diff --git a/tutorial-1/index.html b/tutorial-1/index.html index 4a6e8e0..761ed8d 100644 --- a/tutorial-1/index.html +++ b/tutorial-1/index.html @@ -11,18 +11,18 @@
- + diff --git a/tutorial-1/pixi.js-master/.editorconfig b/tutorial-1/pixi.js-master/.editorconfig deleted file mode 100755 index 347b5a2..0000000 --- a/tutorial-1/pixi.js-master/.editorconfig +++ /dev/null @@ -1,11 +0,0 @@ -; This file is for unifying the coding style for different editors and IDEs. -; More information at http://EditorConfig.org -root = true - -[**.js] -indent_style = space -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true diff --git a/tutorial-1/pixi.js-master/.gitignore b/tutorial-1/pixi.js-master/.gitignore deleted file mode 100755 index 52d83ed..0000000 --- a/tutorial-1/pixi.js-master/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -node_modules -.DS_Store -.project -*.sublime-* -*.log - -bin/pixi.dev.js.map diff --git a/tutorial-1/pixi.js-master/.jshintrc b/tutorial-1/pixi.js-master/.jshintrc deleted file mode 100755 index 08babe8..0000000 --- a/tutorial-1/pixi.js-master/.jshintrc +++ /dev/null @@ -1,127 +0,0 @@ -{ - // -------------------------------------------------------------------- - // JSHint Configuration - // -------------------------------------------------------------------- - // - // @author Chad Engler - - // == Enforcing Options =============================================== - // - // These options tell JSHint to be more strict towards your code. Use - // them if you want to allow only a safe subset of JavaScript, very - // useful when your codebase is shared with a big number of developers - // with different skill levels. - - "bitwise" : false, // Disallow bitwise operators (&, |, ^, etc.). - "camelcase" : true, // Force all variable names to use either camelCase or UPPER_CASE. - "curly" : false, // Require {} for every new block or scope. - "eqeqeq" : true, // Require triple equals i.e. `===`. - "es3" : false, // Enforce conforming to ECMAScript 3. - "forin" : false, // Disallow `for in` loops without `hasOwnPrototype`. - "immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );` - "indent" : 4, // Require that 4 spaces are used for indentation. - "latedef" : true, // Prohibit variable use before definition. - "newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`. - "noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`. - "noempty" : true, // Prohibit use of empty blocks. - "nonew" : true, // Prohibit use of constructors for side-effects. - "plusplus" : false, // Disallow use of `++` & `--`. - "quotmark" : true, // Force consistency when using quote marks. - "undef" : true, // Require all non-global variables be declared before they are used. - "unused" : true, // Warn when varaibles are created by not used. - "strict" : false, // Require `use strict` pragma in every file. - "trailing" : true, // Prohibit trailing whitespaces. - "maxparams" : 8, // Prohibit having more than X number of params in a function. - "maxdepth" : 8, // Prohibit nested blocks from going more than X levels deep. - "maxstatements" : false, // Restrict the number of statements in a function. - "maxcomplexity" : false, // Restrict the cyclomatic complexity of the code. - "maxlen" : 220, // Require that all lines are 100 characters or less. - "globals" : { // Register globals that are used in the code. - //commonjs globals - "module": false, - "require": false, - - // PIXI globals - "PIXI": false, - "spine": false, - - //chai globals - "chai": false, - - //mocha globals - "describe": false, - "it": false, - - //resemble globals - "resemble": false - }, - - // == Relaxing Options ================================================ - // - // These options allow you to suppress certain types of warnings. Use - // them only if you are absolutely positive that you know what you are - // doing. - - "asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons). - "boss" : true, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments. - "debug" : false, // Allow debugger statements e.g. browser breakpoints. - "eqnull" : false, // Tolerate use of `== null`. - "esnext" : false, // Allow ES.next specific features such as `const` and `let`. - "evil" : false, // Tolerate use of `eval`. - "expr" : false, // Tolerate `ExpressionStatement` as Programs. - "funcscope" : false, // Tolerate declarations of variables inside of control structures while accessing them later from the outside. - "globalstrict" : false, // Allow global "use strict" (also enables 'strict'). - "iterator" : false, // Allow usage of __iterator__ property. - "lastsemic" : false, // Tolerate missing semicolons when the it is omitted for the last statement in a one-line block. - "laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons. - "laxcomma" : false, // Suppress warnings about comma-first coding style. - "loopfunc" : false, // Allow functions to be defined within loops. - "moz" : false, // Code that uses Mozilla JS extensions will set this to true - "multistr" : false, // Tolerate multi-line strings. - "proto" : false, // Tolerate __proto__ property. This property is deprecated. - "scripturl" : false, // Tolerate script-targeted URLs. - "smarttabs" : false, // Tolerate mixed tabs and spaces when the latter are used for alignmnent only. - "shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`. - "sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`. - "supernew" : false, // Tolerate `new function () { ... };` and `new Object;`. - "validthis" : false, // Tolerate strict violations when the code is running in strict mode and you use this in a non-constructor function. - - // == Environments ==================================================== - // - // These options pre-define global variables that are exposed by - // popular JavaScript libraries and runtime environments—such as - // browser or node.js. - - "browser" : true, // Standard browser globals e.g. `window`, `document`. - "couch" : false, // Enable globals exposed by CouchDB. - "devel" : false, // Allow development statements e.g. `console.log();`. - "dojo" : false, // Enable globals exposed by Dojo Toolkit. - "jquery" : false, // Enable globals exposed by jQuery JavaScript library. - "mootools" : false, // Enable globals exposed by MooTools JavaScript framework. - "node" : false, // Enable globals available when code is running inside of the NodeJS runtime environment. (for Gruntfile) - "nonstandard" : false, // Define non-standard but widely adopted globals such as escape and unescape. - "prototypejs" : false, // Enable globals exposed by Prototype JavaScript framework. - "rhino" : false, // Enable globals available when your code is running inside of the Rhino runtime environment. - "worker" : false, // Enable globals available when your code is running as a WebWorker. - "wsh" : false, // Enable globals available when your code is running as a script for the Windows Script Host. - "yui" : false, // Enable globals exposed by YUI library. - - // == JSLint Legacy =================================================== - // - // These options are legacy from JSLint. Aside from bug fixes they will - // not be improved in any way and might be removed at any point. - - "nomen" : false, // Prohibit use of initial or trailing underbars in names. - "onevar" : false, // Allow only one `var` statement per function. - "passfail" : false, // Stop on first error. - "white" : false, // Check against strict whitespace and indentation rules. - - // == Undocumented Options ============================================ - // - // While I've found these options in some projects, they are not - // described in the [JSHint Options documentation][4]. - // - // [4]: http://www.jshint.com/options/ - - "maxerr" : 100 // Maximum errors before stopping. -} diff --git a/tutorial-1/pixi.js-master/.travis.yml b/tutorial-1/pixi.js-master/.travis.yml deleted file mode 100755 index 1c60690..0000000 --- a/tutorial-1/pixi.js-master/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: node_js -node_js: - - "0.10" - -branches: - only: - - master - - dev - -install: - - npm install grunt-cli - - npm install - -cache: - directories: - - node_modules - -before_script: - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start - -script: - - ./node_modules/.bin/grunt travis \ No newline at end of file diff --git a/tutorial-1/pixi.js-master/CONTRIBUTING.md b/tutorial-1/pixi.js-master/CONTRIBUTING.md deleted file mode 100755 index ddf5029..0000000 --- a/tutorial-1/pixi.js-master/CONTRIBUTING.md +++ /dev/null @@ -1,62 +0,0 @@ -# How to contribute - -It is essential to the development of pixi.js that the community is empowered -to make changes and get them into the library. Here are some guidlines to make -that process silky smooth for all involved. - -## Reporting issues - -To report a bug, request a feature, or even ask a question, make use of the GitHub Issues -section for [pixi.js][0]. When submitting an issue please take the following steps: - -1. **Seach for existing issues.** Your question or bug may have already been answered or fixed, -be sure to search the issues first before putting in a duplicate issue. - -2. **Create an isolated and reproducible test case.** If you are reporting a bug, make sure you -also have a minimal, runnable, code example that reproduces the problem you have. - -3. **Include a live example.** After narrowing your code down to only the problem areas, make use -of [jsFiddle][1], [jsBin][2], or a link to your live site so that we can view a live example of the problem. - -4. **Share as much information as possible.** Include browser version affected, your OS, version of -the library, steps to reproduce, etc. "X isn't working!!!1!" will probably just be closed. - - -## Making Changes - -To setup for making changes you will need node.js, and grunt installed. You can download node.js -from [nodejs.org][3]. After it has been installed open a console and run `npm i -g grunt-cli` to -install the global `grunt` executable. - -After that you can clone the pixi.js repository, and run `npm i` inside the cloned folder. -This will install dependencies necessary for building the project. Once that is ready, make your -changes and submit a Pull Request. When submitting a PR follow these guidlines: - -- **Send Pull Requests to the `dev` branch.** All Pull Requests must be sent to the `dev` branch, -`master` is the latest release and PRs to that branch will be closed. - -- **Ensure changes are jshint validated.** After making a change be sure to run the build process -to ensure that you didn't break anything. You can do this with `grunt && grunt test` which will run -jshint, rebuild, then run the test suite. - -- **Never commit new builds.** When making a code change, you should always run `grunt` which will -rebuild the project, *however* please do not commit these new builds or your PR will be closed. - -- **Only commit relevant changes.** Don't include changes that are not directly relevant to the fix -you are making. The more focused a PR is, the faster it will get attention and be merged. Extra files -changing only whitespace or trash files will likely get your PR closed. - -## Quickie Code Style Guide - -- Use 4 spaces for tabs, never tab characters. - -- No trailing whitespace, blank lines should have no whitespace. - -- Always favor strict equals `===` unless you *need* to use type coercion. - -- Follow conventions already in the code, and listen to jshint. - -[0]: https://github.com/GoodBoyDigital/pixi.js/issues -[1]: http://jsfiddle.net -[2]: http://jsbin.com/ -[3]: http://nodejs.org \ No newline at end of file diff --git a/tutorial-1/pixi.js-master/Gruntfile.js b/tutorial-1/pixi.js-master/Gruntfile.js deleted file mode 100755 index dda4a9e..0000000 --- a/tutorial-1/pixi.js-master/Gruntfile.js +++ /dev/null @@ -1,227 +0,0 @@ -module.exports = function(grunt) { - grunt.loadNpmTasks('grunt-concat-sourcemap'); - grunt.loadNpmTasks('grunt-contrib-concat'); - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-contrib-connect'); - grunt.loadNpmTasks('grunt-contrib-yuidoc'); - grunt.loadNpmTasks('grunt-contrib-watch'); - - grunt.loadTasks('tasks'); - - var srcFiles = [ - '<%= dirs.src %>/Intro.js', - '<%= dirs.src %>/Pixi.js', - '<%= dirs.src %>/geom/Point.js', - '<%= dirs.src %>/geom/Rectangle.js', - '<%= dirs.src %>/geom/Polygon.js', - '<%= dirs.src %>/geom/Circle.js', - '<%= dirs.src %>/geom/Ellipse.js', - '<%= dirs.src %>/geom/RoundedRectangle.js', - '<%= dirs.src %>/geom/Matrix.js', - '<%= dirs.src %>/display/DisplayObject.js', - '<%= dirs.src %>/display/DisplayObjectContainer.js', - '<%= dirs.src %>/display/Sprite.js', - '<%= dirs.src %>/display/SpriteBatch.js', - '<%= dirs.src %>/display/MovieClip.js', - '<%= dirs.src %>/filters/FilterBlock.js', - '<%= dirs.src %>/text/Text.js', - '<%= dirs.src %>/text/BitmapText.js', - '<%= dirs.src %>/InteractionData.js', - '<%= dirs.src %>/InteractionManager.js', - '<%= dirs.src %>/display/Stage.js', - '<%= dirs.src %>/utils/Utils.js', - '<%= dirs.src %>/utils/EventTarget.js', - '<%= dirs.src %>/utils/Detector.js', - '<%= dirs.src %>/utils/Polyk.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLShaderUtils.js', - '<%= dirs.src %>/renderers/webgl/shaders/PixiShader.js', - '<%= dirs.src %>/renderers/webgl/shaders/PixiFastShader.js', - '<%= dirs.src %>/renderers/webgl/shaders/StripShader.js', - '<%= dirs.src %>/renderers/webgl/shaders/PrimitiveShader.js', - '<%= dirs.src %>/renderers/webgl/shaders/ComplexPrimitiveShader.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLGraphics.js', - '<%= dirs.src %>/renderers/webgl/WebGLRenderer.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLBlendModeManager.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLMaskManager.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLStencilManager.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLShaderManager.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLSpriteBatch.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLFastSpriteBatch.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLFilterManager.js', - '<%= dirs.src %>/renderers/webgl/utils/FilterTexture.js', - '<%= dirs.src %>/renderers/canvas/utils/CanvasBuffer.js', - '<%= dirs.src %>/renderers/canvas/utils/CanvasMaskManager.js', - '<%= dirs.src %>/renderers/canvas/utils/CanvasTinter.js', - '<%= dirs.src %>/renderers/canvas/CanvasRenderer.js', - '<%= dirs.src %>/renderers/canvas/CanvasGraphics.js', - '<%= dirs.src %>/primitives/Graphics.js', - '<%= dirs.src %>/extras/Strip.js', - '<%= dirs.src %>/extras/Rope.js', - '<%= dirs.src %>/extras/TilingSprite.js', - '<%= dirs.src %>/extras/Spine.js', - '<%= dirs.src %>/extras/PIXISpine.js', - '<%= dirs.src %>/textures/BaseTexture.js', - '<%= dirs.src %>/textures/Texture.js', - '<%= dirs.src %>/textures/RenderTexture.js', - '<%= dirs.src %>/textures/VideoTexture.js', - '<%= dirs.src %>/loaders/AssetLoader.js', - '<%= dirs.src %>/loaders/JsonLoader.js', - '<%= dirs.src %>/loaders/AtlasLoader.js', - '<%= dirs.src %>/loaders/SpriteSheetLoader.js', - '<%= dirs.src %>/loaders/ImageLoader.js', - '<%= dirs.src %>/loaders/BitmapFontLoader.js', - '<%= dirs.src %>/loaders/SpineLoader.js', - '<%= dirs.src %>/filters/AbstractFilter.js', - '<%= dirs.src %>/filters/AlphaMaskFilter.js', - '<%= dirs.src %>/filters/ColorMatrixFilter.js', - '<%= dirs.src %>/filters/GrayFilter.js', - '<%= dirs.src %>/filters/DisplacementFilter.js', - '<%= dirs.src %>/filters/PixelateFilter.js', - '<%= dirs.src %>/filters/BlurXFilter.js', - '<%= dirs.src %>/filters/BlurYFilter.js', - '<%= dirs.src %>/filters/BlurFilter.js', - '<%= dirs.src %>/filters/InvertFilter.js', - '<%= dirs.src %>/filters/SepiaFilter.js', - '<%= dirs.src %>/filters/TwistFilter.js', - '<%= dirs.src %>/filters/ColorStepFilter.js', - '<%= dirs.src %>/filters/DotScreenFilter.js', - '<%= dirs.src %>/filters/CrossHatchFilter.js', - '<%= dirs.src %>/filters/RGBSplitFilter.js', - '<%= dirs.src %>/Outro.js' - ], - banner = [ - '/**', - ' * @license', - ' * <%= pkg.name %> - v<%= pkg.version %>', - ' * Copyright (c) 2012-2014, Mat Groves', - ' * <%= pkg.homepage %>', - ' *', - ' * Compiled: <%= grunt.template.today("yyyy-mm-dd") %>', - ' *', - ' * <%= pkg.name %> is licensed under the <%= pkg.license %> License.', - ' * <%= pkg.licenseUrl %>', - ' */', - '' - ].join('\n'); - - grunt.initConfig({ - pkg : grunt.file.readJSON('package.json'), - dirs: { - build: 'bin', - docs: 'docs', - src: 'src/pixi', - test: 'test' - }, - files: { - srcBlob: '<%= dirs.src %>/**/*.js', - testBlob: '<%= dirs.test %>/**/*.js', - testConf: '<%= dirs.test %>/karma.conf.js', - build: '<%= dirs.build %>/pixi.dev.js', - buildMin: '<%= dirs.build %>/pixi.js' - }, - concat: { - options: { - banner: banner - }, - dist: { - src: srcFiles, - dest: '<%= files.build %>' - } - }, - /* jshint -W106 */ - concat_sourcemap: { - dev: { - files: { - '<%= files.build %>': srcFiles - }, - options: { - sourceRoot: '../' - } - } - }, - jshint: { - options: { - jshintrc: './.jshintrc' - }, - source: { - src: srcFiles.concat('Gruntfile.js'), - options: { - ignores: '<%= dirs.src %>/**/{Intro,Outro,Spine,Pixi}.js' - } - }, - test: { - src: ['<%= files.testBlob %>'], - options: { - ignores: '<%= dirs.test %>/lib/resemble.js', - jshintrc: undefined, //don't use jshintrc for tests - expr: true, - undef: false, - camelcase: false - } - } - }, - uglify: { - options: { - banner: banner - }, - dist: { - src: '<%= files.build %>', - dest: '<%= files.buildMin %>' - } - }, - connect: { - test: { - options: { - port: grunt.option('port-test') || 9002, - base: './', - keepalive: true - } - } - }, - yuidoc: { - compile: { - name: '<%= pkg.name %>', - description: '<%= pkg.description %>', - version: '<%= pkg.version %>', - url: '<%= pkg.homepage %>', - logo: '<%= pkg.logo %>', - options: { - paths: '<%= dirs.src %>', - outdir: '<%= dirs.docs %>' - } - } - }, - //Watches and builds for _development_ (source maps) - watch: { - scripts: { - files: ['<%= dirs.src %>/**/*.js'], - tasks: ['concat_sourcemap'], - options: { - spawn: false, - } - } - }, - karma: { - unit: { - configFile: '<%= files.testConf %>', - // browsers: ['Chrome'], - singleRun: true - } - } - }); - - grunt.registerTask('default', ['build', 'test']); - - grunt.registerTask('build', ['jshint:source', 'concat', 'uglify']); - grunt.registerTask('build-debug', ['concat_sourcemap', 'uglify']); - - grunt.registerTask('test', ['concat', 'jshint:test', 'karma']); - - grunt.registerTask('docs', ['yuidoc']); - grunt.registerTask('travis', ['build', 'test']); - - grunt.registerTask('default', ['build', 'test']); - - grunt.registerTask('debug-watch', ['concat_sourcemap', 'watch:debug']); -}; diff --git a/tutorial-1/pixi.js-master/LICENSE b/tutorial-1/pixi.js-master/LICENSE deleted file mode 100755 index 39cbfb0..0000000 --- a/tutorial-1/pixi.js-master/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2013-2015 Mathew Groves - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tutorial-1/pixi.js-master/README.md b/tutorial-1/pixi.js-master/README.md deleted file mode 100755 index 1d3b3d4..0000000 --- a/tutorial-1/pixi.js-master/README.md +++ /dev/null @@ -1,181 +0,0 @@ -Pixi Renderer -============= - -#### *** IMPORTANT - V2 API CHANGES *** #### - -A heads up for anyone updating their version of pixi.js to version 2, as we have changed a couple of bits that you need to be aware of. Fortunately, there are only two changes, and both are small. - -1: Creating a renderer now accepts an options parameter that you can add specific settings to: -``` -// an optional object that contains the settings for the renderer -var options = { - view:myCanvas, - resolution:1 -}; - -var renderer = new PIXI.WebGLRenderer(800, 600, options) -``` - -2: A ```PIXI.RenderTexture``` now accepts a ```PIXI.Matrix``` as its second parameter instead of a point. This gives you much more flexibility: - -``` myRenderTexture.render(myDisplayObject, myMatrix) ``` - -Check out the docs for more info! - - -![pixi.js logo](http://www.goodboydigital.com/pixijs/logo_small.png) - -[](http://www.pixijs.com/projects) -#### JavaScript 2D Renderer #### - -The aim of this project is to provide a fast lightweight 2D library that works -across all devices. The Pixi renderer allows everyone to enjoy the power of -hardware acceleration without prior knowledge of webGL. Also, it's fast. - -If you’re interested in pixi.js then feel free to follow me on twitter -([@doormat23](https://twitter.com/doormat23)) and I will keep you posted! And -of course check back on [our site]() as -any breakthroughs will be posted up there too! - -[![Inline docs](http://inch-ci.org/github/GoodBoyDigital/pixi.js.svg?branch=master)](http://inch-ci.org/github/GoodBoyDigital/pixi.js) -[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/GoodBoyDigital/pixi.js/trend.png)](https://bitdeli.com/free "Bitdeli Badge") - -### Demos ### - -- [WebGL Filters!]() - -- [Run pixie run]() - -- [Fight for Everyone]() - -- [Flash vs HTML]() - -- [Bunny Demo]() - -- [Storm Brewing]() - -- [Filters Demo]() - -- [Render Texture Demo]() - -- [Primitives Demo]() - -- [Masking Demo]() - -- [Interaction Demo]() - -- [photonstorm Balls Demo]() - -- [photonstorm Morph Demo]() - -Thanks to [@photonstorm](https://twitter.com/photonstorm) for providing those -last 2 examples and allowing us to share the source code :) - -### Docs ### - -[Documentation can be found here]() - -### Resources ### - -[Tutorials and other helpful bits]() - -[Pixi.js forum]() - - -### Road Map ### - -* Create a Typescript definition file for Pixi.js -* Implement Flash animation to pixi -* Update Loader so that it support XHR2 if it is available -* Improve the Documentation of the Project -* Create an Asset Loader Tutorial -* Create a MovieClip Tutorial -* Create a small game Tutorial - -### Contribute ### - -Want to be part of the pixi.js project? Great! All are welcome! We will get there quicker together :) -Whether you find a bug, have a great feature request or you fancy owning a task from the road map above feel free to get in touch. - -Make sure to read the [Contributing Guide](https://github.com/GoodBoyDigital/pixi.js/blob/master/CONTRIBUTING.md) -before submitting changes. - -### How to build ### - -PixiJS is built with Grunt. If you don't already have this, go install Node and NPM then install the Grunt Command Line. - -``` -$> npm install -g grunt-cli -``` - -Then, in the folder where you have downloaded the source, install the build dependencies using npm: - -``` -$> npm install -``` - -Then build: - -``` -$> grunt -``` - -This will create a minified version at bin/pixi.js and a non-minified version at bin/pixi.dev.js. - -It also copies the non-minified version to the examples. - -### Current features ### - -- WebGL renderer (with automatic smart batching allowing for REALLY fast performance) -- Canvas renderer (Fastest in town!) -- Full scene graph -- Super easy to use API (similar to the flash display list API) -- Support for texture atlases -- Asset loader / sprite sheet loader -- Auto-detect which renderer should be used -- Full Mouse and Multi-touch Interaction -- Text -- BitmapFont text -- Multiline Text -- Render Texture -- Spine support -- Primitive Drawing -- Masking -- Filters - -### Usage ### - -```javascript - - // You can use either PIXI.WebGLRenderer or PIXI.CanvasRenderer - var renderer = new PIXI.WebGLRenderer(800, 600); - - document.body.appendChild(renderer.view); - - var stage = new PIXI.Stage; - - var bunnyTexture = PIXI.Texture.fromImage("bunny.png"); - var bunny = new PIXI.Sprite(bunnyTexture); - - bunny.position.x = 400; - bunny.position.y = 300; - - bunny.scale.x = 2; - bunny.scale.y = 2; - - stage.addChild(bunny); - - requestAnimationFrame(animate); - - function animate() { - bunny.rotation += 0.01; - - renderer.render(stage); - - requestAnimationFrame(animate); - } -``` - -This content is released under the (http://opensource.org/licenses/MIT) MIT License. - -[![Analytics](https://ga-beacon.appspot.com/UA-39213431-2/pixi.js/index)](https://github.com/igrigorik/ga-beacon) diff --git a/tutorial-1/pixi.js-master/bin/pixi.dev.js b/tutorial-1/pixi.js-master/bin/pixi.dev.js deleted file mode 100755 index c1cf45b..0000000 --- a/tutorial-1/pixi.js-master/bin/pixi.dev.js +++ /dev/null @@ -1,20265 +0,0 @@ -/** - * @license - * pixi.js - v2.2.7 - * Copyright (c) 2012-2014, Mat Groves - * http://goodboydigital.com/ - * - * Compiled: 2015-02-25 - * - * pixi.js is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license.php - */ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -(function(){ - - var root = this; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The [pixi.js](http://www.pixijs.com/) module/namespace. - * - * @module PIXI - */ - -/** - * Namespace-class for [pixi.js](http://www.pixijs.com/). - * - * Contains assorted static properties and enumerations. - * - * @class PIXI - * @static - */ -var PIXI = PIXI || {}; - -/** - * @property {Number} WEBGL_RENDERER - * @protected - * @static - */ -PIXI.WEBGL_RENDERER = 0; -/** - * @property {Number} CANVAS_RENDERER - * @protected - * @static - */ -PIXI.CANVAS_RENDERER = 1; - -/** - * Version of pixi that is loaded. - * @property {String} VERSION - * @static - */ -PIXI.VERSION = "v2.2.7"; - -/** - * Various blend modes supported by pixi. IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes. - * @property {Object} blendModes - * @property {Number} blendModes.NORMAL - * @property {Number} blendModes.ADD - * @property {Number} blendModes.MULTIPLY - * @property {Number} blendModes.SCREEN - * @property {Number} blendModes.OVERLAY - * @property {Number} blendModes.DARKEN - * @property {Number} blendModes.LIGHTEN - * @property {Number} blendModes.COLOR_DODGE - * @property {Number} blendModes.COLOR_BURN - * @property {Number} blendModes.HARD_LIGHT - * @property {Number} blendModes.SOFT_LIGHT - * @property {Number} blendModes.DIFFERENCE - * @property {Number} blendModes.EXCLUSION - * @property {Number} blendModes.HUE - * @property {Number} blendModes.SATURATION - * @property {Number} blendModes.COLOR - * @property {Number} blendModes.LUMINOSITY - * @static - */ -PIXI.blendModes = { - NORMAL:0, - ADD:1, - MULTIPLY:2, - SCREEN:3, - OVERLAY:4, - DARKEN:5, - LIGHTEN:6, - COLOR_DODGE:7, - COLOR_BURN:8, - HARD_LIGHT:9, - SOFT_LIGHT:10, - DIFFERENCE:11, - EXCLUSION:12, - HUE:13, - SATURATION:14, - COLOR:15, - LUMINOSITY:16 -}; - -/** - * The scale modes that are supported by pixi. - * - * The DEFAULT scale mode affects the default scaling mode of future operations. - * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. - * - * @property {Object} scaleModes - * @property {Number} scaleModes.DEFAULT=LINEAR - * @property {Number} scaleModes.LINEAR Smooth scaling - * @property {Number} scaleModes.NEAREST Pixelating scaling - * @static - */ -PIXI.scaleModes = { - DEFAULT:0, - LINEAR:0, - NEAREST:1 -}; - -// used to create uids for various pixi objects.. -PIXI._UID = 0; - -if(typeof(Float32Array) != 'undefined') -{ - PIXI.Float32Array = Float32Array; - PIXI.Uint16Array = Uint16Array; - - // Uint32Array and ArrayBuffer only used by WebGL renderer - // We can suppose that if WebGL is supported then typed arrays are supported too - // as they predate WebGL support for all browsers: - // see typed arrays support: http://caniuse.com/#search=TypedArrays - // see WebGL support: http://caniuse.com/#search=WebGL - PIXI.Uint32Array = Uint32Array; - PIXI.ArrayBuffer = ArrayBuffer; -} -else -{ - PIXI.Float32Array = Array; - PIXI.Uint16Array = Array; -} - -// interaction frequency -PIXI.INTERACTION_FREQUENCY = 30; -PIXI.AUTO_PREVENT_DEFAULT = true; - -/** - * @property {Number} PI_2 - * @static - */ -PIXI.PI_2 = Math.PI * 2; - -/** - * @property {Number} RAD_TO_DEG - * @static - */ -PIXI.RAD_TO_DEG = 180 / Math.PI; - -/** - * @property {Number} DEG_TO_RAD - * @static - */ -PIXI.DEG_TO_RAD = Math.PI / 180; - -/** - * @property {String} RETINA_PREFIX - * @protected - * @static - */ -PIXI.RETINA_PREFIX = "@2x"; -//PIXI.SCALE_PREFIX "@x%%"; - -/** - * If true the default pixi startup (console) banner message will be suppressed. - * - * @property {Boolean} dontSayHello - * @default false - * @static - */ -PIXI.dontSayHello = false; - -/** - * The default render options if none are supplied to - * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. - * - * @property {Object} defaultRenderOptions - * @property {Object} defaultRenderOptions.view=null - * @property {Boolean} defaultRenderOptions.transparent=false - * @property {Boolean} defaultRenderOptions.antialias=false - * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false - * @property {Number} defaultRenderOptions.resolution=1 - * @property {Boolean} defaultRenderOptions.clearBeforeRender=true - * @property {Boolean} defaultRenderOptions.autoResize=false - * @static - */ -PIXI.defaultRenderOptions = { - view:null, - transparent:false, - antialias:false, - preserveDrawingBuffer:false, - resolution:1, - clearBeforeRender:true, - autoResize:false -} - -PIXI.sayHello = function (type) -{ - if(PIXI.dontSayHello)return; - - if ( navigator.userAgent.toLowerCase().indexOf('chrome') > -1 ) - { - var args = [ - '%c %c %c Pixi.js ' + PIXI.VERSION + ' - ' + type + ' %c ' + ' %c ' + ' http://www.pixijs.com/ %c %c ♥%c♥%c♥ ', - 'background: #ff66a5', - 'background: #ff66a5', - 'color: #ff66a5; background: #030307;', - 'background: #ff66a5', - 'background: #ffc3dc', - 'background: #ff66a5', - 'color: #ff2424; background: #fff', - 'color: #ff2424; background: #fff', - 'color: #ff2424; background: #fff' - ]; - - console.log.apply(console, args); - } - else if (window['console']) - { - console.log('Pixi.js ' + PIXI.VERSION + ' - http://www.pixijs.com/'); - } - - PIXI.dontSayHello = true; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis. - * - * @class Point - * @constructor - * @param x {Number} position of the point on the x axis - * @param y {Number} position of the point on the y axis - */ -PIXI.Point = function(x, y) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; -}; - -/** - * Creates a clone of this point - * - * @method clone - * @return {Point} a copy of the point - */ -PIXI.Point.prototype.clone = function() -{ - return new PIXI.Point(this.x, this.y); -}; - -/** - * Sets the point to a new x and y position. - * If y is omitted, both x and y will be set to x. - * - * @method set - * @param [x=0] {Number} position of the point on the x axis - * @param [y=0] {Number} position of the point on the y axis - */ -PIXI.Point.prototype.set = function(x, y) -{ - this.x = x || 0; - this.y = y || ( (y !== 0) ? this.x : 0 ) ; -}; - -// constructor -PIXI.Point.prototype.constructor = PIXI.Point; -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height. - * - * @class Rectangle - * @constructor - * @param x {Number} The X coordinate of the upper-left corner of the rectangle - * @param y {Number} The Y coordinate of the upper-left corner of the rectangle - * @param width {Number} The overall width of this rectangle - * @param height {Number} The overall height of this rectangle - */ -PIXI.Rectangle = function(x, y, width, height) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RECT in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Rectangle - * - * @method clone - * @return {Rectangle} a copy of the rectangle - */ -PIXI.Rectangle.prototype.clone = function() -{ - return new PIXI.Rectangle(this.x, this.y, this.width, this.height); -}; - -/** - * Checks whether the x and y coordinates given are contained within this Rectangle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Rectangle - */ -PIXI.Rectangle.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - var x1 = this.x; - if(x >= x1 && x <= x1 + this.width) - { - var y1 = this.y; - - if(y >= y1 && y <= y1 + this.height) - { - return true; - } - } - - return false; -}; - -// constructor -PIXI.Rectangle.prototype.constructor = PIXI.Rectangle; - -PIXI.EmptyRectangle = new PIXI.Rectangle(0,0,0,0); -/** - * @author Adrien Brault - */ - -/** - * @class Polygon - * @constructor - * @param points* {Array(Point)|Array(Number)|Point...|Number...} This can be an array of Points that form the polygon, - * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be - * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the - * arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are - * Numbers. - */ -PIXI.Polygon = function(points) -{ - //if points isn't an array, use arguments as the array - if(!(points instanceof Array))points = Array.prototype.slice.call(arguments); - - //if this is a flat array of numbers, convert it to points - if(points[0] instanceof PIXI.Point) - { - var p = []; - for(var i = 0, il = points.length; i < il; i++) - { - p.push(points[i].x, points[i].y); - } - - points = p; - } - - this.closed = true; - - /** - * An array of the points of this polygon - * @property points - * @type Array(Point)|Array(Number) - * - */ - this.points = points; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.POLY in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this polygon - * - * @method clone - * @return {Polygon} a copy of the polygon - */ -PIXI.Polygon.prototype.clone = function() -{ - var points = this.points.slice(); - return new PIXI.Polygon(points); -}; - -/** - * Checks whether the x and y coordinates passed to this function are contained within this polygon - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this polygon - */ -PIXI.Polygon.prototype.contains = function(x, y) -{ - var inside = false; - - // use some raycasting to test hits - // https://github.com/substack/point-in-polygon/blob/master/index.js - var length = this.points.length / 2; - - for(var i = 0, j = length - 1; i < length; j = i++) - { - var xi = this.points[i * 2], yi = this.points[i * 2 + 1], - xj = this.points[j * 2], yj = this.points[j * 2 + 1], - intersect = ((yi > y) !== (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi); - - if(intersect) inside = !inside; - } - - return inside; -}; - -// constructor -PIXI.Polygon.prototype.constructor = PIXI.Polygon; - -/** - * @author Chad Engler - */ - -/** - * The Circle object can be used to specify a hit area for displayObjects - * - * @class Circle - * @constructor - * @param x {Number} The X coordinate of the center of this circle - * @param y {Number} The Y coordinate of the center of this circle - * @param radius {Number} The radius of the circle - */ -PIXI.Circle = function(x, y, radius) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property radius - * @type Number - * @default 0 - */ - this.radius = radius || 0; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.CIRC in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Circle instance - * - * @method clone - * @return {Circle} a copy of the Circle - */ -PIXI.Circle.prototype.clone = function() -{ - return new PIXI.Circle(this.x, this.y, this.radius); -}; - -/** - * Checks whether the x and y coordinates given are contained within this circle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Circle - */ -PIXI.Circle.prototype.contains = function(x, y) -{ - if(this.radius <= 0) - return false; - - var dx = (this.x - x), - dy = (this.y - y), - r2 = this.radius * this.radius; - - dx *= dx; - dy *= dy; - - return (dx + dy <= r2); -}; - -/** -* Returns the framing rectangle of the circle as a PIXI.Rectangle object -* -* @method getBounds -* @return {Rectangle} the framing rectangle -*/ -PIXI.Circle.prototype.getBounds = function() -{ - return new PIXI.Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2); -}; - -// constructor -PIXI.Circle.prototype.constructor = PIXI.Circle; - -/** - * @author Chad Engler - */ - -/** - * The Ellipse object can be used to specify a hit area for displayObjects - * - * @class Ellipse - * @constructor - * @param x {Number} The X coordinate of the center of the ellipse - * @param y {Number} The Y coordinate of the center of the ellipse - * @param width {Number} The half width of this ellipse - * @param height {Number} The half height of this ellipse - */ -PIXI.Ellipse = function(x, y, width, height) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.ELIP in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Ellipse instance - * - * @method clone - * @return {Ellipse} a copy of the ellipse - */ -PIXI.Ellipse.prototype.clone = function() -{ - return new PIXI.Ellipse(this.x, this.y, this.width, this.height); -}; - -/** - * Checks whether the x and y coordinates given are contained within this ellipse - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coords are within this ellipse - */ -PIXI.Ellipse.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - //normalize the coords to an ellipse with center 0,0 - var normx = ((x - this.x) / this.width), - normy = ((y - this.y) / this.height); - - normx *= normx; - normy *= normy; - - return (normx + normy <= 1); -}; - -/** -* Returns the framing rectangle of the ellipse as a PIXI.Rectangle object -* -* @method getBounds -* @return {Rectangle} the framing rectangle -*/ -PIXI.Ellipse.prototype.getBounds = function() -{ - return new PIXI.Rectangle(this.x - this.width, this.y - this.height, this.width, this.height); -}; - -// constructor -PIXI.Ellipse.prototype.constructor = PIXI.Ellipse; - -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * The Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height. - * - * @class RoundedRectangle - * @constructor - * @param x {Number} The X coordinate of the upper-left corner of the rounded rectangle - * @param y {Number} The Y coordinate of the upper-left corner of the rounded rectangle - * @param width {Number} The overall width of this rounded rectangle - * @param height {Number} The overall height of this rounded rectangle - * @param radius {Number} Controls the radius of the rounded corners - */ -PIXI.RoundedRectangle = function(x, y, width, height, radius) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - /** - * @property radius - * @type Number - * @default 20 - */ - this.radius = radius || 20; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RRECT in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Rounded Rectangle - * - * @method clone - * @return {RoundedRectangle} a copy of the rounded rectangle - */ -PIXI.RoundedRectangle.prototype.clone = function() -{ - return new PIXI.RoundedRectangle(this.x, this.y, this.width, this.height, this.radius); -}; - -/** - * Checks whether the x and y coordinates given are contained within this Rounded Rectangle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Rounded Rectangle - */ -PIXI.RoundedRectangle.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - var x1 = this.x; - if(x >= x1 && x <= x1 + this.width) - { - var y1 = this.y; - - if(y >= y1 && y <= y1 + this.height) - { - return true; - } - } - - return false; -}; - -// constructor -PIXI.RoundedRectangle.prototype.constructor = PIXI.RoundedRectangle; - - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Matrix class is now an object, which makes it a lot faster, - * here is a representation of it : - * | a | b | tx| - * | c | d | ty| - * | 0 | 0 | 1 | - * - * @class Matrix - * @constructor - */ -PIXI.Matrix = function() -{ - /** - * @property a - * @type Number - * @default 1 - */ - this.a = 1; - - /** - * @property b - * @type Number - * @default 0 - */ - this.b = 0; - - /** - * @property c - * @type Number - * @default 0 - */ - this.c = 0; - - /** - * @property d - * @type Number - * @default 1 - */ - this.d = 1; - - /** - * @property tx - * @type Number - * @default 0 - */ - this.tx = 0; - - /** - * @property ty - * @type Number - * @default 0 - */ - this.ty = 0; -}; - -/** - * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows: - * - * a = array[0] - * b = array[1] - * c = array[3] - * d = array[4] - * tx = array[2] - * ty = array[5] - * - * @method fromArray - * @param array {Array} The array that the matrix will be populated from. - */ -PIXI.Matrix.prototype.fromArray = function(array) -{ - this.a = array[0]; - this.b = array[1]; - this.c = array[3]; - this.d = array[4]; - this.tx = array[2]; - this.ty = array[5]; -}; - -/** - * Creates an array from the current Matrix object. - * - * @method toArray - * @param transpose {Boolean} Whether we need to transpose the matrix or not - * @return {Array} the newly created array which contains the matrix - */ -PIXI.Matrix.prototype.toArray = function(transpose) -{ - if(!this.array) this.array = new PIXI.Float32Array(9); - var array = this.array; - - if(transpose) - { - array[0] = this.a; - array[1] = this.b; - array[2] = 0; - array[3] = this.c; - array[4] = this.d; - array[5] = 0; - array[6] = this.tx; - array[7] = this.ty; - array[8] = 1; - } - else - { - array[0] = this.a; - array[1] = this.c; - array[2] = this.tx; - array[3] = this.b; - array[4] = this.d; - array[5] = this.ty; - array[6] = 0; - array[7] = 0; - array[8] = 1; - } - - return array; -}; - -/** - * Get a new position with the current transformation applied. - * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) - * - * @method apply - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix - */ -PIXI.Matrix.prototype.apply = function(pos, newPos) -{ - newPos = newPos || new PIXI.Point(); - - newPos.x = this.a * pos.x + this.c * pos.y + this.tx; - newPos.y = this.b * pos.x + this.d * pos.y + this.ty; - - return newPos; -}; - -/** - * Get a new position with the inverse of the current transformation applied. - * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) - * - * @method applyInverse - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix - */ -PIXI.Matrix.prototype.applyInverse = function(pos, newPos) -{ - newPos = newPos || new PIXI.Point(); - - var id = 1 / (this.a * this.d + this.c * -this.b); - - newPos.x = this.d * id * pos.x + -this.c * id * pos.y + (this.ty * this.c - this.tx * this.d) * id; - newPos.y = this.a * id * pos.y + -this.b * id * pos.x + (-this.ty * this.a + this.tx * this.b) * id; - - return newPos; -}; - -/** - * Translates the matrix on the x and y. - * - * @method translate - * @param {Number} x - * @param {Number} y - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.translate = function(x, y) -{ - this.tx += x; - this.ty += y; - - return this; -}; - -/** - * Applies a scale transformation to the matrix. - * - * @method scale - * @param {Number} x The amount to scale horizontally - * @param {Number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.scale = function(x, y) -{ - this.a *= x; - this.d *= y; - this.c *= x; - this.b *= y; - this.tx *= x; - this.ty *= y; - - return this; -}; - - -/** - * Applies a rotation transformation to the matrix. - * @method rotate - * @param {Number} angle The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.rotate = function(angle) -{ - var cos = Math.cos( angle ); - var sin = Math.sin( angle ); - - var a1 = this.a; - var c1 = this.c; - var tx1 = this.tx; - - this.a = a1 * cos-this.b * sin; - this.b = a1 * sin+this.b * cos; - this.c = c1 * cos-this.d * sin; - this.d = c1 * sin+this.d * cos; - this.tx = tx1 * cos - this.ty * sin; - this.ty = tx1 * sin + this.ty * cos; - - return this; -}; - -/** - * Appends the given Matrix to this Matrix. - * - * @method append - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. - */ -PIXI.Matrix.prototype.append = function(matrix) -{ - var a1 = this.a; - var b1 = this.b; - var c1 = this.c; - var d1 = this.d; - - this.a = matrix.a * a1 + matrix.b * c1; - this.b = matrix.a * b1 + matrix.b * d1; - this.c = matrix.c * a1 + matrix.d * c1; - this.d = matrix.c * b1 + matrix.d * d1; - - this.tx = matrix.tx * a1 + matrix.ty * c1 + this.tx; - this.ty = matrix.tx * b1 + matrix.ty * d1 + this.ty; - - return this; -}; - -/** - * Resets this Matix to an identity (default) matrix. - * - * @method identity - * @return {Matrix} This matrix. Good for chaining method calls. - */ -PIXI.Matrix.prototype.identity = function() -{ - this.a = 1; - this.b = 0; - this.c = 0; - this.d = 1; - this.tx = 0; - this.ty = 0; - - return this; -}; - -PIXI.identityMatrix = new PIXI.Matrix(); - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The base class for all objects that are rendered on the screen. - * This is an abstract class and should not be used on its own rather it should be extended. - * - * @class DisplayObject - * @constructor - */ -PIXI.DisplayObject = function() -{ - /** - * The coordinate of the object relative to the local coordinates of the parent. - * - * @property position - * @type Point - */ - this.position = new PIXI.Point(); - - /** - * The scale factor of the object. - * - * @property scale - * @type Point - */ - this.scale = new PIXI.Point(1,1);//{x:1, y:1}; - - /** - * The pivot point of the displayObject that it rotates around - * - * @property pivot - * @type Point - */ - this.pivot = new PIXI.Point(0,0); - - /** - * The rotation of the object in radians. - * - * @property rotation - * @type Number - */ - this.rotation = 0; - - /** - * The opacity of the object. - * - * @property alpha - * @type Number - */ - this.alpha = 1; - - /** - * The visibility of the object. - * - * @property visible - * @type Boolean - */ - this.visible = true; - - /** - * This is the defined area that will pick up mouse / touch events. It is null by default. - * Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children) - * - * @property hitArea - * @type Rectangle|Circle|Ellipse|Polygon - */ - this.hitArea = null; - - /** - * This is used to indicate if the displayObject should display a mouse hand cursor on rollover - * - * @property buttonMode - * @type Boolean - */ - this.buttonMode = false; - - /** - * Can this object be rendered - * - * @property renderable - * @type Boolean - */ - this.renderable = false; - - /** - * [read-only] The display object container that contains this display object. - * - * @property parent - * @type DisplayObjectContainer - * @readOnly - */ - this.parent = null; - - /** - * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage. - * - * @property stage - * @type Stage - * @readOnly - */ - this.stage = null; - - /** - * [read-only] The multiplied alpha of the displayObject - * - * @property worldAlpha - * @type Number - * @readOnly - */ - this.worldAlpha = 1; - - /** - * [read-only] Whether or not the object is interactive, do not toggle directly! use the `interactive` property - * - * @property _interactive - * @type Boolean - * @readOnly - * @private - */ - this._interactive = false; - - /** - * This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true - * - * @property defaultCursor - * @type String - * - */ - this.defaultCursor = 'pointer'; - - /** - * [read-only] Current transform of the object based on world (parent) factors - * - * @property worldTransform - * @type Matrix - * @readOnly - * @private - */ - this.worldTransform = new PIXI.Matrix(); - - /** - * cached sin rotation and cos rotation - * - * @property _sr - * @type Number - * @private - */ - this._sr = 0; - - /** - * cached sin rotation and cos rotation - * - * @property _cr - * @type Number - * @private - */ - this._cr = 1; - - /** - * The area the filter is applied to like the hitArea this is used as more of an optimisation - * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle - * - * @property filterArea - * @type Rectangle - */ - this.filterArea = null;//new PIXI.Rectangle(0,0,1,1); - - /** - * The original, cached bounds of the object - * - * @property _bounds - * @type Rectangle - * @private - */ - this._bounds = new PIXI.Rectangle(0, 0, 1, 1); - - /** - * The most up-to-date bounds of the object - * - * @property _currentBounds - * @type Rectangle - * @private - */ - this._currentBounds = null; - - /** - * The original, cached mask of the object - * - * @property _currentBounds - * @type Rectangle - * @private - */ - this._mask = null; - - /** - * Cached internal flag. - * - * @property _cacheAsBitmap - * @type Boolean - * @private - */ - this._cacheAsBitmap = false; - - /** - * Cached internal flag. - * - * @property _cacheIsDirty - * @type Boolean - * @private - */ - this._cacheIsDirty = false; - - - /* - * MOUSE Callbacks - */ - - /** - * A callback that is used when the users mouse rolls over the displayObject - * @method mouseover - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the users mouse leaves the displayObject - * @method mouseout - * @param interactionData {InteractionData} - */ - - //Left button - /** - * A callback that is used when the users clicks on the displayObject with their mouse's left button - * @method click - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user clicks the mouse's left button down over the sprite - * @method mousedown - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's left button that was over the displayObject - * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject - * @method mouseup - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject - * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject - * @method mouseupoutside - * @param interactionData {InteractionData} - */ - - //Right button - /** - * A callback that is used when the users clicks on the displayObject with their mouse's right button - * @method rightclick - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user clicks the mouse's right button down over the sprite - * @method rightdown - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's right button that was over the displayObject - * for this callback to be fired the mouse's right button must have been pressed down over the displayObject - * @method rightup - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject - * for this callback to be fired, the mouse's right button must have been pressed down over the displayObject - * @method rightupoutside - * @param interactionData {InteractionData} - */ - - /* - * TOUCH Callbacks - */ - - /** - * A callback that is used when the users taps on the sprite with their finger - * basically a touch version of click - * @method tap - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user touches over the displayObject - * @method touchstart - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases a touch over the displayObject - * @method touchend - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the touch that was over the displayObject - * for this callback to be fired, The touch must have started over the sprite - * @method touchendoutside - * @param interactionData {InteractionData} - */ -}; - -// constructor -PIXI.DisplayObject.prototype.constructor = PIXI.DisplayObject; - -/** - * Indicates if the sprite will have touch and mouse interactivity. It is false by default - * - * @property interactive - * @type Boolean - * @default false - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'interactive', { - get: function() { - return this._interactive; - }, - set: function(value) { - this._interactive = value; - - // TODO more to be done here.. - // need to sort out a re-crawl! - if(this.stage)this.stage.dirty = true; - } -}); - -/** - * [read-only] Indicates if the sprite is globally visible. - * - * @property worldVisible - * @type Boolean - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'worldVisible', { - get: function() { - var item = this; - - do - { - if(!item.visible)return false; - item = item.parent; - } - while(item); - - return true; - } -}); - -/** - * Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. - * In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. - * To remove a mask, set this property to null. - * - * @property mask - * @type Graphics - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'mask', { - get: function() { - return this._mask; - }, - set: function(value) { - - if(this._mask)this._mask.isMask = false; - this._mask = value; - if(this._mask)this._mask.isMask = true; - } -}); - -/** - * Sets the filters for the displayObject. - * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. - * To remove filters simply set this property to 'null' - * @property filters - * @type Array(Filter) - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { - - get: function() { - return this._filters; - }, - - set: function(value) { - - if(value) - { - // now put all the passes in one place.. - var passes = []; - for (var i = 0; i < value.length; i++) - { - var filterPasses = value[i].passes; - for (var j = 0; j < filterPasses.length; j++) - { - passes.push(filterPasses[j]); - } - } - - // TODO change this as it is legacy - this._filterBlock = {target:this, filterPasses:passes}; - } - - this._filters = value; - } -}); - -/** - * Set if this display object is cached as a bitmap. - * This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. - * To remove simply set this property to 'null' - * @property cacheAsBitmap - * @type Boolean - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'cacheAsBitmap', { - - get: function() { - return this._cacheAsBitmap; - }, - - set: function(value) { - - if(this._cacheAsBitmap === value)return; - - if(value) - { - this._generateCachedSprite(); - } - else - { - this._destroyCachedSprite(); - } - - this._cacheAsBitmap = value; - } -}); - -/* - * Updates the object transform for rendering - * - * @method updateTransform - * @private - */ -PIXI.DisplayObject.prototype.updateTransform = function() -{ - // create some matrix refs for easy access - var pt = this.parent.worldTransform; - var wt = this.worldTransform; - - // temporary matrix variables - var a, b, c, d, tx, ty; - - // so if rotation is between 0 then we can simplify the multiplication process.. - if(this.rotation % PIXI.PI_2) - { - // check to see if the rotation is the same as the previous render. This means we only need to use sin and cos when rotation actually changes - if(this.rotation !== this.rotationCache) - { - this.rotationCache = this.rotation; - this._sr = Math.sin(this.rotation); - this._cr = Math.cos(this.rotation); - } - - // get the matrix values of the displayobject based on its transform properties.. - a = this._cr * this.scale.x; - b = this._sr * this.scale.x; - c = -this._sr * this.scale.y; - d = this._cr * this.scale.y; - tx = this.position.x; - ty = this.position.y; - - // check for pivot.. not often used so geared towards that fact! - if(this.pivot.x || this.pivot.y) - { - tx -= this.pivot.x * a + this.pivot.y * c; - ty -= this.pivot.x * b + this.pivot.y * d; - } - - // concat the parent matrix with the objects transform. - wt.a = a * pt.a + b * pt.c; - wt.b = a * pt.b + b * pt.d; - wt.c = c * pt.a + d * pt.c; - wt.d = c * pt.b + d * pt.d; - wt.tx = tx * pt.a + ty * pt.c + pt.tx; - wt.ty = tx * pt.b + ty * pt.d + pt.ty; - - - } - else - { - // lets do the fast version as we know there is no rotation.. - a = this.scale.x; - d = this.scale.y; - - tx = this.position.x - this.pivot.x * a; - ty = this.position.y - this.pivot.y * d; - - wt.a = a * pt.a; - wt.b = a * pt.b; - wt.c = d * pt.c; - wt.d = d * pt.d; - wt.tx = tx * pt.a + ty * pt.c + pt.tx; - wt.ty = tx * pt.b + ty * pt.d + pt.ty; - } - - // multiply the alphas.. - this.worldAlpha = this.alpha * this.parent.worldAlpha; -}; - -// performance increase to avoid using call.. (10x faster) -PIXI.DisplayObject.prototype.displayObjectUpdateTransform = PIXI.DisplayObject.prototype.updateTransform; - -/** - * Retrieves the bounds of the displayObject as a rectangle object - * - * @method getBounds - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area - */ -PIXI.DisplayObject.prototype.getBounds = function(matrix) -{ - matrix = matrix;//just to get passed js hinting (and preserve inheritance) - return PIXI.EmptyRectangle; -}; - -/** - * Retrieves the local bounds of the displayObject as a rectangle object - * - * @method getLocalBounds - * @return {Rectangle} the rectangular bounding area - */ -PIXI.DisplayObject.prototype.getLocalBounds = function() -{ - return this.getBounds(PIXI.identityMatrix);///PIXI.EmptyRectangle(); -}; - -/** - * Sets the object's stage reference, the stage this object is connected to - * - * @method setStageReference - * @param stage {Stage} the stage that the object will have as its current stage reference - */ -PIXI.DisplayObject.prototype.setStageReference = function(stage) -{ - this.stage = stage; - if(this._interactive)this.stage.dirty = true; -}; - -/** - * Useful function that returns a texture of the displayObject object that can then be used to create sprites - * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. - * - * @method generateTexture - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @return {Texture} a texture of the graphics object - */ -PIXI.DisplayObject.prototype.generateTexture = function(resolution, scaleMode, renderer) -{ - var bounds = this.getLocalBounds(); - - var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0, renderer, scaleMode, resolution); - - PIXI.DisplayObject._tempMatrix.tx = -bounds.x; - PIXI.DisplayObject._tempMatrix.ty = -bounds.y; - - renderTexture.render(this, PIXI.DisplayObject._tempMatrix); - - return renderTexture; -}; - -/** - * Generates and updates the cached sprite for this object. - * - * @method updateCache - */ -PIXI.DisplayObject.prototype.updateCache = function() -{ - this._generateCachedSprite(); -}; - -/** - * Calculates the global position of the display object - * - * @method toGlobal - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object - */ -PIXI.DisplayObject.prototype.toGlobal = function(position) -{ - // don't need to u[date the lot - this.displayObjectUpdateTransform(); - return this.worldTransform.apply(position); -}; - -/** - * Calculates the local position of the display object relative to another point - * - * @method toLocal - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object - */ -PIXI.DisplayObject.prototype.toLocal = function(position, from) -{ - // - if (from) - { - position = from.toGlobal(position); - } - - // don't need to u[date the lot - this.displayObjectUpdateTransform(); - return this.worldTransform.applyInverse(position); -}; - -/** - * Internal method. - * - * @method _renderCachedSprite - * @param renderSession {Object} The render session - * @private - */ -PIXI.DisplayObject.prototype._renderCachedSprite = function(renderSession) -{ - this._cachedSprite.worldAlpha = this.worldAlpha; - - if(renderSession.gl) - { - PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession); - } - else - { - PIXI.Sprite.prototype._renderCanvas.call(this._cachedSprite, renderSession); - } -}; - -/** - * Internal method. - * - * @method _generateCachedSprite - * @private - */ -PIXI.DisplayObject.prototype._generateCachedSprite = function() -{ - this._cacheAsBitmap = false; - var bounds = this.getLocalBounds(); - - if(!this._cachedSprite) - { - var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0);//, renderSession.renderer); - - this._cachedSprite = new PIXI.Sprite(renderTexture); - this._cachedSprite.worldTransform = this.worldTransform; - } - else - { - this._cachedSprite.texture.resize(bounds.width | 0, bounds.height | 0); - } - - //REMOVE filter! - var tempFilters = this._filters; - this._filters = null; - - this._cachedSprite.filters = tempFilters; - - PIXI.DisplayObject._tempMatrix.tx = -bounds.x; - PIXI.DisplayObject._tempMatrix.ty = -bounds.y; - - this._cachedSprite.texture.render(this, PIXI.DisplayObject._tempMatrix, true); - - this._cachedSprite.anchor.x = -( bounds.x / bounds.width ); - this._cachedSprite.anchor.y = -( bounds.y / bounds.height ); - - this._filters = tempFilters; - - this._cacheAsBitmap = true; -}; - -/** -* Destroys the cached sprite. -* -* @method _destroyCachedSprite -* @private -*/ -PIXI.DisplayObject.prototype._destroyCachedSprite = function() -{ - if(!this._cachedSprite)return; - - this._cachedSprite.texture.destroy(true); - - // TODO could be object pooled! - this._cachedSprite = null; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.DisplayObject.prototype._renderWebGL = function(renderSession) -{ - // OVERWRITE; - // this line is just here to pass jshinting :) - renderSession = renderSession; -}; - -/** -* Renders the object using the Canvas renderer -* -* @method _renderCanvas -* @param renderSession {RenderSession} -* @private -*/ -PIXI.DisplayObject.prototype._renderCanvas = function(renderSession) -{ - // OVERWRITE; - // this line is just here to pass jshinting :) - renderSession = renderSession; -}; - - -PIXI.DisplayObject._tempMatrix = new PIXI.Matrix(); - -/** - * The position of the displayObject on the x axis relative to the local coordinates of the parent. - * - * @property x - * @type Number - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'x', { - get: function() { - return this.position.x; - }, - set: function(value) { - this.position.x = value; - } -}); - -/** - * The position of the displayObject on the y axis relative to the local coordinates of the parent. - * - * @property y - * @type Number - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'y', { - get: function() { - return this.position.y; - }, - set: function(value) { - this.position.y = value; - } -}); - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A DisplayObjectContainer represents a collection of display objects. - * It is the base class of all display objects that act as a container for other objects. - * - * @class DisplayObjectContainer - * @extends DisplayObject - * @constructor - */ -PIXI.DisplayObjectContainer = function() -{ - PIXI.DisplayObject.call( this ); - - /** - * [read-only] The array of children of this container. - * - * @property children - * @type Array(DisplayObject) - * @readOnly - */ - this.children = []; - - // fast access to update transform.. - -}; - -// constructor -PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); -PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer; - - -/** - * The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', { - get: function() { - return this.scale.x * this.getLocalBounds().width; - }, - set: function(value) { - - var width = this.getLocalBounds().width; - - if(width !== 0) - { - this.scale.x = value / width; - } - else - { - this.scale.x = 1; - } - - - this._width = value; - } -}); - -/** - * The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', { - get: function() { - return this.scale.y * this.getLocalBounds().height; - }, - set: function(value) { - - var height = this.getLocalBounds().height; - - if(height !== 0) - { - this.scale.y = value / height ; - } - else - { - this.scale.y = 1; - } - - this._height = value; - } -}); - -/** - * Adds a child to the container. - * - * @method addChild - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. - */ -PIXI.DisplayObjectContainer.prototype.addChild = function(child) -{ - return this.addChildAt(child, this.children.length); -}; - -/** - * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown - * - * @method addChildAt - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. - */ -PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) -{ - if(index >= 0 && index <= this.children.length) - { - if(child.parent) - { - child.parent.removeChild(child); - } - - child.parent = this; - - this.children.splice(index, 0, child); - - if(this.stage)child.setStageReference(this.stage); - - return child; - } - else - { - throw new Error(child + 'addChildAt: The index '+ index +' supplied is out of bounds ' + this.children.length); - } -}; - -/** - * Swaps the position of 2 Display Objects within this container. - * - * @method swapChildren - * @param child {DisplayObject} - * @param child2 {DisplayObject} - */ -PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2) -{ - if(child === child2) { - return; - } - - var index1 = this.getChildIndex(child); - var index2 = this.getChildIndex(child2); - - if(index1 < 0 || index2 < 0) { - throw new Error('swapChildren: Both the supplied DisplayObjects must be a child of the caller.'); - } - - this.children[index1] = child2; - this.children[index2] = child; - -}; - -/** - * Returns the index position of a child DisplayObject instance - * - * @method getChildIndex - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify - */ -PIXI.DisplayObjectContainer.prototype.getChildIndex = function(child) -{ - var index = this.children.indexOf(child); - if (index === -1) - { - throw new Error('The supplied DisplayObject must be a child of the caller'); - } - return index; -}; - -/** - * Changes the position of an existing child in the display object container - * - * @method setChildIndex - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object - */ -PIXI.DisplayObjectContainer.prototype.setChildIndex = function(child, index) -{ - if (index < 0 || index >= this.children.length) - { - throw new Error('The supplied index is out of bounds'); - } - var currentIndex = this.getChildIndex(child); - this.children.splice(currentIndex, 1); //remove from old position - this.children.splice(index, 0, child); //add at new position -}; - -/** - * Returns the child at the specified index - * - * @method getChildAt - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child at the given index, if any. - */ -PIXI.DisplayObjectContainer.prototype.getChildAt = function(index) -{ - if (index < 0 || index >= this.children.length) - { - throw new Error('getChildAt: Supplied index '+ index +' does not exist in the child list, or the supplied DisplayObject must be a child of the caller'); - } - return this.children[index]; - -}; - -/** - * Removes a child from the container. - * - * @method removeChild - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. - */ -PIXI.DisplayObjectContainer.prototype.removeChild = function(child) -{ - var index = this.children.indexOf( child ); - if(index === -1)return; - - return this.removeChildAt( index ); -}; - -/** - * Removes a child from the specified index position. - * - * @method removeChildAt - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. - */ -PIXI.DisplayObjectContainer.prototype.removeChildAt = function(index) -{ - var child = this.getChildAt( index ); - if(this.stage) - child.removeStageReference(); - - child.parent = undefined; - this.children.splice( index, 1 ); - return child; -}; - -/** -* Removes all children from this container that are within the begin and end indexes. -* -* @method removeChildren -* @param beginIndex {Number} The beginning position. Default value is 0. -* @param endIndex {Number} The ending position. Default value is size of the container. -*/ -PIXI.DisplayObjectContainer.prototype.removeChildren = function(beginIndex, endIndex) -{ - var begin = beginIndex || 0; - var end = typeof endIndex === 'number' ? endIndex : this.children.length; - var range = end - begin; - - if (range > 0 && range <= end) - { - var removed = this.children.splice(begin, range); - for (var i = 0; i < removed.length; i++) { - var child = removed[i]; - if(this.stage) - child.removeStageReference(); - child.parent = undefined; - } - return removed; - } - else if (range === 0 && this.children.length === 0) - { - return []; - } - else - { - throw new Error( 'removeChildren: Range Error, numeric values are outside the acceptable range' ); - } -}; - -/* - * Updates the transform on all children of this container for rendering - * - * @method updateTransform - * @private - */ -PIXI.DisplayObjectContainer.prototype.updateTransform = function() -{ - if(!this.visible)return; - - this.displayObjectUpdateTransform(); - - //PIXI.DisplayObject.prototype.updateTransform.call( this ); - - if(this._cacheAsBitmap)return; - - for(var i=0,j=this.children.length; i childMaxX ? maxX : childMaxX; - maxY = maxY > childMaxY ? maxY : childMaxY; - } - - if(!childVisible) - return PIXI.EmptyRectangle; - - var bounds = this._bounds; - - bounds.x = minX; - bounds.y = minY; - bounds.width = maxX - minX; - bounds.height = maxY - minY; - - // TODO: store a reference so that if this function gets called again in the render cycle we do not have to recalculate - //this._currentBounds = bounds; - - return bounds; -}; - -/** - * Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration. - * - * @method getLocalBounds - * @return {Rectangle} The rectangular bounding area - */ -PIXI.DisplayObjectContainer.prototype.getLocalBounds = function() -{ - var matrixCache = this.worldTransform; - - this.worldTransform = PIXI.identityMatrix; - - for(var i=0,j=this.children.length; i maxX ? x1 : maxX; - maxX = x2 > maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y1 > maxY ? y1 : maxY; - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - } - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Sprite.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(!this.visible || this.alpha <= 0)return; - - var i,j; - - // do a quick check to see if this element has a mask or a filter. - if(this._mask || this._filters) - { - var spriteBatch = renderSession.spriteBatch; - - // push filter first as we need to ensure the stencil buffer is correct for any masking - if(this._filters) - { - spriteBatch.flush(); - renderSession.filterManager.pushFilter(this._filterBlock); - } - - if(this._mask) - { - spriteBatch.stop(); - renderSession.maskManager.pushMask(this.mask, renderSession); - spriteBatch.start(); - } - - // add this sprite to the batch - spriteBatch.render(this); - - // now loop through the children and make sure they get rendered - for(i=0,j=this.children.length; i= this.textures.length) - { - this.gotoAndStop(this.textures.length - 1); - if(this.onComplete) - { - this.onComplete(); - } - } -}; - -/** - * A short hand way of creating a movieclip from an array of frame ids - * - * @static - * @method fromFrames - * @param frames {Array} the array of frames ids the movieclip will use as its texture frames - * @return {MovieClip} - */ -PIXI.MovieClip.fromFrames = function(frames) -{ - var textures = []; - - for (var i = 0; i < frames.length; i++) - { - textures.push(new PIXI.Texture.fromFrame(frames[i])); - } - - return new PIXI.MovieClip(textures); -}; - -/** - * A short hand way of creating a movieclip from an array of image ids - * - * @static - * @method fromImages - * @param frames {Array} the array of image ids the movieclip will use as its texture frames - * @return {MovieClip} - */ -PIXI.MovieClip.fromImages = function(images) -{ - var textures = []; - - for (var i = 0; i < images.length; i++) - { - textures.push(new PIXI.Texture.fromImage(images[i])); - } - - return new PIXI.MovieClip(textures); -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A target and pass info object for filters. - * - * @class FilterBlock - * @constructor - */ -PIXI.FilterBlock = function() -{ - /** - * The visible state of this FilterBlock. - * - * @property visible - * @type Boolean - */ - this.visible = true; - - /** - * The renderable state of this FilterBlock. - * - * @property renderable - * @type Boolean - */ - this.renderable = true; -}; - -PIXI.FilterBlock.prototype.constructor = PIXI.FilterBlock; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * Modified by Tom Slezakowski http://www.tomslezakowski.com @TomSlezakowski (24/03/2014) - Added dropShadowColor. - */ - -/** - * A Text Object will create a line or multiple lines of text. To split a line you can use '\n' in your text string, - * or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object. - * - * @class Text - * @extends Sprite - * @constructor - * @param text {String} The copy that you would like the text to display - * @param [style] {Object} The style parameters - * @param [style.font] {String} default 'bold 20px Arial' The style and size of the font - * @param [style.fill='black'] {String|Number} A canvas fillstyle that will be used on the text e.g 'red', '#00FF00' - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - * @param [style.stroke] {String|Number} A canvas fillstyle that will be used on the text stroke e.g 'blue', '#FCFF00' - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke) - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap, it needs wordWrap to be set to true - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00' - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow - */ -PIXI.Text = function(text, style) -{ - /** - * The canvas element that everything is drawn to - * - * @property canvas - * @type HTMLCanvasElement - */ - this.canvas = document.createElement('canvas'); - - /** - * The canvas 2d context that everything is drawn with - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.canvas.getContext('2d'); - - /** - * The resolution of the canvas. - * @property resolution - * @type Number - */ - this.resolution = 1; - - PIXI.Sprite.call(this, PIXI.Texture.fromCanvas(this.canvas)); - - this.setText(text); - this.setStyle(style); - -}; - -// constructor -PIXI.Text.prototype = Object.create(PIXI.Sprite.prototype); -PIXI.Text.prototype.constructor = PIXI.Text; - -/** - * The width of the Text, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.Text.prototype, 'width', { - get: function() { - - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - - return this.scale.x * this.texture.frame.width; - }, - set: function(value) { - this.scale.x = value / this.texture.frame.width; - this._width = value; - } -}); - -/** - * The height of the Text, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.Text.prototype, 'height', { - get: function() { - - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - - return this.scale.y * this.texture.frame.height; - }, - set: function(value) { - this.scale.y = value / this.texture.frame.height; - this._height = value; - } -}); - -/** - * Set the style of the text - * - * @method setStyle - * @param [style] {Object} The style parameters - * @param [style.font='bold 20pt Arial'] {String} The style and size of the font - * @param [style.fill='black'] {Object} A canvas fillstyle that will be used on the text eg 'red', '#00FF00' - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - * @param [style.stroke='black'] {String} A canvas fillstyle that will be used on the text stroke eg 'blue', '#FCFF00' - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke) - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00' - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow - */ -PIXI.Text.prototype.setStyle = function(style) -{ - style = style || {}; - style.font = style.font || 'bold 20pt Arial'; - style.fill = style.fill || 'black'; - style.align = style.align || 'left'; - style.stroke = style.stroke || 'black'; //provide a default, see: https://github.com/GoodBoyDigital/pixi.js/issues/136 - style.strokeThickness = style.strokeThickness || 0; - style.wordWrap = style.wordWrap || false; - style.wordWrapWidth = style.wordWrapWidth || 100; - - style.dropShadow = style.dropShadow || false; - style.dropShadowAngle = style.dropShadowAngle || Math.PI / 6; - style.dropShadowDistance = style.dropShadowDistance || 4; - style.dropShadowColor = style.dropShadowColor || 'black'; - - this.style = style; - this.dirty = true; -}; - -/** - * Set the copy for the text object. To split a line you can use '\n'. - * - * @method setText - * @param text {String} The copy that you would like the text to display - */ -PIXI.Text.prototype.setText = function(text) -{ - this.text = text.toString() || ' '; - this.dirty = true; -}; - -/** - * Renders text and updates it when needed - * - * @method updateText - * @private - */ -PIXI.Text.prototype.updateText = function() -{ - this.texture.baseTexture.resolution = this.resolution; - - this.context.font = this.style.font; - - var outputText = this.text; - - // word wrap - // preserve original text - if(this.style.wordWrap)outputText = this.wordWrap(this.text); - - //split text into lines - var lines = outputText.split(/(?:\r\n|\r|\n)/); - - //calculate text width - var lineWidths = []; - var maxLineWidth = 0; - var fontProperties = this.determineFontProperties(this.style.font); - for (var i = 0; i < lines.length; i++) - { - var lineWidth = this.context.measureText(lines[i]).width; - lineWidths[i] = lineWidth; - maxLineWidth = Math.max(maxLineWidth, lineWidth); - } - - var width = maxLineWidth + this.style.strokeThickness; - if(this.style.dropShadow)width += this.style.dropShadowDistance; - - this.canvas.width = ( width + this.context.lineWidth ) * this.resolution; - - //calculate text height - var lineHeight = fontProperties.fontSize + this.style.strokeThickness; - - var height = lineHeight * lines.length; - if(this.style.dropShadow)height += this.style.dropShadowDistance; - - this.canvas.height = height * this.resolution; - - this.context.scale( this.resolution, this.resolution); - - if(navigator.isCocoonJS) this.context.clearRect(0,0,this.canvas.width,this.canvas.height); - - // used for debugging.. - //this.context.fillStyle ="#FF0000" - //this.context.fillRect(0, 0, this.canvas.width,this.canvas.height); - - this.context.font = this.style.font; - this.context.strokeStyle = this.style.stroke; - this.context.lineWidth = this.style.strokeThickness; - this.context.textBaseline = 'alphabetic'; - //this.context.lineJoin = 'round'; - - var linePositionX; - var linePositionY; - - if(this.style.dropShadow) - { - this.context.fillStyle = this.style.dropShadowColor; - - var xShadowOffset = Math.sin(this.style.dropShadowAngle) * this.style.dropShadowDistance; - var yShadowOffset = Math.cos(this.style.dropShadowAngle) * this.style.dropShadowDistance; - - for (i = 0; i < lines.length; i++) - { - linePositionX = this.style.strokeThickness / 2; - linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent; - - if(this.style.align === 'right') - { - linePositionX += maxLineWidth - lineWidths[i]; - } - else if(this.style.align === 'center') - { - linePositionX += (maxLineWidth - lineWidths[i]) / 2; - } - - if(this.style.fill) - { - this.context.fillText(lines[i], linePositionX + xShadowOffset, linePositionY + yShadowOffset); - } - - // if(dropShadow) - } - } - - //set canvas text styles - this.context.fillStyle = this.style.fill; - - //draw lines line by line - for (i = 0; i < lines.length; i++) - { - linePositionX = this.style.strokeThickness / 2; - linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent; - - if(this.style.align === 'right') - { - linePositionX += maxLineWidth - lineWidths[i]; - } - else if(this.style.align === 'center') - { - linePositionX += (maxLineWidth - lineWidths[i]) / 2; - } - - if(this.style.stroke && this.style.strokeThickness) - { - this.context.strokeText(lines[i], linePositionX, linePositionY); - } - - if(this.style.fill) - { - this.context.fillText(lines[i], linePositionX, linePositionY); - } - - // if(dropShadow) - } - - this.updateTexture(); -}; - -/** - * Updates texture size based on canvas size - * - * @method updateTexture - * @private - */ -PIXI.Text.prototype.updateTexture = function() -{ - this.texture.baseTexture.width = this.canvas.width; - this.texture.baseTexture.height = this.canvas.height; - this.texture.crop.width = this.texture.frame.width = this.canvas.width; - this.texture.crop.height = this.texture.frame.height = this.canvas.height; - - this._width = this.canvas.width; - this._height = this.canvas.height; - - // update the dirty base textures - this.texture.baseTexture.dirty(); -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Text.prototype._renderWebGL = function(renderSession) -{ - if(this.dirty) - { - this.resolution = renderSession.resolution; - - this.updateText(); - this.dirty = false; - } - - PIXI.Sprite.prototype._renderWebGL.call(this, renderSession); -}; - -/** -* Renders the object using the Canvas renderer -* -* @method _renderCanvas -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Text.prototype._renderCanvas = function(renderSession) -{ - if(this.dirty) - { - this.resolution = renderSession.resolution; - - this.updateText(); - this.dirty = false; - } - - PIXI.Sprite.prototype._renderCanvas.call(this, renderSession); -}; - -/** -* Calculates the ascent, descent and fontSize of a given fontStyle -* -* @method determineFontProperties -* @param fontStyle {Object} -* @private -*/ -PIXI.Text.prototype.determineFontProperties = function(fontStyle) -{ - var properties = PIXI.Text.fontPropertiesCache[fontStyle]; - - if(!properties) - { - properties = {}; - - var canvas = PIXI.Text.fontPropertiesCanvas; - var context = PIXI.Text.fontPropertiesContext; - - context.font = fontStyle; - - var width = Math.ceil(context.measureText('|Mq').width); - var baseline = Math.ceil(context.measureText('M').width); - var height = 2 * baseline; - - baseline = baseline * 1.4 | 0; - - canvas.width = width; - canvas.height = height; - - context.fillStyle = '#f00'; - context.fillRect(0, 0, width, height); - - context.font = fontStyle; - - context.textBaseline = 'alphabetic'; - context.fillStyle = '#000'; - context.fillText('|MÉq', 0, baseline); - - var imagedata = context.getImageData(0, 0, width, height).data; - var pixels = imagedata.length; - var line = width * 4; - - var i, j; - - var idx = 0; - var stop = false; - - // ascent. scan from top to bottom until we find a non red pixel - for(i = 0; i < baseline; i++) - { - for(j = 0; j < line; j += 4) - { - if(imagedata[idx + j] !== 255) - { - stop = true; - break; - } - } - if(!stop) - { - idx += line; - } - else - { - break; - } - } - - properties.ascent = baseline - i; - - idx = pixels - line; - stop = false; - - // descent. scan from bottom to top until we find a non red pixel - for(i = height; i > baseline; i--) - { - for(j = 0; j < line; j += 4) - { - if(imagedata[idx + j] !== 255) - { - stop = true; - break; - } - } - if(!stop) - { - idx -= line; - } - else - { - break; - } - } - - properties.descent = i - baseline; - //TODO might need a tweak. kind of a temp fix! - properties.descent += 6; - properties.fontSize = properties.ascent + properties.descent; - - PIXI.Text.fontPropertiesCache[fontStyle] = properties; - } - - return properties; -}; - -/** - * Applies newlines to a string to have it optimally fit into the horizontal - * bounds set by the Text object's wordWrapWidth property. - * - * @method wordWrap - * @param text {String} - * @private - */ -PIXI.Text.prototype.wordWrap = function(text) -{ - // Greedy wrapping algorithm that will wrap words as the line grows longer - // than its horizontal bounds. - var result = ''; - var lines = text.split('\n'); - for (var i = 0; i < lines.length; i++) - { - var spaceLeft = this.style.wordWrapWidth; - var words = lines[i].split(' '); - for (var j = 0; j < words.length; j++) - { - var wordWidth = this.context.measureText(words[j]).width; - var wordWidthWithSpace = wordWidth + this.context.measureText(' ').width; - if(j === 0 || wordWidthWithSpace > spaceLeft) - { - // Skip printing the newline if it's the first word of the line that is - // greater than the word wrap width. - if(j > 0) - { - result += '\n'; - } - result += words[j]; - spaceLeft = this.style.wordWrapWidth - wordWidth; - } - else - { - spaceLeft -= wordWidthWithSpace; - result += ' ' + words[j]; - } - } - - if (i < lines.length-1) - { - result += '\n'; - } - } - return result; -}; - -/** -* Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. -* -* @method getBounds -* @param matrix {Matrix} the transformation matrix of the Text -* @return {Rectangle} the framing rectangle -*/ -PIXI.Text.prototype.getBounds = function(matrix) -{ - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - return PIXI.Sprite.prototype.getBounds.call(this, matrix); -}; - -/** - * Destroys this text object. - * - * @method destroy - * @param destroyBaseTexture {Boolean} whether to destroy the base texture as well - */ -PIXI.Text.prototype.destroy = function(destroyBaseTexture) -{ - // make sure to reset the the context and canvas.. dont want this hanging around in memory! - this.context = null; - this.canvas = null; - - this.texture.destroy(destroyBaseTexture === undefined ? true : destroyBaseTexture); -}; - -PIXI.Text.fontPropertiesCache = {}; -PIXI.Text.fontPropertiesCanvas = document.createElement('canvas'); -PIXI.Text.fontPropertiesContext = PIXI.Text.fontPropertiesCanvas.getContext('2d'); - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A BitmapText object will create a line or multiple lines of text using bitmap font. To split a line you can use '\n', '\r' or '\r\n' in your string. - * You can generate the fnt files using - * http://www.angelcode.com/products/bmfont/ for windows or - * http://www.bmglyph.com/ for mac. - * - * @class BitmapText - * @extends DisplayObjectContainer - * @constructor - * @param text {String} The copy that you would like the text to display - * @param style {Object} The style parameters - * @param style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously) - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - */ -PIXI.BitmapText = function(text, style) -{ - PIXI.DisplayObjectContainer.call(this); - - /** - * [read-only] The width of the overall text, different from fontSize, - * which is defined in the style object - * - * @property textWidth - * @type Number - * @readOnly - */ - this.textWidth = 0; - - /** - * [read-only] The height of the overall text, different from fontSize, - * which is defined in the style object - * - * @property textHeight - * @type Number - * @readOnly - */ - this.textHeight = 0; - - /** - * @property _pool - * @type Array - * @private - */ - this._pool = []; - - this.setText(text); - this.setStyle(style); - this.updateText(); - - /** - * The dirty state of this object. - * @property dirty - * @type Boolean - */ - this.dirty = false; -}; - -// constructor -PIXI.BitmapText.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); -PIXI.BitmapText.prototype.constructor = PIXI.BitmapText; - -/** - * Set the text string to be rendered. - * - * @method setText - * @param text {String} The text that you would like displayed - */ -PIXI.BitmapText.prototype.setText = function(text) -{ - this.text = text || ' '; - this.dirty = true; -}; - -/** - * Set the style of the text - * style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously) - * [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single lines of text - * - * @method setStyle - * @param style {Object} The style parameters, contained as properties of an object - */ -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; - this.tint = style.tint; -}; - -/** - * Renders text and updates it when needed - * - * @method updateText - * @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(/(?:\r\n|\r|\n)/.test(this.text.charAt(i))) - { - 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.kerning[prevCharCode]) - { - pos.x += charData.kerning[prevCharCode]; - } - - chars.push({texture:charData.texture, 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); - } - - var lenChildren = this.children.length; - var lenChars = chars.length; - var tint = this.tint || 0xFFFFFF; - - for(i = 0; i < lenChars; i++) - { - var c = i < lenChildren ? this.children[i] : this._pool.pop(); // get old child if have. if not - take from pool. - - if (c) c.setTexture(chars[i].texture); // check if got one before. - else c = new PIXI.Sprite(chars[i].texture); // if no create new one. - - c.position.x = (chars[i].position.x + lineAlignOffsets[chars[i].line]) * scale; - c.position.y = chars[i].position.y * scale; - c.scale.x = c.scale.y = scale; - c.tint = tint; - if (!c.parent) this.addChild(c); - } - - // remove unnecessary children. - // and put their into the pool. - while(this.children.length > lenChars) - { - var child = this.getChildAt(this.children.length - 1); - this._pool.push(child); - this.removeChild(child); - } - - this.textWidth = maxLineWidth * scale; - this.textHeight = (pos.y + data.lineHeight) * scale; -}; - -/** - * Updates the transform of this object - * - * @method updateTransform - * @private - */ -PIXI.BitmapText.prototype.updateTransform = function() -{ - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - PIXI.DisplayObjectContainer.prototype.updateTransform.call(this); -}; - -PIXI.BitmapText.fonts = {}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Holds all information related to an Interaction event - * - * @class InteractionData - * @constructor - */ -PIXI.InteractionData = function() -{ - /** - * This point stores the global coords of where the touch/mouse event happened - * - * @property global - * @type Point - */ - this.global = new PIXI.Point(); - - /** - * The target Sprite that was interacted with - * - * @property target - * @type Sprite - */ - this.target = null; - - /** - * When passed to an event handler, this will be the original DOM Event that was captured - * - * @property originalEvent - * @type Event - */ - this.originalEvent = null; -}; - -/** - * This will return the local coordinates of the specified displayObject for this InteractionData - * - * @method getLocalPosition - * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off - * @param [point] {Point} A Point object in which to store the value, optional (otherwise will create a new point) - * @return {Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject - */ -PIXI.InteractionData.prototype.getLocalPosition = function(displayObject, point) -{ - var worldTransform = displayObject.worldTransform; - var global = this.global; - - // do a cheeky transform to get the mouse coords; - var a00 = worldTransform.a, a01 = worldTransform.c, a02 = worldTransform.tx, - a10 = worldTransform.b, a11 = worldTransform.d, a12 = worldTransform.ty, - id = 1 / (a00 * a11 + a01 * -a10); - - point = point || new PIXI.Point(); - - point.x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id; - point.y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; - - // set the mouse coords... - return point; -}; - -// constructor -PIXI.InteractionData.prototype.constructor = PIXI.InteractionData; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - - /** - * The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive - * if its interactive parameter is set to true - * This manager also supports multitouch. - * - * @class InteractionManager - * @constructor - * @param stage {Stage} The stage to handle interactions - */ -PIXI.InteractionManager = function(stage) -{ - /** - * A reference to the stage - * - * @property stage - * @type Stage - */ - this.stage = stage; - - /** - * The mouse data - * - * @property mouse - * @type InteractionData - */ - this.mouse = new PIXI.InteractionData(); - - /** - * An object that stores current touches (InteractionData) by id reference - * - * @property touches - * @type Object - */ - this.touches = {}; - - /** - * @property tempPoint - * @type Point - * @private - */ - this.tempPoint = new PIXI.Point(); - - /** - * @property mouseoverEnabled - * @type Boolean - * @default - */ - this.mouseoverEnabled = true; - - /** - * Tiny little interactiveData pool ! - * - * @property pool - * @type Array - */ - this.pool = []; - - /** - * An array containing all the iterative items from the our interactive tree - * @property interactiveItems - * @type Array - * @private - */ - this.interactiveItems = []; - - /** - * Our canvas - * @property interactionDOMElement - * @type HTMLCanvasElement - * @private - */ - this.interactionDOMElement = null; - - //this will make it so that you don't have to call bind all the time - - /** - * @property onMouseMove - * @type Function - */ - this.onMouseMove = this.onMouseMove.bind( this ); - - /** - * @property onMouseDown - * @type Function - */ - this.onMouseDown = this.onMouseDown.bind(this); - - /** - * @property onMouseOut - * @type Function - */ - this.onMouseOut = this.onMouseOut.bind(this); - - /** - * @property onMouseUp - * @type Function - */ - this.onMouseUp = this.onMouseUp.bind(this); - - /** - * @property onTouchStart - * @type Function - */ - this.onTouchStart = this.onTouchStart.bind(this); - - /** - * @property onTouchEnd - * @type Function - */ - this.onTouchEnd = this.onTouchEnd.bind(this); - - /** - * @property onTouchCancel - * @type Function - */ - this.onTouchCancel = this.onTouchCancel.bind(this); - - /** - * @property onTouchMove - * @type Function - */ - this.onTouchMove = this.onTouchMove.bind(this); - - /** - * @property last - * @type Number - */ - this.last = 0; - - /** - * The css style of the cursor that is being used - * @property currentCursorStyle - * @type String - */ - this.currentCursorStyle = 'inherit'; - - /** - * Is set to true when the mouse is moved out of the canvas - * @property mouseOut - * @type Boolean - */ - this.mouseOut = false; - - /** - * @property resolution - * @type Number - */ - this.resolution = 1; - - // used for hit testing - this._tempPoint = new PIXI.Point(); -}; - -// constructor -PIXI.InteractionManager.prototype.constructor = PIXI.InteractionManager; - -/** - * Collects an interactive sprite recursively to have their interactions managed - * - * @method collectInteractiveSprite - * @param displayObject {DisplayObject} the displayObject to collect - * @param iParent {DisplayObject} the display object's parent - * @private - */ -PIXI.InteractionManager.prototype.collectInteractiveSprite = function(displayObject, iParent) -{ - var children = displayObject.children; - var length = children.length; - - // make an interaction tree... {item.__interactiveParent} - for (var i = length - 1; i >= 0; i--) - { - var child = children[i]; - - // push all interactive bits - if (child._interactive) - { - iParent.interactiveChildren = true; - //child.__iParent = iParent; - this.interactiveItems.push(child); - - if (child.children.length > 0) { - this.collectInteractiveSprite(child, child); - } - } - else - { - child.__iParent = null; - if (child.children.length > 0) - { - this.collectInteractiveSprite(child, iParent); - } - } - - } -}; - -/** - * Sets the target for event delegation - * - * @method setTarget - * @param target {WebGLRenderer|CanvasRenderer} the renderer to bind events to - * @private - */ -PIXI.InteractionManager.prototype.setTarget = function(target) -{ - this.target = target; - this.resolution = target.resolution; - - // Check if the dom element has been set. If it has don't do anything. - if (this.interactionDOMElement !== null) return; - - this.setTargetDomElement (target.view); -}; - -/** - * Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM - * elements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element - * to receive those events - * - * @method setTargetDomElement - * @param domElement {DOMElement} the DOM element which will receive mouse and touch events - * @private - */ -PIXI.InteractionManager.prototype.setTargetDomElement = function(domElement) -{ - this.removeEvents(); - - if (window.navigator.msPointerEnabled) - { - // time to remove some of that zoom in ja.. - domElement.style['-ms-content-zooming'] = 'none'; - domElement.style['-ms-touch-action'] = 'none'; - } - - this.interactionDOMElement = domElement; - - domElement.addEventListener('mousemove', this.onMouseMove, true); - domElement.addEventListener('mousedown', this.onMouseDown, true); - domElement.addEventListener('mouseout', this.onMouseOut, true); - - // aint no multi touch just yet! - domElement.addEventListener('touchstart', this.onTouchStart, true); - domElement.addEventListener('touchend', this.onTouchEnd, true); - domElement.addEventListener('touchleave', this.onTouchCancel, true); - domElement.addEventListener('touchcancel', this.onTouchCancel, true); - domElement.addEventListener('touchmove', this.onTouchMove, true); - - window.addEventListener('mouseup', this.onMouseUp, true); -}; - -/** - * @method removeEvents - * @private - */ -PIXI.InteractionManager.prototype.removeEvents = function() -{ - if (!this.interactionDOMElement) return; - - this.interactionDOMElement.style['-ms-content-zooming'] = ''; - this.interactionDOMElement.style['-ms-touch-action'] = ''; - - this.interactionDOMElement.removeEventListener('mousemove', this.onMouseMove, true); - this.interactionDOMElement.removeEventListener('mousedown', this.onMouseDown, true); - this.interactionDOMElement.removeEventListener('mouseout', this.onMouseOut, true); - - // aint no multi touch just yet! - this.interactionDOMElement.removeEventListener('touchstart', this.onTouchStart, true); - this.interactionDOMElement.removeEventListener('touchend', this.onTouchEnd, true); - this.interactionDOMElement.removeEventListener('touchleave', this.onTouchCancel, true); - this.interactionDOMElement.removeEventListener('touchcancel', this.onTouchCancel, true); - this.interactionDOMElement.removeEventListener('touchmove', this.onTouchMove, true); - - this.interactionDOMElement = null; - - window.removeEventListener('mouseup', this.onMouseUp, true); -}; - -/** - * updates the state of interactive objects - * - * @method update - * @private - */ -PIXI.InteractionManager.prototype.update = function() -{ - if (!this.target) return; - - // frequency of 30fps?? - var now = Date.now(); - var diff = now - this.last; - diff = (diff * PIXI.INTERACTION_FREQUENCY ) / 1000; - if (diff < 1) return; - this.last = now; - - var i = 0; - - // ok.. so mouse events?? - // yes for now :) - // OPTIMISE - how often to check?? - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - // loop through interactive objects! - var length = this.interactiveItems.length; - var cursor = 'inherit'; - var over = false; - - for (i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - // OPTIMISATION - only calculate every time if the mousemove function exists.. - // OK so.. does the object have any other interactive functions? - // hit-test the clip! - // if (item.mouseover || item.mouseout || item.buttonMode) - // { - // ok so there are some functions so lets hit test it.. - item.__hit = this.hitTest(item, this.mouse); - this.mouse.target = item; - // ok so deal with interactions.. - // looks like there was a hit! - if (item.__hit && !over) - { - if (item.buttonMode) cursor = item.defaultCursor; - - if (!item.interactiveChildren) - { - over = true; - } - - if (!item.__isOver) - { - if (item.mouseover) - { - item.mouseover (this.mouse); - } - item.__isOver = true; - } - } - else - { - if (item.__isOver) - { - // roll out! - if (item.mouseout) - { - item.mouseout (this.mouse); - } - item.__isOver = false; - } - } - } - - if (this.currentCursorStyle !== cursor) - { - this.currentCursorStyle = cursor; - this.interactionDOMElement.style.cursor = cursor; - } -}; - -/** - * @method rebuildInteractiveGraph - * @private - */ -PIXI.InteractionManager.prototype.rebuildInteractiveGraph = function() -{ - this.dirty = false; - - var len = this.interactiveItems.length; - - for (var i = 0; i < len; i++) { - this.interactiveItems[i].interactiveChildren = false; - } - - this.interactiveItems = []; - - if (this.stage.interactive) - { - this.interactiveItems.push(this.stage); - } - - // Go through and collect all the objects that are interactive.. - this.collectInteractiveSprite(this.stage, this.stage); -}; - -/** - * Is called when the mouse moves across the renderer element - * - * @method onMouseMove - * @param event {Event} The DOM event of the mouse moving - * @private - */ -PIXI.InteractionManager.prototype.onMouseMove = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - // TODO optimize by not check EVERY TIME! maybe half as often? // - var rect = this.interactionDOMElement.getBoundingClientRect(); - - this.mouse.global.x = (event.clientX - rect.left) * (this.target.width / rect.width) / this.resolution; - this.mouse.global.y = (event.clientY - rect.top) * ( this.target.height / rect.height) / this.resolution; - - var length = this.interactiveItems.length; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - // Call the function! - if (item.mousemove) - { - item.mousemove(this.mouse); - } - } -}; - -/** - * Is called when the mouse button is pressed down on the renderer element - * - * @method onMouseDown - * @param event {Event} The DOM event of a mouse button being pressed down - * @private - */ -PIXI.InteractionManager.prototype.onMouseDown = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - if (PIXI.AUTO_PREVENT_DEFAULT) - { - this.mouse.originalEvent.preventDefault(); - } - - // loop through interaction tree... - // hit test each item! -> - // get interactive items under point?? - //stage.__i - var length = this.interactiveItems.length; - - var e = this.mouse.originalEvent; - var isRightButton = e.button === 2 || e.which === 3; - var downFunction = isRightButton ? 'rightdown' : 'mousedown'; - var clickFunction = isRightButton ? 'rightclick' : 'click'; - var buttonIsDown = isRightButton ? '__rightIsDown' : '__mouseIsDown'; - var isDown = isRightButton ? '__isRightDown' : '__isDown'; - - // while - // hit test - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - if (item[downFunction] || item[clickFunction]) - { - item[buttonIsDown] = true; - item.__hit = this.hitTest(item, this.mouse); - - if (item.__hit) - { - //call the function! - if (item[downFunction]) - { - item[downFunction](this.mouse); - } - item[isDown] = true; - - // just the one! - if (!item.interactiveChildren) break; - } - } - } -}; - -/** - * Is called when the mouse is moved out of the renderer element - * - * @method onMouseOut - * @param event {Event} The DOM event of a mouse being moved out - * @private - */ -PIXI.InteractionManager.prototype.onMouseOut = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - var length = this.interactiveItems.length; - - this.interactionDOMElement.style.cursor = 'inherit'; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - if (item.__isOver) - { - this.mouse.target = item; - if (item.mouseout) - { - item.mouseout(this.mouse); - } - item.__isOver = false; - } - } - - this.mouseOut = true; - - // move the mouse to an impossible position - this.mouse.global.x = -10000; - this.mouse.global.y = -10000; -}; - -/** - * Is called when the mouse button is released on the renderer element - * - * @method onMouseUp - * @param event {Event} The DOM event of a mouse button being released - * @private - */ -PIXI.InteractionManager.prototype.onMouseUp = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - var length = this.interactiveItems.length; - var up = false; - - var e = this.mouse.originalEvent; - var isRightButton = e.button === 2 || e.which === 3; - - var upFunction = isRightButton ? 'rightup' : 'mouseup'; - var clickFunction = isRightButton ? 'rightclick' : 'click'; - var upOutsideFunction = isRightButton ? 'rightupoutside' : 'mouseupoutside'; - var isDown = isRightButton ? '__isRightDown' : '__isDown'; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - if (item[clickFunction] || item[upFunction] || item[upOutsideFunction]) - { - item.__hit = this.hitTest(item, this.mouse); - - if (item.__hit && !up) - { - //call the function! - if (item[upFunction]) - { - item[upFunction](this.mouse); - } - if (item[isDown]) - { - if (item[clickFunction]) - { - item[clickFunction](this.mouse); - } - } - - if (!item.interactiveChildren) - { - up = true; - } - } - else - { - if (item[isDown]) - { - if (item[upOutsideFunction]) item[upOutsideFunction](this.mouse); - } - } - - item[isDown] = false; - } - } -}; - -/** - * Tests if the current mouse coordinates hit a sprite - * - * @method hitTest - * @param item {DisplayObject} The displayObject to test for a hit - * @param interactionData {InteractionData} The interactionData object to update in the case there is a hit - * @private - */ -PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) -{ - var global = interactionData.global; - - if (!item.worldVisible) - { - return false; - } - - // map the global point to local space. - item.worldTransform.applyInverse(global, this._tempPoint); - - var x = this._tempPoint.x, - y = this._tempPoint.y, - i; - - interactionData.target = item; - - //a sprite or display object with a hit area defined - if (item.hitArea && item.hitArea.contains) - { - return item.hitArea.contains(x, y); - } - // a sprite with no hitarea defined - else if(item instanceof PIXI.Sprite) - { - var width = item.texture.frame.width; - var height = item.texture.frame.height; - var x1 = -width * item.anchor.x; - var y1; - - if (x > x1 && x < x1 + width) - { - y1 = -height * item.anchor.y; - - if (y > y1 && y < y1 + height) - { - // set the target property if a hit is true! - return true; - } - } - } - else if(item instanceof PIXI.Graphics) - { - var graphicsData = item.graphicsData; - for (i = 0; i < graphicsData.length; i++) - { - var data = graphicsData[i]; - if(!data.fill)continue; - - // only deal with fills.. - if(data.shape) - { - if(data.shape.contains(x, y)) - { - //interactionData.target = item; - return true; - } - } - } - } - - var length = item.children.length; - - for (i = 0; i < length; i++) - { - var tempItem = item.children[i]; - var hit = this.hitTest(tempItem, interactionData); - if (hit) - { - // hmm.. TODO SET CORRECT TARGET? - interactionData.target = item; - return true; - } - } - return false; -}; - -/** - * Is called when a touch is moved across the renderer element - * - * @method onTouchMove - * @param event {Event} The DOM event of a touch moving across the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchMove = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - var touchData; - var i = 0; - - for (i = 0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - touchData = this.touches[touchEvent.identifier]; - touchData.originalEvent = event; - - // update the touch position - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - for (var j = 0; j < this.interactiveItems.length; j++) - { - var item = this.interactiveItems[j]; - if (item.touchmove && item.__touchData && item.__touchData[touchEvent.identifier]) - { - item.touchmove(touchData); - } - } - } -}; - -/** - * Is called when a touch is started on the renderer element - * - * @method onTouchStart - * @param event {Event} The DOM event of a touch starting on the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchStart = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - - if (PIXI.AUTO_PREVENT_DEFAULT) - { - event.preventDefault(); - } - - var changedTouches = event.changedTouches; - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - - var touchData = this.pool.pop(); - if (!touchData) - { - touchData = new PIXI.InteractionData(); - } - - touchData.originalEvent = event; - - this.touches[touchEvent.identifier] = touchData; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.touchstart || item.tap) - { - item.__hit = this.hitTest(item, touchData); - - if (item.__hit) - { - //call the function! - if (item.touchstart)item.touchstart(touchData); - item.__isDown = true; - item.__touchData = item.__touchData || {}; - item.__touchData[touchEvent.identifier] = touchData; - - if (!item.interactiveChildren) break; - } - } - } - } -}; - -/** - * Is called when a touch is ended on the renderer element - * - * @method onTouchEnd - * @param event {Event} The DOM event of a touch ending on the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchEnd = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - var touchData = this.touches[touchEvent.identifier]; - var up = false; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.__touchData && item.__touchData[touchEvent.identifier]) - { - - item.__hit = this.hitTest(item, item.__touchData[touchEvent.identifier]); - - // so this one WAS down... - touchData.originalEvent = event; - // hitTest?? - - if (item.touchend || item.tap) - { - if (item.__hit && !up) - { - if (item.touchend) - { - item.touchend(touchData); - } - if (item.__isDown && item.tap) - { - item.tap(touchData); - } - if (!item.interactiveChildren) - { - up = true; - } - } - else - { - if (item.__isDown && item.touchendoutside) - { - item.touchendoutside(touchData); - } - } - - item.__isDown = false; - } - - item.__touchData[touchEvent.identifier] = null; - } - } - // remove the touch.. - this.pool.push(touchData); - this.touches[touchEvent.identifier] = null; - } -}; - -/** - * Is called when a touch is canceled - * - * @method onTouchCancel - * @param event {Event} The DOM event of a touch canceled - * @private - */ -PIXI.InteractionManager.prototype.onTouchCancel = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - var touchData = this.touches[touchEvent.identifier]; - var up = false; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.__touchData && item.__touchData[touchEvent.identifier]) - { - - item.__hit = this.hitTest(item, item.__touchData[touchEvent.identifier]); - - // so this one WAS down... - touchData.originalEvent = event; - // hitTest?? - - if (item.touchcancel && !up) - { - item.touchcancel(touchData); - if (!item.interactiveChildren) - { - up = true; - } - } - - item.__isDown = false; - item.__touchData[touchEvent.identifier] = null; - } - } - // remove the touch.. - this.pool.push(touchData); - this.touches[touchEvent.identifier] = null; - } -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A Stage represents the root of the display tree. Everything connected to the stage is rendered - * - * @class Stage - * @extends DisplayObjectContainer - * @constructor - * @param backgroundColor {Number} the background color of the stage, you have to pass this in is in hex format - * like: 0xFFFFFF for white - * - * Creating a stage is a mandatory process when you use Pixi, which is as simple as this : - * var stage = new PIXI.Stage(0xFFFFFF); - * where the parameter given is the background colour of the stage, in hex - * you will use this stage instance to add your sprites to it and therefore to the renderer - * Here is how to add a sprite to the stage : - * stage.addChild(sprite); - */ -PIXI.Stage = function(backgroundColor) -{ - PIXI.DisplayObjectContainer.call( this ); - - /** - * [read-only] Current transform of the object based on world (parent) factors - * - * @property worldTransform - * @type Matrix - * @readOnly - * @private - */ - this.worldTransform = new PIXI.Matrix(); - - /** - * Whether or not the stage is interactive - * - * @property interactive - * @type Boolean - */ - this.interactive = true; - - /** - * The interaction manage for this stage, manages all interactive activity on the stage - * - * @property interactionManager - * @type InteractionManager - */ - this.interactionManager = new PIXI.InteractionManager(this); - - /** - * Whether the stage is dirty and needs to have interactions updated - * - * @property dirty - * @type Boolean - * @private - */ - this.dirty = true; - - //the stage is its own stage - this.stage = this; - - //optimize hit detection a bit - this.stage.hitArea = new PIXI.Rectangle(0, 0, 100000, 100000); - - this.setBackgroundColor(backgroundColor); -}; - -// constructor -PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); -PIXI.Stage.prototype.constructor = PIXI.Stage; - -/** - * Sets another DOM element which can receive mouse/touch interactions instead of the default Canvas element. - * This is useful for when you have other DOM elements on top of the Canvas element. - * - * @method setInteractionDelegate - * @param domElement {DOMElement} This new domElement which will receive mouse/touch events - */ -PIXI.Stage.prototype.setInteractionDelegate = function(domElement) -{ - this.interactionManager.setTargetDomElement( domElement ); -}; - -/* - * Updates the object transform for rendering - * - * @method updateTransform - * @private - */ -PIXI.Stage.prototype.updateTransform = function() -{ - this.worldAlpha = 1; - - for(var i=0,j=this.children.length; i> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255]; -}; - -/** - * Converts a color as an [R, G, B] array to a hex number - * - * @method rgb2hex - * @param rgb {Array} - */ -PIXI.rgb2hex = function(rgb) { - return ((rgb[0]*255 << 16) + (rgb[1]*255 << 8) + rgb[2]*255); -}; - -/** - * A polyfill for Function.prototype.bind - * - * @method bind - */ -if (typeof Function.prototype.bind !== 'function') { - Function.prototype.bind = (function () { - return function (thisArg) { - var target = this, i = arguments.length - 1, boundArgs = []; - if (i > 0) - { - boundArgs.length = i; - while (i--) boundArgs[i] = arguments[i + 1]; - } - - if (typeof target !== 'function') throw new TypeError(); - - function bound() { - var i = arguments.length, args = new Array(i); - while (i--) args[i] = arguments[i]; - args = boundArgs.concat(args); - return target.apply(this instanceof bound ? this : thisArg, args); - } - - bound.prototype = (function F(proto) { - if (proto) F.prototype = proto; - if (!(this instanceof F)) return new F(); - })(target.prototype); - - return bound; - }; - })(); -} - -/** - * A wrapper for ajax requests to be handled cross browser - * - * @class AjaxRequest - * @constructor - */ -PIXI.AjaxRequest = function() -{ - var activexmodes = ['Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.3.0', 'Microsoft.XMLHTTP']; //activeX versions to check for in IE - - if (window.ActiveXObject) - { //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken) - for (var i=0; i 0 && (number & (number - 1)) === 0) // see: http://goo.gl/D9kPj - return number; - else - { - var result = 1; - while (result < number) result <<= 1; - return result; - } -}; - -/** - * checks if the given width and height make a power of two texture - * @method isPowerOfTwo - * @param width {Number} - * @param height {Number} - * @return {Boolean} - */ -PIXI.isPowerOfTwo = function(width, height) -{ - return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0); - -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * @author Chad Engler https://github.com/englercj @Rolnaaba - */ - -/** - * Originally based on https://github.com/mrdoob/eventtarget.js/ from mr Doob. - * Currently takes inspiration from the nodejs EventEmitter, EventEmitter3, and smokesignals - */ - -/** - * Mixins event emitter functionality to a class - * - * @class EventTarget - * @example - * function MyEmitter() {} - * - * PIXI.EventTarget.mixin(MyEmitter.prototype); - * - * var em = new MyEmitter(); - * em.emit('eventName', 'some data', 'some more data', {}, null, ...); - */ -PIXI.EventTarget = { - /** - * Backward compat from when this used to be a function - */ - call: function callCompat(obj) { - if(obj) { - obj = obj.prototype || obj; - PIXI.EventTarget.mixin(obj); - } - }, - - /** - * Mixes in the properties of the EventTarget prototype onto another object - * - * @method mixin - * @param object {Object} The obj to mix into - */ - mixin: function mixin(obj) { - /** - * Return a list of assigned event listeners. - * - * @method listeners - * @param eventName {String} The events that should be listed. - * @return {Array} An array of listener functions - */ - obj.listeners = function listeners(eventName) { - this._listeners = this._listeners || {}; - - return this._listeners[eventName] ? this._listeners[eventName].slice() : []; - }; - - /** - * Emit an event to all registered event listeners. - * - * @method emit - * @alias dispatchEvent - * @param eventName {String} The name of the event. - * @return {Boolean} Indication if we've emitted an event. - */ - obj.emit = obj.dispatchEvent = function emit(eventName, data) { - this._listeners = this._listeners || {}; - - //backwards compat with old method ".emit({ type: 'something' })" - if(typeof eventName === 'object') { - data = eventName; - eventName = eventName.type; - } - - //ensure we are using a real pixi event - if(!data || data.__isEventObject !== true) { - data = new PIXI.Event(this, eventName, data); - } - - //iterate the listeners - if(this._listeners && this._listeners[eventName]) { - var listeners = this._listeners[eventName].slice(0), - length = listeners.length, - fn = listeners[0], - i; - - for(i = 0; i < length; fn = listeners[++i]) { - //call the event listener - fn.call(this, data); - - //if "stopImmediatePropagation" is called, stop calling sibling events - if(data.stoppedImmediate) { - return this; - } - } - - //if "stopPropagation" is called then don't bubble the event - if(data.stopped) { - return this; - } - } - - //bubble this event up the scene graph - if(this.parent && this.parent.emit) { - this.parent.emit.call(this.parent, eventName, data); - } - - return this; - }; - - /** - * Register a new EventListener for the given event. - * - * @method on - * @alias addEventListener - * @param eventName {String} Name of the event. - * @param callback {Functon} fn Callback function. - */ - obj.on = obj.addEventListener = function on(eventName, fn) { - this._listeners = this._listeners || {}; - - (this._listeners[eventName] = this._listeners[eventName] || []) - .push(fn); - - return this; - }; - - /** - * Add an EventListener that's only called once. - * - * @method once - * @param eventName {String} Name of the event. - * @param callback {Function} Callback function. - */ - obj.once = function once(eventName, fn) { - this._listeners = this._listeners || {}; - - var self = this; - function onceHandlerWrapper() { - fn.apply(self.off(eventName, onceHandlerWrapper), arguments); - } - onceHandlerWrapper._originalHandler = fn; - - return this.on(eventName, onceHandlerWrapper); - }; - - /** - * Remove event listeners. - * - * @method off - * @alias removeEventListener - * @param eventName {String} The event we want to remove. - * @param callback {Function} The listener that we need to find. - */ - obj.off = obj.removeEventListener = function off(eventName, fn) { - this._listeners = this._listeners || {}; - - if(!this._listeners[eventName]) - return this; - - var list = this._listeners[eventName], - i = fn ? list.length : 0; - - while(i-- > 0) { - if(list[i] === fn || list[i]._originalHandler === fn) { - list.splice(i, 1); - } - } - - if(list.length === 0) { - delete this._listeners[eventName]; - } - - return this; - }; - - /** - * Remove all listeners or only the listeners for the specified event. - * - * @method removeAllListeners - * @param eventName {String} The event you want to remove all listeners for. - */ - obj.removeAllListeners = function removeAllListeners(eventName) { - this._listeners = this._listeners || {}; - - if(!this._listeners[eventName]) - return this; - - delete this._listeners[eventName]; - - return this; - }; - } -}; - -/** - * Creates an homogenous object for tracking events so users can know what to expect. - * - * @class Event - * @extends Object - * @constructor - * @param target {Object} The target object that the event is called on - * @param name {String} The string name of the event that was triggered - * @param data {Object} Arbitrary event data to pass along - */ -PIXI.Event = function(target, name, data) { - //for duck typing in the ".on()" function - this.__isEventObject = true; - - /** - * Tracks the state of bubbling propagation. Do not - * set this directly, instead use `event.stopPropagation()` - * - * @property stopped - * @type Boolean - * @private - * @readOnly - */ - this.stopped = false; - - /** - * Tracks the state of sibling listener propagation. Do not - * set this directly, instead use `event.stopImmediatePropagation()` - * - * @property stoppedImmediate - * @type Boolean - * @private - * @readOnly - */ - this.stoppedImmediate = false; - - /** - * The original target the event triggered on. - * - * @property target - * @type Object - * @readOnly - */ - this.target = target; - - /** - * The string name of the event that this represents. - * - * @property type - * @type String - * @readOnly - */ - this.type = name; - - /** - * The data that was passed in with this event. - * - * @property data - * @type Object - * @readOnly - */ - this.data = data; - - //backwards compat with older version of events - this.content = data; - - /** - * The timestamp when the event occurred. - * - * @property timeStamp - * @type Number - * @readOnly - */ - this.timeStamp = Date.now(); -}; - -/** - * Stops the propagation of events up the scene graph (prevents bubbling). - * - * @method stopPropagation - */ -PIXI.Event.prototype.stopPropagation = function stopPropagation() { - this.stopped = true; -}; - -/** - * Stops the propagation of events to sibling listeners (no longer calls any listeners). - * - * @method stopImmediatePropagation - */ -PIXI.Event.prototype.stopImmediatePropagation = function stopImmediatePropagation() { - this.stoppedImmediate = true; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This helper function will automatically detect which renderer you should be using. - * WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by - * the browser then this function will return a canvas renderer - * - * @method autoDetectRenderer - * @for PIXI - * @static - * @param width=800 {Number} the width of the renderers view - * @param height=600 {Number} the height of the renderers view - * - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * - */ -PIXI.autoDetectRenderer = function(width, height, options) -{ - if(!width)width = 800; - if(!height)height = 600; - - // BORROWED from Mr Doob (mrdoob.com) - var webgl = ( function () { try { - var canvas = document.createElement( 'canvas' ); - return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ); - } catch( e ) { - return false; - } - } )(); - - if( webgl ) - { - return new PIXI.WebGLRenderer(width, height, options); - } - - return new PIXI.CanvasRenderer(width, height, options); -}; - -/** - * This helper function will automatically detect which renderer you should be using. - * This function is very similar to the autoDetectRenderer function except that is will return a canvas renderer for android. - * Even thought both android chrome supports webGL the canvas implementation perform better at the time of writing. - * This function will likely change and update as webGL performance improves on these devices. - * - * @method autoDetectRecommendedRenderer - * @for PIXI - * @static - * @param width=800 {Number} the width of the renderers view - * @param height=600 {Number} the height of the renderers view - * - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * - */ -PIXI.autoDetectRecommendedRenderer = function(width, height, options) -{ - if(!width)width = 800; - if(!height)height = 600; - - // BORROWED from Mr Doob (mrdoob.com) - var webgl = ( function () { try { - var canvas = document.createElement( 'canvas' ); - return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ); - } catch( e ) { - return false; - } - } )(); - - var isAndroid = /Android/i.test(navigator.userAgent); - - if( webgl && !isAndroid) - { - return new PIXI.WebGLRenderer(width, height, options); - } - - return new PIXI.CanvasRenderer(width, height, options); -}; - -/* - PolyK library - url: http://polyk.ivank.net - Released under MIT licence. - - Copyright (c) 2012 Ivan Kuckir - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation - files (the "Software"), to deal in the Software without - restriction, including without limitation the rights to use, - copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following - conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. - - This is an amazing lib! - - Slightly modified by Mat Groves (matgroves.com); -*/ - -/** - * Based on the Polyk library http://polyk.ivank.net released under MIT licence. - * This is an amazing lib! - * Slightly modified by Mat Groves (matgroves.com); - * @class PolyK - */ -PIXI.PolyK = {}; - -/** - * Triangulates shapes for webGL graphic fills. - * - * @method Triangulate - */ -PIXI.PolyK.Triangulate = function(p) -{ - var sign = true; - - var n = p.length >> 1; - if(n < 3) return []; - - var tgs = []; - var avl = []; - for(var i = 0; i < n; i++) avl.push(i); - - i = 0; - var al = n; - while(al > 3) - { - var i0 = avl[(i+0)%al]; - var i1 = avl[(i+1)%al]; - var i2 = avl[(i+2)%al]; - - var ax = p[2*i0], ay = p[2*i0+1]; - var bx = p[2*i1], by = p[2*i1+1]; - var cx = p[2*i2], cy = p[2*i2+1]; - - var earFound = false; - if(PIXI.PolyK._convex(ax, ay, bx, by, cx, cy, sign)) - { - earFound = true; - for(var j = 0; j < al; j++) - { - var vi = avl[j]; - if(vi === i0 || vi === i1 || vi === i2) continue; - - if(PIXI.PolyK._PointInTriangle(p[2*vi], p[2*vi+1], ax, ay, bx, by, cx, cy)) { - earFound = false; - break; - } - } - } - - if(earFound) - { - tgs.push(i0, i1, i2); - avl.splice((i+1)%al, 1); - al--; - i = 0; - } - else if(i++ > 3*al) - { - // need to flip flip reverse it! - // reset! - if(sign) - { - tgs = []; - avl = []; - for(i = 0; i < n; i++) avl.push(i); - - i = 0; - al = n; - - sign = false; - } - else - { - // window.console.log("PIXI Warning: shape too complex to fill"); - return null; - } - } - } - - tgs.push(avl[0], avl[1], avl[2]); - return tgs; -}; - -/** - * Checks whether a point is within a triangle - * - * @method _PointInTriangle - * @param px {Number} x coordinate of the point to test - * @param py {Number} y coordinate of the point to test - * @param ax {Number} x coordinate of the a point of the triangle - * @param ay {Number} y coordinate of the a point of the triangle - * @param bx {Number} x coordinate of the b point of the triangle - * @param by {Number} y coordinate of the b point of the triangle - * @param cx {Number} x coordinate of the c point of the triangle - * @param cy {Number} y coordinate of the c point of the triangle - * @private - * @return {Boolean} - */ -PIXI.PolyK._PointInTriangle = function(px, py, ax, ay, bx, by, cx, cy) -{ - var v0x = cx-ax; - var v0y = cy-ay; - var v1x = bx-ax; - var v1y = by-ay; - var v2x = px-ax; - var v2y = py-ay; - - var dot00 = v0x*v0x+v0y*v0y; - var dot01 = v0x*v1x+v0y*v1y; - var dot02 = v0x*v2x+v0y*v2y; - var dot11 = v1x*v1x+v1y*v1y; - var dot12 = v1x*v2x+v1y*v2y; - - var invDenom = 1 / (dot00 * dot11 - dot01 * dot01); - var u = (dot11 * dot02 - dot01 * dot12) * invDenom; - var v = (dot00 * dot12 - dot01 * dot02) * invDenom; - - // Check if point is in triangle - return (u >= 0) && (v >= 0) && (u + v < 1); -}; - -/** - * Checks whether a shape is convex - * - * @method _convex - * @private - * @return {Boolean} - */ -PIXI.PolyK._convex = function(ax, ay, bx, by, cx, cy, sign) -{ - return ((ay-by)*(cx-bx) + (bx-ax)*(cy-by) >= 0) === sign; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @method initDefaultShaders -* @static -* @private -*/ -PIXI.initDefaultShaders = function() -{ -}; - -/** -* @method CompileVertexShader -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @return {Any} -*/ -PIXI.CompileVertexShader = function(gl, shaderSrc) -{ - return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER); -}; - -/** -* @method CompileFragmentShader -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @return {Any} -*/ -PIXI.CompileFragmentShader = function(gl, shaderSrc) -{ - return PIXI._CompileShader(gl, shaderSrc, gl.FRAGMENT_SHADER); -}; - -/** -* @method _CompileShader -* @static -* @private -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @param shaderType {Number} -* @return {Any} -*/ -PIXI._CompileShader = function(gl, shaderSrc, shaderType) -{ - var src = shaderSrc.join("\n"); - var shader = gl.createShader(shaderType); - gl.shaderSource(shader, src); - gl.compileShader(shader); - - if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) - { - window.console.log(gl.getShaderInfoLog(shader)); - return null; - } - - return shader; -}; - -/** -* @method compileProgram -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param vertexSrc {Array} -* @param fragmentSrc {Array} -* @return {Any} -*/ -PIXI.compileProgram = function(gl, vertexSrc, fragmentSrc) -{ - var fragmentShader = PIXI.CompileFragmentShader(gl, fragmentSrc); - var vertexShader = PIXI.CompileVertexShader(gl, vertexSrc); - - var shaderProgram = gl.createProgram(); - - gl.attachShader(shaderProgram, vertexShader); - gl.attachShader(shaderProgram, fragmentShader); - gl.linkProgram(shaderProgram); - - if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) - { - window.console.log("Could not initialise shaders"); - } - - return shaderProgram; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * @author Richard Davey http://www.photonstorm.com @photonstorm - */ - -/** -* @class PixiShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PixiShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]; - - /** - * A local texture counter for multi-texture shaders. - * @property textureCount - * @type Number - */ - this.textureCount = 0; - - /** - * A local flag - * @property firstRun - * @type Boolean - * @private - */ - this.firstRun = true; - - /** - * A dirty flag - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * Uniform attributes cache. - * @property attributes - * @type Array - * @private - */ - this.attributes = []; - - this.init(); -}; - -PIXI.PixiShader.prototype.constructor = PIXI.PixiShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PixiShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc || PIXI.PixiShader.defaultVertexSrc, this.fragmentSrc); - - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.dimensions = gl.getUniformLocation(program, 'dimensions'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - // Begin worst hack eva // - - // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? - // maybe its something to do with the current state of the gl context. - // I'm convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel - // If theres any webGL people that know why could happen please help :) - if(this.colorAttribute === -1) - { - this.colorAttribute = 2; - } - - this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute]; - - // End worst hack eva // - - // add those custom shaders! - for (var key in this.uniforms) - { - // get the uniform locations.. - this.uniforms[key].uniformLocation = gl.getUniformLocation(program, key); - } - - this.initUniforms(); - - this.program = program; -}; - -/** -* Initialises the shader uniform values. -* -* Uniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/ -* http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf -* -* @method initUniforms -*/ -PIXI.PixiShader.prototype.initUniforms = function() -{ - this.textureCount = 1; - var gl = this.gl; - var uniform; - - for (var key in this.uniforms) - { - uniform = this.uniforms[key]; - - var type = uniform.type; - - if (type === 'sampler2D') - { - uniform._init = false; - - if (uniform.value !== null) - { - this.initSampler2D(uniform); - } - } - else if (type === 'mat2' || type === 'mat3' || type === 'mat4') - { - // These require special handling - uniform.glMatrix = true; - uniform.glValueLength = 1; - - if (type === 'mat2') - { - uniform.glFunc = gl.uniformMatrix2fv; - } - else if (type === 'mat3') - { - uniform.glFunc = gl.uniformMatrix3fv; - } - else if (type === 'mat4') - { - uniform.glFunc = gl.uniformMatrix4fv; - } - } - else - { - // GL function reference - uniform.glFunc = gl['uniform' + type]; - - if (type === '2f' || type === '2i') - { - uniform.glValueLength = 2; - } - else if (type === '3f' || type === '3i') - { - uniform.glValueLength = 3; - } - else if (type === '4f' || type === '4i') - { - uniform.glValueLength = 4; - } - else - { - uniform.glValueLength = 1; - } - } - } - -}; - -/** -* Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded) -* -* @method initSampler2D -*/ -PIXI.PixiShader.prototype.initSampler2D = function(uniform) -{ - if (!uniform.value || !uniform.value.baseTexture || !uniform.value.baseTexture.hasLoaded) - { - return; - } - - var gl = this.gl; - - gl.activeTexture(gl['TEXTURE' + this.textureCount]); - gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]); - - // Extended texture data - if (uniform.textureData) - { - var data = uniform.textureData; - - // GLTexture = mag linear, min linear_mipmap_linear, wrap repeat + gl.generateMipmap(gl.TEXTURE_2D); - // GLTextureLinear = mag/min linear, wrap clamp - // GLTextureNearestRepeat = mag/min NEAREST, wrap repeat - // GLTextureNearest = mag/min nearest, wrap clamp - // AudioTexture = whatever + luminance + width 512, height 2, border 0 - // KeyTexture = whatever + luminance + width 256, height 2, border 0 - - // magFilter can be: gl.LINEAR, gl.LINEAR_MIPMAP_LINEAR or gl.NEAREST - // wrapS/T can be: gl.CLAMP_TO_EDGE or gl.REPEAT - - var magFilter = (data.magFilter) ? data.magFilter : gl.LINEAR; - var minFilter = (data.minFilter) ? data.minFilter : gl.LINEAR; - var wrapS = (data.wrapS) ? data.wrapS : gl.CLAMP_TO_EDGE; - var wrapT = (data.wrapT) ? data.wrapT : gl.CLAMP_TO_EDGE; - var format = (data.luminance) ? gl.LUMINANCE : gl.RGBA; - - if (data.repeat) - { - wrapS = gl.REPEAT; - wrapT = gl.REPEAT; - } - - gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, !!data.flipY); - - if (data.width) - { - var width = (data.width) ? data.width : 512; - var height = (data.height) ? data.height : 2; - var border = (data.border) ? data.border : 0; - - // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels); - gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, border, format, gl.UNSIGNED_BYTE, null); - } - else - { - // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, ImageData? pixels); - gl.texImage2D(gl.TEXTURE_2D, 0, format, gl.RGBA, gl.UNSIGNED_BYTE, uniform.value.baseTexture.source); - } - - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrapS); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT); - } - - gl.uniform1i(uniform.uniformLocation, this.textureCount); - - uniform._init = true; - - this.textureCount++; - -}; - -/** -* Updates the shader uniform values. -* -* @method syncUniforms -*/ -PIXI.PixiShader.prototype.syncUniforms = function() -{ - this.textureCount = 1; - var uniform; - var gl = this.gl; - - // This would probably be faster in an array and it would guarantee key order - for (var key in this.uniforms) - { - uniform = this.uniforms[key]; - - if (uniform.glValueLength === 1) - { - if (uniform.glMatrix === true) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.transpose, uniform.value); - } - else - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value); - } - } - else if (uniform.glValueLength === 2) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y); - } - else if (uniform.glValueLength === 3) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z); - } - else if (uniform.glValueLength === 4) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z, uniform.value.w); - } - else if (uniform.type === 'sampler2D') - { - if (uniform._init) - { - gl.activeTexture(gl['TEXTURE' + this.textureCount]); - - if(uniform.value.baseTexture._dirty[gl.id]) - { - PIXI.instances[gl.id].updateTexture(uniform.value.baseTexture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]); - } - - // gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id] || PIXI.createWebGLTexture( uniform.value.baseTexture, gl)); - gl.uniform1i(uniform.uniformLocation, this.textureCount); - this.textureCount++; - } - else - { - this.initSampler2D(uniform); - } - } - } - -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PixiShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; - -/** -* The Default Vertex shader source. -* -* @property defaultVertexSrc -* @type String -*/ -PIXI.PixiShader.defaultVertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aTextureCoord;', - 'attribute vec4 aColor;', - - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - - 'const vec2 center = vec2(-1.0, 1.0);', - - 'void main(void) {', - ' gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - ' vColor = vec4(aColor.rgb * aColor.a, aColor.a);', - '}' -]; -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class PixiFastShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PixiFastShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying float vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aPositionCoord;', - 'attribute vec2 aScale;', - 'attribute float aRotation;', - 'attribute vec2 aTextureCoord;', - 'attribute float aColor;', - - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - 'uniform mat3 uMatrix;', - - 'varying vec2 vTextureCoord;', - 'varying float vColor;', - - 'const vec2 center = vec2(-1.0, 1.0);', - - 'void main(void) {', - ' vec2 v;', - ' vec2 sv = aVertexPosition * aScale;', - ' v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);', - ' v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);', - ' v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;', - ' gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - // ' vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;', - ' vColor = aColor;', - '}' - ]; - - /** - * A local texture counter for multi-texture shaders. - * @property textureCount - * @type Number - */ - this.textureCount = 0; - - this.init(); -}; - -PIXI.PixiFastShader.prototype.constructor = PIXI.PixiFastShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PixiFastShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.dimensions = gl.getUniformLocation(program, 'dimensions'); - this.uMatrix = gl.getUniformLocation(program, 'uMatrix'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aPositionCoord = gl.getAttribLocation(program, 'aPositionCoord'); - - this.aScale = gl.getAttribLocation(program, 'aScale'); - this.aRotation = gl.getAttribLocation(program, 'aRotation'); - - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - // Begin worst hack eva // - - // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? - // maybe its somthing to do with the current state of the gl context. - // Im convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel - // If theres any webGL people that know why could happen please help :) - if(this.colorAttribute === -1) - { - this.colorAttribute = 2; - } - - this.attributes = [this.aVertexPosition, this.aPositionCoord, this.aScale, this.aRotation, this.aTextureCoord, this.colorAttribute]; - - // End worst hack eva // - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PixiFastShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class StripShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.StripShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - // 'varying float vColor;', - 'uniform float alpha;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * alpha;', - // ' gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);',//gl_FragColor * alpha;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aTextureCoord;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - // 'uniform float alpha;', - // 'uniform vec3 tint;', - 'varying vec2 vTextureCoord;', - // 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - // ' vColor = aColor * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.StripShader.prototype.constructor = PIXI.StripShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.StripShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - //this.dimensions = gl.getUniformLocation(this.program, 'dimensions'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - - this.attributes = [this.aVertexPosition, this.aTextureCoord]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.StripShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attribute = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class PrimitiveShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PrimitiveShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' gl_FragColor = vColor;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec4 aColor;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - 'uniform float alpha;', - 'uniform float flipY;', - 'uniform vec3 tint;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);', - ' vColor = aColor * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.PrimitiveShader.prototype.constructor = PIXI.PrimitiveShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PrimitiveShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.tintColor = gl.getUniformLocation(program, 'tint'); - this.flipY = gl.getUniformLocation(program, 'flipY'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - this.attributes = [this.aVertexPosition, this.colorAttribute]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PrimitiveShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class ComplexPrimitiveShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.ComplexPrimitiveShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - - 'precision mediump float;', - - 'varying vec4 vColor;', - - 'void main(void) {', - ' gl_FragColor = vColor;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - //'attribute vec4 aColor;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - - 'uniform vec3 tint;', - 'uniform float alpha;', - 'uniform vec3 color;', - 'uniform float flipY;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);', - ' vColor = vec4(color * alpha * tint, alpha);',//" * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.ComplexPrimitiveShader.prototype.constructor = PIXI.ComplexPrimitiveShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.ComplexPrimitiveShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.tintColor = gl.getUniformLocation(program, 'tint'); - this.color = gl.getUniformLocation(program, 'color'); - this.flipY = gl.getUniformLocation(program, 'flipY'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - // this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - this.attributes = [this.aVertexPosition, this.colorAttribute]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.ComplexPrimitiveShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attribute = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A set of functions used by the webGL renderer to draw the primitive graphics data - * - * @class WebGLGraphics - * @private - * @static - */ -PIXI.WebGLGraphics = function() -{ -}; - -/** - * Renders the graphics object - * - * @static - * @private - * @method renderGraphics - * @param graphics {Graphics} - * @param renderSession {Object} - */ -PIXI.WebGLGraphics.renderGraphics = function(graphics, renderSession)//projection, offset) -{ - var gl = renderSession.gl; - var projection = renderSession.projection, - offset = renderSession.offset, - shader = renderSession.shaderManager.primitiveShader, - webGLData; - - if(graphics.dirty) - { - PIXI.WebGLGraphics.updateGraphics(graphics, gl); - } - - var webGL = graphics._webGL[gl.id]; - - // This could be speeded up for sure! - - for (var i = 0; i < webGL.data.length; i++) - { - if(webGL.data[i].mode === 1) - { - webGLData = webGL.data[i]; - - renderSession.stencilManager.pushStencil(graphics, webGLData, renderSession); - - // render quad.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - renderSession.stencilManager.popStencil(graphics, webGLData, renderSession); - } - else - { - webGLData = webGL.data[i]; - - - renderSession.shaderManager.setShader( shader );//activatePrimitiveShader(); - shader = renderSession.shaderManager.primitiveShader; - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform1f(shader.flipY, 1); - - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - - gl.uniform1f(shader.alpha, graphics.worldAlpha); - - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0); - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4); - - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - } - } -}; - -/** - * Updates the graphics object - * - * @static - * @private - * @method updateGraphics - * @param graphicsData {Graphics} The graphics object to update - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLGraphics.updateGraphics = function(graphics, gl) -{ - // get the contexts graphics object - var webGL = graphics._webGL[gl.id]; - // if the graphics object does not exist in the webGL context time to create it! - if(!webGL)webGL = graphics._webGL[gl.id] = {lastIndex:0, data:[], gl:gl}; - - // flag the graphics as not dirty as we are about to update it... - graphics.dirty = false; - - var i; - - // if the user cleared the graphics object we will need to clear every object - if(graphics.clearDirty) - { - graphics.clearDirty = false; - - // lop through and return all the webGLDatas to the object pool so than can be reused later on - for (i = 0; i < webGL.data.length; i++) - { - var graphicsData = webGL.data[i]; - graphicsData.reset(); - PIXI.WebGLGraphics.graphicsDataPool.push( graphicsData ); - } - - // clear the array and reset the index.. - webGL.data = []; - webGL.lastIndex = 0; - } - - var webGLData; - - // loop through the graphics datas and construct each one.. - // if the object is a complex fill then the new stencil buffer technique will be used - // other wise graphics objects will be pushed into a batch.. - for (i = webGL.lastIndex; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - - if(data.type === PIXI.Graphics.POLY) - { - // need to add the points the the graphics object.. - data.points = data.shape.points.slice(); - if(data.shape.closed) - { - // close the poly if the value is true! - if(data.points[0] !== data.points[data.points.length-2] || data.points[1] !== data.points[data.points.length-1]) - { - data.points.push(data.points[0], data.points[1]); - } - } - - // MAKE SURE WE HAVE THE CORRECT TYPE.. - if(data.fill) - { - if(data.points.length >= 6) - { - if(data.points.length < 6 * 2) - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - - var canDrawUsingSimple = PIXI.WebGLGraphics.buildPoly(data, webGLData); - // console.log(canDrawUsingSimple); - - if(!canDrawUsingSimple) - { - // console.log("<>>>") - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1); - PIXI.WebGLGraphics.buildComplexPoly(data, webGLData); - } - - } - else - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1); - PIXI.WebGLGraphics.buildComplexPoly(data, webGLData); - } - } - } - - if(data.lineWidth > 0) - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - PIXI.WebGLGraphics.buildLine(data, webGLData); - - } - } - else - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - - if(data.type === PIXI.Graphics.RECT) - { - PIXI.WebGLGraphics.buildRectangle(data, webGLData); - } - else if(data.type === PIXI.Graphics.CIRC || data.type === PIXI.Graphics.ELIP) - { - PIXI.WebGLGraphics.buildCircle(data, webGLData); - } - else if(data.type === PIXI.Graphics.RREC) - { - PIXI.WebGLGraphics.buildRoundedRectangle(data, webGLData); - } - } - - webGL.lastIndex++; - } - - // upload all the dirty data... - for (i = 0; i < webGL.data.length; i++) - { - webGLData = webGL.data[i]; - if(webGLData.dirty)webGLData.upload(); - } -}; - -/** - * @static - * @private - * @method switchMode - * @param webGL {WebGLContext} - * @param type {Number} - */ -PIXI.WebGLGraphics.switchMode = function(webGL, type) -{ - var webGLData; - - if(!webGL.data.length) - { - webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl); - webGLData.mode = type; - webGL.data.push(webGLData); - } - else - { - webGLData = webGL.data[webGL.data.length-1]; - - if(webGLData.mode !== type || type === 1) - { - webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl); - webGLData.mode = type; - webGL.data.push(webGLData); - } - } - - webGLData.dirty = true; - - return webGLData; -}; - -/** - * Builds a rectangle to draw - * - * @static - * @private - * @method buildRectangle - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildRectangle = function(graphicsData, webGLData) -{ - // --- // - // need to convert points to a nice regular data - // - var rectData = graphicsData.shape; - var x = rectData.x; - var y = rectData.y; - var width = rectData.width; - var height = rectData.height; - - if(graphicsData.fill) - { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vertPos = verts.length/6; - - // start - verts.push(x, y); - verts.push(r, g, b, alpha); - - verts.push(x + width, y); - verts.push(r, g, b, alpha); - - verts.push(x , y + height); - verts.push(r, g, b, alpha); - - verts.push(x + width, y + height); - verts.push(r, g, b, alpha); - - // insert 2 dead triangles.. - indices.push(vertPos, vertPos, vertPos+1, vertPos+2, vertPos+3, vertPos+3); - } - - if(graphicsData.lineWidth) - { - var tempPoints = graphicsData.points; - - graphicsData.points = [x, y, - x + width, y, - x + width, y + height, - x, y + height, - x, y]; - - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Builds a rounded rectangle to draw - * - * @static - * @private - * @method buildRoundedRectangle - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildRoundedRectangle = function(graphicsData, webGLData) -{ - var rrectData = graphicsData.shape; - var x = rrectData.x; - var y = rrectData.y; - var width = rrectData.width; - var height = rrectData.height; - - var radius = rrectData.radius; - - var recPoints = []; - recPoints.push(x, y + radius); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x, y + height - radius, x, y + height, x + radius, y + height)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width, y + radius, x + width, y, x + width - radius, y)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + radius, y, x, y, x, y + radius)); - - if (graphicsData.fill) { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vecPos = verts.length/6; - - var triangles = PIXI.PolyK.Triangulate(recPoints); - - // - - var i = 0; - for (i = 0; i < triangles.length; i+=3) - { - indices.push(triangles[i] + vecPos); - indices.push(triangles[i] + vecPos); - indices.push(triangles[i+1] + vecPos); - indices.push(triangles[i+2] + vecPos); - indices.push(triangles[i+2] + vecPos); - } - - - for (i = 0; i < recPoints.length; i++) - { - verts.push(recPoints[i], recPoints[++i], r, g, b, alpha); - } - } - - if (graphicsData.lineWidth) { - var tempPoints = graphicsData.points; - - graphicsData.points = recPoints; - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Calculate the points for a quadratic bezier curve. (helper function..) - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c - * - * @static - * @private - * @method quadraticBezierCurve - * @param fromX {Number} Origin point x - * @param fromY {Number} Origin point x - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Array(Number)} - */ -PIXI.WebGLGraphics.quadraticBezierCurve = function(fromX, fromY, cpX, cpY, toX, toY) { - - var xa, - ya, - xb, - yb, - x, - y, - n = 20, - points = []; - - function getPt(n1 , n2, perc) { - var diff = n2 - n1; - - return n1 + ( diff * perc ); - } - - var j = 0; - for (var i = 0; i <= n; i++ ) - { - j = i / n; - - // The Green Line - xa = getPt( fromX , cpX , j ); - ya = getPt( fromY , cpY , j ); - xb = getPt( cpX , toX , j ); - yb = getPt( cpY , toY , j ); - - // The Black Dot - x = getPt( xa , xb , j ); - y = getPt( ya , yb , j ); - - points.push(x, y); - } - return points; -}; - -/** - * Builds a circle to draw - * - * @static - * @private - * @method buildCircle - * @param graphicsData {Graphics} The graphics object to draw - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildCircle = function(graphicsData, webGLData) -{ - // need to convert points to a nice regular data - var circleData = graphicsData.shape; - var x = circleData.x; - var y = circleData.y; - var width; - var height; - - // TODO - bit hacky?? - if(graphicsData.type === PIXI.Graphics.CIRC) - { - width = circleData.radius; - height = circleData.radius; - } - else - { - width = circleData.width; - height = circleData.height; - } - - var totalSegs = 40; - var seg = (Math.PI * 2) / totalSegs ; - - var i = 0; - - if(graphicsData.fill) - { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vecPos = verts.length/6; - - indices.push(vecPos); - - for (i = 0; i < totalSegs + 1 ; i++) - { - verts.push(x,y, r, g, b, alpha); - - verts.push(x + Math.sin(seg * i) * width, - y + Math.cos(seg * i) * height, - r, g, b, alpha); - - indices.push(vecPos++, vecPos++); - } - - indices.push(vecPos-1); - } - - if(graphicsData.lineWidth) - { - var tempPoints = graphicsData.points; - - graphicsData.points = []; - - for (i = 0; i < totalSegs + 1; i++) - { - graphicsData.points.push(x + Math.sin(seg * i) * width, - y + Math.cos(seg * i) * height); - } - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Builds a line to draw - * - * @static - * @private - * @method buildLine - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildLine = function(graphicsData, webGLData) -{ - // TODO OPTIMISE! - var i = 0; - var points = graphicsData.points; - if(points.length === 0)return; - - // if the line width is an odd number add 0.5 to align to a whole pixel - if(graphicsData.lineWidth%2) - { - for (i = 0; i < points.length; i++) { - points[i] += 0.5; - } - } - - // get first and last point.. figure out the middle! - var firstPoint = new PIXI.Point( points[0], points[1] ); - var lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); - - // if the first point is the last point - gonna have issues :) - if(firstPoint.x === lastPoint.x && firstPoint.y === lastPoint.y) - { - // need to clone as we are going to slightly modify the shape.. - points = points.slice(); - - points.pop(); - points.pop(); - - lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); - - var midPointX = lastPoint.x + (firstPoint.x - lastPoint.x) *0.5; - var midPointY = lastPoint.y + (firstPoint.y - lastPoint.y) *0.5; - - points.unshift(midPointX, midPointY); - points.push(midPointX, midPointY); - } - - var verts = webGLData.points; - var indices = webGLData.indices; - var length = points.length / 2; - var indexCount = points.length; - var indexStart = verts.length/6; - - // DRAW the Line - var width = graphicsData.lineWidth / 2; - - // sort color - var color = PIXI.hex2rgb(graphicsData.lineColor); - var alpha = graphicsData.lineAlpha; - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var px, py, p1x, p1y, p2x, p2y, p3x, p3y; - var perpx, perpy, perp2x, perp2y, perp3x, perp3y; - var a1, b1, c1, a2, b2, c2; - var denom, pdist, dist; - - p1x = points[0]; - p1y = points[1]; - - p2x = points[2]; - p2y = points[3]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - // start - verts.push(p1x - perpx , p1y - perpy, - r, g, b, alpha); - - verts.push(p1x + perpx , p1y + perpy, - r, g, b, alpha); - - for (i = 1; i < length-1; i++) - { - p1x = points[(i-1)*2]; - p1y = points[(i-1)*2 + 1]; - - p2x = points[(i)*2]; - p2y = points[(i)*2 + 1]; - - p3x = points[(i+1)*2]; - p3y = points[(i+1)*2 + 1]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - perp2x = -(p2y - p3y); - perp2y = p2x - p3x; - - dist = Math.sqrt(perp2x*perp2x + perp2y*perp2y); - perp2x /= dist; - perp2y /= dist; - perp2x *= width; - perp2y *= width; - - a1 = (-perpy + p1y) - (-perpy + p2y); - b1 = (-perpx + p2x) - (-perpx + p1x); - c1 = (-perpx + p1x) * (-perpy + p2y) - (-perpx + p2x) * (-perpy + p1y); - a2 = (-perp2y + p3y) - (-perp2y + p2y); - b2 = (-perp2x + p2x) - (-perp2x + p3x); - c2 = (-perp2x + p3x) * (-perp2y + p2y) - (-perp2x + p2x) * (-perp2y + p3y); - - denom = a1*b2 - a2*b1; - - if(Math.abs(denom) < 0.1 ) - { - - denom+=10.1; - verts.push(p2x - perpx , p2y - perpy, - r, g, b, alpha); - - verts.push(p2x + perpx , p2y + perpy, - r, g, b, alpha); - - continue; - } - - px = (b1*c2 - b2*c1)/denom; - py = (a2*c1 - a1*c2)/denom; - - - pdist = (px -p2x) * (px -p2x) + (py -p2y) + (py -p2y); - - - if(pdist > 140 * 140) - { - perp3x = perpx - perp2x; - perp3y = perpy - perp2y; - - dist = Math.sqrt(perp3x*perp3x + perp3y*perp3y); - perp3x /= dist; - perp3y /= dist; - perp3x *= width; - perp3y *= width; - - verts.push(p2x - perp3x, p2y -perp3y); - verts.push(r, g, b, alpha); - - verts.push(p2x + perp3x, p2y +perp3y); - verts.push(r, g, b, alpha); - - verts.push(p2x - perp3x, p2y -perp3y); - verts.push(r, g, b, alpha); - - indexCount++; - } - else - { - - verts.push(px , py); - verts.push(r, g, b, alpha); - - verts.push(p2x - (px-p2x), p2y - (py - p2y)); - verts.push(r, g, b, alpha); - } - } - - p1x = points[(length-2)*2]; - p1y = points[(length-2)*2 + 1]; - - p2x = points[(length-1)*2]; - p2y = points[(length-1)*2 + 1]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - verts.push(p2x - perpx , p2y - perpy); - verts.push(r, g, b, alpha); - - verts.push(p2x + perpx , p2y + perpy); - verts.push(r, g, b, alpha); - - indices.push(indexStart); - - for (i = 0; i < indexCount; i++) - { - indices.push(indexStart++); - } - - indices.push(indexStart-1); -}; - -/** - * Builds a complex polygon to draw - * - * @static - * @private - * @method buildComplexPoly - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildComplexPoly = function(graphicsData, webGLData) -{ - //TODO - no need to copy this as it gets turned into a FLoat32Array anyways.. - var points = graphicsData.points.slice(); - if(points.length < 6)return; - - // get first and last point.. figure out the middle! - var indices = webGLData.indices; - webGLData.points = points; - webGLData.alpha = graphicsData.fillAlpha; - webGLData.color = PIXI.hex2rgb(graphicsData.fillColor); - - /* - calclate the bounds.. - */ - var minX = Infinity; - var maxX = -Infinity; - - var minY = Infinity; - var maxY = -Infinity; - - var x,y; - - // get size.. - for (var i = 0; i < points.length; i+=2) - { - x = points[i]; - y = points[i+1]; - - minX = x < minX ? x : minX; - maxX = x > maxX ? x : maxX; - - minY = y < minY ? y : minY; - maxY = y > maxY ? y : maxY; - } - - // add a quad to the end cos there is no point making another buffer! - points.push(minX, minY, - maxX, minY, - maxX, maxY, - minX, maxY); - - // push a quad onto the end.. - - //TODO - this aint needed! - var length = points.length / 2; - for (i = 0; i < length; i++) - { - indices.push( i ); - } - -}; - -/** - * Builds a polygon to draw - * - * @static - * @private - * @method buildPoly - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildPoly = function(graphicsData, webGLData) -{ - var points = graphicsData.points; - - if(points.length < 6)return; - // get first and last point.. figure out the middle! - var verts = webGLData.points; - var indices = webGLData.indices; - - var length = points.length / 2; - - // sort color - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var triangles = PIXI.PolyK.Triangulate(points); - - if(!triangles)return false; - - var vertPos = verts.length / 6; - - var i = 0; - - for (i = 0; i < triangles.length; i+=3) - { - indices.push(triangles[i] + vertPos); - indices.push(triangles[i] + vertPos); - indices.push(triangles[i+1] + vertPos); - indices.push(triangles[i+2] +vertPos); - indices.push(triangles[i+2] + vertPos); - } - - for (i = 0; i < length; i++) - { - verts.push(points[i * 2], points[i * 2 + 1], - r, g, b, alpha); - } - - return true; -}; - -PIXI.WebGLGraphics.graphicsDataPool = []; - -/** - * @class WebGLGraphicsData - * @private - * @static - */ -PIXI.WebGLGraphicsData = function(gl) -{ - this.gl = gl; - - //TODO does this need to be split before uploding?? - this.color = [0,0,0]; // color split! - this.points = []; - this.indices = []; - this.buffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - this.mode = 1; - this.alpha = 1; - this.dirty = true; -}; - -/** - * @method reset - */ -PIXI.WebGLGraphicsData.prototype.reset = function() -{ - this.points = []; - this.indices = []; -}; - -/** - * @method upload - */ -PIXI.WebGLGraphicsData.prototype.upload = function() -{ - var gl = this.gl; - -// this.lastIndex = graphics.graphicsData.length; - this.glPoints = new PIXI.Float32Array(this.points); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer); - gl.bufferData(gl.ARRAY_BUFFER, this.glPoints, gl.STATIC_DRAW); - - this.glIndicies = new PIXI.Uint16Array(this.indices); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.glIndicies, gl.STATIC_DRAW); - - this.dirty = false; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -PIXI.glContexts = []; // this is where we store the webGL contexts for easy access. -PIXI.instances = []; - -/** - * The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer - * should be used for browsers that support webGL. This Render works by automatically managing webGLBatchs. - * So no need for Sprite Batches or Sprite Clouds. - * Don't forget to add the view to your DOM or you will not see anything :) - * - * @class WebGLRenderer - * @constructor - * @param [width=0] {Number} the width of the canvas view - * @param [height=0] {Number} the height of the canvas view - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - */ -PIXI.WebGLRenderer = function(width, height, options) -{ - if(options) - { - for (var i in PIXI.defaultRenderOptions) - { - if (typeof options[i] === 'undefined') options[i] = PIXI.defaultRenderOptions[i]; - } - } - else - { - options = PIXI.defaultRenderOptions; - } - - if(!PIXI.defaultRenderer) - { - PIXI.sayHello('webGL'); - PIXI.defaultRenderer = this; - } - - /** - * @property type - * @type Number - */ - this.type = PIXI.WEBGL_RENDERER; - - /** - * The resolution of the renderer - * - * @property resolution - * @type Number - * @default 1 - */ - this.resolution = options.resolution; - - // do a catch.. only 1 webGL renderer.. - - /** - * Whether the render view is transparent - * - * @property transparent - * @type Boolean - */ - this.transparent = options.transparent; - - /** - * Whether the render view should be resized automatically - * - * @property autoResize - * @type Boolean - */ - this.autoResize = options.autoResize || false; - - /** - * The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering. - * - * @property preserveDrawingBuffer - * @type Boolean - */ - this.preserveDrawingBuffer = options.preserveDrawingBuffer; - - /** - * This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true: - * If the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0). - * If the Stage is transparent, Pixi will clear to the target Stage's background color. - * Disable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set. - * - * @property clearBeforeRender - * @type Boolean - * @default - */ - this.clearBeforeRender = options.clearBeforeRender; - - /** - * The width of the canvas view - * - * @property width - * @type Number - * @default 800 - */ - this.width = width || 800; - - /** - * The height of the canvas view - * - * @property height - * @type Number - * @default 600 - */ - this.height = height || 600; - - /** - * The canvas element that everything is drawn to - * - * @property view - * @type HTMLCanvasElement - */ - this.view = options.view || document.createElement( 'canvas' ); - - // deal with losing context.. - - /** - * @property contextLostBound - * @type Function - */ - this.contextLostBound = this.handleContextLost.bind(this); - - /** - * @property contextRestoredBound - * @type Function - */ - this.contextRestoredBound = this.handleContextRestored.bind(this); - - this.view.addEventListener('webglcontextlost', this.contextLostBound, false); - this.view.addEventListener('webglcontextrestored', this.contextRestoredBound, false); - - /** - * @property _contextOptions - * @type Object - * @private - */ - this._contextOptions = { - alpha: this.transparent, - antialias: options.antialias, // SPEED UP?? - premultipliedAlpha:this.transparent && this.transparent !== 'notMultiplied', - stencil:true, - preserveDrawingBuffer: options.preserveDrawingBuffer - }; - - /** - * @property projection - * @type Point - */ - this.projection = new PIXI.Point(); - - /** - * @property offset - * @type Point - */ - this.offset = new PIXI.Point(0, 0); - - // time to create the render managers! each one focuses on managing a state in webGL - - /** - * Deals with managing the shader programs and their attribs - * @property shaderManager - * @type WebGLShaderManager - */ - this.shaderManager = new PIXI.WebGLShaderManager(); - - /** - * Manages the rendering of sprites - * @property spriteBatch - * @type WebGLSpriteBatch - */ - this.spriteBatch = new PIXI.WebGLSpriteBatch(); - - /** - * Manages the masks using the stencil buffer - * @property maskManager - * @type WebGLMaskManager - */ - this.maskManager = new PIXI.WebGLMaskManager(); - - /** - * Manages the filters - * @property filterManager - * @type WebGLFilterManager - */ - this.filterManager = new PIXI.WebGLFilterManager(); - - /** - * Manages the stencil buffer - * @property stencilManager - * @type WebGLStencilManager - */ - this.stencilManager = new PIXI.WebGLStencilManager(); - - /** - * Manages the blendModes - * @property blendModeManager - * @type WebGLBlendModeManager - */ - this.blendModeManager = new PIXI.WebGLBlendModeManager(); - - /** - * TODO remove - * @property renderSession - * @type Object - */ - this.renderSession = {}; - this.renderSession.gl = this.gl; - this.renderSession.drawCount = 0; - this.renderSession.shaderManager = this.shaderManager; - this.renderSession.maskManager = this.maskManager; - this.renderSession.filterManager = this.filterManager; - this.renderSession.blendModeManager = this.blendModeManager; - this.renderSession.spriteBatch = this.spriteBatch; - this.renderSession.stencilManager = this.stencilManager; - this.renderSession.renderer = this; - this.renderSession.resolution = this.resolution; - - // time init the context.. - this.initContext(); - - // map some webGL blend modes.. - this.mapBlendModes(); -}; - -// constructor -PIXI.WebGLRenderer.prototype.constructor = PIXI.WebGLRenderer; - -/** -* @method initContext -*/ -PIXI.WebGLRenderer.prototype.initContext = function() -{ - var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); - this.gl = gl; - - if (!gl) { - // fail, not able to get a context - throw new Error('This browser does not support webGL. Try using the canvas renderer'); - } - - this.glContextId = gl.id = PIXI.WebGLRenderer.glContextId ++; - - PIXI.glContexts[this.glContextId] = gl; - - PIXI.instances[this.glContextId] = this; - - // set up the default pixi settings.. - gl.disable(gl.DEPTH_TEST); - gl.disable(gl.CULL_FACE); - gl.enable(gl.BLEND); - - // need to set the context for all the managers... - this.shaderManager.setContext(gl); - this.spriteBatch.setContext(gl); - this.maskManager.setContext(gl); - this.filterManager.setContext(gl); - this.blendModeManager.setContext(gl); - this.stencilManager.setContext(gl); - - this.renderSession.gl = this.gl; - - // now resize and we are good to go! - this.resize(this.width, this.height); -}; - -/** - * Renders the stage to its webGL view - * - * @method render - * @param stage {Stage} the Stage element to be rendered - */ -PIXI.WebGLRenderer.prototype.render = function(stage) -{ - // no point rendering if our context has been blown up! - if(this.contextLost)return; - - // if rendering a new stage clear the batches.. - if(this.__stage !== stage) - { - if(stage.interactive)stage.interactionManager.removeEvents(); - - // TODO make this work - // dont think this is needed any more? - this.__stage = stage; - } - - // update the scene graph - stage.updateTransform(); - - var gl = this.gl; - - // interaction - if(stage._interactive) - { - //need to add some events! - if(!stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = true; - stage.interactionManager.setTarget(this); - } - } - else - { - if(stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = false; - stage.interactionManager.setTarget(this); - } - } - - // -- Does this need to be set every frame? -- // - gl.viewport(0, 0, this.width, this.height); - - // make sure we are bound to the main frame buffer - gl.bindFramebuffer(gl.FRAMEBUFFER, null); - - if (this.clearBeforeRender) - { - if(this.transparent) - { - gl.clearColor(0, 0, 0, 0); - } - else - { - gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], 1); - } - - gl.clear (gl.COLOR_BUFFER_BIT); - } - - this.renderDisplayObject( stage, this.projection ); -}; - -/** - * Renders a Display Object. - * - * @method renderDisplayObject - * @param displayObject {DisplayObject} The DisplayObject to render - * @param projection {Point} The projection - * @param buffer {Array} a standard WebGL buffer - */ -PIXI.WebGLRenderer.prototype.renderDisplayObject = function(displayObject, projection, buffer) -{ - this.renderSession.blendModeManager.setBlendMode(PIXI.blendModes.NORMAL); - - // reset the render session data.. - this.renderSession.drawCount = 0; - - // make sure to flip the Y if using a render texture.. - this.renderSession.flipY = buffer ? -1 : 1; - - // set the default projection - this.renderSession.projection = projection; - - //set the default offset - this.renderSession.offset = this.offset; - - // start the sprite batch - this.spriteBatch.begin(this.renderSession); - - // start the filter manager - this.filterManager.begin(this.renderSession, buffer); - - // render the scene! - displayObject._renderWebGL(this.renderSession); - - // finish the sprite batch - this.spriteBatch.end(); -}; - -/** - * Resizes the webGL view to the specified width and height. - * - * @method resize - * @param width {Number} the new width of the webGL view - * @param height {Number} the new height of the webGL view - */ -PIXI.WebGLRenderer.prototype.resize = function(width, height) -{ - this.width = width * this.resolution; - this.height = height * this.resolution; - - this.view.width = this.width; - this.view.height = this.height; - - if (this.autoResize) { - this.view.style.width = this.width / this.resolution + 'px'; - this.view.style.height = this.height / this.resolution + 'px'; - } - - this.gl.viewport(0, 0, this.width, this.height); - - this.projection.x = this.width / 2 / this.resolution; - this.projection.y = -this.height / 2 / this.resolution; -}; - -/** - * Updates and Creates a WebGL texture for the renderers context. - * - * @method updateTexture - * @param texture {Texture} the texture to update - */ -PIXI.WebGLRenderer.prototype.updateTexture = function(texture) -{ - if(!texture.hasLoaded )return; - - var gl = this.gl; - - if(!texture._glTextures[gl.id])texture._glTextures[gl.id] = gl.createTexture(); - - gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]); - - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultipliedAlpha); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source); - - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - - - if(texture.mipmap && PIXI.isPowerOfTwo(texture.width, texture.height)) - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR_MIPMAP_LINEAR : gl.NEAREST_MIPMAP_NEAREST); - gl.generateMipmap(gl.TEXTURE_2D); - } - else - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - } - - // reguler... - if(!texture._powerOf2) - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - } - else - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT); - } - - texture._dirty[gl.id] = false; - - return texture._glTextures[gl.id]; -}; - -/** - * Handles a lost webgl context - * - * @method handleContextLost - * @param event {Event} - * @private - */ -PIXI.WebGLRenderer.prototype.handleContextLost = function(event) -{ - event.preventDefault(); - this.contextLost = true; -}; - -/** - * Handles a restored webgl context - * - * @method handleContextRestored - * @param event {Event} - * @private - */ -PIXI.WebGLRenderer.prototype.handleContextRestored = function() -{ - this.initContext(); - - // empty all the ol gl textures as they are useless now - for(var key in PIXI.TextureCache) - { - var texture = PIXI.TextureCache[key].baseTexture; - texture._glTextures = []; - } - - this.contextLost = false; -}; - -/** - * Removes everything from the renderer (event listeners, spritebatch, etc...) - * - * @method destroy - */ -PIXI.WebGLRenderer.prototype.destroy = function() -{ - // remove listeners - this.view.removeEventListener('webglcontextlost', this.contextLostBound); - this.view.removeEventListener('webglcontextrestored', this.contextRestoredBound); - - PIXI.glContexts[this.glContextId] = null; - - this.projection = null; - this.offset = null; - - // time to create the render managers! each one focuses on managine a state in webGL - this.shaderManager.destroy(); - this.spriteBatch.destroy(); - this.maskManager.destroy(); - this.filterManager.destroy(); - - this.shaderManager = null; - this.spriteBatch = null; - this.maskManager = null; - this.filterManager = null; - - this.gl = null; - this.renderSession = null; -}; - -/** - * Maps Pixi blend modes to WebGL blend modes. - * - * @method mapBlendModes - */ -PIXI.WebGLRenderer.prototype.mapBlendModes = function() -{ - var gl = this.gl; - - if(!PIXI.blendModesWebGL) - { - PIXI.blendModesWebGL = []; - - PIXI.blendModesWebGL[PIXI.blendModes.NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.ADD] = [gl.SRC_ALPHA, gl.DST_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SCREEN] = [gl.SRC_ALPHA, gl.ONE]; - PIXI.blendModesWebGL[PIXI.blendModes.OVERLAY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.DARKEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.LIGHTEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR_DODGE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR_BURN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.HARD_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SOFT_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.DIFFERENCE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.EXCLUSION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.HUE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SATURATION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.LUMINOSITY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - } -}; - -PIXI.WebGLRenderer.glContextId = 0; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLBlendModeManager -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLBlendModeManager = function() -{ - /** - * @property currentBlendMode - * @type Number - */ - this.currentBlendMode = 99999; -}; - -PIXI.WebGLBlendModeManager.prototype.constructor = PIXI.WebGLBlendModeManager; - -/** - * Sets the WebGL Context. - * - * @method setContext - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLBlendModeManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Sets-up the given blendMode from WebGL's point of view. -* -* @method setBlendMode -* @param blendMode {Number} the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD -*/ -PIXI.WebGLBlendModeManager.prototype.setBlendMode = function(blendMode) -{ - if(this.currentBlendMode === blendMode)return false; - - this.currentBlendMode = blendMode; - - var blendModeWebGL = PIXI.blendModesWebGL[this.currentBlendMode]; - this.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); - - return true; -}; - -/** -* Destroys this object. -* -* @method destroy -*/ -PIXI.WebGLBlendModeManager.prototype.destroy = function() -{ - this.gl = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLMaskManager -* @constructor -* @private -*/ -PIXI.WebGLMaskManager = function() -{ -}; - -PIXI.WebGLMaskManager.prototype.constructor = PIXI.WebGLMaskManager; - -/** -* Sets the drawing context to the one given in parameter. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLMaskManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Applies the Mask and adds it to the current filter stack. -* -* @method pushMask -* @param maskData {Array} -* @param renderSession {Object} -*/ -PIXI.WebGLMaskManager.prototype.pushMask = function(maskData, renderSession) -{ - var gl = renderSession.gl; - - if(maskData.dirty) - { - PIXI.WebGLGraphics.updateGraphics(maskData, gl); - } - - if(!maskData._webGL[gl.id].data.length)return; - - renderSession.stencilManager.pushStencil(maskData, maskData._webGL[gl.id].data[0], renderSession); -}; - -/** -* Removes the last filter from the filter stack and doesn't return it. -* -* @method popMask -* @param maskData {Array} -* @param renderSession {Object} an object containing all the useful parameters -*/ -PIXI.WebGLMaskManager.prototype.popMask = function(maskData, renderSession) -{ - var gl = this.gl; - renderSession.stencilManager.popStencil(maskData, maskData._webGL[gl.id].data[0], renderSession); -}; - -/** -* Destroys the mask stack. -* -* @method destroy -*/ -PIXI.WebGLMaskManager.prototype.destroy = function() -{ - this.gl = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLStencilManager -* @constructor -* @private -*/ -PIXI.WebGLStencilManager = function() -{ - this.stencilStack = []; - this.reverse = true; - this.count = 0; -}; - -/** -* Sets the drawing context to the one given in parameter. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLStencilManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Applies the Mask and adds it to the current filter stack. -* -* @method pushMask -* @param graphics {Graphics} -* @param webGLData {Array} -* @param renderSession {Object} -*/ -PIXI.WebGLStencilManager.prototype.pushStencil = function(graphics, webGLData, renderSession) -{ - var gl = this.gl; - this.bindGraphics(graphics, webGLData, renderSession); - - if(this.stencilStack.length === 0) - { - gl.enable(gl.STENCIL_TEST); - gl.clear(gl.STENCIL_BUFFER_BIT); - this.reverse = true; - this.count = 0; - } - - this.stencilStack.push(webGLData); - - var level = this.count; - - gl.colorMask(false, false, false, false); - - gl.stencilFunc(gl.ALWAYS,0,0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT); - - // draw the triangle strip! - - if(webGLData.mode === 1) - { - gl.drawElements(gl.TRIANGLE_FAN, webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 ); - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - - // draw a quad to increment.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - } - - this.reverse = !this.reverse; - } - else - { - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - } - } - - gl.colorMask(true, true, true, true); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP); - - this.count++; -}; - -/** - * TODO this does not belong here! - * - * @method bindGraphics - * @param graphics {Graphics} - * @param webGLData {Array} - * @param renderSession {Object} - */ -PIXI.WebGLStencilManager.prototype.bindGraphics = function(graphics, webGLData, renderSession) -{ - //if(this._currentGraphics === graphics)return; - this._currentGraphics = graphics; - - var gl = this.gl; - - // bind the graphics object.. - var projection = renderSession.projection, - offset = renderSession.offset, - shader;// = renderSession.shaderManager.primitiveShader; - - if(webGLData.mode === 1) - { - shader = renderSession.shaderManager.complexPrimitiveShader; - - renderSession.shaderManager.setShader( shader ); - - gl.uniform1f(shader.flipY, renderSession.flipY); - - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - gl.uniform3fv(shader.color, webGLData.color); - - gl.uniform1f(shader.alpha, graphics.worldAlpha * webGLData.alpha); - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 2, 0); - - - // now do the rest.. - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - } - else - { - //renderSession.shaderManager.activatePrimitiveShader(); - shader = renderSession.shaderManager.primitiveShader; - renderSession.shaderManager.setShader( shader ); - - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform1f(shader.flipY, renderSession.flipY); - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - - gl.uniform1f(shader.alpha, graphics.worldAlpha); - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0); - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4); - - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - } -}; - -/** - * @method popStencil - * @param graphics {Graphics} - * @param webGLData {Array} - * @param renderSession {Object} - */ -PIXI.WebGLStencilManager.prototype.popStencil = function(graphics, webGLData, renderSession) -{ - var gl = this.gl; - this.stencilStack.pop(); - - this.count--; - - if(this.stencilStack.length === 0) - { - // the stack is empty! - gl.disable(gl.STENCIL_TEST); - - } - else - { - - var level = this.count; - - this.bindGraphics(graphics, webGLData, renderSession); - - gl.colorMask(false, false, false, false); - - if(webGLData.mode === 1) - { - this.reverse = !this.reverse; - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - - // draw a quad to increment.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - gl.stencilFunc(gl.ALWAYS,0,0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT); - - // draw the triangle strip! - gl.drawElements(gl.TRIANGLE_FAN, webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - } - - } - else - { - // console.log("<<>>") - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - } - } - - gl.colorMask(true, true, true, true); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP); - - - } -}; - -/** -* Destroys the mask stack. -* -* @method destroy -*/ -PIXI.WebGLStencilManager.prototype.destroy = function() -{ - this.stencilStack = null; - this.gl = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLShaderManager -* @constructor -* @private -*/ -PIXI.WebGLShaderManager = function() -{ - /** - * @property maxAttibs - * @type Number - */ - this.maxAttibs = 10; - - /** - * @property attribState - * @type Array - */ - this.attribState = []; - - /** - * @property tempAttribState - * @type Array - */ - this.tempAttribState = []; - - for (var i = 0; i < this.maxAttibs; i++) - { - this.attribState[i] = false; - } - - /** - * @property stack - * @type Array - */ - this.stack = []; - -}; - -PIXI.WebGLShaderManager.prototype.constructor = PIXI.WebGLShaderManager; - -/** -* Initialises the context and the properties. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLShaderManager.prototype.setContext = function(gl) -{ - this.gl = gl; - - // the next one is used for rendering primitives - this.primitiveShader = new PIXI.PrimitiveShader(gl); - - // the next one is used for rendering triangle strips - this.complexPrimitiveShader = new PIXI.ComplexPrimitiveShader(gl); - - // this shader is used for the default sprite rendering - this.defaultShader = new PIXI.PixiShader(gl); - - // this shader is used for the fast sprite rendering - this.fastShader = new PIXI.PixiFastShader(gl); - - // the next one is used for rendering triangle strips - this.stripShader = new PIXI.StripShader(gl); - this.setShader(this.defaultShader); -}; - -/** -* Takes the attributes given in parameters. -* -* @method setAttribs -* @param attribs {Array} attribs -*/ -PIXI.WebGLShaderManager.prototype.setAttribs = function(attribs) -{ - // reset temp state - var i; - - for (i = 0; i < this.tempAttribState.length; i++) - { - this.tempAttribState[i] = false; - } - - // set the new attribs - for (i = 0; i < attribs.length; i++) - { - var attribId = attribs[i]; - this.tempAttribState[attribId] = true; - } - - var gl = this.gl; - - for (i = 0; i < this.attribState.length; i++) - { - if(this.attribState[i] !== this.tempAttribState[i]) - { - this.attribState[i] = this.tempAttribState[i]; - - if(this.tempAttribState[i]) - { - gl.enableVertexAttribArray(i); - } - else - { - gl.disableVertexAttribArray(i); - } - } - } -}; - -/** -* Sets the current shader. -* -* @method setShader -* @param shader {Any} -*/ -PIXI.WebGLShaderManager.prototype.setShader = function(shader) -{ - if(this._currentId === shader._UID)return false; - - this._currentId = shader._UID; - - this.currentShader = shader; - - this.gl.useProgram(shader.program); - this.setAttribs(shader.attributes); - - return true; -}; - -/** -* Destroys this object. -* -* @method destroy -*/ -PIXI.WebGLShaderManager.prototype.destroy = function() -{ - this.attribState = null; - - this.tempAttribState = null; - - this.primitiveShader.destroy(); - - this.complexPrimitiveShader.destroy(); - - this.defaultShader.destroy(); - - this.fastShader.destroy(); - - this.stripShader.destroy(); - - this.gl = null; -}; - -/** - * @author Mat Groves - * - * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ - * for creating the original pixi version! - * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now share 4 bytes on the vertex buffer - * - * Heavily inspired by LibGDX's WebGLSpriteBatch: - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java - */ - - /** - * - * @class WebGLSpriteBatch - * @private - * @constructor - */ -PIXI.WebGLSpriteBatch = function() -{ - /** - * @property vertSize - * @type Number - */ - this.vertSize = 5; - - /** - * The number of images in the SpriteBatch before it flushes - * @property size - * @type Number - */ - this.size = 2000;//Math.pow(2, 16) / this.vertSize; - - //the total number of bytes in our batch - var numVerts = this.size * 4 * 4 * this.vertSize; - //the total number of indices in our batch - var numIndices = this.size * 6; - - /** - * Holds the vertices - * - * @property vertices - * @type ArrayBuffer - */ - this.vertices = new PIXI.ArrayBuffer(numVerts); - - /** - * View on the vertices as a Float32Array - * - * @property positions - * @type Float32Array - */ - this.positions = new PIXI.Float32Array(this.vertices); - - /** - * View on the vertices as a Uint32Array - * - * @property colors - * @type Uint32Array - */ - this.colors = new PIXI.Uint32Array(this.vertices); - - /** - * Holds the indices - * - * @property indices - * @type Uint16Array - */ - this.indices = new PIXI.Uint16Array(numIndices); - - /** - * @property lastIndexCount - * @type Number - */ - this.lastIndexCount = 0; - - for (var i=0, j=0; i < numIndices; i += 6, j += 4) - { - this.indices[i + 0] = j + 0; - this.indices[i + 1] = j + 1; - this.indices[i + 2] = j + 2; - this.indices[i + 3] = j + 0; - this.indices[i + 4] = j + 2; - this.indices[i + 5] = j + 3; - } - - /** - * @property drawing - * @type Boolean - */ - this.drawing = false; - - /** - * @property currentBatchSize - * @type Number - */ - this.currentBatchSize = 0; - - /** - * @property currentBaseTexture - * @type BaseTexture - */ - this.currentBaseTexture = null; - - /** - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * @property textures - * @type Array - */ - this.textures = []; - - /** - * @property blendModes - * @type Array - */ - this.blendModes = []; - - /** - * @property shaders - * @type Array - */ - this.shaders = []; - - /** - * @property sprites - * @type Array - */ - this.sprites = []; - - /** - * @property defaultShader - * @type AbstractFilter - */ - this.defaultShader = new PIXI.AbstractFilter([ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]); -}; - -/** -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLSpriteBatch.prototype.setContext = function(gl) -{ - this.gl = gl; - - // create a couple of buffers - this.vertexBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // 65535 is max index, so 65535 / 6 = 10922. - - //upload the index data - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); - - this.currentBlendMode = 99999; - - var shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc = this.defaultShader.fragmentSrc; - shader.uniforms = {}; - shader.init(); - - this.defaultShader.shaders[gl.id] = shader; -}; - -/** -* @method begin -* @param renderSession {Object} The RenderSession object -*/ -PIXI.WebGLSpriteBatch.prototype.begin = function(renderSession) -{ - this.renderSession = renderSession; - this.shader = this.renderSession.shaderManager.defaultShader; - - this.start(); -}; - -/** -* @method end -*/ -PIXI.WebGLSpriteBatch.prototype.end = function() -{ - this.flush(); -}; - -/** -* @method render -* @param sprite {Sprite} the sprite to render when using this spritebatch -*/ -PIXI.WebGLSpriteBatch.prototype.render = function(sprite) -{ - var texture = sprite.texture; - - //TODO set blend modes.. - // check texture.. - if(this.currentBatchSize >= this.size) - { - this.flush(); - this.currentBaseTexture = texture.baseTexture; - } - - // get the uvs for the texture - var uvs = texture._uvs; - // if the uvs have not updated then no point rendering just yet! - if(!uvs)return; - - // TODO trim?? - var aX = sprite.anchor.x; - var aY = sprite.anchor.y; - - var w0, w1, h0, h1; - - if (texture.trim) - { - // if the sprite is trimmed then we need to add the extra space before transforming the sprite coords.. - var trim = texture.trim; - - w1 = trim.x - aX * trim.width; - w0 = w1 + texture.crop.width; - - h1 = trim.y - aY * trim.height; - h0 = h1 + texture.crop.height; - - } - else - { - w0 = (texture.frame.width ) * (1-aX); - w1 = (texture.frame.width ) * -aX; - - h0 = texture.frame.height * (1-aY); - h1 = texture.frame.height * -aY; - } - - var index = this.currentBatchSize * 4 * this.vertSize; - - var resolution = texture.baseTexture.resolution; - - var worldTransform = sprite.worldTransform; - - var a = worldTransform.a / resolution; - var b = worldTransform.b / resolution; - var c = worldTransform.c / resolution; - var d = worldTransform.d / resolution; - var tx = worldTransform.tx; - var ty = worldTransform.ty; - - var colors = this.colors; - var positions = this.positions; - - if(this.renderSession.roundPixels) - { - // xy - positions[index] = a * w1 + c * h1 + tx | 0; - positions[index+1] = d * h1 + b * w1 + ty | 0; - - // xy - positions[index+5] = a * w0 + c * h1 + tx | 0; - positions[index+6] = d * h1 + b * w0 + ty | 0; - - // xy - positions[index+10] = a * w0 + c * h0 + tx | 0; - positions[index+11] = d * h0 + b * w0 + ty | 0; - - // xy - positions[index+15] = a * w1 + c * h0 + tx | 0; - positions[index+16] = d * h0 + b * w1 + ty | 0; - } - else - { - // xy - positions[index] = a * w1 + c * h1 + tx; - positions[index+1] = d * h1 + b * w1 + ty; - - // xy - positions[index+5] = a * w0 + c * h1 + tx; - positions[index+6] = d * h1 + b * w0 + ty; - - // xy - positions[index+10] = a * w0 + c * h0 + tx; - positions[index+11] = d * h0 + b * w0 + ty; - - // xy - positions[index+15] = a * w1 + c * h0 + tx; - positions[index+16] = d * h0 + b * w1 + ty; - } - - // uv - positions[index+2] = uvs.x0; - positions[index+3] = uvs.y0; - - // uv - positions[index+7] = uvs.x1; - positions[index+8] = uvs.y1; - - // uv - positions[index+12] = uvs.x2; - positions[index+13] = uvs.y2; - - // uv - positions[index+17] = uvs.x3; - positions[index+18] = uvs.y3; - - // color and alpha - var tint = sprite.tint; - colors[index+4] = colors[index+9] = colors[index+14] = colors[index+19] = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16) + (sprite.worldAlpha * 255 << 24); - - // increment the batchsize - this.sprites[this.currentBatchSize++] = sprite; - - -}; - -/** -* Renders a TilingSprite using the spriteBatch. -* -* @method renderTilingSprite -* @param sprite {TilingSprite} the tilingSprite to render -*/ -PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite) -{ - var texture = tilingSprite.tilingTexture; - - // check texture.. - if(this.currentBatchSize >= this.size) - { - //return; - this.flush(); - this.currentBaseTexture = texture.baseTexture; - } - - // set the textures uvs temporarily - // TODO create a separate texture so that we can tile part of a texture - - if(!tilingSprite._uvs)tilingSprite._uvs = new PIXI.TextureUvs(); - - var uvs = tilingSprite._uvs; - - tilingSprite.tilePosition.x %= texture.baseTexture.width * tilingSprite.tileScaleOffset.x; - tilingSprite.tilePosition.y %= texture.baseTexture.height * tilingSprite.tileScaleOffset.y; - - var offsetX = tilingSprite.tilePosition.x/(texture.baseTexture.width*tilingSprite.tileScaleOffset.x); - var offsetY = tilingSprite.tilePosition.y/(texture.baseTexture.height*tilingSprite.tileScaleOffset.y); - - var scaleX = (tilingSprite.width / texture.baseTexture.width) / (tilingSprite.tileScale.x * tilingSprite.tileScaleOffset.x); - var scaleY = (tilingSprite.height / texture.baseTexture.height) / (tilingSprite.tileScale.y * tilingSprite.tileScaleOffset.y); - - uvs.x0 = 0 - offsetX; - uvs.y0 = 0 - offsetY; - - uvs.x1 = (1 * scaleX) - offsetX; - uvs.y1 = 0 - offsetY; - - uvs.x2 = (1 * scaleX) - offsetX; - uvs.y2 = (1 * scaleY) - offsetY; - - uvs.x3 = 0 - offsetX; - uvs.y3 = (1 * scaleY) - offsetY; - - // get the tilingSprites current alpha and tint and combining them into a single color - var tint = tilingSprite.tint; - var color = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16) + (tilingSprite.alpha * 255 << 24); - - var positions = this.positions; - var colors = this.colors; - - var width = tilingSprite.width; - var height = tilingSprite.height; - - // TODO trim?? - var aX = tilingSprite.anchor.x; - var aY = tilingSprite.anchor.y; - var w0 = width * (1-aX); - var w1 = width * -aX; - - var h0 = height * (1-aY); - var h1 = height * -aY; - - var index = this.currentBatchSize * 4 * this.vertSize; - - var resolution = texture.baseTexture.resolution; - - var worldTransform = tilingSprite.worldTransform; - - var a = worldTransform.a / resolution;//[0]; - var b = worldTransform.b / resolution;//[3]; - var c = worldTransform.c / resolution;//[1]; - var d = worldTransform.d / resolution;//[4]; - var tx = worldTransform.tx;//[2]; - var ty = worldTransform.ty;//[5]; - - // xy - positions[index++] = a * w1 + c * h1 + tx; - positions[index++] = d * h1 + b * w1 + ty; - // uv - positions[index++] = uvs.x0; - positions[index++] = uvs.y0; - // color - colors[index++] = color; - - // xy - positions[index++] = (a * w0 + c * h1 + tx); - positions[index++] = d * h1 + b * w0 + ty; - // uv - positions[index++] = uvs.x1; - positions[index++] = uvs.y1; - // color - colors[index++] = color; - - // xy - positions[index++] = a * w0 + c * h0 + tx; - positions[index++] = d * h0 + b * w0 + ty; - // uv - positions[index++] = uvs.x2; - positions[index++] = uvs.y2; - // color - colors[index++] = color; - - // xy - positions[index++] = a * w1 + c * h0 + tx; - positions[index++] = d * h0 + b * w1 + ty; - // uv - positions[index++] = uvs.x3; - positions[index++] = uvs.y3; - // color - colors[index++] = color; - - // increment the batchsize - this.sprites[this.currentBatchSize++] = tilingSprite; -}; - -/** -* Renders the content and empties the current batch. -* -* @method flush -*/ -PIXI.WebGLSpriteBatch.prototype.flush = function() -{ - // If the batch is length 0 then return as there is nothing to draw - if (this.currentBatchSize===0)return; - - var gl = this.gl; - var shader; - - if(this.dirty) - { - this.dirty = false; - // bind the main texture - gl.activeTexture(gl.TEXTURE0); - - // bind the buffers - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - shader = this.defaultShader.shaders[gl.id]; - - // this is the same for each shader? - var stride = this.vertSize * 4; - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, stride, 2 * 4); - - // color attributes will be interpreted as unsigned bytes and normalized - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.UNSIGNED_BYTE, true, stride, 4 * 4); - } - - // upload the verts to the buffer - if(this.currentBatchSize > ( this.size * 0.5 ) ) - { - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - } - else - { - var view = this.positions.subarray(0, this.currentBatchSize * 4 * this.vertSize); - gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); - } - - var nextTexture, nextBlendMode, nextShader; - var batchSize = 0; - var start = 0; - - var currentBaseTexture = null; - var currentBlendMode = this.renderSession.blendModeManager.currentBlendMode; - var currentShader = null; - - var blendSwap = false; - var shaderSwap = false; - var sprite; - - for (var i = 0, j = this.currentBatchSize; i < j; i++) { - - sprite = this.sprites[i]; - - nextTexture = sprite.texture.baseTexture; - nextBlendMode = sprite.blendMode; - nextShader = sprite.shader || this.defaultShader; - - blendSwap = currentBlendMode !== nextBlendMode; - shaderSwap = currentShader !== nextShader; // should I use _UIDS??? - - if(currentBaseTexture !== nextTexture || blendSwap || shaderSwap) - { - this.renderBatch(currentBaseTexture, batchSize, start); - - start = i; - batchSize = 0; - currentBaseTexture = nextTexture; - - if( blendSwap ) - { - currentBlendMode = nextBlendMode; - this.renderSession.blendModeManager.setBlendMode( currentBlendMode ); - } - - if( shaderSwap ) - { - currentShader = nextShader; - - shader = currentShader.shaders[gl.id]; - - if(!shader) - { - shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc =currentShader.fragmentSrc; - shader.uniforms =currentShader.uniforms; - shader.init(); - - currentShader.shaders[gl.id] = shader; - } - - // set shader function??? - this.renderSession.shaderManager.setShader(shader); - - if(shader.dirty)shader.syncUniforms(); - - // both thease only need to be set if they are changing.. - // set the projection - var projection = this.renderSession.projection; - gl.uniform2f(shader.projectionVector, projection.x, projection.y); - - // TODO - this is temprorary! - var offsetVector = this.renderSession.offset; - gl.uniform2f(shader.offsetVector, offsetVector.x, offsetVector.y); - - // set the pointers - } - } - - batchSize++; - } - - this.renderBatch(currentBaseTexture, batchSize, start); - - // then reset the batch! - this.currentBatchSize = 0; -}; - -/** -* @method renderBatch -* @param texture {Texture} -* @param size {Number} -* @param startIndex {Number} -*/ -PIXI.WebGLSpriteBatch.prototype.renderBatch = function(texture, size, startIndex) -{ - if(size === 0)return; - - var gl = this.gl; - - // check if a texture is dirty.. - if(texture._dirty[gl.id]) - { - this.renderSession.renderer.updateTexture(texture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]); - } - - // now draw those suckas! - gl.drawElements(gl.TRIANGLES, size * 6, gl.UNSIGNED_SHORT, startIndex * 6 * 2); - - // increment the draw count - this.renderSession.drawCount++; -}; - -/** -* @method stop -*/ -PIXI.WebGLSpriteBatch.prototype.stop = function() -{ - this.flush(); - this.dirty = true; -}; - -/** -* @method start -*/ -PIXI.WebGLSpriteBatch.prototype.start = function() -{ - this.dirty = true; -}; - -/** -* Destroys the SpriteBatch. -* -* @method destroy -*/ -PIXI.WebGLSpriteBatch.prototype.destroy = function() -{ - this.vertices = null; - this.indices = null; - - this.gl.deleteBuffer( this.vertexBuffer ); - this.gl.deleteBuffer( this.indexBuffer ); - - this.currentBaseTexture = null; - - this.gl = null; -}; -/** - * @author Mat Groves - * - * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ - * for creating the original pixi version! - * - * Heavily inspired by LibGDX's WebGLSpriteBatch: - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java - */ - -/** -* @class WebGLFastSpriteBatch -* @constructor -*/ -PIXI.WebGLFastSpriteBatch = function(gl) -{ - /** - * @property vertSize - * @type Number - */ - this.vertSize = 10; - - /** - * @property maxSize - * @type Number - */ - this.maxSize = 6000;//Math.pow(2, 16) / this.vertSize; - - /** - * @property size - * @type Number - */ - this.size = this.maxSize; - - //the total number of floats in our batch - var numVerts = this.size * 4 * this.vertSize; - - //the total number of indices in our batch - var numIndices = this.maxSize * 6; - - /** - * Vertex data - * @property vertices - * @type Float32Array - */ - this.vertices = new PIXI.Float32Array(numVerts); - - /** - * Index data - * @property indices - * @type Uint16Array - */ - this.indices = new PIXI.Uint16Array(numIndices); - - /** - * @property vertexBuffer - * @type Object - */ - this.vertexBuffer = null; - - /** - * @property indexBuffer - * @type Object - */ - this.indexBuffer = null; - - /** - * @property lastIndexCount - * @type Number - */ - this.lastIndexCount = 0; - - for (var i=0, j=0; i < numIndices; i += 6, j += 4) - { - this.indices[i + 0] = j + 0; - this.indices[i + 1] = j + 1; - this.indices[i + 2] = j + 2; - this.indices[i + 3] = j + 0; - this.indices[i + 4] = j + 2; - this.indices[i + 5] = j + 3; - } - - /** - * @property drawing - * @type Boolean - */ - this.drawing = false; - - /** - * @property currentBatchSize - * @type Number - */ - this.currentBatchSize = 0; - - /** - * @property currentBaseTexture - * @type BaseTexture - */ - this.currentBaseTexture = null; - - /** - * @property currentBlendMode - * @type Number - */ - this.currentBlendMode = 0; - - /** - * @property renderSession - * @type Object - */ - this.renderSession = null; - - /** - * @property shader - * @type Object - */ - this.shader = null; - - /** - * @property matrix - * @type Matrix - */ - this.matrix = null; - - this.setContext(gl); -}; - -PIXI.WebGLFastSpriteBatch.prototype.constructor = PIXI.WebGLFastSpriteBatch; - -/** - * Sets the WebGL Context. - * - * @method setContext - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLFastSpriteBatch.prototype.setContext = function(gl) -{ - this.gl = gl; - - // create a couple of buffers - this.vertexBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // 65535 is max index, so 65535 / 6 = 10922. - - //upload the index data - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); -}; - -/** - * @method begin - * @param spriteBatch {WebGLSpriteBatch} - * @param renderSession {Object} - */ -PIXI.WebGLFastSpriteBatch.prototype.begin = function(spriteBatch, renderSession) -{ - this.renderSession = renderSession; - this.shader = this.renderSession.shaderManager.fastShader; - - this.matrix = spriteBatch.worldTransform.toArray(true); - - this.start(); -}; - -/** - * @method end - */ -PIXI.WebGLFastSpriteBatch.prototype.end = function() -{ - this.flush(); -}; - -/** - * @method render - * @param spriteBatch {WebGLSpriteBatch} - */ -PIXI.WebGLFastSpriteBatch.prototype.render = function(spriteBatch) -{ - var children = spriteBatch.children; - var sprite = children[0]; - - // if the uvs have not updated then no point rendering just yet! - - // check texture. - if(!sprite.texture._uvs)return; - - this.currentBaseTexture = sprite.texture.baseTexture; - - // check blend mode - if(sprite.blendMode !== this.renderSession.blendModeManager.currentBlendMode) - { - this.flush(); - this.renderSession.blendModeManager.setBlendMode(sprite.blendMode); - } - - for(var i=0,j= children.length; i= this.size) - { - this.flush(); - } -}; - -/** - * @method flush - */ -PIXI.WebGLFastSpriteBatch.prototype.flush = function() -{ - // If the batch is length 0 then return as there is nothing to draw - if (this.currentBatchSize===0)return; - - var gl = this.gl; - - // bind the current texture - - if(!this.currentBaseTexture._glTextures[gl.id])this.renderSession.renderer.updateTexture(this.currentBaseTexture, gl); - - gl.bindTexture(gl.TEXTURE_2D, this.currentBaseTexture._glTextures[gl.id]); - - // upload the verts to the buffer - - if(this.currentBatchSize > ( this.size * 0.5 ) ) - { - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - } - else - { - var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize); - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); - } - - // now draw those suckas! - gl.drawElements(gl.TRIANGLES, this.currentBatchSize * 6, gl.UNSIGNED_SHORT, 0); - - // then reset the batch! - this.currentBatchSize = 0; - - // increment the draw count - this.renderSession.drawCount++; -}; - - -/** - * @method stop - */ -PIXI.WebGLFastSpriteBatch.prototype.stop = function() -{ - this.flush(); -}; - -/** - * @method start - */ -PIXI.WebGLFastSpriteBatch.prototype.start = function() -{ - var gl = this.gl; - - // bind the main texture - gl.activeTexture(gl.TEXTURE0); - - // bind the buffers - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - // set the projection - var projection = this.renderSession.projection; - gl.uniform2f(this.shader.projectionVector, projection.x, projection.y); - - // set the matrix - gl.uniformMatrix3fv(this.shader.uMatrix, false, this.matrix); - - // set the pointers - var stride = this.vertSize * 4; - - gl.vertexAttribPointer(this.shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0); - gl.vertexAttribPointer(this.shader.aPositionCoord, 2, gl.FLOAT, false, stride, 2 * 4); - gl.vertexAttribPointer(this.shader.aScale, 2, gl.FLOAT, false, stride, 4 * 4); - gl.vertexAttribPointer(this.shader.aRotation, 1, gl.FLOAT, false, stride, 6 * 4); - gl.vertexAttribPointer(this.shader.aTextureCoord, 2, gl.FLOAT, false, stride, 7 * 4); - gl.vertexAttribPointer(this.shader.colorAttribute, 1, gl.FLOAT, false, stride, 9 * 4); - -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLFilterManager -* @constructor -*/ -PIXI.WebGLFilterManager = function() -{ - /** - * @property filterStack - * @type Array - */ - this.filterStack = []; - - /** - * @property offsetX - * @type Number - */ - this.offsetX = 0; - - /** - * @property offsetY - * @type Number - */ - this.offsetY = 0; -}; - -PIXI.WebGLFilterManager.prototype.constructor = PIXI.WebGLFilterManager; - -/** -* Initialises the context and the properties. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLFilterManager.prototype.setContext = function(gl) -{ - this.gl = gl; - this.texturePool = []; - - this.initShaderBuffers(); -}; - -/** -* @method begin -* @param renderSession {RenderSession} -* @param buffer {ArrayBuffer} -*/ -PIXI.WebGLFilterManager.prototype.begin = function(renderSession, buffer) -{ - this.renderSession = renderSession; - this.defaultShader = renderSession.shaderManager.defaultShader; - - var projection = this.renderSession.projection; - this.width = projection.x * 2; - this.height = -projection.y * 2; - this.buffer = buffer; -}; - -/** -* Applies the filter and adds it to the current filter stack. -* -* @method pushFilter -* @param filterBlock {Object} the filter that will be pushed to the current filter stack -*/ -PIXI.WebGLFilterManager.prototype.pushFilter = function(filterBlock) -{ - var gl = this.gl; - - var projection = this.renderSession.projection; - var offset = this.renderSession.offset; - - filterBlock._filterArea = filterBlock.target.filterArea || filterBlock.target.getBounds(); - - // filter program - // OPTIMISATION - the first filter is free if its a simple color change? - this.filterStack.push(filterBlock); - - var filter = filterBlock.filterPasses[0]; - - this.offsetX += filterBlock._filterArea.x; - this.offsetY += filterBlock._filterArea.y; - - var texture = this.texturePool.pop(); - if(!texture) - { - texture = new PIXI.FilterTexture(this.gl, this.width, this.height); - } - else - { - texture.resize(this.width, this.height); - } - - gl.bindTexture(gl.TEXTURE_2D, texture.texture); - - var filterArea = filterBlock._filterArea;// filterBlock.target.getBounds();///filterBlock.target.filterArea; - - var padding = filter.padding; - filterArea.x -= padding; - filterArea.y -= padding; - filterArea.width += padding * 2; - filterArea.height += padding * 2; - - // cap filter to screen size.. - if(filterArea.x < 0)filterArea.x = 0; - if(filterArea.width > this.width)filterArea.width = this.width; - if(filterArea.y < 0)filterArea.y = 0; - if(filterArea.height > this.height)filterArea.height = this.height; - - //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, filterArea.width, filterArea.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); - gl.bindFramebuffer(gl.FRAMEBUFFER, texture.frameBuffer); - - // set view port - gl.viewport(0, 0, filterArea.width, filterArea.height); - - projection.x = filterArea.width/2; - projection.y = -filterArea.height/2; - - offset.x = -filterArea.x; - offset.y = -filterArea.y; - - // update projection - // now restore the regular shader.. - // this.renderSession.shaderManager.setShader(this.defaultShader); - //gl.uniform2f(this.defaultShader.projectionVector, filterArea.width/2, -filterArea.height/2); - //gl.uniform2f(this.defaultShader.offsetVector, -filterArea.x, -filterArea.y); - - gl.colorMask(true, true, true, true); - gl.clearColor(0,0,0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); - - filterBlock._glFilterTexture = texture; - -}; - -/** -* Removes the last filter from the filter stack and doesn't return it. -* -* @method popFilter -*/ -PIXI.WebGLFilterManager.prototype.popFilter = function() -{ - var gl = this.gl; - var filterBlock = this.filterStack.pop(); - var filterArea = filterBlock._filterArea; - var texture = filterBlock._glFilterTexture; - var projection = this.renderSession.projection; - var offset = this.renderSession.offset; - - if(filterBlock.filterPasses.length > 1) - { - gl.viewport(0, 0, filterArea.width, filterArea.height); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - - this.vertexArray[0] = 0; - this.vertexArray[1] = filterArea.height; - - this.vertexArray[2] = filterArea.width; - this.vertexArray[3] = filterArea.height; - - this.vertexArray[4] = 0; - this.vertexArray[5] = 0; - - this.vertexArray[6] = filterArea.width; - this.vertexArray[7] = 0; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - // now set the uvs.. - this.uvArray[2] = filterArea.width/this.width; - this.uvArray[5] = filterArea.height/this.height; - this.uvArray[6] = filterArea.width/this.width; - this.uvArray[7] = filterArea.height/this.height; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray); - - var inputTexture = texture; - var outputTexture = this.texturePool.pop(); - if(!outputTexture)outputTexture = new PIXI.FilterTexture(this.gl, this.width, this.height); - outputTexture.resize(this.width, this.height); - - // need to clear this FBO as it may have some left over elements from a previous filter. - gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer ); - gl.clear(gl.COLOR_BUFFER_BIT); - - gl.disable(gl.BLEND); - - for (var i = 0; i < filterBlock.filterPasses.length-1; i++) - { - var filterPass = filterBlock.filterPasses[i]; - - gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer ); - - // set texture - gl.activeTexture(gl.TEXTURE0); - gl.bindTexture(gl.TEXTURE_2D, inputTexture.texture); - - // draw texture.. - //filterPass.applyFilterPass(filterArea.width, filterArea.height); - this.applyFilterPass(filterPass, filterArea, filterArea.width, filterArea.height); - - // swap the textures.. - var temp = inputTexture; - inputTexture = outputTexture; - outputTexture = temp; - } - - gl.enable(gl.BLEND); - - texture = inputTexture; - this.texturePool.push(outputTexture); - } - - var filter = filterBlock.filterPasses[filterBlock.filterPasses.length-1]; - - this.offsetX -= filterArea.x; - this.offsetY -= filterArea.y; - - var sizeX = this.width; - var sizeY = this.height; - - var offsetX = 0; - var offsetY = 0; - - var buffer = this.buffer; - - // time to render the filters texture to the previous scene - if(this.filterStack.length === 0) - { - gl.colorMask(true, true, true, true);//this.transparent); - } - else - { - var currentFilter = this.filterStack[this.filterStack.length-1]; - filterArea = currentFilter._filterArea; - - sizeX = filterArea.width; - sizeY = filterArea.height; - - offsetX = filterArea.x; - offsetY = filterArea.y; - - buffer = currentFilter._glFilterTexture.frameBuffer; - } - - // TODO need to remove these global elements.. - projection.x = sizeX/2; - projection.y = -sizeY/2; - - offset.x = offsetX; - offset.y = offsetY; - - filterArea = filterBlock._filterArea; - - var x = filterArea.x-offsetX; - var y = filterArea.y-offsetY; - - // update the buffers.. - // make sure to flip the y! - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - - this.vertexArray[0] = x; - this.vertexArray[1] = y + filterArea.height; - - this.vertexArray[2] = x + filterArea.width; - this.vertexArray[3] = y + filterArea.height; - - this.vertexArray[4] = x; - this.vertexArray[5] = y; - - this.vertexArray[6] = x + filterArea.width; - this.vertexArray[7] = y; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - - this.uvArray[2] = filterArea.width/this.width; - this.uvArray[5] = filterArea.height/this.height; - this.uvArray[6] = filterArea.width/this.width; - this.uvArray[7] = filterArea.height/this.height; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray); - - gl.viewport(0, 0, sizeX * this.renderSession.resolution, sizeY * this.renderSession.resolution); - - // bind the buffer - gl.bindFramebuffer(gl.FRAMEBUFFER, buffer ); - - // set the blend mode! - //gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA) - - // set texture - gl.activeTexture(gl.TEXTURE0); - gl.bindTexture(gl.TEXTURE_2D, texture.texture); - - // apply! - this.applyFilterPass(filter, filterArea, sizeX, sizeY); - - // now restore the regular shader.. should happen automatically now.. - // this.renderSession.shaderManager.setShader(this.defaultShader); - // gl.uniform2f(this.defaultShader.projectionVector, sizeX/2, -sizeY/2); - // gl.uniform2f(this.defaultShader.offsetVector, -offsetX, -offsetY); - - // return the texture to the pool - this.texturePool.push(texture); - filterBlock._glFilterTexture = null; -}; - - -/** -* Applies the filter to the specified area. -* -* @method applyFilterPass -* @param filter {AbstractFilter} the filter that needs to be applied -* @param filterArea {Texture} TODO - might need an update -* @param width {Number} the horizontal range of the filter -* @param height {Number} the vertical range of the filter -*/ -PIXI.WebGLFilterManager.prototype.applyFilterPass = function(filter, filterArea, width, height) -{ - // use program - var gl = this.gl; - var shader = filter.shaders[gl.id]; - - if(!shader) - { - shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc = filter.fragmentSrc; - shader.uniforms = filter.uniforms; - shader.init(); - - filter.shaders[gl.id] = shader; - } - - // set the shader - this.renderSession.shaderManager.setShader(shader); - -// gl.useProgram(shader.program); - - gl.uniform2f(shader.projectionVector, width/2, -height/2); - gl.uniform2f(shader.offsetVector, 0,0); - - if(filter.uniforms.dimensions) - { - filter.uniforms.dimensions.value[0] = this.width;//width; - filter.uniforms.dimensions.value[1] = this.height;//height; - filter.uniforms.dimensions.value[2] = this.vertexArray[0]; - filter.uniforms.dimensions.value[3] = this.vertexArray[5];//filterArea.height; - } - - shader.syncUniforms(); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer); - gl.vertexAttribPointer(shader.colorAttribute, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - // draw the filter... - gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 ); - - this.renderSession.drawCount++; -}; - -/** -* Initialises the shader buffers. -* -* @method initShaderBuffers -*/ -PIXI.WebGLFilterManager.prototype.initShaderBuffers = function() -{ - var gl = this.gl; - - // create some buffers - this.vertexBuffer = gl.createBuffer(); - this.uvBuffer = gl.createBuffer(); - this.colorBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // bind and upload the vertexs.. - // keep a reference to the vertexFloatData.. - this.vertexArray = new PIXI.Float32Array([0.0, 0.0, - 1.0, 0.0, - 0.0, 1.0, - 1.0, 1.0]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertexArray, gl.STATIC_DRAW); - - // bind and upload the uv buffer - this.uvArray = new PIXI.Float32Array([0.0, 0.0, - 1.0, 0.0, - 0.0, 1.0, - 1.0, 1.0]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvArray, gl.STATIC_DRAW); - - this.colorArray = new PIXI.Float32Array([1.0, 0xFFFFFF, - 1.0, 0xFFFFFF, - 1.0, 0xFFFFFF, - 1.0, 0xFFFFFF]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.colorArray, gl.STATIC_DRAW); - - // bind and upload the index - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 1, 3, 2]), gl.STATIC_DRAW); - -}; - -/** -* Destroys the filter and removes it from the filter stack. -* -* @method destroy -*/ -PIXI.WebGLFilterManager.prototype.destroy = function() -{ - var gl = this.gl; - - this.filterStack = null; - - this.offsetX = 0; - this.offsetY = 0; - - // destroy textures - for (var i = 0; i < this.texturePool.length; i++) { - this.texturePool[i].destroy(); - } - - this.texturePool = null; - - //destroy buffers.. - gl.deleteBuffer(this.vertexBuffer); - gl.deleteBuffer(this.uvBuffer); - gl.deleteBuffer(this.colorBuffer); - gl.deleteBuffer(this.indexBuffer); -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class FilterTexture -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -* @param width {Number} the horizontal range of the filter -* @param height {Number} the vertical range of the filter -* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values -*/ -PIXI.FilterTexture = function(gl, width, height, scaleMode) -{ - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - // next time to create a frame buffer and texture - - /** - * @property frameBuffer - * @type Any - */ - this.frameBuffer = gl.createFramebuffer(); - - /** - * @property texture - * @type Any - */ - this.texture = gl.createTexture(); - - /** - * @property scaleMode - * @type Number - */ - scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - gl.bindTexture(gl.TEXTURE_2D, this.texture); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer ); - - gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer ); - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); - - // required for masking a mask?? - this.renderBuffer = gl.createRenderbuffer(); - gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer); - gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.renderBuffer); - - this.resize(width, height); -}; - -PIXI.FilterTexture.prototype.constructor = PIXI.FilterTexture; - -/** -* Clears the filter texture. -* -* @method clear -*/ -PIXI.FilterTexture.prototype.clear = function() -{ - var gl = this.gl; - - gl.clearColor(0,0,0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); -}; - -/** - * Resizes the texture to the specified width and height - * - * @method resize - * @param width {Number} the new width of the texture - * @param height {Number} the new height of the texture - */ -PIXI.FilterTexture.prototype.resize = function(width, height) -{ - if(this.width === width && this.height === height) return; - - this.width = width; - this.height = height; - - var gl = this.gl; - - gl.bindTexture(gl.TEXTURE_2D, this.texture); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width , height , 0, gl.RGBA, gl.UNSIGNED_BYTE, null); - // update the stencil buffer width and height - gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer); - gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width , height ); -}; - -/** -* Destroys the filter texture. -* -* @method destroy -*/ -PIXI.FilterTexture.prototype.destroy = function() -{ - var gl = this.gl; - gl.deleteFramebuffer( this.frameBuffer ); - gl.deleteTexture( this.texture ); - - this.frameBuffer = null; - this.texture = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Creates a Canvas element of the given size. - * - * @class CanvasBuffer - * @constructor - * @param width {Number} the width for the newly created canvas - * @param height {Number} the height for the newly created canvas - */ -PIXI.CanvasBuffer = function(width, height) -{ - /** - * The width of the Canvas in pixels. - * - * @property width - * @type Number - */ - this.width = width; - - /** - * The height of the Canvas in pixels. - * - * @property height - * @type Number - */ - this.height = height; - - /** - * The Canvas object that belongs to this CanvasBuffer. - * - * @property canvas - * @type HTMLCanvasElement - */ - this.canvas = document.createElement("canvas"); - - /** - * A CanvasRenderingContext2D object representing a two-dimensional rendering context. - * - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.canvas.getContext("2d"); - - this.canvas.width = width; - this.canvas.height = height; -}; - -PIXI.CanvasBuffer.prototype.constructor = PIXI.CanvasBuffer; - -/** - * Clears the canvas that was created by the CanvasBuffer class. - * - * @method clear - * @private - */ -PIXI.CanvasBuffer.prototype.clear = function() -{ - this.context.setTransform(1, 0, 0, 1, 0, 0); - this.context.clearRect(0,0, this.width, this.height); -}; - -/** - * Resizes the canvas to the specified width and height. - * - * @method resize - * @param width {Number} the new width of the canvas - * @param height {Number} the new height of the canvas - */ -PIXI.CanvasBuffer.prototype.resize = function(width, height) -{ - this.width = this.canvas.width = width; - this.height = this.canvas.height = height; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A set of functions used to handle masking. - * - * @class CanvasMaskManager - * @constructor - */ -PIXI.CanvasMaskManager = function() -{ -}; - -PIXI.CanvasMaskManager.prototype.constructor = PIXI.CanvasMaskManager; - -/** - * This method adds it to the current stack of masks. - * - * @method pushMask - * @param maskData {Object} the maskData that will be pushed - * @param renderSession {Object} The renderSession whose context will be used for this mask manager. - */ -PIXI.CanvasMaskManager.prototype.pushMask = function(maskData, renderSession) -{ - var context = renderSession.context; - - context.save(); - - var cacheAlpha = maskData.alpha; - var transform = maskData.worldTransform; - - var resolution = renderSession.resolution; - - context.setTransform(transform.a * resolution, - transform.b * resolution, - transform.c * resolution, - transform.d * resolution, - transform.tx * resolution, - transform.ty * resolution); - - PIXI.CanvasGraphics.renderGraphicsMask(maskData, context); - - context.clip(); - - maskData.worldAlpha = cacheAlpha; -}; - -/** - * Restores the current drawing context to the state it was before the mask was applied. - * - * @method popMask - * @param renderSession {Object} The renderSession whose context will be used for this mask manager. - */ -PIXI.CanvasMaskManager.prototype.popMask = function(renderSession) -{ - renderSession.context.restore(); -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Utility methods for Sprite/Texture tinting. - * - * @class CanvasTinter - * @static - */ -PIXI.CanvasTinter = function() -{ -}; - -/** - * Basically this method just needs a sprite and a color and tints the sprite with the given color. - * - * @method getTintedTexture - * @static - * @param sprite {Sprite} the sprite to tint - * @param color {Number} the color to use to tint the sprite with - * @return {HTMLCanvasElement} The tinted canvas - */ -PIXI.CanvasTinter.getTintedTexture = function(sprite, color) -{ - var texture = sprite.texture; - - color = PIXI.CanvasTinter.roundColor(color); - - var stringColor = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - - texture.tintCache = texture.tintCache || {}; - - if(texture.tintCache[stringColor]) return texture.tintCache[stringColor]; - - // clone texture.. - var canvas = PIXI.CanvasTinter.canvas || document.createElement("canvas"); - - //PIXI.CanvasTinter.tintWithPerPixel(texture, stringColor, canvas); - PIXI.CanvasTinter.tintMethod(texture, color, canvas); - - if(PIXI.CanvasTinter.convertTintToImage) - { - // is this better? - var tintImage = new Image(); - tintImage.src = canvas.toDataURL(); - - texture.tintCache[stringColor] = tintImage; - } - else - { - texture.tintCache[stringColor] = canvas; - // if we are not converting the texture to an image then we need to lose the reference to the canvas - PIXI.CanvasTinter.canvas = null; - } - - return canvas; -}; - -/** - * Tint a texture using the "multiply" operation. - * - * @method tintWithMultiply - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithMultiply = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - - context.fillRect(0, 0, crop.width, crop.height); - - context.globalCompositeOperation = "multiply"; - - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - context.globalCompositeOperation = "destination-atop"; - - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); -}; - -/** - * Tint a texture using the "overlay" operation. - * - * @method tintWithOverlay - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithOverlay = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.globalCompositeOperation = "copy"; - context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - context.fillRect(0, 0, crop.width, crop.height); - - context.globalCompositeOperation = "destination-atop"; - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - //context.globalCompositeOperation = "copy"; -}; - -/** - * Tint a texture pixel per pixel. - * - * @method tintPerPixel - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithPerPixel = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.globalCompositeOperation = "copy"; - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - var rgbValues = PIXI.hex2rgb(color); - var r = rgbValues[0], g = rgbValues[1], b = rgbValues[2]; - - var pixelData = context.getImageData(0, 0, crop.width, crop.height); - - var pixels = pixelData.data; - - for (var i = 0; i < pixels.length; i += 4) - { - pixels[i+0] *= r; - pixels[i+1] *= g; - pixels[i+2] *= b; - } - - context.putImageData(pixelData, 0, 0); -}; - -/** - * Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel. - * - * @method roundColor - * @static - * @param color {number} the color to round, should be a hex color - */ -PIXI.CanvasTinter.roundColor = function(color) -{ - var step = PIXI.CanvasTinter.cacheStepsPerColorChannel; - - var rgbValues = PIXI.hex2rgb(color); - - rgbValues[0] = Math.min(255, (rgbValues[0] / step) * step); - rgbValues[1] = Math.min(255, (rgbValues[1] / step) * step); - rgbValues[2] = Math.min(255, (rgbValues[2] / step) * step); - - return PIXI.rgb2hex(rgbValues); -}; - -/** - * Number of steps which will be used as a cap when rounding colors. - * - * @property cacheStepsPerColorChannel - * @type Number - * @static - */ -PIXI.CanvasTinter.cacheStepsPerColorChannel = 8; - -/** - * Tint cache boolean flag. - * - * @property convertTintToImage - * @type Boolean - * @static - */ -PIXI.CanvasTinter.convertTintToImage = false; - -/** - * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. - * - * @property canUseMultiply - * @type Boolean - * @static - */ -PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes(); - -/** - * The tinting method that will be used. - * - * @method tintMethod - * @static - */ -PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The CanvasRenderer draws the Stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. - * Don't forget to add the CanvasRenderer.view to your DOM or you will not see anything :) - * - * @class CanvasRenderer - * @constructor - * @param [width=800] {Number} the width of the canvas view - * @param [height=600] {Number} the height of the canvas view - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * @param [options.clearBeforeRender=true] {Boolean} This sets if the CanvasRenderer will clear the canvas or not before the new render pass. - */ -PIXI.CanvasRenderer = function(width, height, options) -{ - if(options) - { - for (var i in PIXI.defaultRenderOptions) - { - if (typeof options[i] === "undefined") options[i] = PIXI.defaultRenderOptions[i]; - } - } - else - { - options = PIXI.defaultRenderOptions; - } - - if(!PIXI.defaultRenderer) - { - PIXI.sayHello("Canvas"); - PIXI.defaultRenderer = this; - } - - /** - * The renderer type. - * - * @property type - * @type Number - */ - this.type = PIXI.CANVAS_RENDERER; - - /** - * The resolution of the canvas. - * - * @property resolution - * @type Number - */ - this.resolution = options.resolution; - - /** - * This sets if the CanvasRenderer will clear the canvas or not before the new render pass. - * If the Stage is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color. - * If the Stage is transparent Pixi will use clearRect to clear the canvas every frame. - * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set. - * - * @property clearBeforeRender - * @type Boolean - * @default - */ - this.clearBeforeRender = options.clearBeforeRender; - - /** - * Whether the render view is transparent - * - * @property transparent - * @type Boolean - */ - this.transparent = options.transparent; - - /** - * Whether the render view should be resized automatically - * - * @property autoResize - * @type Boolean - */ - this.autoResize = options.autoResize || false; - - - /** - * The width of the canvas view - * - * @property width - * @type Number - * @default 800 - */ - this.width = width || 800; - - /** - * The height of the canvas view - * - * @property height - * @type Number - * @default 600 - */ - this.height = height || 600; - - this.width *= this.resolution; - this.height *= this.resolution; - - /** - * The canvas element that everything is drawn to. - * - * @property view - * @type HTMLCanvasElement - */ - this.view = options.view || document.createElement( "canvas" ); - - /** - * The canvas 2d context that everything is drawn with - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.view.getContext( "2d", { alpha: this.transparent } ); - - /** - * Boolean flag controlling canvas refresh. - * - * @property refresh - * @type Boolean - */ - this.refresh = true; - - this.view.width = this.width * this.resolution; - this.view.height = this.height * this.resolution; - - /** - * Internal var. - * - * @property count - * @type Number - */ - this.count = 0; - - /** - * Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer - * @property maskManager - * @type CanvasMaskManager - */ - this.maskManager = new PIXI.CanvasMaskManager(); - - /** - * The render session is just a bunch of parameter used for rendering - * @property renderSession - * @type Object - */ - this.renderSession = { - context: this.context, - maskManager: this.maskManager, - scaleMode: null, - smoothProperty: null, - /** - * If true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation. - * Handy for crisp pixel art and speed on legacy devices. - * - */ - roundPixels: false - }; - - this.mapBlendModes(); - - this.resize(width, height); - - if("imageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "imageSmoothingEnabled"; - else if("webkitImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "webkitImageSmoothingEnabled"; - else if("mozImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "mozImageSmoothingEnabled"; - else if("oImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "oImageSmoothingEnabled"; - else if ("msImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "msImageSmoothingEnabled"; -}; - -// constructor -PIXI.CanvasRenderer.prototype.constructor = PIXI.CanvasRenderer; - -/** - * Renders the Stage to this canvas view - * - * @method render - * @param stage {Stage} the Stage element to be rendered - */ -PIXI.CanvasRenderer.prototype.render = function(stage) -{ - stage.updateTransform(); - - this.context.setTransform(1,0,0,1,0,0); - - this.context.globalAlpha = 1; - - this.renderSession.currentBlendMode = PIXI.blendModes.NORMAL; - this.context.globalCompositeOperation = PIXI.blendModesCanvas[PIXI.blendModes.NORMAL]; - - if (navigator.isCocoonJS && this.view.screencanvas) { - this.context.fillStyle = "black"; - this.context.clear(); - } - - if (this.clearBeforeRender) - { - if (this.transparent) - { - this.context.clearRect(0, 0, this.width, this.height); - } - else - { - this.context.fillStyle = stage.backgroundColorString; - this.context.fillRect(0, 0, this.width , this.height); - } - } - - this.renderDisplayObject(stage); - - // run interaction! - if(stage.interactive) - { - //need to add some events! - if(!stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = true; - stage.interactionManager.setTarget(this); - } - } -}; - -/** - * Removes everything from the renderer and optionally removes the Canvas DOM element. - * - * @method destroy - * @param [removeView=true] {boolean} Removes the Canvas element from the DOM. - */ -PIXI.CanvasRenderer.prototype.destroy = function(removeView) -{ - if (typeof removeView === "undefined") { removeView = true; } - - if (removeView && this.view.parent) - { - this.view.parent.removeChild(this.view); - } - - this.view = null; - this.context = null; - this.maskManager = null; - this.renderSession = null; - -}; - -/** - * Resizes the canvas view to the specified width and height - * - * @method resize - * @param width {Number} the new width of the canvas view - * @param height {Number} the new height of the canvas view - */ -PIXI.CanvasRenderer.prototype.resize = function(width, height) -{ - this.width = width * this.resolution; - this.height = height * this.resolution; - - this.view.width = this.width; - this.view.height = this.height; - - if (this.autoResize) { - this.view.style.width = this.width / this.resolution + "px"; - this.view.style.height = this.height / this.resolution + "px"; - } -}; - -/** - * Renders a display object - * - * @method renderDisplayObject - * @param displayObject {DisplayObject} The displayObject to render - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas - * @private - */ -PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject, context) -{ - this.renderSession.context = context || this.context; - this.renderSession.resolution = this.resolution; - displayObject._renderCanvas(this.renderSession); -}; - -/** - * Maps Pixi blend modes to canvas blend modes. - * - * @method mapBlendModes - * @private - */ -PIXI.CanvasRenderer.prototype.mapBlendModes = function() -{ - if(!PIXI.blendModesCanvas) - { - PIXI.blendModesCanvas = []; - - if(PIXI.canUseNewCanvasBlendModes()) - { - PIXI.blendModesCanvas[PIXI.blendModes.NORMAL] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.ADD] = "lighter"; //IS THIS OK??? - PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "multiply"; - PIXI.blendModesCanvas[PIXI.blendModes.SCREEN] = "screen"; - PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY] = "overlay"; - PIXI.blendModesCanvas[PIXI.blendModes.DARKEN] = "darken"; - PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN] = "lighten"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "color-dodge"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "color-burn"; - PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "hard-light"; - PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "soft-light"; - PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "difference"; - PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "exclusion"; - PIXI.blendModesCanvas[PIXI.blendModes.HUE] = "hue"; - PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "saturation"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR] = "color"; - PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "luminosity"; - } - else - { - // this means that the browser does not support the cool new blend modes in canvas "cough" ie "cough" - PIXI.blendModesCanvas[PIXI.blendModes.NORMAL] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.ADD] = "lighter"; //IS THIS OK??? - PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SCREEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.DARKEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.HUE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "source-over"; - } - } -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - - -/** - * A set of functions used by the canvas renderer to draw the primitive graphics data. - * - * @class CanvasGraphics - * @static - */ -PIXI.CanvasGraphics = function() -{ -}; - -/* - * Renders a PIXI.Graphics object to a canvas. - * - * @method renderGraphics - * @static - * @param graphics {Graphics} the actual graphics object to render - * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas - */ -PIXI.CanvasGraphics.renderGraphics = function(graphics, context) -{ - var worldAlpha = graphics.worldAlpha; - - if(graphics.dirty) - { - this.updateGraphicsTint(graphics); - graphics.dirty = false; - } - - - for (var i = 0; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - var shape = data.shape; - - var fillColor = data._fillTint; - var lineColor = data._lineTint; - - context.lineWidth = data.lineWidth; - - if(data.type === PIXI.Graphics.POLY) - { - context.beginPath(); - - var points = shape.points; - - context.moveTo(points[0], points[1]); - - for (var j=1; j < points.length/2; j++) - { - context.lineTo(points[j * 2], points[j * 2 + 1]); - } - - if(shape.closed) - { - context.lineTo(points[0], points[1]); - } - - // if the first and last point are the same close the path - much neater :) - if(points[0] === points[points.length-2] && points[1] === points[points.length-1]) - { - context.closePath(); - } - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if(data.type === PIXI.Graphics.RECT) - { - - if(data.fillColor || data.fillColor === 0) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fillRect(shape.x, shape.y, shape.width, shape.height); - - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.strokeRect(shape.x, shape.y, shape.width, shape.height); - } - } - else if(data.type === PIXI.Graphics.CIRC) - { - // TODO - need to be Undefined! - context.beginPath(); - context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI); - context.closePath(); - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if(data.type === PIXI.Graphics.ELIP) - { - // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas - - var w = shape.width * 2; - var h = shape.height * 2; - - var x = shape.x - w/2; - var y = shape.y - h/2; - - context.beginPath(); - - var kappa = 0.5522848, - ox = (w / 2) * kappa, // control point offset horizontal - oy = (h / 2) * kappa, // control point offset vertical - xe = x + w, // x-end - ye = y + h, // y-end - xm = x + w / 2, // x-middle - ym = y + h / 2; // y-middle - - context.moveTo(x, ym); - context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); - context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); - context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); - context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); - - context.closePath(); - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if (data.type === PIXI.Graphics.RREC) - { - var rx = shape.x; - var ry = shape.y; - var width = shape.width; - var height = shape.height; - var radius = shape.radius; - - var maxRadius = Math.min(width, height) / 2 | 0; - radius = radius > maxRadius ? maxRadius : radius; - - context.beginPath(); - context.moveTo(rx, ry + radius); - context.lineTo(rx, ry + height - radius); - context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height); - context.lineTo(rx + width - radius, ry + height); - context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius); - context.lineTo(rx + width, ry + radius); - context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry); - context.lineTo(rx + radius, ry); - context.quadraticCurveTo(rx, ry, rx, ry + radius); - context.closePath(); - - if(data.fillColor || data.fillColor === 0) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - } -}; - -/* - * Renders a graphics mask - * - * @static - * @private - * @method renderGraphicsMask - * @param graphics {Graphics} the graphics which will be used as a mask - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas - */ -PIXI.CanvasGraphics.renderGraphicsMask = function(graphics, context) -{ - var len = graphics.graphicsData.length; - - if(len === 0) return; - - if(len > 1) - { - len = 1; - window.console.log('Pixi.js warning: masks in canvas can only mask using the first path in the graphics object'); - } - - for (var i = 0; i < 1; i++) - { - var data = graphics.graphicsData[i]; - var shape = data.shape; - - if(data.type === PIXI.Graphics.POLY) - { - context.beginPath(); - - var points = shape.points; - - context.moveTo(points[0], points[1]); - - for (var j=1; j < points.length/2; j++) - { - context.lineTo(points[j * 2], points[j * 2 + 1]); - } - - // if the first and last point are the same close the path - much neater :) - if(points[0] === points[points.length-2] && points[1] === points[points.length-1]) - { - context.closePath(); - } - - } - else if(data.type === PIXI.Graphics.RECT) - { - context.beginPath(); - context.rect(shape.x, shape.y, shape.width, shape.height); - context.closePath(); - } - else if(data.type === PIXI.Graphics.CIRC) - { - // TODO - need to be Undefined! - context.beginPath(); - context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI); - context.closePath(); - } - else if(data.type === PIXI.Graphics.ELIP) - { - - // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas - - var w = shape.width * 2; - var h = shape.height * 2; - - var x = shape.x - w/2; - var y = shape.y - h/2; - - context.beginPath(); - - var kappa = 0.5522848, - ox = (w / 2) * kappa, // control point offset horizontal - oy = (h / 2) * kappa, // control point offset vertical - xe = x + w, // x-end - ye = y + h, // y-end - xm = x + w / 2, // x-middle - ym = y + h / 2; // y-middle - - context.moveTo(x, ym); - context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); - context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); - context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); - context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); - context.closePath(); - } - else if (data.type === PIXI.Graphics.RREC) - { - - var pts = shape.points; - var rx = pts[0]; - var ry = pts[1]; - var width = pts[2]; - var height = pts[3]; - var radius = pts[4]; - - var maxRadius = Math.min(width, height) / 2 | 0; - radius = radius > maxRadius ? maxRadius : radius; - - context.beginPath(); - context.moveTo(rx, ry + radius); - context.lineTo(rx, ry + height - radius); - context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height); - context.lineTo(rx + width - radius, ry + height); - context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius); - context.lineTo(rx + width, ry + radius); - context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry); - context.lineTo(rx + radius, ry); - context.quadraticCurveTo(rx, ry, rx, ry + radius); - context.closePath(); - } - } -}; - -PIXI.CanvasGraphics.updateGraphicsTint = function(graphics) -{ - if(graphics.tint === 0xFFFFFF)return; - - var tintR = (graphics.tint >> 16 & 0xFF) / 255; - var tintG = (graphics.tint >> 8 & 0xFF) / 255; - var tintB = (graphics.tint & 0xFF)/ 255; - - for (var i = 0; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - - var fillColor = data.fillColor | 0; - var lineColor = data.lineColor | 0; - - /* - var colorR = (fillColor >> 16 & 0xFF) / 255; - var colorG = (fillColor >> 8 & 0xFF) / 255; - var colorB = (fillColor & 0xFF) / 255; - - colorR *= tintR; - colorG *= tintG; - colorB *= tintB; - - fillColor = ((colorR*255 << 16) + (colorG*255 << 8) + colorB*255); - - colorR = (lineColor >> 16 & 0xFF) / 255; - colorG = (lineColor >> 8 & 0xFF) / 255; - colorB = (lineColor & 0xFF) / 255; - - colorR *= tintR; - colorG *= tintG; - colorB *= tintB; - - lineColor = ((colorR*255 << 16) + (colorG*255 << 8) + colorB*255); - */ - - // super inline cos im an optimization NAZI :) - data._fillTint = (((fillColor >> 16 & 0xFF) / 255 * tintR*255 << 16) + ((fillColor >> 8 & 0xFF) / 255 * tintG*255 << 8) + (fillColor & 0xFF) / 255 * tintB*255); - data._lineTint = (((lineColor >> 16 & 0xFF) / 255 * tintR*255 << 16) + ((lineColor >> 8 & 0xFF) / 255 * tintG*255 << 8) + (lineColor & 0xFF) / 255 * tintB*255); - - } -}; - - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and color and fill them. - * - * @class Graphics - * @extends DisplayObjectContainer - * @constructor - */ -PIXI.Graphics = function() -{ - PIXI.DisplayObjectContainer.call( this ); - - this.renderable = true; - - /** - * The alpha value used when filling the Graphics object. - * - * @property fillAlpha - * @type Number - */ - this.fillAlpha = 1; - - /** - * The width (thickness) of any lines drawn. - * - * @property lineWidth - * @type Number - */ - this.lineWidth = 0; - - /** - * The color of any lines drawn. - * - * @property lineColor - * @type String - * @default 0 - */ - this.lineColor = 0; - - /** - * Graphics data - * - * @property graphicsData - * @type Array - * @private - */ - this.graphicsData = []; - - /** - * The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint. - * - * @property tint - * @type Number - * @default 0xFFFFFF - */ - this.tint = 0xFFFFFF; - - /** - * The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode. - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - /** - * Current path - * - * @property currentPath - * @type Object - * @private - */ - this.currentPath = null; - - /** - * Array containing some WebGL-related properties used by the WebGL renderer. - * - * @property _webGL - * @type Array - * @private - */ - this._webGL = []; - - /** - * Whether this shape is being used as a mask. - * - * @property isMask - * @type Boolean - */ - this.isMask = false; - - /** - * The bounds' padding used for bounds calculation. - * - * @property boundsPadding - * @type Number - */ - this.boundsPadding = 0; - - this._localBounds = new PIXI.Rectangle(0,0,1,1); - - /** - * Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated. - * - * @property dirty - * @type Boolean - * @private - */ - this.dirty = true; - - /** - * Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated. - * - * @property webGLDirty - * @type Boolean - * @private - */ - this.webGLDirty = false; - - /** - * Used to detect if the cached sprite object needs to be updated. - * - * @property cachedSpriteDirty - * @type Boolean - * @private - */ - this.cachedSpriteDirty = false; - -}; - -// constructor -PIXI.Graphics.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); -PIXI.Graphics.prototype.constructor = PIXI.Graphics; - -/** - * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. - * This is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory. - * It is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas. - * This is not recommended if you are constantly redrawing the graphics element. - * - * @property cacheAsBitmap - * @type Boolean - * @default false - * @private - */ -Object.defineProperty(PIXI.Graphics.prototype, "cacheAsBitmap", { - get: function() { - return this._cacheAsBitmap; - }, - set: function(value) { - this._cacheAsBitmap = value; - - if(this._cacheAsBitmap) - { - - this._generateCachedSprite(); - } - else - { - this.destroyCachedSprite(); - this.dirty = true; - } - - } -}); - -/** - * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method. - * - * @method lineStyle - * @param lineWidth {Number} width of the line to draw, will update the objects stored style - * @param color {Number} color of the line to draw, will update the objects stored style - * @param alpha {Number} alpha of the line to draw, will update the objects stored style - * @return {Graphics} - */ -PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha) -{ - this.lineWidth = lineWidth || 0; - this.lineColor = color || 0; - this.lineAlpha = (arguments.length < 3) ? 1 : alpha; - - if(this.currentPath) - { - if(this.currentPath.shape.points.length) - { - // halfway through a line? start a new one! - this.drawShape( new PIXI.Polygon( this.currentPath.shape.points.slice(-2) )); - return this; - } - - // otherwise its empty so lets just set the line properties - this.currentPath.lineWidth = this.lineWidth; - this.currentPath.lineColor = this.lineColor; - this.currentPath.lineAlpha = this.lineAlpha; - - } - - return this; -}; - -/** - * Moves the current drawing position to x, y. - * - * @method moveTo - * @param x {Number} the X coordinate to move to - * @param y {Number} the Y coordinate to move to - * @return {Graphics} - */ -PIXI.Graphics.prototype.moveTo = function(x, y) -{ - this.drawShape(new PIXI.Polygon([x,y])); - - return this; -}; - -/** - * Draws a line using the current line style from the current drawing position to (x, y); - * The current drawing position is then set to (x, y). - * - * @method lineTo - * @param x {Number} the X coordinate to draw to - * @param y {Number} the Y coordinate to draw to - * @return {Graphics} - */ -PIXI.Graphics.prototype.lineTo = function(x, y) -{ - this.currentPath.shape.points.push(x, y); - this.dirty = true; - - return this; -}; - -/** - * Calculate the points for a quadratic bezier curve and then draws it. - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c - * - * @method quadraticCurveTo - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Graphics} - */ -PIXI.Graphics.prototype.quadraticCurveTo = function(cpX, cpY, toX, toY) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0]; - } - else - { - this.moveTo(0,0); - } - - var xa, - ya, - n = 20, - points = this.currentPath.shape.points; - if(points.length === 0)this.moveTo(0, 0); - - - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - - var j = 0; - for (var i = 1; i <= n; i++ ) - { - j = i / n; - - xa = fromX + ( (cpX - fromX) * j ); - ya = fromY + ( (cpY - fromY) * j ); - - points.push( xa + ( ((cpX + ( (toX - cpX) * j )) - xa) * j ), - ya + ( ((cpY + ( (toY - cpY) * j )) - ya) * j ) ); - } - - - this.dirty = true; - - return this; -}; - -/** - * Calculate the points for a bezier curve and then draws it. - * - * @method bezierCurveTo - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param cpX2 {Number} Second Control point x - * @param cpY2 {Number} Second Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Graphics} - */ -PIXI.Graphics.prototype.bezierCurveTo = function(cpX, cpY, cpX2, cpY2, toX, toY) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0]; - } - else - { - this.moveTo(0,0); - } - - var n = 20, - dt, - dt2, - dt3, - t2, - t3, - points = this.currentPath.shape.points; - - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - - var j = 0; - - for (var i=1; i<=n; i++) - { - j = i / n; - - dt = (1 - j); - dt2 = dt * dt; - dt3 = dt2 * dt; - - t2 = j * j; - t3 = t2 * j; - - points.push( dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX, - dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY); - } - - this.dirty = true; - - return this; -}; - -/* - * The arcTo() method creates an arc/curve between two tangents on the canvas. - * - * "borrowed" from https://code.google.com/p/fxcanvas/ - thanks google! - * - * @method arcTo - * @param x1 {Number} The x-coordinate of the beginning of the arc - * @param y1 {Number} The y-coordinate of the beginning of the arc - * @param x2 {Number} The x-coordinate of the end of the arc - * @param y2 {Number} The y-coordinate of the end of the arc - * @param radius {Number} The radius of the arc - * @return {Graphics} - */ -PIXI.Graphics.prototype.arcTo = function(x1, y1, x2, y2, radius) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0) - { - this.currentPath.shape.points.push(x1, y1); - } - } - else - { - this.moveTo(x1, y1); - } - - var points = this.currentPath.shape.points; - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - var a1 = fromY - y1; - var b1 = fromX - x1; - var a2 = y2 - y1; - var b2 = x2 - x1; - var mm = Math.abs(a1 * b2 - b1 * a2); - - - if (mm < 1.0e-8 || radius === 0) - { - if( points[points.length-2] !== x1 || points[points.length-1] !== y1) - { - //console.log(">>") - points.push(x1, y1); - } - } - else - { - var dd = a1 * a1 + b1 * b1; - var cc = a2 * a2 + b2 * b2; - var tt = a1 * a2 + b1 * b2; - var k1 = radius * Math.sqrt(dd) / mm; - var k2 = radius * Math.sqrt(cc) / mm; - var j1 = k1 * tt / dd; - var j2 = k2 * tt / cc; - var cx = k1 * b2 + k2 * b1; - var cy = k1 * a2 + k2 * a1; - var px = b1 * (k2 + j1); - var py = a1 * (k2 + j1); - var qx = b2 * (k1 + j2); - var qy = a2 * (k1 + j2); - var startAngle = Math.atan2(py - cy, px - cx); - var endAngle = Math.atan2(qy - cy, qx - cx); - - this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1); - } - - this.dirty = true; - - return this; -}; - -/** - * The arc method creates an arc/curve (used to create circles, or parts of circles). - * - * @method arc - * @param cx {Number} The x-coordinate of the center of the circle - * @param cy {Number} The y-coordinate of the center of the circle - * @param radius {Number} The radius of the circle - * @param startAngle {Number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) - * @param endAngle {Number} The ending angle, in radians - * @param anticlockwise {Boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {Graphics} - */ -PIXI.Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) -{ - var startX = cx + Math.cos(startAngle) * radius; - var startY = cy + Math.sin(startAngle) * radius; - var points; - - if( this.currentPath ) - { - points = this.currentPath.shape.points; - - if(points.length === 0) - { - points.push(startX, startY); - } - else if( points[points.length-2] !== startX || points[points.length-1] !== startY) - { - points.push(startX, startY); - } - } - else - { - this.moveTo(startX, startY); - points = this.currentPath.shape.points; - } - - if (startAngle === endAngle)return this; - - if( !anticlockwise && endAngle <= startAngle ) - { - endAngle += Math.PI * 2; - } - else if( anticlockwise && startAngle <= endAngle ) - { - startAngle += Math.PI * 2; - } - - var sweep = anticlockwise ? (startAngle - endAngle) *-1 : (endAngle - startAngle); - var segs = ( Math.abs(sweep)/ (Math.PI * 2) ) * 40; - - if( sweep === 0 ) return this; - - var theta = sweep/(segs*2); - var theta2 = theta*2; - - var cTheta = Math.cos(theta); - var sTheta = Math.sin(theta); - - var segMinus = segs - 1; - - var remainder = ( segMinus % 1 ) / segMinus; - - for(var i=0; i<=segMinus; i++) - { - var real = i + remainder * i; - - - var angle = ((theta) + startAngle + (theta2 * real)); - - var c = Math.cos(angle); - var s = -Math.sin(angle); - - points.push(( (cTheta * c) + (sTheta * s) ) * radius + cx, - ( (cTheta * -s) + (sTheta * c) ) * radius + cy); - } - - this.dirty = true; - - return this; -}; - -/** - * Specifies a simple one-color fill that subsequent calls to other Graphics methods - * (such as lineTo() or drawCircle()) use when drawing. - * - * @method beginFill - * @param color {Number} the color of the fill - * @param alpha {Number} the alpha of the fill - * @return {Graphics} - */ -PIXI.Graphics.prototype.beginFill = function(color, alpha) -{ - this.filling = true; - this.fillColor = color || 0; - this.fillAlpha = (alpha === undefined) ? 1 : alpha; - - if(this.currentPath) - { - if(this.currentPath.shape.points.length <= 2) - { - this.currentPath.fill = this.filling; - this.currentPath.fillColor = this.fillColor; - this.currentPath.fillAlpha = this.fillAlpha; - } - } - return this; -}; - -/** - * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. - * - * @method endFill - * @return {Graphics} - */ -PIXI.Graphics.prototype.endFill = function() -{ - this.filling = false; - this.fillColor = null; - this.fillAlpha = 1; - - return this; -}; - -/** - * Draws a rectangle. - * - * @method drawRect - * - * @param x {Number} The X coord of the top-left of the rectangle - * @param y {Number} The Y coord of the top-left of the rectangle - * @param width {Number} The width of the rectangle - * @param height {Number} The height of the rectangle - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawRect = function( x, y, width, height ) -{ - this.drawShape(new PIXI.Rectangle(x,y, width, height)); - - return this; -}; - -/** - * Draws a rounded rectangle. - * - * @method drawRoundedRect - * - * @param x {Number} The X coord of the top-left of the rectangle - * @param y {Number} The Y coord of the top-left of the rectangle - * @param width {Number} The width of the rectangle - * @param height {Number} The height of the rectangle - * @param radius {Number} Radius of the rectangle corners - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawRoundedRect = function( x, y, width, height, radius ) -{ - this.drawShape(new PIXI.RoundedRectangle(x, y, width, height, radius)); - - return this; -}; - -/** - * Draws a circle. - * - * @method drawCircle - * @param x {Number} The X coordinate of the center of the circle - * @param y {Number} The Y coordinate of the center of the circle - * @param radius {Number} The radius of the circle - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawCircle = function(x, y, radius) -{ - this.drawShape(new PIXI.Circle(x,y, radius)); - - return this; -}; - -/** - * Draws an ellipse. - * - * @method drawEllipse - * @param x {Number} The X coordinate of the center of the ellipse - * @param y {Number} The Y coordinate of the center of the ellipse - * @param width {Number} The half width of the ellipse - * @param height {Number} The half height of the ellipse - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawEllipse = function(x, y, width, height) -{ - this.drawShape(new PIXI.Ellipse(x, y, width, height)); - - return this; -}; - -/** - * Draws a polygon using the given path. - * - * @method drawPolygon - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawPolygon = function(path) -{ - if(!(path instanceof Array))path = Array.prototype.slice.call(arguments); - this.drawShape(new PIXI.Polygon(path)); - return this; -}; - -/** - * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. - * - * @method clear - * @return {Graphics} - */ -PIXI.Graphics.prototype.clear = function() -{ - this.lineWidth = 0; - this.filling = false; - - this.dirty = true; - this.clearDirty = true; - this.graphicsData = []; - - return this; -}; - -/** - * Useful function that returns a texture of the graphics object that can then be used to create sprites - * This can be quite useful if your geometry is complicated and needs to be reused multiple times. - * - * @method generateTexture - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts - * @return {Texture} a texture of the graphics object - */ -PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode) -{ - resolution = resolution || 1; - - var bounds = this.getBounds(); - - var canvasBuffer = new PIXI.CanvasBuffer(bounds.width * resolution, bounds.height * resolution); - - var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas, scaleMode); - texture.baseTexture.resolution = resolution; - - canvasBuffer.context.scale(resolution, resolution); - - canvasBuffer.context.translate(-bounds.x,-bounds.y); - - PIXI.CanvasGraphics.renderGraphics(this, canvasBuffer.context); - - return texture; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Graphics.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(this.visible === false || this.alpha === 0 || this.isMask === true)return; - - if(this._cacheAsBitmap) - { - - if(this.dirty || this.cachedSpriteDirty) - { - - this._generateCachedSprite(); - - // we will also need to update the texture on the gpu too! - this.updateCachedSpriteTexture(); - - this.cachedSpriteDirty = false; - this.dirty = false; - } - - this._cachedSprite.worldAlpha = this.worldAlpha; - PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession); - - return; - } - else - { - renderSession.spriteBatch.stop(); - renderSession.blendModeManager.setBlendMode(this.blendMode); - - if(this._mask)renderSession.maskManager.pushMask(this._mask, renderSession); - if(this._filters)renderSession.filterManager.pushFilter(this._filterBlock); - - // check blend mode - if(this.blendMode !== renderSession.spriteBatch.currentBlendMode) - { - renderSession.spriteBatch.currentBlendMode = this.blendMode; - var blendModeWebGL = PIXI.blendModesWebGL[renderSession.spriteBatch.currentBlendMode]; - renderSession.spriteBatch.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); - } - - // check if the webgl graphic needs to be updated - if(this.webGLDirty) - { - this.dirty = true; - this.webGLDirty = false; - } - - PIXI.WebGLGraphics.renderGraphics(this, renderSession); - - // only render if it has children! - if(this.children.length) - { - renderSession.spriteBatch.start(); - - // simple render children! - for(var i=0, j=this.children.length; i maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - - this._bounds.x = minX; - this._bounds.width = maxX - minX; - - this._bounds.y = minY; - this._bounds.height = maxY - minY; - - return this._bounds; -}; - -/** - * Update the bounds of the object - * - * @method updateLocalBounds - */ -PIXI.Graphics.prototype.updateLocalBounds = function() -{ - var minX = Infinity; - var maxX = -Infinity; - - var minY = Infinity; - var maxY = -Infinity; - - if(this.graphicsData.length) - { - var shape, points, x, y, w, h; - - for (var i = 0; i < this.graphicsData.length; i++) { - var data = this.graphicsData[i]; - var type = data.type; - var lineWidth = data.lineWidth; - shape = data.shape; - - - if(type === PIXI.Graphics.RECT || type === PIXI.Graphics.RREC) - { - x = shape.x - lineWidth/2; - y = shape.y - lineWidth/2; - w = shape.width + lineWidth; - h = shape.height + lineWidth; - - minX = x < minX ? x : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y < minY ? y : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else if(type === PIXI.Graphics.CIRC) - { - x = shape.x; - y = shape.y; - w = shape.radius + lineWidth/2; - h = shape.radius + lineWidth/2; - - minX = x - w < minX ? x - w : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y - h < minY ? y - h : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else if(type === PIXI.Graphics.ELIP) - { - x = shape.x; - y = shape.y; - w = shape.width + lineWidth/2; - h = shape.height + lineWidth/2; - - minX = x - w < minX ? x - w : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y - h < minY ? y - h : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else - { - // POLY - points = shape.points; - - for (var j = 0; j < points.length; j+=2) - { - - x = points[j]; - y = points[j+1]; - minX = x-lineWidth < minX ? x-lineWidth : minX; - maxX = x+lineWidth > maxX ? x+lineWidth : maxX; - - minY = y-lineWidth < minY ? y-lineWidth : minY; - maxY = y+lineWidth > maxY ? y+lineWidth : maxY; - } - } - } - } - else - { - minX = 0; - maxX = 0; - minY = 0; - maxY = 0; - } - - var padding = this.boundsPadding; - - this._localBounds.x = minX - padding; - this._localBounds.width = (maxX - minX) + padding * 2; - - this._localBounds.y = minY - padding; - this._localBounds.height = (maxY - minY) + padding * 2; -}; - -/** - * Generates the cached sprite when the sprite has cacheAsBitmap = true - * - * @method _generateCachedSprite - * @private - */ -PIXI.Graphics.prototype._generateCachedSprite = function() -{ - var bounds = this.getLocalBounds(); - - if(!this._cachedSprite) - { - var canvasBuffer = new PIXI.CanvasBuffer(bounds.width, bounds.height); - var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); - - this._cachedSprite = new PIXI.Sprite(texture); - this._cachedSprite.buffer = canvasBuffer; - - this._cachedSprite.worldTransform = this.worldTransform; - } - else - { - this._cachedSprite.buffer.resize(bounds.width, bounds.height); - } - - // leverage the anchor to account for the offset of the element - this._cachedSprite.anchor.x = -( bounds.x / bounds.width ); - this._cachedSprite.anchor.y = -( bounds.y / bounds.height ); - - // this._cachedSprite.buffer.context.save(); - this._cachedSprite.buffer.context.translate(-bounds.x,-bounds.y); - - // make sure we set the alpha of the graphics to 1 for the render.. - this.worldAlpha = 1; - - // now render the graphic.. - PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context); - this._cachedSprite.alpha = this.alpha; -}; - -/** - * Updates texture size based on canvas size - * - * @method updateCachedSpriteTexture - * @private - */ -PIXI.Graphics.prototype.updateCachedSpriteTexture = function() -{ - var cachedSprite = this._cachedSprite; - var texture = cachedSprite.texture; - var canvas = cachedSprite.buffer.canvas; - - texture.baseTexture.width = canvas.width; - texture.baseTexture.height = canvas.height; - texture.crop.width = texture.frame.width = canvas.width; - texture.crop.height = texture.frame.height = canvas.height; - - cachedSprite._width = canvas.width; - cachedSprite._height = canvas.height; - - // update the dirty base textures - texture.baseTexture.dirty(); -}; - -/** - * Destroys a previous cached sprite. - * - * @method destroyCachedSprite - */ -PIXI.Graphics.prototype.destroyCachedSprite = function() -{ - this._cachedSprite.texture.destroy(true); - - // let the gc collect the unused sprite - // TODO could be object pooled! - this._cachedSprite = null; -}; - -/** - * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. - * - * @method drawShape - * @param {Circle|Rectangle|Ellipse|Line|Polygon} shape The Shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. - */ -PIXI.Graphics.prototype.drawShape = function(shape) -{ - if(this.currentPath) - { - // check current path! - if(this.currentPath.shape.points.length <= 2)this.graphicsData.pop(); - } - - this.currentPath = null; - - var data = new PIXI.GraphicsData(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, shape); - - this.graphicsData.push(data); - - if(data.type === PIXI.Graphics.POLY) - { - data.shape.closed = this.filling; - this.currentPath = data; - } - - this.dirty = true; - - return data; -}; - -/** - * A GraphicsData object. - * - * @class GraphicsData - * @constructor - */ -PIXI.GraphicsData = function(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, shape) -{ - this.lineWidth = lineWidth; - this.lineColor = lineColor; - this.lineAlpha = lineAlpha; - this._lineTint = lineColor; - - this.fillColor = fillColor; - this.fillAlpha = fillAlpha; - this._fillTint = fillColor; - this.fill = fill; - - this.shape = shape; - this.type = shape.type; -}; - -// SOME TYPES: -PIXI.Graphics.POLY = 0; -PIXI.Graphics.RECT = 1; -PIXI.Graphics.CIRC = 2; -PIXI.Graphics.ELIP = 3; -PIXI.Graphics.RREC = 4; - -PIXI.Polygon.prototype.type = PIXI.Graphics.POLY; -PIXI.Rectangle.prototype.type = PIXI.Graphics.RECT; -PIXI.Circle.prototype.type = PIXI.Graphics.CIRC; -PIXI.Ellipse.prototype.type = PIXI.Graphics.ELIP; -PIXI.RoundedRectangle.prototype.type = PIXI.Graphics.RREC; - - -/** - * @author Mat Groves http://matgroves.com/ - */ - - /** - * - * @class Strip - * @extends DisplayObjectContainer - * @constructor - * @param texture {Texture} The texture to use - * @param width {Number} the width - * @param height {Number} the height - * - */ -PIXI.Strip = function(texture) -{ - PIXI.DisplayObjectContainer.call( this ); - - - /** - * The texture of the strip - * - * @property texture - * @type Texture - */ - this.texture = texture; - - // set up the main bits.. - this.uvs = new PIXI.Float32Array([0, 1, - 1, 1, - 1, 0, - 0, 1]); - - this.vertices = new PIXI.Float32Array([0, 0, - 100, 0, - 100, 100, - 0, 100]); - - this.colors = new PIXI.Float32Array([1, 1, 1, 1]); - - this.indices = new PIXI.Uint16Array([0, 1, 2, 3]); - - /** - * Whether the strip is dirty or not - * - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode. - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - /** - * Triangles in canvas mode are automatically antialiased, use this value to force triangles to overlap a bit with each other. - * - * @property canvasPadding - * @type Number - */ - this.canvasPadding = 0; - - this.drawMode = PIXI.Strip.DrawModes.TRIANGLE_STRIP; - -}; - -// constructor -PIXI.Strip.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); -PIXI.Strip.prototype.constructor = PIXI.Strip; - -PIXI.Strip.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(!this.visible || this.alpha <= 0)return; - // render triangle strip.. - - renderSession.spriteBatch.stop(); - - // init! init! - if(!this._vertexBuffer)this._initWebGL(renderSession); - - renderSession.shaderManager.setShader(renderSession.shaderManager.stripShader); - - this._renderStrip(renderSession); - - ///renderSession.shaderManager.activateDefaultShader(); - - renderSession.spriteBatch.start(); - - //TODO check culling -}; - -PIXI.Strip.prototype._initWebGL = function(renderSession) -{ - // build the strip! - var gl = renderSession.gl; - - this._vertexBuffer = gl.createBuffer(); - this._indexBuffer = gl.createBuffer(); - this._uvBuffer = gl.createBuffer(); - this._colorBuffer = gl.createBuffer(); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvs, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._colorBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.colors, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); -}; - -PIXI.Strip.prototype._renderStrip = function(renderSession) -{ - var gl = renderSession.gl; - var projection = renderSession.projection, - offset = renderSession.offset, - shader = renderSession.shaderManager.stripShader; - - var drawMode = this.drawMode === PIXI.Strip.DrawModes.TRIANGLE_STRIP ? gl.TRIANGLE_STRIP : gl.TRIANGLES; - - // gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mat4Real); - - renderSession.blendModeManager.setBlendMode(this.blendMode); - - - // set uniforms - gl.uniformMatrix3fv(shader.translationMatrix, false, this.worldTransform.toArray(true)); - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - gl.uniform1f(shader.alpha, this.worldAlpha); - - if(!this.dirty) - { - - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - // update the uvs - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.activeTexture(gl.TEXTURE0); - - // check if a texture is dirty.. - if(this.texture.baseTexture._dirty[gl.id]) - { - renderSession.renderer.updateTexture(this.texture.baseTexture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]); - } - - // dont need to upload! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - - - } - else - { - - this.dirty = false; - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.STATIC_DRAW); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - // update the uvs - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvs, gl.STATIC_DRAW); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.activeTexture(gl.TEXTURE0); - - // check if a texture is dirty.. - if(this.texture.baseTexture._dirty[gl.id]) - { - renderSession.renderer.updateTexture(this.texture.baseTexture); - } - else - { - gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]); - } - - // dont need to upload! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - } - //console.log(gl.TRIANGLE_STRIP) - // - // - gl.drawElements(drawMode, this.indices.length, gl.UNSIGNED_SHORT, 0); - - -}; - - - -PIXI.Strip.prototype._renderCanvas = function(renderSession) -{ - var context = renderSession.context; - - var transform = this.worldTransform; - - if (renderSession.roundPixels) - { - context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx | 0, transform.ty | 0); - } - else - { - context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty); - } - - if (this.drawMode === PIXI.Strip.DrawModes.TRIANGLE_STRIP) - { - this._renderCanvasTriangleStrip(context); - } - else - { - this._renderCanvasTriangles(context); - } -}; - -PIXI.Strip.prototype._renderCanvasTriangleStrip = function(context) -{ - // draw triangles!! - var vertices = this.vertices; - var uvs = this.uvs; - - var length = vertices.length / 2; - this.count++; - - for (var i = 0; i < length - 2; i++) { - // draw some triangles! - var index = i * 2; - this._renderCanvasDrawTriangle(context, vertices, uvs, index, (index + 2), (index + 4)); - } -}; - -PIXI.Strip.prototype._renderCanvasTriangles = function(context) -{ - // draw triangles!! - var vertices = this.vertices; - var uvs = this.uvs; - var indices = this.indices; - - var length = indices.length; - this.count++; - - for (var i = 0; i < length; i += 3) { - // draw some triangles! - var index0 = indices[i] * 2, index1 = indices[i + 1] * 2, index2 = indices[i + 2] * 2; - this._renderCanvasDrawTriangle(context, vertices, uvs, index0, index1, index2); - } -}; - -PIXI.Strip.prototype._renderCanvasDrawTriangle = function(context, vertices, uvs, index0, index1, index2) -{ - var textureSource = this.texture.baseTexture.source; - var textureWidth = this.texture.width; - var textureHeight = this.texture.height; - - var x0 = vertices[index0], x1 = vertices[index1], x2 = vertices[index2]; - var y0 = vertices[index0 + 1], y1 = vertices[index1 + 1], y2 = vertices[index2 + 1]; - - var u0 = uvs[index0] * textureWidth, u1 = uvs[index1] * textureWidth, u2 = uvs[index2] * textureWidth; - var v0 = uvs[index0 + 1] * textureHeight, v1 = uvs[index1 + 1] * textureHeight, v2 = uvs[index2 + 1] * textureHeight; - - if (this.canvasPadding > 0) { - var paddingX = this.canvasPadding / this.worldTransform.a; - var paddingY = this.canvasPadding / this.worldTransform.d; - var centerX = (x0 + x1 + x2) / 3; - var centerY = (y0 + y1 + y2) / 3; - - var normX = x0 - centerX; - var normY = y0 - centerY; - - var dist = Math.sqrt(normX * normX + normY * normY); - x0 = centerX + (normX / dist) * (dist + paddingX); - y0 = centerY + (normY / dist) * (dist + paddingY); - - // - - normX = x1 - centerX; - normY = y1 - centerY; - - dist = Math.sqrt(normX * normX + normY * normY); - x1 = centerX + (normX / dist) * (dist + paddingX); - y1 = centerY + (normY / dist) * (dist + paddingY); - - normX = x2 - centerX; - normY = y2 - centerY; - - dist = Math.sqrt(normX * normX + normY * normY); - x2 = centerX + (normX / dist) * (dist + paddingX); - y2 = centerY + (normY / dist) * (dist + paddingY); - } - - context.save(); - context.beginPath(); - - - context.moveTo(x0, y0); - context.lineTo(x1, y1); - context.lineTo(x2, y2); - - context.closePath(); - - context.clip(); - - // Compute matrix transform - var delta = (u0 * v1) + (v0 * u2) + (u1 * v2) - (v1 * u2) - (v0 * u1) - (u0 * v2); - var deltaA = (x0 * v1) + (v0 * x2) + (x1 * v2) - (v1 * x2) - (v0 * x1) - (x0 * v2); - var deltaB = (u0 * x1) + (x0 * u2) + (u1 * x2) - (x1 * u2) - (x0 * u1) - (u0 * x2); - var deltaC = (u0 * v1 * x2) + (v0 * x1 * u2) + (x0 * u1 * v2) - (x0 * v1 * u2) - (v0 * u1 * x2) - (u0 * x1 * v2); - var deltaD = (y0 * v1) + (v0 * y2) + (y1 * v2) - (v1 * y2) - (v0 * y1) - (y0 * v2); - var deltaE = (u0 * y1) + (y0 * u2) + (u1 * y2) - (y1 * u2) - (y0 * u1) - (u0 * y2); - var deltaF = (u0 * v1 * y2) + (v0 * y1 * u2) + (y0 * u1 * v2) - (y0 * v1 * u2) - (v0 * u1 * y2) - (u0 * y1 * v2); - - context.transform(deltaA / delta, deltaD / delta, - deltaB / delta, deltaE / delta, - deltaC / delta, deltaF / delta); - - context.drawImage(textureSource, 0, 0); - context.restore(); -}; - - - -/** - * Renders a flat strip - * - * @method renderStripFlat - * @param strip {Strip} The Strip to render - * @private - */ -PIXI.Strip.prototype.renderStripFlat = function(strip) -{ - var context = this.context; - var vertices = strip.vertices; - - var length = vertices.length/2; - this.count++; - - context.beginPath(); - for (var i=1; i < length-2; i++) - { - // draw some triangles! - var index = i*2; - - var x0 = vertices[index], x1 = vertices[index+2], x2 = vertices[index+4]; - var y0 = vertices[index+1], y1 = vertices[index+3], y2 = vertices[index+5]; - - context.moveTo(x0, y0); - context.lineTo(x1, y1); - context.lineTo(x2, y2); - } - - context.fillStyle = '#FF0000'; - context.fill(); - context.closePath(); -}; - -/* -PIXI.Strip.prototype.setTexture = function(texture) -{ - //TODO SET THE TEXTURES - //TODO VISIBILITY - - // stop current texture - this.texture = texture; - this.width = texture.frame.width; - this.height = texture.frame.height; - this.updateFrame = true; -}; -*/ - -/** - * When the texture is updated, this event will fire to update the scale and frame - * - * @method onTextureUpdate - * @param event - * @private - */ - -PIXI.Strip.prototype.onTextureUpdate = function() -{ - this.updateFrame = true; -}; - -/** - * Returns the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account. - * - * @method getBounds - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle - */ -PIXI.Strip.prototype.getBounds = function(matrix) -{ - var worldTransform = matrix || this.worldTransform; - - var a = worldTransform.a; - var b = worldTransform.b; - var c = worldTransform.c; - var d = worldTransform.d; - var tx = worldTransform.tx; - var ty = worldTransform.ty; - - var maxX = -Infinity; - var maxY = -Infinity; - - var minX = Infinity; - var minY = Infinity; - - var vertices = this.vertices; - for (var i = 0, n = vertices.length; i < n; i += 2) - { - var rawX = vertices[i], rawY = vertices[i + 1]; - var x = (a * rawX) + (c * rawY) + tx; - var y = (d * rawY) + (b * rawX) + ty; - - minX = x < minX ? x : minX; - minY = y < minY ? y : minY; - - maxX = x > maxX ? x : maxX; - maxY = y > maxY ? y : maxY; - } - - if (minX === -Infinity || maxY === Infinity) - { - return PIXI.EmptyRectangle; - } - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - -/** - * Different drawing buffer modes supported - * - * @property - * @type {{TRIANGLE_STRIP: number, TRIANGLES: number}} - * @static - */ -PIXI.Strip.DrawModes = { - TRIANGLE_STRIP: 0, - TRIANGLES: 1 -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * @copyright Mat Groves, Rovanion Luckey - */ - -/** - * - * @class Rope - * @constructor - * @extends Strip - * @param {Texture} texture - The texture to use on the rope. - * @param {Array} points - An array of {PIXI.Point}. - * - */ -PIXI.Rope = function(texture, points) -{ - PIXI.Strip.call( this, texture ); - this.points = points; - - this.vertices = new PIXI.Float32Array(points.length * 4); - this.uvs = new PIXI.Float32Array(points.length * 4); - this.colors = new PIXI.Float32Array(points.length * 2); - this.indices = new PIXI.Uint16Array(points.length * 2); - - - this.refresh(); -}; - - -// constructor -PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype ); -PIXI.Rope.prototype.constructor = PIXI.Rope; - -/* - * Refreshes - * - * @method refresh - */ -PIXI.Rope.prototype.refresh = function() -{ - var points = this.points; - if(points.length < 1) return; - - var uvs = this.uvs; - - var lastPoint = points[0]; - var indices = this.indices; - var colors = this.colors; - - this.count-=0.2; - - uvs[0] = 0; - uvs[1] = 0; - uvs[2] = 0; - uvs[3] = 1; - - colors[0] = 1; - colors[1] = 1; - - indices[0] = 0; - indices[1] = 1; - - var total = points.length, - point, index, amount; - - for (var i = 1; i < total; i++) - { - point = points[i]; - index = i * 4; - // time to do some smart drawing! - amount = i / (total-1); - - if(i%2) - { - uvs[index] = amount; - uvs[index+1] = 0; - - uvs[index+2] = amount; - uvs[index+3] = 1; - } - else - { - uvs[index] = amount; - uvs[index+1] = 0; - - uvs[index+2] = amount; - uvs[index+3] = 1; - } - - index = i * 2; - colors[index] = 1; - colors[index+1] = 1; - - index = i * 2; - indices[index] = index; - indices[index + 1] = index + 1; - - lastPoint = point; - } -}; - -/* - * Updates the object transform for rendering - * - * @method updateTransform - * @private - */ -PIXI.Rope.prototype.updateTransform = function() -{ - - var points = this.points; - if(points.length < 1)return; - - var lastPoint = points[0]; - var nextPoint; - var perp = {x:0, y:0}; - - this.count-=0.2; - - var vertices = this.vertices; - var total = points.length, - point, index, ratio, perpLength, num; - - for (var i = 0; i < total; i++) - { - point = points[i]; - index = i * 4; - - if(i < points.length-1) - { - nextPoint = points[i+1]; - } - else - { - nextPoint = point; - } - - perp.y = -(nextPoint.x - lastPoint.x); - perp.x = nextPoint.y - lastPoint.y; - - ratio = (1 - (i / (total-1))) * 10; - - if(ratio > 1) ratio = 1; - - perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y); - num = this.texture.height / 2; //(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio; - perp.x /= perpLength; - perp.y /= perpLength; - - perp.x *= num; - perp.y *= num; - - vertices[index] = point.x + perp.x; - vertices[index+1] = point.y + perp.y; - vertices[index+2] = point.x - perp.x; - vertices[index+3] = point.y - perp.y; - - lastPoint = point; - } - - PIXI.DisplayObjectContainer.prototype.updateTransform.call( this ); -}; -/* - * Sets the texture that the Rope will use - * - * @method setTexture - * @param texture {Texture} the texture that will be used - */ -PIXI.Rope.prototype.setTexture = function(texture) -{ - // stop current texture - this.texture = texture; - //this.updateFrame = true; -}; - -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * A tiling sprite is a fast way of rendering a tiling image - * - * @class TilingSprite - * @extends Sprite - * @constructor - * @param texture {Texture} the texture of the tiling sprite - * @param width {Number} the width of the tiling sprite - * @param height {Number} the height of the tiling sprite - */ -PIXI.TilingSprite = function(texture, width, height) -{ - PIXI.Sprite.call( this, texture); - - /** - * The with of the tiling sprite - * - * @property width - * @type Number - */ - this._width = width || 100; - - /** - * The height of the tiling sprite - * - * @property height - * @type Number - */ - this._height = height || 100; - - /** - * The scaling of the image that is being tiled - * - * @property tileScale - * @type Point - */ - this.tileScale = new PIXI.Point(1,1); - - /** - * A point that represents the scale of the texture object - * - * @property tileScaleOffset - * @type Point - */ - this.tileScaleOffset = new PIXI.Point(1,1); - - /** - * The offset position of the image that is being tiled - * - * @property tilePosition - * @type Point - */ - this.tilePosition = new PIXI.Point(0,0); - - /** - * Whether this sprite is renderable or not - * - * @property renderable - * @type Boolean - * @default true - */ - this.renderable = true; - - /** - * The tint applied to the sprite. This is a hex value - * - * @property tint - * @type Number - * @default 0xFFFFFF - */ - this.tint = 0xFFFFFF; - - /** - * The blend mode to be applied to the sprite - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - - -}; - -// constructor -PIXI.TilingSprite.prototype = Object.create(PIXI.Sprite.prototype); -PIXI.TilingSprite.prototype.constructor = PIXI.TilingSprite; - - -/** - * The width of the sprite, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.TilingSprite.prototype, 'width', { - get: function() { - return this._width; - }, - set: function(value) { - - this._width = value; - } -}); - -/** - * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.TilingSprite.prototype, 'height', { - get: function() { - return this._height; - }, - set: function(value) { - this._height = value; - } -}); - -PIXI.TilingSprite.prototype.setTexture = function(texture) -{ - if (this.texture === texture) return; - - this.texture = texture; - - this.refreshTexture = true; - - this.cachedTint = 0xFFFFFF; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.TilingSprite.prototype._renderWebGL = function(renderSession) -{ - if (this.visible === false || this.alpha === 0) return; - var i,j; - - if (this._mask) - { - renderSession.spriteBatch.stop(); - renderSession.maskManager.pushMask(this.mask, renderSession); - renderSession.spriteBatch.start(); - } - - if (this._filters) - { - renderSession.spriteBatch.flush(); - renderSession.filterManager.pushFilter(this._filterBlock); - } - - - - if (!this.tilingTexture || this.refreshTexture) - { - this.generateTilingTexture(true); - - if (this.tilingTexture && this.tilingTexture.needsUpdate) - { - //TODO - tweaking - renderSession.renderer.updateTexture(this.tilingTexture.baseTexture); - this.tilingTexture.needsUpdate = false; - // this.tilingTexture._uvs = null; - } - } - else - { - renderSession.spriteBatch.renderTilingSprite(this); - } - // simple render children! - for (i=0,j=this.children.length; i maxX ? x1 : maxX; - maxX = x2 > maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y1 > maxY ? y1 : maxY; - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - - - -/** - * When the texture is updated, this event will fire to update the scale and frame - * - * @method onTextureUpdate - * @param event - * @private - */ -PIXI.TilingSprite.prototype.onTextureUpdate = function() -{ - // overriding the sprite version of this! -}; - - -/** -* -* @method generateTilingTexture -* -* @param forcePowerOfTwo {Boolean} Whether we want to force the texture to be a power of two -*/ -PIXI.TilingSprite.prototype.generateTilingTexture = function(forcePowerOfTwo) -{ - if (!this.texture.baseTexture.hasLoaded) return; - - var texture = this.originalTexture || this.texture; - var frame = texture.frame; - var targetWidth, targetHeight; - - // Check that the frame is the same size as the base texture. - var isFrame = frame.width !== texture.baseTexture.width || frame.height !== texture.baseTexture.height; - - var newTextureRequired = false; - - if (!forcePowerOfTwo) - { - if (isFrame) - { - if (texture.trim) - { - targetWidth = texture.trim.width; - targetHeight = texture.trim.height; - } - else - { - targetWidth = frame.width; - targetHeight = frame.height; - } - - newTextureRequired = true; - } - } - else - { - targetWidth = PIXI.getNextPowerOfTwo(frame.width); - targetHeight = PIXI.getNextPowerOfTwo(frame.height); - - // If the BaseTexture dimensions don't match the texture frame then we need a new texture anyway because it's part of a texture atlas - if (frame.width !== targetWidth || frame.height !== targetHeight || texture.baseTexture.width !== targetWidth || texture.baseTexture.height || targetHeight) newTextureRequired = true; - } - - if (newTextureRequired) - { - var canvasBuffer; - - if (this.tilingTexture && this.tilingTexture.isTiling) - { - canvasBuffer = this.tilingTexture.canvasBuffer; - canvasBuffer.resize(targetWidth, targetHeight); - this.tilingTexture.baseTexture.width = targetWidth; - this.tilingTexture.baseTexture.height = targetHeight; - this.tilingTexture.needsUpdate = true; - } - else - { - canvasBuffer = new PIXI.CanvasBuffer(targetWidth, targetHeight); - - this.tilingTexture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); - this.tilingTexture.canvasBuffer = canvasBuffer; - this.tilingTexture.isTiling = true; - } - - canvasBuffer.context.drawImage(texture.baseTexture.source, - texture.crop.x, - texture.crop.y, - texture.crop.width, - texture.crop.height, - 0, - 0, - targetWidth, - targetHeight); - - this.tileScaleOffset.x = frame.width / targetWidth; - this.tileScaleOffset.y = frame.height / targetHeight; - } - else - { - // TODO - switching? - if (this.tilingTexture && this.tilingTexture.isTiling) - { - // destroy the tiling texture! - // TODO could store this somewhere? - this.tilingTexture.destroy(true); - } - - this.tileScaleOffset.x = 1; - this.tileScaleOffset.y = 1; - this.tilingTexture = texture; - } - - this.refreshTexture = false; - - this.originalTexture = this.texture; - this.texture = this.tilingTexture; - - this.tilingTexture.baseTexture._powerOf2 = true; -}; - -PIXI.TilingSprite.prototype.destroy = function () { - PIXI.Sprite.prototype.destroy.call(this); - - this.tileScale = null; - this.tileScaleOffset = null; - this.tilePosition = null; - - this.tilingTexture.destroy(true); - this.tilingTexture = null; -}; - -/****************************************************************************** - * Spine Runtimes Software License - * Version 2.1 - * - * Copyright (c) 2013, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable and - * non-transferable license to install, execute and perform the Spine Runtimes - * Software (the "Software") solely for internal use. Without the written - * permission of Esoteric Software (typically granted by licensing Spine), you - * may not (a) modify, translate, adapt or otherwise create derivative works, - * improvements of the Software or develop new applications using the Software - * or (b) remove, delete, alter or obscure any trademarks or any copyright, - * trademark, patent or other intellectual property or proprietary rights - * notices on or in the Software, including any copy thereof. Redistributions - * in binary or source form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -var spine = { - radDeg: 180 / Math.PI, - degRad: Math.PI / 180, - temp: [], - Float32Array: (typeof(Float32Array) === 'undefined') ? Array : Float32Array, - Uint16Array: (typeof(Uint16Array) === 'undefined') ? Array : Uint16Array -}; - -spine.BoneData = function (name, parent) { - this.name = name; - this.parent = parent; -}; -spine.BoneData.prototype = { - length: 0, - x: 0, y: 0, - rotation: 0, - scaleX: 1, scaleY: 1, - inheritScale: true, - inheritRotation: true, - flipX: false, flipY: false -}; - -spine.SlotData = function (name, boneData) { - this.name = name; - this.boneData = boneData; -}; -spine.SlotData.prototype = { - r: 1, g: 1, b: 1, a: 1, - attachmentName: null, - additiveBlending: false -}; - -spine.IkConstraintData = function (name) { - this.name = name; - this.bones = []; -}; -spine.IkConstraintData.prototype = { - target: null, - bendDirection: 1, - mix: 1 -}; - -spine.Bone = function (boneData, skeleton, parent) { - this.data = boneData; - this.skeleton = skeleton; - this.parent = parent; - this.setToSetupPose(); -}; -spine.Bone.yDown = false; -spine.Bone.prototype = { - x: 0, y: 0, - rotation: 0, rotationIK: 0, - scaleX: 1, scaleY: 1, - flipX: false, flipY: false, - m00: 0, m01: 0, worldX: 0, // a b x - m10: 0, m11: 0, worldY: 0, // c d y - worldRotation: 0, - worldScaleX: 1, worldScaleY: 1, - worldFlipX: false, worldFlipY: false, - updateWorldTransform: function () { - var parent = this.parent; - if (parent) { - this.worldX = this.x * parent.m00 + this.y * parent.m01 + parent.worldX; - this.worldY = this.x * parent.m10 + this.y * parent.m11 + parent.worldY; - if (this.data.inheritScale) { - this.worldScaleX = parent.worldScaleX * this.scaleX; - this.worldScaleY = parent.worldScaleY * this.scaleY; - } else { - this.worldScaleX = this.scaleX; - this.worldScaleY = this.scaleY; - } - this.worldRotation = this.data.inheritRotation ? (parent.worldRotation + this.rotationIK) : this.rotationIK; - this.worldFlipX = parent.worldFlipX != this.flipX; - this.worldFlipY = parent.worldFlipY != this.flipY; - } else { - var skeletonFlipX = this.skeleton.flipX, skeletonFlipY = this.skeleton.flipY; - this.worldX = skeletonFlipX ? -this.x : this.x; - this.worldY = (skeletonFlipY != spine.Bone.yDown) ? -this.y : this.y; - this.worldScaleX = this.scaleX; - this.worldScaleY = this.scaleY; - this.worldRotation = this.rotationIK; - this.worldFlipX = skeletonFlipX != this.flipX; - this.worldFlipY = skeletonFlipY != this.flipY; - } - var radians = this.worldRotation * spine.degRad; - var cos = Math.cos(radians); - var sin = Math.sin(radians); - if (this.worldFlipX) { - this.m00 = -cos * this.worldScaleX; - this.m01 = sin * this.worldScaleY; - } else { - this.m00 = cos * this.worldScaleX; - this.m01 = -sin * this.worldScaleY; - } - if (this.worldFlipY != spine.Bone.yDown) { - this.m10 = -sin * this.worldScaleX; - this.m11 = -cos * this.worldScaleY; - } else { - this.m10 = sin * this.worldScaleX; - this.m11 = cos * this.worldScaleY; - } - }, - setToSetupPose: function () { - var data = this.data; - this.x = data.x; - this.y = data.y; - this.rotation = data.rotation; - this.rotationIK = this.rotation; - this.scaleX = data.scaleX; - this.scaleY = data.scaleY; - this.flipX = data.flipX; - this.flipY = data.flipY; - }, - worldToLocal: function (world) { - var dx = world[0] - this.worldX, dy = world[1] - this.worldY; - var m00 = this.m00, m10 = this.m10, m01 = this.m01, m11 = this.m11; - if (this.worldFlipX != (this.worldFlipY != spine.Bone.yDown)) { - m00 = -m00; - m11 = -m11; - } - var invDet = 1 / (m00 * m11 - m01 * m10); - world[0] = dx * m00 * invDet - dy * m01 * invDet; - world[1] = dy * m11 * invDet - dx * m10 * invDet; - }, - localToWorld: function (local) { - var localX = local[0], localY = local[1]; - local[0] = localX * this.m00 + localY * this.m01 + this.worldX; - local[1] = localX * this.m10 + localY * this.m11 + this.worldY; - } -}; - -spine.Slot = function (slotData, bone) { - this.data = slotData; - this.bone = bone; - this.setToSetupPose(); -}; -spine.Slot.prototype = { - r: 1, g: 1, b: 1, a: 1, - _attachmentTime: 0, - attachment: null, - attachmentVertices: [], - setAttachment: function (attachment) { - this.attachment = attachment; - this._attachmentTime = this.bone.skeleton.time; - this.attachmentVertices.length = 0; - }, - setAttachmentTime: function (time) { - this._attachmentTime = this.bone.skeleton.time - time; - }, - getAttachmentTime: function () { - return this.bone.skeleton.time - this._attachmentTime; - }, - setToSetupPose: function () { - var data = this.data; - this.r = data.r; - this.g = data.g; - this.b = data.b; - this.a = data.a; - - var slotDatas = this.bone.skeleton.data.slots; - for (var i = 0, n = slotDatas.length; i < n; i++) { - if (slotDatas[i] == data) { - this.setAttachment(!data.attachmentName ? null : this.bone.skeleton.getAttachmentBySlotIndex(i, data.attachmentName)); - break; - } - } - } -}; - -spine.IkConstraint = function (data, skeleton) { - this.data = data; - this.mix = data.mix; - this.bendDirection = data.bendDirection; - - this.bones = []; - for (var i = 0, n = data.bones.length; i < n; i++) - this.bones.push(skeleton.findBone(data.bones[i].name)); - this.target = skeleton.findBone(data.target.name); -}; -spine.IkConstraint.prototype = { - apply: function () { - var target = this.target; - var bones = this.bones; - switch (bones.length) { - case 1: - spine.IkConstraint.apply1(bones[0], target.worldX, target.worldY, this.mix); - break; - case 2: - spine.IkConstraint.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.mix); - break; - } - } -}; -/** Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified in the world - * coordinate system. */ -spine.IkConstraint.apply1 = function (bone, targetX, targetY, alpha) { - var parentRotation = (!bone.data.inheritRotation || !bone.parent) ? 0 : bone.parent.worldRotation; - var rotation = bone.rotation; - var rotationIK = Math.atan2(targetY - bone.worldY, targetX - bone.worldX) * spine.radDeg - parentRotation; - bone.rotationIK = rotation + (rotationIK - rotation) * alpha; -}; -/** Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as possible. The - * target is specified in the world coordinate system. - * @param child Any descendant bone of the parent. */ -spine.IkConstraint.apply2 = function (parent, child, targetX, targetY, bendDirection, alpha) { - var childRotation = child.rotation, parentRotation = parent.rotation; - if (!alpha) { - child.rotationIK = childRotation; - parent.rotationIK = parentRotation; - return; - } - var positionX, positionY, tempPosition = spine.temp; - var parentParent = parent.parent; - if (parentParent) { - tempPosition[0] = targetX; - tempPosition[1] = targetY; - parentParent.worldToLocal(tempPosition); - targetX = (tempPosition[0] - parent.x) * parentParent.worldScaleX; - targetY = (tempPosition[1] - parent.y) * parentParent.worldScaleY; - } else { - targetX -= parent.x; - targetY -= parent.y; - } - if (child.parent == parent) { - positionX = child.x; - positionY = child.y; - } else { - tempPosition[0] = child.x; - tempPosition[1] = child.y; - child.parent.localToWorld(tempPosition); - parent.worldToLocal(tempPosition); - positionX = tempPosition[0]; - positionY = tempPosition[1]; - } - var childX = positionX * parent.worldScaleX, childY = positionY * parent.worldScaleY; - var offset = Math.atan2(childY, childX); - var len1 = Math.sqrt(childX * childX + childY * childY), len2 = child.data.length * child.worldScaleX; - // Based on code by Ryan Juckett with permission: Copyright (c) 2008-2009 Ryan Juckett, http://www.ryanjuckett.com/ - var cosDenom = 2 * len1 * len2; - if (cosDenom < 0.0001) { - child.rotationIK = childRotation + (Math.atan2(targetY, targetX) * spine.radDeg - parentRotation - childRotation) * alpha; - return; - } - var cos = (targetX * targetX + targetY * targetY - len1 * len1 - len2 * len2) / cosDenom; - if (cos < -1) - cos = -1; - else if (cos > 1) - cos = 1; - var childAngle = Math.acos(cos) * bendDirection; - var adjacent = len1 + len2 * cos, opposite = len2 * Math.sin(childAngle); - var parentAngle = Math.atan2(targetY * adjacent - targetX * opposite, targetX * adjacent + targetY * opposite); - var rotation = (parentAngle - offset) * spine.radDeg - parentRotation; - if (rotation > 180) - rotation -= 360; - else if (rotation < -180) // - rotation += 360; - parent.rotationIK = parentRotation + rotation * alpha; - rotation = (childAngle + offset) * spine.radDeg - childRotation; - if (rotation > 180) - rotation -= 360; - else if (rotation < -180) // - rotation += 360; - child.rotationIK = childRotation + (rotation + parent.worldRotation - child.parent.worldRotation) * alpha; -}; - -spine.Skin = function (name) { - this.name = name; - this.attachments = {}; -}; -spine.Skin.prototype = { - addAttachment: function (slotIndex, name, attachment) { - this.attachments[slotIndex + ":" + name] = attachment; - }, - getAttachment: function (slotIndex, name) { - return this.attachments[slotIndex + ":" + name]; - }, - _attachAll: function (skeleton, oldSkin) { - for (var key in oldSkin.attachments) { - var colon = key.indexOf(":"); - var slotIndex = parseInt(key.substring(0, colon)); - var name = key.substring(colon + 1); - var slot = skeleton.slots[slotIndex]; - if (slot.attachment && slot.attachment.name == name) { - var attachment = this.getAttachment(slotIndex, name); - if (attachment) slot.setAttachment(attachment); - } - } - } -}; - -spine.Animation = function (name, timelines, duration) { - this.name = name; - this.timelines = timelines; - this.duration = duration; -}; -spine.Animation.prototype = { - apply: function (skeleton, lastTime, time, loop, events) { - if (loop && this.duration != 0) { - time %= this.duration; - lastTime %= this.duration; - } - var timelines = this.timelines; - for (var i = 0, n = timelines.length; i < n; i++) - timelines[i].apply(skeleton, lastTime, time, events, 1); - }, - mix: function (skeleton, lastTime, time, loop, events, alpha) { - if (loop && this.duration != 0) { - time %= this.duration; - lastTime %= this.duration; - } - var timelines = this.timelines; - for (var i = 0, n = timelines.length; i < n; i++) - timelines[i].apply(skeleton, lastTime, time, events, alpha); - } -}; -spine.Animation.binarySearch = function (values, target, step) { - var low = 0; - var high = Math.floor(values.length / step) - 2; - if (!high) return step; - var current = high >>> 1; - while (true) { - if (values[(current + 1) * step] <= target) - low = current + 1; - else - high = current; - if (low == high) return (low + 1) * step; - current = (low + high) >>> 1; - } -}; -spine.Animation.binarySearch1 = function (values, target) { - var low = 0; - var high = values.length - 2; - if (!high) return 1; - var current = high >>> 1; - while (true) { - if (values[current + 1] <= target) - low = current + 1; - else - high = current; - if (low == high) return low + 1; - current = (low + high) >>> 1; - } -}; -spine.Animation.linearSearch = function (values, target, step) { - for (var i = 0, last = values.length - step; i <= last; i += step) - if (values[i] > target) return i; - return -1; -}; - -spine.Curves = function (frameCount) { - this.curves = []; // type, x, y, ... - //this.curves.length = (frameCount - 1) * 19/*BEZIER_SIZE*/; -}; -spine.Curves.prototype = { - setLinear: function (frameIndex) { - this.curves[frameIndex * 19/*BEZIER_SIZE*/] = 0/*LINEAR*/; - }, - setStepped: function (frameIndex) { - this.curves[frameIndex * 19/*BEZIER_SIZE*/] = 1/*STEPPED*/; - }, - /** Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next. - * cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of - * the difference between the keyframe's values. */ - setCurve: function (frameIndex, cx1, cy1, cx2, cy2) { - var subdiv1 = 1 / 10/*BEZIER_SEGMENTS*/, subdiv2 = subdiv1 * subdiv1, subdiv3 = subdiv2 * subdiv1; - var pre1 = 3 * subdiv1, pre2 = 3 * subdiv2, pre4 = 6 * subdiv2, pre5 = 6 * subdiv3; - var tmp1x = -cx1 * 2 + cx2, tmp1y = -cy1 * 2 + cy2, tmp2x = (cx1 - cx2) * 3 + 1, tmp2y = (cy1 - cy2) * 3 + 1; - var dfx = cx1 * pre1 + tmp1x * pre2 + tmp2x * subdiv3, dfy = cy1 * pre1 + tmp1y * pre2 + tmp2y * subdiv3; - var ddfx = tmp1x * pre4 + tmp2x * pre5, ddfy = tmp1y * pre4 + tmp2y * pre5; - var dddfx = tmp2x * pre5, dddfy = tmp2y * pre5; - - var i = frameIndex * 19/*BEZIER_SIZE*/; - var curves = this.curves; - curves[i++] = 2/*BEZIER*/; - - var x = dfx, y = dfy; - for (var n = i + 19/*BEZIER_SIZE*/ - 1; i < n; i += 2) { - curves[i] = x; - curves[i + 1] = y; - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - x += dfx; - y += dfy; - } - }, - getCurvePercent: function (frameIndex, percent) { - percent = percent < 0 ? 0 : (percent > 1 ? 1 : percent); - var curves = this.curves; - var i = frameIndex * 19/*BEZIER_SIZE*/; - var type = curves[i]; - if (type === 0/*LINEAR*/) return percent; - if (type == 1/*STEPPED*/) return 0; - i++; - var x = 0; - for (var start = i, n = i + 19/*BEZIER_SIZE*/ - 1; i < n; i += 2) { - x = curves[i]; - if (x >= percent) { - var prevX, prevY; - if (i == start) { - prevX = 0; - prevY = 0; - } else { - prevX = curves[i - 2]; - prevY = curves[i - 1]; - } - return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX); - } - } - var y = curves[i - 1]; - return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1. - } -}; - -spine.RotateTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, angle, ... - this.frames.length = frameCount * 2; -}; -spine.RotateTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, angle) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = angle; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 2]) { // Time is after last frame. - var amount = bone.data.rotation + frames[frames.length - 1] - bone.rotation; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - bone.rotation += amount * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 2); - var prevFrameValue = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 2/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 2 - 1, percent); - - var amount = frames[frameIndex + 1/*FRAME_VALUE*/] - prevFrameValue; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - amount = bone.data.rotation + (prevFrameValue + amount * percent) - bone.rotation; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - bone.rotation += amount * alpha; - } -}; - -spine.TranslateTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, x, y, ... - this.frames.length = frameCount * 3; -}; -spine.TranslateTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, x, y) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = x; - this.frames[frameIndex + 2] = y; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - bone.x += (bone.data.x + frames[frames.length - 2] - bone.x) * alpha; - bone.y += (bone.data.y + frames[frames.length - 1] - bone.y) * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameX = frames[frameIndex - 2]; - var prevFrameY = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - bone.x += (bone.data.x + prevFrameX + (frames[frameIndex + 1/*FRAME_X*/] - prevFrameX) * percent - bone.x) * alpha; - bone.y += (bone.data.y + prevFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - prevFrameY) * percent - bone.y) * alpha; - } -}; - -spine.ScaleTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, x, y, ... - this.frames.length = frameCount * 3; -}; -spine.ScaleTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, x, y) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = x; - this.frames[frameIndex + 2] = y; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - bone.scaleX += (bone.data.scaleX * frames[frames.length - 2] - bone.scaleX) * alpha; - bone.scaleY += (bone.data.scaleY * frames[frames.length - 1] - bone.scaleY) * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameX = frames[frameIndex - 2]; - var prevFrameY = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - bone.scaleX += (bone.data.scaleX * (prevFrameX + (frames[frameIndex + 1/*FRAME_X*/] - prevFrameX) * percent) - bone.scaleX) * alpha; - bone.scaleY += (bone.data.scaleY * (prevFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - prevFrameY) * percent) - bone.scaleY) * alpha; - } -}; - -spine.ColorTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, r, g, b, a, ... - this.frames.length = frameCount * 5; -}; -spine.ColorTimeline.prototype = { - slotIndex: 0, - getFrameCount: function () { - return this.frames.length / 5; - }, - setFrame: function (frameIndex, time, r, g, b, a) { - frameIndex *= 5; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = r; - this.frames[frameIndex + 2] = g; - this.frames[frameIndex + 3] = b; - this.frames[frameIndex + 4] = a; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var r, g, b, a; - if (time >= frames[frames.length - 5]) { - // Time is after last frame. - var i = frames.length - 1; - r = frames[i - 3]; - g = frames[i - 2]; - b = frames[i - 1]; - a = frames[i]; - } else { - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 5); - var prevFrameR = frames[frameIndex - 4]; - var prevFrameG = frames[frameIndex - 3]; - var prevFrameB = frames[frameIndex - 2]; - var prevFrameA = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 5/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 5 - 1, percent); - - r = prevFrameR + (frames[frameIndex + 1/*FRAME_R*/] - prevFrameR) * percent; - g = prevFrameG + (frames[frameIndex + 2/*FRAME_G*/] - prevFrameG) * percent; - b = prevFrameB + (frames[frameIndex + 3/*FRAME_B*/] - prevFrameB) * percent; - a = prevFrameA + (frames[frameIndex + 4/*FRAME_A*/] - prevFrameA) * percent; - } - var slot = skeleton.slots[this.slotIndex]; - if (alpha < 1) { - slot.r += (r - slot.r) * alpha; - slot.g += (g - slot.g) * alpha; - slot.b += (b - slot.b) * alpha; - slot.a += (a - slot.a) * alpha; - } else { - slot.r = r; - slot.g = g; - slot.b = b; - slot.a = a; - } - } -}; - -spine.AttachmentTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, ... - this.frames.length = frameCount; - this.attachmentNames = []; - this.attachmentNames.length = frameCount; -}; -spine.AttachmentTimeline.prototype = { - slotIndex: 0, - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, attachmentName) { - this.frames[frameIndex] = time; - this.attachmentNames[frameIndex] = attachmentName; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - - var frameIndex = time >= frames[frames.length - 1] ? frames.length - 1 : spine.Animation.binarySearch1(frames, time) - 1; - if (frames[frameIndex] < lastTime) return; - - var attachmentName = this.attachmentNames[frameIndex]; - skeleton.slots[this.slotIndex].setAttachment( - !attachmentName ? null : skeleton.getAttachmentBySlotIndex(this.slotIndex, attachmentName)); - } -}; - -spine.EventTimeline = function (frameCount) { - this.frames = []; // time, ... - this.frames.length = frameCount; - this.events = []; - this.events.length = frameCount; -}; -spine.EventTimeline.prototype = { - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, event) { - this.frames[frameIndex] = time; - this.events[frameIndex] = event; - }, - /** Fires events for frames > lastTime and <= time. */ - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - if (!firedEvents) return; - - var frames = this.frames; - var frameCount = frames.length; - - if (lastTime > time) { // Fire events after last time for looped animations. - this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha); - lastTime = -1; - } else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame. - return; - if (time < frames[0]) return; // Time is before first frame. - - var frameIndex; - if (lastTime < frames[0]) - frameIndex = 0; - else { - frameIndex = spine.Animation.binarySearch1(frames, lastTime); - var frame = frames[frameIndex]; - while (frameIndex > 0) { // Fire multiple events with the same frame. - if (frames[frameIndex - 1] != frame) break; - frameIndex--; - } - } - var events = this.events; - for (; frameIndex < frameCount && time >= frames[frameIndex]; frameIndex++) - firedEvents.push(events[frameIndex]); - } -}; - -spine.DrawOrderTimeline = function (frameCount) { - this.frames = []; // time, ... - this.frames.length = frameCount; - this.drawOrders = []; - this.drawOrders.length = frameCount; -}; -spine.DrawOrderTimeline.prototype = { - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, drawOrder) { - this.frames[frameIndex] = time; - this.drawOrders[frameIndex] = drawOrder; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var frameIndex; - if (time >= frames[frames.length - 1]) // Time is after last frame. - frameIndex = frames.length - 1; - else - frameIndex = spine.Animation.binarySearch1(frames, time) - 1; - - var drawOrder = skeleton.drawOrder; - var slots = skeleton.slots; - var drawOrderToSetupIndex = this.drawOrders[frameIndex]; - if (!drawOrderToSetupIndex) { - for (var i = 0, n = slots.length; i < n; i++) - drawOrder[i] = slots[i]; - } else { - for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++) - drawOrder[i] = skeleton.slots[drawOrderToSetupIndex[i]]; - } - - } -}; - -spine.FfdTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; - this.frames.length = frameCount; - this.frameVertices = []; - this.frameVertices.length = frameCount; -}; -spine.FfdTimeline.prototype = { - slotIndex: 0, - attachment: 0, - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, vertices) { - this.frames[frameIndex] = time; - this.frameVertices[frameIndex] = vertices; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var slot = skeleton.slots[this.slotIndex]; - if (slot.attachment != this.attachment) return; - - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var frameVertices = this.frameVertices; - var vertexCount = frameVertices[0].length; - - var vertices = slot.attachmentVertices; - if (vertices.length != vertexCount) alpha = 1; - vertices.length = vertexCount; - - if (time >= frames[frames.length - 1]) { // Time is after last frame. - var lastVertices = frameVertices[frames.length - 1]; - if (alpha < 1) { - for (var i = 0; i < vertexCount; i++) - vertices[i] += (lastVertices[i] - vertices[i]) * alpha; - } else { - for (var i = 0; i < vertexCount; i++) - vertices[i] = lastVertices[i]; - } - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch1(frames, time); - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 1] - frameTime); - percent = this.curves.getCurvePercent(frameIndex - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent)); - - var prevVertices = frameVertices[frameIndex - 1]; - var nextVertices = frameVertices[frameIndex]; - - if (alpha < 1) { - for (var i = 0; i < vertexCount; i++) { - var prev = prevVertices[i]; - vertices[i] += (prev + (nextVertices[i] - prev) * percent - vertices[i]) * alpha; - } - } else { - for (var i = 0; i < vertexCount; i++) { - var prev = prevVertices[i]; - vertices[i] = prev + (nextVertices[i] - prev) * percent; - } - } - } -}; - -spine.IkConstraintTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, mix, bendDirection, ... - this.frames.length = frameCount * 3; -}; -spine.IkConstraintTimeline.prototype = { - ikConstraintIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, mix, bendDirection) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = mix; - this.frames[frameIndex + 2] = bendDirection; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var ikConstraint = skeleton.ikConstraints[this.ikConstraintIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - ikConstraint.mix += (frames[frames.length - 2] - ikConstraint.mix) * alpha; - ikConstraint.bendDirection = frames[frames.length - 1]; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameMix = frames[frameIndex + -2/*PREV_FRAME_MIX*/]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - var mix = prevFrameMix + (frames[frameIndex + 1/*FRAME_MIX*/] - prevFrameMix) * percent; - ikConstraint.mix += (mix - ikConstraint.mix) * alpha; - ikConstraint.bendDirection = frames[frameIndex + -1/*PREV_FRAME_BEND_DIRECTION*/]; - } -}; - -spine.FlipXTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, flip, ... - this.frames.length = frameCount * 2; -}; -spine.FlipXTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, flip) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = flip ? 1 : 0; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - var frameIndex = (time >= frames[frames.length - 2] ? frames.length : spine.Animation.binarySearch(frames, time, 2)) - 2; - if (frames[frameIndex] < lastTime) return; - skeleton.bones[boneIndex].flipX = frames[frameIndex + 1] != 0; - } -}; - -spine.FlipYTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, flip, ... - this.frames.length = frameCount * 2; -}; -spine.FlipYTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, flip) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = flip ? 1 : 0; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - var frameIndex = (time >= frames[frames.length - 2] ? frames.length : spine.Animation.binarySearch(frames, time, 2)) - 2; - if (frames[frameIndex] < lastTime) return; - skeleton.bones[boneIndex].flipY = frames[frameIndex + 1] != 0; - } -}; - -spine.SkeletonData = function () { - this.bones = []; - this.slots = []; - this.skins = []; - this.events = []; - this.animations = []; - this.ikConstraints = []; -}; -spine.SkeletonData.prototype = { - name: null, - defaultSkin: null, - width: 0, height: 0, - version: null, hash: null, - /** @return May be null. */ - findBone: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].name == boneName) return bones[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findBoneIndex: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].name == boneName) return i; - return -1; - }, - /** @return May be null. */ - findSlot: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - if (slots[i].name == slotName) return slot[i]; - } - return null; - }, - /** @return -1 if the bone was not found. */ - findSlotIndex: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].name == slotName) return i; - return -1; - }, - /** @return May be null. */ - findSkin: function (skinName) { - var skins = this.skins; - for (var i = 0, n = skins.length; i < n; i++) - if (skins[i].name == skinName) return skins[i]; - return null; - }, - /** @return May be null. */ - findEvent: function (eventName) { - var events = this.events; - for (var i = 0, n = events.length; i < n; i++) - if (events[i].name == eventName) return events[i]; - return null; - }, - /** @return May be null. */ - findAnimation: function (animationName) { - var animations = this.animations; - for (var i = 0, n = animations.length; i < n; i++) - if (animations[i].name == animationName) return animations[i]; - return null; - }, - /** @return May be null. */ - findIkConstraint: function (ikConstraintName) { - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) - if (ikConstraints[i].name == ikConstraintName) return ikConstraints[i]; - return null; - } -}; - -spine.Skeleton = function (skeletonData) { - this.data = skeletonData; - - this.bones = []; - for (var i = 0, n = skeletonData.bones.length; i < n; i++) { - var boneData = skeletonData.bones[i]; - var parent = !boneData.parent ? null : this.bones[skeletonData.bones.indexOf(boneData.parent)]; - this.bones.push(new spine.Bone(boneData, this, parent)); - } - - this.slots = []; - this.drawOrder = []; - for (var i = 0, n = skeletonData.slots.length; i < n; i++) { - var slotData = skeletonData.slots[i]; - var bone = this.bones[skeletonData.bones.indexOf(slotData.boneData)]; - var slot = new spine.Slot(slotData, bone); - this.slots.push(slot); - this.drawOrder.push(slot); - } - - this.ikConstraints = []; - for (var i = 0, n = skeletonData.ikConstraints.length; i < n; i++) - this.ikConstraints.push(new spine.IkConstraint(skeletonData.ikConstraints[i], this)); - - this.boneCache = []; - this.updateCache(); -}; -spine.Skeleton.prototype = { - x: 0, y: 0, - skin: null, - r: 1, g: 1, b: 1, a: 1, - time: 0, - flipX: false, flipY: false, - /** Caches information about bones and IK constraints. Must be called if bones or IK constraints are added or removed. */ - updateCache: function () { - var ikConstraints = this.ikConstraints; - var ikConstraintsCount = ikConstraints.length; - - var arrayCount = ikConstraintsCount + 1; - var boneCache = this.boneCache; - if (boneCache.length > arrayCount) boneCache.length = arrayCount; - for (var i = 0, n = boneCache.length; i < n; i++) - boneCache[i].length = 0; - while (boneCache.length < arrayCount) - boneCache[boneCache.length] = []; - - var nonIkBones = boneCache[0]; - var bones = this.bones; - - outer: - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - var current = bone; - do { - for (var ii = 0; ii < ikConstraintsCount; ii++) { - var ikConstraint = ikConstraints[ii]; - var parent = ikConstraint.bones[0]; - var child= ikConstraint.bones[ikConstraint.bones.length - 1]; - while (true) { - if (current == child) { - boneCache[ii].push(bone); - boneCache[ii + 1].push(bone); - continue outer; - } - if (child == parent) break; - child = child.parent; - } - } - current = current.parent; - } while (current); - nonIkBones[nonIkBones.length] = bone; - } - }, - /** Updates the world transform for each bone. */ - updateWorldTransform: function () { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - bone.rotationIK = bone.rotation; - } - var i = 0, last = this.boneCache.length - 1; - while (true) { - var cacheBones = this.boneCache[i]; - for (var ii = 0, nn = cacheBones.length; ii < nn; ii++) - cacheBones[ii].updateWorldTransform(); - if (i == last) break; - this.ikConstraints[i].apply(); - i++; - } - }, - /** Sets the bones and slots to their setup pose values. */ - setToSetupPose: function () { - this.setBonesToSetupPose(); - this.setSlotsToSetupPose(); - }, - setBonesToSetupPose: function () { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - bones[i].setToSetupPose(); - - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) { - var ikConstraint = ikConstraints[i]; - ikConstraint.bendDirection = ikConstraint.data.bendDirection; - ikConstraint.mix = ikConstraint.data.mix; - } - }, - setSlotsToSetupPose: function () { - var slots = this.slots; - var drawOrder = this.drawOrder; - for (var i = 0, n = slots.length; i < n; i++) { - drawOrder[i] = slots[i]; - slots[i].setToSetupPose(i); - } - }, - /** @return May return null. */ - getRootBone: function () { - return this.bones.length ? this.bones[0] : null; - }, - /** @return May be null. */ - findBone: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].data.name == boneName) return bones[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findBoneIndex: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].data.name == boneName) return i; - return -1; - }, - /** @return May be null. */ - findSlot: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].data.name == slotName) return slots[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findSlotIndex: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].data.name == slotName) return i; - return -1; - }, - setSkinByName: function (skinName) { - var skin = this.data.findSkin(skinName); - if (!skin) throw "Skin not found: " + skinName; - this.setSkin(skin); - }, - /** Sets the skin used to look up attachments before looking in the {@link SkeletonData#getDefaultSkin() default skin}. - * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was - * no old skin, each slot's setup mode attachment is attached from the new skin. - * @param newSkin May be null. */ - setSkin: function (newSkin) { - if (newSkin) { - if (this.skin) - newSkin._attachAll(this, this.skin); - else { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - var name = slot.data.attachmentName; - if (name) { - var attachment = newSkin.getAttachment(i, name); - if (attachment) slot.setAttachment(attachment); - } - } - } - } - this.skin = newSkin; - }, - /** @return May be null. */ - getAttachmentBySlotName: function (slotName, attachmentName) { - return this.getAttachmentBySlotIndex(this.data.findSlotIndex(slotName), attachmentName); - }, - /** @return May be null. */ - getAttachmentBySlotIndex: function (slotIndex, attachmentName) { - if (this.skin) { - var attachment = this.skin.getAttachment(slotIndex, attachmentName); - if (attachment) return attachment; - } - if (this.data.defaultSkin) return this.data.defaultSkin.getAttachment(slotIndex, attachmentName); - return null; - }, - /** @param attachmentName May be null. */ - setAttachment: function (slotName, attachmentName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - if (slot.data.name == slotName) { - var attachment = null; - if (attachmentName) { - attachment = this.getAttachmentBySlotIndex(i, attachmentName); - if (!attachment) throw "Attachment not found: " + attachmentName + ", for slot: " + slotName; - } - slot.setAttachment(attachment); - return; - } - } - throw "Slot not found: " + slotName; - }, - /** @return May be null. */ - findIkConstraint: function (ikConstraintName) { - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) - if (ikConstraints[i].data.name == ikConstraintName) return ikConstraints[i]; - return null; - }, - update: function (delta) { - this.time += delta; - } -}; - -spine.EventData = function (name) { - this.name = name; -}; -spine.EventData.prototype = { - intValue: 0, - floatValue: 0, - stringValue: null -}; - -spine.Event = function (data) { - this.data = data; -}; -spine.Event.prototype = { - intValue: 0, - floatValue: 0, - stringValue: null -}; - -spine.AttachmentType = { - region: 0, - boundingbox: 1, - mesh: 2, - skinnedmesh: 3 -}; - -spine.RegionAttachment = function (name) { - this.name = name; - this.offset = []; - this.offset.length = 8; - this.uvs = []; - this.uvs.length = 8; -}; -spine.RegionAttachment.prototype = { - type: spine.AttachmentType.region, - x: 0, y: 0, - rotation: 0, - scaleX: 1, scaleY: 1, - width: 0, height: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - setUVs: function (u, v, u2, v2, rotate) { - var uvs = this.uvs; - if (rotate) { - uvs[2/*X2*/] = u; - uvs[3/*Y2*/] = v2; - uvs[4/*X3*/] = u; - uvs[5/*Y3*/] = v; - uvs[6/*X4*/] = u2; - uvs[7/*Y4*/] = v; - uvs[0/*X1*/] = u2; - uvs[1/*Y1*/] = v2; - } else { - uvs[0/*X1*/] = u; - uvs[1/*Y1*/] = v2; - uvs[2/*X2*/] = u; - uvs[3/*Y2*/] = v; - uvs[4/*X3*/] = u2; - uvs[5/*Y3*/] = v; - uvs[6/*X4*/] = u2; - uvs[7/*Y4*/] = v2; - } - }, - updateOffset: function () { - var regionScaleX = this.width / this.regionOriginalWidth * this.scaleX; - var regionScaleY = this.height / this.regionOriginalHeight * this.scaleY; - var localX = -this.width / 2 * this.scaleX + this.regionOffsetX * regionScaleX; - var localY = -this.height / 2 * this.scaleY + this.regionOffsetY * regionScaleY; - var localX2 = localX + this.regionWidth * regionScaleX; - var localY2 = localY + this.regionHeight * regionScaleY; - var radians = this.rotation * spine.degRad; - var cos = Math.cos(radians); - var sin = Math.sin(radians); - var localXCos = localX * cos + this.x; - var localXSin = localX * sin; - var localYCos = localY * cos + this.y; - var localYSin = localY * sin; - var localX2Cos = localX2 * cos + this.x; - var localX2Sin = localX2 * sin; - var localY2Cos = localY2 * cos + this.y; - var localY2Sin = localY2 * sin; - var offset = this.offset; - offset[0/*X1*/] = localXCos - localYSin; - offset[1/*Y1*/] = localYCos + localXSin; - offset[2/*X2*/] = localXCos - localY2Sin; - offset[3/*Y2*/] = localY2Cos + localXSin; - offset[4/*X3*/] = localX2Cos - localY2Sin; - offset[5/*Y3*/] = localY2Cos + localX2Sin; - offset[6/*X4*/] = localX2Cos - localYSin; - offset[7/*Y4*/] = localYCos + localX2Sin; - }, - computeVertices: function (x, y, bone, vertices) { - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var offset = this.offset; - vertices[0/*X1*/] = offset[0/*X1*/] * m00 + offset[1/*Y1*/] * m01 + x; - vertices[1/*Y1*/] = offset[0/*X1*/] * m10 + offset[1/*Y1*/] * m11 + y; - vertices[2/*X2*/] = offset[2/*X2*/] * m00 + offset[3/*Y2*/] * m01 + x; - vertices[3/*Y2*/] = offset[2/*X2*/] * m10 + offset[3/*Y2*/] * m11 + y; - vertices[4/*X3*/] = offset[4/*X3*/] * m00 + offset[5/*X3*/] * m01 + x; - vertices[5/*X3*/] = offset[4/*X3*/] * m10 + offset[5/*X3*/] * m11 + y; - vertices[6/*X4*/] = offset[6/*X4*/] * m00 + offset[7/*Y4*/] * m01 + x; - vertices[7/*Y4*/] = offset[6/*X4*/] * m10 + offset[7/*Y4*/] * m11 + y; - } -}; - -spine.MeshAttachment = function (name) { - this.name = name; -}; -spine.MeshAttachment.prototype = { - type: spine.AttachmentType.mesh, - vertices: null, - uvs: null, - regionUVs: null, - triangles: null, - hullLength: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionU: 0, regionV: 0, regionU2: 0, regionV2: 0, regionRotate: false, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - edges: null, - width: 0, height: 0, - updateUVs: function () { - var width = this.regionU2 - this.regionU, height = this.regionV2 - this.regionV; - var n = this.regionUVs.length; - if (!this.uvs || this.uvs.length != n) { - this.uvs = new spine.Float32Array(n); - } - if (this.regionRotate) { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i + 1] * width; - this.uvs[i + 1] = this.regionV + height - this.regionUVs[i] * height; - } - } else { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i] * width; - this.uvs[i + 1] = this.regionV + this.regionUVs[i + 1] * height; - } - } - }, - computeWorldVertices: function (x, y, slot, worldVertices) { - var bone = slot.bone; - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var vertices = this.vertices; - var verticesCount = vertices.length; - if (slot.attachmentVertices.length == verticesCount) vertices = slot.attachmentVertices; - for (var i = 0; i < verticesCount; i += 2) { - var vx = vertices[i]; - var vy = vertices[i + 1]; - worldVertices[i] = vx * m00 + vy * m01 + x; - worldVertices[i + 1] = vx * m10 + vy * m11 + y; - } - } -}; - -spine.SkinnedMeshAttachment = function (name) { - this.name = name; -}; -spine.SkinnedMeshAttachment.prototype = { - type: spine.AttachmentType.skinnedmesh, - bones: null, - weights: null, - uvs: null, - regionUVs: null, - triangles: null, - hullLength: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionU: 0, regionV: 0, regionU2: 0, regionV2: 0, regionRotate: false, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - edges: null, - width: 0, height: 0, - updateUVs: function (u, v, u2, v2, rotate) { - var width = this.regionU2 - this.regionU, height = this.regionV2 - this.regionV; - var n = this.regionUVs.length; - if (!this.uvs || this.uvs.length != n) { - this.uvs = new spine.Float32Array(n); - } - if (this.regionRotate) { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i + 1] * width; - this.uvs[i + 1] = this.regionV + height - this.regionUVs[i] * height; - } - } else { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i] * width; - this.uvs[i + 1] = this.regionV + this.regionUVs[i + 1] * height; - } - } - }, - computeWorldVertices: function (x, y, slot, worldVertices) { - var skeletonBones = slot.bone.skeleton.bones; - var weights = this.weights; - var bones = this.bones; - - var w = 0, v = 0, b = 0, f = 0, n = bones.length, nn; - var wx, wy, bone, vx, vy, weight; - if (!slot.attachmentVertices.length) { - for (; v < n; w += 2) { - wx = 0; - wy = 0; - nn = bones[v++] + v; - for (; v < nn; v++, b += 3) { - bone = skeletonBones[bones[v]]; - vx = weights[b]; - vy = weights[b + 1]; - weight = weights[b + 2]; - wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight; - wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight; - } - worldVertices[w] = wx + x; - worldVertices[w + 1] = wy + y; - } - } else { - var ffd = slot.attachmentVertices; - for (; v < n; w += 2) { - wx = 0; - wy = 0; - nn = bones[v++] + v; - for (; v < nn; v++, b += 3, f += 2) { - bone = skeletonBones[bones[v]]; - vx = weights[b] + ffd[f]; - vy = weights[b + 1] + ffd[f + 1]; - weight = weights[b + 2]; - wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight; - wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight; - } - worldVertices[w] = wx + x; - worldVertices[w + 1] = wy + y; - } - } - } -}; - -spine.BoundingBoxAttachment = function (name) { - this.name = name; - this.vertices = []; -}; -spine.BoundingBoxAttachment.prototype = { - type: spine.AttachmentType.boundingbox, - computeWorldVertices: function (x, y, bone, worldVertices) { - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var vertices = this.vertices; - for (var i = 0, n = vertices.length; i < n; i += 2) { - var px = vertices[i]; - var py = vertices[i + 1]; - worldVertices[i] = px * m00 + py * m01 + x; - worldVertices[i + 1] = px * m10 + py * m11 + y; - } - } -}; - -spine.AnimationStateData = function (skeletonData) { - this.skeletonData = skeletonData; - this.animationToMixTime = {}; -}; -spine.AnimationStateData.prototype = { - defaultMix: 0, - setMixByName: function (fromName, toName, duration) { - var from = this.skeletonData.findAnimation(fromName); - if (!from) throw "Animation not found: " + fromName; - var to = this.skeletonData.findAnimation(toName); - if (!to) throw "Animation not found: " + toName; - this.setMix(from, to, duration); - }, - setMix: function (from, to, duration) { - this.animationToMixTime[from.name + ":" + to.name] = duration; - }, - getMix: function (from, to) { - var key = from.name + ":" + to.name; - return this.animationToMixTime.hasOwnProperty(key) ? this.animationToMixTime[key] : this.defaultMix; - } -}; - -spine.TrackEntry = function () {}; -spine.TrackEntry.prototype = { - next: null, previous: null, - animation: null, - loop: false, - delay: 0, time: 0, lastTime: -1, endTime: 0, - timeScale: 1, - mixTime: 0, mixDuration: 0, mix: 1, - onStart: null, onEnd: null, onComplete: null, onEvent: null -}; - -spine.AnimationState = function (stateData) { - this.data = stateData; - this.tracks = []; - this.events = []; -}; -spine.AnimationState.prototype = { - onStart: null, - onEnd: null, - onComplete: null, - onEvent: null, - timeScale: 1, - update: function (delta) { - delta *= this.timeScale; - for (var i = 0; i < this.tracks.length; i++) { - var current = this.tracks[i]; - if (!current) continue; - - current.time += delta * current.timeScale; - if (current.previous) { - var previousDelta = delta * current.previous.timeScale; - current.previous.time += previousDelta; - current.mixTime += previousDelta; - } - - var next = current.next; - if (next) { - next.time = current.lastTime - next.delay; - if (next.time >= 0) this.setCurrent(i, next); - } else { - // End non-looping animation when it reaches its end time and there is no next entry. - if (!current.loop && current.lastTime >= current.endTime) this.clearTrack(i); - } - } - }, - apply: function (skeleton) { - for (var i = 0; i < this.tracks.length; i++) { - var current = this.tracks[i]; - if (!current) continue; - - this.events.length = 0; - - var time = current.time; - var lastTime = current.lastTime; - var endTime = current.endTime; - var loop = current.loop; - if (!loop && time > endTime) time = endTime; - - var previous = current.previous; - if (!previous) { - if (current.mix == 1) - current.animation.apply(skeleton, current.lastTime, time, loop, this.events); - else - current.animation.mix(skeleton, current.lastTime, time, loop, this.events, current.mix); - } else { - var previousTime = previous.time; - if (!previous.loop && previousTime > previous.endTime) previousTime = previous.endTime; - previous.animation.apply(skeleton, previousTime, previousTime, previous.loop, null); - - var alpha = current.mixTime / current.mixDuration * current.mix; - if (alpha >= 1) { - alpha = 1; - current.previous = null; - } - current.animation.mix(skeleton, current.lastTime, time, loop, this.events, alpha); - } - - for (var ii = 0, nn = this.events.length; ii < nn; ii++) { - var event = this.events[ii]; - if (current.onEvent) current.onEvent(i, event); - if (this.onEvent) this.onEvent(i, event); - } - - // Check if completed the animation or a loop iteration. - if (loop ? (lastTime % endTime > time % endTime) : (lastTime < endTime && time >= endTime)) { - var count = Math.floor(time / endTime); - if (current.onComplete) current.onComplete(i, count); - if (this.onComplete) this.onComplete(i, count); - } - - current.lastTime = current.time; - } - }, - clearTracks: function () { - for (var i = 0, n = this.tracks.length; i < n; i++) - this.clearTrack(i); - this.tracks.length = 0; - }, - clearTrack: function (trackIndex) { - if (trackIndex >= this.tracks.length) return; - var current = this.tracks[trackIndex]; - if (!current) return; - - if (current.onEnd) current.onEnd(trackIndex); - if (this.onEnd) this.onEnd(trackIndex); - - this.tracks[trackIndex] = null; - }, - _expandToIndex: function (index) { - if (index < this.tracks.length) return this.tracks[index]; - while (index >= this.tracks.length) - this.tracks.push(null); - return null; - }, - setCurrent: function (index, entry) { - var current = this._expandToIndex(index); - if (current) { - var previous = current.previous; - current.previous = null; - - if (current.onEnd) current.onEnd(index); - if (this.onEnd) this.onEnd(index); - - entry.mixDuration = this.data.getMix(current.animation, entry.animation); - if (entry.mixDuration > 0) { - entry.mixTime = 0; - // If a mix is in progress, mix from the closest animation. - if (previous && current.mixTime / current.mixDuration < 0.5) - entry.previous = previous; - else - entry.previous = current; - } - } - - this.tracks[index] = entry; - - if (entry.onStart) entry.onStart(index); - if (this.onStart) this.onStart(index); - }, - setAnimationByName: function (trackIndex, animationName, loop) { - var animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) throw "Animation not found: " + animationName; - return this.setAnimation(trackIndex, animation, loop); - }, - /** Set the current animation. Any queued animations are cleared. */ - setAnimation: function (trackIndex, animation, loop) { - var entry = new spine.TrackEntry(); - entry.animation = animation; - entry.loop = loop; - entry.endTime = animation.duration; - this.setCurrent(trackIndex, entry); - return entry; - }, - addAnimationByName: function (trackIndex, animationName, loop, delay) { - var animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) throw "Animation not found: " + animationName; - return this.addAnimation(trackIndex, animation, loop, delay); - }, - /** Adds an animation to be played delay seconds after the current or last queued animation. - * @param delay May be <= 0 to use duration of previous animation minus any mix duration plus the negative delay. */ - addAnimation: function (trackIndex, animation, loop, delay) { - var entry = new spine.TrackEntry(); - entry.animation = animation; - entry.loop = loop; - entry.endTime = animation.duration; - - var last = this._expandToIndex(trackIndex); - if (last) { - while (last.next) - last = last.next; - last.next = entry; - } else - this.tracks[trackIndex] = entry; - - if (delay <= 0) { - if (last) - delay += last.endTime - this.data.getMix(last.animation, animation); - else - delay = 0; - } - entry.delay = delay; - - return entry; - }, - /** May be null. */ - getCurrent: function (trackIndex) { - if (trackIndex >= this.tracks.length) return null; - return this.tracks[trackIndex]; - } -}; - -spine.SkeletonJson = function (attachmentLoader) { - this.attachmentLoader = attachmentLoader; -}; -spine.SkeletonJson.prototype = { - scale: 1, - readSkeletonData: function (root, name) { - var skeletonData = new spine.SkeletonData(); - skeletonData.name = name; - - // Skeleton. - var skeletonMap = root["skeleton"]; - if (skeletonMap) { - skeletonData.hash = skeletonMap["hash"]; - skeletonData.version = skeletonMap["spine"]; - skeletonData.width = skeletonMap["width"] || 0; - skeletonData.height = skeletonMap["height"] || 0; - } - - // Bones. - var bones = root["bones"]; - for (var i = 0, n = bones.length; i < n; i++) { - var boneMap = bones[i]; - var parent = null; - if (boneMap["parent"]) { - parent = skeletonData.findBone(boneMap["parent"]); - if (!parent) throw "Parent bone not found: " + boneMap["parent"]; - } - var boneData = new spine.BoneData(boneMap["name"], parent); - boneData.length = (boneMap["length"] || 0) * this.scale; - boneData.x = (boneMap["x"] || 0) * this.scale; - boneData.y = (boneMap["y"] || 0) * this.scale; - boneData.rotation = (boneMap["rotation"] || 0); - boneData.scaleX = boneMap.hasOwnProperty("scaleX") ? boneMap["scaleX"] : 1; - boneData.scaleY = boneMap.hasOwnProperty("scaleY") ? boneMap["scaleY"] : 1; - boneData.inheritScale = boneMap.hasOwnProperty("inheritScale") ? boneMap["inheritScale"] : true; - boneData.inheritRotation = boneMap.hasOwnProperty("inheritRotation") ? boneMap["inheritRotation"] : true; - skeletonData.bones.push(boneData); - } - - // IK constraints. - var ik = root["ik"]; - if (ik) { - for (var i = 0, n = ik.length; i < n; i++) { - var ikMap = ik[i]; - var ikConstraintData = new spine.IkConstraintData(ikMap["name"]); - - var bones = ikMap["bones"]; - for (var ii = 0, nn = bones.length; ii < nn; ii++) { - var bone = skeletonData.findBone(bones[ii]); - if (!bone) throw "IK bone not found: " + bones[ii]; - ikConstraintData.bones.push(bone); - } - - ikConstraintData.target = skeletonData.findBone(ikMap["target"]); - if (!ikConstraintData.target) throw "Target bone not found: " + ikMap["target"]; - - ikConstraintData.bendDirection = (!ikMap.hasOwnProperty("bendPositive") || ikMap["bendPositive"]) ? 1 : -1; - ikConstraintData.mix = ikMap.hasOwnProperty("mix") ? ikMap["mix"] : 1; - - skeletonData.ikConstraints.push(ikConstraintData); - } - } - - // Slots. - var slots = root["slots"]; - for (var i = 0, n = slots.length; i < n; i++) { - var slotMap = slots[i]; - var boneData = skeletonData.findBone(slotMap["bone"]); - if (!boneData) throw "Slot bone not found: " + slotMap["bone"]; - var slotData = new spine.SlotData(slotMap["name"], boneData); - - var color = slotMap["color"]; - if (color) { - slotData.r = this.toColor(color, 0); - slotData.g = this.toColor(color, 1); - slotData.b = this.toColor(color, 2); - slotData.a = this.toColor(color, 3); - } - - slotData.attachmentName = slotMap["attachment"]; - slotData.additiveBlending = slotMap["additive"] && slotMap["additive"] == "true"; - - skeletonData.slots.push(slotData); - } - - // Skins. - var skins = root["skins"]; - for (var skinName in skins) { - if (!skins.hasOwnProperty(skinName)) continue; - var skinMap = skins[skinName]; - var skin = new spine.Skin(skinName); - for (var slotName in skinMap) { - if (!skinMap.hasOwnProperty(slotName)) continue; - var slotIndex = skeletonData.findSlotIndex(slotName); - var slotEntry = skinMap[slotName]; - for (var attachmentName in slotEntry) { - if (!slotEntry.hasOwnProperty(attachmentName)) continue; - var attachment = this.readAttachment(skin, attachmentName, slotEntry[attachmentName]); - if (attachment) skin.addAttachment(slotIndex, attachmentName, attachment); - } - } - skeletonData.skins.push(skin); - if (skin.name == "default") skeletonData.defaultSkin = skin; - } - - // Events. - var events = root["events"]; - for (var eventName in events) { - if (!events.hasOwnProperty(eventName)) continue; - var eventMap = events[eventName]; - var eventData = new spine.EventData(eventName); - eventData.intValue = eventMap["int"] || 0; - eventData.floatValue = eventMap["float"] || 0; - eventData.stringValue = eventMap["string"] || null; - skeletonData.events.push(eventData); - } - - // Animations. - var animations = root["animations"]; - for (var animationName in animations) { - if (!animations.hasOwnProperty(animationName)) continue; - this.readAnimation(animationName, animations[animationName], skeletonData); - } - - return skeletonData; - }, - readAttachment: function (skin, name, map) { - name = map["name"] || name; - - var type = spine.AttachmentType[map["type"] || "region"]; - var path = map["path"] || name; - - var scale = this.scale; - if (type == spine.AttachmentType.region) { - var region = this.attachmentLoader.newRegionAttachment(skin, name, path); - if (!region) return null; - region.path = path; - region.x = (map["x"] || 0) * scale; - region.y = (map["y"] || 0) * scale; - region.scaleX = map.hasOwnProperty("scaleX") ? map["scaleX"] : 1; - region.scaleY = map.hasOwnProperty("scaleY") ? map["scaleY"] : 1; - region.rotation = map["rotation"] || 0; - region.width = (map["width"] || 0) * scale; - region.height = (map["height"] || 0) * scale; - - var color = map["color"]; - if (color) { - region.r = this.toColor(color, 0); - region.g = this.toColor(color, 1); - region.b = this.toColor(color, 2); - region.a = this.toColor(color, 3); - } - - region.updateOffset(); - return region; - } else if (type == spine.AttachmentType.mesh) { - var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path); - if (!mesh) return null; - mesh.path = path; - mesh.vertices = this.getFloatArray(map, "vertices", scale); - mesh.triangles = this.getIntArray(map, "triangles"); - mesh.regionUVs = this.getFloatArray(map, "uvs", 1); - mesh.updateUVs(); - - color = map["color"]; - if (color) { - mesh.r = this.toColor(color, 0); - mesh.g = this.toColor(color, 1); - mesh.b = this.toColor(color, 2); - mesh.a = this.toColor(color, 3); - } - - mesh.hullLength = (map["hull"] || 0) * 2; - if (map["edges"]) mesh.edges = this.getIntArray(map, "edges"); - mesh.width = (map["width"] || 0) * scale; - mesh.height = (map["height"] || 0) * scale; - return mesh; - } else if (type == spine.AttachmentType.skinnedmesh) { - var mesh = this.attachmentLoader.newSkinnedMeshAttachment(skin, name, path); - if (!mesh) return null; - mesh.path = path; - - var uvs = this.getFloatArray(map, "uvs", 1); - var vertices = this.getFloatArray(map, "vertices", 1); - var weights = []; - var bones = []; - for (var i = 0, n = vertices.length; i < n; ) { - var boneCount = vertices[i++] | 0; - bones[bones.length] = boneCount; - for (var nn = i + boneCount * 4; i < nn; ) { - bones[bones.length] = vertices[i]; - weights[weights.length] = vertices[i + 1] * scale; - weights[weights.length] = vertices[i + 2] * scale; - weights[weights.length] = vertices[i + 3]; - i += 4; - } - } - mesh.bones = bones; - mesh.weights = weights; - mesh.triangles = this.getIntArray(map, "triangles"); - mesh.regionUVs = uvs; - mesh.updateUVs(); - - color = map["color"]; - if (color) { - mesh.r = this.toColor(color, 0); - mesh.g = this.toColor(color, 1); - mesh.b = this.toColor(color, 2); - mesh.a = this.toColor(color, 3); - } - - mesh.hullLength = (map["hull"] || 0) * 2; - if (map["edges"]) mesh.edges = this.getIntArray(map, "edges"); - mesh.width = (map["width"] || 0) * scale; - mesh.height = (map["height"] || 0) * scale; - return mesh; - } else if (type == spine.AttachmentType.boundingbox) { - var attachment = this.attachmentLoader.newBoundingBoxAttachment(skin, name); - var vertices = map["vertices"]; - for (var i = 0, n = vertices.length; i < n; i++) - attachment.vertices.push(vertices[i] * scale); - return attachment; - } - throw "Unknown attachment type: " + type; - }, - readAnimation: function (name, map, skeletonData) { - var timelines = []; - var duration = 0; - - var slots = map["slots"]; - for (var slotName in slots) { - if (!slots.hasOwnProperty(slotName)) continue; - var slotMap = slots[slotName]; - var slotIndex = skeletonData.findSlotIndex(slotName); - - for (var timelineName in slotMap) { - if (!slotMap.hasOwnProperty(timelineName)) continue; - var values = slotMap[timelineName]; - if (timelineName == "color") { - var timeline = new spine.ColorTimeline(values.length); - timeline.slotIndex = slotIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var color = valueMap["color"]; - var r = this.toColor(color, 0); - var g = this.toColor(color, 1); - var b = this.toColor(color, 2); - var a = this.toColor(color, 3); - timeline.setFrame(frameIndex, valueMap["time"], r, g, b, a); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 5 - 5]); - - } else if (timelineName == "attachment") { - var timeline = new spine.AttachmentTimeline(values.length); - timeline.slotIndex = slotIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex++, valueMap["time"], valueMap["name"]); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - - } else - throw "Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")"; - } - } - - var bones = map["bones"]; - for (var boneName in bones) { - if (!bones.hasOwnProperty(boneName)) continue; - var boneIndex = skeletonData.findBoneIndex(boneName); - if (boneIndex == -1) throw "Bone not found: " + boneName; - var boneMap = bones[boneName]; - - for (var timelineName in boneMap) { - if (!boneMap.hasOwnProperty(timelineName)) continue; - var values = boneMap[timelineName]; - if (timelineName == "rotate") { - var timeline = new spine.RotateTimeline(values.length); - timeline.boneIndex = boneIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex, valueMap["time"], valueMap["angle"]); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 2 - 2]); - - } else if (timelineName == "translate" || timelineName == "scale") { - var timeline; - var timelineScale = 1; - if (timelineName == "scale") - timeline = new spine.ScaleTimeline(values.length); - else { - timeline = new spine.TranslateTimeline(values.length); - timelineScale = this.scale; - } - timeline.boneIndex = boneIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var x = (valueMap["x"] || 0) * timelineScale; - var y = (valueMap["y"] || 0) * timelineScale; - timeline.setFrame(frameIndex, valueMap["time"], x, y); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 3 - 3]); - - } else if (timelineName == "flipX" || timelineName == "flipY") { - var x = timelineName == "flipX"; - var timeline = x ? new spine.FlipXTimeline(values.length) : new spine.FlipYTimeline(values.length); - timeline.boneIndex = boneIndex; - - var field = x ? "x" : "y"; - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex, valueMap["time"], valueMap[field] || false); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 2 - 2]); - } else - throw "Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")"; - } - } - - var ikMap = map["ik"]; - for (var ikConstraintName in ikMap) { - if (!ikMap.hasOwnProperty(ikConstraintName)) continue; - var ikConstraint = skeletonData.findIkConstraint(ikConstraintName); - var values = ikMap[ikConstraintName]; - var timeline = new spine.IkConstraintTimeline(values.length); - timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(ikConstraint); - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var mix = valueMap.hasOwnProperty("mix") ? valueMap["mix"] : 1; - var bendDirection = (!valueMap.hasOwnProperty("bendPositive") || valueMap["bendPositive"]) ? 1 : -1; - timeline.setFrame(frameIndex, valueMap["time"], mix, bendDirection); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.frameCount * 3 - 3]); - } - - var ffd = map["ffd"]; - for (var skinName in ffd) { - var skin = skeletonData.findSkin(skinName); - var slotMap = ffd[skinName]; - for (slotName in slotMap) { - var slotIndex = skeletonData.findSlotIndex(slotName); - var meshMap = slotMap[slotName]; - for (var meshName in meshMap) { - var values = meshMap[meshName]; - var timeline = new spine.FfdTimeline(values.length); - var attachment = skin.getAttachment(slotIndex, meshName); - if (!attachment) throw "FFD attachment not found: " + meshName; - timeline.slotIndex = slotIndex; - timeline.attachment = attachment; - - var isMesh = attachment.type == spine.AttachmentType.mesh; - var vertexCount; - if (isMesh) - vertexCount = attachment.vertices.length; - else - vertexCount = attachment.weights.length / 3 * 2; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var vertices; - if (!valueMap["vertices"]) { - if (isMesh) - vertices = attachment.vertices; - else { - vertices = []; - vertices.length = vertexCount; - } - } else { - var verticesValue = valueMap["vertices"]; - var vertices = []; - vertices.length = vertexCount; - var start = valueMap["offset"] || 0; - var nn = verticesValue.length; - if (this.scale == 1) { - for (var ii = 0; ii < nn; ii++) - vertices[ii + start] = verticesValue[ii]; - } else { - for (var ii = 0; ii < nn; ii++) - vertices[ii + start] = verticesValue[ii] * this.scale; - } - if (isMesh) { - var meshVertices = attachment.vertices; - for (var ii = 0, nn = vertices.length; ii < nn; ii++) - vertices[ii] += meshVertices[ii]; - } - } - - timeline.setFrame(frameIndex, valueMap["time"], vertices); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines[timelines.length] = timeline; - duration = Math.max(duration, timeline.frames[timeline.frameCount - 1]); - } - } - } - - var drawOrderValues = map["drawOrder"]; - if (!drawOrderValues) drawOrderValues = map["draworder"]; - if (drawOrderValues) { - var timeline = new spine.DrawOrderTimeline(drawOrderValues.length); - var slotCount = skeletonData.slots.length; - var frameIndex = 0; - for (var i = 0, n = drawOrderValues.length; i < n; i++) { - var drawOrderMap = drawOrderValues[i]; - var drawOrder = null; - if (drawOrderMap["offsets"]) { - drawOrder = []; - drawOrder.length = slotCount; - for (var ii = slotCount - 1; ii >= 0; ii--) - drawOrder[ii] = -1; - var offsets = drawOrderMap["offsets"]; - var unchanged = []; - unchanged.length = slotCount - offsets.length; - var originalIndex = 0, unchangedIndex = 0; - for (var ii = 0, nn = offsets.length; ii < nn; ii++) { - var offsetMap = offsets[ii]; - var slotIndex = skeletonData.findSlotIndex(offsetMap["slot"]); - if (slotIndex == -1) throw "Slot not found: " + offsetMap["slot"]; - // Collect unchanged items. - while (originalIndex != slotIndex) - unchanged[unchangedIndex++] = originalIndex++; - // Set changed items. - drawOrder[originalIndex + offsetMap["offset"]] = originalIndex++; - } - // Collect remaining unchanged items. - while (originalIndex < slotCount) - unchanged[unchangedIndex++] = originalIndex++; - // Fill in unchanged items. - for (var ii = slotCount - 1; ii >= 0; ii--) - if (drawOrder[ii] == -1) drawOrder[ii] = unchanged[--unchangedIndex]; - } - timeline.setFrame(frameIndex++, drawOrderMap["time"], drawOrder); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - - var events = map["events"]; - if (events) { - var timeline = new spine.EventTimeline(events.length); - var frameIndex = 0; - for (var i = 0, n = events.length; i < n; i++) { - var eventMap = events[i]; - var eventData = skeletonData.findEvent(eventMap["name"]); - if (!eventData) throw "Event not found: " + eventMap["name"]; - var event = new spine.Event(eventData); - event.intValue = eventMap.hasOwnProperty("int") ? eventMap["int"] : eventData.intValue; - event.floatValue = eventMap.hasOwnProperty("float") ? eventMap["float"] : eventData.floatValue; - event.stringValue = eventMap.hasOwnProperty("string") ? eventMap["string"] : eventData.stringValue; - timeline.setFrame(frameIndex++, eventMap["time"], event); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - - skeletonData.animations.push(new spine.Animation(name, timelines, duration)); - }, - readCurve: function (timeline, frameIndex, valueMap) { - var curve = valueMap["curve"]; - if (!curve) - timeline.curves.setLinear(frameIndex); - else if (curve == "stepped") - timeline.curves.setStepped(frameIndex); - else if (curve instanceof Array) - timeline.curves.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]); - }, - toColor: function (hexString, colorIndex) { - if (hexString.length != 8) throw "Color hexidecimal length must be 8, recieved: " + hexString; - return parseInt(hexString.substring(colorIndex * 2, (colorIndex * 2) + 2), 16) / 255; - }, - getFloatArray: function (map, name, scale) { - var list = map[name]; - var values = new spine.Float32Array(list.length); - var i = 0, n = list.length; - if (scale == 1) { - for (; i < n; i++) - values[i] = list[i]; - } else { - for (; i < n; i++) - values[i] = list[i] * scale; - } - return values; - }, - getIntArray: function (map, name) { - var list = map[name]; - var values = new spine.Uint16Array(list.length); - for (var i = 0, n = list.length; i < n; i++) - values[i] = list[i] | 0; - return values; - } -}; - -spine.Atlas = function (atlasText, textureLoader) { - this.textureLoader = textureLoader; - this.pages = []; - this.regions = []; - - var reader = new spine.AtlasReader(atlasText); - var tuple = []; - tuple.length = 4; - var page = null; - while (true) { - var line = reader.readLine(); - if (line === null) break; - line = reader.trim(line); - if (!line.length) - page = null; - else if (!page) { - page = new spine.AtlasPage(); - page.name = line; - - if (reader.readTuple(tuple) == 2) { // size is only optional for an atlas packed with an old TexturePacker. - page.width = parseInt(tuple[0]); - page.height = parseInt(tuple[1]); - reader.readTuple(tuple); - } - page.format = spine.Atlas.Format[tuple[0]]; - - reader.readTuple(tuple); - page.minFilter = spine.Atlas.TextureFilter[tuple[0]]; - page.magFilter = spine.Atlas.TextureFilter[tuple[1]]; - - var direction = reader.readValue(); - page.uWrap = spine.Atlas.TextureWrap.clampToEdge; - page.vWrap = spine.Atlas.TextureWrap.clampToEdge; - if (direction == "x") - page.uWrap = spine.Atlas.TextureWrap.repeat; - else if (direction == "y") - page.vWrap = spine.Atlas.TextureWrap.repeat; - else if (direction == "xy") - page.uWrap = page.vWrap = spine.Atlas.TextureWrap.repeat; - - textureLoader.load(page, line, this); - - this.pages.push(page); - - } else { - var region = new spine.AtlasRegion(); - region.name = line; - region.page = page; - - region.rotate = reader.readValue() == "true"; - - reader.readTuple(tuple); - var x = parseInt(tuple[0]); - var y = parseInt(tuple[1]); - - reader.readTuple(tuple); - var width = parseInt(tuple[0]); - var height = parseInt(tuple[1]); - - region.u = x / page.width; - region.v = y / page.height; - if (region.rotate) { - region.u2 = (x + height) / page.width; - region.v2 = (y + width) / page.height; - } else { - region.u2 = (x + width) / page.width; - region.v2 = (y + height) / page.height; - } - region.x = x; - region.y = y; - region.width = Math.abs(width); - region.height = Math.abs(height); - - if (reader.readTuple(tuple) == 4) { // split is optional - region.splits = [parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3])]; - - if (reader.readTuple(tuple) == 4) { // pad is optional, but only present with splits - region.pads = [parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3])]; - - reader.readTuple(tuple); - } - } - - region.originalWidth = parseInt(tuple[0]); - region.originalHeight = parseInt(tuple[1]); - - reader.readTuple(tuple); - region.offsetX = parseInt(tuple[0]); - region.offsetY = parseInt(tuple[1]); - - region.index = parseInt(reader.readValue()); - - this.regions.push(region); - } - } -}; -spine.Atlas.prototype = { - findRegion: function (name) { - var regions = this.regions; - for (var i = 0, n = regions.length; i < n; i++) - if (regions[i].name == name) return regions[i]; - return null; - }, - dispose: function () { - var pages = this.pages; - for (var i = 0, n = pages.length; i < n; i++) - this.textureLoader.unload(pages[i].rendererObject); - }, - updateUVs: function (page) { - var regions = this.regions; - for (var i = 0, n = regions.length; i < n; i++) { - var region = regions[i]; - if (region.page != page) continue; - region.u = region.x / page.width; - region.v = region.y / page.height; - if (region.rotate) { - region.u2 = (region.x + region.height) / page.width; - region.v2 = (region.y + region.width) / page.height; - } else { - region.u2 = (region.x + region.width) / page.width; - region.v2 = (region.y + region.height) / page.height; - } - } - } -}; - -spine.Atlas.Format = { - alpha: 0, - intensity: 1, - luminanceAlpha: 2, - rgb565: 3, - rgba4444: 4, - rgb888: 5, - rgba8888: 6 -}; - -spine.Atlas.TextureFilter = { - nearest: 0, - linear: 1, - mipMap: 2, - mipMapNearestNearest: 3, - mipMapLinearNearest: 4, - mipMapNearestLinear: 5, - mipMapLinearLinear: 6 -}; - -spine.Atlas.TextureWrap = { - mirroredRepeat: 0, - clampToEdge: 1, - repeat: 2 -}; - -spine.AtlasPage = function () {}; -spine.AtlasPage.prototype = { - name: null, - format: null, - minFilter: null, - magFilter: null, - uWrap: null, - vWrap: null, - rendererObject: null, - width: 0, - height: 0 -}; - -spine.AtlasRegion = function () {}; -spine.AtlasRegion.prototype = { - page: null, - name: null, - x: 0, y: 0, - width: 0, height: 0, - u: 0, v: 0, u2: 0, v2: 0, - offsetX: 0, offsetY: 0, - originalWidth: 0, originalHeight: 0, - index: 0, - rotate: false, - splits: null, - pads: null -}; - -spine.AtlasReader = function (text) { - this.lines = text.split(/\r\n|\r|\n/); -}; -spine.AtlasReader.prototype = { - index: 0, - trim: function (value) { - return value.replace(/^\s+|\s+$/g, ""); - }, - readLine: function () { - if (this.index >= this.lines.length) return null; - return this.lines[this.index++]; - }, - readValue: function () { - var line = this.readLine(); - var colon = line.indexOf(":"); - if (colon == -1) throw "Invalid line: " + line; - return this.trim(line.substring(colon + 1)); - }, - /** Returns the number of tuple values read (1, 2 or 4). */ - readTuple: function (tuple) { - var line = this.readLine(); - var colon = line.indexOf(":"); - if (colon == -1) throw "Invalid line: " + line; - var i = 0, lastMatch = colon + 1; - for (; i < 3; i++) { - var comma = line.indexOf(",", lastMatch); - if (comma == -1) break; - tuple[i] = this.trim(line.substr(lastMatch, comma - lastMatch)); - lastMatch = comma + 1; - } - tuple[i] = this.trim(line.substring(lastMatch)); - return i + 1; - } -}; - -spine.AtlasAttachmentLoader = function (atlas) { - this.atlas = atlas; -}; -spine.AtlasAttachmentLoader.prototype = { - newRegionAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (region attachment: " + name + ")"; - var attachment = new spine.RegionAttachment(name); - attachment.rendererObject = region; - attachment.setUVs(region.u, region.v, region.u2, region.v2, region.rotate); - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newMeshAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (mesh attachment: " + name + ")"; - var attachment = new spine.MeshAttachment(name); - attachment.rendererObject = region; - attachment.regionU = region.u; - attachment.regionV = region.v; - attachment.regionU2 = region.u2; - attachment.regionV2 = region.v2; - attachment.regionRotate = region.rotate; - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newSkinnedMeshAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (skinned mesh attachment: " + name + ")"; - var attachment = new spine.SkinnedMeshAttachment(name); - attachment.rendererObject = region; - attachment.regionU = region.u; - attachment.regionV = region.v; - attachment.regionU2 = region.u2; - attachment.regionV2 = region.v2; - attachment.regionRotate = region.rotate; - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newBoundingBoxAttachment: function (skin, name) { - return new spine.BoundingBoxAttachment(name); - } -}; - -spine.SkeletonBounds = function () { - this.polygonPool = []; - this.polygons = []; - this.boundingBoxes = []; -}; -spine.SkeletonBounds.prototype = { - minX: 0, minY: 0, maxX: 0, maxY: 0, - update: function (skeleton, updateAabb) { - var slots = skeleton.slots; - var slotCount = slots.length; - var x = skeleton.x, y = skeleton.y; - var boundingBoxes = this.boundingBoxes; - var polygonPool = this.polygonPool; - var polygons = this.polygons; - - boundingBoxes.length = 0; - for (var i = 0, n = polygons.length; i < n; i++) - polygonPool.push(polygons[i]); - polygons.length = 0; - - for (var i = 0; i < slotCount; i++) { - var slot = slots[i]; - var boundingBox = slot.attachment; - if (boundingBox.type != spine.AttachmentType.boundingbox) continue; - boundingBoxes.push(boundingBox); - - var poolCount = polygonPool.length, polygon; - if (poolCount > 0) { - polygon = polygonPool[poolCount - 1]; - polygonPool.splice(poolCount - 1, 1); - } else - polygon = []; - polygons.push(polygon); - - polygon.length = boundingBox.vertices.length; - boundingBox.computeWorldVertices(x, y, slot.bone, polygon); - } - - if (updateAabb) this.aabbCompute(); - }, - aabbCompute: function () { - var polygons = this.polygons; - var minX = Number.MAX_VALUE, minY = Number.MAX_VALUE, maxX = Number.MIN_VALUE, maxY = Number.MIN_VALUE; - for (var i = 0, n = polygons.length; i < n; i++) { - var vertices = polygons[i]; - for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) { - var x = vertices[ii]; - var y = vertices[ii + 1]; - minX = Math.min(minX, x); - minY = Math.min(minY, y); - maxX = Math.max(maxX, x); - maxY = Math.max(maxY, y); - } - } - this.minX = minX; - this.minY = minY; - this.maxX = maxX; - this.maxY = maxY; - }, - /** Returns true if the axis aligned bounding box contains the point. */ - aabbContainsPoint: function (x, y) { - return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY; - }, - /** Returns true if the axis aligned bounding box intersects the line segment. */ - aabbIntersectsSegment: function (x1, y1, x2, y2) { - var minX = this.minX, minY = this.minY, maxX = this.maxX, maxY = this.maxY; - if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY)) - return false; - var m = (y2 - y1) / (x2 - x1); - var y = m * (minX - x1) + y1; - if (y > minY && y < maxY) return true; - y = m * (maxX - x1) + y1; - if (y > minY && y < maxY) return true; - var x = (minY - y1) / m + x1; - if (x > minX && x < maxX) return true; - x = (maxY - y1) / m + x1; - if (x > minX && x < maxX) return true; - return false; - }, - /** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */ - aabbIntersectsSkeleton: function (bounds) { - return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY; - }, - /** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more - * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */ - containsPoint: function (x, y) { - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) - if (this.polygonContainsPoint(polygons[i], x, y)) return this.boundingBoxes[i]; - return null; - }, - /** Returns the first bounding box attachment that contains the line segment, or null. When doing many checks, it is usually - * more efficient to only call this method if {@link #aabbIntersectsSegment(float, float, float, float)} returns true. */ - intersectsSegment: function (x1, y1, x2, y2) { - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) - if (polygons[i].intersectsSegment(x1, y1, x2, y2)) return this.boundingBoxes[i]; - return null; - }, - /** Returns true if the polygon contains the point. */ - polygonContainsPoint: function (polygon, x, y) { - var nn = polygon.length; - var prevIndex = nn - 2; - var inside = false; - for (var ii = 0; ii < nn; ii += 2) { - var vertexY = polygon[ii + 1]; - var prevY = polygon[prevIndex + 1]; - if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) { - var vertexX = polygon[ii]; - if (vertexX + (y - vertexY) / (prevY - vertexY) * (polygon[prevIndex] - vertexX) < x) inside = !inside; - } - prevIndex = ii; - } - return inside; - }, - /** Returns true if the polygon contains the line segment. */ - polygonIntersectsSegment: function (polygon, x1, y1, x2, y2) { - var nn = polygon.length; - var width12 = x1 - x2, height12 = y1 - y2; - var det1 = x1 * y2 - y1 * x2; - var x3 = polygon[nn - 2], y3 = polygon[nn - 1]; - for (var ii = 0; ii < nn; ii += 2) { - var x4 = polygon[ii], y4 = polygon[ii + 1]; - var det2 = x3 * y4 - y3 * x4; - var width34 = x3 - x4, height34 = y3 - y4; - var det3 = width12 * height34 - height12 * width34; - var x = (det1 * width34 - width12 * det2) / det3; - if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) { - var y = (det1 * height34 - height12 * det2) / det3; - if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) return true; - } - x3 = x4; - y3 = y4; - } - return false; - }, - getPolygon: function (attachment) { - var index = this.boundingBoxes.indexOf(attachment); - return index == -1 ? null : this.polygons[index]; - }, - getWidth: function () { - return this.maxX - this.minX; - }, - getHeight: function () { - return this.maxY - this.minY; - } -}; - -/* Esoteric Software SPINE wrapper for pixi.js */ - -spine.Bone.yDown = true; -PIXI.AnimCache = {}; - -/** - * Supporting class to load images from spine atlases as per spine spec. - * - * @class SpineTextureLoader - * @uses EventTarget - * @constructor - * @param basePath {String} Tha base path where to look for the images to be loaded - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.SpineTextureLoader = function(basePath, crossorigin) -{ - PIXI.EventTarget.call(this); - - this.basePath = basePath; - this.crossorigin = crossorigin; - this.loadingCount = 0; -}; - -/* constructor */ -PIXI.SpineTextureLoader.prototype = PIXI.SpineTextureLoader; - -/** - * Starts loading a base texture as per spine specification - * - * @method load - * @param page {spine.AtlasPage} Atlas page to which texture belongs - * @param file {String} The file to load, this is just the file path relative to the base path configured in the constructor - */ -PIXI.SpineTextureLoader.prototype.load = function(page, file) -{ - page.rendererObject = PIXI.BaseTexture.fromImage(this.basePath + '/' + file, this.crossorigin); - if (!page.rendererObject.hasLoaded) - { - var scope = this; - ++scope.loadingCount; - page.rendererObject.addEventListener('loaded', function(){ - --scope.loadingCount; - scope.dispatchEvent({ - type: 'loadedBaseTexture', - content: scope - }); - }); - } -}; - -/** - * Unloads a previously loaded texture as per spine specification - * - * @method unload - * @param texture {BaseTexture} Texture object to destroy - */ -PIXI.SpineTextureLoader.prototype.unload = function(texture) -{ - texture.destroy(true); -}; - -/** - * A class that enables the you to import and run your spine animations in pixi. - * Spine animation data needs to be loaded using the PIXI.AssetLoader or PIXI.SpineLoader before it can be used by this class - * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source - * - * @class Spine - * @extends DisplayObjectContainer - * @constructor - * @param url {String} The url of the spine anim file to be used - */ -PIXI.Spine = function (url) { - PIXI.DisplayObjectContainer.call(this); - - this.spineData = PIXI.AnimCache[url]; - - if (!this.spineData) { - throw new Error('Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: ' + url); - } - - this.skeleton = new spine.Skeleton(this.spineData); - this.skeleton.updateWorldTransform(); - - this.stateData = new spine.AnimationStateData(this.spineData); - this.state = new spine.AnimationState(this.stateData); - - this.slotContainers = []; - - for (var i = 0, n = this.skeleton.drawOrder.length; i < n; i++) { - var slot = this.skeleton.drawOrder[i]; - var attachment = slot.attachment; - var slotContainer = new PIXI.DisplayObjectContainer(); - this.slotContainers.push(slotContainer); - this.addChild(slotContainer); - - if (attachment instanceof spine.RegionAttachment) - { - var spriteName = attachment.rendererObject.name; - var sprite = this.createSprite(slot, attachment); - slot.currentSprite = sprite; - slot.currentSpriteName = spriteName; - slotContainer.addChild(sprite); - } - else if (attachment instanceof spine.MeshAttachment) - { - var mesh = this.createMesh(slot, attachment); - slot.currentMesh = mesh; - slot.currentMeshName = attachment.name; - slotContainer.addChild(mesh); - } - else - { - continue; - } - - } - - this.autoUpdate = true; -}; - -PIXI.Spine.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); -PIXI.Spine.prototype.constructor = PIXI.Spine; - -/** - * If this flag is set to true, the spine animation will be autoupdated every time - * the object id drawn. The down side of this approach is that the delta time is - * automatically calculated and you could miss out on cool effects like slow motion, - * pause, skip ahead and the sorts. Most of these effects can be achieved even with - * autoupdate enabled but are harder to achieve. - * - * @property autoUpdate - * @type { Boolean } - * @default true - */ -Object.defineProperty(PIXI.Spine.prototype, 'autoUpdate', { - get: function() - { - return (this.updateTransform === PIXI.Spine.prototype.autoUpdateTransform); - }, - - set: function(value) - { - this.updateTransform = value ? PIXI.Spine.prototype.autoUpdateTransform : PIXI.DisplayObjectContainer.prototype.updateTransform; - } -}); - -/** - * Update the spine skeleton and its animations by delta time (dt) - * - * @method update - * @param dt {Number} Delta time. Time by which the animation should be updated - */ -PIXI.Spine.prototype.update = function(dt) -{ - this.state.update(dt); - this.state.apply(this.skeleton); - this.skeleton.updateWorldTransform(); - - var drawOrder = this.skeleton.drawOrder; - for (var i = 0, n = drawOrder.length; i < n; i++) { - var slot = drawOrder[i]; - var attachment = slot.attachment; - var slotContainer = this.slotContainers[i]; - - if (!attachment) - { - slotContainer.visible = false; - continue; - } - - var type = attachment.type; - if (type === spine.AttachmentType.region) - { - if (attachment.rendererObject) - { - if (!slot.currentSpriteName || slot.currentSpriteName !== attachment.name) - { - var spriteName = attachment.rendererObject.name; - if (slot.currentSprite !== undefined) - { - slot.currentSprite.visible = false; - } - slot.sprites = slot.sprites || {}; - if (slot.sprites[spriteName] !== undefined) - { - slot.sprites[spriteName].visible = true; - } - else - { - var sprite = this.createSprite(slot, attachment); - slotContainer.addChild(sprite); - } - slot.currentSprite = slot.sprites[spriteName]; - slot.currentSpriteName = spriteName; - } - } - - var bone = slot.bone; - - slotContainer.position.x = bone.worldX + attachment.x * bone.m00 + attachment.y * bone.m01; - slotContainer.position.y = bone.worldY + attachment.x * bone.m10 + attachment.y * bone.m11; - slotContainer.scale.x = bone.worldScaleX; - slotContainer.scale.y = bone.worldScaleY; - - slotContainer.rotation = -(slot.bone.worldRotation * spine.degRad); - - slot.currentSprite.tint = PIXI.rgb2hex([slot.r,slot.g,slot.b]); - } - else if (type === spine.AttachmentType.skinnedmesh) - { - if (!slot.currentMeshName || slot.currentMeshName !== attachment.name) - { - var meshName = attachment.name; - if (slot.currentMesh !== undefined) - { - slot.currentMesh.visible = false; - } - - slot.meshes = slot.meshes || {}; - - if (slot.meshes[meshName] !== undefined) - { - slot.meshes[meshName].visible = true; - } - else - { - var mesh = this.createMesh(slot, attachment); - slotContainer.addChild(mesh); - } - - slot.currentMesh = slot.meshes[meshName]; - slot.currentMeshName = meshName; - } - - attachment.computeWorldVertices(slot.bone.skeleton.x, slot.bone.skeleton.y, slot, slot.currentMesh.vertices); - - } - else - { - slotContainer.visible = false; - continue; - } - slotContainer.visible = true; - - slotContainer.alpha = slot.a; - } -}; - -/** - * When autoupdate is set to yes this function is used as pixi's updateTransform function - * - * @method autoUpdateTransform - * @private - */ -PIXI.Spine.prototype.autoUpdateTransform = function () { - this.lastTime = this.lastTime || Date.now(); - var timeDelta = (Date.now() - this.lastTime) * 0.001; - this.lastTime = Date.now(); - - this.update(timeDelta); - - PIXI.DisplayObjectContainer.prototype.updateTransform.call(this); -}; - -/** - * Create a new sprite to be used with spine.RegionAttachment - * - * @method createSprite - * @param slot {spine.Slot} The slot to which the attachment is parented - * @param attachment {spine.RegionAttachment} The attachment that the sprite will represent - * @private - */ -PIXI.Spine.prototype.createSprite = function (slot, attachment) { - var descriptor = attachment.rendererObject; - var baseTexture = descriptor.page.rendererObject; - var spriteRect = new PIXI.Rectangle(descriptor.x, - descriptor.y, - descriptor.rotate ? descriptor.height : descriptor.width, - descriptor.rotate ? descriptor.width : descriptor.height); - var spriteTexture = new PIXI.Texture(baseTexture, spriteRect); - var sprite = new PIXI.Sprite(spriteTexture); - - var baseRotation = descriptor.rotate ? Math.PI * 0.5 : 0.0; - sprite.scale.set(descriptor.width / descriptor.originalWidth, descriptor.height / descriptor.originalHeight); - sprite.rotation = baseRotation - (attachment.rotation * spine.degRad); - sprite.anchor.x = sprite.anchor.y = 0.5; - - slot.sprites = slot.sprites || {}; - slot.sprites[descriptor.name] = sprite; - return sprite; -}; - -PIXI.Spine.prototype.createMesh = function (slot, attachment) { - var descriptor = attachment.rendererObject; - var baseTexture = descriptor.page.rendererObject; - var texture = new PIXI.Texture(baseTexture); - - var strip = new PIXI.Strip(texture); - strip.drawMode = PIXI.Strip.DrawModes.TRIANGLES; - strip.canvasPadding = 1.5; - - strip.vertices = new PIXI.Float32Array(attachment.uvs.length); - strip.uvs = attachment.uvs; - strip.indices = attachment.triangles; - - slot.meshes = slot.meshes || {}; - slot.meshes[attachment.name] = strip; - - return strip; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -PIXI.BaseTextureCache = {}; - -PIXI.BaseTextureCacheIdGenerator = 0; - -/** - * A texture stores the information that represents an image. All textures have a base texture. - * - * @class BaseTexture - * @uses EventTarget - * @constructor - * @param source {String} the source object (image or canvas) - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - */ -PIXI.BaseTexture = function(source, scaleMode) -{ - /** - * The Resolution of the texture. - * - * @property resolution - * @type Number - */ - this.resolution = 1; - - /** - * [read-only] The width of the base texture set when the image has loaded - * - * @property width - * @type Number - * @readOnly - */ - this.width = 100; - - /** - * [read-only] The height of the base texture set when the image has loaded - * - * @property height - * @type Number - * @readOnly - */ - this.height = 100; - - /** - * The scale mode to apply when scaling this texture - * - * @property scaleMode - * @type {Number} - * @default PIXI.scaleModes.LINEAR - */ - this.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - /** - * [read-only] Set to true once the base texture has loaded - * - * @property hasLoaded - * @type Boolean - * @readOnly - */ - this.hasLoaded = false; - - /** - * The image source that is used to create the texture. - * - * @property source - * @type Image - */ - this.source = source; - - this._UID = PIXI._UID++; - - /** - * Controls if RGB channels should be pre-multiplied by Alpha (WebGL only) - * - * @property premultipliedAlpha - * @type Boolean - * @default true - */ - this.premultipliedAlpha = true; - - // used for webGL - - /** - * @property _glTextures - * @type Array - * @private - */ - this._glTextures = []; - - /** - * - * Set this to true if a mipmap of this texture needs to be generated. This value needs to be set before the texture is used - * Also the texture must be a power of two size to work - * - * @property mipmap - * @type {Boolean} - */ - this.mipmap = false; - - // used for webGL texture updating... - // TODO - this needs to be addressed - - /** - * @property _dirty - * @type Array - * @private - */ - this._dirty = [true, true, true, true]; - - if(!source)return; - - if((this.source.complete || this.source.getContext) && this.source.width && this.source.height) - { - this.hasLoaded = true; - this.width = this.source.naturalWidth || this.source.width; - this.height = this.source.naturalHeight || this.source.height; - this.dirty(); - } - else - { - var scope = this; - - this.source.onload = function() { - - scope.hasLoaded = true; - scope.width = scope.source.naturalWidth || scope.source.width; - scope.height = scope.source.naturalHeight || scope.source.height; - - scope.dirty(); - - // add it to somewhere... - scope.dispatchEvent( { type: 'loaded', content: scope } ); - }; - - this.source.onerror = function() { - scope.dispatchEvent( { type: 'error', content: scope } ); - }; - } - - /** - * @property imageUrl - * @type String - */ - this.imageUrl = null; - - /** - * @property _powerOf2 - * @type Boolean - * @private - */ - this._powerOf2 = false; - -}; - -PIXI.BaseTexture.prototype.constructor = PIXI.BaseTexture; - -PIXI.EventTarget.mixin(PIXI.BaseTexture.prototype); - -/** - * Destroys this base texture - * - * @method destroy - */ -PIXI.BaseTexture.prototype.destroy = function() -{ - if(this.imageUrl) - { - delete PIXI.BaseTextureCache[this.imageUrl]; - delete PIXI.TextureCache[this.imageUrl]; - this.imageUrl = null; - if (!navigator.isCocoonJS) this.source.src = ''; - } - else if (this.source && this.source._pixiId) - { - delete PIXI.BaseTextureCache[this.source._pixiId]; - } - this.source = null; - - this.unloadFromGPU(); -}; - -/** - * Changes the source image of the texture - * - * @method updateSourceImage - * @param newSrc {String} the path of the image - */ -PIXI.BaseTexture.prototype.updateSourceImage = function(newSrc) -{ - this.hasLoaded = false; - this.source.src = null; - this.source.src = newSrc; -}; - -/** - * Sets all glTextures to be dirty. - * - * @method dirty - */ -PIXI.BaseTexture.prototype.dirty = function() -{ - for (var i = 0; i < this._glTextures.length; i++) - { - this._dirty[i] = true; - } -}; - -/** - * Removes the base texture from the GPU, useful for managing resources on the GPU. - * Atexture is still 100% usable and will simply be reuploaded if there is a sprite on screen that is using it. - * - * @method unloadFromGPU - */ -PIXI.BaseTexture.prototype.unloadFromGPU = function() -{ - this.dirty(); - - // delete the webGL textures if any. - for (var i = this._glTextures.length - 1; i >= 0; i--) - { - var glTexture = this._glTextures[i]; - var gl = PIXI.glContexts[i]; - - if(gl && glTexture) - { - gl.deleteTexture(glTexture); - } - - } - - this._glTextures.length = 0; - - this.dirty(); -}; - -/** - * Helper function that creates a base texture from the given image url. - * If the image is not in the base texture cache it will be created and loaded. - * - * @static - * @method fromImage - * @param imageUrl {String} The image url of the texture - * @param crossorigin {Boolean} - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return BaseTexture - */ -PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode) -{ - var baseTexture = PIXI.BaseTextureCache[imageUrl]; - - if(crossorigin === undefined && imageUrl.indexOf('data:') === -1) crossorigin = true; - - if(!baseTexture) - { - // new Image() breaks tex loading in some versions of Chrome. - // See https://code.google.com/p/chromium/issues/detail?id=238071 - var image = new Image();//document.createElement('img'); - if (crossorigin) - { - image.crossOrigin = ''; - } - - image.src = imageUrl; - baseTexture = new PIXI.BaseTexture(image, scaleMode); - baseTexture.imageUrl = imageUrl; - PIXI.BaseTextureCache[imageUrl] = baseTexture; - - // if there is an @2x at the end of the url we are going to assume its a highres image - if( imageUrl.indexOf(PIXI.RETINA_PREFIX + '.') !== -1) - { - baseTexture.resolution = 2; - } - } - - return baseTexture; -}; - -/** - * Helper function that creates a base texture from the given canvas element. - * - * @static - * @method fromCanvas - * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return BaseTexture - */ -PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode) -{ - if(!canvas._pixiId) - { - canvas._pixiId = 'canvas_' + PIXI.TextureCacheIdGenerator++; - } - - var baseTexture = PIXI.BaseTextureCache[canvas._pixiId]; - - if(!baseTexture) - { - baseTexture = new PIXI.BaseTexture(canvas, scaleMode); - PIXI.BaseTextureCache[canvas._pixiId] = baseTexture; - } - - return baseTexture; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -PIXI.TextureCache = {}; -PIXI.FrameCache = {}; - -PIXI.TextureCacheIdGenerator = 0; - -/** - * A texture stores the information that represents an image or part of an image. It cannot be added - * to the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used. - * - * @class Texture - * @uses EventTarget - * @constructor - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle - */ -PIXI.Texture = function(baseTexture, frame, crop, trim) -{ - /** - * Does this Texture have any frame data assigned to it? - * - * @property noFrame - * @type Boolean - */ - this.noFrame = false; - - if (!frame) - { - this.noFrame = true; - frame = new PIXI.Rectangle(0,0,1,1); - } - - if (baseTexture instanceof PIXI.Texture) - { - baseTexture = baseTexture.baseTexture; - } - - /** - * The base texture that this texture uses. - * - * @property baseTexture - * @type BaseTexture - */ - this.baseTexture = baseTexture; - - /** - * The frame specifies the region of the base texture that this texture uses - * - * @property frame - * @type Rectangle - */ - this.frame = frame; - - /** - * The texture trim data. - * - * @property trim - * @type Rectangle - */ - this.trim = trim; - - /** - * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. - * - * @property valid - * @type Boolean - */ - this.valid = false; - - /** - * This will let a renderer know that a texture has been updated (used mainly for webGL uv updates) - * - * @property requiresUpdate - * @type Boolean - */ - this.requiresUpdate = false; - - /** - * The WebGL UV data cache. - * - * @property _uvs - * @type Object - * @private - */ - this._uvs = null; - - /** - * The width of the Texture in pixels. - * - * @property width - * @type Number - */ - this.width = 0; - - /** - * The height of the Texture in pixels. - * - * @property height - * @type Number - */ - this.height = 0; - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @property crop - * @type Rectangle - */ - this.crop = crop || new PIXI.Rectangle(0, 0, 1, 1); - - if (baseTexture.hasLoaded) - { - if (this.noFrame) frame = new PIXI.Rectangle(0, 0, baseTexture.width, baseTexture.height); - this.setFrame(frame); - } - else - { - baseTexture.addEventListener('loaded', this.onBaseTextureLoaded.bind(this)); - } -}; - -PIXI.Texture.prototype.constructor = PIXI.Texture; -PIXI.EventTarget.mixin(PIXI.Texture.prototype); - -/** - * Called when the base texture is loaded - * - * @method onBaseTextureLoaded - * @private - */ -PIXI.Texture.prototype.onBaseTextureLoaded = function() -{ - var baseTexture = this.baseTexture; - baseTexture.removeEventListener('loaded', this.onLoaded); - - if (this.noFrame) this.frame = new PIXI.Rectangle(0, 0, baseTexture.width, baseTexture.height); - - this.setFrame(this.frame); - - this.dispatchEvent( { type: 'update', content: this } ); -}; - -/** - * Destroys this texture - * - * @method destroy - * @param destroyBase {Boolean} Whether to destroy the base texture as well - */ -PIXI.Texture.prototype.destroy = function(destroyBase) -{ - if (destroyBase) this.baseTexture.destroy(); - - this.valid = false; -}; - -/** - * Specifies the region of the baseTexture that this texture will use. - * - * @method setFrame - * @param frame {Rectangle} The frame of the texture to set it to - */ -PIXI.Texture.prototype.setFrame = function(frame) -{ - this.noFrame = false; - - this.frame = frame; - this.width = frame.width; - this.height = frame.height; - - this.crop.x = frame.x; - this.crop.y = frame.y; - this.crop.width = frame.width; - this.crop.height = frame.height; - - if (!this.trim && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) - { - throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); - } - - this.valid = frame && frame.width && frame.height && this.baseTexture.source && this.baseTexture.hasLoaded; - - if (this.trim) - { - this.width = this.trim.width; - this.height = this.trim.height; - this.frame.width = this.trim.width; - this.frame.height = this.trim.height; - } - - if (this.valid) this._updateUvs(); - -}; - -/** - * Updates the internal WebGL UV cache. - * - * @method _updateUvs - * @private - */ -PIXI.Texture.prototype._updateUvs = function() -{ - if(!this._uvs)this._uvs = new PIXI.TextureUvs(); - - var frame = this.crop; - var tw = this.baseTexture.width; - var th = this.baseTexture.height; - - this._uvs.x0 = frame.x / tw; - this._uvs.y0 = frame.y / th; - - this._uvs.x1 = (frame.x + frame.width) / tw; - this._uvs.y1 = frame.y / th; - - this._uvs.x2 = (frame.x + frame.width) / tw; - this._uvs.y2 = (frame.y + frame.height) / th; - - this._uvs.x3 = frame.x / tw; - this._uvs.y3 = (frame.y + frame.height) / th; -}; - -/** - * Helper function that creates a Texture object from the given image url. - * If the image is not in the texture cache it will be created and loaded. - * - * @static - * @method fromImage - * @param imageUrl {String} The image url of the texture - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return Texture - */ -PIXI.Texture.fromImage = function(imageUrl, crossorigin, scaleMode) -{ - var texture = PIXI.TextureCache[imageUrl]; - - if(!texture) - { - texture = new PIXI.Texture(PIXI.BaseTexture.fromImage(imageUrl, crossorigin, scaleMode)); - PIXI.TextureCache[imageUrl] = texture; - } - - return texture; -}; - -/** - * Helper function that returns a Texture objected based on the given frame id. - * If the frame id is not in the texture cache an error will be thrown. - * - * @static - * @method fromFrame - * @param frameId {String} The frame id of the texture - * @return Texture - */ -PIXI.Texture.fromFrame = function(frameId) -{ - var texture = PIXI.TextureCache[frameId]; - if(!texture) throw new Error('The frameId "' + frameId + '" does not exist in the texture cache '); - return texture; -}; - -/** - * Helper function that creates a new a Texture based on the given canvas element. - * - * @static - * @method fromCanvas - * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return Texture - */ -PIXI.Texture.fromCanvas = function(canvas, scaleMode) -{ - var baseTexture = PIXI.BaseTexture.fromCanvas(canvas, scaleMode); - - return new PIXI.Texture( baseTexture ); - -}; - -/** - * Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object. - * - * @static - * @method addTextureToCache - * @param texture {Texture} The Texture to add to the cache. - * @param id {String} The id that the texture will be stored against. - */ -PIXI.Texture.addTextureToCache = function(texture, id) -{ - PIXI.TextureCache[id] = texture; -}; - -/** - * Remove a texture from the global PIXI.TextureCache. - * - * @static - * @method removeTextureFromCache - * @param id {String} The id of the texture to be removed - * @return {Texture} The texture that was removed - */ -PIXI.Texture.removeTextureFromCache = function(id) -{ - var texture = PIXI.TextureCache[id]; - delete PIXI.TextureCache[id]; - delete PIXI.BaseTextureCache[id]; - return texture; -}; - -PIXI.TextureUvs = function() -{ - this.x0 = 0; - this.y0 = 0; - - this.x1 = 0; - this.y1 = 0; - - this.x2 = 0; - this.y2 = 0; - - this.x3 = 0; - this.y3 = 0; -}; - -PIXI.Texture.emptyTexture = new PIXI.Texture(new PIXI.BaseTexture()); - - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A RenderTexture is a special texture that allows any Pixi display object to be rendered to it. - * - * __Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead. - * - * A RenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example: - * - * var renderTexture = new PIXI.RenderTexture(800, 600); - * var sprite = PIXI.Sprite.fromImage("spinObj_01.png"); - * sprite.position.x = 800/2; - * sprite.position.y = 600/2; - * sprite.anchor.x = 0.5; - * sprite.anchor.y = 0.5; - * renderTexture.render(sprite); - * - * The Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual position a DisplayObjectContainer should be used: - * - * var doc = new PIXI.DisplayObjectContainer(); - * doc.addChild(sprite); - * renderTexture.render(doc); // Renders to center of renderTexture - * - * @class RenderTexture - * @extends Texture - * @constructor - * @param width {Number} The width of the render texture - * @param height {Number} The height of the render texture - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @param resolution {Number} The resolution of the texture being generated - */ -PIXI.RenderTexture = function(width, height, renderer, scaleMode, resolution) -{ - /** - * The with of the render texture - * - * @property width - * @type Number - */ - this.width = width || 100; - - /** - * The height of the render texture - * - * @property height - * @type Number - */ - this.height = height || 100; - - /** - * The Resolution of the texture. - * - * @property resolution - * @type Number - */ - this.resolution = resolution || 1; - - /** - * The framing rectangle of the render texture - * - * @property frame - * @type Rectangle - */ - this.frame = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @property crop - * @type Rectangle - */ - this.crop = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * The base texture object that this texture uses - * - * @property baseTexture - * @type BaseTexture - */ - this.baseTexture = new PIXI.BaseTexture(); - this.baseTexture.width = this.width * this.resolution; - this.baseTexture.height = this.height * this.resolution; - this.baseTexture._glTextures = []; - this.baseTexture.resolution = this.resolution; - - this.baseTexture.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - this.baseTexture.hasLoaded = true; - - PIXI.Texture.call(this, - this.baseTexture, - new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution) - ); - - /** - * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. - * - * @property renderer - * @type CanvasRenderer|WebGLRenderer - */ - this.renderer = renderer || PIXI.defaultRenderer; - - if(this.renderer.type === PIXI.WEBGL_RENDERER) - { - var gl = this.renderer.gl; - this.baseTexture._dirty[gl.id] = false; - - this.textureBuffer = new PIXI.FilterTexture(gl, this.width, this.height, this.baseTexture.scaleMode); - this.baseTexture._glTextures[gl.id] = this.textureBuffer.texture; - - this.render = this.renderWebGL; - this.projection = new PIXI.Point(this.width*0.5, -this.height*0.5); - } - else - { - this.render = this.renderCanvas; - this.textureBuffer = new PIXI.CanvasBuffer(this.width* this.resolution, this.height* this.resolution); - this.baseTexture.source = this.textureBuffer.canvas; - } - - /** - * @property valid - * @type Boolean - */ - this.valid = true; - - this._updateUvs(); -}; - -PIXI.RenderTexture.prototype = Object.create(PIXI.Texture.prototype); -PIXI.RenderTexture.prototype.constructor = PIXI.RenderTexture; - -/** - * Resizes the RenderTexture. - * - * @method resize - * @param width {Number} The width to resize to. - * @param height {Number} The height to resize to. - * @param updateBase {Boolean} Should the baseTexture.width and height values be resized as well? - */ -PIXI.RenderTexture.prototype.resize = function(width, height, updateBase) -{ - if (width === this.width && height === this.height)return; - - this.valid = (width > 0 && height > 0); - - this.width = width; - this.height = height; - - this.frame.width = this.crop.width = width * this.resolution; - this.frame.height = this.crop.height = height * this.resolution; - - if (updateBase) - { - this.baseTexture.width = this.width * this.resolution; - this.baseTexture.height = this.height * this.resolution; - } - - if (this.renderer.type === PIXI.WEBGL_RENDERER) - { - this.projection.x = this.width / 2; - this.projection.y = -this.height / 2; - } - - if(!this.valid)return; - - this.textureBuffer.resize(this.width, this.height); -}; - -/** - * Clears the RenderTexture. - * - * @method clear - */ -PIXI.RenderTexture.prototype.clear = function() -{ - if(!this.valid)return; - - if (this.renderer.type === PIXI.WEBGL_RENDERER) - { - this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer); - } - - this.textureBuffer.clear(); -}; - -/** - * This function will draw the display object to the texture. - * - * @method renderWebGL - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. - * @param [clear] {Boolean} If true the texture will be cleared before the displayObject is drawn - * @private - */ -PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, matrix, clear) -{ - if(!this.valid)return; - //TOOD replace position with matrix.. - - //Lets create a nice matrix to apply to our display object. Frame buffers come in upside down so we need to flip the matrix - var wt = displayObject.worldTransform; - wt.identity(); - wt.translate(0, this.projection.y * 2); - if(matrix)wt.append(matrix); - wt.scale(1,-1); - - // setWorld Alpha to ensure that the object is renderer at full opacity - displayObject.worldAlpha = 1; - - // Time to update all the children of the displayObject with the new matrix.. - var children = displayObject.children; - - for(var i=0,j=children.length; i 'image/gif' - var info = data.slice(0, sepIdx).split(';')[0]; - - //We might need to handle some special cases here... - //standardize text/plain to 'txt' file extension - if (!info || info.toLowerCase() === 'text/plain') - return 'txt'; - - //User specified mime type, try splitting it by '/' - return info.split('/').pop().toLowerCase(); - } - - return null; -}; - -/** - * Starts loading the assets sequentially - * - * @method load - */ -PIXI.AssetLoader.prototype.load = function() -{ - var scope = this; - - function onLoad(evt) { - scope.onAssetLoaded(evt.data.content); - } - - this.loadCount = this.assetURLs.length; - - for (var i=0; i < this.assetURLs.length; i++) - { - var fileName = this.assetURLs[i]; - //first see if we have a data URI scheme.. - var fileType = this._getDataType(fileName); - - //if not, assume it's a file URI - if (!fileType) - fileType = fileName.split('?').shift().split('.').pop().toLowerCase(); - - var Constructor = this.loadersByType[fileType]; - if(!Constructor) - throw new Error(fileType + ' is an unsupported file type'); - - var loader = new Constructor(fileName, this.crossorigin); - - loader.on('loaded', onLoad); - loader.load(); - } -}; - -/** - * Invoked after each file is loaded - * - * @method onAssetLoaded - * @private - */ -PIXI.AssetLoader.prototype.onAssetLoaded = function(loader) -{ - this.loadCount--; - - this.emit('onProgress', { - content: this, - loader: loader, - loaded: this.assetURLs.length - this.loadCount, - total: this.assetURLs.length - }); - - if (this.onProgress) this.onProgress(loader); - - if (!this.loadCount) - { - this.emit('onComplete', { content: this }); - if(this.onComplete) this.onComplete(); - } -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The json file loader is used to load in JSON data and parse it - * When loaded this class will dispatch a 'loaded' event - * If loading fails this class will dispatch an 'error' event - * - * @class JsonLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.JsonLoader = function (url, crossorigin) { - /** - * The url of the bitmap font data - * - * @property url - * @type String - */ - this.url = url; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * [read-only] The base url of the bitmap font data - * - * @property baseUrl - * @type String - * @readOnly - */ - this.baseUrl = url.replace(/[^\/]*$/, ''); - - /** - * [read-only] Whether the data has loaded yet - * - * @property loaded - * @type Boolean - * @readOnly - */ - this.loaded = false; - -}; - -// constructor -PIXI.JsonLoader.prototype.constructor = PIXI.JsonLoader; -PIXI.EventTarget.mixin(PIXI.JsonLoader.prototype); - -/** - * Loads the JSON data - * - * @method load - */ -PIXI.JsonLoader.prototype.load = function () { - - if(window.XDomainRequest && this.crossorigin) - { - this.ajaxRequest = new window.XDomainRequest(); - - // XDomainRequest has a few quirks. Occasionally it will abort requests - // A way to avoid this is to make sure ALL callbacks are set even if not used - // More info here: http://stackoverflow.com/questions/15786966/xdomainrequest-aborts-post-on-ie-9 - this.ajaxRequest.timeout = 3000; - - this.ajaxRequest.onerror = this.onError.bind(this); - - this.ajaxRequest.ontimeout = this.onError.bind(this); - - this.ajaxRequest.onprogress = function() {}; - - this.ajaxRequest.onload = this.onJSONLoaded.bind(this); - } - else - { - if (window.XMLHttpRequest) - { - this.ajaxRequest = new window.XMLHttpRequest(); - } - else - { - this.ajaxRequest = new window.ActiveXObject('Microsoft.XMLHTTP'); - } - - this.ajaxRequest.onreadystatechange = this.onReadyStateChanged.bind(this); - } - - this.ajaxRequest.open('GET',this.url,true); - - this.ajaxRequest.send(); -}; - -/** - * Bridge function to be able to use the more reliable onreadystatechange in XMLHttpRequest. - * - * @method onReadyStateChanged - * @private - */ -PIXI.JsonLoader.prototype.onReadyStateChanged = function () { - if (this.ajaxRequest.readyState === 4 && (this.ajaxRequest.status === 200 || window.location.href.indexOf('http') === -1)) { - this.onJSONLoaded(); - } -}; - -/** - * Invoke when JSON file is loaded - * - * @method onJSONLoaded - * @private - */ -PIXI.JsonLoader.prototype.onJSONLoaded = function () { - - if(!this.ajaxRequest.responseText ) - { - this.onError(); - return; - } - - this.json = JSON.parse(this.ajaxRequest.responseText); - - if(this.json.frames && this.json.meta && this.json.meta.image) - { - // sprite sheet - var textureUrl = this.baseUrl + this.json.meta.image; - var image = new PIXI.ImageLoader(textureUrl, this.crossorigin); - var frameData = this.json.frames; - - this.texture = image.texture.baseTexture; - image.addEventListener('loaded', this.onLoaded.bind(this)); - - for (var i in frameData) - { - var rect = frameData[i].frame; - - if (rect) - { - var textureSize = new PIXI.Rectangle(rect.x, rect.y, rect.w, rect.h); - var crop = textureSize.clone(); - var trim = null; - - // Check to see if the sprite is trimmed - if (frameData[i].trimmed) - { - var actualSize = frameData[i].sourceSize; - var realSize = frameData[i].spriteSourceSize; - trim = new PIXI.Rectangle(realSize.x, realSize.y, actualSize.w, actualSize.h); - } - PIXI.TextureCache[i] = new PIXI.Texture(this.texture, textureSize, crop, trim); - } - } - - image.load(); - - } - else if(this.json.bones) - { - /* check if the json was loaded before */ - if (PIXI.AnimCache[this.url]) - { - this.onLoaded(); - } - else - { - /* use a bit of hackery to load the atlas file, here we assume that the .json, .atlas and .png files - * that correspond to the spine file are in the same base URL and that the .json and .atlas files - * have the same name - */ - var atlasPath = this.url.substr(0, this.url.lastIndexOf('.')) + '.atlas'; - var atlasLoader = new PIXI.JsonLoader(atlasPath, this.crossorigin); - // save a copy of the current object for future reference // - var originalLoader = this; - // before loading the file, replace the "onJSONLoaded" function for our own // - atlasLoader.onJSONLoaded = function() - { - // at this point "this" points at the atlasLoader (JsonLoader) instance // - if(!this.ajaxRequest.responseText) - { - this.onError(); // FIXME: hmm, this is funny because we are not responding to errors yet - return; - } - // create a new instance of a spine texture loader for this spine object // - var textureLoader = new PIXI.SpineTextureLoader(this.url.substring(0, this.url.lastIndexOf('/'))); - // create a spine atlas using the loaded text and a spine texture loader instance // - var spineAtlas = new spine.Atlas(this.ajaxRequest.responseText, textureLoader); - // now we use an atlas attachment loader // - var attachmentLoader = new spine.AtlasAttachmentLoader(spineAtlas); - // spine animation - var spineJsonParser = new spine.SkeletonJson(attachmentLoader); - var skeletonData = spineJsonParser.readSkeletonData(originalLoader.json); - PIXI.AnimCache[originalLoader.url] = skeletonData; - originalLoader.spine = skeletonData; - originalLoader.spineAtlas = spineAtlas; - originalLoader.spineAtlasLoader = atlasLoader; - // wait for textures to finish loading if needed - if (textureLoader.loadingCount > 0) - { - textureLoader.addEventListener('loadedBaseTexture', function(evt){ - if (evt.content.content.loadingCount <= 0) - { - originalLoader.onLoaded(); - } - }); - } - else - { - originalLoader.onLoaded(); - } - }; - // start the loading // - atlasLoader.load(); - } - } - else - { - this.onLoaded(); - } -}; - -/** - * Invoke when json file loaded - * - * @method onLoaded - * @private - */ -PIXI.JsonLoader.prototype.onLoaded = function () { - this.loaded = true; - this.dispatchEvent({ - type: 'loaded', - content: this - }); -}; - -/** - * Invoke when error occured - * - * @method onError - * @private - */ -PIXI.JsonLoader.prototype.onError = function () { - - this.dispatchEvent({ - type: 'error', - content: this - }); -}; - -/** - * @author Martin Kelm http://mkelm.github.com - */ - -/** - * The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event. - * - * To generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format. - * - * It is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to 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.fromFrameId() - * - * @class AtlasLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.AtlasLoader = function (url, crossorigin) { - this.url = url; - this.baseUrl = url.replace(/[^\/]*$/, ''); - this.crossorigin = crossorigin; - this.loaded = false; - -}; - -// constructor -PIXI.AtlasLoader.constructor = PIXI.AtlasLoader; - -PIXI.EventTarget.mixin(PIXI.AtlasLoader.prototype); - - /** - * Starts loading the JSON file - * - * @method load - */ -PIXI.AtlasLoader.prototype.load = function () { - this.ajaxRequest = new PIXI.AjaxRequest(); - this.ajaxRequest.onreadystatechange = this.onAtlasLoaded.bind(this); - - this.ajaxRequest.open('GET', this.url, true); - if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/json'); - this.ajaxRequest.send(null); -}; - -/** - * Invoked when the Atlas has fully loaded. Parses the JSON and builds the texture frames. - * - * @method onAtlasLoaded - * @private - */ -PIXI.AtlasLoader.prototype.onAtlasLoaded = function () { - if (this.ajaxRequest.readyState === 4) { - if (this.ajaxRequest.status === 200 || window.location.href.indexOf('http') === -1) { - this.atlas = { - meta : { - image : [] - }, - frames : [] - }; - var result = this.ajaxRequest.responseText.split(/\r?\n/); - var lineCount = -3; - - var currentImageId = 0; - var currentFrame = null; - var nameInNextLine = false; - - var i = 0, - j = 0, - selfOnLoaded = this.onLoaded.bind(this); - - // parser without rotation support yet! - for (i = 0; i < result.length; i++) { - result[i] = result[i].replace(/^\s+|\s+$/g, ''); - if (result[i] === '') { - nameInNextLine = i+1; - } - if (result[i].length > 0) { - if (nameInNextLine === i) { - this.atlas.meta.image.push(result[i]); - currentImageId = this.atlas.meta.image.length - 1; - this.atlas.frames.push({}); - lineCount = -3; - } else if (lineCount > 0) { - if (lineCount % 7 === 1) { // frame name - if (currentFrame != null) { //jshint ignore:line - this.atlas.frames[currentImageId][currentFrame.name] = currentFrame; - } - currentFrame = { name: result[i], frame : {} }; - } else { - var text = result[i].split(' '); - if (lineCount % 7 === 3) { // position - currentFrame.frame.x = Number(text[1].replace(',', '')); - currentFrame.frame.y = Number(text[2]); - } else if (lineCount % 7 === 4) { // size - currentFrame.frame.w = Number(text[1].replace(',', '')); - currentFrame.frame.h = Number(text[2]); - } else if (lineCount % 7 === 5) { // real size - var realSize = { - x : 0, - y : 0, - w : Number(text[1].replace(',', '')), - h : Number(text[2]) - }; - - if (realSize.w > currentFrame.frame.w || realSize.h > currentFrame.frame.h) { - currentFrame.trimmed = true; - currentFrame.realSize = realSize; - } else { - currentFrame.trimmed = false; - } - } - } - } - lineCount++; - } - } - - if (currentFrame != null) { //jshint ignore:line - this.atlas.frames[currentImageId][currentFrame.name] = currentFrame; - } - - if (this.atlas.meta.image.length > 0) { - this.images = []; - for (j = 0; j < this.atlas.meta.image.length; j++) { - // sprite sheet - var textureUrl = this.baseUrl + this.atlas.meta.image[j]; - var frameData = this.atlas.frames[j]; - this.images.push(new PIXI.ImageLoader(textureUrl, this.crossorigin)); - - for (i in frameData) { - var rect = frameData[i].frame; - if (rect) { - PIXI.TextureCache[i] = new PIXI.Texture(this.images[j].texture.baseTexture, { - x: rect.x, - y: rect.y, - width: rect.w, - height: rect.h - }); - if (frameData[i].trimmed) { - PIXI.TextureCache[i].realSize = frameData[i].realSize; - // trim in pixi not supported yet, todo update trim properties if it is done ... - PIXI.TextureCache[i].trim.x = 0; - PIXI.TextureCache[i].trim.y = 0; - } - } - } - } - - this.currentImageId = 0; - for (j = 0; j < this.images.length; j++) { - this.images[j].on('loaded', selfOnLoaded); - } - this.images[this.currentImageId].load(); - - } else { - this.onLoaded(); - } - - } else { - this.onError(); - } - } -}; - -/** - * Invoked when json file has loaded. - * - * @method onLoaded - * @private - */ -PIXI.AtlasLoader.prototype.onLoaded = function () { - if (this.images.length - 1 > this.currentImageId) { - this.currentImageId++; - this.images[this.currentImageId].load(); - } else { - this.loaded = true; - this.emit('loaded', { content: this }); - } -}; - -/** - * Invoked when an error occurs. - * - * @method onError - * @private - */ -PIXI.AtlasLoader.prototype.onError = function () { - this.emit('error', { content: this }); -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * 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 in 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 a 'texture atlas') as it means sprites 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.fromFrameId() - * This loader will load the image file that the Spritesheet points to as well as the data. - * When loaded this class will dispatch a 'loaded' event - * - * @class SpriteSheetLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the sprite sheet JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.SpriteSheetLoader = function (url, crossorigin) { - - /** - * The url of the atlas data - * - * @property url - * @type String - */ - this.url = url; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * [read-only] The base url of the bitmap font data - * - * @property baseUrl - * @type String - * @readOnly - */ - this.baseUrl = url.replace(/[^\/]*$/, ''); - - /** - * The texture being loaded - * - * @property texture - * @type Texture - */ - this.texture = null; - - /** - * The frames of the sprite sheet - * - * @property frames - * @type Object - */ - this.frames = {}; -}; - -// constructor -PIXI.SpriteSheetLoader.prototype.constructor = PIXI.SpriteSheetLoader; - -PIXI.EventTarget.mixin(PIXI.SpriteSheetLoader.prototype); - -/** - * This will begin loading the JSON file - * - * @method load - */ -PIXI.SpriteSheetLoader.prototype.load = function () { - var scope = this; - var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin); - jsonLoader.on('loaded', function (event) { - scope.json = event.data.content.json; - scope.onLoaded(); - }); - jsonLoader.load(); -}; - -/** - * Invoke when all files are loaded (json and texture) - * - * @method onLoaded - * @private - */ -PIXI.SpriteSheetLoader.prototype.onLoaded = function () { - this.emit('loaded', { - content: this - }); -}; - -/** - * @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.fromFrame() and PIXI.Sprite.fromFrame() - * When loaded this class will dispatch a 'loaded' event - * - * @class ImageLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the image - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.ImageLoader = function(url, crossorigin) -{ - /** - * The texture being loaded - * - * @property texture - * @type Texture - */ - this.texture = PIXI.Texture.fromImage(url, crossorigin); - - /** - * if the image is loaded with loadFramedSpriteSheet - * frames will contain the sprite sheet frames - * - * @property frames - * @type Array - * @readOnly - */ - this.frames = []; -}; - -// constructor -PIXI.ImageLoader.prototype.constructor = PIXI.ImageLoader; - -PIXI.EventTarget.mixin(PIXI.ImageLoader.prototype); - -/** - * Loads image or takes it from cache - * - * @method load - */ -PIXI.ImageLoader.prototype.load = function() -{ - if(!this.texture.baseTexture.hasLoaded) - { - this.texture.baseTexture.on('loaded', this.onLoaded.bind(this)); - } - else - { - this.onLoaded(); - } -}; - -/** - * Invoked when image file is loaded or it is already cached and ready to use - * - * @method onLoaded - * @private - */ -PIXI.ImageLoader.prototype.onLoaded = function() -{ - this.emit('loaded', { content: this }); -}; - -/** - * Loads image and split it to uniform sized frames - * - * @method loadFramedSpriteSheet - * @param frameWidth {Number} width of each frame - * @param frameHeight {Number} height of each frame - * @param textureName {String} if given, the frames will be cached in - format - */ -PIXI.ImageLoader.prototype.loadFramedSpriteSheet = function(frameWidth, frameHeight, textureName) -{ - this.frames = []; - var cols = Math.floor(this.texture.width / frameWidth); - var rows = Math.floor(this.texture.height / frameHeight); - - var i=0; - for (var y=0; y-1){var c=["%c %c %c Pixi.js "+b.VERSION+" - "+a+" %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ ","background: #ff66a5","background: #ff66a5","color: #ff66a5; background: #030307;","background: #ff66a5","background: #ffc3dc","background: #ff66a5","color: #ff2424; background: #fff","color: #ff2424; background: #fff","color: #ff2424; background: #fff"];console.log.apply(console,c)}else window.console&&console.log("Pixi.js "+b.VERSION+" - http://www.pixijs.com/");b.dontSayHello=!0}},b.Point=function(a,b){this.x=a||0,this.y=b||0},b.Point.prototype.clone=function(){return new b.Point(this.x,this.y)},b.Point.prototype.set=function(a,b){this.x=a||0,this.y=b||(0!==b?this.x:0)},b.Point.prototype.constructor=b.Point,b.Rectangle=function(a,b,c,d){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0},b.Rectangle.prototype.clone=function(){return new b.Rectangle(this.x,this.y,this.width,this.height)},b.Rectangle.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=this.x;if(a>=c&&a<=c+this.width){var d=this.y;if(b>=d&&b<=d+this.height)return!0}return!1},b.Rectangle.prototype.constructor=b.Rectangle,b.EmptyRectangle=new b.Rectangle(0,0,0,0),b.Polygon=function(a){if(a instanceof Array||(a=Array.prototype.slice.call(arguments)),a[0]instanceof b.Point){for(var c=[],d=0,e=a.length;e>d;d++)c.push(a[d].x,a[d].y);a=c}this.closed=!0,this.points=a},b.Polygon.prototype.clone=function(){var a=this.points.slice();return new b.Polygon(a)},b.Polygon.prototype.contains=function(a,b){for(var c=!1,d=this.points.length/2,e=0,f=d-1;d>e;f=e++){var g=this.points[2*e],h=this.points[2*e+1],i=this.points[2*f],j=this.points[2*f+1],k=h>b!=j>b&&(i-g)*(b-h)/(j-h)+g>a;k&&(c=!c)}return c},b.Polygon.prototype.constructor=b.Polygon,b.Circle=function(a,b,c){this.x=a||0,this.y=b||0,this.radius=c||0},b.Circle.prototype.clone=function(){return new b.Circle(this.x,this.y,this.radius)},b.Circle.prototype.contains=function(a,b){if(this.radius<=0)return!1;var c=this.x-a,d=this.y-b,e=this.radius*this.radius;return c*=c,d*=d,e>=c+d},b.Circle.prototype.getBounds=function(){return new b.Rectangle(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},b.Circle.prototype.constructor=b.Circle,b.Ellipse=function(a,b,c,d){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0},b.Ellipse.prototype.clone=function(){return new b.Ellipse(this.x,this.y,this.width,this.height)},b.Ellipse.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=(a-this.x)/this.width,d=(b-this.y)/this.height;return c*=c,d*=d,1>=c+d},b.Ellipse.prototype.getBounds=function(){return new b.Rectangle(this.x-this.width,this.y-this.height,this.width,this.height)},b.Ellipse.prototype.constructor=b.Ellipse,b.RoundedRectangle=function(a,b,c,d,e){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0,this.radius=e||20},b.RoundedRectangle.prototype.clone=function(){return new b.RoundedRectangle(this.x,this.y,this.width,this.height,this.radius)},b.RoundedRectangle.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=this.x;if(a>=c&&a<=c+this.width){var d=this.y;if(b>=d&&b<=d+this.height)return!0}return!1},b.RoundedRectangle.prototype.constructor=b.RoundedRectangle,b.Matrix=function(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0},b.Matrix.prototype.fromArray=function(a){this.a=a[0],this.b=a[1],this.c=a[3],this.d=a[4],this.tx=a[2],this.ty=a[5]},b.Matrix.prototype.toArray=function(a){this.array||(this.array=new b.Float32Array(9));var c=this.array;return a?(c[0]=this.a,c[1]=this.b,c[2]=0,c[3]=this.c,c[4]=this.d,c[5]=0,c[6]=this.tx,c[7]=this.ty,c[8]=1):(c[0]=this.a,c[1]=this.c,c[2]=this.tx,c[3]=this.b,c[4]=this.d,c[5]=this.ty,c[6]=0,c[7]=0,c[8]=1),c},b.Matrix.prototype.apply=function(a,c){return c=c||new b.Point,c.x=this.a*a.x+this.c*a.y+this.tx,c.y=this.b*a.x+this.d*a.y+this.ty,c},b.Matrix.prototype.applyInverse=function(a,c){c=c||new b.Point;var d=1/(this.a*this.d+this.c*-this.b);return c.x=this.d*d*a.x+-this.c*d*a.y+(this.ty*this.c-this.tx*this.d)*d,c.y=this.a*d*a.y+-this.b*d*a.x+(-this.ty*this.a+this.tx*this.b)*d,c},b.Matrix.prototype.translate=function(a,b){return this.tx+=a,this.ty+=b,this},b.Matrix.prototype.scale=function(a,b){return this.a*=a,this.d*=b,this.c*=a,this.b*=b,this.tx*=a,this.ty*=b,this},b.Matrix.prototype.rotate=function(a){var b=Math.cos(a),c=Math.sin(a),d=this.a,e=this.c,f=this.tx;return this.a=d*b-this.b*c,this.b=d*c+this.b*b,this.c=e*b-this.d*c,this.d=e*c+this.d*b,this.tx=f*b-this.ty*c,this.ty=f*c+this.ty*b,this},b.Matrix.prototype.append=function(a){var b=this.a,c=this.b,d=this.c,e=this.d;return this.a=a.a*b+a.b*d,this.b=a.a*c+a.b*e,this.c=a.c*b+a.d*d,this.d=a.c*c+a.d*e,this.tx=a.tx*b+a.ty*d+this.tx,this.ty=a.tx*c+a.ty*e+this.ty,this},b.Matrix.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},b.identityMatrix=new b.Matrix,b.DisplayObject=function(){this.position=new b.Point,this.scale=new b.Point(1,1),this.pivot=new b.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.hitArea=null,this.buttonMode=!1,this.renderable=!1,this.parent=null,this.stage=null,this.worldAlpha=1,this._interactive=!1,this.defaultCursor="pointer",this.worldTransform=new b.Matrix,this._sr=0,this._cr=1,this.filterArea=null,this._bounds=new b.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null,this._cacheAsBitmap=!1,this._cacheIsDirty=!1},b.DisplayObject.prototype.constructor=b.DisplayObject,Object.defineProperty(b.DisplayObject.prototype,"interactive",{get:function(){return this._interactive},set:function(a){this._interactive=a,this.stage&&(this.stage.dirty=!0)}}),Object.defineProperty(b.DisplayObject.prototype,"worldVisible",{get:function(){var a=this;do{if(!a.visible)return!1;a=a.parent}while(a);return!0}}),Object.defineProperty(b.DisplayObject.prototype,"mask",{get:function(){return this._mask},set:function(a){this._mask&&(this._mask.isMask=!1),this._mask=a,this._mask&&(this._mask.isMask=!0)}}),Object.defineProperty(b.DisplayObject.prototype,"filters",{get:function(){return this._filters},set:function(a){if(a){for(var b=[],c=0;c=0&&b<=this.children.length)return a.parent&&a.parent.removeChild(a),a.parent=this,this.children.splice(b,0,a),this.stage&&a.setStageReference(this.stage),a;throw new Error(a+"addChildAt: The index "+b+" supplied is out of bounds "+this.children.length)},b.DisplayObjectContainer.prototype.swapChildren=function(a,b){if(a!==b){var c=this.getChildIndex(a),d=this.getChildIndex(b);if(0>c||0>d)throw new Error("swapChildren: Both the supplied DisplayObjects must be a child of the caller.");this.children[c]=b,this.children[d]=a}},b.DisplayObjectContainer.prototype.getChildIndex=function(a){var b=this.children.indexOf(a);if(-1===b)throw new Error("The supplied DisplayObject must be a child of the caller");return b},b.DisplayObjectContainer.prototype.setChildIndex=function(a,b){if(0>b||b>=this.children.length)throw new Error("The supplied index is out of bounds");var c=this.getChildIndex(a);this.children.splice(c,1),this.children.splice(b,0,a)},b.DisplayObjectContainer.prototype.getChildAt=function(a){if(0>a||a>=this.children.length)throw new Error("getChildAt: Supplied index "+a+" does not exist in the child list, or the supplied DisplayObject must be a child of the caller");return this.children[a]},b.DisplayObjectContainer.prototype.removeChild=function(a){var b=this.children.indexOf(a);if(-1!==b)return this.removeChildAt(b)},b.DisplayObjectContainer.prototype.removeChildAt=function(a){var b=this.getChildAt(a);return this.stage&&b.removeStageReference(),b.parent=void 0,this.children.splice(a,1),b},b.DisplayObjectContainer.prototype.removeChildren=function(a,b){var c=a||0,d="number"==typeof b?b:this.children.length,e=d-c;if(e>0&&d>=e){for(var f=this.children.splice(c,e),g=0;ga;a++)this.children[a].updateTransform()},b.DisplayObjectContainer.prototype.displayObjectContainerUpdateTransform=b.DisplayObjectContainer.prototype.updateTransform,b.DisplayObjectContainer.prototype.getBounds=function(){if(0===this.children.length)return b.EmptyRectangle;for(var a,c,d,e=1/0,f=1/0,g=-1/0,h=-1/0,i=!1,j=0,k=this.children.length;k>j;j++){var l=this.children[j];l.visible&&(i=!0,a=this.children[j].getBounds(),e=ec?g:c,h=h>d?h:d)}if(!i)return b.EmptyRectangle;var m=this._bounds;return m.x=e,m.y=f,m.width=g-e,m.height=h-f,m},b.DisplayObjectContainer.prototype.getLocalBounds=function(){var a=this.worldTransform;this.worldTransform=b.identityMatrix;for(var c=0,d=this.children.length;d>c;c++)this.children[c].updateTransform();var e=this.getBounds();return this.worldTransform=a,e},b.DisplayObjectContainer.prototype.setStageReference=function(a){this.stage=a,this._interactive&&(this.stage.dirty=!0);for(var b=0,c=this.children.length;c>b;b++){var d=this.children[b];d.setStageReference(a)}},b.DisplayObjectContainer.prototype.removeStageReference=function(){for(var a=0,b=this.children.length;b>a;a++){var c=this.children[a];c.removeStageReference()}this._interactive&&(this.stage.dirty=!0),this.stage=null},b.DisplayObjectContainer.prototype._renderWebGL=function(a){if(this.visible&&!(this.alpha<=0)){if(this._cacheAsBitmap)return void this._renderCachedSprite(a);var b,c;if(this._mask||this._filters){for(this._filters&&(a.spriteBatch.flush(),a.filterManager.pushFilter(this._filterBlock)),this._mask&&(a.spriteBatch.stop(),a.maskManager.pushMask(this.mask,a),a.spriteBatch.start()),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a);a.spriteBatch.stop(),this._mask&&a.maskManager.popMask(this._mask,a),this._filters&&a.filterManager.popFilter(),a.spriteBatch.start()}else for(b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a)}},b.DisplayObjectContainer.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){if(this._cacheAsBitmap)return void this._renderCachedSprite(a);this._mask&&a.maskManager.pushMask(this._mask,a);for(var b=0,c=this.children.length;c>b;b++){var d=this.children[b];d._renderCanvas(a)}this._mask&&a.maskManager.popMask(a)}},b.Sprite=function(a){b.DisplayObjectContainer.call(this),this.anchor=new b.Point,this.texture=a||b.Texture.emptyTexture,this._width=0,this._height=0,this.tint=16777215,this.blendMode=b.blendModes.NORMAL,this.shader=null,this.texture.baseTexture.hasLoaded?this.onTextureUpdate():this.texture.on("update",this.onTextureUpdate.bind(this)),this.renderable=!0},b.Sprite.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Sprite.prototype.constructor=b.Sprite,Object.defineProperty(b.Sprite.prototype,"width",{get:function(){return this.scale.x*this.texture.frame.width},set:function(a){this.scale.x=a/this.texture.frame.width,this._width=a}}),Object.defineProperty(b.Sprite.prototype,"height",{get:function(){return this.scale.y*this.texture.frame.height},set:function(a){this.scale.y=a/this.texture.frame.height,this._height=a}}),b.Sprite.prototype.setTexture=function(a){this.texture=a,this.cachedTint=16777215},b.Sprite.prototype.onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height)},b.Sprite.prototype.getBounds=function(a){var b=this.texture.frame.width,c=this.texture.frame.height,d=b*(1-this.anchor.x),e=b*-this.anchor.x,f=c*(1-this.anchor.y),g=c*-this.anchor.y,h=a||this.worldTransform,i=h.a,j=h.b,k=h.c,l=h.d,m=h.tx,n=h.ty,o=-1/0,p=-1/0,q=1/0,r=1/0;if(0===j&&0===k)0>i&&(i*=-1),0>l&&(l*=-1),q=i*e+m,o=i*d+m,r=l*g+n,p=l*f+n;else{var s=i*e+k*g+m,t=l*g+j*e+n,u=i*d+k*g+m,v=l*g+j*d+n,w=i*d+k*f+m,x=l*f+j*d+n,y=i*e+k*f+m,z=l*f+j*e+n;q=q>s?s:q,q=q>u?u:q,q=q>w?w:q,q=q>y?y:q,r=r>t?t:r,r=r>v?v:r,r=r>x?x:r,r=r>z?z:r,o=s>o?s:o,o=u>o?u:o,o=w>o?w:o,o=y>o?y:o,p=t>p?t:p,p=v>p?v:p,p=x>p?x:p,p=z>p?z:p}var A=this._bounds;return A.x=q,A.width=o-q,A.y=r,A.height=p-r,this._currentBounds=A,A},b.Sprite.prototype._renderWebGL=function(a){if(this.visible&&!(this.alpha<=0)){var b,c;if(this._mask||this._filters){var d=a.spriteBatch;for(this._filters&&(d.flush(),a.filterManager.pushFilter(this._filterBlock)),this._mask&&(d.stop(),a.maskManager.pushMask(this.mask,a),d.start()),d.render(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a);d.stop(),this._mask&&a.maskManager.popMask(this._mask,a),this._filters&&a.filterManager.popFilter(),d.start()}else for(a.spriteBatch.render(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a)}},b.Sprite.prototype._renderCanvas=function(a){if(!(this.visible===!1||0===this.alpha||this.texture.crop.width<=0||this.texture.crop.height<=0)){if(this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,a.context.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]),this._mask&&a.maskManager.pushMask(this._mask,a),this.texture.valid){var c=this.texture.baseTexture.resolution/a.resolution;a.context.globalAlpha=this.worldAlpha,a.smoothProperty&&a.scaleMode!==this.texture.baseTexture.scaleMode&&(a.scaleMode=this.texture.baseTexture.scaleMode,a.context[a.smoothProperty]=a.scaleMode===b.scaleModes.LINEAR);var d=this.texture.trim?this.texture.trim.x-this.anchor.x*this.texture.trim.width:this.anchor.x*-this.texture.frame.width,e=this.texture.trim?this.texture.trim.y-this.anchor.y*this.texture.trim.height:this.anchor.y*-this.texture.frame.height;a.roundPixels?(a.context.setTransform(this.worldTransform.a,this.worldTransform.b,this.worldTransform.c,this.worldTransform.d,this.worldTransform.tx*a.resolution|0,this.worldTransform.ty*a.resolution|0),d=0|d,e=0|e):a.context.setTransform(this.worldTransform.a,this.worldTransform.b,this.worldTransform.c,this.worldTransform.d,this.worldTransform.tx*a.resolution,this.worldTransform.ty*a.resolution),16777215!==this.tint?(this.cachedTint!==this.tint&&(this.cachedTint=this.tint,this.tintedTexture=b.CanvasTinter.getTintedTexture(this,this.tint)),a.context.drawImage(this.tintedTexture,0,0,this.texture.crop.width,this.texture.crop.height,d/c,e/c,this.texture.crop.width/c,this.texture.crop.height/c)):a.context.drawImage(this.texture.baseTexture.source,this.texture.crop.x,this.texture.crop.y,this.texture.crop.width,this.texture.crop.height,d/c,e/c,this.texture.crop.width/c,this.texture.crop.height/c)}for(var f=0,g=this.children.length;g>f;f++)this.children[f]._renderCanvas(a);this._mask&&a.maskManager.popMask(a)}},b.Sprite.fromFrame=function(a){var c=b.TextureCache[a];if(!c)throw new Error('The frameId "'+a+'" does not exist in the texture cache'+this);return new b.Sprite(c)},b.Sprite.fromImage=function(a,c,d){var e=b.Texture.fromImage(a,c,d);return new b.Sprite(e)},b.SpriteBatch=function(a){b.DisplayObjectContainer.call(this),this.textureThing=a,this.ready=!1},b.SpriteBatch.prototype=Object.create(b.DisplayObjectContainer.prototype),b.SpriteBatch.prototype.constructor=b.SpriteBatch,b.SpriteBatch.prototype.initWebGL=function(a){this.fastSpriteBatch=new b.WebGLFastSpriteBatch(a),this.ready=!0},b.SpriteBatch.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},b.SpriteBatch.prototype._renderWebGL=function(a){!this.visible||this.alpha<=0||!this.children.length||(this.ready||this.initWebGL(a.gl),this.fastSpriteBatch.gl!==a.gl&&this.fastSpriteBatch.setContext(a.gl),a.spriteBatch.stop(),a.shaderManager.setShader(a.shaderManager.fastShader),this.fastSpriteBatch.begin(this,a),this.fastSpriteBatch.render(this),a.spriteBatch.start())},b.SpriteBatch.prototype._renderCanvas=function(a){if(this.visible&&!(this.alpha<=0)&&this.children.length){var b=a.context;b.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var c=this.worldTransform,d=!0,e=0;e=this.textures.length&&(this.gotoAndStop(this.textures.length-1),this.onComplete&&this.onComplete())}},b.MovieClip.fromFrames=function(a){for(var c=[],d=0;di;i++){for(j=0;m>j;j+=4)if(255!==k[n+j]){o=!0;break}if(o)break;n+=m}for(c.ascent=g-i,n=l-m,o=!1,i=h;i>g;i--){for(j=0;m>j;j+=4)if(255!==k[n+j]){o=!0;break}if(o)break;n-=m}c.descent=i-g,c.descent+=6,c.fontSize=c.ascent+c.descent,b.Text.fontPropertiesCache[a]=c}return c},b.Text.prototype.wordWrap=function(a){for(var b="",c=a.split("\n"),d=0;de?(g>0&&(b+="\n"),b+=f[g],e=this.style.wordWrapWidth-h):(e-=i,b+=" "+f[g])}d=2?parseInt(c[c.length-2],10):b.BitmapText.fonts[this.fontName].size,this.dirty=!0,this.tint=a.tint},b.BitmapText.prototype.updateText=function(){for(var a=b.BitmapText.fonts[this.fontName],c=new b.Point,d=null,e=[],f=0,g=[],h=0,i=this.fontSize/a.size,j=0;j=j;j++){var n=0;"right"===this.style.align?n=f-g[j]:"center"===this.style.align&&(n=(f-g[j])/2),m.push(n)}var o=this.children.length,p=e.length,q=this.tint||16777215;for(j=0;p>j;j++){var r=o>j?this.children[j]:this._pool.pop();r?r.setTexture(e[j].texture):r=new b.Sprite(e[j].texture),r.position.x=(e[j].position.x+m[e[j].line])*i,r.position.y=e[j].position.y*i,r.scale.x=r.scale.y=i,r.tint=q,r.parent||this.addChild(r)}for(;this.children.length>p;){var s=this.getChildAt(this.children.length-1);this._pool.push(s),this.removeChild(s)}this.textWidth=f*i,this.textHeight=(c.y+a.lineHeight)*i},b.BitmapText.prototype.updateTransform=function(){this.dirty&&(this.updateText(),this.dirty=!1),b.DisplayObjectContainer.prototype.updateTransform.call(this)},b.BitmapText.fonts={},b.InteractionData=function(){this.global=new b.Point,this.target=null,this.originalEvent=null},b.InteractionData.prototype.getLocalPosition=function(a,c){var d=a.worldTransform,e=this.global,f=d.a,g=d.c,h=d.tx,i=d.b,j=d.d,k=d.ty,l=1/(f*j+g*-i);return c=c||new b.Point,c.x=j*l*e.x+-g*l*e.y+(k*g-h*j)*l,c.y=f*l*e.y+-i*l*e.x+(-k*f+h*i)*l,c},b.InteractionData.prototype.constructor=b.InteractionData,b.InteractionManager=function(a){this.stage=a,this.mouse=new b.InteractionData,this.touches={},this.tempPoint=new b.Point,this.mouseoverEnabled=!0,this.pool=[],this.interactiveItems=[],this.interactionDOMElement=null,this.onMouseMove=this.onMouseMove.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.onTouchCancel=this.onTouchCancel.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.last=0,this.currentCursorStyle="inherit",this.mouseOut=!1,this.resolution=1,this._tempPoint=new b.Point -},b.InteractionManager.prototype.constructor=b.InteractionManager,b.InteractionManager.prototype.collectInteractiveSprite=function(a,b){for(var c=a.children,d=c.length,e=d-1;e>=0;e--){var f=c[e];f._interactive?(b.interactiveChildren=!0,this.interactiveItems.push(f),f.children.length>0&&this.collectInteractiveSprite(f,f)):(f.__iParent=null,f.children.length>0&&this.collectInteractiveSprite(f,b))}},b.InteractionManager.prototype.setTarget=function(a){this.target=a,this.resolution=a.resolution,null===this.interactionDOMElement&&this.setTargetDomElement(a.view)},b.InteractionManager.prototype.setTargetDomElement=function(a){this.removeEvents(),window.navigator.msPointerEnabled&&(a.style["-ms-content-zooming"]="none",a.style["-ms-touch-action"]="none"),this.interactionDOMElement=a,a.addEventListener("mousemove",this.onMouseMove,!0),a.addEventListener("mousedown",this.onMouseDown,!0),a.addEventListener("mouseout",this.onMouseOut,!0),a.addEventListener("touchstart",this.onTouchStart,!0),a.addEventListener("touchend",this.onTouchEnd,!0),a.addEventListener("touchleave",this.onTouchCancel,!0),a.addEventListener("touchcancel",this.onTouchCancel,!0),a.addEventListener("touchmove",this.onTouchMove,!0),window.addEventListener("mouseup",this.onMouseUp,!0)},b.InteractionManager.prototype.removeEvents=function(){this.interactionDOMElement&&(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]="",this.interactionDOMElement.removeEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.removeEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.removeEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.removeEventListener("touchleave",this.onTouchCancel,!0),this.interactionDOMElement.removeEventListener("touchcancel",this.onTouchCancel,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onTouchMove,!0),this.interactionDOMElement=null,window.removeEventListener("mouseup",this.onMouseUp,!0))},b.InteractionManager.prototype.update=function(){if(this.target){var a=Date.now(),c=a-this.last;if(c=c*b.INTERACTION_FREQUENCY/1e3,!(1>c)){this.last=a;var d=0;this.dirty&&this.rebuildInteractiveGraph();var e=this.interactiveItems.length,f="inherit",g=!1;for(d=0;e>d;d++){var h=this.interactiveItems[d];h.__hit=this.hitTest(h,this.mouse),this.mouse.target=h,h.__hit&&!g?(h.buttonMode&&(f=h.defaultCursor),h.interactiveChildren||(g=!0),h.__isOver||(h.mouseover&&h.mouseover(this.mouse),h.__isOver=!0)):h.__isOver&&(h.mouseout&&h.mouseout(this.mouse),h.__isOver=!1)}this.currentCursorStyle!==f&&(this.currentCursorStyle=f,this.interactionDOMElement.style.cursor=f)}}},b.InteractionManager.prototype.rebuildInteractiveGraph=function(){this.dirty=!1;for(var a=this.interactiveItems.length,b=0;a>b;b++)this.interactiveItems[b].interactiveChildren=!1;this.interactiveItems=[],this.stage.interactive&&this.interactiveItems.push(this.stage),this.collectInteractiveSprite(this.stage,this.stage)},b.InteractionManager.prototype.onMouseMove=function(a){this.dirty&&this.rebuildInteractiveGraph(),this.mouse.originalEvent=a;var b=this.interactionDOMElement.getBoundingClientRect();this.mouse.global.x=(a.clientX-b.left)*(this.target.width/b.width)/this.resolution,this.mouse.global.y=(a.clientY-b.top)*(this.target.height/b.height)/this.resolution;for(var c=this.interactiveItems.length,d=0;c>d;d++){var e=this.interactiveItems[d];e.mousemove&&e.mousemove(this.mouse)}},b.InteractionManager.prototype.onMouseDown=function(a){this.dirty&&this.rebuildInteractiveGraph(),this.mouse.originalEvent=a,b.AUTO_PREVENT_DEFAULT&&this.mouse.originalEvent.preventDefault();for(var c=this.interactiveItems.length,d=this.mouse.originalEvent,e=2===d.button||3===d.which,f=e?"rightdown":"mousedown",g=e?"rightclick":"click",h=e?"__rightIsDown":"__mouseIsDown",i=e?"__isRightDown":"__isDown",j=0;c>j;j++){var k=this.interactiveItems[j];if((k[f]||k[g])&&(k[h]=!0,k.__hit=this.hitTest(k,this.mouse),k.__hit&&(k[f]&&k[f](this.mouse),k[i]=!0,!k.interactiveChildren)))break}},b.InteractionManager.prototype.onMouseOut=function(a){this.dirty&&this.rebuildInteractiveGraph(),this.mouse.originalEvent=a;var b=this.interactiveItems.length;this.interactionDOMElement.style.cursor="inherit";for(var c=0;b>c;c++){var d=this.interactiveItems[c];d.__isOver&&(this.mouse.target=d,d.mouseout&&d.mouseout(this.mouse),d.__isOver=!1)}this.mouseOut=!0,this.mouse.global.x=-1e4,this.mouse.global.y=-1e4},b.InteractionManager.prototype.onMouseUp=function(a){this.dirty&&this.rebuildInteractiveGraph(),this.mouse.originalEvent=a;for(var b=this.interactiveItems.length,c=!1,d=this.mouse.originalEvent,e=2===d.button||3===d.which,f=e?"rightup":"mouseup",g=e?"rightclick":"click",h=e?"rightupoutside":"mouseupoutside",i=e?"__isRightDown":"__isDown",j=0;b>j;j++){var k=this.interactiveItems[j];(k[g]||k[f]||k[h])&&(k.__hit=this.hitTest(k,this.mouse),k.__hit&&!c?(k[f]&&k[f](this.mouse),k[i]&&k[g]&&k[g](this.mouse),k.interactiveChildren||(c=!0)):k[i]&&k[h]&&k[h](this.mouse),k[i]=!1)}},b.InteractionManager.prototype.hitTest=function(a,c){var d=c.global;if(!a.worldVisible)return!1;a.worldTransform.applyInverse(d,this._tempPoint);var e,f=this._tempPoint.x,g=this._tempPoint.y;if(c.target=a,a.hitArea&&a.hitArea.contains)return a.hitArea.contains(f,g);if(a instanceof b.Sprite){var h,i=a.texture.frame.width,j=a.texture.frame.height,k=-i*a.anchor.x;if(f>k&&k+i>f&&(h=-j*a.anchor.y,g>h&&h+j>g))return!0}else if(a instanceof b.Graphics){var l=a.graphicsData;for(e=0;ee;e++){var o=a.children[e],p=this.hitTest(o,c);if(p)return c.target=a,!0}return!1},b.InteractionManager.prototype.onTouchMove=function(a){this.dirty&&this.rebuildInteractiveGraph();var b,c=this.interactionDOMElement.getBoundingClientRect(),d=a.changedTouches,e=0;for(e=0;ei;i++){var j=this.interactiveItems[i];if((j.touchstart||j.tap)&&(j.__hit=this.hitTest(j,g),j.__hit&&(j.touchstart&&j.touchstart(g),j.__isDown=!0,j.__touchData=j.__touchData||{},j.__touchData[f.identifier]=g,!j.interactiveChildren)))break}}},b.InteractionManager.prototype.onTouchEnd=function(a){this.dirty&&this.rebuildInteractiveGraph();for(var b=this.interactionDOMElement.getBoundingClientRect(),c=a.changedTouches,d=0;di;i++){var j=this.interactiveItems[i];j.__touchData&&j.__touchData[e.identifier]&&(j.__hit=this.hitTest(j,j.__touchData[e.identifier]),f.originalEvent=a,(j.touchend||j.tap)&&(j.__hit&&!g?(j.touchend&&j.touchend(f),j.__isDown&&j.tap&&j.tap(f),j.interactiveChildren||(g=!0)):j.__isDown&&j.touchendoutside&&j.touchendoutside(f),j.__isDown=!1),j.__touchData[e.identifier]=null)}this.pool.push(f),this.touches[e.identifier]=null}},b.InteractionManager.prototype.onTouchCancel=function(a){this.dirty&&this.rebuildInteractiveGraph();for(var b=this.interactionDOMElement.getBoundingClientRect(),c=a.changedTouches,d=0;di;i++){var j=this.interactiveItems[i];j.__touchData&&j.__touchData[e.identifier]&&(j.__hit=this.hitTest(j,j.__touchData[e.identifier]),f.originalEvent=a,j.touchcancel&&!g&&(j.touchcancel(f),j.interactiveChildren||(g=!0)),j.__isDown=!1,j.__touchData[e.identifier]=null)}this.pool.push(f),this.touches[e.identifier]=null}},b.Stage=function(a){b.DisplayObjectContainer.call(this),this.worldTransform=new b.Matrix,this.interactive=!0,this.interactionManager=new b.InteractionManager(this),this.dirty=!0,this.stage=this,this.stage.hitArea=new b.Rectangle(0,0,1e5,1e5),this.setBackgroundColor(a)},b.Stage.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Stage.prototype.constructor=b.Stage,b.Stage.prototype.setInteractionDelegate=function(a){this.interactionManager.setTargetDomElement(a)},b.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var a=0,b=this.children.length;b>a;a++)this.children[a].updateTransform();this.dirty&&(this.dirty=!1,this.interactionManager.dirty=!0),this.interactive&&this.interactionManager.update()},b.Stage.prototype.setBackgroundColor=function(a){this.backgroundColor=a||0,this.backgroundColorSplit=b.hex2rgb(this.backgroundColor);var c=this.backgroundColor.toString(16);c="000000".substr(0,6-c.length)+c,this.backgroundColorString="#"+c},b.Stage.prototype.getMousePosition=function(){return this.interactionManager.mouse.global},function(a){for(var b=0,c=["ms","moz","webkit","o"],d=0;d>16&255)/255,(a>>8&255)/255,(255&a)/255]},b.rgb2hex=function(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]},"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){return function(a){function b(){for(var d=arguments.length,f=new Array(d);d--;)f[d]=arguments[d];return f=e.concat(f),c.apply(this instanceof b?this:a,f)}var c=this,d=arguments.length-1,e=[];if(d>0)for(e.length=d;d--;)e[d]=arguments[d+1];if("function"!=typeof c)throw new TypeError;return b.prototype=function f(a){return a&&(f.prototype=a),this instanceof f?void 0:new f}(c.prototype),b}}()),b.AjaxRequest=function(){var a=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Microsoft.XMLHTTP"];if(!window.ActiveXObject)return window.XMLHttpRequest?new window.XMLHttpRequest:!1;for(var b=0;b0&&0===(a&a-1))return a;for(var b=1;a>b;)b<<=1;return b},b.isPowerOfTwo=function(a,b){return a>0&&0===(a&a-1)&&b>0&&0===(b&b-1)},b.EventTarget={call:function(a){a&&(a=a.prototype||a,b.EventTarget.mixin(a))},mixin:function(a){a.listeners=function(a){return this._listeners=this._listeners||{},this._listeners[a]?this._listeners[a].slice():[]},a.emit=a.dispatchEvent=function(a,c){if(this._listeners=this._listeners||{},"object"==typeof a&&(c=a,a=a.type),c&&c.__isEventObject===!0||(c=new b.Event(this,a,c)),this._listeners&&this._listeners[a]){var d,e=this._listeners[a].slice(0),f=e.length,g=e[0];for(d=0;f>d;g=e[++d])if(g.call(this,c),c.stoppedImmediate)return this;if(c.stopped)return this}return this.parent&&this.parent.emit&&this.parent.emit.call(this.parent,a,c),this},a.on=a.addEventListener=function(a,b){return this._listeners=this._listeners||{},(this._listeners[a]=this._listeners[a]||[]).push(b),this},a.once=function(a,b){function c(){b.apply(d.off(a,c),arguments)}this._listeners=this._listeners||{};var d=this;return c._originalHandler=b,this.on(a,c)},a.off=a.removeEventListener=function(a,b){if(this._listeners=this._listeners||{},!this._listeners[a])return this;for(var c=this._listeners[a],d=b?c.length:0;d-->0;)(c[d]===b||c[d]._originalHandler===b)&&c.splice(d,1);return 0===c.length&&delete this._listeners[a],this},a.removeAllListeners=function(a){return this._listeners=this._listeners||{},this._listeners[a]?(delete this._listeners[a],this):this}}},b.Event=function(a,b,c){this.__isEventObject=!0,this.stopped=!1,this.stoppedImmediate=!1,this.target=a,this.type=b,this.data=c,this.content=c,this.timeStamp=Date.now()},b.Event.prototype.stopPropagation=function(){this.stopped=!0},b.Event.prototype.stopImmediatePropagation=function(){this.stoppedImmediate=!0},b.autoDetectRenderer=function(a,c,d){a||(a=800),c||(c=600);var e=function(){try{var a=document.createElement("canvas");return!!window.WebGLRenderingContext&&(a.getContext("webgl")||a.getContext("experimental-webgl"))}catch(b){return!1}}();return e?new b.WebGLRenderer(a,c,d):new b.CanvasRenderer(a,c,d)},b.autoDetectRecommendedRenderer=function(a,c,d){a||(a=800),c||(c=600);var e=function(){try{var a=document.createElement("canvas");return!!window.WebGLRenderingContext&&(a.getContext("webgl")||a.getContext("experimental-webgl"))}catch(b){return!1}}(),f=/Android/i.test(navigator.userAgent);return e&&!f?new b.WebGLRenderer(a,c,d):new b.CanvasRenderer(a,c,d)},b.PolyK={},b.PolyK.Triangulate=function(a){var c=!0,d=a.length>>1;if(3>d)return[];for(var e=[],f=[],g=0;d>g;g++)f.push(g);g=0;for(var h=d;h>3;){var i=f[(g+0)%h],j=f[(g+1)%h],k=f[(g+2)%h],l=a[2*i],m=a[2*i+1],n=a[2*j],o=a[2*j+1],p=a[2*k],q=a[2*k+1],r=!1;if(b.PolyK._convex(l,m,n,o,p,q,c)){r=!0;for(var s=0;h>s;s++){var t=f[s];if(t!==i&&t!==j&&t!==k&&b.PolyK._PointInTriangle(a[2*t],a[2*t+1],l,m,n,o,p,q)){r=!1;break}}}if(r)e.push(i,j,k),f.splice((g+1)%h,1),h--,g=0;else if(g++>3*h){if(!c)return null;for(e=[],f=[],g=0;d>g;g++)f.push(g);g=0,h=d,c=!1}}return e.push(f[0],f[1],f[2]),e},b.PolyK._PointInTriangle=function(a,b,c,d,e,f,g,h){var i=g-c,j=h-d,k=e-c,l=f-d,m=a-c,n=b-d,o=i*i+j*j,p=i*k+j*l,q=i*m+j*n,r=k*k+l*l,s=k*m+l*n,t=1/(o*r-p*p),u=(r*q-p*s)*t,v=(o*s-p*q)*t;return u>=0&&v>=0&&1>u+v},b.PolyK._convex=function(a,b,c,d,e,f,g){return(b-d)*(e-c)+(c-a)*(f-d)>=0===g},b.initDefaultShaders=function(){},b.CompileVertexShader=function(a,c){return b._CompileShader(a,c,a.VERTEX_SHADER)},b.CompileFragmentShader=function(a,c){return b._CompileShader(a,c,a.FRAGMENT_SHADER)},b._CompileShader=function(a,b,c){var d=b.join("\n"),e=a.createShader(c);return a.shaderSource(e,d),a.compileShader(e),a.getShaderParameter(e,a.COMPILE_STATUS)?e:(window.console.log(a.getShaderInfoLog(e)),null)},b.compileProgram=function(a,c,d){var e=b.CompileFragmentShader(a,d),f=b.CompileVertexShader(a,c),g=a.createProgram();return a.attachShader(g,f),a.attachShader(g,e),a.linkProgram(g),a.getProgramParameter(g,a.LINK_STATUS)||window.console.log("Could not initialise shaders"),g},b.PixiShader=function(a){this._UID=b._UID++,this.gl=a,this.program=null,this.fragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"],this.textureCount=0,this.firstRun=!0,this.dirty=!0,this.attributes=[],this.init()},b.PixiShader.prototype.constructor=b.PixiShader,b.PixiShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc||b.PixiShader.defaultVertexSrc,this.fragmentSrc);a.useProgram(c),this.uSampler=a.getUniformLocation(c,"uSampler"),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.dimensions=a.getUniformLocation(c,"dimensions"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.aTextureCoord=a.getAttribLocation(c,"aTextureCoord"),this.colorAttribute=a.getAttribLocation(c,"aColor"),-1===this.colorAttribute&&(this.colorAttribute=2),this.attributes=[this.aVertexPosition,this.aTextureCoord,this.colorAttribute];for(var d in this.uniforms)this.uniforms[d].uniformLocation=a.getUniformLocation(c,d);this.initUniforms(),this.program=c},b.PixiShader.prototype.initUniforms=function(){this.textureCount=1;var a,b=this.gl;for(var c in this.uniforms){a=this.uniforms[c];var d=a.type;"sampler2D"===d?(a._init=!1,null!==a.value&&this.initSampler2D(a)):"mat2"===d||"mat3"===d||"mat4"===d?(a.glMatrix=!0,a.glValueLength=1,"mat2"===d?a.glFunc=b.uniformMatrix2fv:"mat3"===d?a.glFunc=b.uniformMatrix3fv:"mat4"===d&&(a.glFunc=b.uniformMatrix4fv)):(a.glFunc=b["uniform"+d],a.glValueLength="2f"===d||"2i"===d?2:"3f"===d||"3i"===d?3:"4f"===d||"4i"===d?4:1)}},b.PixiShader.prototype.initSampler2D=function(a){if(a.value&&a.value.baseTexture&&a.value.baseTexture.hasLoaded){var b=this.gl;if(b.activeTexture(b["TEXTURE"+this.textureCount]),b.bindTexture(b.TEXTURE_2D,a.value.baseTexture._glTextures[b.id]),a.textureData){var c=a.textureData,d=c.magFilter?c.magFilter:b.LINEAR,e=c.minFilter?c.minFilter:b.LINEAR,f=c.wrapS?c.wrapS:b.CLAMP_TO_EDGE,g=c.wrapT?c.wrapT:b.CLAMP_TO_EDGE,h=c.luminance?b.LUMINANCE:b.RGBA;if(c.repeat&&(f=b.REPEAT,g=b.REPEAT),b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!!c.flipY),c.width){var i=c.width?c.width:512,j=c.height?c.height:2,k=c.border?c.border:0;b.texImage2D(b.TEXTURE_2D,0,h,i,j,k,h,b.UNSIGNED_BYTE,null)}else b.texImage2D(b.TEXTURE_2D,0,h,b.RGBA,b.UNSIGNED_BYTE,a.value.baseTexture.source);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,d),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,e),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,f),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,g)}b.uniform1i(a.uniformLocation,this.textureCount),a._init=!0,this.textureCount++}},b.PixiShader.prototype.syncUniforms=function(){this.textureCount=1;var a,c=this.gl;for(var d in this.uniforms)a=this.uniforms[d],1===a.glValueLength?a.glMatrix===!0?a.glFunc.call(c,a.uniformLocation,a.transpose,a.value):a.glFunc.call(c,a.uniformLocation,a.value):2===a.glValueLength?a.glFunc.call(c,a.uniformLocation,a.value.x,a.value.y):3===a.glValueLength?a.glFunc.call(c,a.uniformLocation,a.value.x,a.value.y,a.value.z):4===a.glValueLength?a.glFunc.call(c,a.uniformLocation,a.value.x,a.value.y,a.value.z,a.value.w):"sampler2D"===a.type&&(a._init?(c.activeTexture(c["TEXTURE"+this.textureCount]),a.value.baseTexture._dirty[c.id]?b.instances[c.id].updateTexture(a.value.baseTexture):c.bindTexture(c.TEXTURE_2D,a.value.baseTexture._glTextures[c.id]),c.uniform1i(a.uniformLocation,this.textureCount),this.textureCount++):this.initSampler2D(a))},b.PixiShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},b.PixiShader.defaultVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec4 aColor;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","varying vec2 vTextureCoord;","varying vec4 vColor;","const vec2 center = vec2(-1.0, 1.0);","void main(void) {"," gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = vec4(aColor.rgb * aColor.a, aColor.a);","}"],b.PixiFastShader=function(a){this._UID=b._UID++,this.gl=a,this.program=null,this.fragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform mat3 uMatrix;","varying vec2 vTextureCoord;","varying float vColor;","const vec2 center = vec2(-1.0, 1.0);","void main(void) {"," vec2 v;"," vec2 sv = aVertexPosition * aScale;"," v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);"," v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);"," v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;"," gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"],this.textureCount=0,this.init()},b.PixiFastShader.prototype.constructor=b.PixiFastShader,b.PixiFastShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.uSampler=a.getUniformLocation(c,"uSampler"),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.dimensions=a.getUniformLocation(c,"dimensions"),this.uMatrix=a.getUniformLocation(c,"uMatrix"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.aPositionCoord=a.getAttribLocation(c,"aPositionCoord"),this.aScale=a.getAttribLocation(c,"aScale"),this.aRotation=a.getAttribLocation(c,"aRotation"),this.aTextureCoord=a.getAttribLocation(c,"aTextureCoord"),this.colorAttribute=a.getAttribLocation(c,"aColor"),-1===this.colorAttribute&&(this.colorAttribute=2),this.attributes=[this.aVertexPosition,this.aPositionCoord,this.aScale,this.aRotation,this.aTextureCoord,this.colorAttribute],this.program=c},b.PixiFastShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},b.StripShader=function(a){this._UID=b._UID++,this.gl=a,this.program=null,this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","uniform float alpha;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * alpha;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","varying vec2 vTextureCoord;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);"," vTextureCoord = aTextureCoord;","}"],this.init()},b.StripShader.prototype.constructor=b.StripShader,b.StripShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.uSampler=a.getUniformLocation(c,"uSampler"),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.colorAttribute=a.getAttribLocation(c,"aColor"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.aTextureCoord=a.getAttribLocation(c,"aTextureCoord"),this.attributes=[this.aVertexPosition,this.aTextureCoord],this.translationMatrix=a.getUniformLocation(c,"translationMatrix"),this.alpha=a.getUniformLocation(c,"alpha"),this.program=c},b.StripShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attribute=null},b.PrimitiveShader=function(a){this._UID=b._UID++,this.gl=a,this.program=null,this.fragmentSrc=["precision mediump float;","varying vec4 vColor;","void main(void) {"," gl_FragColor = vColor;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform float alpha;","uniform float flipY;","uniform vec3 tint;","varying vec4 vColor;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);"," vColor = aColor * vec4(tint * alpha, alpha);","}"],this.init()},b.PrimitiveShader.prototype.constructor=b.PrimitiveShader,b.PrimitiveShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.tintColor=a.getUniformLocation(c,"tint"),this.flipY=a.getUniformLocation(c,"flipY"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.colorAttribute=a.getAttribLocation(c,"aColor"),this.attributes=[this.aVertexPosition,this.colorAttribute],this.translationMatrix=a.getUniformLocation(c,"translationMatrix"),this.alpha=a.getUniformLocation(c,"alpha"),this.program=c},b.PrimitiveShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},b.ComplexPrimitiveShader=function(a){this._UID=b._UID++,this.gl=a,this.program=null,this.fragmentSrc=["precision mediump float;","varying vec4 vColor;","void main(void) {"," gl_FragColor = vColor;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform vec3 tint;","uniform float alpha;","uniform vec3 color;","uniform float flipY;","varying vec4 vColor;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);"," vColor = vec4(color * alpha * tint, alpha);","}"],this.init()},b.ComplexPrimitiveShader.prototype.constructor=b.ComplexPrimitiveShader,b.ComplexPrimitiveShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.tintColor=a.getUniformLocation(c,"tint"),this.color=a.getUniformLocation(c,"color"),this.flipY=a.getUniformLocation(c,"flipY"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.attributes=[this.aVertexPosition,this.colorAttribute],this.translationMatrix=a.getUniformLocation(c,"translationMatrix"),this.alpha=a.getUniformLocation(c,"alpha"),this.program=c},b.ComplexPrimitiveShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attribute=null},b.WebGLGraphics=function(){},b.WebGLGraphics.renderGraphics=function(a,c){var d,e=c.gl,f=c.projection,g=c.offset,h=c.shaderManager.primitiveShader;a.dirty&&b.WebGLGraphics.updateGraphics(a,e);for(var i=a._webGL[e.id],j=0;j=6)if(h.points.length<12){g=b.WebGLGraphics.switchMode(d,0);var i=b.WebGLGraphics.buildPoly(h,g);i||(g=b.WebGLGraphics.switchMode(d,1),b.WebGLGraphics.buildComplexPoly(h,g))}else g=b.WebGLGraphics.switchMode(d,1),b.WebGLGraphics.buildComplexPoly(h,g);h.lineWidth>0&&(g=b.WebGLGraphics.switchMode(d,0),b.WebGLGraphics.buildLine(h,g))}else g=b.WebGLGraphics.switchMode(d,0),h.type===b.Graphics.RECT?b.WebGLGraphics.buildRectangle(h,g):h.type===b.Graphics.CIRC||h.type===b.Graphics.ELIP?b.WebGLGraphics.buildCircle(h,g):h.type===b.Graphics.RREC&&b.WebGLGraphics.buildRoundedRectangle(h,g);d.lastIndex++}for(e=0;e=q;q++)p=q/n,h=g(a,c,p),i=g(b,d,p),j=g(c,e,p),k=g(d,f,p),l=g(h,j,p),m=g(i,k,p),o.push(l,m);return o},b.WebGLGraphics.buildCircle=function(a,c){var d,e,f=a.shape,g=f.x,h=f.y;a.type===b.Graphics.CIRC?(d=f.radius,e=f.radius):(d=f.width,e=f.height);var i=40,j=2*Math.PI/i,k=0;if(a.fill){var l=b.hex2rgb(a.fillColor),m=a.fillAlpha,n=l[0]*m,o=l[1]*m,p=l[2]*m,q=c.points,r=c.indices,s=q.length/6;for(r.push(s),k=0;i+1>k;k++)q.push(g,h,n,o,p,m),q.push(g+Math.sin(j*k)*d,h+Math.cos(j*k)*e,n,o,p,m),r.push(s++,s++);r.push(s-1) -}if(a.lineWidth){var t=a.points;for(a.points=[],k=0;i+1>k;k++)a.points.push(g+Math.sin(j*k)*d,h+Math.cos(j*k)*e);b.WebGLGraphics.buildLine(a,c),a.points=t}},b.WebGLGraphics.buildLine=function(a,c){var d=0,e=a.points;if(0!==e.length){if(a.lineWidth%2)for(d=0;dd;d++)l=e[2*(d-1)],m=e[2*(d-1)+1],n=e[2*d],o=e[2*d+1],p=e[2*(d+1)],q=e[2*(d+1)+1],r=-(m-o),s=l-n,F=Math.sqrt(r*r+s*s),r/=F,s/=F,r*=L,s*=L,t=-(o-q),u=n-p,F=Math.sqrt(t*t+u*u),t/=F,u/=F,t*=L,u*=L,x=-s+m-(-s+o),y=-r+n-(-r+l),z=(-r+l)*(-s+o)-(-r+n)*(-s+m),A=-u+q-(-u+o),B=-t+n-(-t+p),C=(-t+p)*(-u+o)-(-t+n)*(-u+q),D=x*B-A*y,Math.abs(D)<.1?(D+=10.1,G.push(n-r,o-s,O,P,Q,N),G.push(n+r,o+s,O,P,Q,N)):(j=(y*C-B*z)/D,k=(A*z-x*C)/D,E=(j-n)*(j-n)+(k-o)+(k-o),E>19600?(v=r-t,w=s-u,F=Math.sqrt(v*v+w*w),v/=F,w/=F,v*=L,w*=L,G.push(n-v,o-w),G.push(O,P,Q,N),G.push(n+v,o+w),G.push(O,P,Q,N),G.push(n-v,o-w),G.push(O,P,Q,N),J++):(G.push(j,k),G.push(O,P,Q,N),G.push(n-(j-n),o-(k-o)),G.push(O,P,Q,N)));for(l=e[2*(I-2)],m=e[2*(I-2)+1],n=e[2*(I-1)],o=e[2*(I-1)+1],r=-(m-o),s=l-n,F=Math.sqrt(r*r+s*s),r/=F,s/=F,r*=L,s*=L,G.push(n-r,o-s),G.push(O,P,Q,N),G.push(n+r,o+s),G.push(O,P,Q,N),H.push(K),d=0;J>d;d++)H.push(K++);H.push(K-1)}},b.WebGLGraphics.buildComplexPoly=function(a,c){var d=a.points.slice();if(!(d.length<6)){var e=c.indices;c.points=d,c.alpha=a.fillAlpha,c.color=b.hex2rgb(a.fillColor);for(var f,g,h=1/0,i=-1/0,j=1/0,k=-1/0,l=0;lf?f:h,i=f>i?f:i,j=j>g?g:j,k=g>k?g:k;d.push(h,j,i,j,i,k,h,k);var m=d.length/2;for(l=0;m>l;l++)e.push(l)}},b.WebGLGraphics.buildPoly=function(a,c){var d=a.points;if(!(d.length<6)){var e=c.points,f=c.indices,g=d.length/2,h=b.hex2rgb(a.fillColor),i=a.fillAlpha,j=h[0]*i,k=h[1]*i,l=h[2]*i,m=b.PolyK.Triangulate(d);if(!m)return!1;var n=e.length/6,o=0;for(o=0;oo;o++)e.push(d[2*o],d[2*o+1],j,k,l,i);return!0}},b.WebGLGraphics.graphicsDataPool=[],b.WebGLGraphicsData=function(a){this.gl=a,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),this.mode=1,this.alpha=1,this.dirty=!0},b.WebGLGraphicsData.prototype.reset=function(){this.points=[],this.indices=[]},b.WebGLGraphicsData.prototype.upload=function(){var a=this.gl;this.glPoints=new b.Float32Array(this.points),a.bindBuffer(a.ARRAY_BUFFER,this.buffer),a.bufferData(a.ARRAY_BUFFER,this.glPoints,a.STATIC_DRAW),this.glIndicies=new b.Uint16Array(this.indices),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.glIndicies,a.STATIC_DRAW),this.dirty=!1},b.glContexts=[],b.instances=[],b.WebGLRenderer=function(a,c,d){if(d)for(var e in b.defaultRenderOptions)"undefined"==typeof d[e]&&(d[e]=b.defaultRenderOptions[e]);else d=b.defaultRenderOptions;b.defaultRenderer||(b.sayHello("webGL"),b.defaultRenderer=this),this.type=b.WEBGL_RENDERER,this.resolution=d.resolution,this.transparent=d.transparent,this.autoResize=d.autoResize||!1,this.preserveDrawingBuffer=d.preserveDrawingBuffer,this.clearBeforeRender=d.clearBeforeRender,this.width=a||800,this.height=c||600,this.view=d.view||document.createElement("canvas"),this.contextLostBound=this.handleContextLost.bind(this),this.contextRestoredBound=this.handleContextRestored.bind(this),this.view.addEventListener("webglcontextlost",this.contextLostBound,!1),this.view.addEventListener("webglcontextrestored",this.contextRestoredBound,!1),this._contextOptions={alpha:this.transparent,antialias:d.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:d.preserveDrawingBuffer},this.projection=new b.Point,this.offset=new b.Point(0,0),this.shaderManager=new b.WebGLShaderManager,this.spriteBatch=new b.WebGLSpriteBatch,this.maskManager=new b.WebGLMaskManager,this.filterManager=new b.WebGLFilterManager,this.stencilManager=new b.WebGLStencilManager,this.blendModeManager=new b.WebGLBlendModeManager,this.renderSession={},this.renderSession.gl=this.gl,this.renderSession.drawCount=0,this.renderSession.shaderManager=this.shaderManager,this.renderSession.maskManager=this.maskManager,this.renderSession.filterManager=this.filterManager,this.renderSession.blendModeManager=this.blendModeManager,this.renderSession.spriteBatch=this.spriteBatch,this.renderSession.stencilManager=this.stencilManager,this.renderSession.renderer=this,this.renderSession.resolution=this.resolution,this.initContext(),this.mapBlendModes()},b.WebGLRenderer.prototype.constructor=b.WebGLRenderer,b.WebGLRenderer.prototype.initContext=function(){var a=this.view.getContext("webgl",this._contextOptions)||this.view.getContext("experimental-webgl",this._contextOptions);if(this.gl=a,!a)throw new Error("This browser does not support webGL. Try using the canvas renderer");this.glContextId=a.id=b.WebGLRenderer.glContextId++,b.glContexts[this.glContextId]=a,b.instances[this.glContextId]=this,a.disable(a.DEPTH_TEST),a.disable(a.CULL_FACE),a.enable(a.BLEND),this.shaderManager.setContext(a),this.spriteBatch.setContext(a),this.maskManager.setContext(a),this.filterManager.setContext(a),this.blendModeManager.setContext(a),this.stencilManager.setContext(a),this.renderSession.gl=this.gl,this.resize(this.width,this.height)},b.WebGLRenderer.prototype.render=function(a){if(!this.contextLost){this.__stage!==a&&(a.interactive&&a.interactionManager.removeEvents(),this.__stage=a),a.updateTransform();var b=this.gl;a._interactive?a._interactiveEventsAdded||(a._interactiveEventsAdded=!0,a.interactionManager.setTarget(this)):a._interactiveEventsAdded&&(a._interactiveEventsAdded=!1,a.interactionManager.setTarget(this)),b.viewport(0,0,this.width,this.height),b.bindFramebuffer(b.FRAMEBUFFER,null),this.clearBeforeRender&&(this.transparent?b.clearColor(0,0,0,0):b.clearColor(a.backgroundColorSplit[0],a.backgroundColorSplit[1],a.backgroundColorSplit[2],1),b.clear(b.COLOR_BUFFER_BIT)),this.renderDisplayObject(a,this.projection)}},b.WebGLRenderer.prototype.renderDisplayObject=function(a,c,d){this.renderSession.blendModeManager.setBlendMode(b.blendModes.NORMAL),this.renderSession.drawCount=0,this.renderSession.flipY=d?-1:1,this.renderSession.projection=c,this.renderSession.offset=this.offset,this.spriteBatch.begin(this.renderSession),this.filterManager.begin(this.renderSession,d),a._renderWebGL(this.renderSession),this.spriteBatch.end()},b.WebGLRenderer.prototype.resize=function(a,b){this.width=a*this.resolution,this.height=b*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px",this.view.style.height=this.height/this.resolution+"px"),this.gl.viewport(0,0,this.width,this.height),this.projection.x=this.width/2/this.resolution,this.projection.y=-this.height/2/this.resolution},b.WebGLRenderer.prototype.updateTexture=function(a){if(a.hasLoaded){var c=this.gl;return a._glTextures[c.id]||(a._glTextures[c.id]=c.createTexture()),c.bindTexture(c.TEXTURE_2D,a._glTextures[c.id]),c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultipliedAlpha),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a.source),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),a.mipmap&&b.isPowerOfTwo(a.width,a.height)?(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR_MIPMAP_LINEAR:c.NEAREST_MIPMAP_NEAREST),c.generateMipmap(c.TEXTURE_2D)):c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),a._powerOf2?(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.REPEAT),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.REPEAT)):(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE)),a._dirty[c.id]=!1,a._glTextures[c.id]}},b.WebGLRenderer.prototype.handleContextLost=function(a){a.preventDefault(),this.contextLost=!0},b.WebGLRenderer.prototype.handleContextRestored=function(){this.initContext();for(var a in b.TextureCache){var c=b.TextureCache[a].baseTexture;c._glTextures=[]}this.contextLost=!1},b.WebGLRenderer.prototype.destroy=function(){this.view.removeEventListener("webglcontextlost",this.contextLostBound),this.view.removeEventListener("webglcontextrestored",this.contextRestoredBound),b.glContexts[this.glContextId]=null,this.projection=null,this.offset=null,this.shaderManager.destroy(),this.spriteBatch.destroy(),this.maskManager.destroy(),this.filterManager.destroy(),this.shaderManager=null,this.spriteBatch=null,this.maskManager=null,this.filterManager=null,this.gl=null,this.renderSession=null},b.WebGLRenderer.prototype.mapBlendModes=function(){var a=this.gl;b.blendModesWebGL||(b.blendModesWebGL=[],b.blendModesWebGL[b.blendModes.NORMAL]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.ADD]=[a.SRC_ALPHA,a.DST_ALPHA],b.blendModesWebGL[b.blendModes.MULTIPLY]=[a.DST_COLOR,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.SCREEN]=[a.SRC_ALPHA,a.ONE],b.blendModesWebGL[b.blendModes.OVERLAY]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.DARKEN]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.LIGHTEN]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.COLOR_DODGE]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.COLOR_BURN]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.HARD_LIGHT]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.SOFT_LIGHT]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.DIFFERENCE]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.EXCLUSION]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.HUE]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.SATURATION]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.COLOR]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.LUMINOSITY]=[a.ONE,a.ONE_MINUS_SRC_ALPHA])},b.WebGLRenderer.glContextId=0,b.WebGLBlendModeManager=function(){this.currentBlendMode=99999},b.WebGLBlendModeManager.prototype.constructor=b.WebGLBlendModeManager,b.WebGLBlendModeManager.prototype.setContext=function(a){this.gl=a},b.WebGLBlendModeManager.prototype.setBlendMode=function(a){if(this.currentBlendMode===a)return!1;this.currentBlendMode=a;var c=b.blendModesWebGL[this.currentBlendMode];return this.gl.blendFunc(c[0],c[1]),!0},b.WebGLBlendModeManager.prototype.destroy=function(){this.gl=null},b.WebGLMaskManager=function(){},b.WebGLMaskManager.prototype.constructor=b.WebGLMaskManager,b.WebGLMaskManager.prototype.setContext=function(a){this.gl=a},b.WebGLMaskManager.prototype.pushMask=function(a,c){var d=c.gl;a.dirty&&b.WebGLGraphics.updateGraphics(a,d),a._webGL[d.id].data.length&&c.stencilManager.pushStencil(a,a._webGL[d.id].data[0],c)},b.WebGLMaskManager.prototype.popMask=function(a,b){var c=this.gl;b.stencilManager.popStencil(a,a._webGL[c.id].data[0],b)},b.WebGLMaskManager.prototype.destroy=function(){this.gl=null},b.WebGLStencilManager=function(){this.stencilStack=[],this.reverse=!0,this.count=0},b.WebGLStencilManager.prototype.setContext=function(a){this.gl=a},b.WebGLStencilManager.prototype.pushStencil=function(a,b,c){var d=this.gl;this.bindGraphics(a,b,c),0===this.stencilStack.length&&(d.enable(d.STENCIL_TEST),d.clear(d.STENCIL_BUFFER_BIT),this.reverse=!0,this.count=0),this.stencilStack.push(b);var e=this.count;d.colorMask(!1,!1,!1,!1),d.stencilFunc(d.ALWAYS,0,255),d.stencilOp(d.KEEP,d.KEEP,d.INVERT),1===b.mode?(d.drawElements(d.TRIANGLE_FAN,b.indices.length-4,d.UNSIGNED_SHORT,0),this.reverse?(d.stencilFunc(d.EQUAL,255-e,255),d.stencilOp(d.KEEP,d.KEEP,d.DECR)):(d.stencilFunc(d.EQUAL,e,255),d.stencilOp(d.KEEP,d.KEEP,d.INCR)),d.drawElements(d.TRIANGLE_FAN,4,d.UNSIGNED_SHORT,2*(b.indices.length-4)),this.reverse?d.stencilFunc(d.EQUAL,255-(e+1),255):d.stencilFunc(d.EQUAL,e+1,255),this.reverse=!this.reverse):(this.reverse?(d.stencilFunc(d.EQUAL,e,255),d.stencilOp(d.KEEP,d.KEEP,d.INCR)):(d.stencilFunc(d.EQUAL,255-e,255),d.stencilOp(d.KEEP,d.KEEP,d.DECR)),d.drawElements(d.TRIANGLE_STRIP,b.indices.length,d.UNSIGNED_SHORT,0),this.reverse?d.stencilFunc(d.EQUAL,e+1,255):d.stencilFunc(d.EQUAL,255-(e+1),255)),d.colorMask(!0,!0,!0,!0),d.stencilOp(d.KEEP,d.KEEP,d.KEEP),this.count++},b.WebGLStencilManager.prototype.bindGraphics=function(a,c,d){this._currentGraphics=a;var e,f=this.gl,g=d.projection,h=d.offset;1===c.mode?(e=d.shaderManager.complexPrimitiveShader,d.shaderManager.setShader(e),f.uniform1f(e.flipY,d.flipY),f.uniformMatrix3fv(e.translationMatrix,!1,a.worldTransform.toArray(!0)),f.uniform2f(e.projectionVector,g.x,-g.y),f.uniform2f(e.offsetVector,-h.x,-h.y),f.uniform3fv(e.tintColor,b.hex2rgb(a.tint)),f.uniform3fv(e.color,c.color),f.uniform1f(e.alpha,a.worldAlpha*c.alpha),f.bindBuffer(f.ARRAY_BUFFER,c.buffer),f.vertexAttribPointer(e.aVertexPosition,2,f.FLOAT,!1,8,0),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,c.indexBuffer)):(e=d.shaderManager.primitiveShader,d.shaderManager.setShader(e),f.uniformMatrix3fv(e.translationMatrix,!1,a.worldTransform.toArray(!0)),f.uniform1f(e.flipY,d.flipY),f.uniform2f(e.projectionVector,g.x,-g.y),f.uniform2f(e.offsetVector,-h.x,-h.y),f.uniform3fv(e.tintColor,b.hex2rgb(a.tint)),f.uniform1f(e.alpha,a.worldAlpha),f.bindBuffer(f.ARRAY_BUFFER,c.buffer),f.vertexAttribPointer(e.aVertexPosition,2,f.FLOAT,!1,24,0),f.vertexAttribPointer(e.colorAttribute,4,f.FLOAT,!1,24,8),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,c.indexBuffer))},b.WebGLStencilManager.prototype.popStencil=function(a,b,c){var d=this.gl;if(this.stencilStack.pop(),this.count--,0===this.stencilStack.length)d.disable(d.STENCIL_TEST);else{var e=this.count;this.bindGraphics(a,b,c),d.colorMask(!1,!1,!1,!1),1===b.mode?(this.reverse=!this.reverse,this.reverse?(d.stencilFunc(d.EQUAL,255-(e+1),255),d.stencilOp(d.KEEP,d.KEEP,d.INCR)):(d.stencilFunc(d.EQUAL,e+1,255),d.stencilOp(d.KEEP,d.KEEP,d.DECR)),d.drawElements(d.TRIANGLE_FAN,4,d.UNSIGNED_SHORT,2*(b.indices.length-4)),d.stencilFunc(d.ALWAYS,0,255),d.stencilOp(d.KEEP,d.KEEP,d.INVERT),d.drawElements(d.TRIANGLE_FAN,b.indices.length-4,d.UNSIGNED_SHORT,0),this.reverse?d.stencilFunc(d.EQUAL,e,255):d.stencilFunc(d.EQUAL,255-e,255)):(this.reverse?(d.stencilFunc(d.EQUAL,e+1,255),d.stencilOp(d.KEEP,d.KEEP,d.DECR)):(d.stencilFunc(d.EQUAL,255-(e+1),255),d.stencilOp(d.KEEP,d.KEEP,d.INCR)),d.drawElements(d.TRIANGLE_STRIP,b.indices.length,d.UNSIGNED_SHORT,0),this.reverse?d.stencilFunc(d.EQUAL,e,255):d.stencilFunc(d.EQUAL,255-e,255)),d.colorMask(!0,!0,!0,!0),d.stencilOp(d.KEEP,d.KEEP,d.KEEP)}},b.WebGLStencilManager.prototype.destroy=function(){this.stencilStack=null,this.gl=null},b.WebGLShaderManager=function(){this.maxAttibs=10,this.attribState=[],this.tempAttribState=[];for(var a=0;ad;d+=6,e+=4)this.indices[d+0]=e+0,this.indices[d+1]=e+1,this.indices[d+2]=e+2,this.indices[d+3]=e+0,this.indices[d+4]=e+2,this.indices[d+5]=e+3;this.drawing=!1,this.currentBatchSize=0,this.currentBaseTexture=null,this.dirty=!0,this.textures=[],this.blendModes=[],this.shaders=[],this.sprites=[],this.defaultShader=new b.AbstractFilter(["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"])},b.WebGLSpriteBatch.prototype.setContext=function(a){this.gl=a,this.vertexBuffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.indices,a.STATIC_DRAW),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferData(a.ARRAY_BUFFER,this.vertices,a.DYNAMIC_DRAW),this.currentBlendMode=99999;var c=new b.PixiShader(a);c.fragmentSrc=this.defaultShader.fragmentSrc,c.uniforms={},c.init(),this.defaultShader.shaders[a.id]=c},b.WebGLSpriteBatch.prototype.begin=function(a){this.renderSession=a,this.shader=this.renderSession.shaderManager.defaultShader,this.start()},b.WebGLSpriteBatch.prototype.end=function(){this.flush()},b.WebGLSpriteBatch.prototype.render=function(a){var b=a.texture;this.currentBatchSize>=this.size&&(this.flush(),this.currentBaseTexture=b.baseTexture);var c=b._uvs;if(c){var d,e,f,g,h=a.anchor.x,i=a.anchor.y;if(b.trim){var j=b.trim;e=j.x-h*j.width,d=e+b.crop.width,g=j.y-i*j.height,f=g+b.crop.height}else d=b.frame.width*(1-h),e=b.frame.width*-h,f=b.frame.height*(1-i),g=b.frame.height*-i;var k=4*this.currentBatchSize*this.vertSize,l=b.baseTexture.resolution,m=a.worldTransform,n=m.a/l,o=m.b/l,p=m.c/l,q=m.d/l,r=m.tx,s=m.ty,t=this.colors,u=this.positions;this.renderSession.roundPixels?(u[k]=n*e+p*g+r|0,u[k+1]=q*g+o*e+s|0,u[k+5]=n*d+p*g+r|0,u[k+6]=q*g+o*d+s|0,u[k+10]=n*d+p*f+r|0,u[k+11]=q*f+o*d+s|0,u[k+15]=n*e+p*f+r|0,u[k+16]=q*f+o*e+s|0):(u[k]=n*e+p*g+r,u[k+1]=q*g+o*e+s,u[k+5]=n*d+p*g+r,u[k+6]=q*g+o*d+s,u[k+10]=n*d+p*f+r,u[k+11]=q*f+o*d+s,u[k+15]=n*e+p*f+r,u[k+16]=q*f+o*e+s),u[k+2]=c.x0,u[k+3]=c.y0,u[k+7]=c.x1,u[k+8]=c.y1,u[k+12]=c.x2,u[k+13]=c.y2,u[k+17]=c.x3,u[k+18]=c.y3;var v=a.tint;t[k+4]=t[k+9]=t[k+14]=t[k+19]=(v>>16)+(65280&v)+((255&v)<<16)+(255*a.worldAlpha<<24),this.sprites[this.currentBatchSize++]=a}},b.WebGLSpriteBatch.prototype.renderTilingSprite=function(a){var c=a.tilingTexture;this.currentBatchSize>=this.size&&(this.flush(),this.currentBaseTexture=c.baseTexture),a._uvs||(a._uvs=new b.TextureUvs);var d=a._uvs;a.tilePosition.x%=c.baseTexture.width*a.tileScaleOffset.x,a.tilePosition.y%=c.baseTexture.height*a.tileScaleOffset.y;var e=a.tilePosition.x/(c.baseTexture.width*a.tileScaleOffset.x),f=a.tilePosition.y/(c.baseTexture.height*a.tileScaleOffset.y),g=a.width/c.baseTexture.width/(a.tileScale.x*a.tileScaleOffset.x),h=a.height/c.baseTexture.height/(a.tileScale.y*a.tileScaleOffset.y);d.x0=0-e,d.y0=0-f,d.x1=1*g-e,d.y1=0-f,d.x2=1*g-e,d.y2=1*h-f,d.x3=0-e,d.y3=1*h-f;var i=a.tint,j=(i>>16)+(65280&i)+((255&i)<<16)+(255*a.alpha<<24),k=this.positions,l=this.colors,m=a.width,n=a.height,o=a.anchor.x,p=a.anchor.y,q=m*(1-o),r=m*-o,s=n*(1-p),t=n*-p,u=4*this.currentBatchSize*this.vertSize,v=c.baseTexture.resolution,w=a.worldTransform,x=w.a/v,y=w.b/v,z=w.c/v,A=w.d/v,B=w.tx,C=w.ty;k[u++]=x*r+z*t+B,k[u++]=A*t+y*r+C,k[u++]=d.x0,k[u++]=d.y0,l[u++]=j,k[u++]=x*q+z*t+B,k[u++]=A*t+y*q+C,k[u++]=d.x1,k[u++]=d.y1,l[u++]=j,k[u++]=x*q+z*s+B,k[u++]=A*s+y*q+C,k[u++]=d.x2,k[u++]=d.y2,l[u++]=j,k[u++]=x*r+z*s+B,k[u++]=A*s+y*r+C,k[u++]=d.x3,k[u++]=d.y3,l[u++]=j,this.sprites[this.currentBatchSize++]=a},b.WebGLSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var a,c=this.gl;if(this.dirty){this.dirty=!1,c.activeTexture(c.TEXTURE0),c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a=this.defaultShader.shaders[c.id];var d=4*this.vertSize;c.vertexAttribPointer(a.aVertexPosition,2,c.FLOAT,!1,d,0),c.vertexAttribPointer(a.aTextureCoord,2,c.FLOAT,!1,d,8),c.vertexAttribPointer(a.colorAttribute,4,c.UNSIGNED_BYTE,!0,d,16)}if(this.currentBatchSize>.5*this.size)c.bufferSubData(c.ARRAY_BUFFER,0,this.vertices);else{var e=this.positions.subarray(0,4*this.currentBatchSize*this.vertSize);c.bufferSubData(c.ARRAY_BUFFER,0,e)}for(var f,g,h,i,j=0,k=0,l=null,m=this.renderSession.blendModeManager.currentBlendMode,n=null,o=!1,p=!1,q=0,r=this.currentBatchSize;r>q;q++){if(i=this.sprites[q],f=i.texture.baseTexture,g=i.blendMode,h=i.shader||this.defaultShader,o=m!==g,p=n!==h,(l!==f||o||p)&&(this.renderBatch(l,j,k),k=q,j=0,l=f,o&&(m=g,this.renderSession.blendModeManager.setBlendMode(m)),p)){n=h,a=n.shaders[c.id],a||(a=new b.PixiShader(c),a.fragmentSrc=n.fragmentSrc,a.uniforms=n.uniforms,a.init(),n.shaders[c.id]=a),this.renderSession.shaderManager.setShader(a),a.dirty&&a.syncUniforms();var s=this.renderSession.projection;c.uniform2f(a.projectionVector,s.x,s.y);var t=this.renderSession.offset;c.uniform2f(a.offsetVector,t.x,t.y)}j++}this.renderBatch(l,j,k),this.currentBatchSize=0}},b.WebGLSpriteBatch.prototype.renderBatch=function(a,b,c){if(0!==b){var d=this.gl;a._dirty[d.id]?this.renderSession.renderer.updateTexture(a):d.bindTexture(d.TEXTURE_2D,a._glTextures[d.id]),d.drawElements(d.TRIANGLES,6*b,d.UNSIGNED_SHORT,6*c*2),this.renderSession.drawCount++}},b.WebGLSpriteBatch.prototype.stop=function(){this.flush(),this.dirty=!0},b.WebGLSpriteBatch.prototype.start=function(){this.dirty=!0},b.WebGLSpriteBatch.prototype.destroy=function(){this.vertices=null,this.indices=null,this.gl.deleteBuffer(this.vertexBuffer),this.gl.deleteBuffer(this.indexBuffer),this.currentBaseTexture=null,this.gl=null},b.WebGLFastSpriteBatch=function(a){this.vertSize=10,this.maxSize=6e3,this.size=this.maxSize;var c=4*this.size*this.vertSize,d=6*this.maxSize;this.vertices=new b.Float32Array(c),this.indices=new b.Uint16Array(d),this.vertexBuffer=null,this.indexBuffer=null,this.lastIndexCount=0;for(var e=0,f=0;d>e;e+=6,f+=4)this.indices[e+0]=f+0,this.indices[e+1]=f+1,this.indices[e+2]=f+2,this.indices[e+3]=f+0,this.indices[e+4]=f+2,this.indices[e+5]=f+3;this.drawing=!1,this.currentBatchSize=0,this.currentBaseTexture=null,this.currentBlendMode=0,this.renderSession=null,this.shader=null,this.matrix=null,this.setContext(a)},b.WebGLFastSpriteBatch.prototype.constructor=b.WebGLFastSpriteBatch,b.WebGLFastSpriteBatch.prototype.setContext=function(a){this.gl=a,this.vertexBuffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.indices,a.STATIC_DRAW),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferData(a.ARRAY_BUFFER,this.vertices,a.DYNAMIC_DRAW)},b.WebGLFastSpriteBatch.prototype.begin=function(a,b){this.renderSession=b,this.shader=this.renderSession.shaderManager.fastShader,this.matrix=a.worldTransform.toArray(!0),this.start()},b.WebGLFastSpriteBatch.prototype.end=function(){this.flush()},b.WebGLFastSpriteBatch.prototype.render=function(a){var b=a.children,c=b[0];if(c.texture._uvs){this.currentBaseTexture=c.texture.baseTexture,c.blendMode!==this.renderSession.blendModeManager.currentBlendMode&&(this.flush(),this.renderSession.blendModeManager.setBlendMode(c.blendMode));for(var d=0,e=b.length;e>d;d++)this.renderSprite(b[d]);this.flush()}},b.WebGLFastSpriteBatch.prototype.renderSprite=function(a){if(a.visible&&(a.texture.baseTexture===this.currentBaseTexture||(this.flush(),this.currentBaseTexture=a.texture.baseTexture,a.texture._uvs))){var b,c,d,e,f,g,h,i,j=this.vertices;if(b=a.texture._uvs,c=a.texture.frame.width,d=a.texture.frame.height,a.texture.trim){var k=a.texture.trim;f=k.x-a.anchor.x*k.width,e=f+a.texture.crop.width,h=k.y-a.anchor.y*k.height,g=h+a.texture.crop.height}else e=a.texture.frame.width*(1-a.anchor.x),f=a.texture.frame.width*-a.anchor.x,g=a.texture.frame.height*(1-a.anchor.y),h=a.texture.frame.height*-a.anchor.y;i=4*this.currentBatchSize*this.vertSize,j[i++]=f,j[i++]=h,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b.x0,j[i++]=b.y1,j[i++]=a.alpha,j[i++]=e,j[i++]=h,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b.x1,j[i++]=b.y1,j[i++]=a.alpha,j[i++]=e,j[i++]=g,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b.x2,j[i++]=b.y2,j[i++]=a.alpha,j[i++]=f,j[i++]=g,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b.x3,j[i++]=b.y3,j[i++]=a.alpha,this.currentBatchSize++,this.currentBatchSize>=this.size&&this.flush()}},b.WebGLFastSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var a=this.gl;if(this.currentBaseTexture._glTextures[a.id]||this.renderSession.renderer.updateTexture(this.currentBaseTexture,a),a.bindTexture(a.TEXTURE_2D,this.currentBaseTexture._glTextures[a.id]),this.currentBatchSize>.5*this.size)a.bufferSubData(a.ARRAY_BUFFER,0,this.vertices);else{var b=this.vertices.subarray(0,4*this.currentBatchSize*this.vertSize);a.bufferSubData(a.ARRAY_BUFFER,0,b)}a.drawElements(a.TRIANGLES,6*this.currentBatchSize,a.UNSIGNED_SHORT,0),this.currentBatchSize=0,this.renderSession.drawCount++}},b.WebGLFastSpriteBatch.prototype.stop=function(){this.flush()},b.WebGLFastSpriteBatch.prototype.start=function(){var a=this.gl;a.activeTexture(a.TEXTURE0),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var b=this.renderSession.projection;a.uniform2f(this.shader.projectionVector,b.x,b.y),a.uniformMatrix3fv(this.shader.uMatrix,!1,this.matrix);var c=4*this.vertSize;a.vertexAttribPointer(this.shader.aVertexPosition,2,a.FLOAT,!1,c,0),a.vertexAttribPointer(this.shader.aPositionCoord,2,a.FLOAT,!1,c,8),a.vertexAttribPointer(this.shader.aScale,2,a.FLOAT,!1,c,16),a.vertexAttribPointer(this.shader.aRotation,1,a.FLOAT,!1,c,24),a.vertexAttribPointer(this.shader.aTextureCoord,2,a.FLOAT,!1,c,28),a.vertexAttribPointer(this.shader.colorAttribute,1,a.FLOAT,!1,c,36)},b.WebGLFilterManager=function(){this.filterStack=[],this.offsetX=0,this.offsetY=0},b.WebGLFilterManager.prototype.constructor=b.WebGLFilterManager,b.WebGLFilterManager.prototype.setContext=function(a){this.gl=a,this.texturePool=[],this.initShaderBuffers()},b.WebGLFilterManager.prototype.begin=function(a,b){this.renderSession=a,this.defaultShader=a.shaderManager.defaultShader;var c=this.renderSession.projection;this.width=2*c.x,this.height=2*-c.y,this.buffer=b},b.WebGLFilterManager.prototype.pushFilter=function(a){var c=this.gl,d=this.renderSession.projection,e=this.renderSession.offset;a._filterArea=a.target.filterArea||a.target.getBounds(),this.filterStack.push(a);var f=a.filterPasses[0];this.offsetX+=a._filterArea.x,this.offsetY+=a._filterArea.y;var g=this.texturePool.pop();g?g.resize(this.width,this.height):g=new b.FilterTexture(this.gl,this.width,this.height),c.bindTexture(c.TEXTURE_2D,g.texture);var h=a._filterArea,i=f.padding;h.x-=i,h.y-=i,h.width+=2*i,h.height+=2*i,h.x<0&&(h.x=0),h.width>this.width&&(h.width=this.width),h.y<0&&(h.y=0),h.height>this.height&&(h.height=this.height),c.bindFramebuffer(c.FRAMEBUFFER,g.frameBuffer),c.viewport(0,0,h.width,h.height),d.x=h.width/2,d.y=-h.height/2,e.x=-h.x,e.y=-h.y,c.colorMask(!0,!0,!0,!0),c.clearColor(0,0,0,0),c.clear(c.COLOR_BUFFER_BIT),a._glFilterTexture=g},b.WebGLFilterManager.prototype.popFilter=function(){var a=this.gl,c=this.filterStack.pop(),d=c._filterArea,e=c._glFilterTexture,f=this.renderSession.projection,g=this.renderSession.offset;if(c.filterPasses.length>1){a.viewport(0,0,d.width,d.height),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),this.vertexArray[0]=0,this.vertexArray[1]=d.height,this.vertexArray[2]=d.width,this.vertexArray[3]=d.height,this.vertexArray[4]=0,this.vertexArray[5]=0,this.vertexArray[6]=d.width,this.vertexArray[7]=0,a.bufferSubData(a.ARRAY_BUFFER,0,this.vertexArray),a.bindBuffer(a.ARRAY_BUFFER,this.uvBuffer),this.uvArray[2]=d.width/this.width,this.uvArray[5]=d.height/this.height,this.uvArray[6]=d.width/this.width,this.uvArray[7]=d.height/this.height,a.bufferSubData(a.ARRAY_BUFFER,0,this.uvArray);var h=e,i=this.texturePool.pop();i||(i=new b.FilterTexture(this.gl,this.width,this.height)),i.resize(this.width,this.height),a.bindFramebuffer(a.FRAMEBUFFER,i.frameBuffer),a.clear(a.COLOR_BUFFER_BIT),a.disable(a.BLEND);for(var j=0;jB?B:A,c.beginPath(),c.moveTo(w,x+A),c.lineTo(w,x+z-A),c.quadraticCurveTo(w,x+z,w+A,x+z),c.lineTo(w+y-A,x+z),c.quadraticCurveTo(w+y,x+z,w+y,x+z-A),c.lineTo(w+y,x+A),c.quadraticCurveTo(w+y,x,w+y-A,x),c.lineTo(w+A,x),c.quadraticCurveTo(w,x,w,x+A),c.closePath(),(f.fillColor||0===f.fillColor)&&(c.globalAlpha=f.fillAlpha*d,c.fillStyle="#"+("00000"+(0|h).toString(16)).substr(-6),c.fill()),f.lineWidth&&(c.globalAlpha=f.lineAlpha*d,c.strokeStyle="#"+("00000"+(0|i).toString(16)).substr(-6),c.stroke())}}},b.CanvasGraphics.renderGraphicsMask=function(a,c){var d=a.graphicsData.length;if(0!==d){d>1&&(d=1,window.console.log("Pixi.js warning: masks in canvas can only mask using the first path in the graphics object"));for(var e=0;1>e;e++){var f=a.graphicsData[e],g=f.shape;if(f.type===b.Graphics.POLY){c.beginPath();var h=g.points;c.moveTo(h[0],h[1]);for(var i=1;iA?A:z,c.beginPath(),c.moveTo(v,w+z),c.lineTo(v,w+y-z),c.quadraticCurveTo(v,w+y,v+z,w+y),c.lineTo(v+x-z,w+y),c.quadraticCurveTo(v+x,w+y,v+x,w+y-z),c.lineTo(v+x,w+z),c.quadraticCurveTo(v+x,w,v+x-z,w),c.lineTo(v+z,w),c.quadraticCurveTo(v,w,v,w+z),c.closePath()}}}},b.CanvasGraphics.updateGraphicsTint=function(a){if(16777215!==a.tint)for(var b=(a.tint>>16&255)/255,c=(a.tint>>8&255)/255,d=(255&a.tint)/255,e=0;e>16&255)/255*b*255<<16)+((g>>8&255)/255*c*255<<8)+(255&g)/255*d*255,f._lineTint=((h>>16&255)/255*b*255<<16)+((h>>8&255)/255*c*255<<8)+(255&h)/255*d*255}},b.Graphics=function(){b.DisplayObjectContainer.call(this),this.renderable=!0,this.fillAlpha=1,this.lineWidth=0,this.lineColor=0,this.graphicsData=[],this.tint=16777215,this.blendMode=b.blendModes.NORMAL,this.currentPath=null,this._webGL=[],this.isMask=!1,this.boundsPadding=0,this._localBounds=new b.Rectangle(0,0,1,1),this.dirty=!0,this.webGLDirty=!1,this.cachedSpriteDirty=!1},b.Graphics.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Graphics.prototype.constructor=b.Graphics,Object.defineProperty(b.Graphics.prototype,"cacheAsBitmap",{get:function(){return this._cacheAsBitmap},set:function(a){this._cacheAsBitmap=a,this._cacheAsBitmap?this._generateCachedSprite():(this.destroyCachedSprite(),this.dirty=!0)}}),b.Graphics.prototype.lineStyle=function(a,c,d){if(this.lineWidth=a||0,this.lineColor=c||0,this.lineAlpha=arguments.length<3?1:d,this.currentPath){if(this.currentPath.shape.points.length)return this.drawShape(new b.Polygon(this.currentPath.shape.points.slice(-2))),this;this.currentPath.lineWidth=this.lineWidth,this.currentPath.lineColor=this.lineColor,this.currentPath.lineAlpha=this.lineAlpha}return this},b.Graphics.prototype.moveTo=function(a,c){return this.drawShape(new b.Polygon([a,c])),this},b.Graphics.prototype.lineTo=function(a,b){return this.currentPath.shape.points.push(a,b),this.dirty=!0,this},b.Graphics.prototype.quadraticCurveTo=function(a,b,c,d){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);var e,f,g=20,h=this.currentPath.shape.points;0===h.length&&this.moveTo(0,0);for(var i=h[h.length-2],j=h[h.length-1],k=0,l=1;g>=l;l++)k=l/g,e=i+(a-i)*k,f=j+(b-j)*k,h.push(e+(a+(c-a)*k-e)*k,f+(b+(d-b)*k-f)*k);return this.dirty=!0,this},b.Graphics.prototype.bezierCurveTo=function(a,b,c,d,e,f){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);for(var g,h,i,j,k,l=20,m=this.currentPath.shape.points,n=m[m.length-2],o=m[m.length-1],p=0,q=1;l>=q;q++)p=q/l,g=1-p,h=g*g,i=h*g,j=p*p,k=j*p,m.push(i*n+3*h*p*a+3*g*j*c+k*e,i*o+3*h*p*b+3*g*j*d+k*f);return this.dirty=!0,this},b.Graphics.prototype.arcTo=function(a,b,c,d,e){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(a,b):this.moveTo(a,b);var f=this.currentPath.shape.points,g=f[f.length-2],h=f[f.length-1],i=h-b,j=g-a,k=d-b,l=c-a,m=Math.abs(i*l-j*k);if(1e-8>m||0===e)(f[f.length-2]!==a||f[f.length-1]!==b)&&f.push(a,b);else{var n=i*i+j*j,o=k*k+l*l,p=i*k+j*l,q=e*Math.sqrt(n)/m,r=e*Math.sqrt(o)/m,s=q*p/n,t=r*p/o,u=q*l+r*j,v=q*k+r*i,w=j*(r+s),x=i*(r+s),y=l*(q+t),z=k*(q+t),A=Math.atan2(x-v,w-u),B=Math.atan2(z-v,y-u);this.arc(u+a,v+b,e,A,B,j*k>l*i)}return this.dirty=!0,this},b.Graphics.prototype.arc=function(a,b,c,d,e,f){var g,h=a+Math.cos(d)*c,i=b+Math.sin(d)*c;if(this.currentPath?(g=this.currentPath.shape.points,0===g.length?g.push(h,i):(g[g.length-2]!==h||g[g.length-1]!==i)&&g.push(h,i)):(this.moveTo(h,i),g=this.currentPath.shape.points),d===e)return this;!f&&d>=e?e+=2*Math.PI:f&&e>=d&&(d+=2*Math.PI);var j=f?-1*(d-e):e-d,k=Math.abs(j)/(2*Math.PI)*40;if(0===j)return this;for(var l=j/(2*k),m=2*l,n=Math.cos(l),o=Math.sin(l),p=k-1,q=p%1/p,r=0;p>=r;r++){var s=r+q*r,t=l+d+m*s,u=Math.cos(t),v=-Math.sin(t);g.push((n*u+o*v)*c+a,(n*-v+o*u)*c+b)}return this.dirty=!0,this},b.Graphics.prototype.beginFill=function(a,b){return this.filling=!0,this.fillColor=a||0,this.fillAlpha=void 0===b?1:b,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},b.Graphics.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},b.Graphics.prototype.drawRect=function(a,c,d,e){return this.drawShape(new b.Rectangle(a,c,d,e)),this},b.Graphics.prototype.drawRoundedRect=function(a,c,d,e,f){return this.drawShape(new b.RoundedRectangle(a,c,d,e,f)),this},b.Graphics.prototype.drawCircle=function(a,c,d){return this.drawShape(new b.Circle(a,c,d)),this},b.Graphics.prototype.drawEllipse=function(a,c,d,e){return this.drawShape(new b.Ellipse(a,c,d,e)),this},b.Graphics.prototype.drawPolygon=function(a){return a instanceof Array||(a=Array.prototype.slice.call(arguments)),this.drawShape(new b.Polygon(a)),this},b.Graphics.prototype.clear=function(){return this.lineWidth=0,this.filling=!1,this.dirty=!0,this.clearDirty=!0,this.graphicsData=[],this},b.Graphics.prototype.generateTexture=function(a,c){a=a||1;var d=this.getBounds(),e=new b.CanvasBuffer(d.width*a,d.height*a),f=b.Texture.fromCanvas(e.canvas,c);return f.baseTexture.resolution=a,e.context.scale(a,a),e.context.translate(-d.x,-d.y),b.CanvasGraphics.renderGraphics(this,e.context),f},b.Graphics.prototype._renderWebGL=function(a){if(this.visible!==!1&&0!==this.alpha&&this.isMask!==!0){if(this._cacheAsBitmap)return(this.dirty||this.cachedSpriteDirty)&&(this._generateCachedSprite(),this.updateCachedSpriteTexture(),this.cachedSpriteDirty=!1,this.dirty=!1),this._cachedSprite.worldAlpha=this.worldAlpha,void b.Sprite.prototype._renderWebGL.call(this._cachedSprite,a);if(a.spriteBatch.stop(),a.blendModeManager.setBlendMode(this.blendMode),this._mask&&a.maskManager.pushMask(this._mask,a),this._filters&&a.filterManager.pushFilter(this._filterBlock),this.blendMode!==a.spriteBatch.currentBlendMode){a.spriteBatch.currentBlendMode=this.blendMode;var c=b.blendModesWebGL[a.spriteBatch.currentBlendMode];a.spriteBatch.gl.blendFunc(c[0],c[1])}if(this.webGLDirty&&(this.dirty=!0,this.webGLDirty=!1),b.WebGLGraphics.renderGraphics(this,a),this.children.length){a.spriteBatch.start();for(var d=0,e=this.children.length;e>d;d++)this.children[d]._renderWebGL(a);a.spriteBatch.stop()}this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(this.mask,a),a.drawCount++,a.spriteBatch.start()}},b.Graphics.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha&&this.isMask!==!0){if(this._cacheAsBitmap)return(this.dirty||this.cachedSpriteDirty)&&(this._generateCachedSprite(),this.updateCachedSpriteTexture(),this.cachedSpriteDirty=!1,this.dirty=!1),this._cachedSprite.alpha=this.alpha,void b.Sprite.prototype._renderCanvas.call(this._cachedSprite,a);var c=a.context,d=this.worldTransform;this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,c.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]),this._mask&&a.maskManager.pushMask(this._mask,a);var e=a.resolution;c.setTransform(d.a*e,d.b*e,d.c*e,d.d*e,d.tx*e,d.ty*e),b.CanvasGraphics.renderGraphics(this,c);for(var f=0,g=this.children.length;g>f;f++)this.children[f]._renderCanvas(a);this._mask&&a.maskManager.popMask(a)}},b.Graphics.prototype.getBounds=function(a){if(this.isMask)return b.EmptyRectangle;this.dirty&&(this.updateLocalBounds(),this.webGLDirty=!0,this.cachedSpriteDirty=!0,this.dirty=!1);var c=this._localBounds,d=c.x,e=c.width+c.x,f=c.y,g=c.height+c.y,h=a||this.worldTransform,i=h.a,j=h.b,k=h.c,l=h.d,m=h.tx,n=h.ty,o=i*e+k*g+m,p=l*g+j*e+n,q=i*d+k*g+m,r=l*g+j*d+n,s=i*d+k*f+m,t=l*f+j*d+n,u=i*e+k*f+m,v=l*f+j*e+n,w=o,x=p,y=o,z=p;return y=y>q?q:y,y=y>s?s:y,y=y>u?u:y,z=z>r?r:z,z=z>t?t:z,z=z>v?v:z,w=q>w?q:w,w=s>w?s:w,w=u>w?u:w,x=r>x?r:x,x=t>x?t:x,x=v>x?v:x,this._bounds.x=y,this._bounds.width=w-y,this._bounds.y=z,this._bounds.height=x-z,this._bounds},b.Graphics.prototype.updateLocalBounds=function(){var a=1/0,c=-1/0,d=1/0,e=-1/0;if(this.graphicsData.length)for(var f,g,h,i,j,k,l=0;lh?h:a,c=h+j>c?h+j:c,d=d>i?i:d,e=i+k>e?i+k:e;else if(n===b.Graphics.CIRC)h=f.x,i=f.y,j=f.radius+o/2,k=f.radius+o/2,a=a>h-j?h-j:a,c=h+j>c?h+j:c,d=d>i-k?i-k:d,e=i+k>e?i+k:e;else if(n===b.Graphics.ELIP)h=f.x,i=f.y,j=f.width+o/2,k=f.height+o/2,a=a>h-j?h-j:a,c=h+j>c?h+j:c,d=d>i-k?i-k:d,e=i+k>e?i+k:e;else{g=f.points;for(var p=0;ph-o?h-o:a,c=h+o>c?h+o:c,d=d>i-o?i-o:d,e=i+o>e?i+o:e}}else a=0,c=0,d=0,e=0;var q=this.boundsPadding;this._localBounds.x=a-q,this._localBounds.width=c-a+2*q,this._localBounds.y=d-q,this._localBounds.height=e-d+2*q},b.Graphics.prototype._generateCachedSprite=function(){var a=this.getLocalBounds();if(this._cachedSprite)this._cachedSprite.buffer.resize(a.width,a.height);else{var c=new b.CanvasBuffer(a.width,a.height),d=b.Texture.fromCanvas(c.canvas);this._cachedSprite=new b.Sprite(d),this._cachedSprite.buffer=c,this._cachedSprite.worldTransform=this.worldTransform}this._cachedSprite.anchor.x=-(a.x/a.width),this._cachedSprite.anchor.y=-(a.y/a.height),this._cachedSprite.buffer.context.translate(-a.x,-a.y),this.worldAlpha=1,b.CanvasGraphics.renderGraphics(this,this._cachedSprite.buffer.context),this._cachedSprite.alpha=this.alpha},b.Graphics.prototype.updateCachedSpriteTexture=function(){var a=this._cachedSprite,b=a.texture,c=a.buffer.canvas;b.baseTexture.width=c.width,b.baseTexture.height=c.height,b.crop.width=b.frame.width=c.width,b.crop.height=b.frame.height=c.height,a._width=c.width,a._height=c.height,b.baseTexture.dirty()},b.Graphics.prototype.destroyCachedSprite=function(){this._cachedSprite.texture.destroy(!0),this._cachedSprite=null},b.Graphics.prototype.drawShape=function(a){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null;var c=new b.GraphicsData(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,a);return this.graphicsData.push(c),c.type===b.Graphics.POLY&&(c.shape.closed=this.filling,this.currentPath=c),this.dirty=!0,c},b.GraphicsData=function(a,b,c,d,e,f,g){this.lineWidth=a,this.lineColor=b,this.lineAlpha=c,this._lineTint=b,this.fillColor=d,this.fillAlpha=e,this._fillTint=d,this.fill=f,this.shape=g,this.type=g.type},b.Graphics.POLY=0,b.Graphics.RECT=1,b.Graphics.CIRC=2,b.Graphics.ELIP=3,b.Graphics.RREC=4,b.Polygon.prototype.type=b.Graphics.POLY,b.Rectangle.prototype.type=b.Graphics.RECT,b.Circle.prototype.type=b.Graphics.CIRC,b.Ellipse.prototype.type=b.Graphics.ELIP,b.RoundedRectangle.prototype.type=b.Graphics.RREC,b.Strip=function(a){b.DisplayObjectContainer.call(this),this.texture=a,this.uvs=new b.Float32Array([0,1,1,1,1,0,0,1]),this.vertices=new b.Float32Array([0,0,100,0,100,100,0,100]),this.colors=new b.Float32Array([1,1,1,1]),this.indices=new b.Uint16Array([0,1,2,3]),this.dirty=!0,this.blendMode=b.blendModes.NORMAL,this.canvasPadding=0,this.drawMode=b.Strip.DrawModes.TRIANGLE_STRIP},b.Strip.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Strip.prototype.constructor=b.Strip,b.Strip.prototype._renderWebGL=function(a){!this.visible||this.alpha<=0||(a.spriteBatch.stop(),this._vertexBuffer||this._initWebGL(a),a.shaderManager.setShader(a.shaderManager.stripShader),this._renderStrip(a),a.spriteBatch.start())},b.Strip.prototype._initWebGL=function(a){var b=a.gl;this._vertexBuffer=b.createBuffer(),this._indexBuffer=b.createBuffer(),this._uvBuffer=b.createBuffer(),this._colorBuffer=b.createBuffer(),b.bindBuffer(b.ARRAY_BUFFER,this._vertexBuffer),b.bufferData(b.ARRAY_BUFFER,this.vertices,b.DYNAMIC_DRAW),b.bindBuffer(b.ARRAY_BUFFER,this._uvBuffer),b.bufferData(b.ARRAY_BUFFER,this.uvs,b.STATIC_DRAW),b.bindBuffer(b.ARRAY_BUFFER,this._colorBuffer),b.bufferData(b.ARRAY_BUFFER,this.colors,b.STATIC_DRAW),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this._indexBuffer),b.bufferData(b.ELEMENT_ARRAY_BUFFER,this.indices,b.STATIC_DRAW)},b.Strip.prototype._renderStrip=function(a){var c=a.gl,d=a.projection,e=a.offset,f=a.shaderManager.stripShader,g=this.drawMode===b.Strip.DrawModes.TRIANGLE_STRIP?c.TRIANGLE_STRIP:c.TRIANGLES;a.blendModeManager.setBlendMode(this.blendMode),c.uniformMatrix3fv(f.translationMatrix,!1,this.worldTransform.toArray(!0)),c.uniform2f(f.projectionVector,d.x,-d.y),c.uniform2f(f.offsetVector,-e.x,-e.y),c.uniform1f(f.alpha,this.worldAlpha),this.dirty?(this.dirty=!1,c.bindBuffer(c.ARRAY_BUFFER,this._vertexBuffer),c.bufferData(c.ARRAY_BUFFER,this.vertices,c.STATIC_DRAW),c.vertexAttribPointer(f.aVertexPosition,2,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,this._uvBuffer),c.bufferData(c.ARRAY_BUFFER,this.uvs,c.STATIC_DRAW),c.vertexAttribPointer(f.aTextureCoord,2,c.FLOAT,!1,0,0),c.activeTexture(c.TEXTURE0),this.texture.baseTexture._dirty[c.id]?a.renderer.updateTexture(this.texture.baseTexture):c.bindTexture(c.TEXTURE_2D,this.texture.baseTexture._glTextures[c.id]),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this._indexBuffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,this.indices,c.STATIC_DRAW)):(c.bindBuffer(c.ARRAY_BUFFER,this._vertexBuffer),c.bufferSubData(c.ARRAY_BUFFER,0,this.vertices),c.vertexAttribPointer(f.aVertexPosition,2,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,this._uvBuffer),c.vertexAttribPointer(f.aTextureCoord,2,c.FLOAT,!1,0,0),c.activeTexture(c.TEXTURE0),this.texture.baseTexture._dirty[c.id]?a.renderer.updateTexture(this.texture.baseTexture):c.bindTexture(c.TEXTURE_2D,this.texture.baseTexture._glTextures[c.id]),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this._indexBuffer)),c.drawElements(g,this.indices.length,c.UNSIGNED_SHORT,0)},b.Strip.prototype._renderCanvas=function(a){var c=a.context,d=this.worldTransform;a.roundPixels?c.setTransform(d.a,d.b,d.c,d.d,0|d.tx,0|d.ty):c.setTransform(d.a,d.b,d.c,d.d,d.tx,d.ty),this.drawMode===b.Strip.DrawModes.TRIANGLE_STRIP?this._renderCanvasTriangleStrip(c):this._renderCanvasTriangles(c)},b.Strip.prototype._renderCanvasTriangleStrip=function(a){var b=this.vertices,c=this.uvs,d=b.length/2;this.count++;for(var e=0;d-2>e;e++){var f=2*e;this._renderCanvasDrawTriangle(a,b,c,f,f+2,f+4)}},b.Strip.prototype._renderCanvasTriangles=function(a){var b=this.vertices,c=this.uvs,d=this.indices,e=d.length;this.count++;for(var f=0;e>f;f+=3){var g=2*d[f],h=2*d[f+1],i=2*d[f+2];this._renderCanvasDrawTriangle(a,b,c,g,h,i)}},b.Strip.prototype._renderCanvasDrawTriangle=function(a,b,c,d,e,f){var g=this.texture.baseTexture.source,h=this.texture.width,i=this.texture.height,j=b[d],k=b[e],l=b[f],m=b[d+1],n=b[e+1],o=b[f+1],p=c[d]*h,q=c[e]*h,r=c[f]*h,s=c[d+1]*i,t=c[e+1]*i,u=c[f+1]*i;if(this.canvasPadding>0){var v=this.canvasPadding/this.worldTransform.a,w=this.canvasPadding/this.worldTransform.d,x=(j+k+l)/3,y=(m+n+o)/3,z=j-x,A=m-y,B=Math.sqrt(z*z+A*A);j=x+z/B*(B+v),m=y+A/B*(B+w),z=k-x,A=n-y,B=Math.sqrt(z*z+A*A),k=x+z/B*(B+v),n=y+A/B*(B+w),z=l-x,A=o-y,B=Math.sqrt(z*z+A*A),l=x+z/B*(B+v),o=y+A/B*(B+w)}a.save(),a.beginPath(),a.moveTo(j,m),a.lineTo(k,n),a.lineTo(l,o),a.closePath(),a.clip();var C=p*t+s*r+q*u-t*r-s*q-p*u,D=j*t+s*l+k*u-t*l-s*k-j*u,E=p*k+j*r+q*l-k*r-j*q-p*l,F=p*t*l+s*k*r+j*q*u-j*t*r-s*q*l-p*k*u,G=m*t+s*o+n*u-t*o-s*n-m*u,H=p*n+m*r+q*o-n*r-m*q-p*o,I=p*t*o+s*n*r+m*q*u-m*t*r-s*q*o-p*n*u;a.transform(D/C,G/C,E/C,H/C,F/C,I/C),a.drawImage(g,0,0),a.restore()},b.Strip.prototype.renderStripFlat=function(a){var b=this.context,c=a.vertices,d=c.length/2;this.count++,b.beginPath();for(var e=1;d-2>e;e++){var f=2*e,g=c[f],h=c[f+2],i=c[f+4],j=c[f+1],k=c[f+3],l=c[f+5];b.moveTo(g,j),b.lineTo(h,k),b.lineTo(i,l)}b.fillStyle="#FF0000",b.fill(),b.closePath()},b.Strip.prototype.onTextureUpdate=function(){this.updateFrame=!0},b.Strip.prototype.getBounds=function(a){for(var c=a||this.worldTransform,d=c.a,e=c.b,f=c.c,g=c.d,h=c.tx,i=c.ty,j=-1/0,k=-1/0,l=1/0,m=1/0,n=this.vertices,o=0,p=n.length;p>o;o+=2){var q=n[o],r=n[o+1],s=d*q+f*r+h,t=g*r+e*q+i;l=l>s?s:l,m=m>t?t:m,j=s>j?s:j,k=t>k?t:k}if(l===-1/0||1/0===k)return b.EmptyRectangle;var u=this._bounds;return u.x=l,u.width=j-l,u.y=m,u.height=k-m,this._currentBounds=u,u},b.Strip.DrawModes={TRIANGLE_STRIP:0,TRIANGLES:1},b.Rope=function(a,c){b.Strip.call(this,a),this.points=c,this.vertices=new b.Float32Array(4*c.length),this.uvs=new b.Float32Array(4*c.length),this.colors=new b.Float32Array(2*c.length),this.indices=new b.Uint16Array(2*c.length),this.refresh()},b.Rope.prototype=Object.create(b.Strip.prototype),b.Rope.prototype.constructor=b.Rope,b.Rope.prototype.refresh=function(){var a=this.points;if(!(a.length<1)){var b=this.uvs,c=a[0],d=this.indices,e=this.colors;this.count-=.2,b[0]=0,b[1]=0,b[2]=0,b[3]=1,e[0]=1,e[1]=1,d[0]=0,d[1]=1;for(var f,g,h,i=a.length,j=1;i>j;j++)f=a[j],g=4*j,h=j/(i-1),j%2?(b[g]=h,b[g+1]=0,b[g+2]=h,b[g+3]=1):(b[g]=h,b[g+1]=0,b[g+2]=h,b[g+3]=1),g=2*j,e[g]=1,e[g+1]=1,g=2*j,d[g]=g,d[g+1]=g+1,c=f}},b.Rope.prototype.updateTransform=function(){var a=this.points;if(!(a.length<1)){var c,d=a[0],e={x:0,y:0};this.count-=.2;for(var f,g,h,i,j,k=this.vertices,l=a.length,m=0;l>m;m++)f=a[m],g=4*m,c=m1&&(h=1),i=Math.sqrt(e.x*e.x+e.y*e.y),j=this.texture.height/2,e.x/=i,e.y/=i,e.x*=j,e.y*=j,k[g]=f.x+e.x,k[g+1]=f.y+e.y,k[g+2]=f.x-e.x,k[g+3]=f.y-e.y,d=f;b.DisplayObjectContainer.prototype.updateTransform.call(this)}},b.Rope.prototype.setTexture=function(a){this.texture=a},b.TilingSprite=function(a,c,d){b.Sprite.call(this,a),this._width=c||100,this._height=d||100,this.tileScale=new b.Point(1,1),this.tileScaleOffset=new b.Point(1,1),this.tilePosition=new b.Point(0,0),this.renderable=!0,this.tint=16777215,this.blendMode=b.blendModes.NORMAL},b.TilingSprite.prototype=Object.create(b.Sprite.prototype),b.TilingSprite.prototype.constructor=b.TilingSprite,Object.defineProperty(b.TilingSprite.prototype,"width",{get:function(){return this._width},set:function(a){this._width=a}}),Object.defineProperty(b.TilingSprite.prototype,"height",{get:function(){return this._height},set:function(a){this._height=a}}),b.TilingSprite.prototype.setTexture=function(a){this.texture!==a&&(this.texture=a,this.refreshTexture=!0,this.cachedTint=16777215)},b.TilingSprite.prototype._renderWebGL=function(a){if(this.visible!==!1&&0!==this.alpha){var b,c;for(this._mask&&(a.spriteBatch.stop(),a.maskManager.pushMask(this.mask,a),a.spriteBatch.start()),this._filters&&(a.spriteBatch.flush(),a.filterManager.pushFilter(this._filterBlock)),!this.tilingTexture||this.refreshTexture?(this.generateTilingTexture(!0),this.tilingTexture&&this.tilingTexture.needsUpdate&&(a.renderer.updateTexture(this.tilingTexture.baseTexture),this.tilingTexture.needsUpdate=!1)):a.spriteBatch.renderTilingSprite(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a); -a.spriteBatch.stop(),this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(this._mask,a),a.spriteBatch.start()}},b.TilingSprite.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){var c=a.context;this._mask&&a.maskManager.pushMask(this._mask,a),c.globalAlpha=this.worldAlpha;var d,e,f=this.worldTransform,g=a.resolution;if(c.setTransform(f.a*g,f.b*g,f.c*g,f.d*g,f.tx*g,f.ty*g),!this.__tilePattern||this.refreshTexture){if(this.generateTilingTexture(!1),!this.tilingTexture)return;this.__tilePattern=c.createPattern(this.tilingTexture.baseTexture.source,"repeat")}this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,c.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]);var h=this.tilePosition,i=this.tileScale;for(h.x%=this.tilingTexture.baseTexture.width,h.y%=this.tilingTexture.baseTexture.height,c.scale(i.x,i.y),c.translate(h.x+this.anchor.x*-this._width,h.y+this.anchor.y*-this._height),c.fillStyle=this.__tilePattern,c.fillRect(-h.x,-h.y,this._width/i.x,this._height/i.y),c.scale(1/i.x,1/i.y),c.translate(-h.x+this.anchor.x*this._width,-h.y+this.anchor.y*this._height),this._mask&&a.maskManager.popMask(a),d=0,e=this.children.length;e>d;d++)this.children[d]._renderCanvas(a)}},b.TilingSprite.prototype.getBounds=function(){var a=this._width,b=this._height,c=a*(1-this.anchor.x),d=a*-this.anchor.x,e=b*(1-this.anchor.y),f=b*-this.anchor.y,g=this.worldTransform,h=g.a,i=g.b,j=g.c,k=g.d,l=g.tx,m=g.ty,n=h*d+j*f+l,o=k*f+i*d+m,p=h*c+j*f+l,q=k*f+i*c+m,r=h*c+j*e+l,s=k*e+i*c+m,t=h*d+j*e+l,u=k*e+i*d+m,v=-1/0,w=-1/0,x=1/0,y=1/0;x=x>n?n:x,x=x>p?p:x,x=x>r?r:x,x=x>t?t:x,y=y>o?o:y,y=y>q?q:y,y=y>s?s:y,y=y>u?u:y,v=n>v?n:v,v=p>v?p:v,v=r>v?r:v,v=t>v?t:v,w=o>w?o:w,w=q>w?q:w,w=s>w?s:w,w=u>w?u:w;var z=this._bounds;return z.x=x,z.width=v-x,z.y=y,z.height=w-y,this._currentBounds=z,z},b.TilingSprite.prototype.onTextureUpdate=function(){},b.TilingSprite.prototype.generateTilingTexture=function(a){if(this.texture.baseTexture.hasLoaded){var c,d,e=this.originalTexture||this.texture,f=e.frame,g=f.width!==e.baseTexture.width||f.height!==e.baseTexture.height,h=!1;if(a?(c=b.getNextPowerOfTwo(f.width),d=b.getNextPowerOfTwo(f.height),(f.width!==c||f.height!==d||e.baseTexture.width!==c||e.baseTexture.height||d)&&(h=!0)):g&&(e.trim?(c=e.trim.width,d=e.trim.height):(c=f.width,d=f.height),h=!0),h){var i;this.tilingTexture&&this.tilingTexture.isTiling?(i=this.tilingTexture.canvasBuffer,i.resize(c,d),this.tilingTexture.baseTexture.width=c,this.tilingTexture.baseTexture.height=d,this.tilingTexture.needsUpdate=!0):(i=new b.CanvasBuffer(c,d),this.tilingTexture=b.Texture.fromCanvas(i.canvas),this.tilingTexture.canvasBuffer=i,this.tilingTexture.isTiling=!0),i.context.drawImage(e.baseTexture.source,e.crop.x,e.crop.y,e.crop.width,e.crop.height,0,0,c,d),this.tileScaleOffset.x=f.width/c,this.tileScaleOffset.y=f.height/d}else this.tilingTexture&&this.tilingTexture.isTiling&&this.tilingTexture.destroy(!0),this.tileScaleOffset.x=1,this.tileScaleOffset.y=1,this.tilingTexture=e;this.refreshTexture=!1,this.originalTexture=this.texture,this.texture=this.tilingTexture,this.tilingTexture.baseTexture._powerOf2=!0}},b.TilingSprite.prototype.destroy=function(){b.Sprite.prototype.destroy.call(this),this.tileScale=null,this.tileScaleOffset=null,this.tilePosition=null,this.tilingTexture.destroy(!0),this.tilingTexture=null};var c={radDeg:180/Math.PI,degRad:Math.PI/180,temp:[],Float32Array:"undefined"==typeof Float32Array?Array:Float32Array,Uint16Array:"undefined"==typeof Uint16Array?Array:Uint16Array};c.BoneData=function(a,b){this.name=a,this.parent=b},c.BoneData.prototype={length:0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,inheritScale:!0,inheritRotation:!0,flipX:!1,flipY:!1},c.SlotData=function(a,b){this.name=a,this.boneData=b},c.SlotData.prototype={r:1,g:1,b:1,a:1,attachmentName:null,additiveBlending:!1},c.IkConstraintData=function(a){this.name=a,this.bones=[]},c.IkConstraintData.prototype={target:null,bendDirection:1,mix:1},c.Bone=function(a,b,c){this.data=a,this.skeleton=b,this.parent=c,this.setToSetupPose()},c.Bone.yDown=!1,c.Bone.prototype={x:0,y:0,rotation:0,rotationIK:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,m00:0,m01:0,worldX:0,m10:0,m11:0,worldY:0,worldRotation:0,worldScaleX:1,worldScaleY:1,worldFlipX:!1,worldFlipY:!1,updateWorldTransform:function(){var a=this.parent;if(a)this.worldX=this.x*a.m00+this.y*a.m01+a.worldX,this.worldY=this.x*a.m10+this.y*a.m11+a.worldY,this.data.inheritScale?(this.worldScaleX=a.worldScaleX*this.scaleX,this.worldScaleY=a.worldScaleY*this.scaleY):(this.worldScaleX=this.scaleX,this.worldScaleY=this.scaleY),this.worldRotation=this.data.inheritRotation?a.worldRotation+this.rotationIK:this.rotationIK,this.worldFlipX=a.worldFlipX!=this.flipX,this.worldFlipY=a.worldFlipY!=this.flipY;else{var b=this.skeleton.flipX,d=this.skeleton.flipY;this.worldX=b?-this.x:this.x,this.worldY=d!=c.Bone.yDown?-this.y:this.y,this.worldScaleX=this.scaleX,this.worldScaleY=this.scaleY,this.worldRotation=this.rotationIK,this.worldFlipX=b!=this.flipX,this.worldFlipY=d!=this.flipY}var e=this.worldRotation*c.degRad,f=Math.cos(e),g=Math.sin(e);this.worldFlipX?(this.m00=-f*this.worldScaleX,this.m01=g*this.worldScaleY):(this.m00=f*this.worldScaleX,this.m01=-g*this.worldScaleY),this.worldFlipY!=c.Bone.yDown?(this.m10=-g*this.worldScaleX,this.m11=-f*this.worldScaleY):(this.m10=g*this.worldScaleX,this.m11=f*this.worldScaleY)},setToSetupPose:function(){var a=this.data;this.x=a.x,this.y=a.y,this.rotation=a.rotation,this.rotationIK=this.rotation,this.scaleX=a.scaleX,this.scaleY=a.scaleY,this.flipX=a.flipX,this.flipY=a.flipY},worldToLocal:function(a){var b=a[0]-this.worldX,d=a[1]-this.worldY,e=this.m00,f=this.m10,g=this.m01,h=this.m11;this.worldFlipX!=(this.worldFlipY!=c.Bone.yDown)&&(e=-e,h=-h);var i=1/(e*h-g*f);a[0]=b*e*i-d*g*i,a[1]=d*h*i-b*f*i},localToWorld:function(a){var b=a[0],c=a[1];a[0]=b*this.m00+c*this.m01+this.worldX,a[1]=b*this.m10+c*this.m11+this.worldY}},c.Slot=function(a,b){this.data=a,this.bone=b,this.setToSetupPose()},c.Slot.prototype={r:1,g:1,b:1,a:1,_attachmentTime:0,attachment:null,attachmentVertices:[],setAttachment:function(a){this.attachment=a,this._attachmentTime=this.bone.skeleton.time,this.attachmentVertices.length=0},setAttachmentTime:function(a){this._attachmentTime=this.bone.skeleton.time-a},getAttachmentTime:function(){return this.bone.skeleton.time-this._attachmentTime},setToSetupPose:function(){var a=this.data;this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a;for(var b=this.bone.skeleton.data.slots,c=0,d=b.length;d>c;c++)if(b[c]==a){this.setAttachment(a.attachmentName?this.bone.skeleton.getAttachmentBySlotIndex(c,a.attachmentName):null);break}}},c.IkConstraint=function(a,b){this.data=a,this.mix=a.mix,this.bendDirection=a.bendDirection,this.bones=[];for(var c=0,d=a.bones.length;d>c;c++)this.bones.push(b.findBone(a.bones[c].name));this.target=b.findBone(a.target.name)},c.IkConstraint.prototype={apply:function(){var a=this.target,b=this.bones;switch(b.length){case 1:c.IkConstraint.apply1(b[0],a.worldX,a.worldY,this.mix);break;case 2:c.IkConstraint.apply2(b[0],b[1],a.worldX,a.worldY,this.bendDirection,this.mix)}}},c.IkConstraint.apply1=function(a,b,d,e){var f=a.data.inheritRotation&&a.parent?a.parent.worldRotation:0,g=a.rotation,h=Math.atan2(d-a.worldY,b-a.worldX)*c.radDeg-f;a.rotationIK=g+(h-g)*e},c.IkConstraint.apply2=function(a,b,d,e,f,g){var h=b.rotation,i=a.rotation;if(!g)return b.rotationIK=h,void(a.rotationIK=i);var j,k,l=c.temp,m=a.parent;m?(l[0]=d,l[1]=e,m.worldToLocal(l),d=(l[0]-a.x)*m.worldScaleX,e=(l[1]-a.y)*m.worldScaleY):(d-=a.x,e-=a.y),b.parent==a?(j=b.x,k=b.y):(l[0]=b.x,l[1]=b.y,b.parent.localToWorld(l),a.worldToLocal(l),j=l[0],k=l[1]);var n=j*a.worldScaleX,o=k*a.worldScaleY,p=Math.atan2(o,n),q=Math.sqrt(n*n+o*o),r=b.data.length*b.worldScaleX,s=2*q*r;if(1e-4>s)return void(b.rotationIK=h+(Math.atan2(e,d)*c.radDeg-i-h)*g);var t=(d*d+e*e-q*q-r*r)/s;-1>t?t=-1:t>1&&(t=1);var u=Math.acos(t)*f,v=q+r*t,w=r*Math.sin(u),x=Math.atan2(e*v-d*w,d*v+e*w),y=(x-p)*c.radDeg-i;y>180?y-=360:-180>y&&(y+=360),a.rotationIK=i+y*g,y=(u+p)*c.radDeg-h,y>180?y-=360:-180>y&&(y+=360),b.rotationIK=h+(y+a.worldRotation-b.parent.worldRotation)*g},c.Skin=function(a){this.name=a,this.attachments={}},c.Skin.prototype={addAttachment:function(a,b,c){this.attachments[a+":"+b]=c},getAttachment:function(a,b){return this.attachments[a+":"+b]},_attachAll:function(a,b){for(var c in b.attachments){var d=c.indexOf(":"),e=parseInt(c.substring(0,d)),f=c.substring(d+1),g=a.slots[e];if(g.attachment&&g.attachment.name==f){var h=this.getAttachment(e,f);h&&g.setAttachment(h)}}}},c.Animation=function(a,b,c){this.name=a,this.timelines=b,this.duration=c},c.Animation.prototype={apply:function(a,b,c,d,e){d&&0!=this.duration&&(c%=this.duration,b%=this.duration);for(var f=this.timelines,g=0,h=f.length;h>g;g++)f[g].apply(a,b,c,e,1)},mix:function(a,b,c,d,e,f){d&&0!=this.duration&&(c%=this.duration,b%=this.duration);for(var g=this.timelines,h=0,i=g.length;i>h;h++)g[h].apply(a,b,c,e,f)}},c.Animation.binarySearch=function(a,b,c){var d=0,e=Math.floor(a.length/c)-2;if(!e)return c;for(var f=e>>>1;;){if(a[(f+1)*c]<=b?d=f+1:e=f,d==e)return(d+1)*c;f=d+e>>>1}},c.Animation.binarySearch1=function(a,b){var c=0,d=a.length-2;if(!d)return 1;for(var e=d>>>1;;){if(a[e+1]<=b?c=e+1:d=e,c==d)return c+1;e=c+d>>>1}},c.Animation.linearSearch=function(a,b,c){for(var d=0,e=a.length-c;e>=d;d+=c)if(a[d]>b)return d;return-1},c.Curves=function(){this.curves=[]},c.Curves.prototype={setLinear:function(a){this.curves[19*a]=0},setStepped:function(a){this.curves[19*a]=1},setCurve:function(a,b,c,d,e){var f=.1,g=f*f,h=g*f,i=3*f,j=3*g,k=6*g,l=6*h,m=2*-b+d,n=2*-c+e,o=3*(b-d)+1,p=3*(c-e)+1,q=b*i+m*j+o*h,r=c*i+n*j+p*h,s=m*k+o*l,t=n*k+p*l,u=o*l,v=p*l,w=19*a,x=this.curves;x[w++]=2;for(var y=q,z=r,A=w+19-1;A>w;w+=2)x[w]=y,x[w+1]=z,q+=s,r+=t,s+=u,t+=v,y+=q,z+=r},getCurvePercent:function(a,b){b=0>b?0:b>1?1:b;var c=this.curves,d=19*a,e=c[d];if(0===e)return b;if(1==e)return 0;d++;for(var f=0,g=d,h=d+19-1;h>d;d+=2)if(f=c[d],f>=b){var i,j;return d==g?(i=0,j=0):(i=c[d-2],j=c[d-1]),j+(c[d+1]-j)*(b-i)/(f-i)}var k=c[d-1];return k+(1-k)*(b-f)/(1-f)}},c.RotateTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=2*a},c.RotateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(a,b,c){a*=2,this.frames[a]=b,this.frames[a+1]=c},apply:function(a,b,d,e,f){var g=this.frames;if(!(d=g[g.length-2]){for(var i=h.data.rotation+g[g.length-1]-h.rotation;i>180;)i-=360;for(;-180>i;)i+=360;return void(h.rotation+=i*f)}var j=c.Animation.binarySearch(g,d,2),k=g[j-1],l=g[j],m=1-(d-l)/(g[j-2]-l);m=this.curves.getCurvePercent(j/2-1,m);for(var i=g[j+1]-k;i>180;)i-=360;for(;-180>i;)i+=360;for(i=h.data.rotation+(k+i*m)-h.rotation;i>180;)i-=360;for(;-180>i;)i+=360;h.rotation+=i*f}}},c.TranslateTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=3*a},c.TranslateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(a,b,c,d){a*=3,this.frames[a]=b,this.frames[a+1]=c,this.frames[a+2]=d},apply:function(a,b,d,e,f){var g=this.frames;if(!(d=g[g.length-3])return h.x+=(h.data.x+g[g.length-2]-h.x)*f,void(h.y+=(h.data.y+g[g.length-1]-h.y)*f);var i=c.Animation.binarySearch(g,d,3),j=g[i-2],k=g[i-1],l=g[i],m=1-(d-l)/(g[i+-3]-l);m=this.curves.getCurvePercent(i/3-1,m),h.x+=(h.data.x+j+(g[i+1]-j)*m-h.x)*f,h.y+=(h.data.y+k+(g[i+2]-k)*m-h.y)*f}}},c.ScaleTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=3*a},c.ScaleTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(a,b,c,d){a*=3,this.frames[a]=b,this.frames[a+1]=c,this.frames[a+2]=d},apply:function(a,b,d,e,f){var g=this.frames;if(!(d=g[g.length-3])return h.scaleX+=(h.data.scaleX*g[g.length-2]-h.scaleX)*f,void(h.scaleY+=(h.data.scaleY*g[g.length-1]-h.scaleY)*f);var i=c.Animation.binarySearch(g,d,3),j=g[i-2],k=g[i-1],l=g[i],m=1-(d-l)/(g[i+-3]-l);m=this.curves.getCurvePercent(i/3-1,m),h.scaleX+=(h.data.scaleX*(j+(g[i+1]-j)*m)-h.scaleX)*f,h.scaleY+=(h.data.scaleY*(k+(g[i+2]-k)*m)-h.scaleY)*f}}},c.ColorTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=5*a},c.ColorTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/5},setFrame:function(a,b,c,d,e,f){a*=5,this.frames[a]=b,this.frames[a+1]=c,this.frames[a+2]=d,this.frames[a+3]=e,this.frames[a+4]=f},apply:function(a,b,d,e,f){var g=this.frames;if(!(d=g[g.length-5]){var l=g.length-1;h=g[l-3],i=g[l-2],j=g[l-1],k=g[l]}else{var m=c.Animation.binarySearch(g,d,5),n=g[m-4],o=g[m-3],p=g[m-2],q=g[m-1],r=g[m],s=1-(d-r)/(g[m-5]-r);s=this.curves.getCurvePercent(m/5-1,s),h=n+(g[m+1]-n)*s,i=o+(g[m+2]-o)*s,j=p+(g[m+3]-p)*s,k=q+(g[m+4]-q)*s}var t=a.slots[this.slotIndex];1>f?(t.r+=(h-t.r)*f,t.g+=(i-t.g)*f,t.b+=(j-t.b)*f,t.a+=(k-t.a)*f):(t.r=h,t.g=i,t.b=j,t.a=k)}}},c.AttachmentTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=a,this.attachmentNames=[],this.attachmentNames.length=a},c.AttachmentTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length},setFrame:function(a,b,c){this.frames[a]=b,this.attachmentNames[a]=c},apply:function(a,b,d){var e=this.frames;if(dd&&this.apply(a,b,Number.MAX_VALUE,null,0));b>d&&(b=-1);var f=d>=e[e.length-1]?e.length-1:c.Animation.binarySearch1(e,d)-1;if(!(e[f]d)this.apply(a,b,Number.MAX_VALUE,e,f),b=-1;else if(b>=g[h-1])return;if(!(d0&&g[i-1]==j;)i--}for(var k=this.events;h>i&&d>=g[i];i++)e.push(k[i])}}}},c.DrawOrderTimeline=function(a){this.frames=[],this.frames.length=a,this.drawOrders=[],this.drawOrders.length=a},c.DrawOrderTimeline.prototype={getFrameCount:function(){return this.frames.length},setFrame:function(a,b,c){this.frames[a]=b,this.drawOrders[a]=c},apply:function(a,b,d){var e=this.frames;if(!(d=e[e.length-1]?e.length-1:c.Animation.binarySearch1(e,d)-1;var g=a.drawOrder,h=a.slots,i=this.drawOrders[f];if(i)for(var j=0,k=i.length;k>j;j++)g[j]=a.slots[i[j]];else for(var j=0,k=h.length;k>j;j++)g[j]=h[j]}}},c.FfdTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=a,this.frameVertices=[],this.frameVertices.length=a},c.FfdTimeline.prototype={slotIndex:0,attachment:0,getFrameCount:function(){return this.frames.length},setFrame:function(a,b,c){this.frames[a]=b,this.frameVertices[a]=c},apply:function(a,b,d,e,f){var g=a.slots[this.slotIndex];if(g.attachment==this.attachment){var h=this.frames;if(!(d=h[h.length-1]){var l=i[h.length-1];if(1>f)for(var m=0;j>m;m++)k[m]+=(l[m]-k[m])*f;else for(var m=0;j>m;m++)k[m]=l[m]}else{var n=c.Animation.binarySearch1(h,d),o=h[n],p=1-(d-o)/(h[n-1]-o);p=this.curves.getCurvePercent(n-1,0>p?0:p>1?1:p);var q=i[n-1],r=i[n];if(1>f)for(var m=0;j>m;m++){var s=q[m];k[m]+=(s+(r[m]-s)*p-k[m])*f}else for(var m=0;j>m;m++){var s=q[m];k[m]=s+(r[m]-s)*p}}}}}},c.IkConstraintTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=3*a},c.IkConstraintTimeline.prototype={ikConstraintIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(a,b,c,d){a*=3,this.frames[a]=b,this.frames[a+1]=c,this.frames[a+2]=d},apply:function(a,b,d,e,f){var g=this.frames;if(!(d=g[g.length-3])return h.mix+=(g[g.length-2]-h.mix)*f,void(h.bendDirection=g[g.length-1]);var i=c.Animation.binarySearch(g,d,3),j=g[i+-2],k=g[i],l=1-(d-k)/(g[i+-3]-k);l=this.curves.getCurvePercent(i/3-1,l);var m=j+(g[i+1]-j)*l;h.mix+=(m-h.mix)*f,h.bendDirection=g[i+-1]}}},c.FlipXTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=2*a},c.FlipXTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(a,b,c){a*=2,this.frames[a]=b,this.frames[a+1]=c?1:0},apply:function(a,b,d){var e=this.frames;if(dd&&this.apply(a,b,Number.MAX_VALUE,null,0));b>d&&(b=-1);var f=(d>=e[e.length-2]?e.length:c.Animation.binarySearch(e,d,2))-2;e[f]d&&this.apply(a,b,Number.MAX_VALUE,null,0));b>d&&(b=-1);var f=(d>=e[e.length-2]?e.length:c.Animation.binarySearch(e,d,2))-2;e[f]c;c++)if(b[c].name==a)return b[c];return null},findBoneIndex:function(a){for(var b=this.bones,c=0,d=b.length;d>c;c++)if(b[c].name==a)return c;return-1},findSlot:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].name==a)return slot[c];return null},findSlotIndex:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].name==a)return c;return-1},findSkin:function(a){for(var b=this.skins,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},findEvent:function(a){for(var b=this.events,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},findAnimation:function(a){for(var b=this.animations,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},findIkConstraint:function(a){for(var b=this.ikConstraints,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null}},c.Skeleton=function(a){this.data=a,this.bones=[];for(var b=0,d=a.bones.length;d>b;b++){var e=a.bones[b],f=e.parent?this.bones[a.bones.indexOf(e.parent)]:null;this.bones.push(new c.Bone(e,this,f))}this.slots=[],this.drawOrder=[];for(var b=0,d=a.slots.length;d>b;b++){var g=a.slots[b],h=this.bones[a.bones.indexOf(g.boneData)],i=new c.Slot(g,h);this.slots.push(i),this.drawOrder.push(i)}this.ikConstraints=[];for(var b=0,d=a.ikConstraints.length;d>b;b++)this.ikConstraints.push(new c.IkConstraint(a.ikConstraints[b],this));this.boneCache=[],this.updateCache()},c.Skeleton.prototype={x:0,y:0,skin:null,r:1,g:1,b:1,a:1,time:0,flipX:!1,flipY:!1,updateCache:function(){var a=this.ikConstraints,b=a.length,c=b+1,d=this.boneCache;d.length>c&&(d.length=c);for(var e=0,f=d.length;f>e;e++)d[e].length=0;for(;d.lengthe;e++){var i=h[e],j=i;do{for(var k=0;b>k;k++)for(var l=a[k],m=l.bones[0],n=l.bones[l.bones.length-1];;){if(j==n){d[k].push(i),d[k+1].push(i);continue a}if(n==m)break;n=n.parent}j=j.parent}while(j);g[g.length]=i}},updateWorldTransform:function(){for(var a=this.bones,b=0,c=a.length;c>b;b++){var d=a[b];d.rotationIK=d.rotation}for(var b=0,e=this.boneCache.length-1;;){for(var f=this.boneCache[b],g=0,h=f.length;h>g;g++)f[g].updateWorldTransform();if(b==e)break;this.ikConstraints[b].apply(),b++}},setToSetupPose:function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},setBonesToSetupPose:function(){for(var a=this.bones,b=0,c=a.length;c>b;b++)a[b].setToSetupPose();for(var d=this.ikConstraints,b=0,c=d.length;c>b;b++){var e=d[b];e.bendDirection=e.data.bendDirection,e.mix=e.data.mix}},setSlotsToSetupPose:function(){for(var a=this.slots,b=this.drawOrder,c=0,d=a.length;d>c;c++)b[c]=a[c],a[c].setToSetupPose(c)},getRootBone:function(){return this.bones.length?this.bones[0]:null},findBone:function(a){for(var b=this.bones,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return b[c];return null},findBoneIndex:function(a){for(var b=this.bones,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return c;return-1},findSlot:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return b[c];return null},findSlotIndex:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return c;return-1},setSkinByName:function(a){var b=this.data.findSkin(a);if(!b)throw"Skin not found: "+a;this.setSkin(b)},setSkin:function(a){if(a)if(this.skin)a._attachAll(this,this.skin);else for(var b=this.slots,c=0,d=b.length;d>c;c++){var e=b[c],f=e.data.attachmentName;if(f){var g=a.getAttachment(c,f);g&&e.setAttachment(g)}}this.skin=a},getAttachmentBySlotName:function(a,b){return this.getAttachmentBySlotIndex(this.data.findSlotIndex(a),b)},getAttachmentBySlotIndex:function(a,b){if(this.skin){var c=this.skin.getAttachment(a,b);if(c)return c}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(a,b):null},setAttachment:function(a,b){for(var c=this.slots,d=0,e=c.length;e>d;d++){var f=c[d];if(f.data.name==a){var g=null;if(b&&(g=this.getAttachmentBySlotIndex(d,b),!g))throw"Attachment not found: "+b+", for slot: "+a;return void f.setAttachment(g)}}throw"Slot not found: "+a},findIkConstraint:function(a){for(var b=this.ikConstraints,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return b[c];return null},update:function(a){this.time+=a}},c.EventData=function(a){this.name=a},c.EventData.prototype={intValue:0,floatValue:0,stringValue:null},c.Event=function(a){this.data=a},c.Event.prototype={intValue:0,floatValue:0,stringValue:null},c.AttachmentType={region:0,boundingbox:1,mesh:2,skinnedmesh:3},c.RegionAttachment=function(a){this.name=a,this.offset=[],this.offset.length=8,this.uvs=[],this.uvs.length=8},c.RegionAttachment.prototype={type:c.AttachmentType.region,x:0,y:0,rotation:0,scaleX:1,scaleY:1,width:0,height:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,setUVs:function(a,b,c,d,e){var f=this.uvs;e?(f[2]=a,f[3]=d,f[4]=a,f[5]=b,f[6]=c,f[7]=b,f[0]=c,f[1]=d):(f[0]=a,f[1]=d,f[2]=a,f[3]=b,f[4]=c,f[5]=b,f[6]=c,f[7]=d)},updateOffset:function(){var a=this.width/this.regionOriginalWidth*this.scaleX,b=this.height/this.regionOriginalHeight*this.scaleY,d=-this.width/2*this.scaleX+this.regionOffsetX*a,e=-this.height/2*this.scaleY+this.regionOffsetY*b,f=d+this.regionWidth*a,g=e+this.regionHeight*b,h=this.rotation*c.degRad,i=Math.cos(h),j=Math.sin(h),k=d*i+this.x,l=d*j,m=e*i+this.y,n=e*j,o=f*i+this.x,p=f*j,q=g*i+this.y,r=g*j,s=this.offset;s[0]=k-n,s[1]=m+l,s[2]=k-r,s[3]=q+l,s[4]=o-r,s[5]=q+p,s[6]=o-n,s[7]=m+p},computeVertices:function(a,b,c,d){a+=c.worldX,b+=c.worldY;var e=c.m00,f=c.m01,g=c.m10,h=c.m11,i=this.offset;d[0]=i[0]*e+i[1]*f+a,d[1]=i[0]*g+i[1]*h+b,d[2]=i[2]*e+i[3]*f+a,d[3]=i[2]*g+i[3]*h+b,d[4]=i[4]*e+i[5]*f+a,d[5]=i[4]*g+i[5]*h+b,d[6]=i[6]*e+i[7]*f+a,d[7]=i[6]*g+i[7]*h+b}},c.MeshAttachment=function(a){this.name=a},c.MeshAttachment.prototype={type:c.AttachmentType.mesh,vertices:null,uvs:null,regionUVs:null,triangles:null,hullLength:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,regionU:0,regionV:0,regionU2:0,regionV2:0,regionRotate:!1,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,edges:null,width:0,height:0,updateUVs:function(){var a=this.regionU2-this.regionU,b=this.regionV2-this.regionV,d=this.regionUVs.length;if(this.uvs&&this.uvs.length==d||(this.uvs=new c.Float32Array(d)),this.regionRotate)for(var e=0;d>e;e+=2)this.uvs[e]=this.regionU+this.regionUVs[e+1]*a,this.uvs[e+1]=this.regionV+b-this.regionUVs[e]*b;else for(var e=0;d>e;e+=2)this.uvs[e]=this.regionU+this.regionUVs[e]*a,this.uvs[e+1]=this.regionV+this.regionUVs[e+1]*b},computeWorldVertices:function(a,b,c,d){var e=c.bone;a+=e.worldX,b+=e.worldY;var f=e.m00,g=e.m01,h=e.m10,i=e.m11,j=this.vertices,k=j.length;c.attachmentVertices.length==k&&(j=c.attachmentVertices);for(var l=0;k>l;l+=2){var m=j[l],n=j[l+1];d[l]=m*f+n*g+a,d[l+1]=m*h+n*i+b}}},c.SkinnedMeshAttachment=function(a){this.name=a},c.SkinnedMeshAttachment.prototype={type:c.AttachmentType.skinnedmesh,bones:null,weights:null,uvs:null,regionUVs:null,triangles:null,hullLength:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,regionU:0,regionV:0,regionU2:0,regionV2:0,regionRotate:!1,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,edges:null,width:0,height:0,updateUVs:function(){var a=this.regionU2-this.regionU,b=this.regionV2-this.regionV,d=this.regionUVs.length;if(this.uvs&&this.uvs.length==d||(this.uvs=new c.Float32Array(d)),this.regionRotate)for(var e=0;d>e;e+=2)this.uvs[e]=this.regionU+this.regionUVs[e+1]*a,this.uvs[e+1]=this.regionV+b-this.regionUVs[e]*b;else for(var e=0;d>e;e+=2)this.uvs[e]=this.regionU+this.regionUVs[e]*a,this.uvs[e+1]=this.regionV+this.regionUVs[e+1]*b},computeWorldVertices:function(a,b,c,d){var e,f,g,h,i,j,k,l=c.bone.skeleton.bones,m=this.weights,n=this.bones,o=0,p=0,q=0,r=0,s=n.length;if(c.attachmentVertices.length)for(var t=c.attachmentVertices;s>p;o+=2){for(f=0,g=0,e=n[p++]+p;e>p;p++,q+=3,r+=2)h=l[n[p]],i=m[q]+t[r],j=m[q+1]+t[r+1],k=m[q+2],f+=(i*h.m00+j*h.m01+h.worldX)*k,g+=(i*h.m10+j*h.m11+h.worldY)*k;d[o]=f+a,d[o+1]=g+b}else for(;s>p;o+=2){for(f=0,g=0,e=n[p++]+p;e>p;p++,q+=3)h=l[n[p]],i=m[q],j=m[q+1],k=m[q+2],f+=(i*h.m00+j*h.m01+h.worldX)*k,g+=(i*h.m10+j*h.m11+h.worldY)*k;d[o]=f+a,d[o+1]=g+b}}},c.BoundingBoxAttachment=function(a){this.name=a,this.vertices=[]},c.BoundingBoxAttachment.prototype={type:c.AttachmentType.boundingbox,computeWorldVertices:function(a,b,c,d){a+=c.worldX,b+=c.worldY;for(var e=c.m00,f=c.m01,g=c.m10,h=c.m11,i=this.vertices,j=0,k=i.length;k>j;j+=2){var l=i[j],m=i[j+1];d[j]=l*e+m*f+a,d[j+1]=l*g+m*h+b}}},c.AnimationStateData=function(a){this.skeletonData=a,this.animationToMixTime={}},c.AnimationStateData.prototype={defaultMix:0,setMixByName:function(a,b,c){var d=this.skeletonData.findAnimation(a);if(!d)throw"Animation not found: "+a;var e=this.skeletonData.findAnimation(b);if(!e)throw"Animation not found: "+b;this.setMix(d,e,c)},setMix:function(a,b,c){this.animationToMixTime[a.name+":"+b.name]=c},getMix:function(a,b){var c=a.name+":"+b.name;return this.animationToMixTime.hasOwnProperty(c)?this.animationToMixTime[c]:this.defaultMix}},c.TrackEntry=function(){},c.TrackEntry.prototype={next:null,previous:null,animation:null,loop:!1,delay:0,time:0,lastTime:-1,endTime:0,timeScale:1,mixTime:0,mixDuration:0,mix:1,onStart:null,onEnd:null,onComplete:null,onEvent:null},c.AnimationState=function(a){this.data=a,this.tracks=[],this.events=[]},c.AnimationState.prototype={onStart:null,onEnd:null,onComplete:null,onEvent:null,timeScale:1,update:function(a){a*=this.timeScale;for(var b=0;b=0&&this.setCurrent(b,e)):!c.loop&&c.lastTime>=c.endTime&&this.clearTrack(b)}}},apply:function(a){for(var b=0;bf&&(d=f);var h=c.previous;if(h){var i=h.time;!h.loop&&i>h.endTime&&(i=h.endTime),h.animation.apply(a,i,i,h.loop,null);var j=c.mixTime/c.mixDuration*c.mix;j>=1&&(j=1,c.previous=null),c.animation.mix(a,c.lastTime,d,g,this.events,j)}else 1==c.mix?c.animation.apply(a,c.lastTime,d,g,this.events):c.animation.mix(a,c.lastTime,d,g,this.events,c.mix);for(var k=0,l=this.events.length;l>k;k++){var m=this.events[k];c.onEvent&&c.onEvent(b,m),this.onEvent&&this.onEvent(b,m)}if(g?e%f>d%f:f>e&&d>=f){var n=Math.floor(d/f);c.onComplete&&c.onComplete(b,n),this.onComplete&&this.onComplete(b,n)}c.lastTime=c.time}}},clearTracks:function(){for(var a=0,b=this.tracks.length;b>a;a++)this.clearTrack(a);this.tracks.length=0},clearTrack:function(a){if(!(a>=this.tracks.length)){var b=this.tracks[a];b&&(b.onEnd&&b.onEnd(a),this.onEnd&&this.onEnd(a),this.tracks[a]=null)}},_expandToIndex:function(a){if(a=this.tracks.length;)this.tracks.push(null);return null},setCurrent:function(a,b){var c=this._expandToIndex(a);if(c){var d=c.previous;c.previous=null,c.onEnd&&c.onEnd(a),this.onEnd&&this.onEnd(a),b.mixDuration=this.data.getMix(c.animation,b.animation),b.mixDuration>0&&(b.mixTime=0,b.previous=d&&c.mixTime/c.mixDuration<.5?d:c)}this.tracks[a]=b,b.onStart&&b.onStart(a),this.onStart&&this.onStart(a)},setAnimationByName:function(a,b,c){var d=this.data.skeletonData.findAnimation(b);if(!d)throw"Animation not found: "+b;return this.setAnimation(a,d,c)},setAnimation:function(a,b,d){var e=new c.TrackEntry;return e.animation=b,e.loop=d,e.endTime=b.duration,this.setCurrent(a,e),e},addAnimationByName:function(a,b,c,d){var e=this.data.skeletonData.findAnimation(b);if(!e)throw"Animation not found: "+b;return this.addAnimation(a,e,c,d)},addAnimation:function(a,b,d,e){var f=new c.TrackEntry;f.animation=b,f.loop=d,f.endTime=b.duration;var g=this._expandToIndex(a);if(g){for(;g.next;)g=g.next;g.next=f}else this.tracks[a]=f;return 0>=e&&(g?e+=g.endTime-this.data.getMix(g.animation,b):e=0),f.delay=e,f},getCurrent:function(a){return a>=this.tracks.length?null:this.tracks[a]}},c.SkeletonJson=function(a){this.attachmentLoader=a},c.SkeletonJson.prototype={scale:1,readSkeletonData:function(a,b){var d=new c.SkeletonData;d.name=b;var e=a.skeleton;e&&(d.hash=e.hash,d.version=e.spine,d.width=e.width||0,d.height=e.height||0);for(var f=a.bones,g=0,h=f.length;h>g;g++){var i=f[g],j=null;if(i.parent&&(j=d.findBone(i.parent),!j))throw"Parent bone not found: "+i.parent;var k=new c.BoneData(i.name,j);k.length=(i.length||0)*this.scale,k.x=(i.x||0)*this.scale,k.y=(i.y||0)*this.scale,k.rotation=i.rotation||0,k.scaleX=i.hasOwnProperty("scaleX")?i.scaleX:1,k.scaleY=i.hasOwnProperty("scaleY")?i.scaleY:1,k.inheritScale=i.hasOwnProperty("inheritScale")?i.inheritScale:!0,k.inheritRotation=i.hasOwnProperty("inheritRotation")?i.inheritRotation:!0,d.bones.push(k)}var l=a.ik;if(l)for(var g=0,h=l.length;h>g;g++){for(var m=l[g],n=new c.IkConstraintData(m.name),f=m.bones,o=0,p=f.length;p>o;o++){var q=d.findBone(f[o]);if(!q)throw"IK bone not found: "+f[o];n.bones.push(q)}if(n.target=d.findBone(m.target),!n.target)throw"Target bone not found: "+m.target;n.bendDirection=!m.hasOwnProperty("bendPositive")||m.bendPositive?1:-1,n.mix=m.hasOwnProperty("mix")?m.mix:1,d.ikConstraints.push(n)}for(var r=a.slots,g=0,h=r.length;h>g;g++){var s=r[g],k=d.findBone(s.bone);if(!k)throw"Slot bone not found: "+s.bone;var t=new c.SlotData(s.name,k),u=s.color;u&&(t.r=this.toColor(u,0),t.g=this.toColor(u,1),t.b=this.toColor(u,2),t.a=this.toColor(u,3)),t.attachmentName=s.attachment,t.additiveBlending=s.additive&&"true"==s.additive,d.slots.push(t)}var v=a.skins;for(var w in v)if(v.hasOwnProperty(w)){var x=v[w],y=new c.Skin(w);for(var z in x)if(x.hasOwnProperty(z)){var A=d.findSlotIndex(z),B=x[z];for(var C in B)if(B.hasOwnProperty(C)){var D=this.readAttachment(y,C,B[C]);D&&y.addAttachment(A,C,D)}}d.skins.push(y),"default"==y.name&&(d.defaultSkin=y)}var E=a.events;for(var F in E)if(E.hasOwnProperty(F)){var G=E[F],H=new c.EventData(F);H.intValue=G["int"]||0,H.floatValue=G["float"]||0,H.stringValue=G.string||null,d.events.push(H)}var I=a.animations;for(var J in I)I.hasOwnProperty(J)&&this.readAnimation(J,I[J],d);return d},readAttachment:function(a,b,d){b=d.name||b;var e=c.AttachmentType[d.type||"region"],f=d.path||b,g=this.scale; -if(e==c.AttachmentType.region){var h=this.attachmentLoader.newRegionAttachment(a,b,f);if(!h)return null;h.path=f,h.x=(d.x||0)*g,h.y=(d.y||0)*g,h.scaleX=d.hasOwnProperty("scaleX")?d.scaleX:1,h.scaleY=d.hasOwnProperty("scaleY")?d.scaleY:1,h.rotation=d.rotation||0,h.width=(d.width||0)*g,h.height=(d.height||0)*g;var i=d.color;return i&&(h.r=this.toColor(i,0),h.g=this.toColor(i,1),h.b=this.toColor(i,2),h.a=this.toColor(i,3)),h.updateOffset(),h}if(e==c.AttachmentType.mesh){var j=this.attachmentLoader.newMeshAttachment(a,b,f);return j?(j.path=f,j.vertices=this.getFloatArray(d,"vertices",g),j.triangles=this.getIntArray(d,"triangles"),j.regionUVs=this.getFloatArray(d,"uvs",1),j.updateUVs(),i=d.color,i&&(j.r=this.toColor(i,0),j.g=this.toColor(i,1),j.b=this.toColor(i,2),j.a=this.toColor(i,3)),j.hullLength=2*(d.hull||0),d.edges&&(j.edges=this.getIntArray(d,"edges")),j.width=(d.width||0)*g,j.height=(d.height||0)*g,j):null}if(e==c.AttachmentType.skinnedmesh){var j=this.attachmentLoader.newSkinnedMeshAttachment(a,b,f);if(!j)return null;j.path=f;for(var k=this.getFloatArray(d,"uvs",1),l=this.getFloatArray(d,"vertices",1),m=[],n=[],o=0,p=l.length;p>o;){var q=0|l[o++];n[n.length]=q;for(var r=o+4*q;r>o;)n[n.length]=l[o],m[m.length]=l[o+1]*g,m[m.length]=l[o+2]*g,m[m.length]=l[o+3],o+=4}return j.bones=n,j.weights=m,j.triangles=this.getIntArray(d,"triangles"),j.regionUVs=k,j.updateUVs(),i=d.color,i&&(j.r=this.toColor(i,0),j.g=this.toColor(i,1),j.b=this.toColor(i,2),j.a=this.toColor(i,3)),j.hullLength=2*(d.hull||0),d.edges&&(j.edges=this.getIntArray(d,"edges")),j.width=(d.width||0)*g,j.height=(d.height||0)*g,j}if(e==c.AttachmentType.boundingbox){for(var s=this.attachmentLoader.newBoundingBoxAttachment(a,b),l=d.vertices,o=0,p=l.length;p>o;o++)s.vertices.push(l[o]*g);return s}throw"Unknown attachment type: "+e},readAnimation:function(a,b,d){var e=[],f=0,g=b.slots;for(var h in g)if(g.hasOwnProperty(h)){var i=g[h],j=d.findSlotIndex(h);for(var k in i)if(i.hasOwnProperty(k)){var l=i[k];if("color"==k){var m=new c.ColorTimeline(l.length);m.slotIndex=j;for(var n=0,o=0,p=l.length;p>o;o++){var q=l[o],r=q.color,s=this.toColor(r,0),t=this.toColor(r,1),u=this.toColor(r,2),v=this.toColor(r,3);m.setFrame(n,q.time,s,t,u,v),this.readCurve(m,n,q),n++}e.push(m),f=Math.max(f,m.frames[5*m.getFrameCount()-5])}else{if("attachment"!=k)throw"Invalid timeline type for a slot: "+k+" ("+h+")";var m=new c.AttachmentTimeline(l.length);m.slotIndex=j;for(var n=0,o=0,p=l.length;p>o;o++){var q=l[o];m.setFrame(n++,q.time,q.name)}e.push(m),f=Math.max(f,m.frames[m.getFrameCount()-1])}}}var w=b.bones;for(var x in w)if(w.hasOwnProperty(x)){var y=d.findBoneIndex(x);if(-1==y)throw"Bone not found: "+x;var z=w[x];for(var k in z)if(z.hasOwnProperty(k)){var l=z[k];if("rotate"==k){var m=new c.RotateTimeline(l.length);m.boneIndex=y;for(var n=0,o=0,p=l.length;p>o;o++){var q=l[o];m.setFrame(n,q.time,q.angle),this.readCurve(m,n,q),n++}e.push(m),f=Math.max(f,m.frames[2*m.getFrameCount()-2])}else if("translate"==k||"scale"==k){var m,A=1;"scale"==k?m=new c.ScaleTimeline(l.length):(m=new c.TranslateTimeline(l.length),A=this.scale),m.boneIndex=y;for(var n=0,o=0,p=l.length;p>o;o++){var q=l[o],B=(q.x||0)*A,C=(q.y||0)*A;m.setFrame(n,q.time,B,C),this.readCurve(m,n,q),n++}e.push(m),f=Math.max(f,m.frames[3*m.getFrameCount()-3])}else{if("flipX"!=k&&"flipY"!=k)throw"Invalid timeline type for a bone: "+k+" ("+x+")";var B="flipX"==k,m=B?new c.FlipXTimeline(l.length):new c.FlipYTimeline(l.length);m.boneIndex=y;for(var D=B?"x":"y",n=0,o=0,p=l.length;p>o;o++){var q=l[o];m.setFrame(n,q.time,q[D]||!1),n++}e.push(m),f=Math.max(f,m.frames[2*m.getFrameCount()-2])}}}var E=b.ik;for(var F in E)if(E.hasOwnProperty(F)){var G=d.findIkConstraint(F),l=E[F],m=new c.IkConstraintTimeline(l.length);m.ikConstraintIndex=d.ikConstraints.indexOf(G);for(var n=0,o=0,p=l.length;p>o;o++){var q=l[o],H=q.hasOwnProperty("mix")?q.mix:1,I=!q.hasOwnProperty("bendPositive")||q.bendPositive?1:-1;m.setFrame(n,q.time,H,I),this.readCurve(m,n,q),n++}e.push(m),f=Math.max(f,m.frames[3*m.frameCount-3])}var J=b.ffd;for(var K in J){var L=d.findSkin(K),i=J[K];for(h in i){var j=d.findSlotIndex(h),M=i[h];for(var N in M){var l=M[N],m=new c.FfdTimeline(l.length),O=L.getAttachment(j,N);if(!O)throw"FFD attachment not found: "+N;m.slotIndex=j,m.attachment=O;var P,Q=O.type==c.AttachmentType.mesh;P=Q?O.vertices.length:O.weights.length/3*2;for(var n=0,o=0,p=l.length;p>o;o++){var R,q=l[o];if(q.vertices){var S=q.vertices,R=[];R.length=P;var T=q.offset||0,U=S.length;if(1==this.scale)for(var V=0;U>V;V++)R[V+T]=S[V];else for(var V=0;U>V;V++)R[V+T]=S[V]*this.scale;if(Q)for(var W=O.vertices,V=0,U=R.length;U>V;V++)R[V]+=W[V]}else Q?R=O.vertices:(R=[],R.length=P);m.setFrame(n,q.time,R),this.readCurve(m,n,q),n++}e[e.length]=m,f=Math.max(f,m.frames[m.frameCount-1])}}}var X=b.drawOrder;if(X||(X=b.draworder),X){for(var m=new c.DrawOrderTimeline(X.length),Y=d.slots.length,n=0,o=0,p=X.length;p>o;o++){var Z=X[o],$=null;if(Z.offsets){$=[],$.length=Y;for(var V=Y-1;V>=0;V--)$[V]=-1;var _=Z.offsets,ab=[];ab.length=Y-_.length;for(var bb=0,cb=0,V=0,U=_.length;U>V;V++){var db=_[V],j=d.findSlotIndex(db.slot);if(-1==j)throw"Slot not found: "+db.slot;for(;bb!=j;)ab[cb++]=bb++;$[bb+db.offset]=bb++}for(;Y>bb;)ab[cb++]=bb++;for(var V=Y-1;V>=0;V--)-1==$[V]&&($[V]=ab[--cb])}m.setFrame(n++,Z.time,$)}e.push(m),f=Math.max(f,m.frames[m.getFrameCount()-1])}var eb=b.events;if(eb){for(var m=new c.EventTimeline(eb.length),n=0,o=0,p=eb.length;p>o;o++){var fb=eb[o],gb=d.findEvent(fb.name);if(!gb)throw"Event not found: "+fb.name;var hb=new c.Event(gb);hb.intValue=fb.hasOwnProperty("int")?fb["int"]:gb.intValue,hb.floatValue=fb.hasOwnProperty("float")?fb["float"]:gb.floatValue,hb.stringValue=fb.hasOwnProperty("string")?fb.string:gb.stringValue,m.setFrame(n++,fb.time,hb)}e.push(m),f=Math.max(f,m.frames[m.getFrameCount()-1])}d.animations.push(new c.Animation(a,e,f))},readCurve:function(a,b,c){var d=c.curve;d?"stepped"==d?a.curves.setStepped(b):d instanceof Array&&a.curves.setCurve(b,d[0],d[1],d[2],d[3]):a.curves.setLinear(b)},toColor:function(a,b){if(8!=a.length)throw"Color hexidecimal length must be 8, recieved: "+a;return parseInt(a.substring(2*b,2*b+2),16)/255},getFloatArray:function(a,b,d){var e=a[b],f=new c.Float32Array(e.length),g=0,h=e.length;if(1==d)for(;h>g;g++)f[g]=e[g];else for(;h>g;g++)f[g]=e[g]*d;return f},getIntArray:function(a,b){for(var d=a[b],e=new c.Uint16Array(d.length),f=0,g=d.length;g>f;f++)e[f]=0|d[f];return e}},c.Atlas=function(a,b){this.textureLoader=b,this.pages=[],this.regions=[];var d=new c.AtlasReader(a),e=[];e.length=4;for(var f=null;;){var g=d.readLine();if(null===g)break;if(g=d.trim(g),g.length)if(f){var h=new c.AtlasRegion;h.name=g,h.page=f,h.rotate="true"==d.readValue(),d.readTuple(e);var i=parseInt(e[0]),j=parseInt(e[1]);d.readTuple(e);var k=parseInt(e[0]),l=parseInt(e[1]);h.u=i/f.width,h.v=j/f.height,h.rotate?(h.u2=(i+l)/f.width,h.v2=(j+k)/f.height):(h.u2=(i+k)/f.width,h.v2=(j+l)/f.height),h.x=i,h.y=j,h.width=Math.abs(k),h.height=Math.abs(l),4==d.readTuple(e)&&(h.splits=[parseInt(e[0]),parseInt(e[1]),parseInt(e[2]),parseInt(e[3])],4==d.readTuple(e)&&(h.pads=[parseInt(e[0]),parseInt(e[1]),parseInt(e[2]),parseInt(e[3])],d.readTuple(e))),h.originalWidth=parseInt(e[0]),h.originalHeight=parseInt(e[1]),d.readTuple(e),h.offsetX=parseInt(e[0]),h.offsetY=parseInt(e[1]),h.index=parseInt(d.readValue()),this.regions.push(h)}else{f=new c.AtlasPage,f.name=g,2==d.readTuple(e)&&(f.width=parseInt(e[0]),f.height=parseInt(e[1]),d.readTuple(e)),f.format=c.Atlas.Format[e[0]],d.readTuple(e),f.minFilter=c.Atlas.TextureFilter[e[0]],f.magFilter=c.Atlas.TextureFilter[e[1]];var m=d.readValue();f.uWrap=c.Atlas.TextureWrap.clampToEdge,f.vWrap=c.Atlas.TextureWrap.clampToEdge,"x"==m?f.uWrap=c.Atlas.TextureWrap.repeat:"y"==m?f.vWrap=c.Atlas.TextureWrap.repeat:"xy"==m&&(f.uWrap=f.vWrap=c.Atlas.TextureWrap.repeat),b.load(f,g,this),this.pages.push(f)}else f=null}},c.Atlas.prototype={findRegion:function(a){for(var b=this.regions,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},dispose:function(){for(var a=this.pages,b=0,c=a.length;c>b;b++)this.textureLoader.unload(a[b].rendererObject)},updateUVs:function(a){for(var b=this.regions,c=0,d=b.length;d>c;c++){var e=b[c];e.page==a&&(e.u=e.x/a.width,e.v=e.y/a.height,e.rotate?(e.u2=(e.x+e.height)/a.width,e.v2=(e.y+e.width)/a.height):(e.u2=(e.x+e.width)/a.width,e.v2=(e.y+e.height)/a.height))}}},c.Atlas.Format={alpha:0,intensity:1,luminanceAlpha:2,rgb565:3,rgba4444:4,rgb888:5,rgba8888:6},c.Atlas.TextureFilter={nearest:0,linear:1,mipMap:2,mipMapNearestNearest:3,mipMapLinearNearest:4,mipMapNearestLinear:5,mipMapLinearLinear:6},c.Atlas.TextureWrap={mirroredRepeat:0,clampToEdge:1,repeat:2},c.AtlasPage=function(){},c.AtlasPage.prototype={name:null,format:null,minFilter:null,magFilter:null,uWrap:null,vWrap:null,rendererObject:null,width:0,height:0},c.AtlasRegion=function(){},c.AtlasRegion.prototype={page:null,name:null,x:0,y:0,width:0,height:0,u:0,v:0,u2:0,v2:0,offsetX:0,offsetY:0,originalWidth:0,originalHeight:0,index:0,rotate:!1,splits:null,pads:null},c.AtlasReader=function(a){this.lines=a.split(/\r\n|\r|\n/)},c.AtlasReader.prototype={index:0,trim:function(a){return a.replace(/^\s+|\s+$/g,"")},readLine:function(){return this.index>=this.lines.length?null:this.lines[this.index++]},readValue:function(){var a=this.readLine(),b=a.indexOf(":");if(-1==b)throw"Invalid line: "+a;return this.trim(a.substring(b+1))},readTuple:function(a){var b=this.readLine(),c=b.indexOf(":");if(-1==c)throw"Invalid line: "+b;for(var d=0,e=c+1;3>d;d++){var f=b.indexOf(",",e);if(-1==f)break;a[d]=this.trim(b.substr(e,f-e)),e=f+1}return a[d]=this.trim(b.substring(e)),d+1}},c.AtlasAttachmentLoader=function(a){this.atlas=a},c.AtlasAttachmentLoader.prototype={newRegionAttachment:function(a,b,d){var e=this.atlas.findRegion(d);if(!e)throw"Region not found in atlas: "+d+" (region attachment: "+b+")";var f=new c.RegionAttachment(b);return f.rendererObject=e,f.setUVs(e.u,e.v,e.u2,e.v2,e.rotate),f.regionOffsetX=e.offsetX,f.regionOffsetY=e.offsetY,f.regionWidth=e.width,f.regionHeight=e.height,f.regionOriginalWidth=e.originalWidth,f.regionOriginalHeight=e.originalHeight,f},newMeshAttachment:function(a,b,d){var e=this.atlas.findRegion(d);if(!e)throw"Region not found in atlas: "+d+" (mesh attachment: "+b+")";var f=new c.MeshAttachment(b);return f.rendererObject=e,f.regionU=e.u,f.regionV=e.v,f.regionU2=e.u2,f.regionV2=e.v2,f.regionRotate=e.rotate,f.regionOffsetX=e.offsetX,f.regionOffsetY=e.offsetY,f.regionWidth=e.width,f.regionHeight=e.height,f.regionOriginalWidth=e.originalWidth,f.regionOriginalHeight=e.originalHeight,f},newSkinnedMeshAttachment:function(a,b,d){var e=this.atlas.findRegion(d);if(!e)throw"Region not found in atlas: "+d+" (skinned mesh attachment: "+b+")";var f=new c.SkinnedMeshAttachment(b);return f.rendererObject=e,f.regionU=e.u,f.regionV=e.v,f.regionU2=e.u2,f.regionV2=e.v2,f.regionRotate=e.rotate,f.regionOffsetX=e.offsetX,f.regionOffsetY=e.offsetY,f.regionWidth=e.width,f.regionHeight=e.height,f.regionOriginalWidth=e.originalWidth,f.regionOriginalHeight=e.originalHeight,f},newBoundingBoxAttachment:function(a,b){return new c.BoundingBoxAttachment(b)}},c.SkeletonBounds=function(){this.polygonPool=[],this.polygons=[],this.boundingBoxes=[]},c.SkeletonBounds.prototype={minX:0,minY:0,maxX:0,maxY:0,update:function(a,b){var d=a.slots,e=d.length,f=a.x,g=a.y,h=this.boundingBoxes,i=this.polygonPool,j=this.polygons;h.length=0;for(var k=0,l=j.length;l>k;k++)i.push(j[k]);j.length=0;for(var k=0;e>k;k++){var m=d[k],n=m.attachment;if(n.type==c.AttachmentType.boundingbox){h.push(n);var o,p=i.length;p>0?(o=i[p-1],i.splice(p-1,1)):o=[],j.push(o),o.length=n.vertices.length,n.computeWorldVertices(f,g,m.bone,o)}}b&&this.aabbCompute()},aabbCompute:function(){for(var a=this.polygons,b=Number.MAX_VALUE,c=Number.MAX_VALUE,d=Number.MIN_VALUE,e=Number.MIN_VALUE,f=0,g=a.length;g>f;f++)for(var h=a[f],i=0,j=h.length;j>i;i+=2){var k=h[i],l=h[i+1];b=Math.min(b,k),c=Math.min(c,l),d=Math.max(d,k),e=Math.max(e,l)}this.minX=b,this.minY=c,this.maxX=d,this.maxY=e},aabbContainsPoint:function(a,b){return a>=this.minX&&a<=this.maxX&&b>=this.minY&&b<=this.maxY},aabbIntersectsSegment:function(a,b,c,d){var e=this.minX,f=this.minY,g=this.maxX,h=this.maxY;if(e>=a&&e>=c||f>=b&&f>=d||a>=g&&c>=g||b>=h&&d>=h)return!1;var i=(d-b)/(c-a),j=i*(e-a)+b;if(j>f&&h>j)return!0;if(j=i*(g-a)+b,j>f&&h>j)return!0;var k=(f-b)/i+a;return k>e&&g>k?!0:(k=(h-b)/i+a,k>e&&g>k?!0:!1)},aabbIntersectsSkeleton:function(a){return this.minXa.minX&&this.minYa.minY},containsPoint:function(a,b){for(var c=this.polygons,d=0,e=c.length;e>d;d++)if(this.polygonContainsPoint(c[d],a,b))return this.boundingBoxes[d];return null},intersectsSegment:function(a,b,c,d){for(var e=this.polygons,f=0,g=e.length;g>f;f++)if(e[f].intersectsSegment(a,b,c,d))return this.boundingBoxes[f];return null},polygonContainsPoint:function(a,b,c){for(var d=a.length,e=d-2,f=!1,g=0;d>g;g+=2){var h=a[g+1],i=a[e+1];if(c>h&&i>=c||c>i&&h>=c){var j=a[g];j+(c-h)/(i-h)*(a[e]-j)l;l+=2){var m=a[l],n=a[l+1],o=j*n-k*m,p=j-m,q=k-n,r=g*q-h*p,s=(i*p-g*o)/r;if((s>=j&&m>=s||s>=m&&j>=s)&&(s>=b&&d>=s||s>=d&&b>=s)){var t=(i*q-h*o)/r;if((t>=k&&n>=t||t>=n&&k>=t)&&(t>=c&&e>=t||t>=e&&c>=t))return!0}j=m,k=n}return!1},getPolygon:function(a){var b=this.boundingBoxes.indexOf(a);return-1==b?null:this.polygons[b]},getWidth:function(){return this.maxX-this.minX},getHeight:function(){return this.maxY-this.minY}},c.Bone.yDown=!0,b.AnimCache={},b.SpineTextureLoader=function(a,c){b.EventTarget.call(this),this.basePath=a,this.crossorigin=c,this.loadingCount=0},b.SpineTextureLoader.prototype=b.SpineTextureLoader,b.SpineTextureLoader.prototype.load=function(a,c){if(a.rendererObject=b.BaseTexture.fromImage(this.basePath+"/"+c,this.crossorigin),!a.rendererObject.hasLoaded){var d=this;++d.loadingCount,a.rendererObject.addEventListener("loaded",function(){--d.loadingCount,d.dispatchEvent({type:"loadedBaseTexture",content:d})})}},b.SpineTextureLoader.prototype.unload=function(a){a.destroy(!0)},b.Spine=function(a){if(b.DisplayObjectContainer.call(this),this.spineData=b.AnimCache[a],!this.spineData)throw new Error("Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: "+a);this.skeleton=new c.Skeleton(this.spineData),this.skeleton.updateWorldTransform(),this.stateData=new c.AnimationStateData(this.spineData),this.state=new c.AnimationState(this.stateData),this.slotContainers=[];for(var d=0,e=this.skeleton.drawOrder.length;e>d;d++){var f=this.skeleton.drawOrder[d],g=f.attachment,h=new b.DisplayObjectContainer;if(this.slotContainers.push(h),this.addChild(h),g instanceof c.RegionAttachment){var i=g.rendererObject.name,j=this.createSprite(f,g);f.currentSprite=j,f.currentSpriteName=i,h.addChild(j)}else{if(!(g instanceof c.MeshAttachment))continue;var k=this.createMesh(f,g);f.currentMesh=k,f.currentMeshName=g.name,h.addChild(k)}}this.autoUpdate=!0},b.Spine.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Spine.prototype.constructor=b.Spine,Object.defineProperty(b.Spine.prototype,"autoUpdate",{get:function(){return this.updateTransform===b.Spine.prototype.autoUpdateTransform},set:function(a){this.updateTransform=a?b.Spine.prototype.autoUpdateTransform:b.DisplayObjectContainer.prototype.updateTransform}}),b.Spine.prototype.update=function(a){this.state.update(a),this.state.apply(this.skeleton),this.skeleton.updateWorldTransform();for(var d=this.skeleton.drawOrder,e=0,f=d.length;f>e;e++){var g=d[e],h=g.attachment,i=this.slotContainers[e];if(h){var j=h.type;if(j===c.AttachmentType.region){if(h.rendererObject&&(!g.currentSpriteName||g.currentSpriteName!==h.name)){var k=h.rendererObject.name;if(void 0!==g.currentSprite&&(g.currentSprite.visible=!1),g.sprites=g.sprites||{},void 0!==g.sprites[k])g.sprites[k].visible=!0;else{var l=this.createSprite(g,h);i.addChild(l)}g.currentSprite=g.sprites[k],g.currentSpriteName=k}var m=g.bone;i.position.x=m.worldX+h.x*m.m00+h.y*m.m01,i.position.y=m.worldY+h.x*m.m10+h.y*m.m11,i.scale.x=m.worldScaleX,i.scale.y=m.worldScaleY,i.rotation=-(g.bone.worldRotation*c.degRad),g.currentSprite.tint=b.rgb2hex([g.r,g.g,g.b])}else{if(j!==c.AttachmentType.skinnedmesh){i.visible=!1;continue}if(!g.currentMeshName||g.currentMeshName!==h.name){var n=h.name;if(void 0!==g.currentMesh&&(g.currentMesh.visible=!1),g.meshes=g.meshes||{},void 0!==g.meshes[n])g.meshes[n].visible=!0;else{var o=this.createMesh(g,h);i.addChild(o)}g.currentMesh=g.meshes[n],g.currentMeshName=n}h.computeWorldVertices(g.bone.skeleton.x,g.bone.skeleton.y,g,g.currentMesh.vertices)}i.visible=!0,i.alpha=g.a}else i.visible=!1}},b.Spine.prototype.autoUpdateTransform=function(){this.lastTime=this.lastTime||Date.now();var a=.001*(Date.now()-this.lastTime);this.lastTime=Date.now(),this.update(a),b.DisplayObjectContainer.prototype.updateTransform.call(this)},b.Spine.prototype.createSprite=function(a,d){var e=d.rendererObject,f=e.page.rendererObject,g=new b.Rectangle(e.x,e.y,e.rotate?e.height:e.width,e.rotate?e.width:e.height),h=new b.Texture(f,g),i=new b.Sprite(h),j=e.rotate?.5*Math.PI:0;return i.scale.set(e.width/e.originalWidth,e.height/e.originalHeight),i.rotation=j-d.rotation*c.degRad,i.anchor.x=i.anchor.y=.5,a.sprites=a.sprites||{},a.sprites[e.name]=i,i},b.Spine.prototype.createMesh=function(a,c){var d=c.rendererObject,e=d.page.rendererObject,f=new b.Texture(e),g=new b.Strip(f);return g.drawMode=b.Strip.DrawModes.TRIANGLES,g.canvasPadding=1.5,g.vertices=new b.Float32Array(c.uvs.length),g.uvs=c.uvs,g.indices=c.triangles,a.meshes=a.meshes||{},a.meshes[c.name]=g,g},b.BaseTextureCache={},b.BaseTextureCacheIdGenerator=0,b.BaseTexture=function(a,c){if(this.resolution=1,this.width=100,this.height=100,this.scaleMode=c||b.scaleModes.DEFAULT,this.hasLoaded=!1,this.source=a,this._UID=b._UID++,this.premultipliedAlpha=!0,this._glTextures=[],this.mipmap=!1,this._dirty=[!0,!0,!0,!0],a){if((this.source.complete||this.source.getContext)&&this.source.width&&this.source.height)this.hasLoaded=!0,this.width=this.source.naturalWidth||this.source.width,this.height=this.source.naturalHeight||this.source.height,this.dirty();else{var d=this;this.source.onload=function(){d.hasLoaded=!0,d.width=d.source.naturalWidth||d.source.width,d.height=d.source.naturalHeight||d.source.height,d.dirty(),d.dispatchEvent({type:"loaded",content:d})},this.source.onerror=function(){d.dispatchEvent({type:"error",content:d})}}this.imageUrl=null,this._powerOf2=!1}},b.BaseTexture.prototype.constructor=b.BaseTexture,b.EventTarget.mixin(b.BaseTexture.prototype),b.BaseTexture.prototype.destroy=function(){this.imageUrl?(delete b.BaseTextureCache[this.imageUrl],delete b.TextureCache[this.imageUrl],this.imageUrl=null,navigator.isCocoonJS||(this.source.src="")):this.source&&this.source._pixiId&&delete b.BaseTextureCache[this.source._pixiId],this.source=null,this.unloadFromGPU()},b.BaseTexture.prototype.updateSourceImage=function(a){this.hasLoaded=!1,this.source.src=null,this.source.src=a},b.BaseTexture.prototype.dirty=function(){for(var a=0;a=0;a--){var c=this._glTextures[a],d=b.glContexts[a];d&&c&&d.deleteTexture(c)}this._glTextures.length=0,this.dirty()},b.BaseTexture.fromImage=function(a,c,d){var e=b.BaseTextureCache[a];if(void 0===c&&-1===a.indexOf("data:")&&(c=!0),!e){var f=new Image;c&&(f.crossOrigin=""),f.src=a,e=new b.BaseTexture(f,d),e.imageUrl=a,b.BaseTextureCache[a]=e,-1!==a.indexOf(b.RETINA_PREFIX+".")&&(e.resolution=2)}return e},b.BaseTexture.fromCanvas=function(a,c){a._pixiId||(a._pixiId="canvas_"+b.TextureCacheIdGenerator++);var d=b.BaseTextureCache[a._pixiId];return d||(d=new b.BaseTexture(a,c),b.BaseTextureCache[a._pixiId]=d),d},b.TextureCache={},b.FrameCache={},b.TextureCacheIdGenerator=0,b.Texture=function(a,c,d,e){this.noFrame=!1,c||(this.noFrame=!0,c=new b.Rectangle(0,0,1,1)),a instanceof b.Texture&&(a=a.baseTexture),this.baseTexture=a,this.frame=c,this.trim=e,this.valid=!1,this.requiresUpdate=!1,this._uvs=null,this.width=0,this.height=0,this.crop=d||new b.Rectangle(0,0,1,1),a.hasLoaded?(this.noFrame&&(c=new b.Rectangle(0,0,a.width,a.height)),this.setFrame(c)):a.addEventListener("loaded",this.onBaseTextureLoaded.bind(this))},b.Texture.prototype.constructor=b.Texture,b.EventTarget.mixin(b.Texture.prototype),b.Texture.prototype.onBaseTextureLoaded=function(){var a=this.baseTexture;a.removeEventListener("loaded",this.onLoaded),this.noFrame&&(this.frame=new b.Rectangle(0,0,a.width,a.height)),this.setFrame(this.frame),this.dispatchEvent({type:"update",content:this})},b.Texture.prototype.destroy=function(a){a&&this.baseTexture.destroy(),this.valid=!1},b.Texture.prototype.setFrame=function(a){if(this.noFrame=!1,this.frame=a,this.width=a.width,this.height=a.height,this.crop.x=a.x,this.crop.y=a.y,this.crop.width=a.width,this.crop.height=a.height,!this.trim&&(a.x+a.width>this.baseTexture.width||a.y+a.height>this.baseTexture.height))throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.valid=a&&a.width&&a.height&&this.baseTexture.source&&this.baseTexture.hasLoaded,this.trim&&(this.width=this.trim.width,this.height=this.trim.height,this.frame.width=this.trim.width,this.frame.height=this.trim.height),this.valid&&this._updateUvs()},b.Texture.prototype._updateUvs=function(){this._uvs||(this._uvs=new b.TextureUvs);var a=this.crop,c=this.baseTexture.width,d=this.baseTexture.height;this._uvs.x0=a.x/c,this._uvs.y0=a.y/d,this._uvs.x1=(a.x+a.width)/c,this._uvs.y1=a.y/d,this._uvs.x2=(a.x+a.width)/c,this._uvs.y2=(a.y+a.height)/d,this._uvs.x3=a.x/c,this._uvs.y3=(a.y+a.height)/d},b.Texture.fromImage=function(a,c,d){var e=b.TextureCache[a];return e||(e=new b.Texture(b.BaseTexture.fromImage(a,c,d)),b.TextureCache[a]=e),e},b.Texture.fromFrame=function(a){var c=b.TextureCache[a];if(!c)throw new Error('The frameId "'+a+'" does not exist in the texture cache ');return c},b.Texture.fromCanvas=function(a,c){var d=b.BaseTexture.fromCanvas(a,c);return new b.Texture(d)},b.Texture.addTextureToCache=function(a,c){b.TextureCache[c]=a},b.Texture.removeTextureFromCache=function(a){var c=b.TextureCache[a];return delete b.TextureCache[a],delete b.BaseTextureCache[a],c},b.TextureUvs=function(){this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0},b.Texture.emptyTexture=new b.Texture(new b.BaseTexture),b.RenderTexture=function(a,c,d,e,f){if(this.width=a||100,this.height=c||100,this.resolution=f||1,this.frame=new b.Rectangle(0,0,this.width*this.resolution,this.height*this.resolution),this.crop=new b.Rectangle(0,0,this.width*this.resolution,this.height*this.resolution),this.baseTexture=new b.BaseTexture,this.baseTexture.width=this.width*this.resolution,this.baseTexture.height=this.height*this.resolution,this.baseTexture._glTextures=[],this.baseTexture.resolution=this.resolution,this.baseTexture.scaleMode=e||b.scaleModes.DEFAULT,this.baseTexture.hasLoaded=!0,b.Texture.call(this,this.baseTexture,new b.Rectangle(0,0,this.width*this.resolution,this.height*this.resolution)),this.renderer=d||b.defaultRenderer,this.renderer.type===b.WEBGL_RENDERER){var g=this.renderer.gl;this.baseTexture._dirty[g.id]=!1,this.textureBuffer=new b.FilterTexture(g,this.width,this.height,this.baseTexture.scaleMode),this.baseTexture._glTextures[g.id]=this.textureBuffer.texture,this.render=this.renderWebGL,this.projection=new b.Point(.5*this.width,.5*-this.height)}else this.render=this.renderCanvas,this.textureBuffer=new b.CanvasBuffer(this.width*this.resolution,this.height*this.resolution),this.baseTexture.source=this.textureBuffer.canvas;this.valid=!0,this._updateUvs()},b.RenderTexture.prototype=Object.create(b.Texture.prototype),b.RenderTexture.prototype.constructor=b.RenderTexture,b.RenderTexture.prototype.resize=function(a,c,d){(a!==this.width||c!==this.height)&&(this.valid=a>0&&c>0,this.width=a,this.height=c,this.frame.width=this.crop.width=a*this.resolution,this.frame.height=this.crop.height=c*this.resolution,d&&(this.baseTexture.width=this.width*this.resolution,this.baseTexture.height=this.height*this.resolution),this.renderer.type===b.WEBGL_RENDERER&&(this.projection.x=this.width/2,this.projection.y=-this.height/2),this.valid&&this.textureBuffer.resize(this.width,this.height))},b.RenderTexture.prototype.clear=function(){this.valid&&(this.renderer.type===b.WEBGL_RENDERER&&this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER,this.textureBuffer.frameBuffer),this.textureBuffer.clear())},b.RenderTexture.prototype.renderWebGL=function(a,b,c){if(this.valid){var d=a.worldTransform;d.identity(),d.translate(0,2*this.projection.y),b&&d.append(b),d.scale(1,-1),a.worldAlpha=1;for(var e=a.children,f=0,g=e.length;g>f;f++)e[f].updateTransform();var h=this.renderer.gl;h.viewport(0,0,this.width*this.resolution,this.height*this.resolution),h.bindFramebuffer(h.FRAMEBUFFER,this.textureBuffer.frameBuffer),c&&this.textureBuffer.clear(),this.renderer.spriteBatch.dirty=!0,this.renderer.renderDisplayObject(a,this.projection,this.textureBuffer.frameBuffer),this.renderer.spriteBatch.dirty=!0}},b.RenderTexture.prototype.renderCanvas=function(a,b,c){if(this.valid){var d=a.worldTransform;d.identity(),b&&d.append(b),a.worldAlpha=1;for(var e=a.children,f=0,g=e.length;g>f;f++)e[f].updateTransform();c&&this.textureBuffer.clear();var h=this.textureBuffer.context,i=this.renderer.resolution;this.renderer.resolution=this.resolution,this.renderer.renderDisplayObject(a,h),this.renderer.resolution=i}},b.RenderTexture.prototype.getImage=function(){var a=new Image;return a.src=this.getBase64(),a},b.RenderTexture.prototype.getBase64=function(){return this.getCanvas().toDataURL()},b.RenderTexture.prototype.getCanvas=function(){if(this.renderer.type===b.WEBGL_RENDERER){var a=this.renderer.gl,c=this.textureBuffer.width,d=this.textureBuffer.height,e=new Uint8Array(4*c*d);a.bindFramebuffer(a.FRAMEBUFFER,this.textureBuffer.frameBuffer),a.readPixels(0,0,c,d,a.RGBA,a.UNSIGNED_BYTE,e),a.bindFramebuffer(a.FRAMEBUFFER,null);var f=new b.CanvasBuffer(c,d),g=f.context.getImageData(0,0,c,d);return g.data.set(e),f.context.putImageData(g,0,0),f.canvas}return this.textureBuffer.canvas},b.RenderTexture.tempMatrix=new b.Matrix,b.VideoTexture=function(a,c){if(!a)throw new Error("No video source element specified.");(a.readyState===a.HAVE_ENOUGH_DATA||a.readyState===a.HAVE_FUTURE_DATA)&&a.width&&a.height&&(a.complete=!0),b.BaseTexture.call(this,a,c),this.autoUpdate=!1,this.updateBound=this._onUpdate.bind(this),a.complete||(this._onCanPlay=this.onCanPlay.bind(this),a.addEventListener("canplay",this._onCanPlay),a.addEventListener("canplaythrough",this._onCanPlay),a.addEventListener("play",this.onPlayStart.bind(this)),a.addEventListener("pause",this.onPlayStop.bind(this)))},b.VideoTexture.prototype=Object.create(b.BaseTexture.prototype),b.VideoTexture.constructor=b.VideoTexture,b.VideoTexture.prototype._onUpdate=function(){this.autoUpdate&&(window.requestAnimationFrame(this.updateBound),this.dirty())},b.VideoTexture.prototype.onPlayStart=function(){this.autoUpdate||(window.requestAnimationFrame(this.updateBound),this.autoUpdate=!0)},b.VideoTexture.prototype.onPlayStop=function(){this.autoUpdate=!1},b.VideoTexture.prototype.onCanPlay=function(){"canplaythrough"===event.type&&(this.hasLoaded=!0,this.source&&(this.source.removeEventListener("canplay",this._onCanPlay),this.source.removeEventListener("canplaythrough",this._onCanPlay),this.width=this.source.videoWidth,this.height=this.source.videoHeight,this.__loaded||(this.__loaded=!0,this.dispatchEvent({type:"loaded",content:this}))))},b.VideoTexture.prototype.destroy=function(){this.source&&this.source._pixiId&&(b.BaseTextureCache[this.source._pixiId]=null,delete b.BaseTextureCache[this.source._pixiId],this.source._pixiId=null,delete this.source._pixiId),b.BaseTexture.prototype.destroy.call(this)},b.VideoTexture.baseTextureFromVideo=function(a,c){a._pixiId||(a._pixiId="video_"+b.TextureCacheIdGenerator++);var d=b.BaseTextureCache[a._pixiId];return d||(d=new b.VideoTexture(a,c),b.BaseTextureCache[a._pixiId]=d),d},b.VideoTexture.textureFromVideo=function(a,c){var d=b.VideoTexture.baseTextureFromVideo(a,c);return new b.Texture(d)},b.VideoTexture.fromUrl=function(a,c){var d=document.createElement("video");return d.src=a,d.autoPlay=!0,d.play(),b.VideoTexture.textureFromVideo(d,c)},b.AssetLoader=function(a,c){this.assetURLs=a,this.crossorigin=c,this.loadersByType={jpg:b.ImageLoader,jpeg:b.ImageLoader,png:b.ImageLoader,gif:b.ImageLoader,webp:b.ImageLoader,json:b.JsonLoader,atlas:b.AtlasLoader,anim:b.SpineLoader,xml:b.BitmapFontLoader,fnt:b.BitmapFontLoader}},b.EventTarget.mixin(b.AssetLoader.prototype),b.AssetLoader.prototype.constructor=b.AssetLoader,b.AssetLoader.prototype._getDataType=function(a){var b="data:",c=a.slice(0,b.length).toLowerCase();if(c===b){var d=a.slice(b.length),e=d.indexOf(",");if(-1===e)return null;var f=d.slice(0,e).split(";")[0];return f&&"text/plain"!==f.toLowerCase()?f.split("/").pop().toLowerCase():"txt"}return null},b.AssetLoader.prototype.load=function(){function a(a){b.onAssetLoaded(a.data.content)}var b=this;this.loadCount=this.assetURLs.length;for(var c=0;c0?a.addEventListener("loadedBaseTexture",function(a){a.content.content.loadingCount<=0&&o.onLoaded()}):o.onLoaded()},n.load()}else this.onLoaded()},b.JsonLoader.prototype.onLoaded=function(){this.loaded=!0,this.dispatchEvent({type:"loaded",content:this})},b.JsonLoader.prototype.onError=function(){this.dispatchEvent({type:"error",content:this})},b.AtlasLoader=function(a,b){this.url=a,this.baseUrl=a.replace(/[^\/]*$/,""),this.crossorigin=b,this.loaded=!1},b.AtlasLoader.constructor=b.AtlasLoader,b.EventTarget.mixin(b.AtlasLoader.prototype),b.AtlasLoader.prototype.load=function(){this.ajaxRequest=new b.AjaxRequest,this.ajaxRequest.onreadystatechange=this.onAtlasLoaded.bind(this),this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/json"),this.ajaxRequest.send(null)},b.AtlasLoader.prototype.onAtlasLoaded=function(){if(4===this.ajaxRequest.readyState)if(200===this.ajaxRequest.status||-1===window.location.href.indexOf("http")){this.atlas={meta:{image:[]},frames:[]};var a=this.ajaxRequest.responseText.split(/\r?\n/),c=-3,d=0,e=null,f=!1,g=0,h=0,i=this.onLoaded.bind(this);for(g=0;g0){if(f===g)this.atlas.meta.image.push(a[g]),d=this.atlas.meta.image.length-1,this.atlas.frames.push({}),c=-3;else if(c>0)if(c%7===1)null!=e&&(this.atlas.frames[d][e.name]=e),e={name:a[g],frame:{}};else{var j=a[g].split(" ");if(c%7===3)e.frame.x=Number(j[1].replace(",","")),e.frame.y=Number(j[2]);else if(c%7===4)e.frame.w=Number(j[1].replace(",","")),e.frame.h=Number(j[2]);else if(c%7===5){var k={x:0,y:0,w:Number(j[1].replace(",","")),h:Number(j[2])};k.w>e.frame.w||k.h>e.frame.h?(e.trimmed=!0,e.realSize=k):e.trimmed=!1}}c++}if(null!=e&&(this.atlas.frames[d][e.name]=e),this.atlas.meta.image.length>0){for(this.images=[],h=0;hthis.currentImageId?(this.currentImageId++,this.images[this.currentImageId].load()):(this.loaded=!0,this.emit("loaded",{content:this}))},b.AtlasLoader.prototype.onError=function(){this.emit("error",{content:this})},b.SpriteSheetLoader=function(a,b){this.url=a,this.crossorigin=b,this.baseUrl=a.replace(/[^\/]*$/,""),this.texture=null,this.frames={}},b.SpriteSheetLoader.prototype.constructor=b.SpriteSheetLoader,b.EventTarget.mixin(b.SpriteSheetLoader.prototype),b.SpriteSheetLoader.prototype.load=function(){var a=this,c=new b.JsonLoader(this.url,this.crossorigin);c.on("loaded",function(b){a.json=b.data.content.json,a.onLoaded()}),c.load()},b.SpriteSheetLoader.prototype.onLoaded=function(){this.emit("loaded",{content:this})},b.ImageLoader=function(a,c){this.texture=b.Texture.fromImage(a,c),this.frames=[]},b.ImageLoader.prototype.constructor=b.ImageLoader,b.EventTarget.mixin(b.ImageLoader.prototype),b.ImageLoader.prototype.load=function(){this.texture.baseTexture.hasLoaded?this.onLoaded():this.texture.baseTexture.on("loaded",this.onLoaded.bind(this))},b.ImageLoader.prototype.onLoaded=function(){this.emit("loaded",{content:this})},b.ImageLoader.prototype.loadFramedSpriteSheet=function(a,c,d){this.frames=[];for(var e=Math.floor(this.texture.width/a),f=Math.floor(this.texture.height/c),g=0,h=0;f>h;h++)for(var i=0;e>i;i++,g++){var j=new b.Texture(this.texture.baseTexture,{x:i*a,y:h*c,width:a,height:c});this.frames.push(j),d&&(b.TextureCache[d+"-"+g]=j)}this.load()},b.BitmapFontLoader=function(a,b){this.url=a,this.crossorigin=b,this.baseUrl=a.replace(/[^\/]*$/,""),this.texture=null},b.BitmapFontLoader.prototype.constructor=b.BitmapFontLoader,b.EventTarget.mixin(b.BitmapFontLoader.prototype),b.BitmapFontLoader.prototype.load=function(){this.ajaxRequest=new b.AjaxRequest,this.ajaxRequest.onreadystatechange=this.onXMLLoaded.bind(this),this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/xml"),this.ajaxRequest.send(null)},b.BitmapFontLoader.prototype.onXMLLoaded=function(){if(4===this.ajaxRequest.readyState&&(200===this.ajaxRequest.status||-1===window.location.protocol.indexOf("http"))){var a=this.ajaxRequest.responseXML;if(!a||/MSIE 9/i.test(navigator.userAgent)||navigator.isCocoonJS)if("function"==typeof window.DOMParser){var c=new DOMParser;a=c.parseFromString(this.ajaxRequest.responseText,"text/xml")}else{var d=document.createElement("div");d.innerHTML=this.ajaxRequest.responseText,a=d}var e=this.baseUrl+a.getElementsByTagName("page")[0].getAttribute("file"),f=new b.ImageLoader(e,this.crossorigin);this.texture=f.texture.baseTexture;var g={},h=a.getElementsByTagName("info")[0],i=a.getElementsByTagName("common")[0];g.font=h.getAttribute("face"),g.size=parseInt(h.getAttribute("size"),10),g.lineHeight=parseInt(i.getAttribute("lineHeight"),10),g.chars={};for(var j=a.getElementsByTagName("char"),k=0;ka;a++)this.shaders[a].dirty=!0},b.AlphaMaskFilter=function(a){b.AbstractFilter.call(this),this.passes=[this],a.baseTexture._powerOf2=!0,this.uniforms={mask:{type:"sampler2D",value:a},mapDimensions:{type:"2f",value:{x:1,y:5112}},dimensions:{type:"4fv",value:[0,0,0,0]}},a.baseTexture.hasLoaded?(this.uniforms.mask.value.x=a.width,this.uniforms.mask.value.y=a.height):(this.boundLoadedFunction=this.onTextureLoaded.bind(this),a.baseTexture.on("loaded",this.boundLoadedFunction)),this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D mask;","uniform sampler2D uSampler;","uniform vec2 offset;","uniform vec4 dimensions;","uniform vec2 mapDimensions;","void main(void) {"," vec2 mapCords = vTextureCoord.xy;"," mapCords += (dimensions.zw + offset)/ dimensions.xy ;"," mapCords.y *= -1.0;"," mapCords.y += 1.0;"," mapCords *= dimensions.xy / mapDimensions;"," vec4 original = texture2D(uSampler, vTextureCoord);"," float maskAlpha = texture2D(mask, mapCords).r;"," original *= maskAlpha;"," gl_FragColor = original;","}"]},b.AlphaMaskFilter.prototype=Object.create(b.AbstractFilter.prototype),b.AlphaMaskFilter.prototype.constructor=b.AlphaMaskFilter,b.AlphaMaskFilter.prototype.onTextureLoaded=function(){this.uniforms.mapDimensions.value.x=this.uniforms.mask.value.width,this.uniforms.mapDimensions.value.y=this.uniforms.mask.value.height,this.uniforms.mask.value.baseTexture.off("loaded",this.boundLoadedFunction)},Object.defineProperty(b.AlphaMaskFilter.prototype,"map",{get:function(){return this.uniforms.mask.value},set:function(a){this.uniforms.mask.value=a}}),b.ColorMatrixFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={matrix:{type:"mat4",value:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float invert;","uniform mat4 matrix;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * matrix;","}"]},b.ColorMatrixFilter.prototype=Object.create(b.AbstractFilter.prototype),b.ColorMatrixFilter.prototype.constructor=b.ColorMatrixFilter,Object.defineProperty(b.ColorMatrixFilter.prototype,"matrix",{get:function(){return this.uniforms.matrix.value},set:function(a){this.uniforms.matrix.value=a}}),b.GrayFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={gray:{type:"1f",value:1}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","uniform float gray;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord);"," gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(0.2126*gl_FragColor.r + 0.7152*gl_FragColor.g + 0.0722*gl_FragColor.b), gray);","}"]},b.GrayFilter.prototype=Object.create(b.AbstractFilter.prototype),b.GrayFilter.prototype.constructor=b.GrayFilter,Object.defineProperty(b.GrayFilter.prototype,"gray",{get:function(){return this.uniforms.gray.value},set:function(a){this.uniforms.gray.value=a}}),b.DisplacementFilter=function(a){b.AbstractFilter.call(this),this.passes=[this],a.baseTexture._powerOf2=!0,this.uniforms={displacementMap:{type:"sampler2D",value:a},scale:{type:"2f",value:{x:30,y:30}},offset:{type:"2f",value:{x:0,y:0}},mapDimensions:{type:"2f",value:{x:1,y:5112}},dimensions:{type:"4fv",value:[0,0,0,0]}},a.baseTexture.hasLoaded?(this.uniforms.mapDimensions.value.x=a.width,this.uniforms.mapDimensions.value.y=a.height):(this.boundLoadedFunction=this.onTextureLoaded.bind(this),a.baseTexture.on("loaded",this.boundLoadedFunction)),this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D displacementMap;","uniform sampler2D uSampler;","uniform vec2 scale;","uniform vec2 offset;","uniform vec4 dimensions;","uniform vec2 mapDimensions;","void main(void) {"," vec2 mapCords = vTextureCoord.xy;"," mapCords += (dimensions.zw + offset)/ dimensions.xy ;"," mapCords.y *= -1.0;"," mapCords.y += 1.0;"," vec2 matSample = texture2D(displacementMap, mapCords).xy;"," matSample -= 0.5;"," matSample *= scale;"," matSample /= mapDimensions;"," gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + matSample.x, vTextureCoord.y + matSample.y));"," gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb, 1.0);"," vec2 cord = vTextureCoord;","}"]},b.DisplacementFilter.prototype=Object.create(b.AbstractFilter.prototype),b.DisplacementFilter.prototype.constructor=b.DisplacementFilter,b.DisplacementFilter.prototype.onTextureLoaded=function(){this.uniforms.mapDimensions.value.x=this.uniforms.displacementMap.value.width,this.uniforms.mapDimensions.value.y=this.uniforms.displacementMap.value.height,this.uniforms.displacementMap.value.baseTexture.off("loaded",this.boundLoadedFunction)},Object.defineProperty(b.DisplacementFilter.prototype,"map",{get:function(){return this.uniforms.displacementMap.value},set:function(a){this.uniforms.displacementMap.value=a}}),Object.defineProperty(b.DisplacementFilter.prototype,"scale",{get:function(){return this.uniforms.scale.value},set:function(a){this.uniforms.scale.value=a}}),Object.defineProperty(b.DisplacementFilter.prototype,"offset",{get:function(){return this.uniforms.offset.value},set:function(a){this.uniforms.offset.value=a}}),b.PixelateFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={invert:{type:"1f",value:0},dimensions:{type:"4fv",value:new b.Float32Array([1e4,100,10,10])},pixelSize:{type:"2f",value:{x:10,y:10}}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform vec2 testDim;","uniform vec4 dimensions;","uniform vec2 pixelSize;","uniform sampler2D uSampler;","void main(void) {"," vec2 coord = vTextureCoord;"," vec2 size = dimensions.xy/pixelSize;"," vec2 color = floor( ( vTextureCoord * size ) ) / size + pixelSize/dimensions.xy * 0.5;"," gl_FragColor = texture2D(uSampler, color);","}"]},b.PixelateFilter.prototype=Object.create(b.AbstractFilter.prototype),b.PixelateFilter.prototype.constructor=b.PixelateFilter,Object.defineProperty(b.PixelateFilter.prototype,"size",{get:function(){return this.uniforms.pixelSize.value},set:function(a){this.dirty=!0,this.uniforms.pixelSize.value=a}}),b.BlurXFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={blur:{type:"1f",value:1/512}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float blur;","uniform sampler2D uSampler;","void main(void) {"," vec4 sum = vec4(0.0);"," sum += texture2D(uSampler, vec2(vTextureCoord.x - 4.0*blur, vTextureCoord.y)) * 0.05;"," sum += texture2D(uSampler, vec2(vTextureCoord.x - 3.0*blur, vTextureCoord.y)) * 0.09;"," sum += texture2D(uSampler, vec2(vTextureCoord.x - 2.0*blur, vTextureCoord.y)) * 0.12;"," sum += texture2D(uSampler, vec2(vTextureCoord.x - blur, vTextureCoord.y)) * 0.15;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;"," sum += texture2D(uSampler, vec2(vTextureCoord.x + blur, vTextureCoord.y)) * 0.15;"," sum += texture2D(uSampler, vec2(vTextureCoord.x + 2.0*blur, vTextureCoord.y)) * 0.12;"," sum += texture2D(uSampler, vec2(vTextureCoord.x + 3.0*blur, vTextureCoord.y)) * 0.09;"," sum += texture2D(uSampler, vec2(vTextureCoord.x + 4.0*blur, vTextureCoord.y)) * 0.05;"," gl_FragColor = sum;","}"]},b.BlurXFilter.prototype=Object.create(b.AbstractFilter.prototype),b.BlurXFilter.prototype.constructor=b.BlurXFilter,Object.defineProperty(b.BlurXFilter.prototype,"blur",{get:function(){return this.uniforms.blur.value/(1/7e3)},set:function(a){this.dirty=!0,this.uniforms.blur.value=1/7e3*a}}),b.BlurYFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={blur:{type:"1f",value:1/512}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float blur;","uniform sampler2D uSampler;","void main(void) {"," vec4 sum = vec4(0.0);"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 4.0*blur)) * 0.05;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 3.0*blur)) * 0.09;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 2.0*blur)) * 0.12;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - blur)) * 0.15;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + blur)) * 0.15;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 2.0*blur)) * 0.12;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 3.0*blur)) * 0.09;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 4.0*blur)) * 0.05;"," gl_FragColor = sum;","}"]},b.BlurYFilter.prototype=Object.create(b.AbstractFilter.prototype),b.BlurYFilter.prototype.constructor=b.BlurYFilter,Object.defineProperty(b.BlurYFilter.prototype,"blur",{get:function(){return this.uniforms.blur.value/(1/7e3)},set:function(a){this.uniforms.blur.value=1/7e3*a}}),b.BlurFilter=function(){this.blurXFilter=new b.BlurXFilter,this.blurYFilter=new b.BlurYFilter,this.passes=[this.blurXFilter,this.blurYFilter]},b.BlurFilter.prototype=Object.create(b.AbstractFilter.prototype),b.BlurFilter.prototype.constructor=b.BlurFilter,Object.defineProperty(b.BlurFilter.prototype,"blur",{get:function(){return this.blurXFilter.blur},set:function(a){this.blurXFilter.blur=this.blurYFilter.blur=a}}),Object.defineProperty(b.BlurFilter.prototype,"blurX",{get:function(){return this.blurXFilter.blur},set:function(a){this.blurXFilter.blur=a}}),Object.defineProperty(b.BlurFilter.prototype,"blurY",{get:function(){return this.blurYFilter.blur},set:function(a){this.blurYFilter.blur=a}}),b.InvertFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={invert:{type:"1f",value:1}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float invert;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord);"," gl_FragColor.rgb = mix( (vec3(1)-gl_FragColor.rgb) * gl_FragColor.a, gl_FragColor.rgb, 1.0 - invert);","}"]},b.InvertFilter.prototype=Object.create(b.AbstractFilter.prototype),b.InvertFilter.prototype.constructor=b.InvertFilter,Object.defineProperty(b.InvertFilter.prototype,"invert",{get:function(){return this.uniforms.invert.value},set:function(a){this.uniforms.invert.value=a}}),b.SepiaFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={sepia:{type:"1f",value:1}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float sepia;","uniform sampler2D uSampler;","const mat3 sepiaMatrix = mat3(0.3588, 0.7044, 0.1368, 0.2990, 0.5870, 0.1140, 0.2392, 0.4696, 0.0912);","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord);"," gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb * sepiaMatrix, sepia);","}"]},b.SepiaFilter.prototype=Object.create(b.AbstractFilter.prototype),b.SepiaFilter.prototype.constructor=b.SepiaFilter,Object.defineProperty(b.SepiaFilter.prototype,"sepia",{get:function(){return this.uniforms.sepia.value},set:function(a){this.uniforms.sepia.value=a}}),b.TwistFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={radius:{type:"1f",value:.5},angle:{type:"1f",value:5},offset:{type:"2f",value:{x:.5,y:.5}}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform vec4 dimensions;","uniform sampler2D uSampler;","uniform float radius;","uniform float angle;","uniform vec2 offset;","void main(void) {"," vec2 coord = vTextureCoord - offset;"," float distance = length(coord);"," if (distance < radius) {"," float ratio = (radius - distance) / radius;"," float angleMod = ratio * ratio * angle;"," float s = sin(angleMod);"," float c = cos(angleMod);"," coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);"," }"," gl_FragColor = texture2D(uSampler, coord+offset);","}"]},b.TwistFilter.prototype=Object.create(b.AbstractFilter.prototype),b.TwistFilter.prototype.constructor=b.TwistFilter,Object.defineProperty(b.TwistFilter.prototype,"offset",{get:function(){return this.uniforms.offset.value},set:function(a){this.dirty=!0,this.uniforms.offset.value=a}}),Object.defineProperty(b.TwistFilter.prototype,"radius",{get:function(){return this.uniforms.radius.value},set:function(a){this.dirty=!0,this.uniforms.radius.value=a}}),Object.defineProperty(b.TwistFilter.prototype,"angle",{get:function(){return this.uniforms.angle.value},set:function(a){this.dirty=!0,this.uniforms.angle.value=a}}),b.ColorStepFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={step:{type:"1f",value:5}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","uniform float step;","void main(void) {"," vec4 color = texture2D(uSampler, vTextureCoord);"," color = floor(color * step) / step;"," gl_FragColor = color;","}"]},b.ColorStepFilter.prototype=Object.create(b.AbstractFilter.prototype),b.ColorStepFilter.prototype.constructor=b.ColorStepFilter,Object.defineProperty(b.ColorStepFilter.prototype,"step",{get:function(){return this.uniforms.step.value},set:function(a){this.uniforms.step.value=a}}),b.DotScreenFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={scale:{type:"1f",value:1},angle:{type:"1f",value:5},dimensions:{type:"4fv",value:[0,0,0,0]}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform vec4 dimensions;","uniform sampler2D uSampler;","uniform float angle;","uniform float scale;","float pattern() {"," float s = sin(angle), c = cos(angle);"," vec2 tex = vTextureCoord * dimensions.xy;"," vec2 point = vec2("," c * tex.x - s * tex.y,"," s * tex.x + c * tex.y"," ) * scale;"," return (sin(point.x) * sin(point.y)) * 4.0;","}","void main() {"," vec4 color = texture2D(uSampler, vTextureCoord);"," float average = (color.r + color.g + color.b) / 3.0;"," gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);","}"]},b.DotScreenFilter.prototype=Object.create(b.AbstractFilter.prototype),b.DotScreenFilter.prototype.constructor=b.DotScreenFilter,Object.defineProperty(b.DotScreenFilter.prototype,"scale",{get:function(){return this.uniforms.scale.value},set:function(a){this.dirty=!0,this.uniforms.scale.value=a}}),Object.defineProperty(b.DotScreenFilter.prototype,"angle",{get:function(){return this.uniforms.angle.value},set:function(a){this.dirty=!0,this.uniforms.angle.value=a}}),b.CrossHatchFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={blur:{type:"1f",value:1/512}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float blur;","uniform sampler2D uSampler;","void main(void) {"," float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);"," gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);"," if (lum < 1.00) {"," if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {"," gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);"," }"," }"," if (lum < 0.75) {"," if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {"," gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);"," }"," }"," if (lum < 0.50) {"," if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {"," gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);"," }"," }"," if (lum < 0.3) {"," if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {"," gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);"," }"," }","}"]},b.CrossHatchFilter.prototype=Object.create(b.AbstractFilter.prototype),b.CrossHatchFilter.prototype.constructor=b.CrossHatchFilter,Object.defineProperty(b.CrossHatchFilter.prototype,"blur",{get:function(){return this.uniforms.blur.value/(1/7e3)},set:function(a){this.uniforms.blur.value=1/7e3*a}}),b.RGBSplitFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={red:{type:"2f",value:{x:20,y:20}},green:{type:"2f",value:{x:-20,y:20}},blue:{type:"2f",value:{x:20,y:-20}},dimensions:{type:"4fv",value:[0,0,0,0]}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform vec2 red;","uniform vec2 green;","uniform vec2 blue;","uniform vec4 dimensions;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/dimensions.xy).r;"," gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/dimensions.xy).g;"," gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/dimensions.xy).b;"," gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;","}"]},b.RGBSplitFilter.prototype=Object.create(b.AbstractFilter.prototype),b.RGBSplitFilter.prototype.constructor=b.RGBSplitFilter,Object.defineProperty(b.RGBSplitFilter.prototype,"red",{get:function(){return this.uniforms.red.value},set:function(a){this.uniforms.red.value=a}}),Object.defineProperty(b.RGBSplitFilter.prototype,"green",{get:function(){return this.uniforms.green.value},set:function(a){this.uniforms.green.value=a}}),Object.defineProperty(b.RGBSplitFilter.prototype,"blue",{get:function(){return this.uniforms.blue.value},set:function(a){this.uniforms.blue.value=a}}),"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=b),exports.PIXI=b):"undefined"!=typeof define&&define.amd?define(b):a.PIXI=b}).call(this); \ No newline at end of file diff --git a/tutorial-1/pixi.js-master/bower.json b/tutorial-1/pixi.js-master/bower.json deleted file mode 100755 index 7d5d86b..0000000 --- a/tutorial-1/pixi.js-master/bower.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "pixi.js", - "version": "2.2.7", - - "main": "bin/pixi.dev.js", - - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test" - ], - "dependencies": { - }, - "devDependencies": { - } -} diff --git a/tutorial-1/pixi.js-master/docs/api.js b/tutorial-1/pixi.js-master/docs/api.js deleted file mode 100755 index c298d63..0000000 --- a/tutorial-1/pixi.js-master/docs/api.js +++ /dev/null @@ -1,100 +0,0 @@ -YUI.add("yuidoc-meta", function(Y) { - Y.YUIDoc = { meta: { - "classes": [ - "AbstractFilter", - "AjaxRequest", - "AlphaMaskFilter", - "AsciiFilter", - "AssetLoader", - "AtlasLoader", - "BaseTexture", - "BitmapFontLoader", - "BitmapText", - "BlurFilter", - "BlurXFilter", - "BlurYFilter", - "CanvasBuffer", - "CanvasGraphics", - "CanvasMaskManager", - "CanvasRenderer", - "CanvasTinter", - "Circle", - "ColorMatrixFilter", - "ColorStepFilter", - "ComplexPrimitiveShader", - "ConvolutionFilter", - "CrossHatchFilter", - "DisplacementFilter", - "DisplayObject", - "DisplayObjectContainer", - "DotScreenFilter", - "Ellipse", - "Event", - "EventTarget", - "FilterBlock", - "FilterTexture", - "Graphics", - "GraphicsData", - "GrayFilter", - "ImageLoader", - "InteractionData", - "InteractionManager", - "InvertFilter", - "JsonLoader", - "Matrix", - "MovieClip", - "NoiseFilter", - "NormalMapFilter", - "PixelateFilter", - "PixiFastShader", - "PixiShader", - "Point", - "PolyK", - "Polygon", - "PrimitiveShader", - "RGBSplitFilter", - "Rectangle", - "RenderTexture", - "Rope", - "Rounded Rectangle", - "SepiaFilter", - "SmartBlurFilter", - "Spine", - "SpineLoader", - "Sprite", - "SpriteBatch", - "SpriteSheetLoader", - "Stage", - "Strip", - "StripShader", - "Text", - "Texture", - "TilingSprite", - "TiltShiftFilter", - "TiltShiftXFilter", - "TiltShiftYFilter", - "TwistFilter", - "WebGLBlendModeManager", - "WebGLFastSpriteBatch", - "WebGLFilterManager", - "WebGLGraphics", - "WebGLGraphicsData", - "WebGLMaskManager", - "WebGLRenderer", - "WebGLShaderManager", - "WebGLSpriteBatch", - "WebGLStencilManager", - "autoDetectRecommendedRenderer", - "autoDetectRenderer" - ], - "modules": [ - "PIXI" - ], - "allModules": [ - { - "displayName": "PIXI", - "name": "PIXI" - } - ] -} }; -}); \ No newline at end of file diff --git a/tutorial-1/pixi.js-master/docs/assets/css/external-small.png b/tutorial-1/pixi.js-master/docs/assets/css/external-small.png deleted file mode 100755 index 759a1cd..0000000 Binary files a/tutorial-1/pixi.js-master/docs/assets/css/external-small.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/docs/assets/css/logo.png b/tutorial-1/pixi.js-master/docs/assets/css/logo.png deleted file mode 100755 index 609b336..0000000 Binary files a/tutorial-1/pixi.js-master/docs/assets/css/logo.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/docs/assets/css/main.css b/tutorial-1/pixi.js-master/docs/assets/css/main.css deleted file mode 100755 index d745d44..0000000 --- a/tutorial-1/pixi.js-master/docs/assets/css/main.css +++ /dev/null @@ -1,783 +0,0 @@ -/* -Font sizes for all selectors other than the body are given in percentages, -with 100% equal to 13px. To calculate a font size percentage, multiply the -desired size in pixels by 7.6923076923. - -Here's a quick lookup table: - -10px - 76.923% -11px - 84.615% -12px - 92.308% -13px - 100% -14px - 107.692% -15px - 115.385% -16px - 123.077% -17px - 130.769% -18px - 138.462% -19px - 146.154% -20px - 153.846% -*/ - -html { - background: #fff; - color: #333; - overflow-y: scroll; -} - -body { - /*font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif;*/ - font: 13px/1.4 'Helvetica', 'Arial', sans-serif; - margin: 0; - padding: 0; -} - -/* -- Links ----------------------------------------------------------------- */ -a { - color: #356de4; - text-decoration: none; -} - -.hidden { - display: none; -} - -a:hover { text-decoration: underline; } - -/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from - sight until it's focused. */ -.jump { - position: absolute; - padding: 3px 6px; - left: -99999px; - top: 0; -} - -.jump:focus { left: 40%; } - -/* -- Paragraphs ------------------------------------------------------------ */ -p { margin: 1.3em 0; } -dd p, td p { margin-bottom: 0; } -dd p:first-child, td p:first-child { margin-top: 0; } - -/* -- Headings -------------------------------------------------------------- */ -h1, h2, h3, h4, h5, h6 { - color: #D98527;/*was #f80*/ - font-family: 'Trebuchet MS', sans-serif; - font-weight: bold; - line-height: 1.1; - margin: 1.1em 0 0.5em; -} - -h1 { - font-size: 184.6%; - color: #30418C; - margin: 0.75em 0 0.5em; -} - -h2 { - font-size: 153.846%; - color: #E48A2B; -} - -h3 { font-size: 138.462%; } - -h4 { - border-bottom: 1px solid #DBDFEA; - color: #E48A2B; - font-size: 115.385%; - font-weight: normal; - padding-bottom: 2px; -} - -h5, h6 { font-size: 107.692%; } - -/* -- Code and examples ----------------------------------------------------- */ -code, kbd, pre, samp { - font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; - font-size: 92.308%; - line-height: 1.35; -} - -p code, p kbd, p samp { - background: #FCFBFA; - border: 1px solid #EFEEED; - padding: 0 3px; -} - -a code, a kbd, a samp, -pre code, pre kbd, pre samp, -table code, table kbd, table samp, -.intro code, .intro kbd, .intro samp, -.toc code, .toc kbd, .toc samp { - background: none; - border: none; - padding: 0; -} - -pre.code, pre.terminal, pre.cmd { - overflow-x: auto; - *overflow-x: scroll; - padding: 0.3em 0.6em; -} - -pre.code { - background: #FCFBFA; - border: 1px solid #EFEEED; - border-left-width: 5px; -} - -pre.terminal, pre.cmd { - background: #F0EFFC; - border: 1px solid #D0CBFB; - border-left: 5px solid #D0CBFB; -} - -/* Don't reduce the font size of // elements inside
-   blocks. */
-pre code, pre kbd, pre samp { font-size: 100%; }
-
-/* Used to denote text that shouldn't be selectable, such as line numbers or
-   shell prompts. Guess which browser this doesn't work in. */
-.noselect {
-    -moz-user-select: -moz-none;
-    -khtml-user-select: none;
-    -webkit-user-select: none;
-    -o-user-select: none;
-    user-select: none;
-}
-
-/* -- Lists ----------------------------------------------------------------- */
-dd { margin: 0.2em 0 0.7em 1em; }
-dl { margin: 1em 0; }
-dt { font-weight: bold; }
-
-/* -- Tables ---------------------------------------------------------------- */
-caption, th { text-align: left; }
-
-table {
-    border-collapse: collapse;
-    width: 100%;
-}
-
-td, th {
-    border: 1px solid #fff;
-    padding: 5px 12px;
-    vertical-align: top;
-}
-
-td { background: #E6E9F5; }
-td dl { margin: 0; }
-td dl dl { margin: 1em 0; }
-td pre:first-child { margin-top: 0; }
-
-th {
-    background: #D2D7E6;/*#97A0BF*/
-    border-bottom: none;
-    border-top: none;
-    color: #000;/*#FFF1D5*/
-    font-family: 'Trebuchet MS', sans-serif;
-    font-weight: bold;
-    line-height: 1.3;
-    white-space: nowrap;
-}
-
-
-/* -- Layout and Content ---------------------------------------------------- */
-#doc {
-    margin: auto;
-    min-width: 1024px;
-}
-
-.content { padding: 0 20px 0 25px; }
-
-.sidebar {
-    padding: 0 15px 0 10px;
-}
-#bd {
-    padding: 7px 0 130px;
-    position: relative;
-    width: 99%;
-}
-
-/* -- Table of Contents ----------------------------------------------------- */
-
-/* The #toc id refers to the single global table of contents, while the .toc
-   class refers to generic TOC lists that could be used throughout the page. */
-
-.toc code, .toc kbd, .toc samp { font-size: 100%; }
-.toc li { font-weight: bold; }
-.toc li li { font-weight: normal; }
-
-/* -- Intro and Example Boxes ----------------------------------------------- */
-/*
-.intro, .example { margin-bottom: 2em; }
-.example {
-    -moz-border-radius: 4px;
-    -webkit-border-radius: 4px;
-    border-radius: 4px;
-    -moz-box-shadow: 0 0 5px #bfbfbf;
-    -webkit-box-shadow: 0 0 5px #bfbfbf;
-    box-shadow: 0 0 5px #bfbfbf;
-    padding: 1em;
-}
-.intro {
-    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
-}
-*/
-
-/* -- Other Styles ---------------------------------------------------------- */
-
-/* These are probably YUI-specific, and should be moved out of Selleck's default
-   theme. */
-
-.button {
-    border: 1px solid #dadada;
-    -moz-border-radius: 3px;
-    -webkit-border-radius: 3px;
-    border-radius: 3px;
-    color: #444;
-    display: inline-block;
-    font-family: Helvetica, Arial, sans-serif;
-    font-size: 92.308%;
-    font-weight: bold;
-    padding: 4px 13px 3px;
-    -moz-text-shadow: 1px 1px 0 #fff;
-    -webkit-text-shadow: 1px 1px 0 #fff;
-    text-shadow: 1px 1px 0 #fff;
-    white-space: nowrap;
-
-    background: #EFEFEF; /* old browsers */
-    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
-    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
-    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
-}
-
-.button:hover {
-    border-color: #466899;
-    color: #fff;
-    text-decoration: none;
-    -moz-text-shadow: 1px 1px 0 #222;
-    -webkit-text-shadow: 1px 1px 0 #222;
-    text-shadow: 1px 1px 0 #222;
-
-    background: #6396D8; /* old browsers */
-    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
-    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
-    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
-}
-
-.newwindow { text-align: center; }
-
-.header .version em {
-    display: block;
-    text-align: right;
-}
-
-
-#classdocs .item {
-    border-bottom: 1px solid #466899;
-    margin: 1em 0;
-    padding: 1.5em;
-}
-
-#classdocs .item .params p,
-    #classdocs .item .returns p,{
-    display: inline;
-}
-
-#classdocs .item em code, #classdocs .item em.comment {
-    color: green;
-}
-
-#classdocs .item em.comment a {
-    color: green;
-    text-decoration: underline;
-}
-
-#classdocs .foundat {
-    font-size: 11px;
-    font-style: normal;
-}
-
-.attrs .emits {
-    margin-left: 2em;
-    padding: .5em;
-    border-left: 1px dashed #ccc;
-}
-
-abbr {
-    border-bottom: 1px dashed #ccc;
-    font-size: 80%;
-    cursor: help;
-}
-
-.prettyprint li.L0, 
-.prettyprint li.L1, 
-.prettyprint li.L2, 
-.prettyprint li.L3, 
-.prettyprint li.L5, 
-.prettyprint li.L6, 
-.prettyprint li.L7, 
-.prettyprint li.L8 {
-    list-style: decimal;
-}
-
-ul li p {
-    margin-top: 0;
-}
-
-.method .name {
-    font-size: 110%;
-}
-
-.apidocs .methods .extends .method,
-.apidocs .properties .extends .property,
-.apidocs .attrs .extends .attr,
-.apidocs .events .extends .event {
-    font-weight: bold;
-}
-
-.apidocs .methods .extends .inherited,
-.apidocs .properties .extends .inherited,
-.apidocs .attrs .extends .inherited,
-.apidocs .events .extends .inherited {
-    font-weight: normal;
-}
-
-#hd {
-    background: whiteSmoke;
-    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
-    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
-    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
-    border-bottom: 1px solid #DFDFDF;
-    padding: 0 15px 1px 20px;
-    margin-bottom: 15px;
-}
-
-#hd img {
-    margin-right: 10px;
-    vertical-align: middle;
-}
-
-
-/* -- API Docs CSS ---------------------------------------------------------- */
-
-/*
-This file is organized so that more generic styles are nearer the top, and more
-specific styles are nearer the bottom of the file. This allows us to take full
-advantage of the cascade to avoid redundant style rules. Please respect this
-convention when making changes.
-*/
-
-/* -- Generic TabView styles ------------------------------------------------ */
-
-/*
-These styles apply to all API doc tabviews. To change styles only for a
-specific tabview, see the other sections below.
-*/
-
-.yui3-js-enabled .apidocs .tabview {
-    visibility: hidden; /* Hide until the TabView finishes rendering. */
-    _visibility: visible;
-}
-
-.apidocs .tabview.yui3-tabview-content { visibility: visible; }
-.apidocs .tabview .yui3-tabview-panel { background: #fff; }
-
-/* -- Generic Content Styles ------------------------------------------------ */
-
-/* Headings */
-h2, h3, h4, h5, h6 {
-    border: none;
-    color: #30418C;
-    font-weight: bold;
-    text-decoration: none;
-}
-
-.link-docs {
-    float: right;
-    font-size: 15px;
-    margin: 4px 4px 6px;
-    padding: 6px 30px 5px;
-}
-
-.apidocs { zoom: 1; }
-
-/* Generic box styles. */
-.apidocs .box {
-    border: 1px solid;
-    border-radius: 3px;
-    margin: 1em 0;
-    padding: 0 1em;
-}
-
-/* A flag is a compact, capsule-like indicator of some kind. It's used to
-   indicate private and protected items, item return types, etc. in an
-   attractive and unobtrusive way. */
-.apidocs .flag {
-    background: #bababa;
-    border-radius: 3px;
-    color: #fff;
-    font-size: 11px;
-    margin: 0 0.5em;
-    padding: 2px 4px 1px;
-}
-
-/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
-.apidocs .meta {
-    background: #f9f9f9;
-    border-color: #efefef;
-    color: #555;
-    font-size: 11px;
-    padding: 3px 6px;
-}
-
-.apidocs .meta p { margin: 0; }
-
-/* Deprecation warning. */
-.apidocs .box.deprecated,
-.apidocs .flag.deprecated {
-    background: #fdac9f;
-    border: 1px solid #fd7775;
-}
-
-.apidocs .box.deprecated p { margin: 0.5em 0; }
-.apidocs .flag.deprecated { color: #333; }
-
-/* Module/Class intro description. */
-.apidocs .intro {
-    background: #f0f1f8;
-    border-color: #d4d8eb;
-}
-
-/* Loading spinners. */
-#bd.loading .apidocs,
-#api-list.loading .yui3-tabview-panel {
-    background: #fff url(../img/spinner.gif) no-repeat center 70px;
-    min-height: 150px;
-}
-
-#bd.loading .apidocs .content,
-#api-list.loading .yui3-tabview-panel .apis {
-    display: none;
-}
-
-.apidocs .no-visible-items { color: #666; }
-
-/* Generic inline list. */
-.apidocs ul.inline {
-    display: inline;
-    list-style: none;
-    margin: 0;
-    padding: 0;
-}
-
-.apidocs ul.inline li { display: inline; }
-
-/* Comma-separated list. */
-.apidocs ul.commas li:after { content: ','; }
-.apidocs ul.commas li:last-child:after { content: ''; }
-
-/* Keyboard shortcuts. */
-kbd .cmd { font-family: Monaco, Helvetica; }
-
-/* -- Generic Access Level styles ------------------------------------------- */
-.apidocs .item.protected,
-.apidocs .item.private,
-.apidocs .index-item.protected,
-.apidocs .index-item.deprecated,
-.apidocs .index-item.private {
-    display: none;
-}
-
-.show-deprecated .item.deprecated,
-.show-deprecated .index-item.deprecated,
-.show-protected .item.protected,
-.show-protected .index-item.protected,
-.show-private .item.private,
-.show-private .index-item.private {
-    display: block;
-}
-
-.hide-inherited .item.inherited,
-.hide-inherited .index-item.inherited {
-    display: none;
-}
-
-/* -- Generic Item Index styles --------------------------------------------- */
-.apidocs .index { margin: 1.5em 0 3em; }
-
-.apidocs .index h3 {
-    border-bottom: 1px solid #efefef;
-    color: #333;
-    font-size: 13px;
-    margin: 2em 0 0.6em;
-    padding-bottom: 2px;
-}
-
-.apidocs .index .no-visible-items { margin-top: 2em; }
-
-.apidocs .index-list {
-    border-color: #efefef;
-    font-size: 12px;
-    list-style: none;
-    margin: 0;
-    padding: 0;
-    -moz-column-count: 4;
-    -moz-column-gap: 10px;
-    -moz-column-width: 170px;
-    -ms-column-count: 4;
-    -ms-column-gap: 10px;
-    -ms-column-width: 170px;
-    -o-column-count: 4;
-    -o-column-gap: 10px;
-    -o-column-width: 170px;
-    -webkit-column-count: 4;
-    -webkit-column-gap: 10px;
-    -webkit-column-width: 170px;
-    column-count: 4;
-    column-gap: 10px;
-    column-width: 170px;
-}
-
-.apidocs .no-columns .index-list {
-    -moz-column-count: 1;
-    -ms-column-count: 1;
-    -o-column-count: 1;
-    -webkit-column-count: 1;
-    column-count: 1;
-}
-
-.apidocs .index-item { white-space: nowrap; }
-
-.apidocs .index-item .flag {
-    background: none;
-    border: none;
-    color: #afafaf;
-    display: inline;
-    margin: 0 0 0 0.2em;
-    padding: 0;
-}
-
-/* -- Generic API item styles ----------------------------------------------- */
-.apidocs .args {
-    display: inline;
-    margin: 0 0.5em;
-}
-
-.apidocs .flag.chainable { background: #46ca3b; }
-.apidocs .flag.protected { background: #9b86fc; }
-.apidocs .flag.private { background: #fd6b1b; }
-.apidocs .flag.async { background: #356de4; }
-.apidocs .flag.required { background: #e60923; }
-
-.apidocs .item {
-    border-bottom: 1px solid #efefef;
-    margin: 1.5em 0 2em;
-    padding-bottom: 2em;
-}
-
-.apidocs .item h4,
-.apidocs .item h5,
-.apidocs .item h6 {
-    color: #333;
-    font-family: inherit;
-    font-size: 100%;
-}
-
-.apidocs .item .description p,
-.apidocs .item pre.code {
-    margin: 1em 0 0;
-}
-
-.apidocs .item .meta {
-    background: none;
-    border: none;
-    padding: 0;
-}
-
-.apidocs .item .name {
-    display: inline;
-    font-size: 14px;
-}
-
-.apidocs .item .type,
-.apidocs .item .type a,
-.apidocs .returns-inline {
-    color: #555;
-}
-
-.apidocs .item .type,
-.apidocs .returns-inline {
-    font-size: 11px;
-    margin: 0 0 0 0;
-}
-
-.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
-.apidocs .item .type a:hover { border: none; }
-
-/* -- Item Parameter List --------------------------------------------------- */
-.apidocs .params-list {
-    list-style: square;
-    margin: 1em 0 0 2em;
-    padding: 0;
-}
-
-.apidocs .param { margin-bottom: 1em; }
-
-.apidocs .param .type,
-.apidocs .param .type a {
-    color: #666;
-}
-
-.apidocs .param .type {
-    margin: 0 0 0 0.5em;
-    *margin-left: 0.5em;
-}
-
-.apidocs .param-name { font-weight: bold; }
-
-/* -- Item "Emits" block ---------------------------------------------------- */
-.apidocs .item .emits {
-    background: #f9f9f9;
-    border-color: #eaeaea;
-}
-
-/* -- Item "Returns" block -------------------------------------------------- */
-.apidocs .item .returns .type,
-.apidocs .item .returns .type a {
-    font-size: 100%;
-    margin: 0;
-}
-
-/* -- Class Constructor block ----------------------------------------------- */
-.apidocs .constructor .item {
-    border: none;
-    padding-bottom: 0;
-}
-
-/* -- File Source View ------------------------------------------------------ */
-.apidocs .file pre.code,
-#doc .apidocs .file pre.prettyprint {
-    background: inherit;
-    border: none;
-    overflow: visible;
-    padding: 0;
-}
-
-.apidocs .L0,
-.apidocs .L1,
-.apidocs .L2,
-.apidocs .L3,
-.apidocs .L4,
-.apidocs .L5,
-.apidocs .L6,
-.apidocs .L7,
-.apidocs .L8,
-.apidocs .L9 {
-    background: inherit;
-}
-
-/* -- Submodule List -------------------------------------------------------- */
-.apidocs .module-submodule-description {
-    font-size: 12px;
-    margin: 0.3em 0 1em;
-}
-
-.apidocs .module-submodule-description p:first-child { margin-top: 0; }
-
-/* -- Sidebar TabView ------------------------------------------------------- */
-#api-tabview { margin-top: 0.6em; }
-
-#api-tabview-filter,
-#api-tabview-panel {
-    border: 1px solid #dfdfdf;
-}
-
-#api-tabview-filter {
-    border-bottom: none;
-    border-top: none;
-    padding: 0.6em 10px 0 10px;
-}
-
-#api-tabview-panel { border-top: none; }
-#api-filter { width: 97%; }
-
-/* -- Content TabView ------------------------------------------------------- */
-#classdocs .yui3-tabview-panel { border: none; }
-
-/* -- Source File Contents -------------------------------------------------- */
-.prettyprint li.L0,
-.prettyprint li.L1,
-.prettyprint li.L2,
-.prettyprint li.L3,
-.prettyprint li.L5,
-.prettyprint li.L6,
-.prettyprint li.L7,
-.prettyprint li.L8 {
-    list-style: decimal;
-}
-
-/* -- API options ----------------------------------------------------------- */
-#api-options {
-    font-size: 11px;
-    margin-top: 2.2em;
-    position: absolute;
-    right: 1.5em;
-}
-
-/*#api-options label { margin-right: 0.6em; }*/
-
-/* -- API list -------------------------------------------------------------- */
-#api-list {
-    margin-top: 1.5em;
-    *zoom: 1;
-}
-
-.apis {
-    font-size: 12px;
-    line-height: 1.4;
-    list-style: none;
-    margin: 0;
-    padding: 0.5em 0 0.5em 0.4em;
-}
-
-.apis a {
-    border: 1px solid transparent;
-    display: block;
-    margin: 0 0 0 -4px;
-    padding: 1px 4px 0;
-    text-decoration: none;
-    _border: none;
-    _display: inline;
-}
-
-.apis a:hover,
-.apis a:focus {
-    background: #E8EDFC;
-    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
-    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
-    border-color: #AAC0FA;
-    border-radius: 3px;
-    color: #333;
-    outline: none;
-}
-
-.api-list-item a:hover,
-.api-list-item a:focus {
-    font-weight: bold;
-    text-shadow: 1px 1px 1px #fff;
-}
-
-.apis .message { color: #888; }
-.apis .result a { padding: 3px 5px 2px; }
-
-.apis .result .type {
-    right: 4px;
-    top: 7px;
-}
-
-.api-list-item .yui3-highlight {
-    font-weight: bold;
-}
-
diff --git a/tutorial-1/pixi.js-master/docs/assets/favicon.png b/tutorial-1/pixi.js-master/docs/assets/favicon.png
deleted file mode 100755
index 5a95dda..0000000
Binary files a/tutorial-1/pixi.js-master/docs/assets/favicon.png and /dev/null differ
diff --git a/tutorial-1/pixi.js-master/docs/assets/img/spinner.gif b/tutorial-1/pixi.js-master/docs/assets/img/spinner.gif
deleted file mode 100755
index 44f96ba..0000000
Binary files a/tutorial-1/pixi.js-master/docs/assets/img/spinner.gif and /dev/null differ
diff --git a/tutorial-1/pixi.js-master/docs/assets/index.html b/tutorial-1/pixi.js-master/docs/assets/index.html
deleted file mode 100755
index 487fe15..0000000
--- a/tutorial-1/pixi.js-master/docs/assets/index.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-    
-        Redirector
-        
-    
-    
-        Click here to redirect
-    
-
diff --git a/tutorial-1/pixi.js-master/docs/assets/js/api-filter.js b/tutorial-1/pixi.js-master/docs/assets/js/api-filter.js
deleted file mode 100755
index 37aefba..0000000
--- a/tutorial-1/pixi.js-master/docs/assets/js/api-filter.js
+++ /dev/null
@@ -1,52 +0,0 @@
-YUI.add('api-filter', function (Y) {
-
-Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
-    // -- Initializer ----------------------------------------------------------
-    initializer: function () {
-        this._bindUIACBase();
-        this._syncUIACBase();
-    },
-    getDisplayName: function(name) {
-
-        Y.each(Y.YUIDoc.meta.allModules, function(i) {
-            if (i.name === name && i.displayName) {
-                name = i.displayName;
-            }
-        });
-
-        return name;
-    }
-
-}, {
-    // -- Attributes -----------------------------------------------------------
-    ATTRS: {
-        resultHighlighter: {
-            value: 'phraseMatch'
-        },
-
-        // May be set to "classes" or "modules".
-        queryType: {
-            value: 'classes'
-        },
-
-        source: {
-            valueFn: function() {
-                var self = this;
-                return function(q) {
-                    var data = Y.YUIDoc.meta[self.get('queryType')],
-                        out = [];
-                    Y.each(data, function(v) {
-                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
-                            out.push(v);
-                        }
-                    });
-                    return out;
-                };
-            }
-        }
-    }
-});
-
-}, '3.4.0', {requires: [
-    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
-]});
diff --git a/tutorial-1/pixi.js-master/docs/assets/js/api-list.js b/tutorial-1/pixi.js-master/docs/assets/js/api-list.js
deleted file mode 100755
index 88905b5..0000000
--- a/tutorial-1/pixi.js-master/docs/assets/js/api-list.js
+++ /dev/null
@@ -1,251 +0,0 @@
-YUI.add('api-list', function (Y) {
-
-var Lang   = Y.Lang,
-    YArray = Y.Array,
-
-    APIList = Y.namespace('APIList'),
-
-    classesNode    = Y.one('#api-classes'),
-    inputNode      = Y.one('#api-filter'),
-    modulesNode    = Y.one('#api-modules'),
-    tabviewNode    = Y.one('#api-tabview'),
-
-    tabs = APIList.tabs = {},
-
-    filter = APIList.filter = new Y.APIFilter({
-        inputNode : inputNode,
-        maxResults: 1000,
-
-        on: {
-            results: onFilterResults
-        }
-    }),
-
-    search = APIList.search = new Y.APISearch({
-        inputNode : inputNode,
-        maxResults: 100,
-
-        on: {
-            clear  : onSearchClear,
-            results: onSearchResults
-        }
-    }),
-
-    tabview = APIList.tabview = new Y.TabView({
-        srcNode  : tabviewNode,
-        panelNode: '#api-tabview-panel',
-        render   : true,
-
-        on: {
-            selectionChange: onTabSelectionChange
-        }
-    }),
-
-    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
-        circular   : true,
-        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
-        keys       : {next: 'down:40', previous: 'down:38'}
-    }).focusManager,
-
-    LIST_ITEM_TEMPLATE =
-        '
  • ' + - '{displayName}' + - '
  • '; - -// -- Init --------------------------------------------------------------------- - -// Duckpunch FocusManager's key event handling to prevent it from handling key -// events when a modifier is pressed. -Y.before(function (e, activeDescendant) { - if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { - return new Y.Do.Prevent(); - } -}, focusManager, '_focusPrevious', focusManager); - -Y.before(function (e, activeDescendant) { - if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { - return new Y.Do.Prevent(); - } -}, focusManager, '_focusNext', focusManager); - -// Create a mapping of tabs in the tabview so we can refer to them easily later. -tabview.each(function (tab, index) { - var name = tab.get('label').toLowerCase(); - - tabs[name] = { - index: index, - name : name, - tab : tab - }; -}); - -// Switch tabs on Ctrl/Cmd-Left/Right arrows. -tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); - -// Focus the filter input when the `/` key is pressed. -Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); - -// Keep the Focus Manager up to date. -inputNode.on('focus', function () { - focusManager.set('activeDescendant', inputNode); -}); - -// Update all tabview links to resolved URLs. -tabview.get('panelNode').all('a').each(function (link) { - link.setAttribute('href', link.get('href')); -}); - -// -- Private Functions -------------------------------------------------------- -function getFilterResultNode() { - return filter.get('queryType') === 'classes' ? classesNode : modulesNode; -} - -// -- Event Handlers ----------------------------------------------------------- -function onFilterResults(e) { - var frag = Y.one(Y.config.doc.createDocumentFragment()), - resultNode = getFilterResultNode(), - typePlural = filter.get('queryType'), - typeSingular = typePlural === 'classes' ? 'class' : 'module'; - - if (e.results.length) { - YArray.each(e.results, function (result) { - frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { - rootPath : APIList.rootPath, - displayName : filter.getDisplayName(result.highlighted), - name : result.text, - typePlural : typePlural, - typeSingular: typeSingular - })); - }); - } else { - frag.append( - '
  • ' + - 'No ' + typePlural + ' found.' + - '
  • ' - ); - } - - resultNode.empty(true); - resultNode.append(frag); - - focusManager.refresh(); -} - -function onSearchClear(e) { - - focusManager.refresh(); -} - -function onSearchKey(e) { - var target = e.target; - - if (target.test('input,select,textarea') - || target.get('isContentEditable')) { - return; - } - - e.preventDefault(); - - inputNode.focus(); - focusManager.refresh(); -} - -function onSearchResults(e) { - var frag = Y.one(Y.config.doc.createDocumentFragment()); - - if (e.results.length) { - YArray.each(e.results, function (result) { - frag.append(result.display); - }); - } else { - frag.append( - '
  • ' + - 'No results found. Maybe you\'ll have better luck with a ' + - 'different query?' + - '
  • ' - ); - } - - - focusManager.refresh(); -} - -function onTabSelectionChange(e) { - var tab = e.newVal, - name = tab.get('label').toLowerCase(); - - tabs.selected = { - index: tab.get('index'), - name : name, - tab : tab - }; - - switch (name) { - case 'classes': // fallthru - case 'modules': - filter.setAttrs({ - minQueryLength: 0, - queryType : name - }); - - search.set('minQueryLength', -1); - - // Only send a request if this isn't the initially-selected tab. - if (e.prevVal) { - filter.sendRequest(filter.get('value')); - } - break; - - case 'everything': - filter.set('minQueryLength', -1); - search.set('minQueryLength', 1); - - if (search.get('value')) { - search.sendRequest(search.get('value')); - } else { - inputNode.focus(); - } - break; - - default: - // WTF? We shouldn't be here! - filter.set('minQueryLength', -1); - search.set('minQueryLength', -1); - } - - if (focusManager) { - setTimeout(function () { - focusManager.refresh(); - }, 1); - } -} - -function onTabSwitchKey(e) { - var currentTabIndex = tabs.selected.index; - - if (!(e.ctrlKey || e.metaKey)) { - return; - } - - e.preventDefault(); - - switch (e.keyCode) { - case 37: // left arrow - if (currentTabIndex > 0) { - tabview.selectChild(currentTabIndex - 1); - inputNode.focus(); - } - break; - - case 39: // right arrow - if (currentTabIndex < (Y.Object.size(tabs) - 2)) { - tabview.selectChild(currentTabIndex + 1); - inputNode.focus(); - } - break; - } -} - -}, '3.4.0', {requires: [ - 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' -]}); diff --git a/tutorial-1/pixi.js-master/docs/assets/js/api-search.js b/tutorial-1/pixi.js-master/docs/assets/js/api-search.js deleted file mode 100755 index 175f6a6..0000000 --- a/tutorial-1/pixi.js-master/docs/assets/js/api-search.js +++ /dev/null @@ -1,98 +0,0 @@ -YUI.add('api-search', function (Y) { - -var Lang = Y.Lang, - Node = Y.Node, - YArray = Y.Array; - -Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { - // -- Public Properties ---------------------------------------------------- - RESULT_TEMPLATE: - '
  • ' + - '' + - '

    {name}

    ' + - '{resultType}' + - '
    {description}
    ' + - '{class}' + - '
    ' + - '
  • ', - - // -- Initializer ---------------------------------------------------------- - initializer: function () { - this._bindUIACBase(); - this._syncUIACBase(); - }, - - // -- Protected Methods ---------------------------------------------------- - _apiResultFilter: function (query, results) { - // Filter components out of the results. - return YArray.filter(results, function (result) { - return result.raw.resultType === 'component' ? false : result; - }); - }, - - _apiResultFormatter: function (query, results) { - return YArray.map(results, function (result) { - var raw = Y.merge(result.raw), // create a copy - desc = raw.description || ''; - - // Convert description to text and truncate it if necessary. - desc = Node.create('
    ' + desc + '
    ').get('text'); - - if (desc.length > 65) { - desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; - } else { - desc = Y.Escape.html(desc); - } - - raw['class'] || (raw['class'] = ''); - raw.description = desc; - - // Use the highlighted result name. - raw.name = result.highlighted; - - return Lang.sub(this.RESULT_TEMPLATE, raw); - }, this); - }, - - _apiTextLocator: function (result) { - return result.displayName || result.name; - } -}, { - // -- Attributes ----------------------------------------------------------- - ATTRS: { - resultFormatter: { - valueFn: function () { - return this._apiResultFormatter; - } - }, - - resultFilters: { - valueFn: function () { - return this._apiResultFilter; - } - }, - - resultHighlighter: { - value: 'phraseMatch' - }, - - resultListLocator: { - value: 'data.results' - }, - - resultTextLocator: { - valueFn: function () { - return this._apiTextLocator; - } - }, - - source: { - value: '/api/v1/search?q={query}&count={maxResults}' - } - } -}); - -}, '3.4.0', {requires: [ - 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', - 'escape' -]}); diff --git a/tutorial-1/pixi.js-master/docs/assets/js/apidocs.js b/tutorial-1/pixi.js-master/docs/assets/js/apidocs.js deleted file mode 100755 index c64bb46..0000000 --- a/tutorial-1/pixi.js-master/docs/assets/js/apidocs.js +++ /dev/null @@ -1,370 +0,0 @@ -YUI().use( - 'yuidoc-meta', - 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', -function (Y) { - -var win = Y.config.win, - localStorage = win.localStorage, - - bdNode = Y.one('#bd'), - - pjax, - defaultRoute, - - classTabView, - selectedTab; - -// Kill pjax functionality unless serving over HTTP. -if (!Y.getLocation().protocol.match(/^https?\:/)) { - Y.Router.html5 = false; -} - -// Create the default route with middleware which enables syntax highlighting -// on the loaded content. -defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { - prettyPrint(); - bdNode.removeClass('loading'); - - next(); -}); - -pjax = new Y.Pjax({ - container : '#docs-main', - contentSelector: '#docs-main > .content', - linkSelector : '#bd a', - titleSelector : '#xhr-title', - - navigateOnHash: true, - root : '/', - routes : [ - // -- / ---------------------------------------------------------------- - { - path : '/(index.html)?', - callbacks: defaultRoute - }, - - // -- /classes/* ------------------------------------------------------- - { - path : '/classes/:class.html*', - callbacks: [defaultRoute, 'handleClasses'] - }, - - // -- /files/* --------------------------------------------------------- - { - path : '/files/*file', - callbacks: [defaultRoute, 'handleFiles'] - }, - - // -- /modules/* ------------------------------------------------------- - { - path : '/modules/:module.html*', - callbacks: defaultRoute - } - ] -}); - -// -- Utility Functions -------------------------------------------------------- - -pjax.checkVisibility = function (tab) { - tab || (tab = selectedTab); - - if (!tab) { return; } - - var panelNode = tab.get('panelNode'), - visibleItems; - - // If no items are visible in the tab panel due to the current visibility - // settings, display a message to that effect. - visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { - if (itemNode.getComputedStyle('display') !== 'none') { - return true; - } - }); - - panelNode.all('.no-visible-items').remove(); - - if (!visibleItems) { - if (Y.one('#index .index-item')) { - panelNode.append( - '
    ' + - '

    ' + - 'Some items are not shown due to the current visibility ' + - 'settings. Use the checkboxes at the upper right of this ' + - 'page to change the visibility settings.' + - '

    ' + - '
    ' - ); - } else { - panelNode.append( - '
    ' + - '

    ' + - 'This class doesn\'t provide any methods, properties, ' + - 'attributes, or events.' + - '

    ' + - '
    ' - ); - } - } - - // Hide index sections without any visible items. - Y.all('.index-section').each(function (section) { - var items = 0, - visibleItems = 0; - - section.all('.index-item').each(function (itemNode) { - items += 1; - - if (itemNode.getComputedStyle('display') !== 'none') { - visibleItems += 1; - } - }); - - section.toggleClass('hidden', !visibleItems); - section.toggleClass('no-columns', visibleItems < 4); - }); -}; - -pjax.initClassTabView = function () { - if (!Y.all('#classdocs .api-class-tab').size()) { - return; - } - - if (classTabView) { - classTabView.destroy(); - selectedTab = null; - } - - classTabView = new Y.TabView({ - srcNode: '#classdocs', - - on: { - selectionChange: pjax.onTabSelectionChange - } - }); - - pjax.updateTabState(); - classTabView.render(); -}; - -pjax.initLineNumbers = function () { - var hash = win.location.hash.substring(1), - container = pjax.get('container'), - hasLines, node; - - // Add ids for each line number in the file source view. - container.all('.linenums>li').each(function (lineNode, index) { - lineNode.set('id', 'l' + (index + 1)); - lineNode.addClass('file-line'); - hasLines = true; - }); - - // Scroll to the desired line. - if (hasLines && /^l\d+$/.test(hash)) { - if ((node = container.getById(hash))) { - win.scroll(0, node.getY()); - } - } -}; - -pjax.initRoot = function () { - var terminators = /^(?:classes|files|modules)$/, - parts = pjax._getPathRoot().split('/'), - root = [], - i, len, part; - - for (i = 0, len = parts.length; i < len; i += 1) { - part = parts[i]; - - if (part.match(terminators)) { - // Makes sure the path will end with a "/". - root.push(''); - break; - } - - root.push(part); - } - - pjax.set('root', root.join('/')); -}; - -pjax.updateTabState = function (src) { - var hash = win.location.hash.substring(1), - defaultTab, node, tab, tabPanel; - - function scrollToNode() { - if (node.hasClass('protected')) { - Y.one('#api-show-protected').set('checked', true); - pjax.updateVisibility(); - } - - if (node.hasClass('private')) { - Y.one('#api-show-private').set('checked', true); - pjax.updateVisibility(); - } - - setTimeout(function () { - // For some reason, unless we re-get the node instance here, - // getY() always returns 0. - var node = Y.one('#classdocs').getById(hash); - win.scrollTo(0, node.getY() - 70); - }, 1); - } - - if (!classTabView) { - return; - } - - if (src === 'hashchange' && !hash) { - defaultTab = 'index'; - } else { - if (localStorage) { - defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || - 'index'; - } else { - defaultTab = 'index'; - } - } - - if (hash && (node = Y.one('#classdocs').getById(hash))) { - if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { - if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { - if (classTabView.get('rendered')) { - Y.Widget.getByNode(tab).set('selected', 1); - } else { - tab.addClass('yui3-tab-selected'); - } - } - } - - // Scroll to the desired element if this is a hash URL. - if (node) { - if (classTabView.get('rendered')) { - scrollToNode(); - } else { - classTabView.once('renderedChange', scrollToNode); - } - } - } else { - tab = Y.one('#classdocs .api-class-tab.' + defaultTab); - - // When the `defaultTab` node isn't found, `localStorage` is stale. - if (!tab && defaultTab !== 'index') { - tab = Y.one('#classdocs .api-class-tab.index'); - } - - if (classTabView.get('rendered')) { - Y.Widget.getByNode(tab).set('selected', 1); - } else { - tab.addClass('yui3-tab-selected'); - } - } -}; - -pjax.updateVisibility = function () { - var container = pjax.get('container'); - - container.toggleClass('hide-inherited', - !Y.one('#api-show-inherited').get('checked')); - - container.toggleClass('show-deprecated', - Y.one('#api-show-deprecated').get('checked')); - - container.toggleClass('show-protected', - Y.one('#api-show-protected').get('checked')); - - container.toggleClass('show-private', - Y.one('#api-show-private').get('checked')); - - pjax.checkVisibility(); -}; - -// -- Route Handlers ----------------------------------------------------------- - -pjax.handleClasses = function (req, res, next) { - var status = res.ioResponse.status; - - // Handles success and local filesystem XHRs. - if (!status || (status >= 200 && status < 300)) { - pjax.initClassTabView(); - } - - next(); -}; - -pjax.handleFiles = function (req, res, next) { - var status = res.ioResponse.status; - - // Handles success and local filesystem XHRs. - if (!status || (status >= 200 && status < 300)) { - pjax.initLineNumbers(); - } - - next(); -}; - -// -- Event Handlers ----------------------------------------------------------- - -pjax.onNavigate = function (e) { - var hash = e.hash, - originTarget = e.originEvent && e.originEvent.target, - tab; - - if (hash) { - tab = originTarget && originTarget.ancestor('.yui3-tab', true); - - if (hash === win.location.hash) { - pjax.updateTabState('hashchange'); - } else if (!tab) { - win.location.hash = hash; - } - - e.preventDefault(); - return; - } - - // Only scroll to the top of the page when the URL doesn't have a hash. - this.set('scrollToTop', !e.url.match(/#.+$/)); - - bdNode.addClass('loading'); -}; - -pjax.onOptionClick = function (e) { - pjax.updateVisibility(); -}; - -pjax.onTabSelectionChange = function (e) { - var tab = e.newVal, - tabId = tab.get('contentBox').getAttribute('href').substring(1); - - selectedTab = tab; - - // If switching from a previous tab (i.e., this is not the default tab), - // replace the history entry with a hash URL that will cause this tab to - // be selected if the user navigates away and then returns using the back - // or forward buttons. - if (e.prevVal && localStorage) { - localStorage.setItem('tab_' + pjax.getPath(), tabId); - } - - pjax.checkVisibility(tab); -}; - -// -- Init --------------------------------------------------------------------- - -pjax.on('navigate', pjax.onNavigate); - -pjax.initRoot(); -pjax.upgrade(); -pjax.initClassTabView(); -pjax.initLineNumbers(); -pjax.updateVisibility(); - -Y.APIList.rootPath = pjax.get('root'); - -Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); - -Y.on('hashchange', function (e) { - pjax.updateTabState('hashchange'); -}, win); - -}); diff --git a/tutorial-1/pixi.js-master/docs/assets/js/yui-prettify.js b/tutorial-1/pixi.js-master/docs/assets/js/yui-prettify.js deleted file mode 100755 index 18de864..0000000 --- a/tutorial-1/pixi.js-master/docs/assets/js/yui-prettify.js +++ /dev/null @@ -1,17 +0,0 @@ -YUI().use('node', function(Y) { - var code = Y.all('.prettyprint.linenums'); - if (code.size()) { - code.each(function(c) { - var lis = c.all('ol li'), - l = 1; - lis.each(function(n) { - n.prepend(''); - l++; - }); - }); - var h = location.hash; - location.hash = ''; - h = h.replace('LINE_', 'LINENUM_'); - location.hash = h; - } -}); diff --git a/tutorial-1/pixi.js-master/docs/assets/vendor/prettify/CHANGES.html b/tutorial-1/pixi.js-master/docs/assets/vendor/prettify/CHANGES.html deleted file mode 100755 index b50b841..0000000 --- a/tutorial-1/pixi.js-master/docs/assets/vendor/prettify/CHANGES.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - Change Log - - - README - -

    Known Issues

    -
      -
    • Perl formatting is really crappy. Partly because the author is lazy and - partly because Perl is - hard to parse. -
    • On some browsers, <code> elements with newlines in the text - which use CSS to specify white-space:pre will have the newlines - improperly stripped if the element is not attached to the document at the time - the stripping is done. Also, on IE 6, all newlines will be stripped from - <code> elements because of the way IE6 produces - innerHTML. Workaround: use <pre> for code with - newlines. -
    - -

    Change Log

    -

    29 March 2007

    -
      -
    • Added tests for PHP support - to address - issue 3. -
    • Fixed - bug: prettyPrintOne was not halting. This was not - reachable through the normal entry point. -
    • Fixed - bug: recursing into a script block or PHP tag that was not properly - closed would not silently drop the content. - (test) -
    • Fixed - bug: was eating tabs - (test) -
    • Fixed entity handling so that the caveat -
      -

      Caveats: please properly escape less-thans. x&lt;y - instead of x<y, and use " instead of - &quot; for string delimiters.

      -
      - is no longer applicable. -
    • Added noisefree's C# - patch -
    • Added a distribution that has comments and - whitespace removed to reduce download size from 45.5kB to 12.8kB. -
    -

    4 Jul 2008

    -
      -
    • Added language specific formatters that are triggered by the presence - of a lang-<language-file-extension>
    • -
    • Fixed bug: python handling of '''string''' -
    • Fixed bug: / in regex [charsets] should not end regex -
    -

    5 Jul 2008

    -
      -
    • Defined language extensions for Lisp and Lua -
    -

    14 Jul 2008

    -
      -
    • Language handlers for F#, OCAML, SQL -
    • Support for nocode spans to allow embedding of line - numbers and code annotations which should not be styled or otherwise - affect the tokenization of prettified code. - See the issue 22 - testcase. -
    -

    6 Jan 2009

    -
      -
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • -
    • Added .mxml extension to the markup style handler for - Flex MXML files. See - issue 37. -
    • Added .m extension to the C style handler so that Objective - C source files properly highlight. See - issue 58. -
    • Changed HTML lexer to use the same embedded source mechanism as the - wiki language handler, and changed to use the registered - CSS handler for STYLE element content. -
    -

    21 May 2009

    -
      -
    • Rewrote to improve performance on large files. - See benchmarks.
    • -
    • Fixed bugs with highlighting of Haskell line comments, Lisp - number literals, Lua strings, C preprocessor directives, - newlines in Wiki code on Windows, and newlines in IE6.
    • -
    -

    14 August 2009

    -
      -
    • Fixed prettifying of <code> blocks with embedded newlines. -
    -

    3 October 2009

    -
      -
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. -
    -

    19 July 2010

    -
      -
    • Added support for line numbers. Bug - 22
    • -
    • Added YAML support. Bug - 123
    • -
    • Added VHDL support courtesy Le Poussin.
    • -
    • IE performance improvements. Bug - 102 courtesy jacobly.
    • -
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • -
    • Fixed copy and paste in IE[678]. -
    • Changed output to use &#160; instead of - &nbsp; so that the output works when embedded in XML. - Bug - 108.
    • -
    - - diff --git a/tutorial-1/pixi.js-master/docs/assets/vendor/prettify/COPYING b/tutorial-1/pixi.js-master/docs/assets/vendor/prettify/COPYING deleted file mode 100755 index d645695..0000000 --- a/tutorial-1/pixi.js-master/docs/assets/vendor/prettify/COPYING +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/tutorial-1/pixi.js-master/docs/assets/vendor/prettify/README.html b/tutorial-1/pixi.js-master/docs/assets/vendor/prettify/README.html deleted file mode 100755 index c6fe1a3..0000000 --- a/tutorial-1/pixi.js-master/docs/assets/vendor/prettify/README.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - - Javascript code prettifier - - - - - - - - - - Languages : CH -

    Javascript code prettifier

    - -

    Setup

    -
      -
    1. Download a distribution -
    2. Include the script and stylesheets in your document - (you will need to make sure the css and js file are on your server, and - adjust the paths in the script and link tag) -
      -<link href="prettify.css" type="text/css" rel="stylesheet" />
      -<script type="text/javascript" src="prettify.js"></script>
      -
    3. Add onload="prettyPrint()" to your - document's body tag. -
    4. Modify the stylesheet to get the coloring you prefer
    5. -
    - -

    Usage

    -

    Put code snippets in - <pre class="prettyprint">...</pre> - or <code class="prettyprint">...</code> - and it will automatically be pretty printed. - - - - -
    The original - Prettier -
    class Voila {
    -public:
    -  // Voila
    -  static const string VOILA = "Voila";
    -
    -  // will not interfere with embedded tags.
    -}
    - -
    class Voila {
    -public:
    -  // Voila
    -  static const string VOILA = "Voila";
    -
    -  // will not interfere with embedded tags.
    -}
    -
    - -

    FAQ

    -

    Which languages does it work for?

    -

    The comments in prettify.js are authoritative but the lexer - should work on a number of languages including C and friends, - Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. - It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl - and Ruby, but, because of commenting conventions, doesn't work on - Smalltalk, or CAML-like languages.

    - -

    LISPy languages are supported via an extension: - lang-lisp.js.

    -

    And similarly for - CSS, - Haskell, - Lua, - OCAML, SML, F#, - Visual Basic, - SQL, - Protocol Buffers, and - WikiText.. - -

    If you'd like to add an extension for your favorite language, please - look at src/lang-lisp.js and file an - issue including your language extension, and a testcase.

    - -

    How do I specify which language my code is in?

    -

    You don't need to specify the language since prettyprint() - will guess. You can specify a language by specifying the language extension - along with the prettyprint class like so:

    -
    <pre class="prettyprint lang-html">
    -  The lang-* class specifies the language file extensions.
    -  File extensions supported by default include
    -    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    -    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    -    "xhtml", "xml", "xsl".
    -</pre>
    - -

    It doesn't work on <obfuscated code sample>?

    -

    Yes. Prettifying obfuscated code is like putting lipstick on a pig - — i.e. outside the scope of this tool.

    - -

    Which browsers does it work with?

    -

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. - Look at the test page to see if it - works in your browser.

    - -

    What's changed?

    -

    See the change log

    - -

    Why doesn't Prettyprinting of strings work on WordPress?

    -

    Apparently wordpress does "smart quoting" which changes close quotes. - This causes end quotes to not match up with open quotes. -

    This breaks prettifying as well as copying and pasting of code samples. - See - WordPress's help center for info on how to stop smart quoting of code - snippets.

    - -

    How do I put line numbers in my code?

    -

    You can use the linenums class to turn on line - numbering. If your code doesn't start at line number 1, you can - add a colon and a line number to the end of that class as in - linenums:52. - -

    For example -

    <pre class="prettyprint linenums:4"
    ->// This is line 4.
    -foo();
    -bar();
    -baz();
    -boo();
    -far();
    -faz();
    -<pre>
    - produces -
    // This is line 4.
    -foo();
    -bar();
    -baz();
    -boo();
    -far();
    -faz();
    -
    - -

    How do I prevent a portion of markup from being marked as code?

    -

    You can use the nocode class to identify a span of markup - that is not code. -

    <pre class=prettyprint>
    -int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    -  Continuation of comment */
    -int y = bar();
    -</pre>
    -produces -
    -int x = foo();  /* This is a comment  This is not code
    -  Continuation of comment */
    -int y = bar();
    -
    - -

    For a more complete example see the issue22 - testcase.

    - -

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    -

    If you are calling prettyPrint via an event handler, wrap it in a function. - Instead of doing -

    - addEventListener('load', prettyPrint, false); -
    - wrap it in a closure like -
    - addEventListener('load', function (event) { prettyPrint() }, false); -
    - so that the browser does not pass an event object to prettyPrint which - will confuse it. - -


    - - - - diff --git a/tutorial-1/pixi.js-master/docs/assets/vendor/prettify/prettify-min.css b/tutorial-1/pixi.js-master/docs/assets/vendor/prettify/prettify-min.css deleted file mode 100755 index d44b3a2..0000000 --- a/tutorial-1/pixi.js-master/docs/assets/vendor/prettify/prettify-min.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/tutorial-1/pixi.js-master/docs/assets/vendor/prettify/prettify-min.js b/tutorial-1/pixi.js-master/docs/assets/vendor/prettify/prettify-min.js deleted file mode 100755 index 4845d05..0000000 --- a/tutorial-1/pixi.js-master/docs/assets/vendor/prettify/prettify-min.js +++ /dev/null @@ -1 +0,0 @@ -window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/tutorial-1/pixi.js-master/docs/classes/AbstractFilter.html b/tutorial-1/pixi.js-master/docs/classes/AbstractFilter.html deleted file mode 100755 index c98665e..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/AbstractFilter.html +++ /dev/null @@ -1,857 +0,0 @@ - - - - - AbstractFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AbstractFilter Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This is the base class for creating a PIXI filter. Currently only webGL supports filters. -If you want to make a custom filter this should be your base class.

    - -
    - - -
    -

    Constructor

    -
    -

    AbstractFilter

    - - -
    - (
      - -
    • - - fragmentSrc - -
    • - -
    • - - uniforms - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - fragmentSrc - Array - - - - -
      -

      The fragment source in an array of strings.

      - -
      - - -
    • - -
    • - - uniforms - Object - - - - -
      -

      An object containing the uniforms for this filter.

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/AjaxRequest.html b/tutorial-1/pixi.js-master/docs/classes/AjaxRequest.html deleted file mode 100755 index 473c83e..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/AjaxRequest.html +++ /dev/null @@ -1,978 +0,0 @@ - - - - - AjaxRequest - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AjaxRequest Class

    -
    - - - - - -
    - Defined in: src/pixi/utils/Utils.js:108 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    A wrapper for ajax requests to be handled cross browser

    - -
    - - -
    -

    Constructor

    -
    -

    AjaxRequest

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:108 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    bind

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:74 - -

    - - - - - -
    - -
    -

    A polyfill for Function.prototype.bind

    - -
    - - - - - - -
    - - -
    -

    cancelAnimationFrame

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:20 - -

    - - - - - -
    - -
    -

    A polyfill for cancelAnimationFrame

    - -
    - - - - - - -
    - - -
    -

    canUseNewCanvasBlendModes

    - - - () - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:168 - -

    - - - - - -
    - -
    -

    Checks whether the Canvas BlendModes are supported by the current browser

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    whether they are supported

    - - -
    -
    - - - -
    - - -
    -

    getNextPowerOfTwo

    - - -
    - (
      - -
    • - - number - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:189 - -

    - - - - - -
    - -
    -

    Given a number, this function returns the closest number that is a power of two -this function is taken from Starling Framework as its pretty neat ;)

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - number - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    the closest number that is a power of two

    - - -
    -
    - - - -
    - - -
    -

    hex2rgb

    - - -
    - (
      - -
    • - - hex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:54 - -

    - - - - - -
    - -
    -

    Converts a hex color number to an [R, G, B] array

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - hex - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    requestAnimationFrame

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:12 - -

    - - - - - -
    - -
    -

    A polyfill for requestAnimationFrame -You can actually use both requestAnimationFrame and requestAnimFrame, -you will still benefit from the polyfill

    - -
    - - - - - - -
    - - -
    -

    rgb2hex

    - - -
    - (
      - -
    • - - rgb - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:64 - -

    - - - - - -
    - -
    -

    Converts a color as an [R, G, B] array to a hex number

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - rgb - Array - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/AlphaMaskFilter.html b/tutorial-1/pixi.js-master/docs/classes/AlphaMaskFilter.html deleted file mode 100755 index 6c2abe0..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/AlphaMaskFilter.html +++ /dev/null @@ -1,933 +0,0 @@ - - - - - AlphaMaskFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AlphaMaskFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The AlphaMaskFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. -You can use this filter to apply all manor of crazy warping effects -Currently the r property of the texture is used to offset the x and the g property of the texture is used to offset the y.

    - -
    - - -
    -

    Constructor

    -
    -

    AlphaMaskFilter

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AlphaMaskFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The texture used for the displacement map * must be power of 2 texture at the moment

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    onTextureLoaded

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AlphaMaskFilter.js:71 - -

    - - - - - -
    - -
    -

    Sets the map dimensions uniforms when the texture becomes available.

    - -
    - - - - - - -
    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    map

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AlphaMaskFilter.js:84 - -

    - - - - -
    - -
    -

    The texture used for the displacement map. Must be power of 2 sized texture.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/AsciiFilter.html b/tutorial-1/pixi.js-master/docs/classes/AsciiFilter.html deleted file mode 100755 index eee96f8..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/AsciiFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - AsciiFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AsciiFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    An ASCII filter.

    - -
    - - -
    -

    Constructor

    -
    -

    AsciiFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AsciiFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    size

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AsciiFilter.js:73 - -

    - - - - -
    - -
    -

    The pixel size used by the filter.

    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/AssetLoader.html b/tutorial-1/pixi.js-master/docs/classes/AssetLoader.html deleted file mode 100755 index 9485b58..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/AssetLoader.html +++ /dev/null @@ -1,1743 +0,0 @@ - - - - - AssetLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AssetLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    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

    - -
    - - -
    -

    Constructor

    -
    -

    AssetLoader

    - - -
    - (
      - -
    • - - assetURLs - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - 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. Supported bitmap font - data formats include 'xml' and 'fnt'.

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    -

    Events

    - - -
    - -
    - - -
    -

    Methods

    - - -
    -

    _getDataType

    - - -
    - (
      - -
    • - - str - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:74 - -

    - - - - - -
    - -
    -

    Given a filename, returns its extension.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - str - String - - - - -
      -

      the name of the asset

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:107 - -

    - - - - - -
    - -
    -

    Starts loading the assets sequentially

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onAssetLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:143 - -

    - - - - - -
    - -
    -

    Invoked after each file is loaded

    - -
    - - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    assetURLs

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:23 - -

    - - - - -
    - -
    -

    The array of asset URLs that are going to be loaded

    - -
    - - - - - - -
    - - -
    -

    crossorigin

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:31 - -

    - - - - -
    - -
    -

    Whether the requests should be treated as cross origin

    - -
    - - - - - - -
    - - -
    -

    loadersByType

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:39 - -

    - - - - -
    - -
    -

    Maps file extension to loader types

    - -
    - - - - - - -
    - - -
    - - - - - -
    -

    Events

    - - -
    -

    onComplete

    - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:66 - -

    - - - - -
    - -
    -

    Fired when all the assets have loaded

    - -
    - - - - - -
    - - -
    -

    onProgress

    - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:61 - -

    - - - - -
    - -
    -

    Fired when an item has loaded

    - -
    - - - - - -
    - - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/AtlasLoader.html b/tutorial-1/pixi.js-master/docs/classes/AtlasLoader.html deleted file mode 100755 index a7cc254..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/AtlasLoader.html +++ /dev/null @@ -1,1481 +0,0 @@ - - - - - AtlasLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AtlasLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event.

    -

    To generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format.

    -

    It is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to 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.fromFrameId()

    - -
    - - -
    -

    Constructor

    -
    -

    AtlasLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AtlasLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the JSON file

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AtlasLoader.js:32 - -

    - - - - - -
    - -
    -

    Starts loading the JSON file

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onAtlasLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AtlasLoader.js:46 - -

    - - - - - -
    - -
    -

    Invoked when the Atlas has fully loaded. Parses the JSON and builds the texture frames.

    - -
    - - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onError

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AtlasLoader.js:182 - -

    - - - - - -
    - -
    -

    Invoked when an error occurs.

    - -
    - - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AtlasLoader.js:166 - -

    - - - - - -
    - -
    -

    Invoked when json file has loaded.

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/BaseTexture.html b/tutorial-1/pixi.js-master/docs/classes/BaseTexture.html deleted file mode 100755 index ad0c53e..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/BaseTexture.html +++ /dev/null @@ -1,2399 +0,0 @@ - - - - - BaseTexture - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BaseTexture Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A texture stores the information that represents an image. All textures have a base texture.

    - -
    - - -
    -

    Constructor

    -
    -

    BaseTexture

    - - -
    - (
      - -
    • - - source - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:9 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - source - String - - - - -
      -

      the source object (image or canvas)

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:151 - -

    - - - - - -
    - -
    -

    Destroys this base texture

    - -
    - - - - - - -
    - - -
    -

    dirty

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:187 - -

    - - - - - -
    - -
    -

    Sets all glTextures to be dirty.

    - -
    - - - - - - -
    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    fromCanvas

    - - -
    - (
      - -
    • - - canvas - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:270 - -

    - - - - - -
    - -
    -

    Helper function that creates a base texture from the given canvas element.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - canvas - Canvas - - - - -
      -

      The canvas element source of the texture

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - -

    BaseTexture

    - - -
    -
    - - - -
    - - -
    -

    fromImage

    - - -
    - (
      - -
    • - - imageUrl - -
    • - -
    • - - crossorigin - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:228 - -

    - - - - - -
    - -
    -

    Helper function that creates a base texture from the given image url. -If the image is not in the base texture cache it will be created and loaded.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - imageUrl - String - - - - -
      -

      The image url of the texture

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - -

    BaseTexture

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    unloadFromGPU

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:200 - -

    - - - - - -
    - -
    -

    Removes the base texture from the GPU, useful for managing resources on the GPU. -Atexture is still 100% usable and will simply be reuploaded if there is a sprite on screen that is using it.

    - -
    - - - - - - -
    - - -
    -

    updateSourceImage

    - - -
    - (
      - -
    • - - newSrc - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:174 - -

    - - - - - -
    - -
    -

    Changes the source image of the texture

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - newSrc - String - - - - -
      -

      the path of the image

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _dirty

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:95 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    _glTextures

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:85 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    _powerOf2

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:138 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    hasLoaded

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:55 - -

    - - - - -
    - -
    -

    [read-only] Set to true once the base texture has loaded

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:37 - -

    - - - - -
    - -
    -

    [read-only] The height of the base texture set when the image has loaded

    - -
    - - - - - - -
    - - -
    -

    imageUrl

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:132 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    premultipliedAlpha

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:74 - -

    - - - - -
    - -
    -

    Controls if RGB channels should be pre-multiplied by Alpha (WebGL only)

    - -
    - - -

    Default: true

    - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:20 - -

    - - - - -
    - -
    -

    The Resolution of the texture.

    - -
    - - - - - - -
    - - -
    -

    scaleMode

    - PIXI.scaleModes - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:46 - -

    - - - - -
    - -
    -

    The scale mode to apply when scaling this texture

    - -
    - - -

    Default: PIXI.scaleModes.LINEAR

    - - - - - -
    - - -
    -

    source

    - Image - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:64 - -

    - - - - -
    - -
    -

    The image source that is used to create the texture.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:28 - -

    - - - - -
    - -
    -

    [read-only] The width of the base texture set when the image has loaded

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/BitmapFontLoader.html b/tutorial-1/pixi.js-master/docs/classes/BitmapFontLoader.html deleted file mode 100755 index 670a3d2..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/BitmapFontLoader.html +++ /dev/null @@ -1,1641 +0,0 @@ - - - - - BitmapFontLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BitmapFontLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    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

    - -
    - - -
    -

    Constructor

    -
    -

    BitmapFontLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the sprite sheet JSON file

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:57 - -

    - - - - - -
    - -
    -

    Loads the XML font data

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:152 - -

    - - - - - -
    - -
    -

    Invoked when all files are loaded (xml/fnt and texture)

    - -
    - - - - - - -
    - - -
    -

    onXMLLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:72 - -

    - - - - - -
    - -
    -

    Invoked when the XML file is loaded, parses the data.

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    baseUrl

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:35 - -

    - - - - -
    - -
    -

    [read-only] The base url of the bitmap font data

    - -
    - - - - - - -
    - - -
    -

    crossorigin

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:27 - -

    - - - - -
    - -
    -

    Whether the requests should be treated as cross origin

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:44 - -

    - - - - -
    - -
    -

    [read-only] The texture of the bitmap font

    - -
    - - - - - - -
    - - -
    -

    url

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:19 - -

    - - - - -
    - -
    -

    The url of the bitmap font data

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/BitmapText.html b/tutorial-1/pixi.js-master/docs/classes/BitmapText.html deleted file mode 100755 index 2dfc95f..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/BitmapText.html +++ /dev/null @@ -1,6161 +0,0 @@ - - - - - BitmapText - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BitmapText Class

    -
    - - - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A BitmapText object will create a line or multiple lines of text using bitmap font. To split a line you can use '\n', '\r' or '\r\n' in your string. -You can generate the fnt files using -http://www.angelcode.com/products/bmfont/ for windows or -http://www.bmglyph.com/ for mac.

    - -
    - - -
    -

    Constructor

    -
    -

    BitmapText

    - - -
    - (
      - -
    • - - text - -
    • - -
    • - - style - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - text - String - - - - -
      -

      The copy that you would like the text to display

      - -
      - - -
    • - -
    • - - style - Object - - - - -
      -

      The style parameters

      - -
      - - -
        - -
      • - - font - String - - -
        -

        The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)

        - -
        - - -
      • - -
      • - - [align='left'] - String - optional - - -
        -

        Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text

        - -
        - - -
      • - -
      - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStyle

    - - -
    - (
      - -
    • - - style - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:78 - -

    - - - - - -
    - -
    -

    Set the style of the text -style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously) -[style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single lines of text

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - style - Object - - - - -
      -

      The style parameters, contained as properties of an object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setText

    - - -
    - (
      - -
    • - - text - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:66 - -

    - - - - - -
    - -
    -

    Set the text string to be rendered.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - text - String - - - - -
      -

      The text that you would like displayed

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    -

    updateText

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:100 - -

    - - - - - -
    - -
    -

    Renders text and updates it when needed

    - -
    - - - - - - -
    - - -
    -

    updateTransform

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:198 - -

    - - - - - -
    - -
    -

    Updates the transform of this object

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _pool

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:54 - -

    - - - - -
    - -
    -

    The dirty state of this object.

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    textHeight

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:33 - -

    - - - - -
    - -
    -

    [read-only] The height of the overall text, different from fontSize, -which is defined in the style object

    - -
    - - - - - - -
    - - -
    -

    textWidth

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:23 - -

    - - - - -
    - -
    -

    [read-only] The width of the overall text, different from fontSize, -which is defined in the style object

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/BlurFilter.html b/tutorial-1/pixi.js-master/docs/classes/BlurFilter.html deleted file mode 100755 index 0922ab3..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/BlurFilter.html +++ /dev/null @@ -1,946 +0,0 @@ - - - - - BlurFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BlurFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The BlurFilter applies a Gaussian blur to an object. -The strength of the blur can be set for x- and y-axis separately (always relative to the stage).

    - -
    - - -
    -

    Constructor

    -
    -

    BlurFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number the strength of the blur - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurFilter.js:24 - -

    - - - - -
    - -
    -

    Sets the strength of both the blurX and blurY properties simultaneously

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    blurX

    - Number the strength of the blurX - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurFilter.js:40 - -

    - - - - -
    - -
    -

    Sets the strength of the blurX property

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    blurY

    - Number the strength of the blurY - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurFilter.js:56 - -

    - - - - -
    - -
    -

    Sets the strength of the blurY property

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/BlurXFilter.html b/tutorial-1/pixi.js-master/docs/classes/BlurXFilter.html deleted file mode 100755 index a29861a..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/BlurXFilter.html +++ /dev/null @@ -1,837 +0,0 @@ - - - - - BlurXFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BlurXFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The BlurXFilter applies a horizontal Gaussian blur to an object.

    - -
    - - -
    -

    Constructor

    -
    -

    BlurXFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurXFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number the strength of the blur - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurXFilter.js:51 - -

    - - - - -
    - -
    -

    Sets the strength of both the blur.

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/BlurYFilter.html b/tutorial-1/pixi.js-master/docs/classes/BlurYFilter.html deleted file mode 100755 index e2e564b..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/BlurYFilter.html +++ /dev/null @@ -1,837 +0,0 @@ - - - - - BlurYFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BlurYFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The BlurYFilter applies a vertical Gaussian blur to an object.

    - -
    - - -
    -

    Constructor

    -
    -

    BlurYFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurYFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number the strength of the blur - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurYFilter.js:51 - -

    - - - - -
    - -
    -

    Sets the strength of both the blur.

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/CanvasBuffer.html b/tutorial-1/pixi.js-master/docs/classes/CanvasBuffer.html deleted file mode 100755 index e39dba6..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/CanvasBuffer.html +++ /dev/null @@ -1,868 +0,0 @@ - - - - - CanvasBuffer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CanvasBuffer Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    Creates a Canvas element of the given size.

    - -
    - - -
    -

    Constructor

    -
    -

    CanvasBuffer

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      the width for the newly created canvas

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the height for the newly created canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clear

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:53 - -

    - - - - - -
    - -
    -

    Clears the canvas that was created by the CanvasBuffer class.

    - -
    - - - - - - -
    - - -
    -

    resize

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:65 - -

    - - - - - -
    - -
    -

    Resizes the canvas to the specified width and height.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      the new width of the canvas

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the new height of the canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    canvas

    - HTMLCanvasElement - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:31 - -

    - - - - -
    - -
    -

    The Canvas object that belongs to this CanvasBuffer.

    - -
    - - - - - - -
    - - -
    -

    context

    - CanvasRenderingContext2D - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:39 - -

    - - - - -
    - -
    -

    A CanvasRenderingContext2D object representing a two-dimensional rendering context.

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:23 - -

    - - - - -
    - -
    -

    The height of the Canvas in pixels.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:15 - -

    - - - - -
    - -
    -

    The width of the Canvas in pixels.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/CanvasGraphics.html b/tutorial-1/pixi.js-master/docs/classes/CanvasGraphics.html deleted file mode 100755 index 59addfe..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/CanvasGraphics.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - CanvasGraphics - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CanvasGraphics Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A set of functions used by the canvas renderer to draw the primitive graphics data.

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - - - - - - - -
    - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/CanvasMaskManager.html b/tutorial-1/pixi.js-master/docs/classes/CanvasMaskManager.html deleted file mode 100755 index 0a31f57..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/CanvasMaskManager.html +++ /dev/null @@ -1,620 +0,0 @@ - - - - - CanvasMaskManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CanvasMaskManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A set of functions used to handle masking.

    - -
    - - -
    -

    Constructor

    -
    -

    CanvasMaskManager

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasMaskManager.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    popMask

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasMaskManager.js:49 - -

    - - - - - -
    - -
    -

    Restores the current drawing context to the state it was before the mask was applied.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The renderSession whose context will be used for this mask manager.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    pushMask

    - - -
    - (
      - -
    • - - maskData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasMaskManager.js:17 - -

    - - - - - -
    - -
    -

    This method adds it to the current stack of masks.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - maskData - Object - - - - -
      -

      the maskData that will be pushed

      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      -

      The renderSession whose context will be used for this mask manager.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/CanvasRenderer.html b/tutorial-1/pixi.js-master/docs/classes/CanvasRenderer.html deleted file mode 100755 index 5c96035..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/CanvasRenderer.html +++ /dev/null @@ -1,1761 +0,0 @@ - - - - - CanvasRenderer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CanvasRenderer Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The CanvasRenderer draws the Stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. -Don't forget to add the CanvasRenderer.view to your DOM or you will not see anything :)

    - -
    - - -
    -

    Constructor

    -
    -

    CanvasRenderer

    - - -
    - (
      - -
    • - - [width=800] - -
    • - -
    • - - [height=600] - -
    • - -
    • - - [options] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - [width=800] - Number - optional - - - - -
      -

      the width of the canvas view

      - -
      - - -
    • - -
    • - - [height=600] - Number - optional - - - - -
      -

      the height of the canvas view

      - -
      - - -
    • - -
    • - - [options] - Object - optional - - - - -
      -

      The optional renderer parameters

      - -
      - - -
        - -
      • - - [view] - HTMLCanvasElement - optional - - -
        -

        the canvas to use as a view, optional

        - -
        - - -
      • - -
      • - - [transparent=false] - Boolean - optional - - -
        -

        If the render view is transparent, default false

        - -
        - - -
      • - -
      • - - [autoResize=false] - Boolean - optional - - -
        -

        If the render view is automatically resized, default false

        - -
        - - -
      • - -
      • - - [resolution=1] - Number - optional - - -
        -

        the resolution of the renderer retina would be 2

        - -
        - - -
      • - -
      • - - [clearBeforeRender=true] - Boolean - optional - - -
        -

        This sets if the CanvasRenderer will clear the canvas or not before the new render pass.

        - -
        - - -
      • - -
      - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - -
    - (
      - -
    • - - [removeView=true] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:233 - -

    - - - - - -
    - -
    -

    Removes everything from the renderer and optionally removes the Canvas DOM element.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - [removeView=true] - Boolean - optional - - - - -
      -

      Removes the Canvas element from the DOM.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    mapBlendModes

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:291 - -

    - - - - - -
    - -
    -

    Maps Pixi blend modes to canvas blend modes.

    - -
    - - - - - - -
    - - -
    -

    render

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:184 - -

    - - - - - -
    - -
    -

    Renders the Stage to this canvas view

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the Stage element to be rendered

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderDisplayObject

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - context - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:276 - -

    - - - - - -
    - -
    -

    Renders a display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      The displayObject to render

      - -
      - - -
    • - -
    • - - context - CanvasRenderingContext2D - - - - -
      -

      the context 2d method of the canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    resize

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:255 - -

    - - - - - -
    - -
    -

    Resizes the canvas view to the specified width and height

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      the new width of the canvas view

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the new height of the canvas view

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    autoResize

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:76 - -

    - - - - -
    - -
    -

    Whether the render view should be resized automatically

    - -
    - - - - - - -
    - - -
    -

    CanvasMaskManager

    - CanvasMaskManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:140 - -

    - - - - -
    - -
    -

    Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer

    - -
    - - - - - - -
    - - -
    -

    clearBeforeRender

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:56 - -

    - - - - -
    - -
    -

    This sets if the CanvasRenderer will clear the canvas or not before the new render pass. -If the Stage is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color. -If the Stage is transparent Pixi will use clearRect to clear the canvas every frame. -Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.

    - -
    - - - - - - -
    - - -
    -

    context

    - CanvasRenderingContext2D - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:114 - -

    - - - - -
    - -
    -

    The canvas 2d context that everything is drawn with

    - -
    - - - - - - -
    - - -
    -

    count

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:132 - -

    - - - - -
    - -
    -

    Internal var.

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:94 - -

    - - - - -
    - -
    -

    The height of the canvas view

    - -
    - - -

    Default: 600

    - - - - - -
    - - -
    -

    refresh

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:121 - -

    - - - - -
    - -
    -

    Boolean flag controlling canvas refresh.

    - -
    - - - - - - -
    - - -
    -

    renderSession

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:147 - -

    - - - - -
    - -
    -

    The render session is just a bunch of parameter used for rendering

    - -
    - - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:48 - -

    - - - - -
    - -
    -

    The resolution of the canvas.

    - -
    - - - - - - -
    - - -
    -

    transparent

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:68 - -

    - - - - -
    - -
    -

    Whether the render view is transparent

    - -
    - - - - - - -
    - - -
    -

    type

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:40 - -

    - - - - -
    - -
    -

    The renderer type.

    - -
    - - - - - - -
    - - -
    -

    view

    - HTMLCanvasElement - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:106 - -

    - - - - -
    - -
    -

    The canvas element that everything is drawn to.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:85 - -

    - - - - -
    - -
    -

    The width of the canvas view

    - -
    - - -

    Default: 800

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/CanvasTinter.html b/tutorial-1/pixi.js-master/docs/classes/CanvasTinter.html deleted file mode 100755 index 3cedea0..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/CanvasTinter.html +++ /dev/null @@ -1,1293 +0,0 @@ - - - - - CanvasTinter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CanvasTinter Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    CanvasTinter

    - - - () - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    getTintedTexture

    - - -
    - (
      - -
    • - - sprite - -
    • - -
    • - - color - -
    • - -
    ) -
    - - - - - HTMLCanvasElement - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:14 - -

    - - - - - -
    - -
    -

    Basically this method just needs a sprite and a color and tints the sprite with the given color.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - sprite - Sprite - - - - -
      -

      the sprite to tint

      - -
      - - -
    • - -
    • - - color - Number - - - - -
      -

      the color to use to tint the sprite with

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - HTMLCanvasElement: - -

    The tinted canvas

    - - -
    -
    - - - -
    - - -
    -

    roundColor

    - - -
    - (
      - -
    • - - color - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:184 - -

    - - - - - -
    - -
    -

    Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - color - Number - - - - -
      -

      the color to round, should be a hex color

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    tintMethod

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:227 - -

    - - - - - -
    - -
    -

    The tinting method that will be used.

    - -
    - - - - - - -
    - - -
    -

    tintPerPixel

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - color - -
    • - -
    • - - canvas - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:139 - -

    - - - - - -
    - -
    -

    Tint a texture pixel per pixel.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      the texture to tint

      - -
      - - -
    • - -
    • - - color - Number - - - - -
      -

      the color to use to tint the sprite with

      - -
      - - -
    • - -
    • - - canvas - HTMLCanvasElement - - - - -
      -

      the current canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    tintWithMultiply

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - color - -
    • - -
    • - - canvas - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:58 - -

    - - - - - -
    - -
    -

    Tint a texture using the "multiply" operation.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      the texture to tint

      - -
      - - -
    • - -
    • - - color - Number - - - - -
      -

      the color to use to tint the sprite with

      - -
      - - -
    • - -
    • - - canvas - HTMLCanvasElement - - - - -
      -

      the current canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    tintWithOverlay

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - color - -
    • - -
    • - - canvas - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:104 - -

    - - - - - -
    - -
    -

    Tint a texture using the "overlay" operation.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      the texture to tint

      - -
      - - -
    • - -
    • - - color - Number - - - - -
      -

      the color to use to tint the sprite with

      - -
      - - -
    • - -
    • - - canvas - HTMLCanvasElement - - - - -
      -

      the current canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    cacheStepsPerColorChannel

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:203 - -

    - - - - -
    - -
    -

    Number of steps which will be used as a cap when rounding colors.

    - -
    - - - - - - -
    - - -
    -

    canUseMultiply

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:219 - -

    - - - - -
    - -
    -

    Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method.

    - -
    - - - - - - -
    - - -
    -

    convertTintToImage

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:211 - -

    - - - - -
    - -
    -

    Tint cache boolean flag.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/Circle.html b/tutorial-1/pixi.js-master/docs/classes/Circle.html deleted file mode 100755 index f65b051..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/Circle.html +++ /dev/null @@ -1,955 +0,0 @@ - - - - - Circle - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Circle Class

    -
    - - - - - -
    - Defined in: src/pixi/geom/Circle.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Circle object can be used to specify a hit area for displayObjects

    - -
    - - -
    -

    Constructor

    -
    -

    Circle

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - radius - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the center of this circle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the center of this circle

      - -
      - - -
    • - -
    • - - radius - Number - - - - -
      -

      The radius of the circle

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - -
      - -
    • - radius - - - -
    • - -
    • - x - - - -
    • - -
    • - y - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Circle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:38 - -

    - - - - - -
    - -
    -

    Creates a clone of this Circle instance

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Circle: - -

    a copy of the Circle

    - - -
    -
    - - - -
    - - -
    -

    contains

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:49 - -

    - - - - - -
    - -
    -

    Checks whether the x and y coordinates given are contained within this circle

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the point to test

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the point to test

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Whether the x/y coordinates are within this Circle

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:72 - -

    - - - - - -
    - -
    -

    Returns the framing rectangle of the circle as a PIXI.Rectangle object

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    radius

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:30 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:16 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:23 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/ColorMatrixFilter.html b/tutorial-1/pixi.js-master/docs/classes/ColorMatrixFilter.html deleted file mode 100755 index c1a365b..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/ColorMatrixFilter.html +++ /dev/null @@ -1,839 +0,0 @@ - - - - - ColorMatrixFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    ColorMatrixFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The ColorMatrixFilter class lets you apply a 4x4 matrix transformation on the RGBA -color and alpha values of every pixel on your displayObject to produce a result -with a new set of RGBA color and alpha values. It's pretty powerful!

    - -
    - - -
    -

    Constructor

    -
    -

    ColorMatrixFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ColorMatrixFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    matrix

    - Array and array of 26 numbers - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ColorMatrixFilter.js:46 - -

    - - - - -
    - -
    -

    Sets the matrix of the color matrix filter

    - -
    - - -

    Default: [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]

    - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/ColorStepFilter.html b/tutorial-1/pixi.js-master/docs/classes/ColorStepFilter.html deleted file mode 100755 index 74ec410..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/ColorStepFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - ColorStepFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    ColorStepFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This lowers the color depth of your image by the given amount, producing an image with a smaller palette.

    - -
    - - -
    -

    Constructor

    -
    -

    ColorStepFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ColorStepFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    step

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ColorStepFilter.js:41 - -

    - - - - -
    - -
    -

    The number of steps to reduce the palette by.

    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/ComplexPrimitiveShader.html b/tutorial-1/pixi.js-master/docs/classes/ComplexPrimitiveShader.html deleted file mode 100755 index 7d2a7a7..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/ComplexPrimitiveShader.html +++ /dev/null @@ -1,839 +0,0 @@ - - - - - ComplexPrimitiveShader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    ComplexPrimitiveShader Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    ComplexPrimitiveShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:109 - -

    - - - - - -
    - -
    -

    Destroys the shader.

    - -
    - - - - - - -
    - - -
    -

    init

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:79 - -

    - - - - - -
    - -
    -

    Initialises the shader.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _UID

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:32 - -

    - - - - -
    - -
    -

    The fragment shader.

    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:19 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    program

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:25 - -

    - - - - -
    - -
    -

    The WebGL program.

    - -
    - - - - - - -
    - - -
    -

    vertexSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:48 - -

    - - - - -
    - -
    -

    The vertex shader.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/ConvolutionFilter.html b/tutorial-1/pixi.js-master/docs/classes/ConvolutionFilter.html deleted file mode 100755 index 2177569..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/ConvolutionFilter.html +++ /dev/null @@ -1,1020 +0,0 @@ - - - - - ConvolutionFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    ConvolutionFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The ConvolutionFilter class applies a matrix convolution filter effect. -A convolution combines pixels in the input image with neighboring pixels to produce a new image. -A wide variety of image effects can be achieved through convolutions, including blurring, edge detection, sharpening, embossing, and beveling. -The matrix should be specified as a 9 point Array. See http://docs.gimp.org/en/plug-in-convmatrix.html for more info.

    - -
    - - -
    -

    Constructor

    -
    -

    ConvolutionFilter

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ConvolutionFilter.js:1 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Array - - - - -
      -

      An array of values used for matrix transformation. Specified as a 9 point Array.

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      Width of the object you are transforming

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      Height of the object you are transforming

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ConvolutionFilter.js:93 - -

    - - - - -
    - -
    -

    Height of the object you are transforming

    - -
    - - - - - - -
    - - -
    -

    matrix

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ConvolutionFilter.js:63 - -

    - - - - -
    - -
    -

    An array of values used for matrix transformation. Specified as a 9 point Array.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ConvolutionFilter.js:78 - -

    - - - - -
    - -
    -

    Width of the object you are transforming

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/CrossHatchFilter.html b/tutorial-1/pixi.js-master/docs/classes/CrossHatchFilter.html deleted file mode 100755 index 0f422cc..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/CrossHatchFilter.html +++ /dev/null @@ -1,837 +0,0 @@ - - - - - CrossHatchFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CrossHatchFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A Cross Hatch effect filter.

    - -
    - - -
    -

    Constructor

    -
    -

    CrossHatchFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/CrossHatchFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number the strength of the blur - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/CrossHatchFilter.js:65 - -

    - - - - -
    - -
    -

    Sets the strength of both the blur.

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/DisplacementFilter.html b/tutorial-1/pixi.js-master/docs/classes/DisplacementFilter.html deleted file mode 100755 index 9871925..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/DisplacementFilter.html +++ /dev/null @@ -1,1037 +0,0 @@ - - - - - DisplacementFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    DisplacementFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The DisplacementFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. -You can use this filter to apply all manor of crazy warping effects -Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.

    - -
    - - -
    -

    Constructor

    -
    -

    DisplacementFilter

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DisplacementFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The texture used for the displacement map * must be power of 2 texture at the moment

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    onTextureLoaded

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DisplacementFilter.js:78 - -

    - - - - - -
    - -
    -

    Sets the map dimensions uniforms when the texture becomes available.

    - -
    - - - - - - -
    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    map

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DisplacementFilter.js:91 - -

    - - - - -
    - -
    -

    The texture used for the displacement map. Must be power of 2 texture.

    - -
    - - - - - - -
    - - -
    -

    offset

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DisplacementFilter.js:121 - -

    - - - - -
    - -
    -

    The offset used to move the displacement map.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DisplacementFilter.js:106 - -

    - - - - -
    - -
    -

    The multiplier used to scale the displacement result from the map calculation.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/DisplayObject.html b/tutorial-1/pixi.js-master/docs/classes/DisplayObject.html deleted file mode 100755 index bb55a56..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/DisplayObject.html +++ /dev/null @@ -1,4530 +0,0 @@ - - - - - DisplayObject - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    DisplayObject Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The base class for all objects that are rendered on the screen. -This is an abstract class and should not be used on its own rather it should be extended.

    - -
    - - -
    -

    Constructor

    -
    -

    DisplayObject

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:719 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:705 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    ) -
    - - - - - Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:523 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObject as a rectangle object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Matrix - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:536 - -

    - - - - - -
    - -
    -

    Retrieves the local bounds of the displayObject as a rectangle object

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:547 - -

    - - - - - -
    - -
    -

    Sets the object's stage reference, the stage this object is connected to

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the object will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:188 - -

    - - - - -
    - -
    -

    The original, cached mask of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/DisplayObjectContainer.html b/tutorial-1/pixi.js-master/docs/classes/DisplayObjectContainer.html deleted file mode 100755 index a2f19a5..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/DisplayObjectContainer.html +++ /dev/null @@ -1,5576 +0,0 @@ - - - - - DisplayObjectContainer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    DisplayObjectContainer Class

    -
    - - - -
    - Extends DisplayObject -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A DisplayObjectContainer represents a collection of display objects. -It is the base class of all display objects that act as a container for other objects.

    - -
    - - -
    -

    Constructor

    -
    -

    DisplayObjectContainer

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/DotScreenFilter.html b/tutorial-1/pixi.js-master/docs/classes/DotScreenFilter.html deleted file mode 100755 index dc7b6d7..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/DotScreenFilter.html +++ /dev/null @@ -1,887 +0,0 @@ - - - - - DotScreenFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    DotScreenFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This filter applies a dotscreen effect making display objects appear to be made out of black and white halftone dots like an old printer.

    - -
    - - -
    -

    Constructor

    -
    -

    DotScreenFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DotScreenFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    angle

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DotScreenFilter.js:72 - -

    - - - - -
    - -
    -

    The radius of the effect.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DotScreenFilter.js:57 - -

    - - - - -
    - -
    -

    The scale of the effect.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/Ellipse.html b/tutorial-1/pixi.js-master/docs/classes/Ellipse.html deleted file mode 100755 index 8c53367..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/Ellipse.html +++ /dev/null @@ -1,1030 +0,0 @@ - - - - - Ellipse - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Ellipse Class

    -
    - - - - - -
    - Defined in: src/pixi/geom/Ellipse.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Ellipse object can be used to specify a hit area for displayObjects

    - -
    - - -
    -

    Constructor

    -
    -

    Ellipse

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the center of the ellipse

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the center of the ellipse

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The half width of this ellipse

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The half height of this ellipse

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - -
      - -
    • - height - - - -
    • - -
    • - width - - - -
    • - -
    • - x - - - -
    • - -
    • - y - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Ellipse - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:46 - -

    - - - - - -
    - -
    -

    Creates a clone of this Ellipse instance

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Ellipse: - -

    a copy of the ellipse

    - - -
    -
    - - - -
    - - -
    -

    contains

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:57 - -

    - - - - - -
    - -
    -

    Checks whether the x and y coordinates given are contained within this ellipse

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the point to test

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the point to test

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Whether the x/y coords are within this ellipse

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:80 - -

    - - - - - -
    - -
    -

    Returns the framing rectangle of the ellipse as a PIXI.Rectangle object

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:38 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:31 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:17 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:24 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/Event.html b/tutorial-1/pixi.js-master/docs/classes/Event.html deleted file mode 100755 index 417223d..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/Event.html +++ /dev/null @@ -1,946 +0,0 @@ - - - - - Event - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Event Class

    -
    - - - -
    - Extends Object -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    Creates an homogenous object for tracking events so users can know what to expect.

    - -
    - - -
    -

    Constructor

    -
    -

    Event

    - - -
    - (
      - -
    • - - target - -
    • - -
    • - - name - -
    • - -
    • - - data - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:192 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - target - Object - - - - -
      -

      The target object that the event is called on

      - -
      - - -
    • - -
    • - - name - String - - - - -
      -

      The string name of the event that was triggered

      - -
      - - -
    • - -
    • - - data - Object - - - - -
      -

      Arbitrary event data to pass along

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    stopImmediatePropagation

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:277 - -

    - - - - - -
    - -
    -

    Stops the propagation of events to sibling listeners (no longer calls any listeners).

    - -
    - - - - - - -
    - - -
    -

    stopPropagation

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:268 - -

    - - - - - -
    - -
    -

    Stops the propagation of events up the scene graph (prevents bubbling).

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    data

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:246 - -

    - - - - -
    - -
    -

    The data that was passed in with this event.

    - -
    - - - - - - -
    - - -
    -

    stopped

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:206 - -

    - - - - -
    - -
    -

    Tracks the state of bubbling propagation. Do not -set this directly, instead use event.stopPropagation()

    - -
    - - - - - - -
    - - -
    -

    stoppedImmediate

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:217 - -

    - - - - -
    - -
    -

    Tracks the state of sibling listener propagation. Do not -set this directly, instead use event.stopImmediatePropagation()

    - -
    - - - - - - -
    - - -
    -

    target

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:228 - -

    - - - - -
    - -
    -

    The original target the event triggered on.

    - -
    - - - - - - -
    - - -
    -

    timeStamp

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:258 - -

    - - - - -
    - -
    -

    The timestamp when the event occurred.

    - -
    - - - - - - -
    - - -
    -

    type

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:237 - -

    - - - - -
    - -
    -

    The string name of the event that this represents.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/EventTarget.html b/tutorial-1/pixi.js-master/docs/classes/EventTarget.html deleted file mode 100755 index caab8e5..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/EventTarget.html +++ /dev/null @@ -1,1123 +0,0 @@ - - - - - EventTarget - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    EventTarget Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    Mixins event emitter functionality to a class

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/FilterBlock.html b/tutorial-1/pixi.js-master/docs/classes/FilterBlock.html deleted file mode 100755 index 381971a..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/FilterBlock.html +++ /dev/null @@ -1,510 +0,0 @@ - - - - - FilterBlock - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    FilterBlock Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A target and pass info object for filters.

    - -
    - - -
    -

    Constructor

    -
    -

    FilterBlock

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/FilterBlock.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - - - -
    -

    Properties

    - - -
    - - - - - -
    - - - - -
    -

    Properties

    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/FilterBlock.js:21 - -

    - - - - -
    - -
    -

    The renderable state of this FilterBlock.

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/FilterBlock.js:13 - -

    - - - - -
    - -
    -

    The visible state of this FilterBlock.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/FilterTexture.html b/tutorial-1/pixi.js-master/docs/classes/FilterTexture.html deleted file mode 100755 index fa30bda..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/FilterTexture.html +++ /dev/null @@ -1,967 +0,0 @@ - - - - - FilterTexture - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    FilterTexture Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    FilterTexture

    - - -
    - (
      - -
    • - - gl - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      the horizontal range of the filter

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the vertical range of the filter

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clear

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:61 - -

    - - - - - -
    - -
    -

    Clears the filter texture.

    - -
    - - - - - - -
    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:97 - -

    - - - - - -
    - -
    -

    Destroys the filter texture.

    - -
    - - - - - - -
    - - -
    -

    resize

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:74 - -

    - - - - - -
    - -
    -

    Resizes the texture to the specified width and height

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      the new width of the texture

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the new height of the texture

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    frameBuffer

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:23 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:15 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    scaleMode

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:35 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    texture

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:29 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/Graphics.html b/tutorial-1/pixi.js-master/docs/classes/Graphics.html deleted file mode 100755 index 2d012fa..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/Graphics.html +++ /dev/null @@ -1,8669 +0,0 @@ - - - - - Graphics - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Graphics Class

    -
    - - - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and color and fill them.

    - -
    - - -
    -

    Constructor

    -
    -

    Graphics

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:983 - -

    - - - - - -
    - -
    -

    Generates the cached sprite when the sprite has cacheAsBitmap = true

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:736 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:656 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    arc

    - - -
    - (
      - -
    • - - cx - -
    • - -
    • - - cy - -
    • - -
    • - - radius - -
    • - -
    • - - startAngle - -
    • - -
    • - - endAngle - -
    • - -
    • - - anticlockwise - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:414 - -

    - - - - - -
    - -
    -

    The arc method creates an arc/curve (used to create circles, or parts of circles).

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - cx - Number - - - - -
      -

      The x-coordinate of the center of the circle

      - -
      - - -
    • - -
    • - - cy - Number - - - - -
      -

      The y-coordinate of the center of the circle

      - -
      - - -
    • - -
    • - - radius - Number - - - - -
      -

      The radius of the circle

      - -
      - - -
    • - -
    • - - startAngle - Number - - - - -
      -

      The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle)

      - -
      - - -
    • - -
    • - - endAngle - Number - - - - -
      -

      The ending angle, in radians

      - -
      - - -
    • - -
    • - - anticlockwise - Boolean - - - - -
      -

      Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    beginFill

    - - -
    - (
      - -
    • - - color - -
    • - -
    • - - alpha - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:488 - -

    - - - - - -
    - -
    -

    Specifies a simple one-color fill that subsequent calls to other Graphics methods -(such as lineTo() or drawCircle()) use when drawing.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - color - Number - - - - -
      -

      the color of the fill

      - -
      - - -
    • - -
    • - - alpha - Number - - - - -
      -

      the alpha of the fill

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    bezierCurveTo

    - - -
    - (
      - -
    • - - cpX - -
    • - -
    • - - cpY - -
    • - -
    • - - cpX2 - -
    • - -
    • - - cpY2 - -
    • - -
    • - - toX - -
    • - -
    • - - toY - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:287 - -

    - - - - - -
    - -
    -

    Calculate the points for a bezier curve and then draws it.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - cpX - Number - - - - -
      -

      Control point x

      - -
      - - -
    • - -
    • - - cpY - Number - - - - -
      -

      Control point y

      - -
      - - -
    • - -
    • - - cpX2 - Number - - - - -
      -

      Second Control point x

      - -
      - - -
    • - -
    • - - cpY2 - Number - - - - -
      -

      Second Control point y

      - -
      - - -
    • - -
    • - - toX - Number - - - - -
      -

      Destination point x

      - -
      - - -
    • - -
    • - - toY - Number - - - - -
      -

      Destination point y

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    clear

    - - - () - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:609 - -

    - - - - - -
    - -
    -

    Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    destroyCachedSprite

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:1047 - -

    - - - - - -
    - -
    -

    Destroys a previous cached sprite.

    - -
    - - - - - - -
    - - -
    -

    drawCircle

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - radius - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:562 - -

    - - - - - -
    - -
    -

    Draws a circle.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the center of the circle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the center of the circle

      - -
      - - -
    • - -
    • - - radius - Number - - - - -
      -

      The radius of the circle

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    drawEllipse

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:578 - -

    - - - - - -
    - -
    -

    Draws an ellipse.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the center of the ellipse

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the center of the ellipse

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The half width of the ellipse

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The half height of the ellipse

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    drawPolygon

    - - -
    - (
      - -
    • - - path - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:595 - -

    - - - - - -
    - -
    -

    Draws a polygon using the given path.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - path - Array - - - - -
      -

      The path data used to construct the polygon.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    drawRect

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:530 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coord of the top-left of the rectangle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coord of the top-left of the rectangle

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The width of the rectangle

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The height of the rectangle

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    drawRoundedRect

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    • - - radius - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:546 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coord of the top-left of the rectangle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coord of the top-left of the rectangle

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The width of the rectangle

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The height of the rectangle

      - -
      - - -
    • - -
    • - - radius - Number - - - - -
      -

      Radius of the rectangle corners

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    drawShape

    - - -
    - (
      - -
    • - - shape - -
    • - -
    ) -
    - - - - - GraphicsData - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:1061 - -

    - - - - - -
    - -
    -

    Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - -
    -

    Returns:

    - -
    - - - GraphicsData: - -

    The generated GraphicsData object.

    - - -
    -
    - - - -
    - - -
    -

    endFill

    - - - () - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:515 - -

    - - - - - -
    - -
    -

    Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:627 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the graphics object that can then be used to create sprites -This can be quite useful if your geometry is complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:805 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the graphic shape as a rectangle object

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    lineStyle

    - - -
    - (
      - -
    • - - lineWidth - -
    • - -
    • - - color - -
    • - -
    • - - alpha - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:171 - -

    - - - - - -
    - -
    -

    Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - lineWidth - Number - - - - -
      -

      width of the line to draw, will update the objects stored style

      - -
      - - -
    • - -
    • - - color - Number - - - - -
      -

      color of the line to draw, will update the objects stored style

      - -
      - - -
    • - -
    • - - alpha - Number - - - - -
      -

      alpha of the line to draw, will update the objects stored style

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    lineTo

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:220 - -

    - - - - - -
    - -
    -

    Draws a line using the current line style from the current drawing position to (x, y); -The current drawing position is then set to (x, y).

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      the X coordinate to draw to

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      the Y coordinate to draw to

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    moveTo

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:205 - -

    - - - - - -
    - -
    -

    Moves the current drawing position to x, y.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      the X coordinate to move to

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      the Y coordinate to move to

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    quadraticCurveTo

    - - -
    - (
      - -
    • - - cpX - -
    • - -
    • - - cpY - -
    • - -
    • - - toX - -
    • - -
    • - - toY - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:237 - -

    - - - - - -
    - -
    -

    Calculate the points for a quadratic bezier curve and then draws it. -Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - cpX - Number - - - - -
      -

      Control point x

      - -
      - - -
    • - -
    • - - cpY - Number - - - - -
      -

      Control point y

      - -
      - - -
    • - -
    • - - toX - Number - - - - -
      -

      Destination point x

      - -
      - - -
    • - -
    • - - toY - Number - - - - -
      -

      Destination point y

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    -

    updateCachedSpriteTexture

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:1023 - -

    - - - - - -
    - -
    -

    Updates texture size based on canvas size

    - -
    - - - - - - -
    - - -
    -

    updateLocalBounds

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:884 - -

    - - - - - -
    - -
    -

    Update the bounds of the object

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _webGL

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:79 - -

    - - - - -
    - -
    -

    Array containing some WebGL-related properties used by the WebGL renderer.

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    blendMode

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:61 - -

    - - - - -
    - -
    -

    The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode.

    - -
    - - -

    Default: PIXI.blendModes.NORMAL;

    - - - - - -
    - - -
    -

    boundsPadding

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:96 - -

    - - - - -
    - -
    -

    The bounds' padding used for bounds calculation.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:139 - -

    - - - - -
    - -
    -

    When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. -This is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory. -It is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas. -This is not recommended if you are constantly redrawing the graphics element.

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    cachedSpriteDirty

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:124 - -

    - - - - -
    - -
    -

    Used to detect if the cached sprite object needs to be updated.

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    currentPath

    - Object - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:70 - -

    - - - - -
    - -
    -

    Current path

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:106 - -

    - - - - -
    - -
    -

    Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated.

    - -
    - - - - - - -
    - - -
    -

    fillAlpha

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:18 - -

    - - - - -
    - -
    -

    The alpha value used when filling the Graphics object.

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    graphicsData

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:43 - -

    - - - - -
    - -
    -

    Graphics data

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    isMask

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:88 - -

    - - - - -
    - -
    -

    Whether this shape is being used as a mask.

    - -
    - - - - - - -
    - - -
    -

    lineColor

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:34 - -

    - - - - -
    - -
    -

    The color of any lines drawn.

    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    lineWidth

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:26 - -

    - - - - -
    - -
    -

    The width (thickness) of any lines drawn.

    - -
    - - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    tint

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:52 - -

    - - - - -
    - -
    -

    The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint.

    - -
    - - -

    Default: 0xFFFFFF

    - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    webGLDirty

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:115 - -

    - - - - -
    - -
    -

    Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/GraphicsData.html b/tutorial-1/pixi.js-master/docs/classes/GraphicsData.html deleted file mode 100755 index dc8ff74..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/GraphicsData.html +++ /dev/null @@ -1,390 +0,0 @@ - - - - - GraphicsData - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    GraphicsData Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A GraphicsData object.

    - -
    - - -
    -

    Constructor

    -
    -

    GraphicsData

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:1093 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - - - - - - - -
    - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/GrayFilter.html b/tutorial-1/pixi.js-master/docs/classes/GrayFilter.html deleted file mode 100755 index cbf95ad..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/GrayFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - GrayFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    GrayFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This greyscales the palette of your Display Objects.

    - -
    - - -
    -

    Constructor

    -
    -

    GrayFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/GrayFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    gray

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/GrayFilter.js:41 - -

    - - - - -
    - -
    -

    The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/ImageLoader.html b/tutorial-1/pixi.js-master/docs/classes/ImageLoader.html deleted file mode 100755 index 6b068d2..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/ImageLoader.html +++ /dev/null @@ -1,1613 +0,0 @@ - - - - - ImageLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    ImageLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    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.fromFrame() and PIXI.Sprite.fromFrame() -When loaded this class will dispatch a 'loaded' event

    - -
    - - -
    -

    Constructor

    -
    -

    ImageLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the image

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:42 - -

    - - - - - -
    - -
    -

    Loads image or takes it from cache

    - -
    - - - - - - -
    - - -
    -

    loadFramedSpriteSheet

    - - -
    - (
      - -
    • - - frameWidth - -
    • - -
    • - - frameHeight - -
    • - -
    • - - textureName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:70 - -

    - - - - - -
    - -
    -

    Loads image and split it to uniform sized frames

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frameWidth - Number - - - - -
      -

      width of each frame

      - -
      - - -
    • - -
    • - - frameHeight - Number - - - - -
      -

      height of each frame

      - -
      - - -
    • - -
    • - - textureName - String - - - - -
      -

      if given, the frames will be cached in - format

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:59 - -

    - - - - - -
    - -
    -

    Invoked when image file is loaded or it is already cached and ready to use

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    frames

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:26 - -

    - - - - -
    - -
    -

    if the image is loaded with loadFramedSpriteSheet -frames will contain the sprite sheet frames

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:18 - -

    - - - - -
    - -
    -

    The texture being loaded

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/InteractionData.html b/tutorial-1/pixi.js-master/docs/classes/InteractionData.html deleted file mode 100755 index b31635a..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/InteractionData.html +++ /dev/null @@ -1,715 +0,0 @@ - - - - - InteractionData - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    InteractionData Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    Holds all information related to an Interaction event

    - -
    - - -
    -

    Constructor

    -
    -

    InteractionData

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionData.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    getLocalPosition

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - [point] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionData.js:38 - -

    - - - - - -
    - -
    -

    This will return the local coordinates of the specified displayObject for this InteractionData

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      The DisplayObject that you would like the local coords off

      - -
      - - -
    • - -
    • - - [point] - Point - optional - - - - -
      -

      A Point object in which to store the value, optional (otherwise will create a new point)

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point containing the coordinates of the InteractionData position relative to the DisplayObject

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    global

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionData.js:13 - -

    - - - - -
    - -
    -

    This point stores the global coords of where the touch/mouse event happened

    - -
    - - - - - - -
    - - -
    -

    originalEvent

    - Event - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionData.js:29 - -

    - - - - -
    - -
    -

    When passed to an event handler, this will be the original DOM Event that was captured

    - -
    - - - - - - -
    - - -
    -

    target

    - Sprite - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionData.js:21 - -

    - - - - -
    - -
    -

    The target Sprite that was interacted with

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/InteractionManager.html b/tutorial-1/pixi.js-master/docs/classes/InteractionManager.html deleted file mode 100755 index 952b5f9..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/InteractionManager.html +++ /dev/null @@ -1,2755 +0,0 @@ - - - - - InteractionManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    InteractionManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive -if its interactive parameter is set to true -This manager also supports multitouch.

    - -
    - - -
    -

    Constructor

    -
    -

    InteractionManager

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      The stage to handle interactions

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    collectInteractiveSprite

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - iParent - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:152 - -

    - - - - - -
    - -
    -

    Collects an interactive sprite recursively to have their interactions managed

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      the displayObject to collect

      - -
      - - -
    • - -
    • - - iParent - DisplayObject - - - - -
      -

      the display object's parent

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    hitTest

    - - -
    - (
      - -
    • - - item - -
    • - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:586 - -

    - - - - - -
    - -
    -

    Tests if the current mouse coordinates hit a sprite

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - item - DisplayObject - - - - -
      -

      The displayObject to test for a hit

      - -
      - - -
    • - -
    • - - interactionData - InteractionData - - - - -
      -

      The interactionData object to update in the case there is a hit

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onMouseDown

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:416 - -

    - - - - - -
    - -
    -

    Is called when the mouse button is pressed down on the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a mouse button being pressed down

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onMouseMove

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:380 - -

    - - - - - -
    - -
    -

    Is called when the mouse moves across the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of the mouse moving

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onMouseOut

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:477 - -

    - - - - - -
    - -
    -

    Is called when the mouse is moved out of the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a mouse being moved out

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onMouseUp

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:518 - -

    - - - - - -
    - -
    -

    Is called when the mouse button is released on the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a mouse button being released

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onTouchEnd

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:798 - -

    - - - - - -
    - -
    -

    Is called when a touch is ended on the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a touch ending on the renderer view

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onTouchMove

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:683 - -

    - - - - - -
    - -
    -

    Is called when a touch is moved across the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a touch moving across the renderer view

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onTouchStart

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:729 - -

    - - - - - -
    - -
    -

    Is called when a touch is started on the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a touch starting on the renderer view

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    rebuildInteractiveGraph

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:355 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    removeEvents

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:245 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    setTarget

    - - -
    - (
      - -
    • - - target - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:193 - -

    - - - - - -
    - -
    -

    Sets the target for event delegation

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setTargetDomElement

    - - -
    - (
      - -
    • - - domElement - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:211 - -

    - - - - - -
    - -
    -

    Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM -elements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element -to receive those events

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - domElement - DOMElement - - - - -
      -

      the DOM element which will receive mouse and touch events

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    update

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:270 - -

    - - - - - -
    - -
    -

    updates the state of interactive objects

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    currentCursorStyle

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:128 - -

    - - - - -
    - -
    -

    The css style of the cursor that is being used

    - -
    - - - - - - -
    - - -
    -

    interactionDOMElement

    - HTMLCanvasElement - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:70 - -

    - - - - -
    - -
    -

    Our canvas

    - -
    - - - - - - -
    - - -
    -

    interactiveItems

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:62 - -

    - - - - -
    - -
    -

    An array containing all the iterative items from the our interactive tree

    - -
    - - - - - - -
    - - -
    -

    last

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:122 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    mouse

    - InteractionData - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:24 - -

    - - - - -
    - -
    -

    The mouse data

    - -
    - - - - - - -
    - - -
    -

    mouseOut

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:135 - -

    - - - - -
    - -
    -

    Is set to true when the mouse is moved out of the canvas

    - -
    - - - - - - -
    - - -
    -

    mouseoverEnabled

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:47 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onMouseDown

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:86 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onMouseMove

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:80 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onMouseOut

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:92 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onMouseUp

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:98 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onTouchEnd

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:110 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onTouchMove

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:116 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onTouchStart

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:104 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    pool

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:54 - -

    - - - - -
    - -
    -

    Tiny little interactiveData pool !

    - -
    - - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:142 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:16 - -

    - - - - -
    - -
    -

    A reference to the stage

    - -
    - - - - - - -
    - - -
    -

    tempPoint

    - Point - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:40 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    touches

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:32 - -

    - - - - -
    - -
    -

    An object that stores current touches (InteractionData) by id reference

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/InvertFilter.html b/tutorial-1/pixi.js-master/docs/classes/InvertFilter.html deleted file mode 100755 index 458f3a4..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/InvertFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - InvertFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    InvertFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This inverts your Display Objects colors.

    - -
    - - -
    -

    Constructor

    -
    -

    InvertFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/InvertFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    invert

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/InvertFilter.js:42 - -

    - - - - -
    - -
    -

    The strength of the invert. 1 will fully invert the colors, 0 will make the object its normal color

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/JsonLoader.html b/tutorial-1/pixi.js-master/docs/classes/JsonLoader.html deleted file mode 100755 index 30fbfb4..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/JsonLoader.html +++ /dev/null @@ -1,1704 +0,0 @@ - - - - - JsonLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    JsonLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The json file loader is used to load in JSON data and parse it -When loaded this class will dispatch a 'loaded' event -If loading fails this class will dispatch an 'error' event

    - -
    - - -
    -

    Constructor

    -
    -

    JsonLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the JSON file

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:59 - -

    - - - - - -
    - -
    -

    Loads the JSON data

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onError

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:176 - -

    - - - - - -
    - -
    -

    Invoked if an error occurs.

    - -
    - - - - - - -
    - - -
    -

    onJSONLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:98 - -

    - - - - - -
    - -
    -

    Invoked when the JSON file is loaded.

    - -
    - - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:162 - -

    - - - - - -
    - -
    -

    Invoked when the json file has loaded.

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    baseUrl

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:34 - -

    - - - - -
    - -
    -

    [read-only] The base url of the bitmap font data

    - -
    - - - - - - -
    - - -
    -

    crossorigin

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:26 - -

    - - - - -
    - -
    -

    Whether the requests should be treated as cross origin

    - -
    - - - - - - -
    - - -
    -

    loaded

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:43 - -

    - - - - -
    - -
    -

    [read-only] Whether the data has loaded yet

    - -
    - - - - - - -
    - - -
    -

    url

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:18 - -

    - - - - -
    - -
    -

    The url of the bitmap font data

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/Matrix.html b/tutorial-1/pixi.js-master/docs/classes/Matrix.html deleted file mode 100755 index 8909572..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/Matrix.html +++ /dev/null @@ -1,1813 +0,0 @@ - - - - - Matrix - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Matrix Class

    -
    - - - - - -
    - Defined in: src/pixi/geom/Matrix.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Matrix class is now an object, which makes it a lot faster, -here is a representation of it : -| a | b | tx| -| c | d | ty| -| 0 | 0 | 1 |

    - -
    - - -
    -

    Constructor

    -
    -

    Matrix

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - -
      - -
    • - a - - - -
    • - -
    • - b - - - -
    • - -
    • - c - - - -
    • - -
    • - d - - - -
    • - -
    • - tx - - - -
    • - -
    • - ty - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    append

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    ) -
    - - - - - Matrix - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:225 - -

    - - - - - -
    - -
    -

    Appends the given Matrix to this Matrix.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Matrix - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Matrix: - -

    This matrix. Good for chaining method calls.

    - - -
    -
    - - - -
    - - -
    -

    apply

    - - -
    - (
      - -
    • - - pos - -
    • - -
    • - - [newPos] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:123 - -

    - - - - - -
    - -
    -

    Get a new position with the current transformation applied. -Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - pos - Point - - - - -
      -

      The origin

      - -
      - - -
    • - -
    • - - [newPos] - Point - optional - - - - -
      -

      The point that the new position is assigned to (allowed to be same as input)

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    The new point, transformed through this matrix

    - - -
    -
    - - - -
    - - -
    -

    applyInverse

    - - -
    - (
      - -
    • - - pos - -
    • - -
    • - - [newPos] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:142 - -

    - - - - - -
    - -
    -

    Get a new position with the inverse of the current transformation applied. -Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - pos - Point - - - - -
      -

      The origin

      - -
      - - -
    • - -
    • - - [newPos] - Point - optional - - - - -
      -

      The point that the new position is assigned to (allowed to be same as input)

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    The new point, inverse-transformed through this matrix

    - - -
    -
    - - - -
    - - -
    -

    fromArray

    - - -
    - (
      - -
    • - - array - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:60 - -

    - - - - - -
    - -
    -

    Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:

    -

    a = array[0] -b = array[1] -c = array[3] -d = array[4] -tx = array[2] -ty = array[5]

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - array - Array - - - - -
      -

      The array that the matrix will be populated from.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    identity

    - - - () - - - - - Matrix - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:250 - -

    - - - - - -
    - -
    -

    Resets this Matix to an identity (default) matrix.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Matrix: - -

    This matrix. Good for chaining method calls.

    - - -
    -
    - - - -
    - - -
    -

    rotate

    - - -
    - (
      - -
    • - - angle - -
    • - -
    ) -
    - - - - - Matrix - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:200 - -

    - - - - - -
    - -
    -

    Applies a rotation transformation to the matrix.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - angle - Number - - - - -
      -

      The angle in radians.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Matrix: - -

    This matrix. Good for chaining method calls.

    - - -
    -
    - - - -
    - - -
    -

    scale

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Matrix - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:179 - -

    - - - - - -
    - -
    -

    Applies a scale transformation to the matrix.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The amount to scale horizontally

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The amount to scale vertically

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Matrix: - -

    This matrix. Good for chaining method calls.

    - - -
    -
    - - - -
    - - -
    -

    toArray

    - - -
    - (
      - -
    • - - transpose - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:83 - -

    - - - - - -
    - -
    -

    Creates an array from the current Matrix object.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - transpose - Boolean - - - - -
      -

      Whether we need to transpose the matrix or not

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    the newly created array which contains the matrix

    - - -
    -
    - - - -
    - - -
    -

    translate

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Matrix - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:163 - -

    - - - - - -
    - -
    -

    Translates the matrix on the x and y.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      - -
      - - -
    • - -
    • - - y - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Matrix: - -

    This matrix. Good for chaining method calls.

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    a

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:17 - -

    - - - - -
    - -
    - -
    - - -

    Default: 1

    - - - - - -
    - - -
    -

    b

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:24 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    c

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:31 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    d

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:38 - -

    - - - - -
    - -
    - -
    - - -

    Default: 1

    - - - - - -
    - - -
    -

    tx

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:45 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    ty

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:52 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/MovieClip.html b/tutorial-1/pixi.js-master/docs/classes/MovieClip.html deleted file mode 100755 index 6ff435e..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/MovieClip.html +++ /dev/null @@ -1,7042 +0,0 @@ - - - - - MovieClip - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    MovieClip Class

    -
    - - - -
    - Extends Sprite -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    - -
    - - -
    -

    Constructor

    -
    -

    MovieClip

    - - -
    - (
      - -
    • - - textures - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - textures - Array - - - - -
      -

      an array of {Texture} objects that make up the animation

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:305 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:242 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    fromFrames

    - - -
    - (
      - -
    • - - frames - -
    • - -
    ) -
    - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:169 - -

    - - - - - -
    - -
    -

    A short hand way of creating a movieclip from an array of frame ids

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frames - Array - - - - -
      -

      the array of frames ids the movieclip will use as its texture frames

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    fromImages

    - - -
    - (
      - -
    • - - frames - -
    • - -
    ) -
    - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:188 - -

    - - - - - -
    - -
    -

    A short hand way of creating a movieclip from an array of image ids

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frames - Array - - - - -
      -

      the array of image ids the movieclip will use as its texture frames

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    ) -
    - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:163 - -

    - - - - - -
    - -
    -

    Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Matrix - - - - -
      -

      the transformation matrix of the sprite

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    gotoAndPlay

    - - -
    - (
      - -
    • - - frameNumber - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:125 - -

    - - - - - -
    - -
    -

    Goes to a specific frame and begins playing the MovieClip

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frameNumber - Number - - - - -
      -

      frame index to start at

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    gotoAndStop

    - - -
    - (
      - -
    • - - frameNumber - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:111 - -

    - - - - - -
    - -
    -

    Stops the MovieClip and goes to a specific frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frameNumber - Number - - - - -
      -

      frame index to stop at

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:147 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    play

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:101 - -

    - - - - - -
    - -
    -

    Plays the MovieClip

    - -
    - - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setTexture

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:135 - -

    - - - - - -
    - -
    -

    Sets the texture of the sprite

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The PIXI texture that is displayed by the sprite

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    stop

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:91 - -

    - - - - - -
    - -
    -

    Stops the MovieClip

    - -
    - - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _height

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:50 - -

    - - - - -
    - -
    -

    The height of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _width

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:41 - -

    - - - - -
    - -
    -

    The width of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    anchor

    - Point - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:22 - -

    - - - - -
    - -
    -

    The anchor sets the origin point of the texture. -The default is 0,0 this means the texture's origin is the top left -Setting than anchor to 0.5,0.5 means the textures origin is centered -Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner

    - -
    - - - - - - -
    - - -
    -

    animationSpeed

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:25 - -

    - - - - -
    - -
    -

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    - -
    - - -

    Default: 1

    - - - - - -
    - - -
    -

    blendMode

    - Number - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:68 - -

    - - - - -
    - -
    -

    The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.

    - -
    - - -

    Default: PIXI.blendModes.NORMAL;

    - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    currentFrame

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:51 - -

    - - - - -
    - -
    -

    [read-only] The MovieClips current frame index (this may not have to be a whole number)

    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/display/Sprite.js:119 - -

    - - - - -
    - -
    -

    The height of the sprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    loop

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:34 - -

    - - - - -
    - -
    -

    Whether or not the movie clip repeats after playing.

    - -
    - - -

    Default: true

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    onComplete

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:43 - -

    - - - - -
    - -
    -

    Function to call when a MovieClip finishes playing

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    playing

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:61 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the MovieClip is currently playing

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    shader

    - PIXI.AbstractFilter - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:77 - -

    - - - - -
    - -
    -

    The shader that will be used to render the texture to the stage. Set to null to remove a current shader.

    - -
    - - -

    Default: null

    - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:33 - -

    - - - - -
    - -
    -

    The texture that the sprite is using

    - -
    - - - - - - -
    - - -
    -

    textures

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:17 - -

    - - - - -
    - -
    -

    The array of textures that make up the animation

    - -
    - - - - - - -
    - - -
    -

    tint

    - Number - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:59 - -

    - - - - -
    - -
    -

    The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.

    - -
    - - -

    Default: 0xFFFFFF

    - - - - - -
    - - -
    -

    totalFrames

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:75 - -

    - - - - -
    - -
    -

    [read-only] totalFrames is the total number of frames in the MovieClip. This is the same as number of textures -assigned to the MovieClip.

    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/display/Sprite.js:103 - -

    - - - - -
    - -
    -

    The width of the sprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/NoiseFilter.html b/tutorial-1/pixi.js-master/docs/classes/NoiseFilter.html deleted file mode 100755 index 0a2e317..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/NoiseFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - NoiseFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    NoiseFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A Noise effect filter.

    - -
    - - -
    -

    Constructor

    -
    -

    NoiseFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NoiseFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    noise

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NoiseFilter.js:49 - -

    - - - - -
    - -
    -

    The amount of noise to apply.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/NormalMapFilter.html b/tutorial-1/pixi.js-master/docs/classes/NormalMapFilter.html deleted file mode 100755 index f553ab2..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/NormalMapFilter.html +++ /dev/null @@ -1,1037 +0,0 @@ - - - - - NormalMapFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    NormalMapFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The NormalMapFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. -You can use this filter to apply all manor of crazy warping effects -Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.

    - -
    - - -
    -

    Constructor

    -
    -

    NormalMapFilter

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NormalMapFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The texture used for the displacement map * must be power of 2 texture at the moment

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    onTextureLoaded

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NormalMapFilter.js:140 - -

    - - - - - -
    - -
    -

    Sets the map dimensions uniforms when the texture becomes available.

    - -
    - - - - - - -
    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    map

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NormalMapFilter.js:153 - -

    - - - - -
    - -
    -

    The texture used for the displacement map. Must be power of 2 texture.

    - -
    - - - - - - -
    - - -
    -

    offset

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NormalMapFilter.js:183 - -

    - - - - -
    - -
    -

    The offset used to move the displacement map.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NormalMapFilter.js:168 - -

    - - - - -
    - -
    -

    The multiplier used to scale the displacement result from the map calculation.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/PixelateFilter.html b/tutorial-1/pixi.js-master/docs/classes/PixelateFilter.html deleted file mode 100755 index 50fd174..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/PixelateFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - PixelateFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PixelateFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This filter applies a pixelate effect making display objects appear 'blocky'.

    - -
    - - -
    -

    Constructor

    -
    -

    PixelateFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/PixelateFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    size

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/PixelateFilter.js:48 - -

    - - - - -
    - -
    -

    This a point that describes the size of the blocks. x is the width of the block and y is the height.

    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/PixiFastShader.html b/tutorial-1/pixi.js-master/docs/classes/PixiFastShader.html deleted file mode 100755 index 5c0596a..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/PixiFastShader.html +++ /dev/null @@ -1,891 +0,0 @@ - - - - - PixiFastShader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PixiFastShader Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    PixiFastShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:143 - -

    - - - - - -
    - -
    -

    Destroys the shader.

    - -
    - - - - - - -
    - - -
    -

    init

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:94 - -

    - - - - - -
    - -
    -

    Initialises the shader.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _UID

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:32 - -

    - - - - -
    - -
    -

    The fragment shader.

    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:19 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    program

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:25 - -

    - - - - -
    - -
    -

    The WebGL program.

    - -
    - - - - - - -
    - - -
    -

    textureCount

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:82 - -

    - - - - -
    - -
    -

    A local texture counter for multi-texture shaders.

    - -
    - - - - - - -
    - - -
    -

    vertexSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:47 - -

    - - - - -
    - -
    -

    The vertex shader.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/PixiShader.html b/tutorial-1/pixi.js-master/docs/classes/PixiShader.html deleted file mode 100755 index 79f93ed..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/PixiShader.html +++ /dev/null @@ -1,1239 +0,0 @@ - - - - - PixiShader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PixiShader Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    PixiShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:6 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:351 - -

    - - - - - -
    - -
    -

    Destroys the shader.

    - -
    - - - - - - -
    - - -
    -

    init

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:83 - -

    - - - - - -
    - -
    -

    Initialises the shader.

    - -
    - - - - - - -
    - - -
    -

    initSampler2D

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:208 - -

    - - - - - -
    - -
    -

    Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded)

    - -
    - - - - - - -
    - - -
    -

    initUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:134 - -

    - - - - - -
    - -
    -

    Initialises the shader uniform values.

    -

    Uniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/ -http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf

    - -
    - - - - - - -
    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:283 - -

    - - - - - -
    - -
    -

    Updates the shader uniform values.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _UID

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:13 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    attributes

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:70 - -

    - - - - -
    - -
    -

    Uniform attributes cache.

    - -
    - - - - - - -
    - - -
    -

    defaultVertexSrc

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:365 - -

    - - - - -
    - -
    -

    The Default Vertex shader source.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:63 - -

    - - - - -
    - -
    -

    A dirty flag

    - -
    - - - - - - -
    - - -
    -

    firstRun

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:55 - -

    - - - - -
    - -
    -

    A local flag

    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:33 - -

    - - - - -
    - -
    -

    The fragment shader.

    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:20 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    program

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:26 - -

    - - - - -
    - -
    -

    The WebGL program.

    - -
    - - - - - - -
    - - -
    -

    textureCount

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:48 - -

    - - - - -
    - -
    -

    A local texture counter for multi-texture shaders.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/Point.html b/tutorial-1/pixi.js-master/docs/classes/Point.html deleted file mode 100755 index d2030b9..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/Point.html +++ /dev/null @@ -1,785 +0,0 @@ - - - - - Point - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Point Class

    -
    - - - - - -
    - Defined in: src/pixi/geom/Point.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    - -
    - - -
    -

    Constructor

    -
    -

    Point

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Point.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      position of the point on the x axis

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      position of the point on the y axis

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - -
      - -
    • - clone - - - -
    • - -
    • - set - - - -
    • - -
    -
    - - - -
    -

    Properties

    - -
      - -
    • - x - - - -
    • - -
    • - y - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Point.js:30 - -

    - - - - - -
    - -
    -

    Creates a clone of this point

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Point: - -

    a copy of the point

    - - -
    -
    - - - -
    - - -
    -

    set

    - - -
    - (
      - -
    • - - [x=0] - -
    • - -
    • - - [y=0] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Point.js:41 - -

    - - - - - -
    - -
    -

    Sets the point to a new x and y position. -If y is omitted, both x and y will be set to x.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - [x=0] - Number - optional - - - - -
      -

      position of the point on the x axis

      - -
      - - -
    • - -
    • - - [y=0] - Number - optional - - - - -
      -

      position of the point on the y axis

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Point.js:15 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Point.js:22 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/PolyK.html b/tutorial-1/pixi.js-master/docs/classes/PolyK.html deleted file mode 100755 index e1d21ed..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/PolyK.html +++ /dev/null @@ -1,761 +0,0 @@ - - - - - PolyK - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PolyK Class

    -
    - - - - - -
    - Defined in: src/pixi/utils/Polyk.js:34 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    Based on the Polyk library http://polyk.ivank.net released under MIT licence. -This is an amazing lib! -Slightly modified by Mat Groves (matgroves.com);

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _convex

    - - - () - - - - - Boolean - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Polyk.js:158 - -

    - - - - - -
    - -
    -

    Checks whether a shape is convex

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Boolean: - - -
    -
    - - - -
    - - -
    -

    _PointInTriangle

    - - -
    - (
      - -
    • - - px - -
    • - -
    • - - py - -
    • - -
    • - - ax - -
    • - -
    • - - ay - -
    • - -
    • - - bx - -
    • - -
    • - - by - -
    • - -
    • - - cx - -
    • - -
    • - - cy - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Polyk.js:120 - -

    - - - - - -
    - -
    -

    Checks whether a point is within a triangle

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - px - Number - - - - -
      -

      x coordinate of the point to test

      - -
      - - -
    • - -
    • - - py - Number - - - - -
      -

      y coordinate of the point to test

      - -
      - - -
    • - -
    • - - ax - Number - - - - -
      -

      x coordinate of the a point of the triangle

      - -
      - - -
    • - -
    • - - ay - Number - - - - -
      -

      y coordinate of the a point of the triangle

      - -
      - - -
    • - -
    • - - bx - Number - - - - -
      -

      x coordinate of the b point of the triangle

      - -
      - - -
    • - -
    • - - by - Number - - - - -
      -

      y coordinate of the b point of the triangle

      - -
      - - -
    • - -
    • - - cx - Number - - - - -
      -

      x coordinate of the c point of the triangle

      - -
      - - -
    • - -
    • - - cy - Number - - - - -
      -

      y coordinate of the c point of the triangle

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - - -
    -
    - - - -
    - - -
    -

    Triangulate

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Polyk.js:42 - -

    - - - - - -
    - -
    -

    Triangulates shapes for webGL graphic fills.

    - -
    - - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/Polygon.html b/tutorial-1/pixi.js-master/docs/classes/Polygon.html deleted file mode 100755 index 6fa4c44..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/Polygon.html +++ /dev/null @@ -1,661 +0,0 @@ - - - - - Polygon - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Polygon Class

    -
    - - - - - -
    - Defined in: src/pixi/geom/Polygon.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    Polygon

    - - -
    - (
      - -
    • - - points - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Polygon.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - points - Array | Array | Point... | Number... - - - - multiple - - -
      -

      This can be an array of Points that form the polygon, - a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be - all the points of the polygon e.g. new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...), or the - arguments passed can be flat x,y values e.g. new PIXI.Polygon(x,y, x,y, x,y, ...) where x and y are - Numbers.

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Polygon - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Polygon.js:35 - -

    - - - - - -
    - -
    -

    Creates a clone of this polygon

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Polygon: - -

    a copy of the polygon

    - - -
    -
    - - - -
    - - -
    -

    contains

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Polygon.js:47 - -

    - - - - - -
    - -
    -

    Checks whether the x and y coordinates passed to this function are contained within this polygon

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the point to test

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the point to test

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Whether the x/y coordinates are within this polygon

    - - -
    -
    - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/PrimitiveShader.html b/tutorial-1/pixi.js-master/docs/classes/PrimitiveShader.html deleted file mode 100755 index 0641655..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/PrimitiveShader.html +++ /dev/null @@ -1,839 +0,0 @@ - - - - - PrimitiveShader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PrimitiveShader Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    PrimitiveShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:103 - -

    - - - - - -
    - -
    -

    Destroys the shader.

    - -
    - - - - - - -
    - - -
    -

    init

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:74 - -

    - - - - - -
    - -
    -

    Initialises the shader.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _UID

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:32 - -

    - - - - -
    - -
    -

    The fragment shader.

    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:19 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    program

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:25 - -

    - - - - -
    - -
    -

    The WebGL program.

    - -
    - - - - - - -
    - - -
    -

    vertexSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:46 - -

    - - - - -
    - -
    -

    The vertex shader.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/RGBSplitFilter.html b/tutorial-1/pixi.js-master/docs/classes/RGBSplitFilter.html deleted file mode 100755 index ffb75a6..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/RGBSplitFilter.html +++ /dev/null @@ -1,939 +0,0 @@ - - - - - RGBSplitFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    RGBSplitFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    An RGB Split Filter.

    - -
    - - -
    -

    Constructor

    -
    -

    RGBSplitFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/RGBSplitFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blue

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/RGBSplitFilter.js:78 - -

    - - - - -
    - -
    -

    Blue offset.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    green

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/RGBSplitFilter.js:63 - -

    - - - - -
    - -
    -

    Green channel offset.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    red

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/RGBSplitFilter.js:48 - -

    - - - - -
    - -
    -

    Red channel offset.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/Rectangle.html b/tutorial-1/pixi.js-master/docs/classes/Rectangle.html deleted file mode 100755 index 2180606..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/Rectangle.html +++ /dev/null @@ -1,950 +0,0 @@ - - - - - Rectangle - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Rectangle Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    - -
    - - -
    -

    Constructor

    -
    -

    Rectangle

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the upper-left corner of the rectangle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the upper-left corner of the rectangle

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The overall width of this rectangle

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The overall height of this rectangle

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - -
      - -
    • - height - - - -
    • - -
    • - width - - - -
    • - -
    • - x - - - -
    • - -
    • - y - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:46 - -

    - - - - - -
    - -
    -

    Creates a clone of this Rectangle

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    a copy of the rectangle

    - - -
    -
    - - - -
    - - -
    -

    contains

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:57 - -

    - - - - - -
    - -
    -

    Checks whether the x and y coordinates given are contained within this Rectangle

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the point to test

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the point to test

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Whether the x/y coordinates are within this Rectangle

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:38 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:31 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:17 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:24 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/RenderTexture.html b/tutorial-1/pixi.js-master/docs/classes/RenderTexture.html deleted file mode 100755 index f7c7c7e..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/RenderTexture.html +++ /dev/null @@ -1,2964 +0,0 @@ - - - - - RenderTexture - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    RenderTexture Class

    -
    - - - -
    - Extends Texture -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A RenderTexture is a special texture that allows any Pixi display object to be rendered to it.

    -

    Hint: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead.

    -

    A RenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example:

    -

    var renderTexture = new PIXI.RenderTexture(800, 600); - var sprite = PIXI.Sprite.fromImage("spinObj_01.png"); - sprite.position.x = 800/2; - sprite.position.y = 600/2; - sprite.anchor.x = 0.5; - sprite.anchor.y = 0.5; - renderTexture.render(sprite);

    -

    The Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual position a DisplayObjectContainer should be used:

    -

    var doc = new PIXI.DisplayObjectContainer(); - doc.addChild(sprite); - renderTexture.render(doc); // Renders to center of renderTexture

    - -
    - - -
    -

    Constructor

    -
    -

    RenderTexture

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    • - - renderer - -
    • - -
    • - - scaleMode - -
    • - -
    • - - resolution - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      The width of the render texture

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The height of the render texture

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used for this RenderTexture

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _updateUvs

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:200 - -

    - - - - - -
    - -
    -

    Updates the internal WebGL UV cache.

    - -
    - - - - - - -
    - - -
    -

    clear

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:171 - -

    - - - - - -
    - -
    -

    Clears the RenderTexture.

    - -
    - - - - - - -
    - - -
    -

    destroy

    - - -
    - (
      - -
    • - - destroyBase - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:149 - -

    - - - - - -
    - -
    -

    Destroys this texture

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - destroyBase - Boolean - - - - -
      -

      Whether to destroy the base texture as well

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    getBase64

    - - - () - - - - - String - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:291 - -

    - - - - - -
    - -
    -

    Will return a a base64 encoded string of this texture. It works by calling RenderTexture.getCanvas and then running toDataURL on that.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - String: - -

    A base64 encoded string of the texture.

    - - -
    -
    - - - -
    - - -
    -

    getCanvas

    - - - () - - - - - HTMLCanvasElement - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:302 - -

    - - - - - -
    - -
    -

    Creates a Canvas element, renders this RenderTexture to it and then returns it.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - HTMLCanvasElement: - -

    A Canvas element with the texture rendered on.

    - - -
    -
    - - - -
    - - -
    -

    getImage

    - - - () - - - - - Image - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:278 - -

    - - - - - -
    - -
    -

    Will return a HTML Image of the texture

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Image: - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onBaseTextureLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:131 - -

    - - - - - -
    - -
    -

    Called when the base texture is loaded

    - -
    - - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderCanvas

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - [matrix] - -
    • - -
    • - - [clear] - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:237 - -

    - - - - - -
    - -
    -

    This function will draw the display object to the texture.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      The display object to render this texture on

      - -
      - - -
    • - -
    • - - [matrix] - Matrix - optional - - - - -
      -

      Optional matrix to apply to the display object before rendering.

      - -
      - - -
    • - -
    • - - [clear] - Boolean - optional - - - - -
      -

      If true the texture will be cleared before the displayObject is drawn

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderWebGL

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - [matrix] - -
    • - -
    • - - [clear] - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:188 - -

    - - - - - -
    - -
    -

    This function will draw the display object to the texture.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      The display object to render this texture on

      - -
      - - -
    • - -
    • - - [matrix] - Matrix - optional - - - - -
      -

      Optional matrix to apply to the display object before rendering.

      - -
      - - -
    • - -
    • - - [clear] - Boolean - optional - - - - -
      -

      If true the texture will be cleared before the displayObject is drawn

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    resize

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    • - - updateBase - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:137 - -

    - - - - - -
    - -
    -

    Resizes the RenderTexture.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      The width to resize to.

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The height to resize to.

      - -
      - - -
    • - -
    • - - updateBase - Boolean - - - - -
      -

      Should the baseTexture.width and height values be resized as well?

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setFrame

    - - -
    - (
      - -
    • - - frame - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:162 - -

    - - - - - -
    - -
    -

    Specifies the region of the baseTexture that this texture will use.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frame - Rectangle - - - - -
      -

      The frame of the texture to set it to

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _uvs

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:83 - -

    - - - - -
    - -
    -

    The WebGL UV data cache.

    - -
    - - - - - - -
    - - -
    -

    baseTexture

    - BaseTexture - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:78 - -

    - - - - -
    - -
    -

    The base texture object that this texture uses

    - -
    - - - - - - -
    - - -
    -

    crop

    - Rectangle - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:69 - -

    - - - - -
    - -
    -

    This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, -irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)

    - -
    - - - - - - -
    - - -
    -

    frame

    - Rectangle - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:61 - -

    - - - - -
    - -
    -

    The framing rectangle of the render texture

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:45 - -

    - - - - -
    - -
    -

    The height of the render texture

    - -
    - - - - - - -
    - - -
    -

    noFrame

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:24 - -

    - - - - -
    - -
    -

    Does this Texture have any frame data assigned to it?

    - -
    - - - - - - -
    - - -
    -

    renderer

    - CanvasRenderer | WebGLRenderer - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:99 - -

    - - - - -
    - -
    -

    The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL.

    - -
    - - - - - - -
    - - -
    -

    requiresUpdate

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:75 - -

    - - - - -
    - -
    -

    This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)

    - -
    - - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:53 - -

    - - - - -
    - -
    -

    The Resolution of the texture.

    - -
    - - - - - - -
    - - -
    -

    trim

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:59 - -

    - - - - -
    - -
    -

    The texture trim data.

    - -
    - - - - - - -
    - - -
    -

    valid

    - Boolean - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:125 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:37 - -

    - - - - -
    - -
    -

    The with of the render texture

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/Rope.html b/tutorial-1/pixi.js-master/docs/classes/Rope.html deleted file mode 100755 index c1c314b..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/Rope.html +++ /dev/null @@ -1,5931 +0,0 @@ - - - - - Rope - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Rope Class

    -
    - - - -
    - Extends Strip -
    - - - -
    - Defined in: src/pixi/extras/Rope.js:6 -
    - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    Rope

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - points - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Rope.js:6 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -
        -
      • The texture to use on the rope.
      • -
      - -
      - - -
    • - -
    • - - points - Array - - - - -
      -
        -
      • An array of {PIXI.Point}.
      • -
      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Strip: - - - - src/pixi/extras/Strip.js:341 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    renderStripFlat

    - - -
    - (
      - -
    • - - strip - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Strip: - - - - src/pixi/extras/Strip.js:293 - -

    - - - - - -
    - -
    -

    Renders a flat strip

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - strip - Strip - - - - -
      -

      The Strip to render

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - Strip: - - - - src/pixi/extras/Strip.js:43 - -

    - - - - -
    - -
    -

    Whether the strip is dirty or not

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - Strip: - - - - src/pixi/extras/Strip.js:52 - -

    - - - - -
    - -
    -

    if you need a padding, not yet implemented

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - -

    Inherited from - Strip: - - - - src/pixi/extras/Strip.js:20 - -

    - - - - -
    - -
    -

    The texture of the strip

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/Rounded Rectangle.html b/tutorial-1/pixi.js-master/docs/classes/Rounded Rectangle.html deleted file mode 100755 index 00a3e40..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/Rounded Rectangle.html +++ /dev/null @@ -1,1025 +0,0 @@ - - - - - Rounded Rectangle - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Rounded Rectangle Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    the Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height.

    - -
    - - -
    -

    Constructor

    -
    -

    Rounded Rectangle

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    • - - radius - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the upper-left corner of the rounded rectangle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the upper-left corner of the rounded rectangle

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The overall width of this rounded rectangle

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The overall height of this rounded rectangle

      - -
      - - -
    • - -
    • - - radius - Number - - - - -
      -

      The overall radius of this corners of this rounded rectangle

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - -
      - -
    • - height - - - -
    • - -
    • - radius - - - -
    • - -
    • - width - - - -
    • - -
    • - x - - - -
    • - -
    • - y - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Rounded Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:54 - -

    - - - - - -
    - -
    -

    Creates a clone of this Rounded Rectangle

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rounded Rectangle: - -

    a copy of the rounded rectangle

    - - -
    -
    - - - -
    - - -
    -

    contains

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:65 - -

    - - - - - -
    - -
    -

    Checks whether the x and y coordinates given are contained within this Rounded Rectangle

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the point to test

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the point to test

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Whether the x/y coordinates are within this Rounded Rectangle

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:39 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    radius

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:46 - -

    - - - - -
    - -
    - -
    - - -

    Default: 20

    - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:32 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:18 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:25 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/SepiaFilter.html b/tutorial-1/pixi.js-master/docs/classes/SepiaFilter.html deleted file mode 100755 index fee5fe6..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/SepiaFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - SepiaFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    SepiaFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This applies a sepia effect to your Display Objects.

    - -
    - - -
    -

    Constructor

    -
    -

    SepiaFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/SepiaFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    sepia

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/SepiaFilter.js:43 - -

    - - - - -
    - -
    -

    The strength of the sepia. 1 will apply the full sepia effect, 0 will make the object its normal color.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/SmartBlurFilter.html b/tutorial-1/pixi.js-master/docs/classes/SmartBlurFilter.html deleted file mode 100755 index 4f1da72..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/SmartBlurFilter.html +++ /dev/null @@ -1,837 +0,0 @@ - - - - - SmartBlurFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    SmartBlurFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A Smart Blur Filter.

    - -
    - - -
    -

    Constructor

    -
    -

    SmartBlurFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/SmartBlurFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number the strength of the blur - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/SmartBlurFilter.js:61 - -

    - - - - -
    - -
    -

    The strength of the blur.

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/Spine.html b/tutorial-1/pixi.js-master/docs/classes/Spine.html deleted file mode 100755 index 4c0f0fa..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/Spine.html +++ /dev/null @@ -1,5572 +0,0 @@ - - - - - Spine - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Spine Class

    -
    - - - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A class that enables the you to import and run your spine animations in pixi. -Spine animation data needs to be loaded using the PIXI.AssetLoader or PIXI.SpineLoader before it can be used by this class -See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source

    - -
    - - -
    -

    Constructor

    -
    -

    Spine

    - - -
    - (
      - -
    • - - url - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Spine.js:1357 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the spine anim file to be used

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/SpineLoader.html b/tutorial-1/pixi.js-master/docs/classes/SpineLoader.html deleted file mode 100755 index ed00edc..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/SpineLoader.html +++ /dev/null @@ -1,1527 +0,0 @@ - - - - - SpineLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    SpineLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Spine loader is used to load in JSON spine data -To generate the data you need to use http://esotericsoftware.com/ and export in the "JSON" format -Due to a clash of names You will need to change the extension of the spine file from .json to .anim for it to load -See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source -You will need to generate a sprite sheet to accompany the spine data -When loaded this class will dispatch a "loaded" event

    - -
    - - -
    -

    Constructor

    -
    -

    SpineLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:10 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the JSON file

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:56 - -

    - - - - - -
    - -
    -

    Loads the JSON data

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:72 - -

    - - - - - -
    - -
    -

    Invoked when JSON file is loaded.

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    crossorigin

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:34 - -

    - - - - -
    - -
    -

    Whether the requests should be treated as cross origin

    - -
    - - - - - - -
    - - -
    -

    loaded

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:42 - -

    - - - - -
    - -
    -

    [read-only] Whether the data has loaded yet

    - -
    - - - - - - -
    - - -
    -

    url

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:26 - -

    - - - - -
    - -
    -

    The url of the bitmap font data

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/Sprite.html b/tutorial-1/pixi.js-master/docs/classes/Sprite.html deleted file mode 100755 index 59ecf6e..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/Sprite.html +++ /dev/null @@ -1,6422 +0,0 @@ - - - - - Sprite - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Sprite Class

    -
    - - - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Sprite object is the base for all textured objects that are rendered to the screen

    - -
    - - -
    -

    Constructor

    -
    -

    Sprite

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The texture for this sprite

      -

      A sprite can be created directly from an image like this : -var sprite = new PIXI.Sprite.fromImage('assets/image.png'); -yourStage.addChild(sprite); -then obviously don't forget to add it to the stage you have already created

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:305 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:242 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    fromFrame

    - - -
    - (
      - -
    • - - frameId - -
    • - -
    ) -
    - - - - - Sprite - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:418 - -

    - - - - - -
    - -
    -

    Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId - The frame ids are created when a Texture packer file has been loaded

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frameId - String - - - - -
      -

      The frame Id of the texture in the cache

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Sprite: - -

    A new Sprite using a texture from the texture cache matching the frameId

    - - -
    -
    - - - -
    - - -
    -

    fromImage

    - - -
    - (
      - -
    • - - imageId - -
    • - -
    ) -
    - - - - - Sprite - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:435 - -

    - - - - - -
    - -
    -

    Helper function that creates a sprite that will contain a texture based on an image url - If the image is not in the texture cache it will be loaded

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - imageId - String - - - - -
      -

      The image url of the texture

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Sprite: - -

    A new Sprite using a texture from the texture cache matching the image id

    - - -
    -
    - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    ) -
    - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:163 - -

    - - - - - -
    - -
    -

    Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Matrix - - - - -
      -

      the transformation matrix of the sprite

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:147 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setTexture

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:135 - -

    - - - - - -
    - -
    -

    Sets the texture of the sprite

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The PIXI texture that is displayed by the sprite

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _height

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:50 - -

    - - - - -
    - -
    -

    The height of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _width

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:41 - -

    - - - - -
    - -
    -

    The width of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    anchor

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:22 - -

    - - - - -
    - -
    -

    The anchor sets the origin point of the texture. -The default is 0,0 this means the texture's origin is the top left -Setting than anchor to 0.5,0.5 means the textures origin is centered -Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner

    - -
    - - - - - - -
    - - -
    -

    blendMode

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:68 - -

    - - - - -
    - -
    -

    The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.

    - -
    - - -

    Default: PIXI.blendModes.NORMAL;

    - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/display/Sprite.js:119 - -

    - - - - -
    - -
    -

    The height of the sprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    shader

    - PIXI.AbstractFilter - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:77 - -

    - - - - -
    - -
    -

    The shader that will be used to render the texture to the stage. Set to null to remove a current shader.

    - -
    - - -

    Default: null

    - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:33 - -

    - - - - -
    - -
    -

    The texture that the sprite is using

    - -
    - - - - - - -
    - - -
    -

    tint

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:59 - -

    - - - - -
    - -
    -

    The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.

    - -
    - - -

    Default: 0xFFFFFF

    - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/display/Sprite.js:103 - -

    - - - - -
    - -
    -

    The width of the sprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/SpriteBatch.html b/tutorial-1/pixi.js-master/docs/classes/SpriteBatch.html deleted file mode 100755 index d55ac22..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/SpriteBatch.html +++ /dev/null @@ -1,643 +0,0 @@ - - - - - SpriteBatch - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    SpriteBatch Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The SpriteBatch class is a really fast version of the DisplayObjectContainer -built solely for speed, so use when you need a lot of sprites or particles. -And it's extremely easy to use :

    -

    var container = new PIXI.SpriteBatch();

    -

    stage.addChild(container);

    -

    for(var i = 0; i < 100; i++) - { - var sprite = new PIXI.Sprite.fromImage("myImage.png"); - container.addChild(sprite); - } -And here you have a hundred sprites that will be renderer at the speed of light

    - -
    - - -
    -

    Constructor

    -
    -

    SpriteBatch

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/SpriteBatch.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/SpriteBatch.js:90 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/SpriteBatch.js:66 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/SpriteSheetLoader.html b/tutorial-1/pixi.js-master/docs/classes/SpriteSheetLoader.html deleted file mode 100755 index d2f8285..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/SpriteSheetLoader.html +++ /dev/null @@ -1,1632 +0,0 @@ - - - - - SpriteSheetLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    SpriteSheetLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    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 in 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 a 'texture atlas') as it means sprites 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.fromFrameId() -This loader will load the image file that the Spritesheet points to as well as the data. -When loaded this class will dispatch a 'loaded' event

    - -
    - - -
    -

    Constructor

    -
    -

    SpriteSheetLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the sprite sheet JSON file

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:69 - -

    - - - - - -
    - -
    -

    This will begin loading the JSON file

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:84 - -

    - - - - - -
    - -
    -

    Invoke when all files are loaded (json and texture)

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    baseUrl

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:38 - -

    - - - - -
    - -
    -

    [read-only] The base url of the bitmap font data

    - -
    - - - - - - -
    - - -
    -

    crossorigin

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:30 - -

    - - - - -
    - -
    -

    Whether the requests should be treated as cross origin

    - -
    - - - - - - -
    - - -
    -

    frames

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:55 - -

    - - - - -
    - -
    -

    The frames of the sprite sheet

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:47 - -

    - - - - -
    - -
    -

    The texture being loaded

    - -
    - - - - - - -
    - - -
    -

    url

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:22 - -

    - - - - -
    - -
    -

    The url of the atlas data

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/Stage.html b/tutorial-1/pixi.js-master/docs/classes/Stage.html deleted file mode 100755 index 27d0d6a..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/Stage.html +++ /dev/null @@ -1,5961 +0,0 @@ - - - - - Stage - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Stage Class

    -
    - - - - - - - -
    - Defined in: src/pixi/display/Stage.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    - -
    - - -
    -

    Constructor

    -
    -

    Stage

    - - -
    - (
      - -
    • - - backgroundColor - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - backgroundColor - Number - - - - -
      -

      the background color of the stage, you have to pass this in is in hex format - like: 0xFFFFFF for white

      -

      Creating a stage is a mandatory process when you use Pixi, which is as simple as this : -var stage = new PIXI.Stage(0xFFFFFF); -where the parameter given is the background colour of the stage, in hex -you will use this stage instance to add your sprites to it and therefore to the renderer -Here is how to add a sprite to the stage : -stage.addChild(sprite);

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getMousePosition

    - - - () - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:126 - -

    - - - - - -
    - -
    -

    This will return the point containing global coordinates of the mouse.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point containing the coordinates of the global InteractionData position.

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setBackgroundColor

    - - -
    - (
      - -
    • - - backgroundColor - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:110 - -

    - - - - - -
    - -
    -

    Sets the background color for the stage

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - backgroundColor - Number - - - - -
      -

      the color of the background, easiest way to pass this in is in hex format - like: 0xFFFFFF for white

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setInteractionDelegate

    - - -
    - (
      - -
    • - - domElement - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:73 - -

    - - - - - -
    - -
    -

    Sets another DOM element which can receive mouse/touch interactions instead of the default Canvas element. -This is useful for when you have other DOM elements on top of the Canvas element.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - domElement - DOMElement - - - - -
      -

      This new domElement which will receive mouse/touch events

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:51 - -

    - - - - -
    - -
    -

    Whether the stage is dirty and needs to have interactions updated

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactionManager

    - InteractionManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:43 - -

    - - - - -
    - -
    -

    The interaction manage for this stage, manages all interactive activity on the stage

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Stage.js:35 - -

    - - - - -
    - -
    -

    Whether or not the stage is interactive

    - -
    - - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Stage.js:25 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/Strip.html b/tutorial-1/pixi.js-master/docs/classes/Strip.html deleted file mode 100755 index d93f5d3..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/Strip.html +++ /dev/null @@ -1,5964 +0,0 @@ - - - - - Strip - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Strip Class

    -
    - - - - - - - -
    - Defined in: src/pixi/extras/Strip.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    Strip

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The texture to use

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      the width

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the height

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:341 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    renderStripFlat

    - - -
    - (
      - -
    • - - strip - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:293 - -

    - - - - - -
    - -
    -

    Renders a flat strip

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - strip - Strip - - - - -
      -

      The Strip to render

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:43 - -

    - - - - -
    - -
    -

    Whether the strip is dirty or not

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:52 - -

    - - - - -
    - -
    -

    if you need a padding, not yet implemented

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:20 - -

    - - - - -
    - -
    -

    The texture of the strip

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/StripShader.html b/tutorial-1/pixi.js-master/docs/classes/StripShader.html deleted file mode 100755 index 612ff3b..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/StripShader.html +++ /dev/null @@ -1,839 +0,0 @@ - - - - - StripShader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    StripShader Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    StripShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:111 - -

    - - - - - -
    - -
    -

    Destroys the shader.

    - -
    - - - - - - -
    - - -
    -

    init

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:80 - -

    - - - - - -
    - -
    -

    Initialises the shader.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _UID

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:32 - -

    - - - - -
    - -
    -

    The fragment shader.

    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:19 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    program

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:25 - -

    - - - - -
    - -
    -

    The WebGL program.

    - -
    - - - - - - -
    - - -
    -

    vertexSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:50 - -

    - - - - -
    - -
    -

    The vertex shader.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/Text.html b/tutorial-1/pixi.js-master/docs/classes/Text.html deleted file mode 100755 index 8604a47..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/Text.html +++ /dev/null @@ -1,7290 +0,0 @@ - - - - - Text - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Text Class

    -
    - - - -
    - Extends Sprite -
    - - - -
    - Defined in: src/pixi/text/Text.js:6 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    A Text Object will create a line or multiple lines of text. To split a line you can use '\n' in your text string, -or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object.

    - -
    - - -
    -

    Constructor

    -
    -

    Text

    - - -
    - (
      - -
    • - - text - -
    • - -
    • - - [style] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:6 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - text - String - - - - -
      -

      The copy that you would like the text to display

      - -
      - - -
    • - -
    • - - [style] - Object - optional - - - - -
      -

      The style parameters

      - -
      - - -
        - -
      • - - [font] - String - optional - - -
        -

        default 'bold 20px Arial' The style and size of the font

        - -
        - - -
      • - -
      • - - [fill='black'] - String | Number - optional - - -
        -

        A canvas fillstyle that will be used on the text e.g 'red', '#00FF00'

        - -
        - - -
      • - -
      • - - [align='left'] - String - optional - - -
        -

        Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text

        - -
        - - -
      • - -
      • - - [stroke] - String | Number - optional - - -
        -

        A canvas fillstyle that will be used on the text stroke e.g 'blue', '#FCFF00'

        - -
        - - -
      • - -
      • - - [strokeThickness=0] - Number - optional - - -
        -

        A number that represents the thickness of the stroke. Default is 0 (no stroke)

        - -
        - - -
      • - -
      • - - [wordWrap=false] - Boolean - optional - - -
        -

        Indicates if word wrap should be used

        - -
        - - -
      • - -
      • - - [wordWrapWidth=100] - Number - optional - - -
        -

        The width at which text will wrap, it needs wordWrap to be set to true

        - -
        - - -
      • - -
      • - - [dropShadow=false] - Boolean - optional - - -
        -

        Set a drop shadow for the text

        - -
        - - -
      • - -
      • - - [dropShadowColor='#000000'] - String - optional - - -
        -

        A fill style to be used on the dropshadow e.g 'red', '#00FF00'

        - -
        - - -
      • - -
      • - - [dropShadowAngle=Math.PI/4] - Number - optional - - -
        -

        Set a angle of the drop shadow

        - -
        - - -
      • - -
      • - - [dropShadowDistance=5] - Number - optional - - -
        -

        Set a distance of the drop shadow

        - -
        - - -
      • - -
      - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/text/Text.js:321 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/text/Text.js:301 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    destroy

    - - -
    - (
      - -
    • - - destroyBaseTexture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:510 - -

    - - - - - -
    - -
    -

    Destroys this text object.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - destroyBaseTexture - Boolean - - - - -
      -

      whether to destroy the base texture as well

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    determineFontProperties

    - - -
    - (
      - -
    • - - fontStyle - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:341 - -

    - - - - - -
    - -
    -

    Calculates the ascent, descent and fontSize of a given fontStyle

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - fontStyle - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    ) -
    - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/text/Text.js:492 - -

    - - - - - -
    - -
    -

    Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Matrix - - - - -
      -

      the transformation matrix of the Text

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:147 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStyle

    - - -
    - (
      - -
    • - - [style] - -
    • - -
    • - - [style.font='bold - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:110 - -

    - - - - - -
    - -
    -

    Set the style of the text

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - [style] - Object - optional - - - - -
      -

      The style parameters

      - -
      - - -
        - -
      • - - [fill='black'] - Object - optional - - -
        -

        A canvas fillstyle that will be used on the text eg 'red', '#00FF00'

        - -
        - - -
      • - -
      • - - [align='left'] - String - optional - - -
        -

        Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text

        - -
        - - -
      • - -
      • - - [stroke='black'] - String - optional - - -
        -

        A canvas fillstyle that will be used on the text stroke eg 'blue', '#FCFF00'

        - -
        - - -
      • - -
      • - - [strokeThickness=0] - Number - optional - - -
        -

        A number that represents the thickness of the stroke. Default is 0 (no stroke)

        - -
        - - -
      • - -
      • - - [wordWrap=false] - Boolean - optional - - -
        -

        Indicates if word wrap should be used

        - -
        - - -
      • - -
      • - - [wordWrapWidth=100] - Number - optional - - -
        -

        The width at which text will wrap

        - -
        - - -
      • - -
      • - - [dropShadow=false] - Boolean - optional - - -
        -

        Set a drop shadow for the text

        - -
        - - -
      • - -
      • - - [dropShadowColor='#000000'] - String - optional - - -
        -

        A fill style to be used on the dropshadow e.g 'red', '#00FF00'

        - -
        - - -
      • - -
      • - - [dropShadowAngle=Math.PI/4] - Number - optional - - -
        -

        Set a angle of the drop shadow

        - -
        - - -
      • - -
      • - - [dropShadowDistance=5] - Number - optional - - -
        -

        Set a distance of the drop shadow

        - -
        - - -
      • - -
      - -
    • - -
    • - - [style.font='bold - String - - - - -
      -

      20pt Arial'] The style and size of the font

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setText

    - - -
    - (
      - -
    • - - text - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:147 - -

    - - - - - -
    - -
    -

    Set the copy for the text object. To split a line you can use '\n'.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - text - String - - - - -
      -

      The copy that you would like the text to display

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setTexture

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:135 - -

    - - - - - -
    - -
    -

    Sets the texture of the sprite

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The PIXI texture that is displayed by the sprite

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    -

    updateText

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:159 - -

    - - - - - -
    - -
    -

    Renders text and updates it when needed

    - -
    - - - - - - -
    - - -
    -

    updateTexture

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:281 - -

    - - - - - -
    - -
    -

    Updates texture size based on canvas size

    - -
    - - - - - - -
    - - -
    -

    wordWrap

    - - -
    - (
      - -
    • - - text - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:444 - -

    - - - - - -
    - -
    -

    Applies newlines to a string to have it optimally fit into the horizontal -bounds set by the Text object's wordWrapWidth property.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - text - String - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _height

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:50 - -

    - - - - -
    - -
    -

    The height of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _width

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:41 - -

    - - - - -
    - -
    -

    The width of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    anchor

    - Point - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:22 - -

    - - - - -
    - -
    -

    The anchor sets the origin point of the texture. -The default is 0,0 this means the texture's origin is the top left -Setting than anchor to 0.5,0.5 means the textures origin is centered -Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner

    - -
    - - - - - - -
    - - -
    -

    blendMode

    - Number - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:68 - -

    - - - - -
    - -
    -

    The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.

    - -
    - - -

    Default: PIXI.blendModes.NORMAL;

    - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    canvas

    - HTMLCanvasElement - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:29 - -

    - - - - -
    - -
    -

    The canvas element that everything is drawn to

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    context

    - HTMLCanvasElement - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:37 - -

    - - - - -
    - -
    -

    The canvas 2d context that everything is drawn with

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/text/Text.js:86 - -

    - - - - -
    - -
    -

    The height of the Text, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:44 - -

    - - - - -
    - -
    -

    The resolution of the canvas.

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    shader

    - PIXI.AbstractFilter - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:77 - -

    - - - - -
    - -
    -

    The shader that will be used to render the texture to the stage. Set to null to remove a current shader.

    - -
    - - -

    Default: null

    - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:33 - -

    - - - - -
    - -
    -

    The texture that the sprite is using

    - -
    - - - - - - -
    - - -
    -

    tint

    - Number - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:59 - -

    - - - - -
    - -
    -

    The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.

    - -
    - - -

    Default: 0xFFFFFF

    - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/text/Text.js:62 - -

    - - - - -
    - -
    -

    The width of the Text, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/Texture.html b/tutorial-1/pixi.js-master/docs/classes/Texture.html deleted file mode 100755 index c797d9a..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/Texture.html +++ /dev/null @@ -1,2786 +0,0 @@ - - - - - Texture - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Texture Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A texture stores the information that represents an image or part of an image. It cannot be added -to the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used.

    - -
    - - -
    -

    Constructor

    -
    -

    Texture

    - - -
    - (
      - -
    • - - baseTexture - -
    • - -
    • - - frame - -
    • - -
    • - - [crop] - -
    • - -
    • - - [trim] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:10 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - baseTexture - BaseTexture - - - - -
      -

      The base texture source to create the texture from

      - -
      - - -
    • - -
    • - - frame - Rectangle - - - - -
      -

      The rectangle frame of the texture to show

      - -
      - - -
    • - -
    • - - [crop] - Rectangle - optional - - - - -
      -

      The area of original texture

      - -
      - - -
    • - -
    • - - [trim] - Rectangle - optional - - - - -
      -

      Trimmed texture rectangle

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _updateUvs

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:200 - -

    - - - - - -
    - -
    -

    Updates the internal WebGL UV cache.

    - -
    - - - - - - -
    - - -
    -

    addTextureToCache

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - id - -
    • - -
    ) -
    - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:284 - -

    - - - - - -
    - -
    -

    Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The Texture to add to the cache.

      - -
      - - -
    • - -
    • - - id - String - - - - -
      -

      The id that the texture will be stored against.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    destroy

    - - -
    - (
      - -
    • - - destroyBase - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:149 - -

    - - - - - -
    - -
    -

    Destroys this texture

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - destroyBase - Boolean - - - - -
      -

      Whether to destroy the base texture as well

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    fromCanvas

    - - -
    - (
      - -
    • - - canvas - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:267 - -

    - - - - - -
    - -
    -

    Helper function that creates a new a Texture based on the given canvas element.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - canvas - Canvas - - - - -
      -

      The canvas element source of the texture

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - -

    Texture

    - - -
    -
    - - - -
    - - -
    -

    fromFrame

    - - -
    - (
      - -
    • - - frameId - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:251 - -

    - - - - - -
    - -
    -

    Helper function that returns a Texture objected based on the given frame id. -If the frame id is not in the texture cache an error will be thrown.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frameId - String - - - - -
      -

      The frame id of the texture

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - -

    Texture

    - - -
    -
    - - - -
    - - -
    -

    fromImage

    - - -
    - (
      - -
    • - - imageUrl - -
    • - -
    • - - crossorigin - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:227 - -

    - - - - - -
    - -
    -

    Helper function that creates a Texture object from the given image url. -If the image is not in the texture cache it will be created and loaded.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - imageUrl - String - - - - -
      -

      The image url of the texture

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - -

    Texture

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onBaseTextureLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:131 - -

    - - - - - -
    - -
    -

    Called when the base texture is loaded

    - -
    - - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeTextureFromCache

    - - -
    - (
      - -
    • - - id - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:297 - -

    - - - - - -
    - -
    -

    Remove a texture from the global PIXI.TextureCache.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - id - String - - - - -
      -

      The id of the texture to be removed

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    The texture that was removed

    - - -
    -
    - - - -
    - - -
    -

    setFrame

    - - -
    - (
      - -
    • - - frame - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:162 - -

    - - - - - -
    - -
    -

    Specifies the region of the baseTexture that this texture will use.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frame - Rectangle - - - - -
      -

      The frame of the texture to set it to

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _uvs

    - Object - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:83 - -

    - - - - -
    - -
    -

    The WebGL UV data cache.

    - -
    - - - - - - -
    - - -
    -

    baseTexture

    - BaseTexture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:43 - -

    - - - - -
    - -
    -

    The base texture that this texture uses.

    - -
    - - - - - - -
    - - -
    -

    crop

    - Rectangle - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:108 - -

    - - - - -
    - -
    -

    This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, -irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)

    - -
    - - - - - - -
    - - -
    -

    frame

    - Rectangle - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:51 - -

    - - - - -
    - -
    -

    The frame specifies the region of the base texture that this texture uses

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:100 - -

    - - - - -
    - -
    -

    The height of the Texture in pixels.

    - -
    - - - - - - -
    - - -
    -

    noFrame

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:24 - -

    - - - - -
    - -
    -

    Does this Texture have any frame data assigned to it?

    - -
    - - - - - - -
    - - -
    -

    requiresUpdate

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:75 - -

    - - - - -
    - -
    -

    This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)

    - -
    - - - - - - -
    - - -
    -

    trim

    - Rectangle - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:59 - -

    - - - - -
    - -
    -

    The texture trim data.

    - -
    - - - - - - -
    - - -
    -

    valid

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:67 - -

    - - - - -
    - -
    -

    This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:92 - -

    - - - - -
    - -
    -

    The width of the Texture in pixels.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/TilingSprite.html b/tutorial-1/pixi.js-master/docs/classes/TilingSprite.html deleted file mode 100755 index 00426d9..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/TilingSprite.html +++ /dev/null @@ -1,6532 +0,0 @@ - - - - - TilingSprite - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    TilingSprite Class

    -
    - - - -
    - Extends Sprite -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A tiling sprite is a fast way of rendering a tiling image

    - -
    - - -
    -

    Constructor

    -
    -

    TilingSprite

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      the texture of the tiling sprite

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      the width of the tiling sprite

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the height of the tiling sprite

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:194 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:137 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    generateTilingTexture

    - - -
    - (
      - -
    • - - forcePowerOfTwo - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:373 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - forcePowerOfTwo - Boolean - - - - -
      -

      Whether we want to force the texture to be a power of two

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:280 - -

    - - - - - -
    - -
    -

    Returns the framing rectangle of the sprite as a PIXI.Rectangle object

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - Sprite - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:360 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setTexture

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:135 - -

    - - - - - -
    - -
    -

    Sets the texture of the sprite

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The PIXI texture that is displayed by the sprite

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _height

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:50 - -

    - - - - -
    - -
    -

    The height of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _width

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:41 - -

    - - - - -
    - -
    -

    The width of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    anchor

    - Point - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:22 - -

    - - - - -
    - -
    -

    The anchor sets the origin point of the texture. -The default is 0,0 this means the texture's origin is the top left -Setting than anchor to 0.5,0.5 means the textures origin is centered -Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner

    - -
    - - - - - - -
    - - -
    -

    blendMode

    - Number - - - - - - - - - -
    - -

    Inherited from - - Sprite - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:77 - -

    - - - - -
    - -
    -

    The blend mode to be applied to the sprite

    - -
    - - -

    Default: PIXI.blendModes.NORMAL;

    - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:111 - -

    - - - - -
    - -
    -

    The height of the TilingSprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:27 - -

    - - - - -
    - -
    -

    The height of the tiling sprite

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:59 - -

    - - - - -
    - -
    -

    Whether this sprite is renderable or not

    - -
    - - -

    Default: true

    - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    shader

    - PIXI.AbstractFilter - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:77 - -

    - - - - -
    - -
    -

    The shader that will be used to render the texture to the stage. Set to null to remove a current shader.

    - -
    - - -

    Default: null

    - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:33 - -

    - - - - -
    - -
    -

    The texture that the sprite is using

    - -
    - - - - - - -
    - - -
    -

    tilePosition

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:51 - -

    - - - - -
    - -
    -

    The offset position of the image that is being tiled

    - -
    - - - - - - -
    - - -
    -

    tileScale

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:35 - -

    - - - - -
    - -
    -

    The scaling of the image that is being tiled

    - -
    - - - - - - -
    - - -
    -

    tileScaleOffset

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:43 - -

    - - - - -
    - -
    -

    A point that represents the scale of the texture object

    - -
    - - - - - - -
    - - -
    -

    tint

    - Number - - - - - - - - - -
    - -

    Inherited from - - Sprite - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:68 - -

    - - - - -
    - -
    -

    The tint applied to the sprite. This is a hex value

    - -
    - - -

    Default: 0xFFFFFF

    - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:19 - -

    - - - - -
    - -
    -

    The with of the tiling sprite

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:95 - -

    - - - - -
    - -
    -

    The width of the sprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/TiltShiftFilter.html b/tutorial-1/pixi.js-master/docs/classes/TiltShiftFilter.html deleted file mode 100755 index f8c853f..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/TiltShiftFilter.html +++ /dev/null @@ -1,614 +0,0 @@ - - - - - TiltShiftFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    TiltShiftFilter Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A TiltShift Filter. Manages the pass of both a TiltShiftXFilter and TiltShiftYFilter.

    - -
    - - -
    -

    Constructor

    -
    -

    TiltShiftFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - - - -
    -

    Properties

    - - -
    - - - - - -
    - - - - -
    -

    Properties

    - - -
    -

    blur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftFilter.js:24 - -

    - - - - -
    - -
    -

    The strength of the blur.

    - -
    - - - - - - -
    - - -
    -

    end

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftFilter.js:69 - -

    - - - - -
    - -
    -

    The Y value to end the effect at.

    - -
    - - - - - - -
    - - -
    -

    gradientBlur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftFilter.js:39 - -

    - - - - -
    - -
    -

    The strength of the gradient blur.

    - -
    - - - - - - -
    - - -
    -

    start

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftFilter.js:54 - -

    - - - - -
    - -
    -

    The Y value to start the effect at.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/TiltShiftXFilter.html b/tutorial-1/pixi.js-master/docs/classes/TiltShiftXFilter.html deleted file mode 100755 index 56c306a..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/TiltShiftXFilter.html +++ /dev/null @@ -1,1053 +0,0 @@ - - - - - TiltShiftXFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    TiltShiftXFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A TiltShiftXFilter.

    - -
    - - -
    -

    Constructor

    -
    -

    TiltShiftXFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    -

    updateDelta

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:138 - -

    - - - - - -
    - -
    -

    Updates the filter delta values.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:72 - -

    - - - - -
    - -
    -

    The strength of the blur.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    end

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:121 - -

    - - - - -
    - -
    -

    The X value to end the effect at.

    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    gradientBlur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:88 - -

    - - - - -
    - -
    -

    The strength of the gradient blur.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    start

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:104 - -

    - - - - -
    - -
    -

    The X value to start the effect at.

    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/TiltShiftYFilter.html b/tutorial-1/pixi.js-master/docs/classes/TiltShiftYFilter.html deleted file mode 100755 index cd66a7f..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/TiltShiftYFilter.html +++ /dev/null @@ -1,1053 +0,0 @@ - - - - - TiltShiftYFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    TiltShiftYFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A TiltShiftYFilter.

    - -
    - - -
    -

    Constructor

    -
    -

    TiltShiftYFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    -

    updateDelta

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:138 - -

    - - - - - -
    - -
    -

    Updates the filter delta values.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:72 - -

    - - - - -
    - -
    -

    The strength of the blur.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    end

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:121 - -

    - - - - -
    - -
    -

    The Y value to end the effect at.

    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    gradientBlur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:88 - -

    - - - - -
    - -
    -

    The strength of the gradient blur.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    start

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:104 - -

    - - - - -
    - -
    -

    The Y value to start the effect at.

    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/TwistFilter.html b/tutorial-1/pixi.js-master/docs/classes/TwistFilter.html deleted file mode 100755 index 482d5a9..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/TwistFilter.html +++ /dev/null @@ -1,939 +0,0 @@ - - - - - TwistFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    TwistFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This filter applies a twist effect making display objects appear twisted in the given direction.

    - -
    - - -
    -

    Constructor

    -
    -

    TwistFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TwistFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    angle

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TwistFilter.js:88 - -

    - - - - -
    - -
    -

    This angle of the twist.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    offset

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TwistFilter.js:56 - -

    - - - - -
    - -
    -

    This point describes the the offset of the twist.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    radius

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TwistFilter.js:72 - -

    - - - - -
    - -
    -

    This radius of the twist.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/WebGLBlendModeManager.html b/tutorial-1/pixi.js-master/docs/classes/WebGLBlendModeManager.html deleted file mode 100755 index f69e5db..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/WebGLBlendModeManager.html +++ /dev/null @@ -1,760 +0,0 @@ - - - - - WebGLBlendModeManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLBlendModeManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLBlendModeManager

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:50 - -

    - - - - - -
    - -
    -

    Destroys this object.

    - -
    - - - - - - -
    - - -
    -

    setBlendMode

    - - -
    - (
      - -
    • - - blendMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:32 - -

    - - - - - -
    - -
    -

    Sets-up the given blendMode from WebGL's point of view.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - blendMode - Number - - - - -
      -

      the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:21 - -

    - - - - - -
    - -
    -

    Sets the WebGL Context.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    currentBlendMode

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/WebGLFastSpriteBatch.html b/tutorial-1/pixi.js-master/docs/classes/WebGLFastSpriteBatch.html deleted file mode 100755 index fcc1a27..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/WebGLFastSpriteBatch.html +++ /dev/null @@ -1,1831 +0,0 @@ - - - - - WebGLFastSpriteBatch - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLFastSpriteBatch Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLFastSpriteBatch

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:11 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    begin

    - - -
    - (
      - -
    • - - spriteBatch - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:154 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - spriteBatch - WebGLSpriteBatch - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    end

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:169 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    flush

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:349 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    render

    - - -
    - (
      - -
    • - - spriteBatch - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:177 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    renderSprite

    - - -
    - (
      - -
    • - - sprite - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:208 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - sprite - Sprite - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:130 - -

    - - - - - -
    - -
    -

    Sets the WebGL Context.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    start

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:397 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    stop

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:389 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    currentBaseTexture

    - BaseTexture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:95 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    currentBatchSize

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:89 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    currentBlendMode

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:101 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    drawing

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:83 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    indexBuffer

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:61 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    indices

    - Uint16Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:48 - -

    - - - - -
    - -
    -

    Index data

    - -
    - - - - - - -
    - - -
    -

    lastIndexCount

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:67 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    matrix

    - Matrix - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:119 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    maxSize

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:23 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    renderSession

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:107 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    shader

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:113 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    size

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:29 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    vertexBuffer

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:55 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    vertices

    - Float32Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:41 - -

    - - - - -
    - -
    -

    Vertex data

    - -
    - - - - - - -
    - - -
    -

    vertSize

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:17 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/WebGLFilterManager.html b/tutorial-1/pixi.js-master/docs/classes/WebGLFilterManager.html deleted file mode 100755 index 004f51f..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/WebGLFilterManager.html +++ /dev/null @@ -1,1229 +0,0 @@ - - - - - WebGLFilterManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLFilterManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLFilterManager

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    applyFilterPass

    - - -
    - (
      - -
    • - - filter - -
    • - -
    • - - filterArea - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:315 - -

    - - - - - -
    - -
    -

    Applies the filter to the specified area.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - filter - AbstractFilter - - - - -
      -

      the filter that needs to be applied

      - -
      - - -
    • - -
    • - - filterArea - Texture - - - - -
      -

      TODO - might need an update

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      the horizontal range of the filter

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the vertical range of the filter

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    begin

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    • - - buffer - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:46 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    • - - buffer - ArrayBuffer - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:424 - -

    - - - - - -
    - -
    -

    Destroys the filter and removes it from the filter stack.

    - -
    - - - - - - -
    - - -
    -

    initShaderBuffers

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:376 - -

    - - - - - -
    - -
    -

    Initialises the shader buffers.

    - -
    - - - - - - -
    - - -
    -

    popFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:138 - -

    - - - - - -
    - -
    -

    Removes the last filter from the filter stack and doesn't return it.

    - -
    - - - - - - -
    - - -
    -

    pushFilter

    - - -
    - (
      - -
    • - - filterBlock - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:62 - -

    - - - - - -
    - -
    -

    Applies the filter and adds it to the current filter stack.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - filterBlock - Object - - - - -
      -

      the filter that will be pushed to the current filter stack

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:32 - -

    - - - - - -
    - -
    -

    Initialises the context and the properties.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    filterStack

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:11 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    offsetX

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:17 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    offsetY

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:23 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/WebGLGraphics.html b/tutorial-1/pixi.js-master/docs/classes/WebGLGraphics.html deleted file mode 100755 index f33138b..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/WebGLGraphics.html +++ /dev/null @@ -1,1683 +0,0 @@ - - - - - WebGLGraphics - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLGraphics Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A set of functions used by the webGL renderer to draw the primitive graphics data

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    buildCircle

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:421 - -

    - - - - - -
    - -
    -

    Builds a circle to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object to draw

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    buildComplexPoly

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:716 - -

    - - - - - -
    - -
    -

    Builds a complex polygon to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object containing all the necessary properties

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    buildLine

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:504 - -

    - - - - - -
    - -
    -

    Builds a line to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object containing all the necessary properties

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    buildPoly

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:778 - -

    - - - - - -
    - -
    -

    Builds a polygon to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object containing all the necessary properties

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    buildRectangle

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:233 - -

    - - - - - -
    - -
    -

    Builds a rectangle to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object containing all the necessary properties

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    buildRoundedRectangle

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:301 - -

    - - - - - -
    - -
    -

    Builds a rounded rectangle to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object containing all the necessary properties

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    quadraticBezierCurve

    - - -
    - (
      - -
    • - - fromX - -
    • - -
    • - - fromY - -
    • - -
    • - - cpX - -
    • - -
    • - - cpY - -
    • - -
    • - - toX - -
    • - -
    • - - toY - -
    • - -
    ) -
    - - - - - Array - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:369 - -

    - - - - - -
    - -
    -

    Calculate the points for a quadratic bezier curve. (helper function..) -Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - fromX - Number - - - - -
      -

      Origin point x

      - -
      - - -
    • - -
    • - - fromY - Number - - - - -
      -

      Origin point x

      - -
      - - -
    • - -
    • - - cpX - Number - - - - -
      -

      Control point x

      - -
      - - -
    • - -
    • - - cpY - Number - - - - -
      -

      Control point y

      - -
      - - -
    • - -
    • - - toX - Number - - - - -
      -

      Destination point x

      - -
      - - -
    • - -
    • - - toY - Number - - - - -
      -

      Destination point y

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - - -
    -
    - - - -
    - - -
    -

    renderGraphics

    - - -
    - (
      - -
    • - - graphics - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:16 - -

    - - - - - -
    - -
    -

    Renders the graphics object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphics - Graphics - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    switchMode

    - - -
    - (
      - -
    • - - webGL - -
    • - -
    • - - type - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:199 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - webGL - WebGLContext - - - - -
      - -
      - - -
    • - -
    • - - type - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    updateGraphics

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:84 - -

    - - - - - -
    - -
    -

    Updates the graphics object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object to update

      - -
      - - -
    • - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/WebGLGraphicsData.html b/tutorial-1/pixi.js-master/docs/classes/WebGLGraphicsData.html deleted file mode 100755 index d099949..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/WebGLGraphicsData.html +++ /dev/null @@ -1,470 +0,0 @@ - - - - - WebGLGraphicsData - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLGraphicsData Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    reset

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:850 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    upload

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:860 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/WebGLMaskManager.html b/tutorial-1/pixi.js-master/docs/classes/WebGLMaskManager.html deleted file mode 100755 index 0642f8b..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/WebGLMaskManager.html +++ /dev/null @@ -1,798 +0,0 @@ - - - - - WebGLMaskManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLMaskManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLMaskManager

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js:61 - -

    - - - - - -
    - -
    -

    Destroys the mask stack.

    - -
    - - - - - - -
    - - -
    -

    popMask

    - - -
    - (
      - -
    • - - maskData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js:48 - -

    - - - - - -
    - -
    -

    Removes the last filter from the filter stack and doesn't return it.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - maskData - Array - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      -

      an object containing all the useful parameters

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    pushMask

    - - -
    - (
      - -
    • - - maskData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js:27 - -

    - - - - - -
    - -
    -

    Applies the Mask and adds it to the current filter stack.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - maskData - Array - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js:16 - -

    - - - - - -
    - -
    -

    Sets the drawing context to the one given in parameter.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/WebGLRenderer.html b/tutorial-1/pixi.js-master/docs/classes/WebGLRenderer.html deleted file mode 100755 index 15691a5..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/WebGLRenderer.html +++ /dev/null @@ -1,2526 +0,0 @@ - - - - - WebGLRenderer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLRenderer Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer -should be used for browsers that support webGL. This Render works by automatically managing webGLBatchs. -So no need for Sprite Batches or Sprite Clouds. -Don't forget to add the view to your DOM or you will not see anything :)

    - -
    - - -
    -

    Constructor

    -
    -

    WebGLRenderer

    - - -
    - (
      - -
    • - - [width=0] - -
    • - -
    • - - [height=0] - -
    • - -
    • - - [options] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:8 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - [width=0] - Number - optional - - - - -
      -

      the width of the canvas view

      - -
      - - -
    • - -
    • - - [height=0] - Number - optional - - - - -
      -

      the height of the canvas view

      - -
      - - -
    • - -
    • - - [options] - Object - optional - - - - -
      -

      The optional renderer parameters

      - -
      - - -
        - -
      • - - [view] - HTMLCanvasElement - optional - - -
        -

        the canvas to use as a view, optional

        - -
        - - -
      • - -
      • - - [transparent=false] - Boolean - optional - - -
        -

        If the render view is transparent, default false

        - -
        - - -
      • - -
      • - - [autoResize=false] - Boolean - optional - - -
        -

        If the render view is automatically resized, default false

        - -
        - - -
      • - -
      • - - [antialias=false] - Boolean - optional - - -
        -

        sets antialias (only applicable in chrome at the moment)

        - -
        - - -
      • - -
      • - - [preserveDrawingBuffer=false] - Boolean - optional - - -
        -

        enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context

        - -
        - - -
      • - -
      • - - [resolution=1] - Number - optional - - -
        -

        the resolution of the renderer retina would be 2

        - -
        - - -
      • - -
      - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:477 - -

    - - - - - -
    - -
    -

    Removes everything from the renderer (event listeners, spritebatch, etc...)

    - -
    - - - - - - -
    - - -
    -

    handleContextLost

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:443 - -

    - - - - - -
    - -
    -

    Handles a lost webgl context

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    handleContextRestored

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:456 - -

    - - - - - -
    - -
    -

    Handles a restored webgl context

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    initContext

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:238 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    mapBlendModes

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:508 - -

    - - - - - -
    - -
    -

    Maps Pixi blend modes to WebGL blend modes.

    - -
    - - - - - - -
    - - -
    -

    render

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:276 - -

    - - - - - -
    - -
    -

    Renders the stage to its webGL view

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the Stage element to be rendered

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderDisplayObject

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - projection - -
    • - -
    • - - buffer - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:344 - -

    - - - - - -
    - -
    -

    Renders a Display Object.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      The DisplayObject to render

      - -
      - - -
    • - -
    • - - projection - Point - - - - -
      -

      The projection

      - -
      - - -
    • - -
    • - - buffer - Array - - - - -
      -

      a standard WebGL buffer

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    resize

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:378 - -

    - - - - - -
    - -
    -

    Resizes the webGL view to the specified width and height.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      the new width of the webGL view

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the new height of the webGL view

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    updateTexture

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:404 - -

    - - - - - -
    - -
    -

    Updates and Creates a WebGL texture for the renderers context.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      the texture to update

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _contextOptions

    - Object - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:142 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    autoResize

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:71 - -

    - - - - -
    - -
    -

    Whether the render view should be resized automatically

    - -
    - - - - - - -
    - - -
    -

    blendModeManager

    - WebGLBlendModeManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:204 - -

    - - - - -
    - -
    -

    Manages the blendModes

    - -
    - - - - - - -
    - - -
    -

    clearBeforeRender

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:87 - -

    - - - - -
    - -
    -

    This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true: -If the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0). -If the Stage is transparent, Pixi will clear to the target Stage's background color. -Disable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set.

    - -
    - - - - - - -
    - - -
    -

    contextLostBound

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:127 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    contextRestoredBound

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:133 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    filterManager

    - WebGLFilterManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:190 - -

    - - - - -
    - -
    -

    Manages the filters

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:108 - -

    - - - - -
    - -
    -

    The height of the canvas view

    - -
    - - -

    Default: 600

    - - - - - -
    - - -
    -

    maskManager

    - WebGLMaskManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:183 - -

    - - - - -
    - -
    -

    Manages the masks using the stencil buffer

    - -
    - - - - - - -
    - - -
    -

    offset

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:161 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    preserveDrawingBuffer

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:79 - -

    - - - - -
    - -
    -

    The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering.

    - -
    - - - - - - -
    - - -
    -

    projection

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:155 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    renderSession

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:211 - -

    - - - - -
    - -
    -

    TODO remove

    - -
    - - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:52 - -

    - - - - -
    - -
    -

    The resolution of the renderer

    - -
    - - -

    Default: 1

    - - - - - -
    - - -
    -

    shaderManager

    - WebGLShaderManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:169 - -

    - - - - -
    - -
    -

    Deals with managing the shader programs and their attribs

    - -
    - - - - - - -
    - - -
    -

    spriteBatch

    - WebGLSpriteBatch - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:176 - -

    - - - - -
    - -
    -

    Manages the rendering of sprites

    - -
    - - - - - - -
    - - -
    -

    stencilManager

    - WebGLStencilManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:197 - -

    - - - - -
    - -
    -

    Manages the stencil buffer

    - -
    - - - - - - -
    - - -
    -

    transparent

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:63 - -

    - - - - -
    - -
    -

    Whether the render view is transparent

    - -
    - - - - - - -
    - - -
    -

    type

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:46 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    view

    - HTMLCanvasElement - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:117 - -

    - - - - -
    - -
    -

    The canvas element that everything is drawn to

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:99 - -

    - - - - -
    - -
    -

    The width of the canvas view

    - -
    - - -

    Default: 800

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/WebGLShaderManager.html b/tutorial-1/pixi.js-master/docs/classes/WebGLShaderManager.html deleted file mode 100755 index 376b9d7..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/WebGLShaderManager.html +++ /dev/null @@ -1,976 +0,0 @@ - - - - - WebGLShaderManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLShaderManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLShaderManager

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:135 - -

    - - - - - -
    - -
    -

    Destroys this object.

    - -
    - - - - - - -
    - - -
    -

    setAttribs

    - - -
    - (
      - -
    • - - attribs - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:72 - -

    - - - - - -
    - -
    -

    Takes the attributes given in parameters.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - attribs - Array - - - - -
      -

      attribs

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:45 - -

    - - - - - -
    - -
    -

    Initialises the context and the properties.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setShader

    - - -
    - (
      - -
    • - - shader - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:115 - -

    - - - - - -
    - -
    -

    Sets the current shader.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - shader - Any - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    attribState

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:18 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    maxAttibs

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    stack

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:35 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    tempAttribState

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/WebGLSpriteBatch.html b/tutorial-1/pixi.js-master/docs/classes/WebGLSpriteBatch.html deleted file mode 100755 index b4101f2..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/WebGLSpriteBatch.html +++ /dev/null @@ -1,2619 +0,0 @@ - - - - - WebGLSpriteBatch - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLSpriteBatch Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLSpriteBatch

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:11 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _CompileShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    • - - shaderSrc - -
    • - -
    • - - shaderType - -
    • - -
    ) -
    - - - - - Any - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:38 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    • - - shaderSrc - Array - - - - -
      - -
      - - -
    • - -
    • - - shaderType - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Any: - - -
    -
    - - - -
    - - -
    -

    begin

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:164 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The RenderSession object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    CompileFragmentShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    • - - shaderSrc - -
    • - -
    ) -
    - - - - - Any - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:26 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    • - - shaderSrc - Array - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Any: - - -
    -
    - - - -
    - - -
    -

    compileProgram

    - - -
    - (
      - -
    • - - gl - -
    • - -
    • - - vertexSrc - -
    • - -
    • - - fragmentSrc - -
    • - -
    ) -
    - - - - - Any - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:63 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    • - - vertexSrc - Array - - - - -
      - -
      - - -
    • - -
    • - - fragmentSrc - Array - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Any: - - -
    -
    - - - -
    - - -
    -

    CompileVertexShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    • - - shaderSrc - -
    • - -
    ) -
    - - - - - Any - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:14 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    • - - shaderSrc - Array - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Any: - - -
    -
    - - - -
    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:589 - -

    - - - - - -
    - -
    -

    Destroys the SpriteBatch.

    - -
    - - - - - - -
    - - -
    -

    end

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:176 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    flush

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:418 - -

    - - - - - -
    - -
    -

    Renders the content and empties the current batch.

    - -
    - - - - - - -
    - - -
    -

    initDefaultShaders

    - - - () - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    render

    - - -
    - (
      - -
    • - - sprite - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:184 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - sprite - Sprite - - - - -
      -

      the sprite to render when using this spritebatch

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderBatch

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - size - -
    • - -
    • - - startIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:542 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      - -
      - - -
    • - -
    • - - size - Number - - - - -
      - -
      - - -
    • - -
    • - - startIndex - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderTilingSprite

    - - -
    - (
      - -
    • - - sprite - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:297 - -

    - - - - - -
    - -
    -

    Renders a TilingSprite using the spriteBatch.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - sprite - TilingSprite - - - - -
      -

      the tilingSprite to render

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:132 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    start

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:581 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    stop

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:572 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blendModes

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:99 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    currentBaseTexture

    - BaseTexture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:81 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    currentBatchSize

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:75 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    defaultShader

    - AbstractFilter - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:117 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:87 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    drawing

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:69 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    indices

    - Uint16Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:45 - -

    - - - - -
    - -
    -

    Holds the indices

    - -
    - - - - - - -
    - - -
    -

    lastIndexCount

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:53 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:105 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    size

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:25 - -

    - - - - -
    - -
    -

    The number of images in the SpriteBatch before it flushes

    - -
    - - - - - - -
    - - -
    -

    sprites

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:111 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    textures

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:93 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    vertices

    - Float32Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:37 - -

    - - - - -
    - -
    -

    Holds the vertices

    - -
    - - - - - - -
    - - -
    -

    vertSize

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:19 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/WebGLStencilManager.html b/tutorial-1/pixi.js-master/docs/classes/WebGLStencilManager.html deleted file mode 100755 index 2dac12b..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/WebGLStencilManager.html +++ /dev/null @@ -1,975 +0,0 @@ - - - - - WebGLStencilManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLStencilManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLStencilManager

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    bindGraphics

    - - -
    - (
      - -
    • - - graphics - -
    • - -
    • - - webGLData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:120 - -

    - - - - - -
    - -
    -

    TODO this does not belong here!

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphics - Graphics - - - - -
      - -
      - - -
    • - -
    • - - webGLData - Array - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:285 - -

    - - - - - -
    - -
    -

    Destroys the mask stack.

    - -
    - - - - - - -
    - - -
    -

    popStencil

    - - -
    - (
      - -
    • - - graphics - -
    • - -
    • - - webGLData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:190 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphics - Graphics - - - - -
      - -
      - - -
    • - -
    • - - webGLData - Array - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    pushMask

    - - -
    - (
      - -
    • - - graphics - -
    • - -
    • - - webGLData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:28 - -

    - - - - - -
    - -
    -

    Applies the Mask and adds it to the current filter stack.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphics - Graphics - - - - -
      - -
      - - -
    • - -
    • - - webGLData - Array - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:17 - -

    - - - - - -
    - -
    -

    Sets the drawing context to the one given in parameter.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/autoDetectRecommendedRenderer.html b/tutorial-1/pixi.js-master/docs/classes/autoDetectRecommendedRenderer.html deleted file mode 100755 index c222af0..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/autoDetectRecommendedRenderer.html +++ /dev/null @@ -1,336 +0,0 @@ - - - - - autoDetectRecommendedRenderer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    autoDetectRecommendedRenderer Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This helper function will automatically detect which renderer you should be using. -This function is very similar to the autoDetectRenderer function except that is will return a canvas renderer for android. -Even thought both android chrome supports webGL the canvas implementation perform better at the time of writing. -This function will likely change and update as webGL performance improves on these devices.

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - - - - - - - -
    - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/autoDetectRenderer.html b/tutorial-1/pixi.js-master/docs/classes/autoDetectRenderer.html deleted file mode 100755 index bbf799f..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/autoDetectRenderer.html +++ /dev/null @@ -1,335 +0,0 @@ - - - - - autoDetectRenderer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    autoDetectRenderer Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This helper function will automatically detect which renderer you should be using. -WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by -the browser then this function will return a canvas renderer

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - - - - - - - -
    - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/classes/index.html b/tutorial-1/pixi.js-master/docs/classes/index.html deleted file mode 100755 index 487fe15..0000000 --- a/tutorial-1/pixi.js-master/docs/classes/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Redirector - - - - Click here to redirect - - diff --git a/tutorial-1/pixi.js-master/docs/data.json b/tutorial-1/pixi.js-master/docs/data.json deleted file mode 100755 index e0b8298..0000000 --- a/tutorial-1/pixi.js-master/docs/data.json +++ /dev/null @@ -1,12399 +0,0 @@ -{ - "project": { - "name": "pixi.js", - "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", - "version": "2.1.0", - "url": "http://goodboydigital.com/", - "logo": "http://www.goodboydigital.com/pixijs/logo_small.png" - }, - "files": { - "src/pixi/display/DisplayObject.js": { - "name": "src/pixi/display/DisplayObject.js", - "modules": {}, - "classes": { - "DisplayObject": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/display/DisplayObjectContainer.js": { - "name": "src/pixi/display/DisplayObjectContainer.js", - "modules": {}, - "classes": { - "DisplayObjectContainer": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/display/MovieClip.js": { - "name": "src/pixi/display/MovieClip.js", - "modules": {}, - "classes": { - "MovieClip": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/display/Sprite.js": { - "name": "src/pixi/display/Sprite.js", - "modules": {}, - "classes": { - "Sprite": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/display/SpriteBatch.js": { - "name": "src/pixi/display/SpriteBatch.js", - "modules": {}, - "classes": { - "SpriteBatch": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/display/Stage.js": { - "name": "src/pixi/display/Stage.js", - "modules": {}, - "classes": { - "Stage": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/extras/Rope.js": { - "name": "src/pixi/extras/Rope.js", - "modules": {}, - "classes": { - "Rope": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/extras/Spine.js": { - "name": "src/pixi/extras/Spine.js", - "modules": {}, - "classes": { - "Spine": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/extras/Strip.js": { - "name": "src/pixi/extras/Strip.js", - "modules": {}, - "classes": { - "Strip": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/extras/TilingSprite.js": { - "name": "src/pixi/extras/TilingSprite.js", - "modules": {}, - "classes": { - "TilingSprite": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/AbstractFilter.js": { - "name": "src/pixi/filters/AbstractFilter.js", - "modules": {}, - "classes": { - "AbstractFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/AlphaMaskFilter.js": { - "name": "src/pixi/filters/AlphaMaskFilter.js", - "modules": {}, - "classes": { - "AlphaMaskFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/AsciiFilter.js": { - "name": "src/pixi/filters/AsciiFilter.js", - "modules": {}, - "classes": { - "AsciiFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/BlurFilter.js": { - "name": "src/pixi/filters/BlurFilter.js", - "modules": {}, - "classes": { - "BlurFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/BlurXFilter.js": { - "name": "src/pixi/filters/BlurXFilter.js", - "modules": {}, - "classes": { - "BlurXFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/BlurYFilter.js": { - "name": "src/pixi/filters/BlurYFilter.js", - "modules": {}, - "classes": { - "BlurYFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/ColorMatrixFilter.js": { - "name": "src/pixi/filters/ColorMatrixFilter.js", - "modules": {}, - "classes": { - "ColorMatrixFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/ColorStepFilter.js": { - "name": "src/pixi/filters/ColorStepFilter.js", - "modules": {}, - "classes": { - "ColorStepFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/ConvolutionFilter.js": { - "name": "src/pixi/filters/ConvolutionFilter.js", - "modules": {}, - "classes": { - "ConvolutionFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/CrossHatchFilter.js": { - "name": "src/pixi/filters/CrossHatchFilter.js", - "modules": {}, - "classes": { - "CrossHatchFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/DisplacementFilter.js": { - "name": "src/pixi/filters/DisplacementFilter.js", - "modules": {}, - "classes": { - "DisplacementFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/DotScreenFilter.js": { - "name": "src/pixi/filters/DotScreenFilter.js", - "modules": {}, - "classes": { - "DotScreenFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/FilterBlock.js": { - "name": "src/pixi/filters/FilterBlock.js", - "modules": {}, - "classes": { - "FilterBlock": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/GrayFilter.js": { - "name": "src/pixi/filters/GrayFilter.js", - "modules": {}, - "classes": { - "GrayFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/InvertFilter.js": { - "name": "src/pixi/filters/InvertFilter.js", - "modules": {}, - "classes": { - "InvertFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/NoiseFilter.js": { - "name": "src/pixi/filters/NoiseFilter.js", - "modules": {}, - "classes": { - "NoiseFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/NormalMapFilter.js": { - "name": "src/pixi/filters/NormalMapFilter.js", - "modules": {}, - "classes": { - "NormalMapFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/PixelateFilter.js": { - "name": "src/pixi/filters/PixelateFilter.js", - "modules": {}, - "classes": { - "PixelateFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/RGBSplitFilter.js": { - "name": "src/pixi/filters/RGBSplitFilter.js", - "modules": {}, - "classes": { - "RGBSplitFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/SepiaFilter.js": { - "name": "src/pixi/filters/SepiaFilter.js", - "modules": {}, - "classes": { - "SepiaFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/SmartBlurFilter.js": { - "name": "src/pixi/filters/SmartBlurFilter.js", - "modules": {}, - "classes": { - "SmartBlurFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/TiltShiftFilter.js": { - "name": "src/pixi/filters/TiltShiftFilter.js", - "modules": {}, - "classes": { - "TiltShiftFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/TiltShiftXFilter.js": { - "name": "src/pixi/filters/TiltShiftXFilter.js", - "modules": {}, - "classes": { - "TiltShiftXFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/TiltShiftYFilter.js": { - "name": "src/pixi/filters/TiltShiftYFilter.js", - "modules": {}, - "classes": { - "TiltShiftYFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/TwistFilter.js": { - "name": "src/pixi/filters/TwistFilter.js", - "modules": {}, - "classes": { - "TwistFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Circle.js": { - "name": "src/pixi/geom/Circle.js", - "modules": {}, - "classes": { - "Circle": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Ellipse.js": { - "name": "src/pixi/geom/Ellipse.js", - "modules": {}, - "classes": { - "Ellipse": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Matrix.js": { - "name": "src/pixi/geom/Matrix.js", - "modules": {}, - "classes": { - "Matrix": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Point.js": { - "name": "src/pixi/geom/Point.js", - "modules": {}, - "classes": { - "Point": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Polygon.js": { - "name": "src/pixi/geom/Polygon.js", - "modules": {}, - "classes": { - "Polygon": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Rectangle.js": { - "name": "src/pixi/geom/Rectangle.js", - "modules": {}, - "classes": { - "Rectangle": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/RoundedRectangle.js": { - "name": "src/pixi/geom/RoundedRectangle.js", - "modules": {}, - "classes": { - "Rounded Rectangle": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/loaders/AssetLoader.js": { - "name": "src/pixi/loaders/AssetLoader.js", - "modules": {}, - "classes": { - "AssetLoader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/loaders/AtlasLoader.js": { - "name": "src/pixi/loaders/AtlasLoader.js", - "modules": {}, - "classes": { - "AtlasLoader": 1 - }, - "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/JsonLoader.js": { - "name": "src/pixi/loaders/JsonLoader.js", - "modules": {}, - "classes": { - "JsonLoader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/loaders/SpineLoader.js": { - "name": "src/pixi/loaders/SpineLoader.js", - "modules": {}, - "classes": { - "SpineLoader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/loaders/SpriteSheetLoader.js": { - "name": "src/pixi/loaders/SpriteSheetLoader.js", - "modules": {}, - "classes": { - "SpriteSheetLoader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/primitives/Graphics.js": { - "name": "src/pixi/primitives/Graphics.js", - "modules": {}, - "classes": { - "Graphics": 1, - "GraphicsData": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/canvas/utils/CanvasBuffer.js": { - "name": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "modules": {}, - "classes": { - "CanvasBuffer": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/canvas/utils/CanvasMaskManager.js": { - "name": "src/pixi/renderers/canvas/utils/CanvasMaskManager.js", - "modules": {}, - "classes": { - "CanvasMaskManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/canvas/utils/CanvasTinter.js": { - "name": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "modules": {}, - "classes": { - "CanvasTinter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/canvas/CanvasGraphics.js": { - "name": "src/pixi/renderers/canvas/CanvasGraphics.js", - "modules": {}, - "classes": { - "CanvasGraphics": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/canvas/CanvasRenderer.js": { - "name": "src/pixi/renderers/canvas/CanvasRenderer.js", - "modules": {}, - "classes": { - "CanvasRenderer": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js": { - "name": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "modules": {}, - "classes": { - "ComplexPrimitiveShader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/shaders/PixiFastShader.js": { - "name": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "modules": {}, - "classes": { - "PixiFastShader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/shaders/PixiShader.js": { - "name": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "modules": {}, - "classes": { - "PixiShader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/shaders/PrimitiveShader.js": { - "name": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "modules": {}, - "classes": { - "PrimitiveShader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/shaders/StripShader.js": { - "name": "src/pixi/renderers/webgl/shaders/StripShader.js", - "modules": {}, - "classes": { - "StripShader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/FilterTexture.js": { - "name": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "modules": {}, - "classes": { - "FilterTexture": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "modules": {}, - "classes": { - "WebGLBlendModeManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "modules": {}, - "classes": { - "WebGLFastSpriteBatch": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLFilterManager.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "modules": {}, - "classes": { - "WebGLFilterManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLGraphics.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "modules": {}, - "classes": { - "WebGLGraphics": 1, - "WebGLGraphicsData": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLMaskManager.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "modules": {}, - "classes": { - "WebGLMaskManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLShaderManager.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "modules": {}, - "classes": { - "WebGLShaderManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "modules": {}, - "classes": { - "WebGLSpriteBatch": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLStencilManager.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "modules": {}, - "classes": { - "WebGLStencilManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/WebGLRenderer.js": { - "name": "src/pixi/renderers/webgl/WebGLRenderer.js", - "modules": {}, - "classes": { - "WebGLRenderer": 1 - }, - "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": {}, - "classes": { - "BaseTexture": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/textures/RenderTexture.js": { - "name": "src/pixi/textures/RenderTexture.js", - "modules": {}, - "classes": { - "RenderTexture": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/textures/Texture.js": { - "name": "src/pixi/textures/Texture.js", - "modules": {}, - "classes": { - "Texture": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/textures/VideoTexture.js": { - "name": "src/pixi/textures/VideoTexture.js", - "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} - }, - "src/pixi/utils/Detector.js": { - "name": "src/pixi/utils/Detector.js", - "modules": {}, - "classes": { - "autoDetectRenderer": 1, - "autoDetectRecommendedRenderer": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/utils/EventTarget.js": { - "name": "src/pixi/utils/EventTarget.js", - "modules": {}, - "classes": { - "EventTarget": 1, - "Event": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/utils/Polyk.js": { - "name": "src/pixi/utils/Polyk.js", - "modules": {}, - "classes": { - "PolyK": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/utils/Utils.js": { - "name": "src/pixi/utils/Utils.js", - "modules": {}, - "classes": { - "AjaxRequest": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/InteractionData.js": { - "name": "src/pixi/InteractionData.js", - "modules": {}, - "classes": { - "InteractionData": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/InteractionManager.js": { - "name": "src/pixi/InteractionManager.js", - "modules": {}, - "classes": { - "InteractionManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/Intro.js": { - "name": "src/pixi/Intro.js", - "modules": {}, - "classes": {}, - "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": { - "PIXI": 1 - }, - "classes": {}, - "fors": {}, - "namespaces": {} - } - }, - "modules": { - "PIXI": { - "name": "PIXI", - "submodules": {}, - "classes": { - "DisplayObject": 1, - "DisplayObjectContainer": 1, - "MovieClip": 1, - "Sprite": 1, - "SpriteBatch": 1, - "Stage": 1, - "Rope": 1, - "Spine": 1, - "Strip": 1, - "TilingSprite": 1, - "AbstractFilter": 1, - "AlphaMaskFilter": 1, - "AsciiFilter": 1, - "BlurFilter": 1, - "BlurXFilter": 1, - "BlurYFilter": 1, - "ColorMatrixFilter": 1, - "ColorStepFilter": 1, - "ConvolutionFilter": 1, - "CrossHatchFilter": 1, - "DisplacementFilter": 1, - "DotScreenFilter": 1, - "FilterBlock": 1, - "GrayFilter": 1, - "InvertFilter": 1, - "NoiseFilter": 1, - "NormalMapFilter": 1, - "PixelateFilter": 1, - "RGBSplitFilter": 1, - "SepiaFilter": 1, - "SmartBlurFilter": 1, - "TiltShiftFilter": 1, - "TiltShiftXFilter": 1, - "TiltShiftYFilter": 1, - "TwistFilter": 1, - "Circle": 1, - "Ellipse": 1, - "Matrix": 1, - "Point": 1, - "Polygon": 1, - "Rectangle": 1, - "Rounded Rectangle": 1, - "AssetLoader": 1, - "AtlasLoader": 1, - "BitmapFontLoader": 1, - "ImageLoader": 1, - "JsonLoader": 1, - "SpineLoader": 1, - "SpriteSheetLoader": 1, - "Graphics": 1, - "GraphicsData": 1, - "CanvasBuffer": 1, - "CanvasMaskManager": 1, - "CanvasTinter": 1, - "CanvasGraphics": 1, - "CanvasRenderer": 1, - "ComplexPrimitiveShader": 1, - "PixiFastShader": 1, - "PixiShader": 1, - "PrimitiveShader": 1, - "StripShader": 1, - "FilterTexture": 1, - "WebGLBlendModeManager": 1, - "WebGLFastSpriteBatch": 1, - "WebGLFilterManager": 1, - "WebGLGraphics": 1, - "WebGLGraphicsData": 1, - "WebGLMaskManager": 1, - "WebGLShaderManager": 1, - "WebGLSpriteBatch": 1, - "WebGLStencilManager": 1, - "WebGLRenderer": 1, - "BitmapText": 1, - "Text": 1, - "BaseTexture": 1, - "RenderTexture": 1, - "Texture": 1, - "autoDetectRenderer": 1, - "autoDetectRecommendedRenderer": 1, - "EventTarget": 1, - "Event": 1, - "PolyK": 1, - "AjaxRequest": 1, - "InteractionData": 1, - "InteractionManager": 1 - }, - "fors": {}, - "namespaces": {}, - "tag": "module", - "file": "src/pixi/InteractionManager.js", - "line": 5 - } - }, - "classes": { - "DisplayObject": { - "name": "DisplayObject", - "shortname": "DisplayObject", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/DisplayObject.js", - "line": 5, - "description": "The base class for all objects that are rendered on the screen.\nThis is an abstract class and should not be used on its own rather it should be extended.", - "is_constructor": 1 - }, - "DisplayObjectContainer": { - "name": "DisplayObjectContainer", - "shortname": "DisplayObjectContainer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 5, - "description": "A DisplayObjectContainer represents a collection of display objects.\nIt is the base class of all display objects that act as a container for other objects.", - "extends": "DisplayObject", - "is_constructor": 1 - }, - "MovieClip": { - "name": "MovieClip", - "shortname": "MovieClip", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/MovieClip.js", - "line": 5, - "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", - "extends": "Sprite", - "is_constructor": 1, - "params": [ - { - "name": "textures", - "description": "an array of {Texture} objects that make up the animation", - "type": "Array" - } - ] - }, - "Sprite": { - "name": "Sprite", - "shortname": "Sprite", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/Sprite.js", - "line": 5, - "description": "The Sprite object is the base for all textured objects that are rendered to the screen", - "extends": "DisplayObjectContainer", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "The texture for this sprite\n\nA sprite can be created directly from an image like this :\nvar sprite = new PIXI.Sprite.fromImage('assets/image.png');\nyourStage.addChild(sprite);\nthen obviously don't forget to add it to the stage you have already created", - "type": "Texture" - } - ] - }, - "SpriteBatch": { - "name": "SpriteBatch", - "shortname": "SpriteBatch", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/SpriteBatch.js", - "line": 5, - "description": "The SpriteBatch class is a really fast version of the DisplayObjectContainer \nbuilt solely for speed, so use when you need a lot of sprites or particles.\nAnd it's extremely easy to use : \n\n var container = new PIXI.SpriteBatch();\n\n stage.addChild(container);\n\n for(var i = 0; i < 100; i++)\n {\n var sprite = new PIXI.Sprite.fromImage(\"myImage.png\");\n container.addChild(sprite);\n }\nAnd here you have a hundred sprites that will be renderer at the speed of light", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "", - "type": "Texture" - } - ] - }, - "Stage": { - "name": "Stage", - "shortname": "Stage", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/Stage.js", - "line": 5, - "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", - "extends": "DisplayObjectContainer", - "is_constructor": 1, - "params": [ - { - "name": "backgroundColor", - "description": "the background color of the stage, you have to pass this in is in hex format\n like: 0xFFFFFF for white\n\nCreating a stage is a mandatory process when you use Pixi, which is as simple as this : \nvar stage = new PIXI.Stage(0xFFFFFF);\nwhere the parameter given is the background colour of the stage, in hex\nyou will use this stage instance to add your sprites to it and therefore to the renderer\nHere is how to add a sprite to the stage : \nstage.addChild(sprite);", - "type": "Number" - } - ] - }, - "Rope": { - "name": "Rope", - "shortname": "Rope", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/extras/Rope.js", - "line": 6, - "is_constructor": 1, - "extends": "Strip", - "params": [ - { - "name": "texture", - "description": "- The texture to use on the rope.", - "type": "Texture" - }, - { - "name": "points", - "description": "- An array of {PIXI.Point}.", - "type": "Array" - } - ] - }, - "Spine": { - "name": "Spine", - "shortname": "Spine", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/extras/Spine.js", - "line": 1357, - "description": "A class that enables the you to import and run your spine animations in pixi.\nSpine animation data needs to be loaded using the PIXI.AssetLoader or PIXI.SpineLoader before it can be used by this class\nSee example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source", - "extends": "DisplayObjectContainer", - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the spine anim file to be used", - "type": "String" - } - ] - }, - "Strip": { - "name": "Strip", - "shortname": "Strip", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/extras/Strip.js", - "line": 5, - "extends": "DisplayObjectContainer", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "The texture to use", - "type": "Texture" - }, - { - "name": "width", - "description": "the width", - "type": "Number" - }, - { - "name": "height", - "description": "the height", - "type": "Number" - } - ] - }, - "TilingSprite": { - "name": "TilingSprite", - "shortname": "TilingSprite", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/extras/TilingSprite.js", - "line": 5, - "description": "A tiling sprite is a fast way of rendering a tiling image", - "extends": "Sprite", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "the texture of the tiling sprite", - "type": "Texture" - }, - { - "name": "width", - "description": "the width of the tiling sprite", - "type": "Number" - }, - { - "name": "height", - "description": "the height of the tiling sprite", - "type": "Number" - } - ] - }, - "AbstractFilter": { - "name": "AbstractFilter", - "shortname": "AbstractFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/AbstractFilter.js", - "line": 5, - "description": "This is the base class for creating a PIXI filter. Currently only webGL supports filters.\nIf you want to make a custom filter this should be your base class.", - "is_constructor": 1, - "params": [ - { - "name": "fragmentSrc", - "description": "The fragment source in an array of strings.", - "type": "Array" - }, - { - "name": "uniforms", - "description": "An object containing the uniforms for this filter.", - "type": "Object" - } - ] - }, - "AlphaMaskFilter": { - "name": "AlphaMaskFilter", - "shortname": "AlphaMaskFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/AlphaMaskFilter.js", - "line": 5, - "description": "The AlphaMaskFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object.\nYou can use this filter to apply all manor of crazy warping effects\nCurrently the r property of the texture is used to offset the x and the g property of the texture is used to offset the y.", - "extends": "AbstractFilter", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "The texture used for the displacement map * must be power of 2 texture at the moment", - "type": "Texture" - } - ] - }, - "AsciiFilter": { - "name": "AsciiFilter", - "shortname": "AsciiFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/AsciiFilter.js", - "line": 6, - "description": "An ASCII filter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "BlurFilter": { - "name": "BlurFilter", - "shortname": "BlurFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/BlurFilter.js", - "line": 5, - "description": "The BlurFilter applies a Gaussian blur to an object.\nThe strength of the blur can be set for x- and y-axis separately (always relative to the stage).", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "BlurXFilter": { - "name": "BlurXFilter", - "shortname": "BlurXFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/BlurXFilter.js", - "line": 5, - "description": "The BlurXFilter applies a horizontal Gaussian blur to an object.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "BlurYFilter": { - "name": "BlurYFilter", - "shortname": "BlurYFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/BlurYFilter.js", - "line": 5, - "description": "The BlurYFilter applies a vertical Gaussian blur to an object.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "ColorMatrixFilter": { - "name": "ColorMatrixFilter", - "shortname": "ColorMatrixFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/ColorMatrixFilter.js", - "line": 5, - "description": "The ColorMatrixFilter class lets you apply a 4x4 matrix transformation on the RGBA\ncolor and alpha values of every pixel on your displayObject to produce a result\nwith a new set of RGBA color and alpha values. It's pretty powerful!", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "ColorStepFilter": { - "name": "ColorStepFilter", - "shortname": "ColorStepFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/ColorStepFilter.js", - "line": 5, - "description": "This lowers the color depth of your image by the given amount, producing an image with a smaller palette.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "ConvolutionFilter": { - "name": "ConvolutionFilter", - "shortname": "ConvolutionFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/ConvolutionFilter.js", - "line": 1, - "description": "The ConvolutionFilter class applies a matrix convolution filter effect. \nA convolution combines pixels in the input image with neighboring pixels to produce a new image. \nA wide variety of image effects can be achieved through convolutions, including blurring, edge detection, sharpening, embossing, and beveling.\nThe matrix should be specified as a 9 point Array. See http://docs.gimp.org/en/plug-in-convmatrix.html for more info.", - "extends": "AbstractFilter", - "is_constructor": 1, - "params": [ - { - "name": "matrix", - "description": "An array of values used for matrix transformation. Specified as a 9 point Array.", - "type": "Array" - }, - { - "name": "width", - "description": "Width of the object you are transforming", - "type": "Number" - }, - { - "name": "height", - "description": "Height of the object you are transforming", - "type": "Number" - } - ] - }, - "CrossHatchFilter": { - "name": "CrossHatchFilter", - "shortname": "CrossHatchFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/CrossHatchFilter.js", - "line": 5, - "description": "A Cross Hatch effect filter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "DisplacementFilter": { - "name": "DisplacementFilter", - "shortname": "DisplacementFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 5, - "description": "The DisplacementFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object.\nYou can use this filter to apply all manor of crazy warping effects\nCurrently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.", - "extends": "AbstractFilter", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "The texture used for the displacement map * must be power of 2 texture at the moment", - "type": "Texture" - } - ] - }, - "DotScreenFilter": { - "name": "DotScreenFilter", - "shortname": "DotScreenFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/DotScreenFilter.js", - "line": 6, - "description": "This filter applies a dotscreen effect making display objects appear to be made out of black and white halftone dots like an old printer.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "FilterBlock": { - "name": "FilterBlock", - "shortname": "FilterBlock", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/FilterBlock.js", - "line": 5, - "description": "A target and pass info object for filters.", - "is_constructor": 1 - }, - "GrayFilter": { - "name": "GrayFilter", - "shortname": "GrayFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/GrayFilter.js", - "line": 5, - "description": "This greyscales the palette of your Display Objects.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "InvertFilter": { - "name": "InvertFilter", - "shortname": "InvertFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/InvertFilter.js", - "line": 5, - "description": "This inverts your Display Objects colors.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "NoiseFilter": { - "name": "NoiseFilter", - "shortname": "NoiseFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/NoiseFilter.js", - "line": 6, - "description": "A Noise effect filter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "NormalMapFilter": { - "name": "NormalMapFilter", - "shortname": "NormalMapFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 6, - "description": "The NormalMapFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. \nYou can use this filter to apply all manor of crazy warping effects\nCurrently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.", - "extends": "AbstractFilter", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "The texture used for the displacement map * must be power of 2 texture at the moment", - "type": "Texture" - } - ] - }, - "PixelateFilter": { - "name": "PixelateFilter", - "shortname": "PixelateFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/PixelateFilter.js", - "line": 5, - "description": "This filter applies a pixelate effect making display objects appear 'blocky'.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "RGBSplitFilter": { - "name": "RGBSplitFilter", - "shortname": "RGBSplitFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/RGBSplitFilter.js", - "line": 5, - "description": "An RGB Split Filter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "SepiaFilter": { - "name": "SepiaFilter", - "shortname": "SepiaFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/SepiaFilter.js", - "line": 5, - "description": "This applies a sepia effect to your Display Objects.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "SmartBlurFilter": { - "name": "SmartBlurFilter", - "shortname": "SmartBlurFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/SmartBlurFilter.js", - "line": 5, - "description": "A Smart Blur Filter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "TiltShiftFilter": { - "name": "TiltShiftFilter", - "shortname": "TiltShiftFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 6, - "description": "A TiltShift Filter. Manages the pass of both a TiltShiftXFilter and TiltShiftYFilter.", - "is_constructor": 1 - }, - "TiltShiftXFilter": { - "name": "TiltShiftXFilter", - "shortname": "TiltShiftXFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 6, - "description": "A TiltShiftXFilter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "TiltShiftYFilter": { - "name": "TiltShiftYFilter", - "shortname": "TiltShiftYFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 6, - "description": "A TiltShiftYFilter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "TwistFilter": { - "name": "TwistFilter", - "shortname": "TwistFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/TwistFilter.js", - "line": 5, - "description": "This filter applies a twist effect making display objects appear twisted in the given direction.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "Circle": { - "name": "Circle", - "shortname": "Circle", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Circle.js", - "line": 5, - "description": "The Circle object can be used to specify a hit area for displayObjects", - "is_constructor": 1, - "params": [ - { - "name": "x", - "description": "The X coordinate of the center of this circle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the center of this circle", - "type": "Number" - }, - { - "name": "radius", - "description": "The radius of the circle", - "type": "Number" - } - ] - }, - "Ellipse": { - "name": "Ellipse", - "shortname": "Ellipse", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Ellipse.js", - "line": 5, - "description": "The Ellipse object can be used to specify a hit area for displayObjects", - "is_constructor": 1, - "params": [ - { - "name": "x", - "description": "The X coordinate of the center of the ellipse", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the center of the ellipse", - "type": "Number" - }, - { - "name": "width", - "description": "The half width of this ellipse", - "type": "Number" - }, - { - "name": "height", - "description": "The half height of this ellipse", - "type": "Number" - } - ] - }, - "Matrix": { - "name": "Matrix", - "shortname": "Matrix", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Matrix.js", - "line": 5, - "description": "The Matrix class is now an object, which makes it a lot faster, \nhere is a representation of it : \n| a | b | tx|\n| c | d | ty|\n| 0 | 0 | 1 |", - "is_constructor": 1 - }, - "Point": { - "name": "Point", - "shortname": "Point", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Point.js", - "line": 5, - "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", - "is_constructor": 1, - "params": [ - { - "name": "x", - "description": "position of the point on the x axis", - "type": "Number" - }, - { - "name": "y", - "description": "position of the point on the y axis", - "type": "Number" - } - ] - }, - "Polygon": { - "name": "Polygon", - "shortname": "Polygon", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Polygon.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "points", - "description": "This can be an array of Points that form the polygon,\n a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be\n all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the\n arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are\n Numbers.", - "type": "Array|Array|Point...|Number...", - "multiple": true - } - ] - }, - "Rectangle": { - "name": "Rectangle", - "shortname": "Rectangle", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Rectangle.js", - "line": 5, - "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", - "is_constructor": 1, - "params": [ - { - "name": "x", - "description": "The X coordinate of the upper-left corner of the rectangle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the upper-left corner of the rectangle", - "type": "Number" - }, - { - "name": "width", - "description": "The overall width of this rectangle", - "type": "Number" - }, - { - "name": "height", - "description": "The overall height of this rectangle", - "type": "Number" - } - ] - }, - "Rounded Rectangle": { - "name": "Rounded Rectangle", - "shortname": "Rounded Rectangle", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 5, - "description": "the Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height.", - "is_constructor": 1, - "params": [ - { - "name": "x", - "description": "The X coordinate of the upper-left corner of the rounded rectangle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the upper-left corner of the rounded rectangle", - "type": "Number" - }, - { - "name": "width", - "description": "The overall width of this rounded rectangle", - "type": "Number" - }, - { - "name": "height", - "description": "The overall height of this rounded rectangle", - "type": "Number" - }, - { - "name": "radius", - "description": "The overall radius of this corners of this rounded rectangle", - "type": "Number" - } - ] - }, - "AssetLoader": { - "name": "AssetLoader", - "shortname": "AssetLoader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/loaders/AssetLoader.js", - "line": 5, - "description": "A Class that loads a bunch of images / sprite sheet / bitmap font files. Once the\nassets have been loaded they are added to the PIXI Texture cache and can be accessed\neasily 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, - "uses": [ - "EventTarget" - ], - "params": [ - { - "name": "assetURLs", - "description": "An array of image/sprite sheet urls that you would like loaded\n supported. Supported image formats include 'jpeg', 'jpg', 'png', 'gif'. Supported\n sprite sheet data formats only include 'JSON' at this time. Supported bitmap font\n data formats include 'xml' and 'fnt'.", - "type": "Array" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "AtlasLoader": { - "name": "AtlasLoader", - "shortname": "AtlasLoader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 5, - "description": "The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event.\n\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format.\n\nIt is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to 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.fromFrameId()", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the JSON file", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "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", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the sprite sheet JSON file", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "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.fromFrame() and PIXI.Sprite.fromFrame()\nWhen loaded this class will dispatch a 'loaded' event", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the image", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "JsonLoader": { - "name": "JsonLoader", - "shortname": "JsonLoader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/loaders/JsonLoader.js", - "line": 5, - "description": "The json file loader is used to load in JSON data and parse it\nWhen loaded this class will dispatch a 'loaded' event\nIf loading fails this class will dispatch an 'error' event", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the JSON file", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "SpineLoader": { - "name": "SpineLoader", - "shortname": "SpineLoader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/loaders/SpineLoader.js", - "line": 10, - "description": "The Spine loader is used to load in JSON spine data\nTo generate the data you need to use http://esotericsoftware.com/ and export in the \"JSON\" format\nDue to a clash of names You will need to change the extension of the spine file from *.json to *.anim for it to load\nSee example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source\nYou will need to generate a sprite sheet to accompany the spine data\nWhen loaded this class will dispatch a \"loaded\" event", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the JSON file", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "SpriteSheetLoader": { - "name": "SpriteSheetLoader", - "shortname": "SpriteSheetLoader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "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 in 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 a 'texture atlas') as it means sprites 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.fromFrameId()\nThis loader will load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the sprite sheet JSON file", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "Graphics": { - "name": "Graphics", - "shortname": "Graphics", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/primitives/Graphics.js", - "line": 5, - "description": "The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and color and fill them.", - "extends": "DisplayObjectContainer", - "is_constructor": 1 - }, - "GraphicsData": { - "name": "GraphicsData", - "shortname": "GraphicsData", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/primitives/Graphics.js", - "line": 1093, - "description": "A GraphicsData object.", - "is_constructor": 1 - }, - "CanvasBuffer": { - "name": "CanvasBuffer", - "shortname": "CanvasBuffer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 5, - "description": "Creates a Canvas element of the given size.", - "is_constructor": 1, - "params": [ - { - "name": "width", - "description": "the width for the newly created canvas", - "type": "Number" - }, - { - "name": "height", - "description": "the height for the newly created canvas", - "type": "Number" - } - ] - }, - "CanvasMaskManager": { - "name": "CanvasMaskManager", - "shortname": "CanvasMaskManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/canvas/utils/CanvasMaskManager.js", - "line": 5, - "description": "A set of functions used to handle masking.", - "is_constructor": 1 - }, - "CanvasTinter": { - "name": "CanvasTinter", - "shortname": "CanvasTinter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 5, - "is_constructor": 1, - "static": 1 - }, - "CanvasGraphics": { - "name": "CanvasGraphics", - "shortname": "CanvasGraphics", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/canvas/CanvasGraphics.js", - "line": 6, - "description": "A set of functions used by the canvas renderer to draw the primitive graphics data.", - "static": 1 - }, - "CanvasRenderer": { - "name": "CanvasRenderer", - "shortname": "CanvasRenderer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 5, - "description": "The CanvasRenderer draws the Stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDon't forget to add the CanvasRenderer.view to your DOM or you will not see anything :)", - "is_constructor": 1, - "params": [ - { - "name": "width", - "description": "the width of the canvas view", - "type": "Number", - "optional": true, - "optdefault": "800" - }, - { - "name": "height", - "description": "the height of the canvas view", - "type": "Number", - "optional": true, - "optdefault": "600" - }, - { - "name": "options", - "description": "The optional renderer parameters", - "type": "Object", - "optional": true, - "props": [ - { - "name": "view", - "description": "the canvas to use as a view, optional", - "type": "HTMLCanvasElement", - "optional": true - }, - { - "name": "transparent", - "description": "If the render view is transparent, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "autoResize", - "description": "If the render view is automatically resized, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "resolution", - "description": "the resolution of the renderer retina would be 2", - "type": "Number", - "optional": true, - "optdefault": "1" - }, - { - "name": "clearBeforeRender", - "description": "This sets if the CanvasRenderer will clear the canvas or not before the new render pass.", - "type": "Boolean", - "optional": true, - "optdefault": "true" - } - ] - } - ] - }, - "ComplexPrimitiveShader": { - "name": "ComplexPrimitiveShader", - "shortname": "ComplexPrimitiveShader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "PixiFastShader": { - "name": "PixiFastShader", - "shortname": "PixiFastShader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "PixiShader": { - "name": "PixiShader", - "shortname": "PixiShader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 6, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "PrimitiveShader": { - "name": "PrimitiveShader", - "shortname": "PrimitiveShader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "StripShader": { - "name": "StripShader", - "shortname": "StripShader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "FilterTexture": { - "name": "FilterTexture", - "shortname": "FilterTexture", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - }, - { - "name": "width", - "description": "the horizontal range of the filter", - "type": "Number" - }, - { - "name": "height", - "description": "the vertical range of the filter", - "type": "Number" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ] - }, - "WebGLBlendModeManager": { - "name": "WebGLBlendModeManager", - "shortname": "WebGLBlendModeManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "WebGLFastSpriteBatch": { - "name": "WebGLFastSpriteBatch", - "shortname": "WebGLFastSpriteBatch", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 11, - "is_constructor": 1 - }, - "WebGLFilterManager": { - "name": "WebGLFilterManager", - "shortname": "WebGLFilterManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 5, - "is_constructor": 1 - }, - "WebGLGraphics": { - "name": "WebGLGraphics", - "shortname": "WebGLGraphics", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 5, - "description": "A set of functions used by the webGL renderer to draw the primitive graphics data", - "access": "private", - "tagname": "", - "static": 1 - }, - "WebGLGraphicsData": { - "name": "WebGLGraphicsData", - "shortname": "WebGLGraphicsData", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 829, - "access": "private", - "tagname": "", - "static": 1 - }, - "WebGLMaskManager": { - "name": "WebGLMaskManager", - "shortname": "WebGLMaskManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 5, - "is_constructor": 1, - "access": "private", - "tagname": "" - }, - "WebGLShaderManager": { - "name": "WebGLShaderManager", - "shortname": "WebGLShaderManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 5, - "is_constructor": 1, - "access": "private", - "tagname": "" - }, - "WebGLSpriteBatch": { - "name": "WebGLSpriteBatch", - "shortname": "WebGLSpriteBatch", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 11, - "access": "private", - "tagname": "", - "is_constructor": 1 - }, - "WebGLStencilManager": { - "name": "WebGLStencilManager", - "shortname": "WebGLStencilManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 5, - "is_constructor": 1, - "access": "private", - "tagname": "" - }, - "WebGLRenderer": { - "name": "WebGLRenderer", - "shortname": "WebGLRenderer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 8, - "description": "The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer\nshould be used for browsers that support webGL. This Render works by automatically managing webGLBatchs.\nSo no need for Sprite Batches or Sprite Clouds.\nDon't forget to add the view to your DOM or you will not see anything :)", - "is_constructor": 1, - "params": [ - { - "name": "width", - "description": "the width of the canvas view", - "type": "Number", - "optional": true, - "optdefault": "0" - }, - { - "name": "height", - "description": "the height of the canvas view", - "type": "Number", - "optional": true, - "optdefault": "0" - }, - { - "name": "options", - "description": "The optional renderer parameters", - "type": "Object", - "optional": true, - "props": [ - { - "name": "view", - "description": "the canvas to use as a view, optional", - "type": "HTMLCanvasElement", - "optional": true - }, - { - "name": "transparent", - "description": "If the render view is transparent, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "autoResize", - "description": "If the render view is automatically resized, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "antialias", - "description": "sets antialias (only applicable in chrome at the moment)", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "preserveDrawingBuffer", - "description": "enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "resolution", - "description": "the resolution of the renderer retina would be 2", - "type": "Number", - "optional": true, - "optdefault": "1" - } - ] - } - ] - }, - "BitmapText": { - "name": "BitmapText", - "shortname": "BitmapText", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/text/BitmapText.js", - "line": 5, - "description": "A BitmapText object will create a line or multiple lines of text using bitmap font. To split a line you can use '\\n', '\\r' or '\\r\\n' in your string.\nYou can generate the fnt files using\nhttp://www.angelcode.com/products/bmfont/ for windows or\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", - "props": [ - { - "name": "font", - "description": "The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)", - "type": "String" - }, - { - "name": "align", - "description": "Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text", - "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": 6, - "description": "A Text Object will create a line or multiple lines of text. To split a line you can use '\\n' in your text string,\nor add a wordWrap property set to true and and wordWrapWidth property with a value in the style object.", - "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 20px 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 e.g 'red', '#00FF00'", - "type": "String|Number", - "optional": true, - "optdefault": "'black'" - }, - { - "name": "align", - "description": "Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text", - "type": "String", - "optional": true, - "optdefault": "'left'" - }, - { - "name": "stroke", - "description": "A canvas fillstyle that will be used on the text stroke e.g 'blue', '#FCFF00'", - "type": "String|Number", - "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": "wordWrap", - "description": "Indicates if word wrap should be used", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "wordWrapWidth", - "description": "The width at which text will wrap, it needs wordWrap to be set to true", - "type": "Number", - "optional": true, - "optdefault": "100" - }, - { - "name": "dropShadow", - "description": "Set a drop shadow for the text", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "dropShadowColor", - "description": "A fill style to be used on the dropshadow e.g 'red', '#00FF00'", - "type": "String", - "optional": true, - "optdefault": "'#000000'" - }, - { - "name": "dropShadowAngle", - "description": "Set a angle of the drop shadow", - "type": "Number", - "optional": true, - "optdefault": "Math.PI/4" - }, - { - "name": "dropShadowDistance", - "description": "Set a distance of the drop shadow", - "type": "Number", - "optional": true, - "optdefault": "5" - } - ] - } - ] - }, - "BaseTexture": { - "name": "BaseTexture", - "shortname": "BaseTexture", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/textures/BaseTexture.js", - "line": 9, - "description": "A texture stores the information that represents an image. All textures have a base texture.", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "source", - "description": "the source object (image or canvas)", - "type": "String" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ] - }, - "RenderTexture": { - "name": "RenderTexture", - "shortname": "RenderTexture", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/textures/RenderTexture.js", - "line": 5, - "description": "A RenderTexture is a special texture that allows any Pixi display object to be rendered to it.\n\n__Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead.\n\nA RenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example:\n\n var renderTexture = new PIXI.RenderTexture(800, 600);\n var sprite = PIXI.Sprite.fromImage(\"spinObj_01.png\");\n sprite.position.x = 800/2;\n sprite.position.y = 600/2;\n sprite.anchor.x = 0.5;\n sprite.anchor.y = 0.5;\n renderTexture.render(sprite);\n\nThe Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual position a DisplayObjectContainer should be used:\n\n var doc = new PIXI.DisplayObjectContainer();\n doc.addChild(sprite);\n renderTexture.render(doc); // Renders to center of renderTexture", - "extends": "Texture", - "is_constructor": 1, - "params": [ - { - "name": "width", - "description": "The width of the render texture", - "type": "Number" - }, - { - "name": "height", - "description": "The height of the render texture", - "type": "Number" - }, - { - "name": "renderer", - "description": "The renderer used for this RenderTexture", - "type": "CanvasRenderer|WebGLRenderer" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - }, - { - "name": "resolution", - "description": "The resolution of the texture being generated", - "type": "Number" - } - ] - }, - "Texture": { - "name": "Texture", - "shortname": "Texture", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/textures/Texture.js", - "line": 10, - "description": "A texture stores the information that represents an image or part of an image. It cannot be added\nto the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used.", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "baseTexture", - "description": "The base texture source to create the texture from", - "type": "BaseTexture" - }, - { - "name": "frame", - "description": "The rectangle frame of the texture to show", - "type": "Rectangle" - }, - { - "name": "crop", - "description": "The area of original texture", - "type": "Rectangle", - "optional": true - }, - { - "name": "trim", - "description": "Trimmed texture rectangle", - "type": "Rectangle", - "optional": true - } - ] - }, - "autoDetectRenderer": { - "name": "autoDetectRenderer", - "shortname": "autoDetectRenderer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/utils/Detector.js", - "line": 5, - "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot faster. If webGL is not supported by\nthe browser then this function will return a canvas renderer", - "static": 1, - "params": [ - { - "name": "width=800", - "description": "the width of the renderers view", - "type": "Number" - }, - { - "name": "height=600", - "description": "the height of the renderers view", - "type": "Number" - }, - { - "name": "options", - "description": "The optional renderer parameters", - "type": "Object", - "optional": true, - "props": [ - { - "name": "view", - "description": "the canvas to use as a view, optional", - "type": "HTMLCanvasElement", - "optional": true - }, - { - "name": "transparent", - "description": "If the render view is transparent, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "antialias", - "description": "sets antialias (only applicable in chrome at the moment)", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "preserveDrawingBuffer", - "description": "enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "resolution", - "description": "the resolution of the renderer retina would be 2", - "type": "Number", - "optional": true, - "optdefault": "1" - } - ] - } - ] - }, - "autoDetectRecommendedRenderer": { - "name": "autoDetectRecommendedRenderer", - "shortname": "autoDetectRecommendedRenderer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/utils/Detector.js", - "line": 44, - "description": "This helper function will automatically detect which renderer you should be using.\nThis function is very similar to the autoDetectRenderer function except that is will return a canvas renderer for android.\nEven thought both android chrome supports webGL the canvas implementation perform better at the time of writing. \nThis function will likely change and update as webGL performance improves on these devices.", - "static": 1, - "params": [ - { - "name": "width=800", - "description": "the width of the renderers view", - "type": "Number" - }, - { - "name": "height=600", - "description": "the height of the renderers view", - "type": "Number" - }, - { - "name": "options", - "description": "The optional renderer parameters", - "type": "Object", - "optional": true, - "props": [ - { - "name": "view", - "description": "the canvas to use as a view, optional", - "type": "HTMLCanvasElement", - "optional": true - }, - { - "name": "transparent", - "description": "If the render view is transparent, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "antialias", - "description": "sets antialias (only applicable in chrome at the moment)", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "preserveDrawingBuffer", - "description": "enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "resolution", - "description": "the resolution of the renderer retina would be 2", - "type": "Number", - "optional": true, - "optdefault": "1" - } - ] - } - ] - }, - "EventTarget": { - "name": "EventTarget", - "shortname": "EventTarget", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [ - "AssetLoader", - "AtlasLoader", - "BitmapFontLoader", - "ImageLoader", - "JsonLoader", - "SpineLoader", - "SpriteSheetLoader", - "BaseTexture", - "Texture" - ], - "module": "PIXI", - "file": "src/pixi/utils/EventTarget.js", - "line": 11, - "description": "Mixins event emitter functionality to a class", - "example": [ - "\n function MyEmitter() {}\n\n PIXI.EventTarget.mixin(MyEmitter.prototype);\n\n var em = new MyEmitter();\n em.emit('eventName', 'some data', 'some more data', {}, null, ...);" - ] - }, - "Event": { - "name": "Event", - "shortname": "Event", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/utils/EventTarget.js", - "line": 192, - "description": "Creates an homogenous object for tracking events so users can know what to expect.", - "extends": "Object", - "is_constructor": 1, - "params": [ - { - "name": "target", - "description": "The target object that the event is called on", - "type": "Object" - }, - { - "name": "name", - "description": "The string name of the event that was triggered", - "type": "String" - }, - { - "name": "data", - "description": "Arbitrary event data to pass along", - "type": "Object" - } - ] - }, - "PolyK": { - "name": "PolyK", - "shortname": "PolyK", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/utils/Polyk.js", - "line": 34, - "description": "Based on the Polyk library http://polyk.ivank.net released under MIT licence.\nThis is an amazing lib!\nSlightly modified by Mat Groves (matgroves.com);" - }, - "AjaxRequest": { - "name": "AjaxRequest", - "shortname": "AjaxRequest", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/utils/Utils.js", - "line": 108, - "description": "A wrapper for ajax requests to be handled cross browser", - "is_constructor": 1 - }, - "InteractionData": { - "name": "InteractionData", - "shortname": "InteractionData", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/InteractionData.js", - "line": 5, - "description": "Holds all information related to an Interaction event", - "is_constructor": 1 - }, - "InteractionManager": { - "name": "InteractionManager", - "shortname": "InteractionManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/InteractionManager.js", - "line": 5, - "description": "The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive\nif its interactive parameter is set to true\nThis manager also supports multitouch.", - "is_constructor": 1, - "params": [ - { - "name": "stage", - "description": "The stage to handle interactions", - "type": "Stage" - } - ] - } - }, - "classitems": [ - { - "file": "src/pixi/display/DisplayObject.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 14, - "description": "The coordinate of the object relative to the local coordinates of the parent.", - "itemtype": "property", - "name": "position", - "type": "Point", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 22, - "description": "The scale factor of the object.", - "itemtype": "property", - "name": "scale", - "type": "Point", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 30, - "description": "The pivot point of the displayObject that it rotates around", - "itemtype": "property", - "name": "pivot", - "type": "Point", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 38, - "description": "The rotation of the object in radians.", - "itemtype": "property", - "name": "rotation", - "type": "Number", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 46, - "description": "The opacity of the object.", - "itemtype": "property", - "name": "alpha", - "type": "Number", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 54, - "description": "The visibility of the object.", - "itemtype": "property", - "name": "visible", - "type": "Boolean", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 62, - "description": "This is the defined area that will pick up mouse / touch events. It is null by default.\nSetting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)", - "itemtype": "property", - "name": "hitArea", - "type": "Rectangle|Circle|Ellipse|Polygon", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 71, - "description": "This is used to indicate if the displayObject should display a mouse hand cursor on rollover", - "itemtype": "property", - "name": "buttonMode", - "type": "Boolean", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 79, - "description": "Can this object be rendered", - "itemtype": "property", - "name": "renderable", - "type": "Boolean", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 87, - "description": "[read-only] The display object container that contains this display object.", - "itemtype": "property", - "name": "parent", - "type": "DisplayObjectContainer", - "readonly": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 96, - "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", - "itemtype": "property", - "name": "stage", - "type": "Stage", - "readonly": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 105, - "description": "[read-only] The multiplied alpha of the displayObject", - "itemtype": "property", - "name": "worldAlpha", - "type": "Number", - "readonly": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 114, - "description": "[read-only] Whether or not the object is interactive, do not toggle directly! use the `interactive` property", - "itemtype": "property", - "name": "_interactive", - "type": "Boolean", - "readonly": "", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 124, - "description": "This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true", - "itemtype": "property", - "name": "defaultCursor", - "type": "String", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 133, - "description": "[read-only] Current transform of the object based on world (parent) factors", - "itemtype": "property", - "name": "worldTransform", - "type": "Matrix", - "readonly": "", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 143, - "description": "cached sin rotation and cos rotation", - "itemtype": "property", - "name": "_sr", - "type": "Number", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 152, - "description": "cached sin rotation and cos rotation", - "itemtype": "property", - "name": "_cr", - "type": "Number", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 161, - "description": "The area the filter is applied to like the hitArea this is used as more of an optimisation\nrather than figuring out the dimensions of the displayObject each frame you can set this rectangle", - "itemtype": "property", - "name": "filterArea", - "type": "Rectangle", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 170, - "description": "The original, cached bounds of the object", - "itemtype": "property", - "name": "_bounds", - "type": "Rectangle", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 179, - "description": "The most up-to-date bounds of the object", - "itemtype": "property", - "name": "_currentBounds", - "type": "Rectangle", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 188, - "description": "The original, cached mask of the object", - "itemtype": "property", - "name": "_currentBounds", - "type": "Rectangle", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 197, - "description": "Cached internal flag.", - "itemtype": "property", - "name": "_cacheAsBitmap", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 206, - "description": "Cached internal flag.", - "itemtype": "property", - "name": "_cacheIsDirty", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 220, - "description": "A callback that is used when the users mouse rolls over the displayObject", - "itemtype": "method", - "name": "mouseover", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 226, - "description": "A callback that is used when the users mouse leaves the displayObject", - "itemtype": "method", - "name": "mouseout", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 233, - "description": "A callback that is used when the users clicks on the displayObject with their mouse's left button", - "itemtype": "method", - "name": "click", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 239, - "description": "A callback that is used when the user clicks the mouse's left button down over the sprite", - "itemtype": "method", - "name": "mousedown", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 245, - "description": "A callback that is used when the user releases the mouse's left button that was over the displayObject\nfor this callback to be fired, the mouse's left button must have been pressed down over the displayObject", - "itemtype": "method", - "name": "mouseup", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 252, - "description": "A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject\nfor this callback to be fired, the mouse's left button must have been pressed down over the displayObject", - "itemtype": "method", - "name": "mouseupoutside", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 260, - "description": "A callback that is used when the users clicks on the displayObject with their mouse's right button", - "itemtype": "method", - "name": "rightclick", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 266, - "description": "A callback that is used when the user clicks the mouse's right button down over the sprite", - "itemtype": "method", - "name": "rightdown", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 272, - "description": "A callback that is used when the user releases the mouse's right button that was over the displayObject\nfor this callback to be fired the mouse's right button must have been pressed down over the displayObject", - "itemtype": "method", - "name": "rightup", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 279, - "description": "A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject\nfor this callback to be fired, the mouse's right button must have been pressed down over the displayObject", - "itemtype": "method", - "name": "rightupoutside", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 290, - "description": "A callback that is used when the users taps on the sprite with their finger\nbasically a touch version of click", - "itemtype": "method", - "name": "tap", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 297, - "description": "A callback that is used when the user touches over the displayObject", - "itemtype": "method", - "name": "touchstart", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 303, - "description": "A callback that is used when the user releases a touch over the displayObject", - "itemtype": "method", - "name": "touchend", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 309, - "description": "A callback that is used when the user releases the touch that was over the displayObject\nfor this callback to be fired, The touch must have started over the sprite", - "itemtype": "method", - "name": "touchendoutside", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 320, - "description": "Indicates if the sprite will have touch and mouse interactivity. It is false by default", - "itemtype": "property", - "name": "interactive", - "type": "Boolean", - "default": "false", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 340, - "description": "[read-only] Indicates if the sprite is globally visible.", - "itemtype": "property", - "name": "worldVisible", - "type": "Boolean", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 361, - "description": "Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.\nIn PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping.\nTo remove a mask, set this property to null.", - "itemtype": "property", - "name": "mask", - "type": "Graphics", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 381, - "description": "Sets the filters for the displayObject.\n* IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer.\nTo remove filters simply set this property to 'null'", - "itemtype": "property", - "name": "filters", - "type": "Array An array of filters", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 417, - "description": "Set if this display object is cached as a bitmap.\nThis basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects.\nTo remove simply set this property to 'null'", - "itemtype": "property", - "name": "cacheAsBitmap", - "type": "Boolean", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 523, - "description": "Retrieves the bounds of the displayObject as a rectangle object", - "itemtype": "method", - "name": "getBounds", - "params": [ - { - "name": "matrix", - "description": "", - "type": "Matrix" - } - ], - "return": { - "description": "the rectangular bounding area", - "type": "Rectangle" - }, - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 536, - "description": "Retrieves the local bounds of the displayObject as a rectangle object", - "itemtype": "method", - "name": "getLocalBounds", - "return": { - "description": "the rectangular bounding area", - "type": "Rectangle" - }, - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 547, - "description": "Sets the object's stage reference, the stage this object is connected to", - "itemtype": "method", - "name": "setStageReference", - "params": [ - { - "name": "stage", - "description": "the stage that the object will have as its current stage reference", - "type": "Stage" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 559, - "description": "Useful function that returns a texture of the displayObject object that can then be used to create sprites\nThis can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.", - "itemtype": "method", - "name": "generateTexture", - "params": [ - { - "name": "resolution", - "description": "The resolution of the texture being generated", - "type": "Number" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - }, - { - "name": "renderer", - "description": "The renderer used to generate the texture.", - "type": "CanvasRenderer|WebGLRenderer" - } - ], - "return": { - "description": "a texture of the graphics object", - "type": "Texture" - }, - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 583, - "description": "Generates and updates the cached sprite for this object.", - "itemtype": "method", - "name": "updateCache", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 593, - "description": "Calculates the global position of the display object", - "itemtype": "method", - "name": "toGlobal", - "params": [ - { - "name": "position", - "description": "The world origin to calculate from", - "type": "Point" - } - ], - "return": { - "description": "A point object representing the position of this object", - "type": "Point" - }, - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 606, - "description": "Calculates the local position of the display object relative to another point", - "itemtype": "method", - "name": "toLocal", - "params": [ - { - "name": "position", - "description": "The world origin to calculate from", - "type": "Point" - }, - { - "name": "from", - "description": "The DisplayObject to calculate the global position from", - "type": "DisplayObject", - "optional": true - } - ], - "return": { - "description": "A point object representing the position of this object", - "type": "Point" - }, - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 626, - "description": "Internal method.", - "itemtype": "method", - "name": "_renderCachedSprite", - "params": [ - { - "name": "renderSession", - "description": "The render session", - "type": "Object" - } - ], - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 647, - "description": "Internal method.", - "itemtype": "method", - "name": "_generateCachedSprite", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 689, - "description": "Destroys the cached sprite.", - "itemtype": "method", - "name": "_destroyCachedSprite", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 705, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 719, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 736, - "description": "The position of the displayObject on the x axis relative to the local coordinates of the parent.", - "itemtype": "property", - "name": "x", - "type": "Number", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 751, - "description": "The position of the displayObject on the y axis relative to the local coordinates of the parent.", - "itemtype": "property", - "name": "y", - "type": "Number", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 17, - "description": "[read-only] The array of children of this container.", - "itemtype": "property", - "name": "children", - "type": "Array", - "readonly": "", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 35, - "description": "The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 63, - "description": "The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 90, - "description": "Adds a child to the container.", - "itemtype": "method", - "name": "addChild", - "params": [ - { - "name": "child", - "description": "The DisplayObject to add to the container", - "type": "DisplayObject" - } - ], - "return": { - "description": "The child that was added.", - "type": "DisplayObject" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 102, - "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", - "itemtype": "method", - "name": "addChildAt", - "params": [ - { - "name": "child", - "description": "The child to add", - "type": "DisplayObject" - }, - { - "name": "index", - "description": "The index to place the child in", - "type": "Number" - } - ], - "return": { - "description": "The child that was added.", - "type": "DisplayObject" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 133, - "description": "Swaps the position of 2 Display Objects within this container.", - "itemtype": "method", - "name": "swapChildren", - "params": [ - { - "name": "child", - "description": "", - "type": "DisplayObject" - }, - { - "name": "child2", - "description": "", - "type": "DisplayObject" - } - ], - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 158, - "description": "Returns the index position of a child DisplayObject instance", - "itemtype": "method", - "name": "getChildIndex", - "params": [ - { - "name": "child", - "description": "The DisplayObject instance to identify", - "type": "DisplayObject" - } - ], - "return": { - "description": "The index position of the child display object to identify", - "type": "Number" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 175, - "description": "Changes the position of an existing child in the display object container", - "itemtype": "method", - "name": "setChildIndex", - "params": [ - { - "name": "child", - "description": "The child DisplayObject instance for which you want to change the index number", - "type": "DisplayObject" - }, - { - "name": "index", - "description": "The resulting index number for the child display object", - "type": "Number" - } - ], - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 193, - "description": "Returns the child at the specified index", - "itemtype": "method", - "name": "getChildAt", - "params": [ - { - "name": "index", - "description": "The index to get the child from", - "type": "Number" - } - ], - "return": { - "description": "The child at the given index, if any.", - "type": "DisplayObject" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 210, - "description": "Removes a child from the container.", - "itemtype": "method", - "name": "removeChild", - "params": [ - { - "name": "child", - "description": "The DisplayObject to remove", - "type": "DisplayObject" - } - ], - "return": { - "description": "The child that was removed.", - "type": "DisplayObject" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 225, - "description": "Removes a child from the specified index position.", - "itemtype": "method", - "name": "removeChildAt", - "params": [ - { - "name": "index", - "description": "The index to get the child from", - "type": "Number" - } - ], - "return": { - "description": "The child that was removed.", - "type": "DisplayObject" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 243, - "description": "Removes all children from this container that are within the begin and end indexes.", - "itemtype": "method", - "name": "removeChildren", - "params": [ - { - "name": "beginIndex", - "description": "The beginning position. Default value is 0.", - "type": "Number" - }, - { - "name": "endIndex", - "description": "The ending position. Default value is size of the container.", - "type": "Number" - } - ], - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 302, - "description": "Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.", - "itemtype": "method", - "name": "getBounds", - "return": { - "description": "The rectangular bounding area", - "type": "Rectangle" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 362, - "description": "Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.", - "itemtype": "method", - "name": "getLocalBounds", - "return": { - "description": "The rectangular bounding area", - "type": "Rectangle" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 386, - "description": "Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.", - "itemtype": "method", - "name": "setStageReference", - "params": [ - { - "name": "stage", - "description": "the stage that the container will have as its current stage reference", - "type": "Stage" - } - ], - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 404, - "description": "Removes the current stage reference from the container and all of its children.", - "itemtype": "method", - "name": "removeStageReference", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 423, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 482, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 17, - "description": "The array of textures that make up the animation", - "itemtype": "property", - "name": "textures", - "type": "Array", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 25, - "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", - "itemtype": "property", - "name": "animationSpeed", - "type": "Number", - "default": "1", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 34, - "description": "Whether or not the movie clip repeats after playing.", - "itemtype": "property", - "name": "loop", - "type": "Boolean", - "default": "true", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 43, - "description": "Function to call when a MovieClip finishes playing", - "itemtype": "property", - "name": "onComplete", - "type": "Function", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 51, - "description": "[read-only] The MovieClips current frame index (this may not have to be a whole number)", - "itemtype": "property", - "name": "currentFrame", - "type": "Number", - "default": "0", - "readonly": "", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 61, - "description": "[read-only] Indicates if the MovieClip is currently playing", - "itemtype": "property", - "name": "playing", - "type": "Boolean", - "readonly": "", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 75, - "description": "[read-only] totalFrames is the total number of frames in the MovieClip. This is the same as number of textures\nassigned to the MovieClip.", - "itemtype": "property", - "name": "totalFrames", - "type": "Number", - "default": "0", - "readonly": "", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 91, - "description": "Stops the MovieClip", - "itemtype": "method", - "name": "stop", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 101, - "description": "Plays the MovieClip", - "itemtype": "method", - "name": "play", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 111, - "description": "Stops the MovieClip and goes to a specific frame", - "itemtype": "method", - "name": "gotoAndStop", - "params": [ - { - "name": "frameNumber", - "description": "frame index to stop at", - "type": "Number" - } - ], - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 125, - "description": "Goes to a specific frame and begins playing the MovieClip", - "itemtype": "method", - "name": "gotoAndPlay", - "params": [ - { - "name": "frameNumber", - "description": "frame index to start at", - "type": "Number" - } - ], - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 169, - "description": "A short hand way of creating a movieclip from an array of frame ids", - "static": 1, - "itemtype": "method", - "name": "fromFrames", - "params": [ - { - "name": "frames", - "description": "the array of frames ids the movieclip will use as its texture frames", - "type": "Array" - } - ], - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 188, - "description": "A short hand way of creating a movieclip from an array of image ids", - "static": 1, - "itemtype": "method", - "name": "fromImages", - "params": [ - { - "name": "frames", - "description": "the array of image ids the movieclip will use as its texture frames", - "type": "Array" - } - ], - "class": "MovieClip" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 22, - "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the texture's origin is the top left\nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right corner", - "itemtype": "property", - "name": "anchor", - "type": "Point", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 33, - "description": "The texture that the sprite is using", - "itemtype": "property", - "name": "texture", - "type": "Texture", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 41, - "description": "The width of the sprite (this is initially set by the texture)", - "itemtype": "property", - "name": "_width", - "type": "Number", - "access": "private", - "tagname": "", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 50, - "description": "The height of the sprite (this is initially set by the texture)", - "itemtype": "property", - "name": "_height", - "type": "Number", - "access": "private", - "tagname": "", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 59, - "description": "The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.", - "itemtype": "property", - "name": "tint", - "type": "Number", - "default": "0xFFFFFF", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 68, - "description": "The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.", - "itemtype": "property", - "name": "blendMode", - "type": "Number", - "default": "PIXI.blendModes.NORMAL;", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 77, - "description": "The shader that will be used to render the texture to the stage. Set to null to remove a current shader.", - "itemtype": "property", - "name": "shader", - "type": "PIXI.AbstractFilter", - "default": "null", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 103, - "description": "The width of the sprite, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 119, - "description": "The height of the sprite, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 135, - "description": "Sets the texture of the sprite", - "itemtype": "method", - "name": "setTexture", - "params": [ - { - "name": "texture", - "description": "The PIXI texture that is displayed by the sprite", - "type": "Texture" - } - ], - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 147, - "description": "When the texture is updated, this event will fire to update the scale and frame", - "itemtype": "method", - "name": "onTextureUpdate", - "params": [ - { - "name": "event", - "description": "" - } - ], - "access": "private", - "tagname": "", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 163, - "description": "Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account.", - "itemtype": "method", - "name": "getBounds", - "params": [ - { - "name": "matrix", - "description": "the transformation matrix of the sprite", - "type": "Matrix" - } - ], - "return": { - "description": "the framing rectangle", - "type": "Rectangle" - }, - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 242, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 305, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 418, - "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId\n The frame ids are created when a Texture packer file has been loaded", - "itemtype": "method", - "name": "fromFrame", - "static": 1, - "params": [ - { - "name": "frameId", - "description": "The frame Id of the texture in the cache", - "type": "String" - } - ], - "return": { - "description": "A new Sprite using a texture from the texture cache matching the frameId", - "type": "Sprite" - }, - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 435, - "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", - "itemtype": "method", - "name": "fromImage", - "static": 1, - "params": [ - { - "name": "imageId", - "description": "The image url of the texture", - "type": "String" - } - ], - "return": { - "description": "A new Sprite using a texture from the texture cache matching the image id", - "type": "Sprite" - }, - "class": "Sprite" - }, - { - "file": "src/pixi/display/SpriteBatch.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/", - "class": "SpriteBatch" - }, - { - "file": "src/pixi/display/SpriteBatch.js", - "line": 66, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "SpriteBatch" - }, - { - "file": "src/pixi/display/SpriteBatch.js", - "line": 90, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "SpriteBatch" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 25, - "description": "[read-only] Current transform of the object based on world (parent) factors", - "itemtype": "property", - "name": "worldTransform", - "type": "Matrix", - "readonly": "", - "access": "private", - "tagname": "", - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 35, - "description": "Whether or not the stage is interactive", - "itemtype": "property", - "name": "interactive", - "type": "Boolean", - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 43, - "description": "The interaction manage for this stage, manages all interactive activity on the stage", - "itemtype": "property", - "name": "interactionManager", - "type": "InteractionManager", - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 51, - "description": "Whether the stage is dirty and needs to have interactions updated", - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 73, - "description": "Sets another DOM element which can receive mouse/touch interactions instead of the default Canvas element.\nThis is useful for when you have other DOM elements on top of the Canvas element.", - "itemtype": "method", - "name": "setInteractionDelegate", - "params": [ - { - "name": "domElement", - "description": "This new domElement which will receive mouse/touch events", - "type": "DOMElement" - } - ], - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 110, - "description": "Sets the background color for the stage", - "itemtype": "method", - "name": "setBackgroundColor", - "params": [ - { - "name": "backgroundColor", - "description": "the color of the background, easiest way to pass this in is in hex format\n like: 0xFFFFFF for white", - "type": "Number" - } - ], - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 126, - "description": "This will return the point containing global coordinates of the mouse.", - "itemtype": "method", - "name": "getMousePosition", - "return": { - "description": "A point containing the coordinates of the global InteractionData position.", - "type": "Point" - }, - "class": "Stage" - }, - { - "file": "src/pixi/extras/Rope.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "copyright": "Mat Groves, Rovanion Luckey", - "class": "Rope" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23\nbased on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi\n\nAwesome JS run time provided by EsotericSoftware\nhttps://github.com/EsotericSoftware/spine-runtimes", - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 213, - "description": "cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of", - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 506, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 513, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 520, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 528, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 535, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 542, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 577, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 585, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 600, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 604, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 611, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 618, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 625, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 637, - "description": "from the new skin are attached if the corresponding attachment from the old skin was attached.", - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 644, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 648, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 657, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 849, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 855, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 861, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 867, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 885, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 1310, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/", - "class": "Strip" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 20, - "description": "The texture of the strip", - "itemtype": "property", - "name": "texture", - "type": "Texture", - "class": "Strip" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 43, - "description": "Whether the strip is dirty or not", - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "class": "Strip" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 52, - "description": "if you need a padding, not yet implemented", - "itemtype": "property", - "name": "padding", - "type": "Number", - "class": "Strip" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 293, - "description": "Renders a flat strip", - "itemtype": "method", - "name": "renderStripFlat", - "params": [ - { - "name": "strip", - "description": "The Strip to render", - "type": "Strip" - } - ], - "access": "private", - "tagname": "", - "class": "Strip" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 341, - "description": "When the texture is updated, this event will fire to update the scale and frame", - "itemtype": "method", - "name": "onTextureUpdate", - "params": [ - { - "name": "event", - "description": "" - } - ], - "access": "private", - "tagname": "", - "class": "Strip" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 19, - "description": "The with of the tiling sprite", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 27, - "description": "The height of the tiling sprite", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 35, - "description": "The scaling of the image that is being tiled", - "itemtype": "property", - "name": "tileScale", - "type": "Point", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 43, - "description": "A point that represents the scale of the texture object", - "itemtype": "property", - "name": "tileScaleOffset", - "type": "Point", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 51, - "description": "The offset position of the image that is being tiled", - "itemtype": "property", - "name": "tilePosition", - "type": "Point", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 59, - "description": "Whether this sprite is renderable or not", - "itemtype": "property", - "name": "renderable", - "type": "Boolean", - "default": "true", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 68, - "description": "The tint applied to the sprite. This is a hex value", - "itemtype": "property", - "name": "tint", - "type": "Number", - "default": "0xFFFFFF", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 77, - "description": "The blend mode to be applied to the sprite", - "itemtype": "property", - "name": "blendMode", - "type": "Number", - "default": "PIXI.blendModes.NORMAL;", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 95, - "description": "The width of the sprite, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 111, - "description": "The height of the TilingSprite, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 137, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 194, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 280, - "description": "Returns the framing rectangle of the sprite as a PIXI.Rectangle object", - "itemtype": "method", - "name": "getBounds", - "return": { - "description": "the framing rectangle", - "type": "Rectangle" - }, - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 360, - "description": "When the texture is updated, this event will fire to update the scale and frame", - "itemtype": "method", - "name": "onTextureUpdate", - "params": [ - { - "name": "event", - "description": "" - } - ], - "access": "private", - "tagname": "", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 373, - "itemtype": "method", - "name": "generateTilingTexture", - "params": [ - { - "name": "forcePowerOfTwo", - "description": "Whether we want to force the texture to be a power of two", - "type": "Boolean" - } - ], - "class": "TilingSprite" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 15, - "description": "An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion.\nFor example the blur filter has two passes blurX and blurY.", - "itemtype": "property", - "name": "passes", - "type": "Array an array of filter objects", - "access": "private", - "tagname": "", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 24, - "itemtype": "property", - "name": "shaders", - "type": "Array an array of shaders", - "access": "private", - "tagname": "", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 31, - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 37, - "itemtype": "property", - "name": "padding", - "type": "Number", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 43, - "itemtype": "property", - "name": "uniforms", - "type": "object", - "access": "private", - "tagname": "", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 50, - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "access": "private", - "tagname": "", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 60, - "description": "Syncs the uniforms between the class object and the shaders.", - "itemtype": "method", - "name": "syncUniforms", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AlphaMaskFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "AlphaMaskFilter" - }, - { - "file": "src/pixi/filters/AlphaMaskFilter.js", - "line": 71, - "description": "Sets the map dimensions uniforms when the texture becomes available.", - "itemtype": "method", - "name": "onTextureLoaded", - "class": "AlphaMaskFilter" - }, - { - "file": "src/pixi/filters/AlphaMaskFilter.js", - "line": 84, - "description": "The texture used for the displacement map. Must be power of 2 sized texture.", - "itemtype": "property", - "name": "map", - "type": "Texture", - "class": "AlphaMaskFilter" - }, - { - "file": "src/pixi/filters/AsciiFilter.js", - "line": 1, - "author": "Vico @vicocotea\noriginal shader : https://www.shadertoy.com/view/lssGDj by @movAX13h", - "class": "AsciiFilter" - }, - { - "file": "src/pixi/filters/AsciiFilter.js", - "line": 73, - "description": "The pixel size used by the filter.", - "itemtype": "property", - "name": "size", - "type": "Number", - "class": "AsciiFilter" - }, - { - "file": "src/pixi/filters/BlurFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BlurFilter" - }, - { - "file": "src/pixi/filters/BlurFilter.js", - "line": 24, - "description": "Sets the strength of both the blurX and blurY properties simultaneously", - "itemtype": "property", - "name": "blur", - "type": "Number the strength of the blur", - "default": "2", - "class": "BlurFilter" - }, - { - "file": "src/pixi/filters/BlurFilter.js", - "line": 40, - "description": "Sets the strength of the blurX property", - "itemtype": "property", - "name": "blurX", - "type": "Number the strength of the blurX", - "default": "2", - "class": "BlurFilter" - }, - { - "file": "src/pixi/filters/BlurFilter.js", - "line": 56, - "description": "Sets the strength of the blurY property", - "itemtype": "property", - "name": "blurY", - "type": "Number the strength of the blurY", - "default": "2", - "class": "BlurFilter" - }, - { - "file": "src/pixi/filters/BlurXFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BlurXFilter" - }, - { - "file": "src/pixi/filters/BlurXFilter.js", - "line": 51, - "description": "Sets the strength of both the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number the strength of the blur", - "default": "2", - "class": "BlurXFilter" - }, - { - "file": "src/pixi/filters/BlurYFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BlurYFilter" - }, - { - "file": "src/pixi/filters/BlurYFilter.js", - "line": 51, - "description": "Sets the strength of both the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number the strength of the blur", - "default": "2", - "class": "BlurYFilter" - }, - { - "file": "src/pixi/filters/ColorMatrixFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "ColorMatrixFilter" - }, - { - "file": "src/pixi/filters/ColorMatrixFilter.js", - "line": 46, - "description": "Sets the matrix of the color matrix filter", - "itemtype": "property", - "name": "matrix", - "type": "Array and array of 26 numbers", - "default": "[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]", - "class": "ColorMatrixFilter" - }, - { - "file": "src/pixi/filters/ColorStepFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "ColorStepFilter" - }, - { - "file": "src/pixi/filters/ColorStepFilter.js", - "line": 41, - "description": "The number of steps to reduce the palette by.", - "itemtype": "property", - "name": "step", - "type": "Number", - "class": "ColorStepFilter" - }, - { - "file": "src/pixi/filters/ConvolutionFilter.js", - "line": 63, - "description": "An array of values used for matrix transformation. Specified as a 9 point Array.", - "itemtype": "property", - "name": "matrix", - "type": "Array", - "class": "ConvolutionFilter" - }, - { - "file": "src/pixi/filters/ConvolutionFilter.js", - "line": 78, - "description": "Width of the object you are transforming", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "ConvolutionFilter" - }, - { - "file": "src/pixi/filters/ConvolutionFilter.js", - "line": 93, - "description": "Height of the object you are transforming", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "ConvolutionFilter" - }, - { - "file": "src/pixi/filters/CrossHatchFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CrossHatchFilter" - }, - { - "file": "src/pixi/filters/CrossHatchFilter.js", - "line": 65, - "description": "Sets the strength of both the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number the strength of the blur", - "default": "2", - "class": "CrossHatchFilter" - }, - { - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "DisplacementFilter" - }, - { - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 78, - "description": "Sets the map dimensions uniforms when the texture becomes available.", - "itemtype": "method", - "name": "onTextureLoaded", - "class": "DisplacementFilter" - }, - { - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 91, - "description": "The texture used for the displacement map. Must be power of 2 texture.", - "itemtype": "property", - "name": "map", - "type": "Texture", - "class": "DisplacementFilter" - }, - { - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 106, - "description": "The multiplier used to scale the displacement result from the map calculation.", - "itemtype": "property", - "name": "scale", - "type": "Point", - "class": "DisplacementFilter" - }, - { - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 121, - "description": "The offset used to move the displacement map.", - "itemtype": "property", - "name": "offset", - "type": "Point", - "class": "DisplacementFilter" - }, - { - "file": "src/pixi/filters/DotScreenFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23\noriginal filter: https://github.com/evanw/glfx.js/blob/master/src/filters/fun/dotscreen.js", - "class": "DotScreenFilter" - }, - { - "file": "src/pixi/filters/DotScreenFilter.js", - "line": 57, - "description": "The scale of the effect.", - "itemtype": "property", - "name": "scale", - "type": "Number", - "class": "DotScreenFilter" - }, - { - "file": "src/pixi/filters/DotScreenFilter.js", - "line": 72, - "description": "The radius of the effect.", - "itemtype": "property", - "name": "angle", - "type": "Number", - "class": "DotScreenFilter" - }, - { - "file": "src/pixi/filters/FilterBlock.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "FilterBlock" - }, - { - "file": "src/pixi/filters/FilterBlock.js", - "line": 13, - "description": "The visible state of this FilterBlock.", - "itemtype": "property", - "name": "visible", - "type": "Boolean", - "class": "FilterBlock" - }, - { - "file": "src/pixi/filters/FilterBlock.js", - "line": 21, - "description": "The renderable state of this FilterBlock.", - "itemtype": "property", - "name": "renderable", - "type": "Boolean", - "class": "FilterBlock" - }, - { - "file": "src/pixi/filters/GrayFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "GrayFilter" - }, - { - "file": "src/pixi/filters/GrayFilter.js", - "line": 41, - "description": "The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color.", - "itemtype": "property", - "name": "gray", - "type": "Number", - "class": "GrayFilter" - }, - { - "file": "src/pixi/filters/InvertFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "InvertFilter" - }, - { - "file": "src/pixi/filters/InvertFilter.js", - "line": 42, - "description": "The strength of the invert. 1 will fully invert the colors, 0 will make the object its normal color", - "itemtype": "property", - "name": "invert", - "type": "Number", - "class": "InvertFilter" - }, - { - "file": "src/pixi/filters/NoiseFilter.js", - "line": 1, - "author": "Vico @vicocotea\noriginal filter: https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js", - "class": "NoiseFilter" - }, - { - "file": "src/pixi/filters/NoiseFilter.js", - "line": 49, - "description": "The amount of noise to apply.", - "itemtype": "property", - "name": "noise", - "type": "Number", - "class": "NoiseFilter" - }, - { - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "NormalMapFilter" - }, - { - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 140, - "description": "Sets the map dimensions uniforms when the texture becomes available.", - "itemtype": "method", - "name": "onTextureLoaded", - "class": "NormalMapFilter" - }, - { - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 153, - "description": "The texture used for the displacement map. Must be power of 2 texture.", - "itemtype": "property", - "name": "map", - "type": "Texture", - "class": "NormalMapFilter" - }, - { - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 168, - "description": "The multiplier used to scale the displacement result from the map calculation.", - "itemtype": "property", - "name": "scale", - "type": "Point", - "class": "NormalMapFilter" - }, - { - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 183, - "description": "The offset used to move the displacement map.", - "itemtype": "property", - "name": "offset", - "type": "Point", - "class": "NormalMapFilter" - }, - { - "file": "src/pixi/filters/PixelateFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "PixelateFilter" - }, - { - "file": "src/pixi/filters/PixelateFilter.js", - "line": 48, - "description": "This a point that describes the size of the blocks. x is the width of the block and y is the height.", - "itemtype": "property", - "name": "size", - "type": "Point", - "class": "PixelateFilter" - }, - { - "file": "src/pixi/filters/RGBSplitFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "RGBSplitFilter" - }, - { - "file": "src/pixi/filters/RGBSplitFilter.js", - "line": 48, - "description": "Red channel offset.", - "itemtype": "property", - "name": "red", - "type": "Point", - "class": "RGBSplitFilter" - }, - { - "file": "src/pixi/filters/RGBSplitFilter.js", - "line": 63, - "description": "Green channel offset.", - "itemtype": "property", - "name": "green", - "type": "Point", - "class": "RGBSplitFilter" - }, - { - "file": "src/pixi/filters/RGBSplitFilter.js", - "line": 78, - "description": "Blue offset.", - "itemtype": "property", - "name": "blue", - "type": "Point", - "class": "RGBSplitFilter" - }, - { - "file": "src/pixi/filters/SepiaFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "SepiaFilter" - }, - { - "file": "src/pixi/filters/SepiaFilter.js", - "line": 43, - "description": "The strength of the sepia. 1 will apply the full sepia effect, 0 will make the object its normal color.", - "itemtype": "property", - "name": "sepia", - "type": "Number", - "class": "SepiaFilter" - }, - { - "file": "src/pixi/filters/SmartBlurFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "SmartBlurFilter" - }, - { - "file": "src/pixi/filters/SmartBlurFilter.js", - "line": 61, - "description": "The strength of the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number the strength of the blur", - "default": "2", - "class": "SmartBlurFilter" - }, - { - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 1, - "author": "Vico @vicocotea\noriginal filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/", - "class": "TiltShiftFilter" - }, - { - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 24, - "description": "The strength of the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number", - "class": "TiltShiftFilter" - }, - { - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 39, - "description": "The strength of the gradient blur.", - "itemtype": "property", - "name": "gradientBlur", - "type": "Number", - "class": "TiltShiftFilter" - }, - { - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 54, - "description": "The Y value to start the effect at.", - "itemtype": "property", - "name": "start", - "type": "Number", - "class": "TiltShiftFilter" - }, - { - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 69, - "description": "The Y value to end the effect at.", - "itemtype": "property", - "name": "end", - "type": "Number", - "class": "TiltShiftFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 1, - "author": "Vico @vicocotea\noriginal filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 72, - "description": "The strength of the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 88, - "description": "The strength of the gradient blur.", - "itemtype": "property", - "name": "gradientBlur", - "type": "Number", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 104, - "description": "The X value to start the effect at.", - "itemtype": "property", - "name": "start", - "type": "Number", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 121, - "description": "The X value to end the effect at.", - "itemtype": "property", - "name": "end", - "type": "Number", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 138, - "description": "Updates the filter delta values.", - "itemtype": "method", - "name": "updateDelta", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 1, - "author": "Vico @vicocotea\noriginal filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 72, - "description": "The strength of the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 88, - "description": "The strength of the gradient blur.", - "itemtype": "property", - "name": "gradientBlur", - "type": "Number", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 104, - "description": "The Y value to start the effect at.", - "itemtype": "property", - "name": "start", - "type": "Number", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 121, - "description": "The Y value to end the effect at.", - "itemtype": "property", - "name": "end", - "type": "Number", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 138, - "description": "Updates the filter delta values.", - "itemtype": "method", - "name": "updateDelta", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TwistFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "TwistFilter" - }, - { - "file": "src/pixi/filters/TwistFilter.js", - "line": 56, - "description": "This point describes the the offset of the twist.", - "itemtype": "property", - "name": "offset", - "type": "Point", - "class": "TwistFilter" - }, - { - "file": "src/pixi/filters/TwistFilter.js", - "line": 72, - "description": "This radius of the twist.", - "itemtype": "property", - "name": "radius", - "type": "Number", - "class": "TwistFilter" - }, - { - "file": "src/pixi/filters/TwistFilter.js", - "line": 88, - "description": "This angle of the twist.", - "itemtype": "property", - "name": "angle", - "type": "Number", - "class": "TwistFilter" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 1, - "author": "Chad Engler ", - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 16, - "itemtype": "property", - "name": "x", - "type": "Number", - "default": "0", - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 23, - "itemtype": "property", - "name": "y", - "type": "Number", - "default": "0", - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 30, - "itemtype": "property", - "name": "radius", - "type": "Number", - "default": "0", - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 38, - "description": "Creates a clone of this Circle instance", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the Circle", - "type": "Circle" - }, - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 49, - "description": "Checks whether the x and y coordinates given are contained within this circle", - "itemtype": "method", - "name": "contains", - "params": [ - { - "name": "x", - "description": "The X coordinate of the point to test", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the point to test", - "type": "Number" - } - ], - "return": { - "description": "Whether the x/y coordinates are within this Circle", - "type": "Boolean" - }, - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 72, - "description": "Returns the framing rectangle of the circle as a PIXI.Rectangle object", - "itemtype": "method", - "name": "getBounds", - "return": { - "description": "the framing rectangle", - "type": "Rectangle" - }, - "class": "Circle" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 1, - "author": "Chad Engler ", - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 17, - "itemtype": "property", - "name": "x", - "type": "Number", - "default": "0", - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 24, - "itemtype": "property", - "name": "y", - "type": "Number", - "default": "0", - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 31, - "itemtype": "property", - "name": "width", - "type": "Number", - "default": "0", - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 38, - "itemtype": "property", - "name": "height", - "type": "Number", - "default": "0", - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 46, - "description": "Creates a clone of this Ellipse instance", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the ellipse", - "type": "Ellipse" - }, - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 57, - "description": "Checks whether the x and y coordinates given are contained within this ellipse", - "itemtype": "method", - "name": "contains", - "params": [ - { - "name": "x", - "description": "The X coordinate of the point to test", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the point to test", - "type": "Number" - } - ], - "return": { - "description": "Whether the x/y coords are within this ellipse", - "type": "Boolean" - }, - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 80, - "description": "Returns the framing rectangle of the ellipse as a PIXI.Rectangle object", - "itemtype": "method", - "name": "getBounds", - "return": { - "description": "the framing rectangle", - "type": "Rectangle" - }, - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 17, - "itemtype": "property", - "name": "a", - "type": "Number", - "default": "1", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 24, - "itemtype": "property", - "name": "b", - "type": "Number", - "default": "0", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 31, - "itemtype": "property", - "name": "c", - "type": "Number", - "default": "0", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 38, - "itemtype": "property", - "name": "d", - "type": "Number", - "default": "1", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 45, - "itemtype": "property", - "name": "tx", - "type": "Number", - "default": "0", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 52, - "itemtype": "property", - "name": "ty", - "type": "Number", - "default": "0", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 60, - "description": "Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:\n\na = array[0]\nb = array[1]\nc = array[3]\nd = array[4]\ntx = array[2]\nty = array[5]", - "itemtype": "method", - "name": "fromArray", - "params": [ - { - "name": "array", - "description": "The array that the matrix will be populated from.", - "type": "Array" - } - ], - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 83, - "description": "Creates an array from the current Matrix object.", - "itemtype": "method", - "name": "toArray", - "params": [ - { - "name": "transpose", - "description": "Whether we need to transpose the matrix or not", - "type": "Boolean" - } - ], - "return": { - "description": "the newly created array which contains the matrix", - "type": "Array" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 123, - "description": "Get a new position with the current transformation applied.\nCan be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)", - "itemtype": "method", - "name": "apply", - "params": [ - { - "name": "pos", - "description": "The origin", - "type": "Point" - }, - { - "name": "newPos", - "description": "The point that the new position is assigned to (allowed to be same as input)", - "type": "Point", - "optional": true - } - ], - "return": { - "description": "The new point, transformed through this matrix", - "type": "Point" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 142, - "description": "Get a new position with the inverse of the current transformation applied.\nCan be used to go from the world coordinate space to a child's coordinate space. (e.g. input)", - "itemtype": "method", - "name": "applyInverse", - "params": [ - { - "name": "pos", - "description": "The origin", - "type": "Point" - }, - { - "name": "newPos", - "description": "The point that the new position is assigned to (allowed to be same as input)", - "type": "Point", - "optional": true - } - ], - "return": { - "description": "The new point, inverse-transformed through this matrix", - "type": "Point" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 163, - "description": "Translates the matrix on the x and y.", - "itemtype": "method", - "name": "translate", - "params": [ - { - "name": "x", - "description": "", - "type": "Number" - }, - { - "name": "y", - "description": "", - "type": "Number" - } - ], - "return": { - "description": "This matrix. Good for chaining method calls.", - "type": "Matrix" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 179, - "description": "Applies a scale transformation to the matrix.", - "itemtype": "method", - "name": "scale", - "params": [ - { - "name": "x", - "description": "The amount to scale horizontally", - "type": "Number" - }, - { - "name": "y", - "description": "The amount to scale vertically", - "type": "Number" - } - ], - "return": { - "description": "This matrix. Good for chaining method calls.", - "type": "Matrix" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 200, - "description": "Applies a rotation transformation to the matrix.", - "itemtype": "method", - "name": "rotate", - "params": [ - { - "name": "angle", - "description": "The angle in radians.", - "type": "Number" - } - ], - "return": { - "description": "This matrix. Good for chaining method calls.", - "type": "Matrix" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 225, - "description": "Appends the given Matrix to this Matrix.", - "itemtype": "method", - "name": "append", - "params": [ - { - "name": "matrix", - "description": "", - "type": "Matrix" - } - ], - "return": { - "description": "This matrix. Good for chaining method calls.", - "type": "Matrix" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 250, - "description": "Resets this Matix to an identity (default) matrix.", - "itemtype": "method", - "name": "identity", - "return": { - "description": "This matrix. Good for chaining method calls.", - "type": "Matrix" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Point.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Point" - }, - { - "file": "src/pixi/geom/Point.js", - "line": 15, - "itemtype": "property", - "name": "x", - "type": "Number", - "default": "0", - "class": "Point" - }, - { - "file": "src/pixi/geom/Point.js", - "line": 22, - "itemtype": "property", - "name": "y", - "type": "Number", - "default": "0", - "class": "Point" - }, - { - "file": "src/pixi/geom/Point.js", - "line": 30, - "description": "Creates a clone of this point", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the point", - "type": "Point" - }, - "class": "Point" - }, - { - "file": "src/pixi/geom/Point.js", - "line": 41, - "description": "Sets the point to a new x and y position.\nIf y is omitted, both x and y will be set to x.", - "itemtype": "method", - "name": "set", - "params": [ - { - "name": "x", - "description": "position of the point on the x axis", - "type": "Number", - "optional": true, - "optdefault": "0" - }, - { - "name": "y", - "description": "position of the point on the y axis", - "type": "Number", - "optional": true, - "optdefault": "0" - } - ], - "class": "Point" - }, - { - "file": "src/pixi/geom/Polygon.js", - "line": 1, - "author": "Adrien Brault ", - "class": "Polygon" - }, - { - "file": "src/pixi/geom/Polygon.js", - "line": 35, - "description": "Creates a clone of this polygon", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the polygon", - "type": "Polygon" - }, - "class": "Polygon" - }, - { - "file": "src/pixi/geom/Polygon.js", - "line": 47, - "description": "Checks whether the x and y coordinates passed to this function are contained within this polygon", - "itemtype": "method", - "name": "contains", - "params": [ - { - "name": "x", - "description": "The X coordinate of the point to test", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the point to test", - "type": "Number" - } - ], - "return": { - "description": "Whether the x/y coordinates are within this polygon", - "type": "Boolean" - }, - "class": "Polygon" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/", - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 17, - "itemtype": "property", - "name": "x", - "type": "Number", - "default": "0", - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 24, - "itemtype": "property", - "name": "y", - "type": "Number", - "default": "0", - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 31, - "itemtype": "property", - "name": "width", - "type": "Number", - "default": "0", - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 38, - "itemtype": "property", - "name": "height", - "type": "Number", - "default": "0", - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 46, - "description": "Creates a clone of this Rectangle", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the rectangle", - "type": "Rectangle" - }, - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 57, - "description": "Checks whether the x and y coordinates given are contained within this Rectangle", - "itemtype": "method", - "name": "contains", - "params": [ - { - "name": "x", - "description": "The X coordinate of the point to test", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the point to test", - "type": "Number" - } - ], - "return": { - "description": "Whether the x/y coordinates are within this Rectangle", - "type": "Boolean" - }, - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 18, - "itemtype": "property", - "name": "x", - "type": "Number", - "default": "0", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 25, - "itemtype": "property", - "name": "y", - "type": "Number", - "default": "0", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 32, - "itemtype": "property", - "name": "width", - "type": "Number", - "default": "0", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 39, - "itemtype": "property", - "name": "height", - "type": "Number", - "default": "0", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 46, - "itemtype": "property", - "name": "radius", - "type": "Number", - "default": "20", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 54, - "description": "Creates a clone of this Rounded Rectangle", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the rounded rectangle", - "type": "Rounded Rectangle" - }, - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 65, - "description": "Checks whether the x and y coordinates given are contained within this Rounded Rectangle", - "itemtype": "method", - "name": "contains", - "params": [ - { - "name": "x", - "description": "The X coordinate of the point to test", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the point to test", - "type": "Number" - } - ], - "return": { - "description": "Whether the x/y coordinates are within this Rounded Rectangle", - "type": "Boolean" - }, - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 23, - "description": "The array of asset URLs that are going to be loaded", - "itemtype": "property", - "name": "assetURLs", - "type": "Array", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 31, - "description": "Whether the requests should be treated as cross origin", - "itemtype": "property", - "name": "crossorigin", - "type": "Boolean", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 39, - "description": "Maps file extension to loader types", - "itemtype": "property", - "name": "loadersByType", - "type": "Object", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 61, - "description": "Fired when an item has loaded", - "itemtype": "event", - "name": "onProgress", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 66, - "description": "Fired when all the assets have loaded", - "itemtype": "event", - "name": "onComplete", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 74, - "description": "Given a filename, returns its extension.", - "itemtype": "method", - "name": "_getDataType", - "params": [ - { - "name": "str", - "description": "the name of the asset", - "type": "String" - } - ], - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 107, - "description": "Starts loading the assets sequentially", - "itemtype": "method", - "name": "load", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 143, - "description": "Invoked after each file is loaded", - "itemtype": "method", - "name": "onAssetLoaded", - "access": "private", - "tagname": "", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 1, - "author": "Martin Kelm http://mkelm.github.com", - "class": "AtlasLoader" - }, - { - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 32, - "description": "Starts loading the JSON file", - "itemtype": "method", - "name": "load", - "class": "AtlasLoader" - }, - { - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 46, - "description": "Invoked when the Atlas has fully loaded. Parses the JSON and builds the texture frames.", - "itemtype": "method", - "name": "onAtlasLoaded", - "access": "private", - "tagname": "", - "class": "AtlasLoader" - }, - { - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 166, - "description": "Invoked when json file has loaded.", - "itemtype": "method", - "name": "onLoaded", - "access": "private", - "tagname": "", - "class": "AtlasLoader" - }, - { - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 182, - "description": "Invoked when an error occurs.", - "itemtype": "method", - "name": "onError", - "access": "private", - "tagname": "", - "class": "AtlasLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 19, - "description": "The url of the bitmap font data", - "itemtype": "property", - "name": "url", - "type": "String", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 27, - "description": "Whether the requests should be treated as cross origin", - "itemtype": "property", - "name": "crossorigin", - "type": "Boolean", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 35, - "description": "[read-only] The base url of the bitmap font data", - "itemtype": "property", - "name": "baseUrl", - "type": "String", - "readonly": "", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 44, - "description": "[read-only] The texture of the bitmap font", - "itemtype": "property", - "name": "texture", - "type": "Texture", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 57, - "description": "Loads the XML font data", - "itemtype": "method", - "name": "load", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 72, - "description": "Invoked when the XML file is loaded, parses the data.", - "itemtype": "method", - "name": "onXMLLoaded", - "access": "private", - "tagname": "", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 152, - "description": "Invoked when all files are loaded (xml/fnt and texture)", - "itemtype": "method", - "name": "onLoaded", - "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": 18, - "description": "The texture being loaded", - "itemtype": "property", - "name": "texture", - "type": "Texture", - "class": "ImageLoader" - }, - { - "file": "src/pixi/loaders/ImageLoader.js", - "line": 26, - "description": "if the image is loaded with loadFramedSpriteSheet\nframes will contain the sprite sheet frames", - "itemtype": "property", - "name": "frames", - "type": "Array", - "readonly": "", - "class": "ImageLoader" - }, - { - "file": "src/pixi/loaders/ImageLoader.js", - "line": 42, - "description": "Loads image or takes it from cache", - "itemtype": "method", - "name": "load", - "class": "ImageLoader" - }, - { - "file": "src/pixi/loaders/ImageLoader.js", - "line": 59, - "description": "Invoked when image file is loaded or it is already cached and ready to use", - "itemtype": "method", - "name": "onLoaded", - "access": "private", - "tagname": "", - "class": "ImageLoader" - }, - { - "file": "src/pixi/loaders/ImageLoader.js", - "line": 70, - "description": "Loads image and split it to uniform sized frames", - "itemtype": "method", - "name": "loadFramedSpriteSheet", - "params": [ - { - "name": "frameWidth", - "description": "width of each frame", - "type": "Number" - }, - { - "name": "frameHeight", - "description": "height of each frame", - "type": "Number" - }, - { - "name": "textureName", - "description": "if given, the frames will be cached in - format", - "type": "String" - } - ], - "class": "ImageLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 18, - "description": "The url of the bitmap font data", - "itemtype": "property", - "name": "url", - "type": "String", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 26, - "description": "Whether the requests should be treated as cross origin", - "itemtype": "property", - "name": "crossorigin", - "type": "Boolean", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 34, - "description": "[read-only] The base url of the bitmap font data", - "itemtype": "property", - "name": "baseUrl", - "type": "String", - "readonly": "", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 43, - "description": "[read-only] Whether the data has loaded yet", - "itemtype": "property", - "name": "loaded", - "type": "Boolean", - "readonly": "", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 59, - "description": "Loads the JSON data", - "itemtype": "method", - "name": "load", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 98, - "description": "Invoked when the JSON file is loaded.", - "itemtype": "method", - "name": "onJSONLoaded", - "access": "private", - "tagname": "", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 162, - "description": "Invoked when the json file has loaded.", - "itemtype": "method", - "name": "onLoaded", - "access": "private", - "tagname": "", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 176, - "description": "Invoked if an error occurs.", - "itemtype": "method", - "name": "onError", - "access": "private", - "tagname": "", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23\nbased on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi\n\nAwesome JS run time provided by EsotericSoftware\nhttps://github.com/EsotericSoftware/spine-runtimes", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 26, - "description": "The url of the bitmap font data", - "itemtype": "property", - "name": "url", - "type": "String", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 34, - "description": "Whether the requests should be treated as cross origin", - "itemtype": "property", - "name": "crossorigin", - "type": "Boolean", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 42, - "description": "[read-only] Whether the data has loaded yet", - "itemtype": "property", - "name": "loaded", - "type": "Boolean", - "readonly": "", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 56, - "description": "Loads the JSON data", - "itemtype": "method", - "name": "load", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 72, - "description": "Invoked when JSON file is loaded.", - "itemtype": "method", - "name": "onLoaded", - "access": "private", - "tagname": "", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 22, - "description": "The url of the atlas data", - "itemtype": "property", - "name": "url", - "type": "String", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 30, - "description": "Whether the requests should be treated as cross origin", - "itemtype": "property", - "name": "crossorigin", - "type": "Boolean", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 38, - "description": "[read-only] The base url of the bitmap font data", - "itemtype": "property", - "name": "baseUrl", - "type": "String", - "readonly": "", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 47, - "description": "The texture being loaded", - "itemtype": "property", - "name": "texture", - "type": "Texture", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 55, - "description": "The frames of the sprite sheet", - "itemtype": "property", - "name": "frames", - "type": "Object", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 69, - "description": "This will begin loading the JSON file", - "itemtype": "method", - "name": "load", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 84, - "description": "Invoke when all files are loaded (json and texture)", - "itemtype": "method", - "name": "onLoaded", - "access": "private", - "tagname": "", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 18, - "description": "The alpha value used when filling the Graphics object.", - "itemtype": "property", - "name": "fillAlpha", - "type": "Number", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 26, - "description": "The width (thickness) of any lines drawn.", - "itemtype": "property", - "name": "lineWidth", - "type": "Number", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 34, - "description": "The color of any lines drawn.", - "itemtype": "property", - "name": "lineColor", - "type": "String", - "default": "0", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 43, - "description": "Graphics data", - "itemtype": "property", - "name": "graphicsData", - "type": "Array", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 52, - "description": "The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint.", - "itemtype": "property", - "name": "tint", - "type": "Number", - "default": "0xFFFFFF", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 61, - "description": "The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode.", - "itemtype": "property", - "name": "blendMode", - "type": "Number", - "default": "PIXI.blendModes.NORMAL;", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 70, - "description": "Current path", - "itemtype": "property", - "name": "currentPath", - "type": "Object", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 79, - "description": "Array containing some WebGL-related properties used by the WebGL renderer.", - "itemtype": "property", - "name": "_webGL", - "type": "Array", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 88, - "description": "Whether this shape is being used as a mask.", - "itemtype": "property", - "name": "isMask", - "type": "Boolean", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 96, - "description": "The bounds' padding used for bounds calculation.", - "itemtype": "property", - "name": "boundsPadding", - "type": "Number", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 106, - "description": "Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated.", - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 115, - "description": "Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated.", - "itemtype": "property", - "name": "webGLDirty", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 124, - "description": "Used to detect if the cached sprite object needs to be updated.", - "itemtype": "property", - "name": "cachedSpriteDirty", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 139, - "description": "When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite.\nThis is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory.\nIt is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas.\nThis is not recommended if you are constantly redrawing the graphics element.", - "itemtype": "property", - "name": "cacheAsBitmap", - "type": "Boolean", - "default": "false", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 171, - "description": "Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.", - "itemtype": "method", - "name": "lineStyle", - "params": [ - { - "name": "lineWidth", - "description": "width of the line to draw, will update the objects stored style", - "type": "Number" - }, - { - "name": "color", - "description": "color of the line to draw, will update the objects stored style", - "type": "Number" - }, - { - "name": "alpha", - "description": "alpha of the line to draw, will update the objects stored style", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 205, - "description": "Moves the current drawing position to x, y.", - "itemtype": "method", - "name": "moveTo", - "params": [ - { - "name": "x", - "description": "the X coordinate to move to", - "type": "Number" - }, - { - "name": "y", - "description": "the Y coordinate to move to", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 220, - "description": "Draws a line using the current line style from the current drawing position to (x, y);\nThe current drawing position is then set to (x, y).", - "itemtype": "method", - "name": "lineTo", - "params": [ - { - "name": "x", - "description": "the X coordinate to draw to", - "type": "Number" - }, - { - "name": "y", - "description": "the Y coordinate to draw to", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 237, - "description": "Calculate the points for a quadratic bezier curve and then draws it.\nBased on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c", - "itemtype": "method", - "name": "quadraticCurveTo", - "params": [ - { - "name": "cpX", - "description": "Control point x", - "type": "Number" - }, - { - "name": "cpY", - "description": "Control point y", - "type": "Number" - }, - { - "name": "toX", - "description": "Destination point x", - "type": "Number" - }, - { - "name": "toY", - "description": "Destination point y", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 287, - "description": "Calculate the points for a bezier curve and then draws it.", - "itemtype": "method", - "name": "bezierCurveTo", - "params": [ - { - "name": "cpX", - "description": "Control point x", - "type": "Number" - }, - { - "name": "cpY", - "description": "Control point y", - "type": "Number" - }, - { - "name": "cpX2", - "description": "Second Control point x", - "type": "Number" - }, - { - "name": "cpY2", - "description": "Second Control point y", - "type": "Number" - }, - { - "name": "toX", - "description": "Destination point x", - "type": "Number" - }, - { - "name": "toY", - "description": "Destination point y", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 414, - "description": "The arc method creates an arc/curve (used to create circles, or parts of circles).", - "itemtype": "method", - "name": "arc", - "params": [ - { - "name": "cx", - "description": "The x-coordinate of the center of the circle", - "type": "Number" - }, - { - "name": "cy", - "description": "The y-coordinate of the center of the circle", - "type": "Number" - }, - { - "name": "radius", - "description": "The radius of the circle", - "type": "Number" - }, - { - "name": "startAngle", - "description": "The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle)", - "type": "Number" - }, - { - "name": "endAngle", - "description": "The ending angle, in radians", - "type": "Number" - }, - { - "name": "anticlockwise", - "description": "Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise.", - "type": "Boolean" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 488, - "description": "Specifies a simple one-color fill that subsequent calls to other Graphics methods\n(such as lineTo() or drawCircle()) use when drawing.", - "itemtype": "method", - "name": "beginFill", - "params": [ - { - "name": "color", - "description": "the color of the fill", - "type": "Number" - }, - { - "name": "alpha", - "description": "the alpha of the fill", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 515, - "description": "Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.", - "itemtype": "method", - "name": "endFill", - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 530, - "itemtype": "method", - "name": "drawRect", - "params": [ - { - "name": "x", - "description": "The X coord of the top-left of the rectangle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coord of the top-left of the rectangle", - "type": "Number" - }, - { - "name": "width", - "description": "The width of the rectangle", - "type": "Number" - }, - { - "name": "height", - "description": "The height of the rectangle", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 546, - "itemtype": "method", - "name": "drawRoundedRect", - "params": [ - { - "name": "x", - "description": "The X coord of the top-left of the rectangle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coord of the top-left of the rectangle", - "type": "Number" - }, - { - "name": "width", - "description": "The width of the rectangle", - "type": "Number" - }, - { - "name": "height", - "description": "The height of the rectangle", - "type": "Number" - }, - { - "name": "radius", - "description": "Radius of the rectangle corners", - "type": "Number" - } - ], - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 562, - "description": "Draws a circle.", - "itemtype": "method", - "name": "drawCircle", - "params": [ - { - "name": "x", - "description": "The X coordinate of the center of the circle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the center of the circle", - "type": "Number" - }, - { - "name": "radius", - "description": "The radius of the circle", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 578, - "description": "Draws an ellipse.", - "itemtype": "method", - "name": "drawEllipse", - "params": [ - { - "name": "x", - "description": "The X coordinate of the center of the ellipse", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the center of the ellipse", - "type": "Number" - }, - { - "name": "width", - "description": "The half width of the ellipse", - "type": "Number" - }, - { - "name": "height", - "description": "The half height of the ellipse", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 595, - "description": "Draws a polygon using the given path.", - "itemtype": "method", - "name": "drawPolygon", - "params": [ - { - "name": "path", - "description": "The path data used to construct the polygon.", - "type": "Array" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 609, - "description": "Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.", - "itemtype": "method", - "name": "clear", - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 627, - "description": "Useful function that returns a texture of the graphics object that can then be used to create sprites\nThis can be quite useful if your geometry is complicated and needs to be reused multiple times.", - "itemtype": "method", - "name": "generateTexture", - "params": [ - { - "name": "resolution", - "description": "The resolution of the texture being generated", - "type": "Number" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ], - "return": { - "description": "a texture of the graphics object", - "type": "Texture" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 656, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 736, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 805, - "description": "Retrieves the bounds of the graphic shape as a rectangle object", - "itemtype": "method", - "name": "getBounds", - "return": { - "description": "the rectangular bounding area", - "type": "Rectangle" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 884, - "description": "Update the bounds of the object", - "itemtype": "method", - "name": "updateLocalBounds", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 983, - "description": "Generates the cached sprite when the sprite has cacheAsBitmap = true", - "itemtype": "method", - "name": "_generateCachedSprite", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 1023, - "description": "Updates texture size based on canvas size", - "itemtype": "method", - "name": "updateCachedSpriteTexture", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 1047, - "description": "Destroys a previous cached sprite.", - "itemtype": "method", - "name": "destroyCachedSprite", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 1061, - "description": "Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.", - "itemtype": "method", - "name": "drawShape", - "params": [ - { - "name": "shape", - "description": "The Shape object to draw.", - "type": "Circle|Rectangle|Ellipse|Line|Polygon" - } - ], - "return": { - "description": "The generated GraphicsData object.", - "type": "GraphicsData" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 15, - "description": "The width of the Canvas in pixels.", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 23, - "description": "The height of the Canvas in pixels.", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 31, - "description": "The Canvas object that belongs to this CanvasBuffer.", - "itemtype": "property", - "name": "canvas", - "type": "HTMLCanvasElement", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 39, - "description": "A CanvasRenderingContext2D object representing a two-dimensional rendering context.", - "itemtype": "property", - "name": "context", - "type": "CanvasRenderingContext2D", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 53, - "description": "Clears the canvas that was created by the CanvasBuffer class.", - "itemtype": "method", - "name": "clear", - "access": "private", - "tagname": "", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 65, - "description": "Resizes the canvas to the specified width and height.", - "itemtype": "method", - "name": "resize", - "params": [ - { - "name": "width", - "description": "the new width of the canvas", - "type": "Number" - }, - { - "name": "height", - "description": "the new height of the canvas", - "type": "Number" - } - ], - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasMaskManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CanvasMaskManager" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasMaskManager.js", - "line": 17, - "description": "This method adds it to the current stack of masks.", - "itemtype": "method", - "name": "pushMask", - "params": [ - { - "name": "maskData", - "description": "the maskData that will be pushed", - "type": "Object" - }, - { - "name": "renderSession", - "description": "The renderSession whose context will be used for this mask manager.", - "type": "Object" - } - ], - "class": "CanvasMaskManager" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasMaskManager.js", - "line": 49, - "description": "Restores the current drawing context to the state it was before the mask was applied.", - "itemtype": "method", - "name": "popMask", - "params": [ - { - "name": "renderSession", - "description": "The renderSession whose context will be used for this mask manager.", - "type": "Object" - } - ], - "class": "CanvasMaskManager" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 14, - "description": "Basically this method just needs a sprite and a color and tints the sprite with the given color.", - "itemtype": "method", - "name": "getTintedTexture", - "params": [ - { - "name": "sprite", - "description": "the sprite to tint", - "type": "Sprite" - }, - { - "name": "color", - "description": "the color to use to tint the sprite with", - "type": "Number" - } - ], - "return": { - "description": "The tinted canvas", - "type": "HTMLCanvasElement" - }, - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 58, - "description": "Tint a texture using the \"multiply\" operation.", - "itemtype": "method", - "name": "tintWithMultiply", - "params": [ - { - "name": "texture", - "description": "the texture to tint", - "type": "Texture" - }, - { - "name": "color", - "description": "the color to use to tint the sprite with", - "type": "Number" - }, - { - "name": "canvas", - "description": "the current canvas", - "type": "HTMLCanvasElement" - } - ], - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 104, - "description": "Tint a texture using the \"overlay\" operation.", - "itemtype": "method", - "name": "tintWithOverlay", - "params": [ - { - "name": "texture", - "description": "the texture to tint", - "type": "Texture" - }, - { - "name": "color", - "description": "the color to use to tint the sprite with", - "type": "Number" - }, - { - "name": "canvas", - "description": "the current canvas", - "type": "HTMLCanvasElement" - } - ], - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 139, - "description": "Tint a texture pixel per pixel.", - "itemtype": "method", - "name": "tintPerPixel", - "params": [ - { - "name": "texture", - "description": "the texture to tint", - "type": "Texture" - }, - { - "name": "color", - "description": "the color to use to tint the sprite with", - "type": "Number" - }, - { - "name": "canvas", - "description": "the current canvas", - "type": "HTMLCanvasElement" - } - ], - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 184, - "description": "Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel.", - "itemtype": "method", - "name": "roundColor", - "params": [ - { - "name": "color", - "description": "the color to round, should be a hex color", - "type": "Number" - } - ], - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 203, - "description": "Number of steps which will be used as a cap when rounding colors.", - "itemtype": "property", - "name": "cacheStepsPerColorChannel", - "type": "Number", - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 211, - "description": "Tint cache boolean flag.", - "itemtype": "property", - "name": "convertTintToImage", - "type": "Boolean", - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 219, - "description": "Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method.", - "itemtype": "property", - "name": "canUseMultiply", - "type": "Boolean", - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 227, - "description": "The tinting method that will be used.", - "itemtype": "method", - "name": "tintMethod", - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/CanvasGraphics.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CanvasGraphics" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 40, - "description": "The renderer type.", - "itemtype": "property", - "name": "type", - "type": "Number", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 48, - "description": "The resolution of the canvas.", - "itemtype": "property", - "name": "resolution", - "type": "Number", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 56, - "description": "This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\nIf the Stage is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\nIf the Stage is transparent Pixi will use clearRect to clear the canvas every frame.\nDisable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.", - "itemtype": "property", - "name": "clearBeforeRender", - "type": "Boolean", - "default": "", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 68, - "description": "Whether the render view is transparent", - "itemtype": "property", - "name": "transparent", - "type": "Boolean", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 76, - "description": "Whether the render view should be resized automatically", - "itemtype": "property", - "name": "autoResize", - "type": "Boolean", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 85, - "description": "The width of the canvas view", - "itemtype": "property", - "name": "width", - "type": "Number", - "default": "800", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 94, - "description": "The height of the canvas view", - "itemtype": "property", - "name": "height", - "type": "Number", - "default": "600", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 106, - "description": "The canvas element that everything is drawn to.", - "itemtype": "property", - "name": "view", - "type": "HTMLCanvasElement", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 114, - "description": "The canvas 2d context that everything is drawn with", - "itemtype": "property", - "name": "context", - "type": "CanvasRenderingContext2D", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 121, - "description": "Boolean flag controlling canvas refresh.", - "itemtype": "property", - "name": "refresh", - "type": "Boolean", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 132, - "description": "Internal var.", - "itemtype": "property", - "name": "count", - "type": "Number", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 140, - "description": "Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer", - "itemtype": "property", - "name": "CanvasMaskManager", - "type": "CanvasMaskManager", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 147, - "description": "The render session is just a bunch of parameter used for rendering", - "itemtype": "property", - "name": "renderSession", - "type": "Object", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 157, - "description": "If true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation.\nHandy for crisp pixel art and speed on legacy devices.", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 184, - "description": "Renders the Stage to this canvas view", - "itemtype": "method", - "name": "render", - "params": [ - { - "name": "stage", - "description": "the Stage element to be rendered", - "type": "Stage" - } - ], - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 233, - "description": "Removes everything from the renderer and optionally removes the Canvas DOM element.", - "itemtype": "method", - "name": "destroy", - "params": [ - { - "name": "removeView", - "description": "Removes the Canvas element from the DOM.", - "type": "Boolean", - "optional": true, - "optdefault": "true" - } - ], - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 255, - "description": "Resizes the canvas view to the specified width and height", - "itemtype": "method", - "name": "resize", - "params": [ - { - "name": "width", - "description": "the new width of the canvas view", - "type": "Number" - }, - { - "name": "height", - "description": "the new height of the canvas view", - "type": "Number" - } - ], - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 276, - "description": "Renders a display object", - "itemtype": "method", - "name": "renderDisplayObject", - "params": [ - { - "name": "displayObject", - "description": "The displayObject to render", - "type": "DisplayObject" - }, - { - "name": "context", - "description": "the context 2d method of the canvas", - "type": "CanvasRenderingContext2D" - } - ], - "access": "private", - "tagname": "", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 291, - "description": "Maps Pixi blend modes to canvas blend modes.", - "itemtype": "method", - "name": "mapBlendModes", - "access": "private", - "tagname": "", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 12, - "itemtype": "property", - "name": "_UID", - "type": "Number", - "access": "private", - "tagname": "", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 19, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 25, - "description": "The WebGL program.", - "itemtype": "property", - "name": "program", - "type": "{Any}", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 32, - "description": "The fragment shader.", - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 48, - "description": "The vertex shader.", - "itemtype": "property", - "name": "vertexSrc", - "type": "Array", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 79, - "description": "Initialises the shader.", - "itemtype": "method", - "name": "init", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 109, - "description": "Destroys the shader.", - "itemtype": "method", - "name": "destroy", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 12, - "itemtype": "property", - "name": "_UID", - "type": "Number", - "access": "private", - "tagname": "", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 19, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 25, - "description": "The WebGL program.", - "itemtype": "property", - "name": "program", - "type": "{Any}", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 32, - "description": "The fragment shader.", - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 47, - "description": "The vertex shader.", - "itemtype": "property", - "name": "vertexSrc", - "type": "Array", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 82, - "description": "A local texture counter for multi-texture shaders.", - "itemtype": "property", - "name": "textureCount", - "type": "Number", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 94, - "description": "Initialises the shader.", - "itemtype": "method", - "name": "init", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 143, - "description": "Destroys the shader.", - "itemtype": "method", - "name": "destroy", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 1, - "author": "Richard Davey http://www.photonstorm.com @photonstorm", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 13, - "itemtype": "property", - "name": "_UID", - "type": "Number", - "access": "private", - "tagname": "", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 20, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 26, - "description": "The WebGL program.", - "itemtype": "property", - "name": "program", - "type": "{Any}", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 33, - "description": "The fragment shader.", - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 48, - "description": "A local texture counter for multi-texture shaders.", - "itemtype": "property", - "name": "textureCount", - "type": "Number", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 55, - "description": "A local flag", - "itemtype": "property", - "name": "firstRun", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 63, - "description": "A dirty flag", - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 70, - "description": "Uniform attributes cache.", - "itemtype": "property", - "name": "attributes", - "type": "Array", - "access": "private", - "tagname": "", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 83, - "description": "Initialises the shader.", - "itemtype": "method", - "name": "init", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 134, - "description": "Initialises the shader uniform values.\n\nUniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/\nhttp://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf", - "itemtype": "method", - "name": "initUniforms", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 208, - "description": "Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded)", - "itemtype": "method", - "name": "initSampler2D", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 283, - "description": "Updates the shader uniform values.", - "itemtype": "method", - "name": "syncUniforms", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 351, - "description": "Destroys the shader.", - "itemtype": "method", - "name": "destroy", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 365, - "description": "The Default Vertex shader source.", - "itemtype": "property", - "name": "defaultVertexSrc", - "type": "String", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 12, - "itemtype": "property", - "name": "_UID", - "type": "Number", - "access": "private", - "tagname": "", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 19, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 25, - "description": "The WebGL program.", - "itemtype": "property", - "name": "program", - "type": "{Any}", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 32, - "description": "The fragment shader.", - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 46, - "description": "The vertex shader.", - "itemtype": "property", - "name": "vertexSrc", - "type": "Array", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 74, - "description": "Initialises the shader.", - "itemtype": "method", - "name": "init", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 103, - "description": "Destroys the shader.", - "itemtype": "method", - "name": "destroy", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 12, - "itemtype": "property", - "name": "_UID", - "type": "Number", - "access": "private", - "tagname": "", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 19, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 25, - "description": "The WebGL program.", - "itemtype": "property", - "name": "program", - "type": "{Any}", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 32, - "description": "The fragment shader.", - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 50, - "description": "The vertex shader.", - "itemtype": "property", - "name": "vertexSrc", - "type": "Array", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 80, - "description": "Initialises the shader.", - "itemtype": "method", - "name": "init", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 111, - "description": "Destroys the shader.", - "itemtype": "method", - "name": "destroy", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 15, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 23, - "itemtype": "property", - "name": "frameBuffer", - "type": "Any", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 29, - "itemtype": "property", - "name": "texture", - "type": "Any", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 35, - "itemtype": "property", - "name": "scaleMode", - "type": "Number", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 61, - "description": "Clears the filter texture.", - "itemtype": "method", - "name": "clear", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 74, - "description": "Resizes the texture to the specified width and height", - "itemtype": "method", - "name": "resize", - "params": [ - { - "name": "width", - "description": "the new width of the texture", - "type": "Number" - }, - { - "name": "height", - "description": "the new height of the texture", - "type": "Number" - } - ], - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 97, - "description": "Destroys the filter texture.", - "itemtype": "method", - "name": "destroy", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLBlendModeManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 12, - "itemtype": "property", - "name": "currentBlendMode", - "type": "Number", - "class": "WebGLBlendModeManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 21, - "description": "Sets the WebGL Context.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLBlendModeManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 32, - "description": "Sets-up the given blendMode from WebGL's point of view.", - "itemtype": "method", - "name": "setBlendMode", - "params": [ - { - "name": "blendMode", - "description": "the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD", - "type": "Number" - } - ], - "class": "WebGLBlendModeManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 50, - "description": "Destroys this object.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLBlendModeManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 1, - "author": "Mat Groves\n\nBig thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\nfor creating the original pixi version!\n\nHeavily inspired by LibGDX's WebGLSpriteBatch:\nhttps://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 17, - "itemtype": "property", - "name": "vertSize", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 23, - "itemtype": "property", - "name": "maxSize", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 29, - "itemtype": "property", - "name": "size", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 41, - "description": "Vertex data", - "itemtype": "property", - "name": "vertices", - "type": "Float32Array", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 48, - "description": "Index data", - "itemtype": "property", - "name": "indices", - "type": "Uint16Array", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 55, - "itemtype": "property", - "name": "vertexBuffer", - "type": "Object", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 61, - "itemtype": "property", - "name": "indexBuffer", - "type": "Object", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 67, - "itemtype": "property", - "name": "lastIndexCount", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 83, - "itemtype": "property", - "name": "drawing", - "type": "Boolean", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 89, - "itemtype": "property", - "name": "currentBatchSize", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 95, - "itemtype": "property", - "name": "currentBaseTexture", - "type": "BaseTexture", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 101, - "itemtype": "property", - "name": "currentBlendMode", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 107, - "itemtype": "property", - "name": "renderSession", - "type": "Object", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 113, - "itemtype": "property", - "name": "shader", - "type": "Object", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 119, - "itemtype": "property", - "name": "matrix", - "type": "Matrix", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 130, - "description": "Sets the WebGL Context.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 154, - "itemtype": "method", - "name": "begin", - "params": [ - { - "name": "spriteBatch", - "description": "", - "type": "WebGLSpriteBatch" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 169, - "itemtype": "method", - "name": "end", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 177, - "itemtype": "method", - "name": "render", - "params": [ - { - "name": "spriteBatch", - "description": "", - "type": "WebGLSpriteBatch" - } - ], - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 208, - "itemtype": "method", - "name": "renderSprite", - "params": [ - { - "name": "sprite", - "description": "", - "type": "Sprite" - } - ], - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 349, - "itemtype": "method", - "name": "flush", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 389, - "itemtype": "method", - "name": "stop", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 397, - "itemtype": "method", - "name": "start", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 11, - "itemtype": "property", - "name": "filterStack", - "type": "Array", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 17, - "itemtype": "property", - "name": "offsetX", - "type": "Number", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 23, - "itemtype": "property", - "name": "offsetY", - "type": "Number", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 32, - "description": "Initialises the context and the properties.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 46, - "itemtype": "method", - "name": "begin", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - }, - { - "name": "buffer", - "description": "", - "type": "ArrayBuffer" - } - ], - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 62, - "description": "Applies the filter and adds it to the current filter stack.", - "itemtype": "method", - "name": "pushFilter", - "params": [ - { - "name": "filterBlock", - "description": "the filter that will be pushed to the current filter stack", - "type": "Object" - } - ], - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 138, - "description": "Removes the last filter from the filter stack and doesn't return it.", - "itemtype": "method", - "name": "popFilter", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 315, - "description": "Applies the filter to the specified area.", - "itemtype": "method", - "name": "applyFilterPass", - "params": [ - { - "name": "filter", - "description": "the filter that needs to be applied", - "type": "AbstractFilter" - }, - { - "name": "filterArea", - "description": "TODO - might need an update", - "type": "Texture" - }, - { - "name": "width", - "description": "the horizontal range of the filter", - "type": "Number" - }, - { - "name": "height", - "description": "the vertical range of the filter", - "type": "Number" - } - ], - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 376, - "description": "Initialises the shader buffers.", - "itemtype": "method", - "name": "initShaderBuffers", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 424, - "description": "Destroys the filter and removes it from the filter stack.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 16, - "description": "Renders the graphics object", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "renderGraphics", - "params": [ - { - "name": "graphics", - "description": "", - "type": "Graphics" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 84, - "description": "Updates the graphics object", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "updateGraphics", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object to update", - "type": "Graphics" - }, - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 199, - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "switchMode", - "params": [ - { - "name": "webGL", - "description": "", - "type": "WebGLContext" - }, - { - "name": "type", - "description": "", - "type": "Number" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 233, - "description": "Builds a rectangle to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildRectangle", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object containing all the necessary properties", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 301, - "description": "Builds a rounded rectangle to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildRoundedRectangle", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object containing all the necessary properties", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 369, - "description": "Calculate the points for a quadratic bezier curve. (helper function..)\nBased on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "quadraticBezierCurve", - "params": [ - { - "name": "fromX", - "description": "Origin point x", - "type": "Number" - }, - { - "name": "fromY", - "description": "Origin point x", - "type": "Number" - }, - { - "name": "cpX", - "description": "Control point x", - "type": "Number" - }, - { - "name": "cpY", - "description": "Control point y", - "type": "Number" - }, - { - "name": "toX", - "description": "Destination point x", - "type": "Number" - }, - { - "name": "toY", - "description": "Destination point y", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Array" - }, - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 421, - "description": "Builds a circle to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildCircle", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object to draw", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 504, - "description": "Builds a line to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildLine", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object containing all the necessary properties", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 716, - "description": "Builds a complex polygon to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildComplexPoly", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object containing all the necessary properties", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 778, - "description": "Builds a polygon to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildPoly", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object containing all the necessary properties", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 850, - "itemtype": "method", - "name": "reset", - "class": "WebGLGraphicsData" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 860, - "itemtype": "method", - "name": "upload", - "class": "WebGLGraphicsData" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLMaskManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 16, - "description": "Sets the drawing context to the one given in parameter.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLMaskManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 27, - "description": "Applies the Mask and adds it to the current filter stack.", - "itemtype": "method", - "name": "pushMask", - "params": [ - { - "name": "maskData", - "description": "", - "type": "Array" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLMaskManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 48, - "description": "Removes the last filter from the filter stack and doesn't return it.", - "itemtype": "method", - "name": "popMask", - "params": [ - { - "name": "maskData", - "description": "", - "type": "Array" - }, - { - "name": "renderSession", - "description": "an object containing all the useful parameters", - "type": "Object" - } - ], - "class": "WebGLMaskManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 61, - "description": "Destroys the mask stack.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLMaskManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 12, - "itemtype": "property", - "name": "maxAttibs", - "type": "Number", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 18, - "itemtype": "property", - "name": "attribState", - "type": "Array", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 24, - "itemtype": "property", - "name": "tempAttribState", - "type": "Array", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 35, - "itemtype": "property", - "name": "stack", - "type": "Array", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 45, - "description": "Initialises the context and the properties.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 72, - "description": "Takes the attributes given in parameters.", - "itemtype": "method", - "name": "setAttribs", - "params": [ - { - "name": "attribs", - "description": "attribs", - "type": "Array" - } - ], - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 115, - "description": "Sets the current shader.", - "itemtype": "method", - "name": "setShader", - "params": [ - { - "name": "shader", - "description": "", - "type": "Any" - } - ], - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 135, - "description": "Destroys this object.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 5, - "itemtype": "method", - "name": "initDefaultShaders", - "static": 1, - "access": "private", - "tagname": "", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 14, - "itemtype": "method", - "name": "CompileVertexShader", - "static": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - }, - { - "name": "shaderSrc", - "description": "", - "type": "Array" - } - ], - "return": { - "description": "", - "type": "Any" - }, - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 26, - "itemtype": "method", - "name": "CompileFragmentShader", - "static": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - }, - { - "name": "shaderSrc", - "description": "", - "type": "Array" - } - ], - "return": { - "description": "", - "type": "Any" - }, - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 38, - "itemtype": "method", - "name": "_CompileShader", - "static": 1, - "access": "private", - "tagname": "", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - }, - { - "name": "shaderSrc", - "description": "", - "type": "Array" - }, - { - "name": "shaderType", - "description": "", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Any" - }, - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 63, - "itemtype": "method", - "name": "compileProgram", - "static": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - }, - { - "name": "vertexSrc", - "description": "", - "type": "Array" - }, - { - "name": "fragmentSrc", - "description": "", - "type": "Array" - } - ], - "return": { - "description": "", - "type": "Any" - }, - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 1, - "author": "Mat Groves\n\nBig thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\nfor creating the original pixi version!\n\nHeavily inspired by LibGDX's WebGLSpriteBatch:\nhttps://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 19, - "itemtype": "property", - "name": "vertSize", - "type": "Number", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 25, - "description": "The number of images in the SpriteBatch before it flushes", - "itemtype": "property", - "name": "size", - "type": "Number", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 37, - "description": "Holds the vertices", - "itemtype": "property", - "name": "vertices", - "type": "Float32Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 45, - "description": "Holds the indices", - "itemtype": "property", - "name": "indices", - "type": "Uint16Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 53, - "itemtype": "property", - "name": "lastIndexCount", - "type": "Number", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 69, - "itemtype": "property", - "name": "drawing", - "type": "Boolean", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 75, - "itemtype": "property", - "name": "currentBatchSize", - "type": "Number", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 81, - "itemtype": "property", - "name": "currentBaseTexture", - "type": "BaseTexture", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 87, - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 93, - "itemtype": "property", - "name": "textures", - "type": "Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 99, - "itemtype": "property", - "name": "blendModes", - "type": "Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 105, - "itemtype": "property", - "name": "shaders", - "type": "Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 111, - "itemtype": "property", - "name": "sprites", - "type": "Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 117, - "itemtype": "property", - "name": "defaultShader", - "type": "AbstractFilter", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 132, - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 164, - "itemtype": "method", - "name": "begin", - "params": [ - { - "name": "renderSession", - "description": "The RenderSession object", - "type": "Object" - } - ], - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 176, - "itemtype": "method", - "name": "end", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 184, - "itemtype": "method", - "name": "render", - "params": [ - { - "name": "sprite", - "description": "the sprite to render when using this spritebatch", - "type": "Sprite" - } - ], - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 297, - "description": "Renders a TilingSprite using the spriteBatch.", - "itemtype": "method", - "name": "renderTilingSprite", - "params": [ - { - "name": "sprite", - "description": "the tilingSprite to render", - "type": "TilingSprite" - } - ], - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 418, - "description": "Renders the content and empties the current batch.", - "itemtype": "method", - "name": "flush", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 542, - "itemtype": "method", - "name": "renderBatch", - "params": [ - { - "name": "texture", - "description": "", - "type": "Texture" - }, - { - "name": "size", - "description": "", - "type": "Number" - }, - { - "name": "startIndex", - "description": "", - "type": "Number" - } - ], - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 572, - "itemtype": "method", - "name": "stop", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 581, - "itemtype": "method", - "name": "start", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 589, - "description": "Destroys the SpriteBatch.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 17, - "description": "Sets the drawing context to the one given in parameter.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 28, - "description": "Applies the Mask and adds it to the current filter stack.", - "itemtype": "method", - "name": "pushMask", - "params": [ - { - "name": "graphics", - "description": "", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Array" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 120, - "description": "TODO this does not belong here!", - "itemtype": "method", - "name": "bindGraphics", - "params": [ - { - "name": "graphics", - "description": "", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Array" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 190, - "itemtype": "method", - "name": "popStencil", - "params": [ - { - "name": "graphics", - "description": "", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Array" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 285, - "description": "Destroys the mask stack.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 46, - "itemtype": "property", - "name": "type", - "type": "Number", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 52, - "description": "The resolution of the renderer", - "itemtype": "property", - "name": "resolution", - "type": "Number", - "default": "1", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 63, - "description": "Whether the render view is transparent", - "itemtype": "property", - "name": "transparent", - "type": "Boolean", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 71, - "description": "Whether the render view should be resized automatically", - "itemtype": "property", - "name": "autoResize", - "type": "Boolean", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 79, - "description": "The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering.", - "itemtype": "property", - "name": "preserveDrawingBuffer", - "type": "Boolean", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 87, - "description": "This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true:\nIf the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0).\nIf the Stage is transparent, Pixi will clear to the target Stage's background color.\nDisable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set.", - "itemtype": "property", - "name": "clearBeforeRender", - "type": "Boolean", - "default": "", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 99, - "description": "The width of the canvas view", - "itemtype": "property", - "name": "width", - "type": "Number", - "default": "800", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 108, - "description": "The height of the canvas view", - "itemtype": "property", - "name": "height", - "type": "Number", - "default": "600", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 117, - "description": "The canvas element that everything is drawn to", - "itemtype": "property", - "name": "view", - "type": "HTMLCanvasElement", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 127, - "itemtype": "property", - "name": "contextLostBound", - "type": "Function", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 133, - "itemtype": "property", - "name": "contextRestoredBound", - "type": "Function", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 142, - "itemtype": "property", - "name": "_contextOptions", - "type": "Object", - "access": "private", - "tagname": "", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 155, - "itemtype": "property", - "name": "projection", - "type": "Point", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 161, - "itemtype": "property", - "name": "offset", - "type": "Point", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 169, - "description": "Deals with managing the shader programs and their attribs", - "itemtype": "property", - "name": "shaderManager", - "type": "WebGLShaderManager", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 176, - "description": "Manages the rendering of sprites", - "itemtype": "property", - "name": "spriteBatch", - "type": "WebGLSpriteBatch", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 183, - "description": "Manages the masks using the stencil buffer", - "itemtype": "property", - "name": "maskManager", - "type": "WebGLMaskManager", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 190, - "description": "Manages the filters", - "itemtype": "property", - "name": "filterManager", - "type": "WebGLFilterManager", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 197, - "description": "Manages the stencil buffer", - "itemtype": "property", - "name": "stencilManager", - "type": "WebGLStencilManager", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 204, - "description": "Manages the blendModes", - "itemtype": "property", - "name": "blendModeManager", - "type": "WebGLBlendModeManager", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 211, - "description": "TODO remove", - "itemtype": "property", - "name": "renderSession", - "type": "Object", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 238, - "itemtype": "method", - "name": "initContext", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 276, - "description": "Renders the stage to its webGL view", - "itemtype": "method", - "name": "render", - "params": [ - { - "name": "stage", - "description": "the Stage element to be rendered", - "type": "Stage" - } - ], - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 344, - "description": "Renders a Display Object.", - "itemtype": "method", - "name": "renderDisplayObject", - "params": [ - { - "name": "displayObject", - "description": "The DisplayObject to render", - "type": "DisplayObject" - }, - { - "name": "projection", - "description": "The projection", - "type": "Point" - }, - { - "name": "buffer", - "description": "a standard WebGL buffer", - "type": "Array" - } - ], - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 378, - "description": "Resizes the webGL view to the specified width and height.", - "itemtype": "method", - "name": "resize", - "params": [ - { - "name": "width", - "description": "the new width of the webGL view", - "type": "Number" - }, - { - "name": "height", - "description": "the new height of the webGL view", - "type": "Number" - } - ], - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 404, - "description": "Updates and Creates a WebGL texture for the renderers context.", - "itemtype": "method", - "name": "updateTexture", - "params": [ - { - "name": "texture", - "description": "the texture to update", - "type": "Texture" - } - ], - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 443, - "description": "Handles a lost webgl context", - "itemtype": "method", - "name": "handleContextLost", - "params": [ - { - "name": "event", - "description": "", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 456, - "description": "Handles a restored webgl context", - "itemtype": "method", - "name": "handleContextRestored", - "params": [ - { - "name": "event", - "description": "", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 477, - "description": "Removes everything from the renderer (event listeners, spritebatch, etc...)", - "itemtype": "method", - "name": "destroy", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 508, - "description": "Maps Pixi blend modes to WebGL blend modes.", - "itemtype": "method", - "name": "mapBlendModes", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 23, - "description": "[read-only] The width of the overall text, different from fontSize,\nwhich is defined in the style object", - "itemtype": "property", - "name": "textWidth", - "type": "Number", - "readonly": "", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 33, - "description": "[read-only] The height of the overall text, different from fontSize,\nwhich is defined in the style object", - "itemtype": "property", - "name": "textHeight", - "type": "Number", - "readonly": "", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 43, - "itemtype": "property", - "name": "_pool", - "type": "Array", - "access": "private", - "tagname": "", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 54, - "description": "The dirty state of this object.", - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 66, - "description": "Set the text string to be rendered.", - "itemtype": "method", - "name": "setText", - "params": [ - { - "name": "text", - "description": "The text that you would like displayed", - "type": "String" - } - ], - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 78, - "description": "Set the style of the text\nstyle.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)\n[style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single lines of text", - "itemtype": "method", - "name": "setStyle", - "params": [ - { - "name": "style", - "description": "The style parameters, contained as properties of an object", - "type": "Object" - } - ], - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 100, - "description": "Renders text and updates it when needed", - "itemtype": "method", - "name": "updateText", - "access": "private", - "tagname": "", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 198, - "description": "Updates the transform of this object", - "itemtype": "method", - "name": "updateTransform", - "access": "private", - "tagname": "", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/Text.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23\nModified by Tom Slezakowski http://www.tomslezakowski.com @TomSlezakowski (24/03/2014) - Added dropShadowColor.", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 29, - "description": "The canvas element that everything is drawn to", - "itemtype": "property", - "name": "canvas", - "type": "HTMLCanvasElement", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 37, - "description": "The canvas 2d context that everything is drawn with", - "itemtype": "property", - "name": "context", - "type": "HTMLCanvasElement", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 44, - "description": "The resolution of the canvas.", - "itemtype": "property", - "name": "resolution", - "type": "Number", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 62, - "description": "The width of the Text, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 86, - "description": "The height of the Text, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 110, - "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": "Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text", - "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, - "optdefault": "'black'" - }, - { - "name": "strokeThickness", - "description": "A number that represents the thickness of the stroke. Default is 0 (no stroke)", - "type": "Number", - "optional": true, - "optdefault": "0" - }, - { - "name": "wordWrap", - "description": "Indicates if word wrap should be used", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "wordWrapWidth", - "description": "The width at which text will wrap", - "type": "Number", - "optional": true, - "optdefault": "100" - }, - { - "name": "dropShadow", - "description": "Set a drop shadow for the text", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "dropShadowColor", - "description": "A fill style to be used on the dropshadow e.g 'red', '#00FF00'", - "type": "String", - "optional": true, - "optdefault": "'#000000'" - }, - { - "name": "dropShadowAngle", - "description": "Set a angle of the drop shadow", - "type": "Number", - "optional": true, - "optdefault": "Math.PI/4" - }, - { - "name": "dropShadowDistance", - "description": "Set a distance of the drop shadow", - "type": "Number", - "optional": true, - "optdefault": "5" - } - ] - }, - { - "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": 147, - "description": "Set the copy for the text object. To split a line you can use '\\n'.", - "itemtype": "method", - "name": "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": 159, - "description": "Renders text and updates it when needed", - "itemtype": "method", - "name": "updateText", - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 281, - "description": "Updates texture size based on canvas size", - "itemtype": "method", - "name": "updateTexture", - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 301, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 321, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 341, - "description": "Calculates the ascent, descent and fontSize of a given fontStyle", - "itemtype": "method", - "name": "determineFontProperties", - "params": [ - { - "name": "fontStyle", - "description": "", - "type": "Object" - } - ], - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 444, - "description": "Applies newlines to a string to have it optimally fit into the horizontal\nbounds set by the Text object's wordWrapWidth property.", - "itemtype": "method", - "name": "wordWrap", - "params": [ - { - "name": "text", - "description": "", - "type": "String" - } - ], - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 492, - "description": "Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account.", - "itemtype": "method", - "name": "getBounds", - "params": [ - { - "name": "matrix", - "description": "the transformation matrix of the Text", - "type": "Matrix" - } - ], - "return": { - "description": "the framing rectangle", - "type": "Rectangle" - }, - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 510, - "description": "Destroys this text object.", - "itemtype": "method", - "name": "destroy", - "params": [ - { - "name": "destroyBaseTexture", - "description": "whether to destroy the base texture as well", - "type": "Boolean" - } - ], - "class": "Text" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 20, - "description": "The Resolution of the texture.", - "itemtype": "property", - "name": "resolution", - "type": "Number", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 28, - "description": "[read-only] The width of the base texture set when the image has loaded", - "itemtype": "property", - "name": "width", - "type": "Number", - "readonly": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 37, - "description": "[read-only] The height of the base texture set when the image has loaded", - "itemtype": "property", - "name": "height", - "type": "Number", - "readonly": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 46, - "description": "The scale mode to apply when scaling this texture", - "itemtype": "property", - "name": "scaleMode", - "type": "PIXI.scaleModes", - "default": "PIXI.scaleModes.LINEAR", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 55, - "description": "[read-only] Set to true once the base texture has loaded", - "itemtype": "property", - "name": "hasLoaded", - "type": "Boolean", - "readonly": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 64, - "description": "The image source that is used to create the texture.", - "itemtype": "property", - "name": "source", - "type": "Image", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 74, - "description": "Controls if RGB channels should be pre-multiplied by Alpha (WebGL only)", - "itemtype": "property", - "name": "premultipliedAlpha", - "type": "Boolean", - "default": "true", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 85, - "itemtype": "property", - "name": "_glTextures", - "type": "Array", - "access": "private", - "tagname": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 95, - "itemtype": "property", - "name": "_dirty", - "type": "Array", - "access": "private", - "tagname": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 132, - "itemtype": "property", - "name": "imageUrl", - "type": "String", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 138, - "itemtype": "property", - "name": "_powerOf2", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 151, - "description": "Destroys this base texture", - "itemtype": "method", - "name": "destroy", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 174, - "description": "Changes the source image of the texture", - "itemtype": "method", - "name": "updateSourceImage", - "params": [ - { - "name": "newSrc", - "description": "the path of the image", - "type": "String" - } - ], - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 187, - "description": "Sets all glTextures to be dirty.", - "itemtype": "method", - "name": "dirty", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 200, - "description": "Removes the base texture from the GPU, useful for managing resources on the GPU.\nAtexture is still 100% usable and will simply be reuploaded if there is a sprite on screen that is using it.", - "itemtype": "method", - "name": "unloadFromGPU", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 228, - "description": "Helper function that creates a base texture from the given image url.\nIf the image is not in the base texture cache it will be created and loaded.", - "static": 1, - "itemtype": "method", - "name": "fromImage", - "params": [ - { - "name": "imageUrl", - "description": "The image url of the texture", - "type": "String" - }, - { - "name": "crossorigin", - "description": "", - "type": "Boolean" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ], - "return": { - "description": "BaseTexture" - }, - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 270, - "description": "Helper function that creates a base texture from the given canvas element.", - "static": 1, - "itemtype": "method", - "name": "fromCanvas", - "params": [ - { - "name": "canvas", - "description": "The canvas element source of the texture", - "type": "Canvas" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ], - "return": { - "description": "BaseTexture" - }, - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 37, - "description": "The with of the render texture", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 45, - "description": "The height of the render texture", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 53, - "description": "The Resolution of the texture.", - "itemtype": "property", - "name": "resolution", - "type": "Number", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 61, - "description": "The framing rectangle of the render texture", - "itemtype": "property", - "name": "frame", - "type": "Rectangle", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 69, - "description": "This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,\nirrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)", - "itemtype": "property", - "name": "crop", - "type": "Rectangle", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 78, - "description": "The base texture object that this texture uses", - "itemtype": "property", - "name": "baseTexture", - "type": "BaseTexture", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 99, - "description": "The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL.", - "itemtype": "property", - "name": "renderer", - "type": "CanvasRenderer|WebGLRenderer", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 125, - "itemtype": "property", - "name": "valid", - "type": "Boolean", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 137, - "description": "Resizes the RenderTexture.", - "itemtype": "method", - "name": "resize", - "params": [ - { - "name": "width", - "description": "The width to resize to.", - "type": "Number" - }, - { - "name": "height", - "description": "The height to resize to.", - "type": "Number" - }, - { - "name": "updateBase", - "description": "Should the baseTexture.width and height values be resized as well?", - "type": "Boolean" - } - ], - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 171, - "description": "Clears the RenderTexture.", - "itemtype": "method", - "name": "clear", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 188, - "description": "This function will draw the display object to the texture.", - "itemtype": "method", - "name": "renderWebGL", - "params": [ - { - "name": "displayObject", - "description": "The display object to render this texture on", - "type": "DisplayObject" - }, - { - "name": "matrix", - "description": "Optional matrix to apply to the display object before rendering.", - "type": "Matrix", - "optional": true - }, - { - "name": "clear", - "description": "If true the texture will be cleared before the displayObject is drawn", - "type": "Boolean", - "optional": true - } - ], - "access": "private", - "tagname": "", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 237, - "description": "This function will draw the display object to the texture.", - "itemtype": "method", - "name": "renderCanvas", - "params": [ - { - "name": "displayObject", - "description": "The display object to render this texture on", - "type": "DisplayObject" - }, - { - "name": "matrix", - "description": "Optional matrix to apply to the display object before rendering.", - "type": "Matrix", - "optional": true - }, - { - "name": "clear", - "description": "If true the texture will be cleared before the displayObject is drawn", - "type": "Boolean", - "optional": true - } - ], - "access": "private", - "tagname": "", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 278, - "description": "Will return a HTML Image of the texture", - "itemtype": "method", - "name": "getImage", - "return": { - "description": "", - "type": "Image" - }, - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 291, - "description": "Will return a a base64 encoded string of this texture. It works by calling RenderTexture.getCanvas and then running toDataURL on that.", - "itemtype": "method", - "name": "getBase64", - "return": { - "description": "A base64 encoded string of the texture.", - "type": "String" - }, - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 302, - "description": "Creates a Canvas element, renders this RenderTexture to it and then returns it.", - "itemtype": "method", - "name": "getCanvas", - "return": { - "description": "A Canvas element with the texture rendered on.", - "type": "HTMLCanvasElement" - }, - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 24, - "description": "Does this Texture have any frame data assigned to it?", - "itemtype": "property", - "name": "noFrame", - "type": "Boolean", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 43, - "description": "The base texture that this texture uses.", - "itemtype": "property", - "name": "baseTexture", - "type": "BaseTexture", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 51, - "description": "The frame specifies the region of the base texture that this texture uses", - "itemtype": "property", - "name": "frame", - "type": "Rectangle", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 59, - "description": "The texture trim data.", - "itemtype": "property", - "name": "trim", - "type": "Rectangle", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 67, - "description": "This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.", - "itemtype": "property", - "name": "valid", - "type": "Boolean", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 75, - "description": "This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)", - "itemtype": "property", - "name": "requiresUpdate", - "type": "Boolean", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 83, - "description": "The WebGL UV data cache.", - "itemtype": "property", - "name": "_uvs", - "type": "Object", - "access": "private", - "tagname": "", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 92, - "description": "The width of the Texture in pixels.", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 100, - "description": "The height of the Texture in pixels.", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 108, - "description": "This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,\nirrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)", - "itemtype": "property", - "name": "crop", - "type": "Rectangle", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 131, - "description": "Called when the base texture is loaded", - "itemtype": "method", - "name": "onBaseTextureLoaded", - "access": "private", - "tagname": "", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 149, - "description": "Destroys this texture", - "itemtype": "method", - "name": "destroy", - "params": [ - { - "name": "destroyBase", - "description": "Whether to destroy the base texture as well", - "type": "Boolean" - } - ], - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 162, - "description": "Specifies the region of the baseTexture that this texture will use.", - "itemtype": "method", - "name": "setFrame", - "params": [ - { - "name": "frame", - "description": "The frame of the texture to set it to", - "type": "Rectangle" - } - ], - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 200, - "description": "Updates the internal WebGL UV cache.", - "itemtype": "method", - "name": "_updateUvs", - "access": "private", - "tagname": "", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 227, - "description": "Helper function that creates a Texture object from the given image url.\nIf the image is not in the texture cache it will be created and loaded.", - "static": 1, - "itemtype": "method", - "name": "fromImage", - "params": [ - { - "name": "imageUrl", - "description": "The image url of the texture", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ], - "return": { - "description": "Texture" - }, - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 251, - "description": "Helper function that returns a Texture objected based on the given frame id.\nIf the frame id is not in the texture cache an error will be thrown.", - "static": 1, - "itemtype": "method", - "name": "fromFrame", - "params": [ - { - "name": "frameId", - "description": "The frame id of the texture", - "type": "String" - } - ], - "return": { - "description": "Texture" - }, - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 267, - "description": "Helper function that creates a new a Texture based on the given canvas element.", - "static": 1, - "itemtype": "method", - "name": "fromCanvas", - "params": [ - { - "name": "canvas", - "description": "The canvas element source of the texture", - "type": "Canvas" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ], - "return": { - "description": "Texture" - }, - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 284, - "description": "Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object.", - "static": 1, - "itemtype": "method", - "name": "addTextureToCache", - "params": [ - { - "name": "texture", - "description": "The Texture to add to the cache.", - "type": "Texture" - }, - { - "name": "id", - "description": "The id that the texture will be stored against.", - "type": "String" - } - ], - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 297, - "description": "Remove a texture from the global PIXI.TextureCache.", - "static": 1, - "itemtype": "method", - "name": "removeTextureFromCache", - "params": [ - { - "name": "id", - "description": "The id of the texture to be removed", - "type": "String" - } - ], - "return": { - "description": "The texture that was removed", - "type": "Texture" - }, - "class": "Texture" - }, - { - "file": "src/pixi/textures/VideoTexture.js", - "line": 87, - "description": "Mimic Pixi BaseTexture.from.... method.", - "params": [ - { - "name": "video", - "description": "" - }, - { - "name": "scaleMode", - "description": "" - } - ], - "return": { - "description": "", - "type": "PIXI.VideoTexture" - }, - "class": "autoDetectRenderer" - }, - { - "file": "src/pixi/textures/VideoTexture.js", - "line": 126, - "description": "Mimic PIXI Texture.from... method.", - "params": [ - { - "name": "video", - "description": "" - }, - { - "name": "scaleMode", - "description": "" - } - ], - "return": { - "description": "", - "type": "PIXI.Texture" - }, - "class": "autoDetectRenderer" - }, - { - "file": "src/pixi/utils/Detector.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "autoDetectRenderer" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 1, - "author": "Chad Engler https://github.com/englercj @Rolnaaba", - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 6, - "description": "Originally based on https://github.com/mrdoob/eventtarget.js/ from mr Doob.\nCurrently takes inspiration from the nodejs EventEmitter, EventEmitter3, and smokesignals", - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 24, - "description": "Backward compat from when this used to be a function", - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 34, - "description": "Mixes in the properties of the EventTarget prototype onto another object", - "itemtype": "method", - "name": "mixin", - "params": [ - { - "name": "object", - "description": "The obj to mix into", - "type": "Object" - } - ], - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 41, - "description": "Return a list of assigned event listeners.", - "itemtype": "method", - "name": "listeners", - "params": [ - { - "name": "eventName", - "description": "The events that should be listed.", - "type": "String" - } - ], - "return": { - "description": "An array of listener functions", - "type": "Array" - }, - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 54, - "description": "Emit an event to all registered event listeners.", - "itemtype": "method", - "name": "emit", - "alias": "dispatchEvent", - "params": [ - { - "name": "eventName", - "description": "The name of the event.", - "type": "String" - } - ], - "return": { - "description": "Indication if we've emitted an event.", - "type": "Boolean" - }, - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 107, - "description": "Register a new EventListener for the given event.", - "itemtype": "method", - "name": "on", - "alias": "addEventListener", - "params": [ - { - "name": "eventName", - "description": "Name of the event.", - "type": "String" - }, - { - "name": "callback", - "description": "fn Callback function.", - "type": "Functon" - } - ], - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 124, - "description": "Add an EventListener that's only called once.", - "itemtype": "method", - "name": "once", - "params": [ - { - "name": "eventName", - "description": "Name of the event.", - "type": "String" - }, - { - "name": "callback", - "description": "Callback function.", - "type": "Function" - } - ], - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 143, - "description": "Remove event listeners.", - "itemtype": "method", - "name": "off", - "alias": "removeEventListener", - "params": [ - { - "name": "eventName", - "description": "The event we want to remove.", - "type": "String" - }, - { - "name": "callback", - "description": "The listener that we need to find.", - "type": "Function" - } - ], - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 173, - "description": "Remove all listeners or only the listeners for the specified event.", - "itemtype": "method", - "name": "removeAllListeners", - "params": [ - { - "name": "eventName", - "description": "The event you want to remove all listeners for.", - "type": "String" - } - ], - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 206, - "description": "Tracks the state of bubbling propagation. Do not\nset this directly, instead use `event.stopPropagation()`", - "itemtype": "property", - "name": "stopped", - "type": "Boolean", - "access": "private", - "tagname": "", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 217, - "description": "Tracks the state of sibling listener propagation. Do not\nset this directly, instead use `event.stopImmediatePropagation()`", - "itemtype": "property", - "name": "stoppedImmediate", - "type": "Boolean", - "access": "private", - "tagname": "", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 228, - "description": "The original target the event triggered on.", - "itemtype": "property", - "name": "target", - "type": "Object", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 237, - "description": "The string name of the event that this represents.", - "itemtype": "property", - "name": "type", - "type": "String", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 246, - "description": "The data that was passed in with this event.", - "itemtype": "property", - "name": "data", - "type": "Object", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 258, - "description": "The timestamp when the event occurred.", - "itemtype": "property", - "name": "timeStamp", - "type": "Number", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 268, - "description": "Stops the propagation of events up the scene graph (prevents bubbling).", - "itemtype": "method", - "name": "stopPropagation", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 277, - "description": "Stops the propagation of events to sibling listeners (no longer calls any listeners).", - "itemtype": "method", - "name": "stopImmediatePropagation", - "class": "Event" - }, - { - "file": "src/pixi/utils/Polyk.js", - "line": 42, - "description": "Triangulates shapes for webGL graphic fills.", - "itemtype": "method", - "name": "Triangulate", - "class": "PolyK" - }, - { - "file": "src/pixi/utils/Polyk.js", - "line": 120, - "description": "Checks whether a point is within a triangle", - "itemtype": "method", - "name": "_PointInTriangle", - "params": [ - { - "name": "px", - "description": "x coordinate of the point to test", - "type": "Number" - }, - { - "name": "py", - "description": "y coordinate of the point to test", - "type": "Number" - }, - { - "name": "ax", - "description": "x coordinate of the a point of the triangle", - "type": "Number" - }, - { - "name": "ay", - "description": "y coordinate of the a point of the triangle", - "type": "Number" - }, - { - "name": "bx", - "description": "x coordinate of the b point of the triangle", - "type": "Number" - }, - { - "name": "by", - "description": "y coordinate of the b point of the triangle", - "type": "Number" - }, - { - "name": "cx", - "description": "x coordinate of the c point of the triangle", - "type": "Number" - }, - { - "name": "cy", - "description": "y coordinate of the c point of the triangle", - "type": "Number" - } - ], - "access": "private", - "tagname": "", - "return": { - "description": "", - "type": "Boolean" - }, - "class": "PolyK" - }, - { - "file": "src/pixi/utils/Polyk.js", - "line": 158, - "description": "Checks whether a shape is convex", - "itemtype": "method", - "name": "_convex", - "access": "private", - "tagname": "", - "return": { - "description": "", - "type": "Boolean" - }, - "class": "PolyK" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 12, - "description": "A polyfill for requestAnimationFrame\nYou can actually use both requestAnimationFrame and requestAnimFrame, \nyou will still benefit from the polyfill", - "itemtype": "method", - "name": "requestAnimationFrame", - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 20, - "description": "A polyfill for cancelAnimationFrame", - "itemtype": "method", - "name": "cancelAnimationFrame", - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 54, - "description": "Converts a hex color number to an [R, G, B] array", - "itemtype": "method", - "name": "hex2rgb", - "params": [ - { - "name": "hex", - "description": "", - "type": "Number" - } - ], - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 64, - "description": "Converts a color as an [R, G, B] array to a hex number", - "itemtype": "method", - "name": "rgb2hex", - "params": [ - { - "name": "rgb", - "description": "", - "type": "Array" - } - ], - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 74, - "description": "A polyfill for Function.prototype.bind", - "itemtype": "method", - "name": "bind", - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 168, - "description": "Checks whether the Canvas BlendModes are supported by the current browser", - "itemtype": "method", - "name": "canUseNewCanvasBlendModes", - "return": { - "description": "whether they are supported", - "type": "Boolean" - }, - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 189, - "description": "Given a number, this function returns the closest number that is a power of two\nthis function is taken from Starling Framework as its pretty neat ;)", - "itemtype": "method", - "name": "getNextPowerOfTwo", - "params": [ - { - "name": "number", - "description": "", - "type": "Number" - } - ], - "return": { - "description": "the closest number that is a power of two", - "type": "Number" - }, - "class": "AjaxRequest" - }, - { - "file": "src/pixi/InteractionData.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "InteractionData" - }, - { - "file": "src/pixi/InteractionData.js", - "line": 13, - "description": "This point stores the global coords of where the touch/mouse event happened", - "itemtype": "property", - "name": "global", - "type": "Point", - "class": "InteractionData" - }, - { - "file": "src/pixi/InteractionData.js", - "line": 21, - "description": "The target Sprite that was interacted with", - "itemtype": "property", - "name": "target", - "type": "Sprite", - "class": "InteractionData" - }, - { - "file": "src/pixi/InteractionData.js", - "line": 29, - "description": "When passed to an event handler, this will be the original DOM Event that was captured", - "itemtype": "property", - "name": "originalEvent", - "type": "Event", - "class": "InteractionData" - }, - { - "file": "src/pixi/InteractionData.js", - "line": 38, - "description": "This will return the local coordinates of the specified displayObject for this InteractionData", - "itemtype": "method", - "name": "getLocalPosition", - "params": [ - { - "name": "displayObject", - "description": "The DisplayObject that you would like the local coords off", - "type": "DisplayObject" - }, - { - "name": "point", - "description": "A Point object in which to store the value, optional (otherwise will create a new point)", - "type": "Point", - "optional": true - } - ], - "return": { - "description": "A point containing the coordinates of the InteractionData position relative to the DisplayObject", - "type": "Point" - }, - "class": "InteractionData" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 16, - "description": "A reference to the stage", - "itemtype": "property", - "name": "stage", - "type": "Stage", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 24, - "description": "The mouse data", - "itemtype": "property", - "name": "mouse", - "type": "InteractionData", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 32, - "description": "An object that stores current touches (InteractionData) by id reference", - "itemtype": "property", - "name": "touches", - "type": "Object", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 40, - "itemtype": "property", - "name": "tempPoint", - "type": "Point", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 47, - "itemtype": "property", - "name": "mouseoverEnabled", - "type": "Boolean", - "default": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 54, - "description": "Tiny little interactiveData pool !", - "itemtype": "property", - "name": "pool", - "type": "Array", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 62, - "description": "An array containing all the iterative items from the our interactive tree", - "itemtype": "property", - "name": "interactiveItems", - "type": "Array", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 70, - "description": "Our canvas", - "itemtype": "property", - "name": "interactionDOMElement", - "type": "HTMLCanvasElement", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 80, - "itemtype": "property", - "name": "onMouseMove", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 86, - "itemtype": "property", - "name": "onMouseDown", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 92, - "itemtype": "property", - "name": "onMouseOut", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 98, - "itemtype": "property", - "name": "onMouseUp", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 104, - "itemtype": "property", - "name": "onTouchStart", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 110, - "itemtype": "property", - "name": "onTouchEnd", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 116, - "itemtype": "property", - "name": "onTouchMove", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 122, - "itemtype": "property", - "name": "last", - "type": "Number", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 128, - "description": "The css style of the cursor that is being used", - "itemtype": "property", - "name": "currentCursorStyle", - "type": "String", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 135, - "description": "Is set to true when the mouse is moved out of the canvas", - "itemtype": "property", - "name": "mouseOut", - "type": "Boolean", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 142, - "itemtype": "property", - "name": "resolution", - "type": "Number", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 152, - "description": "Collects an interactive sprite recursively to have their interactions managed", - "itemtype": "method", - "name": "collectInteractiveSprite", - "params": [ - { - "name": "displayObject", - "description": "the displayObject to collect", - "type": "DisplayObject" - }, - { - "name": "iParent", - "description": "the display object's parent", - "type": "DisplayObject" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 193, - "description": "Sets the target for event delegation", - "itemtype": "method", - "name": "setTarget", - "params": [ - { - "name": "target", - "description": "the renderer to bind events to", - "type": "WebGLRenderer|CanvasRenderer" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 211, - "description": "Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM\nelements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element\nto receive those events", - "itemtype": "method", - "name": "setTargetDomElement", - "params": [ - { - "name": "domElement", - "description": "the DOM element which will receive mouse and touch events", - "type": "DOMElement" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 245, - "itemtype": "method", - "name": "removeEvents", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 270, - "description": "updates the state of interactive objects", - "itemtype": "method", - "name": "update", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 355, - "itemtype": "method", - "name": "rebuildInteractiveGraph", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 380, - "description": "Is called when the mouse moves across the renderer element", - "itemtype": "method", - "name": "onMouseMove", - "params": [ - { - "name": "event", - "description": "The DOM event of the mouse moving", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 416, - "description": "Is called when the mouse button is pressed down on the renderer element", - "itemtype": "method", - "name": "onMouseDown", - "params": [ - { - "name": "event", - "description": "The DOM event of a mouse button being pressed down", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 477, - "description": "Is called when the mouse is moved out of the renderer element", - "itemtype": "method", - "name": "onMouseOut", - "params": [ - { - "name": "event", - "description": "The DOM event of a mouse being moved out", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 518, - "description": "Is called when the mouse button is released on the renderer element", - "itemtype": "method", - "name": "onMouseUp", - "params": [ - { - "name": "event", - "description": "The DOM event of a mouse button being released", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 586, - "description": "Tests if the current mouse coordinates hit a sprite", - "itemtype": "method", - "name": "hitTest", - "params": [ - { - "name": "item", - "description": "The displayObject to test for a hit", - "type": "DisplayObject" - }, - { - "name": "interactionData", - "description": "The interactionData object to update in the case there is a hit", - "type": "InteractionData" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 683, - "description": "Is called when a touch is moved across the renderer element", - "itemtype": "method", - "name": "onTouchMove", - "params": [ - { - "name": "event", - "description": "The DOM event of a touch moving across the renderer view", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 729, - "description": "Is called when a touch is started on the renderer element", - "itemtype": "method", - "name": "onTouchStart", - "params": [ - { - "name": "event", - "description": "The DOM event of a touch starting on the renderer view", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 798, - "description": "Is called when a touch is ended on the renderer element", - "itemtype": "method", - "name": "onTouchEnd", - "params": [ - { - "name": "event", - "description": "The DOM event of a touch ending on the renderer view", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/Intro.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "" - }, - { - "file": "src/pixi/Outro.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "" - }, - { - "file": "src/pixi/Pixi.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "" - } - ], - "warnings": [ - { - "message": "unknown tag: copyright", - "line": " src/pixi/extras/Rope.js:1" - }, - { - "message": "replacing incorrect tag: returns with return", - "line": " src/pixi/textures/VideoTexture.js:87" - }, - { - "message": "replacing incorrect tag: returns with return", - "line": " src/pixi/textures/VideoTexture.js:126" - }, - { - "message": "replacing incorrect tag: returns with return", - "line": " src/pixi/utils/EventTarget.js:41" - }, - { - "message": "unknown tag: alias", - "line": " src/pixi/utils/EventTarget.js:54" - }, - { - "message": "replacing incorrect tag: returns with return", - "line": " src/pixi/utils/EventTarget.js:54" - }, - { - "message": "unknown tag: alias", - "line": " src/pixi/utils/EventTarget.js:107" - }, - { - "message": "unknown tag: alias", - "line": " src/pixi/utils/EventTarget.js:143" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/DisplayObject.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/DisplayObjectContainer.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/MovieClip.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/Sprite.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/SpriteBatch.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/Stage.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Rope.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:1" - }, - { - "message": "Missing item type\ncx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of", - "line": " src/pixi/extras/Spine.js:213" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:506" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:513" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:520" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:528" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:535" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:542" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:577" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:585" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:600" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:604" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:611" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:618" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:625" - }, - { - "message": "Missing item type\nfrom the new skin are attached if the corresponding attachment from the old skin was attached.", - "line": " src/pixi/extras/Spine.js:637" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:644" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:648" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:657" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:849" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:855" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:861" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:867" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:885" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:1310" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Strip.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/TilingSprite.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/AbstractFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/AlphaMaskFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/AsciiFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/BlurFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/BlurXFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/BlurYFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/ColorMatrixFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/ColorStepFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/CrossHatchFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/DisplacementFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/DotScreenFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/FilterBlock.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/GrayFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/InvertFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/NoiseFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/NormalMapFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/PixelateFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/RGBSplitFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/SepiaFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/SmartBlurFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/TiltShiftFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/TiltShiftXFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/TiltShiftYFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/TwistFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Circle.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Ellipse.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Matrix.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Point.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Polygon.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Rectangle.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/RoundedRectangle.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/AssetLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/AtlasLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/BitmapFontLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/ImageLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/JsonLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/SpineLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/SpriteSheetLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/primitives/Graphics.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/canvas/utils/CanvasBuffer.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/canvas/utils/CanvasMaskManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/canvas/utils/CanvasTinter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/canvas/CanvasGraphics.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/canvas/CanvasRenderer.js:1" - }, - { - "message": "Missing item type\nIf true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation.\nHandy for crisp pixel art and speed on legacy devices.", - "line": " src/pixi/renderers/canvas/CanvasRenderer.js:157" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/shaders/PixiFastShader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/shaders/PixiShader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/shaders/PrimitiveShader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/shaders/StripShader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/FilterTexture.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLFilterManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLGraphics.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLMaskManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLShaderManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLStencilManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/WebGLRenderer.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/text/BitmapText.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/text/Text.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/textures/BaseTexture.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/textures/RenderTexture.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/textures/Texture.js:1" - }, - { - "message": "Missing item type\nMimic Pixi BaseTexture.from.... method.", - "line": " src/pixi/textures/VideoTexture.js:87" - }, - { - "message": "Missing item type\nMimic PIXI Texture.from... method.", - "line": " src/pixi/textures/VideoTexture.js:126" - }, - { - "message": "Missing item type", - "line": " src/pixi/utils/Detector.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/utils/EventTarget.js:1" - }, - { - "message": "Missing item type\nOriginally based on https://github.com/mrdoob/eventtarget.js/ from mr Doob.\nCurrently takes inspiration from the nodejs EventEmitter, EventEmitter3, and smokesignals", - "line": " src/pixi/utils/EventTarget.js:6" - }, - { - "message": "Missing item type\nBackward compat from when this used to be a function", - "line": " src/pixi/utils/EventTarget.js:24" - }, - { - "message": "Missing item type", - "line": " src/pixi/utils/Utils.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/InteractionData.js:1" - }, - { - "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/Outro.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/Pixi.js:1" - } - ] -} \ No newline at end of file diff --git a/tutorial-1/pixi.js-master/docs/files/index.html b/tutorial-1/pixi.js-master/docs/files/index.html deleted file mode 100755 index 487fe15..0000000 --- a/tutorial-1/pixi.js-master/docs/files/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Redirector - - - - Click here to redirect - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_InteractionData.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_InteractionData.js.html deleted file mode 100755 index f913d34..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_InteractionData.js.html +++ /dev/null @@ -1,344 +0,0 @@ - - - - - src/pixi/InteractionData.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/InteractionData.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * Holds all information related to an Interaction event
    - *
    - * @class InteractionData
    - * @constructor
    - */
    -PIXI.InteractionData = function()
    -{
    -    /**
    -     * This point stores the global coords of where the touch/mouse event happened
    -     *
    -     * @property global
    -     * @type Point
    -     */
    -    this.global = new PIXI.Point();
    -
    -    /**
    -     * The target Sprite that was interacted with
    -     *
    -     * @property target
    -     * @type Sprite
    -     */
    -    this.target = null;
    -
    -    /**
    -     * When passed to an event handler, this will be the original DOM Event that was captured
    -     *
    -     * @property originalEvent
    -     * @type Event
    -     */
    -    this.originalEvent = null;
    -};
    -
    -/**
    - * This will return the local coordinates of the specified displayObject for this InteractionData
    - *
    - * @method getLocalPosition
    - * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off
    - * @param [point] {Point} A Point object in which to store the value, optional (otherwise will create a new point)
    - * @return {Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject
    - */
    -PIXI.InteractionData.prototype.getLocalPosition = function(displayObject, point)
    -{
    -    var worldTransform = displayObject.worldTransform;
    -    var global = this.global;
    -
    -    // do a cheeky transform to get the mouse coords;
    -    var a00 = worldTransform.a, a01 = worldTransform.c, a02 = worldTransform.tx,
    -        a10 = worldTransform.b, a11 = worldTransform.d, a12 = worldTransform.ty,
    -        id = 1 / (a00 * a11 + a01 * -a10);
    -
    -    point = point || new PIXI.Point();
    -
    -    point.x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id;
    -    point.y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id;
    -
    -    // set the mouse coords...
    -    return point;
    -};
    -
    -// constructor
    -PIXI.InteractionData.prototype.constructor = PIXI.InteractionData;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_InteractionManager.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_InteractionManager.js.html deleted file mode 100755 index 824229b..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_InteractionManager.js.html +++ /dev/null @@ -1,1156 +0,0 @@ - - - - - src/pixi/InteractionManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/InteractionManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    - /**
    - * The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive
    - * if its interactive parameter is set to true
    - * This manager also supports multitouch.
    - *
    - * @class InteractionManager
    - * @constructor
    - * @param stage {Stage} The stage to handle interactions
    - */
    -PIXI.InteractionManager = function(stage)
    -{
    -    /**
    -     * A reference to the stage
    -     *
    -     * @property stage
    -     * @type Stage
    -     */
    -    this.stage = stage;
    -
    -    /**
    -     * The mouse data
    -     *
    -     * @property mouse
    -     * @type InteractionData
    -     */
    -    this.mouse = new PIXI.InteractionData();
    -
    -    /**
    -     * An object that stores current touches (InteractionData) by id reference
    -     *
    -     * @property touches
    -     * @type Object
    -     */
    -    this.touches = {};
    -
    -    /**
    -     * @property tempPoint
    -     * @type Point
    -     * @private
    -     */
    -    this.tempPoint = new PIXI.Point();
    -
    -    /**
    -     * @property mouseoverEnabled
    -     * @type Boolean
    -     * @default
    -     */
    -    this.mouseoverEnabled = true;
    -
    -    /**
    -     * Tiny little interactiveData pool !
    -     *
    -     * @property pool
    -     * @type Array
    -     */
    -    this.pool = [];
    -
    -    /**
    -     * An array containing all the iterative items from the our interactive tree
    -     * @property interactiveItems
    -     * @type Array
    -     * @private
    -     */
    -    this.interactiveItems = [];
    -
    -    /**
    -     * Our canvas
    -     * @property interactionDOMElement
    -     * @type HTMLCanvasElement
    -     * @private
    -     */
    -    this.interactionDOMElement = null;
    -
    -    //this will make it so that you don't have to call bind all the time
    -
    -    /**
    -     * @property onMouseMove
    -     * @type Function
    -     */
    -    this.onMouseMove = this.onMouseMove.bind( this );
    -
    -    /**
    -     * @property onMouseDown
    -     * @type Function
    -     */
    -    this.onMouseDown = this.onMouseDown.bind(this);
    -
    -    /**
    -     * @property onMouseOut
    -     * @type Function
    -     */
    -    this.onMouseOut = this.onMouseOut.bind(this);
    -
    -    /**
    -     * @property onMouseUp
    -     * @type Function
    -     */
    -    this.onMouseUp = this.onMouseUp.bind(this);
    -
    -    /**
    -     * @property onTouchStart
    -     * @type Function
    -     */
    -    this.onTouchStart = this.onTouchStart.bind(this);
    -
    -    /**
    -     * @property onTouchEnd
    -     * @type Function
    -     */
    -    this.onTouchEnd = this.onTouchEnd.bind(this);
    -
    -    /**
    -     * @property onTouchMove
    -     * @type Function
    -     */
    -    this.onTouchMove = this.onTouchMove.bind(this);
    -
    -    /**
    -     * @property last
    -     * @type Number
    -     */
    -    this.last = 0;
    -
    -    /**
    -     * The css style of the cursor that is being used
    -     * @property currentCursorStyle
    -     * @type String
    -     */
    -    this.currentCursorStyle = 'inherit';
    -
    -    /**
    -     * Is set to true when the mouse is moved out of the canvas
    -     * @property mouseOut
    -     * @type Boolean
    -     */
    -    this.mouseOut = false;
    -
    -    /**
    -     * @property resolution
    -     * @type Number
    -     */
    -    this.resolution = 1;
    -};
    -
    -// constructor
    -PIXI.InteractionManager.prototype.constructor = PIXI.InteractionManager;
    -
    -/**
    - * Collects an interactive sprite recursively to have their interactions managed
    - *
    - * @method collectInteractiveSprite
    - * @param displayObject {DisplayObject} the displayObject to collect
    - * @param iParent {DisplayObject} the display object's parent
    - * @private
    - */
    -PIXI.InteractionManager.prototype.collectInteractiveSprite = function(displayObject, iParent)
    -{
    -    var children = displayObject.children;
    -    var length = children.length;
    -
    -    // make an interaction tree... {item.__interactiveParent}
    -    for (var i = length - 1; i >= 0; i--)
    -    {
    -        var child = children[i];
    -
    -        // push all interactive bits
    -        if (child._interactive)
    -        {
    -            iParent.interactiveChildren = true;
    -            //child.__iParent = iParent;
    -            this.interactiveItems.push(child);
    -
    -            if (child.children.length > 0) {
    -                this.collectInteractiveSprite(child, child);
    -            }
    -        }
    -        else
    -        {
    -            child.__iParent = null;
    -            if (child.children.length > 0)
    -            {
    -                this.collectInteractiveSprite(child, iParent);
    -            }
    -        }
    -
    -    }
    -};
    -
    -/**
    - * Sets the target for event delegation
    - *
    - * @method setTarget
    - * @param target {WebGLRenderer|CanvasRenderer} the renderer to bind events to
    - * @private
    - */
    -PIXI.InteractionManager.prototype.setTarget = function(target)
    -{
    -    this.target = target;
    -    this.resolution = target.resolution;
    -
    -    // Check if the dom element has been set. If it has don't do anything.
    -    if (this.interactionDOMElement !== null) return;
    -
    -    this.setTargetDomElement (target.view);
    -};
    -
    -/**
    - * Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM
    - * elements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element
    - * to receive those events
    - *
    - * @method setTargetDomElement
    - * @param domElement {DOMElement} the DOM element which will receive mouse and touch events
    - * @private
    - */
    -PIXI.InteractionManager.prototype.setTargetDomElement = function(domElement)
    -{
    -    this.removeEvents();
    -
    -    if (window.navigator.msPointerEnabled)
    -    {
    -        // time to remove some of that zoom in ja..
    -        domElement.style['-ms-content-zooming'] = 'none';
    -        domElement.style['-ms-touch-action'] = 'none';
    -    }
    -
    -    this.interactionDOMElement = domElement;
    -
    -    domElement.addEventListener('mousemove',  this.onMouseMove, true);
    -    domElement.addEventListener('mousedown',  this.onMouseDown, true);
    -    domElement.addEventListener('mouseout',   this.onMouseOut, true);
    -
    -    // aint no multi touch just yet!
    -    domElement.addEventListener('touchstart', this.onTouchStart, true);
    -    domElement.addEventListener('touchend', this.onTouchEnd, true);
    -    domElement.addEventListener('touchmove', this.onTouchMove, true);
    -
    -    window.addEventListener('mouseup',  this.onMouseUp, true);
    -};
    -
    -/**
    - * @method removeEvents
    - * @private
    - */
    -PIXI.InteractionManager.prototype.removeEvents = function()
    -{
    -    if (!this.interactionDOMElement) return;
    -
    -    this.interactionDOMElement.style['-ms-content-zooming'] = '';
    -    this.interactionDOMElement.style['-ms-touch-action'] = '';
    -
    -    this.interactionDOMElement.removeEventListener('mousemove',  this.onMouseMove, true);
    -    this.interactionDOMElement.removeEventListener('mousedown',  this.onMouseDown, true);
    -    this.interactionDOMElement.removeEventListener('mouseout',   this.onMouseOut, true);
    -
    -    // aint no multi touch just yet!
    -    this.interactionDOMElement.removeEventListener('touchstart', this.onTouchStart, true);
    -    this.interactionDOMElement.removeEventListener('touchend', this.onTouchEnd, true);
    -    this.interactionDOMElement.removeEventListener('touchmove', this.onTouchMove, true);
    -
    -    this.interactionDOMElement = null;
    -
    -    window.removeEventListener('mouseup',  this.onMouseUp, true);
    -};
    -
    -/**
    - * updates the state of interactive objects
    - *
    - * @method update
    - * @private
    - */
    -PIXI.InteractionManager.prototype.update = function()
    -{
    -    if (!this.target) return;
    -
    -    // frequency of 30fps??
    -    var now = Date.now();
    -    var diff = now - this.last;
    -    diff = (diff * PIXI.INTERACTION_FREQUENCY ) / 1000;
    -    if (diff < 1) return;
    -    this.last = now;
    -
    -    var i = 0;
    -
    -    // ok.. so mouse events??
    -    // yes for now :)
    -    // OPTIMISE - how often to check??
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    // loop through interactive objects!
    -    var length = this.interactiveItems.length;
    -    var cursor = 'inherit';
    -    var over = false;
    -
    -    for (i = 0; i < length; i++)
    -    {
    -        var item = this.interactiveItems[i];
    -
    -        // OPTIMISATION - only calculate every time if the mousemove function exists..
    -        // OK so.. does the object have any other interactive functions?
    -        // hit-test the clip!
    -       // if (item.mouseover || item.mouseout || item.buttonMode)
    -       // {
    -        // ok so there are some functions so lets hit test it..
    -        item.__hit = this.hitTest(item, this.mouse);
    -        this.mouse.target = item;
    -        // ok so deal with interactions..
    -        // looks like there was a hit!
    -        if (item.__hit && !over)
    -        {
    -            if (item.buttonMode) cursor = item.defaultCursor;
    -
    -            if (!item.interactiveChildren)
    -            {
    -                over = true;
    -            }
    -
    -            if (!item.__isOver)
    -            {
    -                if (item.mouseover)
    -                {
    -                    item.mouseover (this.mouse);
    -                }
    -                item.__isOver = true;
    -            }
    -        }
    -        else
    -        {
    -            if (item.__isOver)
    -            {
    -                // roll out!
    -                if (item.mouseout)
    -                {
    -                    item.mouseout (this.mouse);
    -                }
    -                item.__isOver = false;
    -            }
    -        }
    -    }
    -
    -    if (this.currentCursorStyle !== cursor)
    -    {
    -        this.currentCursorStyle = cursor;
    -        this.interactionDOMElement.style.cursor = cursor;
    -    }
    -};
    -
    -/**
    - * @method rebuildInteractiveGraph
    - * @private
    - */
    -PIXI.InteractionManager.prototype.rebuildInteractiveGraph = function()
    -{
    -    this.dirty = false;
    -
    -    var len = this.interactiveItems.length;
    -
    -    for (var i = 0; i < len; i++) {
    -        this.interactiveItems[i].interactiveChildren = false;
    -    }
    -
    -    this.interactiveItems = [];
    -
    -    if (this.stage.interactive)
    -    {
    -        this.interactiveItems.push(this.stage);
    -    }
    -
    -    // Go through and collect all the objects that are interactive..
    -    this.collectInteractiveSprite(this.stage, this.stage);
    -};
    -
    -/**
    - * Is called when the mouse moves across the renderer element
    - *
    - * @method onMouseMove
    - * @param event {Event} The DOM event of the mouse moving
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onMouseMove = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    this.mouse.originalEvent = event;
    -
    -    // TODO optimize by not check EVERY TIME! maybe half as often? //
    -    var rect = this.interactionDOMElement.getBoundingClientRect();
    -
    -    this.mouse.global.x = (event.clientX - rect.left) * (this.target.width / rect.width) / this.resolution;
    -    this.mouse.global.y = (event.clientY - rect.top) * ( this.target.height / rect.height) / this.resolution;
    -
    -    var length = this.interactiveItems.length;
    -
    -    for (var i = 0; i < length; i++)
    -    {
    -        var item = this.interactiveItems[i];
    -
    -        // Call the function!
    -        if (item.mousemove)
    -        {
    -            item.mousemove(this.mouse);
    -        }
    -    }
    -};
    -
    -/**
    - * Is called when the mouse button is pressed down on the renderer element
    - *
    - * @method onMouseDown
    - * @param event {Event} The DOM event of a mouse button being pressed down
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onMouseDown = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    this.mouse.originalEvent = event;
    -
    -    if (PIXI.AUTO_PREVENT_DEFAULT)
    -    {
    -        this.mouse.originalEvent.preventDefault();
    -    }
    -
    -    // loop through interaction tree...
    -    // hit test each item! ->
    -    // get interactive items under point??
    -    //stage.__i
    -    var length = this.interactiveItems.length;
    -
    -    var e = this.mouse.originalEvent;
    -    var isRightButton = e.button === 2 || e.which === 3;
    -    var downFunction = isRightButton ? 'rightdown' : 'mousedown';
    -    var clickFunction = isRightButton ? 'rightclick' : 'click';
    -    var buttonIsDown = isRightButton ? '__rightIsDown' : '__mouseIsDown';
    -    var isDown = isRightButton ? '__isRightDown' : '__isDown';
    -
    -    // while
    -    // hit test
    -    for (var i = 0; i < length; i++)
    -    {
    -        var item = this.interactiveItems[i];
    -
    -        if (item[downFunction] || item[clickFunction])
    -        {
    -            item[buttonIsDown] = true;
    -            item.__hit = this.hitTest(item, this.mouse);
    -
    -            if (item.__hit)
    -            {
    -                //call the function!
    -                if (item[downFunction])
    -                {
    -                    item[downFunction](this.mouse);
    -                }
    -                item[isDown] = true;
    -
    -                // just the one!
    -                if (!item.interactiveChildren) break;
    -            }
    -        }
    -    }
    -};
    -
    -/**
    - * Is called when the mouse is moved out of the renderer element
    - *
    - * @method onMouseOut
    - * @param event {Event} The DOM event of a mouse being moved out
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onMouseOut = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    this.mouse.originalEvent = event;
    -
    -    var length = this.interactiveItems.length;
    -
    -    this.interactionDOMElement.style.cursor = 'inherit';
    -
    -    for (var i = 0; i < length; i++)
    -    {
    -        var item = this.interactiveItems[i];
    -        if (item.__isOver)
    -        {
    -            this.mouse.target = item;
    -            if (item.mouseout)
    -            {
    -                item.mouseout(this.mouse);
    -            }
    -            item.__isOver = false;
    -        }
    -    }
    -
    -    this.mouseOut = true;
    -
    -    // move the mouse to an impossible position
    -    this.mouse.global.x = -10000;
    -    this.mouse.global.y = -10000;
    -};
    -
    -/**
    - * Is called when the mouse button is released on the renderer element
    - *
    - * @method onMouseUp
    - * @param event {Event} The DOM event of a mouse button being released
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onMouseUp = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    this.mouse.originalEvent = event;
    -
    -    var length = this.interactiveItems.length;
    -    var up = false;
    -
    -    var e = this.mouse.originalEvent;
    -    var isRightButton = e.button === 2 || e.which === 3;
    -
    -    var upFunction = isRightButton ? 'rightup' : 'mouseup';
    -    var clickFunction = isRightButton ? 'rightclick' : 'click';
    -    var upOutsideFunction = isRightButton ? 'rightupoutside' : 'mouseupoutside';
    -    var isDown = isRightButton ? '__isRightDown' : '__isDown';
    -
    -    for (var i = 0; i < length; i++)
    -    {
    -        var item = this.interactiveItems[i];
    -
    -        if (item[clickFunction] || item[upFunction] || item[upOutsideFunction])
    -        {
    -            item.__hit = this.hitTest(item, this.mouse);
    -
    -            if (item.__hit && !up)
    -            {
    -                //call the function!
    -                if (item[upFunction])
    -                {
    -                    item[upFunction](this.mouse);
    -                }
    -                if (item[isDown])
    -                {
    -                    if (item[clickFunction])
    -                    {
    -                        item[clickFunction](this.mouse);
    -                    }
    -                }
    -
    -                if (!item.interactiveChildren)
    -                {
    -                    up = true;
    -                }
    -            }
    -            else
    -            {
    -                if (item[isDown])
    -                {
    -                    if (item[upOutsideFunction]) item[upOutsideFunction](this.mouse);
    -                }
    -            }
    -
    -            item[isDown] = false;
    -        }
    -    }
    -};
    -
    -/**
    - * Tests if the current mouse coordinates hit a sprite
    - *
    - * @method hitTest
    - * @param item {DisplayObject} The displayObject to test for a hit
    - * @param interactionData {InteractionData} The interactionData object to update in the case there is a hit
    - * @private
    - */
    -PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
    -{
    -    var global = interactionData.global;
    -
    -    if (!item.worldVisible)
    -    {
    -        return false;
    -    }
    -
    -    // temp fix for if the element is in a non visible
    -
    -    var worldTransform = item.worldTransform, i,
    -        a = worldTransform.a, b = worldTransform.b,
    -        c = worldTransform.c, tx = worldTransform.tx,
    -        d = worldTransform.d, ty = worldTransform.ty,
    -     
    -        id = 1 / (a * d + c * -b),
    -        x = d * id * global.x + -c * id * global.y + (ty * c - tx * d) * id,
    -        y = a * id * global.y + -b * id * global.x + (-ty * a + tx * b) * id;
    -
    -
    -    interactionData.target = item;
    -
    -    //a sprite or display object with a hit area defined
    -    if (item.hitArea && item.hitArea.contains)
    -    {
    -        if (item.hitArea.contains(x, y))
    -        {
    -            interactionData.target = item;
    -            return true;
    -        }
    -        return false;
    -    }
    -    // a sprite with no hitarea defined
    -    else if(item instanceof PIXI.Sprite)
    -    {
    -        var width = item.texture.frame.width;
    -        var height = item.texture.frame.height;
    -        var x1 = -width * item.anchor.x;
    -        var y1;
    -
    -        if (x > x1 && x < x1 + width)
    -        {
    -            y1 = -height * item.anchor.y;
    -
    -            if (y > y1 && y < y1 + height)
    -            {
    -                // set the target property if a hit is true!
    -                interactionData.target = item;
    -                return true;
    -            }
    -        }
    -    }
    -    else if(item instanceof PIXI.Graphics)
    -    {
    -        var graphicsData = item.graphicsData;
    -        for (i = 0; i < graphicsData.length; i++)
    -        {
    -            var data = graphicsData[i];
    -            if(!data.fill)continue;
    -
    -            // only deal with fills..
    -            if(data.shape)
    -            {
    -                if(data.shape.contains(x, y))
    -                {
    -                    interactionData.target = item;
    -                    return true;
    -                }
    -            }
    -        }
    -    }
    -
    -    var length = item.children.length;
    -
    -    for (i = 0; i < length; i++)
    -    {
    -        var tempItem = item.children[i];
    -        var hit = this.hitTest(tempItem, interactionData);
    -        if (hit)
    -        {
    -            // hmm.. TODO SET CORRECT TARGET?
    -            interactionData.target = item;
    -            return true;
    -        }
    -    }
    -    return false;
    -};
    -
    -/**
    - * Is called when a touch is moved across the renderer element
    - *
    - * @method onTouchMove
    - * @param event {Event} The DOM event of a touch moving across the renderer view
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onTouchMove = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    var rect = this.interactionDOMElement.getBoundingClientRect();
    -    var changedTouches = event.changedTouches;
    -    var touchData;
    -    var i = 0;
    -
    -    for (i = 0; i < changedTouches.length; i++)
    -    {
    -        var touchEvent = changedTouches[i];
    -        touchData = this.touches[touchEvent.identifier];
    -        touchData.originalEvent = event;
    -
    -        // update the touch position
    -        touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution;
    -        touchData.global.y = ( (touchEvent.clientY - rect.top)  * (this.target.height / rect.height) )  / this.resolution;
    -        if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height)
    -        {
    -            //Support for CocoonJS fullscreen scale modes
    -            touchData.global.x = touchEvent.clientX;
    -            touchData.global.y = touchEvent.clientY;
    -        }
    -
    -        for (var j = 0; j < this.interactiveItems.length; j++)
    -        {
    -            var item = this.interactiveItems[j];
    -            if (item.touchmove && item.__touchData && item.__touchData[touchEvent.identifier])
    -            {
    -                item.touchmove(touchData);
    -            }
    -        }
    -    }
    -};
    -
    -/**
    - * Is called when a touch is started on the renderer element
    - *
    - * @method onTouchStart
    - * @param event {Event} The DOM event of a touch starting on the renderer view
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onTouchStart = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    var rect = this.interactionDOMElement.getBoundingClientRect();
    -
    -    if (PIXI.AUTO_PREVENT_DEFAULT)
    -    {
    -        event.preventDefault();
    -    }
    -
    -    var changedTouches = event.changedTouches;
    -    for (var i=0; i < changedTouches.length; i++)
    -    {
    -        var touchEvent = changedTouches[i];
    -
    -        var touchData = this.pool.pop();
    -        if (!touchData)
    -        {
    -            touchData = new PIXI.InteractionData();
    -        }
    -
    -        touchData.originalEvent = event;
    -
    -        this.touches[touchEvent.identifier] = touchData;
    -        touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution;
    -        touchData.global.y = ( (touchEvent.clientY - rect.top)  * (this.target.height / rect.height) ) / this.resolution;
    -        if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height)
    -        {
    -            //Support for CocoonJS fullscreen scale modes
    -            touchData.global.x = touchEvent.clientX;
    -            touchData.global.y = touchEvent.clientY;
    -        }
    -
    -        var length = this.interactiveItems.length;
    -
    -        for (var j = 0; j < length; j++)
    -        {
    -            var item = this.interactiveItems[j];
    -
    -            if (item.touchstart || item.tap)
    -            {
    -                item.__hit = this.hitTest(item, touchData);
    -
    -                if (item.__hit)
    -                {
    -                    //call the function!
    -                    if (item.touchstart)item.touchstart(touchData);
    -                    item.__isDown = true;
    -                    item.__touchData = item.__touchData || {};
    -                    item.__touchData[touchEvent.identifier] = touchData;
    -
    -                    if (!item.interactiveChildren) break;
    -                }
    -            }
    -        }
    -    }
    -};
    -
    -/**
    - * Is called when a touch is ended on the renderer element
    - *
    - * @method onTouchEnd
    - * @param event {Event} The DOM event of a touch ending on the renderer view
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onTouchEnd = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    var rect = this.interactionDOMElement.getBoundingClientRect();
    -    var changedTouches = event.changedTouches;
    -
    -    for (var i=0; i < changedTouches.length; i++)
    -    {
    -        var touchEvent = changedTouches[i];
    -        var touchData = this.touches[touchEvent.identifier];
    -        var up = false;
    -        touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution;
    -        touchData.global.y = ( (touchEvent.clientY - rect.top)  * (this.target.height / rect.height) ) / this.resolution;
    -        if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height)
    -        {
    -            //Support for CocoonJS fullscreen scale modes
    -            touchData.global.x = touchEvent.clientX;
    -            touchData.global.y = touchEvent.clientY;
    -        }
    -
    -        var length = this.interactiveItems.length;
    -        for (var j = 0; j < length; j++)
    -        {
    -            var item = this.interactiveItems[j];
    -
    -            if (item.__touchData && item.__touchData[touchEvent.identifier])
    -            {
    -
    -                item.__hit = this.hitTest(item, item.__touchData[touchEvent.identifier]);
    -
    -                // so this one WAS down...
    -                touchData.originalEvent = event;
    -                // hitTest??
    -
    -                if (item.touchend || item.tap)
    -                {
    -                    if (item.__hit && !up)
    -                    {
    -                        if (item.touchend)
    -                        {
    -                            item.touchend(touchData);
    -                        }
    -                        if (item.__isDown && item.tap)
    -                        {
    -                            item.tap(touchData);
    -                        }
    -                        if (!item.interactiveChildren)
    -                        {
    -                            up = true;
    -                        }
    -                    }
    -                    else
    -                    {
    -                        if (item.__isDown && item.touchendoutside)
    -                        {
    -                            item.touchendoutside(touchData);
    -                        }
    -                    }
    -
    -                    item.__isDown = false;
    -                }
    -
    -                item.__touchData[touchEvent.identifier] = null;
    -            }
    -        }
    -        // remove the touch..
    -        this.pool.push(touchData);
    -        this.touches[touchEvent.identifier] = null;
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_Intro.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_Intro.js.html deleted file mode 100755 index 39c4332..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_Intro.js.html +++ /dev/null @@ -1,285 +0,0 @@ - - - - - src/pixi/Intro.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/Intro.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -(function(){
    -
    -    var root = this;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_Outro.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_Outro.js.html deleted file mode 100755 index a3fd28d..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_Outro.js.html +++ /dev/null @@ -1,292 +0,0 @@ - - - - - src/pixi/Outro.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/Outro.js

    - -
    -
    -/**
    - * @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 if (typeof define !== 'undefined' && define.amd) {
    -        define(PIXI);
    -    } else {
    -        root.PIXI = PIXI;
    -    }
    -}).call(this);
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_Pixi.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_Pixi.js.html deleted file mode 100755 index 3533110..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_Pixi.js.html +++ /dev/null @@ -1,395 +0,0 @@ - - - - - src/pixi/Pixi.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/Pixi.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * @module PIXI
    - */
    -var PIXI = PIXI || {};
    -
    -/* 
    -* 
    -* This file contains a lot of pixi consts which are used across the rendering engine
    -* @class Consts
    -*/
    -PIXI.WEBGL_RENDERER = 0;
    -PIXI.CANVAS_RENDERER = 1;
    -
    -// useful for testing against if your lib is using pixi.
    -PIXI.VERSION = "v2.1.0";
    -
    -
    -// the various blend modes supported by pixi
    -PIXI.blendModes = {
    -    NORMAL:0,
    -    ADD:1,
    -    MULTIPLY:2,
    -    SCREEN:3,
    -    OVERLAY:4,
    -    DARKEN:5,
    -    LIGHTEN:6,
    -    COLOR_DODGE:7,
    -    COLOR_BURN:8,
    -    HARD_LIGHT:9,
    -    SOFT_LIGHT:10,
    -    DIFFERENCE:11,
    -    EXCLUSION:12,
    -    HUE:13,
    -    SATURATION:14,
    -    COLOR:15,
    -    LUMINOSITY:16
    -};
    -
    -// the scale modes
    -PIXI.scaleModes = {
    -    DEFAULT:0,
    -    LINEAR:0,
    -    NEAREST:1
    -};
    -
    -// used to create uids for various pixi objects..
    -PIXI._UID = 0;
    -
    -if(typeof(Float32Array) != 'undefined')
    -{
    -    PIXI.Float32Array = Float32Array;
    -    PIXI.Uint16Array = Uint16Array;
    -}
    -else
    -{
    -    PIXI.Float32Array = Array;
    -    PIXI.Uint16Array = Array;
    -}
    -
    -// interaction frequency 
    -PIXI.INTERACTION_FREQUENCY = 30;
    -PIXI.AUTO_PREVENT_DEFAULT = true;
    -
    -PIXI.PI_2 = Math.PI * 2;
    -PIXI.RAD_TO_DEG = 180 / Math.PI;
    -PIXI.DEG_TO_RAD = Math.PI / 180;
    -
    -PIXI.RETINA_PREFIX = "@2x";
    -//PIXI.SCALE_PREFIX "@x%%";
    -
    -PIXI.dontSayHello = false;
    -
    -
    -PIXI.defaultRenderOptions = {
    -    view:null, 
    -    transparent:false, 
    -    antialias:false, 
    -    preserveDrawingBuffer:false,
    -    resolution:1,
    -    clearBeforeRender:true,
    -    autoResize:false
    -}
    -
    -PIXI.sayHello = function (type) 
    -{
    -    if(PIXI.dontSayHello)return;
    -
    -    if ( navigator.userAgent.toLowerCase().indexOf('chrome') > -1 )
    -    {
    -        var args = [
    -            '%c %c %c Pixi.js ' + PIXI.VERSION + ' - ' + type + '  %c ' + ' %c ' + ' http://www.pixijs.com/  %c %c ♥%c♥%c♥ ',
    -            'background: #ff66a5',
    -            'background: #ff66a5',
    -            'color: #ff66a5; background: #030307;',
    -            'background: #ff66a5',
    -            'background: #ffc3dc',
    -            'background: #ff66a5',
    -            'color: #ff2424; background: #fff',
    -            'color: #ff2424; background: #fff',
    -            'color: #ff2424; background: #fff'
    -        ];
    -
    -       
    -
    -        console.log.apply(console, args);
    -    }
    -    else if (window['console'])
    -    {
    -        console.log('Pixi.js ' + PIXI.VERSION + ' - http://www.pixijs.com/');
    -    }
    -
    -    PIXI.dontSayHello = true;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_display_DisplayObject.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_display_DisplayObject.js.html deleted file mode 100755 index d3de5e4..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_display_DisplayObject.js.html +++ /dev/null @@ -1,1042 +0,0 @@ - - - - - src/pixi/display/DisplayObject.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/DisplayObject.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The base class for all objects that are rendered on the screen.
    - * This is an abstract class and should not be used on its own rather it should be extended.
    - *
    - * @class DisplayObject
    - * @constructor
    - */
    -PIXI.DisplayObject = function()
    -{
    -    /**
    -     * The coordinate of the object relative to the local coordinates of the parent.
    -     *
    -     * @property position
    -     * @type Point
    -     */
    -    this.position = new PIXI.Point();
    -
    -    /**
    -     * The scale factor of the object.
    -     *
    -     * @property scale
    -     * @type Point
    -     */
    -    this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    -
    -    /**
    -     * The pivot point of the displayObject that it rotates around
    -     *
    -     * @property pivot
    -     * @type Point
    -     */
    -    this.pivot = new PIXI.Point(0,0);
    -
    -    /**
    -     * The rotation of the object in radians.
    -     *
    -     * @property rotation
    -     * @type Number
    -     */
    -    this.rotation = 0;
    -
    -    /**
    -     * The opacity of the object.
    -     *
    -     * @property alpha
    -     * @type Number
    -     */
    -    this.alpha = 1;
    -
    -    /**
    -     * The visibility of the object.
    -     *
    -     * @property visible
    -     * @type Boolean
    -     */
    -    this.visible = true;
    -
    -    /**
    -     * This is the defined area that will pick up mouse / touch events. It is null by default.
    -     * Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)
    -     *
    -     * @property hitArea
    -     * @type Rectangle|Circle|Ellipse|Polygon
    -     */
    -    this.hitArea = null;
    -
    -    /**
    -     * This is used to indicate if the displayObject should display a mouse hand cursor on rollover
    -     *
    -     * @property buttonMode
    -     * @type Boolean
    -     */
    -    this.buttonMode = false;
    -
    -    /**
    -     * Can this object be rendered
    -     *
    -     * @property renderable
    -     * @type Boolean
    -     */
    -    this.renderable = false;
    -
    -    /**
    -     * [read-only] The display object container that contains this display object.
    -     *
    -     * @property parent
    -     * @type DisplayObjectContainer
    -     * @readOnly
    -     */
    -    this.parent = null;
    -
    -    /**
    -     * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    -     *
    -     * @property stage
    -     * @type Stage
    -     * @readOnly
    -     */
    -    this.stage = null;
    -
    -    /**
    -     * [read-only] The multiplied alpha of the displayObject
    -     *
    -     * @property worldAlpha
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.worldAlpha = 1;
    -
    -    /**
    -     * [read-only] Whether or not the object is interactive, do not toggle directly! use the `interactive` property
    -     *
    -     * @property _interactive
    -     * @type Boolean
    -     * @readOnly
    -     * @private
    -     */
    -    this._interactive = false;
    -
    -    /**
    -     * This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
    -     *
    -     * @property defaultCursor
    -     * @type String
    -     *
    -    */
    -    this.defaultCursor = 'pointer';
    -
    -    /**
    -     * [read-only] Current transform of the object based on world (parent) factors
    -     *
    -     * @property worldTransform
    -     * @type Matrix
    -     * @readOnly
    -     * @private
    -     */
    -    this.worldTransform = new PIXI.Matrix();
    -
    -    /**
    -     * cached sin rotation and cos rotation
    -     *
    -     * @property _sr
    -     * @type Number
    -     * @private
    -     */
    -    this._sr = 0;
    -
    -    /**
    -     * cached sin rotation and cos rotation
    -     *
    -     * @property _cr
    -     * @type Number
    -     * @private
    -     */
    -    this._cr = 1;
    -
    -    /**
    -     * The area the filter is applied to like the hitArea this is used as more of an optimisation
    -     * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle
    -     *
    -     * @property filterArea
    -     * @type Rectangle
    -     */
    -    this.filterArea = null;//new PIXI.Rectangle(0,0,1,1);
    -
    -    /**
    -     * The original, cached bounds of the object
    -     *
    -     * @property _bounds
    -     * @type Rectangle
    -     * @private
    -     */
    -    this._bounds = new PIXI.Rectangle(0, 0, 1, 1);
    -
    -    /**
    -     * The most up-to-date bounds of the object
    -     *
    -     * @property _currentBounds
    -     * @type Rectangle
    -     * @private
    -     */
    -    this._currentBounds = null;
    -
    -    /**
    -     * The original, cached mask of the object
    -     *
    -     * @property _currentBounds
    -     * @type Rectangle
    -     * @private
    -     */
    -    this._mask = null;
    -
    -    /**
    -     * Cached internal flag.
    -     *
    -     * @property _cacheAsBitmap
    -     * @type Boolean
    -     * @private
    -     */
    -    this._cacheAsBitmap = false;
    -
    -    /**
    -     * Cached internal flag.
    -     *
    -     * @property _cacheIsDirty
    -     * @type Boolean
    -     * @private
    -     */
    -    this._cacheIsDirty = false;
    -
    -
    -    /*
    -     * MOUSE Callbacks
    -     */
    -    
    -    /**
    -     * A callback that is used when the users mouse rolls over the displayObject
    -     * @method mouseover
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the users mouse leaves the displayObject
    -     * @method mouseout
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    //Left button
    -    /**
    -     * A callback that is used when the users clicks on the displayObject with their mouse's left button
    -     * @method click
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user clicks the mouse's left button down over the sprite
    -     * @method mousedown
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases the mouse's left button that was over the displayObject
    -     * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject
    -     * @method mouseup
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject
    -     * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject
    -     * @method mouseupoutside
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    //Right button
    -    /**
    -     * A callback that is used when the users clicks on the displayObject with their mouse's right button
    -     * @method rightclick
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user clicks the mouse's right button down over the sprite
    -     * @method rightdown
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases the mouse's right button that was over the displayObject
    -     * for this callback to be fired the mouse's right button must have been pressed down over the displayObject
    -     * @method rightup
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject
    -     * for this callback to be fired, the mouse's right button must have been pressed down over the displayObject
    -     * @method rightupoutside
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /*
    -     * TOUCH Callbacks
    -     */
    -
    -    /**
    -     * A callback that is used when the users taps on the sprite with their finger
    -     * basically a touch version of click
    -     * @method tap
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user touches over the displayObject
    -     * @method touchstart
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases a touch over the displayObject
    -     * @method touchend
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases the touch that was over the displayObject
    -     * for this callback to be fired, The touch must have started over the sprite
    -     * @method touchendoutside
    -     * @param interactionData {InteractionData}
    -     */
    -};
    -
    -// constructor
    -PIXI.DisplayObject.prototype.constructor = PIXI.DisplayObject;
    -
    -/**
    - * Indicates if the sprite will have touch and mouse interactivity. It is false by default
    - *
    - * @property interactive
    - * @type Boolean
    - * @default false
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'interactive', {
    -    get: function() {
    -        return this._interactive;
    -    },
    -    set: function(value) {
    -        this._interactive = value;
    -
    -        // TODO more to be done here..
    -        // need to sort out a re-crawl!
    -        if(this.stage)this.stage.dirty = true;
    -    }
    -});
    -
    -/**
    - * [read-only] Indicates if the sprite is globally visible.
    - *
    - * @property worldVisible
    - * @type Boolean
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'worldVisible', {
    -    get: function() {
    -        var item = this;
    -
    -        do
    -        {
    -            if(!item.visible)return false;
    -            item = item.parent;
    -        }
    -        while(item);
    -
    -        return true;
    -    }
    -});
    -
    -/**
    - * Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.
    - * In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping.
    - * To remove a mask, set this property to null.
    - *
    - * @property mask
    - * @type Graphics
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'mask', {
    -    get: function() {
    -        return this._mask;
    -    },
    -    set: function(value) {
    -
    -        if(this._mask)this._mask.isMask = false;
    -        this._mask = value;
    -        if(this._mask)this._mask.isMask = true;
    -    }
    -});
    -
    -/**
    - * Sets the filters for the displayObject.
    - * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer.
    - * To remove filters simply set this property to 'null'
    - * @property filters
    - * @type Array An array of filters
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', {
    -
    -    get: function() {
    -        return this._filters;
    -    },
    -
    -    set: function(value) {
    -
    -        if(value)
    -        {
    -            // now put all the passes in one place..
    -            var passes = [];
    -            for (var i = 0; i < value.length; i++)
    -            {
    -                var filterPasses = value[i].passes;
    -                for (var j = 0; j < filterPasses.length; j++)
    -                {
    -                    passes.push(filterPasses[j]);
    -                }
    -            }
    -
    -            // TODO change this as it is legacy
    -            this._filterBlock = {target:this, filterPasses:passes};
    -        }
    -
    -        this._filters = value;
    -    }
    -});
    -
    -/**
    - * Set if this display object is cached as a bitmap.
    - * This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects.
    - * To remove simply set this property to 'null'
    - * @property cacheAsBitmap
    - * @type Boolean
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'cacheAsBitmap', {
    -
    -    get: function() {
    -        return  this._cacheAsBitmap;
    -    },
    -
    -    set: function(value) {
    -
    -        if(this._cacheAsBitmap === value)return;
    -
    -        if(value)
    -        {
    -            this._generateCachedSprite();
    -        }
    -        else
    -        {
    -            this._destroyCachedSprite();
    -        }
    -
    -        this._cacheAsBitmap = value;
    -    }
    -});
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.DisplayObject.prototype.updateTransform = function()
    -{
    -    // create some matrix refs for easy access
    -    var pt = this.parent.worldTransform;
    -    var wt = this.worldTransform;
    -
    -    // temporary matrix variables
    -    var a, b, c, d, tx, ty;
    -
    -    // TODO create a const for 2_PI 
    -    // so if rotation is between 0 then we can simplify the multiplication process..
    -    if(this.rotation % PIXI.PI_2)
    -    {
    -        // check to see if the rotation is the same as the previous render. This means we only need to use sin and cos when rotation actually changes
    -        if(this.rotation !== this.rotationCache)
    -        {
    -            this.rotationCache = this.rotation;
    -            this._sr = Math.sin(this.rotation);
    -            this._cr = Math.cos(this.rotation);
    -        }
    -
    -        // get the matrix values of the displayobject based on its transform properties..
    -        a  =  this._cr * this.scale.x;
    -        b  =  this._sr * this.scale.x;
    -        c  = -this._sr * this.scale.y;
    -        d  =  this._cr * this.scale.y;
    -        tx =  this.position.x;
    -        ty =  this.position.y;
    -        
    -        // check for pivot.. not often used so geared towards that fact!
    -        if(this.pivot.x || this.pivot.y)
    -        {
    -            tx -= this.pivot.x * a + this.pivot.y * c;
    -            ty -= this.pivot.x * b + this.pivot.y * d;
    -        }
    -
    -        // concat the parent matrix with the objects transform.
    -        wt.a  = a  * pt.a + b  * pt.c;
    -        wt.b  = a  * pt.b + b  * pt.d;
    -        wt.c  = c  * pt.a + d  * pt.c;
    -        wt.d  = c  * pt.b + d  * pt.d;
    -        wt.tx = tx * pt.a + ty * pt.c + pt.tx;
    -        wt.ty = tx * pt.b + ty * pt.d + pt.ty;
    -
    -        
    -    }
    -    else
    -    {
    -        // lets do the fast version as we know there is no rotation..
    -        a  = this.scale.x;
    -        d  = this.scale.y;
    -
    -        tx =  this.position.x;
    -        ty =  this.position.y;
    -
    -        wt.a  = a  * pt.a;
    -        wt.b  = a  * pt.b;
    -        wt.c  = d  * pt.c;
    -        wt.d  = d  * pt.d;
    -        wt.tx = tx * pt.a + ty * pt.c + pt.tx;
    -        wt.ty = tx * pt.b + ty * pt.d + pt.ty;
    -    }
    -
    -    // multiply the alphas..
    -    this.worldAlpha = this.alpha * this.parent.worldAlpha;
    -};
    -
    -// performance increase to avoid using call.. (10x faster)
    -PIXI.DisplayObject.prototype.displayObjectUpdateTransform = PIXI.DisplayObject.prototype.updateTransform;
    -
    -/**
    - * Retrieves the bounds of the displayObject as a rectangle object
    - *
    - * @method getBounds
    - * @param matrix {Matrix}
    - * @return {Rectangle} the rectangular bounding area
    - */
    -PIXI.DisplayObject.prototype.getBounds = function(matrix)
    -{
    -    matrix = matrix;//just to get passed js hinting (and preserve inheritance)
    -    return PIXI.EmptyRectangle;
    -};
    -
    -/**
    - * Retrieves the local bounds of the displayObject as a rectangle object
    - *
    - * @method getLocalBounds
    - * @return {Rectangle} the rectangular bounding area
    - */
    -PIXI.DisplayObject.prototype.getLocalBounds = function()
    -{
    -    return this.getBounds(PIXI.identityMatrix);///PIXI.EmptyRectangle();
    -};
    -
    -/**
    - * Sets the object's stage reference, the stage this object is connected to
    - *
    - * @method setStageReference
    - * @param stage {Stage} the stage that the object will have as its current stage reference
    - */
    -PIXI.DisplayObject.prototype.setStageReference = function(stage)
    -{
    -    this.stage = stage;
    -    if(this._interactive)this.stage.dirty = true;
    -};
    -
    -/**
    - * Useful function that returns a texture of the displayObject object that can then be used to create sprites
    - * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.
    - *
    - * @method generateTexture
    - * @param resolution {Number} The resolution of the texture being generated
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture.
    - * @return {Texture} a texture of the graphics object
    - */
    -PIXI.DisplayObject.prototype.generateTexture = function(resolution, scaleMode, renderer)
    -{
    -    var bounds = this.getLocalBounds();
    -
    -    var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0, renderer, scaleMode, resolution);
    -    
    -    PIXI.DisplayObject._tempMatrix.tx = -bounds.x;
    -    PIXI.DisplayObject._tempMatrix.ty = -bounds.y;
    -    
    -    renderTexture.render(this, PIXI.DisplayObject._tempMatrix);
    -
    -    return renderTexture;
    -};
    -
    -/**
    - * Generates and updates the cached sprite for this object.
    - *
    - * @method updateCache
    - */
    -PIXI.DisplayObject.prototype.updateCache = function()
    -{
    -    this._generateCachedSprite();
    -};
    -
    -/**
    - * Calculates the global position of the display object
    - *
    - * @method toGlobal
    - * @param position {Point} The world origin to calculate from
    - * @return {Point} A point object representing the position of this object
    - */
    -PIXI.DisplayObject.prototype.toGlobal = function(position)
    -{
    -    this.updateTransform();
    -    return this.worldTransform.apply(position);
    -};
    -
    -/**
    - * Calculates the local position of the display object relative to another point
    - *
    - * @method toLocal
    - * @param position {Point} The world origin to calculate from
    - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from
    - * @return {Point} A point object representing the position of this object
    - */
    -PIXI.DisplayObject.prototype.toLocal = function(position, from)
    -{
    -    if (from)
    -    {
    -        position = from.toGlobal(position);
    -    }
    -
    -    this.updateTransform();
    -
    -    return this.worldTransform.applyInverse(position);
    -};
    -
    -/**
    - * Internal method.
    - *
    - * @method _renderCachedSprite
    - * @param renderSession {Object} The render session
    - * @private
    - */
    -PIXI.DisplayObject.prototype._renderCachedSprite = function(renderSession)
    -{
    -    this._cachedSprite.worldAlpha = this.worldAlpha;
    -
    -    if(renderSession.gl)
    -    {
    -        PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession);
    -    }
    -    else
    -    {
    -        PIXI.Sprite.prototype._renderCanvas.call(this._cachedSprite, renderSession);
    -    }
    -};
    -
    -/**
    - * Internal method.
    - *
    - * @method _generateCachedSprite
    - * @private
    - */
    -PIXI.DisplayObject.prototype._generateCachedSprite = function()
    -{
    -    this._cacheAsBitmap = false;
    -    var bounds = this.getLocalBounds();
    -
    -    if(!this._cachedSprite)
    -    {
    -        var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0);//, renderSession.renderer);
    -
    -        this._cachedSprite = new PIXI.Sprite(renderTexture);
    -        this._cachedSprite.worldTransform = this.worldTransform;
    -    }
    -    else
    -    {
    -        this._cachedSprite.texture.resize(bounds.width | 0, bounds.height | 0);
    -    }
    -
    -    //REMOVE filter!
    -    var tempFilters = this._filters;
    -    this._filters = null;
    -
    -    this._cachedSprite.filters = tempFilters;
    -
    -    PIXI.DisplayObject._tempMatrix.tx = -bounds.x;
    -    PIXI.DisplayObject._tempMatrix.ty = -bounds.y;
    -    
    -    this._cachedSprite.texture.render(this, PIXI.DisplayObject._tempMatrix );
    -
    -    this._cachedSprite.anchor.x = -( bounds.x / bounds.width );
    -    this._cachedSprite.anchor.y = -( bounds.y / bounds.height );
    -
    -    this._filters = tempFilters;
    -
    -    this._cacheAsBitmap = true;
    -};
    -
    -/**
    -* Destroys the cached sprite.
    -*
    -* @method _destroyCachedSprite
    -* @private
    -*/
    -PIXI.DisplayObject.prototype._destroyCachedSprite = function()
    -{
    -    if(!this._cachedSprite)return;
    -
    -    this._cachedSprite.texture.destroy(true);
    -
    -    // TODO could be object pooled!
    -    this._cachedSprite = null;
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession}
    -* @private
    -*/
    -PIXI.DisplayObject.prototype._renderWebGL = function(renderSession)
    -{
    -    // OVERWRITE;
    -    // this line is just here to pass jshinting :)
    -    renderSession = renderSession;
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession}
    -* @private
    -*/
    -PIXI.DisplayObject.prototype._renderCanvas = function(renderSession)
    -{
    -    // OVERWRITE;
    -    // this line is just here to pass jshinting :)
    -    renderSession = renderSession;
    -};
    -
    -
    -PIXI.DisplayObject._tempMatrix = new PIXI.Matrix();
    -
    -/**
    - * The position of the displayObject on the x axis relative to the local coordinates of the parent.
    - *
    - * @property x
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'x', {
    -    get: function() {
    -        return  this.position.x;
    -    },
    -    set: function(value) {
    -        this.position.x = value;
    -    }
    -});
    -
    -/**
    - * The position of the displayObject on the y axis relative to the local coordinates of the parent.
    - *
    - * @property y
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'y', {
    -    get: function() {
    -        return  this.position.y;
    -    },
    -    set: function(value) {
    -        this.position.y = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_display_DisplayObjectContainer.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_display_DisplayObjectContainer.js.html deleted file mode 100755 index 0c8eb24..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_display_DisplayObjectContainer.js.html +++ /dev/null @@ -1,793 +0,0 @@ - - - - - src/pixi/display/DisplayObjectContainer.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/DisplayObjectContainer.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A DisplayObjectContainer represents a collection of display objects.
    - * It is the base class of all display objects that act as a container for other objects.
    - *
    - * @class DisplayObjectContainer
    - * @extends DisplayObject
    - * @constructor
    - */
    -PIXI.DisplayObjectContainer = function()
    -{
    -    PIXI.DisplayObject.call( this );
    -
    -    /**
    -     * [read-only] The array of children of this container.
    -     *
    -     * @property children
    -     * @type Array<DisplayObject>
    -     * @readOnly
    -     */
    -    this.children = [];
    -
    -    // fast access to update transform..
    -    
    -};
    -
    -// constructor
    -PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    -PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer;
    -
    -
    -/**
    - * The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
    - *
    - * @property width
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', {
    -    get: function() {
    -        return this.scale.x * this.getLocalBounds().width;
    -    },
    -    set: function(value) {
    -        
    -        var width = this.getLocalBounds().width;
    -
    -        if(width !== 0)
    -        {
    -            this.scale.x = value / ( width/this.scale.x );
    -        }
    -        else
    -        {
    -            this.scale.x = 1;
    -        }
    -
    -        
    -        this._width = value;
    -    }
    -});
    -
    -/**
    - * The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
    - *
    - * @property height
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', {
    -    get: function() {
    -        return  this.scale.y * this.getLocalBounds().height;
    -    },
    -    set: function(value) {
    -
    -        var height = this.getLocalBounds().height;
    -
    -        if(height !== 0)
    -        {
    -            this.scale.y = value / ( height/this.scale.y );
    -        }
    -        else
    -        {
    -            this.scale.y = 1;
    -        }
    -
    -        this._height = value;
    -    }
    -});
    -
    -/**
    - * Adds a child to the container.
    - *
    - * @method addChild
    - * @param child {DisplayObject} The DisplayObject to add to the container
    - * @return {DisplayObject} The child that was added.
    - */
    -PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    -{
    -    return this.addChildAt(child, this.children.length);
    -};
    -
    -/**
    - * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    - *
    - * @method addChildAt
    - * @param child {DisplayObject} The child to add
    - * @param index {Number} The index to place the child in
    - * @return {DisplayObject} The child that was added.
    - */
    -PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    -{
    -    if(index >= 0 && index <= this.children.length)
    -    {
    -        if(child.parent)
    -        {
    -            child.parent.removeChild(child);
    -        }
    -
    -        child.parent = this;
    -
    -        this.children.splice(index, 0, child);
    -
    -        if(this.stage)child.setStageReference(this.stage);
    -
    -        return child;
    -    }
    -    else
    -    {
    -        throw new Error(child + 'addChildAt: The index '+ index +' supplied is out of bounds ' + this.children.length);
    -    }
    -};
    -
    -/**
    - * Swaps the position of 2 Display Objects within this container.
    - *
    - * @method swapChildren
    - * @param child {DisplayObject}
    - * @param child2 {DisplayObject}
    - */
    -PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2)
    -{
    -    if(child === child2) {
    -        return;
    -    }
    -
    -    var index1 = this.getChildIndex(child);
    -    var index2 = this.getChildIndex(child2);
    -
    -    if(index1 < 0 || index2 < 0) {
    -        throw new Error('swapChildren: Both the supplied DisplayObjects must be a child of the caller.');
    -    }
    -
    -    this.children[index1] = child2;
    -    this.children[index2] = child;
    -
    -};
    -
    -/**
    - * Returns the index position of a child DisplayObject instance
    - *
    - * @method getChildIndex
    - * @param child {DisplayObject} The DisplayObject instance to identify
    - * @return {Number} The index position of the child display object to identify
    - */
    -PIXI.DisplayObjectContainer.prototype.getChildIndex = function(child)
    -{
    -    var index = this.children.indexOf(child);
    -    if (index === -1)
    -    {
    -        throw new Error('The supplied DisplayObject must be a child of the caller');
    -    }
    -    return index;
    -};
    -
    -/**
    - * Changes the position of an existing child in the display object container
    - *
    - * @method setChildIndex
    - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number
    - * @param index {Number} The resulting index number for the child display object
    - */
    -PIXI.DisplayObjectContainer.prototype.setChildIndex = function(child, index)
    -{
    -    if (index < 0 || index >= this.children.length)
    -    {
    -        throw new Error('The supplied index is out of bounds');
    -    }
    -    var currentIndex = this.getChildIndex(child);
    -    this.children.splice(currentIndex, 1); //remove from old position
    -    this.children.splice(index, 0, child); //add at new position
    -};
    -
    -/**
    - * Returns the child at the specified index
    - *
    - * @method getChildAt
    - * @param index {Number} The index to get the child from
    - * @return {DisplayObject} The child at the given index, if any.
    - */
    -PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
    -{
    -    if (index < 0 || index >= this.children.length)
    -    {
    -        throw new Error('getChildAt: Supplied index '+ index +' does not exist in the child list, or the supplied DisplayObject must be a child of the caller');
    -    }
    -    return this.children[index];
    -    
    -};
    -
    -/**
    - * Removes a child from the container.
    - *
    - * @method removeChild
    - * @param child {DisplayObject} The DisplayObject to remove
    - * @return {DisplayObject} The child that was removed.
    - */
    -PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    -{
    -    var index = this.children.indexOf( child );
    -    if(index === -1)return;
    -    
    -    return this.removeChildAt( index );
    -};
    -
    -/**
    - * Removes a child from the specified index position.
    - *
    - * @method removeChildAt
    - * @param index {Number} The index to get the child from
    - * @return {DisplayObject} The child that was removed.
    - */
    -PIXI.DisplayObjectContainer.prototype.removeChildAt = function(index)
    -{
    -    var child = this.getChildAt( index );
    -    if(this.stage)
    -        child.removeStageReference();
    -
    -    child.parent = undefined;
    -    this.children.splice( index, 1 );
    -    return child;
    -};
    -
    -/**
    -* Removes all children from this container that are within the begin and end indexes.
    -*
    -* @method removeChildren
    -* @param beginIndex {Number} The beginning position. Default value is 0.
    -* @param endIndex {Number} The ending position. Default value is size of the container.
    -*/
    -PIXI.DisplayObjectContainer.prototype.removeChildren = function(beginIndex, endIndex)
    -{
    -    var begin = beginIndex || 0;
    -    var end = typeof endIndex === 'number' ? endIndex : this.children.length;
    -    var range = end - begin;
    -
    -    if (range > 0 && range <= end)
    -    {
    -        var removed = this.children.splice(begin, range);
    -        for (var i = 0; i < removed.length; i++) {
    -            var child = removed[i];
    -            if(this.stage)
    -                child.removeStageReference();
    -            child.parent = undefined;
    -        }
    -        return removed;
    -    }
    -    else if (range === 0 && this.children.length === 0)
    -    {
    -        return [];
    -    }
    -    else
    -    {
    -        throw new Error( 'removeChildren: Range Error, numeric values are outside the acceptable range' );
    -    }
    -};
    -
    -/*
    - * Updates the transform on all children of this container for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    -{
    -    if(!this.visible)return;
    -
    -    this.displayObjectUpdateTransform();
    -
    -    //PIXI.DisplayObject.prototype.updateTransform.call( this );
    -
    -    if(this._cacheAsBitmap)return;
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        this.children[i].updateTransform();
    -    }
    -};
    -
    -// performance increase to avoid using call.. (10x faster)
    -PIXI.DisplayObjectContainer.prototype.displayObjectContainerUpdateTransform = PIXI.DisplayObjectContainer.prototype.updateTransform;
    -
    -/**
    - * Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.
    - *
    - * @method getBounds
    - * @return {Rectangle} The rectangular bounding area
    - */
    -PIXI.DisplayObjectContainer.prototype.getBounds = function()
    -{
    -    if(this.children.length === 0)return PIXI.EmptyRectangle;
    -
    -    // TODO the bounds have already been calculated this render session so return what we have
    -
    -    var minX = Infinity;
    -    var minY = Infinity;
    -
    -    var maxX = -Infinity;
    -    var maxY = -Infinity;
    -
    -    var childBounds;
    -    var childMaxX;
    -    var childMaxY;
    -
    -    var childVisible = false;
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        var child = this.children[i];
    -        
    -        if(!child.visible)continue;
    -
    -        childVisible = true;
    -
    -        childBounds = this.children[i].getBounds();
    -     
    -        minX = minX < childBounds.x ? minX : childBounds.x;
    -        minY = minY < childBounds.y ? minY : childBounds.y;
    -
    -        childMaxX = childBounds.width + childBounds.x;
    -        childMaxY = childBounds.height + childBounds.y;
    -
    -        maxX = maxX > childMaxX ? maxX : childMaxX;
    -        maxY = maxY > childMaxY ? maxY : childMaxY;
    -    }
    -
    -    if(!childVisible)
    -        return PIXI.EmptyRectangle;
    -
    -    var bounds = this._bounds;
    -
    -    bounds.x = minX;
    -    bounds.y = minY;
    -    bounds.width = maxX - minX;
    -    bounds.height = maxY - minY;
    -
    -    // TODO: store a reference so that if this function gets called again in the render cycle we do not have to recalculate
    -    //this._currentBounds = bounds;
    -   
    -    return bounds;
    -};
    -
    -/**
    - * Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.
    - *
    - * @method getLocalBounds
    - * @return {Rectangle} The rectangular bounding area
    - */
    -PIXI.DisplayObjectContainer.prototype.getLocalBounds = function()
    -{
    -    var matrixCache = this.worldTransform;
    -
    -    this.worldTransform = PIXI.identityMatrix;
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        this.children[i].updateTransform();
    -    }
    -
    -    var bounds = this.getBounds();
    -
    -    this.worldTransform = matrixCache;
    -
    -    return bounds;
    -};
    -
    -/**
    - * Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.
    - *
    - * @method setStageReference
    - * @param stage {Stage} the stage that the container will have as its current stage reference
    - */
    -PIXI.DisplayObjectContainer.prototype.setStageReference = function(stage)
    -{
    -    this.stage = stage;
    -    if(this._interactive)this.stage.dirty = true;
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        var child = this.children[i];
    -        child.setStageReference(stage);
    -    }
    -};
    -
    -/**
    - * Removes the current stage reference from the container and all of its children.
    - *
    - * @method removeStageReference
    - */
    -PIXI.DisplayObjectContainer.prototype.removeStageReference = function()
    -{
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        var child = this.children[i];
    -        child.removeStageReference();
    -    }
    -
    -    if(this._interactive)this.stage.dirty = true;
    -    
    -    this.stage = null;
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.DisplayObjectContainer.prototype._renderWebGL = function(renderSession)
    -{
    -    if(!this.visible || this.alpha <= 0)return;
    -    
    -    if(this._cacheAsBitmap)
    -    {
    -        this._renderCachedSprite(renderSession);
    -        return;
    -    }
    -    
    -    var i,j;
    -
    -    if(this._mask || this._filters)
    -    {
    -        
    -        // push filter first as we need to ensure the stencil buffer is correct for any masking
    -        if(this._filters)
    -        {
    -            renderSession.spriteBatch.flush();
    -            renderSession.filterManager.pushFilter(this._filterBlock);
    -        }
    -
    -        if(this._mask)
    -        {
    -            renderSession.spriteBatch.stop();
    -            renderSession.maskManager.pushMask(this.mask, renderSession);
    -            renderSession.spriteBatch.start();
    -        }
    -
    -        // simple render children!
    -        for(i=0,j=this.children.length; i<j; i++)
    -        {
    -            this.children[i]._renderWebGL(renderSession);
    -        }
    -
    -        renderSession.spriteBatch.stop();
    -
    -        if(this._mask)renderSession.maskManager.popMask(this._mask, renderSession);
    -        if(this._filters)renderSession.filterManager.popFilter();
    -        
    -        renderSession.spriteBatch.start();
    -    }
    -    else
    -    {
    -        // simple render children!
    -        for(i=0,j=this.children.length; i<j; i++)
    -        {
    -            this.children[i]._renderWebGL(renderSession);
    -        }
    -    }
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.DisplayObjectContainer.prototype._renderCanvas = function(renderSession)
    -{
    -    if(this.visible === false || this.alpha === 0)return;
    -
    -    if(this._cacheAsBitmap)
    -    {
    -
    -        this._renderCachedSprite(renderSession);
    -        return;
    -    }
    -
    -    if(this._mask)
    -    {
    -        renderSession.maskManager.pushMask(this._mask, renderSession);
    -    }
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        var child = this.children[i];
    -        child._renderCanvas(renderSession);
    -    }
    -
    -    if(this._mask)
    -    {
    -        renderSession.maskManager.popMask(renderSession);
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_display_MovieClip.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_display_MovieClip.js.html deleted file mode 100755 index 7096ce6..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_display_MovieClip.js.html +++ /dev/null @@ -1,483 +0,0 @@ - - - - - src/pixi/display/MovieClip.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/MovieClip.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A MovieClip is a simple way to display an animation depicted by a list of textures.
    - *
    - * @class MovieClip
    - * @extends Sprite
    - * @constructor
    - * @param textures {Array<Texture>} an array of {Texture} objects that make up the animation
    - */
    -PIXI.MovieClip = function(textures)
    -{
    -    PIXI.Sprite.call(this, textures[0]);
    -
    -    /**
    -     * The array of textures that make up the animation
    -     *
    -     * @property textures
    -     * @type Array
    -     */
    -    this.textures = textures;
    -
    -    /**
    -     * The speed that the MovieClip will play at. Higher is faster, lower is slower
    -     *
    -     * @property animationSpeed
    -     * @type Number
    -     * @default 1
    -     */
    -    this.animationSpeed = 1;
    -
    -    /**
    -     * Whether or not the movie clip repeats after playing.
    -     *
    -     * @property loop
    -     * @type Boolean
    -     * @default true
    -     */
    -    this.loop = true;
    -
    -    /**
    -     * Function to call when a MovieClip finishes playing
    -     *
    -     * @property onComplete
    -     * @type Function
    -     */
    -    this.onComplete = null;
    -
    -    /**
    -     * [read-only] The MovieClips current frame index (this may not have to be a whole number)
    -     *
    -     * @property currentFrame
    -     * @type Number
    -     * @default 0
    -     * @readOnly
    -     */
    -    this.currentFrame = 0;
    -
    -    /**
    -     * [read-only] Indicates if the MovieClip is currently playing
    -     *
    -     * @property playing
    -     * @type Boolean
    -     * @readOnly
    -     */
    -    this.playing = false;
    -};
    -
    -// constructor
    -PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    -PIXI.MovieClip.prototype.constructor = PIXI.MovieClip;
    -
    -/**
    -* [read-only] totalFrames is the total number of frames in the MovieClip. This is the same as number of textures
    -* assigned to the MovieClip.
    -*
    -* @property totalFrames
    -* @type Number
    -* @default 0
    -* @readOnly
    -*/
    -Object.defineProperty( PIXI.MovieClip.prototype, 'totalFrames', {
    -	get: function() {
    -
    -		return this.textures.length;
    -	}
    -});
    -
    -/**
    - * Stops the MovieClip
    - *
    - * @method stop
    - */
    -PIXI.MovieClip.prototype.stop = function()
    -{
    -    this.playing = false;
    -};
    -
    -/**
    - * Plays the MovieClip
    - *
    - * @method play
    - */
    -PIXI.MovieClip.prototype.play = function()
    -{
    -    this.playing = true;
    -};
    -
    -/**
    - * Stops the MovieClip and goes to a specific frame
    - *
    - * @method gotoAndStop
    - * @param frameNumber {Number} frame index to stop at
    - */
    -PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    -{
    -    this.playing = false;
    -    this.currentFrame = frameNumber;
    -    var round = (this.currentFrame + 0.5) | 0;
    -    this.setTexture(this.textures[round % this.textures.length]);
    -};
    -
    -/**
    - * Goes to a specific frame and begins playing the MovieClip
    - *
    - * @method gotoAndPlay
    - * @param frameNumber {Number} frame index to start at
    - */
    -PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    -{
    -    this.currentFrame = frameNumber;
    -    this.playing = true;
    -};
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.MovieClip.prototype.updateTransform = function()
    -{
    -    PIXI.Sprite.prototype.updateTransform.call(this);
    -
    -    if(!this.playing)return;
    -
    -    this.currentFrame += this.animationSpeed;
    -
    -    var round = (this.currentFrame + 0.5) | 0;
    -
    -    this.currentFrame = this.currentFrame % this.textures.length;
    -
    -    if(this.loop || round < this.textures.length)
    -    {
    -        this.setTexture(this.textures[round % this.textures.length]);
    -    }
    -    else if(round >= this.textures.length)
    -    {
    -        this.gotoAndStop(this.textures.length - 1);
    -        if(this.onComplete)
    -        {
    -            this.onComplete();
    -        }
    -    }
    -};
    -
    -/**
    - * A short hand way of creating a movieclip from an array of frame ids
    - *
    - * @static
    - * @method fromFrames
    - * @param frames {Array} the array of frames ids the movieclip will use as its texture frames
    - */
    -PIXI.MovieClip.fromFrames = function(frames)
    -{
    -    var textures = [];
    -
    -    for (var i = 0; i < frames.length; i++)
    -    {
    -        textures.push(new PIXI.Texture.fromFrame(frames[i]));
    -    }
    -
    -    return new PIXI.MovieClip(textures);
    -};
    -
    -/**
    - * A short hand way of creating a movieclip from an array of image ids
    - *
    - * @static
    - * @method fromImages
    - * @param frames {Array} the array of image ids the movieclip will use as its texture frames
    - */
    -PIXI.MovieClip.fromImages = function(images)
    -{
    -    var textures = [];
    -
    -    for (var i = 0; i < images.length; i++)
    -    {
    -        textures.push(new PIXI.Texture.fromImage(images[i]));
    -    }
    -
    -    return new PIXI.MovieClip(textures);
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_display_Sprite.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_display_Sprite.js.html deleted file mode 100755 index f92d36c..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_display_Sprite.js.html +++ /dev/null @@ -1,727 +0,0 @@ - - - - - src/pixi/display/Sprite.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/Sprite.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The Sprite object is the base for all textured objects that are rendered to the screen
    - *
    - * @class Sprite
    - * @extends DisplayObjectContainer
    - * @constructor
    - * @param texture {Texture} The texture for this sprite
    - *
    - * A sprite can be created directly from an image like this :
    - * var sprite = new PIXI.Sprite.fromImage('assets/image.png');
    - * yourStage.addChild(sprite);
    - * then obviously don't forget to add it to the stage you have already created
    - */
    -PIXI.Sprite = function(texture)
    -{
    -    PIXI.DisplayObjectContainer.call( this );
    -
    -    /**
    -     * The anchor sets the origin point of the texture.
    -     * The default is 0,0 this means the texture's origin is the top left
    -     * Setting than anchor to 0.5,0.5 means the textures origin is centered
    -     * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner
    -     *
    -     * @property anchor
    -     * @type Point
    -     */
    -    this.anchor = new PIXI.Point();
    -
    -    /**
    -     * The texture that the sprite is using
    -     *
    -     * @property texture
    -     * @type Texture
    -     */
    -    this.texture = texture;
    -
    -    /**
    -     * The width of the sprite (this is initially set by the texture)
    -     *
    -     * @property _width
    -     * @type Number
    -     * @private
    -     */
    -    this._width = 0;
    -
    -    /**
    -     * The height of the sprite (this is initially set by the texture)
    -     *
    -     * @property _height
    -     * @type Number
    -     * @private
    -     */
    -    this._height = 0;
    -
    -    /**
    -     * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.
    -     *
    -     * @property tint
    -     * @type Number
    -     * @default 0xFFFFFF
    -     */
    -    this.tint = 0xFFFFFF;
    -
    -    /**
    -     * The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.
    -     *
    -     * @property blendMode
    -     * @type Number
    -     * @default PIXI.blendModes.NORMAL;
    -     */
    -    this.blendMode = PIXI.blendModes.NORMAL;
    -
    -    /**
    -     * The shader that will be used to render the texture to the stage. Set to null to remove a current shader.
    -     *
    -     * @property shader
    -     * @type PIXI.AbstractFilter
    -     * @default null
    -     */
    -    this.shader = null;
    -
    -    if(texture.baseTexture.hasLoaded)
    -    {
    -        this.onTextureUpdate();
    -    }
    -    else
    -    {
    -        this.texture.on( 'update', this.onTextureUpdate.bind(this) );
    -    }
    -
    -    this.renderable = true;
    -
    -};
    -
    -// constructor
    -PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    -PIXI.Sprite.prototype.constructor = PIXI.Sprite;
    -
    -/**
    - * The width of the sprite, setting this will actually modify the scale to achieve the value set
    - *
    - * @property width
    - * @type Number
    - */
    -Object.defineProperty(PIXI.Sprite.prototype, 'width', {
    -    get: function() {
    -        return this.scale.x * this.texture.frame.width;
    -    },
    -    set: function(value) {
    -        this.scale.x = value / this.texture.frame.width;
    -        this._width = value;
    -    }
    -});
    -
    -/**
    - * The height of the sprite, setting this will actually modify the scale to achieve the value set
    - *
    - * @property height
    - * @type Number
    - */
    -Object.defineProperty(PIXI.Sprite.prototype, 'height', {
    -    get: function() {
    -        return  this.scale.y * this.texture.frame.height;
    -    },
    -    set: function(value) {
    -        this.scale.y = value / this.texture.frame.height;
    -        this._height = value;
    -    }
    -});
    -
    -/**
    - * Sets the texture of the sprite
    - *
    - * @method setTexture
    - * @param texture {Texture} The PIXI texture that is displayed by the sprite
    - */
    -PIXI.Sprite.prototype.setTexture = function(texture)
    -{
    -    this.texture = texture;
    -    this.cachedTint = 0xFFFFFF;
    -};
    -
    -/**
    - * When the texture is updated, this event will fire to update the scale and frame
    - *
    - * @method onTextureUpdate
    - * @param event
    - * @private
    - */
    -PIXI.Sprite.prototype.onTextureUpdate = function()
    -{
    -    // so if _width is 0 then width was not set..
    -    if(this._width)this.scale.x = this._width / this.texture.frame.width;
    -    if(this._height)this.scale.y = this._height / this.texture.frame.height;
    -
    -    //this.updateFrame = true;
    -};
    -
    -/**
    -* Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account.
    -*
    -* @method getBounds
    -* @param matrix {Matrix} the transformation matrix of the sprite
    -* @return {Rectangle} the framing rectangle
    -*/
    -PIXI.Sprite.prototype.getBounds = function(matrix)
    -{
    -    var width = this.texture.frame.width;
    -    var height = this.texture.frame.height;
    -
    -    var w0 = width * (1-this.anchor.x);
    -    var w1 = width * -this.anchor.x;
    -
    -    var h0 = height * (1-this.anchor.y);
    -    var h1 = height * -this.anchor.y;
    -
    -    var worldTransform = matrix || this.worldTransform ;
    -
    -    var a = worldTransform.a;
    -    var b = worldTransform.b;
    -    var c = worldTransform.c;
    -    var d = worldTransform.d;
    -    var tx = worldTransform.tx;
    -    var ty = worldTransform.ty;
    -
    -    var x1 = a * w1 + c * h1 + tx;
    -    var y1 = d * h1 + b * w1 + ty;
    -
    -    var x2 = a * w0 + c * h1 + tx;
    -    var y2 = d * h1 + b * w0 + ty;
    -
    -    var x3 = a * w0 + c * h0 + tx;
    -    var y3 = d * h0 + b * w0 + ty;
    -
    -    var x4 =  a * w1 + c * h0 + tx;
    -    var y4 =  d * h0 + b * w1 + ty;
    -
    -    var maxX = -Infinity;
    -    var maxY = -Infinity;
    -
    -    var minX = Infinity;
    -    var minY = Infinity;
    -
    -    minX = x1 < minX ? x1 : minX;
    -    minX = x2 < minX ? x2 : minX;
    -    minX = x3 < minX ? x3 : minX;
    -    minX = x4 < minX ? x4 : minX;
    -
    -    minY = y1 < minY ? y1 : minY;
    -    minY = y2 < minY ? y2 : minY;
    -    minY = y3 < minY ? y3 : minY;
    -    minY = y4 < minY ? y4 : minY;
    -
    -    maxX = x1 > maxX ? x1 : maxX;
    -    maxX = x2 > maxX ? x2 : maxX;
    -    maxX = x3 > maxX ? x3 : maxX;
    -    maxX = x4 > maxX ? x4 : maxX;
    -
    -    maxY = y1 > maxY ? y1 : maxY;
    -    maxY = y2 > maxY ? y2 : maxY;
    -    maxY = y3 > maxY ? y3 : maxY;
    -    maxY = y4 > maxY ? y4 : maxY;
    -
    -    var bounds = this._bounds;
    -
    -    bounds.x = minX;
    -    bounds.width = maxX - minX;
    -
    -    bounds.y = minY;
    -    bounds.height = maxY - minY;
    -
    -    // store a reference so that if this function gets called again in the render cycle we do not have to recalculate
    -    this._currentBounds = bounds;
    -
    -    return bounds;
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession}
    -* @private
    -*/
    -PIXI.Sprite.prototype._renderWebGL = function(renderSession)
    -{
    -    // if the sprite is not visible or the alpha is 0 then no need to render this element
    -    if(!this.visible || this.alpha <= 0)return;
    -
    -    var i,j;
    -
    -    // do a quick check to see if this element has a mask or a filter.
    -    if(this._mask || this._filters)
    -    {
    -        var spriteBatch =  renderSession.spriteBatch;
    -
    -        // push filter first as we need to ensure the stencil buffer is correct for any masking
    -        if(this._filters)
    -        {
    -            spriteBatch.flush();
    -            renderSession.filterManager.pushFilter(this._filterBlock);
    -        }
    -
    -        if(this._mask)
    -        {
    -            spriteBatch.stop();
    -            renderSession.maskManager.pushMask(this.mask, renderSession);
    -            spriteBatch.start();
    -        }
    -
    -        // add this sprite to the batch
    -        spriteBatch.render(this);
    -
    -        // now loop through the children and make sure they get rendered
    -        for(i=0,j=this.children.length; i<j; i++)
    -        {
    -            this.children[i]._renderWebGL(renderSession);
    -        }
    -
    -        // time to stop the sprite batch as either a mask element or a filter draw will happen next
    -        spriteBatch.stop();
    -
    -        if(this._mask)renderSession.maskManager.popMask(this._mask, renderSession);
    -        if(this._filters)renderSession.filterManager.popFilter();
    -
    -        spriteBatch.start();
    -    }
    -    else
    -    {
    -        renderSession.spriteBatch.render(this);
    -
    -        // simple render children!
    -        for(i=0,j=this.children.length; i<j; i++)
    -        {
    -            this.children[i]._renderWebGL(renderSession);
    -        }
    -
    -    }
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession}
    -* @private
    -*/
    -PIXI.Sprite.prototype._renderCanvas = function(renderSession)
    -{
    -    // If the sprite is not visible or the alpha is 0 then no need to render this element
    -    if (this.visible === false || this.alpha === 0 || this.texture.crop.width <= 0 || this.texture.crop.height <= 0) return;
    -
    -    if (this.blendMode !== renderSession.currentBlendMode)
    -    {
    -        renderSession.currentBlendMode = this.blendMode;
    -        renderSession.context.globalCompositeOperation = PIXI.blendModesCanvas[renderSession.currentBlendMode];
    -    }
    -
    -    if (this._mask)
    -    {
    -        renderSession.maskManager.pushMask(this._mask, renderSession);
    -    }
    -
    -    //  Ignore null sources
    -    if (this.texture.valid)
    -    {
    -        var resolution = this.texture.baseTexture.resolution / renderSession.resolution;
    -
    -        renderSession.context.globalAlpha = this.worldAlpha;
    -
    -        //  Allow for pixel rounding
    -        if (renderSession.roundPixels)
    -        {
    -            renderSession.context.setTransform(
    -                this.worldTransform.a,
    -                this.worldTransform.b,
    -                this.worldTransform.c,
    -                this.worldTransform.d,
    -                (this.worldTransform.tx* renderSession.resolution) | 0,
    -                (this.worldTransform.ty* renderSession.resolution) | 0);
    -        }
    -        else
    -        {
    -            renderSession.context.setTransform(
    -                this.worldTransform.a,
    -                this.worldTransform.b,
    -                this.worldTransform.c,
    -                this.worldTransform.d,
    -                this.worldTransform.tx * renderSession.resolution,
    -                this.worldTransform.ty * renderSession.resolution);
    -        }
    -
    -        //  If smoothingEnabled is supported and we need to change the smoothing property for this texture
    -        if (renderSession.smoothProperty && renderSession.scaleMode !== this.texture.baseTexture.scaleMode)
    -        {
    -            renderSession.scaleMode = this.texture.baseTexture.scaleMode;
    -            renderSession.context[renderSession.smoothProperty] = (renderSession.scaleMode === PIXI.scaleModes.LINEAR);
    -        }
    -
    -        //  If the texture is trimmed we offset by the trim x/y, otherwise we use the frame dimensions
    -        var dx = (this.texture.trim) ? this.texture.trim.x - this.anchor.x * this.texture.trim.width : this.anchor.x * -this.texture.frame.width;
    -        var dy = (this.texture.trim) ? this.texture.trim.y - this.anchor.y * this.texture.trim.height : this.anchor.y * -this.texture.frame.height;
    -
    -        if (this.tint !== 0xFFFFFF)
    -        {
    -            if (this.cachedTint !== this.tint)
    -            {
    -                this.cachedTint = this.tint;
    -
    -                //  TODO clean up caching - how to clean up the caches?
    -                this.tintedTexture = PIXI.CanvasTinter.getTintedTexture(this, this.tint);
    -            }
    -
    -            renderSession.context.drawImage(
    -                                this.tintedTexture,
    -                                0,
    -                                0,
    -                                this.texture.crop.width,
    -                                this.texture.crop.height,
    -                                dx / resolution,
    -                                dy / resolution,
    -                                this.texture.crop.width / resolution,
    -                                this.texture.crop.height / resolution);
    -        }
    -        else
    -        {
    -            renderSession.context.drawImage(
    -                                this.texture.baseTexture.source,
    -                                this.texture.crop.x,
    -                                this.texture.crop.y,
    -                                this.texture.crop.width,
    -                                this.texture.crop.height,
    -                                dx / resolution,
    -                                dy / resolution,
    -                                this.texture.crop.width / resolution,
    -                                this.texture.crop.height / resolution);
    -        }
    -    }
    -
    -    // OVERWRITE
    -    for (var i = 0, j = this.children.length; i < j; i++)
    -    {
    -        this.children[i]._renderCanvas(renderSession);
    -    }
    -
    -    if (this._mask)
    -    {
    -        renderSession.maskManager.popMask(renderSession);
    -    }
    -};
    -
    -// some helper functions..
    -
    -/**
    - *
    - * Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId
    - * The frame ids are created when a Texture packer file has been loaded
    - *
    - * @method fromFrame
    - * @static
    - * @param frameId {String} The frame Id of the texture in the cache
    - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    - */
    -PIXI.Sprite.fromFrame = function(frameId)
    -{
    -    var texture = PIXI.TextureCache[frameId];
    -    if(!texture) throw new Error('The frameId "' + frameId + '" does not exist in the texture cache' + this);
    -    return new PIXI.Sprite(texture);
    -};
    -
    -/**
    - *
    - * Helper function that creates a sprite that will contain a texture based on an image url
    - * If the image is not in the texture cache it will be loaded
    - *
    - * @method fromImage
    - * @static
    - * @param imageId {String} The image url of the texture
    - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    - */
    -PIXI.Sprite.fromImage = function(imageId, crossorigin, scaleMode)
    -{
    -    var texture = PIXI.Texture.fromImage(imageId, crossorigin, scaleMode);
    -    return new PIXI.Sprite(texture);
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_display_SpriteBatch.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_display_SpriteBatch.js.html deleted file mode 100755 index b54f4c1..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_display_SpriteBatch.js.html +++ /dev/null @@ -1,455 +0,0 @@ - - - - - src/pixi/display/SpriteBatch.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/SpriteBatch.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/
    - */
    -
    -/**
    - * The SpriteBatch class is a really fast version of the DisplayObjectContainer 
    - * built solely for speed, so use when you need a lot of sprites or particles.
    - * And it's extremely easy to use : 
    -
    -    var container = new PIXI.SpriteBatch();
    - 
    -    stage.addChild(container);
    - 
    -    for(var i  = 0; i < 100; i++)
    -    {
    -        var sprite = new PIXI.Sprite.fromImage("myImage.png");
    -        container.addChild(sprite);
    -    }
    - * And here you have a hundred sprites that will be renderer at the speed of light
    - *
    - * @class SpriteBatch
    - * @constructor
    - * @param texture {Texture}
    - */
    -
    -//TODO RENAME to PARTICLE CONTAINER?
    -PIXI.SpriteBatch = function(texture)
    -{
    -    PIXI.DisplayObjectContainer.call( this);
    -
    -    this.textureThing = texture;
    -
    -    this.ready = false;
    -};
    -
    -PIXI.SpriteBatch.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
    -PIXI.SpriteBatch.prototype.constructor = PIXI.SpriteBatch;
    -
    -/*
    - * Initialises the spriteBatch
    - *
    - * @method initWebGL
    - * @param gl {WebGLContext} the current WebGL drawing context
    - */
    -PIXI.SpriteBatch.prototype.initWebGL = function(gl)
    -{
    -    // TODO only one needed for the whole engine really?
    -    this.fastSpriteBatch = new PIXI.WebGLFastSpriteBatch(gl);
    -
    -    this.ready = true;
    -};
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.SpriteBatch.prototype.updateTransform = function()
    -{
    -    // TODO don't need to!
    -    PIXI.DisplayObject.prototype.updateTransform.call( this );
    -    //  PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.SpriteBatch.prototype._renderWebGL = function(renderSession)
    -{
    -    if(!this.visible || this.alpha <= 0 || !this.children.length)return;
    -
    -    if(!this.ready)this.initWebGL( renderSession.gl );
    -    
    -    renderSession.spriteBatch.stop();
    -    
    -    renderSession.shaderManager.setShader(renderSession.shaderManager.fastShader);
    -    
    -    this.fastSpriteBatch.begin(this, renderSession);
    -    this.fastSpriteBatch.render(this);
    -
    -    renderSession.spriteBatch.start();
    - 
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.SpriteBatch.prototype._renderCanvas = function(renderSession)
    -{
    -    if(!this.visible || this.alpha <= 0 || !this.children.length)return;
    -    
    -    var context = renderSession.context;
    -    context.globalAlpha = this.worldAlpha;
    -
    -    PIXI.DisplayObject.prototype.updateTransform.call(this);
    -
    -    var transform = this.worldTransform;
    -    // alow for trimming
    -       
    -    var isRotated = true;
    -
    -    for (var i = 0; i < this.children.length; i++) {
    -       
    -        var child = this.children[i];
    -
    -        if(!child.visible)continue;
    -
    -        var texture = child.texture;
    -        var frame = texture.frame;
    -
    -        context.globalAlpha = this.worldAlpha * child.alpha;
    -
    -        if(child.rotation % (Math.PI * 2) === 0)
    -        {
    -            if(isRotated)
    -            {
    -                context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);
    -                isRotated = false;
    -            }
    -
    -            // this is the fastest  way to optimise! - if rotation is 0 then we can avoid any kind of setTransform call
    -            context.drawImage(texture.baseTexture.source,
    -                                 frame.x,
    -                                 frame.y,
    -                                 frame.width,
    -                                 frame.height,
    -                                 ((child.anchor.x) * (-frame.width * child.scale.x) + child.position.x  + 0.5) | 0,
    -                                 ((child.anchor.y) * (-frame.height * child.scale.y) + child.position.y  + 0.5) | 0,
    -                                 frame.width * child.scale.x,
    -                                 frame.height * child.scale.y);
    -        }
    -        else
    -        {
    -            if(!isRotated)isRotated = true;
    -    
    -            PIXI.DisplayObject.prototype.updateTransform.call(child);
    -           
    -            var childTransform = child.worldTransform;
    -
    -            // allow for trimming
    -           
    -            if (renderSession.roundPixels)
    -            {
    -                context.setTransform(childTransform.a, childTransform.b, childTransform.c, childTransform.d, childTransform.tx | 0, childTransform.ty | 0);
    -            }
    -            else
    -            {
    -                context.setTransform(childTransform.a, childTransform.b, childTransform.c, childTransform.d, childTransform.tx, childTransform.ty);
    -            }
    -
    -            context.drawImage(texture.baseTexture.source,
    -                                 frame.x,
    -                                 frame.y,
    -                                 frame.width,
    -                                 frame.height,
    -                                 ((child.anchor.x) * (-frame.width) + 0.5) | 0,
    -                                 ((child.anchor.y) * (-frame.height) + 0.5) | 0,
    -                                 frame.width,
    -                                 frame.height);
    -           
    -
    -        }
    -
    -       // context.restore();
    -    }
    -
    -//    context.restore();
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_display_Stage.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_display_Stage.js.html deleted file mode 100755 index 435f9dd..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_display_Stage.js.html +++ /dev/null @@ -1,413 +0,0 @@ - - - - - src/pixi/display/Stage.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/Stage.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A Stage represents the root of the display tree. Everything connected to the stage is rendered
    - *
    - * @class Stage
    - * @extends DisplayObjectContainer
    - * @constructor
    - * @param backgroundColor {Number} the background color of the stage, you have to pass this in is in hex format
    - *      like: 0xFFFFFF for white
    - * 
    - * Creating a stage is a mandatory process when you use Pixi, which is as simple as this : 
    - * var stage = new PIXI.Stage(0xFFFFFF);
    - * where the parameter given is the background colour of the stage, in hex
    - * you will use this stage instance to add your sprites to it and therefore to the renderer
    - * Here is how to add a sprite to the stage : 
    - * stage.addChild(sprite);
    - */
    -PIXI.Stage = function(backgroundColor)
    -{
    -    PIXI.DisplayObjectContainer.call( this );
    -
    -    /**
    -     * [read-only] Current transform of the object based on world (parent) factors
    -     *
    -     * @property worldTransform
    -     * @type Matrix
    -     * @readOnly
    -     * @private
    -     */
    -    this.worldTransform = new PIXI.Matrix();
    -
    -    /**
    -     * Whether or not the stage is interactive
    -     *
    -     * @property interactive
    -     * @type Boolean
    -     */
    -    this.interactive = true;
    -
    -    /**
    -     * The interaction manage for this stage, manages all interactive activity on the stage
    -     *
    -     * @property interactionManager
    -     * @type InteractionManager
    -     */
    -    this.interactionManager = new PIXI.InteractionManager(this);
    -
    -    /**
    -     * Whether the stage is dirty and needs to have interactions updated
    -     *
    -     * @property dirty
    -     * @type Boolean
    -     * @private
    -     */
    -    this.dirty = true;
    -
    -    //the stage is its own stage
    -    this.stage = this;
    -
    -    //optimize hit detection a bit
    -    this.stage.hitArea = new PIXI.Rectangle(0, 0, 100000, 100000);
    -
    -    this.setBackgroundColor(backgroundColor);
    -};
    -
    -// constructor
    -PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    -PIXI.Stage.prototype.constructor = PIXI.Stage;
    -
    -/**
    - * Sets another DOM element which can receive mouse/touch interactions instead of the default Canvas element.
    - * This is useful for when you have other DOM elements on top of the Canvas element.
    - *
    - * @method setInteractionDelegate
    - * @param domElement {DOMElement} This new domElement which will receive mouse/touch events
    - */
    -PIXI.Stage.prototype.setInteractionDelegate = function(domElement)
    -{
    -    this.interactionManager.setTargetDomElement( domElement );
    -};
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.Stage.prototype.updateTransform = function()
    -{
    -    this.worldAlpha = 1;
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        this.children[i].updateTransform();
    -    }
    -
    -    if(this.dirty)
    -    {
    -        this.dirty = false;
    -        // update interactive!
    -        this.interactionManager.dirty = true;
    -    }
    -
    -    if(this.interactive)this.interactionManager.update();
    -};
    -
    -/**
    - * Sets the background color for the stage
    - *
    - * @method setBackgroundColor
    - * @param backgroundColor {Number} the color of the background, easiest way to pass this in is in hex format
    - *      like: 0xFFFFFF for white
    - */
    -PIXI.Stage.prototype.setBackgroundColor = function(backgroundColor)
    -{
    -    this.backgroundColor = backgroundColor || 0x000000;
    -    this.backgroundColorSplit = PIXI.hex2rgb(this.backgroundColor);
    -    var hex = this.backgroundColor.toString(16);
    -    hex = '000000'.substr(0, 6 - hex.length) + hex;
    -    this.backgroundColorString = '#' + hex;
    -};
    -
    -/**
    - * This will return the point containing global coordinates of the mouse.
    - *
    - * @method getMousePosition
    - * @return {Point} A point containing the coordinates of the global InteractionData position.
    - */
    -PIXI.Stage.prototype.getMousePosition = function()
    -{
    -    return this.interactionManager.mouse.global;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_extras_Rope.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_extras_Rope.js.html deleted file mode 100755 index f4fd44c..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_extras_Rope.js.html +++ /dev/null @@ -1,452 +0,0 @@ - - - - - src/pixi/extras/Rope.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/extras/Rope.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * @copyright Mat Groves, Rovanion Luckey
    - */
    -
    -/**
    - *
    - * @class Rope
    - * @constructor
    - * @extends Strip
    - * @param {Texture} texture - The texture to use on the rope.
    - * @param {Array} points - An array of {PIXI.Point}.
    - *
    - */
    -PIXI.Rope = function(texture, points)
    -{
    -    PIXI.Strip.call( this, texture );
    -    this.points = points;
    -
    -    this.verticies = new PIXI.Float32Array(points.length * 4);
    -    this.uvs = new PIXI.Float32Array(points.length * 4);
    -    this.colors = new PIXI.Float32Array(points.length * 2);
    -    this.indices = new PIXI.Uint16Array(points.length * 2);
    -
    -
    -    this.refresh();
    -};
    -
    -
    -// constructor
    -PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    -PIXI.Rope.prototype.constructor = PIXI.Rope;
    -
    -/*
    - * Refreshes
    - *
    - * @method refresh
    - */
    -PIXI.Rope.prototype.refresh = function()
    -{
    -    var points = this.points;
    -    if(points.length < 1) return;
    -
    -    var uvs = this.uvs;
    -
    -    var lastPoint = points[0];
    -    var indices = this.indices;
    -    var colors = this.colors;
    -
    -    this.count-=0.2;
    -
    -    uvs[0] = 0;
    -    uvs[1] = 0;
    -    uvs[2] = 0;
    -    uvs[3] = 1;
    -
    -    colors[0] = 1;
    -    colors[1] = 1;
    -
    -    indices[0] = 0;
    -    indices[1] = 1;
    -
    -    var total = points.length,
    -        point, index, amount;
    -
    -    for (var i = 1; i < total; i++)
    -    {
    -        point = points[i];
    -        index = i * 4;
    -        // time to do some smart drawing!
    -        amount = i / (total-1);
    -
    -        if(i%2)
    -        {
    -            uvs[index] = amount;
    -            uvs[index+1] = 0;
    -
    -            uvs[index+2] = amount;
    -            uvs[index+3] = 1;
    -        }
    -        else
    -        {
    -            uvs[index] = amount;
    -            uvs[index+1] = 0;
    -
    -            uvs[index+2] = amount;
    -            uvs[index+3] = 1;
    -        }
    -
    -        index = i * 2;
    -        colors[index] = 1;
    -        colors[index+1] = 1;
    -
    -        index = i * 2;
    -        indices[index] = index;
    -        indices[index + 1] = index + 1;
    -
    -        lastPoint = point;
    -    }
    -};
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.Rope.prototype.updateTransform = function()
    -{
    -
    -    var points = this.points;
    -    if(points.length < 1)return;
    -
    -    var lastPoint = points[0];
    -    var nextPoint;
    -    var perp = {x:0, y:0};
    -
    -    this.count-=0.2;
    -
    -    var verticies = this.verticies;
    -    var total = points.length,
    -        point, index, ratio, perpLength, num;
    -
    -    for (var i = 0; i < total; i++)
    -    {
    -        point = points[i];
    -        index = i * 4;
    -
    -        if(i < points.length-1)
    -        {
    -            nextPoint = points[i+1];
    -        }
    -        else
    -        {
    -            nextPoint = point;
    -        }
    -
    -        perp.y = -(nextPoint.x - lastPoint.x);
    -        perp.x = nextPoint.y - lastPoint.y;
    -
    -        ratio = (1 - (i / (total-1))) * 10;
    -
    -        if(ratio > 1) ratio = 1;
    -
    -        perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    -        num = this.texture.height / 2; //(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    -        perp.x /= perpLength;
    -        perp.y /= perpLength;
    -
    -        perp.x *= num;
    -        perp.y *= num;
    -
    -        verticies[index] = point.x + perp.x;
    -        verticies[index+1] = point.y + perp.y;
    -        verticies[index+2] = point.x - perp.x;
    -        verticies[index+3] = point.y - perp.y;
    -
    -        lastPoint = point;
    -    }
    -
    -    PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    -};
    -/*
    - * Sets the texture that the Rope will use
    - *
    - * @method setTexture
    - * @param texture {Texture} the texture that will be used
    - */
    -PIXI.Rope.prototype.setTexture = function(texture)
    -{
    -    // stop current texture
    -    this.texture = texture;
    -    //this.updateFrame = true;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_extras_Spine.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_extras_Spine.js.html deleted file mode 100755 index a534e13..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_extras_Spine.js.html +++ /dev/null @@ -1,1752 +0,0 @@ - - - - - src/pixi/extras/Spine.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/extras/Spine.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * based on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi
    - *
    - * Awesome JS run time provided by EsotericSoftware
    - * https://github.com/EsotericSoftware/spine-runtimes
    - *
    - */
    -
    -/*
    - * Awesome JS run time provided by EsotericSoftware
    - *
    - * https://github.com/EsotericSoftware/spine-runtimes
    - *
    - */
    -
    -
    -
    -var spine = {};
    -
    -spine.BoneData = function (name, parent) {
    -    this.name = name;
    -    this.parent = parent;
    -};
    -spine.BoneData.prototype = {
    -    length: 0,
    -    x: 0, y: 0,
    -    rotation: 0,
    -    scaleX: 1, scaleY: 1
    -};
    -
    -spine.SlotData = function (name, boneData) {
    -    this.name = name;
    -    this.boneData = boneData;
    -};
    -spine.SlotData.prototype = {
    -    r: 1, g: 1, b: 1, a: 1,
    -    attachmentName: null
    -};
    -
    -spine.Bone = function (boneData, parent) {
    -    this.data = boneData;
    -    this.parent = parent;
    -    this.setToSetupPose();
    -};
    -spine.Bone.yDown = false;
    -spine.Bone.prototype = {
    -    x: 0, y: 0,
    -    rotation: 0,
    -    scaleX: 1, scaleY: 1,
    -    m00: 0, m01: 0, worldX: 0, // a b x
    -    m10: 0, m11: 0, worldY: 0, // c d y
    -    worldRotation: 0,
    -    worldScaleX: 1, worldScaleY: 1,
    -    updateWorldTransform: function (flipX, flipY) {
    -        var parent = this.parent;
    -        if (parent != null) {
    -            this.worldX = this.x * parent.m00 + this.y * parent.m01 + parent.worldX;
    -            this.worldY = this.x * parent.m10 + this.y * parent.m11 + parent.worldY;
    -            this.worldScaleX = parent.worldScaleX * this.scaleX;
    -            this.worldScaleY = parent.worldScaleY * this.scaleY;
    -            this.worldRotation = parent.worldRotation + this.rotation;
    -        } else {
    -            this.worldX = this.x;
    -            this.worldY = this.y;
    -            this.worldScaleX = this.scaleX;
    -            this.worldScaleY = this.scaleY;
    -            this.worldRotation = this.rotation;
    -        }
    -        var radians = this.worldRotation * Math.PI / 180;
    -        var cos = Math.cos(radians);
    -        var sin = Math.sin(radians);
    -        this.m00 = cos * this.worldScaleX;
    -        this.m10 = sin * this.worldScaleX;
    -        this.m01 = -sin * this.worldScaleY;
    -        this.m11 = cos * this.worldScaleY;
    -        if (flipX) {
    -            this.m00 = -this.m00;
    -            this.m01 = -this.m01;
    -        }
    -        if (flipY) {
    -            this.m10 = -this.m10;
    -            this.m11 = -this.m11;
    -        }
    -        if (spine.Bone.yDown) {
    -            this.m10 = -this.m10;
    -            this.m11 = -this.m11;
    -        }
    -    },
    -    setToSetupPose: function () {
    -        var data = this.data;
    -        this.x = data.x;
    -        this.y = data.y;
    -        this.rotation = data.rotation;
    -        this.scaleX = data.scaleX;
    -        this.scaleY = data.scaleY;
    -    }
    -};
    -
    -spine.Slot = function (slotData, skeleton, bone) {
    -    this.data = slotData;
    -    this.skeleton = skeleton;
    -    this.bone = bone;
    -    this.setToSetupPose();
    -};
    -spine.Slot.prototype = {
    -    r: 1, g: 1, b: 1, a: 1,
    -    _attachmentTime: 0,
    -    attachment: null,
    -    setAttachment: function (attachment) {
    -        this.attachment = attachment;
    -        this._attachmentTime = this.skeleton.time;
    -    },
    -    setAttachmentTime: function (time) {
    -        this._attachmentTime = this.skeleton.time - time;
    -    },
    -    getAttachmentTime: function () {
    -        return this.skeleton.time - this._attachmentTime;
    -    },
    -    setToSetupPose: function () {
    -        var data = this.data;
    -        this.r = data.r;
    -        this.g = data.g;
    -        this.b = data.b;
    -        this.a = data.a;
    -
    -        var slotDatas = this.skeleton.data.slots;
    -        for (var i = 0, n = slotDatas.length; i < n; i++) {
    -            if (slotDatas[i] == data) {
    -                this.setAttachment(!data.attachmentName ? null : this.skeleton.getAttachmentBySlotIndex(i, data.attachmentName));
    -                break;
    -            }
    -        }
    -    }
    -};
    -
    -spine.Skin = function (name) {
    -    this.name = name;
    -    this.attachments = {};
    -};
    -spine.Skin.prototype = {
    -    addAttachment: function (slotIndex, name, attachment) {
    -        this.attachments[slotIndex + ":" + name] = attachment;
    -    },
    -    getAttachment: function (slotIndex, name) {
    -        return this.attachments[slotIndex + ":" + name];
    -    },
    -    _attachAll: function (skeleton, oldSkin) {
    -        for (var key in oldSkin.attachments) {
    -            var colon = key.indexOf(":");
    -            var slotIndex = parseInt(key.substring(0, colon), 10);
    -            var name = key.substring(colon + 1);
    -            var slot = skeleton.slots[slotIndex];
    -            if (slot.attachment && slot.attachment.name == name) {
    -                var attachment = this.getAttachment(slotIndex, name);
    -                if (attachment) slot.setAttachment(attachment);
    -            }
    -        }
    -    }
    -};
    -
    -spine.Animation = function (name, timelines, duration) {
    -    this.name = name;
    -    this.timelines = timelines;
    -    this.duration = duration;
    -};
    -spine.Animation.prototype = {
    -    apply: function (skeleton, time, loop) {
    -        if (loop && this.duration) time %= this.duration;
    -        var timelines = this.timelines;
    -        for (var i = 0, n = timelines.length; i < n; i++)
    -            timelines[i].apply(skeleton, time, 1);
    -    },
    -    mix: function (skeleton, time, loop, alpha) {
    -        if (loop && this.duration) time %= this.duration;
    -        var timelines = this.timelines;
    -        for (var i = 0, n = timelines.length; i < n; i++)
    -            timelines[i].apply(skeleton, time, alpha);
    -    }
    -};
    -
    -spine.binarySearch = function (values, target, step) {
    -    var low = 0;
    -    var high = Math.floor(values.length / step) - 2;
    -    if (!high) return step;
    -    var current = high >>> 1;
    -    while (true) {
    -        if (values[(current + 1) * step] <= target)
    -            low = current + 1;
    -        else
    -            high = current;
    -        if (low == high) return (low + 1) * step;
    -        current = (low + high) >>> 1;
    -    }
    -};
    -spine.linearSearch = function (values, target, step) {
    -    for (var i = 0, last = values.length - step; i <= last; i += step)
    -        if (values[i] > target) return i;
    -    return -1;
    -};
    -
    -spine.Curves = function (frameCount) {
    -    this.curves = []; // dfx, dfy, ddfx, ddfy, dddfx, dddfy, ...
    -    this.curves.length = (frameCount - 1) * 6;
    -};
    -spine.Curves.prototype = {
    -    setLinear: function (frameIndex) {
    -        this.curves[frameIndex * 6] = 0/*LINEAR*/;
    -    },
    -    setStepped: function (frameIndex) {
    -        this.curves[frameIndex * 6] = -1/*STEPPED*/;
    -    },
    -    /** Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next.
    -     * cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of
    -     * the difference between the keyframe's values. */
    -    setCurve: function (frameIndex, cx1, cy1, cx2, cy2) {
    -        var subdiv_step = 1 / 10/*BEZIER_SEGMENTS*/;
    -        var subdiv_step2 = subdiv_step * subdiv_step;
    -        var subdiv_step3 = subdiv_step2 * subdiv_step;
    -        var pre1 = 3 * subdiv_step;
    -        var pre2 = 3 * subdiv_step2;
    -        var pre4 = 6 * subdiv_step2;
    -        var pre5 = 6 * subdiv_step3;
    -        var tmp1x = -cx1 * 2 + cx2;
    -        var tmp1y = -cy1 * 2 + cy2;
    -        var tmp2x = (cx1 - cx2) * 3 + 1;
    -        var tmp2y = (cy1 - cy2) * 3 + 1;
    -        var i = frameIndex * 6;
    -        var curves = this.curves;
    -        curves[i] = cx1 * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3;
    -        curves[i + 1] = cy1 * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3;
    -        curves[i + 2] = tmp1x * pre4 + tmp2x * pre5;
    -        curves[i + 3] = tmp1y * pre4 + tmp2y * pre5;
    -        curves[i + 4] = tmp2x * pre5;
    -        curves[i + 5] = tmp2y * pre5;
    -    },
    -    getCurvePercent: function (frameIndex, percent) {
    -        percent = percent < 0 ? 0 : (percent > 1 ? 1 : percent);
    -        var curveIndex = frameIndex * 6;
    -        var curves = this.curves;
    -        var dfx = curves[curveIndex];
    -        if (!dfx/*LINEAR*/) return percent;
    -        if (dfx == -1/*STEPPED*/) return 0;
    -        var dfy = curves[curveIndex + 1];
    -        var ddfx = curves[curveIndex + 2];
    -        var ddfy = curves[curveIndex + 3];
    -        var dddfx = curves[curveIndex + 4];
    -        var dddfy = curves[curveIndex + 5];
    -        var x = dfx, y = dfy;
    -        var i = 10/*BEZIER_SEGMENTS*/ - 2;
    -        while (true) {
    -            if (x >= percent) {
    -                var lastX = x - dfx;
    -                var lastY = y - dfy;
    -                return lastY + (y - lastY) * (percent - lastX) / (x - lastX);
    -            }
    -            if (!i) break;
    -            i--;
    -            dfx += ddfx;
    -            dfy += ddfy;
    -            ddfx += dddfx;
    -            ddfy += dddfy;
    -            x += dfx;
    -            y += dfy;
    -        }
    -        return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1.
    -    }
    -};
    -
    -spine.RotateTimeline = function (frameCount) {
    -    this.curves = new spine.Curves(frameCount);
    -    this.frames = []; // time, angle, ...
    -    this.frames.length = frameCount * 2;
    -};
    -spine.RotateTimeline.prototype = {
    -    boneIndex: 0,
    -    getFrameCount: function () {
    -        return this.frames.length / 2;
    -    },
    -    setFrame: function (frameIndex, time, angle) {
    -        frameIndex *= 2;
    -        this.frames[frameIndex] = time;
    -        this.frames[frameIndex + 1] = angle;
    -    },
    -    apply: function (skeleton, time, alpha) {
    -        var frames = this.frames,
    -            amount;
    -
    -        if (time < frames[0]) return; // Time is before first frame.
    -
    -        var bone = skeleton.bones[this.boneIndex];
    -
    -        if (time >= frames[frames.length - 2]) { // Time is after last frame.
    -            amount = bone.data.rotation + frames[frames.length - 1] - bone.rotation;
    -            while (amount > 180)
    -                amount -= 360;
    -            while (amount < -180)
    -                amount += 360;
    -            bone.rotation += amount * alpha;
    -            return;
    -        }
    -
    -        // Interpolate between the last frame and the current frame.
    -        var frameIndex = spine.binarySearch(frames, time, 2);
    -        var lastFrameValue = frames[frameIndex - 1];
    -        var frameTime = frames[frameIndex];
    -        var percent = 1 - (time - frameTime) / (frames[frameIndex - 2/*LAST_FRAME_TIME*/] - frameTime);
    -        percent = this.curves.getCurvePercent(frameIndex / 2 - 1, percent);
    -
    -        amount = frames[frameIndex + 1/*FRAME_VALUE*/] - lastFrameValue;
    -        while (amount > 180)
    -            amount -= 360;
    -        while (amount < -180)
    -            amount += 360;
    -        amount = bone.data.rotation + (lastFrameValue + amount * percent) - bone.rotation;
    -        while (amount > 180)
    -            amount -= 360;
    -        while (amount < -180)
    -            amount += 360;
    -        bone.rotation += amount * alpha;
    -    }
    -};
    -
    -spine.TranslateTimeline = function (frameCount) {
    -    this.curves = new spine.Curves(frameCount);
    -    this.frames = []; // time, x, y, ...
    -    this.frames.length = frameCount * 3;
    -};
    -spine.TranslateTimeline.prototype = {
    -    boneIndex: 0,
    -    getFrameCount: function () {
    -        return this.frames.length / 3;
    -    },
    -    setFrame: function (frameIndex, time, x, y) {
    -        frameIndex *= 3;
    -        this.frames[frameIndex] = time;
    -        this.frames[frameIndex + 1] = x;
    -        this.frames[frameIndex + 2] = y;
    -    },
    -    apply: function (skeleton, time, alpha) {
    -        var frames = this.frames;
    -        if (time < frames[0]) return; // Time is before first frame.
    -
    -        var bone = skeleton.bones[this.boneIndex];
    -
    -        if (time >= frames[frames.length - 3]) { // Time is after last frame.
    -            bone.x += (bone.data.x + frames[frames.length - 2] - bone.x) * alpha;
    -            bone.y += (bone.data.y + frames[frames.length - 1] - bone.y) * alpha;
    -            return;
    -        }
    -
    -        // Interpolate between the last frame and the current frame.
    -        var frameIndex = spine.binarySearch(frames, time, 3);
    -        var lastFrameX = frames[frameIndex - 2];
    -        var lastFrameY = frames[frameIndex - 1];
    -        var frameTime = frames[frameIndex];
    -        var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*LAST_FRAME_TIME*/] - frameTime);
    -        percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent);
    -
    -        bone.x += (bone.data.x + lastFrameX + (frames[frameIndex + 1/*FRAME_X*/] - lastFrameX) * percent - bone.x) * alpha;
    -        bone.y += (bone.data.y + lastFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - lastFrameY) * percent - bone.y) * alpha;
    -    }
    -};
    -
    -spine.ScaleTimeline = function (frameCount) {
    -    this.curves = new spine.Curves(frameCount);
    -    this.frames = []; // time, x, y, ...
    -    this.frames.length = frameCount * 3;
    -};
    -spine.ScaleTimeline.prototype = {
    -    boneIndex: 0,
    -    getFrameCount: function () {
    -        return this.frames.length / 3;
    -    },
    -    setFrame: function (frameIndex, time, x, y) {
    -        frameIndex *= 3;
    -        this.frames[frameIndex] = time;
    -        this.frames[frameIndex + 1] = x;
    -        this.frames[frameIndex + 2] = y;
    -    },
    -    apply: function (skeleton, time, alpha) {
    -        var frames = this.frames;
    -        if (time < frames[0]) return; // Time is before first frame.
    -
    -        var bone = skeleton.bones[this.boneIndex];
    -
    -        if (time >= frames[frames.length - 3]) { // Time is after last frame.
    -            bone.scaleX += (bone.data.scaleX - 1 + frames[frames.length - 2] - bone.scaleX) * alpha;
    -            bone.scaleY += (bone.data.scaleY - 1 + frames[frames.length - 1] - bone.scaleY) * alpha;
    -            return;
    -        }
    -
    -        // Interpolate between the last frame and the current frame.
    -        var frameIndex = spine.binarySearch(frames, time, 3);
    -        var lastFrameX = frames[frameIndex - 2];
    -        var lastFrameY = frames[frameIndex - 1];
    -        var frameTime = frames[frameIndex];
    -        var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*LAST_FRAME_TIME*/] - frameTime);
    -        percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent);
    -
    -        bone.scaleX += (bone.data.scaleX - 1 + lastFrameX + (frames[frameIndex + 1/*FRAME_X*/] - lastFrameX) * percent - bone.scaleX) * alpha;
    -        bone.scaleY += (bone.data.scaleY - 1 + lastFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - lastFrameY) * percent - bone.scaleY) * alpha;
    -    }
    -};
    -
    -spine.ColorTimeline = function (frameCount) {
    -    this.curves = new spine.Curves(frameCount);
    -    this.frames = []; // time, r, g, b, a, ...
    -    this.frames.length = frameCount * 5;
    -};
    -spine.ColorTimeline.prototype = {
    -    slotIndex: 0,
    -    getFrameCount: function () {
    -        return this.frames.length / 5;
    -    },
    -    setFrame: function (frameIndex, time, r, g, b, a) {
    -        frameIndex *= 5;
    -        this.frames[frameIndex] = time;
    -        this.frames[frameIndex + 1] = r;
    -        this.frames[frameIndex + 2] = g;
    -        this.frames[frameIndex + 3] = b;
    -        this.frames[frameIndex + 4] = a;
    -    },
    -    apply: function (skeleton, time, alpha) {
    -        var frames = this.frames;
    -        if (time < frames[0]) return; // Time is before first frame.
    -
    -        var slot = skeleton.slots[this.slotIndex];
    -
    -        if (time >= frames[frames.length - 5]) { // Time is after last frame.
    -            var i = frames.length - 1;
    -            slot.r = frames[i - 3];
    -            slot.g = frames[i - 2];
    -            slot.b = frames[i - 1];
    -            slot.a = frames[i];
    -            return;
    -        }
    -
    -        // Interpolate between the last frame and the current frame.
    -        var frameIndex = spine.binarySearch(frames, time, 5);
    -        var lastFrameR = frames[frameIndex - 4];
    -        var lastFrameG = frames[frameIndex - 3];
    -        var lastFrameB = frames[frameIndex - 2];
    -        var lastFrameA = frames[frameIndex - 1];
    -        var frameTime = frames[frameIndex];
    -        var percent = 1 - (time - frameTime) / (frames[frameIndex - 5/*LAST_FRAME_TIME*/] - frameTime);
    -        percent = this.curves.getCurvePercent(frameIndex / 5 - 1, percent);
    -
    -        var r = lastFrameR + (frames[frameIndex + 1/*FRAME_R*/] - lastFrameR) * percent;
    -        var g = lastFrameG + (frames[frameIndex + 2/*FRAME_G*/] - lastFrameG) * percent;
    -        var b = lastFrameB + (frames[frameIndex + 3/*FRAME_B*/] - lastFrameB) * percent;
    -        var a = lastFrameA + (frames[frameIndex + 4/*FRAME_A*/] - lastFrameA) * percent;
    -        if (alpha < 1) {
    -            slot.r += (r - slot.r) * alpha;
    -            slot.g += (g - slot.g) * alpha;
    -            slot.b += (b - slot.b) * alpha;
    -            slot.a += (a - slot.a) * alpha;
    -        } else {
    -            slot.r = r;
    -            slot.g = g;
    -            slot.b = b;
    -            slot.a = a;
    -        }
    -    }
    -};
    -
    -spine.AttachmentTimeline = function (frameCount) {
    -    this.curves = new spine.Curves(frameCount);
    -    this.frames = []; // time, ...
    -    this.frames.length = frameCount;
    -    this.attachmentNames = []; // time, ...
    -    this.attachmentNames.length = frameCount;
    -};
    -spine.AttachmentTimeline.prototype = {
    -    slotIndex: 0,
    -    getFrameCount: function () {
    -            return this.frames.length;
    -    },
    -    setFrame: function (frameIndex, time, attachmentName) {
    -        this.frames[frameIndex] = time;
    -        this.attachmentNames[frameIndex] = attachmentName;
    -    },
    -    apply: function (skeleton, time, alpha) {
    -        var frames = this.frames;
    -        if (time < frames[0]) return; // Time is before first frame.
    -
    -        var frameIndex;
    -        if (time >= frames[frames.length - 1]) // Time is after last frame.
    -            frameIndex = frames.length - 1;
    -        else
    -            frameIndex = spine.binarySearch(frames, time, 1) - 1;
    -
    -        var attachmentName = this.attachmentNames[frameIndex];
    -        skeleton.slots[this.slotIndex].setAttachment(!attachmentName ? null : skeleton.getAttachmentBySlotIndex(this.slotIndex, attachmentName));
    -    }
    -};
    -
    -spine.SkeletonData = function () {
    -    this.bones = [];
    -    this.slots = [];
    -    this.skins = [];
    -    this.animations = [];
    -};
    -spine.SkeletonData.prototype = {
    -    defaultSkin: null,
    -    /** @return May be null. */
    -    findBone: function (boneName) {
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            if (bones[i].name == boneName) return bones[i];
    -        return null;
    -    },
    -    /** @return -1 if the bone was not found. */
    -    findBoneIndex: function (boneName) {
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            if (bones[i].name == boneName) return i;
    -        return -1;
    -    },
    -    /** @return May be null. */
    -    findSlot: function (slotName) {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.length; i < n; i++) {
    -            if (slots[i].name == slotName) return slot[i];
    -        }
    -        return null;
    -    },
    -    /** @return -1 if the bone was not found. */
    -    findSlotIndex: function (slotName) {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.length; i < n; i++)
    -            if (slots[i].name == slotName) return i;
    -        return -1;
    -    },
    -    /** @return May be null. */
    -    findSkin: function (skinName) {
    -        var skins = this.skins;
    -        for (var i = 0, n = skins.length; i < n; i++)
    -            if (skins[i].name == skinName) return skins[i];
    -        return null;
    -    },
    -    /** @return May be null. */
    -    findAnimation: function (animationName) {
    -        var animations = this.animations;
    -        for (var i = 0, n = animations.length; i < n; i++)
    -            if (animations[i].name == animationName) return animations[i];
    -        return null;
    -    }
    -};
    -
    -spine.Skeleton = function (skeletonData) {
    -    this.data = skeletonData;
    -
    -    this.bones = [];
    -    for (var i = 0, n = skeletonData.bones.length; i < n; i++) {
    -        var boneData = skeletonData.bones[i];
    -        var parent = !boneData.parent ? null : this.bones[skeletonData.bones.indexOf(boneData.parent)];
    -        this.bones.push(new spine.Bone(boneData, parent));
    -    }
    -
    -    this.slots = [];
    -    this.drawOrder = [];
    -    for (i = 0, n = skeletonData.slots.length; i < n; i++) {
    -        var slotData = skeletonData.slots[i];
    -        var bone = this.bones[skeletonData.bones.indexOf(slotData.boneData)];
    -        var slot = new spine.Slot(slotData, this, bone);
    -        this.slots.push(slot);
    -        this.drawOrder.push(slot);
    -    }
    -};
    -spine.Skeleton.prototype = {
    -    x: 0, y: 0,
    -    skin: null,
    -    r: 1, g: 1, b: 1, a: 1,
    -    time: 0,
    -    flipX: false, flipY: false,
    -    /** Updates the world transform for each bone. */
    -    updateWorldTransform: function () {
    -        var flipX = this.flipX;
    -        var flipY = this.flipY;
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            bones[i].updateWorldTransform(flipX, flipY);
    -    },
    -    /** Sets the bones and slots to their setup pose values. */
    -    setToSetupPose: function () {
    -        this.setBonesToSetupPose();
    -        this.setSlotsToSetupPose();
    -    },
    -    setBonesToSetupPose: function () {
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            bones[i].setToSetupPose();
    -    },
    -    setSlotsToSetupPose: function () {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.length; i < n; i++)
    -            slots[i].setToSetupPose(i);
    -    },
    -    /** @return May return null. */
    -    getRootBone: function () {
    -        return this.bones.length ? this.bones[0] : null;
    -    },
    -    /** @return May be null. */
    -    findBone: function (boneName) {
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            if (bones[i].data.name == boneName) return bones[i];
    -        return null;
    -    },
    -    /** @return -1 if the bone was not found. */
    -    findBoneIndex: function (boneName) {
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            if (bones[i].data.name == boneName) return i;
    -        return -1;
    -    },
    -    /** @return May be null. */
    -    findSlot: function (slotName) {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.length; i < n; i++)
    -            if (slots[i].data.name == slotName) return slots[i];
    -        return null;
    -    },
    -    /** @return -1 if the bone was not found. */
    -    findSlotIndex: function (slotName) {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.length; i < n; i++)
    -            if (slots[i].data.name == slotName) return i;
    -        return -1;
    -    },
    -    setSkinByName: function (skinName) {
    -        var skin = this.data.findSkin(skinName);
    -        if (!skin) throw "Skin not found: " + skinName;
    -        this.setSkin(skin);
    -    },
    -    /** Sets the skin used to look up attachments not found in the {@link SkeletonData#getDefaultSkin() default skin}. Attachments
    -     * from the new skin are attached if the corresponding attachment from the old skin was attached.
    -     * @param newSkin May be null. */
    -    setSkin: function (newSkin) {
    -        if (this.skin && newSkin) newSkin._attachAll(this, this.skin);
    -        this.skin = newSkin;
    -    },
    -    /** @return May be null. */
    -    getAttachmentBySlotName: function (slotName, attachmentName) {
    -        return this.getAttachmentBySlotIndex(this.data.findSlotIndex(slotName), attachmentName);
    -    },
    -    /** @return May be null. */
    -    getAttachmentBySlotIndex: function (slotIndex, attachmentName) {
    -        if (this.skin) {
    -            var attachment = this.skin.getAttachment(slotIndex, attachmentName);
    -            if (attachment) return attachment;
    -        }
    -        if (this.data.defaultSkin) return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);
    -        return null;
    -    },
    -    /** @param attachmentName May be null. */
    -    setAttachment: function (slotName, attachmentName) {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.size; i < n; i++) {
    -            var slot = slots[i];
    -            if (slot.data.name == slotName) {
    -                var attachment = null;
    -                if (attachmentName) {
    -                    attachment = this.getAttachment(i, attachmentName);
    -                    if (attachment == null) throw "Attachment not found: " + attachmentName + ", for slot: " + slotName;
    -                }
    -                slot.setAttachment(attachment);
    -                return;
    -            }
    -        }
    -        throw "Slot not found: " + slotName;
    -    },
    -    update: function (delta) {
    -        time += delta;
    -    }
    -};
    -
    -spine.AttachmentType = {
    -    region: 0
    -};
    -
    -spine.RegionAttachment = function () {
    -    this.offset = [];
    -    this.offset.length = 8;
    -    this.uvs = [];
    -    this.uvs.length = 8;
    -};
    -spine.RegionAttachment.prototype = {
    -    x: 0, y: 0,
    -    rotation: 0,
    -    scaleX: 1, scaleY: 1,
    -    width: 0, height: 0,
    -    rendererObject: null,
    -    regionOffsetX: 0, regionOffsetY: 0,
    -    regionWidth: 0, regionHeight: 0,
    -    regionOriginalWidth: 0, regionOriginalHeight: 0,
    -    setUVs: function (u, v, u2, v2, rotate) {
    -        var uvs = this.uvs;
    -        if (rotate) {
    -            uvs[2/*X2*/] = u;
    -            uvs[3/*Y2*/] = v2;
    -            uvs[4/*X3*/] = u;
    -            uvs[5/*Y3*/] = v;
    -            uvs[6/*X4*/] = u2;
    -            uvs[7/*Y4*/] = v;
    -            uvs[0/*X1*/] = u2;
    -            uvs[1/*Y1*/] = v2;
    -        } else {
    -            uvs[0/*X1*/] = u;
    -            uvs[1/*Y1*/] = v2;
    -            uvs[2/*X2*/] = u;
    -            uvs[3/*Y2*/] = v;
    -            uvs[4/*X3*/] = u2;
    -            uvs[5/*Y3*/] = v;
    -            uvs[6/*X4*/] = u2;
    -            uvs[7/*Y4*/] = v2;
    -        }
    -    },
    -    updateOffset: function () {
    -        var regionScaleX = this.width / this.regionOriginalWidth * this.scaleX;
    -        var regionScaleY = this.height / this.regionOriginalHeight * this.scaleY;
    -        var localX = -this.width / 2 * this.scaleX + this.regionOffsetX * regionScaleX;
    -        var localY = -this.height / 2 * this.scaleY + this.regionOffsetY * regionScaleY;
    -        var localX2 = localX + this.regionWidth * regionScaleX;
    -        var localY2 = localY + this.regionHeight * regionScaleY;
    -        var radians = this.rotation * Math.PI / 180;
    -        var cos = Math.cos(radians);
    -        var sin = Math.sin(radians);
    -        var localXCos = localX * cos + this.x;
    -        var localXSin = localX * sin;
    -        var localYCos = localY * cos + this.y;
    -        var localYSin = localY * sin;
    -        var localX2Cos = localX2 * cos + this.x;
    -        var localX2Sin = localX2 * sin;
    -        var localY2Cos = localY2 * cos + this.y;
    -        var localY2Sin = localY2 * sin;
    -        var offset = this.offset;
    -        offset[0/*X1*/] = localXCos - localYSin;
    -        offset[1/*Y1*/] = localYCos + localXSin;
    -        offset[2/*X2*/] = localXCos - localY2Sin;
    -        offset[3/*Y2*/] = localY2Cos + localXSin;
    -        offset[4/*X3*/] = localX2Cos - localY2Sin;
    -        offset[5/*Y3*/] = localY2Cos + localX2Sin;
    -        offset[6/*X4*/] = localX2Cos - localYSin;
    -        offset[7/*Y4*/] = localYCos + localX2Sin;
    -    },
    -    computeVertices: function (x, y, bone, vertices) {
    -        x += bone.worldX;
    -        y += bone.worldY;
    -        var m00 = bone.m00;
    -        var m01 = bone.m01;
    -        var m10 = bone.m10;
    -        var m11 = bone.m11;
    -        var offset = this.offset;
    -        vertices[0/*X1*/] = offset[0/*X1*/] * m00 + offset[1/*Y1*/] * m01 + x;
    -        vertices[1/*Y1*/] = offset[0/*X1*/] * m10 + offset[1/*Y1*/] * m11 + y;
    -        vertices[2/*X2*/] = offset[2/*X2*/] * m00 + offset[3/*Y2*/] * m01 + x;
    -        vertices[3/*Y2*/] = offset[2/*X2*/] * m10 + offset[3/*Y2*/] * m11 + y;
    -        vertices[4/*X3*/] = offset[4/*X3*/] * m00 + offset[5/*X3*/] * m01 + x;
    -        vertices[5/*X3*/] = offset[4/*X3*/] * m10 + offset[5/*X3*/] * m11 + y;
    -        vertices[6/*X4*/] = offset[6/*X4*/] * m00 + offset[7/*Y4*/] * m01 + x;
    -        vertices[7/*Y4*/] = offset[6/*X4*/] * m10 + offset[7/*Y4*/] * m11 + y;
    -    }
    -}
    -
    -spine.AnimationStateData = function (skeletonData) {
    -    this.skeletonData = skeletonData;
    -    this.animationToMixTime = {};
    -};
    -spine.AnimationStateData.prototype = {
    -        defaultMix: 0,
    -    setMixByName: function (fromName, toName, duration) {
    -        var from = this.skeletonData.findAnimation(fromName);
    -        if (!from) throw "Animation not found: " + fromName;
    -        var to = this.skeletonData.findAnimation(toName);
    -        if (!to) throw "Animation not found: " + toName;
    -        this.setMix(from, to, duration);
    -    },
    -    setMix: function (from, to, duration) {
    -        this.animationToMixTime[from.name + ":" + to.name] = duration;
    -    },
    -    getMix: function (from, to) {
    -        var time = this.animationToMixTime[from.name + ":" + to.name];
    -            return time ? time : this.defaultMix;
    -    }
    -};
    -
    -spine.AnimationState = function (stateData) {
    -    this.data = stateData;
    -    this.queue = [];
    -};
    -spine.AnimationState.prototype = {
    -    animationSpeed: 1,
    -    current: null,
    -    previous: null,
    -    currentTime: 0,
    -    previousTime: 0,
    -    currentLoop: false,
    -    previousLoop: false,
    -    mixTime: 0,
    -    mixDuration: 0,
    -    update: function (delta) {
    -        this.currentTime += (delta * this.animationSpeed); //timeScale: Multiply delta by the speed of animation required.
    -        this.previousTime += delta;
    -        this.mixTime += delta;
    -
    -        if (this.queue.length > 0) {
    -            var entry = this.queue[0];
    -            if (this.currentTime >= entry.delay) {
    -                this._setAnimation(entry.animation, entry.loop);
    -                this.queue.shift();
    -            }
    -        }
    -    },
    -    apply: function (skeleton) {
    -        if (!this.current) return;
    -        if (this.previous) {
    -            this.previous.apply(skeleton, this.previousTime, this.previousLoop);
    -            var alpha = this.mixTime / this.mixDuration;
    -            if (alpha >= 1) {
    -                alpha = 1;
    -                this.previous = null;
    -            }
    -            this.current.mix(skeleton, this.currentTime, this.currentLoop, alpha);
    -        } else
    -            this.current.apply(skeleton, this.currentTime, this.currentLoop);
    -    },
    -    clearAnimation: function () {
    -        this.previous = null;
    -        this.current = null;
    -        this.queue.length = 0;
    -    },
    -    _setAnimation: function (animation, loop) {
    -        this.previous = null;
    -        if (animation && this.current) {
    -            this.mixDuration = this.data.getMix(this.current, animation);
    -            if (this.mixDuration > 0) {
    -                this.mixTime = 0;
    -                this.previous = this.current;
    -                this.previousTime = this.currentTime;
    -                this.previousLoop = this.currentLoop;
    -            }
    -        }
    -        this.current = animation;
    -        this.currentLoop = loop;
    -        this.currentTime = 0;
    -    },
    -    /** @see #setAnimation(Animation, Boolean) */
    -    setAnimationByName: function (animationName, loop) {
    -        var animation = this.data.skeletonData.findAnimation(animationName);
    -        if (!animation) throw "Animation not found: " + animationName;
    -        this.setAnimation(animation, loop);
    -    },
    -    /** Set the current animation. Any queued animations are cleared and the current animation time is set to 0.
    -     * @param animation May be null. */
    -    setAnimation: function (animation, loop) {
    -        this.queue.length = 0;
    -        this._setAnimation(animation, loop);
    -    },
    -    /** @see #addAnimation(Animation, Boolean, Number) */
    -    addAnimationByName: function (animationName, loop, delay) {
    -        var animation = this.data.skeletonData.findAnimation(animationName);
    -        if (!animation) throw "Animation not found: " + animationName;
    -        this.addAnimation(animation, loop, delay);
    -    },
    -    /** Adds an animation to be played delay seconds after the current or last queued animation.
    -     * @param delay May be <= 0 to use duration of previous animation minus any mix duration plus the negative delay. */
    -    addAnimation: function (animation, loop, delay) {
    -        var entry = {};
    -        entry.animation = animation;
    -        entry.loop = loop;
    -
    -        if (!delay || delay <= 0) {
    -            var previousAnimation = this.queue.length ? this.queue[this.queue.length - 1].animation : this.current;
    -            if (previousAnimation != null)
    -                delay = previousAnimation.duration - this.data.getMix(previousAnimation, animation) + (delay || 0);
    -            else
    -                delay = 0;
    -        }
    -        entry.delay = delay;
    -
    -        this.queue.push(entry);
    -    },
    -    /** Returns true if no animation is set or if the current time is greater than the animation duration, regardless of looping. */
    -    isComplete: function () {
    -        return !this.current || this.currentTime >= this.current.duration;
    -    }
    -};
    -
    -spine.SkeletonJson = function (attachmentLoader) {
    -    this.attachmentLoader = attachmentLoader;
    -};
    -spine.SkeletonJson.prototype = {
    -    scale: 1,
    -    readSkeletonData: function (root) {
    -        /*jshint -W069*/
    -        var skeletonData = new spine.SkeletonData(),
    -            boneData;
    -
    -        // Bones.
    -        var bones = root["bones"];
    -        for (var i = 0, n = bones.length; i < n; i++) {
    -            var boneMap = bones[i];
    -            var parent = null;
    -            if (boneMap["parent"]) {
    -                parent = skeletonData.findBone(boneMap["parent"]);
    -                if (!parent) throw "Parent bone not found: " + boneMap["parent"];
    -            }
    -            boneData = new spine.BoneData(boneMap["name"], parent);
    -            boneData.length = (boneMap["length"] || 0) * this.scale;
    -            boneData.x = (boneMap["x"] || 0) * this.scale;
    -            boneData.y = (boneMap["y"] || 0) * this.scale;
    -            boneData.rotation = (boneMap["rotation"] || 0);
    -            boneData.scaleX = boneMap["scaleX"] || 1;
    -            boneData.scaleY = boneMap["scaleY"] || 1;
    -            skeletonData.bones.push(boneData);
    -        }
    -
    -        // Slots.
    -        var slots = root["slots"];
    -        for (i = 0, n = slots.length; i < n; i++) {
    -            var slotMap = slots[i];
    -            boneData = skeletonData.findBone(slotMap["bone"]);
    -            if (!boneData) throw "Slot bone not found: " + slotMap["bone"];
    -            var slotData = new spine.SlotData(slotMap["name"], boneData);
    -
    -            var color = slotMap["color"];
    -            if (color) {
    -                slotData.r = spine.SkeletonJson.toColor(color, 0);
    -                slotData.g = spine.SkeletonJson.toColor(color, 1);
    -                slotData.b = spine.SkeletonJson.toColor(color, 2);
    -                slotData.a = spine.SkeletonJson.toColor(color, 3);
    -            }
    -
    -            slotData.attachmentName = slotMap["attachment"];
    -
    -            skeletonData.slots.push(slotData);
    -        }
    -
    -        // Skins.
    -        var skins = root["skins"];
    -        for (var skinName in skins) {
    -            if (!skins.hasOwnProperty(skinName)) continue;
    -            var skinMap = skins[skinName];
    -            var skin = new spine.Skin(skinName);
    -            for (var slotName in skinMap) {
    -                if (!skinMap.hasOwnProperty(slotName)) continue;
    -                var slotIndex = skeletonData.findSlotIndex(slotName);
    -                var slotEntry = skinMap[slotName];
    -                for (var attachmentName in slotEntry) {
    -                    if (!slotEntry.hasOwnProperty(attachmentName)) continue;
    -                    var attachment = this.readAttachment(skin, attachmentName, slotEntry[attachmentName]);
    -                    if (attachment != null) skin.addAttachment(slotIndex, attachmentName, attachment);
    -                }
    -            }
    -            skeletonData.skins.push(skin);
    -            if (skin.name == "default") skeletonData.defaultSkin = skin;
    -        }
    -
    -        // Animations.
    -        var animations = root["animations"];
    -        for (var animationName in animations) {
    -            if (!animations.hasOwnProperty(animationName)) continue;
    -            this.readAnimation(animationName, animations[animationName], skeletonData);
    -        }
    -
    -        return skeletonData;
    -    },
    -    readAttachment: function (skin, name, map) {
    -        /*jshint -W069*/
    -        name = map["name"] || name;
    -
    -        var type = spine.AttachmentType[map["type"] || "region"];
    -
    -        if (type == spine.AttachmentType.region) {
    -            var attachment = new spine.RegionAttachment();
    -            attachment.x = (map["x"] || 0) * this.scale;
    -            attachment.y = (map["y"] || 0) * this.scale;
    -            attachment.scaleX = map["scaleX"] || 1;
    -            attachment.scaleY = map["scaleY"] || 1;
    -            attachment.rotation = map["rotation"] || 0;
    -            attachment.width = (map["width"] || 32) * this.scale;
    -            attachment.height = (map["height"] || 32) * this.scale;
    -            attachment.updateOffset();
    -
    -            attachment.rendererObject = {};
    -            attachment.rendererObject.name = name;
    -            attachment.rendererObject.scale = {};
    -            attachment.rendererObject.scale.x = attachment.scaleX;
    -            attachment.rendererObject.scale.y = attachment.scaleY;
    -            attachment.rendererObject.rotation = -attachment.rotation * Math.PI / 180;
    -            return attachment;
    -        }
    -
    -            throw "Unknown attachment type: " + type;
    -    },
    -
    -    readAnimation: function (name, map, skeletonData) {
    -        /*jshint -W069*/
    -        var timelines = [];
    -        var duration = 0;
    -        var frameIndex, timeline, timelineName, valueMap, values,
    -            i, n;
    -
    -        var bones = map["bones"];
    -        for (var boneName in bones) {
    -            if (!bones.hasOwnProperty(boneName)) continue;
    -            var boneIndex = skeletonData.findBoneIndex(boneName);
    -            if (boneIndex == -1) throw "Bone not found: " + boneName;
    -            var boneMap = bones[boneName];
    -
    -            for (timelineName in boneMap) {
    -                if (!boneMap.hasOwnProperty(timelineName)) continue;
    -                values = boneMap[timelineName];
    -                if (timelineName == "rotate") {
    -                    timeline = new spine.RotateTimeline(values.length);
    -                    timeline.boneIndex = boneIndex;
    -
    -                    frameIndex = 0;
    -                    for (i = 0, n = values.length; i < n; i++) {
    -                        valueMap = values[i];
    -                        timeline.setFrame(frameIndex, valueMap["time"], valueMap["angle"]);
    -                        spine.SkeletonJson.readCurve(timeline, frameIndex, valueMap);
    -                        frameIndex++;
    -                    }
    -                    timelines.push(timeline);
    -                    duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 2 - 2]);
    -
    -                } else if (timelineName == "translate" || timelineName == "scale") {
    -                    var timelineScale = 1;
    -                    if (timelineName == "scale")
    -                        timeline = new spine.ScaleTimeline(values.length);
    -                    else {
    -                        timeline = new spine.TranslateTimeline(values.length);
    -                        timelineScale = this.scale;
    -                    }
    -                    timeline.boneIndex = boneIndex;
    -
    -                    frameIndex = 0;
    -                    for (i = 0, n = values.length; i < n; i++) {
    -                        valueMap = values[i];
    -                        var x = (valueMap["x"] || 0) * timelineScale;
    -                        var y = (valueMap["y"] || 0) * timelineScale;
    -                        timeline.setFrame(frameIndex, valueMap["time"], x, y);
    -                        spine.SkeletonJson.readCurve(timeline, frameIndex, valueMap);
    -                        frameIndex++;
    -                    }
    -                    timelines.push(timeline);
    -                    duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 3 - 3]);
    -
    -                } else
    -                    throw "Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")";
    -            }
    -        }
    -        var slots = map["slots"];
    -        for (var slotName in slots) {
    -            if (!slots.hasOwnProperty(slotName)) continue;
    -            var slotMap = slots[slotName];
    -            var slotIndex = skeletonData.findSlotIndex(slotName);
    -
    -            for (timelineName in slotMap) {
    -                if (!slotMap.hasOwnProperty(timelineName)) continue;
    -                values = slotMap[timelineName];
    -                if (timelineName == "color") {
    -                    timeline = new spine.ColorTimeline(values.length);
    -                    timeline.slotIndex = slotIndex;
    -
    -                    frameIndex = 0;
    -                    for (i = 0, n = values.length; i < n; i++) {
    -                        valueMap = values[i];
    -                        var color = valueMap["color"];
    -                        var r = spine.SkeletonJson.toColor(color, 0);
    -                        var g = spine.SkeletonJson.toColor(color, 1);
    -                        var b = spine.SkeletonJson.toColor(color, 2);
    -                        var a = spine.SkeletonJson.toColor(color, 3);
    -                        timeline.setFrame(frameIndex, valueMap["time"], r, g, b, a);
    -                        spine.SkeletonJson.readCurve(timeline, frameIndex, valueMap);
    -                        frameIndex++;
    -                    }
    -                    timelines.push(timeline);
    -                    duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 5 - 5]);
    -
    -                } else if (timelineName == "attachment") {
    -                    timeline = new spine.AttachmentTimeline(values.length);
    -                    timeline.slotIndex = slotIndex;
    -
    -                    frameIndex = 0;
    -                    for (i = 0, n = values.length; i < n; i++) {
    -                        valueMap = values[i];
    -                        timeline.setFrame(frameIndex++, valueMap["time"], valueMap["name"]);
    -                    }
    -                    timelines.push(timeline);
    -                        duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);
    -
    -                } else
    -                    throw "Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")";
    -            }
    -        }
    -        skeletonData.animations.push(new spine.Animation(name, timelines, duration));
    -    }
    -};
    -spine.SkeletonJson.readCurve = function (timeline, frameIndex, valueMap) {
    -    /*jshint -W069*/
    -    var curve = valueMap["curve"];
    -    if (!curve) return;
    -    if (curve == "stepped")
    -        timeline.curves.setStepped(frameIndex);
    -    else if (curve instanceof Array)
    -        timeline.curves.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]);
    -};
    -spine.SkeletonJson.toColor = function (hexString, colorIndex) {
    -    if (hexString.length != 8) throw "Color hexidecimal length must be 8, recieved: " + hexString;
    -    return parseInt(hexString.substr(colorIndex * 2, 2), 16) / 255;
    -};
    -
    -spine.Atlas = function (atlasText, textureLoader) {
    -    this.textureLoader = textureLoader;
    -    this.pages = [];
    -    this.regions = [];
    -
    -    var reader = new spine.AtlasReader(atlasText);
    -    var tuple = [];
    -    tuple.length = 4;
    -    var page = null;
    -    while (true) {
    -        var line = reader.readLine();
    -        if (line == null) break;
    -        line = reader.trim(line);
    -        if (!line.length)
    -            page = null;
    -        else if (!page) {
    -            page = new spine.AtlasPage();
    -            page.name = line;
    -
    -            page.format = spine.Atlas.Format[reader.readValue()];
    -
    -            reader.readTuple(tuple);
    -            page.minFilter = spine.Atlas.TextureFilter[tuple[0]];
    -            page.magFilter = spine.Atlas.TextureFilter[tuple[1]];
    -
    -            var direction = reader.readValue();
    -            page.uWrap = spine.Atlas.TextureWrap.clampToEdge;
    -            page.vWrap = spine.Atlas.TextureWrap.clampToEdge;
    -            if (direction == "x")
    -                page.uWrap = spine.Atlas.TextureWrap.repeat;
    -            else if (direction == "y")
    -                page.vWrap = spine.Atlas.TextureWrap.repeat;
    -            else if (direction == "xy")
    -                page.uWrap = page.vWrap = spine.Atlas.TextureWrap.repeat;
    -
    -            textureLoader.load(page, line);
    -
    -            this.pages.push(page);
    -
    -        } else {
    -            var region = new spine.AtlasRegion();
    -            region.name = line;
    -            region.page = page;
    -
    -            region.rotate = reader.readValue() == "true";
    -
    -            reader.readTuple(tuple);
    -            var x = parseInt(tuple[0], 10);
    -            var y = parseInt(tuple[1], 10);
    -
    -            reader.readTuple(tuple);
    -            var width = parseInt(tuple[0], 10);
    -            var height = parseInt(tuple[1], 10);
    -
    -            region.u = x / page.width;
    -            region.v = y / page.height;
    -            if (region.rotate) {
    -                region.u2 = (x + height) / page.width;
    -                region.v2 = (y + width) / page.height;
    -            } else {
    -                region.u2 = (x + width) / page.width;
    -                region.v2 = (y + height) / page.height;
    -            }
    -            region.x = x;
    -            region.y = y;
    -            region.width = Math.abs(width);
    -            region.height = Math.abs(height);
    -
    -            if (reader.readTuple(tuple) == 4) { // split is optional
    -                region.splits = [parseInt(tuple[0], 10), parseInt(tuple[1], 10), parseInt(tuple[2], 10), parseInt(tuple[3], 10)];
    -
    -                if (reader.readTuple(tuple) == 4) { // pad is optional, but only present with splits
    -                    region.pads = [parseInt(tuple[0], 10), parseInt(tuple[1], 10), parseInt(tuple[2], 10), parseInt(tuple[3], 10)];
    -
    -                    reader.readTuple(tuple);
    -                }
    -            }
    -
    -            region.originalWidth = parseInt(tuple[0], 10);
    -            region.originalHeight = parseInt(tuple[1], 10);
    -
    -            reader.readTuple(tuple);
    -            region.offsetX = parseInt(tuple[0], 10);
    -            region.offsetY = parseInt(tuple[1], 10);
    -
    -            region.index = parseInt(reader.readValue(), 10);
    -
    -            this.regions.push(region);
    -        }
    -    }
    -};
    -spine.Atlas.prototype = {
    -    findRegion: function (name) {
    -        var regions = this.regions;
    -        for (var i = 0, n = regions.length; i < n; i++)
    -            if (regions[i].name == name) return regions[i];
    -        return null;
    -    },
    -    dispose: function () {
    -        var pages = this.pages;
    -        for (var i = 0, n = pages.length; i < n; i++)
    -            this.textureLoader.unload(pages[i].rendererObject);
    -    },
    -    updateUVs: function (page) {
    -        var regions = this.regions;
    -        for (var i = 0, n = regions.length; i < n; i++) {
    -            var region = regions[i];
    -            if (region.page != page) continue;
    -            region.u = region.x / page.width;
    -            region.v = region.y / page.height;
    -            if (region.rotate) {
    -                region.u2 = (region.x + region.height) / page.width;
    -                region.v2 = (region.y + region.width) / page.height;
    -            } else {
    -                region.u2 = (region.x + region.width) / page.width;
    -                region.v2 = (region.y + region.height) / page.height;
    -            }
    -        }
    -    }
    -};
    -
    -spine.Atlas.Format = {
    -    alpha: 0,
    -    intensity: 1,
    -    luminanceAlpha: 2,
    -    rgb565: 3,
    -    rgba4444: 4,
    -    rgb888: 5,
    -    rgba8888: 6
    -};
    -
    -spine.Atlas.TextureFilter = {
    -    nearest: 0,
    -    linear: 1,
    -    mipMap: 2,
    -    mipMapNearestNearest: 3,
    -    mipMapLinearNearest: 4,
    -    mipMapNearestLinear: 5,
    -    mipMapLinearLinear: 6
    -};
    -
    -spine.Atlas.TextureWrap = {
    -    mirroredRepeat: 0,
    -    clampToEdge: 1,
    -    repeat: 2
    -};
    -
    -spine.AtlasPage = function () {};
    -spine.AtlasPage.prototype = {
    -    name: null,
    -    format: null,
    -    minFilter: null,
    -    magFilter: null,
    -    uWrap: null,
    -    vWrap: null,
    -    rendererObject: null,
    -    width: 0,
    -    height: 0
    -};
    -
    -spine.AtlasRegion = function () {};
    -spine.AtlasRegion.prototype = {
    -    page: null,
    -    name: null,
    -    x: 0, y: 0,
    -    width: 0, height: 0,
    -    u: 0, v: 0, u2: 0, v2: 0,
    -    offsetX: 0, offsetY: 0,
    -    originalWidth: 0, originalHeight: 0,
    -    index: 0,
    -    rotate: false,
    -    splits: null,
    -    pads: null
    -};
    -
    -spine.AtlasReader = function (text) {
    -    this.lines = text.split(/\r\n|\r|\n/);
    -};
    -spine.AtlasReader.prototype = {
    -    index: 0,
    -    trim: function (value) {
    -        return value.replace(/^\s+|\s+$/g, "");
    -    },
    -    readLine: function () {
    -        if (this.index >= this.lines.length) return null;
    -        return this.lines[this.index++];
    -    },
    -    readValue: function () {
    -        var line = this.readLine();
    -        var colon = line.indexOf(":");
    -        if (colon == -1) throw "Invalid line: " + line;
    -        return this.trim(line.substring(colon + 1));
    -    },
    -    /** Returns the number of tuple values read (2 or 4). */
    -    readTuple: function (tuple) {
    -        var line = this.readLine();
    -        var colon = line.indexOf(":");
    -        if (colon == -1) throw "Invalid line: " + line;
    -        var i = 0, lastMatch= colon + 1;
    -        for (; i < 3; i++) {
    -            var comma = line.indexOf(",", lastMatch);
    -            if (comma == -1) {
    -                if (!i) throw "Invalid line: " + line;
    -                break;
    -            }
    -            tuple[i] = this.trim(line.substr(lastMatch, comma - lastMatch));
    -            lastMatch = comma + 1;
    -        }
    -        tuple[i] = this.trim(line.substring(lastMatch));
    -        return i + 1;
    -    }
    -}
    -
    -spine.AtlasAttachmentLoader = function (atlas) {
    -    this.atlas = atlas;
    -}
    -spine.AtlasAttachmentLoader.prototype = {
    -    newAttachment: function (skin, type, name) {
    -        switch (type) {
    -        case spine.AttachmentType.region:
    -            var region = this.atlas.findRegion(name);
    -            if (!region) throw "Region not found in atlas: " + name + " (" + type + ")";
    -            var attachment = new spine.RegionAttachment(name);
    -            attachment.rendererObject = region;
    -            attachment.setUVs(region.u, region.v, region.u2, region.v2, region.rotate);
    -            attachment.regionOffsetX = region.offsetX;
    -            attachment.regionOffsetY = region.offsetY;
    -            attachment.regionWidth = region.width;
    -            attachment.regionHeight = region.height;
    -            attachment.regionOriginalWidth = region.originalWidth;
    -            attachment.regionOriginalHeight = region.originalHeight;
    -            return attachment;
    -        }
    -        throw "Unknown attachment type: " + type;
    -    }
    -}
    -
    -spine.Bone.yDown = true;
    -PIXI.AnimCache = {};
    -
    -/**
    - * A class that enables the you to import and run your spine animations in pixi.
    - * Spine animation data needs to be loaded using the PIXI.AssetLoader or PIXI.SpineLoader before it can be used by this class
    - * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source
    - *
    - * @class Spine
    - * @extends DisplayObjectContainer
    - * @constructor
    - * @param url {String} The url of the spine anim file to be used
    - */
    -PIXI.Spine = function (url) {
    -    PIXI.DisplayObjectContainer.call(this);
    -
    -    this.spineData = PIXI.AnimCache[url];
    -
    -    if (!this.spineData) {
    -        throw new Error("Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: " + url);
    -    }
    -
    -    this.skeleton = new spine.Skeleton(this.spineData);
    -    this.skeleton.updateWorldTransform();
    -
    -    this.stateData = new spine.AnimationStateData(this.spineData);
    -    this.state = new spine.AnimationState(this.stateData);
    -
    -    this.slotContainers = [];
    -
    -    for (var i = 0, n = this.skeleton.drawOrder.length; i < n; i++) {
    -        var slot = this.skeleton.drawOrder[i];
    -        var attachment = slot.attachment;
    -        var slotContainer = new PIXI.DisplayObjectContainer();
    -        this.slotContainers.push(slotContainer);
    -        this.addChild(slotContainer);
    -        if (!(attachment instanceof spine.RegionAttachment)) {
    -            continue;
    -        }
    -        var spriteName = attachment.rendererObject.name;
    -        var sprite = this.createSprite(slot, attachment.rendererObject);
    -        slot.currentSprite = sprite;
    -        slot.currentSpriteName = spriteName;
    -        slotContainer.addChild(sprite);
    -    }
    -};
    -
    -PIXI.Spine.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
    -PIXI.Spine.prototype.constructor = PIXI.Spine;
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.Spine.prototype.updateTransform = function () {
    -    this.lastTime = this.lastTime || Date.now();
    -    var timeDelta = (Date.now() - this.lastTime) * 0.001;
    -    this.lastTime = Date.now();
    -    this.state.update(timeDelta);
    -    this.state.apply(this.skeleton);
    -    this.skeleton.updateWorldTransform();
    -
    -    var drawOrder = this.skeleton.drawOrder;
    -    for (var i = 0, n = drawOrder.length; i < n; i++) {
    -        var slot = drawOrder[i];
    -        var attachment = slot.attachment;
    -        var slotContainer = this.slotContainers[i];
    -        if (!(attachment instanceof spine.RegionAttachment)) {
    -            slotContainer.visible = false;
    -            continue;
    -        }
    -
    -        if (attachment.rendererObject) {
    -            if (!slot.currentSpriteName || slot.currentSpriteName != attachment.name) {
    -                var spriteName = attachment.rendererObject.name;
    -                if (slot.currentSprite !== undefined) {
    -                    slot.currentSprite.visible = false;
    -                }
    -                slot.sprites = slot.sprites || {};
    -                if (slot.sprites[spriteName] !== undefined) {
    -                    slot.sprites[spriteName].visible = true;
    -                } else {
    -                    var sprite = this.createSprite(slot, attachment.rendererObject);
    -                    slotContainer.addChild(sprite);
    -                }
    -                slot.currentSprite = slot.sprites[spriteName];
    -                slot.currentSpriteName = spriteName;
    -            }
    -        }
    -        slotContainer.visible = true;
    -
    -        var bone = slot.bone;
    -
    -        slotContainer.position.x = bone.worldX + attachment.x * bone.m00 + attachment.y * bone.m01;
    -        slotContainer.position.y = bone.worldY + attachment.x * bone.m10 + attachment.y * bone.m11;
    -        slotContainer.scale.x = bone.worldScaleX;
    -        slotContainer.scale.y = bone.worldScaleY;
    -
    -        slotContainer.rotation = -(slot.bone.worldRotation * Math.PI / 180);
    -
    -        slotContainer.alpha = slot.a;
    -        slot.currentSprite.tint = PIXI.rgb2hex([slot.r,slot.g,slot.b]);
    -    }
    -
    -    PIXI.DisplayObjectContainer.prototype.updateTransform.call(this);
    -};
    -
    -
    -PIXI.Spine.prototype.createSprite = function (slot, descriptor) {
    -    var name = PIXI.TextureCache[descriptor.name] ? descriptor.name : descriptor.name + ".png";
    -    var sprite = new PIXI.Sprite(PIXI.Texture.fromFrame(name));
    -    sprite.scale = descriptor.scale;
    -    sprite.rotation = descriptor.rotation;
    -    sprite.anchor.x = sprite.anchor.y = 0.5;
    -
    -    slot.sprites = slot.sprites || {};
    -    slot.sprites[descriptor.name] = sprite;
    -    return sprite;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_extras_Strip.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_extras_Strip.js.html deleted file mode 100755 index bb4a3f6..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_extras_Strip.js.html +++ /dev/null @@ -1,629 +0,0 @@ - - - - - src/pixi/extras/Strip.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/extras/Strip.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/
    - */
    -
    - /**
    - * 
    - * @class Strip
    - * @extends DisplayObjectContainer
    - * @constructor
    - * @param texture {Texture} The texture to use
    - * @param width {Number} the width 
    - * @param height {Number} the height
    - * 
    - */
    -PIXI.Strip = function(texture)
    -{
    -    PIXI.DisplayObjectContainer.call( this );
    -    
    -
    -    /**
    -     * The texture of the strip
    -     *
    -     * @property texture
    -     * @type Texture
    -     */
    -    this.texture = texture;
    -
    -    // set up the main bits..
    -    this.uvs = new PIXI.Float32Array([0, 1,
    -                                      1, 1,
    -                                      1, 0,
    -                                      0, 1]);
    -
    -    this.verticies = new PIXI.Float32Array([0, 0,
    -                                            100, 0,
    -                                            100, 100,
    -                                            0, 100]);
    -
    -    this.colors = new PIXI.Float32Array([1, 1, 1, 1]);
    -
    -    this.indices = new PIXI.Uint16Array([0, 1, 2, 3]);
    -    
    -    /**
    -     * Whether the strip is dirty or not
    -     *
    -     * @property dirty
    -     * @type Boolean
    -     */
    -    this.dirty = true;
    -
    -
    -    /**
    -     * if you need a padding, not yet implemented
    -     *
    -     * @property padding
    -     * @type Number
    -     */
    -    this.padding = 0;
    -     // NYI, TODO padding ?
    -
    -};
    -
    -// constructor
    -PIXI.Strip.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
    -PIXI.Strip.prototype.constructor = PIXI.Strip;
    -
    -PIXI.Strip.prototype._renderWebGL = function(renderSession)
    -{
    -    // if the sprite is not visible or the alpha is 0 then no need to render this element
    -    if(!this.visible || this.alpha <= 0)return;
    -    // render triangle strip..
    -
    -    renderSession.spriteBatch.stop();
    -
    -    // init! init!
    -    if(!this._vertexBuffer)this._initWebGL(renderSession);
    -    
    -    renderSession.shaderManager.setShader(renderSession.shaderManager.stripShader);
    -
    -    this._renderStrip(renderSession);
    -
    -    ///renderSession.shaderManager.activateDefaultShader();
    -
    -    renderSession.spriteBatch.start();
    -
    -    //TODO check culling  
    -};
    -
    -PIXI.Strip.prototype._initWebGL = function(renderSession)
    -{
    -    // build the strip!
    -    var gl = renderSession.gl;
    -    
    -    this._vertexBuffer = gl.createBuffer();
    -    this._indexBuffer = gl.createBuffer();
    -    this._uvBuffer = gl.createBuffer();
    -    this._colorBuffer = gl.createBuffer();
    -    
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.verticies, gl.DYNAMIC_DRAW);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER,  this.uvs, gl.STATIC_DRAW);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this._colorBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.colors, gl.STATIC_DRAW);
    - 
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);
    -    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    -};
    -
    -PIXI.Strip.prototype._renderStrip = function(renderSession)
    -{
    -    var gl = renderSession.gl;
    -    var projection = renderSession.projection,
    -        offset = renderSession.offset,
    -        shader = renderSession.shaderManager.stripShader;
    -
    -
    -    // gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mat4Real);
    -
    -    gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    -
    -    // set uniforms
    -    gl.uniformMatrix3fv(shader.translationMatrix, false, this.worldTransform.toArray(true));
    -    gl.uniform2f(shader.projectionVector, projection.x, -projection.y);
    -    gl.uniform2f(shader.offsetVector, -offset.x, -offset.y);
    -    gl.uniform1f(shader.alpha, this.worldAlpha);
    -
    -    if(!this.dirty)
    -    {
    -        
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies);
    -        gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0);
    -        
    -        // update the uvs
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer);
    -        gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0);
    -            
    -        gl.activeTexture(gl.TEXTURE0);
    -
    -        // check if a texture is dirty..
    -        if(this.texture.baseTexture._dirty[gl.id])
    -        {
    -            renderSession.renderer.updateTexture(this.texture.baseTexture);
    -        }
    -        else
    -        {
    -            // bind the current texture
    -            gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]);
    -        }
    -    
    -        // dont need to upload!
    -        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);
    -    
    -    
    -    }
    -    else
    -    {
    -
    -        this.dirty = false;
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);
    -        gl.bufferData(gl.ARRAY_BUFFER, this.verticies, gl.STATIC_DRAW);
    -        gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0);
    -        
    -        // update the uvs
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer);
    -        gl.bufferData(gl.ARRAY_BUFFER, this.uvs, gl.STATIC_DRAW);
    -        gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0);
    -            
    -        gl.activeTexture(gl.TEXTURE0);
    -
    -        // check if a texture is dirty..
    -        if(this.texture.baseTexture._dirty[gl.id])
    -        {
    -            renderSession.renderer.updateTexture(this.texture.baseTexture);
    -        }
    -        else
    -        {
    -            gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]);
    -        }
    -    
    -        // dont need to upload!
    -        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);
    -        gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    -        
    -    }
    -    //console.log(gl.TRIANGLE_STRIP)
    -    //
    -    //
    -    gl.drawElements(gl.TRIANGLE_STRIP, this.indices.length, gl.UNSIGNED_SHORT, 0);
    -    
    -  
    -};
    -
    -
    -
    -PIXI.Strip.prototype._renderCanvas = function(renderSession)
    -{
    -    var context = renderSession.context;
    -    
    -    var transform = this.worldTransform;
    -
    -    if (renderSession.roundPixels)
    -    {
    -        context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx | 0, transform.ty | 0);
    -    }
    -    else
    -    {
    -        context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);
    -    }
    -        
    -    var strip = this;
    -    // draw triangles!!
    -    var verticies = strip.verticies;
    -    var uvs = strip.uvs;
    -
    -    var length = verticies.length/2;
    -    this.count++;
    -
    -    for (var i = 0; i < length-2; i++)
    -    {
    -        // draw some triangles!
    -        var index = i*2;
    -
    -        var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    -        var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    -
    -        if(this.padding > 0)
    -        {
    -            var centerX = (x0 + x1 + x2)/3;
    -            var centerY = (y0 + y1 + y2)/3;
    -
    -            var normX = x0 - centerX;
    -            var normY = y0 - centerY;
    -
    -            var dist = Math.sqrt( normX * normX + normY * normY );
    -            x0 = centerX + (normX / dist) * (dist + 3);
    -            y0 = centerY + (normY / dist) * (dist + 3);
    -
    -            // 
    -            
    -            normX = x1 - centerX;
    -            normY = y1 - centerY;
    -
    -            dist = Math.sqrt( normX * normX + normY * normY );
    -            x1 = centerX + (normX / dist) * (dist + 3);
    -            y1 = centerY + (normY / dist) * (dist + 3);
    -
    -            normX = x2 - centerX;
    -            normY = y2 - centerY;
    -
    -            dist = Math.sqrt( normX * normX + normY * normY );
    -            x2 = centerX + (normX / dist) * (dist + 3);
    -            y2 = centerY + (normY / dist) * (dist + 3);
    -        }
    -
    -        var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2] * strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    -        var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3] * strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    -
    -        context.save();
    -        context.beginPath();
    -
    -
    -        context.moveTo(x0, y0);
    -        context.lineTo(x1, y1);
    -        context.lineTo(x2, y2);
    -
    -        context.closePath();
    -
    -        context.clip();
    -
    -        // Compute matrix transform
    -        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    -        var deltaA = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    -        var deltaB = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    -        var deltaC = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    -        var deltaD = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    -        var deltaE = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    -        var deltaF = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    -
    -        context.transform(deltaA / delta, deltaD / delta,
    -                            deltaB / delta, deltaE / delta,
    -                            deltaC / delta, deltaF / delta);
    -
    -        context.drawImage(strip.texture.baseTexture.source, 0, 0);
    -        context.restore();
    -    }
    -};
    -
    -
    -/**
    - * Renders a flat strip
    - *
    - * @method renderStripFlat
    - * @param strip {Strip} The Strip to render
    - * @private
    - */
    -PIXI.Strip.prototype.renderStripFlat = function(strip)
    -{
    -    var context = this.context;
    -    var verticies = strip.verticies;
    -
    -    var length = verticies.length/2;
    -    this.count++;
    -
    -    context.beginPath();
    -    for (var i=1; i < length-2; i++)
    -    {
    -        // draw some triangles!
    -        var index = i*2;
    -
    -        var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    -        var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    -
    -        context.moveTo(x0, y0);
    -        context.lineTo(x1, y1);
    -        context.lineTo(x2, y2);
    -    }
    -
    -    context.fillStyle = "#FF0000";
    -    context.fill();
    -    context.closePath();
    -};
    -
    -/*
    -PIXI.Strip.prototype.setTexture = function(texture)
    -{
    -    //TODO SET THE TEXTURES
    -    //TODO VISIBILITY
    -
    -    // stop current texture
    -    this.texture = texture;
    -    this.width   = texture.frame.width;
    -    this.height  = texture.frame.height;
    -    this.updateFrame = true;
    -};
    -*/
    -
    -/**
    - * When the texture is updated, this event will fire to update the scale and frame
    - *
    - * @method onTextureUpdate
    - * @param event
    - * @private
    - */
    -
    -PIXI.Strip.prototype.onTextureUpdate = function()
    -{
    -    this.updateFrame = true;
    -};
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_extras_TilingSprite.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_extras_TilingSprite.js.html deleted file mode 100755 index d95a188..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_extras_TilingSprite.js.html +++ /dev/null @@ -1,743 +0,0 @@ - - - - - src/pixi/extras/TilingSprite.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/extras/TilingSprite.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/
    - */
    -
    -/**
    - * A tiling sprite is a fast way of rendering a tiling image
    - *
    - * @class TilingSprite
    - * @extends Sprite
    - * @constructor
    - * @param texture {Texture} the texture of the tiling sprite
    - * @param width {Number}  the width of the tiling sprite
    - * @param height {Number} the height of the tiling sprite
    - */
    -PIXI.TilingSprite = function(texture, width, height)
    -{
    -    PIXI.Sprite.call( this, texture);
    -
    -    /**
    -     * The with of the tiling sprite
    -     *
    -     * @property width
    -     * @type Number
    -     */
    -    this._width = width || 100;
    -
    -    /**
    -     * The height of the tiling sprite
    -     *
    -     * @property height
    -     * @type Number
    -     */
    -    this._height = height || 100;
    -
    -    /**
    -     * The scaling of the image that is being tiled
    -     *
    -     * @property tileScale
    -     * @type Point
    -     */
    -    this.tileScale = new PIXI.Point(1,1);
    -
    -    /**
    -     * A point that represents the scale of the texture object
    -     *
    -     * @property tileScaleOffset
    -     * @type Point
    -     */
    -    this.tileScaleOffset = new PIXI.Point(1,1);
    -    
    -    /**
    -     * The offset position of the image that is being tiled
    -     *
    -     * @property tilePosition
    -     * @type Point
    -     */
    -    this.tilePosition = new PIXI.Point(0,0);
    -
    -    /**
    -     * Whether this sprite is renderable or not
    -     *
    -     * @property renderable
    -     * @type Boolean
    -     * @default true
    -     */
    -    this.renderable = true;
    -
    -    /**
    -     * The tint applied to the sprite. This is a hex value
    -     *
    -     * @property tint
    -     * @type Number
    -     * @default 0xFFFFFF
    -     */
    -    this.tint = 0xFFFFFF;
    -    
    -    /**
    -     * The blend mode to be applied to the sprite
    -     *
    -     * @property blendMode
    -     * @type Number
    -     * @default PIXI.blendModes.NORMAL;
    -     */
    -    this.blendMode = PIXI.blendModes.NORMAL;
    -
    -    
    -
    -};
    -
    -// constructor
    -PIXI.TilingSprite.prototype = Object.create(PIXI.Sprite.prototype);
    -PIXI.TilingSprite.prototype.constructor = PIXI.TilingSprite;
    -
    -
    -/**
    - * The width of the sprite, setting this will actually modify the scale to achieve the value set
    - *
    - * @property width
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TilingSprite.prototype, 'width', {
    -    get: function() {
    -        return this._width;
    -    },
    -    set: function(value) {
    -        
    -        this._width = value;
    -    }
    -});
    -
    -/**
    - * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set
    - *
    - * @property height
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TilingSprite.prototype, 'height', {
    -    get: function() {
    -        return  this._height;
    -    },
    -    set: function(value) {
    -        this._height = value;
    -    }
    -});
    -
    -PIXI.TilingSprite.prototype.setTexture = function(texture)
    -{
    -    if (this.texture === texture) return;
    -
    -    this.texture = texture;
    -
    -    this.refreshTexture = true;
    -
    -    this.cachedTint = 0xFFFFFF;
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.TilingSprite.prototype._renderWebGL = function(renderSession)
    -{
    -    if (this.visible === false || this.alpha === 0) return;
    -    var i,j;
    -
    -    if (this._mask)
    -    {
    -        renderSession.spriteBatch.stop();
    -        renderSession.maskManager.pushMask(this.mask, renderSession);
    -        renderSession.spriteBatch.start();
    -    }
    -
    -    if (this._filters)
    -    {
    -        renderSession.spriteBatch.flush();
    -        renderSession.filterManager.pushFilter(this._filterBlock);
    -    }
    -
    -   
    -
    -    if (!this.tilingTexture || this.refreshTexture)
    -    {
    -        this.generateTilingTexture(true);
    -
    -        if (this.tilingTexture && this.tilingTexture.needsUpdate)
    -        {
    -            //TODO - tweaking
    -            PIXI.updateWebGLTexture(this.tilingTexture.baseTexture, renderSession.gl);
    -            this.tilingTexture.needsUpdate = false;
    -           // this.tilingTexture._uvs = null;
    -        }
    -    }
    -    else
    -    {
    -        renderSession.spriteBatch.renderTilingSprite(this);
    -    }
    -    // simple render children!
    -    for (i=0,j=this.children.length; i<j; i++)
    -    {
    -        this.children[i]._renderWebGL(renderSession);
    -    }
    -
    -    renderSession.spriteBatch.stop();
    -
    -    if (this._filters) renderSession.filterManager.popFilter();
    -    if (this._mask) renderSession.maskManager.popMask(this._mask, renderSession);
    -    
    -    renderSession.spriteBatch.start();
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.TilingSprite.prototype._renderCanvas = function(renderSession)
    -{
    -    if (this.visible === false || this.alpha === 0)return;
    -    
    -    var context = renderSession.context;
    -
    -    if (this._mask)
    -    {
    -        renderSession.maskManager.pushMask(this._mask, context);
    -    }
    -
    -    context.globalAlpha = this.worldAlpha;
    -    
    -    var transform = this.worldTransform;
    -
    -    var i,j;
    -
    -    var resolution = renderSession.resolution;
    -
    -    context.setTransform(transform.a * resolution,
    -                         transform.c * resolution,
    -                         transform.b * resolution,
    -                         transform.d * resolution,
    -                         transform.tx * resolution,
    -                         transform.ty * resolution);
    -
    -    if (!this.__tilePattern ||  this.refreshTexture)
    -    {
    -        this.generateTilingTexture(false);
    -    
    -        if (this.tilingTexture)
    -        {
    -            this.__tilePattern = context.createPattern(this.tilingTexture.baseTexture.source, 'repeat');
    -        }
    -        else
    -        {
    -            return;
    -        }
    -    }
    -
    -    // check blend mode
    -    if (this.blendMode !== renderSession.currentBlendMode)
    -    {
    -        renderSession.currentBlendMode = this.blendMode;
    -        context.globalCompositeOperation = PIXI.blendModesCanvas[renderSession.currentBlendMode];
    -    }
    -
    -    var tilePosition = this.tilePosition;
    -    var tileScale = this.tileScale;
    -
    -    tilePosition.x %= this.tilingTexture.baseTexture.width;
    -    tilePosition.y %= this.tilingTexture.baseTexture.height;
    -
    -    // offset - make sure to account for the anchor point..
    -    context.scale(tileScale.x,tileScale.y);
    -    context.translate(tilePosition.x + (this.anchor.x * -this._width), tilePosition.y + (this.anchor.y * -this._height));
    -
    -    context.fillStyle = this.__tilePattern;
    -
    -    context.fillRect(-tilePosition.x,
    -                    -tilePosition.y,
    -                    this._width / tileScale.x,
    -                    this._height / tileScale.y);
    -
    -    context.scale(1 / tileScale.x, 1 / tileScale.y);
    -    context.translate(-tilePosition.x + (this.anchor.x * this._width), -tilePosition.y + (this.anchor.y * this._height));
    -
    -    if (this._mask)
    -    {
    -        renderSession.maskManager.popMask(renderSession.context);
    -    }
    -
    -    for (i=0,j=this.children.length; i<j; i++)
    -    {
    -        this.children[i]._renderCanvas(renderSession);
    -    }
    -};
    -
    -
    -/**
    -* Returns the framing rectangle of the sprite as a PIXI.Rectangle object
    -*
    -* @method getBounds
    -* @return {Rectangle} the framing rectangle
    -*/
    -PIXI.TilingSprite.prototype.getBounds = function()
    -{
    -    var width = this._width;
    -    var height = this._height;
    -
    -    var w0 = width * (1-this.anchor.x);
    -    var w1 = width * -this.anchor.x;
    -
    -    var h0 = height * (1-this.anchor.y);
    -    var h1 = height * -this.anchor.y;
    -
    -    var worldTransform = this.worldTransform;
    -
    -    var a = worldTransform.a;
    -    var b = worldTransform.b;
    -    var c = worldTransform.c;
    -    var d = worldTransform.d;
    -    var tx = worldTransform.tx;
    -    var ty = worldTransform.ty;
    -    
    -    var x1 = a * w1 + c * h1 + tx;
    -    var y1 = d * h1 + b * w1 + ty;
    -
    -    var x2 = a * w0 + c * h1 + tx;
    -    var y2 = d * h1 + b * w0 + ty;
    -
    -    var x3 = a * w0 + c * h0 + tx;
    -    var y3 = d * h0 + b * w0 + ty;
    -
    -    var x4 =  a * w1 + c * h0 + tx;
    -    var y4 =  d * h0 + b * w1 + ty;
    -
    -    var maxX = -Infinity;
    -    var maxY = -Infinity;
    -
    -    var minX = Infinity;
    -    var minY = Infinity;
    -
    -    minX = x1 < minX ? x1 : minX;
    -    minX = x2 < minX ? x2 : minX;
    -    minX = x3 < minX ? x3 : minX;
    -    minX = x4 < minX ? x4 : minX;
    -
    -    minY = y1 < minY ? y1 : minY;
    -    minY = y2 < minY ? y2 : minY;
    -    minY = y3 < minY ? y3 : minY;
    -    minY = y4 < minY ? y4 : minY;
    -
    -    maxX = x1 > maxX ? x1 : maxX;
    -    maxX = x2 > maxX ? x2 : maxX;
    -    maxX = x3 > maxX ? x3 : maxX;
    -    maxX = x4 > maxX ? x4 : maxX;
    -
    -    maxY = y1 > maxY ? y1 : maxY;
    -    maxY = y2 > maxY ? y2 : maxY;
    -    maxY = y3 > maxY ? y3 : maxY;
    -    maxY = y4 > maxY ? y4 : maxY;
    -
    -    var bounds = this._bounds;
    -
    -    bounds.x = minX;
    -    bounds.width = maxX - minX;
    -
    -    bounds.y = minY;
    -    bounds.height = maxY - minY;
    -
    -    // store a reference so that if this function gets called again in the render cycle we do not have to recalculate
    -    this._currentBounds = bounds;
    -
    -    return bounds;
    -};
    -
    -
    -
    -/**
    - * When the texture is updated, this event will fire to update the scale and frame
    - *
    - * @method onTextureUpdate
    - * @param event
    - * @private
    - */
    -PIXI.TilingSprite.prototype.onTextureUpdate = function()
    -{
    -   // overriding the sprite version of this!
    -};
    -
    -
    -/**
    -* 
    -* @method generateTilingTexture
    -* 
    -* @param forcePowerOfTwo {Boolean} Whether we want to force the texture to be a power of two
    -*/
    -PIXI.TilingSprite.prototype.generateTilingTexture = function(forcePowerOfTwo)
    -{
    -    if (!this.texture.baseTexture.hasLoaded) return;
    -
    -    var texture = this.originalTexture || this.texture;
    -    var frame = texture.frame;
    -    var targetWidth, targetHeight;
    -
    -    //  Check that the frame is the same size as the base texture.
    -    var isFrame = frame.width !== texture.baseTexture.width || frame.height !== texture.baseTexture.height;
    -
    -    var newTextureRequired = false;
    -
    -    if (!forcePowerOfTwo)
    -    {
    -        if (isFrame)
    -        {
    -            targetWidth = frame.width;
    -            targetHeight = frame.height;
    -           
    -            newTextureRequired = true;
    -        }
    -    }
    -    else
    -    {
    -        targetWidth = PIXI.getNextPowerOfTwo(frame.width);
    -        targetHeight = PIXI.getNextPowerOfTwo(frame.height);
    -
    -        if (frame.width !== targetWidth || frame.height !== targetHeight) newTextureRequired = true;
    -    }
    -
    -    if (newTextureRequired)
    -    {
    -        var canvasBuffer;
    -
    -        if (this.tilingTexture && this.tilingTexture.isTiling)
    -        {
    -            canvasBuffer = this.tilingTexture.canvasBuffer;
    -            canvasBuffer.resize(targetWidth, targetHeight);
    -            this.tilingTexture.baseTexture.width = targetWidth;
    -            this.tilingTexture.baseTexture.height = targetHeight;
    -            this.tilingTexture.needsUpdate = true;
    -        }
    -        else
    -        {
    -            canvasBuffer = new PIXI.CanvasBuffer(targetWidth, targetHeight);
    -
    -            this.tilingTexture = PIXI.Texture.fromCanvas(canvasBuffer.canvas);
    -            this.tilingTexture.canvasBuffer = canvasBuffer;
    -            this.tilingTexture.isTiling = true;
    -        }
    -
    -        canvasBuffer.context.drawImage(texture.baseTexture.source,
    -                               texture.crop.x,
    -                               texture.crop.y,
    -                               texture.crop.width,
    -                               texture.crop.height,
    -                               0,
    -                               0,
    -                               targetWidth,
    -                               targetHeight);
    -
    -        this.tileScaleOffset.x = frame.width / targetWidth;
    -        this.tileScaleOffset.y = frame.height / targetHeight;
    -    }
    -    else
    -    {
    -        //  TODO - switching?
    -        if (this.tilingTexture && this.tilingTexture.isTiling)
    -        {
    -            // destroy the tiling texture!
    -            // TODO could store this somewhere?
    -            this.tilingTexture.destroy(true);
    -        }
    -
    -        this.tileScaleOffset.x = 1;
    -        this.tileScaleOffset.y = 1;
    -        this.tilingTexture = texture;
    -    }
    -
    -    this.refreshTexture = false;
    -    
    -    this.originalTexture = this.texture;
    -    this.texture = this.tilingTexture;
    -    
    -    this.tilingTexture.baseTexture._powerOf2 = true;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_AbstractFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_AbstractFilter.js.html deleted file mode 100755 index d4ac332..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_AbstractFilter.js.html +++ /dev/null @@ -1,355 +0,0 @@ - - - - - src/pixi/filters/AbstractFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/AbstractFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This is the base class for creating a PIXI filter. Currently only webGL supports filters.
    - * If you want to make a custom filter this should be your base class.
    - * @class AbstractFilter
    - * @constructor
    - * @param fragmentSrc {Array} The fragment source in an array of strings.
    - * @param uniforms {Object} An object containing the uniforms for this filter.
    - */
    -PIXI.AbstractFilter = function(fragmentSrc, uniforms)
    -{
    -    /**
    -    * An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion.
    -    * For example the blur filter has two passes blurX and blurY.
    -    * @property passes
    -    * @type Array an array of filter objects
    -    * @private
    -    */
    -    this.passes = [this];
    -
    -    /**
    -    * @property shaders
    -    * @type Array an array of shaders
    -    * @private
    -    */
    -    this.shaders = [];
    -    
    -    /**
    -    * @property dirty
    -    * @type Boolean
    -    */
    -    this.dirty = true;
    -
    -    /**
    -    * @property padding
    -    * @type Number
    -    */
    -    this.padding = 0;
    -
    -    /**
    -    * @property uniforms
    -    * @type object
    -    * @private
    -    */
    -    this.uniforms = uniforms || {};
    -
    -    /**
    -    * @property fragmentSrc
    -    * @type Array
    -    * @private
    -    */
    -    this.fragmentSrc = fragmentSrc || [];
    -};
    -
    -PIXI.AbstractFilter.prototype.constructor = PIXI.AbstractFilter;
    -
    -/**
    - * Syncs the uniforms between the class object and the shaders.
    - *
    - * @method syncUniforms
    - */
    -PIXI.AbstractFilter.prototype.syncUniforms = function()
    -{
    -    for(var i=0,j=this.shaders.length; i<j; i++)
    -    {
    -        this.shaders[i].dirty = true;
    -    }
    -};
    -
    -/*
    -PIXI.AbstractFilter.prototype.apply = function(frameBuffer)
    -{
    -    // TODO :)
    -};
    -*/
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_AlphaMaskFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_AlphaMaskFilter.js.html deleted file mode 100755 index e332a02..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_AlphaMaskFilter.js.html +++ /dev/null @@ -1,375 +0,0 @@ - - - - - src/pixi/filters/AlphaMaskFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/AlphaMaskFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The AlphaMaskFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object.
    - * You can use this filter to apply all manor of crazy warping effects
    - * Currently the r property of the texture is used to offset the x and the g property of the texture is used to offset the y.
    - * 
    - * @class AlphaMaskFilter
    - * @extends AbstractFilter
    - * @constructor
    - * @param texture {Texture} The texture used for the displacement map * must be power of 2 texture at the moment
    - */
    -PIXI.AlphaMaskFilter = function(texture)
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -    texture.baseTexture._powerOf2 = true;
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        mask: {type: 'sampler2D', value:texture},
    -        mapDimensions:   {type: '2f', value:{x:1, y:5112}},
    -        dimensions:   {type: '4fv', value:[0,0,0,0]}
    -    };
    -
    -    if(texture.baseTexture.hasLoaded)
    -    {
    -        this.uniforms.mask.value.x = texture.width;
    -        this.uniforms.mask.value.y = texture.height;
    -    }
    -    else
    -    {
    -        this.boundLoadedFunction = this.onTextureLoaded.bind(this);
    -
    -        texture.baseTexture.on('loaded', this.boundLoadedFunction);
    -    }
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D mask;',
    -        'uniform sampler2D uSampler;',
    -        'uniform vec2 offset;',
    -        'uniform vec4 dimensions;',
    -        'uniform vec2 mapDimensions;',
    -
    -        'void main(void) {',
    -        '   vec2 mapCords = vTextureCoord.xy;',
    -        '   mapCords += (dimensions.zw + offset)/ dimensions.xy ;',
    -        '   mapCords.y *= -1.0;',
    -        '   mapCords.y += 1.0;',
    -        '   mapCords *= dimensions.xy / mapDimensions;',
    -
    -        '   vec4 original =  texture2D(uSampler, vTextureCoord);',
    -        '   float maskAlpha =  texture2D(mask, mapCords).r;',
    -        '   original *= maskAlpha;',
    -        //'   original.rgb *= maskAlpha;',
    -        '   gl_FragColor =  original;',
    -        //'   gl_FragColor = gl_FragColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.AlphaMaskFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.AlphaMaskFilter.prototype.constructor = PIXI.AlphaMaskFilter;
    -
    -/**
    - * Sets the map dimensions uniforms when the texture becomes available.
    - *
    - * @method onTextureLoaded
    - */
    -PIXI.AlphaMaskFilter.prototype.onTextureLoaded = function()
    -{
    -    this.uniforms.mapDimensions.value.x = this.uniforms.mask.value.width;
    -    this.uniforms.mapDimensions.value.y = this.uniforms.mask.value.height;
    -
    -    this.uniforms.mask.value.baseTexture.off('loaded', this.boundLoadedFunction);
    -};
    -
    -/**
    - * The texture used for the displacement map. Must be power of 2 sized texture.
    - *
    - * @property map
    - * @type Texture
    - */
    -Object.defineProperty(PIXI.AlphaMaskFilter.prototype, 'map', {
    -    get: function() {
    -        return this.uniforms.mask.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.mask.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_AsciiFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_AsciiFilter.js.html deleted file mode 100755 index fecc5d2..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_AsciiFilter.js.html +++ /dev/null @@ -1,364 +0,0 @@ - - - - - src/pixi/filters/AsciiFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/AsciiFilter.js

    - -
    -
    -/**
    - * @author Vico @vicocotea
    - * original shader : https://www.shadertoy.com/view/lssGDj by @movAX13h
    - */
    -
    -/**
    - * An ASCII filter.
    - * 
    - * @class AsciiFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.AsciiFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        dimensions: {type: '4fv', value:new PIXI.Float32Array([10000, 100, 10, 10])},
    -        pixelSize: {type: '1f', value:8}
    -    };
    -
    -    this.fragmentSrc = [
    -        
    -        'precision mediump float;',
    -        'uniform vec4 dimensions;',
    -        'uniform float pixelSize;',
    -        'uniform sampler2D uSampler;',
    -
    -        'float character(float n, vec2 p)',
    -        '{',
    -        '    p = floor(p*vec2(4.0, -4.0) + 2.5);',
    -        '    if (clamp(p.x, 0.0, 4.0) == p.x && clamp(p.y, 0.0, 4.0) == p.y)',
    -        '    {',
    -        '        if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0;',
    -        '    }',
    -        '    return 0.0;',
    -        '}',
    -
    -        'void main()',
    -        '{',
    -        '    vec2 uv = gl_FragCoord.xy;',
    -        '    vec3 col = texture2D(uSampler, floor( uv / pixelSize ) * pixelSize / dimensions.xy).rgb;',
    -            
    -        '    #ifdef HAS_GREENSCREEN',
    -        '    float gray = (col.r + col.b)/2.0;', 
    -        '    #else',
    -        '    float gray = (col.r + col.g + col.b)/3.0;',
    -        '    #endif',
    -  
    -        '    float n =  65536.0;             // .',
    -        '    if (gray > 0.2) n = 65600.0;    // :',
    -        '    if (gray > 0.3) n = 332772.0;   // *',
    -        '    if (gray > 0.4) n = 15255086.0; // o',
    -        '    if (gray > 0.5) n = 23385164.0; // &',
    -        '    if (gray > 0.6) n = 15252014.0; // 8',
    -        '    if (gray > 0.7) n = 13199452.0; // @',
    -        '    if (gray > 0.8) n = 11512810.0; // #',
    -            
    -        '    vec2 p = mod( uv / ( pixelSize * 0.5 ), 2.0) - vec2(1.0);',
    -        '    col = col * character(n, p);',
    -            
    -        '    gl_FragColor = vec4(col, 1.0);',
    -        '}'
    -    ];
    -};
    -
    -PIXI.AsciiFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.AsciiFilter.prototype.constructor = PIXI.AsciiFilter;
    -
    -/**
    - * The pixel size used by the filter.
    - *
    - * @property size
    - * @type Number
    - */
    -Object.defineProperty(PIXI.AsciiFilter.prototype, 'size', {
    -    get: function() {
    -        return this.uniforms.pixelSize.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.pixelSize.value = value;
    -    }
    -});
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_BlurFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_BlurFilter.js.html deleted file mode 100755 index f7c0d25..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_BlurFilter.js.html +++ /dev/null @@ -1,348 +0,0 @@ - - - - - src/pixi/filters/BlurFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/BlurFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The BlurFilter applies a Gaussian blur to an object.
    - * The strength of the blur can be set for x- and y-axis separately (always relative to the stage).
    - *
    - * @class BlurFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.BlurFilter = function()
    -{
    -    this.blurXFilter = new PIXI.BlurXFilter();
    -    this.blurYFilter = new PIXI.BlurYFilter();
    -
    -    this.passes =[this.blurXFilter, this.blurYFilter];
    -};
    -
    -PIXI.BlurFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.BlurFilter.prototype.constructor = PIXI.BlurFilter;
    -
    -/**
    - * Sets the strength of both the blurX and blurY properties simultaneously
    - *
    - * @property blur
    - * @type Number the strength of the blur
    - * @default 2
    - */
    -Object.defineProperty(PIXI.BlurFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.blurXFilter.blur;
    -    },
    -    set: function(value) {
    -        this.blurXFilter.blur = this.blurYFilter.blur = value;
    -    }
    -});
    -
    -/**
    - * Sets the strength of the blurX property
    - *
    - * @property blurX
    - * @type Number the strength of the blurX
    - * @default 2
    - */
    -Object.defineProperty(PIXI.BlurFilter.prototype, 'blurX', {
    -    get: function() {
    -        return this.blurXFilter.blur;
    -    },
    -    set: function(value) {
    -        this.blurXFilter.blur = value;
    -    }
    -});
    -
    -/**
    - * Sets the strength of the blurY property
    - *
    - * @property blurY
    - * @type Number the strength of the blurY
    - * @default 2
    - */
    -Object.defineProperty(PIXI.BlurFilter.prototype, 'blurY', {
    -    get: function() {
    -        return this.blurYFilter.blur;
    -    },
    -    set: function(value) {
    -        this.blurYFilter.blur = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_BlurXFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_BlurXFilter.js.html deleted file mode 100755 index 622c2f6..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_BlurXFilter.js.html +++ /dev/null @@ -1,345 +0,0 @@ - - - - - src/pixi/filters/BlurXFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/BlurXFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The BlurXFilter applies a horizontal Gaussian blur to an object.
    - *
    - * @class BlurXFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.BlurXFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 1/512}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float blur;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   vec4 sum = vec4(0.0);',
    -
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x - 4.0*blur, vTextureCoord.y)) * 0.05;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x - 3.0*blur, vTextureCoord.y)) * 0.09;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x - 2.0*blur, vTextureCoord.y)) * 0.12;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x - blur, vTextureCoord.y)) * 0.15;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x + blur, vTextureCoord.y)) * 0.15;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x + 2.0*blur, vTextureCoord.y)) * 0.12;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x + 3.0*blur, vTextureCoord.y)) * 0.09;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x + 4.0*blur, vTextureCoord.y)) * 0.05;',
    -
    -        '   gl_FragColor = sum;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.BlurXFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.BlurXFilter.prototype.constructor = PIXI.BlurXFilter;
    -
    -/**
    - * Sets the strength of both the blur.
    - *
    - * @property blur
    - * @type Number the strength of the blur
    - * @default 2
    - */
    -Object.defineProperty(PIXI.BlurXFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value / (1/7000);
    -    },
    -    set: function(value) {
    -
    -        this.dirty = true;
    -        this.uniforms.blur.value = (1/7000) * value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_BlurYFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_BlurYFilter.js.html deleted file mode 100755 index a6c7290..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_BlurYFilter.js.html +++ /dev/null @@ -1,344 +0,0 @@ - - - - - src/pixi/filters/BlurYFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/BlurYFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The BlurYFilter applies a vertical Gaussian blur to an object.
    - *
    - * @class BlurYFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.BlurYFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 1/512}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float blur;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   vec4 sum = vec4(0.0);',
    -
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 4.0*blur)) * 0.05;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 3.0*blur)) * 0.09;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 2.0*blur)) * 0.12;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - blur)) * 0.15;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + blur)) * 0.15;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 2.0*blur)) * 0.12;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 3.0*blur)) * 0.09;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 4.0*blur)) * 0.05;',
    -
    -        '   gl_FragColor = sum;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.BlurYFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.BlurYFilter.prototype.constructor = PIXI.BlurYFilter;
    -
    -/**
    - * Sets the strength of both the blur.
    - *
    - * @property blur
    - * @type Number the strength of the blur
    - * @default 2
    - */
    -Object.defineProperty(PIXI.BlurYFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value / (1/7000);
    -    },
    -    set: function(value) {
    -        //this.padding = value;
    -        this.uniforms.blur.value = (1/7000) * value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_ColorMatrixFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_ColorMatrixFilter.js.html deleted file mode 100755 index 86702fe..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_ColorMatrixFilter.js.html +++ /dev/null @@ -1,337 +0,0 @@ - - - - - src/pixi/filters/ColorMatrixFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/ColorMatrixFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The ColorMatrixFilter class lets you apply a 4x4 matrix transformation on the RGBA
    - * color and alpha values of every pixel on your displayObject to produce a result
    - * with a new set of RGBA color and alpha values. It's pretty powerful!
    - * 
    - * @class ColorMatrixFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.ColorMatrixFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        matrix: {type: 'mat4', value: [1,0,0,0,
    -                                       0,1,0,0,
    -                                       0,0,1,0,
    -                                       0,0,0,1]}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float invert;',
    -        'uniform mat4 matrix;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord) * matrix;',
    -      //  '   gl_FragColor = gl_FragColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.ColorMatrixFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.ColorMatrixFilter.prototype.constructor = PIXI.ColorMatrixFilter;
    -
    -/**
    - * Sets the matrix of the color matrix filter
    - *
    - * @property matrix
    - * @type Array and array of 26 numbers
    - * @default [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]
    - */
    -Object.defineProperty(PIXI.ColorMatrixFilter.prototype, 'matrix', {
    -    get: function() {
    -        return this.uniforms.matrix.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.matrix.value = value;
    -    }
    -});
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_ColorStepFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_ColorStepFilter.js.html deleted file mode 100755 index eb21f70..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_ColorStepFilter.js.html +++ /dev/null @@ -1,332 +0,0 @@ - - - - - src/pixi/filters/ColorStepFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/ColorStepFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This lowers the color depth of your image by the given amount, producing an image with a smaller palette.
    - * 
    - * @class ColorStepFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.ColorStepFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        step: {type: '1f', value: 5}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D uSampler;',
    -        'uniform float step;',
    -
    -        'void main(void) {',
    -        '   vec4 color = texture2D(uSampler, vTextureCoord);',
    -        '   color = floor(color * step) / step;',
    -        '   gl_FragColor = color;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.ColorStepFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.ColorStepFilter.prototype.constructor = PIXI.ColorStepFilter;
    -
    -/**
    - * The number of steps to reduce the palette by.
    - *
    - * @property step
    - * @type Number
    - */
    -Object.defineProperty(PIXI.ColorStepFilter.prototype, 'step', {
    -    get: function() {
    -        return this.uniforms.step.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.step.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_ConvolutionFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_ConvolutionFilter.js.html deleted file mode 100755 index e6acdc3..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_ConvolutionFilter.js.html +++ /dev/null @@ -1,384 +0,0 @@ - - - - - src/pixi/filters/ConvolutionFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/ConvolutionFilter.js

    - -
    -
    -/**
    - * The ConvolutionFilter class applies a matrix convolution filter effect. 
    - * A convolution combines pixels in the input image with neighboring pixels to produce a new image. 
    - * A wide variety of image effects can be achieved through convolutions, including blurring, edge detection, sharpening, embossing, and beveling.
    - * The matrix should be specified as a 9 point Array. See http://docs.gimp.org/en/plug-in-convmatrix.html for more info.
    - * 
    - * @class ConvolutionFilter
    - * @extends AbstractFilter
    - * @constructor
    - * @param matrix {Array} An array of values used for matrix transformation. Specified as a 9 point Array.
    - * @param width {Number} Width of the object you are transforming
    - * @param height {Number} Height of the object you are transforming
    - */
    -PIXI.ConvolutionFilter = function(matrix, width, height)
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        m : {type: '1fv', value: new PIXI.Float32Array(matrix)},
    -        texelSizeX: {type: '1f', value: 1 / width},
    -        texelSizeY: {type: '1f', value: 1 / height}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying mediump vec2 vTextureCoord;',
    -        'uniform sampler2D texture;',
    -        'uniform float texelSizeX;',
    -        'uniform float texelSizeY;',
    -        'uniform float m[9];',
    -
    -        'vec2 px = vec2(texelSizeX, texelSizeY);',
    -
    -        'void main(void) {',
    -            'vec4 c11 = texture2D(texture, vTextureCoord - px);', // top left
    -            'vec4 c12 = texture2D(texture, vec2(vTextureCoord.x, vTextureCoord.y - px.y));', // top center
    -            'vec4 c13 = texture2D(texture, vec2(vTextureCoord.x + px.x, vTextureCoord.y - px.y));', // top right
    -
    -            'vec4 c21 = texture2D(texture, vec2(vTextureCoord.x - px.x, vTextureCoord.y) );', // mid left
    -            'vec4 c22 = texture2D(texture, vTextureCoord);', // mid center
    -            'vec4 c23 = texture2D(texture, vec2(vTextureCoord.x + px.x, vTextureCoord.y) );', // mid right
    -
    -            'vec4 c31 = texture2D(texture, vec2(vTextureCoord.x - px.x, vTextureCoord.y + px.y) );', // bottom left
    -            'vec4 c32 = texture2D(texture, vec2(vTextureCoord.x, vTextureCoord.y + px.y) );', // bottom center
    -            'vec4 c33 = texture2D(texture, vTextureCoord + px );', // bottom right
    -
    -            'gl_FragColor = ',
    -            'c11 * m[0] + c12 * m[1] + c22 * m[2] +',
    -            'c21 * m[3] + c22 * m[4] + c23 * m[5] +',
    -            'c31 * m[6] + c32 * m[7] + c33 * m[8];',
    -            'gl_FragColor.a = c22.a;',
    -        '}'
    -    ];
    -
    -};
    -
    -PIXI.ConvolutionFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.ConvolutionFilter.prototype.constructor = PIXI.ConvolutionFilter;
    -
    -/**
    - * An array of values used for matrix transformation. Specified as a 9 point Array.
    - *
    - * @property matrix
    - * @type Array
    - */
    -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'matrix', {
    -    get: function() {
    -        return this.uniforms.m.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.m.value = new PIXI.Float32Array(value);
    -    }
    -});
    -
    -/**
    - * Width of the object you are transforming
    - *
    - * @property width
    - * @type Number
    - */
    -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'width', {
    -    get: function() {
    -        return this.uniforms.texelSizeX.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.texelSizeX.value = 1/value;
    -    }
    -});
    -
    -/**
    - * Height of the object you are transforming
    - *
    - * @property height
    - * @type Number
    - */
    -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'height', {
    -    get: function() {
    -        return this.uniforms.texelSizeY.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.texelSizeY.value = 1/value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_CrossHatchFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_CrossHatchFilter.js.html deleted file mode 100755 index 5c8509e..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_CrossHatchFilter.js.html +++ /dev/null @@ -1,358 +0,0 @@ - - - - - src/pixi/filters/CrossHatchFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/CrossHatchFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A Cross Hatch effect filter.
    - * 
    - * @class CrossHatchFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.CrossHatchFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 1 / 512}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float blur;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '    float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);',
    -
    -        '    gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);',
    -
    -        '    if (lum < 1.00) {',
    -        '        if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {',
    -        '            gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);',
    -        '        }',
    -        '    }',
    -
    -        '    if (lum < 0.75) {',
    -        '        if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {',
    -        '            gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);',
    -        '        }',
    -        '    }',
    -
    -        '    if (lum < 0.50) {',
    -        '        if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {',
    -        '            gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);',
    -        '        }',
    -        '    }',
    -
    -        '    if (lum < 0.3) {',
    -        '        if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {',
    -        '            gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);',
    -        '        }',
    -        '    }',
    -        '}'
    -    ];
    -};
    -
    -PIXI.CrossHatchFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.CrossHatchFilter.prototype.constructor = PIXI.CrossHatchFilter;
    -
    -/**
    - * Sets the strength of both the blur.
    - *
    - * @property blur
    - * @type Number the strength of the blur
    - * @default 2
    - */
    -Object.defineProperty(PIXI.CrossHatchFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value / (1/7000);
    -    },
    -    set: function(value) {
    -        //this.padding = value;
    -        this.uniforms.blur.value = (1/7000) * value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_DisplacementFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_DisplacementFilter.js.html deleted file mode 100755 index 06dd7d5..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_DisplacementFilter.js.html +++ /dev/null @@ -1,412 +0,0 @@ - - - - - src/pixi/filters/DisplacementFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/DisplacementFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The DisplacementFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object.
    - * You can use this filter to apply all manor of crazy warping effects
    - * Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.
    - * 
    - * @class DisplacementFilter
    - * @extends AbstractFilter
    - * @constructor
    - * @param texture {Texture} The texture used for the displacement map * must be power of 2 texture at the moment
    - */
    -PIXI.DisplacementFilter = function(texture)
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -    texture.baseTexture._powerOf2 = true;
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        displacementMap: {type: 'sampler2D', value:texture},
    -        scale:           {type: '2f', value:{x:30, y:30}},
    -        offset:          {type: '2f', value:{x:0, y:0}},
    -        mapDimensions:   {type: '2f', value:{x:1, y:5112}},
    -        dimensions:   {type: '4fv', value:[0,0,0,0]}
    -    };
    -
    -    if(texture.baseTexture.hasLoaded)
    -    {
    -        this.uniforms.mapDimensions.value.x = texture.width;
    -        this.uniforms.mapDimensions.value.y = texture.height;
    -    }
    -    else
    -    {
    -        this.boundLoadedFunction = this.onTextureLoaded.bind(this);
    -
    -        texture.baseTexture.on('loaded', this.boundLoadedFunction);
    -    }
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D displacementMap;',
    -        'uniform sampler2D uSampler;',
    -        'uniform vec2 scale;',
    -        'uniform vec2 offset;',
    -        'uniform vec4 dimensions;',
    -        'uniform vec2 mapDimensions;',// = vec2(256.0, 256.0);',
    -        // 'const vec2 textureDimensions = vec2(750.0, 750.0);',
    -
    -        'void main(void) {',
    -        '   vec2 mapCords = vTextureCoord.xy;',
    -        //'   mapCords -= ;',
    -        '   mapCords += (dimensions.zw + offset)/ dimensions.xy ;',
    -        '   mapCords.y *= -1.0;',
    -        '   mapCords.y += 1.0;',
    -        '   vec2 matSample = texture2D(displacementMap, mapCords).xy;',
    -        '   matSample -= 0.5;',
    -        '   matSample *= scale;',
    -        '   matSample /= mapDimensions;',
    -        '   gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + matSample.x, vTextureCoord.y + matSample.y));',
    -        '   gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb, 1.0);',
    -        '   vec2 cord = vTextureCoord;',
    -
    -        //'   gl_FragColor =  texture2D(displacementMap, cord);',
    -     //   '   gl_FragColor = gl_FragColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.DisplacementFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.DisplacementFilter.prototype.constructor = PIXI.DisplacementFilter;
    -
    -/**
    - * Sets the map dimensions uniforms when the texture becomes available.
    - *
    - * @method onTextureLoaded
    - */
    -PIXI.DisplacementFilter.prototype.onTextureLoaded = function()
    -{
    -    this.uniforms.mapDimensions.value.x = this.uniforms.displacementMap.value.width;
    -    this.uniforms.mapDimensions.value.y = this.uniforms.displacementMap.value.height;
    -
    -    this.uniforms.displacementMap.value.baseTexture.off('loaded', this.boundLoadedFunction);
    -};
    -
    -/**
    - * The texture used for the displacement map. Must be power of 2 texture.
    - *
    - * @property map
    - * @type Texture
    - */
    -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'map', {
    -    get: function() {
    -        return this.uniforms.displacementMap.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.displacementMap.value = value;
    -    }
    -});
    -
    -/**
    - * The multiplier used to scale the displacement result from the map calculation.
    - *
    - * @property scale
    - * @type Point
    - */
    -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'scale', {
    -    get: function() {
    -        return this.uniforms.scale.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.scale.value = value;
    -    }
    -});
    -
    -/**
    - * The offset used to move the displacement map.
    - *
    - * @property offset
    - * @type Point
    - */
    -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'offset', {
    -    get: function() {
    -        return this.uniforms.offset.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.offset.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_DotScreenFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_DotScreenFilter.js.html deleted file mode 100755 index b0cf737..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_DotScreenFilter.js.html +++ /dev/null @@ -1,363 +0,0 @@ - - - - - src/pixi/filters/DotScreenFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/DotScreenFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/fun/dotscreen.js
    - */
    -
    -/**
    - * This filter applies a dotscreen effect making display objects appear to be made out of black and white halftone dots like an old printer.
    - * 
    - * @class DotScreenFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.DotScreenFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        scale: {type: '1f', value:1},
    -        angle: {type: '1f', value:5},
    -        dimensions:   {type: '4fv', value:[0,0,0,0]}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform vec4 dimensions;',
    -        'uniform sampler2D uSampler;',
    -
    -        'uniform float angle;',
    -        'uniform float scale;',
    -
    -        'float pattern() {',
    -        '   float s = sin(angle), c = cos(angle);',
    -        '   vec2 tex = vTextureCoord * dimensions.xy;',
    -        '   vec2 point = vec2(',
    -        '       c * tex.x - s * tex.y,',
    -        '       s * tex.x + c * tex.y',
    -        '   ) * scale;',
    -        '   return (sin(point.x) * sin(point.y)) * 4.0;',
    -        '}',
    -
    -        'void main() {',
    -        '   vec4 color = texture2D(uSampler, vTextureCoord);',
    -        '   float average = (color.r + color.g + color.b) / 3.0;',
    -        '   gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);',
    -        '}'
    -    ];
    -};
    -
    -PIXI.DotScreenFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.DotScreenFilter.prototype.constructor = PIXI.DotScreenFilter;
    -
    -/**
    - * The scale of the effect.
    - * @property scale
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DotScreenFilter.prototype, 'scale', {
    -    get: function() {
    -        return this.uniforms.scale.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.scale.value = value;
    -    }
    -});
    -
    -/**
    - * The radius of the effect.
    - * @property angle
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DotScreenFilter.prototype, 'angle', {
    -    get: function() {
    -        return this.uniforms.angle.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.angle.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_FilterBlock.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_FilterBlock.js.html deleted file mode 100755 index 275cc3d..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_FilterBlock.js.html +++ /dev/null @@ -1,308 +0,0 @@ - - - - - src/pixi/filters/FilterBlock.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/FilterBlock.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A target and pass info object for filters.
    - * 
    - * @class FilterBlock
    - * @constructor
    - */
    -PIXI.FilterBlock = function()
    -{
    -    /**
    -     * The visible state of this FilterBlock.
    -     *
    -     * @property visible
    -     * @type Boolean
    -     */
    -    this.visible = true;
    -
    -    /**
    -     * The renderable state of this FilterBlock.
    -     *
    -     * @property renderable
    -     * @type Boolean
    -     */
    -    this.renderable = true;
    -};
    -
    -PIXI.FilterBlock.prototype.constructor = PIXI.FilterBlock;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_GrayFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_GrayFilter.js.html deleted file mode 100755 index 5ac5889..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_GrayFilter.js.html +++ /dev/null @@ -1,331 +0,0 @@ - - - - - src/pixi/filters/GrayFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/GrayFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This greyscales the palette of your Display Objects.
    - * 
    - * @class GrayFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.GrayFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        gray: {type: '1f', value: 1}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D uSampler;',
    -        'uniform float gray;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord);',
    -        '   gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(0.2126*gl_FragColor.r + 0.7152*gl_FragColor.g + 0.0722*gl_FragColor.b), gray);',
    -     //   '   gl_FragColor = gl_FragColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.GrayFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.GrayFilter.prototype.constructor = PIXI.GrayFilter;
    -
    -/**
    - * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color.
    - * @property gray
    - * @type Number
    - */
    -Object.defineProperty(PIXI.GrayFilter.prototype, 'gray', {
    -    get: function() {
    -        return this.uniforms.gray.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.gray.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_InvertFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_InvertFilter.js.html deleted file mode 100755 index 8c3dabd..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_InvertFilter.js.html +++ /dev/null @@ -1,332 +0,0 @@ - - - - - src/pixi/filters/InvertFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/InvertFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This inverts your Display Objects colors.
    - * 
    - * @class InvertFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.InvertFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        invert: {type: '1f', value: 1}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float invert;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord);',
    -        '   gl_FragColor.rgb = mix( (vec3(1)-gl_FragColor.rgb) * gl_FragColor.a, gl_FragColor.rgb, 1.0 - invert);',
    -        //'   gl_FragColor.rgb = gl_FragColor.rgb  * gl_FragColor.a;',
    -      //  '   gl_FragColor = gl_FragColor * vColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.InvertFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.InvertFilter.prototype.constructor = PIXI.InvertFilter;
    -
    -/**
    - * The strength of the invert. 1 will fully invert the colors, 0 will make the object its normal color
    - * @property invert
    - * @type Number
    -*/
    -Object.defineProperty(PIXI.InvertFilter.prototype, 'invert', {
    -    get: function() {
    -        return this.uniforms.invert.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.invert.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_NoiseFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_NoiseFilter.js.html deleted file mode 100755 index 2949784..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_NoiseFilter.js.html +++ /dev/null @@ -1,340 +0,0 @@ - - - - - src/pixi/filters/NoiseFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/NoiseFilter.js

    - -
    -
    -/**
    - * @author Vico @vicocotea
    - * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js
    - */
    -
    -/**
    - * A Noise effect filter.
    - * 
    - * @class NoiseFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.NoiseFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        noise: {type: '1f', value: 0.5}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'uniform sampler2D uSampler;',
    -        'uniform float noise;',
    -        'varying vec2 vTextureCoord;',
    -
    -        'float rand(vec2 co) {',
    -        '    return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);',
    -        '}',
    -        'void main() {',
    -        '    vec4 color = texture2D(uSampler, vTextureCoord);',
    -            
    -        '    float diff = (rand(vTextureCoord) - 0.5) * noise;',
    -        '    color.r += diff;',
    -        '    color.g += diff;',
    -        '    color.b += diff;',
    -            
    -        '    gl_FragColor = color;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.NoiseFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.NoiseFilter.prototype.constructor = PIXI.NoiseFilter;
    -
    -/**
    - * The amount of noise to apply.
    - * @property noise
    - * @type Number
    -*/
    -Object.defineProperty(PIXI.NoiseFilter.prototype, 'noise', {
    -    get: function() {
    -        return this.uniforms.noise.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.noise.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_NormalMapFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_NormalMapFilter.js.html deleted file mode 100755 index eca90e7..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_NormalMapFilter.js.html +++ /dev/null @@ -1,474 +0,0 @@ - - - - - src/pixi/filters/NormalMapFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/NormalMapFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -
    -/**
    - * The NormalMapFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. 
    - * You can use this filter to apply all manor of crazy warping effects
    - * Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.
    - * 
    - * @class NormalMapFilter
    - * @extends AbstractFilter
    - * @constructor
    - * @param texture {Texture} The texture used for the displacement map * must be power of 2 texture at the moment
    - */
    -PIXI.NormalMapFilter = function(texture)
    -{
    -	PIXI.AbstractFilter.call( this );
    -	
    -	this.passes = [this];
    -	texture.baseTexture._powerOf2 = true;
    -
    -	// set the uniforms
    -	this.uniforms = {
    -		displacementMap: {type: 'sampler2D', value:texture},
    -		scale:			 {type: '2f', value:{x:15, y:15}},
    -		offset:			 {type: '2f', value:{x:0, y:0}},
    -		mapDimensions:   {type: '2f', value:{x:1, y:1}},
    -		dimensions:   {type: '4f', value:[0,0,0,0]},
    -	//	LightDir: {type: 'f3', value:[0, 1, 0]},
    -		LightPos: {type: '3f', value:[0, 1, 0]}
    -	};
    -	
    -
    -	if(texture.baseTexture.hasLoaded)
    -	{
    -		this.uniforms.mapDimensions.value.x = texture.width;
    -		this.uniforms.mapDimensions.value.y = texture.height;
    -	}
    -	else
    -	{
    -		this.boundLoadedFunction = this.onTextureLoaded.bind(this);
    -
    -		texture.baseTexture.on("loaded", this.boundLoadedFunction);
    -	}
    -
    -	this.fragmentSrc = [
    -	  "precision mediump float;",
    -	  "varying vec2 vTextureCoord;",
    -	  "varying float vColor;",
    -	  "uniform sampler2D displacementMap;",
    -	  "uniform sampler2D uSampler;",
    -	 
    -	  "uniform vec4 dimensions;",
    -	  
    -		"const vec2 Resolution = vec2(1.0,1.0);",      //resolution of screen
    -		"uniform vec3 LightPos;",    //light position, normalized
    -		"const vec4 LightColor = vec4(1.0, 1.0, 1.0, 1.0);",      //light RGBA -- alpha is intensity
    -		"const vec4 AmbientColor = vec4(1.0, 1.0, 1.0, 0.5);",    //ambient RGBA -- alpha is intensity 
    -		"const vec3 Falloff = vec3(0.0, 1.0, 0.2);",         //attenuation coefficients
    -
    -		"uniform vec3 LightDir;",//" = vec3(1.0, 0.0, 1.0);",
    -
    -
    -	  "uniform vec2 mapDimensions;",// = vec2(256.0, 256.0);",
    -	 
    -
    -	  "void main(void) {",
    -	  	"vec2 mapCords = vTextureCoord.xy;",
    -
    -	  	"vec4 color = texture2D(uSampler, vTextureCoord.st);",
    -        "vec3 nColor = texture2D(displacementMap, vTextureCoord.st).rgb;",
    - 
    -
    -	  	"mapCords *= vec2(dimensions.x/512.0, dimensions.y/512.0);",
    -	  
    -	  	"mapCords.y *= -1.0;",
    -	 	"mapCords.y += 1.0;",
    -
    -	 	//RGBA of our diffuse color
    -		"vec4 DiffuseColor = texture2D(uSampler, vTextureCoord);",
    -
    -		//RGB of our normal map
    -		"vec3 NormalMap = texture2D(displacementMap, mapCords).rgb;",
    -
    -		//The delta position of light
    -		//"vec3 LightDir = vec3(LightPos.xy - (gl_FragCoord.xy / Resolution.xy), LightPos.z);",
    -		"vec3 LightDir = vec3(LightPos.xy - (mapCords.xy), LightPos.z);",
    -		//Correct for aspect ratio
    -		//"LightDir.x *= Resolution.x / Resolution.y;",
    -
    -		//Determine distance (used for attenuation) BEFORE we normalize our LightDir
    -		"float D = length(LightDir);",
    -
    -		//normalize our vectors
    -		"vec3 N = normalize(NormalMap * 2.0 - 1.0);",
    -		"vec3 L = normalize(LightDir);",
    -
    -		//Pre-multiply light color with intensity
    -		//Then perform "N dot L" to determine our diffuse term
    -		"vec3 Diffuse = (LightColor.rgb * LightColor.a) * max(dot(N, L), 0.0);",
    -
    -		//pre-multiply ambient color with intensity
    -		"vec3 Ambient = AmbientColor.rgb * AmbientColor.a;",
    -
    -		//calculate attenuation
    -		"float Attenuation = 1.0 / ( Falloff.x + (Falloff.y*D) + (Falloff.z*D*D) );",
    -
    -		//the calculation which brings it all together
    -		"vec3 Intensity = Ambient + Diffuse * Attenuation;",
    -		"vec3 FinalColor = DiffuseColor.rgb * Intensity;",
    -		"gl_FragColor = vColor * vec4(FinalColor, DiffuseColor.a);",
    -		//"gl_FragColor = vec4(1.0, 0.0, 0.0, Attenuation);",//vColor * vec4(FinalColor, DiffuseColor.a);",
    -	/*
    -	 	// normalise color
    -	 	"vec3 normal = normalize(nColor * 2.0 - 1.0);",
    -	 	
    -	 	"vec3 deltaPos = vec3( (light.xy - gl_FragCoord.xy) / resolution.xy, light.z );",
    -
    -	 	"float lambert = clamp(dot(normal, lightDir), 0.0, 1.0);",
    -
    -	 	"float d = sqrt(dot(deltaPos, deltaPos));", 
    -        "float att = 1.0 / ( attenuation.x + (attenuation.y*d) + (attenuation.z*d*d) );",
    -
    -        "vec3 result = (ambientColor * ambientIntensity) + (lightColor.rgb * lambert) * att;",
    -        "result *= color.rgb;",
    -       
    -        "gl_FragColor = vec4(result, 1.0);",*/
    -
    -	  	
    -
    -	  "}"
    -	];
    -	
    -}
    -
    -PIXI.NormalMapFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.NormalMapFilter.prototype.constructor = PIXI.NormalMapFilter;
    -
    -/**
    - * Sets the map dimensions uniforms when the texture becomes available.
    - *
    - * @method onTextureLoaded
    - */
    -PIXI.NormalMapFilter.prototype.onTextureLoaded = function()
    -{
    -	this.uniforms.mapDimensions.value.x = this.uniforms.displacementMap.value.width;
    -	this.uniforms.mapDimensions.value.y = this.uniforms.displacementMap.value.height;
    -
    -	this.uniforms.displacementMap.value.baseTexture.off("loaded", this.boundLoadedFunction)
    -};
    -
    -/**
    - * The texture used for the displacement map. Must be power of 2 texture.
    - *
    - * @property map
    - * @type Texture
    - */
    -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'map', {
    -    get: function() {
    -        return this.uniforms.displacementMap.value;
    -    },
    -    set: function(value) {
    -    	this.uniforms.displacementMap.value = value;
    -    }
    -});
    -
    -/**
    - * The multiplier used to scale the displacement result from the map calculation.
    - *
    - * @property scale
    - * @type Point
    - */
    -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'scale', {
    -    get: function() {
    -        return this.uniforms.scale.value;
    -    },
    -    set: function(value) {
    -    	this.uniforms.scale.value = value;
    -    }
    -});
    -
    -/**
    - * The offset used to move the displacement map.
    - *
    - * @property offset
    - * @type Point
    - */
    -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'offset', {
    -    get: function() {
    -        return this.uniforms.offset.value;
    -    },
    -    set: function(value) {
    -    	this.uniforms.offset.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_PixelateFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_PixelateFilter.js.html deleted file mode 100755 index 3413e27..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_PixelateFilter.js.html +++ /dev/null @@ -1,340 +0,0 @@ - - - - - src/pixi/filters/PixelateFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/PixelateFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This filter applies a pixelate effect making display objects appear 'blocky'.
    - * 
    - * @class PixelateFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.PixelateFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        invert: {type: '1f', value: 0},
    -        dimensions: {type: '4fv', value:new PIXI.Float32Array([10000, 100, 10, 10])},
    -        pixelSize: {type: '2f', value:{x:10, y:10}}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform vec2 testDim;',
    -        'uniform vec4 dimensions;',
    -        'uniform vec2 pixelSize;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   vec2 coord = vTextureCoord;',
    -
    -        '   vec2 size = dimensions.xy/pixelSize;',
    -
    -        '   vec2 color = floor( ( vTextureCoord * size ) ) / size + pixelSize/dimensions.xy * 0.5;',
    -        '   gl_FragColor = texture2D(uSampler, color);',
    -        '}'
    -    ];
    -};
    -
    -PIXI.PixelateFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.PixelateFilter.prototype.constructor = PIXI.PixelateFilter;
    -
    -/**
    - * This a point that describes the size of the blocks. x is the width of the block and y is the height.
    - * 
    - * @property size
    - * @type Point
    - */
    -Object.defineProperty(PIXI.PixelateFilter.prototype, 'size', {
    -    get: function() {
    -        return this.uniforms.pixelSize.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.pixelSize.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_RGBSplitFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_RGBSplitFilter.js.html deleted file mode 100755 index dca385c..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_RGBSplitFilter.js.html +++ /dev/null @@ -1,369 +0,0 @@ - - - - - src/pixi/filters/RGBSplitFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/RGBSplitFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * An RGB Split Filter.
    - * 
    - * @class RGBSplitFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.RGBSplitFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        red: {type: '2f', value: {x:20, y:20}},
    -        green: {type: '2f', value: {x:-20, y:20}},
    -        blue: {type: '2f', value: {x:20, y:-20}},
    -        dimensions:   {type: '4fv', value:[0,0,0,0]}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform vec2 red;',
    -        'uniform vec2 green;',
    -        'uniform vec2 blue;',
    -        'uniform vec4 dimensions;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/dimensions.xy).r;',
    -        '   gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/dimensions.xy).g;',
    -        '   gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/dimensions.xy).b;',
    -        '   gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.RGBSplitFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.RGBSplitFilter.prototype.constructor = PIXI.RGBSplitFilter;
    -
    -/**
    - * Red channel offset.
    - * 
    - * @property red
    - * @type Point
    - */
    -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'red', {
    -    get: function() {
    -        return this.uniforms.red.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.red.value = value;
    -    }
    -});
    -
    -/**
    - * Green channel offset.
    - * 
    - * @property green
    - * @type Point
    - */
    -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'green', {
    -    get: function() {
    -        return this.uniforms.green.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.green.value = value;
    -    }
    -});
    -
    -/**
    - * Blue offset.
    - * 
    - * @property blue
    - * @type Point
    - */
    -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'blue', {
    -    get: function() {
    -        return this.uniforms.blue.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.blue.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_SepiaFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_SepiaFilter.js.html deleted file mode 100755 index aa41b56..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_SepiaFilter.js.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - src/pixi/filters/SepiaFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/SepiaFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This applies a sepia effect to your Display Objects.
    - * 
    - * @class SepiaFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.SepiaFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        sepia: {type: '1f', value: 1}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float sepia;',
    -        'uniform sampler2D uSampler;',
    -
    -        'const mat3 sepiaMatrix = mat3(0.3588, 0.7044, 0.1368, 0.2990, 0.5870, 0.1140, 0.2392, 0.4696, 0.0912);',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord);',
    -        '   gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb * sepiaMatrix, sepia);',
    -       // '   gl_FragColor = gl_FragColor * vColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.SepiaFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.SepiaFilter.prototype.constructor = PIXI.SepiaFilter;
    -
    -/**
    - * The strength of the sepia. 1 will apply the full sepia effect, 0 will make the object its normal color.
    - * @property sepia
    - * @type Number
    -*/
    -Object.defineProperty(PIXI.SepiaFilter.prototype, 'sepia', {
    -    get: function() {
    -        return this.uniforms.sepia.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.sepia.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_SmartBlurFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_SmartBlurFilter.js.html deleted file mode 100755 index d879bbe..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_SmartBlurFilter.js.html +++ /dev/null @@ -1,353 +0,0 @@ - - - - - src/pixi/filters/SmartBlurFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/SmartBlurFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A Smart Blur Filter.
    - * 
    - * @class SmartBlurFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.SmartBlurFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 1/512}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'uniform sampler2D uSampler;',
    -        //'uniform vec2 delta;',
    -        'const vec2 delta = vec2(1.0/10.0, 0.0);',
    -        //'uniform float darkness;',
    -
    -        'float random(vec3 scale, float seed) {',
    -        '   return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);',
    -        '}',
    -
    -
    -        'void main(void) {',
    -        '   vec4 color = vec4(0.0);',
    -        '   float total = 0.0;',
    -
    -        '   float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);',
    -
    -        '   for (float t = -30.0; t <= 30.0; t++) {',
    -        '       float percent = (t + offset - 0.5) / 30.0;',
    -        '       float weight = 1.0 - abs(percent);',
    -        '       vec4 sample = texture2D(uSampler, vTextureCoord + delta * percent);',
    -        '       sample.rgb *= sample.a;',
    -        '       color += sample * weight;',
    -        '       total += weight;',
    -        '   }',
    -
    -        '   gl_FragColor = color / total;',
    -        '   gl_FragColor.rgb /= gl_FragColor.a + 0.00001;',
    -        //'   gl_FragColor.rgb *= darkness;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.SmartBlurFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.SmartBlurFilter.prototype.constructor = PIXI.SmartBlurFilter;
    -
    -/**
    - * The strength of the blur.
    - *
    - * @property blur
    - * @type Number the strength of the blur
    - * @default 2
    - */
    -Object.defineProperty(PIXI.SmartBlurFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.blur.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_TiltShiftFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_TiltShiftFilter.js.html deleted file mode 100755 index d42187b..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_TiltShiftFilter.js.html +++ /dev/null @@ -1,360 +0,0 @@ - - - - - src/pixi/filters/TiltShiftFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/TiltShiftFilter.js

    - -
    -
    -/**
    - * @author Vico @vicocotea
    - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/
    - */
    -
    -/**
    - * A TiltShift Filter. Manages the pass of both a TiltShiftXFilter and TiltShiftYFilter.
    - * 
    - * @class TiltShiftFilter
    - * @constructor
    - */
    -PIXI.TiltShiftFilter = function()
    -{
    -    this.tiltShiftXFilter = new PIXI.TiltShiftXFilter();
    -    this.tiltShiftYFilter = new PIXI.TiltShiftYFilter();
    -    this.tiltShiftXFilter.updateDelta();
    -    this.tiltShiftXFilter.updateDelta();
    -
    -    this.passes = [this.tiltShiftXFilter, this.tiltShiftYFilter];
    -};
    -
    -PIXI.TiltShiftFilter.prototype.constructor = PIXI.TiltShiftFilter;
    -
    -/**
    - * The strength of the blur.
    - *
    - * @property blur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.tiltShiftXFilter.blur;
    -    },
    -    set: function(value) {
    -        this.tiltShiftXFilter.blur = this.tiltShiftYFilter.blur = value;
    -    }
    -});
    -
    -/**
    - * The strength of the gradient blur.
    - *
    - * @property gradientBlur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'gradientBlur', {
    -    get: function() {
    -        return this.tiltShiftXFilter.gradientBlur;
    -    },
    -    set: function(value) {
    -        this.tiltShiftXFilter.gradientBlur = this.tiltShiftYFilter.gradientBlur = value;
    -    }
    -});
    -
    -/**
    - * The Y value to start the effect at.
    - *
    - * @property start
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'start', {
    -    get: function() {
    -        return this.tiltShiftXFilter.start;
    -    },
    -    set: function(value) {
    -        this.tiltShiftXFilter.start = this.tiltShiftYFilter.start = value;
    -    }
    -});
    -
    -/**
    - * The Y value to end the effect at.
    - *
    - * @property end
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'end', {
    -    get: function() {
    -        return this.tiltShiftXFilter.end;
    -    },
    -    set: function(value) {
    -        this.tiltShiftXFilter.end = this.tiltShiftYFilter.end = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_TiltShiftXFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_TiltShiftXFilter.js.html deleted file mode 100755 index bdd0ee0..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_TiltShiftXFilter.js.html +++ /dev/null @@ -1,427 +0,0 @@ - - - - - src/pixi/filters/TiltShiftXFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/TiltShiftXFilter.js

    - -
    -
    -/**
    - * @author Vico @vicocotea
    - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/
    - */
    -
    -/**
    - * A TiltShiftXFilter.
    - * 
    - * @class TiltShiftXFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.TiltShiftXFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 100.0},
    -        gradientBlur: {type: '1f', value: 600.0},
    -        start: {type: '2f', value:{x:0, y:window.screenHeight / 2}},
    -        end: {type: '2f', value:{x:600, y:window.screenHeight / 2}},
    -        delta: {type: '2f', value:{x:30, y:30}},
    -        texSize: {type: '2f', value:{x:window.screenWidth, y:window.screenHeight}}
    -    };
    -
    -    this.updateDelta();
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'uniform sampler2D uSampler;',
    -        'uniform float blur;',
    -        'uniform float gradientBlur;',
    -        'uniform vec2 start;',
    -        'uniform vec2 end;',
    -        'uniform vec2 delta;',
    -        'uniform vec2 texSize;',
    -        'varying vec2 vTextureCoord;',
    -
    -        'float random(vec3 scale, float seed) {',
    -        '   return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);',
    -        '}',
    -
    -        'void main(void) {',
    -        '    vec4 color = vec4(0.0);',
    -        '    float total = 0.0;',
    -        
    -        '    float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);',
    -        '    vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));',
    -        '    float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;',
    -        
    -        '    for (float t = -30.0; t <= 30.0; t++) {',
    -        '        float percent = (t + offset - 0.5) / 30.0;',
    -        '        float weight = 1.0 - abs(percent);',
    -        '        vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);',
    -        '        sample.rgb *= sample.a;',
    -        '        color += sample * weight;',
    -        '        total += weight;',
    -        '    }',
    -
    -        '    gl_FragColor = color / total;',
    -        '    gl_FragColor.rgb /= gl_FragColor.a + 0.00001;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.TiltShiftXFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.TiltShiftXFilter.prototype.constructor = PIXI.TiltShiftXFilter;
    -
    -/**
    - * The strength of the blur.
    - *
    - * @property blur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.blur.value = value;
    -    }
    -});
    -
    -/**
    - * The strength of the gradient blur.
    - *
    - * @property gradientBlur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'gradientBlur', {
    -    get: function() {
    -        return this.uniforms.gradientBlur.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.gradientBlur.value = value;
    -    }
    -});
    -
    -/**
    - * The X value to start the effect at.
    - *
    - * @property start
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'start', {
    -    get: function() {
    -        return this.uniforms.start.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.start.value = value;
    -        this.updateDelta();
    -    }
    -});
    -
    -/**
    - * The X value to end the effect at.
    - *
    - * @property end
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'end', {
    -    get: function() {
    -        return this.uniforms.end.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.end.value = value;
    -        this.updateDelta();
    -    }
    -});
    -
    -/**
    - * Updates the filter delta values.
    - *
    - * @method updateDelta
    - */
    -PIXI.TiltShiftXFilter.prototype.updateDelta = function(){
    -    var dx = this.uniforms.end.value.x - this.uniforms.start.value.x;
    -    var dy = this.uniforms.end.value.y - this.uniforms.start.value.y;
    -    var d = Math.sqrt(dx * dx + dy * dy);
    -    this.uniforms.delta.value.x = dx / d;
    -    this.uniforms.delta.value.y = dy / d;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_TiltShiftYFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_TiltShiftYFilter.js.html deleted file mode 100755 index d99d3d8..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_TiltShiftYFilter.js.html +++ /dev/null @@ -1,427 +0,0 @@ - - - - - src/pixi/filters/TiltShiftYFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/TiltShiftYFilter.js

    - -
    -
    -/**
    - * @author Vico @vicocotea
    - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/
    - */
    -
    -/**
    - * A TiltShiftYFilter.
    - * 
    - * @class TiltShiftYFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.TiltShiftYFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 100.0},
    -        gradientBlur: {type: '1f', value: 600.0},
    -        start: {type: '2f', value:{x:0, y:window.screenHeight / 2}},
    -        end: {type: '2f', value:{x:600, y:window.screenHeight / 2}},
    -        delta: {type: '2f', value:{x:30, y:30}},
    -        texSize: {type: '2f', value:{x:window.screenWidth, y:window.screenHeight}}
    -    };
    -    
    -    this.updateDelta();
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'uniform sampler2D uSampler;',
    -        'uniform float blur;',
    -        'uniform float gradientBlur;',
    -        'uniform vec2 start;',
    -        'uniform vec2 end;',
    -        'uniform vec2 delta;',
    -        'uniform vec2 texSize;',
    -        'varying vec2 vTextureCoord;',
    -
    -        'float random(vec3 scale, float seed) {',
    -        '   return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);',
    -        '}',
    -
    -        'void main(void) {',
    -        '    vec4 color = vec4(0.0);',
    -        '    float total = 0.0;',
    -        
    -        '    float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);',
    -        '    vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));',
    -        '    float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;',
    -        
    -        '    for (float t = -30.0; t <= 30.0; t++) {',
    -        '        float percent = (t + offset - 0.5) / 30.0;',
    -        '        float weight = 1.0 - abs(percent);',
    -        '        vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);',
    -        '        sample.rgb *= sample.a;',
    -        '        color += sample * weight;',
    -        '        total += weight;',
    -        '    }',
    -
    -        '    gl_FragColor = color / total;',
    -        '    gl_FragColor.rgb /= gl_FragColor.a + 0.00001;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.TiltShiftYFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.TiltShiftYFilter.prototype.constructor = PIXI.TiltShiftYFilter;
    -
    -/**
    - * The strength of the blur.
    - *
    - * @property blur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.blur.value = value;
    -    }
    -});
    -
    -/**
    - * The strength of the gradient blur.
    - *
    - * @property gradientBlur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'gradientBlur', {
    -    get: function() {
    -        return this.uniforms.gradientBlur.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.gradientBlur.value = value;
    -    }
    -});
    -
    -/**
    - * The Y value to start the effect at.
    - *
    - * @property start
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'start', {
    -    get: function() {
    -        return this.uniforms.start.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.start.value = value;
    -        this.updateDelta();
    -    }
    -});
    -
    -/**
    - * The Y value to end the effect at.
    - *
    - * @property end
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'end', {
    -    get: function() {
    -        return this.uniforms.end.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.end.value = value;
    -        this.updateDelta();
    -    }
    -});
    -
    -/**
    - * Updates the filter delta values.
    - *
    - * @method updateDelta
    - */
    -PIXI.TiltShiftYFilter.prototype.updateDelta = function(){
    -    var dx = this.uniforms.end.value.x - this.uniforms.start.value.x;
    -    var dy = this.uniforms.end.value.y - this.uniforms.start.value.y;
    -    var d = Math.sqrt(dx * dx + dy * dy);
    -    this.uniforms.delta.value.x = -dy / d;
    -    this.uniforms.delta.value.y = dx / d;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_TwistFilter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_TwistFilter.js.html deleted file mode 100755 index 97e8f4f..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_filters_TwistFilter.js.html +++ /dev/null @@ -1,380 +0,0 @@ - - - - - src/pixi/filters/TwistFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/TwistFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This filter applies a twist effect making display objects appear twisted in the given direction.
    - * 
    - * @class TwistFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.TwistFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        radius: {type: '1f', value:0.5},
    -        angle: {type: '1f', value:5},
    -        offset: {type: '2f', value:{x:0.5, y:0.5}}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform vec4 dimensions;',
    -        'uniform sampler2D uSampler;',
    -
    -        'uniform float radius;',
    -        'uniform float angle;',
    -        'uniform vec2 offset;',
    -
    -        'void main(void) {',
    -        '   vec2 coord = vTextureCoord - offset;',
    -        '   float distance = length(coord);',
    -
    -        '   if (distance < radius) {',
    -        '       float ratio = (radius - distance) / radius;',
    -        '       float angleMod = ratio * ratio * angle;',
    -        '       float s = sin(angleMod);',
    -        '       float c = cos(angleMod);',
    -        '       coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);',
    -        '   }',
    -
    -        '   gl_FragColor = texture2D(uSampler, coord+offset);',
    -        '}'
    -    ];
    -};
    -
    -PIXI.TwistFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.TwistFilter.prototype.constructor = PIXI.TwistFilter;
    -
    -/**
    - * This point describes the the offset of the twist.
    - * 
    - * @property offset
    - * @type Point
    - */
    -Object.defineProperty(PIXI.TwistFilter.prototype, 'offset', {
    -    get: function() {
    -        return this.uniforms.offset.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.offset.value = value;
    -    }
    -});
    -
    -/**
    - * This radius of the twist.
    - * 
    - * @property radius
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TwistFilter.prototype, 'radius', {
    -    get: function() {
    -        return this.uniforms.radius.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.radius.value = value;
    -    }
    -});
    -
    -/**
    - * This angle of the twist.
    - * 
    - * @property angle
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TwistFilter.prototype, 'angle', {
    -    get: function() {
    -        return this.uniforms.angle.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.angle.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_geom_Circle.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_geom_Circle.js.html deleted file mode 100755 index 8c0c076..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_geom_Circle.js.html +++ /dev/null @@ -1,362 +0,0 @@ - - - - - src/pixi/geom/Circle.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Circle.js

    - -
    -
    -/**
    - * @author Chad Engler <chad@pantherdev.com>
    - */
    -
    -/**
    - * The Circle object can be used to specify a hit area for displayObjects
    - *
    - * @class Circle
    - * @constructor
    - * @param x {Number} The X coordinate of the center of this circle
    - * @param y {Number} The Y coordinate of the center of this circle
    - * @param radius {Number} The radius of the circle
    - */
    -PIXI.Circle = function(x, y, radius)
    -{
    -    /**
    -     * @property x
    -     * @type Number
    -     * @default 0
    -     */
    -    this.x = x || 0;
    -
    -    /**
    -     * @property y
    -     * @type Number
    -     * @default 0
    -     */
    -    this.y = y || 0;
    -
    -    /**
    -     * @property radius
    -     * @type Number
    -     * @default 0
    -     */
    -    this.radius = radius || 0;
    -};
    -
    -/**
    - * Creates a clone of this Circle instance
    - *
    - * @method clone
    - * @return {Circle} a copy of the Circle
    - */
    -PIXI.Circle.prototype.clone = function()
    -{
    -    return new PIXI.Circle(this.x, this.y, this.radius);
    -};
    -
    -/**
    - * Checks whether the x and y coordinates given are contained within this circle
    - *
    - * @method contains
    - * @param x {Number} The X coordinate of the point to test
    - * @param y {Number} The Y coordinate of the point to test
    - * @return {Boolean} Whether the x/y coordinates are within this Circle
    - */
    -PIXI.Circle.prototype.contains = function(x, y)
    -{
    -    if(this.radius <= 0)
    -        return false;
    -
    -    var dx = (this.x - x),
    -        dy = (this.y - y),
    -        r2 = this.radius * this.radius;
    -
    -    dx *= dx;
    -    dy *= dy;
    -
    -    return (dx + dy <= r2);
    -};
    -
    -/**
    -* Returns the framing rectangle of the circle as a PIXI.Rectangle object
    -*
    -* @method getBounds
    -* @return {Rectangle} the framing rectangle
    -*/
    -PIXI.Circle.prototype.getBounds = function()
    -{
    -    return new PIXI.Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2);
    -};
    -
    -// constructor
    -PIXI.Circle.prototype.constructor = PIXI.Circle;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_geom_Ellipse.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_geom_Ellipse.js.html deleted file mode 100755 index f4ebbfb..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_geom_Ellipse.js.html +++ /dev/null @@ -1,370 +0,0 @@ - - - - - src/pixi/geom/Ellipse.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Ellipse.js

    - -
    -
    -/**
    - * @author Chad Engler <chad@pantherdev.com>
    - */
    -
    -/**
    - * The Ellipse object can be used to specify a hit area for displayObjects
    - *
    - * @class Ellipse
    - * @constructor
    - * @param x {Number} The X coordinate of the center of the ellipse
    - * @param y {Number} The Y coordinate of the center of the ellipse
    - * @param width {Number} The half width of this ellipse
    - * @param height {Number} The half height of this ellipse
    - */
    -PIXI.Ellipse = function(x, y, width, height)
    -{
    -    /**
    -     * @property x
    -     * @type Number
    -     * @default 0
    -     */
    -    this.x = x || 0;
    -
    -    /**
    -     * @property y
    -     * @type Number
    -     * @default 0
    -     */
    -    this.y = y || 0;
    -
    -    /**
    -     * @property width
    -     * @type Number
    -     * @default 0
    -     */
    -    this.width = width || 0;
    -
    -    /**
    -     * @property height
    -     * @type Number
    -     * @default 0
    -     */
    -    this.height = height || 0;
    -};
    -
    -/**
    - * Creates a clone of this Ellipse instance
    - *
    - * @method clone
    - * @return {Ellipse} a copy of the ellipse
    - */
    -PIXI.Ellipse.prototype.clone = function()
    -{
    -    return new PIXI.Ellipse(this.x, this.y, this.width, this.height);
    -};
    -
    -/**
    - * Checks whether the x and y coordinates given are contained within this ellipse
    - *
    - * @method contains
    - * @param x {Number} The X coordinate of the point to test
    - * @param y {Number} The Y coordinate of the point to test
    - * @return {Boolean} Whether the x/y coords are within this ellipse
    - */
    -PIXI.Ellipse.prototype.contains = function(x, y)
    -{
    -    if(this.width <= 0 || this.height <= 0)
    -        return false;
    -
    -    //normalize the coords to an ellipse with center 0,0
    -    var normx = ((x - this.x) / this.width),
    -        normy = ((y - this.y) / this.height);
    -
    -    normx *= normx;
    -    normy *= normy;
    -
    -    return (normx + normy <= 1);
    -};
    -
    -/**
    -* Returns the framing rectangle of the ellipse as a PIXI.Rectangle object
    -*
    -* @method getBounds
    -* @return {Rectangle} the framing rectangle
    -*/
    -PIXI.Ellipse.prototype.getBounds = function()
    -{
    -    return new PIXI.Rectangle(this.x - this.width, this.y - this.height, this.width, this.height);
    -};
    -
    -// constructor
    -PIXI.Ellipse.prototype.constructor = PIXI.Ellipse;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_geom_Matrix.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_geom_Matrix.js.html deleted file mode 100755 index f57168e..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_geom_Matrix.js.html +++ /dev/null @@ -1,546 +0,0 @@ - - - - - src/pixi/geom/Matrix.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Matrix.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The Matrix class is now an object, which makes it a lot faster, 
    - * here is a representation of it : 
    - * | a | b | tx|
    - * | c | d | ty|
    - * | 0 | 0 | 1 |
    - *
    - * @class Matrix
    - * @constructor
    - */
    -PIXI.Matrix = function()
    -{
    -    /**
    -     * @property a
    -     * @type Number
    -     * @default 1
    -     */
    -    this.a = 1;
    -
    -    /**
    -     * @property b
    -     * @type Number
    -     * @default 0
    -     */
    -    this.b = 0;
    -
    -    /**
    -     * @property c
    -     * @type Number
    -     * @default 0
    -     */
    -    this.c = 0;
    -
    -    /**
    -     * @property d
    -     * @type Number
    -     * @default 1
    -     */
    -    this.d = 1;
    -
    -    /**
    -     * @property tx
    -     * @type Number
    -     * @default 0
    -     */
    -    this.tx = 0;
    -
    -    /**
    -     * @property ty
    -     * @type Number
    -     * @default 0
    -     */
    -    this.ty = 0;
    -};
    -
    -/**
    - * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:
    - *
    - * a = array[0]
    - * b = array[1]
    - * c = array[3]
    - * d = array[4]
    - * tx = array[2]
    - * ty = array[5]
    - *
    - * @method fromArray
    - * @param array {Array} The array that the matrix will be populated from.
    - */
    -PIXI.Matrix.prototype.fromArray = function(array)
    -{
    -    this.a = array[0];
    -    this.b = array[1];
    -    this.c = array[3];
    -    this.d = array[4];
    -    this.tx = array[2];
    -    this.ty = array[5];
    -};
    -
    -/**
    - * Creates an array from the current Matrix object.
    - *
    - * @method toArray
    - * @param transpose {Boolean} Whether we need to transpose the matrix or not
    - * @return {Array} the newly created array which contains the matrix
    - */
    -PIXI.Matrix.prototype.toArray = function(transpose)
    -{
    -    if(!this.array) this.array = new PIXI.Float32Array(9);
    -    var array = this.array;
    -
    -    if(transpose)
    -    {
    -        array[0] = this.a;
    -        array[1] = this.b;
    -        array[2] = 0;
    -        array[3] = this.c;
    -        array[4] = this.d;
    -        array[5] = 0;
    -        array[6] = this.tx;
    -        array[7] = this.ty;
    -        array[8] = 1;
    -    }
    -    else
    -    {
    -        array[0] = this.a;
    -        array[1] = this.c;
    -        array[2] = this.tx;
    -        array[3] = this.b;
    -        array[4] = this.d;
    -        array[5] = this.ty;
    -        array[6] = 0;
    -        array[7] = 0;
    -        array[8] = 1;
    -    }
    -
    -    return array;
    -};
    -
    -/**
    - * Get a new position with the current transformation applied.
    - * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)
    - *
    - * @method apply
    - * @param pos {Point} The origin
    - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input)
    - * @return {Point} The new point, transformed through this matrix
    - */
    -PIXI.Matrix.prototype.apply = function(pos, newPos)
    -{
    -    newPos = newPos || new PIXI.Point();
    -
    -    newPos.x = this.a * pos.x + this.c * pos.y + this.tx;
    -    newPos.y = this.b * pos.x + this.d * pos.y + this.ty;
    -
    -    return newPos;
    -};
    -
    -/**
    - * Get a new position with the inverse of the current transformation applied.
    - * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)
    - *
    - * @method applyInverse
    - * @param pos {Point} The origin
    - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input)
    - * @return {Point} The new point, inverse-transformed through this matrix
    - */
    -PIXI.Matrix.prototype.applyInverse = function(pos, newPos)
    -{
    -    newPos = newPos || new PIXI.Point();
    -
    -    var id = 1 / (this.a * this.d + this.c * -this.b);
    -     
    -    newPos.x = this.d * id * pos.x + -this.c * id * pos.y + (this.ty * this.c - this.tx * this.d) * id;
    -    newPos.y = this.a * id * pos.y + -this.b * id * pos.x + (-this.ty * this.a + this.tx * this.b) * id;
    -
    -    return newPos;
    -};
    -
    -/**
    - * Translates the matrix on the x and y.
    - * 
    - * @method translate
    - * @param {Number} x
    - * @param {Number} y
    - * @return {Matrix} This matrix. Good for chaining method calls.
    - **/
    -PIXI.Matrix.prototype.translate = function(x, y)
    -{
    -    this.tx += x;
    -    this.ty += y;
    -    
    -    return this;
    -};
    -
    -/**
    - * Applies a scale transformation to the matrix.
    - * 
    - * @method scale
    - * @param {Number} x The amount to scale horizontally
    - * @param {Number} y The amount to scale vertically
    - * @return {Matrix} This matrix. Good for chaining method calls.
    - **/
    -PIXI.Matrix.prototype.scale = function(x, y)
    -{
    -    this.a *= x;
    -    this.d *= y;
    -    this.c *= x;
    -    this.b *= y;
    -    this.tx *= x;
    -    this.ty *= y;
    -
    -    return this;
    -};
    -
    -
    -/**
    - * Applies a rotation transformation to the matrix.
    - * @method rotate
    - * @param {Number} angle The angle in radians.
    - * @return {Matrix} This matrix. Good for chaining method calls.
    - **/
    -PIXI.Matrix.prototype.rotate = function(angle)
    -{
    -    var cos = Math.cos( angle );
    -    var sin = Math.sin( angle );
    -
    -    var a1 = this.a;
    -    var c1 = this.c;
    -    var tx1 = this.tx;
    -
    -    this.a = a1 * cos-this.b * sin;
    -    this.b = a1 * sin+this.b * cos;
    -    this.c = c1 * cos-this.d * sin;
    -    this.d = c1 * sin+this.d * cos;
    -    this.tx = tx1 * cos - this.ty * sin;
    -    this.ty = tx1 * sin + this.ty * cos;
    - 
    -    return this;
    -};
    -
    -/**
    - * Appends the given Matrix to this Matrix.
    - * 
    - * @method append
    - * @param {Matrix} matrix
    - * @return {Matrix} This matrix. Good for chaining method calls.
    - */
    -PIXI.Matrix.prototype.append = function(matrix)
    -{
    -    var a1 = this.a;
    -    var b1 = this.b;
    -    var c1 = this.c;
    -    var d1 = this.d;
    -
    -    this.a  = matrix.a * a1 + matrix.b * c1;
    -    this.b  = matrix.a * b1 + matrix.b * d1;
    -    this.c  = matrix.c * a1 + matrix.d * c1;
    -    this.d  = matrix.c * b1 + matrix.d * d1;
    -
    -    this.tx = matrix.tx * a1 + matrix.ty * c1 + this.tx;
    -    this.ty = matrix.tx * b1 + matrix.ty * d1 + this.ty;
    -    
    -    return this;
    -};
    -
    -/**
    - * Resets this Matix to an identity (default) matrix.
    - * 
    - * @method identity
    - * @return {Matrix} This matrix. Good for chaining method calls.
    - */
    -PIXI.Matrix.prototype.identity = function()
    -{
    -    this.a = 1;
    -    this.b = 0;
    -    this.c = 0;
    -    this.d = 1;
    -    this.tx = 0;
    -    this.ty = 0;
    -
    -    return this;
    -};
    -
    -PIXI.identityMatrix = new PIXI.Matrix();
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_geom_Point.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_geom_Point.js.html deleted file mode 100755 index c8dfbb2..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_geom_Point.js.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - src/pixi/geom/Point.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Point.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    - *
    - * @class Point
    - * @constructor
    - * @param x {Number} position of the point on the x axis
    - * @param y {Number} position of the point on the y axis
    - */
    -PIXI.Point = function(x, y)
    -{
    -    /**
    -     * @property x
    -     * @type Number
    -     * @default 0
    -     */
    -    this.x = x || 0;
    -
    -    /**
    -     * @property y
    -     * @type Number
    -     * @default 0
    -     */
    -    this.y = y || 0;
    -};
    -
    -/**
    - * Creates a clone of this point
    - *
    - * @method clone
    - * @return {Point} a copy of the point
    - */
    -PIXI.Point.prototype.clone = function()
    -{
    -    return new PIXI.Point(this.x, this.y);
    -};
    -
    -/**
    - * Sets the point to a new x and y position.
    - * If y is omitted, both x and y will be set to x.
    - * 
    - * @method set
    - * @param [x=0] {Number} position of the point on the x axis
    - * @param [y=0] {Number} position of the point on the y axis
    - */
    -PIXI.Point.prototype.set = function(x, y)
    -{
    -    this.x = x || 0;
    -    this.y = y || ( (y !== 0) ? this.x : 0 ) ;
    -};
    -
    -// constructor
    -PIXI.Point.prototype.constructor = PIXI.Point;
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_geom_Polygon.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_geom_Polygon.js.html deleted file mode 100755 index b0bc19f..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_geom_Polygon.js.html +++ /dev/null @@ -1,354 +0,0 @@ - - - - - src/pixi/geom/Polygon.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Polygon.js

    - -
    -
    -/**
    - * @author Adrien Brault <adrien.brault@gmail.com>
    - */
    -
    -/**
    - * @class Polygon
    - * @constructor
    - * @param points* {Array<Point>|Array<Number>|Point...|Number...} This can be an array of Points that form the polygon,
    - *      a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be
    - *      all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the
    - *      arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are
    - *      Numbers.
    - */
    -PIXI.Polygon = function(points)
    -{
    -    //if points isn't an array, use arguments as the array
    -    if(!(points instanceof Array))points = Array.prototype.slice.call(arguments);
    -
    -    //if this is a flat array of numbers, convert it to points
    -    if(points[0] instanceof PIXI.Point)
    -    {
    -        var p = [];
    -        for(var i = 0, il = points.length; i < il; i++)
    -        {
    -            p.push(points[i].x, points[i].y);
    -        }
    -
    -        points = p;
    -    }
    -
    -    this.closed = true;
    -    this.points = points;
    -};
    -
    -/**
    - * Creates a clone of this polygon
    - *
    - * @method clone
    - * @return {Polygon} a copy of the polygon
    - */
    -PIXI.Polygon.prototype.clone = function()
    -{
    -    var points = this.points.slice();
    -    return new PIXI.Polygon(points);
    -};
    -
    -/**
    - * Checks whether the x and y coordinates passed to this function are contained within this polygon
    - *
    - * @method contains
    - * @param x {Number} The X coordinate of the point to test
    - * @param y {Number} The Y coordinate of the point to test
    - * @return {Boolean} Whether the x/y coordinates are within this polygon
    - */
    -PIXI.Polygon.prototype.contains = function(x, y)
    -{
    -    var inside = false;
    -
    -    // use some raycasting to test hits
    -    // https://github.com/substack/point-in-polygon/blob/master/index.js
    -    var length = this.points.length / 2;
    -
    -    for(var i = 0, j = length - 1; i < length; j = i++)
    -    {
    -        var xi = this.points[i * 2], yi = this.points[i * 2 + 1],
    -            xj = this.points[j * 2], yj = this.points[j * 2 + 1],
    -            intersect = ((yi > y) !== (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi);
    -
    -        if(intersect) inside = !inside;
    -    }
    -
    -    return inside;
    -};
    -
    -// constructor
    -PIXI.Polygon.prototype.constructor = PIXI.Polygon;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_geom_Rectangle.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_geom_Rectangle.js.html deleted file mode 100755 index c17bec4..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_geom_Rectangle.js.html +++ /dev/null @@ -1,364 +0,0 @@ - - - - - src/pixi/geom/Rectangle.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Rectangle.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/
    - */
    -
    -/**
    - * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    - *
    - * @class Rectangle
    - * @constructor
    - * @param x {Number} The X coordinate of the upper-left corner of the rectangle
    - * @param y {Number} The Y coordinate of the upper-left corner of the rectangle
    - * @param width {Number} The overall width of this rectangle
    - * @param height {Number} The overall height of this rectangle
    - */
    -PIXI.Rectangle = function(x, y, width, height)
    -{
    -    /**
    -     * @property x
    -     * @type Number
    -     * @default 0
    -     */
    -    this.x = x || 0;
    -
    -    /**
    -     * @property y
    -     * @type Number
    -     * @default 0
    -     */
    -    this.y = y || 0;
    -
    -    /**
    -     * @property width
    -     * @type Number
    -     * @default 0
    -     */
    -    this.width = width || 0;
    -
    -    /**
    -     * @property height
    -     * @type Number
    -     * @default 0
    -     */
    -    this.height = height || 0;
    -};
    -
    -/**
    - * Creates a clone of this Rectangle
    - *
    - * @method clone
    - * @return {Rectangle} a copy of the rectangle
    - */
    -PIXI.Rectangle.prototype.clone = function()
    -{
    -    return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    -};
    -
    -/**
    - * Checks whether the x and y coordinates given are contained within this Rectangle
    - *
    - * @method contains
    - * @param x {Number} The X coordinate of the point to test
    - * @param y {Number} The Y coordinate of the point to test
    - * @return {Boolean} Whether the x/y coordinates are within this Rectangle
    - */
    -PIXI.Rectangle.prototype.contains = function(x, y)
    -{
    -    if(this.width <= 0 || this.height <= 0)
    -        return false;
    -
    -    var x1 = this.x;
    -    if(x >= x1 && x <= x1 + this.width)
    -    {
    -        var y1 = this.y;
    -
    -        if(y >= y1 && y <= y1 + this.height)
    -        {
    -            return true;
    -        }
    -    }
    -
    -    return false;
    -};
    -
    -// constructor
    -PIXI.Rectangle.prototype.constructor = PIXI.Rectangle;
    -
    -PIXI.EmptyRectangle = new PIXI.Rectangle(0,0,0,0);
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_geom_RoundedRectangle.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_geom_RoundedRectangle.js.html deleted file mode 100755 index 153da24..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_geom_RoundedRectangle.js.html +++ /dev/null @@ -1,372 +0,0 @@ - - - - - src/pixi/geom/RoundedRectangle.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/RoundedRectangle.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/
    - */
    -
    -/**
    - * the Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height.
    - *
    - * @class Rounded Rectangle
    - * @constructor
    - * @param x {Number} The X coordinate of the upper-left corner of the rounded rectangle
    - * @param y {Number} The Y coordinate of the upper-left corner of the rounded rectangle
    - * @param width {Number} The overall width of this rounded rectangle
    - * @param height {Number} The overall height of this rounded rectangle
    - * @param radius {Number} The overall radius of this corners of this rounded rectangle
    - */
    -PIXI.RoundedRectangle = function(x, y, width, height, radius)
    -{
    -    /**
    -     * @property x
    -     * @type Number
    -     * @default 0
    -     */
    -    this.x = x || 0;
    -
    -    /**
    -     * @property y
    -     * @type Number
    -     * @default 0
    -     */
    -    this.y = y || 0;
    -
    -    /**
    -     * @property width
    -     * @type Number
    -     * @default 0
    -     */
    -    this.width = width || 0;
    -
    -    /**
    -     * @property height
    -     * @type Number
    -     * @default 0
    -     */
    -    this.height = height || 0;
    -
    -    /**
    -     * @property radius
    -     * @type Number
    -     * @default 20
    -     */
    -    this.radius = radius || 20;
    -};
    -
    -/**
    - * Creates a clone of this Rounded Rectangle
    - *
    - * @method clone
    - * @return {rounded Rectangle} a copy of the rounded rectangle
    - */
    -PIXI.RoundedRectangle.prototype.clone = function()
    -{
    -    return new PIXI.RoundedRectangle(this.x, this.y, this.width, this.height, this.radius);
    -};
    -
    -/**
    - * Checks whether the x and y coordinates given are contained within this Rounded Rectangle
    - *
    - * @method contains
    - * @param x {Number} The X coordinate of the point to test
    - * @param y {Number} The Y coordinate of the point to test
    - * @return {Boolean} Whether the x/y coordinates are within this Rounded Rectangle
    - */
    -PIXI.RoundedRectangle.prototype.contains = function(x, y)
    -{
    -    if(this.width <= 0 || this.height <= 0)
    -        return false;
    -
    -    var x1 = this.x;
    -    if(x >= x1 && x <= x1 + this.width)
    -    {
    -        var y1 = this.y;
    -
    -        if(y >= y1 && y <= y1 + this.height)
    -        {
    -            return true;
    -        }
    -    }
    -
    -    return false;
    -};
    -
    -// constructor
    -PIXI.RoundedRectangle.prototype.constructor = PIXI.RoundedRectangle;
    -
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_loaders_AssetLoader.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_loaders_AssetLoader.js.html deleted file mode 100755 index 43a5333..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_loaders_AssetLoader.js.html +++ /dev/null @@ -1,438 +0,0 @@ - - - - - src/pixi/loaders/AssetLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/AssetLoader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * 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
    - * @uses EventTarget
    - * @param assetURLs {Array<String>} 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'.
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.AssetLoader = function(assetURLs, crossorigin)
    -{
    -    /**
    -     * The array of asset URLs that are going to be loaded
    -     *
    -     * @property assetURLs
    -     * @type Array<String>
    -     */
    -    this.assetURLs = assetURLs;
    -
    -    /**
    -     * Whether the requests should be treated as cross origin
    -     *
    -     * @property crossorigin
    -     * @type Boolean
    -     */
    -    this.crossorigin = crossorigin;
    -
    -    /**
    -     * Maps file extension to loader types
    -     *
    -     * @property loadersByType
    -     * @type Object
    -     */
    -    this.loadersByType = {
    -        'jpg':  PIXI.ImageLoader,
    -        'jpeg': PIXI.ImageLoader,
    -        'png':  PIXI.ImageLoader,
    -        'gif':  PIXI.ImageLoader,
    -        'webp': PIXI.ImageLoader,
    -        'json': PIXI.JsonLoader,
    -        'atlas': PIXI.AtlasLoader,
    -        'anim': PIXI.SpineLoader,
    -        'xml':  PIXI.BitmapFontLoader,
    -        'fnt':  PIXI.BitmapFontLoader
    -    };
    -};
    -
    -PIXI.EventTarget.mixin(PIXI.AssetLoader.prototype);
    -
    -/**
    - * Fired when an item has loaded
    - * @event onProgress
    - */
    -
    -/**
    - * Fired when all the assets have loaded
    - * @event onComplete
    - */
    -
    -// constructor
    -PIXI.AssetLoader.prototype.constructor = PIXI.AssetLoader;
    -
    -/**
    - * Given a filename, returns its extension.
    - *
    - * @method _getDataType
    - * @param str {String} the name of the asset
    - */
    -PIXI.AssetLoader.prototype._getDataType = function(str)
    -{
    -    var test = 'data:';
    -    //starts with 'data:'
    -    var start = str.slice(0, test.length).toLowerCase();
    -    if (start === test) {
    -        var data = str.slice(test.length);
    -
    -        var sepIdx = data.indexOf(',');
    -        if (sepIdx === -1) //malformed data URI scheme
    -            return null;
    -
    -        //e.g. 'image/gif;base64' => 'image/gif'
    -        var info = data.slice(0, sepIdx).split(';')[0];
    -
    -        //We might need to handle some special cases here...
    -        //standardize text/plain to 'txt' file extension
    -        if (!info || info.toLowerCase() === 'text/plain')
    -            return 'txt';
    -
    -        //User specified mime type, try splitting it by '/'
    -        return info.split('/').pop().toLowerCase();
    -    }
    -
    -    return null;
    -};
    -
    -/**
    - * Starts loading the assets sequentially
    - *
    - * @method load
    - */
    -PIXI.AssetLoader.prototype.load = function()
    -{
    -    var scope = this;
    -
    -    function onLoad(evt) {
    -        scope.onAssetLoaded(evt.data.content);
    -    }
    -
    -    this.loadCount = this.assetURLs.length;
    -
    -    for (var i=0; i < this.assetURLs.length; i++)
    -    {
    -        var fileName = this.assetURLs[i];
    -        //first see if we have a data URI scheme..
    -        var fileType = this._getDataType(fileName);
    -
    -        //if not, assume it's a file URI
    -        if (!fileType)
    -            fileType = fileName.split('?').shift().split('.').pop().toLowerCase();
    -
    -        var Constructor = this.loadersByType[fileType];
    -        if(!Constructor)
    -            throw new Error(fileType + ' is an unsupported file type');
    -
    -        var loader = new Constructor(fileName, this.crossorigin);
    -
    -        loader.on('loaded', onLoad);
    -        loader.load();
    -    }
    -};
    -
    -/**
    - * Invoked after each file is loaded
    - *
    - * @method onAssetLoaded
    - * @private
    - */
    -PIXI.AssetLoader.prototype.onAssetLoaded = function(loader)
    -{
    -    this.loadCount--;
    -    this.emit('onProgress', { content: this, loader: loader });
    -    if (this.onProgress) this.onProgress(loader);
    -
    -    if (!this.loadCount)
    -    {
    -        this.emit('onComplete', { content: this });
    -        if(this.onComplete) this.onComplete();
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_loaders_AtlasLoader.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_loaders_AtlasLoader.js.html deleted file mode 100755 index 13fc730..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_loaders_AtlasLoader.js.html +++ /dev/null @@ -1,468 +0,0 @@ - - - - - src/pixi/loaders/AtlasLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/AtlasLoader.js

    - -
    -
    -/**
    - * @author Martin Kelm http://mkelm.github.com
    - */
    -
    -/**
    - * The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event.
    - *
    - * To generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format.
    - * 
    - * It is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to 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.fromFrameId()
    - * 
    - * @class AtlasLoader
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the JSON file
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.AtlasLoader = function (url, crossorigin) {
    -    this.url = url;
    -    this.baseUrl = url.replace(/[^\/]*$/, '');
    -    this.crossorigin = crossorigin;
    -    this.loaded = false;
    -
    -};
    -
    -// constructor
    -PIXI.AtlasLoader.constructor = PIXI.AtlasLoader;
    -
    -PIXI.EventTarget.mixin(PIXI.AtlasLoader.prototype);
    -
    - /**
    - * Starts loading the JSON file
    - *
    - * @method load
    - */
    -PIXI.AtlasLoader.prototype.load = function () {
    -    this.ajaxRequest = new PIXI.AjaxRequest();
    -    this.ajaxRequest.onreadystatechange = this.onAtlasLoaded.bind(this);
    -
    -    this.ajaxRequest.open('GET', this.url, true);
    -    if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/json');
    -    this.ajaxRequest.send(null);
    -};
    -
    -/**
    - * Invoked when the Atlas has fully loaded. Parses the JSON and builds the texture frames.
    - * 
    - * @method onAtlasLoaded
    - * @private
    - */
    -PIXI.AtlasLoader.prototype.onAtlasLoaded = function () {
    -    if (this.ajaxRequest.readyState === 4) {
    -        if (this.ajaxRequest.status === 200 || window.location.href.indexOf('http') === -1) {
    -            this.atlas = {
    -                meta : {
    -                    image : []
    -                },
    -                frames : []
    -            };
    -            var result = this.ajaxRequest.responseText.split(/\r?\n/);
    -            var lineCount = -3;
    -
    -            var currentImageId = 0;
    -            var currentFrame = null;
    -            var nameInNextLine = false;
    -
    -            var i = 0,
    -                j = 0,
    -                selfOnLoaded = this.onLoaded.bind(this);
    -
    -            // parser without rotation support yet!
    -            for (i = 0; i < result.length; i++) {
    -                result[i] = result[i].replace(/^\s+|\s+$/g, '');
    -                if (result[i] === '') {
    -                    nameInNextLine = i+1;
    -                }
    -                if (result[i].length > 0) {
    -                    if (nameInNextLine === i) {
    -                        this.atlas.meta.image.push(result[i]);
    -                        currentImageId = this.atlas.meta.image.length - 1;
    -                        this.atlas.frames.push({});
    -                        lineCount = -3;
    -                    } else if (lineCount > 0) {
    -                        if (lineCount % 7 === 1) { // frame name
    -                            if (currentFrame != null) { //jshint ignore:line
    -                                this.atlas.frames[currentImageId][currentFrame.name] = currentFrame;
    -                            }
    -                            currentFrame = { name: result[i], frame : {} };
    -                        } else {
    -                            var text = result[i].split(' ');
    -                            if (lineCount % 7 === 3) { // position
    -                                currentFrame.frame.x = Number(text[1].replace(',', ''));
    -                                currentFrame.frame.y = Number(text[2]);
    -                            } else if (lineCount % 7 === 4) { // size
    -                                currentFrame.frame.w = Number(text[1].replace(',', ''));
    -                                currentFrame.frame.h = Number(text[2]);
    -                            } else if (lineCount % 7 === 5) { // real size
    -                                var realSize = {
    -                                    x : 0,
    -                                    y : 0,
    -                                    w : Number(text[1].replace(',', '')),
    -                                    h : Number(text[2])
    -                                };
    -
    -                                if (realSize.w > currentFrame.frame.w || realSize.h > currentFrame.frame.h) {
    -                                    currentFrame.trimmed = true;
    -                                    currentFrame.realSize = realSize;
    -                                } else {
    -                                    currentFrame.trimmed = false;
    -                                }
    -                            }
    -                        }
    -                    }
    -                    lineCount++;
    -                }
    -            }
    -
    -            if (currentFrame != null) { //jshint ignore:line
    -                this.atlas.frames[currentImageId][currentFrame.name] = currentFrame;
    -            }
    -
    -            if (this.atlas.meta.image.length > 0) {
    -                this.images = [];
    -                for (j = 0; j < this.atlas.meta.image.length; j++) {
    -                    // sprite sheet
    -                    var textureUrl = this.baseUrl + this.atlas.meta.image[j];
    -                    var frameData = this.atlas.frames[j];
    -                    this.images.push(new PIXI.ImageLoader(textureUrl, this.crossorigin));
    -
    -                    for (i in frameData) {
    -                        var rect = frameData[i].frame;
    -                        if (rect) {
    -                            PIXI.TextureCache[i] = new PIXI.Texture(this.images[j].texture.baseTexture, {
    -                                x: rect.x,
    -                                y: rect.y,
    -                                width: rect.w,
    -                                height: rect.h
    -                            });
    -                            if (frameData[i].trimmed) {
    -                                PIXI.TextureCache[i].realSize = frameData[i].realSize;
    -                                // trim in pixi not supported yet, todo update trim properties if it is done ...
    -                                PIXI.TextureCache[i].trim.x = 0;
    -                                PIXI.TextureCache[i].trim.y = 0;
    -                            }
    -                        }
    -                    }
    -                }
    -
    -                this.currentImageId = 0;
    -                for (j = 0; j < this.images.length; j++) {
    -                    this.images[j].on('loaded', selfOnLoaded);
    -                }
    -                this.images[this.currentImageId].load();
    -
    -            } else {
    -                this.onLoaded();
    -            }
    -
    -        } else {
    -            this.onError();
    -        }
    -    }
    -};
    -
    -/**
    - * Invoked when json file has loaded.
    - * 
    - * @method onLoaded
    - * @private
    - */
    -PIXI.AtlasLoader.prototype.onLoaded = function () {
    -    if (this.images.length - 1 > this.currentImageId) {
    -        this.currentImageId++;
    -        this.images[this.currentImageId].load();
    -    } else {
    -        this.loaded = true;
    -        this.emit('loaded', { content: this });
    -    }
    -};
    -
    -/**
    - * Invoked when an error occurs.
    - * 
    - * @method onError
    - * @private
    - */
    -PIXI.AtlasLoader.prototype.onError = function () {
    -    this.emit('error', { content: this });
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_loaders_BitmapFontLoader.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_loaders_BitmapFontLoader.js.html deleted file mode 100755 index 489b3b0..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_loaders_BitmapFontLoader.js.html +++ /dev/null @@ -1,439 +0,0 @@ - - - - - src/pixi/loaders/BitmapFontLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/BitmapFontLoader.js

    - -
    -
    -/**
    - * @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
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the sprite sheet JSON file
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.BitmapFontLoader = function(url, crossorigin)
    -{
    -    /**
    -     * The url of the bitmap font data
    -     *
    -     * @property url
    -     * @type String
    -     */
    -    this.url = url;
    -
    -    /**
    -     * Whether the requests should be treated as cross origin
    -     *
    -     * @property crossorigin
    -     * @type Boolean
    -     */
    -    this.crossorigin = crossorigin;
    -
    -    /**
    -     * [read-only] The base url of the bitmap font data
    -     *
    -     * @property baseUrl
    -     * @type String
    -     * @readOnly
    -     */
    -    this.baseUrl = url.replace(/[^\/]*$/, '');
    -
    -    /**
    -     * [read-only] The texture of the bitmap font
    -     *
    -     * @property texture
    -     * @type Texture
    -     */
    -    this.texture = null;
    -};
    -
    -// constructor
    -PIXI.BitmapFontLoader.prototype.constructor = PIXI.BitmapFontLoader;
    -PIXI.EventTarget.mixin(PIXI.BitmapFontLoader.prototype);
    -
    -/**
    - * Loads the XML font data
    - *
    - * @method load
    - */
    -PIXI.BitmapFontLoader.prototype.load = function()
    -{
    -    this.ajaxRequest = new PIXI.AjaxRequest();
    -    this.ajaxRequest.onreadystatechange = this.onXMLLoaded.bind(this);
    -
    -    this.ajaxRequest.open('GET', this.url, true);
    -    if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/xml');
    -    this.ajaxRequest.send(null);
    -};
    -
    -/**
    - * Invoked when the XML file is loaded, parses the data.
    - *
    - * @method onXMLLoaded
    - * @private
    - */
    -PIXI.BitmapFontLoader.prototype.onXMLLoaded = function()
    -{
    -    if (this.ajaxRequest.readyState === 4)
    -    {
    -        if (this.ajaxRequest.status === 200 || window.location.protocol.indexOf('http') === -1)
    -        {
    -            var responseXML = this.ajaxRequest.responseXML;
    -            if(!responseXML || /MSIE 9/i.test(navigator.userAgent) || navigator.isCocoonJS) {
    -                if(typeof(window.DOMParser) === 'function') {
    -                    var domparser = new DOMParser();
    -                    responseXML = domparser.parseFromString(this.ajaxRequest.responseText, 'text/xml');
    -                } else {
    -                    var div = document.createElement('div');
    -                    div.innerHTML = this.ajaxRequest.responseText;
    -                    responseXML = div;
    -                }
    -            }
    -
    -            var textureUrl = this.baseUrl + responseXML.getElementsByTagName('page')[0].getAttribute('file');
    -            var image = new PIXI.ImageLoader(textureUrl, this.crossorigin);
    -            this.texture = image.texture.baseTexture;
    -
    -            var data = {};
    -            var info = responseXML.getElementsByTagName('info')[0];
    -            var common = responseXML.getElementsByTagName('common')[0];
    -            data.font = info.getAttribute('face');
    -            data.size = parseInt(info.getAttribute('size'), 10);
    -            data.lineHeight = parseInt(common.getAttribute('lineHeight'), 10);
    -            data.chars = {};
    -
    -            //parse letters
    -            var letters = responseXML.getElementsByTagName('char');
    -
    -            for (var i = 0; i < letters.length; i++)
    -            {
    -                var charCode = parseInt(letters[i].getAttribute('id'), 10);
    -
    -                var textureRect = new PIXI.Rectangle(
    -                    parseInt(letters[i].getAttribute('x'), 10),
    -                    parseInt(letters[i].getAttribute('y'), 10),
    -                    parseInt(letters[i].getAttribute('width'), 10),
    -                    parseInt(letters[i].getAttribute('height'), 10)
    -                );
    -
    -                data.chars[charCode] = {
    -                    xOffset: parseInt(letters[i].getAttribute('xoffset'), 10),
    -                    yOffset: parseInt(letters[i].getAttribute('yoffset'), 10),
    -                    xAdvance: parseInt(letters[i].getAttribute('xadvance'), 10),
    -                    kerning: {},
    -                    texture: PIXI.TextureCache[charCode] = new PIXI.Texture(this.texture, textureRect)
    -
    -                };
    -            }
    -
    -            //parse kernings
    -            var kernings = responseXML.getElementsByTagName('kerning');
    -            for (i = 0; i < kernings.length; i++)
    -            {
    -                var first = parseInt(kernings[i].getAttribute('first'), 10);
    -                var second = parseInt(kernings[i].getAttribute('second'), 10);
    -                var amount = parseInt(kernings[i].getAttribute('amount'), 10);
    -
    -                data.chars[second].kerning[first] = amount;
    -
    -            }
    -
    -            PIXI.BitmapText.fonts[data.font] = data;
    -
    -            image.addEventListener('loaded', this.onLoaded.bind(this));
    -            image.load();
    -        }
    -    }
    -};
    -
    -/**
    - * Invoked when all files are loaded (xml/fnt and texture)
    - *
    - * @method onLoaded
    - * @private
    - */
    -PIXI.BitmapFontLoader.prototype.onLoaded = function()
    -{
    -    this.emit('loaded', { content: this });
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_loaders_ImageLoader.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_loaders_ImageLoader.js.html deleted file mode 100755 index 7ca22b2..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_loaders_ImageLoader.js.html +++ /dev/null @@ -1,380 +0,0 @@ - - - - - src/pixi/loaders/ImageLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/ImageLoader.js

    - -
    -
    -/**
    - * @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.fromFrame() and PIXI.Sprite.fromFrame()
    - * When loaded this class will dispatch a 'loaded' event
    - *
    - * @class ImageLoader
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the image
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.ImageLoader = function(url, crossorigin)
    -{
    -    /**
    -     * The texture being loaded
    -     *
    -     * @property texture
    -     * @type Texture
    -     */
    -    this.texture = PIXI.Texture.fromImage(url, crossorigin);
    -
    -    /**
    -     * if the image is loaded with loadFramedSpriteSheet
    -     * frames will contain the sprite sheet frames
    -     *
    -     * @property frames
    -     * @type Array
    -     * @readOnly
    -     */
    -    this.frames = [];
    -};
    -
    -// constructor
    -PIXI.ImageLoader.prototype.constructor = PIXI.ImageLoader;
    -
    -PIXI.EventTarget.mixin(PIXI.ImageLoader.prototype);
    -
    -/**
    - * Loads image or takes it from cache
    - *
    - * @method load
    - */
    -PIXI.ImageLoader.prototype.load = function()
    -{
    -    if(!this.texture.baseTexture.hasLoaded)
    -    {
    -        this.texture.baseTexture.on('loaded', this.onLoaded.bind(this));
    -    }
    -    else
    -    {
    -        this.onLoaded();
    -    }
    -};
    -
    -/**
    - * Invoked when image file is loaded or it is already cached and ready to use
    - *
    - * @method onLoaded
    - * @private
    - */
    -PIXI.ImageLoader.prototype.onLoaded = function()
    -{
    -    this.emit('loaded', { content: this });
    -};
    -
    -/**
    - * Loads image and split it to uniform sized frames
    - *
    - * @method loadFramedSpriteSheet
    - * @param frameWidth {Number} width of each frame
    - * @param frameHeight {Number} height of each frame
    - * @param textureName {String} if given, the frames will be cached in <textureName>-<ord> format
    - */
    -PIXI.ImageLoader.prototype.loadFramedSpriteSheet = function(frameWidth, frameHeight, textureName)
    -{
    -    this.frames = [];
    -    var cols = Math.floor(this.texture.width / frameWidth);
    -    var rows = Math.floor(this.texture.height / frameHeight);
    -
    -    var i=0;
    -    for (var y=0; y<rows; y++)
    -    {
    -        for (var x=0; x<cols; x++,i++)
    -        {
    -            var texture = new PIXI.Texture(this.texture.baseTexture, {
    -                x: x*frameWidth,
    -                y: y*frameHeight,
    -                width: frameWidth,
    -                height: frameHeight
    -            });
    -
    -            this.frames.push(texture);
    -            if (textureName) PIXI.TextureCache[textureName + '-' + i] = texture;
    -        }
    -    }
    -
    -	this.load();
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_loaders_JsonLoader.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_loaders_JsonLoader.js.html deleted file mode 100755 index 0aeaff7..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_loaders_JsonLoader.js.html +++ /dev/null @@ -1,466 +0,0 @@ - - - - - src/pixi/loaders/JsonLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/JsonLoader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The json file loader is used to load in JSON data and parse it
    - * When loaded this class will dispatch a 'loaded' event
    - * If loading fails this class will dispatch an 'error' event
    - *
    - * @class JsonLoader
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the JSON file
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.JsonLoader = function (url, crossorigin) {
    -
    -    /**
    -     * The url of the bitmap font data
    -     *
    -     * @property url
    -     * @type String
    -     */
    -    this.url = url;
    -
    -    /**
    -     * Whether the requests should be treated as cross origin
    -     *
    -     * @property crossorigin
    -     * @type Boolean
    -     */
    -    this.crossorigin = crossorigin;
    -
    -    /**
    -     * [read-only] The base url of the bitmap font data
    -     *
    -     * @property baseUrl
    -     * @type String
    -     * @readOnly
    -     */
    -    this.baseUrl = url.replace(/[^\/]*$/, '');
    -
    -    /**
    -     * [read-only] Whether the data has loaded yet
    -     *
    -     * @property loaded
    -     * @type Boolean
    -     * @readOnly
    -     */
    -    this.loaded = false;
    -
    -};
    -
    -// constructor
    -PIXI.JsonLoader.prototype.constructor = PIXI.JsonLoader;
    -
    -PIXI.EventTarget.mixin(PIXI.JsonLoader.prototype);
    -
    -/**
    - * Loads the JSON data
    - *
    - * @method load
    - */
    -PIXI.JsonLoader.prototype.load = function () {
    -
    -    if(window.XDomainRequest && this.crossorigin)
    -    {
    -        this.ajaxRequest = new window.XDomainRequest();
    -
    -        // XDomainRequest has a few quirks. Occasionally it will abort requests
    -        // A way to avoid this is to make sure ALL callbacks are set even if not used
    -        // More info here: http://stackoverflow.com/questions/15786966/xdomainrequest-aborts-post-on-ie-9
    -        this.ajaxRequest.timeout = 3000;
    -
    -        this.ajaxRequest.onerror = this.onError.bind(this);
    -
    -        this.ajaxRequest.ontimeout = this.onError.bind(this);
    -
    -        this.ajaxRequest.onprogress = function() {};
    -
    -    }
    -    else if (window.XMLHttpRequest)
    -    {
    -        this.ajaxRequest = new window.XMLHttpRequest();
    -    }
    -    else
    -    {
    -        this.ajaxRequest = new window.ActiveXObject('Microsoft.XMLHTTP');
    -    }
    -
    -    this.ajaxRequest.onload = this.onJSONLoaded.bind(this);
    -
    -    this.ajaxRequest.open('GET',this.url,true);
    -
    -    this.ajaxRequest.send();
    -};
    -
    -/**
    - * Invoked when the JSON file is loaded.
    - *
    - * @method onJSONLoaded
    - * @private
    - */
    -PIXI.JsonLoader.prototype.onJSONLoaded = function () {
    -
    -    if(!this.ajaxRequest.responseText )
    -    {
    -        this.onError();
    -        return;
    -    }
    -
    -    this.json = JSON.parse(this.ajaxRequest.responseText);
    -
    -    if(this.json.frames)
    -    {
    -        // sprite sheet
    -        var textureUrl = this.baseUrl + this.json.meta.image;
    -        var image = new PIXI.ImageLoader(textureUrl, this.crossorigin);
    -        var frameData = this.json.frames;
    -
    -        this.texture = image.texture.baseTexture;
    -        image.addEventListener('loaded', this.onLoaded.bind(this));
    -
    -        for (var i in frameData)
    -        {
    -            var rect = frameData[i].frame;
    -
    -            if (rect)
    -            {
    -                var textureSize = new PIXI.Rectangle(rect.x, rect.y, rect.w, rect.h);
    -                var crop = textureSize.clone();
    -                var trim = null;
    -                
    -                //  Check to see if the sprite is trimmed
    -                if (frameData[i].trimmed)
    -                {
    -                    var actualSize = frameData[i].sourceSize;
    -                    var realSize = frameData[i].spriteSourceSize;
    -                    trim = new PIXI.Rectangle(realSize.x, realSize.y, actualSize.w, actualSize.h);
    -                }
    -                PIXI.TextureCache[i] = new PIXI.Texture(this.texture, textureSize, crop, trim);
    -            }
    -        }
    -
    -        image.load();
    -
    -    }
    -    else if(this.json.bones)
    -    {
    -        // spine animation
    -        var spineJsonParser = new spine.SkeletonJson();
    -        var skeletonData = spineJsonParser.readSkeletonData(this.json);
    -        PIXI.AnimCache[this.url] = skeletonData;
    -        this.onLoaded();
    -    }
    -    else
    -    {
    -        this.onLoaded();
    -    }
    -};
    -
    -/**
    - * Invoked when the json file has loaded.
    - *
    - * @method onLoaded
    - * @private
    - */
    -PIXI.JsonLoader.prototype.onLoaded = function () {
    -    this.loaded = true;
    -    this.dispatchEvent({
    -        type: 'loaded',
    -        content: this
    -    });
    -};
    -
    -/**
    - * Invoked if an error occurs.
    - *
    - * @method onError
    - * @private
    - */
    -PIXI.JsonLoader.prototype.onError = function () {
    -
    -    this.dispatchEvent({
    -        type: 'error',
    -        content: this
    -    });
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_loaders_SpineLoader.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_loaders_SpineLoader.js.html deleted file mode 100755 index d56935e..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_loaders_SpineLoader.js.html +++ /dev/null @@ -1,359 +0,0 @@ - - - - - src/pixi/loaders/SpineLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/SpineLoader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * based on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi
    - *
    - * Awesome JS run time provided by EsotericSoftware
    - * https://github.com/EsotericSoftware/spine-runtimes
    - *
    - */
    -
    -/**
    - * The Spine loader is used to load in JSON spine data
    - * To generate the data you need to use http://esotericsoftware.com/ and export in the "JSON" format
    - * Due to a clash of names  You will need to change the extension of the spine file from *.json to *.anim for it to load
    - * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source
    - * You will need to generate a sprite sheet to accompany the spine data
    - * When loaded this class will dispatch a "loaded" event
    - *
    - * @class SpineLoader
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the JSON file
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.SpineLoader = function(url, crossorigin)
    -{
    -    /**
    -     * The url of the bitmap font data
    -     *
    -     * @property url
    -     * @type String
    -     */
    -    this.url = url;
    -
    -    /**
    -     * Whether the requests should be treated as cross origin
    -     *
    -     * @property crossorigin
    -     * @type Boolean
    -     */
    -    this.crossorigin = crossorigin;
    -
    -    /**
    -     * [read-only] Whether the data has loaded yet
    -     *
    -     * @property loaded
    -     * @type Boolean
    -     * @readOnly
    -     */
    -    this.loaded = false;
    -};
    -
    -PIXI.SpineLoader.prototype.constructor = PIXI.SpineLoader;
    -
    -PIXI.EventTarget.mixin(PIXI.SpineLoader.prototype);
    -
    -/**
    - * Loads the JSON data
    - *
    - * @method load
    - */
    -PIXI.SpineLoader.prototype.load = function () {
    -
    -    var scope = this;
    -    var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin);
    -    jsonLoader.on('loaded', function (event) {
    -        scope.json = event.data.content.json;
    -        scope.onLoaded();
    -    });
    -    jsonLoader.load();
    -};
    -
    -/**
    - * Invoked when JSON file is loaded.
    - *
    - * @method onLoaded
    - * @private
    - */
    -PIXI.SpineLoader.prototype.onLoaded = function () {
    -    this.loaded = true;
    -    this.emit('loaded', { content: this });
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_loaders_SpriteSheetLoader.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_loaders_SpriteSheetLoader.js.html deleted file mode 100755 index 60e57df..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_loaders_SpriteSheetLoader.js.html +++ /dev/null @@ -1,372 +0,0 @@ - - - - - src/pixi/loaders/SpriteSheetLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/SpriteSheetLoader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * 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 in 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 a 'texture atlas') as it means sprites 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.fromFrameId()
    - * This loader will load the image file that the Spritesheet points to as well as the data.
    - * When loaded this class will dispatch a 'loaded' event
    - *
    - * @class SpriteSheetLoader
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the sprite sheet JSON file
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.SpriteSheetLoader = function (url, crossorigin) {
    -
    -    /**
    -     * The url of the atlas data
    -     *
    -     * @property url
    -     * @type String
    -     */
    -    this.url = url;
    -
    -    /**
    -     * Whether the requests should be treated as cross origin
    -     *
    -     * @property crossorigin
    -     * @type Boolean
    -     */
    -    this.crossorigin = crossorigin;
    -
    -    /**
    -     * [read-only] The base url of the bitmap font data
    -     *
    -     * @property baseUrl
    -     * @type String
    -     * @readOnly
    -     */
    -    this.baseUrl = url.replace(/[^\/]*$/, '');
    -
    -    /**
    -     * The texture being loaded
    -     *
    -     * @property texture
    -     * @type Texture
    -     */
    -    this.texture = null;
    -
    -    /**
    -     * The frames of the sprite sheet
    -     *
    -     * @property frames
    -     * @type Object
    -     */
    -    this.frames = {};
    -};
    -
    -// constructor
    -PIXI.SpriteSheetLoader.prototype.constructor = PIXI.SpriteSheetLoader;
    -
    -PIXI.EventTarget.mixin(PIXI.SpriteSheetLoader.prototype);
    -
    -/**
    - * This will begin loading the JSON file
    - *
    - * @method load
    - */
    -PIXI.SpriteSheetLoader.prototype.load = function () {
    -    var scope = this;
    -    var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin);
    -    jsonLoader.on('loaded', function (event) {
    -        scope.json = event.data.content.json;
    -        scope.onLoaded();
    -    });
    -    jsonLoader.load();
    -};
    -
    -/**
    - * Invoke when all files are loaded (json and texture)
    - *
    - * @method onLoaded
    - * @private
    - */
    -PIXI.SpriteSheetLoader.prototype.onLoaded = function () {
    -    this.emit('loaded', {
    -        content: this
    -    });
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_primitives_Graphics.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_primitives_Graphics.js.html deleted file mode 100755 index 4161dd1..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_primitives_Graphics.js.html +++ /dev/null @@ -1,1403 +0,0 @@ - - - - - src/pixi/primitives/Graphics.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/primitives/Graphics.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and color and fill them.
    - * 
    - * @class Graphics
    - * @extends DisplayObjectContainer
    - * @constructor
    - */
    -PIXI.Graphics = function()
    -{
    -    PIXI.DisplayObjectContainer.call( this );
    -
    -    this.renderable = true;
    -
    -    /**
    -     * The alpha value used when filling the Graphics object.
    -     *
    -     * @property fillAlpha
    -     * @type Number
    -     */
    -    this.fillAlpha = 1;
    -
    -    /**
    -     * The width (thickness) of any lines drawn.
    -     *
    -     * @property lineWidth
    -     * @type Number
    -     */
    -    this.lineWidth = 0;
    -
    -    /**
    -     * The color of any lines drawn.
    -     *
    -     * @property lineColor
    -     * @type String
    -     * @default 0
    -     */
    -    this.lineColor = 0;
    -
    -    /**
    -     * Graphics data
    -     *
    -     * @property graphicsData
    -     * @type Array
    -     * @private
    -     */
    -    this.graphicsData = [];
    -
    -    /**
    -     * The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint.
    -     *
    -     * @property tint
    -     * @type Number
    -     * @default 0xFFFFFF
    -     */
    -    this.tint = 0xFFFFFF;
    -    
    -    /**
    -     * The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode.
    -     *
    -     * @property blendMode
    -     * @type Number
    -     * @default PIXI.blendModes.NORMAL;
    -     */
    -    this.blendMode = PIXI.blendModes.NORMAL;
    -    
    -    /**
    -     * Current path
    -     *
    -     * @property currentPath
    -     * @type Object
    -     * @private
    -     */
    -    this.currentPath = null;
    -    
    -    /**
    -     * Array containing some WebGL-related properties used by the WebGL renderer.
    -     *
    -     * @property _webGL
    -     * @type Array
    -     * @private
    -     */
    -    this._webGL = [];
    -
    -    /**
    -     * Whether this shape is being used as a mask.
    -     *
    -     * @property isMask
    -     * @type Boolean
    -     */
    -    this.isMask = false;
    -
    -    /**
    -     * The bounds' padding used for bounds calculation.
    -     *
    -     * @property boundsPadding
    -     * @type Number
    -     */
    -    this.boundsPadding = 0;
    -
    -    this._localBounds = new PIXI.Rectangle(0,0,1,1);
    -
    -    /**
    -     * Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated.
    -     * 
    -     * @property dirty
    -     * @type Boolean
    -     * @private
    -     */
    -    this.dirty = true;
    -
    -    /**
    -     * Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated.
    -     * 
    -     * @property webGLDirty
    -     * @type Boolean
    -     * @private
    -     */
    -    this.webGLDirty = false;
    -
    -    /**
    -     * Used to detect if the cached sprite object needs to be updated.
    -     * 
    -     * @property cachedSpriteDirty
    -     * @type Boolean
    -     * @private
    -     */
    -    this.cachedSpriteDirty = false;
    -
    -};
    -
    -// constructor
    -PIXI.Graphics.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    -PIXI.Graphics.prototype.constructor = PIXI.Graphics;
    -
    -/**
    - * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite.
    - * This is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory.
    - * It is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas.
    - * This is not recommended if you are constantly redrawing the graphics element.
    - *
    - * @property cacheAsBitmap
    - * @type Boolean
    - * @default false
    - * @private
    - */
    -Object.defineProperty(PIXI.Graphics.prototype, "cacheAsBitmap", {
    -    get: function() {
    -        return  this._cacheAsBitmap;
    -    },
    -    set: function(value) {
    -        this._cacheAsBitmap = value;
    -
    -        if(this._cacheAsBitmap)
    -        {
    -
    -            this._generateCachedSprite();
    -        }
    -        else
    -        {
    -            this.destroyCachedSprite();
    -            this.dirty = true;
    -        }
    -
    -    }
    -});
    -
    -/**
    - * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.
    - *
    - * @method lineStyle
    - * @param lineWidth {Number} width of the line to draw, will update the objects stored style
    - * @param color {Number} color of the line to draw, will update the objects stored style
    - * @param alpha {Number} alpha of the line to draw, will update the objects stored style
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha)
    -{
    -    this.lineWidth = lineWidth || 0;
    -    this.lineColor = color || 0;
    -    this.lineAlpha = (arguments.length < 3) ? 1 : alpha;
    -
    -    if(this.currentPath)
    -    {
    -        if(this.currentPath.shape.points.length)
    -        {
    -            // halfway through a line? start a new one!
    -            this.drawShape( new PIXI.Polygon( this.currentPath.shape.points.slice(-2) ));
    -            return this;
    -        }
    -
    -        // otherwise its empty so lets just set the line properties
    -        this.currentPath.lineWidth = this.lineWidth;
    -        this.currentPath.lineColor = this.lineColor;
    -        this.currentPath.lineAlpha = this.lineAlpha;
    -        
    -    }
    -
    -    return this;
    -};
    -
    -/**
    - * Moves the current drawing position to x, y.
    - *
    - * @method moveTo
    - * @param x {Number} the X coordinate to move to
    - * @param y {Number} the Y coordinate to move to
    - * @return {Graphics}
    -  */
    -PIXI.Graphics.prototype.moveTo = function(x, y)
    -{
    -    this.drawShape(new PIXI.Polygon([x,y]));
    -
    -    return this;
    -};
    -
    -/**
    - * Draws a line using the current line style from the current drawing position to (x, y);
    - * The current drawing position is then set to (x, y).
    - *
    - * @method lineTo
    - * @param x {Number} the X coordinate to draw to
    - * @param y {Number} the Y coordinate to draw to
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.lineTo = function(x, y)
    -{
    -    this.currentPath.shape.points.push(x, y);
    -    this.dirty = true;
    -
    -    return this;
    -};
    -
    -/**
    - * Calculate the points for a quadratic bezier curve and then draws it.
    - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c
    - *
    - * @method quadraticCurveTo
    - * @param cpX {Number} Control point x
    - * @param cpY {Number} Control point y
    - * @param toX {Number} Destination point x
    - * @param toY {Number} Destination point y
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.quadraticCurveTo = function(cpX, cpY, toX, toY)
    -{
    -    if( this.currentPath )
    -    {
    -        if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0];
    -    }
    -    else
    -    {
    -        this.moveTo(0,0);
    -    }
    -
    -    var xa,
    -    ya,
    -    n = 20,
    -    points = this.currentPath.shape.points;
    -    if(points.length === 0)this.moveTo(0, 0);
    -    
    -
    -    var fromX = points[points.length-2];
    -    var fromY = points[points.length-1];
    -
    -    var j = 0;
    -    for (var i = 1; i <= n; i++ )
    -    {
    -        j = i / n;
    -
    -        xa = fromX + ( (cpX - fromX) * j );
    -        ya = fromY + ( (cpY - fromY) * j );
    -
    -        points.push( xa + ( ((cpX + ( (toX - cpX) * j )) - xa) * j ),
    -                     ya + ( ((cpY + ( (toY - cpY) * j )) - ya) * j ) );
    -    }
    -
    -
    -    this.dirty = true;
    -
    -    return this;
    -};
    -
    -/**
    - * Calculate the points for a bezier curve and then draws it.
    - *
    - * @method bezierCurveTo
    - * @param cpX {Number} Control point x
    - * @param cpY {Number} Control point y
    - * @param cpX2 {Number} Second Control point x
    - * @param cpY2 {Number} Second Control point y
    - * @param toX {Number} Destination point x
    - * @param toY {Number} Destination point y
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.bezierCurveTo = function(cpX, cpY, cpX2, cpY2, toX, toY)
    -{
    -    if( this.currentPath )
    -    {
    -        if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0];
    -    }
    -    else
    -    {
    -        this.moveTo(0,0);
    -    }
    -
    -    var n = 20,
    -    dt,
    -    dt2,
    -    dt3,
    -    t2,
    -    t3,
    -    points = this.currentPath.shape.points;
    -
    -    var fromX = points[points.length-2];
    -    var fromY = points[points.length-1];
    -    
    -    var j = 0;
    -
    -    for (var i=1; i<=n; i++)
    -    {
    -        j = i / n;
    -
    -        dt = (1 - j);
    -        dt2 = dt * dt;
    -        dt3 = dt2 * dt;
    -
    -        t2 = j * j;
    -        t3 = t2 * j;
    -        
    -        points.push( dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX,
    -                     dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY);
    -    }
    -    
    -    this.dirty = true;
    -
    -    return this;
    -};
    -
    -/*
    - * The arcTo() method creates an arc/curve between two tangents on the canvas.
    - * 
    - * "borrowed" from https://code.google.com/p/fxcanvas/ - thanks google!
    - *
    - * @method arcTo
    - * @param x1 {Number} The x-coordinate of the beginning of the arc
    - * @param y1 {Number} The y-coordinate of the beginning of the arc
    - * @param x2 {Number} The x-coordinate of the end of the arc
    - * @param y2 {Number} The y-coordinate of the end of the arc
    - * @param radius {Number} The radius of the arc
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.arcTo = function(x1, y1, x2, y2, radius)
    -{
    -    if( this.currentPath )
    -    {
    -        if(this.currentPath.shape.points.length === 0)
    -        {
    -            this.currentPath.shape.points.push(x1, y1);
    -        }
    -    }
    -    else
    -    {
    -        this.moveTo(x1, y1);
    -    }
    -
    -    var points = this.currentPath.shape.points;
    -    var fromX = points[points.length-2];
    -    var fromY = points[points.length-1];
    -    var a1 = fromY - y1;
    -    var b1 = fromX - x1;
    -    var a2 = y2   - y1;
    -    var b2 = x2   - x1;
    -    var mm = Math.abs(a1 * b2 - b1 * a2);
    -
    -
    -    if (mm < 1.0e-8 || radius === 0)
    -    {
    -        if( points[points.length-2] !== x1 || points[points.length-1] !== y1)
    -        {
    -            //console.log(">>")
    -            points.push(x1, y1);
    -        }
    -    }
    -    else
    -    {
    -        var dd = a1 * a1 + b1 * b1;
    -        var cc = a2 * a2 + b2 * b2;
    -        var tt = a1 * a2 + b1 * b2;
    -        var k1 = radius * Math.sqrt(dd) / mm;
    -        var k2 = radius * Math.sqrt(cc) / mm;
    -        var j1 = k1 * tt / dd;
    -        var j2 = k2 * tt / cc;
    -        var cx = k1 * b2 + k2 * b1;
    -        var cy = k1 * a2 + k2 * a1;
    -        var px = b1 * (k2 + j1);
    -        var py = a1 * (k2 + j1);
    -        var qx = b2 * (k1 + j2);
    -        var qy = a2 * (k1 + j2);
    -        var startAngle = Math.atan2(py - cy, px - cx);
    -        var endAngle   = Math.atan2(qy - cy, qx - cx);
    -
    -        this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1);
    -    }
    -
    -    this.dirty = true;
    -
    -    return this;
    -};
    -
    -/**
    - * The arc method creates an arc/curve (used to create circles, or parts of circles).
    - *
    - * @method arc
    - * @param cx {Number} The x-coordinate of the center of the circle
    - * @param cy {Number} The y-coordinate of the center of the circle
    - * @param radius {Number} The radius of the circle
    - * @param startAngle {Number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle)
    - * @param endAngle {Number} The ending angle, in radians
    - * @param anticlockwise {Boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise.
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise)
    -{
    -    var startX = cx + Math.cos(startAngle) * radius;
    -    var startY = cy + Math.sin(startAngle) * radius;
    -   
    -    var points = this.currentPath.shape.points;
    -
    -    if(points.length === 0)
    -    {
    -        this.moveTo(startX, startY);
    -        points = this.currentPath.shape.points;
    -    }
    -    else if( points[points.length-2] !== startX || points[points.length-1] !== startY)
    -    {
    -        points.push(startX, startY);
    -    }
    -  
    -    if (startAngle === endAngle)return this;
    -
    -    if( !anticlockwise && endAngle <= startAngle )
    -    {
    -        endAngle += Math.PI * 2;
    -    }
    -    else if( anticlockwise && startAngle <= endAngle )
    -    {
    -        startAngle += Math.PI * 2;
    -    }
    -
    -    var sweep = anticlockwise ? (startAngle - endAngle) *-1 : (endAngle - startAngle);
    -    var segs =  ( Math.abs(sweep)/ (Math.PI * 2) ) * 40;
    -
    -    if( sweep === 0 ) return this;
    -
    -    var theta = sweep/(segs*2);
    -    var theta2 = theta*2;
    -
    -    var cTheta = Math.cos(theta);
    -    var sTheta = Math.sin(theta);
    -    
    -    var segMinus = segs - 1;
    -
    -    var remainder = ( segMinus % 1 ) / segMinus;
    -
    -    for(var i=0; i<=segMinus; i++)
    -    {
    -        var real =  i + remainder * i;
    -
    -    
    -        var angle = ((theta) + startAngle + (theta2 * real));
    -
    -        var c = Math.cos(angle);
    -        var s = -Math.sin(angle);
    -
    -        points.push(( (cTheta *  c) + (sTheta * s) ) * radius + cx,
    -                    ( (cTheta * -s) + (sTheta * c) ) * radius + cy);
    -    }
    -
    -    this.dirty = true;
    -
    -    return this;
    -};
    -
    -/**
    - * Specifies a simple one-color fill that subsequent calls to other Graphics methods
    - * (such as lineTo() or drawCircle()) use when drawing.
    - *
    - * @method beginFill
    - * @param color {Number} the color of the fill
    - * @param alpha {Number} the alpha of the fill
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.beginFill = function(color, alpha)
    -{
    -    this.filling = true;
    -    this.fillColor = color || 0;
    -    this.fillAlpha = (alpha === undefined) ? 1 : alpha;
    -
    -    if(this.currentPath)
    -    {
    -        if(this.currentPath.shape.points.length <= 2)
    -        {
    -            this.currentPath.fill = this.filling;
    -            this.currentPath.fillColor = this.fillColor;
    -            this.currentPath.fillAlpha = this.fillAlpha;
    -        }
    -    }
    -    return this;
    -};
    -
    -/**
    - * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.
    - *
    - * @method endFill
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.endFill = function()
    -{
    -    this.filling = false;
    -    this.fillColor = null;
    -    this.fillAlpha = 1;
    -
    -    return this;
    -};
    -
    -/**
    - * @method drawRect
    - *
    - * @param x {Number} The X coord of the top-left of the rectangle
    - * @param y {Number} The Y coord of the top-left of the rectangle
    - * @param width {Number} The width of the rectangle
    - * @param height {Number} The height of the rectangle
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.drawRect = function( x, y, width, height )
    -{
    -    this.drawShape(new PIXI.Rectangle(x,y, width, height));
    -
    -    return this;
    -};
    -
    -/**
    - * @method drawRoundedRect
    - *
    - * @param x {Number} The X coord of the top-left of the rectangle
    - * @param y {Number} The Y coord of the top-left of the rectangle
    - * @param width {Number} The width of the rectangle
    - * @param height {Number} The height of the rectangle
    - * @param radius {Number} Radius of the rectangle corners
    - */
    -PIXI.Graphics.prototype.drawRoundedRect = function( x, y, width, height, radius )
    -{
    -    this.drawShape(new PIXI.RoundedRectangle(x, y, width, height, radius));
    -
    -    return this;
    -};
    -
    -/**
    - * Draws a circle.
    - *
    - * @method drawCircle
    - * @param x {Number} The X coordinate of the center of the circle
    - * @param y {Number} The Y coordinate of the center of the circle
    - * @param radius {Number} The radius of the circle
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.drawCircle = function(x, y, radius)
    -{
    -    this.drawShape(new PIXI.Circle(x,y, radius));
    -
    -    return this;
    -};
    -
    -/**
    - * Draws an ellipse.
    - *
    - * @method drawEllipse
    - * @param x {Number} The X coordinate of the center of the ellipse
    - * @param y {Number} The Y coordinate of the center of the ellipse
    - * @param width {Number} The half width of the ellipse
    - * @param height {Number} The half height of the ellipse
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.drawEllipse = function(x, y, width, height)
    -{
    -    this.drawShape(new PIXI.Ellipse(x, y, width, height));
    -
    -    return this;
    -};
    -
    -/**
    - * Draws a polygon using the given path.
    - *
    - * @method drawPolygon
    - * @param path {Array} The path data used to construct the polygon.
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.drawPolygon = function(path)
    -{
    -    if(!(path instanceof Array))path = Array.prototype.slice.call(arguments);
    -    this.drawShape(new PIXI.Polygon(path));
    -    return this;
    -};
    -
    -/**
    - * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.
    - *
    - * @method clear
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.clear = function()
    -{
    -    this.lineWidth = 0;
    -    this.filling = false;
    -
    -    this.dirty = true;
    -    this.clearDirty = true;
    -    this.graphicsData = [];
    -
    -    return this;
    -};
    -
    -/**
    - * Useful function that returns a texture of the graphics object that can then be used to create sprites
    - * This can be quite useful if your geometry is complicated and needs to be reused multiple times.
    - *
    - * @method generateTexture
    - * @param resolution {Number} The resolution of the texture being generated
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @return {Texture} a texture of the graphics object
    - */
    -PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode)
    -{
    -    resolution = resolution || 1;
    -
    -    var bounds = this.getBounds();
    -   
    -    var canvasBuffer = new PIXI.CanvasBuffer(bounds.width * resolution, bounds.height * resolution);
    -    
    -    var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas, scaleMode);
    -    texture.baseTexture.resolution = resolution;
    -
    -    canvasBuffer.context.scale(resolution, resolution);
    -
    -    canvasBuffer.context.translate(-bounds.x,-bounds.y);
    -    
    -    PIXI.CanvasGraphics.renderGraphics(this, canvasBuffer.context);
    -
    -    return texture;
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.Graphics.prototype._renderWebGL = function(renderSession)
    -{
    -    // if the sprite is not visible or the alpha is 0 then no need to render this element
    -    if(this.visible === false || this.alpha === 0 || this.isMask === true)return;
    -
    -    if(this._cacheAsBitmap)
    -    {
    -
    -        if(this.dirty || this.cachedSpriteDirty)
    -        {
    -
    -            this._generateCachedSprite();
    -   
    -            // we will also need to update the texture on the gpu too!
    -            this.updateCachedSpriteTexture();
    -
    -            this.cachedSpriteDirty = false;
    -            this.dirty = false;
    -        }
    -
    -        this._cachedSprite.worldAlpha = this.worldAlpha;
    -        PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession);
    -
    -        return;
    -    }
    -    else
    -    {
    -        renderSession.spriteBatch.stop();
    -        renderSession.blendModeManager.setBlendMode(this.blendMode);
    -
    -        if(this._mask)renderSession.maskManager.pushMask(this._mask, renderSession);
    -        if(this._filters)renderSession.filterManager.pushFilter(this._filterBlock);
    -      
    -        // check blend mode
    -        if(this.blendMode !== renderSession.spriteBatch.currentBlendMode)
    -        {
    -            renderSession.spriteBatch.currentBlendMode = this.blendMode;
    -            var blendModeWebGL = PIXI.blendModesWebGL[renderSession.spriteBatch.currentBlendMode];
    -            renderSession.spriteBatch.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]);
    -        }
    -        
    -        // check if the webgl graphic needs to be updated
    -        if(this.webGLDirty)
    -        {
    -            this.dirty = true;
    -            this.webGLDirty = false;
    -        }
    -        
    -        PIXI.WebGLGraphics.renderGraphics(this, renderSession);
    -        
    -        // only render if it has children!
    -        if(this.children.length)
    -        {
    -            renderSession.spriteBatch.start();
    -
    -             // simple render children!
    -            for(var i=0, j=this.children.length; i<j; i++)
    -            {
    -                this.children[i]._renderWebGL(renderSession);
    -            }
    -
    -            renderSession.spriteBatch.stop();
    -        }
    -
    -        if(this._filters)renderSession.filterManager.popFilter();
    -        if(this._mask)renderSession.maskManager.popMask(this.mask, renderSession);
    -          
    -        renderSession.drawCount++;
    -
    -        renderSession.spriteBatch.start();
    -    }
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.Graphics.prototype._renderCanvas = function(renderSession)
    -{
    -    // if the sprite is not visible or the alpha is 0 then no need to render this element
    -    if(this.visible === false || this.alpha === 0 || this.isMask === true)return;
    -    
    -    if(this._cacheAsBitmap)
    -    {
    -        if(this.dirty || this.cachedSpriteDirty)
    -        {
    -            this._generateCachedSprite();
    -   
    -            // we will also need to update the texture
    -            this.updateCachedSpriteTexture();
    -
    -            this.cachedSpriteDirty = false;
    -            this.dirty = false;
    -        }
    -
    -        this._cachedSprite.alpha = this.alpha;
    -        PIXI.Sprite.prototype._renderCanvas.call(this._cachedSprite, renderSession);
    -
    -        return;
    -    }
    -    else
    -    {
    -        var context = renderSession.context;
    -        var transform = this.worldTransform;
    -        
    -        if(this.blendMode !== renderSession.currentBlendMode)
    -        {
    -            renderSession.currentBlendMode = this.blendMode;
    -            context.globalCompositeOperation = PIXI.blendModesCanvas[renderSession.currentBlendMode];
    -        }
    -
    -        if(this._mask)
    -        {
    -            renderSession.maskManager.pushMask(this._mask, renderSession);
    -        }
    -
    -        var resolution = renderSession.resolution;
    -        context.setTransform(transform.a * resolution,
    -                             transform.b * resolution,
    -                             transform.c * resolution,
    -                             transform.d * resolution,
    -                             transform.tx * resolution,
    -                             transform.ty * resolution);
    -
    -        PIXI.CanvasGraphics.renderGraphics(this, context);
    -
    -         // simple render children!
    -        for(var i=0, j=this.children.length; i<j; i++)
    -        {
    -            this.children[i]._renderCanvas(renderSession);
    -        }
    -
    -        if(this._mask)
    -        {
    -            renderSession.maskManager.popMask(renderSession);
    -        }
    -    }
    -};
    -
    -/**
    - * Retrieves the bounds of the graphic shape as a rectangle object
    - *
    - * @method getBounds
    - * @return {Rectangle} the rectangular bounding area
    - */
    -PIXI.Graphics.prototype.getBounds = function( matrix )
    -{
    -    // return an empty object if the item is a mask!
    -    if(this.isMask)return PIXI.EmptyRectangle;
    -
    -    if(this.dirty)
    -    {
    -        this.updateLocalBounds();
    -        this.webGLDirty = true;
    -        this.cachedSpriteDirty = true;
    -        this.dirty = false;
    -    }
    -
    -    var bounds = this._localBounds;
    -
    -    var w0 = bounds.x;
    -    var w1 = bounds.width + bounds.x;
    -
    -    var h0 = bounds.y;
    -    var h1 = bounds.height + bounds.y;
    -
    -    var worldTransform = matrix || this.worldTransform;
    -
    -    var a = worldTransform.a;
    -    var b = worldTransform.b;
    -    var c = worldTransform.c;
    -    var d = worldTransform.d;
    -    var tx = worldTransform.tx;
    -    var ty = worldTransform.ty;
    -
    -    var x1 = a * w1 + c * h1 + tx;
    -    var y1 = d * h1 + b * w1 + ty;
    -
    -    var x2 = a * w0 + c * h1 + tx;
    -    var y2 = d * h1 + b * w0 + ty;
    -
    -    var x3 = a * w0 + c * h0 + tx;
    -    var y3 = d * h0 + b * w0 + ty;
    -
    -    var x4 =  a * w1 + c * h0 + tx;
    -    var y4 =  d * h0 + b * w1 + ty;
    -
    -    var maxX = x1;
    -    var maxY = y1;
    -
    -    var minX = x1;
    -    var minY = y1;
    -
    -    minX = x2 < minX ? x2 : minX;
    -    minX = x3 < minX ? x3 : minX;
    -    minX = x4 < minX ? x4 : minX;
    -
    -    minY = y2 < minY ? y2 : minY;
    -    minY = y3 < minY ? y3 : minY;
    -    minY = y4 < minY ? y4 : minY;
    -
    -    maxX = x2 > maxX ? x2 : maxX;
    -    maxX = x3 > maxX ? x3 : maxX;
    -    maxX = x4 > maxX ? x4 : maxX;
    -
    -    maxY = y2 > maxY ? y2 : maxY;
    -    maxY = y3 > maxY ? y3 : maxY;
    -    maxY = y4 > maxY ? y4 : maxY;
    -
    -    this._bounds.x = minX;
    -    this._bounds.width = maxX - minX;
    -
    -    this._bounds.y = minY;
    -    this._bounds.height = maxY - minY;
    -
    -    return  this._bounds;
    -};
    -
    -/**
    - * Update the bounds of the object
    - *
    - * @method updateLocalBounds
    - */
    -PIXI.Graphics.prototype.updateLocalBounds = function()
    -{
    -    var minX = Infinity;
    -    var maxX = -Infinity;
    -
    -    var minY = Infinity;
    -    var maxY = -Infinity;
    -
    -    if(this.graphicsData.length)
    -    {
    -        var shape, points, x, y, w, h;
    -
    -        for (var i = 0; i < this.graphicsData.length; i++) {
    -            var data = this.graphicsData[i];
    -            var type = data.type;
    -            var lineWidth = data.lineWidth;
    -            shape = data.shape;
    -           
    -
    -            if(type === PIXI.Graphics.RECT || type === PIXI.Graphics.RREC)
    -            {
    -                x = shape.x - lineWidth/2;
    -                y = shape.y - lineWidth/2;
    -                w = shape.width + lineWidth;
    -                h = shape.height + lineWidth;
    -
    -                minX = x < minX ? x : minX;
    -                maxX = x + w > maxX ? x + w : maxX;
    -
    -                minY = y < minY ? y : minY;
    -                maxY = y + h > maxY ? y + h : maxY;
    -            }
    -            else if(type === PIXI.Graphics.CIRC)
    -            {
    -                x = shape.x;
    -                y = shape.y;
    -                w = shape.radius + lineWidth/2;
    -                h = shape.radius + lineWidth/2;
    -
    -                minX = x - w < minX ? x - w : minX;
    -                maxX = x + w > maxX ? x + w : maxX;
    -
    -                minY = y - h < minY ? y - h : minY;
    -                maxY = y + h > maxY ? y + h : maxY;
    -            }
    -            else if(type === PIXI.Graphics.ELIP)
    -            {
    -                x = shape.x;
    -                y = shape.y;
    -                w = shape.width + lineWidth/2;
    -                h = shape.height + lineWidth/2;
    -
    -                minX = x - w < minX ? x - w : minX;
    -                maxX = x + w > maxX ? x + w : maxX;
    -
    -                minY = y - h < minY ? y - h : minY;
    -                maxY = y + h > maxY ? y + h : maxY;
    -            }
    -            else
    -            {
    -                // POLY
    -                points = shape.points;
    -                
    -                for (var j = 0; j < points.length; j+=2)
    -                {
    -
    -                    x = points[j];
    -                    y = points[j+1];
    -                    minX = x-lineWidth < minX ? x-lineWidth : minX;
    -                    maxX = x+lineWidth > maxX ? x+lineWidth : maxX;
    -
    -                    minY = y-lineWidth < minY ? y-lineWidth : minY;
    -                    maxY = y+lineWidth > maxY ? y+lineWidth : maxY;
    -                }
    -            }
    -        }
    -    }
    -    else
    -    {
    -        minX = 0;
    -        maxX = 0;
    -        minY = 0;
    -        maxY = 0;
    -    }
    -
    -    var padding = this.boundsPadding;
    -    
    -    this._localBounds.x = minX - padding;
    -    this._localBounds.width = (maxX - minX) + padding * 2;
    -
    -    this._localBounds.y = minY - padding;
    -    this._localBounds.height = (maxY - minY) + padding * 2;
    -};
    -
    -/**
    - * Generates the cached sprite when the sprite has cacheAsBitmap = true
    - *
    - * @method _generateCachedSprite
    - * @private
    - */
    -PIXI.Graphics.prototype._generateCachedSprite = function()
    -{
    -    var bounds = this.getLocalBounds();
    -
    -    if(!this._cachedSprite)
    -    {
    -        var canvasBuffer = new PIXI.CanvasBuffer(bounds.width, bounds.height);
    -        var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas);
    -        
    -        this._cachedSprite = new PIXI.Sprite(texture);
    -        this._cachedSprite.buffer = canvasBuffer;
    -
    -        this._cachedSprite.worldTransform = this.worldTransform;
    -    }
    -    else
    -    {
    -        this._cachedSprite.buffer.resize(bounds.width, bounds.height);
    -    }
    -
    -    // leverage the anchor to account for the offset of the element
    -    this._cachedSprite.anchor.x = -( bounds.x / bounds.width );
    -    this._cachedSprite.anchor.y = -( bounds.y / bounds.height );
    -
    -   // this._cachedSprite.buffer.context.save();
    -    this._cachedSprite.buffer.context.translate(-bounds.x,-bounds.y);
    -    
    -    // make sure we set the alpha of the graphics to 1 for the render.. 
    -    this.worldAlpha = 1;
    -
    -    // now render the graphic..
    -    PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context);
    -    this._cachedSprite.alpha = this.alpha;
    -};
    -
    -/**
    - * Updates texture size based on canvas size
    - *
    - * @method updateCachedSpriteTexture
    - * @private
    - */
    -PIXI.Graphics.prototype.updateCachedSpriteTexture = function()
    -{
    -    var cachedSprite = this._cachedSprite;
    -    var texture = cachedSprite.texture;
    -    var canvas = cachedSprite.buffer.canvas;
    -
    -    texture.baseTexture.width = canvas.width;
    -    texture.baseTexture.height = canvas.height;
    -    texture.crop.width = texture.frame.width = canvas.width;
    -    texture.crop.height = texture.frame.height = canvas.height;
    -
    -    cachedSprite._width = canvas.width;
    -    cachedSprite._height = canvas.height;
    -
    -    // update the dirty base textures
    -    texture.baseTexture.dirty();
    -};
    -
    -/**
    - * Destroys a previous cached sprite.
    - *
    - * @method destroyCachedSprite
    - */
    -PIXI.Graphics.prototype.destroyCachedSprite = function()
    -{
    -    this._cachedSprite.texture.destroy(true);
    -
    -    // let the gc collect the unused sprite
    -    // TODO could be object pooled!
    -    this._cachedSprite = null;
    -};
    -
    -/**
    - * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.
    - *
    - * @method drawShape
    - * @param {Circle|Rectangle|Ellipse|Line|Polygon} shape The Shape object to draw.
    - * @return {GraphicsData} The generated GraphicsData object.
    - */
    -PIXI.Graphics.prototype.drawShape = function(shape)
    -{
    -    if(this.currentPath)
    -    {
    -        // check current path!
    -        if(this.currentPath.shape.points.length <= 2)this.graphicsData.pop();
    -    }
    -
    -    this.currentPath = null;
    -
    -    var data = new PIXI.GraphicsData(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, shape);
    -    
    -    this.graphicsData.push(data);
    -    
    -    if(data.type === PIXI.Graphics.POLY)
    -    {
    -        data.shape.closed = this.filling;
    -        this.currentPath = data;
    -    }
    -
    -    this.dirty = true;
    -
    -    return data;
    -};
    -
    -/**
    - * A GraphicsData object.
    - * 
    - * @class GraphicsData
    - * @constructor
    - */
    -PIXI.GraphicsData = function(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, shape)
    -{
    -    this.lineWidth = lineWidth;
    -    this.lineColor = lineColor;
    -    this.lineAlpha = lineAlpha;
    -
    -    this.fillColor = fillColor;
    -    this.fillAlpha = fillAlpha;
    -    this.fill = fill;
    -
    -    this.shape = shape;
    -    this.type = shape.type;
    -};
    -
    -// SOME TYPES:
    -PIXI.Graphics.POLY = 0;
    -PIXI.Graphics.RECT = 1;
    -PIXI.Graphics.CIRC = 2;
    -PIXI.Graphics.ELIP = 3;
    -PIXI.Graphics.RREC = 4;
    -
    -PIXI.Polygon.prototype.type = PIXI.Graphics.POLY;
    -PIXI.Rectangle.prototype.type = PIXI.Graphics.RECT;
    -PIXI.Circle.prototype.type = PIXI.Graphics.CIRC;
    -PIXI.Ellipse.prototype.type = PIXI.Graphics.ELIP;
    -PIXI.RoundedRectangle.prototype.type = PIXI.Graphics.RREC;
    -
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasGraphics.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasGraphics.js.html deleted file mode 100755 index 61eb8da..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasGraphics.js.html +++ /dev/null @@ -1,579 +0,0 @@ - - - - - src/pixi/renderers/canvas/CanvasGraphics.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/canvas/CanvasGraphics.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -
    -/**
    - * A set of functions used by the canvas renderer to draw the primitive graphics data.
    - *
    - * @class CanvasGraphics
    - * @static
    - */
    -PIXI.CanvasGraphics = function()
    -{
    -};
    -
    -/*
    - * Renders a PIXI.Graphics object to a canvas.
    - *
    - * @method renderGraphics
    - * @static
    - * @param graphics {Graphics} the actual graphics object to render
    - * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas
    - */
    -PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
    -{
    -    var worldAlpha = graphics.worldAlpha;
    -    var color = '';
    -
    -    for (var i = 0; i < graphics.graphicsData.length; i++)
    -    {
    -        var data = graphics.graphicsData[i];
    -        var shape = data.shape;
    -
    -        context.strokeStyle = color = '#' + ('00000' + ( data.lineColor | 0).toString(16)).substr(-6);
    -
    -        context.lineWidth = data.lineWidth;
    -
    -        if(data.type === PIXI.Graphics.POLY)
    -        {
    -            context.beginPath();
    -
    -            var points = shape.points;
    -
    -            context.moveTo(points[0], points[1]);
    -
    -            for (var j=1; j < points.length/2; j++)
    -            {
    -                context.lineTo(points[j * 2], points[j * 2 + 1]);
    -            }
    -
    -            if(shape.closed)
    -            {
    -                context.lineTo(points[0], points[1]);
    -            }
    -
    -            // if the first and last point are the same close the path - much neater :)
    -            if(points[0] === points[points.length-2] && points[1] === points[points.length-1])
    -            {
    -                context.closePath();
    -            }
    -
    -            if(data.fill)
    -            {
    -                context.globalAlpha = data.fillAlpha * worldAlpha;
    -                context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
    -                context.fill();
    -            }
    -            if(data.lineWidth)
    -            {
    -                context.globalAlpha = data.lineAlpha * worldAlpha;
    -                context.stroke();
    -            }
    -        }
    -        else if(data.type === PIXI.Graphics.RECT)
    -        {
    -
    -            if(data.fillColor || data.fillColor === 0)
    -            {
    -                context.globalAlpha = data.fillAlpha * worldAlpha;
    -                context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
    -                context.fillRect(shape.x, shape.y, shape.width, shape.height);
    -
    -            }
    -            if(data.lineWidth)
    -            {
    -                context.globalAlpha = data.lineAlpha * worldAlpha;
    -                context.strokeRect(shape.x, shape.y, shape.width, shape.height);
    -            }
    -        }
    -        else if(data.type === PIXI.Graphics.CIRC)
    -        {
    -            // TODO - need to be Undefined!
    -            context.beginPath();
    -            context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI);
    -            context.closePath();
    -
    -            if(data.fill)
    -            {
    -                context.globalAlpha = data.fillAlpha * worldAlpha;
    -                context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
    -                context.fill();
    -            }
    -            if(data.lineWidth)
    -            {
    -                context.globalAlpha = data.lineAlpha * worldAlpha;
    -                context.stroke();
    -            }
    -        }
    -        else if(data.type === PIXI.Graphics.ELIP)
    -        {
    -            // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas
    -
    -            var w = shape.width * 2;
    -            var h = shape.height * 2;
    -
    -            var x = shape.x - w/2;
    -            var y = shape.y - h/2;
    -
    -            context.beginPath();
    -
    -            var kappa = 0.5522848,
    -                ox = (w / 2) * kappa, // control point offset horizontal
    -                oy = (h / 2) * kappa, // control point offset vertical
    -                xe = x + w,           // x-end
    -                ye = y + h,           // y-end
    -                xm = x + w / 2,       // x-middle
    -                ym = y + h / 2;       // y-middle
    -
    -            context.moveTo(x, ym);
    -            context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
    -            context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
    -            context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
    -            context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
    -
    -            context.closePath();
    -
    -            if(data.fill)
    -            {
    -                context.globalAlpha = data.fillAlpha * worldAlpha;
    -                context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
    -                context.fill();
    -            }
    -            if(data.lineWidth)
    -            {
    -                context.globalAlpha = data.lineAlpha * worldAlpha;
    -                context.stroke();
    -            }
    -        }
    -        else if (data.type === PIXI.Graphics.RREC)
    -        {
    -            var rx = shape.x;
    -            var ry = shape.y;
    -            var width = shape.width;
    -            var height = shape.height;
    -            var radius = shape.radius;
    -
    -            var maxRadius = Math.min(width, height) / 2 | 0;
    -            radius = radius > maxRadius ? maxRadius : radius;
    -
    -            context.beginPath();
    -            context.moveTo(rx, ry + radius);
    -            context.lineTo(rx, ry + height - radius);
    -            context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height);
    -            context.lineTo(rx + width - radius, ry + height);
    -            context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius);
    -            context.lineTo(rx + width, ry + radius);
    -            context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry);
    -            context.lineTo(rx + radius, ry);
    -            context.quadraticCurveTo(rx, ry, rx, ry + radius);
    -            context.closePath();
    -
    -            if(data.fillColor || data.fillColor === 0)
    -            {
    -                context.globalAlpha = data.fillAlpha * worldAlpha;
    -                context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
    -                context.fill();
    -
    -            }
    -            if(data.lineWidth)
    -            {
    -                context.globalAlpha = data.lineAlpha * worldAlpha;
    -                context.stroke();
    -            }
    -        }
    -    }
    -};
    -
    -/*
    - * Renders a graphics mask
    - *
    - * @static
    - * @private
    - * @method renderGraphicsMask
    - * @param graphics {Graphics} the graphics which will be used as a mask
    - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas
    - */
    -PIXI.CanvasGraphics.renderGraphicsMask = function(graphics, context)
    -{
    -    var len = graphics.graphicsData.length;
    -
    -    if(len === 0) return;
    -
    -    if(len > 1)
    -    {
    -        len = 1;
    -        window.console.log('Pixi.js warning: masks in canvas can only mask using the first path in the graphics object');
    -    }
    -
    -    for (var i = 0; i < 1; i++)
    -    {
    -        var data = graphics.graphicsData[i];
    -        var shape = data.shape;
    -
    -        if(data.type === PIXI.Graphics.POLY)
    -        {
    -            context.beginPath();
    -        
    -            var points = shape.points;
    -        
    -            context.moveTo(points[0], points[1]);
    -
    -            for (var j=1; j < points.length/2; j++)
    -            {
    -                context.lineTo(points[j * 2], points[j * 2 + 1]);
    -            }
    -
    -            // if the first and last point are the same close the path - much neater :)
    -            if(points[0] === points[points.length-2] && points[1] === points[points.length-1])
    -            {
    -                context.closePath();
    -            }
    -
    -        }
    -        else if(data.type === PIXI.Graphics.RECT)
    -        {
    -            context.beginPath();
    -            context.rect(shape.x, shape.y, shape.width, shape.height);
    -            context.closePath();
    -        }
    -        else if(data.type === PIXI.Graphics.CIRC)
    -        {
    -            // TODO - need to be Undefined!
    -            context.beginPath();
    -            context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI);
    -            context.closePath();
    -        }
    -        else if(data.type === PIXI.Graphics.ELIP)
    -        {
    -
    -            // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas
    -
    -            var w = shape.width * 2;
    -            var h = shape.height * 2;
    -
    -            var x = shape.x - w/2;
    -            var y = shape.y - h/2;
    -
    -            context.beginPath();
    -
    -            var kappa = 0.5522848,
    -                ox = (w / 2) * kappa, // control point offset horizontal
    -                oy = (h / 2) * kappa, // control point offset vertical
    -                xe = x + w,           // x-end
    -                ye = y + h,           // y-end
    -                xm = x + w / 2,       // x-middle
    -                ym = y + h / 2;       // y-middle
    -
    -            context.moveTo(x, ym);
    -            context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
    -            context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
    -            context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
    -            context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
    -            context.closePath();
    -        }
    -        else if (data.type === PIXI.Graphics.RREC)
    -        {
    -        
    -            var pts = shape.points;
    -            var rx = pts[0];
    -            var ry = pts[1];
    -            var width = pts[2];
    -            var height = pts[3];
    -            var radius = pts[4];
    -
    -            var maxRadius = Math.min(width, height) / 2 | 0;
    -            radius = radius > maxRadius ? maxRadius : radius;
    -
    -            context.beginPath();
    -            context.moveTo(rx, ry + radius);
    -            context.lineTo(rx, ry + height - radius);
    -            context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height);
    -            context.lineTo(rx + width - radius, ry + height);
    -            context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius);
    -            context.lineTo(rx + width, ry + radius);
    -            context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry);
    -            context.lineTo(rx + radius, ry);
    -            context.quadraticCurveTo(rx, ry, rx, ry + radius);
    -            context.closePath();
    -        }
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasRenderer.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasRenderer.js.html deleted file mode 100755 index 0cc3085..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasRenderer.js.html +++ /dev/null @@ -1,623 +0,0 @@ - - - - - src/pixi/renderers/canvas/CanvasRenderer.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/canvas/CanvasRenderer.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The CanvasRenderer draws the Stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    - * Don't forget to add the CanvasRenderer.view to your DOM or you will not see anything :)
    - *
    - * @class CanvasRenderer
    - * @constructor
    - * @param [width=800] {Number} the width of the canvas view
    - * @param [height=600] {Number} the height of the canvas view
    - * @param [options] {Object} The optional renderer parameters
    - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional
    - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false
    - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false
    - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2
    - * @param [options.clearBeforeRender=true] {Boolean} This sets if the CanvasRenderer will clear the canvas or not before the new render pass.
    - */
    -PIXI.CanvasRenderer = function(width, height, options)
    -{
    -    if(options)
    -    {
    -        for (var i in PIXI.defaultRenderOptions)
    -        {
    -            if (typeof options[i] === "undefined") options[i] = PIXI.defaultRenderOptions[i];
    -        }
    -    }
    -    else
    -    {
    -        options = PIXI.defaultRenderOptions;
    -    }
    -
    -    if(!PIXI.defaultRenderer)
    -    {
    -        PIXI.sayHello("Canvas");
    -        PIXI.defaultRenderer = this;
    -    }
    -
    -    /**
    -     * The renderer type.
    -     *
    -     * @property type
    -     * @type Number
    -     */
    -    this.type = PIXI.CANVAS_RENDERER;
    -
    -    /**
    -     * The resolution of the canvas.
    -     *
    -     * @property resolution
    -     * @type Number
    -     */
    -    this.resolution = options.resolution;
    -
    -    /**
    -     * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.
    -     * If the Stage is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.
    -     * If the Stage is transparent Pixi will use clearRect to clear the canvas every frame.
    -     * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.
    -     *
    -     * @property clearBeforeRender
    -     * @type Boolean
    -     * @default
    -     */
    -    this.clearBeforeRender = options.clearBeforeRender;
    -
    -    /**
    -     * Whether the render view is transparent
    -     *
    -     * @property transparent
    -     * @type Boolean
    -     */
    -    this.transparent = options.transparent;
    -
    -    /**
    -     * Whether the render view should be resized automatically
    -     *
    -     * @property autoResize
    -     * @type Boolean
    -     */
    -    this.autoResize = options.autoResize || false;
    -
    -
    -    /**
    -     * The width of the canvas view
    -     *
    -     * @property width
    -     * @type Number
    -     * @default 800
    -     */
    -    this.width = width || 800;
    -
    -    /**
    -     * The height of the canvas view
    -     *
    -     * @property height
    -     * @type Number
    -     * @default 600
    -     */
    -    this.height = height || 600;
    -
    -    this.width *= this.resolution;
    -    this.height *= this.resolution;
    -
    -    /**
    -     * The canvas element that everything is drawn to.
    -     *
    -     * @property view
    -     * @type HTMLCanvasElement
    -     */
    -    this.view = options.view || document.createElement( "canvas" );
    -
    -    /**
    -     * The canvas 2d context that everything is drawn with
    -     * @property context
    -     * @type CanvasRenderingContext2D
    -     */
    -    this.context = this.view.getContext( "2d", { alpha: this.transparent } );
    -
    -    /**
    -     * Boolean flag controlling canvas refresh.
    -     *
    -     * @property refresh
    -     * @type Boolean
    -     */
    -    this.refresh = true;
    -
    -    this.view.width = this.width * this.resolution;
    -    this.view.height = this.height * this.resolution;
    -
    -    /**
    -     * Internal var.
    -     *
    -     * @property count
    -     * @type Number
    -     */
    -    this.count = 0;
    -
    -    /**
    -     * Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer
    -     * @property CanvasMaskManager
    -     * @type CanvasMaskManager
    -     */
    -    this.maskManager = new PIXI.CanvasMaskManager();
    -
    -    /**
    -     * The render session is just a bunch of parameter used for rendering
    -     * @property renderSession
    -     * @type Object
    -     */
    -    this.renderSession = {
    -        context: this.context,
    -        maskManager: this.maskManager,
    -        scaleMode: null,
    -        smoothProperty: null,
    -        /**
    -         * If true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation.
    -         * Handy for crisp pixel art and speed on legacy devices.
    -         *
    -         */
    -        roundPixels: false
    -    };
    -
    -    this.mapBlendModes();
    -    
    -    this.resize(width, height);
    -
    -    if("imageSmoothingEnabled" in this.context)
    -        this.renderSession.smoothProperty = "imageSmoothingEnabled";
    -    else if("webkitImageSmoothingEnabled" in this.context)
    -        this.renderSession.smoothProperty = "webkitImageSmoothingEnabled";
    -    else if("mozImageSmoothingEnabled" in this.context)
    -        this.renderSession.smoothProperty = "mozImageSmoothingEnabled";
    -    else if("oImageSmoothingEnabled" in this.context)
    -        this.renderSession.smoothProperty = "oImageSmoothingEnabled";
    -    else if ("msImageSmoothingEnabled" in this.context)
    -        this.renderSession.smoothProperty = "msImageSmoothingEnabled";
    -};
    -
    -// constructor
    -PIXI.CanvasRenderer.prototype.constructor = PIXI.CanvasRenderer;
    -
    -/**
    - * Renders the Stage to this canvas view
    - *
    - * @method render
    - * @param stage {Stage} the Stage element to be rendered
    - */
    -PIXI.CanvasRenderer.prototype.render = function(stage)
    -{
    -    stage.updateTransform();
    -
    -    this.context.setTransform(1,0,0,1,0,0);
    -
    -    this.context.globalAlpha = 1;
    -
    -    this.renderSession.currentBlendMode = PIXI.blendModes.NORMAL;
    -    this.context.globalCompositeOperation = PIXI.blendModesCanvas[PIXI.blendModes.NORMAL];
    -
    -    if (navigator.isCocoonJS && this.view.screencanvas) {
    -        this.context.fillStyle = "black";
    -        this.context.clear();
    -    }
    -    
    -    if (this.clearBeforeRender)
    -    {
    -        if (this.transparent)
    -        {
    -            this.context.clearRect(0, 0, this.width, this.height);
    -        }
    -        else
    -        {
    -            this.context.fillStyle = stage.backgroundColorString;
    -            this.context.fillRect(0, 0, this.width , this.height);
    -        }
    -    }
    -    
    -    this.renderDisplayObject(stage);
    -
    -    // run interaction!
    -    if(stage.interactive)
    -    {
    -        //need to add some events!
    -        if(!stage._interactiveEventsAdded)
    -        {
    -            stage._interactiveEventsAdded = true;
    -            stage.interactionManager.setTarget(this);
    -        }
    -    }
    -};
    -
    -/**
    - * Removes everything from the renderer and optionally removes the Canvas DOM element.
    - *
    - * @method destroy
    - * @param [removeView=true] {boolean} Removes the Canvas element from the DOM.
    - */
    -PIXI.CanvasRenderer.prototype.destroy = function(removeView)
    -{
    -    if (typeof removeView === "undefined") { removeView = true; }
    -
    -    if (removeView && this.view.parent)
    -    {
    -        this.view.parent.removeChild(this.view);
    -    }
    -
    -    this.view = null;
    -    this.context = null;
    -    this.maskManager = null;
    -    this.renderSession = null;
    -
    -};
    -
    -/**
    - * Resizes the canvas view to the specified width and height
    - *
    - * @method resize
    - * @param width {Number} the new width of the canvas view
    - * @param height {Number} the new height of the canvas view
    - */
    -PIXI.CanvasRenderer.prototype.resize = function(width, height)
    -{
    -    this.width = width * this.resolution;
    -    this.height = height * this.resolution;
    -
    -    this.view.width = this.width;
    -    this.view.height = this.height;
    -
    -    if (this.autoResize) {
    -        this.view.style.width = this.width / this.resolution + "px";
    -        this.view.style.height = this.height / this.resolution + "px";
    -    }
    -};
    -
    -/**
    - * Renders a display object
    - *
    - * @method renderDisplayObject
    - * @param displayObject {DisplayObject} The displayObject to render
    - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas
    - * @private
    - */
    -PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject, context)
    -{
    -    this.renderSession.context = context || this.context;
    -    this.renderSession.resolution = this.resolution;
    -    displayObject._renderCanvas(this.renderSession);
    -};
    -
    -/**
    - * Maps Pixi blend modes to canvas blend modes.
    - *
    - * @method mapBlendModes
    - * @private
    - */
    -PIXI.CanvasRenderer.prototype.mapBlendModes = function()
    -{
    -    if(!PIXI.blendModesCanvas)
    -    {
    -        PIXI.blendModesCanvas = [];
    -
    -        if(PIXI.canUseNewCanvasBlendModes())
    -        {
    -            PIXI.blendModesCanvas[PIXI.blendModes.NORMAL]   = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.ADD]      = "lighter"; //IS THIS OK???
    -            PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "multiply";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SCREEN]   = "screen";
    -            PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY]  = "overlay";
    -            PIXI.blendModesCanvas[PIXI.blendModes.DARKEN]   = "darken";
    -            PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN]  = "lighten";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "color-dodge";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "color-burn";
    -            PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "hard-light";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "soft-light";
    -            PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "difference";
    -            PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "exclusion";
    -            PIXI.blendModesCanvas[PIXI.blendModes.HUE]       = "hue";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "saturation";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR]      = "color";
    -            PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "luminosity";
    -        }
    -        else
    -        {
    -            // this means that the browser does not support the cool new blend modes in canvas "cough" ie "cough"
    -            PIXI.blendModesCanvas[PIXI.blendModes.NORMAL]   = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.ADD]      = "lighter"; //IS THIS OK???
    -            PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SCREEN]   = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY]  = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.DARKEN]   = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN]  = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.HUE]       = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR]      = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "source-over";
    -        }
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasBuffer.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasBuffer.js.html deleted file mode 100755 index 1705871..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasBuffer.js.html +++ /dev/null @@ -1,354 +0,0 @@ - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/canvas/utils/CanvasBuffer.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * Creates a Canvas element of the given size.
    - *
    - * @class CanvasBuffer
    - * @constructor
    - * @param width {Number} the width for the newly created canvas
    - * @param height {Number} the height for the newly created canvas
    - */
    -PIXI.CanvasBuffer = function(width, height)
    -{
    -    /**
    -     * The width of the Canvas in pixels.
    -     *
    -     * @property width
    -     * @type Number
    -     */
    -    this.width = width;
    -
    -    /**
    -     * The height of the Canvas in pixels.
    -     *
    -     * @property height
    -     * @type Number
    -     */
    -    this.height = height;
    -
    -    /**
    -     * The Canvas object that belongs to this CanvasBuffer.
    -     *
    -     * @property canvas
    -     * @type HTMLCanvasElement
    -     */
    -    this.canvas = document.createElement("canvas");
    -
    -    /**
    -     * A CanvasRenderingContext2D object representing a two-dimensional rendering context.
    -     *
    -     * @property context
    -     * @type CanvasRenderingContext2D
    -     */
    -    this.context = this.canvas.getContext("2d");
    -
    -    this.canvas.width = width;
    -    this.canvas.height = height;
    -};
    -
    -PIXI.CanvasBuffer.prototype.constructor = PIXI.CanvasBuffer;
    -
    -/**
    - * Clears the canvas that was created by the CanvasBuffer class.
    - *
    - * @method clear
    - * @private
    - */
    -PIXI.CanvasBuffer.prototype.clear = function()
    -{
    -    this.context.setTransform(1, 0, 0, 1, 0, 0);
    -    this.context.clearRect(0,0, this.width, this.height);
    -};
    -
    -/**
    - * Resizes the canvas to the specified width and height.
    - *
    - * @method resize
    - * @param width {Number} the new width of the canvas
    - * @param height {Number} the new height of the canvas
    - */
    -PIXI.CanvasBuffer.prototype.resize = function(width, height)
    -{
    -    this.width = this.canvas.width = width;
    -    this.height = this.canvas.height = height;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasMaskManager.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasMaskManager.js.html deleted file mode 100755 index a4c4114..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasMaskManager.js.html +++ /dev/null @@ -1,336 +0,0 @@ - - - - - src/pixi/renderers/canvas/utils/CanvasMaskManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/canvas/utils/CanvasMaskManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A set of functions used to handle masking.
    - *
    - * @class CanvasMaskManager
    - * @constructor
    - */
    -PIXI.CanvasMaskManager = function()
    -{
    -};
    -
    -PIXI.CanvasMaskManager.prototype.constructor = PIXI.CanvasMaskManager;
    -
    -/**
    - * This method adds it to the current stack of masks.
    - *
    - * @method pushMask
    - * @param maskData {Object} the maskData that will be pushed
    - * @param renderSession {Object} The renderSession whose context will be used for this mask manager.
    - */
    -PIXI.CanvasMaskManager.prototype.pushMask = function(maskData, renderSession)
    -{
    -	var context = renderSession.context;
    -
    -    context.save();
    -    
    -    var cacheAlpha = maskData.alpha;
    -    var transform = maskData.worldTransform;
    -
    -    var resolution = renderSession.resolution;
    -
    -    context.setTransform(transform.a * resolution,
    -                         transform.b * resolution,
    -                         transform.c * resolution,
    -                         transform.d * resolution,
    -                         transform.tx * resolution,
    -                         transform.ty * resolution);
    -
    -    PIXI.CanvasGraphics.renderGraphicsMask(maskData, context);
    -
    -    context.clip();
    -
    -    maskData.worldAlpha = cacheAlpha;
    -};
    -
    -/**
    - * Restores the current drawing context to the state it was before the mask was applied.
    - *
    - * @method popMask
    - * @param renderSession {Object} The renderSession whose context will be used for this mask manager.
    - */
    -PIXI.CanvasMaskManager.prototype.popMask = function(renderSession)
    -{
    -    renderSession.context.restore();
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasTinter.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasTinter.js.html deleted file mode 100755 index 679a98c..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasTinter.js.html +++ /dev/null @@ -1,510 +0,0 @@ - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/canvas/utils/CanvasTinter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * @class CanvasTinter
    - * @constructor
    - * @static
    - */
    -PIXI.CanvasTinter = function()
    -{
    -};
    -
    -/**
    - * Basically this method just needs a sprite and a color and tints the sprite with the given color.
    - * 
    - * @method getTintedTexture 
    - * @param sprite {Sprite} the sprite to tint
    - * @param color {Number} the color to use to tint the sprite with
    - * @return {HTMLCanvasElement} The tinted canvas
    - */
    -PIXI.CanvasTinter.getTintedTexture = function(sprite, color)
    -{
    -    var texture = sprite.texture;
    -
    -    color = PIXI.CanvasTinter.roundColor(color);
    -
    -    var stringColor = "#" + ("00000" + ( color | 0).toString(16)).substr(-6);
    -   
    -    texture.tintCache = texture.tintCache || {};
    -
    -    if(texture.tintCache[stringColor]) return texture.tintCache[stringColor];
    -
    -     // clone texture..
    -    var canvas = PIXI.CanvasTinter.canvas || document.createElement("canvas");
    -    
    -    //PIXI.CanvasTinter.tintWithPerPixel(texture, stringColor, canvas);
    -    PIXI.CanvasTinter.tintMethod(texture, color, canvas);
    -
    -    if(PIXI.CanvasTinter.convertTintToImage)
    -    {
    -        // is this better?
    -        var tintImage = new Image();
    -        tintImage.src = canvas.toDataURL();
    -
    -        texture.tintCache[stringColor] = tintImage;
    -    }
    -    else
    -    {
    -        texture.tintCache[stringColor] = canvas;
    -        // if we are not converting the texture to an image then we need to lose the reference to the canvas
    -        PIXI.CanvasTinter.canvas = null;
    -    }
    -
    -    return canvas;
    -};
    -
    -/**
    - * Tint a texture using the "multiply" operation.
    - * 
    - * @method tintWithMultiply
    - * @param texture {Texture} the texture to tint
    - * @param color {Number} the color to use to tint the sprite with
    - * @param canvas {HTMLCanvasElement} the current canvas
    - */
    -PIXI.CanvasTinter.tintWithMultiply = function(texture, color, canvas)
    -{
    -    var context = canvas.getContext( "2d" );
    -
    -    var crop = texture.crop;
    -
    -    canvas.width = crop.width;
    -    canvas.height = crop.height;
    -
    -    context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6);
    -    
    -    context.fillRect(0, 0, crop.width, crop.height);
    -    
    -    context.globalCompositeOperation = "multiply";
    -
    -    context.drawImage(texture.baseTexture.source,
    -                           crop.x,
    -                           crop.y,
    -                           crop.width,
    -                           crop.height,
    -                           0,
    -                           0,
    -                           crop.width,
    -                           crop.height);
    -
    -    context.globalCompositeOperation = "destination-atop";
    -
    -    context.drawImage(texture.baseTexture.source,
    -                           crop.x,
    -                           crop.y,
    -                           crop.width,
    -                           crop.height,
    -                           0,
    -                           0,
    -                           crop.width,
    -                           crop.height);
    -};
    -
    -/**
    - * Tint a texture using the "overlay" operation.
    - * 
    - * @method tintWithOverlay
    - * @param texture {Texture} the texture to tint
    - * @param color {Number} the color to use to tint the sprite with
    - * @param canvas {HTMLCanvasElement} the current canvas
    - */
    -PIXI.CanvasTinter.tintWithOverlay = function(texture, color, canvas)
    -{
    -    var context = canvas.getContext( "2d" );
    -
    -    var crop = texture.crop;
    -
    -    canvas.width = crop.width;
    -    canvas.height = crop.height;
    -    
    -    context.globalCompositeOperation = "copy";
    -    context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6);
    -    context.fillRect(0, 0, crop.width, crop.height);
    -
    -    context.globalCompositeOperation = "destination-atop";
    -    context.drawImage(texture.baseTexture.source,
    -                           crop.x,
    -                           crop.y,
    -                           crop.width,
    -                           crop.height,
    -                           0,
    -                           0,
    -                           crop.width,
    -                           crop.height);
    -    
    -    //context.globalCompositeOperation = "copy";
    -};
    -
    -/**
    - * Tint a texture pixel per pixel.
    - * 
    - * @method tintPerPixel
    - * @param texture {Texture} the texture to tint
    - * @param color {Number} the color to use to tint the sprite with
    - * @param canvas {HTMLCanvasElement} the current canvas
    - */
    -PIXI.CanvasTinter.tintWithPerPixel = function(texture, color, canvas)
    -{
    -    var context = canvas.getContext( "2d" );
    -
    -    var crop = texture.crop;
    -
    -    canvas.width = crop.width;
    -    canvas.height = crop.height;
    -  
    -    context.globalCompositeOperation = "copy";
    -    context.drawImage(texture.baseTexture.source,
    -                           crop.x,
    -                           crop.y,
    -                           crop.width,
    -                           crop.height,
    -                           0,
    -                           0,
    -                           crop.width,
    -                           crop.height);
    -
    -    var rgbValues = PIXI.hex2rgb(color);
    -    var r = rgbValues[0], g = rgbValues[1], b = rgbValues[2];
    -
    -    var pixelData = context.getImageData(0, 0, crop.width, crop.height);
    -
    -    var pixels = pixelData.data;
    -
    -    for (var i = 0; i < pixels.length; i += 4)
    -    {
    -        pixels[i+0] *= r;
    -        pixels[i+1] *= g;
    -        pixels[i+2] *= b;
    -    }
    -
    -    context.putImageData(pixelData, 0, 0);
    -};
    -
    -/**
    - * Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel.
    - * 
    - * @method roundColor
    - * @param color {number} the color to round, should be a hex color
    - */
    -PIXI.CanvasTinter.roundColor = function(color)
    -{
    -    var step = PIXI.CanvasTinter.cacheStepsPerColorChannel;
    -
    -    var rgbValues = PIXI.hex2rgb(color);
    -
    -    rgbValues[0] = Math.min(255, (rgbValues[0] / step) * step);
    -    rgbValues[1] = Math.min(255, (rgbValues[1] / step) * step);
    -    rgbValues[2] = Math.min(255, (rgbValues[2] / step) * step);
    -
    -    return PIXI.rgb2hex(rgbValues);
    -};
    -
    -/**
    - * Number of steps which will be used as a cap when rounding colors.
    - *
    - * @property cacheStepsPerColorChannel
    - * @type Number
    - */
    -PIXI.CanvasTinter.cacheStepsPerColorChannel = 8;
    -
    -/**
    - * Tint cache boolean flag.
    - *
    - * @property convertTintToImage
    - * @type Boolean
    - */
    -PIXI.CanvasTinter.convertTintToImage = false;
    -
    -/**
    - * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method.
    - *
    - * @property canUseMultiply
    - * @type Boolean
    - */
    -PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes();
    -
    -/**
    - * The tinting method that will be used.
    - * 
    - * @method tintMethod
    - */
    -PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply :  PIXI.CanvasTinter.tintWithPerPixel;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_WebGLRenderer.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_WebGLRenderer.js.html deleted file mode 100755 index 5fb7452..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_WebGLRenderer.js.html +++ /dev/null @@ -1,820 +0,0 @@ - - - - - src/pixi/renderers/webgl/WebGLRenderer.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/WebGLRenderer.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -PIXI.glContexts = []; // this is where we store the webGL contexts for easy access.
    -PIXI.instances = [];
    -
    -/**
    - * The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer
    - * should be used for browsers that support webGL. This Render works by automatically managing webGLBatchs.
    - * So no need for Sprite Batches or Sprite Clouds.
    - * Don't forget to add the view to your DOM or you will not see anything :)
    - *
    - * @class WebGLRenderer
    - * @constructor
    - * @param [width=0] {Number} the width of the canvas view
    - * @param [height=0] {Number} the height of the canvas view
    - * @param [options] {Object} The optional renderer parameters
    - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional
    - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false
    - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false
    - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment)
    - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context
    - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2
    - */
    -PIXI.WebGLRenderer = function(width, height, options)
    -{
    -    if(options)
    -    {
    -        for (var i in PIXI.defaultRenderOptions)
    -        {
    -            if (typeof options[i] === 'undefined') options[i] = PIXI.defaultRenderOptions[i];
    -        }
    -    }
    -    else
    -    {
    -        options = PIXI.defaultRenderOptions;
    -    }
    -
    -    if(!PIXI.defaultRenderer)
    -    {
    -        PIXI.sayHello('webGL');
    -        PIXI.defaultRenderer = this;
    -    }
    -
    -    /**
    -     * @property type
    -     * @type Number
    -     */
    -    this.type = PIXI.WEBGL_RENDERER;
    -
    -    /**
    -     * The resolution of the renderer
    -     *
    -     * @property resolution
    -     * @type Number
    -     * @default 1
    -     */
    -    this.resolution = options.resolution;
    -
    -    // do a catch.. only 1 webGL renderer..
    -
    -    /**
    -     * Whether the render view is transparent
    -     *
    -     * @property transparent
    -     * @type Boolean
    -     */
    -    this.transparent = options.transparent;
    -
    -    /**
    -     * Whether the render view should be resized automatically
    -     *
    -     * @property autoResize
    -     * @type Boolean
    -     */
    -    this.autoResize = options.autoResize || false;
    -
    -    /**
    -     * The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering.
    -     *
    -     * @property preserveDrawingBuffer
    -     * @type Boolean
    -     */
    -    this.preserveDrawingBuffer = options.preserveDrawingBuffer;
    -
    -    /**
    -     * This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true:
    -     * If the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0).
    -     * If the Stage is transparent, Pixi will clear to the target Stage's background color.
    -     * Disable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set.
    -     *
    -     * @property clearBeforeRender
    -     * @type Boolean
    -     * @default
    -     */
    -    this.clearBeforeRender = options.clearBeforeRender;
    -
    -    /**
    -     * The width of the canvas view
    -     *
    -     * @property width
    -     * @type Number
    -     * @default 800
    -     */
    -    this.width = width || 800;
    -
    -    /**
    -     * The height of the canvas view
    -     *
    -     * @property height
    -     * @type Number
    -     * @default 600
    -     */
    -    this.height = height || 600;
    -
    -    /**
    -     * The canvas element that everything is drawn to
    -     *
    -     * @property view
    -     * @type HTMLCanvasElement
    -     */
    -    this.view = options.view || document.createElement( 'canvas' );
    -
    -    // deal with losing context..
    -
    -    /**
    -     * @property contextLostBound
    -     * @type Function
    -     */
    -    this.contextLostBound = this.handleContextLost.bind(this);
    -
    -    /**
    -     * @property contextRestoredBound
    -     * @type Function
    -     */
    -    this.contextRestoredBound = this.handleContextRestored.bind(this);
    -
    -    this.view.addEventListener('webglcontextlost', this.contextLostBound, false);
    -    this.view.addEventListener('webglcontextrestored', this.contextRestoredBound, false);
    -
    -    /**
    -     * @property _contextOptions
    -     * @type Object
    -     * @private
    -     */
    -    this._contextOptions = {
    -        alpha: this.transparent,
    -        antialias: options.antialias, // SPEED UP??
    -        premultipliedAlpha:this.transparent && this.transparent !== 'notMultiplied',
    -        stencil:true,
    -        preserveDrawingBuffer: options.preserveDrawingBuffer
    -    };
    -
    -    /**
    -     * @property projection
    -     * @type Point
    -     */
    -    this.projection = new PIXI.Point();
    -
    -    /**
    -     * @property offset
    -     * @type Point
    -     */
    -    this.offset = new PIXI.Point(0, 0);
    -
    -    // time to create the render managers! each one focuses on managing a state in webGL
    -
    -    /**
    -     * Deals with managing the shader programs and their attribs
    -     * @property shaderManager
    -     * @type WebGLShaderManager
    -     */
    -    this.shaderManager = new PIXI.WebGLShaderManager();
    -
    -    /**
    -     * Manages the rendering of sprites
    -     * @property spriteBatch
    -     * @type WebGLSpriteBatch
    -     */
    -    this.spriteBatch = new PIXI.WebGLSpriteBatch();
    -
    -    /**
    -     * Manages the masks using the stencil buffer
    -     * @property maskManager
    -     * @type WebGLMaskManager
    -     */
    -    this.maskManager = new PIXI.WebGLMaskManager();
    -
    -    /**
    -     * Manages the filters
    -     * @property filterManager
    -     * @type WebGLFilterManager
    -     */
    -    this.filterManager = new PIXI.WebGLFilterManager();
    -
    -    /**
    -     * Manages the stencil buffer
    -     * @property stencilManager
    -     * @type WebGLStencilManager
    -     */
    -    this.stencilManager = new PIXI.WebGLStencilManager();
    -
    -    /**
    -     * Manages the blendModes
    -     * @property blendModeManager
    -     * @type WebGLBlendModeManager
    -     */
    -    this.blendModeManager = new PIXI.WebGLBlendModeManager();
    -
    -    /**
    -     * TODO remove
    -     * @property renderSession
    -     * @type Object
    -     */
    -    this.renderSession = {};
    -    this.renderSession.gl = this.gl;
    -    this.renderSession.drawCount = 0;
    -    this.renderSession.shaderManager = this.shaderManager;
    -    this.renderSession.maskManager = this.maskManager;
    -    this.renderSession.filterManager = this.filterManager;
    -    this.renderSession.blendModeManager = this.blendModeManager;
    -    this.renderSession.spriteBatch = this.spriteBatch;
    -    this.renderSession.stencilManager = this.stencilManager;
    -    this.renderSession.renderer = this;
    -    this.renderSession.resolution = this.resolution;
    -
    -    // time init the context..
    -    this.initContext();
    -
    -    // map some webGL blend modes..
    -    this.mapBlendModes();
    -};
    -
    -// constructor
    -PIXI.WebGLRenderer.prototype.constructor = PIXI.WebGLRenderer;
    -
    -/**
    -* @method initContext
    -*/
    -PIXI.WebGLRenderer.prototype.initContext = function()
    -{
    -    var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions);
    -    this.gl = gl;
    -
    -    if (!gl) {
    -        // fail, not able to get a context
    -        throw new Error('This browser does not support webGL. Try using the canvas renderer');
    -    }
    -
    -    this.glContextId = gl.id = PIXI.WebGLRenderer.glContextId ++;
    -
    -    PIXI.glContexts[this.glContextId] = gl;
    -
    -    PIXI.instances[this.glContextId] = this;
    -
    -    // set up the default pixi settings..
    -    gl.disable(gl.DEPTH_TEST);
    -    gl.disable(gl.CULL_FACE);
    -    gl.enable(gl.BLEND);
    -
    -    // need to set the context for all the managers...
    -    this.shaderManager.setContext(gl);
    -    this.spriteBatch.setContext(gl);
    -    this.maskManager.setContext(gl);
    -    this.filterManager.setContext(gl);
    -    this.blendModeManager.setContext(gl);
    -    this.stencilManager.setContext(gl);
    -
    -    this.renderSession.gl = this.gl;
    -
    -    // now resize and we are good to go!
    -    this.resize(this.width, this.height);
    -};
    -
    -/**
    - * Renders the stage to its webGL view
    - *
    - * @method render
    - * @param stage {Stage} the Stage element to be rendered
    - */
    -PIXI.WebGLRenderer.prototype.render = function(stage)
    -{
    -    // no point rendering if our context has been blown up!
    -    if(this.contextLost)return;
    -
    -    // if rendering a new stage clear the batches..
    -    if(this.__stage !== stage)
    -    {
    -        if(stage.interactive)stage.interactionManager.removeEvents();
    -
    -        // TODO make this work
    -        // dont think this is needed any more?
    -        this.__stage = stage;
    -    }
    -
    -    // update the scene graph
    -    stage.updateTransform();
    -
    -    var gl = this.gl;
    -
    -    // interaction
    -    if(stage._interactive)
    -    {
    -        //need to add some events!
    -        if(!stage._interactiveEventsAdded)
    -        {
    -            stage._interactiveEventsAdded = true;
    -            stage.interactionManager.setTarget(this);
    -        }
    -    }
    -    else
    -    {
    -        if(stage._interactiveEventsAdded)
    -        {
    -            stage._interactiveEventsAdded = false;
    -            stage.interactionManager.setTarget(this);
    -        }
    -    }
    -
    -    // -- Does this need to be set every frame? -- //
    -    gl.viewport(0, 0, this.width, this.height);
    -
    -    // make sure we are bound to the main frame buffer
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, null);
    -
    -    if (this.clearBeforeRender)
    -        {
    -        if(this.transparent)
    -        {
    -            gl.clearColor(0, 0, 0, 0);
    -        }
    -        else
    -        {
    -            gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], 1);
    -        }
    -
    -        gl.clear (gl.COLOR_BUFFER_BIT);
    -    }
    -
    -    this.renderDisplayObject( stage, this.projection );
    -};
    -
    -/**
    - * Renders a Display Object.
    - *
    - * @method renderDisplayObject
    - * @param displayObject {DisplayObject} The DisplayObject to render
    - * @param projection {Point} The projection
    - * @param buffer {Array} a standard WebGL buffer
    - */
    -PIXI.WebGLRenderer.prototype.renderDisplayObject = function(displayObject, projection, buffer)
    -{
    -    this.renderSession.blendModeManager.setBlendMode(PIXI.blendModes.NORMAL);
    -
    -    // reset the render session data..
    -    this.renderSession.drawCount = 0;
    -
    -    // set the default projection
    -    this.renderSession.projection = projection;
    -
    -    //set the default offset
    -    this.renderSession.offset = this.offset;
    -
    -    // start the sprite batch
    -    this.spriteBatch.begin(this.renderSession);
    -
    -    // start the filter manager
    -    this.filterManager.begin(this.renderSession, buffer);
    -
    -    // render the scene!
    -    displayObject._renderWebGL(this.renderSession);
    -
    -    // finish the sprite batch
    -    this.spriteBatch.end();
    -};
    -
    -/**
    - * Resizes the webGL view to the specified width and height.
    - *
    - * @method resize
    - * @param width {Number} the new width of the webGL view
    - * @param height {Number} the new height of the webGL view
    - */
    -PIXI.WebGLRenderer.prototype.resize = function(width, height)
    -{
    -    this.width = width * this.resolution;
    -    this.height = height * this.resolution;
    -
    -    this.view.width = this.width;
    -    this.view.height = this.height;
    -
    -    if (this.autoResize) {
    -        this.view.style.width = this.width / this.resolution + 'px';
    -        this.view.style.height = this.height / this.resolution + 'px';
    -    }
    -
    -    this.gl.viewport(0, 0, this.width, this.height);
    -
    -    this.projection.x =  this.width / 2 / this.resolution;
    -    this.projection.y =  -this.height / 2 / this.resolution;
    -};
    -
    -/**
    - * Updates and Creates a WebGL texture for the renderers context.
    - *
    - * @method updateTexture
    - * @param texture {Texture} the texture to update
    - */
    -PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    -{
    -    if(!texture.hasLoaded )return;
    -
    -    var gl = this.gl;
    -
    -    if(!texture._glTextures[gl.id])texture._glTextures[gl.id] = gl.createTexture();
    -
    -    gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]);
    -
    -    gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultipliedAlpha);
    -    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source);
    -
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
    -
    -    // reguler...
    -    if(!texture._powerOf2)
    -    {
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    -    }
    -    else
    -    {
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
    -    }
    -
    -    texture._dirty[gl.id] = false;
    -
    -    return  texture._glTextures[gl.id];
    -};
    -
    -/**
    - * Handles a lost webgl context
    - *
    - * @method handleContextLost
    - * @param event {Event}
    - * @private
    - */
    -PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    -{
    -    event.preventDefault();
    -    this.contextLost = true;
    -};
    -
    -/**
    - * Handles a restored webgl context
    - *
    - * @method handleContextRestored
    - * @param event {Event}
    - * @private
    - */
    -PIXI.WebGLRenderer.prototype.handleContextRestored = function()
    -{
    -    this.initContext();
    -
    -    // empty all the ol gl textures as they are useless now
    -    for(var key in PIXI.TextureCache)
    -    {
    -        var texture = PIXI.TextureCache[key].baseTexture;
    -        texture._glTextures = [];
    -    }
    -
    -    this.contextLost = false;
    -};
    -
    -/**
    - * Removes everything from the renderer (event listeners, spritebatch, etc...)
    - *
    - * @method destroy
    - */
    -PIXI.WebGLRenderer.prototype.destroy = function()
    -{
    -    // remove listeners
    -    this.view.removeEventListener('webglcontextlost', this.contextLostBound);
    -    this.view.removeEventListener('webglcontextrestored', this.contextRestoredBound);
    -
    -    PIXI.glContexts[this.glContextId] = null;
    -
    -    this.projection = null;
    -    this.offset = null;
    -
    -    // time to create the render managers! each one focuses on managine a state in webGL
    -    this.shaderManager.destroy();
    -    this.spriteBatch.destroy();
    -    this.maskManager.destroy();
    -    this.filterManager.destroy();
    -
    -    this.shaderManager = null;
    -    this.spriteBatch = null;
    -    this.maskManager = null;
    -    this.filterManager = null;
    -
    -    this.gl = null;
    -    this.renderSession = null;
    -};
    -
    -/**
    - * Maps Pixi blend modes to WebGL blend modes.
    - *
    - * @method mapBlendModes
    - */
    -PIXI.WebGLRenderer.prototype.mapBlendModes = function()
    -{
    -    var gl = this.gl;
    -
    -    if(!PIXI.blendModesWebGL)
    -    {
    -        PIXI.blendModesWebGL = [];
    -
    -        PIXI.blendModesWebGL[PIXI.blendModes.NORMAL]        = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.ADD]           = [gl.SRC_ALPHA, gl.DST_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.MULTIPLY]      = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.SCREEN]        = [gl.SRC_ALPHA, gl.ONE];
    -        PIXI.blendModesWebGL[PIXI.blendModes.OVERLAY]       = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.DARKEN]        = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.LIGHTEN]       = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.COLOR_DODGE]   = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.COLOR_BURN]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.HARD_LIGHT]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.SOFT_LIGHT]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.DIFFERENCE]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.EXCLUSION]     = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.HUE]           = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.SATURATION]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.COLOR]         = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.LUMINOSITY]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -    }
    -};
    -
    -PIXI.WebGLRenderer.glContextId = 0;
    -PIXI.WebGLRenderer.instances = [];
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_ComplexPrimitiveShader.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_ComplexPrimitiveShader.js.html deleted file mode 100755 index 696e890..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_ComplexPrimitiveShader.js.html +++ /dev/null @@ -1,399 +0,0 @@ - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class ComplexPrimitiveShader
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.ComplexPrimitiveShader = function(gl)
    -{
    -    /**
    -     * @property _UID
    -     * @type Number
    -     * @private
    -     */
    -    this._UID = PIXI._UID++;
    -
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    /**
    -     * The WebGL program.
    -     * @property program
    -     * @type {Any}
    -     */
    -    this.program = null;
    -
    -    /**
    -     * The fragment shader.
    -     * @property fragmentSrc
    -     * @type Array
    -     */
    -    this.fragmentSrc = [
    -
    -        'precision mediump float;',
    -
    -        'varying vec4 vColor;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = vColor;',
    -        '}'
    -    ];
    -
    -    /**
    -     * The vertex shader.
    -     * @property vertexSrc
    -     * @type Array
    -     */
    -    this.vertexSrc  = [
    -        'attribute vec2 aVertexPosition;',
    -        //'attribute vec4 aColor;',
    -        'uniform mat3 translationMatrix;',
    -        'uniform vec2 projectionVector;',
    -        'uniform vec2 offsetVector;',
    -        
    -        'uniform vec3 tint;',
    -        'uniform float alpha;',
    -        'uniform vec3 color;',
    -
    -        'varying vec4 vColor;',
    -
    -        'void main(void) {',
    -        '   vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);',
    -        '   v -= offsetVector.xyx;',
    -        '   gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);',
    -        '   vColor = vec4(color * alpha * tint, alpha);',//" * vec4(tint * alpha, alpha);',
    -        '}'
    -    ];
    -
    -    this.init();
    -};
    -
    -PIXI.ComplexPrimitiveShader.prototype.constructor = PIXI.ComplexPrimitiveShader;
    -
    -/**
    -* Initialises the shader.
    -* 
    -* @method init
    -*/
    -PIXI.ComplexPrimitiveShader.prototype.init = function()
    -{
    -    var gl = this.gl;
    -
    -    var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc);
    -    gl.useProgram(program);
    -
    -    // get and store the uniforms for the shader
    -    this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
    -    this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
    -    this.tintColor = gl.getUniformLocation(program, 'tint');
    -    this.color = gl.getUniformLocation(program, 'color');
    -
    -    // get and store the attributes
    -    this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
    -   // this.colorAttribute = gl.getAttribLocation(program, 'aColor');
    -
    -    this.attributes = [this.aVertexPosition, this.colorAttribute];
    -
    -    this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix');
    -    this.alpha = gl.getUniformLocation(program, 'alpha');
    -
    -    this.program = program;
    -};
    -
    -/**
    -* Destroys the shader.
    -* 
    -* @method destroy
    -*/
    -PIXI.ComplexPrimitiveShader.prototype.destroy = function()
    -{
    -    this.gl.deleteProgram( this.program );
    -    this.uniforms = null;
    -    this.gl = null;
    -
    -    this.attribute = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiFastShader.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiFastShader.js.html deleted file mode 100755 index 05dda36..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiFastShader.js.html +++ /dev/null @@ -1,433 +0,0 @@ - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/shaders/PixiFastShader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class PixiFastShader
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.PixiFastShader = function(gl)
    -{
    -    /**
    -     * @property _UID
    -     * @type Number
    -     * @private
    -     */
    -    this._UID = PIXI._UID++;
    -    
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    /**
    -     * The WebGL program.
    -     * @property program
    -     * @type {Any}
    -     */
    -    this.program = null;
    -
    -    /**
    -     * The fragment shader.
    -     * @property fragmentSrc
    -     * @type Array
    -     */
    -    this.fragmentSrc = [
    -        'precision lowp float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying float vColor;',
    -        'uniform sampler2D uSampler;',
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;',
    -        '}'
    -    ];
    -
    -    /**
    -     * The vertex shader.
    -     * @property vertexSrc
    -     * @type Array
    -     */
    -    this.vertexSrc = [
    -        'attribute vec2 aVertexPosition;',
    -        'attribute vec2 aPositionCoord;',
    -        'attribute vec2 aScale;',
    -        'attribute float aRotation;',
    -        'attribute vec2 aTextureCoord;',
    -        'attribute float aColor;',
    -
    -        'uniform vec2 projectionVector;',
    -        'uniform vec2 offsetVector;',
    -        'uniform mat3 uMatrix;',
    -
    -        'varying vec2 vTextureCoord;',
    -        'varying float vColor;',
    -
    -        'const vec2 center = vec2(-1.0, 1.0);',
    -
    -        'void main(void) {',
    -        '   vec2 v;',
    -        '   vec2 sv = aVertexPosition * aScale;',
    -        '   v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);',
    -        '   v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);',
    -        '   v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;',
    -        '   gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);',
    -        '   vTextureCoord = aTextureCoord;',
    -      //  '   vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;',
    -        '   vColor = aColor;',
    -        '}'
    -    ];
    -
    -    /**
    -     * A local texture counter for multi-texture shaders.
    -     * @property textureCount
    -     * @type Number
    -     */
    -    this.textureCount = 0;
    -    
    -    this.init();
    -};
    -
    -PIXI.PixiFastShader.prototype.constructor = PIXI.PixiFastShader;
    -
    -/**
    -* Initialises the shader.
    -* 
    -* @method init
    -*/
    -PIXI.PixiFastShader.prototype.init = function()
    -{
    -    var gl = this.gl;
    -
    -    var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc);
    -    
    -    gl.useProgram(program);
    -
    -    // get and store the uniforms for the shader
    -    this.uSampler = gl.getUniformLocation(program, 'uSampler');
    -
    -    this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
    -    this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
    -    this.dimensions = gl.getUniformLocation(program, 'dimensions');
    -    this.uMatrix = gl.getUniformLocation(program, 'uMatrix');
    -
    -    // get and store the attributes
    -    this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
    -    this.aPositionCoord = gl.getAttribLocation(program, 'aPositionCoord');
    -
    -    this.aScale = gl.getAttribLocation(program, 'aScale');
    -    this.aRotation = gl.getAttribLocation(program, 'aRotation');
    -
    -    this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord');
    -    this.colorAttribute = gl.getAttribLocation(program, 'aColor');
    -   
    -    // Begin worst hack eva //
    -
    -    // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters?
    -    // maybe its somthing to do with the current state of the gl context.
    -    // Im convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel
    -    // If theres any webGL people that know why could happen please help :)
    -    if(this.colorAttribute === -1)
    -    {
    -        this.colorAttribute = 2;
    -    }
    -
    -    this.attributes = [this.aVertexPosition, this.aPositionCoord,  this.aScale, this.aRotation, this.aTextureCoord, this.colorAttribute];
    -    
    -    // End worst hack eva //
    -
    -    this.program = program;
    -};
    -
    -/**
    -* Destroys the shader.
    -* 
    -* @method destroy
    -*/
    -PIXI.PixiFastShader.prototype.destroy = function()
    -{
    -    this.gl.deleteProgram( this.program );
    -    this.uniforms = null;
    -    this.gl = null;
    -
    -    this.attributes = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiShader.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiShader.js.html deleted file mode 100755 index 89d83ac..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiShader.js.html +++ /dev/null @@ -1,668 +0,0 @@ - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/shaders/PixiShader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * @author Richard Davey http://www.photonstorm.com @photonstorm
    - */
    -
    -/**
    -* @class PixiShader
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.PixiShader = function(gl)
    -{
    -    /**
    -     * @property _UID
    -     * @type Number
    -     * @private
    -     */
    -    this._UID = PIXI._UID++;
    -
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    /**
    -     * The WebGL program.
    -     * @property program
    -     * @type {Any}
    -     */
    -    this.program = null;
    -
    -    /**
    -     * The fragment shader.
    -     * @property fragmentSrc
    -     * @type Array
    -     */
    -    this.fragmentSrc = [
    -        'precision lowp float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D uSampler;',
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;',
    -        '}'
    -    ];
    -
    -    /**
    -     * A local texture counter for multi-texture shaders.
    -     * @property textureCount
    -     * @type Number
    -     */
    -    this.textureCount = 0;
    -
    -    /**
    -     * A local flag
    -     * @property firstRun
    -     * @type Boolean
    -     * @private
    -     */
    -    this.firstRun = true;
    -
    -    /**
    -     * A dirty flag
    -     * @property dirty
    -     * @type Boolean
    -     */
    -    this.dirty = true;
    -
    -    /**
    -     * Uniform attributes cache.
    -     * @property attributes
    -     * @type Array
    -     * @private
    -     */
    -    this.attributes = [];
    -
    -    this.init();
    -};
    -
    -PIXI.PixiShader.prototype.constructor = PIXI.PixiShader;
    -
    -/**
    -* Initialises the shader.
    -*
    -* @method init
    -*/
    -PIXI.PixiShader.prototype.init = function()
    -{
    -    var gl = this.gl;
    -
    -    var program = PIXI.compileProgram(gl, this.vertexSrc || PIXI.PixiShader.defaultVertexSrc, this.fragmentSrc);
    -
    -    gl.useProgram(program);
    -
    -    // get and store the uniforms for the shader
    -    this.uSampler = gl.getUniformLocation(program, 'uSampler');
    -    this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
    -    this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
    -    this.dimensions = gl.getUniformLocation(program, 'dimensions');
    -
    -    // get and store the attributes
    -    this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
    -    this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord');
    -    this.colorAttribute = gl.getAttribLocation(program, 'aColor');
    -
    -    // Begin worst hack eva //
    -
    -    // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters?
    -    // maybe its something to do with the current state of the gl context.
    -    // I'm convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel
    -    // If theres any webGL people that know why could happen please help :)
    -    if(this.colorAttribute === -1)
    -    {
    -        this.colorAttribute = 2;
    -    }
    -
    -    this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
    -
    -    // End worst hack eva //
    -
    -    // add those custom shaders!
    -    for (var key in this.uniforms)
    -    {
    -        // get the uniform locations..
    -        this.uniforms[key].uniformLocation = gl.getUniformLocation(program, key);
    -    }
    -
    -    this.initUniforms();
    -
    -    this.program = program;
    -};
    -
    -/**
    -* Initialises the shader uniform values.
    -*
    -* Uniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/
    -* http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf
    -*
    -* @method initUniforms
    -*/
    -PIXI.PixiShader.prototype.initUniforms = function()
    -{
    -    this.textureCount = 1;
    -    var gl = this.gl;
    -    var uniform;
    -
    -    for (var key in this.uniforms)
    -    {
    -        uniform = this.uniforms[key];
    -
    -        var type = uniform.type;
    -
    -        if (type === 'sampler2D')
    -        {
    -            uniform._init = false;
    -
    -            if (uniform.value !== null)
    -            {
    -                this.initSampler2D(uniform);
    -            }
    -        }
    -        else if (type === 'mat2' || type === 'mat3' || type === 'mat4')
    -        {
    -            //  These require special handling
    -            uniform.glMatrix = true;
    -            uniform.glValueLength = 1;
    -
    -            if (type === 'mat2')
    -            {
    -                uniform.glFunc = gl.uniformMatrix2fv;
    -            }
    -            else if (type === 'mat3')
    -            {
    -                uniform.glFunc = gl.uniformMatrix3fv;
    -            }
    -            else if (type === 'mat4')
    -            {
    -                uniform.glFunc = gl.uniformMatrix4fv;
    -            }
    -        }
    -        else
    -        {
    -            //  GL function reference
    -            uniform.glFunc = gl['uniform' + type];
    -
    -            if (type === '2f' || type === '2i')
    -            {
    -                uniform.glValueLength = 2;
    -            }
    -            else if (type === '3f' || type === '3i')
    -            {
    -                uniform.glValueLength = 3;
    -            }
    -            else if (type === '4f' || type === '4i')
    -            {
    -                uniform.glValueLength = 4;
    -            }
    -            else
    -            {
    -                uniform.glValueLength = 1;
    -            }
    -        }
    -    }
    -
    -};
    -
    -/**
    -* Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded)
    -*
    -* @method initSampler2D
    -*/
    -PIXI.PixiShader.prototype.initSampler2D = function(uniform)
    -{
    -    if (!uniform.value || !uniform.value.baseTexture || !uniform.value.baseTexture.hasLoaded)
    -    {
    -        return;
    -    }
    -
    -    var gl = this.gl;
    -
    -    gl.activeTexture(gl['TEXTURE' + this.textureCount]);
    -    gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]);
    -
    -    //  Extended texture data
    -    if (uniform.textureData)
    -    {
    -        var data = uniform.textureData;
    -
    -        // GLTexture = mag linear, min linear_mipmap_linear, wrap repeat + gl.generateMipmap(gl.TEXTURE_2D);
    -        // GLTextureLinear = mag/min linear, wrap clamp
    -        // GLTextureNearestRepeat = mag/min NEAREST, wrap repeat
    -        // GLTextureNearest = mag/min nearest, wrap clamp
    -        // AudioTexture = whatever + luminance + width 512, height 2, border 0
    -        // KeyTexture = whatever + luminance + width 256, height 2, border 0
    -
    -        //  magFilter can be: gl.LINEAR, gl.LINEAR_MIPMAP_LINEAR or gl.NEAREST
    -        //  wrapS/T can be: gl.CLAMP_TO_EDGE or gl.REPEAT
    -
    -        var magFilter = (data.magFilter) ? data.magFilter : gl.LINEAR;
    -        var minFilter = (data.minFilter) ? data.minFilter : gl.LINEAR;
    -        var wrapS = (data.wrapS) ? data.wrapS : gl.CLAMP_TO_EDGE;
    -        var wrapT = (data.wrapT) ? data.wrapT : gl.CLAMP_TO_EDGE;
    -        var format = (data.luminance) ? gl.LUMINANCE : gl.RGBA;
    -
    -        if (data.repeat)
    -        {
    -            wrapS = gl.REPEAT;
    -            wrapT = gl.REPEAT;
    -        }
    -
    -        gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, !!data.flipY);
    -
    -        if (data.width)
    -        {
    -            var width = (data.width) ? data.width : 512;
    -            var height = (data.height) ? data.height : 2;
    -            var border = (data.border) ? data.border : 0;
    -
    -            // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels);
    -            gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, border, format, gl.UNSIGNED_BYTE, null);
    -        }
    -        else
    -        {
    -            //  void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, ImageData? pixels);
    -            gl.texImage2D(gl.TEXTURE_2D, 0, format, gl.RGBA, gl.UNSIGNED_BYTE, uniform.value.baseTexture.source);
    -        }
    -
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter);
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter);
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrapS);
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT);
    -    }
    -
    -    gl.uniform1i(uniform.uniformLocation, this.textureCount);
    -
    -    uniform._init = true;
    -
    -    this.textureCount++;
    -
    -};
    -
    -/**
    -* Updates the shader uniform values.
    -*
    -* @method syncUniforms
    -*/
    -PIXI.PixiShader.prototype.syncUniforms = function()
    -{
    -    this.textureCount = 1;
    -    var uniform;
    -    var gl = this.gl;
    -
    -    //  This would probably be faster in an array and it would guarantee key order
    -    for (var key in this.uniforms)
    -    {
    -        uniform = this.uniforms[key];
    -
    -        if (uniform.glValueLength === 1)
    -        {
    -            if (uniform.glMatrix === true)
    -            {
    -                uniform.glFunc.call(gl, uniform.uniformLocation, uniform.transpose, uniform.value);
    -            }
    -            else
    -            {
    -                uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value);
    -            }
    -        }
    -        else if (uniform.glValueLength === 2)
    -        {
    -            uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y);
    -        }
    -        else if (uniform.glValueLength === 3)
    -        {
    -            uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z);
    -        }
    -        else if (uniform.glValueLength === 4)
    -        {
    -            uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z, uniform.value.w);
    -        }
    -        else if (uniform.type === 'sampler2D')
    -        {
    -            if (uniform._init)
    -            {
    -                gl.activeTexture(gl['TEXTURE' + this.textureCount]);
    -
    -                if(uniform.value.baseTexture._dirty[gl.id])
    -                {
    -                    PIXI.WebGLRenderer.instances[gl.id].updateTexture(uniform.value.baseTexture);
    -                }
    -                else
    -                {
    -                    // bind the current texture
    -                    gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]);
    -                }
    -
    -             //   gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id] || PIXI.createWebGLTexture( uniform.value.baseTexture, gl));
    -                gl.uniform1i(uniform.uniformLocation, this.textureCount);
    -                this.textureCount++;
    -            }
    -            else
    -            {
    -                this.initSampler2D(uniform);
    -            }
    -        }
    -    }
    -
    -};
    -
    -/**
    -* Destroys the shader.
    -*
    -* @method destroy
    -*/
    -PIXI.PixiShader.prototype.destroy = function()
    -{
    -    this.gl.deleteProgram( this.program );
    -    this.uniforms = null;
    -    this.gl = null;
    -
    -    this.attributes = null;
    -};
    -
    -/**
    -* The Default Vertex shader source.
    -*
    -* @property defaultVertexSrc
    -* @type String
    -*/
    -PIXI.PixiShader.defaultVertexSrc = [
    -    'attribute vec2 aVertexPosition;',
    -    'attribute vec2 aTextureCoord;',
    -    'attribute vec4 aColor;',
    -
    -    'uniform vec2 projectionVector;',
    -    'uniform vec2 offsetVector;',
    -
    -    'varying vec2 vTextureCoord;',
    -    'varying vec4 vColor;',
    -
    -    'const vec2 center = vec2(-1.0, 1.0);',
    -
    -    'void main(void) {',
    -    '   gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);',
    -    '   vTextureCoord = aTextureCoord;',
    -    '   vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;',
    -    '   vColor = vec4(color * aColor.x, aColor.x);',
    -    '}'
    -];
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PrimitiveShader.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PrimitiveShader.js.html deleted file mode 100755 index de2db53..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PrimitiveShader.js.html +++ /dev/null @@ -1,393 +0,0 @@ - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/shaders/PrimitiveShader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class PrimitiveShader
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.PrimitiveShader = function(gl)
    -{
    -    /**
    -     * @property _UID
    -     * @type Number
    -     * @private
    -     */
    -    this._UID = PIXI._UID++;
    - 
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    /**
    -     * The WebGL program.
    -     * @property program
    -     * @type {Any}
    -     */
    -    this.program = null;
    -
    -    /**
    -     * The fragment shader.
    -     * @property fragmentSrc
    -     * @type Array
    -     */
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec4 vColor;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = vColor;',
    -        '}'
    -    ];
    -
    -    /**
    -     * The vertex shader.
    -     * @property vertexSrc
    -     * @type Array
    -     */
    -    this.vertexSrc  = [
    -        'attribute vec2 aVertexPosition;',
    -        'attribute vec4 aColor;',
    -        'uniform mat3 translationMatrix;',
    -        'uniform vec2 projectionVector;',
    -        'uniform vec2 offsetVector;',
    -        'uniform float alpha;',
    -        'uniform vec3 tint;',
    -        'varying vec4 vColor;',
    -
    -        'void main(void) {',
    -        '   vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);',
    -        '   v -= offsetVector.xyx;',
    -        '   gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);',
    -        '   vColor = aColor * vec4(tint * alpha, alpha);',
    -        '}'
    -    ];
    -
    -    this.init();
    -};
    -
    -PIXI.PrimitiveShader.prototype.constructor = PIXI.PrimitiveShader;
    -
    -/**
    -* Initialises the shader.
    -* 
    -* @method init
    -*/
    -PIXI.PrimitiveShader.prototype.init = function()
    -{
    -    var gl = this.gl;
    -
    -    var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc);
    -    gl.useProgram(program);
    -
    -    // get and store the uniforms for the shader
    -    this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
    -    this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
    -    this.tintColor = gl.getUniformLocation(program, 'tint');
    -
    -    // get and store the attributes
    -    this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
    -    this.colorAttribute = gl.getAttribLocation(program, 'aColor');
    -
    -    this.attributes = [this.aVertexPosition, this.colorAttribute];
    -
    -    this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix');
    -    this.alpha = gl.getUniformLocation(program, 'alpha');
    -
    -    this.program = program;
    -};
    -
    -/**
    -* Destroys the shader.
    -* 
    -* @method destroy
    -*/
    -PIXI.PrimitiveShader.prototype.destroy = function()
    -{
    -    this.gl.deleteProgram( this.program );
    -    this.uniforms = null;
    -    this.gl = null;
    -
    -    this.attributes = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_StripShader.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_StripShader.js.html deleted file mode 100755 index 39bc977..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_StripShader.js.html +++ /dev/null @@ -1,401 +0,0 @@ - - - - - src/pixi/renderers/webgl/shaders/StripShader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/shaders/StripShader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class StripShader
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.StripShader = function(gl)
    -{
    -    /**
    -     * @property _UID
    -     * @type Number
    -     * @private
    -     */
    -    this._UID = PIXI._UID++;
    -    
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    /**
    -     * The WebGL program.
    -     * @property program
    -     * @type {Any}
    -     */
    -    this.program = null;
    -
    -    /**
    -     * The fragment shader.
    -     * @property fragmentSrc
    -     * @type Array
    -     */
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -     //   'varying float vColor;',
    -        'uniform float alpha;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * alpha;',
    -      //  '   gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);',//gl_FragColor * alpha;',
    -        '}'
    -    ];
    -
    -    /**
    -     * The vertex shader.
    -     * @property vertexSrc
    -     * @type Array
    -     */
    -    this.vertexSrc  = [
    -        'attribute vec2 aVertexPosition;',
    -        'attribute vec2 aTextureCoord;',
    -        'uniform mat3 translationMatrix;',
    -        'uniform vec2 projectionVector;',
    -        'uniform vec2 offsetVector;',
    -      //  'uniform float alpha;',
    -       // 'uniform vec3 tint;',
    -        'varying vec2 vTextureCoord;',
    -      //  'varying vec4 vColor;',
    -
    -        'void main(void) {',
    -        '   vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);',
    -        '   v -= offsetVector.xyx;',
    -        '   gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);',
    -        '   vTextureCoord = aTextureCoord;',
    -       // '   vColor = aColor * vec4(tint * alpha, alpha);',
    -        '}'
    -    ];
    -
    -    this.init();
    -};
    -
    -PIXI.StripShader.prototype.constructor = PIXI.StripShader;
    -
    -/**
    -* Initialises the shader.
    -* 
    -* @method init
    -*/
    -PIXI.StripShader.prototype.init = function()
    -{
    -    var gl = this.gl;
    -
    -    var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc);
    -    gl.useProgram(program);
    -
    -    // get and store the uniforms for the shader
    -    this.uSampler = gl.getUniformLocation(program, 'uSampler');
    -    this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
    -    this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
    -    this.colorAttribute = gl.getAttribLocation(program, 'aColor');
    -    //this.dimensions = gl.getUniformLocation(this.program, 'dimensions');
    -
    -    // get and store the attributes
    -    this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
    -    this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord');
    -
    -    this.attributes = [this.aVertexPosition, this.aTextureCoord];
    -
    -    this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix');
    -    this.alpha = gl.getUniformLocation(program, 'alpha');
    -
    -    this.program = program;
    -};
    -
    -/**
    -* Destroys the shader.
    -* 
    -* @method destroy
    -*/
    -PIXI.StripShader.prototype.destroy = function()
    -{
    -    this.gl.deleteProgram( this.program );
    -    this.uniforms = null;
    -    this.gl = null;
    -
    -    this.attribute = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_FilterTexture.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_FilterTexture.js.html deleted file mode 100755 index f1ce334..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_FilterTexture.js.html +++ /dev/null @@ -1,388 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/FilterTexture.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class FilterTexture
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -* @param width {Number} the horizontal range of the filter
    -* @param height {Number} the vertical range of the filter
    -* @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    -*/
    -PIXI.FilterTexture = function(gl, width, height, scaleMode)
    -{
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    // next time to create a frame buffer and texture
    -
    -    /**
    -     * @property frameBuffer
    -     * @type Any
    -     */
    -    this.frameBuffer = gl.createFramebuffer();
    -
    -    /**
    -     * @property texture
    -     * @type Any
    -     */
    -    this.texture = gl.createTexture();
    -
    -    /**
    -     * @property scaleMode
    -     * @type Number
    -     */
    -    scaleMode = scaleMode || PIXI.scaleModes.DEFAULT;
    -
    -    gl.bindTexture(gl.TEXTURE_2D,  this.texture);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer );
    -
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer );
    -    gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0);
    -
    -    // required for masking a mask??
    -    this.renderBuffer = gl.createRenderbuffer();
    -    gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer);
    -    gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.renderBuffer);
    -  
    -    this.resize(width, height);
    -};
    -
    -PIXI.FilterTexture.prototype.constructor = PIXI.FilterTexture;
    -
    -/**
    -* Clears the filter texture.
    -* 
    -* @method clear
    -*/
    -PIXI.FilterTexture.prototype.clear = function()
    -{
    -    var gl = this.gl;
    -    
    -    gl.clearColor(0,0,0, 0);
    -    gl.clear(gl.COLOR_BUFFER_BIT);
    -};
    -
    -/**
    - * Resizes the texture to the specified width and height
    - *
    - * @method resize
    - * @param width {Number} the new width of the texture
    - * @param height {Number} the new height of the texture
    - */
    -PIXI.FilterTexture.prototype.resize = function(width, height)
    -{
    -    if(this.width === width && this.height === height) return;
    -
    -    this.width = width;
    -    this.height = height;
    -
    -    var gl = this.gl;
    -
    -    gl.bindTexture(gl.TEXTURE_2D,  this.texture);
    -    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA,  width , height , 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
    -    // update the stencil buffer width and height
    -    gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer);
    -    gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width , height );
    -};
    -
    -/**
    -* Destroys the filter texture.
    -* 
    -* @method destroy
    -*/
    -PIXI.FilterTexture.prototype.destroy = function()
    -{
    -    var gl = this.gl;
    -    gl.deleteFramebuffer( this.frameBuffer );
    -    gl.deleteTexture( this.texture );
    -
    -    this.frameBuffer = null;
    -    this.texture = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLBlendModeManager.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLBlendModeManager.js.html deleted file mode 100755 index f2bd028..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLBlendModeManager.js.html +++ /dev/null @@ -1,336 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class WebGLBlendModeManager
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLBlendModeManager = function()
    -{
    -    /**
    -     * @property currentBlendMode
    -     * @type Number
    -     */
    -    this.currentBlendMode = 99999;
    -};
    -
    -PIXI.WebGLBlendModeManager.prototype.constructor = PIXI.WebGLBlendModeManager;
    -
    -/**
    - * Sets the WebGL Context.
    - *
    - * @method setContext
    - * @param gl {WebGLContext} the current WebGL drawing context
    - */
    -PIXI.WebGLBlendModeManager.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -};
    -
    -/**
    -* Sets-up the given blendMode from WebGL's point of view.
    -* 
    -* @method setBlendMode 
    -* @param blendMode {Number} the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD
    -*/
    -PIXI.WebGLBlendModeManager.prototype.setBlendMode = function(blendMode)
    -{
    -    if(this.currentBlendMode === blendMode)return false;
    -
    -    this.currentBlendMode = blendMode;
    -    
    -    var blendModeWebGL = PIXI.blendModesWebGL[this.currentBlendMode];
    -    this.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]);
    -    
    -    return true;
    -};
    -
    -/**
    -* Destroys this object.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLBlendModeManager.prototype.destroy = function()
    -{
    -    this.gl = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFastSpriteBatch.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFastSpriteBatch.js.html deleted file mode 100755 index 4a22a54..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFastSpriteBatch.js.html +++ /dev/null @@ -1,706 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js

    - -
    -
    -/**
    - * @author Mat Groves
    - * 
    - * Big thanks to the very clever Matt DesLauriers <mattdesl> https://github.com/mattdesl/
    - * for creating the original pixi version!
    - *
    - * Heavily inspired by LibGDX's WebGLSpriteBatch:
    - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java
    - */
    -
    -/**
    -* @class WebGLFastSpriteBatch
    -* @constructor
    -*/
    -PIXI.WebGLFastSpriteBatch = function(gl)
    -{
    -    /**
    -     * @property vertSize
    -     * @type Number
    -     */
    -    this.vertSize = 10;
    -
    -    /**
    -     * @property maxSize
    -     * @type Number
    -     */
    -    this.maxSize = 6000;//Math.pow(2, 16) /  this.vertSize;
    -
    -    /**
    -     * @property size
    -     * @type Number
    -     */
    -    this.size = this.maxSize;
    -
    -    //the total number of floats in our batch
    -    var numVerts = this.size * 4 *  this.vertSize;
    -
    -    //the total number of indices in our batch
    -    var numIndices = this.maxSize * 6;
    -
    -    /**
    -     * Vertex data
    -     * @property vertices
    -     * @type Float32Array
    -     */
    -    this.vertices = new PIXI.Float32Array(numVerts);
    -
    -    /**
    -     * Index data
    -     * @property indices
    -     * @type Uint16Array
    -     */
    -    this.indices = new PIXI.Uint16Array(numIndices);
    -    
    -    /**
    -     * @property vertexBuffer
    -     * @type Object
    -     */
    -    this.vertexBuffer = null;
    -
    -    /**
    -     * @property indexBuffer
    -     * @type Object
    -     */
    -    this.indexBuffer = null;
    -
    -    /**
    -     * @property lastIndexCount
    -     * @type Number
    -     */
    -    this.lastIndexCount = 0;
    -
    -    for (var i=0, j=0; i < numIndices; i += 6, j += 4)
    -    {
    -        this.indices[i + 0] = j + 0;
    -        this.indices[i + 1] = j + 1;
    -        this.indices[i + 2] = j + 2;
    -        this.indices[i + 3] = j + 0;
    -        this.indices[i + 4] = j + 2;
    -        this.indices[i + 5] = j + 3;
    -    }
    -
    -    /**
    -     * @property drawing
    -     * @type Boolean
    -     */
    -    this.drawing = false;
    -
    -    /**
    -     * @property currentBatchSize
    -     * @type Number
    -     */
    -    this.currentBatchSize = 0;
    -
    -    /**
    -     * @property currentBaseTexture
    -     * @type BaseTexture
    -     */
    -    this.currentBaseTexture = null;
    -   
    -    /**
    -     * @property currentBlendMode
    -     * @type Number
    -     */
    -    this.currentBlendMode = 0;
    -
    -    /**
    -     * @property renderSession
    -     * @type Object
    -     */
    -    this.renderSession = null;
    -    
    -    /**
    -     * @property shader
    -     * @type Object
    -     */
    -    this.shader = null;
    -
    -    /**
    -     * @property matrix
    -     * @type Matrix
    -     */
    -    this.matrix = null;
    -
    -    this.setContext(gl);
    -};
    -
    -PIXI.WebGLFastSpriteBatch.prototype.constructor = PIXI.WebGLFastSpriteBatch;
    -
    -/**
    - * Sets the WebGL Context.
    - *
    - * @method setContext
    - * @param gl {WebGLContext} the current WebGL drawing context
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -
    -    // create a couple of buffers
    -    this.vertexBuffer = gl.createBuffer();
    -    this.indexBuffer = gl.createBuffer();
    -
    -    // 65535 is max index, so 65535 / 6 = 10922.
    -
    -    //upload the index data
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW);
    -};
    -
    -/**
    - * @method begin
    - * @param spriteBatch {WebGLSpriteBatch}
    - * @param renderSession {Object}
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.begin = function(spriteBatch, renderSession)
    -{
    -    this.renderSession = renderSession;
    -    this.shader = this.renderSession.shaderManager.fastShader;
    -
    -    this.matrix = spriteBatch.worldTransform.toArray(true);
    -
    -    this.start();
    -};
    -
    -/**
    - * @method end
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.end = function()
    -{
    -    this.flush();
    -};
    -
    -/**
    - * @method render
    - * @param spriteBatch {WebGLSpriteBatch}
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.render = function(spriteBatch)
    -{
    -    var children = spriteBatch.children;
    -    var sprite = children[0];
    -
    -    // if the uvs have not updated then no point rendering just yet!
    -    
    -    // check texture.
    -    if(!sprite.texture._uvs)return;
    -   
    -    this.currentBaseTexture = sprite.texture.baseTexture;
    -    
    -    // check blend mode
    -    if(sprite.blendMode !== this.renderSession.blendModeManager.currentBlendMode)
    -    {
    -        this.flush();
    -        this.renderSession.blendModeManager.setBlendMode(sprite.blendMode);
    -    }
    -    
    -    for(var i=0,j= children.length; i<j; i++)
    -    {
    -        this.renderSprite(children[i]);
    -    }
    -
    -    this.flush();
    -};
    -
    -/**
    - * @method renderSprite
    - * @param sprite {Sprite}
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.renderSprite = function(sprite)
    -{
    -    //sprite = children[i];
    -    if(!sprite.visible)return;
    -    
    -    // TODO trim??
    -    if(sprite.texture.baseTexture !== this.currentBaseTexture)
    -    {
    -        this.flush();
    -        this.currentBaseTexture = sprite.texture.baseTexture;
    -        
    -        if(!sprite.texture._uvs)return;
    -    }
    -
    -    var uvs, verticies = this.vertices, width, height, w0, w1, h0, h1, index;
    -
    -    uvs = sprite.texture._uvs;
    -
    -    width = sprite.texture.frame.width;
    -    height = sprite.texture.frame.height;
    -
    -    if (sprite.texture.trim)
    -    {
    -        // if the sprite is trimmed then we need to add the extra space before transforming the sprite coords..
    -        var trim = sprite.texture.trim;
    -
    -        w1 = trim.x - sprite.anchor.x * trim.width;
    -        w0 = w1 + sprite.texture.crop.width;
    -
    -        h1 = trim.y - sprite.anchor.y * trim.height;
    -        h0 = h1 + sprite.texture.crop.height;
    -    }
    -    else
    -    {
    -        w0 = (sprite.texture.frame.width ) * (1-sprite.anchor.x);
    -        w1 = (sprite.texture.frame.width ) * -sprite.anchor.x;
    -
    -        h0 = sprite.texture.frame.height * (1-sprite.anchor.y);
    -        h1 = sprite.texture.frame.height * -sprite.anchor.y;
    -    }
    -
    -    index = this.currentBatchSize * 4 * this.vertSize;
    -
    -    // xy
    -    verticies[index++] = w1;
    -    verticies[index++] = h1;
    -
    -    verticies[index++] = sprite.position.x;
    -    verticies[index++] = sprite.position.y;
    -
    -    //scale
    -    verticies[index++] = sprite.scale.x;
    -    verticies[index++] = sprite.scale.y;
    -
    -    //rotation
    -    verticies[index++] = sprite.rotation;
    -
    -    // uv
    -    verticies[index++] = uvs.x0;
    -    verticies[index++] = uvs.y1;
    -    // color
    -    verticies[index++] = sprite.alpha;
    - 
    -
    -    // xy
    -    verticies[index++] = w0;
    -    verticies[index++] = h1;
    -
    -    verticies[index++] = sprite.position.x;
    -    verticies[index++] = sprite.position.y;
    -
    -    //scale
    -    verticies[index++] = sprite.scale.x;
    -    verticies[index++] = sprite.scale.y;
    -
    -     //rotation
    -    verticies[index++] = sprite.rotation;
    -
    -    // uv
    -    verticies[index++] = uvs.x1;
    -    verticies[index++] = uvs.y1;
    -    // color
    -    verticies[index++] = sprite.alpha;
    -  
    -
    -    // xy
    -    verticies[index++] = w0;
    -    verticies[index++] = h0;
    -
    -    verticies[index++] = sprite.position.x;
    -    verticies[index++] = sprite.position.y;
    -
    -    //scale
    -    verticies[index++] = sprite.scale.x;
    -    verticies[index++] = sprite.scale.y;
    -
    -     //rotation
    -    verticies[index++] = sprite.rotation;
    -
    -    // uv
    -    verticies[index++] = uvs.x2;
    -    verticies[index++] = uvs.y2;
    -    // color
    -    verticies[index++] = sprite.alpha;
    - 
    -
    -
    -
    -    // xy
    -    verticies[index++] = w1;
    -    verticies[index++] = h0;
    -
    -    verticies[index++] = sprite.position.x;
    -    verticies[index++] = sprite.position.y;
    -
    -    //scale
    -    verticies[index++] = sprite.scale.x;
    -    verticies[index++] = sprite.scale.y;
    -
    -     //rotation
    -    verticies[index++] = sprite.rotation;
    -
    -    // uv
    -    verticies[index++] = uvs.x3;
    -    verticies[index++] = uvs.y3;
    -    // color
    -    verticies[index++] = sprite.alpha;
    -
    -    // increment the batchs
    -    this.currentBatchSize++;
    -
    -    if(this.currentBatchSize >= this.size)
    -    {
    -        this.flush();
    -    }
    -};
    -
    -/**
    - * @method flush
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.flush = function()
    -{
    -    // If the batch is length 0 then return as there is nothing to draw
    -    if (this.currentBatchSize===0)return;
    -
    -    var gl = this.gl;
    -    
    -    // bind the current texture
    -
    -    if(!this.currentBaseTexture._glTextures[gl.id])this.renderSession.renderer.updateTexture(this.currentBaseTexture, gl);
    -
    -    gl.bindTexture(gl.TEXTURE_2D, this.currentBaseTexture._glTextures[gl.id]);
    -
    -    // upload the verts to the buffer
    -   
    -    if(this.currentBatchSize > ( this.size * 0.5 ) )
    -    {
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices);
    -    }
    -    else
    -    {
    -        var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize);
    -
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, view);
    -    }
    -    
    -    // now draw those suckas!
    -    gl.drawElements(gl.TRIANGLES, this.currentBatchSize * 6, gl.UNSIGNED_SHORT, 0);
    -   
    -    // then reset the batch!
    -    this.currentBatchSize = 0;
    -
    -    // increment the draw count
    -    this.renderSession.drawCount++;
    -};
    -
    -
    -/**
    - * @method stop
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.stop = function()
    -{
    -    this.flush();
    -};
    -
    -/**
    - * @method start
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.start = function()
    -{
    -    var gl = this.gl;
    -
    -    // bind the main texture
    -    gl.activeTexture(gl.TEXTURE0);
    -
    -    // bind the buffers
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -
    -    // set the projection
    -    var projection = this.renderSession.projection;
    -    gl.uniform2f(this.shader.projectionVector, projection.x, projection.y);
    -
    -    // set the matrix
    -    gl.uniformMatrix3fv(this.shader.uMatrix, false, this.matrix);
    -
    -    // set the pointers
    -    var stride =  this.vertSize * 4;
    -
    -    gl.vertexAttribPointer(this.shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0);
    -    gl.vertexAttribPointer(this.shader.aPositionCoord, 2, gl.FLOAT, false, stride, 2 * 4);
    -    gl.vertexAttribPointer(this.shader.aScale, 2, gl.FLOAT, false, stride, 4 * 4);
    -    gl.vertexAttribPointer(this.shader.aRotation, 1, gl.FLOAT, false, stride, 6 * 4);
    -    gl.vertexAttribPointer(this.shader.aTextureCoord, 2, gl.FLOAT, false, stride, 7 * 4);
    -    gl.vertexAttribPointer(this.shader.colorAttribute, 1, gl.FLOAT, false, stride, 9 * 4);
    -    
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFilterManager.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFilterManager.js.html deleted file mode 100755 index 389585a..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFilterManager.js.html +++ /dev/null @@ -1,728 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLFilterManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class WebGLFilterManager
    -* @constructor
    -*/
    -PIXI.WebGLFilterManager = function()
    -{
    -    /**
    -     * @property filterStack
    -     * @type Array
    -     */
    -    this.filterStack = [];
    -    
    -    /**
    -     * @property offsetX
    -     * @type Number
    -     */
    -    this.offsetX = 0;
    -
    -    /**
    -     * @property offsetY
    -     * @type Number
    -     */
    -    this.offsetY = 0;
    -};
    -
    -PIXI.WebGLFilterManager.prototype.constructor = PIXI.WebGLFilterManager;
    -
    -/**
    -* Initialises the context and the properties.
    -* 
    -* @method setContext 
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLFilterManager.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -    this.texturePool = [];
    -
    -    this.initShaderBuffers();
    -};
    -
    -/**
    -* @method begin
    -* @param renderSession {RenderSession} 
    -* @param buffer {ArrayBuffer} 
    -*/
    -PIXI.WebGLFilterManager.prototype.begin = function(renderSession, buffer)
    -{
    -    this.renderSession = renderSession;
    -    this.defaultShader = renderSession.shaderManager.defaultShader;
    -
    -    var projection = this.renderSession.projection;
    -    this.width = projection.x * 2;
    -    this.height = -projection.y * 2;
    -    this.buffer = buffer;
    -};
    -
    -/**
    -* Applies the filter and adds it to the current filter stack.
    -* 
    -* @method pushFilter
    -* @param filterBlock {Object} the filter that will be pushed to the current filter stack
    -*/
    -PIXI.WebGLFilterManager.prototype.pushFilter = function(filterBlock)
    -{
    -    var gl = this.gl;
    -
    -    var projection = this.renderSession.projection;
    -    var offset = this.renderSession.offset;
    -
    -    filterBlock._filterArea = filterBlock.target.filterArea || filterBlock.target.getBounds();
    -
    -    // filter program
    -    // OPTIMISATION - the first filter is free if its a simple color change?
    -    this.filterStack.push(filterBlock);
    -
    -    var filter = filterBlock.filterPasses[0];
    -
    -    this.offsetX += filterBlock._filterArea.x;
    -    this.offsetY += filterBlock._filterArea.y;
    -
    -    var texture = this.texturePool.pop();
    -    if(!texture)
    -    {
    -        texture = new PIXI.FilterTexture(this.gl, this.width, this.height);
    -    }
    -    else
    -    {
    -        texture.resize(this.width, this.height);
    -    }
    -
    -    gl.bindTexture(gl.TEXTURE_2D,  texture.texture);
    -
    -    var filterArea = filterBlock._filterArea;// filterBlock.target.getBounds();///filterBlock.target.filterArea;
    -
    -    var padding = filter.padding;
    -    filterArea.x -= padding;
    -    filterArea.y -= padding;
    -    filterArea.width += padding * 2;
    -    filterArea.height += padding * 2;
    -
    -    // cap filter to screen size..
    -    if(filterArea.x < 0)filterArea.x = 0;
    -    if(filterArea.width > this.width)filterArea.width = this.width;
    -    if(filterArea.y < 0)filterArea.y = 0;
    -    if(filterArea.height > this.height)filterArea.height = this.height;
    -
    -    //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA,  filterArea.width, filterArea.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, texture.frameBuffer);
    -
    -    // set view port
    -    gl.viewport(0, 0, filterArea.width, filterArea.height);
    -
    -    projection.x = filterArea.width/2;
    -    projection.y = -filterArea.height/2;
    -
    -    offset.x = -filterArea.x;
    -    offset.y = -filterArea.y;
    -
    -    // update projection
    -    // now restore the regular shader..
    -    // this.renderSession.shaderManager.setShader(this.defaultShader);
    -    //gl.uniform2f(this.defaultShader.projectionVector, filterArea.width/2, -filterArea.height/2);
    -    //gl.uniform2f(this.defaultShader.offsetVector, -filterArea.x, -filterArea.y);
    -
    -    gl.colorMask(true, true, true, true);
    -    gl.clearColor(0,0,0, 0);
    -    gl.clear(gl.COLOR_BUFFER_BIT);
    -
    -    filterBlock._glFilterTexture = texture;
    -
    -};
    -
    -/**
    -* Removes the last filter from the filter stack and doesn't return it.
    -* 
    -* @method popFilter
    -*/
    -PIXI.WebGLFilterManager.prototype.popFilter = function()
    -{
    -    var gl = this.gl;
    -    var filterBlock = this.filterStack.pop();
    -    var filterArea = filterBlock._filterArea;
    -    var texture = filterBlock._glFilterTexture;
    -    var projection = this.renderSession.projection;
    -    var offset = this.renderSession.offset;
    -
    -    if(filterBlock.filterPasses.length > 1)
    -    {
    -        gl.viewport(0, 0, filterArea.width, filterArea.height);
    -
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -
    -        this.vertexArray[0] = 0;
    -        this.vertexArray[1] = filterArea.height;
    -
    -        this.vertexArray[2] = filterArea.width;
    -        this.vertexArray[3] = filterArea.height;
    -
    -        this.vertexArray[4] = 0;
    -        this.vertexArray[5] = 0;
    -
    -        this.vertexArray[6] = filterArea.width;
    -        this.vertexArray[7] = 0;
    -
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray);
    -
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    -        // now set the uvs..
    -        this.uvArray[2] = filterArea.width/this.width;
    -        this.uvArray[5] = filterArea.height/this.height;
    -        this.uvArray[6] = filterArea.width/this.width;
    -        this.uvArray[7] = filterArea.height/this.height;
    -
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray);
    -
    -        var inputTexture = texture;
    -        var outputTexture = this.texturePool.pop();
    -        if(!outputTexture)outputTexture = new PIXI.FilterTexture(this.gl, this.width, this.height);
    -        outputTexture.resize(this.width, this.height);
    -
    -        // need to clear this FBO as it may have some left over elements from a previous filter.
    -        gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer );
    -        gl.clear(gl.COLOR_BUFFER_BIT);
    -
    -        gl.disable(gl.BLEND);
    -
    -        for (var i = 0; i < filterBlock.filterPasses.length-1; i++)
    -        {
    -            var filterPass = filterBlock.filterPasses[i];
    -
    -            gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer );
    -
    -            // set texture
    -            gl.activeTexture(gl.TEXTURE0);
    -            gl.bindTexture(gl.TEXTURE_2D, inputTexture.texture);
    -
    -            // draw texture..
    -            //filterPass.applyFilterPass(filterArea.width, filterArea.height);
    -            this.applyFilterPass(filterPass, filterArea, filterArea.width, filterArea.height);
    -
    -            // swap the textures..
    -            var temp = inputTexture;
    -            inputTexture = outputTexture;
    -            outputTexture = temp;
    -        }
    -
    -        gl.enable(gl.BLEND);
    -
    -        texture = inputTexture;
    -        this.texturePool.push(outputTexture);
    -    }
    -
    -    var filter = filterBlock.filterPasses[filterBlock.filterPasses.length-1];
    -
    -    this.offsetX -= filterArea.x;
    -    this.offsetY -= filterArea.y;
    -
    -    var sizeX = this.width;
    -    var sizeY = this.height;
    -
    -    var offsetX = 0;
    -    var offsetY = 0;
    -
    -    var buffer = this.buffer;
    -
    -    // time to render the filters texture to the previous scene
    -    if(this.filterStack.length === 0)
    -    {
    -        gl.colorMask(true, true, true, true);//this.transparent);
    -    }
    -    else
    -    {
    -        var currentFilter = this.filterStack[this.filterStack.length-1];
    -        filterArea = currentFilter._filterArea;
    -
    -        sizeX = filterArea.width;
    -        sizeY = filterArea.height;
    -
    -        offsetX = filterArea.x;
    -        offsetY = filterArea.y;
    -
    -        buffer =  currentFilter._glFilterTexture.frameBuffer;
    -    }
    -
    -    // TODO need to remove these global elements..
    -    projection.x = sizeX/2;
    -    projection.y = -sizeY/2;
    -
    -    offset.x = offsetX;
    -    offset.y = offsetY;
    -
    -    filterArea = filterBlock._filterArea;
    -
    -    var x = filterArea.x-offsetX;
    -    var y = filterArea.y-offsetY;
    -
    -    // update the buffers..
    -    // make sure to flip the y!
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -
    -    this.vertexArray[0] = x;
    -    this.vertexArray[1] = y + filterArea.height;
    -
    -    this.vertexArray[2] = x + filterArea.width;
    -    this.vertexArray[3] = y + filterArea.height;
    -
    -    this.vertexArray[4] = x;
    -    this.vertexArray[5] = y;
    -
    -    this.vertexArray[6] = x + filterArea.width;
    -    this.vertexArray[7] = y;
    -
    -    gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    -
    -    this.uvArray[2] = filterArea.width/this.width;
    -    this.uvArray[5] = filterArea.height/this.height;
    -    this.uvArray[6] = filterArea.width/this.width;
    -    this.uvArray[7] = filterArea.height/this.height;
    -
    -    gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray);
    -
    -    gl.viewport(0, 0, sizeX, sizeY);
    -
    -    // bind the buffer
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, buffer );
    -
    -    // set the blend mode! 
    -    //gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA)
    -
    -    // set texture
    -    gl.activeTexture(gl.TEXTURE0);
    -    gl.bindTexture(gl.TEXTURE_2D, texture.texture);
    -
    -    // apply!
    -    this.applyFilterPass(filter, filterArea, sizeX, sizeY);
    -
    -    // now restore the regular shader.. should happen automatically now..
    -    // this.renderSession.shaderManager.setShader(this.defaultShader);
    -    // gl.uniform2f(this.defaultShader.projectionVector, sizeX/2, -sizeY/2);
    -    // gl.uniform2f(this.defaultShader.offsetVector, -offsetX, -offsetY);
    -
    -    // return the texture to the pool
    -    this.texturePool.push(texture);
    -    filterBlock._glFilterTexture = null;
    -};
    -
    -
    -/**
    -* Applies the filter to the specified area.
    -* 
    -* @method applyFilterPass
    -* @param filter {AbstractFilter} the filter that needs to be applied
    -* @param filterArea {Texture} TODO - might need an update
    -* @param width {Number} the horizontal range of the filter
    -* @param height {Number} the vertical range of the filter
    -*/
    -PIXI.WebGLFilterManager.prototype.applyFilterPass = function(filter, filterArea, width, height)
    -{
    -    // use program
    -    var gl = this.gl;
    -    var shader = filter.shaders[gl.id];
    -
    -    if(!shader)
    -    {
    -        shader = new PIXI.PixiShader(gl);
    -
    -        shader.fragmentSrc = filter.fragmentSrc;
    -        shader.uniforms = filter.uniforms;
    -        shader.init();
    -
    -        filter.shaders[gl.id] = shader;
    -    }
    -
    -    // set the shader
    -    this.renderSession.shaderManager.setShader(shader);
    -
    -//    gl.useProgram(shader.program);
    -
    -    gl.uniform2f(shader.projectionVector, width/2, -height/2);
    -    gl.uniform2f(shader.offsetVector, 0,0);
    -
    -    if(filter.uniforms.dimensions)
    -    {
    -        filter.uniforms.dimensions.value[0] = this.width;//width;
    -        filter.uniforms.dimensions.value[1] = this.height;//height;
    -        filter.uniforms.dimensions.value[2] = this.vertexArray[0];
    -        filter.uniforms.dimensions.value[3] = this.vertexArray[5];//filterArea.height;
    -    }
    -
    -    shader.syncUniforms();
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -    gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    -    gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    -    gl.vertexAttribPointer(shader.colorAttribute, 2, gl.FLOAT, false, 0, 0);
    -
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -
    -    // draw the filter...
    -    gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 );
    -
    -    this.renderSession.drawCount++;
    -};
    -
    -/**
    -* Initialises the shader buffers.
    -* 
    -* @method initShaderBuffers
    -*/
    -PIXI.WebGLFilterManager.prototype.initShaderBuffers = function()
    -{
    -    var gl = this.gl;
    -
    -    // create some buffers
    -    this.vertexBuffer = gl.createBuffer();
    -    this.uvBuffer = gl.createBuffer();
    -    this.colorBuffer = gl.createBuffer();
    -    this.indexBuffer = gl.createBuffer();
    -
    -    // bind and upload the vertexs..
    -    // keep a reference to the vertexFloatData..
    -    this.vertexArray = new PIXI.Float32Array([0.0, 0.0,
    -                                         1.0, 0.0,
    -                                         0.0, 1.0,
    -                                         1.0, 1.0]);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.vertexArray, gl.STATIC_DRAW);
    -
    -    // bind and upload the uv buffer
    -    this.uvArray = new PIXI.Float32Array([0.0, 0.0,
    -                                     1.0, 0.0,
    -                                     0.0, 1.0,
    -                                     1.0, 1.0]);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.uvArray, gl.STATIC_DRAW);
    -
    -    this.colorArray = new PIXI.Float32Array([1.0, 0xFFFFFF,
    -                                        1.0, 0xFFFFFF,
    -                                        1.0, 0xFFFFFF,
    -                                        1.0, 0xFFFFFF]);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.colorArray, gl.STATIC_DRAW);
    -
    -    // bind and upload the index
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 1, 3, 2]), gl.STATIC_DRAW);
    -
    -};
    -
    -/**
    -* Destroys the filter and removes it from the filter stack.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLFilterManager.prototype.destroy = function()
    -{
    -    var gl = this.gl;
    -
    -    this.filterStack = null;
    -    
    -    this.offsetX = 0;
    -    this.offsetY = 0;
    -
    -    // destroy textures
    -    for (var i = 0; i < this.texturePool.length; i++) {
    -        this.texturePool[i].destroy();
    -    }
    -    
    -    this.texturePool = null;
    -
    -    //destroy buffers..
    -    gl.deleteBuffer(this.vertexBuffer);
    -    gl.deleteBuffer(this.uvBuffer);
    -    gl.deleteBuffer(this.colorBuffer);
    -    gl.deleteBuffer(this.indexBuffer);
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLGraphics.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLGraphics.js.html deleted file mode 100755 index 121a416..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLGraphics.js.html +++ /dev/null @@ -1,1157 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLGraphics.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A set of functions used by the webGL renderer to draw the primitive graphics data
    - *
    - * @class WebGLGraphics
    - * @private
    - * @static
    - */
    -PIXI.WebGLGraphics = function()
    -{
    -};
    -
    -/**
    - * Renders the graphics object
    - *
    - * @static
    - * @private
    - * @method renderGraphics
    - * @param graphics {Graphics}
    - * @param renderSession {Object}
    - */
    -PIXI.WebGLGraphics.renderGraphics = function(graphics, renderSession)//projection, offset)
    -{
    -    var gl = renderSession.gl;
    -    var projection = renderSession.projection,
    -        offset = renderSession.offset,
    -        shader = renderSession.shaderManager.primitiveShader,
    -        webGLData;
    -
    -    if(graphics.dirty)
    -    {
    -        PIXI.WebGLGraphics.updateGraphics(graphics, gl);
    -    }
    -
    -    var webGL = graphics._webGL[gl.id];
    -
    -    // This  could be speeded up for sure!
    -
    -    for (var i = 0; i < webGL.data.length; i++)
    -    {
    -        if(webGL.data[i].mode === 1)
    -        {
    -            webGLData = webGL.data[i];
    -
    -            renderSession.stencilManager.pushStencil(graphics, webGLData, renderSession);
    -
    -            // render quad..
    -            gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 );
    -            
    -            renderSession.stencilManager.popStencil(graphics, webGLData, renderSession);
    -        }
    -        else
    -        {
    -            webGLData = webGL.data[i];
    -           
    -
    -            renderSession.shaderManager.setShader( shader );//activatePrimitiveShader();
    -            shader = renderSession.shaderManager.primitiveShader;
    -            gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true));
    -
    -            gl.uniform2f(shader.projectionVector, projection.x, -projection.y);
    -            gl.uniform2f(shader.offsetVector, -offset.x, -offset.y);
    -
    -            gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint));
    -
    -            gl.uniform1f(shader.alpha, graphics.worldAlpha);
    -            
    -
    -            gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer);
    -
    -            gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0);
    -            gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4);
    -
    -            // set the index buffer!
    -            gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer);
    -            gl.drawElements(gl.TRIANGLE_STRIP,  webGLData.indices.length, gl.UNSIGNED_SHORT, 0 );
    -        }
    -    }
    -};
    -
    -/**
    - * Updates the graphics object
    - *
    - * @static
    - * @private
    - * @method updateGraphics
    - * @param graphicsData {Graphics} The graphics object to update
    - * @param gl {WebGLContext} the current WebGL drawing context
    - */
    -PIXI.WebGLGraphics.updateGraphics = function(graphics, gl)
    -{
    -    // get the contexts graphics object
    -    var webGL = graphics._webGL[gl.id];
    -    // if the graphics object does not exist in the webGL context time to create it!
    -    if(!webGL)webGL = graphics._webGL[gl.id] = {lastIndex:0, data:[], gl:gl};
    -
    -    // flag the graphics as not dirty as we are about to update it...
    -    graphics.dirty = false;
    -
    -    var i;
    -
    -    // if the user cleared the graphics object we will need to clear every object
    -    if(graphics.clearDirty)
    -    {
    -        graphics.clearDirty = false;
    -
    -        // lop through and return all the webGLDatas to the object pool so than can be reused later on
    -        for (i = 0; i < webGL.data.length; i++)
    -        {
    -            var graphicsData = webGL.data[i];
    -            graphicsData.reset();
    -            PIXI.WebGLGraphics.graphicsDataPool.push( graphicsData );
    -        }
    -
    -        // clear the array and reset the index.. 
    -        webGL.data = [];
    -        webGL.lastIndex = 0;
    -    }
    -    
    -    var webGLData;
    -    
    -    // loop through the graphics datas and construct each one..
    -    // if the object is a complex fill then the new stencil buffer technique will be used
    -    // other wise graphics objects will be pushed into a batch..
    -    for (i = webGL.lastIndex; i < graphics.graphicsData.length; i++)
    -    {
    -        var data = graphics.graphicsData[i];
    -
    -        if(data.type === PIXI.Graphics.POLY)
    -        {
    -            // need to add the points the the graphics object..
    -            data.points = data.shape.points.slice();
    -            if(data.shape.closed)
    -            {
    -                // close the poly if the valu is true!
    -                if(data.points[0] !== data.points[data.points.length-2] && data.points[1] !== data.points[data.points.length-1])
    -                {
    -                    data.points.push(data.points[0], data.points[1]);
    -                }
    -            }
    -
    -            // MAKE SURE WE HAVE THE CORRECT TYPE..
    -            if(data.fill)
    -            {
    -                if(data.points.length >= 6)
    -                {
    -                    if(data.points.length > 5 * 2)
    -                    {
    -                        webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1);
    -                        PIXI.WebGLGraphics.buildComplexPoly(data, webGLData);
    -                    }
    -                    else
    -                    {
    -                        webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0);
    -                        PIXI.WebGLGraphics.buildPoly(data, webGLData);
    -                    }
    -                }
    -            }
    -
    -            if(data.lineWidth > 0)
    -            {
    -                webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0);
    -                PIXI.WebGLGraphics.buildLine(data, webGLData);
    -
    -            }
    -        }
    -        else
    -        {
    -            webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0);
    -            
    -            if(data.type === PIXI.Graphics.RECT)
    -            {
    -                PIXI.WebGLGraphics.buildRectangle(data, webGLData);
    -            }
    -            else if(data.type === PIXI.Graphics.CIRC || data.type === PIXI.Graphics.ELIP)
    -            {
    -                PIXI.WebGLGraphics.buildCircle(data, webGLData);
    -            }
    -            else if(data.type === PIXI.Graphics.RREC)
    -            {
    -                PIXI.WebGLGraphics.buildRoundedRectangle(data, webGLData);
    -            }
    -        }
    -
    -        webGL.lastIndex++;
    -    }
    -
    -    // upload all the dirty data...
    -    for (i = 0; i < webGL.data.length; i++)
    -    {
    -        webGLData = webGL.data[i];
    -        if(webGLData.dirty)webGLData.upload();
    -    }
    -};
    -
    -/**
    - * @static
    - * @private
    - * @method switchMode
    - * @param webGL {WebGLContext}
    - * @param type {Number}
    - */
    -PIXI.WebGLGraphics.switchMode = function(webGL, type)
    -{
    -    var webGLData;
    -
    -    if(!webGL.data.length)
    -    {
    -        webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl);
    -        webGLData.mode = type;
    -        webGL.data.push(webGLData);
    -    }
    -    else
    -    {
    -        webGLData = webGL.data[webGL.data.length-1];
    -
    -        if(webGLData.mode !== type || type === 1)
    -        {
    -            webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl);
    -            webGLData.mode = type;
    -            webGL.data.push(webGLData);
    -        }
    -    }
    -
    -    webGLData.dirty = true;
    -
    -    return webGLData;
    -};
    -
    -/**
    - * Builds a rectangle to draw
    - *
    - * @static
    - * @private
    - * @method buildRectangle
    - * @param graphicsData {Graphics} The graphics object containing all the necessary properties
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildRectangle = function(graphicsData, webGLData)
    -{
    -    // --- //
    -    // need to convert points to a nice regular data
    -    //
    -    var rectData = graphicsData.shape;
    -    var x = rectData.x;
    -    var y = rectData.y;
    -    var width = rectData.width;
    -    var height = rectData.height;
    -
    -    if(graphicsData.fill)
    -    {
    -        var color = PIXI.hex2rgb(graphicsData.fillColor);
    -        var alpha = graphicsData.fillAlpha;
    -
    -        var r = color[0] * alpha;
    -        var g = color[1] * alpha;
    -        var b = color[2] * alpha;
    -
    -        var verts = webGLData.points;
    -        var indices = webGLData.indices;
    -
    -        var vertPos = verts.length/6;
    -
    -        // start
    -        verts.push(x, y);
    -        verts.push(r, g, b, alpha);
    -
    -        verts.push(x + width, y);
    -        verts.push(r, g, b, alpha);
    -
    -        verts.push(x , y + height);
    -        verts.push(r, g, b, alpha);
    -
    -        verts.push(x + width, y + height);
    -        verts.push(r, g, b, alpha);
    -
    -        // insert 2 dead triangles..
    -        indices.push(vertPos, vertPos, vertPos+1, vertPos+2, vertPos+3, vertPos+3);
    -    }
    -
    -    if(graphicsData.lineWidth)
    -    {
    -        var tempPoints = graphicsData.points;
    -
    -        graphicsData.points = [x, y,
    -                  x + width, y,
    -                  x + width, y + height,
    -                  x, y + height,
    -                  x, y];
    -
    -
    -        PIXI.WebGLGraphics.buildLine(graphicsData, webGLData);
    -
    -        graphicsData.points = tempPoints;
    -    }
    -};
    -
    -/**
    - * Builds a rounded rectangle to draw
    - *
    - * @static
    - * @private
    - * @method buildRoundedRectangle
    - * @param graphicsData {Graphics} The graphics object containing all the necessary properties
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildRoundedRectangle = function(graphicsData, webGLData)
    -{
    -    var rrectData = graphicsData.shape;
    -    var x = rrectData.x;
    -    var y = rrectData.y;
    -    var width = rrectData.width;
    -    var height = rrectData.height;
    -
    -    var radius = rrectData.radius;
    -
    -    var recPoints = [];
    -    recPoints.push(x, y + radius);
    -    recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x, y + height - radius, x, y + height, x + radius, y + height));
    -    recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius));
    -    recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width, y + radius, x + width, y, x + width - radius, y));
    -    recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + radius, y, x, y, x, y + radius));
    -
    -    if (graphicsData.fill) {
    -        var color = PIXI.hex2rgb(graphicsData.fillColor);
    -        var alpha = graphicsData.fillAlpha;
    -
    -        var r = color[0] * alpha;
    -        var g = color[1] * alpha;
    -        var b = color[2] * alpha;
    -
    -        var verts = webGLData.points;
    -        var indices = webGLData.indices;
    -
    -        var vecPos = verts.length/6;
    -
    -        var triangles = PIXI.PolyK.Triangulate(recPoints);
    -
    -        var i = 0;
    -        for (i = 0; i < triangles.length; i+=3)
    -        {
    -            indices.push(triangles[i] + vecPos);
    -            indices.push(triangles[i] + vecPos);
    -            indices.push(triangles[i+1] + vecPos);
    -            indices.push(triangles[i+2] + vecPos);
    -            indices.push(triangles[i+2] + vecPos);
    -        }
    -
    -        for (i = 0; i < recPoints.length; i++)
    -        {
    -            verts.push(recPoints[i], recPoints[++i], r, g, b, alpha);
    -        }
    -    }
    -
    -    if (graphicsData.lineWidth) {
    -        var tempPoints = graphicsData.points;
    -
    -        graphicsData.points = recPoints;
    -
    -        PIXI.WebGLGraphics.buildLine(graphicsData, webGLData);
    -
    -        graphicsData.points = tempPoints;
    -    }
    -};
    -
    -/**
    - * Calculate the points for a quadratic bezier curve. (helper function..)
    - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c
    - *
    - * @static
    - * @private
    - * @method quadraticBezierCurve
    - * @param fromX {Number} Origin point x
    - * @param fromY {Number} Origin point x
    - * @param cpX {Number} Control point x
    - * @param cpY {Number} Control point y
    - * @param toX {Number} Destination point x
    - * @param toY {Number} Destination point y
    - * @return {Array<Number>}
    - */
    -PIXI.WebGLGraphics.quadraticBezierCurve = function(fromX, fromY, cpX, cpY, toX, toY) {
    -
    -    var xa,
    -        ya,
    -        xb,
    -        yb,
    -        x,
    -        y,
    -        n = 20,
    -        points = [];
    -
    -    function getPt(n1 , n2, perc) {
    -        var diff = n2 - n1;
    -
    -        return n1 + ( diff * perc );
    -    }
    -
    -    var j = 0;
    -    for (var i = 0; i <= n; i++ )
    -    {
    -        j = i / n;
    -
    -        // The Green Line
    -        xa = getPt( fromX , cpX , j );
    -        ya = getPt( fromY , cpY , j );
    -        xb = getPt( cpX , toX , j );
    -        yb = getPt( cpY , toY , j );
    -
    -        // The Black Dot
    -        x = getPt( xa , xb , j );
    -        y = getPt( ya , yb , j );
    -
    -        points.push(x, y);
    -    }
    -    return points;
    -};
    -
    -/**
    - * Builds a circle to draw
    - *
    - * @static
    - * @private
    - * @method buildCircle
    - * @param graphicsData {Graphics} The graphics object to draw
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildCircle = function(graphicsData, webGLData)
    -{
    -    // need to convert points to a nice regular data
    -    var circleData = graphicsData.shape;
    -    var x = circleData.x;
    -    var y = circleData.y;
    -    var width;
    -    var height;
    -    
    -    // TODO - bit hacky??
    -    if(graphicsData.type === PIXI.Graphics.CIRC)
    -    {
    -        width = circleData.radius;
    -        height = circleData.radius;
    -    }
    -    else
    -    {
    -        width = circleData.width;
    -        height = circleData.height;
    -    }
    -
    -    var totalSegs = 40;
    -    var seg = (Math.PI * 2) / totalSegs ;
    -
    -    var i = 0;
    -
    -    if(graphicsData.fill)
    -    {
    -        var color = PIXI.hex2rgb(graphicsData.fillColor);
    -        var alpha = graphicsData.fillAlpha;
    -
    -        var r = color[0] * alpha;
    -        var g = color[1] * alpha;
    -        var b = color[2] * alpha;
    -
    -        var verts = webGLData.points;
    -        var indices = webGLData.indices;
    -
    -        var vecPos = verts.length/6;
    -
    -        indices.push(vecPos);
    -
    -        for (i = 0; i < totalSegs + 1 ; i++)
    -        {
    -            verts.push(x,y, r, g, b, alpha);
    -
    -            verts.push(x + Math.sin(seg * i) * width,
    -                       y + Math.cos(seg * i) * height,
    -                       r, g, b, alpha);
    -
    -            indices.push(vecPos++, vecPos++);
    -        }
    -
    -        indices.push(vecPos-1);
    -    }
    -
    -    if(graphicsData.lineWidth)
    -    {
    -        var tempPoints = graphicsData.points;
    -
    -        graphicsData.points = [];
    -
    -        for (i = 0; i < totalSegs + 1; i++)
    -        {
    -            graphicsData.points.push(x + Math.sin(seg * i) * width,
    -                                     y + Math.cos(seg * i) * height);
    -        }
    -
    -        PIXI.WebGLGraphics.buildLine(graphicsData, webGLData);
    -
    -        graphicsData.points = tempPoints;
    -    }
    -};
    -
    -/**
    - * Builds a line to draw
    - *
    - * @static
    - * @private
    - * @method buildLine
    - * @param graphicsData {Graphics} The graphics object containing all the necessary properties
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildLine = function(graphicsData, webGLData)
    -{
    -    // TODO OPTIMISE!
    -    var i = 0;
    -    var points = graphicsData.points;
    -    if(points.length === 0)return;
    -
    -    // if the line width is an odd number add 0.5 to align to a whole pixel
    -    if(graphicsData.lineWidth%2)
    -    {
    -        for (i = 0; i < points.length; i++) {
    -            points[i] += 0.5;
    -        }
    -    }
    -
    -    // get first and last point.. figure out the middle!
    -    var firstPoint = new PIXI.Point( points[0], points[1] );
    -    var lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] );
    -
    -    // if the first point is the last point - gonna have issues :)
    -    if(firstPoint.x === lastPoint.x && firstPoint.y === lastPoint.y)
    -    {
    -        // need to clone as we are going to slightly modify the shape..
    -        points = points.slice();
    -
    -        points.pop();
    -        points.pop();
    -
    -        lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] );
    -
    -        var midPointX = lastPoint.x + (firstPoint.x - lastPoint.x) *0.5;
    -        var midPointY = lastPoint.y + (firstPoint.y - lastPoint.y) *0.5;
    -
    -        points.unshift(midPointX, midPointY);
    -        points.push(midPointX, midPointY);
    -    }
    -
    -    var verts = webGLData.points;
    -    var indices = webGLData.indices;
    -    var length = points.length / 2;
    -    var indexCount = points.length;
    -    var indexStart = verts.length/6;
    -
    -    // DRAW the Line
    -    var width = graphicsData.lineWidth / 2;
    -
    -    // sort color
    -    var color = PIXI.hex2rgb(graphicsData.lineColor);
    -    var alpha = graphicsData.lineAlpha;
    -    var r = color[0] * alpha;
    -    var g = color[1] * alpha;
    -    var b = color[2] * alpha;
    -
    -    var px, py, p1x, p1y, p2x, p2y, p3x, p3y;
    -    var perpx, perpy, perp2x, perp2y, perp3x, perp3y;
    -    var a1, b1, c1, a2, b2, c2;
    -    var denom, pdist, dist;
    -
    -    p1x = points[0];
    -    p1y = points[1];
    -
    -    p2x = points[2];
    -    p2y = points[3];
    -
    -    perpx = -(p1y - p2y);
    -    perpy =  p1x - p2x;
    -
    -    dist = Math.sqrt(perpx*perpx + perpy*perpy);
    -
    -    perpx /= dist;
    -    perpy /= dist;
    -    perpx *= width;
    -    perpy *= width;
    -
    -    // start
    -    verts.push(p1x - perpx , p1y - perpy,
    -                r, g, b, alpha);
    -
    -    verts.push(p1x + perpx , p1y + perpy,
    -                r, g, b, alpha);
    -
    -    for (i = 1; i < length-1; i++)
    -    {
    -        p1x = points[(i-1)*2];
    -        p1y = points[(i-1)*2 + 1];
    -
    -        p2x = points[(i)*2];
    -        p2y = points[(i)*2 + 1];
    -
    -        p3x = points[(i+1)*2];
    -        p3y = points[(i+1)*2 + 1];
    -
    -        perpx = -(p1y - p2y);
    -        perpy = p1x - p2x;
    -
    -        dist = Math.sqrt(perpx*perpx + perpy*perpy);
    -        perpx /= dist;
    -        perpy /= dist;
    -        perpx *= width;
    -        perpy *= width;
    -
    -        perp2x = -(p2y - p3y);
    -        perp2y = p2x - p3x;
    -
    -        dist = Math.sqrt(perp2x*perp2x + perp2y*perp2y);
    -        perp2x /= dist;
    -        perp2y /= dist;
    -        perp2x *= width;
    -        perp2y *= width;
    -
    -        a1 = (-perpy + p1y) - (-perpy + p2y);
    -        b1 = (-perpx + p2x) - (-perpx + p1x);
    -        c1 = (-perpx + p1x) * (-perpy + p2y) - (-perpx + p2x) * (-perpy + p1y);
    -        a2 = (-perp2y + p3y) - (-perp2y + p2y);
    -        b2 = (-perp2x + p2x) - (-perp2x + p3x);
    -        c2 = (-perp2x + p3x) * (-perp2y + p2y) - (-perp2x + p2x) * (-perp2y + p3y);
    -
    -        denom = a1*b2 - a2*b1;
    -
    -        if(Math.abs(denom) < 0.1 )
    -        {
    -
    -            denom+=10.1;
    -            verts.push(p2x - perpx , p2y - perpy,
    -                r, g, b, alpha);
    -
    -            verts.push(p2x + perpx , p2y + perpy,
    -                r, g, b, alpha);
    -
    -            continue;
    -        }
    -
    -        px = (b1*c2 - b2*c1)/denom;
    -        py = (a2*c1 - a1*c2)/denom;
    -
    -
    -        pdist = (px -p2x) * (px -p2x) + (py -p2y) + (py -p2y);
    -
    -
    -        if(pdist > 140 * 140)
    -        {
    -            perp3x = perpx - perp2x;
    -            perp3y = perpy - perp2y;
    -
    -            dist = Math.sqrt(perp3x*perp3x + perp3y*perp3y);
    -            perp3x /= dist;
    -            perp3y /= dist;
    -            perp3x *= width;
    -            perp3y *= width;
    -
    -            verts.push(p2x - perp3x, p2y -perp3y);
    -            verts.push(r, g, b, alpha);
    -
    -            verts.push(p2x + perp3x, p2y +perp3y);
    -            verts.push(r, g, b, alpha);
    -
    -            verts.push(p2x - perp3x, p2y -perp3y);
    -            verts.push(r, g, b, alpha);
    -
    -            indexCount++;
    -        }
    -        else
    -        {
    -
    -            verts.push(px , py);
    -            verts.push(r, g, b, alpha);
    -
    -            verts.push(p2x - (px-p2x), p2y - (py - p2y));
    -            verts.push(r, g, b, alpha);
    -        }
    -    }
    -
    -    p1x = points[(length-2)*2];
    -    p1y = points[(length-2)*2 + 1];
    -
    -    p2x = points[(length-1)*2];
    -    p2y = points[(length-1)*2 + 1];
    -
    -    perpx = -(p1y - p2y);
    -    perpy = p1x - p2x;
    -
    -    dist = Math.sqrt(perpx*perpx + perpy*perpy);
    -    perpx /= dist;
    -    perpy /= dist;
    -    perpx *= width;
    -    perpy *= width;
    -
    -    verts.push(p2x - perpx , p2y - perpy);
    -    verts.push(r, g, b, alpha);
    -
    -    verts.push(p2x + perpx , p2y + perpy);
    -    verts.push(r, g, b, alpha);
    -
    -    indices.push(indexStart);
    -
    -    for (i = 0; i < indexCount; i++)
    -    {
    -        indices.push(indexStart++);
    -    }
    -
    -    indices.push(indexStart-1);
    -};
    -
    -/**
    - * Builds a complex polygon to draw
    - *
    - * @static
    - * @private
    - * @method buildComplexPoly
    - * @param graphicsData {Graphics} The graphics object containing all the necessary properties
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildComplexPoly = function(graphicsData, webGLData)
    -{
    -    //TODO - no need to copy this as it gets turned into a FLoat32Array anyways..
    -    var points = graphicsData.points.slice();
    -    if(points.length < 6)return;
    -
    -    // get first and last point.. figure out the middle!
    -    var indices = webGLData.indices;
    -    webGLData.points = points;
    -    webGLData.alpha = graphicsData.fillAlpha;
    -    webGLData.color = PIXI.hex2rgb(graphicsData.fillColor);
    -
    -    /*
    -        calclate the bounds..
    -    */
    -    var minX = Infinity;
    -    var maxX = -Infinity;
    -
    -    var minY = Infinity;
    -    var maxY = -Infinity;
    -
    -    var x,y;
    -
    -    // get size..
    -    for (var i = 0; i < points.length; i+=2)
    -    {
    -        x = points[i];
    -        y = points[i+1];
    -
    -        minX = x < minX ? x : minX;
    -        maxX = x > maxX ? x : maxX;
    -
    -        minY = y < minY ? y : minY;
    -        maxY = y > maxY ? y : maxY;
    -    }
    -
    -    // add a quad to the end cos there is no point making another buffer!
    -    points.push(minX, minY,
    -                maxX, minY,
    -                maxX, maxY,
    -                minX, maxY);
    -
    -    // push a quad onto the end.. 
    -    
    -    //TODO - this aint needed!
    -    var length = points.length / 2;
    -    for (i = 0; i < length; i++)
    -    {
    -        indices.push( i );
    -    }
    -
    -};
    -
    -/**
    - * Builds a polygon to draw
    - *
    - * @static
    - * @private
    - * @method buildPoly
    - * @param graphicsData {Graphics} The graphics object containing all the necessary properties
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildPoly = function(graphicsData, webGLData)
    -{
    -    var points = graphicsData.points;
    -
    -    if(points.length < 6)return;
    -    // get first and last point.. figure out the middle!
    -    var verts = webGLData.points;
    -    var indices = webGLData.indices;
    -
    -    var length = points.length / 2;
    -
    -    // sort color
    -    var color = PIXI.hex2rgb(graphicsData.fillColor);
    -    var alpha = graphicsData.fillAlpha;
    -    var r = color[0] * alpha;
    -    var g = color[1] * alpha;
    -    var b = color[2] * alpha;
    -
    -    var triangles = PIXI.PolyK.Triangulate(points);
    -    var vertPos = verts.length / 6;
    -
    -    var i = 0;
    -
    -    for (i = 0; i < triangles.length; i+=3)
    -    {
    -        indices.push(triangles[i] + vertPos);
    -        indices.push(triangles[i] + vertPos);
    -        indices.push(triangles[i+1] + vertPos);
    -        indices.push(triangles[i+2] +vertPos);
    -        indices.push(triangles[i+2] + vertPos);
    -    }
    -
    -    for (i = 0; i < length; i++)
    -    {
    -        verts.push(points[i * 2], points[i * 2 + 1],
    -                   r, g, b, alpha);
    -    }
    -
    -};
    -
    -PIXI.WebGLGraphics.graphicsDataPool = [];
    -
    -/**
    - * @class WebGLGraphicsData
    - * @private
    - * @static
    - */
    -PIXI.WebGLGraphicsData = function(gl)
    -{
    -    this.gl = gl;
    -
    -    //TODO does this need to be split before uploding??
    -    this.color = [0,0,0]; // color split!
    -    this.points = [];
    -    this.indices = [];
    -    this.lastIndex = 0;
    -    this.buffer = gl.createBuffer();
    -    this.indexBuffer = gl.createBuffer();
    -    this.mode = 1;
    -    this.alpha = 1;
    -    this.dirty = true;
    -};
    -
    -/**
    - * @method reset
    - */
    -PIXI.WebGLGraphicsData.prototype.reset = function()
    -{
    -    this.points = [];
    -    this.indices = [];
    -    this.lastIndex = 0;
    -};
    -
    -/**
    - * @method upload
    - */
    -PIXI.WebGLGraphicsData.prototype.upload = function()
    -{
    -    var gl = this.gl;
    -
    -//    this.lastIndex = graphics.graphicsData.length;
    -    this.glPoints = new PIXI.Float32Array(this.points);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.glPoints, gl.STATIC_DRAW);
    -
    -    this.glIndicies = new PIXI.Uint16Array(this.indices);
    -
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.glIndicies, gl.STATIC_DRAW);
    -
    -    this.dirty = false;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLMaskManager.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLMaskManager.js.html deleted file mode 100755 index 40c6e1f..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLMaskManager.js.html +++ /dev/null @@ -1,347 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLMaskManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class WebGLMaskManager
    -* @constructor
    -* @private
    -*/
    -PIXI.WebGLMaskManager = function()
    -{
    -};
    -
    -PIXI.WebGLMaskManager.prototype.constructor = PIXI.WebGLMaskManager;
    -
    -/**
    -* Sets the drawing context to the one given in parameter.
    -* 
    -* @method setContext 
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLMaskManager.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -};
    -
    -/**
    -* Applies the Mask and adds it to the current filter stack.
    -* 
    -* @method pushMask
    -* @param maskData {Array}
    -* @param renderSession {Object}
    -*/
    -PIXI.WebGLMaskManager.prototype.pushMask = function(maskData, renderSession)
    -{
    -    var gl = renderSession.gl;
    -
    -    if(maskData.dirty)
    -    {
    -        PIXI.WebGLGraphics.updateGraphics(maskData, gl);
    -    }
    -
    -    if(!maskData._webGL[gl.id].data.length)return;
    -
    -    renderSession.stencilManager.pushStencil(maskData, maskData._webGL[gl.id].data[0], renderSession);
    -};
    -
    -/**
    -* Removes the last filter from the filter stack and doesn't return it.
    -* 
    -* @method popMask
    -* @param maskData {Array}
    -* @param renderSession {Object} an object containing all the useful parameters
    -*/
    -PIXI.WebGLMaskManager.prototype.popMask = function(maskData, renderSession)
    -{
    -    var gl = this.gl;
    -    renderSession.stencilManager.popStencil(maskData, maskData._webGL[gl.id].data[0], renderSession);
    -};
    -
    -/**
    -* Destroys the mask stack.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLMaskManager.prototype.destroy = function()
    -{
    -    this.gl = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderManager.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderManager.js.html deleted file mode 100755 index 89f1c45..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderManager.js.html +++ /dev/null @@ -1,435 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLShaderManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class WebGLShaderManager
    -* @constructor
    -* @private
    -*/
    -PIXI.WebGLShaderManager = function()
    -{
    -    /**
    -     * @property maxAttibs
    -     * @type Number
    -     */
    -    this.maxAttibs = 10;
    -
    -    /**
    -     * @property attribState
    -     * @type Array
    -     */
    -    this.attribState = [];
    -
    -    /**
    -     * @property tempAttribState
    -     * @type Array
    -     */
    -    this.tempAttribState = [];
    -
    -    for (var i = 0; i < this.maxAttibs; i++)
    -    {
    -        this.attribState[i] = false;
    -    }
    -
    -    /**
    -     * @property stack
    -     * @type Array
    -     */
    -    this.stack = [];
    -
    -};
    -
    -PIXI.WebGLShaderManager.prototype.constructor = PIXI.WebGLShaderManager;
    -
    -/**
    -* Initialises the context and the properties.
    -* 
    -* @method setContext 
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLShaderManager.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -    
    -    // the next one is used for rendering primitives
    -    this.primitiveShader = new PIXI.PrimitiveShader(gl);
    -
    -    // the next one is used for rendering triangle strips
    -    this.complexPrimitiveShader = new PIXI.ComplexPrimitiveShader(gl);
    -
    -    // this shader is used for the default sprite rendering
    -    this.defaultShader = new PIXI.PixiShader(gl);
    -
    -    // this shader is used for the fast sprite rendering
    -    this.fastShader = new PIXI.PixiFastShader(gl);
    -
    -    // the next one is used for rendering triangle strips
    -    this.stripShader = new PIXI.StripShader(gl);
    -    this.setShader(this.defaultShader);
    -};
    -
    -/**
    -* Takes the attributes given in parameters.
    -* 
    -* @method setAttribs
    -* @param attribs {Array} attribs 
    -*/
    -PIXI.WebGLShaderManager.prototype.setAttribs = function(attribs)
    -{
    -    // reset temp state
    -    var i;
    -
    -    for (i = 0; i < this.tempAttribState.length; i++)
    -    {
    -        this.tempAttribState[i] = false;
    -    }
    -
    -    // set the new attribs
    -    for (i = 0; i < attribs.length; i++)
    -    {
    -        var attribId = attribs[i];
    -        this.tempAttribState[attribId] = true;
    -    }
    -
    -    var gl = this.gl;
    -
    -    for (i = 0; i < this.attribState.length; i++)
    -    {
    -        if(this.attribState[i] !== this.tempAttribState[i])
    -        {
    -            this.attribState[i] = this.tempAttribState[i];
    -
    -            if(this.tempAttribState[i])
    -            {
    -                gl.enableVertexAttribArray(i);
    -            }
    -            else
    -            {
    -                gl.disableVertexAttribArray(i);
    -            }
    -        }
    -    }
    -};
    -
    -/**
    -* Sets the current shader.
    -* 
    -* @method setShader
    -* @param shader {Any}
    -*/
    -PIXI.WebGLShaderManager.prototype.setShader = function(shader)
    -{
    -    if(this._currentId === shader._UID)return false;
    -    
    -    this._currentId = shader._UID;
    -
    -    this.currentShader = shader;
    -
    -    this.gl.useProgram(shader.program);
    -    this.setAttribs(shader.attributes);
    -
    -    return true;
    -};
    -
    -/**
    -* Destroys this object.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLShaderManager.prototype.destroy = function()
    -{
    -    this.attribState = null;
    -
    -    this.tempAttribState = null;
    -
    -    this.primitiveShader.destroy();
    -
    -    this.complexPrimitiveShader.destroy();
    -
    -    this.defaultShader.destroy();
    -
    -    this.fastShader.destroy();
    -
    -    this.stripShader.destroy();
    -
    -    this.gl = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderUtils.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderUtils.js.html deleted file mode 100755 index eabb242..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderUtils.js.html +++ /dev/null @@ -1,366 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLShaderUtils.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @method initDefaultShaders
    -* @static
    -* @private
    -*/
    -PIXI.initDefaultShaders = function()
    -{
    -};
    -
    -/**
    -* @method CompileVertexShader
    -* @static
    -* @param gl {WebGLContext} the current WebGL drawing context
    -* @param shaderSrc {Array}
    -* @return {Any}
    -*/
    -PIXI.CompileVertexShader = function(gl, shaderSrc)
    -{
    -    return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER);
    -};
    -
    -/**
    -* @method CompileFragmentShader
    -* @static
    -* @param gl {WebGLContext} the current WebGL drawing context
    -* @param shaderSrc {Array}
    -* @return {Any}
    -*/
    -PIXI.CompileFragmentShader = function(gl, shaderSrc)
    -{
    -    return PIXI._CompileShader(gl, shaderSrc, gl.FRAGMENT_SHADER);
    -};
    -
    -/**
    -* @method _CompileShader
    -* @static
    -* @private
    -* @param gl {WebGLContext} the current WebGL drawing context
    -* @param shaderSrc {Array}
    -* @param shaderType {Number}
    -* @return {Any}
    -*/
    -PIXI._CompileShader = function(gl, shaderSrc, shaderType)
    -{
    -    var src = shaderSrc.join("\n");
    -    var shader = gl.createShader(shaderType);
    -    gl.shaderSource(shader, src);
    -    gl.compileShader(shader);
    -
    -    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS))
    -    {
    -        window.console.log(gl.getShaderInfoLog(shader));
    -        return null;
    -    }
    -
    -    return shader;
    -};
    -
    -/**
    -* @method compileProgram
    -* @static
    -* @param gl {WebGLContext} the current WebGL drawing context
    -* @param vertexSrc {Array}
    -* @param fragmentSrc {Array}
    -* @return {Any}
    -*/
    -PIXI.compileProgram = function(gl, vertexSrc, fragmentSrc)
    -{
    -    var fragmentShader = PIXI.CompileFragmentShader(gl, fragmentSrc);
    -    var vertexShader = PIXI.CompileVertexShader(gl, vertexSrc);
    -
    -    var shaderProgram = gl.createProgram();
    -
    -    gl.attachShader(shaderProgram, vertexShader);
    -    gl.attachShader(shaderProgram, fragmentShader);
    -    gl.linkProgram(shaderProgram);
    -
    -    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS))
    -    {
    -        window.console.log("Could not initialise shaders");
    -    }
    -
    -    return shaderProgram;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLSpriteBatch.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLSpriteBatch.js.html deleted file mode 100755 index dd2dd3e..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLSpriteBatch.js.html +++ /dev/null @@ -1,883 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js

    - -
    -
    -/**
    - * @author Mat Groves
    - * 
    - * Big thanks to the very clever Matt DesLauriers <mattdesl> https://github.com/mattdesl/
    - * for creating the original pixi version!
    - *
    - * Heavily inspired by LibGDX's WebGLSpriteBatch:
    - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java
    - */
    -
    - /**
    - *
    - * @class WebGLSpriteBatch
    - * @private
    - * @constructor
    - */
    -PIXI.WebGLSpriteBatch = function()
    -{
    -    /**
    -     * @property vertSize
    -     * @type Number
    -     */
    -    this.vertSize = 6;
    -
    -    /**
    -     * The number of images in the SpriteBatch before it flushes
    -     * @property size
    -     * @type Number
    -     */
    -    this.size = 2000;//Math.pow(2, 16) /  this.vertSize;
    -
    -    //the total number of floats in our batch
    -    var numVerts = this.size * 4 *  this.vertSize;
    -    //the total number of indices in our batch
    -    var numIndices = this.size * 6;
    -
    -    /**
    -    * Holds the vertices
    -    *
    -    * @property vertices
    -    * @type Float32Array
    -    */
    -    this.vertices = new PIXI.Float32Array(numVerts);
    -
    -    /**
    -     * Holds the indices
    -     *
    -     * @property indices
    -     * @type Uint16Array
    -     */
    -    this.indices = new PIXI.Uint16Array(numIndices);
    -    
    -    /**
    -     * @property lastIndexCount
    -     * @type Number
    -     */
    -    this.lastIndexCount = 0;
    -
    -    for (var i=0, j=0; i < numIndices; i += 6, j += 4)
    -    {
    -        this.indices[i + 0] = j + 0;
    -        this.indices[i + 1] = j + 1;
    -        this.indices[i + 2] = j + 2;
    -        this.indices[i + 3] = j + 0;
    -        this.indices[i + 4] = j + 2;
    -        this.indices[i + 5] = j + 3;
    -    }
    -
    -    /**
    -     * @property drawing
    -     * @type Boolean
    -     */
    -    this.drawing = false;
    -
    -    /**
    -     * @property currentBatchSize
    -     * @type Number
    -     */
    -    this.currentBatchSize = 0;
    -
    -    /**
    -     * @property currentBaseTexture
    -     * @type BaseTexture
    -     */
    -    this.currentBaseTexture = null;
    -
    -    /**
    -     * @property dirty
    -     * @type Boolean
    -     */
    -    this.dirty = true;
    -
    -    /**
    -     * @property textures
    -     * @type Array
    -     */
    -    this.textures = [];
    -
    -    /**
    -     * @property blendModes
    -     * @type Array
    -     */
    -    this.blendModes = [];
    -
    -    /**
    -     * @property shaders
    -     * @type Array
    -     */
    -    this.shaders = [];
    -
    -    /**
    -     * @property sprites
    -     * @type Array
    -     */
    -    this.sprites = [];
    -
    -    /**
    -     * @property defaultShader
    -     * @type AbstractFilter
    -     */
    -    this.defaultShader = new PIXI.AbstractFilter([
    -        'precision lowp float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D uSampler;',
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;',
    -        '}'
    -    ]);
    -};
    -
    -/**
    -* @method setContext
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLSpriteBatch.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -
    -    // create a couple of buffers
    -    this.vertexBuffer = gl.createBuffer();
    -    this.indexBuffer = gl.createBuffer();
    -
    -    // 65535 is max index, so 65535 / 6 = 10922.
    -
    -    //upload the index data
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW);
    -
    -    this.currentBlendMode = 99999;
    -
    -    var shader = new PIXI.PixiShader(gl);
    -
    -    shader.fragmentSrc = this.defaultShader.fragmentSrc;
    -    shader.uniforms = {};
    -    shader.init();
    -
    -    this.defaultShader.shaders[gl.id] = shader;
    -};
    -
    -/**
    -* @method begin
    -* @param renderSession {Object} The RenderSession object
    -*/
    -PIXI.WebGLSpriteBatch.prototype.begin = function(renderSession)
    -{
    -    this.renderSession = renderSession;
    -    this.shader = this.renderSession.shaderManager.defaultShader;
    -
    -    this.start();
    -};
    -
    -/**
    -* @method end
    -*/
    -PIXI.WebGLSpriteBatch.prototype.end = function()
    -{
    -    this.flush();
    -};
    -
    -/**
    -* @method render
    -* @param sprite {Sprite} the sprite to render when using this spritebatch
    -*/
    -PIXI.WebGLSpriteBatch.prototype.render = function(sprite)
    -{
    -    var texture = sprite.texture;
    -    
    -   //TODO set blend modes.. 
    -    // check texture..
    -    if(this.currentBatchSize >= this.size)
    -    {
    -        this.flush();
    -        this.currentBaseTexture = texture.baseTexture;
    -    }
    -
    -    // get the uvs for the texture
    -    var uvs = texture._uvs;
    -    // if the uvs have not updated then no point rendering just yet!
    -    if(!uvs)return;
    -
    -    // get the sprites current alpha
    -    var alpha = sprite.worldAlpha;
    -    var tint = sprite.tint;
    -
    -    var verticies = this.vertices;
    -
    -    // TODO trim??
    -    var aX = sprite.anchor.x;
    -    var aY = sprite.anchor.y;
    -
    -    var w0, w1, h0, h1;
    -        
    -    if (texture.trim)
    -    {
    -        // if the sprite is trimmed then we need to add the extra space before transforming the sprite coords..
    -        var trim = texture.trim;
    -
    -        w1 = trim.x - aX * trim.width;
    -        w0 = w1 + texture.crop.width;
    -
    -        h1 = trim.y - aY * trim.height;
    -        h0 = h1 + texture.crop.height;
    -
    -    }
    -    else
    -    {
    -        w0 = (texture.frame.width ) * (1-aX);
    -        w1 = (texture.frame.width ) * -aX;
    -
    -        h0 = texture.frame.height * (1-aY);
    -        h1 = texture.frame.height * -aY;
    -    }
    -
    -    var index = this.currentBatchSize * 4 * this.vertSize;
    -    
    -    var resolution = texture.baseTexture.resolution;
    -
    -    var worldTransform = sprite.worldTransform;
    -
    -    var a = worldTransform.a / resolution;
    -    var b = worldTransform.b / resolution;
    -    var c = worldTransform.c / resolution;
    -    var d = worldTransform.d / resolution;
    -    var tx = worldTransform.tx;
    -    var ty = worldTransform.ty;
    -
    -
    -    // xy
    -    verticies[index++] = a * w1 + c * h1 + tx;
    -    verticies[index++] = d * h1 + b * w1 + ty;
    -    // uv
    -    verticies[index++] = uvs.x0;
    -    verticies[index++] = uvs.y0;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // xy
    -    verticies[index++] = a * w0 + c * h1 + tx;
    -    verticies[index++] = d * h1 + b * w0 + ty;
    -    // uv
    -    verticies[index++] = uvs.x1;
    -    verticies[index++] = uvs.y1;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // xy
    -    verticies[index++] = a * w0 + c * h0 + tx;
    -    verticies[index++] = d * h0 + b * w0 + ty;
    -    // uv
    -    verticies[index++] = uvs.x2;
    -    verticies[index++] = uvs.y2;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // xy
    -    verticies[index++] = a * w1 + c * h0 + tx;
    -    verticies[index++] = d * h0 + b * w1 + ty;
    -    // uv
    -    verticies[index++] = uvs.x3;
    -    verticies[index++] = uvs.y3;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -    
    -    // increment the batchsize
    -    this.sprites[this.currentBatchSize++] = sprite;
    -
    -};
    -
    -/**
    -* Renders a TilingSprite using the spriteBatch.
    -* 
    -* @method renderTilingSprite
    -* @param sprite {TilingSprite} the tilingSprite to render
    -*/
    -PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite)
    -{
    -    var texture = tilingSprite.tilingTexture;
    -
    -    // check texture..
    -    if(this.currentBatchSize >= this.size)
    -    {
    -        //return;
    -        this.flush();
    -        this.currentBaseTexture = texture.baseTexture;
    -    }
    -
    -     // set the textures uvs temporarily
    -    // TODO create a separate texture so that we can tile part of a texture
    -
    -    if(!tilingSprite._uvs)tilingSprite._uvs = new PIXI.TextureUvs();
    -
    -    var uvs = tilingSprite._uvs;
    -
    -    tilingSprite.tilePosition.x %= texture.baseTexture.width * tilingSprite.tileScaleOffset.x;
    -    tilingSprite.tilePosition.y %= texture.baseTexture.height * tilingSprite.tileScaleOffset.y;
    -
    -    var offsetX =  tilingSprite.tilePosition.x/(texture.baseTexture.width*tilingSprite.tileScaleOffset.x);
    -    var offsetY =  tilingSprite.tilePosition.y/(texture.baseTexture.height*tilingSprite.tileScaleOffset.y);
    -
    -    var scaleX =  (tilingSprite.width / texture.baseTexture.width)  / (tilingSprite.tileScale.x * tilingSprite.tileScaleOffset.x);
    -    var scaleY =  (tilingSprite.height / texture.baseTexture.height) / (tilingSprite.tileScale.y * tilingSprite.tileScaleOffset.y);
    -
    -    uvs.x0 = 0 - offsetX;
    -    uvs.y0 = 0 - offsetY;
    -
    -    uvs.x1 = (1 * scaleX) - offsetX;
    -    uvs.y1 = 0 - offsetY;
    -
    -    uvs.x2 = (1 * scaleX) - offsetX;
    -    uvs.y2 = (1 * scaleY) - offsetY;
    -
    -    uvs.x3 = 0 - offsetX;
    -    uvs.y3 = (1 *scaleY) - offsetY;
    -
    -    // get the tilingSprites current alpha
    -    var alpha = tilingSprite.worldAlpha;
    -    var tint = tilingSprite.tint;
    -
    -    var  verticies = this.vertices;
    -
    -    var width = tilingSprite.width;
    -    var height = tilingSprite.height;
    -
    -    // TODO trim??
    -    var aX = tilingSprite.anchor.x;
    -    var aY = tilingSprite.anchor.y;
    -    var w0 = width * (1-aX);
    -    var w1 = width * -aX;
    -
    -    var h0 = height * (1-aY);
    -    var h1 = height * -aY;
    -
    -    var index = this.currentBatchSize * 4 * this.vertSize;
    -
    -    var resolution = texture.baseTexture.resolution;
    -
    -    var worldTransform = tilingSprite.worldTransform;
    -
    -    var a = worldTransform.a / resolution;//[0];
    -    var b = worldTransform.b / resolution;//[3];
    -    var c = worldTransform.c / resolution;//[1];
    -    var d = worldTransform.d / resolution;//[4];
    -    var tx = worldTransform.tx;//[2];
    -    var ty = worldTransform.ty;///[5];
    -
    -    // xy
    -    verticies[index++] = a * w1 + c * h1 + tx;
    -    verticies[index++] = d * h1 + b * w1 + ty;
    -    // uv
    -    verticies[index++] = uvs.x0;
    -    verticies[index++] = uvs.y0;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // xy
    -    verticies[index++] = (a * w0 + c * h1 + tx);
    -    verticies[index++] = d * h1 + b * w0 + ty;
    -    // uv
    -    verticies[index++] = uvs.x1;
    -    verticies[index++] = uvs.y1;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -    
    -    // xy
    -    verticies[index++] = a * w0 + c * h0 + tx;
    -    verticies[index++] = d * h0 + b * w0 + ty;
    -    // uv
    -    verticies[index++] = uvs.x2;
    -    verticies[index++] = uvs.y2;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // xy
    -    verticies[index++] = a * w1 + c * h0 + tx;
    -    verticies[index++] = d * h0 + b * w1 + ty;
    -    // uv
    -    verticies[index++] = uvs.x3;
    -    verticies[index++] = uvs.y3;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // increment the batchsize
    -    this.sprites[this.currentBatchSize++] = tilingSprite;
    -};
    -
    -/**
    -* Renders the content and empties the current batch.
    -*
    -* @method flush
    -*/
    -PIXI.WebGLSpriteBatch.prototype.flush = function()
    -{
    -    // If the batch is length 0 then return as there is nothing to draw
    -    if (this.currentBatchSize===0)return;
    -
    -    var gl = this.gl;
    -    var shader;
    -
    -    if(this.dirty)
    -    {
    -        this.dirty = false;
    -        // bind the main texture
    -        gl.activeTexture(gl.TEXTURE0);
    -
    -        // bind the buffers
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -
    -        shader =  this.defaultShader.shaders[gl.id];
    -
    -        // this is the same for each shader?
    -        var stride =  this.vertSize * 4;
    -        gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0);
    -        gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, stride, 2 * 4);
    -        gl.vertexAttribPointer(shader.colorAttribute, 2, gl.FLOAT, false, stride, 4 * 4);
    -    }
    -
    -    // upload the verts to the buffer  
    -    if(this.currentBatchSize > ( this.size * 0.5 ) )
    -    {
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices);
    -    }
    -    else
    -    {
    -        var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize);
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, view);
    -    }
    -
    -    var nextTexture, nextBlendMode, nextShader;
    -    var batchSize = 0;
    -    var start = 0;
    -
    -    var currentBaseTexture = null;
    -    var currentBlendMode = this.renderSession.blendModeManager.currentBlendMode;
    -    var currentShader = null;
    -
    -    var blendSwap = false;
    -    var shaderSwap = false;
    -    var sprite;
    -
    -    for (var i = 0, j = this.currentBatchSize; i < j; i++) {
    -        
    -        sprite = this.sprites[i];
    -
    -        nextTexture = sprite.texture.baseTexture;
    -        nextBlendMode = sprite.blendMode;
    -        nextShader = sprite.shader || this.defaultShader;
    -
    -        blendSwap = currentBlendMode !== nextBlendMode;
    -        shaderSwap = currentShader !== nextShader; // should I use _UIDS???
    -
    -        if(currentBaseTexture !== nextTexture || blendSwap || shaderSwap)
    -        {
    -            this.renderBatch(currentBaseTexture, batchSize, start);
    -
    -            start = i;
    -            batchSize = 0;
    -            currentBaseTexture = nextTexture;
    -
    -            if( blendSwap )
    -            {
    -                currentBlendMode = nextBlendMode;
    -                this.renderSession.blendModeManager.setBlendMode( currentBlendMode );
    -            }
    -
    -            if( shaderSwap )
    -            {
    -                currentShader = nextShader;
    -                
    -                shader = currentShader.shaders[gl.id];
    -
    -                if(!shader)
    -                {
    -                    shader = new PIXI.PixiShader(gl);
    -
    -                    shader.fragmentSrc =currentShader.fragmentSrc;
    -                    shader.uniforms =currentShader.uniforms;
    -                    shader.init();
    -
    -                    currentShader.shaders[gl.id] = shader;
    -                }
    -
    -                // set shader function???
    -                this.renderSession.shaderManager.setShader(shader);
    -
    -                if(shader.dirty)shader.syncUniforms();
    -                
    -                // both thease only need to be set if they are changing..
    -                // set the projection
    -                var projection = this.renderSession.projection;
    -                gl.uniform2f(shader.projectionVector, projection.x, projection.y);
    -
    -                // TODO - this is temprorary!
    -                var offsetVector = this.renderSession.offset;
    -                gl.uniform2f(shader.offsetVector, offsetVector.x, offsetVector.y);
    -
    -                // set the pointers
    -            }
    -        }
    -
    -        batchSize++;
    -    }
    -
    -    this.renderBatch(currentBaseTexture, batchSize, start);
    -
    -    // then reset the batch!
    -    this.currentBatchSize = 0;
    -};
    -
    -/**
    -* @method renderBatch
    -* @param texture {Texture}
    -* @param size {Number}
    -* @param startIndex {Number}
    -*/
    -PIXI.WebGLSpriteBatch.prototype.renderBatch = function(texture, size, startIndex)
    -{
    -    if(size === 0)return;
    -
    -    var gl = this.gl;
    -
    -    // check if a texture is dirty..
    -    if(texture._dirty[gl.id])
    -    {
    -        this.renderSession.renderer.updateTexture(texture);
    -    }
    -    else
    -    {
    -        // bind the current texture
    -        gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]);
    -    }
    -
    -    // now draw those suckas!
    -    gl.drawElements(gl.TRIANGLES, size * 6, gl.UNSIGNED_SHORT, startIndex * 6 * 2);
    -    
    -    // increment the draw count
    -    this.renderSession.drawCount++;
    -};
    -
    -/**
    -* @method stop
    -*/
    -PIXI.WebGLSpriteBatch.prototype.stop = function()
    -{
    -    this.flush();
    -    this.dirty = true;
    -};
    -
    -/**
    -* @method start
    -*/
    -PIXI.WebGLSpriteBatch.prototype.start = function()
    -{
    -    this.dirty = true;
    -};
    -
    -/**
    -* Destroys the SpriteBatch.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLSpriteBatch.prototype.destroy = function()
    -{
    -    this.vertices = null;
    -    this.indices = null;
    -    
    -    this.gl.deleteBuffer( this.vertexBuffer );
    -    this.gl.deleteBuffer( this.indexBuffer );
    -    
    -    this.currentBaseTexture = null;
    -    
    -    this.gl = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLStencilManager.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLStencilManager.js.html deleted file mode 100755 index 20b4a01..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLStencilManager.js.html +++ /dev/null @@ -1,572 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLStencilManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class WebGLStencilManager
    -* @constructor
    -* @private
    -*/
    -PIXI.WebGLStencilManager = function()
    -{
    -    this.stencilStack = [];
    -    this.reverse = true;
    -    this.count = 0;
    -};
    -
    -/**
    -* Sets the drawing context to the one given in parameter.
    -* 
    -* @method setContext 
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLStencilManager.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -};
    -
    -/**
    -* Applies the Mask and adds it to the current filter stack.
    -* 
    -* @method pushMask
    -* @param graphics {Graphics}
    -* @param webGLData {Array}
    -* @param renderSession {Object}
    -*/
    -PIXI.WebGLStencilManager.prototype.pushStencil = function(graphics, webGLData, renderSession)
    -{
    -    var gl = this.gl;
    -    this.bindGraphics(graphics, webGLData, renderSession);
    -
    -    if(this.stencilStack.length === 0)
    -    {
    -        gl.enable(gl.STENCIL_TEST);
    -        gl.clear(gl.STENCIL_BUFFER_BIT);
    -        this.reverse = true;
    -        this.count = 0;
    -    }
    -
    -    this.stencilStack.push(webGLData);
    -
    -    var level = this.count;
    -
    -    gl.colorMask(false, false, false, false);
    -
    -    gl.stencilFunc(gl.ALWAYS,0,0xFF);
    -    gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT);
    -
    -    // draw the triangle strip!
    -
    -    if(webGLData.mode === 1)
    -    {
    -        gl.drawElements(gl.TRIANGLE_FAN,  webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 );
    -       
    -        if(this.reverse)
    -        {
    -            gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF);
    -            gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR);
    -        }
    -        else
    -        {
    -            gl.stencilFunc(gl.EQUAL,level, 0xFF);
    -            gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR);
    -        }
    -
    -        // draw a quad to increment..
    -        gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 );
    -               
    -        if(this.reverse)
    -        {
    -            gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF);
    -        }
    -        else
    -        {
    -            gl.stencilFunc(gl.EQUAL,level+1, 0xFF);
    -        }
    -
    -        this.reverse = !this.reverse;
    -    }
    -    else
    -    {
    -        if(!this.reverse)
    -        {
    -            gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF);
    -            gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR);
    -        }
    -        else
    -        {
    -            gl.stencilFunc(gl.EQUAL,level, 0xFF);
    -            gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR);
    -        }
    -
    -        gl.drawElements(gl.TRIANGLE_STRIP,  webGLData.indices.length, gl.UNSIGNED_SHORT, 0 );
    -
    -        if(!this.reverse)
    -        {
    -            gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF);
    -        }
    -        else
    -        {
    -            gl.stencilFunc(gl.EQUAL,level+1, 0xFF);
    -        }
    -    }
    -
    -    gl.colorMask(true, true, true, true);
    -    gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP);
    -
    -    this.count++;
    -};
    -
    -/**
    - * TODO this does not belong here!
    - * 
    - * @method bindGraphics
    - * @param graphics {Graphics}
    - * @param webGLData {Array}
    - * @param renderSession {Object}
    - */
    -PIXI.WebGLStencilManager.prototype.bindGraphics = function(graphics, webGLData, renderSession)
    -{
    -    //if(this._currentGraphics === graphics)return;
    -    this._currentGraphics = graphics;
    -
    -    var gl = this.gl;
    -
    -     // bind the graphics object..
    -    var projection = renderSession.projection,
    -        offset = renderSession.offset,
    -        shader;// = renderSession.shaderManager.primitiveShader;
    -
    -    if(webGLData.mode === 1)
    -    {
    -        shader = renderSession.shaderManager.complexPrimitiveShader;
    -
    -        renderSession.shaderManager.setShader( shader );
    -
    -        gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true));
    -
    -        gl.uniform2f(shader.projectionVector, projection.x, -projection.y);
    -        gl.uniform2f(shader.offsetVector, -offset.x, -offset.y);
    -
    -        gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint));
    -        gl.uniform3fv(shader.color, webGLData.color);
    -
    -        gl.uniform1f(shader.alpha, graphics.worldAlpha * webGLData.alpha);
    -
    -        gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer);
    -
    -        gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 2, 0);
    -
    -
    -        // now do the rest..
    -        // set the index buffer!
    -        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer);
    -    }
    -    else
    -    {
    -        //renderSession.shaderManager.activatePrimitiveShader();
    -        shader = renderSession.shaderManager.primitiveShader;
    -        renderSession.shaderManager.setShader( shader );
    -
    -        gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true));
    -
    -        gl.uniform2f(shader.projectionVector, projection.x, -projection.y);
    -        gl.uniform2f(shader.offsetVector, -offset.x, -offset.y);
    -
    -        gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint));
    -
    -        gl.uniform1f(shader.alpha, graphics.worldAlpha);
    -        
    -        gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer);
    -
    -        gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0);
    -        gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4);
    -
    -        // set the index buffer!
    -        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer);
    -    }
    -};
    -
    -/**
    - * @method popStencil
    - * @param graphics {Graphics}
    - * @param webGLData {Array}
    - * @param renderSession {Object}
    - */
    -PIXI.WebGLStencilManager.prototype.popStencil = function(graphics, webGLData, renderSession)
    -{
    -	var gl = this.gl;
    -    this.stencilStack.pop();
    -   
    -    this.count--;
    -
    -    if(this.stencilStack.length === 0)
    -    {
    -        // the stack is empty!
    -        gl.disable(gl.STENCIL_TEST);
    -
    -    }
    -    else
    -    {
    -
    -        var level = this.count;
    -
    -        this.bindGraphics(graphics, webGLData, renderSession);
    -
    -        gl.colorMask(false, false, false, false);
    -    
    -        if(webGLData.mode === 1)
    -        {
    -            this.reverse = !this.reverse;
    -
    -            if(this.reverse)
    -            {
    -                gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF);
    -                gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR);
    -            }
    -            else
    -            {
    -                gl.stencilFunc(gl.EQUAL,level+1, 0xFF);
    -                gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR);
    -            }
    -
    -            // draw a quad to increment..
    -            gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 );
    -            
    -            gl.stencilFunc(gl.ALWAYS,0,0xFF);
    -            gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT);
    -
    -            // draw the triangle strip!
    -            gl.drawElements(gl.TRIANGLE_FAN,  webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 );
    -           
    -            if(!this.reverse)
    -            {
    -                gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF);
    -            }
    -            else
    -            {
    -                gl.stencilFunc(gl.EQUAL,level, 0xFF);
    -            }
    -
    -        }
    -        else
    -        {
    -          //  console.log("<<>>")
    -            if(!this.reverse)
    -            {
    -                gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF);
    -                gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR);
    -            }
    -            else
    -            {
    -                gl.stencilFunc(gl.EQUAL,level+1, 0xFF);
    -                gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR);
    -            }
    -
    -            gl.drawElements(gl.TRIANGLE_STRIP,  webGLData.indices.length, gl.UNSIGNED_SHORT, 0 );
    -
    -            if(!this.reverse)
    -            {
    -                gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF);
    -            }
    -            else
    -            {
    -                gl.stencilFunc(gl.EQUAL,level, 0xFF);
    -            }
    -        }
    -
    -        gl.colorMask(true, true, true, true);
    -        gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP);
    -
    -
    -    }
    -};
    -
    -/**
    -* Destroys the mask stack.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLStencilManager.prototype.destroy = function()
    -{
    -    this.stencilStack = null;
    -    this.gl = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_text_BitmapText.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_text_BitmapText.js.html deleted file mode 100755 index 1a2e2ce..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_text_BitmapText.js.html +++ /dev/null @@ -1,493 +0,0 @@ - - - - - src/pixi/text/BitmapText.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/text/BitmapText.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A BitmapText object will create a line or multiple lines of text using bitmap font. To split a line you can use '\n', '\r' or '\r\n' in your string.
    - * You can generate the fnt files using
    - * http://www.angelcode.com/products/bmfont/ for windows or
    - * http://www.bmglyph.com/ for mac.
    - *
    - * @class BitmapText
    - * @extends DisplayObjectContainer
    - * @constructor
    - * @param text {String} The copy that you would like the text to display
    - * @param style {Object} The style parameters
    - * @param style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)
    - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
    - */
    -PIXI.BitmapText = function(text, style)
    -{
    -    PIXI.DisplayObjectContainer.call(this);
    -
    -    /**
    -     * [read-only] The width of the overall text, different from fontSize,
    -     * which is defined in the style object
    -     *
    -     * @property textWidth
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.textWidth = 0;
    -
    -    /**
    -     * [read-only] The height of the overall text, different from fontSize,
    -     * which is defined in the style object
    -     *
    -     * @property textHeight
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.textHeight = 0;
    -
    -    /**
    -     * @property _pool
    -     * @type Array
    -     * @private
    -     */
    -    this._pool = [];
    -
    -    this.setText(text);
    -    this.setStyle(style);
    -    this.updateText();
    -
    -    /**
    -     * The dirty state of this object.
    -     * @property dirty
    -     * @type Boolean
    -     */
    -    this.dirty = false;
    -};
    -
    -// constructor
    -PIXI.BitmapText.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
    -PIXI.BitmapText.prototype.constructor = PIXI.BitmapText;
    -
    -/**
    - * Set the text string to be rendered.
    - *
    - * @method setText
    - * @param text {String} The text that you would like displayed
    - */
    -PIXI.BitmapText.prototype.setText = function(text)
    -{
    -    this.text = text || ' ';
    -    this.dirty = true;
    -};
    -
    -/**
    - * Set the style of the text
    - * style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)
    - * [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single lines of text
    - *
    - * @method setStyle
    - * @param style {Object} The style parameters, contained as properties of an object
    - */
    -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;
    -    this.tint = style.tint;
    -};
    -
    -/**
    - * Renders text and updates it when needed
    - *
    - * @method updateText
    - * @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(/(?:\r\n|\r|\n)/.test(this.text.charAt(i)))
    -        {
    -            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.kerning[prevCharCode])
    -        {
    -            pos.x += charData.kerning[prevCharCode];
    -        }
    -
    -        chars.push({texture:charData.texture, 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);
    -    }
    -
    -    var lenChildren = this.children.length;
    -    var lenChars = chars.length;
    -    var tint = this.tint || 0xFFFFFF;
    -
    -    for(i = 0; i < lenChars; i++)
    -    {
    -        var c = i < lenChildren ? this.children[i] : this._pool.pop(); // get old child if have. if not - take from pool.
    -
    -        if (c) c.setTexture(chars[i].texture); // check if got one before.
    -        else c = new PIXI.Sprite(chars[i].texture); // if no create new one.
    -
    -        c.position.x = (chars[i].position.x + lineAlignOffsets[chars[i].line]) * scale;
    -        c.position.y = chars[i].position.y * scale;
    -        c.scale.x = c.scale.y = scale;
    -        c.tint = tint;
    -        if (!c.parent) this.addChild(c);
    -    }
    -
    -    // remove unnecessary children.
    -    // and put their into the pool.
    -    while(this.children.length > lenChars)
    -    {
    -        var child = this.getChildAt(this.children.length - 1);
    -        this._pool.push(child);
    -        this.removeChild(child);
    -    }
    -
    -    this.textWidth = maxLineWidth * scale;
    -    this.textHeight = (pos.y + data.lineHeight) * scale;
    -};
    -
    -/**
    - * Updates the transform of this object
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.BitmapText.prototype.updateTransform = function()
    -{
    -    if(this.dirty)
    -    {
    -        this.updateText();
    -        this.dirty = false;
    -    }
    -
    -    PIXI.DisplayObjectContainer.prototype.updateTransform.call(this);
    -};
    -
    -PIXI.BitmapText.fonts = {};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_text_Text.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_text_Text.js.html deleted file mode 100755 index fb28604..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_text_Text.js.html +++ /dev/null @@ -1,805 +0,0 @@ - - - - - src/pixi/text/Text.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/text/Text.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * Modified by Tom Slezakowski http://www.tomslezakowski.com @TomSlezakowski (24/03/2014) - Added dropShadowColor.
    - */
    -
    -/**
    - * A Text Object will create a line or multiple lines of text. To split a line you can use '\n' in your text string,
    - * or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object.
    - *
    - * @class Text
    - * @extends Sprite
    - * @constructor
    - * @param text {String} The copy that you would like the text to display
    - * @param [style] {Object} The style parameters
    - * @param [style.font] {String} default 'bold 20px Arial' The style and size of the font
    - * @param [style.fill='black'] {String|Number} A canvas fillstyle that will be used on the text e.g 'red', '#00FF00'
    - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
    - * @param [style.stroke] {String|Number} A canvas fillstyle that will be used on the text stroke e.g 'blue', '#FCFF00'
    - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke)
    - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used
    - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap, it needs wordWrap to be set to true
    - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text
    - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00'
    - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow
    - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow
    - */
    -PIXI.Text = function(text, style)
    -{
    -    /**
    -     * The canvas element that everything is drawn to
    -     *
    -     * @property canvas
    -     * @type HTMLCanvasElement
    -     */
    -    this.canvas = document.createElement('canvas');
    -
    -    /**
    -     * The canvas 2d context that everything is drawn with
    -     * @property context
    -     * @type HTMLCanvasElement
    -     */
    -    this.context = this.canvas.getContext('2d');
    -
    -    /**
    -     * The resolution of the canvas.
    -     * @property resolution
    -     * @type Number
    -     */
    -    this.resolution = 1;
    -
    -    PIXI.Sprite.call(this, PIXI.Texture.fromCanvas(this.canvas));
    -
    -    this.setText(text);
    -    this.setStyle(style);
    -
    -};
    -
    -// constructor
    -PIXI.Text.prototype = Object.create(PIXI.Sprite.prototype);
    -PIXI.Text.prototype.constructor = PIXI.Text;
    -
    -/**
    - * The width of the Text, setting this will actually modify the scale to achieve the value set
    - *
    - * @property width
    - * @type Number
    - */
    -Object.defineProperty(PIXI.Text.prototype, 'width', {
    -    get: function() {
    -
    -        if(this.dirty)
    -        {
    -            this.updateText();
    -            this.dirty = false;
    -        }
    -
    -
    -        return this.scale.x * this.texture.frame.width;
    -    },
    -    set: function(value) {
    -        this.scale.x = value / this.texture.frame.width;
    -        this._width = value;
    -    }
    -});
    -
    -/**
    - * The height of the Text, setting this will actually modify the scale to achieve the value set
    - *
    - * @property height
    - * @type Number
    - */
    -Object.defineProperty(PIXI.Text.prototype, 'height', {
    -    get: function() {
    -
    -        if(this.dirty)
    -        {
    -            this.updateText();
    -            this.dirty = false;
    -        }
    -
    -
    -        return  this.scale.y * this.texture.frame.height;
    -    },
    -    set: function(value) {
    -        this.scale.y = value / this.texture.frame.height;
    -        this._height = value;
    -    }
    -});
    -
    -/**
    - * Set the style of the text
    - *
    - * @method setStyle
    - * @param [style] {Object} The style parameters
    - * @param [style.font='bold 20pt Arial'] {String} The style and size of the font
    - * @param [style.fill='black'] {Object} A canvas fillstyle that will be used on the text eg 'red', '#00FF00'
    - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
    - * @param [style.stroke='black'] {String} A canvas fillstyle that will be used on the text stroke eg 'blue', '#FCFF00'
    - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke)
    - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used
    - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap
    - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text
    - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00'
    - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow
    - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow
    - */
    -PIXI.Text.prototype.setStyle = function(style)
    -{
    -    style = style || {};
    -    style.font = style.font || 'bold 20pt Arial';
    -    style.fill = style.fill || 'black';
    -    style.align = style.align || 'left';
    -    style.stroke = style.stroke || 'black'; //provide a default, see: https://github.com/GoodBoyDigital/pixi.js/issues/136
    -    style.strokeThickness = style.strokeThickness || 0;
    -    style.wordWrap = style.wordWrap || false;
    -    style.wordWrapWidth = style.wordWrapWidth || 100;
    -    
    -    style.dropShadow = style.dropShadow || false;
    -    style.dropShadowAngle = style.dropShadowAngle || Math.PI / 6;
    -    style.dropShadowDistance = style.dropShadowDistance || 4;
    -    style.dropShadowColor = style.dropShadowColor || 'black';
    -
    -    this.style = style;
    -    this.dirty = true;
    -};
    -
    -/**
    - * Set the copy for the text object. To split a line you can use '\n'.
    - *
    - * @method setText
    - * @param text {String} The copy that you would like the text to display
    - */
    -PIXI.Text.prototype.setText = function(text)
    -{
    -    this.text = text.toString() || ' ';
    -    this.dirty = true;
    -};
    -
    -/**
    - * Renders text and updates it when needed
    - *
    - * @method updateText
    - * @private
    - */
    -PIXI.Text.prototype.updateText = function()
    -{
    -    this.texture.baseTexture.resolution = this.resolution;
    -
    -    this.context.font = this.style.font;
    -
    -    var outputText = this.text;
    -
    -    // word wrap
    -    // preserve original text
    -    if(this.style.wordWrap)outputText = this.wordWrap(this.text);
    -
    -    //split text into lines
    -    var lines = outputText.split(/(?:\r\n|\r|\n)/);
    -
    -    //calculate text width
    -    var lineWidths = [];
    -    var maxLineWidth = 0;
    -    var fontProperties = this.determineFontProperties(this.style.font);
    -    for (var i = 0; i < lines.length; i++)
    -    {
    -        var lineWidth = this.context.measureText(lines[i]).width;
    -        lineWidths[i] = lineWidth;
    -        maxLineWidth = Math.max(maxLineWidth, lineWidth);
    -    }
    -
    -    var width = maxLineWidth + this.style.strokeThickness;
    -    if(this.style.dropShadow)width += this.style.dropShadowDistance;
    -
    -    this.canvas.width = ( width + this.context.lineWidth ) * this.resolution;
    -    
    -    //calculate text height
    -    var lineHeight = fontProperties.fontSize + this.style.strokeThickness;
    - 
    -    var height = lineHeight * lines.length;
    -    if(this.style.dropShadow)height += this.style.dropShadowDistance;
    -
    -    this.canvas.height = height * this.resolution;
    -
    -    this.context.scale( this.resolution, this.resolution);
    -
    -    if(navigator.isCocoonJS) this.context.clearRect(0,0,this.canvas.width,this.canvas.height);
    -    
    -    this.context.font = this.style.font;
    -    this.context.strokeStyle = this.style.stroke;
    -    this.context.lineWidth = this.style.strokeThickness;
    -    this.context.textBaseline = 'alphabetic';
    -    //this.context.lineJoin = 'round';
    -
    -    var linePositionX;
    -    var linePositionY;
    -
    -    if(this.style.dropShadow)
    -    {
    -        this.context.fillStyle = this.style.dropShadowColor;
    -
    -        var xShadowOffset = Math.sin(this.style.dropShadowAngle) * this.style.dropShadowDistance;
    -        var yShadowOffset = Math.cos(this.style.dropShadowAngle) * this.style.dropShadowDistance;
    -
    -        for (i = 0; i < lines.length; i++)
    -        {
    -            linePositionX = this.style.strokeThickness / 2;
    -            linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent;
    -
    -            if(this.style.align === 'right')
    -            {
    -                linePositionX += maxLineWidth - lineWidths[i];
    -            }
    -            else if(this.style.align === 'center')
    -            {
    -                linePositionX += (maxLineWidth - lineWidths[i]) / 2;
    -            }
    -
    -            if(this.style.fill)
    -            {
    -                this.context.fillText(lines[i], linePositionX + xShadowOffset, linePositionY + yShadowOffset);
    -            }
    -
    -          //  if(dropShadow)
    -        }
    -    }
    -
    -    //set canvas text styles
    -    this.context.fillStyle = this.style.fill;
    -    
    -    //draw lines line by line
    -    for (i = 0; i < lines.length; i++)
    -    {
    -        linePositionX = this.style.strokeThickness / 2;
    -        linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent;
    -
    -        if(this.style.align === 'right')
    -        {
    -            linePositionX += maxLineWidth - lineWidths[i];
    -        }
    -        else if(this.style.align === 'center')
    -        {
    -            linePositionX += (maxLineWidth - lineWidths[i]) / 2;
    -        }
    -
    -        if(this.style.stroke && this.style.strokeThickness)
    -        {
    -            this.context.strokeText(lines[i], linePositionX, linePositionY);
    -        }
    -
    -        if(this.style.fill)
    -        {
    -            this.context.fillText(lines[i], linePositionX, linePositionY);
    -        }
    -
    -      //  if(dropShadow)
    -    }
    -
    -    this.updateTexture();
    -};
    -
    -/**
    - * Updates texture size based on canvas size
    - *
    - * @method updateTexture
    - * @private
    - */
    -PIXI.Text.prototype.updateTexture = function()
    -{
    -    this.texture.baseTexture.width = this.canvas.width;
    -    this.texture.baseTexture.height = this.canvas.height;
    -    this.texture.crop.width = this.texture.frame.width = this.canvas.width;
    -    this.texture.crop.height = this.texture.frame.height = this.canvas.height;
    -
    -    this._width = this.canvas.width;
    -    this._height = this.canvas.height;
    -
    -    // update the dirty base textures
    -    this.texture.baseTexture.dirty();
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.Text.prototype._renderWebGL = function(renderSession)
    -{
    -    if(this.dirty)
    -    {
    -        this.resolution = renderSession.resolution;
    -
    -        this.updateText();
    -        this.dirty = false;
    -    }
    -
    -    PIXI.Sprite.prototype._renderWebGL.call(this, renderSession);
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.Text.prototype._renderCanvas = function(renderSession)
    -{
    -    if(this.dirty)
    -    {
    -        this.resolution = renderSession.resolution;
    -
    -        this.updateText();
    -        this.dirty = false;
    -    }
    -     
    -    PIXI.Sprite.prototype._renderCanvas.call(this, renderSession);
    -};
    -
    -/**
    -* Calculates the ascent, descent and fontSize of a given fontStyle
    -*
    -* @method determineFontProperties
    -* @param fontStyle {Object}
    -* @private
    -*/
    -PIXI.Text.prototype.determineFontProperties = function(fontStyle)
    -{
    -    var properties = PIXI.Text.fontPropertiesCache[fontStyle];
    -
    -    if(!properties)
    -    {
    -        properties = {};
    -        
    -        var canvas = PIXI.Text.fontPropertiesCanvas;
    -        var context = PIXI.Text.fontPropertiesContext;
    -
    -        context.font = fontStyle;
    -
    -        var width = Math.ceil(context.measureText('|Mq').width);
    -        var baseline = Math.ceil(context.measureText('M').width);
    -        var height = 2 * baseline;
    -
    -        baseline = baseline * 1.4 | 0;
    -
    -        canvas.width = width;
    -        canvas.height = height;
    -
    -        context.fillStyle = '#f00';
    -        context.fillRect(0, 0, width, height);
    -
    -        context.font = fontStyle;
    -
    -        context.textBaseline = 'alphabetic';
    -        context.fillStyle = '#000';
    -        context.fillText('|Mq', 0, baseline);
    -
    -        var imagedata = context.getImageData(0, 0, width, height).data;
    -        var pixels = imagedata.length;
    -        var line = width * 4;
    -
    -        var i, j;
    -
    -        var idx = 0;
    -        var stop = false;
    -
    -        // ascent. scan from top to bottom until we find a non red pixel
    -        for(i = 0; i < baseline; i++)
    -        {
    -            for(j = 0; j < line; j += 4)
    -            {
    -                if(imagedata[idx + j] !== 255)
    -                {
    -                    stop = true;
    -                    break;
    -                }
    -            }
    -            if(!stop)
    -            {
    -                idx += line;
    -            }
    -            else
    -            {
    -                break;
    -            }
    -        }
    -
    -        properties.ascent = baseline - i;
    -
    -        idx = pixels - line;
    -        stop = false;
    -
    -        // descent. scan from bottom to top until we find a non red pixel
    -        for(i = height; i > baseline; i--)
    -        {
    -            for(j = 0; j < line; j += 4)
    -            {
    -                if(imagedata[idx + j] !== 255)
    -                {
    -                    stop = true;
    -                    break;
    -                }
    -            }
    -            if(!stop)
    -            {
    -                idx -= line;
    -            }
    -            else
    -            {
    -                break;
    -            }
    -        }
    -
    -        properties.descent = i - baseline;
    -        properties.fontSize = properties.ascent + properties.descent;
    -
    -        PIXI.Text.fontPropertiesCache[fontStyle] = properties;
    -    }
    -
    -    return properties;
    -};
    -
    -/**
    - * Applies newlines to a string to have it optimally fit into the horizontal
    - * bounds set by the Text object's wordWrapWidth property.
    - *
    - * @method wordWrap
    - * @param text {String}
    - * @private
    - */
    -PIXI.Text.prototype.wordWrap = function(text)
    -{
    -    // Greedy wrapping algorithm that will wrap words as the line grows longer
    -    // than its horizontal bounds.
    -    var result = '';
    -    var lines = text.split('\n');
    -    for (var i = 0; i < lines.length; i++)
    -    {
    -        var spaceLeft = this.style.wordWrapWidth;
    -        var words = lines[i].split(' ');
    -        for (var j = 0; j < words.length; j++)
    -        {
    -            var wordWidth = this.context.measureText(words[j]).width;
    -            var wordWidthWithSpace = wordWidth + this.context.measureText(' ').width;
    -            if(j === 0 || wordWidthWithSpace > spaceLeft)
    -            {
    -                // Skip printing the newline if it's the first word of the line that is
    -                // greater than the word wrap width.
    -                if(j > 0)
    -                {
    -                    result += '\n';
    -                }
    -                result += words[j];
    -                spaceLeft = this.style.wordWrapWidth - wordWidth;
    -            }
    -            else
    -            {
    -                spaceLeft -= wordWidthWithSpace;
    -                result += ' ' + words[j];
    -            }
    -        }
    -
    -        if (i < lines.length-1)
    -        {
    -            result += '\n';
    -        }
    -    }
    -    return result;
    -};
    -
    -/**
    -* Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account.
    -*
    -* @method getBounds
    -* @param matrix {Matrix} the transformation matrix of the Text
    -* @return {Rectangle} the framing rectangle
    -*/
    -PIXI.Text.prototype.getBounds = function(matrix)
    -{
    -    if(this.dirty)
    -    {
    -        this.updateText();
    -        this.dirty = false;
    -    }
    -
    -    return PIXI.Sprite.prototype.getBounds.call(this, matrix);
    -};
    -
    -/**
    - * Destroys this text object.
    - *
    - * @method destroy
    - * @param destroyBaseTexture {Boolean} whether to destroy the base texture as well
    - */
    -PIXI.Text.prototype.destroy = function(destroyBaseTexture)
    -{
    -    // make sure to reset the the context and canvas.. dont want this hanging around in memory!
    -    this.context = null;
    -    this.canvas = null;
    -
    -    this.texture.destroy(destroyBaseTexture === undefined ? true : destroyBaseTexture);
    -};
    -
    -PIXI.Text.fontPropertiesCache = {};
    -PIXI.Text.fontPropertiesCanvas = document.createElement('canvas');
    -PIXI.Text.fontPropertiesContext = PIXI.Text.fontPropertiesCanvas.getContext('2d');
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_textures_BaseTexture.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_textures_BaseTexture.js.html deleted file mode 100755 index 4c34275..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_textures_BaseTexture.js.html +++ /dev/null @@ -1,573 +0,0 @@ - - - - - src/pixi/textures/BaseTexture.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/textures/BaseTexture.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -PIXI.BaseTextureCache = {};
    -
    -PIXI.BaseTextureCacheIdGenerator = 0;
    -
    -/**
    - * A texture stores the information that represents an image. All textures have a base texture.
    - *
    - * @class BaseTexture
    - * @uses EventTarget
    - * @constructor
    - * @param source {String} the source object (image or canvas)
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - */
    -PIXI.BaseTexture = function(source, scaleMode)
    -{
    -    /**
    -     * The Resolution of the texture. 
    -     *
    -     * @property resolution
    -     * @type Number
    -     */
    -    this.resolution = 1;
    -    
    -    /**
    -     * [read-only] The width of the base texture set when the image has loaded
    -     *
    -     * @property width
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.width = 100;
    -
    -    /**
    -     * [read-only] The height of the base texture set when the image has loaded
    -     *
    -     * @property height
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.height = 100;
    -
    -    /**
    -     * The scale mode to apply when scaling this texture
    -     * 
    -     * @property scaleMode
    -     * @type PIXI.scaleModes
    -     * @default PIXI.scaleModes.LINEAR
    -     */
    -    this.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT;
    -
    -    /**
    -     * [read-only] Set to true once the base texture has loaded
    -     *
    -     * @property hasLoaded
    -     * @type Boolean
    -     * @readOnly
    -     */
    -    this.hasLoaded = false;
    -
    -    /**
    -     * The image source that is used to create the texture.
    -     *
    -     * @property source
    -     * @type Image
    -     */
    -    this.source = source;
    -
    -    this._UID = PIXI._UID++;
    -
    -    /**
    -     * Controls if RGB channels should be pre-multiplied by Alpha  (WebGL only)
    -     *
    -     * @property premultipliedAlpha
    -     * @type Boolean
    -     * @default true
    -     */
    -    this.premultipliedAlpha = true;
    -
    -    // used for webGL
    -
    -    /**
    -     * @property _glTextures
    -     * @type Array
    -     * @private
    -     */
    -    this._glTextures = [];
    -
    -    // used for webGL texture updating...
    -    // TODO - this needs to be addressed
    -
    -    /**
    -     * @property _dirty
    -     * @type Array
    -     * @private
    -     */
    -    this._dirty = [true, true, true, true];
    -
    -    if(!source)return;
    -
    -    if((this.source.complete || this.source.getContext) && this.source.width && this.source.height)
    -    {
    -        this.hasLoaded = true;
    -        this.width = this.source.naturalWidth || this.source.width;
    -        this.height = this.source.naturalHeight || this.source.height;
    -        this.dirty();
    -    }
    -    else
    -    {
    -        var scope = this;
    -
    -        this.source.onload = function() {
    -
    -            scope.hasLoaded = true;
    -            scope.width = scope.source.naturalWidth || scope.source.width;
    -            scope.height = scope.source.naturalHeight || scope.source.height;
    -
    -            scope.dirty();
    -
    -            // add it to somewhere...
    -            scope.dispatchEvent( { type: 'loaded', content: scope } );
    -        };
    -
    -        this.source.onerror = function() {
    -            scope.dispatchEvent( { type: 'error', content: scope } );
    -        };
    -    }
    -
    -    /**
    -     * @property imageUrl
    -     * @type String
    -     */
    -    this.imageUrl = null;
    -
    -    /**
    -     * @property _powerOf2
    -     * @type Boolean
    -     * @private
    -     */
    -    this._powerOf2 = false;
    -
    -};
    -
    -PIXI.BaseTexture.prototype.constructor = PIXI.BaseTexture;
    -
    -PIXI.EventTarget.mixin(PIXI.BaseTexture.prototype);
    -
    -/**
    - * Destroys this base texture
    - *
    - * @method destroy
    - */
    -PIXI.BaseTexture.prototype.destroy = function()
    -{
    -    if(this.imageUrl)
    -    {
    -        delete PIXI.BaseTextureCache[this.imageUrl];
    -        delete PIXI.TextureCache[this.imageUrl];
    -        this.imageUrl = null;
    -        if (!navigator.isCocoonJS) this.source.src = '';
    -    }
    -    else if (this.source && this.source._pixiId)
    -    {
    -        delete PIXI.BaseTextureCache[this.source._pixiId];
    -    }
    -    this.source = null;
    -
    -    this.unloadFromGPU();
    -};
    -
    -/**
    - * Changes the source image of the texture
    - *
    - * @method updateSourceImage
    - * @param newSrc {String} the path of the image
    - */
    -PIXI.BaseTexture.prototype.updateSourceImage = function(newSrc)
    -{
    -    this.hasLoaded = false;
    -    this.source.src = null;
    -    this.source.src = newSrc;
    -};
    -
    -/**
    - * Sets all glTextures to be dirty.
    - *
    - * @method dirty
    - */
    -PIXI.BaseTexture.prototype.dirty = function()
    -{
    -    for (var i = 0; i < this._glTextures.length; i++)
    -    {
    -        this._dirty[i] = true;
    -    }
    -};
    -
    -/**
    - * Removes the base texture from the GPU, useful for managing resources on the GPU.
    - * Atexture is still 100% usable and will simply be reuploaded if there is a sprite on screen that is using it.
    - *
    - * @method unloadFromGPU
    - */
    -PIXI.BaseTexture.prototype.unloadFromGPU = function()
    -{
    -    this.dirty();
    -
    -    // delete the webGL textures if any.
    -    for (var i = this._glTextures.length - 1; i >= 0; i--)
    -    {
    -        var glTexture = this._glTextures[i];
    -        var gl = PIXI.glContexts[i];
    -
    -        if(gl && glTexture)
    -        {
    -            gl.deleteTexture(glTexture);
    -        }
    -        
    -    }
    -
    -    this._glTextures.length = 0;
    -
    -    this.dirty();
    -};
    -
    -/**
    - * Helper function that creates a base texture from the given image url.
    - * If the image is not in the base texture cache it will be created and loaded.
    - *
    - * @static
    - * @method fromImage
    - * @param imageUrl {String} The image url of the texture
    - * @param crossorigin {Boolean}
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @return BaseTexture
    - */
    -PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode)
    -{
    -    var baseTexture = PIXI.BaseTextureCache[imageUrl];
    -
    -    if(crossorigin === undefined && imageUrl.indexOf('data:') === -1) crossorigin = true;
    -
    -    if(!baseTexture)
    -    {
    -        // new Image() breaks tex loading in some versions of Chrome.
    -        // See https://code.google.com/p/chromium/issues/detail?id=238071
    -        var image = new Image();//document.createElement('img');
    -        if (crossorigin)
    -        {
    -            image.crossOrigin = '';
    -        }
    -
    -        image.src = imageUrl;
    -        baseTexture = new PIXI.BaseTexture(image, scaleMode);
    -        baseTexture.imageUrl = imageUrl;
    -        PIXI.BaseTextureCache[imageUrl] = baseTexture;
    -
    -        // if there is an @2x at the end of the url we are going to assume its a highres image
    -        if( imageUrl.indexOf(PIXI.RETINA_PREFIX + '.') !== -1)
    -        {
    -            baseTexture.resolution = 2;
    -        }
    -    }
    -
    -    return baseTexture;
    -};
    -
    -/**
    - * Helper function that creates a base texture from the given canvas element.
    - *
    - * @static
    - * @method fromCanvas
    - * @param canvas {Canvas} The canvas element source of the texture
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @return BaseTexture
    - */
    -PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode)
    -{
    -    if(!canvas._pixiId)
    -    {
    -        canvas._pixiId = 'canvas_' + PIXI.TextureCacheIdGenerator++;
    -    }
    -
    -    var baseTexture = PIXI.BaseTextureCache[canvas._pixiId];
    -
    -    if(!baseTexture)
    -    {
    -        baseTexture = new PIXI.BaseTexture(canvas, scaleMode);
    -        PIXI.BaseTextureCache[canvas._pixiId] = baseTexture;
    -    }
    -
    -    return baseTexture;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_textures_RenderTexture.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_textures_RenderTexture.js.html deleted file mode 100755 index 23c4f84..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_textures_RenderTexture.js.html +++ /dev/null @@ -1,614 +0,0 @@ - - - - - src/pixi/textures/RenderTexture.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/textures/RenderTexture.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A RenderTexture is a special texture that allows any Pixi display object to be rendered to it.
    - *
    - * __Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead.
    - *
    - * A RenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example:
    - *
    - *    var renderTexture = new PIXI.RenderTexture(800, 600);
    - *    var sprite = PIXI.Sprite.fromImage("spinObj_01.png");
    - *    sprite.position.x = 800/2;
    - *    sprite.position.y = 600/2;
    - *    sprite.anchor.x = 0.5;
    - *    sprite.anchor.y = 0.5;
    - *    renderTexture.render(sprite);
    - *
    - * The Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual position a DisplayObjectContainer should be used:
    - *
    - *    var doc = new PIXI.DisplayObjectContainer();
    - *    doc.addChild(sprite);
    - *    renderTexture.render(doc);  // Renders to center of renderTexture
    - *
    - * @class RenderTexture
    - * @extends Texture
    - * @constructor
    - * @param width {Number} The width of the render texture
    - * @param height {Number} The height of the render texture
    - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @param resolution {Number} The resolution of the texture being generated
    - */
    -PIXI.RenderTexture = function(width, height, renderer, scaleMode, resolution)
    -{
    -    /**
    -     * The with of the render texture
    -     *
    -     * @property width
    -     * @type Number
    -     */
    -    this.width = width || 100;
    -
    -    /**
    -     * The height of the render texture
    -     *
    -     * @property height
    -     * @type Number
    -     */
    -    this.height = height || 100;
    -
    -    /**
    -     * The Resolution of the texture.
    -     *
    -     * @property resolution
    -     * @type Number
    -     */
    -    this.resolution = resolution || 1;
    -
    -    /**
    -     * The framing rectangle of the render texture
    -     *
    -     * @property frame
    -     * @type Rectangle
    -     */
    -    this.frame = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution);
    -
    -    /**
    -     * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,
    -     * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)
    -     *
    -     * @property crop
    -     * @type Rectangle
    -     */
    -    this.crop = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution);
    -
    -    /**
    -     * The base texture object that this texture uses
    -     *
    -     * @property baseTexture
    -     * @type BaseTexture
    -     */
    -    this.baseTexture = new PIXI.BaseTexture();
    -    this.baseTexture.width = this.width * this.resolution;
    -    this.baseTexture.height = this.height * this.resolution;
    -    this.baseTexture._glTextures = [];
    -    this.baseTexture.resolution = this.resolution;
    -
    -    this.baseTexture.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT;
    -
    -    this.baseTexture.hasLoaded = true;
    -
    -    PIXI.Texture.call(this,
    -        this.baseTexture,
    -        new PIXI.Rectangle(0, 0, this.width, this.height)
    -    );
    -
    -    /**
    -     * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL.
    -     *
    -     * @property renderer
    -     * @type CanvasRenderer|WebGLRenderer
    -     */
    -    this.renderer = renderer || PIXI.defaultRenderer;
    -
    -    if(this.renderer.type === PIXI.WEBGL_RENDERER)
    -    {
    -        var gl = this.renderer.gl;
    -        this.baseTexture._dirty[gl.id] = false;
    -
    -        this.textureBuffer = new PIXI.FilterTexture(gl, this.width * this.resolution, this.height * this.resolution, this.baseTexture.scaleMode);
    -        this.baseTexture._glTextures[gl.id] =  this.textureBuffer.texture;
    -
    -        this.render = this.renderWebGL;
    -        this.projection = new PIXI.Point(this.width*0.5, -this.height*0.5);
    -    }
    -    else
    -    {
    -        this.render = this.renderCanvas;
    -        this.textureBuffer = new PIXI.CanvasBuffer(this.width* this.resolution, this.height* this.resolution);
    -        this.baseTexture.source = this.textureBuffer.canvas;
    -    }
    -
    -    /**
    -     * @property valid
    -     * @type Boolean
    -     */
    -    this.valid = true;
    -
    -    this._updateUvs();
    -};
    -
    -PIXI.RenderTexture.prototype = Object.create(PIXI.Texture.prototype);
    -PIXI.RenderTexture.prototype.constructor = PIXI.RenderTexture;
    -
    -/**
    - * Resizes the RenderTexture.
    - *
    - * @method resize
    - * @param width {Number} The width to resize to.
    - * @param height {Number} The height to resize to.
    - * @param updateBase {Boolean} Should the baseTexture.width and height values be resized as well?
    - */
    -PIXI.RenderTexture.prototype.resize = function(width, height, updateBase)
    -{
    -    if (width === this.width && height === this.height)return;
    -
    -    this.valid = (width > 0 && height > 0);
    -
    -    this.width = this.frame.width = this.crop.width = width;
    -    this.height =  this.frame.height = this.crop.height = height;
    -
    -    if (updateBase)
    -    {
    -        this.baseTexture.width = this.width;
    -        this.baseTexture.height = this.height;
    -    }
    -
    -    if (this.renderer.type === PIXI.WEBGL_RENDERER)
    -    {
    -        this.projection.x = this.width / 2;
    -        this.projection.y = -this.height / 2;
    -    }
    -
    -    if(!this.valid)return;
    -
    -    this.textureBuffer.resize(this.width * this.resolution, this.height * this.resolution);
    -};
    -
    -/**
    - * Clears the RenderTexture.
    - *
    - * @method clear
    - */
    -PIXI.RenderTexture.prototype.clear = function()
    -{
    -    if(!this.valid)return;
    -
    -    if (this.renderer.type === PIXI.WEBGL_RENDERER)
    -    {
    -        this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer);
    -    }
    -
    -    this.textureBuffer.clear();
    -};
    -
    -/**
    - * This function will draw the display object to the texture.
    - *
    - * @method renderWebGL
    - * @param displayObject {DisplayObject} The display object to render this texture on
    - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering.
    - * @param [clear] {Boolean} If true the texture will be cleared before the displayObject is drawn
    - * @private
    - */
    -PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, matrix, clear)
    -{
    -    if(!this.valid)return;
    -    //TOOD replace position with matrix..
    -   
    -    //Lets create a nice matrix to apply to our display object. Frame buffers come in upside down so we need to flip the matrix 
    -    var wt = displayObject.worldTransform;
    -    wt.identity();
    -    wt.translate(0, this.projection.y * 2);
    -    if(matrix)wt.append(matrix);
    -    wt.scale(1,-1);
    -
    -    // setWorld Alpha to ensure that the object is renderer at full opacity
    -    displayObject.worldAlpha = 1;
    -
    -    // Time to update all the children of the displayObject with the new matrix..    
    -    var children = displayObject.children;
    -
    -    for(var i=0,j=children.length; i<j; i++)
    -    {
    -        children[i].updateTransform();
    -    }
    -    
    -    // time for the webGL fun stuff!
    -    var gl = this.renderer.gl;
    -
    -    gl.viewport(0, 0, this.width * this.resolution, this.height * this.resolution);
    -
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, this.textureBuffer.frameBuffer );
    -
    -    if(clear)this.textureBuffer.clear();
    -
    -    this.renderer.spriteBatch.dirty = true;
    -
    -    this.renderer.renderDisplayObject(displayObject, this.projection, this.textureBuffer.frameBuffer);
    -
    -    this.renderer.spriteBatch.dirty = true;
    -};
    -
    -
    -/**
    - * This function will draw the display object to the texture.
    - *
    - * @method renderCanvas
    - * @param displayObject {DisplayObject} The display object to render this texture on
    - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering.
    - * @param [clear] {Boolean} If true the texture will be cleared before the displayObject is drawn
    - * @private
    - */
    -PIXI.RenderTexture.prototype.renderCanvas = function(displayObject, matrix, clear)
    -{
    -    if(!this.valid)return;
    -
    -    var wt = displayObject.worldTransform;
    -    wt.identity();
    -    if(matrix)wt.append(matrix);
    -    
    -    // setWorld Alpha to ensure that the object is renderer at full opacity
    -    displayObject.worldAlpha = 1;
    -
    -    // Time to update all the children of the displayObject with the new matrix..    
    -    var children = displayObject.children;
    -
    -    for(var i = 0, j = children.length; i < j; i++)
    -    {
    -        children[i].updateTransform();
    -    }
    -
    -    if(clear)this.textureBuffer.clear();
    -
    -    var context = this.textureBuffer.context;
    -
    -    var realResolution = this.renderer.resolution;
    -
    -    this.renderer.resolution = this.resolution;
    -
    -    this.renderer.renderDisplayObject(displayObject, context);
    -
    -    this.renderer.resolution = realResolution;
    -};
    -
    -/**
    - * Will return a HTML Image of the texture
    - *
    - * @method getImage
    - * @return {Image}
    - */
    -PIXI.RenderTexture.prototype.getImage = function()
    -{
    -    var image = new Image();
    -    image.src = this.getBase64();
    -    return image;
    -};
    -
    -/**
    - * Will return a a base64 encoded string of this texture. It works by calling RenderTexture.getCanvas and then running toDataURL on that.
    - *
    - * @method getBase64
    - * @return {String} A base64 encoded string of the texture.
    - */
    -PIXI.RenderTexture.prototype.getBase64 = function()
    -{
    -    return this.getCanvas().toDataURL();
    -};
    -
    -/**
    - * Creates a Canvas element, renders this RenderTexture to it and then returns it.
    - *
    - * @method getCanvas
    - * @return {HTMLCanvasElement} A Canvas element with the texture rendered on.
    - */
    -PIXI.RenderTexture.prototype.getCanvas = function()
    -{
    -    if (this.renderer.type === PIXI.WEBGL_RENDERER)
    -    {
    -        var gl =  this.renderer.gl;
    -        var width = this.textureBuffer.width;
    -        var height = this.textureBuffer.height;
    -
    -        var webGLPixels = new Uint8Array(4 * width * height);
    -
    -        gl.bindFramebuffer(gl.FRAMEBUFFER, this.textureBuffer.frameBuffer);
    -        gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, webGLPixels);
    -        gl.bindFramebuffer(gl.FRAMEBUFFER, null);
    -
    -        var tempCanvas = new PIXI.CanvasBuffer(width, height);
    -        var canvasData = tempCanvas.context.getImageData(0, 0, width, height);
    -        canvasData.data.set(webGLPixels);
    -
    -        tempCanvas.context.putImageData(canvasData, 0, 0);
    -
    -        return tempCanvas.canvas;
    -    }
    -    else
    -    {
    -        return this.textureBuffer.canvas;
    -    }
    -};
    -
    -PIXI.RenderTexture.tempMatrix = new PIXI.Matrix();
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_textures_Texture.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_textures_Texture.js.html deleted file mode 100755 index 179da16..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_textures_Texture.js.html +++ /dev/null @@ -1,607 +0,0 @@ - - - - - src/pixi/textures/Texture.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/textures/Texture.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -PIXI.TextureCache = {};
    -PIXI.FrameCache = {};
    -
    -PIXI.TextureCacheIdGenerator = 0;
    -
    -/**
    - * A texture stores the information that represents an image or part of an image. It cannot be added
    - * to the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used.
    - *
    - * @class Texture
    - * @uses EventTarget
    - * @constructor
    - * @param baseTexture {BaseTexture} The base texture source to create the texture from
    - * @param frame {Rectangle} The rectangle frame of the texture to show
    - * @param [crop] {Rectangle} The area of original texture 
    - * @param [trim] {Rectangle} Trimmed texture rectangle
    - */
    -PIXI.Texture = function(baseTexture, frame, crop, trim)
    -{
    -    /**
    -     * Does this Texture have any frame data assigned to it?
    -     *
    -     * @property noFrame
    -     * @type Boolean
    -     */
    -    this.noFrame = false;
    -
    -    if (!frame)
    -    {
    -        this.noFrame = true;
    -        frame = new PIXI.Rectangle(0,0,1,1);
    -    }
    -
    -    if (baseTexture instanceof PIXI.Texture)
    -    {
    -        baseTexture = baseTexture.baseTexture;
    -    }
    -
    -    /**
    -     * The base texture that this texture uses.
    -     *
    -     * @property baseTexture
    -     * @type BaseTexture
    -     */
    -    this.baseTexture = baseTexture;
    -
    -    /**
    -     * The frame specifies the region of the base texture that this texture uses
    -     *
    -     * @property frame
    -     * @type Rectangle
    -     */
    -    this.frame = frame;
    -
    -    /**
    -     * The texture trim data.
    -     *
    -     * @property trim
    -     * @type Rectangle
    -     */
    -    this.trim = trim;
    -
    -    /**
    -     * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.
    -     *
    -     * @property valid
    -     * @type Boolean
    -     */
    -    this.valid = false;
    -
    -    /**
    -     * This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)
    -     *
    -     * @property requiresUpdate
    -     * @type Boolean
    -     */
    -    this.requiresUpdate = false;
    -
    -    /**
    -     * The WebGL UV data cache.
    -     *
    -     * @property _uvs
    -     * @type Object
    -     * @private
    -     */
    -    this._uvs = null;
    -
    -    /**
    -     * The width of the Texture in pixels.
    -     *
    -     * @property width
    -     * @type Number
    -     */
    -    this.width = 0;
    -
    -    /**
    -     * The height of the Texture in pixels.
    -     *
    -     * @property height
    -     * @type Number
    -     */
    -    this.height = 0;
    -
    -    /**
    -     * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,
    -     * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)
    -     *
    -     * @property crop
    -     * @type Rectangle
    -     */
    -    this.crop = crop || new PIXI.Rectangle(0, 0, 1, 1);
    -
    -    if (baseTexture.hasLoaded)
    -    {
    -        if (this.noFrame) frame = new PIXI.Rectangle(0, 0, baseTexture.width, baseTexture.height);
    -        this.setFrame(frame);
    -    }
    -    else
    -    {
    -        baseTexture.addEventListener('loaded', this.onBaseTextureLoaded.bind(this));
    -    }
    -};
    -
    -PIXI.Texture.prototype.constructor = PIXI.Texture;
    -PIXI.EventTarget.mixin(PIXI.Texture.prototype);
    -
    -/**
    - * Called when the base texture is loaded
    - *
    - * @method onBaseTextureLoaded
    - * @private
    - */
    -PIXI.Texture.prototype.onBaseTextureLoaded = function()
    -{
    -    var baseTexture = this.baseTexture;
    -    baseTexture.removeEventListener('loaded', this.onLoaded);
    -
    -    if (this.noFrame) this.frame = new PIXI.Rectangle(0, 0, baseTexture.width, baseTexture.height);
    -
    -    this.setFrame(this.frame);
    -
    -    this.dispatchEvent( { type: 'update', content: this } );
    -};
    -
    -/**
    - * Destroys this texture
    - *
    - * @method destroy
    - * @param destroyBase {Boolean} Whether to destroy the base texture as well
    - */
    -PIXI.Texture.prototype.destroy = function(destroyBase)
    -{
    -    if (destroyBase) this.baseTexture.destroy();
    -
    -    this.valid = false;
    -};
    -
    -/**
    - * Specifies the region of the baseTexture that this texture will use.
    - *
    - * @method setFrame
    - * @param frame {Rectangle} The frame of the texture to set it to
    - */
    -PIXI.Texture.prototype.setFrame = function(frame)
    -{
    -    this.noFrame = false;
    -
    -    this.frame = frame;
    -    this.width = frame.width;
    -    this.height = frame.height;
    -
    -    this.crop.x = frame.x;
    -    this.crop.y = frame.y;
    -    this.crop.width = frame.width;
    -    this.crop.height = frame.height;
    -
    -    if (!this.trim && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height))
    -    {
    -        throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this);
    -    }
    -
    -    this.valid = frame && frame.width && frame.height && this.baseTexture.source && this.baseTexture.hasLoaded;
    -
    -    if (this.trim)
    -    {
    -        this.width = this.trim.width;
    -        this.height = this.trim.height;
    -        this.frame.width = this.trim.width;
    -        this.frame.height = this.trim.height;
    -    }
    -    
    -    if (this.valid) this._updateUvs();
    -
    -};
    -
    -/**
    - * Updates the internal WebGL UV cache.
    - *
    - * @method _updateUvs
    - * @private
    - */
    -PIXI.Texture.prototype._updateUvs = function()
    -{
    -    if(!this._uvs)this._uvs = new PIXI.TextureUvs();
    -
    -    var frame = this.crop;
    -    var tw = this.baseTexture.width;
    -    var th = this.baseTexture.height;
    -    
    -    this._uvs.x0 = frame.x / tw;
    -    this._uvs.y0 = frame.y / th;
    -
    -    this._uvs.x1 = (frame.x + frame.width) / tw;
    -    this._uvs.y1 = frame.y / th;
    -
    -    this._uvs.x2 = (frame.x + frame.width) / tw;
    -    this._uvs.y2 = (frame.y + frame.height) / th;
    -
    -    this._uvs.x3 = frame.x / tw;
    -    this._uvs.y3 = (frame.y + frame.height) / th;
    -};
    -
    -/**
    - * Helper function that creates a Texture object from the given image url.
    - * If the image is not in the texture cache it will be  created and loaded.
    - *
    - * @static
    - * @method fromImage
    - * @param imageUrl {String} The image url of the texture
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @return Texture
    - */
    -PIXI.Texture.fromImage = function(imageUrl, crossorigin, scaleMode)
    -{
    -    var texture = PIXI.TextureCache[imageUrl];
    -
    -    if(!texture)
    -    {
    -        texture = new PIXI.Texture(PIXI.BaseTexture.fromImage(imageUrl, crossorigin, scaleMode));
    -        PIXI.TextureCache[imageUrl] = texture;
    -    }
    -
    -    return texture;
    -};
    -
    -/**
    - * Helper function that returns a Texture objected based on the given frame id.
    - * If the frame id is not in the texture cache an error will be thrown.
    - *
    - * @static
    - * @method fromFrame
    - * @param frameId {String} The frame id of the texture
    - * @return Texture
    - */
    -PIXI.Texture.fromFrame = function(frameId)
    -{
    -    var texture = PIXI.TextureCache[frameId];
    -    if(!texture) throw new Error('The frameId "' + frameId + '" does not exist in the texture cache ');
    -    return texture;
    -};
    -
    -/**
    - * Helper function that creates a new a Texture based on the given canvas element.
    - *
    - * @static
    - * @method fromCanvas
    - * @param canvas {Canvas} The canvas element source of the texture
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @return Texture
    - */
    -PIXI.Texture.fromCanvas = function(canvas, scaleMode)
    -{
    -    var baseTexture = PIXI.BaseTexture.fromCanvas(canvas, scaleMode);
    -
    -    return new PIXI.Texture( baseTexture );
    -
    -};
    -
    -/**
    - * Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object.
    - *
    - * @static
    - * @method addTextureToCache
    - * @param texture {Texture} The Texture to add to the cache.
    - * @param id {String} The id that the texture will be stored against.
    - */
    -PIXI.Texture.addTextureToCache = function(texture, id)
    -{
    -    PIXI.TextureCache[id] = texture;
    -};
    -
    -/**
    - * Remove a texture from the global PIXI.TextureCache.
    - *
    - * @static
    - * @method removeTextureFromCache
    - * @param id {String} The id of the texture to be removed
    - * @return {Texture} The texture that was removed
    - */
    -PIXI.Texture.removeTextureFromCache = function(id)
    -{
    -    var texture = PIXI.TextureCache[id];
    -    delete PIXI.TextureCache[id];
    -    delete PIXI.BaseTextureCache[id];
    -    return texture;
    -};
    -
    -PIXI.TextureUvs = function()
    -{
    -    this.x0 = 0;
    -    this.y0 = 0;
    -
    -    this.x1 = 0;
    -    this.y1 = 0;
    -
    -    this.x2 = 0;
    -    this.y2 = 0;
    -
    -    this.x3 = 0;
    -    this.y3 = 0;
    -};
    -
    -PIXI.Texture.emptyTexture = new PIXI.Texture(new PIXI.BaseTexture());
    -
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_textures_VideoTexture.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_textures_VideoTexture.js.html deleted file mode 100755 index 4e746c8..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_textures_VideoTexture.js.html +++ /dev/null @@ -1,424 +0,0 @@ - - - - - src/pixi/textures/VideoTexture.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/textures/VideoTexture.js

    - -
    -
    -
    -PIXI.VideoTexture = function( source, scaleMode )
    -{
    -    if( !source ){
    -        throw new Error( 'No video source element specified.' );
    -    }
    -
    -    // hook in here to check if video is already available.
    -    // PIXI.BaseTexture looks for a source.complete boolean, plus width & height.
    -
    -    if( (source.readyState === source.HAVE_ENOUGH_DATA || source.readyState === source.HAVE_FUTURE_DATA ) && source.width && source.height )
    -    {
    -        source.complete = true;
    -    }
    -
    -    PIXI.BaseTexture.call( this, source, scaleMode );
    -
    -    this.autoUpdate = false;
    -    this.updateBound = this._onUpdate.bind(this);
    -
    -    if( !source.complete )
    -    {
    -        this._onCanPlay = this.onCanPlay.bind(this);
    -
    -        source.addEventListener( 'canplay', this._onCanPlay );
    -        source.addEventListener( 'canplaythrough', this._onCanPlay );
    -
    -        // started playing..
    -        source.addEventListener( 'play', this.onPlayStart.bind(this) );
    -        source.addEventListener( 'pause', this.onPlayStop.bind(this) );
    -    }
    -
    -};
    -
    -PIXI.VideoTexture.prototype   = Object.create( PIXI.BaseTexture.prototype );
    -
    -PIXI.VideoTexture.constructor = PIXI.VideoTexture;
    -
    -PIXI.VideoTexture.prototype._onUpdate = function()
    -{
    -    if(this.autoUpdate)
    -    {
    -        window.requestAnimationFrame(this.updateBound);
    -        this.dirty();
    -    }
    -};
    -
    -PIXI.VideoTexture.prototype.onPlayStart = function()
    -{
    -    if(!this.autoUpdate)
    -    {
    -        window.requestAnimationFrame(this.updateBound);
    -        this.autoUpdate = true;
    -    }
    -};
    -
    -PIXI.VideoTexture.prototype.onPlayStop = function()
    -{
    -    this.autoUpdate = false;
    -};
    -
    -PIXI.VideoTexture.prototype.onCanPlay = function()
    -{
    -    if( event.type === 'canplaythrough' )
    -    {
    -        this.hasLoaded  = true;
    -
    -
    -        if( this.source )
    -        {
    -            this.source.removeEventListener( 'canplay', this._onCanPlay );
    -            this.source.removeEventListener( 'canplaythrough', this._onCanPlay );
    -
    -            this.width      = this.source.videoWidth;
    -            this.height     = this.source.videoHeight;
    -
    -            // prevent multiple loaded dispatches..
    -            if( !this.__loaded ){
    -                this.__loaded = true;
    -                this.dispatchEvent( { type: 'loaded', content: this } );
    -            }
    -        }
    -    }
    -};
    -
    -
    -/**
    - * Mimic Pixi BaseTexture.from.... method.
    - * @param video
    - * @param scaleMode
    - * @returns {PIXI.VideoTexture}
    - */
    -PIXI.VideoTexture.baseTextureFromVideo = function( video, scaleMode )
    -{
    -    if( !video._pixiId )
    -    {
    -        video._pixiId = 'video_' + PIXI.TextureCacheIdGenerator++;
    -    }
    -
    -    var baseTexture = PIXI.BaseTextureCache[ video._pixiId ];
    -
    -    if( !baseTexture )
    -    {
    -        baseTexture = new PIXI.VideoTexture( video, scaleMode );
    -        PIXI.BaseTextureCache[ video._pixiId ] = baseTexture;
    -    }
    -
    -    return baseTexture;
    -};
    -
    -
    -PIXI.VideoTexture.prototype.destroy = function()
    -{
    -    if( this.source && this.source._pixiId )
    -    {
    -        PIXI.BaseTextureCache[ this.source._pixiId ] = null;
    -        delete PIXI.BaseTextureCache[ this.source._pixiId ];
    -
    -        this.source._pixiId = null;
    -        delete this.source._pixiId;
    -    }
    -
    -    PIXI.BaseTexture.prototype.destroy.call( this );
    -};
    -
    -/**
    - * Mimic PIXI Texture.from... method.
    - * @param video
    - * @param scaleMode
    - * @returns {PIXI.Texture}
    - */
    -PIXI.VideoTexture.textureFromVideo = function( video, scaleMode )
    -{
    -    var baseTexture = PIXI.VideoTexture.baseTextureFromVideo( video, scaleMode );
    -    return new PIXI.Texture( baseTexture );
    -};
    -
    -PIXI.VideoTexture.fromUrl = function( videoSrc, scaleMode )
    -{
    -    var video = document.createElement('video');
    -    video.src = videoSrc;
    -    video.autoPlay = true;
    -    video.play();
    -    return PIXI.VideoTexture.textureFromVideo( video, scaleMode);
    -};
    -
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_utils_Detector.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_utils_Detector.js.html deleted file mode 100755 index 3e9861a..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_utils_Detector.js.html +++ /dev/null @@ -1,363 +0,0 @@ - - - - - src/pixi/utils/Detector.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/utils/Detector.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This helper function will automatically detect which renderer you should be using.
    - * WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by
    - * the browser then this function will return a canvas renderer
    - * @class autoDetectRenderer
    - * @static
    - * @param width=800 {Number} the width of the renderers view
    - * @param height=600 {Number} the height of the renderers view
    - * 
    - * @param [options] {Object} The optional renderer parameters
    - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional
    - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false
    - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment)
    - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context
    - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2
    - * 
    - */
    -PIXI.autoDetectRenderer = function(width, height, options)
    -{
    -    if(!width)width = 800;
    -    if(!height)height = 600;
    -
    -    // BORROWED from Mr Doob (mrdoob.com)
    -    var webgl = ( function () { try {
    -                                    var canvas = document.createElement( 'canvas' );
    -                                    return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) );
    -                                } catch( e ) {
    -                                    return false;
    -                                }
    -                            } )();
    -
    -    if( webgl )
    -    {
    -        return new PIXI.WebGLRenderer(width, height, options);
    -    }
    -
    -    return  new PIXI.CanvasRenderer(width, height, options);
    -};
    -
    -/**
    - * This helper function will automatically detect which renderer you should be using.
    - * This function is very similar to the autoDetectRenderer function except that is will return a canvas renderer for android.
    - * Even thought both android chrome supports webGL the canvas implementation perform better at the time of writing. 
    - * This function will likely change and update as webGL performance improves on these devices.
    - * 
    - * @class autoDetectRecommendedRenderer
    - * @static
    - * @param width=800 {Number} the width of the renderers view
    - * @param height=600 {Number} the height of the renderers view
    - * 
    - * @param [options] {Object} The optional renderer parameters
    - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional
    - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false
    - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment)
    - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context
    - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2
    - * 
    - */
    -PIXI.autoDetectRecommendedRenderer = function(width, height, options)
    -{
    -    if(!width)width = 800;
    -    if(!height)height = 600;
    -
    -    // BORROWED from Mr Doob (mrdoob.com)
    -    var webgl = ( function () { try {
    -                                    var canvas = document.createElement( 'canvas' );
    -                                    return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) );
    -                                } catch( e ) {
    -                                    return false;
    -                                }
    -                            } )();
    -
    -    var isAndroid = /Android/i.test(navigator.userAgent);
    -
    -    if( webgl && !isAndroid)
    -    {
    -        return new PIXI.WebGLRenderer(width, height, options);
    -    }
    -
    -    return  new PIXI.CanvasRenderer(width, height, options);
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_utils_EventTarget.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_utils_EventTarget.js.html deleted file mode 100755 index 39afb18..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_utils_EventTarget.js.html +++ /dev/null @@ -1,562 +0,0 @@ - - - - - src/pixi/utils/EventTarget.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/utils/EventTarget.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * @author Chad Engler https://github.com/englercj @Rolnaaba
    - */
    -
    -/**
    - * Originally based on https://github.com/mrdoob/eventtarget.js/ from mr Doob.
    - * Currently takes inspiration from the nodejs EventEmitter, EventEmitter3, and smokesignals
    - */
    -
    -/**
    - * Mixins event emitter functionality to a class
    - *
    - * @class EventTarget
    - * @example
    - *      function MyEmitter() {}
    - *
    - *      PIXI.EventTarget.mixin(MyEmitter.prototype);
    - *
    - *      var em = new MyEmitter();
    - *      em.emit('eventName', 'some data', 'some more data', {}, null, ...);
    - */
    -PIXI.EventTarget = {
    -    /**
    -     * Backward compat from when this used to be a function
    -     */
    -    call: function callCompat(obj) {
    -        if(obj) {
    -            obj = obj.prototype || obj;
    -            PIXI.EventTarget.mixin(obj);
    -        }
    -    },
    -
    -    /**
    -     * Mixes in the properties of the EventTarget prototype onto another object
    -     *
    -     * @method mixin
    -     * @param object {Object} The obj to mix into
    -     */
    -    mixin: function mixin(obj) {
    -        /**
    -         * Return a list of assigned event listeners.
    -         *
    -         * @method listeners
    -         * @param eventName {String} The events that should be listed.
    -         * @returns {Array} An array of listener functions
    -         */
    -        obj.listeners = function listeners(eventName) {
    -            this._listeners = this._listeners || {};
    -
    -            return this._listeners[eventName] ? this._listeners[eventName].slice() : [];
    -        };
    -
    -        /**
    -         * Emit an event to all registered event listeners.
    -         *
    -         * @method emit
    -         * @alias dispatchEvent
    -         * @param eventName {String} The name of the event.
    -         * @returns {Boolean} Indication if we've emitted an event.
    -         */
    -        obj.emit = obj.dispatchEvent = function emit(eventName, data) {
    -            this._listeners = this._listeners || {};
    -
    -            //backwards compat with old method ".emit({ type: 'something' })"
    -            if(typeof eventName === 'object') {
    -                data = eventName;
    -                eventName = eventName.type;
    -            }
    -
    -            //ensure we are using a real pixi event
    -            if(!data || data.__isEventObject !== true) {
    -                data = new PIXI.Event(this, eventName, data);
    -            }
    -
    -            //iterate the listeners
    -            if(this._listeners && this._listeners[eventName]) {
    -                var listeners = this._listeners[eventName].slice(0),
    -                    length = listeners.length,
    -                    fn = listeners[0],
    -                    i;
    -
    -                for(i = 0; i < length; fn = listeners[++i]) {
    -                    //call the event listener
    -                    fn.call(this, data);
    -
    -                    //if "stopImmediatePropagation" is called, stop calling sibling events
    -                    if(data.stoppedImmediate) {
    -                        return this;
    -                    }
    -                }
    -
    -                //if "stopPropagation" is called then don't bubble the event
    -                if(data.stopped) {
    -                    return this;
    -                }
    -            }
    -
    -            //bubble this event up the scene graph
    -            if(this.parent && this.parent.emit) {
    -                this.parent.emit.call(this.parent, eventName, data);
    -            }
    -
    -            return this;
    -        };
    -
    -        /**
    -         * Register a new EventListener for the given event.
    -         *
    -         * @method on
    -         * @alias addEventListener
    -         * @param eventName {String} Name of the event.
    -         * @param callback {Functon} fn Callback function.
    -         */
    -        obj.on = obj.addEventListener = function on(eventName, fn) {
    -            this._listeners = this._listeners || {};
    -
    -            (this._listeners[eventName] = this._listeners[eventName] || [])
    -                .push(fn);
    -
    -            return this;
    -        };
    -
    -        /**
    -         * Add an EventListener that's only called once.
    -         *
    -         * @method once
    -         * @param eventName {String} Name of the event.
    -         * @param callback {Function} Callback function.
    -         */
    -        obj.once = function once(eventName, fn) {
    -            this._listeners = this._listeners || {};
    -
    -            var self = this;
    -            function onceHandlerWrapper() {
    -                fn.apply(self.off(eventName, onceHandlerWrapper), arguments);
    -            }
    -            onceHandlerWrapper._originalHandler = fn;
    -
    -            return this.on(eventName, onceHandlerWrapper);
    -        };
    -
    -        /**
    -         * Remove event listeners.
    -         *
    -         * @method off
    -         * @alias removeEventListener
    -         * @param eventName {String} The event we want to remove.
    -         * @param callback {Function} The listener that we need to find.
    -         */
    -        obj.off = obj.removeEventListener = function off(eventName, fn) {
    -            this._listeners = this._listeners || {};
    -
    -            if(!this._listeners[eventName])
    -                return this;
    -
    -            var list = this._listeners[eventName],
    -                i = fn ? list.length : 0;
    -
    -            while(i-- > 0) {
    -                if(list[i] === fn || list[i]._originalHandler === fn) {
    -                    list.splice(i, 1);
    -                }
    -            }
    -
    -            if(list.length === 0) {
    -                delete this._listeners[eventName];
    -            }
    -
    -            return this;
    -        };
    -
    -        /**
    -         * Remove all listeners or only the listeners for the specified event.
    -         *
    -         * @method removeAllListeners
    -         * @param eventName {String} The event you want to remove all listeners for.
    -         */
    -        obj.removeAllListeners = function removeAllListeners(eventName) {
    -            this._listeners = this._listeners || {};
    -
    -            if(!this._listeners[eventName])
    -                return this;
    -
    -            delete this._listeners[eventName];
    -
    -            return this;
    -        };
    -    }
    -};
    -
    -/**
    - * Creates an homogenous object for tracking events so users can know what to expect.
    - *
    - * @class Event
    - * @extends Object
    - * @constructor
    - * @param target {Object} The target object that the event is called on
    - * @param name {String} The string name of the event that was triggered
    - * @param data {Object} Arbitrary event data to pass along
    - */
    -PIXI.Event = function(target, name, data) {
    -    //for duck typing in the ".on()" function
    -    this.__isEventObject = true;
    -
    -    /**
    -     * Tracks the state of bubbling propagation. Do not
    -     * set this directly, instead use `event.stopPropagation()`
    -     *
    -     * @property stopped
    -     * @type Boolean
    -     * @private
    -     * @readOnly
    -     */
    -    this.stopped = false;
    -
    -    /**
    -     * Tracks the state of sibling listener propagation. Do not
    -     * set this directly, instead use `event.stopImmediatePropagation()`
    -     *
    -     * @property stoppedImmediate
    -     * @type Boolean
    -     * @private
    -     * @readOnly
    -     */
    -    this.stoppedImmediate = false;
    -
    -    /**
    -     * The original target the event triggered on.
    -     *
    -     * @property target
    -     * @type Object
    -     * @readOnly
    -     */
    -    this.target = target;
    -
    -    /**
    -     * The string name of the event that this represents.
    -     *
    -     * @property type
    -     * @type String
    -     * @readOnly
    -     */
    -    this.type = name;
    -
    -    /**
    -     * The data that was passed in with this event.
    -     *
    -     * @property data
    -     * @type Object
    -     * @readOnly
    -     */
    -    this.data = data;
    -
    -    //backwards compat with older version of events
    -    this.content = data;
    -
    -    /**
    -     * The timestamp when the event occurred.
    -     *
    -     * @property timeStamp
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.timeStamp = Date.now();
    -};
    -
    -/**
    - * Stops the propagation of events up the scene graph (prevents bubbling).
    - *
    - * @method stopPropagation
    - */
    -PIXI.Event.prototype.stopPropagation = function stopPropagation() {
    -    this.stopped = true;
    -};
    -
    -/**
    - * Stops the propagation of events to sibling listeners (no longer calls any listeners).
    - *
    - * @method stopImmediatePropagation
    - */
    -PIXI.Event.prototype.stopImmediatePropagation = function stopImmediatePropagation() {
    -    this.stoppedImmediate = true;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_utils_Polyk.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_utils_Polyk.js.html deleted file mode 100755 index a0a2226..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_utils_Polyk.js.html +++ /dev/null @@ -1,446 +0,0 @@ - - - - - src/pixi/utils/Polyk.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/utils/Polyk.js

    - -
    -
    -/*
    -    PolyK library
    -    url: http://polyk.ivank.net
    -    Released under MIT licence.
    -
    -    Copyright (c) 2012 Ivan Kuckir
    -
    -    Permission is hereby granted, free of charge, to any person
    -    obtaining a copy of this software and associated documentation
    -    files (the "Software"), to deal in the Software without
    -    restriction, including without limitation the rights to use,
    -    copy, modify, merge, publish, distribute, sublicense, and/or sell
    -    copies of the Software, and to permit persons to whom the
    -    Software is furnished to do so, subject to the following
    -    conditions:
    -
    -    The above copyright notice and this permission notice shall be
    -    included in all copies or substantial portions of the Software.
    -
    -    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    -    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
    -    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    -    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
    -    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
    -    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    -    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
    -    OTHER DEALINGS IN THE SOFTWARE.
    -
    -    This is an amazing lib!
    -
    -    Slightly modified by Mat Groves (matgroves.com);
    -*/
    -
    -/**
    - * Based on the Polyk library http://polyk.ivank.net released under MIT licence.
    - * This is an amazing lib!
    - * Slightly modified by Mat Groves (matgroves.com);
    - * @class PolyK
    - */
    -PIXI.PolyK = {};
    -
    -/**
    - * Triangulates shapes for webGL graphic fills.
    - *
    - * @method Triangulate
    - */
    -PIXI.PolyK.Triangulate = function(p)
    -{
    -    var sign = true;
    -
    -    var n = p.length >> 1;
    -    if(n < 3) return [];
    -
    -    var tgs = [];
    -    var avl = [];
    -    for(var i = 0; i < n; i++) avl.push(i);
    -
    -    i = 0;
    -    var al = n;
    -    while(al > 3)
    -    {
    -        var i0 = avl[(i+0)%al];
    -        var i1 = avl[(i+1)%al];
    -        var i2 = avl[(i+2)%al];
    -
    -        var ax = p[2*i0],  ay = p[2*i0+1];
    -        var bx = p[2*i1],  by = p[2*i1+1];
    -        var cx = p[2*i2],  cy = p[2*i2+1];
    -
    -        var earFound = false;
    -        if(PIXI.PolyK._convex(ax, ay, bx, by, cx, cy, sign))
    -        {
    -            earFound = true;
    -            for(var j = 0; j < al; j++)
    -            {
    -                var vi = avl[j];
    -                if(vi === i0 || vi === i1 || vi === i2) continue;
    -
    -                if(PIXI.PolyK._PointInTriangle(p[2*vi], p[2*vi+1], ax, ay, bx, by, cx, cy)) {
    -                    earFound = false;
    -                    break;
    -                }
    -            }
    -        }
    -
    -        if(earFound)
    -        {
    -            tgs.push(i0, i1, i2);
    -            avl.splice((i+1)%al, 1);
    -            al--;
    -            i = 0;
    -        }
    -        else if(i++ > 3*al)
    -        {
    -            // need to flip flip reverse it!
    -            // reset!
    -            if(sign)
    -            {
    -                tgs = [];
    -                avl = [];
    -                for(i = 0; i < n; i++) avl.push(i);
    -
    -                i = 0;
    -                al = n;
    -
    -                sign = false;
    -            }
    -            else
    -            {
    -                window.console.log("PIXI Warning: shape too complex to fill");
    -                return [];
    -            }
    -        }
    -    }
    -
    -    tgs.push(avl[0], avl[1], avl[2]);
    -    return tgs;
    -};
    -
    -/**
    - * Checks whether a point is within a triangle
    - *
    - * @method _PointInTriangle
    - * @param px {Number} x coordinate of the point to test
    - * @param py {Number} y coordinate of the point to test
    - * @param ax {Number} x coordinate of the a point of the triangle
    - * @param ay {Number} y coordinate of the a point of the triangle
    - * @param bx {Number} x coordinate of the b point of the triangle
    - * @param by {Number} y coordinate of the b point of the triangle
    - * @param cx {Number} x coordinate of the c point of the triangle
    - * @param cy {Number} y coordinate of the c point of the triangle
    - * @private
    - * @return {Boolean}
    - */
    -PIXI.PolyK._PointInTriangle = function(px, py, ax, ay, bx, by, cx, cy)
    -{
    -    var v0x = cx-ax;
    -    var v0y = cy-ay;
    -    var v1x = bx-ax;
    -    var v1y = by-ay;
    -    var v2x = px-ax;
    -    var v2y = py-ay;
    -
    -    var dot00 = v0x*v0x+v0y*v0y;
    -    var dot01 = v0x*v1x+v0y*v1y;
    -    var dot02 = v0x*v2x+v0y*v2y;
    -    var dot11 = v1x*v1x+v1y*v1y;
    -    var dot12 = v1x*v2x+v1y*v2y;
    -
    -    var invDenom = 1 / (dot00 * dot11 - dot01 * dot01);
    -    var u = (dot11 * dot02 - dot01 * dot12) * invDenom;
    -    var v = (dot00 * dot12 - dot01 * dot02) * invDenom;
    -
    -    // Check if point is in triangle
    -    return (u >= 0) && (v >= 0) && (u + v < 1);
    -};
    -
    -/**
    - * Checks whether a shape is convex
    - *
    - * @method _convex
    - * @private
    - * @return {Boolean}
    - */
    -PIXI.PolyK._convex = function(ax, ay, bx, by, cx, cy, sign)
    -{
    -    return ((ay-by)*(cx-bx) + (bx-ax)*(cy-by) >= 0) === sign;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/files/src_pixi_utils_Utils.js.html b/tutorial-1/pixi.js-master/docs/files/src_pixi_utils_Utils.js.html deleted file mode 100755 index 2bcfa6e..0000000 --- a/tutorial-1/pixi.js-master/docs/files/src_pixi_utils_Utils.js.html +++ /dev/null @@ -1,485 +0,0 @@ - - - - - src/pixi/utils/Utils.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/utils/Utils.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    - 
    -// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
    -// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
    -
    -// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
    -
    -// MIT license
    -
    -/**
    - * A polyfill for requestAnimationFrame
    - * You can actually use both requestAnimationFrame and requestAnimFrame, 
    - * you will still benefit from the polyfill
    - *
    - * @method requestAnimationFrame
    - */
    -
    -/**
    - * A polyfill for cancelAnimationFrame
    - *
    - * @method cancelAnimationFrame
    - */
    -(function(window) {
    -    var lastTime = 0;
    -    var vendors = ['ms', 'moz', 'webkit', 'o'];
    -    for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
    -        window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
    -        window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] ||
    -            window[vendors[x] + 'CancelRequestAnimationFrame'];
    -    }
    -
    -    if (!window.requestAnimationFrame) {
    -        window.requestAnimationFrame = function(callback) {
    -            var currTime = new Date().getTime();
    -            var timeToCall = Math.max(0, 16 - (currTime - lastTime));
    -            var id = window.setTimeout(function() { callback(currTime + timeToCall); },
    -              timeToCall);
    -            lastTime = currTime + timeToCall;
    -            return id;
    -        };
    -    }
    -
    -    if (!window.cancelAnimationFrame) {
    -        window.cancelAnimationFrame = function(id) {
    -            clearTimeout(id);
    -        };
    -    }
    -
    -    window.requestAnimFrame = window.requestAnimationFrame;
    -})(this);
    -
    -/**
    - * Converts a hex color number to an [R, G, B] array
    - *
    - * @method hex2rgb
    - * @param hex {Number}
    - */
    -PIXI.hex2rgb = function(hex) {
    -    return [(hex >> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255];
    -};
    -
    -/**
    - * Converts a color as an [R, G, B] array to a hex number
    - *
    - * @method rgb2hex
    - * @param rgb {Array}
    - */
    -PIXI.rgb2hex = function(rgb) {
    -    return ((rgb[0]*255 << 16) + (rgb[1]*255 << 8) + rgb[2]*255);
    -};
    -
    -/**
    - * A polyfill for Function.prototype.bind
    - *
    - * @method bind
    - */
    -if (typeof Function.prototype.bind !== 'function') {
    -    Function.prototype.bind = (function () {
    -        return function (thisArg) {
    -            var target = this, i = arguments.length - 1, boundArgs = [];
    -            if (i > 0)
    -            {
    -                boundArgs.length = i;
    -                while (i--) boundArgs[i] = arguments[i + 1];
    -            }
    -
    -            if (typeof target !== 'function') throw new TypeError();
    -
    -            function bound() {
    -                var i = arguments.length, args = new Array(i);
    -                while (i--) args[i] = arguments[i];
    -                args = boundArgs.concat(args);
    -                return target.apply(this instanceof bound ? this : thisArg, args);
    -            }
    -
    -            bound.prototype = (function F(proto) {
    -                if (proto) F.prototype = proto;
    -                if (!(this instanceof F)) return new F();
    -            })(target.prototype);
    -
    -            return bound;
    -        };
    -    })();
    -}
    -
    -/**
    - * A wrapper for ajax requests to be handled cross browser
    - *
    - * @class AjaxRequest
    - * @constructor
    - */
    -PIXI.AjaxRequest = function()
    -{
    -    var activexmodes = ['Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.3.0', 'Microsoft.XMLHTTP']; //activeX versions to check for in IE
    -
    -    if (window.ActiveXObject)
    -    { //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    -        for (var i=0; i<activexmodes.length; i++)
    -        {
    -            try{
    -                return new window.ActiveXObject(activexmodes[i]);
    -            }
    -            catch(e) {
    -                //suppress error
    -            }
    -        }
    -    }
    -    else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    -    {
    -        return new window.XMLHttpRequest();
    -    }
    -    else
    -    {
    -        return false;
    -    }
    -};
    -/*
    -PIXI.packColorRGBA = function(r, g, b, a)//r, g, b, a)
    -{
    -  //  console.log(r, b, c, d)
    -  return (Math.floor((r)*63) << 18) | (Math.floor((g)*63) << 12) | (Math.floor((b)*63) << 6);// | (Math.floor((a)*63))
    -  //  i = i | (Math.floor((a)*63));
    -   // return i;
    -   // var r = (i / 262144.0 ) / 64;
    -   // var g = (i / 4096.0)%64 / 64;
    -  //  var b = (i / 64.0)%64 / 64;
    -  //  var a = (i)%64 / 64;
    -     
    -  //  console.log(r, g, b, a);
    -  //  return i;
    -
    -};
    -*/
    -/*
    -PIXI.packColorRGB = function(r, g, b)//r, g, b, a)
    -{
    -    return (Math.floor((r)*255) << 16) | (Math.floor((g)*255) << 8) | (Math.floor((b)*255));
    -};
    -
    -PIXI.unpackColorRGB = function(r, g, b)//r, g, b, a)
    -{
    -    return (Math.floor((r)*255) << 16) | (Math.floor((g)*255) << 8) | (Math.floor((b)*255));
    -};
    -*/
    -
    -/**
    - * Checks whether the Canvas BlendModes are supported by the current browser
    - *
    - * @method canUseNewCanvasBlendModes
    - * @return {Boolean} whether they are supported
    - */
    -PIXI.canUseNewCanvasBlendModes = function()
    -{
    -    if (typeof document === 'undefined') return false;
    -    var canvas = document.createElement('canvas');
    -    canvas.width = 1;
    -    canvas.height = 1;
    -    var context = canvas.getContext('2d');
    -    context.fillStyle = '#000';
    -    context.fillRect(0,0,1,1);
    -    context.globalCompositeOperation = 'multiply';
    -    context.fillStyle = '#fff';
    -    context.fillRect(0,0,1,1);
    -    return context.getImageData(0,0,1,1).data[0] === 0;
    -};
    -
    -/**
    - * Given a number, this function returns the closest number that is a power of two
    - * this function is taken from Starling Framework as its pretty neat ;)
    - *
    - * @method getNextPowerOfTwo
    - * @param number {Number}
    - * @return {Number} the closest number that is a power of two
    - */
    -PIXI.getNextPowerOfTwo = function(number)
    -{
    -    if (number > 0 && (number & (number - 1)) === 0) // see: http://goo.gl/D9kPj
    -        return number;
    -    else
    -    {
    -        var result = 1;
    -        while (result < number) result <<= 1;
    -        return result;
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/index.html b/tutorial-1/pixi.js-master/docs/index.html deleted file mode 100755 index d44cf89..0000000 --- a/tutorial-1/pixi.js-master/docs/index.html +++ /dev/null @@ -1,292 +0,0 @@ - - - - - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -
    -
    -

    - Browse to a module or class using the sidebar to view its API documentation. -

    - -

    Keyboard Shortcuts

    - -
      -
    • Press s to focus the API search box.

    • - -
    • Use Up and Down to select classes, modules, and search results.

    • - -
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • - -
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/modules/PIXI.html b/tutorial-1/pixi.js-master/docs/modules/PIXI.html deleted file mode 100755 index 3621bb3..0000000 --- a/tutorial-1/pixi.js-master/docs/modules/PIXI.html +++ /dev/null @@ -1,819 +0,0 @@ - - - - - PIXI - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PIXI Module

    -
    - - - - - - - - - -
    - - - -
    - -
    - - - -
    -
    - -

    This module provides the following classes:

    - - - -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/docs/modules/index.html b/tutorial-1/pixi.js-master/docs/modules/index.html deleted file mode 100755 index 487fe15..0000000 --- a/tutorial-1/pixi.js-master/docs/modules/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Redirector - - - - Click here to redirect - - diff --git a/tutorial-1/pixi.js-master/examples/example 1 - Basics/bunny.png b/tutorial-1/pixi.js-master/examples/example 1 - Basics/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 1 - Basics/bunny.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 1 - Basics/index.html b/tutorial-1/pixi.js-master/examples/example 1 - Basics/index.html deleted file mode 100755 index 7da84bb..0000000 --- a/tutorial-1/pixi.js-master/examples/example 1 - Basics/index.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - pixi.js example 1 - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 1 - Basics/indexTest2.html b/tutorial-1/pixi.js-master/examples/example 1 - Basics/indexTest2.html deleted file mode 100755 index 681f6bf..0000000 --- a/tutorial-1/pixi.js-master/examples/example 1 - Basics/indexTest2.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - pixi.js example 1 - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 1 - Basics/mark.html b/tutorial-1/pixi.js-master/examples/example 1 - Basics/mark.html deleted file mode 100755 index b71350c..0000000 --- a/tutorial-1/pixi.js-master/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
    - - -
    - - -
    - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 1 - Basics/stats.min.js b/tutorial-1/pixi.js-master/examples/example 1 - Basics/stats.min.js deleted file mode 100755 index 52539f4..0000000 --- a/tutorial-1/pixi.js-master/examples/example 1 - Basics/stats.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// stats.js - http://github.com/mrdoob/stats.js -var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; -i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); -k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= -"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= -a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); diff --git a/tutorial-1/pixi.js-master/examples/example 10 - Text/desyrel.png b/tutorial-1/pixi.js-master/examples/example 10 - Text/desyrel.png deleted file mode 100755 index c3559e1..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 10 - Text/desyrel.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 10 - Text/desyrel.xml b/tutorial-1/pixi.js-master/examples/example 10 - Text/desyrel.xml deleted file mode 100755 index 54fcdbb..0000000 --- a/tutorial-1/pixi.js-master/examples/example 10 - Text/desyrel.xml +++ /dev/null @@ -1,1922 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tutorial-1/pixi.js-master/examples/example 10 - Text/index.html b/tutorial-1/pixi.js-master/examples/example 10 - Text/index.html deleted file mode 100755 index 23fae9a..0000000 --- a/tutorial-1/pixi.js-master/examples/example 10 - Text/index.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - pixi.js example 10 Text - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 10 - Text/textDemoBG.jpg b/tutorial-1/pixi.js-master/examples/example 10 - Text/textDemoBG.jpg deleted file mode 100755 index 5955e59..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 10 - Text/textDemoBG.jpg and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/index.html b/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/index.html deleted file mode 100755 index 88a7396..0000000 --- a/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/index.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - pixi.js example 11 RenderTexture - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/indexNew.html b/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/indexNew.html deleted file mode 100755 index 9c8e727..0000000 --- a/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/indexNew.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - pixi.js example 11 RenderTexture - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_01.png b/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_01.png deleted file mode 100755 index 8687366..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_01.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_02.png b/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_02.png deleted file mode 100755 index a140876..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_02.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_03.png b/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_03.png deleted file mode 100755 index 82532c7..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_03.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_04.png b/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_04.png deleted file mode 100755 index 9c790c3..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_04.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_05.png b/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_05.png deleted file mode 100755 index ebb28c8..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_05.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_06.png b/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_06.png deleted file mode 100755 index 1dec5c8..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_06.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_07.png b/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_07.png deleted file mode 100755 index e14a021..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_07.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_08.png b/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_08.png deleted file mode 100755 index 0197fef..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 11 - RenderTexture/spinObj_08.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/Pixie.atlas b/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/Pixie.atlas deleted file mode 100755 index 68a8013..0000000 --- a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/Pixie.atlas +++ /dev/null @@ -1,158 +0,0 @@ -Pixie.png -format: RGBA8888 -filter: Linear,Linear -repeat: none -L_foot - rotate: false - xy: 1048, 355 - size: 68, 51 - orig: 68, 51 - offset: 0, 0 - index: -1 -L_hand - rotate: true - xy: 916, 355 - size: 55, 64 - orig: 55, 64 - offset: 0, 0 - index: -1 -L_lower_arm - rotate: false - xy: 1273, 226 - size: 70, 31 - orig: 70, 31 - offset: 0, 0 - index: -1 -L_lower_leg - rotate: false - xy: 1201, 345 - size: 57, 65 - orig: 57, 65 - offset: 0, 0 - index: -1 -L_upper_arm - rotate: true - xy: 1399, 2 - size: 78, 74 - orig: 78, 74 - offset: 0, 0 - index: -1 -L_upper_leg - rotate: false - xy: 1351, 259 - size: 124, 71 - orig: 124, 71 - offset: 0, 0 - index: -1 -R_foot - rotate: false - xy: 1319, 345 - size: 68, 51 - orig: 68, 51 - offset: 0, 0 - index: -1 -R_hand - rotate: true - xy: 982, 355 - size: 55, 64 - orig: 55, 64 - offset: 0, 0 - index: -1 -R_lower_arm - rotate: false - xy: 1345, 226 - size: 70, 31 - orig: 70, 31 - offset: 0, 0 - index: -1 -R_lower_leg - rotate: false - xy: 1260, 345 - size: 57, 65 - orig: 57, 65 - offset: 0, 0 - index: -1 -R_upper_arm - rotate: true - xy: 1399, 82 - size: 78, 74 - orig: 78, 74 - offset: 0, 0 - index: -1 -R_upper_leg - rotate: false - xy: 1389, 332 - size: 124, 71 - orig: 124, 71 - offset: 0, 0 - index: -1 -backHair - rotate: true - xy: 1096, 2 - size: 261, 175 - orig: 261, 175 - offset: 0, 0 - index: -1 -foreWing - rotate: false - xy: 1096, 265 - size: 253, 78 - orig: 253, 78 - offset: 0, 0 - index: -1 -frontHair - rotate: true - xy: 617, 2 - size: 396, 297 - orig: 396, 297 - offset: 0, 0 - index: -1 -groinal - rotate: true - xy: 1515, 296 - size: 103, 84 - orig: 103, 84 - offset: 0, 0 - index: -1 -head - rotate: false - xy: 2, 2 - size: 613, 408 - orig: 613, 408 - offset: 0, 0 - index: -1 -jaw - rotate: true - xy: 1273, 2 - size: 222, 124 - orig: 222, 124 - offset: 0, 0 - index: -1 -midHair - rotate: true - xy: 916, 2 - size: 351, 178 - orig: 351, 178 - offset: 0, 0 - index: -1 -neck - rotate: true - xy: 1118, 345 - size: 65, 81 - orig: 65, 81 - offset: 0, 0 - index: -1 -rearWing - rotate: false - xy: 1477, 148 - size: 136, 146 - orig: 136, 146 - offset: 0, 0 - index: -1 -vest - rotate: false - xy: 1477, 2 - size: 139, 144 - orig: 139, 144 - offset: 0, 0 - index: -1 diff --git a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/Pixie.json b/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/Pixie.json deleted file mode 100755 index bc7e888..0000000 --- a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/Pixie.json +++ /dev/null @@ -1,924 +0,0 @@ -{ -"bones": [ - { "name": "root" }, - { "name": "hip", "parent": "root", "x": -5.36, "y": 120.63 }, - { "name": "L leg upper", "parent": "hip", "length": 90.28, "x": -21.3, "y": -8.59, "rotation": -123.16 }, - { "name": "R leg upper", "parent": "hip", "length": 79.63, "x": 14.54, "y": -29.09, "rotation": -12.07 }, - { "name": "back", "parent": "hip", "length": 117.04, "x": 3.43, "y": 0.51, "rotation": 64.34 }, - { "name": "L arm upper", "parent": "back", "length": 88.01, "x": 120.71, "y": -25.79, "rotation": 108.03 }, - { "name": "L leg lower", "parent": "L leg upper", "length": 77.82, "x": 89.23, "y": 3.84, "rotation": -74.59 }, - { "name": "R arm upper", "parent": "back", "length": 82.87, "x": 107.42, "y": 16.92, "rotation": -108.18 }, - { "name": "R leg lower", "parent": "R leg upper", "length": 67.73, "x": 79.31, "y": -0.23, "rotation": -35.49 }, - { "name": "fore wing", "parent": "back", "length": 174.95, "x": 78.26, "y": 14.47, "rotation": 111.09 }, - { "name": "neck", "parent": "back", "length": 65.79, "x": 115.87, "y": -0.67, "rotation": -1.35 }, - { "name": "L arm lower", "parent": "L arm upper", "length": 57.67, "x": 84.14, "y": -0.57, "rotation": 35.83 }, - { "name": "L foot", "parent": "L leg lower", "length": 57.67, "x": 74.89, "y": -3.37, "rotation": 79.65 }, - { "name": "R arm lower", "parent": "R arm upper", "length": 58.76, "x": 80.97, "y": -3.48, "rotation": 56.62 }, - { "name": "R foot", "parent": "R leg lower", "length": 51.26, "x": 67.69, "y": -1.98, "rotation": 84.54 }, - { "name": "bone1", "parent": "fore wing", "x": 50.67, "y": 19.71 }, - { "name": "head", "parent": "neck", "length": 132.5, "x": 116.13, "y": 41.67, "rotation": -40.37 }, - { "name": "rear wing", "parent": "fore wing", "length": 123.2, "x": 2.22, "y": -11.57, "rotation": -30.89 }, - { "name": "L hand", "parent": "L arm lower", "length": 33.27, "x": 55.37, "y": 1.3, "rotation": 30.89 }, - { "name": "R hand", "parent": "R arm lower", "length": 33.34, "x": 58.46, "y": -1.24, "rotation": 25.65 }, - { "name": "hair back", "parent": "head", "length": 156.52, "x": 43.77, "y": 270.91, "rotation": 22.07 }, - { "name": "jaw", "parent": "head", "length": 139.22, "x": 8.71, "y": -33.25, "rotation": -46.82 }, - { "name": "hair mid", "parent": "hair back", "length": 191.57, "x": 155.16, "y": -89.36, "rotation": -17.61 }, - { "name": "hair front", "parent": "hair mid", "length": 202.73, "x": 48, "y": -100.58, "rotation": -18.29 } -], -"slots": [ - { "name": "L hand", "bone": "L hand", "attachment": "L_hand" }, - { "name": "L arm lower", "bone": "L arm lower", "attachment": "L_lower_arm" }, - { "name": "L arm upper", "bone": "L arm upper", "attachment": "L_upper_arm" }, - { "name": "rear wing", "bone": "rear wing", "attachment": "rearWing" }, - { "name": "L foot", "bone": "L foot", "attachment": "L_foot" }, - { "name": "L leg lower", "bone": "L leg lower", "attachment": "L_lower_leg" }, - { "name": "L leg upper", "bone": "L leg upper", "attachment": "L_upper_leg" }, - { "name": "R foot", "bone": "R foot", "attachment": "R_foot" }, - { "name": "R lower", "bone": "R leg lower", "attachment": "R_lower_leg" }, - { "name": "R upper", "bone": "R leg upper", "attachment": "R_upper_leg" }, - { "name": "hip", "bone": "hip", "attachment": "groinal" }, - { "name": "fore wing", "bone": "fore wing", "attachment": "foreWing" }, - { "name": "neck", "bone": "neck", "attachment": "neck" }, - { "name": "back", "bone": "back", "attachment": "vest" }, - { "name": "R arm upper", "bone": "R arm upper", "attachment": "R_upper_arm" }, - { "name": "R arm lower", "bone": "R arm lower", "attachment": "R_lower_arm" }, - { "name": "R hand", "bone": "R hand", "attachment": "R_hand" }, - { "name": "hair back", "bone": "hair back", "attachment": "backHair" }, - { "name": "hair front", "bone": "hair front", "attachment": "frontHair" }, - { "name": "head", "bone": "head", "attachment": "head" }, - { "name": "jaw", "bone": "jaw", "attachment": "jaw" }, - { "name": "hair mid", "bone": "hair mid", "attachment": "midHair" } -], -"skins": { - "default": { - "L arm lower": { - "L_lower_arm": { "x": 26.8, "y": 0.38, "rotation": -12.92, "width": 70, "height": 31 } - }, - "L arm upper": { - "L_upper_arm": { "x": 43.44, "y": -0.75, "rotation": 43.61, "width": 78, "height": 74 } - }, - "L foot": { - "L_foot": { "x": 25.73, "y": -3.97, "rotation": -37.09, "width": 68, "height": 51 } - }, - "L hand": { - "L_hand": { "x": 16.53, "y": 5.33, "rotation": -19.13, "width": 55, "height": 64 } - }, - "L leg lower": { - "L_lower_leg": { "x": 32.98, "y": 3.71, "rotation": 50.68, "width": 57, "height": 65 } - }, - "L leg upper": { - "L_upper_leg": { "x": 34.37, "y": 6.89, "rotation": 14.72, "width": 124, "height": 71 } - }, - "R arm lower": { - "R_lower_arm": { "x": 27.12, "y": 1.85, "rotation": -12.78, "width": 70, "height": 31 } - }, - "R arm upper": { - "R_upper_arm": { "x": 40.47, "y": -2.66, "rotation": 43.84, "width": 78, "height": 74 } - }, - "R foot": { - "R_foot": { "x": 19.53, "y": -8.7, "rotation": -36.33, "width": 68, "height": 51 } - }, - "R hand": { - "R_hand": { "x": 17.09, "y": -3.59, "rotation": -38.44, "width": 55, "height": 64 } - }, - "R lower": { - "R_lower_leg": { "x": 33.18, "y": -0.42, "rotation": 50.06, "width": 57, "height": 65 } - }, - "R upper": { - "R_upper_leg": { "x": 26.1, "y": 2.57, "rotation": 14.14, "width": 124, "height": 71 } - }, - "back": { - "vest": { "x": 47.37, "y": 12.63, "rotation": -64.34, "width": 139, "height": 144 } - }, - "fore wing": { - "foreWing": { "x": 103.77, "y": -7.39, "rotation": -175.44, "width": 253, "height": 78 } - }, - "hair back": { - "backHair": { "x": 71.84, "y": -6.96, "rotation": -44.69, "width": 261, "height": 175 } - }, - "hair front": { - "frontHair": { "x": 144.79, "y": -43.44, "rotation": -8.77, "width": 396, "height": 297 } - }, - "hair mid": { - "midHair": { "x": 98.77, "y": -24.19, "rotation": -27.07, "width": 351, "height": 178 } - }, - "head": { - "head": { "x": 54.08, "y": 79.01, "rotation": -22.61, "width": 613, "height": 408 } - }, - "hip": { - "groinal": { "x": -1.3, "y": -22.13, "width": 103, "height": 84 } - }, - "jaw": { - "jaw": { "x": 37.24, "y": -10.62, "rotation": 16.36, "width": 222, "height": 124 } - }, - "neck": { - "neck": { "x": 11.64, "y": 0.09, "rotation": -62.99, "width": 65, "height": 81 } - }, - "rear wing": { - "rearWing": { "x": 72.18, "y": -9.33, "rotation": -144.54, "width": 136, "height": 146 } - } - } -}, -"animations": { - "jump": { - "bones": { - "hip": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { - "time": 0, - "x": 0, - "y": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.3666, - "x": 48.25, - "y": 387.29, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L leg upper": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": -52.49 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R leg upper": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 42.23 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "back": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 17.45 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.3666, "x": -12.48, "y": 6.24 }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L arm upper": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": -23.04 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L leg lower": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 21.33 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R arm upper": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": -20.49 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R leg lower": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 18.73 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "fore wing": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1333, "angle": -17.83 }, - { "time": 0.2333, "angle": -0.57 }, - { "time": 0.3333, "angle": -22.57 }, - { "time": 0.4333, "angle": 6.45 }, - { "time": 0.5333, "angle": -15.51 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "neck": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L arm lower": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 16.6 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L foot": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3333, "angle": -19.99 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.3333, "x": -13.89, "y": -5.83 }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R arm lower": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 54.98 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R foot": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": -4.87 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "bone1": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "head": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.3743, - "angle": 13.84, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "rear wing": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1333, "angle": 30.94 }, - { "time": 0.2333, "angle": -24.35 }, - { "time": 0.3333, "angle": 25.11 }, - { "time": 0.4333, "angle": -6.54 }, - { "time": 0.5333, "angle": 24.65 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L hand": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 57.5 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R hand": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 3.65 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "hair back": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3333, "angle": 6.5 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "jaw": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 5.72 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.3666, "x": -4.28, "y": 3.04 }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.3666, "x": 1.169, "y": 1 }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "hair mid": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3333, "angle": 6.71 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "hair front": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3333, "angle": -8.18 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.3333, "x": -17.24, "y": 20.35 }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - } - } - }, - "running": { - "bones": { - "hip": { - "rotate": [ - { "time": 0, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 2.79 }, - { "time": 0.2333, "x": 0, "y": -15.43 }, - { "time": 0.5, "x": 0, "y": 8 }, - { "time": 0.7, "x": 0, "y": -8.92 }, - { "time": 0.9666, "x": 0, "y": 2.79 } - ] - }, - "R leg upper": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.5, "angle": -150.25 }, - { "time": 0.7, "angle": -110.91 }, - { - "time": 0.8333, - "angle": -25.14, - "curve": [ 0.155, 0.16, 0.75, 1 ] - }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.5, "x": -35.15, "y": 0 }, - { "time": 0.7, "x": -6.5, "y": 0 }, - { "time": 1, "x": 2.6, "y": 0 } - ] - }, - "R leg lower": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.5, "angle": 7.47 }, - { "time": 0.7, "angle": -53.49 }, - { - "time": 0.8333, - "angle": -85.3, - "curve": [ 0.16, 0.21, 0.75, 1 ] - }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0.7, "x": 2.5, "y": -1.47 }, - { "time": 0.8333, "x": 3.93, "y": -5.18 } - ] - }, - "R foot": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.2, "angle": 7.03 }, - { "time": 0.2333, "angle": 18.45 }, - { "time": 0.2666, "angle": 26.41 }, - { "time": 0.3, "angle": 29.63 }, - { "time": 0.5, "angle": -22.49 }, - { "time": 0.7, "angle": -30.93 }, - { "time": 0.8333, "angle": -50.37 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0.5, "x": 0.7, "y": -3.84 } - ] - }, - "L leg upper": { - "rotate": [ - { - "time": 0, - "angle": -30.25, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.2333, "angle": 77.26 }, - { - "time": 0.5, - "angle": 104.21, - "curve": [ 0.25, 0, 0.29, 1 ] - }, - { "time": 1, "angle": -30.25 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.5, "x": 22.13, "y": -16.92 }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L leg lower": { - "rotate": [ - { - "time": 0, - "angle": 22.34, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.2333, - "angle": -65.53, - "curve": [ 0.094, -0.03, 0.678, 1.08 ] - }, - { - "time": 0.5, - "angle": 43.39, - "curve": [ 0.25, 0, 0.287, 1 ] - }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 1, "x": 0.58, "y": -1.74 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L foot": { - "rotate": [ - { "time": 0, "angle": -22.23 }, - { "time": 0.2333, "angle": -1.44 }, - { "time": 0.5, "angle": 5.06 }, - { "time": 0.6333, "angle": 27.11 }, - { "time": 0.6666, "angle": 50.34 }, - { "time": 1, "angle": -12.47 } - ], - "translate": [ - { "time": 0, "x": -4.13, "y": -3.42 }, - { "time": 0.6333, "x": 1.22, "y": 1.73 }, - { "time": 0.6666, "x": -0.56, "y": 5.49 }, - { "time": 1, "x": -0.87, "y": -0.96 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "back": { - "rotate": [ - { "time": 0, "angle": -1.79 }, - { "time": 0.2333, "angle": -10.71 }, - { "time": 0.5, "angle": -2.16 }, - { "time": 0.7, "angle": -10.27 }, - { "time": 0.9666, "angle": -1.79 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.2333, "x": 5.2, "y": -6.5 }, - { "time": 0.5, "x": 1.3, "y": -2.6 }, - { "time": 0.7, "x": 7.81, "y": -6.5 }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "R arm upper": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.5, "angle": 235.62 }, - { "time": 0.7, "angle": -57.38 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 } - ] - }, - "R arm lower": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.068, 0, 0.632, 1.14 ] - }, - { "time": 0.5, "angle": -34.21 }, - { - "time": 0.7, - "angle": 17.35, - "curve": [ 0.221, 0.26, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 } - ] - }, - "R hand": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": 30.13 }, - { "time": 0.7, "angle": 3.91 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 } - ] - }, - "L arm upper": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.5, - "angle": -190.85, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "L hand": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 1, 0.75, 1 ] - }, - { - "time": 0.5, - "angle": -15.76, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "L arm lower": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3, "angle": 45.27 }, - { "time": 0.5, "angle": -20.97 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "fore wing": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.2333, "angle": 17.36 }, - { "time": 0.5333, "angle": -2.27 }, - { "time": 0.7333, "angle": 20.14 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "rear wing": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.2333, "angle": 17.36 }, - { "time": 0.5333, "angle": -2.27 }, - { "time": 0.7333, "angle": 20.14 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "head": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.2666, "angle": -13.61 }, - { "time": 0.5, "angle": 0 }, - { "time": 0.7333, "angle": -11.08 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.2666, "x": 4.54, "y": -38.81 }, - { "time": 0.5, "x": 0, "y": 0 }, - { "time": 0.7333, "x": 0.32, "y": -40.1 }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "jaw": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.2333, "angle": -3.93 }, - { "time": 0.4666, "angle": 8.79 }, - { "time": 0.7333, "angle": 13.97 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.2333, "x": 4.63, "y": 6.7 }, - { "time": 0.4666, "x": 6.67, "y": -4.82 }, - { "time": 0.7333, "x": 6.8, "y": -7.61 }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "hair back": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.2333, - "angle": -3.9, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.5, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.7666, - "angle": -4, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.2333, "x": -1.3, "y": -6.5 }, - { "time": 0.5, "x": 0, "y": 0 }, - { "time": 0.7666, "x": -3.49, "y": -10.15 }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "hair front": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.2333, - "angle": -3.9, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.5, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.7666, - "angle": -4, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "hair mid": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.2333, - "angle": -3.9, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.5, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.7666, - "angle": -4, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - } - } - } -} -} diff --git a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/Pixie.png b/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/Pixie.png deleted file mode 100755 index b1e5b77..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/Pixie.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/dragon.atlas b/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/dragon.atlas deleted file mode 100755 index eefbc1d..0000000 --- a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/dragon.atlas +++ /dev/null @@ -1,290 +0,0 @@ - -dragon.png -format: RGBA8888 -filter: Linear,Linear -repeat: none -L_rear_thigh - rotate: false - xy: 895, 20 - size: 91, 148 - orig: 91, 149 - offset: 0, 0 - index: -1 -L_wing01 - rotate: false - xy: 814, 672 - size: 191, 256 - orig: 191, 256 - offset: 0, 0 - index: -1 -L_wing02 - rotate: false - xy: 714, 189 - size: 179, 269 - orig: 179, 269 - offset: 0, 0 - index: -1 -L_wing03 - rotate: false - xy: 785, 463 - size: 186, 207 - orig: 186, 207 - offset: 0, 0 - index: -1 -L_wing05 - rotate: true - xy: 2, 9 - size: 218, 213 - orig: 218, 213 - offset: 0, 0 - index: -1 -L_wing06 - rotate: false - xy: 2, 229 - size: 192, 331 - orig: 192, 331 - offset: 0, 0 - index: -1 -R_wing01 - rotate: true - xy: 502, 709 - size: 219, 310 - orig: 219, 310 - offset: 0, 0 - index: -1 -R_wing02 - rotate: true - xy: 204, 463 - size: 203, 305 - orig: 203, 305 - offset: 0, 0 - index: -1 -R_wing03 - rotate: false - xy: 511, 460 - size: 272, 247 - orig: 272, 247 - offset: 0, 0 - index: -1 -R_wing05 - rotate: false - xy: 196, 232 - size: 251, 229 - orig: 251, 229 - offset: 0, 0 - index: -1 -R_wing06 - rotate: false - xy: 2, 562 - size: 200, 366 - orig: 200, 366 - offset: 0, 0 - index: -1 -R_wing07 - rotate: true - xy: 449, 258 - size: 200, 263 - orig: 200, 263 - offset: 0, 0 - index: -1 -R_wing08 - rotate: false - xy: 467, 2 - size: 234, 254 - orig: 234, 254 - offset: 0, 0 - index: -1 -R_wing09 - rotate: false - xy: 217, 26 - size: 248, 204 - orig: 248, 204 - offset: 0, 0 - index: -1 -back - rotate: false - xy: 703, 2 - size: 190, 185 - orig: 190, 185 - offset: 0, 0 - index: -1 -chest - rotate: true - xy: 895, 170 - size: 136, 122 - orig: 136, 122 - offset: 0, 0 - index: -1 -front_toeA - rotate: false - xy: 976, 972 - size: 29, 50 - orig: 29, 50 - offset: 0, 0 - index: -1 -head - rotate: false - xy: 204, 668 - size: 296, 260 - orig: 296, 260 - offset: 0, 0 - index: -1 -logo - rotate: false - xy: 2, 930 - size: 897, 92 - orig: 897, 92 - offset: 0, 0 - index: -1 -tail01 - rotate: false - xy: 895, 308 - size: 120, 153 - orig: 120, 153 - offset: 0, 0 - index: -1 -tail03 - rotate: false - xy: 901, 930 - size: 73, 92 - orig: 73, 92 - offset: 0, 0 - index: -1 - -dragon2.png -format: RGBA8888 -filter: Linear,Linear -repeat: none -L_front_leg - rotate: true - xy: 391, 141 - size: 84, 57 - orig: 84, 57 - offset: 0, 0 - index: -1 -L_front_thigh - rotate: false - xy: 446, 269 - size: 84, 72 - orig: 84, 72 - offset: 0, 0 - index: -1 -L_rear_leg - rotate: true - xy: 888, 342 - size: 168, 132 - orig: 206, 177 - offset: 19, 20 - index: -1 -L_wing04 - rotate: false - xy: 256, 227 - size: 188, 135 - orig: 188, 135 - offset: 0, 0 - index: -1 -L_wing07 - rotate: false - xy: 2, 109 - size: 159, 255 - orig: 159, 255 - offset: 0, 0 - index: -1 -L_wing08 - rotate: true - xy: 705, 346 - size: 164, 181 - orig: 164, 181 - offset: 0, 0 - index: -1 -L_wing09 - rotate: false - xy: 499, 343 - size: 204, 167 - orig: 204, 167 - offset: 0, 0 - index: -1 -R_front_leg - rotate: false - xy: 273, 34 - size: 101, 89 - orig: 101, 89 - offset: 0, 0 - index: -1 -R_front_thigh - rotate: false - xy: 163, 106 - size: 108, 108 - orig: 108, 108 - offset: 0, 0 - index: -1 -R_rear_leg - rotate: false - xy: 273, 125 - size: 116, 100 - orig: 116, 100 - offset: 0, 0 - index: -1 -R_rear_thigh - rotate: false - xy: 163, 216 - size: 91, 148 - orig: 91, 149 - offset: 0, 0 - index: -1 -R_wing04 - rotate: false - xy: 2, 366 - size: 279, 144 - orig: 279, 144 - offset: 0, 0 - index: -1 -chin - rotate: false - xy: 283, 364 - size: 214, 146 - orig: 214, 146 - offset: 0, 0 - index: -1 -front_toeB - rotate: false - xy: 590, 284 - size: 56, 57 - orig: 56, 57 - offset: 0, 0 - index: -1 -rear-toe - rotate: true - xy: 2, 2 - size: 105, 77 - orig: 109, 77 - offset: 0, 0 - index: -1 -tail02 - rotate: true - xy: 151, 9 - size: 95, 120 - orig: 95, 120 - offset: 0, 0 - index: -1 -tail04 - rotate: false - xy: 532, 270 - size: 56, 71 - orig: 56, 71 - offset: 0, 0 - index: -1 -tail05 - rotate: false - xy: 648, 282 - size: 52, 59 - orig: 52, 59 - offset: 0, 0 - index: -1 -tail06 - rotate: true - xy: 81, 12 - size: 95, 68 - orig: 95, 68 - offset: 0, 0 - index: -1 diff --git a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/dragon.json b/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/dragon.json deleted file mode 100755 index 0d25038..0000000 --- a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/dragon.json +++ /dev/null @@ -1,783 +0,0 @@ -{ -"bones": [ - { "name": "root", "y": -176.12 }, - { "name": "COG", "parent": "root", "y": 176.12 }, - { "name": "back", "parent": "COG", "length": 115.37, "x": 16.03, "y": 27.94, "rotation": 151.83 }, - { "name": "chest", "parent": "COG", "length": 31.24, "x": 52.52, "y": 15.34, "rotation": 161.7 }, - { "name": "neck", "parent": "COG", "length": 41.36, "x": 64.75, "y": 11.98, "rotation": 39.05 }, - { "name": "L_front_thigh", "parent": "chest", "length": 67.42, "x": -45.58, "y": 7.92, "rotation": 138.94 }, - { "name": "L_wing", "parent": "chest", "length": 301.12, "x": -7.24, "y": -24.65, "rotation": -75.51 }, - { "name": "R_front_thigh", "parent": "chest", "length": 81.63, "x": -10.89, "y": 28.25, "rotation": 67.96 }, - { "name": "R_rear_thigh", "parent": "back", "length": 123.46, "x": 65.31, "y": 59.89, "rotation": 104.87 }, - { "name": "chin", "parent": "neck", "length": 153.15, "x": 64.62, "y": -6.99, "rotation": -69.07 }, - { "name": "head", "parent": "neck", "length": 188.83, "x": 69.96, "y": 2.49, "rotation": 8.06 }, - { "name": "tail1", "parent": "back", "length": 65.65, "x": 115.37, "y": -0.19, "rotation": 44.31 }, - { "name": "L_front_leg", "parent": "L_front_thigh", "length": 51.57, "x": 67.42, "y": 0.02, "rotation": 43.36 }, - { "name": "L_rear_thigh", "parent": "R_rear_thigh", "length": 88.05, "x": -8.59, "y": 30.18, "rotation": 28.35 }, - { "name": "R_front_leg", "parent": "R_front_thigh", "length": 66.52, "x": 83.04, "y": -0.3, "rotation": 92.7 }, - { "name": "R_rear_leg", "parent": "R_rear_thigh", "length": 91.06, "x": 123.46, "y": -0.26, "rotation": -129.04 }, - { "name": "R_wing", "parent": "head", "length": 359.5, "x": -74.68, "y": 20.9, "rotation": 83.21 }, - { "name": "tail2", "parent": "tail1", "length": 54.5, "x": 65.65, "y": 0.22, "rotation": 12 }, - { "name": "L_front_toe1", "parent": "L_front_leg", "length": 51.44, "x": 45.53, "y": 2.43, "rotation": -98 }, - { "name": "L_front_toe2", "parent": "L_front_leg", "length": 61.97, "x": 51.57, "y": -0.12, "rotation": -55.26 }, - { "name": "L_front_toe3", "parent": "L_front_leg", "length": 45.65, "x": 54.19, "y": 0.6, "scaleX": 1.134, "rotation": -11.13 }, - { "name": "L_front_toe4", "parent": "L_front_leg", "length": 53.47, "x": 50.6, "y": 7.08, "scaleX": 1.134, "rotation": 19.42 }, - { "name": "L_rear_leg", "parent": "L_rear_thigh", "length": 103.74, "x": 96.04, "y": -0.97, "rotation": -122.41 }, - { "name": "R_front_toe1", "parent": "R_front_leg", "length": 46.65, "x": 70.03, "y": 5.31, "rotation": 8.59 }, - { "name": "R_front_toe2", "parent": "R_front_leg", "length": 53.66, "x": 66.52, "y": 0.33, "rotation": -35.02 }, - { "name": "R_front_toe3", "parent": "R_front_leg", "length": 58.38, "x": 62.1, "y": -0.79, "rotation": -74.67 }, - { "name": "R_rear_toe1", "parent": "R_rear_leg", "length": 94.99, "x": 90.06, "y": 2.12, "rotation": 141.98 }, - { "name": "R_rear_toe2", "parent": "R_rear_leg", "length": 99.29, "x": 89.6, "y": 1.52, "rotation": 125.32 }, - { "name": "R_rear_toe3", "parent": "R_rear_leg", "length": 103.45, "x": 91.06, "y": -0.35, "rotation": 112.26 }, - { "name": "tail3", "parent": "tail2", "length": 41.78, "x": 54.5, "y": 0.37, "rotation": 1.8 }, - { "name": "tail4", "parent": "tail3", "length": 34.19, "x": 41.78, "y": 0.16, "rotation": -1.8 }, - { "name": "tail5", "parent": "tail4", "length": 32.32, "x": 34.19, "y": -0.19, "rotation": -3.15 }, - { "name": "tail6", "parent": "tail5", "length": 80.08, "x": 32.32, "y": -0.23, "rotation": -29.55 } -], -"slots": [ - { "name": "L_rear_leg", "bone": "L_rear_leg", "attachment": "L_rear_leg" }, - { "name": "L_rear_thigh", "bone": "L_rear_thigh", "attachment": "L_rear_thigh" }, - { "name": "L_wing", "bone": "L_wing", "attachment": "L_wing01" }, - { "name": "tail6", "bone": "tail6", "attachment": "tail06" }, - { "name": "tail5", "bone": "tail5", "attachment": "tail05" }, - { "name": "tail4", "bone": "tail4", "attachment": "tail04" }, - { "name": "tail3", "bone": "tail3", "attachment": "tail03" }, - { "name": "tail2", "bone": "tail2", "attachment": "tail02" }, - { "name": "tail1", "bone": "tail1", "attachment": "tail01" }, - { "name": "back", "bone": "back", "attachment": "back" }, - { "name": "L_front_thigh", "bone": "L_front_thigh", "attachment": "L_front_thigh" }, - { "name": "L_front_leg", "bone": "L_front_leg", "attachment": "L_front_leg" }, - { "name": "L_front_toe1", "bone": "L_front_toe1", "attachment": "front_toeA" }, - { "name": "L_front_toe4", "bone": "L_front_toe4", "attachment": "front_toeB" }, - { "name": "L_front_toe3", "bone": "L_front_toe3", "attachment": "front_toeB" }, - { "name": "L_front_toe2", "bone": "L_front_toe2", "attachment": "front_toeB" }, - { "name": "chest", "bone": "chest", "attachment": "chest" }, - { "name": "R_rear_toe1", "bone": "R_rear_toe1", "attachment": "rear-toe" }, - { "name": "R_rear_toe2", "bone": "R_rear_toe2", "attachment": "rear-toe" }, - { "name": "R_rear_toe3", "bone": "R_rear_toe3", "attachment": "rear-toe" }, - { "name": "R_rear_leg", "bone": "R_rear_leg", "attachment": "R_rear_leg" }, - { "name": "R_rear_thigh", "bone": "R_rear_thigh", "attachment": "R_rear_thigh" }, - { "name": "R_front_toe1", "bone": "R_front_toe1", "attachment": "front_toeB" }, - { "name": "R_front_thigh", "bone": "R_front_thigh", "attachment": "R_front_thigh" }, - { "name": "R_front_leg", "bone": "R_front_leg", "attachment": "R_front_leg" }, - { "name": "R_front_toe2", "bone": "R_front_toe2", "attachment": "front_toeB" }, - { "name": "R_front_toe3", "bone": "R_front_toe3", "attachment": "front_toeB" }, - { "name": "chin", "bone": "chin", "attachment": "chin" }, - { "name": "R_wing", "bone": "R_wing", "attachment": "R_wing01" }, - { "name": "head", "bone": "head", "attachment": "head" }, - { "name": "logo", "bone": "root", "attachment": "logo" } -], -"skins": { - "default": { - "L_front_leg": { - "L_front_leg": { "x": 14.68, "y": 0.48, "rotation": 15.99, "width": 84, "height": 57 } - }, - "L_front_thigh": { - "L_front_thigh": { "x": 27.66, "y": -11.58, "rotation": 58.66, "width": 84, "height": 72 } - }, - "L_front_toe1": { - "front_toeA": { "x": 31.92, "y": 0.61, "rotation": 109.55, "width": 29, "height": 50 } - }, - "L_front_toe2": { - "front_toeB": { "x": 26.83, "y": -4.94, "rotation": 109.51, "width": 56, "height": 57 } - }, - "L_front_toe3": { - "front_toeB": { "x": 18.21, "y": -7.21, "scaleX": 0.881, "scaleY": 0.94, "rotation": 99.71, "width": 56, "height": 57 } - }, - "L_front_toe4": { - "front_toeB": { "x": 23.21, "y": -11.68, "scaleX": 0.881, "rotation": 79.89, "width": 56, "height": 57 } - }, - "L_rear_leg": { - "L_rear_leg": { "x": 67.29, "y": 12.62, "rotation": -162.65, "width": 206, "height": 177 } - }, - "L_rear_thigh": { - "L_rear_thigh": { "x": 56.03, "y": 27.38, "rotation": 74.93, "width": 91, "height": 149 } - }, - "L_wing": { - "L_wing01": { "x": 129.21, "y": -45.49, "rotation": -83.7, "width": 191, "height": 256 }, - "L_wing02": { "x": 126.37, "y": -31.69, "rotation": -86.18, "width": 179, "height": 269 }, - "L_wing03": { "x": 110.26, "y": -90.89, "rotation": -86.18, "width": 186, "height": 207 }, - "L_wing04": { "x": -61.61, "y": -83.26, "rotation": -86.18, "width": 188, "height": 135 }, - "L_wing05": { "x": -90.01, "y": -78.14, "rotation": -86.18, "width": 218, "height": 213 }, - "L_wing06": { "x": -143.76, "y": -83.71, "rotation": -86.18, "width": 192, "height": 331 }, - "L_wing07": { "x": -133.04, "y": -33.89, "rotation": -86.18, "width": 159, "height": 255 }, - "L_wing08": { "x": 50.15, "y": -15.71, "rotation": -86.18, "width": 164, "height": 181 }, - "L_wing09": { "x": 85.94, "y": -11.32, "rotation": -86.18, "width": 204, "height": 167 } - }, - "R_front_leg": { - "R_front_leg": { "x": 17.79, "y": 4.22, "rotation": 37.62, "width": 101, "height": 89 } - }, - "R_front_thigh": { - "R_front_thigh": { "x": 35.28, "y": 2.11, "rotation": 130.33, "width": 108, "height": 108 } - }, - "R_front_toe1": { - "front_toeB": { "x": 24.49, "y": -2.61, "rotation": 104.18, "width": 56, "height": 57 } - }, - "R_front_toe2": { - "front_toeB": { "x": 26.39, "y": 1.16, "rotation": 104.57, "width": 56, "height": 57 } - }, - "R_front_toe3": { - "front_toeB": { "x": 30.66, "y": -0.06, "rotation": 112.29, "width": 56, "height": 57 } - }, - "R_rear_leg": { - "R_rear_leg": { "x": 60.87, "y": -5.72, "rotation": -127.66, "width": 116, "height": 100 } - }, - "R_rear_thigh": { - "R_rear_thigh": { "x": 53.25, "y": 12.58, "rotation": 103.29, "width": 91, "height": 149 } - }, - "R_rear_toe1": { - "rear-toe": { "x": 54.75, "y": -5.72, "rotation": 134.79, "width": 109, "height": 77 } - }, - "R_rear_toe2": { - "rear-toe": { "x": 57.02, "y": -7.22, "rotation": 134.42, "width": 109, "height": 77 } - }, - "R_rear_toe3": { - "rear-toe": { "x": 47.46, "y": -7.64, "rotation": 134.34, "width": 109, "height": 77 } - }, - "R_wing": { - "R_wing01": { "x": 170.08, "y": -23.67, "rotation": -130.33, "width": 219, "height": 310 }, - "R_wing02": { "x": 171.14, "y": -19.33, "rotation": -130.33, "width": 203, "height": 305 }, - "R_wing03": { "x": 166.46, "y": 29.23, "rotation": -130.33, "width": 272, "height": 247 }, - "R_wing04": { "x": 42.94, "y": 134.05, "rotation": -130.33, "width": 279, "height": 144 }, - "R_wing05": { "x": -8.83, "y": 142.59, "rotation": -130.33, "width": 251, "height": 229 }, - "R_wing06": { "x": -123.33, "y": 111.22, "rotation": -130.33, "width": 200, "height": 366 }, - "R_wing07": { "x": -40.17, "y": 118.03, "rotation": -130.33, "width": 200, "height": 263 }, - "R_wing08": { "x": 48.01, "y": 28.76, "rotation": -130.33, "width": 234, "height": 254 }, - "R_wing09": { "x": 128.1, "y": 21.12, "rotation": -130.33, "width": 248, "height": 204 } - }, - "back": { - "back": { "x": 35.84, "y": 19.99, "rotation": -151.83, "width": 190, "height": 185 } - }, - "chest": { - "chest": { "x": -14.6, "y": 24.78, "rotation": -161.7, "width": 136, "height": 122 } - }, - "chin": { - "chin": { "x": 66.55, "y": 7.32, "rotation": 30.01, "width": 214, "height": 146 } - }, - "head": { - "head": { "x": 76.68, "y": 32.21, "rotation": -47.12, "width": 296, "height": 260 } - }, - "logo": { - "logo": { "y": -176.72, "width": 897, "height": 92 } - }, - "tail1": { - "tail01": { "x": 22.59, "y": -4.5, "rotation": 163.85, "width": 120, "height": 153 } - }, - "tail2": { - "tail02": { "x": 18.11, "y": -1.75, "rotation": 151.84, "width": 95, "height": 120 } - }, - "tail3": { - "tail03": { "x": 16.94, "y": -2, "rotation": 150.04, "width": 73, "height": 92 } - }, - "tail4": { - "tail04": { "x": 15.34, "y": -2.17, "rotation": 151.84, "width": 56, "height": 71 } - }, - "tail5": { - "tail05": { "x": 15.05, "y": -3.57, "rotation": 155, "width": 52, "height": 59 } - }, - "tail6": { - "tail06": { "x": 28.02, "y": -16.83, "rotation": -175.44, "width": 95, "height": 68 } - } - } -}, -"animations": { - "flying": { - "slots": { - "L_wing": { - "attachment": [ - { "time": 0, "name": "L_wing01" }, - { "time": 0.0666, "name": "L_wing02" }, - { "time": 0.1333, "name": "L_wing03" }, - { "time": 0.2, "name": "L_wing04" }, - { "time": 0.2666, "name": "L_wing05" }, - { "time": 0.3333, "name": "L_wing06" }, - { "time": 0.4, "name": "L_wing07" }, - { "time": 0.4666, "name": "L_wing08" }, - { "time": 0.5333, "name": "L_wing09" }, - { "time": 0.6, "name": "L_wing01" }, - { "time": 0.7333, "name": "L_wing02" }, - { "time": 0.8, "name": "L_wing03" }, - { "time": 0.8333, "name": "L_wing04" }, - { "time": 0.8666, "name": "L_wing05" }, - { "time": 0.9, "name": "L_wing06" }, - { "time": 0.9333, "name": "L_wing07" }, - { "time": 0.9666, "name": "L_wing08" }, - { "time": 1, "name": "L_wing01" } - ] - }, - "R_wing": { - "attachment": [ - { "time": 0, "name": "R_wing01" }, - { "time": 0.0666, "name": "R_wing02" }, - { "time": 0.1333, "name": "R_wing03" }, - { "time": 0.2, "name": "R_wing04" }, - { "time": 0.2666, "name": "R_wing05" }, - { "time": 0.3333, "name": "R_wing06" }, - { "time": 0.4, "name": "R_wing07" }, - { "time": 0.4666, "name": "R_wing08" }, - { "time": 0.5333, "name": "R_wing09" }, - { "time": 0.6, "name": "R_wing01" }, - { "time": 0.7333, "name": "R_wing02" }, - { "time": 0.7666, "name": "R_wing02" }, - { "time": 0.8, "name": "R_wing03" }, - { "time": 0.8333, "name": "R_wing04" }, - { "time": 0.8666, "name": "R_wing05" }, - { "time": 0.9, "name": "R_wing06" }, - { "time": 0.9333, "name": "R_wing07" }, - { "time": 0.9666, "name": "R_wing08" }, - { "time": 1, "name": "R_wing01" } - ] - } - }, - "bones": { - "back": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 17.39 }, - { "time": 0.5, "angle": 0 }, - { "time": 0.8333, "angle": 7 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "neck": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -8.18 }, - { "time": 0.3333, "angle": -23.16 }, - { "time": 0.5, "angle": -18.01 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "chest": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail1": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -2.42 }, - { "time": 0.3333, "angle": -26.2 }, - { "time": 0.5, "angle": -29.65 }, - { "time": 0.6666, "angle": -23.15 }, - { "time": 0.8333, "angle": -55.46 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_rear_thigh": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail2": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -1.12 }, - { "time": 0.3333, "angle": 10.48 }, - { "time": 0.5, "angle": 7.89 }, - { "time": 0.8333, "angle": -10.38 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail3": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 8.24 }, - { "time": 0.3333, "angle": 15.21 }, - { "time": 0.5, "angle": 14.84 }, - { "time": 0.8333, "angle": -18.9 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail4": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 17.46 }, - { "time": 0.3333, "angle": 22.15 }, - { "time": 0.5, "angle": 22.76 }, - { "time": 0.8333, "angle": -4.37 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail5": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 7.4 }, - { "time": 0.3333, "angle": 28.5 }, - { "time": 0.5, "angle": 21.33 }, - { "time": 0.8333, "angle": -1.27 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail6": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 45.99 }, - { "time": 0.4, "angle": 43.53 }, - { "time": 0.5, "angle": 61.79 }, - { "time": 0.8333, "angle": 13.28 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_rear_leg": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -14.21 }, - { "time": 0.5, "angle": 47.17 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_rear_toe3": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": -36.06 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_rear_toe2": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": -20.32 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_rear_toe1": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": -18.71 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "head": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.408, 1.36, 0.675, 1.43 ] - }, - { "time": 0.5, "angle": 1.03 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "chin": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.416, 1.15, 0.494, 1.27 ] - }, - { "time": 0.3333, "angle": -5.15 }, - { "time": 0.5, "angle": 9.79 }, - { "time": 0.6666, "angle": 18.94 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_thigh": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -19.18 }, - { "time": 0.3333, "angle": -32.02 }, - { "time": 0.5, "angle": -19.62 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_front_thigh": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -12.96 }, - { "time": 0.5, "angle": 16.2 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_leg": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 37.77 }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_toe1": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -16.08 }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_toe2": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.33, "y": 1.029 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_toe4": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": 26.51 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.239, "y": 0.993 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_toe3": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": 16.99 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.402, "y": 1.007 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_front_leg": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 26.07 }, - { "time": 0.5, "angle": -21.6 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_front_toe1": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 29.23 }, - { "time": 0.5, "angle": 34.83 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.412, "y": 1 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_front_toe2": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 24.89 }, - { "time": 0.5, "angle": 23.16 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.407, "y": 1.057 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_front_toe3": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 11.01 }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.329, "y": 1.181 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_rear_leg": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 25.19 }, - { "time": 0.6666, "angle": -15.65 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 } - ] - }, - "COG": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.456, 0.2, 0.422, 1.06 ] - }, - { "time": 0.3333, "angle": 23.93 }, - { - "time": 0.6666, - "angle": 337.8, - "curve": [ 0.41, 0, 0.887, 0.75 ] - }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { - "time": 0, - "x": 0, - "y": 0, - "curve": [ 0.33, 1, 0.816, 1.33 ] - }, - { - "time": 0.5, - "x": 0, - "y": 113.01, - "curve": [ 0.396, 0, 0.709, 2.03 ] - }, - { "time": 1, "x": 0, "y": 0 } - ] - } - } - } -} -} \ No newline at end of file diff --git a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/dragon.png b/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/dragon.png deleted file mode 100755 index bb1fc41..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/dragon.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/dragon2.png b/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/dragon2.png deleted file mode 100755 index 381e77a..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/dragon2.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/goblins.atlas b/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/goblins.atlas deleted file mode 100755 index c9cb702..0000000 --- a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/goblins.atlas +++ /dev/null @@ -1,293 +0,0 @@ - -goblins.png -size: 228,523 -format: RGBA8888 -filter: Linear,Linear -repeat: none -dagger - rotate: false - xy: 2, 43 - size: 26, 108 - orig: 26, 108 - offset: 0, 0 - index: -1 -goblin/eyes-closed - rotate: false - xy: 166, 237 - size: 34, 12 - orig: 34, 12 - offset: 0, 0 - index: -1 -goblin/head - rotate: false - xy: 26, 372 - size: 103, 66 - orig: 103, 66 - offset: 0, 0 - index: -1 -goblin/left-arm - rotate: false - xy: 166, 251 - size: 37, 35 - orig: 37, 35 - offset: 0, 0 - index: -1 -goblin/left-foot - rotate: true - xy: 195, 358 - size: 65, 31 - orig: 65, 31 - offset: 0, 0 - index: -1 -goblin/left-hand - rotate: false - xy: 49, 2 - size: 36, 41 - orig: 36, 41 - offset: 0, 0 - index: -1 -goblin/left-lower-leg - rotate: false - xy: 30, 45 - size: 33, 70 - orig: 33, 70 - offset: 0, 0 - index: -1 -goblin/left-shoulder - rotate: true - xy: 169, 288 - size: 29, 44 - orig: 29, 44 - offset: 0, 0 - index: -1 -goblin/left-upper-leg - rotate: false - xy: 134, 305 - size: 33, 73 - orig: 33, 73 - offset: 0, 0 - index: -1 -goblin/neck - rotate: false - xy: 87, 2 - size: 36, 41 - orig: 36, 41 - offset: 0, 0 - index: -1 -goblin/pelvis - rotate: false - xy: 131, 380 - size: 62, 43 - orig: 62, 43 - offset: 0, 0 - index: -1 -goblin/right-arm - rotate: false - xy: 135, 69 - size: 23, 50 - orig: 23, 50 - offset: 0, 0 - index: -1 -goblin/right-foot - rotate: true - xy: 104, 157 - size: 63, 33 - orig: 63, 33 - offset: 0, 0 - index: -1 -goblin/right-hand - rotate: false - xy: 190, 319 - size: 36, 37 - orig: 36, 37 - offset: 0, 0 - index: -1 -goblin/right-lower-leg - rotate: false - xy: 96, 294 - size: 36, 76 - orig: 36, 76 - offset: 0, 0 - index: -1 -goblin/right-shoulder - rotate: true - xy: 2, 2 - size: 39, 45 - orig: 39, 45 - offset: 0, 0 - index: -1 -goblin/right-upper-leg - rotate: false - xy: 139, 162 - size: 34, 63 - orig: 34, 63 - offset: 0, 0 - index: -1 -goblin/torso - rotate: false - xy: 131, 425 - size: 68, 96 - orig: 68, 96 - offset: 0, 0 - index: -1 -goblin/undie-straps - rotate: true - xy: 201, 466 - size: 55, 19 - orig: 55, 19 - offset: 0, 0 - index: -1 -goblin/undies - rotate: false - xy: 190, 51 - size: 36, 29 - orig: 36, 29 - offset: 0, 0 - index: -1 -goblingirl/eyes-closed - rotate: true - xy: 201, 427 - size: 37, 21 - orig: 37, 21 - offset: 0, 0 - index: -1 -goblingirl/head - rotate: false - xy: 26, 440 - size: 103, 81 - orig: 103, 81 - offset: 0, 0 - index: -1 -goblingirl/left-arm - rotate: true - xy: 175, 198 - size: 37, 35 - orig: 37, 35 - offset: 0, 0 - index: -1 -goblingirl/left-foot - rotate: true - xy: 133, 227 - size: 65, 31 - orig: 65, 31 - offset: 0, 0 - index: -1 -goblingirl/left-hand - rotate: true - xy: 168, 2 - size: 35, 40 - orig: 35, 40 - offset: 0, 0 - index: -1 -goblingirl/left-lower-leg - rotate: false - xy: 65, 45 - size: 33, 70 - orig: 33, 70 - offset: 0, 0 - index: -1 -goblingirl/left-shoulder - rotate: true - xy: 135, 39 - size: 28, 46 - orig: 28, 46 - offset: 0, 0 - index: -1 -goblingirl/left-upper-leg - rotate: false - xy: 98, 222 - size: 33, 70 - orig: 33, 70 - offset: 0, 0 - index: -1 -goblingirl/neck - rotate: true - xy: 125, 2 - size: 35, 41 - orig: 35, 41 - offset: 0, 0 - index: -1 -goblingirl/pelvis - rotate: false - xy: 30, 117 - size: 62, 43 - orig: 62, 43 - offset: 0, 0 - index: -1 -goblingirl/right-arm - rotate: false - xy: 160, 69 - size: 28, 50 - orig: 28, 50 - offset: 0, 0 - index: -1 -goblingirl/right-foot - rotate: true - xy: 100, 56 - size: 63, 33 - orig: 63, 33 - offset: 0, 0 - index: -1 -goblingirl/right-hand - rotate: false - xy: 190, 82 - size: 36, 37 - orig: 36, 37 - offset: 0, 0 - index: -1 -goblingirl/right-lower-leg - rotate: true - xy: 26, 162 - size: 36, 76 - orig: 36, 76 - offset: 0, 0 - index: -1 -goblingirl/right-shoulder - rotate: true - xy: 159, 121 - size: 39, 45 - orig: 39, 45 - offset: 0, 0 - index: -1 -goblingirl/right-upper-leg - rotate: true - xy: 94, 121 - size: 34, 63 - orig: 34, 63 - offset: 0, 0 - index: -1 -goblingirl/torso - rotate: false - xy: 26, 274 - size: 68, 96 - orig: 68, 96 - offset: 0, 0 - index: -1 -goblingirl/undie-straps - rotate: true - xy: 169, 323 - size: 55, 19 - orig: 55, 19 - offset: 0, 0 - index: -1 -goblingirl/undies - rotate: false - xy: 175, 167 - size: 36, 29 - orig: 36, 29 - offset: 0, 0 - index: -1 -shield - rotate: false - xy: 26, 200 - size: 70, 72 - orig: 70, 72 - offset: 0, 0 - index: -1 -spear - rotate: false - xy: 2, 153 - size: 22, 368 - orig: 22, 368 - offset: 0, 0 - index: -1 diff --git a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/goblins.json b/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/goblins.json deleted file mode 100755 index 5d83ae1..0000000 --- a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/goblins.json +++ /dev/null @@ -1 +0,0 @@ -{"skeleton":{"hash":"BMzsp4a1APif5tjCQwomTTo3Ino","spine":"2.1.05","width":233.95,"height":354.87},"bones":[{"name":"root"},{"name":"hip","parent":"root","x":0.64,"y":114.41},{"name":"left upper leg","parent":"hip","length":50.39,"x":14.45,"y":2.81,"rotation":-89.09},{"name":"pelvis","parent":"hip","x":1.41,"y":-6.57},{"name":"right upper leg","parent":"hip","length":42.45,"x":-20.07,"y":-6.83,"rotation":-97.49},{"name":"torso","parent":"hip","length":85.82,"x":-6.42,"y":1.97,"rotation":93.92},{"name":"left lower leg","parent":"left upper leg","length":49.89,"x":56.34,"y":0.98,"rotation":-16.65},{"name":"left shoulder","parent":"torso","length":35.43,"x":74.04,"y":-20.38,"rotation":-156.96},{"name":"neck","parent":"torso","length":18.38,"x":81.67,"y":-6.34,"rotation":-1.51},{"name":"right lower leg","parent":"right upper leg","length":58.52,"x":42.99,"y":-0.61,"rotation":-14.34},{"name":"right shoulder","parent":"torso","length":37.24,"x":76.02,"y":18.14,"rotation":133.88},{"name":"head","parent":"neck","length":68.28,"x":20.93,"y":11.59,"rotation":-13.92},{"name":"left arm","parent":"left shoulder","length":35.62,"x":37.85,"y":-2.34,"rotation":28.16},{"name":"left foot","parent":"left lower leg","length":46.5,"x":58.94,"y":-7.61,"rotation":102.43},{"name":"right arm","parent":"right shoulder","length":36.74,"x":37.6,"y":0.31,"rotation":36.32},{"name":"right foot","parent":"right lower leg","length":45.45,"x":64.88,"y":0.04,"rotation":110.3},{"name":"left hand","parent":"left arm","length":11.52,"x":35.62,"y":0.07,"rotation":2.7},{"name":"right hand","parent":"right arm","length":15.32,"x":36.9,"y":0.34,"rotation":2.35}],"slots":[{"name":"left shoulder","bone":"left shoulder","attachment":"left shoulder"},{"name":"left arm","bone":"left arm","attachment":"left arm"},{"name":"left hand item","bone":"left hand","attachment":"spear"},{"name":"left hand","bone":"left hand","attachment":"left hand"},{"name":"left foot","bone":"left foot","attachment":"left foot"},{"name":"left lower leg","bone":"left lower leg","attachment":"left lower leg"},{"name":"left upper leg","bone":"left upper leg","attachment":"left upper leg"},{"name":"neck","bone":"neck","attachment":"neck"},{"name":"torso","bone":"torso","attachment":"torso"},{"name":"pelvis","bone":"pelvis","attachment":"pelvis"},{"name":"right foot","bone":"right foot","attachment":"right foot"},{"name":"right lower leg","bone":"right lower leg","attachment":"right lower leg"},{"name":"undie straps","bone":"pelvis","attachment":"undie straps"},{"name":"undies","bone":"pelvis","attachment":"undies"},{"name":"right upper leg","bone":"right upper leg","attachment":"right upper leg"},{"name":"head","bone":"head","attachment":"head"},{"name":"eyes","bone":"head"},{"name":"right shoulder","bone":"right shoulder","attachment":"right shoulder"},{"name":"right arm","bone":"right arm","attachment":"right arm"},{"name":"right hand item","bone":"right hand"},{"name":"right hand","bone":"right hand","attachment":"right hand"},{"name":"right hand item top","bone":"right hand","attachment":"shield"}],"skins":{"default":{"left hand item":{"dagger":{"x":7.88,"y":-23.45,"rotation":10.47,"width":26,"height":108},"spear":{"x":-4.55,"y":39.2,"rotation":13.04,"width":22,"height":368}},"right hand item":{"dagger":{"x":6.51,"y":-24.15,"rotation":-8.06,"width":26,"height":108}},"right hand item top":{"shield":{"rotation":93.49,"width":70,"height":72}}},"goblin":{"eyes":{"eyes closed":{"name":"goblin/eyes-closed","x":32.21,"y":-21.27,"rotation":-88.92,"width":34,"height":12}},"head":{"head":{"name":"goblin/head","x":25.73,"y":2.33,"rotation":-92.29,"width":103,"height":66}},"left arm":{"left arm":{"name":"goblin/left-arm","x":16.7,"y":-1.69,"scaleX":1.057,"scaleY":1.057,"rotation":33.84,"width":37,"height":35}},"left foot":{"left foot":{"name":"goblin/left-foot","x":24.85,"y":8.74,"rotation":3.32,"width":65,"height":31}},"left hand":{"left hand":{"name":"goblin/left-hand","x":3.47,"y":3.41,"scaleX":0.892,"scaleY":0.892,"rotation":31.14,"width":36,"height":41}},"left lower leg":{"left lower leg":{"name":"goblin/left-lower-leg","x":23.58,"y":-2.06,"rotation":105.75,"width":33,"height":70}},"left shoulder":{"left shoulder":{"name":"goblin/left-shoulder","x":15.56,"y":-2.26,"rotation":62.01,"width":29,"height":44}},"left upper leg":{"left upper leg":{"name":"goblin/left-upper-leg","x":29.68,"y":-3.87,"rotation":89.09,"width":33,"height":73}},"neck":{"neck":{"name":"goblin/neck","x":10.1,"y":0.42,"rotation":-93.69,"width":36,"height":41}},"pelvis":{"pelvis":{"name":"goblin/pelvis","x":-5.61,"y":0.76,"width":62,"height":43}},"right arm":{"right arm":{"name":"goblin/right-arm","x":16.44,"y":-1.04,"rotation":94.32,"width":23,"height":50}},"right foot":{"right foot":{"name":"goblin/right-foot","x":23.56,"y":9.8,"rotation":1.52,"width":63,"height":33}},"right hand":{"right hand":{"name":"goblin/right-hand","x":7.88,"y":2.78,"rotation":91.96,"width":36,"height":37}},"right lower leg":{"right lower leg":{"name":"goblin/right-lower-leg","x":25.68,"y":-3.15,"rotation":111.83,"width":36,"height":76}},"right shoulder":{"right shoulder":{"name":"goblin/right-shoulder","x":15.68,"y":-1.03,"rotation":130.65,"width":39,"height":45}},"right upper leg":{"right upper leg":{"name":"goblin/right-upper-leg","x":20.35,"y":1.47,"rotation":97.49,"width":34,"height":63}},"torso":{"torso":{"name":"goblin/torso","x":38.09,"y":-3.87,"rotation":-94.95,"width":68,"height":96}},"undie straps":{"undie straps":{"name":"goblin/undie-straps","x":-3.87,"y":13.1,"scaleX":1.089,"width":55,"height":19}},"undies":{"undies":{"name":"goblin/undies","x":6.3,"y":0.12,"rotation":0.91,"width":36,"height":29}}},"goblingirl":{"eyes":{"eyes closed":{"name":"goblingirl/eyes-closed","x":28,"y":-25.54,"rotation":-87.04,"width":37,"height":21}},"head":{"head":{"name":"goblingirl/head","x":27.71,"y":-4.32,"rotation":-85.58,"width":103,"height":81}},"left arm":{"left arm":{"name":"goblingirl/left-arm","x":19.64,"y":-2.42,"rotation":33.05,"width":37,"height":35}},"left foot":{"left foot":{"name":"goblingirl/left-foot","x":25.17,"y":7.92,"rotation":3.32,"width":65,"height":31}},"left hand":{"left hand":{"name":"goblingirl/left-hand","x":4.34,"y":2.39,"scaleX":0.896,"scaleY":0.896,"rotation":30.34,"width":35,"height":40}},"left lower leg":{"left lower leg":{"name":"goblingirl/left-lower-leg","x":25.02,"y":-0.6,"rotation":105.75,"width":33,"height":70}},"left shoulder":{"left shoulder":{"name":"goblingirl/left-shoulder","x":19.8,"y":-0.42,"rotation":61.21,"width":28,"height":46}},"left upper leg":{"left upper leg":{"name":"goblingirl/left-upper-leg","x":30.21,"y":-2.95,"rotation":89.09,"width":33,"height":70}},"neck":{"neck":{"name":"goblingirl/neck","x":6.16,"y":-3.14,"rotation":-98.86,"width":35,"height":41}},"pelvis":{"pelvis":{"name":"goblingirl/pelvis","x":-3.87,"y":3.18,"width":62,"height":43}},"right arm":{"right arm":{"name":"goblingirl/right-arm","x":16.85,"y":-0.66,"rotation":93.52,"width":28,"height":50}},"right foot":{"right foot":{"name":"goblingirl/right-foot","x":23.46,"y":9.66,"rotation":1.52,"width":63,"height":33}},"right hand":{"right hand":{"name":"goblingirl/right-hand","x":7.21,"y":3.43,"rotation":91.16,"width":36,"height":37}},"right lower leg":{"right lower leg":{"name":"goblingirl/right-lower-leg","x":26.15,"y":-3.27,"rotation":111.83,"width":36,"height":76}},"right shoulder":{"right shoulder":{"name":"goblingirl/right-shoulder","x":14.46,"y":0.45,"rotation":129.85,"width":39,"height":45}},"right upper leg":{"right upper leg":{"name":"goblingirl/right-upper-leg","x":19.69,"y":2.13,"rotation":97.49,"width":34,"height":63}},"torso":{"torso":{"name":"goblingirl/torso","x":36.28,"y":-5.14,"rotation":-95.74,"width":68,"height":96}},"undie straps":{"undie straps":{"name":"goblingirl/undie-straps","x":-1.51,"y":14.18,"width":55,"height":19}},"undies":{"undies":{"name":"goblingirl/undies","x":5.4,"y":1.7,"width":36,"height":29}}}},"animations":{"walk":{"slots":{"eyes":{"attachment":[{"time":0.7,"name":"eyes closed"},{"time":0.8,"name":null}]}},"bones":{"left upper leg":{"rotate":[{"time":0,"angle":-26.55},{"time":0.1333,"angle":-8.78},{"time":0.2333,"angle":9.51},{"time":0.3666,"angle":30.74},{"time":0.5,"angle":25.33},{"time":0.6333,"angle":26.11},{"time":0.7333,"angle":-7.7},{"time":0.8666,"angle":-21.19},{"time":1,"angle":-26.55}],"translate":[{"time":0,"x":-1.32,"y":1.7},{"time":0.3666,"x":-0.06,"y":2.42},{"time":1,"x":-1.32,"y":1.7}]},"right upper leg":{"rotate":[{"time":0,"angle":42.45},{"time":0.1333,"angle":52.1},{"time":0.2333,"angle":8.53},{"time":0.5,"angle":-16.93},{"time":0.6333,"angle":1.89},{"time":0.7333,"angle":28.06,"curve":[0.462,0.11,1,1]},{"time":0.8666,"angle":58.68,"curve":[0.5,0.02,1,1]},{"time":1,"angle":42.45}],"translate":[{"time":0,"x":6.23,"y":0},{"time":0.2333,"x":2.14,"y":2.4},{"time":0.5,"x":2.44,"y":4.8},{"time":1,"x":6.23,"y":0}]},"left lower leg":{"rotate":[{"time":0,"angle":-22.98},{"time":0.1333,"angle":-63.5},{"time":0.2333,"angle":-73.76},{"time":0.5,"angle":5.11},{"time":0.6333,"angle":-28.29},{"time":0.7333,"angle":4.08},{"time":0.8666,"angle":3.53},{"time":1,"angle":-22.98}],"translate":[{"time":0,"x":0,"y":0},{"time":0.2333,"x":2.55,"y":-0.47},{"time":0.5,"x":0,"y":0,"curve":"stepped"},{"time":1,"x":0,"y":0}]},"left foot":{"rotate":[{"time":0,"angle":-3.69},{"time":0.1333,"angle":-10.42},{"time":0.2333,"angle":-5.01},{"time":0.3666,"angle":3.87},{"time":0.5,"angle":-3.87},{"time":0.6333,"angle":2.78},{"time":0.7333,"angle":1.68},{"time":0.8666,"angle":-8.54},{"time":1,"angle":-3.69}]},"right shoulder":{"rotate":[{"time":0,"angle":5.29,"curve":[0.264,0,0.75,1]},{"time":0.6333,"angle":6.65},{"time":1,"angle":5.29}]},"right arm":{"rotate":[{"time":0,"angle":-4.02,"curve":[0.267,0,0.804,0.99]},{"time":0.6333,"angle":19.78,"curve":[0.307,0,0.787,0.99]},{"time":1,"angle":-4.02}]},"right hand":{"rotate":[{"time":0,"angle":8.98},{"time":0.6333,"angle":0.51},{"time":1,"angle":8.98}]},"left shoulder":{"rotate":[{"time":0,"angle":6.25,"curve":[0.339,0,0.683,1]},{"time":0.5,"angle":-11.78,"curve":[0.281,0,0.686,0.99]},{"time":1,"angle":6.25}],"translate":[{"time":0,"x":1.15,"y":0.23}]},"left hand":{"rotate":[{"time":0,"angle":-21.23,"curve":[0.295,0,0.755,0.98]},{"time":0.5,"angle":-27.28,"curve":[0.241,0,0.75,0.97]},{"time":1,"angle":-21.23}]},"left arm":{"rotate":[{"time":0,"angle":28.37,"curve":[0.339,0,0.683,1]},{"time":0.5,"angle":60.09,"curve":[0.281,0,0.686,0.99]},{"time":1,"angle":28.37}]},"torso":{"rotate":[{"time":0,"angle":-10.28},{"time":0.1333,"angle":-15.38,"curve":[0.545,0,0.818,1]},{"time":0.3666,"angle":-9.78,"curve":[0.58,0.17,0.669,0.99]},{"time":0.6333,"angle":-15.75,"curve":[0.235,0.01,0.795,1]},{"time":0.8666,"angle":-7.06,"curve":[0.209,0,0.816,0.98]},{"time":1,"angle":-10.28}],"translate":[{"time":0,"x":-1.29,"y":1.68}]},"right foot":{"rotate":[{"time":0,"angle":-5.25},{"time":0.2333,"angle":-1.91},{"time":0.3666,"angle":-6.45},{"time":0.5,"angle":-5.39},{"time":0.7333,"angle":-11.68},{"time":0.8666,"angle":0.46},{"time":1,"angle":-5.25}]},"right lower leg":{"rotate":[{"time":0,"angle":-3.39,"curve":[0.316,0.01,0.741,0.98]},{"time":0.1333,"angle":-45.53,"curve":[0.229,0,0.738,0.97]},{"time":0.2333,"angle":-4.83},{"time":0.5,"angle":-19.53},{"time":0.6333,"angle":-64.8},{"time":0.7333,"angle":-82.56,"curve":[0.557,0.18,1,1]},{"time":1,"angle":-3.39}],"translate":[{"time":0,"x":0,"y":0,"curve":"stepped"},{"time":0.5,"x":0,"y":0},{"time":0.6333,"x":2.18,"y":0.21},{"time":1,"x":0,"y":0}]},"hip":{"rotate":[{"time":0,"angle":0,"curve":"stepped"},{"time":1,"angle":0}],"translate":[{"time":0,"x":0,"y":-4.16},{"time":0.1333,"x":0,"y":-7.05,"curve":[0.359,0.47,0.646,0.74]},{"time":0.3666,"x":0,"y":6.78},{"time":0.5,"x":0,"y":-6.13},{"time":0.6333,"x":0,"y":-7.05,"curve":[0.359,0.47,0.646,0.74]},{"time":0.8666,"x":0,"y":6.78},{"time":1,"x":0,"y":-4.16}]},"neck":{"rotate":[{"time":0,"angle":3.6},{"time":0.1333,"angle":17.49},{"time":0.2333,"angle":6.1},{"time":0.3666,"angle":3.45},{"time":0.5,"angle":5.17},{"time":0.6333,"angle":18.36},{"time":0.7333,"angle":6.09},{"time":0.8666,"angle":2.28},{"time":1,"angle":3.6}]},"head":{"rotate":[{"time":0,"angle":3.6,"curve":[0,0,0.704,1.17]},{"time":0.1333,"angle":-0.2},{"time":0.2333,"angle":6.1},{"time":0.3666,"angle":3.45},{"time":0.5,"angle":5.17,"curve":[0,0,0.704,1.61]},{"time":0.6666,"angle":1.1},{"time":0.7333,"angle":6.09},{"time":0.8666,"angle":2.28},{"time":1,"angle":3.6}]}}}}} \ No newline at end of file diff --git a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/goblins.png b/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/goblins.png deleted file mode 100755 index f2cdf16..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/goblins.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/iP4_BGtile.jpg b/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/iP4_BGtile.jpg deleted file mode 100755 index 767a4fd..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/iP4_BGtile.jpg and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/iP4_ground.png b/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/iP4_ground.png deleted file mode 100755 index a7f92af..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/iP4_ground.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/spineboy.atlas b/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/spineboy.atlas deleted file mode 100755 index cf32cd0..0000000 --- a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/spineboy.atlas +++ /dev/null @@ -1,165 +0,0 @@ -spineboy.png -format: RGBA8888 -filter: Linear,Linear -repeat: none -eyes-closed - rotate: false - xy: 73, 509 - size: 34, 27 - orig: 34, 27 - offset: 0, 0 - index: -1 -eyes - rotate: false - xy: 75, 464 - size: 34, 27 - orig: 34, 27 - offset: 0, 0 - index: -1 -head - rotate: false - xy: 2, 2 - size: 121, 132 - orig: 121, 132 - offset: 0, 0 - index: -1 -left-ankle - rotate: false - xy: 96, 351 - size: 25, 32 - orig: 25, 32 - offset: 0, 0 - index: -1 -left-arm - rotate: false - xy: 39, 423 - size: 35, 29 - orig: 35, 29 - offset: 0, 0 - index: -1 -left-foot - rotate: false - xy: 2, 262 - size: 65, 30 - orig: 65, 30 - offset: 0, 0 - index: -1 -left-hand - rotate: false - xy: 2, 423 - size: 35, 38 - orig: 35, 38 - offset: 0, 0 - index: -1 -left-lower-leg - rotate: false - xy: 72, 202 - size: 49, 64 - orig: 49, 64 - offset: 0, 0 - index: -1 -left-pant-bottom - rotate: false - xy: 2, 363 - size: 44, 22 - orig: 44, 22 - offset: 0, 0 - index: -1 -left-shoulder - rotate: false - xy: 39, 454 - size: 34, 53 - orig: 34, 53 - offset: 0, 0 - index: -1 -left-upper-leg - rotate: false - xy: 2, 464 - size: 33, 67 - orig: 33, 67 - offset: 0, 0 - index: -1 -neck - rotate: false - xy: 37, 509 - size: 34, 28 - orig: 34, 28 - offset: 0, 0 - index: -1 -pelvis - rotate: false - xy: 2, 294 - size: 63, 47 - orig: 63, 47 - offset: 0, 0 - index: -1 -right-ankle - rotate: false - xy: 96, 385 - size: 25, 30 - orig: 25, 30 - offset: 0, 0 - index: -1 -right-arm - rotate: false - xy: 96, 417 - size: 21, 45 - orig: 21, 45 - offset: 0, 0 - index: -1 -right-foot-idle - rotate: false - xy: 69, 268 - size: 53, 28 - orig: 53, 28 - offset: 0, 0 - index: -1 -right-foot - rotate: false - xy: 2, 230 - size: 67, 30 - orig: 67, 30 - offset: 0, 0 - index: -1 -right-hand - rotate: false - xy: 2, 387 - size: 32, 32 - orig: 32, 32 - offset: 0, 0 - index: -1 -right-lower-leg - rotate: false - xy: 72, 136 - size: 51, 64 - orig: 51, 64 - offset: 0, 0 - index: -1 -right-pant-bottom - rotate: false - xy: 2, 343 - size: 46, 18 - orig: 46, 18 - offset: 0, 0 - index: -1 -right-shoulder - rotate: false - xy: 67, 298 - size: 52, 51 - orig: 52, 51 - offset: 0, 0 - index: -1 -right-upper-leg - rotate: false - xy: 50, 351 - size: 44, 70 - orig: 44, 70 - offset: 0, 0 - index: -1 -torso - rotate: false - xy: 2, 136 - size: 68, 92 - orig: 68, 92 - offset: 0, 0 - index: -1 diff --git a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/spineboy.json b/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/spineboy.json deleted file mode 100755 index 17c5095..0000000 --- a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/spineboy.json +++ /dev/null @@ -1,787 +0,0 @@ -{ -"bones": [ - { "name": "root" }, - { "name": "hip", "parent": "root", "x": 0.64, "y": 114.41 }, - { "name": "left upper leg", "parent": "hip", "length": 50.39, "x": 14.45, "y": 2.81, "rotation": -89.09 }, - { "name": "left lower leg", "parent": "left upper leg", "length": 56.45, "x": 51.78, "y": 3.46, "rotation": -16.65 }, - { "name": "left foot", "parent": "left lower leg", "length": 46.5, "x": 64.02, "y": -8.67, "rotation": 102.43 }, - { "name": "right upper leg", "parent": "hip", "length": 45.76, "x": -18.27, "rotation": -101.13 }, - { "name": "right lower leg", "parent": "right upper leg", "length": 58.52, "x": 50.21, "y": 0.6, "rotation": -10.7 }, - { "name": "right foot", "parent": "right lower leg", "length": 45.45, "x": 64.88, "y": 0.04, "rotation": 110.3 }, - { "name": "torso", "parent": "hip", "length": 85.82, "x": -6.42, "y": 1.97, "rotation": 94.95 }, - { "name": "neck", "parent": "torso", "length": 18.38, "x": 83.64, "y": -1.78, "rotation": 0.9 }, - { "name": "head", "parent": "neck", "length": 68.28, "x": 19.09, "y": 6.97, "rotation": -8.94 }, - { "name": "right shoulder", "parent": "torso", "length": 49.95, "x": 81.9, "y": 6.79, "rotation": 130.6 }, - { "name": "right arm", "parent": "right shoulder", "length": 36.74, "x": 49.95, "y": -0.12, "rotation": 40.12 }, - { "name": "right hand", "parent": "right arm", "length": 15.32, "x": 36.9, "y": 0.34, "rotation": 2.35 }, - { "name": "left shoulder", "parent": "torso", "length": 44.19, "x": 78.96, "y": -15.75, "rotation": -156.96 }, - { "name": "left arm", "parent": "left shoulder", "length": 35.62, "x": 44.19, "y": -0.01, "rotation": 28.16 }, - { "name": "left hand", "parent": "left arm", "length": 11.52, "x": 35.62, "y": 0.07, "rotation": 2.7 }, - { "name": "pelvis", "parent": "hip", "x": 1.41, "y": -6.57 } -], -"slots": [ - { "name": "left shoulder", "bone": "left shoulder", "attachment": "left-shoulder" }, - { "name": "left arm", "bone": "left arm", "attachment": "left-arm" }, - { "name": "left hand", "bone": "left hand", "attachment": "left-hand" }, - { "name": "left foot", "bone": "left foot", "attachment": "left-foot" }, - { "name": "left lower leg", "bone": "left lower leg", "attachment": "left-lower-leg" }, - { "name": "left upper leg", "bone": "left upper leg", "attachment": "left-upper-leg" }, - { "name": "pelvis", "bone": "pelvis", "attachment": "pelvis" }, - { "name": "right foot", "bone": "right foot", "attachment": "right-foot" }, - { "name": "right lower leg", "bone": "right lower leg", "attachment": "right-lower-leg" }, - { "name": "right upper leg", "bone": "right upper leg", "attachment": "right-upper-leg" }, - { "name": "torso", "bone": "torso", "attachment": "torso" }, - { "name": "neck", "bone": "neck", "attachment": "neck" }, - { "name": "head", "bone": "head", "attachment": "head" }, - { "name": "eyes", "bone": "head", "attachment": "eyes" }, - { "name": "right shoulder", "bone": "right shoulder", "attachment": "right-shoulder" }, - { "name": "right arm", "bone": "right arm", "attachment": "right-arm" }, - { "name": "right hand", "bone": "right hand", "attachment": "right-hand" } -], -"skins": { - "default": { - "left shoulder": { - "left-shoulder": { "x": 23.74, "y": 0.11, "rotation": 62.01, "width": 34, "height": 53 } - }, - "left arm": { - "left-arm": { "x": 15.11, "y": -0.44, "rotation": 33.84, "width": 35, "height": 29 } - }, - "left hand": { - "left-hand": { "x": 0.75, "y": 1.86, "rotation": 31.14, "width": 35, "height": 38 } - }, - "left foot": { - "left-foot": { "x": 24.35, "y": 8.88, "rotation": 3.32, "width": 65, "height": 30 } - }, - "left lower leg": { - "left-lower-leg": { "x": 24.55, "y": -1.92, "rotation": 105.75, "width": 49, "height": 64 } - }, - "left upper leg": { - "left-upper-leg": { "x": 26.12, "y": -1.85, "rotation": 89.09, "width": 33, "height": 67 } - }, - "pelvis": { - "pelvis": { "x": -4.83, "y": 10.62, "width": 63, "height": 47 } - }, - "right foot": { - "right-foot": { "x": 19.02, "y": 8.47, "rotation": 1.52, "width": 67, "height": 30 } - }, - "right lower leg": { - "right-lower-leg": { "x": 23.28, "y": -2.59, "rotation": 111.83, "width": 51, "height": 64 } - }, - "right upper leg": { - "right-upper-leg": { "x": 23.03, "y": 0.25, "rotation": 101.13, "width": 44, "height": 70 } - }, - "torso": { - "torso": { "x": 44.57, "y": -7.08, "rotation": -94.95, "width": 68, "height": 92 } - }, - "neck": { - "neck": { "x": 9.42, "y": -3.66, "rotation": -100.15, "width": 34, "height": 28 } - }, - "head": { - "head": { "x": 53.94, "y": -5.75, "rotation": -86.9, "width": 121, "height": 132 } - }, - "eyes": { - "eyes": { "x": 28.94, "y": -32.92, "rotation": -86.9, "width": 34, "height": 27 }, - "eyes-closed": { "x": 28.77, "y": -32.86, "rotation": -86.9, "width": 34, "height": 27 } - }, - "right shoulder": { - "right-shoulder": { "x": 25.86, "y": 0.03, "rotation": 134.44, "width": 52, "height": 51 } - }, - "right arm": { - "right-arm": { "x": 18.34, "y": -2.64, "rotation": 94.32, "width": 21, "height": 45 } - }, - "right hand": { - "right-hand": { "x": 6.82, "y": 1.25, "rotation": 91.96, "width": 32, "height": 32 } - } - } -}, -"animations": { - "walk": { - "bones": { - "left upper leg": { - "rotate": [ - { "time": 0, "angle": -26.55 }, - { "time": 0.1333, "angle": -8.78 }, - { "time": 0.2666, "angle": 9.51 }, - { "time": 0.4, "angle": 30.74 }, - { "time": 0.5333, "angle": 25.33 }, - { "time": 0.6666, "angle": 26.11 }, - { "time": 0.8, "angle": -7.7 }, - { "time": 0.9333, "angle": -21.19 }, - { "time": 1.0666, "angle": -26.55 } - ], - "translate": [ - { "time": 0, "x": -3, "y": -2.25 }, - { "time": 0.4, "x": -2.18, "y": -2.25 }, - { "time": 1.0666, "x": -3, "y": -2.25 } - ] - }, - "right upper leg": { - "rotate": [ - { "time": 0, "angle": 42.45 }, - { "time": 0.1333, "angle": 52.1 }, - { "time": 0.2666, "angle": 5.96 }, - { "time": 0.5333, "angle": -16.93 }, - { "time": 0.6666, "angle": 1.89 }, - { - "time": 0.8, - "angle": 28.06, - "curve": [ 0.462, 0.11, 1, 1 ] - }, - { - "time": 0.9333, - "angle": 58.68, - "curve": [ 0.5, 0.02, 1, 1 ] - }, - { "time": 1.0666, "angle": 42.45 } - ], - "translate": [ - { "time": 0, "x": 8.11, "y": -2.36 }, - { "time": 0.1333, "x": 10.03, "y": -2.56 }, - { "time": 0.4, "x": 2.76, "y": -2.97 }, - { "time": 0.5333, "x": 2.76, "y": -2.81 }, - { "time": 0.9333, "x": 8.67, "y": -2.54 }, - { "time": 1.0666, "x": 8.11, "y": -2.36 } - ] - }, - "left lower leg": { - "rotate": [ - { "time": 0, "angle": -10.21 }, - { "time": 0.1333, "angle": -55.64 }, - { "time": 0.2666, "angle": -68.12 }, - { "time": 0.5333, "angle": 5.11 }, - { "time": 0.6666, "angle": -28.29 }, - { "time": 0.8, "angle": 4.08 }, - { "time": 0.9333, "angle": 3.53 }, - { "time": 1.0666, "angle": -10.21 } - ] - }, - "left foot": { - "rotate": [ - { "time": 0, "angle": -3.69 }, - { "time": 0.1333, "angle": -10.42 }, - { "time": 0.2666, "angle": -17.14 }, - { "time": 0.4, "angle": -2.83 }, - { "time": 0.5333, "angle": -3.87 }, - { "time": 0.6666, "angle": 2.78 }, - { "time": 0.8, "angle": 1.68 }, - { "time": 0.9333, "angle": -8.54 }, - { "time": 1.0666, "angle": -3.69 } - ] - }, - "right shoulder": { - "rotate": [ - { - "time": 0, - "angle": 20.89, - "curve": [ 0.264, 0, 0.75, 1 ] - }, - { - "time": 0.1333, - "angle": 3.72, - "curve": [ 0.272, 0, 0.841, 1 ] - }, - { "time": 0.6666, "angle": -278.28 }, - { "time": 1.0666, "angle": 20.89 } - ], - "translate": [ - { "time": 0, "x": -7.84, "y": 7.19 }, - { "time": 0.1333, "x": -6.36, "y": 6.42 }, - { "time": 0.6666, "x": -11.07, "y": 5.25 }, - { "time": 1.0666, "x": -7.84, "y": 7.19 } - ] - }, - "right arm": { - "rotate": [ - { - "time": 0, - "angle": -4.02, - "curve": [ 0.267, 0, 0.804, 0.99 ] - }, - { - "time": 0.1333, - "angle": -13.99, - "curve": [ 0.341, 0, 1, 1 ] - }, - { - "time": 0.6666, - "angle": 36.54, - "curve": [ 0.307, 0, 0.787, 0.99 ] - }, - { "time": 1.0666, "angle": -4.02 } - ] - }, - "right hand": { - "rotate": [ - { "time": 0, "angle": 22.92 }, - { "time": 0.4, "angle": -8.97 }, - { "time": 0.6666, "angle": 0.51 }, - { "time": 1.0666, "angle": 22.92 } - ] - }, - "left shoulder": { - "rotate": [ - { "time": 0, "angle": -1.47 }, - { "time": 0.1333, "angle": 13.6 }, - { "time": 0.6666, "angle": 280.74 }, - { "time": 1.0666, "angle": -1.47 } - ], - "translate": [ - { "time": 0, "x": -1.76, "y": 0.56 }, - { "time": 0.6666, "x": -2.47, "y": 8.14 }, - { "time": 1.0666, "x": -1.76, "y": 0.56 } - ] - }, - "left hand": { - "rotate": [ - { - "time": 0, - "angle": 11.58, - "curve": [ 0.169, 0.37, 0.632, 1.55 ] - }, - { - "time": 0.1333, - "angle": 28.13, - "curve": [ 0.692, 0, 0.692, 0.99 ] - }, - { - "time": 0.6666, - "angle": -27.42, - "curve": [ 0.117, 0.41, 0.738, 1.76 ] - }, - { "time": 0.8, "angle": -36.32 }, - { "time": 1.0666, "angle": 11.58 } - ] - }, - "left arm": { - "rotate": [ - { "time": 0, "angle": -8.27 }, - { "time": 0.1333, "angle": 18.43 }, - { "time": 0.6666, "angle": 0.88 }, - { "time": 1.0666, "angle": -8.27 } - ] - }, - "torso": { - "rotate": [ - { "time": 0, "angle": -10.28 }, - { - "time": 0.1333, - "angle": -15.38, - "curve": [ 0.545, 0, 1, 1 ] - }, - { - "time": 0.4, - "angle": -9.78, - "curve": [ 0.58, 0.17, 1, 1 ] - }, - { "time": 0.6666, "angle": -15.75 }, - { "time": 0.9333, "angle": -7.06 }, - { "time": 1.0666, "angle": -10.28 } - ], - "translate": [ - { "time": 0, "x": -3.67, "y": 1.68 }, - { "time": 0.1333, "x": -3.67, "y": 0.68 }, - { "time": 0.4, "x": -3.67, "y": 1.97 }, - { "time": 0.6666, "x": -3.67, "y": -0.14 }, - { "time": 1.0666, "x": -3.67, "y": 1.68 } - ] - }, - "right foot": { - "rotate": [ - { "time": 0, "angle": -5.25 }, - { "time": 0.2666, "angle": -4.08 }, - { "time": 0.4, "angle": -6.45 }, - { "time": 0.5333, "angle": -5.39 }, - { "time": 0.8, "angle": -11.68 }, - { "time": 0.9333, "angle": 0.46 }, - { "time": 1.0666, "angle": -5.25 } - ] - }, - "right lower leg": { - "rotate": [ - { "time": 0, "angle": -3.39 }, - { "time": 0.1333, "angle": -45.53 }, - { "time": 0.2666, "angle": -2.59 }, - { "time": 0.5333, "angle": -19.53 }, - { "time": 0.6666, "angle": -64.8 }, - { - "time": 0.8, - "angle": -82.56, - "curve": [ 0.557, 0.18, 1, 1 ] - }, - { "time": 1.0666, "angle": -3.39 } - ] - }, - "hip": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 1.0666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { - "time": 0.1333, - "x": 0, - "y": -7.61, - "curve": [ 0.272, 0.86, 1, 1 ] - }, - { "time": 0.4, "x": 0, "y": 8.7 }, - { "time": 0.5333, "x": 0, "y": -0.41 }, - { - "time": 0.6666, - "x": 0, - "y": -7.05, - "curve": [ 0.235, 0.89, 1, 1 ] - }, - { "time": 0.8, "x": 0, "y": 2.92 }, - { "time": 0.9333, "x": 0, "y": 6.78 }, - { "time": 1.0666, "x": 0, "y": 0 } - ] - }, - "neck": { - "rotate": [ - { "time": 0, "angle": 3.6 }, - { "time": 0.1333, "angle": 17.49 }, - { "time": 0.2666, "angle": 6.1 }, - { "time": 0.4, "angle": 3.45 }, - { "time": 0.5333, "angle": 5.17 }, - { "time": 0.6666, "angle": 18.36 }, - { "time": 0.8, "angle": 6.09 }, - { "time": 0.9333, "angle": 2.28 }, - { "time": 1.0666, "angle": 3.6 } - ] - }, - "head": { - "rotate": [ - { - "time": 0, - "angle": 3.6, - "curve": [ 0, 0, 0.704, 1.61 ] - }, - { "time": 0.1666, "angle": -0.2 }, - { "time": 0.2666, "angle": 6.1 }, - { "time": 0.4, "angle": 3.45 }, - { - "time": 0.5333, - "angle": 5.17, - "curve": [ 0, 0, 0.704, 1.61 ] - }, - { "time": 0.7, "angle": 1.1 }, - { "time": 0.8, "angle": 6.09 }, - { "time": 0.9333, "angle": 2.28 }, - { "time": 1.0666, "angle": 3.6 } - ] - } - } - }, - "jump": { - "bones": { - "hip": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.9333, "angle": 0, "curve": "stepped" }, - { "time": 1.3666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": -11.57, "y": -3 }, - { "time": 0.2333, "x": -16.2, "y": -19.43 }, - { - "time": 0.3333, - "x": 7.66, - "y": -8.48, - "curve": [ 0.057, 0.06, 0.712, 1 ] - }, - { "time": 0.3666, "x": 15.38, "y": 5.01 }, - { "time": 0.4666, "x": -7.84, "y": 57.22 }, - { - "time": 0.6, - "x": -10.81, - "y": 96.34, - "curve": [ 0.241, 0, 1, 1 ] - }, - { "time": 0.7333, "x": -7.01, "y": 54.7 }, - { "time": 0.8, "x": -10.58, "y": 32.2 }, - { "time": 0.9333, "x": -31.99, "y": 0.45 }, - { "time": 1.0666, "x": -12.48, "y": -29.47 }, - { "time": 1.3666, "x": -11.57, "y": -3 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left upper leg": { - "rotate": [ - { "time": 0, "angle": 17.13 }, - { "time": 0.2333, "angle": 44.35 }, - { "time": 0.3333, "angle": 16.46 }, - { "time": 0.4, "angle": -9.88 }, - { "time": 0.4666, "angle": -11.42 }, - { "time": 0.5666, "angle": 23.46 }, - { "time": 0.7666, "angle": 71.82 }, - { "time": 0.9333, "angle": 65.53 }, - { "time": 1.0666, "angle": 51.01 }, - { "time": 1.3666, "angle": 17.13 } - ], - "translate": [ - { "time": 0, "x": -3, "y": -2.25, "curve": "stepped" }, - { "time": 0.9333, "x": -3, "y": -2.25, "curve": "stepped" }, - { "time": 1.3666, "x": -3, "y": -2.25 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left lower leg": { - "rotate": [ - { "time": 0, "angle": -16.25 }, - { "time": 0.2333, "angle": -52.21 }, - { "time": 0.4, "angle": 15.04 }, - { "time": 0.4666, "angle": -8.95 }, - { "time": 0.5666, "angle": -39.53 }, - { "time": 0.7666, "angle": -27.27 }, - { "time": 0.9333, "angle": -3.52 }, - { "time": 1.0666, "angle": -61.92 }, - { "time": 1.3666, "angle": -16.25 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left foot": { - "rotate": [ - { "time": 0, "angle": 0.33 }, - { "time": 0.2333, "angle": 6.2 }, - { "time": 0.3333, "angle": 14.73 }, - { "time": 0.4, "angle": -15.54 }, - { "time": 0.4333, "angle": -21.2 }, - { "time": 0.5666, "angle": -7.55 }, - { "time": 0.7666, "angle": -0.67 }, - { "time": 0.9333, "angle": -0.58 }, - { "time": 1.0666, "angle": 14.64 }, - { "time": 1.3666, "angle": 0.33 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right upper leg": { - "rotate": [ - { "time": 0, "angle": 25.97 }, - { "time": 0.2333, "angle": 46.43 }, - { "time": 0.3333, "angle": 22.61 }, - { "time": 0.4, "angle": 2.13 }, - { - "time": 0.4666, - "angle": 0.04, - "curve": [ 0, 0, 0.637, 0.98 ] - }, - { "time": 0.6, "angle": 65.55 }, - { "time": 0.7666, "angle": 64.93 }, - { "time": 0.9333, "angle": 41.08 }, - { "time": 1.0666, "angle": 66.25 }, - { "time": 1.3666, "angle": 25.97 } - ], - "translate": [ - { "time": 0, "x": 5.74, "y": 0.61 }, - { "time": 0.2333, "x": 4.79, "y": 1.79 }, - { "time": 0.3333, "x": 6.05, "y": -4.55 }, - { "time": 0.9333, "x": 4.79, "y": 1.79, "curve": "stepped" }, - { "time": 1.0666, "x": 4.79, "y": 1.79 }, - { "time": 1.3666, "x": 5.74, "y": 0.61 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right lower leg": { - "rotate": [ - { "time": 0, "angle": -27.46 }, - { "time": 0.2333, "angle": -64.03 }, - { "time": 0.4, "angle": -48.36 }, - { "time": 0.5666, "angle": -76.86 }, - { "time": 0.7666, "angle": -26.89 }, - { "time": 0.9, "angle": -18.97 }, - { "time": 0.9333, "angle": -14.18 }, - { "time": 1.0666, "angle": -80.45 }, - { "time": 1.3666, "angle": -27.46 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right foot": { - "rotate": [ - { "time": 0, "angle": 1.08 }, - { "time": 0.2333, "angle": 16.02 }, - { "time": 0.3, "angle": 12.94 }, - { "time": 0.3333, "angle": 15.16 }, - { "time": 0.4, "angle": -14.7 }, - { "time": 0.4333, "angle": -12.85 }, - { "time": 0.4666, "angle": -19.18 }, - { "time": 0.5666, "angle": -15.82 }, - { "time": 0.6, "angle": -3.59 }, - { "time": 0.7666, "angle": -3.56 }, - { "time": 0.9333, "angle": 1.86 }, - { "time": 1.0666, "angle": 16.02 }, - { "time": 1.3666, "angle": 1.08 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "torso": { - "rotate": [ - { "time": 0, "angle": -13.35 }, - { "time": 0.2333, "angle": -48.95 }, - { "time": 0.4333, "angle": -35.77 }, - { "time": 0.6, "angle": -4.59 }, - { "time": 0.7666, "angle": 14.61 }, - { "time": 0.9333, "angle": 15.74 }, - { "time": 1.0666, "angle": -32.44 }, - { "time": 1.3666, "angle": -13.35 } - ], - "translate": [ - { "time": 0, "x": -3.67, "y": 1.68, "curve": "stepped" }, - { "time": 0.9333, "x": -3.67, "y": 1.68, "curve": "stepped" }, - { "time": 1.3666, "x": -3.67, "y": 1.68 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "neck": { - "rotate": [ - { "time": 0, "angle": 12.78 }, - { "time": 0.2333, "angle": 16.46 }, - { "time": 0.4, "angle": 26.49 }, - { "time": 0.6, "angle": 15.51 }, - { "time": 0.7666, "angle": 1.34 }, - { "time": 0.9333, "angle": 2.35 }, - { "time": 1.0666, "angle": 6.08 }, - { "time": 1.3, "angle": 21.23 }, - { "time": 1.3666, "angle": 12.78 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "head": { - "rotate": [ - { "time": 0, "angle": 5.19 }, - { "time": 0.2333, "angle": 20.27 }, - { "time": 0.4, "angle": 15.27 }, - { "time": 0.6, "angle": -24.69 }, - { "time": 0.7666, "angle": -11.02 }, - { "time": 0.9333, "angle": -24.38 }, - { "time": 1.0666, "angle": 11.99 }, - { "time": 1.3, "angle": 4.86 }, - { "time": 1.3666, "angle": 5.19 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left shoulder": { - "rotate": [ - { - "time": 0, - "angle": 0.05, - "curve": [ 0, 0, 0.62, 1 ] - }, - { - "time": 0.2333, - "angle": 279.66, - "curve": [ 0.218, 0.67, 0.66, 0.99 ] - }, - { - "time": 0.5, - "angle": 62.27, - "curve": [ 0.462, 0, 0.764, 0.58 ] - }, - { "time": 0.9333, "angle": 28.91 }, - { "time": 1.0666, "angle": -8.62 }, - { "time": 1.1666, "angle": -18.43 }, - { "time": 1.3666, "angle": 0.05 } - ], - "translate": [ - { "time": 0, "x": -1.76, "y": 0.56, "curve": "stepped" }, - { "time": 0.9333, "x": -1.76, "y": 0.56, "curve": "stepped" }, - { "time": 1.3666, "x": -1.76, "y": 0.56 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left hand": { - "rotate": [ - { "time": 0, "angle": 11.58, "curve": "stepped" }, - { "time": 0.9333, "angle": 11.58, "curve": "stepped" }, - { "time": 1.3666, "angle": 11.58 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left arm": { - "rotate": [ - { "time": 0, "angle": 0.51 }, - { "time": 0.4333, "angle": 12.82 }, - { "time": 0.6, "angle": 47.55 }, - { "time": 0.9333, "angle": 12.82 }, - { "time": 1.1666, "angle": -6.5 }, - { "time": 1.3666, "angle": 0.51 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right shoulder": { - "rotate": [ - { - "time": 0, - "angle": 43.82, - "curve": [ 0, 0, 0.62, 1 ] - }, - { - "time": 0.2333, - "angle": -8.74, - "curve": [ 0.304, 0.58, 0.709, 0.97 ] - }, - { - "time": 0.5333, - "angle": -208.02, - "curve": [ 0.462, 0, 0.764, 0.58 ] - }, - { "time": 0.9333, "angle": -246.72 }, - { "time": 1.0666, "angle": -307.13 }, - { "time": 1.1666, "angle": 37.15 }, - { "time": 1.3666, "angle": 43.82 } - ], - "translate": [ - { "time": 0, "x": -7.84, "y": 7.19, "curve": "stepped" }, - { "time": 0.9333, "x": -7.84, "y": 7.19, "curve": "stepped" }, - { "time": 1.3666, "x": -7.84, "y": 7.19 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right arm": { - "rotate": [ - { "time": 0, "angle": -4.02 }, - { "time": 0.6, "angle": 17.5 }, - { "time": 0.9333, "angle": -4.02 }, - { "time": 1.1666, "angle": -16.72 }, - { "time": 1.3666, "angle": -4.02 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right hand": { - "rotate": [ - { "time": 0, "angle": 22.92, "curve": "stepped" }, - { "time": 0.9333, "angle": 22.92, "curve": "stepped" }, - { "time": 1.3666, "angle": 22.92 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "root": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.4333, "angle": -14.52 }, - { "time": 0.8, "angle": 9.86 }, - { "time": 1.3666, "angle": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - } - } - } -} -} diff --git a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/spineboy.png b/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/spineboy.png deleted file mode 100755 index ab85747..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 12 - Spine/data/spineboy.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 12 - Spine/index.html b/tutorial-1/pixi.js-master/examples/example 12 - Spine/index.html deleted file mode 100755 index 514267d..0000000 --- a/tutorial-1/pixi.js-master/examples/example 12 - Spine/index.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - pixi.js example 12 Spine - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 12 - Spine/index_dragon.html b/tutorial-1/pixi.js-master/examples/example 12 - Spine/index_dragon.html deleted file mode 100755 index a4f62d6..0000000 --- a/tutorial-1/pixi.js-master/examples/example 12 - Spine/index_dragon.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - pixi.js example 12 Spine - - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 12 - Spine/index_goblins.html b/tutorial-1/pixi.js-master/examples/example 12 - Spine/index_goblins.html deleted file mode 100755 index 245e9a0..0000000 --- a/tutorial-1/pixi.js-master/examples/example 12 - Spine/index_goblins.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - pixi.js example 12 Spine - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 12 - Spine/index_pixie.html b/tutorial-1/pixi.js-master/examples/example 12 - Spine/index_pixie.html deleted file mode 100755 index 59d0b36..0000000 --- a/tutorial-1/pixi.js-master/examples/example 12 - Spine/index_pixie.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - pixi.js example 12 Spine - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 13 - Graphics/index.html b/tutorial-1/pixi.js-master/examples/example 13 - Graphics/index.html deleted file mode 100755 index 1164b62..0000000 --- a/tutorial-1/pixi.js-master/examples/example 13 - Graphics/index.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - pixi.js example 13 - Graphics - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 13 - Graphics/indexLineTest.html b/tutorial-1/pixi.js-master/examples/example 13 - Graphics/indexLineTest.html deleted file mode 100755 index 2856845..0000000 --- a/tutorial-1/pixi.js-master/examples/example 13 - Graphics/indexLineTest.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - pixi.js example 13 - Graphics - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_01.png b/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_01.png deleted file mode 100755 index 8687366..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_01.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_02.png b/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_02.png deleted file mode 100755 index a140876..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_02.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_03.png b/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_03.png deleted file mode 100755 index 82532c7..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_03.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_04.png b/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_04.png deleted file mode 100755 index 9c790c3..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_04.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_05.png b/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_05.png deleted file mode 100755 index ebb28c8..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_05.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_06.png b/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_06.png deleted file mode 100755 index 1dec5c8..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_06.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_07.png b/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_07.png deleted file mode 100755 index e14a021..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_07.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_08.png b/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_08.png deleted file mode 100755 index 0197fef..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 13 - Graphics/spinObj_08.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 14 - Masking/BGrotate.jpg b/tutorial-1/pixi.js-master/examples/example 14 - Masking/BGrotate.jpg deleted file mode 100755 index f33f7d4..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 14 - Masking/BGrotate.jpg and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 14 - Masking/Copy of index.html b/tutorial-1/pixi.js-master/examples/example 14 - Masking/Copy of index.html deleted file mode 100755 index ef90f62..0000000 --- a/tutorial-1/pixi.js-master/examples/example 14 - Masking/Copy of index.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - pixi.js example 14 - Masking - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 14 - Masking/LightRotate1.png b/tutorial-1/pixi.js-master/examples/example 14 - Masking/LightRotate1.png deleted file mode 100755 index 44966cf..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 14 - Masking/LightRotate1.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 14 - Masking/LightRotate2.png b/tutorial-1/pixi.js-master/examples/example 14 - Masking/LightRotate2.png deleted file mode 100755 index a6e63c0..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 14 - Masking/LightRotate2.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 14 - Masking/SceneRotate.jpg b/tutorial-1/pixi.js-master/examples/example 14 - Masking/SceneRotate.jpg deleted file mode 100755 index 26fe78b..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 14 - Masking/SceneRotate.jpg and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 14 - Masking/index double mask.html b/tutorial-1/pixi.js-master/examples/example 14 - Masking/index double mask.html deleted file mode 100755 index 5751e7b..0000000 --- a/tutorial-1/pixi.js-master/examples/example 14 - Masking/index double mask.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - pixi.js example 14 - Masking - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 14 - Masking/index nested masks.html b/tutorial-1/pixi.js-master/examples/example 14 - Masking/index nested masks.html deleted file mode 100755 index 7113762..0000000 --- a/tutorial-1/pixi.js-master/examples/example 14 - Masking/index nested masks.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - pixi.js example 14 - Masking - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 14 - Masking/index.html b/tutorial-1/pixi.js-master/examples/example 14 - Masking/index.html deleted file mode 100755 index d786ce1..0000000 --- a/tutorial-1/pixi.js-master/examples/example 14 - Masking/index.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - pixi.js example 14 - Masking - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 14 - Masking/panda.png b/tutorial-1/pixi.js-master/examples/example 14 - Masking/panda.png deleted file mode 100755 index 215a4a9..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 14 - Masking/panda.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 15 - Filters/BGrotate.jpg b/tutorial-1/pixi.js-master/examples/example 15 - Filters/BGrotate.jpg deleted file mode 100755 index f33f7d4..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 15 - Filters/BGrotate.jpg and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 15 - Filters/LightRotate1.png b/tutorial-1/pixi.js-master/examples/example 15 - Filters/LightRotate1.png deleted file mode 100755 index 44966cf..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 15 - Filters/LightRotate1.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 15 - Filters/LightRotate2.png b/tutorial-1/pixi.js-master/examples/example 15 - Filters/LightRotate2.png deleted file mode 100755 index a6e63c0..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 15 - Filters/LightRotate2.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 15 - Filters/SceneRotate.jpg b/tutorial-1/pixi.js-master/examples/example 15 - Filters/SceneRotate.jpg deleted file mode 100755 index 26fe78b..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 15 - Filters/SceneRotate.jpg and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 15 - Filters/dat.gui.min.js b/tutorial-1/pixi.js-master/examples/example 15 - Filters/dat.gui.min.js deleted file mode 100755 index 17e4a3c..0000000 --- a/tutorial-1/pixi.js-master/examples/example 15 - Filters/dat.gui.min.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ -var dat=dat||{};dat.gui=dat.gui||{};dat.utils=dat.utils||{};dat.controllers=dat.controllers||{};dat.dom=dat.dom||{};dat.color=dat.color||{};dat.utils.css=function(){return{load:function(e,a){var a=a||document,c=a.createElement("link");c.type="text/css";c.rel="stylesheet";c.href=e;a.getElementsByTagName("head")[0].appendChild(c)},inject:function(e,a){var a=a||document,c=document.createElement("style");c.type="text/css";c.innerHTML=e;a.getElementsByTagName("head")[0].appendChild(c)}}}(); -dat.utils.common=function(){var e=Array.prototype.forEach,a=Array.prototype.slice;return{BREAK:{},extend:function(c){this.each(a.call(arguments,1),function(a){for(var f in a)this.isUndefined(a[f])||(c[f]=a[f])},this);return c},defaults:function(c){this.each(a.call(arguments,1),function(a){for(var f in a)this.isUndefined(c[f])&&(c[f]=a[f])},this);return c},compose:function(){var c=a.call(arguments);return function(){for(var d=a.call(arguments),f=c.length-1;f>=0;f--)d=[c[f].apply(this,d)];return d[0]}}, -each:function(a,d,f){if(e&&a.forEach===e)a.forEach(d,f);else if(a.length===a.length+0)for(var b=0,n=a.length;b-1?d.length-d.indexOf(".")-1:0};c.superclass=e;a.extend(c.prototype,e.prototype,{setValue:function(a){if(this.__min!==void 0&&athis.__max)a=this.__max;this.__step!==void 0&&a%this.__step!=0&&(a=Math.round(a/this.__step)*this.__step);return c.superclass.prototype.setValue.call(this,a)},min:function(a){this.__min=a;return this},max:function(a){this.__max=a;return this},step:function(a){this.__step=a;return this}});return c}(dat.controllers.Controller,dat.utils.common); -dat.controllers.NumberControllerBox=function(e,a,c){var d=function(f,b,e){function h(){var a=parseFloat(l.__input.value);c.isNaN(a)||l.setValue(a)}function j(a){var b=o-a.clientY;l.setValue(l.getValue()+b*l.__impliedStep);o=a.clientY}function m(){a.unbind(window,"mousemove",j);a.unbind(window,"mouseup",m)}this.__truncationSuspended=false;d.superclass.call(this,f,b,e);var l=this,o;this.__input=document.createElement("input");this.__input.setAttribute("type","text");a.bind(this.__input,"change",h); -a.bind(this.__input,"blur",function(){h();l.__onFinishChange&&l.__onFinishChange.call(l,l.getValue())});a.bind(this.__input,"mousedown",function(b){a.bind(window,"mousemove",j);a.bind(window,"mouseup",m);o=b.clientY});a.bind(this.__input,"keydown",function(a){if(a.keyCode===13)l.__truncationSuspended=true,this.blur(),l.__truncationSuspended=false});this.updateDisplay();this.domElement.appendChild(this.__input)};d.superclass=e;c.extend(d.prototype,e.prototype,{updateDisplay:function(){var a=this.__input, -b;if(this.__truncationSuspended)b=this.getValue();else{b=this.getValue();var c=Math.pow(10,this.__precision);b=Math.round(b*c)/c}a.value=b;return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.NumberController,dat.dom.dom,dat.utils.common); -dat.controllers.NumberControllerSlider=function(e,a,c,d,f){var b=function(d,c,f,e,l){function o(b){b.preventDefault();var d=a.getOffset(g.__background),c=a.getWidth(g.__background);g.setValue(g.__min+(g.__max-g.__min)*((b.clientX-d.left)/(d.left+c-d.left)));return false}function y(){a.unbind(window,"mousemove",o);a.unbind(window,"mouseup",y);g.__onFinishChange&&g.__onFinishChange.call(g,g.getValue())}b.superclass.call(this,d,c,{min:f,max:e,step:l});var g=this;this.__background=document.createElement("div"); -this.__foreground=document.createElement("div");a.bind(this.__background,"mousedown",function(b){a.bind(window,"mousemove",o);a.bind(window,"mouseup",y);o(b)});a.addClass(this.__background,"slider");a.addClass(this.__foreground,"slider-fg");this.updateDisplay();this.__background.appendChild(this.__foreground);this.domElement.appendChild(this.__background)};b.superclass=e;b.useDefaultStyles=function(){c.inject(f)};d.extend(b.prototype,e.prototype,{updateDisplay:function(){this.__foreground.style.width= -(this.getValue()-this.__min)/(this.__max-this.__min)*100+"%";return b.superclass.prototype.updateDisplay.call(this)}});return b}(dat.controllers.NumberController,dat.dom.dom,dat.utils.css,dat.utils.common,".slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}"); -dat.controllers.FunctionController=function(e,a,c){var d=function(c,b,e){d.superclass.call(this,c,b);var h=this;this.__button=document.createElement("div");this.__button.innerHTML=e===void 0?"Fire":e;a.bind(this.__button,"click",function(a){a.preventDefault();h.fire();return false});a.addClass(this.__button,"button");this.domElement.appendChild(this.__button)};d.superclass=e;c.extend(d.prototype,e.prototype,{fire:function(){this.__onChange&&this.__onChange.call(this);this.__onFinishChange&&this.__onFinishChange.call(this, -this.getValue());this.getValue().call(this.object)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common); -dat.controllers.BooleanController=function(e,a,c){var d=function(c,b){d.superclass.call(this,c,b);var e=this;this.__prev=this.getValue();this.__checkbox=document.createElement("input");this.__checkbox.setAttribute("type","checkbox");a.bind(this.__checkbox,"change",function(){e.setValue(!e.__prev)},false);this.domElement.appendChild(this.__checkbox);this.updateDisplay()};d.superclass=e;c.extend(d.prototype,e.prototype,{setValue:function(a){a=d.superclass.prototype.setValue.call(this,a);this.__onFinishChange&& -this.__onFinishChange.call(this,this.getValue());this.__prev=this.getValue();return a},updateDisplay:function(){this.getValue()===true?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=true):this.__checkbox.checked=false;return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common); -dat.color.toString=function(e){return function(a){if(a.a==1||e.isUndefined(a.a)){for(a=a.hex.toString(16);a.length<6;)a="0"+a;return"#"+a}else return"rgba("+Math.round(a.r)+","+Math.round(a.g)+","+Math.round(a.b)+","+a.a+")"}}(dat.utils.common); -dat.color.interpret=function(e,a){var c,d,f=[{litmus:a.isString,conversions:{THREE_CHAR_HEX:{read:function(a){a=a.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return a===null?false:{space:"HEX",hex:parseInt("0x"+a[1].toString()+a[1].toString()+a[2].toString()+a[2].toString()+a[3].toString()+a[3].toString())}},write:e},SIX_CHAR_HEX:{read:function(a){a=a.match(/^#([A-F0-9]{6})$/i);return a===null?false:{space:"HEX",hex:parseInt("0x"+a[1].toString())}},write:e},CSS_RGB:{read:function(a){a=a.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/); -return a===null?false:{space:"RGB",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3])}},write:e},CSS_RGBA:{read:function(a){a=a.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);return a===null?false:{space:"RGB",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3]),a:parseFloat(a[4])}},write:e}}},{litmus:a.isNumber,conversions:{HEX:{read:function(a){return{space:"HEX",hex:a,conversionName:"HEX"}},write:function(a){return a.hex}}}},{litmus:a.isArray,conversions:{RGB_ARRAY:{read:function(a){return a.length!= -3?false:{space:"RGB",r:a[0],g:a[1],b:a[2]}},write:function(a){return[a.r,a.g,a.b]}},RGBA_ARRAY:{read:function(a){return a.length!=4?false:{space:"RGB",r:a[0],g:a[1],b:a[2],a:a[3]}},write:function(a){return[a.r,a.g,a.b,a.a]}}}},{litmus:a.isObject,conversions:{RGBA_OBJ:{read:function(b){return a.isNumber(b.r)&&a.isNumber(b.g)&&a.isNumber(b.b)&&a.isNumber(b.a)?{space:"RGB",r:b.r,g:b.g,b:b.b,a:b.a}:false},write:function(a){return{r:a.r,g:a.g,b:a.b,a:a.a}}},RGB_OBJ:{read:function(b){return a.isNumber(b.r)&& -a.isNumber(b.g)&&a.isNumber(b.b)?{space:"RGB",r:b.r,g:b.g,b:b.b}:false},write:function(a){return{r:a.r,g:a.g,b:a.b}}},HSVA_OBJ:{read:function(b){return a.isNumber(b.h)&&a.isNumber(b.s)&&a.isNumber(b.v)&&a.isNumber(b.a)?{space:"HSV",h:b.h,s:b.s,v:b.v,a:b.a}:false},write:function(a){return{h:a.h,s:a.s,v:a.v,a:a.a}}},HSV_OBJ:{read:function(b){return a.isNumber(b.h)&&a.isNumber(b.s)&&a.isNumber(b.v)?{space:"HSV",h:b.h,s:b.s,v:b.v}:false},write:function(a){return{h:a.h,s:a.s,v:a.v}}}}}];return function(){d= -false;var b=arguments.length>1?a.toArray(arguments):arguments[0];a.each(f,function(e){if(e.litmus(b))return a.each(e.conversions,function(e,f){c=e.read(b);if(d===false&&c!==false)return d=c,c.conversionName=f,c.conversion=e,a.BREAK}),a.BREAK});return d}}(dat.color.toString,dat.utils.common); -dat.GUI=dat.gui.GUI=function(e,a,c,d,f,b,n,h,j,m,l,o,y,g,i){function q(a,b,r,c){if(b[r]===void 0)throw Error("Object "+b+' has no property "'+r+'"');c.color?b=new l(b,r):(b=[b,r].concat(c.factoryArgs),b=d.apply(a,b));if(c.before instanceof f)c.before=c.before.__li;t(a,b);g.addClass(b.domElement,"c");r=document.createElement("span");g.addClass(r,"property-name");r.innerHTML=b.property;var e=document.createElement("div");e.appendChild(r);e.appendChild(b.domElement);c=s(a,e,c.before);g.addClass(c,k.CLASS_CONTROLLER_ROW); -g.addClass(c,typeof b.getValue());p(a,c,b);a.__controllers.push(b);return b}function s(a,b,d){var c=document.createElement("li");b&&c.appendChild(b);d?a.__ul.insertBefore(c,params.before):a.__ul.appendChild(c);a.onResize();return c}function p(a,d,c){c.__li=d;c.__gui=a;i.extend(c,{options:function(b){if(arguments.length>1)return c.remove(),q(a,c.object,c.property,{before:c.__li.nextElementSibling,factoryArgs:[i.toArray(arguments)]});if(i.isArray(b)||i.isObject(b))return c.remove(),q(a,c.object,c.property, -{before:c.__li.nextElementSibling,factoryArgs:[b]})},name:function(a){c.__li.firstElementChild.firstElementChild.innerHTML=a;return c},listen:function(){c.__gui.listen(c);return c},remove:function(){c.__gui.remove(c);return c}});if(c instanceof j){var e=new h(c.object,c.property,{min:c.__min,max:c.__max,step:c.__step});i.each(["updateDisplay","onChange","onFinishChange"],function(a){var b=c[a],H=e[a];c[a]=e[a]=function(){var a=Array.prototype.slice.call(arguments);b.apply(c,a);return H.apply(e,a)}}); -g.addClass(d,"has-slider");c.domElement.insertBefore(e.domElement,c.domElement.firstElementChild)}else if(c instanceof h){var f=function(b){return i.isNumber(c.__min)&&i.isNumber(c.__max)?(c.remove(),q(a,c.object,c.property,{before:c.__li.nextElementSibling,factoryArgs:[c.__min,c.__max,c.__step]})):b};c.min=i.compose(f,c.min);c.max=i.compose(f,c.max)}else if(c instanceof b)g.bind(d,"click",function(){g.fakeEvent(c.__checkbox,"click")}),g.bind(c.__checkbox,"click",function(a){a.stopPropagation()}); -else if(c instanceof n)g.bind(d,"click",function(){g.fakeEvent(c.__button,"click")}),g.bind(d,"mouseover",function(){g.addClass(c.__button,"hover")}),g.bind(d,"mouseout",function(){g.removeClass(c.__button,"hover")});else if(c instanceof l)g.addClass(d,"color"),c.updateDisplay=i.compose(function(a){d.style.borderLeftColor=c.__color.toString();return a},c.updateDisplay),c.updateDisplay();c.setValue=i.compose(function(b){a.getRoot().__preset_select&&c.isModified()&&B(a.getRoot(),true);return b},c.setValue)} -function t(a,b){var c=a.getRoot(),d=c.__rememberedObjects.indexOf(b.object);if(d!=-1){var e=c.__rememberedObjectIndecesToControllers[d];e===void 0&&(e={},c.__rememberedObjectIndecesToControllers[d]=e);e[b.property]=b;if(c.load&&c.load.remembered){c=c.load.remembered;if(c[a.preset])c=c[a.preset];else if(c[w])c=c[w];else return;if(c[d]&&c[d][b.property]!==void 0)d=c[d][b.property],b.initialValue=d,b.setValue(d)}}}function I(a){var b=a.__save_row=document.createElement("li");g.addClass(a.domElement, -"has-save");a.__ul.insertBefore(b,a.__ul.firstChild);g.addClass(b,"save-row");var c=document.createElement("span");c.innerHTML=" ";g.addClass(c,"button gears");var d=document.createElement("span");d.innerHTML="Save";g.addClass(d,"button");g.addClass(d,"save");var e=document.createElement("span");e.innerHTML="New";g.addClass(e,"button");g.addClass(e,"save-as");var f=document.createElement("span");f.innerHTML="Revert";g.addClass(f,"button");g.addClass(f,"revert");var m=a.__preset_select=document.createElement("select"); -a.load&&a.load.remembered?i.each(a.load.remembered,function(b,c){C(a,c,c==a.preset)}):C(a,w,false);g.bind(m,"change",function(){for(var b=0;b0){a.preset=this.preset;if(!a.remembered)a.remembered={};a.remembered[this.preset]=z(this)}a.folders={};i.each(this.__folders,function(b, -c){a.folders[c]=b.getSaveObject()});return a},save:function(){if(!this.load.remembered)this.load.remembered={};this.load.remembered[this.preset]=z(this);B(this,false)},saveAs:function(a){if(!this.load.remembered)this.load.remembered={},this.load.remembered[w]=z(this,true);this.load.remembered[a]=z(this);this.preset=a;C(this,a,true)},revert:function(a){i.each(this.__controllers,function(b){this.getRoot().load.remembered?t(a||this.getRoot(),b):b.setValue(b.initialValue)},this);i.each(this.__folders, -function(a){a.revert(a)});a||B(this.getRoot(),false)},listen:function(a){var b=this.__listening.length==0;this.__listening.push(a);b&&E(this.__listening)}});return k}(dat.utils.css,'
    \n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n
    \n\n Automatically save\n values to localStorage on exit.\n\n
    The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n \n
    \n \n
    \n\n
    ', -".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear;border:0;position:absolute;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-x:hidden}.dg.a.has-save ul{margin-top:27px}.dg.a.has-save ul.closed{margin-top:0}.dg.a .save-row{position:fixed;top:0;z-index:1002}.dg li{-webkit-transition:height 0.1s ease-out;-o-transition:height 0.1s ease-out;-moz-transition:height 0.1s ease-out;transition:height 0.1s ease-out}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;overflow:hidden;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li > *{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:9px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n", -dat.controllers.factory=function(e,a,c,d,f,b,n){return function(h,j,m,l){var o=h[j];if(n.isArray(m)||n.isObject(m))return new e(h,j,m);if(n.isNumber(o))return n.isNumber(m)&&n.isNumber(l)?new c(h,j,m,l):new a(h,j,{min:m,max:l});if(n.isString(o))return new d(h,j);if(n.isFunction(o))return new f(h,j,"");if(n.isBoolean(o))return new b(h,j)}}(dat.controllers.OptionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.StringController=function(e,a,c){var d= -function(c,b){function e(){h.setValue(h.__input.value)}d.superclass.call(this,c,b);var h=this;this.__input=document.createElement("input");this.__input.setAttribute("type","text");a.bind(this.__input,"keyup",e);a.bind(this.__input,"change",e);a.bind(this.__input,"blur",function(){h.__onFinishChange&&h.__onFinishChange.call(h,h.getValue())});a.bind(this.__input,"keydown",function(a){a.keyCode===13&&this.blur()});this.updateDisplay();this.domElement.appendChild(this.__input)};d.superclass=e;c.extend(d.prototype, -e.prototype,{updateDisplay:function(){if(!a.isActive(this.__input))this.__input.value=this.getValue();return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common),dat.controllers.FunctionController,dat.controllers.BooleanController,dat.utils.common),dat.controllers.Controller,dat.controllers.BooleanController,dat.controllers.FunctionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.OptionController, -dat.controllers.ColorController=function(e,a,c,d,f){function b(a,b,c,d){a.style.background="";f.each(j,function(e){a.style.cssText+="background: "+e+"linear-gradient("+b+", "+c+" 0%, "+d+" 100%); "})}function n(a){a.style.background="";a.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);";a.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"; -a.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);";a.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);";a.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}var h=function(e,l){function o(b){q(b);a.bind(window,"mousemove",q);a.bind(window, -"mouseup",j)}function j(){a.unbind(window,"mousemove",q);a.unbind(window,"mouseup",j)}function g(){var a=d(this.value);a!==false?(p.__color.__state=a,p.setValue(p.__color.toOriginal())):this.value=p.__color.toString()}function i(){a.unbind(window,"mousemove",s);a.unbind(window,"mouseup",i)}function q(b){b.preventDefault();var c=a.getWidth(p.__saturation_field),d=a.getOffset(p.__saturation_field),e=(b.clientX-d.left+document.body.scrollLeft)/c,b=1-(b.clientY-d.top+document.body.scrollTop)/c;b>1?b= -1:b<0&&(b=0);e>1?e=1:e<0&&(e=0);p.__color.v=b;p.__color.s=e;p.setValue(p.__color.toOriginal());return false}function s(b){b.preventDefault();var c=a.getHeight(p.__hue_field),d=a.getOffset(p.__hue_field),b=1-(b.clientY-d.top+document.body.scrollTop)/c;b>1?b=1:b<0&&(b=0);p.__color.h=b*360;p.setValue(p.__color.toOriginal());return false}h.superclass.call(this,e,l);this.__color=new c(this.getValue());this.__temp=new c(0);var p=this;this.domElement=document.createElement("div");a.makeSelectable(this.domElement, -false);this.__selector=document.createElement("div");this.__selector.className="selector";this.__saturation_field=document.createElement("div");this.__saturation_field.className="saturation-field";this.__field_knob=document.createElement("div");this.__field_knob.className="field-knob";this.__field_knob_border="2px solid ";this.__hue_knob=document.createElement("div");this.__hue_knob.className="hue-knob";this.__hue_field=document.createElement("div");this.__hue_field.className="hue-field";this.__input= -document.createElement("input");this.__input.type="text";this.__input_textShadow="0 1px 1px ";a.bind(this.__input,"keydown",function(a){a.keyCode===13&&g.call(this)});a.bind(this.__input,"blur",g);a.bind(this.__selector,"mousedown",function(){a.addClass(this,"drag").bind(window,"mouseup",function(){a.removeClass(p.__selector,"drag")})});var t=document.createElement("div");f.extend(this.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}); -f.extend(this.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:this.__field_knob_border+(this.__color.v<0.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1});f.extend(this.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1});f.extend(this.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"});f.extend(t.style, -{width:"100%",height:"100%",background:"none"});b(t,"top","rgba(0,0,0,0)","#000");f.extend(this.__hue_field.style,{width:"15px",height:"100px",display:"inline-block",border:"1px solid #555",cursor:"ns-resize"});n(this.__hue_field);f.extend(this.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:this.__input_textShadow+"rgba(0,0,0,0.7)"});a.bind(this.__saturation_field,"mousedown",o);a.bind(this.__field_knob,"mousedown",o);a.bind(this.__hue_field,"mousedown", -function(b){s(b);a.bind(window,"mousemove",s);a.bind(window,"mouseup",i)});this.__saturation_field.appendChild(t);this.__selector.appendChild(this.__field_knob);this.__selector.appendChild(this.__saturation_field);this.__selector.appendChild(this.__hue_field);this.__hue_field.appendChild(this.__hue_knob);this.domElement.appendChild(this.__input);this.domElement.appendChild(this.__selector);this.updateDisplay()};h.superclass=e;f.extend(h.prototype,e.prototype,{updateDisplay:function(){var a=d(this.getValue()); -if(a!==false){var e=false;f.each(c.COMPONENTS,function(b){if(!f.isUndefined(a[b])&&!f.isUndefined(this.__color.__state[b])&&a[b]!==this.__color.__state[b])return e=true,{}},this);e&&f.extend(this.__color.__state,a)}f.extend(this.__temp.__state,this.__color.__state);this.__temp.a=1;var h=this.__color.v<0.5||this.__color.s>0.5?255:0,j=255-h;f.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toString(),border:this.__field_knob_border+ -"rgb("+h+","+h+","+h+")"});this.__hue_knob.style.marginTop=(1-this.__color.h/360)*100+"px";this.__temp.s=1;this.__temp.v=1;b(this.__saturation_field,"left","#fff",this.__temp.toString());f.extend(this.__input.style,{backgroundColor:this.__input.value=this.__color.toString(),color:"rgb("+h+","+h+","+h+")",textShadow:this.__input_textShadow+"rgba("+j+","+j+","+j+",.7)"})}});var j=["-moz-","-o-","-webkit-","-ms-",""];return h}(dat.controllers.Controller,dat.dom.dom,dat.color.Color=function(e,a,c,d){function f(a, -b,c){Object.defineProperty(a,b,{get:function(){if(this.__state.space==="RGB")return this.__state[b];n(this,b,c);return this.__state[b]},set:function(a){if(this.__state.space!=="RGB")n(this,b,c),this.__state.space="RGB";this.__state[b]=a}})}function b(a,b){Object.defineProperty(a,b,{get:function(){if(this.__state.space==="HSV")return this.__state[b];h(this);return this.__state[b]},set:function(a){if(this.__state.space!=="HSV")h(this),this.__state.space="HSV";this.__state[b]=a}})}function n(b,c,e){if(b.__state.space=== -"HEX")b.__state[c]=a.component_from_hex(b.__state.hex,e);else if(b.__state.space==="HSV")d.extend(b.__state,a.hsv_to_rgb(b.__state.h,b.__state.s,b.__state.v));else throw"Corrupted color state";}function h(b){var c=a.rgb_to_hsv(b.r,b.g,b.b);d.extend(b.__state,{s:c.s,v:c.v});if(d.isNaN(c.h)){if(d.isUndefined(b.__state.h))b.__state.h=0}else b.__state.h=c.h}var j=function(){this.__state=e.apply(this,arguments);if(this.__state===false)throw"Failed to interpret color arguments";this.__state.a=this.__state.a|| -1};j.COMPONENTS="r,g,b,h,s,v,hex,a".split(",");d.extend(j.prototype,{toString:function(){return c(this)},toOriginal:function(){return this.__state.conversion.write(this)}});f(j.prototype,"r",2);f(j.prototype,"g",1);f(j.prototype,"b",0);b(j.prototype,"h");b(j.prototype,"s");b(j.prototype,"v");Object.defineProperty(j.prototype,"a",{get:function(){return this.__state.a},set:function(a){this.__state.a=a}});Object.defineProperty(j.prototype,"hex",{get:function(){if(!this.__state.space!=="HEX")this.__state.hex= -a.rgb_to_hex(this.r,this.g,this.b);return this.__state.hex},set:function(a){this.__state.space="HEX";this.__state.hex=a}});return j}(dat.color.interpret,dat.color.math=function(){var e;return{hsv_to_rgb:function(a,c,d){var e=a/60-Math.floor(a/60),b=d*(1-c),n=d*(1-e*c),c=d*(1-(1-e)*c),a=[[d,c,b],[n,d,b],[b,d,c],[b,n,d],[c,b,d],[d,b,n]][Math.floor(a/60)%6];return{r:a[0]*255,g:a[1]*255,b:a[2]*255}},rgb_to_hsv:function(a,c,d){var e=Math.min(a,c,d),b=Math.max(a,c,d),e=b-e;if(b==0)return{h:NaN,s:0,v:0}; -a=a==b?(c-d)/e:c==b?2+(d-a)/e:4+(a-c)/e;a/=6;a<0&&(a+=1);return{h:a*360,s:e/b,v:b/255}},rgb_to_hex:function(a,c,d){a=this.hex_with_component(0,2,a);a=this.hex_with_component(a,1,c);return a=this.hex_with_component(a,0,d)},component_from_hex:function(a,c){return a>>c*8&255},hex_with_component:function(a,c,d){return d<<(e=c*8)|a&~(255< - - - pixi.js example 15 - Filters - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 15 - Filters/indexAll.html b/tutorial-1/pixi.js-master/examples/example 15 - Filters/indexAll.html deleted file mode 100755 index 4e83cb8..0000000 --- a/tutorial-1/pixi.js-master/examples/example 15 - Filters/indexAll.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - pixi.js example 15 - Filters - - - - - - - - - -
    - - - - - -
    - - - diff --git a/tutorial-1/pixi.js-master/examples/example 15 - Filters/indexBlur.html b/tutorial-1/pixi.js-master/examples/example 15 - Filters/indexBlur.html deleted file mode 100755 index dc899dc..0000000 --- a/tutorial-1/pixi.js-master/examples/example 15 - Filters/indexBlur.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - pixi.js example 15 - Filters - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 15 - Filters/indexDisplacement.html b/tutorial-1/pixi.js-master/examples/example 15 - Filters/indexDisplacement.html deleted file mode 100755 index 23f7f96..0000000 --- a/tutorial-1/pixi.js-master/examples/example 15 - Filters/indexDisplacement.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - pixi.js example 15 - Filters - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 15 - Filters/indexDisplacement_2.html b/tutorial-1/pixi.js-master/examples/example 15 - Filters/indexDisplacement_2.html deleted file mode 100755 index 8cda5d9..0000000 --- a/tutorial-1/pixi.js-master/examples/example 15 - Filters/indexDisplacement_2.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - pixi.js example 15 - Filters - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 15 - Filters/panda.png b/tutorial-1/pixi.js-master/examples/example 15 - Filters/panda.png deleted file mode 100755 index 215a4a9..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 15 - Filters/panda.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 15 - Filters/zeldaWaves.png b/tutorial-1/pixi.js-master/examples/example 15 - Filters/zeldaWaves.png deleted file mode 100755 index 01552c0..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 15 - Filters/zeldaWaves.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 16 - BlendModes/BGrotate.jpg b/tutorial-1/pixi.js-master/examples/example 16 - BlendModes/BGrotate.jpg deleted file mode 100755 index eab4d57..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 16 - BlendModes/BGrotate.jpg and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 16 - BlendModes/flowerTop.png b/tutorial-1/pixi.js-master/examples/example 16 - BlendModes/flowerTop.png deleted file mode 100755 index 041cf2a..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 16 - BlendModes/flowerTop.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 16 - BlendModes/index.html b/tutorial-1/pixi.js-master/examples/example 16 - BlendModes/index.html deleted file mode 100755 index 5bb21a8..0000000 --- a/tutorial-1/pixi.js-master/examples/example 16 - BlendModes/index.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - Pixi.js Blend Modes - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 17 - Tinting/BGrotate.jpg b/tutorial-1/pixi.js-master/examples/example 17 - Tinting/BGrotate.jpg deleted file mode 100755 index eab4d57..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 17 - Tinting/BGrotate.jpg and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 17 - Tinting/eggHead.png b/tutorial-1/pixi.js-master/examples/example 17 - Tinting/eggHead.png deleted file mode 100755 index f8bff53..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 17 - Tinting/eggHead.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 17 - Tinting/index.html b/tutorial-1/pixi.js-master/examples/example 17 - Tinting/index.html deleted file mode 100755 index f051fd1..0000000 --- a/tutorial-1/pixi.js-master/examples/example 17 - Tinting/index.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - Tinting - - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 18 - Batch/click.png b/tutorial-1/pixi.js-master/examples/example 18 - Batch/click.png deleted file mode 100755 index b796e52..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 18 - Batch/click.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 18 - Batch/index.html b/tutorial-1/pixi.js-master/examples/example 18 - Batch/index.html deleted file mode 100755 index ce7c542..0000000 --- a/tutorial-1/pixi.js-master/examples/example 18 - Batch/index.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - Sprite Batch - - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 18 - Batch/logo_small.png b/tutorial-1/pixi.js-master/examples/example 18 - Batch/logo_small.png deleted file mode 100755 index 3a63544..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 18 - Batch/logo_small.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 18 - Batch/tinyMaggot.png b/tutorial-1/pixi.js-master/examples/example 18 - Batch/tinyMaggot.png deleted file mode 100755 index c0b1c00..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 18 - Batch/tinyMaggot.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.json b/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.json deleted file mode 100755 index 7dddba8..0000000 --- a/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.json +++ /dev/null @@ -1,44 +0,0 @@ -{"frames": { - -"eggHead.png": -{ - "frame": {"x":2,"y":169,"w":142,"h":157}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":142,"h":157}, - "sourceSize": {"w":142,"h":157} -}, -"flowerTop.png": -{ - "frame": {"x":2,"y":328,"w":119,"h":181}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":119,"h":181}, - "sourceSize": {"w":119,"h":181} -}, -"helmlok.png": -{ - "frame": {"x":123,"y":328,"w":123,"h":177}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":123,"h":177}, - "sourceSize": {"w":123,"h":177} -}, -"skully.png": -{ - "frame": {"x":2,"y":2,"w":155,"h":165}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":155,"h":165}, - "sourceSize": {"w":155,"h":165} -}}, -"meta": { - "app": "http://www.texturepacker.com", - "version": "1.0", - "image": "SpriteSheet.png", - "format": "RGBA8888", - "size": {"w":256,"h":512}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:9e3e5afd01ea8e418afabfbdcd724485$" -} -} diff --git a/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.png b/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.png deleted file mode 100755 index 210acb1..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/index.html b/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/index.html deleted file mode 100755 index ca82cdc..0000000 --- a/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/index.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - pixi.js example 2 loading a sprite sheet - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/SpriteSheet.tps b/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/SpriteSheet.tps deleted file mode 100755 index c81ef28..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/SpriteSheet.tps and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/eggHead.png b/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/eggHead.png deleted file mode 100755 index f8bff53..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/eggHead.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/flowerTop.png b/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/flowerTop.png deleted file mode 100755 index 041cf2a..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/flowerTop.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/helmlok.png b/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/helmlok.png deleted file mode 100755 index c6b96c0..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/helmlok.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/skully.png b/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/skully.png deleted file mode 100755 index c21b40d..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/skully.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.json b/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.json deleted file mode 100755 index 7dddba8..0000000 --- a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.json +++ /dev/null @@ -1,44 +0,0 @@ -{"frames": { - -"eggHead.png": -{ - "frame": {"x":2,"y":169,"w":142,"h":157}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":142,"h":157}, - "sourceSize": {"w":142,"h":157} -}, -"flowerTop.png": -{ - "frame": {"x":2,"y":328,"w":119,"h":181}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":119,"h":181}, - "sourceSize": {"w":119,"h":181} -}, -"helmlok.png": -{ - "frame": {"x":123,"y":328,"w":123,"h":177}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":123,"h":177}, - "sourceSize": {"w":123,"h":177} -}, -"skully.png": -{ - "frame": {"x":2,"y":2,"w":155,"h":165}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":155,"h":165}, - "sourceSize": {"w":155,"h":165} -}}, -"meta": { - "app": "http://www.texturepacker.com", - "version": "1.0", - "image": "SpriteSheet.png", - "format": "RGBA8888", - "size": {"w":256,"h":512}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:9e3e5afd01ea8e418afabfbdcd724485$" -} -} diff --git a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.png b/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.png deleted file mode 100755 index 210acb1..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/fighter.json b/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/fighter.json deleted file mode 100755 index e20b4a6..0000000 --- a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/fighter.json +++ /dev/null @@ -1,252 +0,0 @@ -{"frames": { - -"rollSequence0000.png": -{ - "frame": {"x":483,"y":692,"w":169,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":4,"w":169,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0001.png": -{ - "frame": {"x":468,"y":2,"w":169,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":4,"w":169,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0002.png": -{ - "frame": {"x":639,"y":2,"w":167,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":5,"w":167,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0003.png": -{ - "frame": {"x":808,"y":2,"w":165,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":5,"w":165,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0004.png": -{ - "frame": {"x":654,"y":688,"w":161,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":5,"w":161,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0005.png": -{ - "frame": {"x":817,"y":458,"w":151,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":6,"y":5,"w":151,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0006.png": -{ - "frame": {"x":817,"y":686,"w":137,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":11,"y":5,"w":137,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0007.png": -{ - "frame": {"x":290,"y":2,"w":113,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":22,"y":3,"w":113,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0008.png": -{ - "frame": {"x":284,"y":692,"w":79,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":40,"y":3,"w":79,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0009.png": -{ - "frame": {"x":405,"y":2,"w":61,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":53,"y":3,"w":61,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0010.png": -{ - "frame": {"x":444,"y":462,"w":49,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":64,"y":3,"w":49,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0011.png": -{ - "frame": {"x":377,"y":462,"w":65,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":52,"y":3,"w":65,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0012.png": -{ - "frame": {"x":272,"y":462,"w":103,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":37,"y":3,"w":103,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0013.png": -{ - "frame": {"x":143,"y":692,"w":139,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":3,"w":139,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0014.png": -{ - "frame": {"x":2,"y":462,"w":163,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":7,"y":3,"w":163,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0015.png": -{ - "frame": {"x":2,"y":2,"w":171,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":2,"y":3,"w":171,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0016.png": -{ - "frame": {"x":2,"y":232,"w":163,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":4,"y":3,"w":163,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0017.png": -{ - "frame": {"x":2,"y":692,"w":139,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":16,"y":3,"w":139,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0018.png": -{ - "frame": {"x":167,"y":462,"w":103,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":35,"y":3,"w":103,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0019.png": -{ - "frame": {"x":365,"y":692,"w":65,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":58,"y":3,"w":65,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0020.png": -{ - "frame": {"x":432,"y":692,"w":49,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":62,"y":3,"w":49,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0021.png": -{ - "frame": {"x":389,"y":232,"w":61,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":61,"y":3,"w":61,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0022.png": -{ - "frame": {"x":306,"y":232,"w":81,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":55,"y":3,"w":81,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0023.png": -{ - "frame": {"x":175,"y":2,"w":113,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":39,"y":3,"w":113,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0024.png": -{ - "frame": {"x":167,"y":232,"w":137,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":26,"y":3,"w":137,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0025.png": -{ - "frame": {"x":664,"y":458,"w":151,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":5,"w":151,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0026.png": -{ - "frame": {"x":792,"y":230,"w":161,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":11,"y":5,"w":161,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0027.png": -{ - "frame": {"x":623,"y":230,"w":167,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":6,"y":5,"w":167,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0028.png": -{ - "frame": {"x":495,"y":460,"w":167,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":5,"y":5,"w":167,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0029.png": -{ - "frame": {"x":452,"y":232,"w":169,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":4,"w":169,"h":226}, - "sourceSize": {"w":175,"h":240} -}}, -"meta": { - "app": "http://www.texturepacker.com", - "version": "1.0", - "image": "fighter.png", - "format": "RGBA8888", - "size": {"w":1024,"h":1024}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:2f213a6b451f9f5719773418dfe80ae8$" -} -} diff --git a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/fighter.png b/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/fighter.png deleted file mode 100755 index 5395f7b..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/fighter.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/index.html b/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/index.html deleted file mode 100755 index ecd4b55..0000000 --- a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/index.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - pixi.js example 2 loading a sprite sheet - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/indexTrim.html b/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/indexTrim.html deleted file mode 100755 index 4682c4e..0000000 --- a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/indexTrim.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - pixi.js example 2 loading a sprite sheet - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/tp/SpriteSheet.tps b/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/tp/SpriteSheet.tps deleted file mode 100755 index c81ef28..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/tp/SpriteSheet.tps and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/tp/eggHead.png b/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/tp/eggHead.png deleted file mode 100755 index f8bff53..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/tp/eggHead.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/tp/flowerTop.png b/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/tp/flowerTop.png deleted file mode 100755 index 041cf2a..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/tp/flowerTop.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/tp/helmlok.png b/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/tp/helmlok.png deleted file mode 100755 index c6b96c0..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/tp/helmlok.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/tp/skully.png b/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/tp/skully.png deleted file mode 100755 index c21b40d..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 2 - SpriteSheet/tp/skully.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 20 - Strip/index.html b/tutorial-1/pixi.js-master/examples/example 20 - Strip/index.html deleted file mode 100755 index 95cd621..0000000 --- a/tutorial-1/pixi.js-master/examples/example 20 - Strip/index.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - pixi.js example 20 - strip - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 20 - Strip/snake.png b/tutorial-1/pixi.js-master/examples/example 20 - Strip/snake.png deleted file mode 100755 index 0cb81d4..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 20 - Strip/snake.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 21 - Complex Graphics/index.html b/tutorial-1/pixi.js-master/examples/example 21 - Complex Graphics/index.html deleted file mode 100755 index 2424e38..0000000 --- a/tutorial-1/pixi.js-master/examples/example 21 - Complex Graphics/index.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - pixi.js example 21 Complex Graphics - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 22 - Complex Masking/eggHead.png b/tutorial-1/pixi.js-master/examples/example 22 - Complex Masking/eggHead.png deleted file mode 100755 index f8bff53..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 22 - Complex Masking/eggHead.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 22 - Complex Masking/flowerTop.png b/tutorial-1/pixi.js-master/examples/example 22 - Complex Masking/flowerTop.png deleted file mode 100755 index 041cf2a..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 22 - Complex Masking/flowerTop.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 22 - Complex Masking/helmlok.png b/tutorial-1/pixi.js-master/examples/example 22 - Complex Masking/helmlok.png deleted file mode 100755 index c6b96c0..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 22 - Complex Masking/helmlok.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 22 - Complex Masking/index.html b/tutorial-1/pixi.js-master/examples/example 22 - Complex Masking/index.html deleted file mode 100755 index db7d0a5..0000000 --- a/tutorial-1/pixi.js-master/examples/example 22 - Complex Masking/index.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - pixi.js example 22 complex masking - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 22 - Complex Masking/skully.png b/tutorial-1/pixi.js-master/examples/example 22 - Complex Masking/skully.png deleted file mode 100755 index c21b40d..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 22 - Complex Masking/skully.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 23 - Texture Swap/eggHead.png b/tutorial-1/pixi.js-master/examples/example 23 - Texture Swap/eggHead.png deleted file mode 100755 index f8bff53..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 23 - Texture Swap/eggHead.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 23 - Texture Swap/flowerTop.png b/tutorial-1/pixi.js-master/examples/example 23 - Texture Swap/flowerTop.png deleted file mode 100755 index 041cf2a..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 23 - Texture Swap/flowerTop.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 23 - Texture Swap/index.html b/tutorial-1/pixi.js-master/examples/example 23 - Texture Swap/index.html deleted file mode 100755 index 21feded..0000000 --- a/tutorial-1/pixi.js-master/examples/example 23 - Texture Swap/index.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - pixi.js example 23 - Texture Swap - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 24 - Box2D Integration/box2d.min.js b/tutorial-1/pixi.js-master/examples/example 24 - Box2D Integration/box2d.min.js deleted file mode 100755 index 1b579fd..0000000 --- a/tutorial-1/pixi.js-master/examples/example 24 - Box2D Integration/box2d.min.js +++ /dev/null @@ -1,112 +0,0 @@ -var b2Settings=function(){};b2Settings.prototype={};b2Settings.USHRT_MAX=65535;b2Settings.b2_pi=Math.PI;b2Settings.b2_massUnitsPerKilogram=1;b2Settings.b2_timeUnitsPerSecond=1;b2Settings.b2_lengthUnitsPerMeter=30;b2Settings.b2_maxManifoldPoints=2;b2Settings.b2_maxShapesPerBody=64;b2Settings.b2_maxPolyVertices=8;b2Settings.b2_maxProxies=1024;b2Settings.b2_maxPairs=8*b2Settings.b2_maxProxies;b2Settings.b2_linearSlop=0.005*b2Settings.b2_lengthUnitsPerMeter;b2Settings.b2_angularSlop=2/180*b2Settings.b2_pi;b2Settings.b2_velocityThreshold=1*b2Settings.b2_lengthUnitsPerMeter/b2Settings.b2_timeUnitsPerSecond;b2Settings.b2_maxLinearCorrection=0.2*b2Settings.b2_lengthUnitsPerMeter;b2Settings.b2_maxAngularCorrection=8/180*b2Settings.b2_pi;b2Settings.b2_contactBaumgarte=0.2;b2Settings.b2_timeToSleep=0.5*b2Settings.b2_timeUnitsPerSecond;b2Settings.b2_linearSleepTolerance=0.01*b2Settings.b2_lengthUnitsPerMeter/b2Settings.b2_timeUnitsPerSecond;b2Settings.b2_angularSleepTolerance=2/180/b2Settings.b2_timeUnitsPerSecond; -b2Settings.b2Assert=function(b){if(!b){var c;c.x++}};Object.extend=function(a,c){for(var b in c){a[b]=c[b]}return a};var b2Vec2=function(a,b){this.x=a;this.y=b};b2Vec2.prototype={SetZero:function(){this.x=0;this.y=0},Set:function(a,b){this.x=a;this.y=b},SetV:function(a){this.x=a.x;this.y=a.y},Negative:function(){return new b2Vec2(-this.x,-this.y)},Copy:function(){return new b2Vec2(this.x,this.y)},Add:function(a){this.x+=a.x;this.y+=a.y},Subtract:function(a){this.x-=a.x;this.y-=a.y},Multiply:function(b){this.x*=b;this.y*=b},MulM:function(b){var a=this.x;this.x=b.col1.x*a+b.col2.x*this.y;this.y=b.col1.y*a+b.col2.y*this.y},MulTM:function(b){var a=b2Math.b2Dot(this,b.col1);this.y=b2Math.b2Dot(this,b.col2);this.x=a},CrossVF:function(b){var a=this.x;this.x=b*this.y;this.y=-b*a},CrossFV:function(b){var a=this.x;this.x=-b*this.y;this.y=b*a},MinV:function(a){this.x=this.xa.x?this.x:a.x;this.y=this.y>a.y?this.y:a.y},Abs:function(){this.x=Math.abs(this.x);this.y=Math.abs(this.y)},Length:function(){return Math.sqrt(this.x*this.x+this.y*this.y) -},Normalize:function(){var b=this.Length();if(b0?b:-b};b2Math.b2AbsV=function(d){var c=new b2Vec2(b2Math.b2Abs(d.x),b2Math.b2Abs(d.y));return c};b2Math.b2AbsM=function(a){var b=new b2Mat22(0,b2Math.b2AbsV(a.col1),b2Math.b2AbsV(a.col2));return b};b2Math.b2Min=function(d,c){return dc?d:c};b2Math.b2MaxV=function(e,d){var f=new b2Vec2(b2Math.b2Max(e.x,d.x),b2Math.b2Max(e.y,d.y));return f};b2Math.b2Clamp=function(c,b,d){return b2Math.b2Max(b,b2Math.b2Min(c,d))};b2Math.b2ClampV=function(c,b,d){return b2Math.b2MaxV(b,b2Math.b2MinV(c,d))};b2Math.b2Swap=function(d,c){var e=d[0];d[0]=c[0];c[0]=e};b2Math.b2Random=function(){return Math.random()*2-1};b2Math.b2NextPowerOfTwo=function(a){a|=(a>>1)&2147483647;a|=(a>>2)&1073741823;a|=(a>>4)&268435455;a|=(a>>8)&16777215; -a|=(a>>16)&65535;return a+1};b2Math.b2IsPowerOfTwo=function(b){var a=b>0&&(b&(b-1))==0;return a};b2Math.tempVec2=new b2Vec2();b2Math.tempVec3=new b2Vec2();b2Math.tempVec4=new b2Vec2();b2Math.tempVec5=new b2Vec2();b2Math.tempMat=new b2Mat22();var b2AABB=function(){this.minVertex=new b2Vec2();this.maxVertex=new b2Vec2()};b2AABB.prototype={IsValid:function(){var b=this.maxVertex.x;var a=this.maxVertex.y;b=this.maxVertex.x;a=this.maxVertex.y;b-=this.minVertex.x;a-=this.minVertex.y;var c=b>=0&&a>=0;c=c&&this.minVertex.IsValid()&&this.maxVertex.IsValid();return c},minVertex:new b2Vec2(),maxVertex:new b2Vec2()};var b2Bound=function(){};b2Bound.prototype={IsLower:function(){return(this.value&1)==0},IsUpper:function(){return(this.value&1)==1},Swap:function(c){var e=this.value;var d=this.proxyId;var a=this.stabbingCount;this.value=c.value;this.proxyId=c.proxyId;this.stabbingCount=c.stabbingCount;c.value=e;c.proxyId=d;c.stabbingCount=a},value:0,proxyId:0,stabbingCount:0};var b2BoundValues=function(){this.lowerValues=[0,0];this.upperValues=[0,0]};b2BoundValues.prototype={lowerValues:[0,0],upperValues:[0,0]};var b2Pair=function(){};b2Pair.prototype={SetBuffered:function(){this.status|=b2Pair.e_pairBuffered},ClearBuffered:function(){this.status&=~b2Pair.e_pairBuffered},IsBuffered:function(){return(this.status&b2Pair.e_pairBuffered)==b2Pair.e_pairBuffered},SetRemoved:function(){this.status|=b2Pair.e_pairRemoved},ClearRemoved:function(){this.status&=~b2Pair.e_pairRemoved},IsRemoved:function(){return(this.status&b2Pair.e_pairRemoved)==b2Pair.e_pairRemoved},SetFinal:function(){this.status|=b2Pair.e_pairFinal},IsFinal:function(){return(this.status&b2Pair.e_pairFinal)==b2Pair.e_pairFinal},userData:null,proxyId1:0,proxyId2:0,next:0,status:0};b2Pair.b2_nullPair=b2Settings.USHRT_MAX;b2Pair.b2_nullProxy=b2Settings.USHRT_MAX;b2Pair.b2_tableCapacity=b2Settings.b2_maxPairs;b2Pair.b2_tableMask=b2Pair.b2_tableCapacity-1;b2Pair.e_pairBuffered=1;b2Pair.e_pairRemoved=2;b2Pair.e_pairFinal=4;var b2PairCallback=function(){};b2PairCallback.prototype={PairAdded:function(b,a){return null},PairRemoved:function(c,b,a){}};var b2BufferedPair=function(){};b2BufferedPair.prototype={proxyId1:0,proxyId2:0};var b2PairManager=function(){var a=0;this.m_hashTable=new Array(b2Pair.b2_tableCapacity);for(a=0;aa){var c=b;b=a;a=c}var d=b2PairManager.Hash(b,a)&b2Pair.b2_tableMask;var f=f=this.FindHash(b,a,d);if(f!=null){return f}var e=this.m_freePair;f=this.m_pairs[e];this.m_freePair=f.next;f.proxyId1=b;f.proxyId2=a;f.status=0;f.userData=null;f.next=this.m_hashTable[d];this.m_hashTable[d]=e;++this.m_pairCount;return f},RemovePair:function(g,f){if(g>f){var i=g;g=f;f=i}var d=b2PairManager.Hash(g,f)&b2Pair.b2_tableMask;var b=this.m_hashTable[d];var h=null;while(b!=b2Pair.b2_nullPair){if(b2PairManager.Equals(this.m_pairs[b],g,f)){var e=b;if(h){h.next=this.m_pairs[b].next}else{this.m_hashTable[d]=this.m_pairs[b].next}var c=this.m_pairs[e];var a=c.userData;c.next=this.m_freePair;c.proxyId1=b2Pair.b2_nullProxy;c.proxyId2=b2Pair.b2_nullProxy;c.userData=null;c.status=0;this.m_freePair=e;--this.m_pairCount;return a}else{h=this.m_pairs[b];b=h.next}}return null},Find:function(b,a){if(b>a){var c=b;b=a;a=c -}var d=b2PairManager.Hash(b,a)&b2Pair.b2_tableMask;return this.FindHash(b,a,d)},FindHash:function(b,a,d){var c=this.m_hashTable[d];while(c!=b2Pair.b2_nullPair&&b2PairManager.Equals(this.m_pairs[c],b,a)==false){c=this.m_pairs[c].next}if(c==b2Pair.b2_nullPair){return null}return this.m_pairs[c]},ValidateBuffer:function(){},ValidateTable:function(){},m_broadPhase:null,m_callback:null,m_pairs:null,m_freePair:0,m_pairCount:0,m_pairBuffer:null,m_pairBufferCount:0,m_hashTable:null};b2PairManager.Hash=function(b,a){var c=((a<<16)&4294901760)|b;c=~c+((c<<15)&4294934528);c=c^((c>>12)&1048575);c=c+((c<<2)&4294967292);c=c^((c>>4)&268435455);c=c*2057;c=c^((c>>16)&65535);return c};b2PairManager.Equals=function(c,b,a){return(c.proxyId1==b&&c.proxyId2==a)};b2PairManager.EqualsPair=function(b,a){return b.proxyId1==a.proxyId1&&b.proxyId2==a.proxyId2};var b2BroadPhase=function(f,g){this.m_pairManager=new b2PairManager();this.m_proxyPool=new Array(b2Settings.b2_maxPairs);this.m_bounds=new Array(2*b2Settings.b2_maxProxies);this.m_queryResults=new Array(b2Settings.b2_maxProxies);this.m_quantizationFactor=new b2Vec2();var d=0;this.m_pairManager.Initialize(this,g);this.m_worldAABB=f;this.m_proxyCount=0;for(d=0;d0&&t0){g=m;while(g0){g=k;while(g0&&bb[c.upperBounds[a]].value){return false}if(b[d.upperBounds[a]].valued[e.upperBounds[c]].value){return false}if(a.upperValues[c]0){var g=c-1;var n=a[g].stabbingCount;while(n){if(a[g].IsLower()){var k=this.m_proxyPool[a[g].proxyId];if(c<=k.upperBounds[b]){this.IncrementOverlapCount(a[g].proxyId);--n}}--g}}h[0]=c;d[0]=l},IncrementOverlapCount:function(b){var a=this.m_proxyPool[b];if(a.timeStampf){e=b-1}else{if(d[b].value0){f[c].id=b[0].id}else{f[c].id=b[1].id}++c}return c};b2Collision.EdgeSeparation=function(p,q,o){var f=p.m_vertices;var g=o.m_vertexCount;var r=o.m_vertices;var e=p.m_normals[q].x;var d=p.m_normals[q].y;var s=e;var l=p.m_R;e=l.col1.x*s+l.col2.x*d;d=l.col1.y*s+l.col2.y*d;var v=e;var u=d;l=o.m_R;s=v*l.col1.x+u*l.col1.y;u=v*l.col2.x+u*l.col2.y;v=s;var n=0;var m=Number.MAX_VALUE;for(var w=0;wa){a=o;h=p}}var n=b2Collision.EdgeSeparation(m,h,l);if(n>0&&w==false){return n}var g=h-1>=0?h-1:j-1;var t=b2Collision.EdgeSeparation(m,g,l);if(t>0&&w==false){return t}var q=h+10&&w==false){return u}var b=0;var k;var v=0;if(t>n&&t>u){v=-1;b=g;k=t}else{if(u>n){v=1;b=q;k=u}else{r[0]=h;return n}}while(true){if(v==-1){h=b-1>=0?b-1:j-1}else{h=b+10&&w==false){return n}if(n>k){b=h;k=n}else{break}}r[0]=b;return k};b2Collision.FindIncidentEdge=function(D,p,q,n){var h=p.m_vertexCount;var f=p.m_vertices;var g=n.m_vertexCount;var s=n.m_vertices;var a=q; -var F=q+1==h?0:q+1;var e=f[F];var C=e.x;var A=e.y;e=f[a];C-=e.x;A-=e.y;var v=C;C=A;A=-v;var E=1/Math.sqrt(C*C+A*A);C*=E;A*=E;var r=C;var o=A;v=r;var l=p.m_R;r=l.col1.x*v+l.col2.x*o;o=l.col1.y*v+l.col2.y*o;var d=r;var b=o;l=n.m_R;v=d*l.col1.x+b*l.col1.y;b=d*l.col2.x+b*l.col2.y;d=v;var k=0;var j=0;var m=Number.MAX_VALUE;for(var B=0;B0&&b==false){return -}var K=0;var g=[K];var E=b2Collision.FindMaxSeparation(g,j,k,b);K=g[0];if(E>0&&b==false){return}var p;var o;var a=0;var R=0;var d=0.98;var O=0.001;if(E>d*F+O){p=j;o=k;a=K;R=1}else{p=k;o=j;a=M;R=0}var c=[new ClipVertex(),new ClipVertex()];b2Collision.FindIncidentEdge(c,p,a,o);var B=p.m_vertexCount;var q=p.m_vertices;var I=q[a];var H=a+1l*l&&b==false){return}var d;if(mg){return}if(t>o){o=t;B=A}}if(og){return}x.pointCount=1;x.normal.Set(n.col1.x*e+n.col2.x*d,n.col1.y*e+n.col2.y*d);h=x.points[0];h.id.features.incidentEdge=b2Collision.b2_nullFeature;h.id.features.incidentVertex=b;h.id.features.referenceFace=b2Collision.b2_nullFeature;h.id.features.flip=0;h.position.x=k.m_position.x-g*x.normal.x;h.position.y=k.m_position.y-g*x.normal.y;h.separation=w-g;return}var q=(z-m.m_vertices[b].x)*r+(y-m.m_vertices[b].y)*p;h=x.points[0];h.id.features.incidentEdge=b2Collision.b2_nullFeature;h.id.features.incidentVertex=b2Collision.b2_nullFeature;h.id.features.referenceFace=b2Collision.b2_nullFeature;h.id.features.flip=0;var l,j;if(q<=0){l=m.m_vertices[b].x;j=m.m_vertices[b].y;h.id.features.incidentVertex=b}else{if(q>=f){l=m.m_vertices[a].x;j=m.m_vertices[a].y;h.id.features.incidentVertex=a}else{l=r*q+m.m_vertices[b].x;j=p*q+m.m_vertices[b].y;h.id.features.incidentEdge=b}}e=z-l;d=y-j;w=Math.sqrt(e*e+d*d);e/=w;d/=w;if(w>g){return}x.pointCount=1;x.normal.Set(n.col1.x*e+n.col2.x*d,n.col1.y*e+n.col2.y*d); -h.position.x=k.m_position.x-g*x.normal.x;h.position.y=k.m_position.y-g*x.normal.y;h.separation=w-g};b2Collision.b2TestOverlap=function(d,c){var i=c.minVertex;var g=d.maxVertex;var f=i.x-g.x;var e=i.y-g.y;i=d.minVertex;g=c.maxVertex;var j=i.x-g.x;var h=i.y-g.y;if(f>0||e>0){return false}if(j>0||h>0){return false}return true};var Features=function(){};Features.prototype={set_referenceFace:function(a){this._referenceFace=a;this._m_id._key=(this._m_id._key&4294967040)|(this._referenceFace&255)},get_referenceFace:function(){return this._referenceFace},_referenceFace:0,set_incidentEdge:function(a){this._incidentEdge=a;this._m_id._key=(this._m_id._key&4294902015)|((this._incidentEdge<<8)&65280)},get_incidentEdge:function(){return this._incidentEdge},_incidentEdge:0,set_incidentVertex:function(a){this._incidentVertex=a;this._m_id._key=(this._m_id._key&4278255615)|((this._incidentVertex<<16)&16711680)},get_incidentVertex:function(){return this._incidentVertex},_incidentVertex:0,set_flip:function(a){this._flip=a;this._m_id._key=(this._m_id._key&16777215)|((this._flip<<24)&4278190080)},get_flip:function(){return this._flip},_flip:0,_m_id:null};var b2ContactID=function(){this.features=new Features();this.features._m_id=this};b2ContactID.prototype={Set:function(a){this.set_key(a._key)},Copy:function(){var a=new b2ContactID();a.set_key(this._key);return a},get_key:function(){return this._key},set_key:function(a){this._key=a;this.features._referenceFace=this._key&255;this.features._incidentEdge=((this._key&65280)>>8)&255;this.features._incidentVertex=((this._key&16711680)>>16)&255;this.features._flip=((this._key&4278190080)>>24)&255},features:new Features(),_key:0};var b2ContactPoint=function(){this.position=new b2Vec2();this.id=new b2ContactID()};b2ContactPoint.prototype={position:new b2Vec2(),separation:null,normalImpulse:null,tangentImpulse:null,id:new b2ContactID()};var b2Distance=function(){};b2Distance.prototype={};b2Distance.ProcessTwo=function(j,h,b,k,i){var f=-i[1].x;var e=-i[1].y;var d=i[0].x-i[1].x;var c=i[0].y-i[1].y;var a=Math.sqrt(d*d+c*c);d/=a;c/=a;var g=f*d+e*c;if(g<=0||a=0&&F>=0){var B=x/(x+F);q.x=m[1].x+B*(m[2].x-m[1].x);q.y=m[1].y+B*(m[2].y-m[1].y);D.x=C[1].x+B*(C[2].x-C[1].x); -D.y=C[1].y+B*(C[2].y-C[1].y);m[0].SetV(m[2]);C[0].SetV(C[2]);G[0].SetV(G[2]);return 2}var f=E*(J*h-I*k);if(f<=0&&j>=0&&o>=0){var B=j/(j+o);q.x=m[0].x+B*(m[2].x-m[0].x);q.y=m[0].y+B*(m[2].y-m[0].y);D.x=C[0].x+B*(C[2].x-C[0].x);D.y=C[0].y+B*(C[2].y-C[0].y);m[1].SetV(m[2]);C[1].SetV(C[2]);G[1].SetV(G[2]);return 2}var d=g+f+e;d=1/d;var A=g*d;var t=f*d;var p=1-A-t;q.x=A*m[0].x+t*m[1].x+p*m[2].x;q.y=A*m[0].y+t*m[1].y+p*m[2].y;D.x=A*C[0].x+t*C[1].x+p*C[2].x;D.y=A*C[0].y+t*C[1].y+p*C[2].y;return 3};b2Distance.InPoinsts=function(a,c,d){for(var b=0;bNumber.MIN_VALUE){D*=1/d;C*=1/d}this.m_coreVertices[w].x=this.m_vertices[w].x-2*b2Settings.b2_linearSlop*D;this.m_coreVertices[w].y=this.m_vertices[w].y-2*b2Settings.b2_linearSlop*C}}var y=Number.MAX_VALUE;var x=Number.MAX_VALUE;var m=-Number.MAX_VALUE;var l=-Number.MAX_VALUE;this.m_maxRadius=0;for(w=0;w0){return false}}return true},syncAABB:new b2AABB(),syncMat:new b2Mat22(),Synchronize:function(c,e,a,b){this.m_R.SetM(b); -this.m_position.x=this.m_body.m_position.x+(b.col1.x*this.m_localCentroid.x+b.col2.x*this.m_localCentroid.y);this.m_position.y=this.m_body.m_position.y+(b.col1.y*this.m_localCentroid.x+b.col2.y*this.m_localCentroid.y);if(this.m_proxyId==b2Pair.b2_nullProxy){return}var m;var l;var k=e.col1;var j=e.col2;var i=this.m_localOBB.R.col1;var h=this.m_localOBB.R.col2;this.syncMat.col1.x=k.x*i.x+j.x*i.y;this.syncMat.col1.y=k.y*i.x+j.y*i.y;this.syncMat.col2.x=k.x*h.x+j.x*h.y;this.syncMat.col2.y=k.y*h.x+j.y*h.y;this.syncMat.Abs();m=this.m_localCentroid.x+this.m_localOBB.center.x;l=this.m_localCentroid.y+this.m_localOBB.center.y;var f=c.x+(e.col1.x*m+e.col2.x*l);var d=c.y+(e.col1.y*m+e.col2.y*l);m=this.syncMat.col1.x*this.m_localOBB.extents.x+this.syncMat.col2.x*this.m_localOBB.extents.y;l=this.syncMat.col1.y*this.m_localOBB.extents.x+this.syncMat.col2.y*this.m_localOBB.extents.y;this.syncAABB.minVertex.x=f-m;this.syncAABB.minVertex.y=d-l;this.syncAABB.maxVertex.x=f+m;this.syncAABB.maxVertex.y=d+l;k=b.col1; -j=b.col2;i=this.m_localOBB.R.col1;h=this.m_localOBB.R.col2;this.syncMat.col1.x=k.x*i.x+j.x*i.y;this.syncMat.col1.y=k.y*i.x+j.y*i.y;this.syncMat.col2.x=k.x*h.x+j.x*h.y;this.syncMat.col2.y=k.y*h.x+j.y*h.y;this.syncMat.Abs();m=this.m_localCentroid.x+this.m_localOBB.center.x;l=this.m_localCentroid.y+this.m_localOBB.center.y;f=a.x+(b.col1.x*m+b.col2.x*l);d=a.y+(b.col1.y*m+b.col2.y*l);m=this.syncMat.col1.x*this.m_localOBB.extents.x+this.syncMat.col2.x*this.m_localOBB.extents.y;l=this.syncMat.col1.y*this.m_localOBB.extents.x+this.syncMat.col2.y*this.m_localOBB.extents.y;this.syncAABB.minVertex.x=Math.min(this.syncAABB.minVertex.x,f-m);this.syncAABB.minVertex.y=Math.min(this.syncAABB.minVertex.y,d-l);this.syncAABB.maxVertex.x=Math.max(this.syncAABB.maxVertex.x,f+m);this.syncAABB.maxVertex.y=Math.max(this.syncAABB.maxVertex.y,d+l);var g=this.m_body.m_world.m_broadPhase;if(g.InRange(this.syncAABB)){g.MoveProxy(this.m_proxyId,this.syncAABB)}else{this.m_body.Freeze()}},QuickSync:function(a,b){this.m_R.SetM(b); -this.m_position.x=a.x+(b.col1.x*this.m_localCentroid.x+b.col2.x*this.m_localCentroid.y);this.m_position.y=a.y+(b.col1.y*this.m_localCentroid.x+b.col2.y*this.m_localCentroid.y)},ResetProxy:function(b){if(this.m_proxyId==b2Pair.b2_nullProxy){return}var e=b.GetProxy(this.m_proxyId);b.DestroyProxy(this.m_proxyId);e=null;var g=b2Math.b2MulMM(this.m_R,this.m_localOBB.R);var d=b2Math.b2AbsM(g);var f=b2Math.b2MulMV(d,this.m_localOBB.extents);var a=b2Math.b2MulMV(this.m_R,this.m_localOBB.center);a.Add(this.m_position);var c=new b2AABB();c.minVertex.SetV(a);c.minVertex.Subtract(f);c.maxVertex.SetV(a);c.maxVertex.Add(f);if(b.InRange(c)){this.m_proxyId=b.CreateProxy(c,this)}else{this.m_proxyId=b2Pair.b2_nullProxy}if(this.m_proxyId==b2Pair.b2_nullProxy){this.m_body.Freeze()}},Support:function(c,a,b){var g=(c*this.m_R.col1.x+a*this.m_R.col1.y);var f=(c*this.m_R.col2.x+a*this.m_R.col2.y);var e=0;var j=(this.m_coreVertices[0].x*g+this.m_coreVertices[0].y*f);for(var d=1;dj){e=d;j=h}}b.Set(this.m_position.x+(this.m_R.col1.x*this.m_coreVertices[e].x+this.m_R.col2.x*this.m_coreVertices[e].y),this.m_position.y+(this.m_R.col1.y*this.m_coreVertices[e].x+this.m_R.col2.y*this.m_coreVertices[e].y))},m_localCentroid:new b2Vec2(),m_localOBB:new b2OBB(),m_vertices:null,m_coreVertices:null,m_vertexCount:0,m_normals:null});b2PolyShape.tempVec=new b2Vec2();b2PolyShape.tAbsR=new b2Mat22();var b2Body=function(f,e){this.sMat0=new b2Mat22();this.m_position=new b2Vec2();this.m_R=new b2Mat22(0);this.m_position0=new b2Vec2();var c=0;var g;var a;this.m_flags=0;this.m_position.SetV(f.position);this.m_rotation=f.rotation;this.m_R.Set(this.m_rotation);this.m_position0.SetV(this.m_position);this.m_rotation0=this.m_rotation;this.m_world=e;this.m_linearDamping=b2Math.b2Clamp(1-f.linearDamping,0,1);this.m_angularDamping=b2Math.b2Clamp(1-f.angularDamping,0,1);this.m_force=new b2Vec2(0,0);this.m_torque=0;this.m_mass=0;var h=new Array(b2Settings.b2_maxShapesPerBody);for(c=0;c0){this.m_center.Multiply(1/this.m_mass);this.m_position.Add(b2Math.b2MulMV(this.m_R,this.m_center)) -}else{this.m_flags|=b2Body.e_staticFlag}this.m_I=0;for(c=0;c0){this.m_invMass=1/this.m_mass}else{this.m_invMass=0}if(this.m_I>0&&f.preventRotation==false){this.m_invI=1/this.m_I}else{this.m_I=0;this.m_invI=0}this.m_linearVelocity=b2Math.AddVV(f.linearVelocity,b2Math.b2CrossFV(f.angularVelocity,this.m_center));this.m_angularVelocity=f.angularVelocity;this.m_jointList=null;this.m_contactList=null;this.m_prev=null;this.m_next=null;this.m_shapeList=null;for(c=0;c0}var c=(b.m_maskBits&a.m_categoryBits)!=0&&(b.m_categoryBits&a.m_maskBits)!=0;return c}};b2CollisionFilter.b2_defaultFilter=new b2CollisionFilter;var b2Island=function(e,d,c,a){var b=0;this.m_bodyCapacity=e;this.m_contactCapacity=d;this.m_jointCapacity=c;this.m_bodyCount=0;this.m_contactCount=0;this.m_jointCount=0;this.m_bodies=new Array(e);for(b=0;bc||b2Math.b2Dot(a.m_linearVelocity,a.m_linearVelocity)>d){a.m_sleepTime=0;e=0}else{a.m_sleepTime+=g;e=b2Math.b2Min(e,a.m_sleepTime)}}if(e>=b2Settings.b2_timeToSleep){for(f=0;f0){a.m_shape1.m_body.WakeUp();a.m_shape2.m_body.WakeUp()}var d=a.m_shape1.m_type;var b=a.m_shape2.m_type;var e=b2Contact.s_registers[d][b].destroyFcn;e(a,c)};b2Contact.s_registers=null;b2Contact.s_initialized=false;var b2ContactConstraint=function(){this.normal=new b2Vec2();this.points=new Array(b2Settings.b2_maxManifoldPoints);for(var a=0;a0){b.velocityBias=-60*b.separation}var h=f+(-F*C)-u-(-G*Q);var g=d+(F*D)-s-(G*S);var P=V.normal.x*h+V.normal.y*g;if(P<-b2Settings.b2_velocityThreshold){b.velocityBias+=-V.restitution*P}}++L}}};b2ContactSolver.prototype={PreSolve:function(){var b;var A;var r;for(var w=0;w=-b2Settings.b2_linearSlop},PostSolve:function(){for(var d=0;d0){this.m_manifoldCount=1 -}else{this.m_manifoldCount=0}},GetManifolds:function(){return this.m_manifold},m_manifold:[new b2Manifold()]});b2CircleContact.Create=function(b,a,c){return new b2CircleContact(b,a)};b2CircleContact.Destroy=function(a,b){};var b2Conservative=function(){};b2Conservative.prototype={};b2Conservative.R1=new b2Mat22();b2Conservative.R2=new b2Mat22();b2Conservative.x1=new b2Vec2();b2Conservative.x2=new b2Vec2();b2Conservative.Conservative=function(k,j){var i=k.GetBody();var h=j.GetBody();var s=i.m_position.x-i.m_position0.x;var q=i.m_position.y-i.m_position0.y;var H=i.m_rotation-i.m_rotation0;var b=h.m_position.x-h.m_position0.x;var a=h.m_position.y-h.m_position0.y;var F=h.m_rotation-h.m_rotation0;var m=k.GetMaxRadius();var l=j.GetMaxRadius();var I=i.m_position0.x;var D=i.m_position0.y;var z=i.m_rotation0;var E=h.m_position0.x;var C=h.m_position0.y;var n=h.m_rotation0;var e=I;var c=D;var J=z;var B=E;var A=C;var G=n;b2Conservative.R1.Set(J);b2Conservative.R2.Set(G);k.QuickSync(p1,b2Conservative.R1);j.QuickSync(p2,b2Conservative.R2);var L=0;var o=10;var u;var t;var y=0;var v=true;for(var w=0;wFLT_EPSILON){d*=b2_linearSlop/p}if(i.IsStatic()){i.m_position.x=e;i.m_position.y=c}else{i.m_position.x=e-u;i.m_position.y=c-t}i.m_rotation=J;i.m_R.Set(J);i.QuickSyncShapes();if(h.IsStatic()){h.m_position.x=B;h.m_position.y=A}else{h.m_position.x=B+u;h.m_position.y=A+t}h.m_position.x=B+u;h.m_position.y=A+t;h.m_rotation=G;h.m_R.Set(G);h.QuickSyncShapes();return true -}k.QuickSync(i.m_position,i.m_R);j.QuickSync(h.m_position,h.m_R);return false};var b2NullContact=function(b,a){this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!b||!a){this.m_shape1=null;this.m_shape2=null;return}this.m_shape1=b;this.m_shape2=a;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null};Object.extend(b2NullContact.prototype,b2Contact.prototype);Object.extend(b2NullContact.prototype,{Evaluate:function(){},GetManifolds:function(){return null}});var b2PolyAndCircleContact=function(b,a){this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!b||!a){this.m_shape1=null;this.m_shape2=null;return}this.m_shape1=b;this.m_shape2=a;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null;this.m_manifold=[new b2Manifold()];b2Settings.b2Assert(this.m_shape1.m_type==b2Shape.e_polyShape);b2Settings.b2Assert(this.m_shape2.m_type==b2Shape.e_circleShape);this.m_manifold[0].pointCount=0;this.m_manifold[0].points[0].normalImpulse=0;this.m_manifold[0].points[0].tangentImpulse=0};Object.extend(b2PolyAndCircleContact.prototype,b2Contact.prototype);Object.extend(b2PolyAndCircleContact.prototype,{Evaluate:function(){b2Collision.b2CollidePolyAndCircle(this.m_manifold[0],this.m_shape1,this.m_shape2,false); -if(this.m_manifold[0].pointCount>0){this.m_manifoldCount=1}else{this.m_manifoldCount=0}},GetManifolds:function(){return this.m_manifold},m_manifold:[new b2Manifold()]});b2PolyAndCircleContact.Create=function(b,a,c){return new b2PolyAndCircleContact(b,a)};b2PolyAndCircleContact.Destroy=function(a,b){};var b2PolyContact=function(b,a){this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!b||!a){this.m_shape1=null;this.m_shape2=null;return}this.m_shape1=b;this.m_shape2=a;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null;this.m0=new b2Manifold();this.m_manifold=[new b2Manifold()];this.m_manifold[0].pointCount=0};Object.extend(b2PolyContact.prototype,b2Contact.prototype);Object.extend(b2PolyContact.prototype,{m0:new b2Manifold(),Evaluate:function(){var a=this.m_manifold[0];var b=this.m0.points;for(var d=0;d0){var h=[false,false];for(var f=0;f0){var e=f.m_shape1.m_body;var d=f.m_shape2.m_body;var b=f.m_node1;var a=f.m_node2;e.WakeUp();d.WakeUp();if(b.prev){b.prev.next=b.next}if(b.next){b.next.prev=b.prev}if(b==e.m_contactList){e.m_contactList=b.next}b.prev=null;b.next=null;if(a.prev){a.prev.next=a.next}if(a.next){a.next.prev=a.prev}if(a==d.m_contactList){d.m_contactList=a.next}a.prev=null;a.next=null}b2Contact.Destroy(f,this.m_world.m_blockAllocator);--this.m_world.m_contactCount},CleanContactList:function(){var b=this.m_world.m_contactList;while(b!=null){var a=b;b=b.m_next;if(a.m_flags&b2Contact.e_destroyFlag){this.DestroyContact(a);a=null}}},Collide:function(){var f;var e;var d;var a;for(var h=this.m_world.m_contactList;h!=null;h=h.m_next){if(h.m_shape1.m_body.IsSleeping()&&h.m_shape2.m_body.IsSleeping()){continue -}var b=h.GetManifoldCount();h.Evaluate();var g=h.GetManifoldCount();if(b==0&&g>0){f=h.m_shape1.m_body;e=h.m_shape2.m_body;d=h.m_node1;a=h.m_node2;d.contact=h;d.other=e;d.prev=null;d.next=f.m_contactList;if(d.next!=null){d.next.prev=h.m_node1}f.m_contactList=h.m_node1;a.contact=h;a.other=f;a.prev=null;a.next=e.m_contactList;if(a.next!=null){a.next.prev=a}e.m_contactList=a}else{if(b>0&&g==0){f=h.m_shape1.m_body;e=h.m_shape2.m_body;d=h.m_node1;a=h.m_node2;if(d.prev){d.prev.next=d.next}if(d.next){d.next.prev=d.prev}if(d==f.m_contactList){f.m_contactList=d.next}d.prev=null;d.next=null;if(a.prev){a.prev.next=a.next}if(a.next){a.next.prev=a.prev}if(a==e.m_contactList){e.m_contactList=a.next}a.prev=null;a.next=null}}}},m_world:null,m_nullContact:new b2NullContact(),m_destroyImmediate:null});var b2World=function(a,d,c){this.step=new b2TimeStep();this.m_contactManager=new b2ContactManager();this.m_listener=null;this.m_filter=b2CollisionFilter.b2_defaultFilter;this.m_bodyList=null;this.m_contactList=null;this.m_jointList=null;this.m_bodyCount=0;this.m_contactCount=0;this.m_jointCount=0;this.m_bodyDestroyList=null;this.m_allowSleep=c;this.m_gravity=d;this.m_contactManager.m_world=this;this.m_broadPhase=new b2BroadPhase(a,this.m_contactManager);var b=new b2BodyDef();this.m_groundBody=this.CreateBody(b)};b2World.prototype={SetListener:function(a){this.m_listener=a},SetFilter:function(a){this.m_filter=a},CreateBody:function(c){var a=new b2Body(c,this);a.m_prev=null;a.m_next=this.m_bodyList;if(this.m_bodyList){this.m_bodyList.m_prev=a}this.m_bodyList=a;++this.m_bodyCount;return a},DestroyBody:function(a){if(a.m_flags&b2Body.e_destroyFlag){return}if(a.m_prev){a.m_prev.m_next=a.m_next}if(a.m_next){a.m_next.m_prev=a.m_prev}if(a==this.m_bodyList){this.m_bodyList=a.m_next}a.m_flags|=b2Body.e_destroyFlag; ---this.m_bodyCount;a.m_prev=null;a.m_next=this.m_bodyDestroyList;this.m_bodyDestroyList=a},CleanBodyList:function(){this.m_contactManager.m_destroyImmediate=true;var c=this.m_bodyDestroyList;while(c){var e=c;c=c.m_next;var d=e.m_jointList;while(d){var a=d;d=d.next;if(this.m_listener){this.m_listener.NotifyJointDestroyed(a.joint)}this.DestroyJoint(a.joint)}e.Destroy()}this.m_bodyDestroyList=null;this.m_contactManager.m_destroyImmediate=false},CreateJoint:function(e){var c=b2Joint.Create(e,this.m_blockAllocator);c.m_prev=null;c.m_next=this.m_jointList;if(this.m_jointList){this.m_jointList.m_prev=c}this.m_jointList=c;++this.m_jointCount;c.m_node1.joint=c;c.m_node1.other=c.m_body2;c.m_node1.prev=null;c.m_node1.next=c.m_body1.m_jointList;if(c.m_body1.m_jointList){c.m_body1.m_jointList.prev=c.m_node1}c.m_body1.m_jointList=c.m_node1;c.m_node2.joint=c;c.m_node2.other=c.m_body1;c.m_node2.prev=null;c.m_node2.next=c.m_body2.m_jointList;if(c.m_body2.m_jointList){c.m_body2.m_jointList.prev=c.m_node2 -}c.m_body2.m_jointList=c.m_node2;if(e.collideConnected==false){var a=e.body1.m_shapeCount0){this.step.inv_dt=1/a}else{this.step.inv_dt=0}this.m_positionIterationCount=0;this.m_contactManager.CleanContactList();this.CleanBodyList();this.m_contactManager.Collide();var n=new b2Island(this.m_bodyCount,this.m_contactCount,this.m_jointCount,this.m_stackAllocator);for(r=this.m_bodyList;r!=null;r=r.m_next){r.m_flags&=~b2Body.e_islandFlag}for(var p=this.m_contactList;p!=null;p=p.m_next){p.m_flags&=~b2Contact.e_islandFlag}for(var h=this.m_jointList;h!=null;h=h.m_next){h.m_islandFlag=false}var u=this.m_bodyCount;var q=new Array(this.m_bodyCount);for(var g=0;g0){r=q[--t];n.AddBody(r);r.m_flags&=~b2Body.e_sleepFlag; -if(r.m_flags&b2Body.e_staticFlag){continue}for(var s=r.m_contactList;s!=null;s=s.next){if(s.contact.m_flags&b2Contact.e_islandFlag){continue}n.AddContact(s.contact);s.contact.m_flags|=b2Contact.e_islandFlag;o=s.other;if(o.m_flags&b2Body.e_islandFlag){continue}q[t++]=o;o.m_flags|=b2Body.e_islandFlag}for(var f=r.m_jointList;f!=null;f=f.next){if(f.joint.m_islandFlag==true){continue}n.AddJoint(f.joint);f.joint.m_islandFlag=true;o=f.other;if(o.m_flags&b2Body.e_islandFlag){continue}q[t++]=o;o.m_flags|=b2Body.e_islandFlag}}n.Solve(this.step,this.m_gravity);this.m_positionIterationCount=b2Math.b2Max(this.m_positionIterationCount,b2Island.m_positionIterationCount);if(this.m_allowSleep){n.UpdateSleep(a)}for(var l=0;lb2Settings.b2_linearSlop){this.m_u.Multiply(1/a)}else{this.m_u.SetZero()}var h=(j*this.m_u.y-i*this.m_u.x);var d=(f*this.m_u.y-e*this.m_u.x);this.m_mass=this.m_body1.m_invMass+this.m_body1.m_invI*h*h+this.m_body2.m_invMass+this.m_body2.m_invI*d*d;this.m_mass=1/this.m_mass;if(b2World.s_enableWarmStarting){var c=this.m_impulse*this.m_u.x;var b=this.m_impulse*this.m_u.y;this.m_body1.m_linearVelocity.x-=this.m_body1.m_invMass*c;this.m_body1.m_linearVelocity.y-=this.m_body1.m_invMass*b;this.m_body1.m_angularVelocity-=this.m_body1.m_invI*(j*b-i*c); -this.m_body2.m_linearVelocity.x+=this.m_body2.m_invMass*c;this.m_body2.m_linearVelocity.y+=this.m_body2.m_invMass*b;this.m_body2.m_angularVelocity+=this.m_body2.m_invI*(f*b-e*c)}else{this.m_impulse=0}},SolveVelocityConstraints:function(b){var j;j=this.m_body1.m_R;var n=j.col1.x*this.m_localAnchor1.x+j.col2.x*this.m_localAnchor1.y;var m=j.col1.y*this.m_localAnchor1.x+j.col2.y*this.m_localAnchor1.y;j=this.m_body2.m_R;var h=j.col1.x*this.m_localAnchor2.x+j.col2.x*this.m_localAnchor2.y;var g=j.col1.y*this.m_localAnchor2.x+j.col2.y*this.m_localAnchor2.y;var l=this.m_body1.m_linearVelocity.x+(-this.m_body1.m_angularVelocity*m);var k=this.m_body1.m_linearVelocity.y+(this.m_body1.m_angularVelocity*n);var f=this.m_body2.m_linearVelocity.x+(-this.m_body2.m_angularVelocity*g);var e=this.m_body2.m_linearVelocity.y+(this.m_body2.m_angularVelocity*h);var i=(this.m_u.x*(f-l)+this.m_u.y*(e-k));var a=-this.m_mass*i;this.m_impulse+=a;var d=a*this.m_u.x;var c=a*this.m_u.y;this.m_body1.m_linearVelocity.x-=this.m_body1.m_invMass*d; -this.m_body1.m_linearVelocity.y-=this.m_body1.m_invMass*c;this.m_body1.m_angularVelocity-=this.m_body1.m_invI*(n*c-m*d);this.m_body2.m_linearVelocity.x+=this.m_body2.m_invMass*d;this.m_body2.m_linearVelocity.y+=this.m_body2.m_invMass*c;this.m_body2.m_angularVelocity+=this.m_body2.m_invI*(h*c-g*d)},SolvePositionConstraints:function(){var j;j=this.m_body1.m_R;var l=j.col1.x*this.m_localAnchor1.x+j.col2.x*this.m_localAnchor1.y;var k=j.col1.y*this.m_localAnchor1.x+j.col2.y*this.m_localAnchor1.y;j=this.m_body2.m_R;var i=j.col1.x*this.m_localAnchor2.x+j.col2.x*this.m_localAnchor2.y;var h=j.col1.y*this.m_localAnchor2.x+j.col2.y*this.m_localAnchor2.y;var g=this.m_body2.m_position.x+i-this.m_body1.m_position.x-l;var f=this.m_body2.m_position.y+h-this.m_body1.m_position.y-k;var c=Math.sqrt(g*g+f*f);g/=c;f/=c;var a=c-this.m_length;a=b2Math.b2Clamp(a,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);var b=-this.m_mass*a;this.m_u.Set(g,f);var e=b*this.m_u.x;var d=b*this.m_u.y;this.m_body1.m_position.x-=this.m_body1.m_invMass*e; -this.m_body1.m_position.y-=this.m_body1.m_invMass*d;this.m_body1.m_rotation-=this.m_body1.m_invI*(l*d-k*e);this.m_body2.m_position.x+=this.m_body2.m_invMass*e;this.m_body2.m_position.y+=this.m_body2.m_invMass*d;this.m_body2.m_rotation+=this.m_body2.m_invI*(i*d-h*e);this.m_body1.m_R.Set(this.m_body1.m_rotation);this.m_body2.m_R.Set(this.m_body2.m_rotation);return b2Math.b2Abs(a)d.dt*this.m_maxForce){this.m_impulse.Multiply(d.dt*this.m_maxForce/b)}e=this.m_impulse.x-j;c=this.m_impulse.y-g;i.m_linearVelocity.x+=i.m_invMass*e;i.m_linearVelocity.y+=i.m_invMass*c; -i.m_angularVelocity+=i.m_invI*(h*c-f*e)},SolvePositionConstraints:function(){return true},m_localAnchor:new b2Vec2(),m_target:new b2Vec2(),m_impulse:new b2Vec2(),m_ptpMass:new b2Mat22(),m_C:new b2Vec2(),m_maxForce:null,m_beta:null,m_gamma:null});var b2MouseJointDef=function(){this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.target=new b2Vec2();this.type=b2Joint.e_mouseJoint;this.maxForce=0;this.frequencyHz=5;this.dampingRatio=0.7;this.timeStep=1/60};Object.extend(b2MouseJointDef.prototype,b2JointDef.prototype);Object.extend(b2MouseJointDef.prototype,{target:new b2Vec2(),maxForce:null,frequencyHz:null,dampingRatio:null,timeStep:null});var b2PrismaticJoint=function(c){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=c.type;this.m_prev=null;this.m_next=null;this.m_body1=c.body1;this.m_body2=c.body2;this.m_collideConnected=c.collideConnected;this.m_islandFlag=false;this.m_userData=c.userData;this.m_localAnchor1=new b2Vec2();this.m_localAnchor2=new b2Vec2();this.m_localXAxis1=new b2Vec2();this.m_localYAxis1=new b2Vec2();this.m_linearJacobian=new b2Jacobian();this.m_motorJacobian=new b2Jacobian();var b;var a;var d;b=this.m_body1.m_R;a=(c.anchorPoint.x-this.m_body1.m_position.x);d=(c.anchorPoint.y-this.m_body1.m_position.y);this.m_localAnchor1.Set((a*b.col1.x+d*b.col1.y),(a*b.col2.x+d*b.col2.y));b=this.m_body2.m_R;a=(c.anchorPoint.x-this.m_body2.m_position.x);d=(c.anchorPoint.y-this.m_body2.m_position.y);this.m_localAnchor2.Set((a*b.col1.x+d*b.col1.y),(a*b.col2.x+d*b.col2.y));b=this.m_body1.m_R;a=c.axis.x;d=c.axis.y;this.m_localXAxis1.Set((a*b.col1.x+d*b.col1.y),(a*b.col2.x+d*b.col2.y));this.m_localYAxis1.x=-this.m_localXAxis1.y; -this.m_localYAxis1.y=this.m_localXAxis1.x;this.m_initialAngle=this.m_body2.m_rotation-this.m_body1.m_rotation;this.m_linearJacobian.SetZero();this.m_linearMass=0;this.m_linearImpulse=0;this.m_angularMass=0;this.m_angularImpulse=0;this.m_motorJacobian.SetZero();this.m_motorMass=0;this.m_motorImpulse=0;this.m_limitImpulse=0;this.m_limitPositionImpulse=0;this.m_lowerTranslation=c.lowerTranslation;this.m_upperTranslation=c.upperTranslation;this.m_maxMotorForce=c.motorForce;this.m_motorSpeed=c.motorSpeed;this.m_enableLimit=c.enableLimit;this.m_enableMotor=c.enableMotor};Object.extend(b2PrismaticJoint.prototype,b2Joint.prototype);Object.extend(b2PrismaticJoint.prototype,{GetAnchor1:function(){var a=this.m_body1;var b=new b2Vec2();b.SetV(this.m_localAnchor1);b.MulM(a.m_R);b.Add(a.m_position);return b},GetAnchor2:function(){var a=this.m_body2;var b=new b2Vec2();b.SetV(this.m_localAnchor2);b.MulM(a.m_R);b.Add(a.m_position);return b},GetJointTranslation:function(){var l=this.m_body1;var k=this.m_body2; -var j;j=l.m_R;var p=j.col1.x*this.m_localAnchor1.x+j.col2.x*this.m_localAnchor1.y;var n=j.col1.y*this.m_localAnchor1.x+j.col2.y*this.m_localAnchor1.y;j=k.m_R;var i=j.col1.x*this.m_localAnchor2.x+j.col2.x*this.m_localAnchor2.y;var h=j.col1.y*this.m_localAnchor2.x+j.col2.y*this.m_localAnchor2.y;var g=l.m_position.x+p;var f=l.m_position.y+n;var c=k.m_position.x+i;var b=k.m_position.y+h;var e=c-g;var d=b-f;j=l.m_R;var o=j.col1.x*this.m_localXAxis1.x+j.col2.x*this.m_localXAxis1.y;var m=j.col1.y*this.m_localXAxis1.x+j.col2.y*this.m_localXAxis1.y;var a=o*e+m*d;return a},GetJointSpeed:function(){var j=this.m_body1;var i=this.m_body2;var k;k=j.m_R;var t=k.col1.x*this.m_localAnchor1.x+k.col2.x*this.m_localAnchor1.y;var s=k.col1.y*this.m_localAnchor1.x+k.col2.y*this.m_localAnchor1.y;k=i.m_R;var h=k.col1.x*this.m_localAnchor2.x+k.col2.x*this.m_localAnchor2.y;var g=k.col1.y*this.m_localAnchor2.x+k.col2.y*this.m_localAnchor2.y;var r=j.m_position.x+t;var p=j.m_position.y+s;var c=i.m_position.x+h;var a=i.m_position.y+g; -var f=c-r;var e=a-p;k=j.m_R;var o=k.col1.x*this.m_localXAxis1.x+k.col2.x*this.m_localXAxis1.y;var n=k.col1.y*this.m_localXAxis1.x+k.col2.y*this.m_localXAxis1.y;var d=j.m_linearVelocity;var b=i.m_linearVelocity;var m=j.m_angularVelocity;var l=i.m_angularVelocity;var q=(f*(-m*n)+e*(m*o))+(o*(((b.x+(-l*g))-d.x)-(-m*s))+n*(((b.y+(l*h))-d.y)-(m*t)));return q},GetMotorForce:function(a){return a*this.m_motorImpulse},SetMotorSpeed:function(a){this.m_motorSpeed=a},SetMotorForce:function(a){this.m_maxMotorForce=a},GetReactionForce:function(b){var e=b*this.m_limitImpulse;var d;d=this.m_body1.m_R;var g=e*(d.col1.x*this.m_localXAxis1.x+d.col2.x*this.m_localXAxis1.y);var f=e*(d.col1.y*this.m_localXAxis1.x+d.col2.y*this.m_localXAxis1.y);var c=e*(d.col1.x*this.m_localYAxis1.x+d.col2.x*this.m_localYAxis1.y);var a=e*(d.col1.y*this.m_localYAxis1.x+d.col2.y*this.m_localYAxis1.y);return new b2Vec2(g+c,f+a)},GetReactionTorque:function(a){return a*this.m_angularImpulse},PrepareVelocitySolver:function(){var m=this.m_body1; -var l=this.m_body2;var p;p=m.m_R;var z=p.col1.x*this.m_localAnchor1.x+p.col2.x*this.m_localAnchor1.y;var y=p.col1.y*this.m_localAnchor1.x+p.col2.y*this.m_localAnchor1.y;p=l.m_R;var i=p.col1.x*this.m_localAnchor2.x+p.col2.x*this.m_localAnchor2.y;var g=p.col1.y*this.m_localAnchor2.x+p.col2.y*this.m_localAnchor2.y;var s=m.m_invMass;var r=l.m_invMass;var k=m.m_invI;var j=l.m_invI;p=m.m_R;var h=p.col1.x*this.m_localYAxis1.x+p.col2.x*this.m_localYAxis1.y;var f=p.col1.y*this.m_localYAxis1.x+p.col2.y*this.m_localYAxis1.y;var t=l.m_position.x+i-m.m_position.x;var q=l.m_position.y+g-m.m_position.y;this.m_linearJacobian.linear1.x=-h;this.m_linearJacobian.linear1.y=-f;this.m_linearJacobian.linear2.x=h;this.m_linearJacobian.linear2.y=f;this.m_linearJacobian.angular1=-(t*f-q*h);this.m_linearJacobian.angular2=i*f-g*h;this.m_linearMass=s+k*this.m_linearJacobian.angular1*this.m_linearJacobian.angular1+r+j*this.m_linearJacobian.angular2*this.m_linearJacobian.angular2;this.m_linearMass=1/this.m_linearMass; -this.m_angularMass=1/(k+j);if(this.m_enableLimit||this.m_enableMotor){p=m.m_R;var v=p.col1.x*this.m_localXAxis1.x+p.col2.x*this.m_localXAxis1.y;var u=p.col1.y*this.m_localXAxis1.x+p.col2.y*this.m_localXAxis1.y;this.m_motorJacobian.linear1.x=-v;this.m_motorJacobian.linear1.y=-u;this.m_motorJacobian.linear2.x=v;this.m_motorJacobian.linear2.y=u;this.m_motorJacobian.angular1=-(t*u-q*v);this.m_motorJacobian.angular2=i*u-g*v;this.m_motorMass=s+k*this.m_motorJacobian.angular1*this.m_motorJacobian.angular1+r+j*this.m_motorJacobian.angular2*this.m_motorJacobian.angular2;this.m_motorMass=1/this.m_motorMass;if(this.m_enableLimit){var e=t-z;var d=q-y;var c=v*e+u*d;if(b2Math.b2Abs(this.m_upperTranslation-this.m_lowerTranslation)<2*b2Settings.b2_linearSlop){this.m_limitState=b2Joint.e_equalLimits}else{if(c<=this.m_lowerTranslation){if(this.m_limitState!=b2Joint.e_atLowerLimit){this.m_limitImpulse=0}this.m_limitState=b2Joint.e_atLowerLimit}else{if(c>=this.m_upperTranslation){if(this.m_limitState!=b2Joint.e_atUpperLimit){this.m_limitImpulse=0 -}this.m_limitState=b2Joint.e_atUpperLimit}else{this.m_limitState=b2Joint.e_inactiveLimit;this.m_limitImpulse=0}}}}}if(this.m_enableMotor==false){this.m_motorImpulse=0}if(this.m_enableLimit==false){this.m_limitImpulse=0}if(b2World.s_enableWarmStarting){var b=this.m_linearImpulse*this.m_linearJacobian.linear1.x+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear1.x;var a=this.m_linearImpulse*this.m_linearJacobian.linear1.y+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear1.y;var o=this.m_linearImpulse*this.m_linearJacobian.linear2.x+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear2.x;var n=this.m_linearImpulse*this.m_linearJacobian.linear2.y+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear2.y;var x=this.m_linearImpulse*this.m_linearJacobian.angular1-this.m_angularImpulse+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.angular1;var w=this.m_linearImpulse*this.m_linearJacobian.angular2+this.m_angularImpulse+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.angular2; -m.m_linearVelocity.x+=s*b;m.m_linearVelocity.y+=s*a;m.m_angularVelocity+=k*x;l.m_linearVelocity.x+=r*o;l.m_linearVelocity.y+=r*n;l.m_angularVelocity+=j*w}else{this.m_linearImpulse=0;this.m_angularImpulse=0;this.m_limitImpulse=0;this.m_motorImpulse=0}this.m_limitPositionImpulse=0},SolveVelocityConstraints:function(b){var l=this.m_body1;var k=this.m_body2;var q=l.m_invMass;var o=k.m_invMass;var d=l.m_invI;var c=k.m_invI;var p;var e=this.m_linearJacobian.Compute(l.m_linearVelocity,l.m_angularVelocity,k.m_linearVelocity,k.m_angularVelocity);var j=-this.m_linearMass*e;this.m_linearImpulse+=j;l.m_linearVelocity.x+=(q*j)*this.m_linearJacobian.linear1.x;l.m_linearVelocity.y+=(q*j)*this.m_linearJacobian.linear1.y;l.m_angularVelocity+=d*j*this.m_linearJacobian.angular1;k.m_linearVelocity.x+=(o*j)*this.m_linearJacobian.linear2.x;k.m_linearVelocity.y+=(o*j)*this.m_linearJacobian.linear2.y;k.m_angularVelocity+=c*j*this.m_linearJacobian.angular2;var h=k.m_angularVelocity-l.m_angularVelocity;var a=-this.m_angularMass*h; -this.m_angularImpulse+=a;l.m_angularVelocity-=d*a;k.m_angularVelocity+=c*a;if(this.m_enableMotor&&this.m_limitState!=b2Joint.e_equalLimits){var m=this.m_motorJacobian.Compute(l.m_linearVelocity,l.m_angularVelocity,k.m_linearVelocity,k.m_angularVelocity)-this.m_motorSpeed;var f=-this.m_motorMass*m;var n=this.m_motorImpulse;this.m_motorImpulse=b2Math.b2Clamp(this.m_motorImpulse+f,-b.dt*this.m_maxMotorForce,b.dt*this.m_maxMotorForce);f=this.m_motorImpulse-n;l.m_linearVelocity.x+=(q*f)*this.m_motorJacobian.linear1.x;l.m_linearVelocity.y+=(q*f)*this.m_motorJacobian.linear1.y;l.m_angularVelocity+=d*f*this.m_motorJacobian.angular1;k.m_linearVelocity.x+=(o*f)*this.m_motorJacobian.linear2.x;k.m_linearVelocity.y+=(o*f)*this.m_motorJacobian.linear2.y;k.m_angularVelocity+=c*f*this.m_motorJacobian.angular2}if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit){var i=this.m_motorJacobian.Compute(l.m_linearVelocity,l.m_angularVelocity,k.m_linearVelocity,k.m_angularVelocity);var g=-this.m_motorMass*i; -if(this.m_limitState==b2Joint.e_equalLimits){this.m_limitImpulse+=g}else{if(this.m_limitState==b2Joint.e_atLowerLimit){p=this.m_limitImpulse;this.m_limitImpulse=b2Math.b2Max(this.m_limitImpulse+g,0);g=this.m_limitImpulse-p}else{if(this.m_limitState==b2Joint.e_atUpperLimit){p=this.m_limitImpulse;this.m_limitImpulse=b2Math.b2Min(this.m_limitImpulse+g,0);g=this.m_limitImpulse-p}}}l.m_linearVelocity.x+=(q*g)*this.m_motorJacobian.linear1.x;l.m_linearVelocity.y+=(q*g)*this.m_motorJacobian.linear1.y;l.m_angularVelocity+=d*g*this.m_motorJacobian.angular1;k.m_linearVelocity.x+=(o*g)*this.m_motorJacobian.linear2.x;k.m_linearVelocity.y+=(o*g)*this.m_motorJacobian.linear2.y;k.m_angularVelocity+=c*g*this.m_motorJacobian.angular2}},SolvePositionConstraints:function(){var o;var y;var m=this.m_body1;var k=this.m_body2;var t=m.m_invMass;var s=k.m_invMass;var j=m.m_invI;var i=k.m_invI;var q;q=m.m_R;var E=q.col1.x*this.m_localAnchor1.x+q.col2.x*this.m_localAnchor1.y;var D=q.col1.y*this.m_localAnchor1.x+q.col2.y*this.m_localAnchor1.y; -q=k.m_R;var h=q.col1.x*this.m_localAnchor2.x+q.col2.x*this.m_localAnchor2.y;var g=q.col1.y*this.m_localAnchor2.x+q.col2.y*this.m_localAnchor2.y;var B=m.m_position.x+E;var z=m.m_position.y+D;var b=k.m_position.x+h;var a=k.m_position.y+g;var e=b-B;var c=a-z;q=m.m_R;var f=q.col1.x*this.m_localYAxis1.x+q.col2.x*this.m_localYAxis1.y;var d=q.col1.y*this.m_localYAxis1.x+q.col2.y*this.m_localYAxis1.y;var l=f*e+d*c;l=b2Math.b2Clamp(l,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);var x=-this.m_linearMass*l;m.m_position.x+=(t*x)*this.m_linearJacobian.linear1.x;m.m_position.y+=(t*x)*this.m_linearJacobian.linear1.y;m.m_rotation+=j*x*this.m_linearJacobian.angular1;k.m_position.x+=(s*x)*this.m_linearJacobian.linear2.x;k.m_position.y+=(s*x)*this.m_linearJacobian.linear2.y;k.m_rotation+=i*x*this.m_linearJacobian.angular2;var p=b2Math.b2Abs(l);var A=k.m_rotation-m.m_rotation-this.m_initialAngle;A=b2Math.b2Clamp(A,-b2Settings.b2_maxAngularCorrection,b2Settings.b2_maxAngularCorrection); -var r=-this.m_angularMass*A;m.m_rotation-=m.m_invI*r;m.m_R.Set(m.m_rotation);k.m_rotation+=k.m_invI*r;k.m_R.Set(k.m_rotation);var C=b2Math.b2Abs(A);if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit){q=m.m_R;E=q.col1.x*this.m_localAnchor1.x+q.col2.x*this.m_localAnchor1.y;D=q.col1.y*this.m_localAnchor1.x+q.col2.y*this.m_localAnchor1.y;q=k.m_R;h=q.col1.x*this.m_localAnchor2.x+q.col2.x*this.m_localAnchor2.y;g=q.col1.y*this.m_localAnchor2.x+q.col2.y*this.m_localAnchor2.y;B=m.m_position.x+E;z=m.m_position.y+D;b=k.m_position.x+h;a=k.m_position.y+g;e=b-B;c=a-z;q=m.m_R;var v=q.col1.x*this.m_localXAxis1.x+q.col2.x*this.m_localXAxis1.y;var u=q.col1.y*this.m_localXAxis1.x+q.col2.y*this.m_localXAxis1.y;var n=(v*e+u*c);var w=0;if(this.m_limitState==b2Joint.e_equalLimits){o=b2Math.b2Clamp(n,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);w=-this.m_motorMass*o;p=b2Math.b2Max(p,b2Math.b2Abs(A))}else{if(this.m_limitState==b2Joint.e_atLowerLimit){o=n-this.m_lowerTranslation; -p=b2Math.b2Max(p,-o);o=b2Math.b2Clamp(o+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0);w=-this.m_motorMass*o;y=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Max(this.m_limitPositionImpulse+w,0);w=this.m_limitPositionImpulse-y}else{if(this.m_limitState==b2Joint.e_atUpperLimit){o=n-this.m_upperTranslation;p=b2Math.b2Max(p,o);o=b2Math.b2Clamp(o-b2Settings.b2_linearSlop,0,b2Settings.b2_maxLinearCorrection);w=-this.m_motorMass*o;y=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Min(this.m_limitPositionImpulse+w,0);w=this.m_limitPositionImpulse-y}}}m.m_position.x+=(t*w)*this.m_motorJacobian.linear1.x;m.m_position.y+=(t*w)*this.m_motorJacobian.linear1.y;m.m_rotation+=j*w*this.m_motorJacobian.angular1;m.m_R.Set(m.m_rotation);k.m_position.x+=(s*w)*this.m_motorJacobian.linear2.x;k.m_position.y+=(s*w)*this.m_motorJacobian.linear2.y;k.m_rotation+=i*w*this.m_motorJacobian.angular2;k.m_R.Set(k.m_rotation)}return p<=b2Settings.b2_linearSlop&&C<=b2Settings.b2_angularSlop -},m_localAnchor1:new b2Vec2(),m_localAnchor2:new b2Vec2(),m_localXAxis1:new b2Vec2(),m_localYAxis1:new b2Vec2(),m_initialAngle:null,m_linearJacobian:new b2Jacobian(),m_linearMass:null,m_linearImpulse:null,m_angularMass:null,m_angularImpulse:null,m_motorJacobian:new b2Jacobian(),m_motorMass:null,m_motorImpulse:null,m_limitImpulse:null,m_limitPositionImpulse:null,m_lowerTranslation:null,m_upperTranslation:null,m_maxMotorForce:null,m_motorSpeed:null,m_enableLimit:null,m_enableMotor:null,m_limitState:0});var b2PrismaticJointDef=function(){this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.type=b2Joint.e_prismaticJoint;this.anchorPoint=new b2Vec2(0,0);this.axis=new b2Vec2(0,0);this.lowerTranslation=0;this.upperTranslation=0;this.motorForce=0;this.motorSpeed=0;this.enableLimit=false;this.enableMotor=false};Object.extend(b2PrismaticJointDef.prototype,b2JointDef.prototype);Object.extend(b2PrismaticJointDef.prototype,{anchorPoint:null,axis:null,lowerTranslation:null,upperTranslation:null,motorForce:null,motorSpeed:null,enableLimit:null,enableMotor:null,Initialize:function(b,a,d,c){this.body1=b;this.body2=a;this.anchorPoint=d;this.axis=c}});var b2PulleyJoint=function(d){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=d.type;this.m_prev=null;this.m_next=null;this.m_body1=d.body1;this.m_body2=d.body2;this.m_collideConnected=d.collideConnected;this.m_islandFlag=false;this.m_userData=d.userData;this.m_groundAnchor1=new b2Vec2();this.m_groundAnchor2=new b2Vec2();this.m_localAnchor1=new b2Vec2();this.m_localAnchor2=new b2Vec2();this.m_u1=new b2Vec2();this.m_u2=new b2Vec2();var b;var a;var h;this.m_ground=this.m_body1.m_world.m_groundBody;this.m_groundAnchor1.x=d.groundPoint1.x-this.m_ground.m_position.x;this.m_groundAnchor1.y=d.groundPoint1.y-this.m_ground.m_position.y;this.m_groundAnchor2.x=d.groundPoint2.x-this.m_ground.m_position.x;this.m_groundAnchor2.y=d.groundPoint2.y-this.m_ground.m_position.y;b=this.m_body1.m_R;a=d.anchorPoint1.x-this.m_body1.m_position.x;h=d.anchorPoint1.y-this.m_body1.m_position.y;this.m_localAnchor1.x=a*b.col1.x+h*b.col1.y;this.m_localAnchor1.y=a*b.col2.x+h*b.col2.y;b=this.m_body2.m_R; -a=d.anchorPoint2.x-this.m_body2.m_position.x;h=d.anchorPoint2.y-this.m_body2.m_position.y;this.m_localAnchor2.x=a*b.col1.x+h*b.col1.y;this.m_localAnchor2.y=a*b.col2.x+h*b.col2.y;this.m_ratio=d.ratio;a=d.groundPoint1.x-d.anchorPoint1.x;h=d.groundPoint1.y-d.anchorPoint1.y;var f=Math.sqrt(a*a+h*h);a=d.groundPoint2.x-d.anchorPoint2.x;h=d.groundPoint2.y-d.anchorPoint2.y;var c=Math.sqrt(a*a+h*h);var g=b2Math.b2Max(0.5*b2PulleyJoint.b2_minPulleyLength,f);var e=b2Math.b2Max(0.5*b2PulleyJoint.b2_minPulleyLength,c);this.m_constant=g+this.m_ratio*e;this.m_maxLength1=b2Math.b2Clamp(d.maxLength1,g,this.m_constant-this.m_ratio*b2PulleyJoint.b2_minPulleyLength);this.m_maxLength2=b2Math.b2Clamp(d.maxLength2,e,(this.m_constant-b2PulleyJoint.b2_minPulleyLength)/this.m_ratio);this.m_pulleyImpulse=0;this.m_limitImpulse1=0;this.m_limitImpulse2=0};Object.extend(b2PulleyJoint.prototype,b2Joint.prototype);Object.extend(b2PulleyJoint.prototype,{GetAnchor1:function(){var a=this.m_body1.m_R;return new b2Vec2(this.m_body1.m_position.x+(a.col1.x*this.m_localAnchor1.x+a.col2.x*this.m_localAnchor1.y),this.m_body1.m_position.y+(a.col1.y*this.m_localAnchor1.x+a.col2.y*this.m_localAnchor1.y)) -},GetAnchor2:function(){var a=this.m_body2.m_R;return new b2Vec2(this.m_body2.m_position.x+(a.col1.x*this.m_localAnchor2.x+a.col2.x*this.m_localAnchor2.y),this.m_body2.m_position.y+(a.col1.y*this.m_localAnchor2.x+a.col2.y*this.m_localAnchor2.y))},GetGroundPoint1:function(){return new b2Vec2(this.m_ground.m_position.x+this.m_groundAnchor1.x,this.m_ground.m_position.y+this.m_groundAnchor1.y)},GetGroundPoint2:function(){return new b2Vec2(this.m_ground.m_position.x+this.m_groundAnchor2.x,this.m_ground.m_position.y+this.m_groundAnchor2.y)},GetReactionForce:function(a){return new b2Vec2()},GetReactionTorque:function(a){return 0},GetLength1:function(){var e;e=this.m_body1.m_R;var d=this.m_body1.m_position.x+(e.col1.x*this.m_localAnchor1.x+e.col2.x*this.m_localAnchor1.y);var c=this.m_body1.m_position.y+(e.col1.y*this.m_localAnchor1.x+e.col2.y*this.m_localAnchor1.y);var b=d-(this.m_ground.m_position.x+this.m_groundAnchor1.x);var a=c-(this.m_ground.m_position.y+this.m_groundAnchor1.y);return Math.sqrt(b*b+a*a) -},GetLength2:function(){var e;e=this.m_body2.m_R;var d=this.m_body2.m_position.x+(e.col1.x*this.m_localAnchor2.x+e.col2.x*this.m_localAnchor2.y);var c=this.m_body2.m_position.y+(e.col1.y*this.m_localAnchor2.x+e.col2.y*this.m_localAnchor2.y);var b=d-(this.m_ground.m_position.x+this.m_groundAnchor2.x);var a=c-(this.m_ground.m_position.y+this.m_groundAnchor2.y);return Math.sqrt(b*b+a*a)},GetRatio:function(){return this.m_ratio},PrepareVelocitySolver:function(){var h=this.m_body1;var g=this.m_body2;var l;l=h.m_R;var v=l.col1.x*this.m_localAnchor1.x+l.col2.x*this.m_localAnchor1.y;var u=l.col1.y*this.m_localAnchor1.x+l.col2.y*this.m_localAnchor1.y;l=g.m_R;var f=l.col1.x*this.m_localAnchor2.x+l.col2.x*this.m_localAnchor2.y;var e=l.col1.y*this.m_localAnchor2.x+l.col2.y*this.m_localAnchor2.y;var t=h.m_position.x+v;var r=h.m_position.y+u;var d=g.m_position.x+f;var c=g.m_position.y+e;var m=this.m_ground.m_position.x+this.m_groundAnchor1.x;var k=this.m_ground.m_position.y+this.m_groundAnchor1.y;var s=this.m_ground.m_position.x+this.m_groundAnchor2.x; -var q=this.m_ground.m_position.y+this.m_groundAnchor2.y;this.m_u1.Set(t-m,r-k);this.m_u2.Set(d-s,c-q);var p=this.m_u1.Length();var o=this.m_u2.Length();if(p>b2Settings.b2_linearSlop){this.m_u1.Multiply(1/p)}else{this.m_u1.SetZero()}if(o>b2Settings.b2_linearSlop){this.m_u2.Multiply(1/o)}else{this.m_u2.SetZero()}if(pb2Settings.b2_linearSlop){this.m_u1.Multiply(1/n)}else{this.m_u1.SetZero()}if(m>b2Settings.b2_linearSlop){this.m_u2.Multiply(1/m)}else{this.m_u2.SetZero()}l=this.m_constant-n-this.m_ratio*m;e=b2Math.b2Max(e,Math.abs(l));l=b2Math.b2Clamp(l,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);h=-this.m_pulleyMass*l;r=-h*this.m_u1.x;p=-h*this.m_u1.y;b=-this.m_ratio*h*this.m_u2.x;a=-this.m_ratio*h*this.m_u2.y;g.m_position.x+=g.m_invMass*r;g.m_position.y+=g.m_invMass*p;g.m_rotation+=g.m_invI*(u*p-t*r);f.m_position.x+=f.m_invMass*b;f.m_position.y+=f.m_invMass*a;f.m_rotation+=f.m_invI*(d*a-c*b);g.m_R.Set(g.m_rotation);f.m_R.Set(f.m_rotation);if(this.m_limitState1==b2Joint.e_atUpperLimit){j=g.m_R;u=j.col1.x*this.m_localAnchor1.x+j.col2.x*this.m_localAnchor1.y;t=j.col1.y*this.m_localAnchor1.x+j.col2.y*this.m_localAnchor1.y; -r=g.m_position.x+u;p=g.m_position.y+t;this.m_u1.Set(r-k,p-i);n=this.m_u1.Length();if(n>b2Settings.b2_linearSlop){this.m_u1.x*=1/n;this.m_u1.y*=1/n}else{this.m_u1.SetZero()}l=this.m_maxLength1-n;e=b2Math.b2Max(e,-l);l=b2Math.b2Clamp(l+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0);h=-this.m_limitMass1*l;s=this.m_limitPositionImpulse1;this.m_limitPositionImpulse1=b2Math.b2Max(0,this.m_limitPositionImpulse1+h);h=this.m_limitPositionImpulse1-s;r=-h*this.m_u1.x;p=-h*this.m_u1.y;g.m_position.x+=g.m_invMass*r;g.m_position.y+=g.m_invMass*p;g.m_rotation+=g.m_invI*(u*p-t*r);g.m_R.Set(g.m_rotation)}if(this.m_limitState2==b2Joint.e_atUpperLimit){j=f.m_R;d=j.col1.x*this.m_localAnchor2.x+j.col2.x*this.m_localAnchor2.y;c=j.col1.y*this.m_localAnchor2.x+j.col2.y*this.m_localAnchor2.y;b=f.m_position.x+d;a=f.m_position.y+c;this.m_u2.Set(b-q,a-o);m=this.m_u2.Length();if(m>b2Settings.b2_linearSlop){this.m_u2.x*=1/m;this.m_u2.y*=1/m}else{this.m_u2.SetZero()}l=this.m_maxLength2-m;e=b2Math.b2Max(e,-l); -l=b2Math.b2Clamp(l+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0);h=-this.m_limitMass2*l;s=this.m_limitPositionImpulse2;this.m_limitPositionImpulse2=b2Math.b2Max(0,this.m_limitPositionImpulse2+h);h=this.m_limitPositionImpulse2-s;b=-h*this.m_u2.x;a=-h*this.m_u2.y;f.m_position.x+=f.m_invMass*b;f.m_position.y+=f.m_invMass*a;f.m_rotation+=f.m_invI*(d*a-c*b);f.m_R.Set(f.m_rotation)}return e=this.m_upperAngle){if(this.m_limitState!=b2Joint.e_atUpperLimit){this.m_limitImpulse=0}this.m_limitState=b2Joint.e_atUpperLimit}else{this.m_limitState=b2Joint.e_inactiveLimit;this.m_limitImpulse=0}}}}else{this.m_limitImpulse=0}if(b2World.s_enableWarmStarting){h.m_linearVelocity.x-=l*this.m_ptpImpulse.x;h.m_linearVelocity.y-=l*this.m_ptpImpulse.y;h.m_angularVelocity-=c*((k*this.m_ptpImpulse.y-i*this.m_ptpImpulse.x)+this.m_motorImpulse+this.m_limitImpulse); -g.m_linearVelocity.x+=j*this.m_ptpImpulse.x;g.m_linearVelocity.y+=j*this.m_ptpImpulse.y;g.m_angularVelocity+=b*((e*this.m_ptpImpulse.y-d*this.m_ptpImpulse.x)+this.m_motorImpulse+this.m_limitImpulse)}else{this.m_ptpImpulse.SetZero();this.m_motorImpulse=0;this.m_limitImpulse=0}this.m_limitPositionImpulse=0},SolveVelocityConstraints:function(f){var g=this.m_body1;var e=this.m_body2;var i;i=g.m_R;var o=i.col1.x*this.m_localAnchor1.x+i.col2.x*this.m_localAnchor1.y;var n=i.col1.y*this.m_localAnchor1.x+i.col2.y*this.m_localAnchor1.y;i=e.m_R;var b=i.col1.x*this.m_localAnchor2.x+i.col2.x*this.m_localAnchor2.y;var a=i.col1.y*this.m_localAnchor2.x+i.col2.y*this.m_localAnchor2.y;var k;var q=e.m_linearVelocity.x+(-e.m_angularVelocity*a)-g.m_linearVelocity.x-(-g.m_angularVelocity*n);var p=e.m_linearVelocity.y+(e.m_angularVelocity*b)-g.m_linearVelocity.y-(g.m_angularVelocity*o);var m=-(this.m_ptpMass.col1.x*q+this.m_ptpMass.col2.x*p);var l=-(this.m_ptpMass.col1.y*q+this.m_ptpMass.col2.y*p);this.m_ptpImpulse.x+=m; -this.m_ptpImpulse.y+=l;g.m_linearVelocity.x-=g.m_invMass*m;g.m_linearVelocity.y-=g.m_invMass*l;g.m_angularVelocity-=g.m_invI*(o*l-n*m);e.m_linearVelocity.x+=e.m_invMass*m;e.m_linearVelocity.y+=e.m_invMass*l;e.m_angularVelocity+=e.m_invI*(b*l-a*m);if(this.m_enableMotor&&this.m_limitState!=b2Joint.e_equalLimits){var r=e.m_angularVelocity-g.m_angularVelocity-this.m_motorSpeed;var c=-this.m_motorMass*r;var d=this.m_motorImpulse;this.m_motorImpulse=b2Math.b2Clamp(this.m_motorImpulse+c,-f.dt*this.m_maxMotorTorque,f.dt*this.m_maxMotorTorque);c=this.m_motorImpulse-d;g.m_angularVelocity-=g.m_invI*c;e.m_angularVelocity+=e.m_invI*c}if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit){var h=e.m_angularVelocity-g.m_angularVelocity;var j=-this.m_motorMass*h;if(this.m_limitState==b2Joint.e_equalLimits){this.m_limitImpulse+=j}else{if(this.m_limitState==b2Joint.e_atLowerLimit){k=this.m_limitImpulse;this.m_limitImpulse=b2Math.b2Max(this.m_limitImpulse+j,0);j=this.m_limitImpulse-k}else{if(this.m_limitState==b2Joint.e_atUpperLimit){k=this.m_limitImpulse; -this.m_limitImpulse=b2Math.b2Min(this.m_limitImpulse+j,0);j=this.m_limitImpulse-k}}}g.m_angularVelocity-=g.m_invI*j;e.m_angularVelocity+=e.m_invI*j}},SolvePositionConstraints:function(){var s;var m;var l=this.m_body1;var k=this.m_body2;var o=0;var n;n=l.m_R;var y=n.col1.x*this.m_localAnchor1.x+n.col2.x*this.m_localAnchor1.y;var x=n.col1.y*this.m_localAnchor1.x+n.col2.y*this.m_localAnchor1.y;n=k.m_R;var f=n.col1.x*this.m_localAnchor2.x+n.col2.x*this.m_localAnchor2.y;var e=n.col1.y*this.m_localAnchor2.x+n.col2.y*this.m_localAnchor2.y;var u=l.m_position.x+y;var t=l.m_position.y+x;var d=k.m_position.x+f;var c=k.m_position.y+e;var j=d-u;var i=c-t;o=Math.sqrt(j*j+i*i);var q=l.m_invMass;var p=k.m_invMass;var h=l.m_invI;var g=k.m_invI;this.K1.col1.x=q+p;this.K1.col2.x=0;this.K1.col1.y=0;this.K1.col2.y=q+p;this.K2.col1.x=h*x*x;this.K2.col2.x=-h*y*x;this.K2.col1.y=-h*y*x;this.K2.col2.y=h*y*y;this.K3.col1.x=g*e*e;this.K3.col2.x=-g*f*e;this.K3.col1.y=-g*f*e;this.K3.col2.y=g*f*f;this.K.SetM(this.K1); -this.K.AddM(this.K2);this.K.AddM(this.K3);this.K.Solve(b2RevoluteJoint.tImpulse,-j,-i);var b=b2RevoluteJoint.tImpulse.x;var a=b2RevoluteJoint.tImpulse.y;l.m_position.x-=l.m_invMass*b;l.m_position.y-=l.m_invMass*a;l.m_rotation-=l.m_invI*(y*a-x*b);l.m_R.Set(l.m_rotation);k.m_position.x+=k.m_invMass*b;k.m_position.y+=k.m_invMass*a;k.m_rotation+=k.m_invI*(f*a-e*b);k.m_R.Set(k.m_rotation);var w=0;if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit){var v=k.m_rotation-l.m_rotation-this.m_intialAngle;var r=0;if(this.m_limitState==b2Joint.e_equalLimits){m=b2Math.b2Clamp(v,-b2Settings.b2_maxAngularCorrection,b2Settings.b2_maxAngularCorrection);r=-this.m_motorMass*m;w=b2Math.b2Abs(m)}else{if(this.m_limitState==b2Joint.e_atLowerLimit){m=v-this.m_lowerAngle;w=b2Math.b2Max(0,-m);m=b2Math.b2Clamp(m+b2Settings.b2_angularSlop,-b2Settings.b2_maxAngularCorrection,0);r=-this.m_motorMass*m;s=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Max(this.m_limitPositionImpulse+r,0); -r=this.m_limitPositionImpulse-s}else{if(this.m_limitState==b2Joint.e_atUpperLimit){m=v-this.m_upperAngle;w=b2Math.b2Max(0,m);m=b2Math.b2Clamp(m-b2Settings.b2_angularSlop,0,b2Settings.b2_maxAngularCorrection);r=-this.m_motorMass*m;s=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Min(this.m_limitPositionImpulse+r,0);r=this.m_limitPositionImpulse-s}}}l.m_rotation-=l.m_invI*r;l.m_R.Set(l.m_rotation);k.m_rotation+=k.m_invI*r;k.m_R.Set(k.m_rotation)}return o<=b2Settings.b2_linearSlop&&w<=b2Settings.b2_angularSlop},m_localAnchor1:new b2Vec2(),m_localAnchor2:new b2Vec2(),m_ptpImpulse:new b2Vec2(),m_motorImpulse:null,m_limitImpulse:null,m_limitPositionImpulse:null,m_ptpMass:new b2Mat22(),m_motorMass:null,m_intialAngle:null,m_lowerAngle:null,m_upperAngle:null,m_maxMotorTorque:null,m_motorSpeed:null,m_enableLimit:null,m_enableMotor:null,m_limitState:0});b2RevoluteJoint.tImpulse=new b2Vec2();var b2RevoluteJointDef=function(){this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.type=b2Joint.e_revoluteJoint;this.anchorPoint=new b2Vec2(0,0);this.lowerAngle=0;this.upperAngle=0;this.motorTorque=0;this.motorSpeed=0;this.enableLimit=false;this.enableMotor=false};Object.extend(b2RevoluteJointDef.prototype,b2JointDef.prototype);Object.extend(b2RevoluteJointDef.prototype,{anchorPoint:null,lowerAngle:null,upperAngle:null,motorTorque:null,motorSpeed:null,enableLimit:null,enableMotor:null,Initialize:function(b,a,c){this.body1=b;this.body2=a;this.anchorPoint=c}}); \ No newline at end of file diff --git a/tutorial-1/pixi.js-master/examples/example 24 - Box2D Integration/bricks.png b/tutorial-1/pixi.js-master/examples/example 24 - Box2D Integration/bricks.png deleted file mode 100755 index 4495016..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 24 - Box2D Integration/bricks.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 24 - Box2D Integration/bunny.png b/tutorial-1/pixi.js-master/examples/example 24 - Box2D Integration/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 24 - Box2D Integration/bunny.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 24 - Box2D Integration/grass.png b/tutorial-1/pixi.js-master/examples/example 24 - Box2D Integration/grass.png deleted file mode 100755 index a9dd3a9..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 24 - Box2D Integration/grass.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 24 - Box2D Integration/index.html b/tutorial-1/pixi.js-master/examples/example 24 - Box2D Integration/index.html deleted file mode 100755 index 1cdfabf..0000000 --- a/tutorial-1/pixi.js-master/examples/example 24 - Box2D Integration/index.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - pixi.js example 24 - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 25 - Video/bunny.png b/tutorial-1/pixi.js-master/examples/example 25 - Video/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 25 - Video/bunny.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 25 - Video/index.html b/tutorial-1/pixi.js-master/examples/example 25 - Video/index.html deleted file mode 100755 index ac6fd8f..0000000 --- a/tutorial-1/pixi.js-master/examples/example 25 - Video/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - deus - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 25 - Video/testVideo.mp4 b/tutorial-1/pixi.js-master/examples/example 25 - Video/testVideo.mp4 deleted file mode 100755 index aa45029..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 25 - Video/testVideo.mp4 and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.json b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.json deleted file mode 100755 index 3e419a2..0000000 --- a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.json +++ /dev/null @@ -1,228 +0,0 @@ -{"frames": { - -"Explosion_Sequence_A 1.png": -{ - "frame": {"x":244,"y":1454,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 10.png": -{ - "frame": {"x":244,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 11.png": -{ - "frame": {"x":2,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 12.png": -{ - "frame": {"x":728,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 13.png": -{ - "frame": {"x":486,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 14.png": -{ - "frame": {"x":244,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 15.png": -{ - "frame": {"x":2,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 16.png": -{ - "frame": {"x":728,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 17.png": -{ - "frame": {"x":486,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 18.png": -{ - "frame": {"x":244,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 19.png": -{ - "frame": {"x":2,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 2.png": -{ - "frame": {"x":728,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 20.png": -{ - "frame": {"x":728,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 21.png": -{ - "frame": {"x":486,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 22.png": -{ - "frame": {"x":244,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 23.png": -{ - "frame": {"x":2,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 24.png": -{ - "frame": {"x":728,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 25.png": -{ - "frame": {"x":486,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 26.png": -{ - "frame": {"x":244,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 27.png": -{ - "frame": {"x":2,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 3.png": -{ - "frame": {"x":486,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 4.png": -{ - "frame": {"x":244,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 5.png": -{ - "frame": {"x":2,"y":1696,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 6.png": -{ - "frame": {"x":2,"y":1454,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 7.png": -{ - "frame": {"x":2,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 8.png": -{ - "frame": {"x":728,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 9.png": -{ - "frame": {"x":486,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}}, -"meta": { - "app": "http://www.texturepacker.com", - "version": "1.0", - "image": "SpriteSheet.png", - "format": "RGBA8888", - "size": {"w":1024,"h":2048}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:17e4a2d92ff3e27832c3f4938cec7c85$" -} -} diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.png deleted file mode 100755 index 79e1a69..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/index.html b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/index.html deleted file mode 100755 index 7c7c79e..0000000 --- a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/index.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - pixi.js example 3 using a movieclip - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/SpriteSheet.tps b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/SpriteSheet.tps deleted file mode 100755 index ba7d215..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/SpriteSheet.tps and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 1.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 1.png deleted file mode 100755 index 0e3b33a..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 1.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 10.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 10.png deleted file mode 100755 index 42629ac..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 10.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 11.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 11.png deleted file mode 100755 index f286b30..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 11.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 12.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 12.png deleted file mode 100755 index c4b19db..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 12.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 13.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 13.png deleted file mode 100755 index b57ec0c..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 13.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 14.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 14.png deleted file mode 100755 index a4c8458..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 14.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 15.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 15.png deleted file mode 100755 index 4b7e8e6..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 15.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 16.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 16.png deleted file mode 100755 index edbfd79..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 16.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 17.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 17.png deleted file mode 100755 index 2378b55..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 17.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 18.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 18.png deleted file mode 100755 index 61a13d6..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 18.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 19.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 19.png deleted file mode 100755 index a507ce1..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 19.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 2.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 2.png deleted file mode 100755 index 6cfe0d7..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 2.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 20.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 20.png deleted file mode 100755 index f371ecc..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 20.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 21.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 21.png deleted file mode 100755 index 389aa20..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 21.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 22.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 22.png deleted file mode 100755 index 5d324e5..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 22.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 23.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 23.png deleted file mode 100755 index 9e03ef7..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 23.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 24.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 24.png deleted file mode 100755 index 5a7b29e..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 24.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 25.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 25.png deleted file mode 100755 index 32fed5a..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 25.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 26.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 26.png deleted file mode 100755 index aed27f4..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 26.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 27.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 27.png deleted file mode 100755 index 03efab1..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 27.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 3.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 3.png deleted file mode 100755 index 400ef98..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 3.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 4.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 4.png deleted file mode 100755 index 13368c7..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 4.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 5.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 5.png deleted file mode 100755 index 8bbcfcd..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 5.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 6.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 6.png deleted file mode 100755 index b13a53b..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 6.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 7.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 7.png deleted file mode 100755 index 7a97e9c..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 7.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 8.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 8.png deleted file mode 100755 index 2daf240..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 8.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 9.png b/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 9.png deleted file mode 100755 index 72cd176..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 9.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 4 - Balls/assets/bubble_32x32.png b/tutorial-1/pixi.js-master/examples/example 4 - Balls/assets/bubble_32x32.png deleted file mode 100755 index 33b877e..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 4 - Balls/assets/bubble_32x32.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 4 - Balls/assets/bubble_64x64.png b/tutorial-1/pixi.js-master/examples/example 4 - Balls/assets/bubble_64x64.png deleted file mode 100755 index 573822c..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 4 - Balls/assets/bubble_64x64.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 4 - Balls/assets/photonstorm.png b/tutorial-1/pixi.js-master/examples/example 4 - Balls/assets/photonstorm.png deleted file mode 100755 index c24685b..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 4 - Balls/assets/photonstorm.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 4 - Balls/assets/pixi.png b/tutorial-1/pixi.js-master/examples/example 4 - Balls/assets/pixi.png deleted file mode 100755 index 13276bb..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 4 - Balls/assets/pixi.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 4 - Balls/index.html b/tutorial-1/pixi.js-master/examples/example 4 - Balls/index.html deleted file mode 100755 index 8f3b930..0000000 --- a/tutorial-1/pixi.js-master/examples/example 4 - Balls/index.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - Pixi Balls by Photon Storm - - - - - - - - - - -
    SX: 0
    SY: 0
    - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 4 - Balls/storm.css b/tutorial-1/pixi.js-master/examples/example 4 - Balls/storm.css deleted file mode 100755 index 2807f21..0000000 --- a/tutorial-1/pixi.js-master/examples/example 4 - Balls/storm.css +++ /dev/null @@ -1,34 +0,0 @@ -body { - margin: 0; - padding: 0; - background-color: #000000; -} - -#rnd { - position: absolute; - top: 16px; - left: 16px; -} - -#photonstorm { - position: absolute; - bottom: 16px; - right: 16px; -} - -#pixi { - position: absolute; - bottom: 16px; - left: 16px; -} - -#sx { - position: absolute; - top: 16px; - right: 16px; - width: 200px; - height: 48px; - font-size: 12px; - font-family: Arial; - color: rgba(255,255,255,0.8); -} diff --git a/tutorial-1/pixi.js-master/examples/example 5 - Morph/assets/photonstorm.png b/tutorial-1/pixi.js-master/examples/example 5 - Morph/assets/photonstorm.png deleted file mode 100755 index c24685b..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 5 - Morph/assets/photonstorm.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 5 - Morph/assets/pixel.png b/tutorial-1/pixi.js-master/examples/example 5 - Morph/assets/pixel.png deleted file mode 100755 index 5fdbb86..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 5 - Morph/assets/pixel.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 5 - Morph/assets/pixi.png b/tutorial-1/pixi.js-master/examples/example 5 - Morph/assets/pixi.png deleted file mode 100755 index 13276bb..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 5 - Morph/assets/pixi.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 5 - Morph/index.html b/tutorial-1/pixi.js-master/examples/example 5 - Morph/index.html deleted file mode 100755 index 8cf6639..0000000 --- a/tutorial-1/pixi.js-master/examples/example 5 - Morph/index.html +++ /dev/null @@ -1,312 +0,0 @@ - - - - Pixi Morph by Photon Storm - - - - - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 5 - Morph/storm.css b/tutorial-1/pixi.js-master/examples/example 5 - Morph/storm.css deleted file mode 100755 index 625022e..0000000 --- a/tutorial-1/pixi.js-master/examples/example 5 - Morph/storm.css +++ /dev/null @@ -1,17 +0,0 @@ -body { - margin: 0; - padding: 0; - background-color: #000000; -} - -#photonstorm { - position: absolute; - bottom: 16px; - right: 16px; -} - -#pixi { - position: absolute; - bottom: 16px; - left: 16px; -} diff --git a/tutorial-1/pixi.js-master/examples/example 6 - Interactivity/button.png b/tutorial-1/pixi.js-master/examples/example 6 - Interactivity/button.png deleted file mode 100755 index b0cd012..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 6 - Interactivity/button.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 6 - Interactivity/buttonDown.png b/tutorial-1/pixi.js-master/examples/example 6 - Interactivity/buttonDown.png deleted file mode 100755 index 643b757..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 6 - Interactivity/buttonDown.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 6 - Interactivity/buttonOver.png b/tutorial-1/pixi.js-master/examples/example 6 - Interactivity/buttonOver.png deleted file mode 100755 index 8117a2d..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 6 - Interactivity/buttonOver.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 6 - Interactivity/button_test_BG.jpg b/tutorial-1/pixi.js-master/examples/example 6 - Interactivity/button_test_BG.jpg deleted file mode 100755 index 0449cbb..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 6 - Interactivity/button_test_BG.jpg and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 6 - Interactivity/index.html b/tutorial-1/pixi.js-master/examples/example 6 - Interactivity/index.html deleted file mode 100755 index 29bd4cf..0000000 --- a/tutorial-1/pixi.js-master/examples/example 6 - Interactivity/index.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - pixi.js example 6 Interactivity - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 6 - Interactivity/pixi.png b/tutorial-1/pixi.js-master/examples/example 6 - Interactivity/pixi.png deleted file mode 100755 index 13276bb..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 6 - Interactivity/pixi.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 7 - Transparent Background/bunny.png b/tutorial-1/pixi.js-master/examples/example 7 - Transparent Background/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 7 - Transparent Background/bunny.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 7 - Transparent Background/index.html b/tutorial-1/pixi.js-master/examples/example 7 - Transparent Background/index.html deleted file mode 100755 index 305c3bd..0000000 --- a/tutorial-1/pixi.js-master/examples/example 7 - Transparent Background/index.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - pixi.js example 7 transparency - - - - -
    Hi there, I'm some HTML text... blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
    - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 7 - Transparent Background/shapeTris.png b/tutorial-1/pixi.js-master/examples/example 7 - Transparent Background/shapeTris.png deleted file mode 100755 index 426ff68..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 7 - Transparent Background/shapeTris.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 8 - Dragging/bunny.png b/tutorial-1/pixi.js-master/examples/example 8 - Dragging/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 8 - Dragging/bunny.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/example 8 - Dragging/index.html b/tutorial-1/pixi.js-master/examples/example 8 - Dragging/index.html deleted file mode 100755 index 69352af..0000000 --- a/tutorial-1/pixi.js-master/examples/example 8 - Dragging/index.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - pixi.js example 8 Dragging - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 9 - Tiling Texture/index.html b/tutorial-1/pixi.js-master/examples/example 9 - Tiling Texture/index.html deleted file mode 100755 index 411ded9..0000000 --- a/tutorial-1/pixi.js-master/examples/example 9 - Tiling Texture/index.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - pixi.js example 9 Tiling Texture - - - - - - - - diff --git a/tutorial-1/pixi.js-master/examples/example 9 - Tiling Texture/p2.jpeg b/tutorial-1/pixi.js-master/examples/example 9 - Tiling Texture/p2.jpeg deleted file mode 100755 index 4943288..0000000 Binary files a/tutorial-1/pixi.js-master/examples/example 9 - Tiling Texture/p2.jpeg and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/test/bunny.png b/tutorial-1/pixi.js-master/examples/test/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-1/pixi.js-master/examples/test/bunny.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/examples/test/index.html b/tutorial-1/pixi.js-master/examples/test/index.html deleted file mode 100755 index f1009cb..0000000 --- a/tutorial-1/pixi.js-master/examples/test/index.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - pixi.js test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tutorial-1/pixi.js-master/logo.png b/tutorial-1/pixi.js-master/logo.png deleted file mode 100755 index 654d77f..0000000 Binary files a/tutorial-1/pixi.js-master/logo.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/logo_small.png b/tutorial-1/pixi.js-master/logo_small.png deleted file mode 100755 index f7c1f4f..0000000 Binary files a/tutorial-1/pixi.js-master/logo_small.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/package.json b/tutorial-1/pixi.js-master/package.json deleted file mode 100755 index 463e77c..0000000 --- a/tutorial-1/pixi.js-master/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "pixi.js", - "version": "2.2.7", - "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", - "author": "Mat Groves", - "contributors": [ - "Chad Engler " - ], - "logo": "http://www.goodboydigital.com/pixijs/logo_small.png", - "homepage": "http://goodboydigital.com/", - "bugs": "https://github.com/GoodBoyDigital/pixi.js/issues", - "license": "MIT", - "licenseUrl": "http://www.opensource.org/licenses/mit-license.php", - "repository": { - "type": "git", - "url": "https://github.com/GoodBoyDigital/pixi.js.git" - }, - "main": "bin/pixi.dev.js", - "scripts": { - "test": "grunt travis --verbose" - }, - "dependencies": {}, - "devDependencies": { - "grunt": "~0.4.1", - "grunt-contrib-jshint": "~0.8", - "grunt-contrib-uglify": "~0.2", - "grunt-contrib-connect": "~0.5", - "grunt-contrib-yuidoc": "~0.5", - "grunt-concat-sourcemap": "~0.4", - "grunt-contrib-concat": "~0.3", - "mocha": "~1.15", - "chai": "~1.8", - "karma": "~0.12", - "karma-chrome-launcher": "~0.1", - "karma-firefox-launcher": "~0.1", - "karma-mocha": "~0.1", - "karma-spec-reporter": "~0.0.6", - "grunt-contrib-watch": "~0.5.3" - } -} diff --git a/tutorial-1/pixi.js-master/src/pixi/InteractionData.js b/tutorial-1/pixi.js-master/src/pixi/InteractionData.js deleted file mode 100755 index b0d8a6a..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/InteractionData.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Holds all information related to an Interaction event - * - * @class InteractionData - * @constructor - */ -PIXI.InteractionData = function() -{ - /** - * This point stores the global coords of where the touch/mouse event happened - * - * @property global - * @type Point - */ - this.global = new PIXI.Point(); - - /** - * The target Sprite that was interacted with - * - * @property target - * @type Sprite - */ - this.target = null; - - /** - * When passed to an event handler, this will be the original DOM Event that was captured - * - * @property originalEvent - * @type Event - */ - this.originalEvent = null; -}; - -/** - * This will return the local coordinates of the specified displayObject for this InteractionData - * - * @method getLocalPosition - * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off - * @param [point] {Point} A Point object in which to store the value, optional (otherwise will create a new point) - * @return {Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject - */ -PIXI.InteractionData.prototype.getLocalPosition = function(displayObject, point) -{ - var worldTransform = displayObject.worldTransform; - var global = this.global; - - // do a cheeky transform to get the mouse coords; - var a00 = worldTransform.a, a01 = worldTransform.c, a02 = worldTransform.tx, - a10 = worldTransform.b, a11 = worldTransform.d, a12 = worldTransform.ty, - id = 1 / (a00 * a11 + a01 * -a10); - - point = point || new PIXI.Point(); - - point.x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id; - point.y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; - - // set the mouse coords... - return point; -}; - -// constructor -PIXI.InteractionData.prototype.constructor = PIXI.InteractionData; diff --git a/tutorial-1/pixi.js-master/src/pixi/InteractionManager.js b/tutorial-1/pixi.js-master/src/pixi/InteractionManager.js deleted file mode 100755 index 646d0a8..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/InteractionManager.js +++ /dev/null @@ -1,944 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - - /** - * The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive - * if its interactive parameter is set to true - * This manager also supports multitouch. - * - * @class InteractionManager - * @constructor - * @param stage {Stage} The stage to handle interactions - */ -PIXI.InteractionManager = function(stage) -{ - /** - * A reference to the stage - * - * @property stage - * @type Stage - */ - this.stage = stage; - - /** - * The mouse data - * - * @property mouse - * @type InteractionData - */ - this.mouse = new PIXI.InteractionData(); - - /** - * An object that stores current touches (InteractionData) by id reference - * - * @property touches - * @type Object - */ - this.touches = {}; - - /** - * @property tempPoint - * @type Point - * @private - */ - this.tempPoint = new PIXI.Point(); - - /** - * @property mouseoverEnabled - * @type Boolean - * @default - */ - this.mouseoverEnabled = true; - - /** - * Tiny little interactiveData pool ! - * - * @property pool - * @type Array - */ - this.pool = []; - - /** - * An array containing all the iterative items from the our interactive tree - * @property interactiveItems - * @type Array - * @private - */ - this.interactiveItems = []; - - /** - * Our canvas - * @property interactionDOMElement - * @type HTMLCanvasElement - * @private - */ - this.interactionDOMElement = null; - - //this will make it so that you don't have to call bind all the time - - /** - * @property onMouseMove - * @type Function - */ - this.onMouseMove = this.onMouseMove.bind( this ); - - /** - * @property onMouseDown - * @type Function - */ - this.onMouseDown = this.onMouseDown.bind(this); - - /** - * @property onMouseOut - * @type Function - */ - this.onMouseOut = this.onMouseOut.bind(this); - - /** - * @property onMouseUp - * @type Function - */ - this.onMouseUp = this.onMouseUp.bind(this); - - /** - * @property onTouchStart - * @type Function - */ - this.onTouchStart = this.onTouchStart.bind(this); - - /** - * @property onTouchEnd - * @type Function - */ - this.onTouchEnd = this.onTouchEnd.bind(this); - - /** - * @property onTouchCancel - * @type Function - */ - this.onTouchCancel = this.onTouchCancel.bind(this); - - /** - * @property onTouchMove - * @type Function - */ - this.onTouchMove = this.onTouchMove.bind(this); - - /** - * @property last - * @type Number - */ - this.last = 0; - - /** - * The css style of the cursor that is being used - * @property currentCursorStyle - * @type String - */ - this.currentCursorStyle = 'inherit'; - - /** - * Is set to true when the mouse is moved out of the canvas - * @property mouseOut - * @type Boolean - */ - this.mouseOut = false; - - /** - * @property resolution - * @type Number - */ - this.resolution = 1; - - // used for hit testing - this._tempPoint = new PIXI.Point(); -}; - -// constructor -PIXI.InteractionManager.prototype.constructor = PIXI.InteractionManager; - -/** - * Collects an interactive sprite recursively to have their interactions managed - * - * @method collectInteractiveSprite - * @param displayObject {DisplayObject} the displayObject to collect - * @param iParent {DisplayObject} the display object's parent - * @private - */ -PIXI.InteractionManager.prototype.collectInteractiveSprite = function(displayObject, iParent) -{ - var children = displayObject.children; - var length = children.length; - - // make an interaction tree... {item.__interactiveParent} - for (var i = length - 1; i >= 0; i--) - { - var child = children[i]; - - // push all interactive bits - if (child._interactive) - { - iParent.interactiveChildren = true; - //child.__iParent = iParent; - this.interactiveItems.push(child); - - if (child.children.length > 0) { - this.collectInteractiveSprite(child, child); - } - } - else - { - child.__iParent = null; - if (child.children.length > 0) - { - this.collectInteractiveSprite(child, iParent); - } - } - - } -}; - -/** - * Sets the target for event delegation - * - * @method setTarget - * @param target {WebGLRenderer|CanvasRenderer} the renderer to bind events to - * @private - */ -PIXI.InteractionManager.prototype.setTarget = function(target) -{ - this.target = target; - this.resolution = target.resolution; - - // Check if the dom element has been set. If it has don't do anything. - if (this.interactionDOMElement !== null) return; - - this.setTargetDomElement (target.view); -}; - -/** - * Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM - * elements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element - * to receive those events - * - * @method setTargetDomElement - * @param domElement {DOMElement} the DOM element which will receive mouse and touch events - * @private - */ -PIXI.InteractionManager.prototype.setTargetDomElement = function(domElement) -{ - this.removeEvents(); - - if (window.navigator.msPointerEnabled) - { - // time to remove some of that zoom in ja.. - domElement.style['-ms-content-zooming'] = 'none'; - domElement.style['-ms-touch-action'] = 'none'; - } - - this.interactionDOMElement = domElement; - - domElement.addEventListener('mousemove', this.onMouseMove, true); - domElement.addEventListener('mousedown', this.onMouseDown, true); - domElement.addEventListener('mouseout', this.onMouseOut, true); - - // aint no multi touch just yet! - domElement.addEventListener('touchstart', this.onTouchStart, true); - domElement.addEventListener('touchend', this.onTouchEnd, true); - domElement.addEventListener('touchleave', this.onTouchCancel, true); - domElement.addEventListener('touchcancel', this.onTouchCancel, true); - domElement.addEventListener('touchmove', this.onTouchMove, true); - - window.addEventListener('mouseup', this.onMouseUp, true); -}; - -/** - * @method removeEvents - * @private - */ -PIXI.InteractionManager.prototype.removeEvents = function() -{ - if (!this.interactionDOMElement) return; - - this.interactionDOMElement.style['-ms-content-zooming'] = ''; - this.interactionDOMElement.style['-ms-touch-action'] = ''; - - this.interactionDOMElement.removeEventListener('mousemove', this.onMouseMove, true); - this.interactionDOMElement.removeEventListener('mousedown', this.onMouseDown, true); - this.interactionDOMElement.removeEventListener('mouseout', this.onMouseOut, true); - - // aint no multi touch just yet! - this.interactionDOMElement.removeEventListener('touchstart', this.onTouchStart, true); - this.interactionDOMElement.removeEventListener('touchend', this.onTouchEnd, true); - this.interactionDOMElement.removeEventListener('touchleave', this.onTouchCancel, true); - this.interactionDOMElement.removeEventListener('touchcancel', this.onTouchCancel, true); - this.interactionDOMElement.removeEventListener('touchmove', this.onTouchMove, true); - - this.interactionDOMElement = null; - - window.removeEventListener('mouseup', this.onMouseUp, true); -}; - -/** - * updates the state of interactive objects - * - * @method update - * @private - */ -PIXI.InteractionManager.prototype.update = function() -{ - if (!this.target) return; - - // frequency of 30fps?? - var now = Date.now(); - var diff = now - this.last; - diff = (diff * PIXI.INTERACTION_FREQUENCY ) / 1000; - if (diff < 1) return; - this.last = now; - - var i = 0; - - // ok.. so mouse events?? - // yes for now :) - // OPTIMISE - how often to check?? - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - // loop through interactive objects! - var length = this.interactiveItems.length; - var cursor = 'inherit'; - var over = false; - - for (i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - // OPTIMISATION - only calculate every time if the mousemove function exists.. - // OK so.. does the object have any other interactive functions? - // hit-test the clip! - // if (item.mouseover || item.mouseout || item.buttonMode) - // { - // ok so there are some functions so lets hit test it.. - item.__hit = this.hitTest(item, this.mouse); - this.mouse.target = item; - // ok so deal with interactions.. - // looks like there was a hit! - if (item.__hit && !over) - { - if (item.buttonMode) cursor = item.defaultCursor; - - if (!item.interactiveChildren) - { - over = true; - } - - if (!item.__isOver) - { - if (item.mouseover) - { - item.mouseover (this.mouse); - } - item.__isOver = true; - } - } - else - { - if (item.__isOver) - { - // roll out! - if (item.mouseout) - { - item.mouseout (this.mouse); - } - item.__isOver = false; - } - } - } - - if (this.currentCursorStyle !== cursor) - { - this.currentCursorStyle = cursor; - this.interactionDOMElement.style.cursor = cursor; - } -}; - -/** - * @method rebuildInteractiveGraph - * @private - */ -PIXI.InteractionManager.prototype.rebuildInteractiveGraph = function() -{ - this.dirty = false; - - var len = this.interactiveItems.length; - - for (var i = 0; i < len; i++) { - this.interactiveItems[i].interactiveChildren = false; - } - - this.interactiveItems = []; - - if (this.stage.interactive) - { - this.interactiveItems.push(this.stage); - } - - // Go through and collect all the objects that are interactive.. - this.collectInteractiveSprite(this.stage, this.stage); -}; - -/** - * Is called when the mouse moves across the renderer element - * - * @method onMouseMove - * @param event {Event} The DOM event of the mouse moving - * @private - */ -PIXI.InteractionManager.prototype.onMouseMove = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - // TODO optimize by not check EVERY TIME! maybe half as often? // - var rect = this.interactionDOMElement.getBoundingClientRect(); - - this.mouse.global.x = (event.clientX - rect.left) * (this.target.width / rect.width) / this.resolution; - this.mouse.global.y = (event.clientY - rect.top) * ( this.target.height / rect.height) / this.resolution; - - var length = this.interactiveItems.length; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - // Call the function! - if (item.mousemove) - { - item.mousemove(this.mouse); - } - } -}; - -/** - * Is called when the mouse button is pressed down on the renderer element - * - * @method onMouseDown - * @param event {Event} The DOM event of a mouse button being pressed down - * @private - */ -PIXI.InteractionManager.prototype.onMouseDown = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - if (PIXI.AUTO_PREVENT_DEFAULT) - { - this.mouse.originalEvent.preventDefault(); - } - - // loop through interaction tree... - // hit test each item! -> - // get interactive items under point?? - //stage.__i - var length = this.interactiveItems.length; - - var e = this.mouse.originalEvent; - var isRightButton = e.button === 2 || e.which === 3; - var downFunction = isRightButton ? 'rightdown' : 'mousedown'; - var clickFunction = isRightButton ? 'rightclick' : 'click'; - var buttonIsDown = isRightButton ? '__rightIsDown' : '__mouseIsDown'; - var isDown = isRightButton ? '__isRightDown' : '__isDown'; - - // while - // hit test - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - if (item[downFunction] || item[clickFunction]) - { - item[buttonIsDown] = true; - item.__hit = this.hitTest(item, this.mouse); - - if (item.__hit) - { - //call the function! - if (item[downFunction]) - { - item[downFunction](this.mouse); - } - item[isDown] = true; - - // just the one! - if (!item.interactiveChildren) break; - } - } - } -}; - -/** - * Is called when the mouse is moved out of the renderer element - * - * @method onMouseOut - * @param event {Event} The DOM event of a mouse being moved out - * @private - */ -PIXI.InteractionManager.prototype.onMouseOut = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - var length = this.interactiveItems.length; - - this.interactionDOMElement.style.cursor = 'inherit'; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - if (item.__isOver) - { - this.mouse.target = item; - if (item.mouseout) - { - item.mouseout(this.mouse); - } - item.__isOver = false; - } - } - - this.mouseOut = true; - - // move the mouse to an impossible position - this.mouse.global.x = -10000; - this.mouse.global.y = -10000; -}; - -/** - * Is called when the mouse button is released on the renderer element - * - * @method onMouseUp - * @param event {Event} The DOM event of a mouse button being released - * @private - */ -PIXI.InteractionManager.prototype.onMouseUp = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - var length = this.interactiveItems.length; - var up = false; - - var e = this.mouse.originalEvent; - var isRightButton = e.button === 2 || e.which === 3; - - var upFunction = isRightButton ? 'rightup' : 'mouseup'; - var clickFunction = isRightButton ? 'rightclick' : 'click'; - var upOutsideFunction = isRightButton ? 'rightupoutside' : 'mouseupoutside'; - var isDown = isRightButton ? '__isRightDown' : '__isDown'; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - if (item[clickFunction] || item[upFunction] || item[upOutsideFunction]) - { - item.__hit = this.hitTest(item, this.mouse); - - if (item.__hit && !up) - { - //call the function! - if (item[upFunction]) - { - item[upFunction](this.mouse); - } - if (item[isDown]) - { - if (item[clickFunction]) - { - item[clickFunction](this.mouse); - } - } - - if (!item.interactiveChildren) - { - up = true; - } - } - else - { - if (item[isDown]) - { - if (item[upOutsideFunction]) item[upOutsideFunction](this.mouse); - } - } - - item[isDown] = false; - } - } -}; - -/** - * Tests if the current mouse coordinates hit a sprite - * - * @method hitTest - * @param item {DisplayObject} The displayObject to test for a hit - * @param interactionData {InteractionData} The interactionData object to update in the case there is a hit - * @private - */ -PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) -{ - var global = interactionData.global; - - if (!item.worldVisible) - { - return false; - } - - // map the global point to local space. - item.worldTransform.applyInverse(global, this._tempPoint); - - var x = this._tempPoint.x, - y = this._tempPoint.y, - i; - - interactionData.target = item; - - //a sprite or display object with a hit area defined - if (item.hitArea && item.hitArea.contains) - { - return item.hitArea.contains(x, y); - } - // a sprite with no hitarea defined - else if(item instanceof PIXI.Sprite) - { - var width = item.texture.frame.width; - var height = item.texture.frame.height; - var x1 = -width * item.anchor.x; - var y1; - - if (x > x1 && x < x1 + width) - { - y1 = -height * item.anchor.y; - - if (y > y1 && y < y1 + height) - { - // set the target property if a hit is true! - return true; - } - } - } - else if(item instanceof PIXI.Graphics) - { - var graphicsData = item.graphicsData; - for (i = 0; i < graphicsData.length; i++) - { - var data = graphicsData[i]; - if(!data.fill)continue; - - // only deal with fills.. - if(data.shape) - { - if(data.shape.contains(x, y)) - { - //interactionData.target = item; - return true; - } - } - } - } - - var length = item.children.length; - - for (i = 0; i < length; i++) - { - var tempItem = item.children[i]; - var hit = this.hitTest(tempItem, interactionData); - if (hit) - { - // hmm.. TODO SET CORRECT TARGET? - interactionData.target = item; - return true; - } - } - return false; -}; - -/** - * Is called when a touch is moved across the renderer element - * - * @method onTouchMove - * @param event {Event} The DOM event of a touch moving across the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchMove = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - var touchData; - var i = 0; - - for (i = 0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - touchData = this.touches[touchEvent.identifier]; - touchData.originalEvent = event; - - // update the touch position - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - for (var j = 0; j < this.interactiveItems.length; j++) - { - var item = this.interactiveItems[j]; - if (item.touchmove && item.__touchData && item.__touchData[touchEvent.identifier]) - { - item.touchmove(touchData); - } - } - } -}; - -/** - * Is called when a touch is started on the renderer element - * - * @method onTouchStart - * @param event {Event} The DOM event of a touch starting on the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchStart = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - - if (PIXI.AUTO_PREVENT_DEFAULT) - { - event.preventDefault(); - } - - var changedTouches = event.changedTouches; - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - - var touchData = this.pool.pop(); - if (!touchData) - { - touchData = new PIXI.InteractionData(); - } - - touchData.originalEvent = event; - - this.touches[touchEvent.identifier] = touchData; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.touchstart || item.tap) - { - item.__hit = this.hitTest(item, touchData); - - if (item.__hit) - { - //call the function! - if (item.touchstart)item.touchstart(touchData); - item.__isDown = true; - item.__touchData = item.__touchData || {}; - item.__touchData[touchEvent.identifier] = touchData; - - if (!item.interactiveChildren) break; - } - } - } - } -}; - -/** - * Is called when a touch is ended on the renderer element - * - * @method onTouchEnd - * @param event {Event} The DOM event of a touch ending on the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchEnd = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - var touchData = this.touches[touchEvent.identifier]; - var up = false; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.__touchData && item.__touchData[touchEvent.identifier]) - { - - item.__hit = this.hitTest(item, item.__touchData[touchEvent.identifier]); - - // so this one WAS down... - touchData.originalEvent = event; - // hitTest?? - - if (item.touchend || item.tap) - { - if (item.__hit && !up) - { - if (item.touchend) - { - item.touchend(touchData); - } - if (item.__isDown && item.tap) - { - item.tap(touchData); - } - if (!item.interactiveChildren) - { - up = true; - } - } - else - { - if (item.__isDown && item.touchendoutside) - { - item.touchendoutside(touchData); - } - } - - item.__isDown = false; - } - - item.__touchData[touchEvent.identifier] = null; - } - } - // remove the touch.. - this.pool.push(touchData); - this.touches[touchEvent.identifier] = null; - } -}; - -/** - * Is called when a touch is canceled - * - * @method onTouchCancel - * @param event {Event} The DOM event of a touch canceled - * @private - */ -PIXI.InteractionManager.prototype.onTouchCancel = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - var touchData = this.touches[touchEvent.identifier]; - var up = false; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.__touchData && item.__touchData[touchEvent.identifier]) - { - - item.__hit = this.hitTest(item, item.__touchData[touchEvent.identifier]); - - // so this one WAS down... - touchData.originalEvent = event; - // hitTest?? - - if (item.touchcancel && !up) - { - item.touchcancel(touchData); - if (!item.interactiveChildren) - { - up = true; - } - } - - item.__isDown = false; - item.__touchData[touchEvent.identifier] = null; - } - } - // remove the touch.. - this.pool.push(touchData); - this.touches[touchEvent.identifier] = null; - } -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/Intro.js b/tutorial-1/pixi.js-master/src/pixi/Intro.js deleted file mode 100755 index 07d01da..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/Intro.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -(function(){ - - var root = this; diff --git a/tutorial-1/pixi.js-master/src/pixi/Outro.js b/tutorial-1/pixi.js-master/src/pixi/Outro.js deleted file mode 100755 index bf38bbc..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/Outro.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @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 if (typeof define !== 'undefined' && define.amd) { - define(PIXI); - } else { - root.PIXI = PIXI; - } -}).call(this); \ No newline at end of file diff --git a/tutorial-1/pixi.js-master/src/pixi/Pixi.js b/tutorial-1/pixi.js-master/src/pixi/Pixi.js deleted file mode 100755 index 1b17b5c..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/Pixi.js +++ /dev/null @@ -1,213 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The [pixi.js](http://www.pixijs.com/) module/namespace. - * - * @module PIXI - */ - -/** - * Namespace-class for [pixi.js](http://www.pixijs.com/). - * - * Contains assorted static properties and enumerations. - * - * @class PIXI - * @static - */ -var PIXI = PIXI || {}; - -/** - * @property {Number} WEBGL_RENDERER - * @protected - * @static - */ -PIXI.WEBGL_RENDERER = 0; -/** - * @property {Number} CANVAS_RENDERER - * @protected - * @static - */ -PIXI.CANVAS_RENDERER = 1; - -/** - * Version of pixi that is loaded. - * @property {String} VERSION - * @static - */ -PIXI.VERSION = "v2.2.7"; - -/** - * Various blend modes supported by pixi. IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes. - * @property {Object} blendModes - * @property {Number} blendModes.NORMAL - * @property {Number} blendModes.ADD - * @property {Number} blendModes.MULTIPLY - * @property {Number} blendModes.SCREEN - * @property {Number} blendModes.OVERLAY - * @property {Number} blendModes.DARKEN - * @property {Number} blendModes.LIGHTEN - * @property {Number} blendModes.COLOR_DODGE - * @property {Number} blendModes.COLOR_BURN - * @property {Number} blendModes.HARD_LIGHT - * @property {Number} blendModes.SOFT_LIGHT - * @property {Number} blendModes.DIFFERENCE - * @property {Number} blendModes.EXCLUSION - * @property {Number} blendModes.HUE - * @property {Number} blendModes.SATURATION - * @property {Number} blendModes.COLOR - * @property {Number} blendModes.LUMINOSITY - * @static - */ -PIXI.blendModes = { - NORMAL:0, - ADD:1, - MULTIPLY:2, - SCREEN:3, - OVERLAY:4, - DARKEN:5, - LIGHTEN:6, - COLOR_DODGE:7, - COLOR_BURN:8, - HARD_LIGHT:9, - SOFT_LIGHT:10, - DIFFERENCE:11, - EXCLUSION:12, - HUE:13, - SATURATION:14, - COLOR:15, - LUMINOSITY:16 -}; - -/** - * The scale modes that are supported by pixi. - * - * The DEFAULT scale mode affects the default scaling mode of future operations. - * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. - * - * @property {Object} scaleModes - * @property {Number} scaleModes.DEFAULT=LINEAR - * @property {Number} scaleModes.LINEAR Smooth scaling - * @property {Number} scaleModes.NEAREST Pixelating scaling - * @static - */ -PIXI.scaleModes = { - DEFAULT:0, - LINEAR:0, - NEAREST:1 -}; - -// used to create uids for various pixi objects.. -PIXI._UID = 0; - -if(typeof(Float32Array) != 'undefined') -{ - PIXI.Float32Array = Float32Array; - PIXI.Uint16Array = Uint16Array; - - // Uint32Array and ArrayBuffer only used by WebGL renderer - // We can suppose that if WebGL is supported then typed arrays are supported too - // as they predate WebGL support for all browsers: - // see typed arrays support: http://caniuse.com/#search=TypedArrays - // see WebGL support: http://caniuse.com/#search=WebGL - PIXI.Uint32Array = Uint32Array; - PIXI.ArrayBuffer = ArrayBuffer; -} -else -{ - PIXI.Float32Array = Array; - PIXI.Uint16Array = Array; -} - -// interaction frequency -PIXI.INTERACTION_FREQUENCY = 30; -PIXI.AUTO_PREVENT_DEFAULT = true; - -/** - * @property {Number} PI_2 - * @static - */ -PIXI.PI_2 = Math.PI * 2; - -/** - * @property {Number} RAD_TO_DEG - * @static - */ -PIXI.RAD_TO_DEG = 180 / Math.PI; - -/** - * @property {Number} DEG_TO_RAD - * @static - */ -PIXI.DEG_TO_RAD = Math.PI / 180; - -/** - * @property {String} RETINA_PREFIX - * @protected - * @static - */ -PIXI.RETINA_PREFIX = "@2x"; -//PIXI.SCALE_PREFIX "@x%%"; - -/** - * If true the default pixi startup (console) banner message will be suppressed. - * - * @property {Boolean} dontSayHello - * @default false - * @static - */ -PIXI.dontSayHello = false; - -/** - * The default render options if none are supplied to - * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. - * - * @property {Object} defaultRenderOptions - * @property {Object} defaultRenderOptions.view=null - * @property {Boolean} defaultRenderOptions.transparent=false - * @property {Boolean} defaultRenderOptions.antialias=false - * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false - * @property {Number} defaultRenderOptions.resolution=1 - * @property {Boolean} defaultRenderOptions.clearBeforeRender=true - * @property {Boolean} defaultRenderOptions.autoResize=false - * @static - */ -PIXI.defaultRenderOptions = { - view:null, - transparent:false, - antialias:false, - preserveDrawingBuffer:false, - resolution:1, - clearBeforeRender:true, - autoResize:false -} - -PIXI.sayHello = function (type) -{ - if(PIXI.dontSayHello)return; - - if ( navigator.userAgent.toLowerCase().indexOf('chrome') > -1 ) - { - var args = [ - '%c %c %c Pixi.js ' + PIXI.VERSION + ' - ' + type + ' %c ' + ' %c ' + ' http://www.pixijs.com/ %c %c ♥%c♥%c♥ ', - 'background: #ff66a5', - 'background: #ff66a5', - 'color: #ff66a5; background: #030307;', - 'background: #ff66a5', - 'background: #ffc3dc', - 'background: #ff66a5', - 'color: #ff2424; background: #fff', - 'color: #ff2424; background: #fff', - 'color: #ff2424; background: #fff' - ]; - - console.log.apply(console, args); - } - else if (window['console']) - { - console.log('Pixi.js ' + PIXI.VERSION + ' - http://www.pixijs.com/'); - } - - PIXI.dontSayHello = true; -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/display/DisplayObject.js b/tutorial-1/pixi.js-master/src/pixi/display/DisplayObject.js deleted file mode 100755 index 58b375c..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/display/DisplayObject.js +++ /dev/null @@ -1,765 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The base class for all objects that are rendered on the screen. - * This is an abstract class and should not be used on its own rather it should be extended. - * - * @class DisplayObject - * @constructor - */ -PIXI.DisplayObject = function() -{ - /** - * The coordinate of the object relative to the local coordinates of the parent. - * - * @property position - * @type Point - */ - this.position = new PIXI.Point(); - - /** - * The scale factor of the object. - * - * @property scale - * @type Point - */ - this.scale = new PIXI.Point(1,1);//{x:1, y:1}; - - /** - * The pivot point of the displayObject that it rotates around - * - * @property pivot - * @type Point - */ - this.pivot = new PIXI.Point(0,0); - - /** - * The rotation of the object in radians. - * - * @property rotation - * @type Number - */ - this.rotation = 0; - - /** - * The opacity of the object. - * - * @property alpha - * @type Number - */ - this.alpha = 1; - - /** - * The visibility of the object. - * - * @property visible - * @type Boolean - */ - this.visible = true; - - /** - * This is the defined area that will pick up mouse / touch events. It is null by default. - * Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children) - * - * @property hitArea - * @type Rectangle|Circle|Ellipse|Polygon - */ - this.hitArea = null; - - /** - * This is used to indicate if the displayObject should display a mouse hand cursor on rollover - * - * @property buttonMode - * @type Boolean - */ - this.buttonMode = false; - - /** - * Can this object be rendered - * - * @property renderable - * @type Boolean - */ - this.renderable = false; - - /** - * [read-only] The display object container that contains this display object. - * - * @property parent - * @type DisplayObjectContainer - * @readOnly - */ - this.parent = null; - - /** - * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage. - * - * @property stage - * @type Stage - * @readOnly - */ - this.stage = null; - - /** - * [read-only] The multiplied alpha of the displayObject - * - * @property worldAlpha - * @type Number - * @readOnly - */ - this.worldAlpha = 1; - - /** - * [read-only] Whether or not the object is interactive, do not toggle directly! use the `interactive` property - * - * @property _interactive - * @type Boolean - * @readOnly - * @private - */ - this._interactive = false; - - /** - * This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true - * - * @property defaultCursor - * @type String - * - */ - this.defaultCursor = 'pointer'; - - /** - * [read-only] Current transform of the object based on world (parent) factors - * - * @property worldTransform - * @type Matrix - * @readOnly - * @private - */ - this.worldTransform = new PIXI.Matrix(); - - /** - * cached sin rotation and cos rotation - * - * @property _sr - * @type Number - * @private - */ - this._sr = 0; - - /** - * cached sin rotation and cos rotation - * - * @property _cr - * @type Number - * @private - */ - this._cr = 1; - - /** - * The area the filter is applied to like the hitArea this is used as more of an optimisation - * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle - * - * @property filterArea - * @type Rectangle - */ - this.filterArea = null;//new PIXI.Rectangle(0,0,1,1); - - /** - * The original, cached bounds of the object - * - * @property _bounds - * @type Rectangle - * @private - */ - this._bounds = new PIXI.Rectangle(0, 0, 1, 1); - - /** - * The most up-to-date bounds of the object - * - * @property _currentBounds - * @type Rectangle - * @private - */ - this._currentBounds = null; - - /** - * The original, cached mask of the object - * - * @property _currentBounds - * @type Rectangle - * @private - */ - this._mask = null; - - /** - * Cached internal flag. - * - * @property _cacheAsBitmap - * @type Boolean - * @private - */ - this._cacheAsBitmap = false; - - /** - * Cached internal flag. - * - * @property _cacheIsDirty - * @type Boolean - * @private - */ - this._cacheIsDirty = false; - - - /* - * MOUSE Callbacks - */ - - /** - * A callback that is used when the users mouse rolls over the displayObject - * @method mouseover - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the users mouse leaves the displayObject - * @method mouseout - * @param interactionData {InteractionData} - */ - - //Left button - /** - * A callback that is used when the users clicks on the displayObject with their mouse's left button - * @method click - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user clicks the mouse's left button down over the sprite - * @method mousedown - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's left button that was over the displayObject - * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject - * @method mouseup - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject - * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject - * @method mouseupoutside - * @param interactionData {InteractionData} - */ - - //Right button - /** - * A callback that is used when the users clicks on the displayObject with their mouse's right button - * @method rightclick - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user clicks the mouse's right button down over the sprite - * @method rightdown - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's right button that was over the displayObject - * for this callback to be fired the mouse's right button must have been pressed down over the displayObject - * @method rightup - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject - * for this callback to be fired, the mouse's right button must have been pressed down over the displayObject - * @method rightupoutside - * @param interactionData {InteractionData} - */ - - /* - * TOUCH Callbacks - */ - - /** - * A callback that is used when the users taps on the sprite with their finger - * basically a touch version of click - * @method tap - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user touches over the displayObject - * @method touchstart - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases a touch over the displayObject - * @method touchend - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the touch that was over the displayObject - * for this callback to be fired, The touch must have started over the sprite - * @method touchendoutside - * @param interactionData {InteractionData} - */ -}; - -// constructor -PIXI.DisplayObject.prototype.constructor = PIXI.DisplayObject; - -/** - * Indicates if the sprite will have touch and mouse interactivity. It is false by default - * - * @property interactive - * @type Boolean - * @default false - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'interactive', { - get: function() { - return this._interactive; - }, - set: function(value) { - this._interactive = value; - - // TODO more to be done here.. - // need to sort out a re-crawl! - if(this.stage)this.stage.dirty = true; - } -}); - -/** - * [read-only] Indicates if the sprite is globally visible. - * - * @property worldVisible - * @type Boolean - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'worldVisible', { - get: function() { - var item = this; - - do - { - if(!item.visible)return false; - item = item.parent; - } - while(item); - - return true; - } -}); - -/** - * Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. - * In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. - * To remove a mask, set this property to null. - * - * @property mask - * @type Graphics - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'mask', { - get: function() { - return this._mask; - }, - set: function(value) { - - if(this._mask)this._mask.isMask = false; - this._mask = value; - if(this._mask)this._mask.isMask = true; - } -}); - -/** - * Sets the filters for the displayObject. - * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. - * To remove filters simply set this property to 'null' - * @property filters - * @type Array(Filter) - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { - - get: function() { - return this._filters; - }, - - set: function(value) { - - if(value) - { - // now put all the passes in one place.. - var passes = []; - for (var i = 0; i < value.length; i++) - { - var filterPasses = value[i].passes; - for (var j = 0; j < filterPasses.length; j++) - { - passes.push(filterPasses[j]); - } - } - - // TODO change this as it is legacy - this._filterBlock = {target:this, filterPasses:passes}; - } - - this._filters = value; - } -}); - -/** - * Set if this display object is cached as a bitmap. - * This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. - * To remove simply set this property to 'null' - * @property cacheAsBitmap - * @type Boolean - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'cacheAsBitmap', { - - get: function() { - return this._cacheAsBitmap; - }, - - set: function(value) { - - if(this._cacheAsBitmap === value)return; - - if(value) - { - this._generateCachedSprite(); - } - else - { - this._destroyCachedSprite(); - } - - this._cacheAsBitmap = value; - } -}); - -/* - * Updates the object transform for rendering - * - * @method updateTransform - * @private - */ -PIXI.DisplayObject.prototype.updateTransform = function() -{ - // create some matrix refs for easy access - var pt = this.parent.worldTransform; - var wt = this.worldTransform; - - // temporary matrix variables - var a, b, c, d, tx, ty; - - // so if rotation is between 0 then we can simplify the multiplication process.. - if(this.rotation % PIXI.PI_2) - { - // check to see if the rotation is the same as the previous render. This means we only need to use sin and cos when rotation actually changes - if(this.rotation !== this.rotationCache) - { - this.rotationCache = this.rotation; - this._sr = Math.sin(this.rotation); - this._cr = Math.cos(this.rotation); - } - - // get the matrix values of the displayobject based on its transform properties.. - a = this._cr * this.scale.x; - b = this._sr * this.scale.x; - c = -this._sr * this.scale.y; - d = this._cr * this.scale.y; - tx = this.position.x; - ty = this.position.y; - - // check for pivot.. not often used so geared towards that fact! - if(this.pivot.x || this.pivot.y) - { - tx -= this.pivot.x * a + this.pivot.y * c; - ty -= this.pivot.x * b + this.pivot.y * d; - } - - // concat the parent matrix with the objects transform. - wt.a = a * pt.a + b * pt.c; - wt.b = a * pt.b + b * pt.d; - wt.c = c * pt.a + d * pt.c; - wt.d = c * pt.b + d * pt.d; - wt.tx = tx * pt.a + ty * pt.c + pt.tx; - wt.ty = tx * pt.b + ty * pt.d + pt.ty; - - - } - else - { - // lets do the fast version as we know there is no rotation.. - a = this.scale.x; - d = this.scale.y; - - tx = this.position.x - this.pivot.x * a; - ty = this.position.y - this.pivot.y * d; - - wt.a = a * pt.a; - wt.b = a * pt.b; - wt.c = d * pt.c; - wt.d = d * pt.d; - wt.tx = tx * pt.a + ty * pt.c + pt.tx; - wt.ty = tx * pt.b + ty * pt.d + pt.ty; - } - - // multiply the alphas.. - this.worldAlpha = this.alpha * this.parent.worldAlpha; -}; - -// performance increase to avoid using call.. (10x faster) -PIXI.DisplayObject.prototype.displayObjectUpdateTransform = PIXI.DisplayObject.prototype.updateTransform; - -/** - * Retrieves the bounds of the displayObject as a rectangle object - * - * @method getBounds - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area - */ -PIXI.DisplayObject.prototype.getBounds = function(matrix) -{ - matrix = matrix;//just to get passed js hinting (and preserve inheritance) - return PIXI.EmptyRectangle; -}; - -/** - * Retrieves the local bounds of the displayObject as a rectangle object - * - * @method getLocalBounds - * @return {Rectangle} the rectangular bounding area - */ -PIXI.DisplayObject.prototype.getLocalBounds = function() -{ - return this.getBounds(PIXI.identityMatrix);///PIXI.EmptyRectangle(); -}; - -/** - * Sets the object's stage reference, the stage this object is connected to - * - * @method setStageReference - * @param stage {Stage} the stage that the object will have as its current stage reference - */ -PIXI.DisplayObject.prototype.setStageReference = function(stage) -{ - this.stage = stage; - if(this._interactive)this.stage.dirty = true; -}; - -/** - * Useful function that returns a texture of the displayObject object that can then be used to create sprites - * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. - * - * @method generateTexture - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @return {Texture} a texture of the graphics object - */ -PIXI.DisplayObject.prototype.generateTexture = function(resolution, scaleMode, renderer) -{ - var bounds = this.getLocalBounds(); - - var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0, renderer, scaleMode, resolution); - - PIXI.DisplayObject._tempMatrix.tx = -bounds.x; - PIXI.DisplayObject._tempMatrix.ty = -bounds.y; - - renderTexture.render(this, PIXI.DisplayObject._tempMatrix); - - return renderTexture; -}; - -/** - * Generates and updates the cached sprite for this object. - * - * @method updateCache - */ -PIXI.DisplayObject.prototype.updateCache = function() -{ - this._generateCachedSprite(); -}; - -/** - * Calculates the global position of the display object - * - * @method toGlobal - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object - */ -PIXI.DisplayObject.prototype.toGlobal = function(position) -{ - // don't need to u[date the lot - this.displayObjectUpdateTransform(); - return this.worldTransform.apply(position); -}; - -/** - * Calculates the local position of the display object relative to another point - * - * @method toLocal - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object - */ -PIXI.DisplayObject.prototype.toLocal = function(position, from) -{ - // - if (from) - { - position = from.toGlobal(position); - } - - // don't need to u[date the lot - this.displayObjectUpdateTransform(); - return this.worldTransform.applyInverse(position); -}; - -/** - * Internal method. - * - * @method _renderCachedSprite - * @param renderSession {Object} The render session - * @private - */ -PIXI.DisplayObject.prototype._renderCachedSprite = function(renderSession) -{ - this._cachedSprite.worldAlpha = this.worldAlpha; - - if(renderSession.gl) - { - PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession); - } - else - { - PIXI.Sprite.prototype._renderCanvas.call(this._cachedSprite, renderSession); - } -}; - -/** - * Internal method. - * - * @method _generateCachedSprite - * @private - */ -PIXI.DisplayObject.prototype._generateCachedSprite = function() -{ - this._cacheAsBitmap = false; - var bounds = this.getLocalBounds(); - - if(!this._cachedSprite) - { - var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0);//, renderSession.renderer); - - this._cachedSprite = new PIXI.Sprite(renderTexture); - this._cachedSprite.worldTransform = this.worldTransform; - } - else - { - this._cachedSprite.texture.resize(bounds.width | 0, bounds.height | 0); - } - - //REMOVE filter! - var tempFilters = this._filters; - this._filters = null; - - this._cachedSprite.filters = tempFilters; - - PIXI.DisplayObject._tempMatrix.tx = -bounds.x; - PIXI.DisplayObject._tempMatrix.ty = -bounds.y; - - this._cachedSprite.texture.render(this, PIXI.DisplayObject._tempMatrix, true); - - this._cachedSprite.anchor.x = -( bounds.x / bounds.width ); - this._cachedSprite.anchor.y = -( bounds.y / bounds.height ); - - this._filters = tempFilters; - - this._cacheAsBitmap = true; -}; - -/** -* Destroys the cached sprite. -* -* @method _destroyCachedSprite -* @private -*/ -PIXI.DisplayObject.prototype._destroyCachedSprite = function() -{ - if(!this._cachedSprite)return; - - this._cachedSprite.texture.destroy(true); - - // TODO could be object pooled! - this._cachedSprite = null; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.DisplayObject.prototype._renderWebGL = function(renderSession) -{ - // OVERWRITE; - // this line is just here to pass jshinting :) - renderSession = renderSession; -}; - -/** -* Renders the object using the Canvas renderer -* -* @method _renderCanvas -* @param renderSession {RenderSession} -* @private -*/ -PIXI.DisplayObject.prototype._renderCanvas = function(renderSession) -{ - // OVERWRITE; - // this line is just here to pass jshinting :) - renderSession = renderSession; -}; - - -PIXI.DisplayObject._tempMatrix = new PIXI.Matrix(); - -/** - * The position of the displayObject on the x axis relative to the local coordinates of the parent. - * - * @property x - * @type Number - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'x', { - get: function() { - return this.position.x; - }, - set: function(value) { - this.position.x = value; - } -}); - -/** - * The position of the displayObject on the y axis relative to the local coordinates of the parent. - * - * @property y - * @type Number - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'y', { - get: function() { - return this.position.y; - }, - set: function(value) { - this.position.y = value; - } -}); diff --git a/tutorial-1/pixi.js-master/src/pixi/display/DisplayObjectContainer.js b/tutorial-1/pixi.js-master/src/pixi/display/DisplayObjectContainer.js deleted file mode 100755 index e3ccc20..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/display/DisplayObjectContainer.js +++ /dev/null @@ -1,515 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A DisplayObjectContainer represents a collection of display objects. - * It is the base class of all display objects that act as a container for other objects. - * - * @class DisplayObjectContainer - * @extends DisplayObject - * @constructor - */ -PIXI.DisplayObjectContainer = function() -{ - PIXI.DisplayObject.call( this ); - - /** - * [read-only] The array of children of this container. - * - * @property children - * @type Array(DisplayObject) - * @readOnly - */ - this.children = []; - - // fast access to update transform.. - -}; - -// constructor -PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); -PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer; - - -/** - * The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', { - get: function() { - return this.scale.x * this.getLocalBounds().width; - }, - set: function(value) { - - var width = this.getLocalBounds().width; - - if(width !== 0) - { - this.scale.x = value / width; - } - else - { - this.scale.x = 1; - } - - - this._width = value; - } -}); - -/** - * The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', { - get: function() { - return this.scale.y * this.getLocalBounds().height; - }, - set: function(value) { - - var height = this.getLocalBounds().height; - - if(height !== 0) - { - this.scale.y = value / height ; - } - else - { - this.scale.y = 1; - } - - this._height = value; - } -}); - -/** - * Adds a child to the container. - * - * @method addChild - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. - */ -PIXI.DisplayObjectContainer.prototype.addChild = function(child) -{ - return this.addChildAt(child, this.children.length); -}; - -/** - * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown - * - * @method addChildAt - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. - */ -PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) -{ - if(index >= 0 && index <= this.children.length) - { - if(child.parent) - { - child.parent.removeChild(child); - } - - child.parent = this; - - this.children.splice(index, 0, child); - - if(this.stage)child.setStageReference(this.stage); - - return child; - } - else - { - throw new Error(child + 'addChildAt: The index '+ index +' supplied is out of bounds ' + this.children.length); - } -}; - -/** - * Swaps the position of 2 Display Objects within this container. - * - * @method swapChildren - * @param child {DisplayObject} - * @param child2 {DisplayObject} - */ -PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2) -{ - if(child === child2) { - return; - } - - var index1 = this.getChildIndex(child); - var index2 = this.getChildIndex(child2); - - if(index1 < 0 || index2 < 0) { - throw new Error('swapChildren: Both the supplied DisplayObjects must be a child of the caller.'); - } - - this.children[index1] = child2; - this.children[index2] = child; - -}; - -/** - * Returns the index position of a child DisplayObject instance - * - * @method getChildIndex - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify - */ -PIXI.DisplayObjectContainer.prototype.getChildIndex = function(child) -{ - var index = this.children.indexOf(child); - if (index === -1) - { - throw new Error('The supplied DisplayObject must be a child of the caller'); - } - return index; -}; - -/** - * Changes the position of an existing child in the display object container - * - * @method setChildIndex - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object - */ -PIXI.DisplayObjectContainer.prototype.setChildIndex = function(child, index) -{ - if (index < 0 || index >= this.children.length) - { - throw new Error('The supplied index is out of bounds'); - } - var currentIndex = this.getChildIndex(child); - this.children.splice(currentIndex, 1); //remove from old position - this.children.splice(index, 0, child); //add at new position -}; - -/** - * Returns the child at the specified index - * - * @method getChildAt - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child at the given index, if any. - */ -PIXI.DisplayObjectContainer.prototype.getChildAt = function(index) -{ - if (index < 0 || index >= this.children.length) - { - throw new Error('getChildAt: Supplied index '+ index +' does not exist in the child list, or the supplied DisplayObject must be a child of the caller'); - } - return this.children[index]; - -}; - -/** - * Removes a child from the container. - * - * @method removeChild - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. - */ -PIXI.DisplayObjectContainer.prototype.removeChild = function(child) -{ - var index = this.children.indexOf( child ); - if(index === -1)return; - - return this.removeChildAt( index ); -}; - -/** - * Removes a child from the specified index position. - * - * @method removeChildAt - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. - */ -PIXI.DisplayObjectContainer.prototype.removeChildAt = function(index) -{ - var child = this.getChildAt( index ); - if(this.stage) - child.removeStageReference(); - - child.parent = undefined; - this.children.splice( index, 1 ); - return child; -}; - -/** -* Removes all children from this container that are within the begin and end indexes. -* -* @method removeChildren -* @param beginIndex {Number} The beginning position. Default value is 0. -* @param endIndex {Number} The ending position. Default value is size of the container. -*/ -PIXI.DisplayObjectContainer.prototype.removeChildren = function(beginIndex, endIndex) -{ - var begin = beginIndex || 0; - var end = typeof endIndex === 'number' ? endIndex : this.children.length; - var range = end - begin; - - if (range > 0 && range <= end) - { - var removed = this.children.splice(begin, range); - for (var i = 0; i < removed.length; i++) { - var child = removed[i]; - if(this.stage) - child.removeStageReference(); - child.parent = undefined; - } - return removed; - } - else if (range === 0 && this.children.length === 0) - { - return []; - } - else - { - throw new Error( 'removeChildren: Range Error, numeric values are outside the acceptable range' ); - } -}; - -/* - * Updates the transform on all children of this container for rendering - * - * @method updateTransform - * @private - */ -PIXI.DisplayObjectContainer.prototype.updateTransform = function() -{ - if(!this.visible)return; - - this.displayObjectUpdateTransform(); - - //PIXI.DisplayObject.prototype.updateTransform.call( this ); - - if(this._cacheAsBitmap)return; - - for(var i=0,j=this.children.length; i childMaxX ? maxX : childMaxX; - maxY = maxY > childMaxY ? maxY : childMaxY; - } - - if(!childVisible) - return PIXI.EmptyRectangle; - - var bounds = this._bounds; - - bounds.x = minX; - bounds.y = minY; - bounds.width = maxX - minX; - bounds.height = maxY - minY; - - // TODO: store a reference so that if this function gets called again in the render cycle we do not have to recalculate - //this._currentBounds = bounds; - - return bounds; -}; - -/** - * Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration. - * - * @method getLocalBounds - * @return {Rectangle} The rectangular bounding area - */ -PIXI.DisplayObjectContainer.prototype.getLocalBounds = function() -{ - var matrixCache = this.worldTransform; - - this.worldTransform = PIXI.identityMatrix; - - for(var i=0,j=this.children.length; i= this.textures.length) - { - this.gotoAndStop(this.textures.length - 1); - if(this.onComplete) - { - this.onComplete(); - } - } -}; - -/** - * A short hand way of creating a movieclip from an array of frame ids - * - * @static - * @method fromFrames - * @param frames {Array} the array of frames ids the movieclip will use as its texture frames - * @return {MovieClip} - */ -PIXI.MovieClip.fromFrames = function(frames) -{ - var textures = []; - - for (var i = 0; i < frames.length; i++) - { - textures.push(new PIXI.Texture.fromFrame(frames[i])); - } - - return new PIXI.MovieClip(textures); -}; - -/** - * A short hand way of creating a movieclip from an array of image ids - * - * @static - * @method fromImages - * @param frames {Array} the array of image ids the movieclip will use as its texture frames - * @return {MovieClip} - */ -PIXI.MovieClip.fromImages = function(images) -{ - var textures = []; - - for (var i = 0; i < images.length; i++) - { - textures.push(new PIXI.Texture.fromImage(images[i])); - } - - return new PIXI.MovieClip(textures); -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/display/Sprite.js b/tutorial-1/pixi.js-master/src/pixi/display/Sprite.js deleted file mode 100755 index aab559a..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/display/Sprite.js +++ /dev/null @@ -1,471 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Sprite object is the base for all textured objects that are rendered to the screen - * - * @class Sprite - * @extends DisplayObjectContainer - * @constructor - * @param texture {Texture} The texture for this sprite - * - * A sprite can be created directly from an image like this : - * var sprite = new PIXI.Sprite.fromImage('assets/image.png'); - * yourStage.addChild(sprite); - * then obviously don't forget to add it to the stage you have already created - */ -PIXI.Sprite = function(texture) -{ - PIXI.DisplayObjectContainer.call( this ); - - /** - * The anchor sets the origin point of the texture. - * The default is 0,0 this means the texture's origin is the top left - * Setting than anchor to 0.5,0.5 means the textures origin is centered - * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner - * - * @property anchor - * @type Point - */ - this.anchor = new PIXI.Point(); - - /** - * The texture that the sprite is using - * - * @property texture - * @type Texture - */ - this.texture = texture || PIXI.Texture.emptyTexture; - - /** - * The width of the sprite (this is initially set by the texture) - * - * @property _width - * @type Number - * @private - */ - this._width = 0; - - /** - * The height of the sprite (this is initially set by the texture) - * - * @property _height - * @type Number - * @private - */ - this._height = 0; - - /** - * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. - * - * @property tint - * @type Number - * @default 0xFFFFFF - */ - this.tint = 0xFFFFFF; - - /** - * The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode. - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - /** - * The shader that will be used to render the texture to the stage. Set to null to remove a current shader. - * - * @property shader - * @type AbstractFilter - * @default null - */ - this.shader = null; - - if(this.texture.baseTexture.hasLoaded) - { - this.onTextureUpdate(); - } - else - { - this.texture.on( 'update', this.onTextureUpdate.bind(this) ); - } - - this.renderable = true; - -}; - -// constructor -PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); -PIXI.Sprite.prototype.constructor = PIXI.Sprite; - -/** - * The width of the sprite, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.Sprite.prototype, 'width', { - get: function() { - return this.scale.x * this.texture.frame.width; - }, - set: function(value) { - this.scale.x = value / this.texture.frame.width; - this._width = value; - } -}); - -/** - * The height of the sprite, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.Sprite.prototype, 'height', { - get: function() { - return this.scale.y * this.texture.frame.height; - }, - set: function(value) { - this.scale.y = value / this.texture.frame.height; - this._height = value; - } -}); - -/** - * Sets the texture of the sprite - * - * @method setTexture - * @param texture {Texture} The PIXI texture that is displayed by the sprite - */ -PIXI.Sprite.prototype.setTexture = function(texture) -{ - this.texture = texture; - this.cachedTint = 0xFFFFFF; -}; - -/** - * When the texture is updated, this event will fire to update the scale and frame - * - * @method onTextureUpdate - * @param event - * @private - */ -PIXI.Sprite.prototype.onTextureUpdate = function() -{ - // so if _width is 0 then width was not set.. - if(this._width)this.scale.x = this._width / this.texture.frame.width; - if(this._height)this.scale.y = this._height / this.texture.frame.height; - - //this.updateFrame = true; -}; - -/** -* Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. -* -* @method getBounds -* @param matrix {Matrix} the transformation matrix of the sprite -* @return {Rectangle} the framing rectangle -*/ -PIXI.Sprite.prototype.getBounds = function(matrix) -{ - var width = this.texture.frame.width; - var height = this.texture.frame.height; - - var w0 = width * (1-this.anchor.x); - var w1 = width * -this.anchor.x; - - var h0 = height * (1-this.anchor.y); - var h1 = height * -this.anchor.y; - - var worldTransform = matrix || this.worldTransform ; - - var a = worldTransform.a; - var b = worldTransform.b; - var c = worldTransform.c; - var d = worldTransform.d; - var tx = worldTransform.tx; - var ty = worldTransform.ty; - - var maxX = -Infinity; - var maxY = -Infinity; - - var minX = Infinity; - var minY = Infinity; - - if(b === 0 && c === 0) - { - // scale may be negative! - if(a < 0)a *= -1; - if(d < 0)d *= -1; - - // this means there is no rotation going on right? RIGHT? - // if thats the case then we can avoid checking the bound values! yay - minX = a * w1 + tx; - maxX = a * w0 + tx; - minY = d * h1 + ty; - maxY = d * h0 + ty; - } - else - { - var x1 = a * w1 + c * h1 + tx; - var y1 = d * h1 + b * w1 + ty; - - var x2 = a * w0 + c * h1 + tx; - var y2 = d * h1 + b * w0 + ty; - - var x3 = a * w0 + c * h0 + tx; - var y3 = d * h0 + b * w0 + ty; - - var x4 = a * w1 + c * h0 + tx; - var y4 = d * h0 + b * w1 + ty; - - minX = x1 < minX ? x1 : minX; - minX = x2 < minX ? x2 : minX; - minX = x3 < minX ? x3 : minX; - minX = x4 < minX ? x4 : minX; - - minY = y1 < minY ? y1 : minY; - minY = y2 < minY ? y2 : minY; - minY = y3 < minY ? y3 : minY; - minY = y4 < minY ? y4 : minY; - - maxX = x1 > maxX ? x1 : maxX; - maxX = x2 > maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y1 > maxY ? y1 : maxY; - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - } - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Sprite.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(!this.visible || this.alpha <= 0)return; - - var i,j; - - // do a quick check to see if this element has a mask or a filter. - if(this._mask || this._filters) - { - var spriteBatch = renderSession.spriteBatch; - - // push filter first as we need to ensure the stencil buffer is correct for any masking - if(this._filters) - { - spriteBatch.flush(); - renderSession.filterManager.pushFilter(this._filterBlock); - } - - if(this._mask) - { - spriteBatch.stop(); - renderSession.maskManager.pushMask(this.mask, renderSession); - spriteBatch.start(); - } - - // add this sprite to the batch - spriteBatch.render(this); - - // now loop through the children and make sure they get rendered - for(i=0,j=this.children.length; i 1) ratio = 1; - - perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y); - num = this.texture.height / 2; //(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio; - perp.x /= perpLength; - perp.y /= perpLength; - - perp.x *= num; - perp.y *= num; - - vertices[index] = point.x + perp.x; - vertices[index+1] = point.y + perp.y; - vertices[index+2] = point.x - perp.x; - vertices[index+3] = point.y - perp.y; - - lastPoint = point; - } - - PIXI.DisplayObjectContainer.prototype.updateTransform.call( this ); -}; -/* - * Sets the texture that the Rope will use - * - * @method setTexture - * @param texture {Texture} the texture that will be used - */ -PIXI.Rope.prototype.setTexture = function(texture) -{ - // stop current texture - this.texture = texture; - //this.updateFrame = true; -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/extras/SPINE-LICENSE b/tutorial-1/pixi.js-master/src/pixi/extras/SPINE-LICENSE deleted file mode 100755 index 7bb7566..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/extras/SPINE-LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Spine Runtimes Software License -Version 2.1 - -Copyright (c) 2013, Esoteric Software -All rights reserved. - -You are granted a perpetual, non-exclusive, non-sublicensable and -non-transferable license to install, execute and perform the Spine Runtimes -Software (the "Software") solely for internal use. Without the written -permission of Esoteric Software (typically granted by licensing Spine), you -may not (a) modify, translate, adapt or otherwise create derivative works, -improvements of the Software or develop new applications using the Software -or (b) remove, delete, alter or obscure any trademarks or any copyright, -trademark, patent or other intellectual property or proprietary rights notices -on or in the Software, including any copy thereof. Redistributions in binary -or source form must include this license and terms. - -THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tutorial-1/pixi.js-master/src/pixi/extras/Spine.js b/tutorial-1/pixi.js-master/src/pixi/extras/Spine.js deleted file mode 100755 index 06ce610..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/extras/Spine.js +++ /dev/null @@ -1,2626 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License - * Version 2.1 - * - * Copyright (c) 2013, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable and - * non-transferable license to install, execute and perform the Spine Runtimes - * Software (the "Software") solely for internal use. Without the written - * permission of Esoteric Software (typically granted by licensing Spine), you - * may not (a) modify, translate, adapt or otherwise create derivative works, - * improvements of the Software or develop new applications using the Software - * or (b) remove, delete, alter or obscure any trademarks or any copyright, - * trademark, patent or other intellectual property or proprietary rights - * notices on or in the Software, including any copy thereof. Redistributions - * in binary or source form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -var spine = { - radDeg: 180 / Math.PI, - degRad: Math.PI / 180, - temp: [], - Float32Array: (typeof(Float32Array) === 'undefined') ? Array : Float32Array, - Uint16Array: (typeof(Uint16Array) === 'undefined') ? Array : Uint16Array -}; - -spine.BoneData = function (name, parent) { - this.name = name; - this.parent = parent; -}; -spine.BoneData.prototype = { - length: 0, - x: 0, y: 0, - rotation: 0, - scaleX: 1, scaleY: 1, - inheritScale: true, - inheritRotation: true, - flipX: false, flipY: false -}; - -spine.SlotData = function (name, boneData) { - this.name = name; - this.boneData = boneData; -}; -spine.SlotData.prototype = { - r: 1, g: 1, b: 1, a: 1, - attachmentName: null, - additiveBlending: false -}; - -spine.IkConstraintData = function (name) { - this.name = name; - this.bones = []; -}; -spine.IkConstraintData.prototype = { - target: null, - bendDirection: 1, - mix: 1 -}; - -spine.Bone = function (boneData, skeleton, parent) { - this.data = boneData; - this.skeleton = skeleton; - this.parent = parent; - this.setToSetupPose(); -}; -spine.Bone.yDown = false; -spine.Bone.prototype = { - x: 0, y: 0, - rotation: 0, rotationIK: 0, - scaleX: 1, scaleY: 1, - flipX: false, flipY: false, - m00: 0, m01: 0, worldX: 0, // a b x - m10: 0, m11: 0, worldY: 0, // c d y - worldRotation: 0, - worldScaleX: 1, worldScaleY: 1, - worldFlipX: false, worldFlipY: false, - updateWorldTransform: function () { - var parent = this.parent; - if (parent) { - this.worldX = this.x * parent.m00 + this.y * parent.m01 + parent.worldX; - this.worldY = this.x * parent.m10 + this.y * parent.m11 + parent.worldY; - if (this.data.inheritScale) { - this.worldScaleX = parent.worldScaleX * this.scaleX; - this.worldScaleY = parent.worldScaleY * this.scaleY; - } else { - this.worldScaleX = this.scaleX; - this.worldScaleY = this.scaleY; - } - this.worldRotation = this.data.inheritRotation ? (parent.worldRotation + this.rotationIK) : this.rotationIK; - this.worldFlipX = parent.worldFlipX != this.flipX; - this.worldFlipY = parent.worldFlipY != this.flipY; - } else { - var skeletonFlipX = this.skeleton.flipX, skeletonFlipY = this.skeleton.flipY; - this.worldX = skeletonFlipX ? -this.x : this.x; - this.worldY = (skeletonFlipY != spine.Bone.yDown) ? -this.y : this.y; - this.worldScaleX = this.scaleX; - this.worldScaleY = this.scaleY; - this.worldRotation = this.rotationIK; - this.worldFlipX = skeletonFlipX != this.flipX; - this.worldFlipY = skeletonFlipY != this.flipY; - } - var radians = this.worldRotation * spine.degRad; - var cos = Math.cos(radians); - var sin = Math.sin(radians); - if (this.worldFlipX) { - this.m00 = -cos * this.worldScaleX; - this.m01 = sin * this.worldScaleY; - } else { - this.m00 = cos * this.worldScaleX; - this.m01 = -sin * this.worldScaleY; - } - if (this.worldFlipY != spine.Bone.yDown) { - this.m10 = -sin * this.worldScaleX; - this.m11 = -cos * this.worldScaleY; - } else { - this.m10 = sin * this.worldScaleX; - this.m11 = cos * this.worldScaleY; - } - }, - setToSetupPose: function () { - var data = this.data; - this.x = data.x; - this.y = data.y; - this.rotation = data.rotation; - this.rotationIK = this.rotation; - this.scaleX = data.scaleX; - this.scaleY = data.scaleY; - this.flipX = data.flipX; - this.flipY = data.flipY; - }, - worldToLocal: function (world) { - var dx = world[0] - this.worldX, dy = world[1] - this.worldY; - var m00 = this.m00, m10 = this.m10, m01 = this.m01, m11 = this.m11; - if (this.worldFlipX != (this.worldFlipY != spine.Bone.yDown)) { - m00 = -m00; - m11 = -m11; - } - var invDet = 1 / (m00 * m11 - m01 * m10); - world[0] = dx * m00 * invDet - dy * m01 * invDet; - world[1] = dy * m11 * invDet - dx * m10 * invDet; - }, - localToWorld: function (local) { - var localX = local[0], localY = local[1]; - local[0] = localX * this.m00 + localY * this.m01 + this.worldX; - local[1] = localX * this.m10 + localY * this.m11 + this.worldY; - } -}; - -spine.Slot = function (slotData, bone) { - this.data = slotData; - this.bone = bone; - this.setToSetupPose(); -}; -spine.Slot.prototype = { - r: 1, g: 1, b: 1, a: 1, - _attachmentTime: 0, - attachment: null, - attachmentVertices: [], - setAttachment: function (attachment) { - this.attachment = attachment; - this._attachmentTime = this.bone.skeleton.time; - this.attachmentVertices.length = 0; - }, - setAttachmentTime: function (time) { - this._attachmentTime = this.bone.skeleton.time - time; - }, - getAttachmentTime: function () { - return this.bone.skeleton.time - this._attachmentTime; - }, - setToSetupPose: function () { - var data = this.data; - this.r = data.r; - this.g = data.g; - this.b = data.b; - this.a = data.a; - - var slotDatas = this.bone.skeleton.data.slots; - for (var i = 0, n = slotDatas.length; i < n; i++) { - if (slotDatas[i] == data) { - this.setAttachment(!data.attachmentName ? null : this.bone.skeleton.getAttachmentBySlotIndex(i, data.attachmentName)); - break; - } - } - } -}; - -spine.IkConstraint = function (data, skeleton) { - this.data = data; - this.mix = data.mix; - this.bendDirection = data.bendDirection; - - this.bones = []; - for (var i = 0, n = data.bones.length; i < n; i++) - this.bones.push(skeleton.findBone(data.bones[i].name)); - this.target = skeleton.findBone(data.target.name); -}; -spine.IkConstraint.prototype = { - apply: function () { - var target = this.target; - var bones = this.bones; - switch (bones.length) { - case 1: - spine.IkConstraint.apply1(bones[0], target.worldX, target.worldY, this.mix); - break; - case 2: - spine.IkConstraint.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.mix); - break; - } - } -}; -/** Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified in the world - * coordinate system. */ -spine.IkConstraint.apply1 = function (bone, targetX, targetY, alpha) { - var parentRotation = (!bone.data.inheritRotation || !bone.parent) ? 0 : bone.parent.worldRotation; - var rotation = bone.rotation; - var rotationIK = Math.atan2(targetY - bone.worldY, targetX - bone.worldX) * spine.radDeg - parentRotation; - bone.rotationIK = rotation + (rotationIK - rotation) * alpha; -}; -/** Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as possible. The - * target is specified in the world coordinate system. - * @param child Any descendant bone of the parent. */ -spine.IkConstraint.apply2 = function (parent, child, targetX, targetY, bendDirection, alpha) { - var childRotation = child.rotation, parentRotation = parent.rotation; - if (!alpha) { - child.rotationIK = childRotation; - parent.rotationIK = parentRotation; - return; - } - var positionX, positionY, tempPosition = spine.temp; - var parentParent = parent.parent; - if (parentParent) { - tempPosition[0] = targetX; - tempPosition[1] = targetY; - parentParent.worldToLocal(tempPosition); - targetX = (tempPosition[0] - parent.x) * parentParent.worldScaleX; - targetY = (tempPosition[1] - parent.y) * parentParent.worldScaleY; - } else { - targetX -= parent.x; - targetY -= parent.y; - } - if (child.parent == parent) { - positionX = child.x; - positionY = child.y; - } else { - tempPosition[0] = child.x; - tempPosition[1] = child.y; - child.parent.localToWorld(tempPosition); - parent.worldToLocal(tempPosition); - positionX = tempPosition[0]; - positionY = tempPosition[1]; - } - var childX = positionX * parent.worldScaleX, childY = positionY * parent.worldScaleY; - var offset = Math.atan2(childY, childX); - var len1 = Math.sqrt(childX * childX + childY * childY), len2 = child.data.length * child.worldScaleX; - // Based on code by Ryan Juckett with permission: Copyright (c) 2008-2009 Ryan Juckett, http://www.ryanjuckett.com/ - var cosDenom = 2 * len1 * len2; - if (cosDenom < 0.0001) { - child.rotationIK = childRotation + (Math.atan2(targetY, targetX) * spine.radDeg - parentRotation - childRotation) * alpha; - return; - } - var cos = (targetX * targetX + targetY * targetY - len1 * len1 - len2 * len2) / cosDenom; - if (cos < -1) - cos = -1; - else if (cos > 1) - cos = 1; - var childAngle = Math.acos(cos) * bendDirection; - var adjacent = len1 + len2 * cos, opposite = len2 * Math.sin(childAngle); - var parentAngle = Math.atan2(targetY * adjacent - targetX * opposite, targetX * adjacent + targetY * opposite); - var rotation = (parentAngle - offset) * spine.radDeg - parentRotation; - if (rotation > 180) - rotation -= 360; - else if (rotation < -180) // - rotation += 360; - parent.rotationIK = parentRotation + rotation * alpha; - rotation = (childAngle + offset) * spine.radDeg - childRotation; - if (rotation > 180) - rotation -= 360; - else if (rotation < -180) // - rotation += 360; - child.rotationIK = childRotation + (rotation + parent.worldRotation - child.parent.worldRotation) * alpha; -}; - -spine.Skin = function (name) { - this.name = name; - this.attachments = {}; -}; -spine.Skin.prototype = { - addAttachment: function (slotIndex, name, attachment) { - this.attachments[slotIndex + ":" + name] = attachment; - }, - getAttachment: function (slotIndex, name) { - return this.attachments[slotIndex + ":" + name]; - }, - _attachAll: function (skeleton, oldSkin) { - for (var key in oldSkin.attachments) { - var colon = key.indexOf(":"); - var slotIndex = parseInt(key.substring(0, colon)); - var name = key.substring(colon + 1); - var slot = skeleton.slots[slotIndex]; - if (slot.attachment && slot.attachment.name == name) { - var attachment = this.getAttachment(slotIndex, name); - if (attachment) slot.setAttachment(attachment); - } - } - } -}; - -spine.Animation = function (name, timelines, duration) { - this.name = name; - this.timelines = timelines; - this.duration = duration; -}; -spine.Animation.prototype = { - apply: function (skeleton, lastTime, time, loop, events) { - if (loop && this.duration != 0) { - time %= this.duration; - lastTime %= this.duration; - } - var timelines = this.timelines; - for (var i = 0, n = timelines.length; i < n; i++) - timelines[i].apply(skeleton, lastTime, time, events, 1); - }, - mix: function (skeleton, lastTime, time, loop, events, alpha) { - if (loop && this.duration != 0) { - time %= this.duration; - lastTime %= this.duration; - } - var timelines = this.timelines; - for (var i = 0, n = timelines.length; i < n; i++) - timelines[i].apply(skeleton, lastTime, time, events, alpha); - } -}; -spine.Animation.binarySearch = function (values, target, step) { - var low = 0; - var high = Math.floor(values.length / step) - 2; - if (!high) return step; - var current = high >>> 1; - while (true) { - if (values[(current + 1) * step] <= target) - low = current + 1; - else - high = current; - if (low == high) return (low + 1) * step; - current = (low + high) >>> 1; - } -}; -spine.Animation.binarySearch1 = function (values, target) { - var low = 0; - var high = values.length - 2; - if (!high) return 1; - var current = high >>> 1; - while (true) { - if (values[current + 1] <= target) - low = current + 1; - else - high = current; - if (low == high) return low + 1; - current = (low + high) >>> 1; - } -}; -spine.Animation.linearSearch = function (values, target, step) { - for (var i = 0, last = values.length - step; i <= last; i += step) - if (values[i] > target) return i; - return -1; -}; - -spine.Curves = function (frameCount) { - this.curves = []; // type, x, y, ... - //this.curves.length = (frameCount - 1) * 19/*BEZIER_SIZE*/; -}; -spine.Curves.prototype = { - setLinear: function (frameIndex) { - this.curves[frameIndex * 19/*BEZIER_SIZE*/] = 0/*LINEAR*/; - }, - setStepped: function (frameIndex) { - this.curves[frameIndex * 19/*BEZIER_SIZE*/] = 1/*STEPPED*/; - }, - /** Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next. - * cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of - * the difference between the keyframe's values. */ - setCurve: function (frameIndex, cx1, cy1, cx2, cy2) { - var subdiv1 = 1 / 10/*BEZIER_SEGMENTS*/, subdiv2 = subdiv1 * subdiv1, subdiv3 = subdiv2 * subdiv1; - var pre1 = 3 * subdiv1, pre2 = 3 * subdiv2, pre4 = 6 * subdiv2, pre5 = 6 * subdiv3; - var tmp1x = -cx1 * 2 + cx2, tmp1y = -cy1 * 2 + cy2, tmp2x = (cx1 - cx2) * 3 + 1, tmp2y = (cy1 - cy2) * 3 + 1; - var dfx = cx1 * pre1 + tmp1x * pre2 + tmp2x * subdiv3, dfy = cy1 * pre1 + tmp1y * pre2 + tmp2y * subdiv3; - var ddfx = tmp1x * pre4 + tmp2x * pre5, ddfy = tmp1y * pre4 + tmp2y * pre5; - var dddfx = tmp2x * pre5, dddfy = tmp2y * pre5; - - var i = frameIndex * 19/*BEZIER_SIZE*/; - var curves = this.curves; - curves[i++] = 2/*BEZIER*/; - - var x = dfx, y = dfy; - for (var n = i + 19/*BEZIER_SIZE*/ - 1; i < n; i += 2) { - curves[i] = x; - curves[i + 1] = y; - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - x += dfx; - y += dfy; - } - }, - getCurvePercent: function (frameIndex, percent) { - percent = percent < 0 ? 0 : (percent > 1 ? 1 : percent); - var curves = this.curves; - var i = frameIndex * 19/*BEZIER_SIZE*/; - var type = curves[i]; - if (type === 0/*LINEAR*/) return percent; - if (type == 1/*STEPPED*/) return 0; - i++; - var x = 0; - for (var start = i, n = i + 19/*BEZIER_SIZE*/ - 1; i < n; i += 2) { - x = curves[i]; - if (x >= percent) { - var prevX, prevY; - if (i == start) { - prevX = 0; - prevY = 0; - } else { - prevX = curves[i - 2]; - prevY = curves[i - 1]; - } - return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX); - } - } - var y = curves[i - 1]; - return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1. - } -}; - -spine.RotateTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, angle, ... - this.frames.length = frameCount * 2; -}; -spine.RotateTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, angle) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = angle; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 2]) { // Time is after last frame. - var amount = bone.data.rotation + frames[frames.length - 1] - bone.rotation; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - bone.rotation += amount * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 2); - var prevFrameValue = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 2/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 2 - 1, percent); - - var amount = frames[frameIndex + 1/*FRAME_VALUE*/] - prevFrameValue; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - amount = bone.data.rotation + (prevFrameValue + amount * percent) - bone.rotation; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - bone.rotation += amount * alpha; - } -}; - -spine.TranslateTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, x, y, ... - this.frames.length = frameCount * 3; -}; -spine.TranslateTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, x, y) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = x; - this.frames[frameIndex + 2] = y; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - bone.x += (bone.data.x + frames[frames.length - 2] - bone.x) * alpha; - bone.y += (bone.data.y + frames[frames.length - 1] - bone.y) * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameX = frames[frameIndex - 2]; - var prevFrameY = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - bone.x += (bone.data.x + prevFrameX + (frames[frameIndex + 1/*FRAME_X*/] - prevFrameX) * percent - bone.x) * alpha; - bone.y += (bone.data.y + prevFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - prevFrameY) * percent - bone.y) * alpha; - } -}; - -spine.ScaleTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, x, y, ... - this.frames.length = frameCount * 3; -}; -spine.ScaleTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, x, y) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = x; - this.frames[frameIndex + 2] = y; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - bone.scaleX += (bone.data.scaleX * frames[frames.length - 2] - bone.scaleX) * alpha; - bone.scaleY += (bone.data.scaleY * frames[frames.length - 1] - bone.scaleY) * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameX = frames[frameIndex - 2]; - var prevFrameY = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - bone.scaleX += (bone.data.scaleX * (prevFrameX + (frames[frameIndex + 1/*FRAME_X*/] - prevFrameX) * percent) - bone.scaleX) * alpha; - bone.scaleY += (bone.data.scaleY * (prevFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - prevFrameY) * percent) - bone.scaleY) * alpha; - } -}; - -spine.ColorTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, r, g, b, a, ... - this.frames.length = frameCount * 5; -}; -spine.ColorTimeline.prototype = { - slotIndex: 0, - getFrameCount: function () { - return this.frames.length / 5; - }, - setFrame: function (frameIndex, time, r, g, b, a) { - frameIndex *= 5; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = r; - this.frames[frameIndex + 2] = g; - this.frames[frameIndex + 3] = b; - this.frames[frameIndex + 4] = a; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var r, g, b, a; - if (time >= frames[frames.length - 5]) { - // Time is after last frame. - var i = frames.length - 1; - r = frames[i - 3]; - g = frames[i - 2]; - b = frames[i - 1]; - a = frames[i]; - } else { - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 5); - var prevFrameR = frames[frameIndex - 4]; - var prevFrameG = frames[frameIndex - 3]; - var prevFrameB = frames[frameIndex - 2]; - var prevFrameA = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 5/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 5 - 1, percent); - - r = prevFrameR + (frames[frameIndex + 1/*FRAME_R*/] - prevFrameR) * percent; - g = prevFrameG + (frames[frameIndex + 2/*FRAME_G*/] - prevFrameG) * percent; - b = prevFrameB + (frames[frameIndex + 3/*FRAME_B*/] - prevFrameB) * percent; - a = prevFrameA + (frames[frameIndex + 4/*FRAME_A*/] - prevFrameA) * percent; - } - var slot = skeleton.slots[this.slotIndex]; - if (alpha < 1) { - slot.r += (r - slot.r) * alpha; - slot.g += (g - slot.g) * alpha; - slot.b += (b - slot.b) * alpha; - slot.a += (a - slot.a) * alpha; - } else { - slot.r = r; - slot.g = g; - slot.b = b; - slot.a = a; - } - } -}; - -spine.AttachmentTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, ... - this.frames.length = frameCount; - this.attachmentNames = []; - this.attachmentNames.length = frameCount; -}; -spine.AttachmentTimeline.prototype = { - slotIndex: 0, - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, attachmentName) { - this.frames[frameIndex] = time; - this.attachmentNames[frameIndex] = attachmentName; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - - var frameIndex = time >= frames[frames.length - 1] ? frames.length - 1 : spine.Animation.binarySearch1(frames, time) - 1; - if (frames[frameIndex] < lastTime) return; - - var attachmentName = this.attachmentNames[frameIndex]; - skeleton.slots[this.slotIndex].setAttachment( - !attachmentName ? null : skeleton.getAttachmentBySlotIndex(this.slotIndex, attachmentName)); - } -}; - -spine.EventTimeline = function (frameCount) { - this.frames = []; // time, ... - this.frames.length = frameCount; - this.events = []; - this.events.length = frameCount; -}; -spine.EventTimeline.prototype = { - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, event) { - this.frames[frameIndex] = time; - this.events[frameIndex] = event; - }, - /** Fires events for frames > lastTime and <= time. */ - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - if (!firedEvents) return; - - var frames = this.frames; - var frameCount = frames.length; - - if (lastTime > time) { // Fire events after last time for looped animations. - this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha); - lastTime = -1; - } else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame. - return; - if (time < frames[0]) return; // Time is before first frame. - - var frameIndex; - if (lastTime < frames[0]) - frameIndex = 0; - else { - frameIndex = spine.Animation.binarySearch1(frames, lastTime); - var frame = frames[frameIndex]; - while (frameIndex > 0) { // Fire multiple events with the same frame. - if (frames[frameIndex - 1] != frame) break; - frameIndex--; - } - } - var events = this.events; - for (; frameIndex < frameCount && time >= frames[frameIndex]; frameIndex++) - firedEvents.push(events[frameIndex]); - } -}; - -spine.DrawOrderTimeline = function (frameCount) { - this.frames = []; // time, ... - this.frames.length = frameCount; - this.drawOrders = []; - this.drawOrders.length = frameCount; -}; -spine.DrawOrderTimeline.prototype = { - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, drawOrder) { - this.frames[frameIndex] = time; - this.drawOrders[frameIndex] = drawOrder; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var frameIndex; - if (time >= frames[frames.length - 1]) // Time is after last frame. - frameIndex = frames.length - 1; - else - frameIndex = spine.Animation.binarySearch1(frames, time) - 1; - - var drawOrder = skeleton.drawOrder; - var slots = skeleton.slots; - var drawOrderToSetupIndex = this.drawOrders[frameIndex]; - if (!drawOrderToSetupIndex) { - for (var i = 0, n = slots.length; i < n; i++) - drawOrder[i] = slots[i]; - } else { - for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++) - drawOrder[i] = skeleton.slots[drawOrderToSetupIndex[i]]; - } - - } -}; - -spine.FfdTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; - this.frames.length = frameCount; - this.frameVertices = []; - this.frameVertices.length = frameCount; -}; -spine.FfdTimeline.prototype = { - slotIndex: 0, - attachment: 0, - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, vertices) { - this.frames[frameIndex] = time; - this.frameVertices[frameIndex] = vertices; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var slot = skeleton.slots[this.slotIndex]; - if (slot.attachment != this.attachment) return; - - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var frameVertices = this.frameVertices; - var vertexCount = frameVertices[0].length; - - var vertices = slot.attachmentVertices; - if (vertices.length != vertexCount) alpha = 1; - vertices.length = vertexCount; - - if (time >= frames[frames.length - 1]) { // Time is after last frame. - var lastVertices = frameVertices[frames.length - 1]; - if (alpha < 1) { - for (var i = 0; i < vertexCount; i++) - vertices[i] += (lastVertices[i] - vertices[i]) * alpha; - } else { - for (var i = 0; i < vertexCount; i++) - vertices[i] = lastVertices[i]; - } - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch1(frames, time); - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 1] - frameTime); - percent = this.curves.getCurvePercent(frameIndex - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent)); - - var prevVertices = frameVertices[frameIndex - 1]; - var nextVertices = frameVertices[frameIndex]; - - if (alpha < 1) { - for (var i = 0; i < vertexCount; i++) { - var prev = prevVertices[i]; - vertices[i] += (prev + (nextVertices[i] - prev) * percent - vertices[i]) * alpha; - } - } else { - for (var i = 0; i < vertexCount; i++) { - var prev = prevVertices[i]; - vertices[i] = prev + (nextVertices[i] - prev) * percent; - } - } - } -}; - -spine.IkConstraintTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, mix, bendDirection, ... - this.frames.length = frameCount * 3; -}; -spine.IkConstraintTimeline.prototype = { - ikConstraintIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, mix, bendDirection) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = mix; - this.frames[frameIndex + 2] = bendDirection; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var ikConstraint = skeleton.ikConstraints[this.ikConstraintIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - ikConstraint.mix += (frames[frames.length - 2] - ikConstraint.mix) * alpha; - ikConstraint.bendDirection = frames[frames.length - 1]; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameMix = frames[frameIndex + -2/*PREV_FRAME_MIX*/]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - var mix = prevFrameMix + (frames[frameIndex + 1/*FRAME_MIX*/] - prevFrameMix) * percent; - ikConstraint.mix += (mix - ikConstraint.mix) * alpha; - ikConstraint.bendDirection = frames[frameIndex + -1/*PREV_FRAME_BEND_DIRECTION*/]; - } -}; - -spine.FlipXTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, flip, ... - this.frames.length = frameCount * 2; -}; -spine.FlipXTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, flip) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = flip ? 1 : 0; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - var frameIndex = (time >= frames[frames.length - 2] ? frames.length : spine.Animation.binarySearch(frames, time, 2)) - 2; - if (frames[frameIndex] < lastTime) return; - skeleton.bones[boneIndex].flipX = frames[frameIndex + 1] != 0; - } -}; - -spine.FlipYTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, flip, ... - this.frames.length = frameCount * 2; -}; -spine.FlipYTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, flip) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = flip ? 1 : 0; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - var frameIndex = (time >= frames[frames.length - 2] ? frames.length : spine.Animation.binarySearch(frames, time, 2)) - 2; - if (frames[frameIndex] < lastTime) return; - skeleton.bones[boneIndex].flipY = frames[frameIndex + 1] != 0; - } -}; - -spine.SkeletonData = function () { - this.bones = []; - this.slots = []; - this.skins = []; - this.events = []; - this.animations = []; - this.ikConstraints = []; -}; -spine.SkeletonData.prototype = { - name: null, - defaultSkin: null, - width: 0, height: 0, - version: null, hash: null, - /** @return May be null. */ - findBone: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].name == boneName) return bones[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findBoneIndex: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].name == boneName) return i; - return -1; - }, - /** @return May be null. */ - findSlot: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - if (slots[i].name == slotName) return slot[i]; - } - return null; - }, - /** @return -1 if the bone was not found. */ - findSlotIndex: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].name == slotName) return i; - return -1; - }, - /** @return May be null. */ - findSkin: function (skinName) { - var skins = this.skins; - for (var i = 0, n = skins.length; i < n; i++) - if (skins[i].name == skinName) return skins[i]; - return null; - }, - /** @return May be null. */ - findEvent: function (eventName) { - var events = this.events; - for (var i = 0, n = events.length; i < n; i++) - if (events[i].name == eventName) return events[i]; - return null; - }, - /** @return May be null. */ - findAnimation: function (animationName) { - var animations = this.animations; - for (var i = 0, n = animations.length; i < n; i++) - if (animations[i].name == animationName) return animations[i]; - return null; - }, - /** @return May be null. */ - findIkConstraint: function (ikConstraintName) { - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) - if (ikConstraints[i].name == ikConstraintName) return ikConstraints[i]; - return null; - } -}; - -spine.Skeleton = function (skeletonData) { - this.data = skeletonData; - - this.bones = []; - for (var i = 0, n = skeletonData.bones.length; i < n; i++) { - var boneData = skeletonData.bones[i]; - var parent = !boneData.parent ? null : this.bones[skeletonData.bones.indexOf(boneData.parent)]; - this.bones.push(new spine.Bone(boneData, this, parent)); - } - - this.slots = []; - this.drawOrder = []; - for (var i = 0, n = skeletonData.slots.length; i < n; i++) { - var slotData = skeletonData.slots[i]; - var bone = this.bones[skeletonData.bones.indexOf(slotData.boneData)]; - var slot = new spine.Slot(slotData, bone); - this.slots.push(slot); - this.drawOrder.push(slot); - } - - this.ikConstraints = []; - for (var i = 0, n = skeletonData.ikConstraints.length; i < n; i++) - this.ikConstraints.push(new spine.IkConstraint(skeletonData.ikConstraints[i], this)); - - this.boneCache = []; - this.updateCache(); -}; -spine.Skeleton.prototype = { - x: 0, y: 0, - skin: null, - r: 1, g: 1, b: 1, a: 1, - time: 0, - flipX: false, flipY: false, - /** Caches information about bones and IK constraints. Must be called if bones or IK constraints are added or removed. */ - updateCache: function () { - var ikConstraints = this.ikConstraints; - var ikConstraintsCount = ikConstraints.length; - - var arrayCount = ikConstraintsCount + 1; - var boneCache = this.boneCache; - if (boneCache.length > arrayCount) boneCache.length = arrayCount; - for (var i = 0, n = boneCache.length; i < n; i++) - boneCache[i].length = 0; - while (boneCache.length < arrayCount) - boneCache[boneCache.length] = []; - - var nonIkBones = boneCache[0]; - var bones = this.bones; - - outer: - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - var current = bone; - do { - for (var ii = 0; ii < ikConstraintsCount; ii++) { - var ikConstraint = ikConstraints[ii]; - var parent = ikConstraint.bones[0]; - var child= ikConstraint.bones[ikConstraint.bones.length - 1]; - while (true) { - if (current == child) { - boneCache[ii].push(bone); - boneCache[ii + 1].push(bone); - continue outer; - } - if (child == parent) break; - child = child.parent; - } - } - current = current.parent; - } while (current); - nonIkBones[nonIkBones.length] = bone; - } - }, - /** Updates the world transform for each bone. */ - updateWorldTransform: function () { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - bone.rotationIK = bone.rotation; - } - var i = 0, last = this.boneCache.length - 1; - while (true) { - var cacheBones = this.boneCache[i]; - for (var ii = 0, nn = cacheBones.length; ii < nn; ii++) - cacheBones[ii].updateWorldTransform(); - if (i == last) break; - this.ikConstraints[i].apply(); - i++; - } - }, - /** Sets the bones and slots to their setup pose values. */ - setToSetupPose: function () { - this.setBonesToSetupPose(); - this.setSlotsToSetupPose(); - }, - setBonesToSetupPose: function () { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - bones[i].setToSetupPose(); - - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) { - var ikConstraint = ikConstraints[i]; - ikConstraint.bendDirection = ikConstraint.data.bendDirection; - ikConstraint.mix = ikConstraint.data.mix; - } - }, - setSlotsToSetupPose: function () { - var slots = this.slots; - var drawOrder = this.drawOrder; - for (var i = 0, n = slots.length; i < n; i++) { - drawOrder[i] = slots[i]; - slots[i].setToSetupPose(i); - } - }, - /** @return May return null. */ - getRootBone: function () { - return this.bones.length ? this.bones[0] : null; - }, - /** @return May be null. */ - findBone: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].data.name == boneName) return bones[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findBoneIndex: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].data.name == boneName) return i; - return -1; - }, - /** @return May be null. */ - findSlot: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].data.name == slotName) return slots[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findSlotIndex: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].data.name == slotName) return i; - return -1; - }, - setSkinByName: function (skinName) { - var skin = this.data.findSkin(skinName); - if (!skin) throw "Skin not found: " + skinName; - this.setSkin(skin); - }, - /** Sets the skin used to look up attachments before looking in the {@link SkeletonData#getDefaultSkin() default skin}. - * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was - * no old skin, each slot's setup mode attachment is attached from the new skin. - * @param newSkin May be null. */ - setSkin: function (newSkin) { - if (newSkin) { - if (this.skin) - newSkin._attachAll(this, this.skin); - else { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - var name = slot.data.attachmentName; - if (name) { - var attachment = newSkin.getAttachment(i, name); - if (attachment) slot.setAttachment(attachment); - } - } - } - } - this.skin = newSkin; - }, - /** @return May be null. */ - getAttachmentBySlotName: function (slotName, attachmentName) { - return this.getAttachmentBySlotIndex(this.data.findSlotIndex(slotName), attachmentName); - }, - /** @return May be null. */ - getAttachmentBySlotIndex: function (slotIndex, attachmentName) { - if (this.skin) { - var attachment = this.skin.getAttachment(slotIndex, attachmentName); - if (attachment) return attachment; - } - if (this.data.defaultSkin) return this.data.defaultSkin.getAttachment(slotIndex, attachmentName); - return null; - }, - /** @param attachmentName May be null. */ - setAttachment: function (slotName, attachmentName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - if (slot.data.name == slotName) { - var attachment = null; - if (attachmentName) { - attachment = this.getAttachmentBySlotIndex(i, attachmentName); - if (!attachment) throw "Attachment not found: " + attachmentName + ", for slot: " + slotName; - } - slot.setAttachment(attachment); - return; - } - } - throw "Slot not found: " + slotName; - }, - /** @return May be null. */ - findIkConstraint: function (ikConstraintName) { - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) - if (ikConstraints[i].data.name == ikConstraintName) return ikConstraints[i]; - return null; - }, - update: function (delta) { - this.time += delta; - } -}; - -spine.EventData = function (name) { - this.name = name; -}; -spine.EventData.prototype = { - intValue: 0, - floatValue: 0, - stringValue: null -}; - -spine.Event = function (data) { - this.data = data; -}; -spine.Event.prototype = { - intValue: 0, - floatValue: 0, - stringValue: null -}; - -spine.AttachmentType = { - region: 0, - boundingbox: 1, - mesh: 2, - skinnedmesh: 3 -}; - -spine.RegionAttachment = function (name) { - this.name = name; - this.offset = []; - this.offset.length = 8; - this.uvs = []; - this.uvs.length = 8; -}; -spine.RegionAttachment.prototype = { - type: spine.AttachmentType.region, - x: 0, y: 0, - rotation: 0, - scaleX: 1, scaleY: 1, - width: 0, height: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - setUVs: function (u, v, u2, v2, rotate) { - var uvs = this.uvs; - if (rotate) { - uvs[2/*X2*/] = u; - uvs[3/*Y2*/] = v2; - uvs[4/*X3*/] = u; - uvs[5/*Y3*/] = v; - uvs[6/*X4*/] = u2; - uvs[7/*Y4*/] = v; - uvs[0/*X1*/] = u2; - uvs[1/*Y1*/] = v2; - } else { - uvs[0/*X1*/] = u; - uvs[1/*Y1*/] = v2; - uvs[2/*X2*/] = u; - uvs[3/*Y2*/] = v; - uvs[4/*X3*/] = u2; - uvs[5/*Y3*/] = v; - uvs[6/*X4*/] = u2; - uvs[7/*Y4*/] = v2; - } - }, - updateOffset: function () { - var regionScaleX = this.width / this.regionOriginalWidth * this.scaleX; - var regionScaleY = this.height / this.regionOriginalHeight * this.scaleY; - var localX = -this.width / 2 * this.scaleX + this.regionOffsetX * regionScaleX; - var localY = -this.height / 2 * this.scaleY + this.regionOffsetY * regionScaleY; - var localX2 = localX + this.regionWidth * regionScaleX; - var localY2 = localY + this.regionHeight * regionScaleY; - var radians = this.rotation * spine.degRad; - var cos = Math.cos(radians); - var sin = Math.sin(radians); - var localXCos = localX * cos + this.x; - var localXSin = localX * sin; - var localYCos = localY * cos + this.y; - var localYSin = localY * sin; - var localX2Cos = localX2 * cos + this.x; - var localX2Sin = localX2 * sin; - var localY2Cos = localY2 * cos + this.y; - var localY2Sin = localY2 * sin; - var offset = this.offset; - offset[0/*X1*/] = localXCos - localYSin; - offset[1/*Y1*/] = localYCos + localXSin; - offset[2/*X2*/] = localXCos - localY2Sin; - offset[3/*Y2*/] = localY2Cos + localXSin; - offset[4/*X3*/] = localX2Cos - localY2Sin; - offset[5/*Y3*/] = localY2Cos + localX2Sin; - offset[6/*X4*/] = localX2Cos - localYSin; - offset[7/*Y4*/] = localYCos + localX2Sin; - }, - computeVertices: function (x, y, bone, vertices) { - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var offset = this.offset; - vertices[0/*X1*/] = offset[0/*X1*/] * m00 + offset[1/*Y1*/] * m01 + x; - vertices[1/*Y1*/] = offset[0/*X1*/] * m10 + offset[1/*Y1*/] * m11 + y; - vertices[2/*X2*/] = offset[2/*X2*/] * m00 + offset[3/*Y2*/] * m01 + x; - vertices[3/*Y2*/] = offset[2/*X2*/] * m10 + offset[3/*Y2*/] * m11 + y; - vertices[4/*X3*/] = offset[4/*X3*/] * m00 + offset[5/*X3*/] * m01 + x; - vertices[5/*X3*/] = offset[4/*X3*/] * m10 + offset[5/*X3*/] * m11 + y; - vertices[6/*X4*/] = offset[6/*X4*/] * m00 + offset[7/*Y4*/] * m01 + x; - vertices[7/*Y4*/] = offset[6/*X4*/] * m10 + offset[7/*Y4*/] * m11 + y; - } -}; - -spine.MeshAttachment = function (name) { - this.name = name; -}; -spine.MeshAttachment.prototype = { - type: spine.AttachmentType.mesh, - vertices: null, - uvs: null, - regionUVs: null, - triangles: null, - hullLength: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionU: 0, regionV: 0, regionU2: 0, regionV2: 0, regionRotate: false, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - edges: null, - width: 0, height: 0, - updateUVs: function () { - var width = this.regionU2 - this.regionU, height = this.regionV2 - this.regionV; - var n = this.regionUVs.length; - if (!this.uvs || this.uvs.length != n) { - this.uvs = new spine.Float32Array(n); - } - if (this.regionRotate) { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i + 1] * width; - this.uvs[i + 1] = this.regionV + height - this.regionUVs[i] * height; - } - } else { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i] * width; - this.uvs[i + 1] = this.regionV + this.regionUVs[i + 1] * height; - } - } - }, - computeWorldVertices: function (x, y, slot, worldVertices) { - var bone = slot.bone; - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var vertices = this.vertices; - var verticesCount = vertices.length; - if (slot.attachmentVertices.length == verticesCount) vertices = slot.attachmentVertices; - for (var i = 0; i < verticesCount; i += 2) { - var vx = vertices[i]; - var vy = vertices[i + 1]; - worldVertices[i] = vx * m00 + vy * m01 + x; - worldVertices[i + 1] = vx * m10 + vy * m11 + y; - } - } -}; - -spine.SkinnedMeshAttachment = function (name) { - this.name = name; -}; -spine.SkinnedMeshAttachment.prototype = { - type: spine.AttachmentType.skinnedmesh, - bones: null, - weights: null, - uvs: null, - regionUVs: null, - triangles: null, - hullLength: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionU: 0, regionV: 0, regionU2: 0, regionV2: 0, regionRotate: false, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - edges: null, - width: 0, height: 0, - updateUVs: function (u, v, u2, v2, rotate) { - var width = this.regionU2 - this.regionU, height = this.regionV2 - this.regionV; - var n = this.regionUVs.length; - if (!this.uvs || this.uvs.length != n) { - this.uvs = new spine.Float32Array(n); - } - if (this.regionRotate) { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i + 1] * width; - this.uvs[i + 1] = this.regionV + height - this.regionUVs[i] * height; - } - } else { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i] * width; - this.uvs[i + 1] = this.regionV + this.regionUVs[i + 1] * height; - } - } - }, - computeWorldVertices: function (x, y, slot, worldVertices) { - var skeletonBones = slot.bone.skeleton.bones; - var weights = this.weights; - var bones = this.bones; - - var w = 0, v = 0, b = 0, f = 0, n = bones.length, nn; - var wx, wy, bone, vx, vy, weight; - if (!slot.attachmentVertices.length) { - for (; v < n; w += 2) { - wx = 0; - wy = 0; - nn = bones[v++] + v; - for (; v < nn; v++, b += 3) { - bone = skeletonBones[bones[v]]; - vx = weights[b]; - vy = weights[b + 1]; - weight = weights[b + 2]; - wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight; - wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight; - } - worldVertices[w] = wx + x; - worldVertices[w + 1] = wy + y; - } - } else { - var ffd = slot.attachmentVertices; - for (; v < n; w += 2) { - wx = 0; - wy = 0; - nn = bones[v++] + v; - for (; v < nn; v++, b += 3, f += 2) { - bone = skeletonBones[bones[v]]; - vx = weights[b] + ffd[f]; - vy = weights[b + 1] + ffd[f + 1]; - weight = weights[b + 2]; - wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight; - wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight; - } - worldVertices[w] = wx + x; - worldVertices[w + 1] = wy + y; - } - } - } -}; - -spine.BoundingBoxAttachment = function (name) { - this.name = name; - this.vertices = []; -}; -spine.BoundingBoxAttachment.prototype = { - type: spine.AttachmentType.boundingbox, - computeWorldVertices: function (x, y, bone, worldVertices) { - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var vertices = this.vertices; - for (var i = 0, n = vertices.length; i < n; i += 2) { - var px = vertices[i]; - var py = vertices[i + 1]; - worldVertices[i] = px * m00 + py * m01 + x; - worldVertices[i + 1] = px * m10 + py * m11 + y; - } - } -}; - -spine.AnimationStateData = function (skeletonData) { - this.skeletonData = skeletonData; - this.animationToMixTime = {}; -}; -spine.AnimationStateData.prototype = { - defaultMix: 0, - setMixByName: function (fromName, toName, duration) { - var from = this.skeletonData.findAnimation(fromName); - if (!from) throw "Animation not found: " + fromName; - var to = this.skeletonData.findAnimation(toName); - if (!to) throw "Animation not found: " + toName; - this.setMix(from, to, duration); - }, - setMix: function (from, to, duration) { - this.animationToMixTime[from.name + ":" + to.name] = duration; - }, - getMix: function (from, to) { - var key = from.name + ":" + to.name; - return this.animationToMixTime.hasOwnProperty(key) ? this.animationToMixTime[key] : this.defaultMix; - } -}; - -spine.TrackEntry = function () {}; -spine.TrackEntry.prototype = { - next: null, previous: null, - animation: null, - loop: false, - delay: 0, time: 0, lastTime: -1, endTime: 0, - timeScale: 1, - mixTime: 0, mixDuration: 0, mix: 1, - onStart: null, onEnd: null, onComplete: null, onEvent: null -}; - -spine.AnimationState = function (stateData) { - this.data = stateData; - this.tracks = []; - this.events = []; -}; -spine.AnimationState.prototype = { - onStart: null, - onEnd: null, - onComplete: null, - onEvent: null, - timeScale: 1, - update: function (delta) { - delta *= this.timeScale; - for (var i = 0; i < this.tracks.length; i++) { - var current = this.tracks[i]; - if (!current) continue; - - current.time += delta * current.timeScale; - if (current.previous) { - var previousDelta = delta * current.previous.timeScale; - current.previous.time += previousDelta; - current.mixTime += previousDelta; - } - - var next = current.next; - if (next) { - next.time = current.lastTime - next.delay; - if (next.time >= 0) this.setCurrent(i, next); - } else { - // End non-looping animation when it reaches its end time and there is no next entry. - if (!current.loop && current.lastTime >= current.endTime) this.clearTrack(i); - } - } - }, - apply: function (skeleton) { - for (var i = 0; i < this.tracks.length; i++) { - var current = this.tracks[i]; - if (!current) continue; - - this.events.length = 0; - - var time = current.time; - var lastTime = current.lastTime; - var endTime = current.endTime; - var loop = current.loop; - if (!loop && time > endTime) time = endTime; - - var previous = current.previous; - if (!previous) { - if (current.mix == 1) - current.animation.apply(skeleton, current.lastTime, time, loop, this.events); - else - current.animation.mix(skeleton, current.lastTime, time, loop, this.events, current.mix); - } else { - var previousTime = previous.time; - if (!previous.loop && previousTime > previous.endTime) previousTime = previous.endTime; - previous.animation.apply(skeleton, previousTime, previousTime, previous.loop, null); - - var alpha = current.mixTime / current.mixDuration * current.mix; - if (alpha >= 1) { - alpha = 1; - current.previous = null; - } - current.animation.mix(skeleton, current.lastTime, time, loop, this.events, alpha); - } - - for (var ii = 0, nn = this.events.length; ii < nn; ii++) { - var event = this.events[ii]; - if (current.onEvent) current.onEvent(i, event); - if (this.onEvent) this.onEvent(i, event); - } - - // Check if completed the animation or a loop iteration. - if (loop ? (lastTime % endTime > time % endTime) : (lastTime < endTime && time >= endTime)) { - var count = Math.floor(time / endTime); - if (current.onComplete) current.onComplete(i, count); - if (this.onComplete) this.onComplete(i, count); - } - - current.lastTime = current.time; - } - }, - clearTracks: function () { - for (var i = 0, n = this.tracks.length; i < n; i++) - this.clearTrack(i); - this.tracks.length = 0; - }, - clearTrack: function (trackIndex) { - if (trackIndex >= this.tracks.length) return; - var current = this.tracks[trackIndex]; - if (!current) return; - - if (current.onEnd) current.onEnd(trackIndex); - if (this.onEnd) this.onEnd(trackIndex); - - this.tracks[trackIndex] = null; - }, - _expandToIndex: function (index) { - if (index < this.tracks.length) return this.tracks[index]; - while (index >= this.tracks.length) - this.tracks.push(null); - return null; - }, - setCurrent: function (index, entry) { - var current = this._expandToIndex(index); - if (current) { - var previous = current.previous; - current.previous = null; - - if (current.onEnd) current.onEnd(index); - if (this.onEnd) this.onEnd(index); - - entry.mixDuration = this.data.getMix(current.animation, entry.animation); - if (entry.mixDuration > 0) { - entry.mixTime = 0; - // If a mix is in progress, mix from the closest animation. - if (previous && current.mixTime / current.mixDuration < 0.5) - entry.previous = previous; - else - entry.previous = current; - } - } - - this.tracks[index] = entry; - - if (entry.onStart) entry.onStart(index); - if (this.onStart) this.onStart(index); - }, - setAnimationByName: function (trackIndex, animationName, loop) { - var animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) throw "Animation not found: " + animationName; - return this.setAnimation(trackIndex, animation, loop); - }, - /** Set the current animation. Any queued animations are cleared. */ - setAnimation: function (trackIndex, animation, loop) { - var entry = new spine.TrackEntry(); - entry.animation = animation; - entry.loop = loop; - entry.endTime = animation.duration; - this.setCurrent(trackIndex, entry); - return entry; - }, - addAnimationByName: function (trackIndex, animationName, loop, delay) { - var animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) throw "Animation not found: " + animationName; - return this.addAnimation(trackIndex, animation, loop, delay); - }, - /** Adds an animation to be played delay seconds after the current or last queued animation. - * @param delay May be <= 0 to use duration of previous animation minus any mix duration plus the negative delay. */ - addAnimation: function (trackIndex, animation, loop, delay) { - var entry = new spine.TrackEntry(); - entry.animation = animation; - entry.loop = loop; - entry.endTime = animation.duration; - - var last = this._expandToIndex(trackIndex); - if (last) { - while (last.next) - last = last.next; - last.next = entry; - } else - this.tracks[trackIndex] = entry; - - if (delay <= 0) { - if (last) - delay += last.endTime - this.data.getMix(last.animation, animation); - else - delay = 0; - } - entry.delay = delay; - - return entry; - }, - /** May be null. */ - getCurrent: function (trackIndex) { - if (trackIndex >= this.tracks.length) return null; - return this.tracks[trackIndex]; - } -}; - -spine.SkeletonJson = function (attachmentLoader) { - this.attachmentLoader = attachmentLoader; -}; -spine.SkeletonJson.prototype = { - scale: 1, - readSkeletonData: function (root, name) { - var skeletonData = new spine.SkeletonData(); - skeletonData.name = name; - - // Skeleton. - var skeletonMap = root["skeleton"]; - if (skeletonMap) { - skeletonData.hash = skeletonMap["hash"]; - skeletonData.version = skeletonMap["spine"]; - skeletonData.width = skeletonMap["width"] || 0; - skeletonData.height = skeletonMap["height"] || 0; - } - - // Bones. - var bones = root["bones"]; - for (var i = 0, n = bones.length; i < n; i++) { - var boneMap = bones[i]; - var parent = null; - if (boneMap["parent"]) { - parent = skeletonData.findBone(boneMap["parent"]); - if (!parent) throw "Parent bone not found: " + boneMap["parent"]; - } - var boneData = new spine.BoneData(boneMap["name"], parent); - boneData.length = (boneMap["length"] || 0) * this.scale; - boneData.x = (boneMap["x"] || 0) * this.scale; - boneData.y = (boneMap["y"] || 0) * this.scale; - boneData.rotation = (boneMap["rotation"] || 0); - boneData.scaleX = boneMap.hasOwnProperty("scaleX") ? boneMap["scaleX"] : 1; - boneData.scaleY = boneMap.hasOwnProperty("scaleY") ? boneMap["scaleY"] : 1; - boneData.inheritScale = boneMap.hasOwnProperty("inheritScale") ? boneMap["inheritScale"] : true; - boneData.inheritRotation = boneMap.hasOwnProperty("inheritRotation") ? boneMap["inheritRotation"] : true; - skeletonData.bones.push(boneData); - } - - // IK constraints. - var ik = root["ik"]; - if (ik) { - for (var i = 0, n = ik.length; i < n; i++) { - var ikMap = ik[i]; - var ikConstraintData = new spine.IkConstraintData(ikMap["name"]); - - var bones = ikMap["bones"]; - for (var ii = 0, nn = bones.length; ii < nn; ii++) { - var bone = skeletonData.findBone(bones[ii]); - if (!bone) throw "IK bone not found: " + bones[ii]; - ikConstraintData.bones.push(bone); - } - - ikConstraintData.target = skeletonData.findBone(ikMap["target"]); - if (!ikConstraintData.target) throw "Target bone not found: " + ikMap["target"]; - - ikConstraintData.bendDirection = (!ikMap.hasOwnProperty("bendPositive") || ikMap["bendPositive"]) ? 1 : -1; - ikConstraintData.mix = ikMap.hasOwnProperty("mix") ? ikMap["mix"] : 1; - - skeletonData.ikConstraints.push(ikConstraintData); - } - } - - // Slots. - var slots = root["slots"]; - for (var i = 0, n = slots.length; i < n; i++) { - var slotMap = slots[i]; - var boneData = skeletonData.findBone(slotMap["bone"]); - if (!boneData) throw "Slot bone not found: " + slotMap["bone"]; - var slotData = new spine.SlotData(slotMap["name"], boneData); - - var color = slotMap["color"]; - if (color) { - slotData.r = this.toColor(color, 0); - slotData.g = this.toColor(color, 1); - slotData.b = this.toColor(color, 2); - slotData.a = this.toColor(color, 3); - } - - slotData.attachmentName = slotMap["attachment"]; - slotData.additiveBlending = slotMap["additive"] && slotMap["additive"] == "true"; - - skeletonData.slots.push(slotData); - } - - // Skins. - var skins = root["skins"]; - for (var skinName in skins) { - if (!skins.hasOwnProperty(skinName)) continue; - var skinMap = skins[skinName]; - var skin = new spine.Skin(skinName); - for (var slotName in skinMap) { - if (!skinMap.hasOwnProperty(slotName)) continue; - var slotIndex = skeletonData.findSlotIndex(slotName); - var slotEntry = skinMap[slotName]; - for (var attachmentName in slotEntry) { - if (!slotEntry.hasOwnProperty(attachmentName)) continue; - var attachment = this.readAttachment(skin, attachmentName, slotEntry[attachmentName]); - if (attachment) skin.addAttachment(slotIndex, attachmentName, attachment); - } - } - skeletonData.skins.push(skin); - if (skin.name == "default") skeletonData.defaultSkin = skin; - } - - // Events. - var events = root["events"]; - for (var eventName in events) { - if (!events.hasOwnProperty(eventName)) continue; - var eventMap = events[eventName]; - var eventData = new spine.EventData(eventName); - eventData.intValue = eventMap["int"] || 0; - eventData.floatValue = eventMap["float"] || 0; - eventData.stringValue = eventMap["string"] || null; - skeletonData.events.push(eventData); - } - - // Animations. - var animations = root["animations"]; - for (var animationName in animations) { - if (!animations.hasOwnProperty(animationName)) continue; - this.readAnimation(animationName, animations[animationName], skeletonData); - } - - return skeletonData; - }, - readAttachment: function (skin, name, map) { - name = map["name"] || name; - - var type = spine.AttachmentType[map["type"] || "region"]; - var path = map["path"] || name; - - var scale = this.scale; - if (type == spine.AttachmentType.region) { - var region = this.attachmentLoader.newRegionAttachment(skin, name, path); - if (!region) return null; - region.path = path; - region.x = (map["x"] || 0) * scale; - region.y = (map["y"] || 0) * scale; - region.scaleX = map.hasOwnProperty("scaleX") ? map["scaleX"] : 1; - region.scaleY = map.hasOwnProperty("scaleY") ? map["scaleY"] : 1; - region.rotation = map["rotation"] || 0; - region.width = (map["width"] || 0) * scale; - region.height = (map["height"] || 0) * scale; - - var color = map["color"]; - if (color) { - region.r = this.toColor(color, 0); - region.g = this.toColor(color, 1); - region.b = this.toColor(color, 2); - region.a = this.toColor(color, 3); - } - - region.updateOffset(); - return region; - } else if (type == spine.AttachmentType.mesh) { - var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path); - if (!mesh) return null; - mesh.path = path; - mesh.vertices = this.getFloatArray(map, "vertices", scale); - mesh.triangles = this.getIntArray(map, "triangles"); - mesh.regionUVs = this.getFloatArray(map, "uvs", 1); - mesh.updateUVs(); - - color = map["color"]; - if (color) { - mesh.r = this.toColor(color, 0); - mesh.g = this.toColor(color, 1); - mesh.b = this.toColor(color, 2); - mesh.a = this.toColor(color, 3); - } - - mesh.hullLength = (map["hull"] || 0) * 2; - if (map["edges"]) mesh.edges = this.getIntArray(map, "edges"); - mesh.width = (map["width"] || 0) * scale; - mesh.height = (map["height"] || 0) * scale; - return mesh; - } else if (type == spine.AttachmentType.skinnedmesh) { - var mesh = this.attachmentLoader.newSkinnedMeshAttachment(skin, name, path); - if (!mesh) return null; - mesh.path = path; - - var uvs = this.getFloatArray(map, "uvs", 1); - var vertices = this.getFloatArray(map, "vertices", 1); - var weights = []; - var bones = []; - for (var i = 0, n = vertices.length; i < n; ) { - var boneCount = vertices[i++] | 0; - bones[bones.length] = boneCount; - for (var nn = i + boneCount * 4; i < nn; ) { - bones[bones.length] = vertices[i]; - weights[weights.length] = vertices[i + 1] * scale; - weights[weights.length] = vertices[i + 2] * scale; - weights[weights.length] = vertices[i + 3]; - i += 4; - } - } - mesh.bones = bones; - mesh.weights = weights; - mesh.triangles = this.getIntArray(map, "triangles"); - mesh.regionUVs = uvs; - mesh.updateUVs(); - - color = map["color"]; - if (color) { - mesh.r = this.toColor(color, 0); - mesh.g = this.toColor(color, 1); - mesh.b = this.toColor(color, 2); - mesh.a = this.toColor(color, 3); - } - - mesh.hullLength = (map["hull"] || 0) * 2; - if (map["edges"]) mesh.edges = this.getIntArray(map, "edges"); - mesh.width = (map["width"] || 0) * scale; - mesh.height = (map["height"] || 0) * scale; - return mesh; - } else if (type == spine.AttachmentType.boundingbox) { - var attachment = this.attachmentLoader.newBoundingBoxAttachment(skin, name); - var vertices = map["vertices"]; - for (var i = 0, n = vertices.length; i < n; i++) - attachment.vertices.push(vertices[i] * scale); - return attachment; - } - throw "Unknown attachment type: " + type; - }, - readAnimation: function (name, map, skeletonData) { - var timelines = []; - var duration = 0; - - var slots = map["slots"]; - for (var slotName in slots) { - if (!slots.hasOwnProperty(slotName)) continue; - var slotMap = slots[slotName]; - var slotIndex = skeletonData.findSlotIndex(slotName); - - for (var timelineName in slotMap) { - if (!slotMap.hasOwnProperty(timelineName)) continue; - var values = slotMap[timelineName]; - if (timelineName == "color") { - var timeline = new spine.ColorTimeline(values.length); - timeline.slotIndex = slotIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var color = valueMap["color"]; - var r = this.toColor(color, 0); - var g = this.toColor(color, 1); - var b = this.toColor(color, 2); - var a = this.toColor(color, 3); - timeline.setFrame(frameIndex, valueMap["time"], r, g, b, a); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 5 - 5]); - - } else if (timelineName == "attachment") { - var timeline = new spine.AttachmentTimeline(values.length); - timeline.slotIndex = slotIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex++, valueMap["time"], valueMap["name"]); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - - } else - throw "Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")"; - } - } - - var bones = map["bones"]; - for (var boneName in bones) { - if (!bones.hasOwnProperty(boneName)) continue; - var boneIndex = skeletonData.findBoneIndex(boneName); - if (boneIndex == -1) throw "Bone not found: " + boneName; - var boneMap = bones[boneName]; - - for (var timelineName in boneMap) { - if (!boneMap.hasOwnProperty(timelineName)) continue; - var values = boneMap[timelineName]; - if (timelineName == "rotate") { - var timeline = new spine.RotateTimeline(values.length); - timeline.boneIndex = boneIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex, valueMap["time"], valueMap["angle"]); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 2 - 2]); - - } else if (timelineName == "translate" || timelineName == "scale") { - var timeline; - var timelineScale = 1; - if (timelineName == "scale") - timeline = new spine.ScaleTimeline(values.length); - else { - timeline = new spine.TranslateTimeline(values.length); - timelineScale = this.scale; - } - timeline.boneIndex = boneIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var x = (valueMap["x"] || 0) * timelineScale; - var y = (valueMap["y"] || 0) * timelineScale; - timeline.setFrame(frameIndex, valueMap["time"], x, y); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 3 - 3]); - - } else if (timelineName == "flipX" || timelineName == "flipY") { - var x = timelineName == "flipX"; - var timeline = x ? new spine.FlipXTimeline(values.length) : new spine.FlipYTimeline(values.length); - timeline.boneIndex = boneIndex; - - var field = x ? "x" : "y"; - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex, valueMap["time"], valueMap[field] || false); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 2 - 2]); - } else - throw "Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")"; - } - } - - var ikMap = map["ik"]; - for (var ikConstraintName in ikMap) { - if (!ikMap.hasOwnProperty(ikConstraintName)) continue; - var ikConstraint = skeletonData.findIkConstraint(ikConstraintName); - var values = ikMap[ikConstraintName]; - var timeline = new spine.IkConstraintTimeline(values.length); - timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(ikConstraint); - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var mix = valueMap.hasOwnProperty("mix") ? valueMap["mix"] : 1; - var bendDirection = (!valueMap.hasOwnProperty("bendPositive") || valueMap["bendPositive"]) ? 1 : -1; - timeline.setFrame(frameIndex, valueMap["time"], mix, bendDirection); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.frameCount * 3 - 3]); - } - - var ffd = map["ffd"]; - for (var skinName in ffd) { - var skin = skeletonData.findSkin(skinName); - var slotMap = ffd[skinName]; - for (slotName in slotMap) { - var slotIndex = skeletonData.findSlotIndex(slotName); - var meshMap = slotMap[slotName]; - for (var meshName in meshMap) { - var values = meshMap[meshName]; - var timeline = new spine.FfdTimeline(values.length); - var attachment = skin.getAttachment(slotIndex, meshName); - if (!attachment) throw "FFD attachment not found: " + meshName; - timeline.slotIndex = slotIndex; - timeline.attachment = attachment; - - var isMesh = attachment.type == spine.AttachmentType.mesh; - var vertexCount; - if (isMesh) - vertexCount = attachment.vertices.length; - else - vertexCount = attachment.weights.length / 3 * 2; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var vertices; - if (!valueMap["vertices"]) { - if (isMesh) - vertices = attachment.vertices; - else { - vertices = []; - vertices.length = vertexCount; - } - } else { - var verticesValue = valueMap["vertices"]; - var vertices = []; - vertices.length = vertexCount; - var start = valueMap["offset"] || 0; - var nn = verticesValue.length; - if (this.scale == 1) { - for (var ii = 0; ii < nn; ii++) - vertices[ii + start] = verticesValue[ii]; - } else { - for (var ii = 0; ii < nn; ii++) - vertices[ii + start] = verticesValue[ii] * this.scale; - } - if (isMesh) { - var meshVertices = attachment.vertices; - for (var ii = 0, nn = vertices.length; ii < nn; ii++) - vertices[ii] += meshVertices[ii]; - } - } - - timeline.setFrame(frameIndex, valueMap["time"], vertices); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines[timelines.length] = timeline; - duration = Math.max(duration, timeline.frames[timeline.frameCount - 1]); - } - } - } - - var drawOrderValues = map["drawOrder"]; - if (!drawOrderValues) drawOrderValues = map["draworder"]; - if (drawOrderValues) { - var timeline = new spine.DrawOrderTimeline(drawOrderValues.length); - var slotCount = skeletonData.slots.length; - var frameIndex = 0; - for (var i = 0, n = drawOrderValues.length; i < n; i++) { - var drawOrderMap = drawOrderValues[i]; - var drawOrder = null; - if (drawOrderMap["offsets"]) { - drawOrder = []; - drawOrder.length = slotCount; - for (var ii = slotCount - 1; ii >= 0; ii--) - drawOrder[ii] = -1; - var offsets = drawOrderMap["offsets"]; - var unchanged = []; - unchanged.length = slotCount - offsets.length; - var originalIndex = 0, unchangedIndex = 0; - for (var ii = 0, nn = offsets.length; ii < nn; ii++) { - var offsetMap = offsets[ii]; - var slotIndex = skeletonData.findSlotIndex(offsetMap["slot"]); - if (slotIndex == -1) throw "Slot not found: " + offsetMap["slot"]; - // Collect unchanged items. - while (originalIndex != slotIndex) - unchanged[unchangedIndex++] = originalIndex++; - // Set changed items. - drawOrder[originalIndex + offsetMap["offset"]] = originalIndex++; - } - // Collect remaining unchanged items. - while (originalIndex < slotCount) - unchanged[unchangedIndex++] = originalIndex++; - // Fill in unchanged items. - for (var ii = slotCount - 1; ii >= 0; ii--) - if (drawOrder[ii] == -1) drawOrder[ii] = unchanged[--unchangedIndex]; - } - timeline.setFrame(frameIndex++, drawOrderMap["time"], drawOrder); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - - var events = map["events"]; - if (events) { - var timeline = new spine.EventTimeline(events.length); - var frameIndex = 0; - for (var i = 0, n = events.length; i < n; i++) { - var eventMap = events[i]; - var eventData = skeletonData.findEvent(eventMap["name"]); - if (!eventData) throw "Event not found: " + eventMap["name"]; - var event = new spine.Event(eventData); - event.intValue = eventMap.hasOwnProperty("int") ? eventMap["int"] : eventData.intValue; - event.floatValue = eventMap.hasOwnProperty("float") ? eventMap["float"] : eventData.floatValue; - event.stringValue = eventMap.hasOwnProperty("string") ? eventMap["string"] : eventData.stringValue; - timeline.setFrame(frameIndex++, eventMap["time"], event); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - - skeletonData.animations.push(new spine.Animation(name, timelines, duration)); - }, - readCurve: function (timeline, frameIndex, valueMap) { - var curve = valueMap["curve"]; - if (!curve) - timeline.curves.setLinear(frameIndex); - else if (curve == "stepped") - timeline.curves.setStepped(frameIndex); - else if (curve instanceof Array) - timeline.curves.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]); - }, - toColor: function (hexString, colorIndex) { - if (hexString.length != 8) throw "Color hexidecimal length must be 8, recieved: " + hexString; - return parseInt(hexString.substring(colorIndex * 2, (colorIndex * 2) + 2), 16) / 255; - }, - getFloatArray: function (map, name, scale) { - var list = map[name]; - var values = new spine.Float32Array(list.length); - var i = 0, n = list.length; - if (scale == 1) { - for (; i < n; i++) - values[i] = list[i]; - } else { - for (; i < n; i++) - values[i] = list[i] * scale; - } - return values; - }, - getIntArray: function (map, name) { - var list = map[name]; - var values = new spine.Uint16Array(list.length); - for (var i = 0, n = list.length; i < n; i++) - values[i] = list[i] | 0; - return values; - } -}; - -spine.Atlas = function (atlasText, textureLoader) { - this.textureLoader = textureLoader; - this.pages = []; - this.regions = []; - - var reader = new spine.AtlasReader(atlasText); - var tuple = []; - tuple.length = 4; - var page = null; - while (true) { - var line = reader.readLine(); - if (line === null) break; - line = reader.trim(line); - if (!line.length) - page = null; - else if (!page) { - page = new spine.AtlasPage(); - page.name = line; - - if (reader.readTuple(tuple) == 2) { // size is only optional for an atlas packed with an old TexturePacker. - page.width = parseInt(tuple[0]); - page.height = parseInt(tuple[1]); - reader.readTuple(tuple); - } - page.format = spine.Atlas.Format[tuple[0]]; - - reader.readTuple(tuple); - page.minFilter = spine.Atlas.TextureFilter[tuple[0]]; - page.magFilter = spine.Atlas.TextureFilter[tuple[1]]; - - var direction = reader.readValue(); - page.uWrap = spine.Atlas.TextureWrap.clampToEdge; - page.vWrap = spine.Atlas.TextureWrap.clampToEdge; - if (direction == "x") - page.uWrap = spine.Atlas.TextureWrap.repeat; - else if (direction == "y") - page.vWrap = spine.Atlas.TextureWrap.repeat; - else if (direction == "xy") - page.uWrap = page.vWrap = spine.Atlas.TextureWrap.repeat; - - textureLoader.load(page, line, this); - - this.pages.push(page); - - } else { - var region = new spine.AtlasRegion(); - region.name = line; - region.page = page; - - region.rotate = reader.readValue() == "true"; - - reader.readTuple(tuple); - var x = parseInt(tuple[0]); - var y = parseInt(tuple[1]); - - reader.readTuple(tuple); - var width = parseInt(tuple[0]); - var height = parseInt(tuple[1]); - - region.u = x / page.width; - region.v = y / page.height; - if (region.rotate) { - region.u2 = (x + height) / page.width; - region.v2 = (y + width) / page.height; - } else { - region.u2 = (x + width) / page.width; - region.v2 = (y + height) / page.height; - } - region.x = x; - region.y = y; - region.width = Math.abs(width); - region.height = Math.abs(height); - - if (reader.readTuple(tuple) == 4) { // split is optional - region.splits = [parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3])]; - - if (reader.readTuple(tuple) == 4) { // pad is optional, but only present with splits - region.pads = [parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3])]; - - reader.readTuple(tuple); - } - } - - region.originalWidth = parseInt(tuple[0]); - region.originalHeight = parseInt(tuple[1]); - - reader.readTuple(tuple); - region.offsetX = parseInt(tuple[0]); - region.offsetY = parseInt(tuple[1]); - - region.index = parseInt(reader.readValue()); - - this.regions.push(region); - } - } -}; -spine.Atlas.prototype = { - findRegion: function (name) { - var regions = this.regions; - for (var i = 0, n = regions.length; i < n; i++) - if (regions[i].name == name) return regions[i]; - return null; - }, - dispose: function () { - var pages = this.pages; - for (var i = 0, n = pages.length; i < n; i++) - this.textureLoader.unload(pages[i].rendererObject); - }, - updateUVs: function (page) { - var regions = this.regions; - for (var i = 0, n = regions.length; i < n; i++) { - var region = regions[i]; - if (region.page != page) continue; - region.u = region.x / page.width; - region.v = region.y / page.height; - if (region.rotate) { - region.u2 = (region.x + region.height) / page.width; - region.v2 = (region.y + region.width) / page.height; - } else { - region.u2 = (region.x + region.width) / page.width; - region.v2 = (region.y + region.height) / page.height; - } - } - } -}; - -spine.Atlas.Format = { - alpha: 0, - intensity: 1, - luminanceAlpha: 2, - rgb565: 3, - rgba4444: 4, - rgb888: 5, - rgba8888: 6 -}; - -spine.Atlas.TextureFilter = { - nearest: 0, - linear: 1, - mipMap: 2, - mipMapNearestNearest: 3, - mipMapLinearNearest: 4, - mipMapNearestLinear: 5, - mipMapLinearLinear: 6 -}; - -spine.Atlas.TextureWrap = { - mirroredRepeat: 0, - clampToEdge: 1, - repeat: 2 -}; - -spine.AtlasPage = function () {}; -spine.AtlasPage.prototype = { - name: null, - format: null, - minFilter: null, - magFilter: null, - uWrap: null, - vWrap: null, - rendererObject: null, - width: 0, - height: 0 -}; - -spine.AtlasRegion = function () {}; -spine.AtlasRegion.prototype = { - page: null, - name: null, - x: 0, y: 0, - width: 0, height: 0, - u: 0, v: 0, u2: 0, v2: 0, - offsetX: 0, offsetY: 0, - originalWidth: 0, originalHeight: 0, - index: 0, - rotate: false, - splits: null, - pads: null -}; - -spine.AtlasReader = function (text) { - this.lines = text.split(/\r\n|\r|\n/); -}; -spine.AtlasReader.prototype = { - index: 0, - trim: function (value) { - return value.replace(/^\s+|\s+$/g, ""); - }, - readLine: function () { - if (this.index >= this.lines.length) return null; - return this.lines[this.index++]; - }, - readValue: function () { - var line = this.readLine(); - var colon = line.indexOf(":"); - if (colon == -1) throw "Invalid line: " + line; - return this.trim(line.substring(colon + 1)); - }, - /** Returns the number of tuple values read (1, 2 or 4). */ - readTuple: function (tuple) { - var line = this.readLine(); - var colon = line.indexOf(":"); - if (colon == -1) throw "Invalid line: " + line; - var i = 0, lastMatch = colon + 1; - for (; i < 3; i++) { - var comma = line.indexOf(",", lastMatch); - if (comma == -1) break; - tuple[i] = this.trim(line.substr(lastMatch, comma - lastMatch)); - lastMatch = comma + 1; - } - tuple[i] = this.trim(line.substring(lastMatch)); - return i + 1; - } -}; - -spine.AtlasAttachmentLoader = function (atlas) { - this.atlas = atlas; -}; -spine.AtlasAttachmentLoader.prototype = { - newRegionAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (region attachment: " + name + ")"; - var attachment = new spine.RegionAttachment(name); - attachment.rendererObject = region; - attachment.setUVs(region.u, region.v, region.u2, region.v2, region.rotate); - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newMeshAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (mesh attachment: " + name + ")"; - var attachment = new spine.MeshAttachment(name); - attachment.rendererObject = region; - attachment.regionU = region.u; - attachment.regionV = region.v; - attachment.regionU2 = region.u2; - attachment.regionV2 = region.v2; - attachment.regionRotate = region.rotate; - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newSkinnedMeshAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (skinned mesh attachment: " + name + ")"; - var attachment = new spine.SkinnedMeshAttachment(name); - attachment.rendererObject = region; - attachment.regionU = region.u; - attachment.regionV = region.v; - attachment.regionU2 = region.u2; - attachment.regionV2 = region.v2; - attachment.regionRotate = region.rotate; - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newBoundingBoxAttachment: function (skin, name) { - return new spine.BoundingBoxAttachment(name); - } -}; - -spine.SkeletonBounds = function () { - this.polygonPool = []; - this.polygons = []; - this.boundingBoxes = []; -}; -spine.SkeletonBounds.prototype = { - minX: 0, minY: 0, maxX: 0, maxY: 0, - update: function (skeleton, updateAabb) { - var slots = skeleton.slots; - var slotCount = slots.length; - var x = skeleton.x, y = skeleton.y; - var boundingBoxes = this.boundingBoxes; - var polygonPool = this.polygonPool; - var polygons = this.polygons; - - boundingBoxes.length = 0; - for (var i = 0, n = polygons.length; i < n; i++) - polygonPool.push(polygons[i]); - polygons.length = 0; - - for (var i = 0; i < slotCount; i++) { - var slot = slots[i]; - var boundingBox = slot.attachment; - if (boundingBox.type != spine.AttachmentType.boundingbox) continue; - boundingBoxes.push(boundingBox); - - var poolCount = polygonPool.length, polygon; - if (poolCount > 0) { - polygon = polygonPool[poolCount - 1]; - polygonPool.splice(poolCount - 1, 1); - } else - polygon = []; - polygons.push(polygon); - - polygon.length = boundingBox.vertices.length; - boundingBox.computeWorldVertices(x, y, slot.bone, polygon); - } - - if (updateAabb) this.aabbCompute(); - }, - aabbCompute: function () { - var polygons = this.polygons; - var minX = Number.MAX_VALUE, minY = Number.MAX_VALUE, maxX = Number.MIN_VALUE, maxY = Number.MIN_VALUE; - for (var i = 0, n = polygons.length; i < n; i++) { - var vertices = polygons[i]; - for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) { - var x = vertices[ii]; - var y = vertices[ii + 1]; - minX = Math.min(minX, x); - minY = Math.min(minY, y); - maxX = Math.max(maxX, x); - maxY = Math.max(maxY, y); - } - } - this.minX = minX; - this.minY = minY; - this.maxX = maxX; - this.maxY = maxY; - }, - /** Returns true if the axis aligned bounding box contains the point. */ - aabbContainsPoint: function (x, y) { - return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY; - }, - /** Returns true if the axis aligned bounding box intersects the line segment. */ - aabbIntersectsSegment: function (x1, y1, x2, y2) { - var minX = this.minX, minY = this.minY, maxX = this.maxX, maxY = this.maxY; - if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY)) - return false; - var m = (y2 - y1) / (x2 - x1); - var y = m * (minX - x1) + y1; - if (y > minY && y < maxY) return true; - y = m * (maxX - x1) + y1; - if (y > minY && y < maxY) return true; - var x = (minY - y1) / m + x1; - if (x > minX && x < maxX) return true; - x = (maxY - y1) / m + x1; - if (x > minX && x < maxX) return true; - return false; - }, - /** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */ - aabbIntersectsSkeleton: function (bounds) { - return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY; - }, - /** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more - * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */ - containsPoint: function (x, y) { - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) - if (this.polygonContainsPoint(polygons[i], x, y)) return this.boundingBoxes[i]; - return null; - }, - /** Returns the first bounding box attachment that contains the line segment, or null. When doing many checks, it is usually - * more efficient to only call this method if {@link #aabbIntersectsSegment(float, float, float, float)} returns true. */ - intersectsSegment: function (x1, y1, x2, y2) { - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) - if (polygons[i].intersectsSegment(x1, y1, x2, y2)) return this.boundingBoxes[i]; - return null; - }, - /** Returns true if the polygon contains the point. */ - polygonContainsPoint: function (polygon, x, y) { - var nn = polygon.length; - var prevIndex = nn - 2; - var inside = false; - for (var ii = 0; ii < nn; ii += 2) { - var vertexY = polygon[ii + 1]; - var prevY = polygon[prevIndex + 1]; - if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) { - var vertexX = polygon[ii]; - if (vertexX + (y - vertexY) / (prevY - vertexY) * (polygon[prevIndex] - vertexX) < x) inside = !inside; - } - prevIndex = ii; - } - return inside; - }, - /** Returns true if the polygon contains the line segment. */ - polygonIntersectsSegment: function (polygon, x1, y1, x2, y2) { - var nn = polygon.length; - var width12 = x1 - x2, height12 = y1 - y2; - var det1 = x1 * y2 - y1 * x2; - var x3 = polygon[nn - 2], y3 = polygon[nn - 1]; - for (var ii = 0; ii < nn; ii += 2) { - var x4 = polygon[ii], y4 = polygon[ii + 1]; - var det2 = x3 * y4 - y3 * x4; - var width34 = x3 - x4, height34 = y3 - y4; - var det3 = width12 * height34 - height12 * width34; - var x = (det1 * width34 - width12 * det2) / det3; - if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) { - var y = (det1 * height34 - height12 * det2) / det3; - if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) return true; - } - x3 = x4; - y3 = y4; - } - return false; - }, - getPolygon: function (attachment) { - var index = this.boundingBoxes.indexOf(attachment); - return index == -1 ? null : this.polygons[index]; - }, - getWidth: function () { - return this.maxX - this.minX; - }, - getHeight: function () { - return this.maxY - this.minY; - } -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/extras/Strip.js b/tutorial-1/pixi.js-master/src/pixi/extras/Strip.js deleted file mode 100755 index 6cff5df..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/extras/Strip.js +++ /dev/null @@ -1,469 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ - */ - - /** - * - * @class Strip - * @extends DisplayObjectContainer - * @constructor - * @param texture {Texture} The texture to use - * @param width {Number} the width - * @param height {Number} the height - * - */ -PIXI.Strip = function(texture) -{ - PIXI.DisplayObjectContainer.call( this ); - - - /** - * The texture of the strip - * - * @property texture - * @type Texture - */ - this.texture = texture; - - // set up the main bits.. - this.uvs = new PIXI.Float32Array([0, 1, - 1, 1, - 1, 0, - 0, 1]); - - this.vertices = new PIXI.Float32Array([0, 0, - 100, 0, - 100, 100, - 0, 100]); - - this.colors = new PIXI.Float32Array([1, 1, 1, 1]); - - this.indices = new PIXI.Uint16Array([0, 1, 2, 3]); - - /** - * Whether the strip is dirty or not - * - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode. - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - /** - * Triangles in canvas mode are automatically antialiased, use this value to force triangles to overlap a bit with each other. - * - * @property canvasPadding - * @type Number - */ - this.canvasPadding = 0; - - this.drawMode = PIXI.Strip.DrawModes.TRIANGLE_STRIP; - -}; - -// constructor -PIXI.Strip.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); -PIXI.Strip.prototype.constructor = PIXI.Strip; - -PIXI.Strip.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(!this.visible || this.alpha <= 0)return; - // render triangle strip.. - - renderSession.spriteBatch.stop(); - - // init! init! - if(!this._vertexBuffer)this._initWebGL(renderSession); - - renderSession.shaderManager.setShader(renderSession.shaderManager.stripShader); - - this._renderStrip(renderSession); - - ///renderSession.shaderManager.activateDefaultShader(); - - renderSession.spriteBatch.start(); - - //TODO check culling -}; - -PIXI.Strip.prototype._initWebGL = function(renderSession) -{ - // build the strip! - var gl = renderSession.gl; - - this._vertexBuffer = gl.createBuffer(); - this._indexBuffer = gl.createBuffer(); - this._uvBuffer = gl.createBuffer(); - this._colorBuffer = gl.createBuffer(); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvs, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._colorBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.colors, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); -}; - -PIXI.Strip.prototype._renderStrip = function(renderSession) -{ - var gl = renderSession.gl; - var projection = renderSession.projection, - offset = renderSession.offset, - shader = renderSession.shaderManager.stripShader; - - var drawMode = this.drawMode === PIXI.Strip.DrawModes.TRIANGLE_STRIP ? gl.TRIANGLE_STRIP : gl.TRIANGLES; - - // gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mat4Real); - - renderSession.blendModeManager.setBlendMode(this.blendMode); - - - // set uniforms - gl.uniformMatrix3fv(shader.translationMatrix, false, this.worldTransform.toArray(true)); - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - gl.uniform1f(shader.alpha, this.worldAlpha); - - if(!this.dirty) - { - - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - // update the uvs - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.activeTexture(gl.TEXTURE0); - - // check if a texture is dirty.. - if(this.texture.baseTexture._dirty[gl.id]) - { - renderSession.renderer.updateTexture(this.texture.baseTexture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]); - } - - // dont need to upload! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - - - } - else - { - - this.dirty = false; - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.STATIC_DRAW); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - // update the uvs - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvs, gl.STATIC_DRAW); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.activeTexture(gl.TEXTURE0); - - // check if a texture is dirty.. - if(this.texture.baseTexture._dirty[gl.id]) - { - renderSession.renderer.updateTexture(this.texture.baseTexture); - } - else - { - gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]); - } - - // dont need to upload! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - } - //console.log(gl.TRIANGLE_STRIP) - // - // - gl.drawElements(drawMode, this.indices.length, gl.UNSIGNED_SHORT, 0); - - -}; - - - -PIXI.Strip.prototype._renderCanvas = function(renderSession) -{ - var context = renderSession.context; - - var transform = this.worldTransform; - - if (renderSession.roundPixels) - { - context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx | 0, transform.ty | 0); - } - else - { - context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty); - } - - if (this.drawMode === PIXI.Strip.DrawModes.TRIANGLE_STRIP) - { - this._renderCanvasTriangleStrip(context); - } - else - { - this._renderCanvasTriangles(context); - } -}; - -PIXI.Strip.prototype._renderCanvasTriangleStrip = function(context) -{ - // draw triangles!! - var vertices = this.vertices; - var uvs = this.uvs; - - var length = vertices.length / 2; - this.count++; - - for (var i = 0; i < length - 2; i++) { - // draw some triangles! - var index = i * 2; - this._renderCanvasDrawTriangle(context, vertices, uvs, index, (index + 2), (index + 4)); - } -}; - -PIXI.Strip.prototype._renderCanvasTriangles = function(context) -{ - // draw triangles!! - var vertices = this.vertices; - var uvs = this.uvs; - var indices = this.indices; - - var length = indices.length; - this.count++; - - for (var i = 0; i < length; i += 3) { - // draw some triangles! - var index0 = indices[i] * 2, index1 = indices[i + 1] * 2, index2 = indices[i + 2] * 2; - this._renderCanvasDrawTriangle(context, vertices, uvs, index0, index1, index2); - } -}; - -PIXI.Strip.prototype._renderCanvasDrawTriangle = function(context, vertices, uvs, index0, index1, index2) -{ - var textureSource = this.texture.baseTexture.source; - var textureWidth = this.texture.width; - var textureHeight = this.texture.height; - - var x0 = vertices[index0], x1 = vertices[index1], x2 = vertices[index2]; - var y0 = vertices[index0 + 1], y1 = vertices[index1 + 1], y2 = vertices[index2 + 1]; - - var u0 = uvs[index0] * textureWidth, u1 = uvs[index1] * textureWidth, u2 = uvs[index2] * textureWidth; - var v0 = uvs[index0 + 1] * textureHeight, v1 = uvs[index1 + 1] * textureHeight, v2 = uvs[index2 + 1] * textureHeight; - - if (this.canvasPadding > 0) { - var paddingX = this.canvasPadding / this.worldTransform.a; - var paddingY = this.canvasPadding / this.worldTransform.d; - var centerX = (x0 + x1 + x2) / 3; - var centerY = (y0 + y1 + y2) / 3; - - var normX = x0 - centerX; - var normY = y0 - centerY; - - var dist = Math.sqrt(normX * normX + normY * normY); - x0 = centerX + (normX / dist) * (dist + paddingX); - y0 = centerY + (normY / dist) * (dist + paddingY); - - // - - normX = x1 - centerX; - normY = y1 - centerY; - - dist = Math.sqrt(normX * normX + normY * normY); - x1 = centerX + (normX / dist) * (dist + paddingX); - y1 = centerY + (normY / dist) * (dist + paddingY); - - normX = x2 - centerX; - normY = y2 - centerY; - - dist = Math.sqrt(normX * normX + normY * normY); - x2 = centerX + (normX / dist) * (dist + paddingX); - y2 = centerY + (normY / dist) * (dist + paddingY); - } - - context.save(); - context.beginPath(); - - - context.moveTo(x0, y0); - context.lineTo(x1, y1); - context.lineTo(x2, y2); - - context.closePath(); - - context.clip(); - - // Compute matrix transform - var delta = (u0 * v1) + (v0 * u2) + (u1 * v2) - (v1 * u2) - (v0 * u1) - (u0 * v2); - var deltaA = (x0 * v1) + (v0 * x2) + (x1 * v2) - (v1 * x2) - (v0 * x1) - (x0 * v2); - var deltaB = (u0 * x1) + (x0 * u2) + (u1 * x2) - (x1 * u2) - (x0 * u1) - (u0 * x2); - var deltaC = (u0 * v1 * x2) + (v0 * x1 * u2) + (x0 * u1 * v2) - (x0 * v1 * u2) - (v0 * u1 * x2) - (u0 * x1 * v2); - var deltaD = (y0 * v1) + (v0 * y2) + (y1 * v2) - (v1 * y2) - (v0 * y1) - (y0 * v2); - var deltaE = (u0 * y1) + (y0 * u2) + (u1 * y2) - (y1 * u2) - (y0 * u1) - (u0 * y2); - var deltaF = (u0 * v1 * y2) + (v0 * y1 * u2) + (y0 * u1 * v2) - (y0 * v1 * u2) - (v0 * u1 * y2) - (u0 * y1 * v2); - - context.transform(deltaA / delta, deltaD / delta, - deltaB / delta, deltaE / delta, - deltaC / delta, deltaF / delta); - - context.drawImage(textureSource, 0, 0); - context.restore(); -}; - - - -/** - * Renders a flat strip - * - * @method renderStripFlat - * @param strip {Strip} The Strip to render - * @private - */ -PIXI.Strip.prototype.renderStripFlat = function(strip) -{ - var context = this.context; - var vertices = strip.vertices; - - var length = vertices.length/2; - this.count++; - - context.beginPath(); - for (var i=1; i < length-2; i++) - { - // draw some triangles! - var index = i*2; - - var x0 = vertices[index], x1 = vertices[index+2], x2 = vertices[index+4]; - var y0 = vertices[index+1], y1 = vertices[index+3], y2 = vertices[index+5]; - - context.moveTo(x0, y0); - context.lineTo(x1, y1); - context.lineTo(x2, y2); - } - - context.fillStyle = '#FF0000'; - context.fill(); - context.closePath(); -}; - -/* -PIXI.Strip.prototype.setTexture = function(texture) -{ - //TODO SET THE TEXTURES - //TODO VISIBILITY - - // stop current texture - this.texture = texture; - this.width = texture.frame.width; - this.height = texture.frame.height; - this.updateFrame = true; -}; -*/ - -/** - * When the texture is updated, this event will fire to update the scale and frame - * - * @method onTextureUpdate - * @param event - * @private - */ - -PIXI.Strip.prototype.onTextureUpdate = function() -{ - this.updateFrame = true; -}; - -/** - * Returns the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account. - * - * @method getBounds - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle - */ -PIXI.Strip.prototype.getBounds = function(matrix) -{ - var worldTransform = matrix || this.worldTransform; - - var a = worldTransform.a; - var b = worldTransform.b; - var c = worldTransform.c; - var d = worldTransform.d; - var tx = worldTransform.tx; - var ty = worldTransform.ty; - - var maxX = -Infinity; - var maxY = -Infinity; - - var minX = Infinity; - var minY = Infinity; - - var vertices = this.vertices; - for (var i = 0, n = vertices.length; i < n; i += 2) - { - var rawX = vertices[i], rawY = vertices[i + 1]; - var x = (a * rawX) + (c * rawY) + tx; - var y = (d * rawY) + (b * rawX) + ty; - - minX = x < minX ? x : minX; - minY = y < minY ? y : minY; - - maxX = x > maxX ? x : maxX; - maxY = y > maxY ? y : maxY; - } - - if (minX === -Infinity || maxY === Infinity) - { - return PIXI.EmptyRectangle; - } - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - -/** - * Different drawing buffer modes supported - * - * @property - * @type {{TRIANGLE_STRIP: number, TRIANGLES: number}} - * @static - */ -PIXI.Strip.DrawModes = { - TRIANGLE_STRIP: 0, - TRIANGLES: 1 -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/extras/TilingSprite.js b/tutorial-1/pixi.js-master/src/pixi/extras/TilingSprite.js deleted file mode 100755 index 2ad39d2..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/extras/TilingSprite.js +++ /dev/null @@ -1,485 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * A tiling sprite is a fast way of rendering a tiling image - * - * @class TilingSprite - * @extends Sprite - * @constructor - * @param texture {Texture} the texture of the tiling sprite - * @param width {Number} the width of the tiling sprite - * @param height {Number} the height of the tiling sprite - */ -PIXI.TilingSprite = function(texture, width, height) -{ - PIXI.Sprite.call( this, texture); - - /** - * The with of the tiling sprite - * - * @property width - * @type Number - */ - this._width = width || 100; - - /** - * The height of the tiling sprite - * - * @property height - * @type Number - */ - this._height = height || 100; - - /** - * The scaling of the image that is being tiled - * - * @property tileScale - * @type Point - */ - this.tileScale = new PIXI.Point(1,1); - - /** - * A point that represents the scale of the texture object - * - * @property tileScaleOffset - * @type Point - */ - this.tileScaleOffset = new PIXI.Point(1,1); - - /** - * The offset position of the image that is being tiled - * - * @property tilePosition - * @type Point - */ - this.tilePosition = new PIXI.Point(0,0); - - /** - * Whether this sprite is renderable or not - * - * @property renderable - * @type Boolean - * @default true - */ - this.renderable = true; - - /** - * The tint applied to the sprite. This is a hex value - * - * @property tint - * @type Number - * @default 0xFFFFFF - */ - this.tint = 0xFFFFFF; - - /** - * The blend mode to be applied to the sprite - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - - -}; - -// constructor -PIXI.TilingSprite.prototype = Object.create(PIXI.Sprite.prototype); -PIXI.TilingSprite.prototype.constructor = PIXI.TilingSprite; - - -/** - * The width of the sprite, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.TilingSprite.prototype, 'width', { - get: function() { - return this._width; - }, - set: function(value) { - - this._width = value; - } -}); - -/** - * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.TilingSprite.prototype, 'height', { - get: function() { - return this._height; - }, - set: function(value) { - this._height = value; - } -}); - -PIXI.TilingSprite.prototype.setTexture = function(texture) -{ - if (this.texture === texture) return; - - this.texture = texture; - - this.refreshTexture = true; - - this.cachedTint = 0xFFFFFF; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.TilingSprite.prototype._renderWebGL = function(renderSession) -{ - if (this.visible === false || this.alpha === 0) return; - var i,j; - - if (this._mask) - { - renderSession.spriteBatch.stop(); - renderSession.maskManager.pushMask(this.mask, renderSession); - renderSession.spriteBatch.start(); - } - - if (this._filters) - { - renderSession.spriteBatch.flush(); - renderSession.filterManager.pushFilter(this._filterBlock); - } - - - - if (!this.tilingTexture || this.refreshTexture) - { - this.generateTilingTexture(true); - - if (this.tilingTexture && this.tilingTexture.needsUpdate) - { - //TODO - tweaking - renderSession.renderer.updateTexture(this.tilingTexture.baseTexture); - this.tilingTexture.needsUpdate = false; - // this.tilingTexture._uvs = null; - } - } - else - { - renderSession.spriteBatch.renderTilingSprite(this); - } - // simple render children! - for (i=0,j=this.children.length; i maxX ? x1 : maxX; - maxX = x2 > maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y1 > maxY ? y1 : maxY; - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - - - -/** - * When the texture is updated, this event will fire to update the scale and frame - * - * @method onTextureUpdate - * @param event - * @private - */ -PIXI.TilingSprite.prototype.onTextureUpdate = function() -{ - // overriding the sprite version of this! -}; - - -/** -* -* @method generateTilingTexture -* -* @param forcePowerOfTwo {Boolean} Whether we want to force the texture to be a power of two -*/ -PIXI.TilingSprite.prototype.generateTilingTexture = function(forcePowerOfTwo) -{ - if (!this.texture.baseTexture.hasLoaded) return; - - var texture = this.originalTexture || this.texture; - var frame = texture.frame; - var targetWidth, targetHeight; - - // Check that the frame is the same size as the base texture. - var isFrame = frame.width !== texture.baseTexture.width || frame.height !== texture.baseTexture.height; - - var newTextureRequired = false; - - if (!forcePowerOfTwo) - { - if (isFrame) - { - if (texture.trim) - { - targetWidth = texture.trim.width; - targetHeight = texture.trim.height; - } - else - { - targetWidth = frame.width; - targetHeight = frame.height; - } - - newTextureRequired = true; - } - } - else - { - targetWidth = PIXI.getNextPowerOfTwo(frame.width); - targetHeight = PIXI.getNextPowerOfTwo(frame.height); - - // If the BaseTexture dimensions don't match the texture frame then we need a new texture anyway because it's part of a texture atlas - if (frame.width !== targetWidth || frame.height !== targetHeight || texture.baseTexture.width !== targetWidth || texture.baseTexture.height || targetHeight) newTextureRequired = true; - } - - if (newTextureRequired) - { - var canvasBuffer; - - if (this.tilingTexture && this.tilingTexture.isTiling) - { - canvasBuffer = this.tilingTexture.canvasBuffer; - canvasBuffer.resize(targetWidth, targetHeight); - this.tilingTexture.baseTexture.width = targetWidth; - this.tilingTexture.baseTexture.height = targetHeight; - this.tilingTexture.needsUpdate = true; - } - else - { - canvasBuffer = new PIXI.CanvasBuffer(targetWidth, targetHeight); - - this.tilingTexture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); - this.tilingTexture.canvasBuffer = canvasBuffer; - this.tilingTexture.isTiling = true; - } - - canvasBuffer.context.drawImage(texture.baseTexture.source, - texture.crop.x, - texture.crop.y, - texture.crop.width, - texture.crop.height, - 0, - 0, - targetWidth, - targetHeight); - - this.tileScaleOffset.x = frame.width / targetWidth; - this.tileScaleOffset.y = frame.height / targetHeight; - } - else - { - // TODO - switching? - if (this.tilingTexture && this.tilingTexture.isTiling) - { - // destroy the tiling texture! - // TODO could store this somewhere? - this.tilingTexture.destroy(true); - } - - this.tileScaleOffset.x = 1; - this.tileScaleOffset.y = 1; - this.tilingTexture = texture; - } - - this.refreshTexture = false; - - this.originalTexture = this.texture; - this.texture = this.tilingTexture; - - this.tilingTexture.baseTexture._powerOf2 = true; -}; - -PIXI.TilingSprite.prototype.destroy = function () { - PIXI.Sprite.prototype.destroy.call(this); - - this.tileScale = null; - this.tileScaleOffset = null; - this.tilePosition = null; - - this.tilingTexture.destroy(true); - this.tilingTexture = null; -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/AbstractFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/AbstractFilter.js deleted file mode 100755 index 6727dc5..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/AbstractFilter.js +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This is the base class for creating a PIXI filter. Currently only webGL supports filters. - * If you want to make a custom filter this should be your base class. - * @class AbstractFilter - * @constructor - * @param fragmentSrc {Array} The fragment source in an array of strings. - * @param uniforms {Object} An object containing the uniforms for this filter. - */ -PIXI.AbstractFilter = function(fragmentSrc, uniforms) -{ - /** - * An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. - * For example the blur filter has two passes blurX and blurY. - * @property passes - * @type Array(Filter) - * @private - */ - this.passes = [this]; - - /** - * @property shaders - * @type Array(Shader) - * @private - */ - this.shaders = []; - - /** - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * @property padding - * @type Number - */ - this.padding = 0; - - /** - * @property uniforms - * @type object - * @private - */ - this.uniforms = uniforms || {}; - - /** - * @property fragmentSrc - * @type Array - * @private - */ - this.fragmentSrc = fragmentSrc || []; -}; - -PIXI.AbstractFilter.prototype.constructor = PIXI.AbstractFilter; - -/** - * Syncs the uniforms between the class object and the shaders. - * - * @method syncUniforms - */ -PIXI.AbstractFilter.prototype.syncUniforms = function() -{ - for(var i=0,j=this.shaders.length; i 0.2) n = 65600.0; // :', - ' if (gray > 0.3) n = 332772.0; // *', - ' if (gray > 0.4) n = 15255086.0; // o', - ' if (gray > 0.5) n = 23385164.0; // &', - ' if (gray > 0.6) n = 15252014.0; // 8', - ' if (gray > 0.7) n = 13199452.0; // @', - ' if (gray > 0.8) n = 11512810.0; // #', - - ' vec2 p = mod( uv / ( pixelSize * 0.5 ), 2.0) - vec2(1.0);', - ' col = col * character(n, p);', - - ' gl_FragColor = vec4(col, 1.0);', - '}' - ]; -}; - -PIXI.AsciiFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.AsciiFilter.prototype.constructor = PIXI.AsciiFilter; - -/** - * The pixel size used by the filter. - * - * @property size - * @type Number - */ -Object.defineProperty(PIXI.AsciiFilter.prototype, 'size', { - get: function() { - return this.uniforms.pixelSize.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.pixelSize.value = value; - } -}); \ No newline at end of file diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/BlurFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/BlurFilter.js deleted file mode 100755 index d93d147..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/BlurFilter.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The BlurFilter applies a Gaussian blur to an object. - * The strength of the blur can be set for x- and y-axis separately (always relative to the stage). - * - * @class BlurFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.BlurFilter = function() -{ - this.blurXFilter = new PIXI.BlurXFilter(); - this.blurYFilter = new PIXI.BlurYFilter(); - - this.passes =[this.blurXFilter, this.blurYFilter]; -}; - -PIXI.BlurFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.BlurFilter.prototype.constructor = PIXI.BlurFilter; - -/** - * Sets the strength of both the blurX and blurY properties simultaneously - * - * @property blur - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.BlurFilter.prototype, 'blur', { - get: function() { - return this.blurXFilter.blur; - }, - set: function(value) { - this.blurXFilter.blur = this.blurYFilter.blur = value; - } -}); - -/** - * Sets the strength of the blurX property - * - * @property blurX - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.BlurFilter.prototype, 'blurX', { - get: function() { - return this.blurXFilter.blur; - }, - set: function(value) { - this.blurXFilter.blur = value; - } -}); - -/** - * Sets the strength of the blurY property - * - * @property blurY - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.BlurFilter.prototype, 'blurY', { - get: function() { - return this.blurYFilter.blur; - }, - set: function(value) { - this.blurYFilter.blur = value; - } -}); diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/BlurXFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/BlurXFilter.js deleted file mode 100755 index 13f67c3..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/BlurXFilter.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The BlurXFilter applies a horizontal Gaussian blur to an object. - * - * @class BlurXFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.BlurXFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 1/512} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float blur;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' vec4 sum = vec4(0.0);', - - ' sum += texture2D(uSampler, vec2(vTextureCoord.x - 4.0*blur, vTextureCoord.y)) * 0.05;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x - 3.0*blur, vTextureCoord.y)) * 0.09;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x - 2.0*blur, vTextureCoord.y)) * 0.12;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x - blur, vTextureCoord.y)) * 0.15;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x + blur, vTextureCoord.y)) * 0.15;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x + 2.0*blur, vTextureCoord.y)) * 0.12;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x + 3.0*blur, vTextureCoord.y)) * 0.09;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x + 4.0*blur, vTextureCoord.y)) * 0.05;', - - ' gl_FragColor = sum;', - '}' - ]; -}; - -PIXI.BlurXFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.BlurXFilter.prototype.constructor = PIXI.BlurXFilter; - -/** - * Sets the strength of both the blur. - * - * @property blur - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.BlurXFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value / (1/7000); - }, - set: function(value) { - - this.dirty = true; - this.uniforms.blur.value = (1/7000) * value; - } -}); diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/BlurYFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/BlurYFilter.js deleted file mode 100755 index 5aecfef..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/BlurYFilter.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The BlurYFilter applies a vertical Gaussian blur to an object. - * - * @class BlurYFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.BlurYFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 1/512} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float blur;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' vec4 sum = vec4(0.0);', - - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 4.0*blur)) * 0.05;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 3.0*blur)) * 0.09;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 2.0*blur)) * 0.12;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - blur)) * 0.15;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + blur)) * 0.15;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 2.0*blur)) * 0.12;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 3.0*blur)) * 0.09;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 4.0*blur)) * 0.05;', - - ' gl_FragColor = sum;', - '}' - ]; -}; - -PIXI.BlurYFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.BlurYFilter.prototype.constructor = PIXI.BlurYFilter; - -/** - * Sets the strength of both the blur. - * - * @property blur - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.BlurYFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value / (1/7000); - }, - set: function(value) { - //this.padding = value; - this.uniforms.blur.value = (1/7000) * value; - } -}); diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/ColorMatrixFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/ColorMatrixFilter.js deleted file mode 100755 index 8f1dcbe..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/ColorMatrixFilter.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The ColorMatrixFilter class lets you apply a 4x4 matrix transformation on the RGBA - * color and alpha values of every pixel on your displayObject to produce a result - * with a new set of RGBA color and alpha values. It's pretty powerful! - * - * @class ColorMatrixFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.ColorMatrixFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - matrix: {type: 'mat4', value: [1,0,0,0, - 0,1,0,0, - 0,0,1,0, - 0,0,0,1]} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float invert;', - 'uniform mat4 matrix;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * matrix;', - // ' gl_FragColor = gl_FragColor;', - '}' - ]; -}; - -PIXI.ColorMatrixFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.ColorMatrixFilter.prototype.constructor = PIXI.ColorMatrixFilter; - -/** - * Sets the matrix of the color matrix filter - * - * @property matrix - * @type Array(Number) - * @default [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] - */ -Object.defineProperty(PIXI.ColorMatrixFilter.prototype, 'matrix', { - get: function() { - return this.uniforms.matrix.value; - }, - set: function(value) { - this.uniforms.matrix.value = value; - } -}); \ No newline at end of file diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/ColorStepFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/ColorStepFilter.js deleted file mode 100755 index 9481acd..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/ColorStepFilter.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This lowers the color depth of your image by the given amount, producing an image with a smaller palette. - * - * @class ColorStepFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.ColorStepFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - step: {type: '1f', value: 5} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'uniform float step;', - - 'void main(void) {', - ' vec4 color = texture2D(uSampler, vTextureCoord);', - ' color = floor(color * step) / step;', - ' gl_FragColor = color;', - '}' - ]; -}; - -PIXI.ColorStepFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.ColorStepFilter.prototype.constructor = PIXI.ColorStepFilter; - -/** - * The number of steps to reduce the palette by. - * - * @property step - * @type Number - */ -Object.defineProperty(PIXI.ColorStepFilter.prototype, 'step', { - get: function() { - return this.uniforms.step.value; - }, - set: function(value) { - this.uniforms.step.value = value; - } -}); diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/ConvolutionFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/ConvolutionFilter.js deleted file mode 100755 index 1d180d7..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/ConvolutionFilter.js +++ /dev/null @@ -1,106 +0,0 @@ -/** - * The ConvolutionFilter class applies a matrix convolution filter effect. - * A convolution combines pixels in the input image with neighboring pixels to produce a new image. - * A wide variety of image effects can be achieved through convolutions, including blurring, edge detection, sharpening, embossing, and beveling. - * The matrix should be specified as a 9 point Array. See http://docs.gimp.org/en/plug-in-convmatrix.html for more info. - * - * @class ConvolutionFilter - * @extends AbstractFilter - * @constructor - * @param matrix {Array} An array of values used for matrix transformation. Specified as a 9 point Array. - * @param width {Number} Width of the object you are transforming - * @param height {Number} Height of the object you are transforming - */ -PIXI.ConvolutionFilter = function(matrix, width, height) -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - m : {type: '1fv', value: new PIXI.Float32Array(matrix)}, - texelSizeX: {type: '1f', value: 1 / width}, - texelSizeY: {type: '1f', value: 1 / height} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying mediump vec2 vTextureCoord;', - 'uniform sampler2D texture;', - 'uniform float texelSizeX;', - 'uniform float texelSizeY;', - 'uniform float m[9];', - - 'vec2 px = vec2(texelSizeX, texelSizeY);', - - 'void main(void) {', - 'vec4 c11 = texture2D(texture, vTextureCoord - px);', // top left - 'vec4 c12 = texture2D(texture, vec2(vTextureCoord.x, vTextureCoord.y - px.y));', // top center - 'vec4 c13 = texture2D(texture, vec2(vTextureCoord.x + px.x, vTextureCoord.y - px.y));', // top right - - 'vec4 c21 = texture2D(texture, vec2(vTextureCoord.x - px.x, vTextureCoord.y) );', // mid left - 'vec4 c22 = texture2D(texture, vTextureCoord);', // mid center - 'vec4 c23 = texture2D(texture, vec2(vTextureCoord.x + px.x, vTextureCoord.y) );', // mid right - - 'vec4 c31 = texture2D(texture, vec2(vTextureCoord.x - px.x, vTextureCoord.y + px.y) );', // bottom left - 'vec4 c32 = texture2D(texture, vec2(vTextureCoord.x, vTextureCoord.y + px.y) );', // bottom center - 'vec4 c33 = texture2D(texture, vTextureCoord + px );', // bottom right - - 'gl_FragColor = ', - 'c11 * m[0] + c12 * m[1] + c22 * m[2] +', - 'c21 * m[3] + c22 * m[4] + c23 * m[5] +', - 'c31 * m[6] + c32 * m[7] + c33 * m[8];', - 'gl_FragColor.a = c22.a;', - '}' - ]; - -}; - -PIXI.ConvolutionFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.ConvolutionFilter.prototype.constructor = PIXI.ConvolutionFilter; - -/** - * An array of values used for matrix transformation. Specified as a 9 point Array. - * - * @property matrix - * @type Array - */ -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'matrix', { - get: function() { - return this.uniforms.m.value; - }, - set: function(value) { - this.uniforms.m.value = new PIXI.Float32Array(value); - } -}); - -/** - * Width of the object you are transforming - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'width', { - get: function() { - return this.uniforms.texelSizeX.value; - }, - set: function(value) { - this.uniforms.texelSizeX.value = 1/value; - } -}); - -/** - * Height of the object you are transforming - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'height', { - get: function() { - return this.uniforms.texelSizeY.value; - }, - set: function(value) { - this.uniforms.texelSizeY.value = 1/value; - } -}); diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/CrossHatchFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/CrossHatchFilter.js deleted file mode 100755 index 4b9f381..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/CrossHatchFilter.js +++ /dev/null @@ -1,80 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A Cross Hatch effect filter. - * - * @class CrossHatchFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.CrossHatchFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 1 / 512} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float blur;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);', - - ' gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);', - - ' if (lum < 1.00) {', - ' if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {', - ' gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);', - ' }', - ' }', - - ' if (lum < 0.75) {', - ' if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {', - ' gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);', - ' }', - ' }', - - ' if (lum < 0.50) {', - ' if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {', - ' gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);', - ' }', - ' }', - - ' if (lum < 0.3) {', - ' if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {', - ' gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);', - ' }', - ' }', - '}' - ]; -}; - -PIXI.CrossHatchFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.CrossHatchFilter.prototype.constructor = PIXI.CrossHatchFilter; - -/** - * Sets the strength of both the blur. - * - * @property blur - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.CrossHatchFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value / (1/7000); - }, - set: function(value) { - //this.padding = value; - this.uniforms.blur.value = (1/7000) * value; - } -}); diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/DisplacementFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/DisplacementFilter.js deleted file mode 100755 index 803b7b8..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/DisplacementFilter.js +++ /dev/null @@ -1,134 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The DisplacementFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. - * You can use this filter to apply all manor of crazy warping effects - * Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y. - * - * @class DisplacementFilter - * @extends AbstractFilter - * @constructor - * @param texture {Texture} The texture used for the displacement map * must be power of 2 texture at the moment - */ -PIXI.DisplacementFilter = function(texture) -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - texture.baseTexture._powerOf2 = true; - - // set the uniforms - this.uniforms = { - displacementMap: {type: 'sampler2D', value:texture}, - scale: {type: '2f', value:{x:30, y:30}}, - offset: {type: '2f', value:{x:0, y:0}}, - mapDimensions: {type: '2f', value:{x:1, y:5112}}, - dimensions: {type: '4fv', value:[0,0,0,0]} - }; - - if(texture.baseTexture.hasLoaded) - { - this.uniforms.mapDimensions.value.x = texture.width; - this.uniforms.mapDimensions.value.y = texture.height; - } - else - { - this.boundLoadedFunction = this.onTextureLoaded.bind(this); - - texture.baseTexture.on('loaded', this.boundLoadedFunction); - } - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D displacementMap;', - 'uniform sampler2D uSampler;', - 'uniform vec2 scale;', - 'uniform vec2 offset;', - 'uniform vec4 dimensions;', - 'uniform vec2 mapDimensions;',// = vec2(256.0, 256.0);', - // 'const vec2 textureDimensions = vec2(750.0, 750.0);', - - 'void main(void) {', - ' vec2 mapCords = vTextureCoord.xy;', - //' mapCords -= ;', - ' mapCords += (dimensions.zw + offset)/ dimensions.xy ;', - ' mapCords.y *= -1.0;', - ' mapCords.y += 1.0;', - ' vec2 matSample = texture2D(displacementMap, mapCords).xy;', - ' matSample -= 0.5;', - ' matSample *= scale;', - ' matSample /= mapDimensions;', - ' gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + matSample.x, vTextureCoord.y + matSample.y));', - ' gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb, 1.0);', - ' vec2 cord = vTextureCoord;', - - //' gl_FragColor = texture2D(displacementMap, cord);', - // ' gl_FragColor = gl_FragColor;', - '}' - ]; -}; - -PIXI.DisplacementFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.DisplacementFilter.prototype.constructor = PIXI.DisplacementFilter; - -/** - * Sets the map dimensions uniforms when the texture becomes available. - * - * @method onTextureLoaded - */ -PIXI.DisplacementFilter.prototype.onTextureLoaded = function() -{ - this.uniforms.mapDimensions.value.x = this.uniforms.displacementMap.value.width; - this.uniforms.mapDimensions.value.y = this.uniforms.displacementMap.value.height; - - this.uniforms.displacementMap.value.baseTexture.off('loaded', this.boundLoadedFunction); -}; - -/** - * The texture used for the displacement map. Must be power of 2 texture. - * - * @property map - * @type Texture - */ -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'map', { - get: function() { - return this.uniforms.displacementMap.value; - }, - set: function(value) { - this.uniforms.displacementMap.value = value; - } -}); - -/** - * The multiplier used to scale the displacement result from the map calculation. - * - * @property scale - * @type Point - */ -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'scale', { - get: function() { - return this.uniforms.scale.value; - }, - set: function(value) { - this.uniforms.scale.value = value; - } -}); - -/** - * The offset used to move the displacement map. - * - * @property offset - * @type Point - */ -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'offset', { - get: function() { - return this.uniforms.offset.value; - }, - set: function(value) { - this.uniforms.offset.value = value; - } -}); diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/DotScreenFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/DotScreenFilter.js deleted file mode 100755 index 5a7462f..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/DotScreenFilter.js +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/fun/dotscreen.js - */ - -/** - * This filter applies a dotscreen effect making display objects appear to be made out of black and white halftone dots like an old printer. - * - * @class DotScreenFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.DotScreenFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - scale: {type: '1f', value:1}, - angle: {type: '1f', value:5}, - dimensions: {type: '4fv', value:[0,0,0,0]} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform vec4 dimensions;', - 'uniform sampler2D uSampler;', - - 'uniform float angle;', - 'uniform float scale;', - - 'float pattern() {', - ' float s = sin(angle), c = cos(angle);', - ' vec2 tex = vTextureCoord * dimensions.xy;', - ' vec2 point = vec2(', - ' c * tex.x - s * tex.y,', - ' s * tex.x + c * tex.y', - ' ) * scale;', - ' return (sin(point.x) * sin(point.y)) * 4.0;', - '}', - - 'void main() {', - ' vec4 color = texture2D(uSampler, vTextureCoord);', - ' float average = (color.r + color.g + color.b) / 3.0;', - ' gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);', - '}' - ]; -}; - -PIXI.DotScreenFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.DotScreenFilter.prototype.constructor = PIXI.DotScreenFilter; - -/** - * The scale of the effect. - * @property scale - * @type Number - */ -Object.defineProperty(PIXI.DotScreenFilter.prototype, 'scale', { - get: function() { - return this.uniforms.scale.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.scale.value = value; - } -}); - -/** - * The radius of the effect. - * @property angle - * @type Number - */ -Object.defineProperty(PIXI.DotScreenFilter.prototype, 'angle', { - get: function() { - return this.uniforms.angle.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.angle.value = value; - } -}); diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/FilterBlock.js b/tutorial-1/pixi.js-master/src/pixi/filters/FilterBlock.js deleted file mode 100755 index fbdacc2..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/FilterBlock.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A target and pass info object for filters. - * - * @class FilterBlock - * @constructor - */ -PIXI.FilterBlock = function() -{ - /** - * The visible state of this FilterBlock. - * - * @property visible - * @type Boolean - */ - this.visible = true; - - /** - * The renderable state of this FilterBlock. - * - * @property renderable - * @type Boolean - */ - this.renderable = true; -}; - -PIXI.FilterBlock.prototype.constructor = PIXI.FilterBlock; diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/GrayFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/GrayFilter.js deleted file mode 100755 index 201d026..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/GrayFilter.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This greyscales the palette of your Display Objects. - * - * @class GrayFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.GrayFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - gray: {type: '1f', value: 1} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'uniform float gray;', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord);', - ' gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(0.2126*gl_FragColor.r + 0.7152*gl_FragColor.g + 0.0722*gl_FragColor.b), gray);', - // ' gl_FragColor = gl_FragColor;', - '}' - ]; -}; - -PIXI.GrayFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.GrayFilter.prototype.constructor = PIXI.GrayFilter; - -/** - * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color. - * @property gray - * @type Number - */ -Object.defineProperty(PIXI.GrayFilter.prototype, 'gray', { - get: function() { - return this.uniforms.gray.value; - }, - set: function(value) { - this.uniforms.gray.value = value; - } -}); diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/InvertFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/InvertFilter.js deleted file mode 100755 index 7f5e84c..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/InvertFilter.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This inverts your Display Objects colors. - * - * @class InvertFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.InvertFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - invert: {type: '1f', value: 1} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float invert;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord);', - ' gl_FragColor.rgb = mix( (vec3(1)-gl_FragColor.rgb) * gl_FragColor.a, gl_FragColor.rgb, 1.0 - invert);', - //' gl_FragColor.rgb = gl_FragColor.rgb * gl_FragColor.a;', - // ' gl_FragColor = gl_FragColor * vColor;', - '}' - ]; -}; - -PIXI.InvertFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.InvertFilter.prototype.constructor = PIXI.InvertFilter; - -/** - * The strength of the invert. 1 will fully invert the colors, 0 will make the object its normal color - * @property invert - * @type Number -*/ -Object.defineProperty(PIXI.InvertFilter.prototype, 'invert', { - get: function() { - return this.uniforms.invert.value; - }, - set: function(value) { - this.uniforms.invert.value = value; - } -}); diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/NoiseFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/NoiseFilter.js deleted file mode 100755 index ff248e4..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/NoiseFilter.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @author Vico @vicocotea - * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js - */ - -/** - * A Noise effect filter. - * - * @class NoiseFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.NoiseFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - noise: {type: '1f', value: 0.5} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'uniform sampler2D uSampler;', - 'uniform float noise;', - 'varying vec2 vTextureCoord;', - - 'float rand(vec2 co) {', - ' return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);', - '}', - 'void main() {', - ' vec4 color = texture2D(uSampler, vTextureCoord);', - - ' float diff = (rand(vTextureCoord) - 0.5) * noise;', - ' color.r += diff;', - ' color.g += diff;', - ' color.b += diff;', - - ' gl_FragColor = color;', - '}' - ]; -}; - -PIXI.NoiseFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.NoiseFilter.prototype.constructor = PIXI.NoiseFilter; - -/** - * The amount of noise to apply. - * @property noise - * @type Number -*/ -Object.defineProperty(PIXI.NoiseFilter.prototype, 'noise', { - get: function() { - return this.uniforms.noise.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.noise.value = value; - } -}); diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/NormalMapFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/NormalMapFilter.js deleted file mode 100755 index e686905..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/NormalMapFilter.js +++ /dev/null @@ -1,196 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - - -/** - * The NormalMapFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. - * You can use this filter to apply all manor of crazy warping effects - * Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y. - * - * @class NormalMapFilter - * @extends AbstractFilter - * @constructor - * @param texture {Texture} The texture used for the displacement map * must be power of 2 texture at the moment - */ -PIXI.NormalMapFilter = function(texture) -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - texture.baseTexture._powerOf2 = true; - - // set the uniforms - this.uniforms = { - displacementMap: {type: 'sampler2D', value:texture}, - scale: {type: '2f', value:{x:15, y:15}}, - offset: {type: '2f', value:{x:0, y:0}}, - mapDimensions: {type: '2f', value:{x:1, y:1}}, - dimensions: {type: '4f', value:[0,0,0,0]}, - // LightDir: {type: 'f3', value:[0, 1, 0]}, - LightPos: {type: '3f', value:[0, 1, 0]} - }; - - - if(texture.baseTexture.hasLoaded) - { - this.uniforms.mapDimensions.value.x = texture.width; - this.uniforms.mapDimensions.value.y = texture.height; - } - else - { - this.boundLoadedFunction = this.onTextureLoaded.bind(this); - - texture.baseTexture.on("loaded", this.boundLoadedFunction); - } - - this.fragmentSrc = [ - "precision mediump float;", - "varying vec2 vTextureCoord;", - "varying float vColor;", - "uniform sampler2D displacementMap;", - "uniform sampler2D uSampler;", - - "uniform vec4 dimensions;", - - "const vec2 Resolution = vec2(1.0,1.0);", //resolution of screen - "uniform vec3 LightPos;", //light position, normalized - "const vec4 LightColor = vec4(1.0, 1.0, 1.0, 1.0);", //light RGBA -- alpha is intensity - "const vec4 AmbientColor = vec4(1.0, 1.0, 1.0, 0.5);", //ambient RGBA -- alpha is intensity - "const vec3 Falloff = vec3(0.0, 1.0, 0.2);", //attenuation coefficients - - "uniform vec3 LightDir;",//" = vec3(1.0, 0.0, 1.0);", - - - "uniform vec2 mapDimensions;",// = vec2(256.0, 256.0);", - - - "void main(void) {", - "vec2 mapCords = vTextureCoord.xy;", - - "vec4 color = texture2D(uSampler, vTextureCoord.st);", - "vec3 nColor = texture2D(displacementMap, vTextureCoord.st).rgb;", - - - "mapCords *= vec2(dimensions.x/512.0, dimensions.y/512.0);", - - "mapCords.y *= -1.0;", - "mapCords.y += 1.0;", - - //RGBA of our diffuse color - "vec4 DiffuseColor = texture2D(uSampler, vTextureCoord);", - - //RGB of our normal map - "vec3 NormalMap = texture2D(displacementMap, mapCords).rgb;", - - //The delta position of light - //"vec3 LightDir = vec3(LightPos.xy - (gl_FragCoord.xy / Resolution.xy), LightPos.z);", - "vec3 LightDir = vec3(LightPos.xy - (mapCords.xy), LightPos.z);", - //Correct for aspect ratio - //"LightDir.x *= Resolution.x / Resolution.y;", - - //Determine distance (used for attenuation) BEFORE we normalize our LightDir - "float D = length(LightDir);", - - //normalize our vectors - "vec3 N = normalize(NormalMap * 2.0 - 1.0);", - "vec3 L = normalize(LightDir);", - - //Pre-multiply light color with intensity - //Then perform "N dot L" to determine our diffuse term - "vec3 Diffuse = (LightColor.rgb * LightColor.a) * max(dot(N, L), 0.0);", - - //pre-multiply ambient color with intensity - "vec3 Ambient = AmbientColor.rgb * AmbientColor.a;", - - //calculate attenuation - "float Attenuation = 1.0 / ( Falloff.x + (Falloff.y*D) + (Falloff.z*D*D) );", - - //the calculation which brings it all together - "vec3 Intensity = Ambient + Diffuse * Attenuation;", - "vec3 FinalColor = DiffuseColor.rgb * Intensity;", - "gl_FragColor = vColor * vec4(FinalColor, DiffuseColor.a);", - //"gl_FragColor = vec4(1.0, 0.0, 0.0, Attenuation);",//vColor * vec4(FinalColor, DiffuseColor.a);", - /* - // normalise color - "vec3 normal = normalize(nColor * 2.0 - 1.0);", - - "vec3 deltaPos = vec3( (light.xy - gl_FragCoord.xy) / resolution.xy, light.z );", - - "float lambert = clamp(dot(normal, lightDir), 0.0, 1.0);", - - "float d = sqrt(dot(deltaPos, deltaPos));", - "float att = 1.0 / ( attenuation.x + (attenuation.y*d) + (attenuation.z*d*d) );", - - "vec3 result = (ambientColor * ambientIntensity) + (lightColor.rgb * lambert) * att;", - "result *= color.rgb;", - - "gl_FragColor = vec4(result, 1.0);",*/ - - - - "}" - ]; - -} - -PIXI.NormalMapFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.NormalMapFilter.prototype.constructor = PIXI.NormalMapFilter; - -/** - * Sets the map dimensions uniforms when the texture becomes available. - * - * @method onTextureLoaded - */ -PIXI.NormalMapFilter.prototype.onTextureLoaded = function() -{ - this.uniforms.mapDimensions.value.x = this.uniforms.displacementMap.value.width; - this.uniforms.mapDimensions.value.y = this.uniforms.displacementMap.value.height; - - this.uniforms.displacementMap.value.baseTexture.off("loaded", this.boundLoadedFunction) -}; - -/** - * The texture used for the displacement map. Must be power of 2 texture. - * - * @property map - * @type Texture - */ -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'map', { - get: function() { - return this.uniforms.displacementMap.value; - }, - set: function(value) { - this.uniforms.displacementMap.value = value; - } -}); - -/** - * The multiplier used to scale the displacement result from the map calculation. - * - * @property scale - * @type Point - */ -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'scale', { - get: function() { - return this.uniforms.scale.value; - }, - set: function(value) { - this.uniforms.scale.value = value; - } -}); - -/** - * The offset used to move the displacement map. - * - * @property offset - * @type Point - */ -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'offset', { - get: function() { - return this.uniforms.offset.value; - }, - set: function(value) { - this.uniforms.offset.value = value; - } -}); diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/PixelateFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/PixelateFilter.js deleted file mode 100755 index 2a3127d..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/PixelateFilter.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This filter applies a pixelate effect making display objects appear 'blocky'. - * - * @class PixelateFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.PixelateFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - invert: {type: '1f', value: 0}, - dimensions: {type: '4fv', value:new PIXI.Float32Array([10000, 100, 10, 10])}, - pixelSize: {type: '2f', value:{x:10, y:10}} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform vec2 testDim;', - 'uniform vec4 dimensions;', - 'uniform vec2 pixelSize;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' vec2 coord = vTextureCoord;', - - ' vec2 size = dimensions.xy/pixelSize;', - - ' vec2 color = floor( ( vTextureCoord * size ) ) / size + pixelSize/dimensions.xy * 0.5;', - ' gl_FragColor = texture2D(uSampler, color);', - '}' - ]; -}; - -PIXI.PixelateFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.PixelateFilter.prototype.constructor = PIXI.PixelateFilter; - -/** - * This a point that describes the size of the blocks. x is the width of the block and y is the height. - * - * @property size - * @type Point - */ -Object.defineProperty(PIXI.PixelateFilter.prototype, 'size', { - get: function() { - return this.uniforms.pixelSize.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.pixelSize.value = value; - } -}); diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/RGBSplitFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/RGBSplitFilter.js deleted file mode 100755 index 7169637..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/RGBSplitFilter.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * An RGB Split Filter. - * - * @class RGBSplitFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.RGBSplitFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - red: {type: '2f', value: {x:20, y:20}}, - green: {type: '2f', value: {x:-20, y:20}}, - blue: {type: '2f', value: {x:20, y:-20}}, - dimensions: {type: '4fv', value:[0,0,0,0]} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform vec2 red;', - 'uniform vec2 green;', - 'uniform vec2 blue;', - 'uniform vec4 dimensions;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/dimensions.xy).r;', - ' gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/dimensions.xy).g;', - ' gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/dimensions.xy).b;', - ' gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;', - '}' - ]; -}; - -PIXI.RGBSplitFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.RGBSplitFilter.prototype.constructor = PIXI.RGBSplitFilter; - -/** - * Red channel offset. - * - * @property red - * @type Point - */ -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'red', { - get: function() { - return this.uniforms.red.value; - }, - set: function(value) { - this.uniforms.red.value = value; - } -}); - -/** - * Green channel offset. - * - * @property green - * @type Point - */ -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'green', { - get: function() { - return this.uniforms.green.value; - }, - set: function(value) { - this.uniforms.green.value = value; - } -}); - -/** - * Blue offset. - * - * @property blue - * @type Point - */ -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'blue', { - get: function() { - return this.uniforms.blue.value; - }, - set: function(value) { - this.uniforms.blue.value = value; - } -}); diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/SepiaFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/SepiaFilter.js deleted file mode 100755 index 5596e53..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/SepiaFilter.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This applies a sepia effect to your Display Objects. - * - * @class SepiaFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.SepiaFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - sepia: {type: '1f', value: 1} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float sepia;', - 'uniform sampler2D uSampler;', - - 'const mat3 sepiaMatrix = mat3(0.3588, 0.7044, 0.1368, 0.2990, 0.5870, 0.1140, 0.2392, 0.4696, 0.0912);', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord);', - ' gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb * sepiaMatrix, sepia);', - // ' gl_FragColor = gl_FragColor * vColor;', - '}' - ]; -}; - -PIXI.SepiaFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.SepiaFilter.prototype.constructor = PIXI.SepiaFilter; - -/** - * The strength of the sepia. 1 will apply the full sepia effect, 0 will make the object its normal color. - * @property sepia - * @type Number -*/ -Object.defineProperty(PIXI.SepiaFilter.prototype, 'sepia', { - get: function() { - return this.uniforms.sepia.value; - }, - set: function(value) { - this.uniforms.sepia.value = value; - } -}); diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/SmartBlurFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/SmartBlurFilter.js deleted file mode 100755 index 44a47f4..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/SmartBlurFilter.js +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A Smart Blur Filter. - * - * @class SmartBlurFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.SmartBlurFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 1/512} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'uniform sampler2D uSampler;', - //'uniform vec2 delta;', - 'const vec2 delta = vec2(1.0/10.0, 0.0);', - //'uniform float darkness;', - - 'float random(vec3 scale, float seed) {', - ' return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);', - '}', - - - 'void main(void) {', - ' vec4 color = vec4(0.0);', - ' float total = 0.0;', - - ' float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);', - - ' for (float t = -30.0; t <= 30.0; t++) {', - ' float percent = (t + offset - 0.5) / 30.0;', - ' float weight = 1.0 - abs(percent);', - ' vec4 sample = texture2D(uSampler, vTextureCoord + delta * percent);', - ' sample.rgb *= sample.a;', - ' color += sample * weight;', - ' total += weight;', - ' }', - - ' gl_FragColor = color / total;', - ' gl_FragColor.rgb /= gl_FragColor.a + 0.00001;', - //' gl_FragColor.rgb *= darkness;', - '}' - ]; -}; - -PIXI.SmartBlurFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.SmartBlurFilter.prototype.constructor = PIXI.SmartBlurFilter; - -/** - * The strength of the blur. - * - * @property blur - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.SmartBlurFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value; - }, - set: function(value) { - this.uniforms.blur.value = value; - } -}); diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/TiltShiftFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/TiltShiftFilter.js deleted file mode 100755 index 2eb3776..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/TiltShiftFilter.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @author Vico @vicocotea - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/ - */ - -/** - * A TiltShift Filter. Manages the pass of both a TiltShiftXFilter and TiltShiftYFilter. - * - * @class TiltShiftFilter - * @constructor - */ -PIXI.TiltShiftFilter = function() -{ - this.tiltShiftXFilter = new PIXI.TiltShiftXFilter(); - this.tiltShiftYFilter = new PIXI.TiltShiftYFilter(); - this.tiltShiftXFilter.updateDelta(); - this.tiltShiftXFilter.updateDelta(); - - this.passes = [this.tiltShiftXFilter, this.tiltShiftYFilter]; -}; - -PIXI.TiltShiftFilter.prototype.constructor = PIXI.TiltShiftFilter; - -/** - * The strength of the blur. - * - * @property blur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'blur', { - get: function() { - return this.tiltShiftXFilter.blur; - }, - set: function(value) { - this.tiltShiftXFilter.blur = this.tiltShiftYFilter.blur = value; - } -}); - -/** - * The strength of the gradient blur. - * - * @property gradientBlur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'gradientBlur', { - get: function() { - return this.tiltShiftXFilter.gradientBlur; - }, - set: function(value) { - this.tiltShiftXFilter.gradientBlur = this.tiltShiftYFilter.gradientBlur = value; - } -}); - -/** - * The Y value to start the effect at. - * - * @property start - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'start', { - get: function() { - return this.tiltShiftXFilter.start; - }, - set: function(value) { - this.tiltShiftXFilter.start = this.tiltShiftYFilter.start = value; - } -}); - -/** - * The Y value to end the effect at. - * - * @property end - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'end', { - get: function() { - return this.tiltShiftXFilter.end; - }, - set: function(value) { - this.tiltShiftXFilter.end = this.tiltShiftYFilter.end = value; - } -}); diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/TiltShiftXFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/TiltShiftXFilter.js deleted file mode 100755 index 29d8f38..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/TiltShiftXFilter.js +++ /dev/null @@ -1,149 +0,0 @@ -/** - * @author Vico @vicocotea - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/ - */ - -/** - * A TiltShiftXFilter. - * - * @class TiltShiftXFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.TiltShiftXFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 100.0}, - gradientBlur: {type: '1f', value: 600.0}, - start: {type: '2f', value:{x:0, y:window.screenHeight / 2}}, - end: {type: '2f', value:{x:600, y:window.screenHeight / 2}}, - delta: {type: '2f', value:{x:30, y:30}}, - texSize: {type: '2f', value:{x:window.screenWidth, y:window.screenHeight}} - }; - - this.updateDelta(); - - this.fragmentSrc = [ - 'precision mediump float;', - 'uniform sampler2D uSampler;', - 'uniform float blur;', - 'uniform float gradientBlur;', - 'uniform vec2 start;', - 'uniform vec2 end;', - 'uniform vec2 delta;', - 'uniform vec2 texSize;', - 'varying vec2 vTextureCoord;', - - 'float random(vec3 scale, float seed) {', - ' return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);', - '}', - - 'void main(void) {', - ' vec4 color = vec4(0.0);', - ' float total = 0.0;', - - ' float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);', - ' vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));', - ' float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;', - - ' for (float t = -30.0; t <= 30.0; t++) {', - ' float percent = (t + offset - 0.5) / 30.0;', - ' float weight = 1.0 - abs(percent);', - ' vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);', - ' sample.rgb *= sample.a;', - ' color += sample * weight;', - ' total += weight;', - ' }', - - ' gl_FragColor = color / total;', - ' gl_FragColor.rgb /= gl_FragColor.a + 0.00001;', - '}' - ]; -}; - -PIXI.TiltShiftXFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.TiltShiftXFilter.prototype.constructor = PIXI.TiltShiftXFilter; - -/** - * The strength of the blur. - * - * @property blur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.blur.value = value; - } -}); - -/** - * The strength of the gradient blur. - * - * @property gradientBlur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'gradientBlur', { - get: function() { - return this.uniforms.gradientBlur.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.gradientBlur.value = value; - } -}); - -/** - * The X value to start the effect at. - * - * @property start - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'start', { - get: function() { - return this.uniforms.start.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.start.value = value; - this.updateDelta(); - } -}); - -/** - * The X value to end the effect at. - * - * @property end - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'end', { - get: function() { - return this.uniforms.end.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.end.value = value; - this.updateDelta(); - } -}); - -/** - * Updates the filter delta values. - * - * @method updateDelta - */ -PIXI.TiltShiftXFilter.prototype.updateDelta = function(){ - var dx = this.uniforms.end.value.x - this.uniforms.start.value.x; - var dy = this.uniforms.end.value.y - this.uniforms.start.value.y; - var d = Math.sqrt(dx * dx + dy * dy); - this.uniforms.delta.value.x = dx / d; - this.uniforms.delta.value.y = dy / d; -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/TiltShiftYFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/TiltShiftYFilter.js deleted file mode 100755 index 3a92851..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/TiltShiftYFilter.js +++ /dev/null @@ -1,149 +0,0 @@ -/** - * @author Vico @vicocotea - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/ - */ - -/** - * A TiltShiftYFilter. - * - * @class TiltShiftYFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.TiltShiftYFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 100.0}, - gradientBlur: {type: '1f', value: 600.0}, - start: {type: '2f', value:{x:0, y:window.screenHeight / 2}}, - end: {type: '2f', value:{x:600, y:window.screenHeight / 2}}, - delta: {type: '2f', value:{x:30, y:30}}, - texSize: {type: '2f', value:{x:window.screenWidth, y:window.screenHeight}} - }; - - this.updateDelta(); - - this.fragmentSrc = [ - 'precision mediump float;', - 'uniform sampler2D uSampler;', - 'uniform float blur;', - 'uniform float gradientBlur;', - 'uniform vec2 start;', - 'uniform vec2 end;', - 'uniform vec2 delta;', - 'uniform vec2 texSize;', - 'varying vec2 vTextureCoord;', - - 'float random(vec3 scale, float seed) {', - ' return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);', - '}', - - 'void main(void) {', - ' vec4 color = vec4(0.0);', - ' float total = 0.0;', - - ' float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);', - ' vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));', - ' float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;', - - ' for (float t = -30.0; t <= 30.0; t++) {', - ' float percent = (t + offset - 0.5) / 30.0;', - ' float weight = 1.0 - abs(percent);', - ' vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);', - ' sample.rgb *= sample.a;', - ' color += sample * weight;', - ' total += weight;', - ' }', - - ' gl_FragColor = color / total;', - ' gl_FragColor.rgb /= gl_FragColor.a + 0.00001;', - '}' - ]; -}; - -PIXI.TiltShiftYFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.TiltShiftYFilter.prototype.constructor = PIXI.TiltShiftYFilter; - -/** - * The strength of the blur. - * - * @property blur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.blur.value = value; - } -}); - -/** - * The strength of the gradient blur. - * - * @property gradientBlur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'gradientBlur', { - get: function() { - return this.uniforms.gradientBlur.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.gradientBlur.value = value; - } -}); - -/** - * The Y value to start the effect at. - * - * @property start - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'start', { - get: function() { - return this.uniforms.start.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.start.value = value; - this.updateDelta(); - } -}); - -/** - * The Y value to end the effect at. - * - * @property end - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'end', { - get: function() { - return this.uniforms.end.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.end.value = value; - this.updateDelta(); - } -}); - -/** - * Updates the filter delta values. - * - * @method updateDelta - */ -PIXI.TiltShiftYFilter.prototype.updateDelta = function(){ - var dx = this.uniforms.end.value.x - this.uniforms.start.value.x; - var dy = this.uniforms.end.value.y - this.uniforms.start.value.y; - var d = Math.sqrt(dx * dx + dy * dy); - this.uniforms.delta.value.x = -dy / d; - this.uniforms.delta.value.y = dx / d; -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/filters/TwistFilter.js b/tutorial-1/pixi.js-master/src/pixi/filters/TwistFilter.js deleted file mode 100755 index 08a3122..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/filters/TwistFilter.js +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This filter applies a twist effect making display objects appear twisted in the given direction. - * - * @class TwistFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.TwistFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - radius: {type: '1f', value:0.5}, - angle: {type: '1f', value:5}, - offset: {type: '2f', value:{x:0.5, y:0.5}} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform vec4 dimensions;', - 'uniform sampler2D uSampler;', - - 'uniform float radius;', - 'uniform float angle;', - 'uniform vec2 offset;', - - 'void main(void) {', - ' vec2 coord = vTextureCoord - offset;', - ' float distance = length(coord);', - - ' if (distance < radius) {', - ' float ratio = (radius - distance) / radius;', - ' float angleMod = ratio * ratio * angle;', - ' float s = sin(angleMod);', - ' float c = cos(angleMod);', - ' coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);', - ' }', - - ' gl_FragColor = texture2D(uSampler, coord+offset);', - '}' - ]; -}; - -PIXI.TwistFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.TwistFilter.prototype.constructor = PIXI.TwistFilter; - -/** - * This point describes the the offset of the twist. - * - * @property offset - * @type Point - */ -Object.defineProperty(PIXI.TwistFilter.prototype, 'offset', { - get: function() { - return this.uniforms.offset.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.offset.value = value; - } -}); - -/** - * This radius of the twist. - * - * @property radius - * @type Number - */ -Object.defineProperty(PIXI.TwistFilter.prototype, 'radius', { - get: function() { - return this.uniforms.radius.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.radius.value = value; - } -}); - -/** - * This angle of the twist. - * - * @property angle - * @type Number - */ -Object.defineProperty(PIXI.TwistFilter.prototype, 'angle', { - get: function() { - return this.uniforms.angle.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.angle.value = value; - } -}); diff --git a/tutorial-1/pixi.js-master/src/pixi/geom/Circle.js b/tutorial-1/pixi.js-master/src/pixi/geom/Circle.js deleted file mode 100755 index 47288c6..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/geom/Circle.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @author Chad Engler - */ - -/** - * The Circle object can be used to specify a hit area for displayObjects - * - * @class Circle - * @constructor - * @param x {Number} The X coordinate of the center of this circle - * @param y {Number} The Y coordinate of the center of this circle - * @param radius {Number} The radius of the circle - */ -PIXI.Circle = function(x, y, radius) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property radius - * @type Number - * @default 0 - */ - this.radius = radius || 0; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.CIRC in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Circle instance - * - * @method clone - * @return {Circle} a copy of the Circle - */ -PIXI.Circle.prototype.clone = function() -{ - return new PIXI.Circle(this.x, this.y, this.radius); -}; - -/** - * Checks whether the x and y coordinates given are contained within this circle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Circle - */ -PIXI.Circle.prototype.contains = function(x, y) -{ - if(this.radius <= 0) - return false; - - var dx = (this.x - x), - dy = (this.y - y), - r2 = this.radius * this.radius; - - dx *= dx; - dy *= dy; - - return (dx + dy <= r2); -}; - -/** -* Returns the framing rectangle of the circle as a PIXI.Rectangle object -* -* @method getBounds -* @return {Rectangle} the framing rectangle -*/ -PIXI.Circle.prototype.getBounds = function() -{ - return new PIXI.Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2); -}; - -// constructor -PIXI.Circle.prototype.constructor = PIXI.Circle; diff --git a/tutorial-1/pixi.js-master/src/pixi/geom/Ellipse.js b/tutorial-1/pixi.js-master/src/pixi/geom/Ellipse.js deleted file mode 100755 index 2700a71..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/geom/Ellipse.js +++ /dev/null @@ -1,100 +0,0 @@ -/** - * @author Chad Engler - */ - -/** - * The Ellipse object can be used to specify a hit area for displayObjects - * - * @class Ellipse - * @constructor - * @param x {Number} The X coordinate of the center of the ellipse - * @param y {Number} The Y coordinate of the center of the ellipse - * @param width {Number} The half width of this ellipse - * @param height {Number} The half height of this ellipse - */ -PIXI.Ellipse = function(x, y, width, height) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.ELIP in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Ellipse instance - * - * @method clone - * @return {Ellipse} a copy of the ellipse - */ -PIXI.Ellipse.prototype.clone = function() -{ - return new PIXI.Ellipse(this.x, this.y, this.width, this.height); -}; - -/** - * Checks whether the x and y coordinates given are contained within this ellipse - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coords are within this ellipse - */ -PIXI.Ellipse.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - //normalize the coords to an ellipse with center 0,0 - var normx = ((x - this.x) / this.width), - normy = ((y - this.y) / this.height); - - normx *= normx; - normy *= normy; - - return (normx + normy <= 1); -}; - -/** -* Returns the framing rectangle of the ellipse as a PIXI.Rectangle object -* -* @method getBounds -* @return {Rectangle} the framing rectangle -*/ -PIXI.Ellipse.prototype.getBounds = function() -{ - return new PIXI.Rectangle(this.x - this.width, this.y - this.height, this.width, this.height); -}; - -// constructor -PIXI.Ellipse.prototype.constructor = PIXI.Ellipse; diff --git a/tutorial-1/pixi.js-master/src/pixi/geom/Matrix.js b/tutorial-1/pixi.js-master/src/pixi/geom/Matrix.js deleted file mode 100755 index b0f043f..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/geom/Matrix.js +++ /dev/null @@ -1,268 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Matrix class is now an object, which makes it a lot faster, - * here is a representation of it : - * | a | b | tx| - * | c | d | ty| - * | 0 | 0 | 1 | - * - * @class Matrix - * @constructor - */ -PIXI.Matrix = function() -{ - /** - * @property a - * @type Number - * @default 1 - */ - this.a = 1; - - /** - * @property b - * @type Number - * @default 0 - */ - this.b = 0; - - /** - * @property c - * @type Number - * @default 0 - */ - this.c = 0; - - /** - * @property d - * @type Number - * @default 1 - */ - this.d = 1; - - /** - * @property tx - * @type Number - * @default 0 - */ - this.tx = 0; - - /** - * @property ty - * @type Number - * @default 0 - */ - this.ty = 0; -}; - -/** - * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows: - * - * a = array[0] - * b = array[1] - * c = array[3] - * d = array[4] - * tx = array[2] - * ty = array[5] - * - * @method fromArray - * @param array {Array} The array that the matrix will be populated from. - */ -PIXI.Matrix.prototype.fromArray = function(array) -{ - this.a = array[0]; - this.b = array[1]; - this.c = array[3]; - this.d = array[4]; - this.tx = array[2]; - this.ty = array[5]; -}; - -/** - * Creates an array from the current Matrix object. - * - * @method toArray - * @param transpose {Boolean} Whether we need to transpose the matrix or not - * @return {Array} the newly created array which contains the matrix - */ -PIXI.Matrix.prototype.toArray = function(transpose) -{ - if(!this.array) this.array = new PIXI.Float32Array(9); - var array = this.array; - - if(transpose) - { - array[0] = this.a; - array[1] = this.b; - array[2] = 0; - array[3] = this.c; - array[4] = this.d; - array[5] = 0; - array[6] = this.tx; - array[7] = this.ty; - array[8] = 1; - } - else - { - array[0] = this.a; - array[1] = this.c; - array[2] = this.tx; - array[3] = this.b; - array[4] = this.d; - array[5] = this.ty; - array[6] = 0; - array[7] = 0; - array[8] = 1; - } - - return array; -}; - -/** - * Get a new position with the current transformation applied. - * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) - * - * @method apply - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix - */ -PIXI.Matrix.prototype.apply = function(pos, newPos) -{ - newPos = newPos || new PIXI.Point(); - - newPos.x = this.a * pos.x + this.c * pos.y + this.tx; - newPos.y = this.b * pos.x + this.d * pos.y + this.ty; - - return newPos; -}; - -/** - * Get a new position with the inverse of the current transformation applied. - * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) - * - * @method applyInverse - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix - */ -PIXI.Matrix.prototype.applyInverse = function(pos, newPos) -{ - newPos = newPos || new PIXI.Point(); - - var id = 1 / (this.a * this.d + this.c * -this.b); - - newPos.x = this.d * id * pos.x + -this.c * id * pos.y + (this.ty * this.c - this.tx * this.d) * id; - newPos.y = this.a * id * pos.y + -this.b * id * pos.x + (-this.ty * this.a + this.tx * this.b) * id; - - return newPos; -}; - -/** - * Translates the matrix on the x and y. - * - * @method translate - * @param {Number} x - * @param {Number} y - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.translate = function(x, y) -{ - this.tx += x; - this.ty += y; - - return this; -}; - -/** - * Applies a scale transformation to the matrix. - * - * @method scale - * @param {Number} x The amount to scale horizontally - * @param {Number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.scale = function(x, y) -{ - this.a *= x; - this.d *= y; - this.c *= x; - this.b *= y; - this.tx *= x; - this.ty *= y; - - return this; -}; - - -/** - * Applies a rotation transformation to the matrix. - * @method rotate - * @param {Number} angle The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.rotate = function(angle) -{ - var cos = Math.cos( angle ); - var sin = Math.sin( angle ); - - var a1 = this.a; - var c1 = this.c; - var tx1 = this.tx; - - this.a = a1 * cos-this.b * sin; - this.b = a1 * sin+this.b * cos; - this.c = c1 * cos-this.d * sin; - this.d = c1 * sin+this.d * cos; - this.tx = tx1 * cos - this.ty * sin; - this.ty = tx1 * sin + this.ty * cos; - - return this; -}; - -/** - * Appends the given Matrix to this Matrix. - * - * @method append - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. - */ -PIXI.Matrix.prototype.append = function(matrix) -{ - var a1 = this.a; - var b1 = this.b; - var c1 = this.c; - var d1 = this.d; - - this.a = matrix.a * a1 + matrix.b * c1; - this.b = matrix.a * b1 + matrix.b * d1; - this.c = matrix.c * a1 + matrix.d * c1; - this.d = matrix.c * b1 + matrix.d * d1; - - this.tx = matrix.tx * a1 + matrix.ty * c1 + this.tx; - this.ty = matrix.tx * b1 + matrix.ty * d1 + this.ty; - - return this; -}; - -/** - * Resets this Matix to an identity (default) matrix. - * - * @method identity - * @return {Matrix} This matrix. Good for chaining method calls. - */ -PIXI.Matrix.prototype.identity = function() -{ - this.a = 1; - this.b = 0; - this.c = 0; - this.d = 1; - this.tx = 0; - this.ty = 0; - - return this; -}; - -PIXI.identityMatrix = new PIXI.Matrix(); diff --git a/tutorial-1/pixi.js-master/src/pixi/geom/Point.js b/tutorial-1/pixi.js-master/src/pixi/geom/Point.js deleted file mode 100755 index 2adcb13..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/geom/Point.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis. - * - * @class Point - * @constructor - * @param x {Number} position of the point on the x axis - * @param y {Number} position of the point on the y axis - */ -PIXI.Point = function(x, y) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; -}; - -/** - * Creates a clone of this point - * - * @method clone - * @return {Point} a copy of the point - */ -PIXI.Point.prototype.clone = function() -{ - return new PIXI.Point(this.x, this.y); -}; - -/** - * Sets the point to a new x and y position. - * If y is omitted, both x and y will be set to x. - * - * @method set - * @param [x=0] {Number} position of the point on the x axis - * @param [y=0] {Number} position of the point on the y axis - */ -PIXI.Point.prototype.set = function(x, y) -{ - this.x = x || 0; - this.y = y || ( (y !== 0) ? this.x : 0 ) ; -}; - -// constructor -PIXI.Point.prototype.constructor = PIXI.Point; \ No newline at end of file diff --git a/tutorial-1/pixi.js-master/src/pixi/geom/Polygon.js b/tutorial-1/pixi.js-master/src/pixi/geom/Polygon.js deleted file mode 100755 index 77f8f56..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/geom/Polygon.js +++ /dev/null @@ -1,90 +0,0 @@ -/** - * @author Adrien Brault - */ - -/** - * @class Polygon - * @constructor - * @param points* {Array(Point)|Array(Number)|Point...|Number...} This can be an array of Points that form the polygon, - * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be - * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the - * arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are - * Numbers. - */ -PIXI.Polygon = function(points) -{ - //if points isn't an array, use arguments as the array - if(!(points instanceof Array))points = Array.prototype.slice.call(arguments); - - //if this is a flat array of numbers, convert it to points - if(points[0] instanceof PIXI.Point) - { - var p = []; - for(var i = 0, il = points.length; i < il; i++) - { - p.push(points[i].x, points[i].y); - } - - points = p; - } - - this.closed = true; - - /** - * An array of the points of this polygon - * @property points - * @type Array(Point)|Array(Number) - * - */ - this.points = points; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.POLY in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this polygon - * - * @method clone - * @return {Polygon} a copy of the polygon - */ -PIXI.Polygon.prototype.clone = function() -{ - var points = this.points.slice(); - return new PIXI.Polygon(points); -}; - -/** - * Checks whether the x and y coordinates passed to this function are contained within this polygon - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this polygon - */ -PIXI.Polygon.prototype.contains = function(x, y) -{ - var inside = false; - - // use some raycasting to test hits - // https://github.com/substack/point-in-polygon/blob/master/index.js - var length = this.points.length / 2; - - for(var i = 0, j = length - 1; i < length; j = i++) - { - var xi = this.points[i * 2], yi = this.points[i * 2 + 1], - xj = this.points[j * 2], yj = this.points[j * 2 + 1], - intersect = ((yi > y) !== (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi); - - if(intersect) inside = !inside; - } - - return inside; -}; - -// constructor -PIXI.Polygon.prototype.constructor = PIXI.Polygon; diff --git a/tutorial-1/pixi.js-master/src/pixi/geom/Rectangle.js b/tutorial-1/pixi.js-master/src/pixi/geom/Rectangle.js deleted file mode 100755 index 61985fa..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/geom/Rectangle.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height. - * - * @class Rectangle - * @constructor - * @param x {Number} The X coordinate of the upper-left corner of the rectangle - * @param y {Number} The Y coordinate of the upper-left corner of the rectangle - * @param width {Number} The overall width of this rectangle - * @param height {Number} The overall height of this rectangle - */ -PIXI.Rectangle = function(x, y, width, height) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RECT in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Rectangle - * - * @method clone - * @return {Rectangle} a copy of the rectangle - */ -PIXI.Rectangle.prototype.clone = function() -{ - return new PIXI.Rectangle(this.x, this.y, this.width, this.height); -}; - -/** - * Checks whether the x and y coordinates given are contained within this Rectangle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Rectangle - */ -PIXI.Rectangle.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - var x1 = this.x; - if(x >= x1 && x <= x1 + this.width) - { - var y1 = this.y; - - if(y >= y1 && y <= y1 + this.height) - { - return true; - } - } - - return false; -}; - -// constructor -PIXI.Rectangle.prototype.constructor = PIXI.Rectangle; - -PIXI.EmptyRectangle = new PIXI.Rectangle(0,0,0,0); \ No newline at end of file diff --git a/tutorial-1/pixi.js-master/src/pixi/geom/RoundedRectangle.js b/tutorial-1/pixi.js-master/src/pixi/geom/RoundedRectangle.js deleted file mode 100755 index 4f75723..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/geom/RoundedRectangle.js +++ /dev/null @@ -1,101 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * The Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height. - * - * @class RoundedRectangle - * @constructor - * @param x {Number} The X coordinate of the upper-left corner of the rounded rectangle - * @param y {Number} The Y coordinate of the upper-left corner of the rounded rectangle - * @param width {Number} The overall width of this rounded rectangle - * @param height {Number} The overall height of this rounded rectangle - * @param radius {Number} Controls the radius of the rounded corners - */ -PIXI.RoundedRectangle = function(x, y, width, height, radius) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - /** - * @property radius - * @type Number - * @default 20 - */ - this.radius = radius || 20; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RRECT in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Rounded Rectangle - * - * @method clone - * @return {RoundedRectangle} a copy of the rounded rectangle - */ -PIXI.RoundedRectangle.prototype.clone = function() -{ - return new PIXI.RoundedRectangle(this.x, this.y, this.width, this.height, this.radius); -}; - -/** - * Checks whether the x and y coordinates given are contained within this Rounded Rectangle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Rounded Rectangle - */ -PIXI.RoundedRectangle.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - var x1 = this.x; - if(x >= x1 && x <= x1 + this.width) - { - var y1 = this.y; - - if(y >= y1 && y <= y1 + this.height) - { - return true; - } - } - - return false; -}; - -// constructor -PIXI.RoundedRectangle.prototype.constructor = PIXI.RoundedRectangle; - diff --git a/tutorial-1/pixi.js-master/src/pixi/loaders/AssetLoader.js b/tutorial-1/pixi.js-master/src/pixi/loaders/AssetLoader.js deleted file mode 100755 index 0e4b858..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/loaders/AssetLoader.js +++ /dev/null @@ -1,167 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * 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 - * @uses EventTarget - * @param assetURLs {Array(String)} 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'. - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.AssetLoader = function(assetURLs, crossorigin) -{ - /** - * The array of asset URLs that are going to be loaded - * - * @property assetURLs - * @type Array(String) - */ - this.assetURLs = assetURLs; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * Maps file extension to loader types - * - * @property loadersByType - * @type Object - */ - this.loadersByType = { - 'jpg': PIXI.ImageLoader, - 'jpeg': PIXI.ImageLoader, - 'png': PIXI.ImageLoader, - 'gif': PIXI.ImageLoader, - 'webp': PIXI.ImageLoader, - 'json': PIXI.JsonLoader, - 'atlas': PIXI.AtlasLoader, - 'anim': PIXI.SpineLoader, - 'xml': PIXI.BitmapFontLoader, - 'fnt': PIXI.BitmapFontLoader - }; -}; - -PIXI.EventTarget.mixin(PIXI.AssetLoader.prototype); - -/** - * Fired when an item has loaded - * @event onProgress - */ - -/** - * Fired when all the assets have loaded - * @event onComplete - */ - -// constructor -PIXI.AssetLoader.prototype.constructor = PIXI.AssetLoader; - -/** - * Given a filename, returns its extension. - * - * @method _getDataType - * @param str {String} the name of the asset - */ -PIXI.AssetLoader.prototype._getDataType = function(str) -{ - var test = 'data:'; - //starts with 'data:' - var start = str.slice(0, test.length).toLowerCase(); - if (start === test) { - var data = str.slice(test.length); - - var sepIdx = data.indexOf(','); - if (sepIdx === -1) //malformed data URI scheme - return null; - - //e.g. 'image/gif;base64' => 'image/gif' - var info = data.slice(0, sepIdx).split(';')[0]; - - //We might need to handle some special cases here... - //standardize text/plain to 'txt' file extension - if (!info || info.toLowerCase() === 'text/plain') - return 'txt'; - - //User specified mime type, try splitting it by '/' - return info.split('/').pop().toLowerCase(); - } - - return null; -}; - -/** - * Starts loading the assets sequentially - * - * @method load - */ -PIXI.AssetLoader.prototype.load = function() -{ - var scope = this; - - function onLoad(evt) { - scope.onAssetLoaded(evt.data.content); - } - - this.loadCount = this.assetURLs.length; - - for (var i=0; i < this.assetURLs.length; i++) - { - var fileName = this.assetURLs[i]; - //first see if we have a data URI scheme.. - var fileType = this._getDataType(fileName); - - //if not, assume it's a file URI - if (!fileType) - fileType = fileName.split('?').shift().split('.').pop().toLowerCase(); - - var Constructor = this.loadersByType[fileType]; - if(!Constructor) - throw new Error(fileType + ' is an unsupported file type'); - - var loader = new Constructor(fileName, this.crossorigin); - - loader.on('loaded', onLoad); - loader.load(); - } -}; - -/** - * Invoked after each file is loaded - * - * @method onAssetLoaded - * @private - */ -PIXI.AssetLoader.prototype.onAssetLoaded = function(loader) -{ - this.loadCount--; - - this.emit('onProgress', { - content: this, - loader: loader, - loaded: this.assetURLs.length - this.loadCount, - total: this.assetURLs.length - }); - - if (this.onProgress) this.onProgress(loader); - - if (!this.loadCount) - { - this.emit('onComplete', { content: this }); - if(this.onComplete) this.onComplete(); - } -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/loaders/AtlasLoader.js b/tutorial-1/pixi.js-master/src/pixi/loaders/AtlasLoader.js deleted file mode 100755 index 5368b6b..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/loaders/AtlasLoader.js +++ /dev/null @@ -1,190 +0,0 @@ -/** - * @author Martin Kelm http://mkelm.github.com - */ - -/** - * The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event. - * - * To generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format. - * - * It is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to 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.fromFrameId() - * - * @class AtlasLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.AtlasLoader = function (url, crossorigin) { - this.url = url; - this.baseUrl = url.replace(/[^\/]*$/, ''); - this.crossorigin = crossorigin; - this.loaded = false; - -}; - -// constructor -PIXI.AtlasLoader.constructor = PIXI.AtlasLoader; - -PIXI.EventTarget.mixin(PIXI.AtlasLoader.prototype); - - /** - * Starts loading the JSON file - * - * @method load - */ -PIXI.AtlasLoader.prototype.load = function () { - this.ajaxRequest = new PIXI.AjaxRequest(); - this.ajaxRequest.onreadystatechange = this.onAtlasLoaded.bind(this); - - this.ajaxRequest.open('GET', this.url, true); - if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/json'); - this.ajaxRequest.send(null); -}; - -/** - * Invoked when the Atlas has fully loaded. Parses the JSON and builds the texture frames. - * - * @method onAtlasLoaded - * @private - */ -PIXI.AtlasLoader.prototype.onAtlasLoaded = function () { - if (this.ajaxRequest.readyState === 4) { - if (this.ajaxRequest.status === 200 || window.location.href.indexOf('http') === -1) { - this.atlas = { - meta : { - image : [] - }, - frames : [] - }; - var result = this.ajaxRequest.responseText.split(/\r?\n/); - var lineCount = -3; - - var currentImageId = 0; - var currentFrame = null; - var nameInNextLine = false; - - var i = 0, - j = 0, - selfOnLoaded = this.onLoaded.bind(this); - - // parser without rotation support yet! - for (i = 0; i < result.length; i++) { - result[i] = result[i].replace(/^\s+|\s+$/g, ''); - if (result[i] === '') { - nameInNextLine = i+1; - } - if (result[i].length > 0) { - if (nameInNextLine === i) { - this.atlas.meta.image.push(result[i]); - currentImageId = this.atlas.meta.image.length - 1; - this.atlas.frames.push({}); - lineCount = -3; - } else if (lineCount > 0) { - if (lineCount % 7 === 1) { // frame name - if (currentFrame != null) { //jshint ignore:line - this.atlas.frames[currentImageId][currentFrame.name] = currentFrame; - } - currentFrame = { name: result[i], frame : {} }; - } else { - var text = result[i].split(' '); - if (lineCount % 7 === 3) { // position - currentFrame.frame.x = Number(text[1].replace(',', '')); - currentFrame.frame.y = Number(text[2]); - } else if (lineCount % 7 === 4) { // size - currentFrame.frame.w = Number(text[1].replace(',', '')); - currentFrame.frame.h = Number(text[2]); - } else if (lineCount % 7 === 5) { // real size - var realSize = { - x : 0, - y : 0, - w : Number(text[1].replace(',', '')), - h : Number(text[2]) - }; - - if (realSize.w > currentFrame.frame.w || realSize.h > currentFrame.frame.h) { - currentFrame.trimmed = true; - currentFrame.realSize = realSize; - } else { - currentFrame.trimmed = false; - } - } - } - } - lineCount++; - } - } - - if (currentFrame != null) { //jshint ignore:line - this.atlas.frames[currentImageId][currentFrame.name] = currentFrame; - } - - if (this.atlas.meta.image.length > 0) { - this.images = []; - for (j = 0; j < this.atlas.meta.image.length; j++) { - // sprite sheet - var textureUrl = this.baseUrl + this.atlas.meta.image[j]; - var frameData = this.atlas.frames[j]; - this.images.push(new PIXI.ImageLoader(textureUrl, this.crossorigin)); - - for (i in frameData) { - var rect = frameData[i].frame; - if (rect) { - PIXI.TextureCache[i] = new PIXI.Texture(this.images[j].texture.baseTexture, { - x: rect.x, - y: rect.y, - width: rect.w, - height: rect.h - }); - if (frameData[i].trimmed) { - PIXI.TextureCache[i].realSize = frameData[i].realSize; - // trim in pixi not supported yet, todo update trim properties if it is done ... - PIXI.TextureCache[i].trim.x = 0; - PIXI.TextureCache[i].trim.y = 0; - } - } - } - } - - this.currentImageId = 0; - for (j = 0; j < this.images.length; j++) { - this.images[j].on('loaded', selfOnLoaded); - } - this.images[this.currentImageId].load(); - - } else { - this.onLoaded(); - } - - } else { - this.onError(); - } - } -}; - -/** - * Invoked when json file has loaded. - * - * @method onLoaded - * @private - */ -PIXI.AtlasLoader.prototype.onLoaded = function () { - if (this.images.length - 1 > this.currentImageId) { - this.currentImageId++; - this.images[this.currentImageId].load(); - } else { - this.loaded = true; - this.emit('loaded', { content: this }); - } -}; - -/** - * Invoked when an error occurs. - * - * @method onError - * @private - */ -PIXI.AtlasLoader.prototype.onError = function () { - this.emit('error', { content: this }); -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/loaders/BitmapFontLoader.js b/tutorial-1/pixi.js-master/src/pixi/loaders/BitmapFontLoader.js deleted file mode 100755 index 3eb54c4..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/loaders/BitmapFontLoader.js +++ /dev/null @@ -1,161 +0,0 @@ -/** - * @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 - * @uses EventTarget - * @constructor - * @param url {String} The url of the sprite sheet JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.BitmapFontLoader = function(url, crossorigin) -{ - /** - * The url of the bitmap font data - * - * @property url - * @type String - */ - this.url = url; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * [read-only] The base url of the bitmap font data - * - * @property baseUrl - * @type String - * @readOnly - */ - this.baseUrl = url.replace(/[^\/]*$/, ''); - - /** - * [read-only] The texture of the bitmap font - * - * @property texture - * @type Texture - */ - this.texture = null; -}; - -// constructor -PIXI.BitmapFontLoader.prototype.constructor = PIXI.BitmapFontLoader; -PIXI.EventTarget.mixin(PIXI.BitmapFontLoader.prototype); - -/** - * Loads the XML font data - * - * @method load - */ -PIXI.BitmapFontLoader.prototype.load = function() -{ - this.ajaxRequest = new PIXI.AjaxRequest(); - this.ajaxRequest.onreadystatechange = this.onXMLLoaded.bind(this); - - this.ajaxRequest.open('GET', this.url, true); - if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/xml'); - this.ajaxRequest.send(null); -}; - -/** - * Invoked when the XML file is loaded, parses the data. - * - * @method onXMLLoaded - * @private - */ -PIXI.BitmapFontLoader.prototype.onXMLLoaded = function() -{ - if (this.ajaxRequest.readyState === 4) - { - if (this.ajaxRequest.status === 200 || window.location.protocol.indexOf('http') === -1) - { - var responseXML = this.ajaxRequest.responseXML; - if(!responseXML || /MSIE 9/i.test(navigator.userAgent) || navigator.isCocoonJS) { - if(typeof(window.DOMParser) === 'function') { - var domparser = new DOMParser(); - responseXML = domparser.parseFromString(this.ajaxRequest.responseText, 'text/xml'); - } else { - var div = document.createElement('div'); - div.innerHTML = this.ajaxRequest.responseText; - responseXML = div; - } - } - - var textureUrl = this.baseUrl + responseXML.getElementsByTagName('page')[0].getAttribute('file'); - var image = new PIXI.ImageLoader(textureUrl, this.crossorigin); - this.texture = image.texture.baseTexture; - - var data = {}; - var info = responseXML.getElementsByTagName('info')[0]; - var common = responseXML.getElementsByTagName('common')[0]; - data.font = info.getAttribute('face'); - data.size = parseInt(info.getAttribute('size'), 10); - data.lineHeight = parseInt(common.getAttribute('lineHeight'), 10); - data.chars = {}; - - //parse letters - var letters = responseXML.getElementsByTagName('char'); - - for (var i = 0; i < letters.length; i++) - { - var charCode = parseInt(letters[i].getAttribute('id'), 10); - - var textureRect = new PIXI.Rectangle( - parseInt(letters[i].getAttribute('x'), 10), - parseInt(letters[i].getAttribute('y'), 10), - parseInt(letters[i].getAttribute('width'), 10), - parseInt(letters[i].getAttribute('height'), 10) - ); - - data.chars[charCode] = { - xOffset: parseInt(letters[i].getAttribute('xoffset'), 10), - yOffset: parseInt(letters[i].getAttribute('yoffset'), 10), - xAdvance: parseInt(letters[i].getAttribute('xadvance'), 10), - kerning: {}, - texture: PIXI.TextureCache[charCode] = new PIXI.Texture(this.texture, textureRect) - - }; - } - - //parse kernings - var kernings = responseXML.getElementsByTagName('kerning'); - for (i = 0; i < kernings.length; i++) - { - var first = parseInt(kernings[i].getAttribute('first'), 10); - var second = parseInt(kernings[i].getAttribute('second'), 10); - var amount = parseInt(kernings[i].getAttribute('amount'), 10); - - data.chars[second].kerning[first] = amount; - - } - - PIXI.BitmapText.fonts[data.font] = data; - - image.addEventListener('loaded', this.onLoaded.bind(this)); - image.load(); - } - } -}; - -/** - * Invoked when all files are loaded (xml/fnt and texture) - * - * @method onLoaded - * @private - */ -PIXI.BitmapFontLoader.prototype.onLoaded = function() -{ - this.emit('loaded', { content: this }); -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/loaders/ImageLoader.js b/tutorial-1/pixi.js-master/src/pixi/loaders/ImageLoader.js deleted file mode 100755 index 1567f29..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/loaders/ImageLoader.js +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @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.fromFrame() and PIXI.Sprite.fromFrame() - * When loaded this class will dispatch a 'loaded' event - * - * @class ImageLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the image - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.ImageLoader = function(url, crossorigin) -{ - /** - * The texture being loaded - * - * @property texture - * @type Texture - */ - this.texture = PIXI.Texture.fromImage(url, crossorigin); - - /** - * if the image is loaded with loadFramedSpriteSheet - * frames will contain the sprite sheet frames - * - * @property frames - * @type Array - * @readOnly - */ - this.frames = []; -}; - -// constructor -PIXI.ImageLoader.prototype.constructor = PIXI.ImageLoader; - -PIXI.EventTarget.mixin(PIXI.ImageLoader.prototype); - -/** - * Loads image or takes it from cache - * - * @method load - */ -PIXI.ImageLoader.prototype.load = function() -{ - if(!this.texture.baseTexture.hasLoaded) - { - this.texture.baseTexture.on('loaded', this.onLoaded.bind(this)); - } - else - { - this.onLoaded(); - } -}; - -/** - * Invoked when image file is loaded or it is already cached and ready to use - * - * @method onLoaded - * @private - */ -PIXI.ImageLoader.prototype.onLoaded = function() -{ - this.emit('loaded', { content: this }); -}; - -/** - * Loads image and split it to uniform sized frames - * - * @method loadFramedSpriteSheet - * @param frameWidth {Number} width of each frame - * @param frameHeight {Number} height of each frame - * @param textureName {String} if given, the frames will be cached in - format - */ -PIXI.ImageLoader.prototype.loadFramedSpriteSheet = function(frameWidth, frameHeight, textureName) -{ - this.frames = []; - var cols = Math.floor(this.texture.width / frameWidth); - var rows = Math.floor(this.texture.height / frameHeight); - - var i=0; - for (var y=0; y 0) - { - textureLoader.addEventListener('loadedBaseTexture', function(evt){ - if (evt.content.content.loadingCount <= 0) - { - originalLoader.onLoaded(); - } - }); - } - else - { - originalLoader.onLoaded(); - } - }; - // start the loading // - atlasLoader.load(); - } - } - else - { - this.onLoaded(); - } -}; - -/** - * Invoke when json file loaded - * - * @method onLoaded - * @private - */ -PIXI.JsonLoader.prototype.onLoaded = function () { - this.loaded = true; - this.dispatchEvent({ - type: 'loaded', - content: this - }); -}; - -/** - * Invoke when error occured - * - * @method onError - * @private - */ -PIXI.JsonLoader.prototype.onError = function () { - - this.dispatchEvent({ - type: 'error', - content: this - }); -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/loaders/SpineLoader.js b/tutorial-1/pixi.js-master/src/pixi/loaders/SpineLoader.js deleted file mode 100755 index c736c50..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/loaders/SpineLoader.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * based on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi - * - * Awesome JS run time provided by EsotericSoftware - * https://github.com/EsotericSoftware/spine-runtimes - * - */ - -/** - * The Spine loader is used to load in JSON spine data - * To generate the data you need to use http://esotericsoftware.com/ and export in the "JSON" format - * Due to a clash of names You will need to change the extension of the spine file from *.json to *.anim for it to load - * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source - * You will need to generate a sprite sheet to accompany the spine data - * When loaded this class will dispatch a "loaded" event - * - * @class SpineLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.SpineLoader = function(url, crossorigin) -{ - /** - * The url of the bitmap font data - * - * @property url - * @type String - */ - this.url = url; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * [read-only] Whether the data has loaded yet - * - * @property loaded - * @type Boolean - * @readOnly - */ - this.loaded = false; -}; - -PIXI.SpineLoader.prototype.constructor = PIXI.SpineLoader; - -PIXI.EventTarget.mixin(PIXI.SpineLoader.prototype); - -/** - * Loads the JSON data - * - * @method load - */ -PIXI.SpineLoader.prototype.load = function () { - - var scope = this; - var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin); - jsonLoader.on('loaded', function (event) { - scope.json = event.data.content.json; - scope.onLoaded(); - }); - jsonLoader.load(); -}; - -/** - * Invoked when JSON file is loaded. - * - * @method onLoaded - * @private - */ -PIXI.SpineLoader.prototype.onLoaded = function () { - this.loaded = true; - this.emit('loaded', { content: this }); -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/loaders/SpriteSheetLoader.js b/tutorial-1/pixi.js-master/src/pixi/loaders/SpriteSheetLoader.js deleted file mode 100755 index 4d50430..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/loaders/SpriteSheetLoader.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * 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 in 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 a 'texture atlas') as it means sprites 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.fromFrameId() - * This loader will load the image file that the Spritesheet points to as well as the data. - * When loaded this class will dispatch a 'loaded' event - * - * @class SpriteSheetLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the sprite sheet JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.SpriteSheetLoader = function (url, crossorigin) { - - /** - * The url of the atlas data - * - * @property url - * @type String - */ - this.url = url; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * [read-only] The base url of the bitmap font data - * - * @property baseUrl - * @type String - * @readOnly - */ - this.baseUrl = url.replace(/[^\/]*$/, ''); - - /** - * The texture being loaded - * - * @property texture - * @type Texture - */ - this.texture = null; - - /** - * The frames of the sprite sheet - * - * @property frames - * @type Object - */ - this.frames = {}; -}; - -// constructor -PIXI.SpriteSheetLoader.prototype.constructor = PIXI.SpriteSheetLoader; - -PIXI.EventTarget.mixin(PIXI.SpriteSheetLoader.prototype); - -/** - * This will begin loading the JSON file - * - * @method load - */ -PIXI.SpriteSheetLoader.prototype.load = function () { - var scope = this; - var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin); - jsonLoader.on('loaded', function (event) { - scope.json = event.data.content.json; - scope.onLoaded(); - }); - jsonLoader.load(); -}; - -/** - * Invoke when all files are loaded (json and texture) - * - * @method onLoaded - * @private - */ -PIXI.SpriteSheetLoader.prototype.onLoaded = function () { - this.emit('loaded', { - content: this - }); -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/primitives/Graphics.js b/tutorial-1/pixi.js-master/src/pixi/primitives/Graphics.js deleted file mode 100755 index fcfdbb9..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/primitives/Graphics.js +++ /dev/null @@ -1,1140 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and color and fill them. - * - * @class Graphics - * @extends DisplayObjectContainer - * @constructor - */ -PIXI.Graphics = function() -{ - PIXI.DisplayObjectContainer.call( this ); - - this.renderable = true; - - /** - * The alpha value used when filling the Graphics object. - * - * @property fillAlpha - * @type Number - */ - this.fillAlpha = 1; - - /** - * The width (thickness) of any lines drawn. - * - * @property lineWidth - * @type Number - */ - this.lineWidth = 0; - - /** - * The color of any lines drawn. - * - * @property lineColor - * @type String - * @default 0 - */ - this.lineColor = 0; - - /** - * Graphics data - * - * @property graphicsData - * @type Array - * @private - */ - this.graphicsData = []; - - /** - * The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint. - * - * @property tint - * @type Number - * @default 0xFFFFFF - */ - this.tint = 0xFFFFFF; - - /** - * The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode. - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - /** - * Current path - * - * @property currentPath - * @type Object - * @private - */ - this.currentPath = null; - - /** - * Array containing some WebGL-related properties used by the WebGL renderer. - * - * @property _webGL - * @type Array - * @private - */ - this._webGL = []; - - /** - * Whether this shape is being used as a mask. - * - * @property isMask - * @type Boolean - */ - this.isMask = false; - - /** - * The bounds' padding used for bounds calculation. - * - * @property boundsPadding - * @type Number - */ - this.boundsPadding = 0; - - this._localBounds = new PIXI.Rectangle(0,0,1,1); - - /** - * Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated. - * - * @property dirty - * @type Boolean - * @private - */ - this.dirty = true; - - /** - * Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated. - * - * @property webGLDirty - * @type Boolean - * @private - */ - this.webGLDirty = false; - - /** - * Used to detect if the cached sprite object needs to be updated. - * - * @property cachedSpriteDirty - * @type Boolean - * @private - */ - this.cachedSpriteDirty = false; - -}; - -// constructor -PIXI.Graphics.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); -PIXI.Graphics.prototype.constructor = PIXI.Graphics; - -/** - * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. - * This is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory. - * It is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas. - * This is not recommended if you are constantly redrawing the graphics element. - * - * @property cacheAsBitmap - * @type Boolean - * @default false - * @private - */ -Object.defineProperty(PIXI.Graphics.prototype, "cacheAsBitmap", { - get: function() { - return this._cacheAsBitmap; - }, - set: function(value) { - this._cacheAsBitmap = value; - - if(this._cacheAsBitmap) - { - - this._generateCachedSprite(); - } - else - { - this.destroyCachedSprite(); - this.dirty = true; - } - - } -}); - -/** - * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method. - * - * @method lineStyle - * @param lineWidth {Number} width of the line to draw, will update the objects stored style - * @param color {Number} color of the line to draw, will update the objects stored style - * @param alpha {Number} alpha of the line to draw, will update the objects stored style - * @return {Graphics} - */ -PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha) -{ - this.lineWidth = lineWidth || 0; - this.lineColor = color || 0; - this.lineAlpha = (arguments.length < 3) ? 1 : alpha; - - if(this.currentPath) - { - if(this.currentPath.shape.points.length) - { - // halfway through a line? start a new one! - this.drawShape( new PIXI.Polygon( this.currentPath.shape.points.slice(-2) )); - return this; - } - - // otherwise its empty so lets just set the line properties - this.currentPath.lineWidth = this.lineWidth; - this.currentPath.lineColor = this.lineColor; - this.currentPath.lineAlpha = this.lineAlpha; - - } - - return this; -}; - -/** - * Moves the current drawing position to x, y. - * - * @method moveTo - * @param x {Number} the X coordinate to move to - * @param y {Number} the Y coordinate to move to - * @return {Graphics} - */ -PIXI.Graphics.prototype.moveTo = function(x, y) -{ - this.drawShape(new PIXI.Polygon([x,y])); - - return this; -}; - -/** - * Draws a line using the current line style from the current drawing position to (x, y); - * The current drawing position is then set to (x, y). - * - * @method lineTo - * @param x {Number} the X coordinate to draw to - * @param y {Number} the Y coordinate to draw to - * @return {Graphics} - */ -PIXI.Graphics.prototype.lineTo = function(x, y) -{ - this.currentPath.shape.points.push(x, y); - this.dirty = true; - - return this; -}; - -/** - * Calculate the points for a quadratic bezier curve and then draws it. - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c - * - * @method quadraticCurveTo - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Graphics} - */ -PIXI.Graphics.prototype.quadraticCurveTo = function(cpX, cpY, toX, toY) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0]; - } - else - { - this.moveTo(0,0); - } - - var xa, - ya, - n = 20, - points = this.currentPath.shape.points; - if(points.length === 0)this.moveTo(0, 0); - - - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - - var j = 0; - for (var i = 1; i <= n; i++ ) - { - j = i / n; - - xa = fromX + ( (cpX - fromX) * j ); - ya = fromY + ( (cpY - fromY) * j ); - - points.push( xa + ( ((cpX + ( (toX - cpX) * j )) - xa) * j ), - ya + ( ((cpY + ( (toY - cpY) * j )) - ya) * j ) ); - } - - - this.dirty = true; - - return this; -}; - -/** - * Calculate the points for a bezier curve and then draws it. - * - * @method bezierCurveTo - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param cpX2 {Number} Second Control point x - * @param cpY2 {Number} Second Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Graphics} - */ -PIXI.Graphics.prototype.bezierCurveTo = function(cpX, cpY, cpX2, cpY2, toX, toY) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0]; - } - else - { - this.moveTo(0,0); - } - - var n = 20, - dt, - dt2, - dt3, - t2, - t3, - points = this.currentPath.shape.points; - - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - - var j = 0; - - for (var i=1; i<=n; i++) - { - j = i / n; - - dt = (1 - j); - dt2 = dt * dt; - dt3 = dt2 * dt; - - t2 = j * j; - t3 = t2 * j; - - points.push( dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX, - dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY); - } - - this.dirty = true; - - return this; -}; - -/* - * The arcTo() method creates an arc/curve between two tangents on the canvas. - * - * "borrowed" from https://code.google.com/p/fxcanvas/ - thanks google! - * - * @method arcTo - * @param x1 {Number} The x-coordinate of the beginning of the arc - * @param y1 {Number} The y-coordinate of the beginning of the arc - * @param x2 {Number} The x-coordinate of the end of the arc - * @param y2 {Number} The y-coordinate of the end of the arc - * @param radius {Number} The radius of the arc - * @return {Graphics} - */ -PIXI.Graphics.prototype.arcTo = function(x1, y1, x2, y2, radius) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0) - { - this.currentPath.shape.points.push(x1, y1); - } - } - else - { - this.moveTo(x1, y1); - } - - var points = this.currentPath.shape.points; - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - var a1 = fromY - y1; - var b1 = fromX - x1; - var a2 = y2 - y1; - var b2 = x2 - x1; - var mm = Math.abs(a1 * b2 - b1 * a2); - - - if (mm < 1.0e-8 || radius === 0) - { - if( points[points.length-2] !== x1 || points[points.length-1] !== y1) - { - //console.log(">>") - points.push(x1, y1); - } - } - else - { - var dd = a1 * a1 + b1 * b1; - var cc = a2 * a2 + b2 * b2; - var tt = a1 * a2 + b1 * b2; - var k1 = radius * Math.sqrt(dd) / mm; - var k2 = radius * Math.sqrt(cc) / mm; - var j1 = k1 * tt / dd; - var j2 = k2 * tt / cc; - var cx = k1 * b2 + k2 * b1; - var cy = k1 * a2 + k2 * a1; - var px = b1 * (k2 + j1); - var py = a1 * (k2 + j1); - var qx = b2 * (k1 + j2); - var qy = a2 * (k1 + j2); - var startAngle = Math.atan2(py - cy, px - cx); - var endAngle = Math.atan2(qy - cy, qx - cx); - - this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1); - } - - this.dirty = true; - - return this; -}; - -/** - * The arc method creates an arc/curve (used to create circles, or parts of circles). - * - * @method arc - * @param cx {Number} The x-coordinate of the center of the circle - * @param cy {Number} The y-coordinate of the center of the circle - * @param radius {Number} The radius of the circle - * @param startAngle {Number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) - * @param endAngle {Number} The ending angle, in radians - * @param anticlockwise {Boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {Graphics} - */ -PIXI.Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) -{ - var startX = cx + Math.cos(startAngle) * radius; - var startY = cy + Math.sin(startAngle) * radius; - var points; - - if( this.currentPath ) - { - points = this.currentPath.shape.points; - - if(points.length === 0) - { - points.push(startX, startY); - } - else if( points[points.length-2] !== startX || points[points.length-1] !== startY) - { - points.push(startX, startY); - } - } - else - { - this.moveTo(startX, startY); - points = this.currentPath.shape.points; - } - - if (startAngle === endAngle)return this; - - if( !anticlockwise && endAngle <= startAngle ) - { - endAngle += Math.PI * 2; - } - else if( anticlockwise && startAngle <= endAngle ) - { - startAngle += Math.PI * 2; - } - - var sweep = anticlockwise ? (startAngle - endAngle) *-1 : (endAngle - startAngle); - var segs = ( Math.abs(sweep)/ (Math.PI * 2) ) * 40; - - if( sweep === 0 ) return this; - - var theta = sweep/(segs*2); - var theta2 = theta*2; - - var cTheta = Math.cos(theta); - var sTheta = Math.sin(theta); - - var segMinus = segs - 1; - - var remainder = ( segMinus % 1 ) / segMinus; - - for(var i=0; i<=segMinus; i++) - { - var real = i + remainder * i; - - - var angle = ((theta) + startAngle + (theta2 * real)); - - var c = Math.cos(angle); - var s = -Math.sin(angle); - - points.push(( (cTheta * c) + (sTheta * s) ) * radius + cx, - ( (cTheta * -s) + (sTheta * c) ) * radius + cy); - } - - this.dirty = true; - - return this; -}; - -/** - * Specifies a simple one-color fill that subsequent calls to other Graphics methods - * (such as lineTo() or drawCircle()) use when drawing. - * - * @method beginFill - * @param color {Number} the color of the fill - * @param alpha {Number} the alpha of the fill - * @return {Graphics} - */ -PIXI.Graphics.prototype.beginFill = function(color, alpha) -{ - this.filling = true; - this.fillColor = color || 0; - this.fillAlpha = (alpha === undefined) ? 1 : alpha; - - if(this.currentPath) - { - if(this.currentPath.shape.points.length <= 2) - { - this.currentPath.fill = this.filling; - this.currentPath.fillColor = this.fillColor; - this.currentPath.fillAlpha = this.fillAlpha; - } - } - return this; -}; - -/** - * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. - * - * @method endFill - * @return {Graphics} - */ -PIXI.Graphics.prototype.endFill = function() -{ - this.filling = false; - this.fillColor = null; - this.fillAlpha = 1; - - return this; -}; - -/** - * Draws a rectangle. - * - * @method drawRect - * - * @param x {Number} The X coord of the top-left of the rectangle - * @param y {Number} The Y coord of the top-left of the rectangle - * @param width {Number} The width of the rectangle - * @param height {Number} The height of the rectangle - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawRect = function( x, y, width, height ) -{ - this.drawShape(new PIXI.Rectangle(x,y, width, height)); - - return this; -}; - -/** - * Draws a rounded rectangle. - * - * @method drawRoundedRect - * - * @param x {Number} The X coord of the top-left of the rectangle - * @param y {Number} The Y coord of the top-left of the rectangle - * @param width {Number} The width of the rectangle - * @param height {Number} The height of the rectangle - * @param radius {Number} Radius of the rectangle corners - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawRoundedRect = function( x, y, width, height, radius ) -{ - this.drawShape(new PIXI.RoundedRectangle(x, y, width, height, radius)); - - return this; -}; - -/** - * Draws a circle. - * - * @method drawCircle - * @param x {Number} The X coordinate of the center of the circle - * @param y {Number} The Y coordinate of the center of the circle - * @param radius {Number} The radius of the circle - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawCircle = function(x, y, radius) -{ - this.drawShape(new PIXI.Circle(x,y, radius)); - - return this; -}; - -/** - * Draws an ellipse. - * - * @method drawEllipse - * @param x {Number} The X coordinate of the center of the ellipse - * @param y {Number} The Y coordinate of the center of the ellipse - * @param width {Number} The half width of the ellipse - * @param height {Number} The half height of the ellipse - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawEllipse = function(x, y, width, height) -{ - this.drawShape(new PIXI.Ellipse(x, y, width, height)); - - return this; -}; - -/** - * Draws a polygon using the given path. - * - * @method drawPolygon - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawPolygon = function(path) -{ - if(!(path instanceof Array))path = Array.prototype.slice.call(arguments); - this.drawShape(new PIXI.Polygon(path)); - return this; -}; - -/** - * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. - * - * @method clear - * @return {Graphics} - */ -PIXI.Graphics.prototype.clear = function() -{ - this.lineWidth = 0; - this.filling = false; - - this.dirty = true; - this.clearDirty = true; - this.graphicsData = []; - - return this; -}; - -/** - * Useful function that returns a texture of the graphics object that can then be used to create sprites - * This can be quite useful if your geometry is complicated and needs to be reused multiple times. - * - * @method generateTexture - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts - * @return {Texture} a texture of the graphics object - */ -PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode) -{ - resolution = resolution || 1; - - var bounds = this.getBounds(); - - var canvasBuffer = new PIXI.CanvasBuffer(bounds.width * resolution, bounds.height * resolution); - - var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas, scaleMode); - texture.baseTexture.resolution = resolution; - - canvasBuffer.context.scale(resolution, resolution); - - canvasBuffer.context.translate(-bounds.x,-bounds.y); - - PIXI.CanvasGraphics.renderGraphics(this, canvasBuffer.context); - - return texture; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Graphics.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(this.visible === false || this.alpha === 0 || this.isMask === true)return; - - if(this._cacheAsBitmap) - { - - if(this.dirty || this.cachedSpriteDirty) - { - - this._generateCachedSprite(); - - // we will also need to update the texture on the gpu too! - this.updateCachedSpriteTexture(); - - this.cachedSpriteDirty = false; - this.dirty = false; - } - - this._cachedSprite.worldAlpha = this.worldAlpha; - PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession); - - return; - } - else - { - renderSession.spriteBatch.stop(); - renderSession.blendModeManager.setBlendMode(this.blendMode); - - if(this._mask)renderSession.maskManager.pushMask(this._mask, renderSession); - if(this._filters)renderSession.filterManager.pushFilter(this._filterBlock); - - // check blend mode - if(this.blendMode !== renderSession.spriteBatch.currentBlendMode) - { - renderSession.spriteBatch.currentBlendMode = this.blendMode; - var blendModeWebGL = PIXI.blendModesWebGL[renderSession.spriteBatch.currentBlendMode]; - renderSession.spriteBatch.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); - } - - // check if the webgl graphic needs to be updated - if(this.webGLDirty) - { - this.dirty = true; - this.webGLDirty = false; - } - - PIXI.WebGLGraphics.renderGraphics(this, renderSession); - - // only render if it has children! - if(this.children.length) - { - renderSession.spriteBatch.start(); - - // simple render children! - for(var i=0, j=this.children.length; i maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - - this._bounds.x = minX; - this._bounds.width = maxX - minX; - - this._bounds.y = minY; - this._bounds.height = maxY - minY; - - return this._bounds; -}; - -/** - * Update the bounds of the object - * - * @method updateLocalBounds - */ -PIXI.Graphics.prototype.updateLocalBounds = function() -{ - var minX = Infinity; - var maxX = -Infinity; - - var minY = Infinity; - var maxY = -Infinity; - - if(this.graphicsData.length) - { - var shape, points, x, y, w, h; - - for (var i = 0; i < this.graphicsData.length; i++) { - var data = this.graphicsData[i]; - var type = data.type; - var lineWidth = data.lineWidth; - shape = data.shape; - - - if(type === PIXI.Graphics.RECT || type === PIXI.Graphics.RREC) - { - x = shape.x - lineWidth/2; - y = shape.y - lineWidth/2; - w = shape.width + lineWidth; - h = shape.height + lineWidth; - - minX = x < minX ? x : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y < minY ? y : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else if(type === PIXI.Graphics.CIRC) - { - x = shape.x; - y = shape.y; - w = shape.radius + lineWidth/2; - h = shape.radius + lineWidth/2; - - minX = x - w < minX ? x - w : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y - h < minY ? y - h : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else if(type === PIXI.Graphics.ELIP) - { - x = shape.x; - y = shape.y; - w = shape.width + lineWidth/2; - h = shape.height + lineWidth/2; - - minX = x - w < minX ? x - w : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y - h < minY ? y - h : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else - { - // POLY - points = shape.points; - - for (var j = 0; j < points.length; j+=2) - { - - x = points[j]; - y = points[j+1]; - minX = x-lineWidth < minX ? x-lineWidth : minX; - maxX = x+lineWidth > maxX ? x+lineWidth : maxX; - - minY = y-lineWidth < minY ? y-lineWidth : minY; - maxY = y+lineWidth > maxY ? y+lineWidth : maxY; - } - } - } - } - else - { - minX = 0; - maxX = 0; - minY = 0; - maxY = 0; - } - - var padding = this.boundsPadding; - - this._localBounds.x = minX - padding; - this._localBounds.width = (maxX - minX) + padding * 2; - - this._localBounds.y = minY - padding; - this._localBounds.height = (maxY - minY) + padding * 2; -}; - -/** - * Generates the cached sprite when the sprite has cacheAsBitmap = true - * - * @method _generateCachedSprite - * @private - */ -PIXI.Graphics.prototype._generateCachedSprite = function() -{ - var bounds = this.getLocalBounds(); - - if(!this._cachedSprite) - { - var canvasBuffer = new PIXI.CanvasBuffer(bounds.width, bounds.height); - var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); - - this._cachedSprite = new PIXI.Sprite(texture); - this._cachedSprite.buffer = canvasBuffer; - - this._cachedSprite.worldTransform = this.worldTransform; - } - else - { - this._cachedSprite.buffer.resize(bounds.width, bounds.height); - } - - // leverage the anchor to account for the offset of the element - this._cachedSprite.anchor.x = -( bounds.x / bounds.width ); - this._cachedSprite.anchor.y = -( bounds.y / bounds.height ); - - // this._cachedSprite.buffer.context.save(); - this._cachedSprite.buffer.context.translate(-bounds.x,-bounds.y); - - // make sure we set the alpha of the graphics to 1 for the render.. - this.worldAlpha = 1; - - // now render the graphic.. - PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context); - this._cachedSprite.alpha = this.alpha; -}; - -/** - * Updates texture size based on canvas size - * - * @method updateCachedSpriteTexture - * @private - */ -PIXI.Graphics.prototype.updateCachedSpriteTexture = function() -{ - var cachedSprite = this._cachedSprite; - var texture = cachedSprite.texture; - var canvas = cachedSprite.buffer.canvas; - - texture.baseTexture.width = canvas.width; - texture.baseTexture.height = canvas.height; - texture.crop.width = texture.frame.width = canvas.width; - texture.crop.height = texture.frame.height = canvas.height; - - cachedSprite._width = canvas.width; - cachedSprite._height = canvas.height; - - // update the dirty base textures - texture.baseTexture.dirty(); -}; - -/** - * Destroys a previous cached sprite. - * - * @method destroyCachedSprite - */ -PIXI.Graphics.prototype.destroyCachedSprite = function() -{ - this._cachedSprite.texture.destroy(true); - - // let the gc collect the unused sprite - // TODO could be object pooled! - this._cachedSprite = null; -}; - -/** - * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. - * - * @method drawShape - * @param {Circle|Rectangle|Ellipse|Line|Polygon} shape The Shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. - */ -PIXI.Graphics.prototype.drawShape = function(shape) -{ - if(this.currentPath) - { - // check current path! - if(this.currentPath.shape.points.length <= 2)this.graphicsData.pop(); - } - - this.currentPath = null; - - var data = new PIXI.GraphicsData(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, shape); - - this.graphicsData.push(data); - - if(data.type === PIXI.Graphics.POLY) - { - data.shape.closed = this.filling; - this.currentPath = data; - } - - this.dirty = true; - - return data; -}; - -/** - * A GraphicsData object. - * - * @class GraphicsData - * @constructor - */ -PIXI.GraphicsData = function(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, shape) -{ - this.lineWidth = lineWidth; - this.lineColor = lineColor; - this.lineAlpha = lineAlpha; - this._lineTint = lineColor; - - this.fillColor = fillColor; - this.fillAlpha = fillAlpha; - this._fillTint = fillColor; - this.fill = fill; - - this.shape = shape; - this.type = shape.type; -}; - -// SOME TYPES: -PIXI.Graphics.POLY = 0; -PIXI.Graphics.RECT = 1; -PIXI.Graphics.CIRC = 2; -PIXI.Graphics.ELIP = 3; -PIXI.Graphics.RREC = 4; - -PIXI.Polygon.prototype.type = PIXI.Graphics.POLY; -PIXI.Rectangle.prototype.type = PIXI.Graphics.RECT; -PIXI.Circle.prototype.type = PIXI.Graphics.CIRC; -PIXI.Ellipse.prototype.type = PIXI.Graphics.ELIP; -PIXI.RoundedRectangle.prototype.type = PIXI.Graphics.RREC; - diff --git a/tutorial-1/pixi.js-master/src/pixi/renderers/canvas/CanvasGraphics.js b/tutorial-1/pixi.js-master/src/pixi/renderers/canvas/CanvasGraphics.js deleted file mode 100755 index 1fb5372..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/renderers/canvas/CanvasGraphics.js +++ /dev/null @@ -1,358 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - - -/** - * A set of functions used by the canvas renderer to draw the primitive graphics data. - * - * @class CanvasGraphics - * @static - */ -PIXI.CanvasGraphics = function() -{ -}; - -/* - * Renders a PIXI.Graphics object to a canvas. - * - * @method renderGraphics - * @static - * @param graphics {Graphics} the actual graphics object to render - * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas - */ -PIXI.CanvasGraphics.renderGraphics = function(graphics, context) -{ - var worldAlpha = graphics.worldAlpha; - - if(graphics.dirty) - { - this.updateGraphicsTint(graphics); - graphics.dirty = false; - } - - - for (var i = 0; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - var shape = data.shape; - - var fillColor = data._fillTint; - var lineColor = data._lineTint; - - context.lineWidth = data.lineWidth; - - if(data.type === PIXI.Graphics.POLY) - { - context.beginPath(); - - var points = shape.points; - - context.moveTo(points[0], points[1]); - - for (var j=1; j < points.length/2; j++) - { - context.lineTo(points[j * 2], points[j * 2 + 1]); - } - - if(shape.closed) - { - context.lineTo(points[0], points[1]); - } - - // if the first and last point are the same close the path - much neater :) - if(points[0] === points[points.length-2] && points[1] === points[points.length-1]) - { - context.closePath(); - } - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if(data.type === PIXI.Graphics.RECT) - { - - if(data.fillColor || data.fillColor === 0) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fillRect(shape.x, shape.y, shape.width, shape.height); - - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.strokeRect(shape.x, shape.y, shape.width, shape.height); - } - } - else if(data.type === PIXI.Graphics.CIRC) - { - // TODO - need to be Undefined! - context.beginPath(); - context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI); - context.closePath(); - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if(data.type === PIXI.Graphics.ELIP) - { - // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas - - var w = shape.width * 2; - var h = shape.height * 2; - - var x = shape.x - w/2; - var y = shape.y - h/2; - - context.beginPath(); - - var kappa = 0.5522848, - ox = (w / 2) * kappa, // control point offset horizontal - oy = (h / 2) * kappa, // control point offset vertical - xe = x + w, // x-end - ye = y + h, // y-end - xm = x + w / 2, // x-middle - ym = y + h / 2; // y-middle - - context.moveTo(x, ym); - context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); - context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); - context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); - context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); - - context.closePath(); - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if (data.type === PIXI.Graphics.RREC) - { - var rx = shape.x; - var ry = shape.y; - var width = shape.width; - var height = shape.height; - var radius = shape.radius; - - var maxRadius = Math.min(width, height) / 2 | 0; - radius = radius > maxRadius ? maxRadius : radius; - - context.beginPath(); - context.moveTo(rx, ry + radius); - context.lineTo(rx, ry + height - radius); - context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height); - context.lineTo(rx + width - radius, ry + height); - context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius); - context.lineTo(rx + width, ry + radius); - context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry); - context.lineTo(rx + radius, ry); - context.quadraticCurveTo(rx, ry, rx, ry + radius); - context.closePath(); - - if(data.fillColor || data.fillColor === 0) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - } -}; - -/* - * Renders a graphics mask - * - * @static - * @private - * @method renderGraphicsMask - * @param graphics {Graphics} the graphics which will be used as a mask - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas - */ -PIXI.CanvasGraphics.renderGraphicsMask = function(graphics, context) -{ - var len = graphics.graphicsData.length; - - if(len === 0) return; - - if(len > 1) - { - len = 1; - window.console.log('Pixi.js warning: masks in canvas can only mask using the first path in the graphics object'); - } - - for (var i = 0; i < 1; i++) - { - var data = graphics.graphicsData[i]; - var shape = data.shape; - - if(data.type === PIXI.Graphics.POLY) - { - context.beginPath(); - - var points = shape.points; - - context.moveTo(points[0], points[1]); - - for (var j=1; j < points.length/2; j++) - { - context.lineTo(points[j * 2], points[j * 2 + 1]); - } - - // if the first and last point are the same close the path - much neater :) - if(points[0] === points[points.length-2] && points[1] === points[points.length-1]) - { - context.closePath(); - } - - } - else if(data.type === PIXI.Graphics.RECT) - { - context.beginPath(); - context.rect(shape.x, shape.y, shape.width, shape.height); - context.closePath(); - } - else if(data.type === PIXI.Graphics.CIRC) - { - // TODO - need to be Undefined! - context.beginPath(); - context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI); - context.closePath(); - } - else if(data.type === PIXI.Graphics.ELIP) - { - - // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas - - var w = shape.width * 2; - var h = shape.height * 2; - - var x = shape.x - w/2; - var y = shape.y - h/2; - - context.beginPath(); - - var kappa = 0.5522848, - ox = (w / 2) * kappa, // control point offset horizontal - oy = (h / 2) * kappa, // control point offset vertical - xe = x + w, // x-end - ye = y + h, // y-end - xm = x + w / 2, // x-middle - ym = y + h / 2; // y-middle - - context.moveTo(x, ym); - context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); - context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); - context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); - context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); - context.closePath(); - } - else if (data.type === PIXI.Graphics.RREC) - { - - var pts = shape.points; - var rx = pts[0]; - var ry = pts[1]; - var width = pts[2]; - var height = pts[3]; - var radius = pts[4]; - - var maxRadius = Math.min(width, height) / 2 | 0; - radius = radius > maxRadius ? maxRadius : radius; - - context.beginPath(); - context.moveTo(rx, ry + radius); - context.lineTo(rx, ry + height - radius); - context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height); - context.lineTo(rx + width - radius, ry + height); - context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius); - context.lineTo(rx + width, ry + radius); - context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry); - context.lineTo(rx + radius, ry); - context.quadraticCurveTo(rx, ry, rx, ry + radius); - context.closePath(); - } - } -}; - -PIXI.CanvasGraphics.updateGraphicsTint = function(graphics) -{ - if(graphics.tint === 0xFFFFFF)return; - - var tintR = (graphics.tint >> 16 & 0xFF) / 255; - var tintG = (graphics.tint >> 8 & 0xFF) / 255; - var tintB = (graphics.tint & 0xFF)/ 255; - - for (var i = 0; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - - var fillColor = data.fillColor | 0; - var lineColor = data.lineColor | 0; - - /* - var colorR = (fillColor >> 16 & 0xFF) / 255; - var colorG = (fillColor >> 8 & 0xFF) / 255; - var colorB = (fillColor & 0xFF) / 255; - - colorR *= tintR; - colorG *= tintG; - colorB *= tintB; - - fillColor = ((colorR*255 << 16) + (colorG*255 << 8) + colorB*255); - - colorR = (lineColor >> 16 & 0xFF) / 255; - colorG = (lineColor >> 8 & 0xFF) / 255; - colorB = (lineColor & 0xFF) / 255; - - colorR *= tintR; - colorG *= tintG; - colorB *= tintB; - - lineColor = ((colorR*255 << 16) + (colorG*255 << 8) + colorB*255); - */ - - // super inline cos im an optimization NAZI :) - data._fillTint = (((fillColor >> 16 & 0xFF) / 255 * tintR*255 << 16) + ((fillColor >> 8 & 0xFF) / 255 * tintG*255 << 8) + (fillColor & 0xFF) / 255 * tintB*255); - data._lineTint = (((lineColor >> 16 & 0xFF) / 255 * tintR*255 << 16) + ((lineColor >> 8 & 0xFF) / 255 * tintG*255 << 8) + (lineColor & 0xFF) / 255 * tintB*255); - - } -}; - diff --git a/tutorial-1/pixi.js-master/src/pixi/renderers/canvas/CanvasRenderer.js b/tutorial-1/pixi.js-master/src/pixi/renderers/canvas/CanvasRenderer.js deleted file mode 100755 index 86a12f9..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/renderers/canvas/CanvasRenderer.js +++ /dev/null @@ -1,345 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The CanvasRenderer draws the Stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. - * Don't forget to add the CanvasRenderer.view to your DOM or you will not see anything :) - * - * @class CanvasRenderer - * @constructor - * @param [width=800] {Number} the width of the canvas view - * @param [height=600] {Number} the height of the canvas view - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * @param [options.clearBeforeRender=true] {Boolean} This sets if the CanvasRenderer will clear the canvas or not before the new render pass. - */ -PIXI.CanvasRenderer = function(width, height, options) -{ - if(options) - { - for (var i in PIXI.defaultRenderOptions) - { - if (typeof options[i] === "undefined") options[i] = PIXI.defaultRenderOptions[i]; - } - } - else - { - options = PIXI.defaultRenderOptions; - } - - if(!PIXI.defaultRenderer) - { - PIXI.sayHello("Canvas"); - PIXI.defaultRenderer = this; - } - - /** - * The renderer type. - * - * @property type - * @type Number - */ - this.type = PIXI.CANVAS_RENDERER; - - /** - * The resolution of the canvas. - * - * @property resolution - * @type Number - */ - this.resolution = options.resolution; - - /** - * This sets if the CanvasRenderer will clear the canvas or not before the new render pass. - * If the Stage is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color. - * If the Stage is transparent Pixi will use clearRect to clear the canvas every frame. - * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set. - * - * @property clearBeforeRender - * @type Boolean - * @default - */ - this.clearBeforeRender = options.clearBeforeRender; - - /** - * Whether the render view is transparent - * - * @property transparent - * @type Boolean - */ - this.transparent = options.transparent; - - /** - * Whether the render view should be resized automatically - * - * @property autoResize - * @type Boolean - */ - this.autoResize = options.autoResize || false; - - - /** - * The width of the canvas view - * - * @property width - * @type Number - * @default 800 - */ - this.width = width || 800; - - /** - * The height of the canvas view - * - * @property height - * @type Number - * @default 600 - */ - this.height = height || 600; - - this.width *= this.resolution; - this.height *= this.resolution; - - /** - * The canvas element that everything is drawn to. - * - * @property view - * @type HTMLCanvasElement - */ - this.view = options.view || document.createElement( "canvas" ); - - /** - * The canvas 2d context that everything is drawn with - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.view.getContext( "2d", { alpha: this.transparent } ); - - /** - * Boolean flag controlling canvas refresh. - * - * @property refresh - * @type Boolean - */ - this.refresh = true; - - this.view.width = this.width * this.resolution; - this.view.height = this.height * this.resolution; - - /** - * Internal var. - * - * @property count - * @type Number - */ - this.count = 0; - - /** - * Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer - * @property maskManager - * @type CanvasMaskManager - */ - this.maskManager = new PIXI.CanvasMaskManager(); - - /** - * The render session is just a bunch of parameter used for rendering - * @property renderSession - * @type Object - */ - this.renderSession = { - context: this.context, - maskManager: this.maskManager, - scaleMode: null, - smoothProperty: null, - /** - * If true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation. - * Handy for crisp pixel art and speed on legacy devices. - * - */ - roundPixels: false - }; - - this.mapBlendModes(); - - this.resize(width, height); - - if("imageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "imageSmoothingEnabled"; - else if("webkitImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "webkitImageSmoothingEnabled"; - else if("mozImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "mozImageSmoothingEnabled"; - else if("oImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "oImageSmoothingEnabled"; - else if ("msImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "msImageSmoothingEnabled"; -}; - -// constructor -PIXI.CanvasRenderer.prototype.constructor = PIXI.CanvasRenderer; - -/** - * Renders the Stage to this canvas view - * - * @method render - * @param stage {Stage} the Stage element to be rendered - */ -PIXI.CanvasRenderer.prototype.render = function(stage) -{ - stage.updateTransform(); - - this.context.setTransform(1,0,0,1,0,0); - - this.context.globalAlpha = 1; - - this.renderSession.currentBlendMode = PIXI.blendModes.NORMAL; - this.context.globalCompositeOperation = PIXI.blendModesCanvas[PIXI.blendModes.NORMAL]; - - if (navigator.isCocoonJS && this.view.screencanvas) { - this.context.fillStyle = "black"; - this.context.clear(); - } - - if (this.clearBeforeRender) - { - if (this.transparent) - { - this.context.clearRect(0, 0, this.width, this.height); - } - else - { - this.context.fillStyle = stage.backgroundColorString; - this.context.fillRect(0, 0, this.width , this.height); - } - } - - this.renderDisplayObject(stage); - - // run interaction! - if(stage.interactive) - { - //need to add some events! - if(!stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = true; - stage.interactionManager.setTarget(this); - } - } -}; - -/** - * Removes everything from the renderer and optionally removes the Canvas DOM element. - * - * @method destroy - * @param [removeView=true] {boolean} Removes the Canvas element from the DOM. - */ -PIXI.CanvasRenderer.prototype.destroy = function(removeView) -{ - if (typeof removeView === "undefined") { removeView = true; } - - if (removeView && this.view.parent) - { - this.view.parent.removeChild(this.view); - } - - this.view = null; - this.context = null; - this.maskManager = null; - this.renderSession = null; - -}; - -/** - * Resizes the canvas view to the specified width and height - * - * @method resize - * @param width {Number} the new width of the canvas view - * @param height {Number} the new height of the canvas view - */ -PIXI.CanvasRenderer.prototype.resize = function(width, height) -{ - this.width = width * this.resolution; - this.height = height * this.resolution; - - this.view.width = this.width; - this.view.height = this.height; - - if (this.autoResize) { - this.view.style.width = this.width / this.resolution + "px"; - this.view.style.height = this.height / this.resolution + "px"; - } -}; - -/** - * Renders a display object - * - * @method renderDisplayObject - * @param displayObject {DisplayObject} The displayObject to render - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas - * @private - */ -PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject, context) -{ - this.renderSession.context = context || this.context; - this.renderSession.resolution = this.resolution; - displayObject._renderCanvas(this.renderSession); -}; - -/** - * Maps Pixi blend modes to canvas blend modes. - * - * @method mapBlendModes - * @private - */ -PIXI.CanvasRenderer.prototype.mapBlendModes = function() -{ - if(!PIXI.blendModesCanvas) - { - PIXI.blendModesCanvas = []; - - if(PIXI.canUseNewCanvasBlendModes()) - { - PIXI.blendModesCanvas[PIXI.blendModes.NORMAL] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.ADD] = "lighter"; //IS THIS OK??? - PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "multiply"; - PIXI.blendModesCanvas[PIXI.blendModes.SCREEN] = "screen"; - PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY] = "overlay"; - PIXI.blendModesCanvas[PIXI.blendModes.DARKEN] = "darken"; - PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN] = "lighten"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "color-dodge"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "color-burn"; - PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "hard-light"; - PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "soft-light"; - PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "difference"; - PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "exclusion"; - PIXI.blendModesCanvas[PIXI.blendModes.HUE] = "hue"; - PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "saturation"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR] = "color"; - PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "luminosity"; - } - else - { - // this means that the browser does not support the cool new blend modes in canvas "cough" ie "cough" - PIXI.blendModesCanvas[PIXI.blendModes.NORMAL] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.ADD] = "lighter"; //IS THIS OK??? - PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SCREEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.DARKEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.HUE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "source-over"; - } - } -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasBuffer.js b/tutorial-1/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasBuffer.js deleted file mode 100755 index b53d851..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasBuffer.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Creates a Canvas element of the given size. - * - * @class CanvasBuffer - * @constructor - * @param width {Number} the width for the newly created canvas - * @param height {Number} the height for the newly created canvas - */ -PIXI.CanvasBuffer = function(width, height) -{ - /** - * The width of the Canvas in pixels. - * - * @property width - * @type Number - */ - this.width = width; - - /** - * The height of the Canvas in pixels. - * - * @property height - * @type Number - */ - this.height = height; - - /** - * The Canvas object that belongs to this CanvasBuffer. - * - * @property canvas - * @type HTMLCanvasElement - */ - this.canvas = document.createElement("canvas"); - - /** - * A CanvasRenderingContext2D object representing a two-dimensional rendering context. - * - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.canvas.getContext("2d"); - - this.canvas.width = width; - this.canvas.height = height; -}; - -PIXI.CanvasBuffer.prototype.constructor = PIXI.CanvasBuffer; - -/** - * Clears the canvas that was created by the CanvasBuffer class. - * - * @method clear - * @private - */ -PIXI.CanvasBuffer.prototype.clear = function() -{ - this.context.setTransform(1, 0, 0, 1, 0, 0); - this.context.clearRect(0,0, this.width, this.height); -}; - -/** - * Resizes the canvas to the specified width and height. - * - * @method resize - * @param width {Number} the new width of the canvas - * @param height {Number} the new height of the canvas - */ -PIXI.CanvasBuffer.prototype.resize = function(width, height) -{ - this.width = this.canvas.width = width; - this.height = this.canvas.height = height; -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasMaskManager.js b/tutorial-1/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasMaskManager.js deleted file mode 100755 index 748adda..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasMaskManager.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A set of functions used to handle masking. - * - * @class CanvasMaskManager - * @constructor - */ -PIXI.CanvasMaskManager = function() -{ -}; - -PIXI.CanvasMaskManager.prototype.constructor = PIXI.CanvasMaskManager; - -/** - * This method adds it to the current stack of masks. - * - * @method pushMask - * @param maskData {Object} the maskData that will be pushed - * @param renderSession {Object} The renderSession whose context will be used for this mask manager. - */ -PIXI.CanvasMaskManager.prototype.pushMask = function(maskData, renderSession) -{ - var context = renderSession.context; - - context.save(); - - var cacheAlpha = maskData.alpha; - var transform = maskData.worldTransform; - - var resolution = renderSession.resolution; - - context.setTransform(transform.a * resolution, - transform.b * resolution, - transform.c * resolution, - transform.d * resolution, - transform.tx * resolution, - transform.ty * resolution); - - PIXI.CanvasGraphics.renderGraphicsMask(maskData, context); - - context.clip(); - - maskData.worldAlpha = cacheAlpha; -}; - -/** - * Restores the current drawing context to the state it was before the mask was applied. - * - * @method popMask - * @param renderSession {Object} The renderSession whose context will be used for this mask manager. - */ -PIXI.CanvasMaskManager.prototype.popMask = function(renderSession) -{ - renderSession.context.restore(); -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasTinter.js b/tutorial-1/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasTinter.js deleted file mode 100755 index dd50b06..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasTinter.js +++ /dev/null @@ -1,242 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Utility methods for Sprite/Texture tinting. - * - * @class CanvasTinter - * @static - */ -PIXI.CanvasTinter = function() -{ -}; - -/** - * Basically this method just needs a sprite and a color and tints the sprite with the given color. - * - * @method getTintedTexture - * @static - * @param sprite {Sprite} the sprite to tint - * @param color {Number} the color to use to tint the sprite with - * @return {HTMLCanvasElement} The tinted canvas - */ -PIXI.CanvasTinter.getTintedTexture = function(sprite, color) -{ - var texture = sprite.texture; - - color = PIXI.CanvasTinter.roundColor(color); - - var stringColor = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - - texture.tintCache = texture.tintCache || {}; - - if(texture.tintCache[stringColor]) return texture.tintCache[stringColor]; - - // clone texture.. - var canvas = PIXI.CanvasTinter.canvas || document.createElement("canvas"); - - //PIXI.CanvasTinter.tintWithPerPixel(texture, stringColor, canvas); - PIXI.CanvasTinter.tintMethod(texture, color, canvas); - - if(PIXI.CanvasTinter.convertTintToImage) - { - // is this better? - var tintImage = new Image(); - tintImage.src = canvas.toDataURL(); - - texture.tintCache[stringColor] = tintImage; - } - else - { - texture.tintCache[stringColor] = canvas; - // if we are not converting the texture to an image then we need to lose the reference to the canvas - PIXI.CanvasTinter.canvas = null; - } - - return canvas; -}; - -/** - * Tint a texture using the "multiply" operation. - * - * @method tintWithMultiply - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithMultiply = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - - context.fillRect(0, 0, crop.width, crop.height); - - context.globalCompositeOperation = "multiply"; - - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - context.globalCompositeOperation = "destination-atop"; - - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); -}; - -/** - * Tint a texture using the "overlay" operation. - * - * @method tintWithOverlay - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithOverlay = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.globalCompositeOperation = "copy"; - context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - context.fillRect(0, 0, crop.width, crop.height); - - context.globalCompositeOperation = "destination-atop"; - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - //context.globalCompositeOperation = "copy"; -}; - -/** - * Tint a texture pixel per pixel. - * - * @method tintPerPixel - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithPerPixel = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.globalCompositeOperation = "copy"; - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - var rgbValues = PIXI.hex2rgb(color); - var r = rgbValues[0], g = rgbValues[1], b = rgbValues[2]; - - var pixelData = context.getImageData(0, 0, crop.width, crop.height); - - var pixels = pixelData.data; - - for (var i = 0; i < pixels.length; i += 4) - { - pixels[i+0] *= r; - pixels[i+1] *= g; - pixels[i+2] *= b; - } - - context.putImageData(pixelData, 0, 0); -}; - -/** - * Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel. - * - * @method roundColor - * @static - * @param color {number} the color to round, should be a hex color - */ -PIXI.CanvasTinter.roundColor = function(color) -{ - var step = PIXI.CanvasTinter.cacheStepsPerColorChannel; - - var rgbValues = PIXI.hex2rgb(color); - - rgbValues[0] = Math.min(255, (rgbValues[0] / step) * step); - rgbValues[1] = Math.min(255, (rgbValues[1] / step) * step); - rgbValues[2] = Math.min(255, (rgbValues[2] / step) * step); - - return PIXI.rgb2hex(rgbValues); -}; - -/** - * Number of steps which will be used as a cap when rounding colors. - * - * @property cacheStepsPerColorChannel - * @type Number - * @static - */ -PIXI.CanvasTinter.cacheStepsPerColorChannel = 8; - -/** - * Tint cache boolean flag. - * - * @property convertTintToImage - * @type Boolean - * @static - */ -PIXI.CanvasTinter.convertTintToImage = false; - -/** - * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. - * - * @property canUseMultiply - * @type Boolean - * @static - */ -PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes(); - -/** - * The tinting method that will be used. - * - * @method tintMethod - * @static - */ -PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel; diff --git a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/WebGLRenderer.js b/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/WebGLRenderer.js deleted file mode 100755 index 02b30e4..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/WebGLRenderer.js +++ /dev/null @@ -1,554 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -PIXI.glContexts = []; // this is where we store the webGL contexts for easy access. -PIXI.instances = []; - -/** - * The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer - * should be used for browsers that support webGL. This Render works by automatically managing webGLBatchs. - * So no need for Sprite Batches or Sprite Clouds. - * Don't forget to add the view to your DOM or you will not see anything :) - * - * @class WebGLRenderer - * @constructor - * @param [width=0] {Number} the width of the canvas view - * @param [height=0] {Number} the height of the canvas view - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - */ -PIXI.WebGLRenderer = function(width, height, options) -{ - if(options) - { - for (var i in PIXI.defaultRenderOptions) - { - if (typeof options[i] === 'undefined') options[i] = PIXI.defaultRenderOptions[i]; - } - } - else - { - options = PIXI.defaultRenderOptions; - } - - if(!PIXI.defaultRenderer) - { - PIXI.sayHello('webGL'); - PIXI.defaultRenderer = this; - } - - /** - * @property type - * @type Number - */ - this.type = PIXI.WEBGL_RENDERER; - - /** - * The resolution of the renderer - * - * @property resolution - * @type Number - * @default 1 - */ - this.resolution = options.resolution; - - // do a catch.. only 1 webGL renderer.. - - /** - * Whether the render view is transparent - * - * @property transparent - * @type Boolean - */ - this.transparent = options.transparent; - - /** - * Whether the render view should be resized automatically - * - * @property autoResize - * @type Boolean - */ - this.autoResize = options.autoResize || false; - - /** - * The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering. - * - * @property preserveDrawingBuffer - * @type Boolean - */ - this.preserveDrawingBuffer = options.preserveDrawingBuffer; - - /** - * This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true: - * If the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0). - * If the Stage is transparent, Pixi will clear to the target Stage's background color. - * Disable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set. - * - * @property clearBeforeRender - * @type Boolean - * @default - */ - this.clearBeforeRender = options.clearBeforeRender; - - /** - * The width of the canvas view - * - * @property width - * @type Number - * @default 800 - */ - this.width = width || 800; - - /** - * The height of the canvas view - * - * @property height - * @type Number - * @default 600 - */ - this.height = height || 600; - - /** - * The canvas element that everything is drawn to - * - * @property view - * @type HTMLCanvasElement - */ - this.view = options.view || document.createElement( 'canvas' ); - - // deal with losing context.. - - /** - * @property contextLostBound - * @type Function - */ - this.contextLostBound = this.handleContextLost.bind(this); - - /** - * @property contextRestoredBound - * @type Function - */ - this.contextRestoredBound = this.handleContextRestored.bind(this); - - this.view.addEventListener('webglcontextlost', this.contextLostBound, false); - this.view.addEventListener('webglcontextrestored', this.contextRestoredBound, false); - - /** - * @property _contextOptions - * @type Object - * @private - */ - this._contextOptions = { - alpha: this.transparent, - antialias: options.antialias, // SPEED UP?? - premultipliedAlpha:this.transparent && this.transparent !== 'notMultiplied', - stencil:true, - preserveDrawingBuffer: options.preserveDrawingBuffer - }; - - /** - * @property projection - * @type Point - */ - this.projection = new PIXI.Point(); - - /** - * @property offset - * @type Point - */ - this.offset = new PIXI.Point(0, 0); - - // time to create the render managers! each one focuses on managing a state in webGL - - /** - * Deals with managing the shader programs and their attribs - * @property shaderManager - * @type WebGLShaderManager - */ - this.shaderManager = new PIXI.WebGLShaderManager(); - - /** - * Manages the rendering of sprites - * @property spriteBatch - * @type WebGLSpriteBatch - */ - this.spriteBatch = new PIXI.WebGLSpriteBatch(); - - /** - * Manages the masks using the stencil buffer - * @property maskManager - * @type WebGLMaskManager - */ - this.maskManager = new PIXI.WebGLMaskManager(); - - /** - * Manages the filters - * @property filterManager - * @type WebGLFilterManager - */ - this.filterManager = new PIXI.WebGLFilterManager(); - - /** - * Manages the stencil buffer - * @property stencilManager - * @type WebGLStencilManager - */ - this.stencilManager = new PIXI.WebGLStencilManager(); - - /** - * Manages the blendModes - * @property blendModeManager - * @type WebGLBlendModeManager - */ - this.blendModeManager = new PIXI.WebGLBlendModeManager(); - - /** - * TODO remove - * @property renderSession - * @type Object - */ - this.renderSession = {}; - this.renderSession.gl = this.gl; - this.renderSession.drawCount = 0; - this.renderSession.shaderManager = this.shaderManager; - this.renderSession.maskManager = this.maskManager; - this.renderSession.filterManager = this.filterManager; - this.renderSession.blendModeManager = this.blendModeManager; - this.renderSession.spriteBatch = this.spriteBatch; - this.renderSession.stencilManager = this.stencilManager; - this.renderSession.renderer = this; - this.renderSession.resolution = this.resolution; - - // time init the context.. - this.initContext(); - - // map some webGL blend modes.. - this.mapBlendModes(); -}; - -// constructor -PIXI.WebGLRenderer.prototype.constructor = PIXI.WebGLRenderer; - -/** -* @method initContext -*/ -PIXI.WebGLRenderer.prototype.initContext = function() -{ - var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); - this.gl = gl; - - if (!gl) { - // fail, not able to get a context - throw new Error('This browser does not support webGL. Try using the canvas renderer'); - } - - this.glContextId = gl.id = PIXI.WebGLRenderer.glContextId ++; - - PIXI.glContexts[this.glContextId] = gl; - - PIXI.instances[this.glContextId] = this; - - // set up the default pixi settings.. - gl.disable(gl.DEPTH_TEST); - gl.disable(gl.CULL_FACE); - gl.enable(gl.BLEND); - - // need to set the context for all the managers... - this.shaderManager.setContext(gl); - this.spriteBatch.setContext(gl); - this.maskManager.setContext(gl); - this.filterManager.setContext(gl); - this.blendModeManager.setContext(gl); - this.stencilManager.setContext(gl); - - this.renderSession.gl = this.gl; - - // now resize and we are good to go! - this.resize(this.width, this.height); -}; - -/** - * Renders the stage to its webGL view - * - * @method render - * @param stage {Stage} the Stage element to be rendered - */ -PIXI.WebGLRenderer.prototype.render = function(stage) -{ - // no point rendering if our context has been blown up! - if(this.contextLost)return; - - // if rendering a new stage clear the batches.. - if(this.__stage !== stage) - { - if(stage.interactive)stage.interactionManager.removeEvents(); - - // TODO make this work - // dont think this is needed any more? - this.__stage = stage; - } - - // update the scene graph - stage.updateTransform(); - - var gl = this.gl; - - // interaction - if(stage._interactive) - { - //need to add some events! - if(!stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = true; - stage.interactionManager.setTarget(this); - } - } - else - { - if(stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = false; - stage.interactionManager.setTarget(this); - } - } - - // -- Does this need to be set every frame? -- // - gl.viewport(0, 0, this.width, this.height); - - // make sure we are bound to the main frame buffer - gl.bindFramebuffer(gl.FRAMEBUFFER, null); - - if (this.clearBeforeRender) - { - if(this.transparent) - { - gl.clearColor(0, 0, 0, 0); - } - else - { - gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], 1); - } - - gl.clear (gl.COLOR_BUFFER_BIT); - } - - this.renderDisplayObject( stage, this.projection ); -}; - -/** - * Renders a Display Object. - * - * @method renderDisplayObject - * @param displayObject {DisplayObject} The DisplayObject to render - * @param projection {Point} The projection - * @param buffer {Array} a standard WebGL buffer - */ -PIXI.WebGLRenderer.prototype.renderDisplayObject = function(displayObject, projection, buffer) -{ - this.renderSession.blendModeManager.setBlendMode(PIXI.blendModes.NORMAL); - - // reset the render session data.. - this.renderSession.drawCount = 0; - - // make sure to flip the Y if using a render texture.. - this.renderSession.flipY = buffer ? -1 : 1; - - // set the default projection - this.renderSession.projection = projection; - - //set the default offset - this.renderSession.offset = this.offset; - - // start the sprite batch - this.spriteBatch.begin(this.renderSession); - - // start the filter manager - this.filterManager.begin(this.renderSession, buffer); - - // render the scene! - displayObject._renderWebGL(this.renderSession); - - // finish the sprite batch - this.spriteBatch.end(); -}; - -/** - * Resizes the webGL view to the specified width and height. - * - * @method resize - * @param width {Number} the new width of the webGL view - * @param height {Number} the new height of the webGL view - */ -PIXI.WebGLRenderer.prototype.resize = function(width, height) -{ - this.width = width * this.resolution; - this.height = height * this.resolution; - - this.view.width = this.width; - this.view.height = this.height; - - if (this.autoResize) { - this.view.style.width = this.width / this.resolution + 'px'; - this.view.style.height = this.height / this.resolution + 'px'; - } - - this.gl.viewport(0, 0, this.width, this.height); - - this.projection.x = this.width / 2 / this.resolution; - this.projection.y = -this.height / 2 / this.resolution; -}; - -/** - * Updates and Creates a WebGL texture for the renderers context. - * - * @method updateTexture - * @param texture {Texture} the texture to update - */ -PIXI.WebGLRenderer.prototype.updateTexture = function(texture) -{ - if(!texture.hasLoaded )return; - - var gl = this.gl; - - if(!texture._glTextures[gl.id])texture._glTextures[gl.id] = gl.createTexture(); - - gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]); - - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultipliedAlpha); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source); - - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - - - if(texture.mipmap && PIXI.isPowerOfTwo(texture.width, texture.height)) - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR_MIPMAP_LINEAR : gl.NEAREST_MIPMAP_NEAREST); - gl.generateMipmap(gl.TEXTURE_2D); - } - else - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - } - - // reguler... - if(!texture._powerOf2) - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - } - else - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT); - } - - texture._dirty[gl.id] = false; - - return texture._glTextures[gl.id]; -}; - -/** - * Handles a lost webgl context - * - * @method handleContextLost - * @param event {Event} - * @private - */ -PIXI.WebGLRenderer.prototype.handleContextLost = function(event) -{ - event.preventDefault(); - this.contextLost = true; -}; - -/** - * Handles a restored webgl context - * - * @method handleContextRestored - * @param event {Event} - * @private - */ -PIXI.WebGLRenderer.prototype.handleContextRestored = function() -{ - this.initContext(); - - // empty all the ol gl textures as they are useless now - for(var key in PIXI.TextureCache) - { - var texture = PIXI.TextureCache[key].baseTexture; - texture._glTextures = []; - } - - this.contextLost = false; -}; - -/** - * Removes everything from the renderer (event listeners, spritebatch, etc...) - * - * @method destroy - */ -PIXI.WebGLRenderer.prototype.destroy = function() -{ - // remove listeners - this.view.removeEventListener('webglcontextlost', this.contextLostBound); - this.view.removeEventListener('webglcontextrestored', this.contextRestoredBound); - - PIXI.glContexts[this.glContextId] = null; - - this.projection = null; - this.offset = null; - - // time to create the render managers! each one focuses on managine a state in webGL - this.shaderManager.destroy(); - this.spriteBatch.destroy(); - this.maskManager.destroy(); - this.filterManager.destroy(); - - this.shaderManager = null; - this.spriteBatch = null; - this.maskManager = null; - this.filterManager = null; - - this.gl = null; - this.renderSession = null; -}; - -/** - * Maps Pixi blend modes to WebGL blend modes. - * - * @method mapBlendModes - */ -PIXI.WebGLRenderer.prototype.mapBlendModes = function() -{ - var gl = this.gl; - - if(!PIXI.blendModesWebGL) - { - PIXI.blendModesWebGL = []; - - PIXI.blendModesWebGL[PIXI.blendModes.NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.ADD] = [gl.SRC_ALPHA, gl.DST_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SCREEN] = [gl.SRC_ALPHA, gl.ONE]; - PIXI.blendModesWebGL[PIXI.blendModes.OVERLAY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.DARKEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.LIGHTEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR_DODGE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR_BURN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.HARD_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SOFT_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.DIFFERENCE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.EXCLUSION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.HUE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SATURATION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.LUMINOSITY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - } -}; - -PIXI.WebGLRenderer.glContextId = 0; diff --git a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js b/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js deleted file mode 100755 index bbd3259..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ /dev/null @@ -1,122 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class ComplexPrimitiveShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.ComplexPrimitiveShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - - 'precision mediump float;', - - 'varying vec4 vColor;', - - 'void main(void) {', - ' gl_FragColor = vColor;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - //'attribute vec4 aColor;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - - 'uniform vec3 tint;', - 'uniform float alpha;', - 'uniform vec3 color;', - 'uniform float flipY;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);', - ' vColor = vec4(color * alpha * tint, alpha);',//" * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.ComplexPrimitiveShader.prototype.constructor = PIXI.ComplexPrimitiveShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.ComplexPrimitiveShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.tintColor = gl.getUniformLocation(program, 'tint'); - this.color = gl.getUniformLocation(program, 'color'); - this.flipY = gl.getUniformLocation(program, 'flipY'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - // this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - this.attributes = [this.aVertexPosition, this.colorAttribute]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.ComplexPrimitiveShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attribute = null; -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiFastShader.js b/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiFastShader.js deleted file mode 100755 index 8e685e7..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiFastShader.js +++ /dev/null @@ -1,155 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class PixiFastShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PixiFastShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying float vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aPositionCoord;', - 'attribute vec2 aScale;', - 'attribute float aRotation;', - 'attribute vec2 aTextureCoord;', - 'attribute float aColor;', - - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - 'uniform mat3 uMatrix;', - - 'varying vec2 vTextureCoord;', - 'varying float vColor;', - - 'const vec2 center = vec2(-1.0, 1.0);', - - 'void main(void) {', - ' vec2 v;', - ' vec2 sv = aVertexPosition * aScale;', - ' v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);', - ' v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);', - ' v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;', - ' gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - // ' vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;', - ' vColor = aColor;', - '}' - ]; - - /** - * A local texture counter for multi-texture shaders. - * @property textureCount - * @type Number - */ - this.textureCount = 0; - - this.init(); -}; - -PIXI.PixiFastShader.prototype.constructor = PIXI.PixiFastShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PixiFastShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.dimensions = gl.getUniformLocation(program, 'dimensions'); - this.uMatrix = gl.getUniformLocation(program, 'uMatrix'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aPositionCoord = gl.getAttribLocation(program, 'aPositionCoord'); - - this.aScale = gl.getAttribLocation(program, 'aScale'); - this.aRotation = gl.getAttribLocation(program, 'aRotation'); - - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - // Begin worst hack eva // - - // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? - // maybe its somthing to do with the current state of the gl context. - // Im convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel - // If theres any webGL people that know why could happen please help :) - if(this.colorAttribute === -1) - { - this.colorAttribute = 2; - } - - this.attributes = [this.aVertexPosition, this.aPositionCoord, this.aScale, this.aRotation, this.aTextureCoord, this.colorAttribute]; - - // End worst hack eva // - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PixiFastShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiShader.js b/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiShader.js deleted file mode 100755 index e70be7f..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiShader.js +++ /dev/null @@ -1,389 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * @author Richard Davey http://www.photonstorm.com @photonstorm - */ - -/** -* @class PixiShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PixiShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]; - - /** - * A local texture counter for multi-texture shaders. - * @property textureCount - * @type Number - */ - this.textureCount = 0; - - /** - * A local flag - * @property firstRun - * @type Boolean - * @private - */ - this.firstRun = true; - - /** - * A dirty flag - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * Uniform attributes cache. - * @property attributes - * @type Array - * @private - */ - this.attributes = []; - - this.init(); -}; - -PIXI.PixiShader.prototype.constructor = PIXI.PixiShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PixiShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc || PIXI.PixiShader.defaultVertexSrc, this.fragmentSrc); - - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.dimensions = gl.getUniformLocation(program, 'dimensions'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - // Begin worst hack eva // - - // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? - // maybe its something to do with the current state of the gl context. - // I'm convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel - // If theres any webGL people that know why could happen please help :) - if(this.colorAttribute === -1) - { - this.colorAttribute = 2; - } - - this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute]; - - // End worst hack eva // - - // add those custom shaders! - for (var key in this.uniforms) - { - // get the uniform locations.. - this.uniforms[key].uniformLocation = gl.getUniformLocation(program, key); - } - - this.initUniforms(); - - this.program = program; -}; - -/** -* Initialises the shader uniform values. -* -* Uniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/ -* http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf -* -* @method initUniforms -*/ -PIXI.PixiShader.prototype.initUniforms = function() -{ - this.textureCount = 1; - var gl = this.gl; - var uniform; - - for (var key in this.uniforms) - { - uniform = this.uniforms[key]; - - var type = uniform.type; - - if (type === 'sampler2D') - { - uniform._init = false; - - if (uniform.value !== null) - { - this.initSampler2D(uniform); - } - } - else if (type === 'mat2' || type === 'mat3' || type === 'mat4') - { - // These require special handling - uniform.glMatrix = true; - uniform.glValueLength = 1; - - if (type === 'mat2') - { - uniform.glFunc = gl.uniformMatrix2fv; - } - else if (type === 'mat3') - { - uniform.glFunc = gl.uniformMatrix3fv; - } - else if (type === 'mat4') - { - uniform.glFunc = gl.uniformMatrix4fv; - } - } - else - { - // GL function reference - uniform.glFunc = gl['uniform' + type]; - - if (type === '2f' || type === '2i') - { - uniform.glValueLength = 2; - } - else if (type === '3f' || type === '3i') - { - uniform.glValueLength = 3; - } - else if (type === '4f' || type === '4i') - { - uniform.glValueLength = 4; - } - else - { - uniform.glValueLength = 1; - } - } - } - -}; - -/** -* Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded) -* -* @method initSampler2D -*/ -PIXI.PixiShader.prototype.initSampler2D = function(uniform) -{ - if (!uniform.value || !uniform.value.baseTexture || !uniform.value.baseTexture.hasLoaded) - { - return; - } - - var gl = this.gl; - - gl.activeTexture(gl['TEXTURE' + this.textureCount]); - gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]); - - // Extended texture data - if (uniform.textureData) - { - var data = uniform.textureData; - - // GLTexture = mag linear, min linear_mipmap_linear, wrap repeat + gl.generateMipmap(gl.TEXTURE_2D); - // GLTextureLinear = mag/min linear, wrap clamp - // GLTextureNearestRepeat = mag/min NEAREST, wrap repeat - // GLTextureNearest = mag/min nearest, wrap clamp - // AudioTexture = whatever + luminance + width 512, height 2, border 0 - // KeyTexture = whatever + luminance + width 256, height 2, border 0 - - // magFilter can be: gl.LINEAR, gl.LINEAR_MIPMAP_LINEAR or gl.NEAREST - // wrapS/T can be: gl.CLAMP_TO_EDGE or gl.REPEAT - - var magFilter = (data.magFilter) ? data.magFilter : gl.LINEAR; - var minFilter = (data.minFilter) ? data.minFilter : gl.LINEAR; - var wrapS = (data.wrapS) ? data.wrapS : gl.CLAMP_TO_EDGE; - var wrapT = (data.wrapT) ? data.wrapT : gl.CLAMP_TO_EDGE; - var format = (data.luminance) ? gl.LUMINANCE : gl.RGBA; - - if (data.repeat) - { - wrapS = gl.REPEAT; - wrapT = gl.REPEAT; - } - - gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, !!data.flipY); - - if (data.width) - { - var width = (data.width) ? data.width : 512; - var height = (data.height) ? data.height : 2; - var border = (data.border) ? data.border : 0; - - // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels); - gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, border, format, gl.UNSIGNED_BYTE, null); - } - else - { - // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, ImageData? pixels); - gl.texImage2D(gl.TEXTURE_2D, 0, format, gl.RGBA, gl.UNSIGNED_BYTE, uniform.value.baseTexture.source); - } - - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrapS); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT); - } - - gl.uniform1i(uniform.uniformLocation, this.textureCount); - - uniform._init = true; - - this.textureCount++; - -}; - -/** -* Updates the shader uniform values. -* -* @method syncUniforms -*/ -PIXI.PixiShader.prototype.syncUniforms = function() -{ - this.textureCount = 1; - var uniform; - var gl = this.gl; - - // This would probably be faster in an array and it would guarantee key order - for (var key in this.uniforms) - { - uniform = this.uniforms[key]; - - if (uniform.glValueLength === 1) - { - if (uniform.glMatrix === true) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.transpose, uniform.value); - } - else - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value); - } - } - else if (uniform.glValueLength === 2) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y); - } - else if (uniform.glValueLength === 3) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z); - } - else if (uniform.glValueLength === 4) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z, uniform.value.w); - } - else if (uniform.type === 'sampler2D') - { - if (uniform._init) - { - gl.activeTexture(gl['TEXTURE' + this.textureCount]); - - if(uniform.value.baseTexture._dirty[gl.id]) - { - PIXI.instances[gl.id].updateTexture(uniform.value.baseTexture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]); - } - - // gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id] || PIXI.createWebGLTexture( uniform.value.baseTexture, gl)); - gl.uniform1i(uniform.uniformLocation, this.textureCount); - this.textureCount++; - } - else - { - this.initSampler2D(uniform); - } - } - } - -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PixiShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; - -/** -* The Default Vertex shader source. -* -* @property defaultVertexSrc -* @type String -*/ -PIXI.PixiShader.defaultVertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aTextureCoord;', - 'attribute vec4 aColor;', - - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - - 'const vec2 center = vec2(-1.0, 1.0);', - - 'void main(void) {', - ' gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - ' vColor = vec4(aColor.rgb * aColor.a, aColor.a);', - '}' -]; \ No newline at end of file diff --git a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/shaders/PrimitiveShader.js b/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/shaders/PrimitiveShader.js deleted file mode 100755 index bdaab89..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/shaders/PrimitiveShader.js +++ /dev/null @@ -1,117 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class PrimitiveShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PrimitiveShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' gl_FragColor = vColor;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec4 aColor;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - 'uniform float alpha;', - 'uniform float flipY;', - 'uniform vec3 tint;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);', - ' vColor = aColor * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.PrimitiveShader.prototype.constructor = PIXI.PrimitiveShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PrimitiveShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.tintColor = gl.getUniformLocation(program, 'tint'); - this.flipY = gl.getUniformLocation(program, 'flipY'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - this.attributes = [this.aVertexPosition, this.colorAttribute]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PrimitiveShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/shaders/StripShader.js b/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/shaders/StripShader.js deleted file mode 100755 index 6b47244..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/shaders/StripShader.js +++ /dev/null @@ -1,123 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class StripShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.StripShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - // 'varying float vColor;', - 'uniform float alpha;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * alpha;', - // ' gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);',//gl_FragColor * alpha;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aTextureCoord;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - // 'uniform float alpha;', - // 'uniform vec3 tint;', - 'varying vec2 vTextureCoord;', - // 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - // ' vColor = aColor * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.StripShader.prototype.constructor = PIXI.StripShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.StripShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - //this.dimensions = gl.getUniformLocation(this.program, 'dimensions'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - - this.attributes = [this.aVertexPosition, this.aTextureCoord]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.StripShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attribute = null; -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/FilterTexture.js b/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/FilterTexture.js deleted file mode 100755 index 0340289..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/FilterTexture.js +++ /dev/null @@ -1,110 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class FilterTexture -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -* @param width {Number} the horizontal range of the filter -* @param height {Number} the vertical range of the filter -* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values -*/ -PIXI.FilterTexture = function(gl, width, height, scaleMode) -{ - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - // next time to create a frame buffer and texture - - /** - * @property frameBuffer - * @type Any - */ - this.frameBuffer = gl.createFramebuffer(); - - /** - * @property texture - * @type Any - */ - this.texture = gl.createTexture(); - - /** - * @property scaleMode - * @type Number - */ - scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - gl.bindTexture(gl.TEXTURE_2D, this.texture); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer ); - - gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer ); - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); - - // required for masking a mask?? - this.renderBuffer = gl.createRenderbuffer(); - gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer); - gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.renderBuffer); - - this.resize(width, height); -}; - -PIXI.FilterTexture.prototype.constructor = PIXI.FilterTexture; - -/** -* Clears the filter texture. -* -* @method clear -*/ -PIXI.FilterTexture.prototype.clear = function() -{ - var gl = this.gl; - - gl.clearColor(0,0,0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); -}; - -/** - * Resizes the texture to the specified width and height - * - * @method resize - * @param width {Number} the new width of the texture - * @param height {Number} the new height of the texture - */ -PIXI.FilterTexture.prototype.resize = function(width, height) -{ - if(this.width === width && this.height === height) return; - - this.width = width; - this.height = height; - - var gl = this.gl; - - gl.bindTexture(gl.TEXTURE_2D, this.texture); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width , height , 0, gl.RGBA, gl.UNSIGNED_BYTE, null); - // update the stencil buffer width and height - gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer); - gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width , height ); -}; - -/** -* Destroys the filter texture. -* -* @method destroy -*/ -PIXI.FilterTexture.prototype.destroy = function() -{ - var gl = this.gl; - gl.deleteFramebuffer( this.frameBuffer ); - gl.deleteTexture( this.texture ); - - this.frameBuffer = null; - this.texture = null; -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js b/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js deleted file mode 100755 index 3de0ec9..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLBlendModeManager -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLBlendModeManager = function() -{ - /** - * @property currentBlendMode - * @type Number - */ - this.currentBlendMode = 99999; -}; - -PIXI.WebGLBlendModeManager.prototype.constructor = PIXI.WebGLBlendModeManager; - -/** - * Sets the WebGL Context. - * - * @method setContext - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLBlendModeManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Sets-up the given blendMode from WebGL's point of view. -* -* @method setBlendMode -* @param blendMode {Number} the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD -*/ -PIXI.WebGLBlendModeManager.prototype.setBlendMode = function(blendMode) -{ - if(this.currentBlendMode === blendMode)return false; - - this.currentBlendMode = blendMode; - - var blendModeWebGL = PIXI.blendModesWebGL[this.currentBlendMode]; - this.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); - - return true; -}; - -/** -* Destroys this object. -* -* @method destroy -*/ -PIXI.WebGLBlendModeManager.prototype.destroy = function() -{ - this.gl = null; -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js b/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js deleted file mode 100755 index d870f50..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js +++ /dev/null @@ -1,428 +0,0 @@ -/** - * @author Mat Groves - * - * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ - * for creating the original pixi version! - * - * Heavily inspired by LibGDX's WebGLSpriteBatch: - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java - */ - -/** -* @class WebGLFastSpriteBatch -* @constructor -*/ -PIXI.WebGLFastSpriteBatch = function(gl) -{ - /** - * @property vertSize - * @type Number - */ - this.vertSize = 10; - - /** - * @property maxSize - * @type Number - */ - this.maxSize = 6000;//Math.pow(2, 16) / this.vertSize; - - /** - * @property size - * @type Number - */ - this.size = this.maxSize; - - //the total number of floats in our batch - var numVerts = this.size * 4 * this.vertSize; - - //the total number of indices in our batch - var numIndices = this.maxSize * 6; - - /** - * Vertex data - * @property vertices - * @type Float32Array - */ - this.vertices = new PIXI.Float32Array(numVerts); - - /** - * Index data - * @property indices - * @type Uint16Array - */ - this.indices = new PIXI.Uint16Array(numIndices); - - /** - * @property vertexBuffer - * @type Object - */ - this.vertexBuffer = null; - - /** - * @property indexBuffer - * @type Object - */ - this.indexBuffer = null; - - /** - * @property lastIndexCount - * @type Number - */ - this.lastIndexCount = 0; - - for (var i=0, j=0; i < numIndices; i += 6, j += 4) - { - this.indices[i + 0] = j + 0; - this.indices[i + 1] = j + 1; - this.indices[i + 2] = j + 2; - this.indices[i + 3] = j + 0; - this.indices[i + 4] = j + 2; - this.indices[i + 5] = j + 3; - } - - /** - * @property drawing - * @type Boolean - */ - this.drawing = false; - - /** - * @property currentBatchSize - * @type Number - */ - this.currentBatchSize = 0; - - /** - * @property currentBaseTexture - * @type BaseTexture - */ - this.currentBaseTexture = null; - - /** - * @property currentBlendMode - * @type Number - */ - this.currentBlendMode = 0; - - /** - * @property renderSession - * @type Object - */ - this.renderSession = null; - - /** - * @property shader - * @type Object - */ - this.shader = null; - - /** - * @property matrix - * @type Matrix - */ - this.matrix = null; - - this.setContext(gl); -}; - -PIXI.WebGLFastSpriteBatch.prototype.constructor = PIXI.WebGLFastSpriteBatch; - -/** - * Sets the WebGL Context. - * - * @method setContext - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLFastSpriteBatch.prototype.setContext = function(gl) -{ - this.gl = gl; - - // create a couple of buffers - this.vertexBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // 65535 is max index, so 65535 / 6 = 10922. - - //upload the index data - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); -}; - -/** - * @method begin - * @param spriteBatch {WebGLSpriteBatch} - * @param renderSession {Object} - */ -PIXI.WebGLFastSpriteBatch.prototype.begin = function(spriteBatch, renderSession) -{ - this.renderSession = renderSession; - this.shader = this.renderSession.shaderManager.fastShader; - - this.matrix = spriteBatch.worldTransform.toArray(true); - - this.start(); -}; - -/** - * @method end - */ -PIXI.WebGLFastSpriteBatch.prototype.end = function() -{ - this.flush(); -}; - -/** - * @method render - * @param spriteBatch {WebGLSpriteBatch} - */ -PIXI.WebGLFastSpriteBatch.prototype.render = function(spriteBatch) -{ - var children = spriteBatch.children; - var sprite = children[0]; - - // if the uvs have not updated then no point rendering just yet! - - // check texture. - if(!sprite.texture._uvs)return; - - this.currentBaseTexture = sprite.texture.baseTexture; - - // check blend mode - if(sprite.blendMode !== this.renderSession.blendModeManager.currentBlendMode) - { - this.flush(); - this.renderSession.blendModeManager.setBlendMode(sprite.blendMode); - } - - for(var i=0,j= children.length; i= this.size) - { - this.flush(); - } -}; - -/** - * @method flush - */ -PIXI.WebGLFastSpriteBatch.prototype.flush = function() -{ - // If the batch is length 0 then return as there is nothing to draw - if (this.currentBatchSize===0)return; - - var gl = this.gl; - - // bind the current texture - - if(!this.currentBaseTexture._glTextures[gl.id])this.renderSession.renderer.updateTexture(this.currentBaseTexture, gl); - - gl.bindTexture(gl.TEXTURE_2D, this.currentBaseTexture._glTextures[gl.id]); - - // upload the verts to the buffer - - if(this.currentBatchSize > ( this.size * 0.5 ) ) - { - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - } - else - { - var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize); - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); - } - - // now draw those suckas! - gl.drawElements(gl.TRIANGLES, this.currentBatchSize * 6, gl.UNSIGNED_SHORT, 0); - - // then reset the batch! - this.currentBatchSize = 0; - - // increment the draw count - this.renderSession.drawCount++; -}; - - -/** - * @method stop - */ -PIXI.WebGLFastSpriteBatch.prototype.stop = function() -{ - this.flush(); -}; - -/** - * @method start - */ -PIXI.WebGLFastSpriteBatch.prototype.start = function() -{ - var gl = this.gl; - - // bind the main texture - gl.activeTexture(gl.TEXTURE0); - - // bind the buffers - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - // set the projection - var projection = this.renderSession.projection; - gl.uniform2f(this.shader.projectionVector, projection.x, projection.y); - - // set the matrix - gl.uniformMatrix3fv(this.shader.uMatrix, false, this.matrix); - - // set the pointers - var stride = this.vertSize * 4; - - gl.vertexAttribPointer(this.shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0); - gl.vertexAttribPointer(this.shader.aPositionCoord, 2, gl.FLOAT, false, stride, 2 * 4); - gl.vertexAttribPointer(this.shader.aScale, 2, gl.FLOAT, false, stride, 4 * 4); - gl.vertexAttribPointer(this.shader.aRotation, 1, gl.FLOAT, false, stride, 6 * 4); - gl.vertexAttribPointer(this.shader.aTextureCoord, 2, gl.FLOAT, false, stride, 7 * 4); - gl.vertexAttribPointer(this.shader.colorAttribute, 1, gl.FLOAT, false, stride, 9 * 4); - -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFilterManager.js b/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFilterManager.js deleted file mode 100755 index e726891..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFilterManager.js +++ /dev/null @@ -1,450 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLFilterManager -* @constructor -*/ -PIXI.WebGLFilterManager = function() -{ - /** - * @property filterStack - * @type Array - */ - this.filterStack = []; - - /** - * @property offsetX - * @type Number - */ - this.offsetX = 0; - - /** - * @property offsetY - * @type Number - */ - this.offsetY = 0; -}; - -PIXI.WebGLFilterManager.prototype.constructor = PIXI.WebGLFilterManager; - -/** -* Initialises the context and the properties. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLFilterManager.prototype.setContext = function(gl) -{ - this.gl = gl; - this.texturePool = []; - - this.initShaderBuffers(); -}; - -/** -* @method begin -* @param renderSession {RenderSession} -* @param buffer {ArrayBuffer} -*/ -PIXI.WebGLFilterManager.prototype.begin = function(renderSession, buffer) -{ - this.renderSession = renderSession; - this.defaultShader = renderSession.shaderManager.defaultShader; - - var projection = this.renderSession.projection; - this.width = projection.x * 2; - this.height = -projection.y * 2; - this.buffer = buffer; -}; - -/** -* Applies the filter and adds it to the current filter stack. -* -* @method pushFilter -* @param filterBlock {Object} the filter that will be pushed to the current filter stack -*/ -PIXI.WebGLFilterManager.prototype.pushFilter = function(filterBlock) -{ - var gl = this.gl; - - var projection = this.renderSession.projection; - var offset = this.renderSession.offset; - - filterBlock._filterArea = filterBlock.target.filterArea || filterBlock.target.getBounds(); - - // filter program - // OPTIMISATION - the first filter is free if its a simple color change? - this.filterStack.push(filterBlock); - - var filter = filterBlock.filterPasses[0]; - - this.offsetX += filterBlock._filterArea.x; - this.offsetY += filterBlock._filterArea.y; - - var texture = this.texturePool.pop(); - if(!texture) - { - texture = new PIXI.FilterTexture(this.gl, this.width, this.height); - } - else - { - texture.resize(this.width, this.height); - } - - gl.bindTexture(gl.TEXTURE_2D, texture.texture); - - var filterArea = filterBlock._filterArea;// filterBlock.target.getBounds();///filterBlock.target.filterArea; - - var padding = filter.padding; - filterArea.x -= padding; - filterArea.y -= padding; - filterArea.width += padding * 2; - filterArea.height += padding * 2; - - // cap filter to screen size.. - if(filterArea.x < 0)filterArea.x = 0; - if(filterArea.width > this.width)filterArea.width = this.width; - if(filterArea.y < 0)filterArea.y = 0; - if(filterArea.height > this.height)filterArea.height = this.height; - - //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, filterArea.width, filterArea.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); - gl.bindFramebuffer(gl.FRAMEBUFFER, texture.frameBuffer); - - // set view port - gl.viewport(0, 0, filterArea.width, filterArea.height); - - projection.x = filterArea.width/2; - projection.y = -filterArea.height/2; - - offset.x = -filterArea.x; - offset.y = -filterArea.y; - - // update projection - // now restore the regular shader.. - // this.renderSession.shaderManager.setShader(this.defaultShader); - //gl.uniform2f(this.defaultShader.projectionVector, filterArea.width/2, -filterArea.height/2); - //gl.uniform2f(this.defaultShader.offsetVector, -filterArea.x, -filterArea.y); - - gl.colorMask(true, true, true, true); - gl.clearColor(0,0,0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); - - filterBlock._glFilterTexture = texture; - -}; - -/** -* Removes the last filter from the filter stack and doesn't return it. -* -* @method popFilter -*/ -PIXI.WebGLFilterManager.prototype.popFilter = function() -{ - var gl = this.gl; - var filterBlock = this.filterStack.pop(); - var filterArea = filterBlock._filterArea; - var texture = filterBlock._glFilterTexture; - var projection = this.renderSession.projection; - var offset = this.renderSession.offset; - - if(filterBlock.filterPasses.length > 1) - { - gl.viewport(0, 0, filterArea.width, filterArea.height); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - - this.vertexArray[0] = 0; - this.vertexArray[1] = filterArea.height; - - this.vertexArray[2] = filterArea.width; - this.vertexArray[3] = filterArea.height; - - this.vertexArray[4] = 0; - this.vertexArray[5] = 0; - - this.vertexArray[6] = filterArea.width; - this.vertexArray[7] = 0; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - // now set the uvs.. - this.uvArray[2] = filterArea.width/this.width; - this.uvArray[5] = filterArea.height/this.height; - this.uvArray[6] = filterArea.width/this.width; - this.uvArray[7] = filterArea.height/this.height; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray); - - var inputTexture = texture; - var outputTexture = this.texturePool.pop(); - if(!outputTexture)outputTexture = new PIXI.FilterTexture(this.gl, this.width, this.height); - outputTexture.resize(this.width, this.height); - - // need to clear this FBO as it may have some left over elements from a previous filter. - gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer ); - gl.clear(gl.COLOR_BUFFER_BIT); - - gl.disable(gl.BLEND); - - for (var i = 0; i < filterBlock.filterPasses.length-1; i++) - { - var filterPass = filterBlock.filterPasses[i]; - - gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer ); - - // set texture - gl.activeTexture(gl.TEXTURE0); - gl.bindTexture(gl.TEXTURE_2D, inputTexture.texture); - - // draw texture.. - //filterPass.applyFilterPass(filterArea.width, filterArea.height); - this.applyFilterPass(filterPass, filterArea, filterArea.width, filterArea.height); - - // swap the textures.. - var temp = inputTexture; - inputTexture = outputTexture; - outputTexture = temp; - } - - gl.enable(gl.BLEND); - - texture = inputTexture; - this.texturePool.push(outputTexture); - } - - var filter = filterBlock.filterPasses[filterBlock.filterPasses.length-1]; - - this.offsetX -= filterArea.x; - this.offsetY -= filterArea.y; - - var sizeX = this.width; - var sizeY = this.height; - - var offsetX = 0; - var offsetY = 0; - - var buffer = this.buffer; - - // time to render the filters texture to the previous scene - if(this.filterStack.length === 0) - { - gl.colorMask(true, true, true, true);//this.transparent); - } - else - { - var currentFilter = this.filterStack[this.filterStack.length-1]; - filterArea = currentFilter._filterArea; - - sizeX = filterArea.width; - sizeY = filterArea.height; - - offsetX = filterArea.x; - offsetY = filterArea.y; - - buffer = currentFilter._glFilterTexture.frameBuffer; - } - - // TODO need to remove these global elements.. - projection.x = sizeX/2; - projection.y = -sizeY/2; - - offset.x = offsetX; - offset.y = offsetY; - - filterArea = filterBlock._filterArea; - - var x = filterArea.x-offsetX; - var y = filterArea.y-offsetY; - - // update the buffers.. - // make sure to flip the y! - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - - this.vertexArray[0] = x; - this.vertexArray[1] = y + filterArea.height; - - this.vertexArray[2] = x + filterArea.width; - this.vertexArray[3] = y + filterArea.height; - - this.vertexArray[4] = x; - this.vertexArray[5] = y; - - this.vertexArray[6] = x + filterArea.width; - this.vertexArray[7] = y; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - - this.uvArray[2] = filterArea.width/this.width; - this.uvArray[5] = filterArea.height/this.height; - this.uvArray[6] = filterArea.width/this.width; - this.uvArray[7] = filterArea.height/this.height; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray); - - gl.viewport(0, 0, sizeX * this.renderSession.resolution, sizeY * this.renderSession.resolution); - - // bind the buffer - gl.bindFramebuffer(gl.FRAMEBUFFER, buffer ); - - // set the blend mode! - //gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA) - - // set texture - gl.activeTexture(gl.TEXTURE0); - gl.bindTexture(gl.TEXTURE_2D, texture.texture); - - // apply! - this.applyFilterPass(filter, filterArea, sizeX, sizeY); - - // now restore the regular shader.. should happen automatically now.. - // this.renderSession.shaderManager.setShader(this.defaultShader); - // gl.uniform2f(this.defaultShader.projectionVector, sizeX/2, -sizeY/2); - // gl.uniform2f(this.defaultShader.offsetVector, -offsetX, -offsetY); - - // return the texture to the pool - this.texturePool.push(texture); - filterBlock._glFilterTexture = null; -}; - - -/** -* Applies the filter to the specified area. -* -* @method applyFilterPass -* @param filter {AbstractFilter} the filter that needs to be applied -* @param filterArea {Texture} TODO - might need an update -* @param width {Number} the horizontal range of the filter -* @param height {Number} the vertical range of the filter -*/ -PIXI.WebGLFilterManager.prototype.applyFilterPass = function(filter, filterArea, width, height) -{ - // use program - var gl = this.gl; - var shader = filter.shaders[gl.id]; - - if(!shader) - { - shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc = filter.fragmentSrc; - shader.uniforms = filter.uniforms; - shader.init(); - - filter.shaders[gl.id] = shader; - } - - // set the shader - this.renderSession.shaderManager.setShader(shader); - -// gl.useProgram(shader.program); - - gl.uniform2f(shader.projectionVector, width/2, -height/2); - gl.uniform2f(shader.offsetVector, 0,0); - - if(filter.uniforms.dimensions) - { - filter.uniforms.dimensions.value[0] = this.width;//width; - filter.uniforms.dimensions.value[1] = this.height;//height; - filter.uniforms.dimensions.value[2] = this.vertexArray[0]; - filter.uniforms.dimensions.value[3] = this.vertexArray[5];//filterArea.height; - } - - shader.syncUniforms(); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer); - gl.vertexAttribPointer(shader.colorAttribute, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - // draw the filter... - gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 ); - - this.renderSession.drawCount++; -}; - -/** -* Initialises the shader buffers. -* -* @method initShaderBuffers -*/ -PIXI.WebGLFilterManager.prototype.initShaderBuffers = function() -{ - var gl = this.gl; - - // create some buffers - this.vertexBuffer = gl.createBuffer(); - this.uvBuffer = gl.createBuffer(); - this.colorBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // bind and upload the vertexs.. - // keep a reference to the vertexFloatData.. - this.vertexArray = new PIXI.Float32Array([0.0, 0.0, - 1.0, 0.0, - 0.0, 1.0, - 1.0, 1.0]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertexArray, gl.STATIC_DRAW); - - // bind and upload the uv buffer - this.uvArray = new PIXI.Float32Array([0.0, 0.0, - 1.0, 0.0, - 0.0, 1.0, - 1.0, 1.0]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvArray, gl.STATIC_DRAW); - - this.colorArray = new PIXI.Float32Array([1.0, 0xFFFFFF, - 1.0, 0xFFFFFF, - 1.0, 0xFFFFFF, - 1.0, 0xFFFFFF]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.colorArray, gl.STATIC_DRAW); - - // bind and upload the index - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 1, 3, 2]), gl.STATIC_DRAW); - -}; - -/** -* Destroys the filter and removes it from the filter stack. -* -* @method destroy -*/ -PIXI.WebGLFilterManager.prototype.destroy = function() -{ - var gl = this.gl; - - this.filterStack = null; - - this.offsetX = 0; - this.offsetY = 0; - - // destroy textures - for (var i = 0; i < this.texturePool.length; i++) { - this.texturePool[i].destroy(); - } - - this.texturePool = null; - - //destroy buffers.. - gl.deleteBuffer(this.vertexBuffer); - gl.deleteBuffer(this.uvBuffer); - gl.deleteBuffer(this.colorBuffer); - gl.deleteBuffer(this.indexBuffer); -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLGraphics.js b/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLGraphics.js deleted file mode 100755 index 710383c..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLGraphics.js +++ /dev/null @@ -1,896 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A set of functions used by the webGL renderer to draw the primitive graphics data - * - * @class WebGLGraphics - * @private - * @static - */ -PIXI.WebGLGraphics = function() -{ -}; - -/** - * Renders the graphics object - * - * @static - * @private - * @method renderGraphics - * @param graphics {Graphics} - * @param renderSession {Object} - */ -PIXI.WebGLGraphics.renderGraphics = function(graphics, renderSession)//projection, offset) -{ - var gl = renderSession.gl; - var projection = renderSession.projection, - offset = renderSession.offset, - shader = renderSession.shaderManager.primitiveShader, - webGLData; - - if(graphics.dirty) - { - PIXI.WebGLGraphics.updateGraphics(graphics, gl); - } - - var webGL = graphics._webGL[gl.id]; - - // This could be speeded up for sure! - - for (var i = 0; i < webGL.data.length; i++) - { - if(webGL.data[i].mode === 1) - { - webGLData = webGL.data[i]; - - renderSession.stencilManager.pushStencil(graphics, webGLData, renderSession); - - // render quad.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - renderSession.stencilManager.popStencil(graphics, webGLData, renderSession); - } - else - { - webGLData = webGL.data[i]; - - - renderSession.shaderManager.setShader( shader );//activatePrimitiveShader(); - shader = renderSession.shaderManager.primitiveShader; - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform1f(shader.flipY, 1); - - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - - gl.uniform1f(shader.alpha, graphics.worldAlpha); - - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0); - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4); - - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - } - } -}; - -/** - * Updates the graphics object - * - * @static - * @private - * @method updateGraphics - * @param graphicsData {Graphics} The graphics object to update - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLGraphics.updateGraphics = function(graphics, gl) -{ - // get the contexts graphics object - var webGL = graphics._webGL[gl.id]; - // if the graphics object does not exist in the webGL context time to create it! - if(!webGL)webGL = graphics._webGL[gl.id] = {lastIndex:0, data:[], gl:gl}; - - // flag the graphics as not dirty as we are about to update it... - graphics.dirty = false; - - var i; - - // if the user cleared the graphics object we will need to clear every object - if(graphics.clearDirty) - { - graphics.clearDirty = false; - - // lop through and return all the webGLDatas to the object pool so than can be reused later on - for (i = 0; i < webGL.data.length; i++) - { - var graphicsData = webGL.data[i]; - graphicsData.reset(); - PIXI.WebGLGraphics.graphicsDataPool.push( graphicsData ); - } - - // clear the array and reset the index.. - webGL.data = []; - webGL.lastIndex = 0; - } - - var webGLData; - - // loop through the graphics datas and construct each one.. - // if the object is a complex fill then the new stencil buffer technique will be used - // other wise graphics objects will be pushed into a batch.. - for (i = webGL.lastIndex; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - - if(data.type === PIXI.Graphics.POLY) - { - // need to add the points the the graphics object.. - data.points = data.shape.points.slice(); - if(data.shape.closed) - { - // close the poly if the value is true! - if(data.points[0] !== data.points[data.points.length-2] || data.points[1] !== data.points[data.points.length-1]) - { - data.points.push(data.points[0], data.points[1]); - } - } - - // MAKE SURE WE HAVE THE CORRECT TYPE.. - if(data.fill) - { - if(data.points.length >= 6) - { - if(data.points.length < 6 * 2) - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - - var canDrawUsingSimple = PIXI.WebGLGraphics.buildPoly(data, webGLData); - // console.log(canDrawUsingSimple); - - if(!canDrawUsingSimple) - { - // console.log("<>>>") - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1); - PIXI.WebGLGraphics.buildComplexPoly(data, webGLData); - } - - } - else - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1); - PIXI.WebGLGraphics.buildComplexPoly(data, webGLData); - } - } - } - - if(data.lineWidth > 0) - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - PIXI.WebGLGraphics.buildLine(data, webGLData); - - } - } - else - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - - if(data.type === PIXI.Graphics.RECT) - { - PIXI.WebGLGraphics.buildRectangle(data, webGLData); - } - else if(data.type === PIXI.Graphics.CIRC || data.type === PIXI.Graphics.ELIP) - { - PIXI.WebGLGraphics.buildCircle(data, webGLData); - } - else if(data.type === PIXI.Graphics.RREC) - { - PIXI.WebGLGraphics.buildRoundedRectangle(data, webGLData); - } - } - - webGL.lastIndex++; - } - - // upload all the dirty data... - for (i = 0; i < webGL.data.length; i++) - { - webGLData = webGL.data[i]; - if(webGLData.dirty)webGLData.upload(); - } -}; - -/** - * @static - * @private - * @method switchMode - * @param webGL {WebGLContext} - * @param type {Number} - */ -PIXI.WebGLGraphics.switchMode = function(webGL, type) -{ - var webGLData; - - if(!webGL.data.length) - { - webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl); - webGLData.mode = type; - webGL.data.push(webGLData); - } - else - { - webGLData = webGL.data[webGL.data.length-1]; - - if(webGLData.mode !== type || type === 1) - { - webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl); - webGLData.mode = type; - webGL.data.push(webGLData); - } - } - - webGLData.dirty = true; - - return webGLData; -}; - -/** - * Builds a rectangle to draw - * - * @static - * @private - * @method buildRectangle - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildRectangle = function(graphicsData, webGLData) -{ - // --- // - // need to convert points to a nice regular data - // - var rectData = graphicsData.shape; - var x = rectData.x; - var y = rectData.y; - var width = rectData.width; - var height = rectData.height; - - if(graphicsData.fill) - { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vertPos = verts.length/6; - - // start - verts.push(x, y); - verts.push(r, g, b, alpha); - - verts.push(x + width, y); - verts.push(r, g, b, alpha); - - verts.push(x , y + height); - verts.push(r, g, b, alpha); - - verts.push(x + width, y + height); - verts.push(r, g, b, alpha); - - // insert 2 dead triangles.. - indices.push(vertPos, vertPos, vertPos+1, vertPos+2, vertPos+3, vertPos+3); - } - - if(graphicsData.lineWidth) - { - var tempPoints = graphicsData.points; - - graphicsData.points = [x, y, - x + width, y, - x + width, y + height, - x, y + height, - x, y]; - - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Builds a rounded rectangle to draw - * - * @static - * @private - * @method buildRoundedRectangle - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildRoundedRectangle = function(graphicsData, webGLData) -{ - var rrectData = graphicsData.shape; - var x = rrectData.x; - var y = rrectData.y; - var width = rrectData.width; - var height = rrectData.height; - - var radius = rrectData.radius; - - var recPoints = []; - recPoints.push(x, y + radius); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x, y + height - radius, x, y + height, x + radius, y + height)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width, y + radius, x + width, y, x + width - radius, y)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + radius, y, x, y, x, y + radius)); - - if (graphicsData.fill) { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vecPos = verts.length/6; - - var triangles = PIXI.PolyK.Triangulate(recPoints); - - // - - var i = 0; - for (i = 0; i < triangles.length; i+=3) - { - indices.push(triangles[i] + vecPos); - indices.push(triangles[i] + vecPos); - indices.push(triangles[i+1] + vecPos); - indices.push(triangles[i+2] + vecPos); - indices.push(triangles[i+2] + vecPos); - } - - - for (i = 0; i < recPoints.length; i++) - { - verts.push(recPoints[i], recPoints[++i], r, g, b, alpha); - } - } - - if (graphicsData.lineWidth) { - var tempPoints = graphicsData.points; - - graphicsData.points = recPoints; - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Calculate the points for a quadratic bezier curve. (helper function..) - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c - * - * @static - * @private - * @method quadraticBezierCurve - * @param fromX {Number} Origin point x - * @param fromY {Number} Origin point x - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Array(Number)} - */ -PIXI.WebGLGraphics.quadraticBezierCurve = function(fromX, fromY, cpX, cpY, toX, toY) { - - var xa, - ya, - xb, - yb, - x, - y, - n = 20, - points = []; - - function getPt(n1 , n2, perc) { - var diff = n2 - n1; - - return n1 + ( diff * perc ); - } - - var j = 0; - for (var i = 0; i <= n; i++ ) - { - j = i / n; - - // The Green Line - xa = getPt( fromX , cpX , j ); - ya = getPt( fromY , cpY , j ); - xb = getPt( cpX , toX , j ); - yb = getPt( cpY , toY , j ); - - // The Black Dot - x = getPt( xa , xb , j ); - y = getPt( ya , yb , j ); - - points.push(x, y); - } - return points; -}; - -/** - * Builds a circle to draw - * - * @static - * @private - * @method buildCircle - * @param graphicsData {Graphics} The graphics object to draw - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildCircle = function(graphicsData, webGLData) -{ - // need to convert points to a nice regular data - var circleData = graphicsData.shape; - var x = circleData.x; - var y = circleData.y; - var width; - var height; - - // TODO - bit hacky?? - if(graphicsData.type === PIXI.Graphics.CIRC) - { - width = circleData.radius; - height = circleData.radius; - } - else - { - width = circleData.width; - height = circleData.height; - } - - var totalSegs = 40; - var seg = (Math.PI * 2) / totalSegs ; - - var i = 0; - - if(graphicsData.fill) - { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vecPos = verts.length/6; - - indices.push(vecPos); - - for (i = 0; i < totalSegs + 1 ; i++) - { - verts.push(x,y, r, g, b, alpha); - - verts.push(x + Math.sin(seg * i) * width, - y + Math.cos(seg * i) * height, - r, g, b, alpha); - - indices.push(vecPos++, vecPos++); - } - - indices.push(vecPos-1); - } - - if(graphicsData.lineWidth) - { - var tempPoints = graphicsData.points; - - graphicsData.points = []; - - for (i = 0; i < totalSegs + 1; i++) - { - graphicsData.points.push(x + Math.sin(seg * i) * width, - y + Math.cos(seg * i) * height); - } - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Builds a line to draw - * - * @static - * @private - * @method buildLine - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildLine = function(graphicsData, webGLData) -{ - // TODO OPTIMISE! - var i = 0; - var points = graphicsData.points; - if(points.length === 0)return; - - // if the line width is an odd number add 0.5 to align to a whole pixel - if(graphicsData.lineWidth%2) - { - for (i = 0; i < points.length; i++) { - points[i] += 0.5; - } - } - - // get first and last point.. figure out the middle! - var firstPoint = new PIXI.Point( points[0], points[1] ); - var lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); - - // if the first point is the last point - gonna have issues :) - if(firstPoint.x === lastPoint.x && firstPoint.y === lastPoint.y) - { - // need to clone as we are going to slightly modify the shape.. - points = points.slice(); - - points.pop(); - points.pop(); - - lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); - - var midPointX = lastPoint.x + (firstPoint.x - lastPoint.x) *0.5; - var midPointY = lastPoint.y + (firstPoint.y - lastPoint.y) *0.5; - - points.unshift(midPointX, midPointY); - points.push(midPointX, midPointY); - } - - var verts = webGLData.points; - var indices = webGLData.indices; - var length = points.length / 2; - var indexCount = points.length; - var indexStart = verts.length/6; - - // DRAW the Line - var width = graphicsData.lineWidth / 2; - - // sort color - var color = PIXI.hex2rgb(graphicsData.lineColor); - var alpha = graphicsData.lineAlpha; - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var px, py, p1x, p1y, p2x, p2y, p3x, p3y; - var perpx, perpy, perp2x, perp2y, perp3x, perp3y; - var a1, b1, c1, a2, b2, c2; - var denom, pdist, dist; - - p1x = points[0]; - p1y = points[1]; - - p2x = points[2]; - p2y = points[3]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - // start - verts.push(p1x - perpx , p1y - perpy, - r, g, b, alpha); - - verts.push(p1x + perpx , p1y + perpy, - r, g, b, alpha); - - for (i = 1; i < length-1; i++) - { - p1x = points[(i-1)*2]; - p1y = points[(i-1)*2 + 1]; - - p2x = points[(i)*2]; - p2y = points[(i)*2 + 1]; - - p3x = points[(i+1)*2]; - p3y = points[(i+1)*2 + 1]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - perp2x = -(p2y - p3y); - perp2y = p2x - p3x; - - dist = Math.sqrt(perp2x*perp2x + perp2y*perp2y); - perp2x /= dist; - perp2y /= dist; - perp2x *= width; - perp2y *= width; - - a1 = (-perpy + p1y) - (-perpy + p2y); - b1 = (-perpx + p2x) - (-perpx + p1x); - c1 = (-perpx + p1x) * (-perpy + p2y) - (-perpx + p2x) * (-perpy + p1y); - a2 = (-perp2y + p3y) - (-perp2y + p2y); - b2 = (-perp2x + p2x) - (-perp2x + p3x); - c2 = (-perp2x + p3x) * (-perp2y + p2y) - (-perp2x + p2x) * (-perp2y + p3y); - - denom = a1*b2 - a2*b1; - - if(Math.abs(denom) < 0.1 ) - { - - denom+=10.1; - verts.push(p2x - perpx , p2y - perpy, - r, g, b, alpha); - - verts.push(p2x + perpx , p2y + perpy, - r, g, b, alpha); - - continue; - } - - px = (b1*c2 - b2*c1)/denom; - py = (a2*c1 - a1*c2)/denom; - - - pdist = (px -p2x) * (px -p2x) + (py -p2y) + (py -p2y); - - - if(pdist > 140 * 140) - { - perp3x = perpx - perp2x; - perp3y = perpy - perp2y; - - dist = Math.sqrt(perp3x*perp3x + perp3y*perp3y); - perp3x /= dist; - perp3y /= dist; - perp3x *= width; - perp3y *= width; - - verts.push(p2x - perp3x, p2y -perp3y); - verts.push(r, g, b, alpha); - - verts.push(p2x + perp3x, p2y +perp3y); - verts.push(r, g, b, alpha); - - verts.push(p2x - perp3x, p2y -perp3y); - verts.push(r, g, b, alpha); - - indexCount++; - } - else - { - - verts.push(px , py); - verts.push(r, g, b, alpha); - - verts.push(p2x - (px-p2x), p2y - (py - p2y)); - verts.push(r, g, b, alpha); - } - } - - p1x = points[(length-2)*2]; - p1y = points[(length-2)*2 + 1]; - - p2x = points[(length-1)*2]; - p2y = points[(length-1)*2 + 1]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - verts.push(p2x - perpx , p2y - perpy); - verts.push(r, g, b, alpha); - - verts.push(p2x + perpx , p2y + perpy); - verts.push(r, g, b, alpha); - - indices.push(indexStart); - - for (i = 0; i < indexCount; i++) - { - indices.push(indexStart++); - } - - indices.push(indexStart-1); -}; - -/** - * Builds a complex polygon to draw - * - * @static - * @private - * @method buildComplexPoly - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildComplexPoly = function(graphicsData, webGLData) -{ - //TODO - no need to copy this as it gets turned into a FLoat32Array anyways.. - var points = graphicsData.points.slice(); - if(points.length < 6)return; - - // get first and last point.. figure out the middle! - var indices = webGLData.indices; - webGLData.points = points; - webGLData.alpha = graphicsData.fillAlpha; - webGLData.color = PIXI.hex2rgb(graphicsData.fillColor); - - /* - calclate the bounds.. - */ - var minX = Infinity; - var maxX = -Infinity; - - var minY = Infinity; - var maxY = -Infinity; - - var x,y; - - // get size.. - for (var i = 0; i < points.length; i+=2) - { - x = points[i]; - y = points[i+1]; - - minX = x < minX ? x : minX; - maxX = x > maxX ? x : maxX; - - minY = y < minY ? y : minY; - maxY = y > maxY ? y : maxY; - } - - // add a quad to the end cos there is no point making another buffer! - points.push(minX, minY, - maxX, minY, - maxX, maxY, - minX, maxY); - - // push a quad onto the end.. - - //TODO - this aint needed! - var length = points.length / 2; - for (i = 0; i < length; i++) - { - indices.push( i ); - } - -}; - -/** - * Builds a polygon to draw - * - * @static - * @private - * @method buildPoly - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildPoly = function(graphicsData, webGLData) -{ - var points = graphicsData.points; - - if(points.length < 6)return; - // get first and last point.. figure out the middle! - var verts = webGLData.points; - var indices = webGLData.indices; - - var length = points.length / 2; - - // sort color - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var triangles = PIXI.PolyK.Triangulate(points); - - if(!triangles)return false; - - var vertPos = verts.length / 6; - - var i = 0; - - for (i = 0; i < triangles.length; i+=3) - { - indices.push(triangles[i] + vertPos); - indices.push(triangles[i] + vertPos); - indices.push(triangles[i+1] + vertPos); - indices.push(triangles[i+2] +vertPos); - indices.push(triangles[i+2] + vertPos); - } - - for (i = 0; i < length; i++) - { - verts.push(points[i * 2], points[i * 2 + 1], - r, g, b, alpha); - } - - return true; -}; - -PIXI.WebGLGraphics.graphicsDataPool = []; - -/** - * @class WebGLGraphicsData - * @private - * @static - */ -PIXI.WebGLGraphicsData = function(gl) -{ - this.gl = gl; - - //TODO does this need to be split before uploding?? - this.color = [0,0,0]; // color split! - this.points = []; - this.indices = []; - this.buffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - this.mode = 1; - this.alpha = 1; - this.dirty = true; -}; - -/** - * @method reset - */ -PIXI.WebGLGraphicsData.prototype.reset = function() -{ - this.points = []; - this.indices = []; -}; - -/** - * @method upload - */ -PIXI.WebGLGraphicsData.prototype.upload = function() -{ - var gl = this.gl; - -// this.lastIndex = graphics.graphicsData.length; - this.glPoints = new PIXI.Float32Array(this.points); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer); - gl.bufferData(gl.ARRAY_BUFFER, this.glPoints, gl.STATIC_DRAW); - - this.glIndicies = new PIXI.Uint16Array(this.indices); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.glIndicies, gl.STATIC_DRAW); - - this.dirty = false; -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLMaskManager.js b/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLMaskManager.js deleted file mode 100755 index 607d5dd..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLMaskManager.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLMaskManager -* @constructor -* @private -*/ -PIXI.WebGLMaskManager = function() -{ -}; - -PIXI.WebGLMaskManager.prototype.constructor = PIXI.WebGLMaskManager; - -/** -* Sets the drawing context to the one given in parameter. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLMaskManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Applies the Mask and adds it to the current filter stack. -* -* @method pushMask -* @param maskData {Array} -* @param renderSession {Object} -*/ -PIXI.WebGLMaskManager.prototype.pushMask = function(maskData, renderSession) -{ - var gl = renderSession.gl; - - if(maskData.dirty) - { - PIXI.WebGLGraphics.updateGraphics(maskData, gl); - } - - if(!maskData._webGL[gl.id].data.length)return; - - renderSession.stencilManager.pushStencil(maskData, maskData._webGL[gl.id].data[0], renderSession); -}; - -/** -* Removes the last filter from the filter stack and doesn't return it. -* -* @method popMask -* @param maskData {Array} -* @param renderSession {Object} an object containing all the useful parameters -*/ -PIXI.WebGLMaskManager.prototype.popMask = function(maskData, renderSession) -{ - var gl = this.gl; - renderSession.stencilManager.popStencil(maskData, maskData._webGL[gl.id].data[0], renderSession); -}; - -/** -* Destroys the mask stack. -* -* @method destroy -*/ -PIXI.WebGLMaskManager.prototype.destroy = function() -{ - this.gl = null; -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderManager.js b/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderManager.js deleted file mode 100755 index a15974e..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderManager.js +++ /dev/null @@ -1,157 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLShaderManager -* @constructor -* @private -*/ -PIXI.WebGLShaderManager = function() -{ - /** - * @property maxAttibs - * @type Number - */ - this.maxAttibs = 10; - - /** - * @property attribState - * @type Array - */ - this.attribState = []; - - /** - * @property tempAttribState - * @type Array - */ - this.tempAttribState = []; - - for (var i = 0; i < this.maxAttibs; i++) - { - this.attribState[i] = false; - } - - /** - * @property stack - * @type Array - */ - this.stack = []; - -}; - -PIXI.WebGLShaderManager.prototype.constructor = PIXI.WebGLShaderManager; - -/** -* Initialises the context and the properties. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLShaderManager.prototype.setContext = function(gl) -{ - this.gl = gl; - - // the next one is used for rendering primitives - this.primitiveShader = new PIXI.PrimitiveShader(gl); - - // the next one is used for rendering triangle strips - this.complexPrimitiveShader = new PIXI.ComplexPrimitiveShader(gl); - - // this shader is used for the default sprite rendering - this.defaultShader = new PIXI.PixiShader(gl); - - // this shader is used for the fast sprite rendering - this.fastShader = new PIXI.PixiFastShader(gl); - - // the next one is used for rendering triangle strips - this.stripShader = new PIXI.StripShader(gl); - this.setShader(this.defaultShader); -}; - -/** -* Takes the attributes given in parameters. -* -* @method setAttribs -* @param attribs {Array} attribs -*/ -PIXI.WebGLShaderManager.prototype.setAttribs = function(attribs) -{ - // reset temp state - var i; - - for (i = 0; i < this.tempAttribState.length; i++) - { - this.tempAttribState[i] = false; - } - - // set the new attribs - for (i = 0; i < attribs.length; i++) - { - var attribId = attribs[i]; - this.tempAttribState[attribId] = true; - } - - var gl = this.gl; - - for (i = 0; i < this.attribState.length; i++) - { - if(this.attribState[i] !== this.tempAttribState[i]) - { - this.attribState[i] = this.tempAttribState[i]; - - if(this.tempAttribState[i]) - { - gl.enableVertexAttribArray(i); - } - else - { - gl.disableVertexAttribArray(i); - } - } - } -}; - -/** -* Sets the current shader. -* -* @method setShader -* @param shader {Any} -*/ -PIXI.WebGLShaderManager.prototype.setShader = function(shader) -{ - if(this._currentId === shader._UID)return false; - - this._currentId = shader._UID; - - this.currentShader = shader; - - this.gl.useProgram(shader.program); - this.setAttribs(shader.attributes); - - return true; -}; - -/** -* Destroys this object. -* -* @method destroy -*/ -PIXI.WebGLShaderManager.prototype.destroy = function() -{ - this.attribState = null; - - this.tempAttribState = null; - - this.primitiveShader.destroy(); - - this.complexPrimitiveShader.destroy(); - - this.defaultShader.destroy(); - - this.fastShader.destroy(); - - this.stripShader.destroy(); - - this.gl = null; -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderUtils.js b/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderUtils.js deleted file mode 100755 index a7d7826..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderUtils.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @method initDefaultShaders -* @static -* @private -*/ -PIXI.initDefaultShaders = function() -{ -}; - -/** -* @method CompileVertexShader -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @return {Any} -*/ -PIXI.CompileVertexShader = function(gl, shaderSrc) -{ - return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER); -}; - -/** -* @method CompileFragmentShader -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @return {Any} -*/ -PIXI.CompileFragmentShader = function(gl, shaderSrc) -{ - return PIXI._CompileShader(gl, shaderSrc, gl.FRAGMENT_SHADER); -}; - -/** -* @method _CompileShader -* @static -* @private -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @param shaderType {Number} -* @return {Any} -*/ -PIXI._CompileShader = function(gl, shaderSrc, shaderType) -{ - var src = shaderSrc.join("\n"); - var shader = gl.createShader(shaderType); - gl.shaderSource(shader, src); - gl.compileShader(shader); - - if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) - { - window.console.log(gl.getShaderInfoLog(shader)); - return null; - } - - return shader; -}; - -/** -* @method compileProgram -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param vertexSrc {Array} -* @param fragmentSrc {Array} -* @return {Any} -*/ -PIXI.compileProgram = function(gl, vertexSrc, fragmentSrc) -{ - var fragmentShader = PIXI.CompileFragmentShader(gl, fragmentSrc); - var vertexShader = PIXI.CompileVertexShader(gl, vertexSrc); - - var shaderProgram = gl.createProgram(); - - gl.attachShader(shaderProgram, vertexShader); - gl.attachShader(shaderProgram, fragmentShader); - gl.linkProgram(shaderProgram); - - if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) - { - window.console.log("Could not initialise shaders"); - } - - return shaderProgram; -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js b/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js deleted file mode 100755 index 711b4da..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js +++ /dev/null @@ -1,635 +0,0 @@ -/** - * @author Mat Groves - * - * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ - * for creating the original pixi version! - * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now share 4 bytes on the vertex buffer - * - * Heavily inspired by LibGDX's WebGLSpriteBatch: - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java - */ - - /** - * - * @class WebGLSpriteBatch - * @private - * @constructor - */ -PIXI.WebGLSpriteBatch = function() -{ - /** - * @property vertSize - * @type Number - */ - this.vertSize = 5; - - /** - * The number of images in the SpriteBatch before it flushes - * @property size - * @type Number - */ - this.size = 2000;//Math.pow(2, 16) / this.vertSize; - - //the total number of bytes in our batch - var numVerts = this.size * 4 * 4 * this.vertSize; - //the total number of indices in our batch - var numIndices = this.size * 6; - - /** - * Holds the vertices - * - * @property vertices - * @type ArrayBuffer - */ - this.vertices = new PIXI.ArrayBuffer(numVerts); - - /** - * View on the vertices as a Float32Array - * - * @property positions - * @type Float32Array - */ - this.positions = new PIXI.Float32Array(this.vertices); - - /** - * View on the vertices as a Uint32Array - * - * @property colors - * @type Uint32Array - */ - this.colors = new PIXI.Uint32Array(this.vertices); - - /** - * Holds the indices - * - * @property indices - * @type Uint16Array - */ - this.indices = new PIXI.Uint16Array(numIndices); - - /** - * @property lastIndexCount - * @type Number - */ - this.lastIndexCount = 0; - - for (var i=0, j=0; i < numIndices; i += 6, j += 4) - { - this.indices[i + 0] = j + 0; - this.indices[i + 1] = j + 1; - this.indices[i + 2] = j + 2; - this.indices[i + 3] = j + 0; - this.indices[i + 4] = j + 2; - this.indices[i + 5] = j + 3; - } - - /** - * @property drawing - * @type Boolean - */ - this.drawing = false; - - /** - * @property currentBatchSize - * @type Number - */ - this.currentBatchSize = 0; - - /** - * @property currentBaseTexture - * @type BaseTexture - */ - this.currentBaseTexture = null; - - /** - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * @property textures - * @type Array - */ - this.textures = []; - - /** - * @property blendModes - * @type Array - */ - this.blendModes = []; - - /** - * @property shaders - * @type Array - */ - this.shaders = []; - - /** - * @property sprites - * @type Array - */ - this.sprites = []; - - /** - * @property defaultShader - * @type AbstractFilter - */ - this.defaultShader = new PIXI.AbstractFilter([ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]); -}; - -/** -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLSpriteBatch.prototype.setContext = function(gl) -{ - this.gl = gl; - - // create a couple of buffers - this.vertexBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // 65535 is max index, so 65535 / 6 = 10922. - - //upload the index data - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); - - this.currentBlendMode = 99999; - - var shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc = this.defaultShader.fragmentSrc; - shader.uniforms = {}; - shader.init(); - - this.defaultShader.shaders[gl.id] = shader; -}; - -/** -* @method begin -* @param renderSession {Object} The RenderSession object -*/ -PIXI.WebGLSpriteBatch.prototype.begin = function(renderSession) -{ - this.renderSession = renderSession; - this.shader = this.renderSession.shaderManager.defaultShader; - - this.start(); -}; - -/** -* @method end -*/ -PIXI.WebGLSpriteBatch.prototype.end = function() -{ - this.flush(); -}; - -/** -* @method render -* @param sprite {Sprite} the sprite to render when using this spritebatch -*/ -PIXI.WebGLSpriteBatch.prototype.render = function(sprite) -{ - var texture = sprite.texture; - - //TODO set blend modes.. - // check texture.. - if(this.currentBatchSize >= this.size) - { - this.flush(); - this.currentBaseTexture = texture.baseTexture; - } - - // get the uvs for the texture - var uvs = texture._uvs; - // if the uvs have not updated then no point rendering just yet! - if(!uvs)return; - - // TODO trim?? - var aX = sprite.anchor.x; - var aY = sprite.anchor.y; - - var w0, w1, h0, h1; - - if (texture.trim) - { - // if the sprite is trimmed then we need to add the extra space before transforming the sprite coords.. - var trim = texture.trim; - - w1 = trim.x - aX * trim.width; - w0 = w1 + texture.crop.width; - - h1 = trim.y - aY * trim.height; - h0 = h1 + texture.crop.height; - - } - else - { - w0 = (texture.frame.width ) * (1-aX); - w1 = (texture.frame.width ) * -aX; - - h0 = texture.frame.height * (1-aY); - h1 = texture.frame.height * -aY; - } - - var index = this.currentBatchSize * 4 * this.vertSize; - - var resolution = texture.baseTexture.resolution; - - var worldTransform = sprite.worldTransform; - - var a = worldTransform.a / resolution; - var b = worldTransform.b / resolution; - var c = worldTransform.c / resolution; - var d = worldTransform.d / resolution; - var tx = worldTransform.tx; - var ty = worldTransform.ty; - - var colors = this.colors; - var positions = this.positions; - - if(this.renderSession.roundPixels) - { - // xy - positions[index] = a * w1 + c * h1 + tx | 0; - positions[index+1] = d * h1 + b * w1 + ty | 0; - - // xy - positions[index+5] = a * w0 + c * h1 + tx | 0; - positions[index+6] = d * h1 + b * w0 + ty | 0; - - // xy - positions[index+10] = a * w0 + c * h0 + tx | 0; - positions[index+11] = d * h0 + b * w0 + ty | 0; - - // xy - positions[index+15] = a * w1 + c * h0 + tx | 0; - positions[index+16] = d * h0 + b * w1 + ty | 0; - } - else - { - // xy - positions[index] = a * w1 + c * h1 + tx; - positions[index+1] = d * h1 + b * w1 + ty; - - // xy - positions[index+5] = a * w0 + c * h1 + tx; - positions[index+6] = d * h1 + b * w0 + ty; - - // xy - positions[index+10] = a * w0 + c * h0 + tx; - positions[index+11] = d * h0 + b * w0 + ty; - - // xy - positions[index+15] = a * w1 + c * h0 + tx; - positions[index+16] = d * h0 + b * w1 + ty; - } - - // uv - positions[index+2] = uvs.x0; - positions[index+3] = uvs.y0; - - // uv - positions[index+7] = uvs.x1; - positions[index+8] = uvs.y1; - - // uv - positions[index+12] = uvs.x2; - positions[index+13] = uvs.y2; - - // uv - positions[index+17] = uvs.x3; - positions[index+18] = uvs.y3; - - // color and alpha - var tint = sprite.tint; - colors[index+4] = colors[index+9] = colors[index+14] = colors[index+19] = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16) + (sprite.worldAlpha * 255 << 24); - - // increment the batchsize - this.sprites[this.currentBatchSize++] = sprite; - - -}; - -/** -* Renders a TilingSprite using the spriteBatch. -* -* @method renderTilingSprite -* @param sprite {TilingSprite} the tilingSprite to render -*/ -PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite) -{ - var texture = tilingSprite.tilingTexture; - - // check texture.. - if(this.currentBatchSize >= this.size) - { - //return; - this.flush(); - this.currentBaseTexture = texture.baseTexture; - } - - // set the textures uvs temporarily - // TODO create a separate texture so that we can tile part of a texture - - if(!tilingSprite._uvs)tilingSprite._uvs = new PIXI.TextureUvs(); - - var uvs = tilingSprite._uvs; - - tilingSprite.tilePosition.x %= texture.baseTexture.width * tilingSprite.tileScaleOffset.x; - tilingSprite.tilePosition.y %= texture.baseTexture.height * tilingSprite.tileScaleOffset.y; - - var offsetX = tilingSprite.tilePosition.x/(texture.baseTexture.width*tilingSprite.tileScaleOffset.x); - var offsetY = tilingSprite.tilePosition.y/(texture.baseTexture.height*tilingSprite.tileScaleOffset.y); - - var scaleX = (tilingSprite.width / texture.baseTexture.width) / (tilingSprite.tileScale.x * tilingSprite.tileScaleOffset.x); - var scaleY = (tilingSprite.height / texture.baseTexture.height) / (tilingSprite.tileScale.y * tilingSprite.tileScaleOffset.y); - - uvs.x0 = 0 - offsetX; - uvs.y0 = 0 - offsetY; - - uvs.x1 = (1 * scaleX) - offsetX; - uvs.y1 = 0 - offsetY; - - uvs.x2 = (1 * scaleX) - offsetX; - uvs.y2 = (1 * scaleY) - offsetY; - - uvs.x3 = 0 - offsetX; - uvs.y3 = (1 * scaleY) - offsetY; - - // get the tilingSprites current alpha and tint and combining them into a single color - var tint = tilingSprite.tint; - var color = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16) + (tilingSprite.alpha * 255 << 24); - - var positions = this.positions; - var colors = this.colors; - - var width = tilingSprite.width; - var height = tilingSprite.height; - - // TODO trim?? - var aX = tilingSprite.anchor.x; - var aY = tilingSprite.anchor.y; - var w0 = width * (1-aX); - var w1 = width * -aX; - - var h0 = height * (1-aY); - var h1 = height * -aY; - - var index = this.currentBatchSize * 4 * this.vertSize; - - var resolution = texture.baseTexture.resolution; - - var worldTransform = tilingSprite.worldTransform; - - var a = worldTransform.a / resolution;//[0]; - var b = worldTransform.b / resolution;//[3]; - var c = worldTransform.c / resolution;//[1]; - var d = worldTransform.d / resolution;//[4]; - var tx = worldTransform.tx;//[2]; - var ty = worldTransform.ty;//[5]; - - // xy - positions[index++] = a * w1 + c * h1 + tx; - positions[index++] = d * h1 + b * w1 + ty; - // uv - positions[index++] = uvs.x0; - positions[index++] = uvs.y0; - // color - colors[index++] = color; - - // xy - positions[index++] = (a * w0 + c * h1 + tx); - positions[index++] = d * h1 + b * w0 + ty; - // uv - positions[index++] = uvs.x1; - positions[index++] = uvs.y1; - // color - colors[index++] = color; - - // xy - positions[index++] = a * w0 + c * h0 + tx; - positions[index++] = d * h0 + b * w0 + ty; - // uv - positions[index++] = uvs.x2; - positions[index++] = uvs.y2; - // color - colors[index++] = color; - - // xy - positions[index++] = a * w1 + c * h0 + tx; - positions[index++] = d * h0 + b * w1 + ty; - // uv - positions[index++] = uvs.x3; - positions[index++] = uvs.y3; - // color - colors[index++] = color; - - // increment the batchsize - this.sprites[this.currentBatchSize++] = tilingSprite; -}; - -/** -* Renders the content and empties the current batch. -* -* @method flush -*/ -PIXI.WebGLSpriteBatch.prototype.flush = function() -{ - // If the batch is length 0 then return as there is nothing to draw - if (this.currentBatchSize===0)return; - - var gl = this.gl; - var shader; - - if(this.dirty) - { - this.dirty = false; - // bind the main texture - gl.activeTexture(gl.TEXTURE0); - - // bind the buffers - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - shader = this.defaultShader.shaders[gl.id]; - - // this is the same for each shader? - var stride = this.vertSize * 4; - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, stride, 2 * 4); - - // color attributes will be interpreted as unsigned bytes and normalized - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.UNSIGNED_BYTE, true, stride, 4 * 4); - } - - // upload the verts to the buffer - if(this.currentBatchSize > ( this.size * 0.5 ) ) - { - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - } - else - { - var view = this.positions.subarray(0, this.currentBatchSize * 4 * this.vertSize); - gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); - } - - var nextTexture, nextBlendMode, nextShader; - var batchSize = 0; - var start = 0; - - var currentBaseTexture = null; - var currentBlendMode = this.renderSession.blendModeManager.currentBlendMode; - var currentShader = null; - - var blendSwap = false; - var shaderSwap = false; - var sprite; - - for (var i = 0, j = this.currentBatchSize; i < j; i++) { - - sprite = this.sprites[i]; - - nextTexture = sprite.texture.baseTexture; - nextBlendMode = sprite.blendMode; - nextShader = sprite.shader || this.defaultShader; - - blendSwap = currentBlendMode !== nextBlendMode; - shaderSwap = currentShader !== nextShader; // should I use _UIDS??? - - if(currentBaseTexture !== nextTexture || blendSwap || shaderSwap) - { - this.renderBatch(currentBaseTexture, batchSize, start); - - start = i; - batchSize = 0; - currentBaseTexture = nextTexture; - - if( blendSwap ) - { - currentBlendMode = nextBlendMode; - this.renderSession.blendModeManager.setBlendMode( currentBlendMode ); - } - - if( shaderSwap ) - { - currentShader = nextShader; - - shader = currentShader.shaders[gl.id]; - - if(!shader) - { - shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc =currentShader.fragmentSrc; - shader.uniforms =currentShader.uniforms; - shader.init(); - - currentShader.shaders[gl.id] = shader; - } - - // set shader function??? - this.renderSession.shaderManager.setShader(shader); - - if(shader.dirty)shader.syncUniforms(); - - // both thease only need to be set if they are changing.. - // set the projection - var projection = this.renderSession.projection; - gl.uniform2f(shader.projectionVector, projection.x, projection.y); - - // TODO - this is temprorary! - var offsetVector = this.renderSession.offset; - gl.uniform2f(shader.offsetVector, offsetVector.x, offsetVector.y); - - // set the pointers - } - } - - batchSize++; - } - - this.renderBatch(currentBaseTexture, batchSize, start); - - // then reset the batch! - this.currentBatchSize = 0; -}; - -/** -* @method renderBatch -* @param texture {Texture} -* @param size {Number} -* @param startIndex {Number} -*/ -PIXI.WebGLSpriteBatch.prototype.renderBatch = function(texture, size, startIndex) -{ - if(size === 0)return; - - var gl = this.gl; - - // check if a texture is dirty.. - if(texture._dirty[gl.id]) - { - this.renderSession.renderer.updateTexture(texture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]); - } - - // now draw those suckas! - gl.drawElements(gl.TRIANGLES, size * 6, gl.UNSIGNED_SHORT, startIndex * 6 * 2); - - // increment the draw count - this.renderSession.drawCount++; -}; - -/** -* @method stop -*/ -PIXI.WebGLSpriteBatch.prototype.stop = function() -{ - this.flush(); - this.dirty = true; -}; - -/** -* @method start -*/ -PIXI.WebGLSpriteBatch.prototype.start = function() -{ - this.dirty = true; -}; - -/** -* Destroys the SpriteBatch. -* -* @method destroy -*/ -PIXI.WebGLSpriteBatch.prototype.destroy = function() -{ - this.vertices = null; - this.indices = null; - - this.gl.deleteBuffer( this.vertexBuffer ); - this.gl.deleteBuffer( this.indexBuffer ); - - this.currentBaseTexture = null; - - this.gl = null; -}; \ No newline at end of file diff --git a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLStencilManager.js b/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLStencilManager.js deleted file mode 100755 index 989d8cf..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLStencilManager.js +++ /dev/null @@ -1,297 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLStencilManager -* @constructor -* @private -*/ -PIXI.WebGLStencilManager = function() -{ - this.stencilStack = []; - this.reverse = true; - this.count = 0; -}; - -/** -* Sets the drawing context to the one given in parameter. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLStencilManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Applies the Mask and adds it to the current filter stack. -* -* @method pushMask -* @param graphics {Graphics} -* @param webGLData {Array} -* @param renderSession {Object} -*/ -PIXI.WebGLStencilManager.prototype.pushStencil = function(graphics, webGLData, renderSession) -{ - var gl = this.gl; - this.bindGraphics(graphics, webGLData, renderSession); - - if(this.stencilStack.length === 0) - { - gl.enable(gl.STENCIL_TEST); - gl.clear(gl.STENCIL_BUFFER_BIT); - this.reverse = true; - this.count = 0; - } - - this.stencilStack.push(webGLData); - - var level = this.count; - - gl.colorMask(false, false, false, false); - - gl.stencilFunc(gl.ALWAYS,0,0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT); - - // draw the triangle strip! - - if(webGLData.mode === 1) - { - gl.drawElements(gl.TRIANGLE_FAN, webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 ); - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - - // draw a quad to increment.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - } - - this.reverse = !this.reverse; - } - else - { - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - } - } - - gl.colorMask(true, true, true, true); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP); - - this.count++; -}; - -/** - * TODO this does not belong here! - * - * @method bindGraphics - * @param graphics {Graphics} - * @param webGLData {Array} - * @param renderSession {Object} - */ -PIXI.WebGLStencilManager.prototype.bindGraphics = function(graphics, webGLData, renderSession) -{ - //if(this._currentGraphics === graphics)return; - this._currentGraphics = graphics; - - var gl = this.gl; - - // bind the graphics object.. - var projection = renderSession.projection, - offset = renderSession.offset, - shader;// = renderSession.shaderManager.primitiveShader; - - if(webGLData.mode === 1) - { - shader = renderSession.shaderManager.complexPrimitiveShader; - - renderSession.shaderManager.setShader( shader ); - - gl.uniform1f(shader.flipY, renderSession.flipY); - - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - gl.uniform3fv(shader.color, webGLData.color); - - gl.uniform1f(shader.alpha, graphics.worldAlpha * webGLData.alpha); - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 2, 0); - - - // now do the rest.. - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - } - else - { - //renderSession.shaderManager.activatePrimitiveShader(); - shader = renderSession.shaderManager.primitiveShader; - renderSession.shaderManager.setShader( shader ); - - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform1f(shader.flipY, renderSession.flipY); - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - - gl.uniform1f(shader.alpha, graphics.worldAlpha); - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0); - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4); - - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - } -}; - -/** - * @method popStencil - * @param graphics {Graphics} - * @param webGLData {Array} - * @param renderSession {Object} - */ -PIXI.WebGLStencilManager.prototype.popStencil = function(graphics, webGLData, renderSession) -{ - var gl = this.gl; - this.stencilStack.pop(); - - this.count--; - - if(this.stencilStack.length === 0) - { - // the stack is empty! - gl.disable(gl.STENCIL_TEST); - - } - else - { - - var level = this.count; - - this.bindGraphics(graphics, webGLData, renderSession); - - gl.colorMask(false, false, false, false); - - if(webGLData.mode === 1) - { - this.reverse = !this.reverse; - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - - // draw a quad to increment.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - gl.stencilFunc(gl.ALWAYS,0,0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT); - - // draw the triangle strip! - gl.drawElements(gl.TRIANGLE_FAN, webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - } - - } - else - { - // console.log("<<>>") - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - } - } - - gl.colorMask(true, true, true, true); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP); - - - } -}; - -/** -* Destroys the mask stack. -* -* @method destroy -*/ -PIXI.WebGLStencilManager.prototype.destroy = function() -{ - this.stencilStack = null; - this.gl = null; -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/text/BitmapText.js b/tutorial-1/pixi.js-master/src/pixi/text/BitmapText.js deleted file mode 100755 index a1d20af..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/text/BitmapText.js +++ /dev/null @@ -1,215 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A BitmapText object will create a line or multiple lines of text using bitmap font. To split a line you can use '\n', '\r' or '\r\n' in your string. - * You can generate the fnt files using - * http://www.angelcode.com/products/bmfont/ for windows or - * http://www.bmglyph.com/ for mac. - * - * @class BitmapText - * @extends DisplayObjectContainer - * @constructor - * @param text {String} The copy that you would like the text to display - * @param style {Object} The style parameters - * @param style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously) - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - */ -PIXI.BitmapText = function(text, style) -{ - PIXI.DisplayObjectContainer.call(this); - - /** - * [read-only] The width of the overall text, different from fontSize, - * which is defined in the style object - * - * @property textWidth - * @type Number - * @readOnly - */ - this.textWidth = 0; - - /** - * [read-only] The height of the overall text, different from fontSize, - * which is defined in the style object - * - * @property textHeight - * @type Number - * @readOnly - */ - this.textHeight = 0; - - /** - * @property _pool - * @type Array - * @private - */ - this._pool = []; - - this.setText(text); - this.setStyle(style); - this.updateText(); - - /** - * The dirty state of this object. - * @property dirty - * @type Boolean - */ - this.dirty = false; -}; - -// constructor -PIXI.BitmapText.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); -PIXI.BitmapText.prototype.constructor = PIXI.BitmapText; - -/** - * Set the text string to be rendered. - * - * @method setText - * @param text {String} The text that you would like displayed - */ -PIXI.BitmapText.prototype.setText = function(text) -{ - this.text = text || ' '; - this.dirty = true; -}; - -/** - * Set the style of the text - * style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously) - * [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single lines of text - * - * @method setStyle - * @param style {Object} The style parameters, contained as properties of an object - */ -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; - this.tint = style.tint; -}; - -/** - * Renders text and updates it when needed - * - * @method updateText - * @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(/(?:\r\n|\r|\n)/.test(this.text.charAt(i))) - { - 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.kerning[prevCharCode]) - { - pos.x += charData.kerning[prevCharCode]; - } - - chars.push({texture:charData.texture, 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); - } - - var lenChildren = this.children.length; - var lenChars = chars.length; - var tint = this.tint || 0xFFFFFF; - - for(i = 0; i < lenChars; i++) - { - var c = i < lenChildren ? this.children[i] : this._pool.pop(); // get old child if have. if not - take from pool. - - if (c) c.setTexture(chars[i].texture); // check if got one before. - else c = new PIXI.Sprite(chars[i].texture); // if no create new one. - - c.position.x = (chars[i].position.x + lineAlignOffsets[chars[i].line]) * scale; - c.position.y = chars[i].position.y * scale; - c.scale.x = c.scale.y = scale; - c.tint = tint; - if (!c.parent) this.addChild(c); - } - - // remove unnecessary children. - // and put their into the pool. - while(this.children.length > lenChars) - { - var child = this.getChildAt(this.children.length - 1); - this._pool.push(child); - this.removeChild(child); - } - - this.textWidth = maxLineWidth * scale; - this.textHeight = (pos.y + data.lineHeight) * scale; -}; - -/** - * Updates the transform of this object - * - * @method updateTransform - * @private - */ -PIXI.BitmapText.prototype.updateTransform = function() -{ - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - PIXI.DisplayObjectContainer.prototype.updateTransform.call(this); -}; - -PIXI.BitmapText.fonts = {}; diff --git a/tutorial-1/pixi.js-master/src/pixi/text/Text.js b/tutorial-1/pixi.js-master/src/pixi/text/Text.js deleted file mode 100755 index b5a6e30..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/text/Text.js +++ /dev/null @@ -1,533 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * Modified by Tom Slezakowski http://www.tomslezakowski.com @TomSlezakowski (24/03/2014) - Added dropShadowColor. - */ - -/** - * A Text Object will create a line or multiple lines of text. To split a line you can use '\n' in your text string, - * or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object. - * - * @class Text - * @extends Sprite - * @constructor - * @param text {String} The copy that you would like the text to display - * @param [style] {Object} The style parameters - * @param [style.font] {String} default 'bold 20px Arial' The style and size of the font - * @param [style.fill='black'] {String|Number} A canvas fillstyle that will be used on the text e.g 'red', '#00FF00' - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - * @param [style.stroke] {String|Number} A canvas fillstyle that will be used on the text stroke e.g 'blue', '#FCFF00' - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke) - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap, it needs wordWrap to be set to true - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00' - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow - */ -PIXI.Text = function(text, style) -{ - /** - * The canvas element that everything is drawn to - * - * @property canvas - * @type HTMLCanvasElement - */ - this.canvas = document.createElement('canvas'); - - /** - * The canvas 2d context that everything is drawn with - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.canvas.getContext('2d'); - - /** - * The resolution of the canvas. - * @property resolution - * @type Number - */ - this.resolution = 1; - - PIXI.Sprite.call(this, PIXI.Texture.fromCanvas(this.canvas)); - - this.setText(text); - this.setStyle(style); - -}; - -// constructor -PIXI.Text.prototype = Object.create(PIXI.Sprite.prototype); -PIXI.Text.prototype.constructor = PIXI.Text; - -/** - * The width of the Text, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.Text.prototype, 'width', { - get: function() { - - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - - return this.scale.x * this.texture.frame.width; - }, - set: function(value) { - this.scale.x = value / this.texture.frame.width; - this._width = value; - } -}); - -/** - * The height of the Text, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.Text.prototype, 'height', { - get: function() { - - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - - return this.scale.y * this.texture.frame.height; - }, - set: function(value) { - this.scale.y = value / this.texture.frame.height; - this._height = value; - } -}); - -/** - * Set the style of the text - * - * @method setStyle - * @param [style] {Object} The style parameters - * @param [style.font='bold 20pt Arial'] {String} The style and size of the font - * @param [style.fill='black'] {Object} A canvas fillstyle that will be used on the text eg 'red', '#00FF00' - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - * @param [style.stroke='black'] {String} A canvas fillstyle that will be used on the text stroke eg 'blue', '#FCFF00' - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke) - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00' - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow - */ -PIXI.Text.prototype.setStyle = function(style) -{ - style = style || {}; - style.font = style.font || 'bold 20pt Arial'; - style.fill = style.fill || 'black'; - style.align = style.align || 'left'; - style.stroke = style.stroke || 'black'; //provide a default, see: https://github.com/GoodBoyDigital/pixi.js/issues/136 - style.strokeThickness = style.strokeThickness || 0; - style.wordWrap = style.wordWrap || false; - style.wordWrapWidth = style.wordWrapWidth || 100; - - style.dropShadow = style.dropShadow || false; - style.dropShadowAngle = style.dropShadowAngle || Math.PI / 6; - style.dropShadowDistance = style.dropShadowDistance || 4; - style.dropShadowColor = style.dropShadowColor || 'black'; - - this.style = style; - this.dirty = true; -}; - -/** - * Set the copy for the text object. To split a line you can use '\n'. - * - * @method setText - * @param text {String} The copy that you would like the text to display - */ -PIXI.Text.prototype.setText = function(text) -{ - this.text = text.toString() || ' '; - this.dirty = true; -}; - -/** - * Renders text and updates it when needed - * - * @method updateText - * @private - */ -PIXI.Text.prototype.updateText = function() -{ - this.texture.baseTexture.resolution = this.resolution; - - this.context.font = this.style.font; - - var outputText = this.text; - - // word wrap - // preserve original text - if(this.style.wordWrap)outputText = this.wordWrap(this.text); - - //split text into lines - var lines = outputText.split(/(?:\r\n|\r|\n)/); - - //calculate text width - var lineWidths = []; - var maxLineWidth = 0; - var fontProperties = this.determineFontProperties(this.style.font); - for (var i = 0; i < lines.length; i++) - { - var lineWidth = this.context.measureText(lines[i]).width; - lineWidths[i] = lineWidth; - maxLineWidth = Math.max(maxLineWidth, lineWidth); - } - - var width = maxLineWidth + this.style.strokeThickness; - if(this.style.dropShadow)width += this.style.dropShadowDistance; - - this.canvas.width = ( width + this.context.lineWidth ) * this.resolution; - - //calculate text height - var lineHeight = fontProperties.fontSize + this.style.strokeThickness; - - var height = lineHeight * lines.length; - if(this.style.dropShadow)height += this.style.dropShadowDistance; - - this.canvas.height = height * this.resolution; - - this.context.scale( this.resolution, this.resolution); - - if(navigator.isCocoonJS) this.context.clearRect(0,0,this.canvas.width,this.canvas.height); - - // used for debugging.. - //this.context.fillStyle ="#FF0000" - //this.context.fillRect(0, 0, this.canvas.width,this.canvas.height); - - this.context.font = this.style.font; - this.context.strokeStyle = this.style.stroke; - this.context.lineWidth = this.style.strokeThickness; - this.context.textBaseline = 'alphabetic'; - //this.context.lineJoin = 'round'; - - var linePositionX; - var linePositionY; - - if(this.style.dropShadow) - { - this.context.fillStyle = this.style.dropShadowColor; - - var xShadowOffset = Math.sin(this.style.dropShadowAngle) * this.style.dropShadowDistance; - var yShadowOffset = Math.cos(this.style.dropShadowAngle) * this.style.dropShadowDistance; - - for (i = 0; i < lines.length; i++) - { - linePositionX = this.style.strokeThickness / 2; - linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent; - - if(this.style.align === 'right') - { - linePositionX += maxLineWidth - lineWidths[i]; - } - else if(this.style.align === 'center') - { - linePositionX += (maxLineWidth - lineWidths[i]) / 2; - } - - if(this.style.fill) - { - this.context.fillText(lines[i], linePositionX + xShadowOffset, linePositionY + yShadowOffset); - } - - // if(dropShadow) - } - } - - //set canvas text styles - this.context.fillStyle = this.style.fill; - - //draw lines line by line - for (i = 0; i < lines.length; i++) - { - linePositionX = this.style.strokeThickness / 2; - linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent; - - if(this.style.align === 'right') - { - linePositionX += maxLineWidth - lineWidths[i]; - } - else if(this.style.align === 'center') - { - linePositionX += (maxLineWidth - lineWidths[i]) / 2; - } - - if(this.style.stroke && this.style.strokeThickness) - { - this.context.strokeText(lines[i], linePositionX, linePositionY); - } - - if(this.style.fill) - { - this.context.fillText(lines[i], linePositionX, linePositionY); - } - - // if(dropShadow) - } - - this.updateTexture(); -}; - -/** - * Updates texture size based on canvas size - * - * @method updateTexture - * @private - */ -PIXI.Text.prototype.updateTexture = function() -{ - this.texture.baseTexture.width = this.canvas.width; - this.texture.baseTexture.height = this.canvas.height; - this.texture.crop.width = this.texture.frame.width = this.canvas.width; - this.texture.crop.height = this.texture.frame.height = this.canvas.height; - - this._width = this.canvas.width; - this._height = this.canvas.height; - - // update the dirty base textures - this.texture.baseTexture.dirty(); -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Text.prototype._renderWebGL = function(renderSession) -{ - if(this.dirty) - { - this.resolution = renderSession.resolution; - - this.updateText(); - this.dirty = false; - } - - PIXI.Sprite.prototype._renderWebGL.call(this, renderSession); -}; - -/** -* Renders the object using the Canvas renderer -* -* @method _renderCanvas -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Text.prototype._renderCanvas = function(renderSession) -{ - if(this.dirty) - { - this.resolution = renderSession.resolution; - - this.updateText(); - this.dirty = false; - } - - PIXI.Sprite.prototype._renderCanvas.call(this, renderSession); -}; - -/** -* Calculates the ascent, descent and fontSize of a given fontStyle -* -* @method determineFontProperties -* @param fontStyle {Object} -* @private -*/ -PIXI.Text.prototype.determineFontProperties = function(fontStyle) -{ - var properties = PIXI.Text.fontPropertiesCache[fontStyle]; - - if(!properties) - { - properties = {}; - - var canvas = PIXI.Text.fontPropertiesCanvas; - var context = PIXI.Text.fontPropertiesContext; - - context.font = fontStyle; - - var width = Math.ceil(context.measureText('|Mq').width); - var baseline = Math.ceil(context.measureText('M').width); - var height = 2 * baseline; - - baseline = baseline * 1.4 | 0; - - canvas.width = width; - canvas.height = height; - - context.fillStyle = '#f00'; - context.fillRect(0, 0, width, height); - - context.font = fontStyle; - - context.textBaseline = 'alphabetic'; - context.fillStyle = '#000'; - context.fillText('|MÉq', 0, baseline); - - var imagedata = context.getImageData(0, 0, width, height).data; - var pixels = imagedata.length; - var line = width * 4; - - var i, j; - - var idx = 0; - var stop = false; - - // ascent. scan from top to bottom until we find a non red pixel - for(i = 0; i < baseline; i++) - { - for(j = 0; j < line; j += 4) - { - if(imagedata[idx + j] !== 255) - { - stop = true; - break; - } - } - if(!stop) - { - idx += line; - } - else - { - break; - } - } - - properties.ascent = baseline - i; - - idx = pixels - line; - stop = false; - - // descent. scan from bottom to top until we find a non red pixel - for(i = height; i > baseline; i--) - { - for(j = 0; j < line; j += 4) - { - if(imagedata[idx + j] !== 255) - { - stop = true; - break; - } - } - if(!stop) - { - idx -= line; - } - else - { - break; - } - } - - properties.descent = i - baseline; - //TODO might need a tweak. kind of a temp fix! - properties.descent += 6; - properties.fontSize = properties.ascent + properties.descent; - - PIXI.Text.fontPropertiesCache[fontStyle] = properties; - } - - return properties; -}; - -/** - * Applies newlines to a string to have it optimally fit into the horizontal - * bounds set by the Text object's wordWrapWidth property. - * - * @method wordWrap - * @param text {String} - * @private - */ -PIXI.Text.prototype.wordWrap = function(text) -{ - // Greedy wrapping algorithm that will wrap words as the line grows longer - // than its horizontal bounds. - var result = ''; - var lines = text.split('\n'); - for (var i = 0; i < lines.length; i++) - { - var spaceLeft = this.style.wordWrapWidth; - var words = lines[i].split(' '); - for (var j = 0; j < words.length; j++) - { - var wordWidth = this.context.measureText(words[j]).width; - var wordWidthWithSpace = wordWidth + this.context.measureText(' ').width; - if(j === 0 || wordWidthWithSpace > spaceLeft) - { - // Skip printing the newline if it's the first word of the line that is - // greater than the word wrap width. - if(j > 0) - { - result += '\n'; - } - result += words[j]; - spaceLeft = this.style.wordWrapWidth - wordWidth; - } - else - { - spaceLeft -= wordWidthWithSpace; - result += ' ' + words[j]; - } - } - - if (i < lines.length-1) - { - result += '\n'; - } - } - return result; -}; - -/** -* Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. -* -* @method getBounds -* @param matrix {Matrix} the transformation matrix of the Text -* @return {Rectangle} the framing rectangle -*/ -PIXI.Text.prototype.getBounds = function(matrix) -{ - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - return PIXI.Sprite.prototype.getBounds.call(this, matrix); -}; - -/** - * Destroys this text object. - * - * @method destroy - * @param destroyBaseTexture {Boolean} whether to destroy the base texture as well - */ -PIXI.Text.prototype.destroy = function(destroyBaseTexture) -{ - // make sure to reset the the context and canvas.. dont want this hanging around in memory! - this.context = null; - this.canvas = null; - - this.texture.destroy(destroyBaseTexture === undefined ? true : destroyBaseTexture); -}; - -PIXI.Text.fontPropertiesCache = {}; -PIXI.Text.fontPropertiesCanvas = document.createElement('canvas'); -PIXI.Text.fontPropertiesContext = PIXI.Text.fontPropertiesCanvas.getContext('2d'); diff --git a/tutorial-1/pixi.js-master/src/pixi/textures/BaseTexture.js b/tutorial-1/pixi.js-master/src/pixi/textures/BaseTexture.js deleted file mode 100755 index 0145849..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/textures/BaseTexture.js +++ /dev/null @@ -1,305 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -PIXI.BaseTextureCache = {}; - -PIXI.BaseTextureCacheIdGenerator = 0; - -/** - * A texture stores the information that represents an image. All textures have a base texture. - * - * @class BaseTexture - * @uses EventTarget - * @constructor - * @param source {String} the source object (image or canvas) - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - */ -PIXI.BaseTexture = function(source, scaleMode) -{ - /** - * The Resolution of the texture. - * - * @property resolution - * @type Number - */ - this.resolution = 1; - - /** - * [read-only] The width of the base texture set when the image has loaded - * - * @property width - * @type Number - * @readOnly - */ - this.width = 100; - - /** - * [read-only] The height of the base texture set when the image has loaded - * - * @property height - * @type Number - * @readOnly - */ - this.height = 100; - - /** - * The scale mode to apply when scaling this texture - * - * @property scaleMode - * @type {Number} - * @default PIXI.scaleModes.LINEAR - */ - this.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - /** - * [read-only] Set to true once the base texture has loaded - * - * @property hasLoaded - * @type Boolean - * @readOnly - */ - this.hasLoaded = false; - - /** - * The image source that is used to create the texture. - * - * @property source - * @type Image - */ - this.source = source; - - this._UID = PIXI._UID++; - - /** - * Controls if RGB channels should be pre-multiplied by Alpha (WebGL only) - * - * @property premultipliedAlpha - * @type Boolean - * @default true - */ - this.premultipliedAlpha = true; - - // used for webGL - - /** - * @property _glTextures - * @type Array - * @private - */ - this._glTextures = []; - - /** - * - * Set this to true if a mipmap of this texture needs to be generated. This value needs to be set before the texture is used - * Also the texture must be a power of two size to work - * - * @property mipmap - * @type {Boolean} - */ - this.mipmap = false; - - // used for webGL texture updating... - // TODO - this needs to be addressed - - /** - * @property _dirty - * @type Array - * @private - */ - this._dirty = [true, true, true, true]; - - if(!source)return; - - if((this.source.complete || this.source.getContext) && this.source.width && this.source.height) - { - this.hasLoaded = true; - this.width = this.source.naturalWidth || this.source.width; - this.height = this.source.naturalHeight || this.source.height; - this.dirty(); - } - else - { - var scope = this; - - this.source.onload = function() { - - scope.hasLoaded = true; - scope.width = scope.source.naturalWidth || scope.source.width; - scope.height = scope.source.naturalHeight || scope.source.height; - - scope.dirty(); - - // add it to somewhere... - scope.dispatchEvent( { type: 'loaded', content: scope } ); - }; - - this.source.onerror = function() { - scope.dispatchEvent( { type: 'error', content: scope } ); - }; - } - - /** - * @property imageUrl - * @type String - */ - this.imageUrl = null; - - /** - * @property _powerOf2 - * @type Boolean - * @private - */ - this._powerOf2 = false; - -}; - -PIXI.BaseTexture.prototype.constructor = PIXI.BaseTexture; - -PIXI.EventTarget.mixin(PIXI.BaseTexture.prototype); - -/** - * Destroys this base texture - * - * @method destroy - */ -PIXI.BaseTexture.prototype.destroy = function() -{ - if(this.imageUrl) - { - delete PIXI.BaseTextureCache[this.imageUrl]; - delete PIXI.TextureCache[this.imageUrl]; - this.imageUrl = null; - if (!navigator.isCocoonJS) this.source.src = ''; - } - else if (this.source && this.source._pixiId) - { - delete PIXI.BaseTextureCache[this.source._pixiId]; - } - this.source = null; - - this.unloadFromGPU(); -}; - -/** - * Changes the source image of the texture - * - * @method updateSourceImage - * @param newSrc {String} the path of the image - */ -PIXI.BaseTexture.prototype.updateSourceImage = function(newSrc) -{ - this.hasLoaded = false; - this.source.src = null; - this.source.src = newSrc; -}; - -/** - * Sets all glTextures to be dirty. - * - * @method dirty - */ -PIXI.BaseTexture.prototype.dirty = function() -{ - for (var i = 0; i < this._glTextures.length; i++) - { - this._dirty[i] = true; - } -}; - -/** - * Removes the base texture from the GPU, useful for managing resources on the GPU. - * Atexture is still 100% usable and will simply be reuploaded if there is a sprite on screen that is using it. - * - * @method unloadFromGPU - */ -PIXI.BaseTexture.prototype.unloadFromGPU = function() -{ - this.dirty(); - - // delete the webGL textures if any. - for (var i = this._glTextures.length - 1; i >= 0; i--) - { - var glTexture = this._glTextures[i]; - var gl = PIXI.glContexts[i]; - - if(gl && glTexture) - { - gl.deleteTexture(glTexture); - } - - } - - this._glTextures.length = 0; - - this.dirty(); -}; - -/** - * Helper function that creates a base texture from the given image url. - * If the image is not in the base texture cache it will be created and loaded. - * - * @static - * @method fromImage - * @param imageUrl {String} The image url of the texture - * @param crossorigin {Boolean} - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return BaseTexture - */ -PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode) -{ - var baseTexture = PIXI.BaseTextureCache[imageUrl]; - - if(crossorigin === undefined && imageUrl.indexOf('data:') === -1) crossorigin = true; - - if(!baseTexture) - { - // new Image() breaks tex loading in some versions of Chrome. - // See https://code.google.com/p/chromium/issues/detail?id=238071 - var image = new Image();//document.createElement('img'); - if (crossorigin) - { - image.crossOrigin = ''; - } - - image.src = imageUrl; - baseTexture = new PIXI.BaseTexture(image, scaleMode); - baseTexture.imageUrl = imageUrl; - PIXI.BaseTextureCache[imageUrl] = baseTexture; - - // if there is an @2x at the end of the url we are going to assume its a highres image - if( imageUrl.indexOf(PIXI.RETINA_PREFIX + '.') !== -1) - { - baseTexture.resolution = 2; - } - } - - return baseTexture; -}; - -/** - * Helper function that creates a base texture from the given canvas element. - * - * @static - * @method fromCanvas - * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return BaseTexture - */ -PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode) -{ - if(!canvas._pixiId) - { - canvas._pixiId = 'canvas_' + PIXI.TextureCacheIdGenerator++; - } - - var baseTexture = PIXI.BaseTextureCache[canvas._pixiId]; - - if(!baseTexture) - { - baseTexture = new PIXI.BaseTexture(canvas, scaleMode); - PIXI.BaseTextureCache[canvas._pixiId] = baseTexture; - } - - return baseTexture; -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/textures/RenderTexture.js b/tutorial-1/pixi.js-master/src/pixi/textures/RenderTexture.js deleted file mode 100755 index 849ce47..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/textures/RenderTexture.js +++ /dev/null @@ -1,339 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A RenderTexture is a special texture that allows any Pixi display object to be rendered to it. - * - * __Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead. - * - * A RenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example: - * - * var renderTexture = new PIXI.RenderTexture(800, 600); - * var sprite = PIXI.Sprite.fromImage("spinObj_01.png"); - * sprite.position.x = 800/2; - * sprite.position.y = 600/2; - * sprite.anchor.x = 0.5; - * sprite.anchor.y = 0.5; - * renderTexture.render(sprite); - * - * The Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual position a DisplayObjectContainer should be used: - * - * var doc = new PIXI.DisplayObjectContainer(); - * doc.addChild(sprite); - * renderTexture.render(doc); // Renders to center of renderTexture - * - * @class RenderTexture - * @extends Texture - * @constructor - * @param width {Number} The width of the render texture - * @param height {Number} The height of the render texture - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @param resolution {Number} The resolution of the texture being generated - */ -PIXI.RenderTexture = function(width, height, renderer, scaleMode, resolution) -{ - /** - * The with of the render texture - * - * @property width - * @type Number - */ - this.width = width || 100; - - /** - * The height of the render texture - * - * @property height - * @type Number - */ - this.height = height || 100; - - /** - * The Resolution of the texture. - * - * @property resolution - * @type Number - */ - this.resolution = resolution || 1; - - /** - * The framing rectangle of the render texture - * - * @property frame - * @type Rectangle - */ - this.frame = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @property crop - * @type Rectangle - */ - this.crop = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * The base texture object that this texture uses - * - * @property baseTexture - * @type BaseTexture - */ - this.baseTexture = new PIXI.BaseTexture(); - this.baseTexture.width = this.width * this.resolution; - this.baseTexture.height = this.height * this.resolution; - this.baseTexture._glTextures = []; - this.baseTexture.resolution = this.resolution; - - this.baseTexture.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - this.baseTexture.hasLoaded = true; - - PIXI.Texture.call(this, - this.baseTexture, - new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution) - ); - - /** - * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. - * - * @property renderer - * @type CanvasRenderer|WebGLRenderer - */ - this.renderer = renderer || PIXI.defaultRenderer; - - if(this.renderer.type === PIXI.WEBGL_RENDERER) - { - var gl = this.renderer.gl; - this.baseTexture._dirty[gl.id] = false; - - this.textureBuffer = new PIXI.FilterTexture(gl, this.width, this.height, this.baseTexture.scaleMode); - this.baseTexture._glTextures[gl.id] = this.textureBuffer.texture; - - this.render = this.renderWebGL; - this.projection = new PIXI.Point(this.width*0.5, -this.height*0.5); - } - else - { - this.render = this.renderCanvas; - this.textureBuffer = new PIXI.CanvasBuffer(this.width* this.resolution, this.height* this.resolution); - this.baseTexture.source = this.textureBuffer.canvas; - } - - /** - * @property valid - * @type Boolean - */ - this.valid = true; - - this._updateUvs(); -}; - -PIXI.RenderTexture.prototype = Object.create(PIXI.Texture.prototype); -PIXI.RenderTexture.prototype.constructor = PIXI.RenderTexture; - -/** - * Resizes the RenderTexture. - * - * @method resize - * @param width {Number} The width to resize to. - * @param height {Number} The height to resize to. - * @param updateBase {Boolean} Should the baseTexture.width and height values be resized as well? - */ -PIXI.RenderTexture.prototype.resize = function(width, height, updateBase) -{ - if (width === this.width && height === this.height)return; - - this.valid = (width > 0 && height > 0); - - this.width = width; - this.height = height; - - this.frame.width = this.crop.width = width * this.resolution; - this.frame.height = this.crop.height = height * this.resolution; - - if (updateBase) - { - this.baseTexture.width = this.width * this.resolution; - this.baseTexture.height = this.height * this.resolution; - } - - if (this.renderer.type === PIXI.WEBGL_RENDERER) - { - this.projection.x = this.width / 2; - this.projection.y = -this.height / 2; - } - - if(!this.valid)return; - - this.textureBuffer.resize(this.width, this.height); -}; - -/** - * Clears the RenderTexture. - * - * @method clear - */ -PIXI.RenderTexture.prototype.clear = function() -{ - if(!this.valid)return; - - if (this.renderer.type === PIXI.WEBGL_RENDERER) - { - this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer); - } - - this.textureBuffer.clear(); -}; - -/** - * This function will draw the display object to the texture. - * - * @method renderWebGL - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. - * @param [clear] {Boolean} If true the texture will be cleared before the displayObject is drawn - * @private - */ -PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, matrix, clear) -{ - if(!this.valid)return; - //TOOD replace position with matrix.. - - //Lets create a nice matrix to apply to our display object. Frame buffers come in upside down so we need to flip the matrix - var wt = displayObject.worldTransform; - wt.identity(); - wt.translate(0, this.projection.y * 2); - if(matrix)wt.append(matrix); - wt.scale(1,-1); - - // setWorld Alpha to ensure that the object is renderer at full opacity - displayObject.worldAlpha = 1; - - // Time to update all the children of the displayObject with the new matrix.. - var children = displayObject.children; - - for(var i=0,j=children.length; i this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) - { - throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); - } - - this.valid = frame && frame.width && frame.height && this.baseTexture.source && this.baseTexture.hasLoaded; - - if (this.trim) - { - this.width = this.trim.width; - this.height = this.trim.height; - this.frame.width = this.trim.width; - this.frame.height = this.trim.height; - } - - if (this.valid) this._updateUvs(); - -}; - -/** - * Updates the internal WebGL UV cache. - * - * @method _updateUvs - * @private - */ -PIXI.Texture.prototype._updateUvs = function() -{ - if(!this._uvs)this._uvs = new PIXI.TextureUvs(); - - var frame = this.crop; - var tw = this.baseTexture.width; - var th = this.baseTexture.height; - - this._uvs.x0 = frame.x / tw; - this._uvs.y0 = frame.y / th; - - this._uvs.x1 = (frame.x + frame.width) / tw; - this._uvs.y1 = frame.y / th; - - this._uvs.x2 = (frame.x + frame.width) / tw; - this._uvs.y2 = (frame.y + frame.height) / th; - - this._uvs.x3 = frame.x / tw; - this._uvs.y3 = (frame.y + frame.height) / th; -}; - -/** - * Helper function that creates a Texture object from the given image url. - * If the image is not in the texture cache it will be created and loaded. - * - * @static - * @method fromImage - * @param imageUrl {String} The image url of the texture - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return Texture - */ -PIXI.Texture.fromImage = function(imageUrl, crossorigin, scaleMode) -{ - var texture = PIXI.TextureCache[imageUrl]; - - if(!texture) - { - texture = new PIXI.Texture(PIXI.BaseTexture.fromImage(imageUrl, crossorigin, scaleMode)); - PIXI.TextureCache[imageUrl] = texture; - } - - return texture; -}; - -/** - * Helper function that returns a Texture objected based on the given frame id. - * If the frame id is not in the texture cache an error will be thrown. - * - * @static - * @method fromFrame - * @param frameId {String} The frame id of the texture - * @return Texture - */ -PIXI.Texture.fromFrame = function(frameId) -{ - var texture = PIXI.TextureCache[frameId]; - if(!texture) throw new Error('The frameId "' + frameId + '" does not exist in the texture cache '); - return texture; -}; - -/** - * Helper function that creates a new a Texture based on the given canvas element. - * - * @static - * @method fromCanvas - * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return Texture - */ -PIXI.Texture.fromCanvas = function(canvas, scaleMode) -{ - var baseTexture = PIXI.BaseTexture.fromCanvas(canvas, scaleMode); - - return new PIXI.Texture( baseTexture ); - -}; - -/** - * Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object. - * - * @static - * @method addTextureToCache - * @param texture {Texture} The Texture to add to the cache. - * @param id {String} The id that the texture will be stored against. - */ -PIXI.Texture.addTextureToCache = function(texture, id) -{ - PIXI.TextureCache[id] = texture; -}; - -/** - * Remove a texture from the global PIXI.TextureCache. - * - * @static - * @method removeTextureFromCache - * @param id {String} The id of the texture to be removed - * @return {Texture} The texture that was removed - */ -PIXI.Texture.removeTextureFromCache = function(id) -{ - var texture = PIXI.TextureCache[id]; - delete PIXI.TextureCache[id]; - delete PIXI.BaseTextureCache[id]; - return texture; -}; - -PIXI.TextureUvs = function() -{ - this.x0 = 0; - this.y0 = 0; - - this.x1 = 0; - this.y1 = 0; - - this.x2 = 0; - this.y2 = 0; - - this.x3 = 0; - this.y3 = 0; -}; - -PIXI.Texture.emptyTexture = new PIXI.Texture(new PIXI.BaseTexture()); - diff --git a/tutorial-1/pixi.js-master/src/pixi/textures/VideoTexture.js b/tutorial-1/pixi.js-master/src/pixi/textures/VideoTexture.js deleted file mode 100755 index ad58ec5..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/textures/VideoTexture.js +++ /dev/null @@ -1,168 +0,0 @@ -/** - * A texture of a [playing] Video. - * - * See the ["deus" demo](http://www.goodboydigital.com/pixijs/examples/deus/). - * - * @class VideoTexture - * @extends BaseTexture - * @constructor - * @param source {HTMLVideoElement} - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - */ -PIXI.VideoTexture = function( source, scaleMode ) -{ - if( !source ){ - throw new Error( 'No video source element specified.' ); - } - - // hook in here to check if video is already available. - // PIXI.BaseTexture looks for a source.complete boolean, plus width & height. - - if( (source.readyState === source.HAVE_ENOUGH_DATA || source.readyState === source.HAVE_FUTURE_DATA ) && source.width && source.height ) - { - source.complete = true; - } - - PIXI.BaseTexture.call( this, source, scaleMode ); - - this.autoUpdate = false; - this.updateBound = this._onUpdate.bind(this); - - if( !source.complete ) - { - this._onCanPlay = this.onCanPlay.bind(this); - - source.addEventListener( 'canplay', this._onCanPlay ); - source.addEventListener( 'canplaythrough', this._onCanPlay ); - - // started playing.. - source.addEventListener( 'play', this.onPlayStart.bind(this) ); - source.addEventListener( 'pause', this.onPlayStop.bind(this) ); - } - -}; - -PIXI.VideoTexture.prototype = Object.create( PIXI.BaseTexture.prototype ); - -PIXI.VideoTexture.constructor = PIXI.VideoTexture; - -PIXI.VideoTexture.prototype._onUpdate = function() -{ - if(this.autoUpdate) - { - window.requestAnimationFrame(this.updateBound); - this.dirty(); - } -}; - -PIXI.VideoTexture.prototype.onPlayStart = function() -{ - if(!this.autoUpdate) - { - window.requestAnimationFrame(this.updateBound); - this.autoUpdate = true; - } -}; - -PIXI.VideoTexture.prototype.onPlayStop = function() -{ - this.autoUpdate = false; -}; - -PIXI.VideoTexture.prototype.onCanPlay = function() -{ - if( event.type === 'canplaythrough' ) - { - this.hasLoaded = true; - - - if( this.source ) - { - this.source.removeEventListener( 'canplay', this._onCanPlay ); - this.source.removeEventListener( 'canplaythrough', this._onCanPlay ); - - this.width = this.source.videoWidth; - this.height = this.source.videoHeight; - - // prevent multiple loaded dispatches.. - if( !this.__loaded ){ - this.__loaded = true; - this.dispatchEvent( { type: 'loaded', content: this } ); - } - } - } -}; - -PIXI.VideoTexture.prototype.destroy = function() -{ - if( this.source && this.source._pixiId ) - { - PIXI.BaseTextureCache[ this.source._pixiId ] = null; - delete PIXI.BaseTextureCache[ this.source._pixiId ]; - - this.source._pixiId = null; - delete this.source._pixiId; - } - - PIXI.BaseTexture.prototype.destroy.call( this ); -}; - -/** - * Mimic Pixi BaseTexture.from.... method. - * - * @static - * @method baseTextureFromVideo - * @param video {HTMLVideoElement} - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return {VideoTexture} - */ -PIXI.VideoTexture.baseTextureFromVideo = function( video, scaleMode ) -{ - if( !video._pixiId ) - { - video._pixiId = 'video_' + PIXI.TextureCacheIdGenerator++; - } - - var baseTexture = PIXI.BaseTextureCache[ video._pixiId ]; - - if( !baseTexture ) - { - baseTexture = new PIXI.VideoTexture( video, scaleMode ); - PIXI.BaseTextureCache[ video._pixiId ] = baseTexture; - } - - return baseTexture; -}; - -/** - * Mimic Pixi BaseTexture.from.... method. - * - * @static - * @method textureFromVideo - * @param video {HTMLVideoElement} - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture, but not a VideoTexture. - */ -PIXI.VideoTexture.textureFromVideo = function( video, scaleMode ) -{ - var baseTexture = PIXI.VideoTexture.baseTextureFromVideo( video, scaleMode ); - return new PIXI.Texture( baseTexture ); -}; - -/** - * Mimic Pixi BaseTexture.from.... method. - * - * @static - * @method fromUrl - * @param videoSrc {String} The URL for the video. - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return {VideoTexture} - */ -PIXI.VideoTexture.fromUrl = function( videoSrc, scaleMode ) -{ - var video = document.createElement('video'); - video.src = videoSrc; - video.autoPlay = true; - video.play(); - return PIXI.VideoTexture.textureFromVideo( video, scaleMode); -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/utils/Detector.js b/tutorial-1/pixi.js-master/src/pixi/utils/Detector.js deleted file mode 100755 index fe38f04..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/utils/Detector.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This helper function will automatically detect which renderer you should be using. - * WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by - * the browser then this function will return a canvas renderer - * - * @method autoDetectRenderer - * @for PIXI - * @static - * @param width=800 {Number} the width of the renderers view - * @param height=600 {Number} the height of the renderers view - * - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * - */ -PIXI.autoDetectRenderer = function(width, height, options) -{ - if(!width)width = 800; - if(!height)height = 600; - - // BORROWED from Mr Doob (mrdoob.com) - var webgl = ( function () { try { - var canvas = document.createElement( 'canvas' ); - return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ); - } catch( e ) { - return false; - } - } )(); - - if( webgl ) - { - return new PIXI.WebGLRenderer(width, height, options); - } - - return new PIXI.CanvasRenderer(width, height, options); -}; - -/** - * This helper function will automatically detect which renderer you should be using. - * This function is very similar to the autoDetectRenderer function except that is will return a canvas renderer for android. - * Even thought both android chrome supports webGL the canvas implementation perform better at the time of writing. - * This function will likely change and update as webGL performance improves on these devices. - * - * @method autoDetectRecommendedRenderer - * @for PIXI - * @static - * @param width=800 {Number} the width of the renderers view - * @param height=600 {Number} the height of the renderers view - * - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * - */ -PIXI.autoDetectRecommendedRenderer = function(width, height, options) -{ - if(!width)width = 800; - if(!height)height = 600; - - // BORROWED from Mr Doob (mrdoob.com) - var webgl = ( function () { try { - var canvas = document.createElement( 'canvas' ); - return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ); - } catch( e ) { - return false; - } - } )(); - - var isAndroid = /Android/i.test(navigator.userAgent); - - if( webgl && !isAndroid) - { - return new PIXI.WebGLRenderer(width, height, options); - } - - return new PIXI.CanvasRenderer(width, height, options); -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/utils/EventTarget.js b/tutorial-1/pixi.js-master/src/pixi/utils/EventTarget.js deleted file mode 100755 index 35aa31b..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/utils/EventTarget.js +++ /dev/null @@ -1,284 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * @author Chad Engler https://github.com/englercj @Rolnaaba - */ - -/** - * Originally based on https://github.com/mrdoob/eventtarget.js/ from mr Doob. - * Currently takes inspiration from the nodejs EventEmitter, EventEmitter3, and smokesignals - */ - -/** - * Mixins event emitter functionality to a class - * - * @class EventTarget - * @example - * function MyEmitter() {} - * - * PIXI.EventTarget.mixin(MyEmitter.prototype); - * - * var em = new MyEmitter(); - * em.emit('eventName', 'some data', 'some more data', {}, null, ...); - */ -PIXI.EventTarget = { - /** - * Backward compat from when this used to be a function - */ - call: function callCompat(obj) { - if(obj) { - obj = obj.prototype || obj; - PIXI.EventTarget.mixin(obj); - } - }, - - /** - * Mixes in the properties of the EventTarget prototype onto another object - * - * @method mixin - * @param object {Object} The obj to mix into - */ - mixin: function mixin(obj) { - /** - * Return a list of assigned event listeners. - * - * @method listeners - * @param eventName {String} The events that should be listed. - * @return {Array} An array of listener functions - */ - obj.listeners = function listeners(eventName) { - this._listeners = this._listeners || {}; - - return this._listeners[eventName] ? this._listeners[eventName].slice() : []; - }; - - /** - * Emit an event to all registered event listeners. - * - * @method emit - * @alias dispatchEvent - * @param eventName {String} The name of the event. - * @return {Boolean} Indication if we've emitted an event. - */ - obj.emit = obj.dispatchEvent = function emit(eventName, data) { - this._listeners = this._listeners || {}; - - //backwards compat with old method ".emit({ type: 'something' })" - if(typeof eventName === 'object') { - data = eventName; - eventName = eventName.type; - } - - //ensure we are using a real pixi event - if(!data || data.__isEventObject !== true) { - data = new PIXI.Event(this, eventName, data); - } - - //iterate the listeners - if(this._listeners && this._listeners[eventName]) { - var listeners = this._listeners[eventName].slice(0), - length = listeners.length, - fn = listeners[0], - i; - - for(i = 0; i < length; fn = listeners[++i]) { - //call the event listener - fn.call(this, data); - - //if "stopImmediatePropagation" is called, stop calling sibling events - if(data.stoppedImmediate) { - return this; - } - } - - //if "stopPropagation" is called then don't bubble the event - if(data.stopped) { - return this; - } - } - - //bubble this event up the scene graph - if(this.parent && this.parent.emit) { - this.parent.emit.call(this.parent, eventName, data); - } - - return this; - }; - - /** - * Register a new EventListener for the given event. - * - * @method on - * @alias addEventListener - * @param eventName {String} Name of the event. - * @param callback {Functon} fn Callback function. - */ - obj.on = obj.addEventListener = function on(eventName, fn) { - this._listeners = this._listeners || {}; - - (this._listeners[eventName] = this._listeners[eventName] || []) - .push(fn); - - return this; - }; - - /** - * Add an EventListener that's only called once. - * - * @method once - * @param eventName {String} Name of the event. - * @param callback {Function} Callback function. - */ - obj.once = function once(eventName, fn) { - this._listeners = this._listeners || {}; - - var self = this; - function onceHandlerWrapper() { - fn.apply(self.off(eventName, onceHandlerWrapper), arguments); - } - onceHandlerWrapper._originalHandler = fn; - - return this.on(eventName, onceHandlerWrapper); - }; - - /** - * Remove event listeners. - * - * @method off - * @alias removeEventListener - * @param eventName {String} The event we want to remove. - * @param callback {Function} The listener that we need to find. - */ - obj.off = obj.removeEventListener = function off(eventName, fn) { - this._listeners = this._listeners || {}; - - if(!this._listeners[eventName]) - return this; - - var list = this._listeners[eventName], - i = fn ? list.length : 0; - - while(i-- > 0) { - if(list[i] === fn || list[i]._originalHandler === fn) { - list.splice(i, 1); - } - } - - if(list.length === 0) { - delete this._listeners[eventName]; - } - - return this; - }; - - /** - * Remove all listeners or only the listeners for the specified event. - * - * @method removeAllListeners - * @param eventName {String} The event you want to remove all listeners for. - */ - obj.removeAllListeners = function removeAllListeners(eventName) { - this._listeners = this._listeners || {}; - - if(!this._listeners[eventName]) - return this; - - delete this._listeners[eventName]; - - return this; - }; - } -}; - -/** - * Creates an homogenous object for tracking events so users can know what to expect. - * - * @class Event - * @extends Object - * @constructor - * @param target {Object} The target object that the event is called on - * @param name {String} The string name of the event that was triggered - * @param data {Object} Arbitrary event data to pass along - */ -PIXI.Event = function(target, name, data) { - //for duck typing in the ".on()" function - this.__isEventObject = true; - - /** - * Tracks the state of bubbling propagation. Do not - * set this directly, instead use `event.stopPropagation()` - * - * @property stopped - * @type Boolean - * @private - * @readOnly - */ - this.stopped = false; - - /** - * Tracks the state of sibling listener propagation. Do not - * set this directly, instead use `event.stopImmediatePropagation()` - * - * @property stoppedImmediate - * @type Boolean - * @private - * @readOnly - */ - this.stoppedImmediate = false; - - /** - * The original target the event triggered on. - * - * @property target - * @type Object - * @readOnly - */ - this.target = target; - - /** - * The string name of the event that this represents. - * - * @property type - * @type String - * @readOnly - */ - this.type = name; - - /** - * The data that was passed in with this event. - * - * @property data - * @type Object - * @readOnly - */ - this.data = data; - - //backwards compat with older version of events - this.content = data; - - /** - * The timestamp when the event occurred. - * - * @property timeStamp - * @type Number - * @readOnly - */ - this.timeStamp = Date.now(); -}; - -/** - * Stops the propagation of events up the scene graph (prevents bubbling). - * - * @method stopPropagation - */ -PIXI.Event.prototype.stopPropagation = function stopPropagation() { - this.stopped = true; -}; - -/** - * Stops the propagation of events to sibling listeners (no longer calls any listeners). - * - * @method stopImmediatePropagation - */ -PIXI.Event.prototype.stopImmediatePropagation = function stopImmediatePropagation() { - this.stoppedImmediate = true; -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/utils/Polyk.js b/tutorial-1/pixi.js-master/src/pixi/utils/Polyk.js deleted file mode 100755 index 838e6a2..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/utils/Polyk.js +++ /dev/null @@ -1,168 +0,0 @@ -/* - PolyK library - url: http://polyk.ivank.net - Released under MIT licence. - - Copyright (c) 2012 Ivan Kuckir - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation - files (the "Software"), to deal in the Software without - restriction, including without limitation the rights to use, - copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following - conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. - - This is an amazing lib! - - Slightly modified by Mat Groves (matgroves.com); -*/ - -/** - * Based on the Polyk library http://polyk.ivank.net released under MIT licence. - * This is an amazing lib! - * Slightly modified by Mat Groves (matgroves.com); - * @class PolyK - */ -PIXI.PolyK = {}; - -/** - * Triangulates shapes for webGL graphic fills. - * - * @method Triangulate - */ -PIXI.PolyK.Triangulate = function(p) -{ - var sign = true; - - var n = p.length >> 1; - if(n < 3) return []; - - var tgs = []; - var avl = []; - for(var i = 0; i < n; i++) avl.push(i); - - i = 0; - var al = n; - while(al > 3) - { - var i0 = avl[(i+0)%al]; - var i1 = avl[(i+1)%al]; - var i2 = avl[(i+2)%al]; - - var ax = p[2*i0], ay = p[2*i0+1]; - var bx = p[2*i1], by = p[2*i1+1]; - var cx = p[2*i2], cy = p[2*i2+1]; - - var earFound = false; - if(PIXI.PolyK._convex(ax, ay, bx, by, cx, cy, sign)) - { - earFound = true; - for(var j = 0; j < al; j++) - { - var vi = avl[j]; - if(vi === i0 || vi === i1 || vi === i2) continue; - - if(PIXI.PolyK._PointInTriangle(p[2*vi], p[2*vi+1], ax, ay, bx, by, cx, cy)) { - earFound = false; - break; - } - } - } - - if(earFound) - { - tgs.push(i0, i1, i2); - avl.splice((i+1)%al, 1); - al--; - i = 0; - } - else if(i++ > 3*al) - { - // need to flip flip reverse it! - // reset! - if(sign) - { - tgs = []; - avl = []; - for(i = 0; i < n; i++) avl.push(i); - - i = 0; - al = n; - - sign = false; - } - else - { - // window.console.log("PIXI Warning: shape too complex to fill"); - return null; - } - } - } - - tgs.push(avl[0], avl[1], avl[2]); - return tgs; -}; - -/** - * Checks whether a point is within a triangle - * - * @method _PointInTriangle - * @param px {Number} x coordinate of the point to test - * @param py {Number} y coordinate of the point to test - * @param ax {Number} x coordinate of the a point of the triangle - * @param ay {Number} y coordinate of the a point of the triangle - * @param bx {Number} x coordinate of the b point of the triangle - * @param by {Number} y coordinate of the b point of the triangle - * @param cx {Number} x coordinate of the c point of the triangle - * @param cy {Number} y coordinate of the c point of the triangle - * @private - * @return {Boolean} - */ -PIXI.PolyK._PointInTriangle = function(px, py, ax, ay, bx, by, cx, cy) -{ - var v0x = cx-ax; - var v0y = cy-ay; - var v1x = bx-ax; - var v1y = by-ay; - var v2x = px-ax; - var v2y = py-ay; - - var dot00 = v0x*v0x+v0y*v0y; - var dot01 = v0x*v1x+v0y*v1y; - var dot02 = v0x*v2x+v0y*v2y; - var dot11 = v1x*v1x+v1y*v1y; - var dot12 = v1x*v2x+v1y*v2y; - - var invDenom = 1 / (dot00 * dot11 - dot01 * dot01); - var u = (dot11 * dot02 - dot01 * dot12) * invDenom; - var v = (dot00 * dot12 - dot01 * dot02) * invDenom; - - // Check if point is in triangle - return (u >= 0) && (v >= 0) && (u + v < 1); -}; - -/** - * Checks whether a shape is convex - * - * @method _convex - * @private - * @return {Boolean} - */ -PIXI.PolyK._convex = function(ax, ay, bx, by, cx, cy, sign) -{ - return ((ay-by)*(cx-bx) + (bx-ax)*(cy-by) >= 0) === sign; -}; diff --git a/tutorial-1/pixi.js-master/src/pixi/utils/Utils.js b/tutorial-1/pixi.js-master/src/pixi/utils/Utils.js deleted file mode 100755 index 1a0127d..0000000 --- a/tutorial-1/pixi.js-master/src/pixi/utils/Utils.js +++ /dev/null @@ -1,220 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ -// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating - -// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel - -// MIT license - -/** - * A polyfill for requestAnimationFrame - * You can actually use both requestAnimationFrame and requestAnimFrame, - * you will still benefit from the polyfill - * - * @method requestAnimationFrame - */ - -/** - * A polyfill for cancelAnimationFrame - * - * @method cancelAnimationFrame - */ -(function(window) { - var lastTime = 0; - var vendors = ['ms', 'moz', 'webkit', 'o']; - for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { - window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']; - window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || - window[vendors[x] + 'CancelRequestAnimationFrame']; - } - - if (!window.requestAnimationFrame) { - window.requestAnimationFrame = function(callback) { - var currTime = new Date().getTime(); - var timeToCall = Math.max(0, 16 - (currTime - lastTime)); - var id = window.setTimeout(function() { callback(currTime + timeToCall); }, - timeToCall); - lastTime = currTime + timeToCall; - return id; - }; - } - - if (!window.cancelAnimationFrame) { - window.cancelAnimationFrame = function(id) { - clearTimeout(id); - }; - } - - window.requestAnimFrame = window.requestAnimationFrame; -})(this); - -/** - * Converts a hex color number to an [R, G, B] array - * - * @method hex2rgb - * @param hex {Number} - */ -PIXI.hex2rgb = function(hex) { - return [(hex >> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255]; -}; - -/** - * Converts a color as an [R, G, B] array to a hex number - * - * @method rgb2hex - * @param rgb {Array} - */ -PIXI.rgb2hex = function(rgb) { - return ((rgb[0]*255 << 16) + (rgb[1]*255 << 8) + rgb[2]*255); -}; - -/** - * A polyfill for Function.prototype.bind - * - * @method bind - */ -if (typeof Function.prototype.bind !== 'function') { - Function.prototype.bind = (function () { - return function (thisArg) { - var target = this, i = arguments.length - 1, boundArgs = []; - if (i > 0) - { - boundArgs.length = i; - while (i--) boundArgs[i] = arguments[i + 1]; - } - - if (typeof target !== 'function') throw new TypeError(); - - function bound() { - var i = arguments.length, args = new Array(i); - while (i--) args[i] = arguments[i]; - args = boundArgs.concat(args); - return target.apply(this instanceof bound ? this : thisArg, args); - } - - bound.prototype = (function F(proto) { - if (proto) F.prototype = proto; - if (!(this instanceof F)) return new F(); - })(target.prototype); - - return bound; - }; - })(); -} - -/** - * A wrapper for ajax requests to be handled cross browser - * - * @class AjaxRequest - * @constructor - */ -PIXI.AjaxRequest = function() -{ - var activexmodes = ['Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.3.0', 'Microsoft.XMLHTTP']; //activeX versions to check for in IE - - if (window.ActiveXObject) - { //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken) - for (var i=0; i 0 && (number & (number - 1)) === 0) // see: http://goo.gl/D9kPj - return number; - else - { - var result = 1; - while (result < number) result <<= 1; - return result; - } -}; - -/** - * checks if the given width and height make a power of two texture - * @method isPowerOfTwo - * @param width {Number} - * @param height {Number} - * @return {Boolean} - */ -PIXI.isPowerOfTwo = function(width, height) -{ - return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0); - -}; diff --git a/tutorial-1/pixi.js-master/tasks/karma.js b/tutorial-1/pixi.js-master/tasks/karma.js deleted file mode 100755 index e20aca5..0000000 --- a/tutorial-1/pixi.js-master/tasks/karma.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = function (grunt) { - 'use strict'; - - var path = require('path'); - var server = require('karma').server; - - grunt.registerMultiTask('karma', 'run karma.', function(target) { - //merge data onto options, with data taking precedence - var options = grunt.util._.merge(this.options(), this.data), - done = this.async(); - - if (options.configFile) { - options.configFile = grunt.template.process(options.configFile); - options.configFile = path.resolve(options.configFile); - } - - done = this.async(); - server.start(options, function(code) { - done(!code); - }); - }); -}; diff --git a/tutorial-1/pixi.js-master/test/functional/example-1-basics/bunny.png b/tutorial-1/pixi.js-master/test/functional/example-1-basics/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-1/pixi.js-master/test/functional/example-1-basics/bunny.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/test/functional/example-1-basics/frame-30.png b/tutorial-1/pixi.js-master/test/functional/example-1-basics/frame-30.png deleted file mode 100755 index 96e3409..0000000 Binary files a/tutorial-1/pixi.js-master/test/functional/example-1-basics/frame-30.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/test/functional/example-1-basics/frame-60.png b/tutorial-1/pixi.js-master/test/functional/example-1-basics/frame-60.png deleted file mode 100755 index af3f4ce..0000000 Binary files a/tutorial-1/pixi.js-master/test/functional/example-1-basics/frame-60.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/test/functional/example-1-basics/frame-90.png b/tutorial-1/pixi.js-master/test/functional/example-1-basics/frame-90.png deleted file mode 100755 index 099b823..0000000 Binary files a/tutorial-1/pixi.js-master/test/functional/example-1-basics/frame-90.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/test/functional/example-1-basics/index.js b/tutorial-1/pixi.js-master/test/functional/example-1-basics/index.js deleted file mode 100755 index 2ad32bd..0000000 --- a/tutorial-1/pixi.js-master/test/functional/example-1-basics/index.js +++ /dev/null @@ -1,133 +0,0 @@ -describe('Example 1 - Basics', function () { - 'use strict'; - - var baseUri = '/base/test/functional/example-1-basics'; - var expect = chai.expect; - var currentFrame = 0; - var frameEvents = {}; - var stage; - var renderer; - var bunny; - - function onFrame(frame, callback) { - frameEvents[frame] = callback; - } - - function animate() { - currentFrame += 1; - - window.requestAnimFrame( animate ); - - // just for fun, lets rotate mr rabbit a little - bunny.rotation += 0.1; - - // render the stage - renderer.render(stage); - - if (frameEvents[currentFrame]) - frameEvents[currentFrame](currentFrame); - } - - function initScene() { - // create an new instance of a pixi stage - stage = new PIXI.Stage(0x66FF99); - - // create a renderer instance - renderer = PIXI.autoDetectRenderer(400, 300); - console.log('Is PIXI.WebGLRenderer: ' + (renderer instanceof PIXI.WebGLRenderer)); - - // add the renderer view element to the DOM - document.body.appendChild(renderer.view); - - window.requestAnimFrame( animate ); - - // create a texture from an image path - var texture = PIXI.Texture.fromImage(baseUri + '/bunny.png'); - // create a new Sprite using the texture - bunny = new PIXI.Sprite(texture); - - // center the sprites anchor point - bunny.anchor.x = 0.5; - bunny.anchor.y = 0.5; - - // move the sprite t the center of the screen - bunny.position.x = 200; - bunny.position.y = 150; - - stage.addChild(bunny); - } - - it('assets loaded', function (done) { - var loader = new PIXI.AssetLoader([ - baseUri + '/bunny.png', - baseUri + '/frame-30.png', - baseUri + '/frame-60.png', - baseUri + '/frame-90.png' - ]); - // loader.on('onProgress', function (event) { - // console.log(event.content); - // }); - loader.on('onComplete', function () { - done(); - initScene(); - }); - loader.load(); - }); - - it('frame 30 should match', function (done) { - this.timeout(700); - onFrame(30, function () { - var str = renderer.view.toDataURL('image/png'); - //console.log(''); - resemble(str) - .compareTo(baseUri + '/frame-30.png') - .onComplete(function (data) { - expect(data).to.be.an('object'); - expect(data.isSameDimensions).to.equal(true); - expect(data.misMatchPercentage).to.be.below(0.2); - done(); - }); - }); - }); - - it('frame 60 should match', function (done) { - this.timeout(1200); - onFrame(60, function () { - var str = renderer.view.toDataURL('image/png'); - //console.log(''); - resemble(str) - .compareTo(baseUri + '/frame-60.png') - .onComplete(function (data) { - expect(data).to.be.an('object'); - expect(data.isSameDimensions).to.equal(true); - expect(data.misMatchPercentage).to.be.below(0.2); - done(); - }); - }); - }); - - it('frame 90 should match', function (done) { - this.timeout(1700); - onFrame(90, function () { - var str = renderer.view.toDataURL('image/png'); - //console.log(''); - resemble(str) - .compareTo(baseUri + '/frame-90.png') - .onComplete(function (data) { - expect(data).to.be.an('object'); - expect(data.isSameDimensions).to.equal(true); - expect(data.misMatchPercentage).to.be.below(0.2); - done(); - }); - }); - }); - - // it('capture something', function (done) { - // this.timeout(2000000); - // onFrame(30, function () { - // var img = new Image(); - // img.src = renderer.view.toDataURL('image/png'); - // document.body.appendChild(img); - // }); - // }); -}); diff --git a/tutorial-1/pixi.js-master/test/karma.conf.js b/tutorial-1/pixi.js-master/test/karma.conf.js deleted file mode 100755 index 86715ab..0000000 --- a/tutorial-1/pixi.js-master/test/karma.conf.js +++ /dev/null @@ -1,83 +0,0 @@ -module.exports = function(config) { - config.set({ - - // base path, that will be used to resolve files and exclude - basePath : '../', - - frameworks : ['mocha'], - - // list of files / patterns to load in the browser - files : [ - 'node_modules/chai/chai.js', - 'bin/pixi.dev.js', - 'test/lib/**/*.js', - 'test/unit/**/*.js', - // 'test/functional/**/*.js', - {pattern: 'test/**/*.png', watched: false, included: false, served: true} - ], - - // list of files to exclude - //exclude : [], - - // use dolts reporter, as travis terminal does not support escaping sequences - // possible values: 'dots', 'progress', 'junit', 'teamcity' - // CLI --reporters progress - reporters : ['spec'], - - // web server port - // CLI --port 9876 - port : 9876, - - // cli runner port - // CLI --runner-port 9100 - runnerPort : 9100, - - // enable / disable colors in the output (reporters and logs) - // CLI --colors --no-colors - colors : true, - - // level of logging - // possible values: karma.LOG_DISABLE || karma.LOG_ERROR || karma.LOG_WARN || karma.LOG_INFO || karma.LOG_DEBUG - // CLI --log-level debug - logLevel : config.LOG_INFO, - - // enable / disable watching file and executing tests whenever any file changes - // CLI --auto-watch --no-auto-watch - autoWatch : false, - - // Start these browsers, currently available: - // - Chrome - // - ChromeCanary - // - Firefox - // - Opera - // - Safari (only Mac) - // - PhantomJS - // - IE (only Windows) - // CLI --browsers Chrome,Firefox,Safari - browsers : ['Firefox'], - - // If browser does not capture in given timeout [ms], kill it - // CLI --capture-timeout 60000 - captureTimeout : 60000, - - // Auto run tests on start (when browsers are captured) and exit - // CLI --single-run --no-single-run - singleRun : true, - - // report which specs are slower than 500ms - // CLI --report-slower-than 500 - reportSlowerThan : 500, - - preprocessors : { - // '**/client/js/*.js': 'coverage' - }, - - plugins : [ - 'karma-chrome-launcher', - 'karma-firefox-launcher', - 'karma-mocha', - // 'karma-phantomjs-launcher' - 'karma-spec-reporter' - ] - }); -}; diff --git a/tutorial-1/pixi.js-master/test/lib/pixi/core/Circle.js b/tutorial-1/pixi.js-master/test/lib/pixi/core/Circle.js deleted file mode 100755 index e7cbd4d..0000000 --- a/tutorial-1/pixi.js-master/test/lib/pixi/core/Circle.js +++ /dev/null @@ -1,22 +0,0 @@ -function pixi_core_Circle_confirmNewCircle(obj) { - var expect = chai.expect; - - expect(obj).to.be.an.instanceof(PIXI.Circle); - expect(obj).to.respondTo('clone'); - expect(obj).to.respondTo('contains'); - expect(obj).to.respondTo('getBounds'); - - expect(obj).to.have.property('x', 0); - expect(obj).to.have.property('y', 0); - expect(obj).to.have.property('radius', 0); -} - -function pixi_core_Circle_isBoundedByRectangle(obj, rect) { - var expect = chai.expect; - - expect(rect).to.have.property('x', obj.x - obj.radius); - expect(rect).to.have.property('y', obj.y - obj.radius); - - expect(rect).to.have.property('width', obj.radius * 2); - expect(rect).to.have.property('height', obj.radius * 2); -} diff --git a/tutorial-1/pixi.js-master/test/lib/pixi/core/Matrix.js b/tutorial-1/pixi.js-master/test/lib/pixi/core/Matrix.js deleted file mode 100755 index 77492c2..0000000 --- a/tutorial-1/pixi.js-master/test/lib/pixi/core/Matrix.js +++ /dev/null @@ -1,13 +0,0 @@ -function pixi_core_Matrix_confirmNewMatrix(matrix) { - var expect = chai.expect; - - expect(matrix).to.be.an.instanceof(PIXI.Matrix); - expect(matrix).to.not.be.empty; - - expect(matrix.a).to.equal(1); - expect(matrix.b).to.equal(0); - expect(matrix.c).to.equal(0); - expect(matrix.d).to.equal(1); - expect(matrix.tx).to.equal(0); - expect(matrix.ty).to.equal(0); -} \ No newline at end of file diff --git a/tutorial-1/pixi.js-master/test/lib/pixi/core/Point.js b/tutorial-1/pixi.js-master/test/lib/pixi/core/Point.js deleted file mode 100755 index e5df07b..0000000 --- a/tutorial-1/pixi.js-master/test/lib/pixi/core/Point.js +++ /dev/null @@ -1,10 +0,0 @@ - -function pixi_core_Point_confirm(obj, x, y) { - var expect = chai.expect; - - expect(obj).to.be.an.instanceof(PIXI.Point); - expect(obj).to.respondTo('clone'); - - expect(obj).to.have.property('x', x); - expect(obj).to.have.property('y', y); -} diff --git a/tutorial-1/pixi.js-master/test/lib/pixi/core/Rectangle.js b/tutorial-1/pixi.js-master/test/lib/pixi/core/Rectangle.js deleted file mode 100755 index 23f0d12..0000000 --- a/tutorial-1/pixi.js-master/test/lib/pixi/core/Rectangle.js +++ /dev/null @@ -1,13 +0,0 @@ - -function pixi_core_Rectangle_confirm(obj, x, y, width, height) { - var expect = chai.expect; - - expect(obj).to.be.an.instanceof(PIXI.Rectangle); - expect(obj).to.respondTo('clone'); - expect(obj).to.respondTo('contains'); - - expect(obj).to.have.property('x', x); - expect(obj).to.have.property('y', y); - expect(obj).to.have.property('width', width); - expect(obj).to.have.property('height', height); -} diff --git a/tutorial-1/pixi.js-master/test/lib/pixi/display/DisplayObject.js b/tutorial-1/pixi.js-master/test/lib/pixi/display/DisplayObject.js deleted file mode 100755 index 9ca495e..0000000 --- a/tutorial-1/pixi.js-master/test/lib/pixi/display/DisplayObject.js +++ /dev/null @@ -1,38 +0,0 @@ - -function pixi_display_DisplayObject_confirmNew(obj) { - var expect = chai.expect; - - expect(obj).to.be.an.instanceof(PIXI.DisplayObject); - //expect(obj).to.respondTo('setInteractive'); - //expect(obj).to.respondTo('addFilter'); - //expect(obj).to.respondTo('removeFilter'); - expect(obj).to.respondTo('updateTransform'); - - expect(obj).to.contain.property('position'); - pixi_core_Point_confirm(obj.position, 0, 0); - expect(obj).to.contain.property('scale'); - pixi_core_Point_confirm(obj.scale, 1, 1); - expect(obj).to.contain.property('pivot'); - pixi_core_Point_confirm(obj.pivot, 0, 0); - - expect(obj).to.have.property('rotation', 0); - expect(obj).to.have.property('alpha', 1); - expect(obj).to.have.property('visible', true); - expect(obj).to.have.property('buttonMode', false); - expect(obj).to.have.property('parent', null); - expect(obj).to.have.property('worldAlpha', 1); - - expect(obj).to.have.property('hitArea'); - expect(obj).to.have.property('interactive'); // TODO: Have a better default value - expect('mask' in obj).to.be.true; // TODO: Have a better default value - expect(obj.mask).to.be.null; - - expect(obj).to.have.property('renderable'); - expect(obj).to.have.property('stage'); - - expect(obj).to.have.deep.property('worldTransform'); - pixi_core_Matrix_confirmNewMatrix(obj.worldTransform); - - //expect(obj).to.have.deep.property('color.length', 0); - //expect(obj).to.have.property('dynamic', true); -} diff --git a/tutorial-1/pixi.js-master/test/lib/pixi/display/DisplayObjectContainer.js b/tutorial-1/pixi.js-master/test/lib/pixi/display/DisplayObjectContainer.js deleted file mode 100755 index 58160a9..0000000 --- a/tutorial-1/pixi.js-master/test/lib/pixi/display/DisplayObjectContainer.js +++ /dev/null @@ -1,18 +0,0 @@ - -function pixi_display_DisplayObjectContainer_confirmNew(obj) { - var expect = chai.expect; - - pixi_display_DisplayObject_confirmNew(obj); - - expect(obj).to.be.an.instanceof(PIXI.DisplayObjectContainer); - expect(obj).to.respondTo('addChild'); - expect(obj).to.respondTo('addChildAt'); - expect(obj).to.respondTo('swapChildren'); - expect(obj).to.respondTo('getChildAt'); - expect(obj).to.respondTo('getChildIndex'); - expect(obj).to.respondTo('setChildIndex'); - expect(obj).to.respondTo('removeChild'); - expect(obj).to.respondTo('updateTransform'); - - expect(obj).to.have.deep.property('children.length', 0); -} diff --git a/tutorial-1/pixi.js-master/test/lib/pixi/display/Sprite.js b/tutorial-1/pixi.js-master/test/lib/pixi/display/Sprite.js deleted file mode 100755 index 2288c16..0000000 --- a/tutorial-1/pixi.js-master/test/lib/pixi/display/Sprite.js +++ /dev/null @@ -1,30 +0,0 @@ - -function pixi_display_Sprite_confirmNew(obj, done) { - var expect = chai.expect; - - pixi_display_DisplayObjectContainer_confirmNew(obj); - - expect(obj).to.be.an.instanceof(PIXI.Sprite); - expect(obj).to.respondTo('setTexture'); - expect(obj).to.respondTo('onTextureUpdate'); - - expect(obj).to.have.property('hitArea', null); - expect(obj).to.have.property('interactive', false); - expect(obj).to.have.property('renderable', true); - expect(obj).to.have.property('stage', null); - - expect(obj).to.have.property('anchor'); - pixi_core_Point_confirm(obj.anchor, 0, 0); - - expect(obj).to.have.property('blendMode', PIXI.blendModes.NORMAL); - expect(obj).to.have.property('width', 1); // TODO: is 1 expected - expect(obj).to.have.property('height', 1); // TODO: is 1 expected - - expect(obj).to.have.property('tint', 0xFFFFFF); - - // FIXME: Just make this a boolean that is always there - expect(!!obj.updateFrame).to.equal(obj.texture.baseTexture.hasLoaded); - - expect(obj).to.have.property('texture'); - pixi_textures_Texture_confirmNew(obj.texture, done); -} diff --git a/tutorial-1/pixi.js-master/test/lib/pixi/extras/Strip.js b/tutorial-1/pixi.js-master/test/lib/pixi/extras/Strip.js deleted file mode 100755 index 8927a8a..0000000 --- a/tutorial-1/pixi.js-master/test/lib/pixi/extras/Strip.js +++ /dev/null @@ -1,12 +0,0 @@ - -function pixi_extras_Strip_confirmNew(obj) { - var expect = chai.expect; - - pixi_display_DisplayObjectContainer_confirmNew(obj); - - expect(obj).to.be.an.instanceof(PIXI.Strip); - expect(obj).to.respondTo('setTexture'); - expect(obj).to.respondTo('onTextureUpdate'); - - // TODO: Test properties -} diff --git a/tutorial-1/pixi.js-master/test/lib/pixi/textures/RenderTexture.js b/tutorial-1/pixi.js-master/test/lib/pixi/textures/RenderTexture.js deleted file mode 100755 index 8556501..0000000 --- a/tutorial-1/pixi.js-master/test/lib/pixi/textures/RenderTexture.js +++ /dev/null @@ -1,14 +0,0 @@ - -function pixi_textures_RenderTexture_confirmNew(obj, done) { - var expect = chai.expect; - - expect(obj).to.have.property('width'); - expect(obj).to.have.property('height'); - - expect(obj).to.have.property('render'); - expect(obj).to.have.property('renderer'); - // expect(obj).to.have.property('projection'); - expect(obj).to.have.property('textureBuffer'); - - pixi_textures_Texture_confirmNew(obj, done); -} diff --git a/tutorial-1/pixi.js-master/test/lib/pixi/textures/Texture.js b/tutorial-1/pixi.js-master/test/lib/pixi/textures/Texture.js deleted file mode 100755 index 2493385..0000000 --- a/tutorial-1/pixi.js-master/test/lib/pixi/textures/Texture.js +++ /dev/null @@ -1,26 +0,0 @@ - -function pixi_textures_Texture_confirmNew(obj, done) { - var expect = chai.expect; - - function confirmFrameDone() { - pixi_core_Rectangle_confirm(obj.frame, 0, 0, obj.baseTexture.width, obj.baseTexture.height); - - expect(obj).to.have.property('width', obj.baseTexture.width); - expect(obj).to.have.property('height', obj.baseTexture.height); - done(); - } - - expect(obj).to.be.an.instanceof(PIXI.Texture); - pixi_utils_EventTarget_confirm(obj); - - expect(obj).to.have.property('baseTexture') - .and.to.be.an.instanceof(PIXI.BaseTexture); - - expect(obj).to.have.property('frame'); - if (obj.baseTexture.hasLoaded) { - confirmFrameDone(); - } else { - obj.on('update', confirmFrameDone); - pixi_core_Rectangle_confirm(obj.frame, 0, 0, 1, 1); - } -} diff --git a/tutorial-1/pixi.js-master/test/lib/pixi/utils/EventTarget.js b/tutorial-1/pixi.js-master/test/lib/pixi/utils/EventTarget.js deleted file mode 100755 index a0c3924..0000000 --- a/tutorial-1/pixi.js-master/test/lib/pixi/utils/EventTarget.js +++ /dev/null @@ -1,34 +0,0 @@ - -function pixi_utils_EventTarget_confirm(obj) { - var expect = chai.expect; - - //public API - expect(obj).to.respondTo('listeners'); - expect(obj).to.respondTo('emit'); - expect(obj).to.respondTo('on'); - expect(obj).to.respondTo('once'); - expect(obj).to.respondTo('off'); - expect(obj).to.respondTo('removeAllListeners'); - - //Aliased names - expect(obj).to.respondTo('removeEventListener'); - expect(obj).to.respondTo('addEventListener'); - expect(obj).to.respondTo('dispatchEvent'); -} - -function pixi_utils_EventTarget_Event_confirm(event, obj, data) { - var expect = chai.expect; - - expect(event).to.be.an.instanceOf(PIXI.Event); - - expect(event).to.have.property('stopped', false); - expect(event).to.have.property('stoppedImmediate', false); - - expect(event).to.have.property('target', obj); - expect(event).to.have.property('type', data.type || 'myevent'); - expect(event).to.have.property('data', data); - expect(event).to.have.property('content', data); - - expect(event).to.respondTo('stopPropagation'); - expect(event).to.respondTo('stopImmediatePropagation'); -} \ No newline at end of file diff --git a/tutorial-1/pixi.js-master/test/lib/resemble.js b/tutorial-1/pixi.js-master/test/lib/resemble.js deleted file mode 100755 index 1cb8c29..0000000 --- a/tutorial-1/pixi.js-master/test/lib/resemble.js +++ /dev/null @@ -1,535 +0,0 @@ -/* -Author: James Cryer -Company: Huddle -Last updated date: 21 Feb 2013 -URL: https://github.com/Huddle/Resemble.js -*/ - -(function(_this){ - 'use strict'; - - _this['resemble'] = function( fileData ){ - - var data = {}; - var images = []; - var updateCallbackArray = []; - - var tolerance = { // between 0 and 255 - red: 16, - green: 16, - blue: 16, - minBrightness: 16, - maxBrightness: 240 - }; - - var ignoreAntialiasing = false; - var ignoreColors = false; - - function triggerDataUpdate(){ - var len = updateCallbackArray.length; - var i; - for(i=0;i tolerance.maxBrightness; - } - - function getHue(r,g,b){ - - r = r / 255; - g = g / 255; - b = b / 255; - var max = Math.max(r, g, b), min = Math.min(r, g, b); - var h; - var d; - - if (max == min){ - h = 0; // achromatic - } else{ - d = max - min; - switch(max){ - case r: h = (g - b) / d + (g < b ? 6 : 0); break; - case g: h = (b - r) / d + 2; break; - case b: h = (r - g) / d + 4; break; - } - h /= 6; - } - - return h; - } - - function isAntialiased(sourcePix, data, cacheSet, verticalPos, horizontalPos, width){ - var offset; - var targetPix; - var distance = 1; - var i; - var j; - var hasHighContrastSibling = 0; - var hasSiblingWithDifferentHue = 0; - var hasEquivilantSibling = 0; - - addHueInfo(sourcePix); - - for (i = distance*-1; i <= distance; i++){ - for (j = distance*-1; j <= distance; j++){ - - if(i===0 && j===0){ - // ignore source pixel - } else { - - offset = ((verticalPos+j)*width + (horizontalPos+i)) * 4; - targetPix = getPixelInfo(data, offset, cacheSet); - - if(targetPix === null){ - continue; - } - - addBrightnessInfo(targetPix); - addHueInfo(targetPix); - - if( isContrasting(sourcePix, targetPix) ){ - hasHighContrastSibling++; - } - - if( isRGBSame(sourcePix,targetPix) ){ - hasEquivilantSibling++; - } - - if( Math.abs(targetPix.h - sourcePix.h) > 0.3 ){ - hasSiblingWithDifferentHue++; - } - - if( hasSiblingWithDifferentHue > 1 || hasHighContrastSibling > 1){ - return true; - } - } - } - } - - if(hasEquivilantSibling < 2){ - return true; - } - - return false; - } - - function errorPixel(px, offset){ - px[offset] = 255; //r - px[offset + 1] = 0; //g - px[offset + 2] = 255; //b - px[offset + 3] = 255; //a - } - - function copyPixel(px, offset, data){ - px[offset] = data.r; //r - px[offset + 1] = data.g; //g - px[offset + 2] = data.b; //b - px[offset + 3] = 255; //a - } - - function copyGrayScalePixel(px, offset, data){ - px[offset] = data.brightness; //r - px[offset + 1] = data.brightness; //g - px[offset + 2] = data.brightness; //b - px[offset + 3] = 255; //a - } - - - function getPixelInfo(data, offset, cacheSet){ - var r; - var g; - var b; - var d; - - if(typeof data[offset] !== 'undefined'){ - r = data[offset]; - g = data[offset+1]; - b = data[offset+2]; - d = { - r: r, - g: g, - b: b - }; - - return d; - } else { - return null; - } - } - - function addBrightnessInfo(data){ - data.brightness = getBrightness(data.r,data.g,data.b); // 'corrected' lightness - } - - function addHueInfo(data){ - data.h = getHue(data.r,data.g,data.b); - } - - function analyseImages(img1, img2, width, height){ - - var hiddenCanvas = document.createElement('canvas'); - - var data1 = img1.data; - var data2 = img2.data; - - hiddenCanvas.width = width; - hiddenCanvas.height = height; - - var context = hiddenCanvas.getContext('2d'); - var imgd = context.createImageData(width,height); - var targetPix = imgd.data; - - var mismatchCount = 0; - - var time = Date.now(); - - var skip; - - if( (width > 1200 || height > 1200) && ignoreAntialiasing){ - skip = 6; - } - - loop(height, width, function(verticalPos, horizontalPos){ - - if(skip){ // only skip if the image isn't small - if(verticalPos % skip === 0 || horizontalPos % skip === 0){ - return; - } - } - - var offset = (verticalPos*width + horizontalPos) * 4; - var pixel1 = getPixelInfo(data1, offset, 1); - var pixel2 = getPixelInfo(data2, offset, 2); - - if(pixel1 === null || pixel2 === null){ - return; - } - - if (ignoreColors){ - - addBrightnessInfo(pixel1); - addBrightnessInfo(pixel2); - - if( isPixelBrightnessSimilar(pixel1, pixel2) ){ - copyGrayScalePixel(targetPix, offset, pixel2); - } else { - errorPixel(targetPix, offset); - mismatchCount++; - } - return; - } - - if( isRGBSimilar(pixel1, pixel2) ){ - copyPixel(targetPix, offset, pixel2); - - } else if( ignoreAntialiasing && ( - addBrightnessInfo(pixel1), // jit pixel info augmentation looks a little weird, sorry. - addBrightnessInfo(pixel2), - isAntialiased(pixel1, data1, 1, verticalPos, horizontalPos, width) || - isAntialiased(pixel2, data2, 2, verticalPos, horizontalPos, width) - )){ - - if( isPixelBrightnessSimilar(pixel1, pixel2) ){ - copyGrayScalePixel(targetPix, offset, pixel2); - } else { - errorPixel(targetPix, offset); - mismatchCount++; - } - } else { - errorPixel(targetPix, offset); - mismatchCount++; - } - - }); - - data.misMatchPercentage = (mismatchCount / (height*width) * 100).toFixed(2); - data.analysisTime = Date.now() - time; - - data.getImageDataUrl = function(text){ - var barHeight = 0; - - if(text){ - barHeight = addLabel(text,context,hiddenCanvas); - } - - context.putImageData(imgd, 0, barHeight); - - return hiddenCanvas.toDataURL("image/png"); - }; - } - - function addLabel(text, context, hiddenCanvas){ - var textPadding = 2; - - context.font = '12px sans-serif'; - - var textWidth = context.measureText(text).width + textPadding*2; - var barHeight = 22; - - if(textWidth > hiddenCanvas.width){ - hiddenCanvas.width = textWidth; - } - - hiddenCanvas.height += barHeight; - - context.fillStyle = "#666"; - context.fillRect(0,0,hiddenCanvas.width,barHeight -4); - context.fillStyle = "#fff"; - context.fillRect(0,barHeight -4,hiddenCanvas.width, 4); - - context.fillStyle = "#fff"; - context.textBaseline = "top"; - context.font = '12px sans-serif'; - context.fillText(text, textPadding, 1); - - return barHeight; - } - - function normalise(img, w, h){ - var c; - var context; - - if(img.height < h || img.width < w){ - c = document.createElement('canvas'); - c.width = w; - c.height = h; - context = c.getContext('2d'); - context.putImageData(img, 0, 0); - return context.getImageData(0, 0, w, h); - } - - return img; - } - - function compare(one, two){ - - function onceWeHaveBoth(){ - var width; - var height; - if(images.length === 2){ - width = images[0].width > images[1].width ? images[0].width : images[1].width; - height = images[0].height > images[1].height ? images[0].height : images[1].height; - - if( (images[0].width === images[1].width) && (images[0].height === images[1].height) ){ - data.isSameDimensions = true; - } else { - data.isSameDimensions = false; - } - - analyseImages( normalise(images[0],width, height), normalise(images[1],width, height), width, height); - - triggerDataUpdate(); - } - } - - images = []; - loadImageData(one, onceWeHaveBoth); - loadImageData(two, onceWeHaveBoth); - } - - function getCompareApi(param){ - - var secondFileData, - hasMethod = typeof param === 'function'; - - if( !hasMethod ){ - // assume it's file data - secondFileData = param; - } - - var self = { - ignoreNothing: function(){ - - tolerance.red = 16; - tolerance.green = 16; - tolerance.blue = 16; - tolerance.minBrightness = 16; - tolerance.maxBrightness = 240; - - ignoreAntialiasing = false; - ignoreColors = false; - - if(hasMethod) { param(); } - return self; - }, - ignoreAntialiasing: function(){ - - tolerance.red = 32; - tolerance.green = 32; - tolerance.blue = 32; - tolerance.minBrightness = 64; - tolerance.maxBrightness = 96; - - ignoreAntialiasing = true; - ignoreColors = false; - - if(hasMethod) { param(); } - return self; - }, - ignoreColors: function(){ - - tolerance.minBrightness = 16; - tolerance.maxBrightness = 240; - - ignoreAntialiasing = false; - ignoreColors = true; - - if(hasMethod) { param(); } - return self; - }, - onComplete: function( callback ){ - - updateCallbackArray.push(callback); - - var wrapper = function(){ - compare(fileData, secondFileData); - }; - - wrapper(); - - return getCompareApi(wrapper); - } - }; - - return self; - } - - return { - onComplete: function( callback ){ - updateCallbackArray.push(callback); - loadImageData(fileData, function(imageData, width, height){ - parseImage(imageData.data, width, height); - }); - }, - compareTo: function(secondFileData){ - return getCompareApi(secondFileData); - } - }; - - }; -}(this)); \ No newline at end of file diff --git a/tutorial-1/pixi.js-master/test/textures/SpriteSheet-Aliens.png b/tutorial-1/pixi.js-master/test/textures/SpriteSheet-Aliens.png deleted file mode 100755 index 210acb1..0000000 Binary files a/tutorial-1/pixi.js-master/test/textures/SpriteSheet-Aliens.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/test/textures/SpriteSheet-Explosion.png b/tutorial-1/pixi.js-master/test/textures/SpriteSheet-Explosion.png deleted file mode 100755 index 79e1a69..0000000 Binary files a/tutorial-1/pixi.js-master/test/textures/SpriteSheet-Explosion.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/test/textures/bunny.png b/tutorial-1/pixi.js-master/test/textures/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-1/pixi.js-master/test/textures/bunny.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/InteractionManager.js b/tutorial-1/pixi.js-master/test/unit/pixi/InteractionManager.js deleted file mode 100755 index ed3001f..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/InteractionManager.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/InteractionManager', function () { - 'use strict'; - - var expect = chai.expect; - var InteractionManager = PIXI.InteractionManager; - - it('Module exists', function () { - expect(InteractionManager).to.be.a('function'); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/Pixi.js b/tutorial-1/pixi.js-master/test/unit/pixi/Pixi.js deleted file mode 100755 index 27debc1..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/Pixi.js +++ /dev/null @@ -1,9 +0,0 @@ -describe('pixi/Pixi', function () { - 'use strict'; - - var expect = chai.expect; - - it('Module exists', function () { - expect(global).to.have.property('PIXI').and.to.be.an('object'); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/core/Circle.js b/tutorial-1/pixi.js-master/test/unit/pixi/core/Circle.js deleted file mode 100755 index fbcfa17..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/core/Circle.js +++ /dev/null @@ -1,21 +0,0 @@ -describe('pixi/core/Circle', function () { - 'use strict'; - - var expect = chai.expect; - var Circle = PIXI.Circle; - - it('Module exists', function () { - expect(Circle).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new Circle(); - pixi_core_Circle_confirmNewCircle(obj); - }); - - it("getBounds should return Rectangle that bounds the circle", function() { - var obj = new Circle(100, 250, 50); - var bounds = obj.getBounds(); - pixi_core_Circle_isBoundedByRectangle(obj, bounds); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/core/Ellipse.js b/tutorial-1/pixi.js-master/test/unit/pixi/core/Ellipse.js deleted file mode 100755 index 026b56f..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/core/Ellipse.js +++ /dev/null @@ -1,24 +0,0 @@ -describe('pixi/core/Ellipse', function () { - 'use strict'; - - var expect = chai.expect; - var Ellipse = PIXI.Ellipse; - - it('Module exists', function () { - expect(Ellipse).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new Ellipse(); - - expect(obj).to.be.an.instanceof(Ellipse); - expect(obj).to.respondTo('clone'); - expect(obj).to.respondTo('contains'); - expect(obj).to.respondTo('getBounds'); - - expect(obj).to.have.property('x', 0); - expect(obj).to.have.property('y', 0); - expect(obj).to.have.property('width', 0); - expect(obj).to.have.property('height', 0); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/core/Matrix.js b/tutorial-1/pixi.js-master/test/unit/pixi/core/Matrix.js deleted file mode 100755 index da75e2e..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/core/Matrix.js +++ /dev/null @@ -1,14 +0,0 @@ -describe('pixi/core/Matrix', function () { - 'use strict'; - - var expect = chai.expect; - - it('Matrix exists', function () { - expect(PIXI.Matrix).to.be.an('function'); - }); - - it('Confirm new Matrix', function () { - var matrix = new PIXI.Matrix(); - pixi_core_Matrix_confirmNewMatrix(matrix); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/core/Point.js b/tutorial-1/pixi.js-master/test/unit/pixi/core/Point.js deleted file mode 100755 index c4d5163..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/core/Point.js +++ /dev/null @@ -1,15 +0,0 @@ -describe('pixi/core/Point', function () { - 'use strict'; - - var expect = chai.expect; - var Point = PIXI.Point; - - it('Module exists', function () { - expect(Point).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new Point(); - pixi_core_Point_confirm(obj, 0, 0); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/core/Polygon.js b/tutorial-1/pixi.js-master/test/unit/pixi/core/Polygon.js deleted file mode 100755 index dc8c918..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/core/Polygon.js +++ /dev/null @@ -1,20 +0,0 @@ -describe('pixi/core/Polygon', function () { - 'use strict'; - - var expect = chai.expect; - var Polygon = PIXI.Polygon; - - it('Module exists', function () { - expect(Polygon).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new Polygon(); - - expect(obj).to.be.an.instanceof(Polygon); - expect(obj).to.respondTo('clone'); - expect(obj).to.respondTo('contains'); - - expect(obj).to.have.deep.property('points.length', 0); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/core/Rectangle.js b/tutorial-1/pixi.js-master/test/unit/pixi/core/Rectangle.js deleted file mode 100755 index d43316e..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/core/Rectangle.js +++ /dev/null @@ -1,15 +0,0 @@ -describe('pixi/core/Rectangle', function () { - 'use strict'; - - var expect = chai.expect; - var Rectangle = PIXI.Rectangle; - - it('Module exists', function () { - expect(Rectangle).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var rect = new Rectangle(); - pixi_core_Rectangle_confirm(rect, 0, 0, 0, 0); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/display/DisplayObject.js b/tutorial-1/pixi.js-master/test/unit/pixi/display/DisplayObject.js deleted file mode 100755 index 044acf8..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/display/DisplayObject.js +++ /dev/null @@ -1,21 +0,0 @@ -describe('pixi/display/DisplayObject', function () { - 'use strict'; - - var expect = chai.expect; - var DisplayObject = PIXI.DisplayObject; - - it('Module exists', function () { - expect(DisplayObject).to.be.a('function'); - // expect(PIXI).to.have.property('visibleCount', 0); - }); - - it('Confirm new instance', function () { - var obj = new DisplayObject(); - - pixi_display_DisplayObject_confirmNew(obj); - expect(obj).to.have.property('hitArea', null); - expect(obj).to.have.property('interactive', false); - expect(obj).to.have.property('renderable', false); - expect(obj).to.have.property('stage', null); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/display/DisplayObjectContainer.js b/tutorial-1/pixi.js-master/test/unit/pixi/display/DisplayObjectContainer.js deleted file mode 100755 index 15a3376..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/display/DisplayObjectContainer.js +++ /dev/null @@ -1,67 +0,0 @@ -describe('pixi/display/DisplayObjectContainer', function () { - 'use strict'; - - var expect = chai.expect; - var DisplayObjectContainer = PIXI.DisplayObjectContainer; - - it('Module exists', function () { - expect(DisplayObjectContainer).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new DisplayObjectContainer(); - - pixi_display_DisplayObjectContainer_confirmNew(obj); - expect(obj).to.have.property('hitArea', null); - expect(obj).to.have.property('interactive', false); - expect(obj).to.have.property('renderable', false); - expect(obj).to.have.property('stage', null); - }); - - it('Gets child index', function() { - var container = new PIXI.DisplayObjectContainer(); - var children = []; - for (var i = 0; i < 10; i++) { - var child = new PIXI.DisplayObject(); - children.push(child); - container.addChild(child); - } - - for (i = 0; i < children.length; i++) { - expect(i).to.eql(container.getChildIndex(children[i])); - } - }); - - it('throws error when trying to get index of not a child', function() { - var container = new PIXI.DisplayObjectContainer(); - var child = new PIXI.DisplayObject(); - - expect(function() { container.getChildIndex(child); }).to.throw(); - }); - - it('Sets child index', function() { - var container = new PIXI.DisplayObjectContainer(); - var children = []; - - for (var i = 0; i < 10; i++) { - var child = new PIXI.DisplayObject(); - children.push(child); - container.addChild(child); - } - children.reverse(); - - for (i = 0; i < children.length; i++) { - container.setChildIndex(children[i], i); - expect(i).to.eql(container.getChildIndex(children[i])); - } - }); - - it('throws error when trying to set incorect index', function() { - var container = new PIXI.DisplayObjectContainer(); - var child = new PIXI.DisplayObject(); - container.addChild(child); - - expect(function() { container.setChildIndex(child, -1); }).to.throw(); - expect(function() { container.setChildIndex(child, 1); }).to.throw(); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/display/MovieClip.js b/tutorial-1/pixi.js-master/test/unit/pixi/display/MovieClip.js deleted file mode 100755 index f3c6c6a..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/display/MovieClip.js +++ /dev/null @@ -1,33 +0,0 @@ -describe('pixi/display/MovieClip', function () { - 'use strict'; - - var expect = chai.expect; - var MovieClip = PIXI.MovieClip; - var Texture = PIXI.Texture; - - it('Module exists', function () { - expect(MovieClip).to.be.a('function'); - }); - - it('Confirm new instance', function (done) { - var texture = Texture.fromImage('/base/test/textures/SpriteSheet-Explosion.png'); - var obj = new MovieClip([texture]); - - pixi_display_Sprite_confirmNew(obj, done); - - expect(obj).to.be.an.instanceof(MovieClip); - expect(obj).to.respondTo('stop'); - expect(obj).to.respondTo('play'); - expect(obj).to.respondTo('gotoAndStop'); - expect(obj).to.respondTo('gotoAndPlay'); - expect(obj).to.respondTo('updateTransform'); - - expect(obj).to.have.deep.property('textures.length', 1); - expect(obj).to.have.deep.property('textures[0]', texture); - expect(obj).to.have.property('animationSpeed', 1); - expect(obj).to.have.property('loop', true); - expect(obj).to.have.property('onComplete', null); - expect(obj).to.have.property('currentFrame', 0); - expect(obj).to.have.property('playing', false); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/display/Sprite.js b/tutorial-1/pixi.js-master/test/unit/pixi/display/Sprite.js deleted file mode 100755 index 30c8076..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/display/Sprite.js +++ /dev/null @@ -1,28 +0,0 @@ -describe('pixi/display/Sprite', function () { - 'use strict'; - - var expect = chai.expect; - var Sprite = PIXI.Sprite; - var Texture = PIXI.Texture; - - it('Module exists', function () { - expect(Sprite).to.be.a('function'); - expect(PIXI).to.have.deep.property('blendModes.NORMAL', 0); - expect(PIXI).to.have.deep.property('blendModes.ADD', 1); - expect(PIXI).to.have.deep.property('blendModes.MULTIPLY', 2); - expect(PIXI).to.have.deep.property('blendModes.SCREEN', 3); - }); - - - it('Members exist', function () { - expect(Sprite).itself.to.respondTo('fromImage'); - expect(Sprite).itself.to.respondTo('fromFrame'); - }); - - it('Confirm new instance', function (done) { - var texture = Texture.fromImage('/base/test/textures/SpriteSheet-Aliens.png'); - var obj = new Sprite(texture); - - pixi_display_Sprite_confirmNew(obj, done); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/display/Stage.js b/tutorial-1/pixi.js-master/test/unit/pixi/display/Stage.js deleted file mode 100755 index 6974c2e..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/display/Stage.js +++ /dev/null @@ -1,49 +0,0 @@ -describe('pixi/display/Stage', function () { - 'use strict'; - - var expect = chai.expect; - var Stage = PIXI.Stage; - var InteractionManager = PIXI.InteractionManager; - var Rectangle = PIXI.Rectangle; - - it('Module exists', function () { - expect(Stage).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new Stage(null, true); - - pixi_display_DisplayObjectContainer_confirmNew(obj); - - expect(obj).to.be.an.instanceof(Stage); - expect(obj).to.respondTo('updateTransform'); - expect(obj).to.respondTo('setBackgroundColor'); - expect(obj).to.respondTo('getMousePosition'); - // FIXME: duplicate member in DisplayObject - pixi_core_Matrix_confirmNewMatrix(obj.worldTransform); - // FIXME: convert arg to bool in constructor - expect(obj).to.have.property('interactive', true); - - expect(obj).to.have.property('interactionManager') - .and.to.be.an.instanceof(InteractionManager) - .and.to.have.property('stage', obj); - - expect(obj).to.have.property('dirty', true); - - expect(obj).to.have.property('stage', obj); - - expect(obj).to.have.property('hitArea') - .and.to.be.an.instanceof(Rectangle); - pixi_core_Rectangle_confirm(obj.hitArea, 0, 0, 100000, 100000); - - expect(obj).to.have.property('backgroundColor', 0x000000); - expect(obj).to.have.deep.property('backgroundColorSplit.length', 3); - expect(obj).to.have.deep.property('backgroundColorSplit[0]', 0); - expect(obj).to.have.deep.property('backgroundColorSplit[1]', 0); - expect(obj).to.have.deep.property('backgroundColorSplit[2]', 0); - expect(obj).to.have.property('backgroundColorString', '#000000'); - - - expect(obj).to.have.property('worldVisible', true); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/extras/Rope.js b/tutorial-1/pixi.js-master/test/unit/pixi/extras/Rope.js deleted file mode 100755 index 05885ac..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/extras/Rope.js +++ /dev/null @@ -1,31 +0,0 @@ -describe('pixi/extras/Rope', function () { - 'use strict'; - - var expect = chai.expect; - var Rope = PIXI.Rope; - var Texture = PIXI.Texture; - var Point = PIXI.Point; - - it('Module exists', function () { - expect(Rope).to.be.a('function'); - }); - - it('Confirm new instance', function () { - - var texture = Texture.fromImage('/base/test/textures/bunny.png'); - - // TODO-Alvin - // Same as Strip - - // var obj = new Rope(texture, [new Point(), new Point(5, 10), new Point(10, 20)]); - - // pixi_extras_Strip_confirmNew(obj); - - // expect(obj).to.be.an.instanceof(Rope); - // expect(obj).to.respondTo('refresh'); - // expect(obj).to.respondTo('updateTransform'); - // expect(obj).to.respondTo('setTexture'); - - // TODO: Test properties - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/extras/Spine.js b/tutorial-1/pixi.js-master/test/unit/pixi/extras/Spine.js deleted file mode 100755 index 0708bc0..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/extras/Spine.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/extras/Spine', function () { - 'use strict'; - - var expect = chai.expect; - var Spine = PIXI.Spine; - - it('Module exists', function () { - expect(Spine).to.be.a('function'); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/extras/Strip.js b/tutorial-1/pixi.js-master/test/unit/pixi/extras/Strip.js deleted file mode 100755 index 230af90..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/extras/Strip.js +++ /dev/null @@ -1,26 +0,0 @@ -describe('pixi/extras/Strip', function () { - 'use strict'; - - var expect = chai.expect; - var Strip = PIXI.Strip; - var Texture = PIXI.Texture; - - it('Module exists', function () { - expect(Strip).to.be.a('function'); - }); - - it('Confirm new instance', function () { - - - // TODO-Alvin - // We tweaked it to make it pass the tests, but the whole strip class needs - // to be re-coded - - var texture = Texture.fromImage('/base/test/textures/bunny.png'); - - // var obj = new Strip(texture, 20, 10000); - - - // pixi_extras_Strip_confirmNew(obj); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/extras/TilingSprite.js b/tutorial-1/pixi.js-master/test/unit/pixi/extras/TilingSprite.js deleted file mode 100755 index 56aea14..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/extras/TilingSprite.js +++ /dev/null @@ -1,24 +0,0 @@ -describe('pixi/extras/TilingSprite', function () { - 'use strict'; - - var expect = chai.expect; - var TilingSprite = PIXI.TilingSprite; - var Texture = PIXI.Texture; - - it('Module exists', function () { - expect(TilingSprite).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var texture = Texture.fromImage('/base/test/textures/bunny.png'); - var obj = new TilingSprite(texture, 6000, 12000); - - pixi_display_DisplayObjectContainer_confirmNew(obj); - - expect(obj).to.be.an.instanceof(TilingSprite); - expect(obj).to.respondTo('setTexture'); - expect(obj).to.respondTo('onTextureUpdate'); - - // TODO: Test properties - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/filters/FilterBlock.js b/tutorial-1/pixi.js-master/test/unit/pixi/filters/FilterBlock.js deleted file mode 100755 index 870cec0..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/filters/FilterBlock.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/filters/FilterBlock', function () { - 'use strict'; - - var expect = chai.expect; - var FilterBlock = PIXI.FilterBlock; - - it('Module exists', function () { - expect(FilterBlock).to.be.a('function'); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/loaders/AssetLoader.js b/tutorial-1/pixi.js-master/test/unit/pixi/loaders/AssetLoader.js deleted file mode 100755 index a0aa0b5..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/loaders/AssetLoader.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/loaders/AssetLoader', function () { - 'use strict'; - - var expect = chai.expect; - var AssetLoader = PIXI.AssetLoader; - - it('Module exists', function () { - expect(AssetLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/loaders/BitmapFontLoader.js b/tutorial-1/pixi.js-master/test/unit/pixi/loaders/BitmapFontLoader.js deleted file mode 100755 index 046f018..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/loaders/BitmapFontLoader.js +++ /dev/null @@ -1,9 +0,0 @@ -describe('pixi/loaders/BitmapFontLoader', function () { - 'use strict'; - - var expect = chai.expect; - - it('Module exists', function () { - expect(PIXI.BitmapFontLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/loaders/ImageLoader.js b/tutorial-1/pixi.js-master/test/unit/pixi/loaders/ImageLoader.js deleted file mode 100755 index 8b1f556..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/loaders/ImageLoader.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/loaders/ImageLoader', function () { - 'use strict'; - - var expect = chai.expect; - var ImageLoader = PIXI.ImageLoader; - - it('Module exists', function () { - expect(ImageLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/loaders/JsonLoader.js b/tutorial-1/pixi.js-master/test/unit/pixi/loaders/JsonLoader.js deleted file mode 100755 index c577e83..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/loaders/JsonLoader.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/loaders/JsonLoader', function () { - 'use strict'; - - var expect = chai.expect; - var JsonLoader = PIXI.JsonLoader; - - it('Module exists', function () { - expect(JsonLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/loaders/SpineLoader.js b/tutorial-1/pixi.js-master/test/unit/pixi/loaders/SpineLoader.js deleted file mode 100755 index fdcc0b8..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/loaders/SpineLoader.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/loaders/SpineLoader', function () { - 'use strict'; - - var expect = chai.expect; - var SpineLoader = PIXI.SpineLoader; - - it('Module exists', function () { - expect(SpineLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/loaders/SpriteSheetLoader.js b/tutorial-1/pixi.js-master/test/unit/pixi/loaders/SpriteSheetLoader.js deleted file mode 100755 index 57beb27..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/loaders/SpriteSheetLoader.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/loaders/SpriteSheetLoader', function () { - 'use strict'; - - var expect = chai.expect; - var SpriteSheetLoader = PIXI.SpriteSheetLoader; - - it('Module exists', function () { - expect(SpriteSheetLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/primitives/Graphics.js b/tutorial-1/pixi.js-master/test/unit/pixi/primitives/Graphics.js deleted file mode 100755 index f3849eb..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/primitives/Graphics.js +++ /dev/null @@ -1,44 +0,0 @@ -describe('pixi/primitives/Graphics', function () { - 'use strict'; - - var expect = chai.expect; - var Graphics = PIXI.Graphics; - - it('Module exists', function () { - expect(Graphics).to.be.a('function'); - - expect(Graphics).itself.to.have.property('POLY', 0); - expect(Graphics).itself.to.have.property('RECT', 1); - expect(Graphics).itself.to.have.property('CIRC', 2); - expect(Graphics).itself.to.have.property('ELIP', 3); - expect(Graphics).itself.to.have.property('RREC', 4); - }); - - it('Confirm new instance', function () { - var obj = new Graphics(); - - pixi_display_DisplayObjectContainer_confirmNew(obj); - - expect(obj).to.be.an.instanceof(Graphics); - expect(obj).to.respondTo('lineStyle'); - expect(obj).to.respondTo('lineStyle'); - expect(obj).to.respondTo('moveTo'); - expect(obj).to.respondTo('lineTo'); - expect(obj).to.respondTo('beginFill'); - expect(obj).to.respondTo('endFill'); - expect(obj).to.respondTo('drawRect'); - // expect(obj).to.respondTo('drawRoundedRect'); - expect(obj).to.respondTo('drawCircle'); - expect(obj).to.respondTo('drawEllipse'); - expect(obj).to.respondTo('clear'); - - expect(obj).to.have.property('renderable', true); - expect(obj).to.have.property('fillAlpha', 1); - expect(obj).to.have.property('lineWidth', 0); - expect(obj).to.have.property('width', 0); - expect(obj).to.have.property('height', 0); - expect(obj).to.have.property('lineColor', 0); - expect(obj).to.have.deep.property('graphicsData.length', 0); - // expect(obj).to.have.deep.property('currentPath.points.length', 0); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasGraphics.js b/tutorial-1/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasGraphics.js deleted file mode 100755 index 8f44472..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasGraphics.js +++ /dev/null @@ -1,15 +0,0 @@ -describe('renders/canvas/CanvasGraphics', function () { - 'use strict'; - - var expect = chai.expect; - var CanvasGraphics = PIXI.CanvasGraphics; - - it('Module exists', function () { - expect(CanvasGraphics).to.be.a('function'); - }); - - it('Members exist', function () { - expect(CanvasGraphics).itself.to.respondTo('renderGraphics'); - expect(CanvasGraphics).itself.to.respondTo('renderGraphicsMask'); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasRenderer.js b/tutorial-1/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasRenderer.js deleted file mode 100755 index 1646444..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasRenderer.js +++ /dev/null @@ -1,36 +0,0 @@ -describe('renderers/canvas/CanvasRenderer', function () { - 'use strict'; - - var expect = chai.expect; - var CanvasRenderer = PIXI.CanvasRenderer; - - it('Module exists', function () { - expect(CanvasRenderer).to.be.a('function'); - }); - - describe('.autoResize', function () { - it('Should automatically resize view if enabled', function () { - var renderer = new CanvasRenderer(200, 200, { - autoResize: true - }); - - expect(renderer.view.style.width).to.equal('200px'); - }); - - it('Should not automatically resize view if disabled', function () { - var renderer = new CanvasRenderer(200, 200, { - autoResize: false - }); - - expect(renderer.view.style.width).to.equal(''); - }); - - it('Should not automatically resize view if not specified', function () { - var renderer = new CanvasRenderer(200, 200, { - resolution: 2 - }); - - expect(renderer.view.style.width).to.equal(''); - }); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLGraphics.js b/tutorial-1/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLGraphics.js deleted file mode 100755 index 5867b28..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLGraphics.js +++ /dev/null @@ -1,20 +0,0 @@ -describe('renderers/wegbl/WebGLGraphics', function () { - 'use strict'; - - var expect = chai.expect; - var WebGLGraphics = PIXI.WebGLGraphics; - - it('Module exists', function () { - expect(WebGLGraphics).to.be.a('function'); - }); - - it('Members exist', function () { - expect(WebGLGraphics).itself.to.respondTo('renderGraphics'); - expect(WebGLGraphics).itself.to.respondTo('updateGraphics'); - expect(WebGLGraphics).itself.to.respondTo('buildRectangle'); - expect(WebGLGraphics).itself.to.respondTo('buildRoundedRectangle'); - expect(WebGLGraphics).itself.to.respondTo('buildCircle'); - expect(WebGLGraphics).itself.to.respondTo('buildLine'); - expect(WebGLGraphics).itself.to.respondTo('buildPoly'); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLRenderer.js b/tutorial-1/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLRenderer.js deleted file mode 100755 index 1680a80..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLRenderer.js +++ /dev/null @@ -1,49 +0,0 @@ -describe('renderers/webgl/WebGLRenderer', function () { - 'use strict'; - - var expect = chai.expect; - var WebGLRenderer = PIXI.WebGLRenderer; - - it('Module exists', function () { - expect(WebGLRenderer).to.be.a('function'); - }); - - // Skip tests if WebGL is not available (WebGL not supported in Travis CI) - try { - var renderer = new WebGLRenderer(400, 300, {}); - renderer.destroy(); - } catch (error) { - return; - } - - it('Destroy renderer', function () { - var renderer = new WebGLRenderer(400, 300, {}); - renderer.destroy(); - }); - - describe('.autoResize', function () { - it('Should automatically resize view if enabled', function () { - var renderer = new WebGLRenderer(200, 200, { - autoResize: true - }); - - expect(renderer.view.style.width).to.equal('200px'); - }); - - it('Should not automatically resize view if disabled', function () { - var renderer = new WebGLRenderer(200, 200, { - autoResize: false - }); - - expect(renderer.view.style.width).to.equal(''); - }); - - it('Should not automatically resize view if not specified', function () { - var renderer = new WebGLRenderer(200, 200, { - resolution: 2 - }); - - expect(renderer.view.style.width).to.equal(''); - }); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLShaders.js b/tutorial-1/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLShaders.js deleted file mode 100755 index 6e33e4f..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLShaders.js +++ /dev/null @@ -1,13 +0,0 @@ -describe('renderers/webgl/WebGLShaders', function () { - 'use strict'; - - var expect = chai.expect; - - it('Module members exist', function () { - - expect(PIXI).to.respondTo('CompileVertexShader'); - expect(PIXI).to.respondTo('CompileFragmentShader'); - expect(PIXI).to.respondTo('_CompileShader'); - expect(PIXI).to.respondTo('compileProgram'); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLSpriteBatch.js b/tutorial-1/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLSpriteBatch.js deleted file mode 100755 index e662b63..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLSpriteBatch.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('renderers/webgl/utils/WebGLSpriteBatch', function () { - 'use strict'; - - var expect = chai.expect; - var WebGLSpriteBatch = PIXI.WebGLSpriteBatch; - - it('Module exists', function () { - expect(WebGLSpriteBatch).to.be.a('function'); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/text/BitmapText.js b/tutorial-1/pixi.js-master/test/unit/pixi/text/BitmapText.js deleted file mode 100755 index 9388e3d..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/text/BitmapText.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/text/BitmapText', function () { - 'use strict'; - - var expect = chai.expect; - var BitmapText = PIXI.BitmapText; - - it('Module exists', function () { - expect(BitmapText).to.be.a('function'); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/text/Text.js b/tutorial-1/pixi.js-master/test/unit/pixi/text/Text.js deleted file mode 100755 index 9bc9ac5..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/text/Text.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/text/Text', function () { - 'use strict'; - - var expect = chai.expect; - var Text = PIXI.Text; - - it('Module exists', function () { - expect(Text).to.be.a('function'); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/textures/BaseTexture.js b/tutorial-1/pixi.js-master/test/unit/pixi/textures/BaseTexture.js deleted file mode 100755 index 502b724..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/textures/BaseTexture.js +++ /dev/null @@ -1,11 +0,0 @@ -describe('pixi/textures/BaseTexture', function () { - 'use strict'; - - var expect = chai.expect; - var BaseTexture = PIXI.BaseTexture; - - it('Module exists', function () { - expect(BaseTexture).to.be.a('function'); - expect(PIXI).to.have.property('BaseTextureCache').and.to.be.an('object'); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/textures/RenderTexture.js b/tutorial-1/pixi.js-master/test/unit/pixi/textures/RenderTexture.js deleted file mode 100755 index 96acdb4..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/textures/RenderTexture.js +++ /dev/null @@ -1,15 +0,0 @@ -describe('pixi/textures/RenderTexture', function () { - 'use strict'; - - var expect = chai.expect; - var RenderTexture = PIXI.RenderTexture; - - it('Module exists', function () { - expect(RenderTexture).to.be.a('function'); - }); - - it('Confirm new instance', function (done) { - var texture = new RenderTexture(100, 100, new PIXI.CanvasRenderer()); - pixi_textures_RenderTexture_confirmNew(texture, done); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/textures/Texture.js b/tutorial-1/pixi.js-master/test/unit/pixi/textures/Texture.js deleted file mode 100755 index 090f64d..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/textures/Texture.js +++ /dev/null @@ -1,26 +0,0 @@ -describe('pixi/textures/Texture', function () { - 'use strict'; - - var expect = chai.expect; - var Texture = PIXI.Texture; - - it('Module exists', function () { - expect(Texture).to.be.a('function'); - expect(PIXI).to.have.property('TextureCache').and.to.be.an('object'); - }); - - it('Members exist', function () { - expect(Texture).itself.to.respondTo('fromImage'); - expect(Texture).itself.to.respondTo('fromFrame'); - expect(Texture).itself.to.respondTo('fromCanvas'); - expect(Texture).itself.to.respondTo('addTextureToCache'); - expect(Texture).itself.to.respondTo('removeTextureFromCache'); - - // expect(Texture).itself.to.have.deep.property('frameUpdates.length', 0); - }); - - it('Confirm new instance', function (done) { - var texture = Texture.fromImage('/base/test/textures/bunny.png'); - pixi_textures_Texture_confirmNew(texture, done); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/utils/Detector.js b/tutorial-1/pixi.js-master/test/unit/pixi/utils/Detector.js deleted file mode 100755 index 4cf6008..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/utils/Detector.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/utils/Detector', function () { - 'use strict'; - - var expect = chai.expect; - var autoDetectRenderer = PIXI.autoDetectRenderer; - - it('Module exists', function () { - expect(autoDetectRenderer).to.be.a('function'); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/utils/EventTarget.js b/tutorial-1/pixi.js-master/test/unit/pixi/utils/EventTarget.js deleted file mode 100755 index 1cfc3a4..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/utils/EventTarget.js +++ /dev/null @@ -1,361 +0,0 @@ -describe('pixi/utils/EventTarget', function () { - 'use strict'; - - var expect = chai.expect; - - var Clazz, PClazz, obj, pobj, obj2; - beforeEach(function () { - Clazz = function () {}; - PClazz = function () {}; - - PIXI.EventTarget.mixin(Clazz.prototype); - PIXI.EventTarget.mixin(PClazz.prototype); - - obj = new Clazz(); - obj2 = new Clazz(); - pobj = new PClazz(); - - obj.parent = pobj; - obj2.parent = obj; - }); - - it('Module exists', function () { - expect(PIXI.EventTarget).to.be.an('object'); - }); - - it('Confirm new instance', function () { - pixi_utils_EventTarget_confirm(obj); - }); - - it('simple on/emit case works', function () { - var myData = {}; - - obj.on('myevent', function (event) { - pixi_utils_EventTarget_Event_confirm(event, obj, myData); - }); - - obj.emit('myevent', myData); - }); - - it('simple once case works', function () { - var called = 0; - - obj.once('myevent', function() { called++; }); - - obj.emit('myevent'); - obj.emit('myevent'); - obj.emit('myevent'); - obj.emit('myevent'); - obj.emit('myevent'); - - expect(called).to.equal(1); - }); - - it('simple off case works', function (done) { - function onMyEvent() { - done(new Error('Event listener should not have been called')); - } - - obj.on('myevent', onMyEvent); - obj.off('myevent', onMyEvent); - obj.emit('myevent'); - - done(); - }); - - it('simple propagation case works', function (done) { - var myData = {}; - - pobj.on('myevent', function () { - done(); - }); - - obj.emit('myevent'); - }); - - it('simple stopPropagation case works', function (done) { - var myData = {}; - - pobj.on('myevent', function () { - done(new Error('Event listener should not have been called on the parent element')); - }); - - obj.on('myevent', function (evt) { - evt.stopPropagation(); - }); - - obj.emit('myevent'); - - done(); - }); - - it('simple stopImmediatePropagation case works', function (done) { - var myData = {}; - - pobj.on('myevent', function () { - done(new Error('Event listener should not have been called on the parent')); - }); - - obj.on('myevent', function (evt) { - evt.stopImmediatePropagation(); - }); - - obj.on('myevent', function () { - done(new Error('Event listener should not have been called on the second')); - }); - - obj.emit('myevent'); - - done(); - }); - - it('multiple dispatches work properly', function () { - var called = 0; - - function onMyEvent() { - called++; - } - - obj.on('myevent', onMyEvent); - obj.emit('myevent'); - obj.emit('myevent'); - obj.emit('myevent'); - obj.emit('myevent'); - - expect(called).to.equal(4); - }); - - it('multiple events work properly', function () { - var called = 0; - - function onMyEvent() { - called++; - } - - obj.on('myevent1', onMyEvent); - obj.on('myevent2', onMyEvent); - obj.on('myevent3', onMyEvent); - obj.emit('myevent1'); - obj.emit('myevent2'); - obj.emit('myevent3'); - - expect(called).to.equal(3); - }); - - it('multiple events one removed works properly', function () { - var called = 0; - - function onMyEvent() { - called++; - } - - obj.on('myevent1', onMyEvent); - obj.on('myevent2', onMyEvent); - obj.on('myevent3', onMyEvent); - - obj.emit('myevent1'); - obj.emit('myevent2'); - obj.emit('myevent3'); - - obj.off('myevent2', onMyEvent); - - obj.emit('myevent1'); - obj.emit('myevent2'); - obj.emit('myevent3'); - - expect(called).to.equal(5); - }); - - it('multiple handlers for one event with some removed', function () { - var called = 0; - - var onMyEvent = function () { - called++; - }, - onMyEvent2 = function () { - called++; - }; - - // add 2 handlers and confirm they both get called - obj.on('myevent', onMyEvent); - obj.on('myevent', onMyEvent); - obj.on('myevent', onMyEvent2); - obj.on('myevent', onMyEvent2); - - obj.emit('myevent'); - - expect(called).to.equal(4); - - // remove one of the handlers, emit again, then ensure 1 more call is made - obj.off('myevent', onMyEvent); - - obj.emit('myevent'); - - expect(called).to.equal(6); - }); - - it('calls to off without a handler do nothing', function () { - var called = 0; - - var onMyEvent = function () { - called++; - }; - - obj.on('myevent', onMyEvent); - obj.on('myevent', onMyEvent); - - obj.emit('myevent'); - - expect(called).to.equal(2); - - obj.off('myevent'); - - obj.emit('myevent'); - - expect(called).to.equal(4); - - obj.off('myevent', onMyEvent); - - obj.emit('myevent'); - - expect(called).to.equal(4); - }); - - it('handles multiple instances with the same prototype', function () { - var called = 0; - - function onMyEvent(e) { - called++; - } - - obj.on('myevent1', onMyEvent); - obj.on('myevent2', onMyEvent); - - obj2.istwo = true; - obj2.on('myevent1', onMyEvent); - obj2.on('myevent2', onMyEvent); - - obj.emit('myevent1'); - obj.emit('myevent2'); - obj2.emit('myevent1'); - obj2.emit('myevent2'); - - //we emit 4 times, but since obj2 is a child of obj the event should bubble - //up to obj and show up there as well. So the obj2.emit() calls each increment - //the counter twice. - expect(called).to.equal(6); - }); - - it('is backwards compatible with older .dispatchEvent({})', function () { - var called = 0, - data = { - some: 'thing', - hello: true - }; - - function onMyEvent(event) { - pixi_utils_EventTarget_Event_confirm(event, obj, data); - - called++; - } - - obj.on('myevent1', onMyEvent); - obj.on('myevent2', onMyEvent); - obj.on('myevent3', onMyEvent); - - data.type = 'myevent1'; - obj.emit(data); - - data.type = 'myevent2'; - obj.emit(data); - - data.type = 'myevent3'; - obj.emit(data); - - obj.off('myevent2', onMyEvent); - - data.type = 'myevent1'; - obj.emit(data); - - data.type = 'myevent2'; - obj.emit(data); - - data.type = 'myevent3'; - obj.emit(data); - - expect(called).to.equal(5); - }); - - it('is backwards compatible with older .call(this)', function () { - var Fn = function() { - PIXI.EventTarget.call(this); - }, - o = new Fn(); - - pixi_utils_EventTarget_confirm(o); - }); - - it('is backwards compatible with older .addEventListener("")', function () { - var called = 0, - data = { - some: 'thing', - hello: true - }; - - function onMyEvent(event) { - pixi_utils_EventTarget_Event_confirm(event, obj, data); - - called++; - } - - obj.addEventListener('myevent1', onMyEvent); - obj.addEventListener('myevent2', onMyEvent); - obj.addEventListener('myevent3', onMyEvent); - - data.type = 'myevent1'; - obj.emit(data); - - data.type = 'myevent2'; - obj.emit(data); - - data.type = 'myevent3'; - obj.emit(data); - - obj.off('myevent2', onMyEvent); - - data.type = 'myevent1'; - obj.emit(data); - - data.type = 'myevent2'; - obj.emit(data); - - data.type = 'myevent3'; - obj.emit(data); - - expect(called).to.equal(5); - }); - - it('event remove during emit call properly', function () { - var called = 0; - - function cb1() { - called++; - obj.off('myevent', cb1); - } - function cb2() { - called++; - obj.off('myevent', cb2); - } - function cb3() { - called++; - obj.off('myevent', cb3); - } - - obj.on('myevent', cb1); - obj.on('myevent', cb2); - obj.on('myevent', cb3); - obj.emit('myevent', ''); - - expect(called).to.equal(3); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/utils/Polyk.js b/tutorial-1/pixi.js-master/test/unit/pixi/utils/Polyk.js deleted file mode 100755 index dfc7128..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/utils/Polyk.js +++ /dev/null @@ -1,14 +0,0 @@ -describe('pixi/utils/Polyk', function () { - 'use strict'; - - var expect = chai.expect; - var PolyK = PIXI.PolyK; - - it('Module exists', function () { - expect(PolyK).to.be.an('object'); - }); - - it('Members exist', function () { - expect(PolyK).to.respondTo('Triangulate'); - }); -}); diff --git a/tutorial-1/pixi.js-master/test/unit/pixi/utils/Utils.js b/tutorial-1/pixi.js-master/test/unit/pixi/utils/Utils.js deleted file mode 100755 index c97b3c6..0000000 --- a/tutorial-1/pixi.js-master/test/unit/pixi/utils/Utils.js +++ /dev/null @@ -1,17 +0,0 @@ -describe('Utils', function () { - 'use strict'; - - var expect = chai.expect; - - it('requestAnimationFrame exists', function () { - expect(global).to.respondTo('requestAnimationFrame'); - }); - - it('cancelAnimationFrame exists', function () { - expect(global).to.respondTo('cancelAnimationFrame'); - }); - - it('requestAnimFrame exists', function () { - expect(global).to.respondTo('requestAnimFrame'); - }); -}); diff --git a/tutorial-1/pixi.js-master/trim/SpriteSheet.json b/tutorial-1/pixi.js-master/trim/SpriteSheet.json deleted file mode 100755 index 978c2f2..0000000 --- a/tutorial-1/pixi.js-master/trim/SpriteSheet.json +++ /dev/null @@ -1,228 +0,0 @@ -{"frames": { - -"Explosion_Sequence_A 1.png": -{ - "frame": {"x":244,"y":1454,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 10.png": -{ - "frame": {"x":244,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 11.png": -{ - "frame": {"x":2,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 12.png": -{ - "frame": {"x":728,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 13.png": -{ - "frame": {"x":486,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 14.png": -{ - "frame": {"x":244,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 15.png": -{ - "frame": {"x":2,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 16.png": -{ - "frame": {"x":728,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 17.png": -{ - "frame": {"x":486,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 18.png": -{ - "frame": {"x":244,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 19.png": -{ - "frame": {"x":2,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 2.png": -{ - "frame": {"x":728,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 20.png": -{ - "frame": {"x":728,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 21.png": -{ - "frame": {"x":486,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 22.png": -{ - "frame": {"x":244,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 23.png": -{ - "frame": {"x":2,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 24.png": -{ - "frame": {"x":728,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 25.png": -{ - "frame": {"x":486,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 26.png": -{ - "frame": {"x":244,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 27.png": -{ - "frame": {"x":2,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 3.png": -{ - "frame": {"x":486,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 4.png": -{ - "frame": {"x":244,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 5.png": -{ - "frame": {"x":2,"y":1696,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 6.png": -{ - "frame": {"x":2,"y":1454,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 7.png": -{ - "frame": {"x":2,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 8.png": -{ - "frame": {"x":728,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 9.png": -{ - "frame": {"x":486,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}}, -"meta": { - "app": "http://www.texturepacker.com", - "version": "1.0", - "image": "SpriteSheet.png", - "format": "RGBA8888", - "size": {"w":1024,"h":2048}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:17e4a2d92ff3e27832c3f4938cec7c85$" -} -} diff --git a/tutorial-1/pixi.js-master/trim/SpriteSheet.png b/tutorial-1/pixi.js-master/trim/SpriteSheet.png deleted file mode 100755 index 79e1a69..0000000 Binary files a/tutorial-1/pixi.js-master/trim/SpriteSheet.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/trim/SpriteSheetTrimmed.json b/tutorial-1/pixi.js-master/trim/SpriteSheetTrimmed.json deleted file mode 100755 index 7f9dd6a..0000000 --- a/tutorial-1/pixi.js-master/trim/SpriteSheetTrimmed.json +++ /dev/null @@ -1,228 +0,0 @@ -{"frames": { - -"TExplosion_Sequence_A 1.png": -{ - "frame": {"x":436,"y":1636,"w":204,"h":182}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":32,"y":38,"w":204,"h":182}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 10.png": -{ - "frame": {"x":2,"y":728,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 11.png": -{ - "frame": {"x":226,"y":486,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 12.png": -{ - "frame": {"x":2,"y":2,"w":224,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":16,"y":0,"w":224,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 13.png": -{ - "frame": {"x":2,"y":970,"w":224,"h":234}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":16,"y":0,"w":224,"h":234}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 14.png": -{ - "frame": {"x":2,"y":1206,"w":224,"h":220}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":16,"y":0,"w":224,"h":220}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 15.png": -{ - "frame": {"x":228,"y":1190,"w":216,"h":214}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":216,"h":214}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 16.png": -{ - "frame": {"x":228,"y":970,"w":216,"h":218}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":216,"h":218}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 17.png": -{ - "frame": {"x":2,"y":1428,"w":222,"h":220}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":220}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 18.png": -{ - "frame": {"x":440,"y":1416,"w":210,"h":218}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":210,"h":218}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 19.png": -{ - "frame": {"x":228,"y":1406,"w":210,"h":220}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":19,"y":0,"w":210,"h":220}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 2.png": -{ - "frame": {"x":2,"y":1650,"w":218,"h":198}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":22,"w":218,"h":198}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 20.png": -{ - "frame": {"x":226,"y":1628,"w":208,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":208,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 21.png": -{ - "frame": {"x":446,"y":1214,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 22.png": -{ - "frame": {"x":446,"y":1012,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 23.png": -{ - "frame": {"x":448,"y":810,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 24.png": -{ - "frame": {"x":450,"y":608,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 25.png": -{ - "frame": {"x":450,"y":406,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 26.png": -{ - "frame": {"x":452,"y":204,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 27.png": -{ - "frame": {"x":452,"y":2,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 3.png": -{ - "frame": {"x":442,"y":1820,"w":208,"h":196}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":19,"y":22,"w":208,"h":196}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 4.png": -{ - "frame": {"x":222,"y":1830,"w":218,"h":196}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":22,"w":218,"h":196}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 5.png": -{ - "frame": {"x":226,"y":728,"w":220,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":19,"y":0,"w":220,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 6.png": -{ - "frame": {"x":2,"y":486,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 7.png": -{ - "frame": {"x":226,"y":244,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 8.png": -{ - "frame": {"x":2,"y":244,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 9.png": -{ - "frame": {"x":228,"y":2,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}}, -"meta": { - "app": "http://www.codeandweb.com/texturepacker ", - "version": "1.0", - "image": "SpriteSheetTrimmed.png", - "format": "RGBA8888", - "size": {"w":654,"h":2028}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:6ba345a190bfe2d62301a49ce8112726:aaa6f60c39d4c316b8ed9667f27805ca:b0c0aa18e0b197cfe7bc02a7377aa72f$" -} -} diff --git a/tutorial-1/pixi.js-master/trim/SpriteSheetTrimmed.png b/tutorial-1/pixi.js-master/trim/SpriteSheetTrimmed.png deleted file mode 100755 index 9214f71..0000000 Binary files a/tutorial-1/pixi.js-master/trim/SpriteSheetTrimmed.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/trim/bikkuriman.png b/tutorial-1/pixi.js-master/trim/bikkuriman.png deleted file mode 100755 index 3bc5592..0000000 Binary files a/tutorial-1/pixi.js-master/trim/bikkuriman.png and /dev/null differ diff --git a/tutorial-1/pixi.js-master/trim/index.html b/tutorial-1/pixi.js-master/trim/index.html deleted file mode 100755 index d051dfa..0000000 --- a/tutorial-1/pixi.js-master/trim/index.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - Pixi Trim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Test 1

    -

    Test 2

    -

    Test 3

    - - - diff --git a/tutorial-1/pixi.js-master/trim/index2.html b/tutorial-1/pixi.js-master/trim/index2.html deleted file mode 100755 index 4276c57..0000000 --- a/tutorial-1/pixi.js-master/trim/index2.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - Pixi Trim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Test 1

    -

    Test 2

    -

    Test 3

    - - - diff --git a/tutorial-1/pixi.js-master/trim/index3.html b/tutorial-1/pixi.js-master/trim/index3.html deleted file mode 100755 index 1a506b3..0000000 --- a/tutorial-1/pixi.js-master/trim/index3.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - Pixi Trim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Test 1

    -

    Test 2

    -

    Test 3

    - - - diff --git a/tutorial-2/Far.js b/tutorial-2/Far.js index 2eea607..75da552 100644 --- a/tutorial-2/Far.js +++ b/tutorial-2/Far.js @@ -1,6 +1,6 @@ function Far() { var texture = PIXI.Texture.fromImage("resources/bg-far.png"); - PIXI.TilingSprite.call(this, texture, 512, 256); + PIXI.extras.TilingSprite.call(this, texture, 512, 256); this.position.x = 0; this.position.y = 0; @@ -10,8 +10,7 @@ function Far() { this.viewportX = 0; } -Far.constructor = Far; -Far.prototype = Object.create(PIXI.TilingSprite.prototype); +Far.prototype = Object.create(PIXI.extras.TilingSprite.prototype); Far.DELTA_X = 0.128; diff --git a/tutorial-2/Main.js b/tutorial-2/Main.js index 0aa6ef2..5189239 100755 --- a/tutorial-2/Main.js +++ b/tutorial-2/Main.js @@ -1,6 +1,6 @@ function Main() { - this.stage = new PIXI.Stage(0x66FF99); - this.renderer = new PIXI.autoDetectRenderer( + this.stage = new PIXI.Container(); + this.renderer = PIXI.autoDetectRenderer( 512, 384, {view:document.getElementById("game-canvas")} @@ -8,7 +8,7 @@ function Main() { this.scroller = new Scroller(this.stage); - requestAnimFrame(this.update.bind(this)); + requestAnimationFrame(this.update.bind(this)); } Main.SCROLL_SPEED = 5; @@ -16,6 +16,6 @@ Main.SCROLL_SPEED = 5; Main.prototype.update = function() { this.scroller.moveViewportXBy(Main.SCROLL_SPEED); this.renderer.render(this.stage); - requestAnimFrame(this.update.bind(this)); + requestAnimationFrame(this.update.bind(this)); }; diff --git a/tutorial-2/Mid.js b/tutorial-2/Mid.js index e7d9451..4b24730 100644 --- a/tutorial-2/Mid.js +++ b/tutorial-2/Mid.js @@ -1,6 +1,6 @@ function Mid() { var texture = PIXI.Texture.fromImage("resources/bg-mid.png"); - PIXI.TilingSprite.call(this, texture, 512, 256); + PIXI.extras.TilingSprite.call(this, texture, 512, 256); this.position.x = 0; this.position.y = 128; @@ -10,8 +10,7 @@ function Mid() { this.viewportX = 0; } -Mid.constructor = Mid; -Mid.prototype = Object.create(PIXI.TilingSprite.prototype); +Mid.prototype = Object.create(PIXI.extras.TilingSprite.prototype); Mid.DELTA_X = 0.64; diff --git a/tutorial-2/index.html b/tutorial-2/index.html index 4a06aaa..a47cbe9 100644 --- a/tutorial-2/index.html +++ b/tutorial-2/index.html @@ -11,7 +11,7 @@
    - + diff --git a/tutorial-2/pixi.js-master/.editorconfig b/tutorial-2/pixi.js-master/.editorconfig deleted file mode 100755 index 347b5a2..0000000 --- a/tutorial-2/pixi.js-master/.editorconfig +++ /dev/null @@ -1,11 +0,0 @@ -; This file is for unifying the coding style for different editors and IDEs. -; More information at http://EditorConfig.org -root = true - -[**.js] -indent_style = space -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true diff --git a/tutorial-2/pixi.js-master/.gitignore b/tutorial-2/pixi.js-master/.gitignore deleted file mode 100755 index 52d83ed..0000000 --- a/tutorial-2/pixi.js-master/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -node_modules -.DS_Store -.project -*.sublime-* -*.log - -bin/pixi.dev.js.map diff --git a/tutorial-2/pixi.js-master/.jshintrc b/tutorial-2/pixi.js-master/.jshintrc deleted file mode 100755 index 08babe8..0000000 --- a/tutorial-2/pixi.js-master/.jshintrc +++ /dev/null @@ -1,127 +0,0 @@ -{ - // -------------------------------------------------------------------- - // JSHint Configuration - // -------------------------------------------------------------------- - // - // @author Chad Engler - - // == Enforcing Options =============================================== - // - // These options tell JSHint to be more strict towards your code. Use - // them if you want to allow only a safe subset of JavaScript, very - // useful when your codebase is shared with a big number of developers - // with different skill levels. - - "bitwise" : false, // Disallow bitwise operators (&, |, ^, etc.). - "camelcase" : true, // Force all variable names to use either camelCase or UPPER_CASE. - "curly" : false, // Require {} for every new block or scope. - "eqeqeq" : true, // Require triple equals i.e. `===`. - "es3" : false, // Enforce conforming to ECMAScript 3. - "forin" : false, // Disallow `for in` loops without `hasOwnPrototype`. - "immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );` - "indent" : 4, // Require that 4 spaces are used for indentation. - "latedef" : true, // Prohibit variable use before definition. - "newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`. - "noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`. - "noempty" : true, // Prohibit use of empty blocks. - "nonew" : true, // Prohibit use of constructors for side-effects. - "plusplus" : false, // Disallow use of `++` & `--`. - "quotmark" : true, // Force consistency when using quote marks. - "undef" : true, // Require all non-global variables be declared before they are used. - "unused" : true, // Warn when varaibles are created by not used. - "strict" : false, // Require `use strict` pragma in every file. - "trailing" : true, // Prohibit trailing whitespaces. - "maxparams" : 8, // Prohibit having more than X number of params in a function. - "maxdepth" : 8, // Prohibit nested blocks from going more than X levels deep. - "maxstatements" : false, // Restrict the number of statements in a function. - "maxcomplexity" : false, // Restrict the cyclomatic complexity of the code. - "maxlen" : 220, // Require that all lines are 100 characters or less. - "globals" : { // Register globals that are used in the code. - //commonjs globals - "module": false, - "require": false, - - // PIXI globals - "PIXI": false, - "spine": false, - - //chai globals - "chai": false, - - //mocha globals - "describe": false, - "it": false, - - //resemble globals - "resemble": false - }, - - // == Relaxing Options ================================================ - // - // These options allow you to suppress certain types of warnings. Use - // them only if you are absolutely positive that you know what you are - // doing. - - "asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons). - "boss" : true, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments. - "debug" : false, // Allow debugger statements e.g. browser breakpoints. - "eqnull" : false, // Tolerate use of `== null`. - "esnext" : false, // Allow ES.next specific features such as `const` and `let`. - "evil" : false, // Tolerate use of `eval`. - "expr" : false, // Tolerate `ExpressionStatement` as Programs. - "funcscope" : false, // Tolerate declarations of variables inside of control structures while accessing them later from the outside. - "globalstrict" : false, // Allow global "use strict" (also enables 'strict'). - "iterator" : false, // Allow usage of __iterator__ property. - "lastsemic" : false, // Tolerate missing semicolons when the it is omitted for the last statement in a one-line block. - "laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons. - "laxcomma" : false, // Suppress warnings about comma-first coding style. - "loopfunc" : false, // Allow functions to be defined within loops. - "moz" : false, // Code that uses Mozilla JS extensions will set this to true - "multistr" : false, // Tolerate multi-line strings. - "proto" : false, // Tolerate __proto__ property. This property is deprecated. - "scripturl" : false, // Tolerate script-targeted URLs. - "smarttabs" : false, // Tolerate mixed tabs and spaces when the latter are used for alignmnent only. - "shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`. - "sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`. - "supernew" : false, // Tolerate `new function () { ... };` and `new Object;`. - "validthis" : false, // Tolerate strict violations when the code is running in strict mode and you use this in a non-constructor function. - - // == Environments ==================================================== - // - // These options pre-define global variables that are exposed by - // popular JavaScript libraries and runtime environments—such as - // browser or node.js. - - "browser" : true, // Standard browser globals e.g. `window`, `document`. - "couch" : false, // Enable globals exposed by CouchDB. - "devel" : false, // Allow development statements e.g. `console.log();`. - "dojo" : false, // Enable globals exposed by Dojo Toolkit. - "jquery" : false, // Enable globals exposed by jQuery JavaScript library. - "mootools" : false, // Enable globals exposed by MooTools JavaScript framework. - "node" : false, // Enable globals available when code is running inside of the NodeJS runtime environment. (for Gruntfile) - "nonstandard" : false, // Define non-standard but widely adopted globals such as escape and unescape. - "prototypejs" : false, // Enable globals exposed by Prototype JavaScript framework. - "rhino" : false, // Enable globals available when your code is running inside of the Rhino runtime environment. - "worker" : false, // Enable globals available when your code is running as a WebWorker. - "wsh" : false, // Enable globals available when your code is running as a script for the Windows Script Host. - "yui" : false, // Enable globals exposed by YUI library. - - // == JSLint Legacy =================================================== - // - // These options are legacy from JSLint. Aside from bug fixes they will - // not be improved in any way and might be removed at any point. - - "nomen" : false, // Prohibit use of initial or trailing underbars in names. - "onevar" : false, // Allow only one `var` statement per function. - "passfail" : false, // Stop on first error. - "white" : false, // Check against strict whitespace and indentation rules. - - // == Undocumented Options ============================================ - // - // While I've found these options in some projects, they are not - // described in the [JSHint Options documentation][4]. - // - // [4]: http://www.jshint.com/options/ - - "maxerr" : 100 // Maximum errors before stopping. -} diff --git a/tutorial-2/pixi.js-master/.travis.yml b/tutorial-2/pixi.js-master/.travis.yml deleted file mode 100755 index 1c60690..0000000 --- a/tutorial-2/pixi.js-master/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: node_js -node_js: - - "0.10" - -branches: - only: - - master - - dev - -install: - - npm install grunt-cli - - npm install - -cache: - directories: - - node_modules - -before_script: - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start - -script: - - ./node_modules/.bin/grunt travis \ No newline at end of file diff --git a/tutorial-2/pixi.js-master/CONTRIBUTING.md b/tutorial-2/pixi.js-master/CONTRIBUTING.md deleted file mode 100755 index ddf5029..0000000 --- a/tutorial-2/pixi.js-master/CONTRIBUTING.md +++ /dev/null @@ -1,62 +0,0 @@ -# How to contribute - -It is essential to the development of pixi.js that the community is empowered -to make changes and get them into the library. Here are some guidlines to make -that process silky smooth for all involved. - -## Reporting issues - -To report a bug, request a feature, or even ask a question, make use of the GitHub Issues -section for [pixi.js][0]. When submitting an issue please take the following steps: - -1. **Seach for existing issues.** Your question or bug may have already been answered or fixed, -be sure to search the issues first before putting in a duplicate issue. - -2. **Create an isolated and reproducible test case.** If you are reporting a bug, make sure you -also have a minimal, runnable, code example that reproduces the problem you have. - -3. **Include a live example.** After narrowing your code down to only the problem areas, make use -of [jsFiddle][1], [jsBin][2], or a link to your live site so that we can view a live example of the problem. - -4. **Share as much information as possible.** Include browser version affected, your OS, version of -the library, steps to reproduce, etc. "X isn't working!!!1!" will probably just be closed. - - -## Making Changes - -To setup for making changes you will need node.js, and grunt installed. You can download node.js -from [nodejs.org][3]. After it has been installed open a console and run `npm i -g grunt-cli` to -install the global `grunt` executable. - -After that you can clone the pixi.js repository, and run `npm i` inside the cloned folder. -This will install dependencies necessary for building the project. Once that is ready, make your -changes and submit a Pull Request. When submitting a PR follow these guidlines: - -- **Send Pull Requests to the `dev` branch.** All Pull Requests must be sent to the `dev` branch, -`master` is the latest release and PRs to that branch will be closed. - -- **Ensure changes are jshint validated.** After making a change be sure to run the build process -to ensure that you didn't break anything. You can do this with `grunt && grunt test` which will run -jshint, rebuild, then run the test suite. - -- **Never commit new builds.** When making a code change, you should always run `grunt` which will -rebuild the project, *however* please do not commit these new builds or your PR will be closed. - -- **Only commit relevant changes.** Don't include changes that are not directly relevant to the fix -you are making. The more focused a PR is, the faster it will get attention and be merged. Extra files -changing only whitespace or trash files will likely get your PR closed. - -## Quickie Code Style Guide - -- Use 4 spaces for tabs, never tab characters. - -- No trailing whitespace, blank lines should have no whitespace. - -- Always favor strict equals `===` unless you *need* to use type coercion. - -- Follow conventions already in the code, and listen to jshint. - -[0]: https://github.com/GoodBoyDigital/pixi.js/issues -[1]: http://jsfiddle.net -[2]: http://jsbin.com/ -[3]: http://nodejs.org \ No newline at end of file diff --git a/tutorial-2/pixi.js-master/Gruntfile.js b/tutorial-2/pixi.js-master/Gruntfile.js deleted file mode 100755 index dda4a9e..0000000 --- a/tutorial-2/pixi.js-master/Gruntfile.js +++ /dev/null @@ -1,227 +0,0 @@ -module.exports = function(grunt) { - grunt.loadNpmTasks('grunt-concat-sourcemap'); - grunt.loadNpmTasks('grunt-contrib-concat'); - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-contrib-connect'); - grunt.loadNpmTasks('grunt-contrib-yuidoc'); - grunt.loadNpmTasks('grunt-contrib-watch'); - - grunt.loadTasks('tasks'); - - var srcFiles = [ - '<%= dirs.src %>/Intro.js', - '<%= dirs.src %>/Pixi.js', - '<%= dirs.src %>/geom/Point.js', - '<%= dirs.src %>/geom/Rectangle.js', - '<%= dirs.src %>/geom/Polygon.js', - '<%= dirs.src %>/geom/Circle.js', - '<%= dirs.src %>/geom/Ellipse.js', - '<%= dirs.src %>/geom/RoundedRectangle.js', - '<%= dirs.src %>/geom/Matrix.js', - '<%= dirs.src %>/display/DisplayObject.js', - '<%= dirs.src %>/display/DisplayObjectContainer.js', - '<%= dirs.src %>/display/Sprite.js', - '<%= dirs.src %>/display/SpriteBatch.js', - '<%= dirs.src %>/display/MovieClip.js', - '<%= dirs.src %>/filters/FilterBlock.js', - '<%= dirs.src %>/text/Text.js', - '<%= dirs.src %>/text/BitmapText.js', - '<%= dirs.src %>/InteractionData.js', - '<%= dirs.src %>/InteractionManager.js', - '<%= dirs.src %>/display/Stage.js', - '<%= dirs.src %>/utils/Utils.js', - '<%= dirs.src %>/utils/EventTarget.js', - '<%= dirs.src %>/utils/Detector.js', - '<%= dirs.src %>/utils/Polyk.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLShaderUtils.js', - '<%= dirs.src %>/renderers/webgl/shaders/PixiShader.js', - '<%= dirs.src %>/renderers/webgl/shaders/PixiFastShader.js', - '<%= dirs.src %>/renderers/webgl/shaders/StripShader.js', - '<%= dirs.src %>/renderers/webgl/shaders/PrimitiveShader.js', - '<%= dirs.src %>/renderers/webgl/shaders/ComplexPrimitiveShader.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLGraphics.js', - '<%= dirs.src %>/renderers/webgl/WebGLRenderer.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLBlendModeManager.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLMaskManager.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLStencilManager.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLShaderManager.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLSpriteBatch.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLFastSpriteBatch.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLFilterManager.js', - '<%= dirs.src %>/renderers/webgl/utils/FilterTexture.js', - '<%= dirs.src %>/renderers/canvas/utils/CanvasBuffer.js', - '<%= dirs.src %>/renderers/canvas/utils/CanvasMaskManager.js', - '<%= dirs.src %>/renderers/canvas/utils/CanvasTinter.js', - '<%= dirs.src %>/renderers/canvas/CanvasRenderer.js', - '<%= dirs.src %>/renderers/canvas/CanvasGraphics.js', - '<%= dirs.src %>/primitives/Graphics.js', - '<%= dirs.src %>/extras/Strip.js', - '<%= dirs.src %>/extras/Rope.js', - '<%= dirs.src %>/extras/TilingSprite.js', - '<%= dirs.src %>/extras/Spine.js', - '<%= dirs.src %>/extras/PIXISpine.js', - '<%= dirs.src %>/textures/BaseTexture.js', - '<%= dirs.src %>/textures/Texture.js', - '<%= dirs.src %>/textures/RenderTexture.js', - '<%= dirs.src %>/textures/VideoTexture.js', - '<%= dirs.src %>/loaders/AssetLoader.js', - '<%= dirs.src %>/loaders/JsonLoader.js', - '<%= dirs.src %>/loaders/AtlasLoader.js', - '<%= dirs.src %>/loaders/SpriteSheetLoader.js', - '<%= dirs.src %>/loaders/ImageLoader.js', - '<%= dirs.src %>/loaders/BitmapFontLoader.js', - '<%= dirs.src %>/loaders/SpineLoader.js', - '<%= dirs.src %>/filters/AbstractFilter.js', - '<%= dirs.src %>/filters/AlphaMaskFilter.js', - '<%= dirs.src %>/filters/ColorMatrixFilter.js', - '<%= dirs.src %>/filters/GrayFilter.js', - '<%= dirs.src %>/filters/DisplacementFilter.js', - '<%= dirs.src %>/filters/PixelateFilter.js', - '<%= dirs.src %>/filters/BlurXFilter.js', - '<%= dirs.src %>/filters/BlurYFilter.js', - '<%= dirs.src %>/filters/BlurFilter.js', - '<%= dirs.src %>/filters/InvertFilter.js', - '<%= dirs.src %>/filters/SepiaFilter.js', - '<%= dirs.src %>/filters/TwistFilter.js', - '<%= dirs.src %>/filters/ColorStepFilter.js', - '<%= dirs.src %>/filters/DotScreenFilter.js', - '<%= dirs.src %>/filters/CrossHatchFilter.js', - '<%= dirs.src %>/filters/RGBSplitFilter.js', - '<%= dirs.src %>/Outro.js' - ], - banner = [ - '/**', - ' * @license', - ' * <%= pkg.name %> - v<%= pkg.version %>', - ' * Copyright (c) 2012-2014, Mat Groves', - ' * <%= pkg.homepage %>', - ' *', - ' * Compiled: <%= grunt.template.today("yyyy-mm-dd") %>', - ' *', - ' * <%= pkg.name %> is licensed under the <%= pkg.license %> License.', - ' * <%= pkg.licenseUrl %>', - ' */', - '' - ].join('\n'); - - grunt.initConfig({ - pkg : grunt.file.readJSON('package.json'), - dirs: { - build: 'bin', - docs: 'docs', - src: 'src/pixi', - test: 'test' - }, - files: { - srcBlob: '<%= dirs.src %>/**/*.js', - testBlob: '<%= dirs.test %>/**/*.js', - testConf: '<%= dirs.test %>/karma.conf.js', - build: '<%= dirs.build %>/pixi.dev.js', - buildMin: '<%= dirs.build %>/pixi.js' - }, - concat: { - options: { - banner: banner - }, - dist: { - src: srcFiles, - dest: '<%= files.build %>' - } - }, - /* jshint -W106 */ - concat_sourcemap: { - dev: { - files: { - '<%= files.build %>': srcFiles - }, - options: { - sourceRoot: '../' - } - } - }, - jshint: { - options: { - jshintrc: './.jshintrc' - }, - source: { - src: srcFiles.concat('Gruntfile.js'), - options: { - ignores: '<%= dirs.src %>/**/{Intro,Outro,Spine,Pixi}.js' - } - }, - test: { - src: ['<%= files.testBlob %>'], - options: { - ignores: '<%= dirs.test %>/lib/resemble.js', - jshintrc: undefined, //don't use jshintrc for tests - expr: true, - undef: false, - camelcase: false - } - } - }, - uglify: { - options: { - banner: banner - }, - dist: { - src: '<%= files.build %>', - dest: '<%= files.buildMin %>' - } - }, - connect: { - test: { - options: { - port: grunt.option('port-test') || 9002, - base: './', - keepalive: true - } - } - }, - yuidoc: { - compile: { - name: '<%= pkg.name %>', - description: '<%= pkg.description %>', - version: '<%= pkg.version %>', - url: '<%= pkg.homepage %>', - logo: '<%= pkg.logo %>', - options: { - paths: '<%= dirs.src %>', - outdir: '<%= dirs.docs %>' - } - } - }, - //Watches and builds for _development_ (source maps) - watch: { - scripts: { - files: ['<%= dirs.src %>/**/*.js'], - tasks: ['concat_sourcemap'], - options: { - spawn: false, - } - } - }, - karma: { - unit: { - configFile: '<%= files.testConf %>', - // browsers: ['Chrome'], - singleRun: true - } - } - }); - - grunt.registerTask('default', ['build', 'test']); - - grunt.registerTask('build', ['jshint:source', 'concat', 'uglify']); - grunt.registerTask('build-debug', ['concat_sourcemap', 'uglify']); - - grunt.registerTask('test', ['concat', 'jshint:test', 'karma']); - - grunt.registerTask('docs', ['yuidoc']); - grunt.registerTask('travis', ['build', 'test']); - - grunt.registerTask('default', ['build', 'test']); - - grunt.registerTask('debug-watch', ['concat_sourcemap', 'watch:debug']); -}; diff --git a/tutorial-2/pixi.js-master/LICENSE b/tutorial-2/pixi.js-master/LICENSE deleted file mode 100755 index 39cbfb0..0000000 --- a/tutorial-2/pixi.js-master/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2013-2015 Mathew Groves - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tutorial-2/pixi.js-master/README.md b/tutorial-2/pixi.js-master/README.md deleted file mode 100755 index 1d3b3d4..0000000 --- a/tutorial-2/pixi.js-master/README.md +++ /dev/null @@ -1,181 +0,0 @@ -Pixi Renderer -============= - -#### *** IMPORTANT - V2 API CHANGES *** #### - -A heads up for anyone updating their version of pixi.js to version 2, as we have changed a couple of bits that you need to be aware of. Fortunately, there are only two changes, and both are small. - -1: Creating a renderer now accepts an options parameter that you can add specific settings to: -``` -// an optional object that contains the settings for the renderer -var options = { - view:myCanvas, - resolution:1 -}; - -var renderer = new PIXI.WebGLRenderer(800, 600, options) -``` - -2: A ```PIXI.RenderTexture``` now accepts a ```PIXI.Matrix``` as its second parameter instead of a point. This gives you much more flexibility: - -``` myRenderTexture.render(myDisplayObject, myMatrix) ``` - -Check out the docs for more info! - - -![pixi.js logo](http://www.goodboydigital.com/pixijs/logo_small.png) - -[](http://www.pixijs.com/projects) -#### JavaScript 2D Renderer #### - -The aim of this project is to provide a fast lightweight 2D library that works -across all devices. The Pixi renderer allows everyone to enjoy the power of -hardware acceleration without prior knowledge of webGL. Also, it's fast. - -If you’re interested in pixi.js then feel free to follow me on twitter -([@doormat23](https://twitter.com/doormat23)) and I will keep you posted! And -of course check back on [our site]() as -any breakthroughs will be posted up there too! - -[![Inline docs](http://inch-ci.org/github/GoodBoyDigital/pixi.js.svg?branch=master)](http://inch-ci.org/github/GoodBoyDigital/pixi.js) -[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/GoodBoyDigital/pixi.js/trend.png)](https://bitdeli.com/free "Bitdeli Badge") - -### Demos ### - -- [WebGL Filters!]() - -- [Run pixie run]() - -- [Fight for Everyone]() - -- [Flash vs HTML]() - -- [Bunny Demo]() - -- [Storm Brewing]() - -- [Filters Demo]() - -- [Render Texture Demo]() - -- [Primitives Demo]() - -- [Masking Demo]() - -- [Interaction Demo]() - -- [photonstorm Balls Demo]() - -- [photonstorm Morph Demo]() - -Thanks to [@photonstorm](https://twitter.com/photonstorm) for providing those -last 2 examples and allowing us to share the source code :) - -### Docs ### - -[Documentation can be found here]() - -### Resources ### - -[Tutorials and other helpful bits]() - -[Pixi.js forum]() - - -### Road Map ### - -* Create a Typescript definition file for Pixi.js -* Implement Flash animation to pixi -* Update Loader so that it support XHR2 if it is available -* Improve the Documentation of the Project -* Create an Asset Loader Tutorial -* Create a MovieClip Tutorial -* Create a small game Tutorial - -### Contribute ### - -Want to be part of the pixi.js project? Great! All are welcome! We will get there quicker together :) -Whether you find a bug, have a great feature request or you fancy owning a task from the road map above feel free to get in touch. - -Make sure to read the [Contributing Guide](https://github.com/GoodBoyDigital/pixi.js/blob/master/CONTRIBUTING.md) -before submitting changes. - -### How to build ### - -PixiJS is built with Grunt. If you don't already have this, go install Node and NPM then install the Grunt Command Line. - -``` -$> npm install -g grunt-cli -``` - -Then, in the folder where you have downloaded the source, install the build dependencies using npm: - -``` -$> npm install -``` - -Then build: - -``` -$> grunt -``` - -This will create a minified version at bin/pixi.js and a non-minified version at bin/pixi.dev.js. - -It also copies the non-minified version to the examples. - -### Current features ### - -- WebGL renderer (with automatic smart batching allowing for REALLY fast performance) -- Canvas renderer (Fastest in town!) -- Full scene graph -- Super easy to use API (similar to the flash display list API) -- Support for texture atlases -- Asset loader / sprite sheet loader -- Auto-detect which renderer should be used -- Full Mouse and Multi-touch Interaction -- Text -- BitmapFont text -- Multiline Text -- Render Texture -- Spine support -- Primitive Drawing -- Masking -- Filters - -### Usage ### - -```javascript - - // You can use either PIXI.WebGLRenderer or PIXI.CanvasRenderer - var renderer = new PIXI.WebGLRenderer(800, 600); - - document.body.appendChild(renderer.view); - - var stage = new PIXI.Stage; - - var bunnyTexture = PIXI.Texture.fromImage("bunny.png"); - var bunny = new PIXI.Sprite(bunnyTexture); - - bunny.position.x = 400; - bunny.position.y = 300; - - bunny.scale.x = 2; - bunny.scale.y = 2; - - stage.addChild(bunny); - - requestAnimationFrame(animate); - - function animate() { - bunny.rotation += 0.01; - - renderer.render(stage); - - requestAnimationFrame(animate); - } -``` - -This content is released under the (http://opensource.org/licenses/MIT) MIT License. - -[![Analytics](https://ga-beacon.appspot.com/UA-39213431-2/pixi.js/index)](https://github.com/igrigorik/ga-beacon) diff --git a/tutorial-2/pixi.js-master/bin/pixi.dev.js b/tutorial-2/pixi.js-master/bin/pixi.dev.js deleted file mode 100755 index c1cf45b..0000000 --- a/tutorial-2/pixi.js-master/bin/pixi.dev.js +++ /dev/null @@ -1,20265 +0,0 @@ -/** - * @license - * pixi.js - v2.2.7 - * Copyright (c) 2012-2014, Mat Groves - * http://goodboydigital.com/ - * - * Compiled: 2015-02-25 - * - * pixi.js is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license.php - */ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -(function(){ - - var root = this; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The [pixi.js](http://www.pixijs.com/) module/namespace. - * - * @module PIXI - */ - -/** - * Namespace-class for [pixi.js](http://www.pixijs.com/). - * - * Contains assorted static properties and enumerations. - * - * @class PIXI - * @static - */ -var PIXI = PIXI || {}; - -/** - * @property {Number} WEBGL_RENDERER - * @protected - * @static - */ -PIXI.WEBGL_RENDERER = 0; -/** - * @property {Number} CANVAS_RENDERER - * @protected - * @static - */ -PIXI.CANVAS_RENDERER = 1; - -/** - * Version of pixi that is loaded. - * @property {String} VERSION - * @static - */ -PIXI.VERSION = "v2.2.7"; - -/** - * Various blend modes supported by pixi. IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes. - * @property {Object} blendModes - * @property {Number} blendModes.NORMAL - * @property {Number} blendModes.ADD - * @property {Number} blendModes.MULTIPLY - * @property {Number} blendModes.SCREEN - * @property {Number} blendModes.OVERLAY - * @property {Number} blendModes.DARKEN - * @property {Number} blendModes.LIGHTEN - * @property {Number} blendModes.COLOR_DODGE - * @property {Number} blendModes.COLOR_BURN - * @property {Number} blendModes.HARD_LIGHT - * @property {Number} blendModes.SOFT_LIGHT - * @property {Number} blendModes.DIFFERENCE - * @property {Number} blendModes.EXCLUSION - * @property {Number} blendModes.HUE - * @property {Number} blendModes.SATURATION - * @property {Number} blendModes.COLOR - * @property {Number} blendModes.LUMINOSITY - * @static - */ -PIXI.blendModes = { - NORMAL:0, - ADD:1, - MULTIPLY:2, - SCREEN:3, - OVERLAY:4, - DARKEN:5, - LIGHTEN:6, - COLOR_DODGE:7, - COLOR_BURN:8, - HARD_LIGHT:9, - SOFT_LIGHT:10, - DIFFERENCE:11, - EXCLUSION:12, - HUE:13, - SATURATION:14, - COLOR:15, - LUMINOSITY:16 -}; - -/** - * The scale modes that are supported by pixi. - * - * The DEFAULT scale mode affects the default scaling mode of future operations. - * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. - * - * @property {Object} scaleModes - * @property {Number} scaleModes.DEFAULT=LINEAR - * @property {Number} scaleModes.LINEAR Smooth scaling - * @property {Number} scaleModes.NEAREST Pixelating scaling - * @static - */ -PIXI.scaleModes = { - DEFAULT:0, - LINEAR:0, - NEAREST:1 -}; - -// used to create uids for various pixi objects.. -PIXI._UID = 0; - -if(typeof(Float32Array) != 'undefined') -{ - PIXI.Float32Array = Float32Array; - PIXI.Uint16Array = Uint16Array; - - // Uint32Array and ArrayBuffer only used by WebGL renderer - // We can suppose that if WebGL is supported then typed arrays are supported too - // as they predate WebGL support for all browsers: - // see typed arrays support: http://caniuse.com/#search=TypedArrays - // see WebGL support: http://caniuse.com/#search=WebGL - PIXI.Uint32Array = Uint32Array; - PIXI.ArrayBuffer = ArrayBuffer; -} -else -{ - PIXI.Float32Array = Array; - PIXI.Uint16Array = Array; -} - -// interaction frequency -PIXI.INTERACTION_FREQUENCY = 30; -PIXI.AUTO_PREVENT_DEFAULT = true; - -/** - * @property {Number} PI_2 - * @static - */ -PIXI.PI_2 = Math.PI * 2; - -/** - * @property {Number} RAD_TO_DEG - * @static - */ -PIXI.RAD_TO_DEG = 180 / Math.PI; - -/** - * @property {Number} DEG_TO_RAD - * @static - */ -PIXI.DEG_TO_RAD = Math.PI / 180; - -/** - * @property {String} RETINA_PREFIX - * @protected - * @static - */ -PIXI.RETINA_PREFIX = "@2x"; -//PIXI.SCALE_PREFIX "@x%%"; - -/** - * If true the default pixi startup (console) banner message will be suppressed. - * - * @property {Boolean} dontSayHello - * @default false - * @static - */ -PIXI.dontSayHello = false; - -/** - * The default render options if none are supplied to - * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. - * - * @property {Object} defaultRenderOptions - * @property {Object} defaultRenderOptions.view=null - * @property {Boolean} defaultRenderOptions.transparent=false - * @property {Boolean} defaultRenderOptions.antialias=false - * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false - * @property {Number} defaultRenderOptions.resolution=1 - * @property {Boolean} defaultRenderOptions.clearBeforeRender=true - * @property {Boolean} defaultRenderOptions.autoResize=false - * @static - */ -PIXI.defaultRenderOptions = { - view:null, - transparent:false, - antialias:false, - preserveDrawingBuffer:false, - resolution:1, - clearBeforeRender:true, - autoResize:false -} - -PIXI.sayHello = function (type) -{ - if(PIXI.dontSayHello)return; - - if ( navigator.userAgent.toLowerCase().indexOf('chrome') > -1 ) - { - var args = [ - '%c %c %c Pixi.js ' + PIXI.VERSION + ' - ' + type + ' %c ' + ' %c ' + ' http://www.pixijs.com/ %c %c ♥%c♥%c♥ ', - 'background: #ff66a5', - 'background: #ff66a5', - 'color: #ff66a5; background: #030307;', - 'background: #ff66a5', - 'background: #ffc3dc', - 'background: #ff66a5', - 'color: #ff2424; background: #fff', - 'color: #ff2424; background: #fff', - 'color: #ff2424; background: #fff' - ]; - - console.log.apply(console, args); - } - else if (window['console']) - { - console.log('Pixi.js ' + PIXI.VERSION + ' - http://www.pixijs.com/'); - } - - PIXI.dontSayHello = true; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis. - * - * @class Point - * @constructor - * @param x {Number} position of the point on the x axis - * @param y {Number} position of the point on the y axis - */ -PIXI.Point = function(x, y) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; -}; - -/** - * Creates a clone of this point - * - * @method clone - * @return {Point} a copy of the point - */ -PIXI.Point.prototype.clone = function() -{ - return new PIXI.Point(this.x, this.y); -}; - -/** - * Sets the point to a new x and y position. - * If y is omitted, both x and y will be set to x. - * - * @method set - * @param [x=0] {Number} position of the point on the x axis - * @param [y=0] {Number} position of the point on the y axis - */ -PIXI.Point.prototype.set = function(x, y) -{ - this.x = x || 0; - this.y = y || ( (y !== 0) ? this.x : 0 ) ; -}; - -// constructor -PIXI.Point.prototype.constructor = PIXI.Point; -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height. - * - * @class Rectangle - * @constructor - * @param x {Number} The X coordinate of the upper-left corner of the rectangle - * @param y {Number} The Y coordinate of the upper-left corner of the rectangle - * @param width {Number} The overall width of this rectangle - * @param height {Number} The overall height of this rectangle - */ -PIXI.Rectangle = function(x, y, width, height) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RECT in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Rectangle - * - * @method clone - * @return {Rectangle} a copy of the rectangle - */ -PIXI.Rectangle.prototype.clone = function() -{ - return new PIXI.Rectangle(this.x, this.y, this.width, this.height); -}; - -/** - * Checks whether the x and y coordinates given are contained within this Rectangle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Rectangle - */ -PIXI.Rectangle.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - var x1 = this.x; - if(x >= x1 && x <= x1 + this.width) - { - var y1 = this.y; - - if(y >= y1 && y <= y1 + this.height) - { - return true; - } - } - - return false; -}; - -// constructor -PIXI.Rectangle.prototype.constructor = PIXI.Rectangle; - -PIXI.EmptyRectangle = new PIXI.Rectangle(0,0,0,0); -/** - * @author Adrien Brault - */ - -/** - * @class Polygon - * @constructor - * @param points* {Array(Point)|Array(Number)|Point...|Number...} This can be an array of Points that form the polygon, - * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be - * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the - * arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are - * Numbers. - */ -PIXI.Polygon = function(points) -{ - //if points isn't an array, use arguments as the array - if(!(points instanceof Array))points = Array.prototype.slice.call(arguments); - - //if this is a flat array of numbers, convert it to points - if(points[0] instanceof PIXI.Point) - { - var p = []; - for(var i = 0, il = points.length; i < il; i++) - { - p.push(points[i].x, points[i].y); - } - - points = p; - } - - this.closed = true; - - /** - * An array of the points of this polygon - * @property points - * @type Array(Point)|Array(Number) - * - */ - this.points = points; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.POLY in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this polygon - * - * @method clone - * @return {Polygon} a copy of the polygon - */ -PIXI.Polygon.prototype.clone = function() -{ - var points = this.points.slice(); - return new PIXI.Polygon(points); -}; - -/** - * Checks whether the x and y coordinates passed to this function are contained within this polygon - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this polygon - */ -PIXI.Polygon.prototype.contains = function(x, y) -{ - var inside = false; - - // use some raycasting to test hits - // https://github.com/substack/point-in-polygon/blob/master/index.js - var length = this.points.length / 2; - - for(var i = 0, j = length - 1; i < length; j = i++) - { - var xi = this.points[i * 2], yi = this.points[i * 2 + 1], - xj = this.points[j * 2], yj = this.points[j * 2 + 1], - intersect = ((yi > y) !== (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi); - - if(intersect) inside = !inside; - } - - return inside; -}; - -// constructor -PIXI.Polygon.prototype.constructor = PIXI.Polygon; - -/** - * @author Chad Engler - */ - -/** - * The Circle object can be used to specify a hit area for displayObjects - * - * @class Circle - * @constructor - * @param x {Number} The X coordinate of the center of this circle - * @param y {Number} The Y coordinate of the center of this circle - * @param radius {Number} The radius of the circle - */ -PIXI.Circle = function(x, y, radius) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property radius - * @type Number - * @default 0 - */ - this.radius = radius || 0; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.CIRC in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Circle instance - * - * @method clone - * @return {Circle} a copy of the Circle - */ -PIXI.Circle.prototype.clone = function() -{ - return new PIXI.Circle(this.x, this.y, this.radius); -}; - -/** - * Checks whether the x and y coordinates given are contained within this circle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Circle - */ -PIXI.Circle.prototype.contains = function(x, y) -{ - if(this.radius <= 0) - return false; - - var dx = (this.x - x), - dy = (this.y - y), - r2 = this.radius * this.radius; - - dx *= dx; - dy *= dy; - - return (dx + dy <= r2); -}; - -/** -* Returns the framing rectangle of the circle as a PIXI.Rectangle object -* -* @method getBounds -* @return {Rectangle} the framing rectangle -*/ -PIXI.Circle.prototype.getBounds = function() -{ - return new PIXI.Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2); -}; - -// constructor -PIXI.Circle.prototype.constructor = PIXI.Circle; - -/** - * @author Chad Engler - */ - -/** - * The Ellipse object can be used to specify a hit area for displayObjects - * - * @class Ellipse - * @constructor - * @param x {Number} The X coordinate of the center of the ellipse - * @param y {Number} The Y coordinate of the center of the ellipse - * @param width {Number} The half width of this ellipse - * @param height {Number} The half height of this ellipse - */ -PIXI.Ellipse = function(x, y, width, height) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.ELIP in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Ellipse instance - * - * @method clone - * @return {Ellipse} a copy of the ellipse - */ -PIXI.Ellipse.prototype.clone = function() -{ - return new PIXI.Ellipse(this.x, this.y, this.width, this.height); -}; - -/** - * Checks whether the x and y coordinates given are contained within this ellipse - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coords are within this ellipse - */ -PIXI.Ellipse.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - //normalize the coords to an ellipse with center 0,0 - var normx = ((x - this.x) / this.width), - normy = ((y - this.y) / this.height); - - normx *= normx; - normy *= normy; - - return (normx + normy <= 1); -}; - -/** -* Returns the framing rectangle of the ellipse as a PIXI.Rectangle object -* -* @method getBounds -* @return {Rectangle} the framing rectangle -*/ -PIXI.Ellipse.prototype.getBounds = function() -{ - return new PIXI.Rectangle(this.x - this.width, this.y - this.height, this.width, this.height); -}; - -// constructor -PIXI.Ellipse.prototype.constructor = PIXI.Ellipse; - -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * The Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height. - * - * @class RoundedRectangle - * @constructor - * @param x {Number} The X coordinate of the upper-left corner of the rounded rectangle - * @param y {Number} The Y coordinate of the upper-left corner of the rounded rectangle - * @param width {Number} The overall width of this rounded rectangle - * @param height {Number} The overall height of this rounded rectangle - * @param radius {Number} Controls the radius of the rounded corners - */ -PIXI.RoundedRectangle = function(x, y, width, height, radius) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - /** - * @property radius - * @type Number - * @default 20 - */ - this.radius = radius || 20; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RRECT in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Rounded Rectangle - * - * @method clone - * @return {RoundedRectangle} a copy of the rounded rectangle - */ -PIXI.RoundedRectangle.prototype.clone = function() -{ - return new PIXI.RoundedRectangle(this.x, this.y, this.width, this.height, this.radius); -}; - -/** - * Checks whether the x and y coordinates given are contained within this Rounded Rectangle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Rounded Rectangle - */ -PIXI.RoundedRectangle.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - var x1 = this.x; - if(x >= x1 && x <= x1 + this.width) - { - var y1 = this.y; - - if(y >= y1 && y <= y1 + this.height) - { - return true; - } - } - - return false; -}; - -// constructor -PIXI.RoundedRectangle.prototype.constructor = PIXI.RoundedRectangle; - - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Matrix class is now an object, which makes it a lot faster, - * here is a representation of it : - * | a | b | tx| - * | c | d | ty| - * | 0 | 0 | 1 | - * - * @class Matrix - * @constructor - */ -PIXI.Matrix = function() -{ - /** - * @property a - * @type Number - * @default 1 - */ - this.a = 1; - - /** - * @property b - * @type Number - * @default 0 - */ - this.b = 0; - - /** - * @property c - * @type Number - * @default 0 - */ - this.c = 0; - - /** - * @property d - * @type Number - * @default 1 - */ - this.d = 1; - - /** - * @property tx - * @type Number - * @default 0 - */ - this.tx = 0; - - /** - * @property ty - * @type Number - * @default 0 - */ - this.ty = 0; -}; - -/** - * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows: - * - * a = array[0] - * b = array[1] - * c = array[3] - * d = array[4] - * tx = array[2] - * ty = array[5] - * - * @method fromArray - * @param array {Array} The array that the matrix will be populated from. - */ -PIXI.Matrix.prototype.fromArray = function(array) -{ - this.a = array[0]; - this.b = array[1]; - this.c = array[3]; - this.d = array[4]; - this.tx = array[2]; - this.ty = array[5]; -}; - -/** - * Creates an array from the current Matrix object. - * - * @method toArray - * @param transpose {Boolean} Whether we need to transpose the matrix or not - * @return {Array} the newly created array which contains the matrix - */ -PIXI.Matrix.prototype.toArray = function(transpose) -{ - if(!this.array) this.array = new PIXI.Float32Array(9); - var array = this.array; - - if(transpose) - { - array[0] = this.a; - array[1] = this.b; - array[2] = 0; - array[3] = this.c; - array[4] = this.d; - array[5] = 0; - array[6] = this.tx; - array[7] = this.ty; - array[8] = 1; - } - else - { - array[0] = this.a; - array[1] = this.c; - array[2] = this.tx; - array[3] = this.b; - array[4] = this.d; - array[5] = this.ty; - array[6] = 0; - array[7] = 0; - array[8] = 1; - } - - return array; -}; - -/** - * Get a new position with the current transformation applied. - * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) - * - * @method apply - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix - */ -PIXI.Matrix.prototype.apply = function(pos, newPos) -{ - newPos = newPos || new PIXI.Point(); - - newPos.x = this.a * pos.x + this.c * pos.y + this.tx; - newPos.y = this.b * pos.x + this.d * pos.y + this.ty; - - return newPos; -}; - -/** - * Get a new position with the inverse of the current transformation applied. - * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) - * - * @method applyInverse - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix - */ -PIXI.Matrix.prototype.applyInverse = function(pos, newPos) -{ - newPos = newPos || new PIXI.Point(); - - var id = 1 / (this.a * this.d + this.c * -this.b); - - newPos.x = this.d * id * pos.x + -this.c * id * pos.y + (this.ty * this.c - this.tx * this.d) * id; - newPos.y = this.a * id * pos.y + -this.b * id * pos.x + (-this.ty * this.a + this.tx * this.b) * id; - - return newPos; -}; - -/** - * Translates the matrix on the x and y. - * - * @method translate - * @param {Number} x - * @param {Number} y - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.translate = function(x, y) -{ - this.tx += x; - this.ty += y; - - return this; -}; - -/** - * Applies a scale transformation to the matrix. - * - * @method scale - * @param {Number} x The amount to scale horizontally - * @param {Number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.scale = function(x, y) -{ - this.a *= x; - this.d *= y; - this.c *= x; - this.b *= y; - this.tx *= x; - this.ty *= y; - - return this; -}; - - -/** - * Applies a rotation transformation to the matrix. - * @method rotate - * @param {Number} angle The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.rotate = function(angle) -{ - var cos = Math.cos( angle ); - var sin = Math.sin( angle ); - - var a1 = this.a; - var c1 = this.c; - var tx1 = this.tx; - - this.a = a1 * cos-this.b * sin; - this.b = a1 * sin+this.b * cos; - this.c = c1 * cos-this.d * sin; - this.d = c1 * sin+this.d * cos; - this.tx = tx1 * cos - this.ty * sin; - this.ty = tx1 * sin + this.ty * cos; - - return this; -}; - -/** - * Appends the given Matrix to this Matrix. - * - * @method append - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. - */ -PIXI.Matrix.prototype.append = function(matrix) -{ - var a1 = this.a; - var b1 = this.b; - var c1 = this.c; - var d1 = this.d; - - this.a = matrix.a * a1 + matrix.b * c1; - this.b = matrix.a * b1 + matrix.b * d1; - this.c = matrix.c * a1 + matrix.d * c1; - this.d = matrix.c * b1 + matrix.d * d1; - - this.tx = matrix.tx * a1 + matrix.ty * c1 + this.tx; - this.ty = matrix.tx * b1 + matrix.ty * d1 + this.ty; - - return this; -}; - -/** - * Resets this Matix to an identity (default) matrix. - * - * @method identity - * @return {Matrix} This matrix. Good for chaining method calls. - */ -PIXI.Matrix.prototype.identity = function() -{ - this.a = 1; - this.b = 0; - this.c = 0; - this.d = 1; - this.tx = 0; - this.ty = 0; - - return this; -}; - -PIXI.identityMatrix = new PIXI.Matrix(); - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The base class for all objects that are rendered on the screen. - * This is an abstract class and should not be used on its own rather it should be extended. - * - * @class DisplayObject - * @constructor - */ -PIXI.DisplayObject = function() -{ - /** - * The coordinate of the object relative to the local coordinates of the parent. - * - * @property position - * @type Point - */ - this.position = new PIXI.Point(); - - /** - * The scale factor of the object. - * - * @property scale - * @type Point - */ - this.scale = new PIXI.Point(1,1);//{x:1, y:1}; - - /** - * The pivot point of the displayObject that it rotates around - * - * @property pivot - * @type Point - */ - this.pivot = new PIXI.Point(0,0); - - /** - * The rotation of the object in radians. - * - * @property rotation - * @type Number - */ - this.rotation = 0; - - /** - * The opacity of the object. - * - * @property alpha - * @type Number - */ - this.alpha = 1; - - /** - * The visibility of the object. - * - * @property visible - * @type Boolean - */ - this.visible = true; - - /** - * This is the defined area that will pick up mouse / touch events. It is null by default. - * Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children) - * - * @property hitArea - * @type Rectangle|Circle|Ellipse|Polygon - */ - this.hitArea = null; - - /** - * This is used to indicate if the displayObject should display a mouse hand cursor on rollover - * - * @property buttonMode - * @type Boolean - */ - this.buttonMode = false; - - /** - * Can this object be rendered - * - * @property renderable - * @type Boolean - */ - this.renderable = false; - - /** - * [read-only] The display object container that contains this display object. - * - * @property parent - * @type DisplayObjectContainer - * @readOnly - */ - this.parent = null; - - /** - * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage. - * - * @property stage - * @type Stage - * @readOnly - */ - this.stage = null; - - /** - * [read-only] The multiplied alpha of the displayObject - * - * @property worldAlpha - * @type Number - * @readOnly - */ - this.worldAlpha = 1; - - /** - * [read-only] Whether or not the object is interactive, do not toggle directly! use the `interactive` property - * - * @property _interactive - * @type Boolean - * @readOnly - * @private - */ - this._interactive = false; - - /** - * This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true - * - * @property defaultCursor - * @type String - * - */ - this.defaultCursor = 'pointer'; - - /** - * [read-only] Current transform of the object based on world (parent) factors - * - * @property worldTransform - * @type Matrix - * @readOnly - * @private - */ - this.worldTransform = new PIXI.Matrix(); - - /** - * cached sin rotation and cos rotation - * - * @property _sr - * @type Number - * @private - */ - this._sr = 0; - - /** - * cached sin rotation and cos rotation - * - * @property _cr - * @type Number - * @private - */ - this._cr = 1; - - /** - * The area the filter is applied to like the hitArea this is used as more of an optimisation - * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle - * - * @property filterArea - * @type Rectangle - */ - this.filterArea = null;//new PIXI.Rectangle(0,0,1,1); - - /** - * The original, cached bounds of the object - * - * @property _bounds - * @type Rectangle - * @private - */ - this._bounds = new PIXI.Rectangle(0, 0, 1, 1); - - /** - * The most up-to-date bounds of the object - * - * @property _currentBounds - * @type Rectangle - * @private - */ - this._currentBounds = null; - - /** - * The original, cached mask of the object - * - * @property _currentBounds - * @type Rectangle - * @private - */ - this._mask = null; - - /** - * Cached internal flag. - * - * @property _cacheAsBitmap - * @type Boolean - * @private - */ - this._cacheAsBitmap = false; - - /** - * Cached internal flag. - * - * @property _cacheIsDirty - * @type Boolean - * @private - */ - this._cacheIsDirty = false; - - - /* - * MOUSE Callbacks - */ - - /** - * A callback that is used when the users mouse rolls over the displayObject - * @method mouseover - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the users mouse leaves the displayObject - * @method mouseout - * @param interactionData {InteractionData} - */ - - //Left button - /** - * A callback that is used when the users clicks on the displayObject with their mouse's left button - * @method click - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user clicks the mouse's left button down over the sprite - * @method mousedown - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's left button that was over the displayObject - * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject - * @method mouseup - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject - * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject - * @method mouseupoutside - * @param interactionData {InteractionData} - */ - - //Right button - /** - * A callback that is used when the users clicks on the displayObject with their mouse's right button - * @method rightclick - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user clicks the mouse's right button down over the sprite - * @method rightdown - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's right button that was over the displayObject - * for this callback to be fired the mouse's right button must have been pressed down over the displayObject - * @method rightup - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject - * for this callback to be fired, the mouse's right button must have been pressed down over the displayObject - * @method rightupoutside - * @param interactionData {InteractionData} - */ - - /* - * TOUCH Callbacks - */ - - /** - * A callback that is used when the users taps on the sprite with their finger - * basically a touch version of click - * @method tap - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user touches over the displayObject - * @method touchstart - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases a touch over the displayObject - * @method touchend - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the touch that was over the displayObject - * for this callback to be fired, The touch must have started over the sprite - * @method touchendoutside - * @param interactionData {InteractionData} - */ -}; - -// constructor -PIXI.DisplayObject.prototype.constructor = PIXI.DisplayObject; - -/** - * Indicates if the sprite will have touch and mouse interactivity. It is false by default - * - * @property interactive - * @type Boolean - * @default false - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'interactive', { - get: function() { - return this._interactive; - }, - set: function(value) { - this._interactive = value; - - // TODO more to be done here.. - // need to sort out a re-crawl! - if(this.stage)this.stage.dirty = true; - } -}); - -/** - * [read-only] Indicates if the sprite is globally visible. - * - * @property worldVisible - * @type Boolean - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'worldVisible', { - get: function() { - var item = this; - - do - { - if(!item.visible)return false; - item = item.parent; - } - while(item); - - return true; - } -}); - -/** - * Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. - * In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. - * To remove a mask, set this property to null. - * - * @property mask - * @type Graphics - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'mask', { - get: function() { - return this._mask; - }, - set: function(value) { - - if(this._mask)this._mask.isMask = false; - this._mask = value; - if(this._mask)this._mask.isMask = true; - } -}); - -/** - * Sets the filters for the displayObject. - * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. - * To remove filters simply set this property to 'null' - * @property filters - * @type Array(Filter) - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { - - get: function() { - return this._filters; - }, - - set: function(value) { - - if(value) - { - // now put all the passes in one place.. - var passes = []; - for (var i = 0; i < value.length; i++) - { - var filterPasses = value[i].passes; - for (var j = 0; j < filterPasses.length; j++) - { - passes.push(filterPasses[j]); - } - } - - // TODO change this as it is legacy - this._filterBlock = {target:this, filterPasses:passes}; - } - - this._filters = value; - } -}); - -/** - * Set if this display object is cached as a bitmap. - * This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. - * To remove simply set this property to 'null' - * @property cacheAsBitmap - * @type Boolean - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'cacheAsBitmap', { - - get: function() { - return this._cacheAsBitmap; - }, - - set: function(value) { - - if(this._cacheAsBitmap === value)return; - - if(value) - { - this._generateCachedSprite(); - } - else - { - this._destroyCachedSprite(); - } - - this._cacheAsBitmap = value; - } -}); - -/* - * Updates the object transform for rendering - * - * @method updateTransform - * @private - */ -PIXI.DisplayObject.prototype.updateTransform = function() -{ - // create some matrix refs for easy access - var pt = this.parent.worldTransform; - var wt = this.worldTransform; - - // temporary matrix variables - var a, b, c, d, tx, ty; - - // so if rotation is between 0 then we can simplify the multiplication process.. - if(this.rotation % PIXI.PI_2) - { - // check to see if the rotation is the same as the previous render. This means we only need to use sin and cos when rotation actually changes - if(this.rotation !== this.rotationCache) - { - this.rotationCache = this.rotation; - this._sr = Math.sin(this.rotation); - this._cr = Math.cos(this.rotation); - } - - // get the matrix values of the displayobject based on its transform properties.. - a = this._cr * this.scale.x; - b = this._sr * this.scale.x; - c = -this._sr * this.scale.y; - d = this._cr * this.scale.y; - tx = this.position.x; - ty = this.position.y; - - // check for pivot.. not often used so geared towards that fact! - if(this.pivot.x || this.pivot.y) - { - tx -= this.pivot.x * a + this.pivot.y * c; - ty -= this.pivot.x * b + this.pivot.y * d; - } - - // concat the parent matrix with the objects transform. - wt.a = a * pt.a + b * pt.c; - wt.b = a * pt.b + b * pt.d; - wt.c = c * pt.a + d * pt.c; - wt.d = c * pt.b + d * pt.d; - wt.tx = tx * pt.a + ty * pt.c + pt.tx; - wt.ty = tx * pt.b + ty * pt.d + pt.ty; - - - } - else - { - // lets do the fast version as we know there is no rotation.. - a = this.scale.x; - d = this.scale.y; - - tx = this.position.x - this.pivot.x * a; - ty = this.position.y - this.pivot.y * d; - - wt.a = a * pt.a; - wt.b = a * pt.b; - wt.c = d * pt.c; - wt.d = d * pt.d; - wt.tx = tx * pt.a + ty * pt.c + pt.tx; - wt.ty = tx * pt.b + ty * pt.d + pt.ty; - } - - // multiply the alphas.. - this.worldAlpha = this.alpha * this.parent.worldAlpha; -}; - -// performance increase to avoid using call.. (10x faster) -PIXI.DisplayObject.prototype.displayObjectUpdateTransform = PIXI.DisplayObject.prototype.updateTransform; - -/** - * Retrieves the bounds of the displayObject as a rectangle object - * - * @method getBounds - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area - */ -PIXI.DisplayObject.prototype.getBounds = function(matrix) -{ - matrix = matrix;//just to get passed js hinting (and preserve inheritance) - return PIXI.EmptyRectangle; -}; - -/** - * Retrieves the local bounds of the displayObject as a rectangle object - * - * @method getLocalBounds - * @return {Rectangle} the rectangular bounding area - */ -PIXI.DisplayObject.prototype.getLocalBounds = function() -{ - return this.getBounds(PIXI.identityMatrix);///PIXI.EmptyRectangle(); -}; - -/** - * Sets the object's stage reference, the stage this object is connected to - * - * @method setStageReference - * @param stage {Stage} the stage that the object will have as its current stage reference - */ -PIXI.DisplayObject.prototype.setStageReference = function(stage) -{ - this.stage = stage; - if(this._interactive)this.stage.dirty = true; -}; - -/** - * Useful function that returns a texture of the displayObject object that can then be used to create sprites - * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. - * - * @method generateTexture - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @return {Texture} a texture of the graphics object - */ -PIXI.DisplayObject.prototype.generateTexture = function(resolution, scaleMode, renderer) -{ - var bounds = this.getLocalBounds(); - - var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0, renderer, scaleMode, resolution); - - PIXI.DisplayObject._tempMatrix.tx = -bounds.x; - PIXI.DisplayObject._tempMatrix.ty = -bounds.y; - - renderTexture.render(this, PIXI.DisplayObject._tempMatrix); - - return renderTexture; -}; - -/** - * Generates and updates the cached sprite for this object. - * - * @method updateCache - */ -PIXI.DisplayObject.prototype.updateCache = function() -{ - this._generateCachedSprite(); -}; - -/** - * Calculates the global position of the display object - * - * @method toGlobal - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object - */ -PIXI.DisplayObject.prototype.toGlobal = function(position) -{ - // don't need to u[date the lot - this.displayObjectUpdateTransform(); - return this.worldTransform.apply(position); -}; - -/** - * Calculates the local position of the display object relative to another point - * - * @method toLocal - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object - */ -PIXI.DisplayObject.prototype.toLocal = function(position, from) -{ - // - if (from) - { - position = from.toGlobal(position); - } - - // don't need to u[date the lot - this.displayObjectUpdateTransform(); - return this.worldTransform.applyInverse(position); -}; - -/** - * Internal method. - * - * @method _renderCachedSprite - * @param renderSession {Object} The render session - * @private - */ -PIXI.DisplayObject.prototype._renderCachedSprite = function(renderSession) -{ - this._cachedSprite.worldAlpha = this.worldAlpha; - - if(renderSession.gl) - { - PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession); - } - else - { - PIXI.Sprite.prototype._renderCanvas.call(this._cachedSprite, renderSession); - } -}; - -/** - * Internal method. - * - * @method _generateCachedSprite - * @private - */ -PIXI.DisplayObject.prototype._generateCachedSprite = function() -{ - this._cacheAsBitmap = false; - var bounds = this.getLocalBounds(); - - if(!this._cachedSprite) - { - var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0);//, renderSession.renderer); - - this._cachedSprite = new PIXI.Sprite(renderTexture); - this._cachedSprite.worldTransform = this.worldTransform; - } - else - { - this._cachedSprite.texture.resize(bounds.width | 0, bounds.height | 0); - } - - //REMOVE filter! - var tempFilters = this._filters; - this._filters = null; - - this._cachedSprite.filters = tempFilters; - - PIXI.DisplayObject._tempMatrix.tx = -bounds.x; - PIXI.DisplayObject._tempMatrix.ty = -bounds.y; - - this._cachedSprite.texture.render(this, PIXI.DisplayObject._tempMatrix, true); - - this._cachedSprite.anchor.x = -( bounds.x / bounds.width ); - this._cachedSprite.anchor.y = -( bounds.y / bounds.height ); - - this._filters = tempFilters; - - this._cacheAsBitmap = true; -}; - -/** -* Destroys the cached sprite. -* -* @method _destroyCachedSprite -* @private -*/ -PIXI.DisplayObject.prototype._destroyCachedSprite = function() -{ - if(!this._cachedSprite)return; - - this._cachedSprite.texture.destroy(true); - - // TODO could be object pooled! - this._cachedSprite = null; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.DisplayObject.prototype._renderWebGL = function(renderSession) -{ - // OVERWRITE; - // this line is just here to pass jshinting :) - renderSession = renderSession; -}; - -/** -* Renders the object using the Canvas renderer -* -* @method _renderCanvas -* @param renderSession {RenderSession} -* @private -*/ -PIXI.DisplayObject.prototype._renderCanvas = function(renderSession) -{ - // OVERWRITE; - // this line is just here to pass jshinting :) - renderSession = renderSession; -}; - - -PIXI.DisplayObject._tempMatrix = new PIXI.Matrix(); - -/** - * The position of the displayObject on the x axis relative to the local coordinates of the parent. - * - * @property x - * @type Number - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'x', { - get: function() { - return this.position.x; - }, - set: function(value) { - this.position.x = value; - } -}); - -/** - * The position of the displayObject on the y axis relative to the local coordinates of the parent. - * - * @property y - * @type Number - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'y', { - get: function() { - return this.position.y; - }, - set: function(value) { - this.position.y = value; - } -}); - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A DisplayObjectContainer represents a collection of display objects. - * It is the base class of all display objects that act as a container for other objects. - * - * @class DisplayObjectContainer - * @extends DisplayObject - * @constructor - */ -PIXI.DisplayObjectContainer = function() -{ - PIXI.DisplayObject.call( this ); - - /** - * [read-only] The array of children of this container. - * - * @property children - * @type Array(DisplayObject) - * @readOnly - */ - this.children = []; - - // fast access to update transform.. - -}; - -// constructor -PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); -PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer; - - -/** - * The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', { - get: function() { - return this.scale.x * this.getLocalBounds().width; - }, - set: function(value) { - - var width = this.getLocalBounds().width; - - if(width !== 0) - { - this.scale.x = value / width; - } - else - { - this.scale.x = 1; - } - - - this._width = value; - } -}); - -/** - * The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', { - get: function() { - return this.scale.y * this.getLocalBounds().height; - }, - set: function(value) { - - var height = this.getLocalBounds().height; - - if(height !== 0) - { - this.scale.y = value / height ; - } - else - { - this.scale.y = 1; - } - - this._height = value; - } -}); - -/** - * Adds a child to the container. - * - * @method addChild - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. - */ -PIXI.DisplayObjectContainer.prototype.addChild = function(child) -{ - return this.addChildAt(child, this.children.length); -}; - -/** - * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown - * - * @method addChildAt - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. - */ -PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) -{ - if(index >= 0 && index <= this.children.length) - { - if(child.parent) - { - child.parent.removeChild(child); - } - - child.parent = this; - - this.children.splice(index, 0, child); - - if(this.stage)child.setStageReference(this.stage); - - return child; - } - else - { - throw new Error(child + 'addChildAt: The index '+ index +' supplied is out of bounds ' + this.children.length); - } -}; - -/** - * Swaps the position of 2 Display Objects within this container. - * - * @method swapChildren - * @param child {DisplayObject} - * @param child2 {DisplayObject} - */ -PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2) -{ - if(child === child2) { - return; - } - - var index1 = this.getChildIndex(child); - var index2 = this.getChildIndex(child2); - - if(index1 < 0 || index2 < 0) { - throw new Error('swapChildren: Both the supplied DisplayObjects must be a child of the caller.'); - } - - this.children[index1] = child2; - this.children[index2] = child; - -}; - -/** - * Returns the index position of a child DisplayObject instance - * - * @method getChildIndex - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify - */ -PIXI.DisplayObjectContainer.prototype.getChildIndex = function(child) -{ - var index = this.children.indexOf(child); - if (index === -1) - { - throw new Error('The supplied DisplayObject must be a child of the caller'); - } - return index; -}; - -/** - * Changes the position of an existing child in the display object container - * - * @method setChildIndex - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object - */ -PIXI.DisplayObjectContainer.prototype.setChildIndex = function(child, index) -{ - if (index < 0 || index >= this.children.length) - { - throw new Error('The supplied index is out of bounds'); - } - var currentIndex = this.getChildIndex(child); - this.children.splice(currentIndex, 1); //remove from old position - this.children.splice(index, 0, child); //add at new position -}; - -/** - * Returns the child at the specified index - * - * @method getChildAt - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child at the given index, if any. - */ -PIXI.DisplayObjectContainer.prototype.getChildAt = function(index) -{ - if (index < 0 || index >= this.children.length) - { - throw new Error('getChildAt: Supplied index '+ index +' does not exist in the child list, or the supplied DisplayObject must be a child of the caller'); - } - return this.children[index]; - -}; - -/** - * Removes a child from the container. - * - * @method removeChild - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. - */ -PIXI.DisplayObjectContainer.prototype.removeChild = function(child) -{ - var index = this.children.indexOf( child ); - if(index === -1)return; - - return this.removeChildAt( index ); -}; - -/** - * Removes a child from the specified index position. - * - * @method removeChildAt - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. - */ -PIXI.DisplayObjectContainer.prototype.removeChildAt = function(index) -{ - var child = this.getChildAt( index ); - if(this.stage) - child.removeStageReference(); - - child.parent = undefined; - this.children.splice( index, 1 ); - return child; -}; - -/** -* Removes all children from this container that are within the begin and end indexes. -* -* @method removeChildren -* @param beginIndex {Number} The beginning position. Default value is 0. -* @param endIndex {Number} The ending position. Default value is size of the container. -*/ -PIXI.DisplayObjectContainer.prototype.removeChildren = function(beginIndex, endIndex) -{ - var begin = beginIndex || 0; - var end = typeof endIndex === 'number' ? endIndex : this.children.length; - var range = end - begin; - - if (range > 0 && range <= end) - { - var removed = this.children.splice(begin, range); - for (var i = 0; i < removed.length; i++) { - var child = removed[i]; - if(this.stage) - child.removeStageReference(); - child.parent = undefined; - } - return removed; - } - else if (range === 0 && this.children.length === 0) - { - return []; - } - else - { - throw new Error( 'removeChildren: Range Error, numeric values are outside the acceptable range' ); - } -}; - -/* - * Updates the transform on all children of this container for rendering - * - * @method updateTransform - * @private - */ -PIXI.DisplayObjectContainer.prototype.updateTransform = function() -{ - if(!this.visible)return; - - this.displayObjectUpdateTransform(); - - //PIXI.DisplayObject.prototype.updateTransform.call( this ); - - if(this._cacheAsBitmap)return; - - for(var i=0,j=this.children.length; i childMaxX ? maxX : childMaxX; - maxY = maxY > childMaxY ? maxY : childMaxY; - } - - if(!childVisible) - return PIXI.EmptyRectangle; - - var bounds = this._bounds; - - bounds.x = minX; - bounds.y = minY; - bounds.width = maxX - minX; - bounds.height = maxY - minY; - - // TODO: store a reference so that if this function gets called again in the render cycle we do not have to recalculate - //this._currentBounds = bounds; - - return bounds; -}; - -/** - * Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration. - * - * @method getLocalBounds - * @return {Rectangle} The rectangular bounding area - */ -PIXI.DisplayObjectContainer.prototype.getLocalBounds = function() -{ - var matrixCache = this.worldTransform; - - this.worldTransform = PIXI.identityMatrix; - - for(var i=0,j=this.children.length; i maxX ? x1 : maxX; - maxX = x2 > maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y1 > maxY ? y1 : maxY; - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - } - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Sprite.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(!this.visible || this.alpha <= 0)return; - - var i,j; - - // do a quick check to see if this element has a mask or a filter. - if(this._mask || this._filters) - { - var spriteBatch = renderSession.spriteBatch; - - // push filter first as we need to ensure the stencil buffer is correct for any masking - if(this._filters) - { - spriteBatch.flush(); - renderSession.filterManager.pushFilter(this._filterBlock); - } - - if(this._mask) - { - spriteBatch.stop(); - renderSession.maskManager.pushMask(this.mask, renderSession); - spriteBatch.start(); - } - - // add this sprite to the batch - spriteBatch.render(this); - - // now loop through the children and make sure they get rendered - for(i=0,j=this.children.length; i= this.textures.length) - { - this.gotoAndStop(this.textures.length - 1); - if(this.onComplete) - { - this.onComplete(); - } - } -}; - -/** - * A short hand way of creating a movieclip from an array of frame ids - * - * @static - * @method fromFrames - * @param frames {Array} the array of frames ids the movieclip will use as its texture frames - * @return {MovieClip} - */ -PIXI.MovieClip.fromFrames = function(frames) -{ - var textures = []; - - for (var i = 0; i < frames.length; i++) - { - textures.push(new PIXI.Texture.fromFrame(frames[i])); - } - - return new PIXI.MovieClip(textures); -}; - -/** - * A short hand way of creating a movieclip from an array of image ids - * - * @static - * @method fromImages - * @param frames {Array} the array of image ids the movieclip will use as its texture frames - * @return {MovieClip} - */ -PIXI.MovieClip.fromImages = function(images) -{ - var textures = []; - - for (var i = 0; i < images.length; i++) - { - textures.push(new PIXI.Texture.fromImage(images[i])); - } - - return new PIXI.MovieClip(textures); -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A target and pass info object for filters. - * - * @class FilterBlock - * @constructor - */ -PIXI.FilterBlock = function() -{ - /** - * The visible state of this FilterBlock. - * - * @property visible - * @type Boolean - */ - this.visible = true; - - /** - * The renderable state of this FilterBlock. - * - * @property renderable - * @type Boolean - */ - this.renderable = true; -}; - -PIXI.FilterBlock.prototype.constructor = PIXI.FilterBlock; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * Modified by Tom Slezakowski http://www.tomslezakowski.com @TomSlezakowski (24/03/2014) - Added dropShadowColor. - */ - -/** - * A Text Object will create a line or multiple lines of text. To split a line you can use '\n' in your text string, - * or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object. - * - * @class Text - * @extends Sprite - * @constructor - * @param text {String} The copy that you would like the text to display - * @param [style] {Object} The style parameters - * @param [style.font] {String} default 'bold 20px Arial' The style and size of the font - * @param [style.fill='black'] {String|Number} A canvas fillstyle that will be used on the text e.g 'red', '#00FF00' - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - * @param [style.stroke] {String|Number} A canvas fillstyle that will be used on the text stroke e.g 'blue', '#FCFF00' - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke) - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap, it needs wordWrap to be set to true - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00' - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow - */ -PIXI.Text = function(text, style) -{ - /** - * The canvas element that everything is drawn to - * - * @property canvas - * @type HTMLCanvasElement - */ - this.canvas = document.createElement('canvas'); - - /** - * The canvas 2d context that everything is drawn with - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.canvas.getContext('2d'); - - /** - * The resolution of the canvas. - * @property resolution - * @type Number - */ - this.resolution = 1; - - PIXI.Sprite.call(this, PIXI.Texture.fromCanvas(this.canvas)); - - this.setText(text); - this.setStyle(style); - -}; - -// constructor -PIXI.Text.prototype = Object.create(PIXI.Sprite.prototype); -PIXI.Text.prototype.constructor = PIXI.Text; - -/** - * The width of the Text, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.Text.prototype, 'width', { - get: function() { - - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - - return this.scale.x * this.texture.frame.width; - }, - set: function(value) { - this.scale.x = value / this.texture.frame.width; - this._width = value; - } -}); - -/** - * The height of the Text, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.Text.prototype, 'height', { - get: function() { - - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - - return this.scale.y * this.texture.frame.height; - }, - set: function(value) { - this.scale.y = value / this.texture.frame.height; - this._height = value; - } -}); - -/** - * Set the style of the text - * - * @method setStyle - * @param [style] {Object} The style parameters - * @param [style.font='bold 20pt Arial'] {String} The style and size of the font - * @param [style.fill='black'] {Object} A canvas fillstyle that will be used on the text eg 'red', '#00FF00' - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - * @param [style.stroke='black'] {String} A canvas fillstyle that will be used on the text stroke eg 'blue', '#FCFF00' - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke) - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00' - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow - */ -PIXI.Text.prototype.setStyle = function(style) -{ - style = style || {}; - style.font = style.font || 'bold 20pt Arial'; - style.fill = style.fill || 'black'; - style.align = style.align || 'left'; - style.stroke = style.stroke || 'black'; //provide a default, see: https://github.com/GoodBoyDigital/pixi.js/issues/136 - style.strokeThickness = style.strokeThickness || 0; - style.wordWrap = style.wordWrap || false; - style.wordWrapWidth = style.wordWrapWidth || 100; - - style.dropShadow = style.dropShadow || false; - style.dropShadowAngle = style.dropShadowAngle || Math.PI / 6; - style.dropShadowDistance = style.dropShadowDistance || 4; - style.dropShadowColor = style.dropShadowColor || 'black'; - - this.style = style; - this.dirty = true; -}; - -/** - * Set the copy for the text object. To split a line you can use '\n'. - * - * @method setText - * @param text {String} The copy that you would like the text to display - */ -PIXI.Text.prototype.setText = function(text) -{ - this.text = text.toString() || ' '; - this.dirty = true; -}; - -/** - * Renders text and updates it when needed - * - * @method updateText - * @private - */ -PIXI.Text.prototype.updateText = function() -{ - this.texture.baseTexture.resolution = this.resolution; - - this.context.font = this.style.font; - - var outputText = this.text; - - // word wrap - // preserve original text - if(this.style.wordWrap)outputText = this.wordWrap(this.text); - - //split text into lines - var lines = outputText.split(/(?:\r\n|\r|\n)/); - - //calculate text width - var lineWidths = []; - var maxLineWidth = 0; - var fontProperties = this.determineFontProperties(this.style.font); - for (var i = 0; i < lines.length; i++) - { - var lineWidth = this.context.measureText(lines[i]).width; - lineWidths[i] = lineWidth; - maxLineWidth = Math.max(maxLineWidth, lineWidth); - } - - var width = maxLineWidth + this.style.strokeThickness; - if(this.style.dropShadow)width += this.style.dropShadowDistance; - - this.canvas.width = ( width + this.context.lineWidth ) * this.resolution; - - //calculate text height - var lineHeight = fontProperties.fontSize + this.style.strokeThickness; - - var height = lineHeight * lines.length; - if(this.style.dropShadow)height += this.style.dropShadowDistance; - - this.canvas.height = height * this.resolution; - - this.context.scale( this.resolution, this.resolution); - - if(navigator.isCocoonJS) this.context.clearRect(0,0,this.canvas.width,this.canvas.height); - - // used for debugging.. - //this.context.fillStyle ="#FF0000" - //this.context.fillRect(0, 0, this.canvas.width,this.canvas.height); - - this.context.font = this.style.font; - this.context.strokeStyle = this.style.stroke; - this.context.lineWidth = this.style.strokeThickness; - this.context.textBaseline = 'alphabetic'; - //this.context.lineJoin = 'round'; - - var linePositionX; - var linePositionY; - - if(this.style.dropShadow) - { - this.context.fillStyle = this.style.dropShadowColor; - - var xShadowOffset = Math.sin(this.style.dropShadowAngle) * this.style.dropShadowDistance; - var yShadowOffset = Math.cos(this.style.dropShadowAngle) * this.style.dropShadowDistance; - - for (i = 0; i < lines.length; i++) - { - linePositionX = this.style.strokeThickness / 2; - linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent; - - if(this.style.align === 'right') - { - linePositionX += maxLineWidth - lineWidths[i]; - } - else if(this.style.align === 'center') - { - linePositionX += (maxLineWidth - lineWidths[i]) / 2; - } - - if(this.style.fill) - { - this.context.fillText(lines[i], linePositionX + xShadowOffset, linePositionY + yShadowOffset); - } - - // if(dropShadow) - } - } - - //set canvas text styles - this.context.fillStyle = this.style.fill; - - //draw lines line by line - for (i = 0; i < lines.length; i++) - { - linePositionX = this.style.strokeThickness / 2; - linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent; - - if(this.style.align === 'right') - { - linePositionX += maxLineWidth - lineWidths[i]; - } - else if(this.style.align === 'center') - { - linePositionX += (maxLineWidth - lineWidths[i]) / 2; - } - - if(this.style.stroke && this.style.strokeThickness) - { - this.context.strokeText(lines[i], linePositionX, linePositionY); - } - - if(this.style.fill) - { - this.context.fillText(lines[i], linePositionX, linePositionY); - } - - // if(dropShadow) - } - - this.updateTexture(); -}; - -/** - * Updates texture size based on canvas size - * - * @method updateTexture - * @private - */ -PIXI.Text.prototype.updateTexture = function() -{ - this.texture.baseTexture.width = this.canvas.width; - this.texture.baseTexture.height = this.canvas.height; - this.texture.crop.width = this.texture.frame.width = this.canvas.width; - this.texture.crop.height = this.texture.frame.height = this.canvas.height; - - this._width = this.canvas.width; - this._height = this.canvas.height; - - // update the dirty base textures - this.texture.baseTexture.dirty(); -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Text.prototype._renderWebGL = function(renderSession) -{ - if(this.dirty) - { - this.resolution = renderSession.resolution; - - this.updateText(); - this.dirty = false; - } - - PIXI.Sprite.prototype._renderWebGL.call(this, renderSession); -}; - -/** -* Renders the object using the Canvas renderer -* -* @method _renderCanvas -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Text.prototype._renderCanvas = function(renderSession) -{ - if(this.dirty) - { - this.resolution = renderSession.resolution; - - this.updateText(); - this.dirty = false; - } - - PIXI.Sprite.prototype._renderCanvas.call(this, renderSession); -}; - -/** -* Calculates the ascent, descent and fontSize of a given fontStyle -* -* @method determineFontProperties -* @param fontStyle {Object} -* @private -*/ -PIXI.Text.prototype.determineFontProperties = function(fontStyle) -{ - var properties = PIXI.Text.fontPropertiesCache[fontStyle]; - - if(!properties) - { - properties = {}; - - var canvas = PIXI.Text.fontPropertiesCanvas; - var context = PIXI.Text.fontPropertiesContext; - - context.font = fontStyle; - - var width = Math.ceil(context.measureText('|Mq').width); - var baseline = Math.ceil(context.measureText('M').width); - var height = 2 * baseline; - - baseline = baseline * 1.4 | 0; - - canvas.width = width; - canvas.height = height; - - context.fillStyle = '#f00'; - context.fillRect(0, 0, width, height); - - context.font = fontStyle; - - context.textBaseline = 'alphabetic'; - context.fillStyle = '#000'; - context.fillText('|MÉq', 0, baseline); - - var imagedata = context.getImageData(0, 0, width, height).data; - var pixels = imagedata.length; - var line = width * 4; - - var i, j; - - var idx = 0; - var stop = false; - - // ascent. scan from top to bottom until we find a non red pixel - for(i = 0; i < baseline; i++) - { - for(j = 0; j < line; j += 4) - { - if(imagedata[idx + j] !== 255) - { - stop = true; - break; - } - } - if(!stop) - { - idx += line; - } - else - { - break; - } - } - - properties.ascent = baseline - i; - - idx = pixels - line; - stop = false; - - // descent. scan from bottom to top until we find a non red pixel - for(i = height; i > baseline; i--) - { - for(j = 0; j < line; j += 4) - { - if(imagedata[idx + j] !== 255) - { - stop = true; - break; - } - } - if(!stop) - { - idx -= line; - } - else - { - break; - } - } - - properties.descent = i - baseline; - //TODO might need a tweak. kind of a temp fix! - properties.descent += 6; - properties.fontSize = properties.ascent + properties.descent; - - PIXI.Text.fontPropertiesCache[fontStyle] = properties; - } - - return properties; -}; - -/** - * Applies newlines to a string to have it optimally fit into the horizontal - * bounds set by the Text object's wordWrapWidth property. - * - * @method wordWrap - * @param text {String} - * @private - */ -PIXI.Text.prototype.wordWrap = function(text) -{ - // Greedy wrapping algorithm that will wrap words as the line grows longer - // than its horizontal bounds. - var result = ''; - var lines = text.split('\n'); - for (var i = 0; i < lines.length; i++) - { - var spaceLeft = this.style.wordWrapWidth; - var words = lines[i].split(' '); - for (var j = 0; j < words.length; j++) - { - var wordWidth = this.context.measureText(words[j]).width; - var wordWidthWithSpace = wordWidth + this.context.measureText(' ').width; - if(j === 0 || wordWidthWithSpace > spaceLeft) - { - // Skip printing the newline if it's the first word of the line that is - // greater than the word wrap width. - if(j > 0) - { - result += '\n'; - } - result += words[j]; - spaceLeft = this.style.wordWrapWidth - wordWidth; - } - else - { - spaceLeft -= wordWidthWithSpace; - result += ' ' + words[j]; - } - } - - if (i < lines.length-1) - { - result += '\n'; - } - } - return result; -}; - -/** -* Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. -* -* @method getBounds -* @param matrix {Matrix} the transformation matrix of the Text -* @return {Rectangle} the framing rectangle -*/ -PIXI.Text.prototype.getBounds = function(matrix) -{ - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - return PIXI.Sprite.prototype.getBounds.call(this, matrix); -}; - -/** - * Destroys this text object. - * - * @method destroy - * @param destroyBaseTexture {Boolean} whether to destroy the base texture as well - */ -PIXI.Text.prototype.destroy = function(destroyBaseTexture) -{ - // make sure to reset the the context and canvas.. dont want this hanging around in memory! - this.context = null; - this.canvas = null; - - this.texture.destroy(destroyBaseTexture === undefined ? true : destroyBaseTexture); -}; - -PIXI.Text.fontPropertiesCache = {}; -PIXI.Text.fontPropertiesCanvas = document.createElement('canvas'); -PIXI.Text.fontPropertiesContext = PIXI.Text.fontPropertiesCanvas.getContext('2d'); - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A BitmapText object will create a line or multiple lines of text using bitmap font. To split a line you can use '\n', '\r' or '\r\n' in your string. - * You can generate the fnt files using - * http://www.angelcode.com/products/bmfont/ for windows or - * http://www.bmglyph.com/ for mac. - * - * @class BitmapText - * @extends DisplayObjectContainer - * @constructor - * @param text {String} The copy that you would like the text to display - * @param style {Object} The style parameters - * @param style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously) - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - */ -PIXI.BitmapText = function(text, style) -{ - PIXI.DisplayObjectContainer.call(this); - - /** - * [read-only] The width of the overall text, different from fontSize, - * which is defined in the style object - * - * @property textWidth - * @type Number - * @readOnly - */ - this.textWidth = 0; - - /** - * [read-only] The height of the overall text, different from fontSize, - * which is defined in the style object - * - * @property textHeight - * @type Number - * @readOnly - */ - this.textHeight = 0; - - /** - * @property _pool - * @type Array - * @private - */ - this._pool = []; - - this.setText(text); - this.setStyle(style); - this.updateText(); - - /** - * The dirty state of this object. - * @property dirty - * @type Boolean - */ - this.dirty = false; -}; - -// constructor -PIXI.BitmapText.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); -PIXI.BitmapText.prototype.constructor = PIXI.BitmapText; - -/** - * Set the text string to be rendered. - * - * @method setText - * @param text {String} The text that you would like displayed - */ -PIXI.BitmapText.prototype.setText = function(text) -{ - this.text = text || ' '; - this.dirty = true; -}; - -/** - * Set the style of the text - * style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously) - * [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single lines of text - * - * @method setStyle - * @param style {Object} The style parameters, contained as properties of an object - */ -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; - this.tint = style.tint; -}; - -/** - * Renders text and updates it when needed - * - * @method updateText - * @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(/(?:\r\n|\r|\n)/.test(this.text.charAt(i))) - { - 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.kerning[prevCharCode]) - { - pos.x += charData.kerning[prevCharCode]; - } - - chars.push({texture:charData.texture, 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); - } - - var lenChildren = this.children.length; - var lenChars = chars.length; - var tint = this.tint || 0xFFFFFF; - - for(i = 0; i < lenChars; i++) - { - var c = i < lenChildren ? this.children[i] : this._pool.pop(); // get old child if have. if not - take from pool. - - if (c) c.setTexture(chars[i].texture); // check if got one before. - else c = new PIXI.Sprite(chars[i].texture); // if no create new one. - - c.position.x = (chars[i].position.x + lineAlignOffsets[chars[i].line]) * scale; - c.position.y = chars[i].position.y * scale; - c.scale.x = c.scale.y = scale; - c.tint = tint; - if (!c.parent) this.addChild(c); - } - - // remove unnecessary children. - // and put their into the pool. - while(this.children.length > lenChars) - { - var child = this.getChildAt(this.children.length - 1); - this._pool.push(child); - this.removeChild(child); - } - - this.textWidth = maxLineWidth * scale; - this.textHeight = (pos.y + data.lineHeight) * scale; -}; - -/** - * Updates the transform of this object - * - * @method updateTransform - * @private - */ -PIXI.BitmapText.prototype.updateTransform = function() -{ - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - PIXI.DisplayObjectContainer.prototype.updateTransform.call(this); -}; - -PIXI.BitmapText.fonts = {}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Holds all information related to an Interaction event - * - * @class InteractionData - * @constructor - */ -PIXI.InteractionData = function() -{ - /** - * This point stores the global coords of where the touch/mouse event happened - * - * @property global - * @type Point - */ - this.global = new PIXI.Point(); - - /** - * The target Sprite that was interacted with - * - * @property target - * @type Sprite - */ - this.target = null; - - /** - * When passed to an event handler, this will be the original DOM Event that was captured - * - * @property originalEvent - * @type Event - */ - this.originalEvent = null; -}; - -/** - * This will return the local coordinates of the specified displayObject for this InteractionData - * - * @method getLocalPosition - * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off - * @param [point] {Point} A Point object in which to store the value, optional (otherwise will create a new point) - * @return {Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject - */ -PIXI.InteractionData.prototype.getLocalPosition = function(displayObject, point) -{ - var worldTransform = displayObject.worldTransform; - var global = this.global; - - // do a cheeky transform to get the mouse coords; - var a00 = worldTransform.a, a01 = worldTransform.c, a02 = worldTransform.tx, - a10 = worldTransform.b, a11 = worldTransform.d, a12 = worldTransform.ty, - id = 1 / (a00 * a11 + a01 * -a10); - - point = point || new PIXI.Point(); - - point.x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id; - point.y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; - - // set the mouse coords... - return point; -}; - -// constructor -PIXI.InteractionData.prototype.constructor = PIXI.InteractionData; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - - /** - * The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive - * if its interactive parameter is set to true - * This manager also supports multitouch. - * - * @class InteractionManager - * @constructor - * @param stage {Stage} The stage to handle interactions - */ -PIXI.InteractionManager = function(stage) -{ - /** - * A reference to the stage - * - * @property stage - * @type Stage - */ - this.stage = stage; - - /** - * The mouse data - * - * @property mouse - * @type InteractionData - */ - this.mouse = new PIXI.InteractionData(); - - /** - * An object that stores current touches (InteractionData) by id reference - * - * @property touches - * @type Object - */ - this.touches = {}; - - /** - * @property tempPoint - * @type Point - * @private - */ - this.tempPoint = new PIXI.Point(); - - /** - * @property mouseoverEnabled - * @type Boolean - * @default - */ - this.mouseoverEnabled = true; - - /** - * Tiny little interactiveData pool ! - * - * @property pool - * @type Array - */ - this.pool = []; - - /** - * An array containing all the iterative items from the our interactive tree - * @property interactiveItems - * @type Array - * @private - */ - this.interactiveItems = []; - - /** - * Our canvas - * @property interactionDOMElement - * @type HTMLCanvasElement - * @private - */ - this.interactionDOMElement = null; - - //this will make it so that you don't have to call bind all the time - - /** - * @property onMouseMove - * @type Function - */ - this.onMouseMove = this.onMouseMove.bind( this ); - - /** - * @property onMouseDown - * @type Function - */ - this.onMouseDown = this.onMouseDown.bind(this); - - /** - * @property onMouseOut - * @type Function - */ - this.onMouseOut = this.onMouseOut.bind(this); - - /** - * @property onMouseUp - * @type Function - */ - this.onMouseUp = this.onMouseUp.bind(this); - - /** - * @property onTouchStart - * @type Function - */ - this.onTouchStart = this.onTouchStart.bind(this); - - /** - * @property onTouchEnd - * @type Function - */ - this.onTouchEnd = this.onTouchEnd.bind(this); - - /** - * @property onTouchCancel - * @type Function - */ - this.onTouchCancel = this.onTouchCancel.bind(this); - - /** - * @property onTouchMove - * @type Function - */ - this.onTouchMove = this.onTouchMove.bind(this); - - /** - * @property last - * @type Number - */ - this.last = 0; - - /** - * The css style of the cursor that is being used - * @property currentCursorStyle - * @type String - */ - this.currentCursorStyle = 'inherit'; - - /** - * Is set to true when the mouse is moved out of the canvas - * @property mouseOut - * @type Boolean - */ - this.mouseOut = false; - - /** - * @property resolution - * @type Number - */ - this.resolution = 1; - - // used for hit testing - this._tempPoint = new PIXI.Point(); -}; - -// constructor -PIXI.InteractionManager.prototype.constructor = PIXI.InteractionManager; - -/** - * Collects an interactive sprite recursively to have their interactions managed - * - * @method collectInteractiveSprite - * @param displayObject {DisplayObject} the displayObject to collect - * @param iParent {DisplayObject} the display object's parent - * @private - */ -PIXI.InteractionManager.prototype.collectInteractiveSprite = function(displayObject, iParent) -{ - var children = displayObject.children; - var length = children.length; - - // make an interaction tree... {item.__interactiveParent} - for (var i = length - 1; i >= 0; i--) - { - var child = children[i]; - - // push all interactive bits - if (child._interactive) - { - iParent.interactiveChildren = true; - //child.__iParent = iParent; - this.interactiveItems.push(child); - - if (child.children.length > 0) { - this.collectInteractiveSprite(child, child); - } - } - else - { - child.__iParent = null; - if (child.children.length > 0) - { - this.collectInteractiveSprite(child, iParent); - } - } - - } -}; - -/** - * Sets the target for event delegation - * - * @method setTarget - * @param target {WebGLRenderer|CanvasRenderer} the renderer to bind events to - * @private - */ -PIXI.InteractionManager.prototype.setTarget = function(target) -{ - this.target = target; - this.resolution = target.resolution; - - // Check if the dom element has been set. If it has don't do anything. - if (this.interactionDOMElement !== null) return; - - this.setTargetDomElement (target.view); -}; - -/** - * Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM - * elements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element - * to receive those events - * - * @method setTargetDomElement - * @param domElement {DOMElement} the DOM element which will receive mouse and touch events - * @private - */ -PIXI.InteractionManager.prototype.setTargetDomElement = function(domElement) -{ - this.removeEvents(); - - if (window.navigator.msPointerEnabled) - { - // time to remove some of that zoom in ja.. - domElement.style['-ms-content-zooming'] = 'none'; - domElement.style['-ms-touch-action'] = 'none'; - } - - this.interactionDOMElement = domElement; - - domElement.addEventListener('mousemove', this.onMouseMove, true); - domElement.addEventListener('mousedown', this.onMouseDown, true); - domElement.addEventListener('mouseout', this.onMouseOut, true); - - // aint no multi touch just yet! - domElement.addEventListener('touchstart', this.onTouchStart, true); - domElement.addEventListener('touchend', this.onTouchEnd, true); - domElement.addEventListener('touchleave', this.onTouchCancel, true); - domElement.addEventListener('touchcancel', this.onTouchCancel, true); - domElement.addEventListener('touchmove', this.onTouchMove, true); - - window.addEventListener('mouseup', this.onMouseUp, true); -}; - -/** - * @method removeEvents - * @private - */ -PIXI.InteractionManager.prototype.removeEvents = function() -{ - if (!this.interactionDOMElement) return; - - this.interactionDOMElement.style['-ms-content-zooming'] = ''; - this.interactionDOMElement.style['-ms-touch-action'] = ''; - - this.interactionDOMElement.removeEventListener('mousemove', this.onMouseMove, true); - this.interactionDOMElement.removeEventListener('mousedown', this.onMouseDown, true); - this.interactionDOMElement.removeEventListener('mouseout', this.onMouseOut, true); - - // aint no multi touch just yet! - this.interactionDOMElement.removeEventListener('touchstart', this.onTouchStart, true); - this.interactionDOMElement.removeEventListener('touchend', this.onTouchEnd, true); - this.interactionDOMElement.removeEventListener('touchleave', this.onTouchCancel, true); - this.interactionDOMElement.removeEventListener('touchcancel', this.onTouchCancel, true); - this.interactionDOMElement.removeEventListener('touchmove', this.onTouchMove, true); - - this.interactionDOMElement = null; - - window.removeEventListener('mouseup', this.onMouseUp, true); -}; - -/** - * updates the state of interactive objects - * - * @method update - * @private - */ -PIXI.InteractionManager.prototype.update = function() -{ - if (!this.target) return; - - // frequency of 30fps?? - var now = Date.now(); - var diff = now - this.last; - diff = (diff * PIXI.INTERACTION_FREQUENCY ) / 1000; - if (diff < 1) return; - this.last = now; - - var i = 0; - - // ok.. so mouse events?? - // yes for now :) - // OPTIMISE - how often to check?? - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - // loop through interactive objects! - var length = this.interactiveItems.length; - var cursor = 'inherit'; - var over = false; - - for (i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - // OPTIMISATION - only calculate every time if the mousemove function exists.. - // OK so.. does the object have any other interactive functions? - // hit-test the clip! - // if (item.mouseover || item.mouseout || item.buttonMode) - // { - // ok so there are some functions so lets hit test it.. - item.__hit = this.hitTest(item, this.mouse); - this.mouse.target = item; - // ok so deal with interactions.. - // looks like there was a hit! - if (item.__hit && !over) - { - if (item.buttonMode) cursor = item.defaultCursor; - - if (!item.interactiveChildren) - { - over = true; - } - - if (!item.__isOver) - { - if (item.mouseover) - { - item.mouseover (this.mouse); - } - item.__isOver = true; - } - } - else - { - if (item.__isOver) - { - // roll out! - if (item.mouseout) - { - item.mouseout (this.mouse); - } - item.__isOver = false; - } - } - } - - if (this.currentCursorStyle !== cursor) - { - this.currentCursorStyle = cursor; - this.interactionDOMElement.style.cursor = cursor; - } -}; - -/** - * @method rebuildInteractiveGraph - * @private - */ -PIXI.InteractionManager.prototype.rebuildInteractiveGraph = function() -{ - this.dirty = false; - - var len = this.interactiveItems.length; - - for (var i = 0; i < len; i++) { - this.interactiveItems[i].interactiveChildren = false; - } - - this.interactiveItems = []; - - if (this.stage.interactive) - { - this.interactiveItems.push(this.stage); - } - - // Go through and collect all the objects that are interactive.. - this.collectInteractiveSprite(this.stage, this.stage); -}; - -/** - * Is called when the mouse moves across the renderer element - * - * @method onMouseMove - * @param event {Event} The DOM event of the mouse moving - * @private - */ -PIXI.InteractionManager.prototype.onMouseMove = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - // TODO optimize by not check EVERY TIME! maybe half as often? // - var rect = this.interactionDOMElement.getBoundingClientRect(); - - this.mouse.global.x = (event.clientX - rect.left) * (this.target.width / rect.width) / this.resolution; - this.mouse.global.y = (event.clientY - rect.top) * ( this.target.height / rect.height) / this.resolution; - - var length = this.interactiveItems.length; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - // Call the function! - if (item.mousemove) - { - item.mousemove(this.mouse); - } - } -}; - -/** - * Is called when the mouse button is pressed down on the renderer element - * - * @method onMouseDown - * @param event {Event} The DOM event of a mouse button being pressed down - * @private - */ -PIXI.InteractionManager.prototype.onMouseDown = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - if (PIXI.AUTO_PREVENT_DEFAULT) - { - this.mouse.originalEvent.preventDefault(); - } - - // loop through interaction tree... - // hit test each item! -> - // get interactive items under point?? - //stage.__i - var length = this.interactiveItems.length; - - var e = this.mouse.originalEvent; - var isRightButton = e.button === 2 || e.which === 3; - var downFunction = isRightButton ? 'rightdown' : 'mousedown'; - var clickFunction = isRightButton ? 'rightclick' : 'click'; - var buttonIsDown = isRightButton ? '__rightIsDown' : '__mouseIsDown'; - var isDown = isRightButton ? '__isRightDown' : '__isDown'; - - // while - // hit test - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - if (item[downFunction] || item[clickFunction]) - { - item[buttonIsDown] = true; - item.__hit = this.hitTest(item, this.mouse); - - if (item.__hit) - { - //call the function! - if (item[downFunction]) - { - item[downFunction](this.mouse); - } - item[isDown] = true; - - // just the one! - if (!item.interactiveChildren) break; - } - } - } -}; - -/** - * Is called when the mouse is moved out of the renderer element - * - * @method onMouseOut - * @param event {Event} The DOM event of a mouse being moved out - * @private - */ -PIXI.InteractionManager.prototype.onMouseOut = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - var length = this.interactiveItems.length; - - this.interactionDOMElement.style.cursor = 'inherit'; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - if (item.__isOver) - { - this.mouse.target = item; - if (item.mouseout) - { - item.mouseout(this.mouse); - } - item.__isOver = false; - } - } - - this.mouseOut = true; - - // move the mouse to an impossible position - this.mouse.global.x = -10000; - this.mouse.global.y = -10000; -}; - -/** - * Is called when the mouse button is released on the renderer element - * - * @method onMouseUp - * @param event {Event} The DOM event of a mouse button being released - * @private - */ -PIXI.InteractionManager.prototype.onMouseUp = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - var length = this.interactiveItems.length; - var up = false; - - var e = this.mouse.originalEvent; - var isRightButton = e.button === 2 || e.which === 3; - - var upFunction = isRightButton ? 'rightup' : 'mouseup'; - var clickFunction = isRightButton ? 'rightclick' : 'click'; - var upOutsideFunction = isRightButton ? 'rightupoutside' : 'mouseupoutside'; - var isDown = isRightButton ? '__isRightDown' : '__isDown'; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - if (item[clickFunction] || item[upFunction] || item[upOutsideFunction]) - { - item.__hit = this.hitTest(item, this.mouse); - - if (item.__hit && !up) - { - //call the function! - if (item[upFunction]) - { - item[upFunction](this.mouse); - } - if (item[isDown]) - { - if (item[clickFunction]) - { - item[clickFunction](this.mouse); - } - } - - if (!item.interactiveChildren) - { - up = true; - } - } - else - { - if (item[isDown]) - { - if (item[upOutsideFunction]) item[upOutsideFunction](this.mouse); - } - } - - item[isDown] = false; - } - } -}; - -/** - * Tests if the current mouse coordinates hit a sprite - * - * @method hitTest - * @param item {DisplayObject} The displayObject to test for a hit - * @param interactionData {InteractionData} The interactionData object to update in the case there is a hit - * @private - */ -PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) -{ - var global = interactionData.global; - - if (!item.worldVisible) - { - return false; - } - - // map the global point to local space. - item.worldTransform.applyInverse(global, this._tempPoint); - - var x = this._tempPoint.x, - y = this._tempPoint.y, - i; - - interactionData.target = item; - - //a sprite or display object with a hit area defined - if (item.hitArea && item.hitArea.contains) - { - return item.hitArea.contains(x, y); - } - // a sprite with no hitarea defined - else if(item instanceof PIXI.Sprite) - { - var width = item.texture.frame.width; - var height = item.texture.frame.height; - var x1 = -width * item.anchor.x; - var y1; - - if (x > x1 && x < x1 + width) - { - y1 = -height * item.anchor.y; - - if (y > y1 && y < y1 + height) - { - // set the target property if a hit is true! - return true; - } - } - } - else if(item instanceof PIXI.Graphics) - { - var graphicsData = item.graphicsData; - for (i = 0; i < graphicsData.length; i++) - { - var data = graphicsData[i]; - if(!data.fill)continue; - - // only deal with fills.. - if(data.shape) - { - if(data.shape.contains(x, y)) - { - //interactionData.target = item; - return true; - } - } - } - } - - var length = item.children.length; - - for (i = 0; i < length; i++) - { - var tempItem = item.children[i]; - var hit = this.hitTest(tempItem, interactionData); - if (hit) - { - // hmm.. TODO SET CORRECT TARGET? - interactionData.target = item; - return true; - } - } - return false; -}; - -/** - * Is called when a touch is moved across the renderer element - * - * @method onTouchMove - * @param event {Event} The DOM event of a touch moving across the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchMove = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - var touchData; - var i = 0; - - for (i = 0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - touchData = this.touches[touchEvent.identifier]; - touchData.originalEvent = event; - - // update the touch position - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - for (var j = 0; j < this.interactiveItems.length; j++) - { - var item = this.interactiveItems[j]; - if (item.touchmove && item.__touchData && item.__touchData[touchEvent.identifier]) - { - item.touchmove(touchData); - } - } - } -}; - -/** - * Is called when a touch is started on the renderer element - * - * @method onTouchStart - * @param event {Event} The DOM event of a touch starting on the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchStart = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - - if (PIXI.AUTO_PREVENT_DEFAULT) - { - event.preventDefault(); - } - - var changedTouches = event.changedTouches; - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - - var touchData = this.pool.pop(); - if (!touchData) - { - touchData = new PIXI.InteractionData(); - } - - touchData.originalEvent = event; - - this.touches[touchEvent.identifier] = touchData; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.touchstart || item.tap) - { - item.__hit = this.hitTest(item, touchData); - - if (item.__hit) - { - //call the function! - if (item.touchstart)item.touchstart(touchData); - item.__isDown = true; - item.__touchData = item.__touchData || {}; - item.__touchData[touchEvent.identifier] = touchData; - - if (!item.interactiveChildren) break; - } - } - } - } -}; - -/** - * Is called when a touch is ended on the renderer element - * - * @method onTouchEnd - * @param event {Event} The DOM event of a touch ending on the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchEnd = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - var touchData = this.touches[touchEvent.identifier]; - var up = false; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.__touchData && item.__touchData[touchEvent.identifier]) - { - - item.__hit = this.hitTest(item, item.__touchData[touchEvent.identifier]); - - // so this one WAS down... - touchData.originalEvent = event; - // hitTest?? - - if (item.touchend || item.tap) - { - if (item.__hit && !up) - { - if (item.touchend) - { - item.touchend(touchData); - } - if (item.__isDown && item.tap) - { - item.tap(touchData); - } - if (!item.interactiveChildren) - { - up = true; - } - } - else - { - if (item.__isDown && item.touchendoutside) - { - item.touchendoutside(touchData); - } - } - - item.__isDown = false; - } - - item.__touchData[touchEvent.identifier] = null; - } - } - // remove the touch.. - this.pool.push(touchData); - this.touches[touchEvent.identifier] = null; - } -}; - -/** - * Is called when a touch is canceled - * - * @method onTouchCancel - * @param event {Event} The DOM event of a touch canceled - * @private - */ -PIXI.InteractionManager.prototype.onTouchCancel = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - var touchData = this.touches[touchEvent.identifier]; - var up = false; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.__touchData && item.__touchData[touchEvent.identifier]) - { - - item.__hit = this.hitTest(item, item.__touchData[touchEvent.identifier]); - - // so this one WAS down... - touchData.originalEvent = event; - // hitTest?? - - if (item.touchcancel && !up) - { - item.touchcancel(touchData); - if (!item.interactiveChildren) - { - up = true; - } - } - - item.__isDown = false; - item.__touchData[touchEvent.identifier] = null; - } - } - // remove the touch.. - this.pool.push(touchData); - this.touches[touchEvent.identifier] = null; - } -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A Stage represents the root of the display tree. Everything connected to the stage is rendered - * - * @class Stage - * @extends DisplayObjectContainer - * @constructor - * @param backgroundColor {Number} the background color of the stage, you have to pass this in is in hex format - * like: 0xFFFFFF for white - * - * Creating a stage is a mandatory process when you use Pixi, which is as simple as this : - * var stage = new PIXI.Stage(0xFFFFFF); - * where the parameter given is the background colour of the stage, in hex - * you will use this stage instance to add your sprites to it and therefore to the renderer - * Here is how to add a sprite to the stage : - * stage.addChild(sprite); - */ -PIXI.Stage = function(backgroundColor) -{ - PIXI.DisplayObjectContainer.call( this ); - - /** - * [read-only] Current transform of the object based on world (parent) factors - * - * @property worldTransform - * @type Matrix - * @readOnly - * @private - */ - this.worldTransform = new PIXI.Matrix(); - - /** - * Whether or not the stage is interactive - * - * @property interactive - * @type Boolean - */ - this.interactive = true; - - /** - * The interaction manage for this stage, manages all interactive activity on the stage - * - * @property interactionManager - * @type InteractionManager - */ - this.interactionManager = new PIXI.InteractionManager(this); - - /** - * Whether the stage is dirty and needs to have interactions updated - * - * @property dirty - * @type Boolean - * @private - */ - this.dirty = true; - - //the stage is its own stage - this.stage = this; - - //optimize hit detection a bit - this.stage.hitArea = new PIXI.Rectangle(0, 0, 100000, 100000); - - this.setBackgroundColor(backgroundColor); -}; - -// constructor -PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); -PIXI.Stage.prototype.constructor = PIXI.Stage; - -/** - * Sets another DOM element which can receive mouse/touch interactions instead of the default Canvas element. - * This is useful for when you have other DOM elements on top of the Canvas element. - * - * @method setInteractionDelegate - * @param domElement {DOMElement} This new domElement which will receive mouse/touch events - */ -PIXI.Stage.prototype.setInteractionDelegate = function(domElement) -{ - this.interactionManager.setTargetDomElement( domElement ); -}; - -/* - * Updates the object transform for rendering - * - * @method updateTransform - * @private - */ -PIXI.Stage.prototype.updateTransform = function() -{ - this.worldAlpha = 1; - - for(var i=0,j=this.children.length; i> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255]; -}; - -/** - * Converts a color as an [R, G, B] array to a hex number - * - * @method rgb2hex - * @param rgb {Array} - */ -PIXI.rgb2hex = function(rgb) { - return ((rgb[0]*255 << 16) + (rgb[1]*255 << 8) + rgb[2]*255); -}; - -/** - * A polyfill for Function.prototype.bind - * - * @method bind - */ -if (typeof Function.prototype.bind !== 'function') { - Function.prototype.bind = (function () { - return function (thisArg) { - var target = this, i = arguments.length - 1, boundArgs = []; - if (i > 0) - { - boundArgs.length = i; - while (i--) boundArgs[i] = arguments[i + 1]; - } - - if (typeof target !== 'function') throw new TypeError(); - - function bound() { - var i = arguments.length, args = new Array(i); - while (i--) args[i] = arguments[i]; - args = boundArgs.concat(args); - return target.apply(this instanceof bound ? this : thisArg, args); - } - - bound.prototype = (function F(proto) { - if (proto) F.prototype = proto; - if (!(this instanceof F)) return new F(); - })(target.prototype); - - return bound; - }; - })(); -} - -/** - * A wrapper for ajax requests to be handled cross browser - * - * @class AjaxRequest - * @constructor - */ -PIXI.AjaxRequest = function() -{ - var activexmodes = ['Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.3.0', 'Microsoft.XMLHTTP']; //activeX versions to check for in IE - - if (window.ActiveXObject) - { //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken) - for (var i=0; i 0 && (number & (number - 1)) === 0) // see: http://goo.gl/D9kPj - return number; - else - { - var result = 1; - while (result < number) result <<= 1; - return result; - } -}; - -/** - * checks if the given width and height make a power of two texture - * @method isPowerOfTwo - * @param width {Number} - * @param height {Number} - * @return {Boolean} - */ -PIXI.isPowerOfTwo = function(width, height) -{ - return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0); - -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * @author Chad Engler https://github.com/englercj @Rolnaaba - */ - -/** - * Originally based on https://github.com/mrdoob/eventtarget.js/ from mr Doob. - * Currently takes inspiration from the nodejs EventEmitter, EventEmitter3, and smokesignals - */ - -/** - * Mixins event emitter functionality to a class - * - * @class EventTarget - * @example - * function MyEmitter() {} - * - * PIXI.EventTarget.mixin(MyEmitter.prototype); - * - * var em = new MyEmitter(); - * em.emit('eventName', 'some data', 'some more data', {}, null, ...); - */ -PIXI.EventTarget = { - /** - * Backward compat from when this used to be a function - */ - call: function callCompat(obj) { - if(obj) { - obj = obj.prototype || obj; - PIXI.EventTarget.mixin(obj); - } - }, - - /** - * Mixes in the properties of the EventTarget prototype onto another object - * - * @method mixin - * @param object {Object} The obj to mix into - */ - mixin: function mixin(obj) { - /** - * Return a list of assigned event listeners. - * - * @method listeners - * @param eventName {String} The events that should be listed. - * @return {Array} An array of listener functions - */ - obj.listeners = function listeners(eventName) { - this._listeners = this._listeners || {}; - - return this._listeners[eventName] ? this._listeners[eventName].slice() : []; - }; - - /** - * Emit an event to all registered event listeners. - * - * @method emit - * @alias dispatchEvent - * @param eventName {String} The name of the event. - * @return {Boolean} Indication if we've emitted an event. - */ - obj.emit = obj.dispatchEvent = function emit(eventName, data) { - this._listeners = this._listeners || {}; - - //backwards compat with old method ".emit({ type: 'something' })" - if(typeof eventName === 'object') { - data = eventName; - eventName = eventName.type; - } - - //ensure we are using a real pixi event - if(!data || data.__isEventObject !== true) { - data = new PIXI.Event(this, eventName, data); - } - - //iterate the listeners - if(this._listeners && this._listeners[eventName]) { - var listeners = this._listeners[eventName].slice(0), - length = listeners.length, - fn = listeners[0], - i; - - for(i = 0; i < length; fn = listeners[++i]) { - //call the event listener - fn.call(this, data); - - //if "stopImmediatePropagation" is called, stop calling sibling events - if(data.stoppedImmediate) { - return this; - } - } - - //if "stopPropagation" is called then don't bubble the event - if(data.stopped) { - return this; - } - } - - //bubble this event up the scene graph - if(this.parent && this.parent.emit) { - this.parent.emit.call(this.parent, eventName, data); - } - - return this; - }; - - /** - * Register a new EventListener for the given event. - * - * @method on - * @alias addEventListener - * @param eventName {String} Name of the event. - * @param callback {Functon} fn Callback function. - */ - obj.on = obj.addEventListener = function on(eventName, fn) { - this._listeners = this._listeners || {}; - - (this._listeners[eventName] = this._listeners[eventName] || []) - .push(fn); - - return this; - }; - - /** - * Add an EventListener that's only called once. - * - * @method once - * @param eventName {String} Name of the event. - * @param callback {Function} Callback function. - */ - obj.once = function once(eventName, fn) { - this._listeners = this._listeners || {}; - - var self = this; - function onceHandlerWrapper() { - fn.apply(self.off(eventName, onceHandlerWrapper), arguments); - } - onceHandlerWrapper._originalHandler = fn; - - return this.on(eventName, onceHandlerWrapper); - }; - - /** - * Remove event listeners. - * - * @method off - * @alias removeEventListener - * @param eventName {String} The event we want to remove. - * @param callback {Function} The listener that we need to find. - */ - obj.off = obj.removeEventListener = function off(eventName, fn) { - this._listeners = this._listeners || {}; - - if(!this._listeners[eventName]) - return this; - - var list = this._listeners[eventName], - i = fn ? list.length : 0; - - while(i-- > 0) { - if(list[i] === fn || list[i]._originalHandler === fn) { - list.splice(i, 1); - } - } - - if(list.length === 0) { - delete this._listeners[eventName]; - } - - return this; - }; - - /** - * Remove all listeners or only the listeners for the specified event. - * - * @method removeAllListeners - * @param eventName {String} The event you want to remove all listeners for. - */ - obj.removeAllListeners = function removeAllListeners(eventName) { - this._listeners = this._listeners || {}; - - if(!this._listeners[eventName]) - return this; - - delete this._listeners[eventName]; - - return this; - }; - } -}; - -/** - * Creates an homogenous object for tracking events so users can know what to expect. - * - * @class Event - * @extends Object - * @constructor - * @param target {Object} The target object that the event is called on - * @param name {String} The string name of the event that was triggered - * @param data {Object} Arbitrary event data to pass along - */ -PIXI.Event = function(target, name, data) { - //for duck typing in the ".on()" function - this.__isEventObject = true; - - /** - * Tracks the state of bubbling propagation. Do not - * set this directly, instead use `event.stopPropagation()` - * - * @property stopped - * @type Boolean - * @private - * @readOnly - */ - this.stopped = false; - - /** - * Tracks the state of sibling listener propagation. Do not - * set this directly, instead use `event.stopImmediatePropagation()` - * - * @property stoppedImmediate - * @type Boolean - * @private - * @readOnly - */ - this.stoppedImmediate = false; - - /** - * The original target the event triggered on. - * - * @property target - * @type Object - * @readOnly - */ - this.target = target; - - /** - * The string name of the event that this represents. - * - * @property type - * @type String - * @readOnly - */ - this.type = name; - - /** - * The data that was passed in with this event. - * - * @property data - * @type Object - * @readOnly - */ - this.data = data; - - //backwards compat with older version of events - this.content = data; - - /** - * The timestamp when the event occurred. - * - * @property timeStamp - * @type Number - * @readOnly - */ - this.timeStamp = Date.now(); -}; - -/** - * Stops the propagation of events up the scene graph (prevents bubbling). - * - * @method stopPropagation - */ -PIXI.Event.prototype.stopPropagation = function stopPropagation() { - this.stopped = true; -}; - -/** - * Stops the propagation of events to sibling listeners (no longer calls any listeners). - * - * @method stopImmediatePropagation - */ -PIXI.Event.prototype.stopImmediatePropagation = function stopImmediatePropagation() { - this.stoppedImmediate = true; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This helper function will automatically detect which renderer you should be using. - * WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by - * the browser then this function will return a canvas renderer - * - * @method autoDetectRenderer - * @for PIXI - * @static - * @param width=800 {Number} the width of the renderers view - * @param height=600 {Number} the height of the renderers view - * - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * - */ -PIXI.autoDetectRenderer = function(width, height, options) -{ - if(!width)width = 800; - if(!height)height = 600; - - // BORROWED from Mr Doob (mrdoob.com) - var webgl = ( function () { try { - var canvas = document.createElement( 'canvas' ); - return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ); - } catch( e ) { - return false; - } - } )(); - - if( webgl ) - { - return new PIXI.WebGLRenderer(width, height, options); - } - - return new PIXI.CanvasRenderer(width, height, options); -}; - -/** - * This helper function will automatically detect which renderer you should be using. - * This function is very similar to the autoDetectRenderer function except that is will return a canvas renderer for android. - * Even thought both android chrome supports webGL the canvas implementation perform better at the time of writing. - * This function will likely change and update as webGL performance improves on these devices. - * - * @method autoDetectRecommendedRenderer - * @for PIXI - * @static - * @param width=800 {Number} the width of the renderers view - * @param height=600 {Number} the height of the renderers view - * - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * - */ -PIXI.autoDetectRecommendedRenderer = function(width, height, options) -{ - if(!width)width = 800; - if(!height)height = 600; - - // BORROWED from Mr Doob (mrdoob.com) - var webgl = ( function () { try { - var canvas = document.createElement( 'canvas' ); - return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ); - } catch( e ) { - return false; - } - } )(); - - var isAndroid = /Android/i.test(navigator.userAgent); - - if( webgl && !isAndroid) - { - return new PIXI.WebGLRenderer(width, height, options); - } - - return new PIXI.CanvasRenderer(width, height, options); -}; - -/* - PolyK library - url: http://polyk.ivank.net - Released under MIT licence. - - Copyright (c) 2012 Ivan Kuckir - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation - files (the "Software"), to deal in the Software without - restriction, including without limitation the rights to use, - copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following - conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. - - This is an amazing lib! - - Slightly modified by Mat Groves (matgroves.com); -*/ - -/** - * Based on the Polyk library http://polyk.ivank.net released under MIT licence. - * This is an amazing lib! - * Slightly modified by Mat Groves (matgroves.com); - * @class PolyK - */ -PIXI.PolyK = {}; - -/** - * Triangulates shapes for webGL graphic fills. - * - * @method Triangulate - */ -PIXI.PolyK.Triangulate = function(p) -{ - var sign = true; - - var n = p.length >> 1; - if(n < 3) return []; - - var tgs = []; - var avl = []; - for(var i = 0; i < n; i++) avl.push(i); - - i = 0; - var al = n; - while(al > 3) - { - var i0 = avl[(i+0)%al]; - var i1 = avl[(i+1)%al]; - var i2 = avl[(i+2)%al]; - - var ax = p[2*i0], ay = p[2*i0+1]; - var bx = p[2*i1], by = p[2*i1+1]; - var cx = p[2*i2], cy = p[2*i2+1]; - - var earFound = false; - if(PIXI.PolyK._convex(ax, ay, bx, by, cx, cy, sign)) - { - earFound = true; - for(var j = 0; j < al; j++) - { - var vi = avl[j]; - if(vi === i0 || vi === i1 || vi === i2) continue; - - if(PIXI.PolyK._PointInTriangle(p[2*vi], p[2*vi+1], ax, ay, bx, by, cx, cy)) { - earFound = false; - break; - } - } - } - - if(earFound) - { - tgs.push(i0, i1, i2); - avl.splice((i+1)%al, 1); - al--; - i = 0; - } - else if(i++ > 3*al) - { - // need to flip flip reverse it! - // reset! - if(sign) - { - tgs = []; - avl = []; - for(i = 0; i < n; i++) avl.push(i); - - i = 0; - al = n; - - sign = false; - } - else - { - // window.console.log("PIXI Warning: shape too complex to fill"); - return null; - } - } - } - - tgs.push(avl[0], avl[1], avl[2]); - return tgs; -}; - -/** - * Checks whether a point is within a triangle - * - * @method _PointInTriangle - * @param px {Number} x coordinate of the point to test - * @param py {Number} y coordinate of the point to test - * @param ax {Number} x coordinate of the a point of the triangle - * @param ay {Number} y coordinate of the a point of the triangle - * @param bx {Number} x coordinate of the b point of the triangle - * @param by {Number} y coordinate of the b point of the triangle - * @param cx {Number} x coordinate of the c point of the triangle - * @param cy {Number} y coordinate of the c point of the triangle - * @private - * @return {Boolean} - */ -PIXI.PolyK._PointInTriangle = function(px, py, ax, ay, bx, by, cx, cy) -{ - var v0x = cx-ax; - var v0y = cy-ay; - var v1x = bx-ax; - var v1y = by-ay; - var v2x = px-ax; - var v2y = py-ay; - - var dot00 = v0x*v0x+v0y*v0y; - var dot01 = v0x*v1x+v0y*v1y; - var dot02 = v0x*v2x+v0y*v2y; - var dot11 = v1x*v1x+v1y*v1y; - var dot12 = v1x*v2x+v1y*v2y; - - var invDenom = 1 / (dot00 * dot11 - dot01 * dot01); - var u = (dot11 * dot02 - dot01 * dot12) * invDenom; - var v = (dot00 * dot12 - dot01 * dot02) * invDenom; - - // Check if point is in triangle - return (u >= 0) && (v >= 0) && (u + v < 1); -}; - -/** - * Checks whether a shape is convex - * - * @method _convex - * @private - * @return {Boolean} - */ -PIXI.PolyK._convex = function(ax, ay, bx, by, cx, cy, sign) -{ - return ((ay-by)*(cx-bx) + (bx-ax)*(cy-by) >= 0) === sign; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @method initDefaultShaders -* @static -* @private -*/ -PIXI.initDefaultShaders = function() -{ -}; - -/** -* @method CompileVertexShader -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @return {Any} -*/ -PIXI.CompileVertexShader = function(gl, shaderSrc) -{ - return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER); -}; - -/** -* @method CompileFragmentShader -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @return {Any} -*/ -PIXI.CompileFragmentShader = function(gl, shaderSrc) -{ - return PIXI._CompileShader(gl, shaderSrc, gl.FRAGMENT_SHADER); -}; - -/** -* @method _CompileShader -* @static -* @private -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @param shaderType {Number} -* @return {Any} -*/ -PIXI._CompileShader = function(gl, shaderSrc, shaderType) -{ - var src = shaderSrc.join("\n"); - var shader = gl.createShader(shaderType); - gl.shaderSource(shader, src); - gl.compileShader(shader); - - if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) - { - window.console.log(gl.getShaderInfoLog(shader)); - return null; - } - - return shader; -}; - -/** -* @method compileProgram -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param vertexSrc {Array} -* @param fragmentSrc {Array} -* @return {Any} -*/ -PIXI.compileProgram = function(gl, vertexSrc, fragmentSrc) -{ - var fragmentShader = PIXI.CompileFragmentShader(gl, fragmentSrc); - var vertexShader = PIXI.CompileVertexShader(gl, vertexSrc); - - var shaderProgram = gl.createProgram(); - - gl.attachShader(shaderProgram, vertexShader); - gl.attachShader(shaderProgram, fragmentShader); - gl.linkProgram(shaderProgram); - - if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) - { - window.console.log("Could not initialise shaders"); - } - - return shaderProgram; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * @author Richard Davey http://www.photonstorm.com @photonstorm - */ - -/** -* @class PixiShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PixiShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]; - - /** - * A local texture counter for multi-texture shaders. - * @property textureCount - * @type Number - */ - this.textureCount = 0; - - /** - * A local flag - * @property firstRun - * @type Boolean - * @private - */ - this.firstRun = true; - - /** - * A dirty flag - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * Uniform attributes cache. - * @property attributes - * @type Array - * @private - */ - this.attributes = []; - - this.init(); -}; - -PIXI.PixiShader.prototype.constructor = PIXI.PixiShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PixiShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc || PIXI.PixiShader.defaultVertexSrc, this.fragmentSrc); - - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.dimensions = gl.getUniformLocation(program, 'dimensions'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - // Begin worst hack eva // - - // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? - // maybe its something to do with the current state of the gl context. - // I'm convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel - // If theres any webGL people that know why could happen please help :) - if(this.colorAttribute === -1) - { - this.colorAttribute = 2; - } - - this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute]; - - // End worst hack eva // - - // add those custom shaders! - for (var key in this.uniforms) - { - // get the uniform locations.. - this.uniforms[key].uniformLocation = gl.getUniformLocation(program, key); - } - - this.initUniforms(); - - this.program = program; -}; - -/** -* Initialises the shader uniform values. -* -* Uniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/ -* http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf -* -* @method initUniforms -*/ -PIXI.PixiShader.prototype.initUniforms = function() -{ - this.textureCount = 1; - var gl = this.gl; - var uniform; - - for (var key in this.uniforms) - { - uniform = this.uniforms[key]; - - var type = uniform.type; - - if (type === 'sampler2D') - { - uniform._init = false; - - if (uniform.value !== null) - { - this.initSampler2D(uniform); - } - } - else if (type === 'mat2' || type === 'mat3' || type === 'mat4') - { - // These require special handling - uniform.glMatrix = true; - uniform.glValueLength = 1; - - if (type === 'mat2') - { - uniform.glFunc = gl.uniformMatrix2fv; - } - else if (type === 'mat3') - { - uniform.glFunc = gl.uniformMatrix3fv; - } - else if (type === 'mat4') - { - uniform.glFunc = gl.uniformMatrix4fv; - } - } - else - { - // GL function reference - uniform.glFunc = gl['uniform' + type]; - - if (type === '2f' || type === '2i') - { - uniform.glValueLength = 2; - } - else if (type === '3f' || type === '3i') - { - uniform.glValueLength = 3; - } - else if (type === '4f' || type === '4i') - { - uniform.glValueLength = 4; - } - else - { - uniform.glValueLength = 1; - } - } - } - -}; - -/** -* Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded) -* -* @method initSampler2D -*/ -PIXI.PixiShader.prototype.initSampler2D = function(uniform) -{ - if (!uniform.value || !uniform.value.baseTexture || !uniform.value.baseTexture.hasLoaded) - { - return; - } - - var gl = this.gl; - - gl.activeTexture(gl['TEXTURE' + this.textureCount]); - gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]); - - // Extended texture data - if (uniform.textureData) - { - var data = uniform.textureData; - - // GLTexture = mag linear, min linear_mipmap_linear, wrap repeat + gl.generateMipmap(gl.TEXTURE_2D); - // GLTextureLinear = mag/min linear, wrap clamp - // GLTextureNearestRepeat = mag/min NEAREST, wrap repeat - // GLTextureNearest = mag/min nearest, wrap clamp - // AudioTexture = whatever + luminance + width 512, height 2, border 0 - // KeyTexture = whatever + luminance + width 256, height 2, border 0 - - // magFilter can be: gl.LINEAR, gl.LINEAR_MIPMAP_LINEAR or gl.NEAREST - // wrapS/T can be: gl.CLAMP_TO_EDGE or gl.REPEAT - - var magFilter = (data.magFilter) ? data.magFilter : gl.LINEAR; - var minFilter = (data.minFilter) ? data.minFilter : gl.LINEAR; - var wrapS = (data.wrapS) ? data.wrapS : gl.CLAMP_TO_EDGE; - var wrapT = (data.wrapT) ? data.wrapT : gl.CLAMP_TO_EDGE; - var format = (data.luminance) ? gl.LUMINANCE : gl.RGBA; - - if (data.repeat) - { - wrapS = gl.REPEAT; - wrapT = gl.REPEAT; - } - - gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, !!data.flipY); - - if (data.width) - { - var width = (data.width) ? data.width : 512; - var height = (data.height) ? data.height : 2; - var border = (data.border) ? data.border : 0; - - // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels); - gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, border, format, gl.UNSIGNED_BYTE, null); - } - else - { - // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, ImageData? pixels); - gl.texImage2D(gl.TEXTURE_2D, 0, format, gl.RGBA, gl.UNSIGNED_BYTE, uniform.value.baseTexture.source); - } - - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrapS); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT); - } - - gl.uniform1i(uniform.uniformLocation, this.textureCount); - - uniform._init = true; - - this.textureCount++; - -}; - -/** -* Updates the shader uniform values. -* -* @method syncUniforms -*/ -PIXI.PixiShader.prototype.syncUniforms = function() -{ - this.textureCount = 1; - var uniform; - var gl = this.gl; - - // This would probably be faster in an array and it would guarantee key order - for (var key in this.uniforms) - { - uniform = this.uniforms[key]; - - if (uniform.glValueLength === 1) - { - if (uniform.glMatrix === true) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.transpose, uniform.value); - } - else - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value); - } - } - else if (uniform.glValueLength === 2) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y); - } - else if (uniform.glValueLength === 3) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z); - } - else if (uniform.glValueLength === 4) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z, uniform.value.w); - } - else if (uniform.type === 'sampler2D') - { - if (uniform._init) - { - gl.activeTexture(gl['TEXTURE' + this.textureCount]); - - if(uniform.value.baseTexture._dirty[gl.id]) - { - PIXI.instances[gl.id].updateTexture(uniform.value.baseTexture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]); - } - - // gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id] || PIXI.createWebGLTexture( uniform.value.baseTexture, gl)); - gl.uniform1i(uniform.uniformLocation, this.textureCount); - this.textureCount++; - } - else - { - this.initSampler2D(uniform); - } - } - } - -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PixiShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; - -/** -* The Default Vertex shader source. -* -* @property defaultVertexSrc -* @type String -*/ -PIXI.PixiShader.defaultVertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aTextureCoord;', - 'attribute vec4 aColor;', - - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - - 'const vec2 center = vec2(-1.0, 1.0);', - - 'void main(void) {', - ' gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - ' vColor = vec4(aColor.rgb * aColor.a, aColor.a);', - '}' -]; -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class PixiFastShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PixiFastShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying float vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aPositionCoord;', - 'attribute vec2 aScale;', - 'attribute float aRotation;', - 'attribute vec2 aTextureCoord;', - 'attribute float aColor;', - - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - 'uniform mat3 uMatrix;', - - 'varying vec2 vTextureCoord;', - 'varying float vColor;', - - 'const vec2 center = vec2(-1.0, 1.0);', - - 'void main(void) {', - ' vec2 v;', - ' vec2 sv = aVertexPosition * aScale;', - ' v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);', - ' v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);', - ' v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;', - ' gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - // ' vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;', - ' vColor = aColor;', - '}' - ]; - - /** - * A local texture counter for multi-texture shaders. - * @property textureCount - * @type Number - */ - this.textureCount = 0; - - this.init(); -}; - -PIXI.PixiFastShader.prototype.constructor = PIXI.PixiFastShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PixiFastShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.dimensions = gl.getUniformLocation(program, 'dimensions'); - this.uMatrix = gl.getUniformLocation(program, 'uMatrix'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aPositionCoord = gl.getAttribLocation(program, 'aPositionCoord'); - - this.aScale = gl.getAttribLocation(program, 'aScale'); - this.aRotation = gl.getAttribLocation(program, 'aRotation'); - - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - // Begin worst hack eva // - - // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? - // maybe its somthing to do with the current state of the gl context. - // Im convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel - // If theres any webGL people that know why could happen please help :) - if(this.colorAttribute === -1) - { - this.colorAttribute = 2; - } - - this.attributes = [this.aVertexPosition, this.aPositionCoord, this.aScale, this.aRotation, this.aTextureCoord, this.colorAttribute]; - - // End worst hack eva // - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PixiFastShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class StripShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.StripShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - // 'varying float vColor;', - 'uniform float alpha;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * alpha;', - // ' gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);',//gl_FragColor * alpha;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aTextureCoord;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - // 'uniform float alpha;', - // 'uniform vec3 tint;', - 'varying vec2 vTextureCoord;', - // 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - // ' vColor = aColor * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.StripShader.prototype.constructor = PIXI.StripShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.StripShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - //this.dimensions = gl.getUniformLocation(this.program, 'dimensions'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - - this.attributes = [this.aVertexPosition, this.aTextureCoord]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.StripShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attribute = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class PrimitiveShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PrimitiveShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' gl_FragColor = vColor;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec4 aColor;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - 'uniform float alpha;', - 'uniform float flipY;', - 'uniform vec3 tint;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);', - ' vColor = aColor * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.PrimitiveShader.prototype.constructor = PIXI.PrimitiveShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PrimitiveShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.tintColor = gl.getUniformLocation(program, 'tint'); - this.flipY = gl.getUniformLocation(program, 'flipY'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - this.attributes = [this.aVertexPosition, this.colorAttribute]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PrimitiveShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class ComplexPrimitiveShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.ComplexPrimitiveShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - - 'precision mediump float;', - - 'varying vec4 vColor;', - - 'void main(void) {', - ' gl_FragColor = vColor;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - //'attribute vec4 aColor;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - - 'uniform vec3 tint;', - 'uniform float alpha;', - 'uniform vec3 color;', - 'uniform float flipY;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);', - ' vColor = vec4(color * alpha * tint, alpha);',//" * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.ComplexPrimitiveShader.prototype.constructor = PIXI.ComplexPrimitiveShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.ComplexPrimitiveShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.tintColor = gl.getUniformLocation(program, 'tint'); - this.color = gl.getUniformLocation(program, 'color'); - this.flipY = gl.getUniformLocation(program, 'flipY'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - // this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - this.attributes = [this.aVertexPosition, this.colorAttribute]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.ComplexPrimitiveShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attribute = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A set of functions used by the webGL renderer to draw the primitive graphics data - * - * @class WebGLGraphics - * @private - * @static - */ -PIXI.WebGLGraphics = function() -{ -}; - -/** - * Renders the graphics object - * - * @static - * @private - * @method renderGraphics - * @param graphics {Graphics} - * @param renderSession {Object} - */ -PIXI.WebGLGraphics.renderGraphics = function(graphics, renderSession)//projection, offset) -{ - var gl = renderSession.gl; - var projection = renderSession.projection, - offset = renderSession.offset, - shader = renderSession.shaderManager.primitiveShader, - webGLData; - - if(graphics.dirty) - { - PIXI.WebGLGraphics.updateGraphics(graphics, gl); - } - - var webGL = graphics._webGL[gl.id]; - - // This could be speeded up for sure! - - for (var i = 0; i < webGL.data.length; i++) - { - if(webGL.data[i].mode === 1) - { - webGLData = webGL.data[i]; - - renderSession.stencilManager.pushStencil(graphics, webGLData, renderSession); - - // render quad.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - renderSession.stencilManager.popStencil(graphics, webGLData, renderSession); - } - else - { - webGLData = webGL.data[i]; - - - renderSession.shaderManager.setShader( shader );//activatePrimitiveShader(); - shader = renderSession.shaderManager.primitiveShader; - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform1f(shader.flipY, 1); - - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - - gl.uniform1f(shader.alpha, graphics.worldAlpha); - - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0); - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4); - - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - } - } -}; - -/** - * Updates the graphics object - * - * @static - * @private - * @method updateGraphics - * @param graphicsData {Graphics} The graphics object to update - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLGraphics.updateGraphics = function(graphics, gl) -{ - // get the contexts graphics object - var webGL = graphics._webGL[gl.id]; - // if the graphics object does not exist in the webGL context time to create it! - if(!webGL)webGL = graphics._webGL[gl.id] = {lastIndex:0, data:[], gl:gl}; - - // flag the graphics as not dirty as we are about to update it... - graphics.dirty = false; - - var i; - - // if the user cleared the graphics object we will need to clear every object - if(graphics.clearDirty) - { - graphics.clearDirty = false; - - // lop through and return all the webGLDatas to the object pool so than can be reused later on - for (i = 0; i < webGL.data.length; i++) - { - var graphicsData = webGL.data[i]; - graphicsData.reset(); - PIXI.WebGLGraphics.graphicsDataPool.push( graphicsData ); - } - - // clear the array and reset the index.. - webGL.data = []; - webGL.lastIndex = 0; - } - - var webGLData; - - // loop through the graphics datas and construct each one.. - // if the object is a complex fill then the new stencil buffer technique will be used - // other wise graphics objects will be pushed into a batch.. - for (i = webGL.lastIndex; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - - if(data.type === PIXI.Graphics.POLY) - { - // need to add the points the the graphics object.. - data.points = data.shape.points.slice(); - if(data.shape.closed) - { - // close the poly if the value is true! - if(data.points[0] !== data.points[data.points.length-2] || data.points[1] !== data.points[data.points.length-1]) - { - data.points.push(data.points[0], data.points[1]); - } - } - - // MAKE SURE WE HAVE THE CORRECT TYPE.. - if(data.fill) - { - if(data.points.length >= 6) - { - if(data.points.length < 6 * 2) - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - - var canDrawUsingSimple = PIXI.WebGLGraphics.buildPoly(data, webGLData); - // console.log(canDrawUsingSimple); - - if(!canDrawUsingSimple) - { - // console.log("<>>>") - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1); - PIXI.WebGLGraphics.buildComplexPoly(data, webGLData); - } - - } - else - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1); - PIXI.WebGLGraphics.buildComplexPoly(data, webGLData); - } - } - } - - if(data.lineWidth > 0) - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - PIXI.WebGLGraphics.buildLine(data, webGLData); - - } - } - else - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - - if(data.type === PIXI.Graphics.RECT) - { - PIXI.WebGLGraphics.buildRectangle(data, webGLData); - } - else if(data.type === PIXI.Graphics.CIRC || data.type === PIXI.Graphics.ELIP) - { - PIXI.WebGLGraphics.buildCircle(data, webGLData); - } - else if(data.type === PIXI.Graphics.RREC) - { - PIXI.WebGLGraphics.buildRoundedRectangle(data, webGLData); - } - } - - webGL.lastIndex++; - } - - // upload all the dirty data... - for (i = 0; i < webGL.data.length; i++) - { - webGLData = webGL.data[i]; - if(webGLData.dirty)webGLData.upload(); - } -}; - -/** - * @static - * @private - * @method switchMode - * @param webGL {WebGLContext} - * @param type {Number} - */ -PIXI.WebGLGraphics.switchMode = function(webGL, type) -{ - var webGLData; - - if(!webGL.data.length) - { - webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl); - webGLData.mode = type; - webGL.data.push(webGLData); - } - else - { - webGLData = webGL.data[webGL.data.length-1]; - - if(webGLData.mode !== type || type === 1) - { - webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl); - webGLData.mode = type; - webGL.data.push(webGLData); - } - } - - webGLData.dirty = true; - - return webGLData; -}; - -/** - * Builds a rectangle to draw - * - * @static - * @private - * @method buildRectangle - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildRectangle = function(graphicsData, webGLData) -{ - // --- // - // need to convert points to a nice regular data - // - var rectData = graphicsData.shape; - var x = rectData.x; - var y = rectData.y; - var width = rectData.width; - var height = rectData.height; - - if(graphicsData.fill) - { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vertPos = verts.length/6; - - // start - verts.push(x, y); - verts.push(r, g, b, alpha); - - verts.push(x + width, y); - verts.push(r, g, b, alpha); - - verts.push(x , y + height); - verts.push(r, g, b, alpha); - - verts.push(x + width, y + height); - verts.push(r, g, b, alpha); - - // insert 2 dead triangles.. - indices.push(vertPos, vertPos, vertPos+1, vertPos+2, vertPos+3, vertPos+3); - } - - if(graphicsData.lineWidth) - { - var tempPoints = graphicsData.points; - - graphicsData.points = [x, y, - x + width, y, - x + width, y + height, - x, y + height, - x, y]; - - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Builds a rounded rectangle to draw - * - * @static - * @private - * @method buildRoundedRectangle - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildRoundedRectangle = function(graphicsData, webGLData) -{ - var rrectData = graphicsData.shape; - var x = rrectData.x; - var y = rrectData.y; - var width = rrectData.width; - var height = rrectData.height; - - var radius = rrectData.radius; - - var recPoints = []; - recPoints.push(x, y + radius); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x, y + height - radius, x, y + height, x + radius, y + height)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width, y + radius, x + width, y, x + width - radius, y)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + radius, y, x, y, x, y + radius)); - - if (graphicsData.fill) { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vecPos = verts.length/6; - - var triangles = PIXI.PolyK.Triangulate(recPoints); - - // - - var i = 0; - for (i = 0; i < triangles.length; i+=3) - { - indices.push(triangles[i] + vecPos); - indices.push(triangles[i] + vecPos); - indices.push(triangles[i+1] + vecPos); - indices.push(triangles[i+2] + vecPos); - indices.push(triangles[i+2] + vecPos); - } - - - for (i = 0; i < recPoints.length; i++) - { - verts.push(recPoints[i], recPoints[++i], r, g, b, alpha); - } - } - - if (graphicsData.lineWidth) { - var tempPoints = graphicsData.points; - - graphicsData.points = recPoints; - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Calculate the points for a quadratic bezier curve. (helper function..) - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c - * - * @static - * @private - * @method quadraticBezierCurve - * @param fromX {Number} Origin point x - * @param fromY {Number} Origin point x - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Array(Number)} - */ -PIXI.WebGLGraphics.quadraticBezierCurve = function(fromX, fromY, cpX, cpY, toX, toY) { - - var xa, - ya, - xb, - yb, - x, - y, - n = 20, - points = []; - - function getPt(n1 , n2, perc) { - var diff = n2 - n1; - - return n1 + ( diff * perc ); - } - - var j = 0; - for (var i = 0; i <= n; i++ ) - { - j = i / n; - - // The Green Line - xa = getPt( fromX , cpX , j ); - ya = getPt( fromY , cpY , j ); - xb = getPt( cpX , toX , j ); - yb = getPt( cpY , toY , j ); - - // The Black Dot - x = getPt( xa , xb , j ); - y = getPt( ya , yb , j ); - - points.push(x, y); - } - return points; -}; - -/** - * Builds a circle to draw - * - * @static - * @private - * @method buildCircle - * @param graphicsData {Graphics} The graphics object to draw - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildCircle = function(graphicsData, webGLData) -{ - // need to convert points to a nice regular data - var circleData = graphicsData.shape; - var x = circleData.x; - var y = circleData.y; - var width; - var height; - - // TODO - bit hacky?? - if(graphicsData.type === PIXI.Graphics.CIRC) - { - width = circleData.radius; - height = circleData.radius; - } - else - { - width = circleData.width; - height = circleData.height; - } - - var totalSegs = 40; - var seg = (Math.PI * 2) / totalSegs ; - - var i = 0; - - if(graphicsData.fill) - { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vecPos = verts.length/6; - - indices.push(vecPos); - - for (i = 0; i < totalSegs + 1 ; i++) - { - verts.push(x,y, r, g, b, alpha); - - verts.push(x + Math.sin(seg * i) * width, - y + Math.cos(seg * i) * height, - r, g, b, alpha); - - indices.push(vecPos++, vecPos++); - } - - indices.push(vecPos-1); - } - - if(graphicsData.lineWidth) - { - var tempPoints = graphicsData.points; - - graphicsData.points = []; - - for (i = 0; i < totalSegs + 1; i++) - { - graphicsData.points.push(x + Math.sin(seg * i) * width, - y + Math.cos(seg * i) * height); - } - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Builds a line to draw - * - * @static - * @private - * @method buildLine - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildLine = function(graphicsData, webGLData) -{ - // TODO OPTIMISE! - var i = 0; - var points = graphicsData.points; - if(points.length === 0)return; - - // if the line width is an odd number add 0.5 to align to a whole pixel - if(graphicsData.lineWidth%2) - { - for (i = 0; i < points.length; i++) { - points[i] += 0.5; - } - } - - // get first and last point.. figure out the middle! - var firstPoint = new PIXI.Point( points[0], points[1] ); - var lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); - - // if the first point is the last point - gonna have issues :) - if(firstPoint.x === lastPoint.x && firstPoint.y === lastPoint.y) - { - // need to clone as we are going to slightly modify the shape.. - points = points.slice(); - - points.pop(); - points.pop(); - - lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); - - var midPointX = lastPoint.x + (firstPoint.x - lastPoint.x) *0.5; - var midPointY = lastPoint.y + (firstPoint.y - lastPoint.y) *0.5; - - points.unshift(midPointX, midPointY); - points.push(midPointX, midPointY); - } - - var verts = webGLData.points; - var indices = webGLData.indices; - var length = points.length / 2; - var indexCount = points.length; - var indexStart = verts.length/6; - - // DRAW the Line - var width = graphicsData.lineWidth / 2; - - // sort color - var color = PIXI.hex2rgb(graphicsData.lineColor); - var alpha = graphicsData.lineAlpha; - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var px, py, p1x, p1y, p2x, p2y, p3x, p3y; - var perpx, perpy, perp2x, perp2y, perp3x, perp3y; - var a1, b1, c1, a2, b2, c2; - var denom, pdist, dist; - - p1x = points[0]; - p1y = points[1]; - - p2x = points[2]; - p2y = points[3]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - // start - verts.push(p1x - perpx , p1y - perpy, - r, g, b, alpha); - - verts.push(p1x + perpx , p1y + perpy, - r, g, b, alpha); - - for (i = 1; i < length-1; i++) - { - p1x = points[(i-1)*2]; - p1y = points[(i-1)*2 + 1]; - - p2x = points[(i)*2]; - p2y = points[(i)*2 + 1]; - - p3x = points[(i+1)*2]; - p3y = points[(i+1)*2 + 1]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - perp2x = -(p2y - p3y); - perp2y = p2x - p3x; - - dist = Math.sqrt(perp2x*perp2x + perp2y*perp2y); - perp2x /= dist; - perp2y /= dist; - perp2x *= width; - perp2y *= width; - - a1 = (-perpy + p1y) - (-perpy + p2y); - b1 = (-perpx + p2x) - (-perpx + p1x); - c1 = (-perpx + p1x) * (-perpy + p2y) - (-perpx + p2x) * (-perpy + p1y); - a2 = (-perp2y + p3y) - (-perp2y + p2y); - b2 = (-perp2x + p2x) - (-perp2x + p3x); - c2 = (-perp2x + p3x) * (-perp2y + p2y) - (-perp2x + p2x) * (-perp2y + p3y); - - denom = a1*b2 - a2*b1; - - if(Math.abs(denom) < 0.1 ) - { - - denom+=10.1; - verts.push(p2x - perpx , p2y - perpy, - r, g, b, alpha); - - verts.push(p2x + perpx , p2y + perpy, - r, g, b, alpha); - - continue; - } - - px = (b1*c2 - b2*c1)/denom; - py = (a2*c1 - a1*c2)/denom; - - - pdist = (px -p2x) * (px -p2x) + (py -p2y) + (py -p2y); - - - if(pdist > 140 * 140) - { - perp3x = perpx - perp2x; - perp3y = perpy - perp2y; - - dist = Math.sqrt(perp3x*perp3x + perp3y*perp3y); - perp3x /= dist; - perp3y /= dist; - perp3x *= width; - perp3y *= width; - - verts.push(p2x - perp3x, p2y -perp3y); - verts.push(r, g, b, alpha); - - verts.push(p2x + perp3x, p2y +perp3y); - verts.push(r, g, b, alpha); - - verts.push(p2x - perp3x, p2y -perp3y); - verts.push(r, g, b, alpha); - - indexCount++; - } - else - { - - verts.push(px , py); - verts.push(r, g, b, alpha); - - verts.push(p2x - (px-p2x), p2y - (py - p2y)); - verts.push(r, g, b, alpha); - } - } - - p1x = points[(length-2)*2]; - p1y = points[(length-2)*2 + 1]; - - p2x = points[(length-1)*2]; - p2y = points[(length-1)*2 + 1]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - verts.push(p2x - perpx , p2y - perpy); - verts.push(r, g, b, alpha); - - verts.push(p2x + perpx , p2y + perpy); - verts.push(r, g, b, alpha); - - indices.push(indexStart); - - for (i = 0; i < indexCount; i++) - { - indices.push(indexStart++); - } - - indices.push(indexStart-1); -}; - -/** - * Builds a complex polygon to draw - * - * @static - * @private - * @method buildComplexPoly - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildComplexPoly = function(graphicsData, webGLData) -{ - //TODO - no need to copy this as it gets turned into a FLoat32Array anyways.. - var points = graphicsData.points.slice(); - if(points.length < 6)return; - - // get first and last point.. figure out the middle! - var indices = webGLData.indices; - webGLData.points = points; - webGLData.alpha = graphicsData.fillAlpha; - webGLData.color = PIXI.hex2rgb(graphicsData.fillColor); - - /* - calclate the bounds.. - */ - var minX = Infinity; - var maxX = -Infinity; - - var minY = Infinity; - var maxY = -Infinity; - - var x,y; - - // get size.. - for (var i = 0; i < points.length; i+=2) - { - x = points[i]; - y = points[i+1]; - - minX = x < minX ? x : minX; - maxX = x > maxX ? x : maxX; - - minY = y < minY ? y : minY; - maxY = y > maxY ? y : maxY; - } - - // add a quad to the end cos there is no point making another buffer! - points.push(minX, minY, - maxX, minY, - maxX, maxY, - minX, maxY); - - // push a quad onto the end.. - - //TODO - this aint needed! - var length = points.length / 2; - for (i = 0; i < length; i++) - { - indices.push( i ); - } - -}; - -/** - * Builds a polygon to draw - * - * @static - * @private - * @method buildPoly - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildPoly = function(graphicsData, webGLData) -{ - var points = graphicsData.points; - - if(points.length < 6)return; - // get first and last point.. figure out the middle! - var verts = webGLData.points; - var indices = webGLData.indices; - - var length = points.length / 2; - - // sort color - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var triangles = PIXI.PolyK.Triangulate(points); - - if(!triangles)return false; - - var vertPos = verts.length / 6; - - var i = 0; - - for (i = 0; i < triangles.length; i+=3) - { - indices.push(triangles[i] + vertPos); - indices.push(triangles[i] + vertPos); - indices.push(triangles[i+1] + vertPos); - indices.push(triangles[i+2] +vertPos); - indices.push(triangles[i+2] + vertPos); - } - - for (i = 0; i < length; i++) - { - verts.push(points[i * 2], points[i * 2 + 1], - r, g, b, alpha); - } - - return true; -}; - -PIXI.WebGLGraphics.graphicsDataPool = []; - -/** - * @class WebGLGraphicsData - * @private - * @static - */ -PIXI.WebGLGraphicsData = function(gl) -{ - this.gl = gl; - - //TODO does this need to be split before uploding?? - this.color = [0,0,0]; // color split! - this.points = []; - this.indices = []; - this.buffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - this.mode = 1; - this.alpha = 1; - this.dirty = true; -}; - -/** - * @method reset - */ -PIXI.WebGLGraphicsData.prototype.reset = function() -{ - this.points = []; - this.indices = []; -}; - -/** - * @method upload - */ -PIXI.WebGLGraphicsData.prototype.upload = function() -{ - var gl = this.gl; - -// this.lastIndex = graphics.graphicsData.length; - this.glPoints = new PIXI.Float32Array(this.points); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer); - gl.bufferData(gl.ARRAY_BUFFER, this.glPoints, gl.STATIC_DRAW); - - this.glIndicies = new PIXI.Uint16Array(this.indices); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.glIndicies, gl.STATIC_DRAW); - - this.dirty = false; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -PIXI.glContexts = []; // this is where we store the webGL contexts for easy access. -PIXI.instances = []; - -/** - * The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer - * should be used for browsers that support webGL. This Render works by automatically managing webGLBatchs. - * So no need for Sprite Batches or Sprite Clouds. - * Don't forget to add the view to your DOM or you will not see anything :) - * - * @class WebGLRenderer - * @constructor - * @param [width=0] {Number} the width of the canvas view - * @param [height=0] {Number} the height of the canvas view - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - */ -PIXI.WebGLRenderer = function(width, height, options) -{ - if(options) - { - for (var i in PIXI.defaultRenderOptions) - { - if (typeof options[i] === 'undefined') options[i] = PIXI.defaultRenderOptions[i]; - } - } - else - { - options = PIXI.defaultRenderOptions; - } - - if(!PIXI.defaultRenderer) - { - PIXI.sayHello('webGL'); - PIXI.defaultRenderer = this; - } - - /** - * @property type - * @type Number - */ - this.type = PIXI.WEBGL_RENDERER; - - /** - * The resolution of the renderer - * - * @property resolution - * @type Number - * @default 1 - */ - this.resolution = options.resolution; - - // do a catch.. only 1 webGL renderer.. - - /** - * Whether the render view is transparent - * - * @property transparent - * @type Boolean - */ - this.transparent = options.transparent; - - /** - * Whether the render view should be resized automatically - * - * @property autoResize - * @type Boolean - */ - this.autoResize = options.autoResize || false; - - /** - * The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering. - * - * @property preserveDrawingBuffer - * @type Boolean - */ - this.preserveDrawingBuffer = options.preserveDrawingBuffer; - - /** - * This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true: - * If the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0). - * If the Stage is transparent, Pixi will clear to the target Stage's background color. - * Disable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set. - * - * @property clearBeforeRender - * @type Boolean - * @default - */ - this.clearBeforeRender = options.clearBeforeRender; - - /** - * The width of the canvas view - * - * @property width - * @type Number - * @default 800 - */ - this.width = width || 800; - - /** - * The height of the canvas view - * - * @property height - * @type Number - * @default 600 - */ - this.height = height || 600; - - /** - * The canvas element that everything is drawn to - * - * @property view - * @type HTMLCanvasElement - */ - this.view = options.view || document.createElement( 'canvas' ); - - // deal with losing context.. - - /** - * @property contextLostBound - * @type Function - */ - this.contextLostBound = this.handleContextLost.bind(this); - - /** - * @property contextRestoredBound - * @type Function - */ - this.contextRestoredBound = this.handleContextRestored.bind(this); - - this.view.addEventListener('webglcontextlost', this.contextLostBound, false); - this.view.addEventListener('webglcontextrestored', this.contextRestoredBound, false); - - /** - * @property _contextOptions - * @type Object - * @private - */ - this._contextOptions = { - alpha: this.transparent, - antialias: options.antialias, // SPEED UP?? - premultipliedAlpha:this.transparent && this.transparent !== 'notMultiplied', - stencil:true, - preserveDrawingBuffer: options.preserveDrawingBuffer - }; - - /** - * @property projection - * @type Point - */ - this.projection = new PIXI.Point(); - - /** - * @property offset - * @type Point - */ - this.offset = new PIXI.Point(0, 0); - - // time to create the render managers! each one focuses on managing a state in webGL - - /** - * Deals with managing the shader programs and their attribs - * @property shaderManager - * @type WebGLShaderManager - */ - this.shaderManager = new PIXI.WebGLShaderManager(); - - /** - * Manages the rendering of sprites - * @property spriteBatch - * @type WebGLSpriteBatch - */ - this.spriteBatch = new PIXI.WebGLSpriteBatch(); - - /** - * Manages the masks using the stencil buffer - * @property maskManager - * @type WebGLMaskManager - */ - this.maskManager = new PIXI.WebGLMaskManager(); - - /** - * Manages the filters - * @property filterManager - * @type WebGLFilterManager - */ - this.filterManager = new PIXI.WebGLFilterManager(); - - /** - * Manages the stencil buffer - * @property stencilManager - * @type WebGLStencilManager - */ - this.stencilManager = new PIXI.WebGLStencilManager(); - - /** - * Manages the blendModes - * @property blendModeManager - * @type WebGLBlendModeManager - */ - this.blendModeManager = new PIXI.WebGLBlendModeManager(); - - /** - * TODO remove - * @property renderSession - * @type Object - */ - this.renderSession = {}; - this.renderSession.gl = this.gl; - this.renderSession.drawCount = 0; - this.renderSession.shaderManager = this.shaderManager; - this.renderSession.maskManager = this.maskManager; - this.renderSession.filterManager = this.filterManager; - this.renderSession.blendModeManager = this.blendModeManager; - this.renderSession.spriteBatch = this.spriteBatch; - this.renderSession.stencilManager = this.stencilManager; - this.renderSession.renderer = this; - this.renderSession.resolution = this.resolution; - - // time init the context.. - this.initContext(); - - // map some webGL blend modes.. - this.mapBlendModes(); -}; - -// constructor -PIXI.WebGLRenderer.prototype.constructor = PIXI.WebGLRenderer; - -/** -* @method initContext -*/ -PIXI.WebGLRenderer.prototype.initContext = function() -{ - var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); - this.gl = gl; - - if (!gl) { - // fail, not able to get a context - throw new Error('This browser does not support webGL. Try using the canvas renderer'); - } - - this.glContextId = gl.id = PIXI.WebGLRenderer.glContextId ++; - - PIXI.glContexts[this.glContextId] = gl; - - PIXI.instances[this.glContextId] = this; - - // set up the default pixi settings.. - gl.disable(gl.DEPTH_TEST); - gl.disable(gl.CULL_FACE); - gl.enable(gl.BLEND); - - // need to set the context for all the managers... - this.shaderManager.setContext(gl); - this.spriteBatch.setContext(gl); - this.maskManager.setContext(gl); - this.filterManager.setContext(gl); - this.blendModeManager.setContext(gl); - this.stencilManager.setContext(gl); - - this.renderSession.gl = this.gl; - - // now resize and we are good to go! - this.resize(this.width, this.height); -}; - -/** - * Renders the stage to its webGL view - * - * @method render - * @param stage {Stage} the Stage element to be rendered - */ -PIXI.WebGLRenderer.prototype.render = function(stage) -{ - // no point rendering if our context has been blown up! - if(this.contextLost)return; - - // if rendering a new stage clear the batches.. - if(this.__stage !== stage) - { - if(stage.interactive)stage.interactionManager.removeEvents(); - - // TODO make this work - // dont think this is needed any more? - this.__stage = stage; - } - - // update the scene graph - stage.updateTransform(); - - var gl = this.gl; - - // interaction - if(stage._interactive) - { - //need to add some events! - if(!stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = true; - stage.interactionManager.setTarget(this); - } - } - else - { - if(stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = false; - stage.interactionManager.setTarget(this); - } - } - - // -- Does this need to be set every frame? -- // - gl.viewport(0, 0, this.width, this.height); - - // make sure we are bound to the main frame buffer - gl.bindFramebuffer(gl.FRAMEBUFFER, null); - - if (this.clearBeforeRender) - { - if(this.transparent) - { - gl.clearColor(0, 0, 0, 0); - } - else - { - gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], 1); - } - - gl.clear (gl.COLOR_BUFFER_BIT); - } - - this.renderDisplayObject( stage, this.projection ); -}; - -/** - * Renders a Display Object. - * - * @method renderDisplayObject - * @param displayObject {DisplayObject} The DisplayObject to render - * @param projection {Point} The projection - * @param buffer {Array} a standard WebGL buffer - */ -PIXI.WebGLRenderer.prototype.renderDisplayObject = function(displayObject, projection, buffer) -{ - this.renderSession.blendModeManager.setBlendMode(PIXI.blendModes.NORMAL); - - // reset the render session data.. - this.renderSession.drawCount = 0; - - // make sure to flip the Y if using a render texture.. - this.renderSession.flipY = buffer ? -1 : 1; - - // set the default projection - this.renderSession.projection = projection; - - //set the default offset - this.renderSession.offset = this.offset; - - // start the sprite batch - this.spriteBatch.begin(this.renderSession); - - // start the filter manager - this.filterManager.begin(this.renderSession, buffer); - - // render the scene! - displayObject._renderWebGL(this.renderSession); - - // finish the sprite batch - this.spriteBatch.end(); -}; - -/** - * Resizes the webGL view to the specified width and height. - * - * @method resize - * @param width {Number} the new width of the webGL view - * @param height {Number} the new height of the webGL view - */ -PIXI.WebGLRenderer.prototype.resize = function(width, height) -{ - this.width = width * this.resolution; - this.height = height * this.resolution; - - this.view.width = this.width; - this.view.height = this.height; - - if (this.autoResize) { - this.view.style.width = this.width / this.resolution + 'px'; - this.view.style.height = this.height / this.resolution + 'px'; - } - - this.gl.viewport(0, 0, this.width, this.height); - - this.projection.x = this.width / 2 / this.resolution; - this.projection.y = -this.height / 2 / this.resolution; -}; - -/** - * Updates and Creates a WebGL texture for the renderers context. - * - * @method updateTexture - * @param texture {Texture} the texture to update - */ -PIXI.WebGLRenderer.prototype.updateTexture = function(texture) -{ - if(!texture.hasLoaded )return; - - var gl = this.gl; - - if(!texture._glTextures[gl.id])texture._glTextures[gl.id] = gl.createTexture(); - - gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]); - - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultipliedAlpha); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source); - - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - - - if(texture.mipmap && PIXI.isPowerOfTwo(texture.width, texture.height)) - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR_MIPMAP_LINEAR : gl.NEAREST_MIPMAP_NEAREST); - gl.generateMipmap(gl.TEXTURE_2D); - } - else - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - } - - // reguler... - if(!texture._powerOf2) - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - } - else - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT); - } - - texture._dirty[gl.id] = false; - - return texture._glTextures[gl.id]; -}; - -/** - * Handles a lost webgl context - * - * @method handleContextLost - * @param event {Event} - * @private - */ -PIXI.WebGLRenderer.prototype.handleContextLost = function(event) -{ - event.preventDefault(); - this.contextLost = true; -}; - -/** - * Handles a restored webgl context - * - * @method handleContextRestored - * @param event {Event} - * @private - */ -PIXI.WebGLRenderer.prototype.handleContextRestored = function() -{ - this.initContext(); - - // empty all the ol gl textures as they are useless now - for(var key in PIXI.TextureCache) - { - var texture = PIXI.TextureCache[key].baseTexture; - texture._glTextures = []; - } - - this.contextLost = false; -}; - -/** - * Removes everything from the renderer (event listeners, spritebatch, etc...) - * - * @method destroy - */ -PIXI.WebGLRenderer.prototype.destroy = function() -{ - // remove listeners - this.view.removeEventListener('webglcontextlost', this.contextLostBound); - this.view.removeEventListener('webglcontextrestored', this.contextRestoredBound); - - PIXI.glContexts[this.glContextId] = null; - - this.projection = null; - this.offset = null; - - // time to create the render managers! each one focuses on managine a state in webGL - this.shaderManager.destroy(); - this.spriteBatch.destroy(); - this.maskManager.destroy(); - this.filterManager.destroy(); - - this.shaderManager = null; - this.spriteBatch = null; - this.maskManager = null; - this.filterManager = null; - - this.gl = null; - this.renderSession = null; -}; - -/** - * Maps Pixi blend modes to WebGL blend modes. - * - * @method mapBlendModes - */ -PIXI.WebGLRenderer.prototype.mapBlendModes = function() -{ - var gl = this.gl; - - if(!PIXI.blendModesWebGL) - { - PIXI.blendModesWebGL = []; - - PIXI.blendModesWebGL[PIXI.blendModes.NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.ADD] = [gl.SRC_ALPHA, gl.DST_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SCREEN] = [gl.SRC_ALPHA, gl.ONE]; - PIXI.blendModesWebGL[PIXI.blendModes.OVERLAY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.DARKEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.LIGHTEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR_DODGE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR_BURN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.HARD_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SOFT_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.DIFFERENCE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.EXCLUSION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.HUE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SATURATION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.LUMINOSITY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - } -}; - -PIXI.WebGLRenderer.glContextId = 0; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLBlendModeManager -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLBlendModeManager = function() -{ - /** - * @property currentBlendMode - * @type Number - */ - this.currentBlendMode = 99999; -}; - -PIXI.WebGLBlendModeManager.prototype.constructor = PIXI.WebGLBlendModeManager; - -/** - * Sets the WebGL Context. - * - * @method setContext - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLBlendModeManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Sets-up the given blendMode from WebGL's point of view. -* -* @method setBlendMode -* @param blendMode {Number} the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD -*/ -PIXI.WebGLBlendModeManager.prototype.setBlendMode = function(blendMode) -{ - if(this.currentBlendMode === blendMode)return false; - - this.currentBlendMode = blendMode; - - var blendModeWebGL = PIXI.blendModesWebGL[this.currentBlendMode]; - this.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); - - return true; -}; - -/** -* Destroys this object. -* -* @method destroy -*/ -PIXI.WebGLBlendModeManager.prototype.destroy = function() -{ - this.gl = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLMaskManager -* @constructor -* @private -*/ -PIXI.WebGLMaskManager = function() -{ -}; - -PIXI.WebGLMaskManager.prototype.constructor = PIXI.WebGLMaskManager; - -/** -* Sets the drawing context to the one given in parameter. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLMaskManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Applies the Mask and adds it to the current filter stack. -* -* @method pushMask -* @param maskData {Array} -* @param renderSession {Object} -*/ -PIXI.WebGLMaskManager.prototype.pushMask = function(maskData, renderSession) -{ - var gl = renderSession.gl; - - if(maskData.dirty) - { - PIXI.WebGLGraphics.updateGraphics(maskData, gl); - } - - if(!maskData._webGL[gl.id].data.length)return; - - renderSession.stencilManager.pushStencil(maskData, maskData._webGL[gl.id].data[0], renderSession); -}; - -/** -* Removes the last filter from the filter stack and doesn't return it. -* -* @method popMask -* @param maskData {Array} -* @param renderSession {Object} an object containing all the useful parameters -*/ -PIXI.WebGLMaskManager.prototype.popMask = function(maskData, renderSession) -{ - var gl = this.gl; - renderSession.stencilManager.popStencil(maskData, maskData._webGL[gl.id].data[0], renderSession); -}; - -/** -* Destroys the mask stack. -* -* @method destroy -*/ -PIXI.WebGLMaskManager.prototype.destroy = function() -{ - this.gl = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLStencilManager -* @constructor -* @private -*/ -PIXI.WebGLStencilManager = function() -{ - this.stencilStack = []; - this.reverse = true; - this.count = 0; -}; - -/** -* Sets the drawing context to the one given in parameter. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLStencilManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Applies the Mask and adds it to the current filter stack. -* -* @method pushMask -* @param graphics {Graphics} -* @param webGLData {Array} -* @param renderSession {Object} -*/ -PIXI.WebGLStencilManager.prototype.pushStencil = function(graphics, webGLData, renderSession) -{ - var gl = this.gl; - this.bindGraphics(graphics, webGLData, renderSession); - - if(this.stencilStack.length === 0) - { - gl.enable(gl.STENCIL_TEST); - gl.clear(gl.STENCIL_BUFFER_BIT); - this.reverse = true; - this.count = 0; - } - - this.stencilStack.push(webGLData); - - var level = this.count; - - gl.colorMask(false, false, false, false); - - gl.stencilFunc(gl.ALWAYS,0,0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT); - - // draw the triangle strip! - - if(webGLData.mode === 1) - { - gl.drawElements(gl.TRIANGLE_FAN, webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 ); - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - - // draw a quad to increment.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - } - - this.reverse = !this.reverse; - } - else - { - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - } - } - - gl.colorMask(true, true, true, true); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP); - - this.count++; -}; - -/** - * TODO this does not belong here! - * - * @method bindGraphics - * @param graphics {Graphics} - * @param webGLData {Array} - * @param renderSession {Object} - */ -PIXI.WebGLStencilManager.prototype.bindGraphics = function(graphics, webGLData, renderSession) -{ - //if(this._currentGraphics === graphics)return; - this._currentGraphics = graphics; - - var gl = this.gl; - - // bind the graphics object.. - var projection = renderSession.projection, - offset = renderSession.offset, - shader;// = renderSession.shaderManager.primitiveShader; - - if(webGLData.mode === 1) - { - shader = renderSession.shaderManager.complexPrimitiveShader; - - renderSession.shaderManager.setShader( shader ); - - gl.uniform1f(shader.flipY, renderSession.flipY); - - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - gl.uniform3fv(shader.color, webGLData.color); - - gl.uniform1f(shader.alpha, graphics.worldAlpha * webGLData.alpha); - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 2, 0); - - - // now do the rest.. - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - } - else - { - //renderSession.shaderManager.activatePrimitiveShader(); - shader = renderSession.shaderManager.primitiveShader; - renderSession.shaderManager.setShader( shader ); - - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform1f(shader.flipY, renderSession.flipY); - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - - gl.uniform1f(shader.alpha, graphics.worldAlpha); - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0); - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4); - - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - } -}; - -/** - * @method popStencil - * @param graphics {Graphics} - * @param webGLData {Array} - * @param renderSession {Object} - */ -PIXI.WebGLStencilManager.prototype.popStencil = function(graphics, webGLData, renderSession) -{ - var gl = this.gl; - this.stencilStack.pop(); - - this.count--; - - if(this.stencilStack.length === 0) - { - // the stack is empty! - gl.disable(gl.STENCIL_TEST); - - } - else - { - - var level = this.count; - - this.bindGraphics(graphics, webGLData, renderSession); - - gl.colorMask(false, false, false, false); - - if(webGLData.mode === 1) - { - this.reverse = !this.reverse; - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - - // draw a quad to increment.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - gl.stencilFunc(gl.ALWAYS,0,0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT); - - // draw the triangle strip! - gl.drawElements(gl.TRIANGLE_FAN, webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - } - - } - else - { - // console.log("<<>>") - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - } - } - - gl.colorMask(true, true, true, true); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP); - - - } -}; - -/** -* Destroys the mask stack. -* -* @method destroy -*/ -PIXI.WebGLStencilManager.prototype.destroy = function() -{ - this.stencilStack = null; - this.gl = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLShaderManager -* @constructor -* @private -*/ -PIXI.WebGLShaderManager = function() -{ - /** - * @property maxAttibs - * @type Number - */ - this.maxAttibs = 10; - - /** - * @property attribState - * @type Array - */ - this.attribState = []; - - /** - * @property tempAttribState - * @type Array - */ - this.tempAttribState = []; - - for (var i = 0; i < this.maxAttibs; i++) - { - this.attribState[i] = false; - } - - /** - * @property stack - * @type Array - */ - this.stack = []; - -}; - -PIXI.WebGLShaderManager.prototype.constructor = PIXI.WebGLShaderManager; - -/** -* Initialises the context and the properties. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLShaderManager.prototype.setContext = function(gl) -{ - this.gl = gl; - - // the next one is used for rendering primitives - this.primitiveShader = new PIXI.PrimitiveShader(gl); - - // the next one is used for rendering triangle strips - this.complexPrimitiveShader = new PIXI.ComplexPrimitiveShader(gl); - - // this shader is used for the default sprite rendering - this.defaultShader = new PIXI.PixiShader(gl); - - // this shader is used for the fast sprite rendering - this.fastShader = new PIXI.PixiFastShader(gl); - - // the next one is used for rendering triangle strips - this.stripShader = new PIXI.StripShader(gl); - this.setShader(this.defaultShader); -}; - -/** -* Takes the attributes given in parameters. -* -* @method setAttribs -* @param attribs {Array} attribs -*/ -PIXI.WebGLShaderManager.prototype.setAttribs = function(attribs) -{ - // reset temp state - var i; - - for (i = 0; i < this.tempAttribState.length; i++) - { - this.tempAttribState[i] = false; - } - - // set the new attribs - for (i = 0; i < attribs.length; i++) - { - var attribId = attribs[i]; - this.tempAttribState[attribId] = true; - } - - var gl = this.gl; - - for (i = 0; i < this.attribState.length; i++) - { - if(this.attribState[i] !== this.tempAttribState[i]) - { - this.attribState[i] = this.tempAttribState[i]; - - if(this.tempAttribState[i]) - { - gl.enableVertexAttribArray(i); - } - else - { - gl.disableVertexAttribArray(i); - } - } - } -}; - -/** -* Sets the current shader. -* -* @method setShader -* @param shader {Any} -*/ -PIXI.WebGLShaderManager.prototype.setShader = function(shader) -{ - if(this._currentId === shader._UID)return false; - - this._currentId = shader._UID; - - this.currentShader = shader; - - this.gl.useProgram(shader.program); - this.setAttribs(shader.attributes); - - return true; -}; - -/** -* Destroys this object. -* -* @method destroy -*/ -PIXI.WebGLShaderManager.prototype.destroy = function() -{ - this.attribState = null; - - this.tempAttribState = null; - - this.primitiveShader.destroy(); - - this.complexPrimitiveShader.destroy(); - - this.defaultShader.destroy(); - - this.fastShader.destroy(); - - this.stripShader.destroy(); - - this.gl = null; -}; - -/** - * @author Mat Groves - * - * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ - * for creating the original pixi version! - * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now share 4 bytes on the vertex buffer - * - * Heavily inspired by LibGDX's WebGLSpriteBatch: - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java - */ - - /** - * - * @class WebGLSpriteBatch - * @private - * @constructor - */ -PIXI.WebGLSpriteBatch = function() -{ - /** - * @property vertSize - * @type Number - */ - this.vertSize = 5; - - /** - * The number of images in the SpriteBatch before it flushes - * @property size - * @type Number - */ - this.size = 2000;//Math.pow(2, 16) / this.vertSize; - - //the total number of bytes in our batch - var numVerts = this.size * 4 * 4 * this.vertSize; - //the total number of indices in our batch - var numIndices = this.size * 6; - - /** - * Holds the vertices - * - * @property vertices - * @type ArrayBuffer - */ - this.vertices = new PIXI.ArrayBuffer(numVerts); - - /** - * View on the vertices as a Float32Array - * - * @property positions - * @type Float32Array - */ - this.positions = new PIXI.Float32Array(this.vertices); - - /** - * View on the vertices as a Uint32Array - * - * @property colors - * @type Uint32Array - */ - this.colors = new PIXI.Uint32Array(this.vertices); - - /** - * Holds the indices - * - * @property indices - * @type Uint16Array - */ - this.indices = new PIXI.Uint16Array(numIndices); - - /** - * @property lastIndexCount - * @type Number - */ - this.lastIndexCount = 0; - - for (var i=0, j=0; i < numIndices; i += 6, j += 4) - { - this.indices[i + 0] = j + 0; - this.indices[i + 1] = j + 1; - this.indices[i + 2] = j + 2; - this.indices[i + 3] = j + 0; - this.indices[i + 4] = j + 2; - this.indices[i + 5] = j + 3; - } - - /** - * @property drawing - * @type Boolean - */ - this.drawing = false; - - /** - * @property currentBatchSize - * @type Number - */ - this.currentBatchSize = 0; - - /** - * @property currentBaseTexture - * @type BaseTexture - */ - this.currentBaseTexture = null; - - /** - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * @property textures - * @type Array - */ - this.textures = []; - - /** - * @property blendModes - * @type Array - */ - this.blendModes = []; - - /** - * @property shaders - * @type Array - */ - this.shaders = []; - - /** - * @property sprites - * @type Array - */ - this.sprites = []; - - /** - * @property defaultShader - * @type AbstractFilter - */ - this.defaultShader = new PIXI.AbstractFilter([ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]); -}; - -/** -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLSpriteBatch.prototype.setContext = function(gl) -{ - this.gl = gl; - - // create a couple of buffers - this.vertexBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // 65535 is max index, so 65535 / 6 = 10922. - - //upload the index data - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); - - this.currentBlendMode = 99999; - - var shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc = this.defaultShader.fragmentSrc; - shader.uniforms = {}; - shader.init(); - - this.defaultShader.shaders[gl.id] = shader; -}; - -/** -* @method begin -* @param renderSession {Object} The RenderSession object -*/ -PIXI.WebGLSpriteBatch.prototype.begin = function(renderSession) -{ - this.renderSession = renderSession; - this.shader = this.renderSession.shaderManager.defaultShader; - - this.start(); -}; - -/** -* @method end -*/ -PIXI.WebGLSpriteBatch.prototype.end = function() -{ - this.flush(); -}; - -/** -* @method render -* @param sprite {Sprite} the sprite to render when using this spritebatch -*/ -PIXI.WebGLSpriteBatch.prototype.render = function(sprite) -{ - var texture = sprite.texture; - - //TODO set blend modes.. - // check texture.. - if(this.currentBatchSize >= this.size) - { - this.flush(); - this.currentBaseTexture = texture.baseTexture; - } - - // get the uvs for the texture - var uvs = texture._uvs; - // if the uvs have not updated then no point rendering just yet! - if(!uvs)return; - - // TODO trim?? - var aX = sprite.anchor.x; - var aY = sprite.anchor.y; - - var w0, w1, h0, h1; - - if (texture.trim) - { - // if the sprite is trimmed then we need to add the extra space before transforming the sprite coords.. - var trim = texture.trim; - - w1 = trim.x - aX * trim.width; - w0 = w1 + texture.crop.width; - - h1 = trim.y - aY * trim.height; - h0 = h1 + texture.crop.height; - - } - else - { - w0 = (texture.frame.width ) * (1-aX); - w1 = (texture.frame.width ) * -aX; - - h0 = texture.frame.height * (1-aY); - h1 = texture.frame.height * -aY; - } - - var index = this.currentBatchSize * 4 * this.vertSize; - - var resolution = texture.baseTexture.resolution; - - var worldTransform = sprite.worldTransform; - - var a = worldTransform.a / resolution; - var b = worldTransform.b / resolution; - var c = worldTransform.c / resolution; - var d = worldTransform.d / resolution; - var tx = worldTransform.tx; - var ty = worldTransform.ty; - - var colors = this.colors; - var positions = this.positions; - - if(this.renderSession.roundPixels) - { - // xy - positions[index] = a * w1 + c * h1 + tx | 0; - positions[index+1] = d * h1 + b * w1 + ty | 0; - - // xy - positions[index+5] = a * w0 + c * h1 + tx | 0; - positions[index+6] = d * h1 + b * w0 + ty | 0; - - // xy - positions[index+10] = a * w0 + c * h0 + tx | 0; - positions[index+11] = d * h0 + b * w0 + ty | 0; - - // xy - positions[index+15] = a * w1 + c * h0 + tx | 0; - positions[index+16] = d * h0 + b * w1 + ty | 0; - } - else - { - // xy - positions[index] = a * w1 + c * h1 + tx; - positions[index+1] = d * h1 + b * w1 + ty; - - // xy - positions[index+5] = a * w0 + c * h1 + tx; - positions[index+6] = d * h1 + b * w0 + ty; - - // xy - positions[index+10] = a * w0 + c * h0 + tx; - positions[index+11] = d * h0 + b * w0 + ty; - - // xy - positions[index+15] = a * w1 + c * h0 + tx; - positions[index+16] = d * h0 + b * w1 + ty; - } - - // uv - positions[index+2] = uvs.x0; - positions[index+3] = uvs.y0; - - // uv - positions[index+7] = uvs.x1; - positions[index+8] = uvs.y1; - - // uv - positions[index+12] = uvs.x2; - positions[index+13] = uvs.y2; - - // uv - positions[index+17] = uvs.x3; - positions[index+18] = uvs.y3; - - // color and alpha - var tint = sprite.tint; - colors[index+4] = colors[index+9] = colors[index+14] = colors[index+19] = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16) + (sprite.worldAlpha * 255 << 24); - - // increment the batchsize - this.sprites[this.currentBatchSize++] = sprite; - - -}; - -/** -* Renders a TilingSprite using the spriteBatch. -* -* @method renderTilingSprite -* @param sprite {TilingSprite} the tilingSprite to render -*/ -PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite) -{ - var texture = tilingSprite.tilingTexture; - - // check texture.. - if(this.currentBatchSize >= this.size) - { - //return; - this.flush(); - this.currentBaseTexture = texture.baseTexture; - } - - // set the textures uvs temporarily - // TODO create a separate texture so that we can tile part of a texture - - if(!tilingSprite._uvs)tilingSprite._uvs = new PIXI.TextureUvs(); - - var uvs = tilingSprite._uvs; - - tilingSprite.tilePosition.x %= texture.baseTexture.width * tilingSprite.tileScaleOffset.x; - tilingSprite.tilePosition.y %= texture.baseTexture.height * tilingSprite.tileScaleOffset.y; - - var offsetX = tilingSprite.tilePosition.x/(texture.baseTexture.width*tilingSprite.tileScaleOffset.x); - var offsetY = tilingSprite.tilePosition.y/(texture.baseTexture.height*tilingSprite.tileScaleOffset.y); - - var scaleX = (tilingSprite.width / texture.baseTexture.width) / (tilingSprite.tileScale.x * tilingSprite.tileScaleOffset.x); - var scaleY = (tilingSprite.height / texture.baseTexture.height) / (tilingSprite.tileScale.y * tilingSprite.tileScaleOffset.y); - - uvs.x0 = 0 - offsetX; - uvs.y0 = 0 - offsetY; - - uvs.x1 = (1 * scaleX) - offsetX; - uvs.y1 = 0 - offsetY; - - uvs.x2 = (1 * scaleX) - offsetX; - uvs.y2 = (1 * scaleY) - offsetY; - - uvs.x3 = 0 - offsetX; - uvs.y3 = (1 * scaleY) - offsetY; - - // get the tilingSprites current alpha and tint and combining them into a single color - var tint = tilingSprite.tint; - var color = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16) + (tilingSprite.alpha * 255 << 24); - - var positions = this.positions; - var colors = this.colors; - - var width = tilingSprite.width; - var height = tilingSprite.height; - - // TODO trim?? - var aX = tilingSprite.anchor.x; - var aY = tilingSprite.anchor.y; - var w0 = width * (1-aX); - var w1 = width * -aX; - - var h0 = height * (1-aY); - var h1 = height * -aY; - - var index = this.currentBatchSize * 4 * this.vertSize; - - var resolution = texture.baseTexture.resolution; - - var worldTransform = tilingSprite.worldTransform; - - var a = worldTransform.a / resolution;//[0]; - var b = worldTransform.b / resolution;//[3]; - var c = worldTransform.c / resolution;//[1]; - var d = worldTransform.d / resolution;//[4]; - var tx = worldTransform.tx;//[2]; - var ty = worldTransform.ty;//[5]; - - // xy - positions[index++] = a * w1 + c * h1 + tx; - positions[index++] = d * h1 + b * w1 + ty; - // uv - positions[index++] = uvs.x0; - positions[index++] = uvs.y0; - // color - colors[index++] = color; - - // xy - positions[index++] = (a * w0 + c * h1 + tx); - positions[index++] = d * h1 + b * w0 + ty; - // uv - positions[index++] = uvs.x1; - positions[index++] = uvs.y1; - // color - colors[index++] = color; - - // xy - positions[index++] = a * w0 + c * h0 + tx; - positions[index++] = d * h0 + b * w0 + ty; - // uv - positions[index++] = uvs.x2; - positions[index++] = uvs.y2; - // color - colors[index++] = color; - - // xy - positions[index++] = a * w1 + c * h0 + tx; - positions[index++] = d * h0 + b * w1 + ty; - // uv - positions[index++] = uvs.x3; - positions[index++] = uvs.y3; - // color - colors[index++] = color; - - // increment the batchsize - this.sprites[this.currentBatchSize++] = tilingSprite; -}; - -/** -* Renders the content and empties the current batch. -* -* @method flush -*/ -PIXI.WebGLSpriteBatch.prototype.flush = function() -{ - // If the batch is length 0 then return as there is nothing to draw - if (this.currentBatchSize===0)return; - - var gl = this.gl; - var shader; - - if(this.dirty) - { - this.dirty = false; - // bind the main texture - gl.activeTexture(gl.TEXTURE0); - - // bind the buffers - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - shader = this.defaultShader.shaders[gl.id]; - - // this is the same for each shader? - var stride = this.vertSize * 4; - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, stride, 2 * 4); - - // color attributes will be interpreted as unsigned bytes and normalized - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.UNSIGNED_BYTE, true, stride, 4 * 4); - } - - // upload the verts to the buffer - if(this.currentBatchSize > ( this.size * 0.5 ) ) - { - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - } - else - { - var view = this.positions.subarray(0, this.currentBatchSize * 4 * this.vertSize); - gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); - } - - var nextTexture, nextBlendMode, nextShader; - var batchSize = 0; - var start = 0; - - var currentBaseTexture = null; - var currentBlendMode = this.renderSession.blendModeManager.currentBlendMode; - var currentShader = null; - - var blendSwap = false; - var shaderSwap = false; - var sprite; - - for (var i = 0, j = this.currentBatchSize; i < j; i++) { - - sprite = this.sprites[i]; - - nextTexture = sprite.texture.baseTexture; - nextBlendMode = sprite.blendMode; - nextShader = sprite.shader || this.defaultShader; - - blendSwap = currentBlendMode !== nextBlendMode; - shaderSwap = currentShader !== nextShader; // should I use _UIDS??? - - if(currentBaseTexture !== nextTexture || blendSwap || shaderSwap) - { - this.renderBatch(currentBaseTexture, batchSize, start); - - start = i; - batchSize = 0; - currentBaseTexture = nextTexture; - - if( blendSwap ) - { - currentBlendMode = nextBlendMode; - this.renderSession.blendModeManager.setBlendMode( currentBlendMode ); - } - - if( shaderSwap ) - { - currentShader = nextShader; - - shader = currentShader.shaders[gl.id]; - - if(!shader) - { - shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc =currentShader.fragmentSrc; - shader.uniforms =currentShader.uniforms; - shader.init(); - - currentShader.shaders[gl.id] = shader; - } - - // set shader function??? - this.renderSession.shaderManager.setShader(shader); - - if(shader.dirty)shader.syncUniforms(); - - // both thease only need to be set if they are changing.. - // set the projection - var projection = this.renderSession.projection; - gl.uniform2f(shader.projectionVector, projection.x, projection.y); - - // TODO - this is temprorary! - var offsetVector = this.renderSession.offset; - gl.uniform2f(shader.offsetVector, offsetVector.x, offsetVector.y); - - // set the pointers - } - } - - batchSize++; - } - - this.renderBatch(currentBaseTexture, batchSize, start); - - // then reset the batch! - this.currentBatchSize = 0; -}; - -/** -* @method renderBatch -* @param texture {Texture} -* @param size {Number} -* @param startIndex {Number} -*/ -PIXI.WebGLSpriteBatch.prototype.renderBatch = function(texture, size, startIndex) -{ - if(size === 0)return; - - var gl = this.gl; - - // check if a texture is dirty.. - if(texture._dirty[gl.id]) - { - this.renderSession.renderer.updateTexture(texture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]); - } - - // now draw those suckas! - gl.drawElements(gl.TRIANGLES, size * 6, gl.UNSIGNED_SHORT, startIndex * 6 * 2); - - // increment the draw count - this.renderSession.drawCount++; -}; - -/** -* @method stop -*/ -PIXI.WebGLSpriteBatch.prototype.stop = function() -{ - this.flush(); - this.dirty = true; -}; - -/** -* @method start -*/ -PIXI.WebGLSpriteBatch.prototype.start = function() -{ - this.dirty = true; -}; - -/** -* Destroys the SpriteBatch. -* -* @method destroy -*/ -PIXI.WebGLSpriteBatch.prototype.destroy = function() -{ - this.vertices = null; - this.indices = null; - - this.gl.deleteBuffer( this.vertexBuffer ); - this.gl.deleteBuffer( this.indexBuffer ); - - this.currentBaseTexture = null; - - this.gl = null; -}; -/** - * @author Mat Groves - * - * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ - * for creating the original pixi version! - * - * Heavily inspired by LibGDX's WebGLSpriteBatch: - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java - */ - -/** -* @class WebGLFastSpriteBatch -* @constructor -*/ -PIXI.WebGLFastSpriteBatch = function(gl) -{ - /** - * @property vertSize - * @type Number - */ - this.vertSize = 10; - - /** - * @property maxSize - * @type Number - */ - this.maxSize = 6000;//Math.pow(2, 16) / this.vertSize; - - /** - * @property size - * @type Number - */ - this.size = this.maxSize; - - //the total number of floats in our batch - var numVerts = this.size * 4 * this.vertSize; - - //the total number of indices in our batch - var numIndices = this.maxSize * 6; - - /** - * Vertex data - * @property vertices - * @type Float32Array - */ - this.vertices = new PIXI.Float32Array(numVerts); - - /** - * Index data - * @property indices - * @type Uint16Array - */ - this.indices = new PIXI.Uint16Array(numIndices); - - /** - * @property vertexBuffer - * @type Object - */ - this.vertexBuffer = null; - - /** - * @property indexBuffer - * @type Object - */ - this.indexBuffer = null; - - /** - * @property lastIndexCount - * @type Number - */ - this.lastIndexCount = 0; - - for (var i=0, j=0; i < numIndices; i += 6, j += 4) - { - this.indices[i + 0] = j + 0; - this.indices[i + 1] = j + 1; - this.indices[i + 2] = j + 2; - this.indices[i + 3] = j + 0; - this.indices[i + 4] = j + 2; - this.indices[i + 5] = j + 3; - } - - /** - * @property drawing - * @type Boolean - */ - this.drawing = false; - - /** - * @property currentBatchSize - * @type Number - */ - this.currentBatchSize = 0; - - /** - * @property currentBaseTexture - * @type BaseTexture - */ - this.currentBaseTexture = null; - - /** - * @property currentBlendMode - * @type Number - */ - this.currentBlendMode = 0; - - /** - * @property renderSession - * @type Object - */ - this.renderSession = null; - - /** - * @property shader - * @type Object - */ - this.shader = null; - - /** - * @property matrix - * @type Matrix - */ - this.matrix = null; - - this.setContext(gl); -}; - -PIXI.WebGLFastSpriteBatch.prototype.constructor = PIXI.WebGLFastSpriteBatch; - -/** - * Sets the WebGL Context. - * - * @method setContext - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLFastSpriteBatch.prototype.setContext = function(gl) -{ - this.gl = gl; - - // create a couple of buffers - this.vertexBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // 65535 is max index, so 65535 / 6 = 10922. - - //upload the index data - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); -}; - -/** - * @method begin - * @param spriteBatch {WebGLSpriteBatch} - * @param renderSession {Object} - */ -PIXI.WebGLFastSpriteBatch.prototype.begin = function(spriteBatch, renderSession) -{ - this.renderSession = renderSession; - this.shader = this.renderSession.shaderManager.fastShader; - - this.matrix = spriteBatch.worldTransform.toArray(true); - - this.start(); -}; - -/** - * @method end - */ -PIXI.WebGLFastSpriteBatch.prototype.end = function() -{ - this.flush(); -}; - -/** - * @method render - * @param spriteBatch {WebGLSpriteBatch} - */ -PIXI.WebGLFastSpriteBatch.prototype.render = function(spriteBatch) -{ - var children = spriteBatch.children; - var sprite = children[0]; - - // if the uvs have not updated then no point rendering just yet! - - // check texture. - if(!sprite.texture._uvs)return; - - this.currentBaseTexture = sprite.texture.baseTexture; - - // check blend mode - if(sprite.blendMode !== this.renderSession.blendModeManager.currentBlendMode) - { - this.flush(); - this.renderSession.blendModeManager.setBlendMode(sprite.blendMode); - } - - for(var i=0,j= children.length; i= this.size) - { - this.flush(); - } -}; - -/** - * @method flush - */ -PIXI.WebGLFastSpriteBatch.prototype.flush = function() -{ - // If the batch is length 0 then return as there is nothing to draw - if (this.currentBatchSize===0)return; - - var gl = this.gl; - - // bind the current texture - - if(!this.currentBaseTexture._glTextures[gl.id])this.renderSession.renderer.updateTexture(this.currentBaseTexture, gl); - - gl.bindTexture(gl.TEXTURE_2D, this.currentBaseTexture._glTextures[gl.id]); - - // upload the verts to the buffer - - if(this.currentBatchSize > ( this.size * 0.5 ) ) - { - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - } - else - { - var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize); - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); - } - - // now draw those suckas! - gl.drawElements(gl.TRIANGLES, this.currentBatchSize * 6, gl.UNSIGNED_SHORT, 0); - - // then reset the batch! - this.currentBatchSize = 0; - - // increment the draw count - this.renderSession.drawCount++; -}; - - -/** - * @method stop - */ -PIXI.WebGLFastSpriteBatch.prototype.stop = function() -{ - this.flush(); -}; - -/** - * @method start - */ -PIXI.WebGLFastSpriteBatch.prototype.start = function() -{ - var gl = this.gl; - - // bind the main texture - gl.activeTexture(gl.TEXTURE0); - - // bind the buffers - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - // set the projection - var projection = this.renderSession.projection; - gl.uniform2f(this.shader.projectionVector, projection.x, projection.y); - - // set the matrix - gl.uniformMatrix3fv(this.shader.uMatrix, false, this.matrix); - - // set the pointers - var stride = this.vertSize * 4; - - gl.vertexAttribPointer(this.shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0); - gl.vertexAttribPointer(this.shader.aPositionCoord, 2, gl.FLOAT, false, stride, 2 * 4); - gl.vertexAttribPointer(this.shader.aScale, 2, gl.FLOAT, false, stride, 4 * 4); - gl.vertexAttribPointer(this.shader.aRotation, 1, gl.FLOAT, false, stride, 6 * 4); - gl.vertexAttribPointer(this.shader.aTextureCoord, 2, gl.FLOAT, false, stride, 7 * 4); - gl.vertexAttribPointer(this.shader.colorAttribute, 1, gl.FLOAT, false, stride, 9 * 4); - -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLFilterManager -* @constructor -*/ -PIXI.WebGLFilterManager = function() -{ - /** - * @property filterStack - * @type Array - */ - this.filterStack = []; - - /** - * @property offsetX - * @type Number - */ - this.offsetX = 0; - - /** - * @property offsetY - * @type Number - */ - this.offsetY = 0; -}; - -PIXI.WebGLFilterManager.prototype.constructor = PIXI.WebGLFilterManager; - -/** -* Initialises the context and the properties. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLFilterManager.prototype.setContext = function(gl) -{ - this.gl = gl; - this.texturePool = []; - - this.initShaderBuffers(); -}; - -/** -* @method begin -* @param renderSession {RenderSession} -* @param buffer {ArrayBuffer} -*/ -PIXI.WebGLFilterManager.prototype.begin = function(renderSession, buffer) -{ - this.renderSession = renderSession; - this.defaultShader = renderSession.shaderManager.defaultShader; - - var projection = this.renderSession.projection; - this.width = projection.x * 2; - this.height = -projection.y * 2; - this.buffer = buffer; -}; - -/** -* Applies the filter and adds it to the current filter stack. -* -* @method pushFilter -* @param filterBlock {Object} the filter that will be pushed to the current filter stack -*/ -PIXI.WebGLFilterManager.prototype.pushFilter = function(filterBlock) -{ - var gl = this.gl; - - var projection = this.renderSession.projection; - var offset = this.renderSession.offset; - - filterBlock._filterArea = filterBlock.target.filterArea || filterBlock.target.getBounds(); - - // filter program - // OPTIMISATION - the first filter is free if its a simple color change? - this.filterStack.push(filterBlock); - - var filter = filterBlock.filterPasses[0]; - - this.offsetX += filterBlock._filterArea.x; - this.offsetY += filterBlock._filterArea.y; - - var texture = this.texturePool.pop(); - if(!texture) - { - texture = new PIXI.FilterTexture(this.gl, this.width, this.height); - } - else - { - texture.resize(this.width, this.height); - } - - gl.bindTexture(gl.TEXTURE_2D, texture.texture); - - var filterArea = filterBlock._filterArea;// filterBlock.target.getBounds();///filterBlock.target.filterArea; - - var padding = filter.padding; - filterArea.x -= padding; - filterArea.y -= padding; - filterArea.width += padding * 2; - filterArea.height += padding * 2; - - // cap filter to screen size.. - if(filterArea.x < 0)filterArea.x = 0; - if(filterArea.width > this.width)filterArea.width = this.width; - if(filterArea.y < 0)filterArea.y = 0; - if(filterArea.height > this.height)filterArea.height = this.height; - - //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, filterArea.width, filterArea.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); - gl.bindFramebuffer(gl.FRAMEBUFFER, texture.frameBuffer); - - // set view port - gl.viewport(0, 0, filterArea.width, filterArea.height); - - projection.x = filterArea.width/2; - projection.y = -filterArea.height/2; - - offset.x = -filterArea.x; - offset.y = -filterArea.y; - - // update projection - // now restore the regular shader.. - // this.renderSession.shaderManager.setShader(this.defaultShader); - //gl.uniform2f(this.defaultShader.projectionVector, filterArea.width/2, -filterArea.height/2); - //gl.uniform2f(this.defaultShader.offsetVector, -filterArea.x, -filterArea.y); - - gl.colorMask(true, true, true, true); - gl.clearColor(0,0,0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); - - filterBlock._glFilterTexture = texture; - -}; - -/** -* Removes the last filter from the filter stack and doesn't return it. -* -* @method popFilter -*/ -PIXI.WebGLFilterManager.prototype.popFilter = function() -{ - var gl = this.gl; - var filterBlock = this.filterStack.pop(); - var filterArea = filterBlock._filterArea; - var texture = filterBlock._glFilterTexture; - var projection = this.renderSession.projection; - var offset = this.renderSession.offset; - - if(filterBlock.filterPasses.length > 1) - { - gl.viewport(0, 0, filterArea.width, filterArea.height); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - - this.vertexArray[0] = 0; - this.vertexArray[1] = filterArea.height; - - this.vertexArray[2] = filterArea.width; - this.vertexArray[3] = filterArea.height; - - this.vertexArray[4] = 0; - this.vertexArray[5] = 0; - - this.vertexArray[6] = filterArea.width; - this.vertexArray[7] = 0; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - // now set the uvs.. - this.uvArray[2] = filterArea.width/this.width; - this.uvArray[5] = filterArea.height/this.height; - this.uvArray[6] = filterArea.width/this.width; - this.uvArray[7] = filterArea.height/this.height; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray); - - var inputTexture = texture; - var outputTexture = this.texturePool.pop(); - if(!outputTexture)outputTexture = new PIXI.FilterTexture(this.gl, this.width, this.height); - outputTexture.resize(this.width, this.height); - - // need to clear this FBO as it may have some left over elements from a previous filter. - gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer ); - gl.clear(gl.COLOR_BUFFER_BIT); - - gl.disable(gl.BLEND); - - for (var i = 0; i < filterBlock.filterPasses.length-1; i++) - { - var filterPass = filterBlock.filterPasses[i]; - - gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer ); - - // set texture - gl.activeTexture(gl.TEXTURE0); - gl.bindTexture(gl.TEXTURE_2D, inputTexture.texture); - - // draw texture.. - //filterPass.applyFilterPass(filterArea.width, filterArea.height); - this.applyFilterPass(filterPass, filterArea, filterArea.width, filterArea.height); - - // swap the textures.. - var temp = inputTexture; - inputTexture = outputTexture; - outputTexture = temp; - } - - gl.enable(gl.BLEND); - - texture = inputTexture; - this.texturePool.push(outputTexture); - } - - var filter = filterBlock.filterPasses[filterBlock.filterPasses.length-1]; - - this.offsetX -= filterArea.x; - this.offsetY -= filterArea.y; - - var sizeX = this.width; - var sizeY = this.height; - - var offsetX = 0; - var offsetY = 0; - - var buffer = this.buffer; - - // time to render the filters texture to the previous scene - if(this.filterStack.length === 0) - { - gl.colorMask(true, true, true, true);//this.transparent); - } - else - { - var currentFilter = this.filterStack[this.filterStack.length-1]; - filterArea = currentFilter._filterArea; - - sizeX = filterArea.width; - sizeY = filterArea.height; - - offsetX = filterArea.x; - offsetY = filterArea.y; - - buffer = currentFilter._glFilterTexture.frameBuffer; - } - - // TODO need to remove these global elements.. - projection.x = sizeX/2; - projection.y = -sizeY/2; - - offset.x = offsetX; - offset.y = offsetY; - - filterArea = filterBlock._filterArea; - - var x = filterArea.x-offsetX; - var y = filterArea.y-offsetY; - - // update the buffers.. - // make sure to flip the y! - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - - this.vertexArray[0] = x; - this.vertexArray[1] = y + filterArea.height; - - this.vertexArray[2] = x + filterArea.width; - this.vertexArray[3] = y + filterArea.height; - - this.vertexArray[4] = x; - this.vertexArray[5] = y; - - this.vertexArray[6] = x + filterArea.width; - this.vertexArray[7] = y; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - - this.uvArray[2] = filterArea.width/this.width; - this.uvArray[5] = filterArea.height/this.height; - this.uvArray[6] = filterArea.width/this.width; - this.uvArray[7] = filterArea.height/this.height; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray); - - gl.viewport(0, 0, sizeX * this.renderSession.resolution, sizeY * this.renderSession.resolution); - - // bind the buffer - gl.bindFramebuffer(gl.FRAMEBUFFER, buffer ); - - // set the blend mode! - //gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA) - - // set texture - gl.activeTexture(gl.TEXTURE0); - gl.bindTexture(gl.TEXTURE_2D, texture.texture); - - // apply! - this.applyFilterPass(filter, filterArea, sizeX, sizeY); - - // now restore the regular shader.. should happen automatically now.. - // this.renderSession.shaderManager.setShader(this.defaultShader); - // gl.uniform2f(this.defaultShader.projectionVector, sizeX/2, -sizeY/2); - // gl.uniform2f(this.defaultShader.offsetVector, -offsetX, -offsetY); - - // return the texture to the pool - this.texturePool.push(texture); - filterBlock._glFilterTexture = null; -}; - - -/** -* Applies the filter to the specified area. -* -* @method applyFilterPass -* @param filter {AbstractFilter} the filter that needs to be applied -* @param filterArea {Texture} TODO - might need an update -* @param width {Number} the horizontal range of the filter -* @param height {Number} the vertical range of the filter -*/ -PIXI.WebGLFilterManager.prototype.applyFilterPass = function(filter, filterArea, width, height) -{ - // use program - var gl = this.gl; - var shader = filter.shaders[gl.id]; - - if(!shader) - { - shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc = filter.fragmentSrc; - shader.uniforms = filter.uniforms; - shader.init(); - - filter.shaders[gl.id] = shader; - } - - // set the shader - this.renderSession.shaderManager.setShader(shader); - -// gl.useProgram(shader.program); - - gl.uniform2f(shader.projectionVector, width/2, -height/2); - gl.uniform2f(shader.offsetVector, 0,0); - - if(filter.uniforms.dimensions) - { - filter.uniforms.dimensions.value[0] = this.width;//width; - filter.uniforms.dimensions.value[1] = this.height;//height; - filter.uniforms.dimensions.value[2] = this.vertexArray[0]; - filter.uniforms.dimensions.value[3] = this.vertexArray[5];//filterArea.height; - } - - shader.syncUniforms(); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer); - gl.vertexAttribPointer(shader.colorAttribute, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - // draw the filter... - gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 ); - - this.renderSession.drawCount++; -}; - -/** -* Initialises the shader buffers. -* -* @method initShaderBuffers -*/ -PIXI.WebGLFilterManager.prototype.initShaderBuffers = function() -{ - var gl = this.gl; - - // create some buffers - this.vertexBuffer = gl.createBuffer(); - this.uvBuffer = gl.createBuffer(); - this.colorBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // bind and upload the vertexs.. - // keep a reference to the vertexFloatData.. - this.vertexArray = new PIXI.Float32Array([0.0, 0.0, - 1.0, 0.0, - 0.0, 1.0, - 1.0, 1.0]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertexArray, gl.STATIC_DRAW); - - // bind and upload the uv buffer - this.uvArray = new PIXI.Float32Array([0.0, 0.0, - 1.0, 0.0, - 0.0, 1.0, - 1.0, 1.0]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvArray, gl.STATIC_DRAW); - - this.colorArray = new PIXI.Float32Array([1.0, 0xFFFFFF, - 1.0, 0xFFFFFF, - 1.0, 0xFFFFFF, - 1.0, 0xFFFFFF]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.colorArray, gl.STATIC_DRAW); - - // bind and upload the index - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 1, 3, 2]), gl.STATIC_DRAW); - -}; - -/** -* Destroys the filter and removes it from the filter stack. -* -* @method destroy -*/ -PIXI.WebGLFilterManager.prototype.destroy = function() -{ - var gl = this.gl; - - this.filterStack = null; - - this.offsetX = 0; - this.offsetY = 0; - - // destroy textures - for (var i = 0; i < this.texturePool.length; i++) { - this.texturePool[i].destroy(); - } - - this.texturePool = null; - - //destroy buffers.. - gl.deleteBuffer(this.vertexBuffer); - gl.deleteBuffer(this.uvBuffer); - gl.deleteBuffer(this.colorBuffer); - gl.deleteBuffer(this.indexBuffer); -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class FilterTexture -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -* @param width {Number} the horizontal range of the filter -* @param height {Number} the vertical range of the filter -* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values -*/ -PIXI.FilterTexture = function(gl, width, height, scaleMode) -{ - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - // next time to create a frame buffer and texture - - /** - * @property frameBuffer - * @type Any - */ - this.frameBuffer = gl.createFramebuffer(); - - /** - * @property texture - * @type Any - */ - this.texture = gl.createTexture(); - - /** - * @property scaleMode - * @type Number - */ - scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - gl.bindTexture(gl.TEXTURE_2D, this.texture); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer ); - - gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer ); - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); - - // required for masking a mask?? - this.renderBuffer = gl.createRenderbuffer(); - gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer); - gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.renderBuffer); - - this.resize(width, height); -}; - -PIXI.FilterTexture.prototype.constructor = PIXI.FilterTexture; - -/** -* Clears the filter texture. -* -* @method clear -*/ -PIXI.FilterTexture.prototype.clear = function() -{ - var gl = this.gl; - - gl.clearColor(0,0,0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); -}; - -/** - * Resizes the texture to the specified width and height - * - * @method resize - * @param width {Number} the new width of the texture - * @param height {Number} the new height of the texture - */ -PIXI.FilterTexture.prototype.resize = function(width, height) -{ - if(this.width === width && this.height === height) return; - - this.width = width; - this.height = height; - - var gl = this.gl; - - gl.bindTexture(gl.TEXTURE_2D, this.texture); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width , height , 0, gl.RGBA, gl.UNSIGNED_BYTE, null); - // update the stencil buffer width and height - gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer); - gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width , height ); -}; - -/** -* Destroys the filter texture. -* -* @method destroy -*/ -PIXI.FilterTexture.prototype.destroy = function() -{ - var gl = this.gl; - gl.deleteFramebuffer( this.frameBuffer ); - gl.deleteTexture( this.texture ); - - this.frameBuffer = null; - this.texture = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Creates a Canvas element of the given size. - * - * @class CanvasBuffer - * @constructor - * @param width {Number} the width for the newly created canvas - * @param height {Number} the height for the newly created canvas - */ -PIXI.CanvasBuffer = function(width, height) -{ - /** - * The width of the Canvas in pixels. - * - * @property width - * @type Number - */ - this.width = width; - - /** - * The height of the Canvas in pixels. - * - * @property height - * @type Number - */ - this.height = height; - - /** - * The Canvas object that belongs to this CanvasBuffer. - * - * @property canvas - * @type HTMLCanvasElement - */ - this.canvas = document.createElement("canvas"); - - /** - * A CanvasRenderingContext2D object representing a two-dimensional rendering context. - * - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.canvas.getContext("2d"); - - this.canvas.width = width; - this.canvas.height = height; -}; - -PIXI.CanvasBuffer.prototype.constructor = PIXI.CanvasBuffer; - -/** - * Clears the canvas that was created by the CanvasBuffer class. - * - * @method clear - * @private - */ -PIXI.CanvasBuffer.prototype.clear = function() -{ - this.context.setTransform(1, 0, 0, 1, 0, 0); - this.context.clearRect(0,0, this.width, this.height); -}; - -/** - * Resizes the canvas to the specified width and height. - * - * @method resize - * @param width {Number} the new width of the canvas - * @param height {Number} the new height of the canvas - */ -PIXI.CanvasBuffer.prototype.resize = function(width, height) -{ - this.width = this.canvas.width = width; - this.height = this.canvas.height = height; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A set of functions used to handle masking. - * - * @class CanvasMaskManager - * @constructor - */ -PIXI.CanvasMaskManager = function() -{ -}; - -PIXI.CanvasMaskManager.prototype.constructor = PIXI.CanvasMaskManager; - -/** - * This method adds it to the current stack of masks. - * - * @method pushMask - * @param maskData {Object} the maskData that will be pushed - * @param renderSession {Object} The renderSession whose context will be used for this mask manager. - */ -PIXI.CanvasMaskManager.prototype.pushMask = function(maskData, renderSession) -{ - var context = renderSession.context; - - context.save(); - - var cacheAlpha = maskData.alpha; - var transform = maskData.worldTransform; - - var resolution = renderSession.resolution; - - context.setTransform(transform.a * resolution, - transform.b * resolution, - transform.c * resolution, - transform.d * resolution, - transform.tx * resolution, - transform.ty * resolution); - - PIXI.CanvasGraphics.renderGraphicsMask(maskData, context); - - context.clip(); - - maskData.worldAlpha = cacheAlpha; -}; - -/** - * Restores the current drawing context to the state it was before the mask was applied. - * - * @method popMask - * @param renderSession {Object} The renderSession whose context will be used for this mask manager. - */ -PIXI.CanvasMaskManager.prototype.popMask = function(renderSession) -{ - renderSession.context.restore(); -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Utility methods for Sprite/Texture tinting. - * - * @class CanvasTinter - * @static - */ -PIXI.CanvasTinter = function() -{ -}; - -/** - * Basically this method just needs a sprite and a color and tints the sprite with the given color. - * - * @method getTintedTexture - * @static - * @param sprite {Sprite} the sprite to tint - * @param color {Number} the color to use to tint the sprite with - * @return {HTMLCanvasElement} The tinted canvas - */ -PIXI.CanvasTinter.getTintedTexture = function(sprite, color) -{ - var texture = sprite.texture; - - color = PIXI.CanvasTinter.roundColor(color); - - var stringColor = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - - texture.tintCache = texture.tintCache || {}; - - if(texture.tintCache[stringColor]) return texture.tintCache[stringColor]; - - // clone texture.. - var canvas = PIXI.CanvasTinter.canvas || document.createElement("canvas"); - - //PIXI.CanvasTinter.tintWithPerPixel(texture, stringColor, canvas); - PIXI.CanvasTinter.tintMethod(texture, color, canvas); - - if(PIXI.CanvasTinter.convertTintToImage) - { - // is this better? - var tintImage = new Image(); - tintImage.src = canvas.toDataURL(); - - texture.tintCache[stringColor] = tintImage; - } - else - { - texture.tintCache[stringColor] = canvas; - // if we are not converting the texture to an image then we need to lose the reference to the canvas - PIXI.CanvasTinter.canvas = null; - } - - return canvas; -}; - -/** - * Tint a texture using the "multiply" operation. - * - * @method tintWithMultiply - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithMultiply = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - - context.fillRect(0, 0, crop.width, crop.height); - - context.globalCompositeOperation = "multiply"; - - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - context.globalCompositeOperation = "destination-atop"; - - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); -}; - -/** - * Tint a texture using the "overlay" operation. - * - * @method tintWithOverlay - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithOverlay = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.globalCompositeOperation = "copy"; - context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - context.fillRect(0, 0, crop.width, crop.height); - - context.globalCompositeOperation = "destination-atop"; - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - //context.globalCompositeOperation = "copy"; -}; - -/** - * Tint a texture pixel per pixel. - * - * @method tintPerPixel - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithPerPixel = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.globalCompositeOperation = "copy"; - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - var rgbValues = PIXI.hex2rgb(color); - var r = rgbValues[0], g = rgbValues[1], b = rgbValues[2]; - - var pixelData = context.getImageData(0, 0, crop.width, crop.height); - - var pixels = pixelData.data; - - for (var i = 0; i < pixels.length; i += 4) - { - pixels[i+0] *= r; - pixels[i+1] *= g; - pixels[i+2] *= b; - } - - context.putImageData(pixelData, 0, 0); -}; - -/** - * Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel. - * - * @method roundColor - * @static - * @param color {number} the color to round, should be a hex color - */ -PIXI.CanvasTinter.roundColor = function(color) -{ - var step = PIXI.CanvasTinter.cacheStepsPerColorChannel; - - var rgbValues = PIXI.hex2rgb(color); - - rgbValues[0] = Math.min(255, (rgbValues[0] / step) * step); - rgbValues[1] = Math.min(255, (rgbValues[1] / step) * step); - rgbValues[2] = Math.min(255, (rgbValues[2] / step) * step); - - return PIXI.rgb2hex(rgbValues); -}; - -/** - * Number of steps which will be used as a cap when rounding colors. - * - * @property cacheStepsPerColorChannel - * @type Number - * @static - */ -PIXI.CanvasTinter.cacheStepsPerColorChannel = 8; - -/** - * Tint cache boolean flag. - * - * @property convertTintToImage - * @type Boolean - * @static - */ -PIXI.CanvasTinter.convertTintToImage = false; - -/** - * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. - * - * @property canUseMultiply - * @type Boolean - * @static - */ -PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes(); - -/** - * The tinting method that will be used. - * - * @method tintMethod - * @static - */ -PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The CanvasRenderer draws the Stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. - * Don't forget to add the CanvasRenderer.view to your DOM or you will not see anything :) - * - * @class CanvasRenderer - * @constructor - * @param [width=800] {Number} the width of the canvas view - * @param [height=600] {Number} the height of the canvas view - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * @param [options.clearBeforeRender=true] {Boolean} This sets if the CanvasRenderer will clear the canvas or not before the new render pass. - */ -PIXI.CanvasRenderer = function(width, height, options) -{ - if(options) - { - for (var i in PIXI.defaultRenderOptions) - { - if (typeof options[i] === "undefined") options[i] = PIXI.defaultRenderOptions[i]; - } - } - else - { - options = PIXI.defaultRenderOptions; - } - - if(!PIXI.defaultRenderer) - { - PIXI.sayHello("Canvas"); - PIXI.defaultRenderer = this; - } - - /** - * The renderer type. - * - * @property type - * @type Number - */ - this.type = PIXI.CANVAS_RENDERER; - - /** - * The resolution of the canvas. - * - * @property resolution - * @type Number - */ - this.resolution = options.resolution; - - /** - * This sets if the CanvasRenderer will clear the canvas or not before the new render pass. - * If the Stage is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color. - * If the Stage is transparent Pixi will use clearRect to clear the canvas every frame. - * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set. - * - * @property clearBeforeRender - * @type Boolean - * @default - */ - this.clearBeforeRender = options.clearBeforeRender; - - /** - * Whether the render view is transparent - * - * @property transparent - * @type Boolean - */ - this.transparent = options.transparent; - - /** - * Whether the render view should be resized automatically - * - * @property autoResize - * @type Boolean - */ - this.autoResize = options.autoResize || false; - - - /** - * The width of the canvas view - * - * @property width - * @type Number - * @default 800 - */ - this.width = width || 800; - - /** - * The height of the canvas view - * - * @property height - * @type Number - * @default 600 - */ - this.height = height || 600; - - this.width *= this.resolution; - this.height *= this.resolution; - - /** - * The canvas element that everything is drawn to. - * - * @property view - * @type HTMLCanvasElement - */ - this.view = options.view || document.createElement( "canvas" ); - - /** - * The canvas 2d context that everything is drawn with - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.view.getContext( "2d", { alpha: this.transparent } ); - - /** - * Boolean flag controlling canvas refresh. - * - * @property refresh - * @type Boolean - */ - this.refresh = true; - - this.view.width = this.width * this.resolution; - this.view.height = this.height * this.resolution; - - /** - * Internal var. - * - * @property count - * @type Number - */ - this.count = 0; - - /** - * Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer - * @property maskManager - * @type CanvasMaskManager - */ - this.maskManager = new PIXI.CanvasMaskManager(); - - /** - * The render session is just a bunch of parameter used for rendering - * @property renderSession - * @type Object - */ - this.renderSession = { - context: this.context, - maskManager: this.maskManager, - scaleMode: null, - smoothProperty: null, - /** - * If true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation. - * Handy for crisp pixel art and speed on legacy devices. - * - */ - roundPixels: false - }; - - this.mapBlendModes(); - - this.resize(width, height); - - if("imageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "imageSmoothingEnabled"; - else if("webkitImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "webkitImageSmoothingEnabled"; - else if("mozImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "mozImageSmoothingEnabled"; - else if("oImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "oImageSmoothingEnabled"; - else if ("msImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "msImageSmoothingEnabled"; -}; - -// constructor -PIXI.CanvasRenderer.prototype.constructor = PIXI.CanvasRenderer; - -/** - * Renders the Stage to this canvas view - * - * @method render - * @param stage {Stage} the Stage element to be rendered - */ -PIXI.CanvasRenderer.prototype.render = function(stage) -{ - stage.updateTransform(); - - this.context.setTransform(1,0,0,1,0,0); - - this.context.globalAlpha = 1; - - this.renderSession.currentBlendMode = PIXI.blendModes.NORMAL; - this.context.globalCompositeOperation = PIXI.blendModesCanvas[PIXI.blendModes.NORMAL]; - - if (navigator.isCocoonJS && this.view.screencanvas) { - this.context.fillStyle = "black"; - this.context.clear(); - } - - if (this.clearBeforeRender) - { - if (this.transparent) - { - this.context.clearRect(0, 0, this.width, this.height); - } - else - { - this.context.fillStyle = stage.backgroundColorString; - this.context.fillRect(0, 0, this.width , this.height); - } - } - - this.renderDisplayObject(stage); - - // run interaction! - if(stage.interactive) - { - //need to add some events! - if(!stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = true; - stage.interactionManager.setTarget(this); - } - } -}; - -/** - * Removes everything from the renderer and optionally removes the Canvas DOM element. - * - * @method destroy - * @param [removeView=true] {boolean} Removes the Canvas element from the DOM. - */ -PIXI.CanvasRenderer.prototype.destroy = function(removeView) -{ - if (typeof removeView === "undefined") { removeView = true; } - - if (removeView && this.view.parent) - { - this.view.parent.removeChild(this.view); - } - - this.view = null; - this.context = null; - this.maskManager = null; - this.renderSession = null; - -}; - -/** - * Resizes the canvas view to the specified width and height - * - * @method resize - * @param width {Number} the new width of the canvas view - * @param height {Number} the new height of the canvas view - */ -PIXI.CanvasRenderer.prototype.resize = function(width, height) -{ - this.width = width * this.resolution; - this.height = height * this.resolution; - - this.view.width = this.width; - this.view.height = this.height; - - if (this.autoResize) { - this.view.style.width = this.width / this.resolution + "px"; - this.view.style.height = this.height / this.resolution + "px"; - } -}; - -/** - * Renders a display object - * - * @method renderDisplayObject - * @param displayObject {DisplayObject} The displayObject to render - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas - * @private - */ -PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject, context) -{ - this.renderSession.context = context || this.context; - this.renderSession.resolution = this.resolution; - displayObject._renderCanvas(this.renderSession); -}; - -/** - * Maps Pixi blend modes to canvas blend modes. - * - * @method mapBlendModes - * @private - */ -PIXI.CanvasRenderer.prototype.mapBlendModes = function() -{ - if(!PIXI.blendModesCanvas) - { - PIXI.blendModesCanvas = []; - - if(PIXI.canUseNewCanvasBlendModes()) - { - PIXI.blendModesCanvas[PIXI.blendModes.NORMAL] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.ADD] = "lighter"; //IS THIS OK??? - PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "multiply"; - PIXI.blendModesCanvas[PIXI.blendModes.SCREEN] = "screen"; - PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY] = "overlay"; - PIXI.blendModesCanvas[PIXI.blendModes.DARKEN] = "darken"; - PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN] = "lighten"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "color-dodge"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "color-burn"; - PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "hard-light"; - PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "soft-light"; - PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "difference"; - PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "exclusion"; - PIXI.blendModesCanvas[PIXI.blendModes.HUE] = "hue"; - PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "saturation"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR] = "color"; - PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "luminosity"; - } - else - { - // this means that the browser does not support the cool new blend modes in canvas "cough" ie "cough" - PIXI.blendModesCanvas[PIXI.blendModes.NORMAL] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.ADD] = "lighter"; //IS THIS OK??? - PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SCREEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.DARKEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.HUE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "source-over"; - } - } -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - - -/** - * A set of functions used by the canvas renderer to draw the primitive graphics data. - * - * @class CanvasGraphics - * @static - */ -PIXI.CanvasGraphics = function() -{ -}; - -/* - * Renders a PIXI.Graphics object to a canvas. - * - * @method renderGraphics - * @static - * @param graphics {Graphics} the actual graphics object to render - * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas - */ -PIXI.CanvasGraphics.renderGraphics = function(graphics, context) -{ - var worldAlpha = graphics.worldAlpha; - - if(graphics.dirty) - { - this.updateGraphicsTint(graphics); - graphics.dirty = false; - } - - - for (var i = 0; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - var shape = data.shape; - - var fillColor = data._fillTint; - var lineColor = data._lineTint; - - context.lineWidth = data.lineWidth; - - if(data.type === PIXI.Graphics.POLY) - { - context.beginPath(); - - var points = shape.points; - - context.moveTo(points[0], points[1]); - - for (var j=1; j < points.length/2; j++) - { - context.lineTo(points[j * 2], points[j * 2 + 1]); - } - - if(shape.closed) - { - context.lineTo(points[0], points[1]); - } - - // if the first and last point are the same close the path - much neater :) - if(points[0] === points[points.length-2] && points[1] === points[points.length-1]) - { - context.closePath(); - } - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if(data.type === PIXI.Graphics.RECT) - { - - if(data.fillColor || data.fillColor === 0) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fillRect(shape.x, shape.y, shape.width, shape.height); - - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.strokeRect(shape.x, shape.y, shape.width, shape.height); - } - } - else if(data.type === PIXI.Graphics.CIRC) - { - // TODO - need to be Undefined! - context.beginPath(); - context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI); - context.closePath(); - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if(data.type === PIXI.Graphics.ELIP) - { - // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas - - var w = shape.width * 2; - var h = shape.height * 2; - - var x = shape.x - w/2; - var y = shape.y - h/2; - - context.beginPath(); - - var kappa = 0.5522848, - ox = (w / 2) * kappa, // control point offset horizontal - oy = (h / 2) * kappa, // control point offset vertical - xe = x + w, // x-end - ye = y + h, // y-end - xm = x + w / 2, // x-middle - ym = y + h / 2; // y-middle - - context.moveTo(x, ym); - context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); - context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); - context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); - context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); - - context.closePath(); - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if (data.type === PIXI.Graphics.RREC) - { - var rx = shape.x; - var ry = shape.y; - var width = shape.width; - var height = shape.height; - var radius = shape.radius; - - var maxRadius = Math.min(width, height) / 2 | 0; - radius = radius > maxRadius ? maxRadius : radius; - - context.beginPath(); - context.moveTo(rx, ry + radius); - context.lineTo(rx, ry + height - radius); - context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height); - context.lineTo(rx + width - radius, ry + height); - context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius); - context.lineTo(rx + width, ry + radius); - context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry); - context.lineTo(rx + radius, ry); - context.quadraticCurveTo(rx, ry, rx, ry + radius); - context.closePath(); - - if(data.fillColor || data.fillColor === 0) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - } -}; - -/* - * Renders a graphics mask - * - * @static - * @private - * @method renderGraphicsMask - * @param graphics {Graphics} the graphics which will be used as a mask - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas - */ -PIXI.CanvasGraphics.renderGraphicsMask = function(graphics, context) -{ - var len = graphics.graphicsData.length; - - if(len === 0) return; - - if(len > 1) - { - len = 1; - window.console.log('Pixi.js warning: masks in canvas can only mask using the first path in the graphics object'); - } - - for (var i = 0; i < 1; i++) - { - var data = graphics.graphicsData[i]; - var shape = data.shape; - - if(data.type === PIXI.Graphics.POLY) - { - context.beginPath(); - - var points = shape.points; - - context.moveTo(points[0], points[1]); - - for (var j=1; j < points.length/2; j++) - { - context.lineTo(points[j * 2], points[j * 2 + 1]); - } - - // if the first and last point are the same close the path - much neater :) - if(points[0] === points[points.length-2] && points[1] === points[points.length-1]) - { - context.closePath(); - } - - } - else if(data.type === PIXI.Graphics.RECT) - { - context.beginPath(); - context.rect(shape.x, shape.y, shape.width, shape.height); - context.closePath(); - } - else if(data.type === PIXI.Graphics.CIRC) - { - // TODO - need to be Undefined! - context.beginPath(); - context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI); - context.closePath(); - } - else if(data.type === PIXI.Graphics.ELIP) - { - - // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas - - var w = shape.width * 2; - var h = shape.height * 2; - - var x = shape.x - w/2; - var y = shape.y - h/2; - - context.beginPath(); - - var kappa = 0.5522848, - ox = (w / 2) * kappa, // control point offset horizontal - oy = (h / 2) * kappa, // control point offset vertical - xe = x + w, // x-end - ye = y + h, // y-end - xm = x + w / 2, // x-middle - ym = y + h / 2; // y-middle - - context.moveTo(x, ym); - context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); - context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); - context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); - context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); - context.closePath(); - } - else if (data.type === PIXI.Graphics.RREC) - { - - var pts = shape.points; - var rx = pts[0]; - var ry = pts[1]; - var width = pts[2]; - var height = pts[3]; - var radius = pts[4]; - - var maxRadius = Math.min(width, height) / 2 | 0; - radius = radius > maxRadius ? maxRadius : radius; - - context.beginPath(); - context.moveTo(rx, ry + radius); - context.lineTo(rx, ry + height - radius); - context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height); - context.lineTo(rx + width - radius, ry + height); - context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius); - context.lineTo(rx + width, ry + radius); - context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry); - context.lineTo(rx + radius, ry); - context.quadraticCurveTo(rx, ry, rx, ry + radius); - context.closePath(); - } - } -}; - -PIXI.CanvasGraphics.updateGraphicsTint = function(graphics) -{ - if(graphics.tint === 0xFFFFFF)return; - - var tintR = (graphics.tint >> 16 & 0xFF) / 255; - var tintG = (graphics.tint >> 8 & 0xFF) / 255; - var tintB = (graphics.tint & 0xFF)/ 255; - - for (var i = 0; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - - var fillColor = data.fillColor | 0; - var lineColor = data.lineColor | 0; - - /* - var colorR = (fillColor >> 16 & 0xFF) / 255; - var colorG = (fillColor >> 8 & 0xFF) / 255; - var colorB = (fillColor & 0xFF) / 255; - - colorR *= tintR; - colorG *= tintG; - colorB *= tintB; - - fillColor = ((colorR*255 << 16) + (colorG*255 << 8) + colorB*255); - - colorR = (lineColor >> 16 & 0xFF) / 255; - colorG = (lineColor >> 8 & 0xFF) / 255; - colorB = (lineColor & 0xFF) / 255; - - colorR *= tintR; - colorG *= tintG; - colorB *= tintB; - - lineColor = ((colorR*255 << 16) + (colorG*255 << 8) + colorB*255); - */ - - // super inline cos im an optimization NAZI :) - data._fillTint = (((fillColor >> 16 & 0xFF) / 255 * tintR*255 << 16) + ((fillColor >> 8 & 0xFF) / 255 * tintG*255 << 8) + (fillColor & 0xFF) / 255 * tintB*255); - data._lineTint = (((lineColor >> 16 & 0xFF) / 255 * tintR*255 << 16) + ((lineColor >> 8 & 0xFF) / 255 * tintG*255 << 8) + (lineColor & 0xFF) / 255 * tintB*255); - - } -}; - - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and color and fill them. - * - * @class Graphics - * @extends DisplayObjectContainer - * @constructor - */ -PIXI.Graphics = function() -{ - PIXI.DisplayObjectContainer.call( this ); - - this.renderable = true; - - /** - * The alpha value used when filling the Graphics object. - * - * @property fillAlpha - * @type Number - */ - this.fillAlpha = 1; - - /** - * The width (thickness) of any lines drawn. - * - * @property lineWidth - * @type Number - */ - this.lineWidth = 0; - - /** - * The color of any lines drawn. - * - * @property lineColor - * @type String - * @default 0 - */ - this.lineColor = 0; - - /** - * Graphics data - * - * @property graphicsData - * @type Array - * @private - */ - this.graphicsData = []; - - /** - * The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint. - * - * @property tint - * @type Number - * @default 0xFFFFFF - */ - this.tint = 0xFFFFFF; - - /** - * The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode. - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - /** - * Current path - * - * @property currentPath - * @type Object - * @private - */ - this.currentPath = null; - - /** - * Array containing some WebGL-related properties used by the WebGL renderer. - * - * @property _webGL - * @type Array - * @private - */ - this._webGL = []; - - /** - * Whether this shape is being used as a mask. - * - * @property isMask - * @type Boolean - */ - this.isMask = false; - - /** - * The bounds' padding used for bounds calculation. - * - * @property boundsPadding - * @type Number - */ - this.boundsPadding = 0; - - this._localBounds = new PIXI.Rectangle(0,0,1,1); - - /** - * Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated. - * - * @property dirty - * @type Boolean - * @private - */ - this.dirty = true; - - /** - * Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated. - * - * @property webGLDirty - * @type Boolean - * @private - */ - this.webGLDirty = false; - - /** - * Used to detect if the cached sprite object needs to be updated. - * - * @property cachedSpriteDirty - * @type Boolean - * @private - */ - this.cachedSpriteDirty = false; - -}; - -// constructor -PIXI.Graphics.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); -PIXI.Graphics.prototype.constructor = PIXI.Graphics; - -/** - * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. - * This is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory. - * It is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas. - * This is not recommended if you are constantly redrawing the graphics element. - * - * @property cacheAsBitmap - * @type Boolean - * @default false - * @private - */ -Object.defineProperty(PIXI.Graphics.prototype, "cacheAsBitmap", { - get: function() { - return this._cacheAsBitmap; - }, - set: function(value) { - this._cacheAsBitmap = value; - - if(this._cacheAsBitmap) - { - - this._generateCachedSprite(); - } - else - { - this.destroyCachedSprite(); - this.dirty = true; - } - - } -}); - -/** - * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method. - * - * @method lineStyle - * @param lineWidth {Number} width of the line to draw, will update the objects stored style - * @param color {Number} color of the line to draw, will update the objects stored style - * @param alpha {Number} alpha of the line to draw, will update the objects stored style - * @return {Graphics} - */ -PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha) -{ - this.lineWidth = lineWidth || 0; - this.lineColor = color || 0; - this.lineAlpha = (arguments.length < 3) ? 1 : alpha; - - if(this.currentPath) - { - if(this.currentPath.shape.points.length) - { - // halfway through a line? start a new one! - this.drawShape( new PIXI.Polygon( this.currentPath.shape.points.slice(-2) )); - return this; - } - - // otherwise its empty so lets just set the line properties - this.currentPath.lineWidth = this.lineWidth; - this.currentPath.lineColor = this.lineColor; - this.currentPath.lineAlpha = this.lineAlpha; - - } - - return this; -}; - -/** - * Moves the current drawing position to x, y. - * - * @method moveTo - * @param x {Number} the X coordinate to move to - * @param y {Number} the Y coordinate to move to - * @return {Graphics} - */ -PIXI.Graphics.prototype.moveTo = function(x, y) -{ - this.drawShape(new PIXI.Polygon([x,y])); - - return this; -}; - -/** - * Draws a line using the current line style from the current drawing position to (x, y); - * The current drawing position is then set to (x, y). - * - * @method lineTo - * @param x {Number} the X coordinate to draw to - * @param y {Number} the Y coordinate to draw to - * @return {Graphics} - */ -PIXI.Graphics.prototype.lineTo = function(x, y) -{ - this.currentPath.shape.points.push(x, y); - this.dirty = true; - - return this; -}; - -/** - * Calculate the points for a quadratic bezier curve and then draws it. - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c - * - * @method quadraticCurveTo - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Graphics} - */ -PIXI.Graphics.prototype.quadraticCurveTo = function(cpX, cpY, toX, toY) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0]; - } - else - { - this.moveTo(0,0); - } - - var xa, - ya, - n = 20, - points = this.currentPath.shape.points; - if(points.length === 0)this.moveTo(0, 0); - - - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - - var j = 0; - for (var i = 1; i <= n; i++ ) - { - j = i / n; - - xa = fromX + ( (cpX - fromX) * j ); - ya = fromY + ( (cpY - fromY) * j ); - - points.push( xa + ( ((cpX + ( (toX - cpX) * j )) - xa) * j ), - ya + ( ((cpY + ( (toY - cpY) * j )) - ya) * j ) ); - } - - - this.dirty = true; - - return this; -}; - -/** - * Calculate the points for a bezier curve and then draws it. - * - * @method bezierCurveTo - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param cpX2 {Number} Second Control point x - * @param cpY2 {Number} Second Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Graphics} - */ -PIXI.Graphics.prototype.bezierCurveTo = function(cpX, cpY, cpX2, cpY2, toX, toY) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0]; - } - else - { - this.moveTo(0,0); - } - - var n = 20, - dt, - dt2, - dt3, - t2, - t3, - points = this.currentPath.shape.points; - - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - - var j = 0; - - for (var i=1; i<=n; i++) - { - j = i / n; - - dt = (1 - j); - dt2 = dt * dt; - dt3 = dt2 * dt; - - t2 = j * j; - t3 = t2 * j; - - points.push( dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX, - dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY); - } - - this.dirty = true; - - return this; -}; - -/* - * The arcTo() method creates an arc/curve between two tangents on the canvas. - * - * "borrowed" from https://code.google.com/p/fxcanvas/ - thanks google! - * - * @method arcTo - * @param x1 {Number} The x-coordinate of the beginning of the arc - * @param y1 {Number} The y-coordinate of the beginning of the arc - * @param x2 {Number} The x-coordinate of the end of the arc - * @param y2 {Number} The y-coordinate of the end of the arc - * @param radius {Number} The radius of the arc - * @return {Graphics} - */ -PIXI.Graphics.prototype.arcTo = function(x1, y1, x2, y2, radius) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0) - { - this.currentPath.shape.points.push(x1, y1); - } - } - else - { - this.moveTo(x1, y1); - } - - var points = this.currentPath.shape.points; - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - var a1 = fromY - y1; - var b1 = fromX - x1; - var a2 = y2 - y1; - var b2 = x2 - x1; - var mm = Math.abs(a1 * b2 - b1 * a2); - - - if (mm < 1.0e-8 || radius === 0) - { - if( points[points.length-2] !== x1 || points[points.length-1] !== y1) - { - //console.log(">>") - points.push(x1, y1); - } - } - else - { - var dd = a1 * a1 + b1 * b1; - var cc = a2 * a2 + b2 * b2; - var tt = a1 * a2 + b1 * b2; - var k1 = radius * Math.sqrt(dd) / mm; - var k2 = radius * Math.sqrt(cc) / mm; - var j1 = k1 * tt / dd; - var j2 = k2 * tt / cc; - var cx = k1 * b2 + k2 * b1; - var cy = k1 * a2 + k2 * a1; - var px = b1 * (k2 + j1); - var py = a1 * (k2 + j1); - var qx = b2 * (k1 + j2); - var qy = a2 * (k1 + j2); - var startAngle = Math.atan2(py - cy, px - cx); - var endAngle = Math.atan2(qy - cy, qx - cx); - - this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1); - } - - this.dirty = true; - - return this; -}; - -/** - * The arc method creates an arc/curve (used to create circles, or parts of circles). - * - * @method arc - * @param cx {Number} The x-coordinate of the center of the circle - * @param cy {Number} The y-coordinate of the center of the circle - * @param radius {Number} The radius of the circle - * @param startAngle {Number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) - * @param endAngle {Number} The ending angle, in radians - * @param anticlockwise {Boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {Graphics} - */ -PIXI.Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) -{ - var startX = cx + Math.cos(startAngle) * radius; - var startY = cy + Math.sin(startAngle) * radius; - var points; - - if( this.currentPath ) - { - points = this.currentPath.shape.points; - - if(points.length === 0) - { - points.push(startX, startY); - } - else if( points[points.length-2] !== startX || points[points.length-1] !== startY) - { - points.push(startX, startY); - } - } - else - { - this.moveTo(startX, startY); - points = this.currentPath.shape.points; - } - - if (startAngle === endAngle)return this; - - if( !anticlockwise && endAngle <= startAngle ) - { - endAngle += Math.PI * 2; - } - else if( anticlockwise && startAngle <= endAngle ) - { - startAngle += Math.PI * 2; - } - - var sweep = anticlockwise ? (startAngle - endAngle) *-1 : (endAngle - startAngle); - var segs = ( Math.abs(sweep)/ (Math.PI * 2) ) * 40; - - if( sweep === 0 ) return this; - - var theta = sweep/(segs*2); - var theta2 = theta*2; - - var cTheta = Math.cos(theta); - var sTheta = Math.sin(theta); - - var segMinus = segs - 1; - - var remainder = ( segMinus % 1 ) / segMinus; - - for(var i=0; i<=segMinus; i++) - { - var real = i + remainder * i; - - - var angle = ((theta) + startAngle + (theta2 * real)); - - var c = Math.cos(angle); - var s = -Math.sin(angle); - - points.push(( (cTheta * c) + (sTheta * s) ) * radius + cx, - ( (cTheta * -s) + (sTheta * c) ) * radius + cy); - } - - this.dirty = true; - - return this; -}; - -/** - * Specifies a simple one-color fill that subsequent calls to other Graphics methods - * (such as lineTo() or drawCircle()) use when drawing. - * - * @method beginFill - * @param color {Number} the color of the fill - * @param alpha {Number} the alpha of the fill - * @return {Graphics} - */ -PIXI.Graphics.prototype.beginFill = function(color, alpha) -{ - this.filling = true; - this.fillColor = color || 0; - this.fillAlpha = (alpha === undefined) ? 1 : alpha; - - if(this.currentPath) - { - if(this.currentPath.shape.points.length <= 2) - { - this.currentPath.fill = this.filling; - this.currentPath.fillColor = this.fillColor; - this.currentPath.fillAlpha = this.fillAlpha; - } - } - return this; -}; - -/** - * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. - * - * @method endFill - * @return {Graphics} - */ -PIXI.Graphics.prototype.endFill = function() -{ - this.filling = false; - this.fillColor = null; - this.fillAlpha = 1; - - return this; -}; - -/** - * Draws a rectangle. - * - * @method drawRect - * - * @param x {Number} The X coord of the top-left of the rectangle - * @param y {Number} The Y coord of the top-left of the rectangle - * @param width {Number} The width of the rectangle - * @param height {Number} The height of the rectangle - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawRect = function( x, y, width, height ) -{ - this.drawShape(new PIXI.Rectangle(x,y, width, height)); - - return this; -}; - -/** - * Draws a rounded rectangle. - * - * @method drawRoundedRect - * - * @param x {Number} The X coord of the top-left of the rectangle - * @param y {Number} The Y coord of the top-left of the rectangle - * @param width {Number} The width of the rectangle - * @param height {Number} The height of the rectangle - * @param radius {Number} Radius of the rectangle corners - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawRoundedRect = function( x, y, width, height, radius ) -{ - this.drawShape(new PIXI.RoundedRectangle(x, y, width, height, radius)); - - return this; -}; - -/** - * Draws a circle. - * - * @method drawCircle - * @param x {Number} The X coordinate of the center of the circle - * @param y {Number} The Y coordinate of the center of the circle - * @param radius {Number} The radius of the circle - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawCircle = function(x, y, radius) -{ - this.drawShape(new PIXI.Circle(x,y, radius)); - - return this; -}; - -/** - * Draws an ellipse. - * - * @method drawEllipse - * @param x {Number} The X coordinate of the center of the ellipse - * @param y {Number} The Y coordinate of the center of the ellipse - * @param width {Number} The half width of the ellipse - * @param height {Number} The half height of the ellipse - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawEllipse = function(x, y, width, height) -{ - this.drawShape(new PIXI.Ellipse(x, y, width, height)); - - return this; -}; - -/** - * Draws a polygon using the given path. - * - * @method drawPolygon - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawPolygon = function(path) -{ - if(!(path instanceof Array))path = Array.prototype.slice.call(arguments); - this.drawShape(new PIXI.Polygon(path)); - return this; -}; - -/** - * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. - * - * @method clear - * @return {Graphics} - */ -PIXI.Graphics.prototype.clear = function() -{ - this.lineWidth = 0; - this.filling = false; - - this.dirty = true; - this.clearDirty = true; - this.graphicsData = []; - - return this; -}; - -/** - * Useful function that returns a texture of the graphics object that can then be used to create sprites - * This can be quite useful if your geometry is complicated and needs to be reused multiple times. - * - * @method generateTexture - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts - * @return {Texture} a texture of the graphics object - */ -PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode) -{ - resolution = resolution || 1; - - var bounds = this.getBounds(); - - var canvasBuffer = new PIXI.CanvasBuffer(bounds.width * resolution, bounds.height * resolution); - - var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas, scaleMode); - texture.baseTexture.resolution = resolution; - - canvasBuffer.context.scale(resolution, resolution); - - canvasBuffer.context.translate(-bounds.x,-bounds.y); - - PIXI.CanvasGraphics.renderGraphics(this, canvasBuffer.context); - - return texture; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Graphics.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(this.visible === false || this.alpha === 0 || this.isMask === true)return; - - if(this._cacheAsBitmap) - { - - if(this.dirty || this.cachedSpriteDirty) - { - - this._generateCachedSprite(); - - // we will also need to update the texture on the gpu too! - this.updateCachedSpriteTexture(); - - this.cachedSpriteDirty = false; - this.dirty = false; - } - - this._cachedSprite.worldAlpha = this.worldAlpha; - PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession); - - return; - } - else - { - renderSession.spriteBatch.stop(); - renderSession.blendModeManager.setBlendMode(this.blendMode); - - if(this._mask)renderSession.maskManager.pushMask(this._mask, renderSession); - if(this._filters)renderSession.filterManager.pushFilter(this._filterBlock); - - // check blend mode - if(this.blendMode !== renderSession.spriteBatch.currentBlendMode) - { - renderSession.spriteBatch.currentBlendMode = this.blendMode; - var blendModeWebGL = PIXI.blendModesWebGL[renderSession.spriteBatch.currentBlendMode]; - renderSession.spriteBatch.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); - } - - // check if the webgl graphic needs to be updated - if(this.webGLDirty) - { - this.dirty = true; - this.webGLDirty = false; - } - - PIXI.WebGLGraphics.renderGraphics(this, renderSession); - - // only render if it has children! - if(this.children.length) - { - renderSession.spriteBatch.start(); - - // simple render children! - for(var i=0, j=this.children.length; i maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - - this._bounds.x = minX; - this._bounds.width = maxX - minX; - - this._bounds.y = minY; - this._bounds.height = maxY - minY; - - return this._bounds; -}; - -/** - * Update the bounds of the object - * - * @method updateLocalBounds - */ -PIXI.Graphics.prototype.updateLocalBounds = function() -{ - var minX = Infinity; - var maxX = -Infinity; - - var minY = Infinity; - var maxY = -Infinity; - - if(this.graphicsData.length) - { - var shape, points, x, y, w, h; - - for (var i = 0; i < this.graphicsData.length; i++) { - var data = this.graphicsData[i]; - var type = data.type; - var lineWidth = data.lineWidth; - shape = data.shape; - - - if(type === PIXI.Graphics.RECT || type === PIXI.Graphics.RREC) - { - x = shape.x - lineWidth/2; - y = shape.y - lineWidth/2; - w = shape.width + lineWidth; - h = shape.height + lineWidth; - - minX = x < minX ? x : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y < minY ? y : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else if(type === PIXI.Graphics.CIRC) - { - x = shape.x; - y = shape.y; - w = shape.radius + lineWidth/2; - h = shape.radius + lineWidth/2; - - minX = x - w < minX ? x - w : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y - h < minY ? y - h : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else if(type === PIXI.Graphics.ELIP) - { - x = shape.x; - y = shape.y; - w = shape.width + lineWidth/2; - h = shape.height + lineWidth/2; - - minX = x - w < minX ? x - w : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y - h < minY ? y - h : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else - { - // POLY - points = shape.points; - - for (var j = 0; j < points.length; j+=2) - { - - x = points[j]; - y = points[j+1]; - minX = x-lineWidth < minX ? x-lineWidth : minX; - maxX = x+lineWidth > maxX ? x+lineWidth : maxX; - - minY = y-lineWidth < minY ? y-lineWidth : minY; - maxY = y+lineWidth > maxY ? y+lineWidth : maxY; - } - } - } - } - else - { - minX = 0; - maxX = 0; - minY = 0; - maxY = 0; - } - - var padding = this.boundsPadding; - - this._localBounds.x = minX - padding; - this._localBounds.width = (maxX - minX) + padding * 2; - - this._localBounds.y = minY - padding; - this._localBounds.height = (maxY - minY) + padding * 2; -}; - -/** - * Generates the cached sprite when the sprite has cacheAsBitmap = true - * - * @method _generateCachedSprite - * @private - */ -PIXI.Graphics.prototype._generateCachedSprite = function() -{ - var bounds = this.getLocalBounds(); - - if(!this._cachedSprite) - { - var canvasBuffer = new PIXI.CanvasBuffer(bounds.width, bounds.height); - var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); - - this._cachedSprite = new PIXI.Sprite(texture); - this._cachedSprite.buffer = canvasBuffer; - - this._cachedSprite.worldTransform = this.worldTransform; - } - else - { - this._cachedSprite.buffer.resize(bounds.width, bounds.height); - } - - // leverage the anchor to account for the offset of the element - this._cachedSprite.anchor.x = -( bounds.x / bounds.width ); - this._cachedSprite.anchor.y = -( bounds.y / bounds.height ); - - // this._cachedSprite.buffer.context.save(); - this._cachedSprite.buffer.context.translate(-bounds.x,-bounds.y); - - // make sure we set the alpha of the graphics to 1 for the render.. - this.worldAlpha = 1; - - // now render the graphic.. - PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context); - this._cachedSprite.alpha = this.alpha; -}; - -/** - * Updates texture size based on canvas size - * - * @method updateCachedSpriteTexture - * @private - */ -PIXI.Graphics.prototype.updateCachedSpriteTexture = function() -{ - var cachedSprite = this._cachedSprite; - var texture = cachedSprite.texture; - var canvas = cachedSprite.buffer.canvas; - - texture.baseTexture.width = canvas.width; - texture.baseTexture.height = canvas.height; - texture.crop.width = texture.frame.width = canvas.width; - texture.crop.height = texture.frame.height = canvas.height; - - cachedSprite._width = canvas.width; - cachedSprite._height = canvas.height; - - // update the dirty base textures - texture.baseTexture.dirty(); -}; - -/** - * Destroys a previous cached sprite. - * - * @method destroyCachedSprite - */ -PIXI.Graphics.prototype.destroyCachedSprite = function() -{ - this._cachedSprite.texture.destroy(true); - - // let the gc collect the unused sprite - // TODO could be object pooled! - this._cachedSprite = null; -}; - -/** - * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. - * - * @method drawShape - * @param {Circle|Rectangle|Ellipse|Line|Polygon} shape The Shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. - */ -PIXI.Graphics.prototype.drawShape = function(shape) -{ - if(this.currentPath) - { - // check current path! - if(this.currentPath.shape.points.length <= 2)this.graphicsData.pop(); - } - - this.currentPath = null; - - var data = new PIXI.GraphicsData(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, shape); - - this.graphicsData.push(data); - - if(data.type === PIXI.Graphics.POLY) - { - data.shape.closed = this.filling; - this.currentPath = data; - } - - this.dirty = true; - - return data; -}; - -/** - * A GraphicsData object. - * - * @class GraphicsData - * @constructor - */ -PIXI.GraphicsData = function(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, shape) -{ - this.lineWidth = lineWidth; - this.lineColor = lineColor; - this.lineAlpha = lineAlpha; - this._lineTint = lineColor; - - this.fillColor = fillColor; - this.fillAlpha = fillAlpha; - this._fillTint = fillColor; - this.fill = fill; - - this.shape = shape; - this.type = shape.type; -}; - -// SOME TYPES: -PIXI.Graphics.POLY = 0; -PIXI.Graphics.RECT = 1; -PIXI.Graphics.CIRC = 2; -PIXI.Graphics.ELIP = 3; -PIXI.Graphics.RREC = 4; - -PIXI.Polygon.prototype.type = PIXI.Graphics.POLY; -PIXI.Rectangle.prototype.type = PIXI.Graphics.RECT; -PIXI.Circle.prototype.type = PIXI.Graphics.CIRC; -PIXI.Ellipse.prototype.type = PIXI.Graphics.ELIP; -PIXI.RoundedRectangle.prototype.type = PIXI.Graphics.RREC; - - -/** - * @author Mat Groves http://matgroves.com/ - */ - - /** - * - * @class Strip - * @extends DisplayObjectContainer - * @constructor - * @param texture {Texture} The texture to use - * @param width {Number} the width - * @param height {Number} the height - * - */ -PIXI.Strip = function(texture) -{ - PIXI.DisplayObjectContainer.call( this ); - - - /** - * The texture of the strip - * - * @property texture - * @type Texture - */ - this.texture = texture; - - // set up the main bits.. - this.uvs = new PIXI.Float32Array([0, 1, - 1, 1, - 1, 0, - 0, 1]); - - this.vertices = new PIXI.Float32Array([0, 0, - 100, 0, - 100, 100, - 0, 100]); - - this.colors = new PIXI.Float32Array([1, 1, 1, 1]); - - this.indices = new PIXI.Uint16Array([0, 1, 2, 3]); - - /** - * Whether the strip is dirty or not - * - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode. - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - /** - * Triangles in canvas mode are automatically antialiased, use this value to force triangles to overlap a bit with each other. - * - * @property canvasPadding - * @type Number - */ - this.canvasPadding = 0; - - this.drawMode = PIXI.Strip.DrawModes.TRIANGLE_STRIP; - -}; - -// constructor -PIXI.Strip.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); -PIXI.Strip.prototype.constructor = PIXI.Strip; - -PIXI.Strip.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(!this.visible || this.alpha <= 0)return; - // render triangle strip.. - - renderSession.spriteBatch.stop(); - - // init! init! - if(!this._vertexBuffer)this._initWebGL(renderSession); - - renderSession.shaderManager.setShader(renderSession.shaderManager.stripShader); - - this._renderStrip(renderSession); - - ///renderSession.shaderManager.activateDefaultShader(); - - renderSession.spriteBatch.start(); - - //TODO check culling -}; - -PIXI.Strip.prototype._initWebGL = function(renderSession) -{ - // build the strip! - var gl = renderSession.gl; - - this._vertexBuffer = gl.createBuffer(); - this._indexBuffer = gl.createBuffer(); - this._uvBuffer = gl.createBuffer(); - this._colorBuffer = gl.createBuffer(); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvs, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._colorBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.colors, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); -}; - -PIXI.Strip.prototype._renderStrip = function(renderSession) -{ - var gl = renderSession.gl; - var projection = renderSession.projection, - offset = renderSession.offset, - shader = renderSession.shaderManager.stripShader; - - var drawMode = this.drawMode === PIXI.Strip.DrawModes.TRIANGLE_STRIP ? gl.TRIANGLE_STRIP : gl.TRIANGLES; - - // gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mat4Real); - - renderSession.blendModeManager.setBlendMode(this.blendMode); - - - // set uniforms - gl.uniformMatrix3fv(shader.translationMatrix, false, this.worldTransform.toArray(true)); - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - gl.uniform1f(shader.alpha, this.worldAlpha); - - if(!this.dirty) - { - - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - // update the uvs - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.activeTexture(gl.TEXTURE0); - - // check if a texture is dirty.. - if(this.texture.baseTexture._dirty[gl.id]) - { - renderSession.renderer.updateTexture(this.texture.baseTexture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]); - } - - // dont need to upload! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - - - } - else - { - - this.dirty = false; - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.STATIC_DRAW); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - // update the uvs - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvs, gl.STATIC_DRAW); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.activeTexture(gl.TEXTURE0); - - // check if a texture is dirty.. - if(this.texture.baseTexture._dirty[gl.id]) - { - renderSession.renderer.updateTexture(this.texture.baseTexture); - } - else - { - gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]); - } - - // dont need to upload! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - } - //console.log(gl.TRIANGLE_STRIP) - // - // - gl.drawElements(drawMode, this.indices.length, gl.UNSIGNED_SHORT, 0); - - -}; - - - -PIXI.Strip.prototype._renderCanvas = function(renderSession) -{ - var context = renderSession.context; - - var transform = this.worldTransform; - - if (renderSession.roundPixels) - { - context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx | 0, transform.ty | 0); - } - else - { - context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty); - } - - if (this.drawMode === PIXI.Strip.DrawModes.TRIANGLE_STRIP) - { - this._renderCanvasTriangleStrip(context); - } - else - { - this._renderCanvasTriangles(context); - } -}; - -PIXI.Strip.prototype._renderCanvasTriangleStrip = function(context) -{ - // draw triangles!! - var vertices = this.vertices; - var uvs = this.uvs; - - var length = vertices.length / 2; - this.count++; - - for (var i = 0; i < length - 2; i++) { - // draw some triangles! - var index = i * 2; - this._renderCanvasDrawTriangle(context, vertices, uvs, index, (index + 2), (index + 4)); - } -}; - -PIXI.Strip.prototype._renderCanvasTriangles = function(context) -{ - // draw triangles!! - var vertices = this.vertices; - var uvs = this.uvs; - var indices = this.indices; - - var length = indices.length; - this.count++; - - for (var i = 0; i < length; i += 3) { - // draw some triangles! - var index0 = indices[i] * 2, index1 = indices[i + 1] * 2, index2 = indices[i + 2] * 2; - this._renderCanvasDrawTriangle(context, vertices, uvs, index0, index1, index2); - } -}; - -PIXI.Strip.prototype._renderCanvasDrawTriangle = function(context, vertices, uvs, index0, index1, index2) -{ - var textureSource = this.texture.baseTexture.source; - var textureWidth = this.texture.width; - var textureHeight = this.texture.height; - - var x0 = vertices[index0], x1 = vertices[index1], x2 = vertices[index2]; - var y0 = vertices[index0 + 1], y1 = vertices[index1 + 1], y2 = vertices[index2 + 1]; - - var u0 = uvs[index0] * textureWidth, u1 = uvs[index1] * textureWidth, u2 = uvs[index2] * textureWidth; - var v0 = uvs[index0 + 1] * textureHeight, v1 = uvs[index1 + 1] * textureHeight, v2 = uvs[index2 + 1] * textureHeight; - - if (this.canvasPadding > 0) { - var paddingX = this.canvasPadding / this.worldTransform.a; - var paddingY = this.canvasPadding / this.worldTransform.d; - var centerX = (x0 + x1 + x2) / 3; - var centerY = (y0 + y1 + y2) / 3; - - var normX = x0 - centerX; - var normY = y0 - centerY; - - var dist = Math.sqrt(normX * normX + normY * normY); - x0 = centerX + (normX / dist) * (dist + paddingX); - y0 = centerY + (normY / dist) * (dist + paddingY); - - // - - normX = x1 - centerX; - normY = y1 - centerY; - - dist = Math.sqrt(normX * normX + normY * normY); - x1 = centerX + (normX / dist) * (dist + paddingX); - y1 = centerY + (normY / dist) * (dist + paddingY); - - normX = x2 - centerX; - normY = y2 - centerY; - - dist = Math.sqrt(normX * normX + normY * normY); - x2 = centerX + (normX / dist) * (dist + paddingX); - y2 = centerY + (normY / dist) * (dist + paddingY); - } - - context.save(); - context.beginPath(); - - - context.moveTo(x0, y0); - context.lineTo(x1, y1); - context.lineTo(x2, y2); - - context.closePath(); - - context.clip(); - - // Compute matrix transform - var delta = (u0 * v1) + (v0 * u2) + (u1 * v2) - (v1 * u2) - (v0 * u1) - (u0 * v2); - var deltaA = (x0 * v1) + (v0 * x2) + (x1 * v2) - (v1 * x2) - (v0 * x1) - (x0 * v2); - var deltaB = (u0 * x1) + (x0 * u2) + (u1 * x2) - (x1 * u2) - (x0 * u1) - (u0 * x2); - var deltaC = (u0 * v1 * x2) + (v0 * x1 * u2) + (x0 * u1 * v2) - (x0 * v1 * u2) - (v0 * u1 * x2) - (u0 * x1 * v2); - var deltaD = (y0 * v1) + (v0 * y2) + (y1 * v2) - (v1 * y2) - (v0 * y1) - (y0 * v2); - var deltaE = (u0 * y1) + (y0 * u2) + (u1 * y2) - (y1 * u2) - (y0 * u1) - (u0 * y2); - var deltaF = (u0 * v1 * y2) + (v0 * y1 * u2) + (y0 * u1 * v2) - (y0 * v1 * u2) - (v0 * u1 * y2) - (u0 * y1 * v2); - - context.transform(deltaA / delta, deltaD / delta, - deltaB / delta, deltaE / delta, - deltaC / delta, deltaF / delta); - - context.drawImage(textureSource, 0, 0); - context.restore(); -}; - - - -/** - * Renders a flat strip - * - * @method renderStripFlat - * @param strip {Strip} The Strip to render - * @private - */ -PIXI.Strip.prototype.renderStripFlat = function(strip) -{ - var context = this.context; - var vertices = strip.vertices; - - var length = vertices.length/2; - this.count++; - - context.beginPath(); - for (var i=1; i < length-2; i++) - { - // draw some triangles! - var index = i*2; - - var x0 = vertices[index], x1 = vertices[index+2], x2 = vertices[index+4]; - var y0 = vertices[index+1], y1 = vertices[index+3], y2 = vertices[index+5]; - - context.moveTo(x0, y0); - context.lineTo(x1, y1); - context.lineTo(x2, y2); - } - - context.fillStyle = '#FF0000'; - context.fill(); - context.closePath(); -}; - -/* -PIXI.Strip.prototype.setTexture = function(texture) -{ - //TODO SET THE TEXTURES - //TODO VISIBILITY - - // stop current texture - this.texture = texture; - this.width = texture.frame.width; - this.height = texture.frame.height; - this.updateFrame = true; -}; -*/ - -/** - * When the texture is updated, this event will fire to update the scale and frame - * - * @method onTextureUpdate - * @param event - * @private - */ - -PIXI.Strip.prototype.onTextureUpdate = function() -{ - this.updateFrame = true; -}; - -/** - * Returns the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account. - * - * @method getBounds - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle - */ -PIXI.Strip.prototype.getBounds = function(matrix) -{ - var worldTransform = matrix || this.worldTransform; - - var a = worldTransform.a; - var b = worldTransform.b; - var c = worldTransform.c; - var d = worldTransform.d; - var tx = worldTransform.tx; - var ty = worldTransform.ty; - - var maxX = -Infinity; - var maxY = -Infinity; - - var minX = Infinity; - var minY = Infinity; - - var vertices = this.vertices; - for (var i = 0, n = vertices.length; i < n; i += 2) - { - var rawX = vertices[i], rawY = vertices[i + 1]; - var x = (a * rawX) + (c * rawY) + tx; - var y = (d * rawY) + (b * rawX) + ty; - - minX = x < minX ? x : minX; - minY = y < minY ? y : minY; - - maxX = x > maxX ? x : maxX; - maxY = y > maxY ? y : maxY; - } - - if (minX === -Infinity || maxY === Infinity) - { - return PIXI.EmptyRectangle; - } - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - -/** - * Different drawing buffer modes supported - * - * @property - * @type {{TRIANGLE_STRIP: number, TRIANGLES: number}} - * @static - */ -PIXI.Strip.DrawModes = { - TRIANGLE_STRIP: 0, - TRIANGLES: 1 -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * @copyright Mat Groves, Rovanion Luckey - */ - -/** - * - * @class Rope - * @constructor - * @extends Strip - * @param {Texture} texture - The texture to use on the rope. - * @param {Array} points - An array of {PIXI.Point}. - * - */ -PIXI.Rope = function(texture, points) -{ - PIXI.Strip.call( this, texture ); - this.points = points; - - this.vertices = new PIXI.Float32Array(points.length * 4); - this.uvs = new PIXI.Float32Array(points.length * 4); - this.colors = new PIXI.Float32Array(points.length * 2); - this.indices = new PIXI.Uint16Array(points.length * 2); - - - this.refresh(); -}; - - -// constructor -PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype ); -PIXI.Rope.prototype.constructor = PIXI.Rope; - -/* - * Refreshes - * - * @method refresh - */ -PIXI.Rope.prototype.refresh = function() -{ - var points = this.points; - if(points.length < 1) return; - - var uvs = this.uvs; - - var lastPoint = points[0]; - var indices = this.indices; - var colors = this.colors; - - this.count-=0.2; - - uvs[0] = 0; - uvs[1] = 0; - uvs[2] = 0; - uvs[3] = 1; - - colors[0] = 1; - colors[1] = 1; - - indices[0] = 0; - indices[1] = 1; - - var total = points.length, - point, index, amount; - - for (var i = 1; i < total; i++) - { - point = points[i]; - index = i * 4; - // time to do some smart drawing! - amount = i / (total-1); - - if(i%2) - { - uvs[index] = amount; - uvs[index+1] = 0; - - uvs[index+2] = amount; - uvs[index+3] = 1; - } - else - { - uvs[index] = amount; - uvs[index+1] = 0; - - uvs[index+2] = amount; - uvs[index+3] = 1; - } - - index = i * 2; - colors[index] = 1; - colors[index+1] = 1; - - index = i * 2; - indices[index] = index; - indices[index + 1] = index + 1; - - lastPoint = point; - } -}; - -/* - * Updates the object transform for rendering - * - * @method updateTransform - * @private - */ -PIXI.Rope.prototype.updateTransform = function() -{ - - var points = this.points; - if(points.length < 1)return; - - var lastPoint = points[0]; - var nextPoint; - var perp = {x:0, y:0}; - - this.count-=0.2; - - var vertices = this.vertices; - var total = points.length, - point, index, ratio, perpLength, num; - - for (var i = 0; i < total; i++) - { - point = points[i]; - index = i * 4; - - if(i < points.length-1) - { - nextPoint = points[i+1]; - } - else - { - nextPoint = point; - } - - perp.y = -(nextPoint.x - lastPoint.x); - perp.x = nextPoint.y - lastPoint.y; - - ratio = (1 - (i / (total-1))) * 10; - - if(ratio > 1) ratio = 1; - - perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y); - num = this.texture.height / 2; //(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio; - perp.x /= perpLength; - perp.y /= perpLength; - - perp.x *= num; - perp.y *= num; - - vertices[index] = point.x + perp.x; - vertices[index+1] = point.y + perp.y; - vertices[index+2] = point.x - perp.x; - vertices[index+3] = point.y - perp.y; - - lastPoint = point; - } - - PIXI.DisplayObjectContainer.prototype.updateTransform.call( this ); -}; -/* - * Sets the texture that the Rope will use - * - * @method setTexture - * @param texture {Texture} the texture that will be used - */ -PIXI.Rope.prototype.setTexture = function(texture) -{ - // stop current texture - this.texture = texture; - //this.updateFrame = true; -}; - -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * A tiling sprite is a fast way of rendering a tiling image - * - * @class TilingSprite - * @extends Sprite - * @constructor - * @param texture {Texture} the texture of the tiling sprite - * @param width {Number} the width of the tiling sprite - * @param height {Number} the height of the tiling sprite - */ -PIXI.TilingSprite = function(texture, width, height) -{ - PIXI.Sprite.call( this, texture); - - /** - * The with of the tiling sprite - * - * @property width - * @type Number - */ - this._width = width || 100; - - /** - * The height of the tiling sprite - * - * @property height - * @type Number - */ - this._height = height || 100; - - /** - * The scaling of the image that is being tiled - * - * @property tileScale - * @type Point - */ - this.tileScale = new PIXI.Point(1,1); - - /** - * A point that represents the scale of the texture object - * - * @property tileScaleOffset - * @type Point - */ - this.tileScaleOffset = new PIXI.Point(1,1); - - /** - * The offset position of the image that is being tiled - * - * @property tilePosition - * @type Point - */ - this.tilePosition = new PIXI.Point(0,0); - - /** - * Whether this sprite is renderable or not - * - * @property renderable - * @type Boolean - * @default true - */ - this.renderable = true; - - /** - * The tint applied to the sprite. This is a hex value - * - * @property tint - * @type Number - * @default 0xFFFFFF - */ - this.tint = 0xFFFFFF; - - /** - * The blend mode to be applied to the sprite - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - - -}; - -// constructor -PIXI.TilingSprite.prototype = Object.create(PIXI.Sprite.prototype); -PIXI.TilingSprite.prototype.constructor = PIXI.TilingSprite; - - -/** - * The width of the sprite, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.TilingSprite.prototype, 'width', { - get: function() { - return this._width; - }, - set: function(value) { - - this._width = value; - } -}); - -/** - * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.TilingSprite.prototype, 'height', { - get: function() { - return this._height; - }, - set: function(value) { - this._height = value; - } -}); - -PIXI.TilingSprite.prototype.setTexture = function(texture) -{ - if (this.texture === texture) return; - - this.texture = texture; - - this.refreshTexture = true; - - this.cachedTint = 0xFFFFFF; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.TilingSprite.prototype._renderWebGL = function(renderSession) -{ - if (this.visible === false || this.alpha === 0) return; - var i,j; - - if (this._mask) - { - renderSession.spriteBatch.stop(); - renderSession.maskManager.pushMask(this.mask, renderSession); - renderSession.spriteBatch.start(); - } - - if (this._filters) - { - renderSession.spriteBatch.flush(); - renderSession.filterManager.pushFilter(this._filterBlock); - } - - - - if (!this.tilingTexture || this.refreshTexture) - { - this.generateTilingTexture(true); - - if (this.tilingTexture && this.tilingTexture.needsUpdate) - { - //TODO - tweaking - renderSession.renderer.updateTexture(this.tilingTexture.baseTexture); - this.tilingTexture.needsUpdate = false; - // this.tilingTexture._uvs = null; - } - } - else - { - renderSession.spriteBatch.renderTilingSprite(this); - } - // simple render children! - for (i=0,j=this.children.length; i maxX ? x1 : maxX; - maxX = x2 > maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y1 > maxY ? y1 : maxY; - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - - - -/** - * When the texture is updated, this event will fire to update the scale and frame - * - * @method onTextureUpdate - * @param event - * @private - */ -PIXI.TilingSprite.prototype.onTextureUpdate = function() -{ - // overriding the sprite version of this! -}; - - -/** -* -* @method generateTilingTexture -* -* @param forcePowerOfTwo {Boolean} Whether we want to force the texture to be a power of two -*/ -PIXI.TilingSprite.prototype.generateTilingTexture = function(forcePowerOfTwo) -{ - if (!this.texture.baseTexture.hasLoaded) return; - - var texture = this.originalTexture || this.texture; - var frame = texture.frame; - var targetWidth, targetHeight; - - // Check that the frame is the same size as the base texture. - var isFrame = frame.width !== texture.baseTexture.width || frame.height !== texture.baseTexture.height; - - var newTextureRequired = false; - - if (!forcePowerOfTwo) - { - if (isFrame) - { - if (texture.trim) - { - targetWidth = texture.trim.width; - targetHeight = texture.trim.height; - } - else - { - targetWidth = frame.width; - targetHeight = frame.height; - } - - newTextureRequired = true; - } - } - else - { - targetWidth = PIXI.getNextPowerOfTwo(frame.width); - targetHeight = PIXI.getNextPowerOfTwo(frame.height); - - // If the BaseTexture dimensions don't match the texture frame then we need a new texture anyway because it's part of a texture atlas - if (frame.width !== targetWidth || frame.height !== targetHeight || texture.baseTexture.width !== targetWidth || texture.baseTexture.height || targetHeight) newTextureRequired = true; - } - - if (newTextureRequired) - { - var canvasBuffer; - - if (this.tilingTexture && this.tilingTexture.isTiling) - { - canvasBuffer = this.tilingTexture.canvasBuffer; - canvasBuffer.resize(targetWidth, targetHeight); - this.tilingTexture.baseTexture.width = targetWidth; - this.tilingTexture.baseTexture.height = targetHeight; - this.tilingTexture.needsUpdate = true; - } - else - { - canvasBuffer = new PIXI.CanvasBuffer(targetWidth, targetHeight); - - this.tilingTexture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); - this.tilingTexture.canvasBuffer = canvasBuffer; - this.tilingTexture.isTiling = true; - } - - canvasBuffer.context.drawImage(texture.baseTexture.source, - texture.crop.x, - texture.crop.y, - texture.crop.width, - texture.crop.height, - 0, - 0, - targetWidth, - targetHeight); - - this.tileScaleOffset.x = frame.width / targetWidth; - this.tileScaleOffset.y = frame.height / targetHeight; - } - else - { - // TODO - switching? - if (this.tilingTexture && this.tilingTexture.isTiling) - { - // destroy the tiling texture! - // TODO could store this somewhere? - this.tilingTexture.destroy(true); - } - - this.tileScaleOffset.x = 1; - this.tileScaleOffset.y = 1; - this.tilingTexture = texture; - } - - this.refreshTexture = false; - - this.originalTexture = this.texture; - this.texture = this.tilingTexture; - - this.tilingTexture.baseTexture._powerOf2 = true; -}; - -PIXI.TilingSprite.prototype.destroy = function () { - PIXI.Sprite.prototype.destroy.call(this); - - this.tileScale = null; - this.tileScaleOffset = null; - this.tilePosition = null; - - this.tilingTexture.destroy(true); - this.tilingTexture = null; -}; - -/****************************************************************************** - * Spine Runtimes Software License - * Version 2.1 - * - * Copyright (c) 2013, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable and - * non-transferable license to install, execute and perform the Spine Runtimes - * Software (the "Software") solely for internal use. Without the written - * permission of Esoteric Software (typically granted by licensing Spine), you - * may not (a) modify, translate, adapt or otherwise create derivative works, - * improvements of the Software or develop new applications using the Software - * or (b) remove, delete, alter or obscure any trademarks or any copyright, - * trademark, patent or other intellectual property or proprietary rights - * notices on or in the Software, including any copy thereof. Redistributions - * in binary or source form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -var spine = { - radDeg: 180 / Math.PI, - degRad: Math.PI / 180, - temp: [], - Float32Array: (typeof(Float32Array) === 'undefined') ? Array : Float32Array, - Uint16Array: (typeof(Uint16Array) === 'undefined') ? Array : Uint16Array -}; - -spine.BoneData = function (name, parent) { - this.name = name; - this.parent = parent; -}; -spine.BoneData.prototype = { - length: 0, - x: 0, y: 0, - rotation: 0, - scaleX: 1, scaleY: 1, - inheritScale: true, - inheritRotation: true, - flipX: false, flipY: false -}; - -spine.SlotData = function (name, boneData) { - this.name = name; - this.boneData = boneData; -}; -spine.SlotData.prototype = { - r: 1, g: 1, b: 1, a: 1, - attachmentName: null, - additiveBlending: false -}; - -spine.IkConstraintData = function (name) { - this.name = name; - this.bones = []; -}; -spine.IkConstraintData.prototype = { - target: null, - bendDirection: 1, - mix: 1 -}; - -spine.Bone = function (boneData, skeleton, parent) { - this.data = boneData; - this.skeleton = skeleton; - this.parent = parent; - this.setToSetupPose(); -}; -spine.Bone.yDown = false; -spine.Bone.prototype = { - x: 0, y: 0, - rotation: 0, rotationIK: 0, - scaleX: 1, scaleY: 1, - flipX: false, flipY: false, - m00: 0, m01: 0, worldX: 0, // a b x - m10: 0, m11: 0, worldY: 0, // c d y - worldRotation: 0, - worldScaleX: 1, worldScaleY: 1, - worldFlipX: false, worldFlipY: false, - updateWorldTransform: function () { - var parent = this.parent; - if (parent) { - this.worldX = this.x * parent.m00 + this.y * parent.m01 + parent.worldX; - this.worldY = this.x * parent.m10 + this.y * parent.m11 + parent.worldY; - if (this.data.inheritScale) { - this.worldScaleX = parent.worldScaleX * this.scaleX; - this.worldScaleY = parent.worldScaleY * this.scaleY; - } else { - this.worldScaleX = this.scaleX; - this.worldScaleY = this.scaleY; - } - this.worldRotation = this.data.inheritRotation ? (parent.worldRotation + this.rotationIK) : this.rotationIK; - this.worldFlipX = parent.worldFlipX != this.flipX; - this.worldFlipY = parent.worldFlipY != this.flipY; - } else { - var skeletonFlipX = this.skeleton.flipX, skeletonFlipY = this.skeleton.flipY; - this.worldX = skeletonFlipX ? -this.x : this.x; - this.worldY = (skeletonFlipY != spine.Bone.yDown) ? -this.y : this.y; - this.worldScaleX = this.scaleX; - this.worldScaleY = this.scaleY; - this.worldRotation = this.rotationIK; - this.worldFlipX = skeletonFlipX != this.flipX; - this.worldFlipY = skeletonFlipY != this.flipY; - } - var radians = this.worldRotation * spine.degRad; - var cos = Math.cos(radians); - var sin = Math.sin(radians); - if (this.worldFlipX) { - this.m00 = -cos * this.worldScaleX; - this.m01 = sin * this.worldScaleY; - } else { - this.m00 = cos * this.worldScaleX; - this.m01 = -sin * this.worldScaleY; - } - if (this.worldFlipY != spine.Bone.yDown) { - this.m10 = -sin * this.worldScaleX; - this.m11 = -cos * this.worldScaleY; - } else { - this.m10 = sin * this.worldScaleX; - this.m11 = cos * this.worldScaleY; - } - }, - setToSetupPose: function () { - var data = this.data; - this.x = data.x; - this.y = data.y; - this.rotation = data.rotation; - this.rotationIK = this.rotation; - this.scaleX = data.scaleX; - this.scaleY = data.scaleY; - this.flipX = data.flipX; - this.flipY = data.flipY; - }, - worldToLocal: function (world) { - var dx = world[0] - this.worldX, dy = world[1] - this.worldY; - var m00 = this.m00, m10 = this.m10, m01 = this.m01, m11 = this.m11; - if (this.worldFlipX != (this.worldFlipY != spine.Bone.yDown)) { - m00 = -m00; - m11 = -m11; - } - var invDet = 1 / (m00 * m11 - m01 * m10); - world[0] = dx * m00 * invDet - dy * m01 * invDet; - world[1] = dy * m11 * invDet - dx * m10 * invDet; - }, - localToWorld: function (local) { - var localX = local[0], localY = local[1]; - local[0] = localX * this.m00 + localY * this.m01 + this.worldX; - local[1] = localX * this.m10 + localY * this.m11 + this.worldY; - } -}; - -spine.Slot = function (slotData, bone) { - this.data = slotData; - this.bone = bone; - this.setToSetupPose(); -}; -spine.Slot.prototype = { - r: 1, g: 1, b: 1, a: 1, - _attachmentTime: 0, - attachment: null, - attachmentVertices: [], - setAttachment: function (attachment) { - this.attachment = attachment; - this._attachmentTime = this.bone.skeleton.time; - this.attachmentVertices.length = 0; - }, - setAttachmentTime: function (time) { - this._attachmentTime = this.bone.skeleton.time - time; - }, - getAttachmentTime: function () { - return this.bone.skeleton.time - this._attachmentTime; - }, - setToSetupPose: function () { - var data = this.data; - this.r = data.r; - this.g = data.g; - this.b = data.b; - this.a = data.a; - - var slotDatas = this.bone.skeleton.data.slots; - for (var i = 0, n = slotDatas.length; i < n; i++) { - if (slotDatas[i] == data) { - this.setAttachment(!data.attachmentName ? null : this.bone.skeleton.getAttachmentBySlotIndex(i, data.attachmentName)); - break; - } - } - } -}; - -spine.IkConstraint = function (data, skeleton) { - this.data = data; - this.mix = data.mix; - this.bendDirection = data.bendDirection; - - this.bones = []; - for (var i = 0, n = data.bones.length; i < n; i++) - this.bones.push(skeleton.findBone(data.bones[i].name)); - this.target = skeleton.findBone(data.target.name); -}; -spine.IkConstraint.prototype = { - apply: function () { - var target = this.target; - var bones = this.bones; - switch (bones.length) { - case 1: - spine.IkConstraint.apply1(bones[0], target.worldX, target.worldY, this.mix); - break; - case 2: - spine.IkConstraint.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.mix); - break; - } - } -}; -/** Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified in the world - * coordinate system. */ -spine.IkConstraint.apply1 = function (bone, targetX, targetY, alpha) { - var parentRotation = (!bone.data.inheritRotation || !bone.parent) ? 0 : bone.parent.worldRotation; - var rotation = bone.rotation; - var rotationIK = Math.atan2(targetY - bone.worldY, targetX - bone.worldX) * spine.radDeg - parentRotation; - bone.rotationIK = rotation + (rotationIK - rotation) * alpha; -}; -/** Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as possible. The - * target is specified in the world coordinate system. - * @param child Any descendant bone of the parent. */ -spine.IkConstraint.apply2 = function (parent, child, targetX, targetY, bendDirection, alpha) { - var childRotation = child.rotation, parentRotation = parent.rotation; - if (!alpha) { - child.rotationIK = childRotation; - parent.rotationIK = parentRotation; - return; - } - var positionX, positionY, tempPosition = spine.temp; - var parentParent = parent.parent; - if (parentParent) { - tempPosition[0] = targetX; - tempPosition[1] = targetY; - parentParent.worldToLocal(tempPosition); - targetX = (tempPosition[0] - parent.x) * parentParent.worldScaleX; - targetY = (tempPosition[1] - parent.y) * parentParent.worldScaleY; - } else { - targetX -= parent.x; - targetY -= parent.y; - } - if (child.parent == parent) { - positionX = child.x; - positionY = child.y; - } else { - tempPosition[0] = child.x; - tempPosition[1] = child.y; - child.parent.localToWorld(tempPosition); - parent.worldToLocal(tempPosition); - positionX = tempPosition[0]; - positionY = tempPosition[1]; - } - var childX = positionX * parent.worldScaleX, childY = positionY * parent.worldScaleY; - var offset = Math.atan2(childY, childX); - var len1 = Math.sqrt(childX * childX + childY * childY), len2 = child.data.length * child.worldScaleX; - // Based on code by Ryan Juckett with permission: Copyright (c) 2008-2009 Ryan Juckett, http://www.ryanjuckett.com/ - var cosDenom = 2 * len1 * len2; - if (cosDenom < 0.0001) { - child.rotationIK = childRotation + (Math.atan2(targetY, targetX) * spine.radDeg - parentRotation - childRotation) * alpha; - return; - } - var cos = (targetX * targetX + targetY * targetY - len1 * len1 - len2 * len2) / cosDenom; - if (cos < -1) - cos = -1; - else if (cos > 1) - cos = 1; - var childAngle = Math.acos(cos) * bendDirection; - var adjacent = len1 + len2 * cos, opposite = len2 * Math.sin(childAngle); - var parentAngle = Math.atan2(targetY * adjacent - targetX * opposite, targetX * adjacent + targetY * opposite); - var rotation = (parentAngle - offset) * spine.radDeg - parentRotation; - if (rotation > 180) - rotation -= 360; - else if (rotation < -180) // - rotation += 360; - parent.rotationIK = parentRotation + rotation * alpha; - rotation = (childAngle + offset) * spine.radDeg - childRotation; - if (rotation > 180) - rotation -= 360; - else if (rotation < -180) // - rotation += 360; - child.rotationIK = childRotation + (rotation + parent.worldRotation - child.parent.worldRotation) * alpha; -}; - -spine.Skin = function (name) { - this.name = name; - this.attachments = {}; -}; -spine.Skin.prototype = { - addAttachment: function (slotIndex, name, attachment) { - this.attachments[slotIndex + ":" + name] = attachment; - }, - getAttachment: function (slotIndex, name) { - return this.attachments[slotIndex + ":" + name]; - }, - _attachAll: function (skeleton, oldSkin) { - for (var key in oldSkin.attachments) { - var colon = key.indexOf(":"); - var slotIndex = parseInt(key.substring(0, colon)); - var name = key.substring(colon + 1); - var slot = skeleton.slots[slotIndex]; - if (slot.attachment && slot.attachment.name == name) { - var attachment = this.getAttachment(slotIndex, name); - if (attachment) slot.setAttachment(attachment); - } - } - } -}; - -spine.Animation = function (name, timelines, duration) { - this.name = name; - this.timelines = timelines; - this.duration = duration; -}; -spine.Animation.prototype = { - apply: function (skeleton, lastTime, time, loop, events) { - if (loop && this.duration != 0) { - time %= this.duration; - lastTime %= this.duration; - } - var timelines = this.timelines; - for (var i = 0, n = timelines.length; i < n; i++) - timelines[i].apply(skeleton, lastTime, time, events, 1); - }, - mix: function (skeleton, lastTime, time, loop, events, alpha) { - if (loop && this.duration != 0) { - time %= this.duration; - lastTime %= this.duration; - } - var timelines = this.timelines; - for (var i = 0, n = timelines.length; i < n; i++) - timelines[i].apply(skeleton, lastTime, time, events, alpha); - } -}; -spine.Animation.binarySearch = function (values, target, step) { - var low = 0; - var high = Math.floor(values.length / step) - 2; - if (!high) return step; - var current = high >>> 1; - while (true) { - if (values[(current + 1) * step] <= target) - low = current + 1; - else - high = current; - if (low == high) return (low + 1) * step; - current = (low + high) >>> 1; - } -}; -spine.Animation.binarySearch1 = function (values, target) { - var low = 0; - var high = values.length - 2; - if (!high) return 1; - var current = high >>> 1; - while (true) { - if (values[current + 1] <= target) - low = current + 1; - else - high = current; - if (low == high) return low + 1; - current = (low + high) >>> 1; - } -}; -spine.Animation.linearSearch = function (values, target, step) { - for (var i = 0, last = values.length - step; i <= last; i += step) - if (values[i] > target) return i; - return -1; -}; - -spine.Curves = function (frameCount) { - this.curves = []; // type, x, y, ... - //this.curves.length = (frameCount - 1) * 19/*BEZIER_SIZE*/; -}; -spine.Curves.prototype = { - setLinear: function (frameIndex) { - this.curves[frameIndex * 19/*BEZIER_SIZE*/] = 0/*LINEAR*/; - }, - setStepped: function (frameIndex) { - this.curves[frameIndex * 19/*BEZIER_SIZE*/] = 1/*STEPPED*/; - }, - /** Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next. - * cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of - * the difference between the keyframe's values. */ - setCurve: function (frameIndex, cx1, cy1, cx2, cy2) { - var subdiv1 = 1 / 10/*BEZIER_SEGMENTS*/, subdiv2 = subdiv1 * subdiv1, subdiv3 = subdiv2 * subdiv1; - var pre1 = 3 * subdiv1, pre2 = 3 * subdiv2, pre4 = 6 * subdiv2, pre5 = 6 * subdiv3; - var tmp1x = -cx1 * 2 + cx2, tmp1y = -cy1 * 2 + cy2, tmp2x = (cx1 - cx2) * 3 + 1, tmp2y = (cy1 - cy2) * 3 + 1; - var dfx = cx1 * pre1 + tmp1x * pre2 + tmp2x * subdiv3, dfy = cy1 * pre1 + tmp1y * pre2 + tmp2y * subdiv3; - var ddfx = tmp1x * pre4 + tmp2x * pre5, ddfy = tmp1y * pre4 + tmp2y * pre5; - var dddfx = tmp2x * pre5, dddfy = tmp2y * pre5; - - var i = frameIndex * 19/*BEZIER_SIZE*/; - var curves = this.curves; - curves[i++] = 2/*BEZIER*/; - - var x = dfx, y = dfy; - for (var n = i + 19/*BEZIER_SIZE*/ - 1; i < n; i += 2) { - curves[i] = x; - curves[i + 1] = y; - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - x += dfx; - y += dfy; - } - }, - getCurvePercent: function (frameIndex, percent) { - percent = percent < 0 ? 0 : (percent > 1 ? 1 : percent); - var curves = this.curves; - var i = frameIndex * 19/*BEZIER_SIZE*/; - var type = curves[i]; - if (type === 0/*LINEAR*/) return percent; - if (type == 1/*STEPPED*/) return 0; - i++; - var x = 0; - for (var start = i, n = i + 19/*BEZIER_SIZE*/ - 1; i < n; i += 2) { - x = curves[i]; - if (x >= percent) { - var prevX, prevY; - if (i == start) { - prevX = 0; - prevY = 0; - } else { - prevX = curves[i - 2]; - prevY = curves[i - 1]; - } - return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX); - } - } - var y = curves[i - 1]; - return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1. - } -}; - -spine.RotateTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, angle, ... - this.frames.length = frameCount * 2; -}; -spine.RotateTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, angle) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = angle; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 2]) { // Time is after last frame. - var amount = bone.data.rotation + frames[frames.length - 1] - bone.rotation; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - bone.rotation += amount * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 2); - var prevFrameValue = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 2/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 2 - 1, percent); - - var amount = frames[frameIndex + 1/*FRAME_VALUE*/] - prevFrameValue; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - amount = bone.data.rotation + (prevFrameValue + amount * percent) - bone.rotation; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - bone.rotation += amount * alpha; - } -}; - -spine.TranslateTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, x, y, ... - this.frames.length = frameCount * 3; -}; -spine.TranslateTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, x, y) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = x; - this.frames[frameIndex + 2] = y; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - bone.x += (bone.data.x + frames[frames.length - 2] - bone.x) * alpha; - bone.y += (bone.data.y + frames[frames.length - 1] - bone.y) * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameX = frames[frameIndex - 2]; - var prevFrameY = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - bone.x += (bone.data.x + prevFrameX + (frames[frameIndex + 1/*FRAME_X*/] - prevFrameX) * percent - bone.x) * alpha; - bone.y += (bone.data.y + prevFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - prevFrameY) * percent - bone.y) * alpha; - } -}; - -spine.ScaleTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, x, y, ... - this.frames.length = frameCount * 3; -}; -spine.ScaleTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, x, y) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = x; - this.frames[frameIndex + 2] = y; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - bone.scaleX += (bone.data.scaleX * frames[frames.length - 2] - bone.scaleX) * alpha; - bone.scaleY += (bone.data.scaleY * frames[frames.length - 1] - bone.scaleY) * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameX = frames[frameIndex - 2]; - var prevFrameY = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - bone.scaleX += (bone.data.scaleX * (prevFrameX + (frames[frameIndex + 1/*FRAME_X*/] - prevFrameX) * percent) - bone.scaleX) * alpha; - bone.scaleY += (bone.data.scaleY * (prevFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - prevFrameY) * percent) - bone.scaleY) * alpha; - } -}; - -spine.ColorTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, r, g, b, a, ... - this.frames.length = frameCount * 5; -}; -spine.ColorTimeline.prototype = { - slotIndex: 0, - getFrameCount: function () { - return this.frames.length / 5; - }, - setFrame: function (frameIndex, time, r, g, b, a) { - frameIndex *= 5; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = r; - this.frames[frameIndex + 2] = g; - this.frames[frameIndex + 3] = b; - this.frames[frameIndex + 4] = a; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var r, g, b, a; - if (time >= frames[frames.length - 5]) { - // Time is after last frame. - var i = frames.length - 1; - r = frames[i - 3]; - g = frames[i - 2]; - b = frames[i - 1]; - a = frames[i]; - } else { - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 5); - var prevFrameR = frames[frameIndex - 4]; - var prevFrameG = frames[frameIndex - 3]; - var prevFrameB = frames[frameIndex - 2]; - var prevFrameA = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 5/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 5 - 1, percent); - - r = prevFrameR + (frames[frameIndex + 1/*FRAME_R*/] - prevFrameR) * percent; - g = prevFrameG + (frames[frameIndex + 2/*FRAME_G*/] - prevFrameG) * percent; - b = prevFrameB + (frames[frameIndex + 3/*FRAME_B*/] - prevFrameB) * percent; - a = prevFrameA + (frames[frameIndex + 4/*FRAME_A*/] - prevFrameA) * percent; - } - var slot = skeleton.slots[this.slotIndex]; - if (alpha < 1) { - slot.r += (r - slot.r) * alpha; - slot.g += (g - slot.g) * alpha; - slot.b += (b - slot.b) * alpha; - slot.a += (a - slot.a) * alpha; - } else { - slot.r = r; - slot.g = g; - slot.b = b; - slot.a = a; - } - } -}; - -spine.AttachmentTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, ... - this.frames.length = frameCount; - this.attachmentNames = []; - this.attachmentNames.length = frameCount; -}; -spine.AttachmentTimeline.prototype = { - slotIndex: 0, - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, attachmentName) { - this.frames[frameIndex] = time; - this.attachmentNames[frameIndex] = attachmentName; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - - var frameIndex = time >= frames[frames.length - 1] ? frames.length - 1 : spine.Animation.binarySearch1(frames, time) - 1; - if (frames[frameIndex] < lastTime) return; - - var attachmentName = this.attachmentNames[frameIndex]; - skeleton.slots[this.slotIndex].setAttachment( - !attachmentName ? null : skeleton.getAttachmentBySlotIndex(this.slotIndex, attachmentName)); - } -}; - -spine.EventTimeline = function (frameCount) { - this.frames = []; // time, ... - this.frames.length = frameCount; - this.events = []; - this.events.length = frameCount; -}; -spine.EventTimeline.prototype = { - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, event) { - this.frames[frameIndex] = time; - this.events[frameIndex] = event; - }, - /** Fires events for frames > lastTime and <= time. */ - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - if (!firedEvents) return; - - var frames = this.frames; - var frameCount = frames.length; - - if (lastTime > time) { // Fire events after last time for looped animations. - this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha); - lastTime = -1; - } else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame. - return; - if (time < frames[0]) return; // Time is before first frame. - - var frameIndex; - if (lastTime < frames[0]) - frameIndex = 0; - else { - frameIndex = spine.Animation.binarySearch1(frames, lastTime); - var frame = frames[frameIndex]; - while (frameIndex > 0) { // Fire multiple events with the same frame. - if (frames[frameIndex - 1] != frame) break; - frameIndex--; - } - } - var events = this.events; - for (; frameIndex < frameCount && time >= frames[frameIndex]; frameIndex++) - firedEvents.push(events[frameIndex]); - } -}; - -spine.DrawOrderTimeline = function (frameCount) { - this.frames = []; // time, ... - this.frames.length = frameCount; - this.drawOrders = []; - this.drawOrders.length = frameCount; -}; -spine.DrawOrderTimeline.prototype = { - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, drawOrder) { - this.frames[frameIndex] = time; - this.drawOrders[frameIndex] = drawOrder; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var frameIndex; - if (time >= frames[frames.length - 1]) // Time is after last frame. - frameIndex = frames.length - 1; - else - frameIndex = spine.Animation.binarySearch1(frames, time) - 1; - - var drawOrder = skeleton.drawOrder; - var slots = skeleton.slots; - var drawOrderToSetupIndex = this.drawOrders[frameIndex]; - if (!drawOrderToSetupIndex) { - for (var i = 0, n = slots.length; i < n; i++) - drawOrder[i] = slots[i]; - } else { - for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++) - drawOrder[i] = skeleton.slots[drawOrderToSetupIndex[i]]; - } - - } -}; - -spine.FfdTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; - this.frames.length = frameCount; - this.frameVertices = []; - this.frameVertices.length = frameCount; -}; -spine.FfdTimeline.prototype = { - slotIndex: 0, - attachment: 0, - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, vertices) { - this.frames[frameIndex] = time; - this.frameVertices[frameIndex] = vertices; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var slot = skeleton.slots[this.slotIndex]; - if (slot.attachment != this.attachment) return; - - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var frameVertices = this.frameVertices; - var vertexCount = frameVertices[0].length; - - var vertices = slot.attachmentVertices; - if (vertices.length != vertexCount) alpha = 1; - vertices.length = vertexCount; - - if (time >= frames[frames.length - 1]) { // Time is after last frame. - var lastVertices = frameVertices[frames.length - 1]; - if (alpha < 1) { - for (var i = 0; i < vertexCount; i++) - vertices[i] += (lastVertices[i] - vertices[i]) * alpha; - } else { - for (var i = 0; i < vertexCount; i++) - vertices[i] = lastVertices[i]; - } - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch1(frames, time); - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 1] - frameTime); - percent = this.curves.getCurvePercent(frameIndex - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent)); - - var prevVertices = frameVertices[frameIndex - 1]; - var nextVertices = frameVertices[frameIndex]; - - if (alpha < 1) { - for (var i = 0; i < vertexCount; i++) { - var prev = prevVertices[i]; - vertices[i] += (prev + (nextVertices[i] - prev) * percent - vertices[i]) * alpha; - } - } else { - for (var i = 0; i < vertexCount; i++) { - var prev = prevVertices[i]; - vertices[i] = prev + (nextVertices[i] - prev) * percent; - } - } - } -}; - -spine.IkConstraintTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, mix, bendDirection, ... - this.frames.length = frameCount * 3; -}; -spine.IkConstraintTimeline.prototype = { - ikConstraintIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, mix, bendDirection) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = mix; - this.frames[frameIndex + 2] = bendDirection; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var ikConstraint = skeleton.ikConstraints[this.ikConstraintIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - ikConstraint.mix += (frames[frames.length - 2] - ikConstraint.mix) * alpha; - ikConstraint.bendDirection = frames[frames.length - 1]; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameMix = frames[frameIndex + -2/*PREV_FRAME_MIX*/]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - var mix = prevFrameMix + (frames[frameIndex + 1/*FRAME_MIX*/] - prevFrameMix) * percent; - ikConstraint.mix += (mix - ikConstraint.mix) * alpha; - ikConstraint.bendDirection = frames[frameIndex + -1/*PREV_FRAME_BEND_DIRECTION*/]; - } -}; - -spine.FlipXTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, flip, ... - this.frames.length = frameCount * 2; -}; -spine.FlipXTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, flip) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = flip ? 1 : 0; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - var frameIndex = (time >= frames[frames.length - 2] ? frames.length : spine.Animation.binarySearch(frames, time, 2)) - 2; - if (frames[frameIndex] < lastTime) return; - skeleton.bones[boneIndex].flipX = frames[frameIndex + 1] != 0; - } -}; - -spine.FlipYTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, flip, ... - this.frames.length = frameCount * 2; -}; -spine.FlipYTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, flip) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = flip ? 1 : 0; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - var frameIndex = (time >= frames[frames.length - 2] ? frames.length : spine.Animation.binarySearch(frames, time, 2)) - 2; - if (frames[frameIndex] < lastTime) return; - skeleton.bones[boneIndex].flipY = frames[frameIndex + 1] != 0; - } -}; - -spine.SkeletonData = function () { - this.bones = []; - this.slots = []; - this.skins = []; - this.events = []; - this.animations = []; - this.ikConstraints = []; -}; -spine.SkeletonData.prototype = { - name: null, - defaultSkin: null, - width: 0, height: 0, - version: null, hash: null, - /** @return May be null. */ - findBone: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].name == boneName) return bones[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findBoneIndex: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].name == boneName) return i; - return -1; - }, - /** @return May be null. */ - findSlot: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - if (slots[i].name == slotName) return slot[i]; - } - return null; - }, - /** @return -1 if the bone was not found. */ - findSlotIndex: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].name == slotName) return i; - return -1; - }, - /** @return May be null. */ - findSkin: function (skinName) { - var skins = this.skins; - for (var i = 0, n = skins.length; i < n; i++) - if (skins[i].name == skinName) return skins[i]; - return null; - }, - /** @return May be null. */ - findEvent: function (eventName) { - var events = this.events; - for (var i = 0, n = events.length; i < n; i++) - if (events[i].name == eventName) return events[i]; - return null; - }, - /** @return May be null. */ - findAnimation: function (animationName) { - var animations = this.animations; - for (var i = 0, n = animations.length; i < n; i++) - if (animations[i].name == animationName) return animations[i]; - return null; - }, - /** @return May be null. */ - findIkConstraint: function (ikConstraintName) { - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) - if (ikConstraints[i].name == ikConstraintName) return ikConstraints[i]; - return null; - } -}; - -spine.Skeleton = function (skeletonData) { - this.data = skeletonData; - - this.bones = []; - for (var i = 0, n = skeletonData.bones.length; i < n; i++) { - var boneData = skeletonData.bones[i]; - var parent = !boneData.parent ? null : this.bones[skeletonData.bones.indexOf(boneData.parent)]; - this.bones.push(new spine.Bone(boneData, this, parent)); - } - - this.slots = []; - this.drawOrder = []; - for (var i = 0, n = skeletonData.slots.length; i < n; i++) { - var slotData = skeletonData.slots[i]; - var bone = this.bones[skeletonData.bones.indexOf(slotData.boneData)]; - var slot = new spine.Slot(slotData, bone); - this.slots.push(slot); - this.drawOrder.push(slot); - } - - this.ikConstraints = []; - for (var i = 0, n = skeletonData.ikConstraints.length; i < n; i++) - this.ikConstraints.push(new spine.IkConstraint(skeletonData.ikConstraints[i], this)); - - this.boneCache = []; - this.updateCache(); -}; -spine.Skeleton.prototype = { - x: 0, y: 0, - skin: null, - r: 1, g: 1, b: 1, a: 1, - time: 0, - flipX: false, flipY: false, - /** Caches information about bones and IK constraints. Must be called if bones or IK constraints are added or removed. */ - updateCache: function () { - var ikConstraints = this.ikConstraints; - var ikConstraintsCount = ikConstraints.length; - - var arrayCount = ikConstraintsCount + 1; - var boneCache = this.boneCache; - if (boneCache.length > arrayCount) boneCache.length = arrayCount; - for (var i = 0, n = boneCache.length; i < n; i++) - boneCache[i].length = 0; - while (boneCache.length < arrayCount) - boneCache[boneCache.length] = []; - - var nonIkBones = boneCache[0]; - var bones = this.bones; - - outer: - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - var current = bone; - do { - for (var ii = 0; ii < ikConstraintsCount; ii++) { - var ikConstraint = ikConstraints[ii]; - var parent = ikConstraint.bones[0]; - var child= ikConstraint.bones[ikConstraint.bones.length - 1]; - while (true) { - if (current == child) { - boneCache[ii].push(bone); - boneCache[ii + 1].push(bone); - continue outer; - } - if (child == parent) break; - child = child.parent; - } - } - current = current.parent; - } while (current); - nonIkBones[nonIkBones.length] = bone; - } - }, - /** Updates the world transform for each bone. */ - updateWorldTransform: function () { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - bone.rotationIK = bone.rotation; - } - var i = 0, last = this.boneCache.length - 1; - while (true) { - var cacheBones = this.boneCache[i]; - for (var ii = 0, nn = cacheBones.length; ii < nn; ii++) - cacheBones[ii].updateWorldTransform(); - if (i == last) break; - this.ikConstraints[i].apply(); - i++; - } - }, - /** Sets the bones and slots to their setup pose values. */ - setToSetupPose: function () { - this.setBonesToSetupPose(); - this.setSlotsToSetupPose(); - }, - setBonesToSetupPose: function () { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - bones[i].setToSetupPose(); - - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) { - var ikConstraint = ikConstraints[i]; - ikConstraint.bendDirection = ikConstraint.data.bendDirection; - ikConstraint.mix = ikConstraint.data.mix; - } - }, - setSlotsToSetupPose: function () { - var slots = this.slots; - var drawOrder = this.drawOrder; - for (var i = 0, n = slots.length; i < n; i++) { - drawOrder[i] = slots[i]; - slots[i].setToSetupPose(i); - } - }, - /** @return May return null. */ - getRootBone: function () { - return this.bones.length ? this.bones[0] : null; - }, - /** @return May be null. */ - findBone: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].data.name == boneName) return bones[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findBoneIndex: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].data.name == boneName) return i; - return -1; - }, - /** @return May be null. */ - findSlot: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].data.name == slotName) return slots[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findSlotIndex: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].data.name == slotName) return i; - return -1; - }, - setSkinByName: function (skinName) { - var skin = this.data.findSkin(skinName); - if (!skin) throw "Skin not found: " + skinName; - this.setSkin(skin); - }, - /** Sets the skin used to look up attachments before looking in the {@link SkeletonData#getDefaultSkin() default skin}. - * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was - * no old skin, each slot's setup mode attachment is attached from the new skin. - * @param newSkin May be null. */ - setSkin: function (newSkin) { - if (newSkin) { - if (this.skin) - newSkin._attachAll(this, this.skin); - else { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - var name = slot.data.attachmentName; - if (name) { - var attachment = newSkin.getAttachment(i, name); - if (attachment) slot.setAttachment(attachment); - } - } - } - } - this.skin = newSkin; - }, - /** @return May be null. */ - getAttachmentBySlotName: function (slotName, attachmentName) { - return this.getAttachmentBySlotIndex(this.data.findSlotIndex(slotName), attachmentName); - }, - /** @return May be null. */ - getAttachmentBySlotIndex: function (slotIndex, attachmentName) { - if (this.skin) { - var attachment = this.skin.getAttachment(slotIndex, attachmentName); - if (attachment) return attachment; - } - if (this.data.defaultSkin) return this.data.defaultSkin.getAttachment(slotIndex, attachmentName); - return null; - }, - /** @param attachmentName May be null. */ - setAttachment: function (slotName, attachmentName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - if (slot.data.name == slotName) { - var attachment = null; - if (attachmentName) { - attachment = this.getAttachmentBySlotIndex(i, attachmentName); - if (!attachment) throw "Attachment not found: " + attachmentName + ", for slot: " + slotName; - } - slot.setAttachment(attachment); - return; - } - } - throw "Slot not found: " + slotName; - }, - /** @return May be null. */ - findIkConstraint: function (ikConstraintName) { - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) - if (ikConstraints[i].data.name == ikConstraintName) return ikConstraints[i]; - return null; - }, - update: function (delta) { - this.time += delta; - } -}; - -spine.EventData = function (name) { - this.name = name; -}; -spine.EventData.prototype = { - intValue: 0, - floatValue: 0, - stringValue: null -}; - -spine.Event = function (data) { - this.data = data; -}; -spine.Event.prototype = { - intValue: 0, - floatValue: 0, - stringValue: null -}; - -spine.AttachmentType = { - region: 0, - boundingbox: 1, - mesh: 2, - skinnedmesh: 3 -}; - -spine.RegionAttachment = function (name) { - this.name = name; - this.offset = []; - this.offset.length = 8; - this.uvs = []; - this.uvs.length = 8; -}; -spine.RegionAttachment.prototype = { - type: spine.AttachmentType.region, - x: 0, y: 0, - rotation: 0, - scaleX: 1, scaleY: 1, - width: 0, height: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - setUVs: function (u, v, u2, v2, rotate) { - var uvs = this.uvs; - if (rotate) { - uvs[2/*X2*/] = u; - uvs[3/*Y2*/] = v2; - uvs[4/*X3*/] = u; - uvs[5/*Y3*/] = v; - uvs[6/*X4*/] = u2; - uvs[7/*Y4*/] = v; - uvs[0/*X1*/] = u2; - uvs[1/*Y1*/] = v2; - } else { - uvs[0/*X1*/] = u; - uvs[1/*Y1*/] = v2; - uvs[2/*X2*/] = u; - uvs[3/*Y2*/] = v; - uvs[4/*X3*/] = u2; - uvs[5/*Y3*/] = v; - uvs[6/*X4*/] = u2; - uvs[7/*Y4*/] = v2; - } - }, - updateOffset: function () { - var regionScaleX = this.width / this.regionOriginalWidth * this.scaleX; - var regionScaleY = this.height / this.regionOriginalHeight * this.scaleY; - var localX = -this.width / 2 * this.scaleX + this.regionOffsetX * regionScaleX; - var localY = -this.height / 2 * this.scaleY + this.regionOffsetY * regionScaleY; - var localX2 = localX + this.regionWidth * regionScaleX; - var localY2 = localY + this.regionHeight * regionScaleY; - var radians = this.rotation * spine.degRad; - var cos = Math.cos(radians); - var sin = Math.sin(radians); - var localXCos = localX * cos + this.x; - var localXSin = localX * sin; - var localYCos = localY * cos + this.y; - var localYSin = localY * sin; - var localX2Cos = localX2 * cos + this.x; - var localX2Sin = localX2 * sin; - var localY2Cos = localY2 * cos + this.y; - var localY2Sin = localY2 * sin; - var offset = this.offset; - offset[0/*X1*/] = localXCos - localYSin; - offset[1/*Y1*/] = localYCos + localXSin; - offset[2/*X2*/] = localXCos - localY2Sin; - offset[3/*Y2*/] = localY2Cos + localXSin; - offset[4/*X3*/] = localX2Cos - localY2Sin; - offset[5/*Y3*/] = localY2Cos + localX2Sin; - offset[6/*X4*/] = localX2Cos - localYSin; - offset[7/*Y4*/] = localYCos + localX2Sin; - }, - computeVertices: function (x, y, bone, vertices) { - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var offset = this.offset; - vertices[0/*X1*/] = offset[0/*X1*/] * m00 + offset[1/*Y1*/] * m01 + x; - vertices[1/*Y1*/] = offset[0/*X1*/] * m10 + offset[1/*Y1*/] * m11 + y; - vertices[2/*X2*/] = offset[2/*X2*/] * m00 + offset[3/*Y2*/] * m01 + x; - vertices[3/*Y2*/] = offset[2/*X2*/] * m10 + offset[3/*Y2*/] * m11 + y; - vertices[4/*X3*/] = offset[4/*X3*/] * m00 + offset[5/*X3*/] * m01 + x; - vertices[5/*X3*/] = offset[4/*X3*/] * m10 + offset[5/*X3*/] * m11 + y; - vertices[6/*X4*/] = offset[6/*X4*/] * m00 + offset[7/*Y4*/] * m01 + x; - vertices[7/*Y4*/] = offset[6/*X4*/] * m10 + offset[7/*Y4*/] * m11 + y; - } -}; - -spine.MeshAttachment = function (name) { - this.name = name; -}; -spine.MeshAttachment.prototype = { - type: spine.AttachmentType.mesh, - vertices: null, - uvs: null, - regionUVs: null, - triangles: null, - hullLength: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionU: 0, regionV: 0, regionU2: 0, regionV2: 0, regionRotate: false, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - edges: null, - width: 0, height: 0, - updateUVs: function () { - var width = this.regionU2 - this.regionU, height = this.regionV2 - this.regionV; - var n = this.regionUVs.length; - if (!this.uvs || this.uvs.length != n) { - this.uvs = new spine.Float32Array(n); - } - if (this.regionRotate) { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i + 1] * width; - this.uvs[i + 1] = this.regionV + height - this.regionUVs[i] * height; - } - } else { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i] * width; - this.uvs[i + 1] = this.regionV + this.regionUVs[i + 1] * height; - } - } - }, - computeWorldVertices: function (x, y, slot, worldVertices) { - var bone = slot.bone; - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var vertices = this.vertices; - var verticesCount = vertices.length; - if (slot.attachmentVertices.length == verticesCount) vertices = slot.attachmentVertices; - for (var i = 0; i < verticesCount; i += 2) { - var vx = vertices[i]; - var vy = vertices[i + 1]; - worldVertices[i] = vx * m00 + vy * m01 + x; - worldVertices[i + 1] = vx * m10 + vy * m11 + y; - } - } -}; - -spine.SkinnedMeshAttachment = function (name) { - this.name = name; -}; -spine.SkinnedMeshAttachment.prototype = { - type: spine.AttachmentType.skinnedmesh, - bones: null, - weights: null, - uvs: null, - regionUVs: null, - triangles: null, - hullLength: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionU: 0, regionV: 0, regionU2: 0, regionV2: 0, regionRotate: false, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - edges: null, - width: 0, height: 0, - updateUVs: function (u, v, u2, v2, rotate) { - var width = this.regionU2 - this.regionU, height = this.regionV2 - this.regionV; - var n = this.regionUVs.length; - if (!this.uvs || this.uvs.length != n) { - this.uvs = new spine.Float32Array(n); - } - if (this.regionRotate) { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i + 1] * width; - this.uvs[i + 1] = this.regionV + height - this.regionUVs[i] * height; - } - } else { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i] * width; - this.uvs[i + 1] = this.regionV + this.regionUVs[i + 1] * height; - } - } - }, - computeWorldVertices: function (x, y, slot, worldVertices) { - var skeletonBones = slot.bone.skeleton.bones; - var weights = this.weights; - var bones = this.bones; - - var w = 0, v = 0, b = 0, f = 0, n = bones.length, nn; - var wx, wy, bone, vx, vy, weight; - if (!slot.attachmentVertices.length) { - for (; v < n; w += 2) { - wx = 0; - wy = 0; - nn = bones[v++] + v; - for (; v < nn; v++, b += 3) { - bone = skeletonBones[bones[v]]; - vx = weights[b]; - vy = weights[b + 1]; - weight = weights[b + 2]; - wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight; - wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight; - } - worldVertices[w] = wx + x; - worldVertices[w + 1] = wy + y; - } - } else { - var ffd = slot.attachmentVertices; - for (; v < n; w += 2) { - wx = 0; - wy = 0; - nn = bones[v++] + v; - for (; v < nn; v++, b += 3, f += 2) { - bone = skeletonBones[bones[v]]; - vx = weights[b] + ffd[f]; - vy = weights[b + 1] + ffd[f + 1]; - weight = weights[b + 2]; - wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight; - wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight; - } - worldVertices[w] = wx + x; - worldVertices[w + 1] = wy + y; - } - } - } -}; - -spine.BoundingBoxAttachment = function (name) { - this.name = name; - this.vertices = []; -}; -spine.BoundingBoxAttachment.prototype = { - type: spine.AttachmentType.boundingbox, - computeWorldVertices: function (x, y, bone, worldVertices) { - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var vertices = this.vertices; - for (var i = 0, n = vertices.length; i < n; i += 2) { - var px = vertices[i]; - var py = vertices[i + 1]; - worldVertices[i] = px * m00 + py * m01 + x; - worldVertices[i + 1] = px * m10 + py * m11 + y; - } - } -}; - -spine.AnimationStateData = function (skeletonData) { - this.skeletonData = skeletonData; - this.animationToMixTime = {}; -}; -spine.AnimationStateData.prototype = { - defaultMix: 0, - setMixByName: function (fromName, toName, duration) { - var from = this.skeletonData.findAnimation(fromName); - if (!from) throw "Animation not found: " + fromName; - var to = this.skeletonData.findAnimation(toName); - if (!to) throw "Animation not found: " + toName; - this.setMix(from, to, duration); - }, - setMix: function (from, to, duration) { - this.animationToMixTime[from.name + ":" + to.name] = duration; - }, - getMix: function (from, to) { - var key = from.name + ":" + to.name; - return this.animationToMixTime.hasOwnProperty(key) ? this.animationToMixTime[key] : this.defaultMix; - } -}; - -spine.TrackEntry = function () {}; -spine.TrackEntry.prototype = { - next: null, previous: null, - animation: null, - loop: false, - delay: 0, time: 0, lastTime: -1, endTime: 0, - timeScale: 1, - mixTime: 0, mixDuration: 0, mix: 1, - onStart: null, onEnd: null, onComplete: null, onEvent: null -}; - -spine.AnimationState = function (stateData) { - this.data = stateData; - this.tracks = []; - this.events = []; -}; -spine.AnimationState.prototype = { - onStart: null, - onEnd: null, - onComplete: null, - onEvent: null, - timeScale: 1, - update: function (delta) { - delta *= this.timeScale; - for (var i = 0; i < this.tracks.length; i++) { - var current = this.tracks[i]; - if (!current) continue; - - current.time += delta * current.timeScale; - if (current.previous) { - var previousDelta = delta * current.previous.timeScale; - current.previous.time += previousDelta; - current.mixTime += previousDelta; - } - - var next = current.next; - if (next) { - next.time = current.lastTime - next.delay; - if (next.time >= 0) this.setCurrent(i, next); - } else { - // End non-looping animation when it reaches its end time and there is no next entry. - if (!current.loop && current.lastTime >= current.endTime) this.clearTrack(i); - } - } - }, - apply: function (skeleton) { - for (var i = 0; i < this.tracks.length; i++) { - var current = this.tracks[i]; - if (!current) continue; - - this.events.length = 0; - - var time = current.time; - var lastTime = current.lastTime; - var endTime = current.endTime; - var loop = current.loop; - if (!loop && time > endTime) time = endTime; - - var previous = current.previous; - if (!previous) { - if (current.mix == 1) - current.animation.apply(skeleton, current.lastTime, time, loop, this.events); - else - current.animation.mix(skeleton, current.lastTime, time, loop, this.events, current.mix); - } else { - var previousTime = previous.time; - if (!previous.loop && previousTime > previous.endTime) previousTime = previous.endTime; - previous.animation.apply(skeleton, previousTime, previousTime, previous.loop, null); - - var alpha = current.mixTime / current.mixDuration * current.mix; - if (alpha >= 1) { - alpha = 1; - current.previous = null; - } - current.animation.mix(skeleton, current.lastTime, time, loop, this.events, alpha); - } - - for (var ii = 0, nn = this.events.length; ii < nn; ii++) { - var event = this.events[ii]; - if (current.onEvent) current.onEvent(i, event); - if (this.onEvent) this.onEvent(i, event); - } - - // Check if completed the animation or a loop iteration. - if (loop ? (lastTime % endTime > time % endTime) : (lastTime < endTime && time >= endTime)) { - var count = Math.floor(time / endTime); - if (current.onComplete) current.onComplete(i, count); - if (this.onComplete) this.onComplete(i, count); - } - - current.lastTime = current.time; - } - }, - clearTracks: function () { - for (var i = 0, n = this.tracks.length; i < n; i++) - this.clearTrack(i); - this.tracks.length = 0; - }, - clearTrack: function (trackIndex) { - if (trackIndex >= this.tracks.length) return; - var current = this.tracks[trackIndex]; - if (!current) return; - - if (current.onEnd) current.onEnd(trackIndex); - if (this.onEnd) this.onEnd(trackIndex); - - this.tracks[trackIndex] = null; - }, - _expandToIndex: function (index) { - if (index < this.tracks.length) return this.tracks[index]; - while (index >= this.tracks.length) - this.tracks.push(null); - return null; - }, - setCurrent: function (index, entry) { - var current = this._expandToIndex(index); - if (current) { - var previous = current.previous; - current.previous = null; - - if (current.onEnd) current.onEnd(index); - if (this.onEnd) this.onEnd(index); - - entry.mixDuration = this.data.getMix(current.animation, entry.animation); - if (entry.mixDuration > 0) { - entry.mixTime = 0; - // If a mix is in progress, mix from the closest animation. - if (previous && current.mixTime / current.mixDuration < 0.5) - entry.previous = previous; - else - entry.previous = current; - } - } - - this.tracks[index] = entry; - - if (entry.onStart) entry.onStart(index); - if (this.onStart) this.onStart(index); - }, - setAnimationByName: function (trackIndex, animationName, loop) { - var animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) throw "Animation not found: " + animationName; - return this.setAnimation(trackIndex, animation, loop); - }, - /** Set the current animation. Any queued animations are cleared. */ - setAnimation: function (trackIndex, animation, loop) { - var entry = new spine.TrackEntry(); - entry.animation = animation; - entry.loop = loop; - entry.endTime = animation.duration; - this.setCurrent(trackIndex, entry); - return entry; - }, - addAnimationByName: function (trackIndex, animationName, loop, delay) { - var animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) throw "Animation not found: " + animationName; - return this.addAnimation(trackIndex, animation, loop, delay); - }, - /** Adds an animation to be played delay seconds after the current or last queued animation. - * @param delay May be <= 0 to use duration of previous animation minus any mix duration plus the negative delay. */ - addAnimation: function (trackIndex, animation, loop, delay) { - var entry = new spine.TrackEntry(); - entry.animation = animation; - entry.loop = loop; - entry.endTime = animation.duration; - - var last = this._expandToIndex(trackIndex); - if (last) { - while (last.next) - last = last.next; - last.next = entry; - } else - this.tracks[trackIndex] = entry; - - if (delay <= 0) { - if (last) - delay += last.endTime - this.data.getMix(last.animation, animation); - else - delay = 0; - } - entry.delay = delay; - - return entry; - }, - /** May be null. */ - getCurrent: function (trackIndex) { - if (trackIndex >= this.tracks.length) return null; - return this.tracks[trackIndex]; - } -}; - -spine.SkeletonJson = function (attachmentLoader) { - this.attachmentLoader = attachmentLoader; -}; -spine.SkeletonJson.prototype = { - scale: 1, - readSkeletonData: function (root, name) { - var skeletonData = new spine.SkeletonData(); - skeletonData.name = name; - - // Skeleton. - var skeletonMap = root["skeleton"]; - if (skeletonMap) { - skeletonData.hash = skeletonMap["hash"]; - skeletonData.version = skeletonMap["spine"]; - skeletonData.width = skeletonMap["width"] || 0; - skeletonData.height = skeletonMap["height"] || 0; - } - - // Bones. - var bones = root["bones"]; - for (var i = 0, n = bones.length; i < n; i++) { - var boneMap = bones[i]; - var parent = null; - if (boneMap["parent"]) { - parent = skeletonData.findBone(boneMap["parent"]); - if (!parent) throw "Parent bone not found: " + boneMap["parent"]; - } - var boneData = new spine.BoneData(boneMap["name"], parent); - boneData.length = (boneMap["length"] || 0) * this.scale; - boneData.x = (boneMap["x"] || 0) * this.scale; - boneData.y = (boneMap["y"] || 0) * this.scale; - boneData.rotation = (boneMap["rotation"] || 0); - boneData.scaleX = boneMap.hasOwnProperty("scaleX") ? boneMap["scaleX"] : 1; - boneData.scaleY = boneMap.hasOwnProperty("scaleY") ? boneMap["scaleY"] : 1; - boneData.inheritScale = boneMap.hasOwnProperty("inheritScale") ? boneMap["inheritScale"] : true; - boneData.inheritRotation = boneMap.hasOwnProperty("inheritRotation") ? boneMap["inheritRotation"] : true; - skeletonData.bones.push(boneData); - } - - // IK constraints. - var ik = root["ik"]; - if (ik) { - for (var i = 0, n = ik.length; i < n; i++) { - var ikMap = ik[i]; - var ikConstraintData = new spine.IkConstraintData(ikMap["name"]); - - var bones = ikMap["bones"]; - for (var ii = 0, nn = bones.length; ii < nn; ii++) { - var bone = skeletonData.findBone(bones[ii]); - if (!bone) throw "IK bone not found: " + bones[ii]; - ikConstraintData.bones.push(bone); - } - - ikConstraintData.target = skeletonData.findBone(ikMap["target"]); - if (!ikConstraintData.target) throw "Target bone not found: " + ikMap["target"]; - - ikConstraintData.bendDirection = (!ikMap.hasOwnProperty("bendPositive") || ikMap["bendPositive"]) ? 1 : -1; - ikConstraintData.mix = ikMap.hasOwnProperty("mix") ? ikMap["mix"] : 1; - - skeletonData.ikConstraints.push(ikConstraintData); - } - } - - // Slots. - var slots = root["slots"]; - for (var i = 0, n = slots.length; i < n; i++) { - var slotMap = slots[i]; - var boneData = skeletonData.findBone(slotMap["bone"]); - if (!boneData) throw "Slot bone not found: " + slotMap["bone"]; - var slotData = new spine.SlotData(slotMap["name"], boneData); - - var color = slotMap["color"]; - if (color) { - slotData.r = this.toColor(color, 0); - slotData.g = this.toColor(color, 1); - slotData.b = this.toColor(color, 2); - slotData.a = this.toColor(color, 3); - } - - slotData.attachmentName = slotMap["attachment"]; - slotData.additiveBlending = slotMap["additive"] && slotMap["additive"] == "true"; - - skeletonData.slots.push(slotData); - } - - // Skins. - var skins = root["skins"]; - for (var skinName in skins) { - if (!skins.hasOwnProperty(skinName)) continue; - var skinMap = skins[skinName]; - var skin = new spine.Skin(skinName); - for (var slotName in skinMap) { - if (!skinMap.hasOwnProperty(slotName)) continue; - var slotIndex = skeletonData.findSlotIndex(slotName); - var slotEntry = skinMap[slotName]; - for (var attachmentName in slotEntry) { - if (!slotEntry.hasOwnProperty(attachmentName)) continue; - var attachment = this.readAttachment(skin, attachmentName, slotEntry[attachmentName]); - if (attachment) skin.addAttachment(slotIndex, attachmentName, attachment); - } - } - skeletonData.skins.push(skin); - if (skin.name == "default") skeletonData.defaultSkin = skin; - } - - // Events. - var events = root["events"]; - for (var eventName in events) { - if (!events.hasOwnProperty(eventName)) continue; - var eventMap = events[eventName]; - var eventData = new spine.EventData(eventName); - eventData.intValue = eventMap["int"] || 0; - eventData.floatValue = eventMap["float"] || 0; - eventData.stringValue = eventMap["string"] || null; - skeletonData.events.push(eventData); - } - - // Animations. - var animations = root["animations"]; - for (var animationName in animations) { - if (!animations.hasOwnProperty(animationName)) continue; - this.readAnimation(animationName, animations[animationName], skeletonData); - } - - return skeletonData; - }, - readAttachment: function (skin, name, map) { - name = map["name"] || name; - - var type = spine.AttachmentType[map["type"] || "region"]; - var path = map["path"] || name; - - var scale = this.scale; - if (type == spine.AttachmentType.region) { - var region = this.attachmentLoader.newRegionAttachment(skin, name, path); - if (!region) return null; - region.path = path; - region.x = (map["x"] || 0) * scale; - region.y = (map["y"] || 0) * scale; - region.scaleX = map.hasOwnProperty("scaleX") ? map["scaleX"] : 1; - region.scaleY = map.hasOwnProperty("scaleY") ? map["scaleY"] : 1; - region.rotation = map["rotation"] || 0; - region.width = (map["width"] || 0) * scale; - region.height = (map["height"] || 0) * scale; - - var color = map["color"]; - if (color) { - region.r = this.toColor(color, 0); - region.g = this.toColor(color, 1); - region.b = this.toColor(color, 2); - region.a = this.toColor(color, 3); - } - - region.updateOffset(); - return region; - } else if (type == spine.AttachmentType.mesh) { - var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path); - if (!mesh) return null; - mesh.path = path; - mesh.vertices = this.getFloatArray(map, "vertices", scale); - mesh.triangles = this.getIntArray(map, "triangles"); - mesh.regionUVs = this.getFloatArray(map, "uvs", 1); - mesh.updateUVs(); - - color = map["color"]; - if (color) { - mesh.r = this.toColor(color, 0); - mesh.g = this.toColor(color, 1); - mesh.b = this.toColor(color, 2); - mesh.a = this.toColor(color, 3); - } - - mesh.hullLength = (map["hull"] || 0) * 2; - if (map["edges"]) mesh.edges = this.getIntArray(map, "edges"); - mesh.width = (map["width"] || 0) * scale; - mesh.height = (map["height"] || 0) * scale; - return mesh; - } else if (type == spine.AttachmentType.skinnedmesh) { - var mesh = this.attachmentLoader.newSkinnedMeshAttachment(skin, name, path); - if (!mesh) return null; - mesh.path = path; - - var uvs = this.getFloatArray(map, "uvs", 1); - var vertices = this.getFloatArray(map, "vertices", 1); - var weights = []; - var bones = []; - for (var i = 0, n = vertices.length; i < n; ) { - var boneCount = vertices[i++] | 0; - bones[bones.length] = boneCount; - for (var nn = i + boneCount * 4; i < nn; ) { - bones[bones.length] = vertices[i]; - weights[weights.length] = vertices[i + 1] * scale; - weights[weights.length] = vertices[i + 2] * scale; - weights[weights.length] = vertices[i + 3]; - i += 4; - } - } - mesh.bones = bones; - mesh.weights = weights; - mesh.triangles = this.getIntArray(map, "triangles"); - mesh.regionUVs = uvs; - mesh.updateUVs(); - - color = map["color"]; - if (color) { - mesh.r = this.toColor(color, 0); - mesh.g = this.toColor(color, 1); - mesh.b = this.toColor(color, 2); - mesh.a = this.toColor(color, 3); - } - - mesh.hullLength = (map["hull"] || 0) * 2; - if (map["edges"]) mesh.edges = this.getIntArray(map, "edges"); - mesh.width = (map["width"] || 0) * scale; - mesh.height = (map["height"] || 0) * scale; - return mesh; - } else if (type == spine.AttachmentType.boundingbox) { - var attachment = this.attachmentLoader.newBoundingBoxAttachment(skin, name); - var vertices = map["vertices"]; - for (var i = 0, n = vertices.length; i < n; i++) - attachment.vertices.push(vertices[i] * scale); - return attachment; - } - throw "Unknown attachment type: " + type; - }, - readAnimation: function (name, map, skeletonData) { - var timelines = []; - var duration = 0; - - var slots = map["slots"]; - for (var slotName in slots) { - if (!slots.hasOwnProperty(slotName)) continue; - var slotMap = slots[slotName]; - var slotIndex = skeletonData.findSlotIndex(slotName); - - for (var timelineName in slotMap) { - if (!slotMap.hasOwnProperty(timelineName)) continue; - var values = slotMap[timelineName]; - if (timelineName == "color") { - var timeline = new spine.ColorTimeline(values.length); - timeline.slotIndex = slotIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var color = valueMap["color"]; - var r = this.toColor(color, 0); - var g = this.toColor(color, 1); - var b = this.toColor(color, 2); - var a = this.toColor(color, 3); - timeline.setFrame(frameIndex, valueMap["time"], r, g, b, a); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 5 - 5]); - - } else if (timelineName == "attachment") { - var timeline = new spine.AttachmentTimeline(values.length); - timeline.slotIndex = slotIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex++, valueMap["time"], valueMap["name"]); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - - } else - throw "Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")"; - } - } - - var bones = map["bones"]; - for (var boneName in bones) { - if (!bones.hasOwnProperty(boneName)) continue; - var boneIndex = skeletonData.findBoneIndex(boneName); - if (boneIndex == -1) throw "Bone not found: " + boneName; - var boneMap = bones[boneName]; - - for (var timelineName in boneMap) { - if (!boneMap.hasOwnProperty(timelineName)) continue; - var values = boneMap[timelineName]; - if (timelineName == "rotate") { - var timeline = new spine.RotateTimeline(values.length); - timeline.boneIndex = boneIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex, valueMap["time"], valueMap["angle"]); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 2 - 2]); - - } else if (timelineName == "translate" || timelineName == "scale") { - var timeline; - var timelineScale = 1; - if (timelineName == "scale") - timeline = new spine.ScaleTimeline(values.length); - else { - timeline = new spine.TranslateTimeline(values.length); - timelineScale = this.scale; - } - timeline.boneIndex = boneIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var x = (valueMap["x"] || 0) * timelineScale; - var y = (valueMap["y"] || 0) * timelineScale; - timeline.setFrame(frameIndex, valueMap["time"], x, y); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 3 - 3]); - - } else if (timelineName == "flipX" || timelineName == "flipY") { - var x = timelineName == "flipX"; - var timeline = x ? new spine.FlipXTimeline(values.length) : new spine.FlipYTimeline(values.length); - timeline.boneIndex = boneIndex; - - var field = x ? "x" : "y"; - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex, valueMap["time"], valueMap[field] || false); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 2 - 2]); - } else - throw "Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")"; - } - } - - var ikMap = map["ik"]; - for (var ikConstraintName in ikMap) { - if (!ikMap.hasOwnProperty(ikConstraintName)) continue; - var ikConstraint = skeletonData.findIkConstraint(ikConstraintName); - var values = ikMap[ikConstraintName]; - var timeline = new spine.IkConstraintTimeline(values.length); - timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(ikConstraint); - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var mix = valueMap.hasOwnProperty("mix") ? valueMap["mix"] : 1; - var bendDirection = (!valueMap.hasOwnProperty("bendPositive") || valueMap["bendPositive"]) ? 1 : -1; - timeline.setFrame(frameIndex, valueMap["time"], mix, bendDirection); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.frameCount * 3 - 3]); - } - - var ffd = map["ffd"]; - for (var skinName in ffd) { - var skin = skeletonData.findSkin(skinName); - var slotMap = ffd[skinName]; - for (slotName in slotMap) { - var slotIndex = skeletonData.findSlotIndex(slotName); - var meshMap = slotMap[slotName]; - for (var meshName in meshMap) { - var values = meshMap[meshName]; - var timeline = new spine.FfdTimeline(values.length); - var attachment = skin.getAttachment(slotIndex, meshName); - if (!attachment) throw "FFD attachment not found: " + meshName; - timeline.slotIndex = slotIndex; - timeline.attachment = attachment; - - var isMesh = attachment.type == spine.AttachmentType.mesh; - var vertexCount; - if (isMesh) - vertexCount = attachment.vertices.length; - else - vertexCount = attachment.weights.length / 3 * 2; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var vertices; - if (!valueMap["vertices"]) { - if (isMesh) - vertices = attachment.vertices; - else { - vertices = []; - vertices.length = vertexCount; - } - } else { - var verticesValue = valueMap["vertices"]; - var vertices = []; - vertices.length = vertexCount; - var start = valueMap["offset"] || 0; - var nn = verticesValue.length; - if (this.scale == 1) { - for (var ii = 0; ii < nn; ii++) - vertices[ii + start] = verticesValue[ii]; - } else { - for (var ii = 0; ii < nn; ii++) - vertices[ii + start] = verticesValue[ii] * this.scale; - } - if (isMesh) { - var meshVertices = attachment.vertices; - for (var ii = 0, nn = vertices.length; ii < nn; ii++) - vertices[ii] += meshVertices[ii]; - } - } - - timeline.setFrame(frameIndex, valueMap["time"], vertices); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines[timelines.length] = timeline; - duration = Math.max(duration, timeline.frames[timeline.frameCount - 1]); - } - } - } - - var drawOrderValues = map["drawOrder"]; - if (!drawOrderValues) drawOrderValues = map["draworder"]; - if (drawOrderValues) { - var timeline = new spine.DrawOrderTimeline(drawOrderValues.length); - var slotCount = skeletonData.slots.length; - var frameIndex = 0; - for (var i = 0, n = drawOrderValues.length; i < n; i++) { - var drawOrderMap = drawOrderValues[i]; - var drawOrder = null; - if (drawOrderMap["offsets"]) { - drawOrder = []; - drawOrder.length = slotCount; - for (var ii = slotCount - 1; ii >= 0; ii--) - drawOrder[ii] = -1; - var offsets = drawOrderMap["offsets"]; - var unchanged = []; - unchanged.length = slotCount - offsets.length; - var originalIndex = 0, unchangedIndex = 0; - for (var ii = 0, nn = offsets.length; ii < nn; ii++) { - var offsetMap = offsets[ii]; - var slotIndex = skeletonData.findSlotIndex(offsetMap["slot"]); - if (slotIndex == -1) throw "Slot not found: " + offsetMap["slot"]; - // Collect unchanged items. - while (originalIndex != slotIndex) - unchanged[unchangedIndex++] = originalIndex++; - // Set changed items. - drawOrder[originalIndex + offsetMap["offset"]] = originalIndex++; - } - // Collect remaining unchanged items. - while (originalIndex < slotCount) - unchanged[unchangedIndex++] = originalIndex++; - // Fill in unchanged items. - for (var ii = slotCount - 1; ii >= 0; ii--) - if (drawOrder[ii] == -1) drawOrder[ii] = unchanged[--unchangedIndex]; - } - timeline.setFrame(frameIndex++, drawOrderMap["time"], drawOrder); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - - var events = map["events"]; - if (events) { - var timeline = new spine.EventTimeline(events.length); - var frameIndex = 0; - for (var i = 0, n = events.length; i < n; i++) { - var eventMap = events[i]; - var eventData = skeletonData.findEvent(eventMap["name"]); - if (!eventData) throw "Event not found: " + eventMap["name"]; - var event = new spine.Event(eventData); - event.intValue = eventMap.hasOwnProperty("int") ? eventMap["int"] : eventData.intValue; - event.floatValue = eventMap.hasOwnProperty("float") ? eventMap["float"] : eventData.floatValue; - event.stringValue = eventMap.hasOwnProperty("string") ? eventMap["string"] : eventData.stringValue; - timeline.setFrame(frameIndex++, eventMap["time"], event); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - - skeletonData.animations.push(new spine.Animation(name, timelines, duration)); - }, - readCurve: function (timeline, frameIndex, valueMap) { - var curve = valueMap["curve"]; - if (!curve) - timeline.curves.setLinear(frameIndex); - else if (curve == "stepped") - timeline.curves.setStepped(frameIndex); - else if (curve instanceof Array) - timeline.curves.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]); - }, - toColor: function (hexString, colorIndex) { - if (hexString.length != 8) throw "Color hexidecimal length must be 8, recieved: " + hexString; - return parseInt(hexString.substring(colorIndex * 2, (colorIndex * 2) + 2), 16) / 255; - }, - getFloatArray: function (map, name, scale) { - var list = map[name]; - var values = new spine.Float32Array(list.length); - var i = 0, n = list.length; - if (scale == 1) { - for (; i < n; i++) - values[i] = list[i]; - } else { - for (; i < n; i++) - values[i] = list[i] * scale; - } - return values; - }, - getIntArray: function (map, name) { - var list = map[name]; - var values = new spine.Uint16Array(list.length); - for (var i = 0, n = list.length; i < n; i++) - values[i] = list[i] | 0; - return values; - } -}; - -spine.Atlas = function (atlasText, textureLoader) { - this.textureLoader = textureLoader; - this.pages = []; - this.regions = []; - - var reader = new spine.AtlasReader(atlasText); - var tuple = []; - tuple.length = 4; - var page = null; - while (true) { - var line = reader.readLine(); - if (line === null) break; - line = reader.trim(line); - if (!line.length) - page = null; - else if (!page) { - page = new spine.AtlasPage(); - page.name = line; - - if (reader.readTuple(tuple) == 2) { // size is only optional for an atlas packed with an old TexturePacker. - page.width = parseInt(tuple[0]); - page.height = parseInt(tuple[1]); - reader.readTuple(tuple); - } - page.format = spine.Atlas.Format[tuple[0]]; - - reader.readTuple(tuple); - page.minFilter = spine.Atlas.TextureFilter[tuple[0]]; - page.magFilter = spine.Atlas.TextureFilter[tuple[1]]; - - var direction = reader.readValue(); - page.uWrap = spine.Atlas.TextureWrap.clampToEdge; - page.vWrap = spine.Atlas.TextureWrap.clampToEdge; - if (direction == "x") - page.uWrap = spine.Atlas.TextureWrap.repeat; - else if (direction == "y") - page.vWrap = spine.Atlas.TextureWrap.repeat; - else if (direction == "xy") - page.uWrap = page.vWrap = spine.Atlas.TextureWrap.repeat; - - textureLoader.load(page, line, this); - - this.pages.push(page); - - } else { - var region = new spine.AtlasRegion(); - region.name = line; - region.page = page; - - region.rotate = reader.readValue() == "true"; - - reader.readTuple(tuple); - var x = parseInt(tuple[0]); - var y = parseInt(tuple[1]); - - reader.readTuple(tuple); - var width = parseInt(tuple[0]); - var height = parseInt(tuple[1]); - - region.u = x / page.width; - region.v = y / page.height; - if (region.rotate) { - region.u2 = (x + height) / page.width; - region.v2 = (y + width) / page.height; - } else { - region.u2 = (x + width) / page.width; - region.v2 = (y + height) / page.height; - } - region.x = x; - region.y = y; - region.width = Math.abs(width); - region.height = Math.abs(height); - - if (reader.readTuple(tuple) == 4) { // split is optional - region.splits = [parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3])]; - - if (reader.readTuple(tuple) == 4) { // pad is optional, but only present with splits - region.pads = [parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3])]; - - reader.readTuple(tuple); - } - } - - region.originalWidth = parseInt(tuple[0]); - region.originalHeight = parseInt(tuple[1]); - - reader.readTuple(tuple); - region.offsetX = parseInt(tuple[0]); - region.offsetY = parseInt(tuple[1]); - - region.index = parseInt(reader.readValue()); - - this.regions.push(region); - } - } -}; -spine.Atlas.prototype = { - findRegion: function (name) { - var regions = this.regions; - for (var i = 0, n = regions.length; i < n; i++) - if (regions[i].name == name) return regions[i]; - return null; - }, - dispose: function () { - var pages = this.pages; - for (var i = 0, n = pages.length; i < n; i++) - this.textureLoader.unload(pages[i].rendererObject); - }, - updateUVs: function (page) { - var regions = this.regions; - for (var i = 0, n = regions.length; i < n; i++) { - var region = regions[i]; - if (region.page != page) continue; - region.u = region.x / page.width; - region.v = region.y / page.height; - if (region.rotate) { - region.u2 = (region.x + region.height) / page.width; - region.v2 = (region.y + region.width) / page.height; - } else { - region.u2 = (region.x + region.width) / page.width; - region.v2 = (region.y + region.height) / page.height; - } - } - } -}; - -spine.Atlas.Format = { - alpha: 0, - intensity: 1, - luminanceAlpha: 2, - rgb565: 3, - rgba4444: 4, - rgb888: 5, - rgba8888: 6 -}; - -spine.Atlas.TextureFilter = { - nearest: 0, - linear: 1, - mipMap: 2, - mipMapNearestNearest: 3, - mipMapLinearNearest: 4, - mipMapNearestLinear: 5, - mipMapLinearLinear: 6 -}; - -spine.Atlas.TextureWrap = { - mirroredRepeat: 0, - clampToEdge: 1, - repeat: 2 -}; - -spine.AtlasPage = function () {}; -spine.AtlasPage.prototype = { - name: null, - format: null, - minFilter: null, - magFilter: null, - uWrap: null, - vWrap: null, - rendererObject: null, - width: 0, - height: 0 -}; - -spine.AtlasRegion = function () {}; -spine.AtlasRegion.prototype = { - page: null, - name: null, - x: 0, y: 0, - width: 0, height: 0, - u: 0, v: 0, u2: 0, v2: 0, - offsetX: 0, offsetY: 0, - originalWidth: 0, originalHeight: 0, - index: 0, - rotate: false, - splits: null, - pads: null -}; - -spine.AtlasReader = function (text) { - this.lines = text.split(/\r\n|\r|\n/); -}; -spine.AtlasReader.prototype = { - index: 0, - trim: function (value) { - return value.replace(/^\s+|\s+$/g, ""); - }, - readLine: function () { - if (this.index >= this.lines.length) return null; - return this.lines[this.index++]; - }, - readValue: function () { - var line = this.readLine(); - var colon = line.indexOf(":"); - if (colon == -1) throw "Invalid line: " + line; - return this.trim(line.substring(colon + 1)); - }, - /** Returns the number of tuple values read (1, 2 or 4). */ - readTuple: function (tuple) { - var line = this.readLine(); - var colon = line.indexOf(":"); - if (colon == -1) throw "Invalid line: " + line; - var i = 0, lastMatch = colon + 1; - for (; i < 3; i++) { - var comma = line.indexOf(",", lastMatch); - if (comma == -1) break; - tuple[i] = this.trim(line.substr(lastMatch, comma - lastMatch)); - lastMatch = comma + 1; - } - tuple[i] = this.trim(line.substring(lastMatch)); - return i + 1; - } -}; - -spine.AtlasAttachmentLoader = function (atlas) { - this.atlas = atlas; -}; -spine.AtlasAttachmentLoader.prototype = { - newRegionAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (region attachment: " + name + ")"; - var attachment = new spine.RegionAttachment(name); - attachment.rendererObject = region; - attachment.setUVs(region.u, region.v, region.u2, region.v2, region.rotate); - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newMeshAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (mesh attachment: " + name + ")"; - var attachment = new spine.MeshAttachment(name); - attachment.rendererObject = region; - attachment.regionU = region.u; - attachment.regionV = region.v; - attachment.regionU2 = region.u2; - attachment.regionV2 = region.v2; - attachment.regionRotate = region.rotate; - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newSkinnedMeshAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (skinned mesh attachment: " + name + ")"; - var attachment = new spine.SkinnedMeshAttachment(name); - attachment.rendererObject = region; - attachment.regionU = region.u; - attachment.regionV = region.v; - attachment.regionU2 = region.u2; - attachment.regionV2 = region.v2; - attachment.regionRotate = region.rotate; - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newBoundingBoxAttachment: function (skin, name) { - return new spine.BoundingBoxAttachment(name); - } -}; - -spine.SkeletonBounds = function () { - this.polygonPool = []; - this.polygons = []; - this.boundingBoxes = []; -}; -spine.SkeletonBounds.prototype = { - minX: 0, minY: 0, maxX: 0, maxY: 0, - update: function (skeleton, updateAabb) { - var slots = skeleton.slots; - var slotCount = slots.length; - var x = skeleton.x, y = skeleton.y; - var boundingBoxes = this.boundingBoxes; - var polygonPool = this.polygonPool; - var polygons = this.polygons; - - boundingBoxes.length = 0; - for (var i = 0, n = polygons.length; i < n; i++) - polygonPool.push(polygons[i]); - polygons.length = 0; - - for (var i = 0; i < slotCount; i++) { - var slot = slots[i]; - var boundingBox = slot.attachment; - if (boundingBox.type != spine.AttachmentType.boundingbox) continue; - boundingBoxes.push(boundingBox); - - var poolCount = polygonPool.length, polygon; - if (poolCount > 0) { - polygon = polygonPool[poolCount - 1]; - polygonPool.splice(poolCount - 1, 1); - } else - polygon = []; - polygons.push(polygon); - - polygon.length = boundingBox.vertices.length; - boundingBox.computeWorldVertices(x, y, slot.bone, polygon); - } - - if (updateAabb) this.aabbCompute(); - }, - aabbCompute: function () { - var polygons = this.polygons; - var minX = Number.MAX_VALUE, minY = Number.MAX_VALUE, maxX = Number.MIN_VALUE, maxY = Number.MIN_VALUE; - for (var i = 0, n = polygons.length; i < n; i++) { - var vertices = polygons[i]; - for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) { - var x = vertices[ii]; - var y = vertices[ii + 1]; - minX = Math.min(minX, x); - minY = Math.min(minY, y); - maxX = Math.max(maxX, x); - maxY = Math.max(maxY, y); - } - } - this.minX = minX; - this.minY = minY; - this.maxX = maxX; - this.maxY = maxY; - }, - /** Returns true if the axis aligned bounding box contains the point. */ - aabbContainsPoint: function (x, y) { - return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY; - }, - /** Returns true if the axis aligned bounding box intersects the line segment. */ - aabbIntersectsSegment: function (x1, y1, x2, y2) { - var minX = this.minX, minY = this.minY, maxX = this.maxX, maxY = this.maxY; - if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY)) - return false; - var m = (y2 - y1) / (x2 - x1); - var y = m * (minX - x1) + y1; - if (y > minY && y < maxY) return true; - y = m * (maxX - x1) + y1; - if (y > minY && y < maxY) return true; - var x = (minY - y1) / m + x1; - if (x > minX && x < maxX) return true; - x = (maxY - y1) / m + x1; - if (x > minX && x < maxX) return true; - return false; - }, - /** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */ - aabbIntersectsSkeleton: function (bounds) { - return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY; - }, - /** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more - * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */ - containsPoint: function (x, y) { - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) - if (this.polygonContainsPoint(polygons[i], x, y)) return this.boundingBoxes[i]; - return null; - }, - /** Returns the first bounding box attachment that contains the line segment, or null. When doing many checks, it is usually - * more efficient to only call this method if {@link #aabbIntersectsSegment(float, float, float, float)} returns true. */ - intersectsSegment: function (x1, y1, x2, y2) { - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) - if (polygons[i].intersectsSegment(x1, y1, x2, y2)) return this.boundingBoxes[i]; - return null; - }, - /** Returns true if the polygon contains the point. */ - polygonContainsPoint: function (polygon, x, y) { - var nn = polygon.length; - var prevIndex = nn - 2; - var inside = false; - for (var ii = 0; ii < nn; ii += 2) { - var vertexY = polygon[ii + 1]; - var prevY = polygon[prevIndex + 1]; - if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) { - var vertexX = polygon[ii]; - if (vertexX + (y - vertexY) / (prevY - vertexY) * (polygon[prevIndex] - vertexX) < x) inside = !inside; - } - prevIndex = ii; - } - return inside; - }, - /** Returns true if the polygon contains the line segment. */ - polygonIntersectsSegment: function (polygon, x1, y1, x2, y2) { - var nn = polygon.length; - var width12 = x1 - x2, height12 = y1 - y2; - var det1 = x1 * y2 - y1 * x2; - var x3 = polygon[nn - 2], y3 = polygon[nn - 1]; - for (var ii = 0; ii < nn; ii += 2) { - var x4 = polygon[ii], y4 = polygon[ii + 1]; - var det2 = x3 * y4 - y3 * x4; - var width34 = x3 - x4, height34 = y3 - y4; - var det3 = width12 * height34 - height12 * width34; - var x = (det1 * width34 - width12 * det2) / det3; - if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) { - var y = (det1 * height34 - height12 * det2) / det3; - if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) return true; - } - x3 = x4; - y3 = y4; - } - return false; - }, - getPolygon: function (attachment) { - var index = this.boundingBoxes.indexOf(attachment); - return index == -1 ? null : this.polygons[index]; - }, - getWidth: function () { - return this.maxX - this.minX; - }, - getHeight: function () { - return this.maxY - this.minY; - } -}; - -/* Esoteric Software SPINE wrapper for pixi.js */ - -spine.Bone.yDown = true; -PIXI.AnimCache = {}; - -/** - * Supporting class to load images from spine atlases as per spine spec. - * - * @class SpineTextureLoader - * @uses EventTarget - * @constructor - * @param basePath {String} Tha base path where to look for the images to be loaded - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.SpineTextureLoader = function(basePath, crossorigin) -{ - PIXI.EventTarget.call(this); - - this.basePath = basePath; - this.crossorigin = crossorigin; - this.loadingCount = 0; -}; - -/* constructor */ -PIXI.SpineTextureLoader.prototype = PIXI.SpineTextureLoader; - -/** - * Starts loading a base texture as per spine specification - * - * @method load - * @param page {spine.AtlasPage} Atlas page to which texture belongs - * @param file {String} The file to load, this is just the file path relative to the base path configured in the constructor - */ -PIXI.SpineTextureLoader.prototype.load = function(page, file) -{ - page.rendererObject = PIXI.BaseTexture.fromImage(this.basePath + '/' + file, this.crossorigin); - if (!page.rendererObject.hasLoaded) - { - var scope = this; - ++scope.loadingCount; - page.rendererObject.addEventListener('loaded', function(){ - --scope.loadingCount; - scope.dispatchEvent({ - type: 'loadedBaseTexture', - content: scope - }); - }); - } -}; - -/** - * Unloads a previously loaded texture as per spine specification - * - * @method unload - * @param texture {BaseTexture} Texture object to destroy - */ -PIXI.SpineTextureLoader.prototype.unload = function(texture) -{ - texture.destroy(true); -}; - -/** - * A class that enables the you to import and run your spine animations in pixi. - * Spine animation data needs to be loaded using the PIXI.AssetLoader or PIXI.SpineLoader before it can be used by this class - * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source - * - * @class Spine - * @extends DisplayObjectContainer - * @constructor - * @param url {String} The url of the spine anim file to be used - */ -PIXI.Spine = function (url) { - PIXI.DisplayObjectContainer.call(this); - - this.spineData = PIXI.AnimCache[url]; - - if (!this.spineData) { - throw new Error('Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: ' + url); - } - - this.skeleton = new spine.Skeleton(this.spineData); - this.skeleton.updateWorldTransform(); - - this.stateData = new spine.AnimationStateData(this.spineData); - this.state = new spine.AnimationState(this.stateData); - - this.slotContainers = []; - - for (var i = 0, n = this.skeleton.drawOrder.length; i < n; i++) { - var slot = this.skeleton.drawOrder[i]; - var attachment = slot.attachment; - var slotContainer = new PIXI.DisplayObjectContainer(); - this.slotContainers.push(slotContainer); - this.addChild(slotContainer); - - if (attachment instanceof spine.RegionAttachment) - { - var spriteName = attachment.rendererObject.name; - var sprite = this.createSprite(slot, attachment); - slot.currentSprite = sprite; - slot.currentSpriteName = spriteName; - slotContainer.addChild(sprite); - } - else if (attachment instanceof spine.MeshAttachment) - { - var mesh = this.createMesh(slot, attachment); - slot.currentMesh = mesh; - slot.currentMeshName = attachment.name; - slotContainer.addChild(mesh); - } - else - { - continue; - } - - } - - this.autoUpdate = true; -}; - -PIXI.Spine.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); -PIXI.Spine.prototype.constructor = PIXI.Spine; - -/** - * If this flag is set to true, the spine animation will be autoupdated every time - * the object id drawn. The down side of this approach is that the delta time is - * automatically calculated and you could miss out on cool effects like slow motion, - * pause, skip ahead and the sorts. Most of these effects can be achieved even with - * autoupdate enabled but are harder to achieve. - * - * @property autoUpdate - * @type { Boolean } - * @default true - */ -Object.defineProperty(PIXI.Spine.prototype, 'autoUpdate', { - get: function() - { - return (this.updateTransform === PIXI.Spine.prototype.autoUpdateTransform); - }, - - set: function(value) - { - this.updateTransform = value ? PIXI.Spine.prototype.autoUpdateTransform : PIXI.DisplayObjectContainer.prototype.updateTransform; - } -}); - -/** - * Update the spine skeleton and its animations by delta time (dt) - * - * @method update - * @param dt {Number} Delta time. Time by which the animation should be updated - */ -PIXI.Spine.prototype.update = function(dt) -{ - this.state.update(dt); - this.state.apply(this.skeleton); - this.skeleton.updateWorldTransform(); - - var drawOrder = this.skeleton.drawOrder; - for (var i = 0, n = drawOrder.length; i < n; i++) { - var slot = drawOrder[i]; - var attachment = slot.attachment; - var slotContainer = this.slotContainers[i]; - - if (!attachment) - { - slotContainer.visible = false; - continue; - } - - var type = attachment.type; - if (type === spine.AttachmentType.region) - { - if (attachment.rendererObject) - { - if (!slot.currentSpriteName || slot.currentSpriteName !== attachment.name) - { - var spriteName = attachment.rendererObject.name; - if (slot.currentSprite !== undefined) - { - slot.currentSprite.visible = false; - } - slot.sprites = slot.sprites || {}; - if (slot.sprites[spriteName] !== undefined) - { - slot.sprites[spriteName].visible = true; - } - else - { - var sprite = this.createSprite(slot, attachment); - slotContainer.addChild(sprite); - } - slot.currentSprite = slot.sprites[spriteName]; - slot.currentSpriteName = spriteName; - } - } - - var bone = slot.bone; - - slotContainer.position.x = bone.worldX + attachment.x * bone.m00 + attachment.y * bone.m01; - slotContainer.position.y = bone.worldY + attachment.x * bone.m10 + attachment.y * bone.m11; - slotContainer.scale.x = bone.worldScaleX; - slotContainer.scale.y = bone.worldScaleY; - - slotContainer.rotation = -(slot.bone.worldRotation * spine.degRad); - - slot.currentSprite.tint = PIXI.rgb2hex([slot.r,slot.g,slot.b]); - } - else if (type === spine.AttachmentType.skinnedmesh) - { - if (!slot.currentMeshName || slot.currentMeshName !== attachment.name) - { - var meshName = attachment.name; - if (slot.currentMesh !== undefined) - { - slot.currentMesh.visible = false; - } - - slot.meshes = slot.meshes || {}; - - if (slot.meshes[meshName] !== undefined) - { - slot.meshes[meshName].visible = true; - } - else - { - var mesh = this.createMesh(slot, attachment); - slotContainer.addChild(mesh); - } - - slot.currentMesh = slot.meshes[meshName]; - slot.currentMeshName = meshName; - } - - attachment.computeWorldVertices(slot.bone.skeleton.x, slot.bone.skeleton.y, slot, slot.currentMesh.vertices); - - } - else - { - slotContainer.visible = false; - continue; - } - slotContainer.visible = true; - - slotContainer.alpha = slot.a; - } -}; - -/** - * When autoupdate is set to yes this function is used as pixi's updateTransform function - * - * @method autoUpdateTransform - * @private - */ -PIXI.Spine.prototype.autoUpdateTransform = function () { - this.lastTime = this.lastTime || Date.now(); - var timeDelta = (Date.now() - this.lastTime) * 0.001; - this.lastTime = Date.now(); - - this.update(timeDelta); - - PIXI.DisplayObjectContainer.prototype.updateTransform.call(this); -}; - -/** - * Create a new sprite to be used with spine.RegionAttachment - * - * @method createSprite - * @param slot {spine.Slot} The slot to which the attachment is parented - * @param attachment {spine.RegionAttachment} The attachment that the sprite will represent - * @private - */ -PIXI.Spine.prototype.createSprite = function (slot, attachment) { - var descriptor = attachment.rendererObject; - var baseTexture = descriptor.page.rendererObject; - var spriteRect = new PIXI.Rectangle(descriptor.x, - descriptor.y, - descriptor.rotate ? descriptor.height : descriptor.width, - descriptor.rotate ? descriptor.width : descriptor.height); - var spriteTexture = new PIXI.Texture(baseTexture, spriteRect); - var sprite = new PIXI.Sprite(spriteTexture); - - var baseRotation = descriptor.rotate ? Math.PI * 0.5 : 0.0; - sprite.scale.set(descriptor.width / descriptor.originalWidth, descriptor.height / descriptor.originalHeight); - sprite.rotation = baseRotation - (attachment.rotation * spine.degRad); - sprite.anchor.x = sprite.anchor.y = 0.5; - - slot.sprites = slot.sprites || {}; - slot.sprites[descriptor.name] = sprite; - return sprite; -}; - -PIXI.Spine.prototype.createMesh = function (slot, attachment) { - var descriptor = attachment.rendererObject; - var baseTexture = descriptor.page.rendererObject; - var texture = new PIXI.Texture(baseTexture); - - var strip = new PIXI.Strip(texture); - strip.drawMode = PIXI.Strip.DrawModes.TRIANGLES; - strip.canvasPadding = 1.5; - - strip.vertices = new PIXI.Float32Array(attachment.uvs.length); - strip.uvs = attachment.uvs; - strip.indices = attachment.triangles; - - slot.meshes = slot.meshes || {}; - slot.meshes[attachment.name] = strip; - - return strip; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -PIXI.BaseTextureCache = {}; - -PIXI.BaseTextureCacheIdGenerator = 0; - -/** - * A texture stores the information that represents an image. All textures have a base texture. - * - * @class BaseTexture - * @uses EventTarget - * @constructor - * @param source {String} the source object (image or canvas) - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - */ -PIXI.BaseTexture = function(source, scaleMode) -{ - /** - * The Resolution of the texture. - * - * @property resolution - * @type Number - */ - this.resolution = 1; - - /** - * [read-only] The width of the base texture set when the image has loaded - * - * @property width - * @type Number - * @readOnly - */ - this.width = 100; - - /** - * [read-only] The height of the base texture set when the image has loaded - * - * @property height - * @type Number - * @readOnly - */ - this.height = 100; - - /** - * The scale mode to apply when scaling this texture - * - * @property scaleMode - * @type {Number} - * @default PIXI.scaleModes.LINEAR - */ - this.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - /** - * [read-only] Set to true once the base texture has loaded - * - * @property hasLoaded - * @type Boolean - * @readOnly - */ - this.hasLoaded = false; - - /** - * The image source that is used to create the texture. - * - * @property source - * @type Image - */ - this.source = source; - - this._UID = PIXI._UID++; - - /** - * Controls if RGB channels should be pre-multiplied by Alpha (WebGL only) - * - * @property premultipliedAlpha - * @type Boolean - * @default true - */ - this.premultipliedAlpha = true; - - // used for webGL - - /** - * @property _glTextures - * @type Array - * @private - */ - this._glTextures = []; - - /** - * - * Set this to true if a mipmap of this texture needs to be generated. This value needs to be set before the texture is used - * Also the texture must be a power of two size to work - * - * @property mipmap - * @type {Boolean} - */ - this.mipmap = false; - - // used for webGL texture updating... - // TODO - this needs to be addressed - - /** - * @property _dirty - * @type Array - * @private - */ - this._dirty = [true, true, true, true]; - - if(!source)return; - - if((this.source.complete || this.source.getContext) && this.source.width && this.source.height) - { - this.hasLoaded = true; - this.width = this.source.naturalWidth || this.source.width; - this.height = this.source.naturalHeight || this.source.height; - this.dirty(); - } - else - { - var scope = this; - - this.source.onload = function() { - - scope.hasLoaded = true; - scope.width = scope.source.naturalWidth || scope.source.width; - scope.height = scope.source.naturalHeight || scope.source.height; - - scope.dirty(); - - // add it to somewhere... - scope.dispatchEvent( { type: 'loaded', content: scope } ); - }; - - this.source.onerror = function() { - scope.dispatchEvent( { type: 'error', content: scope } ); - }; - } - - /** - * @property imageUrl - * @type String - */ - this.imageUrl = null; - - /** - * @property _powerOf2 - * @type Boolean - * @private - */ - this._powerOf2 = false; - -}; - -PIXI.BaseTexture.prototype.constructor = PIXI.BaseTexture; - -PIXI.EventTarget.mixin(PIXI.BaseTexture.prototype); - -/** - * Destroys this base texture - * - * @method destroy - */ -PIXI.BaseTexture.prototype.destroy = function() -{ - if(this.imageUrl) - { - delete PIXI.BaseTextureCache[this.imageUrl]; - delete PIXI.TextureCache[this.imageUrl]; - this.imageUrl = null; - if (!navigator.isCocoonJS) this.source.src = ''; - } - else if (this.source && this.source._pixiId) - { - delete PIXI.BaseTextureCache[this.source._pixiId]; - } - this.source = null; - - this.unloadFromGPU(); -}; - -/** - * Changes the source image of the texture - * - * @method updateSourceImage - * @param newSrc {String} the path of the image - */ -PIXI.BaseTexture.prototype.updateSourceImage = function(newSrc) -{ - this.hasLoaded = false; - this.source.src = null; - this.source.src = newSrc; -}; - -/** - * Sets all glTextures to be dirty. - * - * @method dirty - */ -PIXI.BaseTexture.prototype.dirty = function() -{ - for (var i = 0; i < this._glTextures.length; i++) - { - this._dirty[i] = true; - } -}; - -/** - * Removes the base texture from the GPU, useful for managing resources on the GPU. - * Atexture is still 100% usable and will simply be reuploaded if there is a sprite on screen that is using it. - * - * @method unloadFromGPU - */ -PIXI.BaseTexture.prototype.unloadFromGPU = function() -{ - this.dirty(); - - // delete the webGL textures if any. - for (var i = this._glTextures.length - 1; i >= 0; i--) - { - var glTexture = this._glTextures[i]; - var gl = PIXI.glContexts[i]; - - if(gl && glTexture) - { - gl.deleteTexture(glTexture); - } - - } - - this._glTextures.length = 0; - - this.dirty(); -}; - -/** - * Helper function that creates a base texture from the given image url. - * If the image is not in the base texture cache it will be created and loaded. - * - * @static - * @method fromImage - * @param imageUrl {String} The image url of the texture - * @param crossorigin {Boolean} - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return BaseTexture - */ -PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode) -{ - var baseTexture = PIXI.BaseTextureCache[imageUrl]; - - if(crossorigin === undefined && imageUrl.indexOf('data:') === -1) crossorigin = true; - - if(!baseTexture) - { - // new Image() breaks tex loading in some versions of Chrome. - // See https://code.google.com/p/chromium/issues/detail?id=238071 - var image = new Image();//document.createElement('img'); - if (crossorigin) - { - image.crossOrigin = ''; - } - - image.src = imageUrl; - baseTexture = new PIXI.BaseTexture(image, scaleMode); - baseTexture.imageUrl = imageUrl; - PIXI.BaseTextureCache[imageUrl] = baseTexture; - - // if there is an @2x at the end of the url we are going to assume its a highres image - if( imageUrl.indexOf(PIXI.RETINA_PREFIX + '.') !== -1) - { - baseTexture.resolution = 2; - } - } - - return baseTexture; -}; - -/** - * Helper function that creates a base texture from the given canvas element. - * - * @static - * @method fromCanvas - * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return BaseTexture - */ -PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode) -{ - if(!canvas._pixiId) - { - canvas._pixiId = 'canvas_' + PIXI.TextureCacheIdGenerator++; - } - - var baseTexture = PIXI.BaseTextureCache[canvas._pixiId]; - - if(!baseTexture) - { - baseTexture = new PIXI.BaseTexture(canvas, scaleMode); - PIXI.BaseTextureCache[canvas._pixiId] = baseTexture; - } - - return baseTexture; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -PIXI.TextureCache = {}; -PIXI.FrameCache = {}; - -PIXI.TextureCacheIdGenerator = 0; - -/** - * A texture stores the information that represents an image or part of an image. It cannot be added - * to the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used. - * - * @class Texture - * @uses EventTarget - * @constructor - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle - */ -PIXI.Texture = function(baseTexture, frame, crop, trim) -{ - /** - * Does this Texture have any frame data assigned to it? - * - * @property noFrame - * @type Boolean - */ - this.noFrame = false; - - if (!frame) - { - this.noFrame = true; - frame = new PIXI.Rectangle(0,0,1,1); - } - - if (baseTexture instanceof PIXI.Texture) - { - baseTexture = baseTexture.baseTexture; - } - - /** - * The base texture that this texture uses. - * - * @property baseTexture - * @type BaseTexture - */ - this.baseTexture = baseTexture; - - /** - * The frame specifies the region of the base texture that this texture uses - * - * @property frame - * @type Rectangle - */ - this.frame = frame; - - /** - * The texture trim data. - * - * @property trim - * @type Rectangle - */ - this.trim = trim; - - /** - * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. - * - * @property valid - * @type Boolean - */ - this.valid = false; - - /** - * This will let a renderer know that a texture has been updated (used mainly for webGL uv updates) - * - * @property requiresUpdate - * @type Boolean - */ - this.requiresUpdate = false; - - /** - * The WebGL UV data cache. - * - * @property _uvs - * @type Object - * @private - */ - this._uvs = null; - - /** - * The width of the Texture in pixels. - * - * @property width - * @type Number - */ - this.width = 0; - - /** - * The height of the Texture in pixels. - * - * @property height - * @type Number - */ - this.height = 0; - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @property crop - * @type Rectangle - */ - this.crop = crop || new PIXI.Rectangle(0, 0, 1, 1); - - if (baseTexture.hasLoaded) - { - if (this.noFrame) frame = new PIXI.Rectangle(0, 0, baseTexture.width, baseTexture.height); - this.setFrame(frame); - } - else - { - baseTexture.addEventListener('loaded', this.onBaseTextureLoaded.bind(this)); - } -}; - -PIXI.Texture.prototype.constructor = PIXI.Texture; -PIXI.EventTarget.mixin(PIXI.Texture.prototype); - -/** - * Called when the base texture is loaded - * - * @method onBaseTextureLoaded - * @private - */ -PIXI.Texture.prototype.onBaseTextureLoaded = function() -{ - var baseTexture = this.baseTexture; - baseTexture.removeEventListener('loaded', this.onLoaded); - - if (this.noFrame) this.frame = new PIXI.Rectangle(0, 0, baseTexture.width, baseTexture.height); - - this.setFrame(this.frame); - - this.dispatchEvent( { type: 'update', content: this } ); -}; - -/** - * Destroys this texture - * - * @method destroy - * @param destroyBase {Boolean} Whether to destroy the base texture as well - */ -PIXI.Texture.prototype.destroy = function(destroyBase) -{ - if (destroyBase) this.baseTexture.destroy(); - - this.valid = false; -}; - -/** - * Specifies the region of the baseTexture that this texture will use. - * - * @method setFrame - * @param frame {Rectangle} The frame of the texture to set it to - */ -PIXI.Texture.prototype.setFrame = function(frame) -{ - this.noFrame = false; - - this.frame = frame; - this.width = frame.width; - this.height = frame.height; - - this.crop.x = frame.x; - this.crop.y = frame.y; - this.crop.width = frame.width; - this.crop.height = frame.height; - - if (!this.trim && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) - { - throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); - } - - this.valid = frame && frame.width && frame.height && this.baseTexture.source && this.baseTexture.hasLoaded; - - if (this.trim) - { - this.width = this.trim.width; - this.height = this.trim.height; - this.frame.width = this.trim.width; - this.frame.height = this.trim.height; - } - - if (this.valid) this._updateUvs(); - -}; - -/** - * Updates the internal WebGL UV cache. - * - * @method _updateUvs - * @private - */ -PIXI.Texture.prototype._updateUvs = function() -{ - if(!this._uvs)this._uvs = new PIXI.TextureUvs(); - - var frame = this.crop; - var tw = this.baseTexture.width; - var th = this.baseTexture.height; - - this._uvs.x0 = frame.x / tw; - this._uvs.y0 = frame.y / th; - - this._uvs.x1 = (frame.x + frame.width) / tw; - this._uvs.y1 = frame.y / th; - - this._uvs.x2 = (frame.x + frame.width) / tw; - this._uvs.y2 = (frame.y + frame.height) / th; - - this._uvs.x3 = frame.x / tw; - this._uvs.y3 = (frame.y + frame.height) / th; -}; - -/** - * Helper function that creates a Texture object from the given image url. - * If the image is not in the texture cache it will be created and loaded. - * - * @static - * @method fromImage - * @param imageUrl {String} The image url of the texture - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return Texture - */ -PIXI.Texture.fromImage = function(imageUrl, crossorigin, scaleMode) -{ - var texture = PIXI.TextureCache[imageUrl]; - - if(!texture) - { - texture = new PIXI.Texture(PIXI.BaseTexture.fromImage(imageUrl, crossorigin, scaleMode)); - PIXI.TextureCache[imageUrl] = texture; - } - - return texture; -}; - -/** - * Helper function that returns a Texture objected based on the given frame id. - * If the frame id is not in the texture cache an error will be thrown. - * - * @static - * @method fromFrame - * @param frameId {String} The frame id of the texture - * @return Texture - */ -PIXI.Texture.fromFrame = function(frameId) -{ - var texture = PIXI.TextureCache[frameId]; - if(!texture) throw new Error('The frameId "' + frameId + '" does not exist in the texture cache '); - return texture; -}; - -/** - * Helper function that creates a new a Texture based on the given canvas element. - * - * @static - * @method fromCanvas - * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return Texture - */ -PIXI.Texture.fromCanvas = function(canvas, scaleMode) -{ - var baseTexture = PIXI.BaseTexture.fromCanvas(canvas, scaleMode); - - return new PIXI.Texture( baseTexture ); - -}; - -/** - * Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object. - * - * @static - * @method addTextureToCache - * @param texture {Texture} The Texture to add to the cache. - * @param id {String} The id that the texture will be stored against. - */ -PIXI.Texture.addTextureToCache = function(texture, id) -{ - PIXI.TextureCache[id] = texture; -}; - -/** - * Remove a texture from the global PIXI.TextureCache. - * - * @static - * @method removeTextureFromCache - * @param id {String} The id of the texture to be removed - * @return {Texture} The texture that was removed - */ -PIXI.Texture.removeTextureFromCache = function(id) -{ - var texture = PIXI.TextureCache[id]; - delete PIXI.TextureCache[id]; - delete PIXI.BaseTextureCache[id]; - return texture; -}; - -PIXI.TextureUvs = function() -{ - this.x0 = 0; - this.y0 = 0; - - this.x1 = 0; - this.y1 = 0; - - this.x2 = 0; - this.y2 = 0; - - this.x3 = 0; - this.y3 = 0; -}; - -PIXI.Texture.emptyTexture = new PIXI.Texture(new PIXI.BaseTexture()); - - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A RenderTexture is a special texture that allows any Pixi display object to be rendered to it. - * - * __Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead. - * - * A RenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example: - * - * var renderTexture = new PIXI.RenderTexture(800, 600); - * var sprite = PIXI.Sprite.fromImage("spinObj_01.png"); - * sprite.position.x = 800/2; - * sprite.position.y = 600/2; - * sprite.anchor.x = 0.5; - * sprite.anchor.y = 0.5; - * renderTexture.render(sprite); - * - * The Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual position a DisplayObjectContainer should be used: - * - * var doc = new PIXI.DisplayObjectContainer(); - * doc.addChild(sprite); - * renderTexture.render(doc); // Renders to center of renderTexture - * - * @class RenderTexture - * @extends Texture - * @constructor - * @param width {Number} The width of the render texture - * @param height {Number} The height of the render texture - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @param resolution {Number} The resolution of the texture being generated - */ -PIXI.RenderTexture = function(width, height, renderer, scaleMode, resolution) -{ - /** - * The with of the render texture - * - * @property width - * @type Number - */ - this.width = width || 100; - - /** - * The height of the render texture - * - * @property height - * @type Number - */ - this.height = height || 100; - - /** - * The Resolution of the texture. - * - * @property resolution - * @type Number - */ - this.resolution = resolution || 1; - - /** - * The framing rectangle of the render texture - * - * @property frame - * @type Rectangle - */ - this.frame = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @property crop - * @type Rectangle - */ - this.crop = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * The base texture object that this texture uses - * - * @property baseTexture - * @type BaseTexture - */ - this.baseTexture = new PIXI.BaseTexture(); - this.baseTexture.width = this.width * this.resolution; - this.baseTexture.height = this.height * this.resolution; - this.baseTexture._glTextures = []; - this.baseTexture.resolution = this.resolution; - - this.baseTexture.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - this.baseTexture.hasLoaded = true; - - PIXI.Texture.call(this, - this.baseTexture, - new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution) - ); - - /** - * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. - * - * @property renderer - * @type CanvasRenderer|WebGLRenderer - */ - this.renderer = renderer || PIXI.defaultRenderer; - - if(this.renderer.type === PIXI.WEBGL_RENDERER) - { - var gl = this.renderer.gl; - this.baseTexture._dirty[gl.id] = false; - - this.textureBuffer = new PIXI.FilterTexture(gl, this.width, this.height, this.baseTexture.scaleMode); - this.baseTexture._glTextures[gl.id] = this.textureBuffer.texture; - - this.render = this.renderWebGL; - this.projection = new PIXI.Point(this.width*0.5, -this.height*0.5); - } - else - { - this.render = this.renderCanvas; - this.textureBuffer = new PIXI.CanvasBuffer(this.width* this.resolution, this.height* this.resolution); - this.baseTexture.source = this.textureBuffer.canvas; - } - - /** - * @property valid - * @type Boolean - */ - this.valid = true; - - this._updateUvs(); -}; - -PIXI.RenderTexture.prototype = Object.create(PIXI.Texture.prototype); -PIXI.RenderTexture.prototype.constructor = PIXI.RenderTexture; - -/** - * Resizes the RenderTexture. - * - * @method resize - * @param width {Number} The width to resize to. - * @param height {Number} The height to resize to. - * @param updateBase {Boolean} Should the baseTexture.width and height values be resized as well? - */ -PIXI.RenderTexture.prototype.resize = function(width, height, updateBase) -{ - if (width === this.width && height === this.height)return; - - this.valid = (width > 0 && height > 0); - - this.width = width; - this.height = height; - - this.frame.width = this.crop.width = width * this.resolution; - this.frame.height = this.crop.height = height * this.resolution; - - if (updateBase) - { - this.baseTexture.width = this.width * this.resolution; - this.baseTexture.height = this.height * this.resolution; - } - - if (this.renderer.type === PIXI.WEBGL_RENDERER) - { - this.projection.x = this.width / 2; - this.projection.y = -this.height / 2; - } - - if(!this.valid)return; - - this.textureBuffer.resize(this.width, this.height); -}; - -/** - * Clears the RenderTexture. - * - * @method clear - */ -PIXI.RenderTexture.prototype.clear = function() -{ - if(!this.valid)return; - - if (this.renderer.type === PIXI.WEBGL_RENDERER) - { - this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer); - } - - this.textureBuffer.clear(); -}; - -/** - * This function will draw the display object to the texture. - * - * @method renderWebGL - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. - * @param [clear] {Boolean} If true the texture will be cleared before the displayObject is drawn - * @private - */ -PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, matrix, clear) -{ - if(!this.valid)return; - //TOOD replace position with matrix.. - - //Lets create a nice matrix to apply to our display object. Frame buffers come in upside down so we need to flip the matrix - var wt = displayObject.worldTransform; - wt.identity(); - wt.translate(0, this.projection.y * 2); - if(matrix)wt.append(matrix); - wt.scale(1,-1); - - // setWorld Alpha to ensure that the object is renderer at full opacity - displayObject.worldAlpha = 1; - - // Time to update all the children of the displayObject with the new matrix.. - var children = displayObject.children; - - for(var i=0,j=children.length; i 'image/gif' - var info = data.slice(0, sepIdx).split(';')[0]; - - //We might need to handle some special cases here... - //standardize text/plain to 'txt' file extension - if (!info || info.toLowerCase() === 'text/plain') - return 'txt'; - - //User specified mime type, try splitting it by '/' - return info.split('/').pop().toLowerCase(); - } - - return null; -}; - -/** - * Starts loading the assets sequentially - * - * @method load - */ -PIXI.AssetLoader.prototype.load = function() -{ - var scope = this; - - function onLoad(evt) { - scope.onAssetLoaded(evt.data.content); - } - - this.loadCount = this.assetURLs.length; - - for (var i=0; i < this.assetURLs.length; i++) - { - var fileName = this.assetURLs[i]; - //first see if we have a data URI scheme.. - var fileType = this._getDataType(fileName); - - //if not, assume it's a file URI - if (!fileType) - fileType = fileName.split('?').shift().split('.').pop().toLowerCase(); - - var Constructor = this.loadersByType[fileType]; - if(!Constructor) - throw new Error(fileType + ' is an unsupported file type'); - - var loader = new Constructor(fileName, this.crossorigin); - - loader.on('loaded', onLoad); - loader.load(); - } -}; - -/** - * Invoked after each file is loaded - * - * @method onAssetLoaded - * @private - */ -PIXI.AssetLoader.prototype.onAssetLoaded = function(loader) -{ - this.loadCount--; - - this.emit('onProgress', { - content: this, - loader: loader, - loaded: this.assetURLs.length - this.loadCount, - total: this.assetURLs.length - }); - - if (this.onProgress) this.onProgress(loader); - - if (!this.loadCount) - { - this.emit('onComplete', { content: this }); - if(this.onComplete) this.onComplete(); - } -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The json file loader is used to load in JSON data and parse it - * When loaded this class will dispatch a 'loaded' event - * If loading fails this class will dispatch an 'error' event - * - * @class JsonLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.JsonLoader = function (url, crossorigin) { - /** - * The url of the bitmap font data - * - * @property url - * @type String - */ - this.url = url; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * [read-only] The base url of the bitmap font data - * - * @property baseUrl - * @type String - * @readOnly - */ - this.baseUrl = url.replace(/[^\/]*$/, ''); - - /** - * [read-only] Whether the data has loaded yet - * - * @property loaded - * @type Boolean - * @readOnly - */ - this.loaded = false; - -}; - -// constructor -PIXI.JsonLoader.prototype.constructor = PIXI.JsonLoader; -PIXI.EventTarget.mixin(PIXI.JsonLoader.prototype); - -/** - * Loads the JSON data - * - * @method load - */ -PIXI.JsonLoader.prototype.load = function () { - - if(window.XDomainRequest && this.crossorigin) - { - this.ajaxRequest = new window.XDomainRequest(); - - // XDomainRequest has a few quirks. Occasionally it will abort requests - // A way to avoid this is to make sure ALL callbacks are set even if not used - // More info here: http://stackoverflow.com/questions/15786966/xdomainrequest-aborts-post-on-ie-9 - this.ajaxRequest.timeout = 3000; - - this.ajaxRequest.onerror = this.onError.bind(this); - - this.ajaxRequest.ontimeout = this.onError.bind(this); - - this.ajaxRequest.onprogress = function() {}; - - this.ajaxRequest.onload = this.onJSONLoaded.bind(this); - } - else - { - if (window.XMLHttpRequest) - { - this.ajaxRequest = new window.XMLHttpRequest(); - } - else - { - this.ajaxRequest = new window.ActiveXObject('Microsoft.XMLHTTP'); - } - - this.ajaxRequest.onreadystatechange = this.onReadyStateChanged.bind(this); - } - - this.ajaxRequest.open('GET',this.url,true); - - this.ajaxRequest.send(); -}; - -/** - * Bridge function to be able to use the more reliable onreadystatechange in XMLHttpRequest. - * - * @method onReadyStateChanged - * @private - */ -PIXI.JsonLoader.prototype.onReadyStateChanged = function () { - if (this.ajaxRequest.readyState === 4 && (this.ajaxRequest.status === 200 || window.location.href.indexOf('http') === -1)) { - this.onJSONLoaded(); - } -}; - -/** - * Invoke when JSON file is loaded - * - * @method onJSONLoaded - * @private - */ -PIXI.JsonLoader.prototype.onJSONLoaded = function () { - - if(!this.ajaxRequest.responseText ) - { - this.onError(); - return; - } - - this.json = JSON.parse(this.ajaxRequest.responseText); - - if(this.json.frames && this.json.meta && this.json.meta.image) - { - // sprite sheet - var textureUrl = this.baseUrl + this.json.meta.image; - var image = new PIXI.ImageLoader(textureUrl, this.crossorigin); - var frameData = this.json.frames; - - this.texture = image.texture.baseTexture; - image.addEventListener('loaded', this.onLoaded.bind(this)); - - for (var i in frameData) - { - var rect = frameData[i].frame; - - if (rect) - { - var textureSize = new PIXI.Rectangle(rect.x, rect.y, rect.w, rect.h); - var crop = textureSize.clone(); - var trim = null; - - // Check to see if the sprite is trimmed - if (frameData[i].trimmed) - { - var actualSize = frameData[i].sourceSize; - var realSize = frameData[i].spriteSourceSize; - trim = new PIXI.Rectangle(realSize.x, realSize.y, actualSize.w, actualSize.h); - } - PIXI.TextureCache[i] = new PIXI.Texture(this.texture, textureSize, crop, trim); - } - } - - image.load(); - - } - else if(this.json.bones) - { - /* check if the json was loaded before */ - if (PIXI.AnimCache[this.url]) - { - this.onLoaded(); - } - else - { - /* use a bit of hackery to load the atlas file, here we assume that the .json, .atlas and .png files - * that correspond to the spine file are in the same base URL and that the .json and .atlas files - * have the same name - */ - var atlasPath = this.url.substr(0, this.url.lastIndexOf('.')) + '.atlas'; - var atlasLoader = new PIXI.JsonLoader(atlasPath, this.crossorigin); - // save a copy of the current object for future reference // - var originalLoader = this; - // before loading the file, replace the "onJSONLoaded" function for our own // - atlasLoader.onJSONLoaded = function() - { - // at this point "this" points at the atlasLoader (JsonLoader) instance // - if(!this.ajaxRequest.responseText) - { - this.onError(); // FIXME: hmm, this is funny because we are not responding to errors yet - return; - } - // create a new instance of a spine texture loader for this spine object // - var textureLoader = new PIXI.SpineTextureLoader(this.url.substring(0, this.url.lastIndexOf('/'))); - // create a spine atlas using the loaded text and a spine texture loader instance // - var spineAtlas = new spine.Atlas(this.ajaxRequest.responseText, textureLoader); - // now we use an atlas attachment loader // - var attachmentLoader = new spine.AtlasAttachmentLoader(spineAtlas); - // spine animation - var spineJsonParser = new spine.SkeletonJson(attachmentLoader); - var skeletonData = spineJsonParser.readSkeletonData(originalLoader.json); - PIXI.AnimCache[originalLoader.url] = skeletonData; - originalLoader.spine = skeletonData; - originalLoader.spineAtlas = spineAtlas; - originalLoader.spineAtlasLoader = atlasLoader; - // wait for textures to finish loading if needed - if (textureLoader.loadingCount > 0) - { - textureLoader.addEventListener('loadedBaseTexture', function(evt){ - if (evt.content.content.loadingCount <= 0) - { - originalLoader.onLoaded(); - } - }); - } - else - { - originalLoader.onLoaded(); - } - }; - // start the loading // - atlasLoader.load(); - } - } - else - { - this.onLoaded(); - } -}; - -/** - * Invoke when json file loaded - * - * @method onLoaded - * @private - */ -PIXI.JsonLoader.prototype.onLoaded = function () { - this.loaded = true; - this.dispatchEvent({ - type: 'loaded', - content: this - }); -}; - -/** - * Invoke when error occured - * - * @method onError - * @private - */ -PIXI.JsonLoader.prototype.onError = function () { - - this.dispatchEvent({ - type: 'error', - content: this - }); -}; - -/** - * @author Martin Kelm http://mkelm.github.com - */ - -/** - * The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event. - * - * To generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format. - * - * It is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to 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.fromFrameId() - * - * @class AtlasLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.AtlasLoader = function (url, crossorigin) { - this.url = url; - this.baseUrl = url.replace(/[^\/]*$/, ''); - this.crossorigin = crossorigin; - this.loaded = false; - -}; - -// constructor -PIXI.AtlasLoader.constructor = PIXI.AtlasLoader; - -PIXI.EventTarget.mixin(PIXI.AtlasLoader.prototype); - - /** - * Starts loading the JSON file - * - * @method load - */ -PIXI.AtlasLoader.prototype.load = function () { - this.ajaxRequest = new PIXI.AjaxRequest(); - this.ajaxRequest.onreadystatechange = this.onAtlasLoaded.bind(this); - - this.ajaxRequest.open('GET', this.url, true); - if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/json'); - this.ajaxRequest.send(null); -}; - -/** - * Invoked when the Atlas has fully loaded. Parses the JSON and builds the texture frames. - * - * @method onAtlasLoaded - * @private - */ -PIXI.AtlasLoader.prototype.onAtlasLoaded = function () { - if (this.ajaxRequest.readyState === 4) { - if (this.ajaxRequest.status === 200 || window.location.href.indexOf('http') === -1) { - this.atlas = { - meta : { - image : [] - }, - frames : [] - }; - var result = this.ajaxRequest.responseText.split(/\r?\n/); - var lineCount = -3; - - var currentImageId = 0; - var currentFrame = null; - var nameInNextLine = false; - - var i = 0, - j = 0, - selfOnLoaded = this.onLoaded.bind(this); - - // parser without rotation support yet! - for (i = 0; i < result.length; i++) { - result[i] = result[i].replace(/^\s+|\s+$/g, ''); - if (result[i] === '') { - nameInNextLine = i+1; - } - if (result[i].length > 0) { - if (nameInNextLine === i) { - this.atlas.meta.image.push(result[i]); - currentImageId = this.atlas.meta.image.length - 1; - this.atlas.frames.push({}); - lineCount = -3; - } else if (lineCount > 0) { - if (lineCount % 7 === 1) { // frame name - if (currentFrame != null) { //jshint ignore:line - this.atlas.frames[currentImageId][currentFrame.name] = currentFrame; - } - currentFrame = { name: result[i], frame : {} }; - } else { - var text = result[i].split(' '); - if (lineCount % 7 === 3) { // position - currentFrame.frame.x = Number(text[1].replace(',', '')); - currentFrame.frame.y = Number(text[2]); - } else if (lineCount % 7 === 4) { // size - currentFrame.frame.w = Number(text[1].replace(',', '')); - currentFrame.frame.h = Number(text[2]); - } else if (lineCount % 7 === 5) { // real size - var realSize = { - x : 0, - y : 0, - w : Number(text[1].replace(',', '')), - h : Number(text[2]) - }; - - if (realSize.w > currentFrame.frame.w || realSize.h > currentFrame.frame.h) { - currentFrame.trimmed = true; - currentFrame.realSize = realSize; - } else { - currentFrame.trimmed = false; - } - } - } - } - lineCount++; - } - } - - if (currentFrame != null) { //jshint ignore:line - this.atlas.frames[currentImageId][currentFrame.name] = currentFrame; - } - - if (this.atlas.meta.image.length > 0) { - this.images = []; - for (j = 0; j < this.atlas.meta.image.length; j++) { - // sprite sheet - var textureUrl = this.baseUrl + this.atlas.meta.image[j]; - var frameData = this.atlas.frames[j]; - this.images.push(new PIXI.ImageLoader(textureUrl, this.crossorigin)); - - for (i in frameData) { - var rect = frameData[i].frame; - if (rect) { - PIXI.TextureCache[i] = new PIXI.Texture(this.images[j].texture.baseTexture, { - x: rect.x, - y: rect.y, - width: rect.w, - height: rect.h - }); - if (frameData[i].trimmed) { - PIXI.TextureCache[i].realSize = frameData[i].realSize; - // trim in pixi not supported yet, todo update trim properties if it is done ... - PIXI.TextureCache[i].trim.x = 0; - PIXI.TextureCache[i].trim.y = 0; - } - } - } - } - - this.currentImageId = 0; - for (j = 0; j < this.images.length; j++) { - this.images[j].on('loaded', selfOnLoaded); - } - this.images[this.currentImageId].load(); - - } else { - this.onLoaded(); - } - - } else { - this.onError(); - } - } -}; - -/** - * Invoked when json file has loaded. - * - * @method onLoaded - * @private - */ -PIXI.AtlasLoader.prototype.onLoaded = function () { - if (this.images.length - 1 > this.currentImageId) { - this.currentImageId++; - this.images[this.currentImageId].load(); - } else { - this.loaded = true; - this.emit('loaded', { content: this }); - } -}; - -/** - * Invoked when an error occurs. - * - * @method onError - * @private - */ -PIXI.AtlasLoader.prototype.onError = function () { - this.emit('error', { content: this }); -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * 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 in 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 a 'texture atlas') as it means sprites 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.fromFrameId() - * This loader will load the image file that the Spritesheet points to as well as the data. - * When loaded this class will dispatch a 'loaded' event - * - * @class SpriteSheetLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the sprite sheet JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.SpriteSheetLoader = function (url, crossorigin) { - - /** - * The url of the atlas data - * - * @property url - * @type String - */ - this.url = url; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * [read-only] The base url of the bitmap font data - * - * @property baseUrl - * @type String - * @readOnly - */ - this.baseUrl = url.replace(/[^\/]*$/, ''); - - /** - * The texture being loaded - * - * @property texture - * @type Texture - */ - this.texture = null; - - /** - * The frames of the sprite sheet - * - * @property frames - * @type Object - */ - this.frames = {}; -}; - -// constructor -PIXI.SpriteSheetLoader.prototype.constructor = PIXI.SpriteSheetLoader; - -PIXI.EventTarget.mixin(PIXI.SpriteSheetLoader.prototype); - -/** - * This will begin loading the JSON file - * - * @method load - */ -PIXI.SpriteSheetLoader.prototype.load = function () { - var scope = this; - var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin); - jsonLoader.on('loaded', function (event) { - scope.json = event.data.content.json; - scope.onLoaded(); - }); - jsonLoader.load(); -}; - -/** - * Invoke when all files are loaded (json and texture) - * - * @method onLoaded - * @private - */ -PIXI.SpriteSheetLoader.prototype.onLoaded = function () { - this.emit('loaded', { - content: this - }); -}; - -/** - * @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.fromFrame() and PIXI.Sprite.fromFrame() - * When loaded this class will dispatch a 'loaded' event - * - * @class ImageLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the image - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.ImageLoader = function(url, crossorigin) -{ - /** - * The texture being loaded - * - * @property texture - * @type Texture - */ - this.texture = PIXI.Texture.fromImage(url, crossorigin); - - /** - * if the image is loaded with loadFramedSpriteSheet - * frames will contain the sprite sheet frames - * - * @property frames - * @type Array - * @readOnly - */ - this.frames = []; -}; - -// constructor -PIXI.ImageLoader.prototype.constructor = PIXI.ImageLoader; - -PIXI.EventTarget.mixin(PIXI.ImageLoader.prototype); - -/** - * Loads image or takes it from cache - * - * @method load - */ -PIXI.ImageLoader.prototype.load = function() -{ - if(!this.texture.baseTexture.hasLoaded) - { - this.texture.baseTexture.on('loaded', this.onLoaded.bind(this)); - } - else - { - this.onLoaded(); - } -}; - -/** - * Invoked when image file is loaded or it is already cached and ready to use - * - * @method onLoaded - * @private - */ -PIXI.ImageLoader.prototype.onLoaded = function() -{ - this.emit('loaded', { content: this }); -}; - -/** - * Loads image and split it to uniform sized frames - * - * @method loadFramedSpriteSheet - * @param frameWidth {Number} width of each frame - * @param frameHeight {Number} height of each frame - * @param textureName {String} if given, the frames will be cached in - format - */ -PIXI.ImageLoader.prototype.loadFramedSpriteSheet = function(frameWidth, frameHeight, textureName) -{ - this.frames = []; - var cols = Math.floor(this.texture.width / frameWidth); - var rows = Math.floor(this.texture.height / frameHeight); - - var i=0; - for (var y=0; y-1){var c=["%c %c %c Pixi.js "+b.VERSION+" - "+a+" %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ ","background: #ff66a5","background: #ff66a5","color: #ff66a5; background: #030307;","background: #ff66a5","background: #ffc3dc","background: #ff66a5","color: #ff2424; background: #fff","color: #ff2424; background: #fff","color: #ff2424; background: #fff"];console.log.apply(console,c)}else window.console&&console.log("Pixi.js "+b.VERSION+" - http://www.pixijs.com/");b.dontSayHello=!0}},b.Point=function(a,b){this.x=a||0,this.y=b||0},b.Point.prototype.clone=function(){return new b.Point(this.x,this.y)},b.Point.prototype.set=function(a,b){this.x=a||0,this.y=b||(0!==b?this.x:0)},b.Point.prototype.constructor=b.Point,b.Rectangle=function(a,b,c,d){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0},b.Rectangle.prototype.clone=function(){return new b.Rectangle(this.x,this.y,this.width,this.height)},b.Rectangle.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=this.x;if(a>=c&&a<=c+this.width){var d=this.y;if(b>=d&&b<=d+this.height)return!0}return!1},b.Rectangle.prototype.constructor=b.Rectangle,b.EmptyRectangle=new b.Rectangle(0,0,0,0),b.Polygon=function(a){if(a instanceof Array||(a=Array.prototype.slice.call(arguments)),a[0]instanceof b.Point){for(var c=[],d=0,e=a.length;e>d;d++)c.push(a[d].x,a[d].y);a=c}this.closed=!0,this.points=a},b.Polygon.prototype.clone=function(){var a=this.points.slice();return new b.Polygon(a)},b.Polygon.prototype.contains=function(a,b){for(var c=!1,d=this.points.length/2,e=0,f=d-1;d>e;f=e++){var g=this.points[2*e],h=this.points[2*e+1],i=this.points[2*f],j=this.points[2*f+1],k=h>b!=j>b&&(i-g)*(b-h)/(j-h)+g>a;k&&(c=!c)}return c},b.Polygon.prototype.constructor=b.Polygon,b.Circle=function(a,b,c){this.x=a||0,this.y=b||0,this.radius=c||0},b.Circle.prototype.clone=function(){return new b.Circle(this.x,this.y,this.radius)},b.Circle.prototype.contains=function(a,b){if(this.radius<=0)return!1;var c=this.x-a,d=this.y-b,e=this.radius*this.radius;return c*=c,d*=d,e>=c+d},b.Circle.prototype.getBounds=function(){return new b.Rectangle(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},b.Circle.prototype.constructor=b.Circle,b.Ellipse=function(a,b,c,d){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0},b.Ellipse.prototype.clone=function(){return new b.Ellipse(this.x,this.y,this.width,this.height)},b.Ellipse.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=(a-this.x)/this.width,d=(b-this.y)/this.height;return c*=c,d*=d,1>=c+d},b.Ellipse.prototype.getBounds=function(){return new b.Rectangle(this.x-this.width,this.y-this.height,this.width,this.height)},b.Ellipse.prototype.constructor=b.Ellipse,b.RoundedRectangle=function(a,b,c,d,e){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0,this.radius=e||20},b.RoundedRectangle.prototype.clone=function(){return new b.RoundedRectangle(this.x,this.y,this.width,this.height,this.radius)},b.RoundedRectangle.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=this.x;if(a>=c&&a<=c+this.width){var d=this.y;if(b>=d&&b<=d+this.height)return!0}return!1},b.RoundedRectangle.prototype.constructor=b.RoundedRectangle,b.Matrix=function(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0},b.Matrix.prototype.fromArray=function(a){this.a=a[0],this.b=a[1],this.c=a[3],this.d=a[4],this.tx=a[2],this.ty=a[5]},b.Matrix.prototype.toArray=function(a){this.array||(this.array=new b.Float32Array(9));var c=this.array;return a?(c[0]=this.a,c[1]=this.b,c[2]=0,c[3]=this.c,c[4]=this.d,c[5]=0,c[6]=this.tx,c[7]=this.ty,c[8]=1):(c[0]=this.a,c[1]=this.c,c[2]=this.tx,c[3]=this.b,c[4]=this.d,c[5]=this.ty,c[6]=0,c[7]=0,c[8]=1),c},b.Matrix.prototype.apply=function(a,c){return c=c||new b.Point,c.x=this.a*a.x+this.c*a.y+this.tx,c.y=this.b*a.x+this.d*a.y+this.ty,c},b.Matrix.prototype.applyInverse=function(a,c){c=c||new b.Point;var d=1/(this.a*this.d+this.c*-this.b);return c.x=this.d*d*a.x+-this.c*d*a.y+(this.ty*this.c-this.tx*this.d)*d,c.y=this.a*d*a.y+-this.b*d*a.x+(-this.ty*this.a+this.tx*this.b)*d,c},b.Matrix.prototype.translate=function(a,b){return this.tx+=a,this.ty+=b,this},b.Matrix.prototype.scale=function(a,b){return this.a*=a,this.d*=b,this.c*=a,this.b*=b,this.tx*=a,this.ty*=b,this},b.Matrix.prototype.rotate=function(a){var b=Math.cos(a),c=Math.sin(a),d=this.a,e=this.c,f=this.tx;return this.a=d*b-this.b*c,this.b=d*c+this.b*b,this.c=e*b-this.d*c,this.d=e*c+this.d*b,this.tx=f*b-this.ty*c,this.ty=f*c+this.ty*b,this},b.Matrix.prototype.append=function(a){var b=this.a,c=this.b,d=this.c,e=this.d;return this.a=a.a*b+a.b*d,this.b=a.a*c+a.b*e,this.c=a.c*b+a.d*d,this.d=a.c*c+a.d*e,this.tx=a.tx*b+a.ty*d+this.tx,this.ty=a.tx*c+a.ty*e+this.ty,this},b.Matrix.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},b.identityMatrix=new b.Matrix,b.DisplayObject=function(){this.position=new b.Point,this.scale=new b.Point(1,1),this.pivot=new b.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.hitArea=null,this.buttonMode=!1,this.renderable=!1,this.parent=null,this.stage=null,this.worldAlpha=1,this._interactive=!1,this.defaultCursor="pointer",this.worldTransform=new b.Matrix,this._sr=0,this._cr=1,this.filterArea=null,this._bounds=new b.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null,this._cacheAsBitmap=!1,this._cacheIsDirty=!1},b.DisplayObject.prototype.constructor=b.DisplayObject,Object.defineProperty(b.DisplayObject.prototype,"interactive",{get:function(){return this._interactive},set:function(a){this._interactive=a,this.stage&&(this.stage.dirty=!0)}}),Object.defineProperty(b.DisplayObject.prototype,"worldVisible",{get:function(){var a=this;do{if(!a.visible)return!1;a=a.parent}while(a);return!0}}),Object.defineProperty(b.DisplayObject.prototype,"mask",{get:function(){return this._mask},set:function(a){this._mask&&(this._mask.isMask=!1),this._mask=a,this._mask&&(this._mask.isMask=!0)}}),Object.defineProperty(b.DisplayObject.prototype,"filters",{get:function(){return this._filters},set:function(a){if(a){for(var b=[],c=0;c=0&&b<=this.children.length)return a.parent&&a.parent.removeChild(a),a.parent=this,this.children.splice(b,0,a),this.stage&&a.setStageReference(this.stage),a;throw new Error(a+"addChildAt: The index "+b+" supplied is out of bounds "+this.children.length)},b.DisplayObjectContainer.prototype.swapChildren=function(a,b){if(a!==b){var c=this.getChildIndex(a),d=this.getChildIndex(b);if(0>c||0>d)throw new Error("swapChildren: Both the supplied DisplayObjects must be a child of the caller.");this.children[c]=b,this.children[d]=a}},b.DisplayObjectContainer.prototype.getChildIndex=function(a){var b=this.children.indexOf(a);if(-1===b)throw new Error("The supplied DisplayObject must be a child of the caller");return b},b.DisplayObjectContainer.prototype.setChildIndex=function(a,b){if(0>b||b>=this.children.length)throw new Error("The supplied index is out of bounds");var c=this.getChildIndex(a);this.children.splice(c,1),this.children.splice(b,0,a)},b.DisplayObjectContainer.prototype.getChildAt=function(a){if(0>a||a>=this.children.length)throw new Error("getChildAt: Supplied index "+a+" does not exist in the child list, or the supplied DisplayObject must be a child of the caller");return this.children[a]},b.DisplayObjectContainer.prototype.removeChild=function(a){var b=this.children.indexOf(a);if(-1!==b)return this.removeChildAt(b)},b.DisplayObjectContainer.prototype.removeChildAt=function(a){var b=this.getChildAt(a);return this.stage&&b.removeStageReference(),b.parent=void 0,this.children.splice(a,1),b},b.DisplayObjectContainer.prototype.removeChildren=function(a,b){var c=a||0,d="number"==typeof b?b:this.children.length,e=d-c;if(e>0&&d>=e){for(var f=this.children.splice(c,e),g=0;ga;a++)this.children[a].updateTransform()},b.DisplayObjectContainer.prototype.displayObjectContainerUpdateTransform=b.DisplayObjectContainer.prototype.updateTransform,b.DisplayObjectContainer.prototype.getBounds=function(){if(0===this.children.length)return b.EmptyRectangle;for(var a,c,d,e=1/0,f=1/0,g=-1/0,h=-1/0,i=!1,j=0,k=this.children.length;k>j;j++){var l=this.children[j];l.visible&&(i=!0,a=this.children[j].getBounds(),e=ec?g:c,h=h>d?h:d)}if(!i)return b.EmptyRectangle;var m=this._bounds;return m.x=e,m.y=f,m.width=g-e,m.height=h-f,m},b.DisplayObjectContainer.prototype.getLocalBounds=function(){var a=this.worldTransform;this.worldTransform=b.identityMatrix;for(var c=0,d=this.children.length;d>c;c++)this.children[c].updateTransform();var e=this.getBounds();return this.worldTransform=a,e},b.DisplayObjectContainer.prototype.setStageReference=function(a){this.stage=a,this._interactive&&(this.stage.dirty=!0);for(var b=0,c=this.children.length;c>b;b++){var d=this.children[b];d.setStageReference(a)}},b.DisplayObjectContainer.prototype.removeStageReference=function(){for(var a=0,b=this.children.length;b>a;a++){var c=this.children[a];c.removeStageReference()}this._interactive&&(this.stage.dirty=!0),this.stage=null},b.DisplayObjectContainer.prototype._renderWebGL=function(a){if(this.visible&&!(this.alpha<=0)){if(this._cacheAsBitmap)return void this._renderCachedSprite(a);var b,c;if(this._mask||this._filters){for(this._filters&&(a.spriteBatch.flush(),a.filterManager.pushFilter(this._filterBlock)),this._mask&&(a.spriteBatch.stop(),a.maskManager.pushMask(this.mask,a),a.spriteBatch.start()),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a);a.spriteBatch.stop(),this._mask&&a.maskManager.popMask(this._mask,a),this._filters&&a.filterManager.popFilter(),a.spriteBatch.start()}else for(b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a)}},b.DisplayObjectContainer.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){if(this._cacheAsBitmap)return void this._renderCachedSprite(a);this._mask&&a.maskManager.pushMask(this._mask,a);for(var b=0,c=this.children.length;c>b;b++){var d=this.children[b];d._renderCanvas(a)}this._mask&&a.maskManager.popMask(a)}},b.Sprite=function(a){b.DisplayObjectContainer.call(this),this.anchor=new b.Point,this.texture=a||b.Texture.emptyTexture,this._width=0,this._height=0,this.tint=16777215,this.blendMode=b.blendModes.NORMAL,this.shader=null,this.texture.baseTexture.hasLoaded?this.onTextureUpdate():this.texture.on("update",this.onTextureUpdate.bind(this)),this.renderable=!0},b.Sprite.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Sprite.prototype.constructor=b.Sprite,Object.defineProperty(b.Sprite.prototype,"width",{get:function(){return this.scale.x*this.texture.frame.width},set:function(a){this.scale.x=a/this.texture.frame.width,this._width=a}}),Object.defineProperty(b.Sprite.prototype,"height",{get:function(){return this.scale.y*this.texture.frame.height},set:function(a){this.scale.y=a/this.texture.frame.height,this._height=a}}),b.Sprite.prototype.setTexture=function(a){this.texture=a,this.cachedTint=16777215},b.Sprite.prototype.onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height)},b.Sprite.prototype.getBounds=function(a){var b=this.texture.frame.width,c=this.texture.frame.height,d=b*(1-this.anchor.x),e=b*-this.anchor.x,f=c*(1-this.anchor.y),g=c*-this.anchor.y,h=a||this.worldTransform,i=h.a,j=h.b,k=h.c,l=h.d,m=h.tx,n=h.ty,o=-1/0,p=-1/0,q=1/0,r=1/0;if(0===j&&0===k)0>i&&(i*=-1),0>l&&(l*=-1),q=i*e+m,o=i*d+m,r=l*g+n,p=l*f+n;else{var s=i*e+k*g+m,t=l*g+j*e+n,u=i*d+k*g+m,v=l*g+j*d+n,w=i*d+k*f+m,x=l*f+j*d+n,y=i*e+k*f+m,z=l*f+j*e+n;q=q>s?s:q,q=q>u?u:q,q=q>w?w:q,q=q>y?y:q,r=r>t?t:r,r=r>v?v:r,r=r>x?x:r,r=r>z?z:r,o=s>o?s:o,o=u>o?u:o,o=w>o?w:o,o=y>o?y:o,p=t>p?t:p,p=v>p?v:p,p=x>p?x:p,p=z>p?z:p}var A=this._bounds;return A.x=q,A.width=o-q,A.y=r,A.height=p-r,this._currentBounds=A,A},b.Sprite.prototype._renderWebGL=function(a){if(this.visible&&!(this.alpha<=0)){var b,c;if(this._mask||this._filters){var d=a.spriteBatch;for(this._filters&&(d.flush(),a.filterManager.pushFilter(this._filterBlock)),this._mask&&(d.stop(),a.maskManager.pushMask(this.mask,a),d.start()),d.render(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a);d.stop(),this._mask&&a.maskManager.popMask(this._mask,a),this._filters&&a.filterManager.popFilter(),d.start()}else for(a.spriteBatch.render(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a)}},b.Sprite.prototype._renderCanvas=function(a){if(!(this.visible===!1||0===this.alpha||this.texture.crop.width<=0||this.texture.crop.height<=0)){if(this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,a.context.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]),this._mask&&a.maskManager.pushMask(this._mask,a),this.texture.valid){var c=this.texture.baseTexture.resolution/a.resolution;a.context.globalAlpha=this.worldAlpha,a.smoothProperty&&a.scaleMode!==this.texture.baseTexture.scaleMode&&(a.scaleMode=this.texture.baseTexture.scaleMode,a.context[a.smoothProperty]=a.scaleMode===b.scaleModes.LINEAR);var d=this.texture.trim?this.texture.trim.x-this.anchor.x*this.texture.trim.width:this.anchor.x*-this.texture.frame.width,e=this.texture.trim?this.texture.trim.y-this.anchor.y*this.texture.trim.height:this.anchor.y*-this.texture.frame.height;a.roundPixels?(a.context.setTransform(this.worldTransform.a,this.worldTransform.b,this.worldTransform.c,this.worldTransform.d,this.worldTransform.tx*a.resolution|0,this.worldTransform.ty*a.resolution|0),d=0|d,e=0|e):a.context.setTransform(this.worldTransform.a,this.worldTransform.b,this.worldTransform.c,this.worldTransform.d,this.worldTransform.tx*a.resolution,this.worldTransform.ty*a.resolution),16777215!==this.tint?(this.cachedTint!==this.tint&&(this.cachedTint=this.tint,this.tintedTexture=b.CanvasTinter.getTintedTexture(this,this.tint)),a.context.drawImage(this.tintedTexture,0,0,this.texture.crop.width,this.texture.crop.height,d/c,e/c,this.texture.crop.width/c,this.texture.crop.height/c)):a.context.drawImage(this.texture.baseTexture.source,this.texture.crop.x,this.texture.crop.y,this.texture.crop.width,this.texture.crop.height,d/c,e/c,this.texture.crop.width/c,this.texture.crop.height/c)}for(var f=0,g=this.children.length;g>f;f++)this.children[f]._renderCanvas(a);this._mask&&a.maskManager.popMask(a)}},b.Sprite.fromFrame=function(a){var c=b.TextureCache[a];if(!c)throw new Error('The frameId "'+a+'" does not exist in the texture cache'+this);return new b.Sprite(c)},b.Sprite.fromImage=function(a,c,d){var e=b.Texture.fromImage(a,c,d);return new b.Sprite(e)},b.SpriteBatch=function(a){b.DisplayObjectContainer.call(this),this.textureThing=a,this.ready=!1},b.SpriteBatch.prototype=Object.create(b.DisplayObjectContainer.prototype),b.SpriteBatch.prototype.constructor=b.SpriteBatch,b.SpriteBatch.prototype.initWebGL=function(a){this.fastSpriteBatch=new b.WebGLFastSpriteBatch(a),this.ready=!0},b.SpriteBatch.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},b.SpriteBatch.prototype._renderWebGL=function(a){!this.visible||this.alpha<=0||!this.children.length||(this.ready||this.initWebGL(a.gl),this.fastSpriteBatch.gl!==a.gl&&this.fastSpriteBatch.setContext(a.gl),a.spriteBatch.stop(),a.shaderManager.setShader(a.shaderManager.fastShader),this.fastSpriteBatch.begin(this,a),this.fastSpriteBatch.render(this),a.spriteBatch.start())},b.SpriteBatch.prototype._renderCanvas=function(a){if(this.visible&&!(this.alpha<=0)&&this.children.length){var b=a.context;b.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var c=this.worldTransform,d=!0,e=0;e=this.textures.length&&(this.gotoAndStop(this.textures.length-1),this.onComplete&&this.onComplete())}},b.MovieClip.fromFrames=function(a){for(var c=[],d=0;di;i++){for(j=0;m>j;j+=4)if(255!==k[n+j]){o=!0;break}if(o)break;n+=m}for(c.ascent=g-i,n=l-m,o=!1,i=h;i>g;i--){for(j=0;m>j;j+=4)if(255!==k[n+j]){o=!0;break}if(o)break;n-=m}c.descent=i-g,c.descent+=6,c.fontSize=c.ascent+c.descent,b.Text.fontPropertiesCache[a]=c}return c},b.Text.prototype.wordWrap=function(a){for(var b="",c=a.split("\n"),d=0;de?(g>0&&(b+="\n"),b+=f[g],e=this.style.wordWrapWidth-h):(e-=i,b+=" "+f[g])}d=2?parseInt(c[c.length-2],10):b.BitmapText.fonts[this.fontName].size,this.dirty=!0,this.tint=a.tint},b.BitmapText.prototype.updateText=function(){for(var a=b.BitmapText.fonts[this.fontName],c=new b.Point,d=null,e=[],f=0,g=[],h=0,i=this.fontSize/a.size,j=0;j=j;j++){var n=0;"right"===this.style.align?n=f-g[j]:"center"===this.style.align&&(n=(f-g[j])/2),m.push(n)}var o=this.children.length,p=e.length,q=this.tint||16777215;for(j=0;p>j;j++){var r=o>j?this.children[j]:this._pool.pop();r?r.setTexture(e[j].texture):r=new b.Sprite(e[j].texture),r.position.x=(e[j].position.x+m[e[j].line])*i,r.position.y=e[j].position.y*i,r.scale.x=r.scale.y=i,r.tint=q,r.parent||this.addChild(r)}for(;this.children.length>p;){var s=this.getChildAt(this.children.length-1);this._pool.push(s),this.removeChild(s)}this.textWidth=f*i,this.textHeight=(c.y+a.lineHeight)*i},b.BitmapText.prototype.updateTransform=function(){this.dirty&&(this.updateText(),this.dirty=!1),b.DisplayObjectContainer.prototype.updateTransform.call(this)},b.BitmapText.fonts={},b.InteractionData=function(){this.global=new b.Point,this.target=null,this.originalEvent=null},b.InteractionData.prototype.getLocalPosition=function(a,c){var d=a.worldTransform,e=this.global,f=d.a,g=d.c,h=d.tx,i=d.b,j=d.d,k=d.ty,l=1/(f*j+g*-i);return c=c||new b.Point,c.x=j*l*e.x+-g*l*e.y+(k*g-h*j)*l,c.y=f*l*e.y+-i*l*e.x+(-k*f+h*i)*l,c},b.InteractionData.prototype.constructor=b.InteractionData,b.InteractionManager=function(a){this.stage=a,this.mouse=new b.InteractionData,this.touches={},this.tempPoint=new b.Point,this.mouseoverEnabled=!0,this.pool=[],this.interactiveItems=[],this.interactionDOMElement=null,this.onMouseMove=this.onMouseMove.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.onTouchCancel=this.onTouchCancel.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.last=0,this.currentCursorStyle="inherit",this.mouseOut=!1,this.resolution=1,this._tempPoint=new b.Point -},b.InteractionManager.prototype.constructor=b.InteractionManager,b.InteractionManager.prototype.collectInteractiveSprite=function(a,b){for(var c=a.children,d=c.length,e=d-1;e>=0;e--){var f=c[e];f._interactive?(b.interactiveChildren=!0,this.interactiveItems.push(f),f.children.length>0&&this.collectInteractiveSprite(f,f)):(f.__iParent=null,f.children.length>0&&this.collectInteractiveSprite(f,b))}},b.InteractionManager.prototype.setTarget=function(a){this.target=a,this.resolution=a.resolution,null===this.interactionDOMElement&&this.setTargetDomElement(a.view)},b.InteractionManager.prototype.setTargetDomElement=function(a){this.removeEvents(),window.navigator.msPointerEnabled&&(a.style["-ms-content-zooming"]="none",a.style["-ms-touch-action"]="none"),this.interactionDOMElement=a,a.addEventListener("mousemove",this.onMouseMove,!0),a.addEventListener("mousedown",this.onMouseDown,!0),a.addEventListener("mouseout",this.onMouseOut,!0),a.addEventListener("touchstart",this.onTouchStart,!0),a.addEventListener("touchend",this.onTouchEnd,!0),a.addEventListener("touchleave",this.onTouchCancel,!0),a.addEventListener("touchcancel",this.onTouchCancel,!0),a.addEventListener("touchmove",this.onTouchMove,!0),window.addEventListener("mouseup",this.onMouseUp,!0)},b.InteractionManager.prototype.removeEvents=function(){this.interactionDOMElement&&(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]="",this.interactionDOMElement.removeEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.removeEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.removeEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.removeEventListener("touchleave",this.onTouchCancel,!0),this.interactionDOMElement.removeEventListener("touchcancel",this.onTouchCancel,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onTouchMove,!0),this.interactionDOMElement=null,window.removeEventListener("mouseup",this.onMouseUp,!0))},b.InteractionManager.prototype.update=function(){if(this.target){var a=Date.now(),c=a-this.last;if(c=c*b.INTERACTION_FREQUENCY/1e3,!(1>c)){this.last=a;var d=0;this.dirty&&this.rebuildInteractiveGraph();var e=this.interactiveItems.length,f="inherit",g=!1;for(d=0;e>d;d++){var h=this.interactiveItems[d];h.__hit=this.hitTest(h,this.mouse),this.mouse.target=h,h.__hit&&!g?(h.buttonMode&&(f=h.defaultCursor),h.interactiveChildren||(g=!0),h.__isOver||(h.mouseover&&h.mouseover(this.mouse),h.__isOver=!0)):h.__isOver&&(h.mouseout&&h.mouseout(this.mouse),h.__isOver=!1)}this.currentCursorStyle!==f&&(this.currentCursorStyle=f,this.interactionDOMElement.style.cursor=f)}}},b.InteractionManager.prototype.rebuildInteractiveGraph=function(){this.dirty=!1;for(var a=this.interactiveItems.length,b=0;a>b;b++)this.interactiveItems[b].interactiveChildren=!1;this.interactiveItems=[],this.stage.interactive&&this.interactiveItems.push(this.stage),this.collectInteractiveSprite(this.stage,this.stage)},b.InteractionManager.prototype.onMouseMove=function(a){this.dirty&&this.rebuildInteractiveGraph(),this.mouse.originalEvent=a;var b=this.interactionDOMElement.getBoundingClientRect();this.mouse.global.x=(a.clientX-b.left)*(this.target.width/b.width)/this.resolution,this.mouse.global.y=(a.clientY-b.top)*(this.target.height/b.height)/this.resolution;for(var c=this.interactiveItems.length,d=0;c>d;d++){var e=this.interactiveItems[d];e.mousemove&&e.mousemove(this.mouse)}},b.InteractionManager.prototype.onMouseDown=function(a){this.dirty&&this.rebuildInteractiveGraph(),this.mouse.originalEvent=a,b.AUTO_PREVENT_DEFAULT&&this.mouse.originalEvent.preventDefault();for(var c=this.interactiveItems.length,d=this.mouse.originalEvent,e=2===d.button||3===d.which,f=e?"rightdown":"mousedown",g=e?"rightclick":"click",h=e?"__rightIsDown":"__mouseIsDown",i=e?"__isRightDown":"__isDown",j=0;c>j;j++){var k=this.interactiveItems[j];if((k[f]||k[g])&&(k[h]=!0,k.__hit=this.hitTest(k,this.mouse),k.__hit&&(k[f]&&k[f](this.mouse),k[i]=!0,!k.interactiveChildren)))break}},b.InteractionManager.prototype.onMouseOut=function(a){this.dirty&&this.rebuildInteractiveGraph(),this.mouse.originalEvent=a;var b=this.interactiveItems.length;this.interactionDOMElement.style.cursor="inherit";for(var c=0;b>c;c++){var d=this.interactiveItems[c];d.__isOver&&(this.mouse.target=d,d.mouseout&&d.mouseout(this.mouse),d.__isOver=!1)}this.mouseOut=!0,this.mouse.global.x=-1e4,this.mouse.global.y=-1e4},b.InteractionManager.prototype.onMouseUp=function(a){this.dirty&&this.rebuildInteractiveGraph(),this.mouse.originalEvent=a;for(var b=this.interactiveItems.length,c=!1,d=this.mouse.originalEvent,e=2===d.button||3===d.which,f=e?"rightup":"mouseup",g=e?"rightclick":"click",h=e?"rightupoutside":"mouseupoutside",i=e?"__isRightDown":"__isDown",j=0;b>j;j++){var k=this.interactiveItems[j];(k[g]||k[f]||k[h])&&(k.__hit=this.hitTest(k,this.mouse),k.__hit&&!c?(k[f]&&k[f](this.mouse),k[i]&&k[g]&&k[g](this.mouse),k.interactiveChildren||(c=!0)):k[i]&&k[h]&&k[h](this.mouse),k[i]=!1)}},b.InteractionManager.prototype.hitTest=function(a,c){var d=c.global;if(!a.worldVisible)return!1;a.worldTransform.applyInverse(d,this._tempPoint);var e,f=this._tempPoint.x,g=this._tempPoint.y;if(c.target=a,a.hitArea&&a.hitArea.contains)return a.hitArea.contains(f,g);if(a instanceof b.Sprite){var h,i=a.texture.frame.width,j=a.texture.frame.height,k=-i*a.anchor.x;if(f>k&&k+i>f&&(h=-j*a.anchor.y,g>h&&h+j>g))return!0}else if(a instanceof b.Graphics){var l=a.graphicsData;for(e=0;ee;e++){var o=a.children[e],p=this.hitTest(o,c);if(p)return c.target=a,!0}return!1},b.InteractionManager.prototype.onTouchMove=function(a){this.dirty&&this.rebuildInteractiveGraph();var b,c=this.interactionDOMElement.getBoundingClientRect(),d=a.changedTouches,e=0;for(e=0;ei;i++){var j=this.interactiveItems[i];if((j.touchstart||j.tap)&&(j.__hit=this.hitTest(j,g),j.__hit&&(j.touchstart&&j.touchstart(g),j.__isDown=!0,j.__touchData=j.__touchData||{},j.__touchData[f.identifier]=g,!j.interactiveChildren)))break}}},b.InteractionManager.prototype.onTouchEnd=function(a){this.dirty&&this.rebuildInteractiveGraph();for(var b=this.interactionDOMElement.getBoundingClientRect(),c=a.changedTouches,d=0;di;i++){var j=this.interactiveItems[i];j.__touchData&&j.__touchData[e.identifier]&&(j.__hit=this.hitTest(j,j.__touchData[e.identifier]),f.originalEvent=a,(j.touchend||j.tap)&&(j.__hit&&!g?(j.touchend&&j.touchend(f),j.__isDown&&j.tap&&j.tap(f),j.interactiveChildren||(g=!0)):j.__isDown&&j.touchendoutside&&j.touchendoutside(f),j.__isDown=!1),j.__touchData[e.identifier]=null)}this.pool.push(f),this.touches[e.identifier]=null}},b.InteractionManager.prototype.onTouchCancel=function(a){this.dirty&&this.rebuildInteractiveGraph();for(var b=this.interactionDOMElement.getBoundingClientRect(),c=a.changedTouches,d=0;di;i++){var j=this.interactiveItems[i];j.__touchData&&j.__touchData[e.identifier]&&(j.__hit=this.hitTest(j,j.__touchData[e.identifier]),f.originalEvent=a,j.touchcancel&&!g&&(j.touchcancel(f),j.interactiveChildren||(g=!0)),j.__isDown=!1,j.__touchData[e.identifier]=null)}this.pool.push(f),this.touches[e.identifier]=null}},b.Stage=function(a){b.DisplayObjectContainer.call(this),this.worldTransform=new b.Matrix,this.interactive=!0,this.interactionManager=new b.InteractionManager(this),this.dirty=!0,this.stage=this,this.stage.hitArea=new b.Rectangle(0,0,1e5,1e5),this.setBackgroundColor(a)},b.Stage.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Stage.prototype.constructor=b.Stage,b.Stage.prototype.setInteractionDelegate=function(a){this.interactionManager.setTargetDomElement(a)},b.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var a=0,b=this.children.length;b>a;a++)this.children[a].updateTransform();this.dirty&&(this.dirty=!1,this.interactionManager.dirty=!0),this.interactive&&this.interactionManager.update()},b.Stage.prototype.setBackgroundColor=function(a){this.backgroundColor=a||0,this.backgroundColorSplit=b.hex2rgb(this.backgroundColor);var c=this.backgroundColor.toString(16);c="000000".substr(0,6-c.length)+c,this.backgroundColorString="#"+c},b.Stage.prototype.getMousePosition=function(){return this.interactionManager.mouse.global},function(a){for(var b=0,c=["ms","moz","webkit","o"],d=0;d>16&255)/255,(a>>8&255)/255,(255&a)/255]},b.rgb2hex=function(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]},"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){return function(a){function b(){for(var d=arguments.length,f=new Array(d);d--;)f[d]=arguments[d];return f=e.concat(f),c.apply(this instanceof b?this:a,f)}var c=this,d=arguments.length-1,e=[];if(d>0)for(e.length=d;d--;)e[d]=arguments[d+1];if("function"!=typeof c)throw new TypeError;return b.prototype=function f(a){return a&&(f.prototype=a),this instanceof f?void 0:new f}(c.prototype),b}}()),b.AjaxRequest=function(){var a=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Microsoft.XMLHTTP"];if(!window.ActiveXObject)return window.XMLHttpRequest?new window.XMLHttpRequest:!1;for(var b=0;b0&&0===(a&a-1))return a;for(var b=1;a>b;)b<<=1;return b},b.isPowerOfTwo=function(a,b){return a>0&&0===(a&a-1)&&b>0&&0===(b&b-1)},b.EventTarget={call:function(a){a&&(a=a.prototype||a,b.EventTarget.mixin(a))},mixin:function(a){a.listeners=function(a){return this._listeners=this._listeners||{},this._listeners[a]?this._listeners[a].slice():[]},a.emit=a.dispatchEvent=function(a,c){if(this._listeners=this._listeners||{},"object"==typeof a&&(c=a,a=a.type),c&&c.__isEventObject===!0||(c=new b.Event(this,a,c)),this._listeners&&this._listeners[a]){var d,e=this._listeners[a].slice(0),f=e.length,g=e[0];for(d=0;f>d;g=e[++d])if(g.call(this,c),c.stoppedImmediate)return this;if(c.stopped)return this}return this.parent&&this.parent.emit&&this.parent.emit.call(this.parent,a,c),this},a.on=a.addEventListener=function(a,b){return this._listeners=this._listeners||{},(this._listeners[a]=this._listeners[a]||[]).push(b),this},a.once=function(a,b){function c(){b.apply(d.off(a,c),arguments)}this._listeners=this._listeners||{};var d=this;return c._originalHandler=b,this.on(a,c)},a.off=a.removeEventListener=function(a,b){if(this._listeners=this._listeners||{},!this._listeners[a])return this;for(var c=this._listeners[a],d=b?c.length:0;d-->0;)(c[d]===b||c[d]._originalHandler===b)&&c.splice(d,1);return 0===c.length&&delete this._listeners[a],this},a.removeAllListeners=function(a){return this._listeners=this._listeners||{},this._listeners[a]?(delete this._listeners[a],this):this}}},b.Event=function(a,b,c){this.__isEventObject=!0,this.stopped=!1,this.stoppedImmediate=!1,this.target=a,this.type=b,this.data=c,this.content=c,this.timeStamp=Date.now()},b.Event.prototype.stopPropagation=function(){this.stopped=!0},b.Event.prototype.stopImmediatePropagation=function(){this.stoppedImmediate=!0},b.autoDetectRenderer=function(a,c,d){a||(a=800),c||(c=600);var e=function(){try{var a=document.createElement("canvas");return!!window.WebGLRenderingContext&&(a.getContext("webgl")||a.getContext("experimental-webgl"))}catch(b){return!1}}();return e?new b.WebGLRenderer(a,c,d):new b.CanvasRenderer(a,c,d)},b.autoDetectRecommendedRenderer=function(a,c,d){a||(a=800),c||(c=600);var e=function(){try{var a=document.createElement("canvas");return!!window.WebGLRenderingContext&&(a.getContext("webgl")||a.getContext("experimental-webgl"))}catch(b){return!1}}(),f=/Android/i.test(navigator.userAgent);return e&&!f?new b.WebGLRenderer(a,c,d):new b.CanvasRenderer(a,c,d)},b.PolyK={},b.PolyK.Triangulate=function(a){var c=!0,d=a.length>>1;if(3>d)return[];for(var e=[],f=[],g=0;d>g;g++)f.push(g);g=0;for(var h=d;h>3;){var i=f[(g+0)%h],j=f[(g+1)%h],k=f[(g+2)%h],l=a[2*i],m=a[2*i+1],n=a[2*j],o=a[2*j+1],p=a[2*k],q=a[2*k+1],r=!1;if(b.PolyK._convex(l,m,n,o,p,q,c)){r=!0;for(var s=0;h>s;s++){var t=f[s];if(t!==i&&t!==j&&t!==k&&b.PolyK._PointInTriangle(a[2*t],a[2*t+1],l,m,n,o,p,q)){r=!1;break}}}if(r)e.push(i,j,k),f.splice((g+1)%h,1),h--,g=0;else if(g++>3*h){if(!c)return null;for(e=[],f=[],g=0;d>g;g++)f.push(g);g=0,h=d,c=!1}}return e.push(f[0],f[1],f[2]),e},b.PolyK._PointInTriangle=function(a,b,c,d,e,f,g,h){var i=g-c,j=h-d,k=e-c,l=f-d,m=a-c,n=b-d,o=i*i+j*j,p=i*k+j*l,q=i*m+j*n,r=k*k+l*l,s=k*m+l*n,t=1/(o*r-p*p),u=(r*q-p*s)*t,v=(o*s-p*q)*t;return u>=0&&v>=0&&1>u+v},b.PolyK._convex=function(a,b,c,d,e,f,g){return(b-d)*(e-c)+(c-a)*(f-d)>=0===g},b.initDefaultShaders=function(){},b.CompileVertexShader=function(a,c){return b._CompileShader(a,c,a.VERTEX_SHADER)},b.CompileFragmentShader=function(a,c){return b._CompileShader(a,c,a.FRAGMENT_SHADER)},b._CompileShader=function(a,b,c){var d=b.join("\n"),e=a.createShader(c);return a.shaderSource(e,d),a.compileShader(e),a.getShaderParameter(e,a.COMPILE_STATUS)?e:(window.console.log(a.getShaderInfoLog(e)),null)},b.compileProgram=function(a,c,d){var e=b.CompileFragmentShader(a,d),f=b.CompileVertexShader(a,c),g=a.createProgram();return a.attachShader(g,f),a.attachShader(g,e),a.linkProgram(g),a.getProgramParameter(g,a.LINK_STATUS)||window.console.log("Could not initialise shaders"),g},b.PixiShader=function(a){this._UID=b._UID++,this.gl=a,this.program=null,this.fragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"],this.textureCount=0,this.firstRun=!0,this.dirty=!0,this.attributes=[],this.init()},b.PixiShader.prototype.constructor=b.PixiShader,b.PixiShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc||b.PixiShader.defaultVertexSrc,this.fragmentSrc);a.useProgram(c),this.uSampler=a.getUniformLocation(c,"uSampler"),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.dimensions=a.getUniformLocation(c,"dimensions"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.aTextureCoord=a.getAttribLocation(c,"aTextureCoord"),this.colorAttribute=a.getAttribLocation(c,"aColor"),-1===this.colorAttribute&&(this.colorAttribute=2),this.attributes=[this.aVertexPosition,this.aTextureCoord,this.colorAttribute];for(var d in this.uniforms)this.uniforms[d].uniformLocation=a.getUniformLocation(c,d);this.initUniforms(),this.program=c},b.PixiShader.prototype.initUniforms=function(){this.textureCount=1;var a,b=this.gl;for(var c in this.uniforms){a=this.uniforms[c];var d=a.type;"sampler2D"===d?(a._init=!1,null!==a.value&&this.initSampler2D(a)):"mat2"===d||"mat3"===d||"mat4"===d?(a.glMatrix=!0,a.glValueLength=1,"mat2"===d?a.glFunc=b.uniformMatrix2fv:"mat3"===d?a.glFunc=b.uniformMatrix3fv:"mat4"===d&&(a.glFunc=b.uniformMatrix4fv)):(a.glFunc=b["uniform"+d],a.glValueLength="2f"===d||"2i"===d?2:"3f"===d||"3i"===d?3:"4f"===d||"4i"===d?4:1)}},b.PixiShader.prototype.initSampler2D=function(a){if(a.value&&a.value.baseTexture&&a.value.baseTexture.hasLoaded){var b=this.gl;if(b.activeTexture(b["TEXTURE"+this.textureCount]),b.bindTexture(b.TEXTURE_2D,a.value.baseTexture._glTextures[b.id]),a.textureData){var c=a.textureData,d=c.magFilter?c.magFilter:b.LINEAR,e=c.minFilter?c.minFilter:b.LINEAR,f=c.wrapS?c.wrapS:b.CLAMP_TO_EDGE,g=c.wrapT?c.wrapT:b.CLAMP_TO_EDGE,h=c.luminance?b.LUMINANCE:b.RGBA;if(c.repeat&&(f=b.REPEAT,g=b.REPEAT),b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!!c.flipY),c.width){var i=c.width?c.width:512,j=c.height?c.height:2,k=c.border?c.border:0;b.texImage2D(b.TEXTURE_2D,0,h,i,j,k,h,b.UNSIGNED_BYTE,null)}else b.texImage2D(b.TEXTURE_2D,0,h,b.RGBA,b.UNSIGNED_BYTE,a.value.baseTexture.source);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,d),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,e),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,f),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,g)}b.uniform1i(a.uniformLocation,this.textureCount),a._init=!0,this.textureCount++}},b.PixiShader.prototype.syncUniforms=function(){this.textureCount=1;var a,c=this.gl;for(var d in this.uniforms)a=this.uniforms[d],1===a.glValueLength?a.glMatrix===!0?a.glFunc.call(c,a.uniformLocation,a.transpose,a.value):a.glFunc.call(c,a.uniformLocation,a.value):2===a.glValueLength?a.glFunc.call(c,a.uniformLocation,a.value.x,a.value.y):3===a.glValueLength?a.glFunc.call(c,a.uniformLocation,a.value.x,a.value.y,a.value.z):4===a.glValueLength?a.glFunc.call(c,a.uniformLocation,a.value.x,a.value.y,a.value.z,a.value.w):"sampler2D"===a.type&&(a._init?(c.activeTexture(c["TEXTURE"+this.textureCount]),a.value.baseTexture._dirty[c.id]?b.instances[c.id].updateTexture(a.value.baseTexture):c.bindTexture(c.TEXTURE_2D,a.value.baseTexture._glTextures[c.id]),c.uniform1i(a.uniformLocation,this.textureCount),this.textureCount++):this.initSampler2D(a))},b.PixiShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},b.PixiShader.defaultVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec4 aColor;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","varying vec2 vTextureCoord;","varying vec4 vColor;","const vec2 center = vec2(-1.0, 1.0);","void main(void) {"," gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = vec4(aColor.rgb * aColor.a, aColor.a);","}"],b.PixiFastShader=function(a){this._UID=b._UID++,this.gl=a,this.program=null,this.fragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform mat3 uMatrix;","varying vec2 vTextureCoord;","varying float vColor;","const vec2 center = vec2(-1.0, 1.0);","void main(void) {"," vec2 v;"," vec2 sv = aVertexPosition * aScale;"," v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);"," v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);"," v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;"," gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"],this.textureCount=0,this.init()},b.PixiFastShader.prototype.constructor=b.PixiFastShader,b.PixiFastShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.uSampler=a.getUniformLocation(c,"uSampler"),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.dimensions=a.getUniformLocation(c,"dimensions"),this.uMatrix=a.getUniformLocation(c,"uMatrix"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.aPositionCoord=a.getAttribLocation(c,"aPositionCoord"),this.aScale=a.getAttribLocation(c,"aScale"),this.aRotation=a.getAttribLocation(c,"aRotation"),this.aTextureCoord=a.getAttribLocation(c,"aTextureCoord"),this.colorAttribute=a.getAttribLocation(c,"aColor"),-1===this.colorAttribute&&(this.colorAttribute=2),this.attributes=[this.aVertexPosition,this.aPositionCoord,this.aScale,this.aRotation,this.aTextureCoord,this.colorAttribute],this.program=c},b.PixiFastShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},b.StripShader=function(a){this._UID=b._UID++,this.gl=a,this.program=null,this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","uniform float alpha;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * alpha;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","varying vec2 vTextureCoord;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);"," vTextureCoord = aTextureCoord;","}"],this.init()},b.StripShader.prototype.constructor=b.StripShader,b.StripShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.uSampler=a.getUniformLocation(c,"uSampler"),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.colorAttribute=a.getAttribLocation(c,"aColor"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.aTextureCoord=a.getAttribLocation(c,"aTextureCoord"),this.attributes=[this.aVertexPosition,this.aTextureCoord],this.translationMatrix=a.getUniformLocation(c,"translationMatrix"),this.alpha=a.getUniformLocation(c,"alpha"),this.program=c},b.StripShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attribute=null},b.PrimitiveShader=function(a){this._UID=b._UID++,this.gl=a,this.program=null,this.fragmentSrc=["precision mediump float;","varying vec4 vColor;","void main(void) {"," gl_FragColor = vColor;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform float alpha;","uniform float flipY;","uniform vec3 tint;","varying vec4 vColor;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);"," vColor = aColor * vec4(tint * alpha, alpha);","}"],this.init()},b.PrimitiveShader.prototype.constructor=b.PrimitiveShader,b.PrimitiveShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.tintColor=a.getUniformLocation(c,"tint"),this.flipY=a.getUniformLocation(c,"flipY"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.colorAttribute=a.getAttribLocation(c,"aColor"),this.attributes=[this.aVertexPosition,this.colorAttribute],this.translationMatrix=a.getUniformLocation(c,"translationMatrix"),this.alpha=a.getUniformLocation(c,"alpha"),this.program=c},b.PrimitiveShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},b.ComplexPrimitiveShader=function(a){this._UID=b._UID++,this.gl=a,this.program=null,this.fragmentSrc=["precision mediump float;","varying vec4 vColor;","void main(void) {"," gl_FragColor = vColor;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform vec3 tint;","uniform float alpha;","uniform vec3 color;","uniform float flipY;","varying vec4 vColor;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);"," vColor = vec4(color * alpha * tint, alpha);","}"],this.init()},b.ComplexPrimitiveShader.prototype.constructor=b.ComplexPrimitiveShader,b.ComplexPrimitiveShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.tintColor=a.getUniformLocation(c,"tint"),this.color=a.getUniformLocation(c,"color"),this.flipY=a.getUniformLocation(c,"flipY"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.attributes=[this.aVertexPosition,this.colorAttribute],this.translationMatrix=a.getUniformLocation(c,"translationMatrix"),this.alpha=a.getUniformLocation(c,"alpha"),this.program=c},b.ComplexPrimitiveShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attribute=null},b.WebGLGraphics=function(){},b.WebGLGraphics.renderGraphics=function(a,c){var d,e=c.gl,f=c.projection,g=c.offset,h=c.shaderManager.primitiveShader;a.dirty&&b.WebGLGraphics.updateGraphics(a,e);for(var i=a._webGL[e.id],j=0;j=6)if(h.points.length<12){g=b.WebGLGraphics.switchMode(d,0);var i=b.WebGLGraphics.buildPoly(h,g);i||(g=b.WebGLGraphics.switchMode(d,1),b.WebGLGraphics.buildComplexPoly(h,g))}else g=b.WebGLGraphics.switchMode(d,1),b.WebGLGraphics.buildComplexPoly(h,g);h.lineWidth>0&&(g=b.WebGLGraphics.switchMode(d,0),b.WebGLGraphics.buildLine(h,g))}else g=b.WebGLGraphics.switchMode(d,0),h.type===b.Graphics.RECT?b.WebGLGraphics.buildRectangle(h,g):h.type===b.Graphics.CIRC||h.type===b.Graphics.ELIP?b.WebGLGraphics.buildCircle(h,g):h.type===b.Graphics.RREC&&b.WebGLGraphics.buildRoundedRectangle(h,g);d.lastIndex++}for(e=0;e=q;q++)p=q/n,h=g(a,c,p),i=g(b,d,p),j=g(c,e,p),k=g(d,f,p),l=g(h,j,p),m=g(i,k,p),o.push(l,m);return o},b.WebGLGraphics.buildCircle=function(a,c){var d,e,f=a.shape,g=f.x,h=f.y;a.type===b.Graphics.CIRC?(d=f.radius,e=f.radius):(d=f.width,e=f.height);var i=40,j=2*Math.PI/i,k=0;if(a.fill){var l=b.hex2rgb(a.fillColor),m=a.fillAlpha,n=l[0]*m,o=l[1]*m,p=l[2]*m,q=c.points,r=c.indices,s=q.length/6;for(r.push(s),k=0;i+1>k;k++)q.push(g,h,n,o,p,m),q.push(g+Math.sin(j*k)*d,h+Math.cos(j*k)*e,n,o,p,m),r.push(s++,s++);r.push(s-1) -}if(a.lineWidth){var t=a.points;for(a.points=[],k=0;i+1>k;k++)a.points.push(g+Math.sin(j*k)*d,h+Math.cos(j*k)*e);b.WebGLGraphics.buildLine(a,c),a.points=t}},b.WebGLGraphics.buildLine=function(a,c){var d=0,e=a.points;if(0!==e.length){if(a.lineWidth%2)for(d=0;dd;d++)l=e[2*(d-1)],m=e[2*(d-1)+1],n=e[2*d],o=e[2*d+1],p=e[2*(d+1)],q=e[2*(d+1)+1],r=-(m-o),s=l-n,F=Math.sqrt(r*r+s*s),r/=F,s/=F,r*=L,s*=L,t=-(o-q),u=n-p,F=Math.sqrt(t*t+u*u),t/=F,u/=F,t*=L,u*=L,x=-s+m-(-s+o),y=-r+n-(-r+l),z=(-r+l)*(-s+o)-(-r+n)*(-s+m),A=-u+q-(-u+o),B=-t+n-(-t+p),C=(-t+p)*(-u+o)-(-t+n)*(-u+q),D=x*B-A*y,Math.abs(D)<.1?(D+=10.1,G.push(n-r,o-s,O,P,Q,N),G.push(n+r,o+s,O,P,Q,N)):(j=(y*C-B*z)/D,k=(A*z-x*C)/D,E=(j-n)*(j-n)+(k-o)+(k-o),E>19600?(v=r-t,w=s-u,F=Math.sqrt(v*v+w*w),v/=F,w/=F,v*=L,w*=L,G.push(n-v,o-w),G.push(O,P,Q,N),G.push(n+v,o+w),G.push(O,P,Q,N),G.push(n-v,o-w),G.push(O,P,Q,N),J++):(G.push(j,k),G.push(O,P,Q,N),G.push(n-(j-n),o-(k-o)),G.push(O,P,Q,N)));for(l=e[2*(I-2)],m=e[2*(I-2)+1],n=e[2*(I-1)],o=e[2*(I-1)+1],r=-(m-o),s=l-n,F=Math.sqrt(r*r+s*s),r/=F,s/=F,r*=L,s*=L,G.push(n-r,o-s),G.push(O,P,Q,N),G.push(n+r,o+s),G.push(O,P,Q,N),H.push(K),d=0;J>d;d++)H.push(K++);H.push(K-1)}},b.WebGLGraphics.buildComplexPoly=function(a,c){var d=a.points.slice();if(!(d.length<6)){var e=c.indices;c.points=d,c.alpha=a.fillAlpha,c.color=b.hex2rgb(a.fillColor);for(var f,g,h=1/0,i=-1/0,j=1/0,k=-1/0,l=0;lf?f:h,i=f>i?f:i,j=j>g?g:j,k=g>k?g:k;d.push(h,j,i,j,i,k,h,k);var m=d.length/2;for(l=0;m>l;l++)e.push(l)}},b.WebGLGraphics.buildPoly=function(a,c){var d=a.points;if(!(d.length<6)){var e=c.points,f=c.indices,g=d.length/2,h=b.hex2rgb(a.fillColor),i=a.fillAlpha,j=h[0]*i,k=h[1]*i,l=h[2]*i,m=b.PolyK.Triangulate(d);if(!m)return!1;var n=e.length/6,o=0;for(o=0;oo;o++)e.push(d[2*o],d[2*o+1],j,k,l,i);return!0}},b.WebGLGraphics.graphicsDataPool=[],b.WebGLGraphicsData=function(a){this.gl=a,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),this.mode=1,this.alpha=1,this.dirty=!0},b.WebGLGraphicsData.prototype.reset=function(){this.points=[],this.indices=[]},b.WebGLGraphicsData.prototype.upload=function(){var a=this.gl;this.glPoints=new b.Float32Array(this.points),a.bindBuffer(a.ARRAY_BUFFER,this.buffer),a.bufferData(a.ARRAY_BUFFER,this.glPoints,a.STATIC_DRAW),this.glIndicies=new b.Uint16Array(this.indices),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.glIndicies,a.STATIC_DRAW),this.dirty=!1},b.glContexts=[],b.instances=[],b.WebGLRenderer=function(a,c,d){if(d)for(var e in b.defaultRenderOptions)"undefined"==typeof d[e]&&(d[e]=b.defaultRenderOptions[e]);else d=b.defaultRenderOptions;b.defaultRenderer||(b.sayHello("webGL"),b.defaultRenderer=this),this.type=b.WEBGL_RENDERER,this.resolution=d.resolution,this.transparent=d.transparent,this.autoResize=d.autoResize||!1,this.preserveDrawingBuffer=d.preserveDrawingBuffer,this.clearBeforeRender=d.clearBeforeRender,this.width=a||800,this.height=c||600,this.view=d.view||document.createElement("canvas"),this.contextLostBound=this.handleContextLost.bind(this),this.contextRestoredBound=this.handleContextRestored.bind(this),this.view.addEventListener("webglcontextlost",this.contextLostBound,!1),this.view.addEventListener("webglcontextrestored",this.contextRestoredBound,!1),this._contextOptions={alpha:this.transparent,antialias:d.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:d.preserveDrawingBuffer},this.projection=new b.Point,this.offset=new b.Point(0,0),this.shaderManager=new b.WebGLShaderManager,this.spriteBatch=new b.WebGLSpriteBatch,this.maskManager=new b.WebGLMaskManager,this.filterManager=new b.WebGLFilterManager,this.stencilManager=new b.WebGLStencilManager,this.blendModeManager=new b.WebGLBlendModeManager,this.renderSession={},this.renderSession.gl=this.gl,this.renderSession.drawCount=0,this.renderSession.shaderManager=this.shaderManager,this.renderSession.maskManager=this.maskManager,this.renderSession.filterManager=this.filterManager,this.renderSession.blendModeManager=this.blendModeManager,this.renderSession.spriteBatch=this.spriteBatch,this.renderSession.stencilManager=this.stencilManager,this.renderSession.renderer=this,this.renderSession.resolution=this.resolution,this.initContext(),this.mapBlendModes()},b.WebGLRenderer.prototype.constructor=b.WebGLRenderer,b.WebGLRenderer.prototype.initContext=function(){var a=this.view.getContext("webgl",this._contextOptions)||this.view.getContext("experimental-webgl",this._contextOptions);if(this.gl=a,!a)throw new Error("This browser does not support webGL. Try using the canvas renderer");this.glContextId=a.id=b.WebGLRenderer.glContextId++,b.glContexts[this.glContextId]=a,b.instances[this.glContextId]=this,a.disable(a.DEPTH_TEST),a.disable(a.CULL_FACE),a.enable(a.BLEND),this.shaderManager.setContext(a),this.spriteBatch.setContext(a),this.maskManager.setContext(a),this.filterManager.setContext(a),this.blendModeManager.setContext(a),this.stencilManager.setContext(a),this.renderSession.gl=this.gl,this.resize(this.width,this.height)},b.WebGLRenderer.prototype.render=function(a){if(!this.contextLost){this.__stage!==a&&(a.interactive&&a.interactionManager.removeEvents(),this.__stage=a),a.updateTransform();var b=this.gl;a._interactive?a._interactiveEventsAdded||(a._interactiveEventsAdded=!0,a.interactionManager.setTarget(this)):a._interactiveEventsAdded&&(a._interactiveEventsAdded=!1,a.interactionManager.setTarget(this)),b.viewport(0,0,this.width,this.height),b.bindFramebuffer(b.FRAMEBUFFER,null),this.clearBeforeRender&&(this.transparent?b.clearColor(0,0,0,0):b.clearColor(a.backgroundColorSplit[0],a.backgroundColorSplit[1],a.backgroundColorSplit[2],1),b.clear(b.COLOR_BUFFER_BIT)),this.renderDisplayObject(a,this.projection)}},b.WebGLRenderer.prototype.renderDisplayObject=function(a,c,d){this.renderSession.blendModeManager.setBlendMode(b.blendModes.NORMAL),this.renderSession.drawCount=0,this.renderSession.flipY=d?-1:1,this.renderSession.projection=c,this.renderSession.offset=this.offset,this.spriteBatch.begin(this.renderSession),this.filterManager.begin(this.renderSession,d),a._renderWebGL(this.renderSession),this.spriteBatch.end()},b.WebGLRenderer.prototype.resize=function(a,b){this.width=a*this.resolution,this.height=b*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px",this.view.style.height=this.height/this.resolution+"px"),this.gl.viewport(0,0,this.width,this.height),this.projection.x=this.width/2/this.resolution,this.projection.y=-this.height/2/this.resolution},b.WebGLRenderer.prototype.updateTexture=function(a){if(a.hasLoaded){var c=this.gl;return a._glTextures[c.id]||(a._glTextures[c.id]=c.createTexture()),c.bindTexture(c.TEXTURE_2D,a._glTextures[c.id]),c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultipliedAlpha),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a.source),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),a.mipmap&&b.isPowerOfTwo(a.width,a.height)?(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR_MIPMAP_LINEAR:c.NEAREST_MIPMAP_NEAREST),c.generateMipmap(c.TEXTURE_2D)):c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),a._powerOf2?(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.REPEAT),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.REPEAT)):(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE)),a._dirty[c.id]=!1,a._glTextures[c.id]}},b.WebGLRenderer.prototype.handleContextLost=function(a){a.preventDefault(),this.contextLost=!0},b.WebGLRenderer.prototype.handleContextRestored=function(){this.initContext();for(var a in b.TextureCache){var c=b.TextureCache[a].baseTexture;c._glTextures=[]}this.contextLost=!1},b.WebGLRenderer.prototype.destroy=function(){this.view.removeEventListener("webglcontextlost",this.contextLostBound),this.view.removeEventListener("webglcontextrestored",this.contextRestoredBound),b.glContexts[this.glContextId]=null,this.projection=null,this.offset=null,this.shaderManager.destroy(),this.spriteBatch.destroy(),this.maskManager.destroy(),this.filterManager.destroy(),this.shaderManager=null,this.spriteBatch=null,this.maskManager=null,this.filterManager=null,this.gl=null,this.renderSession=null},b.WebGLRenderer.prototype.mapBlendModes=function(){var a=this.gl;b.blendModesWebGL||(b.blendModesWebGL=[],b.blendModesWebGL[b.blendModes.NORMAL]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.ADD]=[a.SRC_ALPHA,a.DST_ALPHA],b.blendModesWebGL[b.blendModes.MULTIPLY]=[a.DST_COLOR,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.SCREEN]=[a.SRC_ALPHA,a.ONE],b.blendModesWebGL[b.blendModes.OVERLAY]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.DARKEN]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.LIGHTEN]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.COLOR_DODGE]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.COLOR_BURN]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.HARD_LIGHT]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.SOFT_LIGHT]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.DIFFERENCE]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.EXCLUSION]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.HUE]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.SATURATION]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.COLOR]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.LUMINOSITY]=[a.ONE,a.ONE_MINUS_SRC_ALPHA])},b.WebGLRenderer.glContextId=0,b.WebGLBlendModeManager=function(){this.currentBlendMode=99999},b.WebGLBlendModeManager.prototype.constructor=b.WebGLBlendModeManager,b.WebGLBlendModeManager.prototype.setContext=function(a){this.gl=a},b.WebGLBlendModeManager.prototype.setBlendMode=function(a){if(this.currentBlendMode===a)return!1;this.currentBlendMode=a;var c=b.blendModesWebGL[this.currentBlendMode];return this.gl.blendFunc(c[0],c[1]),!0},b.WebGLBlendModeManager.prototype.destroy=function(){this.gl=null},b.WebGLMaskManager=function(){},b.WebGLMaskManager.prototype.constructor=b.WebGLMaskManager,b.WebGLMaskManager.prototype.setContext=function(a){this.gl=a},b.WebGLMaskManager.prototype.pushMask=function(a,c){var d=c.gl;a.dirty&&b.WebGLGraphics.updateGraphics(a,d),a._webGL[d.id].data.length&&c.stencilManager.pushStencil(a,a._webGL[d.id].data[0],c)},b.WebGLMaskManager.prototype.popMask=function(a,b){var c=this.gl;b.stencilManager.popStencil(a,a._webGL[c.id].data[0],b)},b.WebGLMaskManager.prototype.destroy=function(){this.gl=null},b.WebGLStencilManager=function(){this.stencilStack=[],this.reverse=!0,this.count=0},b.WebGLStencilManager.prototype.setContext=function(a){this.gl=a},b.WebGLStencilManager.prototype.pushStencil=function(a,b,c){var d=this.gl;this.bindGraphics(a,b,c),0===this.stencilStack.length&&(d.enable(d.STENCIL_TEST),d.clear(d.STENCIL_BUFFER_BIT),this.reverse=!0,this.count=0),this.stencilStack.push(b);var e=this.count;d.colorMask(!1,!1,!1,!1),d.stencilFunc(d.ALWAYS,0,255),d.stencilOp(d.KEEP,d.KEEP,d.INVERT),1===b.mode?(d.drawElements(d.TRIANGLE_FAN,b.indices.length-4,d.UNSIGNED_SHORT,0),this.reverse?(d.stencilFunc(d.EQUAL,255-e,255),d.stencilOp(d.KEEP,d.KEEP,d.DECR)):(d.stencilFunc(d.EQUAL,e,255),d.stencilOp(d.KEEP,d.KEEP,d.INCR)),d.drawElements(d.TRIANGLE_FAN,4,d.UNSIGNED_SHORT,2*(b.indices.length-4)),this.reverse?d.stencilFunc(d.EQUAL,255-(e+1),255):d.stencilFunc(d.EQUAL,e+1,255),this.reverse=!this.reverse):(this.reverse?(d.stencilFunc(d.EQUAL,e,255),d.stencilOp(d.KEEP,d.KEEP,d.INCR)):(d.stencilFunc(d.EQUAL,255-e,255),d.stencilOp(d.KEEP,d.KEEP,d.DECR)),d.drawElements(d.TRIANGLE_STRIP,b.indices.length,d.UNSIGNED_SHORT,0),this.reverse?d.stencilFunc(d.EQUAL,e+1,255):d.stencilFunc(d.EQUAL,255-(e+1),255)),d.colorMask(!0,!0,!0,!0),d.stencilOp(d.KEEP,d.KEEP,d.KEEP),this.count++},b.WebGLStencilManager.prototype.bindGraphics=function(a,c,d){this._currentGraphics=a;var e,f=this.gl,g=d.projection,h=d.offset;1===c.mode?(e=d.shaderManager.complexPrimitiveShader,d.shaderManager.setShader(e),f.uniform1f(e.flipY,d.flipY),f.uniformMatrix3fv(e.translationMatrix,!1,a.worldTransform.toArray(!0)),f.uniform2f(e.projectionVector,g.x,-g.y),f.uniform2f(e.offsetVector,-h.x,-h.y),f.uniform3fv(e.tintColor,b.hex2rgb(a.tint)),f.uniform3fv(e.color,c.color),f.uniform1f(e.alpha,a.worldAlpha*c.alpha),f.bindBuffer(f.ARRAY_BUFFER,c.buffer),f.vertexAttribPointer(e.aVertexPosition,2,f.FLOAT,!1,8,0),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,c.indexBuffer)):(e=d.shaderManager.primitiveShader,d.shaderManager.setShader(e),f.uniformMatrix3fv(e.translationMatrix,!1,a.worldTransform.toArray(!0)),f.uniform1f(e.flipY,d.flipY),f.uniform2f(e.projectionVector,g.x,-g.y),f.uniform2f(e.offsetVector,-h.x,-h.y),f.uniform3fv(e.tintColor,b.hex2rgb(a.tint)),f.uniform1f(e.alpha,a.worldAlpha),f.bindBuffer(f.ARRAY_BUFFER,c.buffer),f.vertexAttribPointer(e.aVertexPosition,2,f.FLOAT,!1,24,0),f.vertexAttribPointer(e.colorAttribute,4,f.FLOAT,!1,24,8),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,c.indexBuffer))},b.WebGLStencilManager.prototype.popStencil=function(a,b,c){var d=this.gl;if(this.stencilStack.pop(),this.count--,0===this.stencilStack.length)d.disable(d.STENCIL_TEST);else{var e=this.count;this.bindGraphics(a,b,c),d.colorMask(!1,!1,!1,!1),1===b.mode?(this.reverse=!this.reverse,this.reverse?(d.stencilFunc(d.EQUAL,255-(e+1),255),d.stencilOp(d.KEEP,d.KEEP,d.INCR)):(d.stencilFunc(d.EQUAL,e+1,255),d.stencilOp(d.KEEP,d.KEEP,d.DECR)),d.drawElements(d.TRIANGLE_FAN,4,d.UNSIGNED_SHORT,2*(b.indices.length-4)),d.stencilFunc(d.ALWAYS,0,255),d.stencilOp(d.KEEP,d.KEEP,d.INVERT),d.drawElements(d.TRIANGLE_FAN,b.indices.length-4,d.UNSIGNED_SHORT,0),this.reverse?d.stencilFunc(d.EQUAL,e,255):d.stencilFunc(d.EQUAL,255-e,255)):(this.reverse?(d.stencilFunc(d.EQUAL,e+1,255),d.stencilOp(d.KEEP,d.KEEP,d.DECR)):(d.stencilFunc(d.EQUAL,255-(e+1),255),d.stencilOp(d.KEEP,d.KEEP,d.INCR)),d.drawElements(d.TRIANGLE_STRIP,b.indices.length,d.UNSIGNED_SHORT,0),this.reverse?d.stencilFunc(d.EQUAL,e,255):d.stencilFunc(d.EQUAL,255-e,255)),d.colorMask(!0,!0,!0,!0),d.stencilOp(d.KEEP,d.KEEP,d.KEEP)}},b.WebGLStencilManager.prototype.destroy=function(){this.stencilStack=null,this.gl=null},b.WebGLShaderManager=function(){this.maxAttibs=10,this.attribState=[],this.tempAttribState=[];for(var a=0;ad;d+=6,e+=4)this.indices[d+0]=e+0,this.indices[d+1]=e+1,this.indices[d+2]=e+2,this.indices[d+3]=e+0,this.indices[d+4]=e+2,this.indices[d+5]=e+3;this.drawing=!1,this.currentBatchSize=0,this.currentBaseTexture=null,this.dirty=!0,this.textures=[],this.blendModes=[],this.shaders=[],this.sprites=[],this.defaultShader=new b.AbstractFilter(["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"])},b.WebGLSpriteBatch.prototype.setContext=function(a){this.gl=a,this.vertexBuffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.indices,a.STATIC_DRAW),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferData(a.ARRAY_BUFFER,this.vertices,a.DYNAMIC_DRAW),this.currentBlendMode=99999;var c=new b.PixiShader(a);c.fragmentSrc=this.defaultShader.fragmentSrc,c.uniforms={},c.init(),this.defaultShader.shaders[a.id]=c},b.WebGLSpriteBatch.prototype.begin=function(a){this.renderSession=a,this.shader=this.renderSession.shaderManager.defaultShader,this.start()},b.WebGLSpriteBatch.prototype.end=function(){this.flush()},b.WebGLSpriteBatch.prototype.render=function(a){var b=a.texture;this.currentBatchSize>=this.size&&(this.flush(),this.currentBaseTexture=b.baseTexture);var c=b._uvs;if(c){var d,e,f,g,h=a.anchor.x,i=a.anchor.y;if(b.trim){var j=b.trim;e=j.x-h*j.width,d=e+b.crop.width,g=j.y-i*j.height,f=g+b.crop.height}else d=b.frame.width*(1-h),e=b.frame.width*-h,f=b.frame.height*(1-i),g=b.frame.height*-i;var k=4*this.currentBatchSize*this.vertSize,l=b.baseTexture.resolution,m=a.worldTransform,n=m.a/l,o=m.b/l,p=m.c/l,q=m.d/l,r=m.tx,s=m.ty,t=this.colors,u=this.positions;this.renderSession.roundPixels?(u[k]=n*e+p*g+r|0,u[k+1]=q*g+o*e+s|0,u[k+5]=n*d+p*g+r|0,u[k+6]=q*g+o*d+s|0,u[k+10]=n*d+p*f+r|0,u[k+11]=q*f+o*d+s|0,u[k+15]=n*e+p*f+r|0,u[k+16]=q*f+o*e+s|0):(u[k]=n*e+p*g+r,u[k+1]=q*g+o*e+s,u[k+5]=n*d+p*g+r,u[k+6]=q*g+o*d+s,u[k+10]=n*d+p*f+r,u[k+11]=q*f+o*d+s,u[k+15]=n*e+p*f+r,u[k+16]=q*f+o*e+s),u[k+2]=c.x0,u[k+3]=c.y0,u[k+7]=c.x1,u[k+8]=c.y1,u[k+12]=c.x2,u[k+13]=c.y2,u[k+17]=c.x3,u[k+18]=c.y3;var v=a.tint;t[k+4]=t[k+9]=t[k+14]=t[k+19]=(v>>16)+(65280&v)+((255&v)<<16)+(255*a.worldAlpha<<24),this.sprites[this.currentBatchSize++]=a}},b.WebGLSpriteBatch.prototype.renderTilingSprite=function(a){var c=a.tilingTexture;this.currentBatchSize>=this.size&&(this.flush(),this.currentBaseTexture=c.baseTexture),a._uvs||(a._uvs=new b.TextureUvs);var d=a._uvs;a.tilePosition.x%=c.baseTexture.width*a.tileScaleOffset.x,a.tilePosition.y%=c.baseTexture.height*a.tileScaleOffset.y;var e=a.tilePosition.x/(c.baseTexture.width*a.tileScaleOffset.x),f=a.tilePosition.y/(c.baseTexture.height*a.tileScaleOffset.y),g=a.width/c.baseTexture.width/(a.tileScale.x*a.tileScaleOffset.x),h=a.height/c.baseTexture.height/(a.tileScale.y*a.tileScaleOffset.y);d.x0=0-e,d.y0=0-f,d.x1=1*g-e,d.y1=0-f,d.x2=1*g-e,d.y2=1*h-f,d.x3=0-e,d.y3=1*h-f;var i=a.tint,j=(i>>16)+(65280&i)+((255&i)<<16)+(255*a.alpha<<24),k=this.positions,l=this.colors,m=a.width,n=a.height,o=a.anchor.x,p=a.anchor.y,q=m*(1-o),r=m*-o,s=n*(1-p),t=n*-p,u=4*this.currentBatchSize*this.vertSize,v=c.baseTexture.resolution,w=a.worldTransform,x=w.a/v,y=w.b/v,z=w.c/v,A=w.d/v,B=w.tx,C=w.ty;k[u++]=x*r+z*t+B,k[u++]=A*t+y*r+C,k[u++]=d.x0,k[u++]=d.y0,l[u++]=j,k[u++]=x*q+z*t+B,k[u++]=A*t+y*q+C,k[u++]=d.x1,k[u++]=d.y1,l[u++]=j,k[u++]=x*q+z*s+B,k[u++]=A*s+y*q+C,k[u++]=d.x2,k[u++]=d.y2,l[u++]=j,k[u++]=x*r+z*s+B,k[u++]=A*s+y*r+C,k[u++]=d.x3,k[u++]=d.y3,l[u++]=j,this.sprites[this.currentBatchSize++]=a},b.WebGLSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var a,c=this.gl;if(this.dirty){this.dirty=!1,c.activeTexture(c.TEXTURE0),c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a=this.defaultShader.shaders[c.id];var d=4*this.vertSize;c.vertexAttribPointer(a.aVertexPosition,2,c.FLOAT,!1,d,0),c.vertexAttribPointer(a.aTextureCoord,2,c.FLOAT,!1,d,8),c.vertexAttribPointer(a.colorAttribute,4,c.UNSIGNED_BYTE,!0,d,16)}if(this.currentBatchSize>.5*this.size)c.bufferSubData(c.ARRAY_BUFFER,0,this.vertices);else{var e=this.positions.subarray(0,4*this.currentBatchSize*this.vertSize);c.bufferSubData(c.ARRAY_BUFFER,0,e)}for(var f,g,h,i,j=0,k=0,l=null,m=this.renderSession.blendModeManager.currentBlendMode,n=null,o=!1,p=!1,q=0,r=this.currentBatchSize;r>q;q++){if(i=this.sprites[q],f=i.texture.baseTexture,g=i.blendMode,h=i.shader||this.defaultShader,o=m!==g,p=n!==h,(l!==f||o||p)&&(this.renderBatch(l,j,k),k=q,j=0,l=f,o&&(m=g,this.renderSession.blendModeManager.setBlendMode(m)),p)){n=h,a=n.shaders[c.id],a||(a=new b.PixiShader(c),a.fragmentSrc=n.fragmentSrc,a.uniforms=n.uniforms,a.init(),n.shaders[c.id]=a),this.renderSession.shaderManager.setShader(a),a.dirty&&a.syncUniforms();var s=this.renderSession.projection;c.uniform2f(a.projectionVector,s.x,s.y);var t=this.renderSession.offset;c.uniform2f(a.offsetVector,t.x,t.y)}j++}this.renderBatch(l,j,k),this.currentBatchSize=0}},b.WebGLSpriteBatch.prototype.renderBatch=function(a,b,c){if(0!==b){var d=this.gl;a._dirty[d.id]?this.renderSession.renderer.updateTexture(a):d.bindTexture(d.TEXTURE_2D,a._glTextures[d.id]),d.drawElements(d.TRIANGLES,6*b,d.UNSIGNED_SHORT,6*c*2),this.renderSession.drawCount++}},b.WebGLSpriteBatch.prototype.stop=function(){this.flush(),this.dirty=!0},b.WebGLSpriteBatch.prototype.start=function(){this.dirty=!0},b.WebGLSpriteBatch.prototype.destroy=function(){this.vertices=null,this.indices=null,this.gl.deleteBuffer(this.vertexBuffer),this.gl.deleteBuffer(this.indexBuffer),this.currentBaseTexture=null,this.gl=null},b.WebGLFastSpriteBatch=function(a){this.vertSize=10,this.maxSize=6e3,this.size=this.maxSize;var c=4*this.size*this.vertSize,d=6*this.maxSize;this.vertices=new b.Float32Array(c),this.indices=new b.Uint16Array(d),this.vertexBuffer=null,this.indexBuffer=null,this.lastIndexCount=0;for(var e=0,f=0;d>e;e+=6,f+=4)this.indices[e+0]=f+0,this.indices[e+1]=f+1,this.indices[e+2]=f+2,this.indices[e+3]=f+0,this.indices[e+4]=f+2,this.indices[e+5]=f+3;this.drawing=!1,this.currentBatchSize=0,this.currentBaseTexture=null,this.currentBlendMode=0,this.renderSession=null,this.shader=null,this.matrix=null,this.setContext(a)},b.WebGLFastSpriteBatch.prototype.constructor=b.WebGLFastSpriteBatch,b.WebGLFastSpriteBatch.prototype.setContext=function(a){this.gl=a,this.vertexBuffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.indices,a.STATIC_DRAW),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferData(a.ARRAY_BUFFER,this.vertices,a.DYNAMIC_DRAW)},b.WebGLFastSpriteBatch.prototype.begin=function(a,b){this.renderSession=b,this.shader=this.renderSession.shaderManager.fastShader,this.matrix=a.worldTransform.toArray(!0),this.start()},b.WebGLFastSpriteBatch.prototype.end=function(){this.flush()},b.WebGLFastSpriteBatch.prototype.render=function(a){var b=a.children,c=b[0];if(c.texture._uvs){this.currentBaseTexture=c.texture.baseTexture,c.blendMode!==this.renderSession.blendModeManager.currentBlendMode&&(this.flush(),this.renderSession.blendModeManager.setBlendMode(c.blendMode));for(var d=0,e=b.length;e>d;d++)this.renderSprite(b[d]);this.flush()}},b.WebGLFastSpriteBatch.prototype.renderSprite=function(a){if(a.visible&&(a.texture.baseTexture===this.currentBaseTexture||(this.flush(),this.currentBaseTexture=a.texture.baseTexture,a.texture._uvs))){var b,c,d,e,f,g,h,i,j=this.vertices;if(b=a.texture._uvs,c=a.texture.frame.width,d=a.texture.frame.height,a.texture.trim){var k=a.texture.trim;f=k.x-a.anchor.x*k.width,e=f+a.texture.crop.width,h=k.y-a.anchor.y*k.height,g=h+a.texture.crop.height}else e=a.texture.frame.width*(1-a.anchor.x),f=a.texture.frame.width*-a.anchor.x,g=a.texture.frame.height*(1-a.anchor.y),h=a.texture.frame.height*-a.anchor.y;i=4*this.currentBatchSize*this.vertSize,j[i++]=f,j[i++]=h,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b.x0,j[i++]=b.y1,j[i++]=a.alpha,j[i++]=e,j[i++]=h,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b.x1,j[i++]=b.y1,j[i++]=a.alpha,j[i++]=e,j[i++]=g,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b.x2,j[i++]=b.y2,j[i++]=a.alpha,j[i++]=f,j[i++]=g,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b.x3,j[i++]=b.y3,j[i++]=a.alpha,this.currentBatchSize++,this.currentBatchSize>=this.size&&this.flush()}},b.WebGLFastSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var a=this.gl;if(this.currentBaseTexture._glTextures[a.id]||this.renderSession.renderer.updateTexture(this.currentBaseTexture,a),a.bindTexture(a.TEXTURE_2D,this.currentBaseTexture._glTextures[a.id]),this.currentBatchSize>.5*this.size)a.bufferSubData(a.ARRAY_BUFFER,0,this.vertices);else{var b=this.vertices.subarray(0,4*this.currentBatchSize*this.vertSize);a.bufferSubData(a.ARRAY_BUFFER,0,b)}a.drawElements(a.TRIANGLES,6*this.currentBatchSize,a.UNSIGNED_SHORT,0),this.currentBatchSize=0,this.renderSession.drawCount++}},b.WebGLFastSpriteBatch.prototype.stop=function(){this.flush()},b.WebGLFastSpriteBatch.prototype.start=function(){var a=this.gl;a.activeTexture(a.TEXTURE0),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var b=this.renderSession.projection;a.uniform2f(this.shader.projectionVector,b.x,b.y),a.uniformMatrix3fv(this.shader.uMatrix,!1,this.matrix);var c=4*this.vertSize;a.vertexAttribPointer(this.shader.aVertexPosition,2,a.FLOAT,!1,c,0),a.vertexAttribPointer(this.shader.aPositionCoord,2,a.FLOAT,!1,c,8),a.vertexAttribPointer(this.shader.aScale,2,a.FLOAT,!1,c,16),a.vertexAttribPointer(this.shader.aRotation,1,a.FLOAT,!1,c,24),a.vertexAttribPointer(this.shader.aTextureCoord,2,a.FLOAT,!1,c,28),a.vertexAttribPointer(this.shader.colorAttribute,1,a.FLOAT,!1,c,36)},b.WebGLFilterManager=function(){this.filterStack=[],this.offsetX=0,this.offsetY=0},b.WebGLFilterManager.prototype.constructor=b.WebGLFilterManager,b.WebGLFilterManager.prototype.setContext=function(a){this.gl=a,this.texturePool=[],this.initShaderBuffers()},b.WebGLFilterManager.prototype.begin=function(a,b){this.renderSession=a,this.defaultShader=a.shaderManager.defaultShader;var c=this.renderSession.projection;this.width=2*c.x,this.height=2*-c.y,this.buffer=b},b.WebGLFilterManager.prototype.pushFilter=function(a){var c=this.gl,d=this.renderSession.projection,e=this.renderSession.offset;a._filterArea=a.target.filterArea||a.target.getBounds(),this.filterStack.push(a);var f=a.filterPasses[0];this.offsetX+=a._filterArea.x,this.offsetY+=a._filterArea.y;var g=this.texturePool.pop();g?g.resize(this.width,this.height):g=new b.FilterTexture(this.gl,this.width,this.height),c.bindTexture(c.TEXTURE_2D,g.texture);var h=a._filterArea,i=f.padding;h.x-=i,h.y-=i,h.width+=2*i,h.height+=2*i,h.x<0&&(h.x=0),h.width>this.width&&(h.width=this.width),h.y<0&&(h.y=0),h.height>this.height&&(h.height=this.height),c.bindFramebuffer(c.FRAMEBUFFER,g.frameBuffer),c.viewport(0,0,h.width,h.height),d.x=h.width/2,d.y=-h.height/2,e.x=-h.x,e.y=-h.y,c.colorMask(!0,!0,!0,!0),c.clearColor(0,0,0,0),c.clear(c.COLOR_BUFFER_BIT),a._glFilterTexture=g},b.WebGLFilterManager.prototype.popFilter=function(){var a=this.gl,c=this.filterStack.pop(),d=c._filterArea,e=c._glFilterTexture,f=this.renderSession.projection,g=this.renderSession.offset;if(c.filterPasses.length>1){a.viewport(0,0,d.width,d.height),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),this.vertexArray[0]=0,this.vertexArray[1]=d.height,this.vertexArray[2]=d.width,this.vertexArray[3]=d.height,this.vertexArray[4]=0,this.vertexArray[5]=0,this.vertexArray[6]=d.width,this.vertexArray[7]=0,a.bufferSubData(a.ARRAY_BUFFER,0,this.vertexArray),a.bindBuffer(a.ARRAY_BUFFER,this.uvBuffer),this.uvArray[2]=d.width/this.width,this.uvArray[5]=d.height/this.height,this.uvArray[6]=d.width/this.width,this.uvArray[7]=d.height/this.height,a.bufferSubData(a.ARRAY_BUFFER,0,this.uvArray);var h=e,i=this.texturePool.pop();i||(i=new b.FilterTexture(this.gl,this.width,this.height)),i.resize(this.width,this.height),a.bindFramebuffer(a.FRAMEBUFFER,i.frameBuffer),a.clear(a.COLOR_BUFFER_BIT),a.disable(a.BLEND);for(var j=0;jB?B:A,c.beginPath(),c.moveTo(w,x+A),c.lineTo(w,x+z-A),c.quadraticCurveTo(w,x+z,w+A,x+z),c.lineTo(w+y-A,x+z),c.quadraticCurveTo(w+y,x+z,w+y,x+z-A),c.lineTo(w+y,x+A),c.quadraticCurveTo(w+y,x,w+y-A,x),c.lineTo(w+A,x),c.quadraticCurveTo(w,x,w,x+A),c.closePath(),(f.fillColor||0===f.fillColor)&&(c.globalAlpha=f.fillAlpha*d,c.fillStyle="#"+("00000"+(0|h).toString(16)).substr(-6),c.fill()),f.lineWidth&&(c.globalAlpha=f.lineAlpha*d,c.strokeStyle="#"+("00000"+(0|i).toString(16)).substr(-6),c.stroke())}}},b.CanvasGraphics.renderGraphicsMask=function(a,c){var d=a.graphicsData.length;if(0!==d){d>1&&(d=1,window.console.log("Pixi.js warning: masks in canvas can only mask using the first path in the graphics object"));for(var e=0;1>e;e++){var f=a.graphicsData[e],g=f.shape;if(f.type===b.Graphics.POLY){c.beginPath();var h=g.points;c.moveTo(h[0],h[1]);for(var i=1;iA?A:z,c.beginPath(),c.moveTo(v,w+z),c.lineTo(v,w+y-z),c.quadraticCurveTo(v,w+y,v+z,w+y),c.lineTo(v+x-z,w+y),c.quadraticCurveTo(v+x,w+y,v+x,w+y-z),c.lineTo(v+x,w+z),c.quadraticCurveTo(v+x,w,v+x-z,w),c.lineTo(v+z,w),c.quadraticCurveTo(v,w,v,w+z),c.closePath()}}}},b.CanvasGraphics.updateGraphicsTint=function(a){if(16777215!==a.tint)for(var b=(a.tint>>16&255)/255,c=(a.tint>>8&255)/255,d=(255&a.tint)/255,e=0;e>16&255)/255*b*255<<16)+((g>>8&255)/255*c*255<<8)+(255&g)/255*d*255,f._lineTint=((h>>16&255)/255*b*255<<16)+((h>>8&255)/255*c*255<<8)+(255&h)/255*d*255}},b.Graphics=function(){b.DisplayObjectContainer.call(this),this.renderable=!0,this.fillAlpha=1,this.lineWidth=0,this.lineColor=0,this.graphicsData=[],this.tint=16777215,this.blendMode=b.blendModes.NORMAL,this.currentPath=null,this._webGL=[],this.isMask=!1,this.boundsPadding=0,this._localBounds=new b.Rectangle(0,0,1,1),this.dirty=!0,this.webGLDirty=!1,this.cachedSpriteDirty=!1},b.Graphics.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Graphics.prototype.constructor=b.Graphics,Object.defineProperty(b.Graphics.prototype,"cacheAsBitmap",{get:function(){return this._cacheAsBitmap},set:function(a){this._cacheAsBitmap=a,this._cacheAsBitmap?this._generateCachedSprite():(this.destroyCachedSprite(),this.dirty=!0)}}),b.Graphics.prototype.lineStyle=function(a,c,d){if(this.lineWidth=a||0,this.lineColor=c||0,this.lineAlpha=arguments.length<3?1:d,this.currentPath){if(this.currentPath.shape.points.length)return this.drawShape(new b.Polygon(this.currentPath.shape.points.slice(-2))),this;this.currentPath.lineWidth=this.lineWidth,this.currentPath.lineColor=this.lineColor,this.currentPath.lineAlpha=this.lineAlpha}return this},b.Graphics.prototype.moveTo=function(a,c){return this.drawShape(new b.Polygon([a,c])),this},b.Graphics.prototype.lineTo=function(a,b){return this.currentPath.shape.points.push(a,b),this.dirty=!0,this},b.Graphics.prototype.quadraticCurveTo=function(a,b,c,d){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);var e,f,g=20,h=this.currentPath.shape.points;0===h.length&&this.moveTo(0,0);for(var i=h[h.length-2],j=h[h.length-1],k=0,l=1;g>=l;l++)k=l/g,e=i+(a-i)*k,f=j+(b-j)*k,h.push(e+(a+(c-a)*k-e)*k,f+(b+(d-b)*k-f)*k);return this.dirty=!0,this},b.Graphics.prototype.bezierCurveTo=function(a,b,c,d,e,f){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);for(var g,h,i,j,k,l=20,m=this.currentPath.shape.points,n=m[m.length-2],o=m[m.length-1],p=0,q=1;l>=q;q++)p=q/l,g=1-p,h=g*g,i=h*g,j=p*p,k=j*p,m.push(i*n+3*h*p*a+3*g*j*c+k*e,i*o+3*h*p*b+3*g*j*d+k*f);return this.dirty=!0,this},b.Graphics.prototype.arcTo=function(a,b,c,d,e){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(a,b):this.moveTo(a,b);var f=this.currentPath.shape.points,g=f[f.length-2],h=f[f.length-1],i=h-b,j=g-a,k=d-b,l=c-a,m=Math.abs(i*l-j*k);if(1e-8>m||0===e)(f[f.length-2]!==a||f[f.length-1]!==b)&&f.push(a,b);else{var n=i*i+j*j,o=k*k+l*l,p=i*k+j*l,q=e*Math.sqrt(n)/m,r=e*Math.sqrt(o)/m,s=q*p/n,t=r*p/o,u=q*l+r*j,v=q*k+r*i,w=j*(r+s),x=i*(r+s),y=l*(q+t),z=k*(q+t),A=Math.atan2(x-v,w-u),B=Math.atan2(z-v,y-u);this.arc(u+a,v+b,e,A,B,j*k>l*i)}return this.dirty=!0,this},b.Graphics.prototype.arc=function(a,b,c,d,e,f){var g,h=a+Math.cos(d)*c,i=b+Math.sin(d)*c;if(this.currentPath?(g=this.currentPath.shape.points,0===g.length?g.push(h,i):(g[g.length-2]!==h||g[g.length-1]!==i)&&g.push(h,i)):(this.moveTo(h,i),g=this.currentPath.shape.points),d===e)return this;!f&&d>=e?e+=2*Math.PI:f&&e>=d&&(d+=2*Math.PI);var j=f?-1*(d-e):e-d,k=Math.abs(j)/(2*Math.PI)*40;if(0===j)return this;for(var l=j/(2*k),m=2*l,n=Math.cos(l),o=Math.sin(l),p=k-1,q=p%1/p,r=0;p>=r;r++){var s=r+q*r,t=l+d+m*s,u=Math.cos(t),v=-Math.sin(t);g.push((n*u+o*v)*c+a,(n*-v+o*u)*c+b)}return this.dirty=!0,this},b.Graphics.prototype.beginFill=function(a,b){return this.filling=!0,this.fillColor=a||0,this.fillAlpha=void 0===b?1:b,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},b.Graphics.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},b.Graphics.prototype.drawRect=function(a,c,d,e){return this.drawShape(new b.Rectangle(a,c,d,e)),this},b.Graphics.prototype.drawRoundedRect=function(a,c,d,e,f){return this.drawShape(new b.RoundedRectangle(a,c,d,e,f)),this},b.Graphics.prototype.drawCircle=function(a,c,d){return this.drawShape(new b.Circle(a,c,d)),this},b.Graphics.prototype.drawEllipse=function(a,c,d,e){return this.drawShape(new b.Ellipse(a,c,d,e)),this},b.Graphics.prototype.drawPolygon=function(a){return a instanceof Array||(a=Array.prototype.slice.call(arguments)),this.drawShape(new b.Polygon(a)),this},b.Graphics.prototype.clear=function(){return this.lineWidth=0,this.filling=!1,this.dirty=!0,this.clearDirty=!0,this.graphicsData=[],this},b.Graphics.prototype.generateTexture=function(a,c){a=a||1;var d=this.getBounds(),e=new b.CanvasBuffer(d.width*a,d.height*a),f=b.Texture.fromCanvas(e.canvas,c);return f.baseTexture.resolution=a,e.context.scale(a,a),e.context.translate(-d.x,-d.y),b.CanvasGraphics.renderGraphics(this,e.context),f},b.Graphics.prototype._renderWebGL=function(a){if(this.visible!==!1&&0!==this.alpha&&this.isMask!==!0){if(this._cacheAsBitmap)return(this.dirty||this.cachedSpriteDirty)&&(this._generateCachedSprite(),this.updateCachedSpriteTexture(),this.cachedSpriteDirty=!1,this.dirty=!1),this._cachedSprite.worldAlpha=this.worldAlpha,void b.Sprite.prototype._renderWebGL.call(this._cachedSprite,a);if(a.spriteBatch.stop(),a.blendModeManager.setBlendMode(this.blendMode),this._mask&&a.maskManager.pushMask(this._mask,a),this._filters&&a.filterManager.pushFilter(this._filterBlock),this.blendMode!==a.spriteBatch.currentBlendMode){a.spriteBatch.currentBlendMode=this.blendMode;var c=b.blendModesWebGL[a.spriteBatch.currentBlendMode];a.spriteBatch.gl.blendFunc(c[0],c[1])}if(this.webGLDirty&&(this.dirty=!0,this.webGLDirty=!1),b.WebGLGraphics.renderGraphics(this,a),this.children.length){a.spriteBatch.start();for(var d=0,e=this.children.length;e>d;d++)this.children[d]._renderWebGL(a);a.spriteBatch.stop()}this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(this.mask,a),a.drawCount++,a.spriteBatch.start()}},b.Graphics.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha&&this.isMask!==!0){if(this._cacheAsBitmap)return(this.dirty||this.cachedSpriteDirty)&&(this._generateCachedSprite(),this.updateCachedSpriteTexture(),this.cachedSpriteDirty=!1,this.dirty=!1),this._cachedSprite.alpha=this.alpha,void b.Sprite.prototype._renderCanvas.call(this._cachedSprite,a);var c=a.context,d=this.worldTransform;this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,c.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]),this._mask&&a.maskManager.pushMask(this._mask,a);var e=a.resolution;c.setTransform(d.a*e,d.b*e,d.c*e,d.d*e,d.tx*e,d.ty*e),b.CanvasGraphics.renderGraphics(this,c);for(var f=0,g=this.children.length;g>f;f++)this.children[f]._renderCanvas(a);this._mask&&a.maskManager.popMask(a)}},b.Graphics.prototype.getBounds=function(a){if(this.isMask)return b.EmptyRectangle;this.dirty&&(this.updateLocalBounds(),this.webGLDirty=!0,this.cachedSpriteDirty=!0,this.dirty=!1);var c=this._localBounds,d=c.x,e=c.width+c.x,f=c.y,g=c.height+c.y,h=a||this.worldTransform,i=h.a,j=h.b,k=h.c,l=h.d,m=h.tx,n=h.ty,o=i*e+k*g+m,p=l*g+j*e+n,q=i*d+k*g+m,r=l*g+j*d+n,s=i*d+k*f+m,t=l*f+j*d+n,u=i*e+k*f+m,v=l*f+j*e+n,w=o,x=p,y=o,z=p;return y=y>q?q:y,y=y>s?s:y,y=y>u?u:y,z=z>r?r:z,z=z>t?t:z,z=z>v?v:z,w=q>w?q:w,w=s>w?s:w,w=u>w?u:w,x=r>x?r:x,x=t>x?t:x,x=v>x?v:x,this._bounds.x=y,this._bounds.width=w-y,this._bounds.y=z,this._bounds.height=x-z,this._bounds},b.Graphics.prototype.updateLocalBounds=function(){var a=1/0,c=-1/0,d=1/0,e=-1/0;if(this.graphicsData.length)for(var f,g,h,i,j,k,l=0;lh?h:a,c=h+j>c?h+j:c,d=d>i?i:d,e=i+k>e?i+k:e;else if(n===b.Graphics.CIRC)h=f.x,i=f.y,j=f.radius+o/2,k=f.radius+o/2,a=a>h-j?h-j:a,c=h+j>c?h+j:c,d=d>i-k?i-k:d,e=i+k>e?i+k:e;else if(n===b.Graphics.ELIP)h=f.x,i=f.y,j=f.width+o/2,k=f.height+o/2,a=a>h-j?h-j:a,c=h+j>c?h+j:c,d=d>i-k?i-k:d,e=i+k>e?i+k:e;else{g=f.points;for(var p=0;ph-o?h-o:a,c=h+o>c?h+o:c,d=d>i-o?i-o:d,e=i+o>e?i+o:e}}else a=0,c=0,d=0,e=0;var q=this.boundsPadding;this._localBounds.x=a-q,this._localBounds.width=c-a+2*q,this._localBounds.y=d-q,this._localBounds.height=e-d+2*q},b.Graphics.prototype._generateCachedSprite=function(){var a=this.getLocalBounds();if(this._cachedSprite)this._cachedSprite.buffer.resize(a.width,a.height);else{var c=new b.CanvasBuffer(a.width,a.height),d=b.Texture.fromCanvas(c.canvas);this._cachedSprite=new b.Sprite(d),this._cachedSprite.buffer=c,this._cachedSprite.worldTransform=this.worldTransform}this._cachedSprite.anchor.x=-(a.x/a.width),this._cachedSprite.anchor.y=-(a.y/a.height),this._cachedSprite.buffer.context.translate(-a.x,-a.y),this.worldAlpha=1,b.CanvasGraphics.renderGraphics(this,this._cachedSprite.buffer.context),this._cachedSprite.alpha=this.alpha},b.Graphics.prototype.updateCachedSpriteTexture=function(){var a=this._cachedSprite,b=a.texture,c=a.buffer.canvas;b.baseTexture.width=c.width,b.baseTexture.height=c.height,b.crop.width=b.frame.width=c.width,b.crop.height=b.frame.height=c.height,a._width=c.width,a._height=c.height,b.baseTexture.dirty()},b.Graphics.prototype.destroyCachedSprite=function(){this._cachedSprite.texture.destroy(!0),this._cachedSprite=null},b.Graphics.prototype.drawShape=function(a){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null;var c=new b.GraphicsData(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,a);return this.graphicsData.push(c),c.type===b.Graphics.POLY&&(c.shape.closed=this.filling,this.currentPath=c),this.dirty=!0,c},b.GraphicsData=function(a,b,c,d,e,f,g){this.lineWidth=a,this.lineColor=b,this.lineAlpha=c,this._lineTint=b,this.fillColor=d,this.fillAlpha=e,this._fillTint=d,this.fill=f,this.shape=g,this.type=g.type},b.Graphics.POLY=0,b.Graphics.RECT=1,b.Graphics.CIRC=2,b.Graphics.ELIP=3,b.Graphics.RREC=4,b.Polygon.prototype.type=b.Graphics.POLY,b.Rectangle.prototype.type=b.Graphics.RECT,b.Circle.prototype.type=b.Graphics.CIRC,b.Ellipse.prototype.type=b.Graphics.ELIP,b.RoundedRectangle.prototype.type=b.Graphics.RREC,b.Strip=function(a){b.DisplayObjectContainer.call(this),this.texture=a,this.uvs=new b.Float32Array([0,1,1,1,1,0,0,1]),this.vertices=new b.Float32Array([0,0,100,0,100,100,0,100]),this.colors=new b.Float32Array([1,1,1,1]),this.indices=new b.Uint16Array([0,1,2,3]),this.dirty=!0,this.blendMode=b.blendModes.NORMAL,this.canvasPadding=0,this.drawMode=b.Strip.DrawModes.TRIANGLE_STRIP},b.Strip.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Strip.prototype.constructor=b.Strip,b.Strip.prototype._renderWebGL=function(a){!this.visible||this.alpha<=0||(a.spriteBatch.stop(),this._vertexBuffer||this._initWebGL(a),a.shaderManager.setShader(a.shaderManager.stripShader),this._renderStrip(a),a.spriteBatch.start())},b.Strip.prototype._initWebGL=function(a){var b=a.gl;this._vertexBuffer=b.createBuffer(),this._indexBuffer=b.createBuffer(),this._uvBuffer=b.createBuffer(),this._colorBuffer=b.createBuffer(),b.bindBuffer(b.ARRAY_BUFFER,this._vertexBuffer),b.bufferData(b.ARRAY_BUFFER,this.vertices,b.DYNAMIC_DRAW),b.bindBuffer(b.ARRAY_BUFFER,this._uvBuffer),b.bufferData(b.ARRAY_BUFFER,this.uvs,b.STATIC_DRAW),b.bindBuffer(b.ARRAY_BUFFER,this._colorBuffer),b.bufferData(b.ARRAY_BUFFER,this.colors,b.STATIC_DRAW),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this._indexBuffer),b.bufferData(b.ELEMENT_ARRAY_BUFFER,this.indices,b.STATIC_DRAW)},b.Strip.prototype._renderStrip=function(a){var c=a.gl,d=a.projection,e=a.offset,f=a.shaderManager.stripShader,g=this.drawMode===b.Strip.DrawModes.TRIANGLE_STRIP?c.TRIANGLE_STRIP:c.TRIANGLES;a.blendModeManager.setBlendMode(this.blendMode),c.uniformMatrix3fv(f.translationMatrix,!1,this.worldTransform.toArray(!0)),c.uniform2f(f.projectionVector,d.x,-d.y),c.uniform2f(f.offsetVector,-e.x,-e.y),c.uniform1f(f.alpha,this.worldAlpha),this.dirty?(this.dirty=!1,c.bindBuffer(c.ARRAY_BUFFER,this._vertexBuffer),c.bufferData(c.ARRAY_BUFFER,this.vertices,c.STATIC_DRAW),c.vertexAttribPointer(f.aVertexPosition,2,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,this._uvBuffer),c.bufferData(c.ARRAY_BUFFER,this.uvs,c.STATIC_DRAW),c.vertexAttribPointer(f.aTextureCoord,2,c.FLOAT,!1,0,0),c.activeTexture(c.TEXTURE0),this.texture.baseTexture._dirty[c.id]?a.renderer.updateTexture(this.texture.baseTexture):c.bindTexture(c.TEXTURE_2D,this.texture.baseTexture._glTextures[c.id]),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this._indexBuffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,this.indices,c.STATIC_DRAW)):(c.bindBuffer(c.ARRAY_BUFFER,this._vertexBuffer),c.bufferSubData(c.ARRAY_BUFFER,0,this.vertices),c.vertexAttribPointer(f.aVertexPosition,2,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,this._uvBuffer),c.vertexAttribPointer(f.aTextureCoord,2,c.FLOAT,!1,0,0),c.activeTexture(c.TEXTURE0),this.texture.baseTexture._dirty[c.id]?a.renderer.updateTexture(this.texture.baseTexture):c.bindTexture(c.TEXTURE_2D,this.texture.baseTexture._glTextures[c.id]),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this._indexBuffer)),c.drawElements(g,this.indices.length,c.UNSIGNED_SHORT,0)},b.Strip.prototype._renderCanvas=function(a){var c=a.context,d=this.worldTransform;a.roundPixels?c.setTransform(d.a,d.b,d.c,d.d,0|d.tx,0|d.ty):c.setTransform(d.a,d.b,d.c,d.d,d.tx,d.ty),this.drawMode===b.Strip.DrawModes.TRIANGLE_STRIP?this._renderCanvasTriangleStrip(c):this._renderCanvasTriangles(c)},b.Strip.prototype._renderCanvasTriangleStrip=function(a){var b=this.vertices,c=this.uvs,d=b.length/2;this.count++;for(var e=0;d-2>e;e++){var f=2*e;this._renderCanvasDrawTriangle(a,b,c,f,f+2,f+4)}},b.Strip.prototype._renderCanvasTriangles=function(a){var b=this.vertices,c=this.uvs,d=this.indices,e=d.length;this.count++;for(var f=0;e>f;f+=3){var g=2*d[f],h=2*d[f+1],i=2*d[f+2];this._renderCanvasDrawTriangle(a,b,c,g,h,i)}},b.Strip.prototype._renderCanvasDrawTriangle=function(a,b,c,d,e,f){var g=this.texture.baseTexture.source,h=this.texture.width,i=this.texture.height,j=b[d],k=b[e],l=b[f],m=b[d+1],n=b[e+1],o=b[f+1],p=c[d]*h,q=c[e]*h,r=c[f]*h,s=c[d+1]*i,t=c[e+1]*i,u=c[f+1]*i;if(this.canvasPadding>0){var v=this.canvasPadding/this.worldTransform.a,w=this.canvasPadding/this.worldTransform.d,x=(j+k+l)/3,y=(m+n+o)/3,z=j-x,A=m-y,B=Math.sqrt(z*z+A*A);j=x+z/B*(B+v),m=y+A/B*(B+w),z=k-x,A=n-y,B=Math.sqrt(z*z+A*A),k=x+z/B*(B+v),n=y+A/B*(B+w),z=l-x,A=o-y,B=Math.sqrt(z*z+A*A),l=x+z/B*(B+v),o=y+A/B*(B+w)}a.save(),a.beginPath(),a.moveTo(j,m),a.lineTo(k,n),a.lineTo(l,o),a.closePath(),a.clip();var C=p*t+s*r+q*u-t*r-s*q-p*u,D=j*t+s*l+k*u-t*l-s*k-j*u,E=p*k+j*r+q*l-k*r-j*q-p*l,F=p*t*l+s*k*r+j*q*u-j*t*r-s*q*l-p*k*u,G=m*t+s*o+n*u-t*o-s*n-m*u,H=p*n+m*r+q*o-n*r-m*q-p*o,I=p*t*o+s*n*r+m*q*u-m*t*r-s*q*o-p*n*u;a.transform(D/C,G/C,E/C,H/C,F/C,I/C),a.drawImage(g,0,0),a.restore()},b.Strip.prototype.renderStripFlat=function(a){var b=this.context,c=a.vertices,d=c.length/2;this.count++,b.beginPath();for(var e=1;d-2>e;e++){var f=2*e,g=c[f],h=c[f+2],i=c[f+4],j=c[f+1],k=c[f+3],l=c[f+5];b.moveTo(g,j),b.lineTo(h,k),b.lineTo(i,l)}b.fillStyle="#FF0000",b.fill(),b.closePath()},b.Strip.prototype.onTextureUpdate=function(){this.updateFrame=!0},b.Strip.prototype.getBounds=function(a){for(var c=a||this.worldTransform,d=c.a,e=c.b,f=c.c,g=c.d,h=c.tx,i=c.ty,j=-1/0,k=-1/0,l=1/0,m=1/0,n=this.vertices,o=0,p=n.length;p>o;o+=2){var q=n[o],r=n[o+1],s=d*q+f*r+h,t=g*r+e*q+i;l=l>s?s:l,m=m>t?t:m,j=s>j?s:j,k=t>k?t:k}if(l===-1/0||1/0===k)return b.EmptyRectangle;var u=this._bounds;return u.x=l,u.width=j-l,u.y=m,u.height=k-m,this._currentBounds=u,u},b.Strip.DrawModes={TRIANGLE_STRIP:0,TRIANGLES:1},b.Rope=function(a,c){b.Strip.call(this,a),this.points=c,this.vertices=new b.Float32Array(4*c.length),this.uvs=new b.Float32Array(4*c.length),this.colors=new b.Float32Array(2*c.length),this.indices=new b.Uint16Array(2*c.length),this.refresh()},b.Rope.prototype=Object.create(b.Strip.prototype),b.Rope.prototype.constructor=b.Rope,b.Rope.prototype.refresh=function(){var a=this.points;if(!(a.length<1)){var b=this.uvs,c=a[0],d=this.indices,e=this.colors;this.count-=.2,b[0]=0,b[1]=0,b[2]=0,b[3]=1,e[0]=1,e[1]=1,d[0]=0,d[1]=1;for(var f,g,h,i=a.length,j=1;i>j;j++)f=a[j],g=4*j,h=j/(i-1),j%2?(b[g]=h,b[g+1]=0,b[g+2]=h,b[g+3]=1):(b[g]=h,b[g+1]=0,b[g+2]=h,b[g+3]=1),g=2*j,e[g]=1,e[g+1]=1,g=2*j,d[g]=g,d[g+1]=g+1,c=f}},b.Rope.prototype.updateTransform=function(){var a=this.points;if(!(a.length<1)){var c,d=a[0],e={x:0,y:0};this.count-=.2;for(var f,g,h,i,j,k=this.vertices,l=a.length,m=0;l>m;m++)f=a[m],g=4*m,c=m1&&(h=1),i=Math.sqrt(e.x*e.x+e.y*e.y),j=this.texture.height/2,e.x/=i,e.y/=i,e.x*=j,e.y*=j,k[g]=f.x+e.x,k[g+1]=f.y+e.y,k[g+2]=f.x-e.x,k[g+3]=f.y-e.y,d=f;b.DisplayObjectContainer.prototype.updateTransform.call(this)}},b.Rope.prototype.setTexture=function(a){this.texture=a},b.TilingSprite=function(a,c,d){b.Sprite.call(this,a),this._width=c||100,this._height=d||100,this.tileScale=new b.Point(1,1),this.tileScaleOffset=new b.Point(1,1),this.tilePosition=new b.Point(0,0),this.renderable=!0,this.tint=16777215,this.blendMode=b.blendModes.NORMAL},b.TilingSprite.prototype=Object.create(b.Sprite.prototype),b.TilingSprite.prototype.constructor=b.TilingSprite,Object.defineProperty(b.TilingSprite.prototype,"width",{get:function(){return this._width},set:function(a){this._width=a}}),Object.defineProperty(b.TilingSprite.prototype,"height",{get:function(){return this._height},set:function(a){this._height=a}}),b.TilingSprite.prototype.setTexture=function(a){this.texture!==a&&(this.texture=a,this.refreshTexture=!0,this.cachedTint=16777215)},b.TilingSprite.prototype._renderWebGL=function(a){if(this.visible!==!1&&0!==this.alpha){var b,c;for(this._mask&&(a.spriteBatch.stop(),a.maskManager.pushMask(this.mask,a),a.spriteBatch.start()),this._filters&&(a.spriteBatch.flush(),a.filterManager.pushFilter(this._filterBlock)),!this.tilingTexture||this.refreshTexture?(this.generateTilingTexture(!0),this.tilingTexture&&this.tilingTexture.needsUpdate&&(a.renderer.updateTexture(this.tilingTexture.baseTexture),this.tilingTexture.needsUpdate=!1)):a.spriteBatch.renderTilingSprite(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a); -a.spriteBatch.stop(),this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(this._mask,a),a.spriteBatch.start()}},b.TilingSprite.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){var c=a.context;this._mask&&a.maskManager.pushMask(this._mask,a),c.globalAlpha=this.worldAlpha;var d,e,f=this.worldTransform,g=a.resolution;if(c.setTransform(f.a*g,f.b*g,f.c*g,f.d*g,f.tx*g,f.ty*g),!this.__tilePattern||this.refreshTexture){if(this.generateTilingTexture(!1),!this.tilingTexture)return;this.__tilePattern=c.createPattern(this.tilingTexture.baseTexture.source,"repeat")}this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,c.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]);var h=this.tilePosition,i=this.tileScale;for(h.x%=this.tilingTexture.baseTexture.width,h.y%=this.tilingTexture.baseTexture.height,c.scale(i.x,i.y),c.translate(h.x+this.anchor.x*-this._width,h.y+this.anchor.y*-this._height),c.fillStyle=this.__tilePattern,c.fillRect(-h.x,-h.y,this._width/i.x,this._height/i.y),c.scale(1/i.x,1/i.y),c.translate(-h.x+this.anchor.x*this._width,-h.y+this.anchor.y*this._height),this._mask&&a.maskManager.popMask(a),d=0,e=this.children.length;e>d;d++)this.children[d]._renderCanvas(a)}},b.TilingSprite.prototype.getBounds=function(){var a=this._width,b=this._height,c=a*(1-this.anchor.x),d=a*-this.anchor.x,e=b*(1-this.anchor.y),f=b*-this.anchor.y,g=this.worldTransform,h=g.a,i=g.b,j=g.c,k=g.d,l=g.tx,m=g.ty,n=h*d+j*f+l,o=k*f+i*d+m,p=h*c+j*f+l,q=k*f+i*c+m,r=h*c+j*e+l,s=k*e+i*c+m,t=h*d+j*e+l,u=k*e+i*d+m,v=-1/0,w=-1/0,x=1/0,y=1/0;x=x>n?n:x,x=x>p?p:x,x=x>r?r:x,x=x>t?t:x,y=y>o?o:y,y=y>q?q:y,y=y>s?s:y,y=y>u?u:y,v=n>v?n:v,v=p>v?p:v,v=r>v?r:v,v=t>v?t:v,w=o>w?o:w,w=q>w?q:w,w=s>w?s:w,w=u>w?u:w;var z=this._bounds;return z.x=x,z.width=v-x,z.y=y,z.height=w-y,this._currentBounds=z,z},b.TilingSprite.prototype.onTextureUpdate=function(){},b.TilingSprite.prototype.generateTilingTexture=function(a){if(this.texture.baseTexture.hasLoaded){var c,d,e=this.originalTexture||this.texture,f=e.frame,g=f.width!==e.baseTexture.width||f.height!==e.baseTexture.height,h=!1;if(a?(c=b.getNextPowerOfTwo(f.width),d=b.getNextPowerOfTwo(f.height),(f.width!==c||f.height!==d||e.baseTexture.width!==c||e.baseTexture.height||d)&&(h=!0)):g&&(e.trim?(c=e.trim.width,d=e.trim.height):(c=f.width,d=f.height),h=!0),h){var i;this.tilingTexture&&this.tilingTexture.isTiling?(i=this.tilingTexture.canvasBuffer,i.resize(c,d),this.tilingTexture.baseTexture.width=c,this.tilingTexture.baseTexture.height=d,this.tilingTexture.needsUpdate=!0):(i=new b.CanvasBuffer(c,d),this.tilingTexture=b.Texture.fromCanvas(i.canvas),this.tilingTexture.canvasBuffer=i,this.tilingTexture.isTiling=!0),i.context.drawImage(e.baseTexture.source,e.crop.x,e.crop.y,e.crop.width,e.crop.height,0,0,c,d),this.tileScaleOffset.x=f.width/c,this.tileScaleOffset.y=f.height/d}else this.tilingTexture&&this.tilingTexture.isTiling&&this.tilingTexture.destroy(!0),this.tileScaleOffset.x=1,this.tileScaleOffset.y=1,this.tilingTexture=e;this.refreshTexture=!1,this.originalTexture=this.texture,this.texture=this.tilingTexture,this.tilingTexture.baseTexture._powerOf2=!0}},b.TilingSprite.prototype.destroy=function(){b.Sprite.prototype.destroy.call(this),this.tileScale=null,this.tileScaleOffset=null,this.tilePosition=null,this.tilingTexture.destroy(!0),this.tilingTexture=null};var c={radDeg:180/Math.PI,degRad:Math.PI/180,temp:[],Float32Array:"undefined"==typeof Float32Array?Array:Float32Array,Uint16Array:"undefined"==typeof Uint16Array?Array:Uint16Array};c.BoneData=function(a,b){this.name=a,this.parent=b},c.BoneData.prototype={length:0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,inheritScale:!0,inheritRotation:!0,flipX:!1,flipY:!1},c.SlotData=function(a,b){this.name=a,this.boneData=b},c.SlotData.prototype={r:1,g:1,b:1,a:1,attachmentName:null,additiveBlending:!1},c.IkConstraintData=function(a){this.name=a,this.bones=[]},c.IkConstraintData.prototype={target:null,bendDirection:1,mix:1},c.Bone=function(a,b,c){this.data=a,this.skeleton=b,this.parent=c,this.setToSetupPose()},c.Bone.yDown=!1,c.Bone.prototype={x:0,y:0,rotation:0,rotationIK:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,m00:0,m01:0,worldX:0,m10:0,m11:0,worldY:0,worldRotation:0,worldScaleX:1,worldScaleY:1,worldFlipX:!1,worldFlipY:!1,updateWorldTransform:function(){var a=this.parent;if(a)this.worldX=this.x*a.m00+this.y*a.m01+a.worldX,this.worldY=this.x*a.m10+this.y*a.m11+a.worldY,this.data.inheritScale?(this.worldScaleX=a.worldScaleX*this.scaleX,this.worldScaleY=a.worldScaleY*this.scaleY):(this.worldScaleX=this.scaleX,this.worldScaleY=this.scaleY),this.worldRotation=this.data.inheritRotation?a.worldRotation+this.rotationIK:this.rotationIK,this.worldFlipX=a.worldFlipX!=this.flipX,this.worldFlipY=a.worldFlipY!=this.flipY;else{var b=this.skeleton.flipX,d=this.skeleton.flipY;this.worldX=b?-this.x:this.x,this.worldY=d!=c.Bone.yDown?-this.y:this.y,this.worldScaleX=this.scaleX,this.worldScaleY=this.scaleY,this.worldRotation=this.rotationIK,this.worldFlipX=b!=this.flipX,this.worldFlipY=d!=this.flipY}var e=this.worldRotation*c.degRad,f=Math.cos(e),g=Math.sin(e);this.worldFlipX?(this.m00=-f*this.worldScaleX,this.m01=g*this.worldScaleY):(this.m00=f*this.worldScaleX,this.m01=-g*this.worldScaleY),this.worldFlipY!=c.Bone.yDown?(this.m10=-g*this.worldScaleX,this.m11=-f*this.worldScaleY):(this.m10=g*this.worldScaleX,this.m11=f*this.worldScaleY)},setToSetupPose:function(){var a=this.data;this.x=a.x,this.y=a.y,this.rotation=a.rotation,this.rotationIK=this.rotation,this.scaleX=a.scaleX,this.scaleY=a.scaleY,this.flipX=a.flipX,this.flipY=a.flipY},worldToLocal:function(a){var b=a[0]-this.worldX,d=a[1]-this.worldY,e=this.m00,f=this.m10,g=this.m01,h=this.m11;this.worldFlipX!=(this.worldFlipY!=c.Bone.yDown)&&(e=-e,h=-h);var i=1/(e*h-g*f);a[0]=b*e*i-d*g*i,a[1]=d*h*i-b*f*i},localToWorld:function(a){var b=a[0],c=a[1];a[0]=b*this.m00+c*this.m01+this.worldX,a[1]=b*this.m10+c*this.m11+this.worldY}},c.Slot=function(a,b){this.data=a,this.bone=b,this.setToSetupPose()},c.Slot.prototype={r:1,g:1,b:1,a:1,_attachmentTime:0,attachment:null,attachmentVertices:[],setAttachment:function(a){this.attachment=a,this._attachmentTime=this.bone.skeleton.time,this.attachmentVertices.length=0},setAttachmentTime:function(a){this._attachmentTime=this.bone.skeleton.time-a},getAttachmentTime:function(){return this.bone.skeleton.time-this._attachmentTime},setToSetupPose:function(){var a=this.data;this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a;for(var b=this.bone.skeleton.data.slots,c=0,d=b.length;d>c;c++)if(b[c]==a){this.setAttachment(a.attachmentName?this.bone.skeleton.getAttachmentBySlotIndex(c,a.attachmentName):null);break}}},c.IkConstraint=function(a,b){this.data=a,this.mix=a.mix,this.bendDirection=a.bendDirection,this.bones=[];for(var c=0,d=a.bones.length;d>c;c++)this.bones.push(b.findBone(a.bones[c].name));this.target=b.findBone(a.target.name)},c.IkConstraint.prototype={apply:function(){var a=this.target,b=this.bones;switch(b.length){case 1:c.IkConstraint.apply1(b[0],a.worldX,a.worldY,this.mix);break;case 2:c.IkConstraint.apply2(b[0],b[1],a.worldX,a.worldY,this.bendDirection,this.mix)}}},c.IkConstraint.apply1=function(a,b,d,e){var f=a.data.inheritRotation&&a.parent?a.parent.worldRotation:0,g=a.rotation,h=Math.atan2(d-a.worldY,b-a.worldX)*c.radDeg-f;a.rotationIK=g+(h-g)*e},c.IkConstraint.apply2=function(a,b,d,e,f,g){var h=b.rotation,i=a.rotation;if(!g)return b.rotationIK=h,void(a.rotationIK=i);var j,k,l=c.temp,m=a.parent;m?(l[0]=d,l[1]=e,m.worldToLocal(l),d=(l[0]-a.x)*m.worldScaleX,e=(l[1]-a.y)*m.worldScaleY):(d-=a.x,e-=a.y),b.parent==a?(j=b.x,k=b.y):(l[0]=b.x,l[1]=b.y,b.parent.localToWorld(l),a.worldToLocal(l),j=l[0],k=l[1]);var n=j*a.worldScaleX,o=k*a.worldScaleY,p=Math.atan2(o,n),q=Math.sqrt(n*n+o*o),r=b.data.length*b.worldScaleX,s=2*q*r;if(1e-4>s)return void(b.rotationIK=h+(Math.atan2(e,d)*c.radDeg-i-h)*g);var t=(d*d+e*e-q*q-r*r)/s;-1>t?t=-1:t>1&&(t=1);var u=Math.acos(t)*f,v=q+r*t,w=r*Math.sin(u),x=Math.atan2(e*v-d*w,d*v+e*w),y=(x-p)*c.radDeg-i;y>180?y-=360:-180>y&&(y+=360),a.rotationIK=i+y*g,y=(u+p)*c.radDeg-h,y>180?y-=360:-180>y&&(y+=360),b.rotationIK=h+(y+a.worldRotation-b.parent.worldRotation)*g},c.Skin=function(a){this.name=a,this.attachments={}},c.Skin.prototype={addAttachment:function(a,b,c){this.attachments[a+":"+b]=c},getAttachment:function(a,b){return this.attachments[a+":"+b]},_attachAll:function(a,b){for(var c in b.attachments){var d=c.indexOf(":"),e=parseInt(c.substring(0,d)),f=c.substring(d+1),g=a.slots[e];if(g.attachment&&g.attachment.name==f){var h=this.getAttachment(e,f);h&&g.setAttachment(h)}}}},c.Animation=function(a,b,c){this.name=a,this.timelines=b,this.duration=c},c.Animation.prototype={apply:function(a,b,c,d,e){d&&0!=this.duration&&(c%=this.duration,b%=this.duration);for(var f=this.timelines,g=0,h=f.length;h>g;g++)f[g].apply(a,b,c,e,1)},mix:function(a,b,c,d,e,f){d&&0!=this.duration&&(c%=this.duration,b%=this.duration);for(var g=this.timelines,h=0,i=g.length;i>h;h++)g[h].apply(a,b,c,e,f)}},c.Animation.binarySearch=function(a,b,c){var d=0,e=Math.floor(a.length/c)-2;if(!e)return c;for(var f=e>>>1;;){if(a[(f+1)*c]<=b?d=f+1:e=f,d==e)return(d+1)*c;f=d+e>>>1}},c.Animation.binarySearch1=function(a,b){var c=0,d=a.length-2;if(!d)return 1;for(var e=d>>>1;;){if(a[e+1]<=b?c=e+1:d=e,c==d)return c+1;e=c+d>>>1}},c.Animation.linearSearch=function(a,b,c){for(var d=0,e=a.length-c;e>=d;d+=c)if(a[d]>b)return d;return-1},c.Curves=function(){this.curves=[]},c.Curves.prototype={setLinear:function(a){this.curves[19*a]=0},setStepped:function(a){this.curves[19*a]=1},setCurve:function(a,b,c,d,e){var f=.1,g=f*f,h=g*f,i=3*f,j=3*g,k=6*g,l=6*h,m=2*-b+d,n=2*-c+e,o=3*(b-d)+1,p=3*(c-e)+1,q=b*i+m*j+o*h,r=c*i+n*j+p*h,s=m*k+o*l,t=n*k+p*l,u=o*l,v=p*l,w=19*a,x=this.curves;x[w++]=2;for(var y=q,z=r,A=w+19-1;A>w;w+=2)x[w]=y,x[w+1]=z,q+=s,r+=t,s+=u,t+=v,y+=q,z+=r},getCurvePercent:function(a,b){b=0>b?0:b>1?1:b;var c=this.curves,d=19*a,e=c[d];if(0===e)return b;if(1==e)return 0;d++;for(var f=0,g=d,h=d+19-1;h>d;d+=2)if(f=c[d],f>=b){var i,j;return d==g?(i=0,j=0):(i=c[d-2],j=c[d-1]),j+(c[d+1]-j)*(b-i)/(f-i)}var k=c[d-1];return k+(1-k)*(b-f)/(1-f)}},c.RotateTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=2*a},c.RotateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(a,b,c){a*=2,this.frames[a]=b,this.frames[a+1]=c},apply:function(a,b,d,e,f){var g=this.frames;if(!(d=g[g.length-2]){for(var i=h.data.rotation+g[g.length-1]-h.rotation;i>180;)i-=360;for(;-180>i;)i+=360;return void(h.rotation+=i*f)}var j=c.Animation.binarySearch(g,d,2),k=g[j-1],l=g[j],m=1-(d-l)/(g[j-2]-l);m=this.curves.getCurvePercent(j/2-1,m);for(var i=g[j+1]-k;i>180;)i-=360;for(;-180>i;)i+=360;for(i=h.data.rotation+(k+i*m)-h.rotation;i>180;)i-=360;for(;-180>i;)i+=360;h.rotation+=i*f}}},c.TranslateTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=3*a},c.TranslateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(a,b,c,d){a*=3,this.frames[a]=b,this.frames[a+1]=c,this.frames[a+2]=d},apply:function(a,b,d,e,f){var g=this.frames;if(!(d=g[g.length-3])return h.x+=(h.data.x+g[g.length-2]-h.x)*f,void(h.y+=(h.data.y+g[g.length-1]-h.y)*f);var i=c.Animation.binarySearch(g,d,3),j=g[i-2],k=g[i-1],l=g[i],m=1-(d-l)/(g[i+-3]-l);m=this.curves.getCurvePercent(i/3-1,m),h.x+=(h.data.x+j+(g[i+1]-j)*m-h.x)*f,h.y+=(h.data.y+k+(g[i+2]-k)*m-h.y)*f}}},c.ScaleTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=3*a},c.ScaleTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(a,b,c,d){a*=3,this.frames[a]=b,this.frames[a+1]=c,this.frames[a+2]=d},apply:function(a,b,d,e,f){var g=this.frames;if(!(d=g[g.length-3])return h.scaleX+=(h.data.scaleX*g[g.length-2]-h.scaleX)*f,void(h.scaleY+=(h.data.scaleY*g[g.length-1]-h.scaleY)*f);var i=c.Animation.binarySearch(g,d,3),j=g[i-2],k=g[i-1],l=g[i],m=1-(d-l)/(g[i+-3]-l);m=this.curves.getCurvePercent(i/3-1,m),h.scaleX+=(h.data.scaleX*(j+(g[i+1]-j)*m)-h.scaleX)*f,h.scaleY+=(h.data.scaleY*(k+(g[i+2]-k)*m)-h.scaleY)*f}}},c.ColorTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=5*a},c.ColorTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/5},setFrame:function(a,b,c,d,e,f){a*=5,this.frames[a]=b,this.frames[a+1]=c,this.frames[a+2]=d,this.frames[a+3]=e,this.frames[a+4]=f},apply:function(a,b,d,e,f){var g=this.frames;if(!(d=g[g.length-5]){var l=g.length-1;h=g[l-3],i=g[l-2],j=g[l-1],k=g[l]}else{var m=c.Animation.binarySearch(g,d,5),n=g[m-4],o=g[m-3],p=g[m-2],q=g[m-1],r=g[m],s=1-(d-r)/(g[m-5]-r);s=this.curves.getCurvePercent(m/5-1,s),h=n+(g[m+1]-n)*s,i=o+(g[m+2]-o)*s,j=p+(g[m+3]-p)*s,k=q+(g[m+4]-q)*s}var t=a.slots[this.slotIndex];1>f?(t.r+=(h-t.r)*f,t.g+=(i-t.g)*f,t.b+=(j-t.b)*f,t.a+=(k-t.a)*f):(t.r=h,t.g=i,t.b=j,t.a=k)}}},c.AttachmentTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=a,this.attachmentNames=[],this.attachmentNames.length=a},c.AttachmentTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length},setFrame:function(a,b,c){this.frames[a]=b,this.attachmentNames[a]=c},apply:function(a,b,d){var e=this.frames;if(dd&&this.apply(a,b,Number.MAX_VALUE,null,0));b>d&&(b=-1);var f=d>=e[e.length-1]?e.length-1:c.Animation.binarySearch1(e,d)-1;if(!(e[f]d)this.apply(a,b,Number.MAX_VALUE,e,f),b=-1;else if(b>=g[h-1])return;if(!(d0&&g[i-1]==j;)i--}for(var k=this.events;h>i&&d>=g[i];i++)e.push(k[i])}}}},c.DrawOrderTimeline=function(a){this.frames=[],this.frames.length=a,this.drawOrders=[],this.drawOrders.length=a},c.DrawOrderTimeline.prototype={getFrameCount:function(){return this.frames.length},setFrame:function(a,b,c){this.frames[a]=b,this.drawOrders[a]=c},apply:function(a,b,d){var e=this.frames;if(!(d=e[e.length-1]?e.length-1:c.Animation.binarySearch1(e,d)-1;var g=a.drawOrder,h=a.slots,i=this.drawOrders[f];if(i)for(var j=0,k=i.length;k>j;j++)g[j]=a.slots[i[j]];else for(var j=0,k=h.length;k>j;j++)g[j]=h[j]}}},c.FfdTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=a,this.frameVertices=[],this.frameVertices.length=a},c.FfdTimeline.prototype={slotIndex:0,attachment:0,getFrameCount:function(){return this.frames.length},setFrame:function(a,b,c){this.frames[a]=b,this.frameVertices[a]=c},apply:function(a,b,d,e,f){var g=a.slots[this.slotIndex];if(g.attachment==this.attachment){var h=this.frames;if(!(d=h[h.length-1]){var l=i[h.length-1];if(1>f)for(var m=0;j>m;m++)k[m]+=(l[m]-k[m])*f;else for(var m=0;j>m;m++)k[m]=l[m]}else{var n=c.Animation.binarySearch1(h,d),o=h[n],p=1-(d-o)/(h[n-1]-o);p=this.curves.getCurvePercent(n-1,0>p?0:p>1?1:p);var q=i[n-1],r=i[n];if(1>f)for(var m=0;j>m;m++){var s=q[m];k[m]+=(s+(r[m]-s)*p-k[m])*f}else for(var m=0;j>m;m++){var s=q[m];k[m]=s+(r[m]-s)*p}}}}}},c.IkConstraintTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=3*a},c.IkConstraintTimeline.prototype={ikConstraintIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(a,b,c,d){a*=3,this.frames[a]=b,this.frames[a+1]=c,this.frames[a+2]=d},apply:function(a,b,d,e,f){var g=this.frames;if(!(d=g[g.length-3])return h.mix+=(g[g.length-2]-h.mix)*f,void(h.bendDirection=g[g.length-1]);var i=c.Animation.binarySearch(g,d,3),j=g[i+-2],k=g[i],l=1-(d-k)/(g[i+-3]-k);l=this.curves.getCurvePercent(i/3-1,l);var m=j+(g[i+1]-j)*l;h.mix+=(m-h.mix)*f,h.bendDirection=g[i+-1]}}},c.FlipXTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=2*a},c.FlipXTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(a,b,c){a*=2,this.frames[a]=b,this.frames[a+1]=c?1:0},apply:function(a,b,d){var e=this.frames;if(dd&&this.apply(a,b,Number.MAX_VALUE,null,0));b>d&&(b=-1);var f=(d>=e[e.length-2]?e.length:c.Animation.binarySearch(e,d,2))-2;e[f]d&&this.apply(a,b,Number.MAX_VALUE,null,0));b>d&&(b=-1);var f=(d>=e[e.length-2]?e.length:c.Animation.binarySearch(e,d,2))-2;e[f]c;c++)if(b[c].name==a)return b[c];return null},findBoneIndex:function(a){for(var b=this.bones,c=0,d=b.length;d>c;c++)if(b[c].name==a)return c;return-1},findSlot:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].name==a)return slot[c];return null},findSlotIndex:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].name==a)return c;return-1},findSkin:function(a){for(var b=this.skins,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},findEvent:function(a){for(var b=this.events,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},findAnimation:function(a){for(var b=this.animations,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},findIkConstraint:function(a){for(var b=this.ikConstraints,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null}},c.Skeleton=function(a){this.data=a,this.bones=[];for(var b=0,d=a.bones.length;d>b;b++){var e=a.bones[b],f=e.parent?this.bones[a.bones.indexOf(e.parent)]:null;this.bones.push(new c.Bone(e,this,f))}this.slots=[],this.drawOrder=[];for(var b=0,d=a.slots.length;d>b;b++){var g=a.slots[b],h=this.bones[a.bones.indexOf(g.boneData)],i=new c.Slot(g,h);this.slots.push(i),this.drawOrder.push(i)}this.ikConstraints=[];for(var b=0,d=a.ikConstraints.length;d>b;b++)this.ikConstraints.push(new c.IkConstraint(a.ikConstraints[b],this));this.boneCache=[],this.updateCache()},c.Skeleton.prototype={x:0,y:0,skin:null,r:1,g:1,b:1,a:1,time:0,flipX:!1,flipY:!1,updateCache:function(){var a=this.ikConstraints,b=a.length,c=b+1,d=this.boneCache;d.length>c&&(d.length=c);for(var e=0,f=d.length;f>e;e++)d[e].length=0;for(;d.lengthe;e++){var i=h[e],j=i;do{for(var k=0;b>k;k++)for(var l=a[k],m=l.bones[0],n=l.bones[l.bones.length-1];;){if(j==n){d[k].push(i),d[k+1].push(i);continue a}if(n==m)break;n=n.parent}j=j.parent}while(j);g[g.length]=i}},updateWorldTransform:function(){for(var a=this.bones,b=0,c=a.length;c>b;b++){var d=a[b];d.rotationIK=d.rotation}for(var b=0,e=this.boneCache.length-1;;){for(var f=this.boneCache[b],g=0,h=f.length;h>g;g++)f[g].updateWorldTransform();if(b==e)break;this.ikConstraints[b].apply(),b++}},setToSetupPose:function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},setBonesToSetupPose:function(){for(var a=this.bones,b=0,c=a.length;c>b;b++)a[b].setToSetupPose();for(var d=this.ikConstraints,b=0,c=d.length;c>b;b++){var e=d[b];e.bendDirection=e.data.bendDirection,e.mix=e.data.mix}},setSlotsToSetupPose:function(){for(var a=this.slots,b=this.drawOrder,c=0,d=a.length;d>c;c++)b[c]=a[c],a[c].setToSetupPose(c)},getRootBone:function(){return this.bones.length?this.bones[0]:null},findBone:function(a){for(var b=this.bones,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return b[c];return null},findBoneIndex:function(a){for(var b=this.bones,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return c;return-1},findSlot:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return b[c];return null},findSlotIndex:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return c;return-1},setSkinByName:function(a){var b=this.data.findSkin(a);if(!b)throw"Skin not found: "+a;this.setSkin(b)},setSkin:function(a){if(a)if(this.skin)a._attachAll(this,this.skin);else for(var b=this.slots,c=0,d=b.length;d>c;c++){var e=b[c],f=e.data.attachmentName;if(f){var g=a.getAttachment(c,f);g&&e.setAttachment(g)}}this.skin=a},getAttachmentBySlotName:function(a,b){return this.getAttachmentBySlotIndex(this.data.findSlotIndex(a),b)},getAttachmentBySlotIndex:function(a,b){if(this.skin){var c=this.skin.getAttachment(a,b);if(c)return c}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(a,b):null},setAttachment:function(a,b){for(var c=this.slots,d=0,e=c.length;e>d;d++){var f=c[d];if(f.data.name==a){var g=null;if(b&&(g=this.getAttachmentBySlotIndex(d,b),!g))throw"Attachment not found: "+b+", for slot: "+a;return void f.setAttachment(g)}}throw"Slot not found: "+a},findIkConstraint:function(a){for(var b=this.ikConstraints,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return b[c];return null},update:function(a){this.time+=a}},c.EventData=function(a){this.name=a},c.EventData.prototype={intValue:0,floatValue:0,stringValue:null},c.Event=function(a){this.data=a},c.Event.prototype={intValue:0,floatValue:0,stringValue:null},c.AttachmentType={region:0,boundingbox:1,mesh:2,skinnedmesh:3},c.RegionAttachment=function(a){this.name=a,this.offset=[],this.offset.length=8,this.uvs=[],this.uvs.length=8},c.RegionAttachment.prototype={type:c.AttachmentType.region,x:0,y:0,rotation:0,scaleX:1,scaleY:1,width:0,height:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,setUVs:function(a,b,c,d,e){var f=this.uvs;e?(f[2]=a,f[3]=d,f[4]=a,f[5]=b,f[6]=c,f[7]=b,f[0]=c,f[1]=d):(f[0]=a,f[1]=d,f[2]=a,f[3]=b,f[4]=c,f[5]=b,f[6]=c,f[7]=d)},updateOffset:function(){var a=this.width/this.regionOriginalWidth*this.scaleX,b=this.height/this.regionOriginalHeight*this.scaleY,d=-this.width/2*this.scaleX+this.regionOffsetX*a,e=-this.height/2*this.scaleY+this.regionOffsetY*b,f=d+this.regionWidth*a,g=e+this.regionHeight*b,h=this.rotation*c.degRad,i=Math.cos(h),j=Math.sin(h),k=d*i+this.x,l=d*j,m=e*i+this.y,n=e*j,o=f*i+this.x,p=f*j,q=g*i+this.y,r=g*j,s=this.offset;s[0]=k-n,s[1]=m+l,s[2]=k-r,s[3]=q+l,s[4]=o-r,s[5]=q+p,s[6]=o-n,s[7]=m+p},computeVertices:function(a,b,c,d){a+=c.worldX,b+=c.worldY;var e=c.m00,f=c.m01,g=c.m10,h=c.m11,i=this.offset;d[0]=i[0]*e+i[1]*f+a,d[1]=i[0]*g+i[1]*h+b,d[2]=i[2]*e+i[3]*f+a,d[3]=i[2]*g+i[3]*h+b,d[4]=i[4]*e+i[5]*f+a,d[5]=i[4]*g+i[5]*h+b,d[6]=i[6]*e+i[7]*f+a,d[7]=i[6]*g+i[7]*h+b}},c.MeshAttachment=function(a){this.name=a},c.MeshAttachment.prototype={type:c.AttachmentType.mesh,vertices:null,uvs:null,regionUVs:null,triangles:null,hullLength:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,regionU:0,regionV:0,regionU2:0,regionV2:0,regionRotate:!1,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,edges:null,width:0,height:0,updateUVs:function(){var a=this.regionU2-this.regionU,b=this.regionV2-this.regionV,d=this.regionUVs.length;if(this.uvs&&this.uvs.length==d||(this.uvs=new c.Float32Array(d)),this.regionRotate)for(var e=0;d>e;e+=2)this.uvs[e]=this.regionU+this.regionUVs[e+1]*a,this.uvs[e+1]=this.regionV+b-this.regionUVs[e]*b;else for(var e=0;d>e;e+=2)this.uvs[e]=this.regionU+this.regionUVs[e]*a,this.uvs[e+1]=this.regionV+this.regionUVs[e+1]*b},computeWorldVertices:function(a,b,c,d){var e=c.bone;a+=e.worldX,b+=e.worldY;var f=e.m00,g=e.m01,h=e.m10,i=e.m11,j=this.vertices,k=j.length;c.attachmentVertices.length==k&&(j=c.attachmentVertices);for(var l=0;k>l;l+=2){var m=j[l],n=j[l+1];d[l]=m*f+n*g+a,d[l+1]=m*h+n*i+b}}},c.SkinnedMeshAttachment=function(a){this.name=a},c.SkinnedMeshAttachment.prototype={type:c.AttachmentType.skinnedmesh,bones:null,weights:null,uvs:null,regionUVs:null,triangles:null,hullLength:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,regionU:0,regionV:0,regionU2:0,regionV2:0,regionRotate:!1,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,edges:null,width:0,height:0,updateUVs:function(){var a=this.regionU2-this.regionU,b=this.regionV2-this.regionV,d=this.regionUVs.length;if(this.uvs&&this.uvs.length==d||(this.uvs=new c.Float32Array(d)),this.regionRotate)for(var e=0;d>e;e+=2)this.uvs[e]=this.regionU+this.regionUVs[e+1]*a,this.uvs[e+1]=this.regionV+b-this.regionUVs[e]*b;else for(var e=0;d>e;e+=2)this.uvs[e]=this.regionU+this.regionUVs[e]*a,this.uvs[e+1]=this.regionV+this.regionUVs[e+1]*b},computeWorldVertices:function(a,b,c,d){var e,f,g,h,i,j,k,l=c.bone.skeleton.bones,m=this.weights,n=this.bones,o=0,p=0,q=0,r=0,s=n.length;if(c.attachmentVertices.length)for(var t=c.attachmentVertices;s>p;o+=2){for(f=0,g=0,e=n[p++]+p;e>p;p++,q+=3,r+=2)h=l[n[p]],i=m[q]+t[r],j=m[q+1]+t[r+1],k=m[q+2],f+=(i*h.m00+j*h.m01+h.worldX)*k,g+=(i*h.m10+j*h.m11+h.worldY)*k;d[o]=f+a,d[o+1]=g+b}else for(;s>p;o+=2){for(f=0,g=0,e=n[p++]+p;e>p;p++,q+=3)h=l[n[p]],i=m[q],j=m[q+1],k=m[q+2],f+=(i*h.m00+j*h.m01+h.worldX)*k,g+=(i*h.m10+j*h.m11+h.worldY)*k;d[o]=f+a,d[o+1]=g+b}}},c.BoundingBoxAttachment=function(a){this.name=a,this.vertices=[]},c.BoundingBoxAttachment.prototype={type:c.AttachmentType.boundingbox,computeWorldVertices:function(a,b,c,d){a+=c.worldX,b+=c.worldY;for(var e=c.m00,f=c.m01,g=c.m10,h=c.m11,i=this.vertices,j=0,k=i.length;k>j;j+=2){var l=i[j],m=i[j+1];d[j]=l*e+m*f+a,d[j+1]=l*g+m*h+b}}},c.AnimationStateData=function(a){this.skeletonData=a,this.animationToMixTime={}},c.AnimationStateData.prototype={defaultMix:0,setMixByName:function(a,b,c){var d=this.skeletonData.findAnimation(a);if(!d)throw"Animation not found: "+a;var e=this.skeletonData.findAnimation(b);if(!e)throw"Animation not found: "+b;this.setMix(d,e,c)},setMix:function(a,b,c){this.animationToMixTime[a.name+":"+b.name]=c},getMix:function(a,b){var c=a.name+":"+b.name;return this.animationToMixTime.hasOwnProperty(c)?this.animationToMixTime[c]:this.defaultMix}},c.TrackEntry=function(){},c.TrackEntry.prototype={next:null,previous:null,animation:null,loop:!1,delay:0,time:0,lastTime:-1,endTime:0,timeScale:1,mixTime:0,mixDuration:0,mix:1,onStart:null,onEnd:null,onComplete:null,onEvent:null},c.AnimationState=function(a){this.data=a,this.tracks=[],this.events=[]},c.AnimationState.prototype={onStart:null,onEnd:null,onComplete:null,onEvent:null,timeScale:1,update:function(a){a*=this.timeScale;for(var b=0;b=0&&this.setCurrent(b,e)):!c.loop&&c.lastTime>=c.endTime&&this.clearTrack(b)}}},apply:function(a){for(var b=0;bf&&(d=f);var h=c.previous;if(h){var i=h.time;!h.loop&&i>h.endTime&&(i=h.endTime),h.animation.apply(a,i,i,h.loop,null);var j=c.mixTime/c.mixDuration*c.mix;j>=1&&(j=1,c.previous=null),c.animation.mix(a,c.lastTime,d,g,this.events,j)}else 1==c.mix?c.animation.apply(a,c.lastTime,d,g,this.events):c.animation.mix(a,c.lastTime,d,g,this.events,c.mix);for(var k=0,l=this.events.length;l>k;k++){var m=this.events[k];c.onEvent&&c.onEvent(b,m),this.onEvent&&this.onEvent(b,m)}if(g?e%f>d%f:f>e&&d>=f){var n=Math.floor(d/f);c.onComplete&&c.onComplete(b,n),this.onComplete&&this.onComplete(b,n)}c.lastTime=c.time}}},clearTracks:function(){for(var a=0,b=this.tracks.length;b>a;a++)this.clearTrack(a);this.tracks.length=0},clearTrack:function(a){if(!(a>=this.tracks.length)){var b=this.tracks[a];b&&(b.onEnd&&b.onEnd(a),this.onEnd&&this.onEnd(a),this.tracks[a]=null)}},_expandToIndex:function(a){if(a=this.tracks.length;)this.tracks.push(null);return null},setCurrent:function(a,b){var c=this._expandToIndex(a);if(c){var d=c.previous;c.previous=null,c.onEnd&&c.onEnd(a),this.onEnd&&this.onEnd(a),b.mixDuration=this.data.getMix(c.animation,b.animation),b.mixDuration>0&&(b.mixTime=0,b.previous=d&&c.mixTime/c.mixDuration<.5?d:c)}this.tracks[a]=b,b.onStart&&b.onStart(a),this.onStart&&this.onStart(a)},setAnimationByName:function(a,b,c){var d=this.data.skeletonData.findAnimation(b);if(!d)throw"Animation not found: "+b;return this.setAnimation(a,d,c)},setAnimation:function(a,b,d){var e=new c.TrackEntry;return e.animation=b,e.loop=d,e.endTime=b.duration,this.setCurrent(a,e),e},addAnimationByName:function(a,b,c,d){var e=this.data.skeletonData.findAnimation(b);if(!e)throw"Animation not found: "+b;return this.addAnimation(a,e,c,d)},addAnimation:function(a,b,d,e){var f=new c.TrackEntry;f.animation=b,f.loop=d,f.endTime=b.duration;var g=this._expandToIndex(a);if(g){for(;g.next;)g=g.next;g.next=f}else this.tracks[a]=f;return 0>=e&&(g?e+=g.endTime-this.data.getMix(g.animation,b):e=0),f.delay=e,f},getCurrent:function(a){return a>=this.tracks.length?null:this.tracks[a]}},c.SkeletonJson=function(a){this.attachmentLoader=a},c.SkeletonJson.prototype={scale:1,readSkeletonData:function(a,b){var d=new c.SkeletonData;d.name=b;var e=a.skeleton;e&&(d.hash=e.hash,d.version=e.spine,d.width=e.width||0,d.height=e.height||0);for(var f=a.bones,g=0,h=f.length;h>g;g++){var i=f[g],j=null;if(i.parent&&(j=d.findBone(i.parent),!j))throw"Parent bone not found: "+i.parent;var k=new c.BoneData(i.name,j);k.length=(i.length||0)*this.scale,k.x=(i.x||0)*this.scale,k.y=(i.y||0)*this.scale,k.rotation=i.rotation||0,k.scaleX=i.hasOwnProperty("scaleX")?i.scaleX:1,k.scaleY=i.hasOwnProperty("scaleY")?i.scaleY:1,k.inheritScale=i.hasOwnProperty("inheritScale")?i.inheritScale:!0,k.inheritRotation=i.hasOwnProperty("inheritRotation")?i.inheritRotation:!0,d.bones.push(k)}var l=a.ik;if(l)for(var g=0,h=l.length;h>g;g++){for(var m=l[g],n=new c.IkConstraintData(m.name),f=m.bones,o=0,p=f.length;p>o;o++){var q=d.findBone(f[o]);if(!q)throw"IK bone not found: "+f[o];n.bones.push(q)}if(n.target=d.findBone(m.target),!n.target)throw"Target bone not found: "+m.target;n.bendDirection=!m.hasOwnProperty("bendPositive")||m.bendPositive?1:-1,n.mix=m.hasOwnProperty("mix")?m.mix:1,d.ikConstraints.push(n)}for(var r=a.slots,g=0,h=r.length;h>g;g++){var s=r[g],k=d.findBone(s.bone);if(!k)throw"Slot bone not found: "+s.bone;var t=new c.SlotData(s.name,k),u=s.color;u&&(t.r=this.toColor(u,0),t.g=this.toColor(u,1),t.b=this.toColor(u,2),t.a=this.toColor(u,3)),t.attachmentName=s.attachment,t.additiveBlending=s.additive&&"true"==s.additive,d.slots.push(t)}var v=a.skins;for(var w in v)if(v.hasOwnProperty(w)){var x=v[w],y=new c.Skin(w);for(var z in x)if(x.hasOwnProperty(z)){var A=d.findSlotIndex(z),B=x[z];for(var C in B)if(B.hasOwnProperty(C)){var D=this.readAttachment(y,C,B[C]);D&&y.addAttachment(A,C,D)}}d.skins.push(y),"default"==y.name&&(d.defaultSkin=y)}var E=a.events;for(var F in E)if(E.hasOwnProperty(F)){var G=E[F],H=new c.EventData(F);H.intValue=G["int"]||0,H.floatValue=G["float"]||0,H.stringValue=G.string||null,d.events.push(H)}var I=a.animations;for(var J in I)I.hasOwnProperty(J)&&this.readAnimation(J,I[J],d);return d},readAttachment:function(a,b,d){b=d.name||b;var e=c.AttachmentType[d.type||"region"],f=d.path||b,g=this.scale; -if(e==c.AttachmentType.region){var h=this.attachmentLoader.newRegionAttachment(a,b,f);if(!h)return null;h.path=f,h.x=(d.x||0)*g,h.y=(d.y||0)*g,h.scaleX=d.hasOwnProperty("scaleX")?d.scaleX:1,h.scaleY=d.hasOwnProperty("scaleY")?d.scaleY:1,h.rotation=d.rotation||0,h.width=(d.width||0)*g,h.height=(d.height||0)*g;var i=d.color;return i&&(h.r=this.toColor(i,0),h.g=this.toColor(i,1),h.b=this.toColor(i,2),h.a=this.toColor(i,3)),h.updateOffset(),h}if(e==c.AttachmentType.mesh){var j=this.attachmentLoader.newMeshAttachment(a,b,f);return j?(j.path=f,j.vertices=this.getFloatArray(d,"vertices",g),j.triangles=this.getIntArray(d,"triangles"),j.regionUVs=this.getFloatArray(d,"uvs",1),j.updateUVs(),i=d.color,i&&(j.r=this.toColor(i,0),j.g=this.toColor(i,1),j.b=this.toColor(i,2),j.a=this.toColor(i,3)),j.hullLength=2*(d.hull||0),d.edges&&(j.edges=this.getIntArray(d,"edges")),j.width=(d.width||0)*g,j.height=(d.height||0)*g,j):null}if(e==c.AttachmentType.skinnedmesh){var j=this.attachmentLoader.newSkinnedMeshAttachment(a,b,f);if(!j)return null;j.path=f;for(var k=this.getFloatArray(d,"uvs",1),l=this.getFloatArray(d,"vertices",1),m=[],n=[],o=0,p=l.length;p>o;){var q=0|l[o++];n[n.length]=q;for(var r=o+4*q;r>o;)n[n.length]=l[o],m[m.length]=l[o+1]*g,m[m.length]=l[o+2]*g,m[m.length]=l[o+3],o+=4}return j.bones=n,j.weights=m,j.triangles=this.getIntArray(d,"triangles"),j.regionUVs=k,j.updateUVs(),i=d.color,i&&(j.r=this.toColor(i,0),j.g=this.toColor(i,1),j.b=this.toColor(i,2),j.a=this.toColor(i,3)),j.hullLength=2*(d.hull||0),d.edges&&(j.edges=this.getIntArray(d,"edges")),j.width=(d.width||0)*g,j.height=(d.height||0)*g,j}if(e==c.AttachmentType.boundingbox){for(var s=this.attachmentLoader.newBoundingBoxAttachment(a,b),l=d.vertices,o=0,p=l.length;p>o;o++)s.vertices.push(l[o]*g);return s}throw"Unknown attachment type: "+e},readAnimation:function(a,b,d){var e=[],f=0,g=b.slots;for(var h in g)if(g.hasOwnProperty(h)){var i=g[h],j=d.findSlotIndex(h);for(var k in i)if(i.hasOwnProperty(k)){var l=i[k];if("color"==k){var m=new c.ColorTimeline(l.length);m.slotIndex=j;for(var n=0,o=0,p=l.length;p>o;o++){var q=l[o],r=q.color,s=this.toColor(r,0),t=this.toColor(r,1),u=this.toColor(r,2),v=this.toColor(r,3);m.setFrame(n,q.time,s,t,u,v),this.readCurve(m,n,q),n++}e.push(m),f=Math.max(f,m.frames[5*m.getFrameCount()-5])}else{if("attachment"!=k)throw"Invalid timeline type for a slot: "+k+" ("+h+")";var m=new c.AttachmentTimeline(l.length);m.slotIndex=j;for(var n=0,o=0,p=l.length;p>o;o++){var q=l[o];m.setFrame(n++,q.time,q.name)}e.push(m),f=Math.max(f,m.frames[m.getFrameCount()-1])}}}var w=b.bones;for(var x in w)if(w.hasOwnProperty(x)){var y=d.findBoneIndex(x);if(-1==y)throw"Bone not found: "+x;var z=w[x];for(var k in z)if(z.hasOwnProperty(k)){var l=z[k];if("rotate"==k){var m=new c.RotateTimeline(l.length);m.boneIndex=y;for(var n=0,o=0,p=l.length;p>o;o++){var q=l[o];m.setFrame(n,q.time,q.angle),this.readCurve(m,n,q),n++}e.push(m),f=Math.max(f,m.frames[2*m.getFrameCount()-2])}else if("translate"==k||"scale"==k){var m,A=1;"scale"==k?m=new c.ScaleTimeline(l.length):(m=new c.TranslateTimeline(l.length),A=this.scale),m.boneIndex=y;for(var n=0,o=0,p=l.length;p>o;o++){var q=l[o],B=(q.x||0)*A,C=(q.y||0)*A;m.setFrame(n,q.time,B,C),this.readCurve(m,n,q),n++}e.push(m),f=Math.max(f,m.frames[3*m.getFrameCount()-3])}else{if("flipX"!=k&&"flipY"!=k)throw"Invalid timeline type for a bone: "+k+" ("+x+")";var B="flipX"==k,m=B?new c.FlipXTimeline(l.length):new c.FlipYTimeline(l.length);m.boneIndex=y;for(var D=B?"x":"y",n=0,o=0,p=l.length;p>o;o++){var q=l[o];m.setFrame(n,q.time,q[D]||!1),n++}e.push(m),f=Math.max(f,m.frames[2*m.getFrameCount()-2])}}}var E=b.ik;for(var F in E)if(E.hasOwnProperty(F)){var G=d.findIkConstraint(F),l=E[F],m=new c.IkConstraintTimeline(l.length);m.ikConstraintIndex=d.ikConstraints.indexOf(G);for(var n=0,o=0,p=l.length;p>o;o++){var q=l[o],H=q.hasOwnProperty("mix")?q.mix:1,I=!q.hasOwnProperty("bendPositive")||q.bendPositive?1:-1;m.setFrame(n,q.time,H,I),this.readCurve(m,n,q),n++}e.push(m),f=Math.max(f,m.frames[3*m.frameCount-3])}var J=b.ffd;for(var K in J){var L=d.findSkin(K),i=J[K];for(h in i){var j=d.findSlotIndex(h),M=i[h];for(var N in M){var l=M[N],m=new c.FfdTimeline(l.length),O=L.getAttachment(j,N);if(!O)throw"FFD attachment not found: "+N;m.slotIndex=j,m.attachment=O;var P,Q=O.type==c.AttachmentType.mesh;P=Q?O.vertices.length:O.weights.length/3*2;for(var n=0,o=0,p=l.length;p>o;o++){var R,q=l[o];if(q.vertices){var S=q.vertices,R=[];R.length=P;var T=q.offset||0,U=S.length;if(1==this.scale)for(var V=0;U>V;V++)R[V+T]=S[V];else for(var V=0;U>V;V++)R[V+T]=S[V]*this.scale;if(Q)for(var W=O.vertices,V=0,U=R.length;U>V;V++)R[V]+=W[V]}else Q?R=O.vertices:(R=[],R.length=P);m.setFrame(n,q.time,R),this.readCurve(m,n,q),n++}e[e.length]=m,f=Math.max(f,m.frames[m.frameCount-1])}}}var X=b.drawOrder;if(X||(X=b.draworder),X){for(var m=new c.DrawOrderTimeline(X.length),Y=d.slots.length,n=0,o=0,p=X.length;p>o;o++){var Z=X[o],$=null;if(Z.offsets){$=[],$.length=Y;for(var V=Y-1;V>=0;V--)$[V]=-1;var _=Z.offsets,ab=[];ab.length=Y-_.length;for(var bb=0,cb=0,V=0,U=_.length;U>V;V++){var db=_[V],j=d.findSlotIndex(db.slot);if(-1==j)throw"Slot not found: "+db.slot;for(;bb!=j;)ab[cb++]=bb++;$[bb+db.offset]=bb++}for(;Y>bb;)ab[cb++]=bb++;for(var V=Y-1;V>=0;V--)-1==$[V]&&($[V]=ab[--cb])}m.setFrame(n++,Z.time,$)}e.push(m),f=Math.max(f,m.frames[m.getFrameCount()-1])}var eb=b.events;if(eb){for(var m=new c.EventTimeline(eb.length),n=0,o=0,p=eb.length;p>o;o++){var fb=eb[o],gb=d.findEvent(fb.name);if(!gb)throw"Event not found: "+fb.name;var hb=new c.Event(gb);hb.intValue=fb.hasOwnProperty("int")?fb["int"]:gb.intValue,hb.floatValue=fb.hasOwnProperty("float")?fb["float"]:gb.floatValue,hb.stringValue=fb.hasOwnProperty("string")?fb.string:gb.stringValue,m.setFrame(n++,fb.time,hb)}e.push(m),f=Math.max(f,m.frames[m.getFrameCount()-1])}d.animations.push(new c.Animation(a,e,f))},readCurve:function(a,b,c){var d=c.curve;d?"stepped"==d?a.curves.setStepped(b):d instanceof Array&&a.curves.setCurve(b,d[0],d[1],d[2],d[3]):a.curves.setLinear(b)},toColor:function(a,b){if(8!=a.length)throw"Color hexidecimal length must be 8, recieved: "+a;return parseInt(a.substring(2*b,2*b+2),16)/255},getFloatArray:function(a,b,d){var e=a[b],f=new c.Float32Array(e.length),g=0,h=e.length;if(1==d)for(;h>g;g++)f[g]=e[g];else for(;h>g;g++)f[g]=e[g]*d;return f},getIntArray:function(a,b){for(var d=a[b],e=new c.Uint16Array(d.length),f=0,g=d.length;g>f;f++)e[f]=0|d[f];return e}},c.Atlas=function(a,b){this.textureLoader=b,this.pages=[],this.regions=[];var d=new c.AtlasReader(a),e=[];e.length=4;for(var f=null;;){var g=d.readLine();if(null===g)break;if(g=d.trim(g),g.length)if(f){var h=new c.AtlasRegion;h.name=g,h.page=f,h.rotate="true"==d.readValue(),d.readTuple(e);var i=parseInt(e[0]),j=parseInt(e[1]);d.readTuple(e);var k=parseInt(e[0]),l=parseInt(e[1]);h.u=i/f.width,h.v=j/f.height,h.rotate?(h.u2=(i+l)/f.width,h.v2=(j+k)/f.height):(h.u2=(i+k)/f.width,h.v2=(j+l)/f.height),h.x=i,h.y=j,h.width=Math.abs(k),h.height=Math.abs(l),4==d.readTuple(e)&&(h.splits=[parseInt(e[0]),parseInt(e[1]),parseInt(e[2]),parseInt(e[3])],4==d.readTuple(e)&&(h.pads=[parseInt(e[0]),parseInt(e[1]),parseInt(e[2]),parseInt(e[3])],d.readTuple(e))),h.originalWidth=parseInt(e[0]),h.originalHeight=parseInt(e[1]),d.readTuple(e),h.offsetX=parseInt(e[0]),h.offsetY=parseInt(e[1]),h.index=parseInt(d.readValue()),this.regions.push(h)}else{f=new c.AtlasPage,f.name=g,2==d.readTuple(e)&&(f.width=parseInt(e[0]),f.height=parseInt(e[1]),d.readTuple(e)),f.format=c.Atlas.Format[e[0]],d.readTuple(e),f.minFilter=c.Atlas.TextureFilter[e[0]],f.magFilter=c.Atlas.TextureFilter[e[1]];var m=d.readValue();f.uWrap=c.Atlas.TextureWrap.clampToEdge,f.vWrap=c.Atlas.TextureWrap.clampToEdge,"x"==m?f.uWrap=c.Atlas.TextureWrap.repeat:"y"==m?f.vWrap=c.Atlas.TextureWrap.repeat:"xy"==m&&(f.uWrap=f.vWrap=c.Atlas.TextureWrap.repeat),b.load(f,g,this),this.pages.push(f)}else f=null}},c.Atlas.prototype={findRegion:function(a){for(var b=this.regions,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},dispose:function(){for(var a=this.pages,b=0,c=a.length;c>b;b++)this.textureLoader.unload(a[b].rendererObject)},updateUVs:function(a){for(var b=this.regions,c=0,d=b.length;d>c;c++){var e=b[c];e.page==a&&(e.u=e.x/a.width,e.v=e.y/a.height,e.rotate?(e.u2=(e.x+e.height)/a.width,e.v2=(e.y+e.width)/a.height):(e.u2=(e.x+e.width)/a.width,e.v2=(e.y+e.height)/a.height))}}},c.Atlas.Format={alpha:0,intensity:1,luminanceAlpha:2,rgb565:3,rgba4444:4,rgb888:5,rgba8888:6},c.Atlas.TextureFilter={nearest:0,linear:1,mipMap:2,mipMapNearestNearest:3,mipMapLinearNearest:4,mipMapNearestLinear:5,mipMapLinearLinear:6},c.Atlas.TextureWrap={mirroredRepeat:0,clampToEdge:1,repeat:2},c.AtlasPage=function(){},c.AtlasPage.prototype={name:null,format:null,minFilter:null,magFilter:null,uWrap:null,vWrap:null,rendererObject:null,width:0,height:0},c.AtlasRegion=function(){},c.AtlasRegion.prototype={page:null,name:null,x:0,y:0,width:0,height:0,u:0,v:0,u2:0,v2:0,offsetX:0,offsetY:0,originalWidth:0,originalHeight:0,index:0,rotate:!1,splits:null,pads:null},c.AtlasReader=function(a){this.lines=a.split(/\r\n|\r|\n/)},c.AtlasReader.prototype={index:0,trim:function(a){return a.replace(/^\s+|\s+$/g,"")},readLine:function(){return this.index>=this.lines.length?null:this.lines[this.index++]},readValue:function(){var a=this.readLine(),b=a.indexOf(":");if(-1==b)throw"Invalid line: "+a;return this.trim(a.substring(b+1))},readTuple:function(a){var b=this.readLine(),c=b.indexOf(":");if(-1==c)throw"Invalid line: "+b;for(var d=0,e=c+1;3>d;d++){var f=b.indexOf(",",e);if(-1==f)break;a[d]=this.trim(b.substr(e,f-e)),e=f+1}return a[d]=this.trim(b.substring(e)),d+1}},c.AtlasAttachmentLoader=function(a){this.atlas=a},c.AtlasAttachmentLoader.prototype={newRegionAttachment:function(a,b,d){var e=this.atlas.findRegion(d);if(!e)throw"Region not found in atlas: "+d+" (region attachment: "+b+")";var f=new c.RegionAttachment(b);return f.rendererObject=e,f.setUVs(e.u,e.v,e.u2,e.v2,e.rotate),f.regionOffsetX=e.offsetX,f.regionOffsetY=e.offsetY,f.regionWidth=e.width,f.regionHeight=e.height,f.regionOriginalWidth=e.originalWidth,f.regionOriginalHeight=e.originalHeight,f},newMeshAttachment:function(a,b,d){var e=this.atlas.findRegion(d);if(!e)throw"Region not found in atlas: "+d+" (mesh attachment: "+b+")";var f=new c.MeshAttachment(b);return f.rendererObject=e,f.regionU=e.u,f.regionV=e.v,f.regionU2=e.u2,f.regionV2=e.v2,f.regionRotate=e.rotate,f.regionOffsetX=e.offsetX,f.regionOffsetY=e.offsetY,f.regionWidth=e.width,f.regionHeight=e.height,f.regionOriginalWidth=e.originalWidth,f.regionOriginalHeight=e.originalHeight,f},newSkinnedMeshAttachment:function(a,b,d){var e=this.atlas.findRegion(d);if(!e)throw"Region not found in atlas: "+d+" (skinned mesh attachment: "+b+")";var f=new c.SkinnedMeshAttachment(b);return f.rendererObject=e,f.regionU=e.u,f.regionV=e.v,f.regionU2=e.u2,f.regionV2=e.v2,f.regionRotate=e.rotate,f.regionOffsetX=e.offsetX,f.regionOffsetY=e.offsetY,f.regionWidth=e.width,f.regionHeight=e.height,f.regionOriginalWidth=e.originalWidth,f.regionOriginalHeight=e.originalHeight,f},newBoundingBoxAttachment:function(a,b){return new c.BoundingBoxAttachment(b)}},c.SkeletonBounds=function(){this.polygonPool=[],this.polygons=[],this.boundingBoxes=[]},c.SkeletonBounds.prototype={minX:0,minY:0,maxX:0,maxY:0,update:function(a,b){var d=a.slots,e=d.length,f=a.x,g=a.y,h=this.boundingBoxes,i=this.polygonPool,j=this.polygons;h.length=0;for(var k=0,l=j.length;l>k;k++)i.push(j[k]);j.length=0;for(var k=0;e>k;k++){var m=d[k],n=m.attachment;if(n.type==c.AttachmentType.boundingbox){h.push(n);var o,p=i.length;p>0?(o=i[p-1],i.splice(p-1,1)):o=[],j.push(o),o.length=n.vertices.length,n.computeWorldVertices(f,g,m.bone,o)}}b&&this.aabbCompute()},aabbCompute:function(){for(var a=this.polygons,b=Number.MAX_VALUE,c=Number.MAX_VALUE,d=Number.MIN_VALUE,e=Number.MIN_VALUE,f=0,g=a.length;g>f;f++)for(var h=a[f],i=0,j=h.length;j>i;i+=2){var k=h[i],l=h[i+1];b=Math.min(b,k),c=Math.min(c,l),d=Math.max(d,k),e=Math.max(e,l)}this.minX=b,this.minY=c,this.maxX=d,this.maxY=e},aabbContainsPoint:function(a,b){return a>=this.minX&&a<=this.maxX&&b>=this.minY&&b<=this.maxY},aabbIntersectsSegment:function(a,b,c,d){var e=this.minX,f=this.minY,g=this.maxX,h=this.maxY;if(e>=a&&e>=c||f>=b&&f>=d||a>=g&&c>=g||b>=h&&d>=h)return!1;var i=(d-b)/(c-a),j=i*(e-a)+b;if(j>f&&h>j)return!0;if(j=i*(g-a)+b,j>f&&h>j)return!0;var k=(f-b)/i+a;return k>e&&g>k?!0:(k=(h-b)/i+a,k>e&&g>k?!0:!1)},aabbIntersectsSkeleton:function(a){return this.minXa.minX&&this.minYa.minY},containsPoint:function(a,b){for(var c=this.polygons,d=0,e=c.length;e>d;d++)if(this.polygonContainsPoint(c[d],a,b))return this.boundingBoxes[d];return null},intersectsSegment:function(a,b,c,d){for(var e=this.polygons,f=0,g=e.length;g>f;f++)if(e[f].intersectsSegment(a,b,c,d))return this.boundingBoxes[f];return null},polygonContainsPoint:function(a,b,c){for(var d=a.length,e=d-2,f=!1,g=0;d>g;g+=2){var h=a[g+1],i=a[e+1];if(c>h&&i>=c||c>i&&h>=c){var j=a[g];j+(c-h)/(i-h)*(a[e]-j)l;l+=2){var m=a[l],n=a[l+1],o=j*n-k*m,p=j-m,q=k-n,r=g*q-h*p,s=(i*p-g*o)/r;if((s>=j&&m>=s||s>=m&&j>=s)&&(s>=b&&d>=s||s>=d&&b>=s)){var t=(i*q-h*o)/r;if((t>=k&&n>=t||t>=n&&k>=t)&&(t>=c&&e>=t||t>=e&&c>=t))return!0}j=m,k=n}return!1},getPolygon:function(a){var b=this.boundingBoxes.indexOf(a);return-1==b?null:this.polygons[b]},getWidth:function(){return this.maxX-this.minX},getHeight:function(){return this.maxY-this.minY}},c.Bone.yDown=!0,b.AnimCache={},b.SpineTextureLoader=function(a,c){b.EventTarget.call(this),this.basePath=a,this.crossorigin=c,this.loadingCount=0},b.SpineTextureLoader.prototype=b.SpineTextureLoader,b.SpineTextureLoader.prototype.load=function(a,c){if(a.rendererObject=b.BaseTexture.fromImage(this.basePath+"/"+c,this.crossorigin),!a.rendererObject.hasLoaded){var d=this;++d.loadingCount,a.rendererObject.addEventListener("loaded",function(){--d.loadingCount,d.dispatchEvent({type:"loadedBaseTexture",content:d})})}},b.SpineTextureLoader.prototype.unload=function(a){a.destroy(!0)},b.Spine=function(a){if(b.DisplayObjectContainer.call(this),this.spineData=b.AnimCache[a],!this.spineData)throw new Error("Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: "+a);this.skeleton=new c.Skeleton(this.spineData),this.skeleton.updateWorldTransform(),this.stateData=new c.AnimationStateData(this.spineData),this.state=new c.AnimationState(this.stateData),this.slotContainers=[];for(var d=0,e=this.skeleton.drawOrder.length;e>d;d++){var f=this.skeleton.drawOrder[d],g=f.attachment,h=new b.DisplayObjectContainer;if(this.slotContainers.push(h),this.addChild(h),g instanceof c.RegionAttachment){var i=g.rendererObject.name,j=this.createSprite(f,g);f.currentSprite=j,f.currentSpriteName=i,h.addChild(j)}else{if(!(g instanceof c.MeshAttachment))continue;var k=this.createMesh(f,g);f.currentMesh=k,f.currentMeshName=g.name,h.addChild(k)}}this.autoUpdate=!0},b.Spine.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Spine.prototype.constructor=b.Spine,Object.defineProperty(b.Spine.prototype,"autoUpdate",{get:function(){return this.updateTransform===b.Spine.prototype.autoUpdateTransform},set:function(a){this.updateTransform=a?b.Spine.prototype.autoUpdateTransform:b.DisplayObjectContainer.prototype.updateTransform}}),b.Spine.prototype.update=function(a){this.state.update(a),this.state.apply(this.skeleton),this.skeleton.updateWorldTransform();for(var d=this.skeleton.drawOrder,e=0,f=d.length;f>e;e++){var g=d[e],h=g.attachment,i=this.slotContainers[e];if(h){var j=h.type;if(j===c.AttachmentType.region){if(h.rendererObject&&(!g.currentSpriteName||g.currentSpriteName!==h.name)){var k=h.rendererObject.name;if(void 0!==g.currentSprite&&(g.currentSprite.visible=!1),g.sprites=g.sprites||{},void 0!==g.sprites[k])g.sprites[k].visible=!0;else{var l=this.createSprite(g,h);i.addChild(l)}g.currentSprite=g.sprites[k],g.currentSpriteName=k}var m=g.bone;i.position.x=m.worldX+h.x*m.m00+h.y*m.m01,i.position.y=m.worldY+h.x*m.m10+h.y*m.m11,i.scale.x=m.worldScaleX,i.scale.y=m.worldScaleY,i.rotation=-(g.bone.worldRotation*c.degRad),g.currentSprite.tint=b.rgb2hex([g.r,g.g,g.b])}else{if(j!==c.AttachmentType.skinnedmesh){i.visible=!1;continue}if(!g.currentMeshName||g.currentMeshName!==h.name){var n=h.name;if(void 0!==g.currentMesh&&(g.currentMesh.visible=!1),g.meshes=g.meshes||{},void 0!==g.meshes[n])g.meshes[n].visible=!0;else{var o=this.createMesh(g,h);i.addChild(o)}g.currentMesh=g.meshes[n],g.currentMeshName=n}h.computeWorldVertices(g.bone.skeleton.x,g.bone.skeleton.y,g,g.currentMesh.vertices)}i.visible=!0,i.alpha=g.a}else i.visible=!1}},b.Spine.prototype.autoUpdateTransform=function(){this.lastTime=this.lastTime||Date.now();var a=.001*(Date.now()-this.lastTime);this.lastTime=Date.now(),this.update(a),b.DisplayObjectContainer.prototype.updateTransform.call(this)},b.Spine.prototype.createSprite=function(a,d){var e=d.rendererObject,f=e.page.rendererObject,g=new b.Rectangle(e.x,e.y,e.rotate?e.height:e.width,e.rotate?e.width:e.height),h=new b.Texture(f,g),i=new b.Sprite(h),j=e.rotate?.5*Math.PI:0;return i.scale.set(e.width/e.originalWidth,e.height/e.originalHeight),i.rotation=j-d.rotation*c.degRad,i.anchor.x=i.anchor.y=.5,a.sprites=a.sprites||{},a.sprites[e.name]=i,i},b.Spine.prototype.createMesh=function(a,c){var d=c.rendererObject,e=d.page.rendererObject,f=new b.Texture(e),g=new b.Strip(f);return g.drawMode=b.Strip.DrawModes.TRIANGLES,g.canvasPadding=1.5,g.vertices=new b.Float32Array(c.uvs.length),g.uvs=c.uvs,g.indices=c.triangles,a.meshes=a.meshes||{},a.meshes[c.name]=g,g},b.BaseTextureCache={},b.BaseTextureCacheIdGenerator=0,b.BaseTexture=function(a,c){if(this.resolution=1,this.width=100,this.height=100,this.scaleMode=c||b.scaleModes.DEFAULT,this.hasLoaded=!1,this.source=a,this._UID=b._UID++,this.premultipliedAlpha=!0,this._glTextures=[],this.mipmap=!1,this._dirty=[!0,!0,!0,!0],a){if((this.source.complete||this.source.getContext)&&this.source.width&&this.source.height)this.hasLoaded=!0,this.width=this.source.naturalWidth||this.source.width,this.height=this.source.naturalHeight||this.source.height,this.dirty();else{var d=this;this.source.onload=function(){d.hasLoaded=!0,d.width=d.source.naturalWidth||d.source.width,d.height=d.source.naturalHeight||d.source.height,d.dirty(),d.dispatchEvent({type:"loaded",content:d})},this.source.onerror=function(){d.dispatchEvent({type:"error",content:d})}}this.imageUrl=null,this._powerOf2=!1}},b.BaseTexture.prototype.constructor=b.BaseTexture,b.EventTarget.mixin(b.BaseTexture.prototype),b.BaseTexture.prototype.destroy=function(){this.imageUrl?(delete b.BaseTextureCache[this.imageUrl],delete b.TextureCache[this.imageUrl],this.imageUrl=null,navigator.isCocoonJS||(this.source.src="")):this.source&&this.source._pixiId&&delete b.BaseTextureCache[this.source._pixiId],this.source=null,this.unloadFromGPU()},b.BaseTexture.prototype.updateSourceImage=function(a){this.hasLoaded=!1,this.source.src=null,this.source.src=a},b.BaseTexture.prototype.dirty=function(){for(var a=0;a=0;a--){var c=this._glTextures[a],d=b.glContexts[a];d&&c&&d.deleteTexture(c)}this._glTextures.length=0,this.dirty()},b.BaseTexture.fromImage=function(a,c,d){var e=b.BaseTextureCache[a];if(void 0===c&&-1===a.indexOf("data:")&&(c=!0),!e){var f=new Image;c&&(f.crossOrigin=""),f.src=a,e=new b.BaseTexture(f,d),e.imageUrl=a,b.BaseTextureCache[a]=e,-1!==a.indexOf(b.RETINA_PREFIX+".")&&(e.resolution=2)}return e},b.BaseTexture.fromCanvas=function(a,c){a._pixiId||(a._pixiId="canvas_"+b.TextureCacheIdGenerator++);var d=b.BaseTextureCache[a._pixiId];return d||(d=new b.BaseTexture(a,c),b.BaseTextureCache[a._pixiId]=d),d},b.TextureCache={},b.FrameCache={},b.TextureCacheIdGenerator=0,b.Texture=function(a,c,d,e){this.noFrame=!1,c||(this.noFrame=!0,c=new b.Rectangle(0,0,1,1)),a instanceof b.Texture&&(a=a.baseTexture),this.baseTexture=a,this.frame=c,this.trim=e,this.valid=!1,this.requiresUpdate=!1,this._uvs=null,this.width=0,this.height=0,this.crop=d||new b.Rectangle(0,0,1,1),a.hasLoaded?(this.noFrame&&(c=new b.Rectangle(0,0,a.width,a.height)),this.setFrame(c)):a.addEventListener("loaded",this.onBaseTextureLoaded.bind(this))},b.Texture.prototype.constructor=b.Texture,b.EventTarget.mixin(b.Texture.prototype),b.Texture.prototype.onBaseTextureLoaded=function(){var a=this.baseTexture;a.removeEventListener("loaded",this.onLoaded),this.noFrame&&(this.frame=new b.Rectangle(0,0,a.width,a.height)),this.setFrame(this.frame),this.dispatchEvent({type:"update",content:this})},b.Texture.prototype.destroy=function(a){a&&this.baseTexture.destroy(),this.valid=!1},b.Texture.prototype.setFrame=function(a){if(this.noFrame=!1,this.frame=a,this.width=a.width,this.height=a.height,this.crop.x=a.x,this.crop.y=a.y,this.crop.width=a.width,this.crop.height=a.height,!this.trim&&(a.x+a.width>this.baseTexture.width||a.y+a.height>this.baseTexture.height))throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.valid=a&&a.width&&a.height&&this.baseTexture.source&&this.baseTexture.hasLoaded,this.trim&&(this.width=this.trim.width,this.height=this.trim.height,this.frame.width=this.trim.width,this.frame.height=this.trim.height),this.valid&&this._updateUvs()},b.Texture.prototype._updateUvs=function(){this._uvs||(this._uvs=new b.TextureUvs);var a=this.crop,c=this.baseTexture.width,d=this.baseTexture.height;this._uvs.x0=a.x/c,this._uvs.y0=a.y/d,this._uvs.x1=(a.x+a.width)/c,this._uvs.y1=a.y/d,this._uvs.x2=(a.x+a.width)/c,this._uvs.y2=(a.y+a.height)/d,this._uvs.x3=a.x/c,this._uvs.y3=(a.y+a.height)/d},b.Texture.fromImage=function(a,c,d){var e=b.TextureCache[a];return e||(e=new b.Texture(b.BaseTexture.fromImage(a,c,d)),b.TextureCache[a]=e),e},b.Texture.fromFrame=function(a){var c=b.TextureCache[a];if(!c)throw new Error('The frameId "'+a+'" does not exist in the texture cache ');return c},b.Texture.fromCanvas=function(a,c){var d=b.BaseTexture.fromCanvas(a,c);return new b.Texture(d)},b.Texture.addTextureToCache=function(a,c){b.TextureCache[c]=a},b.Texture.removeTextureFromCache=function(a){var c=b.TextureCache[a];return delete b.TextureCache[a],delete b.BaseTextureCache[a],c},b.TextureUvs=function(){this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0},b.Texture.emptyTexture=new b.Texture(new b.BaseTexture),b.RenderTexture=function(a,c,d,e,f){if(this.width=a||100,this.height=c||100,this.resolution=f||1,this.frame=new b.Rectangle(0,0,this.width*this.resolution,this.height*this.resolution),this.crop=new b.Rectangle(0,0,this.width*this.resolution,this.height*this.resolution),this.baseTexture=new b.BaseTexture,this.baseTexture.width=this.width*this.resolution,this.baseTexture.height=this.height*this.resolution,this.baseTexture._glTextures=[],this.baseTexture.resolution=this.resolution,this.baseTexture.scaleMode=e||b.scaleModes.DEFAULT,this.baseTexture.hasLoaded=!0,b.Texture.call(this,this.baseTexture,new b.Rectangle(0,0,this.width*this.resolution,this.height*this.resolution)),this.renderer=d||b.defaultRenderer,this.renderer.type===b.WEBGL_RENDERER){var g=this.renderer.gl;this.baseTexture._dirty[g.id]=!1,this.textureBuffer=new b.FilterTexture(g,this.width,this.height,this.baseTexture.scaleMode),this.baseTexture._glTextures[g.id]=this.textureBuffer.texture,this.render=this.renderWebGL,this.projection=new b.Point(.5*this.width,.5*-this.height)}else this.render=this.renderCanvas,this.textureBuffer=new b.CanvasBuffer(this.width*this.resolution,this.height*this.resolution),this.baseTexture.source=this.textureBuffer.canvas;this.valid=!0,this._updateUvs()},b.RenderTexture.prototype=Object.create(b.Texture.prototype),b.RenderTexture.prototype.constructor=b.RenderTexture,b.RenderTexture.prototype.resize=function(a,c,d){(a!==this.width||c!==this.height)&&(this.valid=a>0&&c>0,this.width=a,this.height=c,this.frame.width=this.crop.width=a*this.resolution,this.frame.height=this.crop.height=c*this.resolution,d&&(this.baseTexture.width=this.width*this.resolution,this.baseTexture.height=this.height*this.resolution),this.renderer.type===b.WEBGL_RENDERER&&(this.projection.x=this.width/2,this.projection.y=-this.height/2),this.valid&&this.textureBuffer.resize(this.width,this.height))},b.RenderTexture.prototype.clear=function(){this.valid&&(this.renderer.type===b.WEBGL_RENDERER&&this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER,this.textureBuffer.frameBuffer),this.textureBuffer.clear())},b.RenderTexture.prototype.renderWebGL=function(a,b,c){if(this.valid){var d=a.worldTransform;d.identity(),d.translate(0,2*this.projection.y),b&&d.append(b),d.scale(1,-1),a.worldAlpha=1;for(var e=a.children,f=0,g=e.length;g>f;f++)e[f].updateTransform();var h=this.renderer.gl;h.viewport(0,0,this.width*this.resolution,this.height*this.resolution),h.bindFramebuffer(h.FRAMEBUFFER,this.textureBuffer.frameBuffer),c&&this.textureBuffer.clear(),this.renderer.spriteBatch.dirty=!0,this.renderer.renderDisplayObject(a,this.projection,this.textureBuffer.frameBuffer),this.renderer.spriteBatch.dirty=!0}},b.RenderTexture.prototype.renderCanvas=function(a,b,c){if(this.valid){var d=a.worldTransform;d.identity(),b&&d.append(b),a.worldAlpha=1;for(var e=a.children,f=0,g=e.length;g>f;f++)e[f].updateTransform();c&&this.textureBuffer.clear();var h=this.textureBuffer.context,i=this.renderer.resolution;this.renderer.resolution=this.resolution,this.renderer.renderDisplayObject(a,h),this.renderer.resolution=i}},b.RenderTexture.prototype.getImage=function(){var a=new Image;return a.src=this.getBase64(),a},b.RenderTexture.prototype.getBase64=function(){return this.getCanvas().toDataURL()},b.RenderTexture.prototype.getCanvas=function(){if(this.renderer.type===b.WEBGL_RENDERER){var a=this.renderer.gl,c=this.textureBuffer.width,d=this.textureBuffer.height,e=new Uint8Array(4*c*d);a.bindFramebuffer(a.FRAMEBUFFER,this.textureBuffer.frameBuffer),a.readPixels(0,0,c,d,a.RGBA,a.UNSIGNED_BYTE,e),a.bindFramebuffer(a.FRAMEBUFFER,null);var f=new b.CanvasBuffer(c,d),g=f.context.getImageData(0,0,c,d);return g.data.set(e),f.context.putImageData(g,0,0),f.canvas}return this.textureBuffer.canvas},b.RenderTexture.tempMatrix=new b.Matrix,b.VideoTexture=function(a,c){if(!a)throw new Error("No video source element specified.");(a.readyState===a.HAVE_ENOUGH_DATA||a.readyState===a.HAVE_FUTURE_DATA)&&a.width&&a.height&&(a.complete=!0),b.BaseTexture.call(this,a,c),this.autoUpdate=!1,this.updateBound=this._onUpdate.bind(this),a.complete||(this._onCanPlay=this.onCanPlay.bind(this),a.addEventListener("canplay",this._onCanPlay),a.addEventListener("canplaythrough",this._onCanPlay),a.addEventListener("play",this.onPlayStart.bind(this)),a.addEventListener("pause",this.onPlayStop.bind(this)))},b.VideoTexture.prototype=Object.create(b.BaseTexture.prototype),b.VideoTexture.constructor=b.VideoTexture,b.VideoTexture.prototype._onUpdate=function(){this.autoUpdate&&(window.requestAnimationFrame(this.updateBound),this.dirty())},b.VideoTexture.prototype.onPlayStart=function(){this.autoUpdate||(window.requestAnimationFrame(this.updateBound),this.autoUpdate=!0)},b.VideoTexture.prototype.onPlayStop=function(){this.autoUpdate=!1},b.VideoTexture.prototype.onCanPlay=function(){"canplaythrough"===event.type&&(this.hasLoaded=!0,this.source&&(this.source.removeEventListener("canplay",this._onCanPlay),this.source.removeEventListener("canplaythrough",this._onCanPlay),this.width=this.source.videoWidth,this.height=this.source.videoHeight,this.__loaded||(this.__loaded=!0,this.dispatchEvent({type:"loaded",content:this}))))},b.VideoTexture.prototype.destroy=function(){this.source&&this.source._pixiId&&(b.BaseTextureCache[this.source._pixiId]=null,delete b.BaseTextureCache[this.source._pixiId],this.source._pixiId=null,delete this.source._pixiId),b.BaseTexture.prototype.destroy.call(this)},b.VideoTexture.baseTextureFromVideo=function(a,c){a._pixiId||(a._pixiId="video_"+b.TextureCacheIdGenerator++);var d=b.BaseTextureCache[a._pixiId];return d||(d=new b.VideoTexture(a,c),b.BaseTextureCache[a._pixiId]=d),d},b.VideoTexture.textureFromVideo=function(a,c){var d=b.VideoTexture.baseTextureFromVideo(a,c);return new b.Texture(d)},b.VideoTexture.fromUrl=function(a,c){var d=document.createElement("video");return d.src=a,d.autoPlay=!0,d.play(),b.VideoTexture.textureFromVideo(d,c)},b.AssetLoader=function(a,c){this.assetURLs=a,this.crossorigin=c,this.loadersByType={jpg:b.ImageLoader,jpeg:b.ImageLoader,png:b.ImageLoader,gif:b.ImageLoader,webp:b.ImageLoader,json:b.JsonLoader,atlas:b.AtlasLoader,anim:b.SpineLoader,xml:b.BitmapFontLoader,fnt:b.BitmapFontLoader}},b.EventTarget.mixin(b.AssetLoader.prototype),b.AssetLoader.prototype.constructor=b.AssetLoader,b.AssetLoader.prototype._getDataType=function(a){var b="data:",c=a.slice(0,b.length).toLowerCase();if(c===b){var d=a.slice(b.length),e=d.indexOf(",");if(-1===e)return null;var f=d.slice(0,e).split(";")[0];return f&&"text/plain"!==f.toLowerCase()?f.split("/").pop().toLowerCase():"txt"}return null},b.AssetLoader.prototype.load=function(){function a(a){b.onAssetLoaded(a.data.content)}var b=this;this.loadCount=this.assetURLs.length;for(var c=0;c0?a.addEventListener("loadedBaseTexture",function(a){a.content.content.loadingCount<=0&&o.onLoaded()}):o.onLoaded()},n.load()}else this.onLoaded()},b.JsonLoader.prototype.onLoaded=function(){this.loaded=!0,this.dispatchEvent({type:"loaded",content:this})},b.JsonLoader.prototype.onError=function(){this.dispatchEvent({type:"error",content:this})},b.AtlasLoader=function(a,b){this.url=a,this.baseUrl=a.replace(/[^\/]*$/,""),this.crossorigin=b,this.loaded=!1},b.AtlasLoader.constructor=b.AtlasLoader,b.EventTarget.mixin(b.AtlasLoader.prototype),b.AtlasLoader.prototype.load=function(){this.ajaxRequest=new b.AjaxRequest,this.ajaxRequest.onreadystatechange=this.onAtlasLoaded.bind(this),this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/json"),this.ajaxRequest.send(null)},b.AtlasLoader.prototype.onAtlasLoaded=function(){if(4===this.ajaxRequest.readyState)if(200===this.ajaxRequest.status||-1===window.location.href.indexOf("http")){this.atlas={meta:{image:[]},frames:[]};var a=this.ajaxRequest.responseText.split(/\r?\n/),c=-3,d=0,e=null,f=!1,g=0,h=0,i=this.onLoaded.bind(this);for(g=0;g0){if(f===g)this.atlas.meta.image.push(a[g]),d=this.atlas.meta.image.length-1,this.atlas.frames.push({}),c=-3;else if(c>0)if(c%7===1)null!=e&&(this.atlas.frames[d][e.name]=e),e={name:a[g],frame:{}};else{var j=a[g].split(" ");if(c%7===3)e.frame.x=Number(j[1].replace(",","")),e.frame.y=Number(j[2]);else if(c%7===4)e.frame.w=Number(j[1].replace(",","")),e.frame.h=Number(j[2]);else if(c%7===5){var k={x:0,y:0,w:Number(j[1].replace(",","")),h:Number(j[2])};k.w>e.frame.w||k.h>e.frame.h?(e.trimmed=!0,e.realSize=k):e.trimmed=!1}}c++}if(null!=e&&(this.atlas.frames[d][e.name]=e),this.atlas.meta.image.length>0){for(this.images=[],h=0;hthis.currentImageId?(this.currentImageId++,this.images[this.currentImageId].load()):(this.loaded=!0,this.emit("loaded",{content:this}))},b.AtlasLoader.prototype.onError=function(){this.emit("error",{content:this})},b.SpriteSheetLoader=function(a,b){this.url=a,this.crossorigin=b,this.baseUrl=a.replace(/[^\/]*$/,""),this.texture=null,this.frames={}},b.SpriteSheetLoader.prototype.constructor=b.SpriteSheetLoader,b.EventTarget.mixin(b.SpriteSheetLoader.prototype),b.SpriteSheetLoader.prototype.load=function(){var a=this,c=new b.JsonLoader(this.url,this.crossorigin);c.on("loaded",function(b){a.json=b.data.content.json,a.onLoaded()}),c.load()},b.SpriteSheetLoader.prototype.onLoaded=function(){this.emit("loaded",{content:this})},b.ImageLoader=function(a,c){this.texture=b.Texture.fromImage(a,c),this.frames=[]},b.ImageLoader.prototype.constructor=b.ImageLoader,b.EventTarget.mixin(b.ImageLoader.prototype),b.ImageLoader.prototype.load=function(){this.texture.baseTexture.hasLoaded?this.onLoaded():this.texture.baseTexture.on("loaded",this.onLoaded.bind(this))},b.ImageLoader.prototype.onLoaded=function(){this.emit("loaded",{content:this})},b.ImageLoader.prototype.loadFramedSpriteSheet=function(a,c,d){this.frames=[];for(var e=Math.floor(this.texture.width/a),f=Math.floor(this.texture.height/c),g=0,h=0;f>h;h++)for(var i=0;e>i;i++,g++){var j=new b.Texture(this.texture.baseTexture,{x:i*a,y:h*c,width:a,height:c});this.frames.push(j),d&&(b.TextureCache[d+"-"+g]=j)}this.load()},b.BitmapFontLoader=function(a,b){this.url=a,this.crossorigin=b,this.baseUrl=a.replace(/[^\/]*$/,""),this.texture=null},b.BitmapFontLoader.prototype.constructor=b.BitmapFontLoader,b.EventTarget.mixin(b.BitmapFontLoader.prototype),b.BitmapFontLoader.prototype.load=function(){this.ajaxRequest=new b.AjaxRequest,this.ajaxRequest.onreadystatechange=this.onXMLLoaded.bind(this),this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/xml"),this.ajaxRequest.send(null)},b.BitmapFontLoader.prototype.onXMLLoaded=function(){if(4===this.ajaxRequest.readyState&&(200===this.ajaxRequest.status||-1===window.location.protocol.indexOf("http"))){var a=this.ajaxRequest.responseXML;if(!a||/MSIE 9/i.test(navigator.userAgent)||navigator.isCocoonJS)if("function"==typeof window.DOMParser){var c=new DOMParser;a=c.parseFromString(this.ajaxRequest.responseText,"text/xml")}else{var d=document.createElement("div");d.innerHTML=this.ajaxRequest.responseText,a=d}var e=this.baseUrl+a.getElementsByTagName("page")[0].getAttribute("file"),f=new b.ImageLoader(e,this.crossorigin);this.texture=f.texture.baseTexture;var g={},h=a.getElementsByTagName("info")[0],i=a.getElementsByTagName("common")[0];g.font=h.getAttribute("face"),g.size=parseInt(h.getAttribute("size"),10),g.lineHeight=parseInt(i.getAttribute("lineHeight"),10),g.chars={};for(var j=a.getElementsByTagName("char"),k=0;ka;a++)this.shaders[a].dirty=!0},b.AlphaMaskFilter=function(a){b.AbstractFilter.call(this),this.passes=[this],a.baseTexture._powerOf2=!0,this.uniforms={mask:{type:"sampler2D",value:a},mapDimensions:{type:"2f",value:{x:1,y:5112}},dimensions:{type:"4fv",value:[0,0,0,0]}},a.baseTexture.hasLoaded?(this.uniforms.mask.value.x=a.width,this.uniforms.mask.value.y=a.height):(this.boundLoadedFunction=this.onTextureLoaded.bind(this),a.baseTexture.on("loaded",this.boundLoadedFunction)),this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D mask;","uniform sampler2D uSampler;","uniform vec2 offset;","uniform vec4 dimensions;","uniform vec2 mapDimensions;","void main(void) {"," vec2 mapCords = vTextureCoord.xy;"," mapCords += (dimensions.zw + offset)/ dimensions.xy ;"," mapCords.y *= -1.0;"," mapCords.y += 1.0;"," mapCords *= dimensions.xy / mapDimensions;"," vec4 original = texture2D(uSampler, vTextureCoord);"," float maskAlpha = texture2D(mask, mapCords).r;"," original *= maskAlpha;"," gl_FragColor = original;","}"]},b.AlphaMaskFilter.prototype=Object.create(b.AbstractFilter.prototype),b.AlphaMaskFilter.prototype.constructor=b.AlphaMaskFilter,b.AlphaMaskFilter.prototype.onTextureLoaded=function(){this.uniforms.mapDimensions.value.x=this.uniforms.mask.value.width,this.uniforms.mapDimensions.value.y=this.uniforms.mask.value.height,this.uniforms.mask.value.baseTexture.off("loaded",this.boundLoadedFunction)},Object.defineProperty(b.AlphaMaskFilter.prototype,"map",{get:function(){return this.uniforms.mask.value},set:function(a){this.uniforms.mask.value=a}}),b.ColorMatrixFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={matrix:{type:"mat4",value:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float invert;","uniform mat4 matrix;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * matrix;","}"]},b.ColorMatrixFilter.prototype=Object.create(b.AbstractFilter.prototype),b.ColorMatrixFilter.prototype.constructor=b.ColorMatrixFilter,Object.defineProperty(b.ColorMatrixFilter.prototype,"matrix",{get:function(){return this.uniforms.matrix.value},set:function(a){this.uniforms.matrix.value=a}}),b.GrayFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={gray:{type:"1f",value:1}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","uniform float gray;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord);"," gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(0.2126*gl_FragColor.r + 0.7152*gl_FragColor.g + 0.0722*gl_FragColor.b), gray);","}"]},b.GrayFilter.prototype=Object.create(b.AbstractFilter.prototype),b.GrayFilter.prototype.constructor=b.GrayFilter,Object.defineProperty(b.GrayFilter.prototype,"gray",{get:function(){return this.uniforms.gray.value},set:function(a){this.uniforms.gray.value=a}}),b.DisplacementFilter=function(a){b.AbstractFilter.call(this),this.passes=[this],a.baseTexture._powerOf2=!0,this.uniforms={displacementMap:{type:"sampler2D",value:a},scale:{type:"2f",value:{x:30,y:30}},offset:{type:"2f",value:{x:0,y:0}},mapDimensions:{type:"2f",value:{x:1,y:5112}},dimensions:{type:"4fv",value:[0,0,0,0]}},a.baseTexture.hasLoaded?(this.uniforms.mapDimensions.value.x=a.width,this.uniforms.mapDimensions.value.y=a.height):(this.boundLoadedFunction=this.onTextureLoaded.bind(this),a.baseTexture.on("loaded",this.boundLoadedFunction)),this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D displacementMap;","uniform sampler2D uSampler;","uniform vec2 scale;","uniform vec2 offset;","uniform vec4 dimensions;","uniform vec2 mapDimensions;","void main(void) {"," vec2 mapCords = vTextureCoord.xy;"," mapCords += (dimensions.zw + offset)/ dimensions.xy ;"," mapCords.y *= -1.0;"," mapCords.y += 1.0;"," vec2 matSample = texture2D(displacementMap, mapCords).xy;"," matSample -= 0.5;"," matSample *= scale;"," matSample /= mapDimensions;"," gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + matSample.x, vTextureCoord.y + matSample.y));"," gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb, 1.0);"," vec2 cord = vTextureCoord;","}"]},b.DisplacementFilter.prototype=Object.create(b.AbstractFilter.prototype),b.DisplacementFilter.prototype.constructor=b.DisplacementFilter,b.DisplacementFilter.prototype.onTextureLoaded=function(){this.uniforms.mapDimensions.value.x=this.uniforms.displacementMap.value.width,this.uniforms.mapDimensions.value.y=this.uniforms.displacementMap.value.height,this.uniforms.displacementMap.value.baseTexture.off("loaded",this.boundLoadedFunction)},Object.defineProperty(b.DisplacementFilter.prototype,"map",{get:function(){return this.uniforms.displacementMap.value},set:function(a){this.uniforms.displacementMap.value=a}}),Object.defineProperty(b.DisplacementFilter.prototype,"scale",{get:function(){return this.uniforms.scale.value},set:function(a){this.uniforms.scale.value=a}}),Object.defineProperty(b.DisplacementFilter.prototype,"offset",{get:function(){return this.uniforms.offset.value},set:function(a){this.uniforms.offset.value=a}}),b.PixelateFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={invert:{type:"1f",value:0},dimensions:{type:"4fv",value:new b.Float32Array([1e4,100,10,10])},pixelSize:{type:"2f",value:{x:10,y:10}}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform vec2 testDim;","uniform vec4 dimensions;","uniform vec2 pixelSize;","uniform sampler2D uSampler;","void main(void) {"," vec2 coord = vTextureCoord;"," vec2 size = dimensions.xy/pixelSize;"," vec2 color = floor( ( vTextureCoord * size ) ) / size + pixelSize/dimensions.xy * 0.5;"," gl_FragColor = texture2D(uSampler, color);","}"]},b.PixelateFilter.prototype=Object.create(b.AbstractFilter.prototype),b.PixelateFilter.prototype.constructor=b.PixelateFilter,Object.defineProperty(b.PixelateFilter.prototype,"size",{get:function(){return this.uniforms.pixelSize.value},set:function(a){this.dirty=!0,this.uniforms.pixelSize.value=a}}),b.BlurXFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={blur:{type:"1f",value:1/512}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float blur;","uniform sampler2D uSampler;","void main(void) {"," vec4 sum = vec4(0.0);"," sum += texture2D(uSampler, vec2(vTextureCoord.x - 4.0*blur, vTextureCoord.y)) * 0.05;"," sum += texture2D(uSampler, vec2(vTextureCoord.x - 3.0*blur, vTextureCoord.y)) * 0.09;"," sum += texture2D(uSampler, vec2(vTextureCoord.x - 2.0*blur, vTextureCoord.y)) * 0.12;"," sum += texture2D(uSampler, vec2(vTextureCoord.x - blur, vTextureCoord.y)) * 0.15;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;"," sum += texture2D(uSampler, vec2(vTextureCoord.x + blur, vTextureCoord.y)) * 0.15;"," sum += texture2D(uSampler, vec2(vTextureCoord.x + 2.0*blur, vTextureCoord.y)) * 0.12;"," sum += texture2D(uSampler, vec2(vTextureCoord.x + 3.0*blur, vTextureCoord.y)) * 0.09;"," sum += texture2D(uSampler, vec2(vTextureCoord.x + 4.0*blur, vTextureCoord.y)) * 0.05;"," gl_FragColor = sum;","}"]},b.BlurXFilter.prototype=Object.create(b.AbstractFilter.prototype),b.BlurXFilter.prototype.constructor=b.BlurXFilter,Object.defineProperty(b.BlurXFilter.prototype,"blur",{get:function(){return this.uniforms.blur.value/(1/7e3)},set:function(a){this.dirty=!0,this.uniforms.blur.value=1/7e3*a}}),b.BlurYFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={blur:{type:"1f",value:1/512}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float blur;","uniform sampler2D uSampler;","void main(void) {"," vec4 sum = vec4(0.0);"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 4.0*blur)) * 0.05;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 3.0*blur)) * 0.09;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 2.0*blur)) * 0.12;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - blur)) * 0.15;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + blur)) * 0.15;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 2.0*blur)) * 0.12;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 3.0*blur)) * 0.09;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 4.0*blur)) * 0.05;"," gl_FragColor = sum;","}"]},b.BlurYFilter.prototype=Object.create(b.AbstractFilter.prototype),b.BlurYFilter.prototype.constructor=b.BlurYFilter,Object.defineProperty(b.BlurYFilter.prototype,"blur",{get:function(){return this.uniforms.blur.value/(1/7e3)},set:function(a){this.uniforms.blur.value=1/7e3*a}}),b.BlurFilter=function(){this.blurXFilter=new b.BlurXFilter,this.blurYFilter=new b.BlurYFilter,this.passes=[this.blurXFilter,this.blurYFilter]},b.BlurFilter.prototype=Object.create(b.AbstractFilter.prototype),b.BlurFilter.prototype.constructor=b.BlurFilter,Object.defineProperty(b.BlurFilter.prototype,"blur",{get:function(){return this.blurXFilter.blur},set:function(a){this.blurXFilter.blur=this.blurYFilter.blur=a}}),Object.defineProperty(b.BlurFilter.prototype,"blurX",{get:function(){return this.blurXFilter.blur},set:function(a){this.blurXFilter.blur=a}}),Object.defineProperty(b.BlurFilter.prototype,"blurY",{get:function(){return this.blurYFilter.blur},set:function(a){this.blurYFilter.blur=a}}),b.InvertFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={invert:{type:"1f",value:1}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float invert;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord);"," gl_FragColor.rgb = mix( (vec3(1)-gl_FragColor.rgb) * gl_FragColor.a, gl_FragColor.rgb, 1.0 - invert);","}"]},b.InvertFilter.prototype=Object.create(b.AbstractFilter.prototype),b.InvertFilter.prototype.constructor=b.InvertFilter,Object.defineProperty(b.InvertFilter.prototype,"invert",{get:function(){return this.uniforms.invert.value},set:function(a){this.uniforms.invert.value=a}}),b.SepiaFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={sepia:{type:"1f",value:1}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float sepia;","uniform sampler2D uSampler;","const mat3 sepiaMatrix = mat3(0.3588, 0.7044, 0.1368, 0.2990, 0.5870, 0.1140, 0.2392, 0.4696, 0.0912);","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord);"," gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb * sepiaMatrix, sepia);","}"]},b.SepiaFilter.prototype=Object.create(b.AbstractFilter.prototype),b.SepiaFilter.prototype.constructor=b.SepiaFilter,Object.defineProperty(b.SepiaFilter.prototype,"sepia",{get:function(){return this.uniforms.sepia.value},set:function(a){this.uniforms.sepia.value=a}}),b.TwistFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={radius:{type:"1f",value:.5},angle:{type:"1f",value:5},offset:{type:"2f",value:{x:.5,y:.5}}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform vec4 dimensions;","uniform sampler2D uSampler;","uniform float radius;","uniform float angle;","uniform vec2 offset;","void main(void) {"," vec2 coord = vTextureCoord - offset;"," float distance = length(coord);"," if (distance < radius) {"," float ratio = (radius - distance) / radius;"," float angleMod = ratio * ratio * angle;"," float s = sin(angleMod);"," float c = cos(angleMod);"," coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);"," }"," gl_FragColor = texture2D(uSampler, coord+offset);","}"]},b.TwistFilter.prototype=Object.create(b.AbstractFilter.prototype),b.TwistFilter.prototype.constructor=b.TwistFilter,Object.defineProperty(b.TwistFilter.prototype,"offset",{get:function(){return this.uniforms.offset.value},set:function(a){this.dirty=!0,this.uniforms.offset.value=a}}),Object.defineProperty(b.TwistFilter.prototype,"radius",{get:function(){return this.uniforms.radius.value},set:function(a){this.dirty=!0,this.uniforms.radius.value=a}}),Object.defineProperty(b.TwistFilter.prototype,"angle",{get:function(){return this.uniforms.angle.value},set:function(a){this.dirty=!0,this.uniforms.angle.value=a}}),b.ColorStepFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={step:{type:"1f",value:5}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","uniform float step;","void main(void) {"," vec4 color = texture2D(uSampler, vTextureCoord);"," color = floor(color * step) / step;"," gl_FragColor = color;","}"]},b.ColorStepFilter.prototype=Object.create(b.AbstractFilter.prototype),b.ColorStepFilter.prototype.constructor=b.ColorStepFilter,Object.defineProperty(b.ColorStepFilter.prototype,"step",{get:function(){return this.uniforms.step.value},set:function(a){this.uniforms.step.value=a}}),b.DotScreenFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={scale:{type:"1f",value:1},angle:{type:"1f",value:5},dimensions:{type:"4fv",value:[0,0,0,0]}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform vec4 dimensions;","uniform sampler2D uSampler;","uniform float angle;","uniform float scale;","float pattern() {"," float s = sin(angle), c = cos(angle);"," vec2 tex = vTextureCoord * dimensions.xy;"," vec2 point = vec2("," c * tex.x - s * tex.y,"," s * tex.x + c * tex.y"," ) * scale;"," return (sin(point.x) * sin(point.y)) * 4.0;","}","void main() {"," vec4 color = texture2D(uSampler, vTextureCoord);"," float average = (color.r + color.g + color.b) / 3.0;"," gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);","}"]},b.DotScreenFilter.prototype=Object.create(b.AbstractFilter.prototype),b.DotScreenFilter.prototype.constructor=b.DotScreenFilter,Object.defineProperty(b.DotScreenFilter.prototype,"scale",{get:function(){return this.uniforms.scale.value},set:function(a){this.dirty=!0,this.uniforms.scale.value=a}}),Object.defineProperty(b.DotScreenFilter.prototype,"angle",{get:function(){return this.uniforms.angle.value},set:function(a){this.dirty=!0,this.uniforms.angle.value=a}}),b.CrossHatchFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={blur:{type:"1f",value:1/512}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float blur;","uniform sampler2D uSampler;","void main(void) {"," float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);"," gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);"," if (lum < 1.00) {"," if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {"," gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);"," }"," }"," if (lum < 0.75) {"," if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {"," gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);"," }"," }"," if (lum < 0.50) {"," if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {"," gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);"," }"," }"," if (lum < 0.3) {"," if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {"," gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);"," }"," }","}"]},b.CrossHatchFilter.prototype=Object.create(b.AbstractFilter.prototype),b.CrossHatchFilter.prototype.constructor=b.CrossHatchFilter,Object.defineProperty(b.CrossHatchFilter.prototype,"blur",{get:function(){return this.uniforms.blur.value/(1/7e3)},set:function(a){this.uniforms.blur.value=1/7e3*a}}),b.RGBSplitFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={red:{type:"2f",value:{x:20,y:20}},green:{type:"2f",value:{x:-20,y:20}},blue:{type:"2f",value:{x:20,y:-20}},dimensions:{type:"4fv",value:[0,0,0,0]}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform vec2 red;","uniform vec2 green;","uniform vec2 blue;","uniform vec4 dimensions;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/dimensions.xy).r;"," gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/dimensions.xy).g;"," gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/dimensions.xy).b;"," gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;","}"]},b.RGBSplitFilter.prototype=Object.create(b.AbstractFilter.prototype),b.RGBSplitFilter.prototype.constructor=b.RGBSplitFilter,Object.defineProperty(b.RGBSplitFilter.prototype,"red",{get:function(){return this.uniforms.red.value},set:function(a){this.uniforms.red.value=a}}),Object.defineProperty(b.RGBSplitFilter.prototype,"green",{get:function(){return this.uniforms.green.value},set:function(a){this.uniforms.green.value=a}}),Object.defineProperty(b.RGBSplitFilter.prototype,"blue",{get:function(){return this.uniforms.blue.value},set:function(a){this.uniforms.blue.value=a}}),"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=b),exports.PIXI=b):"undefined"!=typeof define&&define.amd?define(b):a.PIXI=b}).call(this); \ No newline at end of file diff --git a/tutorial-2/pixi.js-master/bower.json b/tutorial-2/pixi.js-master/bower.json deleted file mode 100755 index 7d5d86b..0000000 --- a/tutorial-2/pixi.js-master/bower.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "pixi.js", - "version": "2.2.7", - - "main": "bin/pixi.dev.js", - - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test" - ], - "dependencies": { - }, - "devDependencies": { - } -} diff --git a/tutorial-2/pixi.js-master/docs/api.js b/tutorial-2/pixi.js-master/docs/api.js deleted file mode 100755 index c298d63..0000000 --- a/tutorial-2/pixi.js-master/docs/api.js +++ /dev/null @@ -1,100 +0,0 @@ -YUI.add("yuidoc-meta", function(Y) { - Y.YUIDoc = { meta: { - "classes": [ - "AbstractFilter", - "AjaxRequest", - "AlphaMaskFilter", - "AsciiFilter", - "AssetLoader", - "AtlasLoader", - "BaseTexture", - "BitmapFontLoader", - "BitmapText", - "BlurFilter", - "BlurXFilter", - "BlurYFilter", - "CanvasBuffer", - "CanvasGraphics", - "CanvasMaskManager", - "CanvasRenderer", - "CanvasTinter", - "Circle", - "ColorMatrixFilter", - "ColorStepFilter", - "ComplexPrimitiveShader", - "ConvolutionFilter", - "CrossHatchFilter", - "DisplacementFilter", - "DisplayObject", - "DisplayObjectContainer", - "DotScreenFilter", - "Ellipse", - "Event", - "EventTarget", - "FilterBlock", - "FilterTexture", - "Graphics", - "GraphicsData", - "GrayFilter", - "ImageLoader", - "InteractionData", - "InteractionManager", - "InvertFilter", - "JsonLoader", - "Matrix", - "MovieClip", - "NoiseFilter", - "NormalMapFilter", - "PixelateFilter", - "PixiFastShader", - "PixiShader", - "Point", - "PolyK", - "Polygon", - "PrimitiveShader", - "RGBSplitFilter", - "Rectangle", - "RenderTexture", - "Rope", - "Rounded Rectangle", - "SepiaFilter", - "SmartBlurFilter", - "Spine", - "SpineLoader", - "Sprite", - "SpriteBatch", - "SpriteSheetLoader", - "Stage", - "Strip", - "StripShader", - "Text", - "Texture", - "TilingSprite", - "TiltShiftFilter", - "TiltShiftXFilter", - "TiltShiftYFilter", - "TwistFilter", - "WebGLBlendModeManager", - "WebGLFastSpriteBatch", - "WebGLFilterManager", - "WebGLGraphics", - "WebGLGraphicsData", - "WebGLMaskManager", - "WebGLRenderer", - "WebGLShaderManager", - "WebGLSpriteBatch", - "WebGLStencilManager", - "autoDetectRecommendedRenderer", - "autoDetectRenderer" - ], - "modules": [ - "PIXI" - ], - "allModules": [ - { - "displayName": "PIXI", - "name": "PIXI" - } - ] -} }; -}); \ No newline at end of file diff --git a/tutorial-2/pixi.js-master/docs/assets/css/external-small.png b/tutorial-2/pixi.js-master/docs/assets/css/external-small.png deleted file mode 100755 index 759a1cd..0000000 Binary files a/tutorial-2/pixi.js-master/docs/assets/css/external-small.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/docs/assets/css/logo.png b/tutorial-2/pixi.js-master/docs/assets/css/logo.png deleted file mode 100755 index 609b336..0000000 Binary files a/tutorial-2/pixi.js-master/docs/assets/css/logo.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/docs/assets/css/main.css b/tutorial-2/pixi.js-master/docs/assets/css/main.css deleted file mode 100755 index d745d44..0000000 --- a/tutorial-2/pixi.js-master/docs/assets/css/main.css +++ /dev/null @@ -1,783 +0,0 @@ -/* -Font sizes for all selectors other than the body are given in percentages, -with 100% equal to 13px. To calculate a font size percentage, multiply the -desired size in pixels by 7.6923076923. - -Here's a quick lookup table: - -10px - 76.923% -11px - 84.615% -12px - 92.308% -13px - 100% -14px - 107.692% -15px - 115.385% -16px - 123.077% -17px - 130.769% -18px - 138.462% -19px - 146.154% -20px - 153.846% -*/ - -html { - background: #fff; - color: #333; - overflow-y: scroll; -} - -body { - /*font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif;*/ - font: 13px/1.4 'Helvetica', 'Arial', sans-serif; - margin: 0; - padding: 0; -} - -/* -- Links ----------------------------------------------------------------- */ -a { - color: #356de4; - text-decoration: none; -} - -.hidden { - display: none; -} - -a:hover { text-decoration: underline; } - -/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from - sight until it's focused. */ -.jump { - position: absolute; - padding: 3px 6px; - left: -99999px; - top: 0; -} - -.jump:focus { left: 40%; } - -/* -- Paragraphs ------------------------------------------------------------ */ -p { margin: 1.3em 0; } -dd p, td p { margin-bottom: 0; } -dd p:first-child, td p:first-child { margin-top: 0; } - -/* -- Headings -------------------------------------------------------------- */ -h1, h2, h3, h4, h5, h6 { - color: #D98527;/*was #f80*/ - font-family: 'Trebuchet MS', sans-serif; - font-weight: bold; - line-height: 1.1; - margin: 1.1em 0 0.5em; -} - -h1 { - font-size: 184.6%; - color: #30418C; - margin: 0.75em 0 0.5em; -} - -h2 { - font-size: 153.846%; - color: #E48A2B; -} - -h3 { font-size: 138.462%; } - -h4 { - border-bottom: 1px solid #DBDFEA; - color: #E48A2B; - font-size: 115.385%; - font-weight: normal; - padding-bottom: 2px; -} - -h5, h6 { font-size: 107.692%; } - -/* -- Code and examples ----------------------------------------------------- */ -code, kbd, pre, samp { - font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; - font-size: 92.308%; - line-height: 1.35; -} - -p code, p kbd, p samp { - background: #FCFBFA; - border: 1px solid #EFEEED; - padding: 0 3px; -} - -a code, a kbd, a samp, -pre code, pre kbd, pre samp, -table code, table kbd, table samp, -.intro code, .intro kbd, .intro samp, -.toc code, .toc kbd, .toc samp { - background: none; - border: none; - padding: 0; -} - -pre.code, pre.terminal, pre.cmd { - overflow-x: auto; - *overflow-x: scroll; - padding: 0.3em 0.6em; -} - -pre.code { - background: #FCFBFA; - border: 1px solid #EFEEED; - border-left-width: 5px; -} - -pre.terminal, pre.cmd { - background: #F0EFFC; - border: 1px solid #D0CBFB; - border-left: 5px solid #D0CBFB; -} - -/* Don't reduce the font size of // elements inside
    -   blocks. */
    -pre code, pre kbd, pre samp { font-size: 100%; }
    -
    -/* Used to denote text that shouldn't be selectable, such as line numbers or
    -   shell prompts. Guess which browser this doesn't work in. */
    -.noselect {
    -    -moz-user-select: -moz-none;
    -    -khtml-user-select: none;
    -    -webkit-user-select: none;
    -    -o-user-select: none;
    -    user-select: none;
    -}
    -
    -/* -- Lists ----------------------------------------------------------------- */
    -dd { margin: 0.2em 0 0.7em 1em; }
    -dl { margin: 1em 0; }
    -dt { font-weight: bold; }
    -
    -/* -- Tables ---------------------------------------------------------------- */
    -caption, th { text-align: left; }
    -
    -table {
    -    border-collapse: collapse;
    -    width: 100%;
    -}
    -
    -td, th {
    -    border: 1px solid #fff;
    -    padding: 5px 12px;
    -    vertical-align: top;
    -}
    -
    -td { background: #E6E9F5; }
    -td dl { margin: 0; }
    -td dl dl { margin: 1em 0; }
    -td pre:first-child { margin-top: 0; }
    -
    -th {
    -    background: #D2D7E6;/*#97A0BF*/
    -    border-bottom: none;
    -    border-top: none;
    -    color: #000;/*#FFF1D5*/
    -    font-family: 'Trebuchet MS', sans-serif;
    -    font-weight: bold;
    -    line-height: 1.3;
    -    white-space: nowrap;
    -}
    -
    -
    -/* -- Layout and Content ---------------------------------------------------- */
    -#doc {
    -    margin: auto;
    -    min-width: 1024px;
    -}
    -
    -.content { padding: 0 20px 0 25px; }
    -
    -.sidebar {
    -    padding: 0 15px 0 10px;
    -}
    -#bd {
    -    padding: 7px 0 130px;
    -    position: relative;
    -    width: 99%;
    -}
    -
    -/* -- Table of Contents ----------------------------------------------------- */
    -
    -/* The #toc id refers to the single global table of contents, while the .toc
    -   class refers to generic TOC lists that could be used throughout the page. */
    -
    -.toc code, .toc kbd, .toc samp { font-size: 100%; }
    -.toc li { font-weight: bold; }
    -.toc li li { font-weight: normal; }
    -
    -/* -- Intro and Example Boxes ----------------------------------------------- */
    -/*
    -.intro, .example { margin-bottom: 2em; }
    -.example {
    -    -moz-border-radius: 4px;
    -    -webkit-border-radius: 4px;
    -    border-radius: 4px;
    -    -moz-box-shadow: 0 0 5px #bfbfbf;
    -    -webkit-box-shadow: 0 0 5px #bfbfbf;
    -    box-shadow: 0 0 5px #bfbfbf;
    -    padding: 1em;
    -}
    -.intro {
    -    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    -}
    -*/
    -
    -/* -- Other Styles ---------------------------------------------------------- */
    -
    -/* These are probably YUI-specific, and should be moved out of Selleck's default
    -   theme. */
    -
    -.button {
    -    border: 1px solid #dadada;
    -    -moz-border-radius: 3px;
    -    -webkit-border-radius: 3px;
    -    border-radius: 3px;
    -    color: #444;
    -    display: inline-block;
    -    font-family: Helvetica, Arial, sans-serif;
    -    font-size: 92.308%;
    -    font-weight: bold;
    -    padding: 4px 13px 3px;
    -    -moz-text-shadow: 1px 1px 0 #fff;
    -    -webkit-text-shadow: 1px 1px 0 #fff;
    -    text-shadow: 1px 1px 0 #fff;
    -    white-space: nowrap;
    -
    -    background: #EFEFEF; /* old browsers */
    -    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    -    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    -    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    -}
    -
    -.button:hover {
    -    border-color: #466899;
    -    color: #fff;
    -    text-decoration: none;
    -    -moz-text-shadow: 1px 1px 0 #222;
    -    -webkit-text-shadow: 1px 1px 0 #222;
    -    text-shadow: 1px 1px 0 #222;
    -
    -    background: #6396D8; /* old browsers */
    -    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    -    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    -    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    -}
    -
    -.newwindow { text-align: center; }
    -
    -.header .version em {
    -    display: block;
    -    text-align: right;
    -}
    -
    -
    -#classdocs .item {
    -    border-bottom: 1px solid #466899;
    -    margin: 1em 0;
    -    padding: 1.5em;
    -}
    -
    -#classdocs .item .params p,
    -    #classdocs .item .returns p,{
    -    display: inline;
    -}
    -
    -#classdocs .item em code, #classdocs .item em.comment {
    -    color: green;
    -}
    -
    -#classdocs .item em.comment a {
    -    color: green;
    -    text-decoration: underline;
    -}
    -
    -#classdocs .foundat {
    -    font-size: 11px;
    -    font-style: normal;
    -}
    -
    -.attrs .emits {
    -    margin-left: 2em;
    -    padding: .5em;
    -    border-left: 1px dashed #ccc;
    -}
    -
    -abbr {
    -    border-bottom: 1px dashed #ccc;
    -    font-size: 80%;
    -    cursor: help;
    -}
    -
    -.prettyprint li.L0, 
    -.prettyprint li.L1, 
    -.prettyprint li.L2, 
    -.prettyprint li.L3, 
    -.prettyprint li.L5, 
    -.prettyprint li.L6, 
    -.prettyprint li.L7, 
    -.prettyprint li.L8 {
    -    list-style: decimal;
    -}
    -
    -ul li p {
    -    margin-top: 0;
    -}
    -
    -.method .name {
    -    font-size: 110%;
    -}
    -
    -.apidocs .methods .extends .method,
    -.apidocs .properties .extends .property,
    -.apidocs .attrs .extends .attr,
    -.apidocs .events .extends .event {
    -    font-weight: bold;
    -}
    -
    -.apidocs .methods .extends .inherited,
    -.apidocs .properties .extends .inherited,
    -.apidocs .attrs .extends .inherited,
    -.apidocs .events .extends .inherited {
    -    font-weight: normal;
    -}
    -
    -#hd {
    -    background: whiteSmoke;
    -    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    -    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    -    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    -    border-bottom: 1px solid #DFDFDF;
    -    padding: 0 15px 1px 20px;
    -    margin-bottom: 15px;
    -}
    -
    -#hd img {
    -    margin-right: 10px;
    -    vertical-align: middle;
    -}
    -
    -
    -/* -- API Docs CSS ---------------------------------------------------------- */
    -
    -/*
    -This file is organized so that more generic styles are nearer the top, and more
    -specific styles are nearer the bottom of the file. This allows us to take full
    -advantage of the cascade to avoid redundant style rules. Please respect this
    -convention when making changes.
    -*/
    -
    -/* -- Generic TabView styles ------------------------------------------------ */
    -
    -/*
    -These styles apply to all API doc tabviews. To change styles only for a
    -specific tabview, see the other sections below.
    -*/
    -
    -.yui3-js-enabled .apidocs .tabview {
    -    visibility: hidden; /* Hide until the TabView finishes rendering. */
    -    _visibility: visible;
    -}
    -
    -.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    -.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    -
    -/* -- Generic Content Styles ------------------------------------------------ */
    -
    -/* Headings */
    -h2, h3, h4, h5, h6 {
    -    border: none;
    -    color: #30418C;
    -    font-weight: bold;
    -    text-decoration: none;
    -}
    -
    -.link-docs {
    -    float: right;
    -    font-size: 15px;
    -    margin: 4px 4px 6px;
    -    padding: 6px 30px 5px;
    -}
    -
    -.apidocs { zoom: 1; }
    -
    -/* Generic box styles. */
    -.apidocs .box {
    -    border: 1px solid;
    -    border-radius: 3px;
    -    margin: 1em 0;
    -    padding: 0 1em;
    -}
    -
    -/* A flag is a compact, capsule-like indicator of some kind. It's used to
    -   indicate private and protected items, item return types, etc. in an
    -   attractive and unobtrusive way. */
    -.apidocs .flag {
    -    background: #bababa;
    -    border-radius: 3px;
    -    color: #fff;
    -    font-size: 11px;
    -    margin: 0 0.5em;
    -    padding: 2px 4px 1px;
    -}
    -
    -/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    -.apidocs .meta {
    -    background: #f9f9f9;
    -    border-color: #efefef;
    -    color: #555;
    -    font-size: 11px;
    -    padding: 3px 6px;
    -}
    -
    -.apidocs .meta p { margin: 0; }
    -
    -/* Deprecation warning. */
    -.apidocs .box.deprecated,
    -.apidocs .flag.deprecated {
    -    background: #fdac9f;
    -    border: 1px solid #fd7775;
    -}
    -
    -.apidocs .box.deprecated p { margin: 0.5em 0; }
    -.apidocs .flag.deprecated { color: #333; }
    -
    -/* Module/Class intro description. */
    -.apidocs .intro {
    -    background: #f0f1f8;
    -    border-color: #d4d8eb;
    -}
    -
    -/* Loading spinners. */
    -#bd.loading .apidocs,
    -#api-list.loading .yui3-tabview-panel {
    -    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    -    min-height: 150px;
    -}
    -
    -#bd.loading .apidocs .content,
    -#api-list.loading .yui3-tabview-panel .apis {
    -    display: none;
    -}
    -
    -.apidocs .no-visible-items { color: #666; }
    -
    -/* Generic inline list. */
    -.apidocs ul.inline {
    -    display: inline;
    -    list-style: none;
    -    margin: 0;
    -    padding: 0;
    -}
    -
    -.apidocs ul.inline li { display: inline; }
    -
    -/* Comma-separated list. */
    -.apidocs ul.commas li:after { content: ','; }
    -.apidocs ul.commas li:last-child:after { content: ''; }
    -
    -/* Keyboard shortcuts. */
    -kbd .cmd { font-family: Monaco, Helvetica; }
    -
    -/* -- Generic Access Level styles ------------------------------------------- */
    -.apidocs .item.protected,
    -.apidocs .item.private,
    -.apidocs .index-item.protected,
    -.apidocs .index-item.deprecated,
    -.apidocs .index-item.private {
    -    display: none;
    -}
    -
    -.show-deprecated .item.deprecated,
    -.show-deprecated .index-item.deprecated,
    -.show-protected .item.protected,
    -.show-protected .index-item.protected,
    -.show-private .item.private,
    -.show-private .index-item.private {
    -    display: block;
    -}
    -
    -.hide-inherited .item.inherited,
    -.hide-inherited .index-item.inherited {
    -    display: none;
    -}
    -
    -/* -- Generic Item Index styles --------------------------------------------- */
    -.apidocs .index { margin: 1.5em 0 3em; }
    -
    -.apidocs .index h3 {
    -    border-bottom: 1px solid #efefef;
    -    color: #333;
    -    font-size: 13px;
    -    margin: 2em 0 0.6em;
    -    padding-bottom: 2px;
    -}
    -
    -.apidocs .index .no-visible-items { margin-top: 2em; }
    -
    -.apidocs .index-list {
    -    border-color: #efefef;
    -    font-size: 12px;
    -    list-style: none;
    -    margin: 0;
    -    padding: 0;
    -    -moz-column-count: 4;
    -    -moz-column-gap: 10px;
    -    -moz-column-width: 170px;
    -    -ms-column-count: 4;
    -    -ms-column-gap: 10px;
    -    -ms-column-width: 170px;
    -    -o-column-count: 4;
    -    -o-column-gap: 10px;
    -    -o-column-width: 170px;
    -    -webkit-column-count: 4;
    -    -webkit-column-gap: 10px;
    -    -webkit-column-width: 170px;
    -    column-count: 4;
    -    column-gap: 10px;
    -    column-width: 170px;
    -}
    -
    -.apidocs .no-columns .index-list {
    -    -moz-column-count: 1;
    -    -ms-column-count: 1;
    -    -o-column-count: 1;
    -    -webkit-column-count: 1;
    -    column-count: 1;
    -}
    -
    -.apidocs .index-item { white-space: nowrap; }
    -
    -.apidocs .index-item .flag {
    -    background: none;
    -    border: none;
    -    color: #afafaf;
    -    display: inline;
    -    margin: 0 0 0 0.2em;
    -    padding: 0;
    -}
    -
    -/* -- Generic API item styles ----------------------------------------------- */
    -.apidocs .args {
    -    display: inline;
    -    margin: 0 0.5em;
    -}
    -
    -.apidocs .flag.chainable { background: #46ca3b; }
    -.apidocs .flag.protected { background: #9b86fc; }
    -.apidocs .flag.private { background: #fd6b1b; }
    -.apidocs .flag.async { background: #356de4; }
    -.apidocs .flag.required { background: #e60923; }
    -
    -.apidocs .item {
    -    border-bottom: 1px solid #efefef;
    -    margin: 1.5em 0 2em;
    -    padding-bottom: 2em;
    -}
    -
    -.apidocs .item h4,
    -.apidocs .item h5,
    -.apidocs .item h6 {
    -    color: #333;
    -    font-family: inherit;
    -    font-size: 100%;
    -}
    -
    -.apidocs .item .description p,
    -.apidocs .item pre.code {
    -    margin: 1em 0 0;
    -}
    -
    -.apidocs .item .meta {
    -    background: none;
    -    border: none;
    -    padding: 0;
    -}
    -
    -.apidocs .item .name {
    -    display: inline;
    -    font-size: 14px;
    -}
    -
    -.apidocs .item .type,
    -.apidocs .item .type a,
    -.apidocs .returns-inline {
    -    color: #555;
    -}
    -
    -.apidocs .item .type,
    -.apidocs .returns-inline {
    -    font-size: 11px;
    -    margin: 0 0 0 0;
    -}
    -
    -.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    -.apidocs .item .type a:hover { border: none; }
    -
    -/* -- Item Parameter List --------------------------------------------------- */
    -.apidocs .params-list {
    -    list-style: square;
    -    margin: 1em 0 0 2em;
    -    padding: 0;
    -}
    -
    -.apidocs .param { margin-bottom: 1em; }
    -
    -.apidocs .param .type,
    -.apidocs .param .type a {
    -    color: #666;
    -}
    -
    -.apidocs .param .type {
    -    margin: 0 0 0 0.5em;
    -    *margin-left: 0.5em;
    -}
    -
    -.apidocs .param-name { font-weight: bold; }
    -
    -/* -- Item "Emits" block ---------------------------------------------------- */
    -.apidocs .item .emits {
    -    background: #f9f9f9;
    -    border-color: #eaeaea;
    -}
    -
    -/* -- Item "Returns" block -------------------------------------------------- */
    -.apidocs .item .returns .type,
    -.apidocs .item .returns .type a {
    -    font-size: 100%;
    -    margin: 0;
    -}
    -
    -/* -- Class Constructor block ----------------------------------------------- */
    -.apidocs .constructor .item {
    -    border: none;
    -    padding-bottom: 0;
    -}
    -
    -/* -- File Source View ------------------------------------------------------ */
    -.apidocs .file pre.code,
    -#doc .apidocs .file pre.prettyprint {
    -    background: inherit;
    -    border: none;
    -    overflow: visible;
    -    padding: 0;
    -}
    -
    -.apidocs .L0,
    -.apidocs .L1,
    -.apidocs .L2,
    -.apidocs .L3,
    -.apidocs .L4,
    -.apidocs .L5,
    -.apidocs .L6,
    -.apidocs .L7,
    -.apidocs .L8,
    -.apidocs .L9 {
    -    background: inherit;
    -}
    -
    -/* -- Submodule List -------------------------------------------------------- */
    -.apidocs .module-submodule-description {
    -    font-size: 12px;
    -    margin: 0.3em 0 1em;
    -}
    -
    -.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    -
    -/* -- Sidebar TabView ------------------------------------------------------- */
    -#api-tabview { margin-top: 0.6em; }
    -
    -#api-tabview-filter,
    -#api-tabview-panel {
    -    border: 1px solid #dfdfdf;
    -}
    -
    -#api-tabview-filter {
    -    border-bottom: none;
    -    border-top: none;
    -    padding: 0.6em 10px 0 10px;
    -}
    -
    -#api-tabview-panel { border-top: none; }
    -#api-filter { width: 97%; }
    -
    -/* -- Content TabView ------------------------------------------------------- */
    -#classdocs .yui3-tabview-panel { border: none; }
    -
    -/* -- Source File Contents -------------------------------------------------- */
    -.prettyprint li.L0,
    -.prettyprint li.L1,
    -.prettyprint li.L2,
    -.prettyprint li.L3,
    -.prettyprint li.L5,
    -.prettyprint li.L6,
    -.prettyprint li.L7,
    -.prettyprint li.L8 {
    -    list-style: decimal;
    -}
    -
    -/* -- API options ----------------------------------------------------------- */
    -#api-options {
    -    font-size: 11px;
    -    margin-top: 2.2em;
    -    position: absolute;
    -    right: 1.5em;
    -}
    -
    -/*#api-options label { margin-right: 0.6em; }*/
    -
    -/* -- API list -------------------------------------------------------------- */
    -#api-list {
    -    margin-top: 1.5em;
    -    *zoom: 1;
    -}
    -
    -.apis {
    -    font-size: 12px;
    -    line-height: 1.4;
    -    list-style: none;
    -    margin: 0;
    -    padding: 0.5em 0 0.5em 0.4em;
    -}
    -
    -.apis a {
    -    border: 1px solid transparent;
    -    display: block;
    -    margin: 0 0 0 -4px;
    -    padding: 1px 4px 0;
    -    text-decoration: none;
    -    _border: none;
    -    _display: inline;
    -}
    -
    -.apis a:hover,
    -.apis a:focus {
    -    background: #E8EDFC;
    -    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    -    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    -    border-color: #AAC0FA;
    -    border-radius: 3px;
    -    color: #333;
    -    outline: none;
    -}
    -
    -.api-list-item a:hover,
    -.api-list-item a:focus {
    -    font-weight: bold;
    -    text-shadow: 1px 1px 1px #fff;
    -}
    -
    -.apis .message { color: #888; }
    -.apis .result a { padding: 3px 5px 2px; }
    -
    -.apis .result .type {
    -    right: 4px;
    -    top: 7px;
    -}
    -
    -.api-list-item .yui3-highlight {
    -    font-weight: bold;
    -}
    -
    diff --git a/tutorial-2/pixi.js-master/docs/assets/favicon.png b/tutorial-2/pixi.js-master/docs/assets/favicon.png
    deleted file mode 100755
    index 5a95dda..0000000
    Binary files a/tutorial-2/pixi.js-master/docs/assets/favicon.png and /dev/null differ
    diff --git a/tutorial-2/pixi.js-master/docs/assets/img/spinner.gif b/tutorial-2/pixi.js-master/docs/assets/img/spinner.gif
    deleted file mode 100755
    index 44f96ba..0000000
    Binary files a/tutorial-2/pixi.js-master/docs/assets/img/spinner.gif and /dev/null differ
    diff --git a/tutorial-2/pixi.js-master/docs/assets/index.html b/tutorial-2/pixi.js-master/docs/assets/index.html
    deleted file mode 100755
    index 487fe15..0000000
    --- a/tutorial-2/pixi.js-master/docs/assets/index.html
    +++ /dev/null
    @@ -1,10 +0,0 @@
    -
    -
    -    
    -        Redirector
    -        
    -    
    -    
    -        Click here to redirect
    -    
    -
    diff --git a/tutorial-2/pixi.js-master/docs/assets/js/api-filter.js b/tutorial-2/pixi.js-master/docs/assets/js/api-filter.js
    deleted file mode 100755
    index 37aefba..0000000
    --- a/tutorial-2/pixi.js-master/docs/assets/js/api-filter.js
    +++ /dev/null
    @@ -1,52 +0,0 @@
    -YUI.add('api-filter', function (Y) {
    -
    -Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    -    // -- Initializer ----------------------------------------------------------
    -    initializer: function () {
    -        this._bindUIACBase();
    -        this._syncUIACBase();
    -    },
    -    getDisplayName: function(name) {
    -
    -        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    -            if (i.name === name && i.displayName) {
    -                name = i.displayName;
    -            }
    -        });
    -
    -        return name;
    -    }
    -
    -}, {
    -    // -- Attributes -----------------------------------------------------------
    -    ATTRS: {
    -        resultHighlighter: {
    -            value: 'phraseMatch'
    -        },
    -
    -        // May be set to "classes" or "modules".
    -        queryType: {
    -            value: 'classes'
    -        },
    -
    -        source: {
    -            valueFn: function() {
    -                var self = this;
    -                return function(q) {
    -                    var data = Y.YUIDoc.meta[self.get('queryType')],
    -                        out = [];
    -                    Y.each(data, function(v) {
    -                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    -                            out.push(v);
    -                        }
    -                    });
    -                    return out;
    -                };
    -            }
    -        }
    -    }
    -});
    -
    -}, '3.4.0', {requires: [
    -    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    -]});
    diff --git a/tutorial-2/pixi.js-master/docs/assets/js/api-list.js b/tutorial-2/pixi.js-master/docs/assets/js/api-list.js
    deleted file mode 100755
    index 88905b5..0000000
    --- a/tutorial-2/pixi.js-master/docs/assets/js/api-list.js
    +++ /dev/null
    @@ -1,251 +0,0 @@
    -YUI.add('api-list', function (Y) {
    -
    -var Lang   = Y.Lang,
    -    YArray = Y.Array,
    -
    -    APIList = Y.namespace('APIList'),
    -
    -    classesNode    = Y.one('#api-classes'),
    -    inputNode      = Y.one('#api-filter'),
    -    modulesNode    = Y.one('#api-modules'),
    -    tabviewNode    = Y.one('#api-tabview'),
    -
    -    tabs = APIList.tabs = {},
    -
    -    filter = APIList.filter = new Y.APIFilter({
    -        inputNode : inputNode,
    -        maxResults: 1000,
    -
    -        on: {
    -            results: onFilterResults
    -        }
    -    }),
    -
    -    search = APIList.search = new Y.APISearch({
    -        inputNode : inputNode,
    -        maxResults: 100,
    -
    -        on: {
    -            clear  : onSearchClear,
    -            results: onSearchResults
    -        }
    -    }),
    -
    -    tabview = APIList.tabview = new Y.TabView({
    -        srcNode  : tabviewNode,
    -        panelNode: '#api-tabview-panel',
    -        render   : true,
    -
    -        on: {
    -            selectionChange: onTabSelectionChange
    -        }
    -    }),
    -
    -    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    -        circular   : true,
    -        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    -        keys       : {next: 'down:40', previous: 'down:38'}
    -    }).focusManager,
    -
    -    LIST_ITEM_TEMPLATE =
    -        '
  • ' + - '{displayName}' + - '
  • '; - -// -- Init --------------------------------------------------------------------- - -// Duckpunch FocusManager's key event handling to prevent it from handling key -// events when a modifier is pressed. -Y.before(function (e, activeDescendant) { - if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { - return new Y.Do.Prevent(); - } -}, focusManager, '_focusPrevious', focusManager); - -Y.before(function (e, activeDescendant) { - if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { - return new Y.Do.Prevent(); - } -}, focusManager, '_focusNext', focusManager); - -// Create a mapping of tabs in the tabview so we can refer to them easily later. -tabview.each(function (tab, index) { - var name = tab.get('label').toLowerCase(); - - tabs[name] = { - index: index, - name : name, - tab : tab - }; -}); - -// Switch tabs on Ctrl/Cmd-Left/Right arrows. -tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); - -// Focus the filter input when the `/` key is pressed. -Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); - -// Keep the Focus Manager up to date. -inputNode.on('focus', function () { - focusManager.set('activeDescendant', inputNode); -}); - -// Update all tabview links to resolved URLs. -tabview.get('panelNode').all('a').each(function (link) { - link.setAttribute('href', link.get('href')); -}); - -// -- Private Functions -------------------------------------------------------- -function getFilterResultNode() { - return filter.get('queryType') === 'classes' ? classesNode : modulesNode; -} - -// -- Event Handlers ----------------------------------------------------------- -function onFilterResults(e) { - var frag = Y.one(Y.config.doc.createDocumentFragment()), - resultNode = getFilterResultNode(), - typePlural = filter.get('queryType'), - typeSingular = typePlural === 'classes' ? 'class' : 'module'; - - if (e.results.length) { - YArray.each(e.results, function (result) { - frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { - rootPath : APIList.rootPath, - displayName : filter.getDisplayName(result.highlighted), - name : result.text, - typePlural : typePlural, - typeSingular: typeSingular - })); - }); - } else { - frag.append( - '
  • ' + - 'No ' + typePlural + ' found.' + - '
  • ' - ); - } - - resultNode.empty(true); - resultNode.append(frag); - - focusManager.refresh(); -} - -function onSearchClear(e) { - - focusManager.refresh(); -} - -function onSearchKey(e) { - var target = e.target; - - if (target.test('input,select,textarea') - || target.get('isContentEditable')) { - return; - } - - e.preventDefault(); - - inputNode.focus(); - focusManager.refresh(); -} - -function onSearchResults(e) { - var frag = Y.one(Y.config.doc.createDocumentFragment()); - - if (e.results.length) { - YArray.each(e.results, function (result) { - frag.append(result.display); - }); - } else { - frag.append( - '
  • ' + - 'No results found. Maybe you\'ll have better luck with a ' + - 'different query?' + - '
  • ' - ); - } - - - focusManager.refresh(); -} - -function onTabSelectionChange(e) { - var tab = e.newVal, - name = tab.get('label').toLowerCase(); - - tabs.selected = { - index: tab.get('index'), - name : name, - tab : tab - }; - - switch (name) { - case 'classes': // fallthru - case 'modules': - filter.setAttrs({ - minQueryLength: 0, - queryType : name - }); - - search.set('minQueryLength', -1); - - // Only send a request if this isn't the initially-selected tab. - if (e.prevVal) { - filter.sendRequest(filter.get('value')); - } - break; - - case 'everything': - filter.set('minQueryLength', -1); - search.set('minQueryLength', 1); - - if (search.get('value')) { - search.sendRequest(search.get('value')); - } else { - inputNode.focus(); - } - break; - - default: - // WTF? We shouldn't be here! - filter.set('minQueryLength', -1); - search.set('minQueryLength', -1); - } - - if (focusManager) { - setTimeout(function () { - focusManager.refresh(); - }, 1); - } -} - -function onTabSwitchKey(e) { - var currentTabIndex = tabs.selected.index; - - if (!(e.ctrlKey || e.metaKey)) { - return; - } - - e.preventDefault(); - - switch (e.keyCode) { - case 37: // left arrow - if (currentTabIndex > 0) { - tabview.selectChild(currentTabIndex - 1); - inputNode.focus(); - } - break; - - case 39: // right arrow - if (currentTabIndex < (Y.Object.size(tabs) - 2)) { - tabview.selectChild(currentTabIndex + 1); - inputNode.focus(); - } - break; - } -} - -}, '3.4.0', {requires: [ - 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' -]}); diff --git a/tutorial-2/pixi.js-master/docs/assets/js/api-search.js b/tutorial-2/pixi.js-master/docs/assets/js/api-search.js deleted file mode 100755 index 175f6a6..0000000 --- a/tutorial-2/pixi.js-master/docs/assets/js/api-search.js +++ /dev/null @@ -1,98 +0,0 @@ -YUI.add('api-search', function (Y) { - -var Lang = Y.Lang, - Node = Y.Node, - YArray = Y.Array; - -Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { - // -- Public Properties ---------------------------------------------------- - RESULT_TEMPLATE: - '
  • ' + - '' + - '

    {name}

    ' + - '{resultType}' + - '
    {description}
    ' + - '{class}' + - '
    ' + - '
  • ', - - // -- Initializer ---------------------------------------------------------- - initializer: function () { - this._bindUIACBase(); - this._syncUIACBase(); - }, - - // -- Protected Methods ---------------------------------------------------- - _apiResultFilter: function (query, results) { - // Filter components out of the results. - return YArray.filter(results, function (result) { - return result.raw.resultType === 'component' ? false : result; - }); - }, - - _apiResultFormatter: function (query, results) { - return YArray.map(results, function (result) { - var raw = Y.merge(result.raw), // create a copy - desc = raw.description || ''; - - // Convert description to text and truncate it if necessary. - desc = Node.create('
    ' + desc + '
    ').get('text'); - - if (desc.length > 65) { - desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; - } else { - desc = Y.Escape.html(desc); - } - - raw['class'] || (raw['class'] = ''); - raw.description = desc; - - // Use the highlighted result name. - raw.name = result.highlighted; - - return Lang.sub(this.RESULT_TEMPLATE, raw); - }, this); - }, - - _apiTextLocator: function (result) { - return result.displayName || result.name; - } -}, { - // -- Attributes ----------------------------------------------------------- - ATTRS: { - resultFormatter: { - valueFn: function () { - return this._apiResultFormatter; - } - }, - - resultFilters: { - valueFn: function () { - return this._apiResultFilter; - } - }, - - resultHighlighter: { - value: 'phraseMatch' - }, - - resultListLocator: { - value: 'data.results' - }, - - resultTextLocator: { - valueFn: function () { - return this._apiTextLocator; - } - }, - - source: { - value: '/api/v1/search?q={query}&count={maxResults}' - } - } -}); - -}, '3.4.0', {requires: [ - 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', - 'escape' -]}); diff --git a/tutorial-2/pixi.js-master/docs/assets/js/apidocs.js b/tutorial-2/pixi.js-master/docs/assets/js/apidocs.js deleted file mode 100755 index c64bb46..0000000 --- a/tutorial-2/pixi.js-master/docs/assets/js/apidocs.js +++ /dev/null @@ -1,370 +0,0 @@ -YUI().use( - 'yuidoc-meta', - 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', -function (Y) { - -var win = Y.config.win, - localStorage = win.localStorage, - - bdNode = Y.one('#bd'), - - pjax, - defaultRoute, - - classTabView, - selectedTab; - -// Kill pjax functionality unless serving over HTTP. -if (!Y.getLocation().protocol.match(/^https?\:/)) { - Y.Router.html5 = false; -} - -// Create the default route with middleware which enables syntax highlighting -// on the loaded content. -defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { - prettyPrint(); - bdNode.removeClass('loading'); - - next(); -}); - -pjax = new Y.Pjax({ - container : '#docs-main', - contentSelector: '#docs-main > .content', - linkSelector : '#bd a', - titleSelector : '#xhr-title', - - navigateOnHash: true, - root : '/', - routes : [ - // -- / ---------------------------------------------------------------- - { - path : '/(index.html)?', - callbacks: defaultRoute - }, - - // -- /classes/* ------------------------------------------------------- - { - path : '/classes/:class.html*', - callbacks: [defaultRoute, 'handleClasses'] - }, - - // -- /files/* --------------------------------------------------------- - { - path : '/files/*file', - callbacks: [defaultRoute, 'handleFiles'] - }, - - // -- /modules/* ------------------------------------------------------- - { - path : '/modules/:module.html*', - callbacks: defaultRoute - } - ] -}); - -// -- Utility Functions -------------------------------------------------------- - -pjax.checkVisibility = function (tab) { - tab || (tab = selectedTab); - - if (!tab) { return; } - - var panelNode = tab.get('panelNode'), - visibleItems; - - // If no items are visible in the tab panel due to the current visibility - // settings, display a message to that effect. - visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { - if (itemNode.getComputedStyle('display') !== 'none') { - return true; - } - }); - - panelNode.all('.no-visible-items').remove(); - - if (!visibleItems) { - if (Y.one('#index .index-item')) { - panelNode.append( - '
    ' + - '

    ' + - 'Some items are not shown due to the current visibility ' + - 'settings. Use the checkboxes at the upper right of this ' + - 'page to change the visibility settings.' + - '

    ' + - '
    ' - ); - } else { - panelNode.append( - '
    ' + - '

    ' + - 'This class doesn\'t provide any methods, properties, ' + - 'attributes, or events.' + - '

    ' + - '
    ' - ); - } - } - - // Hide index sections without any visible items. - Y.all('.index-section').each(function (section) { - var items = 0, - visibleItems = 0; - - section.all('.index-item').each(function (itemNode) { - items += 1; - - if (itemNode.getComputedStyle('display') !== 'none') { - visibleItems += 1; - } - }); - - section.toggleClass('hidden', !visibleItems); - section.toggleClass('no-columns', visibleItems < 4); - }); -}; - -pjax.initClassTabView = function () { - if (!Y.all('#classdocs .api-class-tab').size()) { - return; - } - - if (classTabView) { - classTabView.destroy(); - selectedTab = null; - } - - classTabView = new Y.TabView({ - srcNode: '#classdocs', - - on: { - selectionChange: pjax.onTabSelectionChange - } - }); - - pjax.updateTabState(); - classTabView.render(); -}; - -pjax.initLineNumbers = function () { - var hash = win.location.hash.substring(1), - container = pjax.get('container'), - hasLines, node; - - // Add ids for each line number in the file source view. - container.all('.linenums>li').each(function (lineNode, index) { - lineNode.set('id', 'l' + (index + 1)); - lineNode.addClass('file-line'); - hasLines = true; - }); - - // Scroll to the desired line. - if (hasLines && /^l\d+$/.test(hash)) { - if ((node = container.getById(hash))) { - win.scroll(0, node.getY()); - } - } -}; - -pjax.initRoot = function () { - var terminators = /^(?:classes|files|modules)$/, - parts = pjax._getPathRoot().split('/'), - root = [], - i, len, part; - - for (i = 0, len = parts.length; i < len; i += 1) { - part = parts[i]; - - if (part.match(terminators)) { - // Makes sure the path will end with a "/". - root.push(''); - break; - } - - root.push(part); - } - - pjax.set('root', root.join('/')); -}; - -pjax.updateTabState = function (src) { - var hash = win.location.hash.substring(1), - defaultTab, node, tab, tabPanel; - - function scrollToNode() { - if (node.hasClass('protected')) { - Y.one('#api-show-protected').set('checked', true); - pjax.updateVisibility(); - } - - if (node.hasClass('private')) { - Y.one('#api-show-private').set('checked', true); - pjax.updateVisibility(); - } - - setTimeout(function () { - // For some reason, unless we re-get the node instance here, - // getY() always returns 0. - var node = Y.one('#classdocs').getById(hash); - win.scrollTo(0, node.getY() - 70); - }, 1); - } - - if (!classTabView) { - return; - } - - if (src === 'hashchange' && !hash) { - defaultTab = 'index'; - } else { - if (localStorage) { - defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || - 'index'; - } else { - defaultTab = 'index'; - } - } - - if (hash && (node = Y.one('#classdocs').getById(hash))) { - if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { - if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { - if (classTabView.get('rendered')) { - Y.Widget.getByNode(tab).set('selected', 1); - } else { - tab.addClass('yui3-tab-selected'); - } - } - } - - // Scroll to the desired element if this is a hash URL. - if (node) { - if (classTabView.get('rendered')) { - scrollToNode(); - } else { - classTabView.once('renderedChange', scrollToNode); - } - } - } else { - tab = Y.one('#classdocs .api-class-tab.' + defaultTab); - - // When the `defaultTab` node isn't found, `localStorage` is stale. - if (!tab && defaultTab !== 'index') { - tab = Y.one('#classdocs .api-class-tab.index'); - } - - if (classTabView.get('rendered')) { - Y.Widget.getByNode(tab).set('selected', 1); - } else { - tab.addClass('yui3-tab-selected'); - } - } -}; - -pjax.updateVisibility = function () { - var container = pjax.get('container'); - - container.toggleClass('hide-inherited', - !Y.one('#api-show-inherited').get('checked')); - - container.toggleClass('show-deprecated', - Y.one('#api-show-deprecated').get('checked')); - - container.toggleClass('show-protected', - Y.one('#api-show-protected').get('checked')); - - container.toggleClass('show-private', - Y.one('#api-show-private').get('checked')); - - pjax.checkVisibility(); -}; - -// -- Route Handlers ----------------------------------------------------------- - -pjax.handleClasses = function (req, res, next) { - var status = res.ioResponse.status; - - // Handles success and local filesystem XHRs. - if (!status || (status >= 200 && status < 300)) { - pjax.initClassTabView(); - } - - next(); -}; - -pjax.handleFiles = function (req, res, next) { - var status = res.ioResponse.status; - - // Handles success and local filesystem XHRs. - if (!status || (status >= 200 && status < 300)) { - pjax.initLineNumbers(); - } - - next(); -}; - -// -- Event Handlers ----------------------------------------------------------- - -pjax.onNavigate = function (e) { - var hash = e.hash, - originTarget = e.originEvent && e.originEvent.target, - tab; - - if (hash) { - tab = originTarget && originTarget.ancestor('.yui3-tab', true); - - if (hash === win.location.hash) { - pjax.updateTabState('hashchange'); - } else if (!tab) { - win.location.hash = hash; - } - - e.preventDefault(); - return; - } - - // Only scroll to the top of the page when the URL doesn't have a hash. - this.set('scrollToTop', !e.url.match(/#.+$/)); - - bdNode.addClass('loading'); -}; - -pjax.onOptionClick = function (e) { - pjax.updateVisibility(); -}; - -pjax.onTabSelectionChange = function (e) { - var tab = e.newVal, - tabId = tab.get('contentBox').getAttribute('href').substring(1); - - selectedTab = tab; - - // If switching from a previous tab (i.e., this is not the default tab), - // replace the history entry with a hash URL that will cause this tab to - // be selected if the user navigates away and then returns using the back - // or forward buttons. - if (e.prevVal && localStorage) { - localStorage.setItem('tab_' + pjax.getPath(), tabId); - } - - pjax.checkVisibility(tab); -}; - -// -- Init --------------------------------------------------------------------- - -pjax.on('navigate', pjax.onNavigate); - -pjax.initRoot(); -pjax.upgrade(); -pjax.initClassTabView(); -pjax.initLineNumbers(); -pjax.updateVisibility(); - -Y.APIList.rootPath = pjax.get('root'); - -Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); - -Y.on('hashchange', function (e) { - pjax.updateTabState('hashchange'); -}, win); - -}); diff --git a/tutorial-2/pixi.js-master/docs/assets/js/yui-prettify.js b/tutorial-2/pixi.js-master/docs/assets/js/yui-prettify.js deleted file mode 100755 index 18de864..0000000 --- a/tutorial-2/pixi.js-master/docs/assets/js/yui-prettify.js +++ /dev/null @@ -1,17 +0,0 @@ -YUI().use('node', function(Y) { - var code = Y.all('.prettyprint.linenums'); - if (code.size()) { - code.each(function(c) { - var lis = c.all('ol li'), - l = 1; - lis.each(function(n) { - n.prepend(''); - l++; - }); - }); - var h = location.hash; - location.hash = ''; - h = h.replace('LINE_', 'LINENUM_'); - location.hash = h; - } -}); diff --git a/tutorial-2/pixi.js-master/docs/assets/vendor/prettify/CHANGES.html b/tutorial-2/pixi.js-master/docs/assets/vendor/prettify/CHANGES.html deleted file mode 100755 index b50b841..0000000 --- a/tutorial-2/pixi.js-master/docs/assets/vendor/prettify/CHANGES.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - Change Log - - - README - -

    Known Issues

    -
      -
    • Perl formatting is really crappy. Partly because the author is lazy and - partly because Perl is - hard to parse. -
    • On some browsers, <code> elements with newlines in the text - which use CSS to specify white-space:pre will have the newlines - improperly stripped if the element is not attached to the document at the time - the stripping is done. Also, on IE 6, all newlines will be stripped from - <code> elements because of the way IE6 produces - innerHTML. Workaround: use <pre> for code with - newlines. -
    - -

    Change Log

    -

    29 March 2007

    -
      -
    • Added tests for PHP support - to address - issue 3. -
    • Fixed - bug: prettyPrintOne was not halting. This was not - reachable through the normal entry point. -
    • Fixed - bug: recursing into a script block or PHP tag that was not properly - closed would not silently drop the content. - (test) -
    • Fixed - bug: was eating tabs - (test) -
    • Fixed entity handling so that the caveat -
      -

      Caveats: please properly escape less-thans. x&lt;y - instead of x<y, and use " instead of - &quot; for string delimiters.

      -
      - is no longer applicable. -
    • Added noisefree's C# - patch -
    • Added a distribution that has comments and - whitespace removed to reduce download size from 45.5kB to 12.8kB. -
    -

    4 Jul 2008

    -
      -
    • Added language specific formatters that are triggered by the presence - of a lang-<language-file-extension>
    • -
    • Fixed bug: python handling of '''string''' -
    • Fixed bug: / in regex [charsets] should not end regex -
    -

    5 Jul 2008

    -
      -
    • Defined language extensions for Lisp and Lua -
    -

    14 Jul 2008

    -
      -
    • Language handlers for F#, OCAML, SQL -
    • Support for nocode spans to allow embedding of line - numbers and code annotations which should not be styled or otherwise - affect the tokenization of prettified code. - See the issue 22 - testcase. -
    -

    6 Jan 2009

    -
      -
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • -
    • Added .mxml extension to the markup style handler for - Flex MXML files. See - issue 37. -
    • Added .m extension to the C style handler so that Objective - C source files properly highlight. See - issue 58. -
    • Changed HTML lexer to use the same embedded source mechanism as the - wiki language handler, and changed to use the registered - CSS handler for STYLE element content. -
    -

    21 May 2009

    -
      -
    • Rewrote to improve performance on large files. - See benchmarks.
    • -
    • Fixed bugs with highlighting of Haskell line comments, Lisp - number literals, Lua strings, C preprocessor directives, - newlines in Wiki code on Windows, and newlines in IE6.
    • -
    -

    14 August 2009

    -
      -
    • Fixed prettifying of <code> blocks with embedded newlines. -
    -

    3 October 2009

    -
      -
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. -
    -

    19 July 2010

    -
      -
    • Added support for line numbers. Bug - 22
    • -
    • Added YAML support. Bug - 123
    • -
    • Added VHDL support courtesy Le Poussin.
    • -
    • IE performance improvements. Bug - 102 courtesy jacobly.
    • -
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • -
    • Fixed copy and paste in IE[678]. -
    • Changed output to use &#160; instead of - &nbsp; so that the output works when embedded in XML. - Bug - 108.
    • -
    - - diff --git a/tutorial-2/pixi.js-master/docs/assets/vendor/prettify/COPYING b/tutorial-2/pixi.js-master/docs/assets/vendor/prettify/COPYING deleted file mode 100755 index d645695..0000000 --- a/tutorial-2/pixi.js-master/docs/assets/vendor/prettify/COPYING +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/tutorial-2/pixi.js-master/docs/assets/vendor/prettify/README.html b/tutorial-2/pixi.js-master/docs/assets/vendor/prettify/README.html deleted file mode 100755 index c6fe1a3..0000000 --- a/tutorial-2/pixi.js-master/docs/assets/vendor/prettify/README.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - - Javascript code prettifier - - - - - - - - - - Languages : CH -

    Javascript code prettifier

    - -

    Setup

    -
      -
    1. Download a distribution -
    2. Include the script and stylesheets in your document - (you will need to make sure the css and js file are on your server, and - adjust the paths in the script and link tag) -
      -<link href="prettify.css" type="text/css" rel="stylesheet" />
      -<script type="text/javascript" src="prettify.js"></script>
      -
    3. Add onload="prettyPrint()" to your - document's body tag. -
    4. Modify the stylesheet to get the coloring you prefer
    5. -
    - -

    Usage

    -

    Put code snippets in - <pre class="prettyprint">...</pre> - or <code class="prettyprint">...</code> - and it will automatically be pretty printed. - - - - -
    The original - Prettier -
    class Voila {
    -public:
    -  // Voila
    -  static const string VOILA = "Voila";
    -
    -  // will not interfere with embedded tags.
    -}
    - -
    class Voila {
    -public:
    -  // Voila
    -  static const string VOILA = "Voila";
    -
    -  // will not interfere with embedded tags.
    -}
    -
    - -

    FAQ

    -

    Which languages does it work for?

    -

    The comments in prettify.js are authoritative but the lexer - should work on a number of languages including C and friends, - Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. - It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl - and Ruby, but, because of commenting conventions, doesn't work on - Smalltalk, or CAML-like languages.

    - -

    LISPy languages are supported via an extension: - lang-lisp.js.

    -

    And similarly for - CSS, - Haskell, - Lua, - OCAML, SML, F#, - Visual Basic, - SQL, - Protocol Buffers, and - WikiText.. - -

    If you'd like to add an extension for your favorite language, please - look at src/lang-lisp.js and file an - issue including your language extension, and a testcase.

    - -

    How do I specify which language my code is in?

    -

    You don't need to specify the language since prettyprint() - will guess. You can specify a language by specifying the language extension - along with the prettyprint class like so:

    -
    <pre class="prettyprint lang-html">
    -  The lang-* class specifies the language file extensions.
    -  File extensions supported by default include
    -    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    -    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    -    "xhtml", "xml", "xsl".
    -</pre>
    - -

    It doesn't work on <obfuscated code sample>?

    -

    Yes. Prettifying obfuscated code is like putting lipstick on a pig - — i.e. outside the scope of this tool.

    - -

    Which browsers does it work with?

    -

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. - Look at the test page to see if it - works in your browser.

    - -

    What's changed?

    -

    See the change log

    - -

    Why doesn't Prettyprinting of strings work on WordPress?

    -

    Apparently wordpress does "smart quoting" which changes close quotes. - This causes end quotes to not match up with open quotes. -

    This breaks prettifying as well as copying and pasting of code samples. - See - WordPress's help center for info on how to stop smart quoting of code - snippets.

    - -

    How do I put line numbers in my code?

    -

    You can use the linenums class to turn on line - numbering. If your code doesn't start at line number 1, you can - add a colon and a line number to the end of that class as in - linenums:52. - -

    For example -

    <pre class="prettyprint linenums:4"
    ->// This is line 4.
    -foo();
    -bar();
    -baz();
    -boo();
    -far();
    -faz();
    -<pre>
    - produces -
    // This is line 4.
    -foo();
    -bar();
    -baz();
    -boo();
    -far();
    -faz();
    -
    - -

    How do I prevent a portion of markup from being marked as code?

    -

    You can use the nocode class to identify a span of markup - that is not code. -

    <pre class=prettyprint>
    -int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    -  Continuation of comment */
    -int y = bar();
    -</pre>
    -produces -
    -int x = foo();  /* This is a comment  This is not code
    -  Continuation of comment */
    -int y = bar();
    -
    - -

    For a more complete example see the issue22 - testcase.

    - -

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    -

    If you are calling prettyPrint via an event handler, wrap it in a function. - Instead of doing -

    - addEventListener('load', prettyPrint, false); -
    - wrap it in a closure like -
    - addEventListener('load', function (event) { prettyPrint() }, false); -
    - so that the browser does not pass an event object to prettyPrint which - will confuse it. - -


    - - - - diff --git a/tutorial-2/pixi.js-master/docs/assets/vendor/prettify/prettify-min.css b/tutorial-2/pixi.js-master/docs/assets/vendor/prettify/prettify-min.css deleted file mode 100755 index d44b3a2..0000000 --- a/tutorial-2/pixi.js-master/docs/assets/vendor/prettify/prettify-min.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/tutorial-2/pixi.js-master/docs/assets/vendor/prettify/prettify-min.js b/tutorial-2/pixi.js-master/docs/assets/vendor/prettify/prettify-min.js deleted file mode 100755 index 4845d05..0000000 --- a/tutorial-2/pixi.js-master/docs/assets/vendor/prettify/prettify-min.js +++ /dev/null @@ -1 +0,0 @@ -window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/tutorial-2/pixi.js-master/docs/classes/AbstractFilter.html b/tutorial-2/pixi.js-master/docs/classes/AbstractFilter.html deleted file mode 100755 index c98665e..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/AbstractFilter.html +++ /dev/null @@ -1,857 +0,0 @@ - - - - - AbstractFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AbstractFilter Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This is the base class for creating a PIXI filter. Currently only webGL supports filters. -If you want to make a custom filter this should be your base class.

    - -
    - - -
    -

    Constructor

    -
    -

    AbstractFilter

    - - -
    - (
      - -
    • - - fragmentSrc - -
    • - -
    • - - uniforms - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - fragmentSrc - Array - - - - -
      -

      The fragment source in an array of strings.

      - -
      - - -
    • - -
    • - - uniforms - Object - - - - -
      -

      An object containing the uniforms for this filter.

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/AjaxRequest.html b/tutorial-2/pixi.js-master/docs/classes/AjaxRequest.html deleted file mode 100755 index 473c83e..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/AjaxRequest.html +++ /dev/null @@ -1,978 +0,0 @@ - - - - - AjaxRequest - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AjaxRequest Class

    -
    - - - - - -
    - Defined in: src/pixi/utils/Utils.js:108 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    A wrapper for ajax requests to be handled cross browser

    - -
    - - -
    -

    Constructor

    -
    -

    AjaxRequest

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:108 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    bind

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:74 - -

    - - - - - -
    - -
    -

    A polyfill for Function.prototype.bind

    - -
    - - - - - - -
    - - -
    -

    cancelAnimationFrame

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:20 - -

    - - - - - -
    - -
    -

    A polyfill for cancelAnimationFrame

    - -
    - - - - - - -
    - - -
    -

    canUseNewCanvasBlendModes

    - - - () - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:168 - -

    - - - - - -
    - -
    -

    Checks whether the Canvas BlendModes are supported by the current browser

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    whether they are supported

    - - -
    -
    - - - -
    - - -
    -

    getNextPowerOfTwo

    - - -
    - (
      - -
    • - - number - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:189 - -

    - - - - - -
    - -
    -

    Given a number, this function returns the closest number that is a power of two -this function is taken from Starling Framework as its pretty neat ;)

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - number - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    the closest number that is a power of two

    - - -
    -
    - - - -
    - - -
    -

    hex2rgb

    - - -
    - (
      - -
    • - - hex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:54 - -

    - - - - - -
    - -
    -

    Converts a hex color number to an [R, G, B] array

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - hex - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    requestAnimationFrame

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:12 - -

    - - - - - -
    - -
    -

    A polyfill for requestAnimationFrame -You can actually use both requestAnimationFrame and requestAnimFrame, -you will still benefit from the polyfill

    - -
    - - - - - - -
    - - -
    -

    rgb2hex

    - - -
    - (
      - -
    • - - rgb - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:64 - -

    - - - - - -
    - -
    -

    Converts a color as an [R, G, B] array to a hex number

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - rgb - Array - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/AlphaMaskFilter.html b/tutorial-2/pixi.js-master/docs/classes/AlphaMaskFilter.html deleted file mode 100755 index 6c2abe0..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/AlphaMaskFilter.html +++ /dev/null @@ -1,933 +0,0 @@ - - - - - AlphaMaskFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AlphaMaskFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The AlphaMaskFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. -You can use this filter to apply all manor of crazy warping effects -Currently the r property of the texture is used to offset the x and the g property of the texture is used to offset the y.

    - -
    - - -
    -

    Constructor

    -
    -

    AlphaMaskFilter

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AlphaMaskFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The texture used for the displacement map * must be power of 2 texture at the moment

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    onTextureLoaded

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AlphaMaskFilter.js:71 - -

    - - - - - -
    - -
    -

    Sets the map dimensions uniforms when the texture becomes available.

    - -
    - - - - - - -
    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    map

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AlphaMaskFilter.js:84 - -

    - - - - -
    - -
    -

    The texture used for the displacement map. Must be power of 2 sized texture.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/AsciiFilter.html b/tutorial-2/pixi.js-master/docs/classes/AsciiFilter.html deleted file mode 100755 index eee96f8..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/AsciiFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - AsciiFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AsciiFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    An ASCII filter.

    - -
    - - -
    -

    Constructor

    -
    -

    AsciiFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AsciiFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    size

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AsciiFilter.js:73 - -

    - - - - -
    - -
    -

    The pixel size used by the filter.

    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/AssetLoader.html b/tutorial-2/pixi.js-master/docs/classes/AssetLoader.html deleted file mode 100755 index 9485b58..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/AssetLoader.html +++ /dev/null @@ -1,1743 +0,0 @@ - - - - - AssetLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AssetLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    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

    - -
    - - -
    -

    Constructor

    -
    -

    AssetLoader

    - - -
    - (
      - -
    • - - assetURLs - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - 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. Supported bitmap font - data formats include 'xml' and 'fnt'.

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    -

    Events

    - - -
    - -
    - - -
    -

    Methods

    - - -
    -

    _getDataType

    - - -
    - (
      - -
    • - - str - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:74 - -

    - - - - - -
    - -
    -

    Given a filename, returns its extension.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - str - String - - - - -
      -

      the name of the asset

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:107 - -

    - - - - - -
    - -
    -

    Starts loading the assets sequentially

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onAssetLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:143 - -

    - - - - - -
    - -
    -

    Invoked after each file is loaded

    - -
    - - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    assetURLs

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:23 - -

    - - - - -
    - -
    -

    The array of asset URLs that are going to be loaded

    - -
    - - - - - - -
    - - -
    -

    crossorigin

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:31 - -

    - - - - -
    - -
    -

    Whether the requests should be treated as cross origin

    - -
    - - - - - - -
    - - -
    -

    loadersByType

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:39 - -

    - - - - -
    - -
    -

    Maps file extension to loader types

    - -
    - - - - - - -
    - - -
    - - - - - -
    -

    Events

    - - -
    -

    onComplete

    - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:66 - -

    - - - - -
    - -
    -

    Fired when all the assets have loaded

    - -
    - - - - - -
    - - -
    -

    onProgress

    - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:61 - -

    - - - - -
    - -
    -

    Fired when an item has loaded

    - -
    - - - - - -
    - - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/AtlasLoader.html b/tutorial-2/pixi.js-master/docs/classes/AtlasLoader.html deleted file mode 100755 index a7cc254..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/AtlasLoader.html +++ /dev/null @@ -1,1481 +0,0 @@ - - - - - AtlasLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AtlasLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event.

    -

    To generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format.

    -

    It is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to 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.fromFrameId()

    - -
    - - -
    -

    Constructor

    -
    -

    AtlasLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AtlasLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the JSON file

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AtlasLoader.js:32 - -

    - - - - - -
    - -
    -

    Starts loading the JSON file

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onAtlasLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AtlasLoader.js:46 - -

    - - - - - -
    - -
    -

    Invoked when the Atlas has fully loaded. Parses the JSON and builds the texture frames.

    - -
    - - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onError

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AtlasLoader.js:182 - -

    - - - - - -
    - -
    -

    Invoked when an error occurs.

    - -
    - - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AtlasLoader.js:166 - -

    - - - - - -
    - -
    -

    Invoked when json file has loaded.

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/BaseTexture.html b/tutorial-2/pixi.js-master/docs/classes/BaseTexture.html deleted file mode 100755 index ad0c53e..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/BaseTexture.html +++ /dev/null @@ -1,2399 +0,0 @@ - - - - - BaseTexture - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BaseTexture Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A texture stores the information that represents an image. All textures have a base texture.

    - -
    - - -
    -

    Constructor

    -
    -

    BaseTexture

    - - -
    - (
      - -
    • - - source - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:9 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - source - String - - - - -
      -

      the source object (image or canvas)

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:151 - -

    - - - - - -
    - -
    -

    Destroys this base texture

    - -
    - - - - - - -
    - - -
    -

    dirty

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:187 - -

    - - - - - -
    - -
    -

    Sets all glTextures to be dirty.

    - -
    - - - - - - -
    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    fromCanvas

    - - -
    - (
      - -
    • - - canvas - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:270 - -

    - - - - - -
    - -
    -

    Helper function that creates a base texture from the given canvas element.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - canvas - Canvas - - - - -
      -

      The canvas element source of the texture

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - -

    BaseTexture

    - - -
    -
    - - - -
    - - -
    -

    fromImage

    - - -
    - (
      - -
    • - - imageUrl - -
    • - -
    • - - crossorigin - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:228 - -

    - - - - - -
    - -
    -

    Helper function that creates a base texture from the given image url. -If the image is not in the base texture cache it will be created and loaded.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - imageUrl - String - - - - -
      -

      The image url of the texture

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - -

    BaseTexture

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    unloadFromGPU

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:200 - -

    - - - - - -
    - -
    -

    Removes the base texture from the GPU, useful for managing resources on the GPU. -Atexture is still 100% usable and will simply be reuploaded if there is a sprite on screen that is using it.

    - -
    - - - - - - -
    - - -
    -

    updateSourceImage

    - - -
    - (
      - -
    • - - newSrc - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:174 - -

    - - - - - -
    - -
    -

    Changes the source image of the texture

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - newSrc - String - - - - -
      -

      the path of the image

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _dirty

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:95 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    _glTextures

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:85 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    _powerOf2

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:138 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    hasLoaded

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:55 - -

    - - - - -
    - -
    -

    [read-only] Set to true once the base texture has loaded

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:37 - -

    - - - - -
    - -
    -

    [read-only] The height of the base texture set when the image has loaded

    - -
    - - - - - - -
    - - -
    -

    imageUrl

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:132 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    premultipliedAlpha

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:74 - -

    - - - - -
    - -
    -

    Controls if RGB channels should be pre-multiplied by Alpha (WebGL only)

    - -
    - - -

    Default: true

    - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:20 - -

    - - - - -
    - -
    -

    The Resolution of the texture.

    - -
    - - - - - - -
    - - -
    -

    scaleMode

    - PIXI.scaleModes - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:46 - -

    - - - - -
    - -
    -

    The scale mode to apply when scaling this texture

    - -
    - - -

    Default: PIXI.scaleModes.LINEAR

    - - - - - -
    - - -
    -

    source

    - Image - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:64 - -

    - - - - -
    - -
    -

    The image source that is used to create the texture.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:28 - -

    - - - - -
    - -
    -

    [read-only] The width of the base texture set when the image has loaded

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/BitmapFontLoader.html b/tutorial-2/pixi.js-master/docs/classes/BitmapFontLoader.html deleted file mode 100755 index 670a3d2..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/BitmapFontLoader.html +++ /dev/null @@ -1,1641 +0,0 @@ - - - - - BitmapFontLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BitmapFontLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    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

    - -
    - - -
    -

    Constructor

    -
    -

    BitmapFontLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the sprite sheet JSON file

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:57 - -

    - - - - - -
    - -
    -

    Loads the XML font data

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:152 - -

    - - - - - -
    - -
    -

    Invoked when all files are loaded (xml/fnt and texture)

    - -
    - - - - - - -
    - - -
    -

    onXMLLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:72 - -

    - - - - - -
    - -
    -

    Invoked when the XML file is loaded, parses the data.

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    baseUrl

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:35 - -

    - - - - -
    - -
    -

    [read-only] The base url of the bitmap font data

    - -
    - - - - - - -
    - - -
    -

    crossorigin

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:27 - -

    - - - - -
    - -
    -

    Whether the requests should be treated as cross origin

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:44 - -

    - - - - -
    - -
    -

    [read-only] The texture of the bitmap font

    - -
    - - - - - - -
    - - -
    -

    url

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:19 - -

    - - - - -
    - -
    -

    The url of the bitmap font data

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/BitmapText.html b/tutorial-2/pixi.js-master/docs/classes/BitmapText.html deleted file mode 100755 index 2dfc95f..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/BitmapText.html +++ /dev/null @@ -1,6161 +0,0 @@ - - - - - BitmapText - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BitmapText Class

    -
    - - - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A BitmapText object will create a line or multiple lines of text using bitmap font. To split a line you can use '\n', '\r' or '\r\n' in your string. -You can generate the fnt files using -http://www.angelcode.com/products/bmfont/ for windows or -http://www.bmglyph.com/ for mac.

    - -
    - - -
    -

    Constructor

    -
    -

    BitmapText

    - - -
    - (
      - -
    • - - text - -
    • - -
    • - - style - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - text - String - - - - -
      -

      The copy that you would like the text to display

      - -
      - - -
    • - -
    • - - style - Object - - - - -
      -

      The style parameters

      - -
      - - -
        - -
      • - - font - String - - -
        -

        The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)

        - -
        - - -
      • - -
      • - - [align='left'] - String - optional - - -
        -

        Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text

        - -
        - - -
      • - -
      - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStyle

    - - -
    - (
      - -
    • - - style - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:78 - -

    - - - - - -
    - -
    -

    Set the style of the text -style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously) -[style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single lines of text

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - style - Object - - - - -
      -

      The style parameters, contained as properties of an object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setText

    - - -
    - (
      - -
    • - - text - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:66 - -

    - - - - - -
    - -
    -

    Set the text string to be rendered.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - text - String - - - - -
      -

      The text that you would like displayed

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    -

    updateText

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:100 - -

    - - - - - -
    - -
    -

    Renders text and updates it when needed

    - -
    - - - - - - -
    - - -
    -

    updateTransform

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:198 - -

    - - - - - -
    - -
    -

    Updates the transform of this object

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _pool

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:54 - -

    - - - - -
    - -
    -

    The dirty state of this object.

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    textHeight

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:33 - -

    - - - - -
    - -
    -

    [read-only] The height of the overall text, different from fontSize, -which is defined in the style object

    - -
    - - - - - - -
    - - -
    -

    textWidth

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:23 - -

    - - - - -
    - -
    -

    [read-only] The width of the overall text, different from fontSize, -which is defined in the style object

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/BlurFilter.html b/tutorial-2/pixi.js-master/docs/classes/BlurFilter.html deleted file mode 100755 index 0922ab3..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/BlurFilter.html +++ /dev/null @@ -1,946 +0,0 @@ - - - - - BlurFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BlurFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The BlurFilter applies a Gaussian blur to an object. -The strength of the blur can be set for x- and y-axis separately (always relative to the stage).

    - -
    - - -
    -

    Constructor

    -
    -

    BlurFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number the strength of the blur - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurFilter.js:24 - -

    - - - - -
    - -
    -

    Sets the strength of both the blurX and blurY properties simultaneously

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    blurX

    - Number the strength of the blurX - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurFilter.js:40 - -

    - - - - -
    - -
    -

    Sets the strength of the blurX property

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    blurY

    - Number the strength of the blurY - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurFilter.js:56 - -

    - - - - -
    - -
    -

    Sets the strength of the blurY property

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/BlurXFilter.html b/tutorial-2/pixi.js-master/docs/classes/BlurXFilter.html deleted file mode 100755 index a29861a..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/BlurXFilter.html +++ /dev/null @@ -1,837 +0,0 @@ - - - - - BlurXFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BlurXFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The BlurXFilter applies a horizontal Gaussian blur to an object.

    - -
    - - -
    -

    Constructor

    -
    -

    BlurXFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurXFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number the strength of the blur - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurXFilter.js:51 - -

    - - - - -
    - -
    -

    Sets the strength of both the blur.

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/BlurYFilter.html b/tutorial-2/pixi.js-master/docs/classes/BlurYFilter.html deleted file mode 100755 index e2e564b..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/BlurYFilter.html +++ /dev/null @@ -1,837 +0,0 @@ - - - - - BlurYFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BlurYFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The BlurYFilter applies a vertical Gaussian blur to an object.

    - -
    - - -
    -

    Constructor

    -
    -

    BlurYFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurYFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number the strength of the blur - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurYFilter.js:51 - -

    - - - - -
    - -
    -

    Sets the strength of both the blur.

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/CanvasBuffer.html b/tutorial-2/pixi.js-master/docs/classes/CanvasBuffer.html deleted file mode 100755 index e39dba6..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/CanvasBuffer.html +++ /dev/null @@ -1,868 +0,0 @@ - - - - - CanvasBuffer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CanvasBuffer Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    Creates a Canvas element of the given size.

    - -
    - - -
    -

    Constructor

    -
    -

    CanvasBuffer

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      the width for the newly created canvas

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the height for the newly created canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clear

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:53 - -

    - - - - - -
    - -
    -

    Clears the canvas that was created by the CanvasBuffer class.

    - -
    - - - - - - -
    - - -
    -

    resize

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:65 - -

    - - - - - -
    - -
    -

    Resizes the canvas to the specified width and height.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      the new width of the canvas

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the new height of the canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    canvas

    - HTMLCanvasElement - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:31 - -

    - - - - -
    - -
    -

    The Canvas object that belongs to this CanvasBuffer.

    - -
    - - - - - - -
    - - -
    -

    context

    - CanvasRenderingContext2D - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:39 - -

    - - - - -
    - -
    -

    A CanvasRenderingContext2D object representing a two-dimensional rendering context.

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:23 - -

    - - - - -
    - -
    -

    The height of the Canvas in pixels.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:15 - -

    - - - - -
    - -
    -

    The width of the Canvas in pixels.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/CanvasGraphics.html b/tutorial-2/pixi.js-master/docs/classes/CanvasGraphics.html deleted file mode 100755 index 59addfe..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/CanvasGraphics.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - CanvasGraphics - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CanvasGraphics Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A set of functions used by the canvas renderer to draw the primitive graphics data.

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - - - - - - - -
    - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/CanvasMaskManager.html b/tutorial-2/pixi.js-master/docs/classes/CanvasMaskManager.html deleted file mode 100755 index 0a31f57..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/CanvasMaskManager.html +++ /dev/null @@ -1,620 +0,0 @@ - - - - - CanvasMaskManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CanvasMaskManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A set of functions used to handle masking.

    - -
    - - -
    -

    Constructor

    -
    -

    CanvasMaskManager

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasMaskManager.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    popMask

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasMaskManager.js:49 - -

    - - - - - -
    - -
    -

    Restores the current drawing context to the state it was before the mask was applied.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The renderSession whose context will be used for this mask manager.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    pushMask

    - - -
    - (
      - -
    • - - maskData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasMaskManager.js:17 - -

    - - - - - -
    - -
    -

    This method adds it to the current stack of masks.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - maskData - Object - - - - -
      -

      the maskData that will be pushed

      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      -

      The renderSession whose context will be used for this mask manager.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/CanvasRenderer.html b/tutorial-2/pixi.js-master/docs/classes/CanvasRenderer.html deleted file mode 100755 index 5c96035..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/CanvasRenderer.html +++ /dev/null @@ -1,1761 +0,0 @@ - - - - - CanvasRenderer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CanvasRenderer Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The CanvasRenderer draws the Stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. -Don't forget to add the CanvasRenderer.view to your DOM or you will not see anything :)

    - -
    - - -
    -

    Constructor

    -
    -

    CanvasRenderer

    - - -
    - (
      - -
    • - - [width=800] - -
    • - -
    • - - [height=600] - -
    • - -
    • - - [options] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - [width=800] - Number - optional - - - - -
      -

      the width of the canvas view

      - -
      - - -
    • - -
    • - - [height=600] - Number - optional - - - - -
      -

      the height of the canvas view

      - -
      - - -
    • - -
    • - - [options] - Object - optional - - - - -
      -

      The optional renderer parameters

      - -
      - - -
        - -
      • - - [view] - HTMLCanvasElement - optional - - -
        -

        the canvas to use as a view, optional

        - -
        - - -
      • - -
      • - - [transparent=false] - Boolean - optional - - -
        -

        If the render view is transparent, default false

        - -
        - - -
      • - -
      • - - [autoResize=false] - Boolean - optional - - -
        -

        If the render view is automatically resized, default false

        - -
        - - -
      • - -
      • - - [resolution=1] - Number - optional - - -
        -

        the resolution of the renderer retina would be 2

        - -
        - - -
      • - -
      • - - [clearBeforeRender=true] - Boolean - optional - - -
        -

        This sets if the CanvasRenderer will clear the canvas or not before the new render pass.

        - -
        - - -
      • - -
      - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - -
    - (
      - -
    • - - [removeView=true] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:233 - -

    - - - - - -
    - -
    -

    Removes everything from the renderer and optionally removes the Canvas DOM element.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - [removeView=true] - Boolean - optional - - - - -
      -

      Removes the Canvas element from the DOM.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    mapBlendModes

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:291 - -

    - - - - - -
    - -
    -

    Maps Pixi blend modes to canvas blend modes.

    - -
    - - - - - - -
    - - -
    -

    render

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:184 - -

    - - - - - -
    - -
    -

    Renders the Stage to this canvas view

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the Stage element to be rendered

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderDisplayObject

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - context - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:276 - -

    - - - - - -
    - -
    -

    Renders a display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      The displayObject to render

      - -
      - - -
    • - -
    • - - context - CanvasRenderingContext2D - - - - -
      -

      the context 2d method of the canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    resize

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:255 - -

    - - - - - -
    - -
    -

    Resizes the canvas view to the specified width and height

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      the new width of the canvas view

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the new height of the canvas view

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    autoResize

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:76 - -

    - - - - -
    - -
    -

    Whether the render view should be resized automatically

    - -
    - - - - - - -
    - - -
    -

    CanvasMaskManager

    - CanvasMaskManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:140 - -

    - - - - -
    - -
    -

    Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer

    - -
    - - - - - - -
    - - -
    -

    clearBeforeRender

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:56 - -

    - - - - -
    - -
    -

    This sets if the CanvasRenderer will clear the canvas or not before the new render pass. -If the Stage is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color. -If the Stage is transparent Pixi will use clearRect to clear the canvas every frame. -Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.

    - -
    - - - - - - -
    - - -
    -

    context

    - CanvasRenderingContext2D - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:114 - -

    - - - - -
    - -
    -

    The canvas 2d context that everything is drawn with

    - -
    - - - - - - -
    - - -
    -

    count

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:132 - -

    - - - - -
    - -
    -

    Internal var.

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:94 - -

    - - - - -
    - -
    -

    The height of the canvas view

    - -
    - - -

    Default: 600

    - - - - - -
    - - -
    -

    refresh

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:121 - -

    - - - - -
    - -
    -

    Boolean flag controlling canvas refresh.

    - -
    - - - - - - -
    - - -
    -

    renderSession

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:147 - -

    - - - - -
    - -
    -

    The render session is just a bunch of parameter used for rendering

    - -
    - - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:48 - -

    - - - - -
    - -
    -

    The resolution of the canvas.

    - -
    - - - - - - -
    - - -
    -

    transparent

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:68 - -

    - - - - -
    - -
    -

    Whether the render view is transparent

    - -
    - - - - - - -
    - - -
    -

    type

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:40 - -

    - - - - -
    - -
    -

    The renderer type.

    - -
    - - - - - - -
    - - -
    -

    view

    - HTMLCanvasElement - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:106 - -

    - - - - -
    - -
    -

    The canvas element that everything is drawn to.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:85 - -

    - - - - -
    - -
    -

    The width of the canvas view

    - -
    - - -

    Default: 800

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/CanvasTinter.html b/tutorial-2/pixi.js-master/docs/classes/CanvasTinter.html deleted file mode 100755 index 3cedea0..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/CanvasTinter.html +++ /dev/null @@ -1,1293 +0,0 @@ - - - - - CanvasTinter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CanvasTinter Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    CanvasTinter

    - - - () - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    getTintedTexture

    - - -
    - (
      - -
    • - - sprite - -
    • - -
    • - - color - -
    • - -
    ) -
    - - - - - HTMLCanvasElement - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:14 - -

    - - - - - -
    - -
    -

    Basically this method just needs a sprite and a color and tints the sprite with the given color.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - sprite - Sprite - - - - -
      -

      the sprite to tint

      - -
      - - -
    • - -
    • - - color - Number - - - - -
      -

      the color to use to tint the sprite with

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - HTMLCanvasElement: - -

    The tinted canvas

    - - -
    -
    - - - -
    - - -
    -

    roundColor

    - - -
    - (
      - -
    • - - color - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:184 - -

    - - - - - -
    - -
    -

    Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - color - Number - - - - -
      -

      the color to round, should be a hex color

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    tintMethod

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:227 - -

    - - - - - -
    - -
    -

    The tinting method that will be used.

    - -
    - - - - - - -
    - - -
    -

    tintPerPixel

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - color - -
    • - -
    • - - canvas - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:139 - -

    - - - - - -
    - -
    -

    Tint a texture pixel per pixel.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      the texture to tint

      - -
      - - -
    • - -
    • - - color - Number - - - - -
      -

      the color to use to tint the sprite with

      - -
      - - -
    • - -
    • - - canvas - HTMLCanvasElement - - - - -
      -

      the current canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    tintWithMultiply

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - color - -
    • - -
    • - - canvas - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:58 - -

    - - - - - -
    - -
    -

    Tint a texture using the "multiply" operation.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      the texture to tint

      - -
      - - -
    • - -
    • - - color - Number - - - - -
      -

      the color to use to tint the sprite with

      - -
      - - -
    • - -
    • - - canvas - HTMLCanvasElement - - - - -
      -

      the current canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    tintWithOverlay

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - color - -
    • - -
    • - - canvas - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:104 - -

    - - - - - -
    - -
    -

    Tint a texture using the "overlay" operation.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      the texture to tint

      - -
      - - -
    • - -
    • - - color - Number - - - - -
      -

      the color to use to tint the sprite with

      - -
      - - -
    • - -
    • - - canvas - HTMLCanvasElement - - - - -
      -

      the current canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    cacheStepsPerColorChannel

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:203 - -

    - - - - -
    - -
    -

    Number of steps which will be used as a cap when rounding colors.

    - -
    - - - - - - -
    - - -
    -

    canUseMultiply

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:219 - -

    - - - - -
    - -
    -

    Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method.

    - -
    - - - - - - -
    - - -
    -

    convertTintToImage

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:211 - -

    - - - - -
    - -
    -

    Tint cache boolean flag.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/Circle.html b/tutorial-2/pixi.js-master/docs/classes/Circle.html deleted file mode 100755 index f65b051..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/Circle.html +++ /dev/null @@ -1,955 +0,0 @@ - - - - - Circle - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Circle Class

    -
    - - - - - -
    - Defined in: src/pixi/geom/Circle.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Circle object can be used to specify a hit area for displayObjects

    - -
    - - -
    -

    Constructor

    -
    -

    Circle

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - radius - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the center of this circle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the center of this circle

      - -
      - - -
    • - -
    • - - radius - Number - - - - -
      -

      The radius of the circle

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - -
      - -
    • - radius - - - -
    • - -
    • - x - - - -
    • - -
    • - y - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Circle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:38 - -

    - - - - - -
    - -
    -

    Creates a clone of this Circle instance

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Circle: - -

    a copy of the Circle

    - - -
    -
    - - - -
    - - -
    -

    contains

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:49 - -

    - - - - - -
    - -
    -

    Checks whether the x and y coordinates given are contained within this circle

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the point to test

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the point to test

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Whether the x/y coordinates are within this Circle

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:72 - -

    - - - - - -
    - -
    -

    Returns the framing rectangle of the circle as a PIXI.Rectangle object

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    radius

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:30 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:16 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:23 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/ColorMatrixFilter.html b/tutorial-2/pixi.js-master/docs/classes/ColorMatrixFilter.html deleted file mode 100755 index c1a365b..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/ColorMatrixFilter.html +++ /dev/null @@ -1,839 +0,0 @@ - - - - - ColorMatrixFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    ColorMatrixFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The ColorMatrixFilter class lets you apply a 4x4 matrix transformation on the RGBA -color and alpha values of every pixel on your displayObject to produce a result -with a new set of RGBA color and alpha values. It's pretty powerful!

    - -
    - - -
    -

    Constructor

    -
    -

    ColorMatrixFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ColorMatrixFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    matrix

    - Array and array of 26 numbers - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ColorMatrixFilter.js:46 - -

    - - - - -
    - -
    -

    Sets the matrix of the color matrix filter

    - -
    - - -

    Default: [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]

    - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/ColorStepFilter.html b/tutorial-2/pixi.js-master/docs/classes/ColorStepFilter.html deleted file mode 100755 index 74ec410..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/ColorStepFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - ColorStepFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    ColorStepFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This lowers the color depth of your image by the given amount, producing an image with a smaller palette.

    - -
    - - -
    -

    Constructor

    -
    -

    ColorStepFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ColorStepFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    step

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ColorStepFilter.js:41 - -

    - - - - -
    - -
    -

    The number of steps to reduce the palette by.

    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/ComplexPrimitiveShader.html b/tutorial-2/pixi.js-master/docs/classes/ComplexPrimitiveShader.html deleted file mode 100755 index 7d2a7a7..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/ComplexPrimitiveShader.html +++ /dev/null @@ -1,839 +0,0 @@ - - - - - ComplexPrimitiveShader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    ComplexPrimitiveShader Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    ComplexPrimitiveShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:109 - -

    - - - - - -
    - -
    -

    Destroys the shader.

    - -
    - - - - - - -
    - - -
    -

    init

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:79 - -

    - - - - - -
    - -
    -

    Initialises the shader.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _UID

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:32 - -

    - - - - -
    - -
    -

    The fragment shader.

    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:19 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    program

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:25 - -

    - - - - -
    - -
    -

    The WebGL program.

    - -
    - - - - - - -
    - - -
    -

    vertexSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:48 - -

    - - - - -
    - -
    -

    The vertex shader.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/ConvolutionFilter.html b/tutorial-2/pixi.js-master/docs/classes/ConvolutionFilter.html deleted file mode 100755 index 2177569..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/ConvolutionFilter.html +++ /dev/null @@ -1,1020 +0,0 @@ - - - - - ConvolutionFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    ConvolutionFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The ConvolutionFilter class applies a matrix convolution filter effect. -A convolution combines pixels in the input image with neighboring pixels to produce a new image. -A wide variety of image effects can be achieved through convolutions, including blurring, edge detection, sharpening, embossing, and beveling. -The matrix should be specified as a 9 point Array. See http://docs.gimp.org/en/plug-in-convmatrix.html for more info.

    - -
    - - -
    -

    Constructor

    -
    -

    ConvolutionFilter

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ConvolutionFilter.js:1 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Array - - - - -
      -

      An array of values used for matrix transformation. Specified as a 9 point Array.

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      Width of the object you are transforming

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      Height of the object you are transforming

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ConvolutionFilter.js:93 - -

    - - - - -
    - -
    -

    Height of the object you are transforming

    - -
    - - - - - - -
    - - -
    -

    matrix

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ConvolutionFilter.js:63 - -

    - - - - -
    - -
    -

    An array of values used for matrix transformation. Specified as a 9 point Array.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ConvolutionFilter.js:78 - -

    - - - - -
    - -
    -

    Width of the object you are transforming

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/CrossHatchFilter.html b/tutorial-2/pixi.js-master/docs/classes/CrossHatchFilter.html deleted file mode 100755 index 0f422cc..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/CrossHatchFilter.html +++ /dev/null @@ -1,837 +0,0 @@ - - - - - CrossHatchFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CrossHatchFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A Cross Hatch effect filter.

    - -
    - - -
    -

    Constructor

    -
    -

    CrossHatchFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/CrossHatchFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number the strength of the blur - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/CrossHatchFilter.js:65 - -

    - - - - -
    - -
    -

    Sets the strength of both the blur.

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/DisplacementFilter.html b/tutorial-2/pixi.js-master/docs/classes/DisplacementFilter.html deleted file mode 100755 index 9871925..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/DisplacementFilter.html +++ /dev/null @@ -1,1037 +0,0 @@ - - - - - DisplacementFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    DisplacementFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The DisplacementFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. -You can use this filter to apply all manor of crazy warping effects -Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.

    - -
    - - -
    -

    Constructor

    -
    -

    DisplacementFilter

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DisplacementFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The texture used for the displacement map * must be power of 2 texture at the moment

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    onTextureLoaded

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DisplacementFilter.js:78 - -

    - - - - - -
    - -
    -

    Sets the map dimensions uniforms when the texture becomes available.

    - -
    - - - - - - -
    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    map

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DisplacementFilter.js:91 - -

    - - - - -
    - -
    -

    The texture used for the displacement map. Must be power of 2 texture.

    - -
    - - - - - - -
    - - -
    -

    offset

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DisplacementFilter.js:121 - -

    - - - - -
    - -
    -

    The offset used to move the displacement map.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DisplacementFilter.js:106 - -

    - - - - -
    - -
    -

    The multiplier used to scale the displacement result from the map calculation.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/DisplayObject.html b/tutorial-2/pixi.js-master/docs/classes/DisplayObject.html deleted file mode 100755 index bb55a56..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/DisplayObject.html +++ /dev/null @@ -1,4530 +0,0 @@ - - - - - DisplayObject - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    DisplayObject Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The base class for all objects that are rendered on the screen. -This is an abstract class and should not be used on its own rather it should be extended.

    - -
    - - -
    -

    Constructor

    -
    -

    DisplayObject

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:719 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:705 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    ) -
    - - - - - Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:523 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObject as a rectangle object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Matrix - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:536 - -

    - - - - - -
    - -
    -

    Retrieves the local bounds of the displayObject as a rectangle object

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:547 - -

    - - - - - -
    - -
    -

    Sets the object's stage reference, the stage this object is connected to

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the object will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:188 - -

    - - - - -
    - -
    -

    The original, cached mask of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/DisplayObjectContainer.html b/tutorial-2/pixi.js-master/docs/classes/DisplayObjectContainer.html deleted file mode 100755 index a2f19a5..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/DisplayObjectContainer.html +++ /dev/null @@ -1,5576 +0,0 @@ - - - - - DisplayObjectContainer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    DisplayObjectContainer Class

    -
    - - - -
    - Extends DisplayObject -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A DisplayObjectContainer represents a collection of display objects. -It is the base class of all display objects that act as a container for other objects.

    - -
    - - -
    -

    Constructor

    -
    -

    DisplayObjectContainer

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/DotScreenFilter.html b/tutorial-2/pixi.js-master/docs/classes/DotScreenFilter.html deleted file mode 100755 index dc7b6d7..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/DotScreenFilter.html +++ /dev/null @@ -1,887 +0,0 @@ - - - - - DotScreenFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    DotScreenFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This filter applies a dotscreen effect making display objects appear to be made out of black and white halftone dots like an old printer.

    - -
    - - -
    -

    Constructor

    -
    -

    DotScreenFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DotScreenFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    angle

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DotScreenFilter.js:72 - -

    - - - - -
    - -
    -

    The radius of the effect.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DotScreenFilter.js:57 - -

    - - - - -
    - -
    -

    The scale of the effect.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/Ellipse.html b/tutorial-2/pixi.js-master/docs/classes/Ellipse.html deleted file mode 100755 index 8c53367..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/Ellipse.html +++ /dev/null @@ -1,1030 +0,0 @@ - - - - - Ellipse - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Ellipse Class

    -
    - - - - - -
    - Defined in: src/pixi/geom/Ellipse.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Ellipse object can be used to specify a hit area for displayObjects

    - -
    - - -
    -

    Constructor

    -
    -

    Ellipse

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the center of the ellipse

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the center of the ellipse

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The half width of this ellipse

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The half height of this ellipse

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - -
      - -
    • - height - - - -
    • - -
    • - width - - - -
    • - -
    • - x - - - -
    • - -
    • - y - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Ellipse - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:46 - -

    - - - - - -
    - -
    -

    Creates a clone of this Ellipse instance

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Ellipse: - -

    a copy of the ellipse

    - - -
    -
    - - - -
    - - -
    -

    contains

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:57 - -

    - - - - - -
    - -
    -

    Checks whether the x and y coordinates given are contained within this ellipse

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the point to test

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the point to test

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Whether the x/y coords are within this ellipse

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:80 - -

    - - - - - -
    - -
    -

    Returns the framing rectangle of the ellipse as a PIXI.Rectangle object

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:38 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:31 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:17 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:24 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/Event.html b/tutorial-2/pixi.js-master/docs/classes/Event.html deleted file mode 100755 index 417223d..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/Event.html +++ /dev/null @@ -1,946 +0,0 @@ - - - - - Event - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Event Class

    -
    - - - -
    - Extends Object -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    Creates an homogenous object for tracking events so users can know what to expect.

    - -
    - - -
    -

    Constructor

    -
    -

    Event

    - - -
    - (
      - -
    • - - target - -
    • - -
    • - - name - -
    • - -
    • - - data - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:192 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - target - Object - - - - -
      -

      The target object that the event is called on

      - -
      - - -
    • - -
    • - - name - String - - - - -
      -

      The string name of the event that was triggered

      - -
      - - -
    • - -
    • - - data - Object - - - - -
      -

      Arbitrary event data to pass along

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    stopImmediatePropagation

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:277 - -

    - - - - - -
    - -
    -

    Stops the propagation of events to sibling listeners (no longer calls any listeners).

    - -
    - - - - - - -
    - - -
    -

    stopPropagation

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:268 - -

    - - - - - -
    - -
    -

    Stops the propagation of events up the scene graph (prevents bubbling).

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    data

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:246 - -

    - - - - -
    - -
    -

    The data that was passed in with this event.

    - -
    - - - - - - -
    - - -
    -

    stopped

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:206 - -

    - - - - -
    - -
    -

    Tracks the state of bubbling propagation. Do not -set this directly, instead use event.stopPropagation()

    - -
    - - - - - - -
    - - -
    -

    stoppedImmediate

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:217 - -

    - - - - -
    - -
    -

    Tracks the state of sibling listener propagation. Do not -set this directly, instead use event.stopImmediatePropagation()

    - -
    - - - - - - -
    - - -
    -

    target

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:228 - -

    - - - - -
    - -
    -

    The original target the event triggered on.

    - -
    - - - - - - -
    - - -
    -

    timeStamp

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:258 - -

    - - - - -
    - -
    -

    The timestamp when the event occurred.

    - -
    - - - - - - -
    - - -
    -

    type

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:237 - -

    - - - - -
    - -
    -

    The string name of the event that this represents.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/EventTarget.html b/tutorial-2/pixi.js-master/docs/classes/EventTarget.html deleted file mode 100755 index caab8e5..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/EventTarget.html +++ /dev/null @@ -1,1123 +0,0 @@ - - - - - EventTarget - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    EventTarget Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    Mixins event emitter functionality to a class

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/FilterBlock.html b/tutorial-2/pixi.js-master/docs/classes/FilterBlock.html deleted file mode 100755 index 381971a..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/FilterBlock.html +++ /dev/null @@ -1,510 +0,0 @@ - - - - - FilterBlock - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    FilterBlock Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A target and pass info object for filters.

    - -
    - - -
    -

    Constructor

    -
    -

    FilterBlock

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/FilterBlock.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - - - -
    -

    Properties

    - - -
    - - - - - -
    - - - - -
    -

    Properties

    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/FilterBlock.js:21 - -

    - - - - -
    - -
    -

    The renderable state of this FilterBlock.

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/FilterBlock.js:13 - -

    - - - - -
    - -
    -

    The visible state of this FilterBlock.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/FilterTexture.html b/tutorial-2/pixi.js-master/docs/classes/FilterTexture.html deleted file mode 100755 index fa30bda..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/FilterTexture.html +++ /dev/null @@ -1,967 +0,0 @@ - - - - - FilterTexture - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    FilterTexture Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    FilterTexture

    - - -
    - (
      - -
    • - - gl - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      the horizontal range of the filter

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the vertical range of the filter

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clear

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:61 - -

    - - - - - -
    - -
    -

    Clears the filter texture.

    - -
    - - - - - - -
    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:97 - -

    - - - - - -
    - -
    -

    Destroys the filter texture.

    - -
    - - - - - - -
    - - -
    -

    resize

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:74 - -

    - - - - - -
    - -
    -

    Resizes the texture to the specified width and height

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      the new width of the texture

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the new height of the texture

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    frameBuffer

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:23 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:15 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    scaleMode

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:35 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    texture

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:29 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/Graphics.html b/tutorial-2/pixi.js-master/docs/classes/Graphics.html deleted file mode 100755 index 2d012fa..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/Graphics.html +++ /dev/null @@ -1,8669 +0,0 @@ - - - - - Graphics - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Graphics Class

    -
    - - - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and color and fill them.

    - -
    - - -
    -

    Constructor

    -
    -

    Graphics

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:983 - -

    - - - - - -
    - -
    -

    Generates the cached sprite when the sprite has cacheAsBitmap = true

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:736 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:656 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    arc

    - - -
    - (
      - -
    • - - cx - -
    • - -
    • - - cy - -
    • - -
    • - - radius - -
    • - -
    • - - startAngle - -
    • - -
    • - - endAngle - -
    • - -
    • - - anticlockwise - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:414 - -

    - - - - - -
    - -
    -

    The arc method creates an arc/curve (used to create circles, or parts of circles).

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - cx - Number - - - - -
      -

      The x-coordinate of the center of the circle

      - -
      - - -
    • - -
    • - - cy - Number - - - - -
      -

      The y-coordinate of the center of the circle

      - -
      - - -
    • - -
    • - - radius - Number - - - - -
      -

      The radius of the circle

      - -
      - - -
    • - -
    • - - startAngle - Number - - - - -
      -

      The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle)

      - -
      - - -
    • - -
    • - - endAngle - Number - - - - -
      -

      The ending angle, in radians

      - -
      - - -
    • - -
    • - - anticlockwise - Boolean - - - - -
      -

      Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    beginFill

    - - -
    - (
      - -
    • - - color - -
    • - -
    • - - alpha - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:488 - -

    - - - - - -
    - -
    -

    Specifies a simple one-color fill that subsequent calls to other Graphics methods -(such as lineTo() or drawCircle()) use when drawing.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - color - Number - - - - -
      -

      the color of the fill

      - -
      - - -
    • - -
    • - - alpha - Number - - - - -
      -

      the alpha of the fill

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    bezierCurveTo

    - - -
    - (
      - -
    • - - cpX - -
    • - -
    • - - cpY - -
    • - -
    • - - cpX2 - -
    • - -
    • - - cpY2 - -
    • - -
    • - - toX - -
    • - -
    • - - toY - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:287 - -

    - - - - - -
    - -
    -

    Calculate the points for a bezier curve and then draws it.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - cpX - Number - - - - -
      -

      Control point x

      - -
      - - -
    • - -
    • - - cpY - Number - - - - -
      -

      Control point y

      - -
      - - -
    • - -
    • - - cpX2 - Number - - - - -
      -

      Second Control point x

      - -
      - - -
    • - -
    • - - cpY2 - Number - - - - -
      -

      Second Control point y

      - -
      - - -
    • - -
    • - - toX - Number - - - - -
      -

      Destination point x

      - -
      - - -
    • - -
    • - - toY - Number - - - - -
      -

      Destination point y

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    clear

    - - - () - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:609 - -

    - - - - - -
    - -
    -

    Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    destroyCachedSprite

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:1047 - -

    - - - - - -
    - -
    -

    Destroys a previous cached sprite.

    - -
    - - - - - - -
    - - -
    -

    drawCircle

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - radius - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:562 - -

    - - - - - -
    - -
    -

    Draws a circle.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the center of the circle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the center of the circle

      - -
      - - -
    • - -
    • - - radius - Number - - - - -
      -

      The radius of the circle

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    drawEllipse

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:578 - -

    - - - - - -
    - -
    -

    Draws an ellipse.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the center of the ellipse

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the center of the ellipse

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The half width of the ellipse

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The half height of the ellipse

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    drawPolygon

    - - -
    - (
      - -
    • - - path - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:595 - -

    - - - - - -
    - -
    -

    Draws a polygon using the given path.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - path - Array - - - - -
      -

      The path data used to construct the polygon.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    drawRect

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:530 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coord of the top-left of the rectangle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coord of the top-left of the rectangle

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The width of the rectangle

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The height of the rectangle

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    drawRoundedRect

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    • - - radius - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:546 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coord of the top-left of the rectangle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coord of the top-left of the rectangle

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The width of the rectangle

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The height of the rectangle

      - -
      - - -
    • - -
    • - - radius - Number - - - - -
      -

      Radius of the rectangle corners

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    drawShape

    - - -
    - (
      - -
    • - - shape - -
    • - -
    ) -
    - - - - - GraphicsData - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:1061 - -

    - - - - - -
    - -
    -

    Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - -
    -

    Returns:

    - -
    - - - GraphicsData: - -

    The generated GraphicsData object.

    - - -
    -
    - - - -
    - - -
    -

    endFill

    - - - () - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:515 - -

    - - - - - -
    - -
    -

    Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:627 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the graphics object that can then be used to create sprites -This can be quite useful if your geometry is complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:805 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the graphic shape as a rectangle object

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    lineStyle

    - - -
    - (
      - -
    • - - lineWidth - -
    • - -
    • - - color - -
    • - -
    • - - alpha - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:171 - -

    - - - - - -
    - -
    -

    Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - lineWidth - Number - - - - -
      -

      width of the line to draw, will update the objects stored style

      - -
      - - -
    • - -
    • - - color - Number - - - - -
      -

      color of the line to draw, will update the objects stored style

      - -
      - - -
    • - -
    • - - alpha - Number - - - - -
      -

      alpha of the line to draw, will update the objects stored style

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    lineTo

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:220 - -

    - - - - - -
    - -
    -

    Draws a line using the current line style from the current drawing position to (x, y); -The current drawing position is then set to (x, y).

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      the X coordinate to draw to

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      the Y coordinate to draw to

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    moveTo

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:205 - -

    - - - - - -
    - -
    -

    Moves the current drawing position to x, y.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      the X coordinate to move to

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      the Y coordinate to move to

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    quadraticCurveTo

    - - -
    - (
      - -
    • - - cpX - -
    • - -
    • - - cpY - -
    • - -
    • - - toX - -
    • - -
    • - - toY - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:237 - -

    - - - - - -
    - -
    -

    Calculate the points for a quadratic bezier curve and then draws it. -Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - cpX - Number - - - - -
      -

      Control point x

      - -
      - - -
    • - -
    • - - cpY - Number - - - - -
      -

      Control point y

      - -
      - - -
    • - -
    • - - toX - Number - - - - -
      -

      Destination point x

      - -
      - - -
    • - -
    • - - toY - Number - - - - -
      -

      Destination point y

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    -

    updateCachedSpriteTexture

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:1023 - -

    - - - - - -
    - -
    -

    Updates texture size based on canvas size

    - -
    - - - - - - -
    - - -
    -

    updateLocalBounds

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:884 - -

    - - - - - -
    - -
    -

    Update the bounds of the object

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _webGL

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:79 - -

    - - - - -
    - -
    -

    Array containing some WebGL-related properties used by the WebGL renderer.

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    blendMode

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:61 - -

    - - - - -
    - -
    -

    The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode.

    - -
    - - -

    Default: PIXI.blendModes.NORMAL;

    - - - - - -
    - - -
    -

    boundsPadding

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:96 - -

    - - - - -
    - -
    -

    The bounds' padding used for bounds calculation.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:139 - -

    - - - - -
    - -
    -

    When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. -This is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory. -It is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas. -This is not recommended if you are constantly redrawing the graphics element.

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    cachedSpriteDirty

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:124 - -

    - - - - -
    - -
    -

    Used to detect if the cached sprite object needs to be updated.

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    currentPath

    - Object - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:70 - -

    - - - - -
    - -
    -

    Current path

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:106 - -

    - - - - -
    - -
    -

    Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated.

    - -
    - - - - - - -
    - - -
    -

    fillAlpha

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:18 - -

    - - - - -
    - -
    -

    The alpha value used when filling the Graphics object.

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    graphicsData

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:43 - -

    - - - - -
    - -
    -

    Graphics data

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    isMask

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:88 - -

    - - - - -
    - -
    -

    Whether this shape is being used as a mask.

    - -
    - - - - - - -
    - - -
    -

    lineColor

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:34 - -

    - - - - -
    - -
    -

    The color of any lines drawn.

    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    lineWidth

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:26 - -

    - - - - -
    - -
    -

    The width (thickness) of any lines drawn.

    - -
    - - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    tint

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:52 - -

    - - - - -
    - -
    -

    The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint.

    - -
    - - -

    Default: 0xFFFFFF

    - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    webGLDirty

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:115 - -

    - - - - -
    - -
    -

    Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/GraphicsData.html b/tutorial-2/pixi.js-master/docs/classes/GraphicsData.html deleted file mode 100755 index dc8ff74..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/GraphicsData.html +++ /dev/null @@ -1,390 +0,0 @@ - - - - - GraphicsData - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    GraphicsData Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A GraphicsData object.

    - -
    - - -
    -

    Constructor

    -
    -

    GraphicsData

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:1093 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - - - - - - - -
    - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/GrayFilter.html b/tutorial-2/pixi.js-master/docs/classes/GrayFilter.html deleted file mode 100755 index cbf95ad..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/GrayFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - GrayFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    GrayFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This greyscales the palette of your Display Objects.

    - -
    - - -
    -

    Constructor

    -
    -

    GrayFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/GrayFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    gray

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/GrayFilter.js:41 - -

    - - - - -
    - -
    -

    The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/ImageLoader.html b/tutorial-2/pixi.js-master/docs/classes/ImageLoader.html deleted file mode 100755 index 6b068d2..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/ImageLoader.html +++ /dev/null @@ -1,1613 +0,0 @@ - - - - - ImageLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    ImageLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    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.fromFrame() and PIXI.Sprite.fromFrame() -When loaded this class will dispatch a 'loaded' event

    - -
    - - -
    -

    Constructor

    -
    -

    ImageLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the image

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:42 - -

    - - - - - -
    - -
    -

    Loads image or takes it from cache

    - -
    - - - - - - -
    - - -
    -

    loadFramedSpriteSheet

    - - -
    - (
      - -
    • - - frameWidth - -
    • - -
    • - - frameHeight - -
    • - -
    • - - textureName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:70 - -

    - - - - - -
    - -
    -

    Loads image and split it to uniform sized frames

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frameWidth - Number - - - - -
      -

      width of each frame

      - -
      - - -
    • - -
    • - - frameHeight - Number - - - - -
      -

      height of each frame

      - -
      - - -
    • - -
    • - - textureName - String - - - - -
      -

      if given, the frames will be cached in - format

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:59 - -

    - - - - - -
    - -
    -

    Invoked when image file is loaded or it is already cached and ready to use

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    frames

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:26 - -

    - - - - -
    - -
    -

    if the image is loaded with loadFramedSpriteSheet -frames will contain the sprite sheet frames

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:18 - -

    - - - - -
    - -
    -

    The texture being loaded

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/InteractionData.html b/tutorial-2/pixi.js-master/docs/classes/InteractionData.html deleted file mode 100755 index b31635a..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/InteractionData.html +++ /dev/null @@ -1,715 +0,0 @@ - - - - - InteractionData - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    InteractionData Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    Holds all information related to an Interaction event

    - -
    - - -
    -

    Constructor

    -
    -

    InteractionData

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionData.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    getLocalPosition

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - [point] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionData.js:38 - -

    - - - - - -
    - -
    -

    This will return the local coordinates of the specified displayObject for this InteractionData

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      The DisplayObject that you would like the local coords off

      - -
      - - -
    • - -
    • - - [point] - Point - optional - - - - -
      -

      A Point object in which to store the value, optional (otherwise will create a new point)

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point containing the coordinates of the InteractionData position relative to the DisplayObject

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    global

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionData.js:13 - -

    - - - - -
    - -
    -

    This point stores the global coords of where the touch/mouse event happened

    - -
    - - - - - - -
    - - -
    -

    originalEvent

    - Event - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionData.js:29 - -

    - - - - -
    - -
    -

    When passed to an event handler, this will be the original DOM Event that was captured

    - -
    - - - - - - -
    - - -
    -

    target

    - Sprite - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionData.js:21 - -

    - - - - -
    - -
    -

    The target Sprite that was interacted with

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/InteractionManager.html b/tutorial-2/pixi.js-master/docs/classes/InteractionManager.html deleted file mode 100755 index 952b5f9..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/InteractionManager.html +++ /dev/null @@ -1,2755 +0,0 @@ - - - - - InteractionManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    InteractionManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive -if its interactive parameter is set to true -This manager also supports multitouch.

    - -
    - - -
    -

    Constructor

    -
    -

    InteractionManager

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      The stage to handle interactions

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    collectInteractiveSprite

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - iParent - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:152 - -

    - - - - - -
    - -
    -

    Collects an interactive sprite recursively to have their interactions managed

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      the displayObject to collect

      - -
      - - -
    • - -
    • - - iParent - DisplayObject - - - - -
      -

      the display object's parent

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    hitTest

    - - -
    - (
      - -
    • - - item - -
    • - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:586 - -

    - - - - - -
    - -
    -

    Tests if the current mouse coordinates hit a sprite

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - item - DisplayObject - - - - -
      -

      The displayObject to test for a hit

      - -
      - - -
    • - -
    • - - interactionData - InteractionData - - - - -
      -

      The interactionData object to update in the case there is a hit

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onMouseDown

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:416 - -

    - - - - - -
    - -
    -

    Is called when the mouse button is pressed down on the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a mouse button being pressed down

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onMouseMove

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:380 - -

    - - - - - -
    - -
    -

    Is called when the mouse moves across the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of the mouse moving

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onMouseOut

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:477 - -

    - - - - - -
    - -
    -

    Is called when the mouse is moved out of the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a mouse being moved out

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onMouseUp

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:518 - -

    - - - - - -
    - -
    -

    Is called when the mouse button is released on the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a mouse button being released

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onTouchEnd

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:798 - -

    - - - - - -
    - -
    -

    Is called when a touch is ended on the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a touch ending on the renderer view

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onTouchMove

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:683 - -

    - - - - - -
    - -
    -

    Is called when a touch is moved across the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a touch moving across the renderer view

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onTouchStart

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:729 - -

    - - - - - -
    - -
    -

    Is called when a touch is started on the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a touch starting on the renderer view

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    rebuildInteractiveGraph

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:355 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    removeEvents

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:245 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    setTarget

    - - -
    - (
      - -
    • - - target - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:193 - -

    - - - - - -
    - -
    -

    Sets the target for event delegation

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setTargetDomElement

    - - -
    - (
      - -
    • - - domElement - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:211 - -

    - - - - - -
    - -
    -

    Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM -elements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element -to receive those events

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - domElement - DOMElement - - - - -
      -

      the DOM element which will receive mouse and touch events

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    update

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:270 - -

    - - - - - -
    - -
    -

    updates the state of interactive objects

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    currentCursorStyle

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:128 - -

    - - - - -
    - -
    -

    The css style of the cursor that is being used

    - -
    - - - - - - -
    - - -
    -

    interactionDOMElement

    - HTMLCanvasElement - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:70 - -

    - - - - -
    - -
    -

    Our canvas

    - -
    - - - - - - -
    - - -
    -

    interactiveItems

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:62 - -

    - - - - -
    - -
    -

    An array containing all the iterative items from the our interactive tree

    - -
    - - - - - - -
    - - -
    -

    last

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:122 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    mouse

    - InteractionData - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:24 - -

    - - - - -
    - -
    -

    The mouse data

    - -
    - - - - - - -
    - - -
    -

    mouseOut

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:135 - -

    - - - - -
    - -
    -

    Is set to true when the mouse is moved out of the canvas

    - -
    - - - - - - -
    - - -
    -

    mouseoverEnabled

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:47 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onMouseDown

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:86 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onMouseMove

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:80 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onMouseOut

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:92 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onMouseUp

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:98 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onTouchEnd

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:110 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onTouchMove

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:116 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onTouchStart

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:104 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    pool

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:54 - -

    - - - - -
    - -
    -

    Tiny little interactiveData pool !

    - -
    - - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:142 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:16 - -

    - - - - -
    - -
    -

    A reference to the stage

    - -
    - - - - - - -
    - - -
    -

    tempPoint

    - Point - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:40 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    touches

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:32 - -

    - - - - -
    - -
    -

    An object that stores current touches (InteractionData) by id reference

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/InvertFilter.html b/tutorial-2/pixi.js-master/docs/classes/InvertFilter.html deleted file mode 100755 index 458f3a4..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/InvertFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - InvertFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    InvertFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This inverts your Display Objects colors.

    - -
    - - -
    -

    Constructor

    -
    -

    InvertFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/InvertFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    invert

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/InvertFilter.js:42 - -

    - - - - -
    - -
    -

    The strength of the invert. 1 will fully invert the colors, 0 will make the object its normal color

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/JsonLoader.html b/tutorial-2/pixi.js-master/docs/classes/JsonLoader.html deleted file mode 100755 index 30fbfb4..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/JsonLoader.html +++ /dev/null @@ -1,1704 +0,0 @@ - - - - - JsonLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    JsonLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The json file loader is used to load in JSON data and parse it -When loaded this class will dispatch a 'loaded' event -If loading fails this class will dispatch an 'error' event

    - -
    - - -
    -

    Constructor

    -
    -

    JsonLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the JSON file

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:59 - -

    - - - - - -
    - -
    -

    Loads the JSON data

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onError

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:176 - -

    - - - - - -
    - -
    -

    Invoked if an error occurs.

    - -
    - - - - - - -
    - - -
    -

    onJSONLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:98 - -

    - - - - - -
    - -
    -

    Invoked when the JSON file is loaded.

    - -
    - - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:162 - -

    - - - - - -
    - -
    -

    Invoked when the json file has loaded.

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    baseUrl

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:34 - -

    - - - - -
    - -
    -

    [read-only] The base url of the bitmap font data

    - -
    - - - - - - -
    - - -
    -

    crossorigin

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:26 - -

    - - - - -
    - -
    -

    Whether the requests should be treated as cross origin

    - -
    - - - - - - -
    - - -
    -

    loaded

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:43 - -

    - - - - -
    - -
    -

    [read-only] Whether the data has loaded yet

    - -
    - - - - - - -
    - - -
    -

    url

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:18 - -

    - - - - -
    - -
    -

    The url of the bitmap font data

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/Matrix.html b/tutorial-2/pixi.js-master/docs/classes/Matrix.html deleted file mode 100755 index 8909572..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/Matrix.html +++ /dev/null @@ -1,1813 +0,0 @@ - - - - - Matrix - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Matrix Class

    -
    - - - - - -
    - Defined in: src/pixi/geom/Matrix.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Matrix class is now an object, which makes it a lot faster, -here is a representation of it : -| a | b | tx| -| c | d | ty| -| 0 | 0 | 1 |

    - -
    - - -
    -

    Constructor

    -
    -

    Matrix

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - -
      - -
    • - a - - - -
    • - -
    • - b - - - -
    • - -
    • - c - - - -
    • - -
    • - d - - - -
    • - -
    • - tx - - - -
    • - -
    • - ty - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    append

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    ) -
    - - - - - Matrix - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:225 - -

    - - - - - -
    - -
    -

    Appends the given Matrix to this Matrix.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Matrix - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Matrix: - -

    This matrix. Good for chaining method calls.

    - - -
    -
    - - - -
    - - -
    -

    apply

    - - -
    - (
      - -
    • - - pos - -
    • - -
    • - - [newPos] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:123 - -

    - - - - - -
    - -
    -

    Get a new position with the current transformation applied. -Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - pos - Point - - - - -
      -

      The origin

      - -
      - - -
    • - -
    • - - [newPos] - Point - optional - - - - -
      -

      The point that the new position is assigned to (allowed to be same as input)

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    The new point, transformed through this matrix

    - - -
    -
    - - - -
    - - -
    -

    applyInverse

    - - -
    - (
      - -
    • - - pos - -
    • - -
    • - - [newPos] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:142 - -

    - - - - - -
    - -
    -

    Get a new position with the inverse of the current transformation applied. -Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - pos - Point - - - - -
      -

      The origin

      - -
      - - -
    • - -
    • - - [newPos] - Point - optional - - - - -
      -

      The point that the new position is assigned to (allowed to be same as input)

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    The new point, inverse-transformed through this matrix

    - - -
    -
    - - - -
    - - -
    -

    fromArray

    - - -
    - (
      - -
    • - - array - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:60 - -

    - - - - - -
    - -
    -

    Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:

    -

    a = array[0] -b = array[1] -c = array[3] -d = array[4] -tx = array[2] -ty = array[5]

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - array - Array - - - - -
      -

      The array that the matrix will be populated from.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    identity

    - - - () - - - - - Matrix - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:250 - -

    - - - - - -
    - -
    -

    Resets this Matix to an identity (default) matrix.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Matrix: - -

    This matrix. Good for chaining method calls.

    - - -
    -
    - - - -
    - - -
    -

    rotate

    - - -
    - (
      - -
    • - - angle - -
    • - -
    ) -
    - - - - - Matrix - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:200 - -

    - - - - - -
    - -
    -

    Applies a rotation transformation to the matrix.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - angle - Number - - - - -
      -

      The angle in radians.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Matrix: - -

    This matrix. Good for chaining method calls.

    - - -
    -
    - - - -
    - - -
    -

    scale

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Matrix - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:179 - -

    - - - - - -
    - -
    -

    Applies a scale transformation to the matrix.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The amount to scale horizontally

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The amount to scale vertically

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Matrix: - -

    This matrix. Good for chaining method calls.

    - - -
    -
    - - - -
    - - -
    -

    toArray

    - - -
    - (
      - -
    • - - transpose - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:83 - -

    - - - - - -
    - -
    -

    Creates an array from the current Matrix object.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - transpose - Boolean - - - - -
      -

      Whether we need to transpose the matrix or not

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    the newly created array which contains the matrix

    - - -
    -
    - - - -
    - - -
    -

    translate

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Matrix - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:163 - -

    - - - - - -
    - -
    -

    Translates the matrix on the x and y.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      - -
      - - -
    • - -
    • - - y - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Matrix: - -

    This matrix. Good for chaining method calls.

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    a

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:17 - -

    - - - - -
    - -
    - -
    - - -

    Default: 1

    - - - - - -
    - - -
    -

    b

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:24 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    c

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:31 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    d

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:38 - -

    - - - - -
    - -
    - -
    - - -

    Default: 1

    - - - - - -
    - - -
    -

    tx

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:45 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    ty

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:52 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/MovieClip.html b/tutorial-2/pixi.js-master/docs/classes/MovieClip.html deleted file mode 100755 index 6ff435e..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/MovieClip.html +++ /dev/null @@ -1,7042 +0,0 @@ - - - - - MovieClip - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    MovieClip Class

    -
    - - - -
    - Extends Sprite -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    - -
    - - -
    -

    Constructor

    -
    -

    MovieClip

    - - -
    - (
      - -
    • - - textures - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - textures - Array - - - - -
      -

      an array of {Texture} objects that make up the animation

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:305 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:242 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    fromFrames

    - - -
    - (
      - -
    • - - frames - -
    • - -
    ) -
    - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:169 - -

    - - - - - -
    - -
    -

    A short hand way of creating a movieclip from an array of frame ids

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frames - Array - - - - -
      -

      the array of frames ids the movieclip will use as its texture frames

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    fromImages

    - - -
    - (
      - -
    • - - frames - -
    • - -
    ) -
    - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:188 - -

    - - - - - -
    - -
    -

    A short hand way of creating a movieclip from an array of image ids

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frames - Array - - - - -
      -

      the array of image ids the movieclip will use as its texture frames

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    ) -
    - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:163 - -

    - - - - - -
    - -
    -

    Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Matrix - - - - -
      -

      the transformation matrix of the sprite

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    gotoAndPlay

    - - -
    - (
      - -
    • - - frameNumber - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:125 - -

    - - - - - -
    - -
    -

    Goes to a specific frame and begins playing the MovieClip

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frameNumber - Number - - - - -
      -

      frame index to start at

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    gotoAndStop

    - - -
    - (
      - -
    • - - frameNumber - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:111 - -

    - - - - - -
    - -
    -

    Stops the MovieClip and goes to a specific frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frameNumber - Number - - - - -
      -

      frame index to stop at

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:147 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    play

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:101 - -

    - - - - - -
    - -
    -

    Plays the MovieClip

    - -
    - - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setTexture

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:135 - -

    - - - - - -
    - -
    -

    Sets the texture of the sprite

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The PIXI texture that is displayed by the sprite

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    stop

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:91 - -

    - - - - - -
    - -
    -

    Stops the MovieClip

    - -
    - - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _height

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:50 - -

    - - - - -
    - -
    -

    The height of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _width

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:41 - -

    - - - - -
    - -
    -

    The width of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    anchor

    - Point - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:22 - -

    - - - - -
    - -
    -

    The anchor sets the origin point of the texture. -The default is 0,0 this means the texture's origin is the top left -Setting than anchor to 0.5,0.5 means the textures origin is centered -Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner

    - -
    - - - - - - -
    - - -
    -

    animationSpeed

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:25 - -

    - - - - -
    - -
    -

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    - -
    - - -

    Default: 1

    - - - - - -
    - - -
    -

    blendMode

    - Number - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:68 - -

    - - - - -
    - -
    -

    The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.

    - -
    - - -

    Default: PIXI.blendModes.NORMAL;

    - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    currentFrame

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:51 - -

    - - - - -
    - -
    -

    [read-only] The MovieClips current frame index (this may not have to be a whole number)

    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/display/Sprite.js:119 - -

    - - - - -
    - -
    -

    The height of the sprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    loop

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:34 - -

    - - - - -
    - -
    -

    Whether or not the movie clip repeats after playing.

    - -
    - - -

    Default: true

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    onComplete

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:43 - -

    - - - - -
    - -
    -

    Function to call when a MovieClip finishes playing

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    playing

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:61 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the MovieClip is currently playing

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    shader

    - PIXI.AbstractFilter - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:77 - -

    - - - - -
    - -
    -

    The shader that will be used to render the texture to the stage. Set to null to remove a current shader.

    - -
    - - -

    Default: null

    - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:33 - -

    - - - - -
    - -
    -

    The texture that the sprite is using

    - -
    - - - - - - -
    - - -
    -

    textures

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:17 - -

    - - - - -
    - -
    -

    The array of textures that make up the animation

    - -
    - - - - - - -
    - - -
    -

    tint

    - Number - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:59 - -

    - - - - -
    - -
    -

    The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.

    - -
    - - -

    Default: 0xFFFFFF

    - - - - - -
    - - -
    -

    totalFrames

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:75 - -

    - - - - -
    - -
    -

    [read-only] totalFrames is the total number of frames in the MovieClip. This is the same as number of textures -assigned to the MovieClip.

    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/display/Sprite.js:103 - -

    - - - - -
    - -
    -

    The width of the sprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/NoiseFilter.html b/tutorial-2/pixi.js-master/docs/classes/NoiseFilter.html deleted file mode 100755 index 0a2e317..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/NoiseFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - NoiseFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    NoiseFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A Noise effect filter.

    - -
    - - -
    -

    Constructor

    -
    -

    NoiseFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NoiseFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    noise

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NoiseFilter.js:49 - -

    - - - - -
    - -
    -

    The amount of noise to apply.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/NormalMapFilter.html b/tutorial-2/pixi.js-master/docs/classes/NormalMapFilter.html deleted file mode 100755 index f553ab2..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/NormalMapFilter.html +++ /dev/null @@ -1,1037 +0,0 @@ - - - - - NormalMapFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    NormalMapFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The NormalMapFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. -You can use this filter to apply all manor of crazy warping effects -Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.

    - -
    - - -
    -

    Constructor

    -
    -

    NormalMapFilter

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NormalMapFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The texture used for the displacement map * must be power of 2 texture at the moment

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    onTextureLoaded

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NormalMapFilter.js:140 - -

    - - - - - -
    - -
    -

    Sets the map dimensions uniforms when the texture becomes available.

    - -
    - - - - - - -
    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    map

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NormalMapFilter.js:153 - -

    - - - - -
    - -
    -

    The texture used for the displacement map. Must be power of 2 texture.

    - -
    - - - - - - -
    - - -
    -

    offset

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NormalMapFilter.js:183 - -

    - - - - -
    - -
    -

    The offset used to move the displacement map.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NormalMapFilter.js:168 - -

    - - - - -
    - -
    -

    The multiplier used to scale the displacement result from the map calculation.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/PixelateFilter.html b/tutorial-2/pixi.js-master/docs/classes/PixelateFilter.html deleted file mode 100755 index 50fd174..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/PixelateFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - PixelateFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PixelateFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This filter applies a pixelate effect making display objects appear 'blocky'.

    - -
    - - -
    -

    Constructor

    -
    -

    PixelateFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/PixelateFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    size

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/PixelateFilter.js:48 - -

    - - - - -
    - -
    -

    This a point that describes the size of the blocks. x is the width of the block and y is the height.

    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/PixiFastShader.html b/tutorial-2/pixi.js-master/docs/classes/PixiFastShader.html deleted file mode 100755 index 5c0596a..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/PixiFastShader.html +++ /dev/null @@ -1,891 +0,0 @@ - - - - - PixiFastShader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PixiFastShader Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    PixiFastShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:143 - -

    - - - - - -
    - -
    -

    Destroys the shader.

    - -
    - - - - - - -
    - - -
    -

    init

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:94 - -

    - - - - - -
    - -
    -

    Initialises the shader.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _UID

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:32 - -

    - - - - -
    - -
    -

    The fragment shader.

    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:19 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    program

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:25 - -

    - - - - -
    - -
    -

    The WebGL program.

    - -
    - - - - - - -
    - - -
    -

    textureCount

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:82 - -

    - - - - -
    - -
    -

    A local texture counter for multi-texture shaders.

    - -
    - - - - - - -
    - - -
    -

    vertexSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:47 - -

    - - - - -
    - -
    -

    The vertex shader.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/PixiShader.html b/tutorial-2/pixi.js-master/docs/classes/PixiShader.html deleted file mode 100755 index 79f93ed..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/PixiShader.html +++ /dev/null @@ -1,1239 +0,0 @@ - - - - - PixiShader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PixiShader Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    PixiShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:6 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:351 - -

    - - - - - -
    - -
    -

    Destroys the shader.

    - -
    - - - - - - -
    - - -
    -

    init

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:83 - -

    - - - - - -
    - -
    -

    Initialises the shader.

    - -
    - - - - - - -
    - - -
    -

    initSampler2D

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:208 - -

    - - - - - -
    - -
    -

    Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded)

    - -
    - - - - - - -
    - - -
    -

    initUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:134 - -

    - - - - - -
    - -
    -

    Initialises the shader uniform values.

    -

    Uniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/ -http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf

    - -
    - - - - - - -
    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:283 - -

    - - - - - -
    - -
    -

    Updates the shader uniform values.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _UID

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:13 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    attributes

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:70 - -

    - - - - -
    - -
    -

    Uniform attributes cache.

    - -
    - - - - - - -
    - - -
    -

    defaultVertexSrc

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:365 - -

    - - - - -
    - -
    -

    The Default Vertex shader source.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:63 - -

    - - - - -
    - -
    -

    A dirty flag

    - -
    - - - - - - -
    - - -
    -

    firstRun

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:55 - -

    - - - - -
    - -
    -

    A local flag

    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:33 - -

    - - - - -
    - -
    -

    The fragment shader.

    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:20 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    program

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:26 - -

    - - - - -
    - -
    -

    The WebGL program.

    - -
    - - - - - - -
    - - -
    -

    textureCount

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:48 - -

    - - - - -
    - -
    -

    A local texture counter for multi-texture shaders.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/Point.html b/tutorial-2/pixi.js-master/docs/classes/Point.html deleted file mode 100755 index d2030b9..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/Point.html +++ /dev/null @@ -1,785 +0,0 @@ - - - - - Point - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Point Class

    -
    - - - - - -
    - Defined in: src/pixi/geom/Point.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    - -
    - - -
    -

    Constructor

    -
    -

    Point

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Point.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      position of the point on the x axis

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      position of the point on the y axis

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - -
      - -
    • - clone - - - -
    • - -
    • - set - - - -
    • - -
    -
    - - - -
    -

    Properties

    - -
      - -
    • - x - - - -
    • - -
    • - y - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Point.js:30 - -

    - - - - - -
    - -
    -

    Creates a clone of this point

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Point: - -

    a copy of the point

    - - -
    -
    - - - -
    - - -
    -

    set

    - - -
    - (
      - -
    • - - [x=0] - -
    • - -
    • - - [y=0] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Point.js:41 - -

    - - - - - -
    - -
    -

    Sets the point to a new x and y position. -If y is omitted, both x and y will be set to x.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - [x=0] - Number - optional - - - - -
      -

      position of the point on the x axis

      - -
      - - -
    • - -
    • - - [y=0] - Number - optional - - - - -
      -

      position of the point on the y axis

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Point.js:15 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Point.js:22 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/PolyK.html b/tutorial-2/pixi.js-master/docs/classes/PolyK.html deleted file mode 100755 index e1d21ed..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/PolyK.html +++ /dev/null @@ -1,761 +0,0 @@ - - - - - PolyK - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PolyK Class

    -
    - - - - - -
    - Defined in: src/pixi/utils/Polyk.js:34 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    Based on the Polyk library http://polyk.ivank.net released under MIT licence. -This is an amazing lib! -Slightly modified by Mat Groves (matgroves.com);

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _convex

    - - - () - - - - - Boolean - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Polyk.js:158 - -

    - - - - - -
    - -
    -

    Checks whether a shape is convex

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Boolean: - - -
    -
    - - - -
    - - -
    -

    _PointInTriangle

    - - -
    - (
      - -
    • - - px - -
    • - -
    • - - py - -
    • - -
    • - - ax - -
    • - -
    • - - ay - -
    • - -
    • - - bx - -
    • - -
    • - - by - -
    • - -
    • - - cx - -
    • - -
    • - - cy - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Polyk.js:120 - -

    - - - - - -
    - -
    -

    Checks whether a point is within a triangle

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - px - Number - - - - -
      -

      x coordinate of the point to test

      - -
      - - -
    • - -
    • - - py - Number - - - - -
      -

      y coordinate of the point to test

      - -
      - - -
    • - -
    • - - ax - Number - - - - -
      -

      x coordinate of the a point of the triangle

      - -
      - - -
    • - -
    • - - ay - Number - - - - -
      -

      y coordinate of the a point of the triangle

      - -
      - - -
    • - -
    • - - bx - Number - - - - -
      -

      x coordinate of the b point of the triangle

      - -
      - - -
    • - -
    • - - by - Number - - - - -
      -

      y coordinate of the b point of the triangle

      - -
      - - -
    • - -
    • - - cx - Number - - - - -
      -

      x coordinate of the c point of the triangle

      - -
      - - -
    • - -
    • - - cy - Number - - - - -
      -

      y coordinate of the c point of the triangle

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - - -
    -
    - - - -
    - - -
    -

    Triangulate

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Polyk.js:42 - -

    - - - - - -
    - -
    -

    Triangulates shapes for webGL graphic fills.

    - -
    - - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/Polygon.html b/tutorial-2/pixi.js-master/docs/classes/Polygon.html deleted file mode 100755 index 6fa4c44..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/Polygon.html +++ /dev/null @@ -1,661 +0,0 @@ - - - - - Polygon - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Polygon Class

    -
    - - - - - -
    - Defined in: src/pixi/geom/Polygon.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    Polygon

    - - -
    - (
      - -
    • - - points - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Polygon.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - points - Array | Array | Point... | Number... - - - - multiple - - -
      -

      This can be an array of Points that form the polygon, - a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be - all the points of the polygon e.g. new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...), or the - arguments passed can be flat x,y values e.g. new PIXI.Polygon(x,y, x,y, x,y, ...) where x and y are - Numbers.

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Polygon - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Polygon.js:35 - -

    - - - - - -
    - -
    -

    Creates a clone of this polygon

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Polygon: - -

    a copy of the polygon

    - - -
    -
    - - - -
    - - -
    -

    contains

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Polygon.js:47 - -

    - - - - - -
    - -
    -

    Checks whether the x and y coordinates passed to this function are contained within this polygon

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the point to test

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the point to test

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Whether the x/y coordinates are within this polygon

    - - -
    -
    - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/PrimitiveShader.html b/tutorial-2/pixi.js-master/docs/classes/PrimitiveShader.html deleted file mode 100755 index 0641655..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/PrimitiveShader.html +++ /dev/null @@ -1,839 +0,0 @@ - - - - - PrimitiveShader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PrimitiveShader Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    PrimitiveShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:103 - -

    - - - - - -
    - -
    -

    Destroys the shader.

    - -
    - - - - - - -
    - - -
    -

    init

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:74 - -

    - - - - - -
    - -
    -

    Initialises the shader.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _UID

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:32 - -

    - - - - -
    - -
    -

    The fragment shader.

    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:19 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    program

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:25 - -

    - - - - -
    - -
    -

    The WebGL program.

    - -
    - - - - - - -
    - - -
    -

    vertexSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:46 - -

    - - - - -
    - -
    -

    The vertex shader.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/RGBSplitFilter.html b/tutorial-2/pixi.js-master/docs/classes/RGBSplitFilter.html deleted file mode 100755 index ffb75a6..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/RGBSplitFilter.html +++ /dev/null @@ -1,939 +0,0 @@ - - - - - RGBSplitFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    RGBSplitFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    An RGB Split Filter.

    - -
    - - -
    -

    Constructor

    -
    -

    RGBSplitFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/RGBSplitFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blue

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/RGBSplitFilter.js:78 - -

    - - - - -
    - -
    -

    Blue offset.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    green

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/RGBSplitFilter.js:63 - -

    - - - - -
    - -
    -

    Green channel offset.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    red

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/RGBSplitFilter.js:48 - -

    - - - - -
    - -
    -

    Red channel offset.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/Rectangle.html b/tutorial-2/pixi.js-master/docs/classes/Rectangle.html deleted file mode 100755 index 2180606..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/Rectangle.html +++ /dev/null @@ -1,950 +0,0 @@ - - - - - Rectangle - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Rectangle Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    - -
    - - -
    -

    Constructor

    -
    -

    Rectangle

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the upper-left corner of the rectangle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the upper-left corner of the rectangle

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The overall width of this rectangle

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The overall height of this rectangle

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - -
      - -
    • - height - - - -
    • - -
    • - width - - - -
    • - -
    • - x - - - -
    • - -
    • - y - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:46 - -

    - - - - - -
    - -
    -

    Creates a clone of this Rectangle

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    a copy of the rectangle

    - - -
    -
    - - - -
    - - -
    -

    contains

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:57 - -

    - - - - - -
    - -
    -

    Checks whether the x and y coordinates given are contained within this Rectangle

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the point to test

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the point to test

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Whether the x/y coordinates are within this Rectangle

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:38 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:31 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:17 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:24 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/RenderTexture.html b/tutorial-2/pixi.js-master/docs/classes/RenderTexture.html deleted file mode 100755 index f7c7c7e..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/RenderTexture.html +++ /dev/null @@ -1,2964 +0,0 @@ - - - - - RenderTexture - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    RenderTexture Class

    -
    - - - -
    - Extends Texture -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A RenderTexture is a special texture that allows any Pixi display object to be rendered to it.

    -

    Hint: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead.

    -

    A RenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example:

    -

    var renderTexture = new PIXI.RenderTexture(800, 600); - var sprite = PIXI.Sprite.fromImage("spinObj_01.png"); - sprite.position.x = 800/2; - sprite.position.y = 600/2; - sprite.anchor.x = 0.5; - sprite.anchor.y = 0.5; - renderTexture.render(sprite);

    -

    The Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual position a DisplayObjectContainer should be used:

    -

    var doc = new PIXI.DisplayObjectContainer(); - doc.addChild(sprite); - renderTexture.render(doc); // Renders to center of renderTexture

    - -
    - - -
    -

    Constructor

    -
    -

    RenderTexture

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    • - - renderer - -
    • - -
    • - - scaleMode - -
    • - -
    • - - resolution - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      The width of the render texture

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The height of the render texture

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used for this RenderTexture

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _updateUvs

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:200 - -

    - - - - - -
    - -
    -

    Updates the internal WebGL UV cache.

    - -
    - - - - - - -
    - - -
    -

    clear

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:171 - -

    - - - - - -
    - -
    -

    Clears the RenderTexture.

    - -
    - - - - - - -
    - - -
    -

    destroy

    - - -
    - (
      - -
    • - - destroyBase - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:149 - -

    - - - - - -
    - -
    -

    Destroys this texture

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - destroyBase - Boolean - - - - -
      -

      Whether to destroy the base texture as well

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    getBase64

    - - - () - - - - - String - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:291 - -

    - - - - - -
    - -
    -

    Will return a a base64 encoded string of this texture. It works by calling RenderTexture.getCanvas and then running toDataURL on that.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - String: - -

    A base64 encoded string of the texture.

    - - -
    -
    - - - -
    - - -
    -

    getCanvas

    - - - () - - - - - HTMLCanvasElement - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:302 - -

    - - - - - -
    - -
    -

    Creates a Canvas element, renders this RenderTexture to it and then returns it.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - HTMLCanvasElement: - -

    A Canvas element with the texture rendered on.

    - - -
    -
    - - - -
    - - -
    -

    getImage

    - - - () - - - - - Image - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:278 - -

    - - - - - -
    - -
    -

    Will return a HTML Image of the texture

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Image: - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onBaseTextureLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:131 - -

    - - - - - -
    - -
    -

    Called when the base texture is loaded

    - -
    - - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderCanvas

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - [matrix] - -
    • - -
    • - - [clear] - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:237 - -

    - - - - - -
    - -
    -

    This function will draw the display object to the texture.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      The display object to render this texture on

      - -
      - - -
    • - -
    • - - [matrix] - Matrix - optional - - - - -
      -

      Optional matrix to apply to the display object before rendering.

      - -
      - - -
    • - -
    • - - [clear] - Boolean - optional - - - - -
      -

      If true the texture will be cleared before the displayObject is drawn

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderWebGL

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - [matrix] - -
    • - -
    • - - [clear] - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:188 - -

    - - - - - -
    - -
    -

    This function will draw the display object to the texture.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      The display object to render this texture on

      - -
      - - -
    • - -
    • - - [matrix] - Matrix - optional - - - - -
      -

      Optional matrix to apply to the display object before rendering.

      - -
      - - -
    • - -
    • - - [clear] - Boolean - optional - - - - -
      -

      If true the texture will be cleared before the displayObject is drawn

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    resize

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    • - - updateBase - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:137 - -

    - - - - - -
    - -
    -

    Resizes the RenderTexture.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      The width to resize to.

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The height to resize to.

      - -
      - - -
    • - -
    • - - updateBase - Boolean - - - - -
      -

      Should the baseTexture.width and height values be resized as well?

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setFrame

    - - -
    - (
      - -
    • - - frame - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:162 - -

    - - - - - -
    - -
    -

    Specifies the region of the baseTexture that this texture will use.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frame - Rectangle - - - - -
      -

      The frame of the texture to set it to

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _uvs

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:83 - -

    - - - - -
    - -
    -

    The WebGL UV data cache.

    - -
    - - - - - - -
    - - -
    -

    baseTexture

    - BaseTexture - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:78 - -

    - - - - -
    - -
    -

    The base texture object that this texture uses

    - -
    - - - - - - -
    - - -
    -

    crop

    - Rectangle - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:69 - -

    - - - - -
    - -
    -

    This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, -irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)

    - -
    - - - - - - -
    - - -
    -

    frame

    - Rectangle - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:61 - -

    - - - - -
    - -
    -

    The framing rectangle of the render texture

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:45 - -

    - - - - -
    - -
    -

    The height of the render texture

    - -
    - - - - - - -
    - - -
    -

    noFrame

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:24 - -

    - - - - -
    - -
    -

    Does this Texture have any frame data assigned to it?

    - -
    - - - - - - -
    - - -
    -

    renderer

    - CanvasRenderer | WebGLRenderer - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:99 - -

    - - - - -
    - -
    -

    The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL.

    - -
    - - - - - - -
    - - -
    -

    requiresUpdate

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:75 - -

    - - - - -
    - -
    -

    This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)

    - -
    - - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:53 - -

    - - - - -
    - -
    -

    The Resolution of the texture.

    - -
    - - - - - - -
    - - -
    -

    trim

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:59 - -

    - - - - -
    - -
    -

    The texture trim data.

    - -
    - - - - - - -
    - - -
    -

    valid

    - Boolean - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:125 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:37 - -

    - - - - -
    - -
    -

    The with of the render texture

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/Rope.html b/tutorial-2/pixi.js-master/docs/classes/Rope.html deleted file mode 100755 index c1c314b..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/Rope.html +++ /dev/null @@ -1,5931 +0,0 @@ - - - - - Rope - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Rope Class

    -
    - - - -
    - Extends Strip -
    - - - -
    - Defined in: src/pixi/extras/Rope.js:6 -
    - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    Rope

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - points - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Rope.js:6 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -
        -
      • The texture to use on the rope.
      • -
      - -
      - - -
    • - -
    • - - points - Array - - - - -
      -
        -
      • An array of {PIXI.Point}.
      • -
      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Strip: - - - - src/pixi/extras/Strip.js:341 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    renderStripFlat

    - - -
    - (
      - -
    • - - strip - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Strip: - - - - src/pixi/extras/Strip.js:293 - -

    - - - - - -
    - -
    -

    Renders a flat strip

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - strip - Strip - - - - -
      -

      The Strip to render

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - Strip: - - - - src/pixi/extras/Strip.js:43 - -

    - - - - -
    - -
    -

    Whether the strip is dirty or not

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - Strip: - - - - src/pixi/extras/Strip.js:52 - -

    - - - - -
    - -
    -

    if you need a padding, not yet implemented

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - -

    Inherited from - Strip: - - - - src/pixi/extras/Strip.js:20 - -

    - - - - -
    - -
    -

    The texture of the strip

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/Rounded Rectangle.html b/tutorial-2/pixi.js-master/docs/classes/Rounded Rectangle.html deleted file mode 100755 index 00a3e40..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/Rounded Rectangle.html +++ /dev/null @@ -1,1025 +0,0 @@ - - - - - Rounded Rectangle - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Rounded Rectangle Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    the Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height.

    - -
    - - -
    -

    Constructor

    -
    -

    Rounded Rectangle

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    • - - radius - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the upper-left corner of the rounded rectangle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the upper-left corner of the rounded rectangle

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The overall width of this rounded rectangle

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The overall height of this rounded rectangle

      - -
      - - -
    • - -
    • - - radius - Number - - - - -
      -

      The overall radius of this corners of this rounded rectangle

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - -
      - -
    • - height - - - -
    • - -
    • - radius - - - -
    • - -
    • - width - - - -
    • - -
    • - x - - - -
    • - -
    • - y - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Rounded Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:54 - -

    - - - - - -
    - -
    -

    Creates a clone of this Rounded Rectangle

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rounded Rectangle: - -

    a copy of the rounded rectangle

    - - -
    -
    - - - -
    - - -
    -

    contains

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:65 - -

    - - - - - -
    - -
    -

    Checks whether the x and y coordinates given are contained within this Rounded Rectangle

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the point to test

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the point to test

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Whether the x/y coordinates are within this Rounded Rectangle

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:39 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    radius

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:46 - -

    - - - - -
    - -
    - -
    - - -

    Default: 20

    - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:32 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:18 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:25 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/SepiaFilter.html b/tutorial-2/pixi.js-master/docs/classes/SepiaFilter.html deleted file mode 100755 index fee5fe6..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/SepiaFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - SepiaFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    SepiaFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This applies a sepia effect to your Display Objects.

    - -
    - - -
    -

    Constructor

    -
    -

    SepiaFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/SepiaFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    sepia

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/SepiaFilter.js:43 - -

    - - - - -
    - -
    -

    The strength of the sepia. 1 will apply the full sepia effect, 0 will make the object its normal color.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/SmartBlurFilter.html b/tutorial-2/pixi.js-master/docs/classes/SmartBlurFilter.html deleted file mode 100755 index 4f1da72..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/SmartBlurFilter.html +++ /dev/null @@ -1,837 +0,0 @@ - - - - - SmartBlurFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    SmartBlurFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A Smart Blur Filter.

    - -
    - - -
    -

    Constructor

    -
    -

    SmartBlurFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/SmartBlurFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number the strength of the blur - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/SmartBlurFilter.js:61 - -

    - - - - -
    - -
    -

    The strength of the blur.

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/Spine.html b/tutorial-2/pixi.js-master/docs/classes/Spine.html deleted file mode 100755 index 4c0f0fa..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/Spine.html +++ /dev/null @@ -1,5572 +0,0 @@ - - - - - Spine - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Spine Class

    -
    - - - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A class that enables the you to import and run your spine animations in pixi. -Spine animation data needs to be loaded using the PIXI.AssetLoader or PIXI.SpineLoader before it can be used by this class -See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source

    - -
    - - -
    -

    Constructor

    -
    -

    Spine

    - - -
    - (
      - -
    • - - url - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Spine.js:1357 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the spine anim file to be used

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/SpineLoader.html b/tutorial-2/pixi.js-master/docs/classes/SpineLoader.html deleted file mode 100755 index ed00edc..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/SpineLoader.html +++ /dev/null @@ -1,1527 +0,0 @@ - - - - - SpineLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    SpineLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Spine loader is used to load in JSON spine data -To generate the data you need to use http://esotericsoftware.com/ and export in the "JSON" format -Due to a clash of names You will need to change the extension of the spine file from .json to .anim for it to load -See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source -You will need to generate a sprite sheet to accompany the spine data -When loaded this class will dispatch a "loaded" event

    - -
    - - -
    -

    Constructor

    -
    -

    SpineLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:10 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the JSON file

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:56 - -

    - - - - - -
    - -
    -

    Loads the JSON data

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:72 - -

    - - - - - -
    - -
    -

    Invoked when JSON file is loaded.

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    crossorigin

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:34 - -

    - - - - -
    - -
    -

    Whether the requests should be treated as cross origin

    - -
    - - - - - - -
    - - -
    -

    loaded

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:42 - -

    - - - - -
    - -
    -

    [read-only] Whether the data has loaded yet

    - -
    - - - - - - -
    - - -
    -

    url

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:26 - -

    - - - - -
    - -
    -

    The url of the bitmap font data

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/Sprite.html b/tutorial-2/pixi.js-master/docs/classes/Sprite.html deleted file mode 100755 index 59ecf6e..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/Sprite.html +++ /dev/null @@ -1,6422 +0,0 @@ - - - - - Sprite - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Sprite Class

    -
    - - - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Sprite object is the base for all textured objects that are rendered to the screen

    - -
    - - -
    -

    Constructor

    -
    -

    Sprite

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The texture for this sprite

      -

      A sprite can be created directly from an image like this : -var sprite = new PIXI.Sprite.fromImage('assets/image.png'); -yourStage.addChild(sprite); -then obviously don't forget to add it to the stage you have already created

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:305 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:242 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    fromFrame

    - - -
    - (
      - -
    • - - frameId - -
    • - -
    ) -
    - - - - - Sprite - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:418 - -

    - - - - - -
    - -
    -

    Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId - The frame ids are created when a Texture packer file has been loaded

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frameId - String - - - - -
      -

      The frame Id of the texture in the cache

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Sprite: - -

    A new Sprite using a texture from the texture cache matching the frameId

    - - -
    -
    - - - -
    - - -
    -

    fromImage

    - - -
    - (
      - -
    • - - imageId - -
    • - -
    ) -
    - - - - - Sprite - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:435 - -

    - - - - - -
    - -
    -

    Helper function that creates a sprite that will contain a texture based on an image url - If the image is not in the texture cache it will be loaded

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - imageId - String - - - - -
      -

      The image url of the texture

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Sprite: - -

    A new Sprite using a texture from the texture cache matching the image id

    - - -
    -
    - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    ) -
    - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:163 - -

    - - - - - -
    - -
    -

    Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Matrix - - - - -
      -

      the transformation matrix of the sprite

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:147 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setTexture

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:135 - -

    - - - - - -
    - -
    -

    Sets the texture of the sprite

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The PIXI texture that is displayed by the sprite

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _height

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:50 - -

    - - - - -
    - -
    -

    The height of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _width

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:41 - -

    - - - - -
    - -
    -

    The width of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    anchor

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:22 - -

    - - - - -
    - -
    -

    The anchor sets the origin point of the texture. -The default is 0,0 this means the texture's origin is the top left -Setting than anchor to 0.5,0.5 means the textures origin is centered -Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner

    - -
    - - - - - - -
    - - -
    -

    blendMode

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:68 - -

    - - - - -
    - -
    -

    The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.

    - -
    - - -

    Default: PIXI.blendModes.NORMAL;

    - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/display/Sprite.js:119 - -

    - - - - -
    - -
    -

    The height of the sprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    shader

    - PIXI.AbstractFilter - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:77 - -

    - - - - -
    - -
    -

    The shader that will be used to render the texture to the stage. Set to null to remove a current shader.

    - -
    - - -

    Default: null

    - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:33 - -

    - - - - -
    - -
    -

    The texture that the sprite is using

    - -
    - - - - - - -
    - - -
    -

    tint

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:59 - -

    - - - - -
    - -
    -

    The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.

    - -
    - - -

    Default: 0xFFFFFF

    - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/display/Sprite.js:103 - -

    - - - - -
    - -
    -

    The width of the sprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/SpriteBatch.html b/tutorial-2/pixi.js-master/docs/classes/SpriteBatch.html deleted file mode 100755 index d55ac22..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/SpriteBatch.html +++ /dev/null @@ -1,643 +0,0 @@ - - - - - SpriteBatch - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    SpriteBatch Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The SpriteBatch class is a really fast version of the DisplayObjectContainer -built solely for speed, so use when you need a lot of sprites or particles. -And it's extremely easy to use :

    -

    var container = new PIXI.SpriteBatch();

    -

    stage.addChild(container);

    -

    for(var i = 0; i < 100; i++) - { - var sprite = new PIXI.Sprite.fromImage("myImage.png"); - container.addChild(sprite); - } -And here you have a hundred sprites that will be renderer at the speed of light

    - -
    - - -
    -

    Constructor

    -
    -

    SpriteBatch

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/SpriteBatch.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/SpriteBatch.js:90 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/SpriteBatch.js:66 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/SpriteSheetLoader.html b/tutorial-2/pixi.js-master/docs/classes/SpriteSheetLoader.html deleted file mode 100755 index d2f8285..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/SpriteSheetLoader.html +++ /dev/null @@ -1,1632 +0,0 @@ - - - - - SpriteSheetLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    SpriteSheetLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    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 in 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 a 'texture atlas') as it means sprites 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.fromFrameId() -This loader will load the image file that the Spritesheet points to as well as the data. -When loaded this class will dispatch a 'loaded' event

    - -
    - - -
    -

    Constructor

    -
    -

    SpriteSheetLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the sprite sheet JSON file

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:69 - -

    - - - - - -
    - -
    -

    This will begin loading the JSON file

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:84 - -

    - - - - - -
    - -
    -

    Invoke when all files are loaded (json and texture)

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    baseUrl

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:38 - -

    - - - - -
    - -
    -

    [read-only] The base url of the bitmap font data

    - -
    - - - - - - -
    - - -
    -

    crossorigin

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:30 - -

    - - - - -
    - -
    -

    Whether the requests should be treated as cross origin

    - -
    - - - - - - -
    - - -
    -

    frames

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:55 - -

    - - - - -
    - -
    -

    The frames of the sprite sheet

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:47 - -

    - - - - -
    - -
    -

    The texture being loaded

    - -
    - - - - - - -
    - - -
    -

    url

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:22 - -

    - - - - -
    - -
    -

    The url of the atlas data

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/Stage.html b/tutorial-2/pixi.js-master/docs/classes/Stage.html deleted file mode 100755 index 27d0d6a..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/Stage.html +++ /dev/null @@ -1,5961 +0,0 @@ - - - - - Stage - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Stage Class

    -
    - - - - - - - -
    - Defined in: src/pixi/display/Stage.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    - -
    - - -
    -

    Constructor

    -
    -

    Stage

    - - -
    - (
      - -
    • - - backgroundColor - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - backgroundColor - Number - - - - -
      -

      the background color of the stage, you have to pass this in is in hex format - like: 0xFFFFFF for white

      -

      Creating a stage is a mandatory process when you use Pixi, which is as simple as this : -var stage = new PIXI.Stage(0xFFFFFF); -where the parameter given is the background colour of the stage, in hex -you will use this stage instance to add your sprites to it and therefore to the renderer -Here is how to add a sprite to the stage : -stage.addChild(sprite);

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getMousePosition

    - - - () - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:126 - -

    - - - - - -
    - -
    -

    This will return the point containing global coordinates of the mouse.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point containing the coordinates of the global InteractionData position.

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setBackgroundColor

    - - -
    - (
      - -
    • - - backgroundColor - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:110 - -

    - - - - - -
    - -
    -

    Sets the background color for the stage

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - backgroundColor - Number - - - - -
      -

      the color of the background, easiest way to pass this in is in hex format - like: 0xFFFFFF for white

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setInteractionDelegate

    - - -
    - (
      - -
    • - - domElement - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:73 - -

    - - - - - -
    - -
    -

    Sets another DOM element which can receive mouse/touch interactions instead of the default Canvas element. -This is useful for when you have other DOM elements on top of the Canvas element.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - domElement - DOMElement - - - - -
      -

      This new domElement which will receive mouse/touch events

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:51 - -

    - - - - -
    - -
    -

    Whether the stage is dirty and needs to have interactions updated

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactionManager

    - InteractionManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:43 - -

    - - - - -
    - -
    -

    The interaction manage for this stage, manages all interactive activity on the stage

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Stage.js:35 - -

    - - - - -
    - -
    -

    Whether or not the stage is interactive

    - -
    - - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Stage.js:25 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/Strip.html b/tutorial-2/pixi.js-master/docs/classes/Strip.html deleted file mode 100755 index d93f5d3..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/Strip.html +++ /dev/null @@ -1,5964 +0,0 @@ - - - - - Strip - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Strip Class

    -
    - - - - - - - -
    - Defined in: src/pixi/extras/Strip.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    Strip

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The texture to use

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      the width

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the height

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:341 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    renderStripFlat

    - - -
    - (
      - -
    • - - strip - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:293 - -

    - - - - - -
    - -
    -

    Renders a flat strip

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - strip - Strip - - - - -
      -

      The Strip to render

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:43 - -

    - - - - -
    - -
    -

    Whether the strip is dirty or not

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:52 - -

    - - - - -
    - -
    -

    if you need a padding, not yet implemented

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:20 - -

    - - - - -
    - -
    -

    The texture of the strip

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/StripShader.html b/tutorial-2/pixi.js-master/docs/classes/StripShader.html deleted file mode 100755 index 612ff3b..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/StripShader.html +++ /dev/null @@ -1,839 +0,0 @@ - - - - - StripShader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    StripShader Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    StripShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:111 - -

    - - - - - -
    - -
    -

    Destroys the shader.

    - -
    - - - - - - -
    - - -
    -

    init

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:80 - -

    - - - - - -
    - -
    -

    Initialises the shader.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _UID

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:32 - -

    - - - - -
    - -
    -

    The fragment shader.

    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:19 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    program

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:25 - -

    - - - - -
    - -
    -

    The WebGL program.

    - -
    - - - - - - -
    - - -
    -

    vertexSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:50 - -

    - - - - -
    - -
    -

    The vertex shader.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/Text.html b/tutorial-2/pixi.js-master/docs/classes/Text.html deleted file mode 100755 index 8604a47..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/Text.html +++ /dev/null @@ -1,7290 +0,0 @@ - - - - - Text - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Text Class

    -
    - - - -
    - Extends Sprite -
    - - - -
    - Defined in: src/pixi/text/Text.js:6 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    A Text Object will create a line or multiple lines of text. To split a line you can use '\n' in your text string, -or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object.

    - -
    - - -
    -

    Constructor

    -
    -

    Text

    - - -
    - (
      - -
    • - - text - -
    • - -
    • - - [style] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:6 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - text - String - - - - -
      -

      The copy that you would like the text to display

      - -
      - - -
    • - -
    • - - [style] - Object - optional - - - - -
      -

      The style parameters

      - -
      - - -
        - -
      • - - [font] - String - optional - - -
        -

        default 'bold 20px Arial' The style and size of the font

        - -
        - - -
      • - -
      • - - [fill='black'] - String | Number - optional - - -
        -

        A canvas fillstyle that will be used on the text e.g 'red', '#00FF00'

        - -
        - - -
      • - -
      • - - [align='left'] - String - optional - - -
        -

        Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text

        - -
        - - -
      • - -
      • - - [stroke] - String | Number - optional - - -
        -

        A canvas fillstyle that will be used on the text stroke e.g 'blue', '#FCFF00'

        - -
        - - -
      • - -
      • - - [strokeThickness=0] - Number - optional - - -
        -

        A number that represents the thickness of the stroke. Default is 0 (no stroke)

        - -
        - - -
      • - -
      • - - [wordWrap=false] - Boolean - optional - - -
        -

        Indicates if word wrap should be used

        - -
        - - -
      • - -
      • - - [wordWrapWidth=100] - Number - optional - - -
        -

        The width at which text will wrap, it needs wordWrap to be set to true

        - -
        - - -
      • - -
      • - - [dropShadow=false] - Boolean - optional - - -
        -

        Set a drop shadow for the text

        - -
        - - -
      • - -
      • - - [dropShadowColor='#000000'] - String - optional - - -
        -

        A fill style to be used on the dropshadow e.g 'red', '#00FF00'

        - -
        - - -
      • - -
      • - - [dropShadowAngle=Math.PI/4] - Number - optional - - -
        -

        Set a angle of the drop shadow

        - -
        - - -
      • - -
      • - - [dropShadowDistance=5] - Number - optional - - -
        -

        Set a distance of the drop shadow

        - -
        - - -
      • - -
      - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/text/Text.js:321 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/text/Text.js:301 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    destroy

    - - -
    - (
      - -
    • - - destroyBaseTexture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:510 - -

    - - - - - -
    - -
    -

    Destroys this text object.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - destroyBaseTexture - Boolean - - - - -
      -

      whether to destroy the base texture as well

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    determineFontProperties

    - - -
    - (
      - -
    • - - fontStyle - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:341 - -

    - - - - - -
    - -
    -

    Calculates the ascent, descent and fontSize of a given fontStyle

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - fontStyle - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    ) -
    - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/text/Text.js:492 - -

    - - - - - -
    - -
    -

    Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Matrix - - - - -
      -

      the transformation matrix of the Text

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:147 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStyle

    - - -
    - (
      - -
    • - - [style] - -
    • - -
    • - - [style.font='bold - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:110 - -

    - - - - - -
    - -
    -

    Set the style of the text

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - [style] - Object - optional - - - - -
      -

      The style parameters

      - -
      - - -
        - -
      • - - [fill='black'] - Object - optional - - -
        -

        A canvas fillstyle that will be used on the text eg 'red', '#00FF00'

        - -
        - - -
      • - -
      • - - [align='left'] - String - optional - - -
        -

        Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text

        - -
        - - -
      • - -
      • - - [stroke='black'] - String - optional - - -
        -

        A canvas fillstyle that will be used on the text stroke eg 'blue', '#FCFF00'

        - -
        - - -
      • - -
      • - - [strokeThickness=0] - Number - optional - - -
        -

        A number that represents the thickness of the stroke. Default is 0 (no stroke)

        - -
        - - -
      • - -
      • - - [wordWrap=false] - Boolean - optional - - -
        -

        Indicates if word wrap should be used

        - -
        - - -
      • - -
      • - - [wordWrapWidth=100] - Number - optional - - -
        -

        The width at which text will wrap

        - -
        - - -
      • - -
      • - - [dropShadow=false] - Boolean - optional - - -
        -

        Set a drop shadow for the text

        - -
        - - -
      • - -
      • - - [dropShadowColor='#000000'] - String - optional - - -
        -

        A fill style to be used on the dropshadow e.g 'red', '#00FF00'

        - -
        - - -
      • - -
      • - - [dropShadowAngle=Math.PI/4] - Number - optional - - -
        -

        Set a angle of the drop shadow

        - -
        - - -
      • - -
      • - - [dropShadowDistance=5] - Number - optional - - -
        -

        Set a distance of the drop shadow

        - -
        - - -
      • - -
      - -
    • - -
    • - - [style.font='bold - String - - - - -
      -

      20pt Arial'] The style and size of the font

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setText

    - - -
    - (
      - -
    • - - text - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:147 - -

    - - - - - -
    - -
    -

    Set the copy for the text object. To split a line you can use '\n'.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - text - String - - - - -
      -

      The copy that you would like the text to display

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setTexture

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:135 - -

    - - - - - -
    - -
    -

    Sets the texture of the sprite

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The PIXI texture that is displayed by the sprite

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    -

    updateText

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:159 - -

    - - - - - -
    - -
    -

    Renders text and updates it when needed

    - -
    - - - - - - -
    - - -
    -

    updateTexture

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:281 - -

    - - - - - -
    - -
    -

    Updates texture size based on canvas size

    - -
    - - - - - - -
    - - -
    -

    wordWrap

    - - -
    - (
      - -
    • - - text - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:444 - -

    - - - - - -
    - -
    -

    Applies newlines to a string to have it optimally fit into the horizontal -bounds set by the Text object's wordWrapWidth property.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - text - String - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _height

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:50 - -

    - - - - -
    - -
    -

    The height of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _width

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:41 - -

    - - - - -
    - -
    -

    The width of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    anchor

    - Point - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:22 - -

    - - - - -
    - -
    -

    The anchor sets the origin point of the texture. -The default is 0,0 this means the texture's origin is the top left -Setting than anchor to 0.5,0.5 means the textures origin is centered -Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner

    - -
    - - - - - - -
    - - -
    -

    blendMode

    - Number - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:68 - -

    - - - - -
    - -
    -

    The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.

    - -
    - - -

    Default: PIXI.blendModes.NORMAL;

    - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    canvas

    - HTMLCanvasElement - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:29 - -

    - - - - -
    - -
    -

    The canvas element that everything is drawn to

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    context

    - HTMLCanvasElement - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:37 - -

    - - - - -
    - -
    -

    The canvas 2d context that everything is drawn with

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/text/Text.js:86 - -

    - - - - -
    - -
    -

    The height of the Text, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:44 - -

    - - - - -
    - -
    -

    The resolution of the canvas.

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    shader

    - PIXI.AbstractFilter - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:77 - -

    - - - - -
    - -
    -

    The shader that will be used to render the texture to the stage. Set to null to remove a current shader.

    - -
    - - -

    Default: null

    - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:33 - -

    - - - - -
    - -
    -

    The texture that the sprite is using

    - -
    - - - - - - -
    - - -
    -

    tint

    - Number - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:59 - -

    - - - - -
    - -
    -

    The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.

    - -
    - - -

    Default: 0xFFFFFF

    - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/text/Text.js:62 - -

    - - - - -
    - -
    -

    The width of the Text, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/Texture.html b/tutorial-2/pixi.js-master/docs/classes/Texture.html deleted file mode 100755 index c797d9a..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/Texture.html +++ /dev/null @@ -1,2786 +0,0 @@ - - - - - Texture - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Texture Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A texture stores the information that represents an image or part of an image. It cannot be added -to the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used.

    - -
    - - -
    -

    Constructor

    -
    -

    Texture

    - - -
    - (
      - -
    • - - baseTexture - -
    • - -
    • - - frame - -
    • - -
    • - - [crop] - -
    • - -
    • - - [trim] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:10 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - baseTexture - BaseTexture - - - - -
      -

      The base texture source to create the texture from

      - -
      - - -
    • - -
    • - - frame - Rectangle - - - - -
      -

      The rectangle frame of the texture to show

      - -
      - - -
    • - -
    • - - [crop] - Rectangle - optional - - - - -
      -

      The area of original texture

      - -
      - - -
    • - -
    • - - [trim] - Rectangle - optional - - - - -
      -

      Trimmed texture rectangle

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _updateUvs

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:200 - -

    - - - - - -
    - -
    -

    Updates the internal WebGL UV cache.

    - -
    - - - - - - -
    - - -
    -

    addTextureToCache

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - id - -
    • - -
    ) -
    - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:284 - -

    - - - - - -
    - -
    -

    Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The Texture to add to the cache.

      - -
      - - -
    • - -
    • - - id - String - - - - -
      -

      The id that the texture will be stored against.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    destroy

    - - -
    - (
      - -
    • - - destroyBase - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:149 - -

    - - - - - -
    - -
    -

    Destroys this texture

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - destroyBase - Boolean - - - - -
      -

      Whether to destroy the base texture as well

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    fromCanvas

    - - -
    - (
      - -
    • - - canvas - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:267 - -

    - - - - - -
    - -
    -

    Helper function that creates a new a Texture based on the given canvas element.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - canvas - Canvas - - - - -
      -

      The canvas element source of the texture

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - -

    Texture

    - - -
    -
    - - - -
    - - -
    -

    fromFrame

    - - -
    - (
      - -
    • - - frameId - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:251 - -

    - - - - - -
    - -
    -

    Helper function that returns a Texture objected based on the given frame id. -If the frame id is not in the texture cache an error will be thrown.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frameId - String - - - - -
      -

      The frame id of the texture

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - -

    Texture

    - - -
    -
    - - - -
    - - -
    -

    fromImage

    - - -
    - (
      - -
    • - - imageUrl - -
    • - -
    • - - crossorigin - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:227 - -

    - - - - - -
    - -
    -

    Helper function that creates a Texture object from the given image url. -If the image is not in the texture cache it will be created and loaded.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - imageUrl - String - - - - -
      -

      The image url of the texture

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - -

    Texture

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onBaseTextureLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:131 - -

    - - - - - -
    - -
    -

    Called when the base texture is loaded

    - -
    - - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeTextureFromCache

    - - -
    - (
      - -
    • - - id - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:297 - -

    - - - - - -
    - -
    -

    Remove a texture from the global PIXI.TextureCache.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - id - String - - - - -
      -

      The id of the texture to be removed

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    The texture that was removed

    - - -
    -
    - - - -
    - - -
    -

    setFrame

    - - -
    - (
      - -
    • - - frame - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:162 - -

    - - - - - -
    - -
    -

    Specifies the region of the baseTexture that this texture will use.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frame - Rectangle - - - - -
      -

      The frame of the texture to set it to

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _uvs

    - Object - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:83 - -

    - - - - -
    - -
    -

    The WebGL UV data cache.

    - -
    - - - - - - -
    - - -
    -

    baseTexture

    - BaseTexture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:43 - -

    - - - - -
    - -
    -

    The base texture that this texture uses.

    - -
    - - - - - - -
    - - -
    -

    crop

    - Rectangle - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:108 - -

    - - - - -
    - -
    -

    This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, -irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)

    - -
    - - - - - - -
    - - -
    -

    frame

    - Rectangle - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:51 - -

    - - - - -
    - -
    -

    The frame specifies the region of the base texture that this texture uses

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:100 - -

    - - - - -
    - -
    -

    The height of the Texture in pixels.

    - -
    - - - - - - -
    - - -
    -

    noFrame

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:24 - -

    - - - - -
    - -
    -

    Does this Texture have any frame data assigned to it?

    - -
    - - - - - - -
    - - -
    -

    requiresUpdate

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:75 - -

    - - - - -
    - -
    -

    This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)

    - -
    - - - - - - -
    - - -
    -

    trim

    - Rectangle - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:59 - -

    - - - - -
    - -
    -

    The texture trim data.

    - -
    - - - - - - -
    - - -
    -

    valid

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:67 - -

    - - - - -
    - -
    -

    This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:92 - -

    - - - - -
    - -
    -

    The width of the Texture in pixels.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/TilingSprite.html b/tutorial-2/pixi.js-master/docs/classes/TilingSprite.html deleted file mode 100755 index 00426d9..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/TilingSprite.html +++ /dev/null @@ -1,6532 +0,0 @@ - - - - - TilingSprite - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    TilingSprite Class

    -
    - - - -
    - Extends Sprite -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A tiling sprite is a fast way of rendering a tiling image

    - -
    - - -
    -

    Constructor

    -
    -

    TilingSprite

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      the texture of the tiling sprite

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      the width of the tiling sprite

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the height of the tiling sprite

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:194 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:137 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    generateTilingTexture

    - - -
    - (
      - -
    • - - forcePowerOfTwo - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:373 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - forcePowerOfTwo - Boolean - - - - -
      -

      Whether we want to force the texture to be a power of two

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:280 - -

    - - - - - -
    - -
    -

    Returns the framing rectangle of the sprite as a PIXI.Rectangle object

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - Sprite - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:360 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setTexture

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:135 - -

    - - - - - -
    - -
    -

    Sets the texture of the sprite

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The PIXI texture that is displayed by the sprite

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _height

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:50 - -

    - - - - -
    - -
    -

    The height of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _width

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:41 - -

    - - - - -
    - -
    -

    The width of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    anchor

    - Point - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:22 - -

    - - - - -
    - -
    -

    The anchor sets the origin point of the texture. -The default is 0,0 this means the texture's origin is the top left -Setting than anchor to 0.5,0.5 means the textures origin is centered -Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner

    - -
    - - - - - - -
    - - -
    -

    blendMode

    - Number - - - - - - - - - -
    - -

    Inherited from - - Sprite - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:77 - -

    - - - - -
    - -
    -

    The blend mode to be applied to the sprite

    - -
    - - -

    Default: PIXI.blendModes.NORMAL;

    - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:111 - -

    - - - - -
    - -
    -

    The height of the TilingSprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:27 - -

    - - - - -
    - -
    -

    The height of the tiling sprite

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:59 - -

    - - - - -
    - -
    -

    Whether this sprite is renderable or not

    - -
    - - -

    Default: true

    - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    shader

    - PIXI.AbstractFilter - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:77 - -

    - - - - -
    - -
    -

    The shader that will be used to render the texture to the stage. Set to null to remove a current shader.

    - -
    - - -

    Default: null

    - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:33 - -

    - - - - -
    - -
    -

    The texture that the sprite is using

    - -
    - - - - - - -
    - - -
    -

    tilePosition

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:51 - -

    - - - - -
    - -
    -

    The offset position of the image that is being tiled

    - -
    - - - - - - -
    - - -
    -

    tileScale

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:35 - -

    - - - - -
    - -
    -

    The scaling of the image that is being tiled

    - -
    - - - - - - -
    - - -
    -

    tileScaleOffset

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:43 - -

    - - - - -
    - -
    -

    A point that represents the scale of the texture object

    - -
    - - - - - - -
    - - -
    -

    tint

    - Number - - - - - - - - - -
    - -

    Inherited from - - Sprite - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:68 - -

    - - - - -
    - -
    -

    The tint applied to the sprite. This is a hex value

    - -
    - - -

    Default: 0xFFFFFF

    - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:19 - -

    - - - - -
    - -
    -

    The with of the tiling sprite

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:95 - -

    - - - - -
    - -
    -

    The width of the sprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/TiltShiftFilter.html b/tutorial-2/pixi.js-master/docs/classes/TiltShiftFilter.html deleted file mode 100755 index f8c853f..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/TiltShiftFilter.html +++ /dev/null @@ -1,614 +0,0 @@ - - - - - TiltShiftFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    TiltShiftFilter Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A TiltShift Filter. Manages the pass of both a TiltShiftXFilter and TiltShiftYFilter.

    - -
    - - -
    -

    Constructor

    -
    -

    TiltShiftFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - - - -
    -

    Properties

    - - -
    - - - - - -
    - - - - -
    -

    Properties

    - - -
    -

    blur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftFilter.js:24 - -

    - - - - -
    - -
    -

    The strength of the blur.

    - -
    - - - - - - -
    - - -
    -

    end

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftFilter.js:69 - -

    - - - - -
    - -
    -

    The Y value to end the effect at.

    - -
    - - - - - - -
    - - -
    -

    gradientBlur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftFilter.js:39 - -

    - - - - -
    - -
    -

    The strength of the gradient blur.

    - -
    - - - - - - -
    - - -
    -

    start

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftFilter.js:54 - -

    - - - - -
    - -
    -

    The Y value to start the effect at.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/TiltShiftXFilter.html b/tutorial-2/pixi.js-master/docs/classes/TiltShiftXFilter.html deleted file mode 100755 index 56c306a..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/TiltShiftXFilter.html +++ /dev/null @@ -1,1053 +0,0 @@ - - - - - TiltShiftXFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    TiltShiftXFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A TiltShiftXFilter.

    - -
    - - -
    -

    Constructor

    -
    -

    TiltShiftXFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    -

    updateDelta

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:138 - -

    - - - - - -
    - -
    -

    Updates the filter delta values.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:72 - -

    - - - - -
    - -
    -

    The strength of the blur.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    end

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:121 - -

    - - - - -
    - -
    -

    The X value to end the effect at.

    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    gradientBlur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:88 - -

    - - - - -
    - -
    -

    The strength of the gradient blur.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    start

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:104 - -

    - - - - -
    - -
    -

    The X value to start the effect at.

    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/TiltShiftYFilter.html b/tutorial-2/pixi.js-master/docs/classes/TiltShiftYFilter.html deleted file mode 100755 index cd66a7f..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/TiltShiftYFilter.html +++ /dev/null @@ -1,1053 +0,0 @@ - - - - - TiltShiftYFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    TiltShiftYFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A TiltShiftYFilter.

    - -
    - - -
    -

    Constructor

    -
    -

    TiltShiftYFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    -

    updateDelta

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:138 - -

    - - - - - -
    - -
    -

    Updates the filter delta values.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:72 - -

    - - - - -
    - -
    -

    The strength of the blur.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    end

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:121 - -

    - - - - -
    - -
    -

    The Y value to end the effect at.

    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    gradientBlur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:88 - -

    - - - - -
    - -
    -

    The strength of the gradient blur.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    start

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:104 - -

    - - - - -
    - -
    -

    The Y value to start the effect at.

    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/TwistFilter.html b/tutorial-2/pixi.js-master/docs/classes/TwistFilter.html deleted file mode 100755 index 482d5a9..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/TwistFilter.html +++ /dev/null @@ -1,939 +0,0 @@ - - - - - TwistFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    TwistFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This filter applies a twist effect making display objects appear twisted in the given direction.

    - -
    - - -
    -

    Constructor

    -
    -

    TwistFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TwistFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    angle

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TwistFilter.js:88 - -

    - - - - -
    - -
    -

    This angle of the twist.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    offset

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TwistFilter.js:56 - -

    - - - - -
    - -
    -

    This point describes the the offset of the twist.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    radius

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TwistFilter.js:72 - -

    - - - - -
    - -
    -

    This radius of the twist.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/WebGLBlendModeManager.html b/tutorial-2/pixi.js-master/docs/classes/WebGLBlendModeManager.html deleted file mode 100755 index f69e5db..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/WebGLBlendModeManager.html +++ /dev/null @@ -1,760 +0,0 @@ - - - - - WebGLBlendModeManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLBlendModeManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLBlendModeManager

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:50 - -

    - - - - - -
    - -
    -

    Destroys this object.

    - -
    - - - - - - -
    - - -
    -

    setBlendMode

    - - -
    - (
      - -
    • - - blendMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:32 - -

    - - - - - -
    - -
    -

    Sets-up the given blendMode from WebGL's point of view.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - blendMode - Number - - - - -
      -

      the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:21 - -

    - - - - - -
    - -
    -

    Sets the WebGL Context.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    currentBlendMode

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/WebGLFastSpriteBatch.html b/tutorial-2/pixi.js-master/docs/classes/WebGLFastSpriteBatch.html deleted file mode 100755 index fcc1a27..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/WebGLFastSpriteBatch.html +++ /dev/null @@ -1,1831 +0,0 @@ - - - - - WebGLFastSpriteBatch - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLFastSpriteBatch Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLFastSpriteBatch

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:11 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    begin

    - - -
    - (
      - -
    • - - spriteBatch - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:154 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - spriteBatch - WebGLSpriteBatch - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    end

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:169 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    flush

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:349 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    render

    - - -
    - (
      - -
    • - - spriteBatch - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:177 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    renderSprite

    - - -
    - (
      - -
    • - - sprite - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:208 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - sprite - Sprite - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:130 - -

    - - - - - -
    - -
    -

    Sets the WebGL Context.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    start

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:397 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    stop

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:389 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    currentBaseTexture

    - BaseTexture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:95 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    currentBatchSize

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:89 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    currentBlendMode

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:101 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    drawing

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:83 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    indexBuffer

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:61 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    indices

    - Uint16Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:48 - -

    - - - - -
    - -
    -

    Index data

    - -
    - - - - - - -
    - - -
    -

    lastIndexCount

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:67 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    matrix

    - Matrix - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:119 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    maxSize

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:23 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    renderSession

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:107 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    shader

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:113 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    size

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:29 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    vertexBuffer

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:55 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    vertices

    - Float32Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:41 - -

    - - - - -
    - -
    -

    Vertex data

    - -
    - - - - - - -
    - - -
    -

    vertSize

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:17 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/WebGLFilterManager.html b/tutorial-2/pixi.js-master/docs/classes/WebGLFilterManager.html deleted file mode 100755 index 004f51f..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/WebGLFilterManager.html +++ /dev/null @@ -1,1229 +0,0 @@ - - - - - WebGLFilterManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLFilterManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLFilterManager

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    applyFilterPass

    - - -
    - (
      - -
    • - - filter - -
    • - -
    • - - filterArea - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:315 - -

    - - - - - -
    - -
    -

    Applies the filter to the specified area.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - filter - AbstractFilter - - - - -
      -

      the filter that needs to be applied

      - -
      - - -
    • - -
    • - - filterArea - Texture - - - - -
      -

      TODO - might need an update

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      the horizontal range of the filter

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the vertical range of the filter

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    begin

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    • - - buffer - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:46 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    • - - buffer - ArrayBuffer - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:424 - -

    - - - - - -
    - -
    -

    Destroys the filter and removes it from the filter stack.

    - -
    - - - - - - -
    - - -
    -

    initShaderBuffers

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:376 - -

    - - - - - -
    - -
    -

    Initialises the shader buffers.

    - -
    - - - - - - -
    - - -
    -

    popFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:138 - -

    - - - - - -
    - -
    -

    Removes the last filter from the filter stack and doesn't return it.

    - -
    - - - - - - -
    - - -
    -

    pushFilter

    - - -
    - (
      - -
    • - - filterBlock - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:62 - -

    - - - - - -
    - -
    -

    Applies the filter and adds it to the current filter stack.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - filterBlock - Object - - - - -
      -

      the filter that will be pushed to the current filter stack

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:32 - -

    - - - - - -
    - -
    -

    Initialises the context and the properties.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    filterStack

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:11 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    offsetX

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:17 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    offsetY

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:23 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/WebGLGraphics.html b/tutorial-2/pixi.js-master/docs/classes/WebGLGraphics.html deleted file mode 100755 index f33138b..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/WebGLGraphics.html +++ /dev/null @@ -1,1683 +0,0 @@ - - - - - WebGLGraphics - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLGraphics Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A set of functions used by the webGL renderer to draw the primitive graphics data

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    buildCircle

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:421 - -

    - - - - - -
    - -
    -

    Builds a circle to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object to draw

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    buildComplexPoly

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:716 - -

    - - - - - -
    - -
    -

    Builds a complex polygon to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object containing all the necessary properties

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    buildLine

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:504 - -

    - - - - - -
    - -
    -

    Builds a line to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object containing all the necessary properties

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    buildPoly

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:778 - -

    - - - - - -
    - -
    -

    Builds a polygon to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object containing all the necessary properties

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    buildRectangle

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:233 - -

    - - - - - -
    - -
    -

    Builds a rectangle to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object containing all the necessary properties

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    buildRoundedRectangle

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:301 - -

    - - - - - -
    - -
    -

    Builds a rounded rectangle to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object containing all the necessary properties

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    quadraticBezierCurve

    - - -
    - (
      - -
    • - - fromX - -
    • - -
    • - - fromY - -
    • - -
    • - - cpX - -
    • - -
    • - - cpY - -
    • - -
    • - - toX - -
    • - -
    • - - toY - -
    • - -
    ) -
    - - - - - Array - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:369 - -

    - - - - - -
    - -
    -

    Calculate the points for a quadratic bezier curve. (helper function..) -Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - fromX - Number - - - - -
      -

      Origin point x

      - -
      - - -
    • - -
    • - - fromY - Number - - - - -
      -

      Origin point x

      - -
      - - -
    • - -
    • - - cpX - Number - - - - -
      -

      Control point x

      - -
      - - -
    • - -
    • - - cpY - Number - - - - -
      -

      Control point y

      - -
      - - -
    • - -
    • - - toX - Number - - - - -
      -

      Destination point x

      - -
      - - -
    • - -
    • - - toY - Number - - - - -
      -

      Destination point y

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - - -
    -
    - - - -
    - - -
    -

    renderGraphics

    - - -
    - (
      - -
    • - - graphics - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:16 - -

    - - - - - -
    - -
    -

    Renders the graphics object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphics - Graphics - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    switchMode

    - - -
    - (
      - -
    • - - webGL - -
    • - -
    • - - type - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:199 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - webGL - WebGLContext - - - - -
      - -
      - - -
    • - -
    • - - type - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    updateGraphics

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:84 - -

    - - - - - -
    - -
    -

    Updates the graphics object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object to update

      - -
      - - -
    • - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/WebGLGraphicsData.html b/tutorial-2/pixi.js-master/docs/classes/WebGLGraphicsData.html deleted file mode 100755 index d099949..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/WebGLGraphicsData.html +++ /dev/null @@ -1,470 +0,0 @@ - - - - - WebGLGraphicsData - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLGraphicsData Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    reset

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:850 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    upload

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:860 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/WebGLMaskManager.html b/tutorial-2/pixi.js-master/docs/classes/WebGLMaskManager.html deleted file mode 100755 index 0642f8b..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/WebGLMaskManager.html +++ /dev/null @@ -1,798 +0,0 @@ - - - - - WebGLMaskManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLMaskManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLMaskManager

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js:61 - -

    - - - - - -
    - -
    -

    Destroys the mask stack.

    - -
    - - - - - - -
    - - -
    -

    popMask

    - - -
    - (
      - -
    • - - maskData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js:48 - -

    - - - - - -
    - -
    -

    Removes the last filter from the filter stack and doesn't return it.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - maskData - Array - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      -

      an object containing all the useful parameters

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    pushMask

    - - -
    - (
      - -
    • - - maskData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js:27 - -

    - - - - - -
    - -
    -

    Applies the Mask and adds it to the current filter stack.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - maskData - Array - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js:16 - -

    - - - - - -
    - -
    -

    Sets the drawing context to the one given in parameter.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/WebGLRenderer.html b/tutorial-2/pixi.js-master/docs/classes/WebGLRenderer.html deleted file mode 100755 index 15691a5..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/WebGLRenderer.html +++ /dev/null @@ -1,2526 +0,0 @@ - - - - - WebGLRenderer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLRenderer Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer -should be used for browsers that support webGL. This Render works by automatically managing webGLBatchs. -So no need for Sprite Batches or Sprite Clouds. -Don't forget to add the view to your DOM or you will not see anything :)

    - -
    - - -
    -

    Constructor

    -
    -

    WebGLRenderer

    - - -
    - (
      - -
    • - - [width=0] - -
    • - -
    • - - [height=0] - -
    • - -
    • - - [options] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:8 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - [width=0] - Number - optional - - - - -
      -

      the width of the canvas view

      - -
      - - -
    • - -
    • - - [height=0] - Number - optional - - - - -
      -

      the height of the canvas view

      - -
      - - -
    • - -
    • - - [options] - Object - optional - - - - -
      -

      The optional renderer parameters

      - -
      - - -
        - -
      • - - [view] - HTMLCanvasElement - optional - - -
        -

        the canvas to use as a view, optional

        - -
        - - -
      • - -
      • - - [transparent=false] - Boolean - optional - - -
        -

        If the render view is transparent, default false

        - -
        - - -
      • - -
      • - - [autoResize=false] - Boolean - optional - - -
        -

        If the render view is automatically resized, default false

        - -
        - - -
      • - -
      • - - [antialias=false] - Boolean - optional - - -
        -

        sets antialias (only applicable in chrome at the moment)

        - -
        - - -
      • - -
      • - - [preserveDrawingBuffer=false] - Boolean - optional - - -
        -

        enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context

        - -
        - - -
      • - -
      • - - [resolution=1] - Number - optional - - -
        -

        the resolution of the renderer retina would be 2

        - -
        - - -
      • - -
      - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:477 - -

    - - - - - -
    - -
    -

    Removes everything from the renderer (event listeners, spritebatch, etc...)

    - -
    - - - - - - -
    - - -
    -

    handleContextLost

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:443 - -

    - - - - - -
    - -
    -

    Handles a lost webgl context

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    handleContextRestored

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:456 - -

    - - - - - -
    - -
    -

    Handles a restored webgl context

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    initContext

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:238 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    mapBlendModes

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:508 - -

    - - - - - -
    - -
    -

    Maps Pixi blend modes to WebGL blend modes.

    - -
    - - - - - - -
    - - -
    -

    render

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:276 - -

    - - - - - -
    - -
    -

    Renders the stage to its webGL view

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the Stage element to be rendered

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderDisplayObject

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - projection - -
    • - -
    • - - buffer - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:344 - -

    - - - - - -
    - -
    -

    Renders a Display Object.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      The DisplayObject to render

      - -
      - - -
    • - -
    • - - projection - Point - - - - -
      -

      The projection

      - -
      - - -
    • - -
    • - - buffer - Array - - - - -
      -

      a standard WebGL buffer

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    resize

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:378 - -

    - - - - - -
    - -
    -

    Resizes the webGL view to the specified width and height.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      the new width of the webGL view

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the new height of the webGL view

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    updateTexture

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:404 - -

    - - - - - -
    - -
    -

    Updates and Creates a WebGL texture for the renderers context.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      the texture to update

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _contextOptions

    - Object - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:142 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    autoResize

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:71 - -

    - - - - -
    - -
    -

    Whether the render view should be resized automatically

    - -
    - - - - - - -
    - - -
    -

    blendModeManager

    - WebGLBlendModeManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:204 - -

    - - - - -
    - -
    -

    Manages the blendModes

    - -
    - - - - - - -
    - - -
    -

    clearBeforeRender

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:87 - -

    - - - - -
    - -
    -

    This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true: -If the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0). -If the Stage is transparent, Pixi will clear to the target Stage's background color. -Disable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set.

    - -
    - - - - - - -
    - - -
    -

    contextLostBound

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:127 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    contextRestoredBound

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:133 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    filterManager

    - WebGLFilterManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:190 - -

    - - - - -
    - -
    -

    Manages the filters

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:108 - -

    - - - - -
    - -
    -

    The height of the canvas view

    - -
    - - -

    Default: 600

    - - - - - -
    - - -
    -

    maskManager

    - WebGLMaskManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:183 - -

    - - - - -
    - -
    -

    Manages the masks using the stencil buffer

    - -
    - - - - - - -
    - - -
    -

    offset

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:161 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    preserveDrawingBuffer

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:79 - -

    - - - - -
    - -
    -

    The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering.

    - -
    - - - - - - -
    - - -
    -

    projection

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:155 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    renderSession

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:211 - -

    - - - - -
    - -
    -

    TODO remove

    - -
    - - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:52 - -

    - - - - -
    - -
    -

    The resolution of the renderer

    - -
    - - -

    Default: 1

    - - - - - -
    - - -
    -

    shaderManager

    - WebGLShaderManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:169 - -

    - - - - -
    - -
    -

    Deals with managing the shader programs and their attribs

    - -
    - - - - - - -
    - - -
    -

    spriteBatch

    - WebGLSpriteBatch - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:176 - -

    - - - - -
    - -
    -

    Manages the rendering of sprites

    - -
    - - - - - - -
    - - -
    -

    stencilManager

    - WebGLStencilManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:197 - -

    - - - - -
    - -
    -

    Manages the stencil buffer

    - -
    - - - - - - -
    - - -
    -

    transparent

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:63 - -

    - - - - -
    - -
    -

    Whether the render view is transparent

    - -
    - - - - - - -
    - - -
    -

    type

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:46 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    view

    - HTMLCanvasElement - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:117 - -

    - - - - -
    - -
    -

    The canvas element that everything is drawn to

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:99 - -

    - - - - -
    - -
    -

    The width of the canvas view

    - -
    - - -

    Default: 800

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/WebGLShaderManager.html b/tutorial-2/pixi.js-master/docs/classes/WebGLShaderManager.html deleted file mode 100755 index 376b9d7..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/WebGLShaderManager.html +++ /dev/null @@ -1,976 +0,0 @@ - - - - - WebGLShaderManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLShaderManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLShaderManager

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:135 - -

    - - - - - -
    - -
    -

    Destroys this object.

    - -
    - - - - - - -
    - - -
    -

    setAttribs

    - - -
    - (
      - -
    • - - attribs - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:72 - -

    - - - - - -
    - -
    -

    Takes the attributes given in parameters.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - attribs - Array - - - - -
      -

      attribs

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:45 - -

    - - - - - -
    - -
    -

    Initialises the context and the properties.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setShader

    - - -
    - (
      - -
    • - - shader - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:115 - -

    - - - - - -
    - -
    -

    Sets the current shader.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - shader - Any - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    attribState

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:18 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    maxAttibs

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    stack

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:35 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    tempAttribState

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/WebGLSpriteBatch.html b/tutorial-2/pixi.js-master/docs/classes/WebGLSpriteBatch.html deleted file mode 100755 index b4101f2..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/WebGLSpriteBatch.html +++ /dev/null @@ -1,2619 +0,0 @@ - - - - - WebGLSpriteBatch - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLSpriteBatch Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLSpriteBatch

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:11 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _CompileShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    • - - shaderSrc - -
    • - -
    • - - shaderType - -
    • - -
    ) -
    - - - - - Any - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:38 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    • - - shaderSrc - Array - - - - -
      - -
      - - -
    • - -
    • - - shaderType - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Any: - - -
    -
    - - - -
    - - -
    -

    begin

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:164 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The RenderSession object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    CompileFragmentShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    • - - shaderSrc - -
    • - -
    ) -
    - - - - - Any - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:26 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    • - - shaderSrc - Array - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Any: - - -
    -
    - - - -
    - - -
    -

    compileProgram

    - - -
    - (
      - -
    • - - gl - -
    • - -
    • - - vertexSrc - -
    • - -
    • - - fragmentSrc - -
    • - -
    ) -
    - - - - - Any - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:63 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    • - - vertexSrc - Array - - - - -
      - -
      - - -
    • - -
    • - - fragmentSrc - Array - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Any: - - -
    -
    - - - -
    - - -
    -

    CompileVertexShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    • - - shaderSrc - -
    • - -
    ) -
    - - - - - Any - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:14 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    • - - shaderSrc - Array - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Any: - - -
    -
    - - - -
    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:589 - -

    - - - - - -
    - -
    -

    Destroys the SpriteBatch.

    - -
    - - - - - - -
    - - -
    -

    end

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:176 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    flush

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:418 - -

    - - - - - -
    - -
    -

    Renders the content and empties the current batch.

    - -
    - - - - - - -
    - - -
    -

    initDefaultShaders

    - - - () - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    render

    - - -
    - (
      - -
    • - - sprite - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:184 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - sprite - Sprite - - - - -
      -

      the sprite to render when using this spritebatch

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderBatch

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - size - -
    • - -
    • - - startIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:542 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      - -
      - - -
    • - -
    • - - size - Number - - - - -
      - -
      - - -
    • - -
    • - - startIndex - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderTilingSprite

    - - -
    - (
      - -
    • - - sprite - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:297 - -

    - - - - - -
    - -
    -

    Renders a TilingSprite using the spriteBatch.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - sprite - TilingSprite - - - - -
      -

      the tilingSprite to render

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:132 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    start

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:581 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    stop

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:572 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blendModes

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:99 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    currentBaseTexture

    - BaseTexture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:81 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    currentBatchSize

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:75 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    defaultShader

    - AbstractFilter - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:117 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:87 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    drawing

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:69 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    indices

    - Uint16Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:45 - -

    - - - - -
    - -
    -

    Holds the indices

    - -
    - - - - - - -
    - - -
    -

    lastIndexCount

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:53 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:105 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    size

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:25 - -

    - - - - -
    - -
    -

    The number of images in the SpriteBatch before it flushes

    - -
    - - - - - - -
    - - -
    -

    sprites

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:111 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    textures

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:93 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    vertices

    - Float32Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:37 - -

    - - - - -
    - -
    -

    Holds the vertices

    - -
    - - - - - - -
    - - -
    -

    vertSize

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:19 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/WebGLStencilManager.html b/tutorial-2/pixi.js-master/docs/classes/WebGLStencilManager.html deleted file mode 100755 index 2dac12b..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/WebGLStencilManager.html +++ /dev/null @@ -1,975 +0,0 @@ - - - - - WebGLStencilManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLStencilManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLStencilManager

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    bindGraphics

    - - -
    - (
      - -
    • - - graphics - -
    • - -
    • - - webGLData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:120 - -

    - - - - - -
    - -
    -

    TODO this does not belong here!

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphics - Graphics - - - - -
      - -
      - - -
    • - -
    • - - webGLData - Array - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:285 - -

    - - - - - -
    - -
    -

    Destroys the mask stack.

    - -
    - - - - - - -
    - - -
    -

    popStencil

    - - -
    - (
      - -
    • - - graphics - -
    • - -
    • - - webGLData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:190 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphics - Graphics - - - - -
      - -
      - - -
    • - -
    • - - webGLData - Array - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    pushMask

    - - -
    - (
      - -
    • - - graphics - -
    • - -
    • - - webGLData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:28 - -

    - - - - - -
    - -
    -

    Applies the Mask and adds it to the current filter stack.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphics - Graphics - - - - -
      - -
      - - -
    • - -
    • - - webGLData - Array - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:17 - -

    - - - - - -
    - -
    -

    Sets the drawing context to the one given in parameter.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/autoDetectRecommendedRenderer.html b/tutorial-2/pixi.js-master/docs/classes/autoDetectRecommendedRenderer.html deleted file mode 100755 index c222af0..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/autoDetectRecommendedRenderer.html +++ /dev/null @@ -1,336 +0,0 @@ - - - - - autoDetectRecommendedRenderer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    autoDetectRecommendedRenderer Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This helper function will automatically detect which renderer you should be using. -This function is very similar to the autoDetectRenderer function except that is will return a canvas renderer for android. -Even thought both android chrome supports webGL the canvas implementation perform better at the time of writing. -This function will likely change and update as webGL performance improves on these devices.

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - - - - - - - -
    - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/autoDetectRenderer.html b/tutorial-2/pixi.js-master/docs/classes/autoDetectRenderer.html deleted file mode 100755 index bbf799f..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/autoDetectRenderer.html +++ /dev/null @@ -1,335 +0,0 @@ - - - - - autoDetectRenderer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    autoDetectRenderer Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This helper function will automatically detect which renderer you should be using. -WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by -the browser then this function will return a canvas renderer

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - - - - - - - -
    - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/classes/index.html b/tutorial-2/pixi.js-master/docs/classes/index.html deleted file mode 100755 index 487fe15..0000000 --- a/tutorial-2/pixi.js-master/docs/classes/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Redirector - - - - Click here to redirect - - diff --git a/tutorial-2/pixi.js-master/docs/data.json b/tutorial-2/pixi.js-master/docs/data.json deleted file mode 100755 index e0b8298..0000000 --- a/tutorial-2/pixi.js-master/docs/data.json +++ /dev/null @@ -1,12399 +0,0 @@ -{ - "project": { - "name": "pixi.js", - "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", - "version": "2.1.0", - "url": "http://goodboydigital.com/", - "logo": "http://www.goodboydigital.com/pixijs/logo_small.png" - }, - "files": { - "src/pixi/display/DisplayObject.js": { - "name": "src/pixi/display/DisplayObject.js", - "modules": {}, - "classes": { - "DisplayObject": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/display/DisplayObjectContainer.js": { - "name": "src/pixi/display/DisplayObjectContainer.js", - "modules": {}, - "classes": { - "DisplayObjectContainer": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/display/MovieClip.js": { - "name": "src/pixi/display/MovieClip.js", - "modules": {}, - "classes": { - "MovieClip": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/display/Sprite.js": { - "name": "src/pixi/display/Sprite.js", - "modules": {}, - "classes": { - "Sprite": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/display/SpriteBatch.js": { - "name": "src/pixi/display/SpriteBatch.js", - "modules": {}, - "classes": { - "SpriteBatch": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/display/Stage.js": { - "name": "src/pixi/display/Stage.js", - "modules": {}, - "classes": { - "Stage": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/extras/Rope.js": { - "name": "src/pixi/extras/Rope.js", - "modules": {}, - "classes": { - "Rope": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/extras/Spine.js": { - "name": "src/pixi/extras/Spine.js", - "modules": {}, - "classes": { - "Spine": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/extras/Strip.js": { - "name": "src/pixi/extras/Strip.js", - "modules": {}, - "classes": { - "Strip": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/extras/TilingSprite.js": { - "name": "src/pixi/extras/TilingSprite.js", - "modules": {}, - "classes": { - "TilingSprite": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/AbstractFilter.js": { - "name": "src/pixi/filters/AbstractFilter.js", - "modules": {}, - "classes": { - "AbstractFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/AlphaMaskFilter.js": { - "name": "src/pixi/filters/AlphaMaskFilter.js", - "modules": {}, - "classes": { - "AlphaMaskFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/AsciiFilter.js": { - "name": "src/pixi/filters/AsciiFilter.js", - "modules": {}, - "classes": { - "AsciiFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/BlurFilter.js": { - "name": "src/pixi/filters/BlurFilter.js", - "modules": {}, - "classes": { - "BlurFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/BlurXFilter.js": { - "name": "src/pixi/filters/BlurXFilter.js", - "modules": {}, - "classes": { - "BlurXFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/BlurYFilter.js": { - "name": "src/pixi/filters/BlurYFilter.js", - "modules": {}, - "classes": { - "BlurYFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/ColorMatrixFilter.js": { - "name": "src/pixi/filters/ColorMatrixFilter.js", - "modules": {}, - "classes": { - "ColorMatrixFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/ColorStepFilter.js": { - "name": "src/pixi/filters/ColorStepFilter.js", - "modules": {}, - "classes": { - "ColorStepFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/ConvolutionFilter.js": { - "name": "src/pixi/filters/ConvolutionFilter.js", - "modules": {}, - "classes": { - "ConvolutionFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/CrossHatchFilter.js": { - "name": "src/pixi/filters/CrossHatchFilter.js", - "modules": {}, - "classes": { - "CrossHatchFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/DisplacementFilter.js": { - "name": "src/pixi/filters/DisplacementFilter.js", - "modules": {}, - "classes": { - "DisplacementFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/DotScreenFilter.js": { - "name": "src/pixi/filters/DotScreenFilter.js", - "modules": {}, - "classes": { - "DotScreenFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/FilterBlock.js": { - "name": "src/pixi/filters/FilterBlock.js", - "modules": {}, - "classes": { - "FilterBlock": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/GrayFilter.js": { - "name": "src/pixi/filters/GrayFilter.js", - "modules": {}, - "classes": { - "GrayFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/InvertFilter.js": { - "name": "src/pixi/filters/InvertFilter.js", - "modules": {}, - "classes": { - "InvertFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/NoiseFilter.js": { - "name": "src/pixi/filters/NoiseFilter.js", - "modules": {}, - "classes": { - "NoiseFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/NormalMapFilter.js": { - "name": "src/pixi/filters/NormalMapFilter.js", - "modules": {}, - "classes": { - "NormalMapFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/PixelateFilter.js": { - "name": "src/pixi/filters/PixelateFilter.js", - "modules": {}, - "classes": { - "PixelateFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/RGBSplitFilter.js": { - "name": "src/pixi/filters/RGBSplitFilter.js", - "modules": {}, - "classes": { - "RGBSplitFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/SepiaFilter.js": { - "name": "src/pixi/filters/SepiaFilter.js", - "modules": {}, - "classes": { - "SepiaFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/SmartBlurFilter.js": { - "name": "src/pixi/filters/SmartBlurFilter.js", - "modules": {}, - "classes": { - "SmartBlurFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/TiltShiftFilter.js": { - "name": "src/pixi/filters/TiltShiftFilter.js", - "modules": {}, - "classes": { - "TiltShiftFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/TiltShiftXFilter.js": { - "name": "src/pixi/filters/TiltShiftXFilter.js", - "modules": {}, - "classes": { - "TiltShiftXFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/TiltShiftYFilter.js": { - "name": "src/pixi/filters/TiltShiftYFilter.js", - "modules": {}, - "classes": { - "TiltShiftYFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/TwistFilter.js": { - "name": "src/pixi/filters/TwistFilter.js", - "modules": {}, - "classes": { - "TwistFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Circle.js": { - "name": "src/pixi/geom/Circle.js", - "modules": {}, - "classes": { - "Circle": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Ellipse.js": { - "name": "src/pixi/geom/Ellipse.js", - "modules": {}, - "classes": { - "Ellipse": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Matrix.js": { - "name": "src/pixi/geom/Matrix.js", - "modules": {}, - "classes": { - "Matrix": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Point.js": { - "name": "src/pixi/geom/Point.js", - "modules": {}, - "classes": { - "Point": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Polygon.js": { - "name": "src/pixi/geom/Polygon.js", - "modules": {}, - "classes": { - "Polygon": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Rectangle.js": { - "name": "src/pixi/geom/Rectangle.js", - "modules": {}, - "classes": { - "Rectangle": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/RoundedRectangle.js": { - "name": "src/pixi/geom/RoundedRectangle.js", - "modules": {}, - "classes": { - "Rounded Rectangle": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/loaders/AssetLoader.js": { - "name": "src/pixi/loaders/AssetLoader.js", - "modules": {}, - "classes": { - "AssetLoader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/loaders/AtlasLoader.js": { - "name": "src/pixi/loaders/AtlasLoader.js", - "modules": {}, - "classes": { - "AtlasLoader": 1 - }, - "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/JsonLoader.js": { - "name": "src/pixi/loaders/JsonLoader.js", - "modules": {}, - "classes": { - "JsonLoader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/loaders/SpineLoader.js": { - "name": "src/pixi/loaders/SpineLoader.js", - "modules": {}, - "classes": { - "SpineLoader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/loaders/SpriteSheetLoader.js": { - "name": "src/pixi/loaders/SpriteSheetLoader.js", - "modules": {}, - "classes": { - "SpriteSheetLoader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/primitives/Graphics.js": { - "name": "src/pixi/primitives/Graphics.js", - "modules": {}, - "classes": { - "Graphics": 1, - "GraphicsData": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/canvas/utils/CanvasBuffer.js": { - "name": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "modules": {}, - "classes": { - "CanvasBuffer": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/canvas/utils/CanvasMaskManager.js": { - "name": "src/pixi/renderers/canvas/utils/CanvasMaskManager.js", - "modules": {}, - "classes": { - "CanvasMaskManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/canvas/utils/CanvasTinter.js": { - "name": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "modules": {}, - "classes": { - "CanvasTinter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/canvas/CanvasGraphics.js": { - "name": "src/pixi/renderers/canvas/CanvasGraphics.js", - "modules": {}, - "classes": { - "CanvasGraphics": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/canvas/CanvasRenderer.js": { - "name": "src/pixi/renderers/canvas/CanvasRenderer.js", - "modules": {}, - "classes": { - "CanvasRenderer": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js": { - "name": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "modules": {}, - "classes": { - "ComplexPrimitiveShader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/shaders/PixiFastShader.js": { - "name": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "modules": {}, - "classes": { - "PixiFastShader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/shaders/PixiShader.js": { - "name": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "modules": {}, - "classes": { - "PixiShader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/shaders/PrimitiveShader.js": { - "name": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "modules": {}, - "classes": { - "PrimitiveShader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/shaders/StripShader.js": { - "name": "src/pixi/renderers/webgl/shaders/StripShader.js", - "modules": {}, - "classes": { - "StripShader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/FilterTexture.js": { - "name": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "modules": {}, - "classes": { - "FilterTexture": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "modules": {}, - "classes": { - "WebGLBlendModeManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "modules": {}, - "classes": { - "WebGLFastSpriteBatch": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLFilterManager.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "modules": {}, - "classes": { - "WebGLFilterManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLGraphics.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "modules": {}, - "classes": { - "WebGLGraphics": 1, - "WebGLGraphicsData": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLMaskManager.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "modules": {}, - "classes": { - "WebGLMaskManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLShaderManager.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "modules": {}, - "classes": { - "WebGLShaderManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "modules": {}, - "classes": { - "WebGLSpriteBatch": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLStencilManager.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "modules": {}, - "classes": { - "WebGLStencilManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/WebGLRenderer.js": { - "name": "src/pixi/renderers/webgl/WebGLRenderer.js", - "modules": {}, - "classes": { - "WebGLRenderer": 1 - }, - "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": {}, - "classes": { - "BaseTexture": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/textures/RenderTexture.js": { - "name": "src/pixi/textures/RenderTexture.js", - "modules": {}, - "classes": { - "RenderTexture": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/textures/Texture.js": { - "name": "src/pixi/textures/Texture.js", - "modules": {}, - "classes": { - "Texture": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/textures/VideoTexture.js": { - "name": "src/pixi/textures/VideoTexture.js", - "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} - }, - "src/pixi/utils/Detector.js": { - "name": "src/pixi/utils/Detector.js", - "modules": {}, - "classes": { - "autoDetectRenderer": 1, - "autoDetectRecommendedRenderer": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/utils/EventTarget.js": { - "name": "src/pixi/utils/EventTarget.js", - "modules": {}, - "classes": { - "EventTarget": 1, - "Event": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/utils/Polyk.js": { - "name": "src/pixi/utils/Polyk.js", - "modules": {}, - "classes": { - "PolyK": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/utils/Utils.js": { - "name": "src/pixi/utils/Utils.js", - "modules": {}, - "classes": { - "AjaxRequest": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/InteractionData.js": { - "name": "src/pixi/InteractionData.js", - "modules": {}, - "classes": { - "InteractionData": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/InteractionManager.js": { - "name": "src/pixi/InteractionManager.js", - "modules": {}, - "classes": { - "InteractionManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/Intro.js": { - "name": "src/pixi/Intro.js", - "modules": {}, - "classes": {}, - "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": { - "PIXI": 1 - }, - "classes": {}, - "fors": {}, - "namespaces": {} - } - }, - "modules": { - "PIXI": { - "name": "PIXI", - "submodules": {}, - "classes": { - "DisplayObject": 1, - "DisplayObjectContainer": 1, - "MovieClip": 1, - "Sprite": 1, - "SpriteBatch": 1, - "Stage": 1, - "Rope": 1, - "Spine": 1, - "Strip": 1, - "TilingSprite": 1, - "AbstractFilter": 1, - "AlphaMaskFilter": 1, - "AsciiFilter": 1, - "BlurFilter": 1, - "BlurXFilter": 1, - "BlurYFilter": 1, - "ColorMatrixFilter": 1, - "ColorStepFilter": 1, - "ConvolutionFilter": 1, - "CrossHatchFilter": 1, - "DisplacementFilter": 1, - "DotScreenFilter": 1, - "FilterBlock": 1, - "GrayFilter": 1, - "InvertFilter": 1, - "NoiseFilter": 1, - "NormalMapFilter": 1, - "PixelateFilter": 1, - "RGBSplitFilter": 1, - "SepiaFilter": 1, - "SmartBlurFilter": 1, - "TiltShiftFilter": 1, - "TiltShiftXFilter": 1, - "TiltShiftYFilter": 1, - "TwistFilter": 1, - "Circle": 1, - "Ellipse": 1, - "Matrix": 1, - "Point": 1, - "Polygon": 1, - "Rectangle": 1, - "Rounded Rectangle": 1, - "AssetLoader": 1, - "AtlasLoader": 1, - "BitmapFontLoader": 1, - "ImageLoader": 1, - "JsonLoader": 1, - "SpineLoader": 1, - "SpriteSheetLoader": 1, - "Graphics": 1, - "GraphicsData": 1, - "CanvasBuffer": 1, - "CanvasMaskManager": 1, - "CanvasTinter": 1, - "CanvasGraphics": 1, - "CanvasRenderer": 1, - "ComplexPrimitiveShader": 1, - "PixiFastShader": 1, - "PixiShader": 1, - "PrimitiveShader": 1, - "StripShader": 1, - "FilterTexture": 1, - "WebGLBlendModeManager": 1, - "WebGLFastSpriteBatch": 1, - "WebGLFilterManager": 1, - "WebGLGraphics": 1, - "WebGLGraphicsData": 1, - "WebGLMaskManager": 1, - "WebGLShaderManager": 1, - "WebGLSpriteBatch": 1, - "WebGLStencilManager": 1, - "WebGLRenderer": 1, - "BitmapText": 1, - "Text": 1, - "BaseTexture": 1, - "RenderTexture": 1, - "Texture": 1, - "autoDetectRenderer": 1, - "autoDetectRecommendedRenderer": 1, - "EventTarget": 1, - "Event": 1, - "PolyK": 1, - "AjaxRequest": 1, - "InteractionData": 1, - "InteractionManager": 1 - }, - "fors": {}, - "namespaces": {}, - "tag": "module", - "file": "src/pixi/InteractionManager.js", - "line": 5 - } - }, - "classes": { - "DisplayObject": { - "name": "DisplayObject", - "shortname": "DisplayObject", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/DisplayObject.js", - "line": 5, - "description": "The base class for all objects that are rendered on the screen.\nThis is an abstract class and should not be used on its own rather it should be extended.", - "is_constructor": 1 - }, - "DisplayObjectContainer": { - "name": "DisplayObjectContainer", - "shortname": "DisplayObjectContainer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 5, - "description": "A DisplayObjectContainer represents a collection of display objects.\nIt is the base class of all display objects that act as a container for other objects.", - "extends": "DisplayObject", - "is_constructor": 1 - }, - "MovieClip": { - "name": "MovieClip", - "shortname": "MovieClip", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/MovieClip.js", - "line": 5, - "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", - "extends": "Sprite", - "is_constructor": 1, - "params": [ - { - "name": "textures", - "description": "an array of {Texture} objects that make up the animation", - "type": "Array" - } - ] - }, - "Sprite": { - "name": "Sprite", - "shortname": "Sprite", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/Sprite.js", - "line": 5, - "description": "The Sprite object is the base for all textured objects that are rendered to the screen", - "extends": "DisplayObjectContainer", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "The texture for this sprite\n\nA sprite can be created directly from an image like this :\nvar sprite = new PIXI.Sprite.fromImage('assets/image.png');\nyourStage.addChild(sprite);\nthen obviously don't forget to add it to the stage you have already created", - "type": "Texture" - } - ] - }, - "SpriteBatch": { - "name": "SpriteBatch", - "shortname": "SpriteBatch", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/SpriteBatch.js", - "line": 5, - "description": "The SpriteBatch class is a really fast version of the DisplayObjectContainer \nbuilt solely for speed, so use when you need a lot of sprites or particles.\nAnd it's extremely easy to use : \n\n var container = new PIXI.SpriteBatch();\n\n stage.addChild(container);\n\n for(var i = 0; i < 100; i++)\n {\n var sprite = new PIXI.Sprite.fromImage(\"myImage.png\");\n container.addChild(sprite);\n }\nAnd here you have a hundred sprites that will be renderer at the speed of light", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "", - "type": "Texture" - } - ] - }, - "Stage": { - "name": "Stage", - "shortname": "Stage", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/Stage.js", - "line": 5, - "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", - "extends": "DisplayObjectContainer", - "is_constructor": 1, - "params": [ - { - "name": "backgroundColor", - "description": "the background color of the stage, you have to pass this in is in hex format\n like: 0xFFFFFF for white\n\nCreating a stage is a mandatory process when you use Pixi, which is as simple as this : \nvar stage = new PIXI.Stage(0xFFFFFF);\nwhere the parameter given is the background colour of the stage, in hex\nyou will use this stage instance to add your sprites to it and therefore to the renderer\nHere is how to add a sprite to the stage : \nstage.addChild(sprite);", - "type": "Number" - } - ] - }, - "Rope": { - "name": "Rope", - "shortname": "Rope", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/extras/Rope.js", - "line": 6, - "is_constructor": 1, - "extends": "Strip", - "params": [ - { - "name": "texture", - "description": "- The texture to use on the rope.", - "type": "Texture" - }, - { - "name": "points", - "description": "- An array of {PIXI.Point}.", - "type": "Array" - } - ] - }, - "Spine": { - "name": "Spine", - "shortname": "Spine", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/extras/Spine.js", - "line": 1357, - "description": "A class that enables the you to import and run your spine animations in pixi.\nSpine animation data needs to be loaded using the PIXI.AssetLoader or PIXI.SpineLoader before it can be used by this class\nSee example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source", - "extends": "DisplayObjectContainer", - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the spine anim file to be used", - "type": "String" - } - ] - }, - "Strip": { - "name": "Strip", - "shortname": "Strip", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/extras/Strip.js", - "line": 5, - "extends": "DisplayObjectContainer", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "The texture to use", - "type": "Texture" - }, - { - "name": "width", - "description": "the width", - "type": "Number" - }, - { - "name": "height", - "description": "the height", - "type": "Number" - } - ] - }, - "TilingSprite": { - "name": "TilingSprite", - "shortname": "TilingSprite", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/extras/TilingSprite.js", - "line": 5, - "description": "A tiling sprite is a fast way of rendering a tiling image", - "extends": "Sprite", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "the texture of the tiling sprite", - "type": "Texture" - }, - { - "name": "width", - "description": "the width of the tiling sprite", - "type": "Number" - }, - { - "name": "height", - "description": "the height of the tiling sprite", - "type": "Number" - } - ] - }, - "AbstractFilter": { - "name": "AbstractFilter", - "shortname": "AbstractFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/AbstractFilter.js", - "line": 5, - "description": "This is the base class for creating a PIXI filter. Currently only webGL supports filters.\nIf you want to make a custom filter this should be your base class.", - "is_constructor": 1, - "params": [ - { - "name": "fragmentSrc", - "description": "The fragment source in an array of strings.", - "type": "Array" - }, - { - "name": "uniforms", - "description": "An object containing the uniforms for this filter.", - "type": "Object" - } - ] - }, - "AlphaMaskFilter": { - "name": "AlphaMaskFilter", - "shortname": "AlphaMaskFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/AlphaMaskFilter.js", - "line": 5, - "description": "The AlphaMaskFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object.\nYou can use this filter to apply all manor of crazy warping effects\nCurrently the r property of the texture is used to offset the x and the g property of the texture is used to offset the y.", - "extends": "AbstractFilter", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "The texture used for the displacement map * must be power of 2 texture at the moment", - "type": "Texture" - } - ] - }, - "AsciiFilter": { - "name": "AsciiFilter", - "shortname": "AsciiFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/AsciiFilter.js", - "line": 6, - "description": "An ASCII filter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "BlurFilter": { - "name": "BlurFilter", - "shortname": "BlurFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/BlurFilter.js", - "line": 5, - "description": "The BlurFilter applies a Gaussian blur to an object.\nThe strength of the blur can be set for x- and y-axis separately (always relative to the stage).", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "BlurXFilter": { - "name": "BlurXFilter", - "shortname": "BlurXFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/BlurXFilter.js", - "line": 5, - "description": "The BlurXFilter applies a horizontal Gaussian blur to an object.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "BlurYFilter": { - "name": "BlurYFilter", - "shortname": "BlurYFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/BlurYFilter.js", - "line": 5, - "description": "The BlurYFilter applies a vertical Gaussian blur to an object.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "ColorMatrixFilter": { - "name": "ColorMatrixFilter", - "shortname": "ColorMatrixFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/ColorMatrixFilter.js", - "line": 5, - "description": "The ColorMatrixFilter class lets you apply a 4x4 matrix transformation on the RGBA\ncolor and alpha values of every pixel on your displayObject to produce a result\nwith a new set of RGBA color and alpha values. It's pretty powerful!", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "ColorStepFilter": { - "name": "ColorStepFilter", - "shortname": "ColorStepFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/ColorStepFilter.js", - "line": 5, - "description": "This lowers the color depth of your image by the given amount, producing an image with a smaller palette.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "ConvolutionFilter": { - "name": "ConvolutionFilter", - "shortname": "ConvolutionFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/ConvolutionFilter.js", - "line": 1, - "description": "The ConvolutionFilter class applies a matrix convolution filter effect. \nA convolution combines pixels in the input image with neighboring pixels to produce a new image. \nA wide variety of image effects can be achieved through convolutions, including blurring, edge detection, sharpening, embossing, and beveling.\nThe matrix should be specified as a 9 point Array. See http://docs.gimp.org/en/plug-in-convmatrix.html for more info.", - "extends": "AbstractFilter", - "is_constructor": 1, - "params": [ - { - "name": "matrix", - "description": "An array of values used for matrix transformation. Specified as a 9 point Array.", - "type": "Array" - }, - { - "name": "width", - "description": "Width of the object you are transforming", - "type": "Number" - }, - { - "name": "height", - "description": "Height of the object you are transforming", - "type": "Number" - } - ] - }, - "CrossHatchFilter": { - "name": "CrossHatchFilter", - "shortname": "CrossHatchFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/CrossHatchFilter.js", - "line": 5, - "description": "A Cross Hatch effect filter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "DisplacementFilter": { - "name": "DisplacementFilter", - "shortname": "DisplacementFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 5, - "description": "The DisplacementFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object.\nYou can use this filter to apply all manor of crazy warping effects\nCurrently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.", - "extends": "AbstractFilter", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "The texture used for the displacement map * must be power of 2 texture at the moment", - "type": "Texture" - } - ] - }, - "DotScreenFilter": { - "name": "DotScreenFilter", - "shortname": "DotScreenFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/DotScreenFilter.js", - "line": 6, - "description": "This filter applies a dotscreen effect making display objects appear to be made out of black and white halftone dots like an old printer.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "FilterBlock": { - "name": "FilterBlock", - "shortname": "FilterBlock", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/FilterBlock.js", - "line": 5, - "description": "A target and pass info object for filters.", - "is_constructor": 1 - }, - "GrayFilter": { - "name": "GrayFilter", - "shortname": "GrayFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/GrayFilter.js", - "line": 5, - "description": "This greyscales the palette of your Display Objects.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "InvertFilter": { - "name": "InvertFilter", - "shortname": "InvertFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/InvertFilter.js", - "line": 5, - "description": "This inverts your Display Objects colors.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "NoiseFilter": { - "name": "NoiseFilter", - "shortname": "NoiseFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/NoiseFilter.js", - "line": 6, - "description": "A Noise effect filter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "NormalMapFilter": { - "name": "NormalMapFilter", - "shortname": "NormalMapFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 6, - "description": "The NormalMapFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. \nYou can use this filter to apply all manor of crazy warping effects\nCurrently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.", - "extends": "AbstractFilter", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "The texture used for the displacement map * must be power of 2 texture at the moment", - "type": "Texture" - } - ] - }, - "PixelateFilter": { - "name": "PixelateFilter", - "shortname": "PixelateFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/PixelateFilter.js", - "line": 5, - "description": "This filter applies a pixelate effect making display objects appear 'blocky'.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "RGBSplitFilter": { - "name": "RGBSplitFilter", - "shortname": "RGBSplitFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/RGBSplitFilter.js", - "line": 5, - "description": "An RGB Split Filter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "SepiaFilter": { - "name": "SepiaFilter", - "shortname": "SepiaFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/SepiaFilter.js", - "line": 5, - "description": "This applies a sepia effect to your Display Objects.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "SmartBlurFilter": { - "name": "SmartBlurFilter", - "shortname": "SmartBlurFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/SmartBlurFilter.js", - "line": 5, - "description": "A Smart Blur Filter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "TiltShiftFilter": { - "name": "TiltShiftFilter", - "shortname": "TiltShiftFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 6, - "description": "A TiltShift Filter. Manages the pass of both a TiltShiftXFilter and TiltShiftYFilter.", - "is_constructor": 1 - }, - "TiltShiftXFilter": { - "name": "TiltShiftXFilter", - "shortname": "TiltShiftXFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 6, - "description": "A TiltShiftXFilter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "TiltShiftYFilter": { - "name": "TiltShiftYFilter", - "shortname": "TiltShiftYFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 6, - "description": "A TiltShiftYFilter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "TwistFilter": { - "name": "TwistFilter", - "shortname": "TwistFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/TwistFilter.js", - "line": 5, - "description": "This filter applies a twist effect making display objects appear twisted in the given direction.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "Circle": { - "name": "Circle", - "shortname": "Circle", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Circle.js", - "line": 5, - "description": "The Circle object can be used to specify a hit area for displayObjects", - "is_constructor": 1, - "params": [ - { - "name": "x", - "description": "The X coordinate of the center of this circle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the center of this circle", - "type": "Number" - }, - { - "name": "radius", - "description": "The radius of the circle", - "type": "Number" - } - ] - }, - "Ellipse": { - "name": "Ellipse", - "shortname": "Ellipse", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Ellipse.js", - "line": 5, - "description": "The Ellipse object can be used to specify a hit area for displayObjects", - "is_constructor": 1, - "params": [ - { - "name": "x", - "description": "The X coordinate of the center of the ellipse", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the center of the ellipse", - "type": "Number" - }, - { - "name": "width", - "description": "The half width of this ellipse", - "type": "Number" - }, - { - "name": "height", - "description": "The half height of this ellipse", - "type": "Number" - } - ] - }, - "Matrix": { - "name": "Matrix", - "shortname": "Matrix", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Matrix.js", - "line": 5, - "description": "The Matrix class is now an object, which makes it a lot faster, \nhere is a representation of it : \n| a | b | tx|\n| c | d | ty|\n| 0 | 0 | 1 |", - "is_constructor": 1 - }, - "Point": { - "name": "Point", - "shortname": "Point", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Point.js", - "line": 5, - "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", - "is_constructor": 1, - "params": [ - { - "name": "x", - "description": "position of the point on the x axis", - "type": "Number" - }, - { - "name": "y", - "description": "position of the point on the y axis", - "type": "Number" - } - ] - }, - "Polygon": { - "name": "Polygon", - "shortname": "Polygon", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Polygon.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "points", - "description": "This can be an array of Points that form the polygon,\n a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be\n all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the\n arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are\n Numbers.", - "type": "Array|Array|Point...|Number...", - "multiple": true - } - ] - }, - "Rectangle": { - "name": "Rectangle", - "shortname": "Rectangle", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Rectangle.js", - "line": 5, - "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", - "is_constructor": 1, - "params": [ - { - "name": "x", - "description": "The X coordinate of the upper-left corner of the rectangle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the upper-left corner of the rectangle", - "type": "Number" - }, - { - "name": "width", - "description": "The overall width of this rectangle", - "type": "Number" - }, - { - "name": "height", - "description": "The overall height of this rectangle", - "type": "Number" - } - ] - }, - "Rounded Rectangle": { - "name": "Rounded Rectangle", - "shortname": "Rounded Rectangle", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 5, - "description": "the Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height.", - "is_constructor": 1, - "params": [ - { - "name": "x", - "description": "The X coordinate of the upper-left corner of the rounded rectangle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the upper-left corner of the rounded rectangle", - "type": "Number" - }, - { - "name": "width", - "description": "The overall width of this rounded rectangle", - "type": "Number" - }, - { - "name": "height", - "description": "The overall height of this rounded rectangle", - "type": "Number" - }, - { - "name": "radius", - "description": "The overall radius of this corners of this rounded rectangle", - "type": "Number" - } - ] - }, - "AssetLoader": { - "name": "AssetLoader", - "shortname": "AssetLoader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/loaders/AssetLoader.js", - "line": 5, - "description": "A Class that loads a bunch of images / sprite sheet / bitmap font files. Once the\nassets have been loaded they are added to the PIXI Texture cache and can be accessed\neasily 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, - "uses": [ - "EventTarget" - ], - "params": [ - { - "name": "assetURLs", - "description": "An array of image/sprite sheet urls that you would like loaded\n supported. Supported image formats include 'jpeg', 'jpg', 'png', 'gif'. Supported\n sprite sheet data formats only include 'JSON' at this time. Supported bitmap font\n data formats include 'xml' and 'fnt'.", - "type": "Array" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "AtlasLoader": { - "name": "AtlasLoader", - "shortname": "AtlasLoader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 5, - "description": "The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event.\n\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format.\n\nIt is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to 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.fromFrameId()", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the JSON file", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "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", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the sprite sheet JSON file", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "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.fromFrame() and PIXI.Sprite.fromFrame()\nWhen loaded this class will dispatch a 'loaded' event", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the image", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "JsonLoader": { - "name": "JsonLoader", - "shortname": "JsonLoader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/loaders/JsonLoader.js", - "line": 5, - "description": "The json file loader is used to load in JSON data and parse it\nWhen loaded this class will dispatch a 'loaded' event\nIf loading fails this class will dispatch an 'error' event", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the JSON file", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "SpineLoader": { - "name": "SpineLoader", - "shortname": "SpineLoader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/loaders/SpineLoader.js", - "line": 10, - "description": "The Spine loader is used to load in JSON spine data\nTo generate the data you need to use http://esotericsoftware.com/ and export in the \"JSON\" format\nDue to a clash of names You will need to change the extension of the spine file from *.json to *.anim for it to load\nSee example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source\nYou will need to generate a sprite sheet to accompany the spine data\nWhen loaded this class will dispatch a \"loaded\" event", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the JSON file", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "SpriteSheetLoader": { - "name": "SpriteSheetLoader", - "shortname": "SpriteSheetLoader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "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 in 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 a 'texture atlas') as it means sprites 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.fromFrameId()\nThis loader will load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the sprite sheet JSON file", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "Graphics": { - "name": "Graphics", - "shortname": "Graphics", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/primitives/Graphics.js", - "line": 5, - "description": "The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and color and fill them.", - "extends": "DisplayObjectContainer", - "is_constructor": 1 - }, - "GraphicsData": { - "name": "GraphicsData", - "shortname": "GraphicsData", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/primitives/Graphics.js", - "line": 1093, - "description": "A GraphicsData object.", - "is_constructor": 1 - }, - "CanvasBuffer": { - "name": "CanvasBuffer", - "shortname": "CanvasBuffer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 5, - "description": "Creates a Canvas element of the given size.", - "is_constructor": 1, - "params": [ - { - "name": "width", - "description": "the width for the newly created canvas", - "type": "Number" - }, - { - "name": "height", - "description": "the height for the newly created canvas", - "type": "Number" - } - ] - }, - "CanvasMaskManager": { - "name": "CanvasMaskManager", - "shortname": "CanvasMaskManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/canvas/utils/CanvasMaskManager.js", - "line": 5, - "description": "A set of functions used to handle masking.", - "is_constructor": 1 - }, - "CanvasTinter": { - "name": "CanvasTinter", - "shortname": "CanvasTinter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 5, - "is_constructor": 1, - "static": 1 - }, - "CanvasGraphics": { - "name": "CanvasGraphics", - "shortname": "CanvasGraphics", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/canvas/CanvasGraphics.js", - "line": 6, - "description": "A set of functions used by the canvas renderer to draw the primitive graphics data.", - "static": 1 - }, - "CanvasRenderer": { - "name": "CanvasRenderer", - "shortname": "CanvasRenderer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 5, - "description": "The CanvasRenderer draws the Stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDon't forget to add the CanvasRenderer.view to your DOM or you will not see anything :)", - "is_constructor": 1, - "params": [ - { - "name": "width", - "description": "the width of the canvas view", - "type": "Number", - "optional": true, - "optdefault": "800" - }, - { - "name": "height", - "description": "the height of the canvas view", - "type": "Number", - "optional": true, - "optdefault": "600" - }, - { - "name": "options", - "description": "The optional renderer parameters", - "type": "Object", - "optional": true, - "props": [ - { - "name": "view", - "description": "the canvas to use as a view, optional", - "type": "HTMLCanvasElement", - "optional": true - }, - { - "name": "transparent", - "description": "If the render view is transparent, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "autoResize", - "description": "If the render view is automatically resized, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "resolution", - "description": "the resolution of the renderer retina would be 2", - "type": "Number", - "optional": true, - "optdefault": "1" - }, - { - "name": "clearBeforeRender", - "description": "This sets if the CanvasRenderer will clear the canvas or not before the new render pass.", - "type": "Boolean", - "optional": true, - "optdefault": "true" - } - ] - } - ] - }, - "ComplexPrimitiveShader": { - "name": "ComplexPrimitiveShader", - "shortname": "ComplexPrimitiveShader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "PixiFastShader": { - "name": "PixiFastShader", - "shortname": "PixiFastShader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "PixiShader": { - "name": "PixiShader", - "shortname": "PixiShader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 6, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "PrimitiveShader": { - "name": "PrimitiveShader", - "shortname": "PrimitiveShader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "StripShader": { - "name": "StripShader", - "shortname": "StripShader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "FilterTexture": { - "name": "FilterTexture", - "shortname": "FilterTexture", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - }, - { - "name": "width", - "description": "the horizontal range of the filter", - "type": "Number" - }, - { - "name": "height", - "description": "the vertical range of the filter", - "type": "Number" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ] - }, - "WebGLBlendModeManager": { - "name": "WebGLBlendModeManager", - "shortname": "WebGLBlendModeManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "WebGLFastSpriteBatch": { - "name": "WebGLFastSpriteBatch", - "shortname": "WebGLFastSpriteBatch", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 11, - "is_constructor": 1 - }, - "WebGLFilterManager": { - "name": "WebGLFilterManager", - "shortname": "WebGLFilterManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 5, - "is_constructor": 1 - }, - "WebGLGraphics": { - "name": "WebGLGraphics", - "shortname": "WebGLGraphics", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 5, - "description": "A set of functions used by the webGL renderer to draw the primitive graphics data", - "access": "private", - "tagname": "", - "static": 1 - }, - "WebGLGraphicsData": { - "name": "WebGLGraphicsData", - "shortname": "WebGLGraphicsData", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 829, - "access": "private", - "tagname": "", - "static": 1 - }, - "WebGLMaskManager": { - "name": "WebGLMaskManager", - "shortname": "WebGLMaskManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 5, - "is_constructor": 1, - "access": "private", - "tagname": "" - }, - "WebGLShaderManager": { - "name": "WebGLShaderManager", - "shortname": "WebGLShaderManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 5, - "is_constructor": 1, - "access": "private", - "tagname": "" - }, - "WebGLSpriteBatch": { - "name": "WebGLSpriteBatch", - "shortname": "WebGLSpriteBatch", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 11, - "access": "private", - "tagname": "", - "is_constructor": 1 - }, - "WebGLStencilManager": { - "name": "WebGLStencilManager", - "shortname": "WebGLStencilManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 5, - "is_constructor": 1, - "access": "private", - "tagname": "" - }, - "WebGLRenderer": { - "name": "WebGLRenderer", - "shortname": "WebGLRenderer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 8, - "description": "The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer\nshould be used for browsers that support webGL. This Render works by automatically managing webGLBatchs.\nSo no need for Sprite Batches or Sprite Clouds.\nDon't forget to add the view to your DOM or you will not see anything :)", - "is_constructor": 1, - "params": [ - { - "name": "width", - "description": "the width of the canvas view", - "type": "Number", - "optional": true, - "optdefault": "0" - }, - { - "name": "height", - "description": "the height of the canvas view", - "type": "Number", - "optional": true, - "optdefault": "0" - }, - { - "name": "options", - "description": "The optional renderer parameters", - "type": "Object", - "optional": true, - "props": [ - { - "name": "view", - "description": "the canvas to use as a view, optional", - "type": "HTMLCanvasElement", - "optional": true - }, - { - "name": "transparent", - "description": "If the render view is transparent, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "autoResize", - "description": "If the render view is automatically resized, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "antialias", - "description": "sets antialias (only applicable in chrome at the moment)", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "preserveDrawingBuffer", - "description": "enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "resolution", - "description": "the resolution of the renderer retina would be 2", - "type": "Number", - "optional": true, - "optdefault": "1" - } - ] - } - ] - }, - "BitmapText": { - "name": "BitmapText", - "shortname": "BitmapText", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/text/BitmapText.js", - "line": 5, - "description": "A BitmapText object will create a line or multiple lines of text using bitmap font. To split a line you can use '\\n', '\\r' or '\\r\\n' in your string.\nYou can generate the fnt files using\nhttp://www.angelcode.com/products/bmfont/ for windows or\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", - "props": [ - { - "name": "font", - "description": "The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)", - "type": "String" - }, - { - "name": "align", - "description": "Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text", - "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": 6, - "description": "A Text Object will create a line or multiple lines of text. To split a line you can use '\\n' in your text string,\nor add a wordWrap property set to true and and wordWrapWidth property with a value in the style object.", - "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 20px 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 e.g 'red', '#00FF00'", - "type": "String|Number", - "optional": true, - "optdefault": "'black'" - }, - { - "name": "align", - "description": "Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text", - "type": "String", - "optional": true, - "optdefault": "'left'" - }, - { - "name": "stroke", - "description": "A canvas fillstyle that will be used on the text stroke e.g 'blue', '#FCFF00'", - "type": "String|Number", - "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": "wordWrap", - "description": "Indicates if word wrap should be used", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "wordWrapWidth", - "description": "The width at which text will wrap, it needs wordWrap to be set to true", - "type": "Number", - "optional": true, - "optdefault": "100" - }, - { - "name": "dropShadow", - "description": "Set a drop shadow for the text", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "dropShadowColor", - "description": "A fill style to be used on the dropshadow e.g 'red', '#00FF00'", - "type": "String", - "optional": true, - "optdefault": "'#000000'" - }, - { - "name": "dropShadowAngle", - "description": "Set a angle of the drop shadow", - "type": "Number", - "optional": true, - "optdefault": "Math.PI/4" - }, - { - "name": "dropShadowDistance", - "description": "Set a distance of the drop shadow", - "type": "Number", - "optional": true, - "optdefault": "5" - } - ] - } - ] - }, - "BaseTexture": { - "name": "BaseTexture", - "shortname": "BaseTexture", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/textures/BaseTexture.js", - "line": 9, - "description": "A texture stores the information that represents an image. All textures have a base texture.", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "source", - "description": "the source object (image or canvas)", - "type": "String" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ] - }, - "RenderTexture": { - "name": "RenderTexture", - "shortname": "RenderTexture", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/textures/RenderTexture.js", - "line": 5, - "description": "A RenderTexture is a special texture that allows any Pixi display object to be rendered to it.\n\n__Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead.\n\nA RenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example:\n\n var renderTexture = new PIXI.RenderTexture(800, 600);\n var sprite = PIXI.Sprite.fromImage(\"spinObj_01.png\");\n sprite.position.x = 800/2;\n sprite.position.y = 600/2;\n sprite.anchor.x = 0.5;\n sprite.anchor.y = 0.5;\n renderTexture.render(sprite);\n\nThe Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual position a DisplayObjectContainer should be used:\n\n var doc = new PIXI.DisplayObjectContainer();\n doc.addChild(sprite);\n renderTexture.render(doc); // Renders to center of renderTexture", - "extends": "Texture", - "is_constructor": 1, - "params": [ - { - "name": "width", - "description": "The width of the render texture", - "type": "Number" - }, - { - "name": "height", - "description": "The height of the render texture", - "type": "Number" - }, - { - "name": "renderer", - "description": "The renderer used for this RenderTexture", - "type": "CanvasRenderer|WebGLRenderer" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - }, - { - "name": "resolution", - "description": "The resolution of the texture being generated", - "type": "Number" - } - ] - }, - "Texture": { - "name": "Texture", - "shortname": "Texture", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/textures/Texture.js", - "line": 10, - "description": "A texture stores the information that represents an image or part of an image. It cannot be added\nto the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used.", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "baseTexture", - "description": "The base texture source to create the texture from", - "type": "BaseTexture" - }, - { - "name": "frame", - "description": "The rectangle frame of the texture to show", - "type": "Rectangle" - }, - { - "name": "crop", - "description": "The area of original texture", - "type": "Rectangle", - "optional": true - }, - { - "name": "trim", - "description": "Trimmed texture rectangle", - "type": "Rectangle", - "optional": true - } - ] - }, - "autoDetectRenderer": { - "name": "autoDetectRenderer", - "shortname": "autoDetectRenderer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/utils/Detector.js", - "line": 5, - "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot faster. If webGL is not supported by\nthe browser then this function will return a canvas renderer", - "static": 1, - "params": [ - { - "name": "width=800", - "description": "the width of the renderers view", - "type": "Number" - }, - { - "name": "height=600", - "description": "the height of the renderers view", - "type": "Number" - }, - { - "name": "options", - "description": "The optional renderer parameters", - "type": "Object", - "optional": true, - "props": [ - { - "name": "view", - "description": "the canvas to use as a view, optional", - "type": "HTMLCanvasElement", - "optional": true - }, - { - "name": "transparent", - "description": "If the render view is transparent, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "antialias", - "description": "sets antialias (only applicable in chrome at the moment)", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "preserveDrawingBuffer", - "description": "enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "resolution", - "description": "the resolution of the renderer retina would be 2", - "type": "Number", - "optional": true, - "optdefault": "1" - } - ] - } - ] - }, - "autoDetectRecommendedRenderer": { - "name": "autoDetectRecommendedRenderer", - "shortname": "autoDetectRecommendedRenderer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/utils/Detector.js", - "line": 44, - "description": "This helper function will automatically detect which renderer you should be using.\nThis function is very similar to the autoDetectRenderer function except that is will return a canvas renderer for android.\nEven thought both android chrome supports webGL the canvas implementation perform better at the time of writing. \nThis function will likely change and update as webGL performance improves on these devices.", - "static": 1, - "params": [ - { - "name": "width=800", - "description": "the width of the renderers view", - "type": "Number" - }, - { - "name": "height=600", - "description": "the height of the renderers view", - "type": "Number" - }, - { - "name": "options", - "description": "The optional renderer parameters", - "type": "Object", - "optional": true, - "props": [ - { - "name": "view", - "description": "the canvas to use as a view, optional", - "type": "HTMLCanvasElement", - "optional": true - }, - { - "name": "transparent", - "description": "If the render view is transparent, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "antialias", - "description": "sets antialias (only applicable in chrome at the moment)", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "preserveDrawingBuffer", - "description": "enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "resolution", - "description": "the resolution of the renderer retina would be 2", - "type": "Number", - "optional": true, - "optdefault": "1" - } - ] - } - ] - }, - "EventTarget": { - "name": "EventTarget", - "shortname": "EventTarget", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [ - "AssetLoader", - "AtlasLoader", - "BitmapFontLoader", - "ImageLoader", - "JsonLoader", - "SpineLoader", - "SpriteSheetLoader", - "BaseTexture", - "Texture" - ], - "module": "PIXI", - "file": "src/pixi/utils/EventTarget.js", - "line": 11, - "description": "Mixins event emitter functionality to a class", - "example": [ - "\n function MyEmitter() {}\n\n PIXI.EventTarget.mixin(MyEmitter.prototype);\n\n var em = new MyEmitter();\n em.emit('eventName', 'some data', 'some more data', {}, null, ...);" - ] - }, - "Event": { - "name": "Event", - "shortname": "Event", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/utils/EventTarget.js", - "line": 192, - "description": "Creates an homogenous object for tracking events so users can know what to expect.", - "extends": "Object", - "is_constructor": 1, - "params": [ - { - "name": "target", - "description": "The target object that the event is called on", - "type": "Object" - }, - { - "name": "name", - "description": "The string name of the event that was triggered", - "type": "String" - }, - { - "name": "data", - "description": "Arbitrary event data to pass along", - "type": "Object" - } - ] - }, - "PolyK": { - "name": "PolyK", - "shortname": "PolyK", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/utils/Polyk.js", - "line": 34, - "description": "Based on the Polyk library http://polyk.ivank.net released under MIT licence.\nThis is an amazing lib!\nSlightly modified by Mat Groves (matgroves.com);" - }, - "AjaxRequest": { - "name": "AjaxRequest", - "shortname": "AjaxRequest", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/utils/Utils.js", - "line": 108, - "description": "A wrapper for ajax requests to be handled cross browser", - "is_constructor": 1 - }, - "InteractionData": { - "name": "InteractionData", - "shortname": "InteractionData", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/InteractionData.js", - "line": 5, - "description": "Holds all information related to an Interaction event", - "is_constructor": 1 - }, - "InteractionManager": { - "name": "InteractionManager", - "shortname": "InteractionManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/InteractionManager.js", - "line": 5, - "description": "The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive\nif its interactive parameter is set to true\nThis manager also supports multitouch.", - "is_constructor": 1, - "params": [ - { - "name": "stage", - "description": "The stage to handle interactions", - "type": "Stage" - } - ] - } - }, - "classitems": [ - { - "file": "src/pixi/display/DisplayObject.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 14, - "description": "The coordinate of the object relative to the local coordinates of the parent.", - "itemtype": "property", - "name": "position", - "type": "Point", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 22, - "description": "The scale factor of the object.", - "itemtype": "property", - "name": "scale", - "type": "Point", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 30, - "description": "The pivot point of the displayObject that it rotates around", - "itemtype": "property", - "name": "pivot", - "type": "Point", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 38, - "description": "The rotation of the object in radians.", - "itemtype": "property", - "name": "rotation", - "type": "Number", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 46, - "description": "The opacity of the object.", - "itemtype": "property", - "name": "alpha", - "type": "Number", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 54, - "description": "The visibility of the object.", - "itemtype": "property", - "name": "visible", - "type": "Boolean", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 62, - "description": "This is the defined area that will pick up mouse / touch events. It is null by default.\nSetting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)", - "itemtype": "property", - "name": "hitArea", - "type": "Rectangle|Circle|Ellipse|Polygon", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 71, - "description": "This is used to indicate if the displayObject should display a mouse hand cursor on rollover", - "itemtype": "property", - "name": "buttonMode", - "type": "Boolean", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 79, - "description": "Can this object be rendered", - "itemtype": "property", - "name": "renderable", - "type": "Boolean", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 87, - "description": "[read-only] The display object container that contains this display object.", - "itemtype": "property", - "name": "parent", - "type": "DisplayObjectContainer", - "readonly": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 96, - "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", - "itemtype": "property", - "name": "stage", - "type": "Stage", - "readonly": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 105, - "description": "[read-only] The multiplied alpha of the displayObject", - "itemtype": "property", - "name": "worldAlpha", - "type": "Number", - "readonly": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 114, - "description": "[read-only] Whether or not the object is interactive, do not toggle directly! use the `interactive` property", - "itemtype": "property", - "name": "_interactive", - "type": "Boolean", - "readonly": "", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 124, - "description": "This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true", - "itemtype": "property", - "name": "defaultCursor", - "type": "String", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 133, - "description": "[read-only] Current transform of the object based on world (parent) factors", - "itemtype": "property", - "name": "worldTransform", - "type": "Matrix", - "readonly": "", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 143, - "description": "cached sin rotation and cos rotation", - "itemtype": "property", - "name": "_sr", - "type": "Number", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 152, - "description": "cached sin rotation and cos rotation", - "itemtype": "property", - "name": "_cr", - "type": "Number", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 161, - "description": "The area the filter is applied to like the hitArea this is used as more of an optimisation\nrather than figuring out the dimensions of the displayObject each frame you can set this rectangle", - "itemtype": "property", - "name": "filterArea", - "type": "Rectangle", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 170, - "description": "The original, cached bounds of the object", - "itemtype": "property", - "name": "_bounds", - "type": "Rectangle", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 179, - "description": "The most up-to-date bounds of the object", - "itemtype": "property", - "name": "_currentBounds", - "type": "Rectangle", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 188, - "description": "The original, cached mask of the object", - "itemtype": "property", - "name": "_currentBounds", - "type": "Rectangle", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 197, - "description": "Cached internal flag.", - "itemtype": "property", - "name": "_cacheAsBitmap", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 206, - "description": "Cached internal flag.", - "itemtype": "property", - "name": "_cacheIsDirty", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 220, - "description": "A callback that is used when the users mouse rolls over the displayObject", - "itemtype": "method", - "name": "mouseover", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 226, - "description": "A callback that is used when the users mouse leaves the displayObject", - "itemtype": "method", - "name": "mouseout", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 233, - "description": "A callback that is used when the users clicks on the displayObject with their mouse's left button", - "itemtype": "method", - "name": "click", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 239, - "description": "A callback that is used when the user clicks the mouse's left button down over the sprite", - "itemtype": "method", - "name": "mousedown", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 245, - "description": "A callback that is used when the user releases the mouse's left button that was over the displayObject\nfor this callback to be fired, the mouse's left button must have been pressed down over the displayObject", - "itemtype": "method", - "name": "mouseup", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 252, - "description": "A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject\nfor this callback to be fired, the mouse's left button must have been pressed down over the displayObject", - "itemtype": "method", - "name": "mouseupoutside", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 260, - "description": "A callback that is used when the users clicks on the displayObject with their mouse's right button", - "itemtype": "method", - "name": "rightclick", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 266, - "description": "A callback that is used when the user clicks the mouse's right button down over the sprite", - "itemtype": "method", - "name": "rightdown", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 272, - "description": "A callback that is used when the user releases the mouse's right button that was over the displayObject\nfor this callback to be fired the mouse's right button must have been pressed down over the displayObject", - "itemtype": "method", - "name": "rightup", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 279, - "description": "A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject\nfor this callback to be fired, the mouse's right button must have been pressed down over the displayObject", - "itemtype": "method", - "name": "rightupoutside", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 290, - "description": "A callback that is used when the users taps on the sprite with their finger\nbasically a touch version of click", - "itemtype": "method", - "name": "tap", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 297, - "description": "A callback that is used when the user touches over the displayObject", - "itemtype": "method", - "name": "touchstart", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 303, - "description": "A callback that is used when the user releases a touch over the displayObject", - "itemtype": "method", - "name": "touchend", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 309, - "description": "A callback that is used when the user releases the touch that was over the displayObject\nfor this callback to be fired, The touch must have started over the sprite", - "itemtype": "method", - "name": "touchendoutside", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 320, - "description": "Indicates if the sprite will have touch and mouse interactivity. It is false by default", - "itemtype": "property", - "name": "interactive", - "type": "Boolean", - "default": "false", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 340, - "description": "[read-only] Indicates if the sprite is globally visible.", - "itemtype": "property", - "name": "worldVisible", - "type": "Boolean", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 361, - "description": "Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.\nIn PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping.\nTo remove a mask, set this property to null.", - "itemtype": "property", - "name": "mask", - "type": "Graphics", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 381, - "description": "Sets the filters for the displayObject.\n* IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer.\nTo remove filters simply set this property to 'null'", - "itemtype": "property", - "name": "filters", - "type": "Array An array of filters", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 417, - "description": "Set if this display object is cached as a bitmap.\nThis basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects.\nTo remove simply set this property to 'null'", - "itemtype": "property", - "name": "cacheAsBitmap", - "type": "Boolean", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 523, - "description": "Retrieves the bounds of the displayObject as a rectangle object", - "itemtype": "method", - "name": "getBounds", - "params": [ - { - "name": "matrix", - "description": "", - "type": "Matrix" - } - ], - "return": { - "description": "the rectangular bounding area", - "type": "Rectangle" - }, - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 536, - "description": "Retrieves the local bounds of the displayObject as a rectangle object", - "itemtype": "method", - "name": "getLocalBounds", - "return": { - "description": "the rectangular bounding area", - "type": "Rectangle" - }, - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 547, - "description": "Sets the object's stage reference, the stage this object is connected to", - "itemtype": "method", - "name": "setStageReference", - "params": [ - { - "name": "stage", - "description": "the stage that the object will have as its current stage reference", - "type": "Stage" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 559, - "description": "Useful function that returns a texture of the displayObject object that can then be used to create sprites\nThis can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.", - "itemtype": "method", - "name": "generateTexture", - "params": [ - { - "name": "resolution", - "description": "The resolution of the texture being generated", - "type": "Number" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - }, - { - "name": "renderer", - "description": "The renderer used to generate the texture.", - "type": "CanvasRenderer|WebGLRenderer" - } - ], - "return": { - "description": "a texture of the graphics object", - "type": "Texture" - }, - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 583, - "description": "Generates and updates the cached sprite for this object.", - "itemtype": "method", - "name": "updateCache", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 593, - "description": "Calculates the global position of the display object", - "itemtype": "method", - "name": "toGlobal", - "params": [ - { - "name": "position", - "description": "The world origin to calculate from", - "type": "Point" - } - ], - "return": { - "description": "A point object representing the position of this object", - "type": "Point" - }, - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 606, - "description": "Calculates the local position of the display object relative to another point", - "itemtype": "method", - "name": "toLocal", - "params": [ - { - "name": "position", - "description": "The world origin to calculate from", - "type": "Point" - }, - { - "name": "from", - "description": "The DisplayObject to calculate the global position from", - "type": "DisplayObject", - "optional": true - } - ], - "return": { - "description": "A point object representing the position of this object", - "type": "Point" - }, - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 626, - "description": "Internal method.", - "itemtype": "method", - "name": "_renderCachedSprite", - "params": [ - { - "name": "renderSession", - "description": "The render session", - "type": "Object" - } - ], - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 647, - "description": "Internal method.", - "itemtype": "method", - "name": "_generateCachedSprite", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 689, - "description": "Destroys the cached sprite.", - "itemtype": "method", - "name": "_destroyCachedSprite", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 705, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 719, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 736, - "description": "The position of the displayObject on the x axis relative to the local coordinates of the parent.", - "itemtype": "property", - "name": "x", - "type": "Number", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 751, - "description": "The position of the displayObject on the y axis relative to the local coordinates of the parent.", - "itemtype": "property", - "name": "y", - "type": "Number", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 17, - "description": "[read-only] The array of children of this container.", - "itemtype": "property", - "name": "children", - "type": "Array", - "readonly": "", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 35, - "description": "The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 63, - "description": "The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 90, - "description": "Adds a child to the container.", - "itemtype": "method", - "name": "addChild", - "params": [ - { - "name": "child", - "description": "The DisplayObject to add to the container", - "type": "DisplayObject" - } - ], - "return": { - "description": "The child that was added.", - "type": "DisplayObject" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 102, - "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", - "itemtype": "method", - "name": "addChildAt", - "params": [ - { - "name": "child", - "description": "The child to add", - "type": "DisplayObject" - }, - { - "name": "index", - "description": "The index to place the child in", - "type": "Number" - } - ], - "return": { - "description": "The child that was added.", - "type": "DisplayObject" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 133, - "description": "Swaps the position of 2 Display Objects within this container.", - "itemtype": "method", - "name": "swapChildren", - "params": [ - { - "name": "child", - "description": "", - "type": "DisplayObject" - }, - { - "name": "child2", - "description": "", - "type": "DisplayObject" - } - ], - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 158, - "description": "Returns the index position of a child DisplayObject instance", - "itemtype": "method", - "name": "getChildIndex", - "params": [ - { - "name": "child", - "description": "The DisplayObject instance to identify", - "type": "DisplayObject" - } - ], - "return": { - "description": "The index position of the child display object to identify", - "type": "Number" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 175, - "description": "Changes the position of an existing child in the display object container", - "itemtype": "method", - "name": "setChildIndex", - "params": [ - { - "name": "child", - "description": "The child DisplayObject instance for which you want to change the index number", - "type": "DisplayObject" - }, - { - "name": "index", - "description": "The resulting index number for the child display object", - "type": "Number" - } - ], - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 193, - "description": "Returns the child at the specified index", - "itemtype": "method", - "name": "getChildAt", - "params": [ - { - "name": "index", - "description": "The index to get the child from", - "type": "Number" - } - ], - "return": { - "description": "The child at the given index, if any.", - "type": "DisplayObject" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 210, - "description": "Removes a child from the container.", - "itemtype": "method", - "name": "removeChild", - "params": [ - { - "name": "child", - "description": "The DisplayObject to remove", - "type": "DisplayObject" - } - ], - "return": { - "description": "The child that was removed.", - "type": "DisplayObject" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 225, - "description": "Removes a child from the specified index position.", - "itemtype": "method", - "name": "removeChildAt", - "params": [ - { - "name": "index", - "description": "The index to get the child from", - "type": "Number" - } - ], - "return": { - "description": "The child that was removed.", - "type": "DisplayObject" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 243, - "description": "Removes all children from this container that are within the begin and end indexes.", - "itemtype": "method", - "name": "removeChildren", - "params": [ - { - "name": "beginIndex", - "description": "The beginning position. Default value is 0.", - "type": "Number" - }, - { - "name": "endIndex", - "description": "The ending position. Default value is size of the container.", - "type": "Number" - } - ], - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 302, - "description": "Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.", - "itemtype": "method", - "name": "getBounds", - "return": { - "description": "The rectangular bounding area", - "type": "Rectangle" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 362, - "description": "Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.", - "itemtype": "method", - "name": "getLocalBounds", - "return": { - "description": "The rectangular bounding area", - "type": "Rectangle" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 386, - "description": "Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.", - "itemtype": "method", - "name": "setStageReference", - "params": [ - { - "name": "stage", - "description": "the stage that the container will have as its current stage reference", - "type": "Stage" - } - ], - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 404, - "description": "Removes the current stage reference from the container and all of its children.", - "itemtype": "method", - "name": "removeStageReference", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 423, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 482, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 17, - "description": "The array of textures that make up the animation", - "itemtype": "property", - "name": "textures", - "type": "Array", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 25, - "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", - "itemtype": "property", - "name": "animationSpeed", - "type": "Number", - "default": "1", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 34, - "description": "Whether or not the movie clip repeats after playing.", - "itemtype": "property", - "name": "loop", - "type": "Boolean", - "default": "true", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 43, - "description": "Function to call when a MovieClip finishes playing", - "itemtype": "property", - "name": "onComplete", - "type": "Function", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 51, - "description": "[read-only] The MovieClips current frame index (this may not have to be a whole number)", - "itemtype": "property", - "name": "currentFrame", - "type": "Number", - "default": "0", - "readonly": "", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 61, - "description": "[read-only] Indicates if the MovieClip is currently playing", - "itemtype": "property", - "name": "playing", - "type": "Boolean", - "readonly": "", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 75, - "description": "[read-only] totalFrames is the total number of frames in the MovieClip. This is the same as number of textures\nassigned to the MovieClip.", - "itemtype": "property", - "name": "totalFrames", - "type": "Number", - "default": "0", - "readonly": "", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 91, - "description": "Stops the MovieClip", - "itemtype": "method", - "name": "stop", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 101, - "description": "Plays the MovieClip", - "itemtype": "method", - "name": "play", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 111, - "description": "Stops the MovieClip and goes to a specific frame", - "itemtype": "method", - "name": "gotoAndStop", - "params": [ - { - "name": "frameNumber", - "description": "frame index to stop at", - "type": "Number" - } - ], - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 125, - "description": "Goes to a specific frame and begins playing the MovieClip", - "itemtype": "method", - "name": "gotoAndPlay", - "params": [ - { - "name": "frameNumber", - "description": "frame index to start at", - "type": "Number" - } - ], - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 169, - "description": "A short hand way of creating a movieclip from an array of frame ids", - "static": 1, - "itemtype": "method", - "name": "fromFrames", - "params": [ - { - "name": "frames", - "description": "the array of frames ids the movieclip will use as its texture frames", - "type": "Array" - } - ], - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 188, - "description": "A short hand way of creating a movieclip from an array of image ids", - "static": 1, - "itemtype": "method", - "name": "fromImages", - "params": [ - { - "name": "frames", - "description": "the array of image ids the movieclip will use as its texture frames", - "type": "Array" - } - ], - "class": "MovieClip" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 22, - "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the texture's origin is the top left\nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right corner", - "itemtype": "property", - "name": "anchor", - "type": "Point", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 33, - "description": "The texture that the sprite is using", - "itemtype": "property", - "name": "texture", - "type": "Texture", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 41, - "description": "The width of the sprite (this is initially set by the texture)", - "itemtype": "property", - "name": "_width", - "type": "Number", - "access": "private", - "tagname": "", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 50, - "description": "The height of the sprite (this is initially set by the texture)", - "itemtype": "property", - "name": "_height", - "type": "Number", - "access": "private", - "tagname": "", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 59, - "description": "The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.", - "itemtype": "property", - "name": "tint", - "type": "Number", - "default": "0xFFFFFF", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 68, - "description": "The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.", - "itemtype": "property", - "name": "blendMode", - "type": "Number", - "default": "PIXI.blendModes.NORMAL;", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 77, - "description": "The shader that will be used to render the texture to the stage. Set to null to remove a current shader.", - "itemtype": "property", - "name": "shader", - "type": "PIXI.AbstractFilter", - "default": "null", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 103, - "description": "The width of the sprite, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 119, - "description": "The height of the sprite, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 135, - "description": "Sets the texture of the sprite", - "itemtype": "method", - "name": "setTexture", - "params": [ - { - "name": "texture", - "description": "The PIXI texture that is displayed by the sprite", - "type": "Texture" - } - ], - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 147, - "description": "When the texture is updated, this event will fire to update the scale and frame", - "itemtype": "method", - "name": "onTextureUpdate", - "params": [ - { - "name": "event", - "description": "" - } - ], - "access": "private", - "tagname": "", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 163, - "description": "Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account.", - "itemtype": "method", - "name": "getBounds", - "params": [ - { - "name": "matrix", - "description": "the transformation matrix of the sprite", - "type": "Matrix" - } - ], - "return": { - "description": "the framing rectangle", - "type": "Rectangle" - }, - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 242, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 305, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 418, - "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId\n The frame ids are created when a Texture packer file has been loaded", - "itemtype": "method", - "name": "fromFrame", - "static": 1, - "params": [ - { - "name": "frameId", - "description": "The frame Id of the texture in the cache", - "type": "String" - } - ], - "return": { - "description": "A new Sprite using a texture from the texture cache matching the frameId", - "type": "Sprite" - }, - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 435, - "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", - "itemtype": "method", - "name": "fromImage", - "static": 1, - "params": [ - { - "name": "imageId", - "description": "The image url of the texture", - "type": "String" - } - ], - "return": { - "description": "A new Sprite using a texture from the texture cache matching the image id", - "type": "Sprite" - }, - "class": "Sprite" - }, - { - "file": "src/pixi/display/SpriteBatch.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/", - "class": "SpriteBatch" - }, - { - "file": "src/pixi/display/SpriteBatch.js", - "line": 66, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "SpriteBatch" - }, - { - "file": "src/pixi/display/SpriteBatch.js", - "line": 90, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "SpriteBatch" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 25, - "description": "[read-only] Current transform of the object based on world (parent) factors", - "itemtype": "property", - "name": "worldTransform", - "type": "Matrix", - "readonly": "", - "access": "private", - "tagname": "", - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 35, - "description": "Whether or not the stage is interactive", - "itemtype": "property", - "name": "interactive", - "type": "Boolean", - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 43, - "description": "The interaction manage for this stage, manages all interactive activity on the stage", - "itemtype": "property", - "name": "interactionManager", - "type": "InteractionManager", - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 51, - "description": "Whether the stage is dirty and needs to have interactions updated", - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 73, - "description": "Sets another DOM element which can receive mouse/touch interactions instead of the default Canvas element.\nThis is useful for when you have other DOM elements on top of the Canvas element.", - "itemtype": "method", - "name": "setInteractionDelegate", - "params": [ - { - "name": "domElement", - "description": "This new domElement which will receive mouse/touch events", - "type": "DOMElement" - } - ], - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 110, - "description": "Sets the background color for the stage", - "itemtype": "method", - "name": "setBackgroundColor", - "params": [ - { - "name": "backgroundColor", - "description": "the color of the background, easiest way to pass this in is in hex format\n like: 0xFFFFFF for white", - "type": "Number" - } - ], - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 126, - "description": "This will return the point containing global coordinates of the mouse.", - "itemtype": "method", - "name": "getMousePosition", - "return": { - "description": "A point containing the coordinates of the global InteractionData position.", - "type": "Point" - }, - "class": "Stage" - }, - { - "file": "src/pixi/extras/Rope.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "copyright": "Mat Groves, Rovanion Luckey", - "class": "Rope" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23\nbased on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi\n\nAwesome JS run time provided by EsotericSoftware\nhttps://github.com/EsotericSoftware/spine-runtimes", - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 213, - "description": "cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of", - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 506, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 513, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 520, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 528, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 535, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 542, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 577, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 585, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 600, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 604, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 611, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 618, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 625, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 637, - "description": "from the new skin are attached if the corresponding attachment from the old skin was attached.", - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 644, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 648, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 657, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 849, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 855, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 861, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 867, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 885, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 1310, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/", - "class": "Strip" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 20, - "description": "The texture of the strip", - "itemtype": "property", - "name": "texture", - "type": "Texture", - "class": "Strip" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 43, - "description": "Whether the strip is dirty or not", - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "class": "Strip" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 52, - "description": "if you need a padding, not yet implemented", - "itemtype": "property", - "name": "padding", - "type": "Number", - "class": "Strip" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 293, - "description": "Renders a flat strip", - "itemtype": "method", - "name": "renderStripFlat", - "params": [ - { - "name": "strip", - "description": "The Strip to render", - "type": "Strip" - } - ], - "access": "private", - "tagname": "", - "class": "Strip" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 341, - "description": "When the texture is updated, this event will fire to update the scale and frame", - "itemtype": "method", - "name": "onTextureUpdate", - "params": [ - { - "name": "event", - "description": "" - } - ], - "access": "private", - "tagname": "", - "class": "Strip" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 19, - "description": "The with of the tiling sprite", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 27, - "description": "The height of the tiling sprite", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 35, - "description": "The scaling of the image that is being tiled", - "itemtype": "property", - "name": "tileScale", - "type": "Point", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 43, - "description": "A point that represents the scale of the texture object", - "itemtype": "property", - "name": "tileScaleOffset", - "type": "Point", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 51, - "description": "The offset position of the image that is being tiled", - "itemtype": "property", - "name": "tilePosition", - "type": "Point", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 59, - "description": "Whether this sprite is renderable or not", - "itemtype": "property", - "name": "renderable", - "type": "Boolean", - "default": "true", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 68, - "description": "The tint applied to the sprite. This is a hex value", - "itemtype": "property", - "name": "tint", - "type": "Number", - "default": "0xFFFFFF", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 77, - "description": "The blend mode to be applied to the sprite", - "itemtype": "property", - "name": "blendMode", - "type": "Number", - "default": "PIXI.blendModes.NORMAL;", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 95, - "description": "The width of the sprite, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 111, - "description": "The height of the TilingSprite, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 137, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 194, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 280, - "description": "Returns the framing rectangle of the sprite as a PIXI.Rectangle object", - "itemtype": "method", - "name": "getBounds", - "return": { - "description": "the framing rectangle", - "type": "Rectangle" - }, - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 360, - "description": "When the texture is updated, this event will fire to update the scale and frame", - "itemtype": "method", - "name": "onTextureUpdate", - "params": [ - { - "name": "event", - "description": "" - } - ], - "access": "private", - "tagname": "", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 373, - "itemtype": "method", - "name": "generateTilingTexture", - "params": [ - { - "name": "forcePowerOfTwo", - "description": "Whether we want to force the texture to be a power of two", - "type": "Boolean" - } - ], - "class": "TilingSprite" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 15, - "description": "An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion.\nFor example the blur filter has two passes blurX and blurY.", - "itemtype": "property", - "name": "passes", - "type": "Array an array of filter objects", - "access": "private", - "tagname": "", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 24, - "itemtype": "property", - "name": "shaders", - "type": "Array an array of shaders", - "access": "private", - "tagname": "", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 31, - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 37, - "itemtype": "property", - "name": "padding", - "type": "Number", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 43, - "itemtype": "property", - "name": "uniforms", - "type": "object", - "access": "private", - "tagname": "", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 50, - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "access": "private", - "tagname": "", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 60, - "description": "Syncs the uniforms between the class object and the shaders.", - "itemtype": "method", - "name": "syncUniforms", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AlphaMaskFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "AlphaMaskFilter" - }, - { - "file": "src/pixi/filters/AlphaMaskFilter.js", - "line": 71, - "description": "Sets the map dimensions uniforms when the texture becomes available.", - "itemtype": "method", - "name": "onTextureLoaded", - "class": "AlphaMaskFilter" - }, - { - "file": "src/pixi/filters/AlphaMaskFilter.js", - "line": 84, - "description": "The texture used for the displacement map. Must be power of 2 sized texture.", - "itemtype": "property", - "name": "map", - "type": "Texture", - "class": "AlphaMaskFilter" - }, - { - "file": "src/pixi/filters/AsciiFilter.js", - "line": 1, - "author": "Vico @vicocotea\noriginal shader : https://www.shadertoy.com/view/lssGDj by @movAX13h", - "class": "AsciiFilter" - }, - { - "file": "src/pixi/filters/AsciiFilter.js", - "line": 73, - "description": "The pixel size used by the filter.", - "itemtype": "property", - "name": "size", - "type": "Number", - "class": "AsciiFilter" - }, - { - "file": "src/pixi/filters/BlurFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BlurFilter" - }, - { - "file": "src/pixi/filters/BlurFilter.js", - "line": 24, - "description": "Sets the strength of both the blurX and blurY properties simultaneously", - "itemtype": "property", - "name": "blur", - "type": "Number the strength of the blur", - "default": "2", - "class": "BlurFilter" - }, - { - "file": "src/pixi/filters/BlurFilter.js", - "line": 40, - "description": "Sets the strength of the blurX property", - "itemtype": "property", - "name": "blurX", - "type": "Number the strength of the blurX", - "default": "2", - "class": "BlurFilter" - }, - { - "file": "src/pixi/filters/BlurFilter.js", - "line": 56, - "description": "Sets the strength of the blurY property", - "itemtype": "property", - "name": "blurY", - "type": "Number the strength of the blurY", - "default": "2", - "class": "BlurFilter" - }, - { - "file": "src/pixi/filters/BlurXFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BlurXFilter" - }, - { - "file": "src/pixi/filters/BlurXFilter.js", - "line": 51, - "description": "Sets the strength of both the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number the strength of the blur", - "default": "2", - "class": "BlurXFilter" - }, - { - "file": "src/pixi/filters/BlurYFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BlurYFilter" - }, - { - "file": "src/pixi/filters/BlurYFilter.js", - "line": 51, - "description": "Sets the strength of both the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number the strength of the blur", - "default": "2", - "class": "BlurYFilter" - }, - { - "file": "src/pixi/filters/ColorMatrixFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "ColorMatrixFilter" - }, - { - "file": "src/pixi/filters/ColorMatrixFilter.js", - "line": 46, - "description": "Sets the matrix of the color matrix filter", - "itemtype": "property", - "name": "matrix", - "type": "Array and array of 26 numbers", - "default": "[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]", - "class": "ColorMatrixFilter" - }, - { - "file": "src/pixi/filters/ColorStepFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "ColorStepFilter" - }, - { - "file": "src/pixi/filters/ColorStepFilter.js", - "line": 41, - "description": "The number of steps to reduce the palette by.", - "itemtype": "property", - "name": "step", - "type": "Number", - "class": "ColorStepFilter" - }, - { - "file": "src/pixi/filters/ConvolutionFilter.js", - "line": 63, - "description": "An array of values used for matrix transformation. Specified as a 9 point Array.", - "itemtype": "property", - "name": "matrix", - "type": "Array", - "class": "ConvolutionFilter" - }, - { - "file": "src/pixi/filters/ConvolutionFilter.js", - "line": 78, - "description": "Width of the object you are transforming", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "ConvolutionFilter" - }, - { - "file": "src/pixi/filters/ConvolutionFilter.js", - "line": 93, - "description": "Height of the object you are transforming", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "ConvolutionFilter" - }, - { - "file": "src/pixi/filters/CrossHatchFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CrossHatchFilter" - }, - { - "file": "src/pixi/filters/CrossHatchFilter.js", - "line": 65, - "description": "Sets the strength of both the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number the strength of the blur", - "default": "2", - "class": "CrossHatchFilter" - }, - { - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "DisplacementFilter" - }, - { - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 78, - "description": "Sets the map dimensions uniforms when the texture becomes available.", - "itemtype": "method", - "name": "onTextureLoaded", - "class": "DisplacementFilter" - }, - { - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 91, - "description": "The texture used for the displacement map. Must be power of 2 texture.", - "itemtype": "property", - "name": "map", - "type": "Texture", - "class": "DisplacementFilter" - }, - { - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 106, - "description": "The multiplier used to scale the displacement result from the map calculation.", - "itemtype": "property", - "name": "scale", - "type": "Point", - "class": "DisplacementFilter" - }, - { - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 121, - "description": "The offset used to move the displacement map.", - "itemtype": "property", - "name": "offset", - "type": "Point", - "class": "DisplacementFilter" - }, - { - "file": "src/pixi/filters/DotScreenFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23\noriginal filter: https://github.com/evanw/glfx.js/blob/master/src/filters/fun/dotscreen.js", - "class": "DotScreenFilter" - }, - { - "file": "src/pixi/filters/DotScreenFilter.js", - "line": 57, - "description": "The scale of the effect.", - "itemtype": "property", - "name": "scale", - "type": "Number", - "class": "DotScreenFilter" - }, - { - "file": "src/pixi/filters/DotScreenFilter.js", - "line": 72, - "description": "The radius of the effect.", - "itemtype": "property", - "name": "angle", - "type": "Number", - "class": "DotScreenFilter" - }, - { - "file": "src/pixi/filters/FilterBlock.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "FilterBlock" - }, - { - "file": "src/pixi/filters/FilterBlock.js", - "line": 13, - "description": "The visible state of this FilterBlock.", - "itemtype": "property", - "name": "visible", - "type": "Boolean", - "class": "FilterBlock" - }, - { - "file": "src/pixi/filters/FilterBlock.js", - "line": 21, - "description": "The renderable state of this FilterBlock.", - "itemtype": "property", - "name": "renderable", - "type": "Boolean", - "class": "FilterBlock" - }, - { - "file": "src/pixi/filters/GrayFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "GrayFilter" - }, - { - "file": "src/pixi/filters/GrayFilter.js", - "line": 41, - "description": "The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color.", - "itemtype": "property", - "name": "gray", - "type": "Number", - "class": "GrayFilter" - }, - { - "file": "src/pixi/filters/InvertFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "InvertFilter" - }, - { - "file": "src/pixi/filters/InvertFilter.js", - "line": 42, - "description": "The strength of the invert. 1 will fully invert the colors, 0 will make the object its normal color", - "itemtype": "property", - "name": "invert", - "type": "Number", - "class": "InvertFilter" - }, - { - "file": "src/pixi/filters/NoiseFilter.js", - "line": 1, - "author": "Vico @vicocotea\noriginal filter: https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js", - "class": "NoiseFilter" - }, - { - "file": "src/pixi/filters/NoiseFilter.js", - "line": 49, - "description": "The amount of noise to apply.", - "itemtype": "property", - "name": "noise", - "type": "Number", - "class": "NoiseFilter" - }, - { - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "NormalMapFilter" - }, - { - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 140, - "description": "Sets the map dimensions uniforms when the texture becomes available.", - "itemtype": "method", - "name": "onTextureLoaded", - "class": "NormalMapFilter" - }, - { - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 153, - "description": "The texture used for the displacement map. Must be power of 2 texture.", - "itemtype": "property", - "name": "map", - "type": "Texture", - "class": "NormalMapFilter" - }, - { - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 168, - "description": "The multiplier used to scale the displacement result from the map calculation.", - "itemtype": "property", - "name": "scale", - "type": "Point", - "class": "NormalMapFilter" - }, - { - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 183, - "description": "The offset used to move the displacement map.", - "itemtype": "property", - "name": "offset", - "type": "Point", - "class": "NormalMapFilter" - }, - { - "file": "src/pixi/filters/PixelateFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "PixelateFilter" - }, - { - "file": "src/pixi/filters/PixelateFilter.js", - "line": 48, - "description": "This a point that describes the size of the blocks. x is the width of the block and y is the height.", - "itemtype": "property", - "name": "size", - "type": "Point", - "class": "PixelateFilter" - }, - { - "file": "src/pixi/filters/RGBSplitFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "RGBSplitFilter" - }, - { - "file": "src/pixi/filters/RGBSplitFilter.js", - "line": 48, - "description": "Red channel offset.", - "itemtype": "property", - "name": "red", - "type": "Point", - "class": "RGBSplitFilter" - }, - { - "file": "src/pixi/filters/RGBSplitFilter.js", - "line": 63, - "description": "Green channel offset.", - "itemtype": "property", - "name": "green", - "type": "Point", - "class": "RGBSplitFilter" - }, - { - "file": "src/pixi/filters/RGBSplitFilter.js", - "line": 78, - "description": "Blue offset.", - "itemtype": "property", - "name": "blue", - "type": "Point", - "class": "RGBSplitFilter" - }, - { - "file": "src/pixi/filters/SepiaFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "SepiaFilter" - }, - { - "file": "src/pixi/filters/SepiaFilter.js", - "line": 43, - "description": "The strength of the sepia. 1 will apply the full sepia effect, 0 will make the object its normal color.", - "itemtype": "property", - "name": "sepia", - "type": "Number", - "class": "SepiaFilter" - }, - { - "file": "src/pixi/filters/SmartBlurFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "SmartBlurFilter" - }, - { - "file": "src/pixi/filters/SmartBlurFilter.js", - "line": 61, - "description": "The strength of the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number the strength of the blur", - "default": "2", - "class": "SmartBlurFilter" - }, - { - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 1, - "author": "Vico @vicocotea\noriginal filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/", - "class": "TiltShiftFilter" - }, - { - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 24, - "description": "The strength of the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number", - "class": "TiltShiftFilter" - }, - { - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 39, - "description": "The strength of the gradient blur.", - "itemtype": "property", - "name": "gradientBlur", - "type": "Number", - "class": "TiltShiftFilter" - }, - { - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 54, - "description": "The Y value to start the effect at.", - "itemtype": "property", - "name": "start", - "type": "Number", - "class": "TiltShiftFilter" - }, - { - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 69, - "description": "The Y value to end the effect at.", - "itemtype": "property", - "name": "end", - "type": "Number", - "class": "TiltShiftFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 1, - "author": "Vico @vicocotea\noriginal filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 72, - "description": "The strength of the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 88, - "description": "The strength of the gradient blur.", - "itemtype": "property", - "name": "gradientBlur", - "type": "Number", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 104, - "description": "The X value to start the effect at.", - "itemtype": "property", - "name": "start", - "type": "Number", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 121, - "description": "The X value to end the effect at.", - "itemtype": "property", - "name": "end", - "type": "Number", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 138, - "description": "Updates the filter delta values.", - "itemtype": "method", - "name": "updateDelta", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 1, - "author": "Vico @vicocotea\noriginal filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 72, - "description": "The strength of the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 88, - "description": "The strength of the gradient blur.", - "itemtype": "property", - "name": "gradientBlur", - "type": "Number", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 104, - "description": "The Y value to start the effect at.", - "itemtype": "property", - "name": "start", - "type": "Number", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 121, - "description": "The Y value to end the effect at.", - "itemtype": "property", - "name": "end", - "type": "Number", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 138, - "description": "Updates the filter delta values.", - "itemtype": "method", - "name": "updateDelta", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TwistFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "TwistFilter" - }, - { - "file": "src/pixi/filters/TwistFilter.js", - "line": 56, - "description": "This point describes the the offset of the twist.", - "itemtype": "property", - "name": "offset", - "type": "Point", - "class": "TwistFilter" - }, - { - "file": "src/pixi/filters/TwistFilter.js", - "line": 72, - "description": "This radius of the twist.", - "itemtype": "property", - "name": "radius", - "type": "Number", - "class": "TwistFilter" - }, - { - "file": "src/pixi/filters/TwistFilter.js", - "line": 88, - "description": "This angle of the twist.", - "itemtype": "property", - "name": "angle", - "type": "Number", - "class": "TwistFilter" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 1, - "author": "Chad Engler ", - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 16, - "itemtype": "property", - "name": "x", - "type": "Number", - "default": "0", - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 23, - "itemtype": "property", - "name": "y", - "type": "Number", - "default": "0", - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 30, - "itemtype": "property", - "name": "radius", - "type": "Number", - "default": "0", - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 38, - "description": "Creates a clone of this Circle instance", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the Circle", - "type": "Circle" - }, - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 49, - "description": "Checks whether the x and y coordinates given are contained within this circle", - "itemtype": "method", - "name": "contains", - "params": [ - { - "name": "x", - "description": "The X coordinate of the point to test", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the point to test", - "type": "Number" - } - ], - "return": { - "description": "Whether the x/y coordinates are within this Circle", - "type": "Boolean" - }, - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 72, - "description": "Returns the framing rectangle of the circle as a PIXI.Rectangle object", - "itemtype": "method", - "name": "getBounds", - "return": { - "description": "the framing rectangle", - "type": "Rectangle" - }, - "class": "Circle" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 1, - "author": "Chad Engler ", - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 17, - "itemtype": "property", - "name": "x", - "type": "Number", - "default": "0", - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 24, - "itemtype": "property", - "name": "y", - "type": "Number", - "default": "0", - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 31, - "itemtype": "property", - "name": "width", - "type": "Number", - "default": "0", - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 38, - "itemtype": "property", - "name": "height", - "type": "Number", - "default": "0", - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 46, - "description": "Creates a clone of this Ellipse instance", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the ellipse", - "type": "Ellipse" - }, - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 57, - "description": "Checks whether the x and y coordinates given are contained within this ellipse", - "itemtype": "method", - "name": "contains", - "params": [ - { - "name": "x", - "description": "The X coordinate of the point to test", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the point to test", - "type": "Number" - } - ], - "return": { - "description": "Whether the x/y coords are within this ellipse", - "type": "Boolean" - }, - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 80, - "description": "Returns the framing rectangle of the ellipse as a PIXI.Rectangle object", - "itemtype": "method", - "name": "getBounds", - "return": { - "description": "the framing rectangle", - "type": "Rectangle" - }, - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 17, - "itemtype": "property", - "name": "a", - "type": "Number", - "default": "1", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 24, - "itemtype": "property", - "name": "b", - "type": "Number", - "default": "0", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 31, - "itemtype": "property", - "name": "c", - "type": "Number", - "default": "0", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 38, - "itemtype": "property", - "name": "d", - "type": "Number", - "default": "1", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 45, - "itemtype": "property", - "name": "tx", - "type": "Number", - "default": "0", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 52, - "itemtype": "property", - "name": "ty", - "type": "Number", - "default": "0", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 60, - "description": "Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:\n\na = array[0]\nb = array[1]\nc = array[3]\nd = array[4]\ntx = array[2]\nty = array[5]", - "itemtype": "method", - "name": "fromArray", - "params": [ - { - "name": "array", - "description": "The array that the matrix will be populated from.", - "type": "Array" - } - ], - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 83, - "description": "Creates an array from the current Matrix object.", - "itemtype": "method", - "name": "toArray", - "params": [ - { - "name": "transpose", - "description": "Whether we need to transpose the matrix or not", - "type": "Boolean" - } - ], - "return": { - "description": "the newly created array which contains the matrix", - "type": "Array" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 123, - "description": "Get a new position with the current transformation applied.\nCan be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)", - "itemtype": "method", - "name": "apply", - "params": [ - { - "name": "pos", - "description": "The origin", - "type": "Point" - }, - { - "name": "newPos", - "description": "The point that the new position is assigned to (allowed to be same as input)", - "type": "Point", - "optional": true - } - ], - "return": { - "description": "The new point, transformed through this matrix", - "type": "Point" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 142, - "description": "Get a new position with the inverse of the current transformation applied.\nCan be used to go from the world coordinate space to a child's coordinate space. (e.g. input)", - "itemtype": "method", - "name": "applyInverse", - "params": [ - { - "name": "pos", - "description": "The origin", - "type": "Point" - }, - { - "name": "newPos", - "description": "The point that the new position is assigned to (allowed to be same as input)", - "type": "Point", - "optional": true - } - ], - "return": { - "description": "The new point, inverse-transformed through this matrix", - "type": "Point" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 163, - "description": "Translates the matrix on the x and y.", - "itemtype": "method", - "name": "translate", - "params": [ - { - "name": "x", - "description": "", - "type": "Number" - }, - { - "name": "y", - "description": "", - "type": "Number" - } - ], - "return": { - "description": "This matrix. Good for chaining method calls.", - "type": "Matrix" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 179, - "description": "Applies a scale transformation to the matrix.", - "itemtype": "method", - "name": "scale", - "params": [ - { - "name": "x", - "description": "The amount to scale horizontally", - "type": "Number" - }, - { - "name": "y", - "description": "The amount to scale vertically", - "type": "Number" - } - ], - "return": { - "description": "This matrix. Good for chaining method calls.", - "type": "Matrix" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 200, - "description": "Applies a rotation transformation to the matrix.", - "itemtype": "method", - "name": "rotate", - "params": [ - { - "name": "angle", - "description": "The angle in radians.", - "type": "Number" - } - ], - "return": { - "description": "This matrix. Good for chaining method calls.", - "type": "Matrix" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 225, - "description": "Appends the given Matrix to this Matrix.", - "itemtype": "method", - "name": "append", - "params": [ - { - "name": "matrix", - "description": "", - "type": "Matrix" - } - ], - "return": { - "description": "This matrix. Good for chaining method calls.", - "type": "Matrix" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 250, - "description": "Resets this Matix to an identity (default) matrix.", - "itemtype": "method", - "name": "identity", - "return": { - "description": "This matrix. Good for chaining method calls.", - "type": "Matrix" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Point.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Point" - }, - { - "file": "src/pixi/geom/Point.js", - "line": 15, - "itemtype": "property", - "name": "x", - "type": "Number", - "default": "0", - "class": "Point" - }, - { - "file": "src/pixi/geom/Point.js", - "line": 22, - "itemtype": "property", - "name": "y", - "type": "Number", - "default": "0", - "class": "Point" - }, - { - "file": "src/pixi/geom/Point.js", - "line": 30, - "description": "Creates a clone of this point", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the point", - "type": "Point" - }, - "class": "Point" - }, - { - "file": "src/pixi/geom/Point.js", - "line": 41, - "description": "Sets the point to a new x and y position.\nIf y is omitted, both x and y will be set to x.", - "itemtype": "method", - "name": "set", - "params": [ - { - "name": "x", - "description": "position of the point on the x axis", - "type": "Number", - "optional": true, - "optdefault": "0" - }, - { - "name": "y", - "description": "position of the point on the y axis", - "type": "Number", - "optional": true, - "optdefault": "0" - } - ], - "class": "Point" - }, - { - "file": "src/pixi/geom/Polygon.js", - "line": 1, - "author": "Adrien Brault ", - "class": "Polygon" - }, - { - "file": "src/pixi/geom/Polygon.js", - "line": 35, - "description": "Creates a clone of this polygon", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the polygon", - "type": "Polygon" - }, - "class": "Polygon" - }, - { - "file": "src/pixi/geom/Polygon.js", - "line": 47, - "description": "Checks whether the x and y coordinates passed to this function are contained within this polygon", - "itemtype": "method", - "name": "contains", - "params": [ - { - "name": "x", - "description": "The X coordinate of the point to test", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the point to test", - "type": "Number" - } - ], - "return": { - "description": "Whether the x/y coordinates are within this polygon", - "type": "Boolean" - }, - "class": "Polygon" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/", - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 17, - "itemtype": "property", - "name": "x", - "type": "Number", - "default": "0", - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 24, - "itemtype": "property", - "name": "y", - "type": "Number", - "default": "0", - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 31, - "itemtype": "property", - "name": "width", - "type": "Number", - "default": "0", - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 38, - "itemtype": "property", - "name": "height", - "type": "Number", - "default": "0", - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 46, - "description": "Creates a clone of this Rectangle", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the rectangle", - "type": "Rectangle" - }, - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 57, - "description": "Checks whether the x and y coordinates given are contained within this Rectangle", - "itemtype": "method", - "name": "contains", - "params": [ - { - "name": "x", - "description": "The X coordinate of the point to test", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the point to test", - "type": "Number" - } - ], - "return": { - "description": "Whether the x/y coordinates are within this Rectangle", - "type": "Boolean" - }, - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 18, - "itemtype": "property", - "name": "x", - "type": "Number", - "default": "0", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 25, - "itemtype": "property", - "name": "y", - "type": "Number", - "default": "0", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 32, - "itemtype": "property", - "name": "width", - "type": "Number", - "default": "0", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 39, - "itemtype": "property", - "name": "height", - "type": "Number", - "default": "0", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 46, - "itemtype": "property", - "name": "radius", - "type": "Number", - "default": "20", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 54, - "description": "Creates a clone of this Rounded Rectangle", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the rounded rectangle", - "type": "Rounded Rectangle" - }, - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 65, - "description": "Checks whether the x and y coordinates given are contained within this Rounded Rectangle", - "itemtype": "method", - "name": "contains", - "params": [ - { - "name": "x", - "description": "The X coordinate of the point to test", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the point to test", - "type": "Number" - } - ], - "return": { - "description": "Whether the x/y coordinates are within this Rounded Rectangle", - "type": "Boolean" - }, - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 23, - "description": "The array of asset URLs that are going to be loaded", - "itemtype": "property", - "name": "assetURLs", - "type": "Array", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 31, - "description": "Whether the requests should be treated as cross origin", - "itemtype": "property", - "name": "crossorigin", - "type": "Boolean", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 39, - "description": "Maps file extension to loader types", - "itemtype": "property", - "name": "loadersByType", - "type": "Object", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 61, - "description": "Fired when an item has loaded", - "itemtype": "event", - "name": "onProgress", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 66, - "description": "Fired when all the assets have loaded", - "itemtype": "event", - "name": "onComplete", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 74, - "description": "Given a filename, returns its extension.", - "itemtype": "method", - "name": "_getDataType", - "params": [ - { - "name": "str", - "description": "the name of the asset", - "type": "String" - } - ], - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 107, - "description": "Starts loading the assets sequentially", - "itemtype": "method", - "name": "load", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 143, - "description": "Invoked after each file is loaded", - "itemtype": "method", - "name": "onAssetLoaded", - "access": "private", - "tagname": "", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 1, - "author": "Martin Kelm http://mkelm.github.com", - "class": "AtlasLoader" - }, - { - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 32, - "description": "Starts loading the JSON file", - "itemtype": "method", - "name": "load", - "class": "AtlasLoader" - }, - { - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 46, - "description": "Invoked when the Atlas has fully loaded. Parses the JSON and builds the texture frames.", - "itemtype": "method", - "name": "onAtlasLoaded", - "access": "private", - "tagname": "", - "class": "AtlasLoader" - }, - { - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 166, - "description": "Invoked when json file has loaded.", - "itemtype": "method", - "name": "onLoaded", - "access": "private", - "tagname": "", - "class": "AtlasLoader" - }, - { - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 182, - "description": "Invoked when an error occurs.", - "itemtype": "method", - "name": "onError", - "access": "private", - "tagname": "", - "class": "AtlasLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 19, - "description": "The url of the bitmap font data", - "itemtype": "property", - "name": "url", - "type": "String", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 27, - "description": "Whether the requests should be treated as cross origin", - "itemtype": "property", - "name": "crossorigin", - "type": "Boolean", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 35, - "description": "[read-only] The base url of the bitmap font data", - "itemtype": "property", - "name": "baseUrl", - "type": "String", - "readonly": "", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 44, - "description": "[read-only] The texture of the bitmap font", - "itemtype": "property", - "name": "texture", - "type": "Texture", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 57, - "description": "Loads the XML font data", - "itemtype": "method", - "name": "load", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 72, - "description": "Invoked when the XML file is loaded, parses the data.", - "itemtype": "method", - "name": "onXMLLoaded", - "access": "private", - "tagname": "", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 152, - "description": "Invoked when all files are loaded (xml/fnt and texture)", - "itemtype": "method", - "name": "onLoaded", - "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": 18, - "description": "The texture being loaded", - "itemtype": "property", - "name": "texture", - "type": "Texture", - "class": "ImageLoader" - }, - { - "file": "src/pixi/loaders/ImageLoader.js", - "line": 26, - "description": "if the image is loaded with loadFramedSpriteSheet\nframes will contain the sprite sheet frames", - "itemtype": "property", - "name": "frames", - "type": "Array", - "readonly": "", - "class": "ImageLoader" - }, - { - "file": "src/pixi/loaders/ImageLoader.js", - "line": 42, - "description": "Loads image or takes it from cache", - "itemtype": "method", - "name": "load", - "class": "ImageLoader" - }, - { - "file": "src/pixi/loaders/ImageLoader.js", - "line": 59, - "description": "Invoked when image file is loaded or it is already cached and ready to use", - "itemtype": "method", - "name": "onLoaded", - "access": "private", - "tagname": "", - "class": "ImageLoader" - }, - { - "file": "src/pixi/loaders/ImageLoader.js", - "line": 70, - "description": "Loads image and split it to uniform sized frames", - "itemtype": "method", - "name": "loadFramedSpriteSheet", - "params": [ - { - "name": "frameWidth", - "description": "width of each frame", - "type": "Number" - }, - { - "name": "frameHeight", - "description": "height of each frame", - "type": "Number" - }, - { - "name": "textureName", - "description": "if given, the frames will be cached in - format", - "type": "String" - } - ], - "class": "ImageLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 18, - "description": "The url of the bitmap font data", - "itemtype": "property", - "name": "url", - "type": "String", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 26, - "description": "Whether the requests should be treated as cross origin", - "itemtype": "property", - "name": "crossorigin", - "type": "Boolean", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 34, - "description": "[read-only] The base url of the bitmap font data", - "itemtype": "property", - "name": "baseUrl", - "type": "String", - "readonly": "", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 43, - "description": "[read-only] Whether the data has loaded yet", - "itemtype": "property", - "name": "loaded", - "type": "Boolean", - "readonly": "", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 59, - "description": "Loads the JSON data", - "itemtype": "method", - "name": "load", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 98, - "description": "Invoked when the JSON file is loaded.", - "itemtype": "method", - "name": "onJSONLoaded", - "access": "private", - "tagname": "", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 162, - "description": "Invoked when the json file has loaded.", - "itemtype": "method", - "name": "onLoaded", - "access": "private", - "tagname": "", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 176, - "description": "Invoked if an error occurs.", - "itemtype": "method", - "name": "onError", - "access": "private", - "tagname": "", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23\nbased on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi\n\nAwesome JS run time provided by EsotericSoftware\nhttps://github.com/EsotericSoftware/spine-runtimes", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 26, - "description": "The url of the bitmap font data", - "itemtype": "property", - "name": "url", - "type": "String", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 34, - "description": "Whether the requests should be treated as cross origin", - "itemtype": "property", - "name": "crossorigin", - "type": "Boolean", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 42, - "description": "[read-only] Whether the data has loaded yet", - "itemtype": "property", - "name": "loaded", - "type": "Boolean", - "readonly": "", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 56, - "description": "Loads the JSON data", - "itemtype": "method", - "name": "load", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 72, - "description": "Invoked when JSON file is loaded.", - "itemtype": "method", - "name": "onLoaded", - "access": "private", - "tagname": "", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 22, - "description": "The url of the atlas data", - "itemtype": "property", - "name": "url", - "type": "String", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 30, - "description": "Whether the requests should be treated as cross origin", - "itemtype": "property", - "name": "crossorigin", - "type": "Boolean", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 38, - "description": "[read-only] The base url of the bitmap font data", - "itemtype": "property", - "name": "baseUrl", - "type": "String", - "readonly": "", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 47, - "description": "The texture being loaded", - "itemtype": "property", - "name": "texture", - "type": "Texture", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 55, - "description": "The frames of the sprite sheet", - "itemtype": "property", - "name": "frames", - "type": "Object", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 69, - "description": "This will begin loading the JSON file", - "itemtype": "method", - "name": "load", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 84, - "description": "Invoke when all files are loaded (json and texture)", - "itemtype": "method", - "name": "onLoaded", - "access": "private", - "tagname": "", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 18, - "description": "The alpha value used when filling the Graphics object.", - "itemtype": "property", - "name": "fillAlpha", - "type": "Number", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 26, - "description": "The width (thickness) of any lines drawn.", - "itemtype": "property", - "name": "lineWidth", - "type": "Number", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 34, - "description": "The color of any lines drawn.", - "itemtype": "property", - "name": "lineColor", - "type": "String", - "default": "0", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 43, - "description": "Graphics data", - "itemtype": "property", - "name": "graphicsData", - "type": "Array", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 52, - "description": "The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint.", - "itemtype": "property", - "name": "tint", - "type": "Number", - "default": "0xFFFFFF", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 61, - "description": "The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode.", - "itemtype": "property", - "name": "blendMode", - "type": "Number", - "default": "PIXI.blendModes.NORMAL;", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 70, - "description": "Current path", - "itemtype": "property", - "name": "currentPath", - "type": "Object", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 79, - "description": "Array containing some WebGL-related properties used by the WebGL renderer.", - "itemtype": "property", - "name": "_webGL", - "type": "Array", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 88, - "description": "Whether this shape is being used as a mask.", - "itemtype": "property", - "name": "isMask", - "type": "Boolean", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 96, - "description": "The bounds' padding used for bounds calculation.", - "itemtype": "property", - "name": "boundsPadding", - "type": "Number", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 106, - "description": "Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated.", - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 115, - "description": "Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated.", - "itemtype": "property", - "name": "webGLDirty", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 124, - "description": "Used to detect if the cached sprite object needs to be updated.", - "itemtype": "property", - "name": "cachedSpriteDirty", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 139, - "description": "When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite.\nThis is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory.\nIt is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas.\nThis is not recommended if you are constantly redrawing the graphics element.", - "itemtype": "property", - "name": "cacheAsBitmap", - "type": "Boolean", - "default": "false", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 171, - "description": "Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.", - "itemtype": "method", - "name": "lineStyle", - "params": [ - { - "name": "lineWidth", - "description": "width of the line to draw, will update the objects stored style", - "type": "Number" - }, - { - "name": "color", - "description": "color of the line to draw, will update the objects stored style", - "type": "Number" - }, - { - "name": "alpha", - "description": "alpha of the line to draw, will update the objects stored style", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 205, - "description": "Moves the current drawing position to x, y.", - "itemtype": "method", - "name": "moveTo", - "params": [ - { - "name": "x", - "description": "the X coordinate to move to", - "type": "Number" - }, - { - "name": "y", - "description": "the Y coordinate to move to", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 220, - "description": "Draws a line using the current line style from the current drawing position to (x, y);\nThe current drawing position is then set to (x, y).", - "itemtype": "method", - "name": "lineTo", - "params": [ - { - "name": "x", - "description": "the X coordinate to draw to", - "type": "Number" - }, - { - "name": "y", - "description": "the Y coordinate to draw to", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 237, - "description": "Calculate the points for a quadratic bezier curve and then draws it.\nBased on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c", - "itemtype": "method", - "name": "quadraticCurveTo", - "params": [ - { - "name": "cpX", - "description": "Control point x", - "type": "Number" - }, - { - "name": "cpY", - "description": "Control point y", - "type": "Number" - }, - { - "name": "toX", - "description": "Destination point x", - "type": "Number" - }, - { - "name": "toY", - "description": "Destination point y", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 287, - "description": "Calculate the points for a bezier curve and then draws it.", - "itemtype": "method", - "name": "bezierCurveTo", - "params": [ - { - "name": "cpX", - "description": "Control point x", - "type": "Number" - }, - { - "name": "cpY", - "description": "Control point y", - "type": "Number" - }, - { - "name": "cpX2", - "description": "Second Control point x", - "type": "Number" - }, - { - "name": "cpY2", - "description": "Second Control point y", - "type": "Number" - }, - { - "name": "toX", - "description": "Destination point x", - "type": "Number" - }, - { - "name": "toY", - "description": "Destination point y", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 414, - "description": "The arc method creates an arc/curve (used to create circles, or parts of circles).", - "itemtype": "method", - "name": "arc", - "params": [ - { - "name": "cx", - "description": "The x-coordinate of the center of the circle", - "type": "Number" - }, - { - "name": "cy", - "description": "The y-coordinate of the center of the circle", - "type": "Number" - }, - { - "name": "radius", - "description": "The radius of the circle", - "type": "Number" - }, - { - "name": "startAngle", - "description": "The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle)", - "type": "Number" - }, - { - "name": "endAngle", - "description": "The ending angle, in radians", - "type": "Number" - }, - { - "name": "anticlockwise", - "description": "Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise.", - "type": "Boolean" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 488, - "description": "Specifies a simple one-color fill that subsequent calls to other Graphics methods\n(such as lineTo() or drawCircle()) use when drawing.", - "itemtype": "method", - "name": "beginFill", - "params": [ - { - "name": "color", - "description": "the color of the fill", - "type": "Number" - }, - { - "name": "alpha", - "description": "the alpha of the fill", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 515, - "description": "Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.", - "itemtype": "method", - "name": "endFill", - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 530, - "itemtype": "method", - "name": "drawRect", - "params": [ - { - "name": "x", - "description": "The X coord of the top-left of the rectangle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coord of the top-left of the rectangle", - "type": "Number" - }, - { - "name": "width", - "description": "The width of the rectangle", - "type": "Number" - }, - { - "name": "height", - "description": "The height of the rectangle", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 546, - "itemtype": "method", - "name": "drawRoundedRect", - "params": [ - { - "name": "x", - "description": "The X coord of the top-left of the rectangle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coord of the top-left of the rectangle", - "type": "Number" - }, - { - "name": "width", - "description": "The width of the rectangle", - "type": "Number" - }, - { - "name": "height", - "description": "The height of the rectangle", - "type": "Number" - }, - { - "name": "radius", - "description": "Radius of the rectangle corners", - "type": "Number" - } - ], - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 562, - "description": "Draws a circle.", - "itemtype": "method", - "name": "drawCircle", - "params": [ - { - "name": "x", - "description": "The X coordinate of the center of the circle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the center of the circle", - "type": "Number" - }, - { - "name": "radius", - "description": "The radius of the circle", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 578, - "description": "Draws an ellipse.", - "itemtype": "method", - "name": "drawEllipse", - "params": [ - { - "name": "x", - "description": "The X coordinate of the center of the ellipse", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the center of the ellipse", - "type": "Number" - }, - { - "name": "width", - "description": "The half width of the ellipse", - "type": "Number" - }, - { - "name": "height", - "description": "The half height of the ellipse", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 595, - "description": "Draws a polygon using the given path.", - "itemtype": "method", - "name": "drawPolygon", - "params": [ - { - "name": "path", - "description": "The path data used to construct the polygon.", - "type": "Array" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 609, - "description": "Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.", - "itemtype": "method", - "name": "clear", - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 627, - "description": "Useful function that returns a texture of the graphics object that can then be used to create sprites\nThis can be quite useful if your geometry is complicated and needs to be reused multiple times.", - "itemtype": "method", - "name": "generateTexture", - "params": [ - { - "name": "resolution", - "description": "The resolution of the texture being generated", - "type": "Number" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ], - "return": { - "description": "a texture of the graphics object", - "type": "Texture" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 656, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 736, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 805, - "description": "Retrieves the bounds of the graphic shape as a rectangle object", - "itemtype": "method", - "name": "getBounds", - "return": { - "description": "the rectangular bounding area", - "type": "Rectangle" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 884, - "description": "Update the bounds of the object", - "itemtype": "method", - "name": "updateLocalBounds", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 983, - "description": "Generates the cached sprite when the sprite has cacheAsBitmap = true", - "itemtype": "method", - "name": "_generateCachedSprite", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 1023, - "description": "Updates texture size based on canvas size", - "itemtype": "method", - "name": "updateCachedSpriteTexture", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 1047, - "description": "Destroys a previous cached sprite.", - "itemtype": "method", - "name": "destroyCachedSprite", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 1061, - "description": "Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.", - "itemtype": "method", - "name": "drawShape", - "params": [ - { - "name": "shape", - "description": "The Shape object to draw.", - "type": "Circle|Rectangle|Ellipse|Line|Polygon" - } - ], - "return": { - "description": "The generated GraphicsData object.", - "type": "GraphicsData" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 15, - "description": "The width of the Canvas in pixels.", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 23, - "description": "The height of the Canvas in pixels.", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 31, - "description": "The Canvas object that belongs to this CanvasBuffer.", - "itemtype": "property", - "name": "canvas", - "type": "HTMLCanvasElement", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 39, - "description": "A CanvasRenderingContext2D object representing a two-dimensional rendering context.", - "itemtype": "property", - "name": "context", - "type": "CanvasRenderingContext2D", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 53, - "description": "Clears the canvas that was created by the CanvasBuffer class.", - "itemtype": "method", - "name": "clear", - "access": "private", - "tagname": "", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 65, - "description": "Resizes the canvas to the specified width and height.", - "itemtype": "method", - "name": "resize", - "params": [ - { - "name": "width", - "description": "the new width of the canvas", - "type": "Number" - }, - { - "name": "height", - "description": "the new height of the canvas", - "type": "Number" - } - ], - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasMaskManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CanvasMaskManager" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasMaskManager.js", - "line": 17, - "description": "This method adds it to the current stack of masks.", - "itemtype": "method", - "name": "pushMask", - "params": [ - { - "name": "maskData", - "description": "the maskData that will be pushed", - "type": "Object" - }, - { - "name": "renderSession", - "description": "The renderSession whose context will be used for this mask manager.", - "type": "Object" - } - ], - "class": "CanvasMaskManager" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasMaskManager.js", - "line": 49, - "description": "Restores the current drawing context to the state it was before the mask was applied.", - "itemtype": "method", - "name": "popMask", - "params": [ - { - "name": "renderSession", - "description": "The renderSession whose context will be used for this mask manager.", - "type": "Object" - } - ], - "class": "CanvasMaskManager" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 14, - "description": "Basically this method just needs a sprite and a color and tints the sprite with the given color.", - "itemtype": "method", - "name": "getTintedTexture", - "params": [ - { - "name": "sprite", - "description": "the sprite to tint", - "type": "Sprite" - }, - { - "name": "color", - "description": "the color to use to tint the sprite with", - "type": "Number" - } - ], - "return": { - "description": "The tinted canvas", - "type": "HTMLCanvasElement" - }, - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 58, - "description": "Tint a texture using the \"multiply\" operation.", - "itemtype": "method", - "name": "tintWithMultiply", - "params": [ - { - "name": "texture", - "description": "the texture to tint", - "type": "Texture" - }, - { - "name": "color", - "description": "the color to use to tint the sprite with", - "type": "Number" - }, - { - "name": "canvas", - "description": "the current canvas", - "type": "HTMLCanvasElement" - } - ], - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 104, - "description": "Tint a texture using the \"overlay\" operation.", - "itemtype": "method", - "name": "tintWithOverlay", - "params": [ - { - "name": "texture", - "description": "the texture to tint", - "type": "Texture" - }, - { - "name": "color", - "description": "the color to use to tint the sprite with", - "type": "Number" - }, - { - "name": "canvas", - "description": "the current canvas", - "type": "HTMLCanvasElement" - } - ], - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 139, - "description": "Tint a texture pixel per pixel.", - "itemtype": "method", - "name": "tintPerPixel", - "params": [ - { - "name": "texture", - "description": "the texture to tint", - "type": "Texture" - }, - { - "name": "color", - "description": "the color to use to tint the sprite with", - "type": "Number" - }, - { - "name": "canvas", - "description": "the current canvas", - "type": "HTMLCanvasElement" - } - ], - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 184, - "description": "Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel.", - "itemtype": "method", - "name": "roundColor", - "params": [ - { - "name": "color", - "description": "the color to round, should be a hex color", - "type": "Number" - } - ], - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 203, - "description": "Number of steps which will be used as a cap when rounding colors.", - "itemtype": "property", - "name": "cacheStepsPerColorChannel", - "type": "Number", - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 211, - "description": "Tint cache boolean flag.", - "itemtype": "property", - "name": "convertTintToImage", - "type": "Boolean", - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 219, - "description": "Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method.", - "itemtype": "property", - "name": "canUseMultiply", - "type": "Boolean", - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 227, - "description": "The tinting method that will be used.", - "itemtype": "method", - "name": "tintMethod", - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/CanvasGraphics.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CanvasGraphics" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 40, - "description": "The renderer type.", - "itemtype": "property", - "name": "type", - "type": "Number", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 48, - "description": "The resolution of the canvas.", - "itemtype": "property", - "name": "resolution", - "type": "Number", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 56, - "description": "This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\nIf the Stage is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\nIf the Stage is transparent Pixi will use clearRect to clear the canvas every frame.\nDisable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.", - "itemtype": "property", - "name": "clearBeforeRender", - "type": "Boolean", - "default": "", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 68, - "description": "Whether the render view is transparent", - "itemtype": "property", - "name": "transparent", - "type": "Boolean", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 76, - "description": "Whether the render view should be resized automatically", - "itemtype": "property", - "name": "autoResize", - "type": "Boolean", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 85, - "description": "The width of the canvas view", - "itemtype": "property", - "name": "width", - "type": "Number", - "default": "800", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 94, - "description": "The height of the canvas view", - "itemtype": "property", - "name": "height", - "type": "Number", - "default": "600", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 106, - "description": "The canvas element that everything is drawn to.", - "itemtype": "property", - "name": "view", - "type": "HTMLCanvasElement", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 114, - "description": "The canvas 2d context that everything is drawn with", - "itemtype": "property", - "name": "context", - "type": "CanvasRenderingContext2D", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 121, - "description": "Boolean flag controlling canvas refresh.", - "itemtype": "property", - "name": "refresh", - "type": "Boolean", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 132, - "description": "Internal var.", - "itemtype": "property", - "name": "count", - "type": "Number", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 140, - "description": "Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer", - "itemtype": "property", - "name": "CanvasMaskManager", - "type": "CanvasMaskManager", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 147, - "description": "The render session is just a bunch of parameter used for rendering", - "itemtype": "property", - "name": "renderSession", - "type": "Object", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 157, - "description": "If true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation.\nHandy for crisp pixel art and speed on legacy devices.", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 184, - "description": "Renders the Stage to this canvas view", - "itemtype": "method", - "name": "render", - "params": [ - { - "name": "stage", - "description": "the Stage element to be rendered", - "type": "Stage" - } - ], - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 233, - "description": "Removes everything from the renderer and optionally removes the Canvas DOM element.", - "itemtype": "method", - "name": "destroy", - "params": [ - { - "name": "removeView", - "description": "Removes the Canvas element from the DOM.", - "type": "Boolean", - "optional": true, - "optdefault": "true" - } - ], - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 255, - "description": "Resizes the canvas view to the specified width and height", - "itemtype": "method", - "name": "resize", - "params": [ - { - "name": "width", - "description": "the new width of the canvas view", - "type": "Number" - }, - { - "name": "height", - "description": "the new height of the canvas view", - "type": "Number" - } - ], - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 276, - "description": "Renders a display object", - "itemtype": "method", - "name": "renderDisplayObject", - "params": [ - { - "name": "displayObject", - "description": "The displayObject to render", - "type": "DisplayObject" - }, - { - "name": "context", - "description": "the context 2d method of the canvas", - "type": "CanvasRenderingContext2D" - } - ], - "access": "private", - "tagname": "", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 291, - "description": "Maps Pixi blend modes to canvas blend modes.", - "itemtype": "method", - "name": "mapBlendModes", - "access": "private", - "tagname": "", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 12, - "itemtype": "property", - "name": "_UID", - "type": "Number", - "access": "private", - "tagname": "", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 19, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 25, - "description": "The WebGL program.", - "itemtype": "property", - "name": "program", - "type": "{Any}", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 32, - "description": "The fragment shader.", - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 48, - "description": "The vertex shader.", - "itemtype": "property", - "name": "vertexSrc", - "type": "Array", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 79, - "description": "Initialises the shader.", - "itemtype": "method", - "name": "init", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 109, - "description": "Destroys the shader.", - "itemtype": "method", - "name": "destroy", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 12, - "itemtype": "property", - "name": "_UID", - "type": "Number", - "access": "private", - "tagname": "", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 19, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 25, - "description": "The WebGL program.", - "itemtype": "property", - "name": "program", - "type": "{Any}", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 32, - "description": "The fragment shader.", - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 47, - "description": "The vertex shader.", - "itemtype": "property", - "name": "vertexSrc", - "type": "Array", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 82, - "description": "A local texture counter for multi-texture shaders.", - "itemtype": "property", - "name": "textureCount", - "type": "Number", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 94, - "description": "Initialises the shader.", - "itemtype": "method", - "name": "init", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 143, - "description": "Destroys the shader.", - "itemtype": "method", - "name": "destroy", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 1, - "author": "Richard Davey http://www.photonstorm.com @photonstorm", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 13, - "itemtype": "property", - "name": "_UID", - "type": "Number", - "access": "private", - "tagname": "", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 20, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 26, - "description": "The WebGL program.", - "itemtype": "property", - "name": "program", - "type": "{Any}", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 33, - "description": "The fragment shader.", - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 48, - "description": "A local texture counter for multi-texture shaders.", - "itemtype": "property", - "name": "textureCount", - "type": "Number", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 55, - "description": "A local flag", - "itemtype": "property", - "name": "firstRun", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 63, - "description": "A dirty flag", - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 70, - "description": "Uniform attributes cache.", - "itemtype": "property", - "name": "attributes", - "type": "Array", - "access": "private", - "tagname": "", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 83, - "description": "Initialises the shader.", - "itemtype": "method", - "name": "init", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 134, - "description": "Initialises the shader uniform values.\n\nUniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/\nhttp://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf", - "itemtype": "method", - "name": "initUniforms", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 208, - "description": "Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded)", - "itemtype": "method", - "name": "initSampler2D", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 283, - "description": "Updates the shader uniform values.", - "itemtype": "method", - "name": "syncUniforms", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 351, - "description": "Destroys the shader.", - "itemtype": "method", - "name": "destroy", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 365, - "description": "The Default Vertex shader source.", - "itemtype": "property", - "name": "defaultVertexSrc", - "type": "String", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 12, - "itemtype": "property", - "name": "_UID", - "type": "Number", - "access": "private", - "tagname": "", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 19, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 25, - "description": "The WebGL program.", - "itemtype": "property", - "name": "program", - "type": "{Any}", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 32, - "description": "The fragment shader.", - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 46, - "description": "The vertex shader.", - "itemtype": "property", - "name": "vertexSrc", - "type": "Array", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 74, - "description": "Initialises the shader.", - "itemtype": "method", - "name": "init", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 103, - "description": "Destroys the shader.", - "itemtype": "method", - "name": "destroy", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 12, - "itemtype": "property", - "name": "_UID", - "type": "Number", - "access": "private", - "tagname": "", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 19, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 25, - "description": "The WebGL program.", - "itemtype": "property", - "name": "program", - "type": "{Any}", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 32, - "description": "The fragment shader.", - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 50, - "description": "The vertex shader.", - "itemtype": "property", - "name": "vertexSrc", - "type": "Array", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 80, - "description": "Initialises the shader.", - "itemtype": "method", - "name": "init", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 111, - "description": "Destroys the shader.", - "itemtype": "method", - "name": "destroy", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 15, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 23, - "itemtype": "property", - "name": "frameBuffer", - "type": "Any", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 29, - "itemtype": "property", - "name": "texture", - "type": "Any", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 35, - "itemtype": "property", - "name": "scaleMode", - "type": "Number", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 61, - "description": "Clears the filter texture.", - "itemtype": "method", - "name": "clear", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 74, - "description": "Resizes the texture to the specified width and height", - "itemtype": "method", - "name": "resize", - "params": [ - { - "name": "width", - "description": "the new width of the texture", - "type": "Number" - }, - { - "name": "height", - "description": "the new height of the texture", - "type": "Number" - } - ], - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 97, - "description": "Destroys the filter texture.", - "itemtype": "method", - "name": "destroy", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLBlendModeManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 12, - "itemtype": "property", - "name": "currentBlendMode", - "type": "Number", - "class": "WebGLBlendModeManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 21, - "description": "Sets the WebGL Context.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLBlendModeManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 32, - "description": "Sets-up the given blendMode from WebGL's point of view.", - "itemtype": "method", - "name": "setBlendMode", - "params": [ - { - "name": "blendMode", - "description": "the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD", - "type": "Number" - } - ], - "class": "WebGLBlendModeManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 50, - "description": "Destroys this object.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLBlendModeManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 1, - "author": "Mat Groves\n\nBig thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\nfor creating the original pixi version!\n\nHeavily inspired by LibGDX's WebGLSpriteBatch:\nhttps://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 17, - "itemtype": "property", - "name": "vertSize", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 23, - "itemtype": "property", - "name": "maxSize", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 29, - "itemtype": "property", - "name": "size", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 41, - "description": "Vertex data", - "itemtype": "property", - "name": "vertices", - "type": "Float32Array", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 48, - "description": "Index data", - "itemtype": "property", - "name": "indices", - "type": "Uint16Array", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 55, - "itemtype": "property", - "name": "vertexBuffer", - "type": "Object", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 61, - "itemtype": "property", - "name": "indexBuffer", - "type": "Object", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 67, - "itemtype": "property", - "name": "lastIndexCount", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 83, - "itemtype": "property", - "name": "drawing", - "type": "Boolean", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 89, - "itemtype": "property", - "name": "currentBatchSize", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 95, - "itemtype": "property", - "name": "currentBaseTexture", - "type": "BaseTexture", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 101, - "itemtype": "property", - "name": "currentBlendMode", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 107, - "itemtype": "property", - "name": "renderSession", - "type": "Object", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 113, - "itemtype": "property", - "name": "shader", - "type": "Object", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 119, - "itemtype": "property", - "name": "matrix", - "type": "Matrix", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 130, - "description": "Sets the WebGL Context.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 154, - "itemtype": "method", - "name": "begin", - "params": [ - { - "name": "spriteBatch", - "description": "", - "type": "WebGLSpriteBatch" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 169, - "itemtype": "method", - "name": "end", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 177, - "itemtype": "method", - "name": "render", - "params": [ - { - "name": "spriteBatch", - "description": "", - "type": "WebGLSpriteBatch" - } - ], - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 208, - "itemtype": "method", - "name": "renderSprite", - "params": [ - { - "name": "sprite", - "description": "", - "type": "Sprite" - } - ], - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 349, - "itemtype": "method", - "name": "flush", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 389, - "itemtype": "method", - "name": "stop", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 397, - "itemtype": "method", - "name": "start", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 11, - "itemtype": "property", - "name": "filterStack", - "type": "Array", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 17, - "itemtype": "property", - "name": "offsetX", - "type": "Number", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 23, - "itemtype": "property", - "name": "offsetY", - "type": "Number", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 32, - "description": "Initialises the context and the properties.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 46, - "itemtype": "method", - "name": "begin", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - }, - { - "name": "buffer", - "description": "", - "type": "ArrayBuffer" - } - ], - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 62, - "description": "Applies the filter and adds it to the current filter stack.", - "itemtype": "method", - "name": "pushFilter", - "params": [ - { - "name": "filterBlock", - "description": "the filter that will be pushed to the current filter stack", - "type": "Object" - } - ], - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 138, - "description": "Removes the last filter from the filter stack and doesn't return it.", - "itemtype": "method", - "name": "popFilter", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 315, - "description": "Applies the filter to the specified area.", - "itemtype": "method", - "name": "applyFilterPass", - "params": [ - { - "name": "filter", - "description": "the filter that needs to be applied", - "type": "AbstractFilter" - }, - { - "name": "filterArea", - "description": "TODO - might need an update", - "type": "Texture" - }, - { - "name": "width", - "description": "the horizontal range of the filter", - "type": "Number" - }, - { - "name": "height", - "description": "the vertical range of the filter", - "type": "Number" - } - ], - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 376, - "description": "Initialises the shader buffers.", - "itemtype": "method", - "name": "initShaderBuffers", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 424, - "description": "Destroys the filter and removes it from the filter stack.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 16, - "description": "Renders the graphics object", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "renderGraphics", - "params": [ - { - "name": "graphics", - "description": "", - "type": "Graphics" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 84, - "description": "Updates the graphics object", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "updateGraphics", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object to update", - "type": "Graphics" - }, - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 199, - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "switchMode", - "params": [ - { - "name": "webGL", - "description": "", - "type": "WebGLContext" - }, - { - "name": "type", - "description": "", - "type": "Number" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 233, - "description": "Builds a rectangle to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildRectangle", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object containing all the necessary properties", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 301, - "description": "Builds a rounded rectangle to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildRoundedRectangle", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object containing all the necessary properties", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 369, - "description": "Calculate the points for a quadratic bezier curve. (helper function..)\nBased on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "quadraticBezierCurve", - "params": [ - { - "name": "fromX", - "description": "Origin point x", - "type": "Number" - }, - { - "name": "fromY", - "description": "Origin point x", - "type": "Number" - }, - { - "name": "cpX", - "description": "Control point x", - "type": "Number" - }, - { - "name": "cpY", - "description": "Control point y", - "type": "Number" - }, - { - "name": "toX", - "description": "Destination point x", - "type": "Number" - }, - { - "name": "toY", - "description": "Destination point y", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Array" - }, - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 421, - "description": "Builds a circle to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildCircle", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object to draw", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 504, - "description": "Builds a line to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildLine", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object containing all the necessary properties", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 716, - "description": "Builds a complex polygon to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildComplexPoly", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object containing all the necessary properties", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 778, - "description": "Builds a polygon to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildPoly", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object containing all the necessary properties", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 850, - "itemtype": "method", - "name": "reset", - "class": "WebGLGraphicsData" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 860, - "itemtype": "method", - "name": "upload", - "class": "WebGLGraphicsData" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLMaskManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 16, - "description": "Sets the drawing context to the one given in parameter.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLMaskManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 27, - "description": "Applies the Mask and adds it to the current filter stack.", - "itemtype": "method", - "name": "pushMask", - "params": [ - { - "name": "maskData", - "description": "", - "type": "Array" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLMaskManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 48, - "description": "Removes the last filter from the filter stack and doesn't return it.", - "itemtype": "method", - "name": "popMask", - "params": [ - { - "name": "maskData", - "description": "", - "type": "Array" - }, - { - "name": "renderSession", - "description": "an object containing all the useful parameters", - "type": "Object" - } - ], - "class": "WebGLMaskManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 61, - "description": "Destroys the mask stack.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLMaskManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 12, - "itemtype": "property", - "name": "maxAttibs", - "type": "Number", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 18, - "itemtype": "property", - "name": "attribState", - "type": "Array", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 24, - "itemtype": "property", - "name": "tempAttribState", - "type": "Array", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 35, - "itemtype": "property", - "name": "stack", - "type": "Array", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 45, - "description": "Initialises the context and the properties.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 72, - "description": "Takes the attributes given in parameters.", - "itemtype": "method", - "name": "setAttribs", - "params": [ - { - "name": "attribs", - "description": "attribs", - "type": "Array" - } - ], - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 115, - "description": "Sets the current shader.", - "itemtype": "method", - "name": "setShader", - "params": [ - { - "name": "shader", - "description": "", - "type": "Any" - } - ], - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 135, - "description": "Destroys this object.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 5, - "itemtype": "method", - "name": "initDefaultShaders", - "static": 1, - "access": "private", - "tagname": "", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 14, - "itemtype": "method", - "name": "CompileVertexShader", - "static": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - }, - { - "name": "shaderSrc", - "description": "", - "type": "Array" - } - ], - "return": { - "description": "", - "type": "Any" - }, - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 26, - "itemtype": "method", - "name": "CompileFragmentShader", - "static": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - }, - { - "name": "shaderSrc", - "description": "", - "type": "Array" - } - ], - "return": { - "description": "", - "type": "Any" - }, - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 38, - "itemtype": "method", - "name": "_CompileShader", - "static": 1, - "access": "private", - "tagname": "", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - }, - { - "name": "shaderSrc", - "description": "", - "type": "Array" - }, - { - "name": "shaderType", - "description": "", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Any" - }, - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 63, - "itemtype": "method", - "name": "compileProgram", - "static": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - }, - { - "name": "vertexSrc", - "description": "", - "type": "Array" - }, - { - "name": "fragmentSrc", - "description": "", - "type": "Array" - } - ], - "return": { - "description": "", - "type": "Any" - }, - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 1, - "author": "Mat Groves\n\nBig thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\nfor creating the original pixi version!\n\nHeavily inspired by LibGDX's WebGLSpriteBatch:\nhttps://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 19, - "itemtype": "property", - "name": "vertSize", - "type": "Number", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 25, - "description": "The number of images in the SpriteBatch before it flushes", - "itemtype": "property", - "name": "size", - "type": "Number", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 37, - "description": "Holds the vertices", - "itemtype": "property", - "name": "vertices", - "type": "Float32Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 45, - "description": "Holds the indices", - "itemtype": "property", - "name": "indices", - "type": "Uint16Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 53, - "itemtype": "property", - "name": "lastIndexCount", - "type": "Number", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 69, - "itemtype": "property", - "name": "drawing", - "type": "Boolean", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 75, - "itemtype": "property", - "name": "currentBatchSize", - "type": "Number", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 81, - "itemtype": "property", - "name": "currentBaseTexture", - "type": "BaseTexture", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 87, - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 93, - "itemtype": "property", - "name": "textures", - "type": "Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 99, - "itemtype": "property", - "name": "blendModes", - "type": "Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 105, - "itemtype": "property", - "name": "shaders", - "type": "Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 111, - "itemtype": "property", - "name": "sprites", - "type": "Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 117, - "itemtype": "property", - "name": "defaultShader", - "type": "AbstractFilter", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 132, - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 164, - "itemtype": "method", - "name": "begin", - "params": [ - { - "name": "renderSession", - "description": "The RenderSession object", - "type": "Object" - } - ], - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 176, - "itemtype": "method", - "name": "end", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 184, - "itemtype": "method", - "name": "render", - "params": [ - { - "name": "sprite", - "description": "the sprite to render when using this spritebatch", - "type": "Sprite" - } - ], - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 297, - "description": "Renders a TilingSprite using the spriteBatch.", - "itemtype": "method", - "name": "renderTilingSprite", - "params": [ - { - "name": "sprite", - "description": "the tilingSprite to render", - "type": "TilingSprite" - } - ], - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 418, - "description": "Renders the content and empties the current batch.", - "itemtype": "method", - "name": "flush", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 542, - "itemtype": "method", - "name": "renderBatch", - "params": [ - { - "name": "texture", - "description": "", - "type": "Texture" - }, - { - "name": "size", - "description": "", - "type": "Number" - }, - { - "name": "startIndex", - "description": "", - "type": "Number" - } - ], - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 572, - "itemtype": "method", - "name": "stop", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 581, - "itemtype": "method", - "name": "start", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 589, - "description": "Destroys the SpriteBatch.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 17, - "description": "Sets the drawing context to the one given in parameter.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 28, - "description": "Applies the Mask and adds it to the current filter stack.", - "itemtype": "method", - "name": "pushMask", - "params": [ - { - "name": "graphics", - "description": "", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Array" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 120, - "description": "TODO this does not belong here!", - "itemtype": "method", - "name": "bindGraphics", - "params": [ - { - "name": "graphics", - "description": "", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Array" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 190, - "itemtype": "method", - "name": "popStencil", - "params": [ - { - "name": "graphics", - "description": "", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Array" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 285, - "description": "Destroys the mask stack.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 46, - "itemtype": "property", - "name": "type", - "type": "Number", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 52, - "description": "The resolution of the renderer", - "itemtype": "property", - "name": "resolution", - "type": "Number", - "default": "1", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 63, - "description": "Whether the render view is transparent", - "itemtype": "property", - "name": "transparent", - "type": "Boolean", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 71, - "description": "Whether the render view should be resized automatically", - "itemtype": "property", - "name": "autoResize", - "type": "Boolean", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 79, - "description": "The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering.", - "itemtype": "property", - "name": "preserveDrawingBuffer", - "type": "Boolean", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 87, - "description": "This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true:\nIf the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0).\nIf the Stage is transparent, Pixi will clear to the target Stage's background color.\nDisable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set.", - "itemtype": "property", - "name": "clearBeforeRender", - "type": "Boolean", - "default": "", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 99, - "description": "The width of the canvas view", - "itemtype": "property", - "name": "width", - "type": "Number", - "default": "800", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 108, - "description": "The height of the canvas view", - "itemtype": "property", - "name": "height", - "type": "Number", - "default": "600", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 117, - "description": "The canvas element that everything is drawn to", - "itemtype": "property", - "name": "view", - "type": "HTMLCanvasElement", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 127, - "itemtype": "property", - "name": "contextLostBound", - "type": "Function", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 133, - "itemtype": "property", - "name": "contextRestoredBound", - "type": "Function", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 142, - "itemtype": "property", - "name": "_contextOptions", - "type": "Object", - "access": "private", - "tagname": "", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 155, - "itemtype": "property", - "name": "projection", - "type": "Point", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 161, - "itemtype": "property", - "name": "offset", - "type": "Point", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 169, - "description": "Deals with managing the shader programs and their attribs", - "itemtype": "property", - "name": "shaderManager", - "type": "WebGLShaderManager", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 176, - "description": "Manages the rendering of sprites", - "itemtype": "property", - "name": "spriteBatch", - "type": "WebGLSpriteBatch", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 183, - "description": "Manages the masks using the stencil buffer", - "itemtype": "property", - "name": "maskManager", - "type": "WebGLMaskManager", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 190, - "description": "Manages the filters", - "itemtype": "property", - "name": "filterManager", - "type": "WebGLFilterManager", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 197, - "description": "Manages the stencil buffer", - "itemtype": "property", - "name": "stencilManager", - "type": "WebGLStencilManager", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 204, - "description": "Manages the blendModes", - "itemtype": "property", - "name": "blendModeManager", - "type": "WebGLBlendModeManager", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 211, - "description": "TODO remove", - "itemtype": "property", - "name": "renderSession", - "type": "Object", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 238, - "itemtype": "method", - "name": "initContext", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 276, - "description": "Renders the stage to its webGL view", - "itemtype": "method", - "name": "render", - "params": [ - { - "name": "stage", - "description": "the Stage element to be rendered", - "type": "Stage" - } - ], - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 344, - "description": "Renders a Display Object.", - "itemtype": "method", - "name": "renderDisplayObject", - "params": [ - { - "name": "displayObject", - "description": "The DisplayObject to render", - "type": "DisplayObject" - }, - { - "name": "projection", - "description": "The projection", - "type": "Point" - }, - { - "name": "buffer", - "description": "a standard WebGL buffer", - "type": "Array" - } - ], - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 378, - "description": "Resizes the webGL view to the specified width and height.", - "itemtype": "method", - "name": "resize", - "params": [ - { - "name": "width", - "description": "the new width of the webGL view", - "type": "Number" - }, - { - "name": "height", - "description": "the new height of the webGL view", - "type": "Number" - } - ], - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 404, - "description": "Updates and Creates a WebGL texture for the renderers context.", - "itemtype": "method", - "name": "updateTexture", - "params": [ - { - "name": "texture", - "description": "the texture to update", - "type": "Texture" - } - ], - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 443, - "description": "Handles a lost webgl context", - "itemtype": "method", - "name": "handleContextLost", - "params": [ - { - "name": "event", - "description": "", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 456, - "description": "Handles a restored webgl context", - "itemtype": "method", - "name": "handleContextRestored", - "params": [ - { - "name": "event", - "description": "", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 477, - "description": "Removes everything from the renderer (event listeners, spritebatch, etc...)", - "itemtype": "method", - "name": "destroy", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 508, - "description": "Maps Pixi blend modes to WebGL blend modes.", - "itemtype": "method", - "name": "mapBlendModes", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 23, - "description": "[read-only] The width of the overall text, different from fontSize,\nwhich is defined in the style object", - "itemtype": "property", - "name": "textWidth", - "type": "Number", - "readonly": "", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 33, - "description": "[read-only] The height of the overall text, different from fontSize,\nwhich is defined in the style object", - "itemtype": "property", - "name": "textHeight", - "type": "Number", - "readonly": "", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 43, - "itemtype": "property", - "name": "_pool", - "type": "Array", - "access": "private", - "tagname": "", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 54, - "description": "The dirty state of this object.", - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 66, - "description": "Set the text string to be rendered.", - "itemtype": "method", - "name": "setText", - "params": [ - { - "name": "text", - "description": "The text that you would like displayed", - "type": "String" - } - ], - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 78, - "description": "Set the style of the text\nstyle.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)\n[style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single lines of text", - "itemtype": "method", - "name": "setStyle", - "params": [ - { - "name": "style", - "description": "The style parameters, contained as properties of an object", - "type": "Object" - } - ], - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 100, - "description": "Renders text and updates it when needed", - "itemtype": "method", - "name": "updateText", - "access": "private", - "tagname": "", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 198, - "description": "Updates the transform of this object", - "itemtype": "method", - "name": "updateTransform", - "access": "private", - "tagname": "", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/Text.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23\nModified by Tom Slezakowski http://www.tomslezakowski.com @TomSlezakowski (24/03/2014) - Added dropShadowColor.", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 29, - "description": "The canvas element that everything is drawn to", - "itemtype": "property", - "name": "canvas", - "type": "HTMLCanvasElement", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 37, - "description": "The canvas 2d context that everything is drawn with", - "itemtype": "property", - "name": "context", - "type": "HTMLCanvasElement", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 44, - "description": "The resolution of the canvas.", - "itemtype": "property", - "name": "resolution", - "type": "Number", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 62, - "description": "The width of the Text, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 86, - "description": "The height of the Text, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 110, - "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": "Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text", - "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, - "optdefault": "'black'" - }, - { - "name": "strokeThickness", - "description": "A number that represents the thickness of the stroke. Default is 0 (no stroke)", - "type": "Number", - "optional": true, - "optdefault": "0" - }, - { - "name": "wordWrap", - "description": "Indicates if word wrap should be used", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "wordWrapWidth", - "description": "The width at which text will wrap", - "type": "Number", - "optional": true, - "optdefault": "100" - }, - { - "name": "dropShadow", - "description": "Set a drop shadow for the text", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "dropShadowColor", - "description": "A fill style to be used on the dropshadow e.g 'red', '#00FF00'", - "type": "String", - "optional": true, - "optdefault": "'#000000'" - }, - { - "name": "dropShadowAngle", - "description": "Set a angle of the drop shadow", - "type": "Number", - "optional": true, - "optdefault": "Math.PI/4" - }, - { - "name": "dropShadowDistance", - "description": "Set a distance of the drop shadow", - "type": "Number", - "optional": true, - "optdefault": "5" - } - ] - }, - { - "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": 147, - "description": "Set the copy for the text object. To split a line you can use '\\n'.", - "itemtype": "method", - "name": "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": 159, - "description": "Renders text and updates it when needed", - "itemtype": "method", - "name": "updateText", - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 281, - "description": "Updates texture size based on canvas size", - "itemtype": "method", - "name": "updateTexture", - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 301, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 321, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 341, - "description": "Calculates the ascent, descent and fontSize of a given fontStyle", - "itemtype": "method", - "name": "determineFontProperties", - "params": [ - { - "name": "fontStyle", - "description": "", - "type": "Object" - } - ], - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 444, - "description": "Applies newlines to a string to have it optimally fit into the horizontal\nbounds set by the Text object's wordWrapWidth property.", - "itemtype": "method", - "name": "wordWrap", - "params": [ - { - "name": "text", - "description": "", - "type": "String" - } - ], - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 492, - "description": "Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account.", - "itemtype": "method", - "name": "getBounds", - "params": [ - { - "name": "matrix", - "description": "the transformation matrix of the Text", - "type": "Matrix" - } - ], - "return": { - "description": "the framing rectangle", - "type": "Rectangle" - }, - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 510, - "description": "Destroys this text object.", - "itemtype": "method", - "name": "destroy", - "params": [ - { - "name": "destroyBaseTexture", - "description": "whether to destroy the base texture as well", - "type": "Boolean" - } - ], - "class": "Text" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 20, - "description": "The Resolution of the texture.", - "itemtype": "property", - "name": "resolution", - "type": "Number", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 28, - "description": "[read-only] The width of the base texture set when the image has loaded", - "itemtype": "property", - "name": "width", - "type": "Number", - "readonly": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 37, - "description": "[read-only] The height of the base texture set when the image has loaded", - "itemtype": "property", - "name": "height", - "type": "Number", - "readonly": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 46, - "description": "The scale mode to apply when scaling this texture", - "itemtype": "property", - "name": "scaleMode", - "type": "PIXI.scaleModes", - "default": "PIXI.scaleModes.LINEAR", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 55, - "description": "[read-only] Set to true once the base texture has loaded", - "itemtype": "property", - "name": "hasLoaded", - "type": "Boolean", - "readonly": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 64, - "description": "The image source that is used to create the texture.", - "itemtype": "property", - "name": "source", - "type": "Image", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 74, - "description": "Controls if RGB channels should be pre-multiplied by Alpha (WebGL only)", - "itemtype": "property", - "name": "premultipliedAlpha", - "type": "Boolean", - "default": "true", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 85, - "itemtype": "property", - "name": "_glTextures", - "type": "Array", - "access": "private", - "tagname": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 95, - "itemtype": "property", - "name": "_dirty", - "type": "Array", - "access": "private", - "tagname": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 132, - "itemtype": "property", - "name": "imageUrl", - "type": "String", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 138, - "itemtype": "property", - "name": "_powerOf2", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 151, - "description": "Destroys this base texture", - "itemtype": "method", - "name": "destroy", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 174, - "description": "Changes the source image of the texture", - "itemtype": "method", - "name": "updateSourceImage", - "params": [ - { - "name": "newSrc", - "description": "the path of the image", - "type": "String" - } - ], - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 187, - "description": "Sets all glTextures to be dirty.", - "itemtype": "method", - "name": "dirty", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 200, - "description": "Removes the base texture from the GPU, useful for managing resources on the GPU.\nAtexture is still 100% usable and will simply be reuploaded if there is a sprite on screen that is using it.", - "itemtype": "method", - "name": "unloadFromGPU", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 228, - "description": "Helper function that creates a base texture from the given image url.\nIf the image is not in the base texture cache it will be created and loaded.", - "static": 1, - "itemtype": "method", - "name": "fromImage", - "params": [ - { - "name": "imageUrl", - "description": "The image url of the texture", - "type": "String" - }, - { - "name": "crossorigin", - "description": "", - "type": "Boolean" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ], - "return": { - "description": "BaseTexture" - }, - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 270, - "description": "Helper function that creates a base texture from the given canvas element.", - "static": 1, - "itemtype": "method", - "name": "fromCanvas", - "params": [ - { - "name": "canvas", - "description": "The canvas element source of the texture", - "type": "Canvas" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ], - "return": { - "description": "BaseTexture" - }, - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 37, - "description": "The with of the render texture", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 45, - "description": "The height of the render texture", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 53, - "description": "The Resolution of the texture.", - "itemtype": "property", - "name": "resolution", - "type": "Number", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 61, - "description": "The framing rectangle of the render texture", - "itemtype": "property", - "name": "frame", - "type": "Rectangle", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 69, - "description": "This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,\nirrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)", - "itemtype": "property", - "name": "crop", - "type": "Rectangle", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 78, - "description": "The base texture object that this texture uses", - "itemtype": "property", - "name": "baseTexture", - "type": "BaseTexture", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 99, - "description": "The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL.", - "itemtype": "property", - "name": "renderer", - "type": "CanvasRenderer|WebGLRenderer", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 125, - "itemtype": "property", - "name": "valid", - "type": "Boolean", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 137, - "description": "Resizes the RenderTexture.", - "itemtype": "method", - "name": "resize", - "params": [ - { - "name": "width", - "description": "The width to resize to.", - "type": "Number" - }, - { - "name": "height", - "description": "The height to resize to.", - "type": "Number" - }, - { - "name": "updateBase", - "description": "Should the baseTexture.width and height values be resized as well?", - "type": "Boolean" - } - ], - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 171, - "description": "Clears the RenderTexture.", - "itemtype": "method", - "name": "clear", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 188, - "description": "This function will draw the display object to the texture.", - "itemtype": "method", - "name": "renderWebGL", - "params": [ - { - "name": "displayObject", - "description": "The display object to render this texture on", - "type": "DisplayObject" - }, - { - "name": "matrix", - "description": "Optional matrix to apply to the display object before rendering.", - "type": "Matrix", - "optional": true - }, - { - "name": "clear", - "description": "If true the texture will be cleared before the displayObject is drawn", - "type": "Boolean", - "optional": true - } - ], - "access": "private", - "tagname": "", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 237, - "description": "This function will draw the display object to the texture.", - "itemtype": "method", - "name": "renderCanvas", - "params": [ - { - "name": "displayObject", - "description": "The display object to render this texture on", - "type": "DisplayObject" - }, - { - "name": "matrix", - "description": "Optional matrix to apply to the display object before rendering.", - "type": "Matrix", - "optional": true - }, - { - "name": "clear", - "description": "If true the texture will be cleared before the displayObject is drawn", - "type": "Boolean", - "optional": true - } - ], - "access": "private", - "tagname": "", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 278, - "description": "Will return a HTML Image of the texture", - "itemtype": "method", - "name": "getImage", - "return": { - "description": "", - "type": "Image" - }, - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 291, - "description": "Will return a a base64 encoded string of this texture. It works by calling RenderTexture.getCanvas and then running toDataURL on that.", - "itemtype": "method", - "name": "getBase64", - "return": { - "description": "A base64 encoded string of the texture.", - "type": "String" - }, - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 302, - "description": "Creates a Canvas element, renders this RenderTexture to it and then returns it.", - "itemtype": "method", - "name": "getCanvas", - "return": { - "description": "A Canvas element with the texture rendered on.", - "type": "HTMLCanvasElement" - }, - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 24, - "description": "Does this Texture have any frame data assigned to it?", - "itemtype": "property", - "name": "noFrame", - "type": "Boolean", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 43, - "description": "The base texture that this texture uses.", - "itemtype": "property", - "name": "baseTexture", - "type": "BaseTexture", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 51, - "description": "The frame specifies the region of the base texture that this texture uses", - "itemtype": "property", - "name": "frame", - "type": "Rectangle", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 59, - "description": "The texture trim data.", - "itemtype": "property", - "name": "trim", - "type": "Rectangle", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 67, - "description": "This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.", - "itemtype": "property", - "name": "valid", - "type": "Boolean", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 75, - "description": "This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)", - "itemtype": "property", - "name": "requiresUpdate", - "type": "Boolean", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 83, - "description": "The WebGL UV data cache.", - "itemtype": "property", - "name": "_uvs", - "type": "Object", - "access": "private", - "tagname": "", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 92, - "description": "The width of the Texture in pixels.", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 100, - "description": "The height of the Texture in pixels.", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 108, - "description": "This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,\nirrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)", - "itemtype": "property", - "name": "crop", - "type": "Rectangle", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 131, - "description": "Called when the base texture is loaded", - "itemtype": "method", - "name": "onBaseTextureLoaded", - "access": "private", - "tagname": "", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 149, - "description": "Destroys this texture", - "itemtype": "method", - "name": "destroy", - "params": [ - { - "name": "destroyBase", - "description": "Whether to destroy the base texture as well", - "type": "Boolean" - } - ], - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 162, - "description": "Specifies the region of the baseTexture that this texture will use.", - "itemtype": "method", - "name": "setFrame", - "params": [ - { - "name": "frame", - "description": "The frame of the texture to set it to", - "type": "Rectangle" - } - ], - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 200, - "description": "Updates the internal WebGL UV cache.", - "itemtype": "method", - "name": "_updateUvs", - "access": "private", - "tagname": "", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 227, - "description": "Helper function that creates a Texture object from the given image url.\nIf the image is not in the texture cache it will be created and loaded.", - "static": 1, - "itemtype": "method", - "name": "fromImage", - "params": [ - { - "name": "imageUrl", - "description": "The image url of the texture", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ], - "return": { - "description": "Texture" - }, - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 251, - "description": "Helper function that returns a Texture objected based on the given frame id.\nIf the frame id is not in the texture cache an error will be thrown.", - "static": 1, - "itemtype": "method", - "name": "fromFrame", - "params": [ - { - "name": "frameId", - "description": "The frame id of the texture", - "type": "String" - } - ], - "return": { - "description": "Texture" - }, - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 267, - "description": "Helper function that creates a new a Texture based on the given canvas element.", - "static": 1, - "itemtype": "method", - "name": "fromCanvas", - "params": [ - { - "name": "canvas", - "description": "The canvas element source of the texture", - "type": "Canvas" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ], - "return": { - "description": "Texture" - }, - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 284, - "description": "Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object.", - "static": 1, - "itemtype": "method", - "name": "addTextureToCache", - "params": [ - { - "name": "texture", - "description": "The Texture to add to the cache.", - "type": "Texture" - }, - { - "name": "id", - "description": "The id that the texture will be stored against.", - "type": "String" - } - ], - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 297, - "description": "Remove a texture from the global PIXI.TextureCache.", - "static": 1, - "itemtype": "method", - "name": "removeTextureFromCache", - "params": [ - { - "name": "id", - "description": "The id of the texture to be removed", - "type": "String" - } - ], - "return": { - "description": "The texture that was removed", - "type": "Texture" - }, - "class": "Texture" - }, - { - "file": "src/pixi/textures/VideoTexture.js", - "line": 87, - "description": "Mimic Pixi BaseTexture.from.... method.", - "params": [ - { - "name": "video", - "description": "" - }, - { - "name": "scaleMode", - "description": "" - } - ], - "return": { - "description": "", - "type": "PIXI.VideoTexture" - }, - "class": "autoDetectRenderer" - }, - { - "file": "src/pixi/textures/VideoTexture.js", - "line": 126, - "description": "Mimic PIXI Texture.from... method.", - "params": [ - { - "name": "video", - "description": "" - }, - { - "name": "scaleMode", - "description": "" - } - ], - "return": { - "description": "", - "type": "PIXI.Texture" - }, - "class": "autoDetectRenderer" - }, - { - "file": "src/pixi/utils/Detector.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "autoDetectRenderer" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 1, - "author": "Chad Engler https://github.com/englercj @Rolnaaba", - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 6, - "description": "Originally based on https://github.com/mrdoob/eventtarget.js/ from mr Doob.\nCurrently takes inspiration from the nodejs EventEmitter, EventEmitter3, and smokesignals", - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 24, - "description": "Backward compat from when this used to be a function", - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 34, - "description": "Mixes in the properties of the EventTarget prototype onto another object", - "itemtype": "method", - "name": "mixin", - "params": [ - { - "name": "object", - "description": "The obj to mix into", - "type": "Object" - } - ], - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 41, - "description": "Return a list of assigned event listeners.", - "itemtype": "method", - "name": "listeners", - "params": [ - { - "name": "eventName", - "description": "The events that should be listed.", - "type": "String" - } - ], - "return": { - "description": "An array of listener functions", - "type": "Array" - }, - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 54, - "description": "Emit an event to all registered event listeners.", - "itemtype": "method", - "name": "emit", - "alias": "dispatchEvent", - "params": [ - { - "name": "eventName", - "description": "The name of the event.", - "type": "String" - } - ], - "return": { - "description": "Indication if we've emitted an event.", - "type": "Boolean" - }, - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 107, - "description": "Register a new EventListener for the given event.", - "itemtype": "method", - "name": "on", - "alias": "addEventListener", - "params": [ - { - "name": "eventName", - "description": "Name of the event.", - "type": "String" - }, - { - "name": "callback", - "description": "fn Callback function.", - "type": "Functon" - } - ], - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 124, - "description": "Add an EventListener that's only called once.", - "itemtype": "method", - "name": "once", - "params": [ - { - "name": "eventName", - "description": "Name of the event.", - "type": "String" - }, - { - "name": "callback", - "description": "Callback function.", - "type": "Function" - } - ], - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 143, - "description": "Remove event listeners.", - "itemtype": "method", - "name": "off", - "alias": "removeEventListener", - "params": [ - { - "name": "eventName", - "description": "The event we want to remove.", - "type": "String" - }, - { - "name": "callback", - "description": "The listener that we need to find.", - "type": "Function" - } - ], - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 173, - "description": "Remove all listeners or only the listeners for the specified event.", - "itemtype": "method", - "name": "removeAllListeners", - "params": [ - { - "name": "eventName", - "description": "The event you want to remove all listeners for.", - "type": "String" - } - ], - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 206, - "description": "Tracks the state of bubbling propagation. Do not\nset this directly, instead use `event.stopPropagation()`", - "itemtype": "property", - "name": "stopped", - "type": "Boolean", - "access": "private", - "tagname": "", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 217, - "description": "Tracks the state of sibling listener propagation. Do not\nset this directly, instead use `event.stopImmediatePropagation()`", - "itemtype": "property", - "name": "stoppedImmediate", - "type": "Boolean", - "access": "private", - "tagname": "", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 228, - "description": "The original target the event triggered on.", - "itemtype": "property", - "name": "target", - "type": "Object", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 237, - "description": "The string name of the event that this represents.", - "itemtype": "property", - "name": "type", - "type": "String", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 246, - "description": "The data that was passed in with this event.", - "itemtype": "property", - "name": "data", - "type": "Object", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 258, - "description": "The timestamp when the event occurred.", - "itemtype": "property", - "name": "timeStamp", - "type": "Number", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 268, - "description": "Stops the propagation of events up the scene graph (prevents bubbling).", - "itemtype": "method", - "name": "stopPropagation", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 277, - "description": "Stops the propagation of events to sibling listeners (no longer calls any listeners).", - "itemtype": "method", - "name": "stopImmediatePropagation", - "class": "Event" - }, - { - "file": "src/pixi/utils/Polyk.js", - "line": 42, - "description": "Triangulates shapes for webGL graphic fills.", - "itemtype": "method", - "name": "Triangulate", - "class": "PolyK" - }, - { - "file": "src/pixi/utils/Polyk.js", - "line": 120, - "description": "Checks whether a point is within a triangle", - "itemtype": "method", - "name": "_PointInTriangle", - "params": [ - { - "name": "px", - "description": "x coordinate of the point to test", - "type": "Number" - }, - { - "name": "py", - "description": "y coordinate of the point to test", - "type": "Number" - }, - { - "name": "ax", - "description": "x coordinate of the a point of the triangle", - "type": "Number" - }, - { - "name": "ay", - "description": "y coordinate of the a point of the triangle", - "type": "Number" - }, - { - "name": "bx", - "description": "x coordinate of the b point of the triangle", - "type": "Number" - }, - { - "name": "by", - "description": "y coordinate of the b point of the triangle", - "type": "Number" - }, - { - "name": "cx", - "description": "x coordinate of the c point of the triangle", - "type": "Number" - }, - { - "name": "cy", - "description": "y coordinate of the c point of the triangle", - "type": "Number" - } - ], - "access": "private", - "tagname": "", - "return": { - "description": "", - "type": "Boolean" - }, - "class": "PolyK" - }, - { - "file": "src/pixi/utils/Polyk.js", - "line": 158, - "description": "Checks whether a shape is convex", - "itemtype": "method", - "name": "_convex", - "access": "private", - "tagname": "", - "return": { - "description": "", - "type": "Boolean" - }, - "class": "PolyK" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 12, - "description": "A polyfill for requestAnimationFrame\nYou can actually use both requestAnimationFrame and requestAnimFrame, \nyou will still benefit from the polyfill", - "itemtype": "method", - "name": "requestAnimationFrame", - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 20, - "description": "A polyfill for cancelAnimationFrame", - "itemtype": "method", - "name": "cancelAnimationFrame", - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 54, - "description": "Converts a hex color number to an [R, G, B] array", - "itemtype": "method", - "name": "hex2rgb", - "params": [ - { - "name": "hex", - "description": "", - "type": "Number" - } - ], - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 64, - "description": "Converts a color as an [R, G, B] array to a hex number", - "itemtype": "method", - "name": "rgb2hex", - "params": [ - { - "name": "rgb", - "description": "", - "type": "Array" - } - ], - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 74, - "description": "A polyfill for Function.prototype.bind", - "itemtype": "method", - "name": "bind", - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 168, - "description": "Checks whether the Canvas BlendModes are supported by the current browser", - "itemtype": "method", - "name": "canUseNewCanvasBlendModes", - "return": { - "description": "whether they are supported", - "type": "Boolean" - }, - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 189, - "description": "Given a number, this function returns the closest number that is a power of two\nthis function is taken from Starling Framework as its pretty neat ;)", - "itemtype": "method", - "name": "getNextPowerOfTwo", - "params": [ - { - "name": "number", - "description": "", - "type": "Number" - } - ], - "return": { - "description": "the closest number that is a power of two", - "type": "Number" - }, - "class": "AjaxRequest" - }, - { - "file": "src/pixi/InteractionData.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "InteractionData" - }, - { - "file": "src/pixi/InteractionData.js", - "line": 13, - "description": "This point stores the global coords of where the touch/mouse event happened", - "itemtype": "property", - "name": "global", - "type": "Point", - "class": "InteractionData" - }, - { - "file": "src/pixi/InteractionData.js", - "line": 21, - "description": "The target Sprite that was interacted with", - "itemtype": "property", - "name": "target", - "type": "Sprite", - "class": "InteractionData" - }, - { - "file": "src/pixi/InteractionData.js", - "line": 29, - "description": "When passed to an event handler, this will be the original DOM Event that was captured", - "itemtype": "property", - "name": "originalEvent", - "type": "Event", - "class": "InteractionData" - }, - { - "file": "src/pixi/InteractionData.js", - "line": 38, - "description": "This will return the local coordinates of the specified displayObject for this InteractionData", - "itemtype": "method", - "name": "getLocalPosition", - "params": [ - { - "name": "displayObject", - "description": "The DisplayObject that you would like the local coords off", - "type": "DisplayObject" - }, - { - "name": "point", - "description": "A Point object in which to store the value, optional (otherwise will create a new point)", - "type": "Point", - "optional": true - } - ], - "return": { - "description": "A point containing the coordinates of the InteractionData position relative to the DisplayObject", - "type": "Point" - }, - "class": "InteractionData" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 16, - "description": "A reference to the stage", - "itemtype": "property", - "name": "stage", - "type": "Stage", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 24, - "description": "The mouse data", - "itemtype": "property", - "name": "mouse", - "type": "InteractionData", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 32, - "description": "An object that stores current touches (InteractionData) by id reference", - "itemtype": "property", - "name": "touches", - "type": "Object", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 40, - "itemtype": "property", - "name": "tempPoint", - "type": "Point", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 47, - "itemtype": "property", - "name": "mouseoverEnabled", - "type": "Boolean", - "default": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 54, - "description": "Tiny little interactiveData pool !", - "itemtype": "property", - "name": "pool", - "type": "Array", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 62, - "description": "An array containing all the iterative items from the our interactive tree", - "itemtype": "property", - "name": "interactiveItems", - "type": "Array", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 70, - "description": "Our canvas", - "itemtype": "property", - "name": "interactionDOMElement", - "type": "HTMLCanvasElement", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 80, - "itemtype": "property", - "name": "onMouseMove", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 86, - "itemtype": "property", - "name": "onMouseDown", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 92, - "itemtype": "property", - "name": "onMouseOut", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 98, - "itemtype": "property", - "name": "onMouseUp", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 104, - "itemtype": "property", - "name": "onTouchStart", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 110, - "itemtype": "property", - "name": "onTouchEnd", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 116, - "itemtype": "property", - "name": "onTouchMove", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 122, - "itemtype": "property", - "name": "last", - "type": "Number", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 128, - "description": "The css style of the cursor that is being used", - "itemtype": "property", - "name": "currentCursorStyle", - "type": "String", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 135, - "description": "Is set to true when the mouse is moved out of the canvas", - "itemtype": "property", - "name": "mouseOut", - "type": "Boolean", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 142, - "itemtype": "property", - "name": "resolution", - "type": "Number", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 152, - "description": "Collects an interactive sprite recursively to have their interactions managed", - "itemtype": "method", - "name": "collectInteractiveSprite", - "params": [ - { - "name": "displayObject", - "description": "the displayObject to collect", - "type": "DisplayObject" - }, - { - "name": "iParent", - "description": "the display object's parent", - "type": "DisplayObject" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 193, - "description": "Sets the target for event delegation", - "itemtype": "method", - "name": "setTarget", - "params": [ - { - "name": "target", - "description": "the renderer to bind events to", - "type": "WebGLRenderer|CanvasRenderer" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 211, - "description": "Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM\nelements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element\nto receive those events", - "itemtype": "method", - "name": "setTargetDomElement", - "params": [ - { - "name": "domElement", - "description": "the DOM element which will receive mouse and touch events", - "type": "DOMElement" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 245, - "itemtype": "method", - "name": "removeEvents", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 270, - "description": "updates the state of interactive objects", - "itemtype": "method", - "name": "update", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 355, - "itemtype": "method", - "name": "rebuildInteractiveGraph", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 380, - "description": "Is called when the mouse moves across the renderer element", - "itemtype": "method", - "name": "onMouseMove", - "params": [ - { - "name": "event", - "description": "The DOM event of the mouse moving", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 416, - "description": "Is called when the mouse button is pressed down on the renderer element", - "itemtype": "method", - "name": "onMouseDown", - "params": [ - { - "name": "event", - "description": "The DOM event of a mouse button being pressed down", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 477, - "description": "Is called when the mouse is moved out of the renderer element", - "itemtype": "method", - "name": "onMouseOut", - "params": [ - { - "name": "event", - "description": "The DOM event of a mouse being moved out", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 518, - "description": "Is called when the mouse button is released on the renderer element", - "itemtype": "method", - "name": "onMouseUp", - "params": [ - { - "name": "event", - "description": "The DOM event of a mouse button being released", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 586, - "description": "Tests if the current mouse coordinates hit a sprite", - "itemtype": "method", - "name": "hitTest", - "params": [ - { - "name": "item", - "description": "The displayObject to test for a hit", - "type": "DisplayObject" - }, - { - "name": "interactionData", - "description": "The interactionData object to update in the case there is a hit", - "type": "InteractionData" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 683, - "description": "Is called when a touch is moved across the renderer element", - "itemtype": "method", - "name": "onTouchMove", - "params": [ - { - "name": "event", - "description": "The DOM event of a touch moving across the renderer view", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 729, - "description": "Is called when a touch is started on the renderer element", - "itemtype": "method", - "name": "onTouchStart", - "params": [ - { - "name": "event", - "description": "The DOM event of a touch starting on the renderer view", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 798, - "description": "Is called when a touch is ended on the renderer element", - "itemtype": "method", - "name": "onTouchEnd", - "params": [ - { - "name": "event", - "description": "The DOM event of a touch ending on the renderer view", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/Intro.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "" - }, - { - "file": "src/pixi/Outro.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "" - }, - { - "file": "src/pixi/Pixi.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "" - } - ], - "warnings": [ - { - "message": "unknown tag: copyright", - "line": " src/pixi/extras/Rope.js:1" - }, - { - "message": "replacing incorrect tag: returns with return", - "line": " src/pixi/textures/VideoTexture.js:87" - }, - { - "message": "replacing incorrect tag: returns with return", - "line": " src/pixi/textures/VideoTexture.js:126" - }, - { - "message": "replacing incorrect tag: returns with return", - "line": " src/pixi/utils/EventTarget.js:41" - }, - { - "message": "unknown tag: alias", - "line": " src/pixi/utils/EventTarget.js:54" - }, - { - "message": "replacing incorrect tag: returns with return", - "line": " src/pixi/utils/EventTarget.js:54" - }, - { - "message": "unknown tag: alias", - "line": " src/pixi/utils/EventTarget.js:107" - }, - { - "message": "unknown tag: alias", - "line": " src/pixi/utils/EventTarget.js:143" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/DisplayObject.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/DisplayObjectContainer.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/MovieClip.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/Sprite.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/SpriteBatch.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/Stage.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Rope.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:1" - }, - { - "message": "Missing item type\ncx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of", - "line": " src/pixi/extras/Spine.js:213" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:506" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:513" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:520" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:528" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:535" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:542" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:577" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:585" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:600" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:604" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:611" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:618" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:625" - }, - { - "message": "Missing item type\nfrom the new skin are attached if the corresponding attachment from the old skin was attached.", - "line": " src/pixi/extras/Spine.js:637" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:644" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:648" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:657" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:849" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:855" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:861" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:867" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:885" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:1310" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Strip.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/TilingSprite.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/AbstractFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/AlphaMaskFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/AsciiFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/BlurFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/BlurXFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/BlurYFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/ColorMatrixFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/ColorStepFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/CrossHatchFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/DisplacementFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/DotScreenFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/FilterBlock.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/GrayFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/InvertFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/NoiseFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/NormalMapFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/PixelateFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/RGBSplitFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/SepiaFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/SmartBlurFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/TiltShiftFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/TiltShiftXFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/TiltShiftYFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/TwistFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Circle.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Ellipse.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Matrix.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Point.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Polygon.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Rectangle.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/RoundedRectangle.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/AssetLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/AtlasLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/BitmapFontLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/ImageLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/JsonLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/SpineLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/SpriteSheetLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/primitives/Graphics.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/canvas/utils/CanvasBuffer.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/canvas/utils/CanvasMaskManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/canvas/utils/CanvasTinter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/canvas/CanvasGraphics.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/canvas/CanvasRenderer.js:1" - }, - { - "message": "Missing item type\nIf true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation.\nHandy for crisp pixel art and speed on legacy devices.", - "line": " src/pixi/renderers/canvas/CanvasRenderer.js:157" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/shaders/PixiFastShader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/shaders/PixiShader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/shaders/PrimitiveShader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/shaders/StripShader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/FilterTexture.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLFilterManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLGraphics.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLMaskManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLShaderManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLStencilManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/WebGLRenderer.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/text/BitmapText.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/text/Text.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/textures/BaseTexture.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/textures/RenderTexture.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/textures/Texture.js:1" - }, - { - "message": "Missing item type\nMimic Pixi BaseTexture.from.... method.", - "line": " src/pixi/textures/VideoTexture.js:87" - }, - { - "message": "Missing item type\nMimic PIXI Texture.from... method.", - "line": " src/pixi/textures/VideoTexture.js:126" - }, - { - "message": "Missing item type", - "line": " src/pixi/utils/Detector.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/utils/EventTarget.js:1" - }, - { - "message": "Missing item type\nOriginally based on https://github.com/mrdoob/eventtarget.js/ from mr Doob.\nCurrently takes inspiration from the nodejs EventEmitter, EventEmitter3, and smokesignals", - "line": " src/pixi/utils/EventTarget.js:6" - }, - { - "message": "Missing item type\nBackward compat from when this used to be a function", - "line": " src/pixi/utils/EventTarget.js:24" - }, - { - "message": "Missing item type", - "line": " src/pixi/utils/Utils.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/InteractionData.js:1" - }, - { - "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/Outro.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/Pixi.js:1" - } - ] -} \ No newline at end of file diff --git a/tutorial-2/pixi.js-master/docs/files/index.html b/tutorial-2/pixi.js-master/docs/files/index.html deleted file mode 100755 index 487fe15..0000000 --- a/tutorial-2/pixi.js-master/docs/files/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Redirector - - - - Click here to redirect - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_InteractionData.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_InteractionData.js.html deleted file mode 100755 index f913d34..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_InteractionData.js.html +++ /dev/null @@ -1,344 +0,0 @@ - - - - - src/pixi/InteractionData.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/InteractionData.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * Holds all information related to an Interaction event
    - *
    - * @class InteractionData
    - * @constructor
    - */
    -PIXI.InteractionData = function()
    -{
    -    /**
    -     * This point stores the global coords of where the touch/mouse event happened
    -     *
    -     * @property global
    -     * @type Point
    -     */
    -    this.global = new PIXI.Point();
    -
    -    /**
    -     * The target Sprite that was interacted with
    -     *
    -     * @property target
    -     * @type Sprite
    -     */
    -    this.target = null;
    -
    -    /**
    -     * When passed to an event handler, this will be the original DOM Event that was captured
    -     *
    -     * @property originalEvent
    -     * @type Event
    -     */
    -    this.originalEvent = null;
    -};
    -
    -/**
    - * This will return the local coordinates of the specified displayObject for this InteractionData
    - *
    - * @method getLocalPosition
    - * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off
    - * @param [point] {Point} A Point object in which to store the value, optional (otherwise will create a new point)
    - * @return {Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject
    - */
    -PIXI.InteractionData.prototype.getLocalPosition = function(displayObject, point)
    -{
    -    var worldTransform = displayObject.worldTransform;
    -    var global = this.global;
    -
    -    // do a cheeky transform to get the mouse coords;
    -    var a00 = worldTransform.a, a01 = worldTransform.c, a02 = worldTransform.tx,
    -        a10 = worldTransform.b, a11 = worldTransform.d, a12 = worldTransform.ty,
    -        id = 1 / (a00 * a11 + a01 * -a10);
    -
    -    point = point || new PIXI.Point();
    -
    -    point.x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id;
    -    point.y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id;
    -
    -    // set the mouse coords...
    -    return point;
    -};
    -
    -// constructor
    -PIXI.InteractionData.prototype.constructor = PIXI.InteractionData;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_InteractionManager.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_InteractionManager.js.html deleted file mode 100755 index 824229b..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_InteractionManager.js.html +++ /dev/null @@ -1,1156 +0,0 @@ - - - - - src/pixi/InteractionManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/InteractionManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    - /**
    - * The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive
    - * if its interactive parameter is set to true
    - * This manager also supports multitouch.
    - *
    - * @class InteractionManager
    - * @constructor
    - * @param stage {Stage} The stage to handle interactions
    - */
    -PIXI.InteractionManager = function(stage)
    -{
    -    /**
    -     * A reference to the stage
    -     *
    -     * @property stage
    -     * @type Stage
    -     */
    -    this.stage = stage;
    -
    -    /**
    -     * The mouse data
    -     *
    -     * @property mouse
    -     * @type InteractionData
    -     */
    -    this.mouse = new PIXI.InteractionData();
    -
    -    /**
    -     * An object that stores current touches (InteractionData) by id reference
    -     *
    -     * @property touches
    -     * @type Object
    -     */
    -    this.touches = {};
    -
    -    /**
    -     * @property tempPoint
    -     * @type Point
    -     * @private
    -     */
    -    this.tempPoint = new PIXI.Point();
    -
    -    /**
    -     * @property mouseoverEnabled
    -     * @type Boolean
    -     * @default
    -     */
    -    this.mouseoverEnabled = true;
    -
    -    /**
    -     * Tiny little interactiveData pool !
    -     *
    -     * @property pool
    -     * @type Array
    -     */
    -    this.pool = [];
    -
    -    /**
    -     * An array containing all the iterative items from the our interactive tree
    -     * @property interactiveItems
    -     * @type Array
    -     * @private
    -     */
    -    this.interactiveItems = [];
    -
    -    /**
    -     * Our canvas
    -     * @property interactionDOMElement
    -     * @type HTMLCanvasElement
    -     * @private
    -     */
    -    this.interactionDOMElement = null;
    -
    -    //this will make it so that you don't have to call bind all the time
    -
    -    /**
    -     * @property onMouseMove
    -     * @type Function
    -     */
    -    this.onMouseMove = this.onMouseMove.bind( this );
    -
    -    /**
    -     * @property onMouseDown
    -     * @type Function
    -     */
    -    this.onMouseDown = this.onMouseDown.bind(this);
    -
    -    /**
    -     * @property onMouseOut
    -     * @type Function
    -     */
    -    this.onMouseOut = this.onMouseOut.bind(this);
    -
    -    /**
    -     * @property onMouseUp
    -     * @type Function
    -     */
    -    this.onMouseUp = this.onMouseUp.bind(this);
    -
    -    /**
    -     * @property onTouchStart
    -     * @type Function
    -     */
    -    this.onTouchStart = this.onTouchStart.bind(this);
    -
    -    /**
    -     * @property onTouchEnd
    -     * @type Function
    -     */
    -    this.onTouchEnd = this.onTouchEnd.bind(this);
    -
    -    /**
    -     * @property onTouchMove
    -     * @type Function
    -     */
    -    this.onTouchMove = this.onTouchMove.bind(this);
    -
    -    /**
    -     * @property last
    -     * @type Number
    -     */
    -    this.last = 0;
    -
    -    /**
    -     * The css style of the cursor that is being used
    -     * @property currentCursorStyle
    -     * @type String
    -     */
    -    this.currentCursorStyle = 'inherit';
    -
    -    /**
    -     * Is set to true when the mouse is moved out of the canvas
    -     * @property mouseOut
    -     * @type Boolean
    -     */
    -    this.mouseOut = false;
    -
    -    /**
    -     * @property resolution
    -     * @type Number
    -     */
    -    this.resolution = 1;
    -};
    -
    -// constructor
    -PIXI.InteractionManager.prototype.constructor = PIXI.InteractionManager;
    -
    -/**
    - * Collects an interactive sprite recursively to have their interactions managed
    - *
    - * @method collectInteractiveSprite
    - * @param displayObject {DisplayObject} the displayObject to collect
    - * @param iParent {DisplayObject} the display object's parent
    - * @private
    - */
    -PIXI.InteractionManager.prototype.collectInteractiveSprite = function(displayObject, iParent)
    -{
    -    var children = displayObject.children;
    -    var length = children.length;
    -
    -    // make an interaction tree... {item.__interactiveParent}
    -    for (var i = length - 1; i >= 0; i--)
    -    {
    -        var child = children[i];
    -
    -        // push all interactive bits
    -        if (child._interactive)
    -        {
    -            iParent.interactiveChildren = true;
    -            //child.__iParent = iParent;
    -            this.interactiveItems.push(child);
    -
    -            if (child.children.length > 0) {
    -                this.collectInteractiveSprite(child, child);
    -            }
    -        }
    -        else
    -        {
    -            child.__iParent = null;
    -            if (child.children.length > 0)
    -            {
    -                this.collectInteractiveSprite(child, iParent);
    -            }
    -        }
    -
    -    }
    -};
    -
    -/**
    - * Sets the target for event delegation
    - *
    - * @method setTarget
    - * @param target {WebGLRenderer|CanvasRenderer} the renderer to bind events to
    - * @private
    - */
    -PIXI.InteractionManager.prototype.setTarget = function(target)
    -{
    -    this.target = target;
    -    this.resolution = target.resolution;
    -
    -    // Check if the dom element has been set. If it has don't do anything.
    -    if (this.interactionDOMElement !== null) return;
    -
    -    this.setTargetDomElement (target.view);
    -};
    -
    -/**
    - * Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM
    - * elements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element
    - * to receive those events
    - *
    - * @method setTargetDomElement
    - * @param domElement {DOMElement} the DOM element which will receive mouse and touch events
    - * @private
    - */
    -PIXI.InteractionManager.prototype.setTargetDomElement = function(domElement)
    -{
    -    this.removeEvents();
    -
    -    if (window.navigator.msPointerEnabled)
    -    {
    -        // time to remove some of that zoom in ja..
    -        domElement.style['-ms-content-zooming'] = 'none';
    -        domElement.style['-ms-touch-action'] = 'none';
    -    }
    -
    -    this.interactionDOMElement = domElement;
    -
    -    domElement.addEventListener('mousemove',  this.onMouseMove, true);
    -    domElement.addEventListener('mousedown',  this.onMouseDown, true);
    -    domElement.addEventListener('mouseout',   this.onMouseOut, true);
    -
    -    // aint no multi touch just yet!
    -    domElement.addEventListener('touchstart', this.onTouchStart, true);
    -    domElement.addEventListener('touchend', this.onTouchEnd, true);
    -    domElement.addEventListener('touchmove', this.onTouchMove, true);
    -
    -    window.addEventListener('mouseup',  this.onMouseUp, true);
    -};
    -
    -/**
    - * @method removeEvents
    - * @private
    - */
    -PIXI.InteractionManager.prototype.removeEvents = function()
    -{
    -    if (!this.interactionDOMElement) return;
    -
    -    this.interactionDOMElement.style['-ms-content-zooming'] = '';
    -    this.interactionDOMElement.style['-ms-touch-action'] = '';
    -
    -    this.interactionDOMElement.removeEventListener('mousemove',  this.onMouseMove, true);
    -    this.interactionDOMElement.removeEventListener('mousedown',  this.onMouseDown, true);
    -    this.interactionDOMElement.removeEventListener('mouseout',   this.onMouseOut, true);
    -
    -    // aint no multi touch just yet!
    -    this.interactionDOMElement.removeEventListener('touchstart', this.onTouchStart, true);
    -    this.interactionDOMElement.removeEventListener('touchend', this.onTouchEnd, true);
    -    this.interactionDOMElement.removeEventListener('touchmove', this.onTouchMove, true);
    -
    -    this.interactionDOMElement = null;
    -
    -    window.removeEventListener('mouseup',  this.onMouseUp, true);
    -};
    -
    -/**
    - * updates the state of interactive objects
    - *
    - * @method update
    - * @private
    - */
    -PIXI.InteractionManager.prototype.update = function()
    -{
    -    if (!this.target) return;
    -
    -    // frequency of 30fps??
    -    var now = Date.now();
    -    var diff = now - this.last;
    -    diff = (diff * PIXI.INTERACTION_FREQUENCY ) / 1000;
    -    if (diff < 1) return;
    -    this.last = now;
    -
    -    var i = 0;
    -
    -    // ok.. so mouse events??
    -    // yes for now :)
    -    // OPTIMISE - how often to check??
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    // loop through interactive objects!
    -    var length = this.interactiveItems.length;
    -    var cursor = 'inherit';
    -    var over = false;
    -
    -    for (i = 0; i < length; i++)
    -    {
    -        var item = this.interactiveItems[i];
    -
    -        // OPTIMISATION - only calculate every time if the mousemove function exists..
    -        // OK so.. does the object have any other interactive functions?
    -        // hit-test the clip!
    -       // if (item.mouseover || item.mouseout || item.buttonMode)
    -       // {
    -        // ok so there are some functions so lets hit test it..
    -        item.__hit = this.hitTest(item, this.mouse);
    -        this.mouse.target = item;
    -        // ok so deal with interactions..
    -        // looks like there was a hit!
    -        if (item.__hit && !over)
    -        {
    -            if (item.buttonMode) cursor = item.defaultCursor;
    -
    -            if (!item.interactiveChildren)
    -            {
    -                over = true;
    -            }
    -
    -            if (!item.__isOver)
    -            {
    -                if (item.mouseover)
    -                {
    -                    item.mouseover (this.mouse);
    -                }
    -                item.__isOver = true;
    -            }
    -        }
    -        else
    -        {
    -            if (item.__isOver)
    -            {
    -                // roll out!
    -                if (item.mouseout)
    -                {
    -                    item.mouseout (this.mouse);
    -                }
    -                item.__isOver = false;
    -            }
    -        }
    -    }
    -
    -    if (this.currentCursorStyle !== cursor)
    -    {
    -        this.currentCursorStyle = cursor;
    -        this.interactionDOMElement.style.cursor = cursor;
    -    }
    -};
    -
    -/**
    - * @method rebuildInteractiveGraph
    - * @private
    - */
    -PIXI.InteractionManager.prototype.rebuildInteractiveGraph = function()
    -{
    -    this.dirty = false;
    -
    -    var len = this.interactiveItems.length;
    -
    -    for (var i = 0; i < len; i++) {
    -        this.interactiveItems[i].interactiveChildren = false;
    -    }
    -
    -    this.interactiveItems = [];
    -
    -    if (this.stage.interactive)
    -    {
    -        this.interactiveItems.push(this.stage);
    -    }
    -
    -    // Go through and collect all the objects that are interactive..
    -    this.collectInteractiveSprite(this.stage, this.stage);
    -};
    -
    -/**
    - * Is called when the mouse moves across the renderer element
    - *
    - * @method onMouseMove
    - * @param event {Event} The DOM event of the mouse moving
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onMouseMove = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    this.mouse.originalEvent = event;
    -
    -    // TODO optimize by not check EVERY TIME! maybe half as often? //
    -    var rect = this.interactionDOMElement.getBoundingClientRect();
    -
    -    this.mouse.global.x = (event.clientX - rect.left) * (this.target.width / rect.width) / this.resolution;
    -    this.mouse.global.y = (event.clientY - rect.top) * ( this.target.height / rect.height) / this.resolution;
    -
    -    var length = this.interactiveItems.length;
    -
    -    for (var i = 0; i < length; i++)
    -    {
    -        var item = this.interactiveItems[i];
    -
    -        // Call the function!
    -        if (item.mousemove)
    -        {
    -            item.mousemove(this.mouse);
    -        }
    -    }
    -};
    -
    -/**
    - * Is called when the mouse button is pressed down on the renderer element
    - *
    - * @method onMouseDown
    - * @param event {Event} The DOM event of a mouse button being pressed down
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onMouseDown = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    this.mouse.originalEvent = event;
    -
    -    if (PIXI.AUTO_PREVENT_DEFAULT)
    -    {
    -        this.mouse.originalEvent.preventDefault();
    -    }
    -
    -    // loop through interaction tree...
    -    // hit test each item! ->
    -    // get interactive items under point??
    -    //stage.__i
    -    var length = this.interactiveItems.length;
    -
    -    var e = this.mouse.originalEvent;
    -    var isRightButton = e.button === 2 || e.which === 3;
    -    var downFunction = isRightButton ? 'rightdown' : 'mousedown';
    -    var clickFunction = isRightButton ? 'rightclick' : 'click';
    -    var buttonIsDown = isRightButton ? '__rightIsDown' : '__mouseIsDown';
    -    var isDown = isRightButton ? '__isRightDown' : '__isDown';
    -
    -    // while
    -    // hit test
    -    for (var i = 0; i < length; i++)
    -    {
    -        var item = this.interactiveItems[i];
    -
    -        if (item[downFunction] || item[clickFunction])
    -        {
    -            item[buttonIsDown] = true;
    -            item.__hit = this.hitTest(item, this.mouse);
    -
    -            if (item.__hit)
    -            {
    -                //call the function!
    -                if (item[downFunction])
    -                {
    -                    item[downFunction](this.mouse);
    -                }
    -                item[isDown] = true;
    -
    -                // just the one!
    -                if (!item.interactiveChildren) break;
    -            }
    -        }
    -    }
    -};
    -
    -/**
    - * Is called when the mouse is moved out of the renderer element
    - *
    - * @method onMouseOut
    - * @param event {Event} The DOM event of a mouse being moved out
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onMouseOut = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    this.mouse.originalEvent = event;
    -
    -    var length = this.interactiveItems.length;
    -
    -    this.interactionDOMElement.style.cursor = 'inherit';
    -
    -    for (var i = 0; i < length; i++)
    -    {
    -        var item = this.interactiveItems[i];
    -        if (item.__isOver)
    -        {
    -            this.mouse.target = item;
    -            if (item.mouseout)
    -            {
    -                item.mouseout(this.mouse);
    -            }
    -            item.__isOver = false;
    -        }
    -    }
    -
    -    this.mouseOut = true;
    -
    -    // move the mouse to an impossible position
    -    this.mouse.global.x = -10000;
    -    this.mouse.global.y = -10000;
    -};
    -
    -/**
    - * Is called when the mouse button is released on the renderer element
    - *
    - * @method onMouseUp
    - * @param event {Event} The DOM event of a mouse button being released
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onMouseUp = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    this.mouse.originalEvent = event;
    -
    -    var length = this.interactiveItems.length;
    -    var up = false;
    -
    -    var e = this.mouse.originalEvent;
    -    var isRightButton = e.button === 2 || e.which === 3;
    -
    -    var upFunction = isRightButton ? 'rightup' : 'mouseup';
    -    var clickFunction = isRightButton ? 'rightclick' : 'click';
    -    var upOutsideFunction = isRightButton ? 'rightupoutside' : 'mouseupoutside';
    -    var isDown = isRightButton ? '__isRightDown' : '__isDown';
    -
    -    for (var i = 0; i < length; i++)
    -    {
    -        var item = this.interactiveItems[i];
    -
    -        if (item[clickFunction] || item[upFunction] || item[upOutsideFunction])
    -        {
    -            item.__hit = this.hitTest(item, this.mouse);
    -
    -            if (item.__hit && !up)
    -            {
    -                //call the function!
    -                if (item[upFunction])
    -                {
    -                    item[upFunction](this.mouse);
    -                }
    -                if (item[isDown])
    -                {
    -                    if (item[clickFunction])
    -                    {
    -                        item[clickFunction](this.mouse);
    -                    }
    -                }
    -
    -                if (!item.interactiveChildren)
    -                {
    -                    up = true;
    -                }
    -            }
    -            else
    -            {
    -                if (item[isDown])
    -                {
    -                    if (item[upOutsideFunction]) item[upOutsideFunction](this.mouse);
    -                }
    -            }
    -
    -            item[isDown] = false;
    -        }
    -    }
    -};
    -
    -/**
    - * Tests if the current mouse coordinates hit a sprite
    - *
    - * @method hitTest
    - * @param item {DisplayObject} The displayObject to test for a hit
    - * @param interactionData {InteractionData} The interactionData object to update in the case there is a hit
    - * @private
    - */
    -PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
    -{
    -    var global = interactionData.global;
    -
    -    if (!item.worldVisible)
    -    {
    -        return false;
    -    }
    -
    -    // temp fix for if the element is in a non visible
    -
    -    var worldTransform = item.worldTransform, i,
    -        a = worldTransform.a, b = worldTransform.b,
    -        c = worldTransform.c, tx = worldTransform.tx,
    -        d = worldTransform.d, ty = worldTransform.ty,
    -     
    -        id = 1 / (a * d + c * -b),
    -        x = d * id * global.x + -c * id * global.y + (ty * c - tx * d) * id,
    -        y = a * id * global.y + -b * id * global.x + (-ty * a + tx * b) * id;
    -
    -
    -    interactionData.target = item;
    -
    -    //a sprite or display object with a hit area defined
    -    if (item.hitArea && item.hitArea.contains)
    -    {
    -        if (item.hitArea.contains(x, y))
    -        {
    -            interactionData.target = item;
    -            return true;
    -        }
    -        return false;
    -    }
    -    // a sprite with no hitarea defined
    -    else if(item instanceof PIXI.Sprite)
    -    {
    -        var width = item.texture.frame.width;
    -        var height = item.texture.frame.height;
    -        var x1 = -width * item.anchor.x;
    -        var y1;
    -
    -        if (x > x1 && x < x1 + width)
    -        {
    -            y1 = -height * item.anchor.y;
    -
    -            if (y > y1 && y < y1 + height)
    -            {
    -                // set the target property if a hit is true!
    -                interactionData.target = item;
    -                return true;
    -            }
    -        }
    -    }
    -    else if(item instanceof PIXI.Graphics)
    -    {
    -        var graphicsData = item.graphicsData;
    -        for (i = 0; i < graphicsData.length; i++)
    -        {
    -            var data = graphicsData[i];
    -            if(!data.fill)continue;
    -
    -            // only deal with fills..
    -            if(data.shape)
    -            {
    -                if(data.shape.contains(x, y))
    -                {
    -                    interactionData.target = item;
    -                    return true;
    -                }
    -            }
    -        }
    -    }
    -
    -    var length = item.children.length;
    -
    -    for (i = 0; i < length; i++)
    -    {
    -        var tempItem = item.children[i];
    -        var hit = this.hitTest(tempItem, interactionData);
    -        if (hit)
    -        {
    -            // hmm.. TODO SET CORRECT TARGET?
    -            interactionData.target = item;
    -            return true;
    -        }
    -    }
    -    return false;
    -};
    -
    -/**
    - * Is called when a touch is moved across the renderer element
    - *
    - * @method onTouchMove
    - * @param event {Event} The DOM event of a touch moving across the renderer view
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onTouchMove = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    var rect = this.interactionDOMElement.getBoundingClientRect();
    -    var changedTouches = event.changedTouches;
    -    var touchData;
    -    var i = 0;
    -
    -    for (i = 0; i < changedTouches.length; i++)
    -    {
    -        var touchEvent = changedTouches[i];
    -        touchData = this.touches[touchEvent.identifier];
    -        touchData.originalEvent = event;
    -
    -        // update the touch position
    -        touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution;
    -        touchData.global.y = ( (touchEvent.clientY - rect.top)  * (this.target.height / rect.height) )  / this.resolution;
    -        if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height)
    -        {
    -            //Support for CocoonJS fullscreen scale modes
    -            touchData.global.x = touchEvent.clientX;
    -            touchData.global.y = touchEvent.clientY;
    -        }
    -
    -        for (var j = 0; j < this.interactiveItems.length; j++)
    -        {
    -            var item = this.interactiveItems[j];
    -            if (item.touchmove && item.__touchData && item.__touchData[touchEvent.identifier])
    -            {
    -                item.touchmove(touchData);
    -            }
    -        }
    -    }
    -};
    -
    -/**
    - * Is called when a touch is started on the renderer element
    - *
    - * @method onTouchStart
    - * @param event {Event} The DOM event of a touch starting on the renderer view
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onTouchStart = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    var rect = this.interactionDOMElement.getBoundingClientRect();
    -
    -    if (PIXI.AUTO_PREVENT_DEFAULT)
    -    {
    -        event.preventDefault();
    -    }
    -
    -    var changedTouches = event.changedTouches;
    -    for (var i=0; i < changedTouches.length; i++)
    -    {
    -        var touchEvent = changedTouches[i];
    -
    -        var touchData = this.pool.pop();
    -        if (!touchData)
    -        {
    -            touchData = new PIXI.InteractionData();
    -        }
    -
    -        touchData.originalEvent = event;
    -
    -        this.touches[touchEvent.identifier] = touchData;
    -        touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution;
    -        touchData.global.y = ( (touchEvent.clientY - rect.top)  * (this.target.height / rect.height) ) / this.resolution;
    -        if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height)
    -        {
    -            //Support for CocoonJS fullscreen scale modes
    -            touchData.global.x = touchEvent.clientX;
    -            touchData.global.y = touchEvent.clientY;
    -        }
    -
    -        var length = this.interactiveItems.length;
    -
    -        for (var j = 0; j < length; j++)
    -        {
    -            var item = this.interactiveItems[j];
    -
    -            if (item.touchstart || item.tap)
    -            {
    -                item.__hit = this.hitTest(item, touchData);
    -
    -                if (item.__hit)
    -                {
    -                    //call the function!
    -                    if (item.touchstart)item.touchstart(touchData);
    -                    item.__isDown = true;
    -                    item.__touchData = item.__touchData || {};
    -                    item.__touchData[touchEvent.identifier] = touchData;
    -
    -                    if (!item.interactiveChildren) break;
    -                }
    -            }
    -        }
    -    }
    -};
    -
    -/**
    - * Is called when a touch is ended on the renderer element
    - *
    - * @method onTouchEnd
    - * @param event {Event} The DOM event of a touch ending on the renderer view
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onTouchEnd = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    var rect = this.interactionDOMElement.getBoundingClientRect();
    -    var changedTouches = event.changedTouches;
    -
    -    for (var i=0; i < changedTouches.length; i++)
    -    {
    -        var touchEvent = changedTouches[i];
    -        var touchData = this.touches[touchEvent.identifier];
    -        var up = false;
    -        touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution;
    -        touchData.global.y = ( (touchEvent.clientY - rect.top)  * (this.target.height / rect.height) ) / this.resolution;
    -        if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height)
    -        {
    -            //Support for CocoonJS fullscreen scale modes
    -            touchData.global.x = touchEvent.clientX;
    -            touchData.global.y = touchEvent.clientY;
    -        }
    -
    -        var length = this.interactiveItems.length;
    -        for (var j = 0; j < length; j++)
    -        {
    -            var item = this.interactiveItems[j];
    -
    -            if (item.__touchData && item.__touchData[touchEvent.identifier])
    -            {
    -
    -                item.__hit = this.hitTest(item, item.__touchData[touchEvent.identifier]);
    -
    -                // so this one WAS down...
    -                touchData.originalEvent = event;
    -                // hitTest??
    -
    -                if (item.touchend || item.tap)
    -                {
    -                    if (item.__hit && !up)
    -                    {
    -                        if (item.touchend)
    -                        {
    -                            item.touchend(touchData);
    -                        }
    -                        if (item.__isDown && item.tap)
    -                        {
    -                            item.tap(touchData);
    -                        }
    -                        if (!item.interactiveChildren)
    -                        {
    -                            up = true;
    -                        }
    -                    }
    -                    else
    -                    {
    -                        if (item.__isDown && item.touchendoutside)
    -                        {
    -                            item.touchendoutside(touchData);
    -                        }
    -                    }
    -
    -                    item.__isDown = false;
    -                }
    -
    -                item.__touchData[touchEvent.identifier] = null;
    -            }
    -        }
    -        // remove the touch..
    -        this.pool.push(touchData);
    -        this.touches[touchEvent.identifier] = null;
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_Intro.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_Intro.js.html deleted file mode 100755 index 39c4332..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_Intro.js.html +++ /dev/null @@ -1,285 +0,0 @@ - - - - - src/pixi/Intro.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/Intro.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -(function(){
    -
    -    var root = this;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_Outro.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_Outro.js.html deleted file mode 100755 index a3fd28d..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_Outro.js.html +++ /dev/null @@ -1,292 +0,0 @@ - - - - - src/pixi/Outro.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/Outro.js

    - -
    -
    -/**
    - * @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 if (typeof define !== 'undefined' && define.amd) {
    -        define(PIXI);
    -    } else {
    -        root.PIXI = PIXI;
    -    }
    -}).call(this);
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_Pixi.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_Pixi.js.html deleted file mode 100755 index 3533110..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_Pixi.js.html +++ /dev/null @@ -1,395 +0,0 @@ - - - - - src/pixi/Pixi.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/Pixi.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * @module PIXI
    - */
    -var PIXI = PIXI || {};
    -
    -/* 
    -* 
    -* This file contains a lot of pixi consts which are used across the rendering engine
    -* @class Consts
    -*/
    -PIXI.WEBGL_RENDERER = 0;
    -PIXI.CANVAS_RENDERER = 1;
    -
    -// useful for testing against if your lib is using pixi.
    -PIXI.VERSION = "v2.1.0";
    -
    -
    -// the various blend modes supported by pixi
    -PIXI.blendModes = {
    -    NORMAL:0,
    -    ADD:1,
    -    MULTIPLY:2,
    -    SCREEN:3,
    -    OVERLAY:4,
    -    DARKEN:5,
    -    LIGHTEN:6,
    -    COLOR_DODGE:7,
    -    COLOR_BURN:8,
    -    HARD_LIGHT:9,
    -    SOFT_LIGHT:10,
    -    DIFFERENCE:11,
    -    EXCLUSION:12,
    -    HUE:13,
    -    SATURATION:14,
    -    COLOR:15,
    -    LUMINOSITY:16
    -};
    -
    -// the scale modes
    -PIXI.scaleModes = {
    -    DEFAULT:0,
    -    LINEAR:0,
    -    NEAREST:1
    -};
    -
    -// used to create uids for various pixi objects..
    -PIXI._UID = 0;
    -
    -if(typeof(Float32Array) != 'undefined')
    -{
    -    PIXI.Float32Array = Float32Array;
    -    PIXI.Uint16Array = Uint16Array;
    -}
    -else
    -{
    -    PIXI.Float32Array = Array;
    -    PIXI.Uint16Array = Array;
    -}
    -
    -// interaction frequency 
    -PIXI.INTERACTION_FREQUENCY = 30;
    -PIXI.AUTO_PREVENT_DEFAULT = true;
    -
    -PIXI.PI_2 = Math.PI * 2;
    -PIXI.RAD_TO_DEG = 180 / Math.PI;
    -PIXI.DEG_TO_RAD = Math.PI / 180;
    -
    -PIXI.RETINA_PREFIX = "@2x";
    -//PIXI.SCALE_PREFIX "@x%%";
    -
    -PIXI.dontSayHello = false;
    -
    -
    -PIXI.defaultRenderOptions = {
    -    view:null, 
    -    transparent:false, 
    -    antialias:false, 
    -    preserveDrawingBuffer:false,
    -    resolution:1,
    -    clearBeforeRender:true,
    -    autoResize:false
    -}
    -
    -PIXI.sayHello = function (type) 
    -{
    -    if(PIXI.dontSayHello)return;
    -
    -    if ( navigator.userAgent.toLowerCase().indexOf('chrome') > -1 )
    -    {
    -        var args = [
    -            '%c %c %c Pixi.js ' + PIXI.VERSION + ' - ' + type + '  %c ' + ' %c ' + ' http://www.pixijs.com/  %c %c ♥%c♥%c♥ ',
    -            'background: #ff66a5',
    -            'background: #ff66a5',
    -            'color: #ff66a5; background: #030307;',
    -            'background: #ff66a5',
    -            'background: #ffc3dc',
    -            'background: #ff66a5',
    -            'color: #ff2424; background: #fff',
    -            'color: #ff2424; background: #fff',
    -            'color: #ff2424; background: #fff'
    -        ];
    -
    -       
    -
    -        console.log.apply(console, args);
    -    }
    -    else if (window['console'])
    -    {
    -        console.log('Pixi.js ' + PIXI.VERSION + ' - http://www.pixijs.com/');
    -    }
    -
    -    PIXI.dontSayHello = true;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_display_DisplayObject.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_display_DisplayObject.js.html deleted file mode 100755 index d3de5e4..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_display_DisplayObject.js.html +++ /dev/null @@ -1,1042 +0,0 @@ - - - - - src/pixi/display/DisplayObject.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/DisplayObject.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The base class for all objects that are rendered on the screen.
    - * This is an abstract class and should not be used on its own rather it should be extended.
    - *
    - * @class DisplayObject
    - * @constructor
    - */
    -PIXI.DisplayObject = function()
    -{
    -    /**
    -     * The coordinate of the object relative to the local coordinates of the parent.
    -     *
    -     * @property position
    -     * @type Point
    -     */
    -    this.position = new PIXI.Point();
    -
    -    /**
    -     * The scale factor of the object.
    -     *
    -     * @property scale
    -     * @type Point
    -     */
    -    this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    -
    -    /**
    -     * The pivot point of the displayObject that it rotates around
    -     *
    -     * @property pivot
    -     * @type Point
    -     */
    -    this.pivot = new PIXI.Point(0,0);
    -
    -    /**
    -     * The rotation of the object in radians.
    -     *
    -     * @property rotation
    -     * @type Number
    -     */
    -    this.rotation = 0;
    -
    -    /**
    -     * The opacity of the object.
    -     *
    -     * @property alpha
    -     * @type Number
    -     */
    -    this.alpha = 1;
    -
    -    /**
    -     * The visibility of the object.
    -     *
    -     * @property visible
    -     * @type Boolean
    -     */
    -    this.visible = true;
    -
    -    /**
    -     * This is the defined area that will pick up mouse / touch events. It is null by default.
    -     * Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)
    -     *
    -     * @property hitArea
    -     * @type Rectangle|Circle|Ellipse|Polygon
    -     */
    -    this.hitArea = null;
    -
    -    /**
    -     * This is used to indicate if the displayObject should display a mouse hand cursor on rollover
    -     *
    -     * @property buttonMode
    -     * @type Boolean
    -     */
    -    this.buttonMode = false;
    -
    -    /**
    -     * Can this object be rendered
    -     *
    -     * @property renderable
    -     * @type Boolean
    -     */
    -    this.renderable = false;
    -
    -    /**
    -     * [read-only] The display object container that contains this display object.
    -     *
    -     * @property parent
    -     * @type DisplayObjectContainer
    -     * @readOnly
    -     */
    -    this.parent = null;
    -
    -    /**
    -     * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    -     *
    -     * @property stage
    -     * @type Stage
    -     * @readOnly
    -     */
    -    this.stage = null;
    -
    -    /**
    -     * [read-only] The multiplied alpha of the displayObject
    -     *
    -     * @property worldAlpha
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.worldAlpha = 1;
    -
    -    /**
    -     * [read-only] Whether or not the object is interactive, do not toggle directly! use the `interactive` property
    -     *
    -     * @property _interactive
    -     * @type Boolean
    -     * @readOnly
    -     * @private
    -     */
    -    this._interactive = false;
    -
    -    /**
    -     * This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
    -     *
    -     * @property defaultCursor
    -     * @type String
    -     *
    -    */
    -    this.defaultCursor = 'pointer';
    -
    -    /**
    -     * [read-only] Current transform of the object based on world (parent) factors
    -     *
    -     * @property worldTransform
    -     * @type Matrix
    -     * @readOnly
    -     * @private
    -     */
    -    this.worldTransform = new PIXI.Matrix();
    -
    -    /**
    -     * cached sin rotation and cos rotation
    -     *
    -     * @property _sr
    -     * @type Number
    -     * @private
    -     */
    -    this._sr = 0;
    -
    -    /**
    -     * cached sin rotation and cos rotation
    -     *
    -     * @property _cr
    -     * @type Number
    -     * @private
    -     */
    -    this._cr = 1;
    -
    -    /**
    -     * The area the filter is applied to like the hitArea this is used as more of an optimisation
    -     * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle
    -     *
    -     * @property filterArea
    -     * @type Rectangle
    -     */
    -    this.filterArea = null;//new PIXI.Rectangle(0,0,1,1);
    -
    -    /**
    -     * The original, cached bounds of the object
    -     *
    -     * @property _bounds
    -     * @type Rectangle
    -     * @private
    -     */
    -    this._bounds = new PIXI.Rectangle(0, 0, 1, 1);
    -
    -    /**
    -     * The most up-to-date bounds of the object
    -     *
    -     * @property _currentBounds
    -     * @type Rectangle
    -     * @private
    -     */
    -    this._currentBounds = null;
    -
    -    /**
    -     * The original, cached mask of the object
    -     *
    -     * @property _currentBounds
    -     * @type Rectangle
    -     * @private
    -     */
    -    this._mask = null;
    -
    -    /**
    -     * Cached internal flag.
    -     *
    -     * @property _cacheAsBitmap
    -     * @type Boolean
    -     * @private
    -     */
    -    this._cacheAsBitmap = false;
    -
    -    /**
    -     * Cached internal flag.
    -     *
    -     * @property _cacheIsDirty
    -     * @type Boolean
    -     * @private
    -     */
    -    this._cacheIsDirty = false;
    -
    -
    -    /*
    -     * MOUSE Callbacks
    -     */
    -    
    -    /**
    -     * A callback that is used when the users mouse rolls over the displayObject
    -     * @method mouseover
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the users mouse leaves the displayObject
    -     * @method mouseout
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    //Left button
    -    /**
    -     * A callback that is used when the users clicks on the displayObject with their mouse's left button
    -     * @method click
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user clicks the mouse's left button down over the sprite
    -     * @method mousedown
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases the mouse's left button that was over the displayObject
    -     * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject
    -     * @method mouseup
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject
    -     * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject
    -     * @method mouseupoutside
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    //Right button
    -    /**
    -     * A callback that is used when the users clicks on the displayObject with their mouse's right button
    -     * @method rightclick
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user clicks the mouse's right button down over the sprite
    -     * @method rightdown
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases the mouse's right button that was over the displayObject
    -     * for this callback to be fired the mouse's right button must have been pressed down over the displayObject
    -     * @method rightup
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject
    -     * for this callback to be fired, the mouse's right button must have been pressed down over the displayObject
    -     * @method rightupoutside
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /*
    -     * TOUCH Callbacks
    -     */
    -
    -    /**
    -     * A callback that is used when the users taps on the sprite with their finger
    -     * basically a touch version of click
    -     * @method tap
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user touches over the displayObject
    -     * @method touchstart
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases a touch over the displayObject
    -     * @method touchend
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases the touch that was over the displayObject
    -     * for this callback to be fired, The touch must have started over the sprite
    -     * @method touchendoutside
    -     * @param interactionData {InteractionData}
    -     */
    -};
    -
    -// constructor
    -PIXI.DisplayObject.prototype.constructor = PIXI.DisplayObject;
    -
    -/**
    - * Indicates if the sprite will have touch and mouse interactivity. It is false by default
    - *
    - * @property interactive
    - * @type Boolean
    - * @default false
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'interactive', {
    -    get: function() {
    -        return this._interactive;
    -    },
    -    set: function(value) {
    -        this._interactive = value;
    -
    -        // TODO more to be done here..
    -        // need to sort out a re-crawl!
    -        if(this.stage)this.stage.dirty = true;
    -    }
    -});
    -
    -/**
    - * [read-only] Indicates if the sprite is globally visible.
    - *
    - * @property worldVisible
    - * @type Boolean
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'worldVisible', {
    -    get: function() {
    -        var item = this;
    -
    -        do
    -        {
    -            if(!item.visible)return false;
    -            item = item.parent;
    -        }
    -        while(item);
    -
    -        return true;
    -    }
    -});
    -
    -/**
    - * Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.
    - * In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping.
    - * To remove a mask, set this property to null.
    - *
    - * @property mask
    - * @type Graphics
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'mask', {
    -    get: function() {
    -        return this._mask;
    -    },
    -    set: function(value) {
    -
    -        if(this._mask)this._mask.isMask = false;
    -        this._mask = value;
    -        if(this._mask)this._mask.isMask = true;
    -    }
    -});
    -
    -/**
    - * Sets the filters for the displayObject.
    - * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer.
    - * To remove filters simply set this property to 'null'
    - * @property filters
    - * @type Array An array of filters
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', {
    -
    -    get: function() {
    -        return this._filters;
    -    },
    -
    -    set: function(value) {
    -
    -        if(value)
    -        {
    -            // now put all the passes in one place..
    -            var passes = [];
    -            for (var i = 0; i < value.length; i++)
    -            {
    -                var filterPasses = value[i].passes;
    -                for (var j = 0; j < filterPasses.length; j++)
    -                {
    -                    passes.push(filterPasses[j]);
    -                }
    -            }
    -
    -            // TODO change this as it is legacy
    -            this._filterBlock = {target:this, filterPasses:passes};
    -        }
    -
    -        this._filters = value;
    -    }
    -});
    -
    -/**
    - * Set if this display object is cached as a bitmap.
    - * This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects.
    - * To remove simply set this property to 'null'
    - * @property cacheAsBitmap
    - * @type Boolean
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'cacheAsBitmap', {
    -
    -    get: function() {
    -        return  this._cacheAsBitmap;
    -    },
    -
    -    set: function(value) {
    -
    -        if(this._cacheAsBitmap === value)return;
    -
    -        if(value)
    -        {
    -            this._generateCachedSprite();
    -        }
    -        else
    -        {
    -            this._destroyCachedSprite();
    -        }
    -
    -        this._cacheAsBitmap = value;
    -    }
    -});
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.DisplayObject.prototype.updateTransform = function()
    -{
    -    // create some matrix refs for easy access
    -    var pt = this.parent.worldTransform;
    -    var wt = this.worldTransform;
    -
    -    // temporary matrix variables
    -    var a, b, c, d, tx, ty;
    -
    -    // TODO create a const for 2_PI 
    -    // so if rotation is between 0 then we can simplify the multiplication process..
    -    if(this.rotation % PIXI.PI_2)
    -    {
    -        // check to see if the rotation is the same as the previous render. This means we only need to use sin and cos when rotation actually changes
    -        if(this.rotation !== this.rotationCache)
    -        {
    -            this.rotationCache = this.rotation;
    -            this._sr = Math.sin(this.rotation);
    -            this._cr = Math.cos(this.rotation);
    -        }
    -
    -        // get the matrix values of the displayobject based on its transform properties..
    -        a  =  this._cr * this.scale.x;
    -        b  =  this._sr * this.scale.x;
    -        c  = -this._sr * this.scale.y;
    -        d  =  this._cr * this.scale.y;
    -        tx =  this.position.x;
    -        ty =  this.position.y;
    -        
    -        // check for pivot.. not often used so geared towards that fact!
    -        if(this.pivot.x || this.pivot.y)
    -        {
    -            tx -= this.pivot.x * a + this.pivot.y * c;
    -            ty -= this.pivot.x * b + this.pivot.y * d;
    -        }
    -
    -        // concat the parent matrix with the objects transform.
    -        wt.a  = a  * pt.a + b  * pt.c;
    -        wt.b  = a  * pt.b + b  * pt.d;
    -        wt.c  = c  * pt.a + d  * pt.c;
    -        wt.d  = c  * pt.b + d  * pt.d;
    -        wt.tx = tx * pt.a + ty * pt.c + pt.tx;
    -        wt.ty = tx * pt.b + ty * pt.d + pt.ty;
    -
    -        
    -    }
    -    else
    -    {
    -        // lets do the fast version as we know there is no rotation..
    -        a  = this.scale.x;
    -        d  = this.scale.y;
    -
    -        tx =  this.position.x;
    -        ty =  this.position.y;
    -
    -        wt.a  = a  * pt.a;
    -        wt.b  = a  * pt.b;
    -        wt.c  = d  * pt.c;
    -        wt.d  = d  * pt.d;
    -        wt.tx = tx * pt.a + ty * pt.c + pt.tx;
    -        wt.ty = tx * pt.b + ty * pt.d + pt.ty;
    -    }
    -
    -    // multiply the alphas..
    -    this.worldAlpha = this.alpha * this.parent.worldAlpha;
    -};
    -
    -// performance increase to avoid using call.. (10x faster)
    -PIXI.DisplayObject.prototype.displayObjectUpdateTransform = PIXI.DisplayObject.prototype.updateTransform;
    -
    -/**
    - * Retrieves the bounds of the displayObject as a rectangle object
    - *
    - * @method getBounds
    - * @param matrix {Matrix}
    - * @return {Rectangle} the rectangular bounding area
    - */
    -PIXI.DisplayObject.prototype.getBounds = function(matrix)
    -{
    -    matrix = matrix;//just to get passed js hinting (and preserve inheritance)
    -    return PIXI.EmptyRectangle;
    -};
    -
    -/**
    - * Retrieves the local bounds of the displayObject as a rectangle object
    - *
    - * @method getLocalBounds
    - * @return {Rectangle} the rectangular bounding area
    - */
    -PIXI.DisplayObject.prototype.getLocalBounds = function()
    -{
    -    return this.getBounds(PIXI.identityMatrix);///PIXI.EmptyRectangle();
    -};
    -
    -/**
    - * Sets the object's stage reference, the stage this object is connected to
    - *
    - * @method setStageReference
    - * @param stage {Stage} the stage that the object will have as its current stage reference
    - */
    -PIXI.DisplayObject.prototype.setStageReference = function(stage)
    -{
    -    this.stage = stage;
    -    if(this._interactive)this.stage.dirty = true;
    -};
    -
    -/**
    - * Useful function that returns a texture of the displayObject object that can then be used to create sprites
    - * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.
    - *
    - * @method generateTexture
    - * @param resolution {Number} The resolution of the texture being generated
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture.
    - * @return {Texture} a texture of the graphics object
    - */
    -PIXI.DisplayObject.prototype.generateTexture = function(resolution, scaleMode, renderer)
    -{
    -    var bounds = this.getLocalBounds();
    -
    -    var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0, renderer, scaleMode, resolution);
    -    
    -    PIXI.DisplayObject._tempMatrix.tx = -bounds.x;
    -    PIXI.DisplayObject._tempMatrix.ty = -bounds.y;
    -    
    -    renderTexture.render(this, PIXI.DisplayObject._tempMatrix);
    -
    -    return renderTexture;
    -};
    -
    -/**
    - * Generates and updates the cached sprite for this object.
    - *
    - * @method updateCache
    - */
    -PIXI.DisplayObject.prototype.updateCache = function()
    -{
    -    this._generateCachedSprite();
    -};
    -
    -/**
    - * Calculates the global position of the display object
    - *
    - * @method toGlobal
    - * @param position {Point} The world origin to calculate from
    - * @return {Point} A point object representing the position of this object
    - */
    -PIXI.DisplayObject.prototype.toGlobal = function(position)
    -{
    -    this.updateTransform();
    -    return this.worldTransform.apply(position);
    -};
    -
    -/**
    - * Calculates the local position of the display object relative to another point
    - *
    - * @method toLocal
    - * @param position {Point} The world origin to calculate from
    - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from
    - * @return {Point} A point object representing the position of this object
    - */
    -PIXI.DisplayObject.prototype.toLocal = function(position, from)
    -{
    -    if (from)
    -    {
    -        position = from.toGlobal(position);
    -    }
    -
    -    this.updateTransform();
    -
    -    return this.worldTransform.applyInverse(position);
    -};
    -
    -/**
    - * Internal method.
    - *
    - * @method _renderCachedSprite
    - * @param renderSession {Object} The render session
    - * @private
    - */
    -PIXI.DisplayObject.prototype._renderCachedSprite = function(renderSession)
    -{
    -    this._cachedSprite.worldAlpha = this.worldAlpha;
    -
    -    if(renderSession.gl)
    -    {
    -        PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession);
    -    }
    -    else
    -    {
    -        PIXI.Sprite.prototype._renderCanvas.call(this._cachedSprite, renderSession);
    -    }
    -};
    -
    -/**
    - * Internal method.
    - *
    - * @method _generateCachedSprite
    - * @private
    - */
    -PIXI.DisplayObject.prototype._generateCachedSprite = function()
    -{
    -    this._cacheAsBitmap = false;
    -    var bounds = this.getLocalBounds();
    -
    -    if(!this._cachedSprite)
    -    {
    -        var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0);//, renderSession.renderer);
    -
    -        this._cachedSprite = new PIXI.Sprite(renderTexture);
    -        this._cachedSprite.worldTransform = this.worldTransform;
    -    }
    -    else
    -    {
    -        this._cachedSprite.texture.resize(bounds.width | 0, bounds.height | 0);
    -    }
    -
    -    //REMOVE filter!
    -    var tempFilters = this._filters;
    -    this._filters = null;
    -
    -    this._cachedSprite.filters = tempFilters;
    -
    -    PIXI.DisplayObject._tempMatrix.tx = -bounds.x;
    -    PIXI.DisplayObject._tempMatrix.ty = -bounds.y;
    -    
    -    this._cachedSprite.texture.render(this, PIXI.DisplayObject._tempMatrix );
    -
    -    this._cachedSprite.anchor.x = -( bounds.x / bounds.width );
    -    this._cachedSprite.anchor.y = -( bounds.y / bounds.height );
    -
    -    this._filters = tempFilters;
    -
    -    this._cacheAsBitmap = true;
    -};
    -
    -/**
    -* Destroys the cached sprite.
    -*
    -* @method _destroyCachedSprite
    -* @private
    -*/
    -PIXI.DisplayObject.prototype._destroyCachedSprite = function()
    -{
    -    if(!this._cachedSprite)return;
    -
    -    this._cachedSprite.texture.destroy(true);
    -
    -    // TODO could be object pooled!
    -    this._cachedSprite = null;
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession}
    -* @private
    -*/
    -PIXI.DisplayObject.prototype._renderWebGL = function(renderSession)
    -{
    -    // OVERWRITE;
    -    // this line is just here to pass jshinting :)
    -    renderSession = renderSession;
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession}
    -* @private
    -*/
    -PIXI.DisplayObject.prototype._renderCanvas = function(renderSession)
    -{
    -    // OVERWRITE;
    -    // this line is just here to pass jshinting :)
    -    renderSession = renderSession;
    -};
    -
    -
    -PIXI.DisplayObject._tempMatrix = new PIXI.Matrix();
    -
    -/**
    - * The position of the displayObject on the x axis relative to the local coordinates of the parent.
    - *
    - * @property x
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'x', {
    -    get: function() {
    -        return  this.position.x;
    -    },
    -    set: function(value) {
    -        this.position.x = value;
    -    }
    -});
    -
    -/**
    - * The position of the displayObject on the y axis relative to the local coordinates of the parent.
    - *
    - * @property y
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'y', {
    -    get: function() {
    -        return  this.position.y;
    -    },
    -    set: function(value) {
    -        this.position.y = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_display_DisplayObjectContainer.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_display_DisplayObjectContainer.js.html deleted file mode 100755 index 0c8eb24..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_display_DisplayObjectContainer.js.html +++ /dev/null @@ -1,793 +0,0 @@ - - - - - src/pixi/display/DisplayObjectContainer.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/DisplayObjectContainer.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A DisplayObjectContainer represents a collection of display objects.
    - * It is the base class of all display objects that act as a container for other objects.
    - *
    - * @class DisplayObjectContainer
    - * @extends DisplayObject
    - * @constructor
    - */
    -PIXI.DisplayObjectContainer = function()
    -{
    -    PIXI.DisplayObject.call( this );
    -
    -    /**
    -     * [read-only] The array of children of this container.
    -     *
    -     * @property children
    -     * @type Array<DisplayObject>
    -     * @readOnly
    -     */
    -    this.children = [];
    -
    -    // fast access to update transform..
    -    
    -};
    -
    -// constructor
    -PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    -PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer;
    -
    -
    -/**
    - * The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
    - *
    - * @property width
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', {
    -    get: function() {
    -        return this.scale.x * this.getLocalBounds().width;
    -    },
    -    set: function(value) {
    -        
    -        var width = this.getLocalBounds().width;
    -
    -        if(width !== 0)
    -        {
    -            this.scale.x = value / ( width/this.scale.x );
    -        }
    -        else
    -        {
    -            this.scale.x = 1;
    -        }
    -
    -        
    -        this._width = value;
    -    }
    -});
    -
    -/**
    - * The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
    - *
    - * @property height
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', {
    -    get: function() {
    -        return  this.scale.y * this.getLocalBounds().height;
    -    },
    -    set: function(value) {
    -
    -        var height = this.getLocalBounds().height;
    -
    -        if(height !== 0)
    -        {
    -            this.scale.y = value / ( height/this.scale.y );
    -        }
    -        else
    -        {
    -            this.scale.y = 1;
    -        }
    -
    -        this._height = value;
    -    }
    -});
    -
    -/**
    - * Adds a child to the container.
    - *
    - * @method addChild
    - * @param child {DisplayObject} The DisplayObject to add to the container
    - * @return {DisplayObject} The child that was added.
    - */
    -PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    -{
    -    return this.addChildAt(child, this.children.length);
    -};
    -
    -/**
    - * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    - *
    - * @method addChildAt
    - * @param child {DisplayObject} The child to add
    - * @param index {Number} The index to place the child in
    - * @return {DisplayObject} The child that was added.
    - */
    -PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    -{
    -    if(index >= 0 && index <= this.children.length)
    -    {
    -        if(child.parent)
    -        {
    -            child.parent.removeChild(child);
    -        }
    -
    -        child.parent = this;
    -
    -        this.children.splice(index, 0, child);
    -
    -        if(this.stage)child.setStageReference(this.stage);
    -
    -        return child;
    -    }
    -    else
    -    {
    -        throw new Error(child + 'addChildAt: The index '+ index +' supplied is out of bounds ' + this.children.length);
    -    }
    -};
    -
    -/**
    - * Swaps the position of 2 Display Objects within this container.
    - *
    - * @method swapChildren
    - * @param child {DisplayObject}
    - * @param child2 {DisplayObject}
    - */
    -PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2)
    -{
    -    if(child === child2) {
    -        return;
    -    }
    -
    -    var index1 = this.getChildIndex(child);
    -    var index2 = this.getChildIndex(child2);
    -
    -    if(index1 < 0 || index2 < 0) {
    -        throw new Error('swapChildren: Both the supplied DisplayObjects must be a child of the caller.');
    -    }
    -
    -    this.children[index1] = child2;
    -    this.children[index2] = child;
    -
    -};
    -
    -/**
    - * Returns the index position of a child DisplayObject instance
    - *
    - * @method getChildIndex
    - * @param child {DisplayObject} The DisplayObject instance to identify
    - * @return {Number} The index position of the child display object to identify
    - */
    -PIXI.DisplayObjectContainer.prototype.getChildIndex = function(child)
    -{
    -    var index = this.children.indexOf(child);
    -    if (index === -1)
    -    {
    -        throw new Error('The supplied DisplayObject must be a child of the caller');
    -    }
    -    return index;
    -};
    -
    -/**
    - * Changes the position of an existing child in the display object container
    - *
    - * @method setChildIndex
    - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number
    - * @param index {Number} The resulting index number for the child display object
    - */
    -PIXI.DisplayObjectContainer.prototype.setChildIndex = function(child, index)
    -{
    -    if (index < 0 || index >= this.children.length)
    -    {
    -        throw new Error('The supplied index is out of bounds');
    -    }
    -    var currentIndex = this.getChildIndex(child);
    -    this.children.splice(currentIndex, 1); //remove from old position
    -    this.children.splice(index, 0, child); //add at new position
    -};
    -
    -/**
    - * Returns the child at the specified index
    - *
    - * @method getChildAt
    - * @param index {Number} The index to get the child from
    - * @return {DisplayObject} The child at the given index, if any.
    - */
    -PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
    -{
    -    if (index < 0 || index >= this.children.length)
    -    {
    -        throw new Error('getChildAt: Supplied index '+ index +' does not exist in the child list, or the supplied DisplayObject must be a child of the caller');
    -    }
    -    return this.children[index];
    -    
    -};
    -
    -/**
    - * Removes a child from the container.
    - *
    - * @method removeChild
    - * @param child {DisplayObject} The DisplayObject to remove
    - * @return {DisplayObject} The child that was removed.
    - */
    -PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    -{
    -    var index = this.children.indexOf( child );
    -    if(index === -1)return;
    -    
    -    return this.removeChildAt( index );
    -};
    -
    -/**
    - * Removes a child from the specified index position.
    - *
    - * @method removeChildAt
    - * @param index {Number} The index to get the child from
    - * @return {DisplayObject} The child that was removed.
    - */
    -PIXI.DisplayObjectContainer.prototype.removeChildAt = function(index)
    -{
    -    var child = this.getChildAt( index );
    -    if(this.stage)
    -        child.removeStageReference();
    -
    -    child.parent = undefined;
    -    this.children.splice( index, 1 );
    -    return child;
    -};
    -
    -/**
    -* Removes all children from this container that are within the begin and end indexes.
    -*
    -* @method removeChildren
    -* @param beginIndex {Number} The beginning position. Default value is 0.
    -* @param endIndex {Number} The ending position. Default value is size of the container.
    -*/
    -PIXI.DisplayObjectContainer.prototype.removeChildren = function(beginIndex, endIndex)
    -{
    -    var begin = beginIndex || 0;
    -    var end = typeof endIndex === 'number' ? endIndex : this.children.length;
    -    var range = end - begin;
    -
    -    if (range > 0 && range <= end)
    -    {
    -        var removed = this.children.splice(begin, range);
    -        for (var i = 0; i < removed.length; i++) {
    -            var child = removed[i];
    -            if(this.stage)
    -                child.removeStageReference();
    -            child.parent = undefined;
    -        }
    -        return removed;
    -    }
    -    else if (range === 0 && this.children.length === 0)
    -    {
    -        return [];
    -    }
    -    else
    -    {
    -        throw new Error( 'removeChildren: Range Error, numeric values are outside the acceptable range' );
    -    }
    -};
    -
    -/*
    - * Updates the transform on all children of this container for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    -{
    -    if(!this.visible)return;
    -
    -    this.displayObjectUpdateTransform();
    -
    -    //PIXI.DisplayObject.prototype.updateTransform.call( this );
    -
    -    if(this._cacheAsBitmap)return;
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        this.children[i].updateTransform();
    -    }
    -};
    -
    -// performance increase to avoid using call.. (10x faster)
    -PIXI.DisplayObjectContainer.prototype.displayObjectContainerUpdateTransform = PIXI.DisplayObjectContainer.prototype.updateTransform;
    -
    -/**
    - * Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.
    - *
    - * @method getBounds
    - * @return {Rectangle} The rectangular bounding area
    - */
    -PIXI.DisplayObjectContainer.prototype.getBounds = function()
    -{
    -    if(this.children.length === 0)return PIXI.EmptyRectangle;
    -
    -    // TODO the bounds have already been calculated this render session so return what we have
    -
    -    var minX = Infinity;
    -    var minY = Infinity;
    -
    -    var maxX = -Infinity;
    -    var maxY = -Infinity;
    -
    -    var childBounds;
    -    var childMaxX;
    -    var childMaxY;
    -
    -    var childVisible = false;
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        var child = this.children[i];
    -        
    -        if(!child.visible)continue;
    -
    -        childVisible = true;
    -
    -        childBounds = this.children[i].getBounds();
    -     
    -        minX = minX < childBounds.x ? minX : childBounds.x;
    -        minY = minY < childBounds.y ? minY : childBounds.y;
    -
    -        childMaxX = childBounds.width + childBounds.x;
    -        childMaxY = childBounds.height + childBounds.y;
    -
    -        maxX = maxX > childMaxX ? maxX : childMaxX;
    -        maxY = maxY > childMaxY ? maxY : childMaxY;
    -    }
    -
    -    if(!childVisible)
    -        return PIXI.EmptyRectangle;
    -
    -    var bounds = this._bounds;
    -
    -    bounds.x = minX;
    -    bounds.y = minY;
    -    bounds.width = maxX - minX;
    -    bounds.height = maxY - minY;
    -
    -    // TODO: store a reference so that if this function gets called again in the render cycle we do not have to recalculate
    -    //this._currentBounds = bounds;
    -   
    -    return bounds;
    -};
    -
    -/**
    - * Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.
    - *
    - * @method getLocalBounds
    - * @return {Rectangle} The rectangular bounding area
    - */
    -PIXI.DisplayObjectContainer.prototype.getLocalBounds = function()
    -{
    -    var matrixCache = this.worldTransform;
    -
    -    this.worldTransform = PIXI.identityMatrix;
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        this.children[i].updateTransform();
    -    }
    -
    -    var bounds = this.getBounds();
    -
    -    this.worldTransform = matrixCache;
    -
    -    return bounds;
    -};
    -
    -/**
    - * Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.
    - *
    - * @method setStageReference
    - * @param stage {Stage} the stage that the container will have as its current stage reference
    - */
    -PIXI.DisplayObjectContainer.prototype.setStageReference = function(stage)
    -{
    -    this.stage = stage;
    -    if(this._interactive)this.stage.dirty = true;
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        var child = this.children[i];
    -        child.setStageReference(stage);
    -    }
    -};
    -
    -/**
    - * Removes the current stage reference from the container and all of its children.
    - *
    - * @method removeStageReference
    - */
    -PIXI.DisplayObjectContainer.prototype.removeStageReference = function()
    -{
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        var child = this.children[i];
    -        child.removeStageReference();
    -    }
    -
    -    if(this._interactive)this.stage.dirty = true;
    -    
    -    this.stage = null;
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.DisplayObjectContainer.prototype._renderWebGL = function(renderSession)
    -{
    -    if(!this.visible || this.alpha <= 0)return;
    -    
    -    if(this._cacheAsBitmap)
    -    {
    -        this._renderCachedSprite(renderSession);
    -        return;
    -    }
    -    
    -    var i,j;
    -
    -    if(this._mask || this._filters)
    -    {
    -        
    -        // push filter first as we need to ensure the stencil buffer is correct for any masking
    -        if(this._filters)
    -        {
    -            renderSession.spriteBatch.flush();
    -            renderSession.filterManager.pushFilter(this._filterBlock);
    -        }
    -
    -        if(this._mask)
    -        {
    -            renderSession.spriteBatch.stop();
    -            renderSession.maskManager.pushMask(this.mask, renderSession);
    -            renderSession.spriteBatch.start();
    -        }
    -
    -        // simple render children!
    -        for(i=0,j=this.children.length; i<j; i++)
    -        {
    -            this.children[i]._renderWebGL(renderSession);
    -        }
    -
    -        renderSession.spriteBatch.stop();
    -
    -        if(this._mask)renderSession.maskManager.popMask(this._mask, renderSession);
    -        if(this._filters)renderSession.filterManager.popFilter();
    -        
    -        renderSession.spriteBatch.start();
    -    }
    -    else
    -    {
    -        // simple render children!
    -        for(i=0,j=this.children.length; i<j; i++)
    -        {
    -            this.children[i]._renderWebGL(renderSession);
    -        }
    -    }
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.DisplayObjectContainer.prototype._renderCanvas = function(renderSession)
    -{
    -    if(this.visible === false || this.alpha === 0)return;
    -
    -    if(this._cacheAsBitmap)
    -    {
    -
    -        this._renderCachedSprite(renderSession);
    -        return;
    -    }
    -
    -    if(this._mask)
    -    {
    -        renderSession.maskManager.pushMask(this._mask, renderSession);
    -    }
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        var child = this.children[i];
    -        child._renderCanvas(renderSession);
    -    }
    -
    -    if(this._mask)
    -    {
    -        renderSession.maskManager.popMask(renderSession);
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_display_MovieClip.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_display_MovieClip.js.html deleted file mode 100755 index 7096ce6..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_display_MovieClip.js.html +++ /dev/null @@ -1,483 +0,0 @@ - - - - - src/pixi/display/MovieClip.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/MovieClip.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A MovieClip is a simple way to display an animation depicted by a list of textures.
    - *
    - * @class MovieClip
    - * @extends Sprite
    - * @constructor
    - * @param textures {Array<Texture>} an array of {Texture} objects that make up the animation
    - */
    -PIXI.MovieClip = function(textures)
    -{
    -    PIXI.Sprite.call(this, textures[0]);
    -
    -    /**
    -     * The array of textures that make up the animation
    -     *
    -     * @property textures
    -     * @type Array
    -     */
    -    this.textures = textures;
    -
    -    /**
    -     * The speed that the MovieClip will play at. Higher is faster, lower is slower
    -     *
    -     * @property animationSpeed
    -     * @type Number
    -     * @default 1
    -     */
    -    this.animationSpeed = 1;
    -
    -    /**
    -     * Whether or not the movie clip repeats after playing.
    -     *
    -     * @property loop
    -     * @type Boolean
    -     * @default true
    -     */
    -    this.loop = true;
    -
    -    /**
    -     * Function to call when a MovieClip finishes playing
    -     *
    -     * @property onComplete
    -     * @type Function
    -     */
    -    this.onComplete = null;
    -
    -    /**
    -     * [read-only] The MovieClips current frame index (this may not have to be a whole number)
    -     *
    -     * @property currentFrame
    -     * @type Number
    -     * @default 0
    -     * @readOnly
    -     */
    -    this.currentFrame = 0;
    -
    -    /**
    -     * [read-only] Indicates if the MovieClip is currently playing
    -     *
    -     * @property playing
    -     * @type Boolean
    -     * @readOnly
    -     */
    -    this.playing = false;
    -};
    -
    -// constructor
    -PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    -PIXI.MovieClip.prototype.constructor = PIXI.MovieClip;
    -
    -/**
    -* [read-only] totalFrames is the total number of frames in the MovieClip. This is the same as number of textures
    -* assigned to the MovieClip.
    -*
    -* @property totalFrames
    -* @type Number
    -* @default 0
    -* @readOnly
    -*/
    -Object.defineProperty( PIXI.MovieClip.prototype, 'totalFrames', {
    -	get: function() {
    -
    -		return this.textures.length;
    -	}
    -});
    -
    -/**
    - * Stops the MovieClip
    - *
    - * @method stop
    - */
    -PIXI.MovieClip.prototype.stop = function()
    -{
    -    this.playing = false;
    -};
    -
    -/**
    - * Plays the MovieClip
    - *
    - * @method play
    - */
    -PIXI.MovieClip.prototype.play = function()
    -{
    -    this.playing = true;
    -};
    -
    -/**
    - * Stops the MovieClip and goes to a specific frame
    - *
    - * @method gotoAndStop
    - * @param frameNumber {Number} frame index to stop at
    - */
    -PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    -{
    -    this.playing = false;
    -    this.currentFrame = frameNumber;
    -    var round = (this.currentFrame + 0.5) | 0;
    -    this.setTexture(this.textures[round % this.textures.length]);
    -};
    -
    -/**
    - * Goes to a specific frame and begins playing the MovieClip
    - *
    - * @method gotoAndPlay
    - * @param frameNumber {Number} frame index to start at
    - */
    -PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    -{
    -    this.currentFrame = frameNumber;
    -    this.playing = true;
    -};
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.MovieClip.prototype.updateTransform = function()
    -{
    -    PIXI.Sprite.prototype.updateTransform.call(this);
    -
    -    if(!this.playing)return;
    -
    -    this.currentFrame += this.animationSpeed;
    -
    -    var round = (this.currentFrame + 0.5) | 0;
    -
    -    this.currentFrame = this.currentFrame % this.textures.length;
    -
    -    if(this.loop || round < this.textures.length)
    -    {
    -        this.setTexture(this.textures[round % this.textures.length]);
    -    }
    -    else if(round >= this.textures.length)
    -    {
    -        this.gotoAndStop(this.textures.length - 1);
    -        if(this.onComplete)
    -        {
    -            this.onComplete();
    -        }
    -    }
    -};
    -
    -/**
    - * A short hand way of creating a movieclip from an array of frame ids
    - *
    - * @static
    - * @method fromFrames
    - * @param frames {Array} the array of frames ids the movieclip will use as its texture frames
    - */
    -PIXI.MovieClip.fromFrames = function(frames)
    -{
    -    var textures = [];
    -
    -    for (var i = 0; i < frames.length; i++)
    -    {
    -        textures.push(new PIXI.Texture.fromFrame(frames[i]));
    -    }
    -
    -    return new PIXI.MovieClip(textures);
    -};
    -
    -/**
    - * A short hand way of creating a movieclip from an array of image ids
    - *
    - * @static
    - * @method fromImages
    - * @param frames {Array} the array of image ids the movieclip will use as its texture frames
    - */
    -PIXI.MovieClip.fromImages = function(images)
    -{
    -    var textures = [];
    -
    -    for (var i = 0; i < images.length; i++)
    -    {
    -        textures.push(new PIXI.Texture.fromImage(images[i]));
    -    }
    -
    -    return new PIXI.MovieClip(textures);
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_display_Sprite.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_display_Sprite.js.html deleted file mode 100755 index f92d36c..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_display_Sprite.js.html +++ /dev/null @@ -1,727 +0,0 @@ - - - - - src/pixi/display/Sprite.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/Sprite.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The Sprite object is the base for all textured objects that are rendered to the screen
    - *
    - * @class Sprite
    - * @extends DisplayObjectContainer
    - * @constructor
    - * @param texture {Texture} The texture for this sprite
    - *
    - * A sprite can be created directly from an image like this :
    - * var sprite = new PIXI.Sprite.fromImage('assets/image.png');
    - * yourStage.addChild(sprite);
    - * then obviously don't forget to add it to the stage you have already created
    - */
    -PIXI.Sprite = function(texture)
    -{
    -    PIXI.DisplayObjectContainer.call( this );
    -
    -    /**
    -     * The anchor sets the origin point of the texture.
    -     * The default is 0,0 this means the texture's origin is the top left
    -     * Setting than anchor to 0.5,0.5 means the textures origin is centered
    -     * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner
    -     *
    -     * @property anchor
    -     * @type Point
    -     */
    -    this.anchor = new PIXI.Point();
    -
    -    /**
    -     * The texture that the sprite is using
    -     *
    -     * @property texture
    -     * @type Texture
    -     */
    -    this.texture = texture;
    -
    -    /**
    -     * The width of the sprite (this is initially set by the texture)
    -     *
    -     * @property _width
    -     * @type Number
    -     * @private
    -     */
    -    this._width = 0;
    -
    -    /**
    -     * The height of the sprite (this is initially set by the texture)
    -     *
    -     * @property _height
    -     * @type Number
    -     * @private
    -     */
    -    this._height = 0;
    -
    -    /**
    -     * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.
    -     *
    -     * @property tint
    -     * @type Number
    -     * @default 0xFFFFFF
    -     */
    -    this.tint = 0xFFFFFF;
    -
    -    /**
    -     * The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.
    -     *
    -     * @property blendMode
    -     * @type Number
    -     * @default PIXI.blendModes.NORMAL;
    -     */
    -    this.blendMode = PIXI.blendModes.NORMAL;
    -
    -    /**
    -     * The shader that will be used to render the texture to the stage. Set to null to remove a current shader.
    -     *
    -     * @property shader
    -     * @type PIXI.AbstractFilter
    -     * @default null
    -     */
    -    this.shader = null;
    -
    -    if(texture.baseTexture.hasLoaded)
    -    {
    -        this.onTextureUpdate();
    -    }
    -    else
    -    {
    -        this.texture.on( 'update', this.onTextureUpdate.bind(this) );
    -    }
    -
    -    this.renderable = true;
    -
    -};
    -
    -// constructor
    -PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    -PIXI.Sprite.prototype.constructor = PIXI.Sprite;
    -
    -/**
    - * The width of the sprite, setting this will actually modify the scale to achieve the value set
    - *
    - * @property width
    - * @type Number
    - */
    -Object.defineProperty(PIXI.Sprite.prototype, 'width', {
    -    get: function() {
    -        return this.scale.x * this.texture.frame.width;
    -    },
    -    set: function(value) {
    -        this.scale.x = value / this.texture.frame.width;
    -        this._width = value;
    -    }
    -});
    -
    -/**
    - * The height of the sprite, setting this will actually modify the scale to achieve the value set
    - *
    - * @property height
    - * @type Number
    - */
    -Object.defineProperty(PIXI.Sprite.prototype, 'height', {
    -    get: function() {
    -        return  this.scale.y * this.texture.frame.height;
    -    },
    -    set: function(value) {
    -        this.scale.y = value / this.texture.frame.height;
    -        this._height = value;
    -    }
    -});
    -
    -/**
    - * Sets the texture of the sprite
    - *
    - * @method setTexture
    - * @param texture {Texture} The PIXI texture that is displayed by the sprite
    - */
    -PIXI.Sprite.prototype.setTexture = function(texture)
    -{
    -    this.texture = texture;
    -    this.cachedTint = 0xFFFFFF;
    -};
    -
    -/**
    - * When the texture is updated, this event will fire to update the scale and frame
    - *
    - * @method onTextureUpdate
    - * @param event
    - * @private
    - */
    -PIXI.Sprite.prototype.onTextureUpdate = function()
    -{
    -    // so if _width is 0 then width was not set..
    -    if(this._width)this.scale.x = this._width / this.texture.frame.width;
    -    if(this._height)this.scale.y = this._height / this.texture.frame.height;
    -
    -    //this.updateFrame = true;
    -};
    -
    -/**
    -* Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account.
    -*
    -* @method getBounds
    -* @param matrix {Matrix} the transformation matrix of the sprite
    -* @return {Rectangle} the framing rectangle
    -*/
    -PIXI.Sprite.prototype.getBounds = function(matrix)
    -{
    -    var width = this.texture.frame.width;
    -    var height = this.texture.frame.height;
    -
    -    var w0 = width * (1-this.anchor.x);
    -    var w1 = width * -this.anchor.x;
    -
    -    var h0 = height * (1-this.anchor.y);
    -    var h1 = height * -this.anchor.y;
    -
    -    var worldTransform = matrix || this.worldTransform ;
    -
    -    var a = worldTransform.a;
    -    var b = worldTransform.b;
    -    var c = worldTransform.c;
    -    var d = worldTransform.d;
    -    var tx = worldTransform.tx;
    -    var ty = worldTransform.ty;
    -
    -    var x1 = a * w1 + c * h1 + tx;
    -    var y1 = d * h1 + b * w1 + ty;
    -
    -    var x2 = a * w0 + c * h1 + tx;
    -    var y2 = d * h1 + b * w0 + ty;
    -
    -    var x3 = a * w0 + c * h0 + tx;
    -    var y3 = d * h0 + b * w0 + ty;
    -
    -    var x4 =  a * w1 + c * h0 + tx;
    -    var y4 =  d * h0 + b * w1 + ty;
    -
    -    var maxX = -Infinity;
    -    var maxY = -Infinity;
    -
    -    var minX = Infinity;
    -    var minY = Infinity;
    -
    -    minX = x1 < minX ? x1 : minX;
    -    minX = x2 < minX ? x2 : minX;
    -    minX = x3 < minX ? x3 : minX;
    -    minX = x4 < minX ? x4 : minX;
    -
    -    minY = y1 < minY ? y1 : minY;
    -    minY = y2 < minY ? y2 : minY;
    -    minY = y3 < minY ? y3 : minY;
    -    minY = y4 < minY ? y4 : minY;
    -
    -    maxX = x1 > maxX ? x1 : maxX;
    -    maxX = x2 > maxX ? x2 : maxX;
    -    maxX = x3 > maxX ? x3 : maxX;
    -    maxX = x4 > maxX ? x4 : maxX;
    -
    -    maxY = y1 > maxY ? y1 : maxY;
    -    maxY = y2 > maxY ? y2 : maxY;
    -    maxY = y3 > maxY ? y3 : maxY;
    -    maxY = y4 > maxY ? y4 : maxY;
    -
    -    var bounds = this._bounds;
    -
    -    bounds.x = minX;
    -    bounds.width = maxX - minX;
    -
    -    bounds.y = minY;
    -    bounds.height = maxY - minY;
    -
    -    // store a reference so that if this function gets called again in the render cycle we do not have to recalculate
    -    this._currentBounds = bounds;
    -
    -    return bounds;
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession}
    -* @private
    -*/
    -PIXI.Sprite.prototype._renderWebGL = function(renderSession)
    -{
    -    // if the sprite is not visible or the alpha is 0 then no need to render this element
    -    if(!this.visible || this.alpha <= 0)return;
    -
    -    var i,j;
    -
    -    // do a quick check to see if this element has a mask or a filter.
    -    if(this._mask || this._filters)
    -    {
    -        var spriteBatch =  renderSession.spriteBatch;
    -
    -        // push filter first as we need to ensure the stencil buffer is correct for any masking
    -        if(this._filters)
    -        {
    -            spriteBatch.flush();
    -            renderSession.filterManager.pushFilter(this._filterBlock);
    -        }
    -
    -        if(this._mask)
    -        {
    -            spriteBatch.stop();
    -            renderSession.maskManager.pushMask(this.mask, renderSession);
    -            spriteBatch.start();
    -        }
    -
    -        // add this sprite to the batch
    -        spriteBatch.render(this);
    -
    -        // now loop through the children and make sure they get rendered
    -        for(i=0,j=this.children.length; i<j; i++)
    -        {
    -            this.children[i]._renderWebGL(renderSession);
    -        }
    -
    -        // time to stop the sprite batch as either a mask element or a filter draw will happen next
    -        spriteBatch.stop();
    -
    -        if(this._mask)renderSession.maskManager.popMask(this._mask, renderSession);
    -        if(this._filters)renderSession.filterManager.popFilter();
    -
    -        spriteBatch.start();
    -    }
    -    else
    -    {
    -        renderSession.spriteBatch.render(this);
    -
    -        // simple render children!
    -        for(i=0,j=this.children.length; i<j; i++)
    -        {
    -            this.children[i]._renderWebGL(renderSession);
    -        }
    -
    -    }
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession}
    -* @private
    -*/
    -PIXI.Sprite.prototype._renderCanvas = function(renderSession)
    -{
    -    // If the sprite is not visible or the alpha is 0 then no need to render this element
    -    if (this.visible === false || this.alpha === 0 || this.texture.crop.width <= 0 || this.texture.crop.height <= 0) return;
    -
    -    if (this.blendMode !== renderSession.currentBlendMode)
    -    {
    -        renderSession.currentBlendMode = this.blendMode;
    -        renderSession.context.globalCompositeOperation = PIXI.blendModesCanvas[renderSession.currentBlendMode];
    -    }
    -
    -    if (this._mask)
    -    {
    -        renderSession.maskManager.pushMask(this._mask, renderSession);
    -    }
    -
    -    //  Ignore null sources
    -    if (this.texture.valid)
    -    {
    -        var resolution = this.texture.baseTexture.resolution / renderSession.resolution;
    -
    -        renderSession.context.globalAlpha = this.worldAlpha;
    -
    -        //  Allow for pixel rounding
    -        if (renderSession.roundPixels)
    -        {
    -            renderSession.context.setTransform(
    -                this.worldTransform.a,
    -                this.worldTransform.b,
    -                this.worldTransform.c,
    -                this.worldTransform.d,
    -                (this.worldTransform.tx* renderSession.resolution) | 0,
    -                (this.worldTransform.ty* renderSession.resolution) | 0);
    -        }
    -        else
    -        {
    -            renderSession.context.setTransform(
    -                this.worldTransform.a,
    -                this.worldTransform.b,
    -                this.worldTransform.c,
    -                this.worldTransform.d,
    -                this.worldTransform.tx * renderSession.resolution,
    -                this.worldTransform.ty * renderSession.resolution);
    -        }
    -
    -        //  If smoothingEnabled is supported and we need to change the smoothing property for this texture
    -        if (renderSession.smoothProperty && renderSession.scaleMode !== this.texture.baseTexture.scaleMode)
    -        {
    -            renderSession.scaleMode = this.texture.baseTexture.scaleMode;
    -            renderSession.context[renderSession.smoothProperty] = (renderSession.scaleMode === PIXI.scaleModes.LINEAR);
    -        }
    -
    -        //  If the texture is trimmed we offset by the trim x/y, otherwise we use the frame dimensions
    -        var dx = (this.texture.trim) ? this.texture.trim.x - this.anchor.x * this.texture.trim.width : this.anchor.x * -this.texture.frame.width;
    -        var dy = (this.texture.trim) ? this.texture.trim.y - this.anchor.y * this.texture.trim.height : this.anchor.y * -this.texture.frame.height;
    -
    -        if (this.tint !== 0xFFFFFF)
    -        {
    -            if (this.cachedTint !== this.tint)
    -            {
    -                this.cachedTint = this.tint;
    -
    -                //  TODO clean up caching - how to clean up the caches?
    -                this.tintedTexture = PIXI.CanvasTinter.getTintedTexture(this, this.tint);
    -            }
    -
    -            renderSession.context.drawImage(
    -                                this.tintedTexture,
    -                                0,
    -                                0,
    -                                this.texture.crop.width,
    -                                this.texture.crop.height,
    -                                dx / resolution,
    -                                dy / resolution,
    -                                this.texture.crop.width / resolution,
    -                                this.texture.crop.height / resolution);
    -        }
    -        else
    -        {
    -            renderSession.context.drawImage(
    -                                this.texture.baseTexture.source,
    -                                this.texture.crop.x,
    -                                this.texture.crop.y,
    -                                this.texture.crop.width,
    -                                this.texture.crop.height,
    -                                dx / resolution,
    -                                dy / resolution,
    -                                this.texture.crop.width / resolution,
    -                                this.texture.crop.height / resolution);
    -        }
    -    }
    -
    -    // OVERWRITE
    -    for (var i = 0, j = this.children.length; i < j; i++)
    -    {
    -        this.children[i]._renderCanvas(renderSession);
    -    }
    -
    -    if (this._mask)
    -    {
    -        renderSession.maskManager.popMask(renderSession);
    -    }
    -};
    -
    -// some helper functions..
    -
    -/**
    - *
    - * Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId
    - * The frame ids are created when a Texture packer file has been loaded
    - *
    - * @method fromFrame
    - * @static
    - * @param frameId {String} The frame Id of the texture in the cache
    - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    - */
    -PIXI.Sprite.fromFrame = function(frameId)
    -{
    -    var texture = PIXI.TextureCache[frameId];
    -    if(!texture) throw new Error('The frameId "' + frameId + '" does not exist in the texture cache' + this);
    -    return new PIXI.Sprite(texture);
    -};
    -
    -/**
    - *
    - * Helper function that creates a sprite that will contain a texture based on an image url
    - * If the image is not in the texture cache it will be loaded
    - *
    - * @method fromImage
    - * @static
    - * @param imageId {String} The image url of the texture
    - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    - */
    -PIXI.Sprite.fromImage = function(imageId, crossorigin, scaleMode)
    -{
    -    var texture = PIXI.Texture.fromImage(imageId, crossorigin, scaleMode);
    -    return new PIXI.Sprite(texture);
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_display_SpriteBatch.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_display_SpriteBatch.js.html deleted file mode 100755 index b54f4c1..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_display_SpriteBatch.js.html +++ /dev/null @@ -1,455 +0,0 @@ - - - - - src/pixi/display/SpriteBatch.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/SpriteBatch.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/
    - */
    -
    -/**
    - * The SpriteBatch class is a really fast version of the DisplayObjectContainer 
    - * built solely for speed, so use when you need a lot of sprites or particles.
    - * And it's extremely easy to use : 
    -
    -    var container = new PIXI.SpriteBatch();
    - 
    -    stage.addChild(container);
    - 
    -    for(var i  = 0; i < 100; i++)
    -    {
    -        var sprite = new PIXI.Sprite.fromImage("myImage.png");
    -        container.addChild(sprite);
    -    }
    - * And here you have a hundred sprites that will be renderer at the speed of light
    - *
    - * @class SpriteBatch
    - * @constructor
    - * @param texture {Texture}
    - */
    -
    -//TODO RENAME to PARTICLE CONTAINER?
    -PIXI.SpriteBatch = function(texture)
    -{
    -    PIXI.DisplayObjectContainer.call( this);
    -
    -    this.textureThing = texture;
    -
    -    this.ready = false;
    -};
    -
    -PIXI.SpriteBatch.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
    -PIXI.SpriteBatch.prototype.constructor = PIXI.SpriteBatch;
    -
    -/*
    - * Initialises the spriteBatch
    - *
    - * @method initWebGL
    - * @param gl {WebGLContext} the current WebGL drawing context
    - */
    -PIXI.SpriteBatch.prototype.initWebGL = function(gl)
    -{
    -    // TODO only one needed for the whole engine really?
    -    this.fastSpriteBatch = new PIXI.WebGLFastSpriteBatch(gl);
    -
    -    this.ready = true;
    -};
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.SpriteBatch.prototype.updateTransform = function()
    -{
    -    // TODO don't need to!
    -    PIXI.DisplayObject.prototype.updateTransform.call( this );
    -    //  PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.SpriteBatch.prototype._renderWebGL = function(renderSession)
    -{
    -    if(!this.visible || this.alpha <= 0 || !this.children.length)return;
    -
    -    if(!this.ready)this.initWebGL( renderSession.gl );
    -    
    -    renderSession.spriteBatch.stop();
    -    
    -    renderSession.shaderManager.setShader(renderSession.shaderManager.fastShader);
    -    
    -    this.fastSpriteBatch.begin(this, renderSession);
    -    this.fastSpriteBatch.render(this);
    -
    -    renderSession.spriteBatch.start();
    - 
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.SpriteBatch.prototype._renderCanvas = function(renderSession)
    -{
    -    if(!this.visible || this.alpha <= 0 || !this.children.length)return;
    -    
    -    var context = renderSession.context;
    -    context.globalAlpha = this.worldAlpha;
    -
    -    PIXI.DisplayObject.prototype.updateTransform.call(this);
    -
    -    var transform = this.worldTransform;
    -    // alow for trimming
    -       
    -    var isRotated = true;
    -
    -    for (var i = 0; i < this.children.length; i++) {
    -       
    -        var child = this.children[i];
    -
    -        if(!child.visible)continue;
    -
    -        var texture = child.texture;
    -        var frame = texture.frame;
    -
    -        context.globalAlpha = this.worldAlpha * child.alpha;
    -
    -        if(child.rotation % (Math.PI * 2) === 0)
    -        {
    -            if(isRotated)
    -            {
    -                context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);
    -                isRotated = false;
    -            }
    -
    -            // this is the fastest  way to optimise! - if rotation is 0 then we can avoid any kind of setTransform call
    -            context.drawImage(texture.baseTexture.source,
    -                                 frame.x,
    -                                 frame.y,
    -                                 frame.width,
    -                                 frame.height,
    -                                 ((child.anchor.x) * (-frame.width * child.scale.x) + child.position.x  + 0.5) | 0,
    -                                 ((child.anchor.y) * (-frame.height * child.scale.y) + child.position.y  + 0.5) | 0,
    -                                 frame.width * child.scale.x,
    -                                 frame.height * child.scale.y);
    -        }
    -        else
    -        {
    -            if(!isRotated)isRotated = true;
    -    
    -            PIXI.DisplayObject.prototype.updateTransform.call(child);
    -           
    -            var childTransform = child.worldTransform;
    -
    -            // allow for trimming
    -           
    -            if (renderSession.roundPixels)
    -            {
    -                context.setTransform(childTransform.a, childTransform.b, childTransform.c, childTransform.d, childTransform.tx | 0, childTransform.ty | 0);
    -            }
    -            else
    -            {
    -                context.setTransform(childTransform.a, childTransform.b, childTransform.c, childTransform.d, childTransform.tx, childTransform.ty);
    -            }
    -
    -            context.drawImage(texture.baseTexture.source,
    -                                 frame.x,
    -                                 frame.y,
    -                                 frame.width,
    -                                 frame.height,
    -                                 ((child.anchor.x) * (-frame.width) + 0.5) | 0,
    -                                 ((child.anchor.y) * (-frame.height) + 0.5) | 0,
    -                                 frame.width,
    -                                 frame.height);
    -           
    -
    -        }
    -
    -       // context.restore();
    -    }
    -
    -//    context.restore();
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_display_Stage.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_display_Stage.js.html deleted file mode 100755 index 435f9dd..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_display_Stage.js.html +++ /dev/null @@ -1,413 +0,0 @@ - - - - - src/pixi/display/Stage.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/Stage.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A Stage represents the root of the display tree. Everything connected to the stage is rendered
    - *
    - * @class Stage
    - * @extends DisplayObjectContainer
    - * @constructor
    - * @param backgroundColor {Number} the background color of the stage, you have to pass this in is in hex format
    - *      like: 0xFFFFFF for white
    - * 
    - * Creating a stage is a mandatory process when you use Pixi, which is as simple as this : 
    - * var stage = new PIXI.Stage(0xFFFFFF);
    - * where the parameter given is the background colour of the stage, in hex
    - * you will use this stage instance to add your sprites to it and therefore to the renderer
    - * Here is how to add a sprite to the stage : 
    - * stage.addChild(sprite);
    - */
    -PIXI.Stage = function(backgroundColor)
    -{
    -    PIXI.DisplayObjectContainer.call( this );
    -
    -    /**
    -     * [read-only] Current transform of the object based on world (parent) factors
    -     *
    -     * @property worldTransform
    -     * @type Matrix
    -     * @readOnly
    -     * @private
    -     */
    -    this.worldTransform = new PIXI.Matrix();
    -
    -    /**
    -     * Whether or not the stage is interactive
    -     *
    -     * @property interactive
    -     * @type Boolean
    -     */
    -    this.interactive = true;
    -
    -    /**
    -     * The interaction manage for this stage, manages all interactive activity on the stage
    -     *
    -     * @property interactionManager
    -     * @type InteractionManager
    -     */
    -    this.interactionManager = new PIXI.InteractionManager(this);
    -
    -    /**
    -     * Whether the stage is dirty and needs to have interactions updated
    -     *
    -     * @property dirty
    -     * @type Boolean
    -     * @private
    -     */
    -    this.dirty = true;
    -
    -    //the stage is its own stage
    -    this.stage = this;
    -
    -    //optimize hit detection a bit
    -    this.stage.hitArea = new PIXI.Rectangle(0, 0, 100000, 100000);
    -
    -    this.setBackgroundColor(backgroundColor);
    -};
    -
    -// constructor
    -PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    -PIXI.Stage.prototype.constructor = PIXI.Stage;
    -
    -/**
    - * Sets another DOM element which can receive mouse/touch interactions instead of the default Canvas element.
    - * This is useful for when you have other DOM elements on top of the Canvas element.
    - *
    - * @method setInteractionDelegate
    - * @param domElement {DOMElement} This new domElement which will receive mouse/touch events
    - */
    -PIXI.Stage.prototype.setInteractionDelegate = function(domElement)
    -{
    -    this.interactionManager.setTargetDomElement( domElement );
    -};
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.Stage.prototype.updateTransform = function()
    -{
    -    this.worldAlpha = 1;
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        this.children[i].updateTransform();
    -    }
    -
    -    if(this.dirty)
    -    {
    -        this.dirty = false;
    -        // update interactive!
    -        this.interactionManager.dirty = true;
    -    }
    -
    -    if(this.interactive)this.interactionManager.update();
    -};
    -
    -/**
    - * Sets the background color for the stage
    - *
    - * @method setBackgroundColor
    - * @param backgroundColor {Number} the color of the background, easiest way to pass this in is in hex format
    - *      like: 0xFFFFFF for white
    - */
    -PIXI.Stage.prototype.setBackgroundColor = function(backgroundColor)
    -{
    -    this.backgroundColor = backgroundColor || 0x000000;
    -    this.backgroundColorSplit = PIXI.hex2rgb(this.backgroundColor);
    -    var hex = this.backgroundColor.toString(16);
    -    hex = '000000'.substr(0, 6 - hex.length) + hex;
    -    this.backgroundColorString = '#' + hex;
    -};
    -
    -/**
    - * This will return the point containing global coordinates of the mouse.
    - *
    - * @method getMousePosition
    - * @return {Point} A point containing the coordinates of the global InteractionData position.
    - */
    -PIXI.Stage.prototype.getMousePosition = function()
    -{
    -    return this.interactionManager.mouse.global;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_extras_Rope.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_extras_Rope.js.html deleted file mode 100755 index f4fd44c..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_extras_Rope.js.html +++ /dev/null @@ -1,452 +0,0 @@ - - - - - src/pixi/extras/Rope.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/extras/Rope.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * @copyright Mat Groves, Rovanion Luckey
    - */
    -
    -/**
    - *
    - * @class Rope
    - * @constructor
    - * @extends Strip
    - * @param {Texture} texture - The texture to use on the rope.
    - * @param {Array} points - An array of {PIXI.Point}.
    - *
    - */
    -PIXI.Rope = function(texture, points)
    -{
    -    PIXI.Strip.call( this, texture );
    -    this.points = points;
    -
    -    this.verticies = new PIXI.Float32Array(points.length * 4);
    -    this.uvs = new PIXI.Float32Array(points.length * 4);
    -    this.colors = new PIXI.Float32Array(points.length * 2);
    -    this.indices = new PIXI.Uint16Array(points.length * 2);
    -
    -
    -    this.refresh();
    -};
    -
    -
    -// constructor
    -PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    -PIXI.Rope.prototype.constructor = PIXI.Rope;
    -
    -/*
    - * Refreshes
    - *
    - * @method refresh
    - */
    -PIXI.Rope.prototype.refresh = function()
    -{
    -    var points = this.points;
    -    if(points.length < 1) return;
    -
    -    var uvs = this.uvs;
    -
    -    var lastPoint = points[0];
    -    var indices = this.indices;
    -    var colors = this.colors;
    -
    -    this.count-=0.2;
    -
    -    uvs[0] = 0;
    -    uvs[1] = 0;
    -    uvs[2] = 0;
    -    uvs[3] = 1;
    -
    -    colors[0] = 1;
    -    colors[1] = 1;
    -
    -    indices[0] = 0;
    -    indices[1] = 1;
    -
    -    var total = points.length,
    -        point, index, amount;
    -
    -    for (var i = 1; i < total; i++)
    -    {
    -        point = points[i];
    -        index = i * 4;
    -        // time to do some smart drawing!
    -        amount = i / (total-1);
    -
    -        if(i%2)
    -        {
    -            uvs[index] = amount;
    -            uvs[index+1] = 0;
    -
    -            uvs[index+2] = amount;
    -            uvs[index+3] = 1;
    -        }
    -        else
    -        {
    -            uvs[index] = amount;
    -            uvs[index+1] = 0;
    -
    -            uvs[index+2] = amount;
    -            uvs[index+3] = 1;
    -        }
    -
    -        index = i * 2;
    -        colors[index] = 1;
    -        colors[index+1] = 1;
    -
    -        index = i * 2;
    -        indices[index] = index;
    -        indices[index + 1] = index + 1;
    -
    -        lastPoint = point;
    -    }
    -};
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.Rope.prototype.updateTransform = function()
    -{
    -
    -    var points = this.points;
    -    if(points.length < 1)return;
    -
    -    var lastPoint = points[0];
    -    var nextPoint;
    -    var perp = {x:0, y:0};
    -
    -    this.count-=0.2;
    -
    -    var verticies = this.verticies;
    -    var total = points.length,
    -        point, index, ratio, perpLength, num;
    -
    -    for (var i = 0; i < total; i++)
    -    {
    -        point = points[i];
    -        index = i * 4;
    -
    -        if(i < points.length-1)
    -        {
    -            nextPoint = points[i+1];
    -        }
    -        else
    -        {
    -            nextPoint = point;
    -        }
    -
    -        perp.y = -(nextPoint.x - lastPoint.x);
    -        perp.x = nextPoint.y - lastPoint.y;
    -
    -        ratio = (1 - (i / (total-1))) * 10;
    -
    -        if(ratio > 1) ratio = 1;
    -
    -        perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    -        num = this.texture.height / 2; //(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    -        perp.x /= perpLength;
    -        perp.y /= perpLength;
    -
    -        perp.x *= num;
    -        perp.y *= num;
    -
    -        verticies[index] = point.x + perp.x;
    -        verticies[index+1] = point.y + perp.y;
    -        verticies[index+2] = point.x - perp.x;
    -        verticies[index+3] = point.y - perp.y;
    -
    -        lastPoint = point;
    -    }
    -
    -    PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    -};
    -/*
    - * Sets the texture that the Rope will use
    - *
    - * @method setTexture
    - * @param texture {Texture} the texture that will be used
    - */
    -PIXI.Rope.prototype.setTexture = function(texture)
    -{
    -    // stop current texture
    -    this.texture = texture;
    -    //this.updateFrame = true;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_extras_Spine.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_extras_Spine.js.html deleted file mode 100755 index a534e13..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_extras_Spine.js.html +++ /dev/null @@ -1,1752 +0,0 @@ - - - - - src/pixi/extras/Spine.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/extras/Spine.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * based on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi
    - *
    - * Awesome JS run time provided by EsotericSoftware
    - * https://github.com/EsotericSoftware/spine-runtimes
    - *
    - */
    -
    -/*
    - * Awesome JS run time provided by EsotericSoftware
    - *
    - * https://github.com/EsotericSoftware/spine-runtimes
    - *
    - */
    -
    -
    -
    -var spine = {};
    -
    -spine.BoneData = function (name, parent) {
    -    this.name = name;
    -    this.parent = parent;
    -};
    -spine.BoneData.prototype = {
    -    length: 0,
    -    x: 0, y: 0,
    -    rotation: 0,
    -    scaleX: 1, scaleY: 1
    -};
    -
    -spine.SlotData = function (name, boneData) {
    -    this.name = name;
    -    this.boneData = boneData;
    -};
    -spine.SlotData.prototype = {
    -    r: 1, g: 1, b: 1, a: 1,
    -    attachmentName: null
    -};
    -
    -spine.Bone = function (boneData, parent) {
    -    this.data = boneData;
    -    this.parent = parent;
    -    this.setToSetupPose();
    -};
    -spine.Bone.yDown = false;
    -spine.Bone.prototype = {
    -    x: 0, y: 0,
    -    rotation: 0,
    -    scaleX: 1, scaleY: 1,
    -    m00: 0, m01: 0, worldX: 0, // a b x
    -    m10: 0, m11: 0, worldY: 0, // c d y
    -    worldRotation: 0,
    -    worldScaleX: 1, worldScaleY: 1,
    -    updateWorldTransform: function (flipX, flipY) {
    -        var parent = this.parent;
    -        if (parent != null) {
    -            this.worldX = this.x * parent.m00 + this.y * parent.m01 + parent.worldX;
    -            this.worldY = this.x * parent.m10 + this.y * parent.m11 + parent.worldY;
    -            this.worldScaleX = parent.worldScaleX * this.scaleX;
    -            this.worldScaleY = parent.worldScaleY * this.scaleY;
    -            this.worldRotation = parent.worldRotation + this.rotation;
    -        } else {
    -            this.worldX = this.x;
    -            this.worldY = this.y;
    -            this.worldScaleX = this.scaleX;
    -            this.worldScaleY = this.scaleY;
    -            this.worldRotation = this.rotation;
    -        }
    -        var radians = this.worldRotation * Math.PI / 180;
    -        var cos = Math.cos(radians);
    -        var sin = Math.sin(radians);
    -        this.m00 = cos * this.worldScaleX;
    -        this.m10 = sin * this.worldScaleX;
    -        this.m01 = -sin * this.worldScaleY;
    -        this.m11 = cos * this.worldScaleY;
    -        if (flipX) {
    -            this.m00 = -this.m00;
    -            this.m01 = -this.m01;
    -        }
    -        if (flipY) {
    -            this.m10 = -this.m10;
    -            this.m11 = -this.m11;
    -        }
    -        if (spine.Bone.yDown) {
    -            this.m10 = -this.m10;
    -            this.m11 = -this.m11;
    -        }
    -    },
    -    setToSetupPose: function () {
    -        var data = this.data;
    -        this.x = data.x;
    -        this.y = data.y;
    -        this.rotation = data.rotation;
    -        this.scaleX = data.scaleX;
    -        this.scaleY = data.scaleY;
    -    }
    -};
    -
    -spine.Slot = function (slotData, skeleton, bone) {
    -    this.data = slotData;
    -    this.skeleton = skeleton;
    -    this.bone = bone;
    -    this.setToSetupPose();
    -};
    -spine.Slot.prototype = {
    -    r: 1, g: 1, b: 1, a: 1,
    -    _attachmentTime: 0,
    -    attachment: null,
    -    setAttachment: function (attachment) {
    -        this.attachment = attachment;
    -        this._attachmentTime = this.skeleton.time;
    -    },
    -    setAttachmentTime: function (time) {
    -        this._attachmentTime = this.skeleton.time - time;
    -    },
    -    getAttachmentTime: function () {
    -        return this.skeleton.time - this._attachmentTime;
    -    },
    -    setToSetupPose: function () {
    -        var data = this.data;
    -        this.r = data.r;
    -        this.g = data.g;
    -        this.b = data.b;
    -        this.a = data.a;
    -
    -        var slotDatas = this.skeleton.data.slots;
    -        for (var i = 0, n = slotDatas.length; i < n; i++) {
    -            if (slotDatas[i] == data) {
    -                this.setAttachment(!data.attachmentName ? null : this.skeleton.getAttachmentBySlotIndex(i, data.attachmentName));
    -                break;
    -            }
    -        }
    -    }
    -};
    -
    -spine.Skin = function (name) {
    -    this.name = name;
    -    this.attachments = {};
    -};
    -spine.Skin.prototype = {
    -    addAttachment: function (slotIndex, name, attachment) {
    -        this.attachments[slotIndex + ":" + name] = attachment;
    -    },
    -    getAttachment: function (slotIndex, name) {
    -        return this.attachments[slotIndex + ":" + name];
    -    },
    -    _attachAll: function (skeleton, oldSkin) {
    -        for (var key in oldSkin.attachments) {
    -            var colon = key.indexOf(":");
    -            var slotIndex = parseInt(key.substring(0, colon), 10);
    -            var name = key.substring(colon + 1);
    -            var slot = skeleton.slots[slotIndex];
    -            if (slot.attachment && slot.attachment.name == name) {
    -                var attachment = this.getAttachment(slotIndex, name);
    -                if (attachment) slot.setAttachment(attachment);
    -            }
    -        }
    -    }
    -};
    -
    -spine.Animation = function (name, timelines, duration) {
    -    this.name = name;
    -    this.timelines = timelines;
    -    this.duration = duration;
    -};
    -spine.Animation.prototype = {
    -    apply: function (skeleton, time, loop) {
    -        if (loop && this.duration) time %= this.duration;
    -        var timelines = this.timelines;
    -        for (var i = 0, n = timelines.length; i < n; i++)
    -            timelines[i].apply(skeleton, time, 1);
    -    },
    -    mix: function (skeleton, time, loop, alpha) {
    -        if (loop && this.duration) time %= this.duration;
    -        var timelines = this.timelines;
    -        for (var i = 0, n = timelines.length; i < n; i++)
    -            timelines[i].apply(skeleton, time, alpha);
    -    }
    -};
    -
    -spine.binarySearch = function (values, target, step) {
    -    var low = 0;
    -    var high = Math.floor(values.length / step) - 2;
    -    if (!high) return step;
    -    var current = high >>> 1;
    -    while (true) {
    -        if (values[(current + 1) * step] <= target)
    -            low = current + 1;
    -        else
    -            high = current;
    -        if (low == high) return (low + 1) * step;
    -        current = (low + high) >>> 1;
    -    }
    -};
    -spine.linearSearch = function (values, target, step) {
    -    for (var i = 0, last = values.length - step; i <= last; i += step)
    -        if (values[i] > target) return i;
    -    return -1;
    -};
    -
    -spine.Curves = function (frameCount) {
    -    this.curves = []; // dfx, dfy, ddfx, ddfy, dddfx, dddfy, ...
    -    this.curves.length = (frameCount - 1) * 6;
    -};
    -spine.Curves.prototype = {
    -    setLinear: function (frameIndex) {
    -        this.curves[frameIndex * 6] = 0/*LINEAR*/;
    -    },
    -    setStepped: function (frameIndex) {
    -        this.curves[frameIndex * 6] = -1/*STEPPED*/;
    -    },
    -    /** Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next.
    -     * cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of
    -     * the difference between the keyframe's values. */
    -    setCurve: function (frameIndex, cx1, cy1, cx2, cy2) {
    -        var subdiv_step = 1 / 10/*BEZIER_SEGMENTS*/;
    -        var subdiv_step2 = subdiv_step * subdiv_step;
    -        var subdiv_step3 = subdiv_step2 * subdiv_step;
    -        var pre1 = 3 * subdiv_step;
    -        var pre2 = 3 * subdiv_step2;
    -        var pre4 = 6 * subdiv_step2;
    -        var pre5 = 6 * subdiv_step3;
    -        var tmp1x = -cx1 * 2 + cx2;
    -        var tmp1y = -cy1 * 2 + cy2;
    -        var tmp2x = (cx1 - cx2) * 3 + 1;
    -        var tmp2y = (cy1 - cy2) * 3 + 1;
    -        var i = frameIndex * 6;
    -        var curves = this.curves;
    -        curves[i] = cx1 * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3;
    -        curves[i + 1] = cy1 * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3;
    -        curves[i + 2] = tmp1x * pre4 + tmp2x * pre5;
    -        curves[i + 3] = tmp1y * pre4 + tmp2y * pre5;
    -        curves[i + 4] = tmp2x * pre5;
    -        curves[i + 5] = tmp2y * pre5;
    -    },
    -    getCurvePercent: function (frameIndex, percent) {
    -        percent = percent < 0 ? 0 : (percent > 1 ? 1 : percent);
    -        var curveIndex = frameIndex * 6;
    -        var curves = this.curves;
    -        var dfx = curves[curveIndex];
    -        if (!dfx/*LINEAR*/) return percent;
    -        if (dfx == -1/*STEPPED*/) return 0;
    -        var dfy = curves[curveIndex + 1];
    -        var ddfx = curves[curveIndex + 2];
    -        var ddfy = curves[curveIndex + 3];
    -        var dddfx = curves[curveIndex + 4];
    -        var dddfy = curves[curveIndex + 5];
    -        var x = dfx, y = dfy;
    -        var i = 10/*BEZIER_SEGMENTS*/ - 2;
    -        while (true) {
    -            if (x >= percent) {
    -                var lastX = x - dfx;
    -                var lastY = y - dfy;
    -                return lastY + (y - lastY) * (percent - lastX) / (x - lastX);
    -            }
    -            if (!i) break;
    -            i--;
    -            dfx += ddfx;
    -            dfy += ddfy;
    -            ddfx += dddfx;
    -            ddfy += dddfy;
    -            x += dfx;
    -            y += dfy;
    -        }
    -        return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1.
    -    }
    -};
    -
    -spine.RotateTimeline = function (frameCount) {
    -    this.curves = new spine.Curves(frameCount);
    -    this.frames = []; // time, angle, ...
    -    this.frames.length = frameCount * 2;
    -};
    -spine.RotateTimeline.prototype = {
    -    boneIndex: 0,
    -    getFrameCount: function () {
    -        return this.frames.length / 2;
    -    },
    -    setFrame: function (frameIndex, time, angle) {
    -        frameIndex *= 2;
    -        this.frames[frameIndex] = time;
    -        this.frames[frameIndex + 1] = angle;
    -    },
    -    apply: function (skeleton, time, alpha) {
    -        var frames = this.frames,
    -            amount;
    -
    -        if (time < frames[0]) return; // Time is before first frame.
    -
    -        var bone = skeleton.bones[this.boneIndex];
    -
    -        if (time >= frames[frames.length - 2]) { // Time is after last frame.
    -            amount = bone.data.rotation + frames[frames.length - 1] - bone.rotation;
    -            while (amount > 180)
    -                amount -= 360;
    -            while (amount < -180)
    -                amount += 360;
    -            bone.rotation += amount * alpha;
    -            return;
    -        }
    -
    -        // Interpolate between the last frame and the current frame.
    -        var frameIndex = spine.binarySearch(frames, time, 2);
    -        var lastFrameValue = frames[frameIndex - 1];
    -        var frameTime = frames[frameIndex];
    -        var percent = 1 - (time - frameTime) / (frames[frameIndex - 2/*LAST_FRAME_TIME*/] - frameTime);
    -        percent = this.curves.getCurvePercent(frameIndex / 2 - 1, percent);
    -
    -        amount = frames[frameIndex + 1/*FRAME_VALUE*/] - lastFrameValue;
    -        while (amount > 180)
    -            amount -= 360;
    -        while (amount < -180)
    -            amount += 360;
    -        amount = bone.data.rotation + (lastFrameValue + amount * percent) - bone.rotation;
    -        while (amount > 180)
    -            amount -= 360;
    -        while (amount < -180)
    -            amount += 360;
    -        bone.rotation += amount * alpha;
    -    }
    -};
    -
    -spine.TranslateTimeline = function (frameCount) {
    -    this.curves = new spine.Curves(frameCount);
    -    this.frames = []; // time, x, y, ...
    -    this.frames.length = frameCount * 3;
    -};
    -spine.TranslateTimeline.prototype = {
    -    boneIndex: 0,
    -    getFrameCount: function () {
    -        return this.frames.length / 3;
    -    },
    -    setFrame: function (frameIndex, time, x, y) {
    -        frameIndex *= 3;
    -        this.frames[frameIndex] = time;
    -        this.frames[frameIndex + 1] = x;
    -        this.frames[frameIndex + 2] = y;
    -    },
    -    apply: function (skeleton, time, alpha) {
    -        var frames = this.frames;
    -        if (time < frames[0]) return; // Time is before first frame.
    -
    -        var bone = skeleton.bones[this.boneIndex];
    -
    -        if (time >= frames[frames.length - 3]) { // Time is after last frame.
    -            bone.x += (bone.data.x + frames[frames.length - 2] - bone.x) * alpha;
    -            bone.y += (bone.data.y + frames[frames.length - 1] - bone.y) * alpha;
    -            return;
    -        }
    -
    -        // Interpolate between the last frame and the current frame.
    -        var frameIndex = spine.binarySearch(frames, time, 3);
    -        var lastFrameX = frames[frameIndex - 2];
    -        var lastFrameY = frames[frameIndex - 1];
    -        var frameTime = frames[frameIndex];
    -        var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*LAST_FRAME_TIME*/] - frameTime);
    -        percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent);
    -
    -        bone.x += (bone.data.x + lastFrameX + (frames[frameIndex + 1/*FRAME_X*/] - lastFrameX) * percent - bone.x) * alpha;
    -        bone.y += (bone.data.y + lastFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - lastFrameY) * percent - bone.y) * alpha;
    -    }
    -};
    -
    -spine.ScaleTimeline = function (frameCount) {
    -    this.curves = new spine.Curves(frameCount);
    -    this.frames = []; // time, x, y, ...
    -    this.frames.length = frameCount * 3;
    -};
    -spine.ScaleTimeline.prototype = {
    -    boneIndex: 0,
    -    getFrameCount: function () {
    -        return this.frames.length / 3;
    -    },
    -    setFrame: function (frameIndex, time, x, y) {
    -        frameIndex *= 3;
    -        this.frames[frameIndex] = time;
    -        this.frames[frameIndex + 1] = x;
    -        this.frames[frameIndex + 2] = y;
    -    },
    -    apply: function (skeleton, time, alpha) {
    -        var frames = this.frames;
    -        if (time < frames[0]) return; // Time is before first frame.
    -
    -        var bone = skeleton.bones[this.boneIndex];
    -
    -        if (time >= frames[frames.length - 3]) { // Time is after last frame.
    -            bone.scaleX += (bone.data.scaleX - 1 + frames[frames.length - 2] - bone.scaleX) * alpha;
    -            bone.scaleY += (bone.data.scaleY - 1 + frames[frames.length - 1] - bone.scaleY) * alpha;
    -            return;
    -        }
    -
    -        // Interpolate between the last frame and the current frame.
    -        var frameIndex = spine.binarySearch(frames, time, 3);
    -        var lastFrameX = frames[frameIndex - 2];
    -        var lastFrameY = frames[frameIndex - 1];
    -        var frameTime = frames[frameIndex];
    -        var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*LAST_FRAME_TIME*/] - frameTime);
    -        percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent);
    -
    -        bone.scaleX += (bone.data.scaleX - 1 + lastFrameX + (frames[frameIndex + 1/*FRAME_X*/] - lastFrameX) * percent - bone.scaleX) * alpha;
    -        bone.scaleY += (bone.data.scaleY - 1 + lastFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - lastFrameY) * percent - bone.scaleY) * alpha;
    -    }
    -};
    -
    -spine.ColorTimeline = function (frameCount) {
    -    this.curves = new spine.Curves(frameCount);
    -    this.frames = []; // time, r, g, b, a, ...
    -    this.frames.length = frameCount * 5;
    -};
    -spine.ColorTimeline.prototype = {
    -    slotIndex: 0,
    -    getFrameCount: function () {
    -        return this.frames.length / 5;
    -    },
    -    setFrame: function (frameIndex, time, r, g, b, a) {
    -        frameIndex *= 5;
    -        this.frames[frameIndex] = time;
    -        this.frames[frameIndex + 1] = r;
    -        this.frames[frameIndex + 2] = g;
    -        this.frames[frameIndex + 3] = b;
    -        this.frames[frameIndex + 4] = a;
    -    },
    -    apply: function (skeleton, time, alpha) {
    -        var frames = this.frames;
    -        if (time < frames[0]) return; // Time is before first frame.
    -
    -        var slot = skeleton.slots[this.slotIndex];
    -
    -        if (time >= frames[frames.length - 5]) { // Time is after last frame.
    -            var i = frames.length - 1;
    -            slot.r = frames[i - 3];
    -            slot.g = frames[i - 2];
    -            slot.b = frames[i - 1];
    -            slot.a = frames[i];
    -            return;
    -        }
    -
    -        // Interpolate between the last frame and the current frame.
    -        var frameIndex = spine.binarySearch(frames, time, 5);
    -        var lastFrameR = frames[frameIndex - 4];
    -        var lastFrameG = frames[frameIndex - 3];
    -        var lastFrameB = frames[frameIndex - 2];
    -        var lastFrameA = frames[frameIndex - 1];
    -        var frameTime = frames[frameIndex];
    -        var percent = 1 - (time - frameTime) / (frames[frameIndex - 5/*LAST_FRAME_TIME*/] - frameTime);
    -        percent = this.curves.getCurvePercent(frameIndex / 5 - 1, percent);
    -
    -        var r = lastFrameR + (frames[frameIndex + 1/*FRAME_R*/] - lastFrameR) * percent;
    -        var g = lastFrameG + (frames[frameIndex + 2/*FRAME_G*/] - lastFrameG) * percent;
    -        var b = lastFrameB + (frames[frameIndex + 3/*FRAME_B*/] - lastFrameB) * percent;
    -        var a = lastFrameA + (frames[frameIndex + 4/*FRAME_A*/] - lastFrameA) * percent;
    -        if (alpha < 1) {
    -            slot.r += (r - slot.r) * alpha;
    -            slot.g += (g - slot.g) * alpha;
    -            slot.b += (b - slot.b) * alpha;
    -            slot.a += (a - slot.a) * alpha;
    -        } else {
    -            slot.r = r;
    -            slot.g = g;
    -            slot.b = b;
    -            slot.a = a;
    -        }
    -    }
    -};
    -
    -spine.AttachmentTimeline = function (frameCount) {
    -    this.curves = new spine.Curves(frameCount);
    -    this.frames = []; // time, ...
    -    this.frames.length = frameCount;
    -    this.attachmentNames = []; // time, ...
    -    this.attachmentNames.length = frameCount;
    -};
    -spine.AttachmentTimeline.prototype = {
    -    slotIndex: 0,
    -    getFrameCount: function () {
    -            return this.frames.length;
    -    },
    -    setFrame: function (frameIndex, time, attachmentName) {
    -        this.frames[frameIndex] = time;
    -        this.attachmentNames[frameIndex] = attachmentName;
    -    },
    -    apply: function (skeleton, time, alpha) {
    -        var frames = this.frames;
    -        if (time < frames[0]) return; // Time is before first frame.
    -
    -        var frameIndex;
    -        if (time >= frames[frames.length - 1]) // Time is after last frame.
    -            frameIndex = frames.length - 1;
    -        else
    -            frameIndex = spine.binarySearch(frames, time, 1) - 1;
    -
    -        var attachmentName = this.attachmentNames[frameIndex];
    -        skeleton.slots[this.slotIndex].setAttachment(!attachmentName ? null : skeleton.getAttachmentBySlotIndex(this.slotIndex, attachmentName));
    -    }
    -};
    -
    -spine.SkeletonData = function () {
    -    this.bones = [];
    -    this.slots = [];
    -    this.skins = [];
    -    this.animations = [];
    -};
    -spine.SkeletonData.prototype = {
    -    defaultSkin: null,
    -    /** @return May be null. */
    -    findBone: function (boneName) {
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            if (bones[i].name == boneName) return bones[i];
    -        return null;
    -    },
    -    /** @return -1 if the bone was not found. */
    -    findBoneIndex: function (boneName) {
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            if (bones[i].name == boneName) return i;
    -        return -1;
    -    },
    -    /** @return May be null. */
    -    findSlot: function (slotName) {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.length; i < n; i++) {
    -            if (slots[i].name == slotName) return slot[i];
    -        }
    -        return null;
    -    },
    -    /** @return -1 if the bone was not found. */
    -    findSlotIndex: function (slotName) {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.length; i < n; i++)
    -            if (slots[i].name == slotName) return i;
    -        return -1;
    -    },
    -    /** @return May be null. */
    -    findSkin: function (skinName) {
    -        var skins = this.skins;
    -        for (var i = 0, n = skins.length; i < n; i++)
    -            if (skins[i].name == skinName) return skins[i];
    -        return null;
    -    },
    -    /** @return May be null. */
    -    findAnimation: function (animationName) {
    -        var animations = this.animations;
    -        for (var i = 0, n = animations.length; i < n; i++)
    -            if (animations[i].name == animationName) return animations[i];
    -        return null;
    -    }
    -};
    -
    -spine.Skeleton = function (skeletonData) {
    -    this.data = skeletonData;
    -
    -    this.bones = [];
    -    for (var i = 0, n = skeletonData.bones.length; i < n; i++) {
    -        var boneData = skeletonData.bones[i];
    -        var parent = !boneData.parent ? null : this.bones[skeletonData.bones.indexOf(boneData.parent)];
    -        this.bones.push(new spine.Bone(boneData, parent));
    -    }
    -
    -    this.slots = [];
    -    this.drawOrder = [];
    -    for (i = 0, n = skeletonData.slots.length; i < n; i++) {
    -        var slotData = skeletonData.slots[i];
    -        var bone = this.bones[skeletonData.bones.indexOf(slotData.boneData)];
    -        var slot = new spine.Slot(slotData, this, bone);
    -        this.slots.push(slot);
    -        this.drawOrder.push(slot);
    -    }
    -};
    -spine.Skeleton.prototype = {
    -    x: 0, y: 0,
    -    skin: null,
    -    r: 1, g: 1, b: 1, a: 1,
    -    time: 0,
    -    flipX: false, flipY: false,
    -    /** Updates the world transform for each bone. */
    -    updateWorldTransform: function () {
    -        var flipX = this.flipX;
    -        var flipY = this.flipY;
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            bones[i].updateWorldTransform(flipX, flipY);
    -    },
    -    /** Sets the bones and slots to their setup pose values. */
    -    setToSetupPose: function () {
    -        this.setBonesToSetupPose();
    -        this.setSlotsToSetupPose();
    -    },
    -    setBonesToSetupPose: function () {
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            bones[i].setToSetupPose();
    -    },
    -    setSlotsToSetupPose: function () {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.length; i < n; i++)
    -            slots[i].setToSetupPose(i);
    -    },
    -    /** @return May return null. */
    -    getRootBone: function () {
    -        return this.bones.length ? this.bones[0] : null;
    -    },
    -    /** @return May be null. */
    -    findBone: function (boneName) {
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            if (bones[i].data.name == boneName) return bones[i];
    -        return null;
    -    },
    -    /** @return -1 if the bone was not found. */
    -    findBoneIndex: function (boneName) {
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            if (bones[i].data.name == boneName) return i;
    -        return -1;
    -    },
    -    /** @return May be null. */
    -    findSlot: function (slotName) {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.length; i < n; i++)
    -            if (slots[i].data.name == slotName) return slots[i];
    -        return null;
    -    },
    -    /** @return -1 if the bone was not found. */
    -    findSlotIndex: function (slotName) {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.length; i < n; i++)
    -            if (slots[i].data.name == slotName) return i;
    -        return -1;
    -    },
    -    setSkinByName: function (skinName) {
    -        var skin = this.data.findSkin(skinName);
    -        if (!skin) throw "Skin not found: " + skinName;
    -        this.setSkin(skin);
    -    },
    -    /** Sets the skin used to look up attachments not found in the {@link SkeletonData#getDefaultSkin() default skin}. Attachments
    -     * from the new skin are attached if the corresponding attachment from the old skin was attached.
    -     * @param newSkin May be null. */
    -    setSkin: function (newSkin) {
    -        if (this.skin && newSkin) newSkin._attachAll(this, this.skin);
    -        this.skin = newSkin;
    -    },
    -    /** @return May be null. */
    -    getAttachmentBySlotName: function (slotName, attachmentName) {
    -        return this.getAttachmentBySlotIndex(this.data.findSlotIndex(slotName), attachmentName);
    -    },
    -    /** @return May be null. */
    -    getAttachmentBySlotIndex: function (slotIndex, attachmentName) {
    -        if (this.skin) {
    -            var attachment = this.skin.getAttachment(slotIndex, attachmentName);
    -            if (attachment) return attachment;
    -        }
    -        if (this.data.defaultSkin) return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);
    -        return null;
    -    },
    -    /** @param attachmentName May be null. */
    -    setAttachment: function (slotName, attachmentName) {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.size; i < n; i++) {
    -            var slot = slots[i];
    -            if (slot.data.name == slotName) {
    -                var attachment = null;
    -                if (attachmentName) {
    -                    attachment = this.getAttachment(i, attachmentName);
    -                    if (attachment == null) throw "Attachment not found: " + attachmentName + ", for slot: " + slotName;
    -                }
    -                slot.setAttachment(attachment);
    -                return;
    -            }
    -        }
    -        throw "Slot not found: " + slotName;
    -    },
    -    update: function (delta) {
    -        time += delta;
    -    }
    -};
    -
    -spine.AttachmentType = {
    -    region: 0
    -};
    -
    -spine.RegionAttachment = function () {
    -    this.offset = [];
    -    this.offset.length = 8;
    -    this.uvs = [];
    -    this.uvs.length = 8;
    -};
    -spine.RegionAttachment.prototype = {
    -    x: 0, y: 0,
    -    rotation: 0,
    -    scaleX: 1, scaleY: 1,
    -    width: 0, height: 0,
    -    rendererObject: null,
    -    regionOffsetX: 0, regionOffsetY: 0,
    -    regionWidth: 0, regionHeight: 0,
    -    regionOriginalWidth: 0, regionOriginalHeight: 0,
    -    setUVs: function (u, v, u2, v2, rotate) {
    -        var uvs = this.uvs;
    -        if (rotate) {
    -            uvs[2/*X2*/] = u;
    -            uvs[3/*Y2*/] = v2;
    -            uvs[4/*X3*/] = u;
    -            uvs[5/*Y3*/] = v;
    -            uvs[6/*X4*/] = u2;
    -            uvs[7/*Y4*/] = v;
    -            uvs[0/*X1*/] = u2;
    -            uvs[1/*Y1*/] = v2;
    -        } else {
    -            uvs[0/*X1*/] = u;
    -            uvs[1/*Y1*/] = v2;
    -            uvs[2/*X2*/] = u;
    -            uvs[3/*Y2*/] = v;
    -            uvs[4/*X3*/] = u2;
    -            uvs[5/*Y3*/] = v;
    -            uvs[6/*X4*/] = u2;
    -            uvs[7/*Y4*/] = v2;
    -        }
    -    },
    -    updateOffset: function () {
    -        var regionScaleX = this.width / this.regionOriginalWidth * this.scaleX;
    -        var regionScaleY = this.height / this.regionOriginalHeight * this.scaleY;
    -        var localX = -this.width / 2 * this.scaleX + this.regionOffsetX * regionScaleX;
    -        var localY = -this.height / 2 * this.scaleY + this.regionOffsetY * regionScaleY;
    -        var localX2 = localX + this.regionWidth * regionScaleX;
    -        var localY2 = localY + this.regionHeight * regionScaleY;
    -        var radians = this.rotation * Math.PI / 180;
    -        var cos = Math.cos(radians);
    -        var sin = Math.sin(radians);
    -        var localXCos = localX * cos + this.x;
    -        var localXSin = localX * sin;
    -        var localYCos = localY * cos + this.y;
    -        var localYSin = localY * sin;
    -        var localX2Cos = localX2 * cos + this.x;
    -        var localX2Sin = localX2 * sin;
    -        var localY2Cos = localY2 * cos + this.y;
    -        var localY2Sin = localY2 * sin;
    -        var offset = this.offset;
    -        offset[0/*X1*/] = localXCos - localYSin;
    -        offset[1/*Y1*/] = localYCos + localXSin;
    -        offset[2/*X2*/] = localXCos - localY2Sin;
    -        offset[3/*Y2*/] = localY2Cos + localXSin;
    -        offset[4/*X3*/] = localX2Cos - localY2Sin;
    -        offset[5/*Y3*/] = localY2Cos + localX2Sin;
    -        offset[6/*X4*/] = localX2Cos - localYSin;
    -        offset[7/*Y4*/] = localYCos + localX2Sin;
    -    },
    -    computeVertices: function (x, y, bone, vertices) {
    -        x += bone.worldX;
    -        y += bone.worldY;
    -        var m00 = bone.m00;
    -        var m01 = bone.m01;
    -        var m10 = bone.m10;
    -        var m11 = bone.m11;
    -        var offset = this.offset;
    -        vertices[0/*X1*/] = offset[0/*X1*/] * m00 + offset[1/*Y1*/] * m01 + x;
    -        vertices[1/*Y1*/] = offset[0/*X1*/] * m10 + offset[1/*Y1*/] * m11 + y;
    -        vertices[2/*X2*/] = offset[2/*X2*/] * m00 + offset[3/*Y2*/] * m01 + x;
    -        vertices[3/*Y2*/] = offset[2/*X2*/] * m10 + offset[3/*Y2*/] * m11 + y;
    -        vertices[4/*X3*/] = offset[4/*X3*/] * m00 + offset[5/*X3*/] * m01 + x;
    -        vertices[5/*X3*/] = offset[4/*X3*/] * m10 + offset[5/*X3*/] * m11 + y;
    -        vertices[6/*X4*/] = offset[6/*X4*/] * m00 + offset[7/*Y4*/] * m01 + x;
    -        vertices[7/*Y4*/] = offset[6/*X4*/] * m10 + offset[7/*Y4*/] * m11 + y;
    -    }
    -}
    -
    -spine.AnimationStateData = function (skeletonData) {
    -    this.skeletonData = skeletonData;
    -    this.animationToMixTime = {};
    -};
    -spine.AnimationStateData.prototype = {
    -        defaultMix: 0,
    -    setMixByName: function (fromName, toName, duration) {
    -        var from = this.skeletonData.findAnimation(fromName);
    -        if (!from) throw "Animation not found: " + fromName;
    -        var to = this.skeletonData.findAnimation(toName);
    -        if (!to) throw "Animation not found: " + toName;
    -        this.setMix(from, to, duration);
    -    },
    -    setMix: function (from, to, duration) {
    -        this.animationToMixTime[from.name + ":" + to.name] = duration;
    -    },
    -    getMix: function (from, to) {
    -        var time = this.animationToMixTime[from.name + ":" + to.name];
    -            return time ? time : this.defaultMix;
    -    }
    -};
    -
    -spine.AnimationState = function (stateData) {
    -    this.data = stateData;
    -    this.queue = [];
    -};
    -spine.AnimationState.prototype = {
    -    animationSpeed: 1,
    -    current: null,
    -    previous: null,
    -    currentTime: 0,
    -    previousTime: 0,
    -    currentLoop: false,
    -    previousLoop: false,
    -    mixTime: 0,
    -    mixDuration: 0,
    -    update: function (delta) {
    -        this.currentTime += (delta * this.animationSpeed); //timeScale: Multiply delta by the speed of animation required.
    -        this.previousTime += delta;
    -        this.mixTime += delta;
    -
    -        if (this.queue.length > 0) {
    -            var entry = this.queue[0];
    -            if (this.currentTime >= entry.delay) {
    -                this._setAnimation(entry.animation, entry.loop);
    -                this.queue.shift();
    -            }
    -        }
    -    },
    -    apply: function (skeleton) {
    -        if (!this.current) return;
    -        if (this.previous) {
    -            this.previous.apply(skeleton, this.previousTime, this.previousLoop);
    -            var alpha = this.mixTime / this.mixDuration;
    -            if (alpha >= 1) {
    -                alpha = 1;
    -                this.previous = null;
    -            }
    -            this.current.mix(skeleton, this.currentTime, this.currentLoop, alpha);
    -        } else
    -            this.current.apply(skeleton, this.currentTime, this.currentLoop);
    -    },
    -    clearAnimation: function () {
    -        this.previous = null;
    -        this.current = null;
    -        this.queue.length = 0;
    -    },
    -    _setAnimation: function (animation, loop) {
    -        this.previous = null;
    -        if (animation && this.current) {
    -            this.mixDuration = this.data.getMix(this.current, animation);
    -            if (this.mixDuration > 0) {
    -                this.mixTime = 0;
    -                this.previous = this.current;
    -                this.previousTime = this.currentTime;
    -                this.previousLoop = this.currentLoop;
    -            }
    -        }
    -        this.current = animation;
    -        this.currentLoop = loop;
    -        this.currentTime = 0;
    -    },
    -    /** @see #setAnimation(Animation, Boolean) */
    -    setAnimationByName: function (animationName, loop) {
    -        var animation = this.data.skeletonData.findAnimation(animationName);
    -        if (!animation) throw "Animation not found: " + animationName;
    -        this.setAnimation(animation, loop);
    -    },
    -    /** Set the current animation. Any queued animations are cleared and the current animation time is set to 0.
    -     * @param animation May be null. */
    -    setAnimation: function (animation, loop) {
    -        this.queue.length = 0;
    -        this._setAnimation(animation, loop);
    -    },
    -    /** @see #addAnimation(Animation, Boolean, Number) */
    -    addAnimationByName: function (animationName, loop, delay) {
    -        var animation = this.data.skeletonData.findAnimation(animationName);
    -        if (!animation) throw "Animation not found: " + animationName;
    -        this.addAnimation(animation, loop, delay);
    -    },
    -    /** Adds an animation to be played delay seconds after the current or last queued animation.
    -     * @param delay May be <= 0 to use duration of previous animation minus any mix duration plus the negative delay. */
    -    addAnimation: function (animation, loop, delay) {
    -        var entry = {};
    -        entry.animation = animation;
    -        entry.loop = loop;
    -
    -        if (!delay || delay <= 0) {
    -            var previousAnimation = this.queue.length ? this.queue[this.queue.length - 1].animation : this.current;
    -            if (previousAnimation != null)
    -                delay = previousAnimation.duration - this.data.getMix(previousAnimation, animation) + (delay || 0);
    -            else
    -                delay = 0;
    -        }
    -        entry.delay = delay;
    -
    -        this.queue.push(entry);
    -    },
    -    /** Returns true if no animation is set or if the current time is greater than the animation duration, regardless of looping. */
    -    isComplete: function () {
    -        return !this.current || this.currentTime >= this.current.duration;
    -    }
    -};
    -
    -spine.SkeletonJson = function (attachmentLoader) {
    -    this.attachmentLoader = attachmentLoader;
    -};
    -spine.SkeletonJson.prototype = {
    -    scale: 1,
    -    readSkeletonData: function (root) {
    -        /*jshint -W069*/
    -        var skeletonData = new spine.SkeletonData(),
    -            boneData;
    -
    -        // Bones.
    -        var bones = root["bones"];
    -        for (var i = 0, n = bones.length; i < n; i++) {
    -            var boneMap = bones[i];
    -            var parent = null;
    -            if (boneMap["parent"]) {
    -                parent = skeletonData.findBone(boneMap["parent"]);
    -                if (!parent) throw "Parent bone not found: " + boneMap["parent"];
    -            }
    -            boneData = new spine.BoneData(boneMap["name"], parent);
    -            boneData.length = (boneMap["length"] || 0) * this.scale;
    -            boneData.x = (boneMap["x"] || 0) * this.scale;
    -            boneData.y = (boneMap["y"] || 0) * this.scale;
    -            boneData.rotation = (boneMap["rotation"] || 0);
    -            boneData.scaleX = boneMap["scaleX"] || 1;
    -            boneData.scaleY = boneMap["scaleY"] || 1;
    -            skeletonData.bones.push(boneData);
    -        }
    -
    -        // Slots.
    -        var slots = root["slots"];
    -        for (i = 0, n = slots.length; i < n; i++) {
    -            var slotMap = slots[i];
    -            boneData = skeletonData.findBone(slotMap["bone"]);
    -            if (!boneData) throw "Slot bone not found: " + slotMap["bone"];
    -            var slotData = new spine.SlotData(slotMap["name"], boneData);
    -
    -            var color = slotMap["color"];
    -            if (color) {
    -                slotData.r = spine.SkeletonJson.toColor(color, 0);
    -                slotData.g = spine.SkeletonJson.toColor(color, 1);
    -                slotData.b = spine.SkeletonJson.toColor(color, 2);
    -                slotData.a = spine.SkeletonJson.toColor(color, 3);
    -            }
    -
    -            slotData.attachmentName = slotMap["attachment"];
    -
    -            skeletonData.slots.push(slotData);
    -        }
    -
    -        // Skins.
    -        var skins = root["skins"];
    -        for (var skinName in skins) {
    -            if (!skins.hasOwnProperty(skinName)) continue;
    -            var skinMap = skins[skinName];
    -            var skin = new spine.Skin(skinName);
    -            for (var slotName in skinMap) {
    -                if (!skinMap.hasOwnProperty(slotName)) continue;
    -                var slotIndex = skeletonData.findSlotIndex(slotName);
    -                var slotEntry = skinMap[slotName];
    -                for (var attachmentName in slotEntry) {
    -                    if (!slotEntry.hasOwnProperty(attachmentName)) continue;
    -                    var attachment = this.readAttachment(skin, attachmentName, slotEntry[attachmentName]);
    -                    if (attachment != null) skin.addAttachment(slotIndex, attachmentName, attachment);
    -                }
    -            }
    -            skeletonData.skins.push(skin);
    -            if (skin.name == "default") skeletonData.defaultSkin = skin;
    -        }
    -
    -        // Animations.
    -        var animations = root["animations"];
    -        for (var animationName in animations) {
    -            if (!animations.hasOwnProperty(animationName)) continue;
    -            this.readAnimation(animationName, animations[animationName], skeletonData);
    -        }
    -
    -        return skeletonData;
    -    },
    -    readAttachment: function (skin, name, map) {
    -        /*jshint -W069*/
    -        name = map["name"] || name;
    -
    -        var type = spine.AttachmentType[map["type"] || "region"];
    -
    -        if (type == spine.AttachmentType.region) {
    -            var attachment = new spine.RegionAttachment();
    -            attachment.x = (map["x"] || 0) * this.scale;
    -            attachment.y = (map["y"] || 0) * this.scale;
    -            attachment.scaleX = map["scaleX"] || 1;
    -            attachment.scaleY = map["scaleY"] || 1;
    -            attachment.rotation = map["rotation"] || 0;
    -            attachment.width = (map["width"] || 32) * this.scale;
    -            attachment.height = (map["height"] || 32) * this.scale;
    -            attachment.updateOffset();
    -
    -            attachment.rendererObject = {};
    -            attachment.rendererObject.name = name;
    -            attachment.rendererObject.scale = {};
    -            attachment.rendererObject.scale.x = attachment.scaleX;
    -            attachment.rendererObject.scale.y = attachment.scaleY;
    -            attachment.rendererObject.rotation = -attachment.rotation * Math.PI / 180;
    -            return attachment;
    -        }
    -
    -            throw "Unknown attachment type: " + type;
    -    },
    -
    -    readAnimation: function (name, map, skeletonData) {
    -        /*jshint -W069*/
    -        var timelines = [];
    -        var duration = 0;
    -        var frameIndex, timeline, timelineName, valueMap, values,
    -            i, n;
    -
    -        var bones = map["bones"];
    -        for (var boneName in bones) {
    -            if (!bones.hasOwnProperty(boneName)) continue;
    -            var boneIndex = skeletonData.findBoneIndex(boneName);
    -            if (boneIndex == -1) throw "Bone not found: " + boneName;
    -            var boneMap = bones[boneName];
    -
    -            for (timelineName in boneMap) {
    -                if (!boneMap.hasOwnProperty(timelineName)) continue;
    -                values = boneMap[timelineName];
    -                if (timelineName == "rotate") {
    -                    timeline = new spine.RotateTimeline(values.length);
    -                    timeline.boneIndex = boneIndex;
    -
    -                    frameIndex = 0;
    -                    for (i = 0, n = values.length; i < n; i++) {
    -                        valueMap = values[i];
    -                        timeline.setFrame(frameIndex, valueMap["time"], valueMap["angle"]);
    -                        spine.SkeletonJson.readCurve(timeline, frameIndex, valueMap);
    -                        frameIndex++;
    -                    }
    -                    timelines.push(timeline);
    -                    duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 2 - 2]);
    -
    -                } else if (timelineName == "translate" || timelineName == "scale") {
    -                    var timelineScale = 1;
    -                    if (timelineName == "scale")
    -                        timeline = new spine.ScaleTimeline(values.length);
    -                    else {
    -                        timeline = new spine.TranslateTimeline(values.length);
    -                        timelineScale = this.scale;
    -                    }
    -                    timeline.boneIndex = boneIndex;
    -
    -                    frameIndex = 0;
    -                    for (i = 0, n = values.length; i < n; i++) {
    -                        valueMap = values[i];
    -                        var x = (valueMap["x"] || 0) * timelineScale;
    -                        var y = (valueMap["y"] || 0) * timelineScale;
    -                        timeline.setFrame(frameIndex, valueMap["time"], x, y);
    -                        spine.SkeletonJson.readCurve(timeline, frameIndex, valueMap);
    -                        frameIndex++;
    -                    }
    -                    timelines.push(timeline);
    -                    duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 3 - 3]);
    -
    -                } else
    -                    throw "Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")";
    -            }
    -        }
    -        var slots = map["slots"];
    -        for (var slotName in slots) {
    -            if (!slots.hasOwnProperty(slotName)) continue;
    -            var slotMap = slots[slotName];
    -            var slotIndex = skeletonData.findSlotIndex(slotName);
    -
    -            for (timelineName in slotMap) {
    -                if (!slotMap.hasOwnProperty(timelineName)) continue;
    -                values = slotMap[timelineName];
    -                if (timelineName == "color") {
    -                    timeline = new spine.ColorTimeline(values.length);
    -                    timeline.slotIndex = slotIndex;
    -
    -                    frameIndex = 0;
    -                    for (i = 0, n = values.length; i < n; i++) {
    -                        valueMap = values[i];
    -                        var color = valueMap["color"];
    -                        var r = spine.SkeletonJson.toColor(color, 0);
    -                        var g = spine.SkeletonJson.toColor(color, 1);
    -                        var b = spine.SkeletonJson.toColor(color, 2);
    -                        var a = spine.SkeletonJson.toColor(color, 3);
    -                        timeline.setFrame(frameIndex, valueMap["time"], r, g, b, a);
    -                        spine.SkeletonJson.readCurve(timeline, frameIndex, valueMap);
    -                        frameIndex++;
    -                    }
    -                    timelines.push(timeline);
    -                    duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 5 - 5]);
    -
    -                } else if (timelineName == "attachment") {
    -                    timeline = new spine.AttachmentTimeline(values.length);
    -                    timeline.slotIndex = slotIndex;
    -
    -                    frameIndex = 0;
    -                    for (i = 0, n = values.length; i < n; i++) {
    -                        valueMap = values[i];
    -                        timeline.setFrame(frameIndex++, valueMap["time"], valueMap["name"]);
    -                    }
    -                    timelines.push(timeline);
    -                        duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);
    -
    -                } else
    -                    throw "Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")";
    -            }
    -        }
    -        skeletonData.animations.push(new spine.Animation(name, timelines, duration));
    -    }
    -};
    -spine.SkeletonJson.readCurve = function (timeline, frameIndex, valueMap) {
    -    /*jshint -W069*/
    -    var curve = valueMap["curve"];
    -    if (!curve) return;
    -    if (curve == "stepped")
    -        timeline.curves.setStepped(frameIndex);
    -    else if (curve instanceof Array)
    -        timeline.curves.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]);
    -};
    -spine.SkeletonJson.toColor = function (hexString, colorIndex) {
    -    if (hexString.length != 8) throw "Color hexidecimal length must be 8, recieved: " + hexString;
    -    return parseInt(hexString.substr(colorIndex * 2, 2), 16) / 255;
    -};
    -
    -spine.Atlas = function (atlasText, textureLoader) {
    -    this.textureLoader = textureLoader;
    -    this.pages = [];
    -    this.regions = [];
    -
    -    var reader = new spine.AtlasReader(atlasText);
    -    var tuple = [];
    -    tuple.length = 4;
    -    var page = null;
    -    while (true) {
    -        var line = reader.readLine();
    -        if (line == null) break;
    -        line = reader.trim(line);
    -        if (!line.length)
    -            page = null;
    -        else if (!page) {
    -            page = new spine.AtlasPage();
    -            page.name = line;
    -
    -            page.format = spine.Atlas.Format[reader.readValue()];
    -
    -            reader.readTuple(tuple);
    -            page.minFilter = spine.Atlas.TextureFilter[tuple[0]];
    -            page.magFilter = spine.Atlas.TextureFilter[tuple[1]];
    -
    -            var direction = reader.readValue();
    -            page.uWrap = spine.Atlas.TextureWrap.clampToEdge;
    -            page.vWrap = spine.Atlas.TextureWrap.clampToEdge;
    -            if (direction == "x")
    -                page.uWrap = spine.Atlas.TextureWrap.repeat;
    -            else if (direction == "y")
    -                page.vWrap = spine.Atlas.TextureWrap.repeat;
    -            else if (direction == "xy")
    -                page.uWrap = page.vWrap = spine.Atlas.TextureWrap.repeat;
    -
    -            textureLoader.load(page, line);
    -
    -            this.pages.push(page);
    -
    -        } else {
    -            var region = new spine.AtlasRegion();
    -            region.name = line;
    -            region.page = page;
    -
    -            region.rotate = reader.readValue() == "true";
    -
    -            reader.readTuple(tuple);
    -            var x = parseInt(tuple[0], 10);
    -            var y = parseInt(tuple[1], 10);
    -
    -            reader.readTuple(tuple);
    -            var width = parseInt(tuple[0], 10);
    -            var height = parseInt(tuple[1], 10);
    -
    -            region.u = x / page.width;
    -            region.v = y / page.height;
    -            if (region.rotate) {
    -                region.u2 = (x + height) / page.width;
    -                region.v2 = (y + width) / page.height;
    -            } else {
    -                region.u2 = (x + width) / page.width;
    -                region.v2 = (y + height) / page.height;
    -            }
    -            region.x = x;
    -            region.y = y;
    -            region.width = Math.abs(width);
    -            region.height = Math.abs(height);
    -
    -            if (reader.readTuple(tuple) == 4) { // split is optional
    -                region.splits = [parseInt(tuple[0], 10), parseInt(tuple[1], 10), parseInt(tuple[2], 10), parseInt(tuple[3], 10)];
    -
    -                if (reader.readTuple(tuple) == 4) { // pad is optional, but only present with splits
    -                    region.pads = [parseInt(tuple[0], 10), parseInt(tuple[1], 10), parseInt(tuple[2], 10), parseInt(tuple[3], 10)];
    -
    -                    reader.readTuple(tuple);
    -                }
    -            }
    -
    -            region.originalWidth = parseInt(tuple[0], 10);
    -            region.originalHeight = parseInt(tuple[1], 10);
    -
    -            reader.readTuple(tuple);
    -            region.offsetX = parseInt(tuple[0], 10);
    -            region.offsetY = parseInt(tuple[1], 10);
    -
    -            region.index = parseInt(reader.readValue(), 10);
    -
    -            this.regions.push(region);
    -        }
    -    }
    -};
    -spine.Atlas.prototype = {
    -    findRegion: function (name) {
    -        var regions = this.regions;
    -        for (var i = 0, n = regions.length; i < n; i++)
    -            if (regions[i].name == name) return regions[i];
    -        return null;
    -    },
    -    dispose: function () {
    -        var pages = this.pages;
    -        for (var i = 0, n = pages.length; i < n; i++)
    -            this.textureLoader.unload(pages[i].rendererObject);
    -    },
    -    updateUVs: function (page) {
    -        var regions = this.regions;
    -        for (var i = 0, n = regions.length; i < n; i++) {
    -            var region = regions[i];
    -            if (region.page != page) continue;
    -            region.u = region.x / page.width;
    -            region.v = region.y / page.height;
    -            if (region.rotate) {
    -                region.u2 = (region.x + region.height) / page.width;
    -                region.v2 = (region.y + region.width) / page.height;
    -            } else {
    -                region.u2 = (region.x + region.width) / page.width;
    -                region.v2 = (region.y + region.height) / page.height;
    -            }
    -        }
    -    }
    -};
    -
    -spine.Atlas.Format = {
    -    alpha: 0,
    -    intensity: 1,
    -    luminanceAlpha: 2,
    -    rgb565: 3,
    -    rgba4444: 4,
    -    rgb888: 5,
    -    rgba8888: 6
    -};
    -
    -spine.Atlas.TextureFilter = {
    -    nearest: 0,
    -    linear: 1,
    -    mipMap: 2,
    -    mipMapNearestNearest: 3,
    -    mipMapLinearNearest: 4,
    -    mipMapNearestLinear: 5,
    -    mipMapLinearLinear: 6
    -};
    -
    -spine.Atlas.TextureWrap = {
    -    mirroredRepeat: 0,
    -    clampToEdge: 1,
    -    repeat: 2
    -};
    -
    -spine.AtlasPage = function () {};
    -spine.AtlasPage.prototype = {
    -    name: null,
    -    format: null,
    -    minFilter: null,
    -    magFilter: null,
    -    uWrap: null,
    -    vWrap: null,
    -    rendererObject: null,
    -    width: 0,
    -    height: 0
    -};
    -
    -spine.AtlasRegion = function () {};
    -spine.AtlasRegion.prototype = {
    -    page: null,
    -    name: null,
    -    x: 0, y: 0,
    -    width: 0, height: 0,
    -    u: 0, v: 0, u2: 0, v2: 0,
    -    offsetX: 0, offsetY: 0,
    -    originalWidth: 0, originalHeight: 0,
    -    index: 0,
    -    rotate: false,
    -    splits: null,
    -    pads: null
    -};
    -
    -spine.AtlasReader = function (text) {
    -    this.lines = text.split(/\r\n|\r|\n/);
    -};
    -spine.AtlasReader.prototype = {
    -    index: 0,
    -    trim: function (value) {
    -        return value.replace(/^\s+|\s+$/g, "");
    -    },
    -    readLine: function () {
    -        if (this.index >= this.lines.length) return null;
    -        return this.lines[this.index++];
    -    },
    -    readValue: function () {
    -        var line = this.readLine();
    -        var colon = line.indexOf(":");
    -        if (colon == -1) throw "Invalid line: " + line;
    -        return this.trim(line.substring(colon + 1));
    -    },
    -    /** Returns the number of tuple values read (2 or 4). */
    -    readTuple: function (tuple) {
    -        var line = this.readLine();
    -        var colon = line.indexOf(":");
    -        if (colon == -1) throw "Invalid line: " + line;
    -        var i = 0, lastMatch= colon + 1;
    -        for (; i < 3; i++) {
    -            var comma = line.indexOf(",", lastMatch);
    -            if (comma == -1) {
    -                if (!i) throw "Invalid line: " + line;
    -                break;
    -            }
    -            tuple[i] = this.trim(line.substr(lastMatch, comma - lastMatch));
    -            lastMatch = comma + 1;
    -        }
    -        tuple[i] = this.trim(line.substring(lastMatch));
    -        return i + 1;
    -    }
    -}
    -
    -spine.AtlasAttachmentLoader = function (atlas) {
    -    this.atlas = atlas;
    -}
    -spine.AtlasAttachmentLoader.prototype = {
    -    newAttachment: function (skin, type, name) {
    -        switch (type) {
    -        case spine.AttachmentType.region:
    -            var region = this.atlas.findRegion(name);
    -            if (!region) throw "Region not found in atlas: " + name + " (" + type + ")";
    -            var attachment = new spine.RegionAttachment(name);
    -            attachment.rendererObject = region;
    -            attachment.setUVs(region.u, region.v, region.u2, region.v2, region.rotate);
    -            attachment.regionOffsetX = region.offsetX;
    -            attachment.regionOffsetY = region.offsetY;
    -            attachment.regionWidth = region.width;
    -            attachment.regionHeight = region.height;
    -            attachment.regionOriginalWidth = region.originalWidth;
    -            attachment.regionOriginalHeight = region.originalHeight;
    -            return attachment;
    -        }
    -        throw "Unknown attachment type: " + type;
    -    }
    -}
    -
    -spine.Bone.yDown = true;
    -PIXI.AnimCache = {};
    -
    -/**
    - * A class that enables the you to import and run your spine animations in pixi.
    - * Spine animation data needs to be loaded using the PIXI.AssetLoader or PIXI.SpineLoader before it can be used by this class
    - * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source
    - *
    - * @class Spine
    - * @extends DisplayObjectContainer
    - * @constructor
    - * @param url {String} The url of the spine anim file to be used
    - */
    -PIXI.Spine = function (url) {
    -    PIXI.DisplayObjectContainer.call(this);
    -
    -    this.spineData = PIXI.AnimCache[url];
    -
    -    if (!this.spineData) {
    -        throw new Error("Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: " + url);
    -    }
    -
    -    this.skeleton = new spine.Skeleton(this.spineData);
    -    this.skeleton.updateWorldTransform();
    -
    -    this.stateData = new spine.AnimationStateData(this.spineData);
    -    this.state = new spine.AnimationState(this.stateData);
    -
    -    this.slotContainers = [];
    -
    -    for (var i = 0, n = this.skeleton.drawOrder.length; i < n; i++) {
    -        var slot = this.skeleton.drawOrder[i];
    -        var attachment = slot.attachment;
    -        var slotContainer = new PIXI.DisplayObjectContainer();
    -        this.slotContainers.push(slotContainer);
    -        this.addChild(slotContainer);
    -        if (!(attachment instanceof spine.RegionAttachment)) {
    -            continue;
    -        }
    -        var spriteName = attachment.rendererObject.name;
    -        var sprite = this.createSprite(slot, attachment.rendererObject);
    -        slot.currentSprite = sprite;
    -        slot.currentSpriteName = spriteName;
    -        slotContainer.addChild(sprite);
    -    }
    -};
    -
    -PIXI.Spine.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
    -PIXI.Spine.prototype.constructor = PIXI.Spine;
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.Spine.prototype.updateTransform = function () {
    -    this.lastTime = this.lastTime || Date.now();
    -    var timeDelta = (Date.now() - this.lastTime) * 0.001;
    -    this.lastTime = Date.now();
    -    this.state.update(timeDelta);
    -    this.state.apply(this.skeleton);
    -    this.skeleton.updateWorldTransform();
    -
    -    var drawOrder = this.skeleton.drawOrder;
    -    for (var i = 0, n = drawOrder.length; i < n; i++) {
    -        var slot = drawOrder[i];
    -        var attachment = slot.attachment;
    -        var slotContainer = this.slotContainers[i];
    -        if (!(attachment instanceof spine.RegionAttachment)) {
    -            slotContainer.visible = false;
    -            continue;
    -        }
    -
    -        if (attachment.rendererObject) {
    -            if (!slot.currentSpriteName || slot.currentSpriteName != attachment.name) {
    -                var spriteName = attachment.rendererObject.name;
    -                if (slot.currentSprite !== undefined) {
    -                    slot.currentSprite.visible = false;
    -                }
    -                slot.sprites = slot.sprites || {};
    -                if (slot.sprites[spriteName] !== undefined) {
    -                    slot.sprites[spriteName].visible = true;
    -                } else {
    -                    var sprite = this.createSprite(slot, attachment.rendererObject);
    -                    slotContainer.addChild(sprite);
    -                }
    -                slot.currentSprite = slot.sprites[spriteName];
    -                slot.currentSpriteName = spriteName;
    -            }
    -        }
    -        slotContainer.visible = true;
    -
    -        var bone = slot.bone;
    -
    -        slotContainer.position.x = bone.worldX + attachment.x * bone.m00 + attachment.y * bone.m01;
    -        slotContainer.position.y = bone.worldY + attachment.x * bone.m10 + attachment.y * bone.m11;
    -        slotContainer.scale.x = bone.worldScaleX;
    -        slotContainer.scale.y = bone.worldScaleY;
    -
    -        slotContainer.rotation = -(slot.bone.worldRotation * Math.PI / 180);
    -
    -        slotContainer.alpha = slot.a;
    -        slot.currentSprite.tint = PIXI.rgb2hex([slot.r,slot.g,slot.b]);
    -    }
    -
    -    PIXI.DisplayObjectContainer.prototype.updateTransform.call(this);
    -};
    -
    -
    -PIXI.Spine.prototype.createSprite = function (slot, descriptor) {
    -    var name = PIXI.TextureCache[descriptor.name] ? descriptor.name : descriptor.name + ".png";
    -    var sprite = new PIXI.Sprite(PIXI.Texture.fromFrame(name));
    -    sprite.scale = descriptor.scale;
    -    sprite.rotation = descriptor.rotation;
    -    sprite.anchor.x = sprite.anchor.y = 0.5;
    -
    -    slot.sprites = slot.sprites || {};
    -    slot.sprites[descriptor.name] = sprite;
    -    return sprite;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_extras_Strip.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_extras_Strip.js.html deleted file mode 100755 index bb4a3f6..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_extras_Strip.js.html +++ /dev/null @@ -1,629 +0,0 @@ - - - - - src/pixi/extras/Strip.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/extras/Strip.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/
    - */
    -
    - /**
    - * 
    - * @class Strip
    - * @extends DisplayObjectContainer
    - * @constructor
    - * @param texture {Texture} The texture to use
    - * @param width {Number} the width 
    - * @param height {Number} the height
    - * 
    - */
    -PIXI.Strip = function(texture)
    -{
    -    PIXI.DisplayObjectContainer.call( this );
    -    
    -
    -    /**
    -     * The texture of the strip
    -     *
    -     * @property texture
    -     * @type Texture
    -     */
    -    this.texture = texture;
    -
    -    // set up the main bits..
    -    this.uvs = new PIXI.Float32Array([0, 1,
    -                                      1, 1,
    -                                      1, 0,
    -                                      0, 1]);
    -
    -    this.verticies = new PIXI.Float32Array([0, 0,
    -                                            100, 0,
    -                                            100, 100,
    -                                            0, 100]);
    -
    -    this.colors = new PIXI.Float32Array([1, 1, 1, 1]);
    -
    -    this.indices = new PIXI.Uint16Array([0, 1, 2, 3]);
    -    
    -    /**
    -     * Whether the strip is dirty or not
    -     *
    -     * @property dirty
    -     * @type Boolean
    -     */
    -    this.dirty = true;
    -
    -
    -    /**
    -     * if you need a padding, not yet implemented
    -     *
    -     * @property padding
    -     * @type Number
    -     */
    -    this.padding = 0;
    -     // NYI, TODO padding ?
    -
    -};
    -
    -// constructor
    -PIXI.Strip.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
    -PIXI.Strip.prototype.constructor = PIXI.Strip;
    -
    -PIXI.Strip.prototype._renderWebGL = function(renderSession)
    -{
    -    // if the sprite is not visible or the alpha is 0 then no need to render this element
    -    if(!this.visible || this.alpha <= 0)return;
    -    // render triangle strip..
    -
    -    renderSession.spriteBatch.stop();
    -
    -    // init! init!
    -    if(!this._vertexBuffer)this._initWebGL(renderSession);
    -    
    -    renderSession.shaderManager.setShader(renderSession.shaderManager.stripShader);
    -
    -    this._renderStrip(renderSession);
    -
    -    ///renderSession.shaderManager.activateDefaultShader();
    -
    -    renderSession.spriteBatch.start();
    -
    -    //TODO check culling  
    -};
    -
    -PIXI.Strip.prototype._initWebGL = function(renderSession)
    -{
    -    // build the strip!
    -    var gl = renderSession.gl;
    -    
    -    this._vertexBuffer = gl.createBuffer();
    -    this._indexBuffer = gl.createBuffer();
    -    this._uvBuffer = gl.createBuffer();
    -    this._colorBuffer = gl.createBuffer();
    -    
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.verticies, gl.DYNAMIC_DRAW);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER,  this.uvs, gl.STATIC_DRAW);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this._colorBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.colors, gl.STATIC_DRAW);
    - 
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);
    -    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    -};
    -
    -PIXI.Strip.prototype._renderStrip = function(renderSession)
    -{
    -    var gl = renderSession.gl;
    -    var projection = renderSession.projection,
    -        offset = renderSession.offset,
    -        shader = renderSession.shaderManager.stripShader;
    -
    -
    -    // gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mat4Real);
    -
    -    gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    -
    -    // set uniforms
    -    gl.uniformMatrix3fv(shader.translationMatrix, false, this.worldTransform.toArray(true));
    -    gl.uniform2f(shader.projectionVector, projection.x, -projection.y);
    -    gl.uniform2f(shader.offsetVector, -offset.x, -offset.y);
    -    gl.uniform1f(shader.alpha, this.worldAlpha);
    -
    -    if(!this.dirty)
    -    {
    -        
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies);
    -        gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0);
    -        
    -        // update the uvs
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer);
    -        gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0);
    -            
    -        gl.activeTexture(gl.TEXTURE0);
    -
    -        // check if a texture is dirty..
    -        if(this.texture.baseTexture._dirty[gl.id])
    -        {
    -            renderSession.renderer.updateTexture(this.texture.baseTexture);
    -        }
    -        else
    -        {
    -            // bind the current texture
    -            gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]);
    -        }
    -    
    -        // dont need to upload!
    -        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);
    -    
    -    
    -    }
    -    else
    -    {
    -
    -        this.dirty = false;
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);
    -        gl.bufferData(gl.ARRAY_BUFFER, this.verticies, gl.STATIC_DRAW);
    -        gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0);
    -        
    -        // update the uvs
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer);
    -        gl.bufferData(gl.ARRAY_BUFFER, this.uvs, gl.STATIC_DRAW);
    -        gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0);
    -            
    -        gl.activeTexture(gl.TEXTURE0);
    -
    -        // check if a texture is dirty..
    -        if(this.texture.baseTexture._dirty[gl.id])
    -        {
    -            renderSession.renderer.updateTexture(this.texture.baseTexture);
    -        }
    -        else
    -        {
    -            gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]);
    -        }
    -    
    -        // dont need to upload!
    -        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);
    -        gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    -        
    -    }
    -    //console.log(gl.TRIANGLE_STRIP)
    -    //
    -    //
    -    gl.drawElements(gl.TRIANGLE_STRIP, this.indices.length, gl.UNSIGNED_SHORT, 0);
    -    
    -  
    -};
    -
    -
    -
    -PIXI.Strip.prototype._renderCanvas = function(renderSession)
    -{
    -    var context = renderSession.context;
    -    
    -    var transform = this.worldTransform;
    -
    -    if (renderSession.roundPixels)
    -    {
    -        context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx | 0, transform.ty | 0);
    -    }
    -    else
    -    {
    -        context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);
    -    }
    -        
    -    var strip = this;
    -    // draw triangles!!
    -    var verticies = strip.verticies;
    -    var uvs = strip.uvs;
    -
    -    var length = verticies.length/2;
    -    this.count++;
    -
    -    for (var i = 0; i < length-2; i++)
    -    {
    -        // draw some triangles!
    -        var index = i*2;
    -
    -        var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    -        var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    -
    -        if(this.padding > 0)
    -        {
    -            var centerX = (x0 + x1 + x2)/3;
    -            var centerY = (y0 + y1 + y2)/3;
    -
    -            var normX = x0 - centerX;
    -            var normY = y0 - centerY;
    -
    -            var dist = Math.sqrt( normX * normX + normY * normY );
    -            x0 = centerX + (normX / dist) * (dist + 3);
    -            y0 = centerY + (normY / dist) * (dist + 3);
    -
    -            // 
    -            
    -            normX = x1 - centerX;
    -            normY = y1 - centerY;
    -
    -            dist = Math.sqrt( normX * normX + normY * normY );
    -            x1 = centerX + (normX / dist) * (dist + 3);
    -            y1 = centerY + (normY / dist) * (dist + 3);
    -
    -            normX = x2 - centerX;
    -            normY = y2 - centerY;
    -
    -            dist = Math.sqrt( normX * normX + normY * normY );
    -            x2 = centerX + (normX / dist) * (dist + 3);
    -            y2 = centerY + (normY / dist) * (dist + 3);
    -        }
    -
    -        var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2] * strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    -        var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3] * strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    -
    -        context.save();
    -        context.beginPath();
    -
    -
    -        context.moveTo(x0, y0);
    -        context.lineTo(x1, y1);
    -        context.lineTo(x2, y2);
    -
    -        context.closePath();
    -
    -        context.clip();
    -
    -        // Compute matrix transform
    -        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    -        var deltaA = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    -        var deltaB = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    -        var deltaC = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    -        var deltaD = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    -        var deltaE = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    -        var deltaF = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    -
    -        context.transform(deltaA / delta, deltaD / delta,
    -                            deltaB / delta, deltaE / delta,
    -                            deltaC / delta, deltaF / delta);
    -
    -        context.drawImage(strip.texture.baseTexture.source, 0, 0);
    -        context.restore();
    -    }
    -};
    -
    -
    -/**
    - * Renders a flat strip
    - *
    - * @method renderStripFlat
    - * @param strip {Strip} The Strip to render
    - * @private
    - */
    -PIXI.Strip.prototype.renderStripFlat = function(strip)
    -{
    -    var context = this.context;
    -    var verticies = strip.verticies;
    -
    -    var length = verticies.length/2;
    -    this.count++;
    -
    -    context.beginPath();
    -    for (var i=1; i < length-2; i++)
    -    {
    -        // draw some triangles!
    -        var index = i*2;
    -
    -        var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    -        var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    -
    -        context.moveTo(x0, y0);
    -        context.lineTo(x1, y1);
    -        context.lineTo(x2, y2);
    -    }
    -
    -    context.fillStyle = "#FF0000";
    -    context.fill();
    -    context.closePath();
    -};
    -
    -/*
    -PIXI.Strip.prototype.setTexture = function(texture)
    -{
    -    //TODO SET THE TEXTURES
    -    //TODO VISIBILITY
    -
    -    // stop current texture
    -    this.texture = texture;
    -    this.width   = texture.frame.width;
    -    this.height  = texture.frame.height;
    -    this.updateFrame = true;
    -};
    -*/
    -
    -/**
    - * When the texture is updated, this event will fire to update the scale and frame
    - *
    - * @method onTextureUpdate
    - * @param event
    - * @private
    - */
    -
    -PIXI.Strip.prototype.onTextureUpdate = function()
    -{
    -    this.updateFrame = true;
    -};
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_extras_TilingSprite.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_extras_TilingSprite.js.html deleted file mode 100755 index d95a188..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_extras_TilingSprite.js.html +++ /dev/null @@ -1,743 +0,0 @@ - - - - - src/pixi/extras/TilingSprite.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/extras/TilingSprite.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/
    - */
    -
    -/**
    - * A tiling sprite is a fast way of rendering a tiling image
    - *
    - * @class TilingSprite
    - * @extends Sprite
    - * @constructor
    - * @param texture {Texture} the texture of the tiling sprite
    - * @param width {Number}  the width of the tiling sprite
    - * @param height {Number} the height of the tiling sprite
    - */
    -PIXI.TilingSprite = function(texture, width, height)
    -{
    -    PIXI.Sprite.call( this, texture);
    -
    -    /**
    -     * The with of the tiling sprite
    -     *
    -     * @property width
    -     * @type Number
    -     */
    -    this._width = width || 100;
    -
    -    /**
    -     * The height of the tiling sprite
    -     *
    -     * @property height
    -     * @type Number
    -     */
    -    this._height = height || 100;
    -
    -    /**
    -     * The scaling of the image that is being tiled
    -     *
    -     * @property tileScale
    -     * @type Point
    -     */
    -    this.tileScale = new PIXI.Point(1,1);
    -
    -    /**
    -     * A point that represents the scale of the texture object
    -     *
    -     * @property tileScaleOffset
    -     * @type Point
    -     */
    -    this.tileScaleOffset = new PIXI.Point(1,1);
    -    
    -    /**
    -     * The offset position of the image that is being tiled
    -     *
    -     * @property tilePosition
    -     * @type Point
    -     */
    -    this.tilePosition = new PIXI.Point(0,0);
    -
    -    /**
    -     * Whether this sprite is renderable or not
    -     *
    -     * @property renderable
    -     * @type Boolean
    -     * @default true
    -     */
    -    this.renderable = true;
    -
    -    /**
    -     * The tint applied to the sprite. This is a hex value
    -     *
    -     * @property tint
    -     * @type Number
    -     * @default 0xFFFFFF
    -     */
    -    this.tint = 0xFFFFFF;
    -    
    -    /**
    -     * The blend mode to be applied to the sprite
    -     *
    -     * @property blendMode
    -     * @type Number
    -     * @default PIXI.blendModes.NORMAL;
    -     */
    -    this.blendMode = PIXI.blendModes.NORMAL;
    -
    -    
    -
    -};
    -
    -// constructor
    -PIXI.TilingSprite.prototype = Object.create(PIXI.Sprite.prototype);
    -PIXI.TilingSprite.prototype.constructor = PIXI.TilingSprite;
    -
    -
    -/**
    - * The width of the sprite, setting this will actually modify the scale to achieve the value set
    - *
    - * @property width
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TilingSprite.prototype, 'width', {
    -    get: function() {
    -        return this._width;
    -    },
    -    set: function(value) {
    -        
    -        this._width = value;
    -    }
    -});
    -
    -/**
    - * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set
    - *
    - * @property height
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TilingSprite.prototype, 'height', {
    -    get: function() {
    -        return  this._height;
    -    },
    -    set: function(value) {
    -        this._height = value;
    -    }
    -});
    -
    -PIXI.TilingSprite.prototype.setTexture = function(texture)
    -{
    -    if (this.texture === texture) return;
    -
    -    this.texture = texture;
    -
    -    this.refreshTexture = true;
    -
    -    this.cachedTint = 0xFFFFFF;
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.TilingSprite.prototype._renderWebGL = function(renderSession)
    -{
    -    if (this.visible === false || this.alpha === 0) return;
    -    var i,j;
    -
    -    if (this._mask)
    -    {
    -        renderSession.spriteBatch.stop();
    -        renderSession.maskManager.pushMask(this.mask, renderSession);
    -        renderSession.spriteBatch.start();
    -    }
    -
    -    if (this._filters)
    -    {
    -        renderSession.spriteBatch.flush();
    -        renderSession.filterManager.pushFilter(this._filterBlock);
    -    }
    -
    -   
    -
    -    if (!this.tilingTexture || this.refreshTexture)
    -    {
    -        this.generateTilingTexture(true);
    -
    -        if (this.tilingTexture && this.tilingTexture.needsUpdate)
    -        {
    -            //TODO - tweaking
    -            PIXI.updateWebGLTexture(this.tilingTexture.baseTexture, renderSession.gl);
    -            this.tilingTexture.needsUpdate = false;
    -           // this.tilingTexture._uvs = null;
    -        }
    -    }
    -    else
    -    {
    -        renderSession.spriteBatch.renderTilingSprite(this);
    -    }
    -    // simple render children!
    -    for (i=0,j=this.children.length; i<j; i++)
    -    {
    -        this.children[i]._renderWebGL(renderSession);
    -    }
    -
    -    renderSession.spriteBatch.stop();
    -
    -    if (this._filters) renderSession.filterManager.popFilter();
    -    if (this._mask) renderSession.maskManager.popMask(this._mask, renderSession);
    -    
    -    renderSession.spriteBatch.start();
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.TilingSprite.prototype._renderCanvas = function(renderSession)
    -{
    -    if (this.visible === false || this.alpha === 0)return;
    -    
    -    var context = renderSession.context;
    -
    -    if (this._mask)
    -    {
    -        renderSession.maskManager.pushMask(this._mask, context);
    -    }
    -
    -    context.globalAlpha = this.worldAlpha;
    -    
    -    var transform = this.worldTransform;
    -
    -    var i,j;
    -
    -    var resolution = renderSession.resolution;
    -
    -    context.setTransform(transform.a * resolution,
    -                         transform.c * resolution,
    -                         transform.b * resolution,
    -                         transform.d * resolution,
    -                         transform.tx * resolution,
    -                         transform.ty * resolution);
    -
    -    if (!this.__tilePattern ||  this.refreshTexture)
    -    {
    -        this.generateTilingTexture(false);
    -    
    -        if (this.tilingTexture)
    -        {
    -            this.__tilePattern = context.createPattern(this.tilingTexture.baseTexture.source, 'repeat');
    -        }
    -        else
    -        {
    -            return;
    -        }
    -    }
    -
    -    // check blend mode
    -    if (this.blendMode !== renderSession.currentBlendMode)
    -    {
    -        renderSession.currentBlendMode = this.blendMode;
    -        context.globalCompositeOperation = PIXI.blendModesCanvas[renderSession.currentBlendMode];
    -    }
    -
    -    var tilePosition = this.tilePosition;
    -    var tileScale = this.tileScale;
    -
    -    tilePosition.x %= this.tilingTexture.baseTexture.width;
    -    tilePosition.y %= this.tilingTexture.baseTexture.height;
    -
    -    // offset - make sure to account for the anchor point..
    -    context.scale(tileScale.x,tileScale.y);
    -    context.translate(tilePosition.x + (this.anchor.x * -this._width), tilePosition.y + (this.anchor.y * -this._height));
    -
    -    context.fillStyle = this.__tilePattern;
    -
    -    context.fillRect(-tilePosition.x,
    -                    -tilePosition.y,
    -                    this._width / tileScale.x,
    -                    this._height / tileScale.y);
    -
    -    context.scale(1 / tileScale.x, 1 / tileScale.y);
    -    context.translate(-tilePosition.x + (this.anchor.x * this._width), -tilePosition.y + (this.anchor.y * this._height));
    -
    -    if (this._mask)
    -    {
    -        renderSession.maskManager.popMask(renderSession.context);
    -    }
    -
    -    for (i=0,j=this.children.length; i<j; i++)
    -    {
    -        this.children[i]._renderCanvas(renderSession);
    -    }
    -};
    -
    -
    -/**
    -* Returns the framing rectangle of the sprite as a PIXI.Rectangle object
    -*
    -* @method getBounds
    -* @return {Rectangle} the framing rectangle
    -*/
    -PIXI.TilingSprite.prototype.getBounds = function()
    -{
    -    var width = this._width;
    -    var height = this._height;
    -
    -    var w0 = width * (1-this.anchor.x);
    -    var w1 = width * -this.anchor.x;
    -
    -    var h0 = height * (1-this.anchor.y);
    -    var h1 = height * -this.anchor.y;
    -
    -    var worldTransform = this.worldTransform;
    -
    -    var a = worldTransform.a;
    -    var b = worldTransform.b;
    -    var c = worldTransform.c;
    -    var d = worldTransform.d;
    -    var tx = worldTransform.tx;
    -    var ty = worldTransform.ty;
    -    
    -    var x1 = a * w1 + c * h1 + tx;
    -    var y1 = d * h1 + b * w1 + ty;
    -
    -    var x2 = a * w0 + c * h1 + tx;
    -    var y2 = d * h1 + b * w0 + ty;
    -
    -    var x3 = a * w0 + c * h0 + tx;
    -    var y3 = d * h0 + b * w0 + ty;
    -
    -    var x4 =  a * w1 + c * h0 + tx;
    -    var y4 =  d * h0 + b * w1 + ty;
    -
    -    var maxX = -Infinity;
    -    var maxY = -Infinity;
    -
    -    var minX = Infinity;
    -    var minY = Infinity;
    -
    -    minX = x1 < minX ? x1 : minX;
    -    minX = x2 < minX ? x2 : minX;
    -    minX = x3 < minX ? x3 : minX;
    -    minX = x4 < minX ? x4 : minX;
    -
    -    minY = y1 < minY ? y1 : minY;
    -    minY = y2 < minY ? y2 : minY;
    -    minY = y3 < minY ? y3 : minY;
    -    minY = y4 < minY ? y4 : minY;
    -
    -    maxX = x1 > maxX ? x1 : maxX;
    -    maxX = x2 > maxX ? x2 : maxX;
    -    maxX = x3 > maxX ? x3 : maxX;
    -    maxX = x4 > maxX ? x4 : maxX;
    -
    -    maxY = y1 > maxY ? y1 : maxY;
    -    maxY = y2 > maxY ? y2 : maxY;
    -    maxY = y3 > maxY ? y3 : maxY;
    -    maxY = y4 > maxY ? y4 : maxY;
    -
    -    var bounds = this._bounds;
    -
    -    bounds.x = minX;
    -    bounds.width = maxX - minX;
    -
    -    bounds.y = minY;
    -    bounds.height = maxY - minY;
    -
    -    // store a reference so that if this function gets called again in the render cycle we do not have to recalculate
    -    this._currentBounds = bounds;
    -
    -    return bounds;
    -};
    -
    -
    -
    -/**
    - * When the texture is updated, this event will fire to update the scale and frame
    - *
    - * @method onTextureUpdate
    - * @param event
    - * @private
    - */
    -PIXI.TilingSprite.prototype.onTextureUpdate = function()
    -{
    -   // overriding the sprite version of this!
    -};
    -
    -
    -/**
    -* 
    -* @method generateTilingTexture
    -* 
    -* @param forcePowerOfTwo {Boolean} Whether we want to force the texture to be a power of two
    -*/
    -PIXI.TilingSprite.prototype.generateTilingTexture = function(forcePowerOfTwo)
    -{
    -    if (!this.texture.baseTexture.hasLoaded) return;
    -
    -    var texture = this.originalTexture || this.texture;
    -    var frame = texture.frame;
    -    var targetWidth, targetHeight;
    -
    -    //  Check that the frame is the same size as the base texture.
    -    var isFrame = frame.width !== texture.baseTexture.width || frame.height !== texture.baseTexture.height;
    -
    -    var newTextureRequired = false;
    -
    -    if (!forcePowerOfTwo)
    -    {
    -        if (isFrame)
    -        {
    -            targetWidth = frame.width;
    -            targetHeight = frame.height;
    -           
    -            newTextureRequired = true;
    -        }
    -    }
    -    else
    -    {
    -        targetWidth = PIXI.getNextPowerOfTwo(frame.width);
    -        targetHeight = PIXI.getNextPowerOfTwo(frame.height);
    -
    -        if (frame.width !== targetWidth || frame.height !== targetHeight) newTextureRequired = true;
    -    }
    -
    -    if (newTextureRequired)
    -    {
    -        var canvasBuffer;
    -
    -        if (this.tilingTexture && this.tilingTexture.isTiling)
    -        {
    -            canvasBuffer = this.tilingTexture.canvasBuffer;
    -            canvasBuffer.resize(targetWidth, targetHeight);
    -            this.tilingTexture.baseTexture.width = targetWidth;
    -            this.tilingTexture.baseTexture.height = targetHeight;
    -            this.tilingTexture.needsUpdate = true;
    -        }
    -        else
    -        {
    -            canvasBuffer = new PIXI.CanvasBuffer(targetWidth, targetHeight);
    -
    -            this.tilingTexture = PIXI.Texture.fromCanvas(canvasBuffer.canvas);
    -            this.tilingTexture.canvasBuffer = canvasBuffer;
    -            this.tilingTexture.isTiling = true;
    -        }
    -
    -        canvasBuffer.context.drawImage(texture.baseTexture.source,
    -                               texture.crop.x,
    -                               texture.crop.y,
    -                               texture.crop.width,
    -                               texture.crop.height,
    -                               0,
    -                               0,
    -                               targetWidth,
    -                               targetHeight);
    -
    -        this.tileScaleOffset.x = frame.width / targetWidth;
    -        this.tileScaleOffset.y = frame.height / targetHeight;
    -    }
    -    else
    -    {
    -        //  TODO - switching?
    -        if (this.tilingTexture && this.tilingTexture.isTiling)
    -        {
    -            // destroy the tiling texture!
    -            // TODO could store this somewhere?
    -            this.tilingTexture.destroy(true);
    -        }
    -
    -        this.tileScaleOffset.x = 1;
    -        this.tileScaleOffset.y = 1;
    -        this.tilingTexture = texture;
    -    }
    -
    -    this.refreshTexture = false;
    -    
    -    this.originalTexture = this.texture;
    -    this.texture = this.tilingTexture;
    -    
    -    this.tilingTexture.baseTexture._powerOf2 = true;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_AbstractFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_AbstractFilter.js.html deleted file mode 100755 index d4ac332..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_AbstractFilter.js.html +++ /dev/null @@ -1,355 +0,0 @@ - - - - - src/pixi/filters/AbstractFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/AbstractFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This is the base class for creating a PIXI filter. Currently only webGL supports filters.
    - * If you want to make a custom filter this should be your base class.
    - * @class AbstractFilter
    - * @constructor
    - * @param fragmentSrc {Array} The fragment source in an array of strings.
    - * @param uniforms {Object} An object containing the uniforms for this filter.
    - */
    -PIXI.AbstractFilter = function(fragmentSrc, uniforms)
    -{
    -    /**
    -    * An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion.
    -    * For example the blur filter has two passes blurX and blurY.
    -    * @property passes
    -    * @type Array an array of filter objects
    -    * @private
    -    */
    -    this.passes = [this];
    -
    -    /**
    -    * @property shaders
    -    * @type Array an array of shaders
    -    * @private
    -    */
    -    this.shaders = [];
    -    
    -    /**
    -    * @property dirty
    -    * @type Boolean
    -    */
    -    this.dirty = true;
    -
    -    /**
    -    * @property padding
    -    * @type Number
    -    */
    -    this.padding = 0;
    -
    -    /**
    -    * @property uniforms
    -    * @type object
    -    * @private
    -    */
    -    this.uniforms = uniforms || {};
    -
    -    /**
    -    * @property fragmentSrc
    -    * @type Array
    -    * @private
    -    */
    -    this.fragmentSrc = fragmentSrc || [];
    -};
    -
    -PIXI.AbstractFilter.prototype.constructor = PIXI.AbstractFilter;
    -
    -/**
    - * Syncs the uniforms between the class object and the shaders.
    - *
    - * @method syncUniforms
    - */
    -PIXI.AbstractFilter.prototype.syncUniforms = function()
    -{
    -    for(var i=0,j=this.shaders.length; i<j; i++)
    -    {
    -        this.shaders[i].dirty = true;
    -    }
    -};
    -
    -/*
    -PIXI.AbstractFilter.prototype.apply = function(frameBuffer)
    -{
    -    // TODO :)
    -};
    -*/
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_AlphaMaskFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_AlphaMaskFilter.js.html deleted file mode 100755 index e332a02..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_AlphaMaskFilter.js.html +++ /dev/null @@ -1,375 +0,0 @@ - - - - - src/pixi/filters/AlphaMaskFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/AlphaMaskFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The AlphaMaskFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object.
    - * You can use this filter to apply all manor of crazy warping effects
    - * Currently the r property of the texture is used to offset the x and the g property of the texture is used to offset the y.
    - * 
    - * @class AlphaMaskFilter
    - * @extends AbstractFilter
    - * @constructor
    - * @param texture {Texture} The texture used for the displacement map * must be power of 2 texture at the moment
    - */
    -PIXI.AlphaMaskFilter = function(texture)
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -    texture.baseTexture._powerOf2 = true;
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        mask: {type: 'sampler2D', value:texture},
    -        mapDimensions:   {type: '2f', value:{x:1, y:5112}},
    -        dimensions:   {type: '4fv', value:[0,0,0,0]}
    -    };
    -
    -    if(texture.baseTexture.hasLoaded)
    -    {
    -        this.uniforms.mask.value.x = texture.width;
    -        this.uniforms.mask.value.y = texture.height;
    -    }
    -    else
    -    {
    -        this.boundLoadedFunction = this.onTextureLoaded.bind(this);
    -
    -        texture.baseTexture.on('loaded', this.boundLoadedFunction);
    -    }
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D mask;',
    -        'uniform sampler2D uSampler;',
    -        'uniform vec2 offset;',
    -        'uniform vec4 dimensions;',
    -        'uniform vec2 mapDimensions;',
    -
    -        'void main(void) {',
    -        '   vec2 mapCords = vTextureCoord.xy;',
    -        '   mapCords += (dimensions.zw + offset)/ dimensions.xy ;',
    -        '   mapCords.y *= -1.0;',
    -        '   mapCords.y += 1.0;',
    -        '   mapCords *= dimensions.xy / mapDimensions;',
    -
    -        '   vec4 original =  texture2D(uSampler, vTextureCoord);',
    -        '   float maskAlpha =  texture2D(mask, mapCords).r;',
    -        '   original *= maskAlpha;',
    -        //'   original.rgb *= maskAlpha;',
    -        '   gl_FragColor =  original;',
    -        //'   gl_FragColor = gl_FragColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.AlphaMaskFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.AlphaMaskFilter.prototype.constructor = PIXI.AlphaMaskFilter;
    -
    -/**
    - * Sets the map dimensions uniforms when the texture becomes available.
    - *
    - * @method onTextureLoaded
    - */
    -PIXI.AlphaMaskFilter.prototype.onTextureLoaded = function()
    -{
    -    this.uniforms.mapDimensions.value.x = this.uniforms.mask.value.width;
    -    this.uniforms.mapDimensions.value.y = this.uniforms.mask.value.height;
    -
    -    this.uniforms.mask.value.baseTexture.off('loaded', this.boundLoadedFunction);
    -};
    -
    -/**
    - * The texture used for the displacement map. Must be power of 2 sized texture.
    - *
    - * @property map
    - * @type Texture
    - */
    -Object.defineProperty(PIXI.AlphaMaskFilter.prototype, 'map', {
    -    get: function() {
    -        return this.uniforms.mask.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.mask.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_AsciiFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_AsciiFilter.js.html deleted file mode 100755 index fecc5d2..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_AsciiFilter.js.html +++ /dev/null @@ -1,364 +0,0 @@ - - - - - src/pixi/filters/AsciiFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/AsciiFilter.js

    - -
    -
    -/**
    - * @author Vico @vicocotea
    - * original shader : https://www.shadertoy.com/view/lssGDj by @movAX13h
    - */
    -
    -/**
    - * An ASCII filter.
    - * 
    - * @class AsciiFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.AsciiFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        dimensions: {type: '4fv', value:new PIXI.Float32Array([10000, 100, 10, 10])},
    -        pixelSize: {type: '1f', value:8}
    -    };
    -
    -    this.fragmentSrc = [
    -        
    -        'precision mediump float;',
    -        'uniform vec4 dimensions;',
    -        'uniform float pixelSize;',
    -        'uniform sampler2D uSampler;',
    -
    -        'float character(float n, vec2 p)',
    -        '{',
    -        '    p = floor(p*vec2(4.0, -4.0) + 2.5);',
    -        '    if (clamp(p.x, 0.0, 4.0) == p.x && clamp(p.y, 0.0, 4.0) == p.y)',
    -        '    {',
    -        '        if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0;',
    -        '    }',
    -        '    return 0.0;',
    -        '}',
    -
    -        'void main()',
    -        '{',
    -        '    vec2 uv = gl_FragCoord.xy;',
    -        '    vec3 col = texture2D(uSampler, floor( uv / pixelSize ) * pixelSize / dimensions.xy).rgb;',
    -            
    -        '    #ifdef HAS_GREENSCREEN',
    -        '    float gray = (col.r + col.b)/2.0;', 
    -        '    #else',
    -        '    float gray = (col.r + col.g + col.b)/3.0;',
    -        '    #endif',
    -  
    -        '    float n =  65536.0;             // .',
    -        '    if (gray > 0.2) n = 65600.0;    // :',
    -        '    if (gray > 0.3) n = 332772.0;   // *',
    -        '    if (gray > 0.4) n = 15255086.0; // o',
    -        '    if (gray > 0.5) n = 23385164.0; // &',
    -        '    if (gray > 0.6) n = 15252014.0; // 8',
    -        '    if (gray > 0.7) n = 13199452.0; // @',
    -        '    if (gray > 0.8) n = 11512810.0; // #',
    -            
    -        '    vec2 p = mod( uv / ( pixelSize * 0.5 ), 2.0) - vec2(1.0);',
    -        '    col = col * character(n, p);',
    -            
    -        '    gl_FragColor = vec4(col, 1.0);',
    -        '}'
    -    ];
    -};
    -
    -PIXI.AsciiFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.AsciiFilter.prototype.constructor = PIXI.AsciiFilter;
    -
    -/**
    - * The pixel size used by the filter.
    - *
    - * @property size
    - * @type Number
    - */
    -Object.defineProperty(PIXI.AsciiFilter.prototype, 'size', {
    -    get: function() {
    -        return this.uniforms.pixelSize.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.pixelSize.value = value;
    -    }
    -});
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_BlurFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_BlurFilter.js.html deleted file mode 100755 index f7c0d25..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_BlurFilter.js.html +++ /dev/null @@ -1,348 +0,0 @@ - - - - - src/pixi/filters/BlurFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/BlurFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The BlurFilter applies a Gaussian blur to an object.
    - * The strength of the blur can be set for x- and y-axis separately (always relative to the stage).
    - *
    - * @class BlurFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.BlurFilter = function()
    -{
    -    this.blurXFilter = new PIXI.BlurXFilter();
    -    this.blurYFilter = new PIXI.BlurYFilter();
    -
    -    this.passes =[this.blurXFilter, this.blurYFilter];
    -};
    -
    -PIXI.BlurFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.BlurFilter.prototype.constructor = PIXI.BlurFilter;
    -
    -/**
    - * Sets the strength of both the blurX and blurY properties simultaneously
    - *
    - * @property blur
    - * @type Number the strength of the blur
    - * @default 2
    - */
    -Object.defineProperty(PIXI.BlurFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.blurXFilter.blur;
    -    },
    -    set: function(value) {
    -        this.blurXFilter.blur = this.blurYFilter.blur = value;
    -    }
    -});
    -
    -/**
    - * Sets the strength of the blurX property
    - *
    - * @property blurX
    - * @type Number the strength of the blurX
    - * @default 2
    - */
    -Object.defineProperty(PIXI.BlurFilter.prototype, 'blurX', {
    -    get: function() {
    -        return this.blurXFilter.blur;
    -    },
    -    set: function(value) {
    -        this.blurXFilter.blur = value;
    -    }
    -});
    -
    -/**
    - * Sets the strength of the blurY property
    - *
    - * @property blurY
    - * @type Number the strength of the blurY
    - * @default 2
    - */
    -Object.defineProperty(PIXI.BlurFilter.prototype, 'blurY', {
    -    get: function() {
    -        return this.blurYFilter.blur;
    -    },
    -    set: function(value) {
    -        this.blurYFilter.blur = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_BlurXFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_BlurXFilter.js.html deleted file mode 100755 index 622c2f6..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_BlurXFilter.js.html +++ /dev/null @@ -1,345 +0,0 @@ - - - - - src/pixi/filters/BlurXFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/BlurXFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The BlurXFilter applies a horizontal Gaussian blur to an object.
    - *
    - * @class BlurXFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.BlurXFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 1/512}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float blur;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   vec4 sum = vec4(0.0);',
    -
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x - 4.0*blur, vTextureCoord.y)) * 0.05;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x - 3.0*blur, vTextureCoord.y)) * 0.09;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x - 2.0*blur, vTextureCoord.y)) * 0.12;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x - blur, vTextureCoord.y)) * 0.15;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x + blur, vTextureCoord.y)) * 0.15;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x + 2.0*blur, vTextureCoord.y)) * 0.12;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x + 3.0*blur, vTextureCoord.y)) * 0.09;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x + 4.0*blur, vTextureCoord.y)) * 0.05;',
    -
    -        '   gl_FragColor = sum;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.BlurXFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.BlurXFilter.prototype.constructor = PIXI.BlurXFilter;
    -
    -/**
    - * Sets the strength of both the blur.
    - *
    - * @property blur
    - * @type Number the strength of the blur
    - * @default 2
    - */
    -Object.defineProperty(PIXI.BlurXFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value / (1/7000);
    -    },
    -    set: function(value) {
    -
    -        this.dirty = true;
    -        this.uniforms.blur.value = (1/7000) * value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_BlurYFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_BlurYFilter.js.html deleted file mode 100755 index a6c7290..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_BlurYFilter.js.html +++ /dev/null @@ -1,344 +0,0 @@ - - - - - src/pixi/filters/BlurYFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/BlurYFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The BlurYFilter applies a vertical Gaussian blur to an object.
    - *
    - * @class BlurYFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.BlurYFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 1/512}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float blur;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   vec4 sum = vec4(0.0);',
    -
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 4.0*blur)) * 0.05;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 3.0*blur)) * 0.09;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 2.0*blur)) * 0.12;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - blur)) * 0.15;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + blur)) * 0.15;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 2.0*blur)) * 0.12;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 3.0*blur)) * 0.09;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 4.0*blur)) * 0.05;',
    -
    -        '   gl_FragColor = sum;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.BlurYFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.BlurYFilter.prototype.constructor = PIXI.BlurYFilter;
    -
    -/**
    - * Sets the strength of both the blur.
    - *
    - * @property blur
    - * @type Number the strength of the blur
    - * @default 2
    - */
    -Object.defineProperty(PIXI.BlurYFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value / (1/7000);
    -    },
    -    set: function(value) {
    -        //this.padding = value;
    -        this.uniforms.blur.value = (1/7000) * value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_ColorMatrixFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_ColorMatrixFilter.js.html deleted file mode 100755 index 86702fe..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_ColorMatrixFilter.js.html +++ /dev/null @@ -1,337 +0,0 @@ - - - - - src/pixi/filters/ColorMatrixFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/ColorMatrixFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The ColorMatrixFilter class lets you apply a 4x4 matrix transformation on the RGBA
    - * color and alpha values of every pixel on your displayObject to produce a result
    - * with a new set of RGBA color and alpha values. It's pretty powerful!
    - * 
    - * @class ColorMatrixFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.ColorMatrixFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        matrix: {type: 'mat4', value: [1,0,0,0,
    -                                       0,1,0,0,
    -                                       0,0,1,0,
    -                                       0,0,0,1]}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float invert;',
    -        'uniform mat4 matrix;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord) * matrix;',
    -      //  '   gl_FragColor = gl_FragColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.ColorMatrixFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.ColorMatrixFilter.prototype.constructor = PIXI.ColorMatrixFilter;
    -
    -/**
    - * Sets the matrix of the color matrix filter
    - *
    - * @property matrix
    - * @type Array and array of 26 numbers
    - * @default [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]
    - */
    -Object.defineProperty(PIXI.ColorMatrixFilter.prototype, 'matrix', {
    -    get: function() {
    -        return this.uniforms.matrix.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.matrix.value = value;
    -    }
    -});
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_ColorStepFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_ColorStepFilter.js.html deleted file mode 100755 index eb21f70..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_ColorStepFilter.js.html +++ /dev/null @@ -1,332 +0,0 @@ - - - - - src/pixi/filters/ColorStepFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/ColorStepFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This lowers the color depth of your image by the given amount, producing an image with a smaller palette.
    - * 
    - * @class ColorStepFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.ColorStepFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        step: {type: '1f', value: 5}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D uSampler;',
    -        'uniform float step;',
    -
    -        'void main(void) {',
    -        '   vec4 color = texture2D(uSampler, vTextureCoord);',
    -        '   color = floor(color * step) / step;',
    -        '   gl_FragColor = color;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.ColorStepFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.ColorStepFilter.prototype.constructor = PIXI.ColorStepFilter;
    -
    -/**
    - * The number of steps to reduce the palette by.
    - *
    - * @property step
    - * @type Number
    - */
    -Object.defineProperty(PIXI.ColorStepFilter.prototype, 'step', {
    -    get: function() {
    -        return this.uniforms.step.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.step.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_ConvolutionFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_ConvolutionFilter.js.html deleted file mode 100755 index e6acdc3..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_ConvolutionFilter.js.html +++ /dev/null @@ -1,384 +0,0 @@ - - - - - src/pixi/filters/ConvolutionFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/ConvolutionFilter.js

    - -
    -
    -/**
    - * The ConvolutionFilter class applies a matrix convolution filter effect. 
    - * A convolution combines pixels in the input image with neighboring pixels to produce a new image. 
    - * A wide variety of image effects can be achieved through convolutions, including blurring, edge detection, sharpening, embossing, and beveling.
    - * The matrix should be specified as a 9 point Array. See http://docs.gimp.org/en/plug-in-convmatrix.html for more info.
    - * 
    - * @class ConvolutionFilter
    - * @extends AbstractFilter
    - * @constructor
    - * @param matrix {Array} An array of values used for matrix transformation. Specified as a 9 point Array.
    - * @param width {Number} Width of the object you are transforming
    - * @param height {Number} Height of the object you are transforming
    - */
    -PIXI.ConvolutionFilter = function(matrix, width, height)
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        m : {type: '1fv', value: new PIXI.Float32Array(matrix)},
    -        texelSizeX: {type: '1f', value: 1 / width},
    -        texelSizeY: {type: '1f', value: 1 / height}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying mediump vec2 vTextureCoord;',
    -        'uniform sampler2D texture;',
    -        'uniform float texelSizeX;',
    -        'uniform float texelSizeY;',
    -        'uniform float m[9];',
    -
    -        'vec2 px = vec2(texelSizeX, texelSizeY);',
    -
    -        'void main(void) {',
    -            'vec4 c11 = texture2D(texture, vTextureCoord - px);', // top left
    -            'vec4 c12 = texture2D(texture, vec2(vTextureCoord.x, vTextureCoord.y - px.y));', // top center
    -            'vec4 c13 = texture2D(texture, vec2(vTextureCoord.x + px.x, vTextureCoord.y - px.y));', // top right
    -
    -            'vec4 c21 = texture2D(texture, vec2(vTextureCoord.x - px.x, vTextureCoord.y) );', // mid left
    -            'vec4 c22 = texture2D(texture, vTextureCoord);', // mid center
    -            'vec4 c23 = texture2D(texture, vec2(vTextureCoord.x + px.x, vTextureCoord.y) );', // mid right
    -
    -            'vec4 c31 = texture2D(texture, vec2(vTextureCoord.x - px.x, vTextureCoord.y + px.y) );', // bottom left
    -            'vec4 c32 = texture2D(texture, vec2(vTextureCoord.x, vTextureCoord.y + px.y) );', // bottom center
    -            'vec4 c33 = texture2D(texture, vTextureCoord + px );', // bottom right
    -
    -            'gl_FragColor = ',
    -            'c11 * m[0] + c12 * m[1] + c22 * m[2] +',
    -            'c21 * m[3] + c22 * m[4] + c23 * m[5] +',
    -            'c31 * m[6] + c32 * m[7] + c33 * m[8];',
    -            'gl_FragColor.a = c22.a;',
    -        '}'
    -    ];
    -
    -};
    -
    -PIXI.ConvolutionFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.ConvolutionFilter.prototype.constructor = PIXI.ConvolutionFilter;
    -
    -/**
    - * An array of values used for matrix transformation. Specified as a 9 point Array.
    - *
    - * @property matrix
    - * @type Array
    - */
    -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'matrix', {
    -    get: function() {
    -        return this.uniforms.m.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.m.value = new PIXI.Float32Array(value);
    -    }
    -});
    -
    -/**
    - * Width of the object you are transforming
    - *
    - * @property width
    - * @type Number
    - */
    -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'width', {
    -    get: function() {
    -        return this.uniforms.texelSizeX.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.texelSizeX.value = 1/value;
    -    }
    -});
    -
    -/**
    - * Height of the object you are transforming
    - *
    - * @property height
    - * @type Number
    - */
    -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'height', {
    -    get: function() {
    -        return this.uniforms.texelSizeY.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.texelSizeY.value = 1/value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_CrossHatchFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_CrossHatchFilter.js.html deleted file mode 100755 index 5c8509e..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_CrossHatchFilter.js.html +++ /dev/null @@ -1,358 +0,0 @@ - - - - - src/pixi/filters/CrossHatchFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/CrossHatchFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A Cross Hatch effect filter.
    - * 
    - * @class CrossHatchFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.CrossHatchFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 1 / 512}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float blur;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '    float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);',
    -
    -        '    gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);',
    -
    -        '    if (lum < 1.00) {',
    -        '        if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {',
    -        '            gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);',
    -        '        }',
    -        '    }',
    -
    -        '    if (lum < 0.75) {',
    -        '        if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {',
    -        '            gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);',
    -        '        }',
    -        '    }',
    -
    -        '    if (lum < 0.50) {',
    -        '        if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {',
    -        '            gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);',
    -        '        }',
    -        '    }',
    -
    -        '    if (lum < 0.3) {',
    -        '        if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {',
    -        '            gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);',
    -        '        }',
    -        '    }',
    -        '}'
    -    ];
    -};
    -
    -PIXI.CrossHatchFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.CrossHatchFilter.prototype.constructor = PIXI.CrossHatchFilter;
    -
    -/**
    - * Sets the strength of both the blur.
    - *
    - * @property blur
    - * @type Number the strength of the blur
    - * @default 2
    - */
    -Object.defineProperty(PIXI.CrossHatchFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value / (1/7000);
    -    },
    -    set: function(value) {
    -        //this.padding = value;
    -        this.uniforms.blur.value = (1/7000) * value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_DisplacementFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_DisplacementFilter.js.html deleted file mode 100755 index 06dd7d5..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_DisplacementFilter.js.html +++ /dev/null @@ -1,412 +0,0 @@ - - - - - src/pixi/filters/DisplacementFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/DisplacementFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The DisplacementFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object.
    - * You can use this filter to apply all manor of crazy warping effects
    - * Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.
    - * 
    - * @class DisplacementFilter
    - * @extends AbstractFilter
    - * @constructor
    - * @param texture {Texture} The texture used for the displacement map * must be power of 2 texture at the moment
    - */
    -PIXI.DisplacementFilter = function(texture)
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -    texture.baseTexture._powerOf2 = true;
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        displacementMap: {type: 'sampler2D', value:texture},
    -        scale:           {type: '2f', value:{x:30, y:30}},
    -        offset:          {type: '2f', value:{x:0, y:0}},
    -        mapDimensions:   {type: '2f', value:{x:1, y:5112}},
    -        dimensions:   {type: '4fv', value:[0,0,0,0]}
    -    };
    -
    -    if(texture.baseTexture.hasLoaded)
    -    {
    -        this.uniforms.mapDimensions.value.x = texture.width;
    -        this.uniforms.mapDimensions.value.y = texture.height;
    -    }
    -    else
    -    {
    -        this.boundLoadedFunction = this.onTextureLoaded.bind(this);
    -
    -        texture.baseTexture.on('loaded', this.boundLoadedFunction);
    -    }
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D displacementMap;',
    -        'uniform sampler2D uSampler;',
    -        'uniform vec2 scale;',
    -        'uniform vec2 offset;',
    -        'uniform vec4 dimensions;',
    -        'uniform vec2 mapDimensions;',// = vec2(256.0, 256.0);',
    -        // 'const vec2 textureDimensions = vec2(750.0, 750.0);',
    -
    -        'void main(void) {',
    -        '   vec2 mapCords = vTextureCoord.xy;',
    -        //'   mapCords -= ;',
    -        '   mapCords += (dimensions.zw + offset)/ dimensions.xy ;',
    -        '   mapCords.y *= -1.0;',
    -        '   mapCords.y += 1.0;',
    -        '   vec2 matSample = texture2D(displacementMap, mapCords).xy;',
    -        '   matSample -= 0.5;',
    -        '   matSample *= scale;',
    -        '   matSample /= mapDimensions;',
    -        '   gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + matSample.x, vTextureCoord.y + matSample.y));',
    -        '   gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb, 1.0);',
    -        '   vec2 cord = vTextureCoord;',
    -
    -        //'   gl_FragColor =  texture2D(displacementMap, cord);',
    -     //   '   gl_FragColor = gl_FragColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.DisplacementFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.DisplacementFilter.prototype.constructor = PIXI.DisplacementFilter;
    -
    -/**
    - * Sets the map dimensions uniforms when the texture becomes available.
    - *
    - * @method onTextureLoaded
    - */
    -PIXI.DisplacementFilter.prototype.onTextureLoaded = function()
    -{
    -    this.uniforms.mapDimensions.value.x = this.uniforms.displacementMap.value.width;
    -    this.uniforms.mapDimensions.value.y = this.uniforms.displacementMap.value.height;
    -
    -    this.uniforms.displacementMap.value.baseTexture.off('loaded', this.boundLoadedFunction);
    -};
    -
    -/**
    - * The texture used for the displacement map. Must be power of 2 texture.
    - *
    - * @property map
    - * @type Texture
    - */
    -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'map', {
    -    get: function() {
    -        return this.uniforms.displacementMap.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.displacementMap.value = value;
    -    }
    -});
    -
    -/**
    - * The multiplier used to scale the displacement result from the map calculation.
    - *
    - * @property scale
    - * @type Point
    - */
    -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'scale', {
    -    get: function() {
    -        return this.uniforms.scale.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.scale.value = value;
    -    }
    -});
    -
    -/**
    - * The offset used to move the displacement map.
    - *
    - * @property offset
    - * @type Point
    - */
    -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'offset', {
    -    get: function() {
    -        return this.uniforms.offset.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.offset.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_DotScreenFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_DotScreenFilter.js.html deleted file mode 100755 index b0cf737..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_DotScreenFilter.js.html +++ /dev/null @@ -1,363 +0,0 @@ - - - - - src/pixi/filters/DotScreenFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/DotScreenFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/fun/dotscreen.js
    - */
    -
    -/**
    - * This filter applies a dotscreen effect making display objects appear to be made out of black and white halftone dots like an old printer.
    - * 
    - * @class DotScreenFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.DotScreenFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        scale: {type: '1f', value:1},
    -        angle: {type: '1f', value:5},
    -        dimensions:   {type: '4fv', value:[0,0,0,0]}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform vec4 dimensions;',
    -        'uniform sampler2D uSampler;',
    -
    -        'uniform float angle;',
    -        'uniform float scale;',
    -
    -        'float pattern() {',
    -        '   float s = sin(angle), c = cos(angle);',
    -        '   vec2 tex = vTextureCoord * dimensions.xy;',
    -        '   vec2 point = vec2(',
    -        '       c * tex.x - s * tex.y,',
    -        '       s * tex.x + c * tex.y',
    -        '   ) * scale;',
    -        '   return (sin(point.x) * sin(point.y)) * 4.0;',
    -        '}',
    -
    -        'void main() {',
    -        '   vec4 color = texture2D(uSampler, vTextureCoord);',
    -        '   float average = (color.r + color.g + color.b) / 3.0;',
    -        '   gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);',
    -        '}'
    -    ];
    -};
    -
    -PIXI.DotScreenFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.DotScreenFilter.prototype.constructor = PIXI.DotScreenFilter;
    -
    -/**
    - * The scale of the effect.
    - * @property scale
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DotScreenFilter.prototype, 'scale', {
    -    get: function() {
    -        return this.uniforms.scale.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.scale.value = value;
    -    }
    -});
    -
    -/**
    - * The radius of the effect.
    - * @property angle
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DotScreenFilter.prototype, 'angle', {
    -    get: function() {
    -        return this.uniforms.angle.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.angle.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_FilterBlock.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_FilterBlock.js.html deleted file mode 100755 index 275cc3d..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_FilterBlock.js.html +++ /dev/null @@ -1,308 +0,0 @@ - - - - - src/pixi/filters/FilterBlock.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/FilterBlock.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A target and pass info object for filters.
    - * 
    - * @class FilterBlock
    - * @constructor
    - */
    -PIXI.FilterBlock = function()
    -{
    -    /**
    -     * The visible state of this FilterBlock.
    -     *
    -     * @property visible
    -     * @type Boolean
    -     */
    -    this.visible = true;
    -
    -    /**
    -     * The renderable state of this FilterBlock.
    -     *
    -     * @property renderable
    -     * @type Boolean
    -     */
    -    this.renderable = true;
    -};
    -
    -PIXI.FilterBlock.prototype.constructor = PIXI.FilterBlock;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_GrayFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_GrayFilter.js.html deleted file mode 100755 index 5ac5889..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_GrayFilter.js.html +++ /dev/null @@ -1,331 +0,0 @@ - - - - - src/pixi/filters/GrayFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/GrayFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This greyscales the palette of your Display Objects.
    - * 
    - * @class GrayFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.GrayFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        gray: {type: '1f', value: 1}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D uSampler;',
    -        'uniform float gray;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord);',
    -        '   gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(0.2126*gl_FragColor.r + 0.7152*gl_FragColor.g + 0.0722*gl_FragColor.b), gray);',
    -     //   '   gl_FragColor = gl_FragColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.GrayFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.GrayFilter.prototype.constructor = PIXI.GrayFilter;
    -
    -/**
    - * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color.
    - * @property gray
    - * @type Number
    - */
    -Object.defineProperty(PIXI.GrayFilter.prototype, 'gray', {
    -    get: function() {
    -        return this.uniforms.gray.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.gray.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_InvertFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_InvertFilter.js.html deleted file mode 100755 index 8c3dabd..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_InvertFilter.js.html +++ /dev/null @@ -1,332 +0,0 @@ - - - - - src/pixi/filters/InvertFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/InvertFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This inverts your Display Objects colors.
    - * 
    - * @class InvertFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.InvertFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        invert: {type: '1f', value: 1}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float invert;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord);',
    -        '   gl_FragColor.rgb = mix( (vec3(1)-gl_FragColor.rgb) * gl_FragColor.a, gl_FragColor.rgb, 1.0 - invert);',
    -        //'   gl_FragColor.rgb = gl_FragColor.rgb  * gl_FragColor.a;',
    -      //  '   gl_FragColor = gl_FragColor * vColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.InvertFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.InvertFilter.prototype.constructor = PIXI.InvertFilter;
    -
    -/**
    - * The strength of the invert. 1 will fully invert the colors, 0 will make the object its normal color
    - * @property invert
    - * @type Number
    -*/
    -Object.defineProperty(PIXI.InvertFilter.prototype, 'invert', {
    -    get: function() {
    -        return this.uniforms.invert.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.invert.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_NoiseFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_NoiseFilter.js.html deleted file mode 100755 index 2949784..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_NoiseFilter.js.html +++ /dev/null @@ -1,340 +0,0 @@ - - - - - src/pixi/filters/NoiseFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/NoiseFilter.js

    - -
    -
    -/**
    - * @author Vico @vicocotea
    - * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js
    - */
    -
    -/**
    - * A Noise effect filter.
    - * 
    - * @class NoiseFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.NoiseFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        noise: {type: '1f', value: 0.5}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'uniform sampler2D uSampler;',
    -        'uniform float noise;',
    -        'varying vec2 vTextureCoord;',
    -
    -        'float rand(vec2 co) {',
    -        '    return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);',
    -        '}',
    -        'void main() {',
    -        '    vec4 color = texture2D(uSampler, vTextureCoord);',
    -            
    -        '    float diff = (rand(vTextureCoord) - 0.5) * noise;',
    -        '    color.r += diff;',
    -        '    color.g += diff;',
    -        '    color.b += diff;',
    -            
    -        '    gl_FragColor = color;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.NoiseFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.NoiseFilter.prototype.constructor = PIXI.NoiseFilter;
    -
    -/**
    - * The amount of noise to apply.
    - * @property noise
    - * @type Number
    -*/
    -Object.defineProperty(PIXI.NoiseFilter.prototype, 'noise', {
    -    get: function() {
    -        return this.uniforms.noise.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.noise.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_NormalMapFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_NormalMapFilter.js.html deleted file mode 100755 index eca90e7..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_NormalMapFilter.js.html +++ /dev/null @@ -1,474 +0,0 @@ - - - - - src/pixi/filters/NormalMapFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/NormalMapFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -
    -/**
    - * The NormalMapFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. 
    - * You can use this filter to apply all manor of crazy warping effects
    - * Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.
    - * 
    - * @class NormalMapFilter
    - * @extends AbstractFilter
    - * @constructor
    - * @param texture {Texture} The texture used for the displacement map * must be power of 2 texture at the moment
    - */
    -PIXI.NormalMapFilter = function(texture)
    -{
    -	PIXI.AbstractFilter.call( this );
    -	
    -	this.passes = [this];
    -	texture.baseTexture._powerOf2 = true;
    -
    -	// set the uniforms
    -	this.uniforms = {
    -		displacementMap: {type: 'sampler2D', value:texture},
    -		scale:			 {type: '2f', value:{x:15, y:15}},
    -		offset:			 {type: '2f', value:{x:0, y:0}},
    -		mapDimensions:   {type: '2f', value:{x:1, y:1}},
    -		dimensions:   {type: '4f', value:[0,0,0,0]},
    -	//	LightDir: {type: 'f3', value:[0, 1, 0]},
    -		LightPos: {type: '3f', value:[0, 1, 0]}
    -	};
    -	
    -
    -	if(texture.baseTexture.hasLoaded)
    -	{
    -		this.uniforms.mapDimensions.value.x = texture.width;
    -		this.uniforms.mapDimensions.value.y = texture.height;
    -	}
    -	else
    -	{
    -		this.boundLoadedFunction = this.onTextureLoaded.bind(this);
    -
    -		texture.baseTexture.on("loaded", this.boundLoadedFunction);
    -	}
    -
    -	this.fragmentSrc = [
    -	  "precision mediump float;",
    -	  "varying vec2 vTextureCoord;",
    -	  "varying float vColor;",
    -	  "uniform sampler2D displacementMap;",
    -	  "uniform sampler2D uSampler;",
    -	 
    -	  "uniform vec4 dimensions;",
    -	  
    -		"const vec2 Resolution = vec2(1.0,1.0);",      //resolution of screen
    -		"uniform vec3 LightPos;",    //light position, normalized
    -		"const vec4 LightColor = vec4(1.0, 1.0, 1.0, 1.0);",      //light RGBA -- alpha is intensity
    -		"const vec4 AmbientColor = vec4(1.0, 1.0, 1.0, 0.5);",    //ambient RGBA -- alpha is intensity 
    -		"const vec3 Falloff = vec3(0.0, 1.0, 0.2);",         //attenuation coefficients
    -
    -		"uniform vec3 LightDir;",//" = vec3(1.0, 0.0, 1.0);",
    -
    -
    -	  "uniform vec2 mapDimensions;",// = vec2(256.0, 256.0);",
    -	 
    -
    -	  "void main(void) {",
    -	  	"vec2 mapCords = vTextureCoord.xy;",
    -
    -	  	"vec4 color = texture2D(uSampler, vTextureCoord.st);",
    -        "vec3 nColor = texture2D(displacementMap, vTextureCoord.st).rgb;",
    - 
    -
    -	  	"mapCords *= vec2(dimensions.x/512.0, dimensions.y/512.0);",
    -	  
    -	  	"mapCords.y *= -1.0;",
    -	 	"mapCords.y += 1.0;",
    -
    -	 	//RGBA of our diffuse color
    -		"vec4 DiffuseColor = texture2D(uSampler, vTextureCoord);",
    -
    -		//RGB of our normal map
    -		"vec3 NormalMap = texture2D(displacementMap, mapCords).rgb;",
    -
    -		//The delta position of light
    -		//"vec3 LightDir = vec3(LightPos.xy - (gl_FragCoord.xy / Resolution.xy), LightPos.z);",
    -		"vec3 LightDir = vec3(LightPos.xy - (mapCords.xy), LightPos.z);",
    -		//Correct for aspect ratio
    -		//"LightDir.x *= Resolution.x / Resolution.y;",
    -
    -		//Determine distance (used for attenuation) BEFORE we normalize our LightDir
    -		"float D = length(LightDir);",
    -
    -		//normalize our vectors
    -		"vec3 N = normalize(NormalMap * 2.0 - 1.0);",
    -		"vec3 L = normalize(LightDir);",
    -
    -		//Pre-multiply light color with intensity
    -		//Then perform "N dot L" to determine our diffuse term
    -		"vec3 Diffuse = (LightColor.rgb * LightColor.a) * max(dot(N, L), 0.0);",
    -
    -		//pre-multiply ambient color with intensity
    -		"vec3 Ambient = AmbientColor.rgb * AmbientColor.a;",
    -
    -		//calculate attenuation
    -		"float Attenuation = 1.0 / ( Falloff.x + (Falloff.y*D) + (Falloff.z*D*D) );",
    -
    -		//the calculation which brings it all together
    -		"vec3 Intensity = Ambient + Diffuse * Attenuation;",
    -		"vec3 FinalColor = DiffuseColor.rgb * Intensity;",
    -		"gl_FragColor = vColor * vec4(FinalColor, DiffuseColor.a);",
    -		//"gl_FragColor = vec4(1.0, 0.0, 0.0, Attenuation);",//vColor * vec4(FinalColor, DiffuseColor.a);",
    -	/*
    -	 	// normalise color
    -	 	"vec3 normal = normalize(nColor * 2.0 - 1.0);",
    -	 	
    -	 	"vec3 deltaPos = vec3( (light.xy - gl_FragCoord.xy) / resolution.xy, light.z );",
    -
    -	 	"float lambert = clamp(dot(normal, lightDir), 0.0, 1.0);",
    -
    -	 	"float d = sqrt(dot(deltaPos, deltaPos));", 
    -        "float att = 1.0 / ( attenuation.x + (attenuation.y*d) + (attenuation.z*d*d) );",
    -
    -        "vec3 result = (ambientColor * ambientIntensity) + (lightColor.rgb * lambert) * att;",
    -        "result *= color.rgb;",
    -       
    -        "gl_FragColor = vec4(result, 1.0);",*/
    -
    -	  	
    -
    -	  "}"
    -	];
    -	
    -}
    -
    -PIXI.NormalMapFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.NormalMapFilter.prototype.constructor = PIXI.NormalMapFilter;
    -
    -/**
    - * Sets the map dimensions uniforms when the texture becomes available.
    - *
    - * @method onTextureLoaded
    - */
    -PIXI.NormalMapFilter.prototype.onTextureLoaded = function()
    -{
    -	this.uniforms.mapDimensions.value.x = this.uniforms.displacementMap.value.width;
    -	this.uniforms.mapDimensions.value.y = this.uniforms.displacementMap.value.height;
    -
    -	this.uniforms.displacementMap.value.baseTexture.off("loaded", this.boundLoadedFunction)
    -};
    -
    -/**
    - * The texture used for the displacement map. Must be power of 2 texture.
    - *
    - * @property map
    - * @type Texture
    - */
    -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'map', {
    -    get: function() {
    -        return this.uniforms.displacementMap.value;
    -    },
    -    set: function(value) {
    -    	this.uniforms.displacementMap.value = value;
    -    }
    -});
    -
    -/**
    - * The multiplier used to scale the displacement result from the map calculation.
    - *
    - * @property scale
    - * @type Point
    - */
    -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'scale', {
    -    get: function() {
    -        return this.uniforms.scale.value;
    -    },
    -    set: function(value) {
    -    	this.uniforms.scale.value = value;
    -    }
    -});
    -
    -/**
    - * The offset used to move the displacement map.
    - *
    - * @property offset
    - * @type Point
    - */
    -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'offset', {
    -    get: function() {
    -        return this.uniforms.offset.value;
    -    },
    -    set: function(value) {
    -    	this.uniforms.offset.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_PixelateFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_PixelateFilter.js.html deleted file mode 100755 index 3413e27..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_PixelateFilter.js.html +++ /dev/null @@ -1,340 +0,0 @@ - - - - - src/pixi/filters/PixelateFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/PixelateFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This filter applies a pixelate effect making display objects appear 'blocky'.
    - * 
    - * @class PixelateFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.PixelateFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        invert: {type: '1f', value: 0},
    -        dimensions: {type: '4fv', value:new PIXI.Float32Array([10000, 100, 10, 10])},
    -        pixelSize: {type: '2f', value:{x:10, y:10}}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform vec2 testDim;',
    -        'uniform vec4 dimensions;',
    -        'uniform vec2 pixelSize;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   vec2 coord = vTextureCoord;',
    -
    -        '   vec2 size = dimensions.xy/pixelSize;',
    -
    -        '   vec2 color = floor( ( vTextureCoord * size ) ) / size + pixelSize/dimensions.xy * 0.5;',
    -        '   gl_FragColor = texture2D(uSampler, color);',
    -        '}'
    -    ];
    -};
    -
    -PIXI.PixelateFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.PixelateFilter.prototype.constructor = PIXI.PixelateFilter;
    -
    -/**
    - * This a point that describes the size of the blocks. x is the width of the block and y is the height.
    - * 
    - * @property size
    - * @type Point
    - */
    -Object.defineProperty(PIXI.PixelateFilter.prototype, 'size', {
    -    get: function() {
    -        return this.uniforms.pixelSize.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.pixelSize.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_RGBSplitFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_RGBSplitFilter.js.html deleted file mode 100755 index dca385c..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_RGBSplitFilter.js.html +++ /dev/null @@ -1,369 +0,0 @@ - - - - - src/pixi/filters/RGBSplitFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/RGBSplitFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * An RGB Split Filter.
    - * 
    - * @class RGBSplitFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.RGBSplitFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        red: {type: '2f', value: {x:20, y:20}},
    -        green: {type: '2f', value: {x:-20, y:20}},
    -        blue: {type: '2f', value: {x:20, y:-20}},
    -        dimensions:   {type: '4fv', value:[0,0,0,0]}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform vec2 red;',
    -        'uniform vec2 green;',
    -        'uniform vec2 blue;',
    -        'uniform vec4 dimensions;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/dimensions.xy).r;',
    -        '   gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/dimensions.xy).g;',
    -        '   gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/dimensions.xy).b;',
    -        '   gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.RGBSplitFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.RGBSplitFilter.prototype.constructor = PIXI.RGBSplitFilter;
    -
    -/**
    - * Red channel offset.
    - * 
    - * @property red
    - * @type Point
    - */
    -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'red', {
    -    get: function() {
    -        return this.uniforms.red.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.red.value = value;
    -    }
    -});
    -
    -/**
    - * Green channel offset.
    - * 
    - * @property green
    - * @type Point
    - */
    -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'green', {
    -    get: function() {
    -        return this.uniforms.green.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.green.value = value;
    -    }
    -});
    -
    -/**
    - * Blue offset.
    - * 
    - * @property blue
    - * @type Point
    - */
    -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'blue', {
    -    get: function() {
    -        return this.uniforms.blue.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.blue.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_SepiaFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_SepiaFilter.js.html deleted file mode 100755 index aa41b56..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_SepiaFilter.js.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - src/pixi/filters/SepiaFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/SepiaFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This applies a sepia effect to your Display Objects.
    - * 
    - * @class SepiaFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.SepiaFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        sepia: {type: '1f', value: 1}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float sepia;',
    -        'uniform sampler2D uSampler;',
    -
    -        'const mat3 sepiaMatrix = mat3(0.3588, 0.7044, 0.1368, 0.2990, 0.5870, 0.1140, 0.2392, 0.4696, 0.0912);',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord);',
    -        '   gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb * sepiaMatrix, sepia);',
    -       // '   gl_FragColor = gl_FragColor * vColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.SepiaFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.SepiaFilter.prototype.constructor = PIXI.SepiaFilter;
    -
    -/**
    - * The strength of the sepia. 1 will apply the full sepia effect, 0 will make the object its normal color.
    - * @property sepia
    - * @type Number
    -*/
    -Object.defineProperty(PIXI.SepiaFilter.prototype, 'sepia', {
    -    get: function() {
    -        return this.uniforms.sepia.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.sepia.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_SmartBlurFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_SmartBlurFilter.js.html deleted file mode 100755 index d879bbe..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_SmartBlurFilter.js.html +++ /dev/null @@ -1,353 +0,0 @@ - - - - - src/pixi/filters/SmartBlurFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/SmartBlurFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A Smart Blur Filter.
    - * 
    - * @class SmartBlurFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.SmartBlurFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 1/512}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'uniform sampler2D uSampler;',
    -        //'uniform vec2 delta;',
    -        'const vec2 delta = vec2(1.0/10.0, 0.0);',
    -        //'uniform float darkness;',
    -
    -        'float random(vec3 scale, float seed) {',
    -        '   return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);',
    -        '}',
    -
    -
    -        'void main(void) {',
    -        '   vec4 color = vec4(0.0);',
    -        '   float total = 0.0;',
    -
    -        '   float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);',
    -
    -        '   for (float t = -30.0; t <= 30.0; t++) {',
    -        '       float percent = (t + offset - 0.5) / 30.0;',
    -        '       float weight = 1.0 - abs(percent);',
    -        '       vec4 sample = texture2D(uSampler, vTextureCoord + delta * percent);',
    -        '       sample.rgb *= sample.a;',
    -        '       color += sample * weight;',
    -        '       total += weight;',
    -        '   }',
    -
    -        '   gl_FragColor = color / total;',
    -        '   gl_FragColor.rgb /= gl_FragColor.a + 0.00001;',
    -        //'   gl_FragColor.rgb *= darkness;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.SmartBlurFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.SmartBlurFilter.prototype.constructor = PIXI.SmartBlurFilter;
    -
    -/**
    - * The strength of the blur.
    - *
    - * @property blur
    - * @type Number the strength of the blur
    - * @default 2
    - */
    -Object.defineProperty(PIXI.SmartBlurFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.blur.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_TiltShiftFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_TiltShiftFilter.js.html deleted file mode 100755 index d42187b..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_TiltShiftFilter.js.html +++ /dev/null @@ -1,360 +0,0 @@ - - - - - src/pixi/filters/TiltShiftFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/TiltShiftFilter.js

    - -
    -
    -/**
    - * @author Vico @vicocotea
    - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/
    - */
    -
    -/**
    - * A TiltShift Filter. Manages the pass of both a TiltShiftXFilter and TiltShiftYFilter.
    - * 
    - * @class TiltShiftFilter
    - * @constructor
    - */
    -PIXI.TiltShiftFilter = function()
    -{
    -    this.tiltShiftXFilter = new PIXI.TiltShiftXFilter();
    -    this.tiltShiftYFilter = new PIXI.TiltShiftYFilter();
    -    this.tiltShiftXFilter.updateDelta();
    -    this.tiltShiftXFilter.updateDelta();
    -
    -    this.passes = [this.tiltShiftXFilter, this.tiltShiftYFilter];
    -};
    -
    -PIXI.TiltShiftFilter.prototype.constructor = PIXI.TiltShiftFilter;
    -
    -/**
    - * The strength of the blur.
    - *
    - * @property blur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.tiltShiftXFilter.blur;
    -    },
    -    set: function(value) {
    -        this.tiltShiftXFilter.blur = this.tiltShiftYFilter.blur = value;
    -    }
    -});
    -
    -/**
    - * The strength of the gradient blur.
    - *
    - * @property gradientBlur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'gradientBlur', {
    -    get: function() {
    -        return this.tiltShiftXFilter.gradientBlur;
    -    },
    -    set: function(value) {
    -        this.tiltShiftXFilter.gradientBlur = this.tiltShiftYFilter.gradientBlur = value;
    -    }
    -});
    -
    -/**
    - * The Y value to start the effect at.
    - *
    - * @property start
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'start', {
    -    get: function() {
    -        return this.tiltShiftXFilter.start;
    -    },
    -    set: function(value) {
    -        this.tiltShiftXFilter.start = this.tiltShiftYFilter.start = value;
    -    }
    -});
    -
    -/**
    - * The Y value to end the effect at.
    - *
    - * @property end
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'end', {
    -    get: function() {
    -        return this.tiltShiftXFilter.end;
    -    },
    -    set: function(value) {
    -        this.tiltShiftXFilter.end = this.tiltShiftYFilter.end = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_TiltShiftXFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_TiltShiftXFilter.js.html deleted file mode 100755 index bdd0ee0..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_TiltShiftXFilter.js.html +++ /dev/null @@ -1,427 +0,0 @@ - - - - - src/pixi/filters/TiltShiftXFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/TiltShiftXFilter.js

    - -
    -
    -/**
    - * @author Vico @vicocotea
    - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/
    - */
    -
    -/**
    - * A TiltShiftXFilter.
    - * 
    - * @class TiltShiftXFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.TiltShiftXFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 100.0},
    -        gradientBlur: {type: '1f', value: 600.0},
    -        start: {type: '2f', value:{x:0, y:window.screenHeight / 2}},
    -        end: {type: '2f', value:{x:600, y:window.screenHeight / 2}},
    -        delta: {type: '2f', value:{x:30, y:30}},
    -        texSize: {type: '2f', value:{x:window.screenWidth, y:window.screenHeight}}
    -    };
    -
    -    this.updateDelta();
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'uniform sampler2D uSampler;',
    -        'uniform float blur;',
    -        'uniform float gradientBlur;',
    -        'uniform vec2 start;',
    -        'uniform vec2 end;',
    -        'uniform vec2 delta;',
    -        'uniform vec2 texSize;',
    -        'varying vec2 vTextureCoord;',
    -
    -        'float random(vec3 scale, float seed) {',
    -        '   return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);',
    -        '}',
    -
    -        'void main(void) {',
    -        '    vec4 color = vec4(0.0);',
    -        '    float total = 0.0;',
    -        
    -        '    float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);',
    -        '    vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));',
    -        '    float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;',
    -        
    -        '    for (float t = -30.0; t <= 30.0; t++) {',
    -        '        float percent = (t + offset - 0.5) / 30.0;',
    -        '        float weight = 1.0 - abs(percent);',
    -        '        vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);',
    -        '        sample.rgb *= sample.a;',
    -        '        color += sample * weight;',
    -        '        total += weight;',
    -        '    }',
    -
    -        '    gl_FragColor = color / total;',
    -        '    gl_FragColor.rgb /= gl_FragColor.a + 0.00001;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.TiltShiftXFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.TiltShiftXFilter.prototype.constructor = PIXI.TiltShiftXFilter;
    -
    -/**
    - * The strength of the blur.
    - *
    - * @property blur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.blur.value = value;
    -    }
    -});
    -
    -/**
    - * The strength of the gradient blur.
    - *
    - * @property gradientBlur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'gradientBlur', {
    -    get: function() {
    -        return this.uniforms.gradientBlur.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.gradientBlur.value = value;
    -    }
    -});
    -
    -/**
    - * The X value to start the effect at.
    - *
    - * @property start
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'start', {
    -    get: function() {
    -        return this.uniforms.start.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.start.value = value;
    -        this.updateDelta();
    -    }
    -});
    -
    -/**
    - * The X value to end the effect at.
    - *
    - * @property end
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'end', {
    -    get: function() {
    -        return this.uniforms.end.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.end.value = value;
    -        this.updateDelta();
    -    }
    -});
    -
    -/**
    - * Updates the filter delta values.
    - *
    - * @method updateDelta
    - */
    -PIXI.TiltShiftXFilter.prototype.updateDelta = function(){
    -    var dx = this.uniforms.end.value.x - this.uniforms.start.value.x;
    -    var dy = this.uniforms.end.value.y - this.uniforms.start.value.y;
    -    var d = Math.sqrt(dx * dx + dy * dy);
    -    this.uniforms.delta.value.x = dx / d;
    -    this.uniforms.delta.value.y = dy / d;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_TiltShiftYFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_TiltShiftYFilter.js.html deleted file mode 100755 index d99d3d8..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_TiltShiftYFilter.js.html +++ /dev/null @@ -1,427 +0,0 @@ - - - - - src/pixi/filters/TiltShiftYFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/TiltShiftYFilter.js

    - -
    -
    -/**
    - * @author Vico @vicocotea
    - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/
    - */
    -
    -/**
    - * A TiltShiftYFilter.
    - * 
    - * @class TiltShiftYFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.TiltShiftYFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 100.0},
    -        gradientBlur: {type: '1f', value: 600.0},
    -        start: {type: '2f', value:{x:0, y:window.screenHeight / 2}},
    -        end: {type: '2f', value:{x:600, y:window.screenHeight / 2}},
    -        delta: {type: '2f', value:{x:30, y:30}},
    -        texSize: {type: '2f', value:{x:window.screenWidth, y:window.screenHeight}}
    -    };
    -    
    -    this.updateDelta();
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'uniform sampler2D uSampler;',
    -        'uniform float blur;',
    -        'uniform float gradientBlur;',
    -        'uniform vec2 start;',
    -        'uniform vec2 end;',
    -        'uniform vec2 delta;',
    -        'uniform vec2 texSize;',
    -        'varying vec2 vTextureCoord;',
    -
    -        'float random(vec3 scale, float seed) {',
    -        '   return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);',
    -        '}',
    -
    -        'void main(void) {',
    -        '    vec4 color = vec4(0.0);',
    -        '    float total = 0.0;',
    -        
    -        '    float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);',
    -        '    vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));',
    -        '    float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;',
    -        
    -        '    for (float t = -30.0; t <= 30.0; t++) {',
    -        '        float percent = (t + offset - 0.5) / 30.0;',
    -        '        float weight = 1.0 - abs(percent);',
    -        '        vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);',
    -        '        sample.rgb *= sample.a;',
    -        '        color += sample * weight;',
    -        '        total += weight;',
    -        '    }',
    -
    -        '    gl_FragColor = color / total;',
    -        '    gl_FragColor.rgb /= gl_FragColor.a + 0.00001;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.TiltShiftYFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.TiltShiftYFilter.prototype.constructor = PIXI.TiltShiftYFilter;
    -
    -/**
    - * The strength of the blur.
    - *
    - * @property blur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.blur.value = value;
    -    }
    -});
    -
    -/**
    - * The strength of the gradient blur.
    - *
    - * @property gradientBlur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'gradientBlur', {
    -    get: function() {
    -        return this.uniforms.gradientBlur.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.gradientBlur.value = value;
    -    }
    -});
    -
    -/**
    - * The Y value to start the effect at.
    - *
    - * @property start
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'start', {
    -    get: function() {
    -        return this.uniforms.start.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.start.value = value;
    -        this.updateDelta();
    -    }
    -});
    -
    -/**
    - * The Y value to end the effect at.
    - *
    - * @property end
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'end', {
    -    get: function() {
    -        return this.uniforms.end.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.end.value = value;
    -        this.updateDelta();
    -    }
    -});
    -
    -/**
    - * Updates the filter delta values.
    - *
    - * @method updateDelta
    - */
    -PIXI.TiltShiftYFilter.prototype.updateDelta = function(){
    -    var dx = this.uniforms.end.value.x - this.uniforms.start.value.x;
    -    var dy = this.uniforms.end.value.y - this.uniforms.start.value.y;
    -    var d = Math.sqrt(dx * dx + dy * dy);
    -    this.uniforms.delta.value.x = -dy / d;
    -    this.uniforms.delta.value.y = dx / d;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_TwistFilter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_TwistFilter.js.html deleted file mode 100755 index 97e8f4f..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_filters_TwistFilter.js.html +++ /dev/null @@ -1,380 +0,0 @@ - - - - - src/pixi/filters/TwistFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/TwistFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This filter applies a twist effect making display objects appear twisted in the given direction.
    - * 
    - * @class TwistFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.TwistFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        radius: {type: '1f', value:0.5},
    -        angle: {type: '1f', value:5},
    -        offset: {type: '2f', value:{x:0.5, y:0.5}}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform vec4 dimensions;',
    -        'uniform sampler2D uSampler;',
    -
    -        'uniform float radius;',
    -        'uniform float angle;',
    -        'uniform vec2 offset;',
    -
    -        'void main(void) {',
    -        '   vec2 coord = vTextureCoord - offset;',
    -        '   float distance = length(coord);',
    -
    -        '   if (distance < radius) {',
    -        '       float ratio = (radius - distance) / radius;',
    -        '       float angleMod = ratio * ratio * angle;',
    -        '       float s = sin(angleMod);',
    -        '       float c = cos(angleMod);',
    -        '       coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);',
    -        '   }',
    -
    -        '   gl_FragColor = texture2D(uSampler, coord+offset);',
    -        '}'
    -    ];
    -};
    -
    -PIXI.TwistFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.TwistFilter.prototype.constructor = PIXI.TwistFilter;
    -
    -/**
    - * This point describes the the offset of the twist.
    - * 
    - * @property offset
    - * @type Point
    - */
    -Object.defineProperty(PIXI.TwistFilter.prototype, 'offset', {
    -    get: function() {
    -        return this.uniforms.offset.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.offset.value = value;
    -    }
    -});
    -
    -/**
    - * This radius of the twist.
    - * 
    - * @property radius
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TwistFilter.prototype, 'radius', {
    -    get: function() {
    -        return this.uniforms.radius.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.radius.value = value;
    -    }
    -});
    -
    -/**
    - * This angle of the twist.
    - * 
    - * @property angle
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TwistFilter.prototype, 'angle', {
    -    get: function() {
    -        return this.uniforms.angle.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.angle.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_geom_Circle.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_geom_Circle.js.html deleted file mode 100755 index 8c0c076..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_geom_Circle.js.html +++ /dev/null @@ -1,362 +0,0 @@ - - - - - src/pixi/geom/Circle.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Circle.js

    - -
    -
    -/**
    - * @author Chad Engler <chad@pantherdev.com>
    - */
    -
    -/**
    - * The Circle object can be used to specify a hit area for displayObjects
    - *
    - * @class Circle
    - * @constructor
    - * @param x {Number} The X coordinate of the center of this circle
    - * @param y {Number} The Y coordinate of the center of this circle
    - * @param radius {Number} The radius of the circle
    - */
    -PIXI.Circle = function(x, y, radius)
    -{
    -    /**
    -     * @property x
    -     * @type Number
    -     * @default 0
    -     */
    -    this.x = x || 0;
    -
    -    /**
    -     * @property y
    -     * @type Number
    -     * @default 0
    -     */
    -    this.y = y || 0;
    -
    -    /**
    -     * @property radius
    -     * @type Number
    -     * @default 0
    -     */
    -    this.radius = radius || 0;
    -};
    -
    -/**
    - * Creates a clone of this Circle instance
    - *
    - * @method clone
    - * @return {Circle} a copy of the Circle
    - */
    -PIXI.Circle.prototype.clone = function()
    -{
    -    return new PIXI.Circle(this.x, this.y, this.radius);
    -};
    -
    -/**
    - * Checks whether the x and y coordinates given are contained within this circle
    - *
    - * @method contains
    - * @param x {Number} The X coordinate of the point to test
    - * @param y {Number} The Y coordinate of the point to test
    - * @return {Boolean} Whether the x/y coordinates are within this Circle
    - */
    -PIXI.Circle.prototype.contains = function(x, y)
    -{
    -    if(this.radius <= 0)
    -        return false;
    -
    -    var dx = (this.x - x),
    -        dy = (this.y - y),
    -        r2 = this.radius * this.radius;
    -
    -    dx *= dx;
    -    dy *= dy;
    -
    -    return (dx + dy <= r2);
    -};
    -
    -/**
    -* Returns the framing rectangle of the circle as a PIXI.Rectangle object
    -*
    -* @method getBounds
    -* @return {Rectangle} the framing rectangle
    -*/
    -PIXI.Circle.prototype.getBounds = function()
    -{
    -    return new PIXI.Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2);
    -};
    -
    -// constructor
    -PIXI.Circle.prototype.constructor = PIXI.Circle;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_geom_Ellipse.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_geom_Ellipse.js.html deleted file mode 100755 index f4ebbfb..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_geom_Ellipse.js.html +++ /dev/null @@ -1,370 +0,0 @@ - - - - - src/pixi/geom/Ellipse.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Ellipse.js

    - -
    -
    -/**
    - * @author Chad Engler <chad@pantherdev.com>
    - */
    -
    -/**
    - * The Ellipse object can be used to specify a hit area for displayObjects
    - *
    - * @class Ellipse
    - * @constructor
    - * @param x {Number} The X coordinate of the center of the ellipse
    - * @param y {Number} The Y coordinate of the center of the ellipse
    - * @param width {Number} The half width of this ellipse
    - * @param height {Number} The half height of this ellipse
    - */
    -PIXI.Ellipse = function(x, y, width, height)
    -{
    -    /**
    -     * @property x
    -     * @type Number
    -     * @default 0
    -     */
    -    this.x = x || 0;
    -
    -    /**
    -     * @property y
    -     * @type Number
    -     * @default 0
    -     */
    -    this.y = y || 0;
    -
    -    /**
    -     * @property width
    -     * @type Number
    -     * @default 0
    -     */
    -    this.width = width || 0;
    -
    -    /**
    -     * @property height
    -     * @type Number
    -     * @default 0
    -     */
    -    this.height = height || 0;
    -};
    -
    -/**
    - * Creates a clone of this Ellipse instance
    - *
    - * @method clone
    - * @return {Ellipse} a copy of the ellipse
    - */
    -PIXI.Ellipse.prototype.clone = function()
    -{
    -    return new PIXI.Ellipse(this.x, this.y, this.width, this.height);
    -};
    -
    -/**
    - * Checks whether the x and y coordinates given are contained within this ellipse
    - *
    - * @method contains
    - * @param x {Number} The X coordinate of the point to test
    - * @param y {Number} The Y coordinate of the point to test
    - * @return {Boolean} Whether the x/y coords are within this ellipse
    - */
    -PIXI.Ellipse.prototype.contains = function(x, y)
    -{
    -    if(this.width <= 0 || this.height <= 0)
    -        return false;
    -
    -    //normalize the coords to an ellipse with center 0,0
    -    var normx = ((x - this.x) / this.width),
    -        normy = ((y - this.y) / this.height);
    -
    -    normx *= normx;
    -    normy *= normy;
    -
    -    return (normx + normy <= 1);
    -};
    -
    -/**
    -* Returns the framing rectangle of the ellipse as a PIXI.Rectangle object
    -*
    -* @method getBounds
    -* @return {Rectangle} the framing rectangle
    -*/
    -PIXI.Ellipse.prototype.getBounds = function()
    -{
    -    return new PIXI.Rectangle(this.x - this.width, this.y - this.height, this.width, this.height);
    -};
    -
    -// constructor
    -PIXI.Ellipse.prototype.constructor = PIXI.Ellipse;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_geom_Matrix.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_geom_Matrix.js.html deleted file mode 100755 index f57168e..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_geom_Matrix.js.html +++ /dev/null @@ -1,546 +0,0 @@ - - - - - src/pixi/geom/Matrix.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Matrix.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The Matrix class is now an object, which makes it a lot faster, 
    - * here is a representation of it : 
    - * | a | b | tx|
    - * | c | d | ty|
    - * | 0 | 0 | 1 |
    - *
    - * @class Matrix
    - * @constructor
    - */
    -PIXI.Matrix = function()
    -{
    -    /**
    -     * @property a
    -     * @type Number
    -     * @default 1
    -     */
    -    this.a = 1;
    -
    -    /**
    -     * @property b
    -     * @type Number
    -     * @default 0
    -     */
    -    this.b = 0;
    -
    -    /**
    -     * @property c
    -     * @type Number
    -     * @default 0
    -     */
    -    this.c = 0;
    -
    -    /**
    -     * @property d
    -     * @type Number
    -     * @default 1
    -     */
    -    this.d = 1;
    -
    -    /**
    -     * @property tx
    -     * @type Number
    -     * @default 0
    -     */
    -    this.tx = 0;
    -
    -    /**
    -     * @property ty
    -     * @type Number
    -     * @default 0
    -     */
    -    this.ty = 0;
    -};
    -
    -/**
    - * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:
    - *
    - * a = array[0]
    - * b = array[1]
    - * c = array[3]
    - * d = array[4]
    - * tx = array[2]
    - * ty = array[5]
    - *
    - * @method fromArray
    - * @param array {Array} The array that the matrix will be populated from.
    - */
    -PIXI.Matrix.prototype.fromArray = function(array)
    -{
    -    this.a = array[0];
    -    this.b = array[1];
    -    this.c = array[3];
    -    this.d = array[4];
    -    this.tx = array[2];
    -    this.ty = array[5];
    -};
    -
    -/**
    - * Creates an array from the current Matrix object.
    - *
    - * @method toArray
    - * @param transpose {Boolean} Whether we need to transpose the matrix or not
    - * @return {Array} the newly created array which contains the matrix
    - */
    -PIXI.Matrix.prototype.toArray = function(transpose)
    -{
    -    if(!this.array) this.array = new PIXI.Float32Array(9);
    -    var array = this.array;
    -
    -    if(transpose)
    -    {
    -        array[0] = this.a;
    -        array[1] = this.b;
    -        array[2] = 0;
    -        array[3] = this.c;
    -        array[4] = this.d;
    -        array[5] = 0;
    -        array[6] = this.tx;
    -        array[7] = this.ty;
    -        array[8] = 1;
    -    }
    -    else
    -    {
    -        array[0] = this.a;
    -        array[1] = this.c;
    -        array[2] = this.tx;
    -        array[3] = this.b;
    -        array[4] = this.d;
    -        array[5] = this.ty;
    -        array[6] = 0;
    -        array[7] = 0;
    -        array[8] = 1;
    -    }
    -
    -    return array;
    -};
    -
    -/**
    - * Get a new position with the current transformation applied.
    - * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)
    - *
    - * @method apply
    - * @param pos {Point} The origin
    - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input)
    - * @return {Point} The new point, transformed through this matrix
    - */
    -PIXI.Matrix.prototype.apply = function(pos, newPos)
    -{
    -    newPos = newPos || new PIXI.Point();
    -
    -    newPos.x = this.a * pos.x + this.c * pos.y + this.tx;
    -    newPos.y = this.b * pos.x + this.d * pos.y + this.ty;
    -
    -    return newPos;
    -};
    -
    -/**
    - * Get a new position with the inverse of the current transformation applied.
    - * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)
    - *
    - * @method applyInverse
    - * @param pos {Point} The origin
    - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input)
    - * @return {Point} The new point, inverse-transformed through this matrix
    - */
    -PIXI.Matrix.prototype.applyInverse = function(pos, newPos)
    -{
    -    newPos = newPos || new PIXI.Point();
    -
    -    var id = 1 / (this.a * this.d + this.c * -this.b);
    -     
    -    newPos.x = this.d * id * pos.x + -this.c * id * pos.y + (this.ty * this.c - this.tx * this.d) * id;
    -    newPos.y = this.a * id * pos.y + -this.b * id * pos.x + (-this.ty * this.a + this.tx * this.b) * id;
    -
    -    return newPos;
    -};
    -
    -/**
    - * Translates the matrix on the x and y.
    - * 
    - * @method translate
    - * @param {Number} x
    - * @param {Number} y
    - * @return {Matrix} This matrix. Good for chaining method calls.
    - **/
    -PIXI.Matrix.prototype.translate = function(x, y)
    -{
    -    this.tx += x;
    -    this.ty += y;
    -    
    -    return this;
    -};
    -
    -/**
    - * Applies a scale transformation to the matrix.
    - * 
    - * @method scale
    - * @param {Number} x The amount to scale horizontally
    - * @param {Number} y The amount to scale vertically
    - * @return {Matrix} This matrix. Good for chaining method calls.
    - **/
    -PIXI.Matrix.prototype.scale = function(x, y)
    -{
    -    this.a *= x;
    -    this.d *= y;
    -    this.c *= x;
    -    this.b *= y;
    -    this.tx *= x;
    -    this.ty *= y;
    -
    -    return this;
    -};
    -
    -
    -/**
    - * Applies a rotation transformation to the matrix.
    - * @method rotate
    - * @param {Number} angle The angle in radians.
    - * @return {Matrix} This matrix. Good for chaining method calls.
    - **/
    -PIXI.Matrix.prototype.rotate = function(angle)
    -{
    -    var cos = Math.cos( angle );
    -    var sin = Math.sin( angle );
    -
    -    var a1 = this.a;
    -    var c1 = this.c;
    -    var tx1 = this.tx;
    -
    -    this.a = a1 * cos-this.b * sin;
    -    this.b = a1 * sin+this.b * cos;
    -    this.c = c1 * cos-this.d * sin;
    -    this.d = c1 * sin+this.d * cos;
    -    this.tx = tx1 * cos - this.ty * sin;
    -    this.ty = tx1 * sin + this.ty * cos;
    - 
    -    return this;
    -};
    -
    -/**
    - * Appends the given Matrix to this Matrix.
    - * 
    - * @method append
    - * @param {Matrix} matrix
    - * @return {Matrix} This matrix. Good for chaining method calls.
    - */
    -PIXI.Matrix.prototype.append = function(matrix)
    -{
    -    var a1 = this.a;
    -    var b1 = this.b;
    -    var c1 = this.c;
    -    var d1 = this.d;
    -
    -    this.a  = matrix.a * a1 + matrix.b * c1;
    -    this.b  = matrix.a * b1 + matrix.b * d1;
    -    this.c  = matrix.c * a1 + matrix.d * c1;
    -    this.d  = matrix.c * b1 + matrix.d * d1;
    -
    -    this.tx = matrix.tx * a1 + matrix.ty * c1 + this.tx;
    -    this.ty = matrix.tx * b1 + matrix.ty * d1 + this.ty;
    -    
    -    return this;
    -};
    -
    -/**
    - * Resets this Matix to an identity (default) matrix.
    - * 
    - * @method identity
    - * @return {Matrix} This matrix. Good for chaining method calls.
    - */
    -PIXI.Matrix.prototype.identity = function()
    -{
    -    this.a = 1;
    -    this.b = 0;
    -    this.c = 0;
    -    this.d = 1;
    -    this.tx = 0;
    -    this.ty = 0;
    -
    -    return this;
    -};
    -
    -PIXI.identityMatrix = new PIXI.Matrix();
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_geom_Point.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_geom_Point.js.html deleted file mode 100755 index c8dfbb2..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_geom_Point.js.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - src/pixi/geom/Point.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Point.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    - *
    - * @class Point
    - * @constructor
    - * @param x {Number} position of the point on the x axis
    - * @param y {Number} position of the point on the y axis
    - */
    -PIXI.Point = function(x, y)
    -{
    -    /**
    -     * @property x
    -     * @type Number
    -     * @default 0
    -     */
    -    this.x = x || 0;
    -
    -    /**
    -     * @property y
    -     * @type Number
    -     * @default 0
    -     */
    -    this.y = y || 0;
    -};
    -
    -/**
    - * Creates a clone of this point
    - *
    - * @method clone
    - * @return {Point} a copy of the point
    - */
    -PIXI.Point.prototype.clone = function()
    -{
    -    return new PIXI.Point(this.x, this.y);
    -};
    -
    -/**
    - * Sets the point to a new x and y position.
    - * If y is omitted, both x and y will be set to x.
    - * 
    - * @method set
    - * @param [x=0] {Number} position of the point on the x axis
    - * @param [y=0] {Number} position of the point on the y axis
    - */
    -PIXI.Point.prototype.set = function(x, y)
    -{
    -    this.x = x || 0;
    -    this.y = y || ( (y !== 0) ? this.x : 0 ) ;
    -};
    -
    -// constructor
    -PIXI.Point.prototype.constructor = PIXI.Point;
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_geom_Polygon.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_geom_Polygon.js.html deleted file mode 100755 index b0bc19f..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_geom_Polygon.js.html +++ /dev/null @@ -1,354 +0,0 @@ - - - - - src/pixi/geom/Polygon.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Polygon.js

    - -
    -
    -/**
    - * @author Adrien Brault <adrien.brault@gmail.com>
    - */
    -
    -/**
    - * @class Polygon
    - * @constructor
    - * @param points* {Array<Point>|Array<Number>|Point...|Number...} This can be an array of Points that form the polygon,
    - *      a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be
    - *      all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the
    - *      arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are
    - *      Numbers.
    - */
    -PIXI.Polygon = function(points)
    -{
    -    //if points isn't an array, use arguments as the array
    -    if(!(points instanceof Array))points = Array.prototype.slice.call(arguments);
    -
    -    //if this is a flat array of numbers, convert it to points
    -    if(points[0] instanceof PIXI.Point)
    -    {
    -        var p = [];
    -        for(var i = 0, il = points.length; i < il; i++)
    -        {
    -            p.push(points[i].x, points[i].y);
    -        }
    -
    -        points = p;
    -    }
    -
    -    this.closed = true;
    -    this.points = points;
    -};
    -
    -/**
    - * Creates a clone of this polygon
    - *
    - * @method clone
    - * @return {Polygon} a copy of the polygon
    - */
    -PIXI.Polygon.prototype.clone = function()
    -{
    -    var points = this.points.slice();
    -    return new PIXI.Polygon(points);
    -};
    -
    -/**
    - * Checks whether the x and y coordinates passed to this function are contained within this polygon
    - *
    - * @method contains
    - * @param x {Number} The X coordinate of the point to test
    - * @param y {Number} The Y coordinate of the point to test
    - * @return {Boolean} Whether the x/y coordinates are within this polygon
    - */
    -PIXI.Polygon.prototype.contains = function(x, y)
    -{
    -    var inside = false;
    -
    -    // use some raycasting to test hits
    -    // https://github.com/substack/point-in-polygon/blob/master/index.js
    -    var length = this.points.length / 2;
    -
    -    for(var i = 0, j = length - 1; i < length; j = i++)
    -    {
    -        var xi = this.points[i * 2], yi = this.points[i * 2 + 1],
    -            xj = this.points[j * 2], yj = this.points[j * 2 + 1],
    -            intersect = ((yi > y) !== (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi);
    -
    -        if(intersect) inside = !inside;
    -    }
    -
    -    return inside;
    -};
    -
    -// constructor
    -PIXI.Polygon.prototype.constructor = PIXI.Polygon;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_geom_Rectangle.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_geom_Rectangle.js.html deleted file mode 100755 index c17bec4..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_geom_Rectangle.js.html +++ /dev/null @@ -1,364 +0,0 @@ - - - - - src/pixi/geom/Rectangle.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Rectangle.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/
    - */
    -
    -/**
    - * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    - *
    - * @class Rectangle
    - * @constructor
    - * @param x {Number} The X coordinate of the upper-left corner of the rectangle
    - * @param y {Number} The Y coordinate of the upper-left corner of the rectangle
    - * @param width {Number} The overall width of this rectangle
    - * @param height {Number} The overall height of this rectangle
    - */
    -PIXI.Rectangle = function(x, y, width, height)
    -{
    -    /**
    -     * @property x
    -     * @type Number
    -     * @default 0
    -     */
    -    this.x = x || 0;
    -
    -    /**
    -     * @property y
    -     * @type Number
    -     * @default 0
    -     */
    -    this.y = y || 0;
    -
    -    /**
    -     * @property width
    -     * @type Number
    -     * @default 0
    -     */
    -    this.width = width || 0;
    -
    -    /**
    -     * @property height
    -     * @type Number
    -     * @default 0
    -     */
    -    this.height = height || 0;
    -};
    -
    -/**
    - * Creates a clone of this Rectangle
    - *
    - * @method clone
    - * @return {Rectangle} a copy of the rectangle
    - */
    -PIXI.Rectangle.prototype.clone = function()
    -{
    -    return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    -};
    -
    -/**
    - * Checks whether the x and y coordinates given are contained within this Rectangle
    - *
    - * @method contains
    - * @param x {Number} The X coordinate of the point to test
    - * @param y {Number} The Y coordinate of the point to test
    - * @return {Boolean} Whether the x/y coordinates are within this Rectangle
    - */
    -PIXI.Rectangle.prototype.contains = function(x, y)
    -{
    -    if(this.width <= 0 || this.height <= 0)
    -        return false;
    -
    -    var x1 = this.x;
    -    if(x >= x1 && x <= x1 + this.width)
    -    {
    -        var y1 = this.y;
    -
    -        if(y >= y1 && y <= y1 + this.height)
    -        {
    -            return true;
    -        }
    -    }
    -
    -    return false;
    -};
    -
    -// constructor
    -PIXI.Rectangle.prototype.constructor = PIXI.Rectangle;
    -
    -PIXI.EmptyRectangle = new PIXI.Rectangle(0,0,0,0);
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_geom_RoundedRectangle.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_geom_RoundedRectangle.js.html deleted file mode 100755 index 153da24..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_geom_RoundedRectangle.js.html +++ /dev/null @@ -1,372 +0,0 @@ - - - - - src/pixi/geom/RoundedRectangle.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/RoundedRectangle.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/
    - */
    -
    -/**
    - * the Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height.
    - *
    - * @class Rounded Rectangle
    - * @constructor
    - * @param x {Number} The X coordinate of the upper-left corner of the rounded rectangle
    - * @param y {Number} The Y coordinate of the upper-left corner of the rounded rectangle
    - * @param width {Number} The overall width of this rounded rectangle
    - * @param height {Number} The overall height of this rounded rectangle
    - * @param radius {Number} The overall radius of this corners of this rounded rectangle
    - */
    -PIXI.RoundedRectangle = function(x, y, width, height, radius)
    -{
    -    /**
    -     * @property x
    -     * @type Number
    -     * @default 0
    -     */
    -    this.x = x || 0;
    -
    -    /**
    -     * @property y
    -     * @type Number
    -     * @default 0
    -     */
    -    this.y = y || 0;
    -
    -    /**
    -     * @property width
    -     * @type Number
    -     * @default 0
    -     */
    -    this.width = width || 0;
    -
    -    /**
    -     * @property height
    -     * @type Number
    -     * @default 0
    -     */
    -    this.height = height || 0;
    -
    -    /**
    -     * @property radius
    -     * @type Number
    -     * @default 20
    -     */
    -    this.radius = radius || 20;
    -};
    -
    -/**
    - * Creates a clone of this Rounded Rectangle
    - *
    - * @method clone
    - * @return {rounded Rectangle} a copy of the rounded rectangle
    - */
    -PIXI.RoundedRectangle.prototype.clone = function()
    -{
    -    return new PIXI.RoundedRectangle(this.x, this.y, this.width, this.height, this.radius);
    -};
    -
    -/**
    - * Checks whether the x and y coordinates given are contained within this Rounded Rectangle
    - *
    - * @method contains
    - * @param x {Number} The X coordinate of the point to test
    - * @param y {Number} The Y coordinate of the point to test
    - * @return {Boolean} Whether the x/y coordinates are within this Rounded Rectangle
    - */
    -PIXI.RoundedRectangle.prototype.contains = function(x, y)
    -{
    -    if(this.width <= 0 || this.height <= 0)
    -        return false;
    -
    -    var x1 = this.x;
    -    if(x >= x1 && x <= x1 + this.width)
    -    {
    -        var y1 = this.y;
    -
    -        if(y >= y1 && y <= y1 + this.height)
    -        {
    -            return true;
    -        }
    -    }
    -
    -    return false;
    -};
    -
    -// constructor
    -PIXI.RoundedRectangle.prototype.constructor = PIXI.RoundedRectangle;
    -
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_loaders_AssetLoader.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_loaders_AssetLoader.js.html deleted file mode 100755 index 43a5333..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_loaders_AssetLoader.js.html +++ /dev/null @@ -1,438 +0,0 @@ - - - - - src/pixi/loaders/AssetLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/AssetLoader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * 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
    - * @uses EventTarget
    - * @param assetURLs {Array<String>} 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'.
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.AssetLoader = function(assetURLs, crossorigin)
    -{
    -    /**
    -     * The array of asset URLs that are going to be loaded
    -     *
    -     * @property assetURLs
    -     * @type Array<String>
    -     */
    -    this.assetURLs = assetURLs;
    -
    -    /**
    -     * Whether the requests should be treated as cross origin
    -     *
    -     * @property crossorigin
    -     * @type Boolean
    -     */
    -    this.crossorigin = crossorigin;
    -
    -    /**
    -     * Maps file extension to loader types
    -     *
    -     * @property loadersByType
    -     * @type Object
    -     */
    -    this.loadersByType = {
    -        'jpg':  PIXI.ImageLoader,
    -        'jpeg': PIXI.ImageLoader,
    -        'png':  PIXI.ImageLoader,
    -        'gif':  PIXI.ImageLoader,
    -        'webp': PIXI.ImageLoader,
    -        'json': PIXI.JsonLoader,
    -        'atlas': PIXI.AtlasLoader,
    -        'anim': PIXI.SpineLoader,
    -        'xml':  PIXI.BitmapFontLoader,
    -        'fnt':  PIXI.BitmapFontLoader
    -    };
    -};
    -
    -PIXI.EventTarget.mixin(PIXI.AssetLoader.prototype);
    -
    -/**
    - * Fired when an item has loaded
    - * @event onProgress
    - */
    -
    -/**
    - * Fired when all the assets have loaded
    - * @event onComplete
    - */
    -
    -// constructor
    -PIXI.AssetLoader.prototype.constructor = PIXI.AssetLoader;
    -
    -/**
    - * Given a filename, returns its extension.
    - *
    - * @method _getDataType
    - * @param str {String} the name of the asset
    - */
    -PIXI.AssetLoader.prototype._getDataType = function(str)
    -{
    -    var test = 'data:';
    -    //starts with 'data:'
    -    var start = str.slice(0, test.length).toLowerCase();
    -    if (start === test) {
    -        var data = str.slice(test.length);
    -
    -        var sepIdx = data.indexOf(',');
    -        if (sepIdx === -1) //malformed data URI scheme
    -            return null;
    -
    -        //e.g. 'image/gif;base64' => 'image/gif'
    -        var info = data.slice(0, sepIdx).split(';')[0];
    -
    -        //We might need to handle some special cases here...
    -        //standardize text/plain to 'txt' file extension
    -        if (!info || info.toLowerCase() === 'text/plain')
    -            return 'txt';
    -
    -        //User specified mime type, try splitting it by '/'
    -        return info.split('/').pop().toLowerCase();
    -    }
    -
    -    return null;
    -};
    -
    -/**
    - * Starts loading the assets sequentially
    - *
    - * @method load
    - */
    -PIXI.AssetLoader.prototype.load = function()
    -{
    -    var scope = this;
    -
    -    function onLoad(evt) {
    -        scope.onAssetLoaded(evt.data.content);
    -    }
    -
    -    this.loadCount = this.assetURLs.length;
    -
    -    for (var i=0; i < this.assetURLs.length; i++)
    -    {
    -        var fileName = this.assetURLs[i];
    -        //first see if we have a data URI scheme..
    -        var fileType = this._getDataType(fileName);
    -
    -        //if not, assume it's a file URI
    -        if (!fileType)
    -            fileType = fileName.split('?').shift().split('.').pop().toLowerCase();
    -
    -        var Constructor = this.loadersByType[fileType];
    -        if(!Constructor)
    -            throw new Error(fileType + ' is an unsupported file type');
    -
    -        var loader = new Constructor(fileName, this.crossorigin);
    -
    -        loader.on('loaded', onLoad);
    -        loader.load();
    -    }
    -};
    -
    -/**
    - * Invoked after each file is loaded
    - *
    - * @method onAssetLoaded
    - * @private
    - */
    -PIXI.AssetLoader.prototype.onAssetLoaded = function(loader)
    -{
    -    this.loadCount--;
    -    this.emit('onProgress', { content: this, loader: loader });
    -    if (this.onProgress) this.onProgress(loader);
    -
    -    if (!this.loadCount)
    -    {
    -        this.emit('onComplete', { content: this });
    -        if(this.onComplete) this.onComplete();
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_loaders_AtlasLoader.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_loaders_AtlasLoader.js.html deleted file mode 100755 index 13fc730..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_loaders_AtlasLoader.js.html +++ /dev/null @@ -1,468 +0,0 @@ - - - - - src/pixi/loaders/AtlasLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/AtlasLoader.js

    - -
    -
    -/**
    - * @author Martin Kelm http://mkelm.github.com
    - */
    -
    -/**
    - * The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event.
    - *
    - * To generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format.
    - * 
    - * It is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to 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.fromFrameId()
    - * 
    - * @class AtlasLoader
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the JSON file
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.AtlasLoader = function (url, crossorigin) {
    -    this.url = url;
    -    this.baseUrl = url.replace(/[^\/]*$/, '');
    -    this.crossorigin = crossorigin;
    -    this.loaded = false;
    -
    -};
    -
    -// constructor
    -PIXI.AtlasLoader.constructor = PIXI.AtlasLoader;
    -
    -PIXI.EventTarget.mixin(PIXI.AtlasLoader.prototype);
    -
    - /**
    - * Starts loading the JSON file
    - *
    - * @method load
    - */
    -PIXI.AtlasLoader.prototype.load = function () {
    -    this.ajaxRequest = new PIXI.AjaxRequest();
    -    this.ajaxRequest.onreadystatechange = this.onAtlasLoaded.bind(this);
    -
    -    this.ajaxRequest.open('GET', this.url, true);
    -    if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/json');
    -    this.ajaxRequest.send(null);
    -};
    -
    -/**
    - * Invoked when the Atlas has fully loaded. Parses the JSON and builds the texture frames.
    - * 
    - * @method onAtlasLoaded
    - * @private
    - */
    -PIXI.AtlasLoader.prototype.onAtlasLoaded = function () {
    -    if (this.ajaxRequest.readyState === 4) {
    -        if (this.ajaxRequest.status === 200 || window.location.href.indexOf('http') === -1) {
    -            this.atlas = {
    -                meta : {
    -                    image : []
    -                },
    -                frames : []
    -            };
    -            var result = this.ajaxRequest.responseText.split(/\r?\n/);
    -            var lineCount = -3;
    -
    -            var currentImageId = 0;
    -            var currentFrame = null;
    -            var nameInNextLine = false;
    -
    -            var i = 0,
    -                j = 0,
    -                selfOnLoaded = this.onLoaded.bind(this);
    -
    -            // parser without rotation support yet!
    -            for (i = 0; i < result.length; i++) {
    -                result[i] = result[i].replace(/^\s+|\s+$/g, '');
    -                if (result[i] === '') {
    -                    nameInNextLine = i+1;
    -                }
    -                if (result[i].length > 0) {
    -                    if (nameInNextLine === i) {
    -                        this.atlas.meta.image.push(result[i]);
    -                        currentImageId = this.atlas.meta.image.length - 1;
    -                        this.atlas.frames.push({});
    -                        lineCount = -3;
    -                    } else if (lineCount > 0) {
    -                        if (lineCount % 7 === 1) { // frame name
    -                            if (currentFrame != null) { //jshint ignore:line
    -                                this.atlas.frames[currentImageId][currentFrame.name] = currentFrame;
    -                            }
    -                            currentFrame = { name: result[i], frame : {} };
    -                        } else {
    -                            var text = result[i].split(' ');
    -                            if (lineCount % 7 === 3) { // position
    -                                currentFrame.frame.x = Number(text[1].replace(',', ''));
    -                                currentFrame.frame.y = Number(text[2]);
    -                            } else if (lineCount % 7 === 4) { // size
    -                                currentFrame.frame.w = Number(text[1].replace(',', ''));
    -                                currentFrame.frame.h = Number(text[2]);
    -                            } else if (lineCount % 7 === 5) { // real size
    -                                var realSize = {
    -                                    x : 0,
    -                                    y : 0,
    -                                    w : Number(text[1].replace(',', '')),
    -                                    h : Number(text[2])
    -                                };
    -
    -                                if (realSize.w > currentFrame.frame.w || realSize.h > currentFrame.frame.h) {
    -                                    currentFrame.trimmed = true;
    -                                    currentFrame.realSize = realSize;
    -                                } else {
    -                                    currentFrame.trimmed = false;
    -                                }
    -                            }
    -                        }
    -                    }
    -                    lineCount++;
    -                }
    -            }
    -
    -            if (currentFrame != null) { //jshint ignore:line
    -                this.atlas.frames[currentImageId][currentFrame.name] = currentFrame;
    -            }
    -
    -            if (this.atlas.meta.image.length > 0) {
    -                this.images = [];
    -                for (j = 0; j < this.atlas.meta.image.length; j++) {
    -                    // sprite sheet
    -                    var textureUrl = this.baseUrl + this.atlas.meta.image[j];
    -                    var frameData = this.atlas.frames[j];
    -                    this.images.push(new PIXI.ImageLoader(textureUrl, this.crossorigin));
    -
    -                    for (i in frameData) {
    -                        var rect = frameData[i].frame;
    -                        if (rect) {
    -                            PIXI.TextureCache[i] = new PIXI.Texture(this.images[j].texture.baseTexture, {
    -                                x: rect.x,
    -                                y: rect.y,
    -                                width: rect.w,
    -                                height: rect.h
    -                            });
    -                            if (frameData[i].trimmed) {
    -                                PIXI.TextureCache[i].realSize = frameData[i].realSize;
    -                                // trim in pixi not supported yet, todo update trim properties if it is done ...
    -                                PIXI.TextureCache[i].trim.x = 0;
    -                                PIXI.TextureCache[i].trim.y = 0;
    -                            }
    -                        }
    -                    }
    -                }
    -
    -                this.currentImageId = 0;
    -                for (j = 0; j < this.images.length; j++) {
    -                    this.images[j].on('loaded', selfOnLoaded);
    -                }
    -                this.images[this.currentImageId].load();
    -
    -            } else {
    -                this.onLoaded();
    -            }
    -
    -        } else {
    -            this.onError();
    -        }
    -    }
    -};
    -
    -/**
    - * Invoked when json file has loaded.
    - * 
    - * @method onLoaded
    - * @private
    - */
    -PIXI.AtlasLoader.prototype.onLoaded = function () {
    -    if (this.images.length - 1 > this.currentImageId) {
    -        this.currentImageId++;
    -        this.images[this.currentImageId].load();
    -    } else {
    -        this.loaded = true;
    -        this.emit('loaded', { content: this });
    -    }
    -};
    -
    -/**
    - * Invoked when an error occurs.
    - * 
    - * @method onError
    - * @private
    - */
    -PIXI.AtlasLoader.prototype.onError = function () {
    -    this.emit('error', { content: this });
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_loaders_BitmapFontLoader.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_loaders_BitmapFontLoader.js.html deleted file mode 100755 index 489b3b0..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_loaders_BitmapFontLoader.js.html +++ /dev/null @@ -1,439 +0,0 @@ - - - - - src/pixi/loaders/BitmapFontLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/BitmapFontLoader.js

    - -
    -
    -/**
    - * @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
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the sprite sheet JSON file
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.BitmapFontLoader = function(url, crossorigin)
    -{
    -    /**
    -     * The url of the bitmap font data
    -     *
    -     * @property url
    -     * @type String
    -     */
    -    this.url = url;
    -
    -    /**
    -     * Whether the requests should be treated as cross origin
    -     *
    -     * @property crossorigin
    -     * @type Boolean
    -     */
    -    this.crossorigin = crossorigin;
    -
    -    /**
    -     * [read-only] The base url of the bitmap font data
    -     *
    -     * @property baseUrl
    -     * @type String
    -     * @readOnly
    -     */
    -    this.baseUrl = url.replace(/[^\/]*$/, '');
    -
    -    /**
    -     * [read-only] The texture of the bitmap font
    -     *
    -     * @property texture
    -     * @type Texture
    -     */
    -    this.texture = null;
    -};
    -
    -// constructor
    -PIXI.BitmapFontLoader.prototype.constructor = PIXI.BitmapFontLoader;
    -PIXI.EventTarget.mixin(PIXI.BitmapFontLoader.prototype);
    -
    -/**
    - * Loads the XML font data
    - *
    - * @method load
    - */
    -PIXI.BitmapFontLoader.prototype.load = function()
    -{
    -    this.ajaxRequest = new PIXI.AjaxRequest();
    -    this.ajaxRequest.onreadystatechange = this.onXMLLoaded.bind(this);
    -
    -    this.ajaxRequest.open('GET', this.url, true);
    -    if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/xml');
    -    this.ajaxRequest.send(null);
    -};
    -
    -/**
    - * Invoked when the XML file is loaded, parses the data.
    - *
    - * @method onXMLLoaded
    - * @private
    - */
    -PIXI.BitmapFontLoader.prototype.onXMLLoaded = function()
    -{
    -    if (this.ajaxRequest.readyState === 4)
    -    {
    -        if (this.ajaxRequest.status === 200 || window.location.protocol.indexOf('http') === -1)
    -        {
    -            var responseXML = this.ajaxRequest.responseXML;
    -            if(!responseXML || /MSIE 9/i.test(navigator.userAgent) || navigator.isCocoonJS) {
    -                if(typeof(window.DOMParser) === 'function') {
    -                    var domparser = new DOMParser();
    -                    responseXML = domparser.parseFromString(this.ajaxRequest.responseText, 'text/xml');
    -                } else {
    -                    var div = document.createElement('div');
    -                    div.innerHTML = this.ajaxRequest.responseText;
    -                    responseXML = div;
    -                }
    -            }
    -
    -            var textureUrl = this.baseUrl + responseXML.getElementsByTagName('page')[0].getAttribute('file');
    -            var image = new PIXI.ImageLoader(textureUrl, this.crossorigin);
    -            this.texture = image.texture.baseTexture;
    -
    -            var data = {};
    -            var info = responseXML.getElementsByTagName('info')[0];
    -            var common = responseXML.getElementsByTagName('common')[0];
    -            data.font = info.getAttribute('face');
    -            data.size = parseInt(info.getAttribute('size'), 10);
    -            data.lineHeight = parseInt(common.getAttribute('lineHeight'), 10);
    -            data.chars = {};
    -
    -            //parse letters
    -            var letters = responseXML.getElementsByTagName('char');
    -
    -            for (var i = 0; i < letters.length; i++)
    -            {
    -                var charCode = parseInt(letters[i].getAttribute('id'), 10);
    -
    -                var textureRect = new PIXI.Rectangle(
    -                    parseInt(letters[i].getAttribute('x'), 10),
    -                    parseInt(letters[i].getAttribute('y'), 10),
    -                    parseInt(letters[i].getAttribute('width'), 10),
    -                    parseInt(letters[i].getAttribute('height'), 10)
    -                );
    -
    -                data.chars[charCode] = {
    -                    xOffset: parseInt(letters[i].getAttribute('xoffset'), 10),
    -                    yOffset: parseInt(letters[i].getAttribute('yoffset'), 10),
    -                    xAdvance: parseInt(letters[i].getAttribute('xadvance'), 10),
    -                    kerning: {},
    -                    texture: PIXI.TextureCache[charCode] = new PIXI.Texture(this.texture, textureRect)
    -
    -                };
    -            }
    -
    -            //parse kernings
    -            var kernings = responseXML.getElementsByTagName('kerning');
    -            for (i = 0; i < kernings.length; i++)
    -            {
    -                var first = parseInt(kernings[i].getAttribute('first'), 10);
    -                var second = parseInt(kernings[i].getAttribute('second'), 10);
    -                var amount = parseInt(kernings[i].getAttribute('amount'), 10);
    -
    -                data.chars[second].kerning[first] = amount;
    -
    -            }
    -
    -            PIXI.BitmapText.fonts[data.font] = data;
    -
    -            image.addEventListener('loaded', this.onLoaded.bind(this));
    -            image.load();
    -        }
    -    }
    -};
    -
    -/**
    - * Invoked when all files are loaded (xml/fnt and texture)
    - *
    - * @method onLoaded
    - * @private
    - */
    -PIXI.BitmapFontLoader.prototype.onLoaded = function()
    -{
    -    this.emit('loaded', { content: this });
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_loaders_ImageLoader.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_loaders_ImageLoader.js.html deleted file mode 100755 index 7ca22b2..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_loaders_ImageLoader.js.html +++ /dev/null @@ -1,380 +0,0 @@ - - - - - src/pixi/loaders/ImageLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/ImageLoader.js

    - -
    -
    -/**
    - * @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.fromFrame() and PIXI.Sprite.fromFrame()
    - * When loaded this class will dispatch a 'loaded' event
    - *
    - * @class ImageLoader
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the image
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.ImageLoader = function(url, crossorigin)
    -{
    -    /**
    -     * The texture being loaded
    -     *
    -     * @property texture
    -     * @type Texture
    -     */
    -    this.texture = PIXI.Texture.fromImage(url, crossorigin);
    -
    -    /**
    -     * if the image is loaded with loadFramedSpriteSheet
    -     * frames will contain the sprite sheet frames
    -     *
    -     * @property frames
    -     * @type Array
    -     * @readOnly
    -     */
    -    this.frames = [];
    -};
    -
    -// constructor
    -PIXI.ImageLoader.prototype.constructor = PIXI.ImageLoader;
    -
    -PIXI.EventTarget.mixin(PIXI.ImageLoader.prototype);
    -
    -/**
    - * Loads image or takes it from cache
    - *
    - * @method load
    - */
    -PIXI.ImageLoader.prototype.load = function()
    -{
    -    if(!this.texture.baseTexture.hasLoaded)
    -    {
    -        this.texture.baseTexture.on('loaded', this.onLoaded.bind(this));
    -    }
    -    else
    -    {
    -        this.onLoaded();
    -    }
    -};
    -
    -/**
    - * Invoked when image file is loaded or it is already cached and ready to use
    - *
    - * @method onLoaded
    - * @private
    - */
    -PIXI.ImageLoader.prototype.onLoaded = function()
    -{
    -    this.emit('loaded', { content: this });
    -};
    -
    -/**
    - * Loads image and split it to uniform sized frames
    - *
    - * @method loadFramedSpriteSheet
    - * @param frameWidth {Number} width of each frame
    - * @param frameHeight {Number} height of each frame
    - * @param textureName {String} if given, the frames will be cached in <textureName>-<ord> format
    - */
    -PIXI.ImageLoader.prototype.loadFramedSpriteSheet = function(frameWidth, frameHeight, textureName)
    -{
    -    this.frames = [];
    -    var cols = Math.floor(this.texture.width / frameWidth);
    -    var rows = Math.floor(this.texture.height / frameHeight);
    -
    -    var i=0;
    -    for (var y=0; y<rows; y++)
    -    {
    -        for (var x=0; x<cols; x++,i++)
    -        {
    -            var texture = new PIXI.Texture(this.texture.baseTexture, {
    -                x: x*frameWidth,
    -                y: y*frameHeight,
    -                width: frameWidth,
    -                height: frameHeight
    -            });
    -
    -            this.frames.push(texture);
    -            if (textureName) PIXI.TextureCache[textureName + '-' + i] = texture;
    -        }
    -    }
    -
    -	this.load();
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_loaders_JsonLoader.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_loaders_JsonLoader.js.html deleted file mode 100755 index 0aeaff7..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_loaders_JsonLoader.js.html +++ /dev/null @@ -1,466 +0,0 @@ - - - - - src/pixi/loaders/JsonLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/JsonLoader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The json file loader is used to load in JSON data and parse it
    - * When loaded this class will dispatch a 'loaded' event
    - * If loading fails this class will dispatch an 'error' event
    - *
    - * @class JsonLoader
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the JSON file
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.JsonLoader = function (url, crossorigin) {
    -
    -    /**
    -     * The url of the bitmap font data
    -     *
    -     * @property url
    -     * @type String
    -     */
    -    this.url = url;
    -
    -    /**
    -     * Whether the requests should be treated as cross origin
    -     *
    -     * @property crossorigin
    -     * @type Boolean
    -     */
    -    this.crossorigin = crossorigin;
    -
    -    /**
    -     * [read-only] The base url of the bitmap font data
    -     *
    -     * @property baseUrl
    -     * @type String
    -     * @readOnly
    -     */
    -    this.baseUrl = url.replace(/[^\/]*$/, '');
    -
    -    /**
    -     * [read-only] Whether the data has loaded yet
    -     *
    -     * @property loaded
    -     * @type Boolean
    -     * @readOnly
    -     */
    -    this.loaded = false;
    -
    -};
    -
    -// constructor
    -PIXI.JsonLoader.prototype.constructor = PIXI.JsonLoader;
    -
    -PIXI.EventTarget.mixin(PIXI.JsonLoader.prototype);
    -
    -/**
    - * Loads the JSON data
    - *
    - * @method load
    - */
    -PIXI.JsonLoader.prototype.load = function () {
    -
    -    if(window.XDomainRequest && this.crossorigin)
    -    {
    -        this.ajaxRequest = new window.XDomainRequest();
    -
    -        // XDomainRequest has a few quirks. Occasionally it will abort requests
    -        // A way to avoid this is to make sure ALL callbacks are set even if not used
    -        // More info here: http://stackoverflow.com/questions/15786966/xdomainrequest-aborts-post-on-ie-9
    -        this.ajaxRequest.timeout = 3000;
    -
    -        this.ajaxRequest.onerror = this.onError.bind(this);
    -
    -        this.ajaxRequest.ontimeout = this.onError.bind(this);
    -
    -        this.ajaxRequest.onprogress = function() {};
    -
    -    }
    -    else if (window.XMLHttpRequest)
    -    {
    -        this.ajaxRequest = new window.XMLHttpRequest();
    -    }
    -    else
    -    {
    -        this.ajaxRequest = new window.ActiveXObject('Microsoft.XMLHTTP');
    -    }
    -
    -    this.ajaxRequest.onload = this.onJSONLoaded.bind(this);
    -
    -    this.ajaxRequest.open('GET',this.url,true);
    -
    -    this.ajaxRequest.send();
    -};
    -
    -/**
    - * Invoked when the JSON file is loaded.
    - *
    - * @method onJSONLoaded
    - * @private
    - */
    -PIXI.JsonLoader.prototype.onJSONLoaded = function () {
    -
    -    if(!this.ajaxRequest.responseText )
    -    {
    -        this.onError();
    -        return;
    -    }
    -
    -    this.json = JSON.parse(this.ajaxRequest.responseText);
    -
    -    if(this.json.frames)
    -    {
    -        // sprite sheet
    -        var textureUrl = this.baseUrl + this.json.meta.image;
    -        var image = new PIXI.ImageLoader(textureUrl, this.crossorigin);
    -        var frameData = this.json.frames;
    -
    -        this.texture = image.texture.baseTexture;
    -        image.addEventListener('loaded', this.onLoaded.bind(this));
    -
    -        for (var i in frameData)
    -        {
    -            var rect = frameData[i].frame;
    -
    -            if (rect)
    -            {
    -                var textureSize = new PIXI.Rectangle(rect.x, rect.y, rect.w, rect.h);
    -                var crop = textureSize.clone();
    -                var trim = null;
    -                
    -                //  Check to see if the sprite is trimmed
    -                if (frameData[i].trimmed)
    -                {
    -                    var actualSize = frameData[i].sourceSize;
    -                    var realSize = frameData[i].spriteSourceSize;
    -                    trim = new PIXI.Rectangle(realSize.x, realSize.y, actualSize.w, actualSize.h);
    -                }
    -                PIXI.TextureCache[i] = new PIXI.Texture(this.texture, textureSize, crop, trim);
    -            }
    -        }
    -
    -        image.load();
    -
    -    }
    -    else if(this.json.bones)
    -    {
    -        // spine animation
    -        var spineJsonParser = new spine.SkeletonJson();
    -        var skeletonData = spineJsonParser.readSkeletonData(this.json);
    -        PIXI.AnimCache[this.url] = skeletonData;
    -        this.onLoaded();
    -    }
    -    else
    -    {
    -        this.onLoaded();
    -    }
    -};
    -
    -/**
    - * Invoked when the json file has loaded.
    - *
    - * @method onLoaded
    - * @private
    - */
    -PIXI.JsonLoader.prototype.onLoaded = function () {
    -    this.loaded = true;
    -    this.dispatchEvent({
    -        type: 'loaded',
    -        content: this
    -    });
    -};
    -
    -/**
    - * Invoked if an error occurs.
    - *
    - * @method onError
    - * @private
    - */
    -PIXI.JsonLoader.prototype.onError = function () {
    -
    -    this.dispatchEvent({
    -        type: 'error',
    -        content: this
    -    });
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_loaders_SpineLoader.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_loaders_SpineLoader.js.html deleted file mode 100755 index d56935e..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_loaders_SpineLoader.js.html +++ /dev/null @@ -1,359 +0,0 @@ - - - - - src/pixi/loaders/SpineLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/SpineLoader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * based on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi
    - *
    - * Awesome JS run time provided by EsotericSoftware
    - * https://github.com/EsotericSoftware/spine-runtimes
    - *
    - */
    -
    -/**
    - * The Spine loader is used to load in JSON spine data
    - * To generate the data you need to use http://esotericsoftware.com/ and export in the "JSON" format
    - * Due to a clash of names  You will need to change the extension of the spine file from *.json to *.anim for it to load
    - * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source
    - * You will need to generate a sprite sheet to accompany the spine data
    - * When loaded this class will dispatch a "loaded" event
    - *
    - * @class SpineLoader
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the JSON file
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.SpineLoader = function(url, crossorigin)
    -{
    -    /**
    -     * The url of the bitmap font data
    -     *
    -     * @property url
    -     * @type String
    -     */
    -    this.url = url;
    -
    -    /**
    -     * Whether the requests should be treated as cross origin
    -     *
    -     * @property crossorigin
    -     * @type Boolean
    -     */
    -    this.crossorigin = crossorigin;
    -
    -    /**
    -     * [read-only] Whether the data has loaded yet
    -     *
    -     * @property loaded
    -     * @type Boolean
    -     * @readOnly
    -     */
    -    this.loaded = false;
    -};
    -
    -PIXI.SpineLoader.prototype.constructor = PIXI.SpineLoader;
    -
    -PIXI.EventTarget.mixin(PIXI.SpineLoader.prototype);
    -
    -/**
    - * Loads the JSON data
    - *
    - * @method load
    - */
    -PIXI.SpineLoader.prototype.load = function () {
    -
    -    var scope = this;
    -    var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin);
    -    jsonLoader.on('loaded', function (event) {
    -        scope.json = event.data.content.json;
    -        scope.onLoaded();
    -    });
    -    jsonLoader.load();
    -};
    -
    -/**
    - * Invoked when JSON file is loaded.
    - *
    - * @method onLoaded
    - * @private
    - */
    -PIXI.SpineLoader.prototype.onLoaded = function () {
    -    this.loaded = true;
    -    this.emit('loaded', { content: this });
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_loaders_SpriteSheetLoader.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_loaders_SpriteSheetLoader.js.html deleted file mode 100755 index 60e57df..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_loaders_SpriteSheetLoader.js.html +++ /dev/null @@ -1,372 +0,0 @@ - - - - - src/pixi/loaders/SpriteSheetLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/SpriteSheetLoader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * 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 in 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 a 'texture atlas') as it means sprites 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.fromFrameId()
    - * This loader will load the image file that the Spritesheet points to as well as the data.
    - * When loaded this class will dispatch a 'loaded' event
    - *
    - * @class SpriteSheetLoader
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the sprite sheet JSON file
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.SpriteSheetLoader = function (url, crossorigin) {
    -
    -    /**
    -     * The url of the atlas data
    -     *
    -     * @property url
    -     * @type String
    -     */
    -    this.url = url;
    -
    -    /**
    -     * Whether the requests should be treated as cross origin
    -     *
    -     * @property crossorigin
    -     * @type Boolean
    -     */
    -    this.crossorigin = crossorigin;
    -
    -    /**
    -     * [read-only] The base url of the bitmap font data
    -     *
    -     * @property baseUrl
    -     * @type String
    -     * @readOnly
    -     */
    -    this.baseUrl = url.replace(/[^\/]*$/, '');
    -
    -    /**
    -     * The texture being loaded
    -     *
    -     * @property texture
    -     * @type Texture
    -     */
    -    this.texture = null;
    -
    -    /**
    -     * The frames of the sprite sheet
    -     *
    -     * @property frames
    -     * @type Object
    -     */
    -    this.frames = {};
    -};
    -
    -// constructor
    -PIXI.SpriteSheetLoader.prototype.constructor = PIXI.SpriteSheetLoader;
    -
    -PIXI.EventTarget.mixin(PIXI.SpriteSheetLoader.prototype);
    -
    -/**
    - * This will begin loading the JSON file
    - *
    - * @method load
    - */
    -PIXI.SpriteSheetLoader.prototype.load = function () {
    -    var scope = this;
    -    var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin);
    -    jsonLoader.on('loaded', function (event) {
    -        scope.json = event.data.content.json;
    -        scope.onLoaded();
    -    });
    -    jsonLoader.load();
    -};
    -
    -/**
    - * Invoke when all files are loaded (json and texture)
    - *
    - * @method onLoaded
    - * @private
    - */
    -PIXI.SpriteSheetLoader.prototype.onLoaded = function () {
    -    this.emit('loaded', {
    -        content: this
    -    });
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_primitives_Graphics.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_primitives_Graphics.js.html deleted file mode 100755 index 4161dd1..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_primitives_Graphics.js.html +++ /dev/null @@ -1,1403 +0,0 @@ - - - - - src/pixi/primitives/Graphics.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/primitives/Graphics.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and color and fill them.
    - * 
    - * @class Graphics
    - * @extends DisplayObjectContainer
    - * @constructor
    - */
    -PIXI.Graphics = function()
    -{
    -    PIXI.DisplayObjectContainer.call( this );
    -
    -    this.renderable = true;
    -
    -    /**
    -     * The alpha value used when filling the Graphics object.
    -     *
    -     * @property fillAlpha
    -     * @type Number
    -     */
    -    this.fillAlpha = 1;
    -
    -    /**
    -     * The width (thickness) of any lines drawn.
    -     *
    -     * @property lineWidth
    -     * @type Number
    -     */
    -    this.lineWidth = 0;
    -
    -    /**
    -     * The color of any lines drawn.
    -     *
    -     * @property lineColor
    -     * @type String
    -     * @default 0
    -     */
    -    this.lineColor = 0;
    -
    -    /**
    -     * Graphics data
    -     *
    -     * @property graphicsData
    -     * @type Array
    -     * @private
    -     */
    -    this.graphicsData = [];
    -
    -    /**
    -     * The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint.
    -     *
    -     * @property tint
    -     * @type Number
    -     * @default 0xFFFFFF
    -     */
    -    this.tint = 0xFFFFFF;
    -    
    -    /**
    -     * The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode.
    -     *
    -     * @property blendMode
    -     * @type Number
    -     * @default PIXI.blendModes.NORMAL;
    -     */
    -    this.blendMode = PIXI.blendModes.NORMAL;
    -    
    -    /**
    -     * Current path
    -     *
    -     * @property currentPath
    -     * @type Object
    -     * @private
    -     */
    -    this.currentPath = null;
    -    
    -    /**
    -     * Array containing some WebGL-related properties used by the WebGL renderer.
    -     *
    -     * @property _webGL
    -     * @type Array
    -     * @private
    -     */
    -    this._webGL = [];
    -
    -    /**
    -     * Whether this shape is being used as a mask.
    -     *
    -     * @property isMask
    -     * @type Boolean
    -     */
    -    this.isMask = false;
    -
    -    /**
    -     * The bounds' padding used for bounds calculation.
    -     *
    -     * @property boundsPadding
    -     * @type Number
    -     */
    -    this.boundsPadding = 0;
    -
    -    this._localBounds = new PIXI.Rectangle(0,0,1,1);
    -
    -    /**
    -     * Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated.
    -     * 
    -     * @property dirty
    -     * @type Boolean
    -     * @private
    -     */
    -    this.dirty = true;
    -
    -    /**
    -     * Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated.
    -     * 
    -     * @property webGLDirty
    -     * @type Boolean
    -     * @private
    -     */
    -    this.webGLDirty = false;
    -
    -    /**
    -     * Used to detect if the cached sprite object needs to be updated.
    -     * 
    -     * @property cachedSpriteDirty
    -     * @type Boolean
    -     * @private
    -     */
    -    this.cachedSpriteDirty = false;
    -
    -};
    -
    -// constructor
    -PIXI.Graphics.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    -PIXI.Graphics.prototype.constructor = PIXI.Graphics;
    -
    -/**
    - * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite.
    - * This is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory.
    - * It is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas.
    - * This is not recommended if you are constantly redrawing the graphics element.
    - *
    - * @property cacheAsBitmap
    - * @type Boolean
    - * @default false
    - * @private
    - */
    -Object.defineProperty(PIXI.Graphics.prototype, "cacheAsBitmap", {
    -    get: function() {
    -        return  this._cacheAsBitmap;
    -    },
    -    set: function(value) {
    -        this._cacheAsBitmap = value;
    -
    -        if(this._cacheAsBitmap)
    -        {
    -
    -            this._generateCachedSprite();
    -        }
    -        else
    -        {
    -            this.destroyCachedSprite();
    -            this.dirty = true;
    -        }
    -
    -    }
    -});
    -
    -/**
    - * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.
    - *
    - * @method lineStyle
    - * @param lineWidth {Number} width of the line to draw, will update the objects stored style
    - * @param color {Number} color of the line to draw, will update the objects stored style
    - * @param alpha {Number} alpha of the line to draw, will update the objects stored style
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha)
    -{
    -    this.lineWidth = lineWidth || 0;
    -    this.lineColor = color || 0;
    -    this.lineAlpha = (arguments.length < 3) ? 1 : alpha;
    -
    -    if(this.currentPath)
    -    {
    -        if(this.currentPath.shape.points.length)
    -        {
    -            // halfway through a line? start a new one!
    -            this.drawShape( new PIXI.Polygon( this.currentPath.shape.points.slice(-2) ));
    -            return this;
    -        }
    -
    -        // otherwise its empty so lets just set the line properties
    -        this.currentPath.lineWidth = this.lineWidth;
    -        this.currentPath.lineColor = this.lineColor;
    -        this.currentPath.lineAlpha = this.lineAlpha;
    -        
    -    }
    -
    -    return this;
    -};
    -
    -/**
    - * Moves the current drawing position to x, y.
    - *
    - * @method moveTo
    - * @param x {Number} the X coordinate to move to
    - * @param y {Number} the Y coordinate to move to
    - * @return {Graphics}
    -  */
    -PIXI.Graphics.prototype.moveTo = function(x, y)
    -{
    -    this.drawShape(new PIXI.Polygon([x,y]));
    -
    -    return this;
    -};
    -
    -/**
    - * Draws a line using the current line style from the current drawing position to (x, y);
    - * The current drawing position is then set to (x, y).
    - *
    - * @method lineTo
    - * @param x {Number} the X coordinate to draw to
    - * @param y {Number} the Y coordinate to draw to
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.lineTo = function(x, y)
    -{
    -    this.currentPath.shape.points.push(x, y);
    -    this.dirty = true;
    -
    -    return this;
    -};
    -
    -/**
    - * Calculate the points for a quadratic bezier curve and then draws it.
    - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c
    - *
    - * @method quadraticCurveTo
    - * @param cpX {Number} Control point x
    - * @param cpY {Number} Control point y
    - * @param toX {Number} Destination point x
    - * @param toY {Number} Destination point y
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.quadraticCurveTo = function(cpX, cpY, toX, toY)
    -{
    -    if( this.currentPath )
    -    {
    -        if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0];
    -    }
    -    else
    -    {
    -        this.moveTo(0,0);
    -    }
    -
    -    var xa,
    -    ya,
    -    n = 20,
    -    points = this.currentPath.shape.points;
    -    if(points.length === 0)this.moveTo(0, 0);
    -    
    -
    -    var fromX = points[points.length-2];
    -    var fromY = points[points.length-1];
    -
    -    var j = 0;
    -    for (var i = 1; i <= n; i++ )
    -    {
    -        j = i / n;
    -
    -        xa = fromX + ( (cpX - fromX) * j );
    -        ya = fromY + ( (cpY - fromY) * j );
    -
    -        points.push( xa + ( ((cpX + ( (toX - cpX) * j )) - xa) * j ),
    -                     ya + ( ((cpY + ( (toY - cpY) * j )) - ya) * j ) );
    -    }
    -
    -
    -    this.dirty = true;
    -
    -    return this;
    -};
    -
    -/**
    - * Calculate the points for a bezier curve and then draws it.
    - *
    - * @method bezierCurveTo
    - * @param cpX {Number} Control point x
    - * @param cpY {Number} Control point y
    - * @param cpX2 {Number} Second Control point x
    - * @param cpY2 {Number} Second Control point y
    - * @param toX {Number} Destination point x
    - * @param toY {Number} Destination point y
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.bezierCurveTo = function(cpX, cpY, cpX2, cpY2, toX, toY)
    -{
    -    if( this.currentPath )
    -    {
    -        if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0];
    -    }
    -    else
    -    {
    -        this.moveTo(0,0);
    -    }
    -
    -    var n = 20,
    -    dt,
    -    dt2,
    -    dt3,
    -    t2,
    -    t3,
    -    points = this.currentPath.shape.points;
    -
    -    var fromX = points[points.length-2];
    -    var fromY = points[points.length-1];
    -    
    -    var j = 0;
    -
    -    for (var i=1; i<=n; i++)
    -    {
    -        j = i / n;
    -
    -        dt = (1 - j);
    -        dt2 = dt * dt;
    -        dt3 = dt2 * dt;
    -
    -        t2 = j * j;
    -        t3 = t2 * j;
    -        
    -        points.push( dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX,
    -                     dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY);
    -    }
    -    
    -    this.dirty = true;
    -
    -    return this;
    -};
    -
    -/*
    - * The arcTo() method creates an arc/curve between two tangents on the canvas.
    - * 
    - * "borrowed" from https://code.google.com/p/fxcanvas/ - thanks google!
    - *
    - * @method arcTo
    - * @param x1 {Number} The x-coordinate of the beginning of the arc
    - * @param y1 {Number} The y-coordinate of the beginning of the arc
    - * @param x2 {Number} The x-coordinate of the end of the arc
    - * @param y2 {Number} The y-coordinate of the end of the arc
    - * @param radius {Number} The radius of the arc
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.arcTo = function(x1, y1, x2, y2, radius)
    -{
    -    if( this.currentPath )
    -    {
    -        if(this.currentPath.shape.points.length === 0)
    -        {
    -            this.currentPath.shape.points.push(x1, y1);
    -        }
    -    }
    -    else
    -    {
    -        this.moveTo(x1, y1);
    -    }
    -
    -    var points = this.currentPath.shape.points;
    -    var fromX = points[points.length-2];
    -    var fromY = points[points.length-1];
    -    var a1 = fromY - y1;
    -    var b1 = fromX - x1;
    -    var a2 = y2   - y1;
    -    var b2 = x2   - x1;
    -    var mm = Math.abs(a1 * b2 - b1 * a2);
    -
    -
    -    if (mm < 1.0e-8 || radius === 0)
    -    {
    -        if( points[points.length-2] !== x1 || points[points.length-1] !== y1)
    -        {
    -            //console.log(">>")
    -            points.push(x1, y1);
    -        }
    -    }
    -    else
    -    {
    -        var dd = a1 * a1 + b1 * b1;
    -        var cc = a2 * a2 + b2 * b2;
    -        var tt = a1 * a2 + b1 * b2;
    -        var k1 = radius * Math.sqrt(dd) / mm;
    -        var k2 = radius * Math.sqrt(cc) / mm;
    -        var j1 = k1 * tt / dd;
    -        var j2 = k2 * tt / cc;
    -        var cx = k1 * b2 + k2 * b1;
    -        var cy = k1 * a2 + k2 * a1;
    -        var px = b1 * (k2 + j1);
    -        var py = a1 * (k2 + j1);
    -        var qx = b2 * (k1 + j2);
    -        var qy = a2 * (k1 + j2);
    -        var startAngle = Math.atan2(py - cy, px - cx);
    -        var endAngle   = Math.atan2(qy - cy, qx - cx);
    -
    -        this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1);
    -    }
    -
    -    this.dirty = true;
    -
    -    return this;
    -};
    -
    -/**
    - * The arc method creates an arc/curve (used to create circles, or parts of circles).
    - *
    - * @method arc
    - * @param cx {Number} The x-coordinate of the center of the circle
    - * @param cy {Number} The y-coordinate of the center of the circle
    - * @param radius {Number} The radius of the circle
    - * @param startAngle {Number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle)
    - * @param endAngle {Number} The ending angle, in radians
    - * @param anticlockwise {Boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise.
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise)
    -{
    -    var startX = cx + Math.cos(startAngle) * radius;
    -    var startY = cy + Math.sin(startAngle) * radius;
    -   
    -    var points = this.currentPath.shape.points;
    -
    -    if(points.length === 0)
    -    {
    -        this.moveTo(startX, startY);
    -        points = this.currentPath.shape.points;
    -    }
    -    else if( points[points.length-2] !== startX || points[points.length-1] !== startY)
    -    {
    -        points.push(startX, startY);
    -    }
    -  
    -    if (startAngle === endAngle)return this;
    -
    -    if( !anticlockwise && endAngle <= startAngle )
    -    {
    -        endAngle += Math.PI * 2;
    -    }
    -    else if( anticlockwise && startAngle <= endAngle )
    -    {
    -        startAngle += Math.PI * 2;
    -    }
    -
    -    var sweep = anticlockwise ? (startAngle - endAngle) *-1 : (endAngle - startAngle);
    -    var segs =  ( Math.abs(sweep)/ (Math.PI * 2) ) * 40;
    -
    -    if( sweep === 0 ) return this;
    -
    -    var theta = sweep/(segs*2);
    -    var theta2 = theta*2;
    -
    -    var cTheta = Math.cos(theta);
    -    var sTheta = Math.sin(theta);
    -    
    -    var segMinus = segs - 1;
    -
    -    var remainder = ( segMinus % 1 ) / segMinus;
    -
    -    for(var i=0; i<=segMinus; i++)
    -    {
    -        var real =  i + remainder * i;
    -
    -    
    -        var angle = ((theta) + startAngle + (theta2 * real));
    -
    -        var c = Math.cos(angle);
    -        var s = -Math.sin(angle);
    -
    -        points.push(( (cTheta *  c) + (sTheta * s) ) * radius + cx,
    -                    ( (cTheta * -s) + (sTheta * c) ) * radius + cy);
    -    }
    -
    -    this.dirty = true;
    -
    -    return this;
    -};
    -
    -/**
    - * Specifies a simple one-color fill that subsequent calls to other Graphics methods
    - * (such as lineTo() or drawCircle()) use when drawing.
    - *
    - * @method beginFill
    - * @param color {Number} the color of the fill
    - * @param alpha {Number} the alpha of the fill
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.beginFill = function(color, alpha)
    -{
    -    this.filling = true;
    -    this.fillColor = color || 0;
    -    this.fillAlpha = (alpha === undefined) ? 1 : alpha;
    -
    -    if(this.currentPath)
    -    {
    -        if(this.currentPath.shape.points.length <= 2)
    -        {
    -            this.currentPath.fill = this.filling;
    -            this.currentPath.fillColor = this.fillColor;
    -            this.currentPath.fillAlpha = this.fillAlpha;
    -        }
    -    }
    -    return this;
    -};
    -
    -/**
    - * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.
    - *
    - * @method endFill
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.endFill = function()
    -{
    -    this.filling = false;
    -    this.fillColor = null;
    -    this.fillAlpha = 1;
    -
    -    return this;
    -};
    -
    -/**
    - * @method drawRect
    - *
    - * @param x {Number} The X coord of the top-left of the rectangle
    - * @param y {Number} The Y coord of the top-left of the rectangle
    - * @param width {Number} The width of the rectangle
    - * @param height {Number} The height of the rectangle
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.drawRect = function( x, y, width, height )
    -{
    -    this.drawShape(new PIXI.Rectangle(x,y, width, height));
    -
    -    return this;
    -};
    -
    -/**
    - * @method drawRoundedRect
    - *
    - * @param x {Number} The X coord of the top-left of the rectangle
    - * @param y {Number} The Y coord of the top-left of the rectangle
    - * @param width {Number} The width of the rectangle
    - * @param height {Number} The height of the rectangle
    - * @param radius {Number} Radius of the rectangle corners
    - */
    -PIXI.Graphics.prototype.drawRoundedRect = function( x, y, width, height, radius )
    -{
    -    this.drawShape(new PIXI.RoundedRectangle(x, y, width, height, radius));
    -
    -    return this;
    -};
    -
    -/**
    - * Draws a circle.
    - *
    - * @method drawCircle
    - * @param x {Number} The X coordinate of the center of the circle
    - * @param y {Number} The Y coordinate of the center of the circle
    - * @param radius {Number} The radius of the circle
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.drawCircle = function(x, y, radius)
    -{
    -    this.drawShape(new PIXI.Circle(x,y, radius));
    -
    -    return this;
    -};
    -
    -/**
    - * Draws an ellipse.
    - *
    - * @method drawEllipse
    - * @param x {Number} The X coordinate of the center of the ellipse
    - * @param y {Number} The Y coordinate of the center of the ellipse
    - * @param width {Number} The half width of the ellipse
    - * @param height {Number} The half height of the ellipse
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.drawEllipse = function(x, y, width, height)
    -{
    -    this.drawShape(new PIXI.Ellipse(x, y, width, height));
    -
    -    return this;
    -};
    -
    -/**
    - * Draws a polygon using the given path.
    - *
    - * @method drawPolygon
    - * @param path {Array} The path data used to construct the polygon.
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.drawPolygon = function(path)
    -{
    -    if(!(path instanceof Array))path = Array.prototype.slice.call(arguments);
    -    this.drawShape(new PIXI.Polygon(path));
    -    return this;
    -};
    -
    -/**
    - * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.
    - *
    - * @method clear
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.clear = function()
    -{
    -    this.lineWidth = 0;
    -    this.filling = false;
    -
    -    this.dirty = true;
    -    this.clearDirty = true;
    -    this.graphicsData = [];
    -
    -    return this;
    -};
    -
    -/**
    - * Useful function that returns a texture of the graphics object that can then be used to create sprites
    - * This can be quite useful if your geometry is complicated and needs to be reused multiple times.
    - *
    - * @method generateTexture
    - * @param resolution {Number} The resolution of the texture being generated
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @return {Texture} a texture of the graphics object
    - */
    -PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode)
    -{
    -    resolution = resolution || 1;
    -
    -    var bounds = this.getBounds();
    -   
    -    var canvasBuffer = new PIXI.CanvasBuffer(bounds.width * resolution, bounds.height * resolution);
    -    
    -    var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas, scaleMode);
    -    texture.baseTexture.resolution = resolution;
    -
    -    canvasBuffer.context.scale(resolution, resolution);
    -
    -    canvasBuffer.context.translate(-bounds.x,-bounds.y);
    -    
    -    PIXI.CanvasGraphics.renderGraphics(this, canvasBuffer.context);
    -
    -    return texture;
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.Graphics.prototype._renderWebGL = function(renderSession)
    -{
    -    // if the sprite is not visible or the alpha is 0 then no need to render this element
    -    if(this.visible === false || this.alpha === 0 || this.isMask === true)return;
    -
    -    if(this._cacheAsBitmap)
    -    {
    -
    -        if(this.dirty || this.cachedSpriteDirty)
    -        {
    -
    -            this._generateCachedSprite();
    -   
    -            // we will also need to update the texture on the gpu too!
    -            this.updateCachedSpriteTexture();
    -
    -            this.cachedSpriteDirty = false;
    -            this.dirty = false;
    -        }
    -
    -        this._cachedSprite.worldAlpha = this.worldAlpha;
    -        PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession);
    -
    -        return;
    -    }
    -    else
    -    {
    -        renderSession.spriteBatch.stop();
    -        renderSession.blendModeManager.setBlendMode(this.blendMode);
    -
    -        if(this._mask)renderSession.maskManager.pushMask(this._mask, renderSession);
    -        if(this._filters)renderSession.filterManager.pushFilter(this._filterBlock);
    -      
    -        // check blend mode
    -        if(this.blendMode !== renderSession.spriteBatch.currentBlendMode)
    -        {
    -            renderSession.spriteBatch.currentBlendMode = this.blendMode;
    -            var blendModeWebGL = PIXI.blendModesWebGL[renderSession.spriteBatch.currentBlendMode];
    -            renderSession.spriteBatch.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]);
    -        }
    -        
    -        // check if the webgl graphic needs to be updated
    -        if(this.webGLDirty)
    -        {
    -            this.dirty = true;
    -            this.webGLDirty = false;
    -        }
    -        
    -        PIXI.WebGLGraphics.renderGraphics(this, renderSession);
    -        
    -        // only render if it has children!
    -        if(this.children.length)
    -        {
    -            renderSession.spriteBatch.start();
    -
    -             // simple render children!
    -            for(var i=0, j=this.children.length; i<j; i++)
    -            {
    -                this.children[i]._renderWebGL(renderSession);
    -            }
    -
    -            renderSession.spriteBatch.stop();
    -        }
    -
    -        if(this._filters)renderSession.filterManager.popFilter();
    -        if(this._mask)renderSession.maskManager.popMask(this.mask, renderSession);
    -          
    -        renderSession.drawCount++;
    -
    -        renderSession.spriteBatch.start();
    -    }
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.Graphics.prototype._renderCanvas = function(renderSession)
    -{
    -    // if the sprite is not visible or the alpha is 0 then no need to render this element
    -    if(this.visible === false || this.alpha === 0 || this.isMask === true)return;
    -    
    -    if(this._cacheAsBitmap)
    -    {
    -        if(this.dirty || this.cachedSpriteDirty)
    -        {
    -            this._generateCachedSprite();
    -   
    -            // we will also need to update the texture
    -            this.updateCachedSpriteTexture();
    -
    -            this.cachedSpriteDirty = false;
    -            this.dirty = false;
    -        }
    -
    -        this._cachedSprite.alpha = this.alpha;
    -        PIXI.Sprite.prototype._renderCanvas.call(this._cachedSprite, renderSession);
    -
    -        return;
    -    }
    -    else
    -    {
    -        var context = renderSession.context;
    -        var transform = this.worldTransform;
    -        
    -        if(this.blendMode !== renderSession.currentBlendMode)
    -        {
    -            renderSession.currentBlendMode = this.blendMode;
    -            context.globalCompositeOperation = PIXI.blendModesCanvas[renderSession.currentBlendMode];
    -        }
    -
    -        if(this._mask)
    -        {
    -            renderSession.maskManager.pushMask(this._mask, renderSession);
    -        }
    -
    -        var resolution = renderSession.resolution;
    -        context.setTransform(transform.a * resolution,
    -                             transform.b * resolution,
    -                             transform.c * resolution,
    -                             transform.d * resolution,
    -                             transform.tx * resolution,
    -                             transform.ty * resolution);
    -
    -        PIXI.CanvasGraphics.renderGraphics(this, context);
    -
    -         // simple render children!
    -        for(var i=0, j=this.children.length; i<j; i++)
    -        {
    -            this.children[i]._renderCanvas(renderSession);
    -        }
    -
    -        if(this._mask)
    -        {
    -            renderSession.maskManager.popMask(renderSession);
    -        }
    -    }
    -};
    -
    -/**
    - * Retrieves the bounds of the graphic shape as a rectangle object
    - *
    - * @method getBounds
    - * @return {Rectangle} the rectangular bounding area
    - */
    -PIXI.Graphics.prototype.getBounds = function( matrix )
    -{
    -    // return an empty object if the item is a mask!
    -    if(this.isMask)return PIXI.EmptyRectangle;
    -
    -    if(this.dirty)
    -    {
    -        this.updateLocalBounds();
    -        this.webGLDirty = true;
    -        this.cachedSpriteDirty = true;
    -        this.dirty = false;
    -    }
    -
    -    var bounds = this._localBounds;
    -
    -    var w0 = bounds.x;
    -    var w1 = bounds.width + bounds.x;
    -
    -    var h0 = bounds.y;
    -    var h1 = bounds.height + bounds.y;
    -
    -    var worldTransform = matrix || this.worldTransform;
    -
    -    var a = worldTransform.a;
    -    var b = worldTransform.b;
    -    var c = worldTransform.c;
    -    var d = worldTransform.d;
    -    var tx = worldTransform.tx;
    -    var ty = worldTransform.ty;
    -
    -    var x1 = a * w1 + c * h1 + tx;
    -    var y1 = d * h1 + b * w1 + ty;
    -
    -    var x2 = a * w0 + c * h1 + tx;
    -    var y2 = d * h1 + b * w0 + ty;
    -
    -    var x3 = a * w0 + c * h0 + tx;
    -    var y3 = d * h0 + b * w0 + ty;
    -
    -    var x4 =  a * w1 + c * h0 + tx;
    -    var y4 =  d * h0 + b * w1 + ty;
    -
    -    var maxX = x1;
    -    var maxY = y1;
    -
    -    var minX = x1;
    -    var minY = y1;
    -
    -    minX = x2 < minX ? x2 : minX;
    -    minX = x3 < minX ? x3 : minX;
    -    minX = x4 < minX ? x4 : minX;
    -
    -    minY = y2 < minY ? y2 : minY;
    -    minY = y3 < minY ? y3 : minY;
    -    minY = y4 < minY ? y4 : minY;
    -
    -    maxX = x2 > maxX ? x2 : maxX;
    -    maxX = x3 > maxX ? x3 : maxX;
    -    maxX = x4 > maxX ? x4 : maxX;
    -
    -    maxY = y2 > maxY ? y2 : maxY;
    -    maxY = y3 > maxY ? y3 : maxY;
    -    maxY = y4 > maxY ? y4 : maxY;
    -
    -    this._bounds.x = minX;
    -    this._bounds.width = maxX - minX;
    -
    -    this._bounds.y = minY;
    -    this._bounds.height = maxY - minY;
    -
    -    return  this._bounds;
    -};
    -
    -/**
    - * Update the bounds of the object
    - *
    - * @method updateLocalBounds
    - */
    -PIXI.Graphics.prototype.updateLocalBounds = function()
    -{
    -    var minX = Infinity;
    -    var maxX = -Infinity;
    -
    -    var minY = Infinity;
    -    var maxY = -Infinity;
    -
    -    if(this.graphicsData.length)
    -    {
    -        var shape, points, x, y, w, h;
    -
    -        for (var i = 0; i < this.graphicsData.length; i++) {
    -            var data = this.graphicsData[i];
    -            var type = data.type;
    -            var lineWidth = data.lineWidth;
    -            shape = data.shape;
    -           
    -
    -            if(type === PIXI.Graphics.RECT || type === PIXI.Graphics.RREC)
    -            {
    -                x = shape.x - lineWidth/2;
    -                y = shape.y - lineWidth/2;
    -                w = shape.width + lineWidth;
    -                h = shape.height + lineWidth;
    -
    -                minX = x < minX ? x : minX;
    -                maxX = x + w > maxX ? x + w : maxX;
    -
    -                minY = y < minY ? y : minY;
    -                maxY = y + h > maxY ? y + h : maxY;
    -            }
    -            else if(type === PIXI.Graphics.CIRC)
    -            {
    -                x = shape.x;
    -                y = shape.y;
    -                w = shape.radius + lineWidth/2;
    -                h = shape.radius + lineWidth/2;
    -
    -                minX = x - w < minX ? x - w : minX;
    -                maxX = x + w > maxX ? x + w : maxX;
    -
    -                minY = y - h < minY ? y - h : minY;
    -                maxY = y + h > maxY ? y + h : maxY;
    -            }
    -            else if(type === PIXI.Graphics.ELIP)
    -            {
    -                x = shape.x;
    -                y = shape.y;
    -                w = shape.width + lineWidth/2;
    -                h = shape.height + lineWidth/2;
    -
    -                minX = x - w < minX ? x - w : minX;
    -                maxX = x + w > maxX ? x + w : maxX;
    -
    -                minY = y - h < minY ? y - h : minY;
    -                maxY = y + h > maxY ? y + h : maxY;
    -            }
    -            else
    -            {
    -                // POLY
    -                points = shape.points;
    -                
    -                for (var j = 0; j < points.length; j+=2)
    -                {
    -
    -                    x = points[j];
    -                    y = points[j+1];
    -                    minX = x-lineWidth < minX ? x-lineWidth : minX;
    -                    maxX = x+lineWidth > maxX ? x+lineWidth : maxX;
    -
    -                    minY = y-lineWidth < minY ? y-lineWidth : minY;
    -                    maxY = y+lineWidth > maxY ? y+lineWidth : maxY;
    -                }
    -            }
    -        }
    -    }
    -    else
    -    {
    -        minX = 0;
    -        maxX = 0;
    -        minY = 0;
    -        maxY = 0;
    -    }
    -
    -    var padding = this.boundsPadding;
    -    
    -    this._localBounds.x = minX - padding;
    -    this._localBounds.width = (maxX - minX) + padding * 2;
    -
    -    this._localBounds.y = minY - padding;
    -    this._localBounds.height = (maxY - minY) + padding * 2;
    -};
    -
    -/**
    - * Generates the cached sprite when the sprite has cacheAsBitmap = true
    - *
    - * @method _generateCachedSprite
    - * @private
    - */
    -PIXI.Graphics.prototype._generateCachedSprite = function()
    -{
    -    var bounds = this.getLocalBounds();
    -
    -    if(!this._cachedSprite)
    -    {
    -        var canvasBuffer = new PIXI.CanvasBuffer(bounds.width, bounds.height);
    -        var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas);
    -        
    -        this._cachedSprite = new PIXI.Sprite(texture);
    -        this._cachedSprite.buffer = canvasBuffer;
    -
    -        this._cachedSprite.worldTransform = this.worldTransform;
    -    }
    -    else
    -    {
    -        this._cachedSprite.buffer.resize(bounds.width, bounds.height);
    -    }
    -
    -    // leverage the anchor to account for the offset of the element
    -    this._cachedSprite.anchor.x = -( bounds.x / bounds.width );
    -    this._cachedSprite.anchor.y = -( bounds.y / bounds.height );
    -
    -   // this._cachedSprite.buffer.context.save();
    -    this._cachedSprite.buffer.context.translate(-bounds.x,-bounds.y);
    -    
    -    // make sure we set the alpha of the graphics to 1 for the render.. 
    -    this.worldAlpha = 1;
    -
    -    // now render the graphic..
    -    PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context);
    -    this._cachedSprite.alpha = this.alpha;
    -};
    -
    -/**
    - * Updates texture size based on canvas size
    - *
    - * @method updateCachedSpriteTexture
    - * @private
    - */
    -PIXI.Graphics.prototype.updateCachedSpriteTexture = function()
    -{
    -    var cachedSprite = this._cachedSprite;
    -    var texture = cachedSprite.texture;
    -    var canvas = cachedSprite.buffer.canvas;
    -
    -    texture.baseTexture.width = canvas.width;
    -    texture.baseTexture.height = canvas.height;
    -    texture.crop.width = texture.frame.width = canvas.width;
    -    texture.crop.height = texture.frame.height = canvas.height;
    -
    -    cachedSprite._width = canvas.width;
    -    cachedSprite._height = canvas.height;
    -
    -    // update the dirty base textures
    -    texture.baseTexture.dirty();
    -};
    -
    -/**
    - * Destroys a previous cached sprite.
    - *
    - * @method destroyCachedSprite
    - */
    -PIXI.Graphics.prototype.destroyCachedSprite = function()
    -{
    -    this._cachedSprite.texture.destroy(true);
    -
    -    // let the gc collect the unused sprite
    -    // TODO could be object pooled!
    -    this._cachedSprite = null;
    -};
    -
    -/**
    - * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.
    - *
    - * @method drawShape
    - * @param {Circle|Rectangle|Ellipse|Line|Polygon} shape The Shape object to draw.
    - * @return {GraphicsData} The generated GraphicsData object.
    - */
    -PIXI.Graphics.prototype.drawShape = function(shape)
    -{
    -    if(this.currentPath)
    -    {
    -        // check current path!
    -        if(this.currentPath.shape.points.length <= 2)this.graphicsData.pop();
    -    }
    -
    -    this.currentPath = null;
    -
    -    var data = new PIXI.GraphicsData(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, shape);
    -    
    -    this.graphicsData.push(data);
    -    
    -    if(data.type === PIXI.Graphics.POLY)
    -    {
    -        data.shape.closed = this.filling;
    -        this.currentPath = data;
    -    }
    -
    -    this.dirty = true;
    -
    -    return data;
    -};
    -
    -/**
    - * A GraphicsData object.
    - * 
    - * @class GraphicsData
    - * @constructor
    - */
    -PIXI.GraphicsData = function(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, shape)
    -{
    -    this.lineWidth = lineWidth;
    -    this.lineColor = lineColor;
    -    this.lineAlpha = lineAlpha;
    -
    -    this.fillColor = fillColor;
    -    this.fillAlpha = fillAlpha;
    -    this.fill = fill;
    -
    -    this.shape = shape;
    -    this.type = shape.type;
    -};
    -
    -// SOME TYPES:
    -PIXI.Graphics.POLY = 0;
    -PIXI.Graphics.RECT = 1;
    -PIXI.Graphics.CIRC = 2;
    -PIXI.Graphics.ELIP = 3;
    -PIXI.Graphics.RREC = 4;
    -
    -PIXI.Polygon.prototype.type = PIXI.Graphics.POLY;
    -PIXI.Rectangle.prototype.type = PIXI.Graphics.RECT;
    -PIXI.Circle.prototype.type = PIXI.Graphics.CIRC;
    -PIXI.Ellipse.prototype.type = PIXI.Graphics.ELIP;
    -PIXI.RoundedRectangle.prototype.type = PIXI.Graphics.RREC;
    -
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasGraphics.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasGraphics.js.html deleted file mode 100755 index 61eb8da..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasGraphics.js.html +++ /dev/null @@ -1,579 +0,0 @@ - - - - - src/pixi/renderers/canvas/CanvasGraphics.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/canvas/CanvasGraphics.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -
    -/**
    - * A set of functions used by the canvas renderer to draw the primitive graphics data.
    - *
    - * @class CanvasGraphics
    - * @static
    - */
    -PIXI.CanvasGraphics = function()
    -{
    -};
    -
    -/*
    - * Renders a PIXI.Graphics object to a canvas.
    - *
    - * @method renderGraphics
    - * @static
    - * @param graphics {Graphics} the actual graphics object to render
    - * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas
    - */
    -PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
    -{
    -    var worldAlpha = graphics.worldAlpha;
    -    var color = '';
    -
    -    for (var i = 0; i < graphics.graphicsData.length; i++)
    -    {
    -        var data = graphics.graphicsData[i];
    -        var shape = data.shape;
    -
    -        context.strokeStyle = color = '#' + ('00000' + ( data.lineColor | 0).toString(16)).substr(-6);
    -
    -        context.lineWidth = data.lineWidth;
    -
    -        if(data.type === PIXI.Graphics.POLY)
    -        {
    -            context.beginPath();
    -
    -            var points = shape.points;
    -
    -            context.moveTo(points[0], points[1]);
    -
    -            for (var j=1; j < points.length/2; j++)
    -            {
    -                context.lineTo(points[j * 2], points[j * 2 + 1]);
    -            }
    -
    -            if(shape.closed)
    -            {
    -                context.lineTo(points[0], points[1]);
    -            }
    -
    -            // if the first and last point are the same close the path - much neater :)
    -            if(points[0] === points[points.length-2] && points[1] === points[points.length-1])
    -            {
    -                context.closePath();
    -            }
    -
    -            if(data.fill)
    -            {
    -                context.globalAlpha = data.fillAlpha * worldAlpha;
    -                context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
    -                context.fill();
    -            }
    -            if(data.lineWidth)
    -            {
    -                context.globalAlpha = data.lineAlpha * worldAlpha;
    -                context.stroke();
    -            }
    -        }
    -        else if(data.type === PIXI.Graphics.RECT)
    -        {
    -
    -            if(data.fillColor || data.fillColor === 0)
    -            {
    -                context.globalAlpha = data.fillAlpha * worldAlpha;
    -                context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
    -                context.fillRect(shape.x, shape.y, shape.width, shape.height);
    -
    -            }
    -            if(data.lineWidth)
    -            {
    -                context.globalAlpha = data.lineAlpha * worldAlpha;
    -                context.strokeRect(shape.x, shape.y, shape.width, shape.height);
    -            }
    -        }
    -        else if(data.type === PIXI.Graphics.CIRC)
    -        {
    -            // TODO - need to be Undefined!
    -            context.beginPath();
    -            context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI);
    -            context.closePath();
    -
    -            if(data.fill)
    -            {
    -                context.globalAlpha = data.fillAlpha * worldAlpha;
    -                context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
    -                context.fill();
    -            }
    -            if(data.lineWidth)
    -            {
    -                context.globalAlpha = data.lineAlpha * worldAlpha;
    -                context.stroke();
    -            }
    -        }
    -        else if(data.type === PIXI.Graphics.ELIP)
    -        {
    -            // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas
    -
    -            var w = shape.width * 2;
    -            var h = shape.height * 2;
    -
    -            var x = shape.x - w/2;
    -            var y = shape.y - h/2;
    -
    -            context.beginPath();
    -
    -            var kappa = 0.5522848,
    -                ox = (w / 2) * kappa, // control point offset horizontal
    -                oy = (h / 2) * kappa, // control point offset vertical
    -                xe = x + w,           // x-end
    -                ye = y + h,           // y-end
    -                xm = x + w / 2,       // x-middle
    -                ym = y + h / 2;       // y-middle
    -
    -            context.moveTo(x, ym);
    -            context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
    -            context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
    -            context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
    -            context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
    -
    -            context.closePath();
    -
    -            if(data.fill)
    -            {
    -                context.globalAlpha = data.fillAlpha * worldAlpha;
    -                context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
    -                context.fill();
    -            }
    -            if(data.lineWidth)
    -            {
    -                context.globalAlpha = data.lineAlpha * worldAlpha;
    -                context.stroke();
    -            }
    -        }
    -        else if (data.type === PIXI.Graphics.RREC)
    -        {
    -            var rx = shape.x;
    -            var ry = shape.y;
    -            var width = shape.width;
    -            var height = shape.height;
    -            var radius = shape.radius;
    -
    -            var maxRadius = Math.min(width, height) / 2 | 0;
    -            radius = radius > maxRadius ? maxRadius : radius;
    -
    -            context.beginPath();
    -            context.moveTo(rx, ry + radius);
    -            context.lineTo(rx, ry + height - radius);
    -            context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height);
    -            context.lineTo(rx + width - radius, ry + height);
    -            context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius);
    -            context.lineTo(rx + width, ry + radius);
    -            context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry);
    -            context.lineTo(rx + radius, ry);
    -            context.quadraticCurveTo(rx, ry, rx, ry + radius);
    -            context.closePath();
    -
    -            if(data.fillColor || data.fillColor === 0)
    -            {
    -                context.globalAlpha = data.fillAlpha * worldAlpha;
    -                context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
    -                context.fill();
    -
    -            }
    -            if(data.lineWidth)
    -            {
    -                context.globalAlpha = data.lineAlpha * worldAlpha;
    -                context.stroke();
    -            }
    -        }
    -    }
    -};
    -
    -/*
    - * Renders a graphics mask
    - *
    - * @static
    - * @private
    - * @method renderGraphicsMask
    - * @param graphics {Graphics} the graphics which will be used as a mask
    - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas
    - */
    -PIXI.CanvasGraphics.renderGraphicsMask = function(graphics, context)
    -{
    -    var len = graphics.graphicsData.length;
    -
    -    if(len === 0) return;
    -
    -    if(len > 1)
    -    {
    -        len = 1;
    -        window.console.log('Pixi.js warning: masks in canvas can only mask using the first path in the graphics object');
    -    }
    -
    -    for (var i = 0; i < 1; i++)
    -    {
    -        var data = graphics.graphicsData[i];
    -        var shape = data.shape;
    -
    -        if(data.type === PIXI.Graphics.POLY)
    -        {
    -            context.beginPath();
    -        
    -            var points = shape.points;
    -        
    -            context.moveTo(points[0], points[1]);
    -
    -            for (var j=1; j < points.length/2; j++)
    -            {
    -                context.lineTo(points[j * 2], points[j * 2 + 1]);
    -            }
    -
    -            // if the first and last point are the same close the path - much neater :)
    -            if(points[0] === points[points.length-2] && points[1] === points[points.length-1])
    -            {
    -                context.closePath();
    -            }
    -
    -        }
    -        else if(data.type === PIXI.Graphics.RECT)
    -        {
    -            context.beginPath();
    -            context.rect(shape.x, shape.y, shape.width, shape.height);
    -            context.closePath();
    -        }
    -        else if(data.type === PIXI.Graphics.CIRC)
    -        {
    -            // TODO - need to be Undefined!
    -            context.beginPath();
    -            context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI);
    -            context.closePath();
    -        }
    -        else if(data.type === PIXI.Graphics.ELIP)
    -        {
    -
    -            // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas
    -
    -            var w = shape.width * 2;
    -            var h = shape.height * 2;
    -
    -            var x = shape.x - w/2;
    -            var y = shape.y - h/2;
    -
    -            context.beginPath();
    -
    -            var kappa = 0.5522848,
    -                ox = (w / 2) * kappa, // control point offset horizontal
    -                oy = (h / 2) * kappa, // control point offset vertical
    -                xe = x + w,           // x-end
    -                ye = y + h,           // y-end
    -                xm = x + w / 2,       // x-middle
    -                ym = y + h / 2;       // y-middle
    -
    -            context.moveTo(x, ym);
    -            context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
    -            context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
    -            context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
    -            context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
    -            context.closePath();
    -        }
    -        else if (data.type === PIXI.Graphics.RREC)
    -        {
    -        
    -            var pts = shape.points;
    -            var rx = pts[0];
    -            var ry = pts[1];
    -            var width = pts[2];
    -            var height = pts[3];
    -            var radius = pts[4];
    -
    -            var maxRadius = Math.min(width, height) / 2 | 0;
    -            radius = radius > maxRadius ? maxRadius : radius;
    -
    -            context.beginPath();
    -            context.moveTo(rx, ry + radius);
    -            context.lineTo(rx, ry + height - radius);
    -            context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height);
    -            context.lineTo(rx + width - radius, ry + height);
    -            context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius);
    -            context.lineTo(rx + width, ry + radius);
    -            context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry);
    -            context.lineTo(rx + radius, ry);
    -            context.quadraticCurveTo(rx, ry, rx, ry + radius);
    -            context.closePath();
    -        }
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasRenderer.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasRenderer.js.html deleted file mode 100755 index 0cc3085..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasRenderer.js.html +++ /dev/null @@ -1,623 +0,0 @@ - - - - - src/pixi/renderers/canvas/CanvasRenderer.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/canvas/CanvasRenderer.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The CanvasRenderer draws the Stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    - * Don't forget to add the CanvasRenderer.view to your DOM or you will not see anything :)
    - *
    - * @class CanvasRenderer
    - * @constructor
    - * @param [width=800] {Number} the width of the canvas view
    - * @param [height=600] {Number} the height of the canvas view
    - * @param [options] {Object} The optional renderer parameters
    - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional
    - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false
    - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false
    - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2
    - * @param [options.clearBeforeRender=true] {Boolean} This sets if the CanvasRenderer will clear the canvas or not before the new render pass.
    - */
    -PIXI.CanvasRenderer = function(width, height, options)
    -{
    -    if(options)
    -    {
    -        for (var i in PIXI.defaultRenderOptions)
    -        {
    -            if (typeof options[i] === "undefined") options[i] = PIXI.defaultRenderOptions[i];
    -        }
    -    }
    -    else
    -    {
    -        options = PIXI.defaultRenderOptions;
    -    }
    -
    -    if(!PIXI.defaultRenderer)
    -    {
    -        PIXI.sayHello("Canvas");
    -        PIXI.defaultRenderer = this;
    -    }
    -
    -    /**
    -     * The renderer type.
    -     *
    -     * @property type
    -     * @type Number
    -     */
    -    this.type = PIXI.CANVAS_RENDERER;
    -
    -    /**
    -     * The resolution of the canvas.
    -     *
    -     * @property resolution
    -     * @type Number
    -     */
    -    this.resolution = options.resolution;
    -
    -    /**
    -     * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.
    -     * If the Stage is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.
    -     * If the Stage is transparent Pixi will use clearRect to clear the canvas every frame.
    -     * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.
    -     *
    -     * @property clearBeforeRender
    -     * @type Boolean
    -     * @default
    -     */
    -    this.clearBeforeRender = options.clearBeforeRender;
    -
    -    /**
    -     * Whether the render view is transparent
    -     *
    -     * @property transparent
    -     * @type Boolean
    -     */
    -    this.transparent = options.transparent;
    -
    -    /**
    -     * Whether the render view should be resized automatically
    -     *
    -     * @property autoResize
    -     * @type Boolean
    -     */
    -    this.autoResize = options.autoResize || false;
    -
    -
    -    /**
    -     * The width of the canvas view
    -     *
    -     * @property width
    -     * @type Number
    -     * @default 800
    -     */
    -    this.width = width || 800;
    -
    -    /**
    -     * The height of the canvas view
    -     *
    -     * @property height
    -     * @type Number
    -     * @default 600
    -     */
    -    this.height = height || 600;
    -
    -    this.width *= this.resolution;
    -    this.height *= this.resolution;
    -
    -    /**
    -     * The canvas element that everything is drawn to.
    -     *
    -     * @property view
    -     * @type HTMLCanvasElement
    -     */
    -    this.view = options.view || document.createElement( "canvas" );
    -
    -    /**
    -     * The canvas 2d context that everything is drawn with
    -     * @property context
    -     * @type CanvasRenderingContext2D
    -     */
    -    this.context = this.view.getContext( "2d", { alpha: this.transparent } );
    -
    -    /**
    -     * Boolean flag controlling canvas refresh.
    -     *
    -     * @property refresh
    -     * @type Boolean
    -     */
    -    this.refresh = true;
    -
    -    this.view.width = this.width * this.resolution;
    -    this.view.height = this.height * this.resolution;
    -
    -    /**
    -     * Internal var.
    -     *
    -     * @property count
    -     * @type Number
    -     */
    -    this.count = 0;
    -
    -    /**
    -     * Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer
    -     * @property CanvasMaskManager
    -     * @type CanvasMaskManager
    -     */
    -    this.maskManager = new PIXI.CanvasMaskManager();
    -
    -    /**
    -     * The render session is just a bunch of parameter used for rendering
    -     * @property renderSession
    -     * @type Object
    -     */
    -    this.renderSession = {
    -        context: this.context,
    -        maskManager: this.maskManager,
    -        scaleMode: null,
    -        smoothProperty: null,
    -        /**
    -         * If true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation.
    -         * Handy for crisp pixel art and speed on legacy devices.
    -         *
    -         */
    -        roundPixels: false
    -    };
    -
    -    this.mapBlendModes();
    -    
    -    this.resize(width, height);
    -
    -    if("imageSmoothingEnabled" in this.context)
    -        this.renderSession.smoothProperty = "imageSmoothingEnabled";
    -    else if("webkitImageSmoothingEnabled" in this.context)
    -        this.renderSession.smoothProperty = "webkitImageSmoothingEnabled";
    -    else if("mozImageSmoothingEnabled" in this.context)
    -        this.renderSession.smoothProperty = "mozImageSmoothingEnabled";
    -    else if("oImageSmoothingEnabled" in this.context)
    -        this.renderSession.smoothProperty = "oImageSmoothingEnabled";
    -    else if ("msImageSmoothingEnabled" in this.context)
    -        this.renderSession.smoothProperty = "msImageSmoothingEnabled";
    -};
    -
    -// constructor
    -PIXI.CanvasRenderer.prototype.constructor = PIXI.CanvasRenderer;
    -
    -/**
    - * Renders the Stage to this canvas view
    - *
    - * @method render
    - * @param stage {Stage} the Stage element to be rendered
    - */
    -PIXI.CanvasRenderer.prototype.render = function(stage)
    -{
    -    stage.updateTransform();
    -
    -    this.context.setTransform(1,0,0,1,0,0);
    -
    -    this.context.globalAlpha = 1;
    -
    -    this.renderSession.currentBlendMode = PIXI.blendModes.NORMAL;
    -    this.context.globalCompositeOperation = PIXI.blendModesCanvas[PIXI.blendModes.NORMAL];
    -
    -    if (navigator.isCocoonJS && this.view.screencanvas) {
    -        this.context.fillStyle = "black";
    -        this.context.clear();
    -    }
    -    
    -    if (this.clearBeforeRender)
    -    {
    -        if (this.transparent)
    -        {
    -            this.context.clearRect(0, 0, this.width, this.height);
    -        }
    -        else
    -        {
    -            this.context.fillStyle = stage.backgroundColorString;
    -            this.context.fillRect(0, 0, this.width , this.height);
    -        }
    -    }
    -    
    -    this.renderDisplayObject(stage);
    -
    -    // run interaction!
    -    if(stage.interactive)
    -    {
    -        //need to add some events!
    -        if(!stage._interactiveEventsAdded)
    -        {
    -            stage._interactiveEventsAdded = true;
    -            stage.interactionManager.setTarget(this);
    -        }
    -    }
    -};
    -
    -/**
    - * Removes everything from the renderer and optionally removes the Canvas DOM element.
    - *
    - * @method destroy
    - * @param [removeView=true] {boolean} Removes the Canvas element from the DOM.
    - */
    -PIXI.CanvasRenderer.prototype.destroy = function(removeView)
    -{
    -    if (typeof removeView === "undefined") { removeView = true; }
    -
    -    if (removeView && this.view.parent)
    -    {
    -        this.view.parent.removeChild(this.view);
    -    }
    -
    -    this.view = null;
    -    this.context = null;
    -    this.maskManager = null;
    -    this.renderSession = null;
    -
    -};
    -
    -/**
    - * Resizes the canvas view to the specified width and height
    - *
    - * @method resize
    - * @param width {Number} the new width of the canvas view
    - * @param height {Number} the new height of the canvas view
    - */
    -PIXI.CanvasRenderer.prototype.resize = function(width, height)
    -{
    -    this.width = width * this.resolution;
    -    this.height = height * this.resolution;
    -
    -    this.view.width = this.width;
    -    this.view.height = this.height;
    -
    -    if (this.autoResize) {
    -        this.view.style.width = this.width / this.resolution + "px";
    -        this.view.style.height = this.height / this.resolution + "px";
    -    }
    -};
    -
    -/**
    - * Renders a display object
    - *
    - * @method renderDisplayObject
    - * @param displayObject {DisplayObject} The displayObject to render
    - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas
    - * @private
    - */
    -PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject, context)
    -{
    -    this.renderSession.context = context || this.context;
    -    this.renderSession.resolution = this.resolution;
    -    displayObject._renderCanvas(this.renderSession);
    -};
    -
    -/**
    - * Maps Pixi blend modes to canvas blend modes.
    - *
    - * @method mapBlendModes
    - * @private
    - */
    -PIXI.CanvasRenderer.prototype.mapBlendModes = function()
    -{
    -    if(!PIXI.blendModesCanvas)
    -    {
    -        PIXI.blendModesCanvas = [];
    -
    -        if(PIXI.canUseNewCanvasBlendModes())
    -        {
    -            PIXI.blendModesCanvas[PIXI.blendModes.NORMAL]   = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.ADD]      = "lighter"; //IS THIS OK???
    -            PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "multiply";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SCREEN]   = "screen";
    -            PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY]  = "overlay";
    -            PIXI.blendModesCanvas[PIXI.blendModes.DARKEN]   = "darken";
    -            PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN]  = "lighten";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "color-dodge";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "color-burn";
    -            PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "hard-light";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "soft-light";
    -            PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "difference";
    -            PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "exclusion";
    -            PIXI.blendModesCanvas[PIXI.blendModes.HUE]       = "hue";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "saturation";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR]      = "color";
    -            PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "luminosity";
    -        }
    -        else
    -        {
    -            // this means that the browser does not support the cool new blend modes in canvas "cough" ie "cough"
    -            PIXI.blendModesCanvas[PIXI.blendModes.NORMAL]   = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.ADD]      = "lighter"; //IS THIS OK???
    -            PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SCREEN]   = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY]  = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.DARKEN]   = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN]  = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.HUE]       = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR]      = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "source-over";
    -        }
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasBuffer.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasBuffer.js.html deleted file mode 100755 index 1705871..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasBuffer.js.html +++ /dev/null @@ -1,354 +0,0 @@ - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/canvas/utils/CanvasBuffer.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * Creates a Canvas element of the given size.
    - *
    - * @class CanvasBuffer
    - * @constructor
    - * @param width {Number} the width for the newly created canvas
    - * @param height {Number} the height for the newly created canvas
    - */
    -PIXI.CanvasBuffer = function(width, height)
    -{
    -    /**
    -     * The width of the Canvas in pixels.
    -     *
    -     * @property width
    -     * @type Number
    -     */
    -    this.width = width;
    -
    -    /**
    -     * The height of the Canvas in pixels.
    -     *
    -     * @property height
    -     * @type Number
    -     */
    -    this.height = height;
    -
    -    /**
    -     * The Canvas object that belongs to this CanvasBuffer.
    -     *
    -     * @property canvas
    -     * @type HTMLCanvasElement
    -     */
    -    this.canvas = document.createElement("canvas");
    -
    -    /**
    -     * A CanvasRenderingContext2D object representing a two-dimensional rendering context.
    -     *
    -     * @property context
    -     * @type CanvasRenderingContext2D
    -     */
    -    this.context = this.canvas.getContext("2d");
    -
    -    this.canvas.width = width;
    -    this.canvas.height = height;
    -};
    -
    -PIXI.CanvasBuffer.prototype.constructor = PIXI.CanvasBuffer;
    -
    -/**
    - * Clears the canvas that was created by the CanvasBuffer class.
    - *
    - * @method clear
    - * @private
    - */
    -PIXI.CanvasBuffer.prototype.clear = function()
    -{
    -    this.context.setTransform(1, 0, 0, 1, 0, 0);
    -    this.context.clearRect(0,0, this.width, this.height);
    -};
    -
    -/**
    - * Resizes the canvas to the specified width and height.
    - *
    - * @method resize
    - * @param width {Number} the new width of the canvas
    - * @param height {Number} the new height of the canvas
    - */
    -PIXI.CanvasBuffer.prototype.resize = function(width, height)
    -{
    -    this.width = this.canvas.width = width;
    -    this.height = this.canvas.height = height;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasMaskManager.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasMaskManager.js.html deleted file mode 100755 index a4c4114..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasMaskManager.js.html +++ /dev/null @@ -1,336 +0,0 @@ - - - - - src/pixi/renderers/canvas/utils/CanvasMaskManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/canvas/utils/CanvasMaskManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A set of functions used to handle masking.
    - *
    - * @class CanvasMaskManager
    - * @constructor
    - */
    -PIXI.CanvasMaskManager = function()
    -{
    -};
    -
    -PIXI.CanvasMaskManager.prototype.constructor = PIXI.CanvasMaskManager;
    -
    -/**
    - * This method adds it to the current stack of masks.
    - *
    - * @method pushMask
    - * @param maskData {Object} the maskData that will be pushed
    - * @param renderSession {Object} The renderSession whose context will be used for this mask manager.
    - */
    -PIXI.CanvasMaskManager.prototype.pushMask = function(maskData, renderSession)
    -{
    -	var context = renderSession.context;
    -
    -    context.save();
    -    
    -    var cacheAlpha = maskData.alpha;
    -    var transform = maskData.worldTransform;
    -
    -    var resolution = renderSession.resolution;
    -
    -    context.setTransform(transform.a * resolution,
    -                         transform.b * resolution,
    -                         transform.c * resolution,
    -                         transform.d * resolution,
    -                         transform.tx * resolution,
    -                         transform.ty * resolution);
    -
    -    PIXI.CanvasGraphics.renderGraphicsMask(maskData, context);
    -
    -    context.clip();
    -
    -    maskData.worldAlpha = cacheAlpha;
    -};
    -
    -/**
    - * Restores the current drawing context to the state it was before the mask was applied.
    - *
    - * @method popMask
    - * @param renderSession {Object} The renderSession whose context will be used for this mask manager.
    - */
    -PIXI.CanvasMaskManager.prototype.popMask = function(renderSession)
    -{
    -    renderSession.context.restore();
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasTinter.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasTinter.js.html deleted file mode 100755 index 679a98c..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasTinter.js.html +++ /dev/null @@ -1,510 +0,0 @@ - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/canvas/utils/CanvasTinter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * @class CanvasTinter
    - * @constructor
    - * @static
    - */
    -PIXI.CanvasTinter = function()
    -{
    -};
    -
    -/**
    - * Basically this method just needs a sprite and a color and tints the sprite with the given color.
    - * 
    - * @method getTintedTexture 
    - * @param sprite {Sprite} the sprite to tint
    - * @param color {Number} the color to use to tint the sprite with
    - * @return {HTMLCanvasElement} The tinted canvas
    - */
    -PIXI.CanvasTinter.getTintedTexture = function(sprite, color)
    -{
    -    var texture = sprite.texture;
    -
    -    color = PIXI.CanvasTinter.roundColor(color);
    -
    -    var stringColor = "#" + ("00000" + ( color | 0).toString(16)).substr(-6);
    -   
    -    texture.tintCache = texture.tintCache || {};
    -
    -    if(texture.tintCache[stringColor]) return texture.tintCache[stringColor];
    -
    -     // clone texture..
    -    var canvas = PIXI.CanvasTinter.canvas || document.createElement("canvas");
    -    
    -    //PIXI.CanvasTinter.tintWithPerPixel(texture, stringColor, canvas);
    -    PIXI.CanvasTinter.tintMethod(texture, color, canvas);
    -
    -    if(PIXI.CanvasTinter.convertTintToImage)
    -    {
    -        // is this better?
    -        var tintImage = new Image();
    -        tintImage.src = canvas.toDataURL();
    -
    -        texture.tintCache[stringColor] = tintImage;
    -    }
    -    else
    -    {
    -        texture.tintCache[stringColor] = canvas;
    -        // if we are not converting the texture to an image then we need to lose the reference to the canvas
    -        PIXI.CanvasTinter.canvas = null;
    -    }
    -
    -    return canvas;
    -};
    -
    -/**
    - * Tint a texture using the "multiply" operation.
    - * 
    - * @method tintWithMultiply
    - * @param texture {Texture} the texture to tint
    - * @param color {Number} the color to use to tint the sprite with
    - * @param canvas {HTMLCanvasElement} the current canvas
    - */
    -PIXI.CanvasTinter.tintWithMultiply = function(texture, color, canvas)
    -{
    -    var context = canvas.getContext( "2d" );
    -
    -    var crop = texture.crop;
    -
    -    canvas.width = crop.width;
    -    canvas.height = crop.height;
    -
    -    context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6);
    -    
    -    context.fillRect(0, 0, crop.width, crop.height);
    -    
    -    context.globalCompositeOperation = "multiply";
    -
    -    context.drawImage(texture.baseTexture.source,
    -                           crop.x,
    -                           crop.y,
    -                           crop.width,
    -                           crop.height,
    -                           0,
    -                           0,
    -                           crop.width,
    -                           crop.height);
    -
    -    context.globalCompositeOperation = "destination-atop";
    -
    -    context.drawImage(texture.baseTexture.source,
    -                           crop.x,
    -                           crop.y,
    -                           crop.width,
    -                           crop.height,
    -                           0,
    -                           0,
    -                           crop.width,
    -                           crop.height);
    -};
    -
    -/**
    - * Tint a texture using the "overlay" operation.
    - * 
    - * @method tintWithOverlay
    - * @param texture {Texture} the texture to tint
    - * @param color {Number} the color to use to tint the sprite with
    - * @param canvas {HTMLCanvasElement} the current canvas
    - */
    -PIXI.CanvasTinter.tintWithOverlay = function(texture, color, canvas)
    -{
    -    var context = canvas.getContext( "2d" );
    -
    -    var crop = texture.crop;
    -
    -    canvas.width = crop.width;
    -    canvas.height = crop.height;
    -    
    -    context.globalCompositeOperation = "copy";
    -    context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6);
    -    context.fillRect(0, 0, crop.width, crop.height);
    -
    -    context.globalCompositeOperation = "destination-atop";
    -    context.drawImage(texture.baseTexture.source,
    -                           crop.x,
    -                           crop.y,
    -                           crop.width,
    -                           crop.height,
    -                           0,
    -                           0,
    -                           crop.width,
    -                           crop.height);
    -    
    -    //context.globalCompositeOperation = "copy";
    -};
    -
    -/**
    - * Tint a texture pixel per pixel.
    - * 
    - * @method tintPerPixel
    - * @param texture {Texture} the texture to tint
    - * @param color {Number} the color to use to tint the sprite with
    - * @param canvas {HTMLCanvasElement} the current canvas
    - */
    -PIXI.CanvasTinter.tintWithPerPixel = function(texture, color, canvas)
    -{
    -    var context = canvas.getContext( "2d" );
    -
    -    var crop = texture.crop;
    -
    -    canvas.width = crop.width;
    -    canvas.height = crop.height;
    -  
    -    context.globalCompositeOperation = "copy";
    -    context.drawImage(texture.baseTexture.source,
    -                           crop.x,
    -                           crop.y,
    -                           crop.width,
    -                           crop.height,
    -                           0,
    -                           0,
    -                           crop.width,
    -                           crop.height);
    -
    -    var rgbValues = PIXI.hex2rgb(color);
    -    var r = rgbValues[0], g = rgbValues[1], b = rgbValues[2];
    -
    -    var pixelData = context.getImageData(0, 0, crop.width, crop.height);
    -
    -    var pixels = pixelData.data;
    -
    -    for (var i = 0; i < pixels.length; i += 4)
    -    {
    -        pixels[i+0] *= r;
    -        pixels[i+1] *= g;
    -        pixels[i+2] *= b;
    -    }
    -
    -    context.putImageData(pixelData, 0, 0);
    -};
    -
    -/**
    - * Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel.
    - * 
    - * @method roundColor
    - * @param color {number} the color to round, should be a hex color
    - */
    -PIXI.CanvasTinter.roundColor = function(color)
    -{
    -    var step = PIXI.CanvasTinter.cacheStepsPerColorChannel;
    -
    -    var rgbValues = PIXI.hex2rgb(color);
    -
    -    rgbValues[0] = Math.min(255, (rgbValues[0] / step) * step);
    -    rgbValues[1] = Math.min(255, (rgbValues[1] / step) * step);
    -    rgbValues[2] = Math.min(255, (rgbValues[2] / step) * step);
    -
    -    return PIXI.rgb2hex(rgbValues);
    -};
    -
    -/**
    - * Number of steps which will be used as a cap when rounding colors.
    - *
    - * @property cacheStepsPerColorChannel
    - * @type Number
    - */
    -PIXI.CanvasTinter.cacheStepsPerColorChannel = 8;
    -
    -/**
    - * Tint cache boolean flag.
    - *
    - * @property convertTintToImage
    - * @type Boolean
    - */
    -PIXI.CanvasTinter.convertTintToImage = false;
    -
    -/**
    - * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method.
    - *
    - * @property canUseMultiply
    - * @type Boolean
    - */
    -PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes();
    -
    -/**
    - * The tinting method that will be used.
    - * 
    - * @method tintMethod
    - */
    -PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply :  PIXI.CanvasTinter.tintWithPerPixel;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_WebGLRenderer.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_WebGLRenderer.js.html deleted file mode 100755 index 5fb7452..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_WebGLRenderer.js.html +++ /dev/null @@ -1,820 +0,0 @@ - - - - - src/pixi/renderers/webgl/WebGLRenderer.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/WebGLRenderer.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -PIXI.glContexts = []; // this is where we store the webGL contexts for easy access.
    -PIXI.instances = [];
    -
    -/**
    - * The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer
    - * should be used for browsers that support webGL. This Render works by automatically managing webGLBatchs.
    - * So no need for Sprite Batches or Sprite Clouds.
    - * Don't forget to add the view to your DOM or you will not see anything :)
    - *
    - * @class WebGLRenderer
    - * @constructor
    - * @param [width=0] {Number} the width of the canvas view
    - * @param [height=0] {Number} the height of the canvas view
    - * @param [options] {Object} The optional renderer parameters
    - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional
    - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false
    - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false
    - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment)
    - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context
    - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2
    - */
    -PIXI.WebGLRenderer = function(width, height, options)
    -{
    -    if(options)
    -    {
    -        for (var i in PIXI.defaultRenderOptions)
    -        {
    -            if (typeof options[i] === 'undefined') options[i] = PIXI.defaultRenderOptions[i];
    -        }
    -    }
    -    else
    -    {
    -        options = PIXI.defaultRenderOptions;
    -    }
    -
    -    if(!PIXI.defaultRenderer)
    -    {
    -        PIXI.sayHello('webGL');
    -        PIXI.defaultRenderer = this;
    -    }
    -
    -    /**
    -     * @property type
    -     * @type Number
    -     */
    -    this.type = PIXI.WEBGL_RENDERER;
    -
    -    /**
    -     * The resolution of the renderer
    -     *
    -     * @property resolution
    -     * @type Number
    -     * @default 1
    -     */
    -    this.resolution = options.resolution;
    -
    -    // do a catch.. only 1 webGL renderer..
    -
    -    /**
    -     * Whether the render view is transparent
    -     *
    -     * @property transparent
    -     * @type Boolean
    -     */
    -    this.transparent = options.transparent;
    -
    -    /**
    -     * Whether the render view should be resized automatically
    -     *
    -     * @property autoResize
    -     * @type Boolean
    -     */
    -    this.autoResize = options.autoResize || false;
    -
    -    /**
    -     * The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering.
    -     *
    -     * @property preserveDrawingBuffer
    -     * @type Boolean
    -     */
    -    this.preserveDrawingBuffer = options.preserveDrawingBuffer;
    -
    -    /**
    -     * This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true:
    -     * If the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0).
    -     * If the Stage is transparent, Pixi will clear to the target Stage's background color.
    -     * Disable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set.
    -     *
    -     * @property clearBeforeRender
    -     * @type Boolean
    -     * @default
    -     */
    -    this.clearBeforeRender = options.clearBeforeRender;
    -
    -    /**
    -     * The width of the canvas view
    -     *
    -     * @property width
    -     * @type Number
    -     * @default 800
    -     */
    -    this.width = width || 800;
    -
    -    /**
    -     * The height of the canvas view
    -     *
    -     * @property height
    -     * @type Number
    -     * @default 600
    -     */
    -    this.height = height || 600;
    -
    -    /**
    -     * The canvas element that everything is drawn to
    -     *
    -     * @property view
    -     * @type HTMLCanvasElement
    -     */
    -    this.view = options.view || document.createElement( 'canvas' );
    -
    -    // deal with losing context..
    -
    -    /**
    -     * @property contextLostBound
    -     * @type Function
    -     */
    -    this.contextLostBound = this.handleContextLost.bind(this);
    -
    -    /**
    -     * @property contextRestoredBound
    -     * @type Function
    -     */
    -    this.contextRestoredBound = this.handleContextRestored.bind(this);
    -
    -    this.view.addEventListener('webglcontextlost', this.contextLostBound, false);
    -    this.view.addEventListener('webglcontextrestored', this.contextRestoredBound, false);
    -
    -    /**
    -     * @property _contextOptions
    -     * @type Object
    -     * @private
    -     */
    -    this._contextOptions = {
    -        alpha: this.transparent,
    -        antialias: options.antialias, // SPEED UP??
    -        premultipliedAlpha:this.transparent && this.transparent !== 'notMultiplied',
    -        stencil:true,
    -        preserveDrawingBuffer: options.preserveDrawingBuffer
    -    };
    -
    -    /**
    -     * @property projection
    -     * @type Point
    -     */
    -    this.projection = new PIXI.Point();
    -
    -    /**
    -     * @property offset
    -     * @type Point
    -     */
    -    this.offset = new PIXI.Point(0, 0);
    -
    -    // time to create the render managers! each one focuses on managing a state in webGL
    -
    -    /**
    -     * Deals with managing the shader programs and their attribs
    -     * @property shaderManager
    -     * @type WebGLShaderManager
    -     */
    -    this.shaderManager = new PIXI.WebGLShaderManager();
    -
    -    /**
    -     * Manages the rendering of sprites
    -     * @property spriteBatch
    -     * @type WebGLSpriteBatch
    -     */
    -    this.spriteBatch = new PIXI.WebGLSpriteBatch();
    -
    -    /**
    -     * Manages the masks using the stencil buffer
    -     * @property maskManager
    -     * @type WebGLMaskManager
    -     */
    -    this.maskManager = new PIXI.WebGLMaskManager();
    -
    -    /**
    -     * Manages the filters
    -     * @property filterManager
    -     * @type WebGLFilterManager
    -     */
    -    this.filterManager = new PIXI.WebGLFilterManager();
    -
    -    /**
    -     * Manages the stencil buffer
    -     * @property stencilManager
    -     * @type WebGLStencilManager
    -     */
    -    this.stencilManager = new PIXI.WebGLStencilManager();
    -
    -    /**
    -     * Manages the blendModes
    -     * @property blendModeManager
    -     * @type WebGLBlendModeManager
    -     */
    -    this.blendModeManager = new PIXI.WebGLBlendModeManager();
    -
    -    /**
    -     * TODO remove
    -     * @property renderSession
    -     * @type Object
    -     */
    -    this.renderSession = {};
    -    this.renderSession.gl = this.gl;
    -    this.renderSession.drawCount = 0;
    -    this.renderSession.shaderManager = this.shaderManager;
    -    this.renderSession.maskManager = this.maskManager;
    -    this.renderSession.filterManager = this.filterManager;
    -    this.renderSession.blendModeManager = this.blendModeManager;
    -    this.renderSession.spriteBatch = this.spriteBatch;
    -    this.renderSession.stencilManager = this.stencilManager;
    -    this.renderSession.renderer = this;
    -    this.renderSession.resolution = this.resolution;
    -
    -    // time init the context..
    -    this.initContext();
    -
    -    // map some webGL blend modes..
    -    this.mapBlendModes();
    -};
    -
    -// constructor
    -PIXI.WebGLRenderer.prototype.constructor = PIXI.WebGLRenderer;
    -
    -/**
    -* @method initContext
    -*/
    -PIXI.WebGLRenderer.prototype.initContext = function()
    -{
    -    var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions);
    -    this.gl = gl;
    -
    -    if (!gl) {
    -        // fail, not able to get a context
    -        throw new Error('This browser does not support webGL. Try using the canvas renderer');
    -    }
    -
    -    this.glContextId = gl.id = PIXI.WebGLRenderer.glContextId ++;
    -
    -    PIXI.glContexts[this.glContextId] = gl;
    -
    -    PIXI.instances[this.glContextId] = this;
    -
    -    // set up the default pixi settings..
    -    gl.disable(gl.DEPTH_TEST);
    -    gl.disable(gl.CULL_FACE);
    -    gl.enable(gl.BLEND);
    -
    -    // need to set the context for all the managers...
    -    this.shaderManager.setContext(gl);
    -    this.spriteBatch.setContext(gl);
    -    this.maskManager.setContext(gl);
    -    this.filterManager.setContext(gl);
    -    this.blendModeManager.setContext(gl);
    -    this.stencilManager.setContext(gl);
    -
    -    this.renderSession.gl = this.gl;
    -
    -    // now resize and we are good to go!
    -    this.resize(this.width, this.height);
    -};
    -
    -/**
    - * Renders the stage to its webGL view
    - *
    - * @method render
    - * @param stage {Stage} the Stage element to be rendered
    - */
    -PIXI.WebGLRenderer.prototype.render = function(stage)
    -{
    -    // no point rendering if our context has been blown up!
    -    if(this.contextLost)return;
    -
    -    // if rendering a new stage clear the batches..
    -    if(this.__stage !== stage)
    -    {
    -        if(stage.interactive)stage.interactionManager.removeEvents();
    -
    -        // TODO make this work
    -        // dont think this is needed any more?
    -        this.__stage = stage;
    -    }
    -
    -    // update the scene graph
    -    stage.updateTransform();
    -
    -    var gl = this.gl;
    -
    -    // interaction
    -    if(stage._interactive)
    -    {
    -        //need to add some events!
    -        if(!stage._interactiveEventsAdded)
    -        {
    -            stage._interactiveEventsAdded = true;
    -            stage.interactionManager.setTarget(this);
    -        }
    -    }
    -    else
    -    {
    -        if(stage._interactiveEventsAdded)
    -        {
    -            stage._interactiveEventsAdded = false;
    -            stage.interactionManager.setTarget(this);
    -        }
    -    }
    -
    -    // -- Does this need to be set every frame? -- //
    -    gl.viewport(0, 0, this.width, this.height);
    -
    -    // make sure we are bound to the main frame buffer
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, null);
    -
    -    if (this.clearBeforeRender)
    -        {
    -        if(this.transparent)
    -        {
    -            gl.clearColor(0, 0, 0, 0);
    -        }
    -        else
    -        {
    -            gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], 1);
    -        }
    -
    -        gl.clear (gl.COLOR_BUFFER_BIT);
    -    }
    -
    -    this.renderDisplayObject( stage, this.projection );
    -};
    -
    -/**
    - * Renders a Display Object.
    - *
    - * @method renderDisplayObject
    - * @param displayObject {DisplayObject} The DisplayObject to render
    - * @param projection {Point} The projection
    - * @param buffer {Array} a standard WebGL buffer
    - */
    -PIXI.WebGLRenderer.prototype.renderDisplayObject = function(displayObject, projection, buffer)
    -{
    -    this.renderSession.blendModeManager.setBlendMode(PIXI.blendModes.NORMAL);
    -
    -    // reset the render session data..
    -    this.renderSession.drawCount = 0;
    -
    -    // set the default projection
    -    this.renderSession.projection = projection;
    -
    -    //set the default offset
    -    this.renderSession.offset = this.offset;
    -
    -    // start the sprite batch
    -    this.spriteBatch.begin(this.renderSession);
    -
    -    // start the filter manager
    -    this.filterManager.begin(this.renderSession, buffer);
    -
    -    // render the scene!
    -    displayObject._renderWebGL(this.renderSession);
    -
    -    // finish the sprite batch
    -    this.spriteBatch.end();
    -};
    -
    -/**
    - * Resizes the webGL view to the specified width and height.
    - *
    - * @method resize
    - * @param width {Number} the new width of the webGL view
    - * @param height {Number} the new height of the webGL view
    - */
    -PIXI.WebGLRenderer.prototype.resize = function(width, height)
    -{
    -    this.width = width * this.resolution;
    -    this.height = height * this.resolution;
    -
    -    this.view.width = this.width;
    -    this.view.height = this.height;
    -
    -    if (this.autoResize) {
    -        this.view.style.width = this.width / this.resolution + 'px';
    -        this.view.style.height = this.height / this.resolution + 'px';
    -    }
    -
    -    this.gl.viewport(0, 0, this.width, this.height);
    -
    -    this.projection.x =  this.width / 2 / this.resolution;
    -    this.projection.y =  -this.height / 2 / this.resolution;
    -};
    -
    -/**
    - * Updates and Creates a WebGL texture for the renderers context.
    - *
    - * @method updateTexture
    - * @param texture {Texture} the texture to update
    - */
    -PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    -{
    -    if(!texture.hasLoaded )return;
    -
    -    var gl = this.gl;
    -
    -    if(!texture._glTextures[gl.id])texture._glTextures[gl.id] = gl.createTexture();
    -
    -    gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]);
    -
    -    gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultipliedAlpha);
    -    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source);
    -
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
    -
    -    // reguler...
    -    if(!texture._powerOf2)
    -    {
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    -    }
    -    else
    -    {
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
    -    }
    -
    -    texture._dirty[gl.id] = false;
    -
    -    return  texture._glTextures[gl.id];
    -};
    -
    -/**
    - * Handles a lost webgl context
    - *
    - * @method handleContextLost
    - * @param event {Event}
    - * @private
    - */
    -PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    -{
    -    event.preventDefault();
    -    this.contextLost = true;
    -};
    -
    -/**
    - * Handles a restored webgl context
    - *
    - * @method handleContextRestored
    - * @param event {Event}
    - * @private
    - */
    -PIXI.WebGLRenderer.prototype.handleContextRestored = function()
    -{
    -    this.initContext();
    -
    -    // empty all the ol gl textures as they are useless now
    -    for(var key in PIXI.TextureCache)
    -    {
    -        var texture = PIXI.TextureCache[key].baseTexture;
    -        texture._glTextures = [];
    -    }
    -
    -    this.contextLost = false;
    -};
    -
    -/**
    - * Removes everything from the renderer (event listeners, spritebatch, etc...)
    - *
    - * @method destroy
    - */
    -PIXI.WebGLRenderer.prototype.destroy = function()
    -{
    -    // remove listeners
    -    this.view.removeEventListener('webglcontextlost', this.contextLostBound);
    -    this.view.removeEventListener('webglcontextrestored', this.contextRestoredBound);
    -
    -    PIXI.glContexts[this.glContextId] = null;
    -
    -    this.projection = null;
    -    this.offset = null;
    -
    -    // time to create the render managers! each one focuses on managine a state in webGL
    -    this.shaderManager.destroy();
    -    this.spriteBatch.destroy();
    -    this.maskManager.destroy();
    -    this.filterManager.destroy();
    -
    -    this.shaderManager = null;
    -    this.spriteBatch = null;
    -    this.maskManager = null;
    -    this.filterManager = null;
    -
    -    this.gl = null;
    -    this.renderSession = null;
    -};
    -
    -/**
    - * Maps Pixi blend modes to WebGL blend modes.
    - *
    - * @method mapBlendModes
    - */
    -PIXI.WebGLRenderer.prototype.mapBlendModes = function()
    -{
    -    var gl = this.gl;
    -
    -    if(!PIXI.blendModesWebGL)
    -    {
    -        PIXI.blendModesWebGL = [];
    -
    -        PIXI.blendModesWebGL[PIXI.blendModes.NORMAL]        = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.ADD]           = [gl.SRC_ALPHA, gl.DST_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.MULTIPLY]      = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.SCREEN]        = [gl.SRC_ALPHA, gl.ONE];
    -        PIXI.blendModesWebGL[PIXI.blendModes.OVERLAY]       = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.DARKEN]        = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.LIGHTEN]       = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.COLOR_DODGE]   = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.COLOR_BURN]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.HARD_LIGHT]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.SOFT_LIGHT]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.DIFFERENCE]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.EXCLUSION]     = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.HUE]           = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.SATURATION]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.COLOR]         = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.LUMINOSITY]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -    }
    -};
    -
    -PIXI.WebGLRenderer.glContextId = 0;
    -PIXI.WebGLRenderer.instances = [];
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_ComplexPrimitiveShader.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_ComplexPrimitiveShader.js.html deleted file mode 100755 index 696e890..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_ComplexPrimitiveShader.js.html +++ /dev/null @@ -1,399 +0,0 @@ - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class ComplexPrimitiveShader
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.ComplexPrimitiveShader = function(gl)
    -{
    -    /**
    -     * @property _UID
    -     * @type Number
    -     * @private
    -     */
    -    this._UID = PIXI._UID++;
    -
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    /**
    -     * The WebGL program.
    -     * @property program
    -     * @type {Any}
    -     */
    -    this.program = null;
    -
    -    /**
    -     * The fragment shader.
    -     * @property fragmentSrc
    -     * @type Array
    -     */
    -    this.fragmentSrc = [
    -
    -        'precision mediump float;',
    -
    -        'varying vec4 vColor;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = vColor;',
    -        '}'
    -    ];
    -
    -    /**
    -     * The vertex shader.
    -     * @property vertexSrc
    -     * @type Array
    -     */
    -    this.vertexSrc  = [
    -        'attribute vec2 aVertexPosition;',
    -        //'attribute vec4 aColor;',
    -        'uniform mat3 translationMatrix;',
    -        'uniform vec2 projectionVector;',
    -        'uniform vec2 offsetVector;',
    -        
    -        'uniform vec3 tint;',
    -        'uniform float alpha;',
    -        'uniform vec3 color;',
    -
    -        'varying vec4 vColor;',
    -
    -        'void main(void) {',
    -        '   vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);',
    -        '   v -= offsetVector.xyx;',
    -        '   gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);',
    -        '   vColor = vec4(color * alpha * tint, alpha);',//" * vec4(tint * alpha, alpha);',
    -        '}'
    -    ];
    -
    -    this.init();
    -};
    -
    -PIXI.ComplexPrimitiveShader.prototype.constructor = PIXI.ComplexPrimitiveShader;
    -
    -/**
    -* Initialises the shader.
    -* 
    -* @method init
    -*/
    -PIXI.ComplexPrimitiveShader.prototype.init = function()
    -{
    -    var gl = this.gl;
    -
    -    var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc);
    -    gl.useProgram(program);
    -
    -    // get and store the uniforms for the shader
    -    this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
    -    this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
    -    this.tintColor = gl.getUniformLocation(program, 'tint');
    -    this.color = gl.getUniformLocation(program, 'color');
    -
    -    // get and store the attributes
    -    this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
    -   // this.colorAttribute = gl.getAttribLocation(program, 'aColor');
    -
    -    this.attributes = [this.aVertexPosition, this.colorAttribute];
    -
    -    this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix');
    -    this.alpha = gl.getUniformLocation(program, 'alpha');
    -
    -    this.program = program;
    -};
    -
    -/**
    -* Destroys the shader.
    -* 
    -* @method destroy
    -*/
    -PIXI.ComplexPrimitiveShader.prototype.destroy = function()
    -{
    -    this.gl.deleteProgram( this.program );
    -    this.uniforms = null;
    -    this.gl = null;
    -
    -    this.attribute = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiFastShader.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiFastShader.js.html deleted file mode 100755 index 05dda36..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiFastShader.js.html +++ /dev/null @@ -1,433 +0,0 @@ - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/shaders/PixiFastShader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class PixiFastShader
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.PixiFastShader = function(gl)
    -{
    -    /**
    -     * @property _UID
    -     * @type Number
    -     * @private
    -     */
    -    this._UID = PIXI._UID++;
    -    
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    /**
    -     * The WebGL program.
    -     * @property program
    -     * @type {Any}
    -     */
    -    this.program = null;
    -
    -    /**
    -     * The fragment shader.
    -     * @property fragmentSrc
    -     * @type Array
    -     */
    -    this.fragmentSrc = [
    -        'precision lowp float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying float vColor;',
    -        'uniform sampler2D uSampler;',
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;',
    -        '}'
    -    ];
    -
    -    /**
    -     * The vertex shader.
    -     * @property vertexSrc
    -     * @type Array
    -     */
    -    this.vertexSrc = [
    -        'attribute vec2 aVertexPosition;',
    -        'attribute vec2 aPositionCoord;',
    -        'attribute vec2 aScale;',
    -        'attribute float aRotation;',
    -        'attribute vec2 aTextureCoord;',
    -        'attribute float aColor;',
    -
    -        'uniform vec2 projectionVector;',
    -        'uniform vec2 offsetVector;',
    -        'uniform mat3 uMatrix;',
    -
    -        'varying vec2 vTextureCoord;',
    -        'varying float vColor;',
    -
    -        'const vec2 center = vec2(-1.0, 1.0);',
    -
    -        'void main(void) {',
    -        '   vec2 v;',
    -        '   vec2 sv = aVertexPosition * aScale;',
    -        '   v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);',
    -        '   v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);',
    -        '   v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;',
    -        '   gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);',
    -        '   vTextureCoord = aTextureCoord;',
    -      //  '   vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;',
    -        '   vColor = aColor;',
    -        '}'
    -    ];
    -
    -    /**
    -     * A local texture counter for multi-texture shaders.
    -     * @property textureCount
    -     * @type Number
    -     */
    -    this.textureCount = 0;
    -    
    -    this.init();
    -};
    -
    -PIXI.PixiFastShader.prototype.constructor = PIXI.PixiFastShader;
    -
    -/**
    -* Initialises the shader.
    -* 
    -* @method init
    -*/
    -PIXI.PixiFastShader.prototype.init = function()
    -{
    -    var gl = this.gl;
    -
    -    var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc);
    -    
    -    gl.useProgram(program);
    -
    -    // get and store the uniforms for the shader
    -    this.uSampler = gl.getUniformLocation(program, 'uSampler');
    -
    -    this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
    -    this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
    -    this.dimensions = gl.getUniformLocation(program, 'dimensions');
    -    this.uMatrix = gl.getUniformLocation(program, 'uMatrix');
    -
    -    // get and store the attributes
    -    this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
    -    this.aPositionCoord = gl.getAttribLocation(program, 'aPositionCoord');
    -
    -    this.aScale = gl.getAttribLocation(program, 'aScale');
    -    this.aRotation = gl.getAttribLocation(program, 'aRotation');
    -
    -    this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord');
    -    this.colorAttribute = gl.getAttribLocation(program, 'aColor');
    -   
    -    // Begin worst hack eva //
    -
    -    // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters?
    -    // maybe its somthing to do with the current state of the gl context.
    -    // Im convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel
    -    // If theres any webGL people that know why could happen please help :)
    -    if(this.colorAttribute === -1)
    -    {
    -        this.colorAttribute = 2;
    -    }
    -
    -    this.attributes = [this.aVertexPosition, this.aPositionCoord,  this.aScale, this.aRotation, this.aTextureCoord, this.colorAttribute];
    -    
    -    // End worst hack eva //
    -
    -    this.program = program;
    -};
    -
    -/**
    -* Destroys the shader.
    -* 
    -* @method destroy
    -*/
    -PIXI.PixiFastShader.prototype.destroy = function()
    -{
    -    this.gl.deleteProgram( this.program );
    -    this.uniforms = null;
    -    this.gl = null;
    -
    -    this.attributes = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiShader.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiShader.js.html deleted file mode 100755 index 89d83ac..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiShader.js.html +++ /dev/null @@ -1,668 +0,0 @@ - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/shaders/PixiShader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * @author Richard Davey http://www.photonstorm.com @photonstorm
    - */
    -
    -/**
    -* @class PixiShader
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.PixiShader = function(gl)
    -{
    -    /**
    -     * @property _UID
    -     * @type Number
    -     * @private
    -     */
    -    this._UID = PIXI._UID++;
    -
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    /**
    -     * The WebGL program.
    -     * @property program
    -     * @type {Any}
    -     */
    -    this.program = null;
    -
    -    /**
    -     * The fragment shader.
    -     * @property fragmentSrc
    -     * @type Array
    -     */
    -    this.fragmentSrc = [
    -        'precision lowp float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D uSampler;',
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;',
    -        '}'
    -    ];
    -
    -    /**
    -     * A local texture counter for multi-texture shaders.
    -     * @property textureCount
    -     * @type Number
    -     */
    -    this.textureCount = 0;
    -
    -    /**
    -     * A local flag
    -     * @property firstRun
    -     * @type Boolean
    -     * @private
    -     */
    -    this.firstRun = true;
    -
    -    /**
    -     * A dirty flag
    -     * @property dirty
    -     * @type Boolean
    -     */
    -    this.dirty = true;
    -
    -    /**
    -     * Uniform attributes cache.
    -     * @property attributes
    -     * @type Array
    -     * @private
    -     */
    -    this.attributes = [];
    -
    -    this.init();
    -};
    -
    -PIXI.PixiShader.prototype.constructor = PIXI.PixiShader;
    -
    -/**
    -* Initialises the shader.
    -*
    -* @method init
    -*/
    -PIXI.PixiShader.prototype.init = function()
    -{
    -    var gl = this.gl;
    -
    -    var program = PIXI.compileProgram(gl, this.vertexSrc || PIXI.PixiShader.defaultVertexSrc, this.fragmentSrc);
    -
    -    gl.useProgram(program);
    -
    -    // get and store the uniforms for the shader
    -    this.uSampler = gl.getUniformLocation(program, 'uSampler');
    -    this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
    -    this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
    -    this.dimensions = gl.getUniformLocation(program, 'dimensions');
    -
    -    // get and store the attributes
    -    this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
    -    this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord');
    -    this.colorAttribute = gl.getAttribLocation(program, 'aColor');
    -
    -    // Begin worst hack eva //
    -
    -    // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters?
    -    // maybe its something to do with the current state of the gl context.
    -    // I'm convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel
    -    // If theres any webGL people that know why could happen please help :)
    -    if(this.colorAttribute === -1)
    -    {
    -        this.colorAttribute = 2;
    -    }
    -
    -    this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
    -
    -    // End worst hack eva //
    -
    -    // add those custom shaders!
    -    for (var key in this.uniforms)
    -    {
    -        // get the uniform locations..
    -        this.uniforms[key].uniformLocation = gl.getUniformLocation(program, key);
    -    }
    -
    -    this.initUniforms();
    -
    -    this.program = program;
    -};
    -
    -/**
    -* Initialises the shader uniform values.
    -*
    -* Uniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/
    -* http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf
    -*
    -* @method initUniforms
    -*/
    -PIXI.PixiShader.prototype.initUniforms = function()
    -{
    -    this.textureCount = 1;
    -    var gl = this.gl;
    -    var uniform;
    -
    -    for (var key in this.uniforms)
    -    {
    -        uniform = this.uniforms[key];
    -
    -        var type = uniform.type;
    -
    -        if (type === 'sampler2D')
    -        {
    -            uniform._init = false;
    -
    -            if (uniform.value !== null)
    -            {
    -                this.initSampler2D(uniform);
    -            }
    -        }
    -        else if (type === 'mat2' || type === 'mat3' || type === 'mat4')
    -        {
    -            //  These require special handling
    -            uniform.glMatrix = true;
    -            uniform.glValueLength = 1;
    -
    -            if (type === 'mat2')
    -            {
    -                uniform.glFunc = gl.uniformMatrix2fv;
    -            }
    -            else if (type === 'mat3')
    -            {
    -                uniform.glFunc = gl.uniformMatrix3fv;
    -            }
    -            else if (type === 'mat4')
    -            {
    -                uniform.glFunc = gl.uniformMatrix4fv;
    -            }
    -        }
    -        else
    -        {
    -            //  GL function reference
    -            uniform.glFunc = gl['uniform' + type];
    -
    -            if (type === '2f' || type === '2i')
    -            {
    -                uniform.glValueLength = 2;
    -            }
    -            else if (type === '3f' || type === '3i')
    -            {
    -                uniform.glValueLength = 3;
    -            }
    -            else if (type === '4f' || type === '4i')
    -            {
    -                uniform.glValueLength = 4;
    -            }
    -            else
    -            {
    -                uniform.glValueLength = 1;
    -            }
    -        }
    -    }
    -
    -};
    -
    -/**
    -* Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded)
    -*
    -* @method initSampler2D
    -*/
    -PIXI.PixiShader.prototype.initSampler2D = function(uniform)
    -{
    -    if (!uniform.value || !uniform.value.baseTexture || !uniform.value.baseTexture.hasLoaded)
    -    {
    -        return;
    -    }
    -
    -    var gl = this.gl;
    -
    -    gl.activeTexture(gl['TEXTURE' + this.textureCount]);
    -    gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]);
    -
    -    //  Extended texture data
    -    if (uniform.textureData)
    -    {
    -        var data = uniform.textureData;
    -
    -        // GLTexture = mag linear, min linear_mipmap_linear, wrap repeat + gl.generateMipmap(gl.TEXTURE_2D);
    -        // GLTextureLinear = mag/min linear, wrap clamp
    -        // GLTextureNearestRepeat = mag/min NEAREST, wrap repeat
    -        // GLTextureNearest = mag/min nearest, wrap clamp
    -        // AudioTexture = whatever + luminance + width 512, height 2, border 0
    -        // KeyTexture = whatever + luminance + width 256, height 2, border 0
    -
    -        //  magFilter can be: gl.LINEAR, gl.LINEAR_MIPMAP_LINEAR or gl.NEAREST
    -        //  wrapS/T can be: gl.CLAMP_TO_EDGE or gl.REPEAT
    -
    -        var magFilter = (data.magFilter) ? data.magFilter : gl.LINEAR;
    -        var minFilter = (data.minFilter) ? data.minFilter : gl.LINEAR;
    -        var wrapS = (data.wrapS) ? data.wrapS : gl.CLAMP_TO_EDGE;
    -        var wrapT = (data.wrapT) ? data.wrapT : gl.CLAMP_TO_EDGE;
    -        var format = (data.luminance) ? gl.LUMINANCE : gl.RGBA;
    -
    -        if (data.repeat)
    -        {
    -            wrapS = gl.REPEAT;
    -            wrapT = gl.REPEAT;
    -        }
    -
    -        gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, !!data.flipY);
    -
    -        if (data.width)
    -        {
    -            var width = (data.width) ? data.width : 512;
    -            var height = (data.height) ? data.height : 2;
    -            var border = (data.border) ? data.border : 0;
    -
    -            // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels);
    -            gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, border, format, gl.UNSIGNED_BYTE, null);
    -        }
    -        else
    -        {
    -            //  void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, ImageData? pixels);
    -            gl.texImage2D(gl.TEXTURE_2D, 0, format, gl.RGBA, gl.UNSIGNED_BYTE, uniform.value.baseTexture.source);
    -        }
    -
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter);
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter);
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrapS);
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT);
    -    }
    -
    -    gl.uniform1i(uniform.uniformLocation, this.textureCount);
    -
    -    uniform._init = true;
    -
    -    this.textureCount++;
    -
    -};
    -
    -/**
    -* Updates the shader uniform values.
    -*
    -* @method syncUniforms
    -*/
    -PIXI.PixiShader.prototype.syncUniforms = function()
    -{
    -    this.textureCount = 1;
    -    var uniform;
    -    var gl = this.gl;
    -
    -    //  This would probably be faster in an array and it would guarantee key order
    -    for (var key in this.uniforms)
    -    {
    -        uniform = this.uniforms[key];
    -
    -        if (uniform.glValueLength === 1)
    -        {
    -            if (uniform.glMatrix === true)
    -            {
    -                uniform.glFunc.call(gl, uniform.uniformLocation, uniform.transpose, uniform.value);
    -            }
    -            else
    -            {
    -                uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value);
    -            }
    -        }
    -        else if (uniform.glValueLength === 2)
    -        {
    -            uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y);
    -        }
    -        else if (uniform.glValueLength === 3)
    -        {
    -            uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z);
    -        }
    -        else if (uniform.glValueLength === 4)
    -        {
    -            uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z, uniform.value.w);
    -        }
    -        else if (uniform.type === 'sampler2D')
    -        {
    -            if (uniform._init)
    -            {
    -                gl.activeTexture(gl['TEXTURE' + this.textureCount]);
    -
    -                if(uniform.value.baseTexture._dirty[gl.id])
    -                {
    -                    PIXI.WebGLRenderer.instances[gl.id].updateTexture(uniform.value.baseTexture);
    -                }
    -                else
    -                {
    -                    // bind the current texture
    -                    gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]);
    -                }
    -
    -             //   gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id] || PIXI.createWebGLTexture( uniform.value.baseTexture, gl));
    -                gl.uniform1i(uniform.uniformLocation, this.textureCount);
    -                this.textureCount++;
    -            }
    -            else
    -            {
    -                this.initSampler2D(uniform);
    -            }
    -        }
    -    }
    -
    -};
    -
    -/**
    -* Destroys the shader.
    -*
    -* @method destroy
    -*/
    -PIXI.PixiShader.prototype.destroy = function()
    -{
    -    this.gl.deleteProgram( this.program );
    -    this.uniforms = null;
    -    this.gl = null;
    -
    -    this.attributes = null;
    -};
    -
    -/**
    -* The Default Vertex shader source.
    -*
    -* @property defaultVertexSrc
    -* @type String
    -*/
    -PIXI.PixiShader.defaultVertexSrc = [
    -    'attribute vec2 aVertexPosition;',
    -    'attribute vec2 aTextureCoord;',
    -    'attribute vec4 aColor;',
    -
    -    'uniform vec2 projectionVector;',
    -    'uniform vec2 offsetVector;',
    -
    -    'varying vec2 vTextureCoord;',
    -    'varying vec4 vColor;',
    -
    -    'const vec2 center = vec2(-1.0, 1.0);',
    -
    -    'void main(void) {',
    -    '   gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);',
    -    '   vTextureCoord = aTextureCoord;',
    -    '   vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;',
    -    '   vColor = vec4(color * aColor.x, aColor.x);',
    -    '}'
    -];
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PrimitiveShader.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PrimitiveShader.js.html deleted file mode 100755 index de2db53..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PrimitiveShader.js.html +++ /dev/null @@ -1,393 +0,0 @@ - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/shaders/PrimitiveShader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class PrimitiveShader
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.PrimitiveShader = function(gl)
    -{
    -    /**
    -     * @property _UID
    -     * @type Number
    -     * @private
    -     */
    -    this._UID = PIXI._UID++;
    - 
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    /**
    -     * The WebGL program.
    -     * @property program
    -     * @type {Any}
    -     */
    -    this.program = null;
    -
    -    /**
    -     * The fragment shader.
    -     * @property fragmentSrc
    -     * @type Array
    -     */
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec4 vColor;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = vColor;',
    -        '}'
    -    ];
    -
    -    /**
    -     * The vertex shader.
    -     * @property vertexSrc
    -     * @type Array
    -     */
    -    this.vertexSrc  = [
    -        'attribute vec2 aVertexPosition;',
    -        'attribute vec4 aColor;',
    -        'uniform mat3 translationMatrix;',
    -        'uniform vec2 projectionVector;',
    -        'uniform vec2 offsetVector;',
    -        'uniform float alpha;',
    -        'uniform vec3 tint;',
    -        'varying vec4 vColor;',
    -
    -        'void main(void) {',
    -        '   vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);',
    -        '   v -= offsetVector.xyx;',
    -        '   gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);',
    -        '   vColor = aColor * vec4(tint * alpha, alpha);',
    -        '}'
    -    ];
    -
    -    this.init();
    -};
    -
    -PIXI.PrimitiveShader.prototype.constructor = PIXI.PrimitiveShader;
    -
    -/**
    -* Initialises the shader.
    -* 
    -* @method init
    -*/
    -PIXI.PrimitiveShader.prototype.init = function()
    -{
    -    var gl = this.gl;
    -
    -    var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc);
    -    gl.useProgram(program);
    -
    -    // get and store the uniforms for the shader
    -    this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
    -    this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
    -    this.tintColor = gl.getUniformLocation(program, 'tint');
    -
    -    // get and store the attributes
    -    this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
    -    this.colorAttribute = gl.getAttribLocation(program, 'aColor');
    -
    -    this.attributes = [this.aVertexPosition, this.colorAttribute];
    -
    -    this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix');
    -    this.alpha = gl.getUniformLocation(program, 'alpha');
    -
    -    this.program = program;
    -};
    -
    -/**
    -* Destroys the shader.
    -* 
    -* @method destroy
    -*/
    -PIXI.PrimitiveShader.prototype.destroy = function()
    -{
    -    this.gl.deleteProgram( this.program );
    -    this.uniforms = null;
    -    this.gl = null;
    -
    -    this.attributes = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_StripShader.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_StripShader.js.html deleted file mode 100755 index 39bc977..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_StripShader.js.html +++ /dev/null @@ -1,401 +0,0 @@ - - - - - src/pixi/renderers/webgl/shaders/StripShader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/shaders/StripShader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class StripShader
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.StripShader = function(gl)
    -{
    -    /**
    -     * @property _UID
    -     * @type Number
    -     * @private
    -     */
    -    this._UID = PIXI._UID++;
    -    
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    /**
    -     * The WebGL program.
    -     * @property program
    -     * @type {Any}
    -     */
    -    this.program = null;
    -
    -    /**
    -     * The fragment shader.
    -     * @property fragmentSrc
    -     * @type Array
    -     */
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -     //   'varying float vColor;',
    -        'uniform float alpha;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * alpha;',
    -      //  '   gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);',//gl_FragColor * alpha;',
    -        '}'
    -    ];
    -
    -    /**
    -     * The vertex shader.
    -     * @property vertexSrc
    -     * @type Array
    -     */
    -    this.vertexSrc  = [
    -        'attribute vec2 aVertexPosition;',
    -        'attribute vec2 aTextureCoord;',
    -        'uniform mat3 translationMatrix;',
    -        'uniform vec2 projectionVector;',
    -        'uniform vec2 offsetVector;',
    -      //  'uniform float alpha;',
    -       // 'uniform vec3 tint;',
    -        'varying vec2 vTextureCoord;',
    -      //  'varying vec4 vColor;',
    -
    -        'void main(void) {',
    -        '   vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);',
    -        '   v -= offsetVector.xyx;',
    -        '   gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);',
    -        '   vTextureCoord = aTextureCoord;',
    -       // '   vColor = aColor * vec4(tint * alpha, alpha);',
    -        '}'
    -    ];
    -
    -    this.init();
    -};
    -
    -PIXI.StripShader.prototype.constructor = PIXI.StripShader;
    -
    -/**
    -* Initialises the shader.
    -* 
    -* @method init
    -*/
    -PIXI.StripShader.prototype.init = function()
    -{
    -    var gl = this.gl;
    -
    -    var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc);
    -    gl.useProgram(program);
    -
    -    // get and store the uniforms for the shader
    -    this.uSampler = gl.getUniformLocation(program, 'uSampler');
    -    this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
    -    this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
    -    this.colorAttribute = gl.getAttribLocation(program, 'aColor');
    -    //this.dimensions = gl.getUniformLocation(this.program, 'dimensions');
    -
    -    // get and store the attributes
    -    this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
    -    this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord');
    -
    -    this.attributes = [this.aVertexPosition, this.aTextureCoord];
    -
    -    this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix');
    -    this.alpha = gl.getUniformLocation(program, 'alpha');
    -
    -    this.program = program;
    -};
    -
    -/**
    -* Destroys the shader.
    -* 
    -* @method destroy
    -*/
    -PIXI.StripShader.prototype.destroy = function()
    -{
    -    this.gl.deleteProgram( this.program );
    -    this.uniforms = null;
    -    this.gl = null;
    -
    -    this.attribute = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_FilterTexture.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_FilterTexture.js.html deleted file mode 100755 index f1ce334..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_FilterTexture.js.html +++ /dev/null @@ -1,388 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/FilterTexture.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class FilterTexture
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -* @param width {Number} the horizontal range of the filter
    -* @param height {Number} the vertical range of the filter
    -* @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    -*/
    -PIXI.FilterTexture = function(gl, width, height, scaleMode)
    -{
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    // next time to create a frame buffer and texture
    -
    -    /**
    -     * @property frameBuffer
    -     * @type Any
    -     */
    -    this.frameBuffer = gl.createFramebuffer();
    -
    -    /**
    -     * @property texture
    -     * @type Any
    -     */
    -    this.texture = gl.createTexture();
    -
    -    /**
    -     * @property scaleMode
    -     * @type Number
    -     */
    -    scaleMode = scaleMode || PIXI.scaleModes.DEFAULT;
    -
    -    gl.bindTexture(gl.TEXTURE_2D,  this.texture);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer );
    -
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer );
    -    gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0);
    -
    -    // required for masking a mask??
    -    this.renderBuffer = gl.createRenderbuffer();
    -    gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer);
    -    gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.renderBuffer);
    -  
    -    this.resize(width, height);
    -};
    -
    -PIXI.FilterTexture.prototype.constructor = PIXI.FilterTexture;
    -
    -/**
    -* Clears the filter texture.
    -* 
    -* @method clear
    -*/
    -PIXI.FilterTexture.prototype.clear = function()
    -{
    -    var gl = this.gl;
    -    
    -    gl.clearColor(0,0,0, 0);
    -    gl.clear(gl.COLOR_BUFFER_BIT);
    -};
    -
    -/**
    - * Resizes the texture to the specified width and height
    - *
    - * @method resize
    - * @param width {Number} the new width of the texture
    - * @param height {Number} the new height of the texture
    - */
    -PIXI.FilterTexture.prototype.resize = function(width, height)
    -{
    -    if(this.width === width && this.height === height) return;
    -
    -    this.width = width;
    -    this.height = height;
    -
    -    var gl = this.gl;
    -
    -    gl.bindTexture(gl.TEXTURE_2D,  this.texture);
    -    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA,  width , height , 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
    -    // update the stencil buffer width and height
    -    gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer);
    -    gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width , height );
    -};
    -
    -/**
    -* Destroys the filter texture.
    -* 
    -* @method destroy
    -*/
    -PIXI.FilterTexture.prototype.destroy = function()
    -{
    -    var gl = this.gl;
    -    gl.deleteFramebuffer( this.frameBuffer );
    -    gl.deleteTexture( this.texture );
    -
    -    this.frameBuffer = null;
    -    this.texture = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLBlendModeManager.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLBlendModeManager.js.html deleted file mode 100755 index f2bd028..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLBlendModeManager.js.html +++ /dev/null @@ -1,336 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class WebGLBlendModeManager
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLBlendModeManager = function()
    -{
    -    /**
    -     * @property currentBlendMode
    -     * @type Number
    -     */
    -    this.currentBlendMode = 99999;
    -};
    -
    -PIXI.WebGLBlendModeManager.prototype.constructor = PIXI.WebGLBlendModeManager;
    -
    -/**
    - * Sets the WebGL Context.
    - *
    - * @method setContext
    - * @param gl {WebGLContext} the current WebGL drawing context
    - */
    -PIXI.WebGLBlendModeManager.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -};
    -
    -/**
    -* Sets-up the given blendMode from WebGL's point of view.
    -* 
    -* @method setBlendMode 
    -* @param blendMode {Number} the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD
    -*/
    -PIXI.WebGLBlendModeManager.prototype.setBlendMode = function(blendMode)
    -{
    -    if(this.currentBlendMode === blendMode)return false;
    -
    -    this.currentBlendMode = blendMode;
    -    
    -    var blendModeWebGL = PIXI.blendModesWebGL[this.currentBlendMode];
    -    this.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]);
    -    
    -    return true;
    -};
    -
    -/**
    -* Destroys this object.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLBlendModeManager.prototype.destroy = function()
    -{
    -    this.gl = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFastSpriteBatch.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFastSpriteBatch.js.html deleted file mode 100755 index 4a22a54..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFastSpriteBatch.js.html +++ /dev/null @@ -1,706 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js

    - -
    -
    -/**
    - * @author Mat Groves
    - * 
    - * Big thanks to the very clever Matt DesLauriers <mattdesl> https://github.com/mattdesl/
    - * for creating the original pixi version!
    - *
    - * Heavily inspired by LibGDX's WebGLSpriteBatch:
    - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java
    - */
    -
    -/**
    -* @class WebGLFastSpriteBatch
    -* @constructor
    -*/
    -PIXI.WebGLFastSpriteBatch = function(gl)
    -{
    -    /**
    -     * @property vertSize
    -     * @type Number
    -     */
    -    this.vertSize = 10;
    -
    -    /**
    -     * @property maxSize
    -     * @type Number
    -     */
    -    this.maxSize = 6000;//Math.pow(2, 16) /  this.vertSize;
    -
    -    /**
    -     * @property size
    -     * @type Number
    -     */
    -    this.size = this.maxSize;
    -
    -    //the total number of floats in our batch
    -    var numVerts = this.size * 4 *  this.vertSize;
    -
    -    //the total number of indices in our batch
    -    var numIndices = this.maxSize * 6;
    -
    -    /**
    -     * Vertex data
    -     * @property vertices
    -     * @type Float32Array
    -     */
    -    this.vertices = new PIXI.Float32Array(numVerts);
    -
    -    /**
    -     * Index data
    -     * @property indices
    -     * @type Uint16Array
    -     */
    -    this.indices = new PIXI.Uint16Array(numIndices);
    -    
    -    /**
    -     * @property vertexBuffer
    -     * @type Object
    -     */
    -    this.vertexBuffer = null;
    -
    -    /**
    -     * @property indexBuffer
    -     * @type Object
    -     */
    -    this.indexBuffer = null;
    -
    -    /**
    -     * @property lastIndexCount
    -     * @type Number
    -     */
    -    this.lastIndexCount = 0;
    -
    -    for (var i=0, j=0; i < numIndices; i += 6, j += 4)
    -    {
    -        this.indices[i + 0] = j + 0;
    -        this.indices[i + 1] = j + 1;
    -        this.indices[i + 2] = j + 2;
    -        this.indices[i + 3] = j + 0;
    -        this.indices[i + 4] = j + 2;
    -        this.indices[i + 5] = j + 3;
    -    }
    -
    -    /**
    -     * @property drawing
    -     * @type Boolean
    -     */
    -    this.drawing = false;
    -
    -    /**
    -     * @property currentBatchSize
    -     * @type Number
    -     */
    -    this.currentBatchSize = 0;
    -
    -    /**
    -     * @property currentBaseTexture
    -     * @type BaseTexture
    -     */
    -    this.currentBaseTexture = null;
    -   
    -    /**
    -     * @property currentBlendMode
    -     * @type Number
    -     */
    -    this.currentBlendMode = 0;
    -
    -    /**
    -     * @property renderSession
    -     * @type Object
    -     */
    -    this.renderSession = null;
    -    
    -    /**
    -     * @property shader
    -     * @type Object
    -     */
    -    this.shader = null;
    -
    -    /**
    -     * @property matrix
    -     * @type Matrix
    -     */
    -    this.matrix = null;
    -
    -    this.setContext(gl);
    -};
    -
    -PIXI.WebGLFastSpriteBatch.prototype.constructor = PIXI.WebGLFastSpriteBatch;
    -
    -/**
    - * Sets the WebGL Context.
    - *
    - * @method setContext
    - * @param gl {WebGLContext} the current WebGL drawing context
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -
    -    // create a couple of buffers
    -    this.vertexBuffer = gl.createBuffer();
    -    this.indexBuffer = gl.createBuffer();
    -
    -    // 65535 is max index, so 65535 / 6 = 10922.
    -
    -    //upload the index data
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW);
    -};
    -
    -/**
    - * @method begin
    - * @param spriteBatch {WebGLSpriteBatch}
    - * @param renderSession {Object}
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.begin = function(spriteBatch, renderSession)
    -{
    -    this.renderSession = renderSession;
    -    this.shader = this.renderSession.shaderManager.fastShader;
    -
    -    this.matrix = spriteBatch.worldTransform.toArray(true);
    -
    -    this.start();
    -};
    -
    -/**
    - * @method end
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.end = function()
    -{
    -    this.flush();
    -};
    -
    -/**
    - * @method render
    - * @param spriteBatch {WebGLSpriteBatch}
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.render = function(spriteBatch)
    -{
    -    var children = spriteBatch.children;
    -    var sprite = children[0];
    -
    -    // if the uvs have not updated then no point rendering just yet!
    -    
    -    // check texture.
    -    if(!sprite.texture._uvs)return;
    -   
    -    this.currentBaseTexture = sprite.texture.baseTexture;
    -    
    -    // check blend mode
    -    if(sprite.blendMode !== this.renderSession.blendModeManager.currentBlendMode)
    -    {
    -        this.flush();
    -        this.renderSession.blendModeManager.setBlendMode(sprite.blendMode);
    -    }
    -    
    -    for(var i=0,j= children.length; i<j; i++)
    -    {
    -        this.renderSprite(children[i]);
    -    }
    -
    -    this.flush();
    -};
    -
    -/**
    - * @method renderSprite
    - * @param sprite {Sprite}
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.renderSprite = function(sprite)
    -{
    -    //sprite = children[i];
    -    if(!sprite.visible)return;
    -    
    -    // TODO trim??
    -    if(sprite.texture.baseTexture !== this.currentBaseTexture)
    -    {
    -        this.flush();
    -        this.currentBaseTexture = sprite.texture.baseTexture;
    -        
    -        if(!sprite.texture._uvs)return;
    -    }
    -
    -    var uvs, verticies = this.vertices, width, height, w0, w1, h0, h1, index;
    -
    -    uvs = sprite.texture._uvs;
    -
    -    width = sprite.texture.frame.width;
    -    height = sprite.texture.frame.height;
    -
    -    if (sprite.texture.trim)
    -    {
    -        // if the sprite is trimmed then we need to add the extra space before transforming the sprite coords..
    -        var trim = sprite.texture.trim;
    -
    -        w1 = trim.x - sprite.anchor.x * trim.width;
    -        w0 = w1 + sprite.texture.crop.width;
    -
    -        h1 = trim.y - sprite.anchor.y * trim.height;
    -        h0 = h1 + sprite.texture.crop.height;
    -    }
    -    else
    -    {
    -        w0 = (sprite.texture.frame.width ) * (1-sprite.anchor.x);
    -        w1 = (sprite.texture.frame.width ) * -sprite.anchor.x;
    -
    -        h0 = sprite.texture.frame.height * (1-sprite.anchor.y);
    -        h1 = sprite.texture.frame.height * -sprite.anchor.y;
    -    }
    -
    -    index = this.currentBatchSize * 4 * this.vertSize;
    -
    -    // xy
    -    verticies[index++] = w1;
    -    verticies[index++] = h1;
    -
    -    verticies[index++] = sprite.position.x;
    -    verticies[index++] = sprite.position.y;
    -
    -    //scale
    -    verticies[index++] = sprite.scale.x;
    -    verticies[index++] = sprite.scale.y;
    -
    -    //rotation
    -    verticies[index++] = sprite.rotation;
    -
    -    // uv
    -    verticies[index++] = uvs.x0;
    -    verticies[index++] = uvs.y1;
    -    // color
    -    verticies[index++] = sprite.alpha;
    - 
    -
    -    // xy
    -    verticies[index++] = w0;
    -    verticies[index++] = h1;
    -
    -    verticies[index++] = sprite.position.x;
    -    verticies[index++] = sprite.position.y;
    -
    -    //scale
    -    verticies[index++] = sprite.scale.x;
    -    verticies[index++] = sprite.scale.y;
    -
    -     //rotation
    -    verticies[index++] = sprite.rotation;
    -
    -    // uv
    -    verticies[index++] = uvs.x1;
    -    verticies[index++] = uvs.y1;
    -    // color
    -    verticies[index++] = sprite.alpha;
    -  
    -
    -    // xy
    -    verticies[index++] = w0;
    -    verticies[index++] = h0;
    -
    -    verticies[index++] = sprite.position.x;
    -    verticies[index++] = sprite.position.y;
    -
    -    //scale
    -    verticies[index++] = sprite.scale.x;
    -    verticies[index++] = sprite.scale.y;
    -
    -     //rotation
    -    verticies[index++] = sprite.rotation;
    -
    -    // uv
    -    verticies[index++] = uvs.x2;
    -    verticies[index++] = uvs.y2;
    -    // color
    -    verticies[index++] = sprite.alpha;
    - 
    -
    -
    -
    -    // xy
    -    verticies[index++] = w1;
    -    verticies[index++] = h0;
    -
    -    verticies[index++] = sprite.position.x;
    -    verticies[index++] = sprite.position.y;
    -
    -    //scale
    -    verticies[index++] = sprite.scale.x;
    -    verticies[index++] = sprite.scale.y;
    -
    -     //rotation
    -    verticies[index++] = sprite.rotation;
    -
    -    // uv
    -    verticies[index++] = uvs.x3;
    -    verticies[index++] = uvs.y3;
    -    // color
    -    verticies[index++] = sprite.alpha;
    -
    -    // increment the batchs
    -    this.currentBatchSize++;
    -
    -    if(this.currentBatchSize >= this.size)
    -    {
    -        this.flush();
    -    }
    -};
    -
    -/**
    - * @method flush
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.flush = function()
    -{
    -    // If the batch is length 0 then return as there is nothing to draw
    -    if (this.currentBatchSize===0)return;
    -
    -    var gl = this.gl;
    -    
    -    // bind the current texture
    -
    -    if(!this.currentBaseTexture._glTextures[gl.id])this.renderSession.renderer.updateTexture(this.currentBaseTexture, gl);
    -
    -    gl.bindTexture(gl.TEXTURE_2D, this.currentBaseTexture._glTextures[gl.id]);
    -
    -    // upload the verts to the buffer
    -   
    -    if(this.currentBatchSize > ( this.size * 0.5 ) )
    -    {
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices);
    -    }
    -    else
    -    {
    -        var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize);
    -
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, view);
    -    }
    -    
    -    // now draw those suckas!
    -    gl.drawElements(gl.TRIANGLES, this.currentBatchSize * 6, gl.UNSIGNED_SHORT, 0);
    -   
    -    // then reset the batch!
    -    this.currentBatchSize = 0;
    -
    -    // increment the draw count
    -    this.renderSession.drawCount++;
    -};
    -
    -
    -/**
    - * @method stop
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.stop = function()
    -{
    -    this.flush();
    -};
    -
    -/**
    - * @method start
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.start = function()
    -{
    -    var gl = this.gl;
    -
    -    // bind the main texture
    -    gl.activeTexture(gl.TEXTURE0);
    -
    -    // bind the buffers
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -
    -    // set the projection
    -    var projection = this.renderSession.projection;
    -    gl.uniform2f(this.shader.projectionVector, projection.x, projection.y);
    -
    -    // set the matrix
    -    gl.uniformMatrix3fv(this.shader.uMatrix, false, this.matrix);
    -
    -    // set the pointers
    -    var stride =  this.vertSize * 4;
    -
    -    gl.vertexAttribPointer(this.shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0);
    -    gl.vertexAttribPointer(this.shader.aPositionCoord, 2, gl.FLOAT, false, stride, 2 * 4);
    -    gl.vertexAttribPointer(this.shader.aScale, 2, gl.FLOAT, false, stride, 4 * 4);
    -    gl.vertexAttribPointer(this.shader.aRotation, 1, gl.FLOAT, false, stride, 6 * 4);
    -    gl.vertexAttribPointer(this.shader.aTextureCoord, 2, gl.FLOAT, false, stride, 7 * 4);
    -    gl.vertexAttribPointer(this.shader.colorAttribute, 1, gl.FLOAT, false, stride, 9 * 4);
    -    
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFilterManager.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFilterManager.js.html deleted file mode 100755 index 389585a..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFilterManager.js.html +++ /dev/null @@ -1,728 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLFilterManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class WebGLFilterManager
    -* @constructor
    -*/
    -PIXI.WebGLFilterManager = function()
    -{
    -    /**
    -     * @property filterStack
    -     * @type Array
    -     */
    -    this.filterStack = [];
    -    
    -    /**
    -     * @property offsetX
    -     * @type Number
    -     */
    -    this.offsetX = 0;
    -
    -    /**
    -     * @property offsetY
    -     * @type Number
    -     */
    -    this.offsetY = 0;
    -};
    -
    -PIXI.WebGLFilterManager.prototype.constructor = PIXI.WebGLFilterManager;
    -
    -/**
    -* Initialises the context and the properties.
    -* 
    -* @method setContext 
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLFilterManager.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -    this.texturePool = [];
    -
    -    this.initShaderBuffers();
    -};
    -
    -/**
    -* @method begin
    -* @param renderSession {RenderSession} 
    -* @param buffer {ArrayBuffer} 
    -*/
    -PIXI.WebGLFilterManager.prototype.begin = function(renderSession, buffer)
    -{
    -    this.renderSession = renderSession;
    -    this.defaultShader = renderSession.shaderManager.defaultShader;
    -
    -    var projection = this.renderSession.projection;
    -    this.width = projection.x * 2;
    -    this.height = -projection.y * 2;
    -    this.buffer = buffer;
    -};
    -
    -/**
    -* Applies the filter and adds it to the current filter stack.
    -* 
    -* @method pushFilter
    -* @param filterBlock {Object} the filter that will be pushed to the current filter stack
    -*/
    -PIXI.WebGLFilterManager.prototype.pushFilter = function(filterBlock)
    -{
    -    var gl = this.gl;
    -
    -    var projection = this.renderSession.projection;
    -    var offset = this.renderSession.offset;
    -
    -    filterBlock._filterArea = filterBlock.target.filterArea || filterBlock.target.getBounds();
    -
    -    // filter program
    -    // OPTIMISATION - the first filter is free if its a simple color change?
    -    this.filterStack.push(filterBlock);
    -
    -    var filter = filterBlock.filterPasses[0];
    -
    -    this.offsetX += filterBlock._filterArea.x;
    -    this.offsetY += filterBlock._filterArea.y;
    -
    -    var texture = this.texturePool.pop();
    -    if(!texture)
    -    {
    -        texture = new PIXI.FilterTexture(this.gl, this.width, this.height);
    -    }
    -    else
    -    {
    -        texture.resize(this.width, this.height);
    -    }
    -
    -    gl.bindTexture(gl.TEXTURE_2D,  texture.texture);
    -
    -    var filterArea = filterBlock._filterArea;// filterBlock.target.getBounds();///filterBlock.target.filterArea;
    -
    -    var padding = filter.padding;
    -    filterArea.x -= padding;
    -    filterArea.y -= padding;
    -    filterArea.width += padding * 2;
    -    filterArea.height += padding * 2;
    -
    -    // cap filter to screen size..
    -    if(filterArea.x < 0)filterArea.x = 0;
    -    if(filterArea.width > this.width)filterArea.width = this.width;
    -    if(filterArea.y < 0)filterArea.y = 0;
    -    if(filterArea.height > this.height)filterArea.height = this.height;
    -
    -    //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA,  filterArea.width, filterArea.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, texture.frameBuffer);
    -
    -    // set view port
    -    gl.viewport(0, 0, filterArea.width, filterArea.height);
    -
    -    projection.x = filterArea.width/2;
    -    projection.y = -filterArea.height/2;
    -
    -    offset.x = -filterArea.x;
    -    offset.y = -filterArea.y;
    -
    -    // update projection
    -    // now restore the regular shader..
    -    // this.renderSession.shaderManager.setShader(this.defaultShader);
    -    //gl.uniform2f(this.defaultShader.projectionVector, filterArea.width/2, -filterArea.height/2);
    -    //gl.uniform2f(this.defaultShader.offsetVector, -filterArea.x, -filterArea.y);
    -
    -    gl.colorMask(true, true, true, true);
    -    gl.clearColor(0,0,0, 0);
    -    gl.clear(gl.COLOR_BUFFER_BIT);
    -
    -    filterBlock._glFilterTexture = texture;
    -
    -};
    -
    -/**
    -* Removes the last filter from the filter stack and doesn't return it.
    -* 
    -* @method popFilter
    -*/
    -PIXI.WebGLFilterManager.prototype.popFilter = function()
    -{
    -    var gl = this.gl;
    -    var filterBlock = this.filterStack.pop();
    -    var filterArea = filterBlock._filterArea;
    -    var texture = filterBlock._glFilterTexture;
    -    var projection = this.renderSession.projection;
    -    var offset = this.renderSession.offset;
    -
    -    if(filterBlock.filterPasses.length > 1)
    -    {
    -        gl.viewport(0, 0, filterArea.width, filterArea.height);
    -
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -
    -        this.vertexArray[0] = 0;
    -        this.vertexArray[1] = filterArea.height;
    -
    -        this.vertexArray[2] = filterArea.width;
    -        this.vertexArray[3] = filterArea.height;
    -
    -        this.vertexArray[4] = 0;
    -        this.vertexArray[5] = 0;
    -
    -        this.vertexArray[6] = filterArea.width;
    -        this.vertexArray[7] = 0;
    -
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray);
    -
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    -        // now set the uvs..
    -        this.uvArray[2] = filterArea.width/this.width;
    -        this.uvArray[5] = filterArea.height/this.height;
    -        this.uvArray[6] = filterArea.width/this.width;
    -        this.uvArray[7] = filterArea.height/this.height;
    -
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray);
    -
    -        var inputTexture = texture;
    -        var outputTexture = this.texturePool.pop();
    -        if(!outputTexture)outputTexture = new PIXI.FilterTexture(this.gl, this.width, this.height);
    -        outputTexture.resize(this.width, this.height);
    -
    -        // need to clear this FBO as it may have some left over elements from a previous filter.
    -        gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer );
    -        gl.clear(gl.COLOR_BUFFER_BIT);
    -
    -        gl.disable(gl.BLEND);
    -
    -        for (var i = 0; i < filterBlock.filterPasses.length-1; i++)
    -        {
    -            var filterPass = filterBlock.filterPasses[i];
    -
    -            gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer );
    -
    -            // set texture
    -            gl.activeTexture(gl.TEXTURE0);
    -            gl.bindTexture(gl.TEXTURE_2D, inputTexture.texture);
    -
    -            // draw texture..
    -            //filterPass.applyFilterPass(filterArea.width, filterArea.height);
    -            this.applyFilterPass(filterPass, filterArea, filterArea.width, filterArea.height);
    -
    -            // swap the textures..
    -            var temp = inputTexture;
    -            inputTexture = outputTexture;
    -            outputTexture = temp;
    -        }
    -
    -        gl.enable(gl.BLEND);
    -
    -        texture = inputTexture;
    -        this.texturePool.push(outputTexture);
    -    }
    -
    -    var filter = filterBlock.filterPasses[filterBlock.filterPasses.length-1];
    -
    -    this.offsetX -= filterArea.x;
    -    this.offsetY -= filterArea.y;
    -
    -    var sizeX = this.width;
    -    var sizeY = this.height;
    -
    -    var offsetX = 0;
    -    var offsetY = 0;
    -
    -    var buffer = this.buffer;
    -
    -    // time to render the filters texture to the previous scene
    -    if(this.filterStack.length === 0)
    -    {
    -        gl.colorMask(true, true, true, true);//this.transparent);
    -    }
    -    else
    -    {
    -        var currentFilter = this.filterStack[this.filterStack.length-1];
    -        filterArea = currentFilter._filterArea;
    -
    -        sizeX = filterArea.width;
    -        sizeY = filterArea.height;
    -
    -        offsetX = filterArea.x;
    -        offsetY = filterArea.y;
    -
    -        buffer =  currentFilter._glFilterTexture.frameBuffer;
    -    }
    -
    -    // TODO need to remove these global elements..
    -    projection.x = sizeX/2;
    -    projection.y = -sizeY/2;
    -
    -    offset.x = offsetX;
    -    offset.y = offsetY;
    -
    -    filterArea = filterBlock._filterArea;
    -
    -    var x = filterArea.x-offsetX;
    -    var y = filterArea.y-offsetY;
    -
    -    // update the buffers..
    -    // make sure to flip the y!
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -
    -    this.vertexArray[0] = x;
    -    this.vertexArray[1] = y + filterArea.height;
    -
    -    this.vertexArray[2] = x + filterArea.width;
    -    this.vertexArray[3] = y + filterArea.height;
    -
    -    this.vertexArray[4] = x;
    -    this.vertexArray[5] = y;
    -
    -    this.vertexArray[6] = x + filterArea.width;
    -    this.vertexArray[7] = y;
    -
    -    gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    -
    -    this.uvArray[2] = filterArea.width/this.width;
    -    this.uvArray[5] = filterArea.height/this.height;
    -    this.uvArray[6] = filterArea.width/this.width;
    -    this.uvArray[7] = filterArea.height/this.height;
    -
    -    gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray);
    -
    -    gl.viewport(0, 0, sizeX, sizeY);
    -
    -    // bind the buffer
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, buffer );
    -
    -    // set the blend mode! 
    -    //gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA)
    -
    -    // set texture
    -    gl.activeTexture(gl.TEXTURE0);
    -    gl.bindTexture(gl.TEXTURE_2D, texture.texture);
    -
    -    // apply!
    -    this.applyFilterPass(filter, filterArea, sizeX, sizeY);
    -
    -    // now restore the regular shader.. should happen automatically now..
    -    // this.renderSession.shaderManager.setShader(this.defaultShader);
    -    // gl.uniform2f(this.defaultShader.projectionVector, sizeX/2, -sizeY/2);
    -    // gl.uniform2f(this.defaultShader.offsetVector, -offsetX, -offsetY);
    -
    -    // return the texture to the pool
    -    this.texturePool.push(texture);
    -    filterBlock._glFilterTexture = null;
    -};
    -
    -
    -/**
    -* Applies the filter to the specified area.
    -* 
    -* @method applyFilterPass
    -* @param filter {AbstractFilter} the filter that needs to be applied
    -* @param filterArea {Texture} TODO - might need an update
    -* @param width {Number} the horizontal range of the filter
    -* @param height {Number} the vertical range of the filter
    -*/
    -PIXI.WebGLFilterManager.prototype.applyFilterPass = function(filter, filterArea, width, height)
    -{
    -    // use program
    -    var gl = this.gl;
    -    var shader = filter.shaders[gl.id];
    -
    -    if(!shader)
    -    {
    -        shader = new PIXI.PixiShader(gl);
    -
    -        shader.fragmentSrc = filter.fragmentSrc;
    -        shader.uniforms = filter.uniforms;
    -        shader.init();
    -
    -        filter.shaders[gl.id] = shader;
    -    }
    -
    -    // set the shader
    -    this.renderSession.shaderManager.setShader(shader);
    -
    -//    gl.useProgram(shader.program);
    -
    -    gl.uniform2f(shader.projectionVector, width/2, -height/2);
    -    gl.uniform2f(shader.offsetVector, 0,0);
    -
    -    if(filter.uniforms.dimensions)
    -    {
    -        filter.uniforms.dimensions.value[0] = this.width;//width;
    -        filter.uniforms.dimensions.value[1] = this.height;//height;
    -        filter.uniforms.dimensions.value[2] = this.vertexArray[0];
    -        filter.uniforms.dimensions.value[3] = this.vertexArray[5];//filterArea.height;
    -    }
    -
    -    shader.syncUniforms();
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -    gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    -    gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    -    gl.vertexAttribPointer(shader.colorAttribute, 2, gl.FLOAT, false, 0, 0);
    -
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -
    -    // draw the filter...
    -    gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 );
    -
    -    this.renderSession.drawCount++;
    -};
    -
    -/**
    -* Initialises the shader buffers.
    -* 
    -* @method initShaderBuffers
    -*/
    -PIXI.WebGLFilterManager.prototype.initShaderBuffers = function()
    -{
    -    var gl = this.gl;
    -
    -    // create some buffers
    -    this.vertexBuffer = gl.createBuffer();
    -    this.uvBuffer = gl.createBuffer();
    -    this.colorBuffer = gl.createBuffer();
    -    this.indexBuffer = gl.createBuffer();
    -
    -    // bind and upload the vertexs..
    -    // keep a reference to the vertexFloatData..
    -    this.vertexArray = new PIXI.Float32Array([0.0, 0.0,
    -                                         1.0, 0.0,
    -                                         0.0, 1.0,
    -                                         1.0, 1.0]);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.vertexArray, gl.STATIC_DRAW);
    -
    -    // bind and upload the uv buffer
    -    this.uvArray = new PIXI.Float32Array([0.0, 0.0,
    -                                     1.0, 0.0,
    -                                     0.0, 1.0,
    -                                     1.0, 1.0]);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.uvArray, gl.STATIC_DRAW);
    -
    -    this.colorArray = new PIXI.Float32Array([1.0, 0xFFFFFF,
    -                                        1.0, 0xFFFFFF,
    -                                        1.0, 0xFFFFFF,
    -                                        1.0, 0xFFFFFF]);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.colorArray, gl.STATIC_DRAW);
    -
    -    // bind and upload the index
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 1, 3, 2]), gl.STATIC_DRAW);
    -
    -};
    -
    -/**
    -* Destroys the filter and removes it from the filter stack.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLFilterManager.prototype.destroy = function()
    -{
    -    var gl = this.gl;
    -
    -    this.filterStack = null;
    -    
    -    this.offsetX = 0;
    -    this.offsetY = 0;
    -
    -    // destroy textures
    -    for (var i = 0; i < this.texturePool.length; i++) {
    -        this.texturePool[i].destroy();
    -    }
    -    
    -    this.texturePool = null;
    -
    -    //destroy buffers..
    -    gl.deleteBuffer(this.vertexBuffer);
    -    gl.deleteBuffer(this.uvBuffer);
    -    gl.deleteBuffer(this.colorBuffer);
    -    gl.deleteBuffer(this.indexBuffer);
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLGraphics.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLGraphics.js.html deleted file mode 100755 index 121a416..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLGraphics.js.html +++ /dev/null @@ -1,1157 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLGraphics.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A set of functions used by the webGL renderer to draw the primitive graphics data
    - *
    - * @class WebGLGraphics
    - * @private
    - * @static
    - */
    -PIXI.WebGLGraphics = function()
    -{
    -};
    -
    -/**
    - * Renders the graphics object
    - *
    - * @static
    - * @private
    - * @method renderGraphics
    - * @param graphics {Graphics}
    - * @param renderSession {Object}
    - */
    -PIXI.WebGLGraphics.renderGraphics = function(graphics, renderSession)//projection, offset)
    -{
    -    var gl = renderSession.gl;
    -    var projection = renderSession.projection,
    -        offset = renderSession.offset,
    -        shader = renderSession.shaderManager.primitiveShader,
    -        webGLData;
    -
    -    if(graphics.dirty)
    -    {
    -        PIXI.WebGLGraphics.updateGraphics(graphics, gl);
    -    }
    -
    -    var webGL = graphics._webGL[gl.id];
    -
    -    // This  could be speeded up for sure!
    -
    -    for (var i = 0; i < webGL.data.length; i++)
    -    {
    -        if(webGL.data[i].mode === 1)
    -        {
    -            webGLData = webGL.data[i];
    -
    -            renderSession.stencilManager.pushStencil(graphics, webGLData, renderSession);
    -
    -            // render quad..
    -            gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 );
    -            
    -            renderSession.stencilManager.popStencil(graphics, webGLData, renderSession);
    -        }
    -        else
    -        {
    -            webGLData = webGL.data[i];
    -           
    -
    -            renderSession.shaderManager.setShader( shader );//activatePrimitiveShader();
    -            shader = renderSession.shaderManager.primitiveShader;
    -            gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true));
    -
    -            gl.uniform2f(shader.projectionVector, projection.x, -projection.y);
    -            gl.uniform2f(shader.offsetVector, -offset.x, -offset.y);
    -
    -            gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint));
    -
    -            gl.uniform1f(shader.alpha, graphics.worldAlpha);
    -            
    -
    -            gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer);
    -
    -            gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0);
    -            gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4);
    -
    -            // set the index buffer!
    -            gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer);
    -            gl.drawElements(gl.TRIANGLE_STRIP,  webGLData.indices.length, gl.UNSIGNED_SHORT, 0 );
    -        }
    -    }
    -};
    -
    -/**
    - * Updates the graphics object
    - *
    - * @static
    - * @private
    - * @method updateGraphics
    - * @param graphicsData {Graphics} The graphics object to update
    - * @param gl {WebGLContext} the current WebGL drawing context
    - */
    -PIXI.WebGLGraphics.updateGraphics = function(graphics, gl)
    -{
    -    // get the contexts graphics object
    -    var webGL = graphics._webGL[gl.id];
    -    // if the graphics object does not exist in the webGL context time to create it!
    -    if(!webGL)webGL = graphics._webGL[gl.id] = {lastIndex:0, data:[], gl:gl};
    -
    -    // flag the graphics as not dirty as we are about to update it...
    -    graphics.dirty = false;
    -
    -    var i;
    -
    -    // if the user cleared the graphics object we will need to clear every object
    -    if(graphics.clearDirty)
    -    {
    -        graphics.clearDirty = false;
    -
    -        // lop through and return all the webGLDatas to the object pool so than can be reused later on
    -        for (i = 0; i < webGL.data.length; i++)
    -        {
    -            var graphicsData = webGL.data[i];
    -            graphicsData.reset();
    -            PIXI.WebGLGraphics.graphicsDataPool.push( graphicsData );
    -        }
    -
    -        // clear the array and reset the index.. 
    -        webGL.data = [];
    -        webGL.lastIndex = 0;
    -    }
    -    
    -    var webGLData;
    -    
    -    // loop through the graphics datas and construct each one..
    -    // if the object is a complex fill then the new stencil buffer technique will be used
    -    // other wise graphics objects will be pushed into a batch..
    -    for (i = webGL.lastIndex; i < graphics.graphicsData.length; i++)
    -    {
    -        var data = graphics.graphicsData[i];
    -
    -        if(data.type === PIXI.Graphics.POLY)
    -        {
    -            // need to add the points the the graphics object..
    -            data.points = data.shape.points.slice();
    -            if(data.shape.closed)
    -            {
    -                // close the poly if the valu is true!
    -                if(data.points[0] !== data.points[data.points.length-2] && data.points[1] !== data.points[data.points.length-1])
    -                {
    -                    data.points.push(data.points[0], data.points[1]);
    -                }
    -            }
    -
    -            // MAKE SURE WE HAVE THE CORRECT TYPE..
    -            if(data.fill)
    -            {
    -                if(data.points.length >= 6)
    -                {
    -                    if(data.points.length > 5 * 2)
    -                    {
    -                        webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1);
    -                        PIXI.WebGLGraphics.buildComplexPoly(data, webGLData);
    -                    }
    -                    else
    -                    {
    -                        webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0);
    -                        PIXI.WebGLGraphics.buildPoly(data, webGLData);
    -                    }
    -                }
    -            }
    -
    -            if(data.lineWidth > 0)
    -            {
    -                webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0);
    -                PIXI.WebGLGraphics.buildLine(data, webGLData);
    -
    -            }
    -        }
    -        else
    -        {
    -            webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0);
    -            
    -            if(data.type === PIXI.Graphics.RECT)
    -            {
    -                PIXI.WebGLGraphics.buildRectangle(data, webGLData);
    -            }
    -            else if(data.type === PIXI.Graphics.CIRC || data.type === PIXI.Graphics.ELIP)
    -            {
    -                PIXI.WebGLGraphics.buildCircle(data, webGLData);
    -            }
    -            else if(data.type === PIXI.Graphics.RREC)
    -            {
    -                PIXI.WebGLGraphics.buildRoundedRectangle(data, webGLData);
    -            }
    -        }
    -
    -        webGL.lastIndex++;
    -    }
    -
    -    // upload all the dirty data...
    -    for (i = 0; i < webGL.data.length; i++)
    -    {
    -        webGLData = webGL.data[i];
    -        if(webGLData.dirty)webGLData.upload();
    -    }
    -};
    -
    -/**
    - * @static
    - * @private
    - * @method switchMode
    - * @param webGL {WebGLContext}
    - * @param type {Number}
    - */
    -PIXI.WebGLGraphics.switchMode = function(webGL, type)
    -{
    -    var webGLData;
    -
    -    if(!webGL.data.length)
    -    {
    -        webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl);
    -        webGLData.mode = type;
    -        webGL.data.push(webGLData);
    -    }
    -    else
    -    {
    -        webGLData = webGL.data[webGL.data.length-1];
    -
    -        if(webGLData.mode !== type || type === 1)
    -        {
    -            webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl);
    -            webGLData.mode = type;
    -            webGL.data.push(webGLData);
    -        }
    -    }
    -
    -    webGLData.dirty = true;
    -
    -    return webGLData;
    -};
    -
    -/**
    - * Builds a rectangle to draw
    - *
    - * @static
    - * @private
    - * @method buildRectangle
    - * @param graphicsData {Graphics} The graphics object containing all the necessary properties
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildRectangle = function(graphicsData, webGLData)
    -{
    -    // --- //
    -    // need to convert points to a nice regular data
    -    //
    -    var rectData = graphicsData.shape;
    -    var x = rectData.x;
    -    var y = rectData.y;
    -    var width = rectData.width;
    -    var height = rectData.height;
    -
    -    if(graphicsData.fill)
    -    {
    -        var color = PIXI.hex2rgb(graphicsData.fillColor);
    -        var alpha = graphicsData.fillAlpha;
    -
    -        var r = color[0] * alpha;
    -        var g = color[1] * alpha;
    -        var b = color[2] * alpha;
    -
    -        var verts = webGLData.points;
    -        var indices = webGLData.indices;
    -
    -        var vertPos = verts.length/6;
    -
    -        // start
    -        verts.push(x, y);
    -        verts.push(r, g, b, alpha);
    -
    -        verts.push(x + width, y);
    -        verts.push(r, g, b, alpha);
    -
    -        verts.push(x , y + height);
    -        verts.push(r, g, b, alpha);
    -
    -        verts.push(x + width, y + height);
    -        verts.push(r, g, b, alpha);
    -
    -        // insert 2 dead triangles..
    -        indices.push(vertPos, vertPos, vertPos+1, vertPos+2, vertPos+3, vertPos+3);
    -    }
    -
    -    if(graphicsData.lineWidth)
    -    {
    -        var tempPoints = graphicsData.points;
    -
    -        graphicsData.points = [x, y,
    -                  x + width, y,
    -                  x + width, y + height,
    -                  x, y + height,
    -                  x, y];
    -
    -
    -        PIXI.WebGLGraphics.buildLine(graphicsData, webGLData);
    -
    -        graphicsData.points = tempPoints;
    -    }
    -};
    -
    -/**
    - * Builds a rounded rectangle to draw
    - *
    - * @static
    - * @private
    - * @method buildRoundedRectangle
    - * @param graphicsData {Graphics} The graphics object containing all the necessary properties
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildRoundedRectangle = function(graphicsData, webGLData)
    -{
    -    var rrectData = graphicsData.shape;
    -    var x = rrectData.x;
    -    var y = rrectData.y;
    -    var width = rrectData.width;
    -    var height = rrectData.height;
    -
    -    var radius = rrectData.radius;
    -
    -    var recPoints = [];
    -    recPoints.push(x, y + radius);
    -    recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x, y + height - radius, x, y + height, x + radius, y + height));
    -    recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius));
    -    recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width, y + radius, x + width, y, x + width - radius, y));
    -    recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + radius, y, x, y, x, y + radius));
    -
    -    if (graphicsData.fill) {
    -        var color = PIXI.hex2rgb(graphicsData.fillColor);
    -        var alpha = graphicsData.fillAlpha;
    -
    -        var r = color[0] * alpha;
    -        var g = color[1] * alpha;
    -        var b = color[2] * alpha;
    -
    -        var verts = webGLData.points;
    -        var indices = webGLData.indices;
    -
    -        var vecPos = verts.length/6;
    -
    -        var triangles = PIXI.PolyK.Triangulate(recPoints);
    -
    -        var i = 0;
    -        for (i = 0; i < triangles.length; i+=3)
    -        {
    -            indices.push(triangles[i] + vecPos);
    -            indices.push(triangles[i] + vecPos);
    -            indices.push(triangles[i+1] + vecPos);
    -            indices.push(triangles[i+2] + vecPos);
    -            indices.push(triangles[i+2] + vecPos);
    -        }
    -
    -        for (i = 0; i < recPoints.length; i++)
    -        {
    -            verts.push(recPoints[i], recPoints[++i], r, g, b, alpha);
    -        }
    -    }
    -
    -    if (graphicsData.lineWidth) {
    -        var tempPoints = graphicsData.points;
    -
    -        graphicsData.points = recPoints;
    -
    -        PIXI.WebGLGraphics.buildLine(graphicsData, webGLData);
    -
    -        graphicsData.points = tempPoints;
    -    }
    -};
    -
    -/**
    - * Calculate the points for a quadratic bezier curve. (helper function..)
    - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c
    - *
    - * @static
    - * @private
    - * @method quadraticBezierCurve
    - * @param fromX {Number} Origin point x
    - * @param fromY {Number} Origin point x
    - * @param cpX {Number} Control point x
    - * @param cpY {Number} Control point y
    - * @param toX {Number} Destination point x
    - * @param toY {Number} Destination point y
    - * @return {Array<Number>}
    - */
    -PIXI.WebGLGraphics.quadraticBezierCurve = function(fromX, fromY, cpX, cpY, toX, toY) {
    -
    -    var xa,
    -        ya,
    -        xb,
    -        yb,
    -        x,
    -        y,
    -        n = 20,
    -        points = [];
    -
    -    function getPt(n1 , n2, perc) {
    -        var diff = n2 - n1;
    -
    -        return n1 + ( diff * perc );
    -    }
    -
    -    var j = 0;
    -    for (var i = 0; i <= n; i++ )
    -    {
    -        j = i / n;
    -
    -        // The Green Line
    -        xa = getPt( fromX , cpX , j );
    -        ya = getPt( fromY , cpY , j );
    -        xb = getPt( cpX , toX , j );
    -        yb = getPt( cpY , toY , j );
    -
    -        // The Black Dot
    -        x = getPt( xa , xb , j );
    -        y = getPt( ya , yb , j );
    -
    -        points.push(x, y);
    -    }
    -    return points;
    -};
    -
    -/**
    - * Builds a circle to draw
    - *
    - * @static
    - * @private
    - * @method buildCircle
    - * @param graphicsData {Graphics} The graphics object to draw
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildCircle = function(graphicsData, webGLData)
    -{
    -    // need to convert points to a nice regular data
    -    var circleData = graphicsData.shape;
    -    var x = circleData.x;
    -    var y = circleData.y;
    -    var width;
    -    var height;
    -    
    -    // TODO - bit hacky??
    -    if(graphicsData.type === PIXI.Graphics.CIRC)
    -    {
    -        width = circleData.radius;
    -        height = circleData.radius;
    -    }
    -    else
    -    {
    -        width = circleData.width;
    -        height = circleData.height;
    -    }
    -
    -    var totalSegs = 40;
    -    var seg = (Math.PI * 2) / totalSegs ;
    -
    -    var i = 0;
    -
    -    if(graphicsData.fill)
    -    {
    -        var color = PIXI.hex2rgb(graphicsData.fillColor);
    -        var alpha = graphicsData.fillAlpha;
    -
    -        var r = color[0] * alpha;
    -        var g = color[1] * alpha;
    -        var b = color[2] * alpha;
    -
    -        var verts = webGLData.points;
    -        var indices = webGLData.indices;
    -
    -        var vecPos = verts.length/6;
    -
    -        indices.push(vecPos);
    -
    -        for (i = 0; i < totalSegs + 1 ; i++)
    -        {
    -            verts.push(x,y, r, g, b, alpha);
    -
    -            verts.push(x + Math.sin(seg * i) * width,
    -                       y + Math.cos(seg * i) * height,
    -                       r, g, b, alpha);
    -
    -            indices.push(vecPos++, vecPos++);
    -        }
    -
    -        indices.push(vecPos-1);
    -    }
    -
    -    if(graphicsData.lineWidth)
    -    {
    -        var tempPoints = graphicsData.points;
    -
    -        graphicsData.points = [];
    -
    -        for (i = 0; i < totalSegs + 1; i++)
    -        {
    -            graphicsData.points.push(x + Math.sin(seg * i) * width,
    -                                     y + Math.cos(seg * i) * height);
    -        }
    -
    -        PIXI.WebGLGraphics.buildLine(graphicsData, webGLData);
    -
    -        graphicsData.points = tempPoints;
    -    }
    -};
    -
    -/**
    - * Builds a line to draw
    - *
    - * @static
    - * @private
    - * @method buildLine
    - * @param graphicsData {Graphics} The graphics object containing all the necessary properties
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildLine = function(graphicsData, webGLData)
    -{
    -    // TODO OPTIMISE!
    -    var i = 0;
    -    var points = graphicsData.points;
    -    if(points.length === 0)return;
    -
    -    // if the line width is an odd number add 0.5 to align to a whole pixel
    -    if(graphicsData.lineWidth%2)
    -    {
    -        for (i = 0; i < points.length; i++) {
    -            points[i] += 0.5;
    -        }
    -    }
    -
    -    // get first and last point.. figure out the middle!
    -    var firstPoint = new PIXI.Point( points[0], points[1] );
    -    var lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] );
    -
    -    // if the first point is the last point - gonna have issues :)
    -    if(firstPoint.x === lastPoint.x && firstPoint.y === lastPoint.y)
    -    {
    -        // need to clone as we are going to slightly modify the shape..
    -        points = points.slice();
    -
    -        points.pop();
    -        points.pop();
    -
    -        lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] );
    -
    -        var midPointX = lastPoint.x + (firstPoint.x - lastPoint.x) *0.5;
    -        var midPointY = lastPoint.y + (firstPoint.y - lastPoint.y) *0.5;
    -
    -        points.unshift(midPointX, midPointY);
    -        points.push(midPointX, midPointY);
    -    }
    -
    -    var verts = webGLData.points;
    -    var indices = webGLData.indices;
    -    var length = points.length / 2;
    -    var indexCount = points.length;
    -    var indexStart = verts.length/6;
    -
    -    // DRAW the Line
    -    var width = graphicsData.lineWidth / 2;
    -
    -    // sort color
    -    var color = PIXI.hex2rgb(graphicsData.lineColor);
    -    var alpha = graphicsData.lineAlpha;
    -    var r = color[0] * alpha;
    -    var g = color[1] * alpha;
    -    var b = color[2] * alpha;
    -
    -    var px, py, p1x, p1y, p2x, p2y, p3x, p3y;
    -    var perpx, perpy, perp2x, perp2y, perp3x, perp3y;
    -    var a1, b1, c1, a2, b2, c2;
    -    var denom, pdist, dist;
    -
    -    p1x = points[0];
    -    p1y = points[1];
    -
    -    p2x = points[2];
    -    p2y = points[3];
    -
    -    perpx = -(p1y - p2y);
    -    perpy =  p1x - p2x;
    -
    -    dist = Math.sqrt(perpx*perpx + perpy*perpy);
    -
    -    perpx /= dist;
    -    perpy /= dist;
    -    perpx *= width;
    -    perpy *= width;
    -
    -    // start
    -    verts.push(p1x - perpx , p1y - perpy,
    -                r, g, b, alpha);
    -
    -    verts.push(p1x + perpx , p1y + perpy,
    -                r, g, b, alpha);
    -
    -    for (i = 1; i < length-1; i++)
    -    {
    -        p1x = points[(i-1)*2];
    -        p1y = points[(i-1)*2 + 1];
    -
    -        p2x = points[(i)*2];
    -        p2y = points[(i)*2 + 1];
    -
    -        p3x = points[(i+1)*2];
    -        p3y = points[(i+1)*2 + 1];
    -
    -        perpx = -(p1y - p2y);
    -        perpy = p1x - p2x;
    -
    -        dist = Math.sqrt(perpx*perpx + perpy*perpy);
    -        perpx /= dist;
    -        perpy /= dist;
    -        perpx *= width;
    -        perpy *= width;
    -
    -        perp2x = -(p2y - p3y);
    -        perp2y = p2x - p3x;
    -
    -        dist = Math.sqrt(perp2x*perp2x + perp2y*perp2y);
    -        perp2x /= dist;
    -        perp2y /= dist;
    -        perp2x *= width;
    -        perp2y *= width;
    -
    -        a1 = (-perpy + p1y) - (-perpy + p2y);
    -        b1 = (-perpx + p2x) - (-perpx + p1x);
    -        c1 = (-perpx + p1x) * (-perpy + p2y) - (-perpx + p2x) * (-perpy + p1y);
    -        a2 = (-perp2y + p3y) - (-perp2y + p2y);
    -        b2 = (-perp2x + p2x) - (-perp2x + p3x);
    -        c2 = (-perp2x + p3x) * (-perp2y + p2y) - (-perp2x + p2x) * (-perp2y + p3y);
    -
    -        denom = a1*b2 - a2*b1;
    -
    -        if(Math.abs(denom) < 0.1 )
    -        {
    -
    -            denom+=10.1;
    -            verts.push(p2x - perpx , p2y - perpy,
    -                r, g, b, alpha);
    -
    -            verts.push(p2x + perpx , p2y + perpy,
    -                r, g, b, alpha);
    -
    -            continue;
    -        }
    -
    -        px = (b1*c2 - b2*c1)/denom;
    -        py = (a2*c1 - a1*c2)/denom;
    -
    -
    -        pdist = (px -p2x) * (px -p2x) + (py -p2y) + (py -p2y);
    -
    -
    -        if(pdist > 140 * 140)
    -        {
    -            perp3x = perpx - perp2x;
    -            perp3y = perpy - perp2y;
    -
    -            dist = Math.sqrt(perp3x*perp3x + perp3y*perp3y);
    -            perp3x /= dist;
    -            perp3y /= dist;
    -            perp3x *= width;
    -            perp3y *= width;
    -
    -            verts.push(p2x - perp3x, p2y -perp3y);
    -            verts.push(r, g, b, alpha);
    -
    -            verts.push(p2x + perp3x, p2y +perp3y);
    -            verts.push(r, g, b, alpha);
    -
    -            verts.push(p2x - perp3x, p2y -perp3y);
    -            verts.push(r, g, b, alpha);
    -
    -            indexCount++;
    -        }
    -        else
    -        {
    -
    -            verts.push(px , py);
    -            verts.push(r, g, b, alpha);
    -
    -            verts.push(p2x - (px-p2x), p2y - (py - p2y));
    -            verts.push(r, g, b, alpha);
    -        }
    -    }
    -
    -    p1x = points[(length-2)*2];
    -    p1y = points[(length-2)*2 + 1];
    -
    -    p2x = points[(length-1)*2];
    -    p2y = points[(length-1)*2 + 1];
    -
    -    perpx = -(p1y - p2y);
    -    perpy = p1x - p2x;
    -
    -    dist = Math.sqrt(perpx*perpx + perpy*perpy);
    -    perpx /= dist;
    -    perpy /= dist;
    -    perpx *= width;
    -    perpy *= width;
    -
    -    verts.push(p2x - perpx , p2y - perpy);
    -    verts.push(r, g, b, alpha);
    -
    -    verts.push(p2x + perpx , p2y + perpy);
    -    verts.push(r, g, b, alpha);
    -
    -    indices.push(indexStart);
    -
    -    for (i = 0; i < indexCount; i++)
    -    {
    -        indices.push(indexStart++);
    -    }
    -
    -    indices.push(indexStart-1);
    -};
    -
    -/**
    - * Builds a complex polygon to draw
    - *
    - * @static
    - * @private
    - * @method buildComplexPoly
    - * @param graphicsData {Graphics} The graphics object containing all the necessary properties
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildComplexPoly = function(graphicsData, webGLData)
    -{
    -    //TODO - no need to copy this as it gets turned into a FLoat32Array anyways..
    -    var points = graphicsData.points.slice();
    -    if(points.length < 6)return;
    -
    -    // get first and last point.. figure out the middle!
    -    var indices = webGLData.indices;
    -    webGLData.points = points;
    -    webGLData.alpha = graphicsData.fillAlpha;
    -    webGLData.color = PIXI.hex2rgb(graphicsData.fillColor);
    -
    -    /*
    -        calclate the bounds..
    -    */
    -    var minX = Infinity;
    -    var maxX = -Infinity;
    -
    -    var minY = Infinity;
    -    var maxY = -Infinity;
    -
    -    var x,y;
    -
    -    // get size..
    -    for (var i = 0; i < points.length; i+=2)
    -    {
    -        x = points[i];
    -        y = points[i+1];
    -
    -        minX = x < minX ? x : minX;
    -        maxX = x > maxX ? x : maxX;
    -
    -        minY = y < minY ? y : minY;
    -        maxY = y > maxY ? y : maxY;
    -    }
    -
    -    // add a quad to the end cos there is no point making another buffer!
    -    points.push(minX, minY,
    -                maxX, minY,
    -                maxX, maxY,
    -                minX, maxY);
    -
    -    // push a quad onto the end.. 
    -    
    -    //TODO - this aint needed!
    -    var length = points.length / 2;
    -    for (i = 0; i < length; i++)
    -    {
    -        indices.push( i );
    -    }
    -
    -};
    -
    -/**
    - * Builds a polygon to draw
    - *
    - * @static
    - * @private
    - * @method buildPoly
    - * @param graphicsData {Graphics} The graphics object containing all the necessary properties
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildPoly = function(graphicsData, webGLData)
    -{
    -    var points = graphicsData.points;
    -
    -    if(points.length < 6)return;
    -    // get first and last point.. figure out the middle!
    -    var verts = webGLData.points;
    -    var indices = webGLData.indices;
    -
    -    var length = points.length / 2;
    -
    -    // sort color
    -    var color = PIXI.hex2rgb(graphicsData.fillColor);
    -    var alpha = graphicsData.fillAlpha;
    -    var r = color[0] * alpha;
    -    var g = color[1] * alpha;
    -    var b = color[2] * alpha;
    -
    -    var triangles = PIXI.PolyK.Triangulate(points);
    -    var vertPos = verts.length / 6;
    -
    -    var i = 0;
    -
    -    for (i = 0; i < triangles.length; i+=3)
    -    {
    -        indices.push(triangles[i] + vertPos);
    -        indices.push(triangles[i] + vertPos);
    -        indices.push(triangles[i+1] + vertPos);
    -        indices.push(triangles[i+2] +vertPos);
    -        indices.push(triangles[i+2] + vertPos);
    -    }
    -
    -    for (i = 0; i < length; i++)
    -    {
    -        verts.push(points[i * 2], points[i * 2 + 1],
    -                   r, g, b, alpha);
    -    }
    -
    -};
    -
    -PIXI.WebGLGraphics.graphicsDataPool = [];
    -
    -/**
    - * @class WebGLGraphicsData
    - * @private
    - * @static
    - */
    -PIXI.WebGLGraphicsData = function(gl)
    -{
    -    this.gl = gl;
    -
    -    //TODO does this need to be split before uploding??
    -    this.color = [0,0,0]; // color split!
    -    this.points = [];
    -    this.indices = [];
    -    this.lastIndex = 0;
    -    this.buffer = gl.createBuffer();
    -    this.indexBuffer = gl.createBuffer();
    -    this.mode = 1;
    -    this.alpha = 1;
    -    this.dirty = true;
    -};
    -
    -/**
    - * @method reset
    - */
    -PIXI.WebGLGraphicsData.prototype.reset = function()
    -{
    -    this.points = [];
    -    this.indices = [];
    -    this.lastIndex = 0;
    -};
    -
    -/**
    - * @method upload
    - */
    -PIXI.WebGLGraphicsData.prototype.upload = function()
    -{
    -    var gl = this.gl;
    -
    -//    this.lastIndex = graphics.graphicsData.length;
    -    this.glPoints = new PIXI.Float32Array(this.points);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.glPoints, gl.STATIC_DRAW);
    -
    -    this.glIndicies = new PIXI.Uint16Array(this.indices);
    -
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.glIndicies, gl.STATIC_DRAW);
    -
    -    this.dirty = false;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLMaskManager.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLMaskManager.js.html deleted file mode 100755 index 40c6e1f..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLMaskManager.js.html +++ /dev/null @@ -1,347 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLMaskManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class WebGLMaskManager
    -* @constructor
    -* @private
    -*/
    -PIXI.WebGLMaskManager = function()
    -{
    -};
    -
    -PIXI.WebGLMaskManager.prototype.constructor = PIXI.WebGLMaskManager;
    -
    -/**
    -* Sets the drawing context to the one given in parameter.
    -* 
    -* @method setContext 
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLMaskManager.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -};
    -
    -/**
    -* Applies the Mask and adds it to the current filter stack.
    -* 
    -* @method pushMask
    -* @param maskData {Array}
    -* @param renderSession {Object}
    -*/
    -PIXI.WebGLMaskManager.prototype.pushMask = function(maskData, renderSession)
    -{
    -    var gl = renderSession.gl;
    -
    -    if(maskData.dirty)
    -    {
    -        PIXI.WebGLGraphics.updateGraphics(maskData, gl);
    -    }
    -
    -    if(!maskData._webGL[gl.id].data.length)return;
    -
    -    renderSession.stencilManager.pushStencil(maskData, maskData._webGL[gl.id].data[0], renderSession);
    -};
    -
    -/**
    -* Removes the last filter from the filter stack and doesn't return it.
    -* 
    -* @method popMask
    -* @param maskData {Array}
    -* @param renderSession {Object} an object containing all the useful parameters
    -*/
    -PIXI.WebGLMaskManager.prototype.popMask = function(maskData, renderSession)
    -{
    -    var gl = this.gl;
    -    renderSession.stencilManager.popStencil(maskData, maskData._webGL[gl.id].data[0], renderSession);
    -};
    -
    -/**
    -* Destroys the mask stack.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLMaskManager.prototype.destroy = function()
    -{
    -    this.gl = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderManager.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderManager.js.html deleted file mode 100755 index 89f1c45..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderManager.js.html +++ /dev/null @@ -1,435 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLShaderManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class WebGLShaderManager
    -* @constructor
    -* @private
    -*/
    -PIXI.WebGLShaderManager = function()
    -{
    -    /**
    -     * @property maxAttibs
    -     * @type Number
    -     */
    -    this.maxAttibs = 10;
    -
    -    /**
    -     * @property attribState
    -     * @type Array
    -     */
    -    this.attribState = [];
    -
    -    /**
    -     * @property tempAttribState
    -     * @type Array
    -     */
    -    this.tempAttribState = [];
    -
    -    for (var i = 0; i < this.maxAttibs; i++)
    -    {
    -        this.attribState[i] = false;
    -    }
    -
    -    /**
    -     * @property stack
    -     * @type Array
    -     */
    -    this.stack = [];
    -
    -};
    -
    -PIXI.WebGLShaderManager.prototype.constructor = PIXI.WebGLShaderManager;
    -
    -/**
    -* Initialises the context and the properties.
    -* 
    -* @method setContext 
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLShaderManager.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -    
    -    // the next one is used for rendering primitives
    -    this.primitiveShader = new PIXI.PrimitiveShader(gl);
    -
    -    // the next one is used for rendering triangle strips
    -    this.complexPrimitiveShader = new PIXI.ComplexPrimitiveShader(gl);
    -
    -    // this shader is used for the default sprite rendering
    -    this.defaultShader = new PIXI.PixiShader(gl);
    -
    -    // this shader is used for the fast sprite rendering
    -    this.fastShader = new PIXI.PixiFastShader(gl);
    -
    -    // the next one is used for rendering triangle strips
    -    this.stripShader = new PIXI.StripShader(gl);
    -    this.setShader(this.defaultShader);
    -};
    -
    -/**
    -* Takes the attributes given in parameters.
    -* 
    -* @method setAttribs
    -* @param attribs {Array} attribs 
    -*/
    -PIXI.WebGLShaderManager.prototype.setAttribs = function(attribs)
    -{
    -    // reset temp state
    -    var i;
    -
    -    for (i = 0; i < this.tempAttribState.length; i++)
    -    {
    -        this.tempAttribState[i] = false;
    -    }
    -
    -    // set the new attribs
    -    for (i = 0; i < attribs.length; i++)
    -    {
    -        var attribId = attribs[i];
    -        this.tempAttribState[attribId] = true;
    -    }
    -
    -    var gl = this.gl;
    -
    -    for (i = 0; i < this.attribState.length; i++)
    -    {
    -        if(this.attribState[i] !== this.tempAttribState[i])
    -        {
    -            this.attribState[i] = this.tempAttribState[i];
    -
    -            if(this.tempAttribState[i])
    -            {
    -                gl.enableVertexAttribArray(i);
    -            }
    -            else
    -            {
    -                gl.disableVertexAttribArray(i);
    -            }
    -        }
    -    }
    -};
    -
    -/**
    -* Sets the current shader.
    -* 
    -* @method setShader
    -* @param shader {Any}
    -*/
    -PIXI.WebGLShaderManager.prototype.setShader = function(shader)
    -{
    -    if(this._currentId === shader._UID)return false;
    -    
    -    this._currentId = shader._UID;
    -
    -    this.currentShader = shader;
    -
    -    this.gl.useProgram(shader.program);
    -    this.setAttribs(shader.attributes);
    -
    -    return true;
    -};
    -
    -/**
    -* Destroys this object.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLShaderManager.prototype.destroy = function()
    -{
    -    this.attribState = null;
    -
    -    this.tempAttribState = null;
    -
    -    this.primitiveShader.destroy();
    -
    -    this.complexPrimitiveShader.destroy();
    -
    -    this.defaultShader.destroy();
    -
    -    this.fastShader.destroy();
    -
    -    this.stripShader.destroy();
    -
    -    this.gl = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderUtils.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderUtils.js.html deleted file mode 100755 index eabb242..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderUtils.js.html +++ /dev/null @@ -1,366 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLShaderUtils.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @method initDefaultShaders
    -* @static
    -* @private
    -*/
    -PIXI.initDefaultShaders = function()
    -{
    -};
    -
    -/**
    -* @method CompileVertexShader
    -* @static
    -* @param gl {WebGLContext} the current WebGL drawing context
    -* @param shaderSrc {Array}
    -* @return {Any}
    -*/
    -PIXI.CompileVertexShader = function(gl, shaderSrc)
    -{
    -    return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER);
    -};
    -
    -/**
    -* @method CompileFragmentShader
    -* @static
    -* @param gl {WebGLContext} the current WebGL drawing context
    -* @param shaderSrc {Array}
    -* @return {Any}
    -*/
    -PIXI.CompileFragmentShader = function(gl, shaderSrc)
    -{
    -    return PIXI._CompileShader(gl, shaderSrc, gl.FRAGMENT_SHADER);
    -};
    -
    -/**
    -* @method _CompileShader
    -* @static
    -* @private
    -* @param gl {WebGLContext} the current WebGL drawing context
    -* @param shaderSrc {Array}
    -* @param shaderType {Number}
    -* @return {Any}
    -*/
    -PIXI._CompileShader = function(gl, shaderSrc, shaderType)
    -{
    -    var src = shaderSrc.join("\n");
    -    var shader = gl.createShader(shaderType);
    -    gl.shaderSource(shader, src);
    -    gl.compileShader(shader);
    -
    -    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS))
    -    {
    -        window.console.log(gl.getShaderInfoLog(shader));
    -        return null;
    -    }
    -
    -    return shader;
    -};
    -
    -/**
    -* @method compileProgram
    -* @static
    -* @param gl {WebGLContext} the current WebGL drawing context
    -* @param vertexSrc {Array}
    -* @param fragmentSrc {Array}
    -* @return {Any}
    -*/
    -PIXI.compileProgram = function(gl, vertexSrc, fragmentSrc)
    -{
    -    var fragmentShader = PIXI.CompileFragmentShader(gl, fragmentSrc);
    -    var vertexShader = PIXI.CompileVertexShader(gl, vertexSrc);
    -
    -    var shaderProgram = gl.createProgram();
    -
    -    gl.attachShader(shaderProgram, vertexShader);
    -    gl.attachShader(shaderProgram, fragmentShader);
    -    gl.linkProgram(shaderProgram);
    -
    -    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS))
    -    {
    -        window.console.log("Could not initialise shaders");
    -    }
    -
    -    return shaderProgram;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLSpriteBatch.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLSpriteBatch.js.html deleted file mode 100755 index dd2dd3e..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLSpriteBatch.js.html +++ /dev/null @@ -1,883 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js

    - -
    -
    -/**
    - * @author Mat Groves
    - * 
    - * Big thanks to the very clever Matt DesLauriers <mattdesl> https://github.com/mattdesl/
    - * for creating the original pixi version!
    - *
    - * Heavily inspired by LibGDX's WebGLSpriteBatch:
    - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java
    - */
    -
    - /**
    - *
    - * @class WebGLSpriteBatch
    - * @private
    - * @constructor
    - */
    -PIXI.WebGLSpriteBatch = function()
    -{
    -    /**
    -     * @property vertSize
    -     * @type Number
    -     */
    -    this.vertSize = 6;
    -
    -    /**
    -     * The number of images in the SpriteBatch before it flushes
    -     * @property size
    -     * @type Number
    -     */
    -    this.size = 2000;//Math.pow(2, 16) /  this.vertSize;
    -
    -    //the total number of floats in our batch
    -    var numVerts = this.size * 4 *  this.vertSize;
    -    //the total number of indices in our batch
    -    var numIndices = this.size * 6;
    -
    -    /**
    -    * Holds the vertices
    -    *
    -    * @property vertices
    -    * @type Float32Array
    -    */
    -    this.vertices = new PIXI.Float32Array(numVerts);
    -
    -    /**
    -     * Holds the indices
    -     *
    -     * @property indices
    -     * @type Uint16Array
    -     */
    -    this.indices = new PIXI.Uint16Array(numIndices);
    -    
    -    /**
    -     * @property lastIndexCount
    -     * @type Number
    -     */
    -    this.lastIndexCount = 0;
    -
    -    for (var i=0, j=0; i < numIndices; i += 6, j += 4)
    -    {
    -        this.indices[i + 0] = j + 0;
    -        this.indices[i + 1] = j + 1;
    -        this.indices[i + 2] = j + 2;
    -        this.indices[i + 3] = j + 0;
    -        this.indices[i + 4] = j + 2;
    -        this.indices[i + 5] = j + 3;
    -    }
    -
    -    /**
    -     * @property drawing
    -     * @type Boolean
    -     */
    -    this.drawing = false;
    -
    -    /**
    -     * @property currentBatchSize
    -     * @type Number
    -     */
    -    this.currentBatchSize = 0;
    -
    -    /**
    -     * @property currentBaseTexture
    -     * @type BaseTexture
    -     */
    -    this.currentBaseTexture = null;
    -
    -    /**
    -     * @property dirty
    -     * @type Boolean
    -     */
    -    this.dirty = true;
    -
    -    /**
    -     * @property textures
    -     * @type Array
    -     */
    -    this.textures = [];
    -
    -    /**
    -     * @property blendModes
    -     * @type Array
    -     */
    -    this.blendModes = [];
    -
    -    /**
    -     * @property shaders
    -     * @type Array
    -     */
    -    this.shaders = [];
    -
    -    /**
    -     * @property sprites
    -     * @type Array
    -     */
    -    this.sprites = [];
    -
    -    /**
    -     * @property defaultShader
    -     * @type AbstractFilter
    -     */
    -    this.defaultShader = new PIXI.AbstractFilter([
    -        'precision lowp float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D uSampler;',
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;',
    -        '}'
    -    ]);
    -};
    -
    -/**
    -* @method setContext
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLSpriteBatch.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -
    -    // create a couple of buffers
    -    this.vertexBuffer = gl.createBuffer();
    -    this.indexBuffer = gl.createBuffer();
    -
    -    // 65535 is max index, so 65535 / 6 = 10922.
    -
    -    //upload the index data
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW);
    -
    -    this.currentBlendMode = 99999;
    -
    -    var shader = new PIXI.PixiShader(gl);
    -
    -    shader.fragmentSrc = this.defaultShader.fragmentSrc;
    -    shader.uniforms = {};
    -    shader.init();
    -
    -    this.defaultShader.shaders[gl.id] = shader;
    -};
    -
    -/**
    -* @method begin
    -* @param renderSession {Object} The RenderSession object
    -*/
    -PIXI.WebGLSpriteBatch.prototype.begin = function(renderSession)
    -{
    -    this.renderSession = renderSession;
    -    this.shader = this.renderSession.shaderManager.defaultShader;
    -
    -    this.start();
    -};
    -
    -/**
    -* @method end
    -*/
    -PIXI.WebGLSpriteBatch.prototype.end = function()
    -{
    -    this.flush();
    -};
    -
    -/**
    -* @method render
    -* @param sprite {Sprite} the sprite to render when using this spritebatch
    -*/
    -PIXI.WebGLSpriteBatch.prototype.render = function(sprite)
    -{
    -    var texture = sprite.texture;
    -    
    -   //TODO set blend modes.. 
    -    // check texture..
    -    if(this.currentBatchSize >= this.size)
    -    {
    -        this.flush();
    -        this.currentBaseTexture = texture.baseTexture;
    -    }
    -
    -    // get the uvs for the texture
    -    var uvs = texture._uvs;
    -    // if the uvs have not updated then no point rendering just yet!
    -    if(!uvs)return;
    -
    -    // get the sprites current alpha
    -    var alpha = sprite.worldAlpha;
    -    var tint = sprite.tint;
    -
    -    var verticies = this.vertices;
    -
    -    // TODO trim??
    -    var aX = sprite.anchor.x;
    -    var aY = sprite.anchor.y;
    -
    -    var w0, w1, h0, h1;
    -        
    -    if (texture.trim)
    -    {
    -        // if the sprite is trimmed then we need to add the extra space before transforming the sprite coords..
    -        var trim = texture.trim;
    -
    -        w1 = trim.x - aX * trim.width;
    -        w0 = w1 + texture.crop.width;
    -
    -        h1 = trim.y - aY * trim.height;
    -        h0 = h1 + texture.crop.height;
    -
    -    }
    -    else
    -    {
    -        w0 = (texture.frame.width ) * (1-aX);
    -        w1 = (texture.frame.width ) * -aX;
    -
    -        h0 = texture.frame.height * (1-aY);
    -        h1 = texture.frame.height * -aY;
    -    }
    -
    -    var index = this.currentBatchSize * 4 * this.vertSize;
    -    
    -    var resolution = texture.baseTexture.resolution;
    -
    -    var worldTransform = sprite.worldTransform;
    -
    -    var a = worldTransform.a / resolution;
    -    var b = worldTransform.b / resolution;
    -    var c = worldTransform.c / resolution;
    -    var d = worldTransform.d / resolution;
    -    var tx = worldTransform.tx;
    -    var ty = worldTransform.ty;
    -
    -
    -    // xy
    -    verticies[index++] = a * w1 + c * h1 + tx;
    -    verticies[index++] = d * h1 + b * w1 + ty;
    -    // uv
    -    verticies[index++] = uvs.x0;
    -    verticies[index++] = uvs.y0;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // xy
    -    verticies[index++] = a * w0 + c * h1 + tx;
    -    verticies[index++] = d * h1 + b * w0 + ty;
    -    // uv
    -    verticies[index++] = uvs.x1;
    -    verticies[index++] = uvs.y1;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // xy
    -    verticies[index++] = a * w0 + c * h0 + tx;
    -    verticies[index++] = d * h0 + b * w0 + ty;
    -    // uv
    -    verticies[index++] = uvs.x2;
    -    verticies[index++] = uvs.y2;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // xy
    -    verticies[index++] = a * w1 + c * h0 + tx;
    -    verticies[index++] = d * h0 + b * w1 + ty;
    -    // uv
    -    verticies[index++] = uvs.x3;
    -    verticies[index++] = uvs.y3;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -    
    -    // increment the batchsize
    -    this.sprites[this.currentBatchSize++] = sprite;
    -
    -};
    -
    -/**
    -* Renders a TilingSprite using the spriteBatch.
    -* 
    -* @method renderTilingSprite
    -* @param sprite {TilingSprite} the tilingSprite to render
    -*/
    -PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite)
    -{
    -    var texture = tilingSprite.tilingTexture;
    -
    -    // check texture..
    -    if(this.currentBatchSize >= this.size)
    -    {
    -        //return;
    -        this.flush();
    -        this.currentBaseTexture = texture.baseTexture;
    -    }
    -
    -     // set the textures uvs temporarily
    -    // TODO create a separate texture so that we can tile part of a texture
    -
    -    if(!tilingSprite._uvs)tilingSprite._uvs = new PIXI.TextureUvs();
    -
    -    var uvs = tilingSprite._uvs;
    -
    -    tilingSprite.tilePosition.x %= texture.baseTexture.width * tilingSprite.tileScaleOffset.x;
    -    tilingSprite.tilePosition.y %= texture.baseTexture.height * tilingSprite.tileScaleOffset.y;
    -
    -    var offsetX =  tilingSprite.tilePosition.x/(texture.baseTexture.width*tilingSprite.tileScaleOffset.x);
    -    var offsetY =  tilingSprite.tilePosition.y/(texture.baseTexture.height*tilingSprite.tileScaleOffset.y);
    -
    -    var scaleX =  (tilingSprite.width / texture.baseTexture.width)  / (tilingSprite.tileScale.x * tilingSprite.tileScaleOffset.x);
    -    var scaleY =  (tilingSprite.height / texture.baseTexture.height) / (tilingSprite.tileScale.y * tilingSprite.tileScaleOffset.y);
    -
    -    uvs.x0 = 0 - offsetX;
    -    uvs.y0 = 0 - offsetY;
    -
    -    uvs.x1 = (1 * scaleX) - offsetX;
    -    uvs.y1 = 0 - offsetY;
    -
    -    uvs.x2 = (1 * scaleX) - offsetX;
    -    uvs.y2 = (1 * scaleY) - offsetY;
    -
    -    uvs.x3 = 0 - offsetX;
    -    uvs.y3 = (1 *scaleY) - offsetY;
    -
    -    // get the tilingSprites current alpha
    -    var alpha = tilingSprite.worldAlpha;
    -    var tint = tilingSprite.tint;
    -
    -    var  verticies = this.vertices;
    -
    -    var width = tilingSprite.width;
    -    var height = tilingSprite.height;
    -
    -    // TODO trim??
    -    var aX = tilingSprite.anchor.x;
    -    var aY = tilingSprite.anchor.y;
    -    var w0 = width * (1-aX);
    -    var w1 = width * -aX;
    -
    -    var h0 = height * (1-aY);
    -    var h1 = height * -aY;
    -
    -    var index = this.currentBatchSize * 4 * this.vertSize;
    -
    -    var resolution = texture.baseTexture.resolution;
    -
    -    var worldTransform = tilingSprite.worldTransform;
    -
    -    var a = worldTransform.a / resolution;//[0];
    -    var b = worldTransform.b / resolution;//[3];
    -    var c = worldTransform.c / resolution;//[1];
    -    var d = worldTransform.d / resolution;//[4];
    -    var tx = worldTransform.tx;//[2];
    -    var ty = worldTransform.ty;///[5];
    -
    -    // xy
    -    verticies[index++] = a * w1 + c * h1 + tx;
    -    verticies[index++] = d * h1 + b * w1 + ty;
    -    // uv
    -    verticies[index++] = uvs.x0;
    -    verticies[index++] = uvs.y0;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // xy
    -    verticies[index++] = (a * w0 + c * h1 + tx);
    -    verticies[index++] = d * h1 + b * w0 + ty;
    -    // uv
    -    verticies[index++] = uvs.x1;
    -    verticies[index++] = uvs.y1;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -    
    -    // xy
    -    verticies[index++] = a * w0 + c * h0 + tx;
    -    verticies[index++] = d * h0 + b * w0 + ty;
    -    // uv
    -    verticies[index++] = uvs.x2;
    -    verticies[index++] = uvs.y2;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // xy
    -    verticies[index++] = a * w1 + c * h0 + tx;
    -    verticies[index++] = d * h0 + b * w1 + ty;
    -    // uv
    -    verticies[index++] = uvs.x3;
    -    verticies[index++] = uvs.y3;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // increment the batchsize
    -    this.sprites[this.currentBatchSize++] = tilingSprite;
    -};
    -
    -/**
    -* Renders the content and empties the current batch.
    -*
    -* @method flush
    -*/
    -PIXI.WebGLSpriteBatch.prototype.flush = function()
    -{
    -    // If the batch is length 0 then return as there is nothing to draw
    -    if (this.currentBatchSize===0)return;
    -
    -    var gl = this.gl;
    -    var shader;
    -
    -    if(this.dirty)
    -    {
    -        this.dirty = false;
    -        // bind the main texture
    -        gl.activeTexture(gl.TEXTURE0);
    -
    -        // bind the buffers
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -
    -        shader =  this.defaultShader.shaders[gl.id];
    -
    -        // this is the same for each shader?
    -        var stride =  this.vertSize * 4;
    -        gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0);
    -        gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, stride, 2 * 4);
    -        gl.vertexAttribPointer(shader.colorAttribute, 2, gl.FLOAT, false, stride, 4 * 4);
    -    }
    -
    -    // upload the verts to the buffer  
    -    if(this.currentBatchSize > ( this.size * 0.5 ) )
    -    {
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices);
    -    }
    -    else
    -    {
    -        var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize);
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, view);
    -    }
    -
    -    var nextTexture, nextBlendMode, nextShader;
    -    var batchSize = 0;
    -    var start = 0;
    -
    -    var currentBaseTexture = null;
    -    var currentBlendMode = this.renderSession.blendModeManager.currentBlendMode;
    -    var currentShader = null;
    -
    -    var blendSwap = false;
    -    var shaderSwap = false;
    -    var sprite;
    -
    -    for (var i = 0, j = this.currentBatchSize; i < j; i++) {
    -        
    -        sprite = this.sprites[i];
    -
    -        nextTexture = sprite.texture.baseTexture;
    -        nextBlendMode = sprite.blendMode;
    -        nextShader = sprite.shader || this.defaultShader;
    -
    -        blendSwap = currentBlendMode !== nextBlendMode;
    -        shaderSwap = currentShader !== nextShader; // should I use _UIDS???
    -
    -        if(currentBaseTexture !== nextTexture || blendSwap || shaderSwap)
    -        {
    -            this.renderBatch(currentBaseTexture, batchSize, start);
    -
    -            start = i;
    -            batchSize = 0;
    -            currentBaseTexture = nextTexture;
    -
    -            if( blendSwap )
    -            {
    -                currentBlendMode = nextBlendMode;
    -                this.renderSession.blendModeManager.setBlendMode( currentBlendMode );
    -            }
    -
    -            if( shaderSwap )
    -            {
    -                currentShader = nextShader;
    -                
    -                shader = currentShader.shaders[gl.id];
    -
    -                if(!shader)
    -                {
    -                    shader = new PIXI.PixiShader(gl);
    -
    -                    shader.fragmentSrc =currentShader.fragmentSrc;
    -                    shader.uniforms =currentShader.uniforms;
    -                    shader.init();
    -
    -                    currentShader.shaders[gl.id] = shader;
    -                }
    -
    -                // set shader function???
    -                this.renderSession.shaderManager.setShader(shader);
    -
    -                if(shader.dirty)shader.syncUniforms();
    -                
    -                // both thease only need to be set if they are changing..
    -                // set the projection
    -                var projection = this.renderSession.projection;
    -                gl.uniform2f(shader.projectionVector, projection.x, projection.y);
    -
    -                // TODO - this is temprorary!
    -                var offsetVector = this.renderSession.offset;
    -                gl.uniform2f(shader.offsetVector, offsetVector.x, offsetVector.y);
    -
    -                // set the pointers
    -            }
    -        }
    -
    -        batchSize++;
    -    }
    -
    -    this.renderBatch(currentBaseTexture, batchSize, start);
    -
    -    // then reset the batch!
    -    this.currentBatchSize = 0;
    -};
    -
    -/**
    -* @method renderBatch
    -* @param texture {Texture}
    -* @param size {Number}
    -* @param startIndex {Number}
    -*/
    -PIXI.WebGLSpriteBatch.prototype.renderBatch = function(texture, size, startIndex)
    -{
    -    if(size === 0)return;
    -
    -    var gl = this.gl;
    -
    -    // check if a texture is dirty..
    -    if(texture._dirty[gl.id])
    -    {
    -        this.renderSession.renderer.updateTexture(texture);
    -    }
    -    else
    -    {
    -        // bind the current texture
    -        gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]);
    -    }
    -
    -    // now draw those suckas!
    -    gl.drawElements(gl.TRIANGLES, size * 6, gl.UNSIGNED_SHORT, startIndex * 6 * 2);
    -    
    -    // increment the draw count
    -    this.renderSession.drawCount++;
    -};
    -
    -/**
    -* @method stop
    -*/
    -PIXI.WebGLSpriteBatch.prototype.stop = function()
    -{
    -    this.flush();
    -    this.dirty = true;
    -};
    -
    -/**
    -* @method start
    -*/
    -PIXI.WebGLSpriteBatch.prototype.start = function()
    -{
    -    this.dirty = true;
    -};
    -
    -/**
    -* Destroys the SpriteBatch.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLSpriteBatch.prototype.destroy = function()
    -{
    -    this.vertices = null;
    -    this.indices = null;
    -    
    -    this.gl.deleteBuffer( this.vertexBuffer );
    -    this.gl.deleteBuffer( this.indexBuffer );
    -    
    -    this.currentBaseTexture = null;
    -    
    -    this.gl = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLStencilManager.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLStencilManager.js.html deleted file mode 100755 index 20b4a01..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLStencilManager.js.html +++ /dev/null @@ -1,572 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLStencilManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class WebGLStencilManager
    -* @constructor
    -* @private
    -*/
    -PIXI.WebGLStencilManager = function()
    -{
    -    this.stencilStack = [];
    -    this.reverse = true;
    -    this.count = 0;
    -};
    -
    -/**
    -* Sets the drawing context to the one given in parameter.
    -* 
    -* @method setContext 
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLStencilManager.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -};
    -
    -/**
    -* Applies the Mask and adds it to the current filter stack.
    -* 
    -* @method pushMask
    -* @param graphics {Graphics}
    -* @param webGLData {Array}
    -* @param renderSession {Object}
    -*/
    -PIXI.WebGLStencilManager.prototype.pushStencil = function(graphics, webGLData, renderSession)
    -{
    -    var gl = this.gl;
    -    this.bindGraphics(graphics, webGLData, renderSession);
    -
    -    if(this.stencilStack.length === 0)
    -    {
    -        gl.enable(gl.STENCIL_TEST);
    -        gl.clear(gl.STENCIL_BUFFER_BIT);
    -        this.reverse = true;
    -        this.count = 0;
    -    }
    -
    -    this.stencilStack.push(webGLData);
    -
    -    var level = this.count;
    -
    -    gl.colorMask(false, false, false, false);
    -
    -    gl.stencilFunc(gl.ALWAYS,0,0xFF);
    -    gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT);
    -
    -    // draw the triangle strip!
    -
    -    if(webGLData.mode === 1)
    -    {
    -        gl.drawElements(gl.TRIANGLE_FAN,  webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 );
    -       
    -        if(this.reverse)
    -        {
    -            gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF);
    -            gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR);
    -        }
    -        else
    -        {
    -            gl.stencilFunc(gl.EQUAL,level, 0xFF);
    -            gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR);
    -        }
    -
    -        // draw a quad to increment..
    -        gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 );
    -               
    -        if(this.reverse)
    -        {
    -            gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF);
    -        }
    -        else
    -        {
    -            gl.stencilFunc(gl.EQUAL,level+1, 0xFF);
    -        }
    -
    -        this.reverse = !this.reverse;
    -    }
    -    else
    -    {
    -        if(!this.reverse)
    -        {
    -            gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF);
    -            gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR);
    -        }
    -        else
    -        {
    -            gl.stencilFunc(gl.EQUAL,level, 0xFF);
    -            gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR);
    -        }
    -
    -        gl.drawElements(gl.TRIANGLE_STRIP,  webGLData.indices.length, gl.UNSIGNED_SHORT, 0 );
    -
    -        if(!this.reverse)
    -        {
    -            gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF);
    -        }
    -        else
    -        {
    -            gl.stencilFunc(gl.EQUAL,level+1, 0xFF);
    -        }
    -    }
    -
    -    gl.colorMask(true, true, true, true);
    -    gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP);
    -
    -    this.count++;
    -};
    -
    -/**
    - * TODO this does not belong here!
    - * 
    - * @method bindGraphics
    - * @param graphics {Graphics}
    - * @param webGLData {Array}
    - * @param renderSession {Object}
    - */
    -PIXI.WebGLStencilManager.prototype.bindGraphics = function(graphics, webGLData, renderSession)
    -{
    -    //if(this._currentGraphics === graphics)return;
    -    this._currentGraphics = graphics;
    -
    -    var gl = this.gl;
    -
    -     // bind the graphics object..
    -    var projection = renderSession.projection,
    -        offset = renderSession.offset,
    -        shader;// = renderSession.shaderManager.primitiveShader;
    -
    -    if(webGLData.mode === 1)
    -    {
    -        shader = renderSession.shaderManager.complexPrimitiveShader;
    -
    -        renderSession.shaderManager.setShader( shader );
    -
    -        gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true));
    -
    -        gl.uniform2f(shader.projectionVector, projection.x, -projection.y);
    -        gl.uniform2f(shader.offsetVector, -offset.x, -offset.y);
    -
    -        gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint));
    -        gl.uniform3fv(shader.color, webGLData.color);
    -
    -        gl.uniform1f(shader.alpha, graphics.worldAlpha * webGLData.alpha);
    -
    -        gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer);
    -
    -        gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 2, 0);
    -
    -
    -        // now do the rest..
    -        // set the index buffer!
    -        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer);
    -    }
    -    else
    -    {
    -        //renderSession.shaderManager.activatePrimitiveShader();
    -        shader = renderSession.shaderManager.primitiveShader;
    -        renderSession.shaderManager.setShader( shader );
    -
    -        gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true));
    -
    -        gl.uniform2f(shader.projectionVector, projection.x, -projection.y);
    -        gl.uniform2f(shader.offsetVector, -offset.x, -offset.y);
    -
    -        gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint));
    -
    -        gl.uniform1f(shader.alpha, graphics.worldAlpha);
    -        
    -        gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer);
    -
    -        gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0);
    -        gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4);
    -
    -        // set the index buffer!
    -        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer);
    -    }
    -};
    -
    -/**
    - * @method popStencil
    - * @param graphics {Graphics}
    - * @param webGLData {Array}
    - * @param renderSession {Object}
    - */
    -PIXI.WebGLStencilManager.prototype.popStencil = function(graphics, webGLData, renderSession)
    -{
    -	var gl = this.gl;
    -    this.stencilStack.pop();
    -   
    -    this.count--;
    -
    -    if(this.stencilStack.length === 0)
    -    {
    -        // the stack is empty!
    -        gl.disable(gl.STENCIL_TEST);
    -
    -    }
    -    else
    -    {
    -
    -        var level = this.count;
    -
    -        this.bindGraphics(graphics, webGLData, renderSession);
    -
    -        gl.colorMask(false, false, false, false);
    -    
    -        if(webGLData.mode === 1)
    -        {
    -            this.reverse = !this.reverse;
    -
    -            if(this.reverse)
    -            {
    -                gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF);
    -                gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR);
    -            }
    -            else
    -            {
    -                gl.stencilFunc(gl.EQUAL,level+1, 0xFF);
    -                gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR);
    -            }
    -
    -            // draw a quad to increment..
    -            gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 );
    -            
    -            gl.stencilFunc(gl.ALWAYS,0,0xFF);
    -            gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT);
    -
    -            // draw the triangle strip!
    -            gl.drawElements(gl.TRIANGLE_FAN,  webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 );
    -           
    -            if(!this.reverse)
    -            {
    -                gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF);
    -            }
    -            else
    -            {
    -                gl.stencilFunc(gl.EQUAL,level, 0xFF);
    -            }
    -
    -        }
    -        else
    -        {
    -          //  console.log("<<>>")
    -            if(!this.reverse)
    -            {
    -                gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF);
    -                gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR);
    -            }
    -            else
    -            {
    -                gl.stencilFunc(gl.EQUAL,level+1, 0xFF);
    -                gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR);
    -            }
    -
    -            gl.drawElements(gl.TRIANGLE_STRIP,  webGLData.indices.length, gl.UNSIGNED_SHORT, 0 );
    -
    -            if(!this.reverse)
    -            {
    -                gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF);
    -            }
    -            else
    -            {
    -                gl.stencilFunc(gl.EQUAL,level, 0xFF);
    -            }
    -        }
    -
    -        gl.colorMask(true, true, true, true);
    -        gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP);
    -
    -
    -    }
    -};
    -
    -/**
    -* Destroys the mask stack.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLStencilManager.prototype.destroy = function()
    -{
    -    this.stencilStack = null;
    -    this.gl = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_text_BitmapText.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_text_BitmapText.js.html deleted file mode 100755 index 1a2e2ce..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_text_BitmapText.js.html +++ /dev/null @@ -1,493 +0,0 @@ - - - - - src/pixi/text/BitmapText.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/text/BitmapText.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A BitmapText object will create a line or multiple lines of text using bitmap font. To split a line you can use '\n', '\r' or '\r\n' in your string.
    - * You can generate the fnt files using
    - * http://www.angelcode.com/products/bmfont/ for windows or
    - * http://www.bmglyph.com/ for mac.
    - *
    - * @class BitmapText
    - * @extends DisplayObjectContainer
    - * @constructor
    - * @param text {String} The copy that you would like the text to display
    - * @param style {Object} The style parameters
    - * @param style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)
    - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
    - */
    -PIXI.BitmapText = function(text, style)
    -{
    -    PIXI.DisplayObjectContainer.call(this);
    -
    -    /**
    -     * [read-only] The width of the overall text, different from fontSize,
    -     * which is defined in the style object
    -     *
    -     * @property textWidth
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.textWidth = 0;
    -
    -    /**
    -     * [read-only] The height of the overall text, different from fontSize,
    -     * which is defined in the style object
    -     *
    -     * @property textHeight
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.textHeight = 0;
    -
    -    /**
    -     * @property _pool
    -     * @type Array
    -     * @private
    -     */
    -    this._pool = [];
    -
    -    this.setText(text);
    -    this.setStyle(style);
    -    this.updateText();
    -
    -    /**
    -     * The dirty state of this object.
    -     * @property dirty
    -     * @type Boolean
    -     */
    -    this.dirty = false;
    -};
    -
    -// constructor
    -PIXI.BitmapText.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
    -PIXI.BitmapText.prototype.constructor = PIXI.BitmapText;
    -
    -/**
    - * Set the text string to be rendered.
    - *
    - * @method setText
    - * @param text {String} The text that you would like displayed
    - */
    -PIXI.BitmapText.prototype.setText = function(text)
    -{
    -    this.text = text || ' ';
    -    this.dirty = true;
    -};
    -
    -/**
    - * Set the style of the text
    - * style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)
    - * [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single lines of text
    - *
    - * @method setStyle
    - * @param style {Object} The style parameters, contained as properties of an object
    - */
    -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;
    -    this.tint = style.tint;
    -};
    -
    -/**
    - * Renders text and updates it when needed
    - *
    - * @method updateText
    - * @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(/(?:\r\n|\r|\n)/.test(this.text.charAt(i)))
    -        {
    -            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.kerning[prevCharCode])
    -        {
    -            pos.x += charData.kerning[prevCharCode];
    -        }
    -
    -        chars.push({texture:charData.texture, 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);
    -    }
    -
    -    var lenChildren = this.children.length;
    -    var lenChars = chars.length;
    -    var tint = this.tint || 0xFFFFFF;
    -
    -    for(i = 0; i < lenChars; i++)
    -    {
    -        var c = i < lenChildren ? this.children[i] : this._pool.pop(); // get old child if have. if not - take from pool.
    -
    -        if (c) c.setTexture(chars[i].texture); // check if got one before.
    -        else c = new PIXI.Sprite(chars[i].texture); // if no create new one.
    -
    -        c.position.x = (chars[i].position.x + lineAlignOffsets[chars[i].line]) * scale;
    -        c.position.y = chars[i].position.y * scale;
    -        c.scale.x = c.scale.y = scale;
    -        c.tint = tint;
    -        if (!c.parent) this.addChild(c);
    -    }
    -
    -    // remove unnecessary children.
    -    // and put their into the pool.
    -    while(this.children.length > lenChars)
    -    {
    -        var child = this.getChildAt(this.children.length - 1);
    -        this._pool.push(child);
    -        this.removeChild(child);
    -    }
    -
    -    this.textWidth = maxLineWidth * scale;
    -    this.textHeight = (pos.y + data.lineHeight) * scale;
    -};
    -
    -/**
    - * Updates the transform of this object
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.BitmapText.prototype.updateTransform = function()
    -{
    -    if(this.dirty)
    -    {
    -        this.updateText();
    -        this.dirty = false;
    -    }
    -
    -    PIXI.DisplayObjectContainer.prototype.updateTransform.call(this);
    -};
    -
    -PIXI.BitmapText.fonts = {};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_text_Text.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_text_Text.js.html deleted file mode 100755 index fb28604..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_text_Text.js.html +++ /dev/null @@ -1,805 +0,0 @@ - - - - - src/pixi/text/Text.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/text/Text.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * Modified by Tom Slezakowski http://www.tomslezakowski.com @TomSlezakowski (24/03/2014) - Added dropShadowColor.
    - */
    -
    -/**
    - * A Text Object will create a line or multiple lines of text. To split a line you can use '\n' in your text string,
    - * or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object.
    - *
    - * @class Text
    - * @extends Sprite
    - * @constructor
    - * @param text {String} The copy that you would like the text to display
    - * @param [style] {Object} The style parameters
    - * @param [style.font] {String} default 'bold 20px Arial' The style and size of the font
    - * @param [style.fill='black'] {String|Number} A canvas fillstyle that will be used on the text e.g 'red', '#00FF00'
    - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
    - * @param [style.stroke] {String|Number} A canvas fillstyle that will be used on the text stroke e.g 'blue', '#FCFF00'
    - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke)
    - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used
    - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap, it needs wordWrap to be set to true
    - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text
    - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00'
    - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow
    - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow
    - */
    -PIXI.Text = function(text, style)
    -{
    -    /**
    -     * The canvas element that everything is drawn to
    -     *
    -     * @property canvas
    -     * @type HTMLCanvasElement
    -     */
    -    this.canvas = document.createElement('canvas');
    -
    -    /**
    -     * The canvas 2d context that everything is drawn with
    -     * @property context
    -     * @type HTMLCanvasElement
    -     */
    -    this.context = this.canvas.getContext('2d');
    -
    -    /**
    -     * The resolution of the canvas.
    -     * @property resolution
    -     * @type Number
    -     */
    -    this.resolution = 1;
    -
    -    PIXI.Sprite.call(this, PIXI.Texture.fromCanvas(this.canvas));
    -
    -    this.setText(text);
    -    this.setStyle(style);
    -
    -};
    -
    -// constructor
    -PIXI.Text.prototype = Object.create(PIXI.Sprite.prototype);
    -PIXI.Text.prototype.constructor = PIXI.Text;
    -
    -/**
    - * The width of the Text, setting this will actually modify the scale to achieve the value set
    - *
    - * @property width
    - * @type Number
    - */
    -Object.defineProperty(PIXI.Text.prototype, 'width', {
    -    get: function() {
    -
    -        if(this.dirty)
    -        {
    -            this.updateText();
    -            this.dirty = false;
    -        }
    -
    -
    -        return this.scale.x * this.texture.frame.width;
    -    },
    -    set: function(value) {
    -        this.scale.x = value / this.texture.frame.width;
    -        this._width = value;
    -    }
    -});
    -
    -/**
    - * The height of the Text, setting this will actually modify the scale to achieve the value set
    - *
    - * @property height
    - * @type Number
    - */
    -Object.defineProperty(PIXI.Text.prototype, 'height', {
    -    get: function() {
    -
    -        if(this.dirty)
    -        {
    -            this.updateText();
    -            this.dirty = false;
    -        }
    -
    -
    -        return  this.scale.y * this.texture.frame.height;
    -    },
    -    set: function(value) {
    -        this.scale.y = value / this.texture.frame.height;
    -        this._height = value;
    -    }
    -});
    -
    -/**
    - * Set the style of the text
    - *
    - * @method setStyle
    - * @param [style] {Object} The style parameters
    - * @param [style.font='bold 20pt Arial'] {String} The style and size of the font
    - * @param [style.fill='black'] {Object} A canvas fillstyle that will be used on the text eg 'red', '#00FF00'
    - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
    - * @param [style.stroke='black'] {String} A canvas fillstyle that will be used on the text stroke eg 'blue', '#FCFF00'
    - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke)
    - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used
    - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap
    - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text
    - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00'
    - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow
    - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow
    - */
    -PIXI.Text.prototype.setStyle = function(style)
    -{
    -    style = style || {};
    -    style.font = style.font || 'bold 20pt Arial';
    -    style.fill = style.fill || 'black';
    -    style.align = style.align || 'left';
    -    style.stroke = style.stroke || 'black'; //provide a default, see: https://github.com/GoodBoyDigital/pixi.js/issues/136
    -    style.strokeThickness = style.strokeThickness || 0;
    -    style.wordWrap = style.wordWrap || false;
    -    style.wordWrapWidth = style.wordWrapWidth || 100;
    -    
    -    style.dropShadow = style.dropShadow || false;
    -    style.dropShadowAngle = style.dropShadowAngle || Math.PI / 6;
    -    style.dropShadowDistance = style.dropShadowDistance || 4;
    -    style.dropShadowColor = style.dropShadowColor || 'black';
    -
    -    this.style = style;
    -    this.dirty = true;
    -};
    -
    -/**
    - * Set the copy for the text object. To split a line you can use '\n'.
    - *
    - * @method setText
    - * @param text {String} The copy that you would like the text to display
    - */
    -PIXI.Text.prototype.setText = function(text)
    -{
    -    this.text = text.toString() || ' ';
    -    this.dirty = true;
    -};
    -
    -/**
    - * Renders text and updates it when needed
    - *
    - * @method updateText
    - * @private
    - */
    -PIXI.Text.prototype.updateText = function()
    -{
    -    this.texture.baseTexture.resolution = this.resolution;
    -
    -    this.context.font = this.style.font;
    -
    -    var outputText = this.text;
    -
    -    // word wrap
    -    // preserve original text
    -    if(this.style.wordWrap)outputText = this.wordWrap(this.text);
    -
    -    //split text into lines
    -    var lines = outputText.split(/(?:\r\n|\r|\n)/);
    -
    -    //calculate text width
    -    var lineWidths = [];
    -    var maxLineWidth = 0;
    -    var fontProperties = this.determineFontProperties(this.style.font);
    -    for (var i = 0; i < lines.length; i++)
    -    {
    -        var lineWidth = this.context.measureText(lines[i]).width;
    -        lineWidths[i] = lineWidth;
    -        maxLineWidth = Math.max(maxLineWidth, lineWidth);
    -    }
    -
    -    var width = maxLineWidth + this.style.strokeThickness;
    -    if(this.style.dropShadow)width += this.style.dropShadowDistance;
    -
    -    this.canvas.width = ( width + this.context.lineWidth ) * this.resolution;
    -    
    -    //calculate text height
    -    var lineHeight = fontProperties.fontSize + this.style.strokeThickness;
    - 
    -    var height = lineHeight * lines.length;
    -    if(this.style.dropShadow)height += this.style.dropShadowDistance;
    -
    -    this.canvas.height = height * this.resolution;
    -
    -    this.context.scale( this.resolution, this.resolution);
    -
    -    if(navigator.isCocoonJS) this.context.clearRect(0,0,this.canvas.width,this.canvas.height);
    -    
    -    this.context.font = this.style.font;
    -    this.context.strokeStyle = this.style.stroke;
    -    this.context.lineWidth = this.style.strokeThickness;
    -    this.context.textBaseline = 'alphabetic';
    -    //this.context.lineJoin = 'round';
    -
    -    var linePositionX;
    -    var linePositionY;
    -
    -    if(this.style.dropShadow)
    -    {
    -        this.context.fillStyle = this.style.dropShadowColor;
    -
    -        var xShadowOffset = Math.sin(this.style.dropShadowAngle) * this.style.dropShadowDistance;
    -        var yShadowOffset = Math.cos(this.style.dropShadowAngle) * this.style.dropShadowDistance;
    -
    -        for (i = 0; i < lines.length; i++)
    -        {
    -            linePositionX = this.style.strokeThickness / 2;
    -            linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent;
    -
    -            if(this.style.align === 'right')
    -            {
    -                linePositionX += maxLineWidth - lineWidths[i];
    -            }
    -            else if(this.style.align === 'center')
    -            {
    -                linePositionX += (maxLineWidth - lineWidths[i]) / 2;
    -            }
    -
    -            if(this.style.fill)
    -            {
    -                this.context.fillText(lines[i], linePositionX + xShadowOffset, linePositionY + yShadowOffset);
    -            }
    -
    -          //  if(dropShadow)
    -        }
    -    }
    -
    -    //set canvas text styles
    -    this.context.fillStyle = this.style.fill;
    -    
    -    //draw lines line by line
    -    for (i = 0; i < lines.length; i++)
    -    {
    -        linePositionX = this.style.strokeThickness / 2;
    -        linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent;
    -
    -        if(this.style.align === 'right')
    -        {
    -            linePositionX += maxLineWidth - lineWidths[i];
    -        }
    -        else if(this.style.align === 'center')
    -        {
    -            linePositionX += (maxLineWidth - lineWidths[i]) / 2;
    -        }
    -
    -        if(this.style.stroke && this.style.strokeThickness)
    -        {
    -            this.context.strokeText(lines[i], linePositionX, linePositionY);
    -        }
    -
    -        if(this.style.fill)
    -        {
    -            this.context.fillText(lines[i], linePositionX, linePositionY);
    -        }
    -
    -      //  if(dropShadow)
    -    }
    -
    -    this.updateTexture();
    -};
    -
    -/**
    - * Updates texture size based on canvas size
    - *
    - * @method updateTexture
    - * @private
    - */
    -PIXI.Text.prototype.updateTexture = function()
    -{
    -    this.texture.baseTexture.width = this.canvas.width;
    -    this.texture.baseTexture.height = this.canvas.height;
    -    this.texture.crop.width = this.texture.frame.width = this.canvas.width;
    -    this.texture.crop.height = this.texture.frame.height = this.canvas.height;
    -
    -    this._width = this.canvas.width;
    -    this._height = this.canvas.height;
    -
    -    // update the dirty base textures
    -    this.texture.baseTexture.dirty();
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.Text.prototype._renderWebGL = function(renderSession)
    -{
    -    if(this.dirty)
    -    {
    -        this.resolution = renderSession.resolution;
    -
    -        this.updateText();
    -        this.dirty = false;
    -    }
    -
    -    PIXI.Sprite.prototype._renderWebGL.call(this, renderSession);
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.Text.prototype._renderCanvas = function(renderSession)
    -{
    -    if(this.dirty)
    -    {
    -        this.resolution = renderSession.resolution;
    -
    -        this.updateText();
    -        this.dirty = false;
    -    }
    -     
    -    PIXI.Sprite.prototype._renderCanvas.call(this, renderSession);
    -};
    -
    -/**
    -* Calculates the ascent, descent and fontSize of a given fontStyle
    -*
    -* @method determineFontProperties
    -* @param fontStyle {Object}
    -* @private
    -*/
    -PIXI.Text.prototype.determineFontProperties = function(fontStyle)
    -{
    -    var properties = PIXI.Text.fontPropertiesCache[fontStyle];
    -
    -    if(!properties)
    -    {
    -        properties = {};
    -        
    -        var canvas = PIXI.Text.fontPropertiesCanvas;
    -        var context = PIXI.Text.fontPropertiesContext;
    -
    -        context.font = fontStyle;
    -
    -        var width = Math.ceil(context.measureText('|Mq').width);
    -        var baseline = Math.ceil(context.measureText('M').width);
    -        var height = 2 * baseline;
    -
    -        baseline = baseline * 1.4 | 0;
    -
    -        canvas.width = width;
    -        canvas.height = height;
    -
    -        context.fillStyle = '#f00';
    -        context.fillRect(0, 0, width, height);
    -
    -        context.font = fontStyle;
    -
    -        context.textBaseline = 'alphabetic';
    -        context.fillStyle = '#000';
    -        context.fillText('|Mq', 0, baseline);
    -
    -        var imagedata = context.getImageData(0, 0, width, height).data;
    -        var pixels = imagedata.length;
    -        var line = width * 4;
    -
    -        var i, j;
    -
    -        var idx = 0;
    -        var stop = false;
    -
    -        // ascent. scan from top to bottom until we find a non red pixel
    -        for(i = 0; i < baseline; i++)
    -        {
    -            for(j = 0; j < line; j += 4)
    -            {
    -                if(imagedata[idx + j] !== 255)
    -                {
    -                    stop = true;
    -                    break;
    -                }
    -            }
    -            if(!stop)
    -            {
    -                idx += line;
    -            }
    -            else
    -            {
    -                break;
    -            }
    -        }
    -
    -        properties.ascent = baseline - i;
    -
    -        idx = pixels - line;
    -        stop = false;
    -
    -        // descent. scan from bottom to top until we find a non red pixel
    -        for(i = height; i > baseline; i--)
    -        {
    -            for(j = 0; j < line; j += 4)
    -            {
    -                if(imagedata[idx + j] !== 255)
    -                {
    -                    stop = true;
    -                    break;
    -                }
    -            }
    -            if(!stop)
    -            {
    -                idx -= line;
    -            }
    -            else
    -            {
    -                break;
    -            }
    -        }
    -
    -        properties.descent = i - baseline;
    -        properties.fontSize = properties.ascent + properties.descent;
    -
    -        PIXI.Text.fontPropertiesCache[fontStyle] = properties;
    -    }
    -
    -    return properties;
    -};
    -
    -/**
    - * Applies newlines to a string to have it optimally fit into the horizontal
    - * bounds set by the Text object's wordWrapWidth property.
    - *
    - * @method wordWrap
    - * @param text {String}
    - * @private
    - */
    -PIXI.Text.prototype.wordWrap = function(text)
    -{
    -    // Greedy wrapping algorithm that will wrap words as the line grows longer
    -    // than its horizontal bounds.
    -    var result = '';
    -    var lines = text.split('\n');
    -    for (var i = 0; i < lines.length; i++)
    -    {
    -        var spaceLeft = this.style.wordWrapWidth;
    -        var words = lines[i].split(' ');
    -        for (var j = 0; j < words.length; j++)
    -        {
    -            var wordWidth = this.context.measureText(words[j]).width;
    -            var wordWidthWithSpace = wordWidth + this.context.measureText(' ').width;
    -            if(j === 0 || wordWidthWithSpace > spaceLeft)
    -            {
    -                // Skip printing the newline if it's the first word of the line that is
    -                // greater than the word wrap width.
    -                if(j > 0)
    -                {
    -                    result += '\n';
    -                }
    -                result += words[j];
    -                spaceLeft = this.style.wordWrapWidth - wordWidth;
    -            }
    -            else
    -            {
    -                spaceLeft -= wordWidthWithSpace;
    -                result += ' ' + words[j];
    -            }
    -        }
    -
    -        if (i < lines.length-1)
    -        {
    -            result += '\n';
    -        }
    -    }
    -    return result;
    -};
    -
    -/**
    -* Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account.
    -*
    -* @method getBounds
    -* @param matrix {Matrix} the transformation matrix of the Text
    -* @return {Rectangle} the framing rectangle
    -*/
    -PIXI.Text.prototype.getBounds = function(matrix)
    -{
    -    if(this.dirty)
    -    {
    -        this.updateText();
    -        this.dirty = false;
    -    }
    -
    -    return PIXI.Sprite.prototype.getBounds.call(this, matrix);
    -};
    -
    -/**
    - * Destroys this text object.
    - *
    - * @method destroy
    - * @param destroyBaseTexture {Boolean} whether to destroy the base texture as well
    - */
    -PIXI.Text.prototype.destroy = function(destroyBaseTexture)
    -{
    -    // make sure to reset the the context and canvas.. dont want this hanging around in memory!
    -    this.context = null;
    -    this.canvas = null;
    -
    -    this.texture.destroy(destroyBaseTexture === undefined ? true : destroyBaseTexture);
    -};
    -
    -PIXI.Text.fontPropertiesCache = {};
    -PIXI.Text.fontPropertiesCanvas = document.createElement('canvas');
    -PIXI.Text.fontPropertiesContext = PIXI.Text.fontPropertiesCanvas.getContext('2d');
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_textures_BaseTexture.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_textures_BaseTexture.js.html deleted file mode 100755 index 4c34275..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_textures_BaseTexture.js.html +++ /dev/null @@ -1,573 +0,0 @@ - - - - - src/pixi/textures/BaseTexture.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/textures/BaseTexture.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -PIXI.BaseTextureCache = {};
    -
    -PIXI.BaseTextureCacheIdGenerator = 0;
    -
    -/**
    - * A texture stores the information that represents an image. All textures have a base texture.
    - *
    - * @class BaseTexture
    - * @uses EventTarget
    - * @constructor
    - * @param source {String} the source object (image or canvas)
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - */
    -PIXI.BaseTexture = function(source, scaleMode)
    -{
    -    /**
    -     * The Resolution of the texture. 
    -     *
    -     * @property resolution
    -     * @type Number
    -     */
    -    this.resolution = 1;
    -    
    -    /**
    -     * [read-only] The width of the base texture set when the image has loaded
    -     *
    -     * @property width
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.width = 100;
    -
    -    /**
    -     * [read-only] The height of the base texture set when the image has loaded
    -     *
    -     * @property height
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.height = 100;
    -
    -    /**
    -     * The scale mode to apply when scaling this texture
    -     * 
    -     * @property scaleMode
    -     * @type PIXI.scaleModes
    -     * @default PIXI.scaleModes.LINEAR
    -     */
    -    this.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT;
    -
    -    /**
    -     * [read-only] Set to true once the base texture has loaded
    -     *
    -     * @property hasLoaded
    -     * @type Boolean
    -     * @readOnly
    -     */
    -    this.hasLoaded = false;
    -
    -    /**
    -     * The image source that is used to create the texture.
    -     *
    -     * @property source
    -     * @type Image
    -     */
    -    this.source = source;
    -
    -    this._UID = PIXI._UID++;
    -
    -    /**
    -     * Controls if RGB channels should be pre-multiplied by Alpha  (WebGL only)
    -     *
    -     * @property premultipliedAlpha
    -     * @type Boolean
    -     * @default true
    -     */
    -    this.premultipliedAlpha = true;
    -
    -    // used for webGL
    -
    -    /**
    -     * @property _glTextures
    -     * @type Array
    -     * @private
    -     */
    -    this._glTextures = [];
    -
    -    // used for webGL texture updating...
    -    // TODO - this needs to be addressed
    -
    -    /**
    -     * @property _dirty
    -     * @type Array
    -     * @private
    -     */
    -    this._dirty = [true, true, true, true];
    -
    -    if(!source)return;
    -
    -    if((this.source.complete || this.source.getContext) && this.source.width && this.source.height)
    -    {
    -        this.hasLoaded = true;
    -        this.width = this.source.naturalWidth || this.source.width;
    -        this.height = this.source.naturalHeight || this.source.height;
    -        this.dirty();
    -    }
    -    else
    -    {
    -        var scope = this;
    -
    -        this.source.onload = function() {
    -
    -            scope.hasLoaded = true;
    -            scope.width = scope.source.naturalWidth || scope.source.width;
    -            scope.height = scope.source.naturalHeight || scope.source.height;
    -
    -            scope.dirty();
    -
    -            // add it to somewhere...
    -            scope.dispatchEvent( { type: 'loaded', content: scope } );
    -        };
    -
    -        this.source.onerror = function() {
    -            scope.dispatchEvent( { type: 'error', content: scope } );
    -        };
    -    }
    -
    -    /**
    -     * @property imageUrl
    -     * @type String
    -     */
    -    this.imageUrl = null;
    -
    -    /**
    -     * @property _powerOf2
    -     * @type Boolean
    -     * @private
    -     */
    -    this._powerOf2 = false;
    -
    -};
    -
    -PIXI.BaseTexture.prototype.constructor = PIXI.BaseTexture;
    -
    -PIXI.EventTarget.mixin(PIXI.BaseTexture.prototype);
    -
    -/**
    - * Destroys this base texture
    - *
    - * @method destroy
    - */
    -PIXI.BaseTexture.prototype.destroy = function()
    -{
    -    if(this.imageUrl)
    -    {
    -        delete PIXI.BaseTextureCache[this.imageUrl];
    -        delete PIXI.TextureCache[this.imageUrl];
    -        this.imageUrl = null;
    -        if (!navigator.isCocoonJS) this.source.src = '';
    -    }
    -    else if (this.source && this.source._pixiId)
    -    {
    -        delete PIXI.BaseTextureCache[this.source._pixiId];
    -    }
    -    this.source = null;
    -
    -    this.unloadFromGPU();
    -};
    -
    -/**
    - * Changes the source image of the texture
    - *
    - * @method updateSourceImage
    - * @param newSrc {String} the path of the image
    - */
    -PIXI.BaseTexture.prototype.updateSourceImage = function(newSrc)
    -{
    -    this.hasLoaded = false;
    -    this.source.src = null;
    -    this.source.src = newSrc;
    -};
    -
    -/**
    - * Sets all glTextures to be dirty.
    - *
    - * @method dirty
    - */
    -PIXI.BaseTexture.prototype.dirty = function()
    -{
    -    for (var i = 0; i < this._glTextures.length; i++)
    -    {
    -        this._dirty[i] = true;
    -    }
    -};
    -
    -/**
    - * Removes the base texture from the GPU, useful for managing resources on the GPU.
    - * Atexture is still 100% usable and will simply be reuploaded if there is a sprite on screen that is using it.
    - *
    - * @method unloadFromGPU
    - */
    -PIXI.BaseTexture.prototype.unloadFromGPU = function()
    -{
    -    this.dirty();
    -
    -    // delete the webGL textures if any.
    -    for (var i = this._glTextures.length - 1; i >= 0; i--)
    -    {
    -        var glTexture = this._glTextures[i];
    -        var gl = PIXI.glContexts[i];
    -
    -        if(gl && glTexture)
    -        {
    -            gl.deleteTexture(glTexture);
    -        }
    -        
    -    }
    -
    -    this._glTextures.length = 0;
    -
    -    this.dirty();
    -};
    -
    -/**
    - * Helper function that creates a base texture from the given image url.
    - * If the image is not in the base texture cache it will be created and loaded.
    - *
    - * @static
    - * @method fromImage
    - * @param imageUrl {String} The image url of the texture
    - * @param crossorigin {Boolean}
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @return BaseTexture
    - */
    -PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode)
    -{
    -    var baseTexture = PIXI.BaseTextureCache[imageUrl];
    -
    -    if(crossorigin === undefined && imageUrl.indexOf('data:') === -1) crossorigin = true;
    -
    -    if(!baseTexture)
    -    {
    -        // new Image() breaks tex loading in some versions of Chrome.
    -        // See https://code.google.com/p/chromium/issues/detail?id=238071
    -        var image = new Image();//document.createElement('img');
    -        if (crossorigin)
    -        {
    -            image.crossOrigin = '';
    -        }
    -
    -        image.src = imageUrl;
    -        baseTexture = new PIXI.BaseTexture(image, scaleMode);
    -        baseTexture.imageUrl = imageUrl;
    -        PIXI.BaseTextureCache[imageUrl] = baseTexture;
    -
    -        // if there is an @2x at the end of the url we are going to assume its a highres image
    -        if( imageUrl.indexOf(PIXI.RETINA_PREFIX + '.') !== -1)
    -        {
    -            baseTexture.resolution = 2;
    -        }
    -    }
    -
    -    return baseTexture;
    -};
    -
    -/**
    - * Helper function that creates a base texture from the given canvas element.
    - *
    - * @static
    - * @method fromCanvas
    - * @param canvas {Canvas} The canvas element source of the texture
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @return BaseTexture
    - */
    -PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode)
    -{
    -    if(!canvas._pixiId)
    -    {
    -        canvas._pixiId = 'canvas_' + PIXI.TextureCacheIdGenerator++;
    -    }
    -
    -    var baseTexture = PIXI.BaseTextureCache[canvas._pixiId];
    -
    -    if(!baseTexture)
    -    {
    -        baseTexture = new PIXI.BaseTexture(canvas, scaleMode);
    -        PIXI.BaseTextureCache[canvas._pixiId] = baseTexture;
    -    }
    -
    -    return baseTexture;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_textures_RenderTexture.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_textures_RenderTexture.js.html deleted file mode 100755 index 23c4f84..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_textures_RenderTexture.js.html +++ /dev/null @@ -1,614 +0,0 @@ - - - - - src/pixi/textures/RenderTexture.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/textures/RenderTexture.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A RenderTexture is a special texture that allows any Pixi display object to be rendered to it.
    - *
    - * __Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead.
    - *
    - * A RenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example:
    - *
    - *    var renderTexture = new PIXI.RenderTexture(800, 600);
    - *    var sprite = PIXI.Sprite.fromImage("spinObj_01.png");
    - *    sprite.position.x = 800/2;
    - *    sprite.position.y = 600/2;
    - *    sprite.anchor.x = 0.5;
    - *    sprite.anchor.y = 0.5;
    - *    renderTexture.render(sprite);
    - *
    - * The Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual position a DisplayObjectContainer should be used:
    - *
    - *    var doc = new PIXI.DisplayObjectContainer();
    - *    doc.addChild(sprite);
    - *    renderTexture.render(doc);  // Renders to center of renderTexture
    - *
    - * @class RenderTexture
    - * @extends Texture
    - * @constructor
    - * @param width {Number} The width of the render texture
    - * @param height {Number} The height of the render texture
    - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @param resolution {Number} The resolution of the texture being generated
    - */
    -PIXI.RenderTexture = function(width, height, renderer, scaleMode, resolution)
    -{
    -    /**
    -     * The with of the render texture
    -     *
    -     * @property width
    -     * @type Number
    -     */
    -    this.width = width || 100;
    -
    -    /**
    -     * The height of the render texture
    -     *
    -     * @property height
    -     * @type Number
    -     */
    -    this.height = height || 100;
    -
    -    /**
    -     * The Resolution of the texture.
    -     *
    -     * @property resolution
    -     * @type Number
    -     */
    -    this.resolution = resolution || 1;
    -
    -    /**
    -     * The framing rectangle of the render texture
    -     *
    -     * @property frame
    -     * @type Rectangle
    -     */
    -    this.frame = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution);
    -
    -    /**
    -     * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,
    -     * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)
    -     *
    -     * @property crop
    -     * @type Rectangle
    -     */
    -    this.crop = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution);
    -
    -    /**
    -     * The base texture object that this texture uses
    -     *
    -     * @property baseTexture
    -     * @type BaseTexture
    -     */
    -    this.baseTexture = new PIXI.BaseTexture();
    -    this.baseTexture.width = this.width * this.resolution;
    -    this.baseTexture.height = this.height * this.resolution;
    -    this.baseTexture._glTextures = [];
    -    this.baseTexture.resolution = this.resolution;
    -
    -    this.baseTexture.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT;
    -
    -    this.baseTexture.hasLoaded = true;
    -
    -    PIXI.Texture.call(this,
    -        this.baseTexture,
    -        new PIXI.Rectangle(0, 0, this.width, this.height)
    -    );
    -
    -    /**
    -     * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL.
    -     *
    -     * @property renderer
    -     * @type CanvasRenderer|WebGLRenderer
    -     */
    -    this.renderer = renderer || PIXI.defaultRenderer;
    -
    -    if(this.renderer.type === PIXI.WEBGL_RENDERER)
    -    {
    -        var gl = this.renderer.gl;
    -        this.baseTexture._dirty[gl.id] = false;
    -
    -        this.textureBuffer = new PIXI.FilterTexture(gl, this.width * this.resolution, this.height * this.resolution, this.baseTexture.scaleMode);
    -        this.baseTexture._glTextures[gl.id] =  this.textureBuffer.texture;
    -
    -        this.render = this.renderWebGL;
    -        this.projection = new PIXI.Point(this.width*0.5, -this.height*0.5);
    -    }
    -    else
    -    {
    -        this.render = this.renderCanvas;
    -        this.textureBuffer = new PIXI.CanvasBuffer(this.width* this.resolution, this.height* this.resolution);
    -        this.baseTexture.source = this.textureBuffer.canvas;
    -    }
    -
    -    /**
    -     * @property valid
    -     * @type Boolean
    -     */
    -    this.valid = true;
    -
    -    this._updateUvs();
    -};
    -
    -PIXI.RenderTexture.prototype = Object.create(PIXI.Texture.prototype);
    -PIXI.RenderTexture.prototype.constructor = PIXI.RenderTexture;
    -
    -/**
    - * Resizes the RenderTexture.
    - *
    - * @method resize
    - * @param width {Number} The width to resize to.
    - * @param height {Number} The height to resize to.
    - * @param updateBase {Boolean} Should the baseTexture.width and height values be resized as well?
    - */
    -PIXI.RenderTexture.prototype.resize = function(width, height, updateBase)
    -{
    -    if (width === this.width && height === this.height)return;
    -
    -    this.valid = (width > 0 && height > 0);
    -
    -    this.width = this.frame.width = this.crop.width = width;
    -    this.height =  this.frame.height = this.crop.height = height;
    -
    -    if (updateBase)
    -    {
    -        this.baseTexture.width = this.width;
    -        this.baseTexture.height = this.height;
    -    }
    -
    -    if (this.renderer.type === PIXI.WEBGL_RENDERER)
    -    {
    -        this.projection.x = this.width / 2;
    -        this.projection.y = -this.height / 2;
    -    }
    -
    -    if(!this.valid)return;
    -
    -    this.textureBuffer.resize(this.width * this.resolution, this.height * this.resolution);
    -};
    -
    -/**
    - * Clears the RenderTexture.
    - *
    - * @method clear
    - */
    -PIXI.RenderTexture.prototype.clear = function()
    -{
    -    if(!this.valid)return;
    -
    -    if (this.renderer.type === PIXI.WEBGL_RENDERER)
    -    {
    -        this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer);
    -    }
    -
    -    this.textureBuffer.clear();
    -};
    -
    -/**
    - * This function will draw the display object to the texture.
    - *
    - * @method renderWebGL
    - * @param displayObject {DisplayObject} The display object to render this texture on
    - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering.
    - * @param [clear] {Boolean} If true the texture will be cleared before the displayObject is drawn
    - * @private
    - */
    -PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, matrix, clear)
    -{
    -    if(!this.valid)return;
    -    //TOOD replace position with matrix..
    -   
    -    //Lets create a nice matrix to apply to our display object. Frame buffers come in upside down so we need to flip the matrix 
    -    var wt = displayObject.worldTransform;
    -    wt.identity();
    -    wt.translate(0, this.projection.y * 2);
    -    if(matrix)wt.append(matrix);
    -    wt.scale(1,-1);
    -
    -    // setWorld Alpha to ensure that the object is renderer at full opacity
    -    displayObject.worldAlpha = 1;
    -
    -    // Time to update all the children of the displayObject with the new matrix..    
    -    var children = displayObject.children;
    -
    -    for(var i=0,j=children.length; i<j; i++)
    -    {
    -        children[i].updateTransform();
    -    }
    -    
    -    // time for the webGL fun stuff!
    -    var gl = this.renderer.gl;
    -
    -    gl.viewport(0, 0, this.width * this.resolution, this.height * this.resolution);
    -
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, this.textureBuffer.frameBuffer );
    -
    -    if(clear)this.textureBuffer.clear();
    -
    -    this.renderer.spriteBatch.dirty = true;
    -
    -    this.renderer.renderDisplayObject(displayObject, this.projection, this.textureBuffer.frameBuffer);
    -
    -    this.renderer.spriteBatch.dirty = true;
    -};
    -
    -
    -/**
    - * This function will draw the display object to the texture.
    - *
    - * @method renderCanvas
    - * @param displayObject {DisplayObject} The display object to render this texture on
    - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering.
    - * @param [clear] {Boolean} If true the texture will be cleared before the displayObject is drawn
    - * @private
    - */
    -PIXI.RenderTexture.prototype.renderCanvas = function(displayObject, matrix, clear)
    -{
    -    if(!this.valid)return;
    -
    -    var wt = displayObject.worldTransform;
    -    wt.identity();
    -    if(matrix)wt.append(matrix);
    -    
    -    // setWorld Alpha to ensure that the object is renderer at full opacity
    -    displayObject.worldAlpha = 1;
    -
    -    // Time to update all the children of the displayObject with the new matrix..    
    -    var children = displayObject.children;
    -
    -    for(var i = 0, j = children.length; i < j; i++)
    -    {
    -        children[i].updateTransform();
    -    }
    -
    -    if(clear)this.textureBuffer.clear();
    -
    -    var context = this.textureBuffer.context;
    -
    -    var realResolution = this.renderer.resolution;
    -
    -    this.renderer.resolution = this.resolution;
    -
    -    this.renderer.renderDisplayObject(displayObject, context);
    -
    -    this.renderer.resolution = realResolution;
    -};
    -
    -/**
    - * Will return a HTML Image of the texture
    - *
    - * @method getImage
    - * @return {Image}
    - */
    -PIXI.RenderTexture.prototype.getImage = function()
    -{
    -    var image = new Image();
    -    image.src = this.getBase64();
    -    return image;
    -};
    -
    -/**
    - * Will return a a base64 encoded string of this texture. It works by calling RenderTexture.getCanvas and then running toDataURL on that.
    - *
    - * @method getBase64
    - * @return {String} A base64 encoded string of the texture.
    - */
    -PIXI.RenderTexture.prototype.getBase64 = function()
    -{
    -    return this.getCanvas().toDataURL();
    -};
    -
    -/**
    - * Creates a Canvas element, renders this RenderTexture to it and then returns it.
    - *
    - * @method getCanvas
    - * @return {HTMLCanvasElement} A Canvas element with the texture rendered on.
    - */
    -PIXI.RenderTexture.prototype.getCanvas = function()
    -{
    -    if (this.renderer.type === PIXI.WEBGL_RENDERER)
    -    {
    -        var gl =  this.renderer.gl;
    -        var width = this.textureBuffer.width;
    -        var height = this.textureBuffer.height;
    -
    -        var webGLPixels = new Uint8Array(4 * width * height);
    -
    -        gl.bindFramebuffer(gl.FRAMEBUFFER, this.textureBuffer.frameBuffer);
    -        gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, webGLPixels);
    -        gl.bindFramebuffer(gl.FRAMEBUFFER, null);
    -
    -        var tempCanvas = new PIXI.CanvasBuffer(width, height);
    -        var canvasData = tempCanvas.context.getImageData(0, 0, width, height);
    -        canvasData.data.set(webGLPixels);
    -
    -        tempCanvas.context.putImageData(canvasData, 0, 0);
    -
    -        return tempCanvas.canvas;
    -    }
    -    else
    -    {
    -        return this.textureBuffer.canvas;
    -    }
    -};
    -
    -PIXI.RenderTexture.tempMatrix = new PIXI.Matrix();
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_textures_Texture.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_textures_Texture.js.html deleted file mode 100755 index 179da16..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_textures_Texture.js.html +++ /dev/null @@ -1,607 +0,0 @@ - - - - - src/pixi/textures/Texture.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/textures/Texture.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -PIXI.TextureCache = {};
    -PIXI.FrameCache = {};
    -
    -PIXI.TextureCacheIdGenerator = 0;
    -
    -/**
    - * A texture stores the information that represents an image or part of an image. It cannot be added
    - * to the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used.
    - *
    - * @class Texture
    - * @uses EventTarget
    - * @constructor
    - * @param baseTexture {BaseTexture} The base texture source to create the texture from
    - * @param frame {Rectangle} The rectangle frame of the texture to show
    - * @param [crop] {Rectangle} The area of original texture 
    - * @param [trim] {Rectangle} Trimmed texture rectangle
    - */
    -PIXI.Texture = function(baseTexture, frame, crop, trim)
    -{
    -    /**
    -     * Does this Texture have any frame data assigned to it?
    -     *
    -     * @property noFrame
    -     * @type Boolean
    -     */
    -    this.noFrame = false;
    -
    -    if (!frame)
    -    {
    -        this.noFrame = true;
    -        frame = new PIXI.Rectangle(0,0,1,1);
    -    }
    -
    -    if (baseTexture instanceof PIXI.Texture)
    -    {
    -        baseTexture = baseTexture.baseTexture;
    -    }
    -
    -    /**
    -     * The base texture that this texture uses.
    -     *
    -     * @property baseTexture
    -     * @type BaseTexture
    -     */
    -    this.baseTexture = baseTexture;
    -
    -    /**
    -     * The frame specifies the region of the base texture that this texture uses
    -     *
    -     * @property frame
    -     * @type Rectangle
    -     */
    -    this.frame = frame;
    -
    -    /**
    -     * The texture trim data.
    -     *
    -     * @property trim
    -     * @type Rectangle
    -     */
    -    this.trim = trim;
    -
    -    /**
    -     * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.
    -     *
    -     * @property valid
    -     * @type Boolean
    -     */
    -    this.valid = false;
    -
    -    /**
    -     * This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)
    -     *
    -     * @property requiresUpdate
    -     * @type Boolean
    -     */
    -    this.requiresUpdate = false;
    -
    -    /**
    -     * The WebGL UV data cache.
    -     *
    -     * @property _uvs
    -     * @type Object
    -     * @private
    -     */
    -    this._uvs = null;
    -
    -    /**
    -     * The width of the Texture in pixels.
    -     *
    -     * @property width
    -     * @type Number
    -     */
    -    this.width = 0;
    -
    -    /**
    -     * The height of the Texture in pixels.
    -     *
    -     * @property height
    -     * @type Number
    -     */
    -    this.height = 0;
    -
    -    /**
    -     * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,
    -     * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)
    -     *
    -     * @property crop
    -     * @type Rectangle
    -     */
    -    this.crop = crop || new PIXI.Rectangle(0, 0, 1, 1);
    -
    -    if (baseTexture.hasLoaded)
    -    {
    -        if (this.noFrame) frame = new PIXI.Rectangle(0, 0, baseTexture.width, baseTexture.height);
    -        this.setFrame(frame);
    -    }
    -    else
    -    {
    -        baseTexture.addEventListener('loaded', this.onBaseTextureLoaded.bind(this));
    -    }
    -};
    -
    -PIXI.Texture.prototype.constructor = PIXI.Texture;
    -PIXI.EventTarget.mixin(PIXI.Texture.prototype);
    -
    -/**
    - * Called when the base texture is loaded
    - *
    - * @method onBaseTextureLoaded
    - * @private
    - */
    -PIXI.Texture.prototype.onBaseTextureLoaded = function()
    -{
    -    var baseTexture = this.baseTexture;
    -    baseTexture.removeEventListener('loaded', this.onLoaded);
    -
    -    if (this.noFrame) this.frame = new PIXI.Rectangle(0, 0, baseTexture.width, baseTexture.height);
    -
    -    this.setFrame(this.frame);
    -
    -    this.dispatchEvent( { type: 'update', content: this } );
    -};
    -
    -/**
    - * Destroys this texture
    - *
    - * @method destroy
    - * @param destroyBase {Boolean} Whether to destroy the base texture as well
    - */
    -PIXI.Texture.prototype.destroy = function(destroyBase)
    -{
    -    if (destroyBase) this.baseTexture.destroy();
    -
    -    this.valid = false;
    -};
    -
    -/**
    - * Specifies the region of the baseTexture that this texture will use.
    - *
    - * @method setFrame
    - * @param frame {Rectangle} The frame of the texture to set it to
    - */
    -PIXI.Texture.prototype.setFrame = function(frame)
    -{
    -    this.noFrame = false;
    -
    -    this.frame = frame;
    -    this.width = frame.width;
    -    this.height = frame.height;
    -
    -    this.crop.x = frame.x;
    -    this.crop.y = frame.y;
    -    this.crop.width = frame.width;
    -    this.crop.height = frame.height;
    -
    -    if (!this.trim && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height))
    -    {
    -        throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this);
    -    }
    -
    -    this.valid = frame && frame.width && frame.height && this.baseTexture.source && this.baseTexture.hasLoaded;
    -
    -    if (this.trim)
    -    {
    -        this.width = this.trim.width;
    -        this.height = this.trim.height;
    -        this.frame.width = this.trim.width;
    -        this.frame.height = this.trim.height;
    -    }
    -    
    -    if (this.valid) this._updateUvs();
    -
    -};
    -
    -/**
    - * Updates the internal WebGL UV cache.
    - *
    - * @method _updateUvs
    - * @private
    - */
    -PIXI.Texture.prototype._updateUvs = function()
    -{
    -    if(!this._uvs)this._uvs = new PIXI.TextureUvs();
    -
    -    var frame = this.crop;
    -    var tw = this.baseTexture.width;
    -    var th = this.baseTexture.height;
    -    
    -    this._uvs.x0 = frame.x / tw;
    -    this._uvs.y0 = frame.y / th;
    -
    -    this._uvs.x1 = (frame.x + frame.width) / tw;
    -    this._uvs.y1 = frame.y / th;
    -
    -    this._uvs.x2 = (frame.x + frame.width) / tw;
    -    this._uvs.y2 = (frame.y + frame.height) / th;
    -
    -    this._uvs.x3 = frame.x / tw;
    -    this._uvs.y3 = (frame.y + frame.height) / th;
    -};
    -
    -/**
    - * Helper function that creates a Texture object from the given image url.
    - * If the image is not in the texture cache it will be  created and loaded.
    - *
    - * @static
    - * @method fromImage
    - * @param imageUrl {String} The image url of the texture
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @return Texture
    - */
    -PIXI.Texture.fromImage = function(imageUrl, crossorigin, scaleMode)
    -{
    -    var texture = PIXI.TextureCache[imageUrl];
    -
    -    if(!texture)
    -    {
    -        texture = new PIXI.Texture(PIXI.BaseTexture.fromImage(imageUrl, crossorigin, scaleMode));
    -        PIXI.TextureCache[imageUrl] = texture;
    -    }
    -
    -    return texture;
    -};
    -
    -/**
    - * Helper function that returns a Texture objected based on the given frame id.
    - * If the frame id is not in the texture cache an error will be thrown.
    - *
    - * @static
    - * @method fromFrame
    - * @param frameId {String} The frame id of the texture
    - * @return Texture
    - */
    -PIXI.Texture.fromFrame = function(frameId)
    -{
    -    var texture = PIXI.TextureCache[frameId];
    -    if(!texture) throw new Error('The frameId "' + frameId + '" does not exist in the texture cache ');
    -    return texture;
    -};
    -
    -/**
    - * Helper function that creates a new a Texture based on the given canvas element.
    - *
    - * @static
    - * @method fromCanvas
    - * @param canvas {Canvas} The canvas element source of the texture
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @return Texture
    - */
    -PIXI.Texture.fromCanvas = function(canvas, scaleMode)
    -{
    -    var baseTexture = PIXI.BaseTexture.fromCanvas(canvas, scaleMode);
    -
    -    return new PIXI.Texture( baseTexture );
    -
    -};
    -
    -/**
    - * Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object.
    - *
    - * @static
    - * @method addTextureToCache
    - * @param texture {Texture} The Texture to add to the cache.
    - * @param id {String} The id that the texture will be stored against.
    - */
    -PIXI.Texture.addTextureToCache = function(texture, id)
    -{
    -    PIXI.TextureCache[id] = texture;
    -};
    -
    -/**
    - * Remove a texture from the global PIXI.TextureCache.
    - *
    - * @static
    - * @method removeTextureFromCache
    - * @param id {String} The id of the texture to be removed
    - * @return {Texture} The texture that was removed
    - */
    -PIXI.Texture.removeTextureFromCache = function(id)
    -{
    -    var texture = PIXI.TextureCache[id];
    -    delete PIXI.TextureCache[id];
    -    delete PIXI.BaseTextureCache[id];
    -    return texture;
    -};
    -
    -PIXI.TextureUvs = function()
    -{
    -    this.x0 = 0;
    -    this.y0 = 0;
    -
    -    this.x1 = 0;
    -    this.y1 = 0;
    -
    -    this.x2 = 0;
    -    this.y2 = 0;
    -
    -    this.x3 = 0;
    -    this.y3 = 0;
    -};
    -
    -PIXI.Texture.emptyTexture = new PIXI.Texture(new PIXI.BaseTexture());
    -
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_textures_VideoTexture.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_textures_VideoTexture.js.html deleted file mode 100755 index 4e746c8..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_textures_VideoTexture.js.html +++ /dev/null @@ -1,424 +0,0 @@ - - - - - src/pixi/textures/VideoTexture.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/textures/VideoTexture.js

    - -
    -
    -
    -PIXI.VideoTexture = function( source, scaleMode )
    -{
    -    if( !source ){
    -        throw new Error( 'No video source element specified.' );
    -    }
    -
    -    // hook in here to check if video is already available.
    -    // PIXI.BaseTexture looks for a source.complete boolean, plus width & height.
    -
    -    if( (source.readyState === source.HAVE_ENOUGH_DATA || source.readyState === source.HAVE_FUTURE_DATA ) && source.width && source.height )
    -    {
    -        source.complete = true;
    -    }
    -
    -    PIXI.BaseTexture.call( this, source, scaleMode );
    -
    -    this.autoUpdate = false;
    -    this.updateBound = this._onUpdate.bind(this);
    -
    -    if( !source.complete )
    -    {
    -        this._onCanPlay = this.onCanPlay.bind(this);
    -
    -        source.addEventListener( 'canplay', this._onCanPlay );
    -        source.addEventListener( 'canplaythrough', this._onCanPlay );
    -
    -        // started playing..
    -        source.addEventListener( 'play', this.onPlayStart.bind(this) );
    -        source.addEventListener( 'pause', this.onPlayStop.bind(this) );
    -    }
    -
    -};
    -
    -PIXI.VideoTexture.prototype   = Object.create( PIXI.BaseTexture.prototype );
    -
    -PIXI.VideoTexture.constructor = PIXI.VideoTexture;
    -
    -PIXI.VideoTexture.prototype._onUpdate = function()
    -{
    -    if(this.autoUpdate)
    -    {
    -        window.requestAnimationFrame(this.updateBound);
    -        this.dirty();
    -    }
    -};
    -
    -PIXI.VideoTexture.prototype.onPlayStart = function()
    -{
    -    if(!this.autoUpdate)
    -    {
    -        window.requestAnimationFrame(this.updateBound);
    -        this.autoUpdate = true;
    -    }
    -};
    -
    -PIXI.VideoTexture.prototype.onPlayStop = function()
    -{
    -    this.autoUpdate = false;
    -};
    -
    -PIXI.VideoTexture.prototype.onCanPlay = function()
    -{
    -    if( event.type === 'canplaythrough' )
    -    {
    -        this.hasLoaded  = true;
    -
    -
    -        if( this.source )
    -        {
    -            this.source.removeEventListener( 'canplay', this._onCanPlay );
    -            this.source.removeEventListener( 'canplaythrough', this._onCanPlay );
    -
    -            this.width      = this.source.videoWidth;
    -            this.height     = this.source.videoHeight;
    -
    -            // prevent multiple loaded dispatches..
    -            if( !this.__loaded ){
    -                this.__loaded = true;
    -                this.dispatchEvent( { type: 'loaded', content: this } );
    -            }
    -        }
    -    }
    -};
    -
    -
    -/**
    - * Mimic Pixi BaseTexture.from.... method.
    - * @param video
    - * @param scaleMode
    - * @returns {PIXI.VideoTexture}
    - */
    -PIXI.VideoTexture.baseTextureFromVideo = function( video, scaleMode )
    -{
    -    if( !video._pixiId )
    -    {
    -        video._pixiId = 'video_' + PIXI.TextureCacheIdGenerator++;
    -    }
    -
    -    var baseTexture = PIXI.BaseTextureCache[ video._pixiId ];
    -
    -    if( !baseTexture )
    -    {
    -        baseTexture = new PIXI.VideoTexture( video, scaleMode );
    -        PIXI.BaseTextureCache[ video._pixiId ] = baseTexture;
    -    }
    -
    -    return baseTexture;
    -};
    -
    -
    -PIXI.VideoTexture.prototype.destroy = function()
    -{
    -    if( this.source && this.source._pixiId )
    -    {
    -        PIXI.BaseTextureCache[ this.source._pixiId ] = null;
    -        delete PIXI.BaseTextureCache[ this.source._pixiId ];
    -
    -        this.source._pixiId = null;
    -        delete this.source._pixiId;
    -    }
    -
    -    PIXI.BaseTexture.prototype.destroy.call( this );
    -};
    -
    -/**
    - * Mimic PIXI Texture.from... method.
    - * @param video
    - * @param scaleMode
    - * @returns {PIXI.Texture}
    - */
    -PIXI.VideoTexture.textureFromVideo = function( video, scaleMode )
    -{
    -    var baseTexture = PIXI.VideoTexture.baseTextureFromVideo( video, scaleMode );
    -    return new PIXI.Texture( baseTexture );
    -};
    -
    -PIXI.VideoTexture.fromUrl = function( videoSrc, scaleMode )
    -{
    -    var video = document.createElement('video');
    -    video.src = videoSrc;
    -    video.autoPlay = true;
    -    video.play();
    -    return PIXI.VideoTexture.textureFromVideo( video, scaleMode);
    -};
    -
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_utils_Detector.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_utils_Detector.js.html deleted file mode 100755 index 3e9861a..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_utils_Detector.js.html +++ /dev/null @@ -1,363 +0,0 @@ - - - - - src/pixi/utils/Detector.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/utils/Detector.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This helper function will automatically detect which renderer you should be using.
    - * WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by
    - * the browser then this function will return a canvas renderer
    - * @class autoDetectRenderer
    - * @static
    - * @param width=800 {Number} the width of the renderers view
    - * @param height=600 {Number} the height of the renderers view
    - * 
    - * @param [options] {Object} The optional renderer parameters
    - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional
    - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false
    - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment)
    - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context
    - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2
    - * 
    - */
    -PIXI.autoDetectRenderer = function(width, height, options)
    -{
    -    if(!width)width = 800;
    -    if(!height)height = 600;
    -
    -    // BORROWED from Mr Doob (mrdoob.com)
    -    var webgl = ( function () { try {
    -                                    var canvas = document.createElement( 'canvas' );
    -                                    return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) );
    -                                } catch( e ) {
    -                                    return false;
    -                                }
    -                            } )();
    -
    -    if( webgl )
    -    {
    -        return new PIXI.WebGLRenderer(width, height, options);
    -    }
    -
    -    return  new PIXI.CanvasRenderer(width, height, options);
    -};
    -
    -/**
    - * This helper function will automatically detect which renderer you should be using.
    - * This function is very similar to the autoDetectRenderer function except that is will return a canvas renderer for android.
    - * Even thought both android chrome supports webGL the canvas implementation perform better at the time of writing. 
    - * This function will likely change and update as webGL performance improves on these devices.
    - * 
    - * @class autoDetectRecommendedRenderer
    - * @static
    - * @param width=800 {Number} the width of the renderers view
    - * @param height=600 {Number} the height of the renderers view
    - * 
    - * @param [options] {Object} The optional renderer parameters
    - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional
    - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false
    - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment)
    - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context
    - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2
    - * 
    - */
    -PIXI.autoDetectRecommendedRenderer = function(width, height, options)
    -{
    -    if(!width)width = 800;
    -    if(!height)height = 600;
    -
    -    // BORROWED from Mr Doob (mrdoob.com)
    -    var webgl = ( function () { try {
    -                                    var canvas = document.createElement( 'canvas' );
    -                                    return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) );
    -                                } catch( e ) {
    -                                    return false;
    -                                }
    -                            } )();
    -
    -    var isAndroid = /Android/i.test(navigator.userAgent);
    -
    -    if( webgl && !isAndroid)
    -    {
    -        return new PIXI.WebGLRenderer(width, height, options);
    -    }
    -
    -    return  new PIXI.CanvasRenderer(width, height, options);
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_utils_EventTarget.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_utils_EventTarget.js.html deleted file mode 100755 index 39afb18..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_utils_EventTarget.js.html +++ /dev/null @@ -1,562 +0,0 @@ - - - - - src/pixi/utils/EventTarget.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/utils/EventTarget.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * @author Chad Engler https://github.com/englercj @Rolnaaba
    - */
    -
    -/**
    - * Originally based on https://github.com/mrdoob/eventtarget.js/ from mr Doob.
    - * Currently takes inspiration from the nodejs EventEmitter, EventEmitter3, and smokesignals
    - */
    -
    -/**
    - * Mixins event emitter functionality to a class
    - *
    - * @class EventTarget
    - * @example
    - *      function MyEmitter() {}
    - *
    - *      PIXI.EventTarget.mixin(MyEmitter.prototype);
    - *
    - *      var em = new MyEmitter();
    - *      em.emit('eventName', 'some data', 'some more data', {}, null, ...);
    - */
    -PIXI.EventTarget = {
    -    /**
    -     * Backward compat from when this used to be a function
    -     */
    -    call: function callCompat(obj) {
    -        if(obj) {
    -            obj = obj.prototype || obj;
    -            PIXI.EventTarget.mixin(obj);
    -        }
    -    },
    -
    -    /**
    -     * Mixes in the properties of the EventTarget prototype onto another object
    -     *
    -     * @method mixin
    -     * @param object {Object} The obj to mix into
    -     */
    -    mixin: function mixin(obj) {
    -        /**
    -         * Return a list of assigned event listeners.
    -         *
    -         * @method listeners
    -         * @param eventName {String} The events that should be listed.
    -         * @returns {Array} An array of listener functions
    -         */
    -        obj.listeners = function listeners(eventName) {
    -            this._listeners = this._listeners || {};
    -
    -            return this._listeners[eventName] ? this._listeners[eventName].slice() : [];
    -        };
    -
    -        /**
    -         * Emit an event to all registered event listeners.
    -         *
    -         * @method emit
    -         * @alias dispatchEvent
    -         * @param eventName {String} The name of the event.
    -         * @returns {Boolean} Indication if we've emitted an event.
    -         */
    -        obj.emit = obj.dispatchEvent = function emit(eventName, data) {
    -            this._listeners = this._listeners || {};
    -
    -            //backwards compat with old method ".emit({ type: 'something' })"
    -            if(typeof eventName === 'object') {
    -                data = eventName;
    -                eventName = eventName.type;
    -            }
    -
    -            //ensure we are using a real pixi event
    -            if(!data || data.__isEventObject !== true) {
    -                data = new PIXI.Event(this, eventName, data);
    -            }
    -
    -            //iterate the listeners
    -            if(this._listeners && this._listeners[eventName]) {
    -                var listeners = this._listeners[eventName].slice(0),
    -                    length = listeners.length,
    -                    fn = listeners[0],
    -                    i;
    -
    -                for(i = 0; i < length; fn = listeners[++i]) {
    -                    //call the event listener
    -                    fn.call(this, data);
    -
    -                    //if "stopImmediatePropagation" is called, stop calling sibling events
    -                    if(data.stoppedImmediate) {
    -                        return this;
    -                    }
    -                }
    -
    -                //if "stopPropagation" is called then don't bubble the event
    -                if(data.stopped) {
    -                    return this;
    -                }
    -            }
    -
    -            //bubble this event up the scene graph
    -            if(this.parent && this.parent.emit) {
    -                this.parent.emit.call(this.parent, eventName, data);
    -            }
    -
    -            return this;
    -        };
    -
    -        /**
    -         * Register a new EventListener for the given event.
    -         *
    -         * @method on
    -         * @alias addEventListener
    -         * @param eventName {String} Name of the event.
    -         * @param callback {Functon} fn Callback function.
    -         */
    -        obj.on = obj.addEventListener = function on(eventName, fn) {
    -            this._listeners = this._listeners || {};
    -
    -            (this._listeners[eventName] = this._listeners[eventName] || [])
    -                .push(fn);
    -
    -            return this;
    -        };
    -
    -        /**
    -         * Add an EventListener that's only called once.
    -         *
    -         * @method once
    -         * @param eventName {String} Name of the event.
    -         * @param callback {Function} Callback function.
    -         */
    -        obj.once = function once(eventName, fn) {
    -            this._listeners = this._listeners || {};
    -
    -            var self = this;
    -            function onceHandlerWrapper() {
    -                fn.apply(self.off(eventName, onceHandlerWrapper), arguments);
    -            }
    -            onceHandlerWrapper._originalHandler = fn;
    -
    -            return this.on(eventName, onceHandlerWrapper);
    -        };
    -
    -        /**
    -         * Remove event listeners.
    -         *
    -         * @method off
    -         * @alias removeEventListener
    -         * @param eventName {String} The event we want to remove.
    -         * @param callback {Function} The listener that we need to find.
    -         */
    -        obj.off = obj.removeEventListener = function off(eventName, fn) {
    -            this._listeners = this._listeners || {};
    -
    -            if(!this._listeners[eventName])
    -                return this;
    -
    -            var list = this._listeners[eventName],
    -                i = fn ? list.length : 0;
    -
    -            while(i-- > 0) {
    -                if(list[i] === fn || list[i]._originalHandler === fn) {
    -                    list.splice(i, 1);
    -                }
    -            }
    -
    -            if(list.length === 0) {
    -                delete this._listeners[eventName];
    -            }
    -
    -            return this;
    -        };
    -
    -        /**
    -         * Remove all listeners or only the listeners for the specified event.
    -         *
    -         * @method removeAllListeners
    -         * @param eventName {String} The event you want to remove all listeners for.
    -         */
    -        obj.removeAllListeners = function removeAllListeners(eventName) {
    -            this._listeners = this._listeners || {};
    -
    -            if(!this._listeners[eventName])
    -                return this;
    -
    -            delete this._listeners[eventName];
    -
    -            return this;
    -        };
    -    }
    -};
    -
    -/**
    - * Creates an homogenous object for tracking events so users can know what to expect.
    - *
    - * @class Event
    - * @extends Object
    - * @constructor
    - * @param target {Object} The target object that the event is called on
    - * @param name {String} The string name of the event that was triggered
    - * @param data {Object} Arbitrary event data to pass along
    - */
    -PIXI.Event = function(target, name, data) {
    -    //for duck typing in the ".on()" function
    -    this.__isEventObject = true;
    -
    -    /**
    -     * Tracks the state of bubbling propagation. Do not
    -     * set this directly, instead use `event.stopPropagation()`
    -     *
    -     * @property stopped
    -     * @type Boolean
    -     * @private
    -     * @readOnly
    -     */
    -    this.stopped = false;
    -
    -    /**
    -     * Tracks the state of sibling listener propagation. Do not
    -     * set this directly, instead use `event.stopImmediatePropagation()`
    -     *
    -     * @property stoppedImmediate
    -     * @type Boolean
    -     * @private
    -     * @readOnly
    -     */
    -    this.stoppedImmediate = false;
    -
    -    /**
    -     * The original target the event triggered on.
    -     *
    -     * @property target
    -     * @type Object
    -     * @readOnly
    -     */
    -    this.target = target;
    -
    -    /**
    -     * The string name of the event that this represents.
    -     *
    -     * @property type
    -     * @type String
    -     * @readOnly
    -     */
    -    this.type = name;
    -
    -    /**
    -     * The data that was passed in with this event.
    -     *
    -     * @property data
    -     * @type Object
    -     * @readOnly
    -     */
    -    this.data = data;
    -
    -    //backwards compat with older version of events
    -    this.content = data;
    -
    -    /**
    -     * The timestamp when the event occurred.
    -     *
    -     * @property timeStamp
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.timeStamp = Date.now();
    -};
    -
    -/**
    - * Stops the propagation of events up the scene graph (prevents bubbling).
    - *
    - * @method stopPropagation
    - */
    -PIXI.Event.prototype.stopPropagation = function stopPropagation() {
    -    this.stopped = true;
    -};
    -
    -/**
    - * Stops the propagation of events to sibling listeners (no longer calls any listeners).
    - *
    - * @method stopImmediatePropagation
    - */
    -PIXI.Event.prototype.stopImmediatePropagation = function stopImmediatePropagation() {
    -    this.stoppedImmediate = true;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_utils_Polyk.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_utils_Polyk.js.html deleted file mode 100755 index a0a2226..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_utils_Polyk.js.html +++ /dev/null @@ -1,446 +0,0 @@ - - - - - src/pixi/utils/Polyk.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/utils/Polyk.js

    - -
    -
    -/*
    -    PolyK library
    -    url: http://polyk.ivank.net
    -    Released under MIT licence.
    -
    -    Copyright (c) 2012 Ivan Kuckir
    -
    -    Permission is hereby granted, free of charge, to any person
    -    obtaining a copy of this software and associated documentation
    -    files (the "Software"), to deal in the Software without
    -    restriction, including without limitation the rights to use,
    -    copy, modify, merge, publish, distribute, sublicense, and/or sell
    -    copies of the Software, and to permit persons to whom the
    -    Software is furnished to do so, subject to the following
    -    conditions:
    -
    -    The above copyright notice and this permission notice shall be
    -    included in all copies or substantial portions of the Software.
    -
    -    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    -    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
    -    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    -    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
    -    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
    -    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    -    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
    -    OTHER DEALINGS IN THE SOFTWARE.
    -
    -    This is an amazing lib!
    -
    -    Slightly modified by Mat Groves (matgroves.com);
    -*/
    -
    -/**
    - * Based on the Polyk library http://polyk.ivank.net released under MIT licence.
    - * This is an amazing lib!
    - * Slightly modified by Mat Groves (matgroves.com);
    - * @class PolyK
    - */
    -PIXI.PolyK = {};
    -
    -/**
    - * Triangulates shapes for webGL graphic fills.
    - *
    - * @method Triangulate
    - */
    -PIXI.PolyK.Triangulate = function(p)
    -{
    -    var sign = true;
    -
    -    var n = p.length >> 1;
    -    if(n < 3) return [];
    -
    -    var tgs = [];
    -    var avl = [];
    -    for(var i = 0; i < n; i++) avl.push(i);
    -
    -    i = 0;
    -    var al = n;
    -    while(al > 3)
    -    {
    -        var i0 = avl[(i+0)%al];
    -        var i1 = avl[(i+1)%al];
    -        var i2 = avl[(i+2)%al];
    -
    -        var ax = p[2*i0],  ay = p[2*i0+1];
    -        var bx = p[2*i1],  by = p[2*i1+1];
    -        var cx = p[2*i2],  cy = p[2*i2+1];
    -
    -        var earFound = false;
    -        if(PIXI.PolyK._convex(ax, ay, bx, by, cx, cy, sign))
    -        {
    -            earFound = true;
    -            for(var j = 0; j < al; j++)
    -            {
    -                var vi = avl[j];
    -                if(vi === i0 || vi === i1 || vi === i2) continue;
    -
    -                if(PIXI.PolyK._PointInTriangle(p[2*vi], p[2*vi+1], ax, ay, bx, by, cx, cy)) {
    -                    earFound = false;
    -                    break;
    -                }
    -            }
    -        }
    -
    -        if(earFound)
    -        {
    -            tgs.push(i0, i1, i2);
    -            avl.splice((i+1)%al, 1);
    -            al--;
    -            i = 0;
    -        }
    -        else if(i++ > 3*al)
    -        {
    -            // need to flip flip reverse it!
    -            // reset!
    -            if(sign)
    -            {
    -                tgs = [];
    -                avl = [];
    -                for(i = 0; i < n; i++) avl.push(i);
    -
    -                i = 0;
    -                al = n;
    -
    -                sign = false;
    -            }
    -            else
    -            {
    -                window.console.log("PIXI Warning: shape too complex to fill");
    -                return [];
    -            }
    -        }
    -    }
    -
    -    tgs.push(avl[0], avl[1], avl[2]);
    -    return tgs;
    -};
    -
    -/**
    - * Checks whether a point is within a triangle
    - *
    - * @method _PointInTriangle
    - * @param px {Number} x coordinate of the point to test
    - * @param py {Number} y coordinate of the point to test
    - * @param ax {Number} x coordinate of the a point of the triangle
    - * @param ay {Number} y coordinate of the a point of the triangle
    - * @param bx {Number} x coordinate of the b point of the triangle
    - * @param by {Number} y coordinate of the b point of the triangle
    - * @param cx {Number} x coordinate of the c point of the triangle
    - * @param cy {Number} y coordinate of the c point of the triangle
    - * @private
    - * @return {Boolean}
    - */
    -PIXI.PolyK._PointInTriangle = function(px, py, ax, ay, bx, by, cx, cy)
    -{
    -    var v0x = cx-ax;
    -    var v0y = cy-ay;
    -    var v1x = bx-ax;
    -    var v1y = by-ay;
    -    var v2x = px-ax;
    -    var v2y = py-ay;
    -
    -    var dot00 = v0x*v0x+v0y*v0y;
    -    var dot01 = v0x*v1x+v0y*v1y;
    -    var dot02 = v0x*v2x+v0y*v2y;
    -    var dot11 = v1x*v1x+v1y*v1y;
    -    var dot12 = v1x*v2x+v1y*v2y;
    -
    -    var invDenom = 1 / (dot00 * dot11 - dot01 * dot01);
    -    var u = (dot11 * dot02 - dot01 * dot12) * invDenom;
    -    var v = (dot00 * dot12 - dot01 * dot02) * invDenom;
    -
    -    // Check if point is in triangle
    -    return (u >= 0) && (v >= 0) && (u + v < 1);
    -};
    -
    -/**
    - * Checks whether a shape is convex
    - *
    - * @method _convex
    - * @private
    - * @return {Boolean}
    - */
    -PIXI.PolyK._convex = function(ax, ay, bx, by, cx, cy, sign)
    -{
    -    return ((ay-by)*(cx-bx) + (bx-ax)*(cy-by) >= 0) === sign;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/files/src_pixi_utils_Utils.js.html b/tutorial-2/pixi.js-master/docs/files/src_pixi_utils_Utils.js.html deleted file mode 100755 index 2bcfa6e..0000000 --- a/tutorial-2/pixi.js-master/docs/files/src_pixi_utils_Utils.js.html +++ /dev/null @@ -1,485 +0,0 @@ - - - - - src/pixi/utils/Utils.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/utils/Utils.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    - 
    -// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
    -// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
    -
    -// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
    -
    -// MIT license
    -
    -/**
    - * A polyfill for requestAnimationFrame
    - * You can actually use both requestAnimationFrame and requestAnimFrame, 
    - * you will still benefit from the polyfill
    - *
    - * @method requestAnimationFrame
    - */
    -
    -/**
    - * A polyfill for cancelAnimationFrame
    - *
    - * @method cancelAnimationFrame
    - */
    -(function(window) {
    -    var lastTime = 0;
    -    var vendors = ['ms', 'moz', 'webkit', 'o'];
    -    for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
    -        window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
    -        window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] ||
    -            window[vendors[x] + 'CancelRequestAnimationFrame'];
    -    }
    -
    -    if (!window.requestAnimationFrame) {
    -        window.requestAnimationFrame = function(callback) {
    -            var currTime = new Date().getTime();
    -            var timeToCall = Math.max(0, 16 - (currTime - lastTime));
    -            var id = window.setTimeout(function() { callback(currTime + timeToCall); },
    -              timeToCall);
    -            lastTime = currTime + timeToCall;
    -            return id;
    -        };
    -    }
    -
    -    if (!window.cancelAnimationFrame) {
    -        window.cancelAnimationFrame = function(id) {
    -            clearTimeout(id);
    -        };
    -    }
    -
    -    window.requestAnimFrame = window.requestAnimationFrame;
    -})(this);
    -
    -/**
    - * Converts a hex color number to an [R, G, B] array
    - *
    - * @method hex2rgb
    - * @param hex {Number}
    - */
    -PIXI.hex2rgb = function(hex) {
    -    return [(hex >> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255];
    -};
    -
    -/**
    - * Converts a color as an [R, G, B] array to a hex number
    - *
    - * @method rgb2hex
    - * @param rgb {Array}
    - */
    -PIXI.rgb2hex = function(rgb) {
    -    return ((rgb[0]*255 << 16) + (rgb[1]*255 << 8) + rgb[2]*255);
    -};
    -
    -/**
    - * A polyfill for Function.prototype.bind
    - *
    - * @method bind
    - */
    -if (typeof Function.prototype.bind !== 'function') {
    -    Function.prototype.bind = (function () {
    -        return function (thisArg) {
    -            var target = this, i = arguments.length - 1, boundArgs = [];
    -            if (i > 0)
    -            {
    -                boundArgs.length = i;
    -                while (i--) boundArgs[i] = arguments[i + 1];
    -            }
    -
    -            if (typeof target !== 'function') throw new TypeError();
    -
    -            function bound() {
    -                var i = arguments.length, args = new Array(i);
    -                while (i--) args[i] = arguments[i];
    -                args = boundArgs.concat(args);
    -                return target.apply(this instanceof bound ? this : thisArg, args);
    -            }
    -
    -            bound.prototype = (function F(proto) {
    -                if (proto) F.prototype = proto;
    -                if (!(this instanceof F)) return new F();
    -            })(target.prototype);
    -
    -            return bound;
    -        };
    -    })();
    -}
    -
    -/**
    - * A wrapper for ajax requests to be handled cross browser
    - *
    - * @class AjaxRequest
    - * @constructor
    - */
    -PIXI.AjaxRequest = function()
    -{
    -    var activexmodes = ['Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.3.0', 'Microsoft.XMLHTTP']; //activeX versions to check for in IE
    -
    -    if (window.ActiveXObject)
    -    { //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    -        for (var i=0; i<activexmodes.length; i++)
    -        {
    -            try{
    -                return new window.ActiveXObject(activexmodes[i]);
    -            }
    -            catch(e) {
    -                //suppress error
    -            }
    -        }
    -    }
    -    else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    -    {
    -        return new window.XMLHttpRequest();
    -    }
    -    else
    -    {
    -        return false;
    -    }
    -};
    -/*
    -PIXI.packColorRGBA = function(r, g, b, a)//r, g, b, a)
    -{
    -  //  console.log(r, b, c, d)
    -  return (Math.floor((r)*63) << 18) | (Math.floor((g)*63) << 12) | (Math.floor((b)*63) << 6);// | (Math.floor((a)*63))
    -  //  i = i | (Math.floor((a)*63));
    -   // return i;
    -   // var r = (i / 262144.0 ) / 64;
    -   // var g = (i / 4096.0)%64 / 64;
    -  //  var b = (i / 64.0)%64 / 64;
    -  //  var a = (i)%64 / 64;
    -     
    -  //  console.log(r, g, b, a);
    -  //  return i;
    -
    -};
    -*/
    -/*
    -PIXI.packColorRGB = function(r, g, b)//r, g, b, a)
    -{
    -    return (Math.floor((r)*255) << 16) | (Math.floor((g)*255) << 8) | (Math.floor((b)*255));
    -};
    -
    -PIXI.unpackColorRGB = function(r, g, b)//r, g, b, a)
    -{
    -    return (Math.floor((r)*255) << 16) | (Math.floor((g)*255) << 8) | (Math.floor((b)*255));
    -};
    -*/
    -
    -/**
    - * Checks whether the Canvas BlendModes are supported by the current browser
    - *
    - * @method canUseNewCanvasBlendModes
    - * @return {Boolean} whether they are supported
    - */
    -PIXI.canUseNewCanvasBlendModes = function()
    -{
    -    if (typeof document === 'undefined') return false;
    -    var canvas = document.createElement('canvas');
    -    canvas.width = 1;
    -    canvas.height = 1;
    -    var context = canvas.getContext('2d');
    -    context.fillStyle = '#000';
    -    context.fillRect(0,0,1,1);
    -    context.globalCompositeOperation = 'multiply';
    -    context.fillStyle = '#fff';
    -    context.fillRect(0,0,1,1);
    -    return context.getImageData(0,0,1,1).data[0] === 0;
    -};
    -
    -/**
    - * Given a number, this function returns the closest number that is a power of two
    - * this function is taken from Starling Framework as its pretty neat ;)
    - *
    - * @method getNextPowerOfTwo
    - * @param number {Number}
    - * @return {Number} the closest number that is a power of two
    - */
    -PIXI.getNextPowerOfTwo = function(number)
    -{
    -    if (number > 0 && (number & (number - 1)) === 0) // see: http://goo.gl/D9kPj
    -        return number;
    -    else
    -    {
    -        var result = 1;
    -        while (result < number) result <<= 1;
    -        return result;
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/index.html b/tutorial-2/pixi.js-master/docs/index.html deleted file mode 100755 index d44cf89..0000000 --- a/tutorial-2/pixi.js-master/docs/index.html +++ /dev/null @@ -1,292 +0,0 @@ - - - - - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -
    -
    -

    - Browse to a module or class using the sidebar to view its API documentation. -

    - -

    Keyboard Shortcuts

    - -
      -
    • Press s to focus the API search box.

    • - -
    • Use Up and Down to select classes, modules, and search results.

    • - -
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • - -
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/modules/PIXI.html b/tutorial-2/pixi.js-master/docs/modules/PIXI.html deleted file mode 100755 index 3621bb3..0000000 --- a/tutorial-2/pixi.js-master/docs/modules/PIXI.html +++ /dev/null @@ -1,819 +0,0 @@ - - - - - PIXI - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PIXI Module

    -
    - - - - - - - - - -
    - - - -
    - -
    - - - -
    -
    - -

    This module provides the following classes:

    - - - -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/docs/modules/index.html b/tutorial-2/pixi.js-master/docs/modules/index.html deleted file mode 100755 index 487fe15..0000000 --- a/tutorial-2/pixi.js-master/docs/modules/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Redirector - - - - Click here to redirect - - diff --git a/tutorial-2/pixi.js-master/examples/example 1 - Basics/bunny.png b/tutorial-2/pixi.js-master/examples/example 1 - Basics/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 1 - Basics/bunny.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 1 - Basics/index.html b/tutorial-2/pixi.js-master/examples/example 1 - Basics/index.html deleted file mode 100755 index 7da84bb..0000000 --- a/tutorial-2/pixi.js-master/examples/example 1 - Basics/index.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - pixi.js example 1 - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 1 - Basics/indexTest2.html b/tutorial-2/pixi.js-master/examples/example 1 - Basics/indexTest2.html deleted file mode 100755 index 681f6bf..0000000 --- a/tutorial-2/pixi.js-master/examples/example 1 - Basics/indexTest2.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - pixi.js example 1 - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 1 - Basics/mark.html b/tutorial-2/pixi.js-master/examples/example 1 - Basics/mark.html deleted file mode 100755 index b71350c..0000000 --- a/tutorial-2/pixi.js-master/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
    - - -
    - - -
    - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 1 - Basics/stats.min.js b/tutorial-2/pixi.js-master/examples/example 1 - Basics/stats.min.js deleted file mode 100755 index 52539f4..0000000 --- a/tutorial-2/pixi.js-master/examples/example 1 - Basics/stats.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// stats.js - http://github.com/mrdoob/stats.js -var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; -i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); -k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= -"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= -a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); diff --git a/tutorial-2/pixi.js-master/examples/example 10 - Text/desyrel.png b/tutorial-2/pixi.js-master/examples/example 10 - Text/desyrel.png deleted file mode 100755 index c3559e1..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 10 - Text/desyrel.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 10 - Text/desyrel.xml b/tutorial-2/pixi.js-master/examples/example 10 - Text/desyrel.xml deleted file mode 100755 index 54fcdbb..0000000 --- a/tutorial-2/pixi.js-master/examples/example 10 - Text/desyrel.xml +++ /dev/null @@ -1,1922 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tutorial-2/pixi.js-master/examples/example 10 - Text/index.html b/tutorial-2/pixi.js-master/examples/example 10 - Text/index.html deleted file mode 100755 index 23fae9a..0000000 --- a/tutorial-2/pixi.js-master/examples/example 10 - Text/index.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - pixi.js example 10 Text - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 10 - Text/textDemoBG.jpg b/tutorial-2/pixi.js-master/examples/example 10 - Text/textDemoBG.jpg deleted file mode 100755 index 5955e59..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 10 - Text/textDemoBG.jpg and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/index.html b/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/index.html deleted file mode 100755 index 88a7396..0000000 --- a/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/index.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - pixi.js example 11 RenderTexture - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/indexNew.html b/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/indexNew.html deleted file mode 100755 index 9c8e727..0000000 --- a/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/indexNew.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - pixi.js example 11 RenderTexture - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_01.png b/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_01.png deleted file mode 100755 index 8687366..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_01.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_02.png b/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_02.png deleted file mode 100755 index a140876..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_02.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_03.png b/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_03.png deleted file mode 100755 index 82532c7..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_03.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_04.png b/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_04.png deleted file mode 100755 index 9c790c3..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_04.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_05.png b/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_05.png deleted file mode 100755 index ebb28c8..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_05.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_06.png b/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_06.png deleted file mode 100755 index 1dec5c8..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_06.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_07.png b/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_07.png deleted file mode 100755 index e14a021..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_07.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_08.png b/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_08.png deleted file mode 100755 index 0197fef..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 11 - RenderTexture/spinObj_08.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/Pixie.atlas b/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/Pixie.atlas deleted file mode 100755 index 68a8013..0000000 --- a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/Pixie.atlas +++ /dev/null @@ -1,158 +0,0 @@ -Pixie.png -format: RGBA8888 -filter: Linear,Linear -repeat: none -L_foot - rotate: false - xy: 1048, 355 - size: 68, 51 - orig: 68, 51 - offset: 0, 0 - index: -1 -L_hand - rotate: true - xy: 916, 355 - size: 55, 64 - orig: 55, 64 - offset: 0, 0 - index: -1 -L_lower_arm - rotate: false - xy: 1273, 226 - size: 70, 31 - orig: 70, 31 - offset: 0, 0 - index: -1 -L_lower_leg - rotate: false - xy: 1201, 345 - size: 57, 65 - orig: 57, 65 - offset: 0, 0 - index: -1 -L_upper_arm - rotate: true - xy: 1399, 2 - size: 78, 74 - orig: 78, 74 - offset: 0, 0 - index: -1 -L_upper_leg - rotate: false - xy: 1351, 259 - size: 124, 71 - orig: 124, 71 - offset: 0, 0 - index: -1 -R_foot - rotate: false - xy: 1319, 345 - size: 68, 51 - orig: 68, 51 - offset: 0, 0 - index: -1 -R_hand - rotate: true - xy: 982, 355 - size: 55, 64 - orig: 55, 64 - offset: 0, 0 - index: -1 -R_lower_arm - rotate: false - xy: 1345, 226 - size: 70, 31 - orig: 70, 31 - offset: 0, 0 - index: -1 -R_lower_leg - rotate: false - xy: 1260, 345 - size: 57, 65 - orig: 57, 65 - offset: 0, 0 - index: -1 -R_upper_arm - rotate: true - xy: 1399, 82 - size: 78, 74 - orig: 78, 74 - offset: 0, 0 - index: -1 -R_upper_leg - rotate: false - xy: 1389, 332 - size: 124, 71 - orig: 124, 71 - offset: 0, 0 - index: -1 -backHair - rotate: true - xy: 1096, 2 - size: 261, 175 - orig: 261, 175 - offset: 0, 0 - index: -1 -foreWing - rotate: false - xy: 1096, 265 - size: 253, 78 - orig: 253, 78 - offset: 0, 0 - index: -1 -frontHair - rotate: true - xy: 617, 2 - size: 396, 297 - orig: 396, 297 - offset: 0, 0 - index: -1 -groinal - rotate: true - xy: 1515, 296 - size: 103, 84 - orig: 103, 84 - offset: 0, 0 - index: -1 -head - rotate: false - xy: 2, 2 - size: 613, 408 - orig: 613, 408 - offset: 0, 0 - index: -1 -jaw - rotate: true - xy: 1273, 2 - size: 222, 124 - orig: 222, 124 - offset: 0, 0 - index: -1 -midHair - rotate: true - xy: 916, 2 - size: 351, 178 - orig: 351, 178 - offset: 0, 0 - index: -1 -neck - rotate: true - xy: 1118, 345 - size: 65, 81 - orig: 65, 81 - offset: 0, 0 - index: -1 -rearWing - rotate: false - xy: 1477, 148 - size: 136, 146 - orig: 136, 146 - offset: 0, 0 - index: -1 -vest - rotate: false - xy: 1477, 2 - size: 139, 144 - orig: 139, 144 - offset: 0, 0 - index: -1 diff --git a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/Pixie.json b/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/Pixie.json deleted file mode 100755 index bc7e888..0000000 --- a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/Pixie.json +++ /dev/null @@ -1,924 +0,0 @@ -{ -"bones": [ - { "name": "root" }, - { "name": "hip", "parent": "root", "x": -5.36, "y": 120.63 }, - { "name": "L leg upper", "parent": "hip", "length": 90.28, "x": -21.3, "y": -8.59, "rotation": -123.16 }, - { "name": "R leg upper", "parent": "hip", "length": 79.63, "x": 14.54, "y": -29.09, "rotation": -12.07 }, - { "name": "back", "parent": "hip", "length": 117.04, "x": 3.43, "y": 0.51, "rotation": 64.34 }, - { "name": "L arm upper", "parent": "back", "length": 88.01, "x": 120.71, "y": -25.79, "rotation": 108.03 }, - { "name": "L leg lower", "parent": "L leg upper", "length": 77.82, "x": 89.23, "y": 3.84, "rotation": -74.59 }, - { "name": "R arm upper", "parent": "back", "length": 82.87, "x": 107.42, "y": 16.92, "rotation": -108.18 }, - { "name": "R leg lower", "parent": "R leg upper", "length": 67.73, "x": 79.31, "y": -0.23, "rotation": -35.49 }, - { "name": "fore wing", "parent": "back", "length": 174.95, "x": 78.26, "y": 14.47, "rotation": 111.09 }, - { "name": "neck", "parent": "back", "length": 65.79, "x": 115.87, "y": -0.67, "rotation": -1.35 }, - { "name": "L arm lower", "parent": "L arm upper", "length": 57.67, "x": 84.14, "y": -0.57, "rotation": 35.83 }, - { "name": "L foot", "parent": "L leg lower", "length": 57.67, "x": 74.89, "y": -3.37, "rotation": 79.65 }, - { "name": "R arm lower", "parent": "R arm upper", "length": 58.76, "x": 80.97, "y": -3.48, "rotation": 56.62 }, - { "name": "R foot", "parent": "R leg lower", "length": 51.26, "x": 67.69, "y": -1.98, "rotation": 84.54 }, - { "name": "bone1", "parent": "fore wing", "x": 50.67, "y": 19.71 }, - { "name": "head", "parent": "neck", "length": 132.5, "x": 116.13, "y": 41.67, "rotation": -40.37 }, - { "name": "rear wing", "parent": "fore wing", "length": 123.2, "x": 2.22, "y": -11.57, "rotation": -30.89 }, - { "name": "L hand", "parent": "L arm lower", "length": 33.27, "x": 55.37, "y": 1.3, "rotation": 30.89 }, - { "name": "R hand", "parent": "R arm lower", "length": 33.34, "x": 58.46, "y": -1.24, "rotation": 25.65 }, - { "name": "hair back", "parent": "head", "length": 156.52, "x": 43.77, "y": 270.91, "rotation": 22.07 }, - { "name": "jaw", "parent": "head", "length": 139.22, "x": 8.71, "y": -33.25, "rotation": -46.82 }, - { "name": "hair mid", "parent": "hair back", "length": 191.57, "x": 155.16, "y": -89.36, "rotation": -17.61 }, - { "name": "hair front", "parent": "hair mid", "length": 202.73, "x": 48, "y": -100.58, "rotation": -18.29 } -], -"slots": [ - { "name": "L hand", "bone": "L hand", "attachment": "L_hand" }, - { "name": "L arm lower", "bone": "L arm lower", "attachment": "L_lower_arm" }, - { "name": "L arm upper", "bone": "L arm upper", "attachment": "L_upper_arm" }, - { "name": "rear wing", "bone": "rear wing", "attachment": "rearWing" }, - { "name": "L foot", "bone": "L foot", "attachment": "L_foot" }, - { "name": "L leg lower", "bone": "L leg lower", "attachment": "L_lower_leg" }, - { "name": "L leg upper", "bone": "L leg upper", "attachment": "L_upper_leg" }, - { "name": "R foot", "bone": "R foot", "attachment": "R_foot" }, - { "name": "R lower", "bone": "R leg lower", "attachment": "R_lower_leg" }, - { "name": "R upper", "bone": "R leg upper", "attachment": "R_upper_leg" }, - { "name": "hip", "bone": "hip", "attachment": "groinal" }, - { "name": "fore wing", "bone": "fore wing", "attachment": "foreWing" }, - { "name": "neck", "bone": "neck", "attachment": "neck" }, - { "name": "back", "bone": "back", "attachment": "vest" }, - { "name": "R arm upper", "bone": "R arm upper", "attachment": "R_upper_arm" }, - { "name": "R arm lower", "bone": "R arm lower", "attachment": "R_lower_arm" }, - { "name": "R hand", "bone": "R hand", "attachment": "R_hand" }, - { "name": "hair back", "bone": "hair back", "attachment": "backHair" }, - { "name": "hair front", "bone": "hair front", "attachment": "frontHair" }, - { "name": "head", "bone": "head", "attachment": "head" }, - { "name": "jaw", "bone": "jaw", "attachment": "jaw" }, - { "name": "hair mid", "bone": "hair mid", "attachment": "midHair" } -], -"skins": { - "default": { - "L arm lower": { - "L_lower_arm": { "x": 26.8, "y": 0.38, "rotation": -12.92, "width": 70, "height": 31 } - }, - "L arm upper": { - "L_upper_arm": { "x": 43.44, "y": -0.75, "rotation": 43.61, "width": 78, "height": 74 } - }, - "L foot": { - "L_foot": { "x": 25.73, "y": -3.97, "rotation": -37.09, "width": 68, "height": 51 } - }, - "L hand": { - "L_hand": { "x": 16.53, "y": 5.33, "rotation": -19.13, "width": 55, "height": 64 } - }, - "L leg lower": { - "L_lower_leg": { "x": 32.98, "y": 3.71, "rotation": 50.68, "width": 57, "height": 65 } - }, - "L leg upper": { - "L_upper_leg": { "x": 34.37, "y": 6.89, "rotation": 14.72, "width": 124, "height": 71 } - }, - "R arm lower": { - "R_lower_arm": { "x": 27.12, "y": 1.85, "rotation": -12.78, "width": 70, "height": 31 } - }, - "R arm upper": { - "R_upper_arm": { "x": 40.47, "y": -2.66, "rotation": 43.84, "width": 78, "height": 74 } - }, - "R foot": { - "R_foot": { "x": 19.53, "y": -8.7, "rotation": -36.33, "width": 68, "height": 51 } - }, - "R hand": { - "R_hand": { "x": 17.09, "y": -3.59, "rotation": -38.44, "width": 55, "height": 64 } - }, - "R lower": { - "R_lower_leg": { "x": 33.18, "y": -0.42, "rotation": 50.06, "width": 57, "height": 65 } - }, - "R upper": { - "R_upper_leg": { "x": 26.1, "y": 2.57, "rotation": 14.14, "width": 124, "height": 71 } - }, - "back": { - "vest": { "x": 47.37, "y": 12.63, "rotation": -64.34, "width": 139, "height": 144 } - }, - "fore wing": { - "foreWing": { "x": 103.77, "y": -7.39, "rotation": -175.44, "width": 253, "height": 78 } - }, - "hair back": { - "backHair": { "x": 71.84, "y": -6.96, "rotation": -44.69, "width": 261, "height": 175 } - }, - "hair front": { - "frontHair": { "x": 144.79, "y": -43.44, "rotation": -8.77, "width": 396, "height": 297 } - }, - "hair mid": { - "midHair": { "x": 98.77, "y": -24.19, "rotation": -27.07, "width": 351, "height": 178 } - }, - "head": { - "head": { "x": 54.08, "y": 79.01, "rotation": -22.61, "width": 613, "height": 408 } - }, - "hip": { - "groinal": { "x": -1.3, "y": -22.13, "width": 103, "height": 84 } - }, - "jaw": { - "jaw": { "x": 37.24, "y": -10.62, "rotation": 16.36, "width": 222, "height": 124 } - }, - "neck": { - "neck": { "x": 11.64, "y": 0.09, "rotation": -62.99, "width": 65, "height": 81 } - }, - "rear wing": { - "rearWing": { "x": 72.18, "y": -9.33, "rotation": -144.54, "width": 136, "height": 146 } - } - } -}, -"animations": { - "jump": { - "bones": { - "hip": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { - "time": 0, - "x": 0, - "y": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.3666, - "x": 48.25, - "y": 387.29, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L leg upper": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": -52.49 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R leg upper": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 42.23 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "back": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 17.45 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.3666, "x": -12.48, "y": 6.24 }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L arm upper": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": -23.04 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L leg lower": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 21.33 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R arm upper": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": -20.49 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R leg lower": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 18.73 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "fore wing": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1333, "angle": -17.83 }, - { "time": 0.2333, "angle": -0.57 }, - { "time": 0.3333, "angle": -22.57 }, - { "time": 0.4333, "angle": 6.45 }, - { "time": 0.5333, "angle": -15.51 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "neck": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L arm lower": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 16.6 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L foot": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3333, "angle": -19.99 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.3333, "x": -13.89, "y": -5.83 }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R arm lower": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 54.98 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R foot": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": -4.87 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "bone1": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "head": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.3743, - "angle": 13.84, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "rear wing": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1333, "angle": 30.94 }, - { "time": 0.2333, "angle": -24.35 }, - { "time": 0.3333, "angle": 25.11 }, - { "time": 0.4333, "angle": -6.54 }, - { "time": 0.5333, "angle": 24.65 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L hand": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 57.5 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R hand": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 3.65 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "hair back": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3333, "angle": 6.5 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "jaw": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 5.72 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.3666, "x": -4.28, "y": 3.04 }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.3666, "x": 1.169, "y": 1 }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "hair mid": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3333, "angle": 6.71 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "hair front": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3333, "angle": -8.18 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.3333, "x": -17.24, "y": 20.35 }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - } - } - }, - "running": { - "bones": { - "hip": { - "rotate": [ - { "time": 0, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 2.79 }, - { "time": 0.2333, "x": 0, "y": -15.43 }, - { "time": 0.5, "x": 0, "y": 8 }, - { "time": 0.7, "x": 0, "y": -8.92 }, - { "time": 0.9666, "x": 0, "y": 2.79 } - ] - }, - "R leg upper": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.5, "angle": -150.25 }, - { "time": 0.7, "angle": -110.91 }, - { - "time": 0.8333, - "angle": -25.14, - "curve": [ 0.155, 0.16, 0.75, 1 ] - }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.5, "x": -35.15, "y": 0 }, - { "time": 0.7, "x": -6.5, "y": 0 }, - { "time": 1, "x": 2.6, "y": 0 } - ] - }, - "R leg lower": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.5, "angle": 7.47 }, - { "time": 0.7, "angle": -53.49 }, - { - "time": 0.8333, - "angle": -85.3, - "curve": [ 0.16, 0.21, 0.75, 1 ] - }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0.7, "x": 2.5, "y": -1.47 }, - { "time": 0.8333, "x": 3.93, "y": -5.18 } - ] - }, - "R foot": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.2, "angle": 7.03 }, - { "time": 0.2333, "angle": 18.45 }, - { "time": 0.2666, "angle": 26.41 }, - { "time": 0.3, "angle": 29.63 }, - { "time": 0.5, "angle": -22.49 }, - { "time": 0.7, "angle": -30.93 }, - { "time": 0.8333, "angle": -50.37 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0.5, "x": 0.7, "y": -3.84 } - ] - }, - "L leg upper": { - "rotate": [ - { - "time": 0, - "angle": -30.25, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.2333, "angle": 77.26 }, - { - "time": 0.5, - "angle": 104.21, - "curve": [ 0.25, 0, 0.29, 1 ] - }, - { "time": 1, "angle": -30.25 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.5, "x": 22.13, "y": -16.92 }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L leg lower": { - "rotate": [ - { - "time": 0, - "angle": 22.34, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.2333, - "angle": -65.53, - "curve": [ 0.094, -0.03, 0.678, 1.08 ] - }, - { - "time": 0.5, - "angle": 43.39, - "curve": [ 0.25, 0, 0.287, 1 ] - }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 1, "x": 0.58, "y": -1.74 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L foot": { - "rotate": [ - { "time": 0, "angle": -22.23 }, - { "time": 0.2333, "angle": -1.44 }, - { "time": 0.5, "angle": 5.06 }, - { "time": 0.6333, "angle": 27.11 }, - { "time": 0.6666, "angle": 50.34 }, - { "time": 1, "angle": -12.47 } - ], - "translate": [ - { "time": 0, "x": -4.13, "y": -3.42 }, - { "time": 0.6333, "x": 1.22, "y": 1.73 }, - { "time": 0.6666, "x": -0.56, "y": 5.49 }, - { "time": 1, "x": -0.87, "y": -0.96 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "back": { - "rotate": [ - { "time": 0, "angle": -1.79 }, - { "time": 0.2333, "angle": -10.71 }, - { "time": 0.5, "angle": -2.16 }, - { "time": 0.7, "angle": -10.27 }, - { "time": 0.9666, "angle": -1.79 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.2333, "x": 5.2, "y": -6.5 }, - { "time": 0.5, "x": 1.3, "y": -2.6 }, - { "time": 0.7, "x": 7.81, "y": -6.5 }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "R arm upper": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.5, "angle": 235.62 }, - { "time": 0.7, "angle": -57.38 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 } - ] - }, - "R arm lower": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.068, 0, 0.632, 1.14 ] - }, - { "time": 0.5, "angle": -34.21 }, - { - "time": 0.7, - "angle": 17.35, - "curve": [ 0.221, 0.26, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 } - ] - }, - "R hand": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": 30.13 }, - { "time": 0.7, "angle": 3.91 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 } - ] - }, - "L arm upper": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.5, - "angle": -190.85, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "L hand": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 1, 0.75, 1 ] - }, - { - "time": 0.5, - "angle": -15.76, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "L arm lower": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3, "angle": 45.27 }, - { "time": 0.5, "angle": -20.97 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "fore wing": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.2333, "angle": 17.36 }, - { "time": 0.5333, "angle": -2.27 }, - { "time": 0.7333, "angle": 20.14 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "rear wing": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.2333, "angle": 17.36 }, - { "time": 0.5333, "angle": -2.27 }, - { "time": 0.7333, "angle": 20.14 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "head": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.2666, "angle": -13.61 }, - { "time": 0.5, "angle": 0 }, - { "time": 0.7333, "angle": -11.08 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.2666, "x": 4.54, "y": -38.81 }, - { "time": 0.5, "x": 0, "y": 0 }, - { "time": 0.7333, "x": 0.32, "y": -40.1 }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "jaw": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.2333, "angle": -3.93 }, - { "time": 0.4666, "angle": 8.79 }, - { "time": 0.7333, "angle": 13.97 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.2333, "x": 4.63, "y": 6.7 }, - { "time": 0.4666, "x": 6.67, "y": -4.82 }, - { "time": 0.7333, "x": 6.8, "y": -7.61 }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "hair back": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.2333, - "angle": -3.9, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.5, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.7666, - "angle": -4, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.2333, "x": -1.3, "y": -6.5 }, - { "time": 0.5, "x": 0, "y": 0 }, - { "time": 0.7666, "x": -3.49, "y": -10.15 }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "hair front": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.2333, - "angle": -3.9, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.5, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.7666, - "angle": -4, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "hair mid": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.2333, - "angle": -3.9, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.5, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.7666, - "angle": -4, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - } - } - } -} -} diff --git a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/Pixie.png b/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/Pixie.png deleted file mode 100755 index b1e5b77..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/Pixie.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/dragon.atlas b/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/dragon.atlas deleted file mode 100755 index eefbc1d..0000000 --- a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/dragon.atlas +++ /dev/null @@ -1,290 +0,0 @@ - -dragon.png -format: RGBA8888 -filter: Linear,Linear -repeat: none -L_rear_thigh - rotate: false - xy: 895, 20 - size: 91, 148 - orig: 91, 149 - offset: 0, 0 - index: -1 -L_wing01 - rotate: false - xy: 814, 672 - size: 191, 256 - orig: 191, 256 - offset: 0, 0 - index: -1 -L_wing02 - rotate: false - xy: 714, 189 - size: 179, 269 - orig: 179, 269 - offset: 0, 0 - index: -1 -L_wing03 - rotate: false - xy: 785, 463 - size: 186, 207 - orig: 186, 207 - offset: 0, 0 - index: -1 -L_wing05 - rotate: true - xy: 2, 9 - size: 218, 213 - orig: 218, 213 - offset: 0, 0 - index: -1 -L_wing06 - rotate: false - xy: 2, 229 - size: 192, 331 - orig: 192, 331 - offset: 0, 0 - index: -1 -R_wing01 - rotate: true - xy: 502, 709 - size: 219, 310 - orig: 219, 310 - offset: 0, 0 - index: -1 -R_wing02 - rotate: true - xy: 204, 463 - size: 203, 305 - orig: 203, 305 - offset: 0, 0 - index: -1 -R_wing03 - rotate: false - xy: 511, 460 - size: 272, 247 - orig: 272, 247 - offset: 0, 0 - index: -1 -R_wing05 - rotate: false - xy: 196, 232 - size: 251, 229 - orig: 251, 229 - offset: 0, 0 - index: -1 -R_wing06 - rotate: false - xy: 2, 562 - size: 200, 366 - orig: 200, 366 - offset: 0, 0 - index: -1 -R_wing07 - rotate: true - xy: 449, 258 - size: 200, 263 - orig: 200, 263 - offset: 0, 0 - index: -1 -R_wing08 - rotate: false - xy: 467, 2 - size: 234, 254 - orig: 234, 254 - offset: 0, 0 - index: -1 -R_wing09 - rotate: false - xy: 217, 26 - size: 248, 204 - orig: 248, 204 - offset: 0, 0 - index: -1 -back - rotate: false - xy: 703, 2 - size: 190, 185 - orig: 190, 185 - offset: 0, 0 - index: -1 -chest - rotate: true - xy: 895, 170 - size: 136, 122 - orig: 136, 122 - offset: 0, 0 - index: -1 -front_toeA - rotate: false - xy: 976, 972 - size: 29, 50 - orig: 29, 50 - offset: 0, 0 - index: -1 -head - rotate: false - xy: 204, 668 - size: 296, 260 - orig: 296, 260 - offset: 0, 0 - index: -1 -logo - rotate: false - xy: 2, 930 - size: 897, 92 - orig: 897, 92 - offset: 0, 0 - index: -1 -tail01 - rotate: false - xy: 895, 308 - size: 120, 153 - orig: 120, 153 - offset: 0, 0 - index: -1 -tail03 - rotate: false - xy: 901, 930 - size: 73, 92 - orig: 73, 92 - offset: 0, 0 - index: -1 - -dragon2.png -format: RGBA8888 -filter: Linear,Linear -repeat: none -L_front_leg - rotate: true - xy: 391, 141 - size: 84, 57 - orig: 84, 57 - offset: 0, 0 - index: -1 -L_front_thigh - rotate: false - xy: 446, 269 - size: 84, 72 - orig: 84, 72 - offset: 0, 0 - index: -1 -L_rear_leg - rotate: true - xy: 888, 342 - size: 168, 132 - orig: 206, 177 - offset: 19, 20 - index: -1 -L_wing04 - rotate: false - xy: 256, 227 - size: 188, 135 - orig: 188, 135 - offset: 0, 0 - index: -1 -L_wing07 - rotate: false - xy: 2, 109 - size: 159, 255 - orig: 159, 255 - offset: 0, 0 - index: -1 -L_wing08 - rotate: true - xy: 705, 346 - size: 164, 181 - orig: 164, 181 - offset: 0, 0 - index: -1 -L_wing09 - rotate: false - xy: 499, 343 - size: 204, 167 - orig: 204, 167 - offset: 0, 0 - index: -1 -R_front_leg - rotate: false - xy: 273, 34 - size: 101, 89 - orig: 101, 89 - offset: 0, 0 - index: -1 -R_front_thigh - rotate: false - xy: 163, 106 - size: 108, 108 - orig: 108, 108 - offset: 0, 0 - index: -1 -R_rear_leg - rotate: false - xy: 273, 125 - size: 116, 100 - orig: 116, 100 - offset: 0, 0 - index: -1 -R_rear_thigh - rotate: false - xy: 163, 216 - size: 91, 148 - orig: 91, 149 - offset: 0, 0 - index: -1 -R_wing04 - rotate: false - xy: 2, 366 - size: 279, 144 - orig: 279, 144 - offset: 0, 0 - index: -1 -chin - rotate: false - xy: 283, 364 - size: 214, 146 - orig: 214, 146 - offset: 0, 0 - index: -1 -front_toeB - rotate: false - xy: 590, 284 - size: 56, 57 - orig: 56, 57 - offset: 0, 0 - index: -1 -rear-toe - rotate: true - xy: 2, 2 - size: 105, 77 - orig: 109, 77 - offset: 0, 0 - index: -1 -tail02 - rotate: true - xy: 151, 9 - size: 95, 120 - orig: 95, 120 - offset: 0, 0 - index: -1 -tail04 - rotate: false - xy: 532, 270 - size: 56, 71 - orig: 56, 71 - offset: 0, 0 - index: -1 -tail05 - rotate: false - xy: 648, 282 - size: 52, 59 - orig: 52, 59 - offset: 0, 0 - index: -1 -tail06 - rotate: true - xy: 81, 12 - size: 95, 68 - orig: 95, 68 - offset: 0, 0 - index: -1 diff --git a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/dragon.json b/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/dragon.json deleted file mode 100755 index 0d25038..0000000 --- a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/dragon.json +++ /dev/null @@ -1,783 +0,0 @@ -{ -"bones": [ - { "name": "root", "y": -176.12 }, - { "name": "COG", "parent": "root", "y": 176.12 }, - { "name": "back", "parent": "COG", "length": 115.37, "x": 16.03, "y": 27.94, "rotation": 151.83 }, - { "name": "chest", "parent": "COG", "length": 31.24, "x": 52.52, "y": 15.34, "rotation": 161.7 }, - { "name": "neck", "parent": "COG", "length": 41.36, "x": 64.75, "y": 11.98, "rotation": 39.05 }, - { "name": "L_front_thigh", "parent": "chest", "length": 67.42, "x": -45.58, "y": 7.92, "rotation": 138.94 }, - { "name": "L_wing", "parent": "chest", "length": 301.12, "x": -7.24, "y": -24.65, "rotation": -75.51 }, - { "name": "R_front_thigh", "parent": "chest", "length": 81.63, "x": -10.89, "y": 28.25, "rotation": 67.96 }, - { "name": "R_rear_thigh", "parent": "back", "length": 123.46, "x": 65.31, "y": 59.89, "rotation": 104.87 }, - { "name": "chin", "parent": "neck", "length": 153.15, "x": 64.62, "y": -6.99, "rotation": -69.07 }, - { "name": "head", "parent": "neck", "length": 188.83, "x": 69.96, "y": 2.49, "rotation": 8.06 }, - { "name": "tail1", "parent": "back", "length": 65.65, "x": 115.37, "y": -0.19, "rotation": 44.31 }, - { "name": "L_front_leg", "parent": "L_front_thigh", "length": 51.57, "x": 67.42, "y": 0.02, "rotation": 43.36 }, - { "name": "L_rear_thigh", "parent": "R_rear_thigh", "length": 88.05, "x": -8.59, "y": 30.18, "rotation": 28.35 }, - { "name": "R_front_leg", "parent": "R_front_thigh", "length": 66.52, "x": 83.04, "y": -0.3, "rotation": 92.7 }, - { "name": "R_rear_leg", "parent": "R_rear_thigh", "length": 91.06, "x": 123.46, "y": -0.26, "rotation": -129.04 }, - { "name": "R_wing", "parent": "head", "length": 359.5, "x": -74.68, "y": 20.9, "rotation": 83.21 }, - { "name": "tail2", "parent": "tail1", "length": 54.5, "x": 65.65, "y": 0.22, "rotation": 12 }, - { "name": "L_front_toe1", "parent": "L_front_leg", "length": 51.44, "x": 45.53, "y": 2.43, "rotation": -98 }, - { "name": "L_front_toe2", "parent": "L_front_leg", "length": 61.97, "x": 51.57, "y": -0.12, "rotation": -55.26 }, - { "name": "L_front_toe3", "parent": "L_front_leg", "length": 45.65, "x": 54.19, "y": 0.6, "scaleX": 1.134, "rotation": -11.13 }, - { "name": "L_front_toe4", "parent": "L_front_leg", "length": 53.47, "x": 50.6, "y": 7.08, "scaleX": 1.134, "rotation": 19.42 }, - { "name": "L_rear_leg", "parent": "L_rear_thigh", "length": 103.74, "x": 96.04, "y": -0.97, "rotation": -122.41 }, - { "name": "R_front_toe1", "parent": "R_front_leg", "length": 46.65, "x": 70.03, "y": 5.31, "rotation": 8.59 }, - { "name": "R_front_toe2", "parent": "R_front_leg", "length": 53.66, "x": 66.52, "y": 0.33, "rotation": -35.02 }, - { "name": "R_front_toe3", "parent": "R_front_leg", "length": 58.38, "x": 62.1, "y": -0.79, "rotation": -74.67 }, - { "name": "R_rear_toe1", "parent": "R_rear_leg", "length": 94.99, "x": 90.06, "y": 2.12, "rotation": 141.98 }, - { "name": "R_rear_toe2", "parent": "R_rear_leg", "length": 99.29, "x": 89.6, "y": 1.52, "rotation": 125.32 }, - { "name": "R_rear_toe3", "parent": "R_rear_leg", "length": 103.45, "x": 91.06, "y": -0.35, "rotation": 112.26 }, - { "name": "tail3", "parent": "tail2", "length": 41.78, "x": 54.5, "y": 0.37, "rotation": 1.8 }, - { "name": "tail4", "parent": "tail3", "length": 34.19, "x": 41.78, "y": 0.16, "rotation": -1.8 }, - { "name": "tail5", "parent": "tail4", "length": 32.32, "x": 34.19, "y": -0.19, "rotation": -3.15 }, - { "name": "tail6", "parent": "tail5", "length": 80.08, "x": 32.32, "y": -0.23, "rotation": -29.55 } -], -"slots": [ - { "name": "L_rear_leg", "bone": "L_rear_leg", "attachment": "L_rear_leg" }, - { "name": "L_rear_thigh", "bone": "L_rear_thigh", "attachment": "L_rear_thigh" }, - { "name": "L_wing", "bone": "L_wing", "attachment": "L_wing01" }, - { "name": "tail6", "bone": "tail6", "attachment": "tail06" }, - { "name": "tail5", "bone": "tail5", "attachment": "tail05" }, - { "name": "tail4", "bone": "tail4", "attachment": "tail04" }, - { "name": "tail3", "bone": "tail3", "attachment": "tail03" }, - { "name": "tail2", "bone": "tail2", "attachment": "tail02" }, - { "name": "tail1", "bone": "tail1", "attachment": "tail01" }, - { "name": "back", "bone": "back", "attachment": "back" }, - { "name": "L_front_thigh", "bone": "L_front_thigh", "attachment": "L_front_thigh" }, - { "name": "L_front_leg", "bone": "L_front_leg", "attachment": "L_front_leg" }, - { "name": "L_front_toe1", "bone": "L_front_toe1", "attachment": "front_toeA" }, - { "name": "L_front_toe4", "bone": "L_front_toe4", "attachment": "front_toeB" }, - { "name": "L_front_toe3", "bone": "L_front_toe3", "attachment": "front_toeB" }, - { "name": "L_front_toe2", "bone": "L_front_toe2", "attachment": "front_toeB" }, - { "name": "chest", "bone": "chest", "attachment": "chest" }, - { "name": "R_rear_toe1", "bone": "R_rear_toe1", "attachment": "rear-toe" }, - { "name": "R_rear_toe2", "bone": "R_rear_toe2", "attachment": "rear-toe" }, - { "name": "R_rear_toe3", "bone": "R_rear_toe3", "attachment": "rear-toe" }, - { "name": "R_rear_leg", "bone": "R_rear_leg", "attachment": "R_rear_leg" }, - { "name": "R_rear_thigh", "bone": "R_rear_thigh", "attachment": "R_rear_thigh" }, - { "name": "R_front_toe1", "bone": "R_front_toe1", "attachment": "front_toeB" }, - { "name": "R_front_thigh", "bone": "R_front_thigh", "attachment": "R_front_thigh" }, - { "name": "R_front_leg", "bone": "R_front_leg", "attachment": "R_front_leg" }, - { "name": "R_front_toe2", "bone": "R_front_toe2", "attachment": "front_toeB" }, - { "name": "R_front_toe3", "bone": "R_front_toe3", "attachment": "front_toeB" }, - { "name": "chin", "bone": "chin", "attachment": "chin" }, - { "name": "R_wing", "bone": "R_wing", "attachment": "R_wing01" }, - { "name": "head", "bone": "head", "attachment": "head" }, - { "name": "logo", "bone": "root", "attachment": "logo" } -], -"skins": { - "default": { - "L_front_leg": { - "L_front_leg": { "x": 14.68, "y": 0.48, "rotation": 15.99, "width": 84, "height": 57 } - }, - "L_front_thigh": { - "L_front_thigh": { "x": 27.66, "y": -11.58, "rotation": 58.66, "width": 84, "height": 72 } - }, - "L_front_toe1": { - "front_toeA": { "x": 31.92, "y": 0.61, "rotation": 109.55, "width": 29, "height": 50 } - }, - "L_front_toe2": { - "front_toeB": { "x": 26.83, "y": -4.94, "rotation": 109.51, "width": 56, "height": 57 } - }, - "L_front_toe3": { - "front_toeB": { "x": 18.21, "y": -7.21, "scaleX": 0.881, "scaleY": 0.94, "rotation": 99.71, "width": 56, "height": 57 } - }, - "L_front_toe4": { - "front_toeB": { "x": 23.21, "y": -11.68, "scaleX": 0.881, "rotation": 79.89, "width": 56, "height": 57 } - }, - "L_rear_leg": { - "L_rear_leg": { "x": 67.29, "y": 12.62, "rotation": -162.65, "width": 206, "height": 177 } - }, - "L_rear_thigh": { - "L_rear_thigh": { "x": 56.03, "y": 27.38, "rotation": 74.93, "width": 91, "height": 149 } - }, - "L_wing": { - "L_wing01": { "x": 129.21, "y": -45.49, "rotation": -83.7, "width": 191, "height": 256 }, - "L_wing02": { "x": 126.37, "y": -31.69, "rotation": -86.18, "width": 179, "height": 269 }, - "L_wing03": { "x": 110.26, "y": -90.89, "rotation": -86.18, "width": 186, "height": 207 }, - "L_wing04": { "x": -61.61, "y": -83.26, "rotation": -86.18, "width": 188, "height": 135 }, - "L_wing05": { "x": -90.01, "y": -78.14, "rotation": -86.18, "width": 218, "height": 213 }, - "L_wing06": { "x": -143.76, "y": -83.71, "rotation": -86.18, "width": 192, "height": 331 }, - "L_wing07": { "x": -133.04, "y": -33.89, "rotation": -86.18, "width": 159, "height": 255 }, - "L_wing08": { "x": 50.15, "y": -15.71, "rotation": -86.18, "width": 164, "height": 181 }, - "L_wing09": { "x": 85.94, "y": -11.32, "rotation": -86.18, "width": 204, "height": 167 } - }, - "R_front_leg": { - "R_front_leg": { "x": 17.79, "y": 4.22, "rotation": 37.62, "width": 101, "height": 89 } - }, - "R_front_thigh": { - "R_front_thigh": { "x": 35.28, "y": 2.11, "rotation": 130.33, "width": 108, "height": 108 } - }, - "R_front_toe1": { - "front_toeB": { "x": 24.49, "y": -2.61, "rotation": 104.18, "width": 56, "height": 57 } - }, - "R_front_toe2": { - "front_toeB": { "x": 26.39, "y": 1.16, "rotation": 104.57, "width": 56, "height": 57 } - }, - "R_front_toe3": { - "front_toeB": { "x": 30.66, "y": -0.06, "rotation": 112.29, "width": 56, "height": 57 } - }, - "R_rear_leg": { - "R_rear_leg": { "x": 60.87, "y": -5.72, "rotation": -127.66, "width": 116, "height": 100 } - }, - "R_rear_thigh": { - "R_rear_thigh": { "x": 53.25, "y": 12.58, "rotation": 103.29, "width": 91, "height": 149 } - }, - "R_rear_toe1": { - "rear-toe": { "x": 54.75, "y": -5.72, "rotation": 134.79, "width": 109, "height": 77 } - }, - "R_rear_toe2": { - "rear-toe": { "x": 57.02, "y": -7.22, "rotation": 134.42, "width": 109, "height": 77 } - }, - "R_rear_toe3": { - "rear-toe": { "x": 47.46, "y": -7.64, "rotation": 134.34, "width": 109, "height": 77 } - }, - "R_wing": { - "R_wing01": { "x": 170.08, "y": -23.67, "rotation": -130.33, "width": 219, "height": 310 }, - "R_wing02": { "x": 171.14, "y": -19.33, "rotation": -130.33, "width": 203, "height": 305 }, - "R_wing03": { "x": 166.46, "y": 29.23, "rotation": -130.33, "width": 272, "height": 247 }, - "R_wing04": { "x": 42.94, "y": 134.05, "rotation": -130.33, "width": 279, "height": 144 }, - "R_wing05": { "x": -8.83, "y": 142.59, "rotation": -130.33, "width": 251, "height": 229 }, - "R_wing06": { "x": -123.33, "y": 111.22, "rotation": -130.33, "width": 200, "height": 366 }, - "R_wing07": { "x": -40.17, "y": 118.03, "rotation": -130.33, "width": 200, "height": 263 }, - "R_wing08": { "x": 48.01, "y": 28.76, "rotation": -130.33, "width": 234, "height": 254 }, - "R_wing09": { "x": 128.1, "y": 21.12, "rotation": -130.33, "width": 248, "height": 204 } - }, - "back": { - "back": { "x": 35.84, "y": 19.99, "rotation": -151.83, "width": 190, "height": 185 } - }, - "chest": { - "chest": { "x": -14.6, "y": 24.78, "rotation": -161.7, "width": 136, "height": 122 } - }, - "chin": { - "chin": { "x": 66.55, "y": 7.32, "rotation": 30.01, "width": 214, "height": 146 } - }, - "head": { - "head": { "x": 76.68, "y": 32.21, "rotation": -47.12, "width": 296, "height": 260 } - }, - "logo": { - "logo": { "y": -176.72, "width": 897, "height": 92 } - }, - "tail1": { - "tail01": { "x": 22.59, "y": -4.5, "rotation": 163.85, "width": 120, "height": 153 } - }, - "tail2": { - "tail02": { "x": 18.11, "y": -1.75, "rotation": 151.84, "width": 95, "height": 120 } - }, - "tail3": { - "tail03": { "x": 16.94, "y": -2, "rotation": 150.04, "width": 73, "height": 92 } - }, - "tail4": { - "tail04": { "x": 15.34, "y": -2.17, "rotation": 151.84, "width": 56, "height": 71 } - }, - "tail5": { - "tail05": { "x": 15.05, "y": -3.57, "rotation": 155, "width": 52, "height": 59 } - }, - "tail6": { - "tail06": { "x": 28.02, "y": -16.83, "rotation": -175.44, "width": 95, "height": 68 } - } - } -}, -"animations": { - "flying": { - "slots": { - "L_wing": { - "attachment": [ - { "time": 0, "name": "L_wing01" }, - { "time": 0.0666, "name": "L_wing02" }, - { "time": 0.1333, "name": "L_wing03" }, - { "time": 0.2, "name": "L_wing04" }, - { "time": 0.2666, "name": "L_wing05" }, - { "time": 0.3333, "name": "L_wing06" }, - { "time": 0.4, "name": "L_wing07" }, - { "time": 0.4666, "name": "L_wing08" }, - { "time": 0.5333, "name": "L_wing09" }, - { "time": 0.6, "name": "L_wing01" }, - { "time": 0.7333, "name": "L_wing02" }, - { "time": 0.8, "name": "L_wing03" }, - { "time": 0.8333, "name": "L_wing04" }, - { "time": 0.8666, "name": "L_wing05" }, - { "time": 0.9, "name": "L_wing06" }, - { "time": 0.9333, "name": "L_wing07" }, - { "time": 0.9666, "name": "L_wing08" }, - { "time": 1, "name": "L_wing01" } - ] - }, - "R_wing": { - "attachment": [ - { "time": 0, "name": "R_wing01" }, - { "time": 0.0666, "name": "R_wing02" }, - { "time": 0.1333, "name": "R_wing03" }, - { "time": 0.2, "name": "R_wing04" }, - { "time": 0.2666, "name": "R_wing05" }, - { "time": 0.3333, "name": "R_wing06" }, - { "time": 0.4, "name": "R_wing07" }, - { "time": 0.4666, "name": "R_wing08" }, - { "time": 0.5333, "name": "R_wing09" }, - { "time": 0.6, "name": "R_wing01" }, - { "time": 0.7333, "name": "R_wing02" }, - { "time": 0.7666, "name": "R_wing02" }, - { "time": 0.8, "name": "R_wing03" }, - { "time": 0.8333, "name": "R_wing04" }, - { "time": 0.8666, "name": "R_wing05" }, - { "time": 0.9, "name": "R_wing06" }, - { "time": 0.9333, "name": "R_wing07" }, - { "time": 0.9666, "name": "R_wing08" }, - { "time": 1, "name": "R_wing01" } - ] - } - }, - "bones": { - "back": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 17.39 }, - { "time": 0.5, "angle": 0 }, - { "time": 0.8333, "angle": 7 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "neck": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -8.18 }, - { "time": 0.3333, "angle": -23.16 }, - { "time": 0.5, "angle": -18.01 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "chest": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail1": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -2.42 }, - { "time": 0.3333, "angle": -26.2 }, - { "time": 0.5, "angle": -29.65 }, - { "time": 0.6666, "angle": -23.15 }, - { "time": 0.8333, "angle": -55.46 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_rear_thigh": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail2": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -1.12 }, - { "time": 0.3333, "angle": 10.48 }, - { "time": 0.5, "angle": 7.89 }, - { "time": 0.8333, "angle": -10.38 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail3": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 8.24 }, - { "time": 0.3333, "angle": 15.21 }, - { "time": 0.5, "angle": 14.84 }, - { "time": 0.8333, "angle": -18.9 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail4": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 17.46 }, - { "time": 0.3333, "angle": 22.15 }, - { "time": 0.5, "angle": 22.76 }, - { "time": 0.8333, "angle": -4.37 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail5": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 7.4 }, - { "time": 0.3333, "angle": 28.5 }, - { "time": 0.5, "angle": 21.33 }, - { "time": 0.8333, "angle": -1.27 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail6": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 45.99 }, - { "time": 0.4, "angle": 43.53 }, - { "time": 0.5, "angle": 61.79 }, - { "time": 0.8333, "angle": 13.28 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_rear_leg": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -14.21 }, - { "time": 0.5, "angle": 47.17 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_rear_toe3": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": -36.06 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_rear_toe2": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": -20.32 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_rear_toe1": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": -18.71 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "head": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.408, 1.36, 0.675, 1.43 ] - }, - { "time": 0.5, "angle": 1.03 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "chin": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.416, 1.15, 0.494, 1.27 ] - }, - { "time": 0.3333, "angle": -5.15 }, - { "time": 0.5, "angle": 9.79 }, - { "time": 0.6666, "angle": 18.94 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_thigh": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -19.18 }, - { "time": 0.3333, "angle": -32.02 }, - { "time": 0.5, "angle": -19.62 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_front_thigh": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -12.96 }, - { "time": 0.5, "angle": 16.2 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_leg": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 37.77 }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_toe1": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -16.08 }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_toe2": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.33, "y": 1.029 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_toe4": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": 26.51 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.239, "y": 0.993 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_toe3": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": 16.99 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.402, "y": 1.007 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_front_leg": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 26.07 }, - { "time": 0.5, "angle": -21.6 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_front_toe1": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 29.23 }, - { "time": 0.5, "angle": 34.83 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.412, "y": 1 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_front_toe2": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 24.89 }, - { "time": 0.5, "angle": 23.16 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.407, "y": 1.057 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_front_toe3": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 11.01 }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.329, "y": 1.181 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_rear_leg": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 25.19 }, - { "time": 0.6666, "angle": -15.65 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 } - ] - }, - "COG": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.456, 0.2, 0.422, 1.06 ] - }, - { "time": 0.3333, "angle": 23.93 }, - { - "time": 0.6666, - "angle": 337.8, - "curve": [ 0.41, 0, 0.887, 0.75 ] - }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { - "time": 0, - "x": 0, - "y": 0, - "curve": [ 0.33, 1, 0.816, 1.33 ] - }, - { - "time": 0.5, - "x": 0, - "y": 113.01, - "curve": [ 0.396, 0, 0.709, 2.03 ] - }, - { "time": 1, "x": 0, "y": 0 } - ] - } - } - } -} -} \ No newline at end of file diff --git a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/dragon.png b/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/dragon.png deleted file mode 100755 index bb1fc41..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/dragon.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/dragon2.png b/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/dragon2.png deleted file mode 100755 index 381e77a..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/dragon2.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/goblins.atlas b/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/goblins.atlas deleted file mode 100755 index c9cb702..0000000 --- a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/goblins.atlas +++ /dev/null @@ -1,293 +0,0 @@ - -goblins.png -size: 228,523 -format: RGBA8888 -filter: Linear,Linear -repeat: none -dagger - rotate: false - xy: 2, 43 - size: 26, 108 - orig: 26, 108 - offset: 0, 0 - index: -1 -goblin/eyes-closed - rotate: false - xy: 166, 237 - size: 34, 12 - orig: 34, 12 - offset: 0, 0 - index: -1 -goblin/head - rotate: false - xy: 26, 372 - size: 103, 66 - orig: 103, 66 - offset: 0, 0 - index: -1 -goblin/left-arm - rotate: false - xy: 166, 251 - size: 37, 35 - orig: 37, 35 - offset: 0, 0 - index: -1 -goblin/left-foot - rotate: true - xy: 195, 358 - size: 65, 31 - orig: 65, 31 - offset: 0, 0 - index: -1 -goblin/left-hand - rotate: false - xy: 49, 2 - size: 36, 41 - orig: 36, 41 - offset: 0, 0 - index: -1 -goblin/left-lower-leg - rotate: false - xy: 30, 45 - size: 33, 70 - orig: 33, 70 - offset: 0, 0 - index: -1 -goblin/left-shoulder - rotate: true - xy: 169, 288 - size: 29, 44 - orig: 29, 44 - offset: 0, 0 - index: -1 -goblin/left-upper-leg - rotate: false - xy: 134, 305 - size: 33, 73 - orig: 33, 73 - offset: 0, 0 - index: -1 -goblin/neck - rotate: false - xy: 87, 2 - size: 36, 41 - orig: 36, 41 - offset: 0, 0 - index: -1 -goblin/pelvis - rotate: false - xy: 131, 380 - size: 62, 43 - orig: 62, 43 - offset: 0, 0 - index: -1 -goblin/right-arm - rotate: false - xy: 135, 69 - size: 23, 50 - orig: 23, 50 - offset: 0, 0 - index: -1 -goblin/right-foot - rotate: true - xy: 104, 157 - size: 63, 33 - orig: 63, 33 - offset: 0, 0 - index: -1 -goblin/right-hand - rotate: false - xy: 190, 319 - size: 36, 37 - orig: 36, 37 - offset: 0, 0 - index: -1 -goblin/right-lower-leg - rotate: false - xy: 96, 294 - size: 36, 76 - orig: 36, 76 - offset: 0, 0 - index: -1 -goblin/right-shoulder - rotate: true - xy: 2, 2 - size: 39, 45 - orig: 39, 45 - offset: 0, 0 - index: -1 -goblin/right-upper-leg - rotate: false - xy: 139, 162 - size: 34, 63 - orig: 34, 63 - offset: 0, 0 - index: -1 -goblin/torso - rotate: false - xy: 131, 425 - size: 68, 96 - orig: 68, 96 - offset: 0, 0 - index: -1 -goblin/undie-straps - rotate: true - xy: 201, 466 - size: 55, 19 - orig: 55, 19 - offset: 0, 0 - index: -1 -goblin/undies - rotate: false - xy: 190, 51 - size: 36, 29 - orig: 36, 29 - offset: 0, 0 - index: -1 -goblingirl/eyes-closed - rotate: true - xy: 201, 427 - size: 37, 21 - orig: 37, 21 - offset: 0, 0 - index: -1 -goblingirl/head - rotate: false - xy: 26, 440 - size: 103, 81 - orig: 103, 81 - offset: 0, 0 - index: -1 -goblingirl/left-arm - rotate: true - xy: 175, 198 - size: 37, 35 - orig: 37, 35 - offset: 0, 0 - index: -1 -goblingirl/left-foot - rotate: true - xy: 133, 227 - size: 65, 31 - orig: 65, 31 - offset: 0, 0 - index: -1 -goblingirl/left-hand - rotate: true - xy: 168, 2 - size: 35, 40 - orig: 35, 40 - offset: 0, 0 - index: -1 -goblingirl/left-lower-leg - rotate: false - xy: 65, 45 - size: 33, 70 - orig: 33, 70 - offset: 0, 0 - index: -1 -goblingirl/left-shoulder - rotate: true - xy: 135, 39 - size: 28, 46 - orig: 28, 46 - offset: 0, 0 - index: -1 -goblingirl/left-upper-leg - rotate: false - xy: 98, 222 - size: 33, 70 - orig: 33, 70 - offset: 0, 0 - index: -1 -goblingirl/neck - rotate: true - xy: 125, 2 - size: 35, 41 - orig: 35, 41 - offset: 0, 0 - index: -1 -goblingirl/pelvis - rotate: false - xy: 30, 117 - size: 62, 43 - orig: 62, 43 - offset: 0, 0 - index: -1 -goblingirl/right-arm - rotate: false - xy: 160, 69 - size: 28, 50 - orig: 28, 50 - offset: 0, 0 - index: -1 -goblingirl/right-foot - rotate: true - xy: 100, 56 - size: 63, 33 - orig: 63, 33 - offset: 0, 0 - index: -1 -goblingirl/right-hand - rotate: false - xy: 190, 82 - size: 36, 37 - orig: 36, 37 - offset: 0, 0 - index: -1 -goblingirl/right-lower-leg - rotate: true - xy: 26, 162 - size: 36, 76 - orig: 36, 76 - offset: 0, 0 - index: -1 -goblingirl/right-shoulder - rotate: true - xy: 159, 121 - size: 39, 45 - orig: 39, 45 - offset: 0, 0 - index: -1 -goblingirl/right-upper-leg - rotate: true - xy: 94, 121 - size: 34, 63 - orig: 34, 63 - offset: 0, 0 - index: -1 -goblingirl/torso - rotate: false - xy: 26, 274 - size: 68, 96 - orig: 68, 96 - offset: 0, 0 - index: -1 -goblingirl/undie-straps - rotate: true - xy: 169, 323 - size: 55, 19 - orig: 55, 19 - offset: 0, 0 - index: -1 -goblingirl/undies - rotate: false - xy: 175, 167 - size: 36, 29 - orig: 36, 29 - offset: 0, 0 - index: -1 -shield - rotate: false - xy: 26, 200 - size: 70, 72 - orig: 70, 72 - offset: 0, 0 - index: -1 -spear - rotate: false - xy: 2, 153 - size: 22, 368 - orig: 22, 368 - offset: 0, 0 - index: -1 diff --git a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/goblins.json b/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/goblins.json deleted file mode 100755 index 5d83ae1..0000000 --- a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/goblins.json +++ /dev/null @@ -1 +0,0 @@ -{"skeleton":{"hash":"BMzsp4a1APif5tjCQwomTTo3Ino","spine":"2.1.05","width":233.95,"height":354.87},"bones":[{"name":"root"},{"name":"hip","parent":"root","x":0.64,"y":114.41},{"name":"left upper leg","parent":"hip","length":50.39,"x":14.45,"y":2.81,"rotation":-89.09},{"name":"pelvis","parent":"hip","x":1.41,"y":-6.57},{"name":"right upper leg","parent":"hip","length":42.45,"x":-20.07,"y":-6.83,"rotation":-97.49},{"name":"torso","parent":"hip","length":85.82,"x":-6.42,"y":1.97,"rotation":93.92},{"name":"left lower leg","parent":"left upper leg","length":49.89,"x":56.34,"y":0.98,"rotation":-16.65},{"name":"left shoulder","parent":"torso","length":35.43,"x":74.04,"y":-20.38,"rotation":-156.96},{"name":"neck","parent":"torso","length":18.38,"x":81.67,"y":-6.34,"rotation":-1.51},{"name":"right lower leg","parent":"right upper leg","length":58.52,"x":42.99,"y":-0.61,"rotation":-14.34},{"name":"right shoulder","parent":"torso","length":37.24,"x":76.02,"y":18.14,"rotation":133.88},{"name":"head","parent":"neck","length":68.28,"x":20.93,"y":11.59,"rotation":-13.92},{"name":"left arm","parent":"left shoulder","length":35.62,"x":37.85,"y":-2.34,"rotation":28.16},{"name":"left foot","parent":"left lower leg","length":46.5,"x":58.94,"y":-7.61,"rotation":102.43},{"name":"right arm","parent":"right shoulder","length":36.74,"x":37.6,"y":0.31,"rotation":36.32},{"name":"right foot","parent":"right lower leg","length":45.45,"x":64.88,"y":0.04,"rotation":110.3},{"name":"left hand","parent":"left arm","length":11.52,"x":35.62,"y":0.07,"rotation":2.7},{"name":"right hand","parent":"right arm","length":15.32,"x":36.9,"y":0.34,"rotation":2.35}],"slots":[{"name":"left shoulder","bone":"left shoulder","attachment":"left shoulder"},{"name":"left arm","bone":"left arm","attachment":"left arm"},{"name":"left hand item","bone":"left hand","attachment":"spear"},{"name":"left hand","bone":"left hand","attachment":"left hand"},{"name":"left foot","bone":"left foot","attachment":"left foot"},{"name":"left lower leg","bone":"left lower leg","attachment":"left lower leg"},{"name":"left upper leg","bone":"left upper leg","attachment":"left upper leg"},{"name":"neck","bone":"neck","attachment":"neck"},{"name":"torso","bone":"torso","attachment":"torso"},{"name":"pelvis","bone":"pelvis","attachment":"pelvis"},{"name":"right foot","bone":"right foot","attachment":"right foot"},{"name":"right lower leg","bone":"right lower leg","attachment":"right lower leg"},{"name":"undie straps","bone":"pelvis","attachment":"undie straps"},{"name":"undies","bone":"pelvis","attachment":"undies"},{"name":"right upper leg","bone":"right upper leg","attachment":"right upper leg"},{"name":"head","bone":"head","attachment":"head"},{"name":"eyes","bone":"head"},{"name":"right shoulder","bone":"right shoulder","attachment":"right shoulder"},{"name":"right arm","bone":"right arm","attachment":"right arm"},{"name":"right hand item","bone":"right hand"},{"name":"right hand","bone":"right hand","attachment":"right hand"},{"name":"right hand item top","bone":"right hand","attachment":"shield"}],"skins":{"default":{"left hand item":{"dagger":{"x":7.88,"y":-23.45,"rotation":10.47,"width":26,"height":108},"spear":{"x":-4.55,"y":39.2,"rotation":13.04,"width":22,"height":368}},"right hand item":{"dagger":{"x":6.51,"y":-24.15,"rotation":-8.06,"width":26,"height":108}},"right hand item top":{"shield":{"rotation":93.49,"width":70,"height":72}}},"goblin":{"eyes":{"eyes closed":{"name":"goblin/eyes-closed","x":32.21,"y":-21.27,"rotation":-88.92,"width":34,"height":12}},"head":{"head":{"name":"goblin/head","x":25.73,"y":2.33,"rotation":-92.29,"width":103,"height":66}},"left arm":{"left arm":{"name":"goblin/left-arm","x":16.7,"y":-1.69,"scaleX":1.057,"scaleY":1.057,"rotation":33.84,"width":37,"height":35}},"left foot":{"left foot":{"name":"goblin/left-foot","x":24.85,"y":8.74,"rotation":3.32,"width":65,"height":31}},"left hand":{"left hand":{"name":"goblin/left-hand","x":3.47,"y":3.41,"scaleX":0.892,"scaleY":0.892,"rotation":31.14,"width":36,"height":41}},"left lower leg":{"left lower leg":{"name":"goblin/left-lower-leg","x":23.58,"y":-2.06,"rotation":105.75,"width":33,"height":70}},"left shoulder":{"left shoulder":{"name":"goblin/left-shoulder","x":15.56,"y":-2.26,"rotation":62.01,"width":29,"height":44}},"left upper leg":{"left upper leg":{"name":"goblin/left-upper-leg","x":29.68,"y":-3.87,"rotation":89.09,"width":33,"height":73}},"neck":{"neck":{"name":"goblin/neck","x":10.1,"y":0.42,"rotation":-93.69,"width":36,"height":41}},"pelvis":{"pelvis":{"name":"goblin/pelvis","x":-5.61,"y":0.76,"width":62,"height":43}},"right arm":{"right arm":{"name":"goblin/right-arm","x":16.44,"y":-1.04,"rotation":94.32,"width":23,"height":50}},"right foot":{"right foot":{"name":"goblin/right-foot","x":23.56,"y":9.8,"rotation":1.52,"width":63,"height":33}},"right hand":{"right hand":{"name":"goblin/right-hand","x":7.88,"y":2.78,"rotation":91.96,"width":36,"height":37}},"right lower leg":{"right lower leg":{"name":"goblin/right-lower-leg","x":25.68,"y":-3.15,"rotation":111.83,"width":36,"height":76}},"right shoulder":{"right shoulder":{"name":"goblin/right-shoulder","x":15.68,"y":-1.03,"rotation":130.65,"width":39,"height":45}},"right upper leg":{"right upper leg":{"name":"goblin/right-upper-leg","x":20.35,"y":1.47,"rotation":97.49,"width":34,"height":63}},"torso":{"torso":{"name":"goblin/torso","x":38.09,"y":-3.87,"rotation":-94.95,"width":68,"height":96}},"undie straps":{"undie straps":{"name":"goblin/undie-straps","x":-3.87,"y":13.1,"scaleX":1.089,"width":55,"height":19}},"undies":{"undies":{"name":"goblin/undies","x":6.3,"y":0.12,"rotation":0.91,"width":36,"height":29}}},"goblingirl":{"eyes":{"eyes closed":{"name":"goblingirl/eyes-closed","x":28,"y":-25.54,"rotation":-87.04,"width":37,"height":21}},"head":{"head":{"name":"goblingirl/head","x":27.71,"y":-4.32,"rotation":-85.58,"width":103,"height":81}},"left arm":{"left arm":{"name":"goblingirl/left-arm","x":19.64,"y":-2.42,"rotation":33.05,"width":37,"height":35}},"left foot":{"left foot":{"name":"goblingirl/left-foot","x":25.17,"y":7.92,"rotation":3.32,"width":65,"height":31}},"left hand":{"left hand":{"name":"goblingirl/left-hand","x":4.34,"y":2.39,"scaleX":0.896,"scaleY":0.896,"rotation":30.34,"width":35,"height":40}},"left lower leg":{"left lower leg":{"name":"goblingirl/left-lower-leg","x":25.02,"y":-0.6,"rotation":105.75,"width":33,"height":70}},"left shoulder":{"left shoulder":{"name":"goblingirl/left-shoulder","x":19.8,"y":-0.42,"rotation":61.21,"width":28,"height":46}},"left upper leg":{"left upper leg":{"name":"goblingirl/left-upper-leg","x":30.21,"y":-2.95,"rotation":89.09,"width":33,"height":70}},"neck":{"neck":{"name":"goblingirl/neck","x":6.16,"y":-3.14,"rotation":-98.86,"width":35,"height":41}},"pelvis":{"pelvis":{"name":"goblingirl/pelvis","x":-3.87,"y":3.18,"width":62,"height":43}},"right arm":{"right arm":{"name":"goblingirl/right-arm","x":16.85,"y":-0.66,"rotation":93.52,"width":28,"height":50}},"right foot":{"right foot":{"name":"goblingirl/right-foot","x":23.46,"y":9.66,"rotation":1.52,"width":63,"height":33}},"right hand":{"right hand":{"name":"goblingirl/right-hand","x":7.21,"y":3.43,"rotation":91.16,"width":36,"height":37}},"right lower leg":{"right lower leg":{"name":"goblingirl/right-lower-leg","x":26.15,"y":-3.27,"rotation":111.83,"width":36,"height":76}},"right shoulder":{"right shoulder":{"name":"goblingirl/right-shoulder","x":14.46,"y":0.45,"rotation":129.85,"width":39,"height":45}},"right upper leg":{"right upper leg":{"name":"goblingirl/right-upper-leg","x":19.69,"y":2.13,"rotation":97.49,"width":34,"height":63}},"torso":{"torso":{"name":"goblingirl/torso","x":36.28,"y":-5.14,"rotation":-95.74,"width":68,"height":96}},"undie straps":{"undie straps":{"name":"goblingirl/undie-straps","x":-1.51,"y":14.18,"width":55,"height":19}},"undies":{"undies":{"name":"goblingirl/undies","x":5.4,"y":1.7,"width":36,"height":29}}}},"animations":{"walk":{"slots":{"eyes":{"attachment":[{"time":0.7,"name":"eyes closed"},{"time":0.8,"name":null}]}},"bones":{"left upper leg":{"rotate":[{"time":0,"angle":-26.55},{"time":0.1333,"angle":-8.78},{"time":0.2333,"angle":9.51},{"time":0.3666,"angle":30.74},{"time":0.5,"angle":25.33},{"time":0.6333,"angle":26.11},{"time":0.7333,"angle":-7.7},{"time":0.8666,"angle":-21.19},{"time":1,"angle":-26.55}],"translate":[{"time":0,"x":-1.32,"y":1.7},{"time":0.3666,"x":-0.06,"y":2.42},{"time":1,"x":-1.32,"y":1.7}]},"right upper leg":{"rotate":[{"time":0,"angle":42.45},{"time":0.1333,"angle":52.1},{"time":0.2333,"angle":8.53},{"time":0.5,"angle":-16.93},{"time":0.6333,"angle":1.89},{"time":0.7333,"angle":28.06,"curve":[0.462,0.11,1,1]},{"time":0.8666,"angle":58.68,"curve":[0.5,0.02,1,1]},{"time":1,"angle":42.45}],"translate":[{"time":0,"x":6.23,"y":0},{"time":0.2333,"x":2.14,"y":2.4},{"time":0.5,"x":2.44,"y":4.8},{"time":1,"x":6.23,"y":0}]},"left lower leg":{"rotate":[{"time":0,"angle":-22.98},{"time":0.1333,"angle":-63.5},{"time":0.2333,"angle":-73.76},{"time":0.5,"angle":5.11},{"time":0.6333,"angle":-28.29},{"time":0.7333,"angle":4.08},{"time":0.8666,"angle":3.53},{"time":1,"angle":-22.98}],"translate":[{"time":0,"x":0,"y":0},{"time":0.2333,"x":2.55,"y":-0.47},{"time":0.5,"x":0,"y":0,"curve":"stepped"},{"time":1,"x":0,"y":0}]},"left foot":{"rotate":[{"time":0,"angle":-3.69},{"time":0.1333,"angle":-10.42},{"time":0.2333,"angle":-5.01},{"time":0.3666,"angle":3.87},{"time":0.5,"angle":-3.87},{"time":0.6333,"angle":2.78},{"time":0.7333,"angle":1.68},{"time":0.8666,"angle":-8.54},{"time":1,"angle":-3.69}]},"right shoulder":{"rotate":[{"time":0,"angle":5.29,"curve":[0.264,0,0.75,1]},{"time":0.6333,"angle":6.65},{"time":1,"angle":5.29}]},"right arm":{"rotate":[{"time":0,"angle":-4.02,"curve":[0.267,0,0.804,0.99]},{"time":0.6333,"angle":19.78,"curve":[0.307,0,0.787,0.99]},{"time":1,"angle":-4.02}]},"right hand":{"rotate":[{"time":0,"angle":8.98},{"time":0.6333,"angle":0.51},{"time":1,"angle":8.98}]},"left shoulder":{"rotate":[{"time":0,"angle":6.25,"curve":[0.339,0,0.683,1]},{"time":0.5,"angle":-11.78,"curve":[0.281,0,0.686,0.99]},{"time":1,"angle":6.25}],"translate":[{"time":0,"x":1.15,"y":0.23}]},"left hand":{"rotate":[{"time":0,"angle":-21.23,"curve":[0.295,0,0.755,0.98]},{"time":0.5,"angle":-27.28,"curve":[0.241,0,0.75,0.97]},{"time":1,"angle":-21.23}]},"left arm":{"rotate":[{"time":0,"angle":28.37,"curve":[0.339,0,0.683,1]},{"time":0.5,"angle":60.09,"curve":[0.281,0,0.686,0.99]},{"time":1,"angle":28.37}]},"torso":{"rotate":[{"time":0,"angle":-10.28},{"time":0.1333,"angle":-15.38,"curve":[0.545,0,0.818,1]},{"time":0.3666,"angle":-9.78,"curve":[0.58,0.17,0.669,0.99]},{"time":0.6333,"angle":-15.75,"curve":[0.235,0.01,0.795,1]},{"time":0.8666,"angle":-7.06,"curve":[0.209,0,0.816,0.98]},{"time":1,"angle":-10.28}],"translate":[{"time":0,"x":-1.29,"y":1.68}]},"right foot":{"rotate":[{"time":0,"angle":-5.25},{"time":0.2333,"angle":-1.91},{"time":0.3666,"angle":-6.45},{"time":0.5,"angle":-5.39},{"time":0.7333,"angle":-11.68},{"time":0.8666,"angle":0.46},{"time":1,"angle":-5.25}]},"right lower leg":{"rotate":[{"time":0,"angle":-3.39,"curve":[0.316,0.01,0.741,0.98]},{"time":0.1333,"angle":-45.53,"curve":[0.229,0,0.738,0.97]},{"time":0.2333,"angle":-4.83},{"time":0.5,"angle":-19.53},{"time":0.6333,"angle":-64.8},{"time":0.7333,"angle":-82.56,"curve":[0.557,0.18,1,1]},{"time":1,"angle":-3.39}],"translate":[{"time":0,"x":0,"y":0,"curve":"stepped"},{"time":0.5,"x":0,"y":0},{"time":0.6333,"x":2.18,"y":0.21},{"time":1,"x":0,"y":0}]},"hip":{"rotate":[{"time":0,"angle":0,"curve":"stepped"},{"time":1,"angle":0}],"translate":[{"time":0,"x":0,"y":-4.16},{"time":0.1333,"x":0,"y":-7.05,"curve":[0.359,0.47,0.646,0.74]},{"time":0.3666,"x":0,"y":6.78},{"time":0.5,"x":0,"y":-6.13},{"time":0.6333,"x":0,"y":-7.05,"curve":[0.359,0.47,0.646,0.74]},{"time":0.8666,"x":0,"y":6.78},{"time":1,"x":0,"y":-4.16}]},"neck":{"rotate":[{"time":0,"angle":3.6},{"time":0.1333,"angle":17.49},{"time":0.2333,"angle":6.1},{"time":0.3666,"angle":3.45},{"time":0.5,"angle":5.17},{"time":0.6333,"angle":18.36},{"time":0.7333,"angle":6.09},{"time":0.8666,"angle":2.28},{"time":1,"angle":3.6}]},"head":{"rotate":[{"time":0,"angle":3.6,"curve":[0,0,0.704,1.17]},{"time":0.1333,"angle":-0.2},{"time":0.2333,"angle":6.1},{"time":0.3666,"angle":3.45},{"time":0.5,"angle":5.17,"curve":[0,0,0.704,1.61]},{"time":0.6666,"angle":1.1},{"time":0.7333,"angle":6.09},{"time":0.8666,"angle":2.28},{"time":1,"angle":3.6}]}}}}} \ No newline at end of file diff --git a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/goblins.png b/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/goblins.png deleted file mode 100755 index f2cdf16..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/goblins.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/iP4_BGtile.jpg b/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/iP4_BGtile.jpg deleted file mode 100755 index 767a4fd..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/iP4_BGtile.jpg and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/iP4_ground.png b/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/iP4_ground.png deleted file mode 100755 index a7f92af..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/iP4_ground.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/spineboy.atlas b/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/spineboy.atlas deleted file mode 100755 index cf32cd0..0000000 --- a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/spineboy.atlas +++ /dev/null @@ -1,165 +0,0 @@ -spineboy.png -format: RGBA8888 -filter: Linear,Linear -repeat: none -eyes-closed - rotate: false - xy: 73, 509 - size: 34, 27 - orig: 34, 27 - offset: 0, 0 - index: -1 -eyes - rotate: false - xy: 75, 464 - size: 34, 27 - orig: 34, 27 - offset: 0, 0 - index: -1 -head - rotate: false - xy: 2, 2 - size: 121, 132 - orig: 121, 132 - offset: 0, 0 - index: -1 -left-ankle - rotate: false - xy: 96, 351 - size: 25, 32 - orig: 25, 32 - offset: 0, 0 - index: -1 -left-arm - rotate: false - xy: 39, 423 - size: 35, 29 - orig: 35, 29 - offset: 0, 0 - index: -1 -left-foot - rotate: false - xy: 2, 262 - size: 65, 30 - orig: 65, 30 - offset: 0, 0 - index: -1 -left-hand - rotate: false - xy: 2, 423 - size: 35, 38 - orig: 35, 38 - offset: 0, 0 - index: -1 -left-lower-leg - rotate: false - xy: 72, 202 - size: 49, 64 - orig: 49, 64 - offset: 0, 0 - index: -1 -left-pant-bottom - rotate: false - xy: 2, 363 - size: 44, 22 - orig: 44, 22 - offset: 0, 0 - index: -1 -left-shoulder - rotate: false - xy: 39, 454 - size: 34, 53 - orig: 34, 53 - offset: 0, 0 - index: -1 -left-upper-leg - rotate: false - xy: 2, 464 - size: 33, 67 - orig: 33, 67 - offset: 0, 0 - index: -1 -neck - rotate: false - xy: 37, 509 - size: 34, 28 - orig: 34, 28 - offset: 0, 0 - index: -1 -pelvis - rotate: false - xy: 2, 294 - size: 63, 47 - orig: 63, 47 - offset: 0, 0 - index: -1 -right-ankle - rotate: false - xy: 96, 385 - size: 25, 30 - orig: 25, 30 - offset: 0, 0 - index: -1 -right-arm - rotate: false - xy: 96, 417 - size: 21, 45 - orig: 21, 45 - offset: 0, 0 - index: -1 -right-foot-idle - rotate: false - xy: 69, 268 - size: 53, 28 - orig: 53, 28 - offset: 0, 0 - index: -1 -right-foot - rotate: false - xy: 2, 230 - size: 67, 30 - orig: 67, 30 - offset: 0, 0 - index: -1 -right-hand - rotate: false - xy: 2, 387 - size: 32, 32 - orig: 32, 32 - offset: 0, 0 - index: -1 -right-lower-leg - rotate: false - xy: 72, 136 - size: 51, 64 - orig: 51, 64 - offset: 0, 0 - index: -1 -right-pant-bottom - rotate: false - xy: 2, 343 - size: 46, 18 - orig: 46, 18 - offset: 0, 0 - index: -1 -right-shoulder - rotate: false - xy: 67, 298 - size: 52, 51 - orig: 52, 51 - offset: 0, 0 - index: -1 -right-upper-leg - rotate: false - xy: 50, 351 - size: 44, 70 - orig: 44, 70 - offset: 0, 0 - index: -1 -torso - rotate: false - xy: 2, 136 - size: 68, 92 - orig: 68, 92 - offset: 0, 0 - index: -1 diff --git a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/spineboy.json b/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/spineboy.json deleted file mode 100755 index 17c5095..0000000 --- a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/spineboy.json +++ /dev/null @@ -1,787 +0,0 @@ -{ -"bones": [ - { "name": "root" }, - { "name": "hip", "parent": "root", "x": 0.64, "y": 114.41 }, - { "name": "left upper leg", "parent": "hip", "length": 50.39, "x": 14.45, "y": 2.81, "rotation": -89.09 }, - { "name": "left lower leg", "parent": "left upper leg", "length": 56.45, "x": 51.78, "y": 3.46, "rotation": -16.65 }, - { "name": "left foot", "parent": "left lower leg", "length": 46.5, "x": 64.02, "y": -8.67, "rotation": 102.43 }, - { "name": "right upper leg", "parent": "hip", "length": 45.76, "x": -18.27, "rotation": -101.13 }, - { "name": "right lower leg", "parent": "right upper leg", "length": 58.52, "x": 50.21, "y": 0.6, "rotation": -10.7 }, - { "name": "right foot", "parent": "right lower leg", "length": 45.45, "x": 64.88, "y": 0.04, "rotation": 110.3 }, - { "name": "torso", "parent": "hip", "length": 85.82, "x": -6.42, "y": 1.97, "rotation": 94.95 }, - { "name": "neck", "parent": "torso", "length": 18.38, "x": 83.64, "y": -1.78, "rotation": 0.9 }, - { "name": "head", "parent": "neck", "length": 68.28, "x": 19.09, "y": 6.97, "rotation": -8.94 }, - { "name": "right shoulder", "parent": "torso", "length": 49.95, "x": 81.9, "y": 6.79, "rotation": 130.6 }, - { "name": "right arm", "parent": "right shoulder", "length": 36.74, "x": 49.95, "y": -0.12, "rotation": 40.12 }, - { "name": "right hand", "parent": "right arm", "length": 15.32, "x": 36.9, "y": 0.34, "rotation": 2.35 }, - { "name": "left shoulder", "parent": "torso", "length": 44.19, "x": 78.96, "y": -15.75, "rotation": -156.96 }, - { "name": "left arm", "parent": "left shoulder", "length": 35.62, "x": 44.19, "y": -0.01, "rotation": 28.16 }, - { "name": "left hand", "parent": "left arm", "length": 11.52, "x": 35.62, "y": 0.07, "rotation": 2.7 }, - { "name": "pelvis", "parent": "hip", "x": 1.41, "y": -6.57 } -], -"slots": [ - { "name": "left shoulder", "bone": "left shoulder", "attachment": "left-shoulder" }, - { "name": "left arm", "bone": "left arm", "attachment": "left-arm" }, - { "name": "left hand", "bone": "left hand", "attachment": "left-hand" }, - { "name": "left foot", "bone": "left foot", "attachment": "left-foot" }, - { "name": "left lower leg", "bone": "left lower leg", "attachment": "left-lower-leg" }, - { "name": "left upper leg", "bone": "left upper leg", "attachment": "left-upper-leg" }, - { "name": "pelvis", "bone": "pelvis", "attachment": "pelvis" }, - { "name": "right foot", "bone": "right foot", "attachment": "right-foot" }, - { "name": "right lower leg", "bone": "right lower leg", "attachment": "right-lower-leg" }, - { "name": "right upper leg", "bone": "right upper leg", "attachment": "right-upper-leg" }, - { "name": "torso", "bone": "torso", "attachment": "torso" }, - { "name": "neck", "bone": "neck", "attachment": "neck" }, - { "name": "head", "bone": "head", "attachment": "head" }, - { "name": "eyes", "bone": "head", "attachment": "eyes" }, - { "name": "right shoulder", "bone": "right shoulder", "attachment": "right-shoulder" }, - { "name": "right arm", "bone": "right arm", "attachment": "right-arm" }, - { "name": "right hand", "bone": "right hand", "attachment": "right-hand" } -], -"skins": { - "default": { - "left shoulder": { - "left-shoulder": { "x": 23.74, "y": 0.11, "rotation": 62.01, "width": 34, "height": 53 } - }, - "left arm": { - "left-arm": { "x": 15.11, "y": -0.44, "rotation": 33.84, "width": 35, "height": 29 } - }, - "left hand": { - "left-hand": { "x": 0.75, "y": 1.86, "rotation": 31.14, "width": 35, "height": 38 } - }, - "left foot": { - "left-foot": { "x": 24.35, "y": 8.88, "rotation": 3.32, "width": 65, "height": 30 } - }, - "left lower leg": { - "left-lower-leg": { "x": 24.55, "y": -1.92, "rotation": 105.75, "width": 49, "height": 64 } - }, - "left upper leg": { - "left-upper-leg": { "x": 26.12, "y": -1.85, "rotation": 89.09, "width": 33, "height": 67 } - }, - "pelvis": { - "pelvis": { "x": -4.83, "y": 10.62, "width": 63, "height": 47 } - }, - "right foot": { - "right-foot": { "x": 19.02, "y": 8.47, "rotation": 1.52, "width": 67, "height": 30 } - }, - "right lower leg": { - "right-lower-leg": { "x": 23.28, "y": -2.59, "rotation": 111.83, "width": 51, "height": 64 } - }, - "right upper leg": { - "right-upper-leg": { "x": 23.03, "y": 0.25, "rotation": 101.13, "width": 44, "height": 70 } - }, - "torso": { - "torso": { "x": 44.57, "y": -7.08, "rotation": -94.95, "width": 68, "height": 92 } - }, - "neck": { - "neck": { "x": 9.42, "y": -3.66, "rotation": -100.15, "width": 34, "height": 28 } - }, - "head": { - "head": { "x": 53.94, "y": -5.75, "rotation": -86.9, "width": 121, "height": 132 } - }, - "eyes": { - "eyes": { "x": 28.94, "y": -32.92, "rotation": -86.9, "width": 34, "height": 27 }, - "eyes-closed": { "x": 28.77, "y": -32.86, "rotation": -86.9, "width": 34, "height": 27 } - }, - "right shoulder": { - "right-shoulder": { "x": 25.86, "y": 0.03, "rotation": 134.44, "width": 52, "height": 51 } - }, - "right arm": { - "right-arm": { "x": 18.34, "y": -2.64, "rotation": 94.32, "width": 21, "height": 45 } - }, - "right hand": { - "right-hand": { "x": 6.82, "y": 1.25, "rotation": 91.96, "width": 32, "height": 32 } - } - } -}, -"animations": { - "walk": { - "bones": { - "left upper leg": { - "rotate": [ - { "time": 0, "angle": -26.55 }, - { "time": 0.1333, "angle": -8.78 }, - { "time": 0.2666, "angle": 9.51 }, - { "time": 0.4, "angle": 30.74 }, - { "time": 0.5333, "angle": 25.33 }, - { "time": 0.6666, "angle": 26.11 }, - { "time": 0.8, "angle": -7.7 }, - { "time": 0.9333, "angle": -21.19 }, - { "time": 1.0666, "angle": -26.55 } - ], - "translate": [ - { "time": 0, "x": -3, "y": -2.25 }, - { "time": 0.4, "x": -2.18, "y": -2.25 }, - { "time": 1.0666, "x": -3, "y": -2.25 } - ] - }, - "right upper leg": { - "rotate": [ - { "time": 0, "angle": 42.45 }, - { "time": 0.1333, "angle": 52.1 }, - { "time": 0.2666, "angle": 5.96 }, - { "time": 0.5333, "angle": -16.93 }, - { "time": 0.6666, "angle": 1.89 }, - { - "time": 0.8, - "angle": 28.06, - "curve": [ 0.462, 0.11, 1, 1 ] - }, - { - "time": 0.9333, - "angle": 58.68, - "curve": [ 0.5, 0.02, 1, 1 ] - }, - { "time": 1.0666, "angle": 42.45 } - ], - "translate": [ - { "time": 0, "x": 8.11, "y": -2.36 }, - { "time": 0.1333, "x": 10.03, "y": -2.56 }, - { "time": 0.4, "x": 2.76, "y": -2.97 }, - { "time": 0.5333, "x": 2.76, "y": -2.81 }, - { "time": 0.9333, "x": 8.67, "y": -2.54 }, - { "time": 1.0666, "x": 8.11, "y": -2.36 } - ] - }, - "left lower leg": { - "rotate": [ - { "time": 0, "angle": -10.21 }, - { "time": 0.1333, "angle": -55.64 }, - { "time": 0.2666, "angle": -68.12 }, - { "time": 0.5333, "angle": 5.11 }, - { "time": 0.6666, "angle": -28.29 }, - { "time": 0.8, "angle": 4.08 }, - { "time": 0.9333, "angle": 3.53 }, - { "time": 1.0666, "angle": -10.21 } - ] - }, - "left foot": { - "rotate": [ - { "time": 0, "angle": -3.69 }, - { "time": 0.1333, "angle": -10.42 }, - { "time": 0.2666, "angle": -17.14 }, - { "time": 0.4, "angle": -2.83 }, - { "time": 0.5333, "angle": -3.87 }, - { "time": 0.6666, "angle": 2.78 }, - { "time": 0.8, "angle": 1.68 }, - { "time": 0.9333, "angle": -8.54 }, - { "time": 1.0666, "angle": -3.69 } - ] - }, - "right shoulder": { - "rotate": [ - { - "time": 0, - "angle": 20.89, - "curve": [ 0.264, 0, 0.75, 1 ] - }, - { - "time": 0.1333, - "angle": 3.72, - "curve": [ 0.272, 0, 0.841, 1 ] - }, - { "time": 0.6666, "angle": -278.28 }, - { "time": 1.0666, "angle": 20.89 } - ], - "translate": [ - { "time": 0, "x": -7.84, "y": 7.19 }, - { "time": 0.1333, "x": -6.36, "y": 6.42 }, - { "time": 0.6666, "x": -11.07, "y": 5.25 }, - { "time": 1.0666, "x": -7.84, "y": 7.19 } - ] - }, - "right arm": { - "rotate": [ - { - "time": 0, - "angle": -4.02, - "curve": [ 0.267, 0, 0.804, 0.99 ] - }, - { - "time": 0.1333, - "angle": -13.99, - "curve": [ 0.341, 0, 1, 1 ] - }, - { - "time": 0.6666, - "angle": 36.54, - "curve": [ 0.307, 0, 0.787, 0.99 ] - }, - { "time": 1.0666, "angle": -4.02 } - ] - }, - "right hand": { - "rotate": [ - { "time": 0, "angle": 22.92 }, - { "time": 0.4, "angle": -8.97 }, - { "time": 0.6666, "angle": 0.51 }, - { "time": 1.0666, "angle": 22.92 } - ] - }, - "left shoulder": { - "rotate": [ - { "time": 0, "angle": -1.47 }, - { "time": 0.1333, "angle": 13.6 }, - { "time": 0.6666, "angle": 280.74 }, - { "time": 1.0666, "angle": -1.47 } - ], - "translate": [ - { "time": 0, "x": -1.76, "y": 0.56 }, - { "time": 0.6666, "x": -2.47, "y": 8.14 }, - { "time": 1.0666, "x": -1.76, "y": 0.56 } - ] - }, - "left hand": { - "rotate": [ - { - "time": 0, - "angle": 11.58, - "curve": [ 0.169, 0.37, 0.632, 1.55 ] - }, - { - "time": 0.1333, - "angle": 28.13, - "curve": [ 0.692, 0, 0.692, 0.99 ] - }, - { - "time": 0.6666, - "angle": -27.42, - "curve": [ 0.117, 0.41, 0.738, 1.76 ] - }, - { "time": 0.8, "angle": -36.32 }, - { "time": 1.0666, "angle": 11.58 } - ] - }, - "left arm": { - "rotate": [ - { "time": 0, "angle": -8.27 }, - { "time": 0.1333, "angle": 18.43 }, - { "time": 0.6666, "angle": 0.88 }, - { "time": 1.0666, "angle": -8.27 } - ] - }, - "torso": { - "rotate": [ - { "time": 0, "angle": -10.28 }, - { - "time": 0.1333, - "angle": -15.38, - "curve": [ 0.545, 0, 1, 1 ] - }, - { - "time": 0.4, - "angle": -9.78, - "curve": [ 0.58, 0.17, 1, 1 ] - }, - { "time": 0.6666, "angle": -15.75 }, - { "time": 0.9333, "angle": -7.06 }, - { "time": 1.0666, "angle": -10.28 } - ], - "translate": [ - { "time": 0, "x": -3.67, "y": 1.68 }, - { "time": 0.1333, "x": -3.67, "y": 0.68 }, - { "time": 0.4, "x": -3.67, "y": 1.97 }, - { "time": 0.6666, "x": -3.67, "y": -0.14 }, - { "time": 1.0666, "x": -3.67, "y": 1.68 } - ] - }, - "right foot": { - "rotate": [ - { "time": 0, "angle": -5.25 }, - { "time": 0.2666, "angle": -4.08 }, - { "time": 0.4, "angle": -6.45 }, - { "time": 0.5333, "angle": -5.39 }, - { "time": 0.8, "angle": -11.68 }, - { "time": 0.9333, "angle": 0.46 }, - { "time": 1.0666, "angle": -5.25 } - ] - }, - "right lower leg": { - "rotate": [ - { "time": 0, "angle": -3.39 }, - { "time": 0.1333, "angle": -45.53 }, - { "time": 0.2666, "angle": -2.59 }, - { "time": 0.5333, "angle": -19.53 }, - { "time": 0.6666, "angle": -64.8 }, - { - "time": 0.8, - "angle": -82.56, - "curve": [ 0.557, 0.18, 1, 1 ] - }, - { "time": 1.0666, "angle": -3.39 } - ] - }, - "hip": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 1.0666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { - "time": 0.1333, - "x": 0, - "y": -7.61, - "curve": [ 0.272, 0.86, 1, 1 ] - }, - { "time": 0.4, "x": 0, "y": 8.7 }, - { "time": 0.5333, "x": 0, "y": -0.41 }, - { - "time": 0.6666, - "x": 0, - "y": -7.05, - "curve": [ 0.235, 0.89, 1, 1 ] - }, - { "time": 0.8, "x": 0, "y": 2.92 }, - { "time": 0.9333, "x": 0, "y": 6.78 }, - { "time": 1.0666, "x": 0, "y": 0 } - ] - }, - "neck": { - "rotate": [ - { "time": 0, "angle": 3.6 }, - { "time": 0.1333, "angle": 17.49 }, - { "time": 0.2666, "angle": 6.1 }, - { "time": 0.4, "angle": 3.45 }, - { "time": 0.5333, "angle": 5.17 }, - { "time": 0.6666, "angle": 18.36 }, - { "time": 0.8, "angle": 6.09 }, - { "time": 0.9333, "angle": 2.28 }, - { "time": 1.0666, "angle": 3.6 } - ] - }, - "head": { - "rotate": [ - { - "time": 0, - "angle": 3.6, - "curve": [ 0, 0, 0.704, 1.61 ] - }, - { "time": 0.1666, "angle": -0.2 }, - { "time": 0.2666, "angle": 6.1 }, - { "time": 0.4, "angle": 3.45 }, - { - "time": 0.5333, - "angle": 5.17, - "curve": [ 0, 0, 0.704, 1.61 ] - }, - { "time": 0.7, "angle": 1.1 }, - { "time": 0.8, "angle": 6.09 }, - { "time": 0.9333, "angle": 2.28 }, - { "time": 1.0666, "angle": 3.6 } - ] - } - } - }, - "jump": { - "bones": { - "hip": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.9333, "angle": 0, "curve": "stepped" }, - { "time": 1.3666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": -11.57, "y": -3 }, - { "time": 0.2333, "x": -16.2, "y": -19.43 }, - { - "time": 0.3333, - "x": 7.66, - "y": -8.48, - "curve": [ 0.057, 0.06, 0.712, 1 ] - }, - { "time": 0.3666, "x": 15.38, "y": 5.01 }, - { "time": 0.4666, "x": -7.84, "y": 57.22 }, - { - "time": 0.6, - "x": -10.81, - "y": 96.34, - "curve": [ 0.241, 0, 1, 1 ] - }, - { "time": 0.7333, "x": -7.01, "y": 54.7 }, - { "time": 0.8, "x": -10.58, "y": 32.2 }, - { "time": 0.9333, "x": -31.99, "y": 0.45 }, - { "time": 1.0666, "x": -12.48, "y": -29.47 }, - { "time": 1.3666, "x": -11.57, "y": -3 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left upper leg": { - "rotate": [ - { "time": 0, "angle": 17.13 }, - { "time": 0.2333, "angle": 44.35 }, - { "time": 0.3333, "angle": 16.46 }, - { "time": 0.4, "angle": -9.88 }, - { "time": 0.4666, "angle": -11.42 }, - { "time": 0.5666, "angle": 23.46 }, - { "time": 0.7666, "angle": 71.82 }, - { "time": 0.9333, "angle": 65.53 }, - { "time": 1.0666, "angle": 51.01 }, - { "time": 1.3666, "angle": 17.13 } - ], - "translate": [ - { "time": 0, "x": -3, "y": -2.25, "curve": "stepped" }, - { "time": 0.9333, "x": -3, "y": -2.25, "curve": "stepped" }, - { "time": 1.3666, "x": -3, "y": -2.25 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left lower leg": { - "rotate": [ - { "time": 0, "angle": -16.25 }, - { "time": 0.2333, "angle": -52.21 }, - { "time": 0.4, "angle": 15.04 }, - { "time": 0.4666, "angle": -8.95 }, - { "time": 0.5666, "angle": -39.53 }, - { "time": 0.7666, "angle": -27.27 }, - { "time": 0.9333, "angle": -3.52 }, - { "time": 1.0666, "angle": -61.92 }, - { "time": 1.3666, "angle": -16.25 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left foot": { - "rotate": [ - { "time": 0, "angle": 0.33 }, - { "time": 0.2333, "angle": 6.2 }, - { "time": 0.3333, "angle": 14.73 }, - { "time": 0.4, "angle": -15.54 }, - { "time": 0.4333, "angle": -21.2 }, - { "time": 0.5666, "angle": -7.55 }, - { "time": 0.7666, "angle": -0.67 }, - { "time": 0.9333, "angle": -0.58 }, - { "time": 1.0666, "angle": 14.64 }, - { "time": 1.3666, "angle": 0.33 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right upper leg": { - "rotate": [ - { "time": 0, "angle": 25.97 }, - { "time": 0.2333, "angle": 46.43 }, - { "time": 0.3333, "angle": 22.61 }, - { "time": 0.4, "angle": 2.13 }, - { - "time": 0.4666, - "angle": 0.04, - "curve": [ 0, 0, 0.637, 0.98 ] - }, - { "time": 0.6, "angle": 65.55 }, - { "time": 0.7666, "angle": 64.93 }, - { "time": 0.9333, "angle": 41.08 }, - { "time": 1.0666, "angle": 66.25 }, - { "time": 1.3666, "angle": 25.97 } - ], - "translate": [ - { "time": 0, "x": 5.74, "y": 0.61 }, - { "time": 0.2333, "x": 4.79, "y": 1.79 }, - { "time": 0.3333, "x": 6.05, "y": -4.55 }, - { "time": 0.9333, "x": 4.79, "y": 1.79, "curve": "stepped" }, - { "time": 1.0666, "x": 4.79, "y": 1.79 }, - { "time": 1.3666, "x": 5.74, "y": 0.61 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right lower leg": { - "rotate": [ - { "time": 0, "angle": -27.46 }, - { "time": 0.2333, "angle": -64.03 }, - { "time": 0.4, "angle": -48.36 }, - { "time": 0.5666, "angle": -76.86 }, - { "time": 0.7666, "angle": -26.89 }, - { "time": 0.9, "angle": -18.97 }, - { "time": 0.9333, "angle": -14.18 }, - { "time": 1.0666, "angle": -80.45 }, - { "time": 1.3666, "angle": -27.46 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right foot": { - "rotate": [ - { "time": 0, "angle": 1.08 }, - { "time": 0.2333, "angle": 16.02 }, - { "time": 0.3, "angle": 12.94 }, - { "time": 0.3333, "angle": 15.16 }, - { "time": 0.4, "angle": -14.7 }, - { "time": 0.4333, "angle": -12.85 }, - { "time": 0.4666, "angle": -19.18 }, - { "time": 0.5666, "angle": -15.82 }, - { "time": 0.6, "angle": -3.59 }, - { "time": 0.7666, "angle": -3.56 }, - { "time": 0.9333, "angle": 1.86 }, - { "time": 1.0666, "angle": 16.02 }, - { "time": 1.3666, "angle": 1.08 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "torso": { - "rotate": [ - { "time": 0, "angle": -13.35 }, - { "time": 0.2333, "angle": -48.95 }, - { "time": 0.4333, "angle": -35.77 }, - { "time": 0.6, "angle": -4.59 }, - { "time": 0.7666, "angle": 14.61 }, - { "time": 0.9333, "angle": 15.74 }, - { "time": 1.0666, "angle": -32.44 }, - { "time": 1.3666, "angle": -13.35 } - ], - "translate": [ - { "time": 0, "x": -3.67, "y": 1.68, "curve": "stepped" }, - { "time": 0.9333, "x": -3.67, "y": 1.68, "curve": "stepped" }, - { "time": 1.3666, "x": -3.67, "y": 1.68 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "neck": { - "rotate": [ - { "time": 0, "angle": 12.78 }, - { "time": 0.2333, "angle": 16.46 }, - { "time": 0.4, "angle": 26.49 }, - { "time": 0.6, "angle": 15.51 }, - { "time": 0.7666, "angle": 1.34 }, - { "time": 0.9333, "angle": 2.35 }, - { "time": 1.0666, "angle": 6.08 }, - { "time": 1.3, "angle": 21.23 }, - { "time": 1.3666, "angle": 12.78 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "head": { - "rotate": [ - { "time": 0, "angle": 5.19 }, - { "time": 0.2333, "angle": 20.27 }, - { "time": 0.4, "angle": 15.27 }, - { "time": 0.6, "angle": -24.69 }, - { "time": 0.7666, "angle": -11.02 }, - { "time": 0.9333, "angle": -24.38 }, - { "time": 1.0666, "angle": 11.99 }, - { "time": 1.3, "angle": 4.86 }, - { "time": 1.3666, "angle": 5.19 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left shoulder": { - "rotate": [ - { - "time": 0, - "angle": 0.05, - "curve": [ 0, 0, 0.62, 1 ] - }, - { - "time": 0.2333, - "angle": 279.66, - "curve": [ 0.218, 0.67, 0.66, 0.99 ] - }, - { - "time": 0.5, - "angle": 62.27, - "curve": [ 0.462, 0, 0.764, 0.58 ] - }, - { "time": 0.9333, "angle": 28.91 }, - { "time": 1.0666, "angle": -8.62 }, - { "time": 1.1666, "angle": -18.43 }, - { "time": 1.3666, "angle": 0.05 } - ], - "translate": [ - { "time": 0, "x": -1.76, "y": 0.56, "curve": "stepped" }, - { "time": 0.9333, "x": -1.76, "y": 0.56, "curve": "stepped" }, - { "time": 1.3666, "x": -1.76, "y": 0.56 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left hand": { - "rotate": [ - { "time": 0, "angle": 11.58, "curve": "stepped" }, - { "time": 0.9333, "angle": 11.58, "curve": "stepped" }, - { "time": 1.3666, "angle": 11.58 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left arm": { - "rotate": [ - { "time": 0, "angle": 0.51 }, - { "time": 0.4333, "angle": 12.82 }, - { "time": 0.6, "angle": 47.55 }, - { "time": 0.9333, "angle": 12.82 }, - { "time": 1.1666, "angle": -6.5 }, - { "time": 1.3666, "angle": 0.51 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right shoulder": { - "rotate": [ - { - "time": 0, - "angle": 43.82, - "curve": [ 0, 0, 0.62, 1 ] - }, - { - "time": 0.2333, - "angle": -8.74, - "curve": [ 0.304, 0.58, 0.709, 0.97 ] - }, - { - "time": 0.5333, - "angle": -208.02, - "curve": [ 0.462, 0, 0.764, 0.58 ] - }, - { "time": 0.9333, "angle": -246.72 }, - { "time": 1.0666, "angle": -307.13 }, - { "time": 1.1666, "angle": 37.15 }, - { "time": 1.3666, "angle": 43.82 } - ], - "translate": [ - { "time": 0, "x": -7.84, "y": 7.19, "curve": "stepped" }, - { "time": 0.9333, "x": -7.84, "y": 7.19, "curve": "stepped" }, - { "time": 1.3666, "x": -7.84, "y": 7.19 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right arm": { - "rotate": [ - { "time": 0, "angle": -4.02 }, - { "time": 0.6, "angle": 17.5 }, - { "time": 0.9333, "angle": -4.02 }, - { "time": 1.1666, "angle": -16.72 }, - { "time": 1.3666, "angle": -4.02 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right hand": { - "rotate": [ - { "time": 0, "angle": 22.92, "curve": "stepped" }, - { "time": 0.9333, "angle": 22.92, "curve": "stepped" }, - { "time": 1.3666, "angle": 22.92 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "root": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.4333, "angle": -14.52 }, - { "time": 0.8, "angle": 9.86 }, - { "time": 1.3666, "angle": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - } - } - } -} -} diff --git a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/spineboy.png b/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/spineboy.png deleted file mode 100755 index ab85747..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 12 - Spine/data/spineboy.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 12 - Spine/index.html b/tutorial-2/pixi.js-master/examples/example 12 - Spine/index.html deleted file mode 100755 index 514267d..0000000 --- a/tutorial-2/pixi.js-master/examples/example 12 - Spine/index.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - pixi.js example 12 Spine - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 12 - Spine/index_dragon.html b/tutorial-2/pixi.js-master/examples/example 12 - Spine/index_dragon.html deleted file mode 100755 index a4f62d6..0000000 --- a/tutorial-2/pixi.js-master/examples/example 12 - Spine/index_dragon.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - pixi.js example 12 Spine - - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 12 - Spine/index_goblins.html b/tutorial-2/pixi.js-master/examples/example 12 - Spine/index_goblins.html deleted file mode 100755 index 245e9a0..0000000 --- a/tutorial-2/pixi.js-master/examples/example 12 - Spine/index_goblins.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - pixi.js example 12 Spine - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 12 - Spine/index_pixie.html b/tutorial-2/pixi.js-master/examples/example 12 - Spine/index_pixie.html deleted file mode 100755 index 59d0b36..0000000 --- a/tutorial-2/pixi.js-master/examples/example 12 - Spine/index_pixie.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - pixi.js example 12 Spine - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 13 - Graphics/index.html b/tutorial-2/pixi.js-master/examples/example 13 - Graphics/index.html deleted file mode 100755 index 1164b62..0000000 --- a/tutorial-2/pixi.js-master/examples/example 13 - Graphics/index.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - pixi.js example 13 - Graphics - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 13 - Graphics/indexLineTest.html b/tutorial-2/pixi.js-master/examples/example 13 - Graphics/indexLineTest.html deleted file mode 100755 index 2856845..0000000 --- a/tutorial-2/pixi.js-master/examples/example 13 - Graphics/indexLineTest.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - pixi.js example 13 - Graphics - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_01.png b/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_01.png deleted file mode 100755 index 8687366..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_01.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_02.png b/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_02.png deleted file mode 100755 index a140876..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_02.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_03.png b/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_03.png deleted file mode 100755 index 82532c7..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_03.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_04.png b/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_04.png deleted file mode 100755 index 9c790c3..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_04.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_05.png b/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_05.png deleted file mode 100755 index ebb28c8..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_05.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_06.png b/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_06.png deleted file mode 100755 index 1dec5c8..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_06.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_07.png b/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_07.png deleted file mode 100755 index e14a021..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_07.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_08.png b/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_08.png deleted file mode 100755 index 0197fef..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 13 - Graphics/spinObj_08.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 14 - Masking/BGrotate.jpg b/tutorial-2/pixi.js-master/examples/example 14 - Masking/BGrotate.jpg deleted file mode 100755 index f33f7d4..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 14 - Masking/BGrotate.jpg and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 14 - Masking/Copy of index.html b/tutorial-2/pixi.js-master/examples/example 14 - Masking/Copy of index.html deleted file mode 100755 index ef90f62..0000000 --- a/tutorial-2/pixi.js-master/examples/example 14 - Masking/Copy of index.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - pixi.js example 14 - Masking - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 14 - Masking/LightRotate1.png b/tutorial-2/pixi.js-master/examples/example 14 - Masking/LightRotate1.png deleted file mode 100755 index 44966cf..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 14 - Masking/LightRotate1.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 14 - Masking/LightRotate2.png b/tutorial-2/pixi.js-master/examples/example 14 - Masking/LightRotate2.png deleted file mode 100755 index a6e63c0..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 14 - Masking/LightRotate2.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 14 - Masking/SceneRotate.jpg b/tutorial-2/pixi.js-master/examples/example 14 - Masking/SceneRotate.jpg deleted file mode 100755 index 26fe78b..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 14 - Masking/SceneRotate.jpg and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 14 - Masking/index double mask.html b/tutorial-2/pixi.js-master/examples/example 14 - Masking/index double mask.html deleted file mode 100755 index 5751e7b..0000000 --- a/tutorial-2/pixi.js-master/examples/example 14 - Masking/index double mask.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - pixi.js example 14 - Masking - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 14 - Masking/index nested masks.html b/tutorial-2/pixi.js-master/examples/example 14 - Masking/index nested masks.html deleted file mode 100755 index 7113762..0000000 --- a/tutorial-2/pixi.js-master/examples/example 14 - Masking/index nested masks.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - pixi.js example 14 - Masking - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 14 - Masking/index.html b/tutorial-2/pixi.js-master/examples/example 14 - Masking/index.html deleted file mode 100755 index d786ce1..0000000 --- a/tutorial-2/pixi.js-master/examples/example 14 - Masking/index.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - pixi.js example 14 - Masking - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 14 - Masking/panda.png b/tutorial-2/pixi.js-master/examples/example 14 - Masking/panda.png deleted file mode 100755 index 215a4a9..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 14 - Masking/panda.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 15 - Filters/BGrotate.jpg b/tutorial-2/pixi.js-master/examples/example 15 - Filters/BGrotate.jpg deleted file mode 100755 index f33f7d4..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 15 - Filters/BGrotate.jpg and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 15 - Filters/LightRotate1.png b/tutorial-2/pixi.js-master/examples/example 15 - Filters/LightRotate1.png deleted file mode 100755 index 44966cf..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 15 - Filters/LightRotate1.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 15 - Filters/LightRotate2.png b/tutorial-2/pixi.js-master/examples/example 15 - Filters/LightRotate2.png deleted file mode 100755 index a6e63c0..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 15 - Filters/LightRotate2.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 15 - Filters/SceneRotate.jpg b/tutorial-2/pixi.js-master/examples/example 15 - Filters/SceneRotate.jpg deleted file mode 100755 index 26fe78b..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 15 - Filters/SceneRotate.jpg and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 15 - Filters/dat.gui.min.js b/tutorial-2/pixi.js-master/examples/example 15 - Filters/dat.gui.min.js deleted file mode 100755 index 17e4a3c..0000000 --- a/tutorial-2/pixi.js-master/examples/example 15 - Filters/dat.gui.min.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ -var dat=dat||{};dat.gui=dat.gui||{};dat.utils=dat.utils||{};dat.controllers=dat.controllers||{};dat.dom=dat.dom||{};dat.color=dat.color||{};dat.utils.css=function(){return{load:function(e,a){var a=a||document,c=a.createElement("link");c.type="text/css";c.rel="stylesheet";c.href=e;a.getElementsByTagName("head")[0].appendChild(c)},inject:function(e,a){var a=a||document,c=document.createElement("style");c.type="text/css";c.innerHTML=e;a.getElementsByTagName("head")[0].appendChild(c)}}}(); -dat.utils.common=function(){var e=Array.prototype.forEach,a=Array.prototype.slice;return{BREAK:{},extend:function(c){this.each(a.call(arguments,1),function(a){for(var f in a)this.isUndefined(a[f])||(c[f]=a[f])},this);return c},defaults:function(c){this.each(a.call(arguments,1),function(a){for(var f in a)this.isUndefined(c[f])&&(c[f]=a[f])},this);return c},compose:function(){var c=a.call(arguments);return function(){for(var d=a.call(arguments),f=c.length-1;f>=0;f--)d=[c[f].apply(this,d)];return d[0]}}, -each:function(a,d,f){if(e&&a.forEach===e)a.forEach(d,f);else if(a.length===a.length+0)for(var b=0,n=a.length;b-1?d.length-d.indexOf(".")-1:0};c.superclass=e;a.extend(c.prototype,e.prototype,{setValue:function(a){if(this.__min!==void 0&&athis.__max)a=this.__max;this.__step!==void 0&&a%this.__step!=0&&(a=Math.round(a/this.__step)*this.__step);return c.superclass.prototype.setValue.call(this,a)},min:function(a){this.__min=a;return this},max:function(a){this.__max=a;return this},step:function(a){this.__step=a;return this}});return c}(dat.controllers.Controller,dat.utils.common); -dat.controllers.NumberControllerBox=function(e,a,c){var d=function(f,b,e){function h(){var a=parseFloat(l.__input.value);c.isNaN(a)||l.setValue(a)}function j(a){var b=o-a.clientY;l.setValue(l.getValue()+b*l.__impliedStep);o=a.clientY}function m(){a.unbind(window,"mousemove",j);a.unbind(window,"mouseup",m)}this.__truncationSuspended=false;d.superclass.call(this,f,b,e);var l=this,o;this.__input=document.createElement("input");this.__input.setAttribute("type","text");a.bind(this.__input,"change",h); -a.bind(this.__input,"blur",function(){h();l.__onFinishChange&&l.__onFinishChange.call(l,l.getValue())});a.bind(this.__input,"mousedown",function(b){a.bind(window,"mousemove",j);a.bind(window,"mouseup",m);o=b.clientY});a.bind(this.__input,"keydown",function(a){if(a.keyCode===13)l.__truncationSuspended=true,this.blur(),l.__truncationSuspended=false});this.updateDisplay();this.domElement.appendChild(this.__input)};d.superclass=e;c.extend(d.prototype,e.prototype,{updateDisplay:function(){var a=this.__input, -b;if(this.__truncationSuspended)b=this.getValue();else{b=this.getValue();var c=Math.pow(10,this.__precision);b=Math.round(b*c)/c}a.value=b;return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.NumberController,dat.dom.dom,dat.utils.common); -dat.controllers.NumberControllerSlider=function(e,a,c,d,f){var b=function(d,c,f,e,l){function o(b){b.preventDefault();var d=a.getOffset(g.__background),c=a.getWidth(g.__background);g.setValue(g.__min+(g.__max-g.__min)*((b.clientX-d.left)/(d.left+c-d.left)));return false}function y(){a.unbind(window,"mousemove",o);a.unbind(window,"mouseup",y);g.__onFinishChange&&g.__onFinishChange.call(g,g.getValue())}b.superclass.call(this,d,c,{min:f,max:e,step:l});var g=this;this.__background=document.createElement("div"); -this.__foreground=document.createElement("div");a.bind(this.__background,"mousedown",function(b){a.bind(window,"mousemove",o);a.bind(window,"mouseup",y);o(b)});a.addClass(this.__background,"slider");a.addClass(this.__foreground,"slider-fg");this.updateDisplay();this.__background.appendChild(this.__foreground);this.domElement.appendChild(this.__background)};b.superclass=e;b.useDefaultStyles=function(){c.inject(f)};d.extend(b.prototype,e.prototype,{updateDisplay:function(){this.__foreground.style.width= -(this.getValue()-this.__min)/(this.__max-this.__min)*100+"%";return b.superclass.prototype.updateDisplay.call(this)}});return b}(dat.controllers.NumberController,dat.dom.dom,dat.utils.css,dat.utils.common,".slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}"); -dat.controllers.FunctionController=function(e,a,c){var d=function(c,b,e){d.superclass.call(this,c,b);var h=this;this.__button=document.createElement("div");this.__button.innerHTML=e===void 0?"Fire":e;a.bind(this.__button,"click",function(a){a.preventDefault();h.fire();return false});a.addClass(this.__button,"button");this.domElement.appendChild(this.__button)};d.superclass=e;c.extend(d.prototype,e.prototype,{fire:function(){this.__onChange&&this.__onChange.call(this);this.__onFinishChange&&this.__onFinishChange.call(this, -this.getValue());this.getValue().call(this.object)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common); -dat.controllers.BooleanController=function(e,a,c){var d=function(c,b){d.superclass.call(this,c,b);var e=this;this.__prev=this.getValue();this.__checkbox=document.createElement("input");this.__checkbox.setAttribute("type","checkbox");a.bind(this.__checkbox,"change",function(){e.setValue(!e.__prev)},false);this.domElement.appendChild(this.__checkbox);this.updateDisplay()};d.superclass=e;c.extend(d.prototype,e.prototype,{setValue:function(a){a=d.superclass.prototype.setValue.call(this,a);this.__onFinishChange&& -this.__onFinishChange.call(this,this.getValue());this.__prev=this.getValue();return a},updateDisplay:function(){this.getValue()===true?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=true):this.__checkbox.checked=false;return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common); -dat.color.toString=function(e){return function(a){if(a.a==1||e.isUndefined(a.a)){for(a=a.hex.toString(16);a.length<6;)a="0"+a;return"#"+a}else return"rgba("+Math.round(a.r)+","+Math.round(a.g)+","+Math.round(a.b)+","+a.a+")"}}(dat.utils.common); -dat.color.interpret=function(e,a){var c,d,f=[{litmus:a.isString,conversions:{THREE_CHAR_HEX:{read:function(a){a=a.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return a===null?false:{space:"HEX",hex:parseInt("0x"+a[1].toString()+a[1].toString()+a[2].toString()+a[2].toString()+a[3].toString()+a[3].toString())}},write:e},SIX_CHAR_HEX:{read:function(a){a=a.match(/^#([A-F0-9]{6})$/i);return a===null?false:{space:"HEX",hex:parseInt("0x"+a[1].toString())}},write:e},CSS_RGB:{read:function(a){a=a.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/); -return a===null?false:{space:"RGB",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3])}},write:e},CSS_RGBA:{read:function(a){a=a.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);return a===null?false:{space:"RGB",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3]),a:parseFloat(a[4])}},write:e}}},{litmus:a.isNumber,conversions:{HEX:{read:function(a){return{space:"HEX",hex:a,conversionName:"HEX"}},write:function(a){return a.hex}}}},{litmus:a.isArray,conversions:{RGB_ARRAY:{read:function(a){return a.length!= -3?false:{space:"RGB",r:a[0],g:a[1],b:a[2]}},write:function(a){return[a.r,a.g,a.b]}},RGBA_ARRAY:{read:function(a){return a.length!=4?false:{space:"RGB",r:a[0],g:a[1],b:a[2],a:a[3]}},write:function(a){return[a.r,a.g,a.b,a.a]}}}},{litmus:a.isObject,conversions:{RGBA_OBJ:{read:function(b){return a.isNumber(b.r)&&a.isNumber(b.g)&&a.isNumber(b.b)&&a.isNumber(b.a)?{space:"RGB",r:b.r,g:b.g,b:b.b,a:b.a}:false},write:function(a){return{r:a.r,g:a.g,b:a.b,a:a.a}}},RGB_OBJ:{read:function(b){return a.isNumber(b.r)&& -a.isNumber(b.g)&&a.isNumber(b.b)?{space:"RGB",r:b.r,g:b.g,b:b.b}:false},write:function(a){return{r:a.r,g:a.g,b:a.b}}},HSVA_OBJ:{read:function(b){return a.isNumber(b.h)&&a.isNumber(b.s)&&a.isNumber(b.v)&&a.isNumber(b.a)?{space:"HSV",h:b.h,s:b.s,v:b.v,a:b.a}:false},write:function(a){return{h:a.h,s:a.s,v:a.v,a:a.a}}},HSV_OBJ:{read:function(b){return a.isNumber(b.h)&&a.isNumber(b.s)&&a.isNumber(b.v)?{space:"HSV",h:b.h,s:b.s,v:b.v}:false},write:function(a){return{h:a.h,s:a.s,v:a.v}}}}}];return function(){d= -false;var b=arguments.length>1?a.toArray(arguments):arguments[0];a.each(f,function(e){if(e.litmus(b))return a.each(e.conversions,function(e,f){c=e.read(b);if(d===false&&c!==false)return d=c,c.conversionName=f,c.conversion=e,a.BREAK}),a.BREAK});return d}}(dat.color.toString,dat.utils.common); -dat.GUI=dat.gui.GUI=function(e,a,c,d,f,b,n,h,j,m,l,o,y,g,i){function q(a,b,r,c){if(b[r]===void 0)throw Error("Object "+b+' has no property "'+r+'"');c.color?b=new l(b,r):(b=[b,r].concat(c.factoryArgs),b=d.apply(a,b));if(c.before instanceof f)c.before=c.before.__li;t(a,b);g.addClass(b.domElement,"c");r=document.createElement("span");g.addClass(r,"property-name");r.innerHTML=b.property;var e=document.createElement("div");e.appendChild(r);e.appendChild(b.domElement);c=s(a,e,c.before);g.addClass(c,k.CLASS_CONTROLLER_ROW); -g.addClass(c,typeof b.getValue());p(a,c,b);a.__controllers.push(b);return b}function s(a,b,d){var c=document.createElement("li");b&&c.appendChild(b);d?a.__ul.insertBefore(c,params.before):a.__ul.appendChild(c);a.onResize();return c}function p(a,d,c){c.__li=d;c.__gui=a;i.extend(c,{options:function(b){if(arguments.length>1)return c.remove(),q(a,c.object,c.property,{before:c.__li.nextElementSibling,factoryArgs:[i.toArray(arguments)]});if(i.isArray(b)||i.isObject(b))return c.remove(),q(a,c.object,c.property, -{before:c.__li.nextElementSibling,factoryArgs:[b]})},name:function(a){c.__li.firstElementChild.firstElementChild.innerHTML=a;return c},listen:function(){c.__gui.listen(c);return c},remove:function(){c.__gui.remove(c);return c}});if(c instanceof j){var e=new h(c.object,c.property,{min:c.__min,max:c.__max,step:c.__step});i.each(["updateDisplay","onChange","onFinishChange"],function(a){var b=c[a],H=e[a];c[a]=e[a]=function(){var a=Array.prototype.slice.call(arguments);b.apply(c,a);return H.apply(e,a)}}); -g.addClass(d,"has-slider");c.domElement.insertBefore(e.domElement,c.domElement.firstElementChild)}else if(c instanceof h){var f=function(b){return i.isNumber(c.__min)&&i.isNumber(c.__max)?(c.remove(),q(a,c.object,c.property,{before:c.__li.nextElementSibling,factoryArgs:[c.__min,c.__max,c.__step]})):b};c.min=i.compose(f,c.min);c.max=i.compose(f,c.max)}else if(c instanceof b)g.bind(d,"click",function(){g.fakeEvent(c.__checkbox,"click")}),g.bind(c.__checkbox,"click",function(a){a.stopPropagation()}); -else if(c instanceof n)g.bind(d,"click",function(){g.fakeEvent(c.__button,"click")}),g.bind(d,"mouseover",function(){g.addClass(c.__button,"hover")}),g.bind(d,"mouseout",function(){g.removeClass(c.__button,"hover")});else if(c instanceof l)g.addClass(d,"color"),c.updateDisplay=i.compose(function(a){d.style.borderLeftColor=c.__color.toString();return a},c.updateDisplay),c.updateDisplay();c.setValue=i.compose(function(b){a.getRoot().__preset_select&&c.isModified()&&B(a.getRoot(),true);return b},c.setValue)} -function t(a,b){var c=a.getRoot(),d=c.__rememberedObjects.indexOf(b.object);if(d!=-1){var e=c.__rememberedObjectIndecesToControllers[d];e===void 0&&(e={},c.__rememberedObjectIndecesToControllers[d]=e);e[b.property]=b;if(c.load&&c.load.remembered){c=c.load.remembered;if(c[a.preset])c=c[a.preset];else if(c[w])c=c[w];else return;if(c[d]&&c[d][b.property]!==void 0)d=c[d][b.property],b.initialValue=d,b.setValue(d)}}}function I(a){var b=a.__save_row=document.createElement("li");g.addClass(a.domElement, -"has-save");a.__ul.insertBefore(b,a.__ul.firstChild);g.addClass(b,"save-row");var c=document.createElement("span");c.innerHTML=" ";g.addClass(c,"button gears");var d=document.createElement("span");d.innerHTML="Save";g.addClass(d,"button");g.addClass(d,"save");var e=document.createElement("span");e.innerHTML="New";g.addClass(e,"button");g.addClass(e,"save-as");var f=document.createElement("span");f.innerHTML="Revert";g.addClass(f,"button");g.addClass(f,"revert");var m=a.__preset_select=document.createElement("select"); -a.load&&a.load.remembered?i.each(a.load.remembered,function(b,c){C(a,c,c==a.preset)}):C(a,w,false);g.bind(m,"change",function(){for(var b=0;b0){a.preset=this.preset;if(!a.remembered)a.remembered={};a.remembered[this.preset]=z(this)}a.folders={};i.each(this.__folders,function(b, -c){a.folders[c]=b.getSaveObject()});return a},save:function(){if(!this.load.remembered)this.load.remembered={};this.load.remembered[this.preset]=z(this);B(this,false)},saveAs:function(a){if(!this.load.remembered)this.load.remembered={},this.load.remembered[w]=z(this,true);this.load.remembered[a]=z(this);this.preset=a;C(this,a,true)},revert:function(a){i.each(this.__controllers,function(b){this.getRoot().load.remembered?t(a||this.getRoot(),b):b.setValue(b.initialValue)},this);i.each(this.__folders, -function(a){a.revert(a)});a||B(this.getRoot(),false)},listen:function(a){var b=this.__listening.length==0;this.__listening.push(a);b&&E(this.__listening)}});return k}(dat.utils.css,'
    \n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n
    \n\n Automatically save\n values to localStorage on exit.\n\n
    The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n \n
    \n \n
    \n\n
    ', -".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear;border:0;position:absolute;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-x:hidden}.dg.a.has-save ul{margin-top:27px}.dg.a.has-save ul.closed{margin-top:0}.dg.a .save-row{position:fixed;top:0;z-index:1002}.dg li{-webkit-transition:height 0.1s ease-out;-o-transition:height 0.1s ease-out;-moz-transition:height 0.1s ease-out;transition:height 0.1s ease-out}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;overflow:hidden;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li > *{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:9px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n", -dat.controllers.factory=function(e,a,c,d,f,b,n){return function(h,j,m,l){var o=h[j];if(n.isArray(m)||n.isObject(m))return new e(h,j,m);if(n.isNumber(o))return n.isNumber(m)&&n.isNumber(l)?new c(h,j,m,l):new a(h,j,{min:m,max:l});if(n.isString(o))return new d(h,j);if(n.isFunction(o))return new f(h,j,"");if(n.isBoolean(o))return new b(h,j)}}(dat.controllers.OptionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.StringController=function(e,a,c){var d= -function(c,b){function e(){h.setValue(h.__input.value)}d.superclass.call(this,c,b);var h=this;this.__input=document.createElement("input");this.__input.setAttribute("type","text");a.bind(this.__input,"keyup",e);a.bind(this.__input,"change",e);a.bind(this.__input,"blur",function(){h.__onFinishChange&&h.__onFinishChange.call(h,h.getValue())});a.bind(this.__input,"keydown",function(a){a.keyCode===13&&this.blur()});this.updateDisplay();this.domElement.appendChild(this.__input)};d.superclass=e;c.extend(d.prototype, -e.prototype,{updateDisplay:function(){if(!a.isActive(this.__input))this.__input.value=this.getValue();return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common),dat.controllers.FunctionController,dat.controllers.BooleanController,dat.utils.common),dat.controllers.Controller,dat.controllers.BooleanController,dat.controllers.FunctionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.OptionController, -dat.controllers.ColorController=function(e,a,c,d,f){function b(a,b,c,d){a.style.background="";f.each(j,function(e){a.style.cssText+="background: "+e+"linear-gradient("+b+", "+c+" 0%, "+d+" 100%); "})}function n(a){a.style.background="";a.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);";a.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"; -a.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);";a.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);";a.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}var h=function(e,l){function o(b){q(b);a.bind(window,"mousemove",q);a.bind(window, -"mouseup",j)}function j(){a.unbind(window,"mousemove",q);a.unbind(window,"mouseup",j)}function g(){var a=d(this.value);a!==false?(p.__color.__state=a,p.setValue(p.__color.toOriginal())):this.value=p.__color.toString()}function i(){a.unbind(window,"mousemove",s);a.unbind(window,"mouseup",i)}function q(b){b.preventDefault();var c=a.getWidth(p.__saturation_field),d=a.getOffset(p.__saturation_field),e=(b.clientX-d.left+document.body.scrollLeft)/c,b=1-(b.clientY-d.top+document.body.scrollTop)/c;b>1?b= -1:b<0&&(b=0);e>1?e=1:e<0&&(e=0);p.__color.v=b;p.__color.s=e;p.setValue(p.__color.toOriginal());return false}function s(b){b.preventDefault();var c=a.getHeight(p.__hue_field),d=a.getOffset(p.__hue_field),b=1-(b.clientY-d.top+document.body.scrollTop)/c;b>1?b=1:b<0&&(b=0);p.__color.h=b*360;p.setValue(p.__color.toOriginal());return false}h.superclass.call(this,e,l);this.__color=new c(this.getValue());this.__temp=new c(0);var p=this;this.domElement=document.createElement("div");a.makeSelectable(this.domElement, -false);this.__selector=document.createElement("div");this.__selector.className="selector";this.__saturation_field=document.createElement("div");this.__saturation_field.className="saturation-field";this.__field_knob=document.createElement("div");this.__field_knob.className="field-knob";this.__field_knob_border="2px solid ";this.__hue_knob=document.createElement("div");this.__hue_knob.className="hue-knob";this.__hue_field=document.createElement("div");this.__hue_field.className="hue-field";this.__input= -document.createElement("input");this.__input.type="text";this.__input_textShadow="0 1px 1px ";a.bind(this.__input,"keydown",function(a){a.keyCode===13&&g.call(this)});a.bind(this.__input,"blur",g);a.bind(this.__selector,"mousedown",function(){a.addClass(this,"drag").bind(window,"mouseup",function(){a.removeClass(p.__selector,"drag")})});var t=document.createElement("div");f.extend(this.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}); -f.extend(this.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:this.__field_knob_border+(this.__color.v<0.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1});f.extend(this.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1});f.extend(this.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"});f.extend(t.style, -{width:"100%",height:"100%",background:"none"});b(t,"top","rgba(0,0,0,0)","#000");f.extend(this.__hue_field.style,{width:"15px",height:"100px",display:"inline-block",border:"1px solid #555",cursor:"ns-resize"});n(this.__hue_field);f.extend(this.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:this.__input_textShadow+"rgba(0,0,0,0.7)"});a.bind(this.__saturation_field,"mousedown",o);a.bind(this.__field_knob,"mousedown",o);a.bind(this.__hue_field,"mousedown", -function(b){s(b);a.bind(window,"mousemove",s);a.bind(window,"mouseup",i)});this.__saturation_field.appendChild(t);this.__selector.appendChild(this.__field_knob);this.__selector.appendChild(this.__saturation_field);this.__selector.appendChild(this.__hue_field);this.__hue_field.appendChild(this.__hue_knob);this.domElement.appendChild(this.__input);this.domElement.appendChild(this.__selector);this.updateDisplay()};h.superclass=e;f.extend(h.prototype,e.prototype,{updateDisplay:function(){var a=d(this.getValue()); -if(a!==false){var e=false;f.each(c.COMPONENTS,function(b){if(!f.isUndefined(a[b])&&!f.isUndefined(this.__color.__state[b])&&a[b]!==this.__color.__state[b])return e=true,{}},this);e&&f.extend(this.__color.__state,a)}f.extend(this.__temp.__state,this.__color.__state);this.__temp.a=1;var h=this.__color.v<0.5||this.__color.s>0.5?255:0,j=255-h;f.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toString(),border:this.__field_knob_border+ -"rgb("+h+","+h+","+h+")"});this.__hue_knob.style.marginTop=(1-this.__color.h/360)*100+"px";this.__temp.s=1;this.__temp.v=1;b(this.__saturation_field,"left","#fff",this.__temp.toString());f.extend(this.__input.style,{backgroundColor:this.__input.value=this.__color.toString(),color:"rgb("+h+","+h+","+h+")",textShadow:this.__input_textShadow+"rgba("+j+","+j+","+j+",.7)"})}});var j=["-moz-","-o-","-webkit-","-ms-",""];return h}(dat.controllers.Controller,dat.dom.dom,dat.color.Color=function(e,a,c,d){function f(a, -b,c){Object.defineProperty(a,b,{get:function(){if(this.__state.space==="RGB")return this.__state[b];n(this,b,c);return this.__state[b]},set:function(a){if(this.__state.space!=="RGB")n(this,b,c),this.__state.space="RGB";this.__state[b]=a}})}function b(a,b){Object.defineProperty(a,b,{get:function(){if(this.__state.space==="HSV")return this.__state[b];h(this);return this.__state[b]},set:function(a){if(this.__state.space!=="HSV")h(this),this.__state.space="HSV";this.__state[b]=a}})}function n(b,c,e){if(b.__state.space=== -"HEX")b.__state[c]=a.component_from_hex(b.__state.hex,e);else if(b.__state.space==="HSV")d.extend(b.__state,a.hsv_to_rgb(b.__state.h,b.__state.s,b.__state.v));else throw"Corrupted color state";}function h(b){var c=a.rgb_to_hsv(b.r,b.g,b.b);d.extend(b.__state,{s:c.s,v:c.v});if(d.isNaN(c.h)){if(d.isUndefined(b.__state.h))b.__state.h=0}else b.__state.h=c.h}var j=function(){this.__state=e.apply(this,arguments);if(this.__state===false)throw"Failed to interpret color arguments";this.__state.a=this.__state.a|| -1};j.COMPONENTS="r,g,b,h,s,v,hex,a".split(",");d.extend(j.prototype,{toString:function(){return c(this)},toOriginal:function(){return this.__state.conversion.write(this)}});f(j.prototype,"r",2);f(j.prototype,"g",1);f(j.prototype,"b",0);b(j.prototype,"h");b(j.prototype,"s");b(j.prototype,"v");Object.defineProperty(j.prototype,"a",{get:function(){return this.__state.a},set:function(a){this.__state.a=a}});Object.defineProperty(j.prototype,"hex",{get:function(){if(!this.__state.space!=="HEX")this.__state.hex= -a.rgb_to_hex(this.r,this.g,this.b);return this.__state.hex},set:function(a){this.__state.space="HEX";this.__state.hex=a}});return j}(dat.color.interpret,dat.color.math=function(){var e;return{hsv_to_rgb:function(a,c,d){var e=a/60-Math.floor(a/60),b=d*(1-c),n=d*(1-e*c),c=d*(1-(1-e)*c),a=[[d,c,b],[n,d,b],[b,d,c],[b,n,d],[c,b,d],[d,b,n]][Math.floor(a/60)%6];return{r:a[0]*255,g:a[1]*255,b:a[2]*255}},rgb_to_hsv:function(a,c,d){var e=Math.min(a,c,d),b=Math.max(a,c,d),e=b-e;if(b==0)return{h:NaN,s:0,v:0}; -a=a==b?(c-d)/e:c==b?2+(d-a)/e:4+(a-c)/e;a/=6;a<0&&(a+=1);return{h:a*360,s:e/b,v:b/255}},rgb_to_hex:function(a,c,d){a=this.hex_with_component(0,2,a);a=this.hex_with_component(a,1,c);return a=this.hex_with_component(a,0,d)},component_from_hex:function(a,c){return a>>c*8&255},hex_with_component:function(a,c,d){return d<<(e=c*8)|a&~(255< - - - pixi.js example 15 - Filters - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 15 - Filters/indexAll.html b/tutorial-2/pixi.js-master/examples/example 15 - Filters/indexAll.html deleted file mode 100755 index 4e83cb8..0000000 --- a/tutorial-2/pixi.js-master/examples/example 15 - Filters/indexAll.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - pixi.js example 15 - Filters - - - - - - - - - -
    - - - - - -
    - - - diff --git a/tutorial-2/pixi.js-master/examples/example 15 - Filters/indexBlur.html b/tutorial-2/pixi.js-master/examples/example 15 - Filters/indexBlur.html deleted file mode 100755 index dc899dc..0000000 --- a/tutorial-2/pixi.js-master/examples/example 15 - Filters/indexBlur.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - pixi.js example 15 - Filters - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 15 - Filters/indexDisplacement.html b/tutorial-2/pixi.js-master/examples/example 15 - Filters/indexDisplacement.html deleted file mode 100755 index 23f7f96..0000000 --- a/tutorial-2/pixi.js-master/examples/example 15 - Filters/indexDisplacement.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - pixi.js example 15 - Filters - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 15 - Filters/indexDisplacement_2.html b/tutorial-2/pixi.js-master/examples/example 15 - Filters/indexDisplacement_2.html deleted file mode 100755 index 8cda5d9..0000000 --- a/tutorial-2/pixi.js-master/examples/example 15 - Filters/indexDisplacement_2.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - pixi.js example 15 - Filters - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 15 - Filters/panda.png b/tutorial-2/pixi.js-master/examples/example 15 - Filters/panda.png deleted file mode 100755 index 215a4a9..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 15 - Filters/panda.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 15 - Filters/zeldaWaves.png b/tutorial-2/pixi.js-master/examples/example 15 - Filters/zeldaWaves.png deleted file mode 100755 index 01552c0..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 15 - Filters/zeldaWaves.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 16 - BlendModes/BGrotate.jpg b/tutorial-2/pixi.js-master/examples/example 16 - BlendModes/BGrotate.jpg deleted file mode 100755 index eab4d57..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 16 - BlendModes/BGrotate.jpg and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 16 - BlendModes/flowerTop.png b/tutorial-2/pixi.js-master/examples/example 16 - BlendModes/flowerTop.png deleted file mode 100755 index 041cf2a..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 16 - BlendModes/flowerTop.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 16 - BlendModes/index.html b/tutorial-2/pixi.js-master/examples/example 16 - BlendModes/index.html deleted file mode 100755 index 5bb21a8..0000000 --- a/tutorial-2/pixi.js-master/examples/example 16 - BlendModes/index.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - Pixi.js Blend Modes - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 17 - Tinting/BGrotate.jpg b/tutorial-2/pixi.js-master/examples/example 17 - Tinting/BGrotate.jpg deleted file mode 100755 index eab4d57..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 17 - Tinting/BGrotate.jpg and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 17 - Tinting/eggHead.png b/tutorial-2/pixi.js-master/examples/example 17 - Tinting/eggHead.png deleted file mode 100755 index f8bff53..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 17 - Tinting/eggHead.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 17 - Tinting/index.html b/tutorial-2/pixi.js-master/examples/example 17 - Tinting/index.html deleted file mode 100755 index f051fd1..0000000 --- a/tutorial-2/pixi.js-master/examples/example 17 - Tinting/index.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - Tinting - - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 18 - Batch/click.png b/tutorial-2/pixi.js-master/examples/example 18 - Batch/click.png deleted file mode 100755 index b796e52..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 18 - Batch/click.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 18 - Batch/index.html b/tutorial-2/pixi.js-master/examples/example 18 - Batch/index.html deleted file mode 100755 index ce7c542..0000000 --- a/tutorial-2/pixi.js-master/examples/example 18 - Batch/index.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - Sprite Batch - - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 18 - Batch/logo_small.png b/tutorial-2/pixi.js-master/examples/example 18 - Batch/logo_small.png deleted file mode 100755 index 3a63544..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 18 - Batch/logo_small.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 18 - Batch/tinyMaggot.png b/tutorial-2/pixi.js-master/examples/example 18 - Batch/tinyMaggot.png deleted file mode 100755 index c0b1c00..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 18 - Batch/tinyMaggot.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.json b/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.json deleted file mode 100755 index 7dddba8..0000000 --- a/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.json +++ /dev/null @@ -1,44 +0,0 @@ -{"frames": { - -"eggHead.png": -{ - "frame": {"x":2,"y":169,"w":142,"h":157}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":142,"h":157}, - "sourceSize": {"w":142,"h":157} -}, -"flowerTop.png": -{ - "frame": {"x":2,"y":328,"w":119,"h":181}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":119,"h":181}, - "sourceSize": {"w":119,"h":181} -}, -"helmlok.png": -{ - "frame": {"x":123,"y":328,"w":123,"h":177}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":123,"h":177}, - "sourceSize": {"w":123,"h":177} -}, -"skully.png": -{ - "frame": {"x":2,"y":2,"w":155,"h":165}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":155,"h":165}, - "sourceSize": {"w":155,"h":165} -}}, -"meta": { - "app": "http://www.texturepacker.com", - "version": "1.0", - "image": "SpriteSheet.png", - "format": "RGBA8888", - "size": {"w":256,"h":512}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:9e3e5afd01ea8e418afabfbdcd724485$" -} -} diff --git a/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.png b/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.png deleted file mode 100755 index 210acb1..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/index.html b/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/index.html deleted file mode 100755 index ca82cdc..0000000 --- a/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/index.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - pixi.js example 2 loading a sprite sheet - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/SpriteSheet.tps b/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/SpriteSheet.tps deleted file mode 100755 index c81ef28..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/SpriteSheet.tps and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/eggHead.png b/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/eggHead.png deleted file mode 100755 index f8bff53..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/eggHead.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/flowerTop.png b/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/flowerTop.png deleted file mode 100755 index 041cf2a..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/flowerTop.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/helmlok.png b/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/helmlok.png deleted file mode 100755 index c6b96c0..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/helmlok.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/skully.png b/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/skully.png deleted file mode 100755 index c21b40d..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/skully.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.json b/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.json deleted file mode 100755 index 7dddba8..0000000 --- a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.json +++ /dev/null @@ -1,44 +0,0 @@ -{"frames": { - -"eggHead.png": -{ - "frame": {"x":2,"y":169,"w":142,"h":157}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":142,"h":157}, - "sourceSize": {"w":142,"h":157} -}, -"flowerTop.png": -{ - "frame": {"x":2,"y":328,"w":119,"h":181}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":119,"h":181}, - "sourceSize": {"w":119,"h":181} -}, -"helmlok.png": -{ - "frame": {"x":123,"y":328,"w":123,"h":177}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":123,"h":177}, - "sourceSize": {"w":123,"h":177} -}, -"skully.png": -{ - "frame": {"x":2,"y":2,"w":155,"h":165}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":155,"h":165}, - "sourceSize": {"w":155,"h":165} -}}, -"meta": { - "app": "http://www.texturepacker.com", - "version": "1.0", - "image": "SpriteSheet.png", - "format": "RGBA8888", - "size": {"w":256,"h":512}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:9e3e5afd01ea8e418afabfbdcd724485$" -} -} diff --git a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.png b/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.png deleted file mode 100755 index 210acb1..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/fighter.json b/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/fighter.json deleted file mode 100755 index e20b4a6..0000000 --- a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/fighter.json +++ /dev/null @@ -1,252 +0,0 @@ -{"frames": { - -"rollSequence0000.png": -{ - "frame": {"x":483,"y":692,"w":169,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":4,"w":169,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0001.png": -{ - "frame": {"x":468,"y":2,"w":169,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":4,"w":169,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0002.png": -{ - "frame": {"x":639,"y":2,"w":167,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":5,"w":167,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0003.png": -{ - "frame": {"x":808,"y":2,"w":165,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":5,"w":165,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0004.png": -{ - "frame": {"x":654,"y":688,"w":161,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":5,"w":161,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0005.png": -{ - "frame": {"x":817,"y":458,"w":151,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":6,"y":5,"w":151,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0006.png": -{ - "frame": {"x":817,"y":686,"w":137,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":11,"y":5,"w":137,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0007.png": -{ - "frame": {"x":290,"y":2,"w":113,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":22,"y":3,"w":113,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0008.png": -{ - "frame": {"x":284,"y":692,"w":79,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":40,"y":3,"w":79,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0009.png": -{ - "frame": {"x":405,"y":2,"w":61,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":53,"y":3,"w":61,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0010.png": -{ - "frame": {"x":444,"y":462,"w":49,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":64,"y":3,"w":49,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0011.png": -{ - "frame": {"x":377,"y":462,"w":65,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":52,"y":3,"w":65,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0012.png": -{ - "frame": {"x":272,"y":462,"w":103,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":37,"y":3,"w":103,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0013.png": -{ - "frame": {"x":143,"y":692,"w":139,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":3,"w":139,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0014.png": -{ - "frame": {"x":2,"y":462,"w":163,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":7,"y":3,"w":163,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0015.png": -{ - "frame": {"x":2,"y":2,"w":171,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":2,"y":3,"w":171,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0016.png": -{ - "frame": {"x":2,"y":232,"w":163,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":4,"y":3,"w":163,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0017.png": -{ - "frame": {"x":2,"y":692,"w":139,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":16,"y":3,"w":139,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0018.png": -{ - "frame": {"x":167,"y":462,"w":103,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":35,"y":3,"w":103,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0019.png": -{ - "frame": {"x":365,"y":692,"w":65,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":58,"y":3,"w":65,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0020.png": -{ - "frame": {"x":432,"y":692,"w":49,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":62,"y":3,"w":49,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0021.png": -{ - "frame": {"x":389,"y":232,"w":61,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":61,"y":3,"w":61,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0022.png": -{ - "frame": {"x":306,"y":232,"w":81,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":55,"y":3,"w":81,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0023.png": -{ - "frame": {"x":175,"y":2,"w":113,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":39,"y":3,"w":113,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0024.png": -{ - "frame": {"x":167,"y":232,"w":137,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":26,"y":3,"w":137,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0025.png": -{ - "frame": {"x":664,"y":458,"w":151,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":5,"w":151,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0026.png": -{ - "frame": {"x":792,"y":230,"w":161,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":11,"y":5,"w":161,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0027.png": -{ - "frame": {"x":623,"y":230,"w":167,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":6,"y":5,"w":167,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0028.png": -{ - "frame": {"x":495,"y":460,"w":167,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":5,"y":5,"w":167,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0029.png": -{ - "frame": {"x":452,"y":232,"w":169,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":4,"w":169,"h":226}, - "sourceSize": {"w":175,"h":240} -}}, -"meta": { - "app": "http://www.texturepacker.com", - "version": "1.0", - "image": "fighter.png", - "format": "RGBA8888", - "size": {"w":1024,"h":1024}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:2f213a6b451f9f5719773418dfe80ae8$" -} -} diff --git a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/fighter.png b/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/fighter.png deleted file mode 100755 index 5395f7b..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/fighter.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/index.html b/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/index.html deleted file mode 100755 index ecd4b55..0000000 --- a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/index.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - pixi.js example 2 loading a sprite sheet - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/indexTrim.html b/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/indexTrim.html deleted file mode 100755 index 4682c4e..0000000 --- a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/indexTrim.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - pixi.js example 2 loading a sprite sheet - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/tp/SpriteSheet.tps b/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/tp/SpriteSheet.tps deleted file mode 100755 index c81ef28..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/tp/SpriteSheet.tps and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/tp/eggHead.png b/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/tp/eggHead.png deleted file mode 100755 index f8bff53..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/tp/eggHead.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/tp/flowerTop.png b/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/tp/flowerTop.png deleted file mode 100755 index 041cf2a..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/tp/flowerTop.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/tp/helmlok.png b/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/tp/helmlok.png deleted file mode 100755 index c6b96c0..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/tp/helmlok.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/tp/skully.png b/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/tp/skully.png deleted file mode 100755 index c21b40d..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 2 - SpriteSheet/tp/skully.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 20 - Strip/index.html b/tutorial-2/pixi.js-master/examples/example 20 - Strip/index.html deleted file mode 100755 index 95cd621..0000000 --- a/tutorial-2/pixi.js-master/examples/example 20 - Strip/index.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - pixi.js example 20 - strip - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 20 - Strip/snake.png b/tutorial-2/pixi.js-master/examples/example 20 - Strip/snake.png deleted file mode 100755 index 0cb81d4..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 20 - Strip/snake.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 21 - Complex Graphics/index.html b/tutorial-2/pixi.js-master/examples/example 21 - Complex Graphics/index.html deleted file mode 100755 index 2424e38..0000000 --- a/tutorial-2/pixi.js-master/examples/example 21 - Complex Graphics/index.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - pixi.js example 21 Complex Graphics - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 22 - Complex Masking/eggHead.png b/tutorial-2/pixi.js-master/examples/example 22 - Complex Masking/eggHead.png deleted file mode 100755 index f8bff53..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 22 - Complex Masking/eggHead.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 22 - Complex Masking/flowerTop.png b/tutorial-2/pixi.js-master/examples/example 22 - Complex Masking/flowerTop.png deleted file mode 100755 index 041cf2a..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 22 - Complex Masking/flowerTop.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 22 - Complex Masking/helmlok.png b/tutorial-2/pixi.js-master/examples/example 22 - Complex Masking/helmlok.png deleted file mode 100755 index c6b96c0..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 22 - Complex Masking/helmlok.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 22 - Complex Masking/index.html b/tutorial-2/pixi.js-master/examples/example 22 - Complex Masking/index.html deleted file mode 100755 index db7d0a5..0000000 --- a/tutorial-2/pixi.js-master/examples/example 22 - Complex Masking/index.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - pixi.js example 22 complex masking - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 22 - Complex Masking/skully.png b/tutorial-2/pixi.js-master/examples/example 22 - Complex Masking/skully.png deleted file mode 100755 index c21b40d..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 22 - Complex Masking/skully.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 23 - Texture Swap/eggHead.png b/tutorial-2/pixi.js-master/examples/example 23 - Texture Swap/eggHead.png deleted file mode 100755 index f8bff53..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 23 - Texture Swap/eggHead.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 23 - Texture Swap/flowerTop.png b/tutorial-2/pixi.js-master/examples/example 23 - Texture Swap/flowerTop.png deleted file mode 100755 index 041cf2a..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 23 - Texture Swap/flowerTop.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 23 - Texture Swap/index.html b/tutorial-2/pixi.js-master/examples/example 23 - Texture Swap/index.html deleted file mode 100755 index 21feded..0000000 --- a/tutorial-2/pixi.js-master/examples/example 23 - Texture Swap/index.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - pixi.js example 23 - Texture Swap - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 24 - Box2D Integration/box2d.min.js b/tutorial-2/pixi.js-master/examples/example 24 - Box2D Integration/box2d.min.js deleted file mode 100755 index 1b579fd..0000000 --- a/tutorial-2/pixi.js-master/examples/example 24 - Box2D Integration/box2d.min.js +++ /dev/null @@ -1,112 +0,0 @@ -var b2Settings=function(){};b2Settings.prototype={};b2Settings.USHRT_MAX=65535;b2Settings.b2_pi=Math.PI;b2Settings.b2_massUnitsPerKilogram=1;b2Settings.b2_timeUnitsPerSecond=1;b2Settings.b2_lengthUnitsPerMeter=30;b2Settings.b2_maxManifoldPoints=2;b2Settings.b2_maxShapesPerBody=64;b2Settings.b2_maxPolyVertices=8;b2Settings.b2_maxProxies=1024;b2Settings.b2_maxPairs=8*b2Settings.b2_maxProxies;b2Settings.b2_linearSlop=0.005*b2Settings.b2_lengthUnitsPerMeter;b2Settings.b2_angularSlop=2/180*b2Settings.b2_pi;b2Settings.b2_velocityThreshold=1*b2Settings.b2_lengthUnitsPerMeter/b2Settings.b2_timeUnitsPerSecond;b2Settings.b2_maxLinearCorrection=0.2*b2Settings.b2_lengthUnitsPerMeter;b2Settings.b2_maxAngularCorrection=8/180*b2Settings.b2_pi;b2Settings.b2_contactBaumgarte=0.2;b2Settings.b2_timeToSleep=0.5*b2Settings.b2_timeUnitsPerSecond;b2Settings.b2_linearSleepTolerance=0.01*b2Settings.b2_lengthUnitsPerMeter/b2Settings.b2_timeUnitsPerSecond;b2Settings.b2_angularSleepTolerance=2/180/b2Settings.b2_timeUnitsPerSecond; -b2Settings.b2Assert=function(b){if(!b){var c;c.x++}};Object.extend=function(a,c){for(var b in c){a[b]=c[b]}return a};var b2Vec2=function(a,b){this.x=a;this.y=b};b2Vec2.prototype={SetZero:function(){this.x=0;this.y=0},Set:function(a,b){this.x=a;this.y=b},SetV:function(a){this.x=a.x;this.y=a.y},Negative:function(){return new b2Vec2(-this.x,-this.y)},Copy:function(){return new b2Vec2(this.x,this.y)},Add:function(a){this.x+=a.x;this.y+=a.y},Subtract:function(a){this.x-=a.x;this.y-=a.y},Multiply:function(b){this.x*=b;this.y*=b},MulM:function(b){var a=this.x;this.x=b.col1.x*a+b.col2.x*this.y;this.y=b.col1.y*a+b.col2.y*this.y},MulTM:function(b){var a=b2Math.b2Dot(this,b.col1);this.y=b2Math.b2Dot(this,b.col2);this.x=a},CrossVF:function(b){var a=this.x;this.x=b*this.y;this.y=-b*a},CrossFV:function(b){var a=this.x;this.x=-b*this.y;this.y=b*a},MinV:function(a){this.x=this.xa.x?this.x:a.x;this.y=this.y>a.y?this.y:a.y},Abs:function(){this.x=Math.abs(this.x);this.y=Math.abs(this.y)},Length:function(){return Math.sqrt(this.x*this.x+this.y*this.y) -},Normalize:function(){var b=this.Length();if(b0?b:-b};b2Math.b2AbsV=function(d){var c=new b2Vec2(b2Math.b2Abs(d.x),b2Math.b2Abs(d.y));return c};b2Math.b2AbsM=function(a){var b=new b2Mat22(0,b2Math.b2AbsV(a.col1),b2Math.b2AbsV(a.col2));return b};b2Math.b2Min=function(d,c){return dc?d:c};b2Math.b2MaxV=function(e,d){var f=new b2Vec2(b2Math.b2Max(e.x,d.x),b2Math.b2Max(e.y,d.y));return f};b2Math.b2Clamp=function(c,b,d){return b2Math.b2Max(b,b2Math.b2Min(c,d))};b2Math.b2ClampV=function(c,b,d){return b2Math.b2MaxV(b,b2Math.b2MinV(c,d))};b2Math.b2Swap=function(d,c){var e=d[0];d[0]=c[0];c[0]=e};b2Math.b2Random=function(){return Math.random()*2-1};b2Math.b2NextPowerOfTwo=function(a){a|=(a>>1)&2147483647;a|=(a>>2)&1073741823;a|=(a>>4)&268435455;a|=(a>>8)&16777215; -a|=(a>>16)&65535;return a+1};b2Math.b2IsPowerOfTwo=function(b){var a=b>0&&(b&(b-1))==0;return a};b2Math.tempVec2=new b2Vec2();b2Math.tempVec3=new b2Vec2();b2Math.tempVec4=new b2Vec2();b2Math.tempVec5=new b2Vec2();b2Math.tempMat=new b2Mat22();var b2AABB=function(){this.minVertex=new b2Vec2();this.maxVertex=new b2Vec2()};b2AABB.prototype={IsValid:function(){var b=this.maxVertex.x;var a=this.maxVertex.y;b=this.maxVertex.x;a=this.maxVertex.y;b-=this.minVertex.x;a-=this.minVertex.y;var c=b>=0&&a>=0;c=c&&this.minVertex.IsValid()&&this.maxVertex.IsValid();return c},minVertex:new b2Vec2(),maxVertex:new b2Vec2()};var b2Bound=function(){};b2Bound.prototype={IsLower:function(){return(this.value&1)==0},IsUpper:function(){return(this.value&1)==1},Swap:function(c){var e=this.value;var d=this.proxyId;var a=this.stabbingCount;this.value=c.value;this.proxyId=c.proxyId;this.stabbingCount=c.stabbingCount;c.value=e;c.proxyId=d;c.stabbingCount=a},value:0,proxyId:0,stabbingCount:0};var b2BoundValues=function(){this.lowerValues=[0,0];this.upperValues=[0,0]};b2BoundValues.prototype={lowerValues:[0,0],upperValues:[0,0]};var b2Pair=function(){};b2Pair.prototype={SetBuffered:function(){this.status|=b2Pair.e_pairBuffered},ClearBuffered:function(){this.status&=~b2Pair.e_pairBuffered},IsBuffered:function(){return(this.status&b2Pair.e_pairBuffered)==b2Pair.e_pairBuffered},SetRemoved:function(){this.status|=b2Pair.e_pairRemoved},ClearRemoved:function(){this.status&=~b2Pair.e_pairRemoved},IsRemoved:function(){return(this.status&b2Pair.e_pairRemoved)==b2Pair.e_pairRemoved},SetFinal:function(){this.status|=b2Pair.e_pairFinal},IsFinal:function(){return(this.status&b2Pair.e_pairFinal)==b2Pair.e_pairFinal},userData:null,proxyId1:0,proxyId2:0,next:0,status:0};b2Pair.b2_nullPair=b2Settings.USHRT_MAX;b2Pair.b2_nullProxy=b2Settings.USHRT_MAX;b2Pair.b2_tableCapacity=b2Settings.b2_maxPairs;b2Pair.b2_tableMask=b2Pair.b2_tableCapacity-1;b2Pair.e_pairBuffered=1;b2Pair.e_pairRemoved=2;b2Pair.e_pairFinal=4;var b2PairCallback=function(){};b2PairCallback.prototype={PairAdded:function(b,a){return null},PairRemoved:function(c,b,a){}};var b2BufferedPair=function(){};b2BufferedPair.prototype={proxyId1:0,proxyId2:0};var b2PairManager=function(){var a=0;this.m_hashTable=new Array(b2Pair.b2_tableCapacity);for(a=0;aa){var c=b;b=a;a=c}var d=b2PairManager.Hash(b,a)&b2Pair.b2_tableMask;var f=f=this.FindHash(b,a,d);if(f!=null){return f}var e=this.m_freePair;f=this.m_pairs[e];this.m_freePair=f.next;f.proxyId1=b;f.proxyId2=a;f.status=0;f.userData=null;f.next=this.m_hashTable[d];this.m_hashTable[d]=e;++this.m_pairCount;return f},RemovePair:function(g,f){if(g>f){var i=g;g=f;f=i}var d=b2PairManager.Hash(g,f)&b2Pair.b2_tableMask;var b=this.m_hashTable[d];var h=null;while(b!=b2Pair.b2_nullPair){if(b2PairManager.Equals(this.m_pairs[b],g,f)){var e=b;if(h){h.next=this.m_pairs[b].next}else{this.m_hashTable[d]=this.m_pairs[b].next}var c=this.m_pairs[e];var a=c.userData;c.next=this.m_freePair;c.proxyId1=b2Pair.b2_nullProxy;c.proxyId2=b2Pair.b2_nullProxy;c.userData=null;c.status=0;this.m_freePair=e;--this.m_pairCount;return a}else{h=this.m_pairs[b];b=h.next}}return null},Find:function(b,a){if(b>a){var c=b;b=a;a=c -}var d=b2PairManager.Hash(b,a)&b2Pair.b2_tableMask;return this.FindHash(b,a,d)},FindHash:function(b,a,d){var c=this.m_hashTable[d];while(c!=b2Pair.b2_nullPair&&b2PairManager.Equals(this.m_pairs[c],b,a)==false){c=this.m_pairs[c].next}if(c==b2Pair.b2_nullPair){return null}return this.m_pairs[c]},ValidateBuffer:function(){},ValidateTable:function(){},m_broadPhase:null,m_callback:null,m_pairs:null,m_freePair:0,m_pairCount:0,m_pairBuffer:null,m_pairBufferCount:0,m_hashTable:null};b2PairManager.Hash=function(b,a){var c=((a<<16)&4294901760)|b;c=~c+((c<<15)&4294934528);c=c^((c>>12)&1048575);c=c+((c<<2)&4294967292);c=c^((c>>4)&268435455);c=c*2057;c=c^((c>>16)&65535);return c};b2PairManager.Equals=function(c,b,a){return(c.proxyId1==b&&c.proxyId2==a)};b2PairManager.EqualsPair=function(b,a){return b.proxyId1==a.proxyId1&&b.proxyId2==a.proxyId2};var b2BroadPhase=function(f,g){this.m_pairManager=new b2PairManager();this.m_proxyPool=new Array(b2Settings.b2_maxPairs);this.m_bounds=new Array(2*b2Settings.b2_maxProxies);this.m_queryResults=new Array(b2Settings.b2_maxProxies);this.m_quantizationFactor=new b2Vec2();var d=0;this.m_pairManager.Initialize(this,g);this.m_worldAABB=f;this.m_proxyCount=0;for(d=0;d0&&t0){g=m;while(g0){g=k;while(g0&&bb[c.upperBounds[a]].value){return false}if(b[d.upperBounds[a]].valued[e.upperBounds[c]].value){return false}if(a.upperValues[c]0){var g=c-1;var n=a[g].stabbingCount;while(n){if(a[g].IsLower()){var k=this.m_proxyPool[a[g].proxyId];if(c<=k.upperBounds[b]){this.IncrementOverlapCount(a[g].proxyId);--n}}--g}}h[0]=c;d[0]=l},IncrementOverlapCount:function(b){var a=this.m_proxyPool[b];if(a.timeStampf){e=b-1}else{if(d[b].value0){f[c].id=b[0].id}else{f[c].id=b[1].id}++c}return c};b2Collision.EdgeSeparation=function(p,q,o){var f=p.m_vertices;var g=o.m_vertexCount;var r=o.m_vertices;var e=p.m_normals[q].x;var d=p.m_normals[q].y;var s=e;var l=p.m_R;e=l.col1.x*s+l.col2.x*d;d=l.col1.y*s+l.col2.y*d;var v=e;var u=d;l=o.m_R;s=v*l.col1.x+u*l.col1.y;u=v*l.col2.x+u*l.col2.y;v=s;var n=0;var m=Number.MAX_VALUE;for(var w=0;wa){a=o;h=p}}var n=b2Collision.EdgeSeparation(m,h,l);if(n>0&&w==false){return n}var g=h-1>=0?h-1:j-1;var t=b2Collision.EdgeSeparation(m,g,l);if(t>0&&w==false){return t}var q=h+10&&w==false){return u}var b=0;var k;var v=0;if(t>n&&t>u){v=-1;b=g;k=t}else{if(u>n){v=1;b=q;k=u}else{r[0]=h;return n}}while(true){if(v==-1){h=b-1>=0?b-1:j-1}else{h=b+10&&w==false){return n}if(n>k){b=h;k=n}else{break}}r[0]=b;return k};b2Collision.FindIncidentEdge=function(D,p,q,n){var h=p.m_vertexCount;var f=p.m_vertices;var g=n.m_vertexCount;var s=n.m_vertices;var a=q; -var F=q+1==h?0:q+1;var e=f[F];var C=e.x;var A=e.y;e=f[a];C-=e.x;A-=e.y;var v=C;C=A;A=-v;var E=1/Math.sqrt(C*C+A*A);C*=E;A*=E;var r=C;var o=A;v=r;var l=p.m_R;r=l.col1.x*v+l.col2.x*o;o=l.col1.y*v+l.col2.y*o;var d=r;var b=o;l=n.m_R;v=d*l.col1.x+b*l.col1.y;b=d*l.col2.x+b*l.col2.y;d=v;var k=0;var j=0;var m=Number.MAX_VALUE;for(var B=0;B0&&b==false){return -}var K=0;var g=[K];var E=b2Collision.FindMaxSeparation(g,j,k,b);K=g[0];if(E>0&&b==false){return}var p;var o;var a=0;var R=0;var d=0.98;var O=0.001;if(E>d*F+O){p=j;o=k;a=K;R=1}else{p=k;o=j;a=M;R=0}var c=[new ClipVertex(),new ClipVertex()];b2Collision.FindIncidentEdge(c,p,a,o);var B=p.m_vertexCount;var q=p.m_vertices;var I=q[a];var H=a+1l*l&&b==false){return}var d;if(mg){return}if(t>o){o=t;B=A}}if(og){return}x.pointCount=1;x.normal.Set(n.col1.x*e+n.col2.x*d,n.col1.y*e+n.col2.y*d);h=x.points[0];h.id.features.incidentEdge=b2Collision.b2_nullFeature;h.id.features.incidentVertex=b;h.id.features.referenceFace=b2Collision.b2_nullFeature;h.id.features.flip=0;h.position.x=k.m_position.x-g*x.normal.x;h.position.y=k.m_position.y-g*x.normal.y;h.separation=w-g;return}var q=(z-m.m_vertices[b].x)*r+(y-m.m_vertices[b].y)*p;h=x.points[0];h.id.features.incidentEdge=b2Collision.b2_nullFeature;h.id.features.incidentVertex=b2Collision.b2_nullFeature;h.id.features.referenceFace=b2Collision.b2_nullFeature;h.id.features.flip=0;var l,j;if(q<=0){l=m.m_vertices[b].x;j=m.m_vertices[b].y;h.id.features.incidentVertex=b}else{if(q>=f){l=m.m_vertices[a].x;j=m.m_vertices[a].y;h.id.features.incidentVertex=a}else{l=r*q+m.m_vertices[b].x;j=p*q+m.m_vertices[b].y;h.id.features.incidentEdge=b}}e=z-l;d=y-j;w=Math.sqrt(e*e+d*d);e/=w;d/=w;if(w>g){return}x.pointCount=1;x.normal.Set(n.col1.x*e+n.col2.x*d,n.col1.y*e+n.col2.y*d); -h.position.x=k.m_position.x-g*x.normal.x;h.position.y=k.m_position.y-g*x.normal.y;h.separation=w-g};b2Collision.b2TestOverlap=function(d,c){var i=c.minVertex;var g=d.maxVertex;var f=i.x-g.x;var e=i.y-g.y;i=d.minVertex;g=c.maxVertex;var j=i.x-g.x;var h=i.y-g.y;if(f>0||e>0){return false}if(j>0||h>0){return false}return true};var Features=function(){};Features.prototype={set_referenceFace:function(a){this._referenceFace=a;this._m_id._key=(this._m_id._key&4294967040)|(this._referenceFace&255)},get_referenceFace:function(){return this._referenceFace},_referenceFace:0,set_incidentEdge:function(a){this._incidentEdge=a;this._m_id._key=(this._m_id._key&4294902015)|((this._incidentEdge<<8)&65280)},get_incidentEdge:function(){return this._incidentEdge},_incidentEdge:0,set_incidentVertex:function(a){this._incidentVertex=a;this._m_id._key=(this._m_id._key&4278255615)|((this._incidentVertex<<16)&16711680)},get_incidentVertex:function(){return this._incidentVertex},_incidentVertex:0,set_flip:function(a){this._flip=a;this._m_id._key=(this._m_id._key&16777215)|((this._flip<<24)&4278190080)},get_flip:function(){return this._flip},_flip:0,_m_id:null};var b2ContactID=function(){this.features=new Features();this.features._m_id=this};b2ContactID.prototype={Set:function(a){this.set_key(a._key)},Copy:function(){var a=new b2ContactID();a.set_key(this._key);return a},get_key:function(){return this._key},set_key:function(a){this._key=a;this.features._referenceFace=this._key&255;this.features._incidentEdge=((this._key&65280)>>8)&255;this.features._incidentVertex=((this._key&16711680)>>16)&255;this.features._flip=((this._key&4278190080)>>24)&255},features:new Features(),_key:0};var b2ContactPoint=function(){this.position=new b2Vec2();this.id=new b2ContactID()};b2ContactPoint.prototype={position:new b2Vec2(),separation:null,normalImpulse:null,tangentImpulse:null,id:new b2ContactID()};var b2Distance=function(){};b2Distance.prototype={};b2Distance.ProcessTwo=function(j,h,b,k,i){var f=-i[1].x;var e=-i[1].y;var d=i[0].x-i[1].x;var c=i[0].y-i[1].y;var a=Math.sqrt(d*d+c*c);d/=a;c/=a;var g=f*d+e*c;if(g<=0||a=0&&F>=0){var B=x/(x+F);q.x=m[1].x+B*(m[2].x-m[1].x);q.y=m[1].y+B*(m[2].y-m[1].y);D.x=C[1].x+B*(C[2].x-C[1].x); -D.y=C[1].y+B*(C[2].y-C[1].y);m[0].SetV(m[2]);C[0].SetV(C[2]);G[0].SetV(G[2]);return 2}var f=E*(J*h-I*k);if(f<=0&&j>=0&&o>=0){var B=j/(j+o);q.x=m[0].x+B*(m[2].x-m[0].x);q.y=m[0].y+B*(m[2].y-m[0].y);D.x=C[0].x+B*(C[2].x-C[0].x);D.y=C[0].y+B*(C[2].y-C[0].y);m[1].SetV(m[2]);C[1].SetV(C[2]);G[1].SetV(G[2]);return 2}var d=g+f+e;d=1/d;var A=g*d;var t=f*d;var p=1-A-t;q.x=A*m[0].x+t*m[1].x+p*m[2].x;q.y=A*m[0].y+t*m[1].y+p*m[2].y;D.x=A*C[0].x+t*C[1].x+p*C[2].x;D.y=A*C[0].y+t*C[1].y+p*C[2].y;return 3};b2Distance.InPoinsts=function(a,c,d){for(var b=0;bNumber.MIN_VALUE){D*=1/d;C*=1/d}this.m_coreVertices[w].x=this.m_vertices[w].x-2*b2Settings.b2_linearSlop*D;this.m_coreVertices[w].y=this.m_vertices[w].y-2*b2Settings.b2_linearSlop*C}}var y=Number.MAX_VALUE;var x=Number.MAX_VALUE;var m=-Number.MAX_VALUE;var l=-Number.MAX_VALUE;this.m_maxRadius=0;for(w=0;w0){return false}}return true},syncAABB:new b2AABB(),syncMat:new b2Mat22(),Synchronize:function(c,e,a,b){this.m_R.SetM(b); -this.m_position.x=this.m_body.m_position.x+(b.col1.x*this.m_localCentroid.x+b.col2.x*this.m_localCentroid.y);this.m_position.y=this.m_body.m_position.y+(b.col1.y*this.m_localCentroid.x+b.col2.y*this.m_localCentroid.y);if(this.m_proxyId==b2Pair.b2_nullProxy){return}var m;var l;var k=e.col1;var j=e.col2;var i=this.m_localOBB.R.col1;var h=this.m_localOBB.R.col2;this.syncMat.col1.x=k.x*i.x+j.x*i.y;this.syncMat.col1.y=k.y*i.x+j.y*i.y;this.syncMat.col2.x=k.x*h.x+j.x*h.y;this.syncMat.col2.y=k.y*h.x+j.y*h.y;this.syncMat.Abs();m=this.m_localCentroid.x+this.m_localOBB.center.x;l=this.m_localCentroid.y+this.m_localOBB.center.y;var f=c.x+(e.col1.x*m+e.col2.x*l);var d=c.y+(e.col1.y*m+e.col2.y*l);m=this.syncMat.col1.x*this.m_localOBB.extents.x+this.syncMat.col2.x*this.m_localOBB.extents.y;l=this.syncMat.col1.y*this.m_localOBB.extents.x+this.syncMat.col2.y*this.m_localOBB.extents.y;this.syncAABB.minVertex.x=f-m;this.syncAABB.minVertex.y=d-l;this.syncAABB.maxVertex.x=f+m;this.syncAABB.maxVertex.y=d+l;k=b.col1; -j=b.col2;i=this.m_localOBB.R.col1;h=this.m_localOBB.R.col2;this.syncMat.col1.x=k.x*i.x+j.x*i.y;this.syncMat.col1.y=k.y*i.x+j.y*i.y;this.syncMat.col2.x=k.x*h.x+j.x*h.y;this.syncMat.col2.y=k.y*h.x+j.y*h.y;this.syncMat.Abs();m=this.m_localCentroid.x+this.m_localOBB.center.x;l=this.m_localCentroid.y+this.m_localOBB.center.y;f=a.x+(b.col1.x*m+b.col2.x*l);d=a.y+(b.col1.y*m+b.col2.y*l);m=this.syncMat.col1.x*this.m_localOBB.extents.x+this.syncMat.col2.x*this.m_localOBB.extents.y;l=this.syncMat.col1.y*this.m_localOBB.extents.x+this.syncMat.col2.y*this.m_localOBB.extents.y;this.syncAABB.minVertex.x=Math.min(this.syncAABB.minVertex.x,f-m);this.syncAABB.minVertex.y=Math.min(this.syncAABB.minVertex.y,d-l);this.syncAABB.maxVertex.x=Math.max(this.syncAABB.maxVertex.x,f+m);this.syncAABB.maxVertex.y=Math.max(this.syncAABB.maxVertex.y,d+l);var g=this.m_body.m_world.m_broadPhase;if(g.InRange(this.syncAABB)){g.MoveProxy(this.m_proxyId,this.syncAABB)}else{this.m_body.Freeze()}},QuickSync:function(a,b){this.m_R.SetM(b); -this.m_position.x=a.x+(b.col1.x*this.m_localCentroid.x+b.col2.x*this.m_localCentroid.y);this.m_position.y=a.y+(b.col1.y*this.m_localCentroid.x+b.col2.y*this.m_localCentroid.y)},ResetProxy:function(b){if(this.m_proxyId==b2Pair.b2_nullProxy){return}var e=b.GetProxy(this.m_proxyId);b.DestroyProxy(this.m_proxyId);e=null;var g=b2Math.b2MulMM(this.m_R,this.m_localOBB.R);var d=b2Math.b2AbsM(g);var f=b2Math.b2MulMV(d,this.m_localOBB.extents);var a=b2Math.b2MulMV(this.m_R,this.m_localOBB.center);a.Add(this.m_position);var c=new b2AABB();c.minVertex.SetV(a);c.minVertex.Subtract(f);c.maxVertex.SetV(a);c.maxVertex.Add(f);if(b.InRange(c)){this.m_proxyId=b.CreateProxy(c,this)}else{this.m_proxyId=b2Pair.b2_nullProxy}if(this.m_proxyId==b2Pair.b2_nullProxy){this.m_body.Freeze()}},Support:function(c,a,b){var g=(c*this.m_R.col1.x+a*this.m_R.col1.y);var f=(c*this.m_R.col2.x+a*this.m_R.col2.y);var e=0;var j=(this.m_coreVertices[0].x*g+this.m_coreVertices[0].y*f);for(var d=1;dj){e=d;j=h}}b.Set(this.m_position.x+(this.m_R.col1.x*this.m_coreVertices[e].x+this.m_R.col2.x*this.m_coreVertices[e].y),this.m_position.y+(this.m_R.col1.y*this.m_coreVertices[e].x+this.m_R.col2.y*this.m_coreVertices[e].y))},m_localCentroid:new b2Vec2(),m_localOBB:new b2OBB(),m_vertices:null,m_coreVertices:null,m_vertexCount:0,m_normals:null});b2PolyShape.tempVec=new b2Vec2();b2PolyShape.tAbsR=new b2Mat22();var b2Body=function(f,e){this.sMat0=new b2Mat22();this.m_position=new b2Vec2();this.m_R=new b2Mat22(0);this.m_position0=new b2Vec2();var c=0;var g;var a;this.m_flags=0;this.m_position.SetV(f.position);this.m_rotation=f.rotation;this.m_R.Set(this.m_rotation);this.m_position0.SetV(this.m_position);this.m_rotation0=this.m_rotation;this.m_world=e;this.m_linearDamping=b2Math.b2Clamp(1-f.linearDamping,0,1);this.m_angularDamping=b2Math.b2Clamp(1-f.angularDamping,0,1);this.m_force=new b2Vec2(0,0);this.m_torque=0;this.m_mass=0;var h=new Array(b2Settings.b2_maxShapesPerBody);for(c=0;c0){this.m_center.Multiply(1/this.m_mass);this.m_position.Add(b2Math.b2MulMV(this.m_R,this.m_center)) -}else{this.m_flags|=b2Body.e_staticFlag}this.m_I=0;for(c=0;c0){this.m_invMass=1/this.m_mass}else{this.m_invMass=0}if(this.m_I>0&&f.preventRotation==false){this.m_invI=1/this.m_I}else{this.m_I=0;this.m_invI=0}this.m_linearVelocity=b2Math.AddVV(f.linearVelocity,b2Math.b2CrossFV(f.angularVelocity,this.m_center));this.m_angularVelocity=f.angularVelocity;this.m_jointList=null;this.m_contactList=null;this.m_prev=null;this.m_next=null;this.m_shapeList=null;for(c=0;c0}var c=(b.m_maskBits&a.m_categoryBits)!=0&&(b.m_categoryBits&a.m_maskBits)!=0;return c}};b2CollisionFilter.b2_defaultFilter=new b2CollisionFilter;var b2Island=function(e,d,c,a){var b=0;this.m_bodyCapacity=e;this.m_contactCapacity=d;this.m_jointCapacity=c;this.m_bodyCount=0;this.m_contactCount=0;this.m_jointCount=0;this.m_bodies=new Array(e);for(b=0;bc||b2Math.b2Dot(a.m_linearVelocity,a.m_linearVelocity)>d){a.m_sleepTime=0;e=0}else{a.m_sleepTime+=g;e=b2Math.b2Min(e,a.m_sleepTime)}}if(e>=b2Settings.b2_timeToSleep){for(f=0;f0){a.m_shape1.m_body.WakeUp();a.m_shape2.m_body.WakeUp()}var d=a.m_shape1.m_type;var b=a.m_shape2.m_type;var e=b2Contact.s_registers[d][b].destroyFcn;e(a,c)};b2Contact.s_registers=null;b2Contact.s_initialized=false;var b2ContactConstraint=function(){this.normal=new b2Vec2();this.points=new Array(b2Settings.b2_maxManifoldPoints);for(var a=0;a0){b.velocityBias=-60*b.separation}var h=f+(-F*C)-u-(-G*Q);var g=d+(F*D)-s-(G*S);var P=V.normal.x*h+V.normal.y*g;if(P<-b2Settings.b2_velocityThreshold){b.velocityBias+=-V.restitution*P}}++L}}};b2ContactSolver.prototype={PreSolve:function(){var b;var A;var r;for(var w=0;w=-b2Settings.b2_linearSlop},PostSolve:function(){for(var d=0;d0){this.m_manifoldCount=1 -}else{this.m_manifoldCount=0}},GetManifolds:function(){return this.m_manifold},m_manifold:[new b2Manifold()]});b2CircleContact.Create=function(b,a,c){return new b2CircleContact(b,a)};b2CircleContact.Destroy=function(a,b){};var b2Conservative=function(){};b2Conservative.prototype={};b2Conservative.R1=new b2Mat22();b2Conservative.R2=new b2Mat22();b2Conservative.x1=new b2Vec2();b2Conservative.x2=new b2Vec2();b2Conservative.Conservative=function(k,j){var i=k.GetBody();var h=j.GetBody();var s=i.m_position.x-i.m_position0.x;var q=i.m_position.y-i.m_position0.y;var H=i.m_rotation-i.m_rotation0;var b=h.m_position.x-h.m_position0.x;var a=h.m_position.y-h.m_position0.y;var F=h.m_rotation-h.m_rotation0;var m=k.GetMaxRadius();var l=j.GetMaxRadius();var I=i.m_position0.x;var D=i.m_position0.y;var z=i.m_rotation0;var E=h.m_position0.x;var C=h.m_position0.y;var n=h.m_rotation0;var e=I;var c=D;var J=z;var B=E;var A=C;var G=n;b2Conservative.R1.Set(J);b2Conservative.R2.Set(G);k.QuickSync(p1,b2Conservative.R1);j.QuickSync(p2,b2Conservative.R2);var L=0;var o=10;var u;var t;var y=0;var v=true;for(var w=0;wFLT_EPSILON){d*=b2_linearSlop/p}if(i.IsStatic()){i.m_position.x=e;i.m_position.y=c}else{i.m_position.x=e-u;i.m_position.y=c-t}i.m_rotation=J;i.m_R.Set(J);i.QuickSyncShapes();if(h.IsStatic()){h.m_position.x=B;h.m_position.y=A}else{h.m_position.x=B+u;h.m_position.y=A+t}h.m_position.x=B+u;h.m_position.y=A+t;h.m_rotation=G;h.m_R.Set(G);h.QuickSyncShapes();return true -}k.QuickSync(i.m_position,i.m_R);j.QuickSync(h.m_position,h.m_R);return false};var b2NullContact=function(b,a){this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!b||!a){this.m_shape1=null;this.m_shape2=null;return}this.m_shape1=b;this.m_shape2=a;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null};Object.extend(b2NullContact.prototype,b2Contact.prototype);Object.extend(b2NullContact.prototype,{Evaluate:function(){},GetManifolds:function(){return null}});var b2PolyAndCircleContact=function(b,a){this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!b||!a){this.m_shape1=null;this.m_shape2=null;return}this.m_shape1=b;this.m_shape2=a;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null;this.m_manifold=[new b2Manifold()];b2Settings.b2Assert(this.m_shape1.m_type==b2Shape.e_polyShape);b2Settings.b2Assert(this.m_shape2.m_type==b2Shape.e_circleShape);this.m_manifold[0].pointCount=0;this.m_manifold[0].points[0].normalImpulse=0;this.m_manifold[0].points[0].tangentImpulse=0};Object.extend(b2PolyAndCircleContact.prototype,b2Contact.prototype);Object.extend(b2PolyAndCircleContact.prototype,{Evaluate:function(){b2Collision.b2CollidePolyAndCircle(this.m_manifold[0],this.m_shape1,this.m_shape2,false); -if(this.m_manifold[0].pointCount>0){this.m_manifoldCount=1}else{this.m_manifoldCount=0}},GetManifolds:function(){return this.m_manifold},m_manifold:[new b2Manifold()]});b2PolyAndCircleContact.Create=function(b,a,c){return new b2PolyAndCircleContact(b,a)};b2PolyAndCircleContact.Destroy=function(a,b){};var b2PolyContact=function(b,a){this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!b||!a){this.m_shape1=null;this.m_shape2=null;return}this.m_shape1=b;this.m_shape2=a;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null;this.m0=new b2Manifold();this.m_manifold=[new b2Manifold()];this.m_manifold[0].pointCount=0};Object.extend(b2PolyContact.prototype,b2Contact.prototype);Object.extend(b2PolyContact.prototype,{m0:new b2Manifold(),Evaluate:function(){var a=this.m_manifold[0];var b=this.m0.points;for(var d=0;d0){var h=[false,false];for(var f=0;f0){var e=f.m_shape1.m_body;var d=f.m_shape2.m_body;var b=f.m_node1;var a=f.m_node2;e.WakeUp();d.WakeUp();if(b.prev){b.prev.next=b.next}if(b.next){b.next.prev=b.prev}if(b==e.m_contactList){e.m_contactList=b.next}b.prev=null;b.next=null;if(a.prev){a.prev.next=a.next}if(a.next){a.next.prev=a.prev}if(a==d.m_contactList){d.m_contactList=a.next}a.prev=null;a.next=null}b2Contact.Destroy(f,this.m_world.m_blockAllocator);--this.m_world.m_contactCount},CleanContactList:function(){var b=this.m_world.m_contactList;while(b!=null){var a=b;b=b.m_next;if(a.m_flags&b2Contact.e_destroyFlag){this.DestroyContact(a);a=null}}},Collide:function(){var f;var e;var d;var a;for(var h=this.m_world.m_contactList;h!=null;h=h.m_next){if(h.m_shape1.m_body.IsSleeping()&&h.m_shape2.m_body.IsSleeping()){continue -}var b=h.GetManifoldCount();h.Evaluate();var g=h.GetManifoldCount();if(b==0&&g>0){f=h.m_shape1.m_body;e=h.m_shape2.m_body;d=h.m_node1;a=h.m_node2;d.contact=h;d.other=e;d.prev=null;d.next=f.m_contactList;if(d.next!=null){d.next.prev=h.m_node1}f.m_contactList=h.m_node1;a.contact=h;a.other=f;a.prev=null;a.next=e.m_contactList;if(a.next!=null){a.next.prev=a}e.m_contactList=a}else{if(b>0&&g==0){f=h.m_shape1.m_body;e=h.m_shape2.m_body;d=h.m_node1;a=h.m_node2;if(d.prev){d.prev.next=d.next}if(d.next){d.next.prev=d.prev}if(d==f.m_contactList){f.m_contactList=d.next}d.prev=null;d.next=null;if(a.prev){a.prev.next=a.next}if(a.next){a.next.prev=a.prev}if(a==e.m_contactList){e.m_contactList=a.next}a.prev=null;a.next=null}}}},m_world:null,m_nullContact:new b2NullContact(),m_destroyImmediate:null});var b2World=function(a,d,c){this.step=new b2TimeStep();this.m_contactManager=new b2ContactManager();this.m_listener=null;this.m_filter=b2CollisionFilter.b2_defaultFilter;this.m_bodyList=null;this.m_contactList=null;this.m_jointList=null;this.m_bodyCount=0;this.m_contactCount=0;this.m_jointCount=0;this.m_bodyDestroyList=null;this.m_allowSleep=c;this.m_gravity=d;this.m_contactManager.m_world=this;this.m_broadPhase=new b2BroadPhase(a,this.m_contactManager);var b=new b2BodyDef();this.m_groundBody=this.CreateBody(b)};b2World.prototype={SetListener:function(a){this.m_listener=a},SetFilter:function(a){this.m_filter=a},CreateBody:function(c){var a=new b2Body(c,this);a.m_prev=null;a.m_next=this.m_bodyList;if(this.m_bodyList){this.m_bodyList.m_prev=a}this.m_bodyList=a;++this.m_bodyCount;return a},DestroyBody:function(a){if(a.m_flags&b2Body.e_destroyFlag){return}if(a.m_prev){a.m_prev.m_next=a.m_next}if(a.m_next){a.m_next.m_prev=a.m_prev}if(a==this.m_bodyList){this.m_bodyList=a.m_next}a.m_flags|=b2Body.e_destroyFlag; ---this.m_bodyCount;a.m_prev=null;a.m_next=this.m_bodyDestroyList;this.m_bodyDestroyList=a},CleanBodyList:function(){this.m_contactManager.m_destroyImmediate=true;var c=this.m_bodyDestroyList;while(c){var e=c;c=c.m_next;var d=e.m_jointList;while(d){var a=d;d=d.next;if(this.m_listener){this.m_listener.NotifyJointDestroyed(a.joint)}this.DestroyJoint(a.joint)}e.Destroy()}this.m_bodyDestroyList=null;this.m_contactManager.m_destroyImmediate=false},CreateJoint:function(e){var c=b2Joint.Create(e,this.m_blockAllocator);c.m_prev=null;c.m_next=this.m_jointList;if(this.m_jointList){this.m_jointList.m_prev=c}this.m_jointList=c;++this.m_jointCount;c.m_node1.joint=c;c.m_node1.other=c.m_body2;c.m_node1.prev=null;c.m_node1.next=c.m_body1.m_jointList;if(c.m_body1.m_jointList){c.m_body1.m_jointList.prev=c.m_node1}c.m_body1.m_jointList=c.m_node1;c.m_node2.joint=c;c.m_node2.other=c.m_body1;c.m_node2.prev=null;c.m_node2.next=c.m_body2.m_jointList;if(c.m_body2.m_jointList){c.m_body2.m_jointList.prev=c.m_node2 -}c.m_body2.m_jointList=c.m_node2;if(e.collideConnected==false){var a=e.body1.m_shapeCount0){this.step.inv_dt=1/a}else{this.step.inv_dt=0}this.m_positionIterationCount=0;this.m_contactManager.CleanContactList();this.CleanBodyList();this.m_contactManager.Collide();var n=new b2Island(this.m_bodyCount,this.m_contactCount,this.m_jointCount,this.m_stackAllocator);for(r=this.m_bodyList;r!=null;r=r.m_next){r.m_flags&=~b2Body.e_islandFlag}for(var p=this.m_contactList;p!=null;p=p.m_next){p.m_flags&=~b2Contact.e_islandFlag}for(var h=this.m_jointList;h!=null;h=h.m_next){h.m_islandFlag=false}var u=this.m_bodyCount;var q=new Array(this.m_bodyCount);for(var g=0;g0){r=q[--t];n.AddBody(r);r.m_flags&=~b2Body.e_sleepFlag; -if(r.m_flags&b2Body.e_staticFlag){continue}for(var s=r.m_contactList;s!=null;s=s.next){if(s.contact.m_flags&b2Contact.e_islandFlag){continue}n.AddContact(s.contact);s.contact.m_flags|=b2Contact.e_islandFlag;o=s.other;if(o.m_flags&b2Body.e_islandFlag){continue}q[t++]=o;o.m_flags|=b2Body.e_islandFlag}for(var f=r.m_jointList;f!=null;f=f.next){if(f.joint.m_islandFlag==true){continue}n.AddJoint(f.joint);f.joint.m_islandFlag=true;o=f.other;if(o.m_flags&b2Body.e_islandFlag){continue}q[t++]=o;o.m_flags|=b2Body.e_islandFlag}}n.Solve(this.step,this.m_gravity);this.m_positionIterationCount=b2Math.b2Max(this.m_positionIterationCount,b2Island.m_positionIterationCount);if(this.m_allowSleep){n.UpdateSleep(a)}for(var l=0;lb2Settings.b2_linearSlop){this.m_u.Multiply(1/a)}else{this.m_u.SetZero()}var h=(j*this.m_u.y-i*this.m_u.x);var d=(f*this.m_u.y-e*this.m_u.x);this.m_mass=this.m_body1.m_invMass+this.m_body1.m_invI*h*h+this.m_body2.m_invMass+this.m_body2.m_invI*d*d;this.m_mass=1/this.m_mass;if(b2World.s_enableWarmStarting){var c=this.m_impulse*this.m_u.x;var b=this.m_impulse*this.m_u.y;this.m_body1.m_linearVelocity.x-=this.m_body1.m_invMass*c;this.m_body1.m_linearVelocity.y-=this.m_body1.m_invMass*b;this.m_body1.m_angularVelocity-=this.m_body1.m_invI*(j*b-i*c); -this.m_body2.m_linearVelocity.x+=this.m_body2.m_invMass*c;this.m_body2.m_linearVelocity.y+=this.m_body2.m_invMass*b;this.m_body2.m_angularVelocity+=this.m_body2.m_invI*(f*b-e*c)}else{this.m_impulse=0}},SolveVelocityConstraints:function(b){var j;j=this.m_body1.m_R;var n=j.col1.x*this.m_localAnchor1.x+j.col2.x*this.m_localAnchor1.y;var m=j.col1.y*this.m_localAnchor1.x+j.col2.y*this.m_localAnchor1.y;j=this.m_body2.m_R;var h=j.col1.x*this.m_localAnchor2.x+j.col2.x*this.m_localAnchor2.y;var g=j.col1.y*this.m_localAnchor2.x+j.col2.y*this.m_localAnchor2.y;var l=this.m_body1.m_linearVelocity.x+(-this.m_body1.m_angularVelocity*m);var k=this.m_body1.m_linearVelocity.y+(this.m_body1.m_angularVelocity*n);var f=this.m_body2.m_linearVelocity.x+(-this.m_body2.m_angularVelocity*g);var e=this.m_body2.m_linearVelocity.y+(this.m_body2.m_angularVelocity*h);var i=(this.m_u.x*(f-l)+this.m_u.y*(e-k));var a=-this.m_mass*i;this.m_impulse+=a;var d=a*this.m_u.x;var c=a*this.m_u.y;this.m_body1.m_linearVelocity.x-=this.m_body1.m_invMass*d; -this.m_body1.m_linearVelocity.y-=this.m_body1.m_invMass*c;this.m_body1.m_angularVelocity-=this.m_body1.m_invI*(n*c-m*d);this.m_body2.m_linearVelocity.x+=this.m_body2.m_invMass*d;this.m_body2.m_linearVelocity.y+=this.m_body2.m_invMass*c;this.m_body2.m_angularVelocity+=this.m_body2.m_invI*(h*c-g*d)},SolvePositionConstraints:function(){var j;j=this.m_body1.m_R;var l=j.col1.x*this.m_localAnchor1.x+j.col2.x*this.m_localAnchor1.y;var k=j.col1.y*this.m_localAnchor1.x+j.col2.y*this.m_localAnchor1.y;j=this.m_body2.m_R;var i=j.col1.x*this.m_localAnchor2.x+j.col2.x*this.m_localAnchor2.y;var h=j.col1.y*this.m_localAnchor2.x+j.col2.y*this.m_localAnchor2.y;var g=this.m_body2.m_position.x+i-this.m_body1.m_position.x-l;var f=this.m_body2.m_position.y+h-this.m_body1.m_position.y-k;var c=Math.sqrt(g*g+f*f);g/=c;f/=c;var a=c-this.m_length;a=b2Math.b2Clamp(a,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);var b=-this.m_mass*a;this.m_u.Set(g,f);var e=b*this.m_u.x;var d=b*this.m_u.y;this.m_body1.m_position.x-=this.m_body1.m_invMass*e; -this.m_body1.m_position.y-=this.m_body1.m_invMass*d;this.m_body1.m_rotation-=this.m_body1.m_invI*(l*d-k*e);this.m_body2.m_position.x+=this.m_body2.m_invMass*e;this.m_body2.m_position.y+=this.m_body2.m_invMass*d;this.m_body2.m_rotation+=this.m_body2.m_invI*(i*d-h*e);this.m_body1.m_R.Set(this.m_body1.m_rotation);this.m_body2.m_R.Set(this.m_body2.m_rotation);return b2Math.b2Abs(a)d.dt*this.m_maxForce){this.m_impulse.Multiply(d.dt*this.m_maxForce/b)}e=this.m_impulse.x-j;c=this.m_impulse.y-g;i.m_linearVelocity.x+=i.m_invMass*e;i.m_linearVelocity.y+=i.m_invMass*c; -i.m_angularVelocity+=i.m_invI*(h*c-f*e)},SolvePositionConstraints:function(){return true},m_localAnchor:new b2Vec2(),m_target:new b2Vec2(),m_impulse:new b2Vec2(),m_ptpMass:new b2Mat22(),m_C:new b2Vec2(),m_maxForce:null,m_beta:null,m_gamma:null});var b2MouseJointDef=function(){this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.target=new b2Vec2();this.type=b2Joint.e_mouseJoint;this.maxForce=0;this.frequencyHz=5;this.dampingRatio=0.7;this.timeStep=1/60};Object.extend(b2MouseJointDef.prototype,b2JointDef.prototype);Object.extend(b2MouseJointDef.prototype,{target:new b2Vec2(),maxForce:null,frequencyHz:null,dampingRatio:null,timeStep:null});var b2PrismaticJoint=function(c){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=c.type;this.m_prev=null;this.m_next=null;this.m_body1=c.body1;this.m_body2=c.body2;this.m_collideConnected=c.collideConnected;this.m_islandFlag=false;this.m_userData=c.userData;this.m_localAnchor1=new b2Vec2();this.m_localAnchor2=new b2Vec2();this.m_localXAxis1=new b2Vec2();this.m_localYAxis1=new b2Vec2();this.m_linearJacobian=new b2Jacobian();this.m_motorJacobian=new b2Jacobian();var b;var a;var d;b=this.m_body1.m_R;a=(c.anchorPoint.x-this.m_body1.m_position.x);d=(c.anchorPoint.y-this.m_body1.m_position.y);this.m_localAnchor1.Set((a*b.col1.x+d*b.col1.y),(a*b.col2.x+d*b.col2.y));b=this.m_body2.m_R;a=(c.anchorPoint.x-this.m_body2.m_position.x);d=(c.anchorPoint.y-this.m_body2.m_position.y);this.m_localAnchor2.Set((a*b.col1.x+d*b.col1.y),(a*b.col2.x+d*b.col2.y));b=this.m_body1.m_R;a=c.axis.x;d=c.axis.y;this.m_localXAxis1.Set((a*b.col1.x+d*b.col1.y),(a*b.col2.x+d*b.col2.y));this.m_localYAxis1.x=-this.m_localXAxis1.y; -this.m_localYAxis1.y=this.m_localXAxis1.x;this.m_initialAngle=this.m_body2.m_rotation-this.m_body1.m_rotation;this.m_linearJacobian.SetZero();this.m_linearMass=0;this.m_linearImpulse=0;this.m_angularMass=0;this.m_angularImpulse=0;this.m_motorJacobian.SetZero();this.m_motorMass=0;this.m_motorImpulse=0;this.m_limitImpulse=0;this.m_limitPositionImpulse=0;this.m_lowerTranslation=c.lowerTranslation;this.m_upperTranslation=c.upperTranslation;this.m_maxMotorForce=c.motorForce;this.m_motorSpeed=c.motorSpeed;this.m_enableLimit=c.enableLimit;this.m_enableMotor=c.enableMotor};Object.extend(b2PrismaticJoint.prototype,b2Joint.prototype);Object.extend(b2PrismaticJoint.prototype,{GetAnchor1:function(){var a=this.m_body1;var b=new b2Vec2();b.SetV(this.m_localAnchor1);b.MulM(a.m_R);b.Add(a.m_position);return b},GetAnchor2:function(){var a=this.m_body2;var b=new b2Vec2();b.SetV(this.m_localAnchor2);b.MulM(a.m_R);b.Add(a.m_position);return b},GetJointTranslation:function(){var l=this.m_body1;var k=this.m_body2; -var j;j=l.m_R;var p=j.col1.x*this.m_localAnchor1.x+j.col2.x*this.m_localAnchor1.y;var n=j.col1.y*this.m_localAnchor1.x+j.col2.y*this.m_localAnchor1.y;j=k.m_R;var i=j.col1.x*this.m_localAnchor2.x+j.col2.x*this.m_localAnchor2.y;var h=j.col1.y*this.m_localAnchor2.x+j.col2.y*this.m_localAnchor2.y;var g=l.m_position.x+p;var f=l.m_position.y+n;var c=k.m_position.x+i;var b=k.m_position.y+h;var e=c-g;var d=b-f;j=l.m_R;var o=j.col1.x*this.m_localXAxis1.x+j.col2.x*this.m_localXAxis1.y;var m=j.col1.y*this.m_localXAxis1.x+j.col2.y*this.m_localXAxis1.y;var a=o*e+m*d;return a},GetJointSpeed:function(){var j=this.m_body1;var i=this.m_body2;var k;k=j.m_R;var t=k.col1.x*this.m_localAnchor1.x+k.col2.x*this.m_localAnchor1.y;var s=k.col1.y*this.m_localAnchor1.x+k.col2.y*this.m_localAnchor1.y;k=i.m_R;var h=k.col1.x*this.m_localAnchor2.x+k.col2.x*this.m_localAnchor2.y;var g=k.col1.y*this.m_localAnchor2.x+k.col2.y*this.m_localAnchor2.y;var r=j.m_position.x+t;var p=j.m_position.y+s;var c=i.m_position.x+h;var a=i.m_position.y+g; -var f=c-r;var e=a-p;k=j.m_R;var o=k.col1.x*this.m_localXAxis1.x+k.col2.x*this.m_localXAxis1.y;var n=k.col1.y*this.m_localXAxis1.x+k.col2.y*this.m_localXAxis1.y;var d=j.m_linearVelocity;var b=i.m_linearVelocity;var m=j.m_angularVelocity;var l=i.m_angularVelocity;var q=(f*(-m*n)+e*(m*o))+(o*(((b.x+(-l*g))-d.x)-(-m*s))+n*(((b.y+(l*h))-d.y)-(m*t)));return q},GetMotorForce:function(a){return a*this.m_motorImpulse},SetMotorSpeed:function(a){this.m_motorSpeed=a},SetMotorForce:function(a){this.m_maxMotorForce=a},GetReactionForce:function(b){var e=b*this.m_limitImpulse;var d;d=this.m_body1.m_R;var g=e*(d.col1.x*this.m_localXAxis1.x+d.col2.x*this.m_localXAxis1.y);var f=e*(d.col1.y*this.m_localXAxis1.x+d.col2.y*this.m_localXAxis1.y);var c=e*(d.col1.x*this.m_localYAxis1.x+d.col2.x*this.m_localYAxis1.y);var a=e*(d.col1.y*this.m_localYAxis1.x+d.col2.y*this.m_localYAxis1.y);return new b2Vec2(g+c,f+a)},GetReactionTorque:function(a){return a*this.m_angularImpulse},PrepareVelocitySolver:function(){var m=this.m_body1; -var l=this.m_body2;var p;p=m.m_R;var z=p.col1.x*this.m_localAnchor1.x+p.col2.x*this.m_localAnchor1.y;var y=p.col1.y*this.m_localAnchor1.x+p.col2.y*this.m_localAnchor1.y;p=l.m_R;var i=p.col1.x*this.m_localAnchor2.x+p.col2.x*this.m_localAnchor2.y;var g=p.col1.y*this.m_localAnchor2.x+p.col2.y*this.m_localAnchor2.y;var s=m.m_invMass;var r=l.m_invMass;var k=m.m_invI;var j=l.m_invI;p=m.m_R;var h=p.col1.x*this.m_localYAxis1.x+p.col2.x*this.m_localYAxis1.y;var f=p.col1.y*this.m_localYAxis1.x+p.col2.y*this.m_localYAxis1.y;var t=l.m_position.x+i-m.m_position.x;var q=l.m_position.y+g-m.m_position.y;this.m_linearJacobian.linear1.x=-h;this.m_linearJacobian.linear1.y=-f;this.m_linearJacobian.linear2.x=h;this.m_linearJacobian.linear2.y=f;this.m_linearJacobian.angular1=-(t*f-q*h);this.m_linearJacobian.angular2=i*f-g*h;this.m_linearMass=s+k*this.m_linearJacobian.angular1*this.m_linearJacobian.angular1+r+j*this.m_linearJacobian.angular2*this.m_linearJacobian.angular2;this.m_linearMass=1/this.m_linearMass; -this.m_angularMass=1/(k+j);if(this.m_enableLimit||this.m_enableMotor){p=m.m_R;var v=p.col1.x*this.m_localXAxis1.x+p.col2.x*this.m_localXAxis1.y;var u=p.col1.y*this.m_localXAxis1.x+p.col2.y*this.m_localXAxis1.y;this.m_motorJacobian.linear1.x=-v;this.m_motorJacobian.linear1.y=-u;this.m_motorJacobian.linear2.x=v;this.m_motorJacobian.linear2.y=u;this.m_motorJacobian.angular1=-(t*u-q*v);this.m_motorJacobian.angular2=i*u-g*v;this.m_motorMass=s+k*this.m_motorJacobian.angular1*this.m_motorJacobian.angular1+r+j*this.m_motorJacobian.angular2*this.m_motorJacobian.angular2;this.m_motorMass=1/this.m_motorMass;if(this.m_enableLimit){var e=t-z;var d=q-y;var c=v*e+u*d;if(b2Math.b2Abs(this.m_upperTranslation-this.m_lowerTranslation)<2*b2Settings.b2_linearSlop){this.m_limitState=b2Joint.e_equalLimits}else{if(c<=this.m_lowerTranslation){if(this.m_limitState!=b2Joint.e_atLowerLimit){this.m_limitImpulse=0}this.m_limitState=b2Joint.e_atLowerLimit}else{if(c>=this.m_upperTranslation){if(this.m_limitState!=b2Joint.e_atUpperLimit){this.m_limitImpulse=0 -}this.m_limitState=b2Joint.e_atUpperLimit}else{this.m_limitState=b2Joint.e_inactiveLimit;this.m_limitImpulse=0}}}}}if(this.m_enableMotor==false){this.m_motorImpulse=0}if(this.m_enableLimit==false){this.m_limitImpulse=0}if(b2World.s_enableWarmStarting){var b=this.m_linearImpulse*this.m_linearJacobian.linear1.x+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear1.x;var a=this.m_linearImpulse*this.m_linearJacobian.linear1.y+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear1.y;var o=this.m_linearImpulse*this.m_linearJacobian.linear2.x+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear2.x;var n=this.m_linearImpulse*this.m_linearJacobian.linear2.y+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear2.y;var x=this.m_linearImpulse*this.m_linearJacobian.angular1-this.m_angularImpulse+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.angular1;var w=this.m_linearImpulse*this.m_linearJacobian.angular2+this.m_angularImpulse+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.angular2; -m.m_linearVelocity.x+=s*b;m.m_linearVelocity.y+=s*a;m.m_angularVelocity+=k*x;l.m_linearVelocity.x+=r*o;l.m_linearVelocity.y+=r*n;l.m_angularVelocity+=j*w}else{this.m_linearImpulse=0;this.m_angularImpulse=0;this.m_limitImpulse=0;this.m_motorImpulse=0}this.m_limitPositionImpulse=0},SolveVelocityConstraints:function(b){var l=this.m_body1;var k=this.m_body2;var q=l.m_invMass;var o=k.m_invMass;var d=l.m_invI;var c=k.m_invI;var p;var e=this.m_linearJacobian.Compute(l.m_linearVelocity,l.m_angularVelocity,k.m_linearVelocity,k.m_angularVelocity);var j=-this.m_linearMass*e;this.m_linearImpulse+=j;l.m_linearVelocity.x+=(q*j)*this.m_linearJacobian.linear1.x;l.m_linearVelocity.y+=(q*j)*this.m_linearJacobian.linear1.y;l.m_angularVelocity+=d*j*this.m_linearJacobian.angular1;k.m_linearVelocity.x+=(o*j)*this.m_linearJacobian.linear2.x;k.m_linearVelocity.y+=(o*j)*this.m_linearJacobian.linear2.y;k.m_angularVelocity+=c*j*this.m_linearJacobian.angular2;var h=k.m_angularVelocity-l.m_angularVelocity;var a=-this.m_angularMass*h; -this.m_angularImpulse+=a;l.m_angularVelocity-=d*a;k.m_angularVelocity+=c*a;if(this.m_enableMotor&&this.m_limitState!=b2Joint.e_equalLimits){var m=this.m_motorJacobian.Compute(l.m_linearVelocity,l.m_angularVelocity,k.m_linearVelocity,k.m_angularVelocity)-this.m_motorSpeed;var f=-this.m_motorMass*m;var n=this.m_motorImpulse;this.m_motorImpulse=b2Math.b2Clamp(this.m_motorImpulse+f,-b.dt*this.m_maxMotorForce,b.dt*this.m_maxMotorForce);f=this.m_motorImpulse-n;l.m_linearVelocity.x+=(q*f)*this.m_motorJacobian.linear1.x;l.m_linearVelocity.y+=(q*f)*this.m_motorJacobian.linear1.y;l.m_angularVelocity+=d*f*this.m_motorJacobian.angular1;k.m_linearVelocity.x+=(o*f)*this.m_motorJacobian.linear2.x;k.m_linearVelocity.y+=(o*f)*this.m_motorJacobian.linear2.y;k.m_angularVelocity+=c*f*this.m_motorJacobian.angular2}if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit){var i=this.m_motorJacobian.Compute(l.m_linearVelocity,l.m_angularVelocity,k.m_linearVelocity,k.m_angularVelocity);var g=-this.m_motorMass*i; -if(this.m_limitState==b2Joint.e_equalLimits){this.m_limitImpulse+=g}else{if(this.m_limitState==b2Joint.e_atLowerLimit){p=this.m_limitImpulse;this.m_limitImpulse=b2Math.b2Max(this.m_limitImpulse+g,0);g=this.m_limitImpulse-p}else{if(this.m_limitState==b2Joint.e_atUpperLimit){p=this.m_limitImpulse;this.m_limitImpulse=b2Math.b2Min(this.m_limitImpulse+g,0);g=this.m_limitImpulse-p}}}l.m_linearVelocity.x+=(q*g)*this.m_motorJacobian.linear1.x;l.m_linearVelocity.y+=(q*g)*this.m_motorJacobian.linear1.y;l.m_angularVelocity+=d*g*this.m_motorJacobian.angular1;k.m_linearVelocity.x+=(o*g)*this.m_motorJacobian.linear2.x;k.m_linearVelocity.y+=(o*g)*this.m_motorJacobian.linear2.y;k.m_angularVelocity+=c*g*this.m_motorJacobian.angular2}},SolvePositionConstraints:function(){var o;var y;var m=this.m_body1;var k=this.m_body2;var t=m.m_invMass;var s=k.m_invMass;var j=m.m_invI;var i=k.m_invI;var q;q=m.m_R;var E=q.col1.x*this.m_localAnchor1.x+q.col2.x*this.m_localAnchor1.y;var D=q.col1.y*this.m_localAnchor1.x+q.col2.y*this.m_localAnchor1.y; -q=k.m_R;var h=q.col1.x*this.m_localAnchor2.x+q.col2.x*this.m_localAnchor2.y;var g=q.col1.y*this.m_localAnchor2.x+q.col2.y*this.m_localAnchor2.y;var B=m.m_position.x+E;var z=m.m_position.y+D;var b=k.m_position.x+h;var a=k.m_position.y+g;var e=b-B;var c=a-z;q=m.m_R;var f=q.col1.x*this.m_localYAxis1.x+q.col2.x*this.m_localYAxis1.y;var d=q.col1.y*this.m_localYAxis1.x+q.col2.y*this.m_localYAxis1.y;var l=f*e+d*c;l=b2Math.b2Clamp(l,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);var x=-this.m_linearMass*l;m.m_position.x+=(t*x)*this.m_linearJacobian.linear1.x;m.m_position.y+=(t*x)*this.m_linearJacobian.linear1.y;m.m_rotation+=j*x*this.m_linearJacobian.angular1;k.m_position.x+=(s*x)*this.m_linearJacobian.linear2.x;k.m_position.y+=(s*x)*this.m_linearJacobian.linear2.y;k.m_rotation+=i*x*this.m_linearJacobian.angular2;var p=b2Math.b2Abs(l);var A=k.m_rotation-m.m_rotation-this.m_initialAngle;A=b2Math.b2Clamp(A,-b2Settings.b2_maxAngularCorrection,b2Settings.b2_maxAngularCorrection); -var r=-this.m_angularMass*A;m.m_rotation-=m.m_invI*r;m.m_R.Set(m.m_rotation);k.m_rotation+=k.m_invI*r;k.m_R.Set(k.m_rotation);var C=b2Math.b2Abs(A);if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit){q=m.m_R;E=q.col1.x*this.m_localAnchor1.x+q.col2.x*this.m_localAnchor1.y;D=q.col1.y*this.m_localAnchor1.x+q.col2.y*this.m_localAnchor1.y;q=k.m_R;h=q.col1.x*this.m_localAnchor2.x+q.col2.x*this.m_localAnchor2.y;g=q.col1.y*this.m_localAnchor2.x+q.col2.y*this.m_localAnchor2.y;B=m.m_position.x+E;z=m.m_position.y+D;b=k.m_position.x+h;a=k.m_position.y+g;e=b-B;c=a-z;q=m.m_R;var v=q.col1.x*this.m_localXAxis1.x+q.col2.x*this.m_localXAxis1.y;var u=q.col1.y*this.m_localXAxis1.x+q.col2.y*this.m_localXAxis1.y;var n=(v*e+u*c);var w=0;if(this.m_limitState==b2Joint.e_equalLimits){o=b2Math.b2Clamp(n,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);w=-this.m_motorMass*o;p=b2Math.b2Max(p,b2Math.b2Abs(A))}else{if(this.m_limitState==b2Joint.e_atLowerLimit){o=n-this.m_lowerTranslation; -p=b2Math.b2Max(p,-o);o=b2Math.b2Clamp(o+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0);w=-this.m_motorMass*o;y=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Max(this.m_limitPositionImpulse+w,0);w=this.m_limitPositionImpulse-y}else{if(this.m_limitState==b2Joint.e_atUpperLimit){o=n-this.m_upperTranslation;p=b2Math.b2Max(p,o);o=b2Math.b2Clamp(o-b2Settings.b2_linearSlop,0,b2Settings.b2_maxLinearCorrection);w=-this.m_motorMass*o;y=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Min(this.m_limitPositionImpulse+w,0);w=this.m_limitPositionImpulse-y}}}m.m_position.x+=(t*w)*this.m_motorJacobian.linear1.x;m.m_position.y+=(t*w)*this.m_motorJacobian.linear1.y;m.m_rotation+=j*w*this.m_motorJacobian.angular1;m.m_R.Set(m.m_rotation);k.m_position.x+=(s*w)*this.m_motorJacobian.linear2.x;k.m_position.y+=(s*w)*this.m_motorJacobian.linear2.y;k.m_rotation+=i*w*this.m_motorJacobian.angular2;k.m_R.Set(k.m_rotation)}return p<=b2Settings.b2_linearSlop&&C<=b2Settings.b2_angularSlop -},m_localAnchor1:new b2Vec2(),m_localAnchor2:new b2Vec2(),m_localXAxis1:new b2Vec2(),m_localYAxis1:new b2Vec2(),m_initialAngle:null,m_linearJacobian:new b2Jacobian(),m_linearMass:null,m_linearImpulse:null,m_angularMass:null,m_angularImpulse:null,m_motorJacobian:new b2Jacobian(),m_motorMass:null,m_motorImpulse:null,m_limitImpulse:null,m_limitPositionImpulse:null,m_lowerTranslation:null,m_upperTranslation:null,m_maxMotorForce:null,m_motorSpeed:null,m_enableLimit:null,m_enableMotor:null,m_limitState:0});var b2PrismaticJointDef=function(){this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.type=b2Joint.e_prismaticJoint;this.anchorPoint=new b2Vec2(0,0);this.axis=new b2Vec2(0,0);this.lowerTranslation=0;this.upperTranslation=0;this.motorForce=0;this.motorSpeed=0;this.enableLimit=false;this.enableMotor=false};Object.extend(b2PrismaticJointDef.prototype,b2JointDef.prototype);Object.extend(b2PrismaticJointDef.prototype,{anchorPoint:null,axis:null,lowerTranslation:null,upperTranslation:null,motorForce:null,motorSpeed:null,enableLimit:null,enableMotor:null,Initialize:function(b,a,d,c){this.body1=b;this.body2=a;this.anchorPoint=d;this.axis=c}});var b2PulleyJoint=function(d){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=d.type;this.m_prev=null;this.m_next=null;this.m_body1=d.body1;this.m_body2=d.body2;this.m_collideConnected=d.collideConnected;this.m_islandFlag=false;this.m_userData=d.userData;this.m_groundAnchor1=new b2Vec2();this.m_groundAnchor2=new b2Vec2();this.m_localAnchor1=new b2Vec2();this.m_localAnchor2=new b2Vec2();this.m_u1=new b2Vec2();this.m_u2=new b2Vec2();var b;var a;var h;this.m_ground=this.m_body1.m_world.m_groundBody;this.m_groundAnchor1.x=d.groundPoint1.x-this.m_ground.m_position.x;this.m_groundAnchor1.y=d.groundPoint1.y-this.m_ground.m_position.y;this.m_groundAnchor2.x=d.groundPoint2.x-this.m_ground.m_position.x;this.m_groundAnchor2.y=d.groundPoint2.y-this.m_ground.m_position.y;b=this.m_body1.m_R;a=d.anchorPoint1.x-this.m_body1.m_position.x;h=d.anchorPoint1.y-this.m_body1.m_position.y;this.m_localAnchor1.x=a*b.col1.x+h*b.col1.y;this.m_localAnchor1.y=a*b.col2.x+h*b.col2.y;b=this.m_body2.m_R; -a=d.anchorPoint2.x-this.m_body2.m_position.x;h=d.anchorPoint2.y-this.m_body2.m_position.y;this.m_localAnchor2.x=a*b.col1.x+h*b.col1.y;this.m_localAnchor2.y=a*b.col2.x+h*b.col2.y;this.m_ratio=d.ratio;a=d.groundPoint1.x-d.anchorPoint1.x;h=d.groundPoint1.y-d.anchorPoint1.y;var f=Math.sqrt(a*a+h*h);a=d.groundPoint2.x-d.anchorPoint2.x;h=d.groundPoint2.y-d.anchorPoint2.y;var c=Math.sqrt(a*a+h*h);var g=b2Math.b2Max(0.5*b2PulleyJoint.b2_minPulleyLength,f);var e=b2Math.b2Max(0.5*b2PulleyJoint.b2_minPulleyLength,c);this.m_constant=g+this.m_ratio*e;this.m_maxLength1=b2Math.b2Clamp(d.maxLength1,g,this.m_constant-this.m_ratio*b2PulleyJoint.b2_minPulleyLength);this.m_maxLength2=b2Math.b2Clamp(d.maxLength2,e,(this.m_constant-b2PulleyJoint.b2_minPulleyLength)/this.m_ratio);this.m_pulleyImpulse=0;this.m_limitImpulse1=0;this.m_limitImpulse2=0};Object.extend(b2PulleyJoint.prototype,b2Joint.prototype);Object.extend(b2PulleyJoint.prototype,{GetAnchor1:function(){var a=this.m_body1.m_R;return new b2Vec2(this.m_body1.m_position.x+(a.col1.x*this.m_localAnchor1.x+a.col2.x*this.m_localAnchor1.y),this.m_body1.m_position.y+(a.col1.y*this.m_localAnchor1.x+a.col2.y*this.m_localAnchor1.y)) -},GetAnchor2:function(){var a=this.m_body2.m_R;return new b2Vec2(this.m_body2.m_position.x+(a.col1.x*this.m_localAnchor2.x+a.col2.x*this.m_localAnchor2.y),this.m_body2.m_position.y+(a.col1.y*this.m_localAnchor2.x+a.col2.y*this.m_localAnchor2.y))},GetGroundPoint1:function(){return new b2Vec2(this.m_ground.m_position.x+this.m_groundAnchor1.x,this.m_ground.m_position.y+this.m_groundAnchor1.y)},GetGroundPoint2:function(){return new b2Vec2(this.m_ground.m_position.x+this.m_groundAnchor2.x,this.m_ground.m_position.y+this.m_groundAnchor2.y)},GetReactionForce:function(a){return new b2Vec2()},GetReactionTorque:function(a){return 0},GetLength1:function(){var e;e=this.m_body1.m_R;var d=this.m_body1.m_position.x+(e.col1.x*this.m_localAnchor1.x+e.col2.x*this.m_localAnchor1.y);var c=this.m_body1.m_position.y+(e.col1.y*this.m_localAnchor1.x+e.col2.y*this.m_localAnchor1.y);var b=d-(this.m_ground.m_position.x+this.m_groundAnchor1.x);var a=c-(this.m_ground.m_position.y+this.m_groundAnchor1.y);return Math.sqrt(b*b+a*a) -},GetLength2:function(){var e;e=this.m_body2.m_R;var d=this.m_body2.m_position.x+(e.col1.x*this.m_localAnchor2.x+e.col2.x*this.m_localAnchor2.y);var c=this.m_body2.m_position.y+(e.col1.y*this.m_localAnchor2.x+e.col2.y*this.m_localAnchor2.y);var b=d-(this.m_ground.m_position.x+this.m_groundAnchor2.x);var a=c-(this.m_ground.m_position.y+this.m_groundAnchor2.y);return Math.sqrt(b*b+a*a)},GetRatio:function(){return this.m_ratio},PrepareVelocitySolver:function(){var h=this.m_body1;var g=this.m_body2;var l;l=h.m_R;var v=l.col1.x*this.m_localAnchor1.x+l.col2.x*this.m_localAnchor1.y;var u=l.col1.y*this.m_localAnchor1.x+l.col2.y*this.m_localAnchor1.y;l=g.m_R;var f=l.col1.x*this.m_localAnchor2.x+l.col2.x*this.m_localAnchor2.y;var e=l.col1.y*this.m_localAnchor2.x+l.col2.y*this.m_localAnchor2.y;var t=h.m_position.x+v;var r=h.m_position.y+u;var d=g.m_position.x+f;var c=g.m_position.y+e;var m=this.m_ground.m_position.x+this.m_groundAnchor1.x;var k=this.m_ground.m_position.y+this.m_groundAnchor1.y;var s=this.m_ground.m_position.x+this.m_groundAnchor2.x; -var q=this.m_ground.m_position.y+this.m_groundAnchor2.y;this.m_u1.Set(t-m,r-k);this.m_u2.Set(d-s,c-q);var p=this.m_u1.Length();var o=this.m_u2.Length();if(p>b2Settings.b2_linearSlop){this.m_u1.Multiply(1/p)}else{this.m_u1.SetZero()}if(o>b2Settings.b2_linearSlop){this.m_u2.Multiply(1/o)}else{this.m_u2.SetZero()}if(pb2Settings.b2_linearSlop){this.m_u1.Multiply(1/n)}else{this.m_u1.SetZero()}if(m>b2Settings.b2_linearSlop){this.m_u2.Multiply(1/m)}else{this.m_u2.SetZero()}l=this.m_constant-n-this.m_ratio*m;e=b2Math.b2Max(e,Math.abs(l));l=b2Math.b2Clamp(l,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);h=-this.m_pulleyMass*l;r=-h*this.m_u1.x;p=-h*this.m_u1.y;b=-this.m_ratio*h*this.m_u2.x;a=-this.m_ratio*h*this.m_u2.y;g.m_position.x+=g.m_invMass*r;g.m_position.y+=g.m_invMass*p;g.m_rotation+=g.m_invI*(u*p-t*r);f.m_position.x+=f.m_invMass*b;f.m_position.y+=f.m_invMass*a;f.m_rotation+=f.m_invI*(d*a-c*b);g.m_R.Set(g.m_rotation);f.m_R.Set(f.m_rotation);if(this.m_limitState1==b2Joint.e_atUpperLimit){j=g.m_R;u=j.col1.x*this.m_localAnchor1.x+j.col2.x*this.m_localAnchor1.y;t=j.col1.y*this.m_localAnchor1.x+j.col2.y*this.m_localAnchor1.y; -r=g.m_position.x+u;p=g.m_position.y+t;this.m_u1.Set(r-k,p-i);n=this.m_u1.Length();if(n>b2Settings.b2_linearSlop){this.m_u1.x*=1/n;this.m_u1.y*=1/n}else{this.m_u1.SetZero()}l=this.m_maxLength1-n;e=b2Math.b2Max(e,-l);l=b2Math.b2Clamp(l+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0);h=-this.m_limitMass1*l;s=this.m_limitPositionImpulse1;this.m_limitPositionImpulse1=b2Math.b2Max(0,this.m_limitPositionImpulse1+h);h=this.m_limitPositionImpulse1-s;r=-h*this.m_u1.x;p=-h*this.m_u1.y;g.m_position.x+=g.m_invMass*r;g.m_position.y+=g.m_invMass*p;g.m_rotation+=g.m_invI*(u*p-t*r);g.m_R.Set(g.m_rotation)}if(this.m_limitState2==b2Joint.e_atUpperLimit){j=f.m_R;d=j.col1.x*this.m_localAnchor2.x+j.col2.x*this.m_localAnchor2.y;c=j.col1.y*this.m_localAnchor2.x+j.col2.y*this.m_localAnchor2.y;b=f.m_position.x+d;a=f.m_position.y+c;this.m_u2.Set(b-q,a-o);m=this.m_u2.Length();if(m>b2Settings.b2_linearSlop){this.m_u2.x*=1/m;this.m_u2.y*=1/m}else{this.m_u2.SetZero()}l=this.m_maxLength2-m;e=b2Math.b2Max(e,-l); -l=b2Math.b2Clamp(l+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0);h=-this.m_limitMass2*l;s=this.m_limitPositionImpulse2;this.m_limitPositionImpulse2=b2Math.b2Max(0,this.m_limitPositionImpulse2+h);h=this.m_limitPositionImpulse2-s;b=-h*this.m_u2.x;a=-h*this.m_u2.y;f.m_position.x+=f.m_invMass*b;f.m_position.y+=f.m_invMass*a;f.m_rotation+=f.m_invI*(d*a-c*b);f.m_R.Set(f.m_rotation)}return e=this.m_upperAngle){if(this.m_limitState!=b2Joint.e_atUpperLimit){this.m_limitImpulse=0}this.m_limitState=b2Joint.e_atUpperLimit}else{this.m_limitState=b2Joint.e_inactiveLimit;this.m_limitImpulse=0}}}}else{this.m_limitImpulse=0}if(b2World.s_enableWarmStarting){h.m_linearVelocity.x-=l*this.m_ptpImpulse.x;h.m_linearVelocity.y-=l*this.m_ptpImpulse.y;h.m_angularVelocity-=c*((k*this.m_ptpImpulse.y-i*this.m_ptpImpulse.x)+this.m_motorImpulse+this.m_limitImpulse); -g.m_linearVelocity.x+=j*this.m_ptpImpulse.x;g.m_linearVelocity.y+=j*this.m_ptpImpulse.y;g.m_angularVelocity+=b*((e*this.m_ptpImpulse.y-d*this.m_ptpImpulse.x)+this.m_motorImpulse+this.m_limitImpulse)}else{this.m_ptpImpulse.SetZero();this.m_motorImpulse=0;this.m_limitImpulse=0}this.m_limitPositionImpulse=0},SolveVelocityConstraints:function(f){var g=this.m_body1;var e=this.m_body2;var i;i=g.m_R;var o=i.col1.x*this.m_localAnchor1.x+i.col2.x*this.m_localAnchor1.y;var n=i.col1.y*this.m_localAnchor1.x+i.col2.y*this.m_localAnchor1.y;i=e.m_R;var b=i.col1.x*this.m_localAnchor2.x+i.col2.x*this.m_localAnchor2.y;var a=i.col1.y*this.m_localAnchor2.x+i.col2.y*this.m_localAnchor2.y;var k;var q=e.m_linearVelocity.x+(-e.m_angularVelocity*a)-g.m_linearVelocity.x-(-g.m_angularVelocity*n);var p=e.m_linearVelocity.y+(e.m_angularVelocity*b)-g.m_linearVelocity.y-(g.m_angularVelocity*o);var m=-(this.m_ptpMass.col1.x*q+this.m_ptpMass.col2.x*p);var l=-(this.m_ptpMass.col1.y*q+this.m_ptpMass.col2.y*p);this.m_ptpImpulse.x+=m; -this.m_ptpImpulse.y+=l;g.m_linearVelocity.x-=g.m_invMass*m;g.m_linearVelocity.y-=g.m_invMass*l;g.m_angularVelocity-=g.m_invI*(o*l-n*m);e.m_linearVelocity.x+=e.m_invMass*m;e.m_linearVelocity.y+=e.m_invMass*l;e.m_angularVelocity+=e.m_invI*(b*l-a*m);if(this.m_enableMotor&&this.m_limitState!=b2Joint.e_equalLimits){var r=e.m_angularVelocity-g.m_angularVelocity-this.m_motorSpeed;var c=-this.m_motorMass*r;var d=this.m_motorImpulse;this.m_motorImpulse=b2Math.b2Clamp(this.m_motorImpulse+c,-f.dt*this.m_maxMotorTorque,f.dt*this.m_maxMotorTorque);c=this.m_motorImpulse-d;g.m_angularVelocity-=g.m_invI*c;e.m_angularVelocity+=e.m_invI*c}if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit){var h=e.m_angularVelocity-g.m_angularVelocity;var j=-this.m_motorMass*h;if(this.m_limitState==b2Joint.e_equalLimits){this.m_limitImpulse+=j}else{if(this.m_limitState==b2Joint.e_atLowerLimit){k=this.m_limitImpulse;this.m_limitImpulse=b2Math.b2Max(this.m_limitImpulse+j,0);j=this.m_limitImpulse-k}else{if(this.m_limitState==b2Joint.e_atUpperLimit){k=this.m_limitImpulse; -this.m_limitImpulse=b2Math.b2Min(this.m_limitImpulse+j,0);j=this.m_limitImpulse-k}}}g.m_angularVelocity-=g.m_invI*j;e.m_angularVelocity+=e.m_invI*j}},SolvePositionConstraints:function(){var s;var m;var l=this.m_body1;var k=this.m_body2;var o=0;var n;n=l.m_R;var y=n.col1.x*this.m_localAnchor1.x+n.col2.x*this.m_localAnchor1.y;var x=n.col1.y*this.m_localAnchor1.x+n.col2.y*this.m_localAnchor1.y;n=k.m_R;var f=n.col1.x*this.m_localAnchor2.x+n.col2.x*this.m_localAnchor2.y;var e=n.col1.y*this.m_localAnchor2.x+n.col2.y*this.m_localAnchor2.y;var u=l.m_position.x+y;var t=l.m_position.y+x;var d=k.m_position.x+f;var c=k.m_position.y+e;var j=d-u;var i=c-t;o=Math.sqrt(j*j+i*i);var q=l.m_invMass;var p=k.m_invMass;var h=l.m_invI;var g=k.m_invI;this.K1.col1.x=q+p;this.K1.col2.x=0;this.K1.col1.y=0;this.K1.col2.y=q+p;this.K2.col1.x=h*x*x;this.K2.col2.x=-h*y*x;this.K2.col1.y=-h*y*x;this.K2.col2.y=h*y*y;this.K3.col1.x=g*e*e;this.K3.col2.x=-g*f*e;this.K3.col1.y=-g*f*e;this.K3.col2.y=g*f*f;this.K.SetM(this.K1); -this.K.AddM(this.K2);this.K.AddM(this.K3);this.K.Solve(b2RevoluteJoint.tImpulse,-j,-i);var b=b2RevoluteJoint.tImpulse.x;var a=b2RevoluteJoint.tImpulse.y;l.m_position.x-=l.m_invMass*b;l.m_position.y-=l.m_invMass*a;l.m_rotation-=l.m_invI*(y*a-x*b);l.m_R.Set(l.m_rotation);k.m_position.x+=k.m_invMass*b;k.m_position.y+=k.m_invMass*a;k.m_rotation+=k.m_invI*(f*a-e*b);k.m_R.Set(k.m_rotation);var w=0;if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit){var v=k.m_rotation-l.m_rotation-this.m_intialAngle;var r=0;if(this.m_limitState==b2Joint.e_equalLimits){m=b2Math.b2Clamp(v,-b2Settings.b2_maxAngularCorrection,b2Settings.b2_maxAngularCorrection);r=-this.m_motorMass*m;w=b2Math.b2Abs(m)}else{if(this.m_limitState==b2Joint.e_atLowerLimit){m=v-this.m_lowerAngle;w=b2Math.b2Max(0,-m);m=b2Math.b2Clamp(m+b2Settings.b2_angularSlop,-b2Settings.b2_maxAngularCorrection,0);r=-this.m_motorMass*m;s=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Max(this.m_limitPositionImpulse+r,0); -r=this.m_limitPositionImpulse-s}else{if(this.m_limitState==b2Joint.e_atUpperLimit){m=v-this.m_upperAngle;w=b2Math.b2Max(0,m);m=b2Math.b2Clamp(m-b2Settings.b2_angularSlop,0,b2Settings.b2_maxAngularCorrection);r=-this.m_motorMass*m;s=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Min(this.m_limitPositionImpulse+r,0);r=this.m_limitPositionImpulse-s}}}l.m_rotation-=l.m_invI*r;l.m_R.Set(l.m_rotation);k.m_rotation+=k.m_invI*r;k.m_R.Set(k.m_rotation)}return o<=b2Settings.b2_linearSlop&&w<=b2Settings.b2_angularSlop},m_localAnchor1:new b2Vec2(),m_localAnchor2:new b2Vec2(),m_ptpImpulse:new b2Vec2(),m_motorImpulse:null,m_limitImpulse:null,m_limitPositionImpulse:null,m_ptpMass:new b2Mat22(),m_motorMass:null,m_intialAngle:null,m_lowerAngle:null,m_upperAngle:null,m_maxMotorTorque:null,m_motorSpeed:null,m_enableLimit:null,m_enableMotor:null,m_limitState:0});b2RevoluteJoint.tImpulse=new b2Vec2();var b2RevoluteJointDef=function(){this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.type=b2Joint.e_revoluteJoint;this.anchorPoint=new b2Vec2(0,0);this.lowerAngle=0;this.upperAngle=0;this.motorTorque=0;this.motorSpeed=0;this.enableLimit=false;this.enableMotor=false};Object.extend(b2RevoluteJointDef.prototype,b2JointDef.prototype);Object.extend(b2RevoluteJointDef.prototype,{anchorPoint:null,lowerAngle:null,upperAngle:null,motorTorque:null,motorSpeed:null,enableLimit:null,enableMotor:null,Initialize:function(b,a,c){this.body1=b;this.body2=a;this.anchorPoint=c}}); \ No newline at end of file diff --git a/tutorial-2/pixi.js-master/examples/example 24 - Box2D Integration/bricks.png b/tutorial-2/pixi.js-master/examples/example 24 - Box2D Integration/bricks.png deleted file mode 100755 index 4495016..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 24 - Box2D Integration/bricks.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 24 - Box2D Integration/bunny.png b/tutorial-2/pixi.js-master/examples/example 24 - Box2D Integration/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 24 - Box2D Integration/bunny.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 24 - Box2D Integration/grass.png b/tutorial-2/pixi.js-master/examples/example 24 - Box2D Integration/grass.png deleted file mode 100755 index a9dd3a9..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 24 - Box2D Integration/grass.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 24 - Box2D Integration/index.html b/tutorial-2/pixi.js-master/examples/example 24 - Box2D Integration/index.html deleted file mode 100755 index 1cdfabf..0000000 --- a/tutorial-2/pixi.js-master/examples/example 24 - Box2D Integration/index.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - pixi.js example 24 - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 25 - Video/bunny.png b/tutorial-2/pixi.js-master/examples/example 25 - Video/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 25 - Video/bunny.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 25 - Video/index.html b/tutorial-2/pixi.js-master/examples/example 25 - Video/index.html deleted file mode 100755 index ac6fd8f..0000000 --- a/tutorial-2/pixi.js-master/examples/example 25 - Video/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - deus - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 25 - Video/testVideo.mp4 b/tutorial-2/pixi.js-master/examples/example 25 - Video/testVideo.mp4 deleted file mode 100755 index aa45029..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 25 - Video/testVideo.mp4 and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.json b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.json deleted file mode 100755 index 3e419a2..0000000 --- a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.json +++ /dev/null @@ -1,228 +0,0 @@ -{"frames": { - -"Explosion_Sequence_A 1.png": -{ - "frame": {"x":244,"y":1454,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 10.png": -{ - "frame": {"x":244,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 11.png": -{ - "frame": {"x":2,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 12.png": -{ - "frame": {"x":728,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 13.png": -{ - "frame": {"x":486,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 14.png": -{ - "frame": {"x":244,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 15.png": -{ - "frame": {"x":2,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 16.png": -{ - "frame": {"x":728,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 17.png": -{ - "frame": {"x":486,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 18.png": -{ - "frame": {"x":244,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 19.png": -{ - "frame": {"x":2,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 2.png": -{ - "frame": {"x":728,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 20.png": -{ - "frame": {"x":728,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 21.png": -{ - "frame": {"x":486,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 22.png": -{ - "frame": {"x":244,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 23.png": -{ - "frame": {"x":2,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 24.png": -{ - "frame": {"x":728,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 25.png": -{ - "frame": {"x":486,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 26.png": -{ - "frame": {"x":244,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 27.png": -{ - "frame": {"x":2,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 3.png": -{ - "frame": {"x":486,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 4.png": -{ - "frame": {"x":244,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 5.png": -{ - "frame": {"x":2,"y":1696,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 6.png": -{ - "frame": {"x":2,"y":1454,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 7.png": -{ - "frame": {"x":2,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 8.png": -{ - "frame": {"x":728,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 9.png": -{ - "frame": {"x":486,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}}, -"meta": { - "app": "http://www.texturepacker.com", - "version": "1.0", - "image": "SpriteSheet.png", - "format": "RGBA8888", - "size": {"w":1024,"h":2048}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:17e4a2d92ff3e27832c3f4938cec7c85$" -} -} diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.png deleted file mode 100755 index 79e1a69..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/index.html b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/index.html deleted file mode 100755 index 7c7c79e..0000000 --- a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/index.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - pixi.js example 3 using a movieclip - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/SpriteSheet.tps b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/SpriteSheet.tps deleted file mode 100755 index ba7d215..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/SpriteSheet.tps and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 1.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 1.png deleted file mode 100755 index 0e3b33a..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 1.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 10.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 10.png deleted file mode 100755 index 42629ac..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 10.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 11.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 11.png deleted file mode 100755 index f286b30..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 11.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 12.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 12.png deleted file mode 100755 index c4b19db..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 12.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 13.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 13.png deleted file mode 100755 index b57ec0c..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 13.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 14.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 14.png deleted file mode 100755 index a4c8458..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 14.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 15.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 15.png deleted file mode 100755 index 4b7e8e6..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 15.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 16.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 16.png deleted file mode 100755 index edbfd79..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 16.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 17.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 17.png deleted file mode 100755 index 2378b55..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 17.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 18.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 18.png deleted file mode 100755 index 61a13d6..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 18.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 19.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 19.png deleted file mode 100755 index a507ce1..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 19.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 2.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 2.png deleted file mode 100755 index 6cfe0d7..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 2.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 20.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 20.png deleted file mode 100755 index f371ecc..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 20.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 21.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 21.png deleted file mode 100755 index 389aa20..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 21.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 22.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 22.png deleted file mode 100755 index 5d324e5..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 22.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 23.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 23.png deleted file mode 100755 index 9e03ef7..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 23.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 24.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 24.png deleted file mode 100755 index 5a7b29e..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 24.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 25.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 25.png deleted file mode 100755 index 32fed5a..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 25.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 26.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 26.png deleted file mode 100755 index aed27f4..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 26.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 27.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 27.png deleted file mode 100755 index 03efab1..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 27.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 3.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 3.png deleted file mode 100755 index 400ef98..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 3.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 4.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 4.png deleted file mode 100755 index 13368c7..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 4.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 5.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 5.png deleted file mode 100755 index 8bbcfcd..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 5.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 6.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 6.png deleted file mode 100755 index b13a53b..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 6.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 7.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 7.png deleted file mode 100755 index 7a97e9c..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 7.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 8.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 8.png deleted file mode 100755 index 2daf240..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 8.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 9.png b/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 9.png deleted file mode 100755 index 72cd176..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 9.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 4 - Balls/assets/bubble_32x32.png b/tutorial-2/pixi.js-master/examples/example 4 - Balls/assets/bubble_32x32.png deleted file mode 100755 index 33b877e..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 4 - Balls/assets/bubble_32x32.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 4 - Balls/assets/bubble_64x64.png b/tutorial-2/pixi.js-master/examples/example 4 - Balls/assets/bubble_64x64.png deleted file mode 100755 index 573822c..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 4 - Balls/assets/bubble_64x64.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 4 - Balls/assets/photonstorm.png b/tutorial-2/pixi.js-master/examples/example 4 - Balls/assets/photonstorm.png deleted file mode 100755 index c24685b..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 4 - Balls/assets/photonstorm.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 4 - Balls/assets/pixi.png b/tutorial-2/pixi.js-master/examples/example 4 - Balls/assets/pixi.png deleted file mode 100755 index 13276bb..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 4 - Balls/assets/pixi.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 4 - Balls/index.html b/tutorial-2/pixi.js-master/examples/example 4 - Balls/index.html deleted file mode 100755 index 8f3b930..0000000 --- a/tutorial-2/pixi.js-master/examples/example 4 - Balls/index.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - Pixi Balls by Photon Storm - - - - - - - - - - -
    SX: 0
    SY: 0
    - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 4 - Balls/storm.css b/tutorial-2/pixi.js-master/examples/example 4 - Balls/storm.css deleted file mode 100755 index 2807f21..0000000 --- a/tutorial-2/pixi.js-master/examples/example 4 - Balls/storm.css +++ /dev/null @@ -1,34 +0,0 @@ -body { - margin: 0; - padding: 0; - background-color: #000000; -} - -#rnd { - position: absolute; - top: 16px; - left: 16px; -} - -#photonstorm { - position: absolute; - bottom: 16px; - right: 16px; -} - -#pixi { - position: absolute; - bottom: 16px; - left: 16px; -} - -#sx { - position: absolute; - top: 16px; - right: 16px; - width: 200px; - height: 48px; - font-size: 12px; - font-family: Arial; - color: rgba(255,255,255,0.8); -} diff --git a/tutorial-2/pixi.js-master/examples/example 5 - Morph/assets/photonstorm.png b/tutorial-2/pixi.js-master/examples/example 5 - Morph/assets/photonstorm.png deleted file mode 100755 index c24685b..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 5 - Morph/assets/photonstorm.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 5 - Morph/assets/pixel.png b/tutorial-2/pixi.js-master/examples/example 5 - Morph/assets/pixel.png deleted file mode 100755 index 5fdbb86..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 5 - Morph/assets/pixel.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 5 - Morph/assets/pixi.png b/tutorial-2/pixi.js-master/examples/example 5 - Morph/assets/pixi.png deleted file mode 100755 index 13276bb..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 5 - Morph/assets/pixi.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 5 - Morph/index.html b/tutorial-2/pixi.js-master/examples/example 5 - Morph/index.html deleted file mode 100755 index 8cf6639..0000000 --- a/tutorial-2/pixi.js-master/examples/example 5 - Morph/index.html +++ /dev/null @@ -1,312 +0,0 @@ - - - - Pixi Morph by Photon Storm - - - - - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 5 - Morph/storm.css b/tutorial-2/pixi.js-master/examples/example 5 - Morph/storm.css deleted file mode 100755 index 625022e..0000000 --- a/tutorial-2/pixi.js-master/examples/example 5 - Morph/storm.css +++ /dev/null @@ -1,17 +0,0 @@ -body { - margin: 0; - padding: 0; - background-color: #000000; -} - -#photonstorm { - position: absolute; - bottom: 16px; - right: 16px; -} - -#pixi { - position: absolute; - bottom: 16px; - left: 16px; -} diff --git a/tutorial-2/pixi.js-master/examples/example 6 - Interactivity/button.png b/tutorial-2/pixi.js-master/examples/example 6 - Interactivity/button.png deleted file mode 100755 index b0cd012..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 6 - Interactivity/button.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 6 - Interactivity/buttonDown.png b/tutorial-2/pixi.js-master/examples/example 6 - Interactivity/buttonDown.png deleted file mode 100755 index 643b757..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 6 - Interactivity/buttonDown.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 6 - Interactivity/buttonOver.png b/tutorial-2/pixi.js-master/examples/example 6 - Interactivity/buttonOver.png deleted file mode 100755 index 8117a2d..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 6 - Interactivity/buttonOver.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 6 - Interactivity/button_test_BG.jpg b/tutorial-2/pixi.js-master/examples/example 6 - Interactivity/button_test_BG.jpg deleted file mode 100755 index 0449cbb..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 6 - Interactivity/button_test_BG.jpg and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 6 - Interactivity/index.html b/tutorial-2/pixi.js-master/examples/example 6 - Interactivity/index.html deleted file mode 100755 index 29bd4cf..0000000 --- a/tutorial-2/pixi.js-master/examples/example 6 - Interactivity/index.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - pixi.js example 6 Interactivity - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 6 - Interactivity/pixi.png b/tutorial-2/pixi.js-master/examples/example 6 - Interactivity/pixi.png deleted file mode 100755 index 13276bb..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 6 - Interactivity/pixi.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 7 - Transparent Background/bunny.png b/tutorial-2/pixi.js-master/examples/example 7 - Transparent Background/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 7 - Transparent Background/bunny.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 7 - Transparent Background/index.html b/tutorial-2/pixi.js-master/examples/example 7 - Transparent Background/index.html deleted file mode 100755 index 305c3bd..0000000 --- a/tutorial-2/pixi.js-master/examples/example 7 - Transparent Background/index.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - pixi.js example 7 transparency - - - - -
    Hi there, I'm some HTML text... blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
    - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 7 - Transparent Background/shapeTris.png b/tutorial-2/pixi.js-master/examples/example 7 - Transparent Background/shapeTris.png deleted file mode 100755 index 426ff68..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 7 - Transparent Background/shapeTris.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 8 - Dragging/bunny.png b/tutorial-2/pixi.js-master/examples/example 8 - Dragging/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 8 - Dragging/bunny.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/example 8 - Dragging/index.html b/tutorial-2/pixi.js-master/examples/example 8 - Dragging/index.html deleted file mode 100755 index 69352af..0000000 --- a/tutorial-2/pixi.js-master/examples/example 8 - Dragging/index.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - pixi.js example 8 Dragging - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 9 - Tiling Texture/index.html b/tutorial-2/pixi.js-master/examples/example 9 - Tiling Texture/index.html deleted file mode 100755 index 411ded9..0000000 --- a/tutorial-2/pixi.js-master/examples/example 9 - Tiling Texture/index.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - pixi.js example 9 Tiling Texture - - - - - - - - diff --git a/tutorial-2/pixi.js-master/examples/example 9 - Tiling Texture/p2.jpeg b/tutorial-2/pixi.js-master/examples/example 9 - Tiling Texture/p2.jpeg deleted file mode 100755 index 4943288..0000000 Binary files a/tutorial-2/pixi.js-master/examples/example 9 - Tiling Texture/p2.jpeg and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/test/bunny.png b/tutorial-2/pixi.js-master/examples/test/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-2/pixi.js-master/examples/test/bunny.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/examples/test/index.html b/tutorial-2/pixi.js-master/examples/test/index.html deleted file mode 100755 index f1009cb..0000000 --- a/tutorial-2/pixi.js-master/examples/test/index.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - pixi.js test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tutorial-2/pixi.js-master/logo.png b/tutorial-2/pixi.js-master/logo.png deleted file mode 100755 index 654d77f..0000000 Binary files a/tutorial-2/pixi.js-master/logo.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/logo_small.png b/tutorial-2/pixi.js-master/logo_small.png deleted file mode 100755 index f7c1f4f..0000000 Binary files a/tutorial-2/pixi.js-master/logo_small.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/package.json b/tutorial-2/pixi.js-master/package.json deleted file mode 100755 index 463e77c..0000000 --- a/tutorial-2/pixi.js-master/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "pixi.js", - "version": "2.2.7", - "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", - "author": "Mat Groves", - "contributors": [ - "Chad Engler " - ], - "logo": "http://www.goodboydigital.com/pixijs/logo_small.png", - "homepage": "http://goodboydigital.com/", - "bugs": "https://github.com/GoodBoyDigital/pixi.js/issues", - "license": "MIT", - "licenseUrl": "http://www.opensource.org/licenses/mit-license.php", - "repository": { - "type": "git", - "url": "https://github.com/GoodBoyDigital/pixi.js.git" - }, - "main": "bin/pixi.dev.js", - "scripts": { - "test": "grunt travis --verbose" - }, - "dependencies": {}, - "devDependencies": { - "grunt": "~0.4.1", - "grunt-contrib-jshint": "~0.8", - "grunt-contrib-uglify": "~0.2", - "grunt-contrib-connect": "~0.5", - "grunt-contrib-yuidoc": "~0.5", - "grunt-concat-sourcemap": "~0.4", - "grunt-contrib-concat": "~0.3", - "mocha": "~1.15", - "chai": "~1.8", - "karma": "~0.12", - "karma-chrome-launcher": "~0.1", - "karma-firefox-launcher": "~0.1", - "karma-mocha": "~0.1", - "karma-spec-reporter": "~0.0.6", - "grunt-contrib-watch": "~0.5.3" - } -} diff --git a/tutorial-2/pixi.js-master/src/pixi/InteractionData.js b/tutorial-2/pixi.js-master/src/pixi/InteractionData.js deleted file mode 100755 index b0d8a6a..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/InteractionData.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Holds all information related to an Interaction event - * - * @class InteractionData - * @constructor - */ -PIXI.InteractionData = function() -{ - /** - * This point stores the global coords of where the touch/mouse event happened - * - * @property global - * @type Point - */ - this.global = new PIXI.Point(); - - /** - * The target Sprite that was interacted with - * - * @property target - * @type Sprite - */ - this.target = null; - - /** - * When passed to an event handler, this will be the original DOM Event that was captured - * - * @property originalEvent - * @type Event - */ - this.originalEvent = null; -}; - -/** - * This will return the local coordinates of the specified displayObject for this InteractionData - * - * @method getLocalPosition - * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off - * @param [point] {Point} A Point object in which to store the value, optional (otherwise will create a new point) - * @return {Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject - */ -PIXI.InteractionData.prototype.getLocalPosition = function(displayObject, point) -{ - var worldTransform = displayObject.worldTransform; - var global = this.global; - - // do a cheeky transform to get the mouse coords; - var a00 = worldTransform.a, a01 = worldTransform.c, a02 = worldTransform.tx, - a10 = worldTransform.b, a11 = worldTransform.d, a12 = worldTransform.ty, - id = 1 / (a00 * a11 + a01 * -a10); - - point = point || new PIXI.Point(); - - point.x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id; - point.y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; - - // set the mouse coords... - return point; -}; - -// constructor -PIXI.InteractionData.prototype.constructor = PIXI.InteractionData; diff --git a/tutorial-2/pixi.js-master/src/pixi/InteractionManager.js b/tutorial-2/pixi.js-master/src/pixi/InteractionManager.js deleted file mode 100755 index 646d0a8..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/InteractionManager.js +++ /dev/null @@ -1,944 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - - /** - * The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive - * if its interactive parameter is set to true - * This manager also supports multitouch. - * - * @class InteractionManager - * @constructor - * @param stage {Stage} The stage to handle interactions - */ -PIXI.InteractionManager = function(stage) -{ - /** - * A reference to the stage - * - * @property stage - * @type Stage - */ - this.stage = stage; - - /** - * The mouse data - * - * @property mouse - * @type InteractionData - */ - this.mouse = new PIXI.InteractionData(); - - /** - * An object that stores current touches (InteractionData) by id reference - * - * @property touches - * @type Object - */ - this.touches = {}; - - /** - * @property tempPoint - * @type Point - * @private - */ - this.tempPoint = new PIXI.Point(); - - /** - * @property mouseoverEnabled - * @type Boolean - * @default - */ - this.mouseoverEnabled = true; - - /** - * Tiny little interactiveData pool ! - * - * @property pool - * @type Array - */ - this.pool = []; - - /** - * An array containing all the iterative items from the our interactive tree - * @property interactiveItems - * @type Array - * @private - */ - this.interactiveItems = []; - - /** - * Our canvas - * @property interactionDOMElement - * @type HTMLCanvasElement - * @private - */ - this.interactionDOMElement = null; - - //this will make it so that you don't have to call bind all the time - - /** - * @property onMouseMove - * @type Function - */ - this.onMouseMove = this.onMouseMove.bind( this ); - - /** - * @property onMouseDown - * @type Function - */ - this.onMouseDown = this.onMouseDown.bind(this); - - /** - * @property onMouseOut - * @type Function - */ - this.onMouseOut = this.onMouseOut.bind(this); - - /** - * @property onMouseUp - * @type Function - */ - this.onMouseUp = this.onMouseUp.bind(this); - - /** - * @property onTouchStart - * @type Function - */ - this.onTouchStart = this.onTouchStart.bind(this); - - /** - * @property onTouchEnd - * @type Function - */ - this.onTouchEnd = this.onTouchEnd.bind(this); - - /** - * @property onTouchCancel - * @type Function - */ - this.onTouchCancel = this.onTouchCancel.bind(this); - - /** - * @property onTouchMove - * @type Function - */ - this.onTouchMove = this.onTouchMove.bind(this); - - /** - * @property last - * @type Number - */ - this.last = 0; - - /** - * The css style of the cursor that is being used - * @property currentCursorStyle - * @type String - */ - this.currentCursorStyle = 'inherit'; - - /** - * Is set to true when the mouse is moved out of the canvas - * @property mouseOut - * @type Boolean - */ - this.mouseOut = false; - - /** - * @property resolution - * @type Number - */ - this.resolution = 1; - - // used for hit testing - this._tempPoint = new PIXI.Point(); -}; - -// constructor -PIXI.InteractionManager.prototype.constructor = PIXI.InteractionManager; - -/** - * Collects an interactive sprite recursively to have their interactions managed - * - * @method collectInteractiveSprite - * @param displayObject {DisplayObject} the displayObject to collect - * @param iParent {DisplayObject} the display object's parent - * @private - */ -PIXI.InteractionManager.prototype.collectInteractiveSprite = function(displayObject, iParent) -{ - var children = displayObject.children; - var length = children.length; - - // make an interaction tree... {item.__interactiveParent} - for (var i = length - 1; i >= 0; i--) - { - var child = children[i]; - - // push all interactive bits - if (child._interactive) - { - iParent.interactiveChildren = true; - //child.__iParent = iParent; - this.interactiveItems.push(child); - - if (child.children.length > 0) { - this.collectInteractiveSprite(child, child); - } - } - else - { - child.__iParent = null; - if (child.children.length > 0) - { - this.collectInteractiveSprite(child, iParent); - } - } - - } -}; - -/** - * Sets the target for event delegation - * - * @method setTarget - * @param target {WebGLRenderer|CanvasRenderer} the renderer to bind events to - * @private - */ -PIXI.InteractionManager.prototype.setTarget = function(target) -{ - this.target = target; - this.resolution = target.resolution; - - // Check if the dom element has been set. If it has don't do anything. - if (this.interactionDOMElement !== null) return; - - this.setTargetDomElement (target.view); -}; - -/** - * Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM - * elements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element - * to receive those events - * - * @method setTargetDomElement - * @param domElement {DOMElement} the DOM element which will receive mouse and touch events - * @private - */ -PIXI.InteractionManager.prototype.setTargetDomElement = function(domElement) -{ - this.removeEvents(); - - if (window.navigator.msPointerEnabled) - { - // time to remove some of that zoom in ja.. - domElement.style['-ms-content-zooming'] = 'none'; - domElement.style['-ms-touch-action'] = 'none'; - } - - this.interactionDOMElement = domElement; - - domElement.addEventListener('mousemove', this.onMouseMove, true); - domElement.addEventListener('mousedown', this.onMouseDown, true); - domElement.addEventListener('mouseout', this.onMouseOut, true); - - // aint no multi touch just yet! - domElement.addEventListener('touchstart', this.onTouchStart, true); - domElement.addEventListener('touchend', this.onTouchEnd, true); - domElement.addEventListener('touchleave', this.onTouchCancel, true); - domElement.addEventListener('touchcancel', this.onTouchCancel, true); - domElement.addEventListener('touchmove', this.onTouchMove, true); - - window.addEventListener('mouseup', this.onMouseUp, true); -}; - -/** - * @method removeEvents - * @private - */ -PIXI.InteractionManager.prototype.removeEvents = function() -{ - if (!this.interactionDOMElement) return; - - this.interactionDOMElement.style['-ms-content-zooming'] = ''; - this.interactionDOMElement.style['-ms-touch-action'] = ''; - - this.interactionDOMElement.removeEventListener('mousemove', this.onMouseMove, true); - this.interactionDOMElement.removeEventListener('mousedown', this.onMouseDown, true); - this.interactionDOMElement.removeEventListener('mouseout', this.onMouseOut, true); - - // aint no multi touch just yet! - this.interactionDOMElement.removeEventListener('touchstart', this.onTouchStart, true); - this.interactionDOMElement.removeEventListener('touchend', this.onTouchEnd, true); - this.interactionDOMElement.removeEventListener('touchleave', this.onTouchCancel, true); - this.interactionDOMElement.removeEventListener('touchcancel', this.onTouchCancel, true); - this.interactionDOMElement.removeEventListener('touchmove', this.onTouchMove, true); - - this.interactionDOMElement = null; - - window.removeEventListener('mouseup', this.onMouseUp, true); -}; - -/** - * updates the state of interactive objects - * - * @method update - * @private - */ -PIXI.InteractionManager.prototype.update = function() -{ - if (!this.target) return; - - // frequency of 30fps?? - var now = Date.now(); - var diff = now - this.last; - diff = (diff * PIXI.INTERACTION_FREQUENCY ) / 1000; - if (diff < 1) return; - this.last = now; - - var i = 0; - - // ok.. so mouse events?? - // yes for now :) - // OPTIMISE - how often to check?? - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - // loop through interactive objects! - var length = this.interactiveItems.length; - var cursor = 'inherit'; - var over = false; - - for (i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - // OPTIMISATION - only calculate every time if the mousemove function exists.. - // OK so.. does the object have any other interactive functions? - // hit-test the clip! - // if (item.mouseover || item.mouseout || item.buttonMode) - // { - // ok so there are some functions so lets hit test it.. - item.__hit = this.hitTest(item, this.mouse); - this.mouse.target = item; - // ok so deal with interactions.. - // looks like there was a hit! - if (item.__hit && !over) - { - if (item.buttonMode) cursor = item.defaultCursor; - - if (!item.interactiveChildren) - { - over = true; - } - - if (!item.__isOver) - { - if (item.mouseover) - { - item.mouseover (this.mouse); - } - item.__isOver = true; - } - } - else - { - if (item.__isOver) - { - // roll out! - if (item.mouseout) - { - item.mouseout (this.mouse); - } - item.__isOver = false; - } - } - } - - if (this.currentCursorStyle !== cursor) - { - this.currentCursorStyle = cursor; - this.interactionDOMElement.style.cursor = cursor; - } -}; - -/** - * @method rebuildInteractiveGraph - * @private - */ -PIXI.InteractionManager.prototype.rebuildInteractiveGraph = function() -{ - this.dirty = false; - - var len = this.interactiveItems.length; - - for (var i = 0; i < len; i++) { - this.interactiveItems[i].interactiveChildren = false; - } - - this.interactiveItems = []; - - if (this.stage.interactive) - { - this.interactiveItems.push(this.stage); - } - - // Go through and collect all the objects that are interactive.. - this.collectInteractiveSprite(this.stage, this.stage); -}; - -/** - * Is called when the mouse moves across the renderer element - * - * @method onMouseMove - * @param event {Event} The DOM event of the mouse moving - * @private - */ -PIXI.InteractionManager.prototype.onMouseMove = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - // TODO optimize by not check EVERY TIME! maybe half as often? // - var rect = this.interactionDOMElement.getBoundingClientRect(); - - this.mouse.global.x = (event.clientX - rect.left) * (this.target.width / rect.width) / this.resolution; - this.mouse.global.y = (event.clientY - rect.top) * ( this.target.height / rect.height) / this.resolution; - - var length = this.interactiveItems.length; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - // Call the function! - if (item.mousemove) - { - item.mousemove(this.mouse); - } - } -}; - -/** - * Is called when the mouse button is pressed down on the renderer element - * - * @method onMouseDown - * @param event {Event} The DOM event of a mouse button being pressed down - * @private - */ -PIXI.InteractionManager.prototype.onMouseDown = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - if (PIXI.AUTO_PREVENT_DEFAULT) - { - this.mouse.originalEvent.preventDefault(); - } - - // loop through interaction tree... - // hit test each item! -> - // get interactive items under point?? - //stage.__i - var length = this.interactiveItems.length; - - var e = this.mouse.originalEvent; - var isRightButton = e.button === 2 || e.which === 3; - var downFunction = isRightButton ? 'rightdown' : 'mousedown'; - var clickFunction = isRightButton ? 'rightclick' : 'click'; - var buttonIsDown = isRightButton ? '__rightIsDown' : '__mouseIsDown'; - var isDown = isRightButton ? '__isRightDown' : '__isDown'; - - // while - // hit test - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - if (item[downFunction] || item[clickFunction]) - { - item[buttonIsDown] = true; - item.__hit = this.hitTest(item, this.mouse); - - if (item.__hit) - { - //call the function! - if (item[downFunction]) - { - item[downFunction](this.mouse); - } - item[isDown] = true; - - // just the one! - if (!item.interactiveChildren) break; - } - } - } -}; - -/** - * Is called when the mouse is moved out of the renderer element - * - * @method onMouseOut - * @param event {Event} The DOM event of a mouse being moved out - * @private - */ -PIXI.InteractionManager.prototype.onMouseOut = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - var length = this.interactiveItems.length; - - this.interactionDOMElement.style.cursor = 'inherit'; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - if (item.__isOver) - { - this.mouse.target = item; - if (item.mouseout) - { - item.mouseout(this.mouse); - } - item.__isOver = false; - } - } - - this.mouseOut = true; - - // move the mouse to an impossible position - this.mouse.global.x = -10000; - this.mouse.global.y = -10000; -}; - -/** - * Is called when the mouse button is released on the renderer element - * - * @method onMouseUp - * @param event {Event} The DOM event of a mouse button being released - * @private - */ -PIXI.InteractionManager.prototype.onMouseUp = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - var length = this.interactiveItems.length; - var up = false; - - var e = this.mouse.originalEvent; - var isRightButton = e.button === 2 || e.which === 3; - - var upFunction = isRightButton ? 'rightup' : 'mouseup'; - var clickFunction = isRightButton ? 'rightclick' : 'click'; - var upOutsideFunction = isRightButton ? 'rightupoutside' : 'mouseupoutside'; - var isDown = isRightButton ? '__isRightDown' : '__isDown'; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - if (item[clickFunction] || item[upFunction] || item[upOutsideFunction]) - { - item.__hit = this.hitTest(item, this.mouse); - - if (item.__hit && !up) - { - //call the function! - if (item[upFunction]) - { - item[upFunction](this.mouse); - } - if (item[isDown]) - { - if (item[clickFunction]) - { - item[clickFunction](this.mouse); - } - } - - if (!item.interactiveChildren) - { - up = true; - } - } - else - { - if (item[isDown]) - { - if (item[upOutsideFunction]) item[upOutsideFunction](this.mouse); - } - } - - item[isDown] = false; - } - } -}; - -/** - * Tests if the current mouse coordinates hit a sprite - * - * @method hitTest - * @param item {DisplayObject} The displayObject to test for a hit - * @param interactionData {InteractionData} The interactionData object to update in the case there is a hit - * @private - */ -PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) -{ - var global = interactionData.global; - - if (!item.worldVisible) - { - return false; - } - - // map the global point to local space. - item.worldTransform.applyInverse(global, this._tempPoint); - - var x = this._tempPoint.x, - y = this._tempPoint.y, - i; - - interactionData.target = item; - - //a sprite or display object with a hit area defined - if (item.hitArea && item.hitArea.contains) - { - return item.hitArea.contains(x, y); - } - // a sprite with no hitarea defined - else if(item instanceof PIXI.Sprite) - { - var width = item.texture.frame.width; - var height = item.texture.frame.height; - var x1 = -width * item.anchor.x; - var y1; - - if (x > x1 && x < x1 + width) - { - y1 = -height * item.anchor.y; - - if (y > y1 && y < y1 + height) - { - // set the target property if a hit is true! - return true; - } - } - } - else if(item instanceof PIXI.Graphics) - { - var graphicsData = item.graphicsData; - for (i = 0; i < graphicsData.length; i++) - { - var data = graphicsData[i]; - if(!data.fill)continue; - - // only deal with fills.. - if(data.shape) - { - if(data.shape.contains(x, y)) - { - //interactionData.target = item; - return true; - } - } - } - } - - var length = item.children.length; - - for (i = 0; i < length; i++) - { - var tempItem = item.children[i]; - var hit = this.hitTest(tempItem, interactionData); - if (hit) - { - // hmm.. TODO SET CORRECT TARGET? - interactionData.target = item; - return true; - } - } - return false; -}; - -/** - * Is called when a touch is moved across the renderer element - * - * @method onTouchMove - * @param event {Event} The DOM event of a touch moving across the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchMove = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - var touchData; - var i = 0; - - for (i = 0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - touchData = this.touches[touchEvent.identifier]; - touchData.originalEvent = event; - - // update the touch position - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - for (var j = 0; j < this.interactiveItems.length; j++) - { - var item = this.interactiveItems[j]; - if (item.touchmove && item.__touchData && item.__touchData[touchEvent.identifier]) - { - item.touchmove(touchData); - } - } - } -}; - -/** - * Is called when a touch is started on the renderer element - * - * @method onTouchStart - * @param event {Event} The DOM event of a touch starting on the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchStart = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - - if (PIXI.AUTO_PREVENT_DEFAULT) - { - event.preventDefault(); - } - - var changedTouches = event.changedTouches; - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - - var touchData = this.pool.pop(); - if (!touchData) - { - touchData = new PIXI.InteractionData(); - } - - touchData.originalEvent = event; - - this.touches[touchEvent.identifier] = touchData; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.touchstart || item.tap) - { - item.__hit = this.hitTest(item, touchData); - - if (item.__hit) - { - //call the function! - if (item.touchstart)item.touchstart(touchData); - item.__isDown = true; - item.__touchData = item.__touchData || {}; - item.__touchData[touchEvent.identifier] = touchData; - - if (!item.interactiveChildren) break; - } - } - } - } -}; - -/** - * Is called when a touch is ended on the renderer element - * - * @method onTouchEnd - * @param event {Event} The DOM event of a touch ending on the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchEnd = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - var touchData = this.touches[touchEvent.identifier]; - var up = false; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.__touchData && item.__touchData[touchEvent.identifier]) - { - - item.__hit = this.hitTest(item, item.__touchData[touchEvent.identifier]); - - // so this one WAS down... - touchData.originalEvent = event; - // hitTest?? - - if (item.touchend || item.tap) - { - if (item.__hit && !up) - { - if (item.touchend) - { - item.touchend(touchData); - } - if (item.__isDown && item.tap) - { - item.tap(touchData); - } - if (!item.interactiveChildren) - { - up = true; - } - } - else - { - if (item.__isDown && item.touchendoutside) - { - item.touchendoutside(touchData); - } - } - - item.__isDown = false; - } - - item.__touchData[touchEvent.identifier] = null; - } - } - // remove the touch.. - this.pool.push(touchData); - this.touches[touchEvent.identifier] = null; - } -}; - -/** - * Is called when a touch is canceled - * - * @method onTouchCancel - * @param event {Event} The DOM event of a touch canceled - * @private - */ -PIXI.InteractionManager.prototype.onTouchCancel = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - var touchData = this.touches[touchEvent.identifier]; - var up = false; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.__touchData && item.__touchData[touchEvent.identifier]) - { - - item.__hit = this.hitTest(item, item.__touchData[touchEvent.identifier]); - - // so this one WAS down... - touchData.originalEvent = event; - // hitTest?? - - if (item.touchcancel && !up) - { - item.touchcancel(touchData); - if (!item.interactiveChildren) - { - up = true; - } - } - - item.__isDown = false; - item.__touchData[touchEvent.identifier] = null; - } - } - // remove the touch.. - this.pool.push(touchData); - this.touches[touchEvent.identifier] = null; - } -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/Intro.js b/tutorial-2/pixi.js-master/src/pixi/Intro.js deleted file mode 100755 index 07d01da..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/Intro.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -(function(){ - - var root = this; diff --git a/tutorial-2/pixi.js-master/src/pixi/Outro.js b/tutorial-2/pixi.js-master/src/pixi/Outro.js deleted file mode 100755 index bf38bbc..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/Outro.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @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 if (typeof define !== 'undefined' && define.amd) { - define(PIXI); - } else { - root.PIXI = PIXI; - } -}).call(this); \ No newline at end of file diff --git a/tutorial-2/pixi.js-master/src/pixi/Pixi.js b/tutorial-2/pixi.js-master/src/pixi/Pixi.js deleted file mode 100755 index 1b17b5c..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/Pixi.js +++ /dev/null @@ -1,213 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The [pixi.js](http://www.pixijs.com/) module/namespace. - * - * @module PIXI - */ - -/** - * Namespace-class for [pixi.js](http://www.pixijs.com/). - * - * Contains assorted static properties and enumerations. - * - * @class PIXI - * @static - */ -var PIXI = PIXI || {}; - -/** - * @property {Number} WEBGL_RENDERER - * @protected - * @static - */ -PIXI.WEBGL_RENDERER = 0; -/** - * @property {Number} CANVAS_RENDERER - * @protected - * @static - */ -PIXI.CANVAS_RENDERER = 1; - -/** - * Version of pixi that is loaded. - * @property {String} VERSION - * @static - */ -PIXI.VERSION = "v2.2.7"; - -/** - * Various blend modes supported by pixi. IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes. - * @property {Object} blendModes - * @property {Number} blendModes.NORMAL - * @property {Number} blendModes.ADD - * @property {Number} blendModes.MULTIPLY - * @property {Number} blendModes.SCREEN - * @property {Number} blendModes.OVERLAY - * @property {Number} blendModes.DARKEN - * @property {Number} blendModes.LIGHTEN - * @property {Number} blendModes.COLOR_DODGE - * @property {Number} blendModes.COLOR_BURN - * @property {Number} blendModes.HARD_LIGHT - * @property {Number} blendModes.SOFT_LIGHT - * @property {Number} blendModes.DIFFERENCE - * @property {Number} blendModes.EXCLUSION - * @property {Number} blendModes.HUE - * @property {Number} blendModes.SATURATION - * @property {Number} blendModes.COLOR - * @property {Number} blendModes.LUMINOSITY - * @static - */ -PIXI.blendModes = { - NORMAL:0, - ADD:1, - MULTIPLY:2, - SCREEN:3, - OVERLAY:4, - DARKEN:5, - LIGHTEN:6, - COLOR_DODGE:7, - COLOR_BURN:8, - HARD_LIGHT:9, - SOFT_LIGHT:10, - DIFFERENCE:11, - EXCLUSION:12, - HUE:13, - SATURATION:14, - COLOR:15, - LUMINOSITY:16 -}; - -/** - * The scale modes that are supported by pixi. - * - * The DEFAULT scale mode affects the default scaling mode of future operations. - * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. - * - * @property {Object} scaleModes - * @property {Number} scaleModes.DEFAULT=LINEAR - * @property {Number} scaleModes.LINEAR Smooth scaling - * @property {Number} scaleModes.NEAREST Pixelating scaling - * @static - */ -PIXI.scaleModes = { - DEFAULT:0, - LINEAR:0, - NEAREST:1 -}; - -// used to create uids for various pixi objects.. -PIXI._UID = 0; - -if(typeof(Float32Array) != 'undefined') -{ - PIXI.Float32Array = Float32Array; - PIXI.Uint16Array = Uint16Array; - - // Uint32Array and ArrayBuffer only used by WebGL renderer - // We can suppose that if WebGL is supported then typed arrays are supported too - // as they predate WebGL support for all browsers: - // see typed arrays support: http://caniuse.com/#search=TypedArrays - // see WebGL support: http://caniuse.com/#search=WebGL - PIXI.Uint32Array = Uint32Array; - PIXI.ArrayBuffer = ArrayBuffer; -} -else -{ - PIXI.Float32Array = Array; - PIXI.Uint16Array = Array; -} - -// interaction frequency -PIXI.INTERACTION_FREQUENCY = 30; -PIXI.AUTO_PREVENT_DEFAULT = true; - -/** - * @property {Number} PI_2 - * @static - */ -PIXI.PI_2 = Math.PI * 2; - -/** - * @property {Number} RAD_TO_DEG - * @static - */ -PIXI.RAD_TO_DEG = 180 / Math.PI; - -/** - * @property {Number} DEG_TO_RAD - * @static - */ -PIXI.DEG_TO_RAD = Math.PI / 180; - -/** - * @property {String} RETINA_PREFIX - * @protected - * @static - */ -PIXI.RETINA_PREFIX = "@2x"; -//PIXI.SCALE_PREFIX "@x%%"; - -/** - * If true the default pixi startup (console) banner message will be suppressed. - * - * @property {Boolean} dontSayHello - * @default false - * @static - */ -PIXI.dontSayHello = false; - -/** - * The default render options if none are supplied to - * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. - * - * @property {Object} defaultRenderOptions - * @property {Object} defaultRenderOptions.view=null - * @property {Boolean} defaultRenderOptions.transparent=false - * @property {Boolean} defaultRenderOptions.antialias=false - * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false - * @property {Number} defaultRenderOptions.resolution=1 - * @property {Boolean} defaultRenderOptions.clearBeforeRender=true - * @property {Boolean} defaultRenderOptions.autoResize=false - * @static - */ -PIXI.defaultRenderOptions = { - view:null, - transparent:false, - antialias:false, - preserveDrawingBuffer:false, - resolution:1, - clearBeforeRender:true, - autoResize:false -} - -PIXI.sayHello = function (type) -{ - if(PIXI.dontSayHello)return; - - if ( navigator.userAgent.toLowerCase().indexOf('chrome') > -1 ) - { - var args = [ - '%c %c %c Pixi.js ' + PIXI.VERSION + ' - ' + type + ' %c ' + ' %c ' + ' http://www.pixijs.com/ %c %c ♥%c♥%c♥ ', - 'background: #ff66a5', - 'background: #ff66a5', - 'color: #ff66a5; background: #030307;', - 'background: #ff66a5', - 'background: #ffc3dc', - 'background: #ff66a5', - 'color: #ff2424; background: #fff', - 'color: #ff2424; background: #fff', - 'color: #ff2424; background: #fff' - ]; - - console.log.apply(console, args); - } - else if (window['console']) - { - console.log('Pixi.js ' + PIXI.VERSION + ' - http://www.pixijs.com/'); - } - - PIXI.dontSayHello = true; -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/display/DisplayObject.js b/tutorial-2/pixi.js-master/src/pixi/display/DisplayObject.js deleted file mode 100755 index 58b375c..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/display/DisplayObject.js +++ /dev/null @@ -1,765 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The base class for all objects that are rendered on the screen. - * This is an abstract class and should not be used on its own rather it should be extended. - * - * @class DisplayObject - * @constructor - */ -PIXI.DisplayObject = function() -{ - /** - * The coordinate of the object relative to the local coordinates of the parent. - * - * @property position - * @type Point - */ - this.position = new PIXI.Point(); - - /** - * The scale factor of the object. - * - * @property scale - * @type Point - */ - this.scale = new PIXI.Point(1,1);//{x:1, y:1}; - - /** - * The pivot point of the displayObject that it rotates around - * - * @property pivot - * @type Point - */ - this.pivot = new PIXI.Point(0,0); - - /** - * The rotation of the object in radians. - * - * @property rotation - * @type Number - */ - this.rotation = 0; - - /** - * The opacity of the object. - * - * @property alpha - * @type Number - */ - this.alpha = 1; - - /** - * The visibility of the object. - * - * @property visible - * @type Boolean - */ - this.visible = true; - - /** - * This is the defined area that will pick up mouse / touch events. It is null by default. - * Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children) - * - * @property hitArea - * @type Rectangle|Circle|Ellipse|Polygon - */ - this.hitArea = null; - - /** - * This is used to indicate if the displayObject should display a mouse hand cursor on rollover - * - * @property buttonMode - * @type Boolean - */ - this.buttonMode = false; - - /** - * Can this object be rendered - * - * @property renderable - * @type Boolean - */ - this.renderable = false; - - /** - * [read-only] The display object container that contains this display object. - * - * @property parent - * @type DisplayObjectContainer - * @readOnly - */ - this.parent = null; - - /** - * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage. - * - * @property stage - * @type Stage - * @readOnly - */ - this.stage = null; - - /** - * [read-only] The multiplied alpha of the displayObject - * - * @property worldAlpha - * @type Number - * @readOnly - */ - this.worldAlpha = 1; - - /** - * [read-only] Whether or not the object is interactive, do not toggle directly! use the `interactive` property - * - * @property _interactive - * @type Boolean - * @readOnly - * @private - */ - this._interactive = false; - - /** - * This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true - * - * @property defaultCursor - * @type String - * - */ - this.defaultCursor = 'pointer'; - - /** - * [read-only] Current transform of the object based on world (parent) factors - * - * @property worldTransform - * @type Matrix - * @readOnly - * @private - */ - this.worldTransform = new PIXI.Matrix(); - - /** - * cached sin rotation and cos rotation - * - * @property _sr - * @type Number - * @private - */ - this._sr = 0; - - /** - * cached sin rotation and cos rotation - * - * @property _cr - * @type Number - * @private - */ - this._cr = 1; - - /** - * The area the filter is applied to like the hitArea this is used as more of an optimisation - * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle - * - * @property filterArea - * @type Rectangle - */ - this.filterArea = null;//new PIXI.Rectangle(0,0,1,1); - - /** - * The original, cached bounds of the object - * - * @property _bounds - * @type Rectangle - * @private - */ - this._bounds = new PIXI.Rectangle(0, 0, 1, 1); - - /** - * The most up-to-date bounds of the object - * - * @property _currentBounds - * @type Rectangle - * @private - */ - this._currentBounds = null; - - /** - * The original, cached mask of the object - * - * @property _currentBounds - * @type Rectangle - * @private - */ - this._mask = null; - - /** - * Cached internal flag. - * - * @property _cacheAsBitmap - * @type Boolean - * @private - */ - this._cacheAsBitmap = false; - - /** - * Cached internal flag. - * - * @property _cacheIsDirty - * @type Boolean - * @private - */ - this._cacheIsDirty = false; - - - /* - * MOUSE Callbacks - */ - - /** - * A callback that is used when the users mouse rolls over the displayObject - * @method mouseover - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the users mouse leaves the displayObject - * @method mouseout - * @param interactionData {InteractionData} - */ - - //Left button - /** - * A callback that is used when the users clicks on the displayObject with their mouse's left button - * @method click - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user clicks the mouse's left button down over the sprite - * @method mousedown - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's left button that was over the displayObject - * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject - * @method mouseup - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject - * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject - * @method mouseupoutside - * @param interactionData {InteractionData} - */ - - //Right button - /** - * A callback that is used when the users clicks on the displayObject with their mouse's right button - * @method rightclick - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user clicks the mouse's right button down over the sprite - * @method rightdown - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's right button that was over the displayObject - * for this callback to be fired the mouse's right button must have been pressed down over the displayObject - * @method rightup - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject - * for this callback to be fired, the mouse's right button must have been pressed down over the displayObject - * @method rightupoutside - * @param interactionData {InteractionData} - */ - - /* - * TOUCH Callbacks - */ - - /** - * A callback that is used when the users taps on the sprite with their finger - * basically a touch version of click - * @method tap - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user touches over the displayObject - * @method touchstart - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases a touch over the displayObject - * @method touchend - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the touch that was over the displayObject - * for this callback to be fired, The touch must have started over the sprite - * @method touchendoutside - * @param interactionData {InteractionData} - */ -}; - -// constructor -PIXI.DisplayObject.prototype.constructor = PIXI.DisplayObject; - -/** - * Indicates if the sprite will have touch and mouse interactivity. It is false by default - * - * @property interactive - * @type Boolean - * @default false - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'interactive', { - get: function() { - return this._interactive; - }, - set: function(value) { - this._interactive = value; - - // TODO more to be done here.. - // need to sort out a re-crawl! - if(this.stage)this.stage.dirty = true; - } -}); - -/** - * [read-only] Indicates if the sprite is globally visible. - * - * @property worldVisible - * @type Boolean - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'worldVisible', { - get: function() { - var item = this; - - do - { - if(!item.visible)return false; - item = item.parent; - } - while(item); - - return true; - } -}); - -/** - * Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. - * In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. - * To remove a mask, set this property to null. - * - * @property mask - * @type Graphics - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'mask', { - get: function() { - return this._mask; - }, - set: function(value) { - - if(this._mask)this._mask.isMask = false; - this._mask = value; - if(this._mask)this._mask.isMask = true; - } -}); - -/** - * Sets the filters for the displayObject. - * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. - * To remove filters simply set this property to 'null' - * @property filters - * @type Array(Filter) - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { - - get: function() { - return this._filters; - }, - - set: function(value) { - - if(value) - { - // now put all the passes in one place.. - var passes = []; - for (var i = 0; i < value.length; i++) - { - var filterPasses = value[i].passes; - for (var j = 0; j < filterPasses.length; j++) - { - passes.push(filterPasses[j]); - } - } - - // TODO change this as it is legacy - this._filterBlock = {target:this, filterPasses:passes}; - } - - this._filters = value; - } -}); - -/** - * Set if this display object is cached as a bitmap. - * This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. - * To remove simply set this property to 'null' - * @property cacheAsBitmap - * @type Boolean - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'cacheAsBitmap', { - - get: function() { - return this._cacheAsBitmap; - }, - - set: function(value) { - - if(this._cacheAsBitmap === value)return; - - if(value) - { - this._generateCachedSprite(); - } - else - { - this._destroyCachedSprite(); - } - - this._cacheAsBitmap = value; - } -}); - -/* - * Updates the object transform for rendering - * - * @method updateTransform - * @private - */ -PIXI.DisplayObject.prototype.updateTransform = function() -{ - // create some matrix refs for easy access - var pt = this.parent.worldTransform; - var wt = this.worldTransform; - - // temporary matrix variables - var a, b, c, d, tx, ty; - - // so if rotation is between 0 then we can simplify the multiplication process.. - if(this.rotation % PIXI.PI_2) - { - // check to see if the rotation is the same as the previous render. This means we only need to use sin and cos when rotation actually changes - if(this.rotation !== this.rotationCache) - { - this.rotationCache = this.rotation; - this._sr = Math.sin(this.rotation); - this._cr = Math.cos(this.rotation); - } - - // get the matrix values of the displayobject based on its transform properties.. - a = this._cr * this.scale.x; - b = this._sr * this.scale.x; - c = -this._sr * this.scale.y; - d = this._cr * this.scale.y; - tx = this.position.x; - ty = this.position.y; - - // check for pivot.. not often used so geared towards that fact! - if(this.pivot.x || this.pivot.y) - { - tx -= this.pivot.x * a + this.pivot.y * c; - ty -= this.pivot.x * b + this.pivot.y * d; - } - - // concat the parent matrix with the objects transform. - wt.a = a * pt.a + b * pt.c; - wt.b = a * pt.b + b * pt.d; - wt.c = c * pt.a + d * pt.c; - wt.d = c * pt.b + d * pt.d; - wt.tx = tx * pt.a + ty * pt.c + pt.tx; - wt.ty = tx * pt.b + ty * pt.d + pt.ty; - - - } - else - { - // lets do the fast version as we know there is no rotation.. - a = this.scale.x; - d = this.scale.y; - - tx = this.position.x - this.pivot.x * a; - ty = this.position.y - this.pivot.y * d; - - wt.a = a * pt.a; - wt.b = a * pt.b; - wt.c = d * pt.c; - wt.d = d * pt.d; - wt.tx = tx * pt.a + ty * pt.c + pt.tx; - wt.ty = tx * pt.b + ty * pt.d + pt.ty; - } - - // multiply the alphas.. - this.worldAlpha = this.alpha * this.parent.worldAlpha; -}; - -// performance increase to avoid using call.. (10x faster) -PIXI.DisplayObject.prototype.displayObjectUpdateTransform = PIXI.DisplayObject.prototype.updateTransform; - -/** - * Retrieves the bounds of the displayObject as a rectangle object - * - * @method getBounds - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area - */ -PIXI.DisplayObject.prototype.getBounds = function(matrix) -{ - matrix = matrix;//just to get passed js hinting (and preserve inheritance) - return PIXI.EmptyRectangle; -}; - -/** - * Retrieves the local bounds of the displayObject as a rectangle object - * - * @method getLocalBounds - * @return {Rectangle} the rectangular bounding area - */ -PIXI.DisplayObject.prototype.getLocalBounds = function() -{ - return this.getBounds(PIXI.identityMatrix);///PIXI.EmptyRectangle(); -}; - -/** - * Sets the object's stage reference, the stage this object is connected to - * - * @method setStageReference - * @param stage {Stage} the stage that the object will have as its current stage reference - */ -PIXI.DisplayObject.prototype.setStageReference = function(stage) -{ - this.stage = stage; - if(this._interactive)this.stage.dirty = true; -}; - -/** - * Useful function that returns a texture of the displayObject object that can then be used to create sprites - * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. - * - * @method generateTexture - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @return {Texture} a texture of the graphics object - */ -PIXI.DisplayObject.prototype.generateTexture = function(resolution, scaleMode, renderer) -{ - var bounds = this.getLocalBounds(); - - var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0, renderer, scaleMode, resolution); - - PIXI.DisplayObject._tempMatrix.tx = -bounds.x; - PIXI.DisplayObject._tempMatrix.ty = -bounds.y; - - renderTexture.render(this, PIXI.DisplayObject._tempMatrix); - - return renderTexture; -}; - -/** - * Generates and updates the cached sprite for this object. - * - * @method updateCache - */ -PIXI.DisplayObject.prototype.updateCache = function() -{ - this._generateCachedSprite(); -}; - -/** - * Calculates the global position of the display object - * - * @method toGlobal - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object - */ -PIXI.DisplayObject.prototype.toGlobal = function(position) -{ - // don't need to u[date the lot - this.displayObjectUpdateTransform(); - return this.worldTransform.apply(position); -}; - -/** - * Calculates the local position of the display object relative to another point - * - * @method toLocal - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object - */ -PIXI.DisplayObject.prototype.toLocal = function(position, from) -{ - // - if (from) - { - position = from.toGlobal(position); - } - - // don't need to u[date the lot - this.displayObjectUpdateTransform(); - return this.worldTransform.applyInverse(position); -}; - -/** - * Internal method. - * - * @method _renderCachedSprite - * @param renderSession {Object} The render session - * @private - */ -PIXI.DisplayObject.prototype._renderCachedSprite = function(renderSession) -{ - this._cachedSprite.worldAlpha = this.worldAlpha; - - if(renderSession.gl) - { - PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession); - } - else - { - PIXI.Sprite.prototype._renderCanvas.call(this._cachedSprite, renderSession); - } -}; - -/** - * Internal method. - * - * @method _generateCachedSprite - * @private - */ -PIXI.DisplayObject.prototype._generateCachedSprite = function() -{ - this._cacheAsBitmap = false; - var bounds = this.getLocalBounds(); - - if(!this._cachedSprite) - { - var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0);//, renderSession.renderer); - - this._cachedSprite = new PIXI.Sprite(renderTexture); - this._cachedSprite.worldTransform = this.worldTransform; - } - else - { - this._cachedSprite.texture.resize(bounds.width | 0, bounds.height | 0); - } - - //REMOVE filter! - var tempFilters = this._filters; - this._filters = null; - - this._cachedSprite.filters = tempFilters; - - PIXI.DisplayObject._tempMatrix.tx = -bounds.x; - PIXI.DisplayObject._tempMatrix.ty = -bounds.y; - - this._cachedSprite.texture.render(this, PIXI.DisplayObject._tempMatrix, true); - - this._cachedSprite.anchor.x = -( bounds.x / bounds.width ); - this._cachedSprite.anchor.y = -( bounds.y / bounds.height ); - - this._filters = tempFilters; - - this._cacheAsBitmap = true; -}; - -/** -* Destroys the cached sprite. -* -* @method _destroyCachedSprite -* @private -*/ -PIXI.DisplayObject.prototype._destroyCachedSprite = function() -{ - if(!this._cachedSprite)return; - - this._cachedSprite.texture.destroy(true); - - // TODO could be object pooled! - this._cachedSprite = null; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.DisplayObject.prototype._renderWebGL = function(renderSession) -{ - // OVERWRITE; - // this line is just here to pass jshinting :) - renderSession = renderSession; -}; - -/** -* Renders the object using the Canvas renderer -* -* @method _renderCanvas -* @param renderSession {RenderSession} -* @private -*/ -PIXI.DisplayObject.prototype._renderCanvas = function(renderSession) -{ - // OVERWRITE; - // this line is just here to pass jshinting :) - renderSession = renderSession; -}; - - -PIXI.DisplayObject._tempMatrix = new PIXI.Matrix(); - -/** - * The position of the displayObject on the x axis relative to the local coordinates of the parent. - * - * @property x - * @type Number - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'x', { - get: function() { - return this.position.x; - }, - set: function(value) { - this.position.x = value; - } -}); - -/** - * The position of the displayObject on the y axis relative to the local coordinates of the parent. - * - * @property y - * @type Number - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'y', { - get: function() { - return this.position.y; - }, - set: function(value) { - this.position.y = value; - } -}); diff --git a/tutorial-2/pixi.js-master/src/pixi/display/DisplayObjectContainer.js b/tutorial-2/pixi.js-master/src/pixi/display/DisplayObjectContainer.js deleted file mode 100755 index e3ccc20..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/display/DisplayObjectContainer.js +++ /dev/null @@ -1,515 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A DisplayObjectContainer represents a collection of display objects. - * It is the base class of all display objects that act as a container for other objects. - * - * @class DisplayObjectContainer - * @extends DisplayObject - * @constructor - */ -PIXI.DisplayObjectContainer = function() -{ - PIXI.DisplayObject.call( this ); - - /** - * [read-only] The array of children of this container. - * - * @property children - * @type Array(DisplayObject) - * @readOnly - */ - this.children = []; - - // fast access to update transform.. - -}; - -// constructor -PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); -PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer; - - -/** - * The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', { - get: function() { - return this.scale.x * this.getLocalBounds().width; - }, - set: function(value) { - - var width = this.getLocalBounds().width; - - if(width !== 0) - { - this.scale.x = value / width; - } - else - { - this.scale.x = 1; - } - - - this._width = value; - } -}); - -/** - * The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', { - get: function() { - return this.scale.y * this.getLocalBounds().height; - }, - set: function(value) { - - var height = this.getLocalBounds().height; - - if(height !== 0) - { - this.scale.y = value / height ; - } - else - { - this.scale.y = 1; - } - - this._height = value; - } -}); - -/** - * Adds a child to the container. - * - * @method addChild - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. - */ -PIXI.DisplayObjectContainer.prototype.addChild = function(child) -{ - return this.addChildAt(child, this.children.length); -}; - -/** - * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown - * - * @method addChildAt - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. - */ -PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) -{ - if(index >= 0 && index <= this.children.length) - { - if(child.parent) - { - child.parent.removeChild(child); - } - - child.parent = this; - - this.children.splice(index, 0, child); - - if(this.stage)child.setStageReference(this.stage); - - return child; - } - else - { - throw new Error(child + 'addChildAt: The index '+ index +' supplied is out of bounds ' + this.children.length); - } -}; - -/** - * Swaps the position of 2 Display Objects within this container. - * - * @method swapChildren - * @param child {DisplayObject} - * @param child2 {DisplayObject} - */ -PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2) -{ - if(child === child2) { - return; - } - - var index1 = this.getChildIndex(child); - var index2 = this.getChildIndex(child2); - - if(index1 < 0 || index2 < 0) { - throw new Error('swapChildren: Both the supplied DisplayObjects must be a child of the caller.'); - } - - this.children[index1] = child2; - this.children[index2] = child; - -}; - -/** - * Returns the index position of a child DisplayObject instance - * - * @method getChildIndex - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify - */ -PIXI.DisplayObjectContainer.prototype.getChildIndex = function(child) -{ - var index = this.children.indexOf(child); - if (index === -1) - { - throw new Error('The supplied DisplayObject must be a child of the caller'); - } - return index; -}; - -/** - * Changes the position of an existing child in the display object container - * - * @method setChildIndex - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object - */ -PIXI.DisplayObjectContainer.prototype.setChildIndex = function(child, index) -{ - if (index < 0 || index >= this.children.length) - { - throw new Error('The supplied index is out of bounds'); - } - var currentIndex = this.getChildIndex(child); - this.children.splice(currentIndex, 1); //remove from old position - this.children.splice(index, 0, child); //add at new position -}; - -/** - * Returns the child at the specified index - * - * @method getChildAt - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child at the given index, if any. - */ -PIXI.DisplayObjectContainer.prototype.getChildAt = function(index) -{ - if (index < 0 || index >= this.children.length) - { - throw new Error('getChildAt: Supplied index '+ index +' does not exist in the child list, or the supplied DisplayObject must be a child of the caller'); - } - return this.children[index]; - -}; - -/** - * Removes a child from the container. - * - * @method removeChild - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. - */ -PIXI.DisplayObjectContainer.prototype.removeChild = function(child) -{ - var index = this.children.indexOf( child ); - if(index === -1)return; - - return this.removeChildAt( index ); -}; - -/** - * Removes a child from the specified index position. - * - * @method removeChildAt - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. - */ -PIXI.DisplayObjectContainer.prototype.removeChildAt = function(index) -{ - var child = this.getChildAt( index ); - if(this.stage) - child.removeStageReference(); - - child.parent = undefined; - this.children.splice( index, 1 ); - return child; -}; - -/** -* Removes all children from this container that are within the begin and end indexes. -* -* @method removeChildren -* @param beginIndex {Number} The beginning position. Default value is 0. -* @param endIndex {Number} The ending position. Default value is size of the container. -*/ -PIXI.DisplayObjectContainer.prototype.removeChildren = function(beginIndex, endIndex) -{ - var begin = beginIndex || 0; - var end = typeof endIndex === 'number' ? endIndex : this.children.length; - var range = end - begin; - - if (range > 0 && range <= end) - { - var removed = this.children.splice(begin, range); - for (var i = 0; i < removed.length; i++) { - var child = removed[i]; - if(this.stage) - child.removeStageReference(); - child.parent = undefined; - } - return removed; - } - else if (range === 0 && this.children.length === 0) - { - return []; - } - else - { - throw new Error( 'removeChildren: Range Error, numeric values are outside the acceptable range' ); - } -}; - -/* - * Updates the transform on all children of this container for rendering - * - * @method updateTransform - * @private - */ -PIXI.DisplayObjectContainer.prototype.updateTransform = function() -{ - if(!this.visible)return; - - this.displayObjectUpdateTransform(); - - //PIXI.DisplayObject.prototype.updateTransform.call( this ); - - if(this._cacheAsBitmap)return; - - for(var i=0,j=this.children.length; i childMaxX ? maxX : childMaxX; - maxY = maxY > childMaxY ? maxY : childMaxY; - } - - if(!childVisible) - return PIXI.EmptyRectangle; - - var bounds = this._bounds; - - bounds.x = minX; - bounds.y = minY; - bounds.width = maxX - minX; - bounds.height = maxY - minY; - - // TODO: store a reference so that if this function gets called again in the render cycle we do not have to recalculate - //this._currentBounds = bounds; - - return bounds; -}; - -/** - * Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration. - * - * @method getLocalBounds - * @return {Rectangle} The rectangular bounding area - */ -PIXI.DisplayObjectContainer.prototype.getLocalBounds = function() -{ - var matrixCache = this.worldTransform; - - this.worldTransform = PIXI.identityMatrix; - - for(var i=0,j=this.children.length; i= this.textures.length) - { - this.gotoAndStop(this.textures.length - 1); - if(this.onComplete) - { - this.onComplete(); - } - } -}; - -/** - * A short hand way of creating a movieclip from an array of frame ids - * - * @static - * @method fromFrames - * @param frames {Array} the array of frames ids the movieclip will use as its texture frames - * @return {MovieClip} - */ -PIXI.MovieClip.fromFrames = function(frames) -{ - var textures = []; - - for (var i = 0; i < frames.length; i++) - { - textures.push(new PIXI.Texture.fromFrame(frames[i])); - } - - return new PIXI.MovieClip(textures); -}; - -/** - * A short hand way of creating a movieclip from an array of image ids - * - * @static - * @method fromImages - * @param frames {Array} the array of image ids the movieclip will use as its texture frames - * @return {MovieClip} - */ -PIXI.MovieClip.fromImages = function(images) -{ - var textures = []; - - for (var i = 0; i < images.length; i++) - { - textures.push(new PIXI.Texture.fromImage(images[i])); - } - - return new PIXI.MovieClip(textures); -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/display/Sprite.js b/tutorial-2/pixi.js-master/src/pixi/display/Sprite.js deleted file mode 100755 index aab559a..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/display/Sprite.js +++ /dev/null @@ -1,471 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Sprite object is the base for all textured objects that are rendered to the screen - * - * @class Sprite - * @extends DisplayObjectContainer - * @constructor - * @param texture {Texture} The texture for this sprite - * - * A sprite can be created directly from an image like this : - * var sprite = new PIXI.Sprite.fromImage('assets/image.png'); - * yourStage.addChild(sprite); - * then obviously don't forget to add it to the stage you have already created - */ -PIXI.Sprite = function(texture) -{ - PIXI.DisplayObjectContainer.call( this ); - - /** - * The anchor sets the origin point of the texture. - * The default is 0,0 this means the texture's origin is the top left - * Setting than anchor to 0.5,0.5 means the textures origin is centered - * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner - * - * @property anchor - * @type Point - */ - this.anchor = new PIXI.Point(); - - /** - * The texture that the sprite is using - * - * @property texture - * @type Texture - */ - this.texture = texture || PIXI.Texture.emptyTexture; - - /** - * The width of the sprite (this is initially set by the texture) - * - * @property _width - * @type Number - * @private - */ - this._width = 0; - - /** - * The height of the sprite (this is initially set by the texture) - * - * @property _height - * @type Number - * @private - */ - this._height = 0; - - /** - * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. - * - * @property tint - * @type Number - * @default 0xFFFFFF - */ - this.tint = 0xFFFFFF; - - /** - * The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode. - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - /** - * The shader that will be used to render the texture to the stage. Set to null to remove a current shader. - * - * @property shader - * @type AbstractFilter - * @default null - */ - this.shader = null; - - if(this.texture.baseTexture.hasLoaded) - { - this.onTextureUpdate(); - } - else - { - this.texture.on( 'update', this.onTextureUpdate.bind(this) ); - } - - this.renderable = true; - -}; - -// constructor -PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); -PIXI.Sprite.prototype.constructor = PIXI.Sprite; - -/** - * The width of the sprite, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.Sprite.prototype, 'width', { - get: function() { - return this.scale.x * this.texture.frame.width; - }, - set: function(value) { - this.scale.x = value / this.texture.frame.width; - this._width = value; - } -}); - -/** - * The height of the sprite, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.Sprite.prototype, 'height', { - get: function() { - return this.scale.y * this.texture.frame.height; - }, - set: function(value) { - this.scale.y = value / this.texture.frame.height; - this._height = value; - } -}); - -/** - * Sets the texture of the sprite - * - * @method setTexture - * @param texture {Texture} The PIXI texture that is displayed by the sprite - */ -PIXI.Sprite.prototype.setTexture = function(texture) -{ - this.texture = texture; - this.cachedTint = 0xFFFFFF; -}; - -/** - * When the texture is updated, this event will fire to update the scale and frame - * - * @method onTextureUpdate - * @param event - * @private - */ -PIXI.Sprite.prototype.onTextureUpdate = function() -{ - // so if _width is 0 then width was not set.. - if(this._width)this.scale.x = this._width / this.texture.frame.width; - if(this._height)this.scale.y = this._height / this.texture.frame.height; - - //this.updateFrame = true; -}; - -/** -* Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. -* -* @method getBounds -* @param matrix {Matrix} the transformation matrix of the sprite -* @return {Rectangle} the framing rectangle -*/ -PIXI.Sprite.prototype.getBounds = function(matrix) -{ - var width = this.texture.frame.width; - var height = this.texture.frame.height; - - var w0 = width * (1-this.anchor.x); - var w1 = width * -this.anchor.x; - - var h0 = height * (1-this.anchor.y); - var h1 = height * -this.anchor.y; - - var worldTransform = matrix || this.worldTransform ; - - var a = worldTransform.a; - var b = worldTransform.b; - var c = worldTransform.c; - var d = worldTransform.d; - var tx = worldTransform.tx; - var ty = worldTransform.ty; - - var maxX = -Infinity; - var maxY = -Infinity; - - var minX = Infinity; - var minY = Infinity; - - if(b === 0 && c === 0) - { - // scale may be negative! - if(a < 0)a *= -1; - if(d < 0)d *= -1; - - // this means there is no rotation going on right? RIGHT? - // if thats the case then we can avoid checking the bound values! yay - minX = a * w1 + tx; - maxX = a * w0 + tx; - minY = d * h1 + ty; - maxY = d * h0 + ty; - } - else - { - var x1 = a * w1 + c * h1 + tx; - var y1 = d * h1 + b * w1 + ty; - - var x2 = a * w0 + c * h1 + tx; - var y2 = d * h1 + b * w0 + ty; - - var x3 = a * w0 + c * h0 + tx; - var y3 = d * h0 + b * w0 + ty; - - var x4 = a * w1 + c * h0 + tx; - var y4 = d * h0 + b * w1 + ty; - - minX = x1 < minX ? x1 : minX; - minX = x2 < minX ? x2 : minX; - minX = x3 < minX ? x3 : minX; - minX = x4 < minX ? x4 : minX; - - minY = y1 < minY ? y1 : minY; - minY = y2 < minY ? y2 : minY; - minY = y3 < minY ? y3 : minY; - minY = y4 < minY ? y4 : minY; - - maxX = x1 > maxX ? x1 : maxX; - maxX = x2 > maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y1 > maxY ? y1 : maxY; - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - } - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Sprite.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(!this.visible || this.alpha <= 0)return; - - var i,j; - - // do a quick check to see if this element has a mask or a filter. - if(this._mask || this._filters) - { - var spriteBatch = renderSession.spriteBatch; - - // push filter first as we need to ensure the stencil buffer is correct for any masking - if(this._filters) - { - spriteBatch.flush(); - renderSession.filterManager.pushFilter(this._filterBlock); - } - - if(this._mask) - { - spriteBatch.stop(); - renderSession.maskManager.pushMask(this.mask, renderSession); - spriteBatch.start(); - } - - // add this sprite to the batch - spriteBatch.render(this); - - // now loop through the children and make sure they get rendered - for(i=0,j=this.children.length; i 1) ratio = 1; - - perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y); - num = this.texture.height / 2; //(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio; - perp.x /= perpLength; - perp.y /= perpLength; - - perp.x *= num; - perp.y *= num; - - vertices[index] = point.x + perp.x; - vertices[index+1] = point.y + perp.y; - vertices[index+2] = point.x - perp.x; - vertices[index+3] = point.y - perp.y; - - lastPoint = point; - } - - PIXI.DisplayObjectContainer.prototype.updateTransform.call( this ); -}; -/* - * Sets the texture that the Rope will use - * - * @method setTexture - * @param texture {Texture} the texture that will be used - */ -PIXI.Rope.prototype.setTexture = function(texture) -{ - // stop current texture - this.texture = texture; - //this.updateFrame = true; -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/extras/SPINE-LICENSE b/tutorial-2/pixi.js-master/src/pixi/extras/SPINE-LICENSE deleted file mode 100755 index 7bb7566..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/extras/SPINE-LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Spine Runtimes Software License -Version 2.1 - -Copyright (c) 2013, Esoteric Software -All rights reserved. - -You are granted a perpetual, non-exclusive, non-sublicensable and -non-transferable license to install, execute and perform the Spine Runtimes -Software (the "Software") solely for internal use. Without the written -permission of Esoteric Software (typically granted by licensing Spine), you -may not (a) modify, translate, adapt or otherwise create derivative works, -improvements of the Software or develop new applications using the Software -or (b) remove, delete, alter or obscure any trademarks or any copyright, -trademark, patent or other intellectual property or proprietary rights notices -on or in the Software, including any copy thereof. Redistributions in binary -or source form must include this license and terms. - -THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tutorial-2/pixi.js-master/src/pixi/extras/Spine.js b/tutorial-2/pixi.js-master/src/pixi/extras/Spine.js deleted file mode 100755 index 06ce610..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/extras/Spine.js +++ /dev/null @@ -1,2626 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License - * Version 2.1 - * - * Copyright (c) 2013, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable and - * non-transferable license to install, execute and perform the Spine Runtimes - * Software (the "Software") solely for internal use. Without the written - * permission of Esoteric Software (typically granted by licensing Spine), you - * may not (a) modify, translate, adapt or otherwise create derivative works, - * improvements of the Software or develop new applications using the Software - * or (b) remove, delete, alter or obscure any trademarks or any copyright, - * trademark, patent or other intellectual property or proprietary rights - * notices on or in the Software, including any copy thereof. Redistributions - * in binary or source form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -var spine = { - radDeg: 180 / Math.PI, - degRad: Math.PI / 180, - temp: [], - Float32Array: (typeof(Float32Array) === 'undefined') ? Array : Float32Array, - Uint16Array: (typeof(Uint16Array) === 'undefined') ? Array : Uint16Array -}; - -spine.BoneData = function (name, parent) { - this.name = name; - this.parent = parent; -}; -spine.BoneData.prototype = { - length: 0, - x: 0, y: 0, - rotation: 0, - scaleX: 1, scaleY: 1, - inheritScale: true, - inheritRotation: true, - flipX: false, flipY: false -}; - -spine.SlotData = function (name, boneData) { - this.name = name; - this.boneData = boneData; -}; -spine.SlotData.prototype = { - r: 1, g: 1, b: 1, a: 1, - attachmentName: null, - additiveBlending: false -}; - -spine.IkConstraintData = function (name) { - this.name = name; - this.bones = []; -}; -spine.IkConstraintData.prototype = { - target: null, - bendDirection: 1, - mix: 1 -}; - -spine.Bone = function (boneData, skeleton, parent) { - this.data = boneData; - this.skeleton = skeleton; - this.parent = parent; - this.setToSetupPose(); -}; -spine.Bone.yDown = false; -spine.Bone.prototype = { - x: 0, y: 0, - rotation: 0, rotationIK: 0, - scaleX: 1, scaleY: 1, - flipX: false, flipY: false, - m00: 0, m01: 0, worldX: 0, // a b x - m10: 0, m11: 0, worldY: 0, // c d y - worldRotation: 0, - worldScaleX: 1, worldScaleY: 1, - worldFlipX: false, worldFlipY: false, - updateWorldTransform: function () { - var parent = this.parent; - if (parent) { - this.worldX = this.x * parent.m00 + this.y * parent.m01 + parent.worldX; - this.worldY = this.x * parent.m10 + this.y * parent.m11 + parent.worldY; - if (this.data.inheritScale) { - this.worldScaleX = parent.worldScaleX * this.scaleX; - this.worldScaleY = parent.worldScaleY * this.scaleY; - } else { - this.worldScaleX = this.scaleX; - this.worldScaleY = this.scaleY; - } - this.worldRotation = this.data.inheritRotation ? (parent.worldRotation + this.rotationIK) : this.rotationIK; - this.worldFlipX = parent.worldFlipX != this.flipX; - this.worldFlipY = parent.worldFlipY != this.flipY; - } else { - var skeletonFlipX = this.skeleton.flipX, skeletonFlipY = this.skeleton.flipY; - this.worldX = skeletonFlipX ? -this.x : this.x; - this.worldY = (skeletonFlipY != spine.Bone.yDown) ? -this.y : this.y; - this.worldScaleX = this.scaleX; - this.worldScaleY = this.scaleY; - this.worldRotation = this.rotationIK; - this.worldFlipX = skeletonFlipX != this.flipX; - this.worldFlipY = skeletonFlipY != this.flipY; - } - var radians = this.worldRotation * spine.degRad; - var cos = Math.cos(radians); - var sin = Math.sin(radians); - if (this.worldFlipX) { - this.m00 = -cos * this.worldScaleX; - this.m01 = sin * this.worldScaleY; - } else { - this.m00 = cos * this.worldScaleX; - this.m01 = -sin * this.worldScaleY; - } - if (this.worldFlipY != spine.Bone.yDown) { - this.m10 = -sin * this.worldScaleX; - this.m11 = -cos * this.worldScaleY; - } else { - this.m10 = sin * this.worldScaleX; - this.m11 = cos * this.worldScaleY; - } - }, - setToSetupPose: function () { - var data = this.data; - this.x = data.x; - this.y = data.y; - this.rotation = data.rotation; - this.rotationIK = this.rotation; - this.scaleX = data.scaleX; - this.scaleY = data.scaleY; - this.flipX = data.flipX; - this.flipY = data.flipY; - }, - worldToLocal: function (world) { - var dx = world[0] - this.worldX, dy = world[1] - this.worldY; - var m00 = this.m00, m10 = this.m10, m01 = this.m01, m11 = this.m11; - if (this.worldFlipX != (this.worldFlipY != spine.Bone.yDown)) { - m00 = -m00; - m11 = -m11; - } - var invDet = 1 / (m00 * m11 - m01 * m10); - world[0] = dx * m00 * invDet - dy * m01 * invDet; - world[1] = dy * m11 * invDet - dx * m10 * invDet; - }, - localToWorld: function (local) { - var localX = local[0], localY = local[1]; - local[0] = localX * this.m00 + localY * this.m01 + this.worldX; - local[1] = localX * this.m10 + localY * this.m11 + this.worldY; - } -}; - -spine.Slot = function (slotData, bone) { - this.data = slotData; - this.bone = bone; - this.setToSetupPose(); -}; -spine.Slot.prototype = { - r: 1, g: 1, b: 1, a: 1, - _attachmentTime: 0, - attachment: null, - attachmentVertices: [], - setAttachment: function (attachment) { - this.attachment = attachment; - this._attachmentTime = this.bone.skeleton.time; - this.attachmentVertices.length = 0; - }, - setAttachmentTime: function (time) { - this._attachmentTime = this.bone.skeleton.time - time; - }, - getAttachmentTime: function () { - return this.bone.skeleton.time - this._attachmentTime; - }, - setToSetupPose: function () { - var data = this.data; - this.r = data.r; - this.g = data.g; - this.b = data.b; - this.a = data.a; - - var slotDatas = this.bone.skeleton.data.slots; - for (var i = 0, n = slotDatas.length; i < n; i++) { - if (slotDatas[i] == data) { - this.setAttachment(!data.attachmentName ? null : this.bone.skeleton.getAttachmentBySlotIndex(i, data.attachmentName)); - break; - } - } - } -}; - -spine.IkConstraint = function (data, skeleton) { - this.data = data; - this.mix = data.mix; - this.bendDirection = data.bendDirection; - - this.bones = []; - for (var i = 0, n = data.bones.length; i < n; i++) - this.bones.push(skeleton.findBone(data.bones[i].name)); - this.target = skeleton.findBone(data.target.name); -}; -spine.IkConstraint.prototype = { - apply: function () { - var target = this.target; - var bones = this.bones; - switch (bones.length) { - case 1: - spine.IkConstraint.apply1(bones[0], target.worldX, target.worldY, this.mix); - break; - case 2: - spine.IkConstraint.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.mix); - break; - } - } -}; -/** Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified in the world - * coordinate system. */ -spine.IkConstraint.apply1 = function (bone, targetX, targetY, alpha) { - var parentRotation = (!bone.data.inheritRotation || !bone.parent) ? 0 : bone.parent.worldRotation; - var rotation = bone.rotation; - var rotationIK = Math.atan2(targetY - bone.worldY, targetX - bone.worldX) * spine.radDeg - parentRotation; - bone.rotationIK = rotation + (rotationIK - rotation) * alpha; -}; -/** Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as possible. The - * target is specified in the world coordinate system. - * @param child Any descendant bone of the parent. */ -spine.IkConstraint.apply2 = function (parent, child, targetX, targetY, bendDirection, alpha) { - var childRotation = child.rotation, parentRotation = parent.rotation; - if (!alpha) { - child.rotationIK = childRotation; - parent.rotationIK = parentRotation; - return; - } - var positionX, positionY, tempPosition = spine.temp; - var parentParent = parent.parent; - if (parentParent) { - tempPosition[0] = targetX; - tempPosition[1] = targetY; - parentParent.worldToLocal(tempPosition); - targetX = (tempPosition[0] - parent.x) * parentParent.worldScaleX; - targetY = (tempPosition[1] - parent.y) * parentParent.worldScaleY; - } else { - targetX -= parent.x; - targetY -= parent.y; - } - if (child.parent == parent) { - positionX = child.x; - positionY = child.y; - } else { - tempPosition[0] = child.x; - tempPosition[1] = child.y; - child.parent.localToWorld(tempPosition); - parent.worldToLocal(tempPosition); - positionX = tempPosition[0]; - positionY = tempPosition[1]; - } - var childX = positionX * parent.worldScaleX, childY = positionY * parent.worldScaleY; - var offset = Math.atan2(childY, childX); - var len1 = Math.sqrt(childX * childX + childY * childY), len2 = child.data.length * child.worldScaleX; - // Based on code by Ryan Juckett with permission: Copyright (c) 2008-2009 Ryan Juckett, http://www.ryanjuckett.com/ - var cosDenom = 2 * len1 * len2; - if (cosDenom < 0.0001) { - child.rotationIK = childRotation + (Math.atan2(targetY, targetX) * spine.radDeg - parentRotation - childRotation) * alpha; - return; - } - var cos = (targetX * targetX + targetY * targetY - len1 * len1 - len2 * len2) / cosDenom; - if (cos < -1) - cos = -1; - else if (cos > 1) - cos = 1; - var childAngle = Math.acos(cos) * bendDirection; - var adjacent = len1 + len2 * cos, opposite = len2 * Math.sin(childAngle); - var parentAngle = Math.atan2(targetY * adjacent - targetX * opposite, targetX * adjacent + targetY * opposite); - var rotation = (parentAngle - offset) * spine.radDeg - parentRotation; - if (rotation > 180) - rotation -= 360; - else if (rotation < -180) // - rotation += 360; - parent.rotationIK = parentRotation + rotation * alpha; - rotation = (childAngle + offset) * spine.radDeg - childRotation; - if (rotation > 180) - rotation -= 360; - else if (rotation < -180) // - rotation += 360; - child.rotationIK = childRotation + (rotation + parent.worldRotation - child.parent.worldRotation) * alpha; -}; - -spine.Skin = function (name) { - this.name = name; - this.attachments = {}; -}; -spine.Skin.prototype = { - addAttachment: function (slotIndex, name, attachment) { - this.attachments[slotIndex + ":" + name] = attachment; - }, - getAttachment: function (slotIndex, name) { - return this.attachments[slotIndex + ":" + name]; - }, - _attachAll: function (skeleton, oldSkin) { - for (var key in oldSkin.attachments) { - var colon = key.indexOf(":"); - var slotIndex = parseInt(key.substring(0, colon)); - var name = key.substring(colon + 1); - var slot = skeleton.slots[slotIndex]; - if (slot.attachment && slot.attachment.name == name) { - var attachment = this.getAttachment(slotIndex, name); - if (attachment) slot.setAttachment(attachment); - } - } - } -}; - -spine.Animation = function (name, timelines, duration) { - this.name = name; - this.timelines = timelines; - this.duration = duration; -}; -spine.Animation.prototype = { - apply: function (skeleton, lastTime, time, loop, events) { - if (loop && this.duration != 0) { - time %= this.duration; - lastTime %= this.duration; - } - var timelines = this.timelines; - for (var i = 0, n = timelines.length; i < n; i++) - timelines[i].apply(skeleton, lastTime, time, events, 1); - }, - mix: function (skeleton, lastTime, time, loop, events, alpha) { - if (loop && this.duration != 0) { - time %= this.duration; - lastTime %= this.duration; - } - var timelines = this.timelines; - for (var i = 0, n = timelines.length; i < n; i++) - timelines[i].apply(skeleton, lastTime, time, events, alpha); - } -}; -spine.Animation.binarySearch = function (values, target, step) { - var low = 0; - var high = Math.floor(values.length / step) - 2; - if (!high) return step; - var current = high >>> 1; - while (true) { - if (values[(current + 1) * step] <= target) - low = current + 1; - else - high = current; - if (low == high) return (low + 1) * step; - current = (low + high) >>> 1; - } -}; -spine.Animation.binarySearch1 = function (values, target) { - var low = 0; - var high = values.length - 2; - if (!high) return 1; - var current = high >>> 1; - while (true) { - if (values[current + 1] <= target) - low = current + 1; - else - high = current; - if (low == high) return low + 1; - current = (low + high) >>> 1; - } -}; -spine.Animation.linearSearch = function (values, target, step) { - for (var i = 0, last = values.length - step; i <= last; i += step) - if (values[i] > target) return i; - return -1; -}; - -spine.Curves = function (frameCount) { - this.curves = []; // type, x, y, ... - //this.curves.length = (frameCount - 1) * 19/*BEZIER_SIZE*/; -}; -spine.Curves.prototype = { - setLinear: function (frameIndex) { - this.curves[frameIndex * 19/*BEZIER_SIZE*/] = 0/*LINEAR*/; - }, - setStepped: function (frameIndex) { - this.curves[frameIndex * 19/*BEZIER_SIZE*/] = 1/*STEPPED*/; - }, - /** Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next. - * cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of - * the difference between the keyframe's values. */ - setCurve: function (frameIndex, cx1, cy1, cx2, cy2) { - var subdiv1 = 1 / 10/*BEZIER_SEGMENTS*/, subdiv2 = subdiv1 * subdiv1, subdiv3 = subdiv2 * subdiv1; - var pre1 = 3 * subdiv1, pre2 = 3 * subdiv2, pre4 = 6 * subdiv2, pre5 = 6 * subdiv3; - var tmp1x = -cx1 * 2 + cx2, tmp1y = -cy1 * 2 + cy2, tmp2x = (cx1 - cx2) * 3 + 1, tmp2y = (cy1 - cy2) * 3 + 1; - var dfx = cx1 * pre1 + tmp1x * pre2 + tmp2x * subdiv3, dfy = cy1 * pre1 + tmp1y * pre2 + tmp2y * subdiv3; - var ddfx = tmp1x * pre4 + tmp2x * pre5, ddfy = tmp1y * pre4 + tmp2y * pre5; - var dddfx = tmp2x * pre5, dddfy = tmp2y * pre5; - - var i = frameIndex * 19/*BEZIER_SIZE*/; - var curves = this.curves; - curves[i++] = 2/*BEZIER*/; - - var x = dfx, y = dfy; - for (var n = i + 19/*BEZIER_SIZE*/ - 1; i < n; i += 2) { - curves[i] = x; - curves[i + 1] = y; - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - x += dfx; - y += dfy; - } - }, - getCurvePercent: function (frameIndex, percent) { - percent = percent < 0 ? 0 : (percent > 1 ? 1 : percent); - var curves = this.curves; - var i = frameIndex * 19/*BEZIER_SIZE*/; - var type = curves[i]; - if (type === 0/*LINEAR*/) return percent; - if (type == 1/*STEPPED*/) return 0; - i++; - var x = 0; - for (var start = i, n = i + 19/*BEZIER_SIZE*/ - 1; i < n; i += 2) { - x = curves[i]; - if (x >= percent) { - var prevX, prevY; - if (i == start) { - prevX = 0; - prevY = 0; - } else { - prevX = curves[i - 2]; - prevY = curves[i - 1]; - } - return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX); - } - } - var y = curves[i - 1]; - return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1. - } -}; - -spine.RotateTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, angle, ... - this.frames.length = frameCount * 2; -}; -spine.RotateTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, angle) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = angle; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 2]) { // Time is after last frame. - var amount = bone.data.rotation + frames[frames.length - 1] - bone.rotation; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - bone.rotation += amount * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 2); - var prevFrameValue = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 2/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 2 - 1, percent); - - var amount = frames[frameIndex + 1/*FRAME_VALUE*/] - prevFrameValue; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - amount = bone.data.rotation + (prevFrameValue + amount * percent) - bone.rotation; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - bone.rotation += amount * alpha; - } -}; - -spine.TranslateTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, x, y, ... - this.frames.length = frameCount * 3; -}; -spine.TranslateTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, x, y) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = x; - this.frames[frameIndex + 2] = y; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - bone.x += (bone.data.x + frames[frames.length - 2] - bone.x) * alpha; - bone.y += (bone.data.y + frames[frames.length - 1] - bone.y) * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameX = frames[frameIndex - 2]; - var prevFrameY = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - bone.x += (bone.data.x + prevFrameX + (frames[frameIndex + 1/*FRAME_X*/] - prevFrameX) * percent - bone.x) * alpha; - bone.y += (bone.data.y + prevFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - prevFrameY) * percent - bone.y) * alpha; - } -}; - -spine.ScaleTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, x, y, ... - this.frames.length = frameCount * 3; -}; -spine.ScaleTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, x, y) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = x; - this.frames[frameIndex + 2] = y; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - bone.scaleX += (bone.data.scaleX * frames[frames.length - 2] - bone.scaleX) * alpha; - bone.scaleY += (bone.data.scaleY * frames[frames.length - 1] - bone.scaleY) * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameX = frames[frameIndex - 2]; - var prevFrameY = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - bone.scaleX += (bone.data.scaleX * (prevFrameX + (frames[frameIndex + 1/*FRAME_X*/] - prevFrameX) * percent) - bone.scaleX) * alpha; - bone.scaleY += (bone.data.scaleY * (prevFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - prevFrameY) * percent) - bone.scaleY) * alpha; - } -}; - -spine.ColorTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, r, g, b, a, ... - this.frames.length = frameCount * 5; -}; -spine.ColorTimeline.prototype = { - slotIndex: 0, - getFrameCount: function () { - return this.frames.length / 5; - }, - setFrame: function (frameIndex, time, r, g, b, a) { - frameIndex *= 5; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = r; - this.frames[frameIndex + 2] = g; - this.frames[frameIndex + 3] = b; - this.frames[frameIndex + 4] = a; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var r, g, b, a; - if (time >= frames[frames.length - 5]) { - // Time is after last frame. - var i = frames.length - 1; - r = frames[i - 3]; - g = frames[i - 2]; - b = frames[i - 1]; - a = frames[i]; - } else { - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 5); - var prevFrameR = frames[frameIndex - 4]; - var prevFrameG = frames[frameIndex - 3]; - var prevFrameB = frames[frameIndex - 2]; - var prevFrameA = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 5/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 5 - 1, percent); - - r = prevFrameR + (frames[frameIndex + 1/*FRAME_R*/] - prevFrameR) * percent; - g = prevFrameG + (frames[frameIndex + 2/*FRAME_G*/] - prevFrameG) * percent; - b = prevFrameB + (frames[frameIndex + 3/*FRAME_B*/] - prevFrameB) * percent; - a = prevFrameA + (frames[frameIndex + 4/*FRAME_A*/] - prevFrameA) * percent; - } - var slot = skeleton.slots[this.slotIndex]; - if (alpha < 1) { - slot.r += (r - slot.r) * alpha; - slot.g += (g - slot.g) * alpha; - slot.b += (b - slot.b) * alpha; - slot.a += (a - slot.a) * alpha; - } else { - slot.r = r; - slot.g = g; - slot.b = b; - slot.a = a; - } - } -}; - -spine.AttachmentTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, ... - this.frames.length = frameCount; - this.attachmentNames = []; - this.attachmentNames.length = frameCount; -}; -spine.AttachmentTimeline.prototype = { - slotIndex: 0, - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, attachmentName) { - this.frames[frameIndex] = time; - this.attachmentNames[frameIndex] = attachmentName; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - - var frameIndex = time >= frames[frames.length - 1] ? frames.length - 1 : spine.Animation.binarySearch1(frames, time) - 1; - if (frames[frameIndex] < lastTime) return; - - var attachmentName = this.attachmentNames[frameIndex]; - skeleton.slots[this.slotIndex].setAttachment( - !attachmentName ? null : skeleton.getAttachmentBySlotIndex(this.slotIndex, attachmentName)); - } -}; - -spine.EventTimeline = function (frameCount) { - this.frames = []; // time, ... - this.frames.length = frameCount; - this.events = []; - this.events.length = frameCount; -}; -spine.EventTimeline.prototype = { - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, event) { - this.frames[frameIndex] = time; - this.events[frameIndex] = event; - }, - /** Fires events for frames > lastTime and <= time. */ - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - if (!firedEvents) return; - - var frames = this.frames; - var frameCount = frames.length; - - if (lastTime > time) { // Fire events after last time for looped animations. - this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha); - lastTime = -1; - } else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame. - return; - if (time < frames[0]) return; // Time is before first frame. - - var frameIndex; - if (lastTime < frames[0]) - frameIndex = 0; - else { - frameIndex = spine.Animation.binarySearch1(frames, lastTime); - var frame = frames[frameIndex]; - while (frameIndex > 0) { // Fire multiple events with the same frame. - if (frames[frameIndex - 1] != frame) break; - frameIndex--; - } - } - var events = this.events; - for (; frameIndex < frameCount && time >= frames[frameIndex]; frameIndex++) - firedEvents.push(events[frameIndex]); - } -}; - -spine.DrawOrderTimeline = function (frameCount) { - this.frames = []; // time, ... - this.frames.length = frameCount; - this.drawOrders = []; - this.drawOrders.length = frameCount; -}; -spine.DrawOrderTimeline.prototype = { - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, drawOrder) { - this.frames[frameIndex] = time; - this.drawOrders[frameIndex] = drawOrder; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var frameIndex; - if (time >= frames[frames.length - 1]) // Time is after last frame. - frameIndex = frames.length - 1; - else - frameIndex = spine.Animation.binarySearch1(frames, time) - 1; - - var drawOrder = skeleton.drawOrder; - var slots = skeleton.slots; - var drawOrderToSetupIndex = this.drawOrders[frameIndex]; - if (!drawOrderToSetupIndex) { - for (var i = 0, n = slots.length; i < n; i++) - drawOrder[i] = slots[i]; - } else { - for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++) - drawOrder[i] = skeleton.slots[drawOrderToSetupIndex[i]]; - } - - } -}; - -spine.FfdTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; - this.frames.length = frameCount; - this.frameVertices = []; - this.frameVertices.length = frameCount; -}; -spine.FfdTimeline.prototype = { - slotIndex: 0, - attachment: 0, - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, vertices) { - this.frames[frameIndex] = time; - this.frameVertices[frameIndex] = vertices; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var slot = skeleton.slots[this.slotIndex]; - if (slot.attachment != this.attachment) return; - - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var frameVertices = this.frameVertices; - var vertexCount = frameVertices[0].length; - - var vertices = slot.attachmentVertices; - if (vertices.length != vertexCount) alpha = 1; - vertices.length = vertexCount; - - if (time >= frames[frames.length - 1]) { // Time is after last frame. - var lastVertices = frameVertices[frames.length - 1]; - if (alpha < 1) { - for (var i = 0; i < vertexCount; i++) - vertices[i] += (lastVertices[i] - vertices[i]) * alpha; - } else { - for (var i = 0; i < vertexCount; i++) - vertices[i] = lastVertices[i]; - } - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch1(frames, time); - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 1] - frameTime); - percent = this.curves.getCurvePercent(frameIndex - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent)); - - var prevVertices = frameVertices[frameIndex - 1]; - var nextVertices = frameVertices[frameIndex]; - - if (alpha < 1) { - for (var i = 0; i < vertexCount; i++) { - var prev = prevVertices[i]; - vertices[i] += (prev + (nextVertices[i] - prev) * percent - vertices[i]) * alpha; - } - } else { - for (var i = 0; i < vertexCount; i++) { - var prev = prevVertices[i]; - vertices[i] = prev + (nextVertices[i] - prev) * percent; - } - } - } -}; - -spine.IkConstraintTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, mix, bendDirection, ... - this.frames.length = frameCount * 3; -}; -spine.IkConstraintTimeline.prototype = { - ikConstraintIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, mix, bendDirection) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = mix; - this.frames[frameIndex + 2] = bendDirection; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var ikConstraint = skeleton.ikConstraints[this.ikConstraintIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - ikConstraint.mix += (frames[frames.length - 2] - ikConstraint.mix) * alpha; - ikConstraint.bendDirection = frames[frames.length - 1]; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameMix = frames[frameIndex + -2/*PREV_FRAME_MIX*/]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - var mix = prevFrameMix + (frames[frameIndex + 1/*FRAME_MIX*/] - prevFrameMix) * percent; - ikConstraint.mix += (mix - ikConstraint.mix) * alpha; - ikConstraint.bendDirection = frames[frameIndex + -1/*PREV_FRAME_BEND_DIRECTION*/]; - } -}; - -spine.FlipXTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, flip, ... - this.frames.length = frameCount * 2; -}; -spine.FlipXTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, flip) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = flip ? 1 : 0; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - var frameIndex = (time >= frames[frames.length - 2] ? frames.length : spine.Animation.binarySearch(frames, time, 2)) - 2; - if (frames[frameIndex] < lastTime) return; - skeleton.bones[boneIndex].flipX = frames[frameIndex + 1] != 0; - } -}; - -spine.FlipYTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, flip, ... - this.frames.length = frameCount * 2; -}; -spine.FlipYTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, flip) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = flip ? 1 : 0; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - var frameIndex = (time >= frames[frames.length - 2] ? frames.length : spine.Animation.binarySearch(frames, time, 2)) - 2; - if (frames[frameIndex] < lastTime) return; - skeleton.bones[boneIndex].flipY = frames[frameIndex + 1] != 0; - } -}; - -spine.SkeletonData = function () { - this.bones = []; - this.slots = []; - this.skins = []; - this.events = []; - this.animations = []; - this.ikConstraints = []; -}; -spine.SkeletonData.prototype = { - name: null, - defaultSkin: null, - width: 0, height: 0, - version: null, hash: null, - /** @return May be null. */ - findBone: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].name == boneName) return bones[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findBoneIndex: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].name == boneName) return i; - return -1; - }, - /** @return May be null. */ - findSlot: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - if (slots[i].name == slotName) return slot[i]; - } - return null; - }, - /** @return -1 if the bone was not found. */ - findSlotIndex: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].name == slotName) return i; - return -1; - }, - /** @return May be null. */ - findSkin: function (skinName) { - var skins = this.skins; - for (var i = 0, n = skins.length; i < n; i++) - if (skins[i].name == skinName) return skins[i]; - return null; - }, - /** @return May be null. */ - findEvent: function (eventName) { - var events = this.events; - for (var i = 0, n = events.length; i < n; i++) - if (events[i].name == eventName) return events[i]; - return null; - }, - /** @return May be null. */ - findAnimation: function (animationName) { - var animations = this.animations; - for (var i = 0, n = animations.length; i < n; i++) - if (animations[i].name == animationName) return animations[i]; - return null; - }, - /** @return May be null. */ - findIkConstraint: function (ikConstraintName) { - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) - if (ikConstraints[i].name == ikConstraintName) return ikConstraints[i]; - return null; - } -}; - -spine.Skeleton = function (skeletonData) { - this.data = skeletonData; - - this.bones = []; - for (var i = 0, n = skeletonData.bones.length; i < n; i++) { - var boneData = skeletonData.bones[i]; - var parent = !boneData.parent ? null : this.bones[skeletonData.bones.indexOf(boneData.parent)]; - this.bones.push(new spine.Bone(boneData, this, parent)); - } - - this.slots = []; - this.drawOrder = []; - for (var i = 0, n = skeletonData.slots.length; i < n; i++) { - var slotData = skeletonData.slots[i]; - var bone = this.bones[skeletonData.bones.indexOf(slotData.boneData)]; - var slot = new spine.Slot(slotData, bone); - this.slots.push(slot); - this.drawOrder.push(slot); - } - - this.ikConstraints = []; - for (var i = 0, n = skeletonData.ikConstraints.length; i < n; i++) - this.ikConstraints.push(new spine.IkConstraint(skeletonData.ikConstraints[i], this)); - - this.boneCache = []; - this.updateCache(); -}; -spine.Skeleton.prototype = { - x: 0, y: 0, - skin: null, - r: 1, g: 1, b: 1, a: 1, - time: 0, - flipX: false, flipY: false, - /** Caches information about bones and IK constraints. Must be called if bones or IK constraints are added or removed. */ - updateCache: function () { - var ikConstraints = this.ikConstraints; - var ikConstraintsCount = ikConstraints.length; - - var arrayCount = ikConstraintsCount + 1; - var boneCache = this.boneCache; - if (boneCache.length > arrayCount) boneCache.length = arrayCount; - for (var i = 0, n = boneCache.length; i < n; i++) - boneCache[i].length = 0; - while (boneCache.length < arrayCount) - boneCache[boneCache.length] = []; - - var nonIkBones = boneCache[0]; - var bones = this.bones; - - outer: - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - var current = bone; - do { - for (var ii = 0; ii < ikConstraintsCount; ii++) { - var ikConstraint = ikConstraints[ii]; - var parent = ikConstraint.bones[0]; - var child= ikConstraint.bones[ikConstraint.bones.length - 1]; - while (true) { - if (current == child) { - boneCache[ii].push(bone); - boneCache[ii + 1].push(bone); - continue outer; - } - if (child == parent) break; - child = child.parent; - } - } - current = current.parent; - } while (current); - nonIkBones[nonIkBones.length] = bone; - } - }, - /** Updates the world transform for each bone. */ - updateWorldTransform: function () { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - bone.rotationIK = bone.rotation; - } - var i = 0, last = this.boneCache.length - 1; - while (true) { - var cacheBones = this.boneCache[i]; - for (var ii = 0, nn = cacheBones.length; ii < nn; ii++) - cacheBones[ii].updateWorldTransform(); - if (i == last) break; - this.ikConstraints[i].apply(); - i++; - } - }, - /** Sets the bones and slots to their setup pose values. */ - setToSetupPose: function () { - this.setBonesToSetupPose(); - this.setSlotsToSetupPose(); - }, - setBonesToSetupPose: function () { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - bones[i].setToSetupPose(); - - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) { - var ikConstraint = ikConstraints[i]; - ikConstraint.bendDirection = ikConstraint.data.bendDirection; - ikConstraint.mix = ikConstraint.data.mix; - } - }, - setSlotsToSetupPose: function () { - var slots = this.slots; - var drawOrder = this.drawOrder; - for (var i = 0, n = slots.length; i < n; i++) { - drawOrder[i] = slots[i]; - slots[i].setToSetupPose(i); - } - }, - /** @return May return null. */ - getRootBone: function () { - return this.bones.length ? this.bones[0] : null; - }, - /** @return May be null. */ - findBone: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].data.name == boneName) return bones[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findBoneIndex: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].data.name == boneName) return i; - return -1; - }, - /** @return May be null. */ - findSlot: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].data.name == slotName) return slots[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findSlotIndex: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].data.name == slotName) return i; - return -1; - }, - setSkinByName: function (skinName) { - var skin = this.data.findSkin(skinName); - if (!skin) throw "Skin not found: " + skinName; - this.setSkin(skin); - }, - /** Sets the skin used to look up attachments before looking in the {@link SkeletonData#getDefaultSkin() default skin}. - * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was - * no old skin, each slot's setup mode attachment is attached from the new skin. - * @param newSkin May be null. */ - setSkin: function (newSkin) { - if (newSkin) { - if (this.skin) - newSkin._attachAll(this, this.skin); - else { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - var name = slot.data.attachmentName; - if (name) { - var attachment = newSkin.getAttachment(i, name); - if (attachment) slot.setAttachment(attachment); - } - } - } - } - this.skin = newSkin; - }, - /** @return May be null. */ - getAttachmentBySlotName: function (slotName, attachmentName) { - return this.getAttachmentBySlotIndex(this.data.findSlotIndex(slotName), attachmentName); - }, - /** @return May be null. */ - getAttachmentBySlotIndex: function (slotIndex, attachmentName) { - if (this.skin) { - var attachment = this.skin.getAttachment(slotIndex, attachmentName); - if (attachment) return attachment; - } - if (this.data.defaultSkin) return this.data.defaultSkin.getAttachment(slotIndex, attachmentName); - return null; - }, - /** @param attachmentName May be null. */ - setAttachment: function (slotName, attachmentName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - if (slot.data.name == slotName) { - var attachment = null; - if (attachmentName) { - attachment = this.getAttachmentBySlotIndex(i, attachmentName); - if (!attachment) throw "Attachment not found: " + attachmentName + ", for slot: " + slotName; - } - slot.setAttachment(attachment); - return; - } - } - throw "Slot not found: " + slotName; - }, - /** @return May be null. */ - findIkConstraint: function (ikConstraintName) { - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) - if (ikConstraints[i].data.name == ikConstraintName) return ikConstraints[i]; - return null; - }, - update: function (delta) { - this.time += delta; - } -}; - -spine.EventData = function (name) { - this.name = name; -}; -spine.EventData.prototype = { - intValue: 0, - floatValue: 0, - stringValue: null -}; - -spine.Event = function (data) { - this.data = data; -}; -spine.Event.prototype = { - intValue: 0, - floatValue: 0, - stringValue: null -}; - -spine.AttachmentType = { - region: 0, - boundingbox: 1, - mesh: 2, - skinnedmesh: 3 -}; - -spine.RegionAttachment = function (name) { - this.name = name; - this.offset = []; - this.offset.length = 8; - this.uvs = []; - this.uvs.length = 8; -}; -spine.RegionAttachment.prototype = { - type: spine.AttachmentType.region, - x: 0, y: 0, - rotation: 0, - scaleX: 1, scaleY: 1, - width: 0, height: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - setUVs: function (u, v, u2, v2, rotate) { - var uvs = this.uvs; - if (rotate) { - uvs[2/*X2*/] = u; - uvs[3/*Y2*/] = v2; - uvs[4/*X3*/] = u; - uvs[5/*Y3*/] = v; - uvs[6/*X4*/] = u2; - uvs[7/*Y4*/] = v; - uvs[0/*X1*/] = u2; - uvs[1/*Y1*/] = v2; - } else { - uvs[0/*X1*/] = u; - uvs[1/*Y1*/] = v2; - uvs[2/*X2*/] = u; - uvs[3/*Y2*/] = v; - uvs[4/*X3*/] = u2; - uvs[5/*Y3*/] = v; - uvs[6/*X4*/] = u2; - uvs[7/*Y4*/] = v2; - } - }, - updateOffset: function () { - var regionScaleX = this.width / this.regionOriginalWidth * this.scaleX; - var regionScaleY = this.height / this.regionOriginalHeight * this.scaleY; - var localX = -this.width / 2 * this.scaleX + this.regionOffsetX * regionScaleX; - var localY = -this.height / 2 * this.scaleY + this.regionOffsetY * regionScaleY; - var localX2 = localX + this.regionWidth * regionScaleX; - var localY2 = localY + this.regionHeight * regionScaleY; - var radians = this.rotation * spine.degRad; - var cos = Math.cos(radians); - var sin = Math.sin(radians); - var localXCos = localX * cos + this.x; - var localXSin = localX * sin; - var localYCos = localY * cos + this.y; - var localYSin = localY * sin; - var localX2Cos = localX2 * cos + this.x; - var localX2Sin = localX2 * sin; - var localY2Cos = localY2 * cos + this.y; - var localY2Sin = localY2 * sin; - var offset = this.offset; - offset[0/*X1*/] = localXCos - localYSin; - offset[1/*Y1*/] = localYCos + localXSin; - offset[2/*X2*/] = localXCos - localY2Sin; - offset[3/*Y2*/] = localY2Cos + localXSin; - offset[4/*X3*/] = localX2Cos - localY2Sin; - offset[5/*Y3*/] = localY2Cos + localX2Sin; - offset[6/*X4*/] = localX2Cos - localYSin; - offset[7/*Y4*/] = localYCos + localX2Sin; - }, - computeVertices: function (x, y, bone, vertices) { - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var offset = this.offset; - vertices[0/*X1*/] = offset[0/*X1*/] * m00 + offset[1/*Y1*/] * m01 + x; - vertices[1/*Y1*/] = offset[0/*X1*/] * m10 + offset[1/*Y1*/] * m11 + y; - vertices[2/*X2*/] = offset[2/*X2*/] * m00 + offset[3/*Y2*/] * m01 + x; - vertices[3/*Y2*/] = offset[2/*X2*/] * m10 + offset[3/*Y2*/] * m11 + y; - vertices[4/*X3*/] = offset[4/*X3*/] * m00 + offset[5/*X3*/] * m01 + x; - vertices[5/*X3*/] = offset[4/*X3*/] * m10 + offset[5/*X3*/] * m11 + y; - vertices[6/*X4*/] = offset[6/*X4*/] * m00 + offset[7/*Y4*/] * m01 + x; - vertices[7/*Y4*/] = offset[6/*X4*/] * m10 + offset[7/*Y4*/] * m11 + y; - } -}; - -spine.MeshAttachment = function (name) { - this.name = name; -}; -spine.MeshAttachment.prototype = { - type: spine.AttachmentType.mesh, - vertices: null, - uvs: null, - regionUVs: null, - triangles: null, - hullLength: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionU: 0, regionV: 0, regionU2: 0, regionV2: 0, regionRotate: false, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - edges: null, - width: 0, height: 0, - updateUVs: function () { - var width = this.regionU2 - this.regionU, height = this.regionV2 - this.regionV; - var n = this.regionUVs.length; - if (!this.uvs || this.uvs.length != n) { - this.uvs = new spine.Float32Array(n); - } - if (this.regionRotate) { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i + 1] * width; - this.uvs[i + 1] = this.regionV + height - this.regionUVs[i] * height; - } - } else { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i] * width; - this.uvs[i + 1] = this.regionV + this.regionUVs[i + 1] * height; - } - } - }, - computeWorldVertices: function (x, y, slot, worldVertices) { - var bone = slot.bone; - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var vertices = this.vertices; - var verticesCount = vertices.length; - if (slot.attachmentVertices.length == verticesCount) vertices = slot.attachmentVertices; - for (var i = 0; i < verticesCount; i += 2) { - var vx = vertices[i]; - var vy = vertices[i + 1]; - worldVertices[i] = vx * m00 + vy * m01 + x; - worldVertices[i + 1] = vx * m10 + vy * m11 + y; - } - } -}; - -spine.SkinnedMeshAttachment = function (name) { - this.name = name; -}; -spine.SkinnedMeshAttachment.prototype = { - type: spine.AttachmentType.skinnedmesh, - bones: null, - weights: null, - uvs: null, - regionUVs: null, - triangles: null, - hullLength: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionU: 0, regionV: 0, regionU2: 0, regionV2: 0, regionRotate: false, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - edges: null, - width: 0, height: 0, - updateUVs: function (u, v, u2, v2, rotate) { - var width = this.regionU2 - this.regionU, height = this.regionV2 - this.regionV; - var n = this.regionUVs.length; - if (!this.uvs || this.uvs.length != n) { - this.uvs = new spine.Float32Array(n); - } - if (this.regionRotate) { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i + 1] * width; - this.uvs[i + 1] = this.regionV + height - this.regionUVs[i] * height; - } - } else { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i] * width; - this.uvs[i + 1] = this.regionV + this.regionUVs[i + 1] * height; - } - } - }, - computeWorldVertices: function (x, y, slot, worldVertices) { - var skeletonBones = slot.bone.skeleton.bones; - var weights = this.weights; - var bones = this.bones; - - var w = 0, v = 0, b = 0, f = 0, n = bones.length, nn; - var wx, wy, bone, vx, vy, weight; - if (!slot.attachmentVertices.length) { - for (; v < n; w += 2) { - wx = 0; - wy = 0; - nn = bones[v++] + v; - for (; v < nn; v++, b += 3) { - bone = skeletonBones[bones[v]]; - vx = weights[b]; - vy = weights[b + 1]; - weight = weights[b + 2]; - wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight; - wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight; - } - worldVertices[w] = wx + x; - worldVertices[w + 1] = wy + y; - } - } else { - var ffd = slot.attachmentVertices; - for (; v < n; w += 2) { - wx = 0; - wy = 0; - nn = bones[v++] + v; - for (; v < nn; v++, b += 3, f += 2) { - bone = skeletonBones[bones[v]]; - vx = weights[b] + ffd[f]; - vy = weights[b + 1] + ffd[f + 1]; - weight = weights[b + 2]; - wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight; - wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight; - } - worldVertices[w] = wx + x; - worldVertices[w + 1] = wy + y; - } - } - } -}; - -spine.BoundingBoxAttachment = function (name) { - this.name = name; - this.vertices = []; -}; -spine.BoundingBoxAttachment.prototype = { - type: spine.AttachmentType.boundingbox, - computeWorldVertices: function (x, y, bone, worldVertices) { - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var vertices = this.vertices; - for (var i = 0, n = vertices.length; i < n; i += 2) { - var px = vertices[i]; - var py = vertices[i + 1]; - worldVertices[i] = px * m00 + py * m01 + x; - worldVertices[i + 1] = px * m10 + py * m11 + y; - } - } -}; - -spine.AnimationStateData = function (skeletonData) { - this.skeletonData = skeletonData; - this.animationToMixTime = {}; -}; -spine.AnimationStateData.prototype = { - defaultMix: 0, - setMixByName: function (fromName, toName, duration) { - var from = this.skeletonData.findAnimation(fromName); - if (!from) throw "Animation not found: " + fromName; - var to = this.skeletonData.findAnimation(toName); - if (!to) throw "Animation not found: " + toName; - this.setMix(from, to, duration); - }, - setMix: function (from, to, duration) { - this.animationToMixTime[from.name + ":" + to.name] = duration; - }, - getMix: function (from, to) { - var key = from.name + ":" + to.name; - return this.animationToMixTime.hasOwnProperty(key) ? this.animationToMixTime[key] : this.defaultMix; - } -}; - -spine.TrackEntry = function () {}; -spine.TrackEntry.prototype = { - next: null, previous: null, - animation: null, - loop: false, - delay: 0, time: 0, lastTime: -1, endTime: 0, - timeScale: 1, - mixTime: 0, mixDuration: 0, mix: 1, - onStart: null, onEnd: null, onComplete: null, onEvent: null -}; - -spine.AnimationState = function (stateData) { - this.data = stateData; - this.tracks = []; - this.events = []; -}; -spine.AnimationState.prototype = { - onStart: null, - onEnd: null, - onComplete: null, - onEvent: null, - timeScale: 1, - update: function (delta) { - delta *= this.timeScale; - for (var i = 0; i < this.tracks.length; i++) { - var current = this.tracks[i]; - if (!current) continue; - - current.time += delta * current.timeScale; - if (current.previous) { - var previousDelta = delta * current.previous.timeScale; - current.previous.time += previousDelta; - current.mixTime += previousDelta; - } - - var next = current.next; - if (next) { - next.time = current.lastTime - next.delay; - if (next.time >= 0) this.setCurrent(i, next); - } else { - // End non-looping animation when it reaches its end time and there is no next entry. - if (!current.loop && current.lastTime >= current.endTime) this.clearTrack(i); - } - } - }, - apply: function (skeleton) { - for (var i = 0; i < this.tracks.length; i++) { - var current = this.tracks[i]; - if (!current) continue; - - this.events.length = 0; - - var time = current.time; - var lastTime = current.lastTime; - var endTime = current.endTime; - var loop = current.loop; - if (!loop && time > endTime) time = endTime; - - var previous = current.previous; - if (!previous) { - if (current.mix == 1) - current.animation.apply(skeleton, current.lastTime, time, loop, this.events); - else - current.animation.mix(skeleton, current.lastTime, time, loop, this.events, current.mix); - } else { - var previousTime = previous.time; - if (!previous.loop && previousTime > previous.endTime) previousTime = previous.endTime; - previous.animation.apply(skeleton, previousTime, previousTime, previous.loop, null); - - var alpha = current.mixTime / current.mixDuration * current.mix; - if (alpha >= 1) { - alpha = 1; - current.previous = null; - } - current.animation.mix(skeleton, current.lastTime, time, loop, this.events, alpha); - } - - for (var ii = 0, nn = this.events.length; ii < nn; ii++) { - var event = this.events[ii]; - if (current.onEvent) current.onEvent(i, event); - if (this.onEvent) this.onEvent(i, event); - } - - // Check if completed the animation or a loop iteration. - if (loop ? (lastTime % endTime > time % endTime) : (lastTime < endTime && time >= endTime)) { - var count = Math.floor(time / endTime); - if (current.onComplete) current.onComplete(i, count); - if (this.onComplete) this.onComplete(i, count); - } - - current.lastTime = current.time; - } - }, - clearTracks: function () { - for (var i = 0, n = this.tracks.length; i < n; i++) - this.clearTrack(i); - this.tracks.length = 0; - }, - clearTrack: function (trackIndex) { - if (trackIndex >= this.tracks.length) return; - var current = this.tracks[trackIndex]; - if (!current) return; - - if (current.onEnd) current.onEnd(trackIndex); - if (this.onEnd) this.onEnd(trackIndex); - - this.tracks[trackIndex] = null; - }, - _expandToIndex: function (index) { - if (index < this.tracks.length) return this.tracks[index]; - while (index >= this.tracks.length) - this.tracks.push(null); - return null; - }, - setCurrent: function (index, entry) { - var current = this._expandToIndex(index); - if (current) { - var previous = current.previous; - current.previous = null; - - if (current.onEnd) current.onEnd(index); - if (this.onEnd) this.onEnd(index); - - entry.mixDuration = this.data.getMix(current.animation, entry.animation); - if (entry.mixDuration > 0) { - entry.mixTime = 0; - // If a mix is in progress, mix from the closest animation. - if (previous && current.mixTime / current.mixDuration < 0.5) - entry.previous = previous; - else - entry.previous = current; - } - } - - this.tracks[index] = entry; - - if (entry.onStart) entry.onStart(index); - if (this.onStart) this.onStart(index); - }, - setAnimationByName: function (trackIndex, animationName, loop) { - var animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) throw "Animation not found: " + animationName; - return this.setAnimation(trackIndex, animation, loop); - }, - /** Set the current animation. Any queued animations are cleared. */ - setAnimation: function (trackIndex, animation, loop) { - var entry = new spine.TrackEntry(); - entry.animation = animation; - entry.loop = loop; - entry.endTime = animation.duration; - this.setCurrent(trackIndex, entry); - return entry; - }, - addAnimationByName: function (trackIndex, animationName, loop, delay) { - var animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) throw "Animation not found: " + animationName; - return this.addAnimation(trackIndex, animation, loop, delay); - }, - /** Adds an animation to be played delay seconds after the current or last queued animation. - * @param delay May be <= 0 to use duration of previous animation minus any mix duration plus the negative delay. */ - addAnimation: function (trackIndex, animation, loop, delay) { - var entry = new spine.TrackEntry(); - entry.animation = animation; - entry.loop = loop; - entry.endTime = animation.duration; - - var last = this._expandToIndex(trackIndex); - if (last) { - while (last.next) - last = last.next; - last.next = entry; - } else - this.tracks[trackIndex] = entry; - - if (delay <= 0) { - if (last) - delay += last.endTime - this.data.getMix(last.animation, animation); - else - delay = 0; - } - entry.delay = delay; - - return entry; - }, - /** May be null. */ - getCurrent: function (trackIndex) { - if (trackIndex >= this.tracks.length) return null; - return this.tracks[trackIndex]; - } -}; - -spine.SkeletonJson = function (attachmentLoader) { - this.attachmentLoader = attachmentLoader; -}; -spine.SkeletonJson.prototype = { - scale: 1, - readSkeletonData: function (root, name) { - var skeletonData = new spine.SkeletonData(); - skeletonData.name = name; - - // Skeleton. - var skeletonMap = root["skeleton"]; - if (skeletonMap) { - skeletonData.hash = skeletonMap["hash"]; - skeletonData.version = skeletonMap["spine"]; - skeletonData.width = skeletonMap["width"] || 0; - skeletonData.height = skeletonMap["height"] || 0; - } - - // Bones. - var bones = root["bones"]; - for (var i = 0, n = bones.length; i < n; i++) { - var boneMap = bones[i]; - var parent = null; - if (boneMap["parent"]) { - parent = skeletonData.findBone(boneMap["parent"]); - if (!parent) throw "Parent bone not found: " + boneMap["parent"]; - } - var boneData = new spine.BoneData(boneMap["name"], parent); - boneData.length = (boneMap["length"] || 0) * this.scale; - boneData.x = (boneMap["x"] || 0) * this.scale; - boneData.y = (boneMap["y"] || 0) * this.scale; - boneData.rotation = (boneMap["rotation"] || 0); - boneData.scaleX = boneMap.hasOwnProperty("scaleX") ? boneMap["scaleX"] : 1; - boneData.scaleY = boneMap.hasOwnProperty("scaleY") ? boneMap["scaleY"] : 1; - boneData.inheritScale = boneMap.hasOwnProperty("inheritScale") ? boneMap["inheritScale"] : true; - boneData.inheritRotation = boneMap.hasOwnProperty("inheritRotation") ? boneMap["inheritRotation"] : true; - skeletonData.bones.push(boneData); - } - - // IK constraints. - var ik = root["ik"]; - if (ik) { - for (var i = 0, n = ik.length; i < n; i++) { - var ikMap = ik[i]; - var ikConstraintData = new spine.IkConstraintData(ikMap["name"]); - - var bones = ikMap["bones"]; - for (var ii = 0, nn = bones.length; ii < nn; ii++) { - var bone = skeletonData.findBone(bones[ii]); - if (!bone) throw "IK bone not found: " + bones[ii]; - ikConstraintData.bones.push(bone); - } - - ikConstraintData.target = skeletonData.findBone(ikMap["target"]); - if (!ikConstraintData.target) throw "Target bone not found: " + ikMap["target"]; - - ikConstraintData.bendDirection = (!ikMap.hasOwnProperty("bendPositive") || ikMap["bendPositive"]) ? 1 : -1; - ikConstraintData.mix = ikMap.hasOwnProperty("mix") ? ikMap["mix"] : 1; - - skeletonData.ikConstraints.push(ikConstraintData); - } - } - - // Slots. - var slots = root["slots"]; - for (var i = 0, n = slots.length; i < n; i++) { - var slotMap = slots[i]; - var boneData = skeletonData.findBone(slotMap["bone"]); - if (!boneData) throw "Slot bone not found: " + slotMap["bone"]; - var slotData = new spine.SlotData(slotMap["name"], boneData); - - var color = slotMap["color"]; - if (color) { - slotData.r = this.toColor(color, 0); - slotData.g = this.toColor(color, 1); - slotData.b = this.toColor(color, 2); - slotData.a = this.toColor(color, 3); - } - - slotData.attachmentName = slotMap["attachment"]; - slotData.additiveBlending = slotMap["additive"] && slotMap["additive"] == "true"; - - skeletonData.slots.push(slotData); - } - - // Skins. - var skins = root["skins"]; - for (var skinName in skins) { - if (!skins.hasOwnProperty(skinName)) continue; - var skinMap = skins[skinName]; - var skin = new spine.Skin(skinName); - for (var slotName in skinMap) { - if (!skinMap.hasOwnProperty(slotName)) continue; - var slotIndex = skeletonData.findSlotIndex(slotName); - var slotEntry = skinMap[slotName]; - for (var attachmentName in slotEntry) { - if (!slotEntry.hasOwnProperty(attachmentName)) continue; - var attachment = this.readAttachment(skin, attachmentName, slotEntry[attachmentName]); - if (attachment) skin.addAttachment(slotIndex, attachmentName, attachment); - } - } - skeletonData.skins.push(skin); - if (skin.name == "default") skeletonData.defaultSkin = skin; - } - - // Events. - var events = root["events"]; - for (var eventName in events) { - if (!events.hasOwnProperty(eventName)) continue; - var eventMap = events[eventName]; - var eventData = new spine.EventData(eventName); - eventData.intValue = eventMap["int"] || 0; - eventData.floatValue = eventMap["float"] || 0; - eventData.stringValue = eventMap["string"] || null; - skeletonData.events.push(eventData); - } - - // Animations. - var animations = root["animations"]; - for (var animationName in animations) { - if (!animations.hasOwnProperty(animationName)) continue; - this.readAnimation(animationName, animations[animationName], skeletonData); - } - - return skeletonData; - }, - readAttachment: function (skin, name, map) { - name = map["name"] || name; - - var type = spine.AttachmentType[map["type"] || "region"]; - var path = map["path"] || name; - - var scale = this.scale; - if (type == spine.AttachmentType.region) { - var region = this.attachmentLoader.newRegionAttachment(skin, name, path); - if (!region) return null; - region.path = path; - region.x = (map["x"] || 0) * scale; - region.y = (map["y"] || 0) * scale; - region.scaleX = map.hasOwnProperty("scaleX") ? map["scaleX"] : 1; - region.scaleY = map.hasOwnProperty("scaleY") ? map["scaleY"] : 1; - region.rotation = map["rotation"] || 0; - region.width = (map["width"] || 0) * scale; - region.height = (map["height"] || 0) * scale; - - var color = map["color"]; - if (color) { - region.r = this.toColor(color, 0); - region.g = this.toColor(color, 1); - region.b = this.toColor(color, 2); - region.a = this.toColor(color, 3); - } - - region.updateOffset(); - return region; - } else if (type == spine.AttachmentType.mesh) { - var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path); - if (!mesh) return null; - mesh.path = path; - mesh.vertices = this.getFloatArray(map, "vertices", scale); - mesh.triangles = this.getIntArray(map, "triangles"); - mesh.regionUVs = this.getFloatArray(map, "uvs", 1); - mesh.updateUVs(); - - color = map["color"]; - if (color) { - mesh.r = this.toColor(color, 0); - mesh.g = this.toColor(color, 1); - mesh.b = this.toColor(color, 2); - mesh.a = this.toColor(color, 3); - } - - mesh.hullLength = (map["hull"] || 0) * 2; - if (map["edges"]) mesh.edges = this.getIntArray(map, "edges"); - mesh.width = (map["width"] || 0) * scale; - mesh.height = (map["height"] || 0) * scale; - return mesh; - } else if (type == spine.AttachmentType.skinnedmesh) { - var mesh = this.attachmentLoader.newSkinnedMeshAttachment(skin, name, path); - if (!mesh) return null; - mesh.path = path; - - var uvs = this.getFloatArray(map, "uvs", 1); - var vertices = this.getFloatArray(map, "vertices", 1); - var weights = []; - var bones = []; - for (var i = 0, n = vertices.length; i < n; ) { - var boneCount = vertices[i++] | 0; - bones[bones.length] = boneCount; - for (var nn = i + boneCount * 4; i < nn; ) { - bones[bones.length] = vertices[i]; - weights[weights.length] = vertices[i + 1] * scale; - weights[weights.length] = vertices[i + 2] * scale; - weights[weights.length] = vertices[i + 3]; - i += 4; - } - } - mesh.bones = bones; - mesh.weights = weights; - mesh.triangles = this.getIntArray(map, "triangles"); - mesh.regionUVs = uvs; - mesh.updateUVs(); - - color = map["color"]; - if (color) { - mesh.r = this.toColor(color, 0); - mesh.g = this.toColor(color, 1); - mesh.b = this.toColor(color, 2); - mesh.a = this.toColor(color, 3); - } - - mesh.hullLength = (map["hull"] || 0) * 2; - if (map["edges"]) mesh.edges = this.getIntArray(map, "edges"); - mesh.width = (map["width"] || 0) * scale; - mesh.height = (map["height"] || 0) * scale; - return mesh; - } else if (type == spine.AttachmentType.boundingbox) { - var attachment = this.attachmentLoader.newBoundingBoxAttachment(skin, name); - var vertices = map["vertices"]; - for (var i = 0, n = vertices.length; i < n; i++) - attachment.vertices.push(vertices[i] * scale); - return attachment; - } - throw "Unknown attachment type: " + type; - }, - readAnimation: function (name, map, skeletonData) { - var timelines = []; - var duration = 0; - - var slots = map["slots"]; - for (var slotName in slots) { - if (!slots.hasOwnProperty(slotName)) continue; - var slotMap = slots[slotName]; - var slotIndex = skeletonData.findSlotIndex(slotName); - - for (var timelineName in slotMap) { - if (!slotMap.hasOwnProperty(timelineName)) continue; - var values = slotMap[timelineName]; - if (timelineName == "color") { - var timeline = new spine.ColorTimeline(values.length); - timeline.slotIndex = slotIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var color = valueMap["color"]; - var r = this.toColor(color, 0); - var g = this.toColor(color, 1); - var b = this.toColor(color, 2); - var a = this.toColor(color, 3); - timeline.setFrame(frameIndex, valueMap["time"], r, g, b, a); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 5 - 5]); - - } else if (timelineName == "attachment") { - var timeline = new spine.AttachmentTimeline(values.length); - timeline.slotIndex = slotIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex++, valueMap["time"], valueMap["name"]); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - - } else - throw "Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")"; - } - } - - var bones = map["bones"]; - for (var boneName in bones) { - if (!bones.hasOwnProperty(boneName)) continue; - var boneIndex = skeletonData.findBoneIndex(boneName); - if (boneIndex == -1) throw "Bone not found: " + boneName; - var boneMap = bones[boneName]; - - for (var timelineName in boneMap) { - if (!boneMap.hasOwnProperty(timelineName)) continue; - var values = boneMap[timelineName]; - if (timelineName == "rotate") { - var timeline = new spine.RotateTimeline(values.length); - timeline.boneIndex = boneIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex, valueMap["time"], valueMap["angle"]); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 2 - 2]); - - } else if (timelineName == "translate" || timelineName == "scale") { - var timeline; - var timelineScale = 1; - if (timelineName == "scale") - timeline = new spine.ScaleTimeline(values.length); - else { - timeline = new spine.TranslateTimeline(values.length); - timelineScale = this.scale; - } - timeline.boneIndex = boneIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var x = (valueMap["x"] || 0) * timelineScale; - var y = (valueMap["y"] || 0) * timelineScale; - timeline.setFrame(frameIndex, valueMap["time"], x, y); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 3 - 3]); - - } else if (timelineName == "flipX" || timelineName == "flipY") { - var x = timelineName == "flipX"; - var timeline = x ? new spine.FlipXTimeline(values.length) : new spine.FlipYTimeline(values.length); - timeline.boneIndex = boneIndex; - - var field = x ? "x" : "y"; - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex, valueMap["time"], valueMap[field] || false); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 2 - 2]); - } else - throw "Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")"; - } - } - - var ikMap = map["ik"]; - for (var ikConstraintName in ikMap) { - if (!ikMap.hasOwnProperty(ikConstraintName)) continue; - var ikConstraint = skeletonData.findIkConstraint(ikConstraintName); - var values = ikMap[ikConstraintName]; - var timeline = new spine.IkConstraintTimeline(values.length); - timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(ikConstraint); - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var mix = valueMap.hasOwnProperty("mix") ? valueMap["mix"] : 1; - var bendDirection = (!valueMap.hasOwnProperty("bendPositive") || valueMap["bendPositive"]) ? 1 : -1; - timeline.setFrame(frameIndex, valueMap["time"], mix, bendDirection); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.frameCount * 3 - 3]); - } - - var ffd = map["ffd"]; - for (var skinName in ffd) { - var skin = skeletonData.findSkin(skinName); - var slotMap = ffd[skinName]; - for (slotName in slotMap) { - var slotIndex = skeletonData.findSlotIndex(slotName); - var meshMap = slotMap[slotName]; - for (var meshName in meshMap) { - var values = meshMap[meshName]; - var timeline = new spine.FfdTimeline(values.length); - var attachment = skin.getAttachment(slotIndex, meshName); - if (!attachment) throw "FFD attachment not found: " + meshName; - timeline.slotIndex = slotIndex; - timeline.attachment = attachment; - - var isMesh = attachment.type == spine.AttachmentType.mesh; - var vertexCount; - if (isMesh) - vertexCount = attachment.vertices.length; - else - vertexCount = attachment.weights.length / 3 * 2; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var vertices; - if (!valueMap["vertices"]) { - if (isMesh) - vertices = attachment.vertices; - else { - vertices = []; - vertices.length = vertexCount; - } - } else { - var verticesValue = valueMap["vertices"]; - var vertices = []; - vertices.length = vertexCount; - var start = valueMap["offset"] || 0; - var nn = verticesValue.length; - if (this.scale == 1) { - for (var ii = 0; ii < nn; ii++) - vertices[ii + start] = verticesValue[ii]; - } else { - for (var ii = 0; ii < nn; ii++) - vertices[ii + start] = verticesValue[ii] * this.scale; - } - if (isMesh) { - var meshVertices = attachment.vertices; - for (var ii = 0, nn = vertices.length; ii < nn; ii++) - vertices[ii] += meshVertices[ii]; - } - } - - timeline.setFrame(frameIndex, valueMap["time"], vertices); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines[timelines.length] = timeline; - duration = Math.max(duration, timeline.frames[timeline.frameCount - 1]); - } - } - } - - var drawOrderValues = map["drawOrder"]; - if (!drawOrderValues) drawOrderValues = map["draworder"]; - if (drawOrderValues) { - var timeline = new spine.DrawOrderTimeline(drawOrderValues.length); - var slotCount = skeletonData.slots.length; - var frameIndex = 0; - for (var i = 0, n = drawOrderValues.length; i < n; i++) { - var drawOrderMap = drawOrderValues[i]; - var drawOrder = null; - if (drawOrderMap["offsets"]) { - drawOrder = []; - drawOrder.length = slotCount; - for (var ii = slotCount - 1; ii >= 0; ii--) - drawOrder[ii] = -1; - var offsets = drawOrderMap["offsets"]; - var unchanged = []; - unchanged.length = slotCount - offsets.length; - var originalIndex = 0, unchangedIndex = 0; - for (var ii = 0, nn = offsets.length; ii < nn; ii++) { - var offsetMap = offsets[ii]; - var slotIndex = skeletonData.findSlotIndex(offsetMap["slot"]); - if (slotIndex == -1) throw "Slot not found: " + offsetMap["slot"]; - // Collect unchanged items. - while (originalIndex != slotIndex) - unchanged[unchangedIndex++] = originalIndex++; - // Set changed items. - drawOrder[originalIndex + offsetMap["offset"]] = originalIndex++; - } - // Collect remaining unchanged items. - while (originalIndex < slotCount) - unchanged[unchangedIndex++] = originalIndex++; - // Fill in unchanged items. - for (var ii = slotCount - 1; ii >= 0; ii--) - if (drawOrder[ii] == -1) drawOrder[ii] = unchanged[--unchangedIndex]; - } - timeline.setFrame(frameIndex++, drawOrderMap["time"], drawOrder); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - - var events = map["events"]; - if (events) { - var timeline = new spine.EventTimeline(events.length); - var frameIndex = 0; - for (var i = 0, n = events.length; i < n; i++) { - var eventMap = events[i]; - var eventData = skeletonData.findEvent(eventMap["name"]); - if (!eventData) throw "Event not found: " + eventMap["name"]; - var event = new spine.Event(eventData); - event.intValue = eventMap.hasOwnProperty("int") ? eventMap["int"] : eventData.intValue; - event.floatValue = eventMap.hasOwnProperty("float") ? eventMap["float"] : eventData.floatValue; - event.stringValue = eventMap.hasOwnProperty("string") ? eventMap["string"] : eventData.stringValue; - timeline.setFrame(frameIndex++, eventMap["time"], event); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - - skeletonData.animations.push(new spine.Animation(name, timelines, duration)); - }, - readCurve: function (timeline, frameIndex, valueMap) { - var curve = valueMap["curve"]; - if (!curve) - timeline.curves.setLinear(frameIndex); - else if (curve == "stepped") - timeline.curves.setStepped(frameIndex); - else if (curve instanceof Array) - timeline.curves.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]); - }, - toColor: function (hexString, colorIndex) { - if (hexString.length != 8) throw "Color hexidecimal length must be 8, recieved: " + hexString; - return parseInt(hexString.substring(colorIndex * 2, (colorIndex * 2) + 2), 16) / 255; - }, - getFloatArray: function (map, name, scale) { - var list = map[name]; - var values = new spine.Float32Array(list.length); - var i = 0, n = list.length; - if (scale == 1) { - for (; i < n; i++) - values[i] = list[i]; - } else { - for (; i < n; i++) - values[i] = list[i] * scale; - } - return values; - }, - getIntArray: function (map, name) { - var list = map[name]; - var values = new spine.Uint16Array(list.length); - for (var i = 0, n = list.length; i < n; i++) - values[i] = list[i] | 0; - return values; - } -}; - -spine.Atlas = function (atlasText, textureLoader) { - this.textureLoader = textureLoader; - this.pages = []; - this.regions = []; - - var reader = new spine.AtlasReader(atlasText); - var tuple = []; - tuple.length = 4; - var page = null; - while (true) { - var line = reader.readLine(); - if (line === null) break; - line = reader.trim(line); - if (!line.length) - page = null; - else if (!page) { - page = new spine.AtlasPage(); - page.name = line; - - if (reader.readTuple(tuple) == 2) { // size is only optional for an atlas packed with an old TexturePacker. - page.width = parseInt(tuple[0]); - page.height = parseInt(tuple[1]); - reader.readTuple(tuple); - } - page.format = spine.Atlas.Format[tuple[0]]; - - reader.readTuple(tuple); - page.minFilter = spine.Atlas.TextureFilter[tuple[0]]; - page.magFilter = spine.Atlas.TextureFilter[tuple[1]]; - - var direction = reader.readValue(); - page.uWrap = spine.Atlas.TextureWrap.clampToEdge; - page.vWrap = spine.Atlas.TextureWrap.clampToEdge; - if (direction == "x") - page.uWrap = spine.Atlas.TextureWrap.repeat; - else if (direction == "y") - page.vWrap = spine.Atlas.TextureWrap.repeat; - else if (direction == "xy") - page.uWrap = page.vWrap = spine.Atlas.TextureWrap.repeat; - - textureLoader.load(page, line, this); - - this.pages.push(page); - - } else { - var region = new spine.AtlasRegion(); - region.name = line; - region.page = page; - - region.rotate = reader.readValue() == "true"; - - reader.readTuple(tuple); - var x = parseInt(tuple[0]); - var y = parseInt(tuple[1]); - - reader.readTuple(tuple); - var width = parseInt(tuple[0]); - var height = parseInt(tuple[1]); - - region.u = x / page.width; - region.v = y / page.height; - if (region.rotate) { - region.u2 = (x + height) / page.width; - region.v2 = (y + width) / page.height; - } else { - region.u2 = (x + width) / page.width; - region.v2 = (y + height) / page.height; - } - region.x = x; - region.y = y; - region.width = Math.abs(width); - region.height = Math.abs(height); - - if (reader.readTuple(tuple) == 4) { // split is optional - region.splits = [parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3])]; - - if (reader.readTuple(tuple) == 4) { // pad is optional, but only present with splits - region.pads = [parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3])]; - - reader.readTuple(tuple); - } - } - - region.originalWidth = parseInt(tuple[0]); - region.originalHeight = parseInt(tuple[1]); - - reader.readTuple(tuple); - region.offsetX = parseInt(tuple[0]); - region.offsetY = parseInt(tuple[1]); - - region.index = parseInt(reader.readValue()); - - this.regions.push(region); - } - } -}; -spine.Atlas.prototype = { - findRegion: function (name) { - var regions = this.regions; - for (var i = 0, n = regions.length; i < n; i++) - if (regions[i].name == name) return regions[i]; - return null; - }, - dispose: function () { - var pages = this.pages; - for (var i = 0, n = pages.length; i < n; i++) - this.textureLoader.unload(pages[i].rendererObject); - }, - updateUVs: function (page) { - var regions = this.regions; - for (var i = 0, n = regions.length; i < n; i++) { - var region = regions[i]; - if (region.page != page) continue; - region.u = region.x / page.width; - region.v = region.y / page.height; - if (region.rotate) { - region.u2 = (region.x + region.height) / page.width; - region.v2 = (region.y + region.width) / page.height; - } else { - region.u2 = (region.x + region.width) / page.width; - region.v2 = (region.y + region.height) / page.height; - } - } - } -}; - -spine.Atlas.Format = { - alpha: 0, - intensity: 1, - luminanceAlpha: 2, - rgb565: 3, - rgba4444: 4, - rgb888: 5, - rgba8888: 6 -}; - -spine.Atlas.TextureFilter = { - nearest: 0, - linear: 1, - mipMap: 2, - mipMapNearestNearest: 3, - mipMapLinearNearest: 4, - mipMapNearestLinear: 5, - mipMapLinearLinear: 6 -}; - -spine.Atlas.TextureWrap = { - mirroredRepeat: 0, - clampToEdge: 1, - repeat: 2 -}; - -spine.AtlasPage = function () {}; -spine.AtlasPage.prototype = { - name: null, - format: null, - minFilter: null, - magFilter: null, - uWrap: null, - vWrap: null, - rendererObject: null, - width: 0, - height: 0 -}; - -spine.AtlasRegion = function () {}; -spine.AtlasRegion.prototype = { - page: null, - name: null, - x: 0, y: 0, - width: 0, height: 0, - u: 0, v: 0, u2: 0, v2: 0, - offsetX: 0, offsetY: 0, - originalWidth: 0, originalHeight: 0, - index: 0, - rotate: false, - splits: null, - pads: null -}; - -spine.AtlasReader = function (text) { - this.lines = text.split(/\r\n|\r|\n/); -}; -spine.AtlasReader.prototype = { - index: 0, - trim: function (value) { - return value.replace(/^\s+|\s+$/g, ""); - }, - readLine: function () { - if (this.index >= this.lines.length) return null; - return this.lines[this.index++]; - }, - readValue: function () { - var line = this.readLine(); - var colon = line.indexOf(":"); - if (colon == -1) throw "Invalid line: " + line; - return this.trim(line.substring(colon + 1)); - }, - /** Returns the number of tuple values read (1, 2 or 4). */ - readTuple: function (tuple) { - var line = this.readLine(); - var colon = line.indexOf(":"); - if (colon == -1) throw "Invalid line: " + line; - var i = 0, lastMatch = colon + 1; - for (; i < 3; i++) { - var comma = line.indexOf(",", lastMatch); - if (comma == -1) break; - tuple[i] = this.trim(line.substr(lastMatch, comma - lastMatch)); - lastMatch = comma + 1; - } - tuple[i] = this.trim(line.substring(lastMatch)); - return i + 1; - } -}; - -spine.AtlasAttachmentLoader = function (atlas) { - this.atlas = atlas; -}; -spine.AtlasAttachmentLoader.prototype = { - newRegionAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (region attachment: " + name + ")"; - var attachment = new spine.RegionAttachment(name); - attachment.rendererObject = region; - attachment.setUVs(region.u, region.v, region.u2, region.v2, region.rotate); - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newMeshAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (mesh attachment: " + name + ")"; - var attachment = new spine.MeshAttachment(name); - attachment.rendererObject = region; - attachment.regionU = region.u; - attachment.regionV = region.v; - attachment.regionU2 = region.u2; - attachment.regionV2 = region.v2; - attachment.regionRotate = region.rotate; - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newSkinnedMeshAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (skinned mesh attachment: " + name + ")"; - var attachment = new spine.SkinnedMeshAttachment(name); - attachment.rendererObject = region; - attachment.regionU = region.u; - attachment.regionV = region.v; - attachment.regionU2 = region.u2; - attachment.regionV2 = region.v2; - attachment.regionRotate = region.rotate; - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newBoundingBoxAttachment: function (skin, name) { - return new spine.BoundingBoxAttachment(name); - } -}; - -spine.SkeletonBounds = function () { - this.polygonPool = []; - this.polygons = []; - this.boundingBoxes = []; -}; -spine.SkeletonBounds.prototype = { - minX: 0, minY: 0, maxX: 0, maxY: 0, - update: function (skeleton, updateAabb) { - var slots = skeleton.slots; - var slotCount = slots.length; - var x = skeleton.x, y = skeleton.y; - var boundingBoxes = this.boundingBoxes; - var polygonPool = this.polygonPool; - var polygons = this.polygons; - - boundingBoxes.length = 0; - for (var i = 0, n = polygons.length; i < n; i++) - polygonPool.push(polygons[i]); - polygons.length = 0; - - for (var i = 0; i < slotCount; i++) { - var slot = slots[i]; - var boundingBox = slot.attachment; - if (boundingBox.type != spine.AttachmentType.boundingbox) continue; - boundingBoxes.push(boundingBox); - - var poolCount = polygonPool.length, polygon; - if (poolCount > 0) { - polygon = polygonPool[poolCount - 1]; - polygonPool.splice(poolCount - 1, 1); - } else - polygon = []; - polygons.push(polygon); - - polygon.length = boundingBox.vertices.length; - boundingBox.computeWorldVertices(x, y, slot.bone, polygon); - } - - if (updateAabb) this.aabbCompute(); - }, - aabbCompute: function () { - var polygons = this.polygons; - var minX = Number.MAX_VALUE, minY = Number.MAX_VALUE, maxX = Number.MIN_VALUE, maxY = Number.MIN_VALUE; - for (var i = 0, n = polygons.length; i < n; i++) { - var vertices = polygons[i]; - for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) { - var x = vertices[ii]; - var y = vertices[ii + 1]; - minX = Math.min(minX, x); - minY = Math.min(minY, y); - maxX = Math.max(maxX, x); - maxY = Math.max(maxY, y); - } - } - this.minX = minX; - this.minY = minY; - this.maxX = maxX; - this.maxY = maxY; - }, - /** Returns true if the axis aligned bounding box contains the point. */ - aabbContainsPoint: function (x, y) { - return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY; - }, - /** Returns true if the axis aligned bounding box intersects the line segment. */ - aabbIntersectsSegment: function (x1, y1, x2, y2) { - var minX = this.minX, minY = this.minY, maxX = this.maxX, maxY = this.maxY; - if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY)) - return false; - var m = (y2 - y1) / (x2 - x1); - var y = m * (minX - x1) + y1; - if (y > minY && y < maxY) return true; - y = m * (maxX - x1) + y1; - if (y > minY && y < maxY) return true; - var x = (minY - y1) / m + x1; - if (x > minX && x < maxX) return true; - x = (maxY - y1) / m + x1; - if (x > minX && x < maxX) return true; - return false; - }, - /** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */ - aabbIntersectsSkeleton: function (bounds) { - return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY; - }, - /** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more - * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */ - containsPoint: function (x, y) { - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) - if (this.polygonContainsPoint(polygons[i], x, y)) return this.boundingBoxes[i]; - return null; - }, - /** Returns the first bounding box attachment that contains the line segment, or null. When doing many checks, it is usually - * more efficient to only call this method if {@link #aabbIntersectsSegment(float, float, float, float)} returns true. */ - intersectsSegment: function (x1, y1, x2, y2) { - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) - if (polygons[i].intersectsSegment(x1, y1, x2, y2)) return this.boundingBoxes[i]; - return null; - }, - /** Returns true if the polygon contains the point. */ - polygonContainsPoint: function (polygon, x, y) { - var nn = polygon.length; - var prevIndex = nn - 2; - var inside = false; - for (var ii = 0; ii < nn; ii += 2) { - var vertexY = polygon[ii + 1]; - var prevY = polygon[prevIndex + 1]; - if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) { - var vertexX = polygon[ii]; - if (vertexX + (y - vertexY) / (prevY - vertexY) * (polygon[prevIndex] - vertexX) < x) inside = !inside; - } - prevIndex = ii; - } - return inside; - }, - /** Returns true if the polygon contains the line segment. */ - polygonIntersectsSegment: function (polygon, x1, y1, x2, y2) { - var nn = polygon.length; - var width12 = x1 - x2, height12 = y1 - y2; - var det1 = x1 * y2 - y1 * x2; - var x3 = polygon[nn - 2], y3 = polygon[nn - 1]; - for (var ii = 0; ii < nn; ii += 2) { - var x4 = polygon[ii], y4 = polygon[ii + 1]; - var det2 = x3 * y4 - y3 * x4; - var width34 = x3 - x4, height34 = y3 - y4; - var det3 = width12 * height34 - height12 * width34; - var x = (det1 * width34 - width12 * det2) / det3; - if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) { - var y = (det1 * height34 - height12 * det2) / det3; - if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) return true; - } - x3 = x4; - y3 = y4; - } - return false; - }, - getPolygon: function (attachment) { - var index = this.boundingBoxes.indexOf(attachment); - return index == -1 ? null : this.polygons[index]; - }, - getWidth: function () { - return this.maxX - this.minX; - }, - getHeight: function () { - return this.maxY - this.minY; - } -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/extras/Strip.js b/tutorial-2/pixi.js-master/src/pixi/extras/Strip.js deleted file mode 100755 index 6cff5df..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/extras/Strip.js +++ /dev/null @@ -1,469 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ - */ - - /** - * - * @class Strip - * @extends DisplayObjectContainer - * @constructor - * @param texture {Texture} The texture to use - * @param width {Number} the width - * @param height {Number} the height - * - */ -PIXI.Strip = function(texture) -{ - PIXI.DisplayObjectContainer.call( this ); - - - /** - * The texture of the strip - * - * @property texture - * @type Texture - */ - this.texture = texture; - - // set up the main bits.. - this.uvs = new PIXI.Float32Array([0, 1, - 1, 1, - 1, 0, - 0, 1]); - - this.vertices = new PIXI.Float32Array([0, 0, - 100, 0, - 100, 100, - 0, 100]); - - this.colors = new PIXI.Float32Array([1, 1, 1, 1]); - - this.indices = new PIXI.Uint16Array([0, 1, 2, 3]); - - /** - * Whether the strip is dirty or not - * - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode. - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - /** - * Triangles in canvas mode are automatically antialiased, use this value to force triangles to overlap a bit with each other. - * - * @property canvasPadding - * @type Number - */ - this.canvasPadding = 0; - - this.drawMode = PIXI.Strip.DrawModes.TRIANGLE_STRIP; - -}; - -// constructor -PIXI.Strip.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); -PIXI.Strip.prototype.constructor = PIXI.Strip; - -PIXI.Strip.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(!this.visible || this.alpha <= 0)return; - // render triangle strip.. - - renderSession.spriteBatch.stop(); - - // init! init! - if(!this._vertexBuffer)this._initWebGL(renderSession); - - renderSession.shaderManager.setShader(renderSession.shaderManager.stripShader); - - this._renderStrip(renderSession); - - ///renderSession.shaderManager.activateDefaultShader(); - - renderSession.spriteBatch.start(); - - //TODO check culling -}; - -PIXI.Strip.prototype._initWebGL = function(renderSession) -{ - // build the strip! - var gl = renderSession.gl; - - this._vertexBuffer = gl.createBuffer(); - this._indexBuffer = gl.createBuffer(); - this._uvBuffer = gl.createBuffer(); - this._colorBuffer = gl.createBuffer(); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvs, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._colorBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.colors, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); -}; - -PIXI.Strip.prototype._renderStrip = function(renderSession) -{ - var gl = renderSession.gl; - var projection = renderSession.projection, - offset = renderSession.offset, - shader = renderSession.shaderManager.stripShader; - - var drawMode = this.drawMode === PIXI.Strip.DrawModes.TRIANGLE_STRIP ? gl.TRIANGLE_STRIP : gl.TRIANGLES; - - // gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mat4Real); - - renderSession.blendModeManager.setBlendMode(this.blendMode); - - - // set uniforms - gl.uniformMatrix3fv(shader.translationMatrix, false, this.worldTransform.toArray(true)); - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - gl.uniform1f(shader.alpha, this.worldAlpha); - - if(!this.dirty) - { - - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - // update the uvs - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.activeTexture(gl.TEXTURE0); - - // check if a texture is dirty.. - if(this.texture.baseTexture._dirty[gl.id]) - { - renderSession.renderer.updateTexture(this.texture.baseTexture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]); - } - - // dont need to upload! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - - - } - else - { - - this.dirty = false; - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.STATIC_DRAW); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - // update the uvs - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvs, gl.STATIC_DRAW); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.activeTexture(gl.TEXTURE0); - - // check if a texture is dirty.. - if(this.texture.baseTexture._dirty[gl.id]) - { - renderSession.renderer.updateTexture(this.texture.baseTexture); - } - else - { - gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]); - } - - // dont need to upload! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - } - //console.log(gl.TRIANGLE_STRIP) - // - // - gl.drawElements(drawMode, this.indices.length, gl.UNSIGNED_SHORT, 0); - - -}; - - - -PIXI.Strip.prototype._renderCanvas = function(renderSession) -{ - var context = renderSession.context; - - var transform = this.worldTransform; - - if (renderSession.roundPixels) - { - context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx | 0, transform.ty | 0); - } - else - { - context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty); - } - - if (this.drawMode === PIXI.Strip.DrawModes.TRIANGLE_STRIP) - { - this._renderCanvasTriangleStrip(context); - } - else - { - this._renderCanvasTriangles(context); - } -}; - -PIXI.Strip.prototype._renderCanvasTriangleStrip = function(context) -{ - // draw triangles!! - var vertices = this.vertices; - var uvs = this.uvs; - - var length = vertices.length / 2; - this.count++; - - for (var i = 0; i < length - 2; i++) { - // draw some triangles! - var index = i * 2; - this._renderCanvasDrawTriangle(context, vertices, uvs, index, (index + 2), (index + 4)); - } -}; - -PIXI.Strip.prototype._renderCanvasTriangles = function(context) -{ - // draw triangles!! - var vertices = this.vertices; - var uvs = this.uvs; - var indices = this.indices; - - var length = indices.length; - this.count++; - - for (var i = 0; i < length; i += 3) { - // draw some triangles! - var index0 = indices[i] * 2, index1 = indices[i + 1] * 2, index2 = indices[i + 2] * 2; - this._renderCanvasDrawTriangle(context, vertices, uvs, index0, index1, index2); - } -}; - -PIXI.Strip.prototype._renderCanvasDrawTriangle = function(context, vertices, uvs, index0, index1, index2) -{ - var textureSource = this.texture.baseTexture.source; - var textureWidth = this.texture.width; - var textureHeight = this.texture.height; - - var x0 = vertices[index0], x1 = vertices[index1], x2 = vertices[index2]; - var y0 = vertices[index0 + 1], y1 = vertices[index1 + 1], y2 = vertices[index2 + 1]; - - var u0 = uvs[index0] * textureWidth, u1 = uvs[index1] * textureWidth, u2 = uvs[index2] * textureWidth; - var v0 = uvs[index0 + 1] * textureHeight, v1 = uvs[index1 + 1] * textureHeight, v2 = uvs[index2 + 1] * textureHeight; - - if (this.canvasPadding > 0) { - var paddingX = this.canvasPadding / this.worldTransform.a; - var paddingY = this.canvasPadding / this.worldTransform.d; - var centerX = (x0 + x1 + x2) / 3; - var centerY = (y0 + y1 + y2) / 3; - - var normX = x0 - centerX; - var normY = y0 - centerY; - - var dist = Math.sqrt(normX * normX + normY * normY); - x0 = centerX + (normX / dist) * (dist + paddingX); - y0 = centerY + (normY / dist) * (dist + paddingY); - - // - - normX = x1 - centerX; - normY = y1 - centerY; - - dist = Math.sqrt(normX * normX + normY * normY); - x1 = centerX + (normX / dist) * (dist + paddingX); - y1 = centerY + (normY / dist) * (dist + paddingY); - - normX = x2 - centerX; - normY = y2 - centerY; - - dist = Math.sqrt(normX * normX + normY * normY); - x2 = centerX + (normX / dist) * (dist + paddingX); - y2 = centerY + (normY / dist) * (dist + paddingY); - } - - context.save(); - context.beginPath(); - - - context.moveTo(x0, y0); - context.lineTo(x1, y1); - context.lineTo(x2, y2); - - context.closePath(); - - context.clip(); - - // Compute matrix transform - var delta = (u0 * v1) + (v0 * u2) + (u1 * v2) - (v1 * u2) - (v0 * u1) - (u0 * v2); - var deltaA = (x0 * v1) + (v0 * x2) + (x1 * v2) - (v1 * x2) - (v0 * x1) - (x0 * v2); - var deltaB = (u0 * x1) + (x0 * u2) + (u1 * x2) - (x1 * u2) - (x0 * u1) - (u0 * x2); - var deltaC = (u0 * v1 * x2) + (v0 * x1 * u2) + (x0 * u1 * v2) - (x0 * v1 * u2) - (v0 * u1 * x2) - (u0 * x1 * v2); - var deltaD = (y0 * v1) + (v0 * y2) + (y1 * v2) - (v1 * y2) - (v0 * y1) - (y0 * v2); - var deltaE = (u0 * y1) + (y0 * u2) + (u1 * y2) - (y1 * u2) - (y0 * u1) - (u0 * y2); - var deltaF = (u0 * v1 * y2) + (v0 * y1 * u2) + (y0 * u1 * v2) - (y0 * v1 * u2) - (v0 * u1 * y2) - (u0 * y1 * v2); - - context.transform(deltaA / delta, deltaD / delta, - deltaB / delta, deltaE / delta, - deltaC / delta, deltaF / delta); - - context.drawImage(textureSource, 0, 0); - context.restore(); -}; - - - -/** - * Renders a flat strip - * - * @method renderStripFlat - * @param strip {Strip} The Strip to render - * @private - */ -PIXI.Strip.prototype.renderStripFlat = function(strip) -{ - var context = this.context; - var vertices = strip.vertices; - - var length = vertices.length/2; - this.count++; - - context.beginPath(); - for (var i=1; i < length-2; i++) - { - // draw some triangles! - var index = i*2; - - var x0 = vertices[index], x1 = vertices[index+2], x2 = vertices[index+4]; - var y0 = vertices[index+1], y1 = vertices[index+3], y2 = vertices[index+5]; - - context.moveTo(x0, y0); - context.lineTo(x1, y1); - context.lineTo(x2, y2); - } - - context.fillStyle = '#FF0000'; - context.fill(); - context.closePath(); -}; - -/* -PIXI.Strip.prototype.setTexture = function(texture) -{ - //TODO SET THE TEXTURES - //TODO VISIBILITY - - // stop current texture - this.texture = texture; - this.width = texture.frame.width; - this.height = texture.frame.height; - this.updateFrame = true; -}; -*/ - -/** - * When the texture is updated, this event will fire to update the scale and frame - * - * @method onTextureUpdate - * @param event - * @private - */ - -PIXI.Strip.prototype.onTextureUpdate = function() -{ - this.updateFrame = true; -}; - -/** - * Returns the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account. - * - * @method getBounds - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle - */ -PIXI.Strip.prototype.getBounds = function(matrix) -{ - var worldTransform = matrix || this.worldTransform; - - var a = worldTransform.a; - var b = worldTransform.b; - var c = worldTransform.c; - var d = worldTransform.d; - var tx = worldTransform.tx; - var ty = worldTransform.ty; - - var maxX = -Infinity; - var maxY = -Infinity; - - var minX = Infinity; - var minY = Infinity; - - var vertices = this.vertices; - for (var i = 0, n = vertices.length; i < n; i += 2) - { - var rawX = vertices[i], rawY = vertices[i + 1]; - var x = (a * rawX) + (c * rawY) + tx; - var y = (d * rawY) + (b * rawX) + ty; - - minX = x < minX ? x : minX; - minY = y < minY ? y : minY; - - maxX = x > maxX ? x : maxX; - maxY = y > maxY ? y : maxY; - } - - if (minX === -Infinity || maxY === Infinity) - { - return PIXI.EmptyRectangle; - } - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - -/** - * Different drawing buffer modes supported - * - * @property - * @type {{TRIANGLE_STRIP: number, TRIANGLES: number}} - * @static - */ -PIXI.Strip.DrawModes = { - TRIANGLE_STRIP: 0, - TRIANGLES: 1 -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/extras/TilingSprite.js b/tutorial-2/pixi.js-master/src/pixi/extras/TilingSprite.js deleted file mode 100755 index 2ad39d2..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/extras/TilingSprite.js +++ /dev/null @@ -1,485 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * A tiling sprite is a fast way of rendering a tiling image - * - * @class TilingSprite - * @extends Sprite - * @constructor - * @param texture {Texture} the texture of the tiling sprite - * @param width {Number} the width of the tiling sprite - * @param height {Number} the height of the tiling sprite - */ -PIXI.TilingSprite = function(texture, width, height) -{ - PIXI.Sprite.call( this, texture); - - /** - * The with of the tiling sprite - * - * @property width - * @type Number - */ - this._width = width || 100; - - /** - * The height of the tiling sprite - * - * @property height - * @type Number - */ - this._height = height || 100; - - /** - * The scaling of the image that is being tiled - * - * @property tileScale - * @type Point - */ - this.tileScale = new PIXI.Point(1,1); - - /** - * A point that represents the scale of the texture object - * - * @property tileScaleOffset - * @type Point - */ - this.tileScaleOffset = new PIXI.Point(1,1); - - /** - * The offset position of the image that is being tiled - * - * @property tilePosition - * @type Point - */ - this.tilePosition = new PIXI.Point(0,0); - - /** - * Whether this sprite is renderable or not - * - * @property renderable - * @type Boolean - * @default true - */ - this.renderable = true; - - /** - * The tint applied to the sprite. This is a hex value - * - * @property tint - * @type Number - * @default 0xFFFFFF - */ - this.tint = 0xFFFFFF; - - /** - * The blend mode to be applied to the sprite - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - - -}; - -// constructor -PIXI.TilingSprite.prototype = Object.create(PIXI.Sprite.prototype); -PIXI.TilingSprite.prototype.constructor = PIXI.TilingSprite; - - -/** - * The width of the sprite, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.TilingSprite.prototype, 'width', { - get: function() { - return this._width; - }, - set: function(value) { - - this._width = value; - } -}); - -/** - * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.TilingSprite.prototype, 'height', { - get: function() { - return this._height; - }, - set: function(value) { - this._height = value; - } -}); - -PIXI.TilingSprite.prototype.setTexture = function(texture) -{ - if (this.texture === texture) return; - - this.texture = texture; - - this.refreshTexture = true; - - this.cachedTint = 0xFFFFFF; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.TilingSprite.prototype._renderWebGL = function(renderSession) -{ - if (this.visible === false || this.alpha === 0) return; - var i,j; - - if (this._mask) - { - renderSession.spriteBatch.stop(); - renderSession.maskManager.pushMask(this.mask, renderSession); - renderSession.spriteBatch.start(); - } - - if (this._filters) - { - renderSession.spriteBatch.flush(); - renderSession.filterManager.pushFilter(this._filterBlock); - } - - - - if (!this.tilingTexture || this.refreshTexture) - { - this.generateTilingTexture(true); - - if (this.tilingTexture && this.tilingTexture.needsUpdate) - { - //TODO - tweaking - renderSession.renderer.updateTexture(this.tilingTexture.baseTexture); - this.tilingTexture.needsUpdate = false; - // this.tilingTexture._uvs = null; - } - } - else - { - renderSession.spriteBatch.renderTilingSprite(this); - } - // simple render children! - for (i=0,j=this.children.length; i maxX ? x1 : maxX; - maxX = x2 > maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y1 > maxY ? y1 : maxY; - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - - - -/** - * When the texture is updated, this event will fire to update the scale and frame - * - * @method onTextureUpdate - * @param event - * @private - */ -PIXI.TilingSprite.prototype.onTextureUpdate = function() -{ - // overriding the sprite version of this! -}; - - -/** -* -* @method generateTilingTexture -* -* @param forcePowerOfTwo {Boolean} Whether we want to force the texture to be a power of two -*/ -PIXI.TilingSprite.prototype.generateTilingTexture = function(forcePowerOfTwo) -{ - if (!this.texture.baseTexture.hasLoaded) return; - - var texture = this.originalTexture || this.texture; - var frame = texture.frame; - var targetWidth, targetHeight; - - // Check that the frame is the same size as the base texture. - var isFrame = frame.width !== texture.baseTexture.width || frame.height !== texture.baseTexture.height; - - var newTextureRequired = false; - - if (!forcePowerOfTwo) - { - if (isFrame) - { - if (texture.trim) - { - targetWidth = texture.trim.width; - targetHeight = texture.trim.height; - } - else - { - targetWidth = frame.width; - targetHeight = frame.height; - } - - newTextureRequired = true; - } - } - else - { - targetWidth = PIXI.getNextPowerOfTwo(frame.width); - targetHeight = PIXI.getNextPowerOfTwo(frame.height); - - // If the BaseTexture dimensions don't match the texture frame then we need a new texture anyway because it's part of a texture atlas - if (frame.width !== targetWidth || frame.height !== targetHeight || texture.baseTexture.width !== targetWidth || texture.baseTexture.height || targetHeight) newTextureRequired = true; - } - - if (newTextureRequired) - { - var canvasBuffer; - - if (this.tilingTexture && this.tilingTexture.isTiling) - { - canvasBuffer = this.tilingTexture.canvasBuffer; - canvasBuffer.resize(targetWidth, targetHeight); - this.tilingTexture.baseTexture.width = targetWidth; - this.tilingTexture.baseTexture.height = targetHeight; - this.tilingTexture.needsUpdate = true; - } - else - { - canvasBuffer = new PIXI.CanvasBuffer(targetWidth, targetHeight); - - this.tilingTexture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); - this.tilingTexture.canvasBuffer = canvasBuffer; - this.tilingTexture.isTiling = true; - } - - canvasBuffer.context.drawImage(texture.baseTexture.source, - texture.crop.x, - texture.crop.y, - texture.crop.width, - texture.crop.height, - 0, - 0, - targetWidth, - targetHeight); - - this.tileScaleOffset.x = frame.width / targetWidth; - this.tileScaleOffset.y = frame.height / targetHeight; - } - else - { - // TODO - switching? - if (this.tilingTexture && this.tilingTexture.isTiling) - { - // destroy the tiling texture! - // TODO could store this somewhere? - this.tilingTexture.destroy(true); - } - - this.tileScaleOffset.x = 1; - this.tileScaleOffset.y = 1; - this.tilingTexture = texture; - } - - this.refreshTexture = false; - - this.originalTexture = this.texture; - this.texture = this.tilingTexture; - - this.tilingTexture.baseTexture._powerOf2 = true; -}; - -PIXI.TilingSprite.prototype.destroy = function () { - PIXI.Sprite.prototype.destroy.call(this); - - this.tileScale = null; - this.tileScaleOffset = null; - this.tilePosition = null; - - this.tilingTexture.destroy(true); - this.tilingTexture = null; -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/AbstractFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/AbstractFilter.js deleted file mode 100755 index 6727dc5..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/AbstractFilter.js +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This is the base class for creating a PIXI filter. Currently only webGL supports filters. - * If you want to make a custom filter this should be your base class. - * @class AbstractFilter - * @constructor - * @param fragmentSrc {Array} The fragment source in an array of strings. - * @param uniforms {Object} An object containing the uniforms for this filter. - */ -PIXI.AbstractFilter = function(fragmentSrc, uniforms) -{ - /** - * An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. - * For example the blur filter has two passes blurX and blurY. - * @property passes - * @type Array(Filter) - * @private - */ - this.passes = [this]; - - /** - * @property shaders - * @type Array(Shader) - * @private - */ - this.shaders = []; - - /** - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * @property padding - * @type Number - */ - this.padding = 0; - - /** - * @property uniforms - * @type object - * @private - */ - this.uniforms = uniforms || {}; - - /** - * @property fragmentSrc - * @type Array - * @private - */ - this.fragmentSrc = fragmentSrc || []; -}; - -PIXI.AbstractFilter.prototype.constructor = PIXI.AbstractFilter; - -/** - * Syncs the uniforms between the class object and the shaders. - * - * @method syncUniforms - */ -PIXI.AbstractFilter.prototype.syncUniforms = function() -{ - for(var i=0,j=this.shaders.length; i 0.2) n = 65600.0; // :', - ' if (gray > 0.3) n = 332772.0; // *', - ' if (gray > 0.4) n = 15255086.0; // o', - ' if (gray > 0.5) n = 23385164.0; // &', - ' if (gray > 0.6) n = 15252014.0; // 8', - ' if (gray > 0.7) n = 13199452.0; // @', - ' if (gray > 0.8) n = 11512810.0; // #', - - ' vec2 p = mod( uv / ( pixelSize * 0.5 ), 2.0) - vec2(1.0);', - ' col = col * character(n, p);', - - ' gl_FragColor = vec4(col, 1.0);', - '}' - ]; -}; - -PIXI.AsciiFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.AsciiFilter.prototype.constructor = PIXI.AsciiFilter; - -/** - * The pixel size used by the filter. - * - * @property size - * @type Number - */ -Object.defineProperty(PIXI.AsciiFilter.prototype, 'size', { - get: function() { - return this.uniforms.pixelSize.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.pixelSize.value = value; - } -}); \ No newline at end of file diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/BlurFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/BlurFilter.js deleted file mode 100755 index d93d147..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/BlurFilter.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The BlurFilter applies a Gaussian blur to an object. - * The strength of the blur can be set for x- and y-axis separately (always relative to the stage). - * - * @class BlurFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.BlurFilter = function() -{ - this.blurXFilter = new PIXI.BlurXFilter(); - this.blurYFilter = new PIXI.BlurYFilter(); - - this.passes =[this.blurXFilter, this.blurYFilter]; -}; - -PIXI.BlurFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.BlurFilter.prototype.constructor = PIXI.BlurFilter; - -/** - * Sets the strength of both the blurX and blurY properties simultaneously - * - * @property blur - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.BlurFilter.prototype, 'blur', { - get: function() { - return this.blurXFilter.blur; - }, - set: function(value) { - this.blurXFilter.blur = this.blurYFilter.blur = value; - } -}); - -/** - * Sets the strength of the blurX property - * - * @property blurX - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.BlurFilter.prototype, 'blurX', { - get: function() { - return this.blurXFilter.blur; - }, - set: function(value) { - this.blurXFilter.blur = value; - } -}); - -/** - * Sets the strength of the blurY property - * - * @property blurY - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.BlurFilter.prototype, 'blurY', { - get: function() { - return this.blurYFilter.blur; - }, - set: function(value) { - this.blurYFilter.blur = value; - } -}); diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/BlurXFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/BlurXFilter.js deleted file mode 100755 index 13f67c3..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/BlurXFilter.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The BlurXFilter applies a horizontal Gaussian blur to an object. - * - * @class BlurXFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.BlurXFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 1/512} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float blur;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' vec4 sum = vec4(0.0);', - - ' sum += texture2D(uSampler, vec2(vTextureCoord.x - 4.0*blur, vTextureCoord.y)) * 0.05;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x - 3.0*blur, vTextureCoord.y)) * 0.09;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x - 2.0*blur, vTextureCoord.y)) * 0.12;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x - blur, vTextureCoord.y)) * 0.15;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x + blur, vTextureCoord.y)) * 0.15;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x + 2.0*blur, vTextureCoord.y)) * 0.12;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x + 3.0*blur, vTextureCoord.y)) * 0.09;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x + 4.0*blur, vTextureCoord.y)) * 0.05;', - - ' gl_FragColor = sum;', - '}' - ]; -}; - -PIXI.BlurXFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.BlurXFilter.prototype.constructor = PIXI.BlurXFilter; - -/** - * Sets the strength of both the blur. - * - * @property blur - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.BlurXFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value / (1/7000); - }, - set: function(value) { - - this.dirty = true; - this.uniforms.blur.value = (1/7000) * value; - } -}); diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/BlurYFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/BlurYFilter.js deleted file mode 100755 index 5aecfef..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/BlurYFilter.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The BlurYFilter applies a vertical Gaussian blur to an object. - * - * @class BlurYFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.BlurYFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 1/512} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float blur;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' vec4 sum = vec4(0.0);', - - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 4.0*blur)) * 0.05;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 3.0*blur)) * 0.09;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 2.0*blur)) * 0.12;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - blur)) * 0.15;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + blur)) * 0.15;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 2.0*blur)) * 0.12;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 3.0*blur)) * 0.09;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 4.0*blur)) * 0.05;', - - ' gl_FragColor = sum;', - '}' - ]; -}; - -PIXI.BlurYFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.BlurYFilter.prototype.constructor = PIXI.BlurYFilter; - -/** - * Sets the strength of both the blur. - * - * @property blur - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.BlurYFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value / (1/7000); - }, - set: function(value) { - //this.padding = value; - this.uniforms.blur.value = (1/7000) * value; - } -}); diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/ColorMatrixFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/ColorMatrixFilter.js deleted file mode 100755 index 8f1dcbe..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/ColorMatrixFilter.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The ColorMatrixFilter class lets you apply a 4x4 matrix transformation on the RGBA - * color and alpha values of every pixel on your displayObject to produce a result - * with a new set of RGBA color and alpha values. It's pretty powerful! - * - * @class ColorMatrixFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.ColorMatrixFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - matrix: {type: 'mat4', value: [1,0,0,0, - 0,1,0,0, - 0,0,1,0, - 0,0,0,1]} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float invert;', - 'uniform mat4 matrix;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * matrix;', - // ' gl_FragColor = gl_FragColor;', - '}' - ]; -}; - -PIXI.ColorMatrixFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.ColorMatrixFilter.prototype.constructor = PIXI.ColorMatrixFilter; - -/** - * Sets the matrix of the color matrix filter - * - * @property matrix - * @type Array(Number) - * @default [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] - */ -Object.defineProperty(PIXI.ColorMatrixFilter.prototype, 'matrix', { - get: function() { - return this.uniforms.matrix.value; - }, - set: function(value) { - this.uniforms.matrix.value = value; - } -}); \ No newline at end of file diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/ColorStepFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/ColorStepFilter.js deleted file mode 100755 index 9481acd..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/ColorStepFilter.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This lowers the color depth of your image by the given amount, producing an image with a smaller palette. - * - * @class ColorStepFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.ColorStepFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - step: {type: '1f', value: 5} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'uniform float step;', - - 'void main(void) {', - ' vec4 color = texture2D(uSampler, vTextureCoord);', - ' color = floor(color * step) / step;', - ' gl_FragColor = color;', - '}' - ]; -}; - -PIXI.ColorStepFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.ColorStepFilter.prototype.constructor = PIXI.ColorStepFilter; - -/** - * The number of steps to reduce the palette by. - * - * @property step - * @type Number - */ -Object.defineProperty(PIXI.ColorStepFilter.prototype, 'step', { - get: function() { - return this.uniforms.step.value; - }, - set: function(value) { - this.uniforms.step.value = value; - } -}); diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/ConvolutionFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/ConvolutionFilter.js deleted file mode 100755 index 1d180d7..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/ConvolutionFilter.js +++ /dev/null @@ -1,106 +0,0 @@ -/** - * The ConvolutionFilter class applies a matrix convolution filter effect. - * A convolution combines pixels in the input image with neighboring pixels to produce a new image. - * A wide variety of image effects can be achieved through convolutions, including blurring, edge detection, sharpening, embossing, and beveling. - * The matrix should be specified as a 9 point Array. See http://docs.gimp.org/en/plug-in-convmatrix.html for more info. - * - * @class ConvolutionFilter - * @extends AbstractFilter - * @constructor - * @param matrix {Array} An array of values used for matrix transformation. Specified as a 9 point Array. - * @param width {Number} Width of the object you are transforming - * @param height {Number} Height of the object you are transforming - */ -PIXI.ConvolutionFilter = function(matrix, width, height) -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - m : {type: '1fv', value: new PIXI.Float32Array(matrix)}, - texelSizeX: {type: '1f', value: 1 / width}, - texelSizeY: {type: '1f', value: 1 / height} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying mediump vec2 vTextureCoord;', - 'uniform sampler2D texture;', - 'uniform float texelSizeX;', - 'uniform float texelSizeY;', - 'uniform float m[9];', - - 'vec2 px = vec2(texelSizeX, texelSizeY);', - - 'void main(void) {', - 'vec4 c11 = texture2D(texture, vTextureCoord - px);', // top left - 'vec4 c12 = texture2D(texture, vec2(vTextureCoord.x, vTextureCoord.y - px.y));', // top center - 'vec4 c13 = texture2D(texture, vec2(vTextureCoord.x + px.x, vTextureCoord.y - px.y));', // top right - - 'vec4 c21 = texture2D(texture, vec2(vTextureCoord.x - px.x, vTextureCoord.y) );', // mid left - 'vec4 c22 = texture2D(texture, vTextureCoord);', // mid center - 'vec4 c23 = texture2D(texture, vec2(vTextureCoord.x + px.x, vTextureCoord.y) );', // mid right - - 'vec4 c31 = texture2D(texture, vec2(vTextureCoord.x - px.x, vTextureCoord.y + px.y) );', // bottom left - 'vec4 c32 = texture2D(texture, vec2(vTextureCoord.x, vTextureCoord.y + px.y) );', // bottom center - 'vec4 c33 = texture2D(texture, vTextureCoord + px );', // bottom right - - 'gl_FragColor = ', - 'c11 * m[0] + c12 * m[1] + c22 * m[2] +', - 'c21 * m[3] + c22 * m[4] + c23 * m[5] +', - 'c31 * m[6] + c32 * m[7] + c33 * m[8];', - 'gl_FragColor.a = c22.a;', - '}' - ]; - -}; - -PIXI.ConvolutionFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.ConvolutionFilter.prototype.constructor = PIXI.ConvolutionFilter; - -/** - * An array of values used for matrix transformation. Specified as a 9 point Array. - * - * @property matrix - * @type Array - */ -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'matrix', { - get: function() { - return this.uniforms.m.value; - }, - set: function(value) { - this.uniforms.m.value = new PIXI.Float32Array(value); - } -}); - -/** - * Width of the object you are transforming - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'width', { - get: function() { - return this.uniforms.texelSizeX.value; - }, - set: function(value) { - this.uniforms.texelSizeX.value = 1/value; - } -}); - -/** - * Height of the object you are transforming - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'height', { - get: function() { - return this.uniforms.texelSizeY.value; - }, - set: function(value) { - this.uniforms.texelSizeY.value = 1/value; - } -}); diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/CrossHatchFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/CrossHatchFilter.js deleted file mode 100755 index 4b9f381..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/CrossHatchFilter.js +++ /dev/null @@ -1,80 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A Cross Hatch effect filter. - * - * @class CrossHatchFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.CrossHatchFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 1 / 512} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float blur;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);', - - ' gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);', - - ' if (lum < 1.00) {', - ' if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {', - ' gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);', - ' }', - ' }', - - ' if (lum < 0.75) {', - ' if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {', - ' gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);', - ' }', - ' }', - - ' if (lum < 0.50) {', - ' if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {', - ' gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);', - ' }', - ' }', - - ' if (lum < 0.3) {', - ' if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {', - ' gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);', - ' }', - ' }', - '}' - ]; -}; - -PIXI.CrossHatchFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.CrossHatchFilter.prototype.constructor = PIXI.CrossHatchFilter; - -/** - * Sets the strength of both the blur. - * - * @property blur - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.CrossHatchFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value / (1/7000); - }, - set: function(value) { - //this.padding = value; - this.uniforms.blur.value = (1/7000) * value; - } -}); diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/DisplacementFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/DisplacementFilter.js deleted file mode 100755 index 803b7b8..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/DisplacementFilter.js +++ /dev/null @@ -1,134 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The DisplacementFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. - * You can use this filter to apply all manor of crazy warping effects - * Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y. - * - * @class DisplacementFilter - * @extends AbstractFilter - * @constructor - * @param texture {Texture} The texture used for the displacement map * must be power of 2 texture at the moment - */ -PIXI.DisplacementFilter = function(texture) -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - texture.baseTexture._powerOf2 = true; - - // set the uniforms - this.uniforms = { - displacementMap: {type: 'sampler2D', value:texture}, - scale: {type: '2f', value:{x:30, y:30}}, - offset: {type: '2f', value:{x:0, y:0}}, - mapDimensions: {type: '2f', value:{x:1, y:5112}}, - dimensions: {type: '4fv', value:[0,0,0,0]} - }; - - if(texture.baseTexture.hasLoaded) - { - this.uniforms.mapDimensions.value.x = texture.width; - this.uniforms.mapDimensions.value.y = texture.height; - } - else - { - this.boundLoadedFunction = this.onTextureLoaded.bind(this); - - texture.baseTexture.on('loaded', this.boundLoadedFunction); - } - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D displacementMap;', - 'uniform sampler2D uSampler;', - 'uniform vec2 scale;', - 'uniform vec2 offset;', - 'uniform vec4 dimensions;', - 'uniform vec2 mapDimensions;',// = vec2(256.0, 256.0);', - // 'const vec2 textureDimensions = vec2(750.0, 750.0);', - - 'void main(void) {', - ' vec2 mapCords = vTextureCoord.xy;', - //' mapCords -= ;', - ' mapCords += (dimensions.zw + offset)/ dimensions.xy ;', - ' mapCords.y *= -1.0;', - ' mapCords.y += 1.0;', - ' vec2 matSample = texture2D(displacementMap, mapCords).xy;', - ' matSample -= 0.5;', - ' matSample *= scale;', - ' matSample /= mapDimensions;', - ' gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + matSample.x, vTextureCoord.y + matSample.y));', - ' gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb, 1.0);', - ' vec2 cord = vTextureCoord;', - - //' gl_FragColor = texture2D(displacementMap, cord);', - // ' gl_FragColor = gl_FragColor;', - '}' - ]; -}; - -PIXI.DisplacementFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.DisplacementFilter.prototype.constructor = PIXI.DisplacementFilter; - -/** - * Sets the map dimensions uniforms when the texture becomes available. - * - * @method onTextureLoaded - */ -PIXI.DisplacementFilter.prototype.onTextureLoaded = function() -{ - this.uniforms.mapDimensions.value.x = this.uniforms.displacementMap.value.width; - this.uniforms.mapDimensions.value.y = this.uniforms.displacementMap.value.height; - - this.uniforms.displacementMap.value.baseTexture.off('loaded', this.boundLoadedFunction); -}; - -/** - * The texture used for the displacement map. Must be power of 2 texture. - * - * @property map - * @type Texture - */ -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'map', { - get: function() { - return this.uniforms.displacementMap.value; - }, - set: function(value) { - this.uniforms.displacementMap.value = value; - } -}); - -/** - * The multiplier used to scale the displacement result from the map calculation. - * - * @property scale - * @type Point - */ -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'scale', { - get: function() { - return this.uniforms.scale.value; - }, - set: function(value) { - this.uniforms.scale.value = value; - } -}); - -/** - * The offset used to move the displacement map. - * - * @property offset - * @type Point - */ -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'offset', { - get: function() { - return this.uniforms.offset.value; - }, - set: function(value) { - this.uniforms.offset.value = value; - } -}); diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/DotScreenFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/DotScreenFilter.js deleted file mode 100755 index 5a7462f..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/DotScreenFilter.js +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/fun/dotscreen.js - */ - -/** - * This filter applies a dotscreen effect making display objects appear to be made out of black and white halftone dots like an old printer. - * - * @class DotScreenFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.DotScreenFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - scale: {type: '1f', value:1}, - angle: {type: '1f', value:5}, - dimensions: {type: '4fv', value:[0,0,0,0]} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform vec4 dimensions;', - 'uniform sampler2D uSampler;', - - 'uniform float angle;', - 'uniform float scale;', - - 'float pattern() {', - ' float s = sin(angle), c = cos(angle);', - ' vec2 tex = vTextureCoord * dimensions.xy;', - ' vec2 point = vec2(', - ' c * tex.x - s * tex.y,', - ' s * tex.x + c * tex.y', - ' ) * scale;', - ' return (sin(point.x) * sin(point.y)) * 4.0;', - '}', - - 'void main() {', - ' vec4 color = texture2D(uSampler, vTextureCoord);', - ' float average = (color.r + color.g + color.b) / 3.0;', - ' gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);', - '}' - ]; -}; - -PIXI.DotScreenFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.DotScreenFilter.prototype.constructor = PIXI.DotScreenFilter; - -/** - * The scale of the effect. - * @property scale - * @type Number - */ -Object.defineProperty(PIXI.DotScreenFilter.prototype, 'scale', { - get: function() { - return this.uniforms.scale.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.scale.value = value; - } -}); - -/** - * The radius of the effect. - * @property angle - * @type Number - */ -Object.defineProperty(PIXI.DotScreenFilter.prototype, 'angle', { - get: function() { - return this.uniforms.angle.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.angle.value = value; - } -}); diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/FilterBlock.js b/tutorial-2/pixi.js-master/src/pixi/filters/FilterBlock.js deleted file mode 100755 index fbdacc2..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/FilterBlock.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A target and pass info object for filters. - * - * @class FilterBlock - * @constructor - */ -PIXI.FilterBlock = function() -{ - /** - * The visible state of this FilterBlock. - * - * @property visible - * @type Boolean - */ - this.visible = true; - - /** - * The renderable state of this FilterBlock. - * - * @property renderable - * @type Boolean - */ - this.renderable = true; -}; - -PIXI.FilterBlock.prototype.constructor = PIXI.FilterBlock; diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/GrayFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/GrayFilter.js deleted file mode 100755 index 201d026..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/GrayFilter.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This greyscales the palette of your Display Objects. - * - * @class GrayFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.GrayFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - gray: {type: '1f', value: 1} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'uniform float gray;', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord);', - ' gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(0.2126*gl_FragColor.r + 0.7152*gl_FragColor.g + 0.0722*gl_FragColor.b), gray);', - // ' gl_FragColor = gl_FragColor;', - '}' - ]; -}; - -PIXI.GrayFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.GrayFilter.prototype.constructor = PIXI.GrayFilter; - -/** - * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color. - * @property gray - * @type Number - */ -Object.defineProperty(PIXI.GrayFilter.prototype, 'gray', { - get: function() { - return this.uniforms.gray.value; - }, - set: function(value) { - this.uniforms.gray.value = value; - } -}); diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/InvertFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/InvertFilter.js deleted file mode 100755 index 7f5e84c..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/InvertFilter.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This inverts your Display Objects colors. - * - * @class InvertFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.InvertFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - invert: {type: '1f', value: 1} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float invert;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord);', - ' gl_FragColor.rgb = mix( (vec3(1)-gl_FragColor.rgb) * gl_FragColor.a, gl_FragColor.rgb, 1.0 - invert);', - //' gl_FragColor.rgb = gl_FragColor.rgb * gl_FragColor.a;', - // ' gl_FragColor = gl_FragColor * vColor;', - '}' - ]; -}; - -PIXI.InvertFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.InvertFilter.prototype.constructor = PIXI.InvertFilter; - -/** - * The strength of the invert. 1 will fully invert the colors, 0 will make the object its normal color - * @property invert - * @type Number -*/ -Object.defineProperty(PIXI.InvertFilter.prototype, 'invert', { - get: function() { - return this.uniforms.invert.value; - }, - set: function(value) { - this.uniforms.invert.value = value; - } -}); diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/NoiseFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/NoiseFilter.js deleted file mode 100755 index ff248e4..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/NoiseFilter.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @author Vico @vicocotea - * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js - */ - -/** - * A Noise effect filter. - * - * @class NoiseFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.NoiseFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - noise: {type: '1f', value: 0.5} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'uniform sampler2D uSampler;', - 'uniform float noise;', - 'varying vec2 vTextureCoord;', - - 'float rand(vec2 co) {', - ' return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);', - '}', - 'void main() {', - ' vec4 color = texture2D(uSampler, vTextureCoord);', - - ' float diff = (rand(vTextureCoord) - 0.5) * noise;', - ' color.r += diff;', - ' color.g += diff;', - ' color.b += diff;', - - ' gl_FragColor = color;', - '}' - ]; -}; - -PIXI.NoiseFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.NoiseFilter.prototype.constructor = PIXI.NoiseFilter; - -/** - * The amount of noise to apply. - * @property noise - * @type Number -*/ -Object.defineProperty(PIXI.NoiseFilter.prototype, 'noise', { - get: function() { - return this.uniforms.noise.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.noise.value = value; - } -}); diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/NormalMapFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/NormalMapFilter.js deleted file mode 100755 index e686905..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/NormalMapFilter.js +++ /dev/null @@ -1,196 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - - -/** - * The NormalMapFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. - * You can use this filter to apply all manor of crazy warping effects - * Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y. - * - * @class NormalMapFilter - * @extends AbstractFilter - * @constructor - * @param texture {Texture} The texture used for the displacement map * must be power of 2 texture at the moment - */ -PIXI.NormalMapFilter = function(texture) -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - texture.baseTexture._powerOf2 = true; - - // set the uniforms - this.uniforms = { - displacementMap: {type: 'sampler2D', value:texture}, - scale: {type: '2f', value:{x:15, y:15}}, - offset: {type: '2f', value:{x:0, y:0}}, - mapDimensions: {type: '2f', value:{x:1, y:1}}, - dimensions: {type: '4f', value:[0,0,0,0]}, - // LightDir: {type: 'f3', value:[0, 1, 0]}, - LightPos: {type: '3f', value:[0, 1, 0]} - }; - - - if(texture.baseTexture.hasLoaded) - { - this.uniforms.mapDimensions.value.x = texture.width; - this.uniforms.mapDimensions.value.y = texture.height; - } - else - { - this.boundLoadedFunction = this.onTextureLoaded.bind(this); - - texture.baseTexture.on("loaded", this.boundLoadedFunction); - } - - this.fragmentSrc = [ - "precision mediump float;", - "varying vec2 vTextureCoord;", - "varying float vColor;", - "uniform sampler2D displacementMap;", - "uniform sampler2D uSampler;", - - "uniform vec4 dimensions;", - - "const vec2 Resolution = vec2(1.0,1.0);", //resolution of screen - "uniform vec3 LightPos;", //light position, normalized - "const vec4 LightColor = vec4(1.0, 1.0, 1.0, 1.0);", //light RGBA -- alpha is intensity - "const vec4 AmbientColor = vec4(1.0, 1.0, 1.0, 0.5);", //ambient RGBA -- alpha is intensity - "const vec3 Falloff = vec3(0.0, 1.0, 0.2);", //attenuation coefficients - - "uniform vec3 LightDir;",//" = vec3(1.0, 0.0, 1.0);", - - - "uniform vec2 mapDimensions;",// = vec2(256.0, 256.0);", - - - "void main(void) {", - "vec2 mapCords = vTextureCoord.xy;", - - "vec4 color = texture2D(uSampler, vTextureCoord.st);", - "vec3 nColor = texture2D(displacementMap, vTextureCoord.st).rgb;", - - - "mapCords *= vec2(dimensions.x/512.0, dimensions.y/512.0);", - - "mapCords.y *= -1.0;", - "mapCords.y += 1.0;", - - //RGBA of our diffuse color - "vec4 DiffuseColor = texture2D(uSampler, vTextureCoord);", - - //RGB of our normal map - "vec3 NormalMap = texture2D(displacementMap, mapCords).rgb;", - - //The delta position of light - //"vec3 LightDir = vec3(LightPos.xy - (gl_FragCoord.xy / Resolution.xy), LightPos.z);", - "vec3 LightDir = vec3(LightPos.xy - (mapCords.xy), LightPos.z);", - //Correct for aspect ratio - //"LightDir.x *= Resolution.x / Resolution.y;", - - //Determine distance (used for attenuation) BEFORE we normalize our LightDir - "float D = length(LightDir);", - - //normalize our vectors - "vec3 N = normalize(NormalMap * 2.0 - 1.0);", - "vec3 L = normalize(LightDir);", - - //Pre-multiply light color with intensity - //Then perform "N dot L" to determine our diffuse term - "vec3 Diffuse = (LightColor.rgb * LightColor.a) * max(dot(N, L), 0.0);", - - //pre-multiply ambient color with intensity - "vec3 Ambient = AmbientColor.rgb * AmbientColor.a;", - - //calculate attenuation - "float Attenuation = 1.0 / ( Falloff.x + (Falloff.y*D) + (Falloff.z*D*D) );", - - //the calculation which brings it all together - "vec3 Intensity = Ambient + Diffuse * Attenuation;", - "vec3 FinalColor = DiffuseColor.rgb * Intensity;", - "gl_FragColor = vColor * vec4(FinalColor, DiffuseColor.a);", - //"gl_FragColor = vec4(1.0, 0.0, 0.0, Attenuation);",//vColor * vec4(FinalColor, DiffuseColor.a);", - /* - // normalise color - "vec3 normal = normalize(nColor * 2.0 - 1.0);", - - "vec3 deltaPos = vec3( (light.xy - gl_FragCoord.xy) / resolution.xy, light.z );", - - "float lambert = clamp(dot(normal, lightDir), 0.0, 1.0);", - - "float d = sqrt(dot(deltaPos, deltaPos));", - "float att = 1.0 / ( attenuation.x + (attenuation.y*d) + (attenuation.z*d*d) );", - - "vec3 result = (ambientColor * ambientIntensity) + (lightColor.rgb * lambert) * att;", - "result *= color.rgb;", - - "gl_FragColor = vec4(result, 1.0);",*/ - - - - "}" - ]; - -} - -PIXI.NormalMapFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.NormalMapFilter.prototype.constructor = PIXI.NormalMapFilter; - -/** - * Sets the map dimensions uniforms when the texture becomes available. - * - * @method onTextureLoaded - */ -PIXI.NormalMapFilter.prototype.onTextureLoaded = function() -{ - this.uniforms.mapDimensions.value.x = this.uniforms.displacementMap.value.width; - this.uniforms.mapDimensions.value.y = this.uniforms.displacementMap.value.height; - - this.uniforms.displacementMap.value.baseTexture.off("loaded", this.boundLoadedFunction) -}; - -/** - * The texture used for the displacement map. Must be power of 2 texture. - * - * @property map - * @type Texture - */ -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'map', { - get: function() { - return this.uniforms.displacementMap.value; - }, - set: function(value) { - this.uniforms.displacementMap.value = value; - } -}); - -/** - * The multiplier used to scale the displacement result from the map calculation. - * - * @property scale - * @type Point - */ -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'scale', { - get: function() { - return this.uniforms.scale.value; - }, - set: function(value) { - this.uniforms.scale.value = value; - } -}); - -/** - * The offset used to move the displacement map. - * - * @property offset - * @type Point - */ -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'offset', { - get: function() { - return this.uniforms.offset.value; - }, - set: function(value) { - this.uniforms.offset.value = value; - } -}); diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/PixelateFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/PixelateFilter.js deleted file mode 100755 index 2a3127d..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/PixelateFilter.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This filter applies a pixelate effect making display objects appear 'blocky'. - * - * @class PixelateFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.PixelateFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - invert: {type: '1f', value: 0}, - dimensions: {type: '4fv', value:new PIXI.Float32Array([10000, 100, 10, 10])}, - pixelSize: {type: '2f', value:{x:10, y:10}} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform vec2 testDim;', - 'uniform vec4 dimensions;', - 'uniform vec2 pixelSize;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' vec2 coord = vTextureCoord;', - - ' vec2 size = dimensions.xy/pixelSize;', - - ' vec2 color = floor( ( vTextureCoord * size ) ) / size + pixelSize/dimensions.xy * 0.5;', - ' gl_FragColor = texture2D(uSampler, color);', - '}' - ]; -}; - -PIXI.PixelateFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.PixelateFilter.prototype.constructor = PIXI.PixelateFilter; - -/** - * This a point that describes the size of the blocks. x is the width of the block and y is the height. - * - * @property size - * @type Point - */ -Object.defineProperty(PIXI.PixelateFilter.prototype, 'size', { - get: function() { - return this.uniforms.pixelSize.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.pixelSize.value = value; - } -}); diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/RGBSplitFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/RGBSplitFilter.js deleted file mode 100755 index 7169637..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/RGBSplitFilter.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * An RGB Split Filter. - * - * @class RGBSplitFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.RGBSplitFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - red: {type: '2f', value: {x:20, y:20}}, - green: {type: '2f', value: {x:-20, y:20}}, - blue: {type: '2f', value: {x:20, y:-20}}, - dimensions: {type: '4fv', value:[0,0,0,0]} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform vec2 red;', - 'uniform vec2 green;', - 'uniform vec2 blue;', - 'uniform vec4 dimensions;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/dimensions.xy).r;', - ' gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/dimensions.xy).g;', - ' gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/dimensions.xy).b;', - ' gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;', - '}' - ]; -}; - -PIXI.RGBSplitFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.RGBSplitFilter.prototype.constructor = PIXI.RGBSplitFilter; - -/** - * Red channel offset. - * - * @property red - * @type Point - */ -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'red', { - get: function() { - return this.uniforms.red.value; - }, - set: function(value) { - this.uniforms.red.value = value; - } -}); - -/** - * Green channel offset. - * - * @property green - * @type Point - */ -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'green', { - get: function() { - return this.uniforms.green.value; - }, - set: function(value) { - this.uniforms.green.value = value; - } -}); - -/** - * Blue offset. - * - * @property blue - * @type Point - */ -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'blue', { - get: function() { - return this.uniforms.blue.value; - }, - set: function(value) { - this.uniforms.blue.value = value; - } -}); diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/SepiaFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/SepiaFilter.js deleted file mode 100755 index 5596e53..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/SepiaFilter.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This applies a sepia effect to your Display Objects. - * - * @class SepiaFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.SepiaFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - sepia: {type: '1f', value: 1} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float sepia;', - 'uniform sampler2D uSampler;', - - 'const mat3 sepiaMatrix = mat3(0.3588, 0.7044, 0.1368, 0.2990, 0.5870, 0.1140, 0.2392, 0.4696, 0.0912);', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord);', - ' gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb * sepiaMatrix, sepia);', - // ' gl_FragColor = gl_FragColor * vColor;', - '}' - ]; -}; - -PIXI.SepiaFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.SepiaFilter.prototype.constructor = PIXI.SepiaFilter; - -/** - * The strength of the sepia. 1 will apply the full sepia effect, 0 will make the object its normal color. - * @property sepia - * @type Number -*/ -Object.defineProperty(PIXI.SepiaFilter.prototype, 'sepia', { - get: function() { - return this.uniforms.sepia.value; - }, - set: function(value) { - this.uniforms.sepia.value = value; - } -}); diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/SmartBlurFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/SmartBlurFilter.js deleted file mode 100755 index 44a47f4..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/SmartBlurFilter.js +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A Smart Blur Filter. - * - * @class SmartBlurFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.SmartBlurFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 1/512} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'uniform sampler2D uSampler;', - //'uniform vec2 delta;', - 'const vec2 delta = vec2(1.0/10.0, 0.0);', - //'uniform float darkness;', - - 'float random(vec3 scale, float seed) {', - ' return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);', - '}', - - - 'void main(void) {', - ' vec4 color = vec4(0.0);', - ' float total = 0.0;', - - ' float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);', - - ' for (float t = -30.0; t <= 30.0; t++) {', - ' float percent = (t + offset - 0.5) / 30.0;', - ' float weight = 1.0 - abs(percent);', - ' vec4 sample = texture2D(uSampler, vTextureCoord + delta * percent);', - ' sample.rgb *= sample.a;', - ' color += sample * weight;', - ' total += weight;', - ' }', - - ' gl_FragColor = color / total;', - ' gl_FragColor.rgb /= gl_FragColor.a + 0.00001;', - //' gl_FragColor.rgb *= darkness;', - '}' - ]; -}; - -PIXI.SmartBlurFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.SmartBlurFilter.prototype.constructor = PIXI.SmartBlurFilter; - -/** - * The strength of the blur. - * - * @property blur - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.SmartBlurFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value; - }, - set: function(value) { - this.uniforms.blur.value = value; - } -}); diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/TiltShiftFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/TiltShiftFilter.js deleted file mode 100755 index 2eb3776..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/TiltShiftFilter.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @author Vico @vicocotea - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/ - */ - -/** - * A TiltShift Filter. Manages the pass of both a TiltShiftXFilter and TiltShiftYFilter. - * - * @class TiltShiftFilter - * @constructor - */ -PIXI.TiltShiftFilter = function() -{ - this.tiltShiftXFilter = new PIXI.TiltShiftXFilter(); - this.tiltShiftYFilter = new PIXI.TiltShiftYFilter(); - this.tiltShiftXFilter.updateDelta(); - this.tiltShiftXFilter.updateDelta(); - - this.passes = [this.tiltShiftXFilter, this.tiltShiftYFilter]; -}; - -PIXI.TiltShiftFilter.prototype.constructor = PIXI.TiltShiftFilter; - -/** - * The strength of the blur. - * - * @property blur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'blur', { - get: function() { - return this.tiltShiftXFilter.blur; - }, - set: function(value) { - this.tiltShiftXFilter.blur = this.tiltShiftYFilter.blur = value; - } -}); - -/** - * The strength of the gradient blur. - * - * @property gradientBlur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'gradientBlur', { - get: function() { - return this.tiltShiftXFilter.gradientBlur; - }, - set: function(value) { - this.tiltShiftXFilter.gradientBlur = this.tiltShiftYFilter.gradientBlur = value; - } -}); - -/** - * The Y value to start the effect at. - * - * @property start - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'start', { - get: function() { - return this.tiltShiftXFilter.start; - }, - set: function(value) { - this.tiltShiftXFilter.start = this.tiltShiftYFilter.start = value; - } -}); - -/** - * The Y value to end the effect at. - * - * @property end - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'end', { - get: function() { - return this.tiltShiftXFilter.end; - }, - set: function(value) { - this.tiltShiftXFilter.end = this.tiltShiftYFilter.end = value; - } -}); diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/TiltShiftXFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/TiltShiftXFilter.js deleted file mode 100755 index 29d8f38..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/TiltShiftXFilter.js +++ /dev/null @@ -1,149 +0,0 @@ -/** - * @author Vico @vicocotea - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/ - */ - -/** - * A TiltShiftXFilter. - * - * @class TiltShiftXFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.TiltShiftXFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 100.0}, - gradientBlur: {type: '1f', value: 600.0}, - start: {type: '2f', value:{x:0, y:window.screenHeight / 2}}, - end: {type: '2f', value:{x:600, y:window.screenHeight / 2}}, - delta: {type: '2f', value:{x:30, y:30}}, - texSize: {type: '2f', value:{x:window.screenWidth, y:window.screenHeight}} - }; - - this.updateDelta(); - - this.fragmentSrc = [ - 'precision mediump float;', - 'uniform sampler2D uSampler;', - 'uniform float blur;', - 'uniform float gradientBlur;', - 'uniform vec2 start;', - 'uniform vec2 end;', - 'uniform vec2 delta;', - 'uniform vec2 texSize;', - 'varying vec2 vTextureCoord;', - - 'float random(vec3 scale, float seed) {', - ' return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);', - '}', - - 'void main(void) {', - ' vec4 color = vec4(0.0);', - ' float total = 0.0;', - - ' float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);', - ' vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));', - ' float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;', - - ' for (float t = -30.0; t <= 30.0; t++) {', - ' float percent = (t + offset - 0.5) / 30.0;', - ' float weight = 1.0 - abs(percent);', - ' vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);', - ' sample.rgb *= sample.a;', - ' color += sample * weight;', - ' total += weight;', - ' }', - - ' gl_FragColor = color / total;', - ' gl_FragColor.rgb /= gl_FragColor.a + 0.00001;', - '}' - ]; -}; - -PIXI.TiltShiftXFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.TiltShiftXFilter.prototype.constructor = PIXI.TiltShiftXFilter; - -/** - * The strength of the blur. - * - * @property blur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.blur.value = value; - } -}); - -/** - * The strength of the gradient blur. - * - * @property gradientBlur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'gradientBlur', { - get: function() { - return this.uniforms.gradientBlur.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.gradientBlur.value = value; - } -}); - -/** - * The X value to start the effect at. - * - * @property start - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'start', { - get: function() { - return this.uniforms.start.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.start.value = value; - this.updateDelta(); - } -}); - -/** - * The X value to end the effect at. - * - * @property end - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'end', { - get: function() { - return this.uniforms.end.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.end.value = value; - this.updateDelta(); - } -}); - -/** - * Updates the filter delta values. - * - * @method updateDelta - */ -PIXI.TiltShiftXFilter.prototype.updateDelta = function(){ - var dx = this.uniforms.end.value.x - this.uniforms.start.value.x; - var dy = this.uniforms.end.value.y - this.uniforms.start.value.y; - var d = Math.sqrt(dx * dx + dy * dy); - this.uniforms.delta.value.x = dx / d; - this.uniforms.delta.value.y = dy / d; -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/TiltShiftYFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/TiltShiftYFilter.js deleted file mode 100755 index 3a92851..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/TiltShiftYFilter.js +++ /dev/null @@ -1,149 +0,0 @@ -/** - * @author Vico @vicocotea - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/ - */ - -/** - * A TiltShiftYFilter. - * - * @class TiltShiftYFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.TiltShiftYFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 100.0}, - gradientBlur: {type: '1f', value: 600.0}, - start: {type: '2f', value:{x:0, y:window.screenHeight / 2}}, - end: {type: '2f', value:{x:600, y:window.screenHeight / 2}}, - delta: {type: '2f', value:{x:30, y:30}}, - texSize: {type: '2f', value:{x:window.screenWidth, y:window.screenHeight}} - }; - - this.updateDelta(); - - this.fragmentSrc = [ - 'precision mediump float;', - 'uniform sampler2D uSampler;', - 'uniform float blur;', - 'uniform float gradientBlur;', - 'uniform vec2 start;', - 'uniform vec2 end;', - 'uniform vec2 delta;', - 'uniform vec2 texSize;', - 'varying vec2 vTextureCoord;', - - 'float random(vec3 scale, float seed) {', - ' return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);', - '}', - - 'void main(void) {', - ' vec4 color = vec4(0.0);', - ' float total = 0.0;', - - ' float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);', - ' vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));', - ' float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;', - - ' for (float t = -30.0; t <= 30.0; t++) {', - ' float percent = (t + offset - 0.5) / 30.0;', - ' float weight = 1.0 - abs(percent);', - ' vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);', - ' sample.rgb *= sample.a;', - ' color += sample * weight;', - ' total += weight;', - ' }', - - ' gl_FragColor = color / total;', - ' gl_FragColor.rgb /= gl_FragColor.a + 0.00001;', - '}' - ]; -}; - -PIXI.TiltShiftYFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.TiltShiftYFilter.prototype.constructor = PIXI.TiltShiftYFilter; - -/** - * The strength of the blur. - * - * @property blur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.blur.value = value; - } -}); - -/** - * The strength of the gradient blur. - * - * @property gradientBlur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'gradientBlur', { - get: function() { - return this.uniforms.gradientBlur.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.gradientBlur.value = value; - } -}); - -/** - * The Y value to start the effect at. - * - * @property start - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'start', { - get: function() { - return this.uniforms.start.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.start.value = value; - this.updateDelta(); - } -}); - -/** - * The Y value to end the effect at. - * - * @property end - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'end', { - get: function() { - return this.uniforms.end.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.end.value = value; - this.updateDelta(); - } -}); - -/** - * Updates the filter delta values. - * - * @method updateDelta - */ -PIXI.TiltShiftYFilter.prototype.updateDelta = function(){ - var dx = this.uniforms.end.value.x - this.uniforms.start.value.x; - var dy = this.uniforms.end.value.y - this.uniforms.start.value.y; - var d = Math.sqrt(dx * dx + dy * dy); - this.uniforms.delta.value.x = -dy / d; - this.uniforms.delta.value.y = dx / d; -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/filters/TwistFilter.js b/tutorial-2/pixi.js-master/src/pixi/filters/TwistFilter.js deleted file mode 100755 index 08a3122..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/filters/TwistFilter.js +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This filter applies a twist effect making display objects appear twisted in the given direction. - * - * @class TwistFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.TwistFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - radius: {type: '1f', value:0.5}, - angle: {type: '1f', value:5}, - offset: {type: '2f', value:{x:0.5, y:0.5}} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform vec4 dimensions;', - 'uniform sampler2D uSampler;', - - 'uniform float radius;', - 'uniform float angle;', - 'uniform vec2 offset;', - - 'void main(void) {', - ' vec2 coord = vTextureCoord - offset;', - ' float distance = length(coord);', - - ' if (distance < radius) {', - ' float ratio = (radius - distance) / radius;', - ' float angleMod = ratio * ratio * angle;', - ' float s = sin(angleMod);', - ' float c = cos(angleMod);', - ' coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);', - ' }', - - ' gl_FragColor = texture2D(uSampler, coord+offset);', - '}' - ]; -}; - -PIXI.TwistFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.TwistFilter.prototype.constructor = PIXI.TwistFilter; - -/** - * This point describes the the offset of the twist. - * - * @property offset - * @type Point - */ -Object.defineProperty(PIXI.TwistFilter.prototype, 'offset', { - get: function() { - return this.uniforms.offset.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.offset.value = value; - } -}); - -/** - * This radius of the twist. - * - * @property radius - * @type Number - */ -Object.defineProperty(PIXI.TwistFilter.prototype, 'radius', { - get: function() { - return this.uniforms.radius.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.radius.value = value; - } -}); - -/** - * This angle of the twist. - * - * @property angle - * @type Number - */ -Object.defineProperty(PIXI.TwistFilter.prototype, 'angle', { - get: function() { - return this.uniforms.angle.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.angle.value = value; - } -}); diff --git a/tutorial-2/pixi.js-master/src/pixi/geom/Circle.js b/tutorial-2/pixi.js-master/src/pixi/geom/Circle.js deleted file mode 100755 index 47288c6..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/geom/Circle.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @author Chad Engler - */ - -/** - * The Circle object can be used to specify a hit area for displayObjects - * - * @class Circle - * @constructor - * @param x {Number} The X coordinate of the center of this circle - * @param y {Number} The Y coordinate of the center of this circle - * @param radius {Number} The radius of the circle - */ -PIXI.Circle = function(x, y, radius) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property radius - * @type Number - * @default 0 - */ - this.radius = radius || 0; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.CIRC in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Circle instance - * - * @method clone - * @return {Circle} a copy of the Circle - */ -PIXI.Circle.prototype.clone = function() -{ - return new PIXI.Circle(this.x, this.y, this.radius); -}; - -/** - * Checks whether the x and y coordinates given are contained within this circle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Circle - */ -PIXI.Circle.prototype.contains = function(x, y) -{ - if(this.radius <= 0) - return false; - - var dx = (this.x - x), - dy = (this.y - y), - r2 = this.radius * this.radius; - - dx *= dx; - dy *= dy; - - return (dx + dy <= r2); -}; - -/** -* Returns the framing rectangle of the circle as a PIXI.Rectangle object -* -* @method getBounds -* @return {Rectangle} the framing rectangle -*/ -PIXI.Circle.prototype.getBounds = function() -{ - return new PIXI.Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2); -}; - -// constructor -PIXI.Circle.prototype.constructor = PIXI.Circle; diff --git a/tutorial-2/pixi.js-master/src/pixi/geom/Ellipse.js b/tutorial-2/pixi.js-master/src/pixi/geom/Ellipse.js deleted file mode 100755 index 2700a71..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/geom/Ellipse.js +++ /dev/null @@ -1,100 +0,0 @@ -/** - * @author Chad Engler - */ - -/** - * The Ellipse object can be used to specify a hit area for displayObjects - * - * @class Ellipse - * @constructor - * @param x {Number} The X coordinate of the center of the ellipse - * @param y {Number} The Y coordinate of the center of the ellipse - * @param width {Number} The half width of this ellipse - * @param height {Number} The half height of this ellipse - */ -PIXI.Ellipse = function(x, y, width, height) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.ELIP in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Ellipse instance - * - * @method clone - * @return {Ellipse} a copy of the ellipse - */ -PIXI.Ellipse.prototype.clone = function() -{ - return new PIXI.Ellipse(this.x, this.y, this.width, this.height); -}; - -/** - * Checks whether the x and y coordinates given are contained within this ellipse - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coords are within this ellipse - */ -PIXI.Ellipse.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - //normalize the coords to an ellipse with center 0,0 - var normx = ((x - this.x) / this.width), - normy = ((y - this.y) / this.height); - - normx *= normx; - normy *= normy; - - return (normx + normy <= 1); -}; - -/** -* Returns the framing rectangle of the ellipse as a PIXI.Rectangle object -* -* @method getBounds -* @return {Rectangle} the framing rectangle -*/ -PIXI.Ellipse.prototype.getBounds = function() -{ - return new PIXI.Rectangle(this.x - this.width, this.y - this.height, this.width, this.height); -}; - -// constructor -PIXI.Ellipse.prototype.constructor = PIXI.Ellipse; diff --git a/tutorial-2/pixi.js-master/src/pixi/geom/Matrix.js b/tutorial-2/pixi.js-master/src/pixi/geom/Matrix.js deleted file mode 100755 index b0f043f..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/geom/Matrix.js +++ /dev/null @@ -1,268 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Matrix class is now an object, which makes it a lot faster, - * here is a representation of it : - * | a | b | tx| - * | c | d | ty| - * | 0 | 0 | 1 | - * - * @class Matrix - * @constructor - */ -PIXI.Matrix = function() -{ - /** - * @property a - * @type Number - * @default 1 - */ - this.a = 1; - - /** - * @property b - * @type Number - * @default 0 - */ - this.b = 0; - - /** - * @property c - * @type Number - * @default 0 - */ - this.c = 0; - - /** - * @property d - * @type Number - * @default 1 - */ - this.d = 1; - - /** - * @property tx - * @type Number - * @default 0 - */ - this.tx = 0; - - /** - * @property ty - * @type Number - * @default 0 - */ - this.ty = 0; -}; - -/** - * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows: - * - * a = array[0] - * b = array[1] - * c = array[3] - * d = array[4] - * tx = array[2] - * ty = array[5] - * - * @method fromArray - * @param array {Array} The array that the matrix will be populated from. - */ -PIXI.Matrix.prototype.fromArray = function(array) -{ - this.a = array[0]; - this.b = array[1]; - this.c = array[3]; - this.d = array[4]; - this.tx = array[2]; - this.ty = array[5]; -}; - -/** - * Creates an array from the current Matrix object. - * - * @method toArray - * @param transpose {Boolean} Whether we need to transpose the matrix or not - * @return {Array} the newly created array which contains the matrix - */ -PIXI.Matrix.prototype.toArray = function(transpose) -{ - if(!this.array) this.array = new PIXI.Float32Array(9); - var array = this.array; - - if(transpose) - { - array[0] = this.a; - array[1] = this.b; - array[2] = 0; - array[3] = this.c; - array[4] = this.d; - array[5] = 0; - array[6] = this.tx; - array[7] = this.ty; - array[8] = 1; - } - else - { - array[0] = this.a; - array[1] = this.c; - array[2] = this.tx; - array[3] = this.b; - array[4] = this.d; - array[5] = this.ty; - array[6] = 0; - array[7] = 0; - array[8] = 1; - } - - return array; -}; - -/** - * Get a new position with the current transformation applied. - * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) - * - * @method apply - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix - */ -PIXI.Matrix.prototype.apply = function(pos, newPos) -{ - newPos = newPos || new PIXI.Point(); - - newPos.x = this.a * pos.x + this.c * pos.y + this.tx; - newPos.y = this.b * pos.x + this.d * pos.y + this.ty; - - return newPos; -}; - -/** - * Get a new position with the inverse of the current transformation applied. - * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) - * - * @method applyInverse - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix - */ -PIXI.Matrix.prototype.applyInverse = function(pos, newPos) -{ - newPos = newPos || new PIXI.Point(); - - var id = 1 / (this.a * this.d + this.c * -this.b); - - newPos.x = this.d * id * pos.x + -this.c * id * pos.y + (this.ty * this.c - this.tx * this.d) * id; - newPos.y = this.a * id * pos.y + -this.b * id * pos.x + (-this.ty * this.a + this.tx * this.b) * id; - - return newPos; -}; - -/** - * Translates the matrix on the x and y. - * - * @method translate - * @param {Number} x - * @param {Number} y - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.translate = function(x, y) -{ - this.tx += x; - this.ty += y; - - return this; -}; - -/** - * Applies a scale transformation to the matrix. - * - * @method scale - * @param {Number} x The amount to scale horizontally - * @param {Number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.scale = function(x, y) -{ - this.a *= x; - this.d *= y; - this.c *= x; - this.b *= y; - this.tx *= x; - this.ty *= y; - - return this; -}; - - -/** - * Applies a rotation transformation to the matrix. - * @method rotate - * @param {Number} angle The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.rotate = function(angle) -{ - var cos = Math.cos( angle ); - var sin = Math.sin( angle ); - - var a1 = this.a; - var c1 = this.c; - var tx1 = this.tx; - - this.a = a1 * cos-this.b * sin; - this.b = a1 * sin+this.b * cos; - this.c = c1 * cos-this.d * sin; - this.d = c1 * sin+this.d * cos; - this.tx = tx1 * cos - this.ty * sin; - this.ty = tx1 * sin + this.ty * cos; - - return this; -}; - -/** - * Appends the given Matrix to this Matrix. - * - * @method append - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. - */ -PIXI.Matrix.prototype.append = function(matrix) -{ - var a1 = this.a; - var b1 = this.b; - var c1 = this.c; - var d1 = this.d; - - this.a = matrix.a * a1 + matrix.b * c1; - this.b = matrix.a * b1 + matrix.b * d1; - this.c = matrix.c * a1 + matrix.d * c1; - this.d = matrix.c * b1 + matrix.d * d1; - - this.tx = matrix.tx * a1 + matrix.ty * c1 + this.tx; - this.ty = matrix.tx * b1 + matrix.ty * d1 + this.ty; - - return this; -}; - -/** - * Resets this Matix to an identity (default) matrix. - * - * @method identity - * @return {Matrix} This matrix. Good for chaining method calls. - */ -PIXI.Matrix.prototype.identity = function() -{ - this.a = 1; - this.b = 0; - this.c = 0; - this.d = 1; - this.tx = 0; - this.ty = 0; - - return this; -}; - -PIXI.identityMatrix = new PIXI.Matrix(); diff --git a/tutorial-2/pixi.js-master/src/pixi/geom/Point.js b/tutorial-2/pixi.js-master/src/pixi/geom/Point.js deleted file mode 100755 index 2adcb13..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/geom/Point.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis. - * - * @class Point - * @constructor - * @param x {Number} position of the point on the x axis - * @param y {Number} position of the point on the y axis - */ -PIXI.Point = function(x, y) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; -}; - -/** - * Creates a clone of this point - * - * @method clone - * @return {Point} a copy of the point - */ -PIXI.Point.prototype.clone = function() -{ - return new PIXI.Point(this.x, this.y); -}; - -/** - * Sets the point to a new x and y position. - * If y is omitted, both x and y will be set to x. - * - * @method set - * @param [x=0] {Number} position of the point on the x axis - * @param [y=0] {Number} position of the point on the y axis - */ -PIXI.Point.prototype.set = function(x, y) -{ - this.x = x || 0; - this.y = y || ( (y !== 0) ? this.x : 0 ) ; -}; - -// constructor -PIXI.Point.prototype.constructor = PIXI.Point; \ No newline at end of file diff --git a/tutorial-2/pixi.js-master/src/pixi/geom/Polygon.js b/tutorial-2/pixi.js-master/src/pixi/geom/Polygon.js deleted file mode 100755 index 77f8f56..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/geom/Polygon.js +++ /dev/null @@ -1,90 +0,0 @@ -/** - * @author Adrien Brault - */ - -/** - * @class Polygon - * @constructor - * @param points* {Array(Point)|Array(Number)|Point...|Number...} This can be an array of Points that form the polygon, - * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be - * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the - * arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are - * Numbers. - */ -PIXI.Polygon = function(points) -{ - //if points isn't an array, use arguments as the array - if(!(points instanceof Array))points = Array.prototype.slice.call(arguments); - - //if this is a flat array of numbers, convert it to points - if(points[0] instanceof PIXI.Point) - { - var p = []; - for(var i = 0, il = points.length; i < il; i++) - { - p.push(points[i].x, points[i].y); - } - - points = p; - } - - this.closed = true; - - /** - * An array of the points of this polygon - * @property points - * @type Array(Point)|Array(Number) - * - */ - this.points = points; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.POLY in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this polygon - * - * @method clone - * @return {Polygon} a copy of the polygon - */ -PIXI.Polygon.prototype.clone = function() -{ - var points = this.points.slice(); - return new PIXI.Polygon(points); -}; - -/** - * Checks whether the x and y coordinates passed to this function are contained within this polygon - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this polygon - */ -PIXI.Polygon.prototype.contains = function(x, y) -{ - var inside = false; - - // use some raycasting to test hits - // https://github.com/substack/point-in-polygon/blob/master/index.js - var length = this.points.length / 2; - - for(var i = 0, j = length - 1; i < length; j = i++) - { - var xi = this.points[i * 2], yi = this.points[i * 2 + 1], - xj = this.points[j * 2], yj = this.points[j * 2 + 1], - intersect = ((yi > y) !== (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi); - - if(intersect) inside = !inside; - } - - return inside; -}; - -// constructor -PIXI.Polygon.prototype.constructor = PIXI.Polygon; diff --git a/tutorial-2/pixi.js-master/src/pixi/geom/Rectangle.js b/tutorial-2/pixi.js-master/src/pixi/geom/Rectangle.js deleted file mode 100755 index 61985fa..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/geom/Rectangle.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height. - * - * @class Rectangle - * @constructor - * @param x {Number} The X coordinate of the upper-left corner of the rectangle - * @param y {Number} The Y coordinate of the upper-left corner of the rectangle - * @param width {Number} The overall width of this rectangle - * @param height {Number} The overall height of this rectangle - */ -PIXI.Rectangle = function(x, y, width, height) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RECT in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Rectangle - * - * @method clone - * @return {Rectangle} a copy of the rectangle - */ -PIXI.Rectangle.prototype.clone = function() -{ - return new PIXI.Rectangle(this.x, this.y, this.width, this.height); -}; - -/** - * Checks whether the x and y coordinates given are contained within this Rectangle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Rectangle - */ -PIXI.Rectangle.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - var x1 = this.x; - if(x >= x1 && x <= x1 + this.width) - { - var y1 = this.y; - - if(y >= y1 && y <= y1 + this.height) - { - return true; - } - } - - return false; -}; - -// constructor -PIXI.Rectangle.prototype.constructor = PIXI.Rectangle; - -PIXI.EmptyRectangle = new PIXI.Rectangle(0,0,0,0); \ No newline at end of file diff --git a/tutorial-2/pixi.js-master/src/pixi/geom/RoundedRectangle.js b/tutorial-2/pixi.js-master/src/pixi/geom/RoundedRectangle.js deleted file mode 100755 index 4f75723..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/geom/RoundedRectangle.js +++ /dev/null @@ -1,101 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * The Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height. - * - * @class RoundedRectangle - * @constructor - * @param x {Number} The X coordinate of the upper-left corner of the rounded rectangle - * @param y {Number} The Y coordinate of the upper-left corner of the rounded rectangle - * @param width {Number} The overall width of this rounded rectangle - * @param height {Number} The overall height of this rounded rectangle - * @param radius {Number} Controls the radius of the rounded corners - */ -PIXI.RoundedRectangle = function(x, y, width, height, radius) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - /** - * @property radius - * @type Number - * @default 20 - */ - this.radius = radius || 20; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RRECT in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Rounded Rectangle - * - * @method clone - * @return {RoundedRectangle} a copy of the rounded rectangle - */ -PIXI.RoundedRectangle.prototype.clone = function() -{ - return new PIXI.RoundedRectangle(this.x, this.y, this.width, this.height, this.radius); -}; - -/** - * Checks whether the x and y coordinates given are contained within this Rounded Rectangle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Rounded Rectangle - */ -PIXI.RoundedRectangle.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - var x1 = this.x; - if(x >= x1 && x <= x1 + this.width) - { - var y1 = this.y; - - if(y >= y1 && y <= y1 + this.height) - { - return true; - } - } - - return false; -}; - -// constructor -PIXI.RoundedRectangle.prototype.constructor = PIXI.RoundedRectangle; - diff --git a/tutorial-2/pixi.js-master/src/pixi/loaders/AssetLoader.js b/tutorial-2/pixi.js-master/src/pixi/loaders/AssetLoader.js deleted file mode 100755 index 0e4b858..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/loaders/AssetLoader.js +++ /dev/null @@ -1,167 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * 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 - * @uses EventTarget - * @param assetURLs {Array(String)} 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'. - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.AssetLoader = function(assetURLs, crossorigin) -{ - /** - * The array of asset URLs that are going to be loaded - * - * @property assetURLs - * @type Array(String) - */ - this.assetURLs = assetURLs; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * Maps file extension to loader types - * - * @property loadersByType - * @type Object - */ - this.loadersByType = { - 'jpg': PIXI.ImageLoader, - 'jpeg': PIXI.ImageLoader, - 'png': PIXI.ImageLoader, - 'gif': PIXI.ImageLoader, - 'webp': PIXI.ImageLoader, - 'json': PIXI.JsonLoader, - 'atlas': PIXI.AtlasLoader, - 'anim': PIXI.SpineLoader, - 'xml': PIXI.BitmapFontLoader, - 'fnt': PIXI.BitmapFontLoader - }; -}; - -PIXI.EventTarget.mixin(PIXI.AssetLoader.prototype); - -/** - * Fired when an item has loaded - * @event onProgress - */ - -/** - * Fired when all the assets have loaded - * @event onComplete - */ - -// constructor -PIXI.AssetLoader.prototype.constructor = PIXI.AssetLoader; - -/** - * Given a filename, returns its extension. - * - * @method _getDataType - * @param str {String} the name of the asset - */ -PIXI.AssetLoader.prototype._getDataType = function(str) -{ - var test = 'data:'; - //starts with 'data:' - var start = str.slice(0, test.length).toLowerCase(); - if (start === test) { - var data = str.slice(test.length); - - var sepIdx = data.indexOf(','); - if (sepIdx === -1) //malformed data URI scheme - return null; - - //e.g. 'image/gif;base64' => 'image/gif' - var info = data.slice(0, sepIdx).split(';')[0]; - - //We might need to handle some special cases here... - //standardize text/plain to 'txt' file extension - if (!info || info.toLowerCase() === 'text/plain') - return 'txt'; - - //User specified mime type, try splitting it by '/' - return info.split('/').pop().toLowerCase(); - } - - return null; -}; - -/** - * Starts loading the assets sequentially - * - * @method load - */ -PIXI.AssetLoader.prototype.load = function() -{ - var scope = this; - - function onLoad(evt) { - scope.onAssetLoaded(evt.data.content); - } - - this.loadCount = this.assetURLs.length; - - for (var i=0; i < this.assetURLs.length; i++) - { - var fileName = this.assetURLs[i]; - //first see if we have a data URI scheme.. - var fileType = this._getDataType(fileName); - - //if not, assume it's a file URI - if (!fileType) - fileType = fileName.split('?').shift().split('.').pop().toLowerCase(); - - var Constructor = this.loadersByType[fileType]; - if(!Constructor) - throw new Error(fileType + ' is an unsupported file type'); - - var loader = new Constructor(fileName, this.crossorigin); - - loader.on('loaded', onLoad); - loader.load(); - } -}; - -/** - * Invoked after each file is loaded - * - * @method onAssetLoaded - * @private - */ -PIXI.AssetLoader.prototype.onAssetLoaded = function(loader) -{ - this.loadCount--; - - this.emit('onProgress', { - content: this, - loader: loader, - loaded: this.assetURLs.length - this.loadCount, - total: this.assetURLs.length - }); - - if (this.onProgress) this.onProgress(loader); - - if (!this.loadCount) - { - this.emit('onComplete', { content: this }); - if(this.onComplete) this.onComplete(); - } -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/loaders/AtlasLoader.js b/tutorial-2/pixi.js-master/src/pixi/loaders/AtlasLoader.js deleted file mode 100755 index 5368b6b..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/loaders/AtlasLoader.js +++ /dev/null @@ -1,190 +0,0 @@ -/** - * @author Martin Kelm http://mkelm.github.com - */ - -/** - * The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event. - * - * To generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format. - * - * It is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to 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.fromFrameId() - * - * @class AtlasLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.AtlasLoader = function (url, crossorigin) { - this.url = url; - this.baseUrl = url.replace(/[^\/]*$/, ''); - this.crossorigin = crossorigin; - this.loaded = false; - -}; - -// constructor -PIXI.AtlasLoader.constructor = PIXI.AtlasLoader; - -PIXI.EventTarget.mixin(PIXI.AtlasLoader.prototype); - - /** - * Starts loading the JSON file - * - * @method load - */ -PIXI.AtlasLoader.prototype.load = function () { - this.ajaxRequest = new PIXI.AjaxRequest(); - this.ajaxRequest.onreadystatechange = this.onAtlasLoaded.bind(this); - - this.ajaxRequest.open('GET', this.url, true); - if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/json'); - this.ajaxRequest.send(null); -}; - -/** - * Invoked when the Atlas has fully loaded. Parses the JSON and builds the texture frames. - * - * @method onAtlasLoaded - * @private - */ -PIXI.AtlasLoader.prototype.onAtlasLoaded = function () { - if (this.ajaxRequest.readyState === 4) { - if (this.ajaxRequest.status === 200 || window.location.href.indexOf('http') === -1) { - this.atlas = { - meta : { - image : [] - }, - frames : [] - }; - var result = this.ajaxRequest.responseText.split(/\r?\n/); - var lineCount = -3; - - var currentImageId = 0; - var currentFrame = null; - var nameInNextLine = false; - - var i = 0, - j = 0, - selfOnLoaded = this.onLoaded.bind(this); - - // parser without rotation support yet! - for (i = 0; i < result.length; i++) { - result[i] = result[i].replace(/^\s+|\s+$/g, ''); - if (result[i] === '') { - nameInNextLine = i+1; - } - if (result[i].length > 0) { - if (nameInNextLine === i) { - this.atlas.meta.image.push(result[i]); - currentImageId = this.atlas.meta.image.length - 1; - this.atlas.frames.push({}); - lineCount = -3; - } else if (lineCount > 0) { - if (lineCount % 7 === 1) { // frame name - if (currentFrame != null) { //jshint ignore:line - this.atlas.frames[currentImageId][currentFrame.name] = currentFrame; - } - currentFrame = { name: result[i], frame : {} }; - } else { - var text = result[i].split(' '); - if (lineCount % 7 === 3) { // position - currentFrame.frame.x = Number(text[1].replace(',', '')); - currentFrame.frame.y = Number(text[2]); - } else if (lineCount % 7 === 4) { // size - currentFrame.frame.w = Number(text[1].replace(',', '')); - currentFrame.frame.h = Number(text[2]); - } else if (lineCount % 7 === 5) { // real size - var realSize = { - x : 0, - y : 0, - w : Number(text[1].replace(',', '')), - h : Number(text[2]) - }; - - if (realSize.w > currentFrame.frame.w || realSize.h > currentFrame.frame.h) { - currentFrame.trimmed = true; - currentFrame.realSize = realSize; - } else { - currentFrame.trimmed = false; - } - } - } - } - lineCount++; - } - } - - if (currentFrame != null) { //jshint ignore:line - this.atlas.frames[currentImageId][currentFrame.name] = currentFrame; - } - - if (this.atlas.meta.image.length > 0) { - this.images = []; - for (j = 0; j < this.atlas.meta.image.length; j++) { - // sprite sheet - var textureUrl = this.baseUrl + this.atlas.meta.image[j]; - var frameData = this.atlas.frames[j]; - this.images.push(new PIXI.ImageLoader(textureUrl, this.crossorigin)); - - for (i in frameData) { - var rect = frameData[i].frame; - if (rect) { - PIXI.TextureCache[i] = new PIXI.Texture(this.images[j].texture.baseTexture, { - x: rect.x, - y: rect.y, - width: rect.w, - height: rect.h - }); - if (frameData[i].trimmed) { - PIXI.TextureCache[i].realSize = frameData[i].realSize; - // trim in pixi not supported yet, todo update trim properties if it is done ... - PIXI.TextureCache[i].trim.x = 0; - PIXI.TextureCache[i].trim.y = 0; - } - } - } - } - - this.currentImageId = 0; - for (j = 0; j < this.images.length; j++) { - this.images[j].on('loaded', selfOnLoaded); - } - this.images[this.currentImageId].load(); - - } else { - this.onLoaded(); - } - - } else { - this.onError(); - } - } -}; - -/** - * Invoked when json file has loaded. - * - * @method onLoaded - * @private - */ -PIXI.AtlasLoader.prototype.onLoaded = function () { - if (this.images.length - 1 > this.currentImageId) { - this.currentImageId++; - this.images[this.currentImageId].load(); - } else { - this.loaded = true; - this.emit('loaded', { content: this }); - } -}; - -/** - * Invoked when an error occurs. - * - * @method onError - * @private - */ -PIXI.AtlasLoader.prototype.onError = function () { - this.emit('error', { content: this }); -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/loaders/BitmapFontLoader.js b/tutorial-2/pixi.js-master/src/pixi/loaders/BitmapFontLoader.js deleted file mode 100755 index 3eb54c4..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/loaders/BitmapFontLoader.js +++ /dev/null @@ -1,161 +0,0 @@ -/** - * @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 - * @uses EventTarget - * @constructor - * @param url {String} The url of the sprite sheet JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.BitmapFontLoader = function(url, crossorigin) -{ - /** - * The url of the bitmap font data - * - * @property url - * @type String - */ - this.url = url; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * [read-only] The base url of the bitmap font data - * - * @property baseUrl - * @type String - * @readOnly - */ - this.baseUrl = url.replace(/[^\/]*$/, ''); - - /** - * [read-only] The texture of the bitmap font - * - * @property texture - * @type Texture - */ - this.texture = null; -}; - -// constructor -PIXI.BitmapFontLoader.prototype.constructor = PIXI.BitmapFontLoader; -PIXI.EventTarget.mixin(PIXI.BitmapFontLoader.prototype); - -/** - * Loads the XML font data - * - * @method load - */ -PIXI.BitmapFontLoader.prototype.load = function() -{ - this.ajaxRequest = new PIXI.AjaxRequest(); - this.ajaxRequest.onreadystatechange = this.onXMLLoaded.bind(this); - - this.ajaxRequest.open('GET', this.url, true); - if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/xml'); - this.ajaxRequest.send(null); -}; - -/** - * Invoked when the XML file is loaded, parses the data. - * - * @method onXMLLoaded - * @private - */ -PIXI.BitmapFontLoader.prototype.onXMLLoaded = function() -{ - if (this.ajaxRequest.readyState === 4) - { - if (this.ajaxRequest.status === 200 || window.location.protocol.indexOf('http') === -1) - { - var responseXML = this.ajaxRequest.responseXML; - if(!responseXML || /MSIE 9/i.test(navigator.userAgent) || navigator.isCocoonJS) { - if(typeof(window.DOMParser) === 'function') { - var domparser = new DOMParser(); - responseXML = domparser.parseFromString(this.ajaxRequest.responseText, 'text/xml'); - } else { - var div = document.createElement('div'); - div.innerHTML = this.ajaxRequest.responseText; - responseXML = div; - } - } - - var textureUrl = this.baseUrl + responseXML.getElementsByTagName('page')[0].getAttribute('file'); - var image = new PIXI.ImageLoader(textureUrl, this.crossorigin); - this.texture = image.texture.baseTexture; - - var data = {}; - var info = responseXML.getElementsByTagName('info')[0]; - var common = responseXML.getElementsByTagName('common')[0]; - data.font = info.getAttribute('face'); - data.size = parseInt(info.getAttribute('size'), 10); - data.lineHeight = parseInt(common.getAttribute('lineHeight'), 10); - data.chars = {}; - - //parse letters - var letters = responseXML.getElementsByTagName('char'); - - for (var i = 0; i < letters.length; i++) - { - var charCode = parseInt(letters[i].getAttribute('id'), 10); - - var textureRect = new PIXI.Rectangle( - parseInt(letters[i].getAttribute('x'), 10), - parseInt(letters[i].getAttribute('y'), 10), - parseInt(letters[i].getAttribute('width'), 10), - parseInt(letters[i].getAttribute('height'), 10) - ); - - data.chars[charCode] = { - xOffset: parseInt(letters[i].getAttribute('xoffset'), 10), - yOffset: parseInt(letters[i].getAttribute('yoffset'), 10), - xAdvance: parseInt(letters[i].getAttribute('xadvance'), 10), - kerning: {}, - texture: PIXI.TextureCache[charCode] = new PIXI.Texture(this.texture, textureRect) - - }; - } - - //parse kernings - var kernings = responseXML.getElementsByTagName('kerning'); - for (i = 0; i < kernings.length; i++) - { - var first = parseInt(kernings[i].getAttribute('first'), 10); - var second = parseInt(kernings[i].getAttribute('second'), 10); - var amount = parseInt(kernings[i].getAttribute('amount'), 10); - - data.chars[second].kerning[first] = amount; - - } - - PIXI.BitmapText.fonts[data.font] = data; - - image.addEventListener('loaded', this.onLoaded.bind(this)); - image.load(); - } - } -}; - -/** - * Invoked when all files are loaded (xml/fnt and texture) - * - * @method onLoaded - * @private - */ -PIXI.BitmapFontLoader.prototype.onLoaded = function() -{ - this.emit('loaded', { content: this }); -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/loaders/ImageLoader.js b/tutorial-2/pixi.js-master/src/pixi/loaders/ImageLoader.js deleted file mode 100755 index 1567f29..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/loaders/ImageLoader.js +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @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.fromFrame() and PIXI.Sprite.fromFrame() - * When loaded this class will dispatch a 'loaded' event - * - * @class ImageLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the image - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.ImageLoader = function(url, crossorigin) -{ - /** - * The texture being loaded - * - * @property texture - * @type Texture - */ - this.texture = PIXI.Texture.fromImage(url, crossorigin); - - /** - * if the image is loaded with loadFramedSpriteSheet - * frames will contain the sprite sheet frames - * - * @property frames - * @type Array - * @readOnly - */ - this.frames = []; -}; - -// constructor -PIXI.ImageLoader.prototype.constructor = PIXI.ImageLoader; - -PIXI.EventTarget.mixin(PIXI.ImageLoader.prototype); - -/** - * Loads image or takes it from cache - * - * @method load - */ -PIXI.ImageLoader.prototype.load = function() -{ - if(!this.texture.baseTexture.hasLoaded) - { - this.texture.baseTexture.on('loaded', this.onLoaded.bind(this)); - } - else - { - this.onLoaded(); - } -}; - -/** - * Invoked when image file is loaded or it is already cached and ready to use - * - * @method onLoaded - * @private - */ -PIXI.ImageLoader.prototype.onLoaded = function() -{ - this.emit('loaded', { content: this }); -}; - -/** - * Loads image and split it to uniform sized frames - * - * @method loadFramedSpriteSheet - * @param frameWidth {Number} width of each frame - * @param frameHeight {Number} height of each frame - * @param textureName {String} if given, the frames will be cached in - format - */ -PIXI.ImageLoader.prototype.loadFramedSpriteSheet = function(frameWidth, frameHeight, textureName) -{ - this.frames = []; - var cols = Math.floor(this.texture.width / frameWidth); - var rows = Math.floor(this.texture.height / frameHeight); - - var i=0; - for (var y=0; y 0) - { - textureLoader.addEventListener('loadedBaseTexture', function(evt){ - if (evt.content.content.loadingCount <= 0) - { - originalLoader.onLoaded(); - } - }); - } - else - { - originalLoader.onLoaded(); - } - }; - // start the loading // - atlasLoader.load(); - } - } - else - { - this.onLoaded(); - } -}; - -/** - * Invoke when json file loaded - * - * @method onLoaded - * @private - */ -PIXI.JsonLoader.prototype.onLoaded = function () { - this.loaded = true; - this.dispatchEvent({ - type: 'loaded', - content: this - }); -}; - -/** - * Invoke when error occured - * - * @method onError - * @private - */ -PIXI.JsonLoader.prototype.onError = function () { - - this.dispatchEvent({ - type: 'error', - content: this - }); -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/loaders/SpineLoader.js b/tutorial-2/pixi.js-master/src/pixi/loaders/SpineLoader.js deleted file mode 100755 index c736c50..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/loaders/SpineLoader.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * based on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi - * - * Awesome JS run time provided by EsotericSoftware - * https://github.com/EsotericSoftware/spine-runtimes - * - */ - -/** - * The Spine loader is used to load in JSON spine data - * To generate the data you need to use http://esotericsoftware.com/ and export in the "JSON" format - * Due to a clash of names You will need to change the extension of the spine file from *.json to *.anim for it to load - * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source - * You will need to generate a sprite sheet to accompany the spine data - * When loaded this class will dispatch a "loaded" event - * - * @class SpineLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.SpineLoader = function(url, crossorigin) -{ - /** - * The url of the bitmap font data - * - * @property url - * @type String - */ - this.url = url; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * [read-only] Whether the data has loaded yet - * - * @property loaded - * @type Boolean - * @readOnly - */ - this.loaded = false; -}; - -PIXI.SpineLoader.prototype.constructor = PIXI.SpineLoader; - -PIXI.EventTarget.mixin(PIXI.SpineLoader.prototype); - -/** - * Loads the JSON data - * - * @method load - */ -PIXI.SpineLoader.prototype.load = function () { - - var scope = this; - var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin); - jsonLoader.on('loaded', function (event) { - scope.json = event.data.content.json; - scope.onLoaded(); - }); - jsonLoader.load(); -}; - -/** - * Invoked when JSON file is loaded. - * - * @method onLoaded - * @private - */ -PIXI.SpineLoader.prototype.onLoaded = function () { - this.loaded = true; - this.emit('loaded', { content: this }); -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/loaders/SpriteSheetLoader.js b/tutorial-2/pixi.js-master/src/pixi/loaders/SpriteSheetLoader.js deleted file mode 100755 index 4d50430..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/loaders/SpriteSheetLoader.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * 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 in 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 a 'texture atlas') as it means sprites 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.fromFrameId() - * This loader will load the image file that the Spritesheet points to as well as the data. - * When loaded this class will dispatch a 'loaded' event - * - * @class SpriteSheetLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the sprite sheet JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.SpriteSheetLoader = function (url, crossorigin) { - - /** - * The url of the atlas data - * - * @property url - * @type String - */ - this.url = url; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * [read-only] The base url of the bitmap font data - * - * @property baseUrl - * @type String - * @readOnly - */ - this.baseUrl = url.replace(/[^\/]*$/, ''); - - /** - * The texture being loaded - * - * @property texture - * @type Texture - */ - this.texture = null; - - /** - * The frames of the sprite sheet - * - * @property frames - * @type Object - */ - this.frames = {}; -}; - -// constructor -PIXI.SpriteSheetLoader.prototype.constructor = PIXI.SpriteSheetLoader; - -PIXI.EventTarget.mixin(PIXI.SpriteSheetLoader.prototype); - -/** - * This will begin loading the JSON file - * - * @method load - */ -PIXI.SpriteSheetLoader.prototype.load = function () { - var scope = this; - var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin); - jsonLoader.on('loaded', function (event) { - scope.json = event.data.content.json; - scope.onLoaded(); - }); - jsonLoader.load(); -}; - -/** - * Invoke when all files are loaded (json and texture) - * - * @method onLoaded - * @private - */ -PIXI.SpriteSheetLoader.prototype.onLoaded = function () { - this.emit('loaded', { - content: this - }); -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/primitives/Graphics.js b/tutorial-2/pixi.js-master/src/pixi/primitives/Graphics.js deleted file mode 100755 index fcfdbb9..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/primitives/Graphics.js +++ /dev/null @@ -1,1140 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and color and fill them. - * - * @class Graphics - * @extends DisplayObjectContainer - * @constructor - */ -PIXI.Graphics = function() -{ - PIXI.DisplayObjectContainer.call( this ); - - this.renderable = true; - - /** - * The alpha value used when filling the Graphics object. - * - * @property fillAlpha - * @type Number - */ - this.fillAlpha = 1; - - /** - * The width (thickness) of any lines drawn. - * - * @property lineWidth - * @type Number - */ - this.lineWidth = 0; - - /** - * The color of any lines drawn. - * - * @property lineColor - * @type String - * @default 0 - */ - this.lineColor = 0; - - /** - * Graphics data - * - * @property graphicsData - * @type Array - * @private - */ - this.graphicsData = []; - - /** - * The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint. - * - * @property tint - * @type Number - * @default 0xFFFFFF - */ - this.tint = 0xFFFFFF; - - /** - * The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode. - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - /** - * Current path - * - * @property currentPath - * @type Object - * @private - */ - this.currentPath = null; - - /** - * Array containing some WebGL-related properties used by the WebGL renderer. - * - * @property _webGL - * @type Array - * @private - */ - this._webGL = []; - - /** - * Whether this shape is being used as a mask. - * - * @property isMask - * @type Boolean - */ - this.isMask = false; - - /** - * The bounds' padding used for bounds calculation. - * - * @property boundsPadding - * @type Number - */ - this.boundsPadding = 0; - - this._localBounds = new PIXI.Rectangle(0,0,1,1); - - /** - * Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated. - * - * @property dirty - * @type Boolean - * @private - */ - this.dirty = true; - - /** - * Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated. - * - * @property webGLDirty - * @type Boolean - * @private - */ - this.webGLDirty = false; - - /** - * Used to detect if the cached sprite object needs to be updated. - * - * @property cachedSpriteDirty - * @type Boolean - * @private - */ - this.cachedSpriteDirty = false; - -}; - -// constructor -PIXI.Graphics.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); -PIXI.Graphics.prototype.constructor = PIXI.Graphics; - -/** - * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. - * This is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory. - * It is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas. - * This is not recommended if you are constantly redrawing the graphics element. - * - * @property cacheAsBitmap - * @type Boolean - * @default false - * @private - */ -Object.defineProperty(PIXI.Graphics.prototype, "cacheAsBitmap", { - get: function() { - return this._cacheAsBitmap; - }, - set: function(value) { - this._cacheAsBitmap = value; - - if(this._cacheAsBitmap) - { - - this._generateCachedSprite(); - } - else - { - this.destroyCachedSprite(); - this.dirty = true; - } - - } -}); - -/** - * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method. - * - * @method lineStyle - * @param lineWidth {Number} width of the line to draw, will update the objects stored style - * @param color {Number} color of the line to draw, will update the objects stored style - * @param alpha {Number} alpha of the line to draw, will update the objects stored style - * @return {Graphics} - */ -PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha) -{ - this.lineWidth = lineWidth || 0; - this.lineColor = color || 0; - this.lineAlpha = (arguments.length < 3) ? 1 : alpha; - - if(this.currentPath) - { - if(this.currentPath.shape.points.length) - { - // halfway through a line? start a new one! - this.drawShape( new PIXI.Polygon( this.currentPath.shape.points.slice(-2) )); - return this; - } - - // otherwise its empty so lets just set the line properties - this.currentPath.lineWidth = this.lineWidth; - this.currentPath.lineColor = this.lineColor; - this.currentPath.lineAlpha = this.lineAlpha; - - } - - return this; -}; - -/** - * Moves the current drawing position to x, y. - * - * @method moveTo - * @param x {Number} the X coordinate to move to - * @param y {Number} the Y coordinate to move to - * @return {Graphics} - */ -PIXI.Graphics.prototype.moveTo = function(x, y) -{ - this.drawShape(new PIXI.Polygon([x,y])); - - return this; -}; - -/** - * Draws a line using the current line style from the current drawing position to (x, y); - * The current drawing position is then set to (x, y). - * - * @method lineTo - * @param x {Number} the X coordinate to draw to - * @param y {Number} the Y coordinate to draw to - * @return {Graphics} - */ -PIXI.Graphics.prototype.lineTo = function(x, y) -{ - this.currentPath.shape.points.push(x, y); - this.dirty = true; - - return this; -}; - -/** - * Calculate the points for a quadratic bezier curve and then draws it. - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c - * - * @method quadraticCurveTo - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Graphics} - */ -PIXI.Graphics.prototype.quadraticCurveTo = function(cpX, cpY, toX, toY) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0]; - } - else - { - this.moveTo(0,0); - } - - var xa, - ya, - n = 20, - points = this.currentPath.shape.points; - if(points.length === 0)this.moveTo(0, 0); - - - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - - var j = 0; - for (var i = 1; i <= n; i++ ) - { - j = i / n; - - xa = fromX + ( (cpX - fromX) * j ); - ya = fromY + ( (cpY - fromY) * j ); - - points.push( xa + ( ((cpX + ( (toX - cpX) * j )) - xa) * j ), - ya + ( ((cpY + ( (toY - cpY) * j )) - ya) * j ) ); - } - - - this.dirty = true; - - return this; -}; - -/** - * Calculate the points for a bezier curve and then draws it. - * - * @method bezierCurveTo - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param cpX2 {Number} Second Control point x - * @param cpY2 {Number} Second Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Graphics} - */ -PIXI.Graphics.prototype.bezierCurveTo = function(cpX, cpY, cpX2, cpY2, toX, toY) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0]; - } - else - { - this.moveTo(0,0); - } - - var n = 20, - dt, - dt2, - dt3, - t2, - t3, - points = this.currentPath.shape.points; - - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - - var j = 0; - - for (var i=1; i<=n; i++) - { - j = i / n; - - dt = (1 - j); - dt2 = dt * dt; - dt3 = dt2 * dt; - - t2 = j * j; - t3 = t2 * j; - - points.push( dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX, - dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY); - } - - this.dirty = true; - - return this; -}; - -/* - * The arcTo() method creates an arc/curve between two tangents on the canvas. - * - * "borrowed" from https://code.google.com/p/fxcanvas/ - thanks google! - * - * @method arcTo - * @param x1 {Number} The x-coordinate of the beginning of the arc - * @param y1 {Number} The y-coordinate of the beginning of the arc - * @param x2 {Number} The x-coordinate of the end of the arc - * @param y2 {Number} The y-coordinate of the end of the arc - * @param radius {Number} The radius of the arc - * @return {Graphics} - */ -PIXI.Graphics.prototype.arcTo = function(x1, y1, x2, y2, radius) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0) - { - this.currentPath.shape.points.push(x1, y1); - } - } - else - { - this.moveTo(x1, y1); - } - - var points = this.currentPath.shape.points; - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - var a1 = fromY - y1; - var b1 = fromX - x1; - var a2 = y2 - y1; - var b2 = x2 - x1; - var mm = Math.abs(a1 * b2 - b1 * a2); - - - if (mm < 1.0e-8 || radius === 0) - { - if( points[points.length-2] !== x1 || points[points.length-1] !== y1) - { - //console.log(">>") - points.push(x1, y1); - } - } - else - { - var dd = a1 * a1 + b1 * b1; - var cc = a2 * a2 + b2 * b2; - var tt = a1 * a2 + b1 * b2; - var k1 = radius * Math.sqrt(dd) / mm; - var k2 = radius * Math.sqrt(cc) / mm; - var j1 = k1 * tt / dd; - var j2 = k2 * tt / cc; - var cx = k1 * b2 + k2 * b1; - var cy = k1 * a2 + k2 * a1; - var px = b1 * (k2 + j1); - var py = a1 * (k2 + j1); - var qx = b2 * (k1 + j2); - var qy = a2 * (k1 + j2); - var startAngle = Math.atan2(py - cy, px - cx); - var endAngle = Math.atan2(qy - cy, qx - cx); - - this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1); - } - - this.dirty = true; - - return this; -}; - -/** - * The arc method creates an arc/curve (used to create circles, or parts of circles). - * - * @method arc - * @param cx {Number} The x-coordinate of the center of the circle - * @param cy {Number} The y-coordinate of the center of the circle - * @param radius {Number} The radius of the circle - * @param startAngle {Number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) - * @param endAngle {Number} The ending angle, in radians - * @param anticlockwise {Boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {Graphics} - */ -PIXI.Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) -{ - var startX = cx + Math.cos(startAngle) * radius; - var startY = cy + Math.sin(startAngle) * radius; - var points; - - if( this.currentPath ) - { - points = this.currentPath.shape.points; - - if(points.length === 0) - { - points.push(startX, startY); - } - else if( points[points.length-2] !== startX || points[points.length-1] !== startY) - { - points.push(startX, startY); - } - } - else - { - this.moveTo(startX, startY); - points = this.currentPath.shape.points; - } - - if (startAngle === endAngle)return this; - - if( !anticlockwise && endAngle <= startAngle ) - { - endAngle += Math.PI * 2; - } - else if( anticlockwise && startAngle <= endAngle ) - { - startAngle += Math.PI * 2; - } - - var sweep = anticlockwise ? (startAngle - endAngle) *-1 : (endAngle - startAngle); - var segs = ( Math.abs(sweep)/ (Math.PI * 2) ) * 40; - - if( sweep === 0 ) return this; - - var theta = sweep/(segs*2); - var theta2 = theta*2; - - var cTheta = Math.cos(theta); - var sTheta = Math.sin(theta); - - var segMinus = segs - 1; - - var remainder = ( segMinus % 1 ) / segMinus; - - for(var i=0; i<=segMinus; i++) - { - var real = i + remainder * i; - - - var angle = ((theta) + startAngle + (theta2 * real)); - - var c = Math.cos(angle); - var s = -Math.sin(angle); - - points.push(( (cTheta * c) + (sTheta * s) ) * radius + cx, - ( (cTheta * -s) + (sTheta * c) ) * radius + cy); - } - - this.dirty = true; - - return this; -}; - -/** - * Specifies a simple one-color fill that subsequent calls to other Graphics methods - * (such as lineTo() or drawCircle()) use when drawing. - * - * @method beginFill - * @param color {Number} the color of the fill - * @param alpha {Number} the alpha of the fill - * @return {Graphics} - */ -PIXI.Graphics.prototype.beginFill = function(color, alpha) -{ - this.filling = true; - this.fillColor = color || 0; - this.fillAlpha = (alpha === undefined) ? 1 : alpha; - - if(this.currentPath) - { - if(this.currentPath.shape.points.length <= 2) - { - this.currentPath.fill = this.filling; - this.currentPath.fillColor = this.fillColor; - this.currentPath.fillAlpha = this.fillAlpha; - } - } - return this; -}; - -/** - * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. - * - * @method endFill - * @return {Graphics} - */ -PIXI.Graphics.prototype.endFill = function() -{ - this.filling = false; - this.fillColor = null; - this.fillAlpha = 1; - - return this; -}; - -/** - * Draws a rectangle. - * - * @method drawRect - * - * @param x {Number} The X coord of the top-left of the rectangle - * @param y {Number} The Y coord of the top-left of the rectangle - * @param width {Number} The width of the rectangle - * @param height {Number} The height of the rectangle - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawRect = function( x, y, width, height ) -{ - this.drawShape(new PIXI.Rectangle(x,y, width, height)); - - return this; -}; - -/** - * Draws a rounded rectangle. - * - * @method drawRoundedRect - * - * @param x {Number} The X coord of the top-left of the rectangle - * @param y {Number} The Y coord of the top-left of the rectangle - * @param width {Number} The width of the rectangle - * @param height {Number} The height of the rectangle - * @param radius {Number} Radius of the rectangle corners - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawRoundedRect = function( x, y, width, height, radius ) -{ - this.drawShape(new PIXI.RoundedRectangle(x, y, width, height, radius)); - - return this; -}; - -/** - * Draws a circle. - * - * @method drawCircle - * @param x {Number} The X coordinate of the center of the circle - * @param y {Number} The Y coordinate of the center of the circle - * @param radius {Number} The radius of the circle - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawCircle = function(x, y, radius) -{ - this.drawShape(new PIXI.Circle(x,y, radius)); - - return this; -}; - -/** - * Draws an ellipse. - * - * @method drawEllipse - * @param x {Number} The X coordinate of the center of the ellipse - * @param y {Number} The Y coordinate of the center of the ellipse - * @param width {Number} The half width of the ellipse - * @param height {Number} The half height of the ellipse - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawEllipse = function(x, y, width, height) -{ - this.drawShape(new PIXI.Ellipse(x, y, width, height)); - - return this; -}; - -/** - * Draws a polygon using the given path. - * - * @method drawPolygon - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawPolygon = function(path) -{ - if(!(path instanceof Array))path = Array.prototype.slice.call(arguments); - this.drawShape(new PIXI.Polygon(path)); - return this; -}; - -/** - * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. - * - * @method clear - * @return {Graphics} - */ -PIXI.Graphics.prototype.clear = function() -{ - this.lineWidth = 0; - this.filling = false; - - this.dirty = true; - this.clearDirty = true; - this.graphicsData = []; - - return this; -}; - -/** - * Useful function that returns a texture of the graphics object that can then be used to create sprites - * This can be quite useful if your geometry is complicated and needs to be reused multiple times. - * - * @method generateTexture - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts - * @return {Texture} a texture of the graphics object - */ -PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode) -{ - resolution = resolution || 1; - - var bounds = this.getBounds(); - - var canvasBuffer = new PIXI.CanvasBuffer(bounds.width * resolution, bounds.height * resolution); - - var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas, scaleMode); - texture.baseTexture.resolution = resolution; - - canvasBuffer.context.scale(resolution, resolution); - - canvasBuffer.context.translate(-bounds.x,-bounds.y); - - PIXI.CanvasGraphics.renderGraphics(this, canvasBuffer.context); - - return texture; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Graphics.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(this.visible === false || this.alpha === 0 || this.isMask === true)return; - - if(this._cacheAsBitmap) - { - - if(this.dirty || this.cachedSpriteDirty) - { - - this._generateCachedSprite(); - - // we will also need to update the texture on the gpu too! - this.updateCachedSpriteTexture(); - - this.cachedSpriteDirty = false; - this.dirty = false; - } - - this._cachedSprite.worldAlpha = this.worldAlpha; - PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession); - - return; - } - else - { - renderSession.spriteBatch.stop(); - renderSession.blendModeManager.setBlendMode(this.blendMode); - - if(this._mask)renderSession.maskManager.pushMask(this._mask, renderSession); - if(this._filters)renderSession.filterManager.pushFilter(this._filterBlock); - - // check blend mode - if(this.blendMode !== renderSession.spriteBatch.currentBlendMode) - { - renderSession.spriteBatch.currentBlendMode = this.blendMode; - var blendModeWebGL = PIXI.blendModesWebGL[renderSession.spriteBatch.currentBlendMode]; - renderSession.spriteBatch.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); - } - - // check if the webgl graphic needs to be updated - if(this.webGLDirty) - { - this.dirty = true; - this.webGLDirty = false; - } - - PIXI.WebGLGraphics.renderGraphics(this, renderSession); - - // only render if it has children! - if(this.children.length) - { - renderSession.spriteBatch.start(); - - // simple render children! - for(var i=0, j=this.children.length; i maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - - this._bounds.x = minX; - this._bounds.width = maxX - minX; - - this._bounds.y = minY; - this._bounds.height = maxY - minY; - - return this._bounds; -}; - -/** - * Update the bounds of the object - * - * @method updateLocalBounds - */ -PIXI.Graphics.prototype.updateLocalBounds = function() -{ - var minX = Infinity; - var maxX = -Infinity; - - var minY = Infinity; - var maxY = -Infinity; - - if(this.graphicsData.length) - { - var shape, points, x, y, w, h; - - for (var i = 0; i < this.graphicsData.length; i++) { - var data = this.graphicsData[i]; - var type = data.type; - var lineWidth = data.lineWidth; - shape = data.shape; - - - if(type === PIXI.Graphics.RECT || type === PIXI.Graphics.RREC) - { - x = shape.x - lineWidth/2; - y = shape.y - lineWidth/2; - w = shape.width + lineWidth; - h = shape.height + lineWidth; - - minX = x < minX ? x : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y < minY ? y : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else if(type === PIXI.Graphics.CIRC) - { - x = shape.x; - y = shape.y; - w = shape.radius + lineWidth/2; - h = shape.radius + lineWidth/2; - - minX = x - w < minX ? x - w : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y - h < minY ? y - h : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else if(type === PIXI.Graphics.ELIP) - { - x = shape.x; - y = shape.y; - w = shape.width + lineWidth/2; - h = shape.height + lineWidth/2; - - minX = x - w < minX ? x - w : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y - h < minY ? y - h : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else - { - // POLY - points = shape.points; - - for (var j = 0; j < points.length; j+=2) - { - - x = points[j]; - y = points[j+1]; - minX = x-lineWidth < minX ? x-lineWidth : minX; - maxX = x+lineWidth > maxX ? x+lineWidth : maxX; - - minY = y-lineWidth < minY ? y-lineWidth : minY; - maxY = y+lineWidth > maxY ? y+lineWidth : maxY; - } - } - } - } - else - { - minX = 0; - maxX = 0; - minY = 0; - maxY = 0; - } - - var padding = this.boundsPadding; - - this._localBounds.x = minX - padding; - this._localBounds.width = (maxX - minX) + padding * 2; - - this._localBounds.y = minY - padding; - this._localBounds.height = (maxY - minY) + padding * 2; -}; - -/** - * Generates the cached sprite when the sprite has cacheAsBitmap = true - * - * @method _generateCachedSprite - * @private - */ -PIXI.Graphics.prototype._generateCachedSprite = function() -{ - var bounds = this.getLocalBounds(); - - if(!this._cachedSprite) - { - var canvasBuffer = new PIXI.CanvasBuffer(bounds.width, bounds.height); - var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); - - this._cachedSprite = new PIXI.Sprite(texture); - this._cachedSprite.buffer = canvasBuffer; - - this._cachedSprite.worldTransform = this.worldTransform; - } - else - { - this._cachedSprite.buffer.resize(bounds.width, bounds.height); - } - - // leverage the anchor to account for the offset of the element - this._cachedSprite.anchor.x = -( bounds.x / bounds.width ); - this._cachedSprite.anchor.y = -( bounds.y / bounds.height ); - - // this._cachedSprite.buffer.context.save(); - this._cachedSprite.buffer.context.translate(-bounds.x,-bounds.y); - - // make sure we set the alpha of the graphics to 1 for the render.. - this.worldAlpha = 1; - - // now render the graphic.. - PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context); - this._cachedSprite.alpha = this.alpha; -}; - -/** - * Updates texture size based on canvas size - * - * @method updateCachedSpriteTexture - * @private - */ -PIXI.Graphics.prototype.updateCachedSpriteTexture = function() -{ - var cachedSprite = this._cachedSprite; - var texture = cachedSprite.texture; - var canvas = cachedSprite.buffer.canvas; - - texture.baseTexture.width = canvas.width; - texture.baseTexture.height = canvas.height; - texture.crop.width = texture.frame.width = canvas.width; - texture.crop.height = texture.frame.height = canvas.height; - - cachedSprite._width = canvas.width; - cachedSprite._height = canvas.height; - - // update the dirty base textures - texture.baseTexture.dirty(); -}; - -/** - * Destroys a previous cached sprite. - * - * @method destroyCachedSprite - */ -PIXI.Graphics.prototype.destroyCachedSprite = function() -{ - this._cachedSprite.texture.destroy(true); - - // let the gc collect the unused sprite - // TODO could be object pooled! - this._cachedSprite = null; -}; - -/** - * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. - * - * @method drawShape - * @param {Circle|Rectangle|Ellipse|Line|Polygon} shape The Shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. - */ -PIXI.Graphics.prototype.drawShape = function(shape) -{ - if(this.currentPath) - { - // check current path! - if(this.currentPath.shape.points.length <= 2)this.graphicsData.pop(); - } - - this.currentPath = null; - - var data = new PIXI.GraphicsData(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, shape); - - this.graphicsData.push(data); - - if(data.type === PIXI.Graphics.POLY) - { - data.shape.closed = this.filling; - this.currentPath = data; - } - - this.dirty = true; - - return data; -}; - -/** - * A GraphicsData object. - * - * @class GraphicsData - * @constructor - */ -PIXI.GraphicsData = function(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, shape) -{ - this.lineWidth = lineWidth; - this.lineColor = lineColor; - this.lineAlpha = lineAlpha; - this._lineTint = lineColor; - - this.fillColor = fillColor; - this.fillAlpha = fillAlpha; - this._fillTint = fillColor; - this.fill = fill; - - this.shape = shape; - this.type = shape.type; -}; - -// SOME TYPES: -PIXI.Graphics.POLY = 0; -PIXI.Graphics.RECT = 1; -PIXI.Graphics.CIRC = 2; -PIXI.Graphics.ELIP = 3; -PIXI.Graphics.RREC = 4; - -PIXI.Polygon.prototype.type = PIXI.Graphics.POLY; -PIXI.Rectangle.prototype.type = PIXI.Graphics.RECT; -PIXI.Circle.prototype.type = PIXI.Graphics.CIRC; -PIXI.Ellipse.prototype.type = PIXI.Graphics.ELIP; -PIXI.RoundedRectangle.prototype.type = PIXI.Graphics.RREC; - diff --git a/tutorial-2/pixi.js-master/src/pixi/renderers/canvas/CanvasGraphics.js b/tutorial-2/pixi.js-master/src/pixi/renderers/canvas/CanvasGraphics.js deleted file mode 100755 index 1fb5372..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/renderers/canvas/CanvasGraphics.js +++ /dev/null @@ -1,358 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - - -/** - * A set of functions used by the canvas renderer to draw the primitive graphics data. - * - * @class CanvasGraphics - * @static - */ -PIXI.CanvasGraphics = function() -{ -}; - -/* - * Renders a PIXI.Graphics object to a canvas. - * - * @method renderGraphics - * @static - * @param graphics {Graphics} the actual graphics object to render - * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas - */ -PIXI.CanvasGraphics.renderGraphics = function(graphics, context) -{ - var worldAlpha = graphics.worldAlpha; - - if(graphics.dirty) - { - this.updateGraphicsTint(graphics); - graphics.dirty = false; - } - - - for (var i = 0; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - var shape = data.shape; - - var fillColor = data._fillTint; - var lineColor = data._lineTint; - - context.lineWidth = data.lineWidth; - - if(data.type === PIXI.Graphics.POLY) - { - context.beginPath(); - - var points = shape.points; - - context.moveTo(points[0], points[1]); - - for (var j=1; j < points.length/2; j++) - { - context.lineTo(points[j * 2], points[j * 2 + 1]); - } - - if(shape.closed) - { - context.lineTo(points[0], points[1]); - } - - // if the first and last point are the same close the path - much neater :) - if(points[0] === points[points.length-2] && points[1] === points[points.length-1]) - { - context.closePath(); - } - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if(data.type === PIXI.Graphics.RECT) - { - - if(data.fillColor || data.fillColor === 0) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fillRect(shape.x, shape.y, shape.width, shape.height); - - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.strokeRect(shape.x, shape.y, shape.width, shape.height); - } - } - else if(data.type === PIXI.Graphics.CIRC) - { - // TODO - need to be Undefined! - context.beginPath(); - context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI); - context.closePath(); - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if(data.type === PIXI.Graphics.ELIP) - { - // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas - - var w = shape.width * 2; - var h = shape.height * 2; - - var x = shape.x - w/2; - var y = shape.y - h/2; - - context.beginPath(); - - var kappa = 0.5522848, - ox = (w / 2) * kappa, // control point offset horizontal - oy = (h / 2) * kappa, // control point offset vertical - xe = x + w, // x-end - ye = y + h, // y-end - xm = x + w / 2, // x-middle - ym = y + h / 2; // y-middle - - context.moveTo(x, ym); - context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); - context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); - context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); - context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); - - context.closePath(); - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if (data.type === PIXI.Graphics.RREC) - { - var rx = shape.x; - var ry = shape.y; - var width = shape.width; - var height = shape.height; - var radius = shape.radius; - - var maxRadius = Math.min(width, height) / 2 | 0; - radius = radius > maxRadius ? maxRadius : radius; - - context.beginPath(); - context.moveTo(rx, ry + radius); - context.lineTo(rx, ry + height - radius); - context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height); - context.lineTo(rx + width - radius, ry + height); - context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius); - context.lineTo(rx + width, ry + radius); - context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry); - context.lineTo(rx + radius, ry); - context.quadraticCurveTo(rx, ry, rx, ry + radius); - context.closePath(); - - if(data.fillColor || data.fillColor === 0) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - } -}; - -/* - * Renders a graphics mask - * - * @static - * @private - * @method renderGraphicsMask - * @param graphics {Graphics} the graphics which will be used as a mask - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas - */ -PIXI.CanvasGraphics.renderGraphicsMask = function(graphics, context) -{ - var len = graphics.graphicsData.length; - - if(len === 0) return; - - if(len > 1) - { - len = 1; - window.console.log('Pixi.js warning: masks in canvas can only mask using the first path in the graphics object'); - } - - for (var i = 0; i < 1; i++) - { - var data = graphics.graphicsData[i]; - var shape = data.shape; - - if(data.type === PIXI.Graphics.POLY) - { - context.beginPath(); - - var points = shape.points; - - context.moveTo(points[0], points[1]); - - for (var j=1; j < points.length/2; j++) - { - context.lineTo(points[j * 2], points[j * 2 + 1]); - } - - // if the first and last point are the same close the path - much neater :) - if(points[0] === points[points.length-2] && points[1] === points[points.length-1]) - { - context.closePath(); - } - - } - else if(data.type === PIXI.Graphics.RECT) - { - context.beginPath(); - context.rect(shape.x, shape.y, shape.width, shape.height); - context.closePath(); - } - else if(data.type === PIXI.Graphics.CIRC) - { - // TODO - need to be Undefined! - context.beginPath(); - context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI); - context.closePath(); - } - else if(data.type === PIXI.Graphics.ELIP) - { - - // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas - - var w = shape.width * 2; - var h = shape.height * 2; - - var x = shape.x - w/2; - var y = shape.y - h/2; - - context.beginPath(); - - var kappa = 0.5522848, - ox = (w / 2) * kappa, // control point offset horizontal - oy = (h / 2) * kappa, // control point offset vertical - xe = x + w, // x-end - ye = y + h, // y-end - xm = x + w / 2, // x-middle - ym = y + h / 2; // y-middle - - context.moveTo(x, ym); - context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); - context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); - context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); - context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); - context.closePath(); - } - else if (data.type === PIXI.Graphics.RREC) - { - - var pts = shape.points; - var rx = pts[0]; - var ry = pts[1]; - var width = pts[2]; - var height = pts[3]; - var radius = pts[4]; - - var maxRadius = Math.min(width, height) / 2 | 0; - radius = radius > maxRadius ? maxRadius : radius; - - context.beginPath(); - context.moveTo(rx, ry + radius); - context.lineTo(rx, ry + height - radius); - context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height); - context.lineTo(rx + width - radius, ry + height); - context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius); - context.lineTo(rx + width, ry + radius); - context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry); - context.lineTo(rx + radius, ry); - context.quadraticCurveTo(rx, ry, rx, ry + radius); - context.closePath(); - } - } -}; - -PIXI.CanvasGraphics.updateGraphicsTint = function(graphics) -{ - if(graphics.tint === 0xFFFFFF)return; - - var tintR = (graphics.tint >> 16 & 0xFF) / 255; - var tintG = (graphics.tint >> 8 & 0xFF) / 255; - var tintB = (graphics.tint & 0xFF)/ 255; - - for (var i = 0; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - - var fillColor = data.fillColor | 0; - var lineColor = data.lineColor | 0; - - /* - var colorR = (fillColor >> 16 & 0xFF) / 255; - var colorG = (fillColor >> 8 & 0xFF) / 255; - var colorB = (fillColor & 0xFF) / 255; - - colorR *= tintR; - colorG *= tintG; - colorB *= tintB; - - fillColor = ((colorR*255 << 16) + (colorG*255 << 8) + colorB*255); - - colorR = (lineColor >> 16 & 0xFF) / 255; - colorG = (lineColor >> 8 & 0xFF) / 255; - colorB = (lineColor & 0xFF) / 255; - - colorR *= tintR; - colorG *= tintG; - colorB *= tintB; - - lineColor = ((colorR*255 << 16) + (colorG*255 << 8) + colorB*255); - */ - - // super inline cos im an optimization NAZI :) - data._fillTint = (((fillColor >> 16 & 0xFF) / 255 * tintR*255 << 16) + ((fillColor >> 8 & 0xFF) / 255 * tintG*255 << 8) + (fillColor & 0xFF) / 255 * tintB*255); - data._lineTint = (((lineColor >> 16 & 0xFF) / 255 * tintR*255 << 16) + ((lineColor >> 8 & 0xFF) / 255 * tintG*255 << 8) + (lineColor & 0xFF) / 255 * tintB*255); - - } -}; - diff --git a/tutorial-2/pixi.js-master/src/pixi/renderers/canvas/CanvasRenderer.js b/tutorial-2/pixi.js-master/src/pixi/renderers/canvas/CanvasRenderer.js deleted file mode 100755 index 86a12f9..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/renderers/canvas/CanvasRenderer.js +++ /dev/null @@ -1,345 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The CanvasRenderer draws the Stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. - * Don't forget to add the CanvasRenderer.view to your DOM or you will not see anything :) - * - * @class CanvasRenderer - * @constructor - * @param [width=800] {Number} the width of the canvas view - * @param [height=600] {Number} the height of the canvas view - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * @param [options.clearBeforeRender=true] {Boolean} This sets if the CanvasRenderer will clear the canvas or not before the new render pass. - */ -PIXI.CanvasRenderer = function(width, height, options) -{ - if(options) - { - for (var i in PIXI.defaultRenderOptions) - { - if (typeof options[i] === "undefined") options[i] = PIXI.defaultRenderOptions[i]; - } - } - else - { - options = PIXI.defaultRenderOptions; - } - - if(!PIXI.defaultRenderer) - { - PIXI.sayHello("Canvas"); - PIXI.defaultRenderer = this; - } - - /** - * The renderer type. - * - * @property type - * @type Number - */ - this.type = PIXI.CANVAS_RENDERER; - - /** - * The resolution of the canvas. - * - * @property resolution - * @type Number - */ - this.resolution = options.resolution; - - /** - * This sets if the CanvasRenderer will clear the canvas or not before the new render pass. - * If the Stage is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color. - * If the Stage is transparent Pixi will use clearRect to clear the canvas every frame. - * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set. - * - * @property clearBeforeRender - * @type Boolean - * @default - */ - this.clearBeforeRender = options.clearBeforeRender; - - /** - * Whether the render view is transparent - * - * @property transparent - * @type Boolean - */ - this.transparent = options.transparent; - - /** - * Whether the render view should be resized automatically - * - * @property autoResize - * @type Boolean - */ - this.autoResize = options.autoResize || false; - - - /** - * The width of the canvas view - * - * @property width - * @type Number - * @default 800 - */ - this.width = width || 800; - - /** - * The height of the canvas view - * - * @property height - * @type Number - * @default 600 - */ - this.height = height || 600; - - this.width *= this.resolution; - this.height *= this.resolution; - - /** - * The canvas element that everything is drawn to. - * - * @property view - * @type HTMLCanvasElement - */ - this.view = options.view || document.createElement( "canvas" ); - - /** - * The canvas 2d context that everything is drawn with - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.view.getContext( "2d", { alpha: this.transparent } ); - - /** - * Boolean flag controlling canvas refresh. - * - * @property refresh - * @type Boolean - */ - this.refresh = true; - - this.view.width = this.width * this.resolution; - this.view.height = this.height * this.resolution; - - /** - * Internal var. - * - * @property count - * @type Number - */ - this.count = 0; - - /** - * Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer - * @property maskManager - * @type CanvasMaskManager - */ - this.maskManager = new PIXI.CanvasMaskManager(); - - /** - * The render session is just a bunch of parameter used for rendering - * @property renderSession - * @type Object - */ - this.renderSession = { - context: this.context, - maskManager: this.maskManager, - scaleMode: null, - smoothProperty: null, - /** - * If true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation. - * Handy for crisp pixel art and speed on legacy devices. - * - */ - roundPixels: false - }; - - this.mapBlendModes(); - - this.resize(width, height); - - if("imageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "imageSmoothingEnabled"; - else if("webkitImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "webkitImageSmoothingEnabled"; - else if("mozImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "mozImageSmoothingEnabled"; - else if("oImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "oImageSmoothingEnabled"; - else if ("msImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "msImageSmoothingEnabled"; -}; - -// constructor -PIXI.CanvasRenderer.prototype.constructor = PIXI.CanvasRenderer; - -/** - * Renders the Stage to this canvas view - * - * @method render - * @param stage {Stage} the Stage element to be rendered - */ -PIXI.CanvasRenderer.prototype.render = function(stage) -{ - stage.updateTransform(); - - this.context.setTransform(1,0,0,1,0,0); - - this.context.globalAlpha = 1; - - this.renderSession.currentBlendMode = PIXI.blendModes.NORMAL; - this.context.globalCompositeOperation = PIXI.blendModesCanvas[PIXI.blendModes.NORMAL]; - - if (navigator.isCocoonJS && this.view.screencanvas) { - this.context.fillStyle = "black"; - this.context.clear(); - } - - if (this.clearBeforeRender) - { - if (this.transparent) - { - this.context.clearRect(0, 0, this.width, this.height); - } - else - { - this.context.fillStyle = stage.backgroundColorString; - this.context.fillRect(0, 0, this.width , this.height); - } - } - - this.renderDisplayObject(stage); - - // run interaction! - if(stage.interactive) - { - //need to add some events! - if(!stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = true; - stage.interactionManager.setTarget(this); - } - } -}; - -/** - * Removes everything from the renderer and optionally removes the Canvas DOM element. - * - * @method destroy - * @param [removeView=true] {boolean} Removes the Canvas element from the DOM. - */ -PIXI.CanvasRenderer.prototype.destroy = function(removeView) -{ - if (typeof removeView === "undefined") { removeView = true; } - - if (removeView && this.view.parent) - { - this.view.parent.removeChild(this.view); - } - - this.view = null; - this.context = null; - this.maskManager = null; - this.renderSession = null; - -}; - -/** - * Resizes the canvas view to the specified width and height - * - * @method resize - * @param width {Number} the new width of the canvas view - * @param height {Number} the new height of the canvas view - */ -PIXI.CanvasRenderer.prototype.resize = function(width, height) -{ - this.width = width * this.resolution; - this.height = height * this.resolution; - - this.view.width = this.width; - this.view.height = this.height; - - if (this.autoResize) { - this.view.style.width = this.width / this.resolution + "px"; - this.view.style.height = this.height / this.resolution + "px"; - } -}; - -/** - * Renders a display object - * - * @method renderDisplayObject - * @param displayObject {DisplayObject} The displayObject to render - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas - * @private - */ -PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject, context) -{ - this.renderSession.context = context || this.context; - this.renderSession.resolution = this.resolution; - displayObject._renderCanvas(this.renderSession); -}; - -/** - * Maps Pixi blend modes to canvas blend modes. - * - * @method mapBlendModes - * @private - */ -PIXI.CanvasRenderer.prototype.mapBlendModes = function() -{ - if(!PIXI.blendModesCanvas) - { - PIXI.blendModesCanvas = []; - - if(PIXI.canUseNewCanvasBlendModes()) - { - PIXI.blendModesCanvas[PIXI.blendModes.NORMAL] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.ADD] = "lighter"; //IS THIS OK??? - PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "multiply"; - PIXI.blendModesCanvas[PIXI.blendModes.SCREEN] = "screen"; - PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY] = "overlay"; - PIXI.blendModesCanvas[PIXI.blendModes.DARKEN] = "darken"; - PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN] = "lighten"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "color-dodge"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "color-burn"; - PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "hard-light"; - PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "soft-light"; - PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "difference"; - PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "exclusion"; - PIXI.blendModesCanvas[PIXI.blendModes.HUE] = "hue"; - PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "saturation"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR] = "color"; - PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "luminosity"; - } - else - { - // this means that the browser does not support the cool new blend modes in canvas "cough" ie "cough" - PIXI.blendModesCanvas[PIXI.blendModes.NORMAL] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.ADD] = "lighter"; //IS THIS OK??? - PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SCREEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.DARKEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.HUE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "source-over"; - } - } -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasBuffer.js b/tutorial-2/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasBuffer.js deleted file mode 100755 index b53d851..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasBuffer.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Creates a Canvas element of the given size. - * - * @class CanvasBuffer - * @constructor - * @param width {Number} the width for the newly created canvas - * @param height {Number} the height for the newly created canvas - */ -PIXI.CanvasBuffer = function(width, height) -{ - /** - * The width of the Canvas in pixels. - * - * @property width - * @type Number - */ - this.width = width; - - /** - * The height of the Canvas in pixels. - * - * @property height - * @type Number - */ - this.height = height; - - /** - * The Canvas object that belongs to this CanvasBuffer. - * - * @property canvas - * @type HTMLCanvasElement - */ - this.canvas = document.createElement("canvas"); - - /** - * A CanvasRenderingContext2D object representing a two-dimensional rendering context. - * - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.canvas.getContext("2d"); - - this.canvas.width = width; - this.canvas.height = height; -}; - -PIXI.CanvasBuffer.prototype.constructor = PIXI.CanvasBuffer; - -/** - * Clears the canvas that was created by the CanvasBuffer class. - * - * @method clear - * @private - */ -PIXI.CanvasBuffer.prototype.clear = function() -{ - this.context.setTransform(1, 0, 0, 1, 0, 0); - this.context.clearRect(0,0, this.width, this.height); -}; - -/** - * Resizes the canvas to the specified width and height. - * - * @method resize - * @param width {Number} the new width of the canvas - * @param height {Number} the new height of the canvas - */ -PIXI.CanvasBuffer.prototype.resize = function(width, height) -{ - this.width = this.canvas.width = width; - this.height = this.canvas.height = height; -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasMaskManager.js b/tutorial-2/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasMaskManager.js deleted file mode 100755 index 748adda..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasMaskManager.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A set of functions used to handle masking. - * - * @class CanvasMaskManager - * @constructor - */ -PIXI.CanvasMaskManager = function() -{ -}; - -PIXI.CanvasMaskManager.prototype.constructor = PIXI.CanvasMaskManager; - -/** - * This method adds it to the current stack of masks. - * - * @method pushMask - * @param maskData {Object} the maskData that will be pushed - * @param renderSession {Object} The renderSession whose context will be used for this mask manager. - */ -PIXI.CanvasMaskManager.prototype.pushMask = function(maskData, renderSession) -{ - var context = renderSession.context; - - context.save(); - - var cacheAlpha = maskData.alpha; - var transform = maskData.worldTransform; - - var resolution = renderSession.resolution; - - context.setTransform(transform.a * resolution, - transform.b * resolution, - transform.c * resolution, - transform.d * resolution, - transform.tx * resolution, - transform.ty * resolution); - - PIXI.CanvasGraphics.renderGraphicsMask(maskData, context); - - context.clip(); - - maskData.worldAlpha = cacheAlpha; -}; - -/** - * Restores the current drawing context to the state it was before the mask was applied. - * - * @method popMask - * @param renderSession {Object} The renderSession whose context will be used for this mask manager. - */ -PIXI.CanvasMaskManager.prototype.popMask = function(renderSession) -{ - renderSession.context.restore(); -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasTinter.js b/tutorial-2/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasTinter.js deleted file mode 100755 index dd50b06..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasTinter.js +++ /dev/null @@ -1,242 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Utility methods for Sprite/Texture tinting. - * - * @class CanvasTinter - * @static - */ -PIXI.CanvasTinter = function() -{ -}; - -/** - * Basically this method just needs a sprite and a color and tints the sprite with the given color. - * - * @method getTintedTexture - * @static - * @param sprite {Sprite} the sprite to tint - * @param color {Number} the color to use to tint the sprite with - * @return {HTMLCanvasElement} The tinted canvas - */ -PIXI.CanvasTinter.getTintedTexture = function(sprite, color) -{ - var texture = sprite.texture; - - color = PIXI.CanvasTinter.roundColor(color); - - var stringColor = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - - texture.tintCache = texture.tintCache || {}; - - if(texture.tintCache[stringColor]) return texture.tintCache[stringColor]; - - // clone texture.. - var canvas = PIXI.CanvasTinter.canvas || document.createElement("canvas"); - - //PIXI.CanvasTinter.tintWithPerPixel(texture, stringColor, canvas); - PIXI.CanvasTinter.tintMethod(texture, color, canvas); - - if(PIXI.CanvasTinter.convertTintToImage) - { - // is this better? - var tintImage = new Image(); - tintImage.src = canvas.toDataURL(); - - texture.tintCache[stringColor] = tintImage; - } - else - { - texture.tintCache[stringColor] = canvas; - // if we are not converting the texture to an image then we need to lose the reference to the canvas - PIXI.CanvasTinter.canvas = null; - } - - return canvas; -}; - -/** - * Tint a texture using the "multiply" operation. - * - * @method tintWithMultiply - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithMultiply = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - - context.fillRect(0, 0, crop.width, crop.height); - - context.globalCompositeOperation = "multiply"; - - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - context.globalCompositeOperation = "destination-atop"; - - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); -}; - -/** - * Tint a texture using the "overlay" operation. - * - * @method tintWithOverlay - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithOverlay = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.globalCompositeOperation = "copy"; - context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - context.fillRect(0, 0, crop.width, crop.height); - - context.globalCompositeOperation = "destination-atop"; - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - //context.globalCompositeOperation = "copy"; -}; - -/** - * Tint a texture pixel per pixel. - * - * @method tintPerPixel - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithPerPixel = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.globalCompositeOperation = "copy"; - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - var rgbValues = PIXI.hex2rgb(color); - var r = rgbValues[0], g = rgbValues[1], b = rgbValues[2]; - - var pixelData = context.getImageData(0, 0, crop.width, crop.height); - - var pixels = pixelData.data; - - for (var i = 0; i < pixels.length; i += 4) - { - pixels[i+0] *= r; - pixels[i+1] *= g; - pixels[i+2] *= b; - } - - context.putImageData(pixelData, 0, 0); -}; - -/** - * Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel. - * - * @method roundColor - * @static - * @param color {number} the color to round, should be a hex color - */ -PIXI.CanvasTinter.roundColor = function(color) -{ - var step = PIXI.CanvasTinter.cacheStepsPerColorChannel; - - var rgbValues = PIXI.hex2rgb(color); - - rgbValues[0] = Math.min(255, (rgbValues[0] / step) * step); - rgbValues[1] = Math.min(255, (rgbValues[1] / step) * step); - rgbValues[2] = Math.min(255, (rgbValues[2] / step) * step); - - return PIXI.rgb2hex(rgbValues); -}; - -/** - * Number of steps which will be used as a cap when rounding colors. - * - * @property cacheStepsPerColorChannel - * @type Number - * @static - */ -PIXI.CanvasTinter.cacheStepsPerColorChannel = 8; - -/** - * Tint cache boolean flag. - * - * @property convertTintToImage - * @type Boolean - * @static - */ -PIXI.CanvasTinter.convertTintToImage = false; - -/** - * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. - * - * @property canUseMultiply - * @type Boolean - * @static - */ -PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes(); - -/** - * The tinting method that will be used. - * - * @method tintMethod - * @static - */ -PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel; diff --git a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/WebGLRenderer.js b/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/WebGLRenderer.js deleted file mode 100755 index 02b30e4..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/WebGLRenderer.js +++ /dev/null @@ -1,554 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -PIXI.glContexts = []; // this is where we store the webGL contexts for easy access. -PIXI.instances = []; - -/** - * The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer - * should be used for browsers that support webGL. This Render works by automatically managing webGLBatchs. - * So no need for Sprite Batches or Sprite Clouds. - * Don't forget to add the view to your DOM or you will not see anything :) - * - * @class WebGLRenderer - * @constructor - * @param [width=0] {Number} the width of the canvas view - * @param [height=0] {Number} the height of the canvas view - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - */ -PIXI.WebGLRenderer = function(width, height, options) -{ - if(options) - { - for (var i in PIXI.defaultRenderOptions) - { - if (typeof options[i] === 'undefined') options[i] = PIXI.defaultRenderOptions[i]; - } - } - else - { - options = PIXI.defaultRenderOptions; - } - - if(!PIXI.defaultRenderer) - { - PIXI.sayHello('webGL'); - PIXI.defaultRenderer = this; - } - - /** - * @property type - * @type Number - */ - this.type = PIXI.WEBGL_RENDERER; - - /** - * The resolution of the renderer - * - * @property resolution - * @type Number - * @default 1 - */ - this.resolution = options.resolution; - - // do a catch.. only 1 webGL renderer.. - - /** - * Whether the render view is transparent - * - * @property transparent - * @type Boolean - */ - this.transparent = options.transparent; - - /** - * Whether the render view should be resized automatically - * - * @property autoResize - * @type Boolean - */ - this.autoResize = options.autoResize || false; - - /** - * The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering. - * - * @property preserveDrawingBuffer - * @type Boolean - */ - this.preserveDrawingBuffer = options.preserveDrawingBuffer; - - /** - * This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true: - * If the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0). - * If the Stage is transparent, Pixi will clear to the target Stage's background color. - * Disable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set. - * - * @property clearBeforeRender - * @type Boolean - * @default - */ - this.clearBeforeRender = options.clearBeforeRender; - - /** - * The width of the canvas view - * - * @property width - * @type Number - * @default 800 - */ - this.width = width || 800; - - /** - * The height of the canvas view - * - * @property height - * @type Number - * @default 600 - */ - this.height = height || 600; - - /** - * The canvas element that everything is drawn to - * - * @property view - * @type HTMLCanvasElement - */ - this.view = options.view || document.createElement( 'canvas' ); - - // deal with losing context.. - - /** - * @property contextLostBound - * @type Function - */ - this.contextLostBound = this.handleContextLost.bind(this); - - /** - * @property contextRestoredBound - * @type Function - */ - this.contextRestoredBound = this.handleContextRestored.bind(this); - - this.view.addEventListener('webglcontextlost', this.contextLostBound, false); - this.view.addEventListener('webglcontextrestored', this.contextRestoredBound, false); - - /** - * @property _contextOptions - * @type Object - * @private - */ - this._contextOptions = { - alpha: this.transparent, - antialias: options.antialias, // SPEED UP?? - premultipliedAlpha:this.transparent && this.transparent !== 'notMultiplied', - stencil:true, - preserveDrawingBuffer: options.preserveDrawingBuffer - }; - - /** - * @property projection - * @type Point - */ - this.projection = new PIXI.Point(); - - /** - * @property offset - * @type Point - */ - this.offset = new PIXI.Point(0, 0); - - // time to create the render managers! each one focuses on managing a state in webGL - - /** - * Deals with managing the shader programs and their attribs - * @property shaderManager - * @type WebGLShaderManager - */ - this.shaderManager = new PIXI.WebGLShaderManager(); - - /** - * Manages the rendering of sprites - * @property spriteBatch - * @type WebGLSpriteBatch - */ - this.spriteBatch = new PIXI.WebGLSpriteBatch(); - - /** - * Manages the masks using the stencil buffer - * @property maskManager - * @type WebGLMaskManager - */ - this.maskManager = new PIXI.WebGLMaskManager(); - - /** - * Manages the filters - * @property filterManager - * @type WebGLFilterManager - */ - this.filterManager = new PIXI.WebGLFilterManager(); - - /** - * Manages the stencil buffer - * @property stencilManager - * @type WebGLStencilManager - */ - this.stencilManager = new PIXI.WebGLStencilManager(); - - /** - * Manages the blendModes - * @property blendModeManager - * @type WebGLBlendModeManager - */ - this.blendModeManager = new PIXI.WebGLBlendModeManager(); - - /** - * TODO remove - * @property renderSession - * @type Object - */ - this.renderSession = {}; - this.renderSession.gl = this.gl; - this.renderSession.drawCount = 0; - this.renderSession.shaderManager = this.shaderManager; - this.renderSession.maskManager = this.maskManager; - this.renderSession.filterManager = this.filterManager; - this.renderSession.blendModeManager = this.blendModeManager; - this.renderSession.spriteBatch = this.spriteBatch; - this.renderSession.stencilManager = this.stencilManager; - this.renderSession.renderer = this; - this.renderSession.resolution = this.resolution; - - // time init the context.. - this.initContext(); - - // map some webGL blend modes.. - this.mapBlendModes(); -}; - -// constructor -PIXI.WebGLRenderer.prototype.constructor = PIXI.WebGLRenderer; - -/** -* @method initContext -*/ -PIXI.WebGLRenderer.prototype.initContext = function() -{ - var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); - this.gl = gl; - - if (!gl) { - // fail, not able to get a context - throw new Error('This browser does not support webGL. Try using the canvas renderer'); - } - - this.glContextId = gl.id = PIXI.WebGLRenderer.glContextId ++; - - PIXI.glContexts[this.glContextId] = gl; - - PIXI.instances[this.glContextId] = this; - - // set up the default pixi settings.. - gl.disable(gl.DEPTH_TEST); - gl.disable(gl.CULL_FACE); - gl.enable(gl.BLEND); - - // need to set the context for all the managers... - this.shaderManager.setContext(gl); - this.spriteBatch.setContext(gl); - this.maskManager.setContext(gl); - this.filterManager.setContext(gl); - this.blendModeManager.setContext(gl); - this.stencilManager.setContext(gl); - - this.renderSession.gl = this.gl; - - // now resize and we are good to go! - this.resize(this.width, this.height); -}; - -/** - * Renders the stage to its webGL view - * - * @method render - * @param stage {Stage} the Stage element to be rendered - */ -PIXI.WebGLRenderer.prototype.render = function(stage) -{ - // no point rendering if our context has been blown up! - if(this.contextLost)return; - - // if rendering a new stage clear the batches.. - if(this.__stage !== stage) - { - if(stage.interactive)stage.interactionManager.removeEvents(); - - // TODO make this work - // dont think this is needed any more? - this.__stage = stage; - } - - // update the scene graph - stage.updateTransform(); - - var gl = this.gl; - - // interaction - if(stage._interactive) - { - //need to add some events! - if(!stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = true; - stage.interactionManager.setTarget(this); - } - } - else - { - if(stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = false; - stage.interactionManager.setTarget(this); - } - } - - // -- Does this need to be set every frame? -- // - gl.viewport(0, 0, this.width, this.height); - - // make sure we are bound to the main frame buffer - gl.bindFramebuffer(gl.FRAMEBUFFER, null); - - if (this.clearBeforeRender) - { - if(this.transparent) - { - gl.clearColor(0, 0, 0, 0); - } - else - { - gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], 1); - } - - gl.clear (gl.COLOR_BUFFER_BIT); - } - - this.renderDisplayObject( stage, this.projection ); -}; - -/** - * Renders a Display Object. - * - * @method renderDisplayObject - * @param displayObject {DisplayObject} The DisplayObject to render - * @param projection {Point} The projection - * @param buffer {Array} a standard WebGL buffer - */ -PIXI.WebGLRenderer.prototype.renderDisplayObject = function(displayObject, projection, buffer) -{ - this.renderSession.blendModeManager.setBlendMode(PIXI.blendModes.NORMAL); - - // reset the render session data.. - this.renderSession.drawCount = 0; - - // make sure to flip the Y if using a render texture.. - this.renderSession.flipY = buffer ? -1 : 1; - - // set the default projection - this.renderSession.projection = projection; - - //set the default offset - this.renderSession.offset = this.offset; - - // start the sprite batch - this.spriteBatch.begin(this.renderSession); - - // start the filter manager - this.filterManager.begin(this.renderSession, buffer); - - // render the scene! - displayObject._renderWebGL(this.renderSession); - - // finish the sprite batch - this.spriteBatch.end(); -}; - -/** - * Resizes the webGL view to the specified width and height. - * - * @method resize - * @param width {Number} the new width of the webGL view - * @param height {Number} the new height of the webGL view - */ -PIXI.WebGLRenderer.prototype.resize = function(width, height) -{ - this.width = width * this.resolution; - this.height = height * this.resolution; - - this.view.width = this.width; - this.view.height = this.height; - - if (this.autoResize) { - this.view.style.width = this.width / this.resolution + 'px'; - this.view.style.height = this.height / this.resolution + 'px'; - } - - this.gl.viewport(0, 0, this.width, this.height); - - this.projection.x = this.width / 2 / this.resolution; - this.projection.y = -this.height / 2 / this.resolution; -}; - -/** - * Updates and Creates a WebGL texture for the renderers context. - * - * @method updateTexture - * @param texture {Texture} the texture to update - */ -PIXI.WebGLRenderer.prototype.updateTexture = function(texture) -{ - if(!texture.hasLoaded )return; - - var gl = this.gl; - - if(!texture._glTextures[gl.id])texture._glTextures[gl.id] = gl.createTexture(); - - gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]); - - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultipliedAlpha); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source); - - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - - - if(texture.mipmap && PIXI.isPowerOfTwo(texture.width, texture.height)) - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR_MIPMAP_LINEAR : gl.NEAREST_MIPMAP_NEAREST); - gl.generateMipmap(gl.TEXTURE_2D); - } - else - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - } - - // reguler... - if(!texture._powerOf2) - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - } - else - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT); - } - - texture._dirty[gl.id] = false; - - return texture._glTextures[gl.id]; -}; - -/** - * Handles a lost webgl context - * - * @method handleContextLost - * @param event {Event} - * @private - */ -PIXI.WebGLRenderer.prototype.handleContextLost = function(event) -{ - event.preventDefault(); - this.contextLost = true; -}; - -/** - * Handles a restored webgl context - * - * @method handleContextRestored - * @param event {Event} - * @private - */ -PIXI.WebGLRenderer.prototype.handleContextRestored = function() -{ - this.initContext(); - - // empty all the ol gl textures as they are useless now - for(var key in PIXI.TextureCache) - { - var texture = PIXI.TextureCache[key].baseTexture; - texture._glTextures = []; - } - - this.contextLost = false; -}; - -/** - * Removes everything from the renderer (event listeners, spritebatch, etc...) - * - * @method destroy - */ -PIXI.WebGLRenderer.prototype.destroy = function() -{ - // remove listeners - this.view.removeEventListener('webglcontextlost', this.contextLostBound); - this.view.removeEventListener('webglcontextrestored', this.contextRestoredBound); - - PIXI.glContexts[this.glContextId] = null; - - this.projection = null; - this.offset = null; - - // time to create the render managers! each one focuses on managine a state in webGL - this.shaderManager.destroy(); - this.spriteBatch.destroy(); - this.maskManager.destroy(); - this.filterManager.destroy(); - - this.shaderManager = null; - this.spriteBatch = null; - this.maskManager = null; - this.filterManager = null; - - this.gl = null; - this.renderSession = null; -}; - -/** - * Maps Pixi blend modes to WebGL blend modes. - * - * @method mapBlendModes - */ -PIXI.WebGLRenderer.prototype.mapBlendModes = function() -{ - var gl = this.gl; - - if(!PIXI.blendModesWebGL) - { - PIXI.blendModesWebGL = []; - - PIXI.blendModesWebGL[PIXI.blendModes.NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.ADD] = [gl.SRC_ALPHA, gl.DST_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SCREEN] = [gl.SRC_ALPHA, gl.ONE]; - PIXI.blendModesWebGL[PIXI.blendModes.OVERLAY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.DARKEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.LIGHTEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR_DODGE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR_BURN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.HARD_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SOFT_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.DIFFERENCE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.EXCLUSION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.HUE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SATURATION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.LUMINOSITY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - } -}; - -PIXI.WebGLRenderer.glContextId = 0; diff --git a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js b/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js deleted file mode 100755 index bbd3259..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ /dev/null @@ -1,122 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class ComplexPrimitiveShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.ComplexPrimitiveShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - - 'precision mediump float;', - - 'varying vec4 vColor;', - - 'void main(void) {', - ' gl_FragColor = vColor;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - //'attribute vec4 aColor;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - - 'uniform vec3 tint;', - 'uniform float alpha;', - 'uniform vec3 color;', - 'uniform float flipY;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);', - ' vColor = vec4(color * alpha * tint, alpha);',//" * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.ComplexPrimitiveShader.prototype.constructor = PIXI.ComplexPrimitiveShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.ComplexPrimitiveShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.tintColor = gl.getUniformLocation(program, 'tint'); - this.color = gl.getUniformLocation(program, 'color'); - this.flipY = gl.getUniformLocation(program, 'flipY'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - // this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - this.attributes = [this.aVertexPosition, this.colorAttribute]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.ComplexPrimitiveShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attribute = null; -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiFastShader.js b/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiFastShader.js deleted file mode 100755 index 8e685e7..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiFastShader.js +++ /dev/null @@ -1,155 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class PixiFastShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PixiFastShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying float vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aPositionCoord;', - 'attribute vec2 aScale;', - 'attribute float aRotation;', - 'attribute vec2 aTextureCoord;', - 'attribute float aColor;', - - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - 'uniform mat3 uMatrix;', - - 'varying vec2 vTextureCoord;', - 'varying float vColor;', - - 'const vec2 center = vec2(-1.0, 1.0);', - - 'void main(void) {', - ' vec2 v;', - ' vec2 sv = aVertexPosition * aScale;', - ' v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);', - ' v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);', - ' v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;', - ' gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - // ' vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;', - ' vColor = aColor;', - '}' - ]; - - /** - * A local texture counter for multi-texture shaders. - * @property textureCount - * @type Number - */ - this.textureCount = 0; - - this.init(); -}; - -PIXI.PixiFastShader.prototype.constructor = PIXI.PixiFastShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PixiFastShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.dimensions = gl.getUniformLocation(program, 'dimensions'); - this.uMatrix = gl.getUniformLocation(program, 'uMatrix'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aPositionCoord = gl.getAttribLocation(program, 'aPositionCoord'); - - this.aScale = gl.getAttribLocation(program, 'aScale'); - this.aRotation = gl.getAttribLocation(program, 'aRotation'); - - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - // Begin worst hack eva // - - // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? - // maybe its somthing to do with the current state of the gl context. - // Im convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel - // If theres any webGL people that know why could happen please help :) - if(this.colorAttribute === -1) - { - this.colorAttribute = 2; - } - - this.attributes = [this.aVertexPosition, this.aPositionCoord, this.aScale, this.aRotation, this.aTextureCoord, this.colorAttribute]; - - // End worst hack eva // - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PixiFastShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiShader.js b/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiShader.js deleted file mode 100755 index e70be7f..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiShader.js +++ /dev/null @@ -1,389 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * @author Richard Davey http://www.photonstorm.com @photonstorm - */ - -/** -* @class PixiShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PixiShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]; - - /** - * A local texture counter for multi-texture shaders. - * @property textureCount - * @type Number - */ - this.textureCount = 0; - - /** - * A local flag - * @property firstRun - * @type Boolean - * @private - */ - this.firstRun = true; - - /** - * A dirty flag - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * Uniform attributes cache. - * @property attributes - * @type Array - * @private - */ - this.attributes = []; - - this.init(); -}; - -PIXI.PixiShader.prototype.constructor = PIXI.PixiShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PixiShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc || PIXI.PixiShader.defaultVertexSrc, this.fragmentSrc); - - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.dimensions = gl.getUniformLocation(program, 'dimensions'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - // Begin worst hack eva // - - // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? - // maybe its something to do with the current state of the gl context. - // I'm convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel - // If theres any webGL people that know why could happen please help :) - if(this.colorAttribute === -1) - { - this.colorAttribute = 2; - } - - this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute]; - - // End worst hack eva // - - // add those custom shaders! - for (var key in this.uniforms) - { - // get the uniform locations.. - this.uniforms[key].uniformLocation = gl.getUniformLocation(program, key); - } - - this.initUniforms(); - - this.program = program; -}; - -/** -* Initialises the shader uniform values. -* -* Uniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/ -* http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf -* -* @method initUniforms -*/ -PIXI.PixiShader.prototype.initUniforms = function() -{ - this.textureCount = 1; - var gl = this.gl; - var uniform; - - for (var key in this.uniforms) - { - uniform = this.uniforms[key]; - - var type = uniform.type; - - if (type === 'sampler2D') - { - uniform._init = false; - - if (uniform.value !== null) - { - this.initSampler2D(uniform); - } - } - else if (type === 'mat2' || type === 'mat3' || type === 'mat4') - { - // These require special handling - uniform.glMatrix = true; - uniform.glValueLength = 1; - - if (type === 'mat2') - { - uniform.glFunc = gl.uniformMatrix2fv; - } - else if (type === 'mat3') - { - uniform.glFunc = gl.uniformMatrix3fv; - } - else if (type === 'mat4') - { - uniform.glFunc = gl.uniformMatrix4fv; - } - } - else - { - // GL function reference - uniform.glFunc = gl['uniform' + type]; - - if (type === '2f' || type === '2i') - { - uniform.glValueLength = 2; - } - else if (type === '3f' || type === '3i') - { - uniform.glValueLength = 3; - } - else if (type === '4f' || type === '4i') - { - uniform.glValueLength = 4; - } - else - { - uniform.glValueLength = 1; - } - } - } - -}; - -/** -* Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded) -* -* @method initSampler2D -*/ -PIXI.PixiShader.prototype.initSampler2D = function(uniform) -{ - if (!uniform.value || !uniform.value.baseTexture || !uniform.value.baseTexture.hasLoaded) - { - return; - } - - var gl = this.gl; - - gl.activeTexture(gl['TEXTURE' + this.textureCount]); - gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]); - - // Extended texture data - if (uniform.textureData) - { - var data = uniform.textureData; - - // GLTexture = mag linear, min linear_mipmap_linear, wrap repeat + gl.generateMipmap(gl.TEXTURE_2D); - // GLTextureLinear = mag/min linear, wrap clamp - // GLTextureNearestRepeat = mag/min NEAREST, wrap repeat - // GLTextureNearest = mag/min nearest, wrap clamp - // AudioTexture = whatever + luminance + width 512, height 2, border 0 - // KeyTexture = whatever + luminance + width 256, height 2, border 0 - - // magFilter can be: gl.LINEAR, gl.LINEAR_MIPMAP_LINEAR or gl.NEAREST - // wrapS/T can be: gl.CLAMP_TO_EDGE or gl.REPEAT - - var magFilter = (data.magFilter) ? data.magFilter : gl.LINEAR; - var minFilter = (data.minFilter) ? data.minFilter : gl.LINEAR; - var wrapS = (data.wrapS) ? data.wrapS : gl.CLAMP_TO_EDGE; - var wrapT = (data.wrapT) ? data.wrapT : gl.CLAMP_TO_EDGE; - var format = (data.luminance) ? gl.LUMINANCE : gl.RGBA; - - if (data.repeat) - { - wrapS = gl.REPEAT; - wrapT = gl.REPEAT; - } - - gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, !!data.flipY); - - if (data.width) - { - var width = (data.width) ? data.width : 512; - var height = (data.height) ? data.height : 2; - var border = (data.border) ? data.border : 0; - - // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels); - gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, border, format, gl.UNSIGNED_BYTE, null); - } - else - { - // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, ImageData? pixels); - gl.texImage2D(gl.TEXTURE_2D, 0, format, gl.RGBA, gl.UNSIGNED_BYTE, uniform.value.baseTexture.source); - } - - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrapS); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT); - } - - gl.uniform1i(uniform.uniformLocation, this.textureCount); - - uniform._init = true; - - this.textureCount++; - -}; - -/** -* Updates the shader uniform values. -* -* @method syncUniforms -*/ -PIXI.PixiShader.prototype.syncUniforms = function() -{ - this.textureCount = 1; - var uniform; - var gl = this.gl; - - // This would probably be faster in an array and it would guarantee key order - for (var key in this.uniforms) - { - uniform = this.uniforms[key]; - - if (uniform.glValueLength === 1) - { - if (uniform.glMatrix === true) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.transpose, uniform.value); - } - else - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value); - } - } - else if (uniform.glValueLength === 2) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y); - } - else if (uniform.glValueLength === 3) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z); - } - else if (uniform.glValueLength === 4) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z, uniform.value.w); - } - else if (uniform.type === 'sampler2D') - { - if (uniform._init) - { - gl.activeTexture(gl['TEXTURE' + this.textureCount]); - - if(uniform.value.baseTexture._dirty[gl.id]) - { - PIXI.instances[gl.id].updateTexture(uniform.value.baseTexture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]); - } - - // gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id] || PIXI.createWebGLTexture( uniform.value.baseTexture, gl)); - gl.uniform1i(uniform.uniformLocation, this.textureCount); - this.textureCount++; - } - else - { - this.initSampler2D(uniform); - } - } - } - -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PixiShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; - -/** -* The Default Vertex shader source. -* -* @property defaultVertexSrc -* @type String -*/ -PIXI.PixiShader.defaultVertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aTextureCoord;', - 'attribute vec4 aColor;', - - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - - 'const vec2 center = vec2(-1.0, 1.0);', - - 'void main(void) {', - ' gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - ' vColor = vec4(aColor.rgb * aColor.a, aColor.a);', - '}' -]; \ No newline at end of file diff --git a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/shaders/PrimitiveShader.js b/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/shaders/PrimitiveShader.js deleted file mode 100755 index bdaab89..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/shaders/PrimitiveShader.js +++ /dev/null @@ -1,117 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class PrimitiveShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PrimitiveShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' gl_FragColor = vColor;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec4 aColor;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - 'uniform float alpha;', - 'uniform float flipY;', - 'uniform vec3 tint;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);', - ' vColor = aColor * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.PrimitiveShader.prototype.constructor = PIXI.PrimitiveShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PrimitiveShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.tintColor = gl.getUniformLocation(program, 'tint'); - this.flipY = gl.getUniformLocation(program, 'flipY'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - this.attributes = [this.aVertexPosition, this.colorAttribute]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PrimitiveShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/shaders/StripShader.js b/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/shaders/StripShader.js deleted file mode 100755 index 6b47244..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/shaders/StripShader.js +++ /dev/null @@ -1,123 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class StripShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.StripShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - // 'varying float vColor;', - 'uniform float alpha;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * alpha;', - // ' gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);',//gl_FragColor * alpha;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aTextureCoord;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - // 'uniform float alpha;', - // 'uniform vec3 tint;', - 'varying vec2 vTextureCoord;', - // 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - // ' vColor = aColor * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.StripShader.prototype.constructor = PIXI.StripShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.StripShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - //this.dimensions = gl.getUniformLocation(this.program, 'dimensions'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - - this.attributes = [this.aVertexPosition, this.aTextureCoord]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.StripShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attribute = null; -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/FilterTexture.js b/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/FilterTexture.js deleted file mode 100755 index 0340289..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/FilterTexture.js +++ /dev/null @@ -1,110 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class FilterTexture -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -* @param width {Number} the horizontal range of the filter -* @param height {Number} the vertical range of the filter -* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values -*/ -PIXI.FilterTexture = function(gl, width, height, scaleMode) -{ - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - // next time to create a frame buffer and texture - - /** - * @property frameBuffer - * @type Any - */ - this.frameBuffer = gl.createFramebuffer(); - - /** - * @property texture - * @type Any - */ - this.texture = gl.createTexture(); - - /** - * @property scaleMode - * @type Number - */ - scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - gl.bindTexture(gl.TEXTURE_2D, this.texture); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer ); - - gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer ); - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); - - // required for masking a mask?? - this.renderBuffer = gl.createRenderbuffer(); - gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer); - gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.renderBuffer); - - this.resize(width, height); -}; - -PIXI.FilterTexture.prototype.constructor = PIXI.FilterTexture; - -/** -* Clears the filter texture. -* -* @method clear -*/ -PIXI.FilterTexture.prototype.clear = function() -{ - var gl = this.gl; - - gl.clearColor(0,0,0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); -}; - -/** - * Resizes the texture to the specified width and height - * - * @method resize - * @param width {Number} the new width of the texture - * @param height {Number} the new height of the texture - */ -PIXI.FilterTexture.prototype.resize = function(width, height) -{ - if(this.width === width && this.height === height) return; - - this.width = width; - this.height = height; - - var gl = this.gl; - - gl.bindTexture(gl.TEXTURE_2D, this.texture); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width , height , 0, gl.RGBA, gl.UNSIGNED_BYTE, null); - // update the stencil buffer width and height - gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer); - gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width , height ); -}; - -/** -* Destroys the filter texture. -* -* @method destroy -*/ -PIXI.FilterTexture.prototype.destroy = function() -{ - var gl = this.gl; - gl.deleteFramebuffer( this.frameBuffer ); - gl.deleteTexture( this.texture ); - - this.frameBuffer = null; - this.texture = null; -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js b/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js deleted file mode 100755 index 3de0ec9..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLBlendModeManager -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLBlendModeManager = function() -{ - /** - * @property currentBlendMode - * @type Number - */ - this.currentBlendMode = 99999; -}; - -PIXI.WebGLBlendModeManager.prototype.constructor = PIXI.WebGLBlendModeManager; - -/** - * Sets the WebGL Context. - * - * @method setContext - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLBlendModeManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Sets-up the given blendMode from WebGL's point of view. -* -* @method setBlendMode -* @param blendMode {Number} the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD -*/ -PIXI.WebGLBlendModeManager.prototype.setBlendMode = function(blendMode) -{ - if(this.currentBlendMode === blendMode)return false; - - this.currentBlendMode = blendMode; - - var blendModeWebGL = PIXI.blendModesWebGL[this.currentBlendMode]; - this.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); - - return true; -}; - -/** -* Destroys this object. -* -* @method destroy -*/ -PIXI.WebGLBlendModeManager.prototype.destroy = function() -{ - this.gl = null; -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js b/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js deleted file mode 100755 index d870f50..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js +++ /dev/null @@ -1,428 +0,0 @@ -/** - * @author Mat Groves - * - * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ - * for creating the original pixi version! - * - * Heavily inspired by LibGDX's WebGLSpriteBatch: - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java - */ - -/** -* @class WebGLFastSpriteBatch -* @constructor -*/ -PIXI.WebGLFastSpriteBatch = function(gl) -{ - /** - * @property vertSize - * @type Number - */ - this.vertSize = 10; - - /** - * @property maxSize - * @type Number - */ - this.maxSize = 6000;//Math.pow(2, 16) / this.vertSize; - - /** - * @property size - * @type Number - */ - this.size = this.maxSize; - - //the total number of floats in our batch - var numVerts = this.size * 4 * this.vertSize; - - //the total number of indices in our batch - var numIndices = this.maxSize * 6; - - /** - * Vertex data - * @property vertices - * @type Float32Array - */ - this.vertices = new PIXI.Float32Array(numVerts); - - /** - * Index data - * @property indices - * @type Uint16Array - */ - this.indices = new PIXI.Uint16Array(numIndices); - - /** - * @property vertexBuffer - * @type Object - */ - this.vertexBuffer = null; - - /** - * @property indexBuffer - * @type Object - */ - this.indexBuffer = null; - - /** - * @property lastIndexCount - * @type Number - */ - this.lastIndexCount = 0; - - for (var i=0, j=0; i < numIndices; i += 6, j += 4) - { - this.indices[i + 0] = j + 0; - this.indices[i + 1] = j + 1; - this.indices[i + 2] = j + 2; - this.indices[i + 3] = j + 0; - this.indices[i + 4] = j + 2; - this.indices[i + 5] = j + 3; - } - - /** - * @property drawing - * @type Boolean - */ - this.drawing = false; - - /** - * @property currentBatchSize - * @type Number - */ - this.currentBatchSize = 0; - - /** - * @property currentBaseTexture - * @type BaseTexture - */ - this.currentBaseTexture = null; - - /** - * @property currentBlendMode - * @type Number - */ - this.currentBlendMode = 0; - - /** - * @property renderSession - * @type Object - */ - this.renderSession = null; - - /** - * @property shader - * @type Object - */ - this.shader = null; - - /** - * @property matrix - * @type Matrix - */ - this.matrix = null; - - this.setContext(gl); -}; - -PIXI.WebGLFastSpriteBatch.prototype.constructor = PIXI.WebGLFastSpriteBatch; - -/** - * Sets the WebGL Context. - * - * @method setContext - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLFastSpriteBatch.prototype.setContext = function(gl) -{ - this.gl = gl; - - // create a couple of buffers - this.vertexBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // 65535 is max index, so 65535 / 6 = 10922. - - //upload the index data - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); -}; - -/** - * @method begin - * @param spriteBatch {WebGLSpriteBatch} - * @param renderSession {Object} - */ -PIXI.WebGLFastSpriteBatch.prototype.begin = function(spriteBatch, renderSession) -{ - this.renderSession = renderSession; - this.shader = this.renderSession.shaderManager.fastShader; - - this.matrix = spriteBatch.worldTransform.toArray(true); - - this.start(); -}; - -/** - * @method end - */ -PIXI.WebGLFastSpriteBatch.prototype.end = function() -{ - this.flush(); -}; - -/** - * @method render - * @param spriteBatch {WebGLSpriteBatch} - */ -PIXI.WebGLFastSpriteBatch.prototype.render = function(spriteBatch) -{ - var children = spriteBatch.children; - var sprite = children[0]; - - // if the uvs have not updated then no point rendering just yet! - - // check texture. - if(!sprite.texture._uvs)return; - - this.currentBaseTexture = sprite.texture.baseTexture; - - // check blend mode - if(sprite.blendMode !== this.renderSession.blendModeManager.currentBlendMode) - { - this.flush(); - this.renderSession.blendModeManager.setBlendMode(sprite.blendMode); - } - - for(var i=0,j= children.length; i= this.size) - { - this.flush(); - } -}; - -/** - * @method flush - */ -PIXI.WebGLFastSpriteBatch.prototype.flush = function() -{ - // If the batch is length 0 then return as there is nothing to draw - if (this.currentBatchSize===0)return; - - var gl = this.gl; - - // bind the current texture - - if(!this.currentBaseTexture._glTextures[gl.id])this.renderSession.renderer.updateTexture(this.currentBaseTexture, gl); - - gl.bindTexture(gl.TEXTURE_2D, this.currentBaseTexture._glTextures[gl.id]); - - // upload the verts to the buffer - - if(this.currentBatchSize > ( this.size * 0.5 ) ) - { - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - } - else - { - var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize); - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); - } - - // now draw those suckas! - gl.drawElements(gl.TRIANGLES, this.currentBatchSize * 6, gl.UNSIGNED_SHORT, 0); - - // then reset the batch! - this.currentBatchSize = 0; - - // increment the draw count - this.renderSession.drawCount++; -}; - - -/** - * @method stop - */ -PIXI.WebGLFastSpriteBatch.prototype.stop = function() -{ - this.flush(); -}; - -/** - * @method start - */ -PIXI.WebGLFastSpriteBatch.prototype.start = function() -{ - var gl = this.gl; - - // bind the main texture - gl.activeTexture(gl.TEXTURE0); - - // bind the buffers - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - // set the projection - var projection = this.renderSession.projection; - gl.uniform2f(this.shader.projectionVector, projection.x, projection.y); - - // set the matrix - gl.uniformMatrix3fv(this.shader.uMatrix, false, this.matrix); - - // set the pointers - var stride = this.vertSize * 4; - - gl.vertexAttribPointer(this.shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0); - gl.vertexAttribPointer(this.shader.aPositionCoord, 2, gl.FLOAT, false, stride, 2 * 4); - gl.vertexAttribPointer(this.shader.aScale, 2, gl.FLOAT, false, stride, 4 * 4); - gl.vertexAttribPointer(this.shader.aRotation, 1, gl.FLOAT, false, stride, 6 * 4); - gl.vertexAttribPointer(this.shader.aTextureCoord, 2, gl.FLOAT, false, stride, 7 * 4); - gl.vertexAttribPointer(this.shader.colorAttribute, 1, gl.FLOAT, false, stride, 9 * 4); - -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFilterManager.js b/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFilterManager.js deleted file mode 100755 index e726891..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFilterManager.js +++ /dev/null @@ -1,450 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLFilterManager -* @constructor -*/ -PIXI.WebGLFilterManager = function() -{ - /** - * @property filterStack - * @type Array - */ - this.filterStack = []; - - /** - * @property offsetX - * @type Number - */ - this.offsetX = 0; - - /** - * @property offsetY - * @type Number - */ - this.offsetY = 0; -}; - -PIXI.WebGLFilterManager.prototype.constructor = PIXI.WebGLFilterManager; - -/** -* Initialises the context and the properties. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLFilterManager.prototype.setContext = function(gl) -{ - this.gl = gl; - this.texturePool = []; - - this.initShaderBuffers(); -}; - -/** -* @method begin -* @param renderSession {RenderSession} -* @param buffer {ArrayBuffer} -*/ -PIXI.WebGLFilterManager.prototype.begin = function(renderSession, buffer) -{ - this.renderSession = renderSession; - this.defaultShader = renderSession.shaderManager.defaultShader; - - var projection = this.renderSession.projection; - this.width = projection.x * 2; - this.height = -projection.y * 2; - this.buffer = buffer; -}; - -/** -* Applies the filter and adds it to the current filter stack. -* -* @method pushFilter -* @param filterBlock {Object} the filter that will be pushed to the current filter stack -*/ -PIXI.WebGLFilterManager.prototype.pushFilter = function(filterBlock) -{ - var gl = this.gl; - - var projection = this.renderSession.projection; - var offset = this.renderSession.offset; - - filterBlock._filterArea = filterBlock.target.filterArea || filterBlock.target.getBounds(); - - // filter program - // OPTIMISATION - the first filter is free if its a simple color change? - this.filterStack.push(filterBlock); - - var filter = filterBlock.filterPasses[0]; - - this.offsetX += filterBlock._filterArea.x; - this.offsetY += filterBlock._filterArea.y; - - var texture = this.texturePool.pop(); - if(!texture) - { - texture = new PIXI.FilterTexture(this.gl, this.width, this.height); - } - else - { - texture.resize(this.width, this.height); - } - - gl.bindTexture(gl.TEXTURE_2D, texture.texture); - - var filterArea = filterBlock._filterArea;// filterBlock.target.getBounds();///filterBlock.target.filterArea; - - var padding = filter.padding; - filterArea.x -= padding; - filterArea.y -= padding; - filterArea.width += padding * 2; - filterArea.height += padding * 2; - - // cap filter to screen size.. - if(filterArea.x < 0)filterArea.x = 0; - if(filterArea.width > this.width)filterArea.width = this.width; - if(filterArea.y < 0)filterArea.y = 0; - if(filterArea.height > this.height)filterArea.height = this.height; - - //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, filterArea.width, filterArea.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); - gl.bindFramebuffer(gl.FRAMEBUFFER, texture.frameBuffer); - - // set view port - gl.viewport(0, 0, filterArea.width, filterArea.height); - - projection.x = filterArea.width/2; - projection.y = -filterArea.height/2; - - offset.x = -filterArea.x; - offset.y = -filterArea.y; - - // update projection - // now restore the regular shader.. - // this.renderSession.shaderManager.setShader(this.defaultShader); - //gl.uniform2f(this.defaultShader.projectionVector, filterArea.width/2, -filterArea.height/2); - //gl.uniform2f(this.defaultShader.offsetVector, -filterArea.x, -filterArea.y); - - gl.colorMask(true, true, true, true); - gl.clearColor(0,0,0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); - - filterBlock._glFilterTexture = texture; - -}; - -/** -* Removes the last filter from the filter stack and doesn't return it. -* -* @method popFilter -*/ -PIXI.WebGLFilterManager.prototype.popFilter = function() -{ - var gl = this.gl; - var filterBlock = this.filterStack.pop(); - var filterArea = filterBlock._filterArea; - var texture = filterBlock._glFilterTexture; - var projection = this.renderSession.projection; - var offset = this.renderSession.offset; - - if(filterBlock.filterPasses.length > 1) - { - gl.viewport(0, 0, filterArea.width, filterArea.height); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - - this.vertexArray[0] = 0; - this.vertexArray[1] = filterArea.height; - - this.vertexArray[2] = filterArea.width; - this.vertexArray[3] = filterArea.height; - - this.vertexArray[4] = 0; - this.vertexArray[5] = 0; - - this.vertexArray[6] = filterArea.width; - this.vertexArray[7] = 0; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - // now set the uvs.. - this.uvArray[2] = filterArea.width/this.width; - this.uvArray[5] = filterArea.height/this.height; - this.uvArray[6] = filterArea.width/this.width; - this.uvArray[7] = filterArea.height/this.height; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray); - - var inputTexture = texture; - var outputTexture = this.texturePool.pop(); - if(!outputTexture)outputTexture = new PIXI.FilterTexture(this.gl, this.width, this.height); - outputTexture.resize(this.width, this.height); - - // need to clear this FBO as it may have some left over elements from a previous filter. - gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer ); - gl.clear(gl.COLOR_BUFFER_BIT); - - gl.disable(gl.BLEND); - - for (var i = 0; i < filterBlock.filterPasses.length-1; i++) - { - var filterPass = filterBlock.filterPasses[i]; - - gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer ); - - // set texture - gl.activeTexture(gl.TEXTURE0); - gl.bindTexture(gl.TEXTURE_2D, inputTexture.texture); - - // draw texture.. - //filterPass.applyFilterPass(filterArea.width, filterArea.height); - this.applyFilterPass(filterPass, filterArea, filterArea.width, filterArea.height); - - // swap the textures.. - var temp = inputTexture; - inputTexture = outputTexture; - outputTexture = temp; - } - - gl.enable(gl.BLEND); - - texture = inputTexture; - this.texturePool.push(outputTexture); - } - - var filter = filterBlock.filterPasses[filterBlock.filterPasses.length-1]; - - this.offsetX -= filterArea.x; - this.offsetY -= filterArea.y; - - var sizeX = this.width; - var sizeY = this.height; - - var offsetX = 0; - var offsetY = 0; - - var buffer = this.buffer; - - // time to render the filters texture to the previous scene - if(this.filterStack.length === 0) - { - gl.colorMask(true, true, true, true);//this.transparent); - } - else - { - var currentFilter = this.filterStack[this.filterStack.length-1]; - filterArea = currentFilter._filterArea; - - sizeX = filterArea.width; - sizeY = filterArea.height; - - offsetX = filterArea.x; - offsetY = filterArea.y; - - buffer = currentFilter._glFilterTexture.frameBuffer; - } - - // TODO need to remove these global elements.. - projection.x = sizeX/2; - projection.y = -sizeY/2; - - offset.x = offsetX; - offset.y = offsetY; - - filterArea = filterBlock._filterArea; - - var x = filterArea.x-offsetX; - var y = filterArea.y-offsetY; - - // update the buffers.. - // make sure to flip the y! - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - - this.vertexArray[0] = x; - this.vertexArray[1] = y + filterArea.height; - - this.vertexArray[2] = x + filterArea.width; - this.vertexArray[3] = y + filterArea.height; - - this.vertexArray[4] = x; - this.vertexArray[5] = y; - - this.vertexArray[6] = x + filterArea.width; - this.vertexArray[7] = y; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - - this.uvArray[2] = filterArea.width/this.width; - this.uvArray[5] = filterArea.height/this.height; - this.uvArray[6] = filterArea.width/this.width; - this.uvArray[7] = filterArea.height/this.height; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray); - - gl.viewport(0, 0, sizeX * this.renderSession.resolution, sizeY * this.renderSession.resolution); - - // bind the buffer - gl.bindFramebuffer(gl.FRAMEBUFFER, buffer ); - - // set the blend mode! - //gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA) - - // set texture - gl.activeTexture(gl.TEXTURE0); - gl.bindTexture(gl.TEXTURE_2D, texture.texture); - - // apply! - this.applyFilterPass(filter, filterArea, sizeX, sizeY); - - // now restore the regular shader.. should happen automatically now.. - // this.renderSession.shaderManager.setShader(this.defaultShader); - // gl.uniform2f(this.defaultShader.projectionVector, sizeX/2, -sizeY/2); - // gl.uniform2f(this.defaultShader.offsetVector, -offsetX, -offsetY); - - // return the texture to the pool - this.texturePool.push(texture); - filterBlock._glFilterTexture = null; -}; - - -/** -* Applies the filter to the specified area. -* -* @method applyFilterPass -* @param filter {AbstractFilter} the filter that needs to be applied -* @param filterArea {Texture} TODO - might need an update -* @param width {Number} the horizontal range of the filter -* @param height {Number} the vertical range of the filter -*/ -PIXI.WebGLFilterManager.prototype.applyFilterPass = function(filter, filterArea, width, height) -{ - // use program - var gl = this.gl; - var shader = filter.shaders[gl.id]; - - if(!shader) - { - shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc = filter.fragmentSrc; - shader.uniforms = filter.uniforms; - shader.init(); - - filter.shaders[gl.id] = shader; - } - - // set the shader - this.renderSession.shaderManager.setShader(shader); - -// gl.useProgram(shader.program); - - gl.uniform2f(shader.projectionVector, width/2, -height/2); - gl.uniform2f(shader.offsetVector, 0,0); - - if(filter.uniforms.dimensions) - { - filter.uniforms.dimensions.value[0] = this.width;//width; - filter.uniforms.dimensions.value[1] = this.height;//height; - filter.uniforms.dimensions.value[2] = this.vertexArray[0]; - filter.uniforms.dimensions.value[3] = this.vertexArray[5];//filterArea.height; - } - - shader.syncUniforms(); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer); - gl.vertexAttribPointer(shader.colorAttribute, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - // draw the filter... - gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 ); - - this.renderSession.drawCount++; -}; - -/** -* Initialises the shader buffers. -* -* @method initShaderBuffers -*/ -PIXI.WebGLFilterManager.prototype.initShaderBuffers = function() -{ - var gl = this.gl; - - // create some buffers - this.vertexBuffer = gl.createBuffer(); - this.uvBuffer = gl.createBuffer(); - this.colorBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // bind and upload the vertexs.. - // keep a reference to the vertexFloatData.. - this.vertexArray = new PIXI.Float32Array([0.0, 0.0, - 1.0, 0.0, - 0.0, 1.0, - 1.0, 1.0]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertexArray, gl.STATIC_DRAW); - - // bind and upload the uv buffer - this.uvArray = new PIXI.Float32Array([0.0, 0.0, - 1.0, 0.0, - 0.0, 1.0, - 1.0, 1.0]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvArray, gl.STATIC_DRAW); - - this.colorArray = new PIXI.Float32Array([1.0, 0xFFFFFF, - 1.0, 0xFFFFFF, - 1.0, 0xFFFFFF, - 1.0, 0xFFFFFF]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.colorArray, gl.STATIC_DRAW); - - // bind and upload the index - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 1, 3, 2]), gl.STATIC_DRAW); - -}; - -/** -* Destroys the filter and removes it from the filter stack. -* -* @method destroy -*/ -PIXI.WebGLFilterManager.prototype.destroy = function() -{ - var gl = this.gl; - - this.filterStack = null; - - this.offsetX = 0; - this.offsetY = 0; - - // destroy textures - for (var i = 0; i < this.texturePool.length; i++) { - this.texturePool[i].destroy(); - } - - this.texturePool = null; - - //destroy buffers.. - gl.deleteBuffer(this.vertexBuffer); - gl.deleteBuffer(this.uvBuffer); - gl.deleteBuffer(this.colorBuffer); - gl.deleteBuffer(this.indexBuffer); -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLGraphics.js b/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLGraphics.js deleted file mode 100755 index 710383c..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLGraphics.js +++ /dev/null @@ -1,896 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A set of functions used by the webGL renderer to draw the primitive graphics data - * - * @class WebGLGraphics - * @private - * @static - */ -PIXI.WebGLGraphics = function() -{ -}; - -/** - * Renders the graphics object - * - * @static - * @private - * @method renderGraphics - * @param graphics {Graphics} - * @param renderSession {Object} - */ -PIXI.WebGLGraphics.renderGraphics = function(graphics, renderSession)//projection, offset) -{ - var gl = renderSession.gl; - var projection = renderSession.projection, - offset = renderSession.offset, - shader = renderSession.shaderManager.primitiveShader, - webGLData; - - if(graphics.dirty) - { - PIXI.WebGLGraphics.updateGraphics(graphics, gl); - } - - var webGL = graphics._webGL[gl.id]; - - // This could be speeded up for sure! - - for (var i = 0; i < webGL.data.length; i++) - { - if(webGL.data[i].mode === 1) - { - webGLData = webGL.data[i]; - - renderSession.stencilManager.pushStencil(graphics, webGLData, renderSession); - - // render quad.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - renderSession.stencilManager.popStencil(graphics, webGLData, renderSession); - } - else - { - webGLData = webGL.data[i]; - - - renderSession.shaderManager.setShader( shader );//activatePrimitiveShader(); - shader = renderSession.shaderManager.primitiveShader; - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform1f(shader.flipY, 1); - - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - - gl.uniform1f(shader.alpha, graphics.worldAlpha); - - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0); - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4); - - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - } - } -}; - -/** - * Updates the graphics object - * - * @static - * @private - * @method updateGraphics - * @param graphicsData {Graphics} The graphics object to update - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLGraphics.updateGraphics = function(graphics, gl) -{ - // get the contexts graphics object - var webGL = graphics._webGL[gl.id]; - // if the graphics object does not exist in the webGL context time to create it! - if(!webGL)webGL = graphics._webGL[gl.id] = {lastIndex:0, data:[], gl:gl}; - - // flag the graphics as not dirty as we are about to update it... - graphics.dirty = false; - - var i; - - // if the user cleared the graphics object we will need to clear every object - if(graphics.clearDirty) - { - graphics.clearDirty = false; - - // lop through and return all the webGLDatas to the object pool so than can be reused later on - for (i = 0; i < webGL.data.length; i++) - { - var graphicsData = webGL.data[i]; - graphicsData.reset(); - PIXI.WebGLGraphics.graphicsDataPool.push( graphicsData ); - } - - // clear the array and reset the index.. - webGL.data = []; - webGL.lastIndex = 0; - } - - var webGLData; - - // loop through the graphics datas and construct each one.. - // if the object is a complex fill then the new stencil buffer technique will be used - // other wise graphics objects will be pushed into a batch.. - for (i = webGL.lastIndex; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - - if(data.type === PIXI.Graphics.POLY) - { - // need to add the points the the graphics object.. - data.points = data.shape.points.slice(); - if(data.shape.closed) - { - // close the poly if the value is true! - if(data.points[0] !== data.points[data.points.length-2] || data.points[1] !== data.points[data.points.length-1]) - { - data.points.push(data.points[0], data.points[1]); - } - } - - // MAKE SURE WE HAVE THE CORRECT TYPE.. - if(data.fill) - { - if(data.points.length >= 6) - { - if(data.points.length < 6 * 2) - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - - var canDrawUsingSimple = PIXI.WebGLGraphics.buildPoly(data, webGLData); - // console.log(canDrawUsingSimple); - - if(!canDrawUsingSimple) - { - // console.log("<>>>") - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1); - PIXI.WebGLGraphics.buildComplexPoly(data, webGLData); - } - - } - else - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1); - PIXI.WebGLGraphics.buildComplexPoly(data, webGLData); - } - } - } - - if(data.lineWidth > 0) - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - PIXI.WebGLGraphics.buildLine(data, webGLData); - - } - } - else - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - - if(data.type === PIXI.Graphics.RECT) - { - PIXI.WebGLGraphics.buildRectangle(data, webGLData); - } - else if(data.type === PIXI.Graphics.CIRC || data.type === PIXI.Graphics.ELIP) - { - PIXI.WebGLGraphics.buildCircle(data, webGLData); - } - else if(data.type === PIXI.Graphics.RREC) - { - PIXI.WebGLGraphics.buildRoundedRectangle(data, webGLData); - } - } - - webGL.lastIndex++; - } - - // upload all the dirty data... - for (i = 0; i < webGL.data.length; i++) - { - webGLData = webGL.data[i]; - if(webGLData.dirty)webGLData.upload(); - } -}; - -/** - * @static - * @private - * @method switchMode - * @param webGL {WebGLContext} - * @param type {Number} - */ -PIXI.WebGLGraphics.switchMode = function(webGL, type) -{ - var webGLData; - - if(!webGL.data.length) - { - webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl); - webGLData.mode = type; - webGL.data.push(webGLData); - } - else - { - webGLData = webGL.data[webGL.data.length-1]; - - if(webGLData.mode !== type || type === 1) - { - webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl); - webGLData.mode = type; - webGL.data.push(webGLData); - } - } - - webGLData.dirty = true; - - return webGLData; -}; - -/** - * Builds a rectangle to draw - * - * @static - * @private - * @method buildRectangle - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildRectangle = function(graphicsData, webGLData) -{ - // --- // - // need to convert points to a nice regular data - // - var rectData = graphicsData.shape; - var x = rectData.x; - var y = rectData.y; - var width = rectData.width; - var height = rectData.height; - - if(graphicsData.fill) - { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vertPos = verts.length/6; - - // start - verts.push(x, y); - verts.push(r, g, b, alpha); - - verts.push(x + width, y); - verts.push(r, g, b, alpha); - - verts.push(x , y + height); - verts.push(r, g, b, alpha); - - verts.push(x + width, y + height); - verts.push(r, g, b, alpha); - - // insert 2 dead triangles.. - indices.push(vertPos, vertPos, vertPos+1, vertPos+2, vertPos+3, vertPos+3); - } - - if(graphicsData.lineWidth) - { - var tempPoints = graphicsData.points; - - graphicsData.points = [x, y, - x + width, y, - x + width, y + height, - x, y + height, - x, y]; - - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Builds a rounded rectangle to draw - * - * @static - * @private - * @method buildRoundedRectangle - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildRoundedRectangle = function(graphicsData, webGLData) -{ - var rrectData = graphicsData.shape; - var x = rrectData.x; - var y = rrectData.y; - var width = rrectData.width; - var height = rrectData.height; - - var radius = rrectData.radius; - - var recPoints = []; - recPoints.push(x, y + radius); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x, y + height - radius, x, y + height, x + radius, y + height)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width, y + radius, x + width, y, x + width - radius, y)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + radius, y, x, y, x, y + radius)); - - if (graphicsData.fill) { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vecPos = verts.length/6; - - var triangles = PIXI.PolyK.Triangulate(recPoints); - - // - - var i = 0; - for (i = 0; i < triangles.length; i+=3) - { - indices.push(triangles[i] + vecPos); - indices.push(triangles[i] + vecPos); - indices.push(triangles[i+1] + vecPos); - indices.push(triangles[i+2] + vecPos); - indices.push(triangles[i+2] + vecPos); - } - - - for (i = 0; i < recPoints.length; i++) - { - verts.push(recPoints[i], recPoints[++i], r, g, b, alpha); - } - } - - if (graphicsData.lineWidth) { - var tempPoints = graphicsData.points; - - graphicsData.points = recPoints; - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Calculate the points for a quadratic bezier curve. (helper function..) - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c - * - * @static - * @private - * @method quadraticBezierCurve - * @param fromX {Number} Origin point x - * @param fromY {Number} Origin point x - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Array(Number)} - */ -PIXI.WebGLGraphics.quadraticBezierCurve = function(fromX, fromY, cpX, cpY, toX, toY) { - - var xa, - ya, - xb, - yb, - x, - y, - n = 20, - points = []; - - function getPt(n1 , n2, perc) { - var diff = n2 - n1; - - return n1 + ( diff * perc ); - } - - var j = 0; - for (var i = 0; i <= n; i++ ) - { - j = i / n; - - // The Green Line - xa = getPt( fromX , cpX , j ); - ya = getPt( fromY , cpY , j ); - xb = getPt( cpX , toX , j ); - yb = getPt( cpY , toY , j ); - - // The Black Dot - x = getPt( xa , xb , j ); - y = getPt( ya , yb , j ); - - points.push(x, y); - } - return points; -}; - -/** - * Builds a circle to draw - * - * @static - * @private - * @method buildCircle - * @param graphicsData {Graphics} The graphics object to draw - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildCircle = function(graphicsData, webGLData) -{ - // need to convert points to a nice regular data - var circleData = graphicsData.shape; - var x = circleData.x; - var y = circleData.y; - var width; - var height; - - // TODO - bit hacky?? - if(graphicsData.type === PIXI.Graphics.CIRC) - { - width = circleData.radius; - height = circleData.radius; - } - else - { - width = circleData.width; - height = circleData.height; - } - - var totalSegs = 40; - var seg = (Math.PI * 2) / totalSegs ; - - var i = 0; - - if(graphicsData.fill) - { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vecPos = verts.length/6; - - indices.push(vecPos); - - for (i = 0; i < totalSegs + 1 ; i++) - { - verts.push(x,y, r, g, b, alpha); - - verts.push(x + Math.sin(seg * i) * width, - y + Math.cos(seg * i) * height, - r, g, b, alpha); - - indices.push(vecPos++, vecPos++); - } - - indices.push(vecPos-1); - } - - if(graphicsData.lineWidth) - { - var tempPoints = graphicsData.points; - - graphicsData.points = []; - - for (i = 0; i < totalSegs + 1; i++) - { - graphicsData.points.push(x + Math.sin(seg * i) * width, - y + Math.cos(seg * i) * height); - } - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Builds a line to draw - * - * @static - * @private - * @method buildLine - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildLine = function(graphicsData, webGLData) -{ - // TODO OPTIMISE! - var i = 0; - var points = graphicsData.points; - if(points.length === 0)return; - - // if the line width is an odd number add 0.5 to align to a whole pixel - if(graphicsData.lineWidth%2) - { - for (i = 0; i < points.length; i++) { - points[i] += 0.5; - } - } - - // get first and last point.. figure out the middle! - var firstPoint = new PIXI.Point( points[0], points[1] ); - var lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); - - // if the first point is the last point - gonna have issues :) - if(firstPoint.x === lastPoint.x && firstPoint.y === lastPoint.y) - { - // need to clone as we are going to slightly modify the shape.. - points = points.slice(); - - points.pop(); - points.pop(); - - lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); - - var midPointX = lastPoint.x + (firstPoint.x - lastPoint.x) *0.5; - var midPointY = lastPoint.y + (firstPoint.y - lastPoint.y) *0.5; - - points.unshift(midPointX, midPointY); - points.push(midPointX, midPointY); - } - - var verts = webGLData.points; - var indices = webGLData.indices; - var length = points.length / 2; - var indexCount = points.length; - var indexStart = verts.length/6; - - // DRAW the Line - var width = graphicsData.lineWidth / 2; - - // sort color - var color = PIXI.hex2rgb(graphicsData.lineColor); - var alpha = graphicsData.lineAlpha; - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var px, py, p1x, p1y, p2x, p2y, p3x, p3y; - var perpx, perpy, perp2x, perp2y, perp3x, perp3y; - var a1, b1, c1, a2, b2, c2; - var denom, pdist, dist; - - p1x = points[0]; - p1y = points[1]; - - p2x = points[2]; - p2y = points[3]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - // start - verts.push(p1x - perpx , p1y - perpy, - r, g, b, alpha); - - verts.push(p1x + perpx , p1y + perpy, - r, g, b, alpha); - - for (i = 1; i < length-1; i++) - { - p1x = points[(i-1)*2]; - p1y = points[(i-1)*2 + 1]; - - p2x = points[(i)*2]; - p2y = points[(i)*2 + 1]; - - p3x = points[(i+1)*2]; - p3y = points[(i+1)*2 + 1]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - perp2x = -(p2y - p3y); - perp2y = p2x - p3x; - - dist = Math.sqrt(perp2x*perp2x + perp2y*perp2y); - perp2x /= dist; - perp2y /= dist; - perp2x *= width; - perp2y *= width; - - a1 = (-perpy + p1y) - (-perpy + p2y); - b1 = (-perpx + p2x) - (-perpx + p1x); - c1 = (-perpx + p1x) * (-perpy + p2y) - (-perpx + p2x) * (-perpy + p1y); - a2 = (-perp2y + p3y) - (-perp2y + p2y); - b2 = (-perp2x + p2x) - (-perp2x + p3x); - c2 = (-perp2x + p3x) * (-perp2y + p2y) - (-perp2x + p2x) * (-perp2y + p3y); - - denom = a1*b2 - a2*b1; - - if(Math.abs(denom) < 0.1 ) - { - - denom+=10.1; - verts.push(p2x - perpx , p2y - perpy, - r, g, b, alpha); - - verts.push(p2x + perpx , p2y + perpy, - r, g, b, alpha); - - continue; - } - - px = (b1*c2 - b2*c1)/denom; - py = (a2*c1 - a1*c2)/denom; - - - pdist = (px -p2x) * (px -p2x) + (py -p2y) + (py -p2y); - - - if(pdist > 140 * 140) - { - perp3x = perpx - perp2x; - perp3y = perpy - perp2y; - - dist = Math.sqrt(perp3x*perp3x + perp3y*perp3y); - perp3x /= dist; - perp3y /= dist; - perp3x *= width; - perp3y *= width; - - verts.push(p2x - perp3x, p2y -perp3y); - verts.push(r, g, b, alpha); - - verts.push(p2x + perp3x, p2y +perp3y); - verts.push(r, g, b, alpha); - - verts.push(p2x - perp3x, p2y -perp3y); - verts.push(r, g, b, alpha); - - indexCount++; - } - else - { - - verts.push(px , py); - verts.push(r, g, b, alpha); - - verts.push(p2x - (px-p2x), p2y - (py - p2y)); - verts.push(r, g, b, alpha); - } - } - - p1x = points[(length-2)*2]; - p1y = points[(length-2)*2 + 1]; - - p2x = points[(length-1)*2]; - p2y = points[(length-1)*2 + 1]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - verts.push(p2x - perpx , p2y - perpy); - verts.push(r, g, b, alpha); - - verts.push(p2x + perpx , p2y + perpy); - verts.push(r, g, b, alpha); - - indices.push(indexStart); - - for (i = 0; i < indexCount; i++) - { - indices.push(indexStart++); - } - - indices.push(indexStart-1); -}; - -/** - * Builds a complex polygon to draw - * - * @static - * @private - * @method buildComplexPoly - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildComplexPoly = function(graphicsData, webGLData) -{ - //TODO - no need to copy this as it gets turned into a FLoat32Array anyways.. - var points = graphicsData.points.slice(); - if(points.length < 6)return; - - // get first and last point.. figure out the middle! - var indices = webGLData.indices; - webGLData.points = points; - webGLData.alpha = graphicsData.fillAlpha; - webGLData.color = PIXI.hex2rgb(graphicsData.fillColor); - - /* - calclate the bounds.. - */ - var minX = Infinity; - var maxX = -Infinity; - - var minY = Infinity; - var maxY = -Infinity; - - var x,y; - - // get size.. - for (var i = 0; i < points.length; i+=2) - { - x = points[i]; - y = points[i+1]; - - minX = x < minX ? x : minX; - maxX = x > maxX ? x : maxX; - - minY = y < minY ? y : minY; - maxY = y > maxY ? y : maxY; - } - - // add a quad to the end cos there is no point making another buffer! - points.push(minX, minY, - maxX, minY, - maxX, maxY, - minX, maxY); - - // push a quad onto the end.. - - //TODO - this aint needed! - var length = points.length / 2; - for (i = 0; i < length; i++) - { - indices.push( i ); - } - -}; - -/** - * Builds a polygon to draw - * - * @static - * @private - * @method buildPoly - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildPoly = function(graphicsData, webGLData) -{ - var points = graphicsData.points; - - if(points.length < 6)return; - // get first and last point.. figure out the middle! - var verts = webGLData.points; - var indices = webGLData.indices; - - var length = points.length / 2; - - // sort color - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var triangles = PIXI.PolyK.Triangulate(points); - - if(!triangles)return false; - - var vertPos = verts.length / 6; - - var i = 0; - - for (i = 0; i < triangles.length; i+=3) - { - indices.push(triangles[i] + vertPos); - indices.push(triangles[i] + vertPos); - indices.push(triangles[i+1] + vertPos); - indices.push(triangles[i+2] +vertPos); - indices.push(triangles[i+2] + vertPos); - } - - for (i = 0; i < length; i++) - { - verts.push(points[i * 2], points[i * 2 + 1], - r, g, b, alpha); - } - - return true; -}; - -PIXI.WebGLGraphics.graphicsDataPool = []; - -/** - * @class WebGLGraphicsData - * @private - * @static - */ -PIXI.WebGLGraphicsData = function(gl) -{ - this.gl = gl; - - //TODO does this need to be split before uploding?? - this.color = [0,0,0]; // color split! - this.points = []; - this.indices = []; - this.buffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - this.mode = 1; - this.alpha = 1; - this.dirty = true; -}; - -/** - * @method reset - */ -PIXI.WebGLGraphicsData.prototype.reset = function() -{ - this.points = []; - this.indices = []; -}; - -/** - * @method upload - */ -PIXI.WebGLGraphicsData.prototype.upload = function() -{ - var gl = this.gl; - -// this.lastIndex = graphics.graphicsData.length; - this.glPoints = new PIXI.Float32Array(this.points); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer); - gl.bufferData(gl.ARRAY_BUFFER, this.glPoints, gl.STATIC_DRAW); - - this.glIndicies = new PIXI.Uint16Array(this.indices); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.glIndicies, gl.STATIC_DRAW); - - this.dirty = false; -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLMaskManager.js b/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLMaskManager.js deleted file mode 100755 index 607d5dd..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLMaskManager.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLMaskManager -* @constructor -* @private -*/ -PIXI.WebGLMaskManager = function() -{ -}; - -PIXI.WebGLMaskManager.prototype.constructor = PIXI.WebGLMaskManager; - -/** -* Sets the drawing context to the one given in parameter. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLMaskManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Applies the Mask and adds it to the current filter stack. -* -* @method pushMask -* @param maskData {Array} -* @param renderSession {Object} -*/ -PIXI.WebGLMaskManager.prototype.pushMask = function(maskData, renderSession) -{ - var gl = renderSession.gl; - - if(maskData.dirty) - { - PIXI.WebGLGraphics.updateGraphics(maskData, gl); - } - - if(!maskData._webGL[gl.id].data.length)return; - - renderSession.stencilManager.pushStencil(maskData, maskData._webGL[gl.id].data[0], renderSession); -}; - -/** -* Removes the last filter from the filter stack and doesn't return it. -* -* @method popMask -* @param maskData {Array} -* @param renderSession {Object} an object containing all the useful parameters -*/ -PIXI.WebGLMaskManager.prototype.popMask = function(maskData, renderSession) -{ - var gl = this.gl; - renderSession.stencilManager.popStencil(maskData, maskData._webGL[gl.id].data[0], renderSession); -}; - -/** -* Destroys the mask stack. -* -* @method destroy -*/ -PIXI.WebGLMaskManager.prototype.destroy = function() -{ - this.gl = null; -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderManager.js b/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderManager.js deleted file mode 100755 index a15974e..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderManager.js +++ /dev/null @@ -1,157 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLShaderManager -* @constructor -* @private -*/ -PIXI.WebGLShaderManager = function() -{ - /** - * @property maxAttibs - * @type Number - */ - this.maxAttibs = 10; - - /** - * @property attribState - * @type Array - */ - this.attribState = []; - - /** - * @property tempAttribState - * @type Array - */ - this.tempAttribState = []; - - for (var i = 0; i < this.maxAttibs; i++) - { - this.attribState[i] = false; - } - - /** - * @property stack - * @type Array - */ - this.stack = []; - -}; - -PIXI.WebGLShaderManager.prototype.constructor = PIXI.WebGLShaderManager; - -/** -* Initialises the context and the properties. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLShaderManager.prototype.setContext = function(gl) -{ - this.gl = gl; - - // the next one is used for rendering primitives - this.primitiveShader = new PIXI.PrimitiveShader(gl); - - // the next one is used for rendering triangle strips - this.complexPrimitiveShader = new PIXI.ComplexPrimitiveShader(gl); - - // this shader is used for the default sprite rendering - this.defaultShader = new PIXI.PixiShader(gl); - - // this shader is used for the fast sprite rendering - this.fastShader = new PIXI.PixiFastShader(gl); - - // the next one is used for rendering triangle strips - this.stripShader = new PIXI.StripShader(gl); - this.setShader(this.defaultShader); -}; - -/** -* Takes the attributes given in parameters. -* -* @method setAttribs -* @param attribs {Array} attribs -*/ -PIXI.WebGLShaderManager.prototype.setAttribs = function(attribs) -{ - // reset temp state - var i; - - for (i = 0; i < this.tempAttribState.length; i++) - { - this.tempAttribState[i] = false; - } - - // set the new attribs - for (i = 0; i < attribs.length; i++) - { - var attribId = attribs[i]; - this.tempAttribState[attribId] = true; - } - - var gl = this.gl; - - for (i = 0; i < this.attribState.length; i++) - { - if(this.attribState[i] !== this.tempAttribState[i]) - { - this.attribState[i] = this.tempAttribState[i]; - - if(this.tempAttribState[i]) - { - gl.enableVertexAttribArray(i); - } - else - { - gl.disableVertexAttribArray(i); - } - } - } -}; - -/** -* Sets the current shader. -* -* @method setShader -* @param shader {Any} -*/ -PIXI.WebGLShaderManager.prototype.setShader = function(shader) -{ - if(this._currentId === shader._UID)return false; - - this._currentId = shader._UID; - - this.currentShader = shader; - - this.gl.useProgram(shader.program); - this.setAttribs(shader.attributes); - - return true; -}; - -/** -* Destroys this object. -* -* @method destroy -*/ -PIXI.WebGLShaderManager.prototype.destroy = function() -{ - this.attribState = null; - - this.tempAttribState = null; - - this.primitiveShader.destroy(); - - this.complexPrimitiveShader.destroy(); - - this.defaultShader.destroy(); - - this.fastShader.destroy(); - - this.stripShader.destroy(); - - this.gl = null; -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderUtils.js b/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderUtils.js deleted file mode 100755 index a7d7826..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderUtils.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @method initDefaultShaders -* @static -* @private -*/ -PIXI.initDefaultShaders = function() -{ -}; - -/** -* @method CompileVertexShader -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @return {Any} -*/ -PIXI.CompileVertexShader = function(gl, shaderSrc) -{ - return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER); -}; - -/** -* @method CompileFragmentShader -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @return {Any} -*/ -PIXI.CompileFragmentShader = function(gl, shaderSrc) -{ - return PIXI._CompileShader(gl, shaderSrc, gl.FRAGMENT_SHADER); -}; - -/** -* @method _CompileShader -* @static -* @private -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @param shaderType {Number} -* @return {Any} -*/ -PIXI._CompileShader = function(gl, shaderSrc, shaderType) -{ - var src = shaderSrc.join("\n"); - var shader = gl.createShader(shaderType); - gl.shaderSource(shader, src); - gl.compileShader(shader); - - if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) - { - window.console.log(gl.getShaderInfoLog(shader)); - return null; - } - - return shader; -}; - -/** -* @method compileProgram -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param vertexSrc {Array} -* @param fragmentSrc {Array} -* @return {Any} -*/ -PIXI.compileProgram = function(gl, vertexSrc, fragmentSrc) -{ - var fragmentShader = PIXI.CompileFragmentShader(gl, fragmentSrc); - var vertexShader = PIXI.CompileVertexShader(gl, vertexSrc); - - var shaderProgram = gl.createProgram(); - - gl.attachShader(shaderProgram, vertexShader); - gl.attachShader(shaderProgram, fragmentShader); - gl.linkProgram(shaderProgram); - - if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) - { - window.console.log("Could not initialise shaders"); - } - - return shaderProgram; -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js b/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js deleted file mode 100755 index 711b4da..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js +++ /dev/null @@ -1,635 +0,0 @@ -/** - * @author Mat Groves - * - * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ - * for creating the original pixi version! - * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now share 4 bytes on the vertex buffer - * - * Heavily inspired by LibGDX's WebGLSpriteBatch: - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java - */ - - /** - * - * @class WebGLSpriteBatch - * @private - * @constructor - */ -PIXI.WebGLSpriteBatch = function() -{ - /** - * @property vertSize - * @type Number - */ - this.vertSize = 5; - - /** - * The number of images in the SpriteBatch before it flushes - * @property size - * @type Number - */ - this.size = 2000;//Math.pow(2, 16) / this.vertSize; - - //the total number of bytes in our batch - var numVerts = this.size * 4 * 4 * this.vertSize; - //the total number of indices in our batch - var numIndices = this.size * 6; - - /** - * Holds the vertices - * - * @property vertices - * @type ArrayBuffer - */ - this.vertices = new PIXI.ArrayBuffer(numVerts); - - /** - * View on the vertices as a Float32Array - * - * @property positions - * @type Float32Array - */ - this.positions = new PIXI.Float32Array(this.vertices); - - /** - * View on the vertices as a Uint32Array - * - * @property colors - * @type Uint32Array - */ - this.colors = new PIXI.Uint32Array(this.vertices); - - /** - * Holds the indices - * - * @property indices - * @type Uint16Array - */ - this.indices = new PIXI.Uint16Array(numIndices); - - /** - * @property lastIndexCount - * @type Number - */ - this.lastIndexCount = 0; - - for (var i=0, j=0; i < numIndices; i += 6, j += 4) - { - this.indices[i + 0] = j + 0; - this.indices[i + 1] = j + 1; - this.indices[i + 2] = j + 2; - this.indices[i + 3] = j + 0; - this.indices[i + 4] = j + 2; - this.indices[i + 5] = j + 3; - } - - /** - * @property drawing - * @type Boolean - */ - this.drawing = false; - - /** - * @property currentBatchSize - * @type Number - */ - this.currentBatchSize = 0; - - /** - * @property currentBaseTexture - * @type BaseTexture - */ - this.currentBaseTexture = null; - - /** - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * @property textures - * @type Array - */ - this.textures = []; - - /** - * @property blendModes - * @type Array - */ - this.blendModes = []; - - /** - * @property shaders - * @type Array - */ - this.shaders = []; - - /** - * @property sprites - * @type Array - */ - this.sprites = []; - - /** - * @property defaultShader - * @type AbstractFilter - */ - this.defaultShader = new PIXI.AbstractFilter([ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]); -}; - -/** -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLSpriteBatch.prototype.setContext = function(gl) -{ - this.gl = gl; - - // create a couple of buffers - this.vertexBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // 65535 is max index, so 65535 / 6 = 10922. - - //upload the index data - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); - - this.currentBlendMode = 99999; - - var shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc = this.defaultShader.fragmentSrc; - shader.uniforms = {}; - shader.init(); - - this.defaultShader.shaders[gl.id] = shader; -}; - -/** -* @method begin -* @param renderSession {Object} The RenderSession object -*/ -PIXI.WebGLSpriteBatch.prototype.begin = function(renderSession) -{ - this.renderSession = renderSession; - this.shader = this.renderSession.shaderManager.defaultShader; - - this.start(); -}; - -/** -* @method end -*/ -PIXI.WebGLSpriteBatch.prototype.end = function() -{ - this.flush(); -}; - -/** -* @method render -* @param sprite {Sprite} the sprite to render when using this spritebatch -*/ -PIXI.WebGLSpriteBatch.prototype.render = function(sprite) -{ - var texture = sprite.texture; - - //TODO set blend modes.. - // check texture.. - if(this.currentBatchSize >= this.size) - { - this.flush(); - this.currentBaseTexture = texture.baseTexture; - } - - // get the uvs for the texture - var uvs = texture._uvs; - // if the uvs have not updated then no point rendering just yet! - if(!uvs)return; - - // TODO trim?? - var aX = sprite.anchor.x; - var aY = sprite.anchor.y; - - var w0, w1, h0, h1; - - if (texture.trim) - { - // if the sprite is trimmed then we need to add the extra space before transforming the sprite coords.. - var trim = texture.trim; - - w1 = trim.x - aX * trim.width; - w0 = w1 + texture.crop.width; - - h1 = trim.y - aY * trim.height; - h0 = h1 + texture.crop.height; - - } - else - { - w0 = (texture.frame.width ) * (1-aX); - w1 = (texture.frame.width ) * -aX; - - h0 = texture.frame.height * (1-aY); - h1 = texture.frame.height * -aY; - } - - var index = this.currentBatchSize * 4 * this.vertSize; - - var resolution = texture.baseTexture.resolution; - - var worldTransform = sprite.worldTransform; - - var a = worldTransform.a / resolution; - var b = worldTransform.b / resolution; - var c = worldTransform.c / resolution; - var d = worldTransform.d / resolution; - var tx = worldTransform.tx; - var ty = worldTransform.ty; - - var colors = this.colors; - var positions = this.positions; - - if(this.renderSession.roundPixels) - { - // xy - positions[index] = a * w1 + c * h1 + tx | 0; - positions[index+1] = d * h1 + b * w1 + ty | 0; - - // xy - positions[index+5] = a * w0 + c * h1 + tx | 0; - positions[index+6] = d * h1 + b * w0 + ty | 0; - - // xy - positions[index+10] = a * w0 + c * h0 + tx | 0; - positions[index+11] = d * h0 + b * w0 + ty | 0; - - // xy - positions[index+15] = a * w1 + c * h0 + tx | 0; - positions[index+16] = d * h0 + b * w1 + ty | 0; - } - else - { - // xy - positions[index] = a * w1 + c * h1 + tx; - positions[index+1] = d * h1 + b * w1 + ty; - - // xy - positions[index+5] = a * w0 + c * h1 + tx; - positions[index+6] = d * h1 + b * w0 + ty; - - // xy - positions[index+10] = a * w0 + c * h0 + tx; - positions[index+11] = d * h0 + b * w0 + ty; - - // xy - positions[index+15] = a * w1 + c * h0 + tx; - positions[index+16] = d * h0 + b * w1 + ty; - } - - // uv - positions[index+2] = uvs.x0; - positions[index+3] = uvs.y0; - - // uv - positions[index+7] = uvs.x1; - positions[index+8] = uvs.y1; - - // uv - positions[index+12] = uvs.x2; - positions[index+13] = uvs.y2; - - // uv - positions[index+17] = uvs.x3; - positions[index+18] = uvs.y3; - - // color and alpha - var tint = sprite.tint; - colors[index+4] = colors[index+9] = colors[index+14] = colors[index+19] = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16) + (sprite.worldAlpha * 255 << 24); - - // increment the batchsize - this.sprites[this.currentBatchSize++] = sprite; - - -}; - -/** -* Renders a TilingSprite using the spriteBatch. -* -* @method renderTilingSprite -* @param sprite {TilingSprite} the tilingSprite to render -*/ -PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite) -{ - var texture = tilingSprite.tilingTexture; - - // check texture.. - if(this.currentBatchSize >= this.size) - { - //return; - this.flush(); - this.currentBaseTexture = texture.baseTexture; - } - - // set the textures uvs temporarily - // TODO create a separate texture so that we can tile part of a texture - - if(!tilingSprite._uvs)tilingSprite._uvs = new PIXI.TextureUvs(); - - var uvs = tilingSprite._uvs; - - tilingSprite.tilePosition.x %= texture.baseTexture.width * tilingSprite.tileScaleOffset.x; - tilingSprite.tilePosition.y %= texture.baseTexture.height * tilingSprite.tileScaleOffset.y; - - var offsetX = tilingSprite.tilePosition.x/(texture.baseTexture.width*tilingSprite.tileScaleOffset.x); - var offsetY = tilingSprite.tilePosition.y/(texture.baseTexture.height*tilingSprite.tileScaleOffset.y); - - var scaleX = (tilingSprite.width / texture.baseTexture.width) / (tilingSprite.tileScale.x * tilingSprite.tileScaleOffset.x); - var scaleY = (tilingSprite.height / texture.baseTexture.height) / (tilingSprite.tileScale.y * tilingSprite.tileScaleOffset.y); - - uvs.x0 = 0 - offsetX; - uvs.y0 = 0 - offsetY; - - uvs.x1 = (1 * scaleX) - offsetX; - uvs.y1 = 0 - offsetY; - - uvs.x2 = (1 * scaleX) - offsetX; - uvs.y2 = (1 * scaleY) - offsetY; - - uvs.x3 = 0 - offsetX; - uvs.y3 = (1 * scaleY) - offsetY; - - // get the tilingSprites current alpha and tint and combining them into a single color - var tint = tilingSprite.tint; - var color = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16) + (tilingSprite.alpha * 255 << 24); - - var positions = this.positions; - var colors = this.colors; - - var width = tilingSprite.width; - var height = tilingSprite.height; - - // TODO trim?? - var aX = tilingSprite.anchor.x; - var aY = tilingSprite.anchor.y; - var w0 = width * (1-aX); - var w1 = width * -aX; - - var h0 = height * (1-aY); - var h1 = height * -aY; - - var index = this.currentBatchSize * 4 * this.vertSize; - - var resolution = texture.baseTexture.resolution; - - var worldTransform = tilingSprite.worldTransform; - - var a = worldTransform.a / resolution;//[0]; - var b = worldTransform.b / resolution;//[3]; - var c = worldTransform.c / resolution;//[1]; - var d = worldTransform.d / resolution;//[4]; - var tx = worldTransform.tx;//[2]; - var ty = worldTransform.ty;//[5]; - - // xy - positions[index++] = a * w1 + c * h1 + tx; - positions[index++] = d * h1 + b * w1 + ty; - // uv - positions[index++] = uvs.x0; - positions[index++] = uvs.y0; - // color - colors[index++] = color; - - // xy - positions[index++] = (a * w0 + c * h1 + tx); - positions[index++] = d * h1 + b * w0 + ty; - // uv - positions[index++] = uvs.x1; - positions[index++] = uvs.y1; - // color - colors[index++] = color; - - // xy - positions[index++] = a * w0 + c * h0 + tx; - positions[index++] = d * h0 + b * w0 + ty; - // uv - positions[index++] = uvs.x2; - positions[index++] = uvs.y2; - // color - colors[index++] = color; - - // xy - positions[index++] = a * w1 + c * h0 + tx; - positions[index++] = d * h0 + b * w1 + ty; - // uv - positions[index++] = uvs.x3; - positions[index++] = uvs.y3; - // color - colors[index++] = color; - - // increment the batchsize - this.sprites[this.currentBatchSize++] = tilingSprite; -}; - -/** -* Renders the content and empties the current batch. -* -* @method flush -*/ -PIXI.WebGLSpriteBatch.prototype.flush = function() -{ - // If the batch is length 0 then return as there is nothing to draw - if (this.currentBatchSize===0)return; - - var gl = this.gl; - var shader; - - if(this.dirty) - { - this.dirty = false; - // bind the main texture - gl.activeTexture(gl.TEXTURE0); - - // bind the buffers - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - shader = this.defaultShader.shaders[gl.id]; - - // this is the same for each shader? - var stride = this.vertSize * 4; - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, stride, 2 * 4); - - // color attributes will be interpreted as unsigned bytes and normalized - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.UNSIGNED_BYTE, true, stride, 4 * 4); - } - - // upload the verts to the buffer - if(this.currentBatchSize > ( this.size * 0.5 ) ) - { - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - } - else - { - var view = this.positions.subarray(0, this.currentBatchSize * 4 * this.vertSize); - gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); - } - - var nextTexture, nextBlendMode, nextShader; - var batchSize = 0; - var start = 0; - - var currentBaseTexture = null; - var currentBlendMode = this.renderSession.blendModeManager.currentBlendMode; - var currentShader = null; - - var blendSwap = false; - var shaderSwap = false; - var sprite; - - for (var i = 0, j = this.currentBatchSize; i < j; i++) { - - sprite = this.sprites[i]; - - nextTexture = sprite.texture.baseTexture; - nextBlendMode = sprite.blendMode; - nextShader = sprite.shader || this.defaultShader; - - blendSwap = currentBlendMode !== nextBlendMode; - shaderSwap = currentShader !== nextShader; // should I use _UIDS??? - - if(currentBaseTexture !== nextTexture || blendSwap || shaderSwap) - { - this.renderBatch(currentBaseTexture, batchSize, start); - - start = i; - batchSize = 0; - currentBaseTexture = nextTexture; - - if( blendSwap ) - { - currentBlendMode = nextBlendMode; - this.renderSession.blendModeManager.setBlendMode( currentBlendMode ); - } - - if( shaderSwap ) - { - currentShader = nextShader; - - shader = currentShader.shaders[gl.id]; - - if(!shader) - { - shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc =currentShader.fragmentSrc; - shader.uniforms =currentShader.uniforms; - shader.init(); - - currentShader.shaders[gl.id] = shader; - } - - // set shader function??? - this.renderSession.shaderManager.setShader(shader); - - if(shader.dirty)shader.syncUniforms(); - - // both thease only need to be set if they are changing.. - // set the projection - var projection = this.renderSession.projection; - gl.uniform2f(shader.projectionVector, projection.x, projection.y); - - // TODO - this is temprorary! - var offsetVector = this.renderSession.offset; - gl.uniform2f(shader.offsetVector, offsetVector.x, offsetVector.y); - - // set the pointers - } - } - - batchSize++; - } - - this.renderBatch(currentBaseTexture, batchSize, start); - - // then reset the batch! - this.currentBatchSize = 0; -}; - -/** -* @method renderBatch -* @param texture {Texture} -* @param size {Number} -* @param startIndex {Number} -*/ -PIXI.WebGLSpriteBatch.prototype.renderBatch = function(texture, size, startIndex) -{ - if(size === 0)return; - - var gl = this.gl; - - // check if a texture is dirty.. - if(texture._dirty[gl.id]) - { - this.renderSession.renderer.updateTexture(texture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]); - } - - // now draw those suckas! - gl.drawElements(gl.TRIANGLES, size * 6, gl.UNSIGNED_SHORT, startIndex * 6 * 2); - - // increment the draw count - this.renderSession.drawCount++; -}; - -/** -* @method stop -*/ -PIXI.WebGLSpriteBatch.prototype.stop = function() -{ - this.flush(); - this.dirty = true; -}; - -/** -* @method start -*/ -PIXI.WebGLSpriteBatch.prototype.start = function() -{ - this.dirty = true; -}; - -/** -* Destroys the SpriteBatch. -* -* @method destroy -*/ -PIXI.WebGLSpriteBatch.prototype.destroy = function() -{ - this.vertices = null; - this.indices = null; - - this.gl.deleteBuffer( this.vertexBuffer ); - this.gl.deleteBuffer( this.indexBuffer ); - - this.currentBaseTexture = null; - - this.gl = null; -}; \ No newline at end of file diff --git a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLStencilManager.js b/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLStencilManager.js deleted file mode 100755 index 989d8cf..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLStencilManager.js +++ /dev/null @@ -1,297 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLStencilManager -* @constructor -* @private -*/ -PIXI.WebGLStencilManager = function() -{ - this.stencilStack = []; - this.reverse = true; - this.count = 0; -}; - -/** -* Sets the drawing context to the one given in parameter. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLStencilManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Applies the Mask and adds it to the current filter stack. -* -* @method pushMask -* @param graphics {Graphics} -* @param webGLData {Array} -* @param renderSession {Object} -*/ -PIXI.WebGLStencilManager.prototype.pushStencil = function(graphics, webGLData, renderSession) -{ - var gl = this.gl; - this.bindGraphics(graphics, webGLData, renderSession); - - if(this.stencilStack.length === 0) - { - gl.enable(gl.STENCIL_TEST); - gl.clear(gl.STENCIL_BUFFER_BIT); - this.reverse = true; - this.count = 0; - } - - this.stencilStack.push(webGLData); - - var level = this.count; - - gl.colorMask(false, false, false, false); - - gl.stencilFunc(gl.ALWAYS,0,0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT); - - // draw the triangle strip! - - if(webGLData.mode === 1) - { - gl.drawElements(gl.TRIANGLE_FAN, webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 ); - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - - // draw a quad to increment.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - } - - this.reverse = !this.reverse; - } - else - { - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - } - } - - gl.colorMask(true, true, true, true); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP); - - this.count++; -}; - -/** - * TODO this does not belong here! - * - * @method bindGraphics - * @param graphics {Graphics} - * @param webGLData {Array} - * @param renderSession {Object} - */ -PIXI.WebGLStencilManager.prototype.bindGraphics = function(graphics, webGLData, renderSession) -{ - //if(this._currentGraphics === graphics)return; - this._currentGraphics = graphics; - - var gl = this.gl; - - // bind the graphics object.. - var projection = renderSession.projection, - offset = renderSession.offset, - shader;// = renderSession.shaderManager.primitiveShader; - - if(webGLData.mode === 1) - { - shader = renderSession.shaderManager.complexPrimitiveShader; - - renderSession.shaderManager.setShader( shader ); - - gl.uniform1f(shader.flipY, renderSession.flipY); - - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - gl.uniform3fv(shader.color, webGLData.color); - - gl.uniform1f(shader.alpha, graphics.worldAlpha * webGLData.alpha); - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 2, 0); - - - // now do the rest.. - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - } - else - { - //renderSession.shaderManager.activatePrimitiveShader(); - shader = renderSession.shaderManager.primitiveShader; - renderSession.shaderManager.setShader( shader ); - - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform1f(shader.flipY, renderSession.flipY); - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - - gl.uniform1f(shader.alpha, graphics.worldAlpha); - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0); - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4); - - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - } -}; - -/** - * @method popStencil - * @param graphics {Graphics} - * @param webGLData {Array} - * @param renderSession {Object} - */ -PIXI.WebGLStencilManager.prototype.popStencil = function(graphics, webGLData, renderSession) -{ - var gl = this.gl; - this.stencilStack.pop(); - - this.count--; - - if(this.stencilStack.length === 0) - { - // the stack is empty! - gl.disable(gl.STENCIL_TEST); - - } - else - { - - var level = this.count; - - this.bindGraphics(graphics, webGLData, renderSession); - - gl.colorMask(false, false, false, false); - - if(webGLData.mode === 1) - { - this.reverse = !this.reverse; - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - - // draw a quad to increment.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - gl.stencilFunc(gl.ALWAYS,0,0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT); - - // draw the triangle strip! - gl.drawElements(gl.TRIANGLE_FAN, webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - } - - } - else - { - // console.log("<<>>") - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - } - } - - gl.colorMask(true, true, true, true); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP); - - - } -}; - -/** -* Destroys the mask stack. -* -* @method destroy -*/ -PIXI.WebGLStencilManager.prototype.destroy = function() -{ - this.stencilStack = null; - this.gl = null; -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/text/BitmapText.js b/tutorial-2/pixi.js-master/src/pixi/text/BitmapText.js deleted file mode 100755 index a1d20af..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/text/BitmapText.js +++ /dev/null @@ -1,215 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A BitmapText object will create a line or multiple lines of text using bitmap font. To split a line you can use '\n', '\r' or '\r\n' in your string. - * You can generate the fnt files using - * http://www.angelcode.com/products/bmfont/ for windows or - * http://www.bmglyph.com/ for mac. - * - * @class BitmapText - * @extends DisplayObjectContainer - * @constructor - * @param text {String} The copy that you would like the text to display - * @param style {Object} The style parameters - * @param style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously) - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - */ -PIXI.BitmapText = function(text, style) -{ - PIXI.DisplayObjectContainer.call(this); - - /** - * [read-only] The width of the overall text, different from fontSize, - * which is defined in the style object - * - * @property textWidth - * @type Number - * @readOnly - */ - this.textWidth = 0; - - /** - * [read-only] The height of the overall text, different from fontSize, - * which is defined in the style object - * - * @property textHeight - * @type Number - * @readOnly - */ - this.textHeight = 0; - - /** - * @property _pool - * @type Array - * @private - */ - this._pool = []; - - this.setText(text); - this.setStyle(style); - this.updateText(); - - /** - * The dirty state of this object. - * @property dirty - * @type Boolean - */ - this.dirty = false; -}; - -// constructor -PIXI.BitmapText.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); -PIXI.BitmapText.prototype.constructor = PIXI.BitmapText; - -/** - * Set the text string to be rendered. - * - * @method setText - * @param text {String} The text that you would like displayed - */ -PIXI.BitmapText.prototype.setText = function(text) -{ - this.text = text || ' '; - this.dirty = true; -}; - -/** - * Set the style of the text - * style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously) - * [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single lines of text - * - * @method setStyle - * @param style {Object} The style parameters, contained as properties of an object - */ -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; - this.tint = style.tint; -}; - -/** - * Renders text and updates it when needed - * - * @method updateText - * @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(/(?:\r\n|\r|\n)/.test(this.text.charAt(i))) - { - 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.kerning[prevCharCode]) - { - pos.x += charData.kerning[prevCharCode]; - } - - chars.push({texture:charData.texture, 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); - } - - var lenChildren = this.children.length; - var lenChars = chars.length; - var tint = this.tint || 0xFFFFFF; - - for(i = 0; i < lenChars; i++) - { - var c = i < lenChildren ? this.children[i] : this._pool.pop(); // get old child if have. if not - take from pool. - - if (c) c.setTexture(chars[i].texture); // check if got one before. - else c = new PIXI.Sprite(chars[i].texture); // if no create new one. - - c.position.x = (chars[i].position.x + lineAlignOffsets[chars[i].line]) * scale; - c.position.y = chars[i].position.y * scale; - c.scale.x = c.scale.y = scale; - c.tint = tint; - if (!c.parent) this.addChild(c); - } - - // remove unnecessary children. - // and put their into the pool. - while(this.children.length > lenChars) - { - var child = this.getChildAt(this.children.length - 1); - this._pool.push(child); - this.removeChild(child); - } - - this.textWidth = maxLineWidth * scale; - this.textHeight = (pos.y + data.lineHeight) * scale; -}; - -/** - * Updates the transform of this object - * - * @method updateTransform - * @private - */ -PIXI.BitmapText.prototype.updateTransform = function() -{ - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - PIXI.DisplayObjectContainer.prototype.updateTransform.call(this); -}; - -PIXI.BitmapText.fonts = {}; diff --git a/tutorial-2/pixi.js-master/src/pixi/text/Text.js b/tutorial-2/pixi.js-master/src/pixi/text/Text.js deleted file mode 100755 index b5a6e30..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/text/Text.js +++ /dev/null @@ -1,533 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * Modified by Tom Slezakowski http://www.tomslezakowski.com @TomSlezakowski (24/03/2014) - Added dropShadowColor. - */ - -/** - * A Text Object will create a line or multiple lines of text. To split a line you can use '\n' in your text string, - * or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object. - * - * @class Text - * @extends Sprite - * @constructor - * @param text {String} The copy that you would like the text to display - * @param [style] {Object} The style parameters - * @param [style.font] {String} default 'bold 20px Arial' The style and size of the font - * @param [style.fill='black'] {String|Number} A canvas fillstyle that will be used on the text e.g 'red', '#00FF00' - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - * @param [style.stroke] {String|Number} A canvas fillstyle that will be used on the text stroke e.g 'blue', '#FCFF00' - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke) - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap, it needs wordWrap to be set to true - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00' - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow - */ -PIXI.Text = function(text, style) -{ - /** - * The canvas element that everything is drawn to - * - * @property canvas - * @type HTMLCanvasElement - */ - this.canvas = document.createElement('canvas'); - - /** - * The canvas 2d context that everything is drawn with - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.canvas.getContext('2d'); - - /** - * The resolution of the canvas. - * @property resolution - * @type Number - */ - this.resolution = 1; - - PIXI.Sprite.call(this, PIXI.Texture.fromCanvas(this.canvas)); - - this.setText(text); - this.setStyle(style); - -}; - -// constructor -PIXI.Text.prototype = Object.create(PIXI.Sprite.prototype); -PIXI.Text.prototype.constructor = PIXI.Text; - -/** - * The width of the Text, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.Text.prototype, 'width', { - get: function() { - - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - - return this.scale.x * this.texture.frame.width; - }, - set: function(value) { - this.scale.x = value / this.texture.frame.width; - this._width = value; - } -}); - -/** - * The height of the Text, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.Text.prototype, 'height', { - get: function() { - - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - - return this.scale.y * this.texture.frame.height; - }, - set: function(value) { - this.scale.y = value / this.texture.frame.height; - this._height = value; - } -}); - -/** - * Set the style of the text - * - * @method setStyle - * @param [style] {Object} The style parameters - * @param [style.font='bold 20pt Arial'] {String} The style and size of the font - * @param [style.fill='black'] {Object} A canvas fillstyle that will be used on the text eg 'red', '#00FF00' - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - * @param [style.stroke='black'] {String} A canvas fillstyle that will be used on the text stroke eg 'blue', '#FCFF00' - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke) - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00' - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow - */ -PIXI.Text.prototype.setStyle = function(style) -{ - style = style || {}; - style.font = style.font || 'bold 20pt Arial'; - style.fill = style.fill || 'black'; - style.align = style.align || 'left'; - style.stroke = style.stroke || 'black'; //provide a default, see: https://github.com/GoodBoyDigital/pixi.js/issues/136 - style.strokeThickness = style.strokeThickness || 0; - style.wordWrap = style.wordWrap || false; - style.wordWrapWidth = style.wordWrapWidth || 100; - - style.dropShadow = style.dropShadow || false; - style.dropShadowAngle = style.dropShadowAngle || Math.PI / 6; - style.dropShadowDistance = style.dropShadowDistance || 4; - style.dropShadowColor = style.dropShadowColor || 'black'; - - this.style = style; - this.dirty = true; -}; - -/** - * Set the copy for the text object. To split a line you can use '\n'. - * - * @method setText - * @param text {String} The copy that you would like the text to display - */ -PIXI.Text.prototype.setText = function(text) -{ - this.text = text.toString() || ' '; - this.dirty = true; -}; - -/** - * Renders text and updates it when needed - * - * @method updateText - * @private - */ -PIXI.Text.prototype.updateText = function() -{ - this.texture.baseTexture.resolution = this.resolution; - - this.context.font = this.style.font; - - var outputText = this.text; - - // word wrap - // preserve original text - if(this.style.wordWrap)outputText = this.wordWrap(this.text); - - //split text into lines - var lines = outputText.split(/(?:\r\n|\r|\n)/); - - //calculate text width - var lineWidths = []; - var maxLineWidth = 0; - var fontProperties = this.determineFontProperties(this.style.font); - for (var i = 0; i < lines.length; i++) - { - var lineWidth = this.context.measureText(lines[i]).width; - lineWidths[i] = lineWidth; - maxLineWidth = Math.max(maxLineWidth, lineWidth); - } - - var width = maxLineWidth + this.style.strokeThickness; - if(this.style.dropShadow)width += this.style.dropShadowDistance; - - this.canvas.width = ( width + this.context.lineWidth ) * this.resolution; - - //calculate text height - var lineHeight = fontProperties.fontSize + this.style.strokeThickness; - - var height = lineHeight * lines.length; - if(this.style.dropShadow)height += this.style.dropShadowDistance; - - this.canvas.height = height * this.resolution; - - this.context.scale( this.resolution, this.resolution); - - if(navigator.isCocoonJS) this.context.clearRect(0,0,this.canvas.width,this.canvas.height); - - // used for debugging.. - //this.context.fillStyle ="#FF0000" - //this.context.fillRect(0, 0, this.canvas.width,this.canvas.height); - - this.context.font = this.style.font; - this.context.strokeStyle = this.style.stroke; - this.context.lineWidth = this.style.strokeThickness; - this.context.textBaseline = 'alphabetic'; - //this.context.lineJoin = 'round'; - - var linePositionX; - var linePositionY; - - if(this.style.dropShadow) - { - this.context.fillStyle = this.style.dropShadowColor; - - var xShadowOffset = Math.sin(this.style.dropShadowAngle) * this.style.dropShadowDistance; - var yShadowOffset = Math.cos(this.style.dropShadowAngle) * this.style.dropShadowDistance; - - for (i = 0; i < lines.length; i++) - { - linePositionX = this.style.strokeThickness / 2; - linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent; - - if(this.style.align === 'right') - { - linePositionX += maxLineWidth - lineWidths[i]; - } - else if(this.style.align === 'center') - { - linePositionX += (maxLineWidth - lineWidths[i]) / 2; - } - - if(this.style.fill) - { - this.context.fillText(lines[i], linePositionX + xShadowOffset, linePositionY + yShadowOffset); - } - - // if(dropShadow) - } - } - - //set canvas text styles - this.context.fillStyle = this.style.fill; - - //draw lines line by line - for (i = 0; i < lines.length; i++) - { - linePositionX = this.style.strokeThickness / 2; - linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent; - - if(this.style.align === 'right') - { - linePositionX += maxLineWidth - lineWidths[i]; - } - else if(this.style.align === 'center') - { - linePositionX += (maxLineWidth - lineWidths[i]) / 2; - } - - if(this.style.stroke && this.style.strokeThickness) - { - this.context.strokeText(lines[i], linePositionX, linePositionY); - } - - if(this.style.fill) - { - this.context.fillText(lines[i], linePositionX, linePositionY); - } - - // if(dropShadow) - } - - this.updateTexture(); -}; - -/** - * Updates texture size based on canvas size - * - * @method updateTexture - * @private - */ -PIXI.Text.prototype.updateTexture = function() -{ - this.texture.baseTexture.width = this.canvas.width; - this.texture.baseTexture.height = this.canvas.height; - this.texture.crop.width = this.texture.frame.width = this.canvas.width; - this.texture.crop.height = this.texture.frame.height = this.canvas.height; - - this._width = this.canvas.width; - this._height = this.canvas.height; - - // update the dirty base textures - this.texture.baseTexture.dirty(); -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Text.prototype._renderWebGL = function(renderSession) -{ - if(this.dirty) - { - this.resolution = renderSession.resolution; - - this.updateText(); - this.dirty = false; - } - - PIXI.Sprite.prototype._renderWebGL.call(this, renderSession); -}; - -/** -* Renders the object using the Canvas renderer -* -* @method _renderCanvas -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Text.prototype._renderCanvas = function(renderSession) -{ - if(this.dirty) - { - this.resolution = renderSession.resolution; - - this.updateText(); - this.dirty = false; - } - - PIXI.Sprite.prototype._renderCanvas.call(this, renderSession); -}; - -/** -* Calculates the ascent, descent and fontSize of a given fontStyle -* -* @method determineFontProperties -* @param fontStyle {Object} -* @private -*/ -PIXI.Text.prototype.determineFontProperties = function(fontStyle) -{ - var properties = PIXI.Text.fontPropertiesCache[fontStyle]; - - if(!properties) - { - properties = {}; - - var canvas = PIXI.Text.fontPropertiesCanvas; - var context = PIXI.Text.fontPropertiesContext; - - context.font = fontStyle; - - var width = Math.ceil(context.measureText('|Mq').width); - var baseline = Math.ceil(context.measureText('M').width); - var height = 2 * baseline; - - baseline = baseline * 1.4 | 0; - - canvas.width = width; - canvas.height = height; - - context.fillStyle = '#f00'; - context.fillRect(0, 0, width, height); - - context.font = fontStyle; - - context.textBaseline = 'alphabetic'; - context.fillStyle = '#000'; - context.fillText('|MÉq', 0, baseline); - - var imagedata = context.getImageData(0, 0, width, height).data; - var pixels = imagedata.length; - var line = width * 4; - - var i, j; - - var idx = 0; - var stop = false; - - // ascent. scan from top to bottom until we find a non red pixel - for(i = 0; i < baseline; i++) - { - for(j = 0; j < line; j += 4) - { - if(imagedata[idx + j] !== 255) - { - stop = true; - break; - } - } - if(!stop) - { - idx += line; - } - else - { - break; - } - } - - properties.ascent = baseline - i; - - idx = pixels - line; - stop = false; - - // descent. scan from bottom to top until we find a non red pixel - for(i = height; i > baseline; i--) - { - for(j = 0; j < line; j += 4) - { - if(imagedata[idx + j] !== 255) - { - stop = true; - break; - } - } - if(!stop) - { - idx -= line; - } - else - { - break; - } - } - - properties.descent = i - baseline; - //TODO might need a tweak. kind of a temp fix! - properties.descent += 6; - properties.fontSize = properties.ascent + properties.descent; - - PIXI.Text.fontPropertiesCache[fontStyle] = properties; - } - - return properties; -}; - -/** - * Applies newlines to a string to have it optimally fit into the horizontal - * bounds set by the Text object's wordWrapWidth property. - * - * @method wordWrap - * @param text {String} - * @private - */ -PIXI.Text.prototype.wordWrap = function(text) -{ - // Greedy wrapping algorithm that will wrap words as the line grows longer - // than its horizontal bounds. - var result = ''; - var lines = text.split('\n'); - for (var i = 0; i < lines.length; i++) - { - var spaceLeft = this.style.wordWrapWidth; - var words = lines[i].split(' '); - for (var j = 0; j < words.length; j++) - { - var wordWidth = this.context.measureText(words[j]).width; - var wordWidthWithSpace = wordWidth + this.context.measureText(' ').width; - if(j === 0 || wordWidthWithSpace > spaceLeft) - { - // Skip printing the newline if it's the first word of the line that is - // greater than the word wrap width. - if(j > 0) - { - result += '\n'; - } - result += words[j]; - spaceLeft = this.style.wordWrapWidth - wordWidth; - } - else - { - spaceLeft -= wordWidthWithSpace; - result += ' ' + words[j]; - } - } - - if (i < lines.length-1) - { - result += '\n'; - } - } - return result; -}; - -/** -* Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. -* -* @method getBounds -* @param matrix {Matrix} the transformation matrix of the Text -* @return {Rectangle} the framing rectangle -*/ -PIXI.Text.prototype.getBounds = function(matrix) -{ - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - return PIXI.Sprite.prototype.getBounds.call(this, matrix); -}; - -/** - * Destroys this text object. - * - * @method destroy - * @param destroyBaseTexture {Boolean} whether to destroy the base texture as well - */ -PIXI.Text.prototype.destroy = function(destroyBaseTexture) -{ - // make sure to reset the the context and canvas.. dont want this hanging around in memory! - this.context = null; - this.canvas = null; - - this.texture.destroy(destroyBaseTexture === undefined ? true : destroyBaseTexture); -}; - -PIXI.Text.fontPropertiesCache = {}; -PIXI.Text.fontPropertiesCanvas = document.createElement('canvas'); -PIXI.Text.fontPropertiesContext = PIXI.Text.fontPropertiesCanvas.getContext('2d'); diff --git a/tutorial-2/pixi.js-master/src/pixi/textures/BaseTexture.js b/tutorial-2/pixi.js-master/src/pixi/textures/BaseTexture.js deleted file mode 100755 index 0145849..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/textures/BaseTexture.js +++ /dev/null @@ -1,305 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -PIXI.BaseTextureCache = {}; - -PIXI.BaseTextureCacheIdGenerator = 0; - -/** - * A texture stores the information that represents an image. All textures have a base texture. - * - * @class BaseTexture - * @uses EventTarget - * @constructor - * @param source {String} the source object (image or canvas) - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - */ -PIXI.BaseTexture = function(source, scaleMode) -{ - /** - * The Resolution of the texture. - * - * @property resolution - * @type Number - */ - this.resolution = 1; - - /** - * [read-only] The width of the base texture set when the image has loaded - * - * @property width - * @type Number - * @readOnly - */ - this.width = 100; - - /** - * [read-only] The height of the base texture set when the image has loaded - * - * @property height - * @type Number - * @readOnly - */ - this.height = 100; - - /** - * The scale mode to apply when scaling this texture - * - * @property scaleMode - * @type {Number} - * @default PIXI.scaleModes.LINEAR - */ - this.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - /** - * [read-only] Set to true once the base texture has loaded - * - * @property hasLoaded - * @type Boolean - * @readOnly - */ - this.hasLoaded = false; - - /** - * The image source that is used to create the texture. - * - * @property source - * @type Image - */ - this.source = source; - - this._UID = PIXI._UID++; - - /** - * Controls if RGB channels should be pre-multiplied by Alpha (WebGL only) - * - * @property premultipliedAlpha - * @type Boolean - * @default true - */ - this.premultipliedAlpha = true; - - // used for webGL - - /** - * @property _glTextures - * @type Array - * @private - */ - this._glTextures = []; - - /** - * - * Set this to true if a mipmap of this texture needs to be generated. This value needs to be set before the texture is used - * Also the texture must be a power of two size to work - * - * @property mipmap - * @type {Boolean} - */ - this.mipmap = false; - - // used for webGL texture updating... - // TODO - this needs to be addressed - - /** - * @property _dirty - * @type Array - * @private - */ - this._dirty = [true, true, true, true]; - - if(!source)return; - - if((this.source.complete || this.source.getContext) && this.source.width && this.source.height) - { - this.hasLoaded = true; - this.width = this.source.naturalWidth || this.source.width; - this.height = this.source.naturalHeight || this.source.height; - this.dirty(); - } - else - { - var scope = this; - - this.source.onload = function() { - - scope.hasLoaded = true; - scope.width = scope.source.naturalWidth || scope.source.width; - scope.height = scope.source.naturalHeight || scope.source.height; - - scope.dirty(); - - // add it to somewhere... - scope.dispatchEvent( { type: 'loaded', content: scope } ); - }; - - this.source.onerror = function() { - scope.dispatchEvent( { type: 'error', content: scope } ); - }; - } - - /** - * @property imageUrl - * @type String - */ - this.imageUrl = null; - - /** - * @property _powerOf2 - * @type Boolean - * @private - */ - this._powerOf2 = false; - -}; - -PIXI.BaseTexture.prototype.constructor = PIXI.BaseTexture; - -PIXI.EventTarget.mixin(PIXI.BaseTexture.prototype); - -/** - * Destroys this base texture - * - * @method destroy - */ -PIXI.BaseTexture.prototype.destroy = function() -{ - if(this.imageUrl) - { - delete PIXI.BaseTextureCache[this.imageUrl]; - delete PIXI.TextureCache[this.imageUrl]; - this.imageUrl = null; - if (!navigator.isCocoonJS) this.source.src = ''; - } - else if (this.source && this.source._pixiId) - { - delete PIXI.BaseTextureCache[this.source._pixiId]; - } - this.source = null; - - this.unloadFromGPU(); -}; - -/** - * Changes the source image of the texture - * - * @method updateSourceImage - * @param newSrc {String} the path of the image - */ -PIXI.BaseTexture.prototype.updateSourceImage = function(newSrc) -{ - this.hasLoaded = false; - this.source.src = null; - this.source.src = newSrc; -}; - -/** - * Sets all glTextures to be dirty. - * - * @method dirty - */ -PIXI.BaseTexture.prototype.dirty = function() -{ - for (var i = 0; i < this._glTextures.length; i++) - { - this._dirty[i] = true; - } -}; - -/** - * Removes the base texture from the GPU, useful for managing resources on the GPU. - * Atexture is still 100% usable and will simply be reuploaded if there is a sprite on screen that is using it. - * - * @method unloadFromGPU - */ -PIXI.BaseTexture.prototype.unloadFromGPU = function() -{ - this.dirty(); - - // delete the webGL textures if any. - for (var i = this._glTextures.length - 1; i >= 0; i--) - { - var glTexture = this._glTextures[i]; - var gl = PIXI.glContexts[i]; - - if(gl && glTexture) - { - gl.deleteTexture(glTexture); - } - - } - - this._glTextures.length = 0; - - this.dirty(); -}; - -/** - * Helper function that creates a base texture from the given image url. - * If the image is not in the base texture cache it will be created and loaded. - * - * @static - * @method fromImage - * @param imageUrl {String} The image url of the texture - * @param crossorigin {Boolean} - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return BaseTexture - */ -PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode) -{ - var baseTexture = PIXI.BaseTextureCache[imageUrl]; - - if(crossorigin === undefined && imageUrl.indexOf('data:') === -1) crossorigin = true; - - if(!baseTexture) - { - // new Image() breaks tex loading in some versions of Chrome. - // See https://code.google.com/p/chromium/issues/detail?id=238071 - var image = new Image();//document.createElement('img'); - if (crossorigin) - { - image.crossOrigin = ''; - } - - image.src = imageUrl; - baseTexture = new PIXI.BaseTexture(image, scaleMode); - baseTexture.imageUrl = imageUrl; - PIXI.BaseTextureCache[imageUrl] = baseTexture; - - // if there is an @2x at the end of the url we are going to assume its a highres image - if( imageUrl.indexOf(PIXI.RETINA_PREFIX + '.') !== -1) - { - baseTexture.resolution = 2; - } - } - - return baseTexture; -}; - -/** - * Helper function that creates a base texture from the given canvas element. - * - * @static - * @method fromCanvas - * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return BaseTexture - */ -PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode) -{ - if(!canvas._pixiId) - { - canvas._pixiId = 'canvas_' + PIXI.TextureCacheIdGenerator++; - } - - var baseTexture = PIXI.BaseTextureCache[canvas._pixiId]; - - if(!baseTexture) - { - baseTexture = new PIXI.BaseTexture(canvas, scaleMode); - PIXI.BaseTextureCache[canvas._pixiId] = baseTexture; - } - - return baseTexture; -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/textures/RenderTexture.js b/tutorial-2/pixi.js-master/src/pixi/textures/RenderTexture.js deleted file mode 100755 index 849ce47..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/textures/RenderTexture.js +++ /dev/null @@ -1,339 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A RenderTexture is a special texture that allows any Pixi display object to be rendered to it. - * - * __Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead. - * - * A RenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example: - * - * var renderTexture = new PIXI.RenderTexture(800, 600); - * var sprite = PIXI.Sprite.fromImage("spinObj_01.png"); - * sprite.position.x = 800/2; - * sprite.position.y = 600/2; - * sprite.anchor.x = 0.5; - * sprite.anchor.y = 0.5; - * renderTexture.render(sprite); - * - * The Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual position a DisplayObjectContainer should be used: - * - * var doc = new PIXI.DisplayObjectContainer(); - * doc.addChild(sprite); - * renderTexture.render(doc); // Renders to center of renderTexture - * - * @class RenderTexture - * @extends Texture - * @constructor - * @param width {Number} The width of the render texture - * @param height {Number} The height of the render texture - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @param resolution {Number} The resolution of the texture being generated - */ -PIXI.RenderTexture = function(width, height, renderer, scaleMode, resolution) -{ - /** - * The with of the render texture - * - * @property width - * @type Number - */ - this.width = width || 100; - - /** - * The height of the render texture - * - * @property height - * @type Number - */ - this.height = height || 100; - - /** - * The Resolution of the texture. - * - * @property resolution - * @type Number - */ - this.resolution = resolution || 1; - - /** - * The framing rectangle of the render texture - * - * @property frame - * @type Rectangle - */ - this.frame = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @property crop - * @type Rectangle - */ - this.crop = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * The base texture object that this texture uses - * - * @property baseTexture - * @type BaseTexture - */ - this.baseTexture = new PIXI.BaseTexture(); - this.baseTexture.width = this.width * this.resolution; - this.baseTexture.height = this.height * this.resolution; - this.baseTexture._glTextures = []; - this.baseTexture.resolution = this.resolution; - - this.baseTexture.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - this.baseTexture.hasLoaded = true; - - PIXI.Texture.call(this, - this.baseTexture, - new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution) - ); - - /** - * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. - * - * @property renderer - * @type CanvasRenderer|WebGLRenderer - */ - this.renderer = renderer || PIXI.defaultRenderer; - - if(this.renderer.type === PIXI.WEBGL_RENDERER) - { - var gl = this.renderer.gl; - this.baseTexture._dirty[gl.id] = false; - - this.textureBuffer = new PIXI.FilterTexture(gl, this.width, this.height, this.baseTexture.scaleMode); - this.baseTexture._glTextures[gl.id] = this.textureBuffer.texture; - - this.render = this.renderWebGL; - this.projection = new PIXI.Point(this.width*0.5, -this.height*0.5); - } - else - { - this.render = this.renderCanvas; - this.textureBuffer = new PIXI.CanvasBuffer(this.width* this.resolution, this.height* this.resolution); - this.baseTexture.source = this.textureBuffer.canvas; - } - - /** - * @property valid - * @type Boolean - */ - this.valid = true; - - this._updateUvs(); -}; - -PIXI.RenderTexture.prototype = Object.create(PIXI.Texture.prototype); -PIXI.RenderTexture.prototype.constructor = PIXI.RenderTexture; - -/** - * Resizes the RenderTexture. - * - * @method resize - * @param width {Number} The width to resize to. - * @param height {Number} The height to resize to. - * @param updateBase {Boolean} Should the baseTexture.width and height values be resized as well? - */ -PIXI.RenderTexture.prototype.resize = function(width, height, updateBase) -{ - if (width === this.width && height === this.height)return; - - this.valid = (width > 0 && height > 0); - - this.width = width; - this.height = height; - - this.frame.width = this.crop.width = width * this.resolution; - this.frame.height = this.crop.height = height * this.resolution; - - if (updateBase) - { - this.baseTexture.width = this.width * this.resolution; - this.baseTexture.height = this.height * this.resolution; - } - - if (this.renderer.type === PIXI.WEBGL_RENDERER) - { - this.projection.x = this.width / 2; - this.projection.y = -this.height / 2; - } - - if(!this.valid)return; - - this.textureBuffer.resize(this.width, this.height); -}; - -/** - * Clears the RenderTexture. - * - * @method clear - */ -PIXI.RenderTexture.prototype.clear = function() -{ - if(!this.valid)return; - - if (this.renderer.type === PIXI.WEBGL_RENDERER) - { - this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer); - } - - this.textureBuffer.clear(); -}; - -/** - * This function will draw the display object to the texture. - * - * @method renderWebGL - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. - * @param [clear] {Boolean} If true the texture will be cleared before the displayObject is drawn - * @private - */ -PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, matrix, clear) -{ - if(!this.valid)return; - //TOOD replace position with matrix.. - - //Lets create a nice matrix to apply to our display object. Frame buffers come in upside down so we need to flip the matrix - var wt = displayObject.worldTransform; - wt.identity(); - wt.translate(0, this.projection.y * 2); - if(matrix)wt.append(matrix); - wt.scale(1,-1); - - // setWorld Alpha to ensure that the object is renderer at full opacity - displayObject.worldAlpha = 1; - - // Time to update all the children of the displayObject with the new matrix.. - var children = displayObject.children; - - for(var i=0,j=children.length; i this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) - { - throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); - } - - this.valid = frame && frame.width && frame.height && this.baseTexture.source && this.baseTexture.hasLoaded; - - if (this.trim) - { - this.width = this.trim.width; - this.height = this.trim.height; - this.frame.width = this.trim.width; - this.frame.height = this.trim.height; - } - - if (this.valid) this._updateUvs(); - -}; - -/** - * Updates the internal WebGL UV cache. - * - * @method _updateUvs - * @private - */ -PIXI.Texture.prototype._updateUvs = function() -{ - if(!this._uvs)this._uvs = new PIXI.TextureUvs(); - - var frame = this.crop; - var tw = this.baseTexture.width; - var th = this.baseTexture.height; - - this._uvs.x0 = frame.x / tw; - this._uvs.y0 = frame.y / th; - - this._uvs.x1 = (frame.x + frame.width) / tw; - this._uvs.y1 = frame.y / th; - - this._uvs.x2 = (frame.x + frame.width) / tw; - this._uvs.y2 = (frame.y + frame.height) / th; - - this._uvs.x3 = frame.x / tw; - this._uvs.y3 = (frame.y + frame.height) / th; -}; - -/** - * Helper function that creates a Texture object from the given image url. - * If the image is not in the texture cache it will be created and loaded. - * - * @static - * @method fromImage - * @param imageUrl {String} The image url of the texture - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return Texture - */ -PIXI.Texture.fromImage = function(imageUrl, crossorigin, scaleMode) -{ - var texture = PIXI.TextureCache[imageUrl]; - - if(!texture) - { - texture = new PIXI.Texture(PIXI.BaseTexture.fromImage(imageUrl, crossorigin, scaleMode)); - PIXI.TextureCache[imageUrl] = texture; - } - - return texture; -}; - -/** - * Helper function that returns a Texture objected based on the given frame id. - * If the frame id is not in the texture cache an error will be thrown. - * - * @static - * @method fromFrame - * @param frameId {String} The frame id of the texture - * @return Texture - */ -PIXI.Texture.fromFrame = function(frameId) -{ - var texture = PIXI.TextureCache[frameId]; - if(!texture) throw new Error('The frameId "' + frameId + '" does not exist in the texture cache '); - return texture; -}; - -/** - * Helper function that creates a new a Texture based on the given canvas element. - * - * @static - * @method fromCanvas - * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return Texture - */ -PIXI.Texture.fromCanvas = function(canvas, scaleMode) -{ - var baseTexture = PIXI.BaseTexture.fromCanvas(canvas, scaleMode); - - return new PIXI.Texture( baseTexture ); - -}; - -/** - * Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object. - * - * @static - * @method addTextureToCache - * @param texture {Texture} The Texture to add to the cache. - * @param id {String} The id that the texture will be stored against. - */ -PIXI.Texture.addTextureToCache = function(texture, id) -{ - PIXI.TextureCache[id] = texture; -}; - -/** - * Remove a texture from the global PIXI.TextureCache. - * - * @static - * @method removeTextureFromCache - * @param id {String} The id of the texture to be removed - * @return {Texture} The texture that was removed - */ -PIXI.Texture.removeTextureFromCache = function(id) -{ - var texture = PIXI.TextureCache[id]; - delete PIXI.TextureCache[id]; - delete PIXI.BaseTextureCache[id]; - return texture; -}; - -PIXI.TextureUvs = function() -{ - this.x0 = 0; - this.y0 = 0; - - this.x1 = 0; - this.y1 = 0; - - this.x2 = 0; - this.y2 = 0; - - this.x3 = 0; - this.y3 = 0; -}; - -PIXI.Texture.emptyTexture = new PIXI.Texture(new PIXI.BaseTexture()); - diff --git a/tutorial-2/pixi.js-master/src/pixi/textures/VideoTexture.js b/tutorial-2/pixi.js-master/src/pixi/textures/VideoTexture.js deleted file mode 100755 index ad58ec5..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/textures/VideoTexture.js +++ /dev/null @@ -1,168 +0,0 @@ -/** - * A texture of a [playing] Video. - * - * See the ["deus" demo](http://www.goodboydigital.com/pixijs/examples/deus/). - * - * @class VideoTexture - * @extends BaseTexture - * @constructor - * @param source {HTMLVideoElement} - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - */ -PIXI.VideoTexture = function( source, scaleMode ) -{ - if( !source ){ - throw new Error( 'No video source element specified.' ); - } - - // hook in here to check if video is already available. - // PIXI.BaseTexture looks for a source.complete boolean, plus width & height. - - if( (source.readyState === source.HAVE_ENOUGH_DATA || source.readyState === source.HAVE_FUTURE_DATA ) && source.width && source.height ) - { - source.complete = true; - } - - PIXI.BaseTexture.call( this, source, scaleMode ); - - this.autoUpdate = false; - this.updateBound = this._onUpdate.bind(this); - - if( !source.complete ) - { - this._onCanPlay = this.onCanPlay.bind(this); - - source.addEventListener( 'canplay', this._onCanPlay ); - source.addEventListener( 'canplaythrough', this._onCanPlay ); - - // started playing.. - source.addEventListener( 'play', this.onPlayStart.bind(this) ); - source.addEventListener( 'pause', this.onPlayStop.bind(this) ); - } - -}; - -PIXI.VideoTexture.prototype = Object.create( PIXI.BaseTexture.prototype ); - -PIXI.VideoTexture.constructor = PIXI.VideoTexture; - -PIXI.VideoTexture.prototype._onUpdate = function() -{ - if(this.autoUpdate) - { - window.requestAnimationFrame(this.updateBound); - this.dirty(); - } -}; - -PIXI.VideoTexture.prototype.onPlayStart = function() -{ - if(!this.autoUpdate) - { - window.requestAnimationFrame(this.updateBound); - this.autoUpdate = true; - } -}; - -PIXI.VideoTexture.prototype.onPlayStop = function() -{ - this.autoUpdate = false; -}; - -PIXI.VideoTexture.prototype.onCanPlay = function() -{ - if( event.type === 'canplaythrough' ) - { - this.hasLoaded = true; - - - if( this.source ) - { - this.source.removeEventListener( 'canplay', this._onCanPlay ); - this.source.removeEventListener( 'canplaythrough', this._onCanPlay ); - - this.width = this.source.videoWidth; - this.height = this.source.videoHeight; - - // prevent multiple loaded dispatches.. - if( !this.__loaded ){ - this.__loaded = true; - this.dispatchEvent( { type: 'loaded', content: this } ); - } - } - } -}; - -PIXI.VideoTexture.prototype.destroy = function() -{ - if( this.source && this.source._pixiId ) - { - PIXI.BaseTextureCache[ this.source._pixiId ] = null; - delete PIXI.BaseTextureCache[ this.source._pixiId ]; - - this.source._pixiId = null; - delete this.source._pixiId; - } - - PIXI.BaseTexture.prototype.destroy.call( this ); -}; - -/** - * Mimic Pixi BaseTexture.from.... method. - * - * @static - * @method baseTextureFromVideo - * @param video {HTMLVideoElement} - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return {VideoTexture} - */ -PIXI.VideoTexture.baseTextureFromVideo = function( video, scaleMode ) -{ - if( !video._pixiId ) - { - video._pixiId = 'video_' + PIXI.TextureCacheIdGenerator++; - } - - var baseTexture = PIXI.BaseTextureCache[ video._pixiId ]; - - if( !baseTexture ) - { - baseTexture = new PIXI.VideoTexture( video, scaleMode ); - PIXI.BaseTextureCache[ video._pixiId ] = baseTexture; - } - - return baseTexture; -}; - -/** - * Mimic Pixi BaseTexture.from.... method. - * - * @static - * @method textureFromVideo - * @param video {HTMLVideoElement} - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture, but not a VideoTexture. - */ -PIXI.VideoTexture.textureFromVideo = function( video, scaleMode ) -{ - var baseTexture = PIXI.VideoTexture.baseTextureFromVideo( video, scaleMode ); - return new PIXI.Texture( baseTexture ); -}; - -/** - * Mimic Pixi BaseTexture.from.... method. - * - * @static - * @method fromUrl - * @param videoSrc {String} The URL for the video. - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return {VideoTexture} - */ -PIXI.VideoTexture.fromUrl = function( videoSrc, scaleMode ) -{ - var video = document.createElement('video'); - video.src = videoSrc; - video.autoPlay = true; - video.play(); - return PIXI.VideoTexture.textureFromVideo( video, scaleMode); -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/utils/Detector.js b/tutorial-2/pixi.js-master/src/pixi/utils/Detector.js deleted file mode 100755 index fe38f04..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/utils/Detector.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This helper function will automatically detect which renderer you should be using. - * WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by - * the browser then this function will return a canvas renderer - * - * @method autoDetectRenderer - * @for PIXI - * @static - * @param width=800 {Number} the width of the renderers view - * @param height=600 {Number} the height of the renderers view - * - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * - */ -PIXI.autoDetectRenderer = function(width, height, options) -{ - if(!width)width = 800; - if(!height)height = 600; - - // BORROWED from Mr Doob (mrdoob.com) - var webgl = ( function () { try { - var canvas = document.createElement( 'canvas' ); - return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ); - } catch( e ) { - return false; - } - } )(); - - if( webgl ) - { - return new PIXI.WebGLRenderer(width, height, options); - } - - return new PIXI.CanvasRenderer(width, height, options); -}; - -/** - * This helper function will automatically detect which renderer you should be using. - * This function is very similar to the autoDetectRenderer function except that is will return a canvas renderer for android. - * Even thought both android chrome supports webGL the canvas implementation perform better at the time of writing. - * This function will likely change and update as webGL performance improves on these devices. - * - * @method autoDetectRecommendedRenderer - * @for PIXI - * @static - * @param width=800 {Number} the width of the renderers view - * @param height=600 {Number} the height of the renderers view - * - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * - */ -PIXI.autoDetectRecommendedRenderer = function(width, height, options) -{ - if(!width)width = 800; - if(!height)height = 600; - - // BORROWED from Mr Doob (mrdoob.com) - var webgl = ( function () { try { - var canvas = document.createElement( 'canvas' ); - return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ); - } catch( e ) { - return false; - } - } )(); - - var isAndroid = /Android/i.test(navigator.userAgent); - - if( webgl && !isAndroid) - { - return new PIXI.WebGLRenderer(width, height, options); - } - - return new PIXI.CanvasRenderer(width, height, options); -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/utils/EventTarget.js b/tutorial-2/pixi.js-master/src/pixi/utils/EventTarget.js deleted file mode 100755 index 35aa31b..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/utils/EventTarget.js +++ /dev/null @@ -1,284 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * @author Chad Engler https://github.com/englercj @Rolnaaba - */ - -/** - * Originally based on https://github.com/mrdoob/eventtarget.js/ from mr Doob. - * Currently takes inspiration from the nodejs EventEmitter, EventEmitter3, and smokesignals - */ - -/** - * Mixins event emitter functionality to a class - * - * @class EventTarget - * @example - * function MyEmitter() {} - * - * PIXI.EventTarget.mixin(MyEmitter.prototype); - * - * var em = new MyEmitter(); - * em.emit('eventName', 'some data', 'some more data', {}, null, ...); - */ -PIXI.EventTarget = { - /** - * Backward compat from when this used to be a function - */ - call: function callCompat(obj) { - if(obj) { - obj = obj.prototype || obj; - PIXI.EventTarget.mixin(obj); - } - }, - - /** - * Mixes in the properties of the EventTarget prototype onto another object - * - * @method mixin - * @param object {Object} The obj to mix into - */ - mixin: function mixin(obj) { - /** - * Return a list of assigned event listeners. - * - * @method listeners - * @param eventName {String} The events that should be listed. - * @return {Array} An array of listener functions - */ - obj.listeners = function listeners(eventName) { - this._listeners = this._listeners || {}; - - return this._listeners[eventName] ? this._listeners[eventName].slice() : []; - }; - - /** - * Emit an event to all registered event listeners. - * - * @method emit - * @alias dispatchEvent - * @param eventName {String} The name of the event. - * @return {Boolean} Indication if we've emitted an event. - */ - obj.emit = obj.dispatchEvent = function emit(eventName, data) { - this._listeners = this._listeners || {}; - - //backwards compat with old method ".emit({ type: 'something' })" - if(typeof eventName === 'object') { - data = eventName; - eventName = eventName.type; - } - - //ensure we are using a real pixi event - if(!data || data.__isEventObject !== true) { - data = new PIXI.Event(this, eventName, data); - } - - //iterate the listeners - if(this._listeners && this._listeners[eventName]) { - var listeners = this._listeners[eventName].slice(0), - length = listeners.length, - fn = listeners[0], - i; - - for(i = 0; i < length; fn = listeners[++i]) { - //call the event listener - fn.call(this, data); - - //if "stopImmediatePropagation" is called, stop calling sibling events - if(data.stoppedImmediate) { - return this; - } - } - - //if "stopPropagation" is called then don't bubble the event - if(data.stopped) { - return this; - } - } - - //bubble this event up the scene graph - if(this.parent && this.parent.emit) { - this.parent.emit.call(this.parent, eventName, data); - } - - return this; - }; - - /** - * Register a new EventListener for the given event. - * - * @method on - * @alias addEventListener - * @param eventName {String} Name of the event. - * @param callback {Functon} fn Callback function. - */ - obj.on = obj.addEventListener = function on(eventName, fn) { - this._listeners = this._listeners || {}; - - (this._listeners[eventName] = this._listeners[eventName] || []) - .push(fn); - - return this; - }; - - /** - * Add an EventListener that's only called once. - * - * @method once - * @param eventName {String} Name of the event. - * @param callback {Function} Callback function. - */ - obj.once = function once(eventName, fn) { - this._listeners = this._listeners || {}; - - var self = this; - function onceHandlerWrapper() { - fn.apply(self.off(eventName, onceHandlerWrapper), arguments); - } - onceHandlerWrapper._originalHandler = fn; - - return this.on(eventName, onceHandlerWrapper); - }; - - /** - * Remove event listeners. - * - * @method off - * @alias removeEventListener - * @param eventName {String} The event we want to remove. - * @param callback {Function} The listener that we need to find. - */ - obj.off = obj.removeEventListener = function off(eventName, fn) { - this._listeners = this._listeners || {}; - - if(!this._listeners[eventName]) - return this; - - var list = this._listeners[eventName], - i = fn ? list.length : 0; - - while(i-- > 0) { - if(list[i] === fn || list[i]._originalHandler === fn) { - list.splice(i, 1); - } - } - - if(list.length === 0) { - delete this._listeners[eventName]; - } - - return this; - }; - - /** - * Remove all listeners or only the listeners for the specified event. - * - * @method removeAllListeners - * @param eventName {String} The event you want to remove all listeners for. - */ - obj.removeAllListeners = function removeAllListeners(eventName) { - this._listeners = this._listeners || {}; - - if(!this._listeners[eventName]) - return this; - - delete this._listeners[eventName]; - - return this; - }; - } -}; - -/** - * Creates an homogenous object for tracking events so users can know what to expect. - * - * @class Event - * @extends Object - * @constructor - * @param target {Object} The target object that the event is called on - * @param name {String} The string name of the event that was triggered - * @param data {Object} Arbitrary event data to pass along - */ -PIXI.Event = function(target, name, data) { - //for duck typing in the ".on()" function - this.__isEventObject = true; - - /** - * Tracks the state of bubbling propagation. Do not - * set this directly, instead use `event.stopPropagation()` - * - * @property stopped - * @type Boolean - * @private - * @readOnly - */ - this.stopped = false; - - /** - * Tracks the state of sibling listener propagation. Do not - * set this directly, instead use `event.stopImmediatePropagation()` - * - * @property stoppedImmediate - * @type Boolean - * @private - * @readOnly - */ - this.stoppedImmediate = false; - - /** - * The original target the event triggered on. - * - * @property target - * @type Object - * @readOnly - */ - this.target = target; - - /** - * The string name of the event that this represents. - * - * @property type - * @type String - * @readOnly - */ - this.type = name; - - /** - * The data that was passed in with this event. - * - * @property data - * @type Object - * @readOnly - */ - this.data = data; - - //backwards compat with older version of events - this.content = data; - - /** - * The timestamp when the event occurred. - * - * @property timeStamp - * @type Number - * @readOnly - */ - this.timeStamp = Date.now(); -}; - -/** - * Stops the propagation of events up the scene graph (prevents bubbling). - * - * @method stopPropagation - */ -PIXI.Event.prototype.stopPropagation = function stopPropagation() { - this.stopped = true; -}; - -/** - * Stops the propagation of events to sibling listeners (no longer calls any listeners). - * - * @method stopImmediatePropagation - */ -PIXI.Event.prototype.stopImmediatePropagation = function stopImmediatePropagation() { - this.stoppedImmediate = true; -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/utils/Polyk.js b/tutorial-2/pixi.js-master/src/pixi/utils/Polyk.js deleted file mode 100755 index 838e6a2..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/utils/Polyk.js +++ /dev/null @@ -1,168 +0,0 @@ -/* - PolyK library - url: http://polyk.ivank.net - Released under MIT licence. - - Copyright (c) 2012 Ivan Kuckir - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation - files (the "Software"), to deal in the Software without - restriction, including without limitation the rights to use, - copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following - conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. - - This is an amazing lib! - - Slightly modified by Mat Groves (matgroves.com); -*/ - -/** - * Based on the Polyk library http://polyk.ivank.net released under MIT licence. - * This is an amazing lib! - * Slightly modified by Mat Groves (matgroves.com); - * @class PolyK - */ -PIXI.PolyK = {}; - -/** - * Triangulates shapes for webGL graphic fills. - * - * @method Triangulate - */ -PIXI.PolyK.Triangulate = function(p) -{ - var sign = true; - - var n = p.length >> 1; - if(n < 3) return []; - - var tgs = []; - var avl = []; - for(var i = 0; i < n; i++) avl.push(i); - - i = 0; - var al = n; - while(al > 3) - { - var i0 = avl[(i+0)%al]; - var i1 = avl[(i+1)%al]; - var i2 = avl[(i+2)%al]; - - var ax = p[2*i0], ay = p[2*i0+1]; - var bx = p[2*i1], by = p[2*i1+1]; - var cx = p[2*i2], cy = p[2*i2+1]; - - var earFound = false; - if(PIXI.PolyK._convex(ax, ay, bx, by, cx, cy, sign)) - { - earFound = true; - for(var j = 0; j < al; j++) - { - var vi = avl[j]; - if(vi === i0 || vi === i1 || vi === i2) continue; - - if(PIXI.PolyK._PointInTriangle(p[2*vi], p[2*vi+1], ax, ay, bx, by, cx, cy)) { - earFound = false; - break; - } - } - } - - if(earFound) - { - tgs.push(i0, i1, i2); - avl.splice((i+1)%al, 1); - al--; - i = 0; - } - else if(i++ > 3*al) - { - // need to flip flip reverse it! - // reset! - if(sign) - { - tgs = []; - avl = []; - for(i = 0; i < n; i++) avl.push(i); - - i = 0; - al = n; - - sign = false; - } - else - { - // window.console.log("PIXI Warning: shape too complex to fill"); - return null; - } - } - } - - tgs.push(avl[0], avl[1], avl[2]); - return tgs; -}; - -/** - * Checks whether a point is within a triangle - * - * @method _PointInTriangle - * @param px {Number} x coordinate of the point to test - * @param py {Number} y coordinate of the point to test - * @param ax {Number} x coordinate of the a point of the triangle - * @param ay {Number} y coordinate of the a point of the triangle - * @param bx {Number} x coordinate of the b point of the triangle - * @param by {Number} y coordinate of the b point of the triangle - * @param cx {Number} x coordinate of the c point of the triangle - * @param cy {Number} y coordinate of the c point of the triangle - * @private - * @return {Boolean} - */ -PIXI.PolyK._PointInTriangle = function(px, py, ax, ay, bx, by, cx, cy) -{ - var v0x = cx-ax; - var v0y = cy-ay; - var v1x = bx-ax; - var v1y = by-ay; - var v2x = px-ax; - var v2y = py-ay; - - var dot00 = v0x*v0x+v0y*v0y; - var dot01 = v0x*v1x+v0y*v1y; - var dot02 = v0x*v2x+v0y*v2y; - var dot11 = v1x*v1x+v1y*v1y; - var dot12 = v1x*v2x+v1y*v2y; - - var invDenom = 1 / (dot00 * dot11 - dot01 * dot01); - var u = (dot11 * dot02 - dot01 * dot12) * invDenom; - var v = (dot00 * dot12 - dot01 * dot02) * invDenom; - - // Check if point is in triangle - return (u >= 0) && (v >= 0) && (u + v < 1); -}; - -/** - * Checks whether a shape is convex - * - * @method _convex - * @private - * @return {Boolean} - */ -PIXI.PolyK._convex = function(ax, ay, bx, by, cx, cy, sign) -{ - return ((ay-by)*(cx-bx) + (bx-ax)*(cy-by) >= 0) === sign; -}; diff --git a/tutorial-2/pixi.js-master/src/pixi/utils/Utils.js b/tutorial-2/pixi.js-master/src/pixi/utils/Utils.js deleted file mode 100755 index 1a0127d..0000000 --- a/tutorial-2/pixi.js-master/src/pixi/utils/Utils.js +++ /dev/null @@ -1,220 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ -// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating - -// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel - -// MIT license - -/** - * A polyfill for requestAnimationFrame - * You can actually use both requestAnimationFrame and requestAnimFrame, - * you will still benefit from the polyfill - * - * @method requestAnimationFrame - */ - -/** - * A polyfill for cancelAnimationFrame - * - * @method cancelAnimationFrame - */ -(function(window) { - var lastTime = 0; - var vendors = ['ms', 'moz', 'webkit', 'o']; - for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { - window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']; - window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || - window[vendors[x] + 'CancelRequestAnimationFrame']; - } - - if (!window.requestAnimationFrame) { - window.requestAnimationFrame = function(callback) { - var currTime = new Date().getTime(); - var timeToCall = Math.max(0, 16 - (currTime - lastTime)); - var id = window.setTimeout(function() { callback(currTime + timeToCall); }, - timeToCall); - lastTime = currTime + timeToCall; - return id; - }; - } - - if (!window.cancelAnimationFrame) { - window.cancelAnimationFrame = function(id) { - clearTimeout(id); - }; - } - - window.requestAnimFrame = window.requestAnimationFrame; -})(this); - -/** - * Converts a hex color number to an [R, G, B] array - * - * @method hex2rgb - * @param hex {Number} - */ -PIXI.hex2rgb = function(hex) { - return [(hex >> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255]; -}; - -/** - * Converts a color as an [R, G, B] array to a hex number - * - * @method rgb2hex - * @param rgb {Array} - */ -PIXI.rgb2hex = function(rgb) { - return ((rgb[0]*255 << 16) + (rgb[1]*255 << 8) + rgb[2]*255); -}; - -/** - * A polyfill for Function.prototype.bind - * - * @method bind - */ -if (typeof Function.prototype.bind !== 'function') { - Function.prototype.bind = (function () { - return function (thisArg) { - var target = this, i = arguments.length - 1, boundArgs = []; - if (i > 0) - { - boundArgs.length = i; - while (i--) boundArgs[i] = arguments[i + 1]; - } - - if (typeof target !== 'function') throw new TypeError(); - - function bound() { - var i = arguments.length, args = new Array(i); - while (i--) args[i] = arguments[i]; - args = boundArgs.concat(args); - return target.apply(this instanceof bound ? this : thisArg, args); - } - - bound.prototype = (function F(proto) { - if (proto) F.prototype = proto; - if (!(this instanceof F)) return new F(); - })(target.prototype); - - return bound; - }; - })(); -} - -/** - * A wrapper for ajax requests to be handled cross browser - * - * @class AjaxRequest - * @constructor - */ -PIXI.AjaxRequest = function() -{ - var activexmodes = ['Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.3.0', 'Microsoft.XMLHTTP']; //activeX versions to check for in IE - - if (window.ActiveXObject) - { //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken) - for (var i=0; i 0 && (number & (number - 1)) === 0) // see: http://goo.gl/D9kPj - return number; - else - { - var result = 1; - while (result < number) result <<= 1; - return result; - } -}; - -/** - * checks if the given width and height make a power of two texture - * @method isPowerOfTwo - * @param width {Number} - * @param height {Number} - * @return {Boolean} - */ -PIXI.isPowerOfTwo = function(width, height) -{ - return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0); - -}; diff --git a/tutorial-2/pixi.js-master/tasks/karma.js b/tutorial-2/pixi.js-master/tasks/karma.js deleted file mode 100755 index e20aca5..0000000 --- a/tutorial-2/pixi.js-master/tasks/karma.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = function (grunt) { - 'use strict'; - - var path = require('path'); - var server = require('karma').server; - - grunt.registerMultiTask('karma', 'run karma.', function(target) { - //merge data onto options, with data taking precedence - var options = grunt.util._.merge(this.options(), this.data), - done = this.async(); - - if (options.configFile) { - options.configFile = grunt.template.process(options.configFile); - options.configFile = path.resolve(options.configFile); - } - - done = this.async(); - server.start(options, function(code) { - done(!code); - }); - }); -}; diff --git a/tutorial-2/pixi.js-master/test/functional/example-1-basics/bunny.png b/tutorial-2/pixi.js-master/test/functional/example-1-basics/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-2/pixi.js-master/test/functional/example-1-basics/bunny.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/test/functional/example-1-basics/frame-30.png b/tutorial-2/pixi.js-master/test/functional/example-1-basics/frame-30.png deleted file mode 100755 index 96e3409..0000000 Binary files a/tutorial-2/pixi.js-master/test/functional/example-1-basics/frame-30.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/test/functional/example-1-basics/frame-60.png b/tutorial-2/pixi.js-master/test/functional/example-1-basics/frame-60.png deleted file mode 100755 index af3f4ce..0000000 Binary files a/tutorial-2/pixi.js-master/test/functional/example-1-basics/frame-60.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/test/functional/example-1-basics/frame-90.png b/tutorial-2/pixi.js-master/test/functional/example-1-basics/frame-90.png deleted file mode 100755 index 099b823..0000000 Binary files a/tutorial-2/pixi.js-master/test/functional/example-1-basics/frame-90.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/test/functional/example-1-basics/index.js b/tutorial-2/pixi.js-master/test/functional/example-1-basics/index.js deleted file mode 100755 index 2ad32bd..0000000 --- a/tutorial-2/pixi.js-master/test/functional/example-1-basics/index.js +++ /dev/null @@ -1,133 +0,0 @@ -describe('Example 1 - Basics', function () { - 'use strict'; - - var baseUri = '/base/test/functional/example-1-basics'; - var expect = chai.expect; - var currentFrame = 0; - var frameEvents = {}; - var stage; - var renderer; - var bunny; - - function onFrame(frame, callback) { - frameEvents[frame] = callback; - } - - function animate() { - currentFrame += 1; - - window.requestAnimFrame( animate ); - - // just for fun, lets rotate mr rabbit a little - bunny.rotation += 0.1; - - // render the stage - renderer.render(stage); - - if (frameEvents[currentFrame]) - frameEvents[currentFrame](currentFrame); - } - - function initScene() { - // create an new instance of a pixi stage - stage = new PIXI.Stage(0x66FF99); - - // create a renderer instance - renderer = PIXI.autoDetectRenderer(400, 300); - console.log('Is PIXI.WebGLRenderer: ' + (renderer instanceof PIXI.WebGLRenderer)); - - // add the renderer view element to the DOM - document.body.appendChild(renderer.view); - - window.requestAnimFrame( animate ); - - // create a texture from an image path - var texture = PIXI.Texture.fromImage(baseUri + '/bunny.png'); - // create a new Sprite using the texture - bunny = new PIXI.Sprite(texture); - - // center the sprites anchor point - bunny.anchor.x = 0.5; - bunny.anchor.y = 0.5; - - // move the sprite t the center of the screen - bunny.position.x = 200; - bunny.position.y = 150; - - stage.addChild(bunny); - } - - it('assets loaded', function (done) { - var loader = new PIXI.AssetLoader([ - baseUri + '/bunny.png', - baseUri + '/frame-30.png', - baseUri + '/frame-60.png', - baseUri + '/frame-90.png' - ]); - // loader.on('onProgress', function (event) { - // console.log(event.content); - // }); - loader.on('onComplete', function () { - done(); - initScene(); - }); - loader.load(); - }); - - it('frame 30 should match', function (done) { - this.timeout(700); - onFrame(30, function () { - var str = renderer.view.toDataURL('image/png'); - //console.log(''); - resemble(str) - .compareTo(baseUri + '/frame-30.png') - .onComplete(function (data) { - expect(data).to.be.an('object'); - expect(data.isSameDimensions).to.equal(true); - expect(data.misMatchPercentage).to.be.below(0.2); - done(); - }); - }); - }); - - it('frame 60 should match', function (done) { - this.timeout(1200); - onFrame(60, function () { - var str = renderer.view.toDataURL('image/png'); - //console.log(''); - resemble(str) - .compareTo(baseUri + '/frame-60.png') - .onComplete(function (data) { - expect(data).to.be.an('object'); - expect(data.isSameDimensions).to.equal(true); - expect(data.misMatchPercentage).to.be.below(0.2); - done(); - }); - }); - }); - - it('frame 90 should match', function (done) { - this.timeout(1700); - onFrame(90, function () { - var str = renderer.view.toDataURL('image/png'); - //console.log(''); - resemble(str) - .compareTo(baseUri + '/frame-90.png') - .onComplete(function (data) { - expect(data).to.be.an('object'); - expect(data.isSameDimensions).to.equal(true); - expect(data.misMatchPercentage).to.be.below(0.2); - done(); - }); - }); - }); - - // it('capture something', function (done) { - // this.timeout(2000000); - // onFrame(30, function () { - // var img = new Image(); - // img.src = renderer.view.toDataURL('image/png'); - // document.body.appendChild(img); - // }); - // }); -}); diff --git a/tutorial-2/pixi.js-master/test/karma.conf.js b/tutorial-2/pixi.js-master/test/karma.conf.js deleted file mode 100755 index 86715ab..0000000 --- a/tutorial-2/pixi.js-master/test/karma.conf.js +++ /dev/null @@ -1,83 +0,0 @@ -module.exports = function(config) { - config.set({ - - // base path, that will be used to resolve files and exclude - basePath : '../', - - frameworks : ['mocha'], - - // list of files / patterns to load in the browser - files : [ - 'node_modules/chai/chai.js', - 'bin/pixi.dev.js', - 'test/lib/**/*.js', - 'test/unit/**/*.js', - // 'test/functional/**/*.js', - {pattern: 'test/**/*.png', watched: false, included: false, served: true} - ], - - // list of files to exclude - //exclude : [], - - // use dolts reporter, as travis terminal does not support escaping sequences - // possible values: 'dots', 'progress', 'junit', 'teamcity' - // CLI --reporters progress - reporters : ['spec'], - - // web server port - // CLI --port 9876 - port : 9876, - - // cli runner port - // CLI --runner-port 9100 - runnerPort : 9100, - - // enable / disable colors in the output (reporters and logs) - // CLI --colors --no-colors - colors : true, - - // level of logging - // possible values: karma.LOG_DISABLE || karma.LOG_ERROR || karma.LOG_WARN || karma.LOG_INFO || karma.LOG_DEBUG - // CLI --log-level debug - logLevel : config.LOG_INFO, - - // enable / disable watching file and executing tests whenever any file changes - // CLI --auto-watch --no-auto-watch - autoWatch : false, - - // Start these browsers, currently available: - // - Chrome - // - ChromeCanary - // - Firefox - // - Opera - // - Safari (only Mac) - // - PhantomJS - // - IE (only Windows) - // CLI --browsers Chrome,Firefox,Safari - browsers : ['Firefox'], - - // If browser does not capture in given timeout [ms], kill it - // CLI --capture-timeout 60000 - captureTimeout : 60000, - - // Auto run tests on start (when browsers are captured) and exit - // CLI --single-run --no-single-run - singleRun : true, - - // report which specs are slower than 500ms - // CLI --report-slower-than 500 - reportSlowerThan : 500, - - preprocessors : { - // '**/client/js/*.js': 'coverage' - }, - - plugins : [ - 'karma-chrome-launcher', - 'karma-firefox-launcher', - 'karma-mocha', - // 'karma-phantomjs-launcher' - 'karma-spec-reporter' - ] - }); -}; diff --git a/tutorial-2/pixi.js-master/test/lib/pixi/core/Circle.js b/tutorial-2/pixi.js-master/test/lib/pixi/core/Circle.js deleted file mode 100755 index e7cbd4d..0000000 --- a/tutorial-2/pixi.js-master/test/lib/pixi/core/Circle.js +++ /dev/null @@ -1,22 +0,0 @@ -function pixi_core_Circle_confirmNewCircle(obj) { - var expect = chai.expect; - - expect(obj).to.be.an.instanceof(PIXI.Circle); - expect(obj).to.respondTo('clone'); - expect(obj).to.respondTo('contains'); - expect(obj).to.respondTo('getBounds'); - - expect(obj).to.have.property('x', 0); - expect(obj).to.have.property('y', 0); - expect(obj).to.have.property('radius', 0); -} - -function pixi_core_Circle_isBoundedByRectangle(obj, rect) { - var expect = chai.expect; - - expect(rect).to.have.property('x', obj.x - obj.radius); - expect(rect).to.have.property('y', obj.y - obj.radius); - - expect(rect).to.have.property('width', obj.radius * 2); - expect(rect).to.have.property('height', obj.radius * 2); -} diff --git a/tutorial-2/pixi.js-master/test/lib/pixi/core/Matrix.js b/tutorial-2/pixi.js-master/test/lib/pixi/core/Matrix.js deleted file mode 100755 index 77492c2..0000000 --- a/tutorial-2/pixi.js-master/test/lib/pixi/core/Matrix.js +++ /dev/null @@ -1,13 +0,0 @@ -function pixi_core_Matrix_confirmNewMatrix(matrix) { - var expect = chai.expect; - - expect(matrix).to.be.an.instanceof(PIXI.Matrix); - expect(matrix).to.not.be.empty; - - expect(matrix.a).to.equal(1); - expect(matrix.b).to.equal(0); - expect(matrix.c).to.equal(0); - expect(matrix.d).to.equal(1); - expect(matrix.tx).to.equal(0); - expect(matrix.ty).to.equal(0); -} \ No newline at end of file diff --git a/tutorial-2/pixi.js-master/test/lib/pixi/core/Point.js b/tutorial-2/pixi.js-master/test/lib/pixi/core/Point.js deleted file mode 100755 index e5df07b..0000000 --- a/tutorial-2/pixi.js-master/test/lib/pixi/core/Point.js +++ /dev/null @@ -1,10 +0,0 @@ - -function pixi_core_Point_confirm(obj, x, y) { - var expect = chai.expect; - - expect(obj).to.be.an.instanceof(PIXI.Point); - expect(obj).to.respondTo('clone'); - - expect(obj).to.have.property('x', x); - expect(obj).to.have.property('y', y); -} diff --git a/tutorial-2/pixi.js-master/test/lib/pixi/core/Rectangle.js b/tutorial-2/pixi.js-master/test/lib/pixi/core/Rectangle.js deleted file mode 100755 index 23f0d12..0000000 --- a/tutorial-2/pixi.js-master/test/lib/pixi/core/Rectangle.js +++ /dev/null @@ -1,13 +0,0 @@ - -function pixi_core_Rectangle_confirm(obj, x, y, width, height) { - var expect = chai.expect; - - expect(obj).to.be.an.instanceof(PIXI.Rectangle); - expect(obj).to.respondTo('clone'); - expect(obj).to.respondTo('contains'); - - expect(obj).to.have.property('x', x); - expect(obj).to.have.property('y', y); - expect(obj).to.have.property('width', width); - expect(obj).to.have.property('height', height); -} diff --git a/tutorial-2/pixi.js-master/test/lib/pixi/display/DisplayObject.js b/tutorial-2/pixi.js-master/test/lib/pixi/display/DisplayObject.js deleted file mode 100755 index 9ca495e..0000000 --- a/tutorial-2/pixi.js-master/test/lib/pixi/display/DisplayObject.js +++ /dev/null @@ -1,38 +0,0 @@ - -function pixi_display_DisplayObject_confirmNew(obj) { - var expect = chai.expect; - - expect(obj).to.be.an.instanceof(PIXI.DisplayObject); - //expect(obj).to.respondTo('setInteractive'); - //expect(obj).to.respondTo('addFilter'); - //expect(obj).to.respondTo('removeFilter'); - expect(obj).to.respondTo('updateTransform'); - - expect(obj).to.contain.property('position'); - pixi_core_Point_confirm(obj.position, 0, 0); - expect(obj).to.contain.property('scale'); - pixi_core_Point_confirm(obj.scale, 1, 1); - expect(obj).to.contain.property('pivot'); - pixi_core_Point_confirm(obj.pivot, 0, 0); - - expect(obj).to.have.property('rotation', 0); - expect(obj).to.have.property('alpha', 1); - expect(obj).to.have.property('visible', true); - expect(obj).to.have.property('buttonMode', false); - expect(obj).to.have.property('parent', null); - expect(obj).to.have.property('worldAlpha', 1); - - expect(obj).to.have.property('hitArea'); - expect(obj).to.have.property('interactive'); // TODO: Have a better default value - expect('mask' in obj).to.be.true; // TODO: Have a better default value - expect(obj.mask).to.be.null; - - expect(obj).to.have.property('renderable'); - expect(obj).to.have.property('stage'); - - expect(obj).to.have.deep.property('worldTransform'); - pixi_core_Matrix_confirmNewMatrix(obj.worldTransform); - - //expect(obj).to.have.deep.property('color.length', 0); - //expect(obj).to.have.property('dynamic', true); -} diff --git a/tutorial-2/pixi.js-master/test/lib/pixi/display/DisplayObjectContainer.js b/tutorial-2/pixi.js-master/test/lib/pixi/display/DisplayObjectContainer.js deleted file mode 100755 index 58160a9..0000000 --- a/tutorial-2/pixi.js-master/test/lib/pixi/display/DisplayObjectContainer.js +++ /dev/null @@ -1,18 +0,0 @@ - -function pixi_display_DisplayObjectContainer_confirmNew(obj) { - var expect = chai.expect; - - pixi_display_DisplayObject_confirmNew(obj); - - expect(obj).to.be.an.instanceof(PIXI.DisplayObjectContainer); - expect(obj).to.respondTo('addChild'); - expect(obj).to.respondTo('addChildAt'); - expect(obj).to.respondTo('swapChildren'); - expect(obj).to.respondTo('getChildAt'); - expect(obj).to.respondTo('getChildIndex'); - expect(obj).to.respondTo('setChildIndex'); - expect(obj).to.respondTo('removeChild'); - expect(obj).to.respondTo('updateTransform'); - - expect(obj).to.have.deep.property('children.length', 0); -} diff --git a/tutorial-2/pixi.js-master/test/lib/pixi/display/Sprite.js b/tutorial-2/pixi.js-master/test/lib/pixi/display/Sprite.js deleted file mode 100755 index 2288c16..0000000 --- a/tutorial-2/pixi.js-master/test/lib/pixi/display/Sprite.js +++ /dev/null @@ -1,30 +0,0 @@ - -function pixi_display_Sprite_confirmNew(obj, done) { - var expect = chai.expect; - - pixi_display_DisplayObjectContainer_confirmNew(obj); - - expect(obj).to.be.an.instanceof(PIXI.Sprite); - expect(obj).to.respondTo('setTexture'); - expect(obj).to.respondTo('onTextureUpdate'); - - expect(obj).to.have.property('hitArea', null); - expect(obj).to.have.property('interactive', false); - expect(obj).to.have.property('renderable', true); - expect(obj).to.have.property('stage', null); - - expect(obj).to.have.property('anchor'); - pixi_core_Point_confirm(obj.anchor, 0, 0); - - expect(obj).to.have.property('blendMode', PIXI.blendModes.NORMAL); - expect(obj).to.have.property('width', 1); // TODO: is 1 expected - expect(obj).to.have.property('height', 1); // TODO: is 1 expected - - expect(obj).to.have.property('tint', 0xFFFFFF); - - // FIXME: Just make this a boolean that is always there - expect(!!obj.updateFrame).to.equal(obj.texture.baseTexture.hasLoaded); - - expect(obj).to.have.property('texture'); - pixi_textures_Texture_confirmNew(obj.texture, done); -} diff --git a/tutorial-2/pixi.js-master/test/lib/pixi/extras/Strip.js b/tutorial-2/pixi.js-master/test/lib/pixi/extras/Strip.js deleted file mode 100755 index 8927a8a..0000000 --- a/tutorial-2/pixi.js-master/test/lib/pixi/extras/Strip.js +++ /dev/null @@ -1,12 +0,0 @@ - -function pixi_extras_Strip_confirmNew(obj) { - var expect = chai.expect; - - pixi_display_DisplayObjectContainer_confirmNew(obj); - - expect(obj).to.be.an.instanceof(PIXI.Strip); - expect(obj).to.respondTo('setTexture'); - expect(obj).to.respondTo('onTextureUpdate'); - - // TODO: Test properties -} diff --git a/tutorial-2/pixi.js-master/test/lib/pixi/textures/RenderTexture.js b/tutorial-2/pixi.js-master/test/lib/pixi/textures/RenderTexture.js deleted file mode 100755 index 8556501..0000000 --- a/tutorial-2/pixi.js-master/test/lib/pixi/textures/RenderTexture.js +++ /dev/null @@ -1,14 +0,0 @@ - -function pixi_textures_RenderTexture_confirmNew(obj, done) { - var expect = chai.expect; - - expect(obj).to.have.property('width'); - expect(obj).to.have.property('height'); - - expect(obj).to.have.property('render'); - expect(obj).to.have.property('renderer'); - // expect(obj).to.have.property('projection'); - expect(obj).to.have.property('textureBuffer'); - - pixi_textures_Texture_confirmNew(obj, done); -} diff --git a/tutorial-2/pixi.js-master/test/lib/pixi/textures/Texture.js b/tutorial-2/pixi.js-master/test/lib/pixi/textures/Texture.js deleted file mode 100755 index 2493385..0000000 --- a/tutorial-2/pixi.js-master/test/lib/pixi/textures/Texture.js +++ /dev/null @@ -1,26 +0,0 @@ - -function pixi_textures_Texture_confirmNew(obj, done) { - var expect = chai.expect; - - function confirmFrameDone() { - pixi_core_Rectangle_confirm(obj.frame, 0, 0, obj.baseTexture.width, obj.baseTexture.height); - - expect(obj).to.have.property('width', obj.baseTexture.width); - expect(obj).to.have.property('height', obj.baseTexture.height); - done(); - } - - expect(obj).to.be.an.instanceof(PIXI.Texture); - pixi_utils_EventTarget_confirm(obj); - - expect(obj).to.have.property('baseTexture') - .and.to.be.an.instanceof(PIXI.BaseTexture); - - expect(obj).to.have.property('frame'); - if (obj.baseTexture.hasLoaded) { - confirmFrameDone(); - } else { - obj.on('update', confirmFrameDone); - pixi_core_Rectangle_confirm(obj.frame, 0, 0, 1, 1); - } -} diff --git a/tutorial-2/pixi.js-master/test/lib/pixi/utils/EventTarget.js b/tutorial-2/pixi.js-master/test/lib/pixi/utils/EventTarget.js deleted file mode 100755 index a0c3924..0000000 --- a/tutorial-2/pixi.js-master/test/lib/pixi/utils/EventTarget.js +++ /dev/null @@ -1,34 +0,0 @@ - -function pixi_utils_EventTarget_confirm(obj) { - var expect = chai.expect; - - //public API - expect(obj).to.respondTo('listeners'); - expect(obj).to.respondTo('emit'); - expect(obj).to.respondTo('on'); - expect(obj).to.respondTo('once'); - expect(obj).to.respondTo('off'); - expect(obj).to.respondTo('removeAllListeners'); - - //Aliased names - expect(obj).to.respondTo('removeEventListener'); - expect(obj).to.respondTo('addEventListener'); - expect(obj).to.respondTo('dispatchEvent'); -} - -function pixi_utils_EventTarget_Event_confirm(event, obj, data) { - var expect = chai.expect; - - expect(event).to.be.an.instanceOf(PIXI.Event); - - expect(event).to.have.property('stopped', false); - expect(event).to.have.property('stoppedImmediate', false); - - expect(event).to.have.property('target', obj); - expect(event).to.have.property('type', data.type || 'myevent'); - expect(event).to.have.property('data', data); - expect(event).to.have.property('content', data); - - expect(event).to.respondTo('stopPropagation'); - expect(event).to.respondTo('stopImmediatePropagation'); -} \ No newline at end of file diff --git a/tutorial-2/pixi.js-master/test/lib/resemble.js b/tutorial-2/pixi.js-master/test/lib/resemble.js deleted file mode 100755 index 1cb8c29..0000000 --- a/tutorial-2/pixi.js-master/test/lib/resemble.js +++ /dev/null @@ -1,535 +0,0 @@ -/* -Author: James Cryer -Company: Huddle -Last updated date: 21 Feb 2013 -URL: https://github.com/Huddle/Resemble.js -*/ - -(function(_this){ - 'use strict'; - - _this['resemble'] = function( fileData ){ - - var data = {}; - var images = []; - var updateCallbackArray = []; - - var tolerance = { // between 0 and 255 - red: 16, - green: 16, - blue: 16, - minBrightness: 16, - maxBrightness: 240 - }; - - var ignoreAntialiasing = false; - var ignoreColors = false; - - function triggerDataUpdate(){ - var len = updateCallbackArray.length; - var i; - for(i=0;i tolerance.maxBrightness; - } - - function getHue(r,g,b){ - - r = r / 255; - g = g / 255; - b = b / 255; - var max = Math.max(r, g, b), min = Math.min(r, g, b); - var h; - var d; - - if (max == min){ - h = 0; // achromatic - } else{ - d = max - min; - switch(max){ - case r: h = (g - b) / d + (g < b ? 6 : 0); break; - case g: h = (b - r) / d + 2; break; - case b: h = (r - g) / d + 4; break; - } - h /= 6; - } - - return h; - } - - function isAntialiased(sourcePix, data, cacheSet, verticalPos, horizontalPos, width){ - var offset; - var targetPix; - var distance = 1; - var i; - var j; - var hasHighContrastSibling = 0; - var hasSiblingWithDifferentHue = 0; - var hasEquivilantSibling = 0; - - addHueInfo(sourcePix); - - for (i = distance*-1; i <= distance; i++){ - for (j = distance*-1; j <= distance; j++){ - - if(i===0 && j===0){ - // ignore source pixel - } else { - - offset = ((verticalPos+j)*width + (horizontalPos+i)) * 4; - targetPix = getPixelInfo(data, offset, cacheSet); - - if(targetPix === null){ - continue; - } - - addBrightnessInfo(targetPix); - addHueInfo(targetPix); - - if( isContrasting(sourcePix, targetPix) ){ - hasHighContrastSibling++; - } - - if( isRGBSame(sourcePix,targetPix) ){ - hasEquivilantSibling++; - } - - if( Math.abs(targetPix.h - sourcePix.h) > 0.3 ){ - hasSiblingWithDifferentHue++; - } - - if( hasSiblingWithDifferentHue > 1 || hasHighContrastSibling > 1){ - return true; - } - } - } - } - - if(hasEquivilantSibling < 2){ - return true; - } - - return false; - } - - function errorPixel(px, offset){ - px[offset] = 255; //r - px[offset + 1] = 0; //g - px[offset + 2] = 255; //b - px[offset + 3] = 255; //a - } - - function copyPixel(px, offset, data){ - px[offset] = data.r; //r - px[offset + 1] = data.g; //g - px[offset + 2] = data.b; //b - px[offset + 3] = 255; //a - } - - function copyGrayScalePixel(px, offset, data){ - px[offset] = data.brightness; //r - px[offset + 1] = data.brightness; //g - px[offset + 2] = data.brightness; //b - px[offset + 3] = 255; //a - } - - - function getPixelInfo(data, offset, cacheSet){ - var r; - var g; - var b; - var d; - - if(typeof data[offset] !== 'undefined'){ - r = data[offset]; - g = data[offset+1]; - b = data[offset+2]; - d = { - r: r, - g: g, - b: b - }; - - return d; - } else { - return null; - } - } - - function addBrightnessInfo(data){ - data.brightness = getBrightness(data.r,data.g,data.b); // 'corrected' lightness - } - - function addHueInfo(data){ - data.h = getHue(data.r,data.g,data.b); - } - - function analyseImages(img1, img2, width, height){ - - var hiddenCanvas = document.createElement('canvas'); - - var data1 = img1.data; - var data2 = img2.data; - - hiddenCanvas.width = width; - hiddenCanvas.height = height; - - var context = hiddenCanvas.getContext('2d'); - var imgd = context.createImageData(width,height); - var targetPix = imgd.data; - - var mismatchCount = 0; - - var time = Date.now(); - - var skip; - - if( (width > 1200 || height > 1200) && ignoreAntialiasing){ - skip = 6; - } - - loop(height, width, function(verticalPos, horizontalPos){ - - if(skip){ // only skip if the image isn't small - if(verticalPos % skip === 0 || horizontalPos % skip === 0){ - return; - } - } - - var offset = (verticalPos*width + horizontalPos) * 4; - var pixel1 = getPixelInfo(data1, offset, 1); - var pixel2 = getPixelInfo(data2, offset, 2); - - if(pixel1 === null || pixel2 === null){ - return; - } - - if (ignoreColors){ - - addBrightnessInfo(pixel1); - addBrightnessInfo(pixel2); - - if( isPixelBrightnessSimilar(pixel1, pixel2) ){ - copyGrayScalePixel(targetPix, offset, pixel2); - } else { - errorPixel(targetPix, offset); - mismatchCount++; - } - return; - } - - if( isRGBSimilar(pixel1, pixel2) ){ - copyPixel(targetPix, offset, pixel2); - - } else if( ignoreAntialiasing && ( - addBrightnessInfo(pixel1), // jit pixel info augmentation looks a little weird, sorry. - addBrightnessInfo(pixel2), - isAntialiased(pixel1, data1, 1, verticalPos, horizontalPos, width) || - isAntialiased(pixel2, data2, 2, verticalPos, horizontalPos, width) - )){ - - if( isPixelBrightnessSimilar(pixel1, pixel2) ){ - copyGrayScalePixel(targetPix, offset, pixel2); - } else { - errorPixel(targetPix, offset); - mismatchCount++; - } - } else { - errorPixel(targetPix, offset); - mismatchCount++; - } - - }); - - data.misMatchPercentage = (mismatchCount / (height*width) * 100).toFixed(2); - data.analysisTime = Date.now() - time; - - data.getImageDataUrl = function(text){ - var barHeight = 0; - - if(text){ - barHeight = addLabel(text,context,hiddenCanvas); - } - - context.putImageData(imgd, 0, barHeight); - - return hiddenCanvas.toDataURL("image/png"); - }; - } - - function addLabel(text, context, hiddenCanvas){ - var textPadding = 2; - - context.font = '12px sans-serif'; - - var textWidth = context.measureText(text).width + textPadding*2; - var barHeight = 22; - - if(textWidth > hiddenCanvas.width){ - hiddenCanvas.width = textWidth; - } - - hiddenCanvas.height += barHeight; - - context.fillStyle = "#666"; - context.fillRect(0,0,hiddenCanvas.width,barHeight -4); - context.fillStyle = "#fff"; - context.fillRect(0,barHeight -4,hiddenCanvas.width, 4); - - context.fillStyle = "#fff"; - context.textBaseline = "top"; - context.font = '12px sans-serif'; - context.fillText(text, textPadding, 1); - - return barHeight; - } - - function normalise(img, w, h){ - var c; - var context; - - if(img.height < h || img.width < w){ - c = document.createElement('canvas'); - c.width = w; - c.height = h; - context = c.getContext('2d'); - context.putImageData(img, 0, 0); - return context.getImageData(0, 0, w, h); - } - - return img; - } - - function compare(one, two){ - - function onceWeHaveBoth(){ - var width; - var height; - if(images.length === 2){ - width = images[0].width > images[1].width ? images[0].width : images[1].width; - height = images[0].height > images[1].height ? images[0].height : images[1].height; - - if( (images[0].width === images[1].width) && (images[0].height === images[1].height) ){ - data.isSameDimensions = true; - } else { - data.isSameDimensions = false; - } - - analyseImages( normalise(images[0],width, height), normalise(images[1],width, height), width, height); - - triggerDataUpdate(); - } - } - - images = []; - loadImageData(one, onceWeHaveBoth); - loadImageData(two, onceWeHaveBoth); - } - - function getCompareApi(param){ - - var secondFileData, - hasMethod = typeof param === 'function'; - - if( !hasMethod ){ - // assume it's file data - secondFileData = param; - } - - var self = { - ignoreNothing: function(){ - - tolerance.red = 16; - tolerance.green = 16; - tolerance.blue = 16; - tolerance.minBrightness = 16; - tolerance.maxBrightness = 240; - - ignoreAntialiasing = false; - ignoreColors = false; - - if(hasMethod) { param(); } - return self; - }, - ignoreAntialiasing: function(){ - - tolerance.red = 32; - tolerance.green = 32; - tolerance.blue = 32; - tolerance.minBrightness = 64; - tolerance.maxBrightness = 96; - - ignoreAntialiasing = true; - ignoreColors = false; - - if(hasMethod) { param(); } - return self; - }, - ignoreColors: function(){ - - tolerance.minBrightness = 16; - tolerance.maxBrightness = 240; - - ignoreAntialiasing = false; - ignoreColors = true; - - if(hasMethod) { param(); } - return self; - }, - onComplete: function( callback ){ - - updateCallbackArray.push(callback); - - var wrapper = function(){ - compare(fileData, secondFileData); - }; - - wrapper(); - - return getCompareApi(wrapper); - } - }; - - return self; - } - - return { - onComplete: function( callback ){ - updateCallbackArray.push(callback); - loadImageData(fileData, function(imageData, width, height){ - parseImage(imageData.data, width, height); - }); - }, - compareTo: function(secondFileData){ - return getCompareApi(secondFileData); - } - }; - - }; -}(this)); \ No newline at end of file diff --git a/tutorial-2/pixi.js-master/test/textures/SpriteSheet-Aliens.png b/tutorial-2/pixi.js-master/test/textures/SpriteSheet-Aliens.png deleted file mode 100755 index 210acb1..0000000 Binary files a/tutorial-2/pixi.js-master/test/textures/SpriteSheet-Aliens.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/test/textures/SpriteSheet-Explosion.png b/tutorial-2/pixi.js-master/test/textures/SpriteSheet-Explosion.png deleted file mode 100755 index 79e1a69..0000000 Binary files a/tutorial-2/pixi.js-master/test/textures/SpriteSheet-Explosion.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/test/textures/bunny.png b/tutorial-2/pixi.js-master/test/textures/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-2/pixi.js-master/test/textures/bunny.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/InteractionManager.js b/tutorial-2/pixi.js-master/test/unit/pixi/InteractionManager.js deleted file mode 100755 index ed3001f..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/InteractionManager.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/InteractionManager', function () { - 'use strict'; - - var expect = chai.expect; - var InteractionManager = PIXI.InteractionManager; - - it('Module exists', function () { - expect(InteractionManager).to.be.a('function'); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/Pixi.js b/tutorial-2/pixi.js-master/test/unit/pixi/Pixi.js deleted file mode 100755 index 27debc1..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/Pixi.js +++ /dev/null @@ -1,9 +0,0 @@ -describe('pixi/Pixi', function () { - 'use strict'; - - var expect = chai.expect; - - it('Module exists', function () { - expect(global).to.have.property('PIXI').and.to.be.an('object'); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/core/Circle.js b/tutorial-2/pixi.js-master/test/unit/pixi/core/Circle.js deleted file mode 100755 index fbcfa17..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/core/Circle.js +++ /dev/null @@ -1,21 +0,0 @@ -describe('pixi/core/Circle', function () { - 'use strict'; - - var expect = chai.expect; - var Circle = PIXI.Circle; - - it('Module exists', function () { - expect(Circle).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new Circle(); - pixi_core_Circle_confirmNewCircle(obj); - }); - - it("getBounds should return Rectangle that bounds the circle", function() { - var obj = new Circle(100, 250, 50); - var bounds = obj.getBounds(); - pixi_core_Circle_isBoundedByRectangle(obj, bounds); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/core/Ellipse.js b/tutorial-2/pixi.js-master/test/unit/pixi/core/Ellipse.js deleted file mode 100755 index 026b56f..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/core/Ellipse.js +++ /dev/null @@ -1,24 +0,0 @@ -describe('pixi/core/Ellipse', function () { - 'use strict'; - - var expect = chai.expect; - var Ellipse = PIXI.Ellipse; - - it('Module exists', function () { - expect(Ellipse).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new Ellipse(); - - expect(obj).to.be.an.instanceof(Ellipse); - expect(obj).to.respondTo('clone'); - expect(obj).to.respondTo('contains'); - expect(obj).to.respondTo('getBounds'); - - expect(obj).to.have.property('x', 0); - expect(obj).to.have.property('y', 0); - expect(obj).to.have.property('width', 0); - expect(obj).to.have.property('height', 0); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/core/Matrix.js b/tutorial-2/pixi.js-master/test/unit/pixi/core/Matrix.js deleted file mode 100755 index da75e2e..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/core/Matrix.js +++ /dev/null @@ -1,14 +0,0 @@ -describe('pixi/core/Matrix', function () { - 'use strict'; - - var expect = chai.expect; - - it('Matrix exists', function () { - expect(PIXI.Matrix).to.be.an('function'); - }); - - it('Confirm new Matrix', function () { - var matrix = new PIXI.Matrix(); - pixi_core_Matrix_confirmNewMatrix(matrix); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/core/Point.js b/tutorial-2/pixi.js-master/test/unit/pixi/core/Point.js deleted file mode 100755 index c4d5163..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/core/Point.js +++ /dev/null @@ -1,15 +0,0 @@ -describe('pixi/core/Point', function () { - 'use strict'; - - var expect = chai.expect; - var Point = PIXI.Point; - - it('Module exists', function () { - expect(Point).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new Point(); - pixi_core_Point_confirm(obj, 0, 0); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/core/Polygon.js b/tutorial-2/pixi.js-master/test/unit/pixi/core/Polygon.js deleted file mode 100755 index dc8c918..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/core/Polygon.js +++ /dev/null @@ -1,20 +0,0 @@ -describe('pixi/core/Polygon', function () { - 'use strict'; - - var expect = chai.expect; - var Polygon = PIXI.Polygon; - - it('Module exists', function () { - expect(Polygon).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new Polygon(); - - expect(obj).to.be.an.instanceof(Polygon); - expect(obj).to.respondTo('clone'); - expect(obj).to.respondTo('contains'); - - expect(obj).to.have.deep.property('points.length', 0); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/core/Rectangle.js b/tutorial-2/pixi.js-master/test/unit/pixi/core/Rectangle.js deleted file mode 100755 index d43316e..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/core/Rectangle.js +++ /dev/null @@ -1,15 +0,0 @@ -describe('pixi/core/Rectangle', function () { - 'use strict'; - - var expect = chai.expect; - var Rectangle = PIXI.Rectangle; - - it('Module exists', function () { - expect(Rectangle).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var rect = new Rectangle(); - pixi_core_Rectangle_confirm(rect, 0, 0, 0, 0); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/display/DisplayObject.js b/tutorial-2/pixi.js-master/test/unit/pixi/display/DisplayObject.js deleted file mode 100755 index 044acf8..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/display/DisplayObject.js +++ /dev/null @@ -1,21 +0,0 @@ -describe('pixi/display/DisplayObject', function () { - 'use strict'; - - var expect = chai.expect; - var DisplayObject = PIXI.DisplayObject; - - it('Module exists', function () { - expect(DisplayObject).to.be.a('function'); - // expect(PIXI).to.have.property('visibleCount', 0); - }); - - it('Confirm new instance', function () { - var obj = new DisplayObject(); - - pixi_display_DisplayObject_confirmNew(obj); - expect(obj).to.have.property('hitArea', null); - expect(obj).to.have.property('interactive', false); - expect(obj).to.have.property('renderable', false); - expect(obj).to.have.property('stage', null); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/display/DisplayObjectContainer.js b/tutorial-2/pixi.js-master/test/unit/pixi/display/DisplayObjectContainer.js deleted file mode 100755 index 15a3376..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/display/DisplayObjectContainer.js +++ /dev/null @@ -1,67 +0,0 @@ -describe('pixi/display/DisplayObjectContainer', function () { - 'use strict'; - - var expect = chai.expect; - var DisplayObjectContainer = PIXI.DisplayObjectContainer; - - it('Module exists', function () { - expect(DisplayObjectContainer).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new DisplayObjectContainer(); - - pixi_display_DisplayObjectContainer_confirmNew(obj); - expect(obj).to.have.property('hitArea', null); - expect(obj).to.have.property('interactive', false); - expect(obj).to.have.property('renderable', false); - expect(obj).to.have.property('stage', null); - }); - - it('Gets child index', function() { - var container = new PIXI.DisplayObjectContainer(); - var children = []; - for (var i = 0; i < 10; i++) { - var child = new PIXI.DisplayObject(); - children.push(child); - container.addChild(child); - } - - for (i = 0; i < children.length; i++) { - expect(i).to.eql(container.getChildIndex(children[i])); - } - }); - - it('throws error when trying to get index of not a child', function() { - var container = new PIXI.DisplayObjectContainer(); - var child = new PIXI.DisplayObject(); - - expect(function() { container.getChildIndex(child); }).to.throw(); - }); - - it('Sets child index', function() { - var container = new PIXI.DisplayObjectContainer(); - var children = []; - - for (var i = 0; i < 10; i++) { - var child = new PIXI.DisplayObject(); - children.push(child); - container.addChild(child); - } - children.reverse(); - - for (i = 0; i < children.length; i++) { - container.setChildIndex(children[i], i); - expect(i).to.eql(container.getChildIndex(children[i])); - } - }); - - it('throws error when trying to set incorect index', function() { - var container = new PIXI.DisplayObjectContainer(); - var child = new PIXI.DisplayObject(); - container.addChild(child); - - expect(function() { container.setChildIndex(child, -1); }).to.throw(); - expect(function() { container.setChildIndex(child, 1); }).to.throw(); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/display/MovieClip.js b/tutorial-2/pixi.js-master/test/unit/pixi/display/MovieClip.js deleted file mode 100755 index f3c6c6a..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/display/MovieClip.js +++ /dev/null @@ -1,33 +0,0 @@ -describe('pixi/display/MovieClip', function () { - 'use strict'; - - var expect = chai.expect; - var MovieClip = PIXI.MovieClip; - var Texture = PIXI.Texture; - - it('Module exists', function () { - expect(MovieClip).to.be.a('function'); - }); - - it('Confirm new instance', function (done) { - var texture = Texture.fromImage('/base/test/textures/SpriteSheet-Explosion.png'); - var obj = new MovieClip([texture]); - - pixi_display_Sprite_confirmNew(obj, done); - - expect(obj).to.be.an.instanceof(MovieClip); - expect(obj).to.respondTo('stop'); - expect(obj).to.respondTo('play'); - expect(obj).to.respondTo('gotoAndStop'); - expect(obj).to.respondTo('gotoAndPlay'); - expect(obj).to.respondTo('updateTransform'); - - expect(obj).to.have.deep.property('textures.length', 1); - expect(obj).to.have.deep.property('textures[0]', texture); - expect(obj).to.have.property('animationSpeed', 1); - expect(obj).to.have.property('loop', true); - expect(obj).to.have.property('onComplete', null); - expect(obj).to.have.property('currentFrame', 0); - expect(obj).to.have.property('playing', false); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/display/Sprite.js b/tutorial-2/pixi.js-master/test/unit/pixi/display/Sprite.js deleted file mode 100755 index 30c8076..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/display/Sprite.js +++ /dev/null @@ -1,28 +0,0 @@ -describe('pixi/display/Sprite', function () { - 'use strict'; - - var expect = chai.expect; - var Sprite = PIXI.Sprite; - var Texture = PIXI.Texture; - - it('Module exists', function () { - expect(Sprite).to.be.a('function'); - expect(PIXI).to.have.deep.property('blendModes.NORMAL', 0); - expect(PIXI).to.have.deep.property('blendModes.ADD', 1); - expect(PIXI).to.have.deep.property('blendModes.MULTIPLY', 2); - expect(PIXI).to.have.deep.property('blendModes.SCREEN', 3); - }); - - - it('Members exist', function () { - expect(Sprite).itself.to.respondTo('fromImage'); - expect(Sprite).itself.to.respondTo('fromFrame'); - }); - - it('Confirm new instance', function (done) { - var texture = Texture.fromImage('/base/test/textures/SpriteSheet-Aliens.png'); - var obj = new Sprite(texture); - - pixi_display_Sprite_confirmNew(obj, done); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/display/Stage.js b/tutorial-2/pixi.js-master/test/unit/pixi/display/Stage.js deleted file mode 100755 index 6974c2e..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/display/Stage.js +++ /dev/null @@ -1,49 +0,0 @@ -describe('pixi/display/Stage', function () { - 'use strict'; - - var expect = chai.expect; - var Stage = PIXI.Stage; - var InteractionManager = PIXI.InteractionManager; - var Rectangle = PIXI.Rectangle; - - it('Module exists', function () { - expect(Stage).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new Stage(null, true); - - pixi_display_DisplayObjectContainer_confirmNew(obj); - - expect(obj).to.be.an.instanceof(Stage); - expect(obj).to.respondTo('updateTransform'); - expect(obj).to.respondTo('setBackgroundColor'); - expect(obj).to.respondTo('getMousePosition'); - // FIXME: duplicate member in DisplayObject - pixi_core_Matrix_confirmNewMatrix(obj.worldTransform); - // FIXME: convert arg to bool in constructor - expect(obj).to.have.property('interactive', true); - - expect(obj).to.have.property('interactionManager') - .and.to.be.an.instanceof(InteractionManager) - .and.to.have.property('stage', obj); - - expect(obj).to.have.property('dirty', true); - - expect(obj).to.have.property('stage', obj); - - expect(obj).to.have.property('hitArea') - .and.to.be.an.instanceof(Rectangle); - pixi_core_Rectangle_confirm(obj.hitArea, 0, 0, 100000, 100000); - - expect(obj).to.have.property('backgroundColor', 0x000000); - expect(obj).to.have.deep.property('backgroundColorSplit.length', 3); - expect(obj).to.have.deep.property('backgroundColorSplit[0]', 0); - expect(obj).to.have.deep.property('backgroundColorSplit[1]', 0); - expect(obj).to.have.deep.property('backgroundColorSplit[2]', 0); - expect(obj).to.have.property('backgroundColorString', '#000000'); - - - expect(obj).to.have.property('worldVisible', true); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/extras/Rope.js b/tutorial-2/pixi.js-master/test/unit/pixi/extras/Rope.js deleted file mode 100755 index 05885ac..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/extras/Rope.js +++ /dev/null @@ -1,31 +0,0 @@ -describe('pixi/extras/Rope', function () { - 'use strict'; - - var expect = chai.expect; - var Rope = PIXI.Rope; - var Texture = PIXI.Texture; - var Point = PIXI.Point; - - it('Module exists', function () { - expect(Rope).to.be.a('function'); - }); - - it('Confirm new instance', function () { - - var texture = Texture.fromImage('/base/test/textures/bunny.png'); - - // TODO-Alvin - // Same as Strip - - // var obj = new Rope(texture, [new Point(), new Point(5, 10), new Point(10, 20)]); - - // pixi_extras_Strip_confirmNew(obj); - - // expect(obj).to.be.an.instanceof(Rope); - // expect(obj).to.respondTo('refresh'); - // expect(obj).to.respondTo('updateTransform'); - // expect(obj).to.respondTo('setTexture'); - - // TODO: Test properties - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/extras/Spine.js b/tutorial-2/pixi.js-master/test/unit/pixi/extras/Spine.js deleted file mode 100755 index 0708bc0..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/extras/Spine.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/extras/Spine', function () { - 'use strict'; - - var expect = chai.expect; - var Spine = PIXI.Spine; - - it('Module exists', function () { - expect(Spine).to.be.a('function'); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/extras/Strip.js b/tutorial-2/pixi.js-master/test/unit/pixi/extras/Strip.js deleted file mode 100755 index 230af90..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/extras/Strip.js +++ /dev/null @@ -1,26 +0,0 @@ -describe('pixi/extras/Strip', function () { - 'use strict'; - - var expect = chai.expect; - var Strip = PIXI.Strip; - var Texture = PIXI.Texture; - - it('Module exists', function () { - expect(Strip).to.be.a('function'); - }); - - it('Confirm new instance', function () { - - - // TODO-Alvin - // We tweaked it to make it pass the tests, but the whole strip class needs - // to be re-coded - - var texture = Texture.fromImage('/base/test/textures/bunny.png'); - - // var obj = new Strip(texture, 20, 10000); - - - // pixi_extras_Strip_confirmNew(obj); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/extras/TilingSprite.js b/tutorial-2/pixi.js-master/test/unit/pixi/extras/TilingSprite.js deleted file mode 100755 index 56aea14..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/extras/TilingSprite.js +++ /dev/null @@ -1,24 +0,0 @@ -describe('pixi/extras/TilingSprite', function () { - 'use strict'; - - var expect = chai.expect; - var TilingSprite = PIXI.TilingSprite; - var Texture = PIXI.Texture; - - it('Module exists', function () { - expect(TilingSprite).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var texture = Texture.fromImage('/base/test/textures/bunny.png'); - var obj = new TilingSprite(texture, 6000, 12000); - - pixi_display_DisplayObjectContainer_confirmNew(obj); - - expect(obj).to.be.an.instanceof(TilingSprite); - expect(obj).to.respondTo('setTexture'); - expect(obj).to.respondTo('onTextureUpdate'); - - // TODO: Test properties - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/filters/FilterBlock.js b/tutorial-2/pixi.js-master/test/unit/pixi/filters/FilterBlock.js deleted file mode 100755 index 870cec0..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/filters/FilterBlock.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/filters/FilterBlock', function () { - 'use strict'; - - var expect = chai.expect; - var FilterBlock = PIXI.FilterBlock; - - it('Module exists', function () { - expect(FilterBlock).to.be.a('function'); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/loaders/AssetLoader.js b/tutorial-2/pixi.js-master/test/unit/pixi/loaders/AssetLoader.js deleted file mode 100755 index a0aa0b5..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/loaders/AssetLoader.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/loaders/AssetLoader', function () { - 'use strict'; - - var expect = chai.expect; - var AssetLoader = PIXI.AssetLoader; - - it('Module exists', function () { - expect(AssetLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/loaders/BitmapFontLoader.js b/tutorial-2/pixi.js-master/test/unit/pixi/loaders/BitmapFontLoader.js deleted file mode 100755 index 046f018..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/loaders/BitmapFontLoader.js +++ /dev/null @@ -1,9 +0,0 @@ -describe('pixi/loaders/BitmapFontLoader', function () { - 'use strict'; - - var expect = chai.expect; - - it('Module exists', function () { - expect(PIXI.BitmapFontLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/loaders/ImageLoader.js b/tutorial-2/pixi.js-master/test/unit/pixi/loaders/ImageLoader.js deleted file mode 100755 index 8b1f556..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/loaders/ImageLoader.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/loaders/ImageLoader', function () { - 'use strict'; - - var expect = chai.expect; - var ImageLoader = PIXI.ImageLoader; - - it('Module exists', function () { - expect(ImageLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/loaders/JsonLoader.js b/tutorial-2/pixi.js-master/test/unit/pixi/loaders/JsonLoader.js deleted file mode 100755 index c577e83..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/loaders/JsonLoader.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/loaders/JsonLoader', function () { - 'use strict'; - - var expect = chai.expect; - var JsonLoader = PIXI.JsonLoader; - - it('Module exists', function () { - expect(JsonLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/loaders/SpineLoader.js b/tutorial-2/pixi.js-master/test/unit/pixi/loaders/SpineLoader.js deleted file mode 100755 index fdcc0b8..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/loaders/SpineLoader.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/loaders/SpineLoader', function () { - 'use strict'; - - var expect = chai.expect; - var SpineLoader = PIXI.SpineLoader; - - it('Module exists', function () { - expect(SpineLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/loaders/SpriteSheetLoader.js b/tutorial-2/pixi.js-master/test/unit/pixi/loaders/SpriteSheetLoader.js deleted file mode 100755 index 57beb27..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/loaders/SpriteSheetLoader.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/loaders/SpriteSheetLoader', function () { - 'use strict'; - - var expect = chai.expect; - var SpriteSheetLoader = PIXI.SpriteSheetLoader; - - it('Module exists', function () { - expect(SpriteSheetLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/primitives/Graphics.js b/tutorial-2/pixi.js-master/test/unit/pixi/primitives/Graphics.js deleted file mode 100755 index f3849eb..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/primitives/Graphics.js +++ /dev/null @@ -1,44 +0,0 @@ -describe('pixi/primitives/Graphics', function () { - 'use strict'; - - var expect = chai.expect; - var Graphics = PIXI.Graphics; - - it('Module exists', function () { - expect(Graphics).to.be.a('function'); - - expect(Graphics).itself.to.have.property('POLY', 0); - expect(Graphics).itself.to.have.property('RECT', 1); - expect(Graphics).itself.to.have.property('CIRC', 2); - expect(Graphics).itself.to.have.property('ELIP', 3); - expect(Graphics).itself.to.have.property('RREC', 4); - }); - - it('Confirm new instance', function () { - var obj = new Graphics(); - - pixi_display_DisplayObjectContainer_confirmNew(obj); - - expect(obj).to.be.an.instanceof(Graphics); - expect(obj).to.respondTo('lineStyle'); - expect(obj).to.respondTo('lineStyle'); - expect(obj).to.respondTo('moveTo'); - expect(obj).to.respondTo('lineTo'); - expect(obj).to.respondTo('beginFill'); - expect(obj).to.respondTo('endFill'); - expect(obj).to.respondTo('drawRect'); - // expect(obj).to.respondTo('drawRoundedRect'); - expect(obj).to.respondTo('drawCircle'); - expect(obj).to.respondTo('drawEllipse'); - expect(obj).to.respondTo('clear'); - - expect(obj).to.have.property('renderable', true); - expect(obj).to.have.property('fillAlpha', 1); - expect(obj).to.have.property('lineWidth', 0); - expect(obj).to.have.property('width', 0); - expect(obj).to.have.property('height', 0); - expect(obj).to.have.property('lineColor', 0); - expect(obj).to.have.deep.property('graphicsData.length', 0); - // expect(obj).to.have.deep.property('currentPath.points.length', 0); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasGraphics.js b/tutorial-2/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasGraphics.js deleted file mode 100755 index 8f44472..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasGraphics.js +++ /dev/null @@ -1,15 +0,0 @@ -describe('renders/canvas/CanvasGraphics', function () { - 'use strict'; - - var expect = chai.expect; - var CanvasGraphics = PIXI.CanvasGraphics; - - it('Module exists', function () { - expect(CanvasGraphics).to.be.a('function'); - }); - - it('Members exist', function () { - expect(CanvasGraphics).itself.to.respondTo('renderGraphics'); - expect(CanvasGraphics).itself.to.respondTo('renderGraphicsMask'); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasRenderer.js b/tutorial-2/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasRenderer.js deleted file mode 100755 index 1646444..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasRenderer.js +++ /dev/null @@ -1,36 +0,0 @@ -describe('renderers/canvas/CanvasRenderer', function () { - 'use strict'; - - var expect = chai.expect; - var CanvasRenderer = PIXI.CanvasRenderer; - - it('Module exists', function () { - expect(CanvasRenderer).to.be.a('function'); - }); - - describe('.autoResize', function () { - it('Should automatically resize view if enabled', function () { - var renderer = new CanvasRenderer(200, 200, { - autoResize: true - }); - - expect(renderer.view.style.width).to.equal('200px'); - }); - - it('Should not automatically resize view if disabled', function () { - var renderer = new CanvasRenderer(200, 200, { - autoResize: false - }); - - expect(renderer.view.style.width).to.equal(''); - }); - - it('Should not automatically resize view if not specified', function () { - var renderer = new CanvasRenderer(200, 200, { - resolution: 2 - }); - - expect(renderer.view.style.width).to.equal(''); - }); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLGraphics.js b/tutorial-2/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLGraphics.js deleted file mode 100755 index 5867b28..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLGraphics.js +++ /dev/null @@ -1,20 +0,0 @@ -describe('renderers/wegbl/WebGLGraphics', function () { - 'use strict'; - - var expect = chai.expect; - var WebGLGraphics = PIXI.WebGLGraphics; - - it('Module exists', function () { - expect(WebGLGraphics).to.be.a('function'); - }); - - it('Members exist', function () { - expect(WebGLGraphics).itself.to.respondTo('renderGraphics'); - expect(WebGLGraphics).itself.to.respondTo('updateGraphics'); - expect(WebGLGraphics).itself.to.respondTo('buildRectangle'); - expect(WebGLGraphics).itself.to.respondTo('buildRoundedRectangle'); - expect(WebGLGraphics).itself.to.respondTo('buildCircle'); - expect(WebGLGraphics).itself.to.respondTo('buildLine'); - expect(WebGLGraphics).itself.to.respondTo('buildPoly'); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLRenderer.js b/tutorial-2/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLRenderer.js deleted file mode 100755 index 1680a80..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLRenderer.js +++ /dev/null @@ -1,49 +0,0 @@ -describe('renderers/webgl/WebGLRenderer', function () { - 'use strict'; - - var expect = chai.expect; - var WebGLRenderer = PIXI.WebGLRenderer; - - it('Module exists', function () { - expect(WebGLRenderer).to.be.a('function'); - }); - - // Skip tests if WebGL is not available (WebGL not supported in Travis CI) - try { - var renderer = new WebGLRenderer(400, 300, {}); - renderer.destroy(); - } catch (error) { - return; - } - - it('Destroy renderer', function () { - var renderer = new WebGLRenderer(400, 300, {}); - renderer.destroy(); - }); - - describe('.autoResize', function () { - it('Should automatically resize view if enabled', function () { - var renderer = new WebGLRenderer(200, 200, { - autoResize: true - }); - - expect(renderer.view.style.width).to.equal('200px'); - }); - - it('Should not automatically resize view if disabled', function () { - var renderer = new WebGLRenderer(200, 200, { - autoResize: false - }); - - expect(renderer.view.style.width).to.equal(''); - }); - - it('Should not automatically resize view if not specified', function () { - var renderer = new WebGLRenderer(200, 200, { - resolution: 2 - }); - - expect(renderer.view.style.width).to.equal(''); - }); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLShaders.js b/tutorial-2/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLShaders.js deleted file mode 100755 index 6e33e4f..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLShaders.js +++ /dev/null @@ -1,13 +0,0 @@ -describe('renderers/webgl/WebGLShaders', function () { - 'use strict'; - - var expect = chai.expect; - - it('Module members exist', function () { - - expect(PIXI).to.respondTo('CompileVertexShader'); - expect(PIXI).to.respondTo('CompileFragmentShader'); - expect(PIXI).to.respondTo('_CompileShader'); - expect(PIXI).to.respondTo('compileProgram'); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLSpriteBatch.js b/tutorial-2/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLSpriteBatch.js deleted file mode 100755 index e662b63..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLSpriteBatch.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('renderers/webgl/utils/WebGLSpriteBatch', function () { - 'use strict'; - - var expect = chai.expect; - var WebGLSpriteBatch = PIXI.WebGLSpriteBatch; - - it('Module exists', function () { - expect(WebGLSpriteBatch).to.be.a('function'); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/text/BitmapText.js b/tutorial-2/pixi.js-master/test/unit/pixi/text/BitmapText.js deleted file mode 100755 index 9388e3d..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/text/BitmapText.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/text/BitmapText', function () { - 'use strict'; - - var expect = chai.expect; - var BitmapText = PIXI.BitmapText; - - it('Module exists', function () { - expect(BitmapText).to.be.a('function'); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/text/Text.js b/tutorial-2/pixi.js-master/test/unit/pixi/text/Text.js deleted file mode 100755 index 9bc9ac5..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/text/Text.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/text/Text', function () { - 'use strict'; - - var expect = chai.expect; - var Text = PIXI.Text; - - it('Module exists', function () { - expect(Text).to.be.a('function'); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/textures/BaseTexture.js b/tutorial-2/pixi.js-master/test/unit/pixi/textures/BaseTexture.js deleted file mode 100755 index 502b724..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/textures/BaseTexture.js +++ /dev/null @@ -1,11 +0,0 @@ -describe('pixi/textures/BaseTexture', function () { - 'use strict'; - - var expect = chai.expect; - var BaseTexture = PIXI.BaseTexture; - - it('Module exists', function () { - expect(BaseTexture).to.be.a('function'); - expect(PIXI).to.have.property('BaseTextureCache').and.to.be.an('object'); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/textures/RenderTexture.js b/tutorial-2/pixi.js-master/test/unit/pixi/textures/RenderTexture.js deleted file mode 100755 index 96acdb4..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/textures/RenderTexture.js +++ /dev/null @@ -1,15 +0,0 @@ -describe('pixi/textures/RenderTexture', function () { - 'use strict'; - - var expect = chai.expect; - var RenderTexture = PIXI.RenderTexture; - - it('Module exists', function () { - expect(RenderTexture).to.be.a('function'); - }); - - it('Confirm new instance', function (done) { - var texture = new RenderTexture(100, 100, new PIXI.CanvasRenderer()); - pixi_textures_RenderTexture_confirmNew(texture, done); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/textures/Texture.js b/tutorial-2/pixi.js-master/test/unit/pixi/textures/Texture.js deleted file mode 100755 index 090f64d..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/textures/Texture.js +++ /dev/null @@ -1,26 +0,0 @@ -describe('pixi/textures/Texture', function () { - 'use strict'; - - var expect = chai.expect; - var Texture = PIXI.Texture; - - it('Module exists', function () { - expect(Texture).to.be.a('function'); - expect(PIXI).to.have.property('TextureCache').and.to.be.an('object'); - }); - - it('Members exist', function () { - expect(Texture).itself.to.respondTo('fromImage'); - expect(Texture).itself.to.respondTo('fromFrame'); - expect(Texture).itself.to.respondTo('fromCanvas'); - expect(Texture).itself.to.respondTo('addTextureToCache'); - expect(Texture).itself.to.respondTo('removeTextureFromCache'); - - // expect(Texture).itself.to.have.deep.property('frameUpdates.length', 0); - }); - - it('Confirm new instance', function (done) { - var texture = Texture.fromImage('/base/test/textures/bunny.png'); - pixi_textures_Texture_confirmNew(texture, done); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/utils/Detector.js b/tutorial-2/pixi.js-master/test/unit/pixi/utils/Detector.js deleted file mode 100755 index 4cf6008..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/utils/Detector.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/utils/Detector', function () { - 'use strict'; - - var expect = chai.expect; - var autoDetectRenderer = PIXI.autoDetectRenderer; - - it('Module exists', function () { - expect(autoDetectRenderer).to.be.a('function'); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/utils/EventTarget.js b/tutorial-2/pixi.js-master/test/unit/pixi/utils/EventTarget.js deleted file mode 100755 index 1cfc3a4..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/utils/EventTarget.js +++ /dev/null @@ -1,361 +0,0 @@ -describe('pixi/utils/EventTarget', function () { - 'use strict'; - - var expect = chai.expect; - - var Clazz, PClazz, obj, pobj, obj2; - beforeEach(function () { - Clazz = function () {}; - PClazz = function () {}; - - PIXI.EventTarget.mixin(Clazz.prototype); - PIXI.EventTarget.mixin(PClazz.prototype); - - obj = new Clazz(); - obj2 = new Clazz(); - pobj = new PClazz(); - - obj.parent = pobj; - obj2.parent = obj; - }); - - it('Module exists', function () { - expect(PIXI.EventTarget).to.be.an('object'); - }); - - it('Confirm new instance', function () { - pixi_utils_EventTarget_confirm(obj); - }); - - it('simple on/emit case works', function () { - var myData = {}; - - obj.on('myevent', function (event) { - pixi_utils_EventTarget_Event_confirm(event, obj, myData); - }); - - obj.emit('myevent', myData); - }); - - it('simple once case works', function () { - var called = 0; - - obj.once('myevent', function() { called++; }); - - obj.emit('myevent'); - obj.emit('myevent'); - obj.emit('myevent'); - obj.emit('myevent'); - obj.emit('myevent'); - - expect(called).to.equal(1); - }); - - it('simple off case works', function (done) { - function onMyEvent() { - done(new Error('Event listener should not have been called')); - } - - obj.on('myevent', onMyEvent); - obj.off('myevent', onMyEvent); - obj.emit('myevent'); - - done(); - }); - - it('simple propagation case works', function (done) { - var myData = {}; - - pobj.on('myevent', function () { - done(); - }); - - obj.emit('myevent'); - }); - - it('simple stopPropagation case works', function (done) { - var myData = {}; - - pobj.on('myevent', function () { - done(new Error('Event listener should not have been called on the parent element')); - }); - - obj.on('myevent', function (evt) { - evt.stopPropagation(); - }); - - obj.emit('myevent'); - - done(); - }); - - it('simple stopImmediatePropagation case works', function (done) { - var myData = {}; - - pobj.on('myevent', function () { - done(new Error('Event listener should not have been called on the parent')); - }); - - obj.on('myevent', function (evt) { - evt.stopImmediatePropagation(); - }); - - obj.on('myevent', function () { - done(new Error('Event listener should not have been called on the second')); - }); - - obj.emit('myevent'); - - done(); - }); - - it('multiple dispatches work properly', function () { - var called = 0; - - function onMyEvent() { - called++; - } - - obj.on('myevent', onMyEvent); - obj.emit('myevent'); - obj.emit('myevent'); - obj.emit('myevent'); - obj.emit('myevent'); - - expect(called).to.equal(4); - }); - - it('multiple events work properly', function () { - var called = 0; - - function onMyEvent() { - called++; - } - - obj.on('myevent1', onMyEvent); - obj.on('myevent2', onMyEvent); - obj.on('myevent3', onMyEvent); - obj.emit('myevent1'); - obj.emit('myevent2'); - obj.emit('myevent3'); - - expect(called).to.equal(3); - }); - - it('multiple events one removed works properly', function () { - var called = 0; - - function onMyEvent() { - called++; - } - - obj.on('myevent1', onMyEvent); - obj.on('myevent2', onMyEvent); - obj.on('myevent3', onMyEvent); - - obj.emit('myevent1'); - obj.emit('myevent2'); - obj.emit('myevent3'); - - obj.off('myevent2', onMyEvent); - - obj.emit('myevent1'); - obj.emit('myevent2'); - obj.emit('myevent3'); - - expect(called).to.equal(5); - }); - - it('multiple handlers for one event with some removed', function () { - var called = 0; - - var onMyEvent = function () { - called++; - }, - onMyEvent2 = function () { - called++; - }; - - // add 2 handlers and confirm they both get called - obj.on('myevent', onMyEvent); - obj.on('myevent', onMyEvent); - obj.on('myevent', onMyEvent2); - obj.on('myevent', onMyEvent2); - - obj.emit('myevent'); - - expect(called).to.equal(4); - - // remove one of the handlers, emit again, then ensure 1 more call is made - obj.off('myevent', onMyEvent); - - obj.emit('myevent'); - - expect(called).to.equal(6); - }); - - it('calls to off without a handler do nothing', function () { - var called = 0; - - var onMyEvent = function () { - called++; - }; - - obj.on('myevent', onMyEvent); - obj.on('myevent', onMyEvent); - - obj.emit('myevent'); - - expect(called).to.equal(2); - - obj.off('myevent'); - - obj.emit('myevent'); - - expect(called).to.equal(4); - - obj.off('myevent', onMyEvent); - - obj.emit('myevent'); - - expect(called).to.equal(4); - }); - - it('handles multiple instances with the same prototype', function () { - var called = 0; - - function onMyEvent(e) { - called++; - } - - obj.on('myevent1', onMyEvent); - obj.on('myevent2', onMyEvent); - - obj2.istwo = true; - obj2.on('myevent1', onMyEvent); - obj2.on('myevent2', onMyEvent); - - obj.emit('myevent1'); - obj.emit('myevent2'); - obj2.emit('myevent1'); - obj2.emit('myevent2'); - - //we emit 4 times, but since obj2 is a child of obj the event should bubble - //up to obj and show up there as well. So the obj2.emit() calls each increment - //the counter twice. - expect(called).to.equal(6); - }); - - it('is backwards compatible with older .dispatchEvent({})', function () { - var called = 0, - data = { - some: 'thing', - hello: true - }; - - function onMyEvent(event) { - pixi_utils_EventTarget_Event_confirm(event, obj, data); - - called++; - } - - obj.on('myevent1', onMyEvent); - obj.on('myevent2', onMyEvent); - obj.on('myevent3', onMyEvent); - - data.type = 'myevent1'; - obj.emit(data); - - data.type = 'myevent2'; - obj.emit(data); - - data.type = 'myevent3'; - obj.emit(data); - - obj.off('myevent2', onMyEvent); - - data.type = 'myevent1'; - obj.emit(data); - - data.type = 'myevent2'; - obj.emit(data); - - data.type = 'myevent3'; - obj.emit(data); - - expect(called).to.equal(5); - }); - - it('is backwards compatible with older .call(this)', function () { - var Fn = function() { - PIXI.EventTarget.call(this); - }, - o = new Fn(); - - pixi_utils_EventTarget_confirm(o); - }); - - it('is backwards compatible with older .addEventListener("")', function () { - var called = 0, - data = { - some: 'thing', - hello: true - }; - - function onMyEvent(event) { - pixi_utils_EventTarget_Event_confirm(event, obj, data); - - called++; - } - - obj.addEventListener('myevent1', onMyEvent); - obj.addEventListener('myevent2', onMyEvent); - obj.addEventListener('myevent3', onMyEvent); - - data.type = 'myevent1'; - obj.emit(data); - - data.type = 'myevent2'; - obj.emit(data); - - data.type = 'myevent3'; - obj.emit(data); - - obj.off('myevent2', onMyEvent); - - data.type = 'myevent1'; - obj.emit(data); - - data.type = 'myevent2'; - obj.emit(data); - - data.type = 'myevent3'; - obj.emit(data); - - expect(called).to.equal(5); - }); - - it('event remove during emit call properly', function () { - var called = 0; - - function cb1() { - called++; - obj.off('myevent', cb1); - } - function cb2() { - called++; - obj.off('myevent', cb2); - } - function cb3() { - called++; - obj.off('myevent', cb3); - } - - obj.on('myevent', cb1); - obj.on('myevent', cb2); - obj.on('myevent', cb3); - obj.emit('myevent', ''); - - expect(called).to.equal(3); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/utils/Polyk.js b/tutorial-2/pixi.js-master/test/unit/pixi/utils/Polyk.js deleted file mode 100755 index dfc7128..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/utils/Polyk.js +++ /dev/null @@ -1,14 +0,0 @@ -describe('pixi/utils/Polyk', function () { - 'use strict'; - - var expect = chai.expect; - var PolyK = PIXI.PolyK; - - it('Module exists', function () { - expect(PolyK).to.be.an('object'); - }); - - it('Members exist', function () { - expect(PolyK).to.respondTo('Triangulate'); - }); -}); diff --git a/tutorial-2/pixi.js-master/test/unit/pixi/utils/Utils.js b/tutorial-2/pixi.js-master/test/unit/pixi/utils/Utils.js deleted file mode 100755 index c97b3c6..0000000 --- a/tutorial-2/pixi.js-master/test/unit/pixi/utils/Utils.js +++ /dev/null @@ -1,17 +0,0 @@ -describe('Utils', function () { - 'use strict'; - - var expect = chai.expect; - - it('requestAnimationFrame exists', function () { - expect(global).to.respondTo('requestAnimationFrame'); - }); - - it('cancelAnimationFrame exists', function () { - expect(global).to.respondTo('cancelAnimationFrame'); - }); - - it('requestAnimFrame exists', function () { - expect(global).to.respondTo('requestAnimFrame'); - }); -}); diff --git a/tutorial-2/pixi.js-master/trim/SpriteSheet.json b/tutorial-2/pixi.js-master/trim/SpriteSheet.json deleted file mode 100755 index 978c2f2..0000000 --- a/tutorial-2/pixi.js-master/trim/SpriteSheet.json +++ /dev/null @@ -1,228 +0,0 @@ -{"frames": { - -"Explosion_Sequence_A 1.png": -{ - "frame": {"x":244,"y":1454,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 10.png": -{ - "frame": {"x":244,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 11.png": -{ - "frame": {"x":2,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 12.png": -{ - "frame": {"x":728,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 13.png": -{ - "frame": {"x":486,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 14.png": -{ - "frame": {"x":244,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 15.png": -{ - "frame": {"x":2,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 16.png": -{ - "frame": {"x":728,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 17.png": -{ - "frame": {"x":486,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 18.png": -{ - "frame": {"x":244,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 19.png": -{ - "frame": {"x":2,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 2.png": -{ - "frame": {"x":728,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 20.png": -{ - "frame": {"x":728,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 21.png": -{ - "frame": {"x":486,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 22.png": -{ - "frame": {"x":244,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 23.png": -{ - "frame": {"x":2,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 24.png": -{ - "frame": {"x":728,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 25.png": -{ - "frame": {"x":486,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 26.png": -{ - "frame": {"x":244,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 27.png": -{ - "frame": {"x":2,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 3.png": -{ - "frame": {"x":486,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 4.png": -{ - "frame": {"x":244,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 5.png": -{ - "frame": {"x":2,"y":1696,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 6.png": -{ - "frame": {"x":2,"y":1454,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 7.png": -{ - "frame": {"x":2,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 8.png": -{ - "frame": {"x":728,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 9.png": -{ - "frame": {"x":486,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}}, -"meta": { - "app": "http://www.texturepacker.com", - "version": "1.0", - "image": "SpriteSheet.png", - "format": "RGBA8888", - "size": {"w":1024,"h":2048}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:17e4a2d92ff3e27832c3f4938cec7c85$" -} -} diff --git a/tutorial-2/pixi.js-master/trim/SpriteSheet.png b/tutorial-2/pixi.js-master/trim/SpriteSheet.png deleted file mode 100755 index 79e1a69..0000000 Binary files a/tutorial-2/pixi.js-master/trim/SpriteSheet.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/trim/SpriteSheetTrimmed.json b/tutorial-2/pixi.js-master/trim/SpriteSheetTrimmed.json deleted file mode 100755 index 7f9dd6a..0000000 --- a/tutorial-2/pixi.js-master/trim/SpriteSheetTrimmed.json +++ /dev/null @@ -1,228 +0,0 @@ -{"frames": { - -"TExplosion_Sequence_A 1.png": -{ - "frame": {"x":436,"y":1636,"w":204,"h":182}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":32,"y":38,"w":204,"h":182}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 10.png": -{ - "frame": {"x":2,"y":728,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 11.png": -{ - "frame": {"x":226,"y":486,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 12.png": -{ - "frame": {"x":2,"y":2,"w":224,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":16,"y":0,"w":224,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 13.png": -{ - "frame": {"x":2,"y":970,"w":224,"h":234}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":16,"y":0,"w":224,"h":234}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 14.png": -{ - "frame": {"x":2,"y":1206,"w":224,"h":220}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":16,"y":0,"w":224,"h":220}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 15.png": -{ - "frame": {"x":228,"y":1190,"w":216,"h":214}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":216,"h":214}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 16.png": -{ - "frame": {"x":228,"y":970,"w":216,"h":218}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":216,"h":218}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 17.png": -{ - "frame": {"x":2,"y":1428,"w":222,"h":220}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":220}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 18.png": -{ - "frame": {"x":440,"y":1416,"w":210,"h":218}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":210,"h":218}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 19.png": -{ - "frame": {"x":228,"y":1406,"w":210,"h":220}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":19,"y":0,"w":210,"h":220}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 2.png": -{ - "frame": {"x":2,"y":1650,"w":218,"h":198}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":22,"w":218,"h":198}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 20.png": -{ - "frame": {"x":226,"y":1628,"w":208,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":208,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 21.png": -{ - "frame": {"x":446,"y":1214,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 22.png": -{ - "frame": {"x":446,"y":1012,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 23.png": -{ - "frame": {"x":448,"y":810,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 24.png": -{ - "frame": {"x":450,"y":608,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 25.png": -{ - "frame": {"x":450,"y":406,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 26.png": -{ - "frame": {"x":452,"y":204,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 27.png": -{ - "frame": {"x":452,"y":2,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 3.png": -{ - "frame": {"x":442,"y":1820,"w":208,"h":196}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":19,"y":22,"w":208,"h":196}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 4.png": -{ - "frame": {"x":222,"y":1830,"w":218,"h":196}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":22,"w":218,"h":196}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 5.png": -{ - "frame": {"x":226,"y":728,"w":220,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":19,"y":0,"w":220,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 6.png": -{ - "frame": {"x":2,"y":486,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 7.png": -{ - "frame": {"x":226,"y":244,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 8.png": -{ - "frame": {"x":2,"y":244,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 9.png": -{ - "frame": {"x":228,"y":2,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}}, -"meta": { - "app": "http://www.codeandweb.com/texturepacker ", - "version": "1.0", - "image": "SpriteSheetTrimmed.png", - "format": "RGBA8888", - "size": {"w":654,"h":2028}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:6ba345a190bfe2d62301a49ce8112726:aaa6f60c39d4c316b8ed9667f27805ca:b0c0aa18e0b197cfe7bc02a7377aa72f$" -} -} diff --git a/tutorial-2/pixi.js-master/trim/SpriteSheetTrimmed.png b/tutorial-2/pixi.js-master/trim/SpriteSheetTrimmed.png deleted file mode 100755 index 9214f71..0000000 Binary files a/tutorial-2/pixi.js-master/trim/SpriteSheetTrimmed.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/trim/bikkuriman.png b/tutorial-2/pixi.js-master/trim/bikkuriman.png deleted file mode 100755 index 3bc5592..0000000 Binary files a/tutorial-2/pixi.js-master/trim/bikkuriman.png and /dev/null differ diff --git a/tutorial-2/pixi.js-master/trim/index.html b/tutorial-2/pixi.js-master/trim/index.html deleted file mode 100755 index d051dfa..0000000 --- a/tutorial-2/pixi.js-master/trim/index.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - Pixi Trim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Test 1

    -

    Test 2

    -

    Test 3

    - - - diff --git a/tutorial-2/pixi.js-master/trim/index2.html b/tutorial-2/pixi.js-master/trim/index2.html deleted file mode 100755 index 4276c57..0000000 --- a/tutorial-2/pixi.js-master/trim/index2.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - Pixi Trim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Test 1

    -

    Test 2

    -

    Test 3

    - - - diff --git a/tutorial-2/pixi.js-master/trim/index3.html b/tutorial-2/pixi.js-master/trim/index3.html deleted file mode 100755 index 1a506b3..0000000 --- a/tutorial-2/pixi.js-master/trim/index3.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - Pixi Trim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Test 1

    -

    Test 2

    -

    Test 3

    - - - diff --git a/tutorial-3/Far.js b/tutorial-3/Far.js index 2eea607..75da552 100755 --- a/tutorial-3/Far.js +++ b/tutorial-3/Far.js @@ -1,6 +1,6 @@ function Far() { var texture = PIXI.Texture.fromImage("resources/bg-far.png"); - PIXI.TilingSprite.call(this, texture, 512, 256); + PIXI.extras.TilingSprite.call(this, texture, 512, 256); this.position.x = 0; this.position.y = 0; @@ -10,8 +10,7 @@ function Far() { this.viewportX = 0; } -Far.constructor = Far; -Far.prototype = Object.create(PIXI.TilingSprite.prototype); +Far.prototype = Object.create(PIXI.extras.TilingSprite.prototype); Far.DELTA_X = 0.128; diff --git a/tutorial-3/Main.js b/tutorial-3/Main.js index 8e16685..70ab66f 100755 --- a/tutorial-3/Main.js +++ b/tutorial-3/Main.js @@ -1,6 +1,6 @@ function Main() { - this.stage = new PIXI.Stage(0x66FF99); - this.renderer = new PIXI.autoDetectRenderer( + this.stage = new PIXI.Container(); + this.renderer = PIXI.autoDetectRenderer( 512, 384, {view:document.getElementById("game-canvas")} @@ -14,17 +14,19 @@ Main.SCROLL_SPEED = 5; Main.prototype.update = function() { this.scroller.moveViewportXBy(Main.SCROLL_SPEED); this.renderer.render(this.stage); - requestAnimFrame(this.update.bind(this)); + requestAnimationFrame(this.update.bind(this)); }; Main.prototype.loadSpriteSheet = function() { - var assetsToLoad = ["resources/wall.json", "resources/bg-mid.png", "resources/bg-far.png"]; - loader = new PIXI.AssetLoader(assetsToLoad); - loader.onComplete = this.spriteSheetLoaded.bind(this); + var loader = PIXI.loader; + loader.add("wall", "resources/wall.json"); + loader.add("bg-mid", "resources/bg-mid.png"); + loader.add("bg-far", "resources/bg-far.png"); + loader.once("complete", this.spriteSheetLoaded.bind(this)); loader.load(); }; Main.prototype.spriteSheetLoaded = function() { this.scroller = new Scroller(this.stage); - requestAnimFrame(this.update.bind(this)); + requestAnimationFrame(this.update.bind(this)); }; diff --git a/tutorial-3/Mid.js b/tutorial-3/Mid.js index e7d9451..4b24730 100755 --- a/tutorial-3/Mid.js +++ b/tutorial-3/Mid.js @@ -1,6 +1,6 @@ function Mid() { var texture = PIXI.Texture.fromImage("resources/bg-mid.png"); - PIXI.TilingSprite.call(this, texture, 512, 256); + PIXI.extras.TilingSprite.call(this, texture, 512, 256); this.position.x = 0; this.position.y = 128; @@ -10,8 +10,7 @@ function Mid() { this.viewportX = 0; } -Mid.constructor = Mid; -Mid.prototype = Object.create(PIXI.TilingSprite.prototype); +Mid.prototype = Object.create(PIXI.extras.TilingSprite.prototype); Mid.DELTA_X = 0.64; diff --git a/tutorial-3/index.html b/tutorial-3/index.html index c4b62b8..571a325 100755 --- a/tutorial-3/index.html +++ b/tutorial-3/index.html @@ -11,7 +11,7 @@
    - + diff --git a/tutorial-3/pixi.js-master/.editorconfig b/tutorial-3/pixi.js-master/.editorconfig deleted file mode 100755 index 347b5a2..0000000 --- a/tutorial-3/pixi.js-master/.editorconfig +++ /dev/null @@ -1,11 +0,0 @@ -; This file is for unifying the coding style for different editors and IDEs. -; More information at http://EditorConfig.org -root = true - -[**.js] -indent_style = space -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true diff --git a/tutorial-3/pixi.js-master/.gitignore b/tutorial-3/pixi.js-master/.gitignore deleted file mode 100755 index 52d83ed..0000000 --- a/tutorial-3/pixi.js-master/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -node_modules -.DS_Store -.project -*.sublime-* -*.log - -bin/pixi.dev.js.map diff --git a/tutorial-3/pixi.js-master/.jshintrc b/tutorial-3/pixi.js-master/.jshintrc deleted file mode 100755 index 08babe8..0000000 --- a/tutorial-3/pixi.js-master/.jshintrc +++ /dev/null @@ -1,127 +0,0 @@ -{ - // -------------------------------------------------------------------- - // JSHint Configuration - // -------------------------------------------------------------------- - // - // @author Chad Engler - - // == Enforcing Options =============================================== - // - // These options tell JSHint to be more strict towards your code. Use - // them if you want to allow only a safe subset of JavaScript, very - // useful when your codebase is shared with a big number of developers - // with different skill levels. - - "bitwise" : false, // Disallow bitwise operators (&, |, ^, etc.). - "camelcase" : true, // Force all variable names to use either camelCase or UPPER_CASE. - "curly" : false, // Require {} for every new block or scope. - "eqeqeq" : true, // Require triple equals i.e. `===`. - "es3" : false, // Enforce conforming to ECMAScript 3. - "forin" : false, // Disallow `for in` loops without `hasOwnPrototype`. - "immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );` - "indent" : 4, // Require that 4 spaces are used for indentation. - "latedef" : true, // Prohibit variable use before definition. - "newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`. - "noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`. - "noempty" : true, // Prohibit use of empty blocks. - "nonew" : true, // Prohibit use of constructors for side-effects. - "plusplus" : false, // Disallow use of `++` & `--`. - "quotmark" : true, // Force consistency when using quote marks. - "undef" : true, // Require all non-global variables be declared before they are used. - "unused" : true, // Warn when varaibles are created by not used. - "strict" : false, // Require `use strict` pragma in every file. - "trailing" : true, // Prohibit trailing whitespaces. - "maxparams" : 8, // Prohibit having more than X number of params in a function. - "maxdepth" : 8, // Prohibit nested blocks from going more than X levels deep. - "maxstatements" : false, // Restrict the number of statements in a function. - "maxcomplexity" : false, // Restrict the cyclomatic complexity of the code. - "maxlen" : 220, // Require that all lines are 100 characters or less. - "globals" : { // Register globals that are used in the code. - //commonjs globals - "module": false, - "require": false, - - // PIXI globals - "PIXI": false, - "spine": false, - - //chai globals - "chai": false, - - //mocha globals - "describe": false, - "it": false, - - //resemble globals - "resemble": false - }, - - // == Relaxing Options ================================================ - // - // These options allow you to suppress certain types of warnings. Use - // them only if you are absolutely positive that you know what you are - // doing. - - "asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons). - "boss" : true, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments. - "debug" : false, // Allow debugger statements e.g. browser breakpoints. - "eqnull" : false, // Tolerate use of `== null`. - "esnext" : false, // Allow ES.next specific features such as `const` and `let`. - "evil" : false, // Tolerate use of `eval`. - "expr" : false, // Tolerate `ExpressionStatement` as Programs. - "funcscope" : false, // Tolerate declarations of variables inside of control structures while accessing them later from the outside. - "globalstrict" : false, // Allow global "use strict" (also enables 'strict'). - "iterator" : false, // Allow usage of __iterator__ property. - "lastsemic" : false, // Tolerate missing semicolons when the it is omitted for the last statement in a one-line block. - "laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons. - "laxcomma" : false, // Suppress warnings about comma-first coding style. - "loopfunc" : false, // Allow functions to be defined within loops. - "moz" : false, // Code that uses Mozilla JS extensions will set this to true - "multistr" : false, // Tolerate multi-line strings. - "proto" : false, // Tolerate __proto__ property. This property is deprecated. - "scripturl" : false, // Tolerate script-targeted URLs. - "smarttabs" : false, // Tolerate mixed tabs and spaces when the latter are used for alignmnent only. - "shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`. - "sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`. - "supernew" : false, // Tolerate `new function () { ... };` and `new Object;`. - "validthis" : false, // Tolerate strict violations when the code is running in strict mode and you use this in a non-constructor function. - - // == Environments ==================================================== - // - // These options pre-define global variables that are exposed by - // popular JavaScript libraries and runtime environments—such as - // browser or node.js. - - "browser" : true, // Standard browser globals e.g. `window`, `document`. - "couch" : false, // Enable globals exposed by CouchDB. - "devel" : false, // Allow development statements e.g. `console.log();`. - "dojo" : false, // Enable globals exposed by Dojo Toolkit. - "jquery" : false, // Enable globals exposed by jQuery JavaScript library. - "mootools" : false, // Enable globals exposed by MooTools JavaScript framework. - "node" : false, // Enable globals available when code is running inside of the NodeJS runtime environment. (for Gruntfile) - "nonstandard" : false, // Define non-standard but widely adopted globals such as escape and unescape. - "prototypejs" : false, // Enable globals exposed by Prototype JavaScript framework. - "rhino" : false, // Enable globals available when your code is running inside of the Rhino runtime environment. - "worker" : false, // Enable globals available when your code is running as a WebWorker. - "wsh" : false, // Enable globals available when your code is running as a script for the Windows Script Host. - "yui" : false, // Enable globals exposed by YUI library. - - // == JSLint Legacy =================================================== - // - // These options are legacy from JSLint. Aside from bug fixes they will - // not be improved in any way and might be removed at any point. - - "nomen" : false, // Prohibit use of initial or trailing underbars in names. - "onevar" : false, // Allow only one `var` statement per function. - "passfail" : false, // Stop on first error. - "white" : false, // Check against strict whitespace and indentation rules. - - // == Undocumented Options ============================================ - // - // While I've found these options in some projects, they are not - // described in the [JSHint Options documentation][4]. - // - // [4]: http://www.jshint.com/options/ - - "maxerr" : 100 // Maximum errors before stopping. -} diff --git a/tutorial-3/pixi.js-master/.travis.yml b/tutorial-3/pixi.js-master/.travis.yml deleted file mode 100755 index 1c60690..0000000 --- a/tutorial-3/pixi.js-master/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: node_js -node_js: - - "0.10" - -branches: - only: - - master - - dev - -install: - - npm install grunt-cli - - npm install - -cache: - directories: - - node_modules - -before_script: - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start - -script: - - ./node_modules/.bin/grunt travis \ No newline at end of file diff --git a/tutorial-3/pixi.js-master/CONTRIBUTING.md b/tutorial-3/pixi.js-master/CONTRIBUTING.md deleted file mode 100755 index ddf5029..0000000 --- a/tutorial-3/pixi.js-master/CONTRIBUTING.md +++ /dev/null @@ -1,62 +0,0 @@ -# How to contribute - -It is essential to the development of pixi.js that the community is empowered -to make changes and get them into the library. Here are some guidlines to make -that process silky smooth for all involved. - -## Reporting issues - -To report a bug, request a feature, or even ask a question, make use of the GitHub Issues -section for [pixi.js][0]. When submitting an issue please take the following steps: - -1. **Seach for existing issues.** Your question or bug may have already been answered or fixed, -be sure to search the issues first before putting in a duplicate issue. - -2. **Create an isolated and reproducible test case.** If you are reporting a bug, make sure you -also have a minimal, runnable, code example that reproduces the problem you have. - -3. **Include a live example.** After narrowing your code down to only the problem areas, make use -of [jsFiddle][1], [jsBin][2], or a link to your live site so that we can view a live example of the problem. - -4. **Share as much information as possible.** Include browser version affected, your OS, version of -the library, steps to reproduce, etc. "X isn't working!!!1!" will probably just be closed. - - -## Making Changes - -To setup for making changes you will need node.js, and grunt installed. You can download node.js -from [nodejs.org][3]. After it has been installed open a console and run `npm i -g grunt-cli` to -install the global `grunt` executable. - -After that you can clone the pixi.js repository, and run `npm i` inside the cloned folder. -This will install dependencies necessary for building the project. Once that is ready, make your -changes and submit a Pull Request. When submitting a PR follow these guidlines: - -- **Send Pull Requests to the `dev` branch.** All Pull Requests must be sent to the `dev` branch, -`master` is the latest release and PRs to that branch will be closed. - -- **Ensure changes are jshint validated.** After making a change be sure to run the build process -to ensure that you didn't break anything. You can do this with `grunt && grunt test` which will run -jshint, rebuild, then run the test suite. - -- **Never commit new builds.** When making a code change, you should always run `grunt` which will -rebuild the project, *however* please do not commit these new builds or your PR will be closed. - -- **Only commit relevant changes.** Don't include changes that are not directly relevant to the fix -you are making. The more focused a PR is, the faster it will get attention and be merged. Extra files -changing only whitespace or trash files will likely get your PR closed. - -## Quickie Code Style Guide - -- Use 4 spaces for tabs, never tab characters. - -- No trailing whitespace, blank lines should have no whitespace. - -- Always favor strict equals `===` unless you *need* to use type coercion. - -- Follow conventions already in the code, and listen to jshint. - -[0]: https://github.com/GoodBoyDigital/pixi.js/issues -[1]: http://jsfiddle.net -[2]: http://jsbin.com/ -[3]: http://nodejs.org \ No newline at end of file diff --git a/tutorial-3/pixi.js-master/Gruntfile.js b/tutorial-3/pixi.js-master/Gruntfile.js deleted file mode 100755 index dda4a9e..0000000 --- a/tutorial-3/pixi.js-master/Gruntfile.js +++ /dev/null @@ -1,227 +0,0 @@ -module.exports = function(grunt) { - grunt.loadNpmTasks('grunt-concat-sourcemap'); - grunt.loadNpmTasks('grunt-contrib-concat'); - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-contrib-connect'); - grunt.loadNpmTasks('grunt-contrib-yuidoc'); - grunt.loadNpmTasks('grunt-contrib-watch'); - - grunt.loadTasks('tasks'); - - var srcFiles = [ - '<%= dirs.src %>/Intro.js', - '<%= dirs.src %>/Pixi.js', - '<%= dirs.src %>/geom/Point.js', - '<%= dirs.src %>/geom/Rectangle.js', - '<%= dirs.src %>/geom/Polygon.js', - '<%= dirs.src %>/geom/Circle.js', - '<%= dirs.src %>/geom/Ellipse.js', - '<%= dirs.src %>/geom/RoundedRectangle.js', - '<%= dirs.src %>/geom/Matrix.js', - '<%= dirs.src %>/display/DisplayObject.js', - '<%= dirs.src %>/display/DisplayObjectContainer.js', - '<%= dirs.src %>/display/Sprite.js', - '<%= dirs.src %>/display/SpriteBatch.js', - '<%= dirs.src %>/display/MovieClip.js', - '<%= dirs.src %>/filters/FilterBlock.js', - '<%= dirs.src %>/text/Text.js', - '<%= dirs.src %>/text/BitmapText.js', - '<%= dirs.src %>/InteractionData.js', - '<%= dirs.src %>/InteractionManager.js', - '<%= dirs.src %>/display/Stage.js', - '<%= dirs.src %>/utils/Utils.js', - '<%= dirs.src %>/utils/EventTarget.js', - '<%= dirs.src %>/utils/Detector.js', - '<%= dirs.src %>/utils/Polyk.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLShaderUtils.js', - '<%= dirs.src %>/renderers/webgl/shaders/PixiShader.js', - '<%= dirs.src %>/renderers/webgl/shaders/PixiFastShader.js', - '<%= dirs.src %>/renderers/webgl/shaders/StripShader.js', - '<%= dirs.src %>/renderers/webgl/shaders/PrimitiveShader.js', - '<%= dirs.src %>/renderers/webgl/shaders/ComplexPrimitiveShader.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLGraphics.js', - '<%= dirs.src %>/renderers/webgl/WebGLRenderer.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLBlendModeManager.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLMaskManager.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLStencilManager.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLShaderManager.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLSpriteBatch.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLFastSpriteBatch.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLFilterManager.js', - '<%= dirs.src %>/renderers/webgl/utils/FilterTexture.js', - '<%= dirs.src %>/renderers/canvas/utils/CanvasBuffer.js', - '<%= dirs.src %>/renderers/canvas/utils/CanvasMaskManager.js', - '<%= dirs.src %>/renderers/canvas/utils/CanvasTinter.js', - '<%= dirs.src %>/renderers/canvas/CanvasRenderer.js', - '<%= dirs.src %>/renderers/canvas/CanvasGraphics.js', - '<%= dirs.src %>/primitives/Graphics.js', - '<%= dirs.src %>/extras/Strip.js', - '<%= dirs.src %>/extras/Rope.js', - '<%= dirs.src %>/extras/TilingSprite.js', - '<%= dirs.src %>/extras/Spine.js', - '<%= dirs.src %>/extras/PIXISpine.js', - '<%= dirs.src %>/textures/BaseTexture.js', - '<%= dirs.src %>/textures/Texture.js', - '<%= dirs.src %>/textures/RenderTexture.js', - '<%= dirs.src %>/textures/VideoTexture.js', - '<%= dirs.src %>/loaders/AssetLoader.js', - '<%= dirs.src %>/loaders/JsonLoader.js', - '<%= dirs.src %>/loaders/AtlasLoader.js', - '<%= dirs.src %>/loaders/SpriteSheetLoader.js', - '<%= dirs.src %>/loaders/ImageLoader.js', - '<%= dirs.src %>/loaders/BitmapFontLoader.js', - '<%= dirs.src %>/loaders/SpineLoader.js', - '<%= dirs.src %>/filters/AbstractFilter.js', - '<%= dirs.src %>/filters/AlphaMaskFilter.js', - '<%= dirs.src %>/filters/ColorMatrixFilter.js', - '<%= dirs.src %>/filters/GrayFilter.js', - '<%= dirs.src %>/filters/DisplacementFilter.js', - '<%= dirs.src %>/filters/PixelateFilter.js', - '<%= dirs.src %>/filters/BlurXFilter.js', - '<%= dirs.src %>/filters/BlurYFilter.js', - '<%= dirs.src %>/filters/BlurFilter.js', - '<%= dirs.src %>/filters/InvertFilter.js', - '<%= dirs.src %>/filters/SepiaFilter.js', - '<%= dirs.src %>/filters/TwistFilter.js', - '<%= dirs.src %>/filters/ColorStepFilter.js', - '<%= dirs.src %>/filters/DotScreenFilter.js', - '<%= dirs.src %>/filters/CrossHatchFilter.js', - '<%= dirs.src %>/filters/RGBSplitFilter.js', - '<%= dirs.src %>/Outro.js' - ], - banner = [ - '/**', - ' * @license', - ' * <%= pkg.name %> - v<%= pkg.version %>', - ' * Copyright (c) 2012-2014, Mat Groves', - ' * <%= pkg.homepage %>', - ' *', - ' * Compiled: <%= grunt.template.today("yyyy-mm-dd") %>', - ' *', - ' * <%= pkg.name %> is licensed under the <%= pkg.license %> License.', - ' * <%= pkg.licenseUrl %>', - ' */', - '' - ].join('\n'); - - grunt.initConfig({ - pkg : grunt.file.readJSON('package.json'), - dirs: { - build: 'bin', - docs: 'docs', - src: 'src/pixi', - test: 'test' - }, - files: { - srcBlob: '<%= dirs.src %>/**/*.js', - testBlob: '<%= dirs.test %>/**/*.js', - testConf: '<%= dirs.test %>/karma.conf.js', - build: '<%= dirs.build %>/pixi.dev.js', - buildMin: '<%= dirs.build %>/pixi.js' - }, - concat: { - options: { - banner: banner - }, - dist: { - src: srcFiles, - dest: '<%= files.build %>' - } - }, - /* jshint -W106 */ - concat_sourcemap: { - dev: { - files: { - '<%= files.build %>': srcFiles - }, - options: { - sourceRoot: '../' - } - } - }, - jshint: { - options: { - jshintrc: './.jshintrc' - }, - source: { - src: srcFiles.concat('Gruntfile.js'), - options: { - ignores: '<%= dirs.src %>/**/{Intro,Outro,Spine,Pixi}.js' - } - }, - test: { - src: ['<%= files.testBlob %>'], - options: { - ignores: '<%= dirs.test %>/lib/resemble.js', - jshintrc: undefined, //don't use jshintrc for tests - expr: true, - undef: false, - camelcase: false - } - } - }, - uglify: { - options: { - banner: banner - }, - dist: { - src: '<%= files.build %>', - dest: '<%= files.buildMin %>' - } - }, - connect: { - test: { - options: { - port: grunt.option('port-test') || 9002, - base: './', - keepalive: true - } - } - }, - yuidoc: { - compile: { - name: '<%= pkg.name %>', - description: '<%= pkg.description %>', - version: '<%= pkg.version %>', - url: '<%= pkg.homepage %>', - logo: '<%= pkg.logo %>', - options: { - paths: '<%= dirs.src %>', - outdir: '<%= dirs.docs %>' - } - } - }, - //Watches and builds for _development_ (source maps) - watch: { - scripts: { - files: ['<%= dirs.src %>/**/*.js'], - tasks: ['concat_sourcemap'], - options: { - spawn: false, - } - } - }, - karma: { - unit: { - configFile: '<%= files.testConf %>', - // browsers: ['Chrome'], - singleRun: true - } - } - }); - - grunt.registerTask('default', ['build', 'test']); - - grunt.registerTask('build', ['jshint:source', 'concat', 'uglify']); - grunt.registerTask('build-debug', ['concat_sourcemap', 'uglify']); - - grunt.registerTask('test', ['concat', 'jshint:test', 'karma']); - - grunt.registerTask('docs', ['yuidoc']); - grunt.registerTask('travis', ['build', 'test']); - - grunt.registerTask('default', ['build', 'test']); - - grunt.registerTask('debug-watch', ['concat_sourcemap', 'watch:debug']); -}; diff --git a/tutorial-3/pixi.js-master/LICENSE b/tutorial-3/pixi.js-master/LICENSE deleted file mode 100755 index 39cbfb0..0000000 --- a/tutorial-3/pixi.js-master/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2013-2015 Mathew Groves - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tutorial-3/pixi.js-master/README.md b/tutorial-3/pixi.js-master/README.md deleted file mode 100755 index 1d3b3d4..0000000 --- a/tutorial-3/pixi.js-master/README.md +++ /dev/null @@ -1,181 +0,0 @@ -Pixi Renderer -============= - -#### *** IMPORTANT - V2 API CHANGES *** #### - -A heads up for anyone updating their version of pixi.js to version 2, as we have changed a couple of bits that you need to be aware of. Fortunately, there are only two changes, and both are small. - -1: Creating a renderer now accepts an options parameter that you can add specific settings to: -``` -// an optional object that contains the settings for the renderer -var options = { - view:myCanvas, - resolution:1 -}; - -var renderer = new PIXI.WebGLRenderer(800, 600, options) -``` - -2: A ```PIXI.RenderTexture``` now accepts a ```PIXI.Matrix``` as its second parameter instead of a point. This gives you much more flexibility: - -``` myRenderTexture.render(myDisplayObject, myMatrix) ``` - -Check out the docs for more info! - - -![pixi.js logo](http://www.goodboydigital.com/pixijs/logo_small.png) - -[](http://www.pixijs.com/projects) -#### JavaScript 2D Renderer #### - -The aim of this project is to provide a fast lightweight 2D library that works -across all devices. The Pixi renderer allows everyone to enjoy the power of -hardware acceleration without prior knowledge of webGL. Also, it's fast. - -If you’re interested in pixi.js then feel free to follow me on twitter -([@doormat23](https://twitter.com/doormat23)) and I will keep you posted! And -of course check back on [our site]() as -any breakthroughs will be posted up there too! - -[![Inline docs](http://inch-ci.org/github/GoodBoyDigital/pixi.js.svg?branch=master)](http://inch-ci.org/github/GoodBoyDigital/pixi.js) -[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/GoodBoyDigital/pixi.js/trend.png)](https://bitdeli.com/free "Bitdeli Badge") - -### Demos ### - -- [WebGL Filters!]() - -- [Run pixie run]() - -- [Fight for Everyone]() - -- [Flash vs HTML]() - -- [Bunny Demo]() - -- [Storm Brewing]() - -- [Filters Demo]() - -- [Render Texture Demo]() - -- [Primitives Demo]() - -- [Masking Demo]() - -- [Interaction Demo]() - -- [photonstorm Balls Demo]() - -- [photonstorm Morph Demo]() - -Thanks to [@photonstorm](https://twitter.com/photonstorm) for providing those -last 2 examples and allowing us to share the source code :) - -### Docs ### - -[Documentation can be found here]() - -### Resources ### - -[Tutorials and other helpful bits]() - -[Pixi.js forum]() - - -### Road Map ### - -* Create a Typescript definition file for Pixi.js -* Implement Flash animation to pixi -* Update Loader so that it support XHR2 if it is available -* Improve the Documentation of the Project -* Create an Asset Loader Tutorial -* Create a MovieClip Tutorial -* Create a small game Tutorial - -### Contribute ### - -Want to be part of the pixi.js project? Great! All are welcome! We will get there quicker together :) -Whether you find a bug, have a great feature request or you fancy owning a task from the road map above feel free to get in touch. - -Make sure to read the [Contributing Guide](https://github.com/GoodBoyDigital/pixi.js/blob/master/CONTRIBUTING.md) -before submitting changes. - -### How to build ### - -PixiJS is built with Grunt. If you don't already have this, go install Node and NPM then install the Grunt Command Line. - -``` -$> npm install -g grunt-cli -``` - -Then, in the folder where you have downloaded the source, install the build dependencies using npm: - -``` -$> npm install -``` - -Then build: - -``` -$> grunt -``` - -This will create a minified version at bin/pixi.js and a non-minified version at bin/pixi.dev.js. - -It also copies the non-minified version to the examples. - -### Current features ### - -- WebGL renderer (with automatic smart batching allowing for REALLY fast performance) -- Canvas renderer (Fastest in town!) -- Full scene graph -- Super easy to use API (similar to the flash display list API) -- Support for texture atlases -- Asset loader / sprite sheet loader -- Auto-detect which renderer should be used -- Full Mouse and Multi-touch Interaction -- Text -- BitmapFont text -- Multiline Text -- Render Texture -- Spine support -- Primitive Drawing -- Masking -- Filters - -### Usage ### - -```javascript - - // You can use either PIXI.WebGLRenderer or PIXI.CanvasRenderer - var renderer = new PIXI.WebGLRenderer(800, 600); - - document.body.appendChild(renderer.view); - - var stage = new PIXI.Stage; - - var bunnyTexture = PIXI.Texture.fromImage("bunny.png"); - var bunny = new PIXI.Sprite(bunnyTexture); - - bunny.position.x = 400; - bunny.position.y = 300; - - bunny.scale.x = 2; - bunny.scale.y = 2; - - stage.addChild(bunny); - - requestAnimationFrame(animate); - - function animate() { - bunny.rotation += 0.01; - - renderer.render(stage); - - requestAnimationFrame(animate); - } -``` - -This content is released under the (http://opensource.org/licenses/MIT) MIT License. - -[![Analytics](https://ga-beacon.appspot.com/UA-39213431-2/pixi.js/index)](https://github.com/igrigorik/ga-beacon) diff --git a/tutorial-3/pixi.js-master/bin/pixi.dev.js b/tutorial-3/pixi.js-master/bin/pixi.dev.js deleted file mode 100755 index c1cf45b..0000000 --- a/tutorial-3/pixi.js-master/bin/pixi.dev.js +++ /dev/null @@ -1,20265 +0,0 @@ -/** - * @license - * pixi.js - v2.2.7 - * Copyright (c) 2012-2014, Mat Groves - * http://goodboydigital.com/ - * - * Compiled: 2015-02-25 - * - * pixi.js is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license.php - */ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -(function(){ - - var root = this; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The [pixi.js](http://www.pixijs.com/) module/namespace. - * - * @module PIXI - */ - -/** - * Namespace-class for [pixi.js](http://www.pixijs.com/). - * - * Contains assorted static properties and enumerations. - * - * @class PIXI - * @static - */ -var PIXI = PIXI || {}; - -/** - * @property {Number} WEBGL_RENDERER - * @protected - * @static - */ -PIXI.WEBGL_RENDERER = 0; -/** - * @property {Number} CANVAS_RENDERER - * @protected - * @static - */ -PIXI.CANVAS_RENDERER = 1; - -/** - * Version of pixi that is loaded. - * @property {String} VERSION - * @static - */ -PIXI.VERSION = "v2.2.7"; - -/** - * Various blend modes supported by pixi. IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes. - * @property {Object} blendModes - * @property {Number} blendModes.NORMAL - * @property {Number} blendModes.ADD - * @property {Number} blendModes.MULTIPLY - * @property {Number} blendModes.SCREEN - * @property {Number} blendModes.OVERLAY - * @property {Number} blendModes.DARKEN - * @property {Number} blendModes.LIGHTEN - * @property {Number} blendModes.COLOR_DODGE - * @property {Number} blendModes.COLOR_BURN - * @property {Number} blendModes.HARD_LIGHT - * @property {Number} blendModes.SOFT_LIGHT - * @property {Number} blendModes.DIFFERENCE - * @property {Number} blendModes.EXCLUSION - * @property {Number} blendModes.HUE - * @property {Number} blendModes.SATURATION - * @property {Number} blendModes.COLOR - * @property {Number} blendModes.LUMINOSITY - * @static - */ -PIXI.blendModes = { - NORMAL:0, - ADD:1, - MULTIPLY:2, - SCREEN:3, - OVERLAY:4, - DARKEN:5, - LIGHTEN:6, - COLOR_DODGE:7, - COLOR_BURN:8, - HARD_LIGHT:9, - SOFT_LIGHT:10, - DIFFERENCE:11, - EXCLUSION:12, - HUE:13, - SATURATION:14, - COLOR:15, - LUMINOSITY:16 -}; - -/** - * The scale modes that are supported by pixi. - * - * The DEFAULT scale mode affects the default scaling mode of future operations. - * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. - * - * @property {Object} scaleModes - * @property {Number} scaleModes.DEFAULT=LINEAR - * @property {Number} scaleModes.LINEAR Smooth scaling - * @property {Number} scaleModes.NEAREST Pixelating scaling - * @static - */ -PIXI.scaleModes = { - DEFAULT:0, - LINEAR:0, - NEAREST:1 -}; - -// used to create uids for various pixi objects.. -PIXI._UID = 0; - -if(typeof(Float32Array) != 'undefined') -{ - PIXI.Float32Array = Float32Array; - PIXI.Uint16Array = Uint16Array; - - // Uint32Array and ArrayBuffer only used by WebGL renderer - // We can suppose that if WebGL is supported then typed arrays are supported too - // as they predate WebGL support for all browsers: - // see typed arrays support: http://caniuse.com/#search=TypedArrays - // see WebGL support: http://caniuse.com/#search=WebGL - PIXI.Uint32Array = Uint32Array; - PIXI.ArrayBuffer = ArrayBuffer; -} -else -{ - PIXI.Float32Array = Array; - PIXI.Uint16Array = Array; -} - -// interaction frequency -PIXI.INTERACTION_FREQUENCY = 30; -PIXI.AUTO_PREVENT_DEFAULT = true; - -/** - * @property {Number} PI_2 - * @static - */ -PIXI.PI_2 = Math.PI * 2; - -/** - * @property {Number} RAD_TO_DEG - * @static - */ -PIXI.RAD_TO_DEG = 180 / Math.PI; - -/** - * @property {Number} DEG_TO_RAD - * @static - */ -PIXI.DEG_TO_RAD = Math.PI / 180; - -/** - * @property {String} RETINA_PREFIX - * @protected - * @static - */ -PIXI.RETINA_PREFIX = "@2x"; -//PIXI.SCALE_PREFIX "@x%%"; - -/** - * If true the default pixi startup (console) banner message will be suppressed. - * - * @property {Boolean} dontSayHello - * @default false - * @static - */ -PIXI.dontSayHello = false; - -/** - * The default render options if none are supplied to - * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. - * - * @property {Object} defaultRenderOptions - * @property {Object} defaultRenderOptions.view=null - * @property {Boolean} defaultRenderOptions.transparent=false - * @property {Boolean} defaultRenderOptions.antialias=false - * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false - * @property {Number} defaultRenderOptions.resolution=1 - * @property {Boolean} defaultRenderOptions.clearBeforeRender=true - * @property {Boolean} defaultRenderOptions.autoResize=false - * @static - */ -PIXI.defaultRenderOptions = { - view:null, - transparent:false, - antialias:false, - preserveDrawingBuffer:false, - resolution:1, - clearBeforeRender:true, - autoResize:false -} - -PIXI.sayHello = function (type) -{ - if(PIXI.dontSayHello)return; - - if ( navigator.userAgent.toLowerCase().indexOf('chrome') > -1 ) - { - var args = [ - '%c %c %c Pixi.js ' + PIXI.VERSION + ' - ' + type + ' %c ' + ' %c ' + ' http://www.pixijs.com/ %c %c ♥%c♥%c♥ ', - 'background: #ff66a5', - 'background: #ff66a5', - 'color: #ff66a5; background: #030307;', - 'background: #ff66a5', - 'background: #ffc3dc', - 'background: #ff66a5', - 'color: #ff2424; background: #fff', - 'color: #ff2424; background: #fff', - 'color: #ff2424; background: #fff' - ]; - - console.log.apply(console, args); - } - else if (window['console']) - { - console.log('Pixi.js ' + PIXI.VERSION + ' - http://www.pixijs.com/'); - } - - PIXI.dontSayHello = true; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis. - * - * @class Point - * @constructor - * @param x {Number} position of the point on the x axis - * @param y {Number} position of the point on the y axis - */ -PIXI.Point = function(x, y) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; -}; - -/** - * Creates a clone of this point - * - * @method clone - * @return {Point} a copy of the point - */ -PIXI.Point.prototype.clone = function() -{ - return new PIXI.Point(this.x, this.y); -}; - -/** - * Sets the point to a new x and y position. - * If y is omitted, both x and y will be set to x. - * - * @method set - * @param [x=0] {Number} position of the point on the x axis - * @param [y=0] {Number} position of the point on the y axis - */ -PIXI.Point.prototype.set = function(x, y) -{ - this.x = x || 0; - this.y = y || ( (y !== 0) ? this.x : 0 ) ; -}; - -// constructor -PIXI.Point.prototype.constructor = PIXI.Point; -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height. - * - * @class Rectangle - * @constructor - * @param x {Number} The X coordinate of the upper-left corner of the rectangle - * @param y {Number} The Y coordinate of the upper-left corner of the rectangle - * @param width {Number} The overall width of this rectangle - * @param height {Number} The overall height of this rectangle - */ -PIXI.Rectangle = function(x, y, width, height) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RECT in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Rectangle - * - * @method clone - * @return {Rectangle} a copy of the rectangle - */ -PIXI.Rectangle.prototype.clone = function() -{ - return new PIXI.Rectangle(this.x, this.y, this.width, this.height); -}; - -/** - * Checks whether the x and y coordinates given are contained within this Rectangle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Rectangle - */ -PIXI.Rectangle.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - var x1 = this.x; - if(x >= x1 && x <= x1 + this.width) - { - var y1 = this.y; - - if(y >= y1 && y <= y1 + this.height) - { - return true; - } - } - - return false; -}; - -// constructor -PIXI.Rectangle.prototype.constructor = PIXI.Rectangle; - -PIXI.EmptyRectangle = new PIXI.Rectangle(0,0,0,0); -/** - * @author Adrien Brault - */ - -/** - * @class Polygon - * @constructor - * @param points* {Array(Point)|Array(Number)|Point...|Number...} This can be an array of Points that form the polygon, - * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be - * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the - * arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are - * Numbers. - */ -PIXI.Polygon = function(points) -{ - //if points isn't an array, use arguments as the array - if(!(points instanceof Array))points = Array.prototype.slice.call(arguments); - - //if this is a flat array of numbers, convert it to points - if(points[0] instanceof PIXI.Point) - { - var p = []; - for(var i = 0, il = points.length; i < il; i++) - { - p.push(points[i].x, points[i].y); - } - - points = p; - } - - this.closed = true; - - /** - * An array of the points of this polygon - * @property points - * @type Array(Point)|Array(Number) - * - */ - this.points = points; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.POLY in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this polygon - * - * @method clone - * @return {Polygon} a copy of the polygon - */ -PIXI.Polygon.prototype.clone = function() -{ - var points = this.points.slice(); - return new PIXI.Polygon(points); -}; - -/** - * Checks whether the x and y coordinates passed to this function are contained within this polygon - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this polygon - */ -PIXI.Polygon.prototype.contains = function(x, y) -{ - var inside = false; - - // use some raycasting to test hits - // https://github.com/substack/point-in-polygon/blob/master/index.js - var length = this.points.length / 2; - - for(var i = 0, j = length - 1; i < length; j = i++) - { - var xi = this.points[i * 2], yi = this.points[i * 2 + 1], - xj = this.points[j * 2], yj = this.points[j * 2 + 1], - intersect = ((yi > y) !== (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi); - - if(intersect) inside = !inside; - } - - return inside; -}; - -// constructor -PIXI.Polygon.prototype.constructor = PIXI.Polygon; - -/** - * @author Chad Engler - */ - -/** - * The Circle object can be used to specify a hit area for displayObjects - * - * @class Circle - * @constructor - * @param x {Number} The X coordinate of the center of this circle - * @param y {Number} The Y coordinate of the center of this circle - * @param radius {Number} The radius of the circle - */ -PIXI.Circle = function(x, y, radius) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property radius - * @type Number - * @default 0 - */ - this.radius = radius || 0; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.CIRC in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Circle instance - * - * @method clone - * @return {Circle} a copy of the Circle - */ -PIXI.Circle.prototype.clone = function() -{ - return new PIXI.Circle(this.x, this.y, this.radius); -}; - -/** - * Checks whether the x and y coordinates given are contained within this circle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Circle - */ -PIXI.Circle.prototype.contains = function(x, y) -{ - if(this.radius <= 0) - return false; - - var dx = (this.x - x), - dy = (this.y - y), - r2 = this.radius * this.radius; - - dx *= dx; - dy *= dy; - - return (dx + dy <= r2); -}; - -/** -* Returns the framing rectangle of the circle as a PIXI.Rectangle object -* -* @method getBounds -* @return {Rectangle} the framing rectangle -*/ -PIXI.Circle.prototype.getBounds = function() -{ - return new PIXI.Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2); -}; - -// constructor -PIXI.Circle.prototype.constructor = PIXI.Circle; - -/** - * @author Chad Engler - */ - -/** - * The Ellipse object can be used to specify a hit area for displayObjects - * - * @class Ellipse - * @constructor - * @param x {Number} The X coordinate of the center of the ellipse - * @param y {Number} The Y coordinate of the center of the ellipse - * @param width {Number} The half width of this ellipse - * @param height {Number} The half height of this ellipse - */ -PIXI.Ellipse = function(x, y, width, height) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.ELIP in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Ellipse instance - * - * @method clone - * @return {Ellipse} a copy of the ellipse - */ -PIXI.Ellipse.prototype.clone = function() -{ - return new PIXI.Ellipse(this.x, this.y, this.width, this.height); -}; - -/** - * Checks whether the x and y coordinates given are contained within this ellipse - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coords are within this ellipse - */ -PIXI.Ellipse.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - //normalize the coords to an ellipse with center 0,0 - var normx = ((x - this.x) / this.width), - normy = ((y - this.y) / this.height); - - normx *= normx; - normy *= normy; - - return (normx + normy <= 1); -}; - -/** -* Returns the framing rectangle of the ellipse as a PIXI.Rectangle object -* -* @method getBounds -* @return {Rectangle} the framing rectangle -*/ -PIXI.Ellipse.prototype.getBounds = function() -{ - return new PIXI.Rectangle(this.x - this.width, this.y - this.height, this.width, this.height); -}; - -// constructor -PIXI.Ellipse.prototype.constructor = PIXI.Ellipse; - -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * The Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height. - * - * @class RoundedRectangle - * @constructor - * @param x {Number} The X coordinate of the upper-left corner of the rounded rectangle - * @param y {Number} The Y coordinate of the upper-left corner of the rounded rectangle - * @param width {Number} The overall width of this rounded rectangle - * @param height {Number} The overall height of this rounded rectangle - * @param radius {Number} Controls the radius of the rounded corners - */ -PIXI.RoundedRectangle = function(x, y, width, height, radius) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - /** - * @property radius - * @type Number - * @default 20 - */ - this.radius = radius || 20; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RRECT in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Rounded Rectangle - * - * @method clone - * @return {RoundedRectangle} a copy of the rounded rectangle - */ -PIXI.RoundedRectangle.prototype.clone = function() -{ - return new PIXI.RoundedRectangle(this.x, this.y, this.width, this.height, this.radius); -}; - -/** - * Checks whether the x and y coordinates given are contained within this Rounded Rectangle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Rounded Rectangle - */ -PIXI.RoundedRectangle.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - var x1 = this.x; - if(x >= x1 && x <= x1 + this.width) - { - var y1 = this.y; - - if(y >= y1 && y <= y1 + this.height) - { - return true; - } - } - - return false; -}; - -// constructor -PIXI.RoundedRectangle.prototype.constructor = PIXI.RoundedRectangle; - - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Matrix class is now an object, which makes it a lot faster, - * here is a representation of it : - * | a | b | tx| - * | c | d | ty| - * | 0 | 0 | 1 | - * - * @class Matrix - * @constructor - */ -PIXI.Matrix = function() -{ - /** - * @property a - * @type Number - * @default 1 - */ - this.a = 1; - - /** - * @property b - * @type Number - * @default 0 - */ - this.b = 0; - - /** - * @property c - * @type Number - * @default 0 - */ - this.c = 0; - - /** - * @property d - * @type Number - * @default 1 - */ - this.d = 1; - - /** - * @property tx - * @type Number - * @default 0 - */ - this.tx = 0; - - /** - * @property ty - * @type Number - * @default 0 - */ - this.ty = 0; -}; - -/** - * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows: - * - * a = array[0] - * b = array[1] - * c = array[3] - * d = array[4] - * tx = array[2] - * ty = array[5] - * - * @method fromArray - * @param array {Array} The array that the matrix will be populated from. - */ -PIXI.Matrix.prototype.fromArray = function(array) -{ - this.a = array[0]; - this.b = array[1]; - this.c = array[3]; - this.d = array[4]; - this.tx = array[2]; - this.ty = array[5]; -}; - -/** - * Creates an array from the current Matrix object. - * - * @method toArray - * @param transpose {Boolean} Whether we need to transpose the matrix or not - * @return {Array} the newly created array which contains the matrix - */ -PIXI.Matrix.prototype.toArray = function(transpose) -{ - if(!this.array) this.array = new PIXI.Float32Array(9); - var array = this.array; - - if(transpose) - { - array[0] = this.a; - array[1] = this.b; - array[2] = 0; - array[3] = this.c; - array[4] = this.d; - array[5] = 0; - array[6] = this.tx; - array[7] = this.ty; - array[8] = 1; - } - else - { - array[0] = this.a; - array[1] = this.c; - array[2] = this.tx; - array[3] = this.b; - array[4] = this.d; - array[5] = this.ty; - array[6] = 0; - array[7] = 0; - array[8] = 1; - } - - return array; -}; - -/** - * Get a new position with the current transformation applied. - * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) - * - * @method apply - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix - */ -PIXI.Matrix.prototype.apply = function(pos, newPos) -{ - newPos = newPos || new PIXI.Point(); - - newPos.x = this.a * pos.x + this.c * pos.y + this.tx; - newPos.y = this.b * pos.x + this.d * pos.y + this.ty; - - return newPos; -}; - -/** - * Get a new position with the inverse of the current transformation applied. - * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) - * - * @method applyInverse - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix - */ -PIXI.Matrix.prototype.applyInverse = function(pos, newPos) -{ - newPos = newPos || new PIXI.Point(); - - var id = 1 / (this.a * this.d + this.c * -this.b); - - newPos.x = this.d * id * pos.x + -this.c * id * pos.y + (this.ty * this.c - this.tx * this.d) * id; - newPos.y = this.a * id * pos.y + -this.b * id * pos.x + (-this.ty * this.a + this.tx * this.b) * id; - - return newPos; -}; - -/** - * Translates the matrix on the x and y. - * - * @method translate - * @param {Number} x - * @param {Number} y - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.translate = function(x, y) -{ - this.tx += x; - this.ty += y; - - return this; -}; - -/** - * Applies a scale transformation to the matrix. - * - * @method scale - * @param {Number} x The amount to scale horizontally - * @param {Number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.scale = function(x, y) -{ - this.a *= x; - this.d *= y; - this.c *= x; - this.b *= y; - this.tx *= x; - this.ty *= y; - - return this; -}; - - -/** - * Applies a rotation transformation to the matrix. - * @method rotate - * @param {Number} angle The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.rotate = function(angle) -{ - var cos = Math.cos( angle ); - var sin = Math.sin( angle ); - - var a1 = this.a; - var c1 = this.c; - var tx1 = this.tx; - - this.a = a1 * cos-this.b * sin; - this.b = a1 * sin+this.b * cos; - this.c = c1 * cos-this.d * sin; - this.d = c1 * sin+this.d * cos; - this.tx = tx1 * cos - this.ty * sin; - this.ty = tx1 * sin + this.ty * cos; - - return this; -}; - -/** - * Appends the given Matrix to this Matrix. - * - * @method append - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. - */ -PIXI.Matrix.prototype.append = function(matrix) -{ - var a1 = this.a; - var b1 = this.b; - var c1 = this.c; - var d1 = this.d; - - this.a = matrix.a * a1 + matrix.b * c1; - this.b = matrix.a * b1 + matrix.b * d1; - this.c = matrix.c * a1 + matrix.d * c1; - this.d = matrix.c * b1 + matrix.d * d1; - - this.tx = matrix.tx * a1 + matrix.ty * c1 + this.tx; - this.ty = matrix.tx * b1 + matrix.ty * d1 + this.ty; - - return this; -}; - -/** - * Resets this Matix to an identity (default) matrix. - * - * @method identity - * @return {Matrix} This matrix. Good for chaining method calls. - */ -PIXI.Matrix.prototype.identity = function() -{ - this.a = 1; - this.b = 0; - this.c = 0; - this.d = 1; - this.tx = 0; - this.ty = 0; - - return this; -}; - -PIXI.identityMatrix = new PIXI.Matrix(); - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The base class for all objects that are rendered on the screen. - * This is an abstract class and should not be used on its own rather it should be extended. - * - * @class DisplayObject - * @constructor - */ -PIXI.DisplayObject = function() -{ - /** - * The coordinate of the object relative to the local coordinates of the parent. - * - * @property position - * @type Point - */ - this.position = new PIXI.Point(); - - /** - * The scale factor of the object. - * - * @property scale - * @type Point - */ - this.scale = new PIXI.Point(1,1);//{x:1, y:1}; - - /** - * The pivot point of the displayObject that it rotates around - * - * @property pivot - * @type Point - */ - this.pivot = new PIXI.Point(0,0); - - /** - * The rotation of the object in radians. - * - * @property rotation - * @type Number - */ - this.rotation = 0; - - /** - * The opacity of the object. - * - * @property alpha - * @type Number - */ - this.alpha = 1; - - /** - * The visibility of the object. - * - * @property visible - * @type Boolean - */ - this.visible = true; - - /** - * This is the defined area that will pick up mouse / touch events. It is null by default. - * Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children) - * - * @property hitArea - * @type Rectangle|Circle|Ellipse|Polygon - */ - this.hitArea = null; - - /** - * This is used to indicate if the displayObject should display a mouse hand cursor on rollover - * - * @property buttonMode - * @type Boolean - */ - this.buttonMode = false; - - /** - * Can this object be rendered - * - * @property renderable - * @type Boolean - */ - this.renderable = false; - - /** - * [read-only] The display object container that contains this display object. - * - * @property parent - * @type DisplayObjectContainer - * @readOnly - */ - this.parent = null; - - /** - * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage. - * - * @property stage - * @type Stage - * @readOnly - */ - this.stage = null; - - /** - * [read-only] The multiplied alpha of the displayObject - * - * @property worldAlpha - * @type Number - * @readOnly - */ - this.worldAlpha = 1; - - /** - * [read-only] Whether or not the object is interactive, do not toggle directly! use the `interactive` property - * - * @property _interactive - * @type Boolean - * @readOnly - * @private - */ - this._interactive = false; - - /** - * This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true - * - * @property defaultCursor - * @type String - * - */ - this.defaultCursor = 'pointer'; - - /** - * [read-only] Current transform of the object based on world (parent) factors - * - * @property worldTransform - * @type Matrix - * @readOnly - * @private - */ - this.worldTransform = new PIXI.Matrix(); - - /** - * cached sin rotation and cos rotation - * - * @property _sr - * @type Number - * @private - */ - this._sr = 0; - - /** - * cached sin rotation and cos rotation - * - * @property _cr - * @type Number - * @private - */ - this._cr = 1; - - /** - * The area the filter is applied to like the hitArea this is used as more of an optimisation - * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle - * - * @property filterArea - * @type Rectangle - */ - this.filterArea = null;//new PIXI.Rectangle(0,0,1,1); - - /** - * The original, cached bounds of the object - * - * @property _bounds - * @type Rectangle - * @private - */ - this._bounds = new PIXI.Rectangle(0, 0, 1, 1); - - /** - * The most up-to-date bounds of the object - * - * @property _currentBounds - * @type Rectangle - * @private - */ - this._currentBounds = null; - - /** - * The original, cached mask of the object - * - * @property _currentBounds - * @type Rectangle - * @private - */ - this._mask = null; - - /** - * Cached internal flag. - * - * @property _cacheAsBitmap - * @type Boolean - * @private - */ - this._cacheAsBitmap = false; - - /** - * Cached internal flag. - * - * @property _cacheIsDirty - * @type Boolean - * @private - */ - this._cacheIsDirty = false; - - - /* - * MOUSE Callbacks - */ - - /** - * A callback that is used when the users mouse rolls over the displayObject - * @method mouseover - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the users mouse leaves the displayObject - * @method mouseout - * @param interactionData {InteractionData} - */ - - //Left button - /** - * A callback that is used when the users clicks on the displayObject with their mouse's left button - * @method click - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user clicks the mouse's left button down over the sprite - * @method mousedown - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's left button that was over the displayObject - * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject - * @method mouseup - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject - * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject - * @method mouseupoutside - * @param interactionData {InteractionData} - */ - - //Right button - /** - * A callback that is used when the users clicks on the displayObject with their mouse's right button - * @method rightclick - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user clicks the mouse's right button down over the sprite - * @method rightdown - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's right button that was over the displayObject - * for this callback to be fired the mouse's right button must have been pressed down over the displayObject - * @method rightup - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject - * for this callback to be fired, the mouse's right button must have been pressed down over the displayObject - * @method rightupoutside - * @param interactionData {InteractionData} - */ - - /* - * TOUCH Callbacks - */ - - /** - * A callback that is used when the users taps on the sprite with their finger - * basically a touch version of click - * @method tap - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user touches over the displayObject - * @method touchstart - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases a touch over the displayObject - * @method touchend - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the touch that was over the displayObject - * for this callback to be fired, The touch must have started over the sprite - * @method touchendoutside - * @param interactionData {InteractionData} - */ -}; - -// constructor -PIXI.DisplayObject.prototype.constructor = PIXI.DisplayObject; - -/** - * Indicates if the sprite will have touch and mouse interactivity. It is false by default - * - * @property interactive - * @type Boolean - * @default false - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'interactive', { - get: function() { - return this._interactive; - }, - set: function(value) { - this._interactive = value; - - // TODO more to be done here.. - // need to sort out a re-crawl! - if(this.stage)this.stage.dirty = true; - } -}); - -/** - * [read-only] Indicates if the sprite is globally visible. - * - * @property worldVisible - * @type Boolean - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'worldVisible', { - get: function() { - var item = this; - - do - { - if(!item.visible)return false; - item = item.parent; - } - while(item); - - return true; - } -}); - -/** - * Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. - * In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. - * To remove a mask, set this property to null. - * - * @property mask - * @type Graphics - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'mask', { - get: function() { - return this._mask; - }, - set: function(value) { - - if(this._mask)this._mask.isMask = false; - this._mask = value; - if(this._mask)this._mask.isMask = true; - } -}); - -/** - * Sets the filters for the displayObject. - * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. - * To remove filters simply set this property to 'null' - * @property filters - * @type Array(Filter) - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { - - get: function() { - return this._filters; - }, - - set: function(value) { - - if(value) - { - // now put all the passes in one place.. - var passes = []; - for (var i = 0; i < value.length; i++) - { - var filterPasses = value[i].passes; - for (var j = 0; j < filterPasses.length; j++) - { - passes.push(filterPasses[j]); - } - } - - // TODO change this as it is legacy - this._filterBlock = {target:this, filterPasses:passes}; - } - - this._filters = value; - } -}); - -/** - * Set if this display object is cached as a bitmap. - * This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. - * To remove simply set this property to 'null' - * @property cacheAsBitmap - * @type Boolean - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'cacheAsBitmap', { - - get: function() { - return this._cacheAsBitmap; - }, - - set: function(value) { - - if(this._cacheAsBitmap === value)return; - - if(value) - { - this._generateCachedSprite(); - } - else - { - this._destroyCachedSprite(); - } - - this._cacheAsBitmap = value; - } -}); - -/* - * Updates the object transform for rendering - * - * @method updateTransform - * @private - */ -PIXI.DisplayObject.prototype.updateTransform = function() -{ - // create some matrix refs for easy access - var pt = this.parent.worldTransform; - var wt = this.worldTransform; - - // temporary matrix variables - var a, b, c, d, tx, ty; - - // so if rotation is between 0 then we can simplify the multiplication process.. - if(this.rotation % PIXI.PI_2) - { - // check to see if the rotation is the same as the previous render. This means we only need to use sin and cos when rotation actually changes - if(this.rotation !== this.rotationCache) - { - this.rotationCache = this.rotation; - this._sr = Math.sin(this.rotation); - this._cr = Math.cos(this.rotation); - } - - // get the matrix values of the displayobject based on its transform properties.. - a = this._cr * this.scale.x; - b = this._sr * this.scale.x; - c = -this._sr * this.scale.y; - d = this._cr * this.scale.y; - tx = this.position.x; - ty = this.position.y; - - // check for pivot.. not often used so geared towards that fact! - if(this.pivot.x || this.pivot.y) - { - tx -= this.pivot.x * a + this.pivot.y * c; - ty -= this.pivot.x * b + this.pivot.y * d; - } - - // concat the parent matrix with the objects transform. - wt.a = a * pt.a + b * pt.c; - wt.b = a * pt.b + b * pt.d; - wt.c = c * pt.a + d * pt.c; - wt.d = c * pt.b + d * pt.d; - wt.tx = tx * pt.a + ty * pt.c + pt.tx; - wt.ty = tx * pt.b + ty * pt.d + pt.ty; - - - } - else - { - // lets do the fast version as we know there is no rotation.. - a = this.scale.x; - d = this.scale.y; - - tx = this.position.x - this.pivot.x * a; - ty = this.position.y - this.pivot.y * d; - - wt.a = a * pt.a; - wt.b = a * pt.b; - wt.c = d * pt.c; - wt.d = d * pt.d; - wt.tx = tx * pt.a + ty * pt.c + pt.tx; - wt.ty = tx * pt.b + ty * pt.d + pt.ty; - } - - // multiply the alphas.. - this.worldAlpha = this.alpha * this.parent.worldAlpha; -}; - -// performance increase to avoid using call.. (10x faster) -PIXI.DisplayObject.prototype.displayObjectUpdateTransform = PIXI.DisplayObject.prototype.updateTransform; - -/** - * Retrieves the bounds of the displayObject as a rectangle object - * - * @method getBounds - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area - */ -PIXI.DisplayObject.prototype.getBounds = function(matrix) -{ - matrix = matrix;//just to get passed js hinting (and preserve inheritance) - return PIXI.EmptyRectangle; -}; - -/** - * Retrieves the local bounds of the displayObject as a rectangle object - * - * @method getLocalBounds - * @return {Rectangle} the rectangular bounding area - */ -PIXI.DisplayObject.prototype.getLocalBounds = function() -{ - return this.getBounds(PIXI.identityMatrix);///PIXI.EmptyRectangle(); -}; - -/** - * Sets the object's stage reference, the stage this object is connected to - * - * @method setStageReference - * @param stage {Stage} the stage that the object will have as its current stage reference - */ -PIXI.DisplayObject.prototype.setStageReference = function(stage) -{ - this.stage = stage; - if(this._interactive)this.stage.dirty = true; -}; - -/** - * Useful function that returns a texture of the displayObject object that can then be used to create sprites - * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. - * - * @method generateTexture - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @return {Texture} a texture of the graphics object - */ -PIXI.DisplayObject.prototype.generateTexture = function(resolution, scaleMode, renderer) -{ - var bounds = this.getLocalBounds(); - - var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0, renderer, scaleMode, resolution); - - PIXI.DisplayObject._tempMatrix.tx = -bounds.x; - PIXI.DisplayObject._tempMatrix.ty = -bounds.y; - - renderTexture.render(this, PIXI.DisplayObject._tempMatrix); - - return renderTexture; -}; - -/** - * Generates and updates the cached sprite for this object. - * - * @method updateCache - */ -PIXI.DisplayObject.prototype.updateCache = function() -{ - this._generateCachedSprite(); -}; - -/** - * Calculates the global position of the display object - * - * @method toGlobal - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object - */ -PIXI.DisplayObject.prototype.toGlobal = function(position) -{ - // don't need to u[date the lot - this.displayObjectUpdateTransform(); - return this.worldTransform.apply(position); -}; - -/** - * Calculates the local position of the display object relative to another point - * - * @method toLocal - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object - */ -PIXI.DisplayObject.prototype.toLocal = function(position, from) -{ - // - if (from) - { - position = from.toGlobal(position); - } - - // don't need to u[date the lot - this.displayObjectUpdateTransform(); - return this.worldTransform.applyInverse(position); -}; - -/** - * Internal method. - * - * @method _renderCachedSprite - * @param renderSession {Object} The render session - * @private - */ -PIXI.DisplayObject.prototype._renderCachedSprite = function(renderSession) -{ - this._cachedSprite.worldAlpha = this.worldAlpha; - - if(renderSession.gl) - { - PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession); - } - else - { - PIXI.Sprite.prototype._renderCanvas.call(this._cachedSprite, renderSession); - } -}; - -/** - * Internal method. - * - * @method _generateCachedSprite - * @private - */ -PIXI.DisplayObject.prototype._generateCachedSprite = function() -{ - this._cacheAsBitmap = false; - var bounds = this.getLocalBounds(); - - if(!this._cachedSprite) - { - var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0);//, renderSession.renderer); - - this._cachedSprite = new PIXI.Sprite(renderTexture); - this._cachedSprite.worldTransform = this.worldTransform; - } - else - { - this._cachedSprite.texture.resize(bounds.width | 0, bounds.height | 0); - } - - //REMOVE filter! - var tempFilters = this._filters; - this._filters = null; - - this._cachedSprite.filters = tempFilters; - - PIXI.DisplayObject._tempMatrix.tx = -bounds.x; - PIXI.DisplayObject._tempMatrix.ty = -bounds.y; - - this._cachedSprite.texture.render(this, PIXI.DisplayObject._tempMatrix, true); - - this._cachedSprite.anchor.x = -( bounds.x / bounds.width ); - this._cachedSprite.anchor.y = -( bounds.y / bounds.height ); - - this._filters = tempFilters; - - this._cacheAsBitmap = true; -}; - -/** -* Destroys the cached sprite. -* -* @method _destroyCachedSprite -* @private -*/ -PIXI.DisplayObject.prototype._destroyCachedSprite = function() -{ - if(!this._cachedSprite)return; - - this._cachedSprite.texture.destroy(true); - - // TODO could be object pooled! - this._cachedSprite = null; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.DisplayObject.prototype._renderWebGL = function(renderSession) -{ - // OVERWRITE; - // this line is just here to pass jshinting :) - renderSession = renderSession; -}; - -/** -* Renders the object using the Canvas renderer -* -* @method _renderCanvas -* @param renderSession {RenderSession} -* @private -*/ -PIXI.DisplayObject.prototype._renderCanvas = function(renderSession) -{ - // OVERWRITE; - // this line is just here to pass jshinting :) - renderSession = renderSession; -}; - - -PIXI.DisplayObject._tempMatrix = new PIXI.Matrix(); - -/** - * The position of the displayObject on the x axis relative to the local coordinates of the parent. - * - * @property x - * @type Number - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'x', { - get: function() { - return this.position.x; - }, - set: function(value) { - this.position.x = value; - } -}); - -/** - * The position of the displayObject on the y axis relative to the local coordinates of the parent. - * - * @property y - * @type Number - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'y', { - get: function() { - return this.position.y; - }, - set: function(value) { - this.position.y = value; - } -}); - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A DisplayObjectContainer represents a collection of display objects. - * It is the base class of all display objects that act as a container for other objects. - * - * @class DisplayObjectContainer - * @extends DisplayObject - * @constructor - */ -PIXI.DisplayObjectContainer = function() -{ - PIXI.DisplayObject.call( this ); - - /** - * [read-only] The array of children of this container. - * - * @property children - * @type Array(DisplayObject) - * @readOnly - */ - this.children = []; - - // fast access to update transform.. - -}; - -// constructor -PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); -PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer; - - -/** - * The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', { - get: function() { - return this.scale.x * this.getLocalBounds().width; - }, - set: function(value) { - - var width = this.getLocalBounds().width; - - if(width !== 0) - { - this.scale.x = value / width; - } - else - { - this.scale.x = 1; - } - - - this._width = value; - } -}); - -/** - * The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', { - get: function() { - return this.scale.y * this.getLocalBounds().height; - }, - set: function(value) { - - var height = this.getLocalBounds().height; - - if(height !== 0) - { - this.scale.y = value / height ; - } - else - { - this.scale.y = 1; - } - - this._height = value; - } -}); - -/** - * Adds a child to the container. - * - * @method addChild - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. - */ -PIXI.DisplayObjectContainer.prototype.addChild = function(child) -{ - return this.addChildAt(child, this.children.length); -}; - -/** - * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown - * - * @method addChildAt - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. - */ -PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) -{ - if(index >= 0 && index <= this.children.length) - { - if(child.parent) - { - child.parent.removeChild(child); - } - - child.parent = this; - - this.children.splice(index, 0, child); - - if(this.stage)child.setStageReference(this.stage); - - return child; - } - else - { - throw new Error(child + 'addChildAt: The index '+ index +' supplied is out of bounds ' + this.children.length); - } -}; - -/** - * Swaps the position of 2 Display Objects within this container. - * - * @method swapChildren - * @param child {DisplayObject} - * @param child2 {DisplayObject} - */ -PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2) -{ - if(child === child2) { - return; - } - - var index1 = this.getChildIndex(child); - var index2 = this.getChildIndex(child2); - - if(index1 < 0 || index2 < 0) { - throw new Error('swapChildren: Both the supplied DisplayObjects must be a child of the caller.'); - } - - this.children[index1] = child2; - this.children[index2] = child; - -}; - -/** - * Returns the index position of a child DisplayObject instance - * - * @method getChildIndex - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify - */ -PIXI.DisplayObjectContainer.prototype.getChildIndex = function(child) -{ - var index = this.children.indexOf(child); - if (index === -1) - { - throw new Error('The supplied DisplayObject must be a child of the caller'); - } - return index; -}; - -/** - * Changes the position of an existing child in the display object container - * - * @method setChildIndex - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object - */ -PIXI.DisplayObjectContainer.prototype.setChildIndex = function(child, index) -{ - if (index < 0 || index >= this.children.length) - { - throw new Error('The supplied index is out of bounds'); - } - var currentIndex = this.getChildIndex(child); - this.children.splice(currentIndex, 1); //remove from old position - this.children.splice(index, 0, child); //add at new position -}; - -/** - * Returns the child at the specified index - * - * @method getChildAt - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child at the given index, if any. - */ -PIXI.DisplayObjectContainer.prototype.getChildAt = function(index) -{ - if (index < 0 || index >= this.children.length) - { - throw new Error('getChildAt: Supplied index '+ index +' does not exist in the child list, or the supplied DisplayObject must be a child of the caller'); - } - return this.children[index]; - -}; - -/** - * Removes a child from the container. - * - * @method removeChild - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. - */ -PIXI.DisplayObjectContainer.prototype.removeChild = function(child) -{ - var index = this.children.indexOf( child ); - if(index === -1)return; - - return this.removeChildAt( index ); -}; - -/** - * Removes a child from the specified index position. - * - * @method removeChildAt - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. - */ -PIXI.DisplayObjectContainer.prototype.removeChildAt = function(index) -{ - var child = this.getChildAt( index ); - if(this.stage) - child.removeStageReference(); - - child.parent = undefined; - this.children.splice( index, 1 ); - return child; -}; - -/** -* Removes all children from this container that are within the begin and end indexes. -* -* @method removeChildren -* @param beginIndex {Number} The beginning position. Default value is 0. -* @param endIndex {Number} The ending position. Default value is size of the container. -*/ -PIXI.DisplayObjectContainer.prototype.removeChildren = function(beginIndex, endIndex) -{ - var begin = beginIndex || 0; - var end = typeof endIndex === 'number' ? endIndex : this.children.length; - var range = end - begin; - - if (range > 0 && range <= end) - { - var removed = this.children.splice(begin, range); - for (var i = 0; i < removed.length; i++) { - var child = removed[i]; - if(this.stage) - child.removeStageReference(); - child.parent = undefined; - } - return removed; - } - else if (range === 0 && this.children.length === 0) - { - return []; - } - else - { - throw new Error( 'removeChildren: Range Error, numeric values are outside the acceptable range' ); - } -}; - -/* - * Updates the transform on all children of this container for rendering - * - * @method updateTransform - * @private - */ -PIXI.DisplayObjectContainer.prototype.updateTransform = function() -{ - if(!this.visible)return; - - this.displayObjectUpdateTransform(); - - //PIXI.DisplayObject.prototype.updateTransform.call( this ); - - if(this._cacheAsBitmap)return; - - for(var i=0,j=this.children.length; i childMaxX ? maxX : childMaxX; - maxY = maxY > childMaxY ? maxY : childMaxY; - } - - if(!childVisible) - return PIXI.EmptyRectangle; - - var bounds = this._bounds; - - bounds.x = minX; - bounds.y = minY; - bounds.width = maxX - minX; - bounds.height = maxY - minY; - - // TODO: store a reference so that if this function gets called again in the render cycle we do not have to recalculate - //this._currentBounds = bounds; - - return bounds; -}; - -/** - * Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration. - * - * @method getLocalBounds - * @return {Rectangle} The rectangular bounding area - */ -PIXI.DisplayObjectContainer.prototype.getLocalBounds = function() -{ - var matrixCache = this.worldTransform; - - this.worldTransform = PIXI.identityMatrix; - - for(var i=0,j=this.children.length; i maxX ? x1 : maxX; - maxX = x2 > maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y1 > maxY ? y1 : maxY; - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - } - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Sprite.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(!this.visible || this.alpha <= 0)return; - - var i,j; - - // do a quick check to see if this element has a mask or a filter. - if(this._mask || this._filters) - { - var spriteBatch = renderSession.spriteBatch; - - // push filter first as we need to ensure the stencil buffer is correct for any masking - if(this._filters) - { - spriteBatch.flush(); - renderSession.filterManager.pushFilter(this._filterBlock); - } - - if(this._mask) - { - spriteBatch.stop(); - renderSession.maskManager.pushMask(this.mask, renderSession); - spriteBatch.start(); - } - - // add this sprite to the batch - spriteBatch.render(this); - - // now loop through the children and make sure they get rendered - for(i=0,j=this.children.length; i= this.textures.length) - { - this.gotoAndStop(this.textures.length - 1); - if(this.onComplete) - { - this.onComplete(); - } - } -}; - -/** - * A short hand way of creating a movieclip from an array of frame ids - * - * @static - * @method fromFrames - * @param frames {Array} the array of frames ids the movieclip will use as its texture frames - * @return {MovieClip} - */ -PIXI.MovieClip.fromFrames = function(frames) -{ - var textures = []; - - for (var i = 0; i < frames.length; i++) - { - textures.push(new PIXI.Texture.fromFrame(frames[i])); - } - - return new PIXI.MovieClip(textures); -}; - -/** - * A short hand way of creating a movieclip from an array of image ids - * - * @static - * @method fromImages - * @param frames {Array} the array of image ids the movieclip will use as its texture frames - * @return {MovieClip} - */ -PIXI.MovieClip.fromImages = function(images) -{ - var textures = []; - - for (var i = 0; i < images.length; i++) - { - textures.push(new PIXI.Texture.fromImage(images[i])); - } - - return new PIXI.MovieClip(textures); -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A target and pass info object for filters. - * - * @class FilterBlock - * @constructor - */ -PIXI.FilterBlock = function() -{ - /** - * The visible state of this FilterBlock. - * - * @property visible - * @type Boolean - */ - this.visible = true; - - /** - * The renderable state of this FilterBlock. - * - * @property renderable - * @type Boolean - */ - this.renderable = true; -}; - -PIXI.FilterBlock.prototype.constructor = PIXI.FilterBlock; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * Modified by Tom Slezakowski http://www.tomslezakowski.com @TomSlezakowski (24/03/2014) - Added dropShadowColor. - */ - -/** - * A Text Object will create a line or multiple lines of text. To split a line you can use '\n' in your text string, - * or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object. - * - * @class Text - * @extends Sprite - * @constructor - * @param text {String} The copy that you would like the text to display - * @param [style] {Object} The style parameters - * @param [style.font] {String} default 'bold 20px Arial' The style and size of the font - * @param [style.fill='black'] {String|Number} A canvas fillstyle that will be used on the text e.g 'red', '#00FF00' - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - * @param [style.stroke] {String|Number} A canvas fillstyle that will be used on the text stroke e.g 'blue', '#FCFF00' - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke) - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap, it needs wordWrap to be set to true - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00' - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow - */ -PIXI.Text = function(text, style) -{ - /** - * The canvas element that everything is drawn to - * - * @property canvas - * @type HTMLCanvasElement - */ - this.canvas = document.createElement('canvas'); - - /** - * The canvas 2d context that everything is drawn with - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.canvas.getContext('2d'); - - /** - * The resolution of the canvas. - * @property resolution - * @type Number - */ - this.resolution = 1; - - PIXI.Sprite.call(this, PIXI.Texture.fromCanvas(this.canvas)); - - this.setText(text); - this.setStyle(style); - -}; - -// constructor -PIXI.Text.prototype = Object.create(PIXI.Sprite.prototype); -PIXI.Text.prototype.constructor = PIXI.Text; - -/** - * The width of the Text, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.Text.prototype, 'width', { - get: function() { - - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - - return this.scale.x * this.texture.frame.width; - }, - set: function(value) { - this.scale.x = value / this.texture.frame.width; - this._width = value; - } -}); - -/** - * The height of the Text, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.Text.prototype, 'height', { - get: function() { - - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - - return this.scale.y * this.texture.frame.height; - }, - set: function(value) { - this.scale.y = value / this.texture.frame.height; - this._height = value; - } -}); - -/** - * Set the style of the text - * - * @method setStyle - * @param [style] {Object} The style parameters - * @param [style.font='bold 20pt Arial'] {String} The style and size of the font - * @param [style.fill='black'] {Object} A canvas fillstyle that will be used on the text eg 'red', '#00FF00' - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - * @param [style.stroke='black'] {String} A canvas fillstyle that will be used on the text stroke eg 'blue', '#FCFF00' - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke) - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00' - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow - */ -PIXI.Text.prototype.setStyle = function(style) -{ - style = style || {}; - style.font = style.font || 'bold 20pt Arial'; - style.fill = style.fill || 'black'; - style.align = style.align || 'left'; - style.stroke = style.stroke || 'black'; //provide a default, see: https://github.com/GoodBoyDigital/pixi.js/issues/136 - style.strokeThickness = style.strokeThickness || 0; - style.wordWrap = style.wordWrap || false; - style.wordWrapWidth = style.wordWrapWidth || 100; - - style.dropShadow = style.dropShadow || false; - style.dropShadowAngle = style.dropShadowAngle || Math.PI / 6; - style.dropShadowDistance = style.dropShadowDistance || 4; - style.dropShadowColor = style.dropShadowColor || 'black'; - - this.style = style; - this.dirty = true; -}; - -/** - * Set the copy for the text object. To split a line you can use '\n'. - * - * @method setText - * @param text {String} The copy that you would like the text to display - */ -PIXI.Text.prototype.setText = function(text) -{ - this.text = text.toString() || ' '; - this.dirty = true; -}; - -/** - * Renders text and updates it when needed - * - * @method updateText - * @private - */ -PIXI.Text.prototype.updateText = function() -{ - this.texture.baseTexture.resolution = this.resolution; - - this.context.font = this.style.font; - - var outputText = this.text; - - // word wrap - // preserve original text - if(this.style.wordWrap)outputText = this.wordWrap(this.text); - - //split text into lines - var lines = outputText.split(/(?:\r\n|\r|\n)/); - - //calculate text width - var lineWidths = []; - var maxLineWidth = 0; - var fontProperties = this.determineFontProperties(this.style.font); - for (var i = 0; i < lines.length; i++) - { - var lineWidth = this.context.measureText(lines[i]).width; - lineWidths[i] = lineWidth; - maxLineWidth = Math.max(maxLineWidth, lineWidth); - } - - var width = maxLineWidth + this.style.strokeThickness; - if(this.style.dropShadow)width += this.style.dropShadowDistance; - - this.canvas.width = ( width + this.context.lineWidth ) * this.resolution; - - //calculate text height - var lineHeight = fontProperties.fontSize + this.style.strokeThickness; - - var height = lineHeight * lines.length; - if(this.style.dropShadow)height += this.style.dropShadowDistance; - - this.canvas.height = height * this.resolution; - - this.context.scale( this.resolution, this.resolution); - - if(navigator.isCocoonJS) this.context.clearRect(0,0,this.canvas.width,this.canvas.height); - - // used for debugging.. - //this.context.fillStyle ="#FF0000" - //this.context.fillRect(0, 0, this.canvas.width,this.canvas.height); - - this.context.font = this.style.font; - this.context.strokeStyle = this.style.stroke; - this.context.lineWidth = this.style.strokeThickness; - this.context.textBaseline = 'alphabetic'; - //this.context.lineJoin = 'round'; - - var linePositionX; - var linePositionY; - - if(this.style.dropShadow) - { - this.context.fillStyle = this.style.dropShadowColor; - - var xShadowOffset = Math.sin(this.style.dropShadowAngle) * this.style.dropShadowDistance; - var yShadowOffset = Math.cos(this.style.dropShadowAngle) * this.style.dropShadowDistance; - - for (i = 0; i < lines.length; i++) - { - linePositionX = this.style.strokeThickness / 2; - linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent; - - if(this.style.align === 'right') - { - linePositionX += maxLineWidth - lineWidths[i]; - } - else if(this.style.align === 'center') - { - linePositionX += (maxLineWidth - lineWidths[i]) / 2; - } - - if(this.style.fill) - { - this.context.fillText(lines[i], linePositionX + xShadowOffset, linePositionY + yShadowOffset); - } - - // if(dropShadow) - } - } - - //set canvas text styles - this.context.fillStyle = this.style.fill; - - //draw lines line by line - for (i = 0; i < lines.length; i++) - { - linePositionX = this.style.strokeThickness / 2; - linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent; - - if(this.style.align === 'right') - { - linePositionX += maxLineWidth - lineWidths[i]; - } - else if(this.style.align === 'center') - { - linePositionX += (maxLineWidth - lineWidths[i]) / 2; - } - - if(this.style.stroke && this.style.strokeThickness) - { - this.context.strokeText(lines[i], linePositionX, linePositionY); - } - - if(this.style.fill) - { - this.context.fillText(lines[i], linePositionX, linePositionY); - } - - // if(dropShadow) - } - - this.updateTexture(); -}; - -/** - * Updates texture size based on canvas size - * - * @method updateTexture - * @private - */ -PIXI.Text.prototype.updateTexture = function() -{ - this.texture.baseTexture.width = this.canvas.width; - this.texture.baseTexture.height = this.canvas.height; - this.texture.crop.width = this.texture.frame.width = this.canvas.width; - this.texture.crop.height = this.texture.frame.height = this.canvas.height; - - this._width = this.canvas.width; - this._height = this.canvas.height; - - // update the dirty base textures - this.texture.baseTexture.dirty(); -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Text.prototype._renderWebGL = function(renderSession) -{ - if(this.dirty) - { - this.resolution = renderSession.resolution; - - this.updateText(); - this.dirty = false; - } - - PIXI.Sprite.prototype._renderWebGL.call(this, renderSession); -}; - -/** -* Renders the object using the Canvas renderer -* -* @method _renderCanvas -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Text.prototype._renderCanvas = function(renderSession) -{ - if(this.dirty) - { - this.resolution = renderSession.resolution; - - this.updateText(); - this.dirty = false; - } - - PIXI.Sprite.prototype._renderCanvas.call(this, renderSession); -}; - -/** -* Calculates the ascent, descent and fontSize of a given fontStyle -* -* @method determineFontProperties -* @param fontStyle {Object} -* @private -*/ -PIXI.Text.prototype.determineFontProperties = function(fontStyle) -{ - var properties = PIXI.Text.fontPropertiesCache[fontStyle]; - - if(!properties) - { - properties = {}; - - var canvas = PIXI.Text.fontPropertiesCanvas; - var context = PIXI.Text.fontPropertiesContext; - - context.font = fontStyle; - - var width = Math.ceil(context.measureText('|Mq').width); - var baseline = Math.ceil(context.measureText('M').width); - var height = 2 * baseline; - - baseline = baseline * 1.4 | 0; - - canvas.width = width; - canvas.height = height; - - context.fillStyle = '#f00'; - context.fillRect(0, 0, width, height); - - context.font = fontStyle; - - context.textBaseline = 'alphabetic'; - context.fillStyle = '#000'; - context.fillText('|MÉq', 0, baseline); - - var imagedata = context.getImageData(0, 0, width, height).data; - var pixels = imagedata.length; - var line = width * 4; - - var i, j; - - var idx = 0; - var stop = false; - - // ascent. scan from top to bottom until we find a non red pixel - for(i = 0; i < baseline; i++) - { - for(j = 0; j < line; j += 4) - { - if(imagedata[idx + j] !== 255) - { - stop = true; - break; - } - } - if(!stop) - { - idx += line; - } - else - { - break; - } - } - - properties.ascent = baseline - i; - - idx = pixels - line; - stop = false; - - // descent. scan from bottom to top until we find a non red pixel - for(i = height; i > baseline; i--) - { - for(j = 0; j < line; j += 4) - { - if(imagedata[idx + j] !== 255) - { - stop = true; - break; - } - } - if(!stop) - { - idx -= line; - } - else - { - break; - } - } - - properties.descent = i - baseline; - //TODO might need a tweak. kind of a temp fix! - properties.descent += 6; - properties.fontSize = properties.ascent + properties.descent; - - PIXI.Text.fontPropertiesCache[fontStyle] = properties; - } - - return properties; -}; - -/** - * Applies newlines to a string to have it optimally fit into the horizontal - * bounds set by the Text object's wordWrapWidth property. - * - * @method wordWrap - * @param text {String} - * @private - */ -PIXI.Text.prototype.wordWrap = function(text) -{ - // Greedy wrapping algorithm that will wrap words as the line grows longer - // than its horizontal bounds. - var result = ''; - var lines = text.split('\n'); - for (var i = 0; i < lines.length; i++) - { - var spaceLeft = this.style.wordWrapWidth; - var words = lines[i].split(' '); - for (var j = 0; j < words.length; j++) - { - var wordWidth = this.context.measureText(words[j]).width; - var wordWidthWithSpace = wordWidth + this.context.measureText(' ').width; - if(j === 0 || wordWidthWithSpace > spaceLeft) - { - // Skip printing the newline if it's the first word of the line that is - // greater than the word wrap width. - if(j > 0) - { - result += '\n'; - } - result += words[j]; - spaceLeft = this.style.wordWrapWidth - wordWidth; - } - else - { - spaceLeft -= wordWidthWithSpace; - result += ' ' + words[j]; - } - } - - if (i < lines.length-1) - { - result += '\n'; - } - } - return result; -}; - -/** -* Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. -* -* @method getBounds -* @param matrix {Matrix} the transformation matrix of the Text -* @return {Rectangle} the framing rectangle -*/ -PIXI.Text.prototype.getBounds = function(matrix) -{ - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - return PIXI.Sprite.prototype.getBounds.call(this, matrix); -}; - -/** - * Destroys this text object. - * - * @method destroy - * @param destroyBaseTexture {Boolean} whether to destroy the base texture as well - */ -PIXI.Text.prototype.destroy = function(destroyBaseTexture) -{ - // make sure to reset the the context and canvas.. dont want this hanging around in memory! - this.context = null; - this.canvas = null; - - this.texture.destroy(destroyBaseTexture === undefined ? true : destroyBaseTexture); -}; - -PIXI.Text.fontPropertiesCache = {}; -PIXI.Text.fontPropertiesCanvas = document.createElement('canvas'); -PIXI.Text.fontPropertiesContext = PIXI.Text.fontPropertiesCanvas.getContext('2d'); - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A BitmapText object will create a line or multiple lines of text using bitmap font. To split a line you can use '\n', '\r' or '\r\n' in your string. - * You can generate the fnt files using - * http://www.angelcode.com/products/bmfont/ for windows or - * http://www.bmglyph.com/ for mac. - * - * @class BitmapText - * @extends DisplayObjectContainer - * @constructor - * @param text {String} The copy that you would like the text to display - * @param style {Object} The style parameters - * @param style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously) - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - */ -PIXI.BitmapText = function(text, style) -{ - PIXI.DisplayObjectContainer.call(this); - - /** - * [read-only] The width of the overall text, different from fontSize, - * which is defined in the style object - * - * @property textWidth - * @type Number - * @readOnly - */ - this.textWidth = 0; - - /** - * [read-only] The height of the overall text, different from fontSize, - * which is defined in the style object - * - * @property textHeight - * @type Number - * @readOnly - */ - this.textHeight = 0; - - /** - * @property _pool - * @type Array - * @private - */ - this._pool = []; - - this.setText(text); - this.setStyle(style); - this.updateText(); - - /** - * The dirty state of this object. - * @property dirty - * @type Boolean - */ - this.dirty = false; -}; - -// constructor -PIXI.BitmapText.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); -PIXI.BitmapText.prototype.constructor = PIXI.BitmapText; - -/** - * Set the text string to be rendered. - * - * @method setText - * @param text {String} The text that you would like displayed - */ -PIXI.BitmapText.prototype.setText = function(text) -{ - this.text = text || ' '; - this.dirty = true; -}; - -/** - * Set the style of the text - * style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously) - * [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single lines of text - * - * @method setStyle - * @param style {Object} The style parameters, contained as properties of an object - */ -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; - this.tint = style.tint; -}; - -/** - * Renders text and updates it when needed - * - * @method updateText - * @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(/(?:\r\n|\r|\n)/.test(this.text.charAt(i))) - { - 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.kerning[prevCharCode]) - { - pos.x += charData.kerning[prevCharCode]; - } - - chars.push({texture:charData.texture, 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); - } - - var lenChildren = this.children.length; - var lenChars = chars.length; - var tint = this.tint || 0xFFFFFF; - - for(i = 0; i < lenChars; i++) - { - var c = i < lenChildren ? this.children[i] : this._pool.pop(); // get old child if have. if not - take from pool. - - if (c) c.setTexture(chars[i].texture); // check if got one before. - else c = new PIXI.Sprite(chars[i].texture); // if no create new one. - - c.position.x = (chars[i].position.x + lineAlignOffsets[chars[i].line]) * scale; - c.position.y = chars[i].position.y * scale; - c.scale.x = c.scale.y = scale; - c.tint = tint; - if (!c.parent) this.addChild(c); - } - - // remove unnecessary children. - // and put their into the pool. - while(this.children.length > lenChars) - { - var child = this.getChildAt(this.children.length - 1); - this._pool.push(child); - this.removeChild(child); - } - - this.textWidth = maxLineWidth * scale; - this.textHeight = (pos.y + data.lineHeight) * scale; -}; - -/** - * Updates the transform of this object - * - * @method updateTransform - * @private - */ -PIXI.BitmapText.prototype.updateTransform = function() -{ - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - PIXI.DisplayObjectContainer.prototype.updateTransform.call(this); -}; - -PIXI.BitmapText.fonts = {}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Holds all information related to an Interaction event - * - * @class InteractionData - * @constructor - */ -PIXI.InteractionData = function() -{ - /** - * This point stores the global coords of where the touch/mouse event happened - * - * @property global - * @type Point - */ - this.global = new PIXI.Point(); - - /** - * The target Sprite that was interacted with - * - * @property target - * @type Sprite - */ - this.target = null; - - /** - * When passed to an event handler, this will be the original DOM Event that was captured - * - * @property originalEvent - * @type Event - */ - this.originalEvent = null; -}; - -/** - * This will return the local coordinates of the specified displayObject for this InteractionData - * - * @method getLocalPosition - * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off - * @param [point] {Point} A Point object in which to store the value, optional (otherwise will create a new point) - * @return {Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject - */ -PIXI.InteractionData.prototype.getLocalPosition = function(displayObject, point) -{ - var worldTransform = displayObject.worldTransform; - var global = this.global; - - // do a cheeky transform to get the mouse coords; - var a00 = worldTransform.a, a01 = worldTransform.c, a02 = worldTransform.tx, - a10 = worldTransform.b, a11 = worldTransform.d, a12 = worldTransform.ty, - id = 1 / (a00 * a11 + a01 * -a10); - - point = point || new PIXI.Point(); - - point.x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id; - point.y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; - - // set the mouse coords... - return point; -}; - -// constructor -PIXI.InteractionData.prototype.constructor = PIXI.InteractionData; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - - /** - * The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive - * if its interactive parameter is set to true - * This manager also supports multitouch. - * - * @class InteractionManager - * @constructor - * @param stage {Stage} The stage to handle interactions - */ -PIXI.InteractionManager = function(stage) -{ - /** - * A reference to the stage - * - * @property stage - * @type Stage - */ - this.stage = stage; - - /** - * The mouse data - * - * @property mouse - * @type InteractionData - */ - this.mouse = new PIXI.InteractionData(); - - /** - * An object that stores current touches (InteractionData) by id reference - * - * @property touches - * @type Object - */ - this.touches = {}; - - /** - * @property tempPoint - * @type Point - * @private - */ - this.tempPoint = new PIXI.Point(); - - /** - * @property mouseoverEnabled - * @type Boolean - * @default - */ - this.mouseoverEnabled = true; - - /** - * Tiny little interactiveData pool ! - * - * @property pool - * @type Array - */ - this.pool = []; - - /** - * An array containing all the iterative items from the our interactive tree - * @property interactiveItems - * @type Array - * @private - */ - this.interactiveItems = []; - - /** - * Our canvas - * @property interactionDOMElement - * @type HTMLCanvasElement - * @private - */ - this.interactionDOMElement = null; - - //this will make it so that you don't have to call bind all the time - - /** - * @property onMouseMove - * @type Function - */ - this.onMouseMove = this.onMouseMove.bind( this ); - - /** - * @property onMouseDown - * @type Function - */ - this.onMouseDown = this.onMouseDown.bind(this); - - /** - * @property onMouseOut - * @type Function - */ - this.onMouseOut = this.onMouseOut.bind(this); - - /** - * @property onMouseUp - * @type Function - */ - this.onMouseUp = this.onMouseUp.bind(this); - - /** - * @property onTouchStart - * @type Function - */ - this.onTouchStart = this.onTouchStart.bind(this); - - /** - * @property onTouchEnd - * @type Function - */ - this.onTouchEnd = this.onTouchEnd.bind(this); - - /** - * @property onTouchCancel - * @type Function - */ - this.onTouchCancel = this.onTouchCancel.bind(this); - - /** - * @property onTouchMove - * @type Function - */ - this.onTouchMove = this.onTouchMove.bind(this); - - /** - * @property last - * @type Number - */ - this.last = 0; - - /** - * The css style of the cursor that is being used - * @property currentCursorStyle - * @type String - */ - this.currentCursorStyle = 'inherit'; - - /** - * Is set to true when the mouse is moved out of the canvas - * @property mouseOut - * @type Boolean - */ - this.mouseOut = false; - - /** - * @property resolution - * @type Number - */ - this.resolution = 1; - - // used for hit testing - this._tempPoint = new PIXI.Point(); -}; - -// constructor -PIXI.InteractionManager.prototype.constructor = PIXI.InteractionManager; - -/** - * Collects an interactive sprite recursively to have their interactions managed - * - * @method collectInteractiveSprite - * @param displayObject {DisplayObject} the displayObject to collect - * @param iParent {DisplayObject} the display object's parent - * @private - */ -PIXI.InteractionManager.prototype.collectInteractiveSprite = function(displayObject, iParent) -{ - var children = displayObject.children; - var length = children.length; - - // make an interaction tree... {item.__interactiveParent} - for (var i = length - 1; i >= 0; i--) - { - var child = children[i]; - - // push all interactive bits - if (child._interactive) - { - iParent.interactiveChildren = true; - //child.__iParent = iParent; - this.interactiveItems.push(child); - - if (child.children.length > 0) { - this.collectInteractiveSprite(child, child); - } - } - else - { - child.__iParent = null; - if (child.children.length > 0) - { - this.collectInteractiveSprite(child, iParent); - } - } - - } -}; - -/** - * Sets the target for event delegation - * - * @method setTarget - * @param target {WebGLRenderer|CanvasRenderer} the renderer to bind events to - * @private - */ -PIXI.InteractionManager.prototype.setTarget = function(target) -{ - this.target = target; - this.resolution = target.resolution; - - // Check if the dom element has been set. If it has don't do anything. - if (this.interactionDOMElement !== null) return; - - this.setTargetDomElement (target.view); -}; - -/** - * Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM - * elements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element - * to receive those events - * - * @method setTargetDomElement - * @param domElement {DOMElement} the DOM element which will receive mouse and touch events - * @private - */ -PIXI.InteractionManager.prototype.setTargetDomElement = function(domElement) -{ - this.removeEvents(); - - if (window.navigator.msPointerEnabled) - { - // time to remove some of that zoom in ja.. - domElement.style['-ms-content-zooming'] = 'none'; - domElement.style['-ms-touch-action'] = 'none'; - } - - this.interactionDOMElement = domElement; - - domElement.addEventListener('mousemove', this.onMouseMove, true); - domElement.addEventListener('mousedown', this.onMouseDown, true); - domElement.addEventListener('mouseout', this.onMouseOut, true); - - // aint no multi touch just yet! - domElement.addEventListener('touchstart', this.onTouchStart, true); - domElement.addEventListener('touchend', this.onTouchEnd, true); - domElement.addEventListener('touchleave', this.onTouchCancel, true); - domElement.addEventListener('touchcancel', this.onTouchCancel, true); - domElement.addEventListener('touchmove', this.onTouchMove, true); - - window.addEventListener('mouseup', this.onMouseUp, true); -}; - -/** - * @method removeEvents - * @private - */ -PIXI.InteractionManager.prototype.removeEvents = function() -{ - if (!this.interactionDOMElement) return; - - this.interactionDOMElement.style['-ms-content-zooming'] = ''; - this.interactionDOMElement.style['-ms-touch-action'] = ''; - - this.interactionDOMElement.removeEventListener('mousemove', this.onMouseMove, true); - this.interactionDOMElement.removeEventListener('mousedown', this.onMouseDown, true); - this.interactionDOMElement.removeEventListener('mouseout', this.onMouseOut, true); - - // aint no multi touch just yet! - this.interactionDOMElement.removeEventListener('touchstart', this.onTouchStart, true); - this.interactionDOMElement.removeEventListener('touchend', this.onTouchEnd, true); - this.interactionDOMElement.removeEventListener('touchleave', this.onTouchCancel, true); - this.interactionDOMElement.removeEventListener('touchcancel', this.onTouchCancel, true); - this.interactionDOMElement.removeEventListener('touchmove', this.onTouchMove, true); - - this.interactionDOMElement = null; - - window.removeEventListener('mouseup', this.onMouseUp, true); -}; - -/** - * updates the state of interactive objects - * - * @method update - * @private - */ -PIXI.InteractionManager.prototype.update = function() -{ - if (!this.target) return; - - // frequency of 30fps?? - var now = Date.now(); - var diff = now - this.last; - diff = (diff * PIXI.INTERACTION_FREQUENCY ) / 1000; - if (diff < 1) return; - this.last = now; - - var i = 0; - - // ok.. so mouse events?? - // yes for now :) - // OPTIMISE - how often to check?? - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - // loop through interactive objects! - var length = this.interactiveItems.length; - var cursor = 'inherit'; - var over = false; - - for (i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - // OPTIMISATION - only calculate every time if the mousemove function exists.. - // OK so.. does the object have any other interactive functions? - // hit-test the clip! - // if (item.mouseover || item.mouseout || item.buttonMode) - // { - // ok so there are some functions so lets hit test it.. - item.__hit = this.hitTest(item, this.mouse); - this.mouse.target = item; - // ok so deal with interactions.. - // looks like there was a hit! - if (item.__hit && !over) - { - if (item.buttonMode) cursor = item.defaultCursor; - - if (!item.interactiveChildren) - { - over = true; - } - - if (!item.__isOver) - { - if (item.mouseover) - { - item.mouseover (this.mouse); - } - item.__isOver = true; - } - } - else - { - if (item.__isOver) - { - // roll out! - if (item.mouseout) - { - item.mouseout (this.mouse); - } - item.__isOver = false; - } - } - } - - if (this.currentCursorStyle !== cursor) - { - this.currentCursorStyle = cursor; - this.interactionDOMElement.style.cursor = cursor; - } -}; - -/** - * @method rebuildInteractiveGraph - * @private - */ -PIXI.InteractionManager.prototype.rebuildInteractiveGraph = function() -{ - this.dirty = false; - - var len = this.interactiveItems.length; - - for (var i = 0; i < len; i++) { - this.interactiveItems[i].interactiveChildren = false; - } - - this.interactiveItems = []; - - if (this.stage.interactive) - { - this.interactiveItems.push(this.stage); - } - - // Go through and collect all the objects that are interactive.. - this.collectInteractiveSprite(this.stage, this.stage); -}; - -/** - * Is called when the mouse moves across the renderer element - * - * @method onMouseMove - * @param event {Event} The DOM event of the mouse moving - * @private - */ -PIXI.InteractionManager.prototype.onMouseMove = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - // TODO optimize by not check EVERY TIME! maybe half as often? // - var rect = this.interactionDOMElement.getBoundingClientRect(); - - this.mouse.global.x = (event.clientX - rect.left) * (this.target.width / rect.width) / this.resolution; - this.mouse.global.y = (event.clientY - rect.top) * ( this.target.height / rect.height) / this.resolution; - - var length = this.interactiveItems.length; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - // Call the function! - if (item.mousemove) - { - item.mousemove(this.mouse); - } - } -}; - -/** - * Is called when the mouse button is pressed down on the renderer element - * - * @method onMouseDown - * @param event {Event} The DOM event of a mouse button being pressed down - * @private - */ -PIXI.InteractionManager.prototype.onMouseDown = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - if (PIXI.AUTO_PREVENT_DEFAULT) - { - this.mouse.originalEvent.preventDefault(); - } - - // loop through interaction tree... - // hit test each item! -> - // get interactive items under point?? - //stage.__i - var length = this.interactiveItems.length; - - var e = this.mouse.originalEvent; - var isRightButton = e.button === 2 || e.which === 3; - var downFunction = isRightButton ? 'rightdown' : 'mousedown'; - var clickFunction = isRightButton ? 'rightclick' : 'click'; - var buttonIsDown = isRightButton ? '__rightIsDown' : '__mouseIsDown'; - var isDown = isRightButton ? '__isRightDown' : '__isDown'; - - // while - // hit test - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - if (item[downFunction] || item[clickFunction]) - { - item[buttonIsDown] = true; - item.__hit = this.hitTest(item, this.mouse); - - if (item.__hit) - { - //call the function! - if (item[downFunction]) - { - item[downFunction](this.mouse); - } - item[isDown] = true; - - // just the one! - if (!item.interactiveChildren) break; - } - } - } -}; - -/** - * Is called when the mouse is moved out of the renderer element - * - * @method onMouseOut - * @param event {Event} The DOM event of a mouse being moved out - * @private - */ -PIXI.InteractionManager.prototype.onMouseOut = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - var length = this.interactiveItems.length; - - this.interactionDOMElement.style.cursor = 'inherit'; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - if (item.__isOver) - { - this.mouse.target = item; - if (item.mouseout) - { - item.mouseout(this.mouse); - } - item.__isOver = false; - } - } - - this.mouseOut = true; - - // move the mouse to an impossible position - this.mouse.global.x = -10000; - this.mouse.global.y = -10000; -}; - -/** - * Is called when the mouse button is released on the renderer element - * - * @method onMouseUp - * @param event {Event} The DOM event of a mouse button being released - * @private - */ -PIXI.InteractionManager.prototype.onMouseUp = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - var length = this.interactiveItems.length; - var up = false; - - var e = this.mouse.originalEvent; - var isRightButton = e.button === 2 || e.which === 3; - - var upFunction = isRightButton ? 'rightup' : 'mouseup'; - var clickFunction = isRightButton ? 'rightclick' : 'click'; - var upOutsideFunction = isRightButton ? 'rightupoutside' : 'mouseupoutside'; - var isDown = isRightButton ? '__isRightDown' : '__isDown'; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - if (item[clickFunction] || item[upFunction] || item[upOutsideFunction]) - { - item.__hit = this.hitTest(item, this.mouse); - - if (item.__hit && !up) - { - //call the function! - if (item[upFunction]) - { - item[upFunction](this.mouse); - } - if (item[isDown]) - { - if (item[clickFunction]) - { - item[clickFunction](this.mouse); - } - } - - if (!item.interactiveChildren) - { - up = true; - } - } - else - { - if (item[isDown]) - { - if (item[upOutsideFunction]) item[upOutsideFunction](this.mouse); - } - } - - item[isDown] = false; - } - } -}; - -/** - * Tests if the current mouse coordinates hit a sprite - * - * @method hitTest - * @param item {DisplayObject} The displayObject to test for a hit - * @param interactionData {InteractionData} The interactionData object to update in the case there is a hit - * @private - */ -PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) -{ - var global = interactionData.global; - - if (!item.worldVisible) - { - return false; - } - - // map the global point to local space. - item.worldTransform.applyInverse(global, this._tempPoint); - - var x = this._tempPoint.x, - y = this._tempPoint.y, - i; - - interactionData.target = item; - - //a sprite or display object with a hit area defined - if (item.hitArea && item.hitArea.contains) - { - return item.hitArea.contains(x, y); - } - // a sprite with no hitarea defined - else if(item instanceof PIXI.Sprite) - { - var width = item.texture.frame.width; - var height = item.texture.frame.height; - var x1 = -width * item.anchor.x; - var y1; - - if (x > x1 && x < x1 + width) - { - y1 = -height * item.anchor.y; - - if (y > y1 && y < y1 + height) - { - // set the target property if a hit is true! - return true; - } - } - } - else if(item instanceof PIXI.Graphics) - { - var graphicsData = item.graphicsData; - for (i = 0; i < graphicsData.length; i++) - { - var data = graphicsData[i]; - if(!data.fill)continue; - - // only deal with fills.. - if(data.shape) - { - if(data.shape.contains(x, y)) - { - //interactionData.target = item; - return true; - } - } - } - } - - var length = item.children.length; - - for (i = 0; i < length; i++) - { - var tempItem = item.children[i]; - var hit = this.hitTest(tempItem, interactionData); - if (hit) - { - // hmm.. TODO SET CORRECT TARGET? - interactionData.target = item; - return true; - } - } - return false; -}; - -/** - * Is called when a touch is moved across the renderer element - * - * @method onTouchMove - * @param event {Event} The DOM event of a touch moving across the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchMove = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - var touchData; - var i = 0; - - for (i = 0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - touchData = this.touches[touchEvent.identifier]; - touchData.originalEvent = event; - - // update the touch position - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - for (var j = 0; j < this.interactiveItems.length; j++) - { - var item = this.interactiveItems[j]; - if (item.touchmove && item.__touchData && item.__touchData[touchEvent.identifier]) - { - item.touchmove(touchData); - } - } - } -}; - -/** - * Is called when a touch is started on the renderer element - * - * @method onTouchStart - * @param event {Event} The DOM event of a touch starting on the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchStart = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - - if (PIXI.AUTO_PREVENT_DEFAULT) - { - event.preventDefault(); - } - - var changedTouches = event.changedTouches; - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - - var touchData = this.pool.pop(); - if (!touchData) - { - touchData = new PIXI.InteractionData(); - } - - touchData.originalEvent = event; - - this.touches[touchEvent.identifier] = touchData; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.touchstart || item.tap) - { - item.__hit = this.hitTest(item, touchData); - - if (item.__hit) - { - //call the function! - if (item.touchstart)item.touchstart(touchData); - item.__isDown = true; - item.__touchData = item.__touchData || {}; - item.__touchData[touchEvent.identifier] = touchData; - - if (!item.interactiveChildren) break; - } - } - } - } -}; - -/** - * Is called when a touch is ended on the renderer element - * - * @method onTouchEnd - * @param event {Event} The DOM event of a touch ending on the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchEnd = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - var touchData = this.touches[touchEvent.identifier]; - var up = false; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.__touchData && item.__touchData[touchEvent.identifier]) - { - - item.__hit = this.hitTest(item, item.__touchData[touchEvent.identifier]); - - // so this one WAS down... - touchData.originalEvent = event; - // hitTest?? - - if (item.touchend || item.tap) - { - if (item.__hit && !up) - { - if (item.touchend) - { - item.touchend(touchData); - } - if (item.__isDown && item.tap) - { - item.tap(touchData); - } - if (!item.interactiveChildren) - { - up = true; - } - } - else - { - if (item.__isDown && item.touchendoutside) - { - item.touchendoutside(touchData); - } - } - - item.__isDown = false; - } - - item.__touchData[touchEvent.identifier] = null; - } - } - // remove the touch.. - this.pool.push(touchData); - this.touches[touchEvent.identifier] = null; - } -}; - -/** - * Is called when a touch is canceled - * - * @method onTouchCancel - * @param event {Event} The DOM event of a touch canceled - * @private - */ -PIXI.InteractionManager.prototype.onTouchCancel = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - var touchData = this.touches[touchEvent.identifier]; - var up = false; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.__touchData && item.__touchData[touchEvent.identifier]) - { - - item.__hit = this.hitTest(item, item.__touchData[touchEvent.identifier]); - - // so this one WAS down... - touchData.originalEvent = event; - // hitTest?? - - if (item.touchcancel && !up) - { - item.touchcancel(touchData); - if (!item.interactiveChildren) - { - up = true; - } - } - - item.__isDown = false; - item.__touchData[touchEvent.identifier] = null; - } - } - // remove the touch.. - this.pool.push(touchData); - this.touches[touchEvent.identifier] = null; - } -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A Stage represents the root of the display tree. Everything connected to the stage is rendered - * - * @class Stage - * @extends DisplayObjectContainer - * @constructor - * @param backgroundColor {Number} the background color of the stage, you have to pass this in is in hex format - * like: 0xFFFFFF for white - * - * Creating a stage is a mandatory process when you use Pixi, which is as simple as this : - * var stage = new PIXI.Stage(0xFFFFFF); - * where the parameter given is the background colour of the stage, in hex - * you will use this stage instance to add your sprites to it and therefore to the renderer - * Here is how to add a sprite to the stage : - * stage.addChild(sprite); - */ -PIXI.Stage = function(backgroundColor) -{ - PIXI.DisplayObjectContainer.call( this ); - - /** - * [read-only] Current transform of the object based on world (parent) factors - * - * @property worldTransform - * @type Matrix - * @readOnly - * @private - */ - this.worldTransform = new PIXI.Matrix(); - - /** - * Whether or not the stage is interactive - * - * @property interactive - * @type Boolean - */ - this.interactive = true; - - /** - * The interaction manage for this stage, manages all interactive activity on the stage - * - * @property interactionManager - * @type InteractionManager - */ - this.interactionManager = new PIXI.InteractionManager(this); - - /** - * Whether the stage is dirty and needs to have interactions updated - * - * @property dirty - * @type Boolean - * @private - */ - this.dirty = true; - - //the stage is its own stage - this.stage = this; - - //optimize hit detection a bit - this.stage.hitArea = new PIXI.Rectangle(0, 0, 100000, 100000); - - this.setBackgroundColor(backgroundColor); -}; - -// constructor -PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); -PIXI.Stage.prototype.constructor = PIXI.Stage; - -/** - * Sets another DOM element which can receive mouse/touch interactions instead of the default Canvas element. - * This is useful for when you have other DOM elements on top of the Canvas element. - * - * @method setInteractionDelegate - * @param domElement {DOMElement} This new domElement which will receive mouse/touch events - */ -PIXI.Stage.prototype.setInteractionDelegate = function(domElement) -{ - this.interactionManager.setTargetDomElement( domElement ); -}; - -/* - * Updates the object transform for rendering - * - * @method updateTransform - * @private - */ -PIXI.Stage.prototype.updateTransform = function() -{ - this.worldAlpha = 1; - - for(var i=0,j=this.children.length; i> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255]; -}; - -/** - * Converts a color as an [R, G, B] array to a hex number - * - * @method rgb2hex - * @param rgb {Array} - */ -PIXI.rgb2hex = function(rgb) { - return ((rgb[0]*255 << 16) + (rgb[1]*255 << 8) + rgb[2]*255); -}; - -/** - * A polyfill for Function.prototype.bind - * - * @method bind - */ -if (typeof Function.prototype.bind !== 'function') { - Function.prototype.bind = (function () { - return function (thisArg) { - var target = this, i = arguments.length - 1, boundArgs = []; - if (i > 0) - { - boundArgs.length = i; - while (i--) boundArgs[i] = arguments[i + 1]; - } - - if (typeof target !== 'function') throw new TypeError(); - - function bound() { - var i = arguments.length, args = new Array(i); - while (i--) args[i] = arguments[i]; - args = boundArgs.concat(args); - return target.apply(this instanceof bound ? this : thisArg, args); - } - - bound.prototype = (function F(proto) { - if (proto) F.prototype = proto; - if (!(this instanceof F)) return new F(); - })(target.prototype); - - return bound; - }; - })(); -} - -/** - * A wrapper for ajax requests to be handled cross browser - * - * @class AjaxRequest - * @constructor - */ -PIXI.AjaxRequest = function() -{ - var activexmodes = ['Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.3.0', 'Microsoft.XMLHTTP']; //activeX versions to check for in IE - - if (window.ActiveXObject) - { //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken) - for (var i=0; i 0 && (number & (number - 1)) === 0) // see: http://goo.gl/D9kPj - return number; - else - { - var result = 1; - while (result < number) result <<= 1; - return result; - } -}; - -/** - * checks if the given width and height make a power of two texture - * @method isPowerOfTwo - * @param width {Number} - * @param height {Number} - * @return {Boolean} - */ -PIXI.isPowerOfTwo = function(width, height) -{ - return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0); - -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * @author Chad Engler https://github.com/englercj @Rolnaaba - */ - -/** - * Originally based on https://github.com/mrdoob/eventtarget.js/ from mr Doob. - * Currently takes inspiration from the nodejs EventEmitter, EventEmitter3, and smokesignals - */ - -/** - * Mixins event emitter functionality to a class - * - * @class EventTarget - * @example - * function MyEmitter() {} - * - * PIXI.EventTarget.mixin(MyEmitter.prototype); - * - * var em = new MyEmitter(); - * em.emit('eventName', 'some data', 'some more data', {}, null, ...); - */ -PIXI.EventTarget = { - /** - * Backward compat from when this used to be a function - */ - call: function callCompat(obj) { - if(obj) { - obj = obj.prototype || obj; - PIXI.EventTarget.mixin(obj); - } - }, - - /** - * Mixes in the properties of the EventTarget prototype onto another object - * - * @method mixin - * @param object {Object} The obj to mix into - */ - mixin: function mixin(obj) { - /** - * Return a list of assigned event listeners. - * - * @method listeners - * @param eventName {String} The events that should be listed. - * @return {Array} An array of listener functions - */ - obj.listeners = function listeners(eventName) { - this._listeners = this._listeners || {}; - - return this._listeners[eventName] ? this._listeners[eventName].slice() : []; - }; - - /** - * Emit an event to all registered event listeners. - * - * @method emit - * @alias dispatchEvent - * @param eventName {String} The name of the event. - * @return {Boolean} Indication if we've emitted an event. - */ - obj.emit = obj.dispatchEvent = function emit(eventName, data) { - this._listeners = this._listeners || {}; - - //backwards compat with old method ".emit({ type: 'something' })" - if(typeof eventName === 'object') { - data = eventName; - eventName = eventName.type; - } - - //ensure we are using a real pixi event - if(!data || data.__isEventObject !== true) { - data = new PIXI.Event(this, eventName, data); - } - - //iterate the listeners - if(this._listeners && this._listeners[eventName]) { - var listeners = this._listeners[eventName].slice(0), - length = listeners.length, - fn = listeners[0], - i; - - for(i = 0; i < length; fn = listeners[++i]) { - //call the event listener - fn.call(this, data); - - //if "stopImmediatePropagation" is called, stop calling sibling events - if(data.stoppedImmediate) { - return this; - } - } - - //if "stopPropagation" is called then don't bubble the event - if(data.stopped) { - return this; - } - } - - //bubble this event up the scene graph - if(this.parent && this.parent.emit) { - this.parent.emit.call(this.parent, eventName, data); - } - - return this; - }; - - /** - * Register a new EventListener for the given event. - * - * @method on - * @alias addEventListener - * @param eventName {String} Name of the event. - * @param callback {Functon} fn Callback function. - */ - obj.on = obj.addEventListener = function on(eventName, fn) { - this._listeners = this._listeners || {}; - - (this._listeners[eventName] = this._listeners[eventName] || []) - .push(fn); - - return this; - }; - - /** - * Add an EventListener that's only called once. - * - * @method once - * @param eventName {String} Name of the event. - * @param callback {Function} Callback function. - */ - obj.once = function once(eventName, fn) { - this._listeners = this._listeners || {}; - - var self = this; - function onceHandlerWrapper() { - fn.apply(self.off(eventName, onceHandlerWrapper), arguments); - } - onceHandlerWrapper._originalHandler = fn; - - return this.on(eventName, onceHandlerWrapper); - }; - - /** - * Remove event listeners. - * - * @method off - * @alias removeEventListener - * @param eventName {String} The event we want to remove. - * @param callback {Function} The listener that we need to find. - */ - obj.off = obj.removeEventListener = function off(eventName, fn) { - this._listeners = this._listeners || {}; - - if(!this._listeners[eventName]) - return this; - - var list = this._listeners[eventName], - i = fn ? list.length : 0; - - while(i-- > 0) { - if(list[i] === fn || list[i]._originalHandler === fn) { - list.splice(i, 1); - } - } - - if(list.length === 0) { - delete this._listeners[eventName]; - } - - return this; - }; - - /** - * Remove all listeners or only the listeners for the specified event. - * - * @method removeAllListeners - * @param eventName {String} The event you want to remove all listeners for. - */ - obj.removeAllListeners = function removeAllListeners(eventName) { - this._listeners = this._listeners || {}; - - if(!this._listeners[eventName]) - return this; - - delete this._listeners[eventName]; - - return this; - }; - } -}; - -/** - * Creates an homogenous object for tracking events so users can know what to expect. - * - * @class Event - * @extends Object - * @constructor - * @param target {Object} The target object that the event is called on - * @param name {String} The string name of the event that was triggered - * @param data {Object} Arbitrary event data to pass along - */ -PIXI.Event = function(target, name, data) { - //for duck typing in the ".on()" function - this.__isEventObject = true; - - /** - * Tracks the state of bubbling propagation. Do not - * set this directly, instead use `event.stopPropagation()` - * - * @property stopped - * @type Boolean - * @private - * @readOnly - */ - this.stopped = false; - - /** - * Tracks the state of sibling listener propagation. Do not - * set this directly, instead use `event.stopImmediatePropagation()` - * - * @property stoppedImmediate - * @type Boolean - * @private - * @readOnly - */ - this.stoppedImmediate = false; - - /** - * The original target the event triggered on. - * - * @property target - * @type Object - * @readOnly - */ - this.target = target; - - /** - * The string name of the event that this represents. - * - * @property type - * @type String - * @readOnly - */ - this.type = name; - - /** - * The data that was passed in with this event. - * - * @property data - * @type Object - * @readOnly - */ - this.data = data; - - //backwards compat with older version of events - this.content = data; - - /** - * The timestamp when the event occurred. - * - * @property timeStamp - * @type Number - * @readOnly - */ - this.timeStamp = Date.now(); -}; - -/** - * Stops the propagation of events up the scene graph (prevents bubbling). - * - * @method stopPropagation - */ -PIXI.Event.prototype.stopPropagation = function stopPropagation() { - this.stopped = true; -}; - -/** - * Stops the propagation of events to sibling listeners (no longer calls any listeners). - * - * @method stopImmediatePropagation - */ -PIXI.Event.prototype.stopImmediatePropagation = function stopImmediatePropagation() { - this.stoppedImmediate = true; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This helper function will automatically detect which renderer you should be using. - * WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by - * the browser then this function will return a canvas renderer - * - * @method autoDetectRenderer - * @for PIXI - * @static - * @param width=800 {Number} the width of the renderers view - * @param height=600 {Number} the height of the renderers view - * - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * - */ -PIXI.autoDetectRenderer = function(width, height, options) -{ - if(!width)width = 800; - if(!height)height = 600; - - // BORROWED from Mr Doob (mrdoob.com) - var webgl = ( function () { try { - var canvas = document.createElement( 'canvas' ); - return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ); - } catch( e ) { - return false; - } - } )(); - - if( webgl ) - { - return new PIXI.WebGLRenderer(width, height, options); - } - - return new PIXI.CanvasRenderer(width, height, options); -}; - -/** - * This helper function will automatically detect which renderer you should be using. - * This function is very similar to the autoDetectRenderer function except that is will return a canvas renderer for android. - * Even thought both android chrome supports webGL the canvas implementation perform better at the time of writing. - * This function will likely change and update as webGL performance improves on these devices. - * - * @method autoDetectRecommendedRenderer - * @for PIXI - * @static - * @param width=800 {Number} the width of the renderers view - * @param height=600 {Number} the height of the renderers view - * - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * - */ -PIXI.autoDetectRecommendedRenderer = function(width, height, options) -{ - if(!width)width = 800; - if(!height)height = 600; - - // BORROWED from Mr Doob (mrdoob.com) - var webgl = ( function () { try { - var canvas = document.createElement( 'canvas' ); - return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ); - } catch( e ) { - return false; - } - } )(); - - var isAndroid = /Android/i.test(navigator.userAgent); - - if( webgl && !isAndroid) - { - return new PIXI.WebGLRenderer(width, height, options); - } - - return new PIXI.CanvasRenderer(width, height, options); -}; - -/* - PolyK library - url: http://polyk.ivank.net - Released under MIT licence. - - Copyright (c) 2012 Ivan Kuckir - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation - files (the "Software"), to deal in the Software without - restriction, including without limitation the rights to use, - copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following - conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. - - This is an amazing lib! - - Slightly modified by Mat Groves (matgroves.com); -*/ - -/** - * Based on the Polyk library http://polyk.ivank.net released under MIT licence. - * This is an amazing lib! - * Slightly modified by Mat Groves (matgroves.com); - * @class PolyK - */ -PIXI.PolyK = {}; - -/** - * Triangulates shapes for webGL graphic fills. - * - * @method Triangulate - */ -PIXI.PolyK.Triangulate = function(p) -{ - var sign = true; - - var n = p.length >> 1; - if(n < 3) return []; - - var tgs = []; - var avl = []; - for(var i = 0; i < n; i++) avl.push(i); - - i = 0; - var al = n; - while(al > 3) - { - var i0 = avl[(i+0)%al]; - var i1 = avl[(i+1)%al]; - var i2 = avl[(i+2)%al]; - - var ax = p[2*i0], ay = p[2*i0+1]; - var bx = p[2*i1], by = p[2*i1+1]; - var cx = p[2*i2], cy = p[2*i2+1]; - - var earFound = false; - if(PIXI.PolyK._convex(ax, ay, bx, by, cx, cy, sign)) - { - earFound = true; - for(var j = 0; j < al; j++) - { - var vi = avl[j]; - if(vi === i0 || vi === i1 || vi === i2) continue; - - if(PIXI.PolyK._PointInTriangle(p[2*vi], p[2*vi+1], ax, ay, bx, by, cx, cy)) { - earFound = false; - break; - } - } - } - - if(earFound) - { - tgs.push(i0, i1, i2); - avl.splice((i+1)%al, 1); - al--; - i = 0; - } - else if(i++ > 3*al) - { - // need to flip flip reverse it! - // reset! - if(sign) - { - tgs = []; - avl = []; - for(i = 0; i < n; i++) avl.push(i); - - i = 0; - al = n; - - sign = false; - } - else - { - // window.console.log("PIXI Warning: shape too complex to fill"); - return null; - } - } - } - - tgs.push(avl[0], avl[1], avl[2]); - return tgs; -}; - -/** - * Checks whether a point is within a triangle - * - * @method _PointInTriangle - * @param px {Number} x coordinate of the point to test - * @param py {Number} y coordinate of the point to test - * @param ax {Number} x coordinate of the a point of the triangle - * @param ay {Number} y coordinate of the a point of the triangle - * @param bx {Number} x coordinate of the b point of the triangle - * @param by {Number} y coordinate of the b point of the triangle - * @param cx {Number} x coordinate of the c point of the triangle - * @param cy {Number} y coordinate of the c point of the triangle - * @private - * @return {Boolean} - */ -PIXI.PolyK._PointInTriangle = function(px, py, ax, ay, bx, by, cx, cy) -{ - var v0x = cx-ax; - var v0y = cy-ay; - var v1x = bx-ax; - var v1y = by-ay; - var v2x = px-ax; - var v2y = py-ay; - - var dot00 = v0x*v0x+v0y*v0y; - var dot01 = v0x*v1x+v0y*v1y; - var dot02 = v0x*v2x+v0y*v2y; - var dot11 = v1x*v1x+v1y*v1y; - var dot12 = v1x*v2x+v1y*v2y; - - var invDenom = 1 / (dot00 * dot11 - dot01 * dot01); - var u = (dot11 * dot02 - dot01 * dot12) * invDenom; - var v = (dot00 * dot12 - dot01 * dot02) * invDenom; - - // Check if point is in triangle - return (u >= 0) && (v >= 0) && (u + v < 1); -}; - -/** - * Checks whether a shape is convex - * - * @method _convex - * @private - * @return {Boolean} - */ -PIXI.PolyK._convex = function(ax, ay, bx, by, cx, cy, sign) -{ - return ((ay-by)*(cx-bx) + (bx-ax)*(cy-by) >= 0) === sign; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @method initDefaultShaders -* @static -* @private -*/ -PIXI.initDefaultShaders = function() -{ -}; - -/** -* @method CompileVertexShader -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @return {Any} -*/ -PIXI.CompileVertexShader = function(gl, shaderSrc) -{ - return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER); -}; - -/** -* @method CompileFragmentShader -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @return {Any} -*/ -PIXI.CompileFragmentShader = function(gl, shaderSrc) -{ - return PIXI._CompileShader(gl, shaderSrc, gl.FRAGMENT_SHADER); -}; - -/** -* @method _CompileShader -* @static -* @private -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @param shaderType {Number} -* @return {Any} -*/ -PIXI._CompileShader = function(gl, shaderSrc, shaderType) -{ - var src = shaderSrc.join("\n"); - var shader = gl.createShader(shaderType); - gl.shaderSource(shader, src); - gl.compileShader(shader); - - if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) - { - window.console.log(gl.getShaderInfoLog(shader)); - return null; - } - - return shader; -}; - -/** -* @method compileProgram -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param vertexSrc {Array} -* @param fragmentSrc {Array} -* @return {Any} -*/ -PIXI.compileProgram = function(gl, vertexSrc, fragmentSrc) -{ - var fragmentShader = PIXI.CompileFragmentShader(gl, fragmentSrc); - var vertexShader = PIXI.CompileVertexShader(gl, vertexSrc); - - var shaderProgram = gl.createProgram(); - - gl.attachShader(shaderProgram, vertexShader); - gl.attachShader(shaderProgram, fragmentShader); - gl.linkProgram(shaderProgram); - - if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) - { - window.console.log("Could not initialise shaders"); - } - - return shaderProgram; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * @author Richard Davey http://www.photonstorm.com @photonstorm - */ - -/** -* @class PixiShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PixiShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]; - - /** - * A local texture counter for multi-texture shaders. - * @property textureCount - * @type Number - */ - this.textureCount = 0; - - /** - * A local flag - * @property firstRun - * @type Boolean - * @private - */ - this.firstRun = true; - - /** - * A dirty flag - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * Uniform attributes cache. - * @property attributes - * @type Array - * @private - */ - this.attributes = []; - - this.init(); -}; - -PIXI.PixiShader.prototype.constructor = PIXI.PixiShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PixiShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc || PIXI.PixiShader.defaultVertexSrc, this.fragmentSrc); - - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.dimensions = gl.getUniformLocation(program, 'dimensions'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - // Begin worst hack eva // - - // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? - // maybe its something to do with the current state of the gl context. - // I'm convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel - // If theres any webGL people that know why could happen please help :) - if(this.colorAttribute === -1) - { - this.colorAttribute = 2; - } - - this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute]; - - // End worst hack eva // - - // add those custom shaders! - for (var key in this.uniforms) - { - // get the uniform locations.. - this.uniforms[key].uniformLocation = gl.getUniformLocation(program, key); - } - - this.initUniforms(); - - this.program = program; -}; - -/** -* Initialises the shader uniform values. -* -* Uniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/ -* http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf -* -* @method initUniforms -*/ -PIXI.PixiShader.prototype.initUniforms = function() -{ - this.textureCount = 1; - var gl = this.gl; - var uniform; - - for (var key in this.uniforms) - { - uniform = this.uniforms[key]; - - var type = uniform.type; - - if (type === 'sampler2D') - { - uniform._init = false; - - if (uniform.value !== null) - { - this.initSampler2D(uniform); - } - } - else if (type === 'mat2' || type === 'mat3' || type === 'mat4') - { - // These require special handling - uniform.glMatrix = true; - uniform.glValueLength = 1; - - if (type === 'mat2') - { - uniform.glFunc = gl.uniformMatrix2fv; - } - else if (type === 'mat3') - { - uniform.glFunc = gl.uniformMatrix3fv; - } - else if (type === 'mat4') - { - uniform.glFunc = gl.uniformMatrix4fv; - } - } - else - { - // GL function reference - uniform.glFunc = gl['uniform' + type]; - - if (type === '2f' || type === '2i') - { - uniform.glValueLength = 2; - } - else if (type === '3f' || type === '3i') - { - uniform.glValueLength = 3; - } - else if (type === '4f' || type === '4i') - { - uniform.glValueLength = 4; - } - else - { - uniform.glValueLength = 1; - } - } - } - -}; - -/** -* Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded) -* -* @method initSampler2D -*/ -PIXI.PixiShader.prototype.initSampler2D = function(uniform) -{ - if (!uniform.value || !uniform.value.baseTexture || !uniform.value.baseTexture.hasLoaded) - { - return; - } - - var gl = this.gl; - - gl.activeTexture(gl['TEXTURE' + this.textureCount]); - gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]); - - // Extended texture data - if (uniform.textureData) - { - var data = uniform.textureData; - - // GLTexture = mag linear, min linear_mipmap_linear, wrap repeat + gl.generateMipmap(gl.TEXTURE_2D); - // GLTextureLinear = mag/min linear, wrap clamp - // GLTextureNearestRepeat = mag/min NEAREST, wrap repeat - // GLTextureNearest = mag/min nearest, wrap clamp - // AudioTexture = whatever + luminance + width 512, height 2, border 0 - // KeyTexture = whatever + luminance + width 256, height 2, border 0 - - // magFilter can be: gl.LINEAR, gl.LINEAR_MIPMAP_LINEAR or gl.NEAREST - // wrapS/T can be: gl.CLAMP_TO_EDGE or gl.REPEAT - - var magFilter = (data.magFilter) ? data.magFilter : gl.LINEAR; - var minFilter = (data.minFilter) ? data.minFilter : gl.LINEAR; - var wrapS = (data.wrapS) ? data.wrapS : gl.CLAMP_TO_EDGE; - var wrapT = (data.wrapT) ? data.wrapT : gl.CLAMP_TO_EDGE; - var format = (data.luminance) ? gl.LUMINANCE : gl.RGBA; - - if (data.repeat) - { - wrapS = gl.REPEAT; - wrapT = gl.REPEAT; - } - - gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, !!data.flipY); - - if (data.width) - { - var width = (data.width) ? data.width : 512; - var height = (data.height) ? data.height : 2; - var border = (data.border) ? data.border : 0; - - // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels); - gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, border, format, gl.UNSIGNED_BYTE, null); - } - else - { - // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, ImageData? pixels); - gl.texImage2D(gl.TEXTURE_2D, 0, format, gl.RGBA, gl.UNSIGNED_BYTE, uniform.value.baseTexture.source); - } - - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrapS); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT); - } - - gl.uniform1i(uniform.uniformLocation, this.textureCount); - - uniform._init = true; - - this.textureCount++; - -}; - -/** -* Updates the shader uniform values. -* -* @method syncUniforms -*/ -PIXI.PixiShader.prototype.syncUniforms = function() -{ - this.textureCount = 1; - var uniform; - var gl = this.gl; - - // This would probably be faster in an array and it would guarantee key order - for (var key in this.uniforms) - { - uniform = this.uniforms[key]; - - if (uniform.glValueLength === 1) - { - if (uniform.glMatrix === true) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.transpose, uniform.value); - } - else - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value); - } - } - else if (uniform.glValueLength === 2) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y); - } - else if (uniform.glValueLength === 3) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z); - } - else if (uniform.glValueLength === 4) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z, uniform.value.w); - } - else if (uniform.type === 'sampler2D') - { - if (uniform._init) - { - gl.activeTexture(gl['TEXTURE' + this.textureCount]); - - if(uniform.value.baseTexture._dirty[gl.id]) - { - PIXI.instances[gl.id].updateTexture(uniform.value.baseTexture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]); - } - - // gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id] || PIXI.createWebGLTexture( uniform.value.baseTexture, gl)); - gl.uniform1i(uniform.uniformLocation, this.textureCount); - this.textureCount++; - } - else - { - this.initSampler2D(uniform); - } - } - } - -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PixiShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; - -/** -* The Default Vertex shader source. -* -* @property defaultVertexSrc -* @type String -*/ -PIXI.PixiShader.defaultVertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aTextureCoord;', - 'attribute vec4 aColor;', - - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - - 'const vec2 center = vec2(-1.0, 1.0);', - - 'void main(void) {', - ' gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - ' vColor = vec4(aColor.rgb * aColor.a, aColor.a);', - '}' -]; -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class PixiFastShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PixiFastShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying float vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aPositionCoord;', - 'attribute vec2 aScale;', - 'attribute float aRotation;', - 'attribute vec2 aTextureCoord;', - 'attribute float aColor;', - - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - 'uniform mat3 uMatrix;', - - 'varying vec2 vTextureCoord;', - 'varying float vColor;', - - 'const vec2 center = vec2(-1.0, 1.0);', - - 'void main(void) {', - ' vec2 v;', - ' vec2 sv = aVertexPosition * aScale;', - ' v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);', - ' v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);', - ' v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;', - ' gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - // ' vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;', - ' vColor = aColor;', - '}' - ]; - - /** - * A local texture counter for multi-texture shaders. - * @property textureCount - * @type Number - */ - this.textureCount = 0; - - this.init(); -}; - -PIXI.PixiFastShader.prototype.constructor = PIXI.PixiFastShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PixiFastShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.dimensions = gl.getUniformLocation(program, 'dimensions'); - this.uMatrix = gl.getUniformLocation(program, 'uMatrix'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aPositionCoord = gl.getAttribLocation(program, 'aPositionCoord'); - - this.aScale = gl.getAttribLocation(program, 'aScale'); - this.aRotation = gl.getAttribLocation(program, 'aRotation'); - - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - // Begin worst hack eva // - - // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? - // maybe its somthing to do with the current state of the gl context. - // Im convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel - // If theres any webGL people that know why could happen please help :) - if(this.colorAttribute === -1) - { - this.colorAttribute = 2; - } - - this.attributes = [this.aVertexPosition, this.aPositionCoord, this.aScale, this.aRotation, this.aTextureCoord, this.colorAttribute]; - - // End worst hack eva // - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PixiFastShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class StripShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.StripShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - // 'varying float vColor;', - 'uniform float alpha;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * alpha;', - // ' gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);',//gl_FragColor * alpha;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aTextureCoord;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - // 'uniform float alpha;', - // 'uniform vec3 tint;', - 'varying vec2 vTextureCoord;', - // 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - // ' vColor = aColor * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.StripShader.prototype.constructor = PIXI.StripShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.StripShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - //this.dimensions = gl.getUniformLocation(this.program, 'dimensions'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - - this.attributes = [this.aVertexPosition, this.aTextureCoord]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.StripShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attribute = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class PrimitiveShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PrimitiveShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' gl_FragColor = vColor;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec4 aColor;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - 'uniform float alpha;', - 'uniform float flipY;', - 'uniform vec3 tint;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);', - ' vColor = aColor * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.PrimitiveShader.prototype.constructor = PIXI.PrimitiveShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PrimitiveShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.tintColor = gl.getUniformLocation(program, 'tint'); - this.flipY = gl.getUniformLocation(program, 'flipY'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - this.attributes = [this.aVertexPosition, this.colorAttribute]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PrimitiveShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class ComplexPrimitiveShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.ComplexPrimitiveShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - - 'precision mediump float;', - - 'varying vec4 vColor;', - - 'void main(void) {', - ' gl_FragColor = vColor;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - //'attribute vec4 aColor;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - - 'uniform vec3 tint;', - 'uniform float alpha;', - 'uniform vec3 color;', - 'uniform float flipY;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);', - ' vColor = vec4(color * alpha * tint, alpha);',//" * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.ComplexPrimitiveShader.prototype.constructor = PIXI.ComplexPrimitiveShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.ComplexPrimitiveShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.tintColor = gl.getUniformLocation(program, 'tint'); - this.color = gl.getUniformLocation(program, 'color'); - this.flipY = gl.getUniformLocation(program, 'flipY'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - // this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - this.attributes = [this.aVertexPosition, this.colorAttribute]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.ComplexPrimitiveShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attribute = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A set of functions used by the webGL renderer to draw the primitive graphics data - * - * @class WebGLGraphics - * @private - * @static - */ -PIXI.WebGLGraphics = function() -{ -}; - -/** - * Renders the graphics object - * - * @static - * @private - * @method renderGraphics - * @param graphics {Graphics} - * @param renderSession {Object} - */ -PIXI.WebGLGraphics.renderGraphics = function(graphics, renderSession)//projection, offset) -{ - var gl = renderSession.gl; - var projection = renderSession.projection, - offset = renderSession.offset, - shader = renderSession.shaderManager.primitiveShader, - webGLData; - - if(graphics.dirty) - { - PIXI.WebGLGraphics.updateGraphics(graphics, gl); - } - - var webGL = graphics._webGL[gl.id]; - - // This could be speeded up for sure! - - for (var i = 0; i < webGL.data.length; i++) - { - if(webGL.data[i].mode === 1) - { - webGLData = webGL.data[i]; - - renderSession.stencilManager.pushStencil(graphics, webGLData, renderSession); - - // render quad.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - renderSession.stencilManager.popStencil(graphics, webGLData, renderSession); - } - else - { - webGLData = webGL.data[i]; - - - renderSession.shaderManager.setShader( shader );//activatePrimitiveShader(); - shader = renderSession.shaderManager.primitiveShader; - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform1f(shader.flipY, 1); - - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - - gl.uniform1f(shader.alpha, graphics.worldAlpha); - - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0); - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4); - - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - } - } -}; - -/** - * Updates the graphics object - * - * @static - * @private - * @method updateGraphics - * @param graphicsData {Graphics} The graphics object to update - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLGraphics.updateGraphics = function(graphics, gl) -{ - // get the contexts graphics object - var webGL = graphics._webGL[gl.id]; - // if the graphics object does not exist in the webGL context time to create it! - if(!webGL)webGL = graphics._webGL[gl.id] = {lastIndex:0, data:[], gl:gl}; - - // flag the graphics as not dirty as we are about to update it... - graphics.dirty = false; - - var i; - - // if the user cleared the graphics object we will need to clear every object - if(graphics.clearDirty) - { - graphics.clearDirty = false; - - // lop through and return all the webGLDatas to the object pool so than can be reused later on - for (i = 0; i < webGL.data.length; i++) - { - var graphicsData = webGL.data[i]; - graphicsData.reset(); - PIXI.WebGLGraphics.graphicsDataPool.push( graphicsData ); - } - - // clear the array and reset the index.. - webGL.data = []; - webGL.lastIndex = 0; - } - - var webGLData; - - // loop through the graphics datas and construct each one.. - // if the object is a complex fill then the new stencil buffer technique will be used - // other wise graphics objects will be pushed into a batch.. - for (i = webGL.lastIndex; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - - if(data.type === PIXI.Graphics.POLY) - { - // need to add the points the the graphics object.. - data.points = data.shape.points.slice(); - if(data.shape.closed) - { - // close the poly if the value is true! - if(data.points[0] !== data.points[data.points.length-2] || data.points[1] !== data.points[data.points.length-1]) - { - data.points.push(data.points[0], data.points[1]); - } - } - - // MAKE SURE WE HAVE THE CORRECT TYPE.. - if(data.fill) - { - if(data.points.length >= 6) - { - if(data.points.length < 6 * 2) - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - - var canDrawUsingSimple = PIXI.WebGLGraphics.buildPoly(data, webGLData); - // console.log(canDrawUsingSimple); - - if(!canDrawUsingSimple) - { - // console.log("<>>>") - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1); - PIXI.WebGLGraphics.buildComplexPoly(data, webGLData); - } - - } - else - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1); - PIXI.WebGLGraphics.buildComplexPoly(data, webGLData); - } - } - } - - if(data.lineWidth > 0) - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - PIXI.WebGLGraphics.buildLine(data, webGLData); - - } - } - else - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - - if(data.type === PIXI.Graphics.RECT) - { - PIXI.WebGLGraphics.buildRectangle(data, webGLData); - } - else if(data.type === PIXI.Graphics.CIRC || data.type === PIXI.Graphics.ELIP) - { - PIXI.WebGLGraphics.buildCircle(data, webGLData); - } - else if(data.type === PIXI.Graphics.RREC) - { - PIXI.WebGLGraphics.buildRoundedRectangle(data, webGLData); - } - } - - webGL.lastIndex++; - } - - // upload all the dirty data... - for (i = 0; i < webGL.data.length; i++) - { - webGLData = webGL.data[i]; - if(webGLData.dirty)webGLData.upload(); - } -}; - -/** - * @static - * @private - * @method switchMode - * @param webGL {WebGLContext} - * @param type {Number} - */ -PIXI.WebGLGraphics.switchMode = function(webGL, type) -{ - var webGLData; - - if(!webGL.data.length) - { - webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl); - webGLData.mode = type; - webGL.data.push(webGLData); - } - else - { - webGLData = webGL.data[webGL.data.length-1]; - - if(webGLData.mode !== type || type === 1) - { - webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl); - webGLData.mode = type; - webGL.data.push(webGLData); - } - } - - webGLData.dirty = true; - - return webGLData; -}; - -/** - * Builds a rectangle to draw - * - * @static - * @private - * @method buildRectangle - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildRectangle = function(graphicsData, webGLData) -{ - // --- // - // need to convert points to a nice regular data - // - var rectData = graphicsData.shape; - var x = rectData.x; - var y = rectData.y; - var width = rectData.width; - var height = rectData.height; - - if(graphicsData.fill) - { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vertPos = verts.length/6; - - // start - verts.push(x, y); - verts.push(r, g, b, alpha); - - verts.push(x + width, y); - verts.push(r, g, b, alpha); - - verts.push(x , y + height); - verts.push(r, g, b, alpha); - - verts.push(x + width, y + height); - verts.push(r, g, b, alpha); - - // insert 2 dead triangles.. - indices.push(vertPos, vertPos, vertPos+1, vertPos+2, vertPos+3, vertPos+3); - } - - if(graphicsData.lineWidth) - { - var tempPoints = graphicsData.points; - - graphicsData.points = [x, y, - x + width, y, - x + width, y + height, - x, y + height, - x, y]; - - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Builds a rounded rectangle to draw - * - * @static - * @private - * @method buildRoundedRectangle - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildRoundedRectangle = function(graphicsData, webGLData) -{ - var rrectData = graphicsData.shape; - var x = rrectData.x; - var y = rrectData.y; - var width = rrectData.width; - var height = rrectData.height; - - var radius = rrectData.radius; - - var recPoints = []; - recPoints.push(x, y + radius); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x, y + height - radius, x, y + height, x + radius, y + height)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width, y + radius, x + width, y, x + width - radius, y)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + radius, y, x, y, x, y + radius)); - - if (graphicsData.fill) { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vecPos = verts.length/6; - - var triangles = PIXI.PolyK.Triangulate(recPoints); - - // - - var i = 0; - for (i = 0; i < triangles.length; i+=3) - { - indices.push(triangles[i] + vecPos); - indices.push(triangles[i] + vecPos); - indices.push(triangles[i+1] + vecPos); - indices.push(triangles[i+2] + vecPos); - indices.push(triangles[i+2] + vecPos); - } - - - for (i = 0; i < recPoints.length; i++) - { - verts.push(recPoints[i], recPoints[++i], r, g, b, alpha); - } - } - - if (graphicsData.lineWidth) { - var tempPoints = graphicsData.points; - - graphicsData.points = recPoints; - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Calculate the points for a quadratic bezier curve. (helper function..) - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c - * - * @static - * @private - * @method quadraticBezierCurve - * @param fromX {Number} Origin point x - * @param fromY {Number} Origin point x - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Array(Number)} - */ -PIXI.WebGLGraphics.quadraticBezierCurve = function(fromX, fromY, cpX, cpY, toX, toY) { - - var xa, - ya, - xb, - yb, - x, - y, - n = 20, - points = []; - - function getPt(n1 , n2, perc) { - var diff = n2 - n1; - - return n1 + ( diff * perc ); - } - - var j = 0; - for (var i = 0; i <= n; i++ ) - { - j = i / n; - - // The Green Line - xa = getPt( fromX , cpX , j ); - ya = getPt( fromY , cpY , j ); - xb = getPt( cpX , toX , j ); - yb = getPt( cpY , toY , j ); - - // The Black Dot - x = getPt( xa , xb , j ); - y = getPt( ya , yb , j ); - - points.push(x, y); - } - return points; -}; - -/** - * Builds a circle to draw - * - * @static - * @private - * @method buildCircle - * @param graphicsData {Graphics} The graphics object to draw - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildCircle = function(graphicsData, webGLData) -{ - // need to convert points to a nice regular data - var circleData = graphicsData.shape; - var x = circleData.x; - var y = circleData.y; - var width; - var height; - - // TODO - bit hacky?? - if(graphicsData.type === PIXI.Graphics.CIRC) - { - width = circleData.radius; - height = circleData.radius; - } - else - { - width = circleData.width; - height = circleData.height; - } - - var totalSegs = 40; - var seg = (Math.PI * 2) / totalSegs ; - - var i = 0; - - if(graphicsData.fill) - { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vecPos = verts.length/6; - - indices.push(vecPos); - - for (i = 0; i < totalSegs + 1 ; i++) - { - verts.push(x,y, r, g, b, alpha); - - verts.push(x + Math.sin(seg * i) * width, - y + Math.cos(seg * i) * height, - r, g, b, alpha); - - indices.push(vecPos++, vecPos++); - } - - indices.push(vecPos-1); - } - - if(graphicsData.lineWidth) - { - var tempPoints = graphicsData.points; - - graphicsData.points = []; - - for (i = 0; i < totalSegs + 1; i++) - { - graphicsData.points.push(x + Math.sin(seg * i) * width, - y + Math.cos(seg * i) * height); - } - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Builds a line to draw - * - * @static - * @private - * @method buildLine - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildLine = function(graphicsData, webGLData) -{ - // TODO OPTIMISE! - var i = 0; - var points = graphicsData.points; - if(points.length === 0)return; - - // if the line width is an odd number add 0.5 to align to a whole pixel - if(graphicsData.lineWidth%2) - { - for (i = 0; i < points.length; i++) { - points[i] += 0.5; - } - } - - // get first and last point.. figure out the middle! - var firstPoint = new PIXI.Point( points[0], points[1] ); - var lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); - - // if the first point is the last point - gonna have issues :) - if(firstPoint.x === lastPoint.x && firstPoint.y === lastPoint.y) - { - // need to clone as we are going to slightly modify the shape.. - points = points.slice(); - - points.pop(); - points.pop(); - - lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); - - var midPointX = lastPoint.x + (firstPoint.x - lastPoint.x) *0.5; - var midPointY = lastPoint.y + (firstPoint.y - lastPoint.y) *0.5; - - points.unshift(midPointX, midPointY); - points.push(midPointX, midPointY); - } - - var verts = webGLData.points; - var indices = webGLData.indices; - var length = points.length / 2; - var indexCount = points.length; - var indexStart = verts.length/6; - - // DRAW the Line - var width = graphicsData.lineWidth / 2; - - // sort color - var color = PIXI.hex2rgb(graphicsData.lineColor); - var alpha = graphicsData.lineAlpha; - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var px, py, p1x, p1y, p2x, p2y, p3x, p3y; - var perpx, perpy, perp2x, perp2y, perp3x, perp3y; - var a1, b1, c1, a2, b2, c2; - var denom, pdist, dist; - - p1x = points[0]; - p1y = points[1]; - - p2x = points[2]; - p2y = points[3]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - // start - verts.push(p1x - perpx , p1y - perpy, - r, g, b, alpha); - - verts.push(p1x + perpx , p1y + perpy, - r, g, b, alpha); - - for (i = 1; i < length-1; i++) - { - p1x = points[(i-1)*2]; - p1y = points[(i-1)*2 + 1]; - - p2x = points[(i)*2]; - p2y = points[(i)*2 + 1]; - - p3x = points[(i+1)*2]; - p3y = points[(i+1)*2 + 1]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - perp2x = -(p2y - p3y); - perp2y = p2x - p3x; - - dist = Math.sqrt(perp2x*perp2x + perp2y*perp2y); - perp2x /= dist; - perp2y /= dist; - perp2x *= width; - perp2y *= width; - - a1 = (-perpy + p1y) - (-perpy + p2y); - b1 = (-perpx + p2x) - (-perpx + p1x); - c1 = (-perpx + p1x) * (-perpy + p2y) - (-perpx + p2x) * (-perpy + p1y); - a2 = (-perp2y + p3y) - (-perp2y + p2y); - b2 = (-perp2x + p2x) - (-perp2x + p3x); - c2 = (-perp2x + p3x) * (-perp2y + p2y) - (-perp2x + p2x) * (-perp2y + p3y); - - denom = a1*b2 - a2*b1; - - if(Math.abs(denom) < 0.1 ) - { - - denom+=10.1; - verts.push(p2x - perpx , p2y - perpy, - r, g, b, alpha); - - verts.push(p2x + perpx , p2y + perpy, - r, g, b, alpha); - - continue; - } - - px = (b1*c2 - b2*c1)/denom; - py = (a2*c1 - a1*c2)/denom; - - - pdist = (px -p2x) * (px -p2x) + (py -p2y) + (py -p2y); - - - if(pdist > 140 * 140) - { - perp3x = perpx - perp2x; - perp3y = perpy - perp2y; - - dist = Math.sqrt(perp3x*perp3x + perp3y*perp3y); - perp3x /= dist; - perp3y /= dist; - perp3x *= width; - perp3y *= width; - - verts.push(p2x - perp3x, p2y -perp3y); - verts.push(r, g, b, alpha); - - verts.push(p2x + perp3x, p2y +perp3y); - verts.push(r, g, b, alpha); - - verts.push(p2x - perp3x, p2y -perp3y); - verts.push(r, g, b, alpha); - - indexCount++; - } - else - { - - verts.push(px , py); - verts.push(r, g, b, alpha); - - verts.push(p2x - (px-p2x), p2y - (py - p2y)); - verts.push(r, g, b, alpha); - } - } - - p1x = points[(length-2)*2]; - p1y = points[(length-2)*2 + 1]; - - p2x = points[(length-1)*2]; - p2y = points[(length-1)*2 + 1]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - verts.push(p2x - perpx , p2y - perpy); - verts.push(r, g, b, alpha); - - verts.push(p2x + perpx , p2y + perpy); - verts.push(r, g, b, alpha); - - indices.push(indexStart); - - for (i = 0; i < indexCount; i++) - { - indices.push(indexStart++); - } - - indices.push(indexStart-1); -}; - -/** - * Builds a complex polygon to draw - * - * @static - * @private - * @method buildComplexPoly - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildComplexPoly = function(graphicsData, webGLData) -{ - //TODO - no need to copy this as it gets turned into a FLoat32Array anyways.. - var points = graphicsData.points.slice(); - if(points.length < 6)return; - - // get first and last point.. figure out the middle! - var indices = webGLData.indices; - webGLData.points = points; - webGLData.alpha = graphicsData.fillAlpha; - webGLData.color = PIXI.hex2rgb(graphicsData.fillColor); - - /* - calclate the bounds.. - */ - var minX = Infinity; - var maxX = -Infinity; - - var minY = Infinity; - var maxY = -Infinity; - - var x,y; - - // get size.. - for (var i = 0; i < points.length; i+=2) - { - x = points[i]; - y = points[i+1]; - - minX = x < minX ? x : minX; - maxX = x > maxX ? x : maxX; - - minY = y < minY ? y : minY; - maxY = y > maxY ? y : maxY; - } - - // add a quad to the end cos there is no point making another buffer! - points.push(minX, minY, - maxX, minY, - maxX, maxY, - minX, maxY); - - // push a quad onto the end.. - - //TODO - this aint needed! - var length = points.length / 2; - for (i = 0; i < length; i++) - { - indices.push( i ); - } - -}; - -/** - * Builds a polygon to draw - * - * @static - * @private - * @method buildPoly - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildPoly = function(graphicsData, webGLData) -{ - var points = graphicsData.points; - - if(points.length < 6)return; - // get first and last point.. figure out the middle! - var verts = webGLData.points; - var indices = webGLData.indices; - - var length = points.length / 2; - - // sort color - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var triangles = PIXI.PolyK.Triangulate(points); - - if(!triangles)return false; - - var vertPos = verts.length / 6; - - var i = 0; - - for (i = 0; i < triangles.length; i+=3) - { - indices.push(triangles[i] + vertPos); - indices.push(triangles[i] + vertPos); - indices.push(triangles[i+1] + vertPos); - indices.push(triangles[i+2] +vertPos); - indices.push(triangles[i+2] + vertPos); - } - - for (i = 0; i < length; i++) - { - verts.push(points[i * 2], points[i * 2 + 1], - r, g, b, alpha); - } - - return true; -}; - -PIXI.WebGLGraphics.graphicsDataPool = []; - -/** - * @class WebGLGraphicsData - * @private - * @static - */ -PIXI.WebGLGraphicsData = function(gl) -{ - this.gl = gl; - - //TODO does this need to be split before uploding?? - this.color = [0,0,0]; // color split! - this.points = []; - this.indices = []; - this.buffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - this.mode = 1; - this.alpha = 1; - this.dirty = true; -}; - -/** - * @method reset - */ -PIXI.WebGLGraphicsData.prototype.reset = function() -{ - this.points = []; - this.indices = []; -}; - -/** - * @method upload - */ -PIXI.WebGLGraphicsData.prototype.upload = function() -{ - var gl = this.gl; - -// this.lastIndex = graphics.graphicsData.length; - this.glPoints = new PIXI.Float32Array(this.points); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer); - gl.bufferData(gl.ARRAY_BUFFER, this.glPoints, gl.STATIC_DRAW); - - this.glIndicies = new PIXI.Uint16Array(this.indices); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.glIndicies, gl.STATIC_DRAW); - - this.dirty = false; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -PIXI.glContexts = []; // this is where we store the webGL contexts for easy access. -PIXI.instances = []; - -/** - * The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer - * should be used for browsers that support webGL. This Render works by automatically managing webGLBatchs. - * So no need for Sprite Batches or Sprite Clouds. - * Don't forget to add the view to your DOM or you will not see anything :) - * - * @class WebGLRenderer - * @constructor - * @param [width=0] {Number} the width of the canvas view - * @param [height=0] {Number} the height of the canvas view - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - */ -PIXI.WebGLRenderer = function(width, height, options) -{ - if(options) - { - for (var i in PIXI.defaultRenderOptions) - { - if (typeof options[i] === 'undefined') options[i] = PIXI.defaultRenderOptions[i]; - } - } - else - { - options = PIXI.defaultRenderOptions; - } - - if(!PIXI.defaultRenderer) - { - PIXI.sayHello('webGL'); - PIXI.defaultRenderer = this; - } - - /** - * @property type - * @type Number - */ - this.type = PIXI.WEBGL_RENDERER; - - /** - * The resolution of the renderer - * - * @property resolution - * @type Number - * @default 1 - */ - this.resolution = options.resolution; - - // do a catch.. only 1 webGL renderer.. - - /** - * Whether the render view is transparent - * - * @property transparent - * @type Boolean - */ - this.transparent = options.transparent; - - /** - * Whether the render view should be resized automatically - * - * @property autoResize - * @type Boolean - */ - this.autoResize = options.autoResize || false; - - /** - * The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering. - * - * @property preserveDrawingBuffer - * @type Boolean - */ - this.preserveDrawingBuffer = options.preserveDrawingBuffer; - - /** - * This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true: - * If the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0). - * If the Stage is transparent, Pixi will clear to the target Stage's background color. - * Disable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set. - * - * @property clearBeforeRender - * @type Boolean - * @default - */ - this.clearBeforeRender = options.clearBeforeRender; - - /** - * The width of the canvas view - * - * @property width - * @type Number - * @default 800 - */ - this.width = width || 800; - - /** - * The height of the canvas view - * - * @property height - * @type Number - * @default 600 - */ - this.height = height || 600; - - /** - * The canvas element that everything is drawn to - * - * @property view - * @type HTMLCanvasElement - */ - this.view = options.view || document.createElement( 'canvas' ); - - // deal with losing context.. - - /** - * @property contextLostBound - * @type Function - */ - this.contextLostBound = this.handleContextLost.bind(this); - - /** - * @property contextRestoredBound - * @type Function - */ - this.contextRestoredBound = this.handleContextRestored.bind(this); - - this.view.addEventListener('webglcontextlost', this.contextLostBound, false); - this.view.addEventListener('webglcontextrestored', this.contextRestoredBound, false); - - /** - * @property _contextOptions - * @type Object - * @private - */ - this._contextOptions = { - alpha: this.transparent, - antialias: options.antialias, // SPEED UP?? - premultipliedAlpha:this.transparent && this.transparent !== 'notMultiplied', - stencil:true, - preserveDrawingBuffer: options.preserveDrawingBuffer - }; - - /** - * @property projection - * @type Point - */ - this.projection = new PIXI.Point(); - - /** - * @property offset - * @type Point - */ - this.offset = new PIXI.Point(0, 0); - - // time to create the render managers! each one focuses on managing a state in webGL - - /** - * Deals with managing the shader programs and their attribs - * @property shaderManager - * @type WebGLShaderManager - */ - this.shaderManager = new PIXI.WebGLShaderManager(); - - /** - * Manages the rendering of sprites - * @property spriteBatch - * @type WebGLSpriteBatch - */ - this.spriteBatch = new PIXI.WebGLSpriteBatch(); - - /** - * Manages the masks using the stencil buffer - * @property maskManager - * @type WebGLMaskManager - */ - this.maskManager = new PIXI.WebGLMaskManager(); - - /** - * Manages the filters - * @property filterManager - * @type WebGLFilterManager - */ - this.filterManager = new PIXI.WebGLFilterManager(); - - /** - * Manages the stencil buffer - * @property stencilManager - * @type WebGLStencilManager - */ - this.stencilManager = new PIXI.WebGLStencilManager(); - - /** - * Manages the blendModes - * @property blendModeManager - * @type WebGLBlendModeManager - */ - this.blendModeManager = new PIXI.WebGLBlendModeManager(); - - /** - * TODO remove - * @property renderSession - * @type Object - */ - this.renderSession = {}; - this.renderSession.gl = this.gl; - this.renderSession.drawCount = 0; - this.renderSession.shaderManager = this.shaderManager; - this.renderSession.maskManager = this.maskManager; - this.renderSession.filterManager = this.filterManager; - this.renderSession.blendModeManager = this.blendModeManager; - this.renderSession.spriteBatch = this.spriteBatch; - this.renderSession.stencilManager = this.stencilManager; - this.renderSession.renderer = this; - this.renderSession.resolution = this.resolution; - - // time init the context.. - this.initContext(); - - // map some webGL blend modes.. - this.mapBlendModes(); -}; - -// constructor -PIXI.WebGLRenderer.prototype.constructor = PIXI.WebGLRenderer; - -/** -* @method initContext -*/ -PIXI.WebGLRenderer.prototype.initContext = function() -{ - var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); - this.gl = gl; - - if (!gl) { - // fail, not able to get a context - throw new Error('This browser does not support webGL. Try using the canvas renderer'); - } - - this.glContextId = gl.id = PIXI.WebGLRenderer.glContextId ++; - - PIXI.glContexts[this.glContextId] = gl; - - PIXI.instances[this.glContextId] = this; - - // set up the default pixi settings.. - gl.disable(gl.DEPTH_TEST); - gl.disable(gl.CULL_FACE); - gl.enable(gl.BLEND); - - // need to set the context for all the managers... - this.shaderManager.setContext(gl); - this.spriteBatch.setContext(gl); - this.maskManager.setContext(gl); - this.filterManager.setContext(gl); - this.blendModeManager.setContext(gl); - this.stencilManager.setContext(gl); - - this.renderSession.gl = this.gl; - - // now resize and we are good to go! - this.resize(this.width, this.height); -}; - -/** - * Renders the stage to its webGL view - * - * @method render - * @param stage {Stage} the Stage element to be rendered - */ -PIXI.WebGLRenderer.prototype.render = function(stage) -{ - // no point rendering if our context has been blown up! - if(this.contextLost)return; - - // if rendering a new stage clear the batches.. - if(this.__stage !== stage) - { - if(stage.interactive)stage.interactionManager.removeEvents(); - - // TODO make this work - // dont think this is needed any more? - this.__stage = stage; - } - - // update the scene graph - stage.updateTransform(); - - var gl = this.gl; - - // interaction - if(stage._interactive) - { - //need to add some events! - if(!stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = true; - stage.interactionManager.setTarget(this); - } - } - else - { - if(stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = false; - stage.interactionManager.setTarget(this); - } - } - - // -- Does this need to be set every frame? -- // - gl.viewport(0, 0, this.width, this.height); - - // make sure we are bound to the main frame buffer - gl.bindFramebuffer(gl.FRAMEBUFFER, null); - - if (this.clearBeforeRender) - { - if(this.transparent) - { - gl.clearColor(0, 0, 0, 0); - } - else - { - gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], 1); - } - - gl.clear (gl.COLOR_BUFFER_BIT); - } - - this.renderDisplayObject( stage, this.projection ); -}; - -/** - * Renders a Display Object. - * - * @method renderDisplayObject - * @param displayObject {DisplayObject} The DisplayObject to render - * @param projection {Point} The projection - * @param buffer {Array} a standard WebGL buffer - */ -PIXI.WebGLRenderer.prototype.renderDisplayObject = function(displayObject, projection, buffer) -{ - this.renderSession.blendModeManager.setBlendMode(PIXI.blendModes.NORMAL); - - // reset the render session data.. - this.renderSession.drawCount = 0; - - // make sure to flip the Y if using a render texture.. - this.renderSession.flipY = buffer ? -1 : 1; - - // set the default projection - this.renderSession.projection = projection; - - //set the default offset - this.renderSession.offset = this.offset; - - // start the sprite batch - this.spriteBatch.begin(this.renderSession); - - // start the filter manager - this.filterManager.begin(this.renderSession, buffer); - - // render the scene! - displayObject._renderWebGL(this.renderSession); - - // finish the sprite batch - this.spriteBatch.end(); -}; - -/** - * Resizes the webGL view to the specified width and height. - * - * @method resize - * @param width {Number} the new width of the webGL view - * @param height {Number} the new height of the webGL view - */ -PIXI.WebGLRenderer.prototype.resize = function(width, height) -{ - this.width = width * this.resolution; - this.height = height * this.resolution; - - this.view.width = this.width; - this.view.height = this.height; - - if (this.autoResize) { - this.view.style.width = this.width / this.resolution + 'px'; - this.view.style.height = this.height / this.resolution + 'px'; - } - - this.gl.viewport(0, 0, this.width, this.height); - - this.projection.x = this.width / 2 / this.resolution; - this.projection.y = -this.height / 2 / this.resolution; -}; - -/** - * Updates and Creates a WebGL texture for the renderers context. - * - * @method updateTexture - * @param texture {Texture} the texture to update - */ -PIXI.WebGLRenderer.prototype.updateTexture = function(texture) -{ - if(!texture.hasLoaded )return; - - var gl = this.gl; - - if(!texture._glTextures[gl.id])texture._glTextures[gl.id] = gl.createTexture(); - - gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]); - - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultipliedAlpha); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source); - - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - - - if(texture.mipmap && PIXI.isPowerOfTwo(texture.width, texture.height)) - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR_MIPMAP_LINEAR : gl.NEAREST_MIPMAP_NEAREST); - gl.generateMipmap(gl.TEXTURE_2D); - } - else - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - } - - // reguler... - if(!texture._powerOf2) - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - } - else - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT); - } - - texture._dirty[gl.id] = false; - - return texture._glTextures[gl.id]; -}; - -/** - * Handles a lost webgl context - * - * @method handleContextLost - * @param event {Event} - * @private - */ -PIXI.WebGLRenderer.prototype.handleContextLost = function(event) -{ - event.preventDefault(); - this.contextLost = true; -}; - -/** - * Handles a restored webgl context - * - * @method handleContextRestored - * @param event {Event} - * @private - */ -PIXI.WebGLRenderer.prototype.handleContextRestored = function() -{ - this.initContext(); - - // empty all the ol gl textures as they are useless now - for(var key in PIXI.TextureCache) - { - var texture = PIXI.TextureCache[key].baseTexture; - texture._glTextures = []; - } - - this.contextLost = false; -}; - -/** - * Removes everything from the renderer (event listeners, spritebatch, etc...) - * - * @method destroy - */ -PIXI.WebGLRenderer.prototype.destroy = function() -{ - // remove listeners - this.view.removeEventListener('webglcontextlost', this.contextLostBound); - this.view.removeEventListener('webglcontextrestored', this.contextRestoredBound); - - PIXI.glContexts[this.glContextId] = null; - - this.projection = null; - this.offset = null; - - // time to create the render managers! each one focuses on managine a state in webGL - this.shaderManager.destroy(); - this.spriteBatch.destroy(); - this.maskManager.destroy(); - this.filterManager.destroy(); - - this.shaderManager = null; - this.spriteBatch = null; - this.maskManager = null; - this.filterManager = null; - - this.gl = null; - this.renderSession = null; -}; - -/** - * Maps Pixi blend modes to WebGL blend modes. - * - * @method mapBlendModes - */ -PIXI.WebGLRenderer.prototype.mapBlendModes = function() -{ - var gl = this.gl; - - if(!PIXI.blendModesWebGL) - { - PIXI.blendModesWebGL = []; - - PIXI.blendModesWebGL[PIXI.blendModes.NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.ADD] = [gl.SRC_ALPHA, gl.DST_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SCREEN] = [gl.SRC_ALPHA, gl.ONE]; - PIXI.blendModesWebGL[PIXI.blendModes.OVERLAY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.DARKEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.LIGHTEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR_DODGE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR_BURN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.HARD_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SOFT_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.DIFFERENCE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.EXCLUSION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.HUE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SATURATION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.LUMINOSITY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - } -}; - -PIXI.WebGLRenderer.glContextId = 0; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLBlendModeManager -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLBlendModeManager = function() -{ - /** - * @property currentBlendMode - * @type Number - */ - this.currentBlendMode = 99999; -}; - -PIXI.WebGLBlendModeManager.prototype.constructor = PIXI.WebGLBlendModeManager; - -/** - * Sets the WebGL Context. - * - * @method setContext - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLBlendModeManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Sets-up the given blendMode from WebGL's point of view. -* -* @method setBlendMode -* @param blendMode {Number} the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD -*/ -PIXI.WebGLBlendModeManager.prototype.setBlendMode = function(blendMode) -{ - if(this.currentBlendMode === blendMode)return false; - - this.currentBlendMode = blendMode; - - var blendModeWebGL = PIXI.blendModesWebGL[this.currentBlendMode]; - this.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); - - return true; -}; - -/** -* Destroys this object. -* -* @method destroy -*/ -PIXI.WebGLBlendModeManager.prototype.destroy = function() -{ - this.gl = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLMaskManager -* @constructor -* @private -*/ -PIXI.WebGLMaskManager = function() -{ -}; - -PIXI.WebGLMaskManager.prototype.constructor = PIXI.WebGLMaskManager; - -/** -* Sets the drawing context to the one given in parameter. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLMaskManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Applies the Mask and adds it to the current filter stack. -* -* @method pushMask -* @param maskData {Array} -* @param renderSession {Object} -*/ -PIXI.WebGLMaskManager.prototype.pushMask = function(maskData, renderSession) -{ - var gl = renderSession.gl; - - if(maskData.dirty) - { - PIXI.WebGLGraphics.updateGraphics(maskData, gl); - } - - if(!maskData._webGL[gl.id].data.length)return; - - renderSession.stencilManager.pushStencil(maskData, maskData._webGL[gl.id].data[0], renderSession); -}; - -/** -* Removes the last filter from the filter stack and doesn't return it. -* -* @method popMask -* @param maskData {Array} -* @param renderSession {Object} an object containing all the useful parameters -*/ -PIXI.WebGLMaskManager.prototype.popMask = function(maskData, renderSession) -{ - var gl = this.gl; - renderSession.stencilManager.popStencil(maskData, maskData._webGL[gl.id].data[0], renderSession); -}; - -/** -* Destroys the mask stack. -* -* @method destroy -*/ -PIXI.WebGLMaskManager.prototype.destroy = function() -{ - this.gl = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLStencilManager -* @constructor -* @private -*/ -PIXI.WebGLStencilManager = function() -{ - this.stencilStack = []; - this.reverse = true; - this.count = 0; -}; - -/** -* Sets the drawing context to the one given in parameter. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLStencilManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Applies the Mask and adds it to the current filter stack. -* -* @method pushMask -* @param graphics {Graphics} -* @param webGLData {Array} -* @param renderSession {Object} -*/ -PIXI.WebGLStencilManager.prototype.pushStencil = function(graphics, webGLData, renderSession) -{ - var gl = this.gl; - this.bindGraphics(graphics, webGLData, renderSession); - - if(this.stencilStack.length === 0) - { - gl.enable(gl.STENCIL_TEST); - gl.clear(gl.STENCIL_BUFFER_BIT); - this.reverse = true; - this.count = 0; - } - - this.stencilStack.push(webGLData); - - var level = this.count; - - gl.colorMask(false, false, false, false); - - gl.stencilFunc(gl.ALWAYS,0,0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT); - - // draw the triangle strip! - - if(webGLData.mode === 1) - { - gl.drawElements(gl.TRIANGLE_FAN, webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 ); - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - - // draw a quad to increment.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - } - - this.reverse = !this.reverse; - } - else - { - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - } - } - - gl.colorMask(true, true, true, true); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP); - - this.count++; -}; - -/** - * TODO this does not belong here! - * - * @method bindGraphics - * @param graphics {Graphics} - * @param webGLData {Array} - * @param renderSession {Object} - */ -PIXI.WebGLStencilManager.prototype.bindGraphics = function(graphics, webGLData, renderSession) -{ - //if(this._currentGraphics === graphics)return; - this._currentGraphics = graphics; - - var gl = this.gl; - - // bind the graphics object.. - var projection = renderSession.projection, - offset = renderSession.offset, - shader;// = renderSession.shaderManager.primitiveShader; - - if(webGLData.mode === 1) - { - shader = renderSession.shaderManager.complexPrimitiveShader; - - renderSession.shaderManager.setShader( shader ); - - gl.uniform1f(shader.flipY, renderSession.flipY); - - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - gl.uniform3fv(shader.color, webGLData.color); - - gl.uniform1f(shader.alpha, graphics.worldAlpha * webGLData.alpha); - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 2, 0); - - - // now do the rest.. - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - } - else - { - //renderSession.shaderManager.activatePrimitiveShader(); - shader = renderSession.shaderManager.primitiveShader; - renderSession.shaderManager.setShader( shader ); - - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform1f(shader.flipY, renderSession.flipY); - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - - gl.uniform1f(shader.alpha, graphics.worldAlpha); - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0); - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4); - - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - } -}; - -/** - * @method popStencil - * @param graphics {Graphics} - * @param webGLData {Array} - * @param renderSession {Object} - */ -PIXI.WebGLStencilManager.prototype.popStencil = function(graphics, webGLData, renderSession) -{ - var gl = this.gl; - this.stencilStack.pop(); - - this.count--; - - if(this.stencilStack.length === 0) - { - // the stack is empty! - gl.disable(gl.STENCIL_TEST); - - } - else - { - - var level = this.count; - - this.bindGraphics(graphics, webGLData, renderSession); - - gl.colorMask(false, false, false, false); - - if(webGLData.mode === 1) - { - this.reverse = !this.reverse; - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - - // draw a quad to increment.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - gl.stencilFunc(gl.ALWAYS,0,0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT); - - // draw the triangle strip! - gl.drawElements(gl.TRIANGLE_FAN, webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - } - - } - else - { - // console.log("<<>>") - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - } - } - - gl.colorMask(true, true, true, true); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP); - - - } -}; - -/** -* Destroys the mask stack. -* -* @method destroy -*/ -PIXI.WebGLStencilManager.prototype.destroy = function() -{ - this.stencilStack = null; - this.gl = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLShaderManager -* @constructor -* @private -*/ -PIXI.WebGLShaderManager = function() -{ - /** - * @property maxAttibs - * @type Number - */ - this.maxAttibs = 10; - - /** - * @property attribState - * @type Array - */ - this.attribState = []; - - /** - * @property tempAttribState - * @type Array - */ - this.tempAttribState = []; - - for (var i = 0; i < this.maxAttibs; i++) - { - this.attribState[i] = false; - } - - /** - * @property stack - * @type Array - */ - this.stack = []; - -}; - -PIXI.WebGLShaderManager.prototype.constructor = PIXI.WebGLShaderManager; - -/** -* Initialises the context and the properties. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLShaderManager.prototype.setContext = function(gl) -{ - this.gl = gl; - - // the next one is used for rendering primitives - this.primitiveShader = new PIXI.PrimitiveShader(gl); - - // the next one is used for rendering triangle strips - this.complexPrimitiveShader = new PIXI.ComplexPrimitiveShader(gl); - - // this shader is used for the default sprite rendering - this.defaultShader = new PIXI.PixiShader(gl); - - // this shader is used for the fast sprite rendering - this.fastShader = new PIXI.PixiFastShader(gl); - - // the next one is used for rendering triangle strips - this.stripShader = new PIXI.StripShader(gl); - this.setShader(this.defaultShader); -}; - -/** -* Takes the attributes given in parameters. -* -* @method setAttribs -* @param attribs {Array} attribs -*/ -PIXI.WebGLShaderManager.prototype.setAttribs = function(attribs) -{ - // reset temp state - var i; - - for (i = 0; i < this.tempAttribState.length; i++) - { - this.tempAttribState[i] = false; - } - - // set the new attribs - for (i = 0; i < attribs.length; i++) - { - var attribId = attribs[i]; - this.tempAttribState[attribId] = true; - } - - var gl = this.gl; - - for (i = 0; i < this.attribState.length; i++) - { - if(this.attribState[i] !== this.tempAttribState[i]) - { - this.attribState[i] = this.tempAttribState[i]; - - if(this.tempAttribState[i]) - { - gl.enableVertexAttribArray(i); - } - else - { - gl.disableVertexAttribArray(i); - } - } - } -}; - -/** -* Sets the current shader. -* -* @method setShader -* @param shader {Any} -*/ -PIXI.WebGLShaderManager.prototype.setShader = function(shader) -{ - if(this._currentId === shader._UID)return false; - - this._currentId = shader._UID; - - this.currentShader = shader; - - this.gl.useProgram(shader.program); - this.setAttribs(shader.attributes); - - return true; -}; - -/** -* Destroys this object. -* -* @method destroy -*/ -PIXI.WebGLShaderManager.prototype.destroy = function() -{ - this.attribState = null; - - this.tempAttribState = null; - - this.primitiveShader.destroy(); - - this.complexPrimitiveShader.destroy(); - - this.defaultShader.destroy(); - - this.fastShader.destroy(); - - this.stripShader.destroy(); - - this.gl = null; -}; - -/** - * @author Mat Groves - * - * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ - * for creating the original pixi version! - * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now share 4 bytes on the vertex buffer - * - * Heavily inspired by LibGDX's WebGLSpriteBatch: - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java - */ - - /** - * - * @class WebGLSpriteBatch - * @private - * @constructor - */ -PIXI.WebGLSpriteBatch = function() -{ - /** - * @property vertSize - * @type Number - */ - this.vertSize = 5; - - /** - * The number of images in the SpriteBatch before it flushes - * @property size - * @type Number - */ - this.size = 2000;//Math.pow(2, 16) / this.vertSize; - - //the total number of bytes in our batch - var numVerts = this.size * 4 * 4 * this.vertSize; - //the total number of indices in our batch - var numIndices = this.size * 6; - - /** - * Holds the vertices - * - * @property vertices - * @type ArrayBuffer - */ - this.vertices = new PIXI.ArrayBuffer(numVerts); - - /** - * View on the vertices as a Float32Array - * - * @property positions - * @type Float32Array - */ - this.positions = new PIXI.Float32Array(this.vertices); - - /** - * View on the vertices as a Uint32Array - * - * @property colors - * @type Uint32Array - */ - this.colors = new PIXI.Uint32Array(this.vertices); - - /** - * Holds the indices - * - * @property indices - * @type Uint16Array - */ - this.indices = new PIXI.Uint16Array(numIndices); - - /** - * @property lastIndexCount - * @type Number - */ - this.lastIndexCount = 0; - - for (var i=0, j=0; i < numIndices; i += 6, j += 4) - { - this.indices[i + 0] = j + 0; - this.indices[i + 1] = j + 1; - this.indices[i + 2] = j + 2; - this.indices[i + 3] = j + 0; - this.indices[i + 4] = j + 2; - this.indices[i + 5] = j + 3; - } - - /** - * @property drawing - * @type Boolean - */ - this.drawing = false; - - /** - * @property currentBatchSize - * @type Number - */ - this.currentBatchSize = 0; - - /** - * @property currentBaseTexture - * @type BaseTexture - */ - this.currentBaseTexture = null; - - /** - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * @property textures - * @type Array - */ - this.textures = []; - - /** - * @property blendModes - * @type Array - */ - this.blendModes = []; - - /** - * @property shaders - * @type Array - */ - this.shaders = []; - - /** - * @property sprites - * @type Array - */ - this.sprites = []; - - /** - * @property defaultShader - * @type AbstractFilter - */ - this.defaultShader = new PIXI.AbstractFilter([ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]); -}; - -/** -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLSpriteBatch.prototype.setContext = function(gl) -{ - this.gl = gl; - - // create a couple of buffers - this.vertexBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // 65535 is max index, so 65535 / 6 = 10922. - - //upload the index data - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); - - this.currentBlendMode = 99999; - - var shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc = this.defaultShader.fragmentSrc; - shader.uniforms = {}; - shader.init(); - - this.defaultShader.shaders[gl.id] = shader; -}; - -/** -* @method begin -* @param renderSession {Object} The RenderSession object -*/ -PIXI.WebGLSpriteBatch.prototype.begin = function(renderSession) -{ - this.renderSession = renderSession; - this.shader = this.renderSession.shaderManager.defaultShader; - - this.start(); -}; - -/** -* @method end -*/ -PIXI.WebGLSpriteBatch.prototype.end = function() -{ - this.flush(); -}; - -/** -* @method render -* @param sprite {Sprite} the sprite to render when using this spritebatch -*/ -PIXI.WebGLSpriteBatch.prototype.render = function(sprite) -{ - var texture = sprite.texture; - - //TODO set blend modes.. - // check texture.. - if(this.currentBatchSize >= this.size) - { - this.flush(); - this.currentBaseTexture = texture.baseTexture; - } - - // get the uvs for the texture - var uvs = texture._uvs; - // if the uvs have not updated then no point rendering just yet! - if(!uvs)return; - - // TODO trim?? - var aX = sprite.anchor.x; - var aY = sprite.anchor.y; - - var w0, w1, h0, h1; - - if (texture.trim) - { - // if the sprite is trimmed then we need to add the extra space before transforming the sprite coords.. - var trim = texture.trim; - - w1 = trim.x - aX * trim.width; - w0 = w1 + texture.crop.width; - - h1 = trim.y - aY * trim.height; - h0 = h1 + texture.crop.height; - - } - else - { - w0 = (texture.frame.width ) * (1-aX); - w1 = (texture.frame.width ) * -aX; - - h0 = texture.frame.height * (1-aY); - h1 = texture.frame.height * -aY; - } - - var index = this.currentBatchSize * 4 * this.vertSize; - - var resolution = texture.baseTexture.resolution; - - var worldTransform = sprite.worldTransform; - - var a = worldTransform.a / resolution; - var b = worldTransform.b / resolution; - var c = worldTransform.c / resolution; - var d = worldTransform.d / resolution; - var tx = worldTransform.tx; - var ty = worldTransform.ty; - - var colors = this.colors; - var positions = this.positions; - - if(this.renderSession.roundPixels) - { - // xy - positions[index] = a * w1 + c * h1 + tx | 0; - positions[index+1] = d * h1 + b * w1 + ty | 0; - - // xy - positions[index+5] = a * w0 + c * h1 + tx | 0; - positions[index+6] = d * h1 + b * w0 + ty | 0; - - // xy - positions[index+10] = a * w0 + c * h0 + tx | 0; - positions[index+11] = d * h0 + b * w0 + ty | 0; - - // xy - positions[index+15] = a * w1 + c * h0 + tx | 0; - positions[index+16] = d * h0 + b * w1 + ty | 0; - } - else - { - // xy - positions[index] = a * w1 + c * h1 + tx; - positions[index+1] = d * h1 + b * w1 + ty; - - // xy - positions[index+5] = a * w0 + c * h1 + tx; - positions[index+6] = d * h1 + b * w0 + ty; - - // xy - positions[index+10] = a * w0 + c * h0 + tx; - positions[index+11] = d * h0 + b * w0 + ty; - - // xy - positions[index+15] = a * w1 + c * h0 + tx; - positions[index+16] = d * h0 + b * w1 + ty; - } - - // uv - positions[index+2] = uvs.x0; - positions[index+3] = uvs.y0; - - // uv - positions[index+7] = uvs.x1; - positions[index+8] = uvs.y1; - - // uv - positions[index+12] = uvs.x2; - positions[index+13] = uvs.y2; - - // uv - positions[index+17] = uvs.x3; - positions[index+18] = uvs.y3; - - // color and alpha - var tint = sprite.tint; - colors[index+4] = colors[index+9] = colors[index+14] = colors[index+19] = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16) + (sprite.worldAlpha * 255 << 24); - - // increment the batchsize - this.sprites[this.currentBatchSize++] = sprite; - - -}; - -/** -* Renders a TilingSprite using the spriteBatch. -* -* @method renderTilingSprite -* @param sprite {TilingSprite} the tilingSprite to render -*/ -PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite) -{ - var texture = tilingSprite.tilingTexture; - - // check texture.. - if(this.currentBatchSize >= this.size) - { - //return; - this.flush(); - this.currentBaseTexture = texture.baseTexture; - } - - // set the textures uvs temporarily - // TODO create a separate texture so that we can tile part of a texture - - if(!tilingSprite._uvs)tilingSprite._uvs = new PIXI.TextureUvs(); - - var uvs = tilingSprite._uvs; - - tilingSprite.tilePosition.x %= texture.baseTexture.width * tilingSprite.tileScaleOffset.x; - tilingSprite.tilePosition.y %= texture.baseTexture.height * tilingSprite.tileScaleOffset.y; - - var offsetX = tilingSprite.tilePosition.x/(texture.baseTexture.width*tilingSprite.tileScaleOffset.x); - var offsetY = tilingSprite.tilePosition.y/(texture.baseTexture.height*tilingSprite.tileScaleOffset.y); - - var scaleX = (tilingSprite.width / texture.baseTexture.width) / (tilingSprite.tileScale.x * tilingSprite.tileScaleOffset.x); - var scaleY = (tilingSprite.height / texture.baseTexture.height) / (tilingSprite.tileScale.y * tilingSprite.tileScaleOffset.y); - - uvs.x0 = 0 - offsetX; - uvs.y0 = 0 - offsetY; - - uvs.x1 = (1 * scaleX) - offsetX; - uvs.y1 = 0 - offsetY; - - uvs.x2 = (1 * scaleX) - offsetX; - uvs.y2 = (1 * scaleY) - offsetY; - - uvs.x3 = 0 - offsetX; - uvs.y3 = (1 * scaleY) - offsetY; - - // get the tilingSprites current alpha and tint and combining them into a single color - var tint = tilingSprite.tint; - var color = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16) + (tilingSprite.alpha * 255 << 24); - - var positions = this.positions; - var colors = this.colors; - - var width = tilingSprite.width; - var height = tilingSprite.height; - - // TODO trim?? - var aX = tilingSprite.anchor.x; - var aY = tilingSprite.anchor.y; - var w0 = width * (1-aX); - var w1 = width * -aX; - - var h0 = height * (1-aY); - var h1 = height * -aY; - - var index = this.currentBatchSize * 4 * this.vertSize; - - var resolution = texture.baseTexture.resolution; - - var worldTransform = tilingSprite.worldTransform; - - var a = worldTransform.a / resolution;//[0]; - var b = worldTransform.b / resolution;//[3]; - var c = worldTransform.c / resolution;//[1]; - var d = worldTransform.d / resolution;//[4]; - var tx = worldTransform.tx;//[2]; - var ty = worldTransform.ty;//[5]; - - // xy - positions[index++] = a * w1 + c * h1 + tx; - positions[index++] = d * h1 + b * w1 + ty; - // uv - positions[index++] = uvs.x0; - positions[index++] = uvs.y0; - // color - colors[index++] = color; - - // xy - positions[index++] = (a * w0 + c * h1 + tx); - positions[index++] = d * h1 + b * w0 + ty; - // uv - positions[index++] = uvs.x1; - positions[index++] = uvs.y1; - // color - colors[index++] = color; - - // xy - positions[index++] = a * w0 + c * h0 + tx; - positions[index++] = d * h0 + b * w0 + ty; - // uv - positions[index++] = uvs.x2; - positions[index++] = uvs.y2; - // color - colors[index++] = color; - - // xy - positions[index++] = a * w1 + c * h0 + tx; - positions[index++] = d * h0 + b * w1 + ty; - // uv - positions[index++] = uvs.x3; - positions[index++] = uvs.y3; - // color - colors[index++] = color; - - // increment the batchsize - this.sprites[this.currentBatchSize++] = tilingSprite; -}; - -/** -* Renders the content and empties the current batch. -* -* @method flush -*/ -PIXI.WebGLSpriteBatch.prototype.flush = function() -{ - // If the batch is length 0 then return as there is nothing to draw - if (this.currentBatchSize===0)return; - - var gl = this.gl; - var shader; - - if(this.dirty) - { - this.dirty = false; - // bind the main texture - gl.activeTexture(gl.TEXTURE0); - - // bind the buffers - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - shader = this.defaultShader.shaders[gl.id]; - - // this is the same for each shader? - var stride = this.vertSize * 4; - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, stride, 2 * 4); - - // color attributes will be interpreted as unsigned bytes and normalized - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.UNSIGNED_BYTE, true, stride, 4 * 4); - } - - // upload the verts to the buffer - if(this.currentBatchSize > ( this.size * 0.5 ) ) - { - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - } - else - { - var view = this.positions.subarray(0, this.currentBatchSize * 4 * this.vertSize); - gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); - } - - var nextTexture, nextBlendMode, nextShader; - var batchSize = 0; - var start = 0; - - var currentBaseTexture = null; - var currentBlendMode = this.renderSession.blendModeManager.currentBlendMode; - var currentShader = null; - - var blendSwap = false; - var shaderSwap = false; - var sprite; - - for (var i = 0, j = this.currentBatchSize; i < j; i++) { - - sprite = this.sprites[i]; - - nextTexture = sprite.texture.baseTexture; - nextBlendMode = sprite.blendMode; - nextShader = sprite.shader || this.defaultShader; - - blendSwap = currentBlendMode !== nextBlendMode; - shaderSwap = currentShader !== nextShader; // should I use _UIDS??? - - if(currentBaseTexture !== nextTexture || blendSwap || shaderSwap) - { - this.renderBatch(currentBaseTexture, batchSize, start); - - start = i; - batchSize = 0; - currentBaseTexture = nextTexture; - - if( blendSwap ) - { - currentBlendMode = nextBlendMode; - this.renderSession.blendModeManager.setBlendMode( currentBlendMode ); - } - - if( shaderSwap ) - { - currentShader = nextShader; - - shader = currentShader.shaders[gl.id]; - - if(!shader) - { - shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc =currentShader.fragmentSrc; - shader.uniforms =currentShader.uniforms; - shader.init(); - - currentShader.shaders[gl.id] = shader; - } - - // set shader function??? - this.renderSession.shaderManager.setShader(shader); - - if(shader.dirty)shader.syncUniforms(); - - // both thease only need to be set if they are changing.. - // set the projection - var projection = this.renderSession.projection; - gl.uniform2f(shader.projectionVector, projection.x, projection.y); - - // TODO - this is temprorary! - var offsetVector = this.renderSession.offset; - gl.uniform2f(shader.offsetVector, offsetVector.x, offsetVector.y); - - // set the pointers - } - } - - batchSize++; - } - - this.renderBatch(currentBaseTexture, batchSize, start); - - // then reset the batch! - this.currentBatchSize = 0; -}; - -/** -* @method renderBatch -* @param texture {Texture} -* @param size {Number} -* @param startIndex {Number} -*/ -PIXI.WebGLSpriteBatch.prototype.renderBatch = function(texture, size, startIndex) -{ - if(size === 0)return; - - var gl = this.gl; - - // check if a texture is dirty.. - if(texture._dirty[gl.id]) - { - this.renderSession.renderer.updateTexture(texture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]); - } - - // now draw those suckas! - gl.drawElements(gl.TRIANGLES, size * 6, gl.UNSIGNED_SHORT, startIndex * 6 * 2); - - // increment the draw count - this.renderSession.drawCount++; -}; - -/** -* @method stop -*/ -PIXI.WebGLSpriteBatch.prototype.stop = function() -{ - this.flush(); - this.dirty = true; -}; - -/** -* @method start -*/ -PIXI.WebGLSpriteBatch.prototype.start = function() -{ - this.dirty = true; -}; - -/** -* Destroys the SpriteBatch. -* -* @method destroy -*/ -PIXI.WebGLSpriteBatch.prototype.destroy = function() -{ - this.vertices = null; - this.indices = null; - - this.gl.deleteBuffer( this.vertexBuffer ); - this.gl.deleteBuffer( this.indexBuffer ); - - this.currentBaseTexture = null; - - this.gl = null; -}; -/** - * @author Mat Groves - * - * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ - * for creating the original pixi version! - * - * Heavily inspired by LibGDX's WebGLSpriteBatch: - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java - */ - -/** -* @class WebGLFastSpriteBatch -* @constructor -*/ -PIXI.WebGLFastSpriteBatch = function(gl) -{ - /** - * @property vertSize - * @type Number - */ - this.vertSize = 10; - - /** - * @property maxSize - * @type Number - */ - this.maxSize = 6000;//Math.pow(2, 16) / this.vertSize; - - /** - * @property size - * @type Number - */ - this.size = this.maxSize; - - //the total number of floats in our batch - var numVerts = this.size * 4 * this.vertSize; - - //the total number of indices in our batch - var numIndices = this.maxSize * 6; - - /** - * Vertex data - * @property vertices - * @type Float32Array - */ - this.vertices = new PIXI.Float32Array(numVerts); - - /** - * Index data - * @property indices - * @type Uint16Array - */ - this.indices = new PIXI.Uint16Array(numIndices); - - /** - * @property vertexBuffer - * @type Object - */ - this.vertexBuffer = null; - - /** - * @property indexBuffer - * @type Object - */ - this.indexBuffer = null; - - /** - * @property lastIndexCount - * @type Number - */ - this.lastIndexCount = 0; - - for (var i=0, j=0; i < numIndices; i += 6, j += 4) - { - this.indices[i + 0] = j + 0; - this.indices[i + 1] = j + 1; - this.indices[i + 2] = j + 2; - this.indices[i + 3] = j + 0; - this.indices[i + 4] = j + 2; - this.indices[i + 5] = j + 3; - } - - /** - * @property drawing - * @type Boolean - */ - this.drawing = false; - - /** - * @property currentBatchSize - * @type Number - */ - this.currentBatchSize = 0; - - /** - * @property currentBaseTexture - * @type BaseTexture - */ - this.currentBaseTexture = null; - - /** - * @property currentBlendMode - * @type Number - */ - this.currentBlendMode = 0; - - /** - * @property renderSession - * @type Object - */ - this.renderSession = null; - - /** - * @property shader - * @type Object - */ - this.shader = null; - - /** - * @property matrix - * @type Matrix - */ - this.matrix = null; - - this.setContext(gl); -}; - -PIXI.WebGLFastSpriteBatch.prototype.constructor = PIXI.WebGLFastSpriteBatch; - -/** - * Sets the WebGL Context. - * - * @method setContext - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLFastSpriteBatch.prototype.setContext = function(gl) -{ - this.gl = gl; - - // create a couple of buffers - this.vertexBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // 65535 is max index, so 65535 / 6 = 10922. - - //upload the index data - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); -}; - -/** - * @method begin - * @param spriteBatch {WebGLSpriteBatch} - * @param renderSession {Object} - */ -PIXI.WebGLFastSpriteBatch.prototype.begin = function(spriteBatch, renderSession) -{ - this.renderSession = renderSession; - this.shader = this.renderSession.shaderManager.fastShader; - - this.matrix = spriteBatch.worldTransform.toArray(true); - - this.start(); -}; - -/** - * @method end - */ -PIXI.WebGLFastSpriteBatch.prototype.end = function() -{ - this.flush(); -}; - -/** - * @method render - * @param spriteBatch {WebGLSpriteBatch} - */ -PIXI.WebGLFastSpriteBatch.prototype.render = function(spriteBatch) -{ - var children = spriteBatch.children; - var sprite = children[0]; - - // if the uvs have not updated then no point rendering just yet! - - // check texture. - if(!sprite.texture._uvs)return; - - this.currentBaseTexture = sprite.texture.baseTexture; - - // check blend mode - if(sprite.blendMode !== this.renderSession.blendModeManager.currentBlendMode) - { - this.flush(); - this.renderSession.blendModeManager.setBlendMode(sprite.blendMode); - } - - for(var i=0,j= children.length; i= this.size) - { - this.flush(); - } -}; - -/** - * @method flush - */ -PIXI.WebGLFastSpriteBatch.prototype.flush = function() -{ - // If the batch is length 0 then return as there is nothing to draw - if (this.currentBatchSize===0)return; - - var gl = this.gl; - - // bind the current texture - - if(!this.currentBaseTexture._glTextures[gl.id])this.renderSession.renderer.updateTexture(this.currentBaseTexture, gl); - - gl.bindTexture(gl.TEXTURE_2D, this.currentBaseTexture._glTextures[gl.id]); - - // upload the verts to the buffer - - if(this.currentBatchSize > ( this.size * 0.5 ) ) - { - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - } - else - { - var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize); - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); - } - - // now draw those suckas! - gl.drawElements(gl.TRIANGLES, this.currentBatchSize * 6, gl.UNSIGNED_SHORT, 0); - - // then reset the batch! - this.currentBatchSize = 0; - - // increment the draw count - this.renderSession.drawCount++; -}; - - -/** - * @method stop - */ -PIXI.WebGLFastSpriteBatch.prototype.stop = function() -{ - this.flush(); -}; - -/** - * @method start - */ -PIXI.WebGLFastSpriteBatch.prototype.start = function() -{ - var gl = this.gl; - - // bind the main texture - gl.activeTexture(gl.TEXTURE0); - - // bind the buffers - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - // set the projection - var projection = this.renderSession.projection; - gl.uniform2f(this.shader.projectionVector, projection.x, projection.y); - - // set the matrix - gl.uniformMatrix3fv(this.shader.uMatrix, false, this.matrix); - - // set the pointers - var stride = this.vertSize * 4; - - gl.vertexAttribPointer(this.shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0); - gl.vertexAttribPointer(this.shader.aPositionCoord, 2, gl.FLOAT, false, stride, 2 * 4); - gl.vertexAttribPointer(this.shader.aScale, 2, gl.FLOAT, false, stride, 4 * 4); - gl.vertexAttribPointer(this.shader.aRotation, 1, gl.FLOAT, false, stride, 6 * 4); - gl.vertexAttribPointer(this.shader.aTextureCoord, 2, gl.FLOAT, false, stride, 7 * 4); - gl.vertexAttribPointer(this.shader.colorAttribute, 1, gl.FLOAT, false, stride, 9 * 4); - -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLFilterManager -* @constructor -*/ -PIXI.WebGLFilterManager = function() -{ - /** - * @property filterStack - * @type Array - */ - this.filterStack = []; - - /** - * @property offsetX - * @type Number - */ - this.offsetX = 0; - - /** - * @property offsetY - * @type Number - */ - this.offsetY = 0; -}; - -PIXI.WebGLFilterManager.prototype.constructor = PIXI.WebGLFilterManager; - -/** -* Initialises the context and the properties. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLFilterManager.prototype.setContext = function(gl) -{ - this.gl = gl; - this.texturePool = []; - - this.initShaderBuffers(); -}; - -/** -* @method begin -* @param renderSession {RenderSession} -* @param buffer {ArrayBuffer} -*/ -PIXI.WebGLFilterManager.prototype.begin = function(renderSession, buffer) -{ - this.renderSession = renderSession; - this.defaultShader = renderSession.shaderManager.defaultShader; - - var projection = this.renderSession.projection; - this.width = projection.x * 2; - this.height = -projection.y * 2; - this.buffer = buffer; -}; - -/** -* Applies the filter and adds it to the current filter stack. -* -* @method pushFilter -* @param filterBlock {Object} the filter that will be pushed to the current filter stack -*/ -PIXI.WebGLFilterManager.prototype.pushFilter = function(filterBlock) -{ - var gl = this.gl; - - var projection = this.renderSession.projection; - var offset = this.renderSession.offset; - - filterBlock._filterArea = filterBlock.target.filterArea || filterBlock.target.getBounds(); - - // filter program - // OPTIMISATION - the first filter is free if its a simple color change? - this.filterStack.push(filterBlock); - - var filter = filterBlock.filterPasses[0]; - - this.offsetX += filterBlock._filterArea.x; - this.offsetY += filterBlock._filterArea.y; - - var texture = this.texturePool.pop(); - if(!texture) - { - texture = new PIXI.FilterTexture(this.gl, this.width, this.height); - } - else - { - texture.resize(this.width, this.height); - } - - gl.bindTexture(gl.TEXTURE_2D, texture.texture); - - var filterArea = filterBlock._filterArea;// filterBlock.target.getBounds();///filterBlock.target.filterArea; - - var padding = filter.padding; - filterArea.x -= padding; - filterArea.y -= padding; - filterArea.width += padding * 2; - filterArea.height += padding * 2; - - // cap filter to screen size.. - if(filterArea.x < 0)filterArea.x = 0; - if(filterArea.width > this.width)filterArea.width = this.width; - if(filterArea.y < 0)filterArea.y = 0; - if(filterArea.height > this.height)filterArea.height = this.height; - - //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, filterArea.width, filterArea.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); - gl.bindFramebuffer(gl.FRAMEBUFFER, texture.frameBuffer); - - // set view port - gl.viewport(0, 0, filterArea.width, filterArea.height); - - projection.x = filterArea.width/2; - projection.y = -filterArea.height/2; - - offset.x = -filterArea.x; - offset.y = -filterArea.y; - - // update projection - // now restore the regular shader.. - // this.renderSession.shaderManager.setShader(this.defaultShader); - //gl.uniform2f(this.defaultShader.projectionVector, filterArea.width/2, -filterArea.height/2); - //gl.uniform2f(this.defaultShader.offsetVector, -filterArea.x, -filterArea.y); - - gl.colorMask(true, true, true, true); - gl.clearColor(0,0,0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); - - filterBlock._glFilterTexture = texture; - -}; - -/** -* Removes the last filter from the filter stack and doesn't return it. -* -* @method popFilter -*/ -PIXI.WebGLFilterManager.prototype.popFilter = function() -{ - var gl = this.gl; - var filterBlock = this.filterStack.pop(); - var filterArea = filterBlock._filterArea; - var texture = filterBlock._glFilterTexture; - var projection = this.renderSession.projection; - var offset = this.renderSession.offset; - - if(filterBlock.filterPasses.length > 1) - { - gl.viewport(0, 0, filterArea.width, filterArea.height); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - - this.vertexArray[0] = 0; - this.vertexArray[1] = filterArea.height; - - this.vertexArray[2] = filterArea.width; - this.vertexArray[3] = filterArea.height; - - this.vertexArray[4] = 0; - this.vertexArray[5] = 0; - - this.vertexArray[6] = filterArea.width; - this.vertexArray[7] = 0; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - // now set the uvs.. - this.uvArray[2] = filterArea.width/this.width; - this.uvArray[5] = filterArea.height/this.height; - this.uvArray[6] = filterArea.width/this.width; - this.uvArray[7] = filterArea.height/this.height; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray); - - var inputTexture = texture; - var outputTexture = this.texturePool.pop(); - if(!outputTexture)outputTexture = new PIXI.FilterTexture(this.gl, this.width, this.height); - outputTexture.resize(this.width, this.height); - - // need to clear this FBO as it may have some left over elements from a previous filter. - gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer ); - gl.clear(gl.COLOR_BUFFER_BIT); - - gl.disable(gl.BLEND); - - for (var i = 0; i < filterBlock.filterPasses.length-1; i++) - { - var filterPass = filterBlock.filterPasses[i]; - - gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer ); - - // set texture - gl.activeTexture(gl.TEXTURE0); - gl.bindTexture(gl.TEXTURE_2D, inputTexture.texture); - - // draw texture.. - //filterPass.applyFilterPass(filterArea.width, filterArea.height); - this.applyFilterPass(filterPass, filterArea, filterArea.width, filterArea.height); - - // swap the textures.. - var temp = inputTexture; - inputTexture = outputTexture; - outputTexture = temp; - } - - gl.enable(gl.BLEND); - - texture = inputTexture; - this.texturePool.push(outputTexture); - } - - var filter = filterBlock.filterPasses[filterBlock.filterPasses.length-1]; - - this.offsetX -= filterArea.x; - this.offsetY -= filterArea.y; - - var sizeX = this.width; - var sizeY = this.height; - - var offsetX = 0; - var offsetY = 0; - - var buffer = this.buffer; - - // time to render the filters texture to the previous scene - if(this.filterStack.length === 0) - { - gl.colorMask(true, true, true, true);//this.transparent); - } - else - { - var currentFilter = this.filterStack[this.filterStack.length-1]; - filterArea = currentFilter._filterArea; - - sizeX = filterArea.width; - sizeY = filterArea.height; - - offsetX = filterArea.x; - offsetY = filterArea.y; - - buffer = currentFilter._glFilterTexture.frameBuffer; - } - - // TODO need to remove these global elements.. - projection.x = sizeX/2; - projection.y = -sizeY/2; - - offset.x = offsetX; - offset.y = offsetY; - - filterArea = filterBlock._filterArea; - - var x = filterArea.x-offsetX; - var y = filterArea.y-offsetY; - - // update the buffers.. - // make sure to flip the y! - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - - this.vertexArray[0] = x; - this.vertexArray[1] = y + filterArea.height; - - this.vertexArray[2] = x + filterArea.width; - this.vertexArray[3] = y + filterArea.height; - - this.vertexArray[4] = x; - this.vertexArray[5] = y; - - this.vertexArray[6] = x + filterArea.width; - this.vertexArray[7] = y; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - - this.uvArray[2] = filterArea.width/this.width; - this.uvArray[5] = filterArea.height/this.height; - this.uvArray[6] = filterArea.width/this.width; - this.uvArray[7] = filterArea.height/this.height; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray); - - gl.viewport(0, 0, sizeX * this.renderSession.resolution, sizeY * this.renderSession.resolution); - - // bind the buffer - gl.bindFramebuffer(gl.FRAMEBUFFER, buffer ); - - // set the blend mode! - //gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA) - - // set texture - gl.activeTexture(gl.TEXTURE0); - gl.bindTexture(gl.TEXTURE_2D, texture.texture); - - // apply! - this.applyFilterPass(filter, filterArea, sizeX, sizeY); - - // now restore the regular shader.. should happen automatically now.. - // this.renderSession.shaderManager.setShader(this.defaultShader); - // gl.uniform2f(this.defaultShader.projectionVector, sizeX/2, -sizeY/2); - // gl.uniform2f(this.defaultShader.offsetVector, -offsetX, -offsetY); - - // return the texture to the pool - this.texturePool.push(texture); - filterBlock._glFilterTexture = null; -}; - - -/** -* Applies the filter to the specified area. -* -* @method applyFilterPass -* @param filter {AbstractFilter} the filter that needs to be applied -* @param filterArea {Texture} TODO - might need an update -* @param width {Number} the horizontal range of the filter -* @param height {Number} the vertical range of the filter -*/ -PIXI.WebGLFilterManager.prototype.applyFilterPass = function(filter, filterArea, width, height) -{ - // use program - var gl = this.gl; - var shader = filter.shaders[gl.id]; - - if(!shader) - { - shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc = filter.fragmentSrc; - shader.uniforms = filter.uniforms; - shader.init(); - - filter.shaders[gl.id] = shader; - } - - // set the shader - this.renderSession.shaderManager.setShader(shader); - -// gl.useProgram(shader.program); - - gl.uniform2f(shader.projectionVector, width/2, -height/2); - gl.uniform2f(shader.offsetVector, 0,0); - - if(filter.uniforms.dimensions) - { - filter.uniforms.dimensions.value[0] = this.width;//width; - filter.uniforms.dimensions.value[1] = this.height;//height; - filter.uniforms.dimensions.value[2] = this.vertexArray[0]; - filter.uniforms.dimensions.value[3] = this.vertexArray[5];//filterArea.height; - } - - shader.syncUniforms(); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer); - gl.vertexAttribPointer(shader.colorAttribute, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - // draw the filter... - gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 ); - - this.renderSession.drawCount++; -}; - -/** -* Initialises the shader buffers. -* -* @method initShaderBuffers -*/ -PIXI.WebGLFilterManager.prototype.initShaderBuffers = function() -{ - var gl = this.gl; - - // create some buffers - this.vertexBuffer = gl.createBuffer(); - this.uvBuffer = gl.createBuffer(); - this.colorBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // bind and upload the vertexs.. - // keep a reference to the vertexFloatData.. - this.vertexArray = new PIXI.Float32Array([0.0, 0.0, - 1.0, 0.0, - 0.0, 1.0, - 1.0, 1.0]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertexArray, gl.STATIC_DRAW); - - // bind and upload the uv buffer - this.uvArray = new PIXI.Float32Array([0.0, 0.0, - 1.0, 0.0, - 0.0, 1.0, - 1.0, 1.0]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvArray, gl.STATIC_DRAW); - - this.colorArray = new PIXI.Float32Array([1.0, 0xFFFFFF, - 1.0, 0xFFFFFF, - 1.0, 0xFFFFFF, - 1.0, 0xFFFFFF]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.colorArray, gl.STATIC_DRAW); - - // bind and upload the index - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 1, 3, 2]), gl.STATIC_DRAW); - -}; - -/** -* Destroys the filter and removes it from the filter stack. -* -* @method destroy -*/ -PIXI.WebGLFilterManager.prototype.destroy = function() -{ - var gl = this.gl; - - this.filterStack = null; - - this.offsetX = 0; - this.offsetY = 0; - - // destroy textures - for (var i = 0; i < this.texturePool.length; i++) { - this.texturePool[i].destroy(); - } - - this.texturePool = null; - - //destroy buffers.. - gl.deleteBuffer(this.vertexBuffer); - gl.deleteBuffer(this.uvBuffer); - gl.deleteBuffer(this.colorBuffer); - gl.deleteBuffer(this.indexBuffer); -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class FilterTexture -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -* @param width {Number} the horizontal range of the filter -* @param height {Number} the vertical range of the filter -* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values -*/ -PIXI.FilterTexture = function(gl, width, height, scaleMode) -{ - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - // next time to create a frame buffer and texture - - /** - * @property frameBuffer - * @type Any - */ - this.frameBuffer = gl.createFramebuffer(); - - /** - * @property texture - * @type Any - */ - this.texture = gl.createTexture(); - - /** - * @property scaleMode - * @type Number - */ - scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - gl.bindTexture(gl.TEXTURE_2D, this.texture); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer ); - - gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer ); - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); - - // required for masking a mask?? - this.renderBuffer = gl.createRenderbuffer(); - gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer); - gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.renderBuffer); - - this.resize(width, height); -}; - -PIXI.FilterTexture.prototype.constructor = PIXI.FilterTexture; - -/** -* Clears the filter texture. -* -* @method clear -*/ -PIXI.FilterTexture.prototype.clear = function() -{ - var gl = this.gl; - - gl.clearColor(0,0,0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); -}; - -/** - * Resizes the texture to the specified width and height - * - * @method resize - * @param width {Number} the new width of the texture - * @param height {Number} the new height of the texture - */ -PIXI.FilterTexture.prototype.resize = function(width, height) -{ - if(this.width === width && this.height === height) return; - - this.width = width; - this.height = height; - - var gl = this.gl; - - gl.bindTexture(gl.TEXTURE_2D, this.texture); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width , height , 0, gl.RGBA, gl.UNSIGNED_BYTE, null); - // update the stencil buffer width and height - gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer); - gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width , height ); -}; - -/** -* Destroys the filter texture. -* -* @method destroy -*/ -PIXI.FilterTexture.prototype.destroy = function() -{ - var gl = this.gl; - gl.deleteFramebuffer( this.frameBuffer ); - gl.deleteTexture( this.texture ); - - this.frameBuffer = null; - this.texture = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Creates a Canvas element of the given size. - * - * @class CanvasBuffer - * @constructor - * @param width {Number} the width for the newly created canvas - * @param height {Number} the height for the newly created canvas - */ -PIXI.CanvasBuffer = function(width, height) -{ - /** - * The width of the Canvas in pixels. - * - * @property width - * @type Number - */ - this.width = width; - - /** - * The height of the Canvas in pixels. - * - * @property height - * @type Number - */ - this.height = height; - - /** - * The Canvas object that belongs to this CanvasBuffer. - * - * @property canvas - * @type HTMLCanvasElement - */ - this.canvas = document.createElement("canvas"); - - /** - * A CanvasRenderingContext2D object representing a two-dimensional rendering context. - * - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.canvas.getContext("2d"); - - this.canvas.width = width; - this.canvas.height = height; -}; - -PIXI.CanvasBuffer.prototype.constructor = PIXI.CanvasBuffer; - -/** - * Clears the canvas that was created by the CanvasBuffer class. - * - * @method clear - * @private - */ -PIXI.CanvasBuffer.prototype.clear = function() -{ - this.context.setTransform(1, 0, 0, 1, 0, 0); - this.context.clearRect(0,0, this.width, this.height); -}; - -/** - * Resizes the canvas to the specified width and height. - * - * @method resize - * @param width {Number} the new width of the canvas - * @param height {Number} the new height of the canvas - */ -PIXI.CanvasBuffer.prototype.resize = function(width, height) -{ - this.width = this.canvas.width = width; - this.height = this.canvas.height = height; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A set of functions used to handle masking. - * - * @class CanvasMaskManager - * @constructor - */ -PIXI.CanvasMaskManager = function() -{ -}; - -PIXI.CanvasMaskManager.prototype.constructor = PIXI.CanvasMaskManager; - -/** - * This method adds it to the current stack of masks. - * - * @method pushMask - * @param maskData {Object} the maskData that will be pushed - * @param renderSession {Object} The renderSession whose context will be used for this mask manager. - */ -PIXI.CanvasMaskManager.prototype.pushMask = function(maskData, renderSession) -{ - var context = renderSession.context; - - context.save(); - - var cacheAlpha = maskData.alpha; - var transform = maskData.worldTransform; - - var resolution = renderSession.resolution; - - context.setTransform(transform.a * resolution, - transform.b * resolution, - transform.c * resolution, - transform.d * resolution, - transform.tx * resolution, - transform.ty * resolution); - - PIXI.CanvasGraphics.renderGraphicsMask(maskData, context); - - context.clip(); - - maskData.worldAlpha = cacheAlpha; -}; - -/** - * Restores the current drawing context to the state it was before the mask was applied. - * - * @method popMask - * @param renderSession {Object} The renderSession whose context will be used for this mask manager. - */ -PIXI.CanvasMaskManager.prototype.popMask = function(renderSession) -{ - renderSession.context.restore(); -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Utility methods for Sprite/Texture tinting. - * - * @class CanvasTinter - * @static - */ -PIXI.CanvasTinter = function() -{ -}; - -/** - * Basically this method just needs a sprite and a color and tints the sprite with the given color. - * - * @method getTintedTexture - * @static - * @param sprite {Sprite} the sprite to tint - * @param color {Number} the color to use to tint the sprite with - * @return {HTMLCanvasElement} The tinted canvas - */ -PIXI.CanvasTinter.getTintedTexture = function(sprite, color) -{ - var texture = sprite.texture; - - color = PIXI.CanvasTinter.roundColor(color); - - var stringColor = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - - texture.tintCache = texture.tintCache || {}; - - if(texture.tintCache[stringColor]) return texture.tintCache[stringColor]; - - // clone texture.. - var canvas = PIXI.CanvasTinter.canvas || document.createElement("canvas"); - - //PIXI.CanvasTinter.tintWithPerPixel(texture, stringColor, canvas); - PIXI.CanvasTinter.tintMethod(texture, color, canvas); - - if(PIXI.CanvasTinter.convertTintToImage) - { - // is this better? - var tintImage = new Image(); - tintImage.src = canvas.toDataURL(); - - texture.tintCache[stringColor] = tintImage; - } - else - { - texture.tintCache[stringColor] = canvas; - // if we are not converting the texture to an image then we need to lose the reference to the canvas - PIXI.CanvasTinter.canvas = null; - } - - return canvas; -}; - -/** - * Tint a texture using the "multiply" operation. - * - * @method tintWithMultiply - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithMultiply = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - - context.fillRect(0, 0, crop.width, crop.height); - - context.globalCompositeOperation = "multiply"; - - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - context.globalCompositeOperation = "destination-atop"; - - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); -}; - -/** - * Tint a texture using the "overlay" operation. - * - * @method tintWithOverlay - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithOverlay = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.globalCompositeOperation = "copy"; - context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - context.fillRect(0, 0, crop.width, crop.height); - - context.globalCompositeOperation = "destination-atop"; - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - //context.globalCompositeOperation = "copy"; -}; - -/** - * Tint a texture pixel per pixel. - * - * @method tintPerPixel - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithPerPixel = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.globalCompositeOperation = "copy"; - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - var rgbValues = PIXI.hex2rgb(color); - var r = rgbValues[0], g = rgbValues[1], b = rgbValues[2]; - - var pixelData = context.getImageData(0, 0, crop.width, crop.height); - - var pixels = pixelData.data; - - for (var i = 0; i < pixels.length; i += 4) - { - pixels[i+0] *= r; - pixels[i+1] *= g; - pixels[i+2] *= b; - } - - context.putImageData(pixelData, 0, 0); -}; - -/** - * Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel. - * - * @method roundColor - * @static - * @param color {number} the color to round, should be a hex color - */ -PIXI.CanvasTinter.roundColor = function(color) -{ - var step = PIXI.CanvasTinter.cacheStepsPerColorChannel; - - var rgbValues = PIXI.hex2rgb(color); - - rgbValues[0] = Math.min(255, (rgbValues[0] / step) * step); - rgbValues[1] = Math.min(255, (rgbValues[1] / step) * step); - rgbValues[2] = Math.min(255, (rgbValues[2] / step) * step); - - return PIXI.rgb2hex(rgbValues); -}; - -/** - * Number of steps which will be used as a cap when rounding colors. - * - * @property cacheStepsPerColorChannel - * @type Number - * @static - */ -PIXI.CanvasTinter.cacheStepsPerColorChannel = 8; - -/** - * Tint cache boolean flag. - * - * @property convertTintToImage - * @type Boolean - * @static - */ -PIXI.CanvasTinter.convertTintToImage = false; - -/** - * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. - * - * @property canUseMultiply - * @type Boolean - * @static - */ -PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes(); - -/** - * The tinting method that will be used. - * - * @method tintMethod - * @static - */ -PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The CanvasRenderer draws the Stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. - * Don't forget to add the CanvasRenderer.view to your DOM or you will not see anything :) - * - * @class CanvasRenderer - * @constructor - * @param [width=800] {Number} the width of the canvas view - * @param [height=600] {Number} the height of the canvas view - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * @param [options.clearBeforeRender=true] {Boolean} This sets if the CanvasRenderer will clear the canvas or not before the new render pass. - */ -PIXI.CanvasRenderer = function(width, height, options) -{ - if(options) - { - for (var i in PIXI.defaultRenderOptions) - { - if (typeof options[i] === "undefined") options[i] = PIXI.defaultRenderOptions[i]; - } - } - else - { - options = PIXI.defaultRenderOptions; - } - - if(!PIXI.defaultRenderer) - { - PIXI.sayHello("Canvas"); - PIXI.defaultRenderer = this; - } - - /** - * The renderer type. - * - * @property type - * @type Number - */ - this.type = PIXI.CANVAS_RENDERER; - - /** - * The resolution of the canvas. - * - * @property resolution - * @type Number - */ - this.resolution = options.resolution; - - /** - * This sets if the CanvasRenderer will clear the canvas or not before the new render pass. - * If the Stage is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color. - * If the Stage is transparent Pixi will use clearRect to clear the canvas every frame. - * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set. - * - * @property clearBeforeRender - * @type Boolean - * @default - */ - this.clearBeforeRender = options.clearBeforeRender; - - /** - * Whether the render view is transparent - * - * @property transparent - * @type Boolean - */ - this.transparent = options.transparent; - - /** - * Whether the render view should be resized automatically - * - * @property autoResize - * @type Boolean - */ - this.autoResize = options.autoResize || false; - - - /** - * The width of the canvas view - * - * @property width - * @type Number - * @default 800 - */ - this.width = width || 800; - - /** - * The height of the canvas view - * - * @property height - * @type Number - * @default 600 - */ - this.height = height || 600; - - this.width *= this.resolution; - this.height *= this.resolution; - - /** - * The canvas element that everything is drawn to. - * - * @property view - * @type HTMLCanvasElement - */ - this.view = options.view || document.createElement( "canvas" ); - - /** - * The canvas 2d context that everything is drawn with - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.view.getContext( "2d", { alpha: this.transparent } ); - - /** - * Boolean flag controlling canvas refresh. - * - * @property refresh - * @type Boolean - */ - this.refresh = true; - - this.view.width = this.width * this.resolution; - this.view.height = this.height * this.resolution; - - /** - * Internal var. - * - * @property count - * @type Number - */ - this.count = 0; - - /** - * Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer - * @property maskManager - * @type CanvasMaskManager - */ - this.maskManager = new PIXI.CanvasMaskManager(); - - /** - * The render session is just a bunch of parameter used for rendering - * @property renderSession - * @type Object - */ - this.renderSession = { - context: this.context, - maskManager: this.maskManager, - scaleMode: null, - smoothProperty: null, - /** - * If true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation. - * Handy for crisp pixel art and speed on legacy devices. - * - */ - roundPixels: false - }; - - this.mapBlendModes(); - - this.resize(width, height); - - if("imageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "imageSmoothingEnabled"; - else if("webkitImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "webkitImageSmoothingEnabled"; - else if("mozImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "mozImageSmoothingEnabled"; - else if("oImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "oImageSmoothingEnabled"; - else if ("msImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "msImageSmoothingEnabled"; -}; - -// constructor -PIXI.CanvasRenderer.prototype.constructor = PIXI.CanvasRenderer; - -/** - * Renders the Stage to this canvas view - * - * @method render - * @param stage {Stage} the Stage element to be rendered - */ -PIXI.CanvasRenderer.prototype.render = function(stage) -{ - stage.updateTransform(); - - this.context.setTransform(1,0,0,1,0,0); - - this.context.globalAlpha = 1; - - this.renderSession.currentBlendMode = PIXI.blendModes.NORMAL; - this.context.globalCompositeOperation = PIXI.blendModesCanvas[PIXI.blendModes.NORMAL]; - - if (navigator.isCocoonJS && this.view.screencanvas) { - this.context.fillStyle = "black"; - this.context.clear(); - } - - if (this.clearBeforeRender) - { - if (this.transparent) - { - this.context.clearRect(0, 0, this.width, this.height); - } - else - { - this.context.fillStyle = stage.backgroundColorString; - this.context.fillRect(0, 0, this.width , this.height); - } - } - - this.renderDisplayObject(stage); - - // run interaction! - if(stage.interactive) - { - //need to add some events! - if(!stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = true; - stage.interactionManager.setTarget(this); - } - } -}; - -/** - * Removes everything from the renderer and optionally removes the Canvas DOM element. - * - * @method destroy - * @param [removeView=true] {boolean} Removes the Canvas element from the DOM. - */ -PIXI.CanvasRenderer.prototype.destroy = function(removeView) -{ - if (typeof removeView === "undefined") { removeView = true; } - - if (removeView && this.view.parent) - { - this.view.parent.removeChild(this.view); - } - - this.view = null; - this.context = null; - this.maskManager = null; - this.renderSession = null; - -}; - -/** - * Resizes the canvas view to the specified width and height - * - * @method resize - * @param width {Number} the new width of the canvas view - * @param height {Number} the new height of the canvas view - */ -PIXI.CanvasRenderer.prototype.resize = function(width, height) -{ - this.width = width * this.resolution; - this.height = height * this.resolution; - - this.view.width = this.width; - this.view.height = this.height; - - if (this.autoResize) { - this.view.style.width = this.width / this.resolution + "px"; - this.view.style.height = this.height / this.resolution + "px"; - } -}; - -/** - * Renders a display object - * - * @method renderDisplayObject - * @param displayObject {DisplayObject} The displayObject to render - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas - * @private - */ -PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject, context) -{ - this.renderSession.context = context || this.context; - this.renderSession.resolution = this.resolution; - displayObject._renderCanvas(this.renderSession); -}; - -/** - * Maps Pixi blend modes to canvas blend modes. - * - * @method mapBlendModes - * @private - */ -PIXI.CanvasRenderer.prototype.mapBlendModes = function() -{ - if(!PIXI.blendModesCanvas) - { - PIXI.blendModesCanvas = []; - - if(PIXI.canUseNewCanvasBlendModes()) - { - PIXI.blendModesCanvas[PIXI.blendModes.NORMAL] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.ADD] = "lighter"; //IS THIS OK??? - PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "multiply"; - PIXI.blendModesCanvas[PIXI.blendModes.SCREEN] = "screen"; - PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY] = "overlay"; - PIXI.blendModesCanvas[PIXI.blendModes.DARKEN] = "darken"; - PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN] = "lighten"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "color-dodge"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "color-burn"; - PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "hard-light"; - PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "soft-light"; - PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "difference"; - PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "exclusion"; - PIXI.blendModesCanvas[PIXI.blendModes.HUE] = "hue"; - PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "saturation"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR] = "color"; - PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "luminosity"; - } - else - { - // this means that the browser does not support the cool new blend modes in canvas "cough" ie "cough" - PIXI.blendModesCanvas[PIXI.blendModes.NORMAL] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.ADD] = "lighter"; //IS THIS OK??? - PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SCREEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.DARKEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.HUE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "source-over"; - } - } -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - - -/** - * A set of functions used by the canvas renderer to draw the primitive graphics data. - * - * @class CanvasGraphics - * @static - */ -PIXI.CanvasGraphics = function() -{ -}; - -/* - * Renders a PIXI.Graphics object to a canvas. - * - * @method renderGraphics - * @static - * @param graphics {Graphics} the actual graphics object to render - * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas - */ -PIXI.CanvasGraphics.renderGraphics = function(graphics, context) -{ - var worldAlpha = graphics.worldAlpha; - - if(graphics.dirty) - { - this.updateGraphicsTint(graphics); - graphics.dirty = false; - } - - - for (var i = 0; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - var shape = data.shape; - - var fillColor = data._fillTint; - var lineColor = data._lineTint; - - context.lineWidth = data.lineWidth; - - if(data.type === PIXI.Graphics.POLY) - { - context.beginPath(); - - var points = shape.points; - - context.moveTo(points[0], points[1]); - - for (var j=1; j < points.length/2; j++) - { - context.lineTo(points[j * 2], points[j * 2 + 1]); - } - - if(shape.closed) - { - context.lineTo(points[0], points[1]); - } - - // if the first and last point are the same close the path - much neater :) - if(points[0] === points[points.length-2] && points[1] === points[points.length-1]) - { - context.closePath(); - } - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if(data.type === PIXI.Graphics.RECT) - { - - if(data.fillColor || data.fillColor === 0) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fillRect(shape.x, shape.y, shape.width, shape.height); - - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.strokeRect(shape.x, shape.y, shape.width, shape.height); - } - } - else if(data.type === PIXI.Graphics.CIRC) - { - // TODO - need to be Undefined! - context.beginPath(); - context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI); - context.closePath(); - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if(data.type === PIXI.Graphics.ELIP) - { - // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas - - var w = shape.width * 2; - var h = shape.height * 2; - - var x = shape.x - w/2; - var y = shape.y - h/2; - - context.beginPath(); - - var kappa = 0.5522848, - ox = (w / 2) * kappa, // control point offset horizontal - oy = (h / 2) * kappa, // control point offset vertical - xe = x + w, // x-end - ye = y + h, // y-end - xm = x + w / 2, // x-middle - ym = y + h / 2; // y-middle - - context.moveTo(x, ym); - context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); - context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); - context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); - context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); - - context.closePath(); - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if (data.type === PIXI.Graphics.RREC) - { - var rx = shape.x; - var ry = shape.y; - var width = shape.width; - var height = shape.height; - var radius = shape.radius; - - var maxRadius = Math.min(width, height) / 2 | 0; - radius = radius > maxRadius ? maxRadius : radius; - - context.beginPath(); - context.moveTo(rx, ry + radius); - context.lineTo(rx, ry + height - radius); - context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height); - context.lineTo(rx + width - radius, ry + height); - context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius); - context.lineTo(rx + width, ry + radius); - context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry); - context.lineTo(rx + radius, ry); - context.quadraticCurveTo(rx, ry, rx, ry + radius); - context.closePath(); - - if(data.fillColor || data.fillColor === 0) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - } -}; - -/* - * Renders a graphics mask - * - * @static - * @private - * @method renderGraphicsMask - * @param graphics {Graphics} the graphics which will be used as a mask - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas - */ -PIXI.CanvasGraphics.renderGraphicsMask = function(graphics, context) -{ - var len = graphics.graphicsData.length; - - if(len === 0) return; - - if(len > 1) - { - len = 1; - window.console.log('Pixi.js warning: masks in canvas can only mask using the first path in the graphics object'); - } - - for (var i = 0; i < 1; i++) - { - var data = graphics.graphicsData[i]; - var shape = data.shape; - - if(data.type === PIXI.Graphics.POLY) - { - context.beginPath(); - - var points = shape.points; - - context.moveTo(points[0], points[1]); - - for (var j=1; j < points.length/2; j++) - { - context.lineTo(points[j * 2], points[j * 2 + 1]); - } - - // if the first and last point are the same close the path - much neater :) - if(points[0] === points[points.length-2] && points[1] === points[points.length-1]) - { - context.closePath(); - } - - } - else if(data.type === PIXI.Graphics.RECT) - { - context.beginPath(); - context.rect(shape.x, shape.y, shape.width, shape.height); - context.closePath(); - } - else if(data.type === PIXI.Graphics.CIRC) - { - // TODO - need to be Undefined! - context.beginPath(); - context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI); - context.closePath(); - } - else if(data.type === PIXI.Graphics.ELIP) - { - - // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas - - var w = shape.width * 2; - var h = shape.height * 2; - - var x = shape.x - w/2; - var y = shape.y - h/2; - - context.beginPath(); - - var kappa = 0.5522848, - ox = (w / 2) * kappa, // control point offset horizontal - oy = (h / 2) * kappa, // control point offset vertical - xe = x + w, // x-end - ye = y + h, // y-end - xm = x + w / 2, // x-middle - ym = y + h / 2; // y-middle - - context.moveTo(x, ym); - context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); - context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); - context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); - context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); - context.closePath(); - } - else if (data.type === PIXI.Graphics.RREC) - { - - var pts = shape.points; - var rx = pts[0]; - var ry = pts[1]; - var width = pts[2]; - var height = pts[3]; - var radius = pts[4]; - - var maxRadius = Math.min(width, height) / 2 | 0; - radius = radius > maxRadius ? maxRadius : radius; - - context.beginPath(); - context.moveTo(rx, ry + radius); - context.lineTo(rx, ry + height - radius); - context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height); - context.lineTo(rx + width - radius, ry + height); - context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius); - context.lineTo(rx + width, ry + radius); - context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry); - context.lineTo(rx + radius, ry); - context.quadraticCurveTo(rx, ry, rx, ry + radius); - context.closePath(); - } - } -}; - -PIXI.CanvasGraphics.updateGraphicsTint = function(graphics) -{ - if(graphics.tint === 0xFFFFFF)return; - - var tintR = (graphics.tint >> 16 & 0xFF) / 255; - var tintG = (graphics.tint >> 8 & 0xFF) / 255; - var tintB = (graphics.tint & 0xFF)/ 255; - - for (var i = 0; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - - var fillColor = data.fillColor | 0; - var lineColor = data.lineColor | 0; - - /* - var colorR = (fillColor >> 16 & 0xFF) / 255; - var colorG = (fillColor >> 8 & 0xFF) / 255; - var colorB = (fillColor & 0xFF) / 255; - - colorR *= tintR; - colorG *= tintG; - colorB *= tintB; - - fillColor = ((colorR*255 << 16) + (colorG*255 << 8) + colorB*255); - - colorR = (lineColor >> 16 & 0xFF) / 255; - colorG = (lineColor >> 8 & 0xFF) / 255; - colorB = (lineColor & 0xFF) / 255; - - colorR *= tintR; - colorG *= tintG; - colorB *= tintB; - - lineColor = ((colorR*255 << 16) + (colorG*255 << 8) + colorB*255); - */ - - // super inline cos im an optimization NAZI :) - data._fillTint = (((fillColor >> 16 & 0xFF) / 255 * tintR*255 << 16) + ((fillColor >> 8 & 0xFF) / 255 * tintG*255 << 8) + (fillColor & 0xFF) / 255 * tintB*255); - data._lineTint = (((lineColor >> 16 & 0xFF) / 255 * tintR*255 << 16) + ((lineColor >> 8 & 0xFF) / 255 * tintG*255 << 8) + (lineColor & 0xFF) / 255 * tintB*255); - - } -}; - - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and color and fill them. - * - * @class Graphics - * @extends DisplayObjectContainer - * @constructor - */ -PIXI.Graphics = function() -{ - PIXI.DisplayObjectContainer.call( this ); - - this.renderable = true; - - /** - * The alpha value used when filling the Graphics object. - * - * @property fillAlpha - * @type Number - */ - this.fillAlpha = 1; - - /** - * The width (thickness) of any lines drawn. - * - * @property lineWidth - * @type Number - */ - this.lineWidth = 0; - - /** - * The color of any lines drawn. - * - * @property lineColor - * @type String - * @default 0 - */ - this.lineColor = 0; - - /** - * Graphics data - * - * @property graphicsData - * @type Array - * @private - */ - this.graphicsData = []; - - /** - * The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint. - * - * @property tint - * @type Number - * @default 0xFFFFFF - */ - this.tint = 0xFFFFFF; - - /** - * The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode. - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - /** - * Current path - * - * @property currentPath - * @type Object - * @private - */ - this.currentPath = null; - - /** - * Array containing some WebGL-related properties used by the WebGL renderer. - * - * @property _webGL - * @type Array - * @private - */ - this._webGL = []; - - /** - * Whether this shape is being used as a mask. - * - * @property isMask - * @type Boolean - */ - this.isMask = false; - - /** - * The bounds' padding used for bounds calculation. - * - * @property boundsPadding - * @type Number - */ - this.boundsPadding = 0; - - this._localBounds = new PIXI.Rectangle(0,0,1,1); - - /** - * Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated. - * - * @property dirty - * @type Boolean - * @private - */ - this.dirty = true; - - /** - * Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated. - * - * @property webGLDirty - * @type Boolean - * @private - */ - this.webGLDirty = false; - - /** - * Used to detect if the cached sprite object needs to be updated. - * - * @property cachedSpriteDirty - * @type Boolean - * @private - */ - this.cachedSpriteDirty = false; - -}; - -// constructor -PIXI.Graphics.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); -PIXI.Graphics.prototype.constructor = PIXI.Graphics; - -/** - * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. - * This is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory. - * It is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas. - * This is not recommended if you are constantly redrawing the graphics element. - * - * @property cacheAsBitmap - * @type Boolean - * @default false - * @private - */ -Object.defineProperty(PIXI.Graphics.prototype, "cacheAsBitmap", { - get: function() { - return this._cacheAsBitmap; - }, - set: function(value) { - this._cacheAsBitmap = value; - - if(this._cacheAsBitmap) - { - - this._generateCachedSprite(); - } - else - { - this.destroyCachedSprite(); - this.dirty = true; - } - - } -}); - -/** - * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method. - * - * @method lineStyle - * @param lineWidth {Number} width of the line to draw, will update the objects stored style - * @param color {Number} color of the line to draw, will update the objects stored style - * @param alpha {Number} alpha of the line to draw, will update the objects stored style - * @return {Graphics} - */ -PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha) -{ - this.lineWidth = lineWidth || 0; - this.lineColor = color || 0; - this.lineAlpha = (arguments.length < 3) ? 1 : alpha; - - if(this.currentPath) - { - if(this.currentPath.shape.points.length) - { - // halfway through a line? start a new one! - this.drawShape( new PIXI.Polygon( this.currentPath.shape.points.slice(-2) )); - return this; - } - - // otherwise its empty so lets just set the line properties - this.currentPath.lineWidth = this.lineWidth; - this.currentPath.lineColor = this.lineColor; - this.currentPath.lineAlpha = this.lineAlpha; - - } - - return this; -}; - -/** - * Moves the current drawing position to x, y. - * - * @method moveTo - * @param x {Number} the X coordinate to move to - * @param y {Number} the Y coordinate to move to - * @return {Graphics} - */ -PIXI.Graphics.prototype.moveTo = function(x, y) -{ - this.drawShape(new PIXI.Polygon([x,y])); - - return this; -}; - -/** - * Draws a line using the current line style from the current drawing position to (x, y); - * The current drawing position is then set to (x, y). - * - * @method lineTo - * @param x {Number} the X coordinate to draw to - * @param y {Number} the Y coordinate to draw to - * @return {Graphics} - */ -PIXI.Graphics.prototype.lineTo = function(x, y) -{ - this.currentPath.shape.points.push(x, y); - this.dirty = true; - - return this; -}; - -/** - * Calculate the points for a quadratic bezier curve and then draws it. - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c - * - * @method quadraticCurveTo - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Graphics} - */ -PIXI.Graphics.prototype.quadraticCurveTo = function(cpX, cpY, toX, toY) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0]; - } - else - { - this.moveTo(0,0); - } - - var xa, - ya, - n = 20, - points = this.currentPath.shape.points; - if(points.length === 0)this.moveTo(0, 0); - - - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - - var j = 0; - for (var i = 1; i <= n; i++ ) - { - j = i / n; - - xa = fromX + ( (cpX - fromX) * j ); - ya = fromY + ( (cpY - fromY) * j ); - - points.push( xa + ( ((cpX + ( (toX - cpX) * j )) - xa) * j ), - ya + ( ((cpY + ( (toY - cpY) * j )) - ya) * j ) ); - } - - - this.dirty = true; - - return this; -}; - -/** - * Calculate the points for a bezier curve and then draws it. - * - * @method bezierCurveTo - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param cpX2 {Number} Second Control point x - * @param cpY2 {Number} Second Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Graphics} - */ -PIXI.Graphics.prototype.bezierCurveTo = function(cpX, cpY, cpX2, cpY2, toX, toY) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0]; - } - else - { - this.moveTo(0,0); - } - - var n = 20, - dt, - dt2, - dt3, - t2, - t3, - points = this.currentPath.shape.points; - - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - - var j = 0; - - for (var i=1; i<=n; i++) - { - j = i / n; - - dt = (1 - j); - dt2 = dt * dt; - dt3 = dt2 * dt; - - t2 = j * j; - t3 = t2 * j; - - points.push( dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX, - dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY); - } - - this.dirty = true; - - return this; -}; - -/* - * The arcTo() method creates an arc/curve between two tangents on the canvas. - * - * "borrowed" from https://code.google.com/p/fxcanvas/ - thanks google! - * - * @method arcTo - * @param x1 {Number} The x-coordinate of the beginning of the arc - * @param y1 {Number} The y-coordinate of the beginning of the arc - * @param x2 {Number} The x-coordinate of the end of the arc - * @param y2 {Number} The y-coordinate of the end of the arc - * @param radius {Number} The radius of the arc - * @return {Graphics} - */ -PIXI.Graphics.prototype.arcTo = function(x1, y1, x2, y2, radius) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0) - { - this.currentPath.shape.points.push(x1, y1); - } - } - else - { - this.moveTo(x1, y1); - } - - var points = this.currentPath.shape.points; - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - var a1 = fromY - y1; - var b1 = fromX - x1; - var a2 = y2 - y1; - var b2 = x2 - x1; - var mm = Math.abs(a1 * b2 - b1 * a2); - - - if (mm < 1.0e-8 || radius === 0) - { - if( points[points.length-2] !== x1 || points[points.length-1] !== y1) - { - //console.log(">>") - points.push(x1, y1); - } - } - else - { - var dd = a1 * a1 + b1 * b1; - var cc = a2 * a2 + b2 * b2; - var tt = a1 * a2 + b1 * b2; - var k1 = radius * Math.sqrt(dd) / mm; - var k2 = radius * Math.sqrt(cc) / mm; - var j1 = k1 * tt / dd; - var j2 = k2 * tt / cc; - var cx = k1 * b2 + k2 * b1; - var cy = k1 * a2 + k2 * a1; - var px = b1 * (k2 + j1); - var py = a1 * (k2 + j1); - var qx = b2 * (k1 + j2); - var qy = a2 * (k1 + j2); - var startAngle = Math.atan2(py - cy, px - cx); - var endAngle = Math.atan2(qy - cy, qx - cx); - - this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1); - } - - this.dirty = true; - - return this; -}; - -/** - * The arc method creates an arc/curve (used to create circles, or parts of circles). - * - * @method arc - * @param cx {Number} The x-coordinate of the center of the circle - * @param cy {Number} The y-coordinate of the center of the circle - * @param radius {Number} The radius of the circle - * @param startAngle {Number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) - * @param endAngle {Number} The ending angle, in radians - * @param anticlockwise {Boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {Graphics} - */ -PIXI.Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) -{ - var startX = cx + Math.cos(startAngle) * radius; - var startY = cy + Math.sin(startAngle) * radius; - var points; - - if( this.currentPath ) - { - points = this.currentPath.shape.points; - - if(points.length === 0) - { - points.push(startX, startY); - } - else if( points[points.length-2] !== startX || points[points.length-1] !== startY) - { - points.push(startX, startY); - } - } - else - { - this.moveTo(startX, startY); - points = this.currentPath.shape.points; - } - - if (startAngle === endAngle)return this; - - if( !anticlockwise && endAngle <= startAngle ) - { - endAngle += Math.PI * 2; - } - else if( anticlockwise && startAngle <= endAngle ) - { - startAngle += Math.PI * 2; - } - - var sweep = anticlockwise ? (startAngle - endAngle) *-1 : (endAngle - startAngle); - var segs = ( Math.abs(sweep)/ (Math.PI * 2) ) * 40; - - if( sweep === 0 ) return this; - - var theta = sweep/(segs*2); - var theta2 = theta*2; - - var cTheta = Math.cos(theta); - var sTheta = Math.sin(theta); - - var segMinus = segs - 1; - - var remainder = ( segMinus % 1 ) / segMinus; - - for(var i=0; i<=segMinus; i++) - { - var real = i + remainder * i; - - - var angle = ((theta) + startAngle + (theta2 * real)); - - var c = Math.cos(angle); - var s = -Math.sin(angle); - - points.push(( (cTheta * c) + (sTheta * s) ) * radius + cx, - ( (cTheta * -s) + (sTheta * c) ) * radius + cy); - } - - this.dirty = true; - - return this; -}; - -/** - * Specifies a simple one-color fill that subsequent calls to other Graphics methods - * (such as lineTo() or drawCircle()) use when drawing. - * - * @method beginFill - * @param color {Number} the color of the fill - * @param alpha {Number} the alpha of the fill - * @return {Graphics} - */ -PIXI.Graphics.prototype.beginFill = function(color, alpha) -{ - this.filling = true; - this.fillColor = color || 0; - this.fillAlpha = (alpha === undefined) ? 1 : alpha; - - if(this.currentPath) - { - if(this.currentPath.shape.points.length <= 2) - { - this.currentPath.fill = this.filling; - this.currentPath.fillColor = this.fillColor; - this.currentPath.fillAlpha = this.fillAlpha; - } - } - return this; -}; - -/** - * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. - * - * @method endFill - * @return {Graphics} - */ -PIXI.Graphics.prototype.endFill = function() -{ - this.filling = false; - this.fillColor = null; - this.fillAlpha = 1; - - return this; -}; - -/** - * Draws a rectangle. - * - * @method drawRect - * - * @param x {Number} The X coord of the top-left of the rectangle - * @param y {Number} The Y coord of the top-left of the rectangle - * @param width {Number} The width of the rectangle - * @param height {Number} The height of the rectangle - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawRect = function( x, y, width, height ) -{ - this.drawShape(new PIXI.Rectangle(x,y, width, height)); - - return this; -}; - -/** - * Draws a rounded rectangle. - * - * @method drawRoundedRect - * - * @param x {Number} The X coord of the top-left of the rectangle - * @param y {Number} The Y coord of the top-left of the rectangle - * @param width {Number} The width of the rectangle - * @param height {Number} The height of the rectangle - * @param radius {Number} Radius of the rectangle corners - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawRoundedRect = function( x, y, width, height, radius ) -{ - this.drawShape(new PIXI.RoundedRectangle(x, y, width, height, radius)); - - return this; -}; - -/** - * Draws a circle. - * - * @method drawCircle - * @param x {Number} The X coordinate of the center of the circle - * @param y {Number} The Y coordinate of the center of the circle - * @param radius {Number} The radius of the circle - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawCircle = function(x, y, radius) -{ - this.drawShape(new PIXI.Circle(x,y, radius)); - - return this; -}; - -/** - * Draws an ellipse. - * - * @method drawEllipse - * @param x {Number} The X coordinate of the center of the ellipse - * @param y {Number} The Y coordinate of the center of the ellipse - * @param width {Number} The half width of the ellipse - * @param height {Number} The half height of the ellipse - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawEllipse = function(x, y, width, height) -{ - this.drawShape(new PIXI.Ellipse(x, y, width, height)); - - return this; -}; - -/** - * Draws a polygon using the given path. - * - * @method drawPolygon - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawPolygon = function(path) -{ - if(!(path instanceof Array))path = Array.prototype.slice.call(arguments); - this.drawShape(new PIXI.Polygon(path)); - return this; -}; - -/** - * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. - * - * @method clear - * @return {Graphics} - */ -PIXI.Graphics.prototype.clear = function() -{ - this.lineWidth = 0; - this.filling = false; - - this.dirty = true; - this.clearDirty = true; - this.graphicsData = []; - - return this; -}; - -/** - * Useful function that returns a texture of the graphics object that can then be used to create sprites - * This can be quite useful if your geometry is complicated and needs to be reused multiple times. - * - * @method generateTexture - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts - * @return {Texture} a texture of the graphics object - */ -PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode) -{ - resolution = resolution || 1; - - var bounds = this.getBounds(); - - var canvasBuffer = new PIXI.CanvasBuffer(bounds.width * resolution, bounds.height * resolution); - - var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas, scaleMode); - texture.baseTexture.resolution = resolution; - - canvasBuffer.context.scale(resolution, resolution); - - canvasBuffer.context.translate(-bounds.x,-bounds.y); - - PIXI.CanvasGraphics.renderGraphics(this, canvasBuffer.context); - - return texture; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Graphics.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(this.visible === false || this.alpha === 0 || this.isMask === true)return; - - if(this._cacheAsBitmap) - { - - if(this.dirty || this.cachedSpriteDirty) - { - - this._generateCachedSprite(); - - // we will also need to update the texture on the gpu too! - this.updateCachedSpriteTexture(); - - this.cachedSpriteDirty = false; - this.dirty = false; - } - - this._cachedSprite.worldAlpha = this.worldAlpha; - PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession); - - return; - } - else - { - renderSession.spriteBatch.stop(); - renderSession.blendModeManager.setBlendMode(this.blendMode); - - if(this._mask)renderSession.maskManager.pushMask(this._mask, renderSession); - if(this._filters)renderSession.filterManager.pushFilter(this._filterBlock); - - // check blend mode - if(this.blendMode !== renderSession.spriteBatch.currentBlendMode) - { - renderSession.spriteBatch.currentBlendMode = this.blendMode; - var blendModeWebGL = PIXI.blendModesWebGL[renderSession.spriteBatch.currentBlendMode]; - renderSession.spriteBatch.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); - } - - // check if the webgl graphic needs to be updated - if(this.webGLDirty) - { - this.dirty = true; - this.webGLDirty = false; - } - - PIXI.WebGLGraphics.renderGraphics(this, renderSession); - - // only render if it has children! - if(this.children.length) - { - renderSession.spriteBatch.start(); - - // simple render children! - for(var i=0, j=this.children.length; i maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - - this._bounds.x = minX; - this._bounds.width = maxX - minX; - - this._bounds.y = minY; - this._bounds.height = maxY - minY; - - return this._bounds; -}; - -/** - * Update the bounds of the object - * - * @method updateLocalBounds - */ -PIXI.Graphics.prototype.updateLocalBounds = function() -{ - var minX = Infinity; - var maxX = -Infinity; - - var minY = Infinity; - var maxY = -Infinity; - - if(this.graphicsData.length) - { - var shape, points, x, y, w, h; - - for (var i = 0; i < this.graphicsData.length; i++) { - var data = this.graphicsData[i]; - var type = data.type; - var lineWidth = data.lineWidth; - shape = data.shape; - - - if(type === PIXI.Graphics.RECT || type === PIXI.Graphics.RREC) - { - x = shape.x - lineWidth/2; - y = shape.y - lineWidth/2; - w = shape.width + lineWidth; - h = shape.height + lineWidth; - - minX = x < minX ? x : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y < minY ? y : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else if(type === PIXI.Graphics.CIRC) - { - x = shape.x; - y = shape.y; - w = shape.radius + lineWidth/2; - h = shape.radius + lineWidth/2; - - minX = x - w < minX ? x - w : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y - h < minY ? y - h : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else if(type === PIXI.Graphics.ELIP) - { - x = shape.x; - y = shape.y; - w = shape.width + lineWidth/2; - h = shape.height + lineWidth/2; - - minX = x - w < minX ? x - w : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y - h < minY ? y - h : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else - { - // POLY - points = shape.points; - - for (var j = 0; j < points.length; j+=2) - { - - x = points[j]; - y = points[j+1]; - minX = x-lineWidth < minX ? x-lineWidth : minX; - maxX = x+lineWidth > maxX ? x+lineWidth : maxX; - - minY = y-lineWidth < minY ? y-lineWidth : minY; - maxY = y+lineWidth > maxY ? y+lineWidth : maxY; - } - } - } - } - else - { - minX = 0; - maxX = 0; - minY = 0; - maxY = 0; - } - - var padding = this.boundsPadding; - - this._localBounds.x = minX - padding; - this._localBounds.width = (maxX - minX) + padding * 2; - - this._localBounds.y = minY - padding; - this._localBounds.height = (maxY - minY) + padding * 2; -}; - -/** - * Generates the cached sprite when the sprite has cacheAsBitmap = true - * - * @method _generateCachedSprite - * @private - */ -PIXI.Graphics.prototype._generateCachedSprite = function() -{ - var bounds = this.getLocalBounds(); - - if(!this._cachedSprite) - { - var canvasBuffer = new PIXI.CanvasBuffer(bounds.width, bounds.height); - var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); - - this._cachedSprite = new PIXI.Sprite(texture); - this._cachedSprite.buffer = canvasBuffer; - - this._cachedSprite.worldTransform = this.worldTransform; - } - else - { - this._cachedSprite.buffer.resize(bounds.width, bounds.height); - } - - // leverage the anchor to account for the offset of the element - this._cachedSprite.anchor.x = -( bounds.x / bounds.width ); - this._cachedSprite.anchor.y = -( bounds.y / bounds.height ); - - // this._cachedSprite.buffer.context.save(); - this._cachedSprite.buffer.context.translate(-bounds.x,-bounds.y); - - // make sure we set the alpha of the graphics to 1 for the render.. - this.worldAlpha = 1; - - // now render the graphic.. - PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context); - this._cachedSprite.alpha = this.alpha; -}; - -/** - * Updates texture size based on canvas size - * - * @method updateCachedSpriteTexture - * @private - */ -PIXI.Graphics.prototype.updateCachedSpriteTexture = function() -{ - var cachedSprite = this._cachedSprite; - var texture = cachedSprite.texture; - var canvas = cachedSprite.buffer.canvas; - - texture.baseTexture.width = canvas.width; - texture.baseTexture.height = canvas.height; - texture.crop.width = texture.frame.width = canvas.width; - texture.crop.height = texture.frame.height = canvas.height; - - cachedSprite._width = canvas.width; - cachedSprite._height = canvas.height; - - // update the dirty base textures - texture.baseTexture.dirty(); -}; - -/** - * Destroys a previous cached sprite. - * - * @method destroyCachedSprite - */ -PIXI.Graphics.prototype.destroyCachedSprite = function() -{ - this._cachedSprite.texture.destroy(true); - - // let the gc collect the unused sprite - // TODO could be object pooled! - this._cachedSprite = null; -}; - -/** - * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. - * - * @method drawShape - * @param {Circle|Rectangle|Ellipse|Line|Polygon} shape The Shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. - */ -PIXI.Graphics.prototype.drawShape = function(shape) -{ - if(this.currentPath) - { - // check current path! - if(this.currentPath.shape.points.length <= 2)this.graphicsData.pop(); - } - - this.currentPath = null; - - var data = new PIXI.GraphicsData(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, shape); - - this.graphicsData.push(data); - - if(data.type === PIXI.Graphics.POLY) - { - data.shape.closed = this.filling; - this.currentPath = data; - } - - this.dirty = true; - - return data; -}; - -/** - * A GraphicsData object. - * - * @class GraphicsData - * @constructor - */ -PIXI.GraphicsData = function(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, shape) -{ - this.lineWidth = lineWidth; - this.lineColor = lineColor; - this.lineAlpha = lineAlpha; - this._lineTint = lineColor; - - this.fillColor = fillColor; - this.fillAlpha = fillAlpha; - this._fillTint = fillColor; - this.fill = fill; - - this.shape = shape; - this.type = shape.type; -}; - -// SOME TYPES: -PIXI.Graphics.POLY = 0; -PIXI.Graphics.RECT = 1; -PIXI.Graphics.CIRC = 2; -PIXI.Graphics.ELIP = 3; -PIXI.Graphics.RREC = 4; - -PIXI.Polygon.prototype.type = PIXI.Graphics.POLY; -PIXI.Rectangle.prototype.type = PIXI.Graphics.RECT; -PIXI.Circle.prototype.type = PIXI.Graphics.CIRC; -PIXI.Ellipse.prototype.type = PIXI.Graphics.ELIP; -PIXI.RoundedRectangle.prototype.type = PIXI.Graphics.RREC; - - -/** - * @author Mat Groves http://matgroves.com/ - */ - - /** - * - * @class Strip - * @extends DisplayObjectContainer - * @constructor - * @param texture {Texture} The texture to use - * @param width {Number} the width - * @param height {Number} the height - * - */ -PIXI.Strip = function(texture) -{ - PIXI.DisplayObjectContainer.call( this ); - - - /** - * The texture of the strip - * - * @property texture - * @type Texture - */ - this.texture = texture; - - // set up the main bits.. - this.uvs = new PIXI.Float32Array([0, 1, - 1, 1, - 1, 0, - 0, 1]); - - this.vertices = new PIXI.Float32Array([0, 0, - 100, 0, - 100, 100, - 0, 100]); - - this.colors = new PIXI.Float32Array([1, 1, 1, 1]); - - this.indices = new PIXI.Uint16Array([0, 1, 2, 3]); - - /** - * Whether the strip is dirty or not - * - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode. - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - /** - * Triangles in canvas mode are automatically antialiased, use this value to force triangles to overlap a bit with each other. - * - * @property canvasPadding - * @type Number - */ - this.canvasPadding = 0; - - this.drawMode = PIXI.Strip.DrawModes.TRIANGLE_STRIP; - -}; - -// constructor -PIXI.Strip.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); -PIXI.Strip.prototype.constructor = PIXI.Strip; - -PIXI.Strip.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(!this.visible || this.alpha <= 0)return; - // render triangle strip.. - - renderSession.spriteBatch.stop(); - - // init! init! - if(!this._vertexBuffer)this._initWebGL(renderSession); - - renderSession.shaderManager.setShader(renderSession.shaderManager.stripShader); - - this._renderStrip(renderSession); - - ///renderSession.shaderManager.activateDefaultShader(); - - renderSession.spriteBatch.start(); - - //TODO check culling -}; - -PIXI.Strip.prototype._initWebGL = function(renderSession) -{ - // build the strip! - var gl = renderSession.gl; - - this._vertexBuffer = gl.createBuffer(); - this._indexBuffer = gl.createBuffer(); - this._uvBuffer = gl.createBuffer(); - this._colorBuffer = gl.createBuffer(); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvs, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._colorBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.colors, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); -}; - -PIXI.Strip.prototype._renderStrip = function(renderSession) -{ - var gl = renderSession.gl; - var projection = renderSession.projection, - offset = renderSession.offset, - shader = renderSession.shaderManager.stripShader; - - var drawMode = this.drawMode === PIXI.Strip.DrawModes.TRIANGLE_STRIP ? gl.TRIANGLE_STRIP : gl.TRIANGLES; - - // gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mat4Real); - - renderSession.blendModeManager.setBlendMode(this.blendMode); - - - // set uniforms - gl.uniformMatrix3fv(shader.translationMatrix, false, this.worldTransform.toArray(true)); - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - gl.uniform1f(shader.alpha, this.worldAlpha); - - if(!this.dirty) - { - - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - // update the uvs - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.activeTexture(gl.TEXTURE0); - - // check if a texture is dirty.. - if(this.texture.baseTexture._dirty[gl.id]) - { - renderSession.renderer.updateTexture(this.texture.baseTexture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]); - } - - // dont need to upload! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - - - } - else - { - - this.dirty = false; - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.STATIC_DRAW); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - // update the uvs - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvs, gl.STATIC_DRAW); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.activeTexture(gl.TEXTURE0); - - // check if a texture is dirty.. - if(this.texture.baseTexture._dirty[gl.id]) - { - renderSession.renderer.updateTexture(this.texture.baseTexture); - } - else - { - gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]); - } - - // dont need to upload! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - } - //console.log(gl.TRIANGLE_STRIP) - // - // - gl.drawElements(drawMode, this.indices.length, gl.UNSIGNED_SHORT, 0); - - -}; - - - -PIXI.Strip.prototype._renderCanvas = function(renderSession) -{ - var context = renderSession.context; - - var transform = this.worldTransform; - - if (renderSession.roundPixels) - { - context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx | 0, transform.ty | 0); - } - else - { - context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty); - } - - if (this.drawMode === PIXI.Strip.DrawModes.TRIANGLE_STRIP) - { - this._renderCanvasTriangleStrip(context); - } - else - { - this._renderCanvasTriangles(context); - } -}; - -PIXI.Strip.prototype._renderCanvasTriangleStrip = function(context) -{ - // draw triangles!! - var vertices = this.vertices; - var uvs = this.uvs; - - var length = vertices.length / 2; - this.count++; - - for (var i = 0; i < length - 2; i++) { - // draw some triangles! - var index = i * 2; - this._renderCanvasDrawTriangle(context, vertices, uvs, index, (index + 2), (index + 4)); - } -}; - -PIXI.Strip.prototype._renderCanvasTriangles = function(context) -{ - // draw triangles!! - var vertices = this.vertices; - var uvs = this.uvs; - var indices = this.indices; - - var length = indices.length; - this.count++; - - for (var i = 0; i < length; i += 3) { - // draw some triangles! - var index0 = indices[i] * 2, index1 = indices[i + 1] * 2, index2 = indices[i + 2] * 2; - this._renderCanvasDrawTriangle(context, vertices, uvs, index0, index1, index2); - } -}; - -PIXI.Strip.prototype._renderCanvasDrawTriangle = function(context, vertices, uvs, index0, index1, index2) -{ - var textureSource = this.texture.baseTexture.source; - var textureWidth = this.texture.width; - var textureHeight = this.texture.height; - - var x0 = vertices[index0], x1 = vertices[index1], x2 = vertices[index2]; - var y0 = vertices[index0 + 1], y1 = vertices[index1 + 1], y2 = vertices[index2 + 1]; - - var u0 = uvs[index0] * textureWidth, u1 = uvs[index1] * textureWidth, u2 = uvs[index2] * textureWidth; - var v0 = uvs[index0 + 1] * textureHeight, v1 = uvs[index1 + 1] * textureHeight, v2 = uvs[index2 + 1] * textureHeight; - - if (this.canvasPadding > 0) { - var paddingX = this.canvasPadding / this.worldTransform.a; - var paddingY = this.canvasPadding / this.worldTransform.d; - var centerX = (x0 + x1 + x2) / 3; - var centerY = (y0 + y1 + y2) / 3; - - var normX = x0 - centerX; - var normY = y0 - centerY; - - var dist = Math.sqrt(normX * normX + normY * normY); - x0 = centerX + (normX / dist) * (dist + paddingX); - y0 = centerY + (normY / dist) * (dist + paddingY); - - // - - normX = x1 - centerX; - normY = y1 - centerY; - - dist = Math.sqrt(normX * normX + normY * normY); - x1 = centerX + (normX / dist) * (dist + paddingX); - y1 = centerY + (normY / dist) * (dist + paddingY); - - normX = x2 - centerX; - normY = y2 - centerY; - - dist = Math.sqrt(normX * normX + normY * normY); - x2 = centerX + (normX / dist) * (dist + paddingX); - y2 = centerY + (normY / dist) * (dist + paddingY); - } - - context.save(); - context.beginPath(); - - - context.moveTo(x0, y0); - context.lineTo(x1, y1); - context.lineTo(x2, y2); - - context.closePath(); - - context.clip(); - - // Compute matrix transform - var delta = (u0 * v1) + (v0 * u2) + (u1 * v2) - (v1 * u2) - (v0 * u1) - (u0 * v2); - var deltaA = (x0 * v1) + (v0 * x2) + (x1 * v2) - (v1 * x2) - (v0 * x1) - (x0 * v2); - var deltaB = (u0 * x1) + (x0 * u2) + (u1 * x2) - (x1 * u2) - (x0 * u1) - (u0 * x2); - var deltaC = (u0 * v1 * x2) + (v0 * x1 * u2) + (x0 * u1 * v2) - (x0 * v1 * u2) - (v0 * u1 * x2) - (u0 * x1 * v2); - var deltaD = (y0 * v1) + (v0 * y2) + (y1 * v2) - (v1 * y2) - (v0 * y1) - (y0 * v2); - var deltaE = (u0 * y1) + (y0 * u2) + (u1 * y2) - (y1 * u2) - (y0 * u1) - (u0 * y2); - var deltaF = (u0 * v1 * y2) + (v0 * y1 * u2) + (y0 * u1 * v2) - (y0 * v1 * u2) - (v0 * u1 * y2) - (u0 * y1 * v2); - - context.transform(deltaA / delta, deltaD / delta, - deltaB / delta, deltaE / delta, - deltaC / delta, deltaF / delta); - - context.drawImage(textureSource, 0, 0); - context.restore(); -}; - - - -/** - * Renders a flat strip - * - * @method renderStripFlat - * @param strip {Strip} The Strip to render - * @private - */ -PIXI.Strip.prototype.renderStripFlat = function(strip) -{ - var context = this.context; - var vertices = strip.vertices; - - var length = vertices.length/2; - this.count++; - - context.beginPath(); - for (var i=1; i < length-2; i++) - { - // draw some triangles! - var index = i*2; - - var x0 = vertices[index], x1 = vertices[index+2], x2 = vertices[index+4]; - var y0 = vertices[index+1], y1 = vertices[index+3], y2 = vertices[index+5]; - - context.moveTo(x0, y0); - context.lineTo(x1, y1); - context.lineTo(x2, y2); - } - - context.fillStyle = '#FF0000'; - context.fill(); - context.closePath(); -}; - -/* -PIXI.Strip.prototype.setTexture = function(texture) -{ - //TODO SET THE TEXTURES - //TODO VISIBILITY - - // stop current texture - this.texture = texture; - this.width = texture.frame.width; - this.height = texture.frame.height; - this.updateFrame = true; -}; -*/ - -/** - * When the texture is updated, this event will fire to update the scale and frame - * - * @method onTextureUpdate - * @param event - * @private - */ - -PIXI.Strip.prototype.onTextureUpdate = function() -{ - this.updateFrame = true; -}; - -/** - * Returns the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account. - * - * @method getBounds - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle - */ -PIXI.Strip.prototype.getBounds = function(matrix) -{ - var worldTransform = matrix || this.worldTransform; - - var a = worldTransform.a; - var b = worldTransform.b; - var c = worldTransform.c; - var d = worldTransform.d; - var tx = worldTransform.tx; - var ty = worldTransform.ty; - - var maxX = -Infinity; - var maxY = -Infinity; - - var minX = Infinity; - var minY = Infinity; - - var vertices = this.vertices; - for (var i = 0, n = vertices.length; i < n; i += 2) - { - var rawX = vertices[i], rawY = vertices[i + 1]; - var x = (a * rawX) + (c * rawY) + tx; - var y = (d * rawY) + (b * rawX) + ty; - - minX = x < minX ? x : minX; - minY = y < minY ? y : minY; - - maxX = x > maxX ? x : maxX; - maxY = y > maxY ? y : maxY; - } - - if (minX === -Infinity || maxY === Infinity) - { - return PIXI.EmptyRectangle; - } - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - -/** - * Different drawing buffer modes supported - * - * @property - * @type {{TRIANGLE_STRIP: number, TRIANGLES: number}} - * @static - */ -PIXI.Strip.DrawModes = { - TRIANGLE_STRIP: 0, - TRIANGLES: 1 -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * @copyright Mat Groves, Rovanion Luckey - */ - -/** - * - * @class Rope - * @constructor - * @extends Strip - * @param {Texture} texture - The texture to use on the rope. - * @param {Array} points - An array of {PIXI.Point}. - * - */ -PIXI.Rope = function(texture, points) -{ - PIXI.Strip.call( this, texture ); - this.points = points; - - this.vertices = new PIXI.Float32Array(points.length * 4); - this.uvs = new PIXI.Float32Array(points.length * 4); - this.colors = new PIXI.Float32Array(points.length * 2); - this.indices = new PIXI.Uint16Array(points.length * 2); - - - this.refresh(); -}; - - -// constructor -PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype ); -PIXI.Rope.prototype.constructor = PIXI.Rope; - -/* - * Refreshes - * - * @method refresh - */ -PIXI.Rope.prototype.refresh = function() -{ - var points = this.points; - if(points.length < 1) return; - - var uvs = this.uvs; - - var lastPoint = points[0]; - var indices = this.indices; - var colors = this.colors; - - this.count-=0.2; - - uvs[0] = 0; - uvs[1] = 0; - uvs[2] = 0; - uvs[3] = 1; - - colors[0] = 1; - colors[1] = 1; - - indices[0] = 0; - indices[1] = 1; - - var total = points.length, - point, index, amount; - - for (var i = 1; i < total; i++) - { - point = points[i]; - index = i * 4; - // time to do some smart drawing! - amount = i / (total-1); - - if(i%2) - { - uvs[index] = amount; - uvs[index+1] = 0; - - uvs[index+2] = amount; - uvs[index+3] = 1; - } - else - { - uvs[index] = amount; - uvs[index+1] = 0; - - uvs[index+2] = amount; - uvs[index+3] = 1; - } - - index = i * 2; - colors[index] = 1; - colors[index+1] = 1; - - index = i * 2; - indices[index] = index; - indices[index + 1] = index + 1; - - lastPoint = point; - } -}; - -/* - * Updates the object transform for rendering - * - * @method updateTransform - * @private - */ -PIXI.Rope.prototype.updateTransform = function() -{ - - var points = this.points; - if(points.length < 1)return; - - var lastPoint = points[0]; - var nextPoint; - var perp = {x:0, y:0}; - - this.count-=0.2; - - var vertices = this.vertices; - var total = points.length, - point, index, ratio, perpLength, num; - - for (var i = 0; i < total; i++) - { - point = points[i]; - index = i * 4; - - if(i < points.length-1) - { - nextPoint = points[i+1]; - } - else - { - nextPoint = point; - } - - perp.y = -(nextPoint.x - lastPoint.x); - perp.x = nextPoint.y - lastPoint.y; - - ratio = (1 - (i / (total-1))) * 10; - - if(ratio > 1) ratio = 1; - - perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y); - num = this.texture.height / 2; //(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio; - perp.x /= perpLength; - perp.y /= perpLength; - - perp.x *= num; - perp.y *= num; - - vertices[index] = point.x + perp.x; - vertices[index+1] = point.y + perp.y; - vertices[index+2] = point.x - perp.x; - vertices[index+3] = point.y - perp.y; - - lastPoint = point; - } - - PIXI.DisplayObjectContainer.prototype.updateTransform.call( this ); -}; -/* - * Sets the texture that the Rope will use - * - * @method setTexture - * @param texture {Texture} the texture that will be used - */ -PIXI.Rope.prototype.setTexture = function(texture) -{ - // stop current texture - this.texture = texture; - //this.updateFrame = true; -}; - -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * A tiling sprite is a fast way of rendering a tiling image - * - * @class TilingSprite - * @extends Sprite - * @constructor - * @param texture {Texture} the texture of the tiling sprite - * @param width {Number} the width of the tiling sprite - * @param height {Number} the height of the tiling sprite - */ -PIXI.TilingSprite = function(texture, width, height) -{ - PIXI.Sprite.call( this, texture); - - /** - * The with of the tiling sprite - * - * @property width - * @type Number - */ - this._width = width || 100; - - /** - * The height of the tiling sprite - * - * @property height - * @type Number - */ - this._height = height || 100; - - /** - * The scaling of the image that is being tiled - * - * @property tileScale - * @type Point - */ - this.tileScale = new PIXI.Point(1,1); - - /** - * A point that represents the scale of the texture object - * - * @property tileScaleOffset - * @type Point - */ - this.tileScaleOffset = new PIXI.Point(1,1); - - /** - * The offset position of the image that is being tiled - * - * @property tilePosition - * @type Point - */ - this.tilePosition = new PIXI.Point(0,0); - - /** - * Whether this sprite is renderable or not - * - * @property renderable - * @type Boolean - * @default true - */ - this.renderable = true; - - /** - * The tint applied to the sprite. This is a hex value - * - * @property tint - * @type Number - * @default 0xFFFFFF - */ - this.tint = 0xFFFFFF; - - /** - * The blend mode to be applied to the sprite - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - - -}; - -// constructor -PIXI.TilingSprite.prototype = Object.create(PIXI.Sprite.prototype); -PIXI.TilingSprite.prototype.constructor = PIXI.TilingSprite; - - -/** - * The width of the sprite, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.TilingSprite.prototype, 'width', { - get: function() { - return this._width; - }, - set: function(value) { - - this._width = value; - } -}); - -/** - * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.TilingSprite.prototype, 'height', { - get: function() { - return this._height; - }, - set: function(value) { - this._height = value; - } -}); - -PIXI.TilingSprite.prototype.setTexture = function(texture) -{ - if (this.texture === texture) return; - - this.texture = texture; - - this.refreshTexture = true; - - this.cachedTint = 0xFFFFFF; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.TilingSprite.prototype._renderWebGL = function(renderSession) -{ - if (this.visible === false || this.alpha === 0) return; - var i,j; - - if (this._mask) - { - renderSession.spriteBatch.stop(); - renderSession.maskManager.pushMask(this.mask, renderSession); - renderSession.spriteBatch.start(); - } - - if (this._filters) - { - renderSession.spriteBatch.flush(); - renderSession.filterManager.pushFilter(this._filterBlock); - } - - - - if (!this.tilingTexture || this.refreshTexture) - { - this.generateTilingTexture(true); - - if (this.tilingTexture && this.tilingTexture.needsUpdate) - { - //TODO - tweaking - renderSession.renderer.updateTexture(this.tilingTexture.baseTexture); - this.tilingTexture.needsUpdate = false; - // this.tilingTexture._uvs = null; - } - } - else - { - renderSession.spriteBatch.renderTilingSprite(this); - } - // simple render children! - for (i=0,j=this.children.length; i maxX ? x1 : maxX; - maxX = x2 > maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y1 > maxY ? y1 : maxY; - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - - - -/** - * When the texture is updated, this event will fire to update the scale and frame - * - * @method onTextureUpdate - * @param event - * @private - */ -PIXI.TilingSprite.prototype.onTextureUpdate = function() -{ - // overriding the sprite version of this! -}; - - -/** -* -* @method generateTilingTexture -* -* @param forcePowerOfTwo {Boolean} Whether we want to force the texture to be a power of two -*/ -PIXI.TilingSprite.prototype.generateTilingTexture = function(forcePowerOfTwo) -{ - if (!this.texture.baseTexture.hasLoaded) return; - - var texture = this.originalTexture || this.texture; - var frame = texture.frame; - var targetWidth, targetHeight; - - // Check that the frame is the same size as the base texture. - var isFrame = frame.width !== texture.baseTexture.width || frame.height !== texture.baseTexture.height; - - var newTextureRequired = false; - - if (!forcePowerOfTwo) - { - if (isFrame) - { - if (texture.trim) - { - targetWidth = texture.trim.width; - targetHeight = texture.trim.height; - } - else - { - targetWidth = frame.width; - targetHeight = frame.height; - } - - newTextureRequired = true; - } - } - else - { - targetWidth = PIXI.getNextPowerOfTwo(frame.width); - targetHeight = PIXI.getNextPowerOfTwo(frame.height); - - // If the BaseTexture dimensions don't match the texture frame then we need a new texture anyway because it's part of a texture atlas - if (frame.width !== targetWidth || frame.height !== targetHeight || texture.baseTexture.width !== targetWidth || texture.baseTexture.height || targetHeight) newTextureRequired = true; - } - - if (newTextureRequired) - { - var canvasBuffer; - - if (this.tilingTexture && this.tilingTexture.isTiling) - { - canvasBuffer = this.tilingTexture.canvasBuffer; - canvasBuffer.resize(targetWidth, targetHeight); - this.tilingTexture.baseTexture.width = targetWidth; - this.tilingTexture.baseTexture.height = targetHeight; - this.tilingTexture.needsUpdate = true; - } - else - { - canvasBuffer = new PIXI.CanvasBuffer(targetWidth, targetHeight); - - this.tilingTexture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); - this.tilingTexture.canvasBuffer = canvasBuffer; - this.tilingTexture.isTiling = true; - } - - canvasBuffer.context.drawImage(texture.baseTexture.source, - texture.crop.x, - texture.crop.y, - texture.crop.width, - texture.crop.height, - 0, - 0, - targetWidth, - targetHeight); - - this.tileScaleOffset.x = frame.width / targetWidth; - this.tileScaleOffset.y = frame.height / targetHeight; - } - else - { - // TODO - switching? - if (this.tilingTexture && this.tilingTexture.isTiling) - { - // destroy the tiling texture! - // TODO could store this somewhere? - this.tilingTexture.destroy(true); - } - - this.tileScaleOffset.x = 1; - this.tileScaleOffset.y = 1; - this.tilingTexture = texture; - } - - this.refreshTexture = false; - - this.originalTexture = this.texture; - this.texture = this.tilingTexture; - - this.tilingTexture.baseTexture._powerOf2 = true; -}; - -PIXI.TilingSprite.prototype.destroy = function () { - PIXI.Sprite.prototype.destroy.call(this); - - this.tileScale = null; - this.tileScaleOffset = null; - this.tilePosition = null; - - this.tilingTexture.destroy(true); - this.tilingTexture = null; -}; - -/****************************************************************************** - * Spine Runtimes Software License - * Version 2.1 - * - * Copyright (c) 2013, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable and - * non-transferable license to install, execute and perform the Spine Runtimes - * Software (the "Software") solely for internal use. Without the written - * permission of Esoteric Software (typically granted by licensing Spine), you - * may not (a) modify, translate, adapt or otherwise create derivative works, - * improvements of the Software or develop new applications using the Software - * or (b) remove, delete, alter or obscure any trademarks or any copyright, - * trademark, patent or other intellectual property or proprietary rights - * notices on or in the Software, including any copy thereof. Redistributions - * in binary or source form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -var spine = { - radDeg: 180 / Math.PI, - degRad: Math.PI / 180, - temp: [], - Float32Array: (typeof(Float32Array) === 'undefined') ? Array : Float32Array, - Uint16Array: (typeof(Uint16Array) === 'undefined') ? Array : Uint16Array -}; - -spine.BoneData = function (name, parent) { - this.name = name; - this.parent = parent; -}; -spine.BoneData.prototype = { - length: 0, - x: 0, y: 0, - rotation: 0, - scaleX: 1, scaleY: 1, - inheritScale: true, - inheritRotation: true, - flipX: false, flipY: false -}; - -spine.SlotData = function (name, boneData) { - this.name = name; - this.boneData = boneData; -}; -spine.SlotData.prototype = { - r: 1, g: 1, b: 1, a: 1, - attachmentName: null, - additiveBlending: false -}; - -spine.IkConstraintData = function (name) { - this.name = name; - this.bones = []; -}; -spine.IkConstraintData.prototype = { - target: null, - bendDirection: 1, - mix: 1 -}; - -spine.Bone = function (boneData, skeleton, parent) { - this.data = boneData; - this.skeleton = skeleton; - this.parent = parent; - this.setToSetupPose(); -}; -spine.Bone.yDown = false; -spine.Bone.prototype = { - x: 0, y: 0, - rotation: 0, rotationIK: 0, - scaleX: 1, scaleY: 1, - flipX: false, flipY: false, - m00: 0, m01: 0, worldX: 0, // a b x - m10: 0, m11: 0, worldY: 0, // c d y - worldRotation: 0, - worldScaleX: 1, worldScaleY: 1, - worldFlipX: false, worldFlipY: false, - updateWorldTransform: function () { - var parent = this.parent; - if (parent) { - this.worldX = this.x * parent.m00 + this.y * parent.m01 + parent.worldX; - this.worldY = this.x * parent.m10 + this.y * parent.m11 + parent.worldY; - if (this.data.inheritScale) { - this.worldScaleX = parent.worldScaleX * this.scaleX; - this.worldScaleY = parent.worldScaleY * this.scaleY; - } else { - this.worldScaleX = this.scaleX; - this.worldScaleY = this.scaleY; - } - this.worldRotation = this.data.inheritRotation ? (parent.worldRotation + this.rotationIK) : this.rotationIK; - this.worldFlipX = parent.worldFlipX != this.flipX; - this.worldFlipY = parent.worldFlipY != this.flipY; - } else { - var skeletonFlipX = this.skeleton.flipX, skeletonFlipY = this.skeleton.flipY; - this.worldX = skeletonFlipX ? -this.x : this.x; - this.worldY = (skeletonFlipY != spine.Bone.yDown) ? -this.y : this.y; - this.worldScaleX = this.scaleX; - this.worldScaleY = this.scaleY; - this.worldRotation = this.rotationIK; - this.worldFlipX = skeletonFlipX != this.flipX; - this.worldFlipY = skeletonFlipY != this.flipY; - } - var radians = this.worldRotation * spine.degRad; - var cos = Math.cos(radians); - var sin = Math.sin(radians); - if (this.worldFlipX) { - this.m00 = -cos * this.worldScaleX; - this.m01 = sin * this.worldScaleY; - } else { - this.m00 = cos * this.worldScaleX; - this.m01 = -sin * this.worldScaleY; - } - if (this.worldFlipY != spine.Bone.yDown) { - this.m10 = -sin * this.worldScaleX; - this.m11 = -cos * this.worldScaleY; - } else { - this.m10 = sin * this.worldScaleX; - this.m11 = cos * this.worldScaleY; - } - }, - setToSetupPose: function () { - var data = this.data; - this.x = data.x; - this.y = data.y; - this.rotation = data.rotation; - this.rotationIK = this.rotation; - this.scaleX = data.scaleX; - this.scaleY = data.scaleY; - this.flipX = data.flipX; - this.flipY = data.flipY; - }, - worldToLocal: function (world) { - var dx = world[0] - this.worldX, dy = world[1] - this.worldY; - var m00 = this.m00, m10 = this.m10, m01 = this.m01, m11 = this.m11; - if (this.worldFlipX != (this.worldFlipY != spine.Bone.yDown)) { - m00 = -m00; - m11 = -m11; - } - var invDet = 1 / (m00 * m11 - m01 * m10); - world[0] = dx * m00 * invDet - dy * m01 * invDet; - world[1] = dy * m11 * invDet - dx * m10 * invDet; - }, - localToWorld: function (local) { - var localX = local[0], localY = local[1]; - local[0] = localX * this.m00 + localY * this.m01 + this.worldX; - local[1] = localX * this.m10 + localY * this.m11 + this.worldY; - } -}; - -spine.Slot = function (slotData, bone) { - this.data = slotData; - this.bone = bone; - this.setToSetupPose(); -}; -spine.Slot.prototype = { - r: 1, g: 1, b: 1, a: 1, - _attachmentTime: 0, - attachment: null, - attachmentVertices: [], - setAttachment: function (attachment) { - this.attachment = attachment; - this._attachmentTime = this.bone.skeleton.time; - this.attachmentVertices.length = 0; - }, - setAttachmentTime: function (time) { - this._attachmentTime = this.bone.skeleton.time - time; - }, - getAttachmentTime: function () { - return this.bone.skeleton.time - this._attachmentTime; - }, - setToSetupPose: function () { - var data = this.data; - this.r = data.r; - this.g = data.g; - this.b = data.b; - this.a = data.a; - - var slotDatas = this.bone.skeleton.data.slots; - for (var i = 0, n = slotDatas.length; i < n; i++) { - if (slotDatas[i] == data) { - this.setAttachment(!data.attachmentName ? null : this.bone.skeleton.getAttachmentBySlotIndex(i, data.attachmentName)); - break; - } - } - } -}; - -spine.IkConstraint = function (data, skeleton) { - this.data = data; - this.mix = data.mix; - this.bendDirection = data.bendDirection; - - this.bones = []; - for (var i = 0, n = data.bones.length; i < n; i++) - this.bones.push(skeleton.findBone(data.bones[i].name)); - this.target = skeleton.findBone(data.target.name); -}; -spine.IkConstraint.prototype = { - apply: function () { - var target = this.target; - var bones = this.bones; - switch (bones.length) { - case 1: - spine.IkConstraint.apply1(bones[0], target.worldX, target.worldY, this.mix); - break; - case 2: - spine.IkConstraint.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.mix); - break; - } - } -}; -/** Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified in the world - * coordinate system. */ -spine.IkConstraint.apply1 = function (bone, targetX, targetY, alpha) { - var parentRotation = (!bone.data.inheritRotation || !bone.parent) ? 0 : bone.parent.worldRotation; - var rotation = bone.rotation; - var rotationIK = Math.atan2(targetY - bone.worldY, targetX - bone.worldX) * spine.radDeg - parentRotation; - bone.rotationIK = rotation + (rotationIK - rotation) * alpha; -}; -/** Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as possible. The - * target is specified in the world coordinate system. - * @param child Any descendant bone of the parent. */ -spine.IkConstraint.apply2 = function (parent, child, targetX, targetY, bendDirection, alpha) { - var childRotation = child.rotation, parentRotation = parent.rotation; - if (!alpha) { - child.rotationIK = childRotation; - parent.rotationIK = parentRotation; - return; - } - var positionX, positionY, tempPosition = spine.temp; - var parentParent = parent.parent; - if (parentParent) { - tempPosition[0] = targetX; - tempPosition[1] = targetY; - parentParent.worldToLocal(tempPosition); - targetX = (tempPosition[0] - parent.x) * parentParent.worldScaleX; - targetY = (tempPosition[1] - parent.y) * parentParent.worldScaleY; - } else { - targetX -= parent.x; - targetY -= parent.y; - } - if (child.parent == parent) { - positionX = child.x; - positionY = child.y; - } else { - tempPosition[0] = child.x; - tempPosition[1] = child.y; - child.parent.localToWorld(tempPosition); - parent.worldToLocal(tempPosition); - positionX = tempPosition[0]; - positionY = tempPosition[1]; - } - var childX = positionX * parent.worldScaleX, childY = positionY * parent.worldScaleY; - var offset = Math.atan2(childY, childX); - var len1 = Math.sqrt(childX * childX + childY * childY), len2 = child.data.length * child.worldScaleX; - // Based on code by Ryan Juckett with permission: Copyright (c) 2008-2009 Ryan Juckett, http://www.ryanjuckett.com/ - var cosDenom = 2 * len1 * len2; - if (cosDenom < 0.0001) { - child.rotationIK = childRotation + (Math.atan2(targetY, targetX) * spine.radDeg - parentRotation - childRotation) * alpha; - return; - } - var cos = (targetX * targetX + targetY * targetY - len1 * len1 - len2 * len2) / cosDenom; - if (cos < -1) - cos = -1; - else if (cos > 1) - cos = 1; - var childAngle = Math.acos(cos) * bendDirection; - var adjacent = len1 + len2 * cos, opposite = len2 * Math.sin(childAngle); - var parentAngle = Math.atan2(targetY * adjacent - targetX * opposite, targetX * adjacent + targetY * opposite); - var rotation = (parentAngle - offset) * spine.radDeg - parentRotation; - if (rotation > 180) - rotation -= 360; - else if (rotation < -180) // - rotation += 360; - parent.rotationIK = parentRotation + rotation * alpha; - rotation = (childAngle + offset) * spine.radDeg - childRotation; - if (rotation > 180) - rotation -= 360; - else if (rotation < -180) // - rotation += 360; - child.rotationIK = childRotation + (rotation + parent.worldRotation - child.parent.worldRotation) * alpha; -}; - -spine.Skin = function (name) { - this.name = name; - this.attachments = {}; -}; -spine.Skin.prototype = { - addAttachment: function (slotIndex, name, attachment) { - this.attachments[slotIndex + ":" + name] = attachment; - }, - getAttachment: function (slotIndex, name) { - return this.attachments[slotIndex + ":" + name]; - }, - _attachAll: function (skeleton, oldSkin) { - for (var key in oldSkin.attachments) { - var colon = key.indexOf(":"); - var slotIndex = parseInt(key.substring(0, colon)); - var name = key.substring(colon + 1); - var slot = skeleton.slots[slotIndex]; - if (slot.attachment && slot.attachment.name == name) { - var attachment = this.getAttachment(slotIndex, name); - if (attachment) slot.setAttachment(attachment); - } - } - } -}; - -spine.Animation = function (name, timelines, duration) { - this.name = name; - this.timelines = timelines; - this.duration = duration; -}; -spine.Animation.prototype = { - apply: function (skeleton, lastTime, time, loop, events) { - if (loop && this.duration != 0) { - time %= this.duration; - lastTime %= this.duration; - } - var timelines = this.timelines; - for (var i = 0, n = timelines.length; i < n; i++) - timelines[i].apply(skeleton, lastTime, time, events, 1); - }, - mix: function (skeleton, lastTime, time, loop, events, alpha) { - if (loop && this.duration != 0) { - time %= this.duration; - lastTime %= this.duration; - } - var timelines = this.timelines; - for (var i = 0, n = timelines.length; i < n; i++) - timelines[i].apply(skeleton, lastTime, time, events, alpha); - } -}; -spine.Animation.binarySearch = function (values, target, step) { - var low = 0; - var high = Math.floor(values.length / step) - 2; - if (!high) return step; - var current = high >>> 1; - while (true) { - if (values[(current + 1) * step] <= target) - low = current + 1; - else - high = current; - if (low == high) return (low + 1) * step; - current = (low + high) >>> 1; - } -}; -spine.Animation.binarySearch1 = function (values, target) { - var low = 0; - var high = values.length - 2; - if (!high) return 1; - var current = high >>> 1; - while (true) { - if (values[current + 1] <= target) - low = current + 1; - else - high = current; - if (low == high) return low + 1; - current = (low + high) >>> 1; - } -}; -spine.Animation.linearSearch = function (values, target, step) { - for (var i = 0, last = values.length - step; i <= last; i += step) - if (values[i] > target) return i; - return -1; -}; - -spine.Curves = function (frameCount) { - this.curves = []; // type, x, y, ... - //this.curves.length = (frameCount - 1) * 19/*BEZIER_SIZE*/; -}; -spine.Curves.prototype = { - setLinear: function (frameIndex) { - this.curves[frameIndex * 19/*BEZIER_SIZE*/] = 0/*LINEAR*/; - }, - setStepped: function (frameIndex) { - this.curves[frameIndex * 19/*BEZIER_SIZE*/] = 1/*STEPPED*/; - }, - /** Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next. - * cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of - * the difference between the keyframe's values. */ - setCurve: function (frameIndex, cx1, cy1, cx2, cy2) { - var subdiv1 = 1 / 10/*BEZIER_SEGMENTS*/, subdiv2 = subdiv1 * subdiv1, subdiv3 = subdiv2 * subdiv1; - var pre1 = 3 * subdiv1, pre2 = 3 * subdiv2, pre4 = 6 * subdiv2, pre5 = 6 * subdiv3; - var tmp1x = -cx1 * 2 + cx2, tmp1y = -cy1 * 2 + cy2, tmp2x = (cx1 - cx2) * 3 + 1, tmp2y = (cy1 - cy2) * 3 + 1; - var dfx = cx1 * pre1 + tmp1x * pre2 + tmp2x * subdiv3, dfy = cy1 * pre1 + tmp1y * pre2 + tmp2y * subdiv3; - var ddfx = tmp1x * pre4 + tmp2x * pre5, ddfy = tmp1y * pre4 + tmp2y * pre5; - var dddfx = tmp2x * pre5, dddfy = tmp2y * pre5; - - var i = frameIndex * 19/*BEZIER_SIZE*/; - var curves = this.curves; - curves[i++] = 2/*BEZIER*/; - - var x = dfx, y = dfy; - for (var n = i + 19/*BEZIER_SIZE*/ - 1; i < n; i += 2) { - curves[i] = x; - curves[i + 1] = y; - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - x += dfx; - y += dfy; - } - }, - getCurvePercent: function (frameIndex, percent) { - percent = percent < 0 ? 0 : (percent > 1 ? 1 : percent); - var curves = this.curves; - var i = frameIndex * 19/*BEZIER_SIZE*/; - var type = curves[i]; - if (type === 0/*LINEAR*/) return percent; - if (type == 1/*STEPPED*/) return 0; - i++; - var x = 0; - for (var start = i, n = i + 19/*BEZIER_SIZE*/ - 1; i < n; i += 2) { - x = curves[i]; - if (x >= percent) { - var prevX, prevY; - if (i == start) { - prevX = 0; - prevY = 0; - } else { - prevX = curves[i - 2]; - prevY = curves[i - 1]; - } - return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX); - } - } - var y = curves[i - 1]; - return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1. - } -}; - -spine.RotateTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, angle, ... - this.frames.length = frameCount * 2; -}; -spine.RotateTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, angle) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = angle; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 2]) { // Time is after last frame. - var amount = bone.data.rotation + frames[frames.length - 1] - bone.rotation; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - bone.rotation += amount * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 2); - var prevFrameValue = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 2/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 2 - 1, percent); - - var amount = frames[frameIndex + 1/*FRAME_VALUE*/] - prevFrameValue; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - amount = bone.data.rotation + (prevFrameValue + amount * percent) - bone.rotation; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - bone.rotation += amount * alpha; - } -}; - -spine.TranslateTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, x, y, ... - this.frames.length = frameCount * 3; -}; -spine.TranslateTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, x, y) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = x; - this.frames[frameIndex + 2] = y; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - bone.x += (bone.data.x + frames[frames.length - 2] - bone.x) * alpha; - bone.y += (bone.data.y + frames[frames.length - 1] - bone.y) * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameX = frames[frameIndex - 2]; - var prevFrameY = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - bone.x += (bone.data.x + prevFrameX + (frames[frameIndex + 1/*FRAME_X*/] - prevFrameX) * percent - bone.x) * alpha; - bone.y += (bone.data.y + prevFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - prevFrameY) * percent - bone.y) * alpha; - } -}; - -spine.ScaleTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, x, y, ... - this.frames.length = frameCount * 3; -}; -spine.ScaleTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, x, y) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = x; - this.frames[frameIndex + 2] = y; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - bone.scaleX += (bone.data.scaleX * frames[frames.length - 2] - bone.scaleX) * alpha; - bone.scaleY += (bone.data.scaleY * frames[frames.length - 1] - bone.scaleY) * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameX = frames[frameIndex - 2]; - var prevFrameY = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - bone.scaleX += (bone.data.scaleX * (prevFrameX + (frames[frameIndex + 1/*FRAME_X*/] - prevFrameX) * percent) - bone.scaleX) * alpha; - bone.scaleY += (bone.data.scaleY * (prevFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - prevFrameY) * percent) - bone.scaleY) * alpha; - } -}; - -spine.ColorTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, r, g, b, a, ... - this.frames.length = frameCount * 5; -}; -spine.ColorTimeline.prototype = { - slotIndex: 0, - getFrameCount: function () { - return this.frames.length / 5; - }, - setFrame: function (frameIndex, time, r, g, b, a) { - frameIndex *= 5; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = r; - this.frames[frameIndex + 2] = g; - this.frames[frameIndex + 3] = b; - this.frames[frameIndex + 4] = a; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var r, g, b, a; - if (time >= frames[frames.length - 5]) { - // Time is after last frame. - var i = frames.length - 1; - r = frames[i - 3]; - g = frames[i - 2]; - b = frames[i - 1]; - a = frames[i]; - } else { - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 5); - var prevFrameR = frames[frameIndex - 4]; - var prevFrameG = frames[frameIndex - 3]; - var prevFrameB = frames[frameIndex - 2]; - var prevFrameA = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 5/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 5 - 1, percent); - - r = prevFrameR + (frames[frameIndex + 1/*FRAME_R*/] - prevFrameR) * percent; - g = prevFrameG + (frames[frameIndex + 2/*FRAME_G*/] - prevFrameG) * percent; - b = prevFrameB + (frames[frameIndex + 3/*FRAME_B*/] - prevFrameB) * percent; - a = prevFrameA + (frames[frameIndex + 4/*FRAME_A*/] - prevFrameA) * percent; - } - var slot = skeleton.slots[this.slotIndex]; - if (alpha < 1) { - slot.r += (r - slot.r) * alpha; - slot.g += (g - slot.g) * alpha; - slot.b += (b - slot.b) * alpha; - slot.a += (a - slot.a) * alpha; - } else { - slot.r = r; - slot.g = g; - slot.b = b; - slot.a = a; - } - } -}; - -spine.AttachmentTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, ... - this.frames.length = frameCount; - this.attachmentNames = []; - this.attachmentNames.length = frameCount; -}; -spine.AttachmentTimeline.prototype = { - slotIndex: 0, - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, attachmentName) { - this.frames[frameIndex] = time; - this.attachmentNames[frameIndex] = attachmentName; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - - var frameIndex = time >= frames[frames.length - 1] ? frames.length - 1 : spine.Animation.binarySearch1(frames, time) - 1; - if (frames[frameIndex] < lastTime) return; - - var attachmentName = this.attachmentNames[frameIndex]; - skeleton.slots[this.slotIndex].setAttachment( - !attachmentName ? null : skeleton.getAttachmentBySlotIndex(this.slotIndex, attachmentName)); - } -}; - -spine.EventTimeline = function (frameCount) { - this.frames = []; // time, ... - this.frames.length = frameCount; - this.events = []; - this.events.length = frameCount; -}; -spine.EventTimeline.prototype = { - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, event) { - this.frames[frameIndex] = time; - this.events[frameIndex] = event; - }, - /** Fires events for frames > lastTime and <= time. */ - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - if (!firedEvents) return; - - var frames = this.frames; - var frameCount = frames.length; - - if (lastTime > time) { // Fire events after last time for looped animations. - this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha); - lastTime = -1; - } else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame. - return; - if (time < frames[0]) return; // Time is before first frame. - - var frameIndex; - if (lastTime < frames[0]) - frameIndex = 0; - else { - frameIndex = spine.Animation.binarySearch1(frames, lastTime); - var frame = frames[frameIndex]; - while (frameIndex > 0) { // Fire multiple events with the same frame. - if (frames[frameIndex - 1] != frame) break; - frameIndex--; - } - } - var events = this.events; - for (; frameIndex < frameCount && time >= frames[frameIndex]; frameIndex++) - firedEvents.push(events[frameIndex]); - } -}; - -spine.DrawOrderTimeline = function (frameCount) { - this.frames = []; // time, ... - this.frames.length = frameCount; - this.drawOrders = []; - this.drawOrders.length = frameCount; -}; -spine.DrawOrderTimeline.prototype = { - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, drawOrder) { - this.frames[frameIndex] = time; - this.drawOrders[frameIndex] = drawOrder; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var frameIndex; - if (time >= frames[frames.length - 1]) // Time is after last frame. - frameIndex = frames.length - 1; - else - frameIndex = spine.Animation.binarySearch1(frames, time) - 1; - - var drawOrder = skeleton.drawOrder; - var slots = skeleton.slots; - var drawOrderToSetupIndex = this.drawOrders[frameIndex]; - if (!drawOrderToSetupIndex) { - for (var i = 0, n = slots.length; i < n; i++) - drawOrder[i] = slots[i]; - } else { - for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++) - drawOrder[i] = skeleton.slots[drawOrderToSetupIndex[i]]; - } - - } -}; - -spine.FfdTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; - this.frames.length = frameCount; - this.frameVertices = []; - this.frameVertices.length = frameCount; -}; -spine.FfdTimeline.prototype = { - slotIndex: 0, - attachment: 0, - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, vertices) { - this.frames[frameIndex] = time; - this.frameVertices[frameIndex] = vertices; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var slot = skeleton.slots[this.slotIndex]; - if (slot.attachment != this.attachment) return; - - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var frameVertices = this.frameVertices; - var vertexCount = frameVertices[0].length; - - var vertices = slot.attachmentVertices; - if (vertices.length != vertexCount) alpha = 1; - vertices.length = vertexCount; - - if (time >= frames[frames.length - 1]) { // Time is after last frame. - var lastVertices = frameVertices[frames.length - 1]; - if (alpha < 1) { - for (var i = 0; i < vertexCount; i++) - vertices[i] += (lastVertices[i] - vertices[i]) * alpha; - } else { - for (var i = 0; i < vertexCount; i++) - vertices[i] = lastVertices[i]; - } - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch1(frames, time); - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 1] - frameTime); - percent = this.curves.getCurvePercent(frameIndex - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent)); - - var prevVertices = frameVertices[frameIndex - 1]; - var nextVertices = frameVertices[frameIndex]; - - if (alpha < 1) { - for (var i = 0; i < vertexCount; i++) { - var prev = prevVertices[i]; - vertices[i] += (prev + (nextVertices[i] - prev) * percent - vertices[i]) * alpha; - } - } else { - for (var i = 0; i < vertexCount; i++) { - var prev = prevVertices[i]; - vertices[i] = prev + (nextVertices[i] - prev) * percent; - } - } - } -}; - -spine.IkConstraintTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, mix, bendDirection, ... - this.frames.length = frameCount * 3; -}; -spine.IkConstraintTimeline.prototype = { - ikConstraintIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, mix, bendDirection) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = mix; - this.frames[frameIndex + 2] = bendDirection; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var ikConstraint = skeleton.ikConstraints[this.ikConstraintIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - ikConstraint.mix += (frames[frames.length - 2] - ikConstraint.mix) * alpha; - ikConstraint.bendDirection = frames[frames.length - 1]; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameMix = frames[frameIndex + -2/*PREV_FRAME_MIX*/]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - var mix = prevFrameMix + (frames[frameIndex + 1/*FRAME_MIX*/] - prevFrameMix) * percent; - ikConstraint.mix += (mix - ikConstraint.mix) * alpha; - ikConstraint.bendDirection = frames[frameIndex + -1/*PREV_FRAME_BEND_DIRECTION*/]; - } -}; - -spine.FlipXTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, flip, ... - this.frames.length = frameCount * 2; -}; -spine.FlipXTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, flip) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = flip ? 1 : 0; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - var frameIndex = (time >= frames[frames.length - 2] ? frames.length : spine.Animation.binarySearch(frames, time, 2)) - 2; - if (frames[frameIndex] < lastTime) return; - skeleton.bones[boneIndex].flipX = frames[frameIndex + 1] != 0; - } -}; - -spine.FlipYTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, flip, ... - this.frames.length = frameCount * 2; -}; -spine.FlipYTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, flip) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = flip ? 1 : 0; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - var frameIndex = (time >= frames[frames.length - 2] ? frames.length : spine.Animation.binarySearch(frames, time, 2)) - 2; - if (frames[frameIndex] < lastTime) return; - skeleton.bones[boneIndex].flipY = frames[frameIndex + 1] != 0; - } -}; - -spine.SkeletonData = function () { - this.bones = []; - this.slots = []; - this.skins = []; - this.events = []; - this.animations = []; - this.ikConstraints = []; -}; -spine.SkeletonData.prototype = { - name: null, - defaultSkin: null, - width: 0, height: 0, - version: null, hash: null, - /** @return May be null. */ - findBone: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].name == boneName) return bones[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findBoneIndex: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].name == boneName) return i; - return -1; - }, - /** @return May be null. */ - findSlot: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - if (slots[i].name == slotName) return slot[i]; - } - return null; - }, - /** @return -1 if the bone was not found. */ - findSlotIndex: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].name == slotName) return i; - return -1; - }, - /** @return May be null. */ - findSkin: function (skinName) { - var skins = this.skins; - for (var i = 0, n = skins.length; i < n; i++) - if (skins[i].name == skinName) return skins[i]; - return null; - }, - /** @return May be null. */ - findEvent: function (eventName) { - var events = this.events; - for (var i = 0, n = events.length; i < n; i++) - if (events[i].name == eventName) return events[i]; - return null; - }, - /** @return May be null. */ - findAnimation: function (animationName) { - var animations = this.animations; - for (var i = 0, n = animations.length; i < n; i++) - if (animations[i].name == animationName) return animations[i]; - return null; - }, - /** @return May be null. */ - findIkConstraint: function (ikConstraintName) { - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) - if (ikConstraints[i].name == ikConstraintName) return ikConstraints[i]; - return null; - } -}; - -spine.Skeleton = function (skeletonData) { - this.data = skeletonData; - - this.bones = []; - for (var i = 0, n = skeletonData.bones.length; i < n; i++) { - var boneData = skeletonData.bones[i]; - var parent = !boneData.parent ? null : this.bones[skeletonData.bones.indexOf(boneData.parent)]; - this.bones.push(new spine.Bone(boneData, this, parent)); - } - - this.slots = []; - this.drawOrder = []; - for (var i = 0, n = skeletonData.slots.length; i < n; i++) { - var slotData = skeletonData.slots[i]; - var bone = this.bones[skeletonData.bones.indexOf(slotData.boneData)]; - var slot = new spine.Slot(slotData, bone); - this.slots.push(slot); - this.drawOrder.push(slot); - } - - this.ikConstraints = []; - for (var i = 0, n = skeletonData.ikConstraints.length; i < n; i++) - this.ikConstraints.push(new spine.IkConstraint(skeletonData.ikConstraints[i], this)); - - this.boneCache = []; - this.updateCache(); -}; -spine.Skeleton.prototype = { - x: 0, y: 0, - skin: null, - r: 1, g: 1, b: 1, a: 1, - time: 0, - flipX: false, flipY: false, - /** Caches information about bones and IK constraints. Must be called if bones or IK constraints are added or removed. */ - updateCache: function () { - var ikConstraints = this.ikConstraints; - var ikConstraintsCount = ikConstraints.length; - - var arrayCount = ikConstraintsCount + 1; - var boneCache = this.boneCache; - if (boneCache.length > arrayCount) boneCache.length = arrayCount; - for (var i = 0, n = boneCache.length; i < n; i++) - boneCache[i].length = 0; - while (boneCache.length < arrayCount) - boneCache[boneCache.length] = []; - - var nonIkBones = boneCache[0]; - var bones = this.bones; - - outer: - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - var current = bone; - do { - for (var ii = 0; ii < ikConstraintsCount; ii++) { - var ikConstraint = ikConstraints[ii]; - var parent = ikConstraint.bones[0]; - var child= ikConstraint.bones[ikConstraint.bones.length - 1]; - while (true) { - if (current == child) { - boneCache[ii].push(bone); - boneCache[ii + 1].push(bone); - continue outer; - } - if (child == parent) break; - child = child.parent; - } - } - current = current.parent; - } while (current); - nonIkBones[nonIkBones.length] = bone; - } - }, - /** Updates the world transform for each bone. */ - updateWorldTransform: function () { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - bone.rotationIK = bone.rotation; - } - var i = 0, last = this.boneCache.length - 1; - while (true) { - var cacheBones = this.boneCache[i]; - for (var ii = 0, nn = cacheBones.length; ii < nn; ii++) - cacheBones[ii].updateWorldTransform(); - if (i == last) break; - this.ikConstraints[i].apply(); - i++; - } - }, - /** Sets the bones and slots to their setup pose values. */ - setToSetupPose: function () { - this.setBonesToSetupPose(); - this.setSlotsToSetupPose(); - }, - setBonesToSetupPose: function () { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - bones[i].setToSetupPose(); - - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) { - var ikConstraint = ikConstraints[i]; - ikConstraint.bendDirection = ikConstraint.data.bendDirection; - ikConstraint.mix = ikConstraint.data.mix; - } - }, - setSlotsToSetupPose: function () { - var slots = this.slots; - var drawOrder = this.drawOrder; - for (var i = 0, n = slots.length; i < n; i++) { - drawOrder[i] = slots[i]; - slots[i].setToSetupPose(i); - } - }, - /** @return May return null. */ - getRootBone: function () { - return this.bones.length ? this.bones[0] : null; - }, - /** @return May be null. */ - findBone: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].data.name == boneName) return bones[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findBoneIndex: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].data.name == boneName) return i; - return -1; - }, - /** @return May be null. */ - findSlot: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].data.name == slotName) return slots[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findSlotIndex: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].data.name == slotName) return i; - return -1; - }, - setSkinByName: function (skinName) { - var skin = this.data.findSkin(skinName); - if (!skin) throw "Skin not found: " + skinName; - this.setSkin(skin); - }, - /** Sets the skin used to look up attachments before looking in the {@link SkeletonData#getDefaultSkin() default skin}. - * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was - * no old skin, each slot's setup mode attachment is attached from the new skin. - * @param newSkin May be null. */ - setSkin: function (newSkin) { - if (newSkin) { - if (this.skin) - newSkin._attachAll(this, this.skin); - else { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - var name = slot.data.attachmentName; - if (name) { - var attachment = newSkin.getAttachment(i, name); - if (attachment) slot.setAttachment(attachment); - } - } - } - } - this.skin = newSkin; - }, - /** @return May be null. */ - getAttachmentBySlotName: function (slotName, attachmentName) { - return this.getAttachmentBySlotIndex(this.data.findSlotIndex(slotName), attachmentName); - }, - /** @return May be null. */ - getAttachmentBySlotIndex: function (slotIndex, attachmentName) { - if (this.skin) { - var attachment = this.skin.getAttachment(slotIndex, attachmentName); - if (attachment) return attachment; - } - if (this.data.defaultSkin) return this.data.defaultSkin.getAttachment(slotIndex, attachmentName); - return null; - }, - /** @param attachmentName May be null. */ - setAttachment: function (slotName, attachmentName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - if (slot.data.name == slotName) { - var attachment = null; - if (attachmentName) { - attachment = this.getAttachmentBySlotIndex(i, attachmentName); - if (!attachment) throw "Attachment not found: " + attachmentName + ", for slot: " + slotName; - } - slot.setAttachment(attachment); - return; - } - } - throw "Slot not found: " + slotName; - }, - /** @return May be null. */ - findIkConstraint: function (ikConstraintName) { - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) - if (ikConstraints[i].data.name == ikConstraintName) return ikConstraints[i]; - return null; - }, - update: function (delta) { - this.time += delta; - } -}; - -spine.EventData = function (name) { - this.name = name; -}; -spine.EventData.prototype = { - intValue: 0, - floatValue: 0, - stringValue: null -}; - -spine.Event = function (data) { - this.data = data; -}; -spine.Event.prototype = { - intValue: 0, - floatValue: 0, - stringValue: null -}; - -spine.AttachmentType = { - region: 0, - boundingbox: 1, - mesh: 2, - skinnedmesh: 3 -}; - -spine.RegionAttachment = function (name) { - this.name = name; - this.offset = []; - this.offset.length = 8; - this.uvs = []; - this.uvs.length = 8; -}; -spine.RegionAttachment.prototype = { - type: spine.AttachmentType.region, - x: 0, y: 0, - rotation: 0, - scaleX: 1, scaleY: 1, - width: 0, height: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - setUVs: function (u, v, u2, v2, rotate) { - var uvs = this.uvs; - if (rotate) { - uvs[2/*X2*/] = u; - uvs[3/*Y2*/] = v2; - uvs[4/*X3*/] = u; - uvs[5/*Y3*/] = v; - uvs[6/*X4*/] = u2; - uvs[7/*Y4*/] = v; - uvs[0/*X1*/] = u2; - uvs[1/*Y1*/] = v2; - } else { - uvs[0/*X1*/] = u; - uvs[1/*Y1*/] = v2; - uvs[2/*X2*/] = u; - uvs[3/*Y2*/] = v; - uvs[4/*X3*/] = u2; - uvs[5/*Y3*/] = v; - uvs[6/*X4*/] = u2; - uvs[7/*Y4*/] = v2; - } - }, - updateOffset: function () { - var regionScaleX = this.width / this.regionOriginalWidth * this.scaleX; - var regionScaleY = this.height / this.regionOriginalHeight * this.scaleY; - var localX = -this.width / 2 * this.scaleX + this.regionOffsetX * regionScaleX; - var localY = -this.height / 2 * this.scaleY + this.regionOffsetY * regionScaleY; - var localX2 = localX + this.regionWidth * regionScaleX; - var localY2 = localY + this.regionHeight * regionScaleY; - var radians = this.rotation * spine.degRad; - var cos = Math.cos(radians); - var sin = Math.sin(radians); - var localXCos = localX * cos + this.x; - var localXSin = localX * sin; - var localYCos = localY * cos + this.y; - var localYSin = localY * sin; - var localX2Cos = localX2 * cos + this.x; - var localX2Sin = localX2 * sin; - var localY2Cos = localY2 * cos + this.y; - var localY2Sin = localY2 * sin; - var offset = this.offset; - offset[0/*X1*/] = localXCos - localYSin; - offset[1/*Y1*/] = localYCos + localXSin; - offset[2/*X2*/] = localXCos - localY2Sin; - offset[3/*Y2*/] = localY2Cos + localXSin; - offset[4/*X3*/] = localX2Cos - localY2Sin; - offset[5/*Y3*/] = localY2Cos + localX2Sin; - offset[6/*X4*/] = localX2Cos - localYSin; - offset[7/*Y4*/] = localYCos + localX2Sin; - }, - computeVertices: function (x, y, bone, vertices) { - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var offset = this.offset; - vertices[0/*X1*/] = offset[0/*X1*/] * m00 + offset[1/*Y1*/] * m01 + x; - vertices[1/*Y1*/] = offset[0/*X1*/] * m10 + offset[1/*Y1*/] * m11 + y; - vertices[2/*X2*/] = offset[2/*X2*/] * m00 + offset[3/*Y2*/] * m01 + x; - vertices[3/*Y2*/] = offset[2/*X2*/] * m10 + offset[3/*Y2*/] * m11 + y; - vertices[4/*X3*/] = offset[4/*X3*/] * m00 + offset[5/*X3*/] * m01 + x; - vertices[5/*X3*/] = offset[4/*X3*/] * m10 + offset[5/*X3*/] * m11 + y; - vertices[6/*X4*/] = offset[6/*X4*/] * m00 + offset[7/*Y4*/] * m01 + x; - vertices[7/*Y4*/] = offset[6/*X4*/] * m10 + offset[7/*Y4*/] * m11 + y; - } -}; - -spine.MeshAttachment = function (name) { - this.name = name; -}; -spine.MeshAttachment.prototype = { - type: spine.AttachmentType.mesh, - vertices: null, - uvs: null, - regionUVs: null, - triangles: null, - hullLength: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionU: 0, regionV: 0, regionU2: 0, regionV2: 0, regionRotate: false, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - edges: null, - width: 0, height: 0, - updateUVs: function () { - var width = this.regionU2 - this.regionU, height = this.regionV2 - this.regionV; - var n = this.regionUVs.length; - if (!this.uvs || this.uvs.length != n) { - this.uvs = new spine.Float32Array(n); - } - if (this.regionRotate) { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i + 1] * width; - this.uvs[i + 1] = this.regionV + height - this.regionUVs[i] * height; - } - } else { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i] * width; - this.uvs[i + 1] = this.regionV + this.regionUVs[i + 1] * height; - } - } - }, - computeWorldVertices: function (x, y, slot, worldVertices) { - var bone = slot.bone; - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var vertices = this.vertices; - var verticesCount = vertices.length; - if (slot.attachmentVertices.length == verticesCount) vertices = slot.attachmentVertices; - for (var i = 0; i < verticesCount; i += 2) { - var vx = vertices[i]; - var vy = vertices[i + 1]; - worldVertices[i] = vx * m00 + vy * m01 + x; - worldVertices[i + 1] = vx * m10 + vy * m11 + y; - } - } -}; - -spine.SkinnedMeshAttachment = function (name) { - this.name = name; -}; -spine.SkinnedMeshAttachment.prototype = { - type: spine.AttachmentType.skinnedmesh, - bones: null, - weights: null, - uvs: null, - regionUVs: null, - triangles: null, - hullLength: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionU: 0, regionV: 0, regionU2: 0, regionV2: 0, regionRotate: false, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - edges: null, - width: 0, height: 0, - updateUVs: function (u, v, u2, v2, rotate) { - var width = this.regionU2 - this.regionU, height = this.regionV2 - this.regionV; - var n = this.regionUVs.length; - if (!this.uvs || this.uvs.length != n) { - this.uvs = new spine.Float32Array(n); - } - if (this.regionRotate) { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i + 1] * width; - this.uvs[i + 1] = this.regionV + height - this.regionUVs[i] * height; - } - } else { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i] * width; - this.uvs[i + 1] = this.regionV + this.regionUVs[i + 1] * height; - } - } - }, - computeWorldVertices: function (x, y, slot, worldVertices) { - var skeletonBones = slot.bone.skeleton.bones; - var weights = this.weights; - var bones = this.bones; - - var w = 0, v = 0, b = 0, f = 0, n = bones.length, nn; - var wx, wy, bone, vx, vy, weight; - if (!slot.attachmentVertices.length) { - for (; v < n; w += 2) { - wx = 0; - wy = 0; - nn = bones[v++] + v; - for (; v < nn; v++, b += 3) { - bone = skeletonBones[bones[v]]; - vx = weights[b]; - vy = weights[b + 1]; - weight = weights[b + 2]; - wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight; - wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight; - } - worldVertices[w] = wx + x; - worldVertices[w + 1] = wy + y; - } - } else { - var ffd = slot.attachmentVertices; - for (; v < n; w += 2) { - wx = 0; - wy = 0; - nn = bones[v++] + v; - for (; v < nn; v++, b += 3, f += 2) { - bone = skeletonBones[bones[v]]; - vx = weights[b] + ffd[f]; - vy = weights[b + 1] + ffd[f + 1]; - weight = weights[b + 2]; - wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight; - wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight; - } - worldVertices[w] = wx + x; - worldVertices[w + 1] = wy + y; - } - } - } -}; - -spine.BoundingBoxAttachment = function (name) { - this.name = name; - this.vertices = []; -}; -spine.BoundingBoxAttachment.prototype = { - type: spine.AttachmentType.boundingbox, - computeWorldVertices: function (x, y, bone, worldVertices) { - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var vertices = this.vertices; - for (var i = 0, n = vertices.length; i < n; i += 2) { - var px = vertices[i]; - var py = vertices[i + 1]; - worldVertices[i] = px * m00 + py * m01 + x; - worldVertices[i + 1] = px * m10 + py * m11 + y; - } - } -}; - -spine.AnimationStateData = function (skeletonData) { - this.skeletonData = skeletonData; - this.animationToMixTime = {}; -}; -spine.AnimationStateData.prototype = { - defaultMix: 0, - setMixByName: function (fromName, toName, duration) { - var from = this.skeletonData.findAnimation(fromName); - if (!from) throw "Animation not found: " + fromName; - var to = this.skeletonData.findAnimation(toName); - if (!to) throw "Animation not found: " + toName; - this.setMix(from, to, duration); - }, - setMix: function (from, to, duration) { - this.animationToMixTime[from.name + ":" + to.name] = duration; - }, - getMix: function (from, to) { - var key = from.name + ":" + to.name; - return this.animationToMixTime.hasOwnProperty(key) ? this.animationToMixTime[key] : this.defaultMix; - } -}; - -spine.TrackEntry = function () {}; -spine.TrackEntry.prototype = { - next: null, previous: null, - animation: null, - loop: false, - delay: 0, time: 0, lastTime: -1, endTime: 0, - timeScale: 1, - mixTime: 0, mixDuration: 0, mix: 1, - onStart: null, onEnd: null, onComplete: null, onEvent: null -}; - -spine.AnimationState = function (stateData) { - this.data = stateData; - this.tracks = []; - this.events = []; -}; -spine.AnimationState.prototype = { - onStart: null, - onEnd: null, - onComplete: null, - onEvent: null, - timeScale: 1, - update: function (delta) { - delta *= this.timeScale; - for (var i = 0; i < this.tracks.length; i++) { - var current = this.tracks[i]; - if (!current) continue; - - current.time += delta * current.timeScale; - if (current.previous) { - var previousDelta = delta * current.previous.timeScale; - current.previous.time += previousDelta; - current.mixTime += previousDelta; - } - - var next = current.next; - if (next) { - next.time = current.lastTime - next.delay; - if (next.time >= 0) this.setCurrent(i, next); - } else { - // End non-looping animation when it reaches its end time and there is no next entry. - if (!current.loop && current.lastTime >= current.endTime) this.clearTrack(i); - } - } - }, - apply: function (skeleton) { - for (var i = 0; i < this.tracks.length; i++) { - var current = this.tracks[i]; - if (!current) continue; - - this.events.length = 0; - - var time = current.time; - var lastTime = current.lastTime; - var endTime = current.endTime; - var loop = current.loop; - if (!loop && time > endTime) time = endTime; - - var previous = current.previous; - if (!previous) { - if (current.mix == 1) - current.animation.apply(skeleton, current.lastTime, time, loop, this.events); - else - current.animation.mix(skeleton, current.lastTime, time, loop, this.events, current.mix); - } else { - var previousTime = previous.time; - if (!previous.loop && previousTime > previous.endTime) previousTime = previous.endTime; - previous.animation.apply(skeleton, previousTime, previousTime, previous.loop, null); - - var alpha = current.mixTime / current.mixDuration * current.mix; - if (alpha >= 1) { - alpha = 1; - current.previous = null; - } - current.animation.mix(skeleton, current.lastTime, time, loop, this.events, alpha); - } - - for (var ii = 0, nn = this.events.length; ii < nn; ii++) { - var event = this.events[ii]; - if (current.onEvent) current.onEvent(i, event); - if (this.onEvent) this.onEvent(i, event); - } - - // Check if completed the animation or a loop iteration. - if (loop ? (lastTime % endTime > time % endTime) : (lastTime < endTime && time >= endTime)) { - var count = Math.floor(time / endTime); - if (current.onComplete) current.onComplete(i, count); - if (this.onComplete) this.onComplete(i, count); - } - - current.lastTime = current.time; - } - }, - clearTracks: function () { - for (var i = 0, n = this.tracks.length; i < n; i++) - this.clearTrack(i); - this.tracks.length = 0; - }, - clearTrack: function (trackIndex) { - if (trackIndex >= this.tracks.length) return; - var current = this.tracks[trackIndex]; - if (!current) return; - - if (current.onEnd) current.onEnd(trackIndex); - if (this.onEnd) this.onEnd(trackIndex); - - this.tracks[trackIndex] = null; - }, - _expandToIndex: function (index) { - if (index < this.tracks.length) return this.tracks[index]; - while (index >= this.tracks.length) - this.tracks.push(null); - return null; - }, - setCurrent: function (index, entry) { - var current = this._expandToIndex(index); - if (current) { - var previous = current.previous; - current.previous = null; - - if (current.onEnd) current.onEnd(index); - if (this.onEnd) this.onEnd(index); - - entry.mixDuration = this.data.getMix(current.animation, entry.animation); - if (entry.mixDuration > 0) { - entry.mixTime = 0; - // If a mix is in progress, mix from the closest animation. - if (previous && current.mixTime / current.mixDuration < 0.5) - entry.previous = previous; - else - entry.previous = current; - } - } - - this.tracks[index] = entry; - - if (entry.onStart) entry.onStart(index); - if (this.onStart) this.onStart(index); - }, - setAnimationByName: function (trackIndex, animationName, loop) { - var animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) throw "Animation not found: " + animationName; - return this.setAnimation(trackIndex, animation, loop); - }, - /** Set the current animation. Any queued animations are cleared. */ - setAnimation: function (trackIndex, animation, loop) { - var entry = new spine.TrackEntry(); - entry.animation = animation; - entry.loop = loop; - entry.endTime = animation.duration; - this.setCurrent(trackIndex, entry); - return entry; - }, - addAnimationByName: function (trackIndex, animationName, loop, delay) { - var animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) throw "Animation not found: " + animationName; - return this.addAnimation(trackIndex, animation, loop, delay); - }, - /** Adds an animation to be played delay seconds after the current or last queued animation. - * @param delay May be <= 0 to use duration of previous animation minus any mix duration plus the negative delay. */ - addAnimation: function (trackIndex, animation, loop, delay) { - var entry = new spine.TrackEntry(); - entry.animation = animation; - entry.loop = loop; - entry.endTime = animation.duration; - - var last = this._expandToIndex(trackIndex); - if (last) { - while (last.next) - last = last.next; - last.next = entry; - } else - this.tracks[trackIndex] = entry; - - if (delay <= 0) { - if (last) - delay += last.endTime - this.data.getMix(last.animation, animation); - else - delay = 0; - } - entry.delay = delay; - - return entry; - }, - /** May be null. */ - getCurrent: function (trackIndex) { - if (trackIndex >= this.tracks.length) return null; - return this.tracks[trackIndex]; - } -}; - -spine.SkeletonJson = function (attachmentLoader) { - this.attachmentLoader = attachmentLoader; -}; -spine.SkeletonJson.prototype = { - scale: 1, - readSkeletonData: function (root, name) { - var skeletonData = new spine.SkeletonData(); - skeletonData.name = name; - - // Skeleton. - var skeletonMap = root["skeleton"]; - if (skeletonMap) { - skeletonData.hash = skeletonMap["hash"]; - skeletonData.version = skeletonMap["spine"]; - skeletonData.width = skeletonMap["width"] || 0; - skeletonData.height = skeletonMap["height"] || 0; - } - - // Bones. - var bones = root["bones"]; - for (var i = 0, n = bones.length; i < n; i++) { - var boneMap = bones[i]; - var parent = null; - if (boneMap["parent"]) { - parent = skeletonData.findBone(boneMap["parent"]); - if (!parent) throw "Parent bone not found: " + boneMap["parent"]; - } - var boneData = new spine.BoneData(boneMap["name"], parent); - boneData.length = (boneMap["length"] || 0) * this.scale; - boneData.x = (boneMap["x"] || 0) * this.scale; - boneData.y = (boneMap["y"] || 0) * this.scale; - boneData.rotation = (boneMap["rotation"] || 0); - boneData.scaleX = boneMap.hasOwnProperty("scaleX") ? boneMap["scaleX"] : 1; - boneData.scaleY = boneMap.hasOwnProperty("scaleY") ? boneMap["scaleY"] : 1; - boneData.inheritScale = boneMap.hasOwnProperty("inheritScale") ? boneMap["inheritScale"] : true; - boneData.inheritRotation = boneMap.hasOwnProperty("inheritRotation") ? boneMap["inheritRotation"] : true; - skeletonData.bones.push(boneData); - } - - // IK constraints. - var ik = root["ik"]; - if (ik) { - for (var i = 0, n = ik.length; i < n; i++) { - var ikMap = ik[i]; - var ikConstraintData = new spine.IkConstraintData(ikMap["name"]); - - var bones = ikMap["bones"]; - for (var ii = 0, nn = bones.length; ii < nn; ii++) { - var bone = skeletonData.findBone(bones[ii]); - if (!bone) throw "IK bone not found: " + bones[ii]; - ikConstraintData.bones.push(bone); - } - - ikConstraintData.target = skeletonData.findBone(ikMap["target"]); - if (!ikConstraintData.target) throw "Target bone not found: " + ikMap["target"]; - - ikConstraintData.bendDirection = (!ikMap.hasOwnProperty("bendPositive") || ikMap["bendPositive"]) ? 1 : -1; - ikConstraintData.mix = ikMap.hasOwnProperty("mix") ? ikMap["mix"] : 1; - - skeletonData.ikConstraints.push(ikConstraintData); - } - } - - // Slots. - var slots = root["slots"]; - for (var i = 0, n = slots.length; i < n; i++) { - var slotMap = slots[i]; - var boneData = skeletonData.findBone(slotMap["bone"]); - if (!boneData) throw "Slot bone not found: " + slotMap["bone"]; - var slotData = new spine.SlotData(slotMap["name"], boneData); - - var color = slotMap["color"]; - if (color) { - slotData.r = this.toColor(color, 0); - slotData.g = this.toColor(color, 1); - slotData.b = this.toColor(color, 2); - slotData.a = this.toColor(color, 3); - } - - slotData.attachmentName = slotMap["attachment"]; - slotData.additiveBlending = slotMap["additive"] && slotMap["additive"] == "true"; - - skeletonData.slots.push(slotData); - } - - // Skins. - var skins = root["skins"]; - for (var skinName in skins) { - if (!skins.hasOwnProperty(skinName)) continue; - var skinMap = skins[skinName]; - var skin = new spine.Skin(skinName); - for (var slotName in skinMap) { - if (!skinMap.hasOwnProperty(slotName)) continue; - var slotIndex = skeletonData.findSlotIndex(slotName); - var slotEntry = skinMap[slotName]; - for (var attachmentName in slotEntry) { - if (!slotEntry.hasOwnProperty(attachmentName)) continue; - var attachment = this.readAttachment(skin, attachmentName, slotEntry[attachmentName]); - if (attachment) skin.addAttachment(slotIndex, attachmentName, attachment); - } - } - skeletonData.skins.push(skin); - if (skin.name == "default") skeletonData.defaultSkin = skin; - } - - // Events. - var events = root["events"]; - for (var eventName in events) { - if (!events.hasOwnProperty(eventName)) continue; - var eventMap = events[eventName]; - var eventData = new spine.EventData(eventName); - eventData.intValue = eventMap["int"] || 0; - eventData.floatValue = eventMap["float"] || 0; - eventData.stringValue = eventMap["string"] || null; - skeletonData.events.push(eventData); - } - - // Animations. - var animations = root["animations"]; - for (var animationName in animations) { - if (!animations.hasOwnProperty(animationName)) continue; - this.readAnimation(animationName, animations[animationName], skeletonData); - } - - return skeletonData; - }, - readAttachment: function (skin, name, map) { - name = map["name"] || name; - - var type = spine.AttachmentType[map["type"] || "region"]; - var path = map["path"] || name; - - var scale = this.scale; - if (type == spine.AttachmentType.region) { - var region = this.attachmentLoader.newRegionAttachment(skin, name, path); - if (!region) return null; - region.path = path; - region.x = (map["x"] || 0) * scale; - region.y = (map["y"] || 0) * scale; - region.scaleX = map.hasOwnProperty("scaleX") ? map["scaleX"] : 1; - region.scaleY = map.hasOwnProperty("scaleY") ? map["scaleY"] : 1; - region.rotation = map["rotation"] || 0; - region.width = (map["width"] || 0) * scale; - region.height = (map["height"] || 0) * scale; - - var color = map["color"]; - if (color) { - region.r = this.toColor(color, 0); - region.g = this.toColor(color, 1); - region.b = this.toColor(color, 2); - region.a = this.toColor(color, 3); - } - - region.updateOffset(); - return region; - } else if (type == spine.AttachmentType.mesh) { - var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path); - if (!mesh) return null; - mesh.path = path; - mesh.vertices = this.getFloatArray(map, "vertices", scale); - mesh.triangles = this.getIntArray(map, "triangles"); - mesh.regionUVs = this.getFloatArray(map, "uvs", 1); - mesh.updateUVs(); - - color = map["color"]; - if (color) { - mesh.r = this.toColor(color, 0); - mesh.g = this.toColor(color, 1); - mesh.b = this.toColor(color, 2); - mesh.a = this.toColor(color, 3); - } - - mesh.hullLength = (map["hull"] || 0) * 2; - if (map["edges"]) mesh.edges = this.getIntArray(map, "edges"); - mesh.width = (map["width"] || 0) * scale; - mesh.height = (map["height"] || 0) * scale; - return mesh; - } else if (type == spine.AttachmentType.skinnedmesh) { - var mesh = this.attachmentLoader.newSkinnedMeshAttachment(skin, name, path); - if (!mesh) return null; - mesh.path = path; - - var uvs = this.getFloatArray(map, "uvs", 1); - var vertices = this.getFloatArray(map, "vertices", 1); - var weights = []; - var bones = []; - for (var i = 0, n = vertices.length; i < n; ) { - var boneCount = vertices[i++] | 0; - bones[bones.length] = boneCount; - for (var nn = i + boneCount * 4; i < nn; ) { - bones[bones.length] = vertices[i]; - weights[weights.length] = vertices[i + 1] * scale; - weights[weights.length] = vertices[i + 2] * scale; - weights[weights.length] = vertices[i + 3]; - i += 4; - } - } - mesh.bones = bones; - mesh.weights = weights; - mesh.triangles = this.getIntArray(map, "triangles"); - mesh.regionUVs = uvs; - mesh.updateUVs(); - - color = map["color"]; - if (color) { - mesh.r = this.toColor(color, 0); - mesh.g = this.toColor(color, 1); - mesh.b = this.toColor(color, 2); - mesh.a = this.toColor(color, 3); - } - - mesh.hullLength = (map["hull"] || 0) * 2; - if (map["edges"]) mesh.edges = this.getIntArray(map, "edges"); - mesh.width = (map["width"] || 0) * scale; - mesh.height = (map["height"] || 0) * scale; - return mesh; - } else if (type == spine.AttachmentType.boundingbox) { - var attachment = this.attachmentLoader.newBoundingBoxAttachment(skin, name); - var vertices = map["vertices"]; - for (var i = 0, n = vertices.length; i < n; i++) - attachment.vertices.push(vertices[i] * scale); - return attachment; - } - throw "Unknown attachment type: " + type; - }, - readAnimation: function (name, map, skeletonData) { - var timelines = []; - var duration = 0; - - var slots = map["slots"]; - for (var slotName in slots) { - if (!slots.hasOwnProperty(slotName)) continue; - var slotMap = slots[slotName]; - var slotIndex = skeletonData.findSlotIndex(slotName); - - for (var timelineName in slotMap) { - if (!slotMap.hasOwnProperty(timelineName)) continue; - var values = slotMap[timelineName]; - if (timelineName == "color") { - var timeline = new spine.ColorTimeline(values.length); - timeline.slotIndex = slotIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var color = valueMap["color"]; - var r = this.toColor(color, 0); - var g = this.toColor(color, 1); - var b = this.toColor(color, 2); - var a = this.toColor(color, 3); - timeline.setFrame(frameIndex, valueMap["time"], r, g, b, a); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 5 - 5]); - - } else if (timelineName == "attachment") { - var timeline = new spine.AttachmentTimeline(values.length); - timeline.slotIndex = slotIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex++, valueMap["time"], valueMap["name"]); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - - } else - throw "Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")"; - } - } - - var bones = map["bones"]; - for (var boneName in bones) { - if (!bones.hasOwnProperty(boneName)) continue; - var boneIndex = skeletonData.findBoneIndex(boneName); - if (boneIndex == -1) throw "Bone not found: " + boneName; - var boneMap = bones[boneName]; - - for (var timelineName in boneMap) { - if (!boneMap.hasOwnProperty(timelineName)) continue; - var values = boneMap[timelineName]; - if (timelineName == "rotate") { - var timeline = new spine.RotateTimeline(values.length); - timeline.boneIndex = boneIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex, valueMap["time"], valueMap["angle"]); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 2 - 2]); - - } else if (timelineName == "translate" || timelineName == "scale") { - var timeline; - var timelineScale = 1; - if (timelineName == "scale") - timeline = new spine.ScaleTimeline(values.length); - else { - timeline = new spine.TranslateTimeline(values.length); - timelineScale = this.scale; - } - timeline.boneIndex = boneIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var x = (valueMap["x"] || 0) * timelineScale; - var y = (valueMap["y"] || 0) * timelineScale; - timeline.setFrame(frameIndex, valueMap["time"], x, y); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 3 - 3]); - - } else if (timelineName == "flipX" || timelineName == "flipY") { - var x = timelineName == "flipX"; - var timeline = x ? new spine.FlipXTimeline(values.length) : new spine.FlipYTimeline(values.length); - timeline.boneIndex = boneIndex; - - var field = x ? "x" : "y"; - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex, valueMap["time"], valueMap[field] || false); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 2 - 2]); - } else - throw "Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")"; - } - } - - var ikMap = map["ik"]; - for (var ikConstraintName in ikMap) { - if (!ikMap.hasOwnProperty(ikConstraintName)) continue; - var ikConstraint = skeletonData.findIkConstraint(ikConstraintName); - var values = ikMap[ikConstraintName]; - var timeline = new spine.IkConstraintTimeline(values.length); - timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(ikConstraint); - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var mix = valueMap.hasOwnProperty("mix") ? valueMap["mix"] : 1; - var bendDirection = (!valueMap.hasOwnProperty("bendPositive") || valueMap["bendPositive"]) ? 1 : -1; - timeline.setFrame(frameIndex, valueMap["time"], mix, bendDirection); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.frameCount * 3 - 3]); - } - - var ffd = map["ffd"]; - for (var skinName in ffd) { - var skin = skeletonData.findSkin(skinName); - var slotMap = ffd[skinName]; - for (slotName in slotMap) { - var slotIndex = skeletonData.findSlotIndex(slotName); - var meshMap = slotMap[slotName]; - for (var meshName in meshMap) { - var values = meshMap[meshName]; - var timeline = new spine.FfdTimeline(values.length); - var attachment = skin.getAttachment(slotIndex, meshName); - if (!attachment) throw "FFD attachment not found: " + meshName; - timeline.slotIndex = slotIndex; - timeline.attachment = attachment; - - var isMesh = attachment.type == spine.AttachmentType.mesh; - var vertexCount; - if (isMesh) - vertexCount = attachment.vertices.length; - else - vertexCount = attachment.weights.length / 3 * 2; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var vertices; - if (!valueMap["vertices"]) { - if (isMesh) - vertices = attachment.vertices; - else { - vertices = []; - vertices.length = vertexCount; - } - } else { - var verticesValue = valueMap["vertices"]; - var vertices = []; - vertices.length = vertexCount; - var start = valueMap["offset"] || 0; - var nn = verticesValue.length; - if (this.scale == 1) { - for (var ii = 0; ii < nn; ii++) - vertices[ii + start] = verticesValue[ii]; - } else { - for (var ii = 0; ii < nn; ii++) - vertices[ii + start] = verticesValue[ii] * this.scale; - } - if (isMesh) { - var meshVertices = attachment.vertices; - for (var ii = 0, nn = vertices.length; ii < nn; ii++) - vertices[ii] += meshVertices[ii]; - } - } - - timeline.setFrame(frameIndex, valueMap["time"], vertices); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines[timelines.length] = timeline; - duration = Math.max(duration, timeline.frames[timeline.frameCount - 1]); - } - } - } - - var drawOrderValues = map["drawOrder"]; - if (!drawOrderValues) drawOrderValues = map["draworder"]; - if (drawOrderValues) { - var timeline = new spine.DrawOrderTimeline(drawOrderValues.length); - var slotCount = skeletonData.slots.length; - var frameIndex = 0; - for (var i = 0, n = drawOrderValues.length; i < n; i++) { - var drawOrderMap = drawOrderValues[i]; - var drawOrder = null; - if (drawOrderMap["offsets"]) { - drawOrder = []; - drawOrder.length = slotCount; - for (var ii = slotCount - 1; ii >= 0; ii--) - drawOrder[ii] = -1; - var offsets = drawOrderMap["offsets"]; - var unchanged = []; - unchanged.length = slotCount - offsets.length; - var originalIndex = 0, unchangedIndex = 0; - for (var ii = 0, nn = offsets.length; ii < nn; ii++) { - var offsetMap = offsets[ii]; - var slotIndex = skeletonData.findSlotIndex(offsetMap["slot"]); - if (slotIndex == -1) throw "Slot not found: " + offsetMap["slot"]; - // Collect unchanged items. - while (originalIndex != slotIndex) - unchanged[unchangedIndex++] = originalIndex++; - // Set changed items. - drawOrder[originalIndex + offsetMap["offset"]] = originalIndex++; - } - // Collect remaining unchanged items. - while (originalIndex < slotCount) - unchanged[unchangedIndex++] = originalIndex++; - // Fill in unchanged items. - for (var ii = slotCount - 1; ii >= 0; ii--) - if (drawOrder[ii] == -1) drawOrder[ii] = unchanged[--unchangedIndex]; - } - timeline.setFrame(frameIndex++, drawOrderMap["time"], drawOrder); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - - var events = map["events"]; - if (events) { - var timeline = new spine.EventTimeline(events.length); - var frameIndex = 0; - for (var i = 0, n = events.length; i < n; i++) { - var eventMap = events[i]; - var eventData = skeletonData.findEvent(eventMap["name"]); - if (!eventData) throw "Event not found: " + eventMap["name"]; - var event = new spine.Event(eventData); - event.intValue = eventMap.hasOwnProperty("int") ? eventMap["int"] : eventData.intValue; - event.floatValue = eventMap.hasOwnProperty("float") ? eventMap["float"] : eventData.floatValue; - event.stringValue = eventMap.hasOwnProperty("string") ? eventMap["string"] : eventData.stringValue; - timeline.setFrame(frameIndex++, eventMap["time"], event); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - - skeletonData.animations.push(new spine.Animation(name, timelines, duration)); - }, - readCurve: function (timeline, frameIndex, valueMap) { - var curve = valueMap["curve"]; - if (!curve) - timeline.curves.setLinear(frameIndex); - else if (curve == "stepped") - timeline.curves.setStepped(frameIndex); - else if (curve instanceof Array) - timeline.curves.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]); - }, - toColor: function (hexString, colorIndex) { - if (hexString.length != 8) throw "Color hexidecimal length must be 8, recieved: " + hexString; - return parseInt(hexString.substring(colorIndex * 2, (colorIndex * 2) + 2), 16) / 255; - }, - getFloatArray: function (map, name, scale) { - var list = map[name]; - var values = new spine.Float32Array(list.length); - var i = 0, n = list.length; - if (scale == 1) { - for (; i < n; i++) - values[i] = list[i]; - } else { - for (; i < n; i++) - values[i] = list[i] * scale; - } - return values; - }, - getIntArray: function (map, name) { - var list = map[name]; - var values = new spine.Uint16Array(list.length); - for (var i = 0, n = list.length; i < n; i++) - values[i] = list[i] | 0; - return values; - } -}; - -spine.Atlas = function (atlasText, textureLoader) { - this.textureLoader = textureLoader; - this.pages = []; - this.regions = []; - - var reader = new spine.AtlasReader(atlasText); - var tuple = []; - tuple.length = 4; - var page = null; - while (true) { - var line = reader.readLine(); - if (line === null) break; - line = reader.trim(line); - if (!line.length) - page = null; - else if (!page) { - page = new spine.AtlasPage(); - page.name = line; - - if (reader.readTuple(tuple) == 2) { // size is only optional for an atlas packed with an old TexturePacker. - page.width = parseInt(tuple[0]); - page.height = parseInt(tuple[1]); - reader.readTuple(tuple); - } - page.format = spine.Atlas.Format[tuple[0]]; - - reader.readTuple(tuple); - page.minFilter = spine.Atlas.TextureFilter[tuple[0]]; - page.magFilter = spine.Atlas.TextureFilter[tuple[1]]; - - var direction = reader.readValue(); - page.uWrap = spine.Atlas.TextureWrap.clampToEdge; - page.vWrap = spine.Atlas.TextureWrap.clampToEdge; - if (direction == "x") - page.uWrap = spine.Atlas.TextureWrap.repeat; - else if (direction == "y") - page.vWrap = spine.Atlas.TextureWrap.repeat; - else if (direction == "xy") - page.uWrap = page.vWrap = spine.Atlas.TextureWrap.repeat; - - textureLoader.load(page, line, this); - - this.pages.push(page); - - } else { - var region = new spine.AtlasRegion(); - region.name = line; - region.page = page; - - region.rotate = reader.readValue() == "true"; - - reader.readTuple(tuple); - var x = parseInt(tuple[0]); - var y = parseInt(tuple[1]); - - reader.readTuple(tuple); - var width = parseInt(tuple[0]); - var height = parseInt(tuple[1]); - - region.u = x / page.width; - region.v = y / page.height; - if (region.rotate) { - region.u2 = (x + height) / page.width; - region.v2 = (y + width) / page.height; - } else { - region.u2 = (x + width) / page.width; - region.v2 = (y + height) / page.height; - } - region.x = x; - region.y = y; - region.width = Math.abs(width); - region.height = Math.abs(height); - - if (reader.readTuple(tuple) == 4) { // split is optional - region.splits = [parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3])]; - - if (reader.readTuple(tuple) == 4) { // pad is optional, but only present with splits - region.pads = [parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3])]; - - reader.readTuple(tuple); - } - } - - region.originalWidth = parseInt(tuple[0]); - region.originalHeight = parseInt(tuple[1]); - - reader.readTuple(tuple); - region.offsetX = parseInt(tuple[0]); - region.offsetY = parseInt(tuple[1]); - - region.index = parseInt(reader.readValue()); - - this.regions.push(region); - } - } -}; -spine.Atlas.prototype = { - findRegion: function (name) { - var regions = this.regions; - for (var i = 0, n = regions.length; i < n; i++) - if (regions[i].name == name) return regions[i]; - return null; - }, - dispose: function () { - var pages = this.pages; - for (var i = 0, n = pages.length; i < n; i++) - this.textureLoader.unload(pages[i].rendererObject); - }, - updateUVs: function (page) { - var regions = this.regions; - for (var i = 0, n = regions.length; i < n; i++) { - var region = regions[i]; - if (region.page != page) continue; - region.u = region.x / page.width; - region.v = region.y / page.height; - if (region.rotate) { - region.u2 = (region.x + region.height) / page.width; - region.v2 = (region.y + region.width) / page.height; - } else { - region.u2 = (region.x + region.width) / page.width; - region.v2 = (region.y + region.height) / page.height; - } - } - } -}; - -spine.Atlas.Format = { - alpha: 0, - intensity: 1, - luminanceAlpha: 2, - rgb565: 3, - rgba4444: 4, - rgb888: 5, - rgba8888: 6 -}; - -spine.Atlas.TextureFilter = { - nearest: 0, - linear: 1, - mipMap: 2, - mipMapNearestNearest: 3, - mipMapLinearNearest: 4, - mipMapNearestLinear: 5, - mipMapLinearLinear: 6 -}; - -spine.Atlas.TextureWrap = { - mirroredRepeat: 0, - clampToEdge: 1, - repeat: 2 -}; - -spine.AtlasPage = function () {}; -spine.AtlasPage.prototype = { - name: null, - format: null, - minFilter: null, - magFilter: null, - uWrap: null, - vWrap: null, - rendererObject: null, - width: 0, - height: 0 -}; - -spine.AtlasRegion = function () {}; -spine.AtlasRegion.prototype = { - page: null, - name: null, - x: 0, y: 0, - width: 0, height: 0, - u: 0, v: 0, u2: 0, v2: 0, - offsetX: 0, offsetY: 0, - originalWidth: 0, originalHeight: 0, - index: 0, - rotate: false, - splits: null, - pads: null -}; - -spine.AtlasReader = function (text) { - this.lines = text.split(/\r\n|\r|\n/); -}; -spine.AtlasReader.prototype = { - index: 0, - trim: function (value) { - return value.replace(/^\s+|\s+$/g, ""); - }, - readLine: function () { - if (this.index >= this.lines.length) return null; - return this.lines[this.index++]; - }, - readValue: function () { - var line = this.readLine(); - var colon = line.indexOf(":"); - if (colon == -1) throw "Invalid line: " + line; - return this.trim(line.substring(colon + 1)); - }, - /** Returns the number of tuple values read (1, 2 or 4). */ - readTuple: function (tuple) { - var line = this.readLine(); - var colon = line.indexOf(":"); - if (colon == -1) throw "Invalid line: " + line; - var i = 0, lastMatch = colon + 1; - for (; i < 3; i++) { - var comma = line.indexOf(",", lastMatch); - if (comma == -1) break; - tuple[i] = this.trim(line.substr(lastMatch, comma - lastMatch)); - lastMatch = comma + 1; - } - tuple[i] = this.trim(line.substring(lastMatch)); - return i + 1; - } -}; - -spine.AtlasAttachmentLoader = function (atlas) { - this.atlas = atlas; -}; -spine.AtlasAttachmentLoader.prototype = { - newRegionAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (region attachment: " + name + ")"; - var attachment = new spine.RegionAttachment(name); - attachment.rendererObject = region; - attachment.setUVs(region.u, region.v, region.u2, region.v2, region.rotate); - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newMeshAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (mesh attachment: " + name + ")"; - var attachment = new spine.MeshAttachment(name); - attachment.rendererObject = region; - attachment.regionU = region.u; - attachment.regionV = region.v; - attachment.regionU2 = region.u2; - attachment.regionV2 = region.v2; - attachment.regionRotate = region.rotate; - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newSkinnedMeshAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (skinned mesh attachment: " + name + ")"; - var attachment = new spine.SkinnedMeshAttachment(name); - attachment.rendererObject = region; - attachment.regionU = region.u; - attachment.regionV = region.v; - attachment.regionU2 = region.u2; - attachment.regionV2 = region.v2; - attachment.regionRotate = region.rotate; - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newBoundingBoxAttachment: function (skin, name) { - return new spine.BoundingBoxAttachment(name); - } -}; - -spine.SkeletonBounds = function () { - this.polygonPool = []; - this.polygons = []; - this.boundingBoxes = []; -}; -spine.SkeletonBounds.prototype = { - minX: 0, minY: 0, maxX: 0, maxY: 0, - update: function (skeleton, updateAabb) { - var slots = skeleton.slots; - var slotCount = slots.length; - var x = skeleton.x, y = skeleton.y; - var boundingBoxes = this.boundingBoxes; - var polygonPool = this.polygonPool; - var polygons = this.polygons; - - boundingBoxes.length = 0; - for (var i = 0, n = polygons.length; i < n; i++) - polygonPool.push(polygons[i]); - polygons.length = 0; - - for (var i = 0; i < slotCount; i++) { - var slot = slots[i]; - var boundingBox = slot.attachment; - if (boundingBox.type != spine.AttachmentType.boundingbox) continue; - boundingBoxes.push(boundingBox); - - var poolCount = polygonPool.length, polygon; - if (poolCount > 0) { - polygon = polygonPool[poolCount - 1]; - polygonPool.splice(poolCount - 1, 1); - } else - polygon = []; - polygons.push(polygon); - - polygon.length = boundingBox.vertices.length; - boundingBox.computeWorldVertices(x, y, slot.bone, polygon); - } - - if (updateAabb) this.aabbCompute(); - }, - aabbCompute: function () { - var polygons = this.polygons; - var minX = Number.MAX_VALUE, minY = Number.MAX_VALUE, maxX = Number.MIN_VALUE, maxY = Number.MIN_VALUE; - for (var i = 0, n = polygons.length; i < n; i++) { - var vertices = polygons[i]; - for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) { - var x = vertices[ii]; - var y = vertices[ii + 1]; - minX = Math.min(minX, x); - minY = Math.min(minY, y); - maxX = Math.max(maxX, x); - maxY = Math.max(maxY, y); - } - } - this.minX = minX; - this.minY = minY; - this.maxX = maxX; - this.maxY = maxY; - }, - /** Returns true if the axis aligned bounding box contains the point. */ - aabbContainsPoint: function (x, y) { - return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY; - }, - /** Returns true if the axis aligned bounding box intersects the line segment. */ - aabbIntersectsSegment: function (x1, y1, x2, y2) { - var minX = this.minX, minY = this.minY, maxX = this.maxX, maxY = this.maxY; - if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY)) - return false; - var m = (y2 - y1) / (x2 - x1); - var y = m * (minX - x1) + y1; - if (y > minY && y < maxY) return true; - y = m * (maxX - x1) + y1; - if (y > minY && y < maxY) return true; - var x = (minY - y1) / m + x1; - if (x > minX && x < maxX) return true; - x = (maxY - y1) / m + x1; - if (x > minX && x < maxX) return true; - return false; - }, - /** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */ - aabbIntersectsSkeleton: function (bounds) { - return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY; - }, - /** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more - * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */ - containsPoint: function (x, y) { - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) - if (this.polygonContainsPoint(polygons[i], x, y)) return this.boundingBoxes[i]; - return null; - }, - /** Returns the first bounding box attachment that contains the line segment, or null. When doing many checks, it is usually - * more efficient to only call this method if {@link #aabbIntersectsSegment(float, float, float, float)} returns true. */ - intersectsSegment: function (x1, y1, x2, y2) { - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) - if (polygons[i].intersectsSegment(x1, y1, x2, y2)) return this.boundingBoxes[i]; - return null; - }, - /** Returns true if the polygon contains the point. */ - polygonContainsPoint: function (polygon, x, y) { - var nn = polygon.length; - var prevIndex = nn - 2; - var inside = false; - for (var ii = 0; ii < nn; ii += 2) { - var vertexY = polygon[ii + 1]; - var prevY = polygon[prevIndex + 1]; - if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) { - var vertexX = polygon[ii]; - if (vertexX + (y - vertexY) / (prevY - vertexY) * (polygon[prevIndex] - vertexX) < x) inside = !inside; - } - prevIndex = ii; - } - return inside; - }, - /** Returns true if the polygon contains the line segment. */ - polygonIntersectsSegment: function (polygon, x1, y1, x2, y2) { - var nn = polygon.length; - var width12 = x1 - x2, height12 = y1 - y2; - var det1 = x1 * y2 - y1 * x2; - var x3 = polygon[nn - 2], y3 = polygon[nn - 1]; - for (var ii = 0; ii < nn; ii += 2) { - var x4 = polygon[ii], y4 = polygon[ii + 1]; - var det2 = x3 * y4 - y3 * x4; - var width34 = x3 - x4, height34 = y3 - y4; - var det3 = width12 * height34 - height12 * width34; - var x = (det1 * width34 - width12 * det2) / det3; - if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) { - var y = (det1 * height34 - height12 * det2) / det3; - if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) return true; - } - x3 = x4; - y3 = y4; - } - return false; - }, - getPolygon: function (attachment) { - var index = this.boundingBoxes.indexOf(attachment); - return index == -1 ? null : this.polygons[index]; - }, - getWidth: function () { - return this.maxX - this.minX; - }, - getHeight: function () { - return this.maxY - this.minY; - } -}; - -/* Esoteric Software SPINE wrapper for pixi.js */ - -spine.Bone.yDown = true; -PIXI.AnimCache = {}; - -/** - * Supporting class to load images from spine atlases as per spine spec. - * - * @class SpineTextureLoader - * @uses EventTarget - * @constructor - * @param basePath {String} Tha base path where to look for the images to be loaded - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.SpineTextureLoader = function(basePath, crossorigin) -{ - PIXI.EventTarget.call(this); - - this.basePath = basePath; - this.crossorigin = crossorigin; - this.loadingCount = 0; -}; - -/* constructor */ -PIXI.SpineTextureLoader.prototype = PIXI.SpineTextureLoader; - -/** - * Starts loading a base texture as per spine specification - * - * @method load - * @param page {spine.AtlasPage} Atlas page to which texture belongs - * @param file {String} The file to load, this is just the file path relative to the base path configured in the constructor - */ -PIXI.SpineTextureLoader.prototype.load = function(page, file) -{ - page.rendererObject = PIXI.BaseTexture.fromImage(this.basePath + '/' + file, this.crossorigin); - if (!page.rendererObject.hasLoaded) - { - var scope = this; - ++scope.loadingCount; - page.rendererObject.addEventListener('loaded', function(){ - --scope.loadingCount; - scope.dispatchEvent({ - type: 'loadedBaseTexture', - content: scope - }); - }); - } -}; - -/** - * Unloads a previously loaded texture as per spine specification - * - * @method unload - * @param texture {BaseTexture} Texture object to destroy - */ -PIXI.SpineTextureLoader.prototype.unload = function(texture) -{ - texture.destroy(true); -}; - -/** - * A class that enables the you to import and run your spine animations in pixi. - * Spine animation data needs to be loaded using the PIXI.AssetLoader or PIXI.SpineLoader before it can be used by this class - * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source - * - * @class Spine - * @extends DisplayObjectContainer - * @constructor - * @param url {String} The url of the spine anim file to be used - */ -PIXI.Spine = function (url) { - PIXI.DisplayObjectContainer.call(this); - - this.spineData = PIXI.AnimCache[url]; - - if (!this.spineData) { - throw new Error('Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: ' + url); - } - - this.skeleton = new spine.Skeleton(this.spineData); - this.skeleton.updateWorldTransform(); - - this.stateData = new spine.AnimationStateData(this.spineData); - this.state = new spine.AnimationState(this.stateData); - - this.slotContainers = []; - - for (var i = 0, n = this.skeleton.drawOrder.length; i < n; i++) { - var slot = this.skeleton.drawOrder[i]; - var attachment = slot.attachment; - var slotContainer = new PIXI.DisplayObjectContainer(); - this.slotContainers.push(slotContainer); - this.addChild(slotContainer); - - if (attachment instanceof spine.RegionAttachment) - { - var spriteName = attachment.rendererObject.name; - var sprite = this.createSprite(slot, attachment); - slot.currentSprite = sprite; - slot.currentSpriteName = spriteName; - slotContainer.addChild(sprite); - } - else if (attachment instanceof spine.MeshAttachment) - { - var mesh = this.createMesh(slot, attachment); - slot.currentMesh = mesh; - slot.currentMeshName = attachment.name; - slotContainer.addChild(mesh); - } - else - { - continue; - } - - } - - this.autoUpdate = true; -}; - -PIXI.Spine.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); -PIXI.Spine.prototype.constructor = PIXI.Spine; - -/** - * If this flag is set to true, the spine animation will be autoupdated every time - * the object id drawn. The down side of this approach is that the delta time is - * automatically calculated and you could miss out on cool effects like slow motion, - * pause, skip ahead and the sorts. Most of these effects can be achieved even with - * autoupdate enabled but are harder to achieve. - * - * @property autoUpdate - * @type { Boolean } - * @default true - */ -Object.defineProperty(PIXI.Spine.prototype, 'autoUpdate', { - get: function() - { - return (this.updateTransform === PIXI.Spine.prototype.autoUpdateTransform); - }, - - set: function(value) - { - this.updateTransform = value ? PIXI.Spine.prototype.autoUpdateTransform : PIXI.DisplayObjectContainer.prototype.updateTransform; - } -}); - -/** - * Update the spine skeleton and its animations by delta time (dt) - * - * @method update - * @param dt {Number} Delta time. Time by which the animation should be updated - */ -PIXI.Spine.prototype.update = function(dt) -{ - this.state.update(dt); - this.state.apply(this.skeleton); - this.skeleton.updateWorldTransform(); - - var drawOrder = this.skeleton.drawOrder; - for (var i = 0, n = drawOrder.length; i < n; i++) { - var slot = drawOrder[i]; - var attachment = slot.attachment; - var slotContainer = this.slotContainers[i]; - - if (!attachment) - { - slotContainer.visible = false; - continue; - } - - var type = attachment.type; - if (type === spine.AttachmentType.region) - { - if (attachment.rendererObject) - { - if (!slot.currentSpriteName || slot.currentSpriteName !== attachment.name) - { - var spriteName = attachment.rendererObject.name; - if (slot.currentSprite !== undefined) - { - slot.currentSprite.visible = false; - } - slot.sprites = slot.sprites || {}; - if (slot.sprites[spriteName] !== undefined) - { - slot.sprites[spriteName].visible = true; - } - else - { - var sprite = this.createSprite(slot, attachment); - slotContainer.addChild(sprite); - } - slot.currentSprite = slot.sprites[spriteName]; - slot.currentSpriteName = spriteName; - } - } - - var bone = slot.bone; - - slotContainer.position.x = bone.worldX + attachment.x * bone.m00 + attachment.y * bone.m01; - slotContainer.position.y = bone.worldY + attachment.x * bone.m10 + attachment.y * bone.m11; - slotContainer.scale.x = bone.worldScaleX; - slotContainer.scale.y = bone.worldScaleY; - - slotContainer.rotation = -(slot.bone.worldRotation * spine.degRad); - - slot.currentSprite.tint = PIXI.rgb2hex([slot.r,slot.g,slot.b]); - } - else if (type === spine.AttachmentType.skinnedmesh) - { - if (!slot.currentMeshName || slot.currentMeshName !== attachment.name) - { - var meshName = attachment.name; - if (slot.currentMesh !== undefined) - { - slot.currentMesh.visible = false; - } - - slot.meshes = slot.meshes || {}; - - if (slot.meshes[meshName] !== undefined) - { - slot.meshes[meshName].visible = true; - } - else - { - var mesh = this.createMesh(slot, attachment); - slotContainer.addChild(mesh); - } - - slot.currentMesh = slot.meshes[meshName]; - slot.currentMeshName = meshName; - } - - attachment.computeWorldVertices(slot.bone.skeleton.x, slot.bone.skeleton.y, slot, slot.currentMesh.vertices); - - } - else - { - slotContainer.visible = false; - continue; - } - slotContainer.visible = true; - - slotContainer.alpha = slot.a; - } -}; - -/** - * When autoupdate is set to yes this function is used as pixi's updateTransform function - * - * @method autoUpdateTransform - * @private - */ -PIXI.Spine.prototype.autoUpdateTransform = function () { - this.lastTime = this.lastTime || Date.now(); - var timeDelta = (Date.now() - this.lastTime) * 0.001; - this.lastTime = Date.now(); - - this.update(timeDelta); - - PIXI.DisplayObjectContainer.prototype.updateTransform.call(this); -}; - -/** - * Create a new sprite to be used with spine.RegionAttachment - * - * @method createSprite - * @param slot {spine.Slot} The slot to which the attachment is parented - * @param attachment {spine.RegionAttachment} The attachment that the sprite will represent - * @private - */ -PIXI.Spine.prototype.createSprite = function (slot, attachment) { - var descriptor = attachment.rendererObject; - var baseTexture = descriptor.page.rendererObject; - var spriteRect = new PIXI.Rectangle(descriptor.x, - descriptor.y, - descriptor.rotate ? descriptor.height : descriptor.width, - descriptor.rotate ? descriptor.width : descriptor.height); - var spriteTexture = new PIXI.Texture(baseTexture, spriteRect); - var sprite = new PIXI.Sprite(spriteTexture); - - var baseRotation = descriptor.rotate ? Math.PI * 0.5 : 0.0; - sprite.scale.set(descriptor.width / descriptor.originalWidth, descriptor.height / descriptor.originalHeight); - sprite.rotation = baseRotation - (attachment.rotation * spine.degRad); - sprite.anchor.x = sprite.anchor.y = 0.5; - - slot.sprites = slot.sprites || {}; - slot.sprites[descriptor.name] = sprite; - return sprite; -}; - -PIXI.Spine.prototype.createMesh = function (slot, attachment) { - var descriptor = attachment.rendererObject; - var baseTexture = descriptor.page.rendererObject; - var texture = new PIXI.Texture(baseTexture); - - var strip = new PIXI.Strip(texture); - strip.drawMode = PIXI.Strip.DrawModes.TRIANGLES; - strip.canvasPadding = 1.5; - - strip.vertices = new PIXI.Float32Array(attachment.uvs.length); - strip.uvs = attachment.uvs; - strip.indices = attachment.triangles; - - slot.meshes = slot.meshes || {}; - slot.meshes[attachment.name] = strip; - - return strip; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -PIXI.BaseTextureCache = {}; - -PIXI.BaseTextureCacheIdGenerator = 0; - -/** - * A texture stores the information that represents an image. All textures have a base texture. - * - * @class BaseTexture - * @uses EventTarget - * @constructor - * @param source {String} the source object (image or canvas) - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - */ -PIXI.BaseTexture = function(source, scaleMode) -{ - /** - * The Resolution of the texture. - * - * @property resolution - * @type Number - */ - this.resolution = 1; - - /** - * [read-only] The width of the base texture set when the image has loaded - * - * @property width - * @type Number - * @readOnly - */ - this.width = 100; - - /** - * [read-only] The height of the base texture set when the image has loaded - * - * @property height - * @type Number - * @readOnly - */ - this.height = 100; - - /** - * The scale mode to apply when scaling this texture - * - * @property scaleMode - * @type {Number} - * @default PIXI.scaleModes.LINEAR - */ - this.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - /** - * [read-only] Set to true once the base texture has loaded - * - * @property hasLoaded - * @type Boolean - * @readOnly - */ - this.hasLoaded = false; - - /** - * The image source that is used to create the texture. - * - * @property source - * @type Image - */ - this.source = source; - - this._UID = PIXI._UID++; - - /** - * Controls if RGB channels should be pre-multiplied by Alpha (WebGL only) - * - * @property premultipliedAlpha - * @type Boolean - * @default true - */ - this.premultipliedAlpha = true; - - // used for webGL - - /** - * @property _glTextures - * @type Array - * @private - */ - this._glTextures = []; - - /** - * - * Set this to true if a mipmap of this texture needs to be generated. This value needs to be set before the texture is used - * Also the texture must be a power of two size to work - * - * @property mipmap - * @type {Boolean} - */ - this.mipmap = false; - - // used for webGL texture updating... - // TODO - this needs to be addressed - - /** - * @property _dirty - * @type Array - * @private - */ - this._dirty = [true, true, true, true]; - - if(!source)return; - - if((this.source.complete || this.source.getContext) && this.source.width && this.source.height) - { - this.hasLoaded = true; - this.width = this.source.naturalWidth || this.source.width; - this.height = this.source.naturalHeight || this.source.height; - this.dirty(); - } - else - { - var scope = this; - - this.source.onload = function() { - - scope.hasLoaded = true; - scope.width = scope.source.naturalWidth || scope.source.width; - scope.height = scope.source.naturalHeight || scope.source.height; - - scope.dirty(); - - // add it to somewhere... - scope.dispatchEvent( { type: 'loaded', content: scope } ); - }; - - this.source.onerror = function() { - scope.dispatchEvent( { type: 'error', content: scope } ); - }; - } - - /** - * @property imageUrl - * @type String - */ - this.imageUrl = null; - - /** - * @property _powerOf2 - * @type Boolean - * @private - */ - this._powerOf2 = false; - -}; - -PIXI.BaseTexture.prototype.constructor = PIXI.BaseTexture; - -PIXI.EventTarget.mixin(PIXI.BaseTexture.prototype); - -/** - * Destroys this base texture - * - * @method destroy - */ -PIXI.BaseTexture.prototype.destroy = function() -{ - if(this.imageUrl) - { - delete PIXI.BaseTextureCache[this.imageUrl]; - delete PIXI.TextureCache[this.imageUrl]; - this.imageUrl = null; - if (!navigator.isCocoonJS) this.source.src = ''; - } - else if (this.source && this.source._pixiId) - { - delete PIXI.BaseTextureCache[this.source._pixiId]; - } - this.source = null; - - this.unloadFromGPU(); -}; - -/** - * Changes the source image of the texture - * - * @method updateSourceImage - * @param newSrc {String} the path of the image - */ -PIXI.BaseTexture.prototype.updateSourceImage = function(newSrc) -{ - this.hasLoaded = false; - this.source.src = null; - this.source.src = newSrc; -}; - -/** - * Sets all glTextures to be dirty. - * - * @method dirty - */ -PIXI.BaseTexture.prototype.dirty = function() -{ - for (var i = 0; i < this._glTextures.length; i++) - { - this._dirty[i] = true; - } -}; - -/** - * Removes the base texture from the GPU, useful for managing resources on the GPU. - * Atexture is still 100% usable and will simply be reuploaded if there is a sprite on screen that is using it. - * - * @method unloadFromGPU - */ -PIXI.BaseTexture.prototype.unloadFromGPU = function() -{ - this.dirty(); - - // delete the webGL textures if any. - for (var i = this._glTextures.length - 1; i >= 0; i--) - { - var glTexture = this._glTextures[i]; - var gl = PIXI.glContexts[i]; - - if(gl && glTexture) - { - gl.deleteTexture(glTexture); - } - - } - - this._glTextures.length = 0; - - this.dirty(); -}; - -/** - * Helper function that creates a base texture from the given image url. - * If the image is not in the base texture cache it will be created and loaded. - * - * @static - * @method fromImage - * @param imageUrl {String} The image url of the texture - * @param crossorigin {Boolean} - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return BaseTexture - */ -PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode) -{ - var baseTexture = PIXI.BaseTextureCache[imageUrl]; - - if(crossorigin === undefined && imageUrl.indexOf('data:') === -1) crossorigin = true; - - if(!baseTexture) - { - // new Image() breaks tex loading in some versions of Chrome. - // See https://code.google.com/p/chromium/issues/detail?id=238071 - var image = new Image();//document.createElement('img'); - if (crossorigin) - { - image.crossOrigin = ''; - } - - image.src = imageUrl; - baseTexture = new PIXI.BaseTexture(image, scaleMode); - baseTexture.imageUrl = imageUrl; - PIXI.BaseTextureCache[imageUrl] = baseTexture; - - // if there is an @2x at the end of the url we are going to assume its a highres image - if( imageUrl.indexOf(PIXI.RETINA_PREFIX + '.') !== -1) - { - baseTexture.resolution = 2; - } - } - - return baseTexture; -}; - -/** - * Helper function that creates a base texture from the given canvas element. - * - * @static - * @method fromCanvas - * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return BaseTexture - */ -PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode) -{ - if(!canvas._pixiId) - { - canvas._pixiId = 'canvas_' + PIXI.TextureCacheIdGenerator++; - } - - var baseTexture = PIXI.BaseTextureCache[canvas._pixiId]; - - if(!baseTexture) - { - baseTexture = new PIXI.BaseTexture(canvas, scaleMode); - PIXI.BaseTextureCache[canvas._pixiId] = baseTexture; - } - - return baseTexture; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -PIXI.TextureCache = {}; -PIXI.FrameCache = {}; - -PIXI.TextureCacheIdGenerator = 0; - -/** - * A texture stores the information that represents an image or part of an image. It cannot be added - * to the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used. - * - * @class Texture - * @uses EventTarget - * @constructor - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle - */ -PIXI.Texture = function(baseTexture, frame, crop, trim) -{ - /** - * Does this Texture have any frame data assigned to it? - * - * @property noFrame - * @type Boolean - */ - this.noFrame = false; - - if (!frame) - { - this.noFrame = true; - frame = new PIXI.Rectangle(0,0,1,1); - } - - if (baseTexture instanceof PIXI.Texture) - { - baseTexture = baseTexture.baseTexture; - } - - /** - * The base texture that this texture uses. - * - * @property baseTexture - * @type BaseTexture - */ - this.baseTexture = baseTexture; - - /** - * The frame specifies the region of the base texture that this texture uses - * - * @property frame - * @type Rectangle - */ - this.frame = frame; - - /** - * The texture trim data. - * - * @property trim - * @type Rectangle - */ - this.trim = trim; - - /** - * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. - * - * @property valid - * @type Boolean - */ - this.valid = false; - - /** - * This will let a renderer know that a texture has been updated (used mainly for webGL uv updates) - * - * @property requiresUpdate - * @type Boolean - */ - this.requiresUpdate = false; - - /** - * The WebGL UV data cache. - * - * @property _uvs - * @type Object - * @private - */ - this._uvs = null; - - /** - * The width of the Texture in pixels. - * - * @property width - * @type Number - */ - this.width = 0; - - /** - * The height of the Texture in pixels. - * - * @property height - * @type Number - */ - this.height = 0; - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @property crop - * @type Rectangle - */ - this.crop = crop || new PIXI.Rectangle(0, 0, 1, 1); - - if (baseTexture.hasLoaded) - { - if (this.noFrame) frame = new PIXI.Rectangle(0, 0, baseTexture.width, baseTexture.height); - this.setFrame(frame); - } - else - { - baseTexture.addEventListener('loaded', this.onBaseTextureLoaded.bind(this)); - } -}; - -PIXI.Texture.prototype.constructor = PIXI.Texture; -PIXI.EventTarget.mixin(PIXI.Texture.prototype); - -/** - * Called when the base texture is loaded - * - * @method onBaseTextureLoaded - * @private - */ -PIXI.Texture.prototype.onBaseTextureLoaded = function() -{ - var baseTexture = this.baseTexture; - baseTexture.removeEventListener('loaded', this.onLoaded); - - if (this.noFrame) this.frame = new PIXI.Rectangle(0, 0, baseTexture.width, baseTexture.height); - - this.setFrame(this.frame); - - this.dispatchEvent( { type: 'update', content: this } ); -}; - -/** - * Destroys this texture - * - * @method destroy - * @param destroyBase {Boolean} Whether to destroy the base texture as well - */ -PIXI.Texture.prototype.destroy = function(destroyBase) -{ - if (destroyBase) this.baseTexture.destroy(); - - this.valid = false; -}; - -/** - * Specifies the region of the baseTexture that this texture will use. - * - * @method setFrame - * @param frame {Rectangle} The frame of the texture to set it to - */ -PIXI.Texture.prototype.setFrame = function(frame) -{ - this.noFrame = false; - - this.frame = frame; - this.width = frame.width; - this.height = frame.height; - - this.crop.x = frame.x; - this.crop.y = frame.y; - this.crop.width = frame.width; - this.crop.height = frame.height; - - if (!this.trim && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) - { - throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); - } - - this.valid = frame && frame.width && frame.height && this.baseTexture.source && this.baseTexture.hasLoaded; - - if (this.trim) - { - this.width = this.trim.width; - this.height = this.trim.height; - this.frame.width = this.trim.width; - this.frame.height = this.trim.height; - } - - if (this.valid) this._updateUvs(); - -}; - -/** - * Updates the internal WebGL UV cache. - * - * @method _updateUvs - * @private - */ -PIXI.Texture.prototype._updateUvs = function() -{ - if(!this._uvs)this._uvs = new PIXI.TextureUvs(); - - var frame = this.crop; - var tw = this.baseTexture.width; - var th = this.baseTexture.height; - - this._uvs.x0 = frame.x / tw; - this._uvs.y0 = frame.y / th; - - this._uvs.x1 = (frame.x + frame.width) / tw; - this._uvs.y1 = frame.y / th; - - this._uvs.x2 = (frame.x + frame.width) / tw; - this._uvs.y2 = (frame.y + frame.height) / th; - - this._uvs.x3 = frame.x / tw; - this._uvs.y3 = (frame.y + frame.height) / th; -}; - -/** - * Helper function that creates a Texture object from the given image url. - * If the image is not in the texture cache it will be created and loaded. - * - * @static - * @method fromImage - * @param imageUrl {String} The image url of the texture - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return Texture - */ -PIXI.Texture.fromImage = function(imageUrl, crossorigin, scaleMode) -{ - var texture = PIXI.TextureCache[imageUrl]; - - if(!texture) - { - texture = new PIXI.Texture(PIXI.BaseTexture.fromImage(imageUrl, crossorigin, scaleMode)); - PIXI.TextureCache[imageUrl] = texture; - } - - return texture; -}; - -/** - * Helper function that returns a Texture objected based on the given frame id. - * If the frame id is not in the texture cache an error will be thrown. - * - * @static - * @method fromFrame - * @param frameId {String} The frame id of the texture - * @return Texture - */ -PIXI.Texture.fromFrame = function(frameId) -{ - var texture = PIXI.TextureCache[frameId]; - if(!texture) throw new Error('The frameId "' + frameId + '" does not exist in the texture cache '); - return texture; -}; - -/** - * Helper function that creates a new a Texture based on the given canvas element. - * - * @static - * @method fromCanvas - * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return Texture - */ -PIXI.Texture.fromCanvas = function(canvas, scaleMode) -{ - var baseTexture = PIXI.BaseTexture.fromCanvas(canvas, scaleMode); - - return new PIXI.Texture( baseTexture ); - -}; - -/** - * Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object. - * - * @static - * @method addTextureToCache - * @param texture {Texture} The Texture to add to the cache. - * @param id {String} The id that the texture will be stored against. - */ -PIXI.Texture.addTextureToCache = function(texture, id) -{ - PIXI.TextureCache[id] = texture; -}; - -/** - * Remove a texture from the global PIXI.TextureCache. - * - * @static - * @method removeTextureFromCache - * @param id {String} The id of the texture to be removed - * @return {Texture} The texture that was removed - */ -PIXI.Texture.removeTextureFromCache = function(id) -{ - var texture = PIXI.TextureCache[id]; - delete PIXI.TextureCache[id]; - delete PIXI.BaseTextureCache[id]; - return texture; -}; - -PIXI.TextureUvs = function() -{ - this.x0 = 0; - this.y0 = 0; - - this.x1 = 0; - this.y1 = 0; - - this.x2 = 0; - this.y2 = 0; - - this.x3 = 0; - this.y3 = 0; -}; - -PIXI.Texture.emptyTexture = new PIXI.Texture(new PIXI.BaseTexture()); - - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A RenderTexture is a special texture that allows any Pixi display object to be rendered to it. - * - * __Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead. - * - * A RenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example: - * - * var renderTexture = new PIXI.RenderTexture(800, 600); - * var sprite = PIXI.Sprite.fromImage("spinObj_01.png"); - * sprite.position.x = 800/2; - * sprite.position.y = 600/2; - * sprite.anchor.x = 0.5; - * sprite.anchor.y = 0.5; - * renderTexture.render(sprite); - * - * The Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual position a DisplayObjectContainer should be used: - * - * var doc = new PIXI.DisplayObjectContainer(); - * doc.addChild(sprite); - * renderTexture.render(doc); // Renders to center of renderTexture - * - * @class RenderTexture - * @extends Texture - * @constructor - * @param width {Number} The width of the render texture - * @param height {Number} The height of the render texture - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @param resolution {Number} The resolution of the texture being generated - */ -PIXI.RenderTexture = function(width, height, renderer, scaleMode, resolution) -{ - /** - * The with of the render texture - * - * @property width - * @type Number - */ - this.width = width || 100; - - /** - * The height of the render texture - * - * @property height - * @type Number - */ - this.height = height || 100; - - /** - * The Resolution of the texture. - * - * @property resolution - * @type Number - */ - this.resolution = resolution || 1; - - /** - * The framing rectangle of the render texture - * - * @property frame - * @type Rectangle - */ - this.frame = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @property crop - * @type Rectangle - */ - this.crop = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * The base texture object that this texture uses - * - * @property baseTexture - * @type BaseTexture - */ - this.baseTexture = new PIXI.BaseTexture(); - this.baseTexture.width = this.width * this.resolution; - this.baseTexture.height = this.height * this.resolution; - this.baseTexture._glTextures = []; - this.baseTexture.resolution = this.resolution; - - this.baseTexture.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - this.baseTexture.hasLoaded = true; - - PIXI.Texture.call(this, - this.baseTexture, - new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution) - ); - - /** - * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. - * - * @property renderer - * @type CanvasRenderer|WebGLRenderer - */ - this.renderer = renderer || PIXI.defaultRenderer; - - if(this.renderer.type === PIXI.WEBGL_RENDERER) - { - var gl = this.renderer.gl; - this.baseTexture._dirty[gl.id] = false; - - this.textureBuffer = new PIXI.FilterTexture(gl, this.width, this.height, this.baseTexture.scaleMode); - this.baseTexture._glTextures[gl.id] = this.textureBuffer.texture; - - this.render = this.renderWebGL; - this.projection = new PIXI.Point(this.width*0.5, -this.height*0.5); - } - else - { - this.render = this.renderCanvas; - this.textureBuffer = new PIXI.CanvasBuffer(this.width* this.resolution, this.height* this.resolution); - this.baseTexture.source = this.textureBuffer.canvas; - } - - /** - * @property valid - * @type Boolean - */ - this.valid = true; - - this._updateUvs(); -}; - -PIXI.RenderTexture.prototype = Object.create(PIXI.Texture.prototype); -PIXI.RenderTexture.prototype.constructor = PIXI.RenderTexture; - -/** - * Resizes the RenderTexture. - * - * @method resize - * @param width {Number} The width to resize to. - * @param height {Number} The height to resize to. - * @param updateBase {Boolean} Should the baseTexture.width and height values be resized as well? - */ -PIXI.RenderTexture.prototype.resize = function(width, height, updateBase) -{ - if (width === this.width && height === this.height)return; - - this.valid = (width > 0 && height > 0); - - this.width = width; - this.height = height; - - this.frame.width = this.crop.width = width * this.resolution; - this.frame.height = this.crop.height = height * this.resolution; - - if (updateBase) - { - this.baseTexture.width = this.width * this.resolution; - this.baseTexture.height = this.height * this.resolution; - } - - if (this.renderer.type === PIXI.WEBGL_RENDERER) - { - this.projection.x = this.width / 2; - this.projection.y = -this.height / 2; - } - - if(!this.valid)return; - - this.textureBuffer.resize(this.width, this.height); -}; - -/** - * Clears the RenderTexture. - * - * @method clear - */ -PIXI.RenderTexture.prototype.clear = function() -{ - if(!this.valid)return; - - if (this.renderer.type === PIXI.WEBGL_RENDERER) - { - this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer); - } - - this.textureBuffer.clear(); -}; - -/** - * This function will draw the display object to the texture. - * - * @method renderWebGL - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. - * @param [clear] {Boolean} If true the texture will be cleared before the displayObject is drawn - * @private - */ -PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, matrix, clear) -{ - if(!this.valid)return; - //TOOD replace position with matrix.. - - //Lets create a nice matrix to apply to our display object. Frame buffers come in upside down so we need to flip the matrix - var wt = displayObject.worldTransform; - wt.identity(); - wt.translate(0, this.projection.y * 2); - if(matrix)wt.append(matrix); - wt.scale(1,-1); - - // setWorld Alpha to ensure that the object is renderer at full opacity - displayObject.worldAlpha = 1; - - // Time to update all the children of the displayObject with the new matrix.. - var children = displayObject.children; - - for(var i=0,j=children.length; i 'image/gif' - var info = data.slice(0, sepIdx).split(';')[0]; - - //We might need to handle some special cases here... - //standardize text/plain to 'txt' file extension - if (!info || info.toLowerCase() === 'text/plain') - return 'txt'; - - //User specified mime type, try splitting it by '/' - return info.split('/').pop().toLowerCase(); - } - - return null; -}; - -/** - * Starts loading the assets sequentially - * - * @method load - */ -PIXI.AssetLoader.prototype.load = function() -{ - var scope = this; - - function onLoad(evt) { - scope.onAssetLoaded(evt.data.content); - } - - this.loadCount = this.assetURLs.length; - - for (var i=0; i < this.assetURLs.length; i++) - { - var fileName = this.assetURLs[i]; - //first see if we have a data URI scheme.. - var fileType = this._getDataType(fileName); - - //if not, assume it's a file URI - if (!fileType) - fileType = fileName.split('?').shift().split('.').pop().toLowerCase(); - - var Constructor = this.loadersByType[fileType]; - if(!Constructor) - throw new Error(fileType + ' is an unsupported file type'); - - var loader = new Constructor(fileName, this.crossorigin); - - loader.on('loaded', onLoad); - loader.load(); - } -}; - -/** - * Invoked after each file is loaded - * - * @method onAssetLoaded - * @private - */ -PIXI.AssetLoader.prototype.onAssetLoaded = function(loader) -{ - this.loadCount--; - - this.emit('onProgress', { - content: this, - loader: loader, - loaded: this.assetURLs.length - this.loadCount, - total: this.assetURLs.length - }); - - if (this.onProgress) this.onProgress(loader); - - if (!this.loadCount) - { - this.emit('onComplete', { content: this }); - if(this.onComplete) this.onComplete(); - } -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The json file loader is used to load in JSON data and parse it - * When loaded this class will dispatch a 'loaded' event - * If loading fails this class will dispatch an 'error' event - * - * @class JsonLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.JsonLoader = function (url, crossorigin) { - /** - * The url of the bitmap font data - * - * @property url - * @type String - */ - this.url = url; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * [read-only] The base url of the bitmap font data - * - * @property baseUrl - * @type String - * @readOnly - */ - this.baseUrl = url.replace(/[^\/]*$/, ''); - - /** - * [read-only] Whether the data has loaded yet - * - * @property loaded - * @type Boolean - * @readOnly - */ - this.loaded = false; - -}; - -// constructor -PIXI.JsonLoader.prototype.constructor = PIXI.JsonLoader; -PIXI.EventTarget.mixin(PIXI.JsonLoader.prototype); - -/** - * Loads the JSON data - * - * @method load - */ -PIXI.JsonLoader.prototype.load = function () { - - if(window.XDomainRequest && this.crossorigin) - { - this.ajaxRequest = new window.XDomainRequest(); - - // XDomainRequest has a few quirks. Occasionally it will abort requests - // A way to avoid this is to make sure ALL callbacks are set even if not used - // More info here: http://stackoverflow.com/questions/15786966/xdomainrequest-aborts-post-on-ie-9 - this.ajaxRequest.timeout = 3000; - - this.ajaxRequest.onerror = this.onError.bind(this); - - this.ajaxRequest.ontimeout = this.onError.bind(this); - - this.ajaxRequest.onprogress = function() {}; - - this.ajaxRequest.onload = this.onJSONLoaded.bind(this); - } - else - { - if (window.XMLHttpRequest) - { - this.ajaxRequest = new window.XMLHttpRequest(); - } - else - { - this.ajaxRequest = new window.ActiveXObject('Microsoft.XMLHTTP'); - } - - this.ajaxRequest.onreadystatechange = this.onReadyStateChanged.bind(this); - } - - this.ajaxRequest.open('GET',this.url,true); - - this.ajaxRequest.send(); -}; - -/** - * Bridge function to be able to use the more reliable onreadystatechange in XMLHttpRequest. - * - * @method onReadyStateChanged - * @private - */ -PIXI.JsonLoader.prototype.onReadyStateChanged = function () { - if (this.ajaxRequest.readyState === 4 && (this.ajaxRequest.status === 200 || window.location.href.indexOf('http') === -1)) { - this.onJSONLoaded(); - } -}; - -/** - * Invoke when JSON file is loaded - * - * @method onJSONLoaded - * @private - */ -PIXI.JsonLoader.prototype.onJSONLoaded = function () { - - if(!this.ajaxRequest.responseText ) - { - this.onError(); - return; - } - - this.json = JSON.parse(this.ajaxRequest.responseText); - - if(this.json.frames && this.json.meta && this.json.meta.image) - { - // sprite sheet - var textureUrl = this.baseUrl + this.json.meta.image; - var image = new PIXI.ImageLoader(textureUrl, this.crossorigin); - var frameData = this.json.frames; - - this.texture = image.texture.baseTexture; - image.addEventListener('loaded', this.onLoaded.bind(this)); - - for (var i in frameData) - { - var rect = frameData[i].frame; - - if (rect) - { - var textureSize = new PIXI.Rectangle(rect.x, rect.y, rect.w, rect.h); - var crop = textureSize.clone(); - var trim = null; - - // Check to see if the sprite is trimmed - if (frameData[i].trimmed) - { - var actualSize = frameData[i].sourceSize; - var realSize = frameData[i].spriteSourceSize; - trim = new PIXI.Rectangle(realSize.x, realSize.y, actualSize.w, actualSize.h); - } - PIXI.TextureCache[i] = new PIXI.Texture(this.texture, textureSize, crop, trim); - } - } - - image.load(); - - } - else if(this.json.bones) - { - /* check if the json was loaded before */ - if (PIXI.AnimCache[this.url]) - { - this.onLoaded(); - } - else - { - /* use a bit of hackery to load the atlas file, here we assume that the .json, .atlas and .png files - * that correspond to the spine file are in the same base URL and that the .json and .atlas files - * have the same name - */ - var atlasPath = this.url.substr(0, this.url.lastIndexOf('.')) + '.atlas'; - var atlasLoader = new PIXI.JsonLoader(atlasPath, this.crossorigin); - // save a copy of the current object for future reference // - var originalLoader = this; - // before loading the file, replace the "onJSONLoaded" function for our own // - atlasLoader.onJSONLoaded = function() - { - // at this point "this" points at the atlasLoader (JsonLoader) instance // - if(!this.ajaxRequest.responseText) - { - this.onError(); // FIXME: hmm, this is funny because we are not responding to errors yet - return; - } - // create a new instance of a spine texture loader for this spine object // - var textureLoader = new PIXI.SpineTextureLoader(this.url.substring(0, this.url.lastIndexOf('/'))); - // create a spine atlas using the loaded text and a spine texture loader instance // - var spineAtlas = new spine.Atlas(this.ajaxRequest.responseText, textureLoader); - // now we use an atlas attachment loader // - var attachmentLoader = new spine.AtlasAttachmentLoader(spineAtlas); - // spine animation - var spineJsonParser = new spine.SkeletonJson(attachmentLoader); - var skeletonData = spineJsonParser.readSkeletonData(originalLoader.json); - PIXI.AnimCache[originalLoader.url] = skeletonData; - originalLoader.spine = skeletonData; - originalLoader.spineAtlas = spineAtlas; - originalLoader.spineAtlasLoader = atlasLoader; - // wait for textures to finish loading if needed - if (textureLoader.loadingCount > 0) - { - textureLoader.addEventListener('loadedBaseTexture', function(evt){ - if (evt.content.content.loadingCount <= 0) - { - originalLoader.onLoaded(); - } - }); - } - else - { - originalLoader.onLoaded(); - } - }; - // start the loading // - atlasLoader.load(); - } - } - else - { - this.onLoaded(); - } -}; - -/** - * Invoke when json file loaded - * - * @method onLoaded - * @private - */ -PIXI.JsonLoader.prototype.onLoaded = function () { - this.loaded = true; - this.dispatchEvent({ - type: 'loaded', - content: this - }); -}; - -/** - * Invoke when error occured - * - * @method onError - * @private - */ -PIXI.JsonLoader.prototype.onError = function () { - - this.dispatchEvent({ - type: 'error', - content: this - }); -}; - -/** - * @author Martin Kelm http://mkelm.github.com - */ - -/** - * The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event. - * - * To generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format. - * - * It is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to 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.fromFrameId() - * - * @class AtlasLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.AtlasLoader = function (url, crossorigin) { - this.url = url; - this.baseUrl = url.replace(/[^\/]*$/, ''); - this.crossorigin = crossorigin; - this.loaded = false; - -}; - -// constructor -PIXI.AtlasLoader.constructor = PIXI.AtlasLoader; - -PIXI.EventTarget.mixin(PIXI.AtlasLoader.prototype); - - /** - * Starts loading the JSON file - * - * @method load - */ -PIXI.AtlasLoader.prototype.load = function () { - this.ajaxRequest = new PIXI.AjaxRequest(); - this.ajaxRequest.onreadystatechange = this.onAtlasLoaded.bind(this); - - this.ajaxRequest.open('GET', this.url, true); - if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/json'); - this.ajaxRequest.send(null); -}; - -/** - * Invoked when the Atlas has fully loaded. Parses the JSON and builds the texture frames. - * - * @method onAtlasLoaded - * @private - */ -PIXI.AtlasLoader.prototype.onAtlasLoaded = function () { - if (this.ajaxRequest.readyState === 4) { - if (this.ajaxRequest.status === 200 || window.location.href.indexOf('http') === -1) { - this.atlas = { - meta : { - image : [] - }, - frames : [] - }; - var result = this.ajaxRequest.responseText.split(/\r?\n/); - var lineCount = -3; - - var currentImageId = 0; - var currentFrame = null; - var nameInNextLine = false; - - var i = 0, - j = 0, - selfOnLoaded = this.onLoaded.bind(this); - - // parser without rotation support yet! - for (i = 0; i < result.length; i++) { - result[i] = result[i].replace(/^\s+|\s+$/g, ''); - if (result[i] === '') { - nameInNextLine = i+1; - } - if (result[i].length > 0) { - if (nameInNextLine === i) { - this.atlas.meta.image.push(result[i]); - currentImageId = this.atlas.meta.image.length - 1; - this.atlas.frames.push({}); - lineCount = -3; - } else if (lineCount > 0) { - if (lineCount % 7 === 1) { // frame name - if (currentFrame != null) { //jshint ignore:line - this.atlas.frames[currentImageId][currentFrame.name] = currentFrame; - } - currentFrame = { name: result[i], frame : {} }; - } else { - var text = result[i].split(' '); - if (lineCount % 7 === 3) { // position - currentFrame.frame.x = Number(text[1].replace(',', '')); - currentFrame.frame.y = Number(text[2]); - } else if (lineCount % 7 === 4) { // size - currentFrame.frame.w = Number(text[1].replace(',', '')); - currentFrame.frame.h = Number(text[2]); - } else if (lineCount % 7 === 5) { // real size - var realSize = { - x : 0, - y : 0, - w : Number(text[1].replace(',', '')), - h : Number(text[2]) - }; - - if (realSize.w > currentFrame.frame.w || realSize.h > currentFrame.frame.h) { - currentFrame.trimmed = true; - currentFrame.realSize = realSize; - } else { - currentFrame.trimmed = false; - } - } - } - } - lineCount++; - } - } - - if (currentFrame != null) { //jshint ignore:line - this.atlas.frames[currentImageId][currentFrame.name] = currentFrame; - } - - if (this.atlas.meta.image.length > 0) { - this.images = []; - for (j = 0; j < this.atlas.meta.image.length; j++) { - // sprite sheet - var textureUrl = this.baseUrl + this.atlas.meta.image[j]; - var frameData = this.atlas.frames[j]; - this.images.push(new PIXI.ImageLoader(textureUrl, this.crossorigin)); - - for (i in frameData) { - var rect = frameData[i].frame; - if (rect) { - PIXI.TextureCache[i] = new PIXI.Texture(this.images[j].texture.baseTexture, { - x: rect.x, - y: rect.y, - width: rect.w, - height: rect.h - }); - if (frameData[i].trimmed) { - PIXI.TextureCache[i].realSize = frameData[i].realSize; - // trim in pixi not supported yet, todo update trim properties if it is done ... - PIXI.TextureCache[i].trim.x = 0; - PIXI.TextureCache[i].trim.y = 0; - } - } - } - } - - this.currentImageId = 0; - for (j = 0; j < this.images.length; j++) { - this.images[j].on('loaded', selfOnLoaded); - } - this.images[this.currentImageId].load(); - - } else { - this.onLoaded(); - } - - } else { - this.onError(); - } - } -}; - -/** - * Invoked when json file has loaded. - * - * @method onLoaded - * @private - */ -PIXI.AtlasLoader.prototype.onLoaded = function () { - if (this.images.length - 1 > this.currentImageId) { - this.currentImageId++; - this.images[this.currentImageId].load(); - } else { - this.loaded = true; - this.emit('loaded', { content: this }); - } -}; - -/** - * Invoked when an error occurs. - * - * @method onError - * @private - */ -PIXI.AtlasLoader.prototype.onError = function () { - this.emit('error', { content: this }); -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * 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 in 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 a 'texture atlas') as it means sprites 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.fromFrameId() - * This loader will load the image file that the Spritesheet points to as well as the data. - * When loaded this class will dispatch a 'loaded' event - * - * @class SpriteSheetLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the sprite sheet JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.SpriteSheetLoader = function (url, crossorigin) { - - /** - * The url of the atlas data - * - * @property url - * @type String - */ - this.url = url; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * [read-only] The base url of the bitmap font data - * - * @property baseUrl - * @type String - * @readOnly - */ - this.baseUrl = url.replace(/[^\/]*$/, ''); - - /** - * The texture being loaded - * - * @property texture - * @type Texture - */ - this.texture = null; - - /** - * The frames of the sprite sheet - * - * @property frames - * @type Object - */ - this.frames = {}; -}; - -// constructor -PIXI.SpriteSheetLoader.prototype.constructor = PIXI.SpriteSheetLoader; - -PIXI.EventTarget.mixin(PIXI.SpriteSheetLoader.prototype); - -/** - * This will begin loading the JSON file - * - * @method load - */ -PIXI.SpriteSheetLoader.prototype.load = function () { - var scope = this; - var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin); - jsonLoader.on('loaded', function (event) { - scope.json = event.data.content.json; - scope.onLoaded(); - }); - jsonLoader.load(); -}; - -/** - * Invoke when all files are loaded (json and texture) - * - * @method onLoaded - * @private - */ -PIXI.SpriteSheetLoader.prototype.onLoaded = function () { - this.emit('loaded', { - content: this - }); -}; - -/** - * @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.fromFrame() and PIXI.Sprite.fromFrame() - * When loaded this class will dispatch a 'loaded' event - * - * @class ImageLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the image - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.ImageLoader = function(url, crossorigin) -{ - /** - * The texture being loaded - * - * @property texture - * @type Texture - */ - this.texture = PIXI.Texture.fromImage(url, crossorigin); - - /** - * if the image is loaded with loadFramedSpriteSheet - * frames will contain the sprite sheet frames - * - * @property frames - * @type Array - * @readOnly - */ - this.frames = []; -}; - -// constructor -PIXI.ImageLoader.prototype.constructor = PIXI.ImageLoader; - -PIXI.EventTarget.mixin(PIXI.ImageLoader.prototype); - -/** - * Loads image or takes it from cache - * - * @method load - */ -PIXI.ImageLoader.prototype.load = function() -{ - if(!this.texture.baseTexture.hasLoaded) - { - this.texture.baseTexture.on('loaded', this.onLoaded.bind(this)); - } - else - { - this.onLoaded(); - } -}; - -/** - * Invoked when image file is loaded or it is already cached and ready to use - * - * @method onLoaded - * @private - */ -PIXI.ImageLoader.prototype.onLoaded = function() -{ - this.emit('loaded', { content: this }); -}; - -/** - * Loads image and split it to uniform sized frames - * - * @method loadFramedSpriteSheet - * @param frameWidth {Number} width of each frame - * @param frameHeight {Number} height of each frame - * @param textureName {String} if given, the frames will be cached in - format - */ -PIXI.ImageLoader.prototype.loadFramedSpriteSheet = function(frameWidth, frameHeight, textureName) -{ - this.frames = []; - var cols = Math.floor(this.texture.width / frameWidth); - var rows = Math.floor(this.texture.height / frameHeight); - - var i=0; - for (var y=0; y-1){var c=["%c %c %c Pixi.js "+b.VERSION+" - "+a+" %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ ","background: #ff66a5","background: #ff66a5","color: #ff66a5; background: #030307;","background: #ff66a5","background: #ffc3dc","background: #ff66a5","color: #ff2424; background: #fff","color: #ff2424; background: #fff","color: #ff2424; background: #fff"];console.log.apply(console,c)}else window.console&&console.log("Pixi.js "+b.VERSION+" - http://www.pixijs.com/");b.dontSayHello=!0}},b.Point=function(a,b){this.x=a||0,this.y=b||0},b.Point.prototype.clone=function(){return new b.Point(this.x,this.y)},b.Point.prototype.set=function(a,b){this.x=a||0,this.y=b||(0!==b?this.x:0)},b.Point.prototype.constructor=b.Point,b.Rectangle=function(a,b,c,d){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0},b.Rectangle.prototype.clone=function(){return new b.Rectangle(this.x,this.y,this.width,this.height)},b.Rectangle.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=this.x;if(a>=c&&a<=c+this.width){var d=this.y;if(b>=d&&b<=d+this.height)return!0}return!1},b.Rectangle.prototype.constructor=b.Rectangle,b.EmptyRectangle=new b.Rectangle(0,0,0,0),b.Polygon=function(a){if(a instanceof Array||(a=Array.prototype.slice.call(arguments)),a[0]instanceof b.Point){for(var c=[],d=0,e=a.length;e>d;d++)c.push(a[d].x,a[d].y);a=c}this.closed=!0,this.points=a},b.Polygon.prototype.clone=function(){var a=this.points.slice();return new b.Polygon(a)},b.Polygon.prototype.contains=function(a,b){for(var c=!1,d=this.points.length/2,e=0,f=d-1;d>e;f=e++){var g=this.points[2*e],h=this.points[2*e+1],i=this.points[2*f],j=this.points[2*f+1],k=h>b!=j>b&&(i-g)*(b-h)/(j-h)+g>a;k&&(c=!c)}return c},b.Polygon.prototype.constructor=b.Polygon,b.Circle=function(a,b,c){this.x=a||0,this.y=b||0,this.radius=c||0},b.Circle.prototype.clone=function(){return new b.Circle(this.x,this.y,this.radius)},b.Circle.prototype.contains=function(a,b){if(this.radius<=0)return!1;var c=this.x-a,d=this.y-b,e=this.radius*this.radius;return c*=c,d*=d,e>=c+d},b.Circle.prototype.getBounds=function(){return new b.Rectangle(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},b.Circle.prototype.constructor=b.Circle,b.Ellipse=function(a,b,c,d){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0},b.Ellipse.prototype.clone=function(){return new b.Ellipse(this.x,this.y,this.width,this.height)},b.Ellipse.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=(a-this.x)/this.width,d=(b-this.y)/this.height;return c*=c,d*=d,1>=c+d},b.Ellipse.prototype.getBounds=function(){return new b.Rectangle(this.x-this.width,this.y-this.height,this.width,this.height)},b.Ellipse.prototype.constructor=b.Ellipse,b.RoundedRectangle=function(a,b,c,d,e){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0,this.radius=e||20},b.RoundedRectangle.prototype.clone=function(){return new b.RoundedRectangle(this.x,this.y,this.width,this.height,this.radius)},b.RoundedRectangle.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=this.x;if(a>=c&&a<=c+this.width){var d=this.y;if(b>=d&&b<=d+this.height)return!0}return!1},b.RoundedRectangle.prototype.constructor=b.RoundedRectangle,b.Matrix=function(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0},b.Matrix.prototype.fromArray=function(a){this.a=a[0],this.b=a[1],this.c=a[3],this.d=a[4],this.tx=a[2],this.ty=a[5]},b.Matrix.prototype.toArray=function(a){this.array||(this.array=new b.Float32Array(9));var c=this.array;return a?(c[0]=this.a,c[1]=this.b,c[2]=0,c[3]=this.c,c[4]=this.d,c[5]=0,c[6]=this.tx,c[7]=this.ty,c[8]=1):(c[0]=this.a,c[1]=this.c,c[2]=this.tx,c[3]=this.b,c[4]=this.d,c[5]=this.ty,c[6]=0,c[7]=0,c[8]=1),c},b.Matrix.prototype.apply=function(a,c){return c=c||new b.Point,c.x=this.a*a.x+this.c*a.y+this.tx,c.y=this.b*a.x+this.d*a.y+this.ty,c},b.Matrix.prototype.applyInverse=function(a,c){c=c||new b.Point;var d=1/(this.a*this.d+this.c*-this.b);return c.x=this.d*d*a.x+-this.c*d*a.y+(this.ty*this.c-this.tx*this.d)*d,c.y=this.a*d*a.y+-this.b*d*a.x+(-this.ty*this.a+this.tx*this.b)*d,c},b.Matrix.prototype.translate=function(a,b){return this.tx+=a,this.ty+=b,this},b.Matrix.prototype.scale=function(a,b){return this.a*=a,this.d*=b,this.c*=a,this.b*=b,this.tx*=a,this.ty*=b,this},b.Matrix.prototype.rotate=function(a){var b=Math.cos(a),c=Math.sin(a),d=this.a,e=this.c,f=this.tx;return this.a=d*b-this.b*c,this.b=d*c+this.b*b,this.c=e*b-this.d*c,this.d=e*c+this.d*b,this.tx=f*b-this.ty*c,this.ty=f*c+this.ty*b,this},b.Matrix.prototype.append=function(a){var b=this.a,c=this.b,d=this.c,e=this.d;return this.a=a.a*b+a.b*d,this.b=a.a*c+a.b*e,this.c=a.c*b+a.d*d,this.d=a.c*c+a.d*e,this.tx=a.tx*b+a.ty*d+this.tx,this.ty=a.tx*c+a.ty*e+this.ty,this},b.Matrix.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},b.identityMatrix=new b.Matrix,b.DisplayObject=function(){this.position=new b.Point,this.scale=new b.Point(1,1),this.pivot=new b.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.hitArea=null,this.buttonMode=!1,this.renderable=!1,this.parent=null,this.stage=null,this.worldAlpha=1,this._interactive=!1,this.defaultCursor="pointer",this.worldTransform=new b.Matrix,this._sr=0,this._cr=1,this.filterArea=null,this._bounds=new b.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null,this._cacheAsBitmap=!1,this._cacheIsDirty=!1},b.DisplayObject.prototype.constructor=b.DisplayObject,Object.defineProperty(b.DisplayObject.prototype,"interactive",{get:function(){return this._interactive},set:function(a){this._interactive=a,this.stage&&(this.stage.dirty=!0)}}),Object.defineProperty(b.DisplayObject.prototype,"worldVisible",{get:function(){var a=this;do{if(!a.visible)return!1;a=a.parent}while(a);return!0}}),Object.defineProperty(b.DisplayObject.prototype,"mask",{get:function(){return this._mask},set:function(a){this._mask&&(this._mask.isMask=!1),this._mask=a,this._mask&&(this._mask.isMask=!0)}}),Object.defineProperty(b.DisplayObject.prototype,"filters",{get:function(){return this._filters},set:function(a){if(a){for(var b=[],c=0;c=0&&b<=this.children.length)return a.parent&&a.parent.removeChild(a),a.parent=this,this.children.splice(b,0,a),this.stage&&a.setStageReference(this.stage),a;throw new Error(a+"addChildAt: The index "+b+" supplied is out of bounds "+this.children.length)},b.DisplayObjectContainer.prototype.swapChildren=function(a,b){if(a!==b){var c=this.getChildIndex(a),d=this.getChildIndex(b);if(0>c||0>d)throw new Error("swapChildren: Both the supplied DisplayObjects must be a child of the caller.");this.children[c]=b,this.children[d]=a}},b.DisplayObjectContainer.prototype.getChildIndex=function(a){var b=this.children.indexOf(a);if(-1===b)throw new Error("The supplied DisplayObject must be a child of the caller");return b},b.DisplayObjectContainer.prototype.setChildIndex=function(a,b){if(0>b||b>=this.children.length)throw new Error("The supplied index is out of bounds");var c=this.getChildIndex(a);this.children.splice(c,1),this.children.splice(b,0,a)},b.DisplayObjectContainer.prototype.getChildAt=function(a){if(0>a||a>=this.children.length)throw new Error("getChildAt: Supplied index "+a+" does not exist in the child list, or the supplied DisplayObject must be a child of the caller");return this.children[a]},b.DisplayObjectContainer.prototype.removeChild=function(a){var b=this.children.indexOf(a);if(-1!==b)return this.removeChildAt(b)},b.DisplayObjectContainer.prototype.removeChildAt=function(a){var b=this.getChildAt(a);return this.stage&&b.removeStageReference(),b.parent=void 0,this.children.splice(a,1),b},b.DisplayObjectContainer.prototype.removeChildren=function(a,b){var c=a||0,d="number"==typeof b?b:this.children.length,e=d-c;if(e>0&&d>=e){for(var f=this.children.splice(c,e),g=0;ga;a++)this.children[a].updateTransform()},b.DisplayObjectContainer.prototype.displayObjectContainerUpdateTransform=b.DisplayObjectContainer.prototype.updateTransform,b.DisplayObjectContainer.prototype.getBounds=function(){if(0===this.children.length)return b.EmptyRectangle;for(var a,c,d,e=1/0,f=1/0,g=-1/0,h=-1/0,i=!1,j=0,k=this.children.length;k>j;j++){var l=this.children[j];l.visible&&(i=!0,a=this.children[j].getBounds(),e=ec?g:c,h=h>d?h:d)}if(!i)return b.EmptyRectangle;var m=this._bounds;return m.x=e,m.y=f,m.width=g-e,m.height=h-f,m},b.DisplayObjectContainer.prototype.getLocalBounds=function(){var a=this.worldTransform;this.worldTransform=b.identityMatrix;for(var c=0,d=this.children.length;d>c;c++)this.children[c].updateTransform();var e=this.getBounds();return this.worldTransform=a,e},b.DisplayObjectContainer.prototype.setStageReference=function(a){this.stage=a,this._interactive&&(this.stage.dirty=!0);for(var b=0,c=this.children.length;c>b;b++){var d=this.children[b];d.setStageReference(a)}},b.DisplayObjectContainer.prototype.removeStageReference=function(){for(var a=0,b=this.children.length;b>a;a++){var c=this.children[a];c.removeStageReference()}this._interactive&&(this.stage.dirty=!0),this.stage=null},b.DisplayObjectContainer.prototype._renderWebGL=function(a){if(this.visible&&!(this.alpha<=0)){if(this._cacheAsBitmap)return void this._renderCachedSprite(a);var b,c;if(this._mask||this._filters){for(this._filters&&(a.spriteBatch.flush(),a.filterManager.pushFilter(this._filterBlock)),this._mask&&(a.spriteBatch.stop(),a.maskManager.pushMask(this.mask,a),a.spriteBatch.start()),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a);a.spriteBatch.stop(),this._mask&&a.maskManager.popMask(this._mask,a),this._filters&&a.filterManager.popFilter(),a.spriteBatch.start()}else for(b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a)}},b.DisplayObjectContainer.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){if(this._cacheAsBitmap)return void this._renderCachedSprite(a);this._mask&&a.maskManager.pushMask(this._mask,a);for(var b=0,c=this.children.length;c>b;b++){var d=this.children[b];d._renderCanvas(a)}this._mask&&a.maskManager.popMask(a)}},b.Sprite=function(a){b.DisplayObjectContainer.call(this),this.anchor=new b.Point,this.texture=a||b.Texture.emptyTexture,this._width=0,this._height=0,this.tint=16777215,this.blendMode=b.blendModes.NORMAL,this.shader=null,this.texture.baseTexture.hasLoaded?this.onTextureUpdate():this.texture.on("update",this.onTextureUpdate.bind(this)),this.renderable=!0},b.Sprite.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Sprite.prototype.constructor=b.Sprite,Object.defineProperty(b.Sprite.prototype,"width",{get:function(){return this.scale.x*this.texture.frame.width},set:function(a){this.scale.x=a/this.texture.frame.width,this._width=a}}),Object.defineProperty(b.Sprite.prototype,"height",{get:function(){return this.scale.y*this.texture.frame.height},set:function(a){this.scale.y=a/this.texture.frame.height,this._height=a}}),b.Sprite.prototype.setTexture=function(a){this.texture=a,this.cachedTint=16777215},b.Sprite.prototype.onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height)},b.Sprite.prototype.getBounds=function(a){var b=this.texture.frame.width,c=this.texture.frame.height,d=b*(1-this.anchor.x),e=b*-this.anchor.x,f=c*(1-this.anchor.y),g=c*-this.anchor.y,h=a||this.worldTransform,i=h.a,j=h.b,k=h.c,l=h.d,m=h.tx,n=h.ty,o=-1/0,p=-1/0,q=1/0,r=1/0;if(0===j&&0===k)0>i&&(i*=-1),0>l&&(l*=-1),q=i*e+m,o=i*d+m,r=l*g+n,p=l*f+n;else{var s=i*e+k*g+m,t=l*g+j*e+n,u=i*d+k*g+m,v=l*g+j*d+n,w=i*d+k*f+m,x=l*f+j*d+n,y=i*e+k*f+m,z=l*f+j*e+n;q=q>s?s:q,q=q>u?u:q,q=q>w?w:q,q=q>y?y:q,r=r>t?t:r,r=r>v?v:r,r=r>x?x:r,r=r>z?z:r,o=s>o?s:o,o=u>o?u:o,o=w>o?w:o,o=y>o?y:o,p=t>p?t:p,p=v>p?v:p,p=x>p?x:p,p=z>p?z:p}var A=this._bounds;return A.x=q,A.width=o-q,A.y=r,A.height=p-r,this._currentBounds=A,A},b.Sprite.prototype._renderWebGL=function(a){if(this.visible&&!(this.alpha<=0)){var b,c;if(this._mask||this._filters){var d=a.spriteBatch;for(this._filters&&(d.flush(),a.filterManager.pushFilter(this._filterBlock)),this._mask&&(d.stop(),a.maskManager.pushMask(this.mask,a),d.start()),d.render(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a);d.stop(),this._mask&&a.maskManager.popMask(this._mask,a),this._filters&&a.filterManager.popFilter(),d.start()}else for(a.spriteBatch.render(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a)}},b.Sprite.prototype._renderCanvas=function(a){if(!(this.visible===!1||0===this.alpha||this.texture.crop.width<=0||this.texture.crop.height<=0)){if(this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,a.context.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]),this._mask&&a.maskManager.pushMask(this._mask,a),this.texture.valid){var c=this.texture.baseTexture.resolution/a.resolution;a.context.globalAlpha=this.worldAlpha,a.smoothProperty&&a.scaleMode!==this.texture.baseTexture.scaleMode&&(a.scaleMode=this.texture.baseTexture.scaleMode,a.context[a.smoothProperty]=a.scaleMode===b.scaleModes.LINEAR);var d=this.texture.trim?this.texture.trim.x-this.anchor.x*this.texture.trim.width:this.anchor.x*-this.texture.frame.width,e=this.texture.trim?this.texture.trim.y-this.anchor.y*this.texture.trim.height:this.anchor.y*-this.texture.frame.height;a.roundPixels?(a.context.setTransform(this.worldTransform.a,this.worldTransform.b,this.worldTransform.c,this.worldTransform.d,this.worldTransform.tx*a.resolution|0,this.worldTransform.ty*a.resolution|0),d=0|d,e=0|e):a.context.setTransform(this.worldTransform.a,this.worldTransform.b,this.worldTransform.c,this.worldTransform.d,this.worldTransform.tx*a.resolution,this.worldTransform.ty*a.resolution),16777215!==this.tint?(this.cachedTint!==this.tint&&(this.cachedTint=this.tint,this.tintedTexture=b.CanvasTinter.getTintedTexture(this,this.tint)),a.context.drawImage(this.tintedTexture,0,0,this.texture.crop.width,this.texture.crop.height,d/c,e/c,this.texture.crop.width/c,this.texture.crop.height/c)):a.context.drawImage(this.texture.baseTexture.source,this.texture.crop.x,this.texture.crop.y,this.texture.crop.width,this.texture.crop.height,d/c,e/c,this.texture.crop.width/c,this.texture.crop.height/c)}for(var f=0,g=this.children.length;g>f;f++)this.children[f]._renderCanvas(a);this._mask&&a.maskManager.popMask(a)}},b.Sprite.fromFrame=function(a){var c=b.TextureCache[a];if(!c)throw new Error('The frameId "'+a+'" does not exist in the texture cache'+this);return new b.Sprite(c)},b.Sprite.fromImage=function(a,c,d){var e=b.Texture.fromImage(a,c,d);return new b.Sprite(e)},b.SpriteBatch=function(a){b.DisplayObjectContainer.call(this),this.textureThing=a,this.ready=!1},b.SpriteBatch.prototype=Object.create(b.DisplayObjectContainer.prototype),b.SpriteBatch.prototype.constructor=b.SpriteBatch,b.SpriteBatch.prototype.initWebGL=function(a){this.fastSpriteBatch=new b.WebGLFastSpriteBatch(a),this.ready=!0},b.SpriteBatch.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},b.SpriteBatch.prototype._renderWebGL=function(a){!this.visible||this.alpha<=0||!this.children.length||(this.ready||this.initWebGL(a.gl),this.fastSpriteBatch.gl!==a.gl&&this.fastSpriteBatch.setContext(a.gl),a.spriteBatch.stop(),a.shaderManager.setShader(a.shaderManager.fastShader),this.fastSpriteBatch.begin(this,a),this.fastSpriteBatch.render(this),a.spriteBatch.start())},b.SpriteBatch.prototype._renderCanvas=function(a){if(this.visible&&!(this.alpha<=0)&&this.children.length){var b=a.context;b.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var c=this.worldTransform,d=!0,e=0;e=this.textures.length&&(this.gotoAndStop(this.textures.length-1),this.onComplete&&this.onComplete())}},b.MovieClip.fromFrames=function(a){for(var c=[],d=0;di;i++){for(j=0;m>j;j+=4)if(255!==k[n+j]){o=!0;break}if(o)break;n+=m}for(c.ascent=g-i,n=l-m,o=!1,i=h;i>g;i--){for(j=0;m>j;j+=4)if(255!==k[n+j]){o=!0;break}if(o)break;n-=m}c.descent=i-g,c.descent+=6,c.fontSize=c.ascent+c.descent,b.Text.fontPropertiesCache[a]=c}return c},b.Text.prototype.wordWrap=function(a){for(var b="",c=a.split("\n"),d=0;de?(g>0&&(b+="\n"),b+=f[g],e=this.style.wordWrapWidth-h):(e-=i,b+=" "+f[g])}d=2?parseInt(c[c.length-2],10):b.BitmapText.fonts[this.fontName].size,this.dirty=!0,this.tint=a.tint},b.BitmapText.prototype.updateText=function(){for(var a=b.BitmapText.fonts[this.fontName],c=new b.Point,d=null,e=[],f=0,g=[],h=0,i=this.fontSize/a.size,j=0;j=j;j++){var n=0;"right"===this.style.align?n=f-g[j]:"center"===this.style.align&&(n=(f-g[j])/2),m.push(n)}var o=this.children.length,p=e.length,q=this.tint||16777215;for(j=0;p>j;j++){var r=o>j?this.children[j]:this._pool.pop();r?r.setTexture(e[j].texture):r=new b.Sprite(e[j].texture),r.position.x=(e[j].position.x+m[e[j].line])*i,r.position.y=e[j].position.y*i,r.scale.x=r.scale.y=i,r.tint=q,r.parent||this.addChild(r)}for(;this.children.length>p;){var s=this.getChildAt(this.children.length-1);this._pool.push(s),this.removeChild(s)}this.textWidth=f*i,this.textHeight=(c.y+a.lineHeight)*i},b.BitmapText.prototype.updateTransform=function(){this.dirty&&(this.updateText(),this.dirty=!1),b.DisplayObjectContainer.prototype.updateTransform.call(this)},b.BitmapText.fonts={},b.InteractionData=function(){this.global=new b.Point,this.target=null,this.originalEvent=null},b.InteractionData.prototype.getLocalPosition=function(a,c){var d=a.worldTransform,e=this.global,f=d.a,g=d.c,h=d.tx,i=d.b,j=d.d,k=d.ty,l=1/(f*j+g*-i);return c=c||new b.Point,c.x=j*l*e.x+-g*l*e.y+(k*g-h*j)*l,c.y=f*l*e.y+-i*l*e.x+(-k*f+h*i)*l,c},b.InteractionData.prototype.constructor=b.InteractionData,b.InteractionManager=function(a){this.stage=a,this.mouse=new b.InteractionData,this.touches={},this.tempPoint=new b.Point,this.mouseoverEnabled=!0,this.pool=[],this.interactiveItems=[],this.interactionDOMElement=null,this.onMouseMove=this.onMouseMove.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.onTouchCancel=this.onTouchCancel.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.last=0,this.currentCursorStyle="inherit",this.mouseOut=!1,this.resolution=1,this._tempPoint=new b.Point -},b.InteractionManager.prototype.constructor=b.InteractionManager,b.InteractionManager.prototype.collectInteractiveSprite=function(a,b){for(var c=a.children,d=c.length,e=d-1;e>=0;e--){var f=c[e];f._interactive?(b.interactiveChildren=!0,this.interactiveItems.push(f),f.children.length>0&&this.collectInteractiveSprite(f,f)):(f.__iParent=null,f.children.length>0&&this.collectInteractiveSprite(f,b))}},b.InteractionManager.prototype.setTarget=function(a){this.target=a,this.resolution=a.resolution,null===this.interactionDOMElement&&this.setTargetDomElement(a.view)},b.InteractionManager.prototype.setTargetDomElement=function(a){this.removeEvents(),window.navigator.msPointerEnabled&&(a.style["-ms-content-zooming"]="none",a.style["-ms-touch-action"]="none"),this.interactionDOMElement=a,a.addEventListener("mousemove",this.onMouseMove,!0),a.addEventListener("mousedown",this.onMouseDown,!0),a.addEventListener("mouseout",this.onMouseOut,!0),a.addEventListener("touchstart",this.onTouchStart,!0),a.addEventListener("touchend",this.onTouchEnd,!0),a.addEventListener("touchleave",this.onTouchCancel,!0),a.addEventListener("touchcancel",this.onTouchCancel,!0),a.addEventListener("touchmove",this.onTouchMove,!0),window.addEventListener("mouseup",this.onMouseUp,!0)},b.InteractionManager.prototype.removeEvents=function(){this.interactionDOMElement&&(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]="",this.interactionDOMElement.removeEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.removeEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.removeEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.removeEventListener("touchleave",this.onTouchCancel,!0),this.interactionDOMElement.removeEventListener("touchcancel",this.onTouchCancel,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onTouchMove,!0),this.interactionDOMElement=null,window.removeEventListener("mouseup",this.onMouseUp,!0))},b.InteractionManager.prototype.update=function(){if(this.target){var a=Date.now(),c=a-this.last;if(c=c*b.INTERACTION_FREQUENCY/1e3,!(1>c)){this.last=a;var d=0;this.dirty&&this.rebuildInteractiveGraph();var e=this.interactiveItems.length,f="inherit",g=!1;for(d=0;e>d;d++){var h=this.interactiveItems[d];h.__hit=this.hitTest(h,this.mouse),this.mouse.target=h,h.__hit&&!g?(h.buttonMode&&(f=h.defaultCursor),h.interactiveChildren||(g=!0),h.__isOver||(h.mouseover&&h.mouseover(this.mouse),h.__isOver=!0)):h.__isOver&&(h.mouseout&&h.mouseout(this.mouse),h.__isOver=!1)}this.currentCursorStyle!==f&&(this.currentCursorStyle=f,this.interactionDOMElement.style.cursor=f)}}},b.InteractionManager.prototype.rebuildInteractiveGraph=function(){this.dirty=!1;for(var a=this.interactiveItems.length,b=0;a>b;b++)this.interactiveItems[b].interactiveChildren=!1;this.interactiveItems=[],this.stage.interactive&&this.interactiveItems.push(this.stage),this.collectInteractiveSprite(this.stage,this.stage)},b.InteractionManager.prototype.onMouseMove=function(a){this.dirty&&this.rebuildInteractiveGraph(),this.mouse.originalEvent=a;var b=this.interactionDOMElement.getBoundingClientRect();this.mouse.global.x=(a.clientX-b.left)*(this.target.width/b.width)/this.resolution,this.mouse.global.y=(a.clientY-b.top)*(this.target.height/b.height)/this.resolution;for(var c=this.interactiveItems.length,d=0;c>d;d++){var e=this.interactiveItems[d];e.mousemove&&e.mousemove(this.mouse)}},b.InteractionManager.prototype.onMouseDown=function(a){this.dirty&&this.rebuildInteractiveGraph(),this.mouse.originalEvent=a,b.AUTO_PREVENT_DEFAULT&&this.mouse.originalEvent.preventDefault();for(var c=this.interactiveItems.length,d=this.mouse.originalEvent,e=2===d.button||3===d.which,f=e?"rightdown":"mousedown",g=e?"rightclick":"click",h=e?"__rightIsDown":"__mouseIsDown",i=e?"__isRightDown":"__isDown",j=0;c>j;j++){var k=this.interactiveItems[j];if((k[f]||k[g])&&(k[h]=!0,k.__hit=this.hitTest(k,this.mouse),k.__hit&&(k[f]&&k[f](this.mouse),k[i]=!0,!k.interactiveChildren)))break}},b.InteractionManager.prototype.onMouseOut=function(a){this.dirty&&this.rebuildInteractiveGraph(),this.mouse.originalEvent=a;var b=this.interactiveItems.length;this.interactionDOMElement.style.cursor="inherit";for(var c=0;b>c;c++){var d=this.interactiveItems[c];d.__isOver&&(this.mouse.target=d,d.mouseout&&d.mouseout(this.mouse),d.__isOver=!1)}this.mouseOut=!0,this.mouse.global.x=-1e4,this.mouse.global.y=-1e4},b.InteractionManager.prototype.onMouseUp=function(a){this.dirty&&this.rebuildInteractiveGraph(),this.mouse.originalEvent=a;for(var b=this.interactiveItems.length,c=!1,d=this.mouse.originalEvent,e=2===d.button||3===d.which,f=e?"rightup":"mouseup",g=e?"rightclick":"click",h=e?"rightupoutside":"mouseupoutside",i=e?"__isRightDown":"__isDown",j=0;b>j;j++){var k=this.interactiveItems[j];(k[g]||k[f]||k[h])&&(k.__hit=this.hitTest(k,this.mouse),k.__hit&&!c?(k[f]&&k[f](this.mouse),k[i]&&k[g]&&k[g](this.mouse),k.interactiveChildren||(c=!0)):k[i]&&k[h]&&k[h](this.mouse),k[i]=!1)}},b.InteractionManager.prototype.hitTest=function(a,c){var d=c.global;if(!a.worldVisible)return!1;a.worldTransform.applyInverse(d,this._tempPoint);var e,f=this._tempPoint.x,g=this._tempPoint.y;if(c.target=a,a.hitArea&&a.hitArea.contains)return a.hitArea.contains(f,g);if(a instanceof b.Sprite){var h,i=a.texture.frame.width,j=a.texture.frame.height,k=-i*a.anchor.x;if(f>k&&k+i>f&&(h=-j*a.anchor.y,g>h&&h+j>g))return!0}else if(a instanceof b.Graphics){var l=a.graphicsData;for(e=0;ee;e++){var o=a.children[e],p=this.hitTest(o,c);if(p)return c.target=a,!0}return!1},b.InteractionManager.prototype.onTouchMove=function(a){this.dirty&&this.rebuildInteractiveGraph();var b,c=this.interactionDOMElement.getBoundingClientRect(),d=a.changedTouches,e=0;for(e=0;ei;i++){var j=this.interactiveItems[i];if((j.touchstart||j.tap)&&(j.__hit=this.hitTest(j,g),j.__hit&&(j.touchstart&&j.touchstart(g),j.__isDown=!0,j.__touchData=j.__touchData||{},j.__touchData[f.identifier]=g,!j.interactiveChildren)))break}}},b.InteractionManager.prototype.onTouchEnd=function(a){this.dirty&&this.rebuildInteractiveGraph();for(var b=this.interactionDOMElement.getBoundingClientRect(),c=a.changedTouches,d=0;di;i++){var j=this.interactiveItems[i];j.__touchData&&j.__touchData[e.identifier]&&(j.__hit=this.hitTest(j,j.__touchData[e.identifier]),f.originalEvent=a,(j.touchend||j.tap)&&(j.__hit&&!g?(j.touchend&&j.touchend(f),j.__isDown&&j.tap&&j.tap(f),j.interactiveChildren||(g=!0)):j.__isDown&&j.touchendoutside&&j.touchendoutside(f),j.__isDown=!1),j.__touchData[e.identifier]=null)}this.pool.push(f),this.touches[e.identifier]=null}},b.InteractionManager.prototype.onTouchCancel=function(a){this.dirty&&this.rebuildInteractiveGraph();for(var b=this.interactionDOMElement.getBoundingClientRect(),c=a.changedTouches,d=0;di;i++){var j=this.interactiveItems[i];j.__touchData&&j.__touchData[e.identifier]&&(j.__hit=this.hitTest(j,j.__touchData[e.identifier]),f.originalEvent=a,j.touchcancel&&!g&&(j.touchcancel(f),j.interactiveChildren||(g=!0)),j.__isDown=!1,j.__touchData[e.identifier]=null)}this.pool.push(f),this.touches[e.identifier]=null}},b.Stage=function(a){b.DisplayObjectContainer.call(this),this.worldTransform=new b.Matrix,this.interactive=!0,this.interactionManager=new b.InteractionManager(this),this.dirty=!0,this.stage=this,this.stage.hitArea=new b.Rectangle(0,0,1e5,1e5),this.setBackgroundColor(a)},b.Stage.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Stage.prototype.constructor=b.Stage,b.Stage.prototype.setInteractionDelegate=function(a){this.interactionManager.setTargetDomElement(a)},b.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var a=0,b=this.children.length;b>a;a++)this.children[a].updateTransform();this.dirty&&(this.dirty=!1,this.interactionManager.dirty=!0),this.interactive&&this.interactionManager.update()},b.Stage.prototype.setBackgroundColor=function(a){this.backgroundColor=a||0,this.backgroundColorSplit=b.hex2rgb(this.backgroundColor);var c=this.backgroundColor.toString(16);c="000000".substr(0,6-c.length)+c,this.backgroundColorString="#"+c},b.Stage.prototype.getMousePosition=function(){return this.interactionManager.mouse.global},function(a){for(var b=0,c=["ms","moz","webkit","o"],d=0;d>16&255)/255,(a>>8&255)/255,(255&a)/255]},b.rgb2hex=function(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]},"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){return function(a){function b(){for(var d=arguments.length,f=new Array(d);d--;)f[d]=arguments[d];return f=e.concat(f),c.apply(this instanceof b?this:a,f)}var c=this,d=arguments.length-1,e=[];if(d>0)for(e.length=d;d--;)e[d]=arguments[d+1];if("function"!=typeof c)throw new TypeError;return b.prototype=function f(a){return a&&(f.prototype=a),this instanceof f?void 0:new f}(c.prototype),b}}()),b.AjaxRequest=function(){var a=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Microsoft.XMLHTTP"];if(!window.ActiveXObject)return window.XMLHttpRequest?new window.XMLHttpRequest:!1;for(var b=0;b0&&0===(a&a-1))return a;for(var b=1;a>b;)b<<=1;return b},b.isPowerOfTwo=function(a,b){return a>0&&0===(a&a-1)&&b>0&&0===(b&b-1)},b.EventTarget={call:function(a){a&&(a=a.prototype||a,b.EventTarget.mixin(a))},mixin:function(a){a.listeners=function(a){return this._listeners=this._listeners||{},this._listeners[a]?this._listeners[a].slice():[]},a.emit=a.dispatchEvent=function(a,c){if(this._listeners=this._listeners||{},"object"==typeof a&&(c=a,a=a.type),c&&c.__isEventObject===!0||(c=new b.Event(this,a,c)),this._listeners&&this._listeners[a]){var d,e=this._listeners[a].slice(0),f=e.length,g=e[0];for(d=0;f>d;g=e[++d])if(g.call(this,c),c.stoppedImmediate)return this;if(c.stopped)return this}return this.parent&&this.parent.emit&&this.parent.emit.call(this.parent,a,c),this},a.on=a.addEventListener=function(a,b){return this._listeners=this._listeners||{},(this._listeners[a]=this._listeners[a]||[]).push(b),this},a.once=function(a,b){function c(){b.apply(d.off(a,c),arguments)}this._listeners=this._listeners||{};var d=this;return c._originalHandler=b,this.on(a,c)},a.off=a.removeEventListener=function(a,b){if(this._listeners=this._listeners||{},!this._listeners[a])return this;for(var c=this._listeners[a],d=b?c.length:0;d-->0;)(c[d]===b||c[d]._originalHandler===b)&&c.splice(d,1);return 0===c.length&&delete this._listeners[a],this},a.removeAllListeners=function(a){return this._listeners=this._listeners||{},this._listeners[a]?(delete this._listeners[a],this):this}}},b.Event=function(a,b,c){this.__isEventObject=!0,this.stopped=!1,this.stoppedImmediate=!1,this.target=a,this.type=b,this.data=c,this.content=c,this.timeStamp=Date.now()},b.Event.prototype.stopPropagation=function(){this.stopped=!0},b.Event.prototype.stopImmediatePropagation=function(){this.stoppedImmediate=!0},b.autoDetectRenderer=function(a,c,d){a||(a=800),c||(c=600);var e=function(){try{var a=document.createElement("canvas");return!!window.WebGLRenderingContext&&(a.getContext("webgl")||a.getContext("experimental-webgl"))}catch(b){return!1}}();return e?new b.WebGLRenderer(a,c,d):new b.CanvasRenderer(a,c,d)},b.autoDetectRecommendedRenderer=function(a,c,d){a||(a=800),c||(c=600);var e=function(){try{var a=document.createElement("canvas");return!!window.WebGLRenderingContext&&(a.getContext("webgl")||a.getContext("experimental-webgl"))}catch(b){return!1}}(),f=/Android/i.test(navigator.userAgent);return e&&!f?new b.WebGLRenderer(a,c,d):new b.CanvasRenderer(a,c,d)},b.PolyK={},b.PolyK.Triangulate=function(a){var c=!0,d=a.length>>1;if(3>d)return[];for(var e=[],f=[],g=0;d>g;g++)f.push(g);g=0;for(var h=d;h>3;){var i=f[(g+0)%h],j=f[(g+1)%h],k=f[(g+2)%h],l=a[2*i],m=a[2*i+1],n=a[2*j],o=a[2*j+1],p=a[2*k],q=a[2*k+1],r=!1;if(b.PolyK._convex(l,m,n,o,p,q,c)){r=!0;for(var s=0;h>s;s++){var t=f[s];if(t!==i&&t!==j&&t!==k&&b.PolyK._PointInTriangle(a[2*t],a[2*t+1],l,m,n,o,p,q)){r=!1;break}}}if(r)e.push(i,j,k),f.splice((g+1)%h,1),h--,g=0;else if(g++>3*h){if(!c)return null;for(e=[],f=[],g=0;d>g;g++)f.push(g);g=0,h=d,c=!1}}return e.push(f[0],f[1],f[2]),e},b.PolyK._PointInTriangle=function(a,b,c,d,e,f,g,h){var i=g-c,j=h-d,k=e-c,l=f-d,m=a-c,n=b-d,o=i*i+j*j,p=i*k+j*l,q=i*m+j*n,r=k*k+l*l,s=k*m+l*n,t=1/(o*r-p*p),u=(r*q-p*s)*t,v=(o*s-p*q)*t;return u>=0&&v>=0&&1>u+v},b.PolyK._convex=function(a,b,c,d,e,f,g){return(b-d)*(e-c)+(c-a)*(f-d)>=0===g},b.initDefaultShaders=function(){},b.CompileVertexShader=function(a,c){return b._CompileShader(a,c,a.VERTEX_SHADER)},b.CompileFragmentShader=function(a,c){return b._CompileShader(a,c,a.FRAGMENT_SHADER)},b._CompileShader=function(a,b,c){var d=b.join("\n"),e=a.createShader(c);return a.shaderSource(e,d),a.compileShader(e),a.getShaderParameter(e,a.COMPILE_STATUS)?e:(window.console.log(a.getShaderInfoLog(e)),null)},b.compileProgram=function(a,c,d){var e=b.CompileFragmentShader(a,d),f=b.CompileVertexShader(a,c),g=a.createProgram();return a.attachShader(g,f),a.attachShader(g,e),a.linkProgram(g),a.getProgramParameter(g,a.LINK_STATUS)||window.console.log("Could not initialise shaders"),g},b.PixiShader=function(a){this._UID=b._UID++,this.gl=a,this.program=null,this.fragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"],this.textureCount=0,this.firstRun=!0,this.dirty=!0,this.attributes=[],this.init()},b.PixiShader.prototype.constructor=b.PixiShader,b.PixiShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc||b.PixiShader.defaultVertexSrc,this.fragmentSrc);a.useProgram(c),this.uSampler=a.getUniformLocation(c,"uSampler"),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.dimensions=a.getUniformLocation(c,"dimensions"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.aTextureCoord=a.getAttribLocation(c,"aTextureCoord"),this.colorAttribute=a.getAttribLocation(c,"aColor"),-1===this.colorAttribute&&(this.colorAttribute=2),this.attributes=[this.aVertexPosition,this.aTextureCoord,this.colorAttribute];for(var d in this.uniforms)this.uniforms[d].uniformLocation=a.getUniformLocation(c,d);this.initUniforms(),this.program=c},b.PixiShader.prototype.initUniforms=function(){this.textureCount=1;var a,b=this.gl;for(var c in this.uniforms){a=this.uniforms[c];var d=a.type;"sampler2D"===d?(a._init=!1,null!==a.value&&this.initSampler2D(a)):"mat2"===d||"mat3"===d||"mat4"===d?(a.glMatrix=!0,a.glValueLength=1,"mat2"===d?a.glFunc=b.uniformMatrix2fv:"mat3"===d?a.glFunc=b.uniformMatrix3fv:"mat4"===d&&(a.glFunc=b.uniformMatrix4fv)):(a.glFunc=b["uniform"+d],a.glValueLength="2f"===d||"2i"===d?2:"3f"===d||"3i"===d?3:"4f"===d||"4i"===d?4:1)}},b.PixiShader.prototype.initSampler2D=function(a){if(a.value&&a.value.baseTexture&&a.value.baseTexture.hasLoaded){var b=this.gl;if(b.activeTexture(b["TEXTURE"+this.textureCount]),b.bindTexture(b.TEXTURE_2D,a.value.baseTexture._glTextures[b.id]),a.textureData){var c=a.textureData,d=c.magFilter?c.magFilter:b.LINEAR,e=c.minFilter?c.minFilter:b.LINEAR,f=c.wrapS?c.wrapS:b.CLAMP_TO_EDGE,g=c.wrapT?c.wrapT:b.CLAMP_TO_EDGE,h=c.luminance?b.LUMINANCE:b.RGBA;if(c.repeat&&(f=b.REPEAT,g=b.REPEAT),b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!!c.flipY),c.width){var i=c.width?c.width:512,j=c.height?c.height:2,k=c.border?c.border:0;b.texImage2D(b.TEXTURE_2D,0,h,i,j,k,h,b.UNSIGNED_BYTE,null)}else b.texImage2D(b.TEXTURE_2D,0,h,b.RGBA,b.UNSIGNED_BYTE,a.value.baseTexture.source);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,d),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,e),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,f),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,g)}b.uniform1i(a.uniformLocation,this.textureCount),a._init=!0,this.textureCount++}},b.PixiShader.prototype.syncUniforms=function(){this.textureCount=1;var a,c=this.gl;for(var d in this.uniforms)a=this.uniforms[d],1===a.glValueLength?a.glMatrix===!0?a.glFunc.call(c,a.uniformLocation,a.transpose,a.value):a.glFunc.call(c,a.uniformLocation,a.value):2===a.glValueLength?a.glFunc.call(c,a.uniformLocation,a.value.x,a.value.y):3===a.glValueLength?a.glFunc.call(c,a.uniformLocation,a.value.x,a.value.y,a.value.z):4===a.glValueLength?a.glFunc.call(c,a.uniformLocation,a.value.x,a.value.y,a.value.z,a.value.w):"sampler2D"===a.type&&(a._init?(c.activeTexture(c["TEXTURE"+this.textureCount]),a.value.baseTexture._dirty[c.id]?b.instances[c.id].updateTexture(a.value.baseTexture):c.bindTexture(c.TEXTURE_2D,a.value.baseTexture._glTextures[c.id]),c.uniform1i(a.uniformLocation,this.textureCount),this.textureCount++):this.initSampler2D(a))},b.PixiShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},b.PixiShader.defaultVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec4 aColor;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","varying vec2 vTextureCoord;","varying vec4 vColor;","const vec2 center = vec2(-1.0, 1.0);","void main(void) {"," gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = vec4(aColor.rgb * aColor.a, aColor.a);","}"],b.PixiFastShader=function(a){this._UID=b._UID++,this.gl=a,this.program=null,this.fragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform mat3 uMatrix;","varying vec2 vTextureCoord;","varying float vColor;","const vec2 center = vec2(-1.0, 1.0);","void main(void) {"," vec2 v;"," vec2 sv = aVertexPosition * aScale;"," v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);"," v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);"," v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;"," gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"],this.textureCount=0,this.init()},b.PixiFastShader.prototype.constructor=b.PixiFastShader,b.PixiFastShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.uSampler=a.getUniformLocation(c,"uSampler"),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.dimensions=a.getUniformLocation(c,"dimensions"),this.uMatrix=a.getUniformLocation(c,"uMatrix"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.aPositionCoord=a.getAttribLocation(c,"aPositionCoord"),this.aScale=a.getAttribLocation(c,"aScale"),this.aRotation=a.getAttribLocation(c,"aRotation"),this.aTextureCoord=a.getAttribLocation(c,"aTextureCoord"),this.colorAttribute=a.getAttribLocation(c,"aColor"),-1===this.colorAttribute&&(this.colorAttribute=2),this.attributes=[this.aVertexPosition,this.aPositionCoord,this.aScale,this.aRotation,this.aTextureCoord,this.colorAttribute],this.program=c},b.PixiFastShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},b.StripShader=function(a){this._UID=b._UID++,this.gl=a,this.program=null,this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","uniform float alpha;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * alpha;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","varying vec2 vTextureCoord;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);"," vTextureCoord = aTextureCoord;","}"],this.init()},b.StripShader.prototype.constructor=b.StripShader,b.StripShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.uSampler=a.getUniformLocation(c,"uSampler"),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.colorAttribute=a.getAttribLocation(c,"aColor"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.aTextureCoord=a.getAttribLocation(c,"aTextureCoord"),this.attributes=[this.aVertexPosition,this.aTextureCoord],this.translationMatrix=a.getUniformLocation(c,"translationMatrix"),this.alpha=a.getUniformLocation(c,"alpha"),this.program=c},b.StripShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attribute=null},b.PrimitiveShader=function(a){this._UID=b._UID++,this.gl=a,this.program=null,this.fragmentSrc=["precision mediump float;","varying vec4 vColor;","void main(void) {"," gl_FragColor = vColor;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform float alpha;","uniform float flipY;","uniform vec3 tint;","varying vec4 vColor;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);"," vColor = aColor * vec4(tint * alpha, alpha);","}"],this.init()},b.PrimitiveShader.prototype.constructor=b.PrimitiveShader,b.PrimitiveShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.tintColor=a.getUniformLocation(c,"tint"),this.flipY=a.getUniformLocation(c,"flipY"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.colorAttribute=a.getAttribLocation(c,"aColor"),this.attributes=[this.aVertexPosition,this.colorAttribute],this.translationMatrix=a.getUniformLocation(c,"translationMatrix"),this.alpha=a.getUniformLocation(c,"alpha"),this.program=c},b.PrimitiveShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},b.ComplexPrimitiveShader=function(a){this._UID=b._UID++,this.gl=a,this.program=null,this.fragmentSrc=["precision mediump float;","varying vec4 vColor;","void main(void) {"," gl_FragColor = vColor;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform vec3 tint;","uniform float alpha;","uniform vec3 color;","uniform float flipY;","varying vec4 vColor;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);"," vColor = vec4(color * alpha * tint, alpha);","}"],this.init()},b.ComplexPrimitiveShader.prototype.constructor=b.ComplexPrimitiveShader,b.ComplexPrimitiveShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.tintColor=a.getUniformLocation(c,"tint"),this.color=a.getUniformLocation(c,"color"),this.flipY=a.getUniformLocation(c,"flipY"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.attributes=[this.aVertexPosition,this.colorAttribute],this.translationMatrix=a.getUniformLocation(c,"translationMatrix"),this.alpha=a.getUniformLocation(c,"alpha"),this.program=c},b.ComplexPrimitiveShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attribute=null},b.WebGLGraphics=function(){},b.WebGLGraphics.renderGraphics=function(a,c){var d,e=c.gl,f=c.projection,g=c.offset,h=c.shaderManager.primitiveShader;a.dirty&&b.WebGLGraphics.updateGraphics(a,e);for(var i=a._webGL[e.id],j=0;j=6)if(h.points.length<12){g=b.WebGLGraphics.switchMode(d,0);var i=b.WebGLGraphics.buildPoly(h,g);i||(g=b.WebGLGraphics.switchMode(d,1),b.WebGLGraphics.buildComplexPoly(h,g))}else g=b.WebGLGraphics.switchMode(d,1),b.WebGLGraphics.buildComplexPoly(h,g);h.lineWidth>0&&(g=b.WebGLGraphics.switchMode(d,0),b.WebGLGraphics.buildLine(h,g))}else g=b.WebGLGraphics.switchMode(d,0),h.type===b.Graphics.RECT?b.WebGLGraphics.buildRectangle(h,g):h.type===b.Graphics.CIRC||h.type===b.Graphics.ELIP?b.WebGLGraphics.buildCircle(h,g):h.type===b.Graphics.RREC&&b.WebGLGraphics.buildRoundedRectangle(h,g);d.lastIndex++}for(e=0;e=q;q++)p=q/n,h=g(a,c,p),i=g(b,d,p),j=g(c,e,p),k=g(d,f,p),l=g(h,j,p),m=g(i,k,p),o.push(l,m);return o},b.WebGLGraphics.buildCircle=function(a,c){var d,e,f=a.shape,g=f.x,h=f.y;a.type===b.Graphics.CIRC?(d=f.radius,e=f.radius):(d=f.width,e=f.height);var i=40,j=2*Math.PI/i,k=0;if(a.fill){var l=b.hex2rgb(a.fillColor),m=a.fillAlpha,n=l[0]*m,o=l[1]*m,p=l[2]*m,q=c.points,r=c.indices,s=q.length/6;for(r.push(s),k=0;i+1>k;k++)q.push(g,h,n,o,p,m),q.push(g+Math.sin(j*k)*d,h+Math.cos(j*k)*e,n,o,p,m),r.push(s++,s++);r.push(s-1) -}if(a.lineWidth){var t=a.points;for(a.points=[],k=0;i+1>k;k++)a.points.push(g+Math.sin(j*k)*d,h+Math.cos(j*k)*e);b.WebGLGraphics.buildLine(a,c),a.points=t}},b.WebGLGraphics.buildLine=function(a,c){var d=0,e=a.points;if(0!==e.length){if(a.lineWidth%2)for(d=0;dd;d++)l=e[2*(d-1)],m=e[2*(d-1)+1],n=e[2*d],o=e[2*d+1],p=e[2*(d+1)],q=e[2*(d+1)+1],r=-(m-o),s=l-n,F=Math.sqrt(r*r+s*s),r/=F,s/=F,r*=L,s*=L,t=-(o-q),u=n-p,F=Math.sqrt(t*t+u*u),t/=F,u/=F,t*=L,u*=L,x=-s+m-(-s+o),y=-r+n-(-r+l),z=(-r+l)*(-s+o)-(-r+n)*(-s+m),A=-u+q-(-u+o),B=-t+n-(-t+p),C=(-t+p)*(-u+o)-(-t+n)*(-u+q),D=x*B-A*y,Math.abs(D)<.1?(D+=10.1,G.push(n-r,o-s,O,P,Q,N),G.push(n+r,o+s,O,P,Q,N)):(j=(y*C-B*z)/D,k=(A*z-x*C)/D,E=(j-n)*(j-n)+(k-o)+(k-o),E>19600?(v=r-t,w=s-u,F=Math.sqrt(v*v+w*w),v/=F,w/=F,v*=L,w*=L,G.push(n-v,o-w),G.push(O,P,Q,N),G.push(n+v,o+w),G.push(O,P,Q,N),G.push(n-v,o-w),G.push(O,P,Q,N),J++):(G.push(j,k),G.push(O,P,Q,N),G.push(n-(j-n),o-(k-o)),G.push(O,P,Q,N)));for(l=e[2*(I-2)],m=e[2*(I-2)+1],n=e[2*(I-1)],o=e[2*(I-1)+1],r=-(m-o),s=l-n,F=Math.sqrt(r*r+s*s),r/=F,s/=F,r*=L,s*=L,G.push(n-r,o-s),G.push(O,P,Q,N),G.push(n+r,o+s),G.push(O,P,Q,N),H.push(K),d=0;J>d;d++)H.push(K++);H.push(K-1)}},b.WebGLGraphics.buildComplexPoly=function(a,c){var d=a.points.slice();if(!(d.length<6)){var e=c.indices;c.points=d,c.alpha=a.fillAlpha,c.color=b.hex2rgb(a.fillColor);for(var f,g,h=1/0,i=-1/0,j=1/0,k=-1/0,l=0;lf?f:h,i=f>i?f:i,j=j>g?g:j,k=g>k?g:k;d.push(h,j,i,j,i,k,h,k);var m=d.length/2;for(l=0;m>l;l++)e.push(l)}},b.WebGLGraphics.buildPoly=function(a,c){var d=a.points;if(!(d.length<6)){var e=c.points,f=c.indices,g=d.length/2,h=b.hex2rgb(a.fillColor),i=a.fillAlpha,j=h[0]*i,k=h[1]*i,l=h[2]*i,m=b.PolyK.Triangulate(d);if(!m)return!1;var n=e.length/6,o=0;for(o=0;oo;o++)e.push(d[2*o],d[2*o+1],j,k,l,i);return!0}},b.WebGLGraphics.graphicsDataPool=[],b.WebGLGraphicsData=function(a){this.gl=a,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),this.mode=1,this.alpha=1,this.dirty=!0},b.WebGLGraphicsData.prototype.reset=function(){this.points=[],this.indices=[]},b.WebGLGraphicsData.prototype.upload=function(){var a=this.gl;this.glPoints=new b.Float32Array(this.points),a.bindBuffer(a.ARRAY_BUFFER,this.buffer),a.bufferData(a.ARRAY_BUFFER,this.glPoints,a.STATIC_DRAW),this.glIndicies=new b.Uint16Array(this.indices),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.glIndicies,a.STATIC_DRAW),this.dirty=!1},b.glContexts=[],b.instances=[],b.WebGLRenderer=function(a,c,d){if(d)for(var e in b.defaultRenderOptions)"undefined"==typeof d[e]&&(d[e]=b.defaultRenderOptions[e]);else d=b.defaultRenderOptions;b.defaultRenderer||(b.sayHello("webGL"),b.defaultRenderer=this),this.type=b.WEBGL_RENDERER,this.resolution=d.resolution,this.transparent=d.transparent,this.autoResize=d.autoResize||!1,this.preserveDrawingBuffer=d.preserveDrawingBuffer,this.clearBeforeRender=d.clearBeforeRender,this.width=a||800,this.height=c||600,this.view=d.view||document.createElement("canvas"),this.contextLostBound=this.handleContextLost.bind(this),this.contextRestoredBound=this.handleContextRestored.bind(this),this.view.addEventListener("webglcontextlost",this.contextLostBound,!1),this.view.addEventListener("webglcontextrestored",this.contextRestoredBound,!1),this._contextOptions={alpha:this.transparent,antialias:d.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:d.preserveDrawingBuffer},this.projection=new b.Point,this.offset=new b.Point(0,0),this.shaderManager=new b.WebGLShaderManager,this.spriteBatch=new b.WebGLSpriteBatch,this.maskManager=new b.WebGLMaskManager,this.filterManager=new b.WebGLFilterManager,this.stencilManager=new b.WebGLStencilManager,this.blendModeManager=new b.WebGLBlendModeManager,this.renderSession={},this.renderSession.gl=this.gl,this.renderSession.drawCount=0,this.renderSession.shaderManager=this.shaderManager,this.renderSession.maskManager=this.maskManager,this.renderSession.filterManager=this.filterManager,this.renderSession.blendModeManager=this.blendModeManager,this.renderSession.spriteBatch=this.spriteBatch,this.renderSession.stencilManager=this.stencilManager,this.renderSession.renderer=this,this.renderSession.resolution=this.resolution,this.initContext(),this.mapBlendModes()},b.WebGLRenderer.prototype.constructor=b.WebGLRenderer,b.WebGLRenderer.prototype.initContext=function(){var a=this.view.getContext("webgl",this._contextOptions)||this.view.getContext("experimental-webgl",this._contextOptions);if(this.gl=a,!a)throw new Error("This browser does not support webGL. Try using the canvas renderer");this.glContextId=a.id=b.WebGLRenderer.glContextId++,b.glContexts[this.glContextId]=a,b.instances[this.glContextId]=this,a.disable(a.DEPTH_TEST),a.disable(a.CULL_FACE),a.enable(a.BLEND),this.shaderManager.setContext(a),this.spriteBatch.setContext(a),this.maskManager.setContext(a),this.filterManager.setContext(a),this.blendModeManager.setContext(a),this.stencilManager.setContext(a),this.renderSession.gl=this.gl,this.resize(this.width,this.height)},b.WebGLRenderer.prototype.render=function(a){if(!this.contextLost){this.__stage!==a&&(a.interactive&&a.interactionManager.removeEvents(),this.__stage=a),a.updateTransform();var b=this.gl;a._interactive?a._interactiveEventsAdded||(a._interactiveEventsAdded=!0,a.interactionManager.setTarget(this)):a._interactiveEventsAdded&&(a._interactiveEventsAdded=!1,a.interactionManager.setTarget(this)),b.viewport(0,0,this.width,this.height),b.bindFramebuffer(b.FRAMEBUFFER,null),this.clearBeforeRender&&(this.transparent?b.clearColor(0,0,0,0):b.clearColor(a.backgroundColorSplit[0],a.backgroundColorSplit[1],a.backgroundColorSplit[2],1),b.clear(b.COLOR_BUFFER_BIT)),this.renderDisplayObject(a,this.projection)}},b.WebGLRenderer.prototype.renderDisplayObject=function(a,c,d){this.renderSession.blendModeManager.setBlendMode(b.blendModes.NORMAL),this.renderSession.drawCount=0,this.renderSession.flipY=d?-1:1,this.renderSession.projection=c,this.renderSession.offset=this.offset,this.spriteBatch.begin(this.renderSession),this.filterManager.begin(this.renderSession,d),a._renderWebGL(this.renderSession),this.spriteBatch.end()},b.WebGLRenderer.prototype.resize=function(a,b){this.width=a*this.resolution,this.height=b*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px",this.view.style.height=this.height/this.resolution+"px"),this.gl.viewport(0,0,this.width,this.height),this.projection.x=this.width/2/this.resolution,this.projection.y=-this.height/2/this.resolution},b.WebGLRenderer.prototype.updateTexture=function(a){if(a.hasLoaded){var c=this.gl;return a._glTextures[c.id]||(a._glTextures[c.id]=c.createTexture()),c.bindTexture(c.TEXTURE_2D,a._glTextures[c.id]),c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultipliedAlpha),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a.source),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),a.mipmap&&b.isPowerOfTwo(a.width,a.height)?(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR_MIPMAP_LINEAR:c.NEAREST_MIPMAP_NEAREST),c.generateMipmap(c.TEXTURE_2D)):c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),a._powerOf2?(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.REPEAT),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.REPEAT)):(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE)),a._dirty[c.id]=!1,a._glTextures[c.id]}},b.WebGLRenderer.prototype.handleContextLost=function(a){a.preventDefault(),this.contextLost=!0},b.WebGLRenderer.prototype.handleContextRestored=function(){this.initContext();for(var a in b.TextureCache){var c=b.TextureCache[a].baseTexture;c._glTextures=[]}this.contextLost=!1},b.WebGLRenderer.prototype.destroy=function(){this.view.removeEventListener("webglcontextlost",this.contextLostBound),this.view.removeEventListener("webglcontextrestored",this.contextRestoredBound),b.glContexts[this.glContextId]=null,this.projection=null,this.offset=null,this.shaderManager.destroy(),this.spriteBatch.destroy(),this.maskManager.destroy(),this.filterManager.destroy(),this.shaderManager=null,this.spriteBatch=null,this.maskManager=null,this.filterManager=null,this.gl=null,this.renderSession=null},b.WebGLRenderer.prototype.mapBlendModes=function(){var a=this.gl;b.blendModesWebGL||(b.blendModesWebGL=[],b.blendModesWebGL[b.blendModes.NORMAL]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.ADD]=[a.SRC_ALPHA,a.DST_ALPHA],b.blendModesWebGL[b.blendModes.MULTIPLY]=[a.DST_COLOR,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.SCREEN]=[a.SRC_ALPHA,a.ONE],b.blendModesWebGL[b.blendModes.OVERLAY]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.DARKEN]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.LIGHTEN]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.COLOR_DODGE]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.COLOR_BURN]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.HARD_LIGHT]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.SOFT_LIGHT]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.DIFFERENCE]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.EXCLUSION]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.HUE]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.SATURATION]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.COLOR]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.LUMINOSITY]=[a.ONE,a.ONE_MINUS_SRC_ALPHA])},b.WebGLRenderer.glContextId=0,b.WebGLBlendModeManager=function(){this.currentBlendMode=99999},b.WebGLBlendModeManager.prototype.constructor=b.WebGLBlendModeManager,b.WebGLBlendModeManager.prototype.setContext=function(a){this.gl=a},b.WebGLBlendModeManager.prototype.setBlendMode=function(a){if(this.currentBlendMode===a)return!1;this.currentBlendMode=a;var c=b.blendModesWebGL[this.currentBlendMode];return this.gl.blendFunc(c[0],c[1]),!0},b.WebGLBlendModeManager.prototype.destroy=function(){this.gl=null},b.WebGLMaskManager=function(){},b.WebGLMaskManager.prototype.constructor=b.WebGLMaskManager,b.WebGLMaskManager.prototype.setContext=function(a){this.gl=a},b.WebGLMaskManager.prototype.pushMask=function(a,c){var d=c.gl;a.dirty&&b.WebGLGraphics.updateGraphics(a,d),a._webGL[d.id].data.length&&c.stencilManager.pushStencil(a,a._webGL[d.id].data[0],c)},b.WebGLMaskManager.prototype.popMask=function(a,b){var c=this.gl;b.stencilManager.popStencil(a,a._webGL[c.id].data[0],b)},b.WebGLMaskManager.prototype.destroy=function(){this.gl=null},b.WebGLStencilManager=function(){this.stencilStack=[],this.reverse=!0,this.count=0},b.WebGLStencilManager.prototype.setContext=function(a){this.gl=a},b.WebGLStencilManager.prototype.pushStencil=function(a,b,c){var d=this.gl;this.bindGraphics(a,b,c),0===this.stencilStack.length&&(d.enable(d.STENCIL_TEST),d.clear(d.STENCIL_BUFFER_BIT),this.reverse=!0,this.count=0),this.stencilStack.push(b);var e=this.count;d.colorMask(!1,!1,!1,!1),d.stencilFunc(d.ALWAYS,0,255),d.stencilOp(d.KEEP,d.KEEP,d.INVERT),1===b.mode?(d.drawElements(d.TRIANGLE_FAN,b.indices.length-4,d.UNSIGNED_SHORT,0),this.reverse?(d.stencilFunc(d.EQUAL,255-e,255),d.stencilOp(d.KEEP,d.KEEP,d.DECR)):(d.stencilFunc(d.EQUAL,e,255),d.stencilOp(d.KEEP,d.KEEP,d.INCR)),d.drawElements(d.TRIANGLE_FAN,4,d.UNSIGNED_SHORT,2*(b.indices.length-4)),this.reverse?d.stencilFunc(d.EQUAL,255-(e+1),255):d.stencilFunc(d.EQUAL,e+1,255),this.reverse=!this.reverse):(this.reverse?(d.stencilFunc(d.EQUAL,e,255),d.stencilOp(d.KEEP,d.KEEP,d.INCR)):(d.stencilFunc(d.EQUAL,255-e,255),d.stencilOp(d.KEEP,d.KEEP,d.DECR)),d.drawElements(d.TRIANGLE_STRIP,b.indices.length,d.UNSIGNED_SHORT,0),this.reverse?d.stencilFunc(d.EQUAL,e+1,255):d.stencilFunc(d.EQUAL,255-(e+1),255)),d.colorMask(!0,!0,!0,!0),d.stencilOp(d.KEEP,d.KEEP,d.KEEP),this.count++},b.WebGLStencilManager.prototype.bindGraphics=function(a,c,d){this._currentGraphics=a;var e,f=this.gl,g=d.projection,h=d.offset;1===c.mode?(e=d.shaderManager.complexPrimitiveShader,d.shaderManager.setShader(e),f.uniform1f(e.flipY,d.flipY),f.uniformMatrix3fv(e.translationMatrix,!1,a.worldTransform.toArray(!0)),f.uniform2f(e.projectionVector,g.x,-g.y),f.uniform2f(e.offsetVector,-h.x,-h.y),f.uniform3fv(e.tintColor,b.hex2rgb(a.tint)),f.uniform3fv(e.color,c.color),f.uniform1f(e.alpha,a.worldAlpha*c.alpha),f.bindBuffer(f.ARRAY_BUFFER,c.buffer),f.vertexAttribPointer(e.aVertexPosition,2,f.FLOAT,!1,8,0),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,c.indexBuffer)):(e=d.shaderManager.primitiveShader,d.shaderManager.setShader(e),f.uniformMatrix3fv(e.translationMatrix,!1,a.worldTransform.toArray(!0)),f.uniform1f(e.flipY,d.flipY),f.uniform2f(e.projectionVector,g.x,-g.y),f.uniform2f(e.offsetVector,-h.x,-h.y),f.uniform3fv(e.tintColor,b.hex2rgb(a.tint)),f.uniform1f(e.alpha,a.worldAlpha),f.bindBuffer(f.ARRAY_BUFFER,c.buffer),f.vertexAttribPointer(e.aVertexPosition,2,f.FLOAT,!1,24,0),f.vertexAttribPointer(e.colorAttribute,4,f.FLOAT,!1,24,8),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,c.indexBuffer))},b.WebGLStencilManager.prototype.popStencil=function(a,b,c){var d=this.gl;if(this.stencilStack.pop(),this.count--,0===this.stencilStack.length)d.disable(d.STENCIL_TEST);else{var e=this.count;this.bindGraphics(a,b,c),d.colorMask(!1,!1,!1,!1),1===b.mode?(this.reverse=!this.reverse,this.reverse?(d.stencilFunc(d.EQUAL,255-(e+1),255),d.stencilOp(d.KEEP,d.KEEP,d.INCR)):(d.stencilFunc(d.EQUAL,e+1,255),d.stencilOp(d.KEEP,d.KEEP,d.DECR)),d.drawElements(d.TRIANGLE_FAN,4,d.UNSIGNED_SHORT,2*(b.indices.length-4)),d.stencilFunc(d.ALWAYS,0,255),d.stencilOp(d.KEEP,d.KEEP,d.INVERT),d.drawElements(d.TRIANGLE_FAN,b.indices.length-4,d.UNSIGNED_SHORT,0),this.reverse?d.stencilFunc(d.EQUAL,e,255):d.stencilFunc(d.EQUAL,255-e,255)):(this.reverse?(d.stencilFunc(d.EQUAL,e+1,255),d.stencilOp(d.KEEP,d.KEEP,d.DECR)):(d.stencilFunc(d.EQUAL,255-(e+1),255),d.stencilOp(d.KEEP,d.KEEP,d.INCR)),d.drawElements(d.TRIANGLE_STRIP,b.indices.length,d.UNSIGNED_SHORT,0),this.reverse?d.stencilFunc(d.EQUAL,e,255):d.stencilFunc(d.EQUAL,255-e,255)),d.colorMask(!0,!0,!0,!0),d.stencilOp(d.KEEP,d.KEEP,d.KEEP)}},b.WebGLStencilManager.prototype.destroy=function(){this.stencilStack=null,this.gl=null},b.WebGLShaderManager=function(){this.maxAttibs=10,this.attribState=[],this.tempAttribState=[];for(var a=0;ad;d+=6,e+=4)this.indices[d+0]=e+0,this.indices[d+1]=e+1,this.indices[d+2]=e+2,this.indices[d+3]=e+0,this.indices[d+4]=e+2,this.indices[d+5]=e+3;this.drawing=!1,this.currentBatchSize=0,this.currentBaseTexture=null,this.dirty=!0,this.textures=[],this.blendModes=[],this.shaders=[],this.sprites=[],this.defaultShader=new b.AbstractFilter(["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"])},b.WebGLSpriteBatch.prototype.setContext=function(a){this.gl=a,this.vertexBuffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.indices,a.STATIC_DRAW),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferData(a.ARRAY_BUFFER,this.vertices,a.DYNAMIC_DRAW),this.currentBlendMode=99999;var c=new b.PixiShader(a);c.fragmentSrc=this.defaultShader.fragmentSrc,c.uniforms={},c.init(),this.defaultShader.shaders[a.id]=c},b.WebGLSpriteBatch.prototype.begin=function(a){this.renderSession=a,this.shader=this.renderSession.shaderManager.defaultShader,this.start()},b.WebGLSpriteBatch.prototype.end=function(){this.flush()},b.WebGLSpriteBatch.prototype.render=function(a){var b=a.texture;this.currentBatchSize>=this.size&&(this.flush(),this.currentBaseTexture=b.baseTexture);var c=b._uvs;if(c){var d,e,f,g,h=a.anchor.x,i=a.anchor.y;if(b.trim){var j=b.trim;e=j.x-h*j.width,d=e+b.crop.width,g=j.y-i*j.height,f=g+b.crop.height}else d=b.frame.width*(1-h),e=b.frame.width*-h,f=b.frame.height*(1-i),g=b.frame.height*-i;var k=4*this.currentBatchSize*this.vertSize,l=b.baseTexture.resolution,m=a.worldTransform,n=m.a/l,o=m.b/l,p=m.c/l,q=m.d/l,r=m.tx,s=m.ty,t=this.colors,u=this.positions;this.renderSession.roundPixels?(u[k]=n*e+p*g+r|0,u[k+1]=q*g+o*e+s|0,u[k+5]=n*d+p*g+r|0,u[k+6]=q*g+o*d+s|0,u[k+10]=n*d+p*f+r|0,u[k+11]=q*f+o*d+s|0,u[k+15]=n*e+p*f+r|0,u[k+16]=q*f+o*e+s|0):(u[k]=n*e+p*g+r,u[k+1]=q*g+o*e+s,u[k+5]=n*d+p*g+r,u[k+6]=q*g+o*d+s,u[k+10]=n*d+p*f+r,u[k+11]=q*f+o*d+s,u[k+15]=n*e+p*f+r,u[k+16]=q*f+o*e+s),u[k+2]=c.x0,u[k+3]=c.y0,u[k+7]=c.x1,u[k+8]=c.y1,u[k+12]=c.x2,u[k+13]=c.y2,u[k+17]=c.x3,u[k+18]=c.y3;var v=a.tint;t[k+4]=t[k+9]=t[k+14]=t[k+19]=(v>>16)+(65280&v)+((255&v)<<16)+(255*a.worldAlpha<<24),this.sprites[this.currentBatchSize++]=a}},b.WebGLSpriteBatch.prototype.renderTilingSprite=function(a){var c=a.tilingTexture;this.currentBatchSize>=this.size&&(this.flush(),this.currentBaseTexture=c.baseTexture),a._uvs||(a._uvs=new b.TextureUvs);var d=a._uvs;a.tilePosition.x%=c.baseTexture.width*a.tileScaleOffset.x,a.tilePosition.y%=c.baseTexture.height*a.tileScaleOffset.y;var e=a.tilePosition.x/(c.baseTexture.width*a.tileScaleOffset.x),f=a.tilePosition.y/(c.baseTexture.height*a.tileScaleOffset.y),g=a.width/c.baseTexture.width/(a.tileScale.x*a.tileScaleOffset.x),h=a.height/c.baseTexture.height/(a.tileScale.y*a.tileScaleOffset.y);d.x0=0-e,d.y0=0-f,d.x1=1*g-e,d.y1=0-f,d.x2=1*g-e,d.y2=1*h-f,d.x3=0-e,d.y3=1*h-f;var i=a.tint,j=(i>>16)+(65280&i)+((255&i)<<16)+(255*a.alpha<<24),k=this.positions,l=this.colors,m=a.width,n=a.height,o=a.anchor.x,p=a.anchor.y,q=m*(1-o),r=m*-o,s=n*(1-p),t=n*-p,u=4*this.currentBatchSize*this.vertSize,v=c.baseTexture.resolution,w=a.worldTransform,x=w.a/v,y=w.b/v,z=w.c/v,A=w.d/v,B=w.tx,C=w.ty;k[u++]=x*r+z*t+B,k[u++]=A*t+y*r+C,k[u++]=d.x0,k[u++]=d.y0,l[u++]=j,k[u++]=x*q+z*t+B,k[u++]=A*t+y*q+C,k[u++]=d.x1,k[u++]=d.y1,l[u++]=j,k[u++]=x*q+z*s+B,k[u++]=A*s+y*q+C,k[u++]=d.x2,k[u++]=d.y2,l[u++]=j,k[u++]=x*r+z*s+B,k[u++]=A*s+y*r+C,k[u++]=d.x3,k[u++]=d.y3,l[u++]=j,this.sprites[this.currentBatchSize++]=a},b.WebGLSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var a,c=this.gl;if(this.dirty){this.dirty=!1,c.activeTexture(c.TEXTURE0),c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a=this.defaultShader.shaders[c.id];var d=4*this.vertSize;c.vertexAttribPointer(a.aVertexPosition,2,c.FLOAT,!1,d,0),c.vertexAttribPointer(a.aTextureCoord,2,c.FLOAT,!1,d,8),c.vertexAttribPointer(a.colorAttribute,4,c.UNSIGNED_BYTE,!0,d,16)}if(this.currentBatchSize>.5*this.size)c.bufferSubData(c.ARRAY_BUFFER,0,this.vertices);else{var e=this.positions.subarray(0,4*this.currentBatchSize*this.vertSize);c.bufferSubData(c.ARRAY_BUFFER,0,e)}for(var f,g,h,i,j=0,k=0,l=null,m=this.renderSession.blendModeManager.currentBlendMode,n=null,o=!1,p=!1,q=0,r=this.currentBatchSize;r>q;q++){if(i=this.sprites[q],f=i.texture.baseTexture,g=i.blendMode,h=i.shader||this.defaultShader,o=m!==g,p=n!==h,(l!==f||o||p)&&(this.renderBatch(l,j,k),k=q,j=0,l=f,o&&(m=g,this.renderSession.blendModeManager.setBlendMode(m)),p)){n=h,a=n.shaders[c.id],a||(a=new b.PixiShader(c),a.fragmentSrc=n.fragmentSrc,a.uniforms=n.uniforms,a.init(),n.shaders[c.id]=a),this.renderSession.shaderManager.setShader(a),a.dirty&&a.syncUniforms();var s=this.renderSession.projection;c.uniform2f(a.projectionVector,s.x,s.y);var t=this.renderSession.offset;c.uniform2f(a.offsetVector,t.x,t.y)}j++}this.renderBatch(l,j,k),this.currentBatchSize=0}},b.WebGLSpriteBatch.prototype.renderBatch=function(a,b,c){if(0!==b){var d=this.gl;a._dirty[d.id]?this.renderSession.renderer.updateTexture(a):d.bindTexture(d.TEXTURE_2D,a._glTextures[d.id]),d.drawElements(d.TRIANGLES,6*b,d.UNSIGNED_SHORT,6*c*2),this.renderSession.drawCount++}},b.WebGLSpriteBatch.prototype.stop=function(){this.flush(),this.dirty=!0},b.WebGLSpriteBatch.prototype.start=function(){this.dirty=!0},b.WebGLSpriteBatch.prototype.destroy=function(){this.vertices=null,this.indices=null,this.gl.deleteBuffer(this.vertexBuffer),this.gl.deleteBuffer(this.indexBuffer),this.currentBaseTexture=null,this.gl=null},b.WebGLFastSpriteBatch=function(a){this.vertSize=10,this.maxSize=6e3,this.size=this.maxSize;var c=4*this.size*this.vertSize,d=6*this.maxSize;this.vertices=new b.Float32Array(c),this.indices=new b.Uint16Array(d),this.vertexBuffer=null,this.indexBuffer=null,this.lastIndexCount=0;for(var e=0,f=0;d>e;e+=6,f+=4)this.indices[e+0]=f+0,this.indices[e+1]=f+1,this.indices[e+2]=f+2,this.indices[e+3]=f+0,this.indices[e+4]=f+2,this.indices[e+5]=f+3;this.drawing=!1,this.currentBatchSize=0,this.currentBaseTexture=null,this.currentBlendMode=0,this.renderSession=null,this.shader=null,this.matrix=null,this.setContext(a)},b.WebGLFastSpriteBatch.prototype.constructor=b.WebGLFastSpriteBatch,b.WebGLFastSpriteBatch.prototype.setContext=function(a){this.gl=a,this.vertexBuffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.indices,a.STATIC_DRAW),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferData(a.ARRAY_BUFFER,this.vertices,a.DYNAMIC_DRAW)},b.WebGLFastSpriteBatch.prototype.begin=function(a,b){this.renderSession=b,this.shader=this.renderSession.shaderManager.fastShader,this.matrix=a.worldTransform.toArray(!0),this.start()},b.WebGLFastSpriteBatch.prototype.end=function(){this.flush()},b.WebGLFastSpriteBatch.prototype.render=function(a){var b=a.children,c=b[0];if(c.texture._uvs){this.currentBaseTexture=c.texture.baseTexture,c.blendMode!==this.renderSession.blendModeManager.currentBlendMode&&(this.flush(),this.renderSession.blendModeManager.setBlendMode(c.blendMode));for(var d=0,e=b.length;e>d;d++)this.renderSprite(b[d]);this.flush()}},b.WebGLFastSpriteBatch.prototype.renderSprite=function(a){if(a.visible&&(a.texture.baseTexture===this.currentBaseTexture||(this.flush(),this.currentBaseTexture=a.texture.baseTexture,a.texture._uvs))){var b,c,d,e,f,g,h,i,j=this.vertices;if(b=a.texture._uvs,c=a.texture.frame.width,d=a.texture.frame.height,a.texture.trim){var k=a.texture.trim;f=k.x-a.anchor.x*k.width,e=f+a.texture.crop.width,h=k.y-a.anchor.y*k.height,g=h+a.texture.crop.height}else e=a.texture.frame.width*(1-a.anchor.x),f=a.texture.frame.width*-a.anchor.x,g=a.texture.frame.height*(1-a.anchor.y),h=a.texture.frame.height*-a.anchor.y;i=4*this.currentBatchSize*this.vertSize,j[i++]=f,j[i++]=h,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b.x0,j[i++]=b.y1,j[i++]=a.alpha,j[i++]=e,j[i++]=h,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b.x1,j[i++]=b.y1,j[i++]=a.alpha,j[i++]=e,j[i++]=g,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b.x2,j[i++]=b.y2,j[i++]=a.alpha,j[i++]=f,j[i++]=g,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b.x3,j[i++]=b.y3,j[i++]=a.alpha,this.currentBatchSize++,this.currentBatchSize>=this.size&&this.flush()}},b.WebGLFastSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var a=this.gl;if(this.currentBaseTexture._glTextures[a.id]||this.renderSession.renderer.updateTexture(this.currentBaseTexture,a),a.bindTexture(a.TEXTURE_2D,this.currentBaseTexture._glTextures[a.id]),this.currentBatchSize>.5*this.size)a.bufferSubData(a.ARRAY_BUFFER,0,this.vertices);else{var b=this.vertices.subarray(0,4*this.currentBatchSize*this.vertSize);a.bufferSubData(a.ARRAY_BUFFER,0,b)}a.drawElements(a.TRIANGLES,6*this.currentBatchSize,a.UNSIGNED_SHORT,0),this.currentBatchSize=0,this.renderSession.drawCount++}},b.WebGLFastSpriteBatch.prototype.stop=function(){this.flush()},b.WebGLFastSpriteBatch.prototype.start=function(){var a=this.gl;a.activeTexture(a.TEXTURE0),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var b=this.renderSession.projection;a.uniform2f(this.shader.projectionVector,b.x,b.y),a.uniformMatrix3fv(this.shader.uMatrix,!1,this.matrix);var c=4*this.vertSize;a.vertexAttribPointer(this.shader.aVertexPosition,2,a.FLOAT,!1,c,0),a.vertexAttribPointer(this.shader.aPositionCoord,2,a.FLOAT,!1,c,8),a.vertexAttribPointer(this.shader.aScale,2,a.FLOAT,!1,c,16),a.vertexAttribPointer(this.shader.aRotation,1,a.FLOAT,!1,c,24),a.vertexAttribPointer(this.shader.aTextureCoord,2,a.FLOAT,!1,c,28),a.vertexAttribPointer(this.shader.colorAttribute,1,a.FLOAT,!1,c,36)},b.WebGLFilterManager=function(){this.filterStack=[],this.offsetX=0,this.offsetY=0},b.WebGLFilterManager.prototype.constructor=b.WebGLFilterManager,b.WebGLFilterManager.prototype.setContext=function(a){this.gl=a,this.texturePool=[],this.initShaderBuffers()},b.WebGLFilterManager.prototype.begin=function(a,b){this.renderSession=a,this.defaultShader=a.shaderManager.defaultShader;var c=this.renderSession.projection;this.width=2*c.x,this.height=2*-c.y,this.buffer=b},b.WebGLFilterManager.prototype.pushFilter=function(a){var c=this.gl,d=this.renderSession.projection,e=this.renderSession.offset;a._filterArea=a.target.filterArea||a.target.getBounds(),this.filterStack.push(a);var f=a.filterPasses[0];this.offsetX+=a._filterArea.x,this.offsetY+=a._filterArea.y;var g=this.texturePool.pop();g?g.resize(this.width,this.height):g=new b.FilterTexture(this.gl,this.width,this.height),c.bindTexture(c.TEXTURE_2D,g.texture);var h=a._filterArea,i=f.padding;h.x-=i,h.y-=i,h.width+=2*i,h.height+=2*i,h.x<0&&(h.x=0),h.width>this.width&&(h.width=this.width),h.y<0&&(h.y=0),h.height>this.height&&(h.height=this.height),c.bindFramebuffer(c.FRAMEBUFFER,g.frameBuffer),c.viewport(0,0,h.width,h.height),d.x=h.width/2,d.y=-h.height/2,e.x=-h.x,e.y=-h.y,c.colorMask(!0,!0,!0,!0),c.clearColor(0,0,0,0),c.clear(c.COLOR_BUFFER_BIT),a._glFilterTexture=g},b.WebGLFilterManager.prototype.popFilter=function(){var a=this.gl,c=this.filterStack.pop(),d=c._filterArea,e=c._glFilterTexture,f=this.renderSession.projection,g=this.renderSession.offset;if(c.filterPasses.length>1){a.viewport(0,0,d.width,d.height),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),this.vertexArray[0]=0,this.vertexArray[1]=d.height,this.vertexArray[2]=d.width,this.vertexArray[3]=d.height,this.vertexArray[4]=0,this.vertexArray[5]=0,this.vertexArray[6]=d.width,this.vertexArray[7]=0,a.bufferSubData(a.ARRAY_BUFFER,0,this.vertexArray),a.bindBuffer(a.ARRAY_BUFFER,this.uvBuffer),this.uvArray[2]=d.width/this.width,this.uvArray[5]=d.height/this.height,this.uvArray[6]=d.width/this.width,this.uvArray[7]=d.height/this.height,a.bufferSubData(a.ARRAY_BUFFER,0,this.uvArray);var h=e,i=this.texturePool.pop();i||(i=new b.FilterTexture(this.gl,this.width,this.height)),i.resize(this.width,this.height),a.bindFramebuffer(a.FRAMEBUFFER,i.frameBuffer),a.clear(a.COLOR_BUFFER_BIT),a.disable(a.BLEND);for(var j=0;jB?B:A,c.beginPath(),c.moveTo(w,x+A),c.lineTo(w,x+z-A),c.quadraticCurveTo(w,x+z,w+A,x+z),c.lineTo(w+y-A,x+z),c.quadraticCurveTo(w+y,x+z,w+y,x+z-A),c.lineTo(w+y,x+A),c.quadraticCurveTo(w+y,x,w+y-A,x),c.lineTo(w+A,x),c.quadraticCurveTo(w,x,w,x+A),c.closePath(),(f.fillColor||0===f.fillColor)&&(c.globalAlpha=f.fillAlpha*d,c.fillStyle="#"+("00000"+(0|h).toString(16)).substr(-6),c.fill()),f.lineWidth&&(c.globalAlpha=f.lineAlpha*d,c.strokeStyle="#"+("00000"+(0|i).toString(16)).substr(-6),c.stroke())}}},b.CanvasGraphics.renderGraphicsMask=function(a,c){var d=a.graphicsData.length;if(0!==d){d>1&&(d=1,window.console.log("Pixi.js warning: masks in canvas can only mask using the first path in the graphics object"));for(var e=0;1>e;e++){var f=a.graphicsData[e],g=f.shape;if(f.type===b.Graphics.POLY){c.beginPath();var h=g.points;c.moveTo(h[0],h[1]);for(var i=1;iA?A:z,c.beginPath(),c.moveTo(v,w+z),c.lineTo(v,w+y-z),c.quadraticCurveTo(v,w+y,v+z,w+y),c.lineTo(v+x-z,w+y),c.quadraticCurveTo(v+x,w+y,v+x,w+y-z),c.lineTo(v+x,w+z),c.quadraticCurveTo(v+x,w,v+x-z,w),c.lineTo(v+z,w),c.quadraticCurveTo(v,w,v,w+z),c.closePath()}}}},b.CanvasGraphics.updateGraphicsTint=function(a){if(16777215!==a.tint)for(var b=(a.tint>>16&255)/255,c=(a.tint>>8&255)/255,d=(255&a.tint)/255,e=0;e>16&255)/255*b*255<<16)+((g>>8&255)/255*c*255<<8)+(255&g)/255*d*255,f._lineTint=((h>>16&255)/255*b*255<<16)+((h>>8&255)/255*c*255<<8)+(255&h)/255*d*255}},b.Graphics=function(){b.DisplayObjectContainer.call(this),this.renderable=!0,this.fillAlpha=1,this.lineWidth=0,this.lineColor=0,this.graphicsData=[],this.tint=16777215,this.blendMode=b.blendModes.NORMAL,this.currentPath=null,this._webGL=[],this.isMask=!1,this.boundsPadding=0,this._localBounds=new b.Rectangle(0,0,1,1),this.dirty=!0,this.webGLDirty=!1,this.cachedSpriteDirty=!1},b.Graphics.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Graphics.prototype.constructor=b.Graphics,Object.defineProperty(b.Graphics.prototype,"cacheAsBitmap",{get:function(){return this._cacheAsBitmap},set:function(a){this._cacheAsBitmap=a,this._cacheAsBitmap?this._generateCachedSprite():(this.destroyCachedSprite(),this.dirty=!0)}}),b.Graphics.prototype.lineStyle=function(a,c,d){if(this.lineWidth=a||0,this.lineColor=c||0,this.lineAlpha=arguments.length<3?1:d,this.currentPath){if(this.currentPath.shape.points.length)return this.drawShape(new b.Polygon(this.currentPath.shape.points.slice(-2))),this;this.currentPath.lineWidth=this.lineWidth,this.currentPath.lineColor=this.lineColor,this.currentPath.lineAlpha=this.lineAlpha}return this},b.Graphics.prototype.moveTo=function(a,c){return this.drawShape(new b.Polygon([a,c])),this},b.Graphics.prototype.lineTo=function(a,b){return this.currentPath.shape.points.push(a,b),this.dirty=!0,this},b.Graphics.prototype.quadraticCurveTo=function(a,b,c,d){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);var e,f,g=20,h=this.currentPath.shape.points;0===h.length&&this.moveTo(0,0);for(var i=h[h.length-2],j=h[h.length-1],k=0,l=1;g>=l;l++)k=l/g,e=i+(a-i)*k,f=j+(b-j)*k,h.push(e+(a+(c-a)*k-e)*k,f+(b+(d-b)*k-f)*k);return this.dirty=!0,this},b.Graphics.prototype.bezierCurveTo=function(a,b,c,d,e,f){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);for(var g,h,i,j,k,l=20,m=this.currentPath.shape.points,n=m[m.length-2],o=m[m.length-1],p=0,q=1;l>=q;q++)p=q/l,g=1-p,h=g*g,i=h*g,j=p*p,k=j*p,m.push(i*n+3*h*p*a+3*g*j*c+k*e,i*o+3*h*p*b+3*g*j*d+k*f);return this.dirty=!0,this},b.Graphics.prototype.arcTo=function(a,b,c,d,e){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(a,b):this.moveTo(a,b);var f=this.currentPath.shape.points,g=f[f.length-2],h=f[f.length-1],i=h-b,j=g-a,k=d-b,l=c-a,m=Math.abs(i*l-j*k);if(1e-8>m||0===e)(f[f.length-2]!==a||f[f.length-1]!==b)&&f.push(a,b);else{var n=i*i+j*j,o=k*k+l*l,p=i*k+j*l,q=e*Math.sqrt(n)/m,r=e*Math.sqrt(o)/m,s=q*p/n,t=r*p/o,u=q*l+r*j,v=q*k+r*i,w=j*(r+s),x=i*(r+s),y=l*(q+t),z=k*(q+t),A=Math.atan2(x-v,w-u),B=Math.atan2(z-v,y-u);this.arc(u+a,v+b,e,A,B,j*k>l*i)}return this.dirty=!0,this},b.Graphics.prototype.arc=function(a,b,c,d,e,f){var g,h=a+Math.cos(d)*c,i=b+Math.sin(d)*c;if(this.currentPath?(g=this.currentPath.shape.points,0===g.length?g.push(h,i):(g[g.length-2]!==h||g[g.length-1]!==i)&&g.push(h,i)):(this.moveTo(h,i),g=this.currentPath.shape.points),d===e)return this;!f&&d>=e?e+=2*Math.PI:f&&e>=d&&(d+=2*Math.PI);var j=f?-1*(d-e):e-d,k=Math.abs(j)/(2*Math.PI)*40;if(0===j)return this;for(var l=j/(2*k),m=2*l,n=Math.cos(l),o=Math.sin(l),p=k-1,q=p%1/p,r=0;p>=r;r++){var s=r+q*r,t=l+d+m*s,u=Math.cos(t),v=-Math.sin(t);g.push((n*u+o*v)*c+a,(n*-v+o*u)*c+b)}return this.dirty=!0,this},b.Graphics.prototype.beginFill=function(a,b){return this.filling=!0,this.fillColor=a||0,this.fillAlpha=void 0===b?1:b,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},b.Graphics.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},b.Graphics.prototype.drawRect=function(a,c,d,e){return this.drawShape(new b.Rectangle(a,c,d,e)),this},b.Graphics.prototype.drawRoundedRect=function(a,c,d,e,f){return this.drawShape(new b.RoundedRectangle(a,c,d,e,f)),this},b.Graphics.prototype.drawCircle=function(a,c,d){return this.drawShape(new b.Circle(a,c,d)),this},b.Graphics.prototype.drawEllipse=function(a,c,d,e){return this.drawShape(new b.Ellipse(a,c,d,e)),this},b.Graphics.prototype.drawPolygon=function(a){return a instanceof Array||(a=Array.prototype.slice.call(arguments)),this.drawShape(new b.Polygon(a)),this},b.Graphics.prototype.clear=function(){return this.lineWidth=0,this.filling=!1,this.dirty=!0,this.clearDirty=!0,this.graphicsData=[],this},b.Graphics.prototype.generateTexture=function(a,c){a=a||1;var d=this.getBounds(),e=new b.CanvasBuffer(d.width*a,d.height*a),f=b.Texture.fromCanvas(e.canvas,c);return f.baseTexture.resolution=a,e.context.scale(a,a),e.context.translate(-d.x,-d.y),b.CanvasGraphics.renderGraphics(this,e.context),f},b.Graphics.prototype._renderWebGL=function(a){if(this.visible!==!1&&0!==this.alpha&&this.isMask!==!0){if(this._cacheAsBitmap)return(this.dirty||this.cachedSpriteDirty)&&(this._generateCachedSprite(),this.updateCachedSpriteTexture(),this.cachedSpriteDirty=!1,this.dirty=!1),this._cachedSprite.worldAlpha=this.worldAlpha,void b.Sprite.prototype._renderWebGL.call(this._cachedSprite,a);if(a.spriteBatch.stop(),a.blendModeManager.setBlendMode(this.blendMode),this._mask&&a.maskManager.pushMask(this._mask,a),this._filters&&a.filterManager.pushFilter(this._filterBlock),this.blendMode!==a.spriteBatch.currentBlendMode){a.spriteBatch.currentBlendMode=this.blendMode;var c=b.blendModesWebGL[a.spriteBatch.currentBlendMode];a.spriteBatch.gl.blendFunc(c[0],c[1])}if(this.webGLDirty&&(this.dirty=!0,this.webGLDirty=!1),b.WebGLGraphics.renderGraphics(this,a),this.children.length){a.spriteBatch.start();for(var d=0,e=this.children.length;e>d;d++)this.children[d]._renderWebGL(a);a.spriteBatch.stop()}this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(this.mask,a),a.drawCount++,a.spriteBatch.start()}},b.Graphics.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha&&this.isMask!==!0){if(this._cacheAsBitmap)return(this.dirty||this.cachedSpriteDirty)&&(this._generateCachedSprite(),this.updateCachedSpriteTexture(),this.cachedSpriteDirty=!1,this.dirty=!1),this._cachedSprite.alpha=this.alpha,void b.Sprite.prototype._renderCanvas.call(this._cachedSprite,a);var c=a.context,d=this.worldTransform;this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,c.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]),this._mask&&a.maskManager.pushMask(this._mask,a);var e=a.resolution;c.setTransform(d.a*e,d.b*e,d.c*e,d.d*e,d.tx*e,d.ty*e),b.CanvasGraphics.renderGraphics(this,c);for(var f=0,g=this.children.length;g>f;f++)this.children[f]._renderCanvas(a);this._mask&&a.maskManager.popMask(a)}},b.Graphics.prototype.getBounds=function(a){if(this.isMask)return b.EmptyRectangle;this.dirty&&(this.updateLocalBounds(),this.webGLDirty=!0,this.cachedSpriteDirty=!0,this.dirty=!1);var c=this._localBounds,d=c.x,e=c.width+c.x,f=c.y,g=c.height+c.y,h=a||this.worldTransform,i=h.a,j=h.b,k=h.c,l=h.d,m=h.tx,n=h.ty,o=i*e+k*g+m,p=l*g+j*e+n,q=i*d+k*g+m,r=l*g+j*d+n,s=i*d+k*f+m,t=l*f+j*d+n,u=i*e+k*f+m,v=l*f+j*e+n,w=o,x=p,y=o,z=p;return y=y>q?q:y,y=y>s?s:y,y=y>u?u:y,z=z>r?r:z,z=z>t?t:z,z=z>v?v:z,w=q>w?q:w,w=s>w?s:w,w=u>w?u:w,x=r>x?r:x,x=t>x?t:x,x=v>x?v:x,this._bounds.x=y,this._bounds.width=w-y,this._bounds.y=z,this._bounds.height=x-z,this._bounds},b.Graphics.prototype.updateLocalBounds=function(){var a=1/0,c=-1/0,d=1/0,e=-1/0;if(this.graphicsData.length)for(var f,g,h,i,j,k,l=0;lh?h:a,c=h+j>c?h+j:c,d=d>i?i:d,e=i+k>e?i+k:e;else if(n===b.Graphics.CIRC)h=f.x,i=f.y,j=f.radius+o/2,k=f.radius+o/2,a=a>h-j?h-j:a,c=h+j>c?h+j:c,d=d>i-k?i-k:d,e=i+k>e?i+k:e;else if(n===b.Graphics.ELIP)h=f.x,i=f.y,j=f.width+o/2,k=f.height+o/2,a=a>h-j?h-j:a,c=h+j>c?h+j:c,d=d>i-k?i-k:d,e=i+k>e?i+k:e;else{g=f.points;for(var p=0;ph-o?h-o:a,c=h+o>c?h+o:c,d=d>i-o?i-o:d,e=i+o>e?i+o:e}}else a=0,c=0,d=0,e=0;var q=this.boundsPadding;this._localBounds.x=a-q,this._localBounds.width=c-a+2*q,this._localBounds.y=d-q,this._localBounds.height=e-d+2*q},b.Graphics.prototype._generateCachedSprite=function(){var a=this.getLocalBounds();if(this._cachedSprite)this._cachedSprite.buffer.resize(a.width,a.height);else{var c=new b.CanvasBuffer(a.width,a.height),d=b.Texture.fromCanvas(c.canvas);this._cachedSprite=new b.Sprite(d),this._cachedSprite.buffer=c,this._cachedSprite.worldTransform=this.worldTransform}this._cachedSprite.anchor.x=-(a.x/a.width),this._cachedSprite.anchor.y=-(a.y/a.height),this._cachedSprite.buffer.context.translate(-a.x,-a.y),this.worldAlpha=1,b.CanvasGraphics.renderGraphics(this,this._cachedSprite.buffer.context),this._cachedSprite.alpha=this.alpha},b.Graphics.prototype.updateCachedSpriteTexture=function(){var a=this._cachedSprite,b=a.texture,c=a.buffer.canvas;b.baseTexture.width=c.width,b.baseTexture.height=c.height,b.crop.width=b.frame.width=c.width,b.crop.height=b.frame.height=c.height,a._width=c.width,a._height=c.height,b.baseTexture.dirty()},b.Graphics.prototype.destroyCachedSprite=function(){this._cachedSprite.texture.destroy(!0),this._cachedSprite=null},b.Graphics.prototype.drawShape=function(a){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null;var c=new b.GraphicsData(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,a);return this.graphicsData.push(c),c.type===b.Graphics.POLY&&(c.shape.closed=this.filling,this.currentPath=c),this.dirty=!0,c},b.GraphicsData=function(a,b,c,d,e,f,g){this.lineWidth=a,this.lineColor=b,this.lineAlpha=c,this._lineTint=b,this.fillColor=d,this.fillAlpha=e,this._fillTint=d,this.fill=f,this.shape=g,this.type=g.type},b.Graphics.POLY=0,b.Graphics.RECT=1,b.Graphics.CIRC=2,b.Graphics.ELIP=3,b.Graphics.RREC=4,b.Polygon.prototype.type=b.Graphics.POLY,b.Rectangle.prototype.type=b.Graphics.RECT,b.Circle.prototype.type=b.Graphics.CIRC,b.Ellipse.prototype.type=b.Graphics.ELIP,b.RoundedRectangle.prototype.type=b.Graphics.RREC,b.Strip=function(a){b.DisplayObjectContainer.call(this),this.texture=a,this.uvs=new b.Float32Array([0,1,1,1,1,0,0,1]),this.vertices=new b.Float32Array([0,0,100,0,100,100,0,100]),this.colors=new b.Float32Array([1,1,1,1]),this.indices=new b.Uint16Array([0,1,2,3]),this.dirty=!0,this.blendMode=b.blendModes.NORMAL,this.canvasPadding=0,this.drawMode=b.Strip.DrawModes.TRIANGLE_STRIP},b.Strip.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Strip.prototype.constructor=b.Strip,b.Strip.prototype._renderWebGL=function(a){!this.visible||this.alpha<=0||(a.spriteBatch.stop(),this._vertexBuffer||this._initWebGL(a),a.shaderManager.setShader(a.shaderManager.stripShader),this._renderStrip(a),a.spriteBatch.start())},b.Strip.prototype._initWebGL=function(a){var b=a.gl;this._vertexBuffer=b.createBuffer(),this._indexBuffer=b.createBuffer(),this._uvBuffer=b.createBuffer(),this._colorBuffer=b.createBuffer(),b.bindBuffer(b.ARRAY_BUFFER,this._vertexBuffer),b.bufferData(b.ARRAY_BUFFER,this.vertices,b.DYNAMIC_DRAW),b.bindBuffer(b.ARRAY_BUFFER,this._uvBuffer),b.bufferData(b.ARRAY_BUFFER,this.uvs,b.STATIC_DRAW),b.bindBuffer(b.ARRAY_BUFFER,this._colorBuffer),b.bufferData(b.ARRAY_BUFFER,this.colors,b.STATIC_DRAW),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this._indexBuffer),b.bufferData(b.ELEMENT_ARRAY_BUFFER,this.indices,b.STATIC_DRAW)},b.Strip.prototype._renderStrip=function(a){var c=a.gl,d=a.projection,e=a.offset,f=a.shaderManager.stripShader,g=this.drawMode===b.Strip.DrawModes.TRIANGLE_STRIP?c.TRIANGLE_STRIP:c.TRIANGLES;a.blendModeManager.setBlendMode(this.blendMode),c.uniformMatrix3fv(f.translationMatrix,!1,this.worldTransform.toArray(!0)),c.uniform2f(f.projectionVector,d.x,-d.y),c.uniform2f(f.offsetVector,-e.x,-e.y),c.uniform1f(f.alpha,this.worldAlpha),this.dirty?(this.dirty=!1,c.bindBuffer(c.ARRAY_BUFFER,this._vertexBuffer),c.bufferData(c.ARRAY_BUFFER,this.vertices,c.STATIC_DRAW),c.vertexAttribPointer(f.aVertexPosition,2,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,this._uvBuffer),c.bufferData(c.ARRAY_BUFFER,this.uvs,c.STATIC_DRAW),c.vertexAttribPointer(f.aTextureCoord,2,c.FLOAT,!1,0,0),c.activeTexture(c.TEXTURE0),this.texture.baseTexture._dirty[c.id]?a.renderer.updateTexture(this.texture.baseTexture):c.bindTexture(c.TEXTURE_2D,this.texture.baseTexture._glTextures[c.id]),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this._indexBuffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,this.indices,c.STATIC_DRAW)):(c.bindBuffer(c.ARRAY_BUFFER,this._vertexBuffer),c.bufferSubData(c.ARRAY_BUFFER,0,this.vertices),c.vertexAttribPointer(f.aVertexPosition,2,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,this._uvBuffer),c.vertexAttribPointer(f.aTextureCoord,2,c.FLOAT,!1,0,0),c.activeTexture(c.TEXTURE0),this.texture.baseTexture._dirty[c.id]?a.renderer.updateTexture(this.texture.baseTexture):c.bindTexture(c.TEXTURE_2D,this.texture.baseTexture._glTextures[c.id]),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this._indexBuffer)),c.drawElements(g,this.indices.length,c.UNSIGNED_SHORT,0)},b.Strip.prototype._renderCanvas=function(a){var c=a.context,d=this.worldTransform;a.roundPixels?c.setTransform(d.a,d.b,d.c,d.d,0|d.tx,0|d.ty):c.setTransform(d.a,d.b,d.c,d.d,d.tx,d.ty),this.drawMode===b.Strip.DrawModes.TRIANGLE_STRIP?this._renderCanvasTriangleStrip(c):this._renderCanvasTriangles(c)},b.Strip.prototype._renderCanvasTriangleStrip=function(a){var b=this.vertices,c=this.uvs,d=b.length/2;this.count++;for(var e=0;d-2>e;e++){var f=2*e;this._renderCanvasDrawTriangle(a,b,c,f,f+2,f+4)}},b.Strip.prototype._renderCanvasTriangles=function(a){var b=this.vertices,c=this.uvs,d=this.indices,e=d.length;this.count++;for(var f=0;e>f;f+=3){var g=2*d[f],h=2*d[f+1],i=2*d[f+2];this._renderCanvasDrawTriangle(a,b,c,g,h,i)}},b.Strip.prototype._renderCanvasDrawTriangle=function(a,b,c,d,e,f){var g=this.texture.baseTexture.source,h=this.texture.width,i=this.texture.height,j=b[d],k=b[e],l=b[f],m=b[d+1],n=b[e+1],o=b[f+1],p=c[d]*h,q=c[e]*h,r=c[f]*h,s=c[d+1]*i,t=c[e+1]*i,u=c[f+1]*i;if(this.canvasPadding>0){var v=this.canvasPadding/this.worldTransform.a,w=this.canvasPadding/this.worldTransform.d,x=(j+k+l)/3,y=(m+n+o)/3,z=j-x,A=m-y,B=Math.sqrt(z*z+A*A);j=x+z/B*(B+v),m=y+A/B*(B+w),z=k-x,A=n-y,B=Math.sqrt(z*z+A*A),k=x+z/B*(B+v),n=y+A/B*(B+w),z=l-x,A=o-y,B=Math.sqrt(z*z+A*A),l=x+z/B*(B+v),o=y+A/B*(B+w)}a.save(),a.beginPath(),a.moveTo(j,m),a.lineTo(k,n),a.lineTo(l,o),a.closePath(),a.clip();var C=p*t+s*r+q*u-t*r-s*q-p*u,D=j*t+s*l+k*u-t*l-s*k-j*u,E=p*k+j*r+q*l-k*r-j*q-p*l,F=p*t*l+s*k*r+j*q*u-j*t*r-s*q*l-p*k*u,G=m*t+s*o+n*u-t*o-s*n-m*u,H=p*n+m*r+q*o-n*r-m*q-p*o,I=p*t*o+s*n*r+m*q*u-m*t*r-s*q*o-p*n*u;a.transform(D/C,G/C,E/C,H/C,F/C,I/C),a.drawImage(g,0,0),a.restore()},b.Strip.prototype.renderStripFlat=function(a){var b=this.context,c=a.vertices,d=c.length/2;this.count++,b.beginPath();for(var e=1;d-2>e;e++){var f=2*e,g=c[f],h=c[f+2],i=c[f+4],j=c[f+1],k=c[f+3],l=c[f+5];b.moveTo(g,j),b.lineTo(h,k),b.lineTo(i,l)}b.fillStyle="#FF0000",b.fill(),b.closePath()},b.Strip.prototype.onTextureUpdate=function(){this.updateFrame=!0},b.Strip.prototype.getBounds=function(a){for(var c=a||this.worldTransform,d=c.a,e=c.b,f=c.c,g=c.d,h=c.tx,i=c.ty,j=-1/0,k=-1/0,l=1/0,m=1/0,n=this.vertices,o=0,p=n.length;p>o;o+=2){var q=n[o],r=n[o+1],s=d*q+f*r+h,t=g*r+e*q+i;l=l>s?s:l,m=m>t?t:m,j=s>j?s:j,k=t>k?t:k}if(l===-1/0||1/0===k)return b.EmptyRectangle;var u=this._bounds;return u.x=l,u.width=j-l,u.y=m,u.height=k-m,this._currentBounds=u,u},b.Strip.DrawModes={TRIANGLE_STRIP:0,TRIANGLES:1},b.Rope=function(a,c){b.Strip.call(this,a),this.points=c,this.vertices=new b.Float32Array(4*c.length),this.uvs=new b.Float32Array(4*c.length),this.colors=new b.Float32Array(2*c.length),this.indices=new b.Uint16Array(2*c.length),this.refresh()},b.Rope.prototype=Object.create(b.Strip.prototype),b.Rope.prototype.constructor=b.Rope,b.Rope.prototype.refresh=function(){var a=this.points;if(!(a.length<1)){var b=this.uvs,c=a[0],d=this.indices,e=this.colors;this.count-=.2,b[0]=0,b[1]=0,b[2]=0,b[3]=1,e[0]=1,e[1]=1,d[0]=0,d[1]=1;for(var f,g,h,i=a.length,j=1;i>j;j++)f=a[j],g=4*j,h=j/(i-1),j%2?(b[g]=h,b[g+1]=0,b[g+2]=h,b[g+3]=1):(b[g]=h,b[g+1]=0,b[g+2]=h,b[g+3]=1),g=2*j,e[g]=1,e[g+1]=1,g=2*j,d[g]=g,d[g+1]=g+1,c=f}},b.Rope.prototype.updateTransform=function(){var a=this.points;if(!(a.length<1)){var c,d=a[0],e={x:0,y:0};this.count-=.2;for(var f,g,h,i,j,k=this.vertices,l=a.length,m=0;l>m;m++)f=a[m],g=4*m,c=m1&&(h=1),i=Math.sqrt(e.x*e.x+e.y*e.y),j=this.texture.height/2,e.x/=i,e.y/=i,e.x*=j,e.y*=j,k[g]=f.x+e.x,k[g+1]=f.y+e.y,k[g+2]=f.x-e.x,k[g+3]=f.y-e.y,d=f;b.DisplayObjectContainer.prototype.updateTransform.call(this)}},b.Rope.prototype.setTexture=function(a){this.texture=a},b.TilingSprite=function(a,c,d){b.Sprite.call(this,a),this._width=c||100,this._height=d||100,this.tileScale=new b.Point(1,1),this.tileScaleOffset=new b.Point(1,1),this.tilePosition=new b.Point(0,0),this.renderable=!0,this.tint=16777215,this.blendMode=b.blendModes.NORMAL},b.TilingSprite.prototype=Object.create(b.Sprite.prototype),b.TilingSprite.prototype.constructor=b.TilingSprite,Object.defineProperty(b.TilingSprite.prototype,"width",{get:function(){return this._width},set:function(a){this._width=a}}),Object.defineProperty(b.TilingSprite.prototype,"height",{get:function(){return this._height},set:function(a){this._height=a}}),b.TilingSprite.prototype.setTexture=function(a){this.texture!==a&&(this.texture=a,this.refreshTexture=!0,this.cachedTint=16777215)},b.TilingSprite.prototype._renderWebGL=function(a){if(this.visible!==!1&&0!==this.alpha){var b,c;for(this._mask&&(a.spriteBatch.stop(),a.maskManager.pushMask(this.mask,a),a.spriteBatch.start()),this._filters&&(a.spriteBatch.flush(),a.filterManager.pushFilter(this._filterBlock)),!this.tilingTexture||this.refreshTexture?(this.generateTilingTexture(!0),this.tilingTexture&&this.tilingTexture.needsUpdate&&(a.renderer.updateTexture(this.tilingTexture.baseTexture),this.tilingTexture.needsUpdate=!1)):a.spriteBatch.renderTilingSprite(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a); -a.spriteBatch.stop(),this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(this._mask,a),a.spriteBatch.start()}},b.TilingSprite.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){var c=a.context;this._mask&&a.maskManager.pushMask(this._mask,a),c.globalAlpha=this.worldAlpha;var d,e,f=this.worldTransform,g=a.resolution;if(c.setTransform(f.a*g,f.b*g,f.c*g,f.d*g,f.tx*g,f.ty*g),!this.__tilePattern||this.refreshTexture){if(this.generateTilingTexture(!1),!this.tilingTexture)return;this.__tilePattern=c.createPattern(this.tilingTexture.baseTexture.source,"repeat")}this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,c.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]);var h=this.tilePosition,i=this.tileScale;for(h.x%=this.tilingTexture.baseTexture.width,h.y%=this.tilingTexture.baseTexture.height,c.scale(i.x,i.y),c.translate(h.x+this.anchor.x*-this._width,h.y+this.anchor.y*-this._height),c.fillStyle=this.__tilePattern,c.fillRect(-h.x,-h.y,this._width/i.x,this._height/i.y),c.scale(1/i.x,1/i.y),c.translate(-h.x+this.anchor.x*this._width,-h.y+this.anchor.y*this._height),this._mask&&a.maskManager.popMask(a),d=0,e=this.children.length;e>d;d++)this.children[d]._renderCanvas(a)}},b.TilingSprite.prototype.getBounds=function(){var a=this._width,b=this._height,c=a*(1-this.anchor.x),d=a*-this.anchor.x,e=b*(1-this.anchor.y),f=b*-this.anchor.y,g=this.worldTransform,h=g.a,i=g.b,j=g.c,k=g.d,l=g.tx,m=g.ty,n=h*d+j*f+l,o=k*f+i*d+m,p=h*c+j*f+l,q=k*f+i*c+m,r=h*c+j*e+l,s=k*e+i*c+m,t=h*d+j*e+l,u=k*e+i*d+m,v=-1/0,w=-1/0,x=1/0,y=1/0;x=x>n?n:x,x=x>p?p:x,x=x>r?r:x,x=x>t?t:x,y=y>o?o:y,y=y>q?q:y,y=y>s?s:y,y=y>u?u:y,v=n>v?n:v,v=p>v?p:v,v=r>v?r:v,v=t>v?t:v,w=o>w?o:w,w=q>w?q:w,w=s>w?s:w,w=u>w?u:w;var z=this._bounds;return z.x=x,z.width=v-x,z.y=y,z.height=w-y,this._currentBounds=z,z},b.TilingSprite.prototype.onTextureUpdate=function(){},b.TilingSprite.prototype.generateTilingTexture=function(a){if(this.texture.baseTexture.hasLoaded){var c,d,e=this.originalTexture||this.texture,f=e.frame,g=f.width!==e.baseTexture.width||f.height!==e.baseTexture.height,h=!1;if(a?(c=b.getNextPowerOfTwo(f.width),d=b.getNextPowerOfTwo(f.height),(f.width!==c||f.height!==d||e.baseTexture.width!==c||e.baseTexture.height||d)&&(h=!0)):g&&(e.trim?(c=e.trim.width,d=e.trim.height):(c=f.width,d=f.height),h=!0),h){var i;this.tilingTexture&&this.tilingTexture.isTiling?(i=this.tilingTexture.canvasBuffer,i.resize(c,d),this.tilingTexture.baseTexture.width=c,this.tilingTexture.baseTexture.height=d,this.tilingTexture.needsUpdate=!0):(i=new b.CanvasBuffer(c,d),this.tilingTexture=b.Texture.fromCanvas(i.canvas),this.tilingTexture.canvasBuffer=i,this.tilingTexture.isTiling=!0),i.context.drawImage(e.baseTexture.source,e.crop.x,e.crop.y,e.crop.width,e.crop.height,0,0,c,d),this.tileScaleOffset.x=f.width/c,this.tileScaleOffset.y=f.height/d}else this.tilingTexture&&this.tilingTexture.isTiling&&this.tilingTexture.destroy(!0),this.tileScaleOffset.x=1,this.tileScaleOffset.y=1,this.tilingTexture=e;this.refreshTexture=!1,this.originalTexture=this.texture,this.texture=this.tilingTexture,this.tilingTexture.baseTexture._powerOf2=!0}},b.TilingSprite.prototype.destroy=function(){b.Sprite.prototype.destroy.call(this),this.tileScale=null,this.tileScaleOffset=null,this.tilePosition=null,this.tilingTexture.destroy(!0),this.tilingTexture=null};var c={radDeg:180/Math.PI,degRad:Math.PI/180,temp:[],Float32Array:"undefined"==typeof Float32Array?Array:Float32Array,Uint16Array:"undefined"==typeof Uint16Array?Array:Uint16Array};c.BoneData=function(a,b){this.name=a,this.parent=b},c.BoneData.prototype={length:0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,inheritScale:!0,inheritRotation:!0,flipX:!1,flipY:!1},c.SlotData=function(a,b){this.name=a,this.boneData=b},c.SlotData.prototype={r:1,g:1,b:1,a:1,attachmentName:null,additiveBlending:!1},c.IkConstraintData=function(a){this.name=a,this.bones=[]},c.IkConstraintData.prototype={target:null,bendDirection:1,mix:1},c.Bone=function(a,b,c){this.data=a,this.skeleton=b,this.parent=c,this.setToSetupPose()},c.Bone.yDown=!1,c.Bone.prototype={x:0,y:0,rotation:0,rotationIK:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,m00:0,m01:0,worldX:0,m10:0,m11:0,worldY:0,worldRotation:0,worldScaleX:1,worldScaleY:1,worldFlipX:!1,worldFlipY:!1,updateWorldTransform:function(){var a=this.parent;if(a)this.worldX=this.x*a.m00+this.y*a.m01+a.worldX,this.worldY=this.x*a.m10+this.y*a.m11+a.worldY,this.data.inheritScale?(this.worldScaleX=a.worldScaleX*this.scaleX,this.worldScaleY=a.worldScaleY*this.scaleY):(this.worldScaleX=this.scaleX,this.worldScaleY=this.scaleY),this.worldRotation=this.data.inheritRotation?a.worldRotation+this.rotationIK:this.rotationIK,this.worldFlipX=a.worldFlipX!=this.flipX,this.worldFlipY=a.worldFlipY!=this.flipY;else{var b=this.skeleton.flipX,d=this.skeleton.flipY;this.worldX=b?-this.x:this.x,this.worldY=d!=c.Bone.yDown?-this.y:this.y,this.worldScaleX=this.scaleX,this.worldScaleY=this.scaleY,this.worldRotation=this.rotationIK,this.worldFlipX=b!=this.flipX,this.worldFlipY=d!=this.flipY}var e=this.worldRotation*c.degRad,f=Math.cos(e),g=Math.sin(e);this.worldFlipX?(this.m00=-f*this.worldScaleX,this.m01=g*this.worldScaleY):(this.m00=f*this.worldScaleX,this.m01=-g*this.worldScaleY),this.worldFlipY!=c.Bone.yDown?(this.m10=-g*this.worldScaleX,this.m11=-f*this.worldScaleY):(this.m10=g*this.worldScaleX,this.m11=f*this.worldScaleY)},setToSetupPose:function(){var a=this.data;this.x=a.x,this.y=a.y,this.rotation=a.rotation,this.rotationIK=this.rotation,this.scaleX=a.scaleX,this.scaleY=a.scaleY,this.flipX=a.flipX,this.flipY=a.flipY},worldToLocal:function(a){var b=a[0]-this.worldX,d=a[1]-this.worldY,e=this.m00,f=this.m10,g=this.m01,h=this.m11;this.worldFlipX!=(this.worldFlipY!=c.Bone.yDown)&&(e=-e,h=-h);var i=1/(e*h-g*f);a[0]=b*e*i-d*g*i,a[1]=d*h*i-b*f*i},localToWorld:function(a){var b=a[0],c=a[1];a[0]=b*this.m00+c*this.m01+this.worldX,a[1]=b*this.m10+c*this.m11+this.worldY}},c.Slot=function(a,b){this.data=a,this.bone=b,this.setToSetupPose()},c.Slot.prototype={r:1,g:1,b:1,a:1,_attachmentTime:0,attachment:null,attachmentVertices:[],setAttachment:function(a){this.attachment=a,this._attachmentTime=this.bone.skeleton.time,this.attachmentVertices.length=0},setAttachmentTime:function(a){this._attachmentTime=this.bone.skeleton.time-a},getAttachmentTime:function(){return this.bone.skeleton.time-this._attachmentTime},setToSetupPose:function(){var a=this.data;this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a;for(var b=this.bone.skeleton.data.slots,c=0,d=b.length;d>c;c++)if(b[c]==a){this.setAttachment(a.attachmentName?this.bone.skeleton.getAttachmentBySlotIndex(c,a.attachmentName):null);break}}},c.IkConstraint=function(a,b){this.data=a,this.mix=a.mix,this.bendDirection=a.bendDirection,this.bones=[];for(var c=0,d=a.bones.length;d>c;c++)this.bones.push(b.findBone(a.bones[c].name));this.target=b.findBone(a.target.name)},c.IkConstraint.prototype={apply:function(){var a=this.target,b=this.bones;switch(b.length){case 1:c.IkConstraint.apply1(b[0],a.worldX,a.worldY,this.mix);break;case 2:c.IkConstraint.apply2(b[0],b[1],a.worldX,a.worldY,this.bendDirection,this.mix)}}},c.IkConstraint.apply1=function(a,b,d,e){var f=a.data.inheritRotation&&a.parent?a.parent.worldRotation:0,g=a.rotation,h=Math.atan2(d-a.worldY,b-a.worldX)*c.radDeg-f;a.rotationIK=g+(h-g)*e},c.IkConstraint.apply2=function(a,b,d,e,f,g){var h=b.rotation,i=a.rotation;if(!g)return b.rotationIK=h,void(a.rotationIK=i);var j,k,l=c.temp,m=a.parent;m?(l[0]=d,l[1]=e,m.worldToLocal(l),d=(l[0]-a.x)*m.worldScaleX,e=(l[1]-a.y)*m.worldScaleY):(d-=a.x,e-=a.y),b.parent==a?(j=b.x,k=b.y):(l[0]=b.x,l[1]=b.y,b.parent.localToWorld(l),a.worldToLocal(l),j=l[0],k=l[1]);var n=j*a.worldScaleX,o=k*a.worldScaleY,p=Math.atan2(o,n),q=Math.sqrt(n*n+o*o),r=b.data.length*b.worldScaleX,s=2*q*r;if(1e-4>s)return void(b.rotationIK=h+(Math.atan2(e,d)*c.radDeg-i-h)*g);var t=(d*d+e*e-q*q-r*r)/s;-1>t?t=-1:t>1&&(t=1);var u=Math.acos(t)*f,v=q+r*t,w=r*Math.sin(u),x=Math.atan2(e*v-d*w,d*v+e*w),y=(x-p)*c.radDeg-i;y>180?y-=360:-180>y&&(y+=360),a.rotationIK=i+y*g,y=(u+p)*c.radDeg-h,y>180?y-=360:-180>y&&(y+=360),b.rotationIK=h+(y+a.worldRotation-b.parent.worldRotation)*g},c.Skin=function(a){this.name=a,this.attachments={}},c.Skin.prototype={addAttachment:function(a,b,c){this.attachments[a+":"+b]=c},getAttachment:function(a,b){return this.attachments[a+":"+b]},_attachAll:function(a,b){for(var c in b.attachments){var d=c.indexOf(":"),e=parseInt(c.substring(0,d)),f=c.substring(d+1),g=a.slots[e];if(g.attachment&&g.attachment.name==f){var h=this.getAttachment(e,f);h&&g.setAttachment(h)}}}},c.Animation=function(a,b,c){this.name=a,this.timelines=b,this.duration=c},c.Animation.prototype={apply:function(a,b,c,d,e){d&&0!=this.duration&&(c%=this.duration,b%=this.duration);for(var f=this.timelines,g=0,h=f.length;h>g;g++)f[g].apply(a,b,c,e,1)},mix:function(a,b,c,d,e,f){d&&0!=this.duration&&(c%=this.duration,b%=this.duration);for(var g=this.timelines,h=0,i=g.length;i>h;h++)g[h].apply(a,b,c,e,f)}},c.Animation.binarySearch=function(a,b,c){var d=0,e=Math.floor(a.length/c)-2;if(!e)return c;for(var f=e>>>1;;){if(a[(f+1)*c]<=b?d=f+1:e=f,d==e)return(d+1)*c;f=d+e>>>1}},c.Animation.binarySearch1=function(a,b){var c=0,d=a.length-2;if(!d)return 1;for(var e=d>>>1;;){if(a[e+1]<=b?c=e+1:d=e,c==d)return c+1;e=c+d>>>1}},c.Animation.linearSearch=function(a,b,c){for(var d=0,e=a.length-c;e>=d;d+=c)if(a[d]>b)return d;return-1},c.Curves=function(){this.curves=[]},c.Curves.prototype={setLinear:function(a){this.curves[19*a]=0},setStepped:function(a){this.curves[19*a]=1},setCurve:function(a,b,c,d,e){var f=.1,g=f*f,h=g*f,i=3*f,j=3*g,k=6*g,l=6*h,m=2*-b+d,n=2*-c+e,o=3*(b-d)+1,p=3*(c-e)+1,q=b*i+m*j+o*h,r=c*i+n*j+p*h,s=m*k+o*l,t=n*k+p*l,u=o*l,v=p*l,w=19*a,x=this.curves;x[w++]=2;for(var y=q,z=r,A=w+19-1;A>w;w+=2)x[w]=y,x[w+1]=z,q+=s,r+=t,s+=u,t+=v,y+=q,z+=r},getCurvePercent:function(a,b){b=0>b?0:b>1?1:b;var c=this.curves,d=19*a,e=c[d];if(0===e)return b;if(1==e)return 0;d++;for(var f=0,g=d,h=d+19-1;h>d;d+=2)if(f=c[d],f>=b){var i,j;return d==g?(i=0,j=0):(i=c[d-2],j=c[d-1]),j+(c[d+1]-j)*(b-i)/(f-i)}var k=c[d-1];return k+(1-k)*(b-f)/(1-f)}},c.RotateTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=2*a},c.RotateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(a,b,c){a*=2,this.frames[a]=b,this.frames[a+1]=c},apply:function(a,b,d,e,f){var g=this.frames;if(!(d=g[g.length-2]){for(var i=h.data.rotation+g[g.length-1]-h.rotation;i>180;)i-=360;for(;-180>i;)i+=360;return void(h.rotation+=i*f)}var j=c.Animation.binarySearch(g,d,2),k=g[j-1],l=g[j],m=1-(d-l)/(g[j-2]-l);m=this.curves.getCurvePercent(j/2-1,m);for(var i=g[j+1]-k;i>180;)i-=360;for(;-180>i;)i+=360;for(i=h.data.rotation+(k+i*m)-h.rotation;i>180;)i-=360;for(;-180>i;)i+=360;h.rotation+=i*f}}},c.TranslateTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=3*a},c.TranslateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(a,b,c,d){a*=3,this.frames[a]=b,this.frames[a+1]=c,this.frames[a+2]=d},apply:function(a,b,d,e,f){var g=this.frames;if(!(d=g[g.length-3])return h.x+=(h.data.x+g[g.length-2]-h.x)*f,void(h.y+=(h.data.y+g[g.length-1]-h.y)*f);var i=c.Animation.binarySearch(g,d,3),j=g[i-2],k=g[i-1],l=g[i],m=1-(d-l)/(g[i+-3]-l);m=this.curves.getCurvePercent(i/3-1,m),h.x+=(h.data.x+j+(g[i+1]-j)*m-h.x)*f,h.y+=(h.data.y+k+(g[i+2]-k)*m-h.y)*f}}},c.ScaleTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=3*a},c.ScaleTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(a,b,c,d){a*=3,this.frames[a]=b,this.frames[a+1]=c,this.frames[a+2]=d},apply:function(a,b,d,e,f){var g=this.frames;if(!(d=g[g.length-3])return h.scaleX+=(h.data.scaleX*g[g.length-2]-h.scaleX)*f,void(h.scaleY+=(h.data.scaleY*g[g.length-1]-h.scaleY)*f);var i=c.Animation.binarySearch(g,d,3),j=g[i-2],k=g[i-1],l=g[i],m=1-(d-l)/(g[i+-3]-l);m=this.curves.getCurvePercent(i/3-1,m),h.scaleX+=(h.data.scaleX*(j+(g[i+1]-j)*m)-h.scaleX)*f,h.scaleY+=(h.data.scaleY*(k+(g[i+2]-k)*m)-h.scaleY)*f}}},c.ColorTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=5*a},c.ColorTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/5},setFrame:function(a,b,c,d,e,f){a*=5,this.frames[a]=b,this.frames[a+1]=c,this.frames[a+2]=d,this.frames[a+3]=e,this.frames[a+4]=f},apply:function(a,b,d,e,f){var g=this.frames;if(!(d=g[g.length-5]){var l=g.length-1;h=g[l-3],i=g[l-2],j=g[l-1],k=g[l]}else{var m=c.Animation.binarySearch(g,d,5),n=g[m-4],o=g[m-3],p=g[m-2],q=g[m-1],r=g[m],s=1-(d-r)/(g[m-5]-r);s=this.curves.getCurvePercent(m/5-1,s),h=n+(g[m+1]-n)*s,i=o+(g[m+2]-o)*s,j=p+(g[m+3]-p)*s,k=q+(g[m+4]-q)*s}var t=a.slots[this.slotIndex];1>f?(t.r+=(h-t.r)*f,t.g+=(i-t.g)*f,t.b+=(j-t.b)*f,t.a+=(k-t.a)*f):(t.r=h,t.g=i,t.b=j,t.a=k)}}},c.AttachmentTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=a,this.attachmentNames=[],this.attachmentNames.length=a},c.AttachmentTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length},setFrame:function(a,b,c){this.frames[a]=b,this.attachmentNames[a]=c},apply:function(a,b,d){var e=this.frames;if(dd&&this.apply(a,b,Number.MAX_VALUE,null,0));b>d&&(b=-1);var f=d>=e[e.length-1]?e.length-1:c.Animation.binarySearch1(e,d)-1;if(!(e[f]d)this.apply(a,b,Number.MAX_VALUE,e,f),b=-1;else if(b>=g[h-1])return;if(!(d0&&g[i-1]==j;)i--}for(var k=this.events;h>i&&d>=g[i];i++)e.push(k[i])}}}},c.DrawOrderTimeline=function(a){this.frames=[],this.frames.length=a,this.drawOrders=[],this.drawOrders.length=a},c.DrawOrderTimeline.prototype={getFrameCount:function(){return this.frames.length},setFrame:function(a,b,c){this.frames[a]=b,this.drawOrders[a]=c},apply:function(a,b,d){var e=this.frames;if(!(d=e[e.length-1]?e.length-1:c.Animation.binarySearch1(e,d)-1;var g=a.drawOrder,h=a.slots,i=this.drawOrders[f];if(i)for(var j=0,k=i.length;k>j;j++)g[j]=a.slots[i[j]];else for(var j=0,k=h.length;k>j;j++)g[j]=h[j]}}},c.FfdTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=a,this.frameVertices=[],this.frameVertices.length=a},c.FfdTimeline.prototype={slotIndex:0,attachment:0,getFrameCount:function(){return this.frames.length},setFrame:function(a,b,c){this.frames[a]=b,this.frameVertices[a]=c},apply:function(a,b,d,e,f){var g=a.slots[this.slotIndex];if(g.attachment==this.attachment){var h=this.frames;if(!(d=h[h.length-1]){var l=i[h.length-1];if(1>f)for(var m=0;j>m;m++)k[m]+=(l[m]-k[m])*f;else for(var m=0;j>m;m++)k[m]=l[m]}else{var n=c.Animation.binarySearch1(h,d),o=h[n],p=1-(d-o)/(h[n-1]-o);p=this.curves.getCurvePercent(n-1,0>p?0:p>1?1:p);var q=i[n-1],r=i[n];if(1>f)for(var m=0;j>m;m++){var s=q[m];k[m]+=(s+(r[m]-s)*p-k[m])*f}else for(var m=0;j>m;m++){var s=q[m];k[m]=s+(r[m]-s)*p}}}}}},c.IkConstraintTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=3*a},c.IkConstraintTimeline.prototype={ikConstraintIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(a,b,c,d){a*=3,this.frames[a]=b,this.frames[a+1]=c,this.frames[a+2]=d},apply:function(a,b,d,e,f){var g=this.frames;if(!(d=g[g.length-3])return h.mix+=(g[g.length-2]-h.mix)*f,void(h.bendDirection=g[g.length-1]);var i=c.Animation.binarySearch(g,d,3),j=g[i+-2],k=g[i],l=1-(d-k)/(g[i+-3]-k);l=this.curves.getCurvePercent(i/3-1,l);var m=j+(g[i+1]-j)*l;h.mix+=(m-h.mix)*f,h.bendDirection=g[i+-1]}}},c.FlipXTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=2*a},c.FlipXTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(a,b,c){a*=2,this.frames[a]=b,this.frames[a+1]=c?1:0},apply:function(a,b,d){var e=this.frames;if(dd&&this.apply(a,b,Number.MAX_VALUE,null,0));b>d&&(b=-1);var f=(d>=e[e.length-2]?e.length:c.Animation.binarySearch(e,d,2))-2;e[f]d&&this.apply(a,b,Number.MAX_VALUE,null,0));b>d&&(b=-1);var f=(d>=e[e.length-2]?e.length:c.Animation.binarySearch(e,d,2))-2;e[f]c;c++)if(b[c].name==a)return b[c];return null},findBoneIndex:function(a){for(var b=this.bones,c=0,d=b.length;d>c;c++)if(b[c].name==a)return c;return-1},findSlot:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].name==a)return slot[c];return null},findSlotIndex:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].name==a)return c;return-1},findSkin:function(a){for(var b=this.skins,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},findEvent:function(a){for(var b=this.events,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},findAnimation:function(a){for(var b=this.animations,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},findIkConstraint:function(a){for(var b=this.ikConstraints,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null}},c.Skeleton=function(a){this.data=a,this.bones=[];for(var b=0,d=a.bones.length;d>b;b++){var e=a.bones[b],f=e.parent?this.bones[a.bones.indexOf(e.parent)]:null;this.bones.push(new c.Bone(e,this,f))}this.slots=[],this.drawOrder=[];for(var b=0,d=a.slots.length;d>b;b++){var g=a.slots[b],h=this.bones[a.bones.indexOf(g.boneData)],i=new c.Slot(g,h);this.slots.push(i),this.drawOrder.push(i)}this.ikConstraints=[];for(var b=0,d=a.ikConstraints.length;d>b;b++)this.ikConstraints.push(new c.IkConstraint(a.ikConstraints[b],this));this.boneCache=[],this.updateCache()},c.Skeleton.prototype={x:0,y:0,skin:null,r:1,g:1,b:1,a:1,time:0,flipX:!1,flipY:!1,updateCache:function(){var a=this.ikConstraints,b=a.length,c=b+1,d=this.boneCache;d.length>c&&(d.length=c);for(var e=0,f=d.length;f>e;e++)d[e].length=0;for(;d.lengthe;e++){var i=h[e],j=i;do{for(var k=0;b>k;k++)for(var l=a[k],m=l.bones[0],n=l.bones[l.bones.length-1];;){if(j==n){d[k].push(i),d[k+1].push(i);continue a}if(n==m)break;n=n.parent}j=j.parent}while(j);g[g.length]=i}},updateWorldTransform:function(){for(var a=this.bones,b=0,c=a.length;c>b;b++){var d=a[b];d.rotationIK=d.rotation}for(var b=0,e=this.boneCache.length-1;;){for(var f=this.boneCache[b],g=0,h=f.length;h>g;g++)f[g].updateWorldTransform();if(b==e)break;this.ikConstraints[b].apply(),b++}},setToSetupPose:function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},setBonesToSetupPose:function(){for(var a=this.bones,b=0,c=a.length;c>b;b++)a[b].setToSetupPose();for(var d=this.ikConstraints,b=0,c=d.length;c>b;b++){var e=d[b];e.bendDirection=e.data.bendDirection,e.mix=e.data.mix}},setSlotsToSetupPose:function(){for(var a=this.slots,b=this.drawOrder,c=0,d=a.length;d>c;c++)b[c]=a[c],a[c].setToSetupPose(c)},getRootBone:function(){return this.bones.length?this.bones[0]:null},findBone:function(a){for(var b=this.bones,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return b[c];return null},findBoneIndex:function(a){for(var b=this.bones,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return c;return-1},findSlot:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return b[c];return null},findSlotIndex:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return c;return-1},setSkinByName:function(a){var b=this.data.findSkin(a);if(!b)throw"Skin not found: "+a;this.setSkin(b)},setSkin:function(a){if(a)if(this.skin)a._attachAll(this,this.skin);else for(var b=this.slots,c=0,d=b.length;d>c;c++){var e=b[c],f=e.data.attachmentName;if(f){var g=a.getAttachment(c,f);g&&e.setAttachment(g)}}this.skin=a},getAttachmentBySlotName:function(a,b){return this.getAttachmentBySlotIndex(this.data.findSlotIndex(a),b)},getAttachmentBySlotIndex:function(a,b){if(this.skin){var c=this.skin.getAttachment(a,b);if(c)return c}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(a,b):null},setAttachment:function(a,b){for(var c=this.slots,d=0,e=c.length;e>d;d++){var f=c[d];if(f.data.name==a){var g=null;if(b&&(g=this.getAttachmentBySlotIndex(d,b),!g))throw"Attachment not found: "+b+", for slot: "+a;return void f.setAttachment(g)}}throw"Slot not found: "+a},findIkConstraint:function(a){for(var b=this.ikConstraints,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return b[c];return null},update:function(a){this.time+=a}},c.EventData=function(a){this.name=a},c.EventData.prototype={intValue:0,floatValue:0,stringValue:null},c.Event=function(a){this.data=a},c.Event.prototype={intValue:0,floatValue:0,stringValue:null},c.AttachmentType={region:0,boundingbox:1,mesh:2,skinnedmesh:3},c.RegionAttachment=function(a){this.name=a,this.offset=[],this.offset.length=8,this.uvs=[],this.uvs.length=8},c.RegionAttachment.prototype={type:c.AttachmentType.region,x:0,y:0,rotation:0,scaleX:1,scaleY:1,width:0,height:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,setUVs:function(a,b,c,d,e){var f=this.uvs;e?(f[2]=a,f[3]=d,f[4]=a,f[5]=b,f[6]=c,f[7]=b,f[0]=c,f[1]=d):(f[0]=a,f[1]=d,f[2]=a,f[3]=b,f[4]=c,f[5]=b,f[6]=c,f[7]=d)},updateOffset:function(){var a=this.width/this.regionOriginalWidth*this.scaleX,b=this.height/this.regionOriginalHeight*this.scaleY,d=-this.width/2*this.scaleX+this.regionOffsetX*a,e=-this.height/2*this.scaleY+this.regionOffsetY*b,f=d+this.regionWidth*a,g=e+this.regionHeight*b,h=this.rotation*c.degRad,i=Math.cos(h),j=Math.sin(h),k=d*i+this.x,l=d*j,m=e*i+this.y,n=e*j,o=f*i+this.x,p=f*j,q=g*i+this.y,r=g*j,s=this.offset;s[0]=k-n,s[1]=m+l,s[2]=k-r,s[3]=q+l,s[4]=o-r,s[5]=q+p,s[6]=o-n,s[7]=m+p},computeVertices:function(a,b,c,d){a+=c.worldX,b+=c.worldY;var e=c.m00,f=c.m01,g=c.m10,h=c.m11,i=this.offset;d[0]=i[0]*e+i[1]*f+a,d[1]=i[0]*g+i[1]*h+b,d[2]=i[2]*e+i[3]*f+a,d[3]=i[2]*g+i[3]*h+b,d[4]=i[4]*e+i[5]*f+a,d[5]=i[4]*g+i[5]*h+b,d[6]=i[6]*e+i[7]*f+a,d[7]=i[6]*g+i[7]*h+b}},c.MeshAttachment=function(a){this.name=a},c.MeshAttachment.prototype={type:c.AttachmentType.mesh,vertices:null,uvs:null,regionUVs:null,triangles:null,hullLength:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,regionU:0,regionV:0,regionU2:0,regionV2:0,regionRotate:!1,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,edges:null,width:0,height:0,updateUVs:function(){var a=this.regionU2-this.regionU,b=this.regionV2-this.regionV,d=this.regionUVs.length;if(this.uvs&&this.uvs.length==d||(this.uvs=new c.Float32Array(d)),this.regionRotate)for(var e=0;d>e;e+=2)this.uvs[e]=this.regionU+this.regionUVs[e+1]*a,this.uvs[e+1]=this.regionV+b-this.regionUVs[e]*b;else for(var e=0;d>e;e+=2)this.uvs[e]=this.regionU+this.regionUVs[e]*a,this.uvs[e+1]=this.regionV+this.regionUVs[e+1]*b},computeWorldVertices:function(a,b,c,d){var e=c.bone;a+=e.worldX,b+=e.worldY;var f=e.m00,g=e.m01,h=e.m10,i=e.m11,j=this.vertices,k=j.length;c.attachmentVertices.length==k&&(j=c.attachmentVertices);for(var l=0;k>l;l+=2){var m=j[l],n=j[l+1];d[l]=m*f+n*g+a,d[l+1]=m*h+n*i+b}}},c.SkinnedMeshAttachment=function(a){this.name=a},c.SkinnedMeshAttachment.prototype={type:c.AttachmentType.skinnedmesh,bones:null,weights:null,uvs:null,regionUVs:null,triangles:null,hullLength:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,regionU:0,regionV:0,regionU2:0,regionV2:0,regionRotate:!1,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,edges:null,width:0,height:0,updateUVs:function(){var a=this.regionU2-this.regionU,b=this.regionV2-this.regionV,d=this.regionUVs.length;if(this.uvs&&this.uvs.length==d||(this.uvs=new c.Float32Array(d)),this.regionRotate)for(var e=0;d>e;e+=2)this.uvs[e]=this.regionU+this.regionUVs[e+1]*a,this.uvs[e+1]=this.regionV+b-this.regionUVs[e]*b;else for(var e=0;d>e;e+=2)this.uvs[e]=this.regionU+this.regionUVs[e]*a,this.uvs[e+1]=this.regionV+this.regionUVs[e+1]*b},computeWorldVertices:function(a,b,c,d){var e,f,g,h,i,j,k,l=c.bone.skeleton.bones,m=this.weights,n=this.bones,o=0,p=0,q=0,r=0,s=n.length;if(c.attachmentVertices.length)for(var t=c.attachmentVertices;s>p;o+=2){for(f=0,g=0,e=n[p++]+p;e>p;p++,q+=3,r+=2)h=l[n[p]],i=m[q]+t[r],j=m[q+1]+t[r+1],k=m[q+2],f+=(i*h.m00+j*h.m01+h.worldX)*k,g+=(i*h.m10+j*h.m11+h.worldY)*k;d[o]=f+a,d[o+1]=g+b}else for(;s>p;o+=2){for(f=0,g=0,e=n[p++]+p;e>p;p++,q+=3)h=l[n[p]],i=m[q],j=m[q+1],k=m[q+2],f+=(i*h.m00+j*h.m01+h.worldX)*k,g+=(i*h.m10+j*h.m11+h.worldY)*k;d[o]=f+a,d[o+1]=g+b}}},c.BoundingBoxAttachment=function(a){this.name=a,this.vertices=[]},c.BoundingBoxAttachment.prototype={type:c.AttachmentType.boundingbox,computeWorldVertices:function(a,b,c,d){a+=c.worldX,b+=c.worldY;for(var e=c.m00,f=c.m01,g=c.m10,h=c.m11,i=this.vertices,j=0,k=i.length;k>j;j+=2){var l=i[j],m=i[j+1];d[j]=l*e+m*f+a,d[j+1]=l*g+m*h+b}}},c.AnimationStateData=function(a){this.skeletonData=a,this.animationToMixTime={}},c.AnimationStateData.prototype={defaultMix:0,setMixByName:function(a,b,c){var d=this.skeletonData.findAnimation(a);if(!d)throw"Animation not found: "+a;var e=this.skeletonData.findAnimation(b);if(!e)throw"Animation not found: "+b;this.setMix(d,e,c)},setMix:function(a,b,c){this.animationToMixTime[a.name+":"+b.name]=c},getMix:function(a,b){var c=a.name+":"+b.name;return this.animationToMixTime.hasOwnProperty(c)?this.animationToMixTime[c]:this.defaultMix}},c.TrackEntry=function(){},c.TrackEntry.prototype={next:null,previous:null,animation:null,loop:!1,delay:0,time:0,lastTime:-1,endTime:0,timeScale:1,mixTime:0,mixDuration:0,mix:1,onStart:null,onEnd:null,onComplete:null,onEvent:null},c.AnimationState=function(a){this.data=a,this.tracks=[],this.events=[]},c.AnimationState.prototype={onStart:null,onEnd:null,onComplete:null,onEvent:null,timeScale:1,update:function(a){a*=this.timeScale;for(var b=0;b=0&&this.setCurrent(b,e)):!c.loop&&c.lastTime>=c.endTime&&this.clearTrack(b)}}},apply:function(a){for(var b=0;bf&&(d=f);var h=c.previous;if(h){var i=h.time;!h.loop&&i>h.endTime&&(i=h.endTime),h.animation.apply(a,i,i,h.loop,null);var j=c.mixTime/c.mixDuration*c.mix;j>=1&&(j=1,c.previous=null),c.animation.mix(a,c.lastTime,d,g,this.events,j)}else 1==c.mix?c.animation.apply(a,c.lastTime,d,g,this.events):c.animation.mix(a,c.lastTime,d,g,this.events,c.mix);for(var k=0,l=this.events.length;l>k;k++){var m=this.events[k];c.onEvent&&c.onEvent(b,m),this.onEvent&&this.onEvent(b,m)}if(g?e%f>d%f:f>e&&d>=f){var n=Math.floor(d/f);c.onComplete&&c.onComplete(b,n),this.onComplete&&this.onComplete(b,n)}c.lastTime=c.time}}},clearTracks:function(){for(var a=0,b=this.tracks.length;b>a;a++)this.clearTrack(a);this.tracks.length=0},clearTrack:function(a){if(!(a>=this.tracks.length)){var b=this.tracks[a];b&&(b.onEnd&&b.onEnd(a),this.onEnd&&this.onEnd(a),this.tracks[a]=null)}},_expandToIndex:function(a){if(a=this.tracks.length;)this.tracks.push(null);return null},setCurrent:function(a,b){var c=this._expandToIndex(a);if(c){var d=c.previous;c.previous=null,c.onEnd&&c.onEnd(a),this.onEnd&&this.onEnd(a),b.mixDuration=this.data.getMix(c.animation,b.animation),b.mixDuration>0&&(b.mixTime=0,b.previous=d&&c.mixTime/c.mixDuration<.5?d:c)}this.tracks[a]=b,b.onStart&&b.onStart(a),this.onStart&&this.onStart(a)},setAnimationByName:function(a,b,c){var d=this.data.skeletonData.findAnimation(b);if(!d)throw"Animation not found: "+b;return this.setAnimation(a,d,c)},setAnimation:function(a,b,d){var e=new c.TrackEntry;return e.animation=b,e.loop=d,e.endTime=b.duration,this.setCurrent(a,e),e},addAnimationByName:function(a,b,c,d){var e=this.data.skeletonData.findAnimation(b);if(!e)throw"Animation not found: "+b;return this.addAnimation(a,e,c,d)},addAnimation:function(a,b,d,e){var f=new c.TrackEntry;f.animation=b,f.loop=d,f.endTime=b.duration;var g=this._expandToIndex(a);if(g){for(;g.next;)g=g.next;g.next=f}else this.tracks[a]=f;return 0>=e&&(g?e+=g.endTime-this.data.getMix(g.animation,b):e=0),f.delay=e,f},getCurrent:function(a){return a>=this.tracks.length?null:this.tracks[a]}},c.SkeletonJson=function(a){this.attachmentLoader=a},c.SkeletonJson.prototype={scale:1,readSkeletonData:function(a,b){var d=new c.SkeletonData;d.name=b;var e=a.skeleton;e&&(d.hash=e.hash,d.version=e.spine,d.width=e.width||0,d.height=e.height||0);for(var f=a.bones,g=0,h=f.length;h>g;g++){var i=f[g],j=null;if(i.parent&&(j=d.findBone(i.parent),!j))throw"Parent bone not found: "+i.parent;var k=new c.BoneData(i.name,j);k.length=(i.length||0)*this.scale,k.x=(i.x||0)*this.scale,k.y=(i.y||0)*this.scale,k.rotation=i.rotation||0,k.scaleX=i.hasOwnProperty("scaleX")?i.scaleX:1,k.scaleY=i.hasOwnProperty("scaleY")?i.scaleY:1,k.inheritScale=i.hasOwnProperty("inheritScale")?i.inheritScale:!0,k.inheritRotation=i.hasOwnProperty("inheritRotation")?i.inheritRotation:!0,d.bones.push(k)}var l=a.ik;if(l)for(var g=0,h=l.length;h>g;g++){for(var m=l[g],n=new c.IkConstraintData(m.name),f=m.bones,o=0,p=f.length;p>o;o++){var q=d.findBone(f[o]);if(!q)throw"IK bone not found: "+f[o];n.bones.push(q)}if(n.target=d.findBone(m.target),!n.target)throw"Target bone not found: "+m.target;n.bendDirection=!m.hasOwnProperty("bendPositive")||m.bendPositive?1:-1,n.mix=m.hasOwnProperty("mix")?m.mix:1,d.ikConstraints.push(n)}for(var r=a.slots,g=0,h=r.length;h>g;g++){var s=r[g],k=d.findBone(s.bone);if(!k)throw"Slot bone not found: "+s.bone;var t=new c.SlotData(s.name,k),u=s.color;u&&(t.r=this.toColor(u,0),t.g=this.toColor(u,1),t.b=this.toColor(u,2),t.a=this.toColor(u,3)),t.attachmentName=s.attachment,t.additiveBlending=s.additive&&"true"==s.additive,d.slots.push(t)}var v=a.skins;for(var w in v)if(v.hasOwnProperty(w)){var x=v[w],y=new c.Skin(w);for(var z in x)if(x.hasOwnProperty(z)){var A=d.findSlotIndex(z),B=x[z];for(var C in B)if(B.hasOwnProperty(C)){var D=this.readAttachment(y,C,B[C]);D&&y.addAttachment(A,C,D)}}d.skins.push(y),"default"==y.name&&(d.defaultSkin=y)}var E=a.events;for(var F in E)if(E.hasOwnProperty(F)){var G=E[F],H=new c.EventData(F);H.intValue=G["int"]||0,H.floatValue=G["float"]||0,H.stringValue=G.string||null,d.events.push(H)}var I=a.animations;for(var J in I)I.hasOwnProperty(J)&&this.readAnimation(J,I[J],d);return d},readAttachment:function(a,b,d){b=d.name||b;var e=c.AttachmentType[d.type||"region"],f=d.path||b,g=this.scale; -if(e==c.AttachmentType.region){var h=this.attachmentLoader.newRegionAttachment(a,b,f);if(!h)return null;h.path=f,h.x=(d.x||0)*g,h.y=(d.y||0)*g,h.scaleX=d.hasOwnProperty("scaleX")?d.scaleX:1,h.scaleY=d.hasOwnProperty("scaleY")?d.scaleY:1,h.rotation=d.rotation||0,h.width=(d.width||0)*g,h.height=(d.height||0)*g;var i=d.color;return i&&(h.r=this.toColor(i,0),h.g=this.toColor(i,1),h.b=this.toColor(i,2),h.a=this.toColor(i,3)),h.updateOffset(),h}if(e==c.AttachmentType.mesh){var j=this.attachmentLoader.newMeshAttachment(a,b,f);return j?(j.path=f,j.vertices=this.getFloatArray(d,"vertices",g),j.triangles=this.getIntArray(d,"triangles"),j.regionUVs=this.getFloatArray(d,"uvs",1),j.updateUVs(),i=d.color,i&&(j.r=this.toColor(i,0),j.g=this.toColor(i,1),j.b=this.toColor(i,2),j.a=this.toColor(i,3)),j.hullLength=2*(d.hull||0),d.edges&&(j.edges=this.getIntArray(d,"edges")),j.width=(d.width||0)*g,j.height=(d.height||0)*g,j):null}if(e==c.AttachmentType.skinnedmesh){var j=this.attachmentLoader.newSkinnedMeshAttachment(a,b,f);if(!j)return null;j.path=f;for(var k=this.getFloatArray(d,"uvs",1),l=this.getFloatArray(d,"vertices",1),m=[],n=[],o=0,p=l.length;p>o;){var q=0|l[o++];n[n.length]=q;for(var r=o+4*q;r>o;)n[n.length]=l[o],m[m.length]=l[o+1]*g,m[m.length]=l[o+2]*g,m[m.length]=l[o+3],o+=4}return j.bones=n,j.weights=m,j.triangles=this.getIntArray(d,"triangles"),j.regionUVs=k,j.updateUVs(),i=d.color,i&&(j.r=this.toColor(i,0),j.g=this.toColor(i,1),j.b=this.toColor(i,2),j.a=this.toColor(i,3)),j.hullLength=2*(d.hull||0),d.edges&&(j.edges=this.getIntArray(d,"edges")),j.width=(d.width||0)*g,j.height=(d.height||0)*g,j}if(e==c.AttachmentType.boundingbox){for(var s=this.attachmentLoader.newBoundingBoxAttachment(a,b),l=d.vertices,o=0,p=l.length;p>o;o++)s.vertices.push(l[o]*g);return s}throw"Unknown attachment type: "+e},readAnimation:function(a,b,d){var e=[],f=0,g=b.slots;for(var h in g)if(g.hasOwnProperty(h)){var i=g[h],j=d.findSlotIndex(h);for(var k in i)if(i.hasOwnProperty(k)){var l=i[k];if("color"==k){var m=new c.ColorTimeline(l.length);m.slotIndex=j;for(var n=0,o=0,p=l.length;p>o;o++){var q=l[o],r=q.color,s=this.toColor(r,0),t=this.toColor(r,1),u=this.toColor(r,2),v=this.toColor(r,3);m.setFrame(n,q.time,s,t,u,v),this.readCurve(m,n,q),n++}e.push(m),f=Math.max(f,m.frames[5*m.getFrameCount()-5])}else{if("attachment"!=k)throw"Invalid timeline type for a slot: "+k+" ("+h+")";var m=new c.AttachmentTimeline(l.length);m.slotIndex=j;for(var n=0,o=0,p=l.length;p>o;o++){var q=l[o];m.setFrame(n++,q.time,q.name)}e.push(m),f=Math.max(f,m.frames[m.getFrameCount()-1])}}}var w=b.bones;for(var x in w)if(w.hasOwnProperty(x)){var y=d.findBoneIndex(x);if(-1==y)throw"Bone not found: "+x;var z=w[x];for(var k in z)if(z.hasOwnProperty(k)){var l=z[k];if("rotate"==k){var m=new c.RotateTimeline(l.length);m.boneIndex=y;for(var n=0,o=0,p=l.length;p>o;o++){var q=l[o];m.setFrame(n,q.time,q.angle),this.readCurve(m,n,q),n++}e.push(m),f=Math.max(f,m.frames[2*m.getFrameCount()-2])}else if("translate"==k||"scale"==k){var m,A=1;"scale"==k?m=new c.ScaleTimeline(l.length):(m=new c.TranslateTimeline(l.length),A=this.scale),m.boneIndex=y;for(var n=0,o=0,p=l.length;p>o;o++){var q=l[o],B=(q.x||0)*A,C=(q.y||0)*A;m.setFrame(n,q.time,B,C),this.readCurve(m,n,q),n++}e.push(m),f=Math.max(f,m.frames[3*m.getFrameCount()-3])}else{if("flipX"!=k&&"flipY"!=k)throw"Invalid timeline type for a bone: "+k+" ("+x+")";var B="flipX"==k,m=B?new c.FlipXTimeline(l.length):new c.FlipYTimeline(l.length);m.boneIndex=y;for(var D=B?"x":"y",n=0,o=0,p=l.length;p>o;o++){var q=l[o];m.setFrame(n,q.time,q[D]||!1),n++}e.push(m),f=Math.max(f,m.frames[2*m.getFrameCount()-2])}}}var E=b.ik;for(var F in E)if(E.hasOwnProperty(F)){var G=d.findIkConstraint(F),l=E[F],m=new c.IkConstraintTimeline(l.length);m.ikConstraintIndex=d.ikConstraints.indexOf(G);for(var n=0,o=0,p=l.length;p>o;o++){var q=l[o],H=q.hasOwnProperty("mix")?q.mix:1,I=!q.hasOwnProperty("bendPositive")||q.bendPositive?1:-1;m.setFrame(n,q.time,H,I),this.readCurve(m,n,q),n++}e.push(m),f=Math.max(f,m.frames[3*m.frameCount-3])}var J=b.ffd;for(var K in J){var L=d.findSkin(K),i=J[K];for(h in i){var j=d.findSlotIndex(h),M=i[h];for(var N in M){var l=M[N],m=new c.FfdTimeline(l.length),O=L.getAttachment(j,N);if(!O)throw"FFD attachment not found: "+N;m.slotIndex=j,m.attachment=O;var P,Q=O.type==c.AttachmentType.mesh;P=Q?O.vertices.length:O.weights.length/3*2;for(var n=0,o=0,p=l.length;p>o;o++){var R,q=l[o];if(q.vertices){var S=q.vertices,R=[];R.length=P;var T=q.offset||0,U=S.length;if(1==this.scale)for(var V=0;U>V;V++)R[V+T]=S[V];else for(var V=0;U>V;V++)R[V+T]=S[V]*this.scale;if(Q)for(var W=O.vertices,V=0,U=R.length;U>V;V++)R[V]+=W[V]}else Q?R=O.vertices:(R=[],R.length=P);m.setFrame(n,q.time,R),this.readCurve(m,n,q),n++}e[e.length]=m,f=Math.max(f,m.frames[m.frameCount-1])}}}var X=b.drawOrder;if(X||(X=b.draworder),X){for(var m=new c.DrawOrderTimeline(X.length),Y=d.slots.length,n=0,o=0,p=X.length;p>o;o++){var Z=X[o],$=null;if(Z.offsets){$=[],$.length=Y;for(var V=Y-1;V>=0;V--)$[V]=-1;var _=Z.offsets,ab=[];ab.length=Y-_.length;for(var bb=0,cb=0,V=0,U=_.length;U>V;V++){var db=_[V],j=d.findSlotIndex(db.slot);if(-1==j)throw"Slot not found: "+db.slot;for(;bb!=j;)ab[cb++]=bb++;$[bb+db.offset]=bb++}for(;Y>bb;)ab[cb++]=bb++;for(var V=Y-1;V>=0;V--)-1==$[V]&&($[V]=ab[--cb])}m.setFrame(n++,Z.time,$)}e.push(m),f=Math.max(f,m.frames[m.getFrameCount()-1])}var eb=b.events;if(eb){for(var m=new c.EventTimeline(eb.length),n=0,o=0,p=eb.length;p>o;o++){var fb=eb[o],gb=d.findEvent(fb.name);if(!gb)throw"Event not found: "+fb.name;var hb=new c.Event(gb);hb.intValue=fb.hasOwnProperty("int")?fb["int"]:gb.intValue,hb.floatValue=fb.hasOwnProperty("float")?fb["float"]:gb.floatValue,hb.stringValue=fb.hasOwnProperty("string")?fb.string:gb.stringValue,m.setFrame(n++,fb.time,hb)}e.push(m),f=Math.max(f,m.frames[m.getFrameCount()-1])}d.animations.push(new c.Animation(a,e,f))},readCurve:function(a,b,c){var d=c.curve;d?"stepped"==d?a.curves.setStepped(b):d instanceof Array&&a.curves.setCurve(b,d[0],d[1],d[2],d[3]):a.curves.setLinear(b)},toColor:function(a,b){if(8!=a.length)throw"Color hexidecimal length must be 8, recieved: "+a;return parseInt(a.substring(2*b,2*b+2),16)/255},getFloatArray:function(a,b,d){var e=a[b],f=new c.Float32Array(e.length),g=0,h=e.length;if(1==d)for(;h>g;g++)f[g]=e[g];else for(;h>g;g++)f[g]=e[g]*d;return f},getIntArray:function(a,b){for(var d=a[b],e=new c.Uint16Array(d.length),f=0,g=d.length;g>f;f++)e[f]=0|d[f];return e}},c.Atlas=function(a,b){this.textureLoader=b,this.pages=[],this.regions=[];var d=new c.AtlasReader(a),e=[];e.length=4;for(var f=null;;){var g=d.readLine();if(null===g)break;if(g=d.trim(g),g.length)if(f){var h=new c.AtlasRegion;h.name=g,h.page=f,h.rotate="true"==d.readValue(),d.readTuple(e);var i=parseInt(e[0]),j=parseInt(e[1]);d.readTuple(e);var k=parseInt(e[0]),l=parseInt(e[1]);h.u=i/f.width,h.v=j/f.height,h.rotate?(h.u2=(i+l)/f.width,h.v2=(j+k)/f.height):(h.u2=(i+k)/f.width,h.v2=(j+l)/f.height),h.x=i,h.y=j,h.width=Math.abs(k),h.height=Math.abs(l),4==d.readTuple(e)&&(h.splits=[parseInt(e[0]),parseInt(e[1]),parseInt(e[2]),parseInt(e[3])],4==d.readTuple(e)&&(h.pads=[parseInt(e[0]),parseInt(e[1]),parseInt(e[2]),parseInt(e[3])],d.readTuple(e))),h.originalWidth=parseInt(e[0]),h.originalHeight=parseInt(e[1]),d.readTuple(e),h.offsetX=parseInt(e[0]),h.offsetY=parseInt(e[1]),h.index=parseInt(d.readValue()),this.regions.push(h)}else{f=new c.AtlasPage,f.name=g,2==d.readTuple(e)&&(f.width=parseInt(e[0]),f.height=parseInt(e[1]),d.readTuple(e)),f.format=c.Atlas.Format[e[0]],d.readTuple(e),f.minFilter=c.Atlas.TextureFilter[e[0]],f.magFilter=c.Atlas.TextureFilter[e[1]];var m=d.readValue();f.uWrap=c.Atlas.TextureWrap.clampToEdge,f.vWrap=c.Atlas.TextureWrap.clampToEdge,"x"==m?f.uWrap=c.Atlas.TextureWrap.repeat:"y"==m?f.vWrap=c.Atlas.TextureWrap.repeat:"xy"==m&&(f.uWrap=f.vWrap=c.Atlas.TextureWrap.repeat),b.load(f,g,this),this.pages.push(f)}else f=null}},c.Atlas.prototype={findRegion:function(a){for(var b=this.regions,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},dispose:function(){for(var a=this.pages,b=0,c=a.length;c>b;b++)this.textureLoader.unload(a[b].rendererObject)},updateUVs:function(a){for(var b=this.regions,c=0,d=b.length;d>c;c++){var e=b[c];e.page==a&&(e.u=e.x/a.width,e.v=e.y/a.height,e.rotate?(e.u2=(e.x+e.height)/a.width,e.v2=(e.y+e.width)/a.height):(e.u2=(e.x+e.width)/a.width,e.v2=(e.y+e.height)/a.height))}}},c.Atlas.Format={alpha:0,intensity:1,luminanceAlpha:2,rgb565:3,rgba4444:4,rgb888:5,rgba8888:6},c.Atlas.TextureFilter={nearest:0,linear:1,mipMap:2,mipMapNearestNearest:3,mipMapLinearNearest:4,mipMapNearestLinear:5,mipMapLinearLinear:6},c.Atlas.TextureWrap={mirroredRepeat:0,clampToEdge:1,repeat:2},c.AtlasPage=function(){},c.AtlasPage.prototype={name:null,format:null,minFilter:null,magFilter:null,uWrap:null,vWrap:null,rendererObject:null,width:0,height:0},c.AtlasRegion=function(){},c.AtlasRegion.prototype={page:null,name:null,x:0,y:0,width:0,height:0,u:0,v:0,u2:0,v2:0,offsetX:0,offsetY:0,originalWidth:0,originalHeight:0,index:0,rotate:!1,splits:null,pads:null},c.AtlasReader=function(a){this.lines=a.split(/\r\n|\r|\n/)},c.AtlasReader.prototype={index:0,trim:function(a){return a.replace(/^\s+|\s+$/g,"")},readLine:function(){return this.index>=this.lines.length?null:this.lines[this.index++]},readValue:function(){var a=this.readLine(),b=a.indexOf(":");if(-1==b)throw"Invalid line: "+a;return this.trim(a.substring(b+1))},readTuple:function(a){var b=this.readLine(),c=b.indexOf(":");if(-1==c)throw"Invalid line: "+b;for(var d=0,e=c+1;3>d;d++){var f=b.indexOf(",",e);if(-1==f)break;a[d]=this.trim(b.substr(e,f-e)),e=f+1}return a[d]=this.trim(b.substring(e)),d+1}},c.AtlasAttachmentLoader=function(a){this.atlas=a},c.AtlasAttachmentLoader.prototype={newRegionAttachment:function(a,b,d){var e=this.atlas.findRegion(d);if(!e)throw"Region not found in atlas: "+d+" (region attachment: "+b+")";var f=new c.RegionAttachment(b);return f.rendererObject=e,f.setUVs(e.u,e.v,e.u2,e.v2,e.rotate),f.regionOffsetX=e.offsetX,f.regionOffsetY=e.offsetY,f.regionWidth=e.width,f.regionHeight=e.height,f.regionOriginalWidth=e.originalWidth,f.regionOriginalHeight=e.originalHeight,f},newMeshAttachment:function(a,b,d){var e=this.atlas.findRegion(d);if(!e)throw"Region not found in atlas: "+d+" (mesh attachment: "+b+")";var f=new c.MeshAttachment(b);return f.rendererObject=e,f.regionU=e.u,f.regionV=e.v,f.regionU2=e.u2,f.regionV2=e.v2,f.regionRotate=e.rotate,f.regionOffsetX=e.offsetX,f.regionOffsetY=e.offsetY,f.regionWidth=e.width,f.regionHeight=e.height,f.regionOriginalWidth=e.originalWidth,f.regionOriginalHeight=e.originalHeight,f},newSkinnedMeshAttachment:function(a,b,d){var e=this.atlas.findRegion(d);if(!e)throw"Region not found in atlas: "+d+" (skinned mesh attachment: "+b+")";var f=new c.SkinnedMeshAttachment(b);return f.rendererObject=e,f.regionU=e.u,f.regionV=e.v,f.regionU2=e.u2,f.regionV2=e.v2,f.regionRotate=e.rotate,f.regionOffsetX=e.offsetX,f.regionOffsetY=e.offsetY,f.regionWidth=e.width,f.regionHeight=e.height,f.regionOriginalWidth=e.originalWidth,f.regionOriginalHeight=e.originalHeight,f},newBoundingBoxAttachment:function(a,b){return new c.BoundingBoxAttachment(b)}},c.SkeletonBounds=function(){this.polygonPool=[],this.polygons=[],this.boundingBoxes=[]},c.SkeletonBounds.prototype={minX:0,minY:0,maxX:0,maxY:0,update:function(a,b){var d=a.slots,e=d.length,f=a.x,g=a.y,h=this.boundingBoxes,i=this.polygonPool,j=this.polygons;h.length=0;for(var k=0,l=j.length;l>k;k++)i.push(j[k]);j.length=0;for(var k=0;e>k;k++){var m=d[k],n=m.attachment;if(n.type==c.AttachmentType.boundingbox){h.push(n);var o,p=i.length;p>0?(o=i[p-1],i.splice(p-1,1)):o=[],j.push(o),o.length=n.vertices.length,n.computeWorldVertices(f,g,m.bone,o)}}b&&this.aabbCompute()},aabbCompute:function(){for(var a=this.polygons,b=Number.MAX_VALUE,c=Number.MAX_VALUE,d=Number.MIN_VALUE,e=Number.MIN_VALUE,f=0,g=a.length;g>f;f++)for(var h=a[f],i=0,j=h.length;j>i;i+=2){var k=h[i],l=h[i+1];b=Math.min(b,k),c=Math.min(c,l),d=Math.max(d,k),e=Math.max(e,l)}this.minX=b,this.minY=c,this.maxX=d,this.maxY=e},aabbContainsPoint:function(a,b){return a>=this.minX&&a<=this.maxX&&b>=this.minY&&b<=this.maxY},aabbIntersectsSegment:function(a,b,c,d){var e=this.minX,f=this.minY,g=this.maxX,h=this.maxY;if(e>=a&&e>=c||f>=b&&f>=d||a>=g&&c>=g||b>=h&&d>=h)return!1;var i=(d-b)/(c-a),j=i*(e-a)+b;if(j>f&&h>j)return!0;if(j=i*(g-a)+b,j>f&&h>j)return!0;var k=(f-b)/i+a;return k>e&&g>k?!0:(k=(h-b)/i+a,k>e&&g>k?!0:!1)},aabbIntersectsSkeleton:function(a){return this.minXa.minX&&this.minYa.minY},containsPoint:function(a,b){for(var c=this.polygons,d=0,e=c.length;e>d;d++)if(this.polygonContainsPoint(c[d],a,b))return this.boundingBoxes[d];return null},intersectsSegment:function(a,b,c,d){for(var e=this.polygons,f=0,g=e.length;g>f;f++)if(e[f].intersectsSegment(a,b,c,d))return this.boundingBoxes[f];return null},polygonContainsPoint:function(a,b,c){for(var d=a.length,e=d-2,f=!1,g=0;d>g;g+=2){var h=a[g+1],i=a[e+1];if(c>h&&i>=c||c>i&&h>=c){var j=a[g];j+(c-h)/(i-h)*(a[e]-j)l;l+=2){var m=a[l],n=a[l+1],o=j*n-k*m,p=j-m,q=k-n,r=g*q-h*p,s=(i*p-g*o)/r;if((s>=j&&m>=s||s>=m&&j>=s)&&(s>=b&&d>=s||s>=d&&b>=s)){var t=(i*q-h*o)/r;if((t>=k&&n>=t||t>=n&&k>=t)&&(t>=c&&e>=t||t>=e&&c>=t))return!0}j=m,k=n}return!1},getPolygon:function(a){var b=this.boundingBoxes.indexOf(a);return-1==b?null:this.polygons[b]},getWidth:function(){return this.maxX-this.minX},getHeight:function(){return this.maxY-this.minY}},c.Bone.yDown=!0,b.AnimCache={},b.SpineTextureLoader=function(a,c){b.EventTarget.call(this),this.basePath=a,this.crossorigin=c,this.loadingCount=0},b.SpineTextureLoader.prototype=b.SpineTextureLoader,b.SpineTextureLoader.prototype.load=function(a,c){if(a.rendererObject=b.BaseTexture.fromImage(this.basePath+"/"+c,this.crossorigin),!a.rendererObject.hasLoaded){var d=this;++d.loadingCount,a.rendererObject.addEventListener("loaded",function(){--d.loadingCount,d.dispatchEvent({type:"loadedBaseTexture",content:d})})}},b.SpineTextureLoader.prototype.unload=function(a){a.destroy(!0)},b.Spine=function(a){if(b.DisplayObjectContainer.call(this),this.spineData=b.AnimCache[a],!this.spineData)throw new Error("Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: "+a);this.skeleton=new c.Skeleton(this.spineData),this.skeleton.updateWorldTransform(),this.stateData=new c.AnimationStateData(this.spineData),this.state=new c.AnimationState(this.stateData),this.slotContainers=[];for(var d=0,e=this.skeleton.drawOrder.length;e>d;d++){var f=this.skeleton.drawOrder[d],g=f.attachment,h=new b.DisplayObjectContainer;if(this.slotContainers.push(h),this.addChild(h),g instanceof c.RegionAttachment){var i=g.rendererObject.name,j=this.createSprite(f,g);f.currentSprite=j,f.currentSpriteName=i,h.addChild(j)}else{if(!(g instanceof c.MeshAttachment))continue;var k=this.createMesh(f,g);f.currentMesh=k,f.currentMeshName=g.name,h.addChild(k)}}this.autoUpdate=!0},b.Spine.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Spine.prototype.constructor=b.Spine,Object.defineProperty(b.Spine.prototype,"autoUpdate",{get:function(){return this.updateTransform===b.Spine.prototype.autoUpdateTransform},set:function(a){this.updateTransform=a?b.Spine.prototype.autoUpdateTransform:b.DisplayObjectContainer.prototype.updateTransform}}),b.Spine.prototype.update=function(a){this.state.update(a),this.state.apply(this.skeleton),this.skeleton.updateWorldTransform();for(var d=this.skeleton.drawOrder,e=0,f=d.length;f>e;e++){var g=d[e],h=g.attachment,i=this.slotContainers[e];if(h){var j=h.type;if(j===c.AttachmentType.region){if(h.rendererObject&&(!g.currentSpriteName||g.currentSpriteName!==h.name)){var k=h.rendererObject.name;if(void 0!==g.currentSprite&&(g.currentSprite.visible=!1),g.sprites=g.sprites||{},void 0!==g.sprites[k])g.sprites[k].visible=!0;else{var l=this.createSprite(g,h);i.addChild(l)}g.currentSprite=g.sprites[k],g.currentSpriteName=k}var m=g.bone;i.position.x=m.worldX+h.x*m.m00+h.y*m.m01,i.position.y=m.worldY+h.x*m.m10+h.y*m.m11,i.scale.x=m.worldScaleX,i.scale.y=m.worldScaleY,i.rotation=-(g.bone.worldRotation*c.degRad),g.currentSprite.tint=b.rgb2hex([g.r,g.g,g.b])}else{if(j!==c.AttachmentType.skinnedmesh){i.visible=!1;continue}if(!g.currentMeshName||g.currentMeshName!==h.name){var n=h.name;if(void 0!==g.currentMesh&&(g.currentMesh.visible=!1),g.meshes=g.meshes||{},void 0!==g.meshes[n])g.meshes[n].visible=!0;else{var o=this.createMesh(g,h);i.addChild(o)}g.currentMesh=g.meshes[n],g.currentMeshName=n}h.computeWorldVertices(g.bone.skeleton.x,g.bone.skeleton.y,g,g.currentMesh.vertices)}i.visible=!0,i.alpha=g.a}else i.visible=!1}},b.Spine.prototype.autoUpdateTransform=function(){this.lastTime=this.lastTime||Date.now();var a=.001*(Date.now()-this.lastTime);this.lastTime=Date.now(),this.update(a),b.DisplayObjectContainer.prototype.updateTransform.call(this)},b.Spine.prototype.createSprite=function(a,d){var e=d.rendererObject,f=e.page.rendererObject,g=new b.Rectangle(e.x,e.y,e.rotate?e.height:e.width,e.rotate?e.width:e.height),h=new b.Texture(f,g),i=new b.Sprite(h),j=e.rotate?.5*Math.PI:0;return i.scale.set(e.width/e.originalWidth,e.height/e.originalHeight),i.rotation=j-d.rotation*c.degRad,i.anchor.x=i.anchor.y=.5,a.sprites=a.sprites||{},a.sprites[e.name]=i,i},b.Spine.prototype.createMesh=function(a,c){var d=c.rendererObject,e=d.page.rendererObject,f=new b.Texture(e),g=new b.Strip(f);return g.drawMode=b.Strip.DrawModes.TRIANGLES,g.canvasPadding=1.5,g.vertices=new b.Float32Array(c.uvs.length),g.uvs=c.uvs,g.indices=c.triangles,a.meshes=a.meshes||{},a.meshes[c.name]=g,g},b.BaseTextureCache={},b.BaseTextureCacheIdGenerator=0,b.BaseTexture=function(a,c){if(this.resolution=1,this.width=100,this.height=100,this.scaleMode=c||b.scaleModes.DEFAULT,this.hasLoaded=!1,this.source=a,this._UID=b._UID++,this.premultipliedAlpha=!0,this._glTextures=[],this.mipmap=!1,this._dirty=[!0,!0,!0,!0],a){if((this.source.complete||this.source.getContext)&&this.source.width&&this.source.height)this.hasLoaded=!0,this.width=this.source.naturalWidth||this.source.width,this.height=this.source.naturalHeight||this.source.height,this.dirty();else{var d=this;this.source.onload=function(){d.hasLoaded=!0,d.width=d.source.naturalWidth||d.source.width,d.height=d.source.naturalHeight||d.source.height,d.dirty(),d.dispatchEvent({type:"loaded",content:d})},this.source.onerror=function(){d.dispatchEvent({type:"error",content:d})}}this.imageUrl=null,this._powerOf2=!1}},b.BaseTexture.prototype.constructor=b.BaseTexture,b.EventTarget.mixin(b.BaseTexture.prototype),b.BaseTexture.prototype.destroy=function(){this.imageUrl?(delete b.BaseTextureCache[this.imageUrl],delete b.TextureCache[this.imageUrl],this.imageUrl=null,navigator.isCocoonJS||(this.source.src="")):this.source&&this.source._pixiId&&delete b.BaseTextureCache[this.source._pixiId],this.source=null,this.unloadFromGPU()},b.BaseTexture.prototype.updateSourceImage=function(a){this.hasLoaded=!1,this.source.src=null,this.source.src=a},b.BaseTexture.prototype.dirty=function(){for(var a=0;a=0;a--){var c=this._glTextures[a],d=b.glContexts[a];d&&c&&d.deleteTexture(c)}this._glTextures.length=0,this.dirty()},b.BaseTexture.fromImage=function(a,c,d){var e=b.BaseTextureCache[a];if(void 0===c&&-1===a.indexOf("data:")&&(c=!0),!e){var f=new Image;c&&(f.crossOrigin=""),f.src=a,e=new b.BaseTexture(f,d),e.imageUrl=a,b.BaseTextureCache[a]=e,-1!==a.indexOf(b.RETINA_PREFIX+".")&&(e.resolution=2)}return e},b.BaseTexture.fromCanvas=function(a,c){a._pixiId||(a._pixiId="canvas_"+b.TextureCacheIdGenerator++);var d=b.BaseTextureCache[a._pixiId];return d||(d=new b.BaseTexture(a,c),b.BaseTextureCache[a._pixiId]=d),d},b.TextureCache={},b.FrameCache={},b.TextureCacheIdGenerator=0,b.Texture=function(a,c,d,e){this.noFrame=!1,c||(this.noFrame=!0,c=new b.Rectangle(0,0,1,1)),a instanceof b.Texture&&(a=a.baseTexture),this.baseTexture=a,this.frame=c,this.trim=e,this.valid=!1,this.requiresUpdate=!1,this._uvs=null,this.width=0,this.height=0,this.crop=d||new b.Rectangle(0,0,1,1),a.hasLoaded?(this.noFrame&&(c=new b.Rectangle(0,0,a.width,a.height)),this.setFrame(c)):a.addEventListener("loaded",this.onBaseTextureLoaded.bind(this))},b.Texture.prototype.constructor=b.Texture,b.EventTarget.mixin(b.Texture.prototype),b.Texture.prototype.onBaseTextureLoaded=function(){var a=this.baseTexture;a.removeEventListener("loaded",this.onLoaded),this.noFrame&&(this.frame=new b.Rectangle(0,0,a.width,a.height)),this.setFrame(this.frame),this.dispatchEvent({type:"update",content:this})},b.Texture.prototype.destroy=function(a){a&&this.baseTexture.destroy(),this.valid=!1},b.Texture.prototype.setFrame=function(a){if(this.noFrame=!1,this.frame=a,this.width=a.width,this.height=a.height,this.crop.x=a.x,this.crop.y=a.y,this.crop.width=a.width,this.crop.height=a.height,!this.trim&&(a.x+a.width>this.baseTexture.width||a.y+a.height>this.baseTexture.height))throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.valid=a&&a.width&&a.height&&this.baseTexture.source&&this.baseTexture.hasLoaded,this.trim&&(this.width=this.trim.width,this.height=this.trim.height,this.frame.width=this.trim.width,this.frame.height=this.trim.height),this.valid&&this._updateUvs()},b.Texture.prototype._updateUvs=function(){this._uvs||(this._uvs=new b.TextureUvs);var a=this.crop,c=this.baseTexture.width,d=this.baseTexture.height;this._uvs.x0=a.x/c,this._uvs.y0=a.y/d,this._uvs.x1=(a.x+a.width)/c,this._uvs.y1=a.y/d,this._uvs.x2=(a.x+a.width)/c,this._uvs.y2=(a.y+a.height)/d,this._uvs.x3=a.x/c,this._uvs.y3=(a.y+a.height)/d},b.Texture.fromImage=function(a,c,d){var e=b.TextureCache[a];return e||(e=new b.Texture(b.BaseTexture.fromImage(a,c,d)),b.TextureCache[a]=e),e},b.Texture.fromFrame=function(a){var c=b.TextureCache[a];if(!c)throw new Error('The frameId "'+a+'" does not exist in the texture cache ');return c},b.Texture.fromCanvas=function(a,c){var d=b.BaseTexture.fromCanvas(a,c);return new b.Texture(d)},b.Texture.addTextureToCache=function(a,c){b.TextureCache[c]=a},b.Texture.removeTextureFromCache=function(a){var c=b.TextureCache[a];return delete b.TextureCache[a],delete b.BaseTextureCache[a],c},b.TextureUvs=function(){this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0},b.Texture.emptyTexture=new b.Texture(new b.BaseTexture),b.RenderTexture=function(a,c,d,e,f){if(this.width=a||100,this.height=c||100,this.resolution=f||1,this.frame=new b.Rectangle(0,0,this.width*this.resolution,this.height*this.resolution),this.crop=new b.Rectangle(0,0,this.width*this.resolution,this.height*this.resolution),this.baseTexture=new b.BaseTexture,this.baseTexture.width=this.width*this.resolution,this.baseTexture.height=this.height*this.resolution,this.baseTexture._glTextures=[],this.baseTexture.resolution=this.resolution,this.baseTexture.scaleMode=e||b.scaleModes.DEFAULT,this.baseTexture.hasLoaded=!0,b.Texture.call(this,this.baseTexture,new b.Rectangle(0,0,this.width*this.resolution,this.height*this.resolution)),this.renderer=d||b.defaultRenderer,this.renderer.type===b.WEBGL_RENDERER){var g=this.renderer.gl;this.baseTexture._dirty[g.id]=!1,this.textureBuffer=new b.FilterTexture(g,this.width,this.height,this.baseTexture.scaleMode),this.baseTexture._glTextures[g.id]=this.textureBuffer.texture,this.render=this.renderWebGL,this.projection=new b.Point(.5*this.width,.5*-this.height)}else this.render=this.renderCanvas,this.textureBuffer=new b.CanvasBuffer(this.width*this.resolution,this.height*this.resolution),this.baseTexture.source=this.textureBuffer.canvas;this.valid=!0,this._updateUvs()},b.RenderTexture.prototype=Object.create(b.Texture.prototype),b.RenderTexture.prototype.constructor=b.RenderTexture,b.RenderTexture.prototype.resize=function(a,c,d){(a!==this.width||c!==this.height)&&(this.valid=a>0&&c>0,this.width=a,this.height=c,this.frame.width=this.crop.width=a*this.resolution,this.frame.height=this.crop.height=c*this.resolution,d&&(this.baseTexture.width=this.width*this.resolution,this.baseTexture.height=this.height*this.resolution),this.renderer.type===b.WEBGL_RENDERER&&(this.projection.x=this.width/2,this.projection.y=-this.height/2),this.valid&&this.textureBuffer.resize(this.width,this.height))},b.RenderTexture.prototype.clear=function(){this.valid&&(this.renderer.type===b.WEBGL_RENDERER&&this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER,this.textureBuffer.frameBuffer),this.textureBuffer.clear())},b.RenderTexture.prototype.renderWebGL=function(a,b,c){if(this.valid){var d=a.worldTransform;d.identity(),d.translate(0,2*this.projection.y),b&&d.append(b),d.scale(1,-1),a.worldAlpha=1;for(var e=a.children,f=0,g=e.length;g>f;f++)e[f].updateTransform();var h=this.renderer.gl;h.viewport(0,0,this.width*this.resolution,this.height*this.resolution),h.bindFramebuffer(h.FRAMEBUFFER,this.textureBuffer.frameBuffer),c&&this.textureBuffer.clear(),this.renderer.spriteBatch.dirty=!0,this.renderer.renderDisplayObject(a,this.projection,this.textureBuffer.frameBuffer),this.renderer.spriteBatch.dirty=!0}},b.RenderTexture.prototype.renderCanvas=function(a,b,c){if(this.valid){var d=a.worldTransform;d.identity(),b&&d.append(b),a.worldAlpha=1;for(var e=a.children,f=0,g=e.length;g>f;f++)e[f].updateTransform();c&&this.textureBuffer.clear();var h=this.textureBuffer.context,i=this.renderer.resolution;this.renderer.resolution=this.resolution,this.renderer.renderDisplayObject(a,h),this.renderer.resolution=i}},b.RenderTexture.prototype.getImage=function(){var a=new Image;return a.src=this.getBase64(),a},b.RenderTexture.prototype.getBase64=function(){return this.getCanvas().toDataURL()},b.RenderTexture.prototype.getCanvas=function(){if(this.renderer.type===b.WEBGL_RENDERER){var a=this.renderer.gl,c=this.textureBuffer.width,d=this.textureBuffer.height,e=new Uint8Array(4*c*d);a.bindFramebuffer(a.FRAMEBUFFER,this.textureBuffer.frameBuffer),a.readPixels(0,0,c,d,a.RGBA,a.UNSIGNED_BYTE,e),a.bindFramebuffer(a.FRAMEBUFFER,null);var f=new b.CanvasBuffer(c,d),g=f.context.getImageData(0,0,c,d);return g.data.set(e),f.context.putImageData(g,0,0),f.canvas}return this.textureBuffer.canvas},b.RenderTexture.tempMatrix=new b.Matrix,b.VideoTexture=function(a,c){if(!a)throw new Error("No video source element specified.");(a.readyState===a.HAVE_ENOUGH_DATA||a.readyState===a.HAVE_FUTURE_DATA)&&a.width&&a.height&&(a.complete=!0),b.BaseTexture.call(this,a,c),this.autoUpdate=!1,this.updateBound=this._onUpdate.bind(this),a.complete||(this._onCanPlay=this.onCanPlay.bind(this),a.addEventListener("canplay",this._onCanPlay),a.addEventListener("canplaythrough",this._onCanPlay),a.addEventListener("play",this.onPlayStart.bind(this)),a.addEventListener("pause",this.onPlayStop.bind(this)))},b.VideoTexture.prototype=Object.create(b.BaseTexture.prototype),b.VideoTexture.constructor=b.VideoTexture,b.VideoTexture.prototype._onUpdate=function(){this.autoUpdate&&(window.requestAnimationFrame(this.updateBound),this.dirty())},b.VideoTexture.prototype.onPlayStart=function(){this.autoUpdate||(window.requestAnimationFrame(this.updateBound),this.autoUpdate=!0)},b.VideoTexture.prototype.onPlayStop=function(){this.autoUpdate=!1},b.VideoTexture.prototype.onCanPlay=function(){"canplaythrough"===event.type&&(this.hasLoaded=!0,this.source&&(this.source.removeEventListener("canplay",this._onCanPlay),this.source.removeEventListener("canplaythrough",this._onCanPlay),this.width=this.source.videoWidth,this.height=this.source.videoHeight,this.__loaded||(this.__loaded=!0,this.dispatchEvent({type:"loaded",content:this}))))},b.VideoTexture.prototype.destroy=function(){this.source&&this.source._pixiId&&(b.BaseTextureCache[this.source._pixiId]=null,delete b.BaseTextureCache[this.source._pixiId],this.source._pixiId=null,delete this.source._pixiId),b.BaseTexture.prototype.destroy.call(this)},b.VideoTexture.baseTextureFromVideo=function(a,c){a._pixiId||(a._pixiId="video_"+b.TextureCacheIdGenerator++);var d=b.BaseTextureCache[a._pixiId];return d||(d=new b.VideoTexture(a,c),b.BaseTextureCache[a._pixiId]=d),d},b.VideoTexture.textureFromVideo=function(a,c){var d=b.VideoTexture.baseTextureFromVideo(a,c);return new b.Texture(d)},b.VideoTexture.fromUrl=function(a,c){var d=document.createElement("video");return d.src=a,d.autoPlay=!0,d.play(),b.VideoTexture.textureFromVideo(d,c)},b.AssetLoader=function(a,c){this.assetURLs=a,this.crossorigin=c,this.loadersByType={jpg:b.ImageLoader,jpeg:b.ImageLoader,png:b.ImageLoader,gif:b.ImageLoader,webp:b.ImageLoader,json:b.JsonLoader,atlas:b.AtlasLoader,anim:b.SpineLoader,xml:b.BitmapFontLoader,fnt:b.BitmapFontLoader}},b.EventTarget.mixin(b.AssetLoader.prototype),b.AssetLoader.prototype.constructor=b.AssetLoader,b.AssetLoader.prototype._getDataType=function(a){var b="data:",c=a.slice(0,b.length).toLowerCase();if(c===b){var d=a.slice(b.length),e=d.indexOf(",");if(-1===e)return null;var f=d.slice(0,e).split(";")[0];return f&&"text/plain"!==f.toLowerCase()?f.split("/").pop().toLowerCase():"txt"}return null},b.AssetLoader.prototype.load=function(){function a(a){b.onAssetLoaded(a.data.content)}var b=this;this.loadCount=this.assetURLs.length;for(var c=0;c0?a.addEventListener("loadedBaseTexture",function(a){a.content.content.loadingCount<=0&&o.onLoaded()}):o.onLoaded()},n.load()}else this.onLoaded()},b.JsonLoader.prototype.onLoaded=function(){this.loaded=!0,this.dispatchEvent({type:"loaded",content:this})},b.JsonLoader.prototype.onError=function(){this.dispatchEvent({type:"error",content:this})},b.AtlasLoader=function(a,b){this.url=a,this.baseUrl=a.replace(/[^\/]*$/,""),this.crossorigin=b,this.loaded=!1},b.AtlasLoader.constructor=b.AtlasLoader,b.EventTarget.mixin(b.AtlasLoader.prototype),b.AtlasLoader.prototype.load=function(){this.ajaxRequest=new b.AjaxRequest,this.ajaxRequest.onreadystatechange=this.onAtlasLoaded.bind(this),this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/json"),this.ajaxRequest.send(null)},b.AtlasLoader.prototype.onAtlasLoaded=function(){if(4===this.ajaxRequest.readyState)if(200===this.ajaxRequest.status||-1===window.location.href.indexOf("http")){this.atlas={meta:{image:[]},frames:[]};var a=this.ajaxRequest.responseText.split(/\r?\n/),c=-3,d=0,e=null,f=!1,g=0,h=0,i=this.onLoaded.bind(this);for(g=0;g0){if(f===g)this.atlas.meta.image.push(a[g]),d=this.atlas.meta.image.length-1,this.atlas.frames.push({}),c=-3;else if(c>0)if(c%7===1)null!=e&&(this.atlas.frames[d][e.name]=e),e={name:a[g],frame:{}};else{var j=a[g].split(" ");if(c%7===3)e.frame.x=Number(j[1].replace(",","")),e.frame.y=Number(j[2]);else if(c%7===4)e.frame.w=Number(j[1].replace(",","")),e.frame.h=Number(j[2]);else if(c%7===5){var k={x:0,y:0,w:Number(j[1].replace(",","")),h:Number(j[2])};k.w>e.frame.w||k.h>e.frame.h?(e.trimmed=!0,e.realSize=k):e.trimmed=!1}}c++}if(null!=e&&(this.atlas.frames[d][e.name]=e),this.atlas.meta.image.length>0){for(this.images=[],h=0;hthis.currentImageId?(this.currentImageId++,this.images[this.currentImageId].load()):(this.loaded=!0,this.emit("loaded",{content:this}))},b.AtlasLoader.prototype.onError=function(){this.emit("error",{content:this})},b.SpriteSheetLoader=function(a,b){this.url=a,this.crossorigin=b,this.baseUrl=a.replace(/[^\/]*$/,""),this.texture=null,this.frames={}},b.SpriteSheetLoader.prototype.constructor=b.SpriteSheetLoader,b.EventTarget.mixin(b.SpriteSheetLoader.prototype),b.SpriteSheetLoader.prototype.load=function(){var a=this,c=new b.JsonLoader(this.url,this.crossorigin);c.on("loaded",function(b){a.json=b.data.content.json,a.onLoaded()}),c.load()},b.SpriteSheetLoader.prototype.onLoaded=function(){this.emit("loaded",{content:this})},b.ImageLoader=function(a,c){this.texture=b.Texture.fromImage(a,c),this.frames=[]},b.ImageLoader.prototype.constructor=b.ImageLoader,b.EventTarget.mixin(b.ImageLoader.prototype),b.ImageLoader.prototype.load=function(){this.texture.baseTexture.hasLoaded?this.onLoaded():this.texture.baseTexture.on("loaded",this.onLoaded.bind(this))},b.ImageLoader.prototype.onLoaded=function(){this.emit("loaded",{content:this})},b.ImageLoader.prototype.loadFramedSpriteSheet=function(a,c,d){this.frames=[];for(var e=Math.floor(this.texture.width/a),f=Math.floor(this.texture.height/c),g=0,h=0;f>h;h++)for(var i=0;e>i;i++,g++){var j=new b.Texture(this.texture.baseTexture,{x:i*a,y:h*c,width:a,height:c});this.frames.push(j),d&&(b.TextureCache[d+"-"+g]=j)}this.load()},b.BitmapFontLoader=function(a,b){this.url=a,this.crossorigin=b,this.baseUrl=a.replace(/[^\/]*$/,""),this.texture=null},b.BitmapFontLoader.prototype.constructor=b.BitmapFontLoader,b.EventTarget.mixin(b.BitmapFontLoader.prototype),b.BitmapFontLoader.prototype.load=function(){this.ajaxRequest=new b.AjaxRequest,this.ajaxRequest.onreadystatechange=this.onXMLLoaded.bind(this),this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/xml"),this.ajaxRequest.send(null)},b.BitmapFontLoader.prototype.onXMLLoaded=function(){if(4===this.ajaxRequest.readyState&&(200===this.ajaxRequest.status||-1===window.location.protocol.indexOf("http"))){var a=this.ajaxRequest.responseXML;if(!a||/MSIE 9/i.test(navigator.userAgent)||navigator.isCocoonJS)if("function"==typeof window.DOMParser){var c=new DOMParser;a=c.parseFromString(this.ajaxRequest.responseText,"text/xml")}else{var d=document.createElement("div");d.innerHTML=this.ajaxRequest.responseText,a=d}var e=this.baseUrl+a.getElementsByTagName("page")[0].getAttribute("file"),f=new b.ImageLoader(e,this.crossorigin);this.texture=f.texture.baseTexture;var g={},h=a.getElementsByTagName("info")[0],i=a.getElementsByTagName("common")[0];g.font=h.getAttribute("face"),g.size=parseInt(h.getAttribute("size"),10),g.lineHeight=parseInt(i.getAttribute("lineHeight"),10),g.chars={};for(var j=a.getElementsByTagName("char"),k=0;ka;a++)this.shaders[a].dirty=!0},b.AlphaMaskFilter=function(a){b.AbstractFilter.call(this),this.passes=[this],a.baseTexture._powerOf2=!0,this.uniforms={mask:{type:"sampler2D",value:a},mapDimensions:{type:"2f",value:{x:1,y:5112}},dimensions:{type:"4fv",value:[0,0,0,0]}},a.baseTexture.hasLoaded?(this.uniforms.mask.value.x=a.width,this.uniforms.mask.value.y=a.height):(this.boundLoadedFunction=this.onTextureLoaded.bind(this),a.baseTexture.on("loaded",this.boundLoadedFunction)),this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D mask;","uniform sampler2D uSampler;","uniform vec2 offset;","uniform vec4 dimensions;","uniform vec2 mapDimensions;","void main(void) {"," vec2 mapCords = vTextureCoord.xy;"," mapCords += (dimensions.zw + offset)/ dimensions.xy ;"," mapCords.y *= -1.0;"," mapCords.y += 1.0;"," mapCords *= dimensions.xy / mapDimensions;"," vec4 original = texture2D(uSampler, vTextureCoord);"," float maskAlpha = texture2D(mask, mapCords).r;"," original *= maskAlpha;"," gl_FragColor = original;","}"]},b.AlphaMaskFilter.prototype=Object.create(b.AbstractFilter.prototype),b.AlphaMaskFilter.prototype.constructor=b.AlphaMaskFilter,b.AlphaMaskFilter.prototype.onTextureLoaded=function(){this.uniforms.mapDimensions.value.x=this.uniforms.mask.value.width,this.uniforms.mapDimensions.value.y=this.uniforms.mask.value.height,this.uniforms.mask.value.baseTexture.off("loaded",this.boundLoadedFunction)},Object.defineProperty(b.AlphaMaskFilter.prototype,"map",{get:function(){return this.uniforms.mask.value},set:function(a){this.uniforms.mask.value=a}}),b.ColorMatrixFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={matrix:{type:"mat4",value:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float invert;","uniform mat4 matrix;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * matrix;","}"]},b.ColorMatrixFilter.prototype=Object.create(b.AbstractFilter.prototype),b.ColorMatrixFilter.prototype.constructor=b.ColorMatrixFilter,Object.defineProperty(b.ColorMatrixFilter.prototype,"matrix",{get:function(){return this.uniforms.matrix.value},set:function(a){this.uniforms.matrix.value=a}}),b.GrayFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={gray:{type:"1f",value:1}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","uniform float gray;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord);"," gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(0.2126*gl_FragColor.r + 0.7152*gl_FragColor.g + 0.0722*gl_FragColor.b), gray);","}"]},b.GrayFilter.prototype=Object.create(b.AbstractFilter.prototype),b.GrayFilter.prototype.constructor=b.GrayFilter,Object.defineProperty(b.GrayFilter.prototype,"gray",{get:function(){return this.uniforms.gray.value},set:function(a){this.uniforms.gray.value=a}}),b.DisplacementFilter=function(a){b.AbstractFilter.call(this),this.passes=[this],a.baseTexture._powerOf2=!0,this.uniforms={displacementMap:{type:"sampler2D",value:a},scale:{type:"2f",value:{x:30,y:30}},offset:{type:"2f",value:{x:0,y:0}},mapDimensions:{type:"2f",value:{x:1,y:5112}},dimensions:{type:"4fv",value:[0,0,0,0]}},a.baseTexture.hasLoaded?(this.uniforms.mapDimensions.value.x=a.width,this.uniforms.mapDimensions.value.y=a.height):(this.boundLoadedFunction=this.onTextureLoaded.bind(this),a.baseTexture.on("loaded",this.boundLoadedFunction)),this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D displacementMap;","uniform sampler2D uSampler;","uniform vec2 scale;","uniform vec2 offset;","uniform vec4 dimensions;","uniform vec2 mapDimensions;","void main(void) {"," vec2 mapCords = vTextureCoord.xy;"," mapCords += (dimensions.zw + offset)/ dimensions.xy ;"," mapCords.y *= -1.0;"," mapCords.y += 1.0;"," vec2 matSample = texture2D(displacementMap, mapCords).xy;"," matSample -= 0.5;"," matSample *= scale;"," matSample /= mapDimensions;"," gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + matSample.x, vTextureCoord.y + matSample.y));"," gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb, 1.0);"," vec2 cord = vTextureCoord;","}"]},b.DisplacementFilter.prototype=Object.create(b.AbstractFilter.prototype),b.DisplacementFilter.prototype.constructor=b.DisplacementFilter,b.DisplacementFilter.prototype.onTextureLoaded=function(){this.uniforms.mapDimensions.value.x=this.uniforms.displacementMap.value.width,this.uniforms.mapDimensions.value.y=this.uniforms.displacementMap.value.height,this.uniforms.displacementMap.value.baseTexture.off("loaded",this.boundLoadedFunction)},Object.defineProperty(b.DisplacementFilter.prototype,"map",{get:function(){return this.uniforms.displacementMap.value},set:function(a){this.uniforms.displacementMap.value=a}}),Object.defineProperty(b.DisplacementFilter.prototype,"scale",{get:function(){return this.uniforms.scale.value},set:function(a){this.uniforms.scale.value=a}}),Object.defineProperty(b.DisplacementFilter.prototype,"offset",{get:function(){return this.uniforms.offset.value},set:function(a){this.uniforms.offset.value=a}}),b.PixelateFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={invert:{type:"1f",value:0},dimensions:{type:"4fv",value:new b.Float32Array([1e4,100,10,10])},pixelSize:{type:"2f",value:{x:10,y:10}}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform vec2 testDim;","uniform vec4 dimensions;","uniform vec2 pixelSize;","uniform sampler2D uSampler;","void main(void) {"," vec2 coord = vTextureCoord;"," vec2 size = dimensions.xy/pixelSize;"," vec2 color = floor( ( vTextureCoord * size ) ) / size + pixelSize/dimensions.xy * 0.5;"," gl_FragColor = texture2D(uSampler, color);","}"]},b.PixelateFilter.prototype=Object.create(b.AbstractFilter.prototype),b.PixelateFilter.prototype.constructor=b.PixelateFilter,Object.defineProperty(b.PixelateFilter.prototype,"size",{get:function(){return this.uniforms.pixelSize.value},set:function(a){this.dirty=!0,this.uniforms.pixelSize.value=a}}),b.BlurXFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={blur:{type:"1f",value:1/512}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float blur;","uniform sampler2D uSampler;","void main(void) {"," vec4 sum = vec4(0.0);"," sum += texture2D(uSampler, vec2(vTextureCoord.x - 4.0*blur, vTextureCoord.y)) * 0.05;"," sum += texture2D(uSampler, vec2(vTextureCoord.x - 3.0*blur, vTextureCoord.y)) * 0.09;"," sum += texture2D(uSampler, vec2(vTextureCoord.x - 2.0*blur, vTextureCoord.y)) * 0.12;"," sum += texture2D(uSampler, vec2(vTextureCoord.x - blur, vTextureCoord.y)) * 0.15;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;"," sum += texture2D(uSampler, vec2(vTextureCoord.x + blur, vTextureCoord.y)) * 0.15;"," sum += texture2D(uSampler, vec2(vTextureCoord.x + 2.0*blur, vTextureCoord.y)) * 0.12;"," sum += texture2D(uSampler, vec2(vTextureCoord.x + 3.0*blur, vTextureCoord.y)) * 0.09;"," sum += texture2D(uSampler, vec2(vTextureCoord.x + 4.0*blur, vTextureCoord.y)) * 0.05;"," gl_FragColor = sum;","}"]},b.BlurXFilter.prototype=Object.create(b.AbstractFilter.prototype),b.BlurXFilter.prototype.constructor=b.BlurXFilter,Object.defineProperty(b.BlurXFilter.prototype,"blur",{get:function(){return this.uniforms.blur.value/(1/7e3)},set:function(a){this.dirty=!0,this.uniforms.blur.value=1/7e3*a}}),b.BlurYFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={blur:{type:"1f",value:1/512}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float blur;","uniform sampler2D uSampler;","void main(void) {"," vec4 sum = vec4(0.0);"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 4.0*blur)) * 0.05;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 3.0*blur)) * 0.09;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 2.0*blur)) * 0.12;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - blur)) * 0.15;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + blur)) * 0.15;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 2.0*blur)) * 0.12;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 3.0*blur)) * 0.09;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 4.0*blur)) * 0.05;"," gl_FragColor = sum;","}"]},b.BlurYFilter.prototype=Object.create(b.AbstractFilter.prototype),b.BlurYFilter.prototype.constructor=b.BlurYFilter,Object.defineProperty(b.BlurYFilter.prototype,"blur",{get:function(){return this.uniforms.blur.value/(1/7e3)},set:function(a){this.uniforms.blur.value=1/7e3*a}}),b.BlurFilter=function(){this.blurXFilter=new b.BlurXFilter,this.blurYFilter=new b.BlurYFilter,this.passes=[this.blurXFilter,this.blurYFilter]},b.BlurFilter.prototype=Object.create(b.AbstractFilter.prototype),b.BlurFilter.prototype.constructor=b.BlurFilter,Object.defineProperty(b.BlurFilter.prototype,"blur",{get:function(){return this.blurXFilter.blur},set:function(a){this.blurXFilter.blur=this.blurYFilter.blur=a}}),Object.defineProperty(b.BlurFilter.prototype,"blurX",{get:function(){return this.blurXFilter.blur},set:function(a){this.blurXFilter.blur=a}}),Object.defineProperty(b.BlurFilter.prototype,"blurY",{get:function(){return this.blurYFilter.blur},set:function(a){this.blurYFilter.blur=a}}),b.InvertFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={invert:{type:"1f",value:1}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float invert;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord);"," gl_FragColor.rgb = mix( (vec3(1)-gl_FragColor.rgb) * gl_FragColor.a, gl_FragColor.rgb, 1.0 - invert);","}"]},b.InvertFilter.prototype=Object.create(b.AbstractFilter.prototype),b.InvertFilter.prototype.constructor=b.InvertFilter,Object.defineProperty(b.InvertFilter.prototype,"invert",{get:function(){return this.uniforms.invert.value},set:function(a){this.uniforms.invert.value=a}}),b.SepiaFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={sepia:{type:"1f",value:1}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float sepia;","uniform sampler2D uSampler;","const mat3 sepiaMatrix = mat3(0.3588, 0.7044, 0.1368, 0.2990, 0.5870, 0.1140, 0.2392, 0.4696, 0.0912);","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord);"," gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb * sepiaMatrix, sepia);","}"]},b.SepiaFilter.prototype=Object.create(b.AbstractFilter.prototype),b.SepiaFilter.prototype.constructor=b.SepiaFilter,Object.defineProperty(b.SepiaFilter.prototype,"sepia",{get:function(){return this.uniforms.sepia.value},set:function(a){this.uniforms.sepia.value=a}}),b.TwistFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={radius:{type:"1f",value:.5},angle:{type:"1f",value:5},offset:{type:"2f",value:{x:.5,y:.5}}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform vec4 dimensions;","uniform sampler2D uSampler;","uniform float radius;","uniform float angle;","uniform vec2 offset;","void main(void) {"," vec2 coord = vTextureCoord - offset;"," float distance = length(coord);"," if (distance < radius) {"," float ratio = (radius - distance) / radius;"," float angleMod = ratio * ratio * angle;"," float s = sin(angleMod);"," float c = cos(angleMod);"," coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);"," }"," gl_FragColor = texture2D(uSampler, coord+offset);","}"]},b.TwistFilter.prototype=Object.create(b.AbstractFilter.prototype),b.TwistFilter.prototype.constructor=b.TwistFilter,Object.defineProperty(b.TwistFilter.prototype,"offset",{get:function(){return this.uniforms.offset.value},set:function(a){this.dirty=!0,this.uniforms.offset.value=a}}),Object.defineProperty(b.TwistFilter.prototype,"radius",{get:function(){return this.uniforms.radius.value},set:function(a){this.dirty=!0,this.uniforms.radius.value=a}}),Object.defineProperty(b.TwistFilter.prototype,"angle",{get:function(){return this.uniforms.angle.value},set:function(a){this.dirty=!0,this.uniforms.angle.value=a}}),b.ColorStepFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={step:{type:"1f",value:5}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","uniform float step;","void main(void) {"," vec4 color = texture2D(uSampler, vTextureCoord);"," color = floor(color * step) / step;"," gl_FragColor = color;","}"]},b.ColorStepFilter.prototype=Object.create(b.AbstractFilter.prototype),b.ColorStepFilter.prototype.constructor=b.ColorStepFilter,Object.defineProperty(b.ColorStepFilter.prototype,"step",{get:function(){return this.uniforms.step.value},set:function(a){this.uniforms.step.value=a}}),b.DotScreenFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={scale:{type:"1f",value:1},angle:{type:"1f",value:5},dimensions:{type:"4fv",value:[0,0,0,0]}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform vec4 dimensions;","uniform sampler2D uSampler;","uniform float angle;","uniform float scale;","float pattern() {"," float s = sin(angle), c = cos(angle);"," vec2 tex = vTextureCoord * dimensions.xy;"," vec2 point = vec2("," c * tex.x - s * tex.y,"," s * tex.x + c * tex.y"," ) * scale;"," return (sin(point.x) * sin(point.y)) * 4.0;","}","void main() {"," vec4 color = texture2D(uSampler, vTextureCoord);"," float average = (color.r + color.g + color.b) / 3.0;"," gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);","}"]},b.DotScreenFilter.prototype=Object.create(b.AbstractFilter.prototype),b.DotScreenFilter.prototype.constructor=b.DotScreenFilter,Object.defineProperty(b.DotScreenFilter.prototype,"scale",{get:function(){return this.uniforms.scale.value},set:function(a){this.dirty=!0,this.uniforms.scale.value=a}}),Object.defineProperty(b.DotScreenFilter.prototype,"angle",{get:function(){return this.uniforms.angle.value},set:function(a){this.dirty=!0,this.uniforms.angle.value=a}}),b.CrossHatchFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={blur:{type:"1f",value:1/512}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float blur;","uniform sampler2D uSampler;","void main(void) {"," float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);"," gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);"," if (lum < 1.00) {"," if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {"," gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);"," }"," }"," if (lum < 0.75) {"," if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {"," gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);"," }"," }"," if (lum < 0.50) {"," if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {"," gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);"," }"," }"," if (lum < 0.3) {"," if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {"," gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);"," }"," }","}"]},b.CrossHatchFilter.prototype=Object.create(b.AbstractFilter.prototype),b.CrossHatchFilter.prototype.constructor=b.CrossHatchFilter,Object.defineProperty(b.CrossHatchFilter.prototype,"blur",{get:function(){return this.uniforms.blur.value/(1/7e3)},set:function(a){this.uniforms.blur.value=1/7e3*a}}),b.RGBSplitFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={red:{type:"2f",value:{x:20,y:20}},green:{type:"2f",value:{x:-20,y:20}},blue:{type:"2f",value:{x:20,y:-20}},dimensions:{type:"4fv",value:[0,0,0,0]}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform vec2 red;","uniform vec2 green;","uniform vec2 blue;","uniform vec4 dimensions;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/dimensions.xy).r;"," gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/dimensions.xy).g;"," gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/dimensions.xy).b;"," gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;","}"]},b.RGBSplitFilter.prototype=Object.create(b.AbstractFilter.prototype),b.RGBSplitFilter.prototype.constructor=b.RGBSplitFilter,Object.defineProperty(b.RGBSplitFilter.prototype,"red",{get:function(){return this.uniforms.red.value},set:function(a){this.uniforms.red.value=a}}),Object.defineProperty(b.RGBSplitFilter.prototype,"green",{get:function(){return this.uniforms.green.value},set:function(a){this.uniforms.green.value=a}}),Object.defineProperty(b.RGBSplitFilter.prototype,"blue",{get:function(){return this.uniforms.blue.value},set:function(a){this.uniforms.blue.value=a}}),"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=b),exports.PIXI=b):"undefined"!=typeof define&&define.amd?define(b):a.PIXI=b}).call(this); \ No newline at end of file diff --git a/tutorial-3/pixi.js-master/bower.json b/tutorial-3/pixi.js-master/bower.json deleted file mode 100755 index 7d5d86b..0000000 --- a/tutorial-3/pixi.js-master/bower.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "pixi.js", - "version": "2.2.7", - - "main": "bin/pixi.dev.js", - - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test" - ], - "dependencies": { - }, - "devDependencies": { - } -} diff --git a/tutorial-3/pixi.js-master/docs/api.js b/tutorial-3/pixi.js-master/docs/api.js deleted file mode 100755 index c298d63..0000000 --- a/tutorial-3/pixi.js-master/docs/api.js +++ /dev/null @@ -1,100 +0,0 @@ -YUI.add("yuidoc-meta", function(Y) { - Y.YUIDoc = { meta: { - "classes": [ - "AbstractFilter", - "AjaxRequest", - "AlphaMaskFilter", - "AsciiFilter", - "AssetLoader", - "AtlasLoader", - "BaseTexture", - "BitmapFontLoader", - "BitmapText", - "BlurFilter", - "BlurXFilter", - "BlurYFilter", - "CanvasBuffer", - "CanvasGraphics", - "CanvasMaskManager", - "CanvasRenderer", - "CanvasTinter", - "Circle", - "ColorMatrixFilter", - "ColorStepFilter", - "ComplexPrimitiveShader", - "ConvolutionFilter", - "CrossHatchFilter", - "DisplacementFilter", - "DisplayObject", - "DisplayObjectContainer", - "DotScreenFilter", - "Ellipse", - "Event", - "EventTarget", - "FilterBlock", - "FilterTexture", - "Graphics", - "GraphicsData", - "GrayFilter", - "ImageLoader", - "InteractionData", - "InteractionManager", - "InvertFilter", - "JsonLoader", - "Matrix", - "MovieClip", - "NoiseFilter", - "NormalMapFilter", - "PixelateFilter", - "PixiFastShader", - "PixiShader", - "Point", - "PolyK", - "Polygon", - "PrimitiveShader", - "RGBSplitFilter", - "Rectangle", - "RenderTexture", - "Rope", - "Rounded Rectangle", - "SepiaFilter", - "SmartBlurFilter", - "Spine", - "SpineLoader", - "Sprite", - "SpriteBatch", - "SpriteSheetLoader", - "Stage", - "Strip", - "StripShader", - "Text", - "Texture", - "TilingSprite", - "TiltShiftFilter", - "TiltShiftXFilter", - "TiltShiftYFilter", - "TwistFilter", - "WebGLBlendModeManager", - "WebGLFastSpriteBatch", - "WebGLFilterManager", - "WebGLGraphics", - "WebGLGraphicsData", - "WebGLMaskManager", - "WebGLRenderer", - "WebGLShaderManager", - "WebGLSpriteBatch", - "WebGLStencilManager", - "autoDetectRecommendedRenderer", - "autoDetectRenderer" - ], - "modules": [ - "PIXI" - ], - "allModules": [ - { - "displayName": "PIXI", - "name": "PIXI" - } - ] -} }; -}); \ No newline at end of file diff --git a/tutorial-3/pixi.js-master/docs/assets/css/external-small.png b/tutorial-3/pixi.js-master/docs/assets/css/external-small.png deleted file mode 100755 index 759a1cd..0000000 Binary files a/tutorial-3/pixi.js-master/docs/assets/css/external-small.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/docs/assets/css/logo.png b/tutorial-3/pixi.js-master/docs/assets/css/logo.png deleted file mode 100755 index 609b336..0000000 Binary files a/tutorial-3/pixi.js-master/docs/assets/css/logo.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/docs/assets/css/main.css b/tutorial-3/pixi.js-master/docs/assets/css/main.css deleted file mode 100755 index d745d44..0000000 --- a/tutorial-3/pixi.js-master/docs/assets/css/main.css +++ /dev/null @@ -1,783 +0,0 @@ -/* -Font sizes for all selectors other than the body are given in percentages, -with 100% equal to 13px. To calculate a font size percentage, multiply the -desired size in pixels by 7.6923076923. - -Here's a quick lookup table: - -10px - 76.923% -11px - 84.615% -12px - 92.308% -13px - 100% -14px - 107.692% -15px - 115.385% -16px - 123.077% -17px - 130.769% -18px - 138.462% -19px - 146.154% -20px - 153.846% -*/ - -html { - background: #fff; - color: #333; - overflow-y: scroll; -} - -body { - /*font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif;*/ - font: 13px/1.4 'Helvetica', 'Arial', sans-serif; - margin: 0; - padding: 0; -} - -/* -- Links ----------------------------------------------------------------- */ -a { - color: #356de4; - text-decoration: none; -} - -.hidden { - display: none; -} - -a:hover { text-decoration: underline; } - -/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from - sight until it's focused. */ -.jump { - position: absolute; - padding: 3px 6px; - left: -99999px; - top: 0; -} - -.jump:focus { left: 40%; } - -/* -- Paragraphs ------------------------------------------------------------ */ -p { margin: 1.3em 0; } -dd p, td p { margin-bottom: 0; } -dd p:first-child, td p:first-child { margin-top: 0; } - -/* -- Headings -------------------------------------------------------------- */ -h1, h2, h3, h4, h5, h6 { - color: #D98527;/*was #f80*/ - font-family: 'Trebuchet MS', sans-serif; - font-weight: bold; - line-height: 1.1; - margin: 1.1em 0 0.5em; -} - -h1 { - font-size: 184.6%; - color: #30418C; - margin: 0.75em 0 0.5em; -} - -h2 { - font-size: 153.846%; - color: #E48A2B; -} - -h3 { font-size: 138.462%; } - -h4 { - border-bottom: 1px solid #DBDFEA; - color: #E48A2B; - font-size: 115.385%; - font-weight: normal; - padding-bottom: 2px; -} - -h5, h6 { font-size: 107.692%; } - -/* -- Code and examples ----------------------------------------------------- */ -code, kbd, pre, samp { - font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; - font-size: 92.308%; - line-height: 1.35; -} - -p code, p kbd, p samp { - background: #FCFBFA; - border: 1px solid #EFEEED; - padding: 0 3px; -} - -a code, a kbd, a samp, -pre code, pre kbd, pre samp, -table code, table kbd, table samp, -.intro code, .intro kbd, .intro samp, -.toc code, .toc kbd, .toc samp { - background: none; - border: none; - padding: 0; -} - -pre.code, pre.terminal, pre.cmd { - overflow-x: auto; - *overflow-x: scroll; - padding: 0.3em 0.6em; -} - -pre.code { - background: #FCFBFA; - border: 1px solid #EFEEED; - border-left-width: 5px; -} - -pre.terminal, pre.cmd { - background: #F0EFFC; - border: 1px solid #D0CBFB; - border-left: 5px solid #D0CBFB; -} - -/* Don't reduce the font size of // elements inside
    -   blocks. */
    -pre code, pre kbd, pre samp { font-size: 100%; }
    -
    -/* Used to denote text that shouldn't be selectable, such as line numbers or
    -   shell prompts. Guess which browser this doesn't work in. */
    -.noselect {
    -    -moz-user-select: -moz-none;
    -    -khtml-user-select: none;
    -    -webkit-user-select: none;
    -    -o-user-select: none;
    -    user-select: none;
    -}
    -
    -/* -- Lists ----------------------------------------------------------------- */
    -dd { margin: 0.2em 0 0.7em 1em; }
    -dl { margin: 1em 0; }
    -dt { font-weight: bold; }
    -
    -/* -- Tables ---------------------------------------------------------------- */
    -caption, th { text-align: left; }
    -
    -table {
    -    border-collapse: collapse;
    -    width: 100%;
    -}
    -
    -td, th {
    -    border: 1px solid #fff;
    -    padding: 5px 12px;
    -    vertical-align: top;
    -}
    -
    -td { background: #E6E9F5; }
    -td dl { margin: 0; }
    -td dl dl { margin: 1em 0; }
    -td pre:first-child { margin-top: 0; }
    -
    -th {
    -    background: #D2D7E6;/*#97A0BF*/
    -    border-bottom: none;
    -    border-top: none;
    -    color: #000;/*#FFF1D5*/
    -    font-family: 'Trebuchet MS', sans-serif;
    -    font-weight: bold;
    -    line-height: 1.3;
    -    white-space: nowrap;
    -}
    -
    -
    -/* -- Layout and Content ---------------------------------------------------- */
    -#doc {
    -    margin: auto;
    -    min-width: 1024px;
    -}
    -
    -.content { padding: 0 20px 0 25px; }
    -
    -.sidebar {
    -    padding: 0 15px 0 10px;
    -}
    -#bd {
    -    padding: 7px 0 130px;
    -    position: relative;
    -    width: 99%;
    -}
    -
    -/* -- Table of Contents ----------------------------------------------------- */
    -
    -/* The #toc id refers to the single global table of contents, while the .toc
    -   class refers to generic TOC lists that could be used throughout the page. */
    -
    -.toc code, .toc kbd, .toc samp { font-size: 100%; }
    -.toc li { font-weight: bold; }
    -.toc li li { font-weight: normal; }
    -
    -/* -- Intro and Example Boxes ----------------------------------------------- */
    -/*
    -.intro, .example { margin-bottom: 2em; }
    -.example {
    -    -moz-border-radius: 4px;
    -    -webkit-border-radius: 4px;
    -    border-radius: 4px;
    -    -moz-box-shadow: 0 0 5px #bfbfbf;
    -    -webkit-box-shadow: 0 0 5px #bfbfbf;
    -    box-shadow: 0 0 5px #bfbfbf;
    -    padding: 1em;
    -}
    -.intro {
    -    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    -}
    -*/
    -
    -/* -- Other Styles ---------------------------------------------------------- */
    -
    -/* These are probably YUI-specific, and should be moved out of Selleck's default
    -   theme. */
    -
    -.button {
    -    border: 1px solid #dadada;
    -    -moz-border-radius: 3px;
    -    -webkit-border-radius: 3px;
    -    border-radius: 3px;
    -    color: #444;
    -    display: inline-block;
    -    font-family: Helvetica, Arial, sans-serif;
    -    font-size: 92.308%;
    -    font-weight: bold;
    -    padding: 4px 13px 3px;
    -    -moz-text-shadow: 1px 1px 0 #fff;
    -    -webkit-text-shadow: 1px 1px 0 #fff;
    -    text-shadow: 1px 1px 0 #fff;
    -    white-space: nowrap;
    -
    -    background: #EFEFEF; /* old browsers */
    -    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    -    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    -    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    -}
    -
    -.button:hover {
    -    border-color: #466899;
    -    color: #fff;
    -    text-decoration: none;
    -    -moz-text-shadow: 1px 1px 0 #222;
    -    -webkit-text-shadow: 1px 1px 0 #222;
    -    text-shadow: 1px 1px 0 #222;
    -
    -    background: #6396D8; /* old browsers */
    -    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    -    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    -    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    -}
    -
    -.newwindow { text-align: center; }
    -
    -.header .version em {
    -    display: block;
    -    text-align: right;
    -}
    -
    -
    -#classdocs .item {
    -    border-bottom: 1px solid #466899;
    -    margin: 1em 0;
    -    padding: 1.5em;
    -}
    -
    -#classdocs .item .params p,
    -    #classdocs .item .returns p,{
    -    display: inline;
    -}
    -
    -#classdocs .item em code, #classdocs .item em.comment {
    -    color: green;
    -}
    -
    -#classdocs .item em.comment a {
    -    color: green;
    -    text-decoration: underline;
    -}
    -
    -#classdocs .foundat {
    -    font-size: 11px;
    -    font-style: normal;
    -}
    -
    -.attrs .emits {
    -    margin-left: 2em;
    -    padding: .5em;
    -    border-left: 1px dashed #ccc;
    -}
    -
    -abbr {
    -    border-bottom: 1px dashed #ccc;
    -    font-size: 80%;
    -    cursor: help;
    -}
    -
    -.prettyprint li.L0, 
    -.prettyprint li.L1, 
    -.prettyprint li.L2, 
    -.prettyprint li.L3, 
    -.prettyprint li.L5, 
    -.prettyprint li.L6, 
    -.prettyprint li.L7, 
    -.prettyprint li.L8 {
    -    list-style: decimal;
    -}
    -
    -ul li p {
    -    margin-top: 0;
    -}
    -
    -.method .name {
    -    font-size: 110%;
    -}
    -
    -.apidocs .methods .extends .method,
    -.apidocs .properties .extends .property,
    -.apidocs .attrs .extends .attr,
    -.apidocs .events .extends .event {
    -    font-weight: bold;
    -}
    -
    -.apidocs .methods .extends .inherited,
    -.apidocs .properties .extends .inherited,
    -.apidocs .attrs .extends .inherited,
    -.apidocs .events .extends .inherited {
    -    font-weight: normal;
    -}
    -
    -#hd {
    -    background: whiteSmoke;
    -    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    -    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    -    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    -    border-bottom: 1px solid #DFDFDF;
    -    padding: 0 15px 1px 20px;
    -    margin-bottom: 15px;
    -}
    -
    -#hd img {
    -    margin-right: 10px;
    -    vertical-align: middle;
    -}
    -
    -
    -/* -- API Docs CSS ---------------------------------------------------------- */
    -
    -/*
    -This file is organized so that more generic styles are nearer the top, and more
    -specific styles are nearer the bottom of the file. This allows us to take full
    -advantage of the cascade to avoid redundant style rules. Please respect this
    -convention when making changes.
    -*/
    -
    -/* -- Generic TabView styles ------------------------------------------------ */
    -
    -/*
    -These styles apply to all API doc tabviews. To change styles only for a
    -specific tabview, see the other sections below.
    -*/
    -
    -.yui3-js-enabled .apidocs .tabview {
    -    visibility: hidden; /* Hide until the TabView finishes rendering. */
    -    _visibility: visible;
    -}
    -
    -.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    -.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    -
    -/* -- Generic Content Styles ------------------------------------------------ */
    -
    -/* Headings */
    -h2, h3, h4, h5, h6 {
    -    border: none;
    -    color: #30418C;
    -    font-weight: bold;
    -    text-decoration: none;
    -}
    -
    -.link-docs {
    -    float: right;
    -    font-size: 15px;
    -    margin: 4px 4px 6px;
    -    padding: 6px 30px 5px;
    -}
    -
    -.apidocs { zoom: 1; }
    -
    -/* Generic box styles. */
    -.apidocs .box {
    -    border: 1px solid;
    -    border-radius: 3px;
    -    margin: 1em 0;
    -    padding: 0 1em;
    -}
    -
    -/* A flag is a compact, capsule-like indicator of some kind. It's used to
    -   indicate private and protected items, item return types, etc. in an
    -   attractive and unobtrusive way. */
    -.apidocs .flag {
    -    background: #bababa;
    -    border-radius: 3px;
    -    color: #fff;
    -    font-size: 11px;
    -    margin: 0 0.5em;
    -    padding: 2px 4px 1px;
    -}
    -
    -/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    -.apidocs .meta {
    -    background: #f9f9f9;
    -    border-color: #efefef;
    -    color: #555;
    -    font-size: 11px;
    -    padding: 3px 6px;
    -}
    -
    -.apidocs .meta p { margin: 0; }
    -
    -/* Deprecation warning. */
    -.apidocs .box.deprecated,
    -.apidocs .flag.deprecated {
    -    background: #fdac9f;
    -    border: 1px solid #fd7775;
    -}
    -
    -.apidocs .box.deprecated p { margin: 0.5em 0; }
    -.apidocs .flag.deprecated { color: #333; }
    -
    -/* Module/Class intro description. */
    -.apidocs .intro {
    -    background: #f0f1f8;
    -    border-color: #d4d8eb;
    -}
    -
    -/* Loading spinners. */
    -#bd.loading .apidocs,
    -#api-list.loading .yui3-tabview-panel {
    -    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    -    min-height: 150px;
    -}
    -
    -#bd.loading .apidocs .content,
    -#api-list.loading .yui3-tabview-panel .apis {
    -    display: none;
    -}
    -
    -.apidocs .no-visible-items { color: #666; }
    -
    -/* Generic inline list. */
    -.apidocs ul.inline {
    -    display: inline;
    -    list-style: none;
    -    margin: 0;
    -    padding: 0;
    -}
    -
    -.apidocs ul.inline li { display: inline; }
    -
    -/* Comma-separated list. */
    -.apidocs ul.commas li:after { content: ','; }
    -.apidocs ul.commas li:last-child:after { content: ''; }
    -
    -/* Keyboard shortcuts. */
    -kbd .cmd { font-family: Monaco, Helvetica; }
    -
    -/* -- Generic Access Level styles ------------------------------------------- */
    -.apidocs .item.protected,
    -.apidocs .item.private,
    -.apidocs .index-item.protected,
    -.apidocs .index-item.deprecated,
    -.apidocs .index-item.private {
    -    display: none;
    -}
    -
    -.show-deprecated .item.deprecated,
    -.show-deprecated .index-item.deprecated,
    -.show-protected .item.protected,
    -.show-protected .index-item.protected,
    -.show-private .item.private,
    -.show-private .index-item.private {
    -    display: block;
    -}
    -
    -.hide-inherited .item.inherited,
    -.hide-inherited .index-item.inherited {
    -    display: none;
    -}
    -
    -/* -- Generic Item Index styles --------------------------------------------- */
    -.apidocs .index { margin: 1.5em 0 3em; }
    -
    -.apidocs .index h3 {
    -    border-bottom: 1px solid #efefef;
    -    color: #333;
    -    font-size: 13px;
    -    margin: 2em 0 0.6em;
    -    padding-bottom: 2px;
    -}
    -
    -.apidocs .index .no-visible-items { margin-top: 2em; }
    -
    -.apidocs .index-list {
    -    border-color: #efefef;
    -    font-size: 12px;
    -    list-style: none;
    -    margin: 0;
    -    padding: 0;
    -    -moz-column-count: 4;
    -    -moz-column-gap: 10px;
    -    -moz-column-width: 170px;
    -    -ms-column-count: 4;
    -    -ms-column-gap: 10px;
    -    -ms-column-width: 170px;
    -    -o-column-count: 4;
    -    -o-column-gap: 10px;
    -    -o-column-width: 170px;
    -    -webkit-column-count: 4;
    -    -webkit-column-gap: 10px;
    -    -webkit-column-width: 170px;
    -    column-count: 4;
    -    column-gap: 10px;
    -    column-width: 170px;
    -}
    -
    -.apidocs .no-columns .index-list {
    -    -moz-column-count: 1;
    -    -ms-column-count: 1;
    -    -o-column-count: 1;
    -    -webkit-column-count: 1;
    -    column-count: 1;
    -}
    -
    -.apidocs .index-item { white-space: nowrap; }
    -
    -.apidocs .index-item .flag {
    -    background: none;
    -    border: none;
    -    color: #afafaf;
    -    display: inline;
    -    margin: 0 0 0 0.2em;
    -    padding: 0;
    -}
    -
    -/* -- Generic API item styles ----------------------------------------------- */
    -.apidocs .args {
    -    display: inline;
    -    margin: 0 0.5em;
    -}
    -
    -.apidocs .flag.chainable { background: #46ca3b; }
    -.apidocs .flag.protected { background: #9b86fc; }
    -.apidocs .flag.private { background: #fd6b1b; }
    -.apidocs .flag.async { background: #356de4; }
    -.apidocs .flag.required { background: #e60923; }
    -
    -.apidocs .item {
    -    border-bottom: 1px solid #efefef;
    -    margin: 1.5em 0 2em;
    -    padding-bottom: 2em;
    -}
    -
    -.apidocs .item h4,
    -.apidocs .item h5,
    -.apidocs .item h6 {
    -    color: #333;
    -    font-family: inherit;
    -    font-size: 100%;
    -}
    -
    -.apidocs .item .description p,
    -.apidocs .item pre.code {
    -    margin: 1em 0 0;
    -}
    -
    -.apidocs .item .meta {
    -    background: none;
    -    border: none;
    -    padding: 0;
    -}
    -
    -.apidocs .item .name {
    -    display: inline;
    -    font-size: 14px;
    -}
    -
    -.apidocs .item .type,
    -.apidocs .item .type a,
    -.apidocs .returns-inline {
    -    color: #555;
    -}
    -
    -.apidocs .item .type,
    -.apidocs .returns-inline {
    -    font-size: 11px;
    -    margin: 0 0 0 0;
    -}
    -
    -.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    -.apidocs .item .type a:hover { border: none; }
    -
    -/* -- Item Parameter List --------------------------------------------------- */
    -.apidocs .params-list {
    -    list-style: square;
    -    margin: 1em 0 0 2em;
    -    padding: 0;
    -}
    -
    -.apidocs .param { margin-bottom: 1em; }
    -
    -.apidocs .param .type,
    -.apidocs .param .type a {
    -    color: #666;
    -}
    -
    -.apidocs .param .type {
    -    margin: 0 0 0 0.5em;
    -    *margin-left: 0.5em;
    -}
    -
    -.apidocs .param-name { font-weight: bold; }
    -
    -/* -- Item "Emits" block ---------------------------------------------------- */
    -.apidocs .item .emits {
    -    background: #f9f9f9;
    -    border-color: #eaeaea;
    -}
    -
    -/* -- Item "Returns" block -------------------------------------------------- */
    -.apidocs .item .returns .type,
    -.apidocs .item .returns .type a {
    -    font-size: 100%;
    -    margin: 0;
    -}
    -
    -/* -- Class Constructor block ----------------------------------------------- */
    -.apidocs .constructor .item {
    -    border: none;
    -    padding-bottom: 0;
    -}
    -
    -/* -- File Source View ------------------------------------------------------ */
    -.apidocs .file pre.code,
    -#doc .apidocs .file pre.prettyprint {
    -    background: inherit;
    -    border: none;
    -    overflow: visible;
    -    padding: 0;
    -}
    -
    -.apidocs .L0,
    -.apidocs .L1,
    -.apidocs .L2,
    -.apidocs .L3,
    -.apidocs .L4,
    -.apidocs .L5,
    -.apidocs .L6,
    -.apidocs .L7,
    -.apidocs .L8,
    -.apidocs .L9 {
    -    background: inherit;
    -}
    -
    -/* -- Submodule List -------------------------------------------------------- */
    -.apidocs .module-submodule-description {
    -    font-size: 12px;
    -    margin: 0.3em 0 1em;
    -}
    -
    -.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    -
    -/* -- Sidebar TabView ------------------------------------------------------- */
    -#api-tabview { margin-top: 0.6em; }
    -
    -#api-tabview-filter,
    -#api-tabview-panel {
    -    border: 1px solid #dfdfdf;
    -}
    -
    -#api-tabview-filter {
    -    border-bottom: none;
    -    border-top: none;
    -    padding: 0.6em 10px 0 10px;
    -}
    -
    -#api-tabview-panel { border-top: none; }
    -#api-filter { width: 97%; }
    -
    -/* -- Content TabView ------------------------------------------------------- */
    -#classdocs .yui3-tabview-panel { border: none; }
    -
    -/* -- Source File Contents -------------------------------------------------- */
    -.prettyprint li.L0,
    -.prettyprint li.L1,
    -.prettyprint li.L2,
    -.prettyprint li.L3,
    -.prettyprint li.L5,
    -.prettyprint li.L6,
    -.prettyprint li.L7,
    -.prettyprint li.L8 {
    -    list-style: decimal;
    -}
    -
    -/* -- API options ----------------------------------------------------------- */
    -#api-options {
    -    font-size: 11px;
    -    margin-top: 2.2em;
    -    position: absolute;
    -    right: 1.5em;
    -}
    -
    -/*#api-options label { margin-right: 0.6em; }*/
    -
    -/* -- API list -------------------------------------------------------------- */
    -#api-list {
    -    margin-top: 1.5em;
    -    *zoom: 1;
    -}
    -
    -.apis {
    -    font-size: 12px;
    -    line-height: 1.4;
    -    list-style: none;
    -    margin: 0;
    -    padding: 0.5em 0 0.5em 0.4em;
    -}
    -
    -.apis a {
    -    border: 1px solid transparent;
    -    display: block;
    -    margin: 0 0 0 -4px;
    -    padding: 1px 4px 0;
    -    text-decoration: none;
    -    _border: none;
    -    _display: inline;
    -}
    -
    -.apis a:hover,
    -.apis a:focus {
    -    background: #E8EDFC;
    -    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    -    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    -    border-color: #AAC0FA;
    -    border-radius: 3px;
    -    color: #333;
    -    outline: none;
    -}
    -
    -.api-list-item a:hover,
    -.api-list-item a:focus {
    -    font-weight: bold;
    -    text-shadow: 1px 1px 1px #fff;
    -}
    -
    -.apis .message { color: #888; }
    -.apis .result a { padding: 3px 5px 2px; }
    -
    -.apis .result .type {
    -    right: 4px;
    -    top: 7px;
    -}
    -
    -.api-list-item .yui3-highlight {
    -    font-weight: bold;
    -}
    -
    diff --git a/tutorial-3/pixi.js-master/docs/assets/favicon.png b/tutorial-3/pixi.js-master/docs/assets/favicon.png
    deleted file mode 100755
    index 5a95dda..0000000
    Binary files a/tutorial-3/pixi.js-master/docs/assets/favicon.png and /dev/null differ
    diff --git a/tutorial-3/pixi.js-master/docs/assets/img/spinner.gif b/tutorial-3/pixi.js-master/docs/assets/img/spinner.gif
    deleted file mode 100755
    index 44f96ba..0000000
    Binary files a/tutorial-3/pixi.js-master/docs/assets/img/spinner.gif and /dev/null differ
    diff --git a/tutorial-3/pixi.js-master/docs/assets/index.html b/tutorial-3/pixi.js-master/docs/assets/index.html
    deleted file mode 100755
    index 487fe15..0000000
    --- a/tutorial-3/pixi.js-master/docs/assets/index.html
    +++ /dev/null
    @@ -1,10 +0,0 @@
    -
    -
    -    
    -        Redirector
    -        
    -    
    -    
    -        Click here to redirect
    -    
    -
    diff --git a/tutorial-3/pixi.js-master/docs/assets/js/api-filter.js b/tutorial-3/pixi.js-master/docs/assets/js/api-filter.js
    deleted file mode 100755
    index 37aefba..0000000
    --- a/tutorial-3/pixi.js-master/docs/assets/js/api-filter.js
    +++ /dev/null
    @@ -1,52 +0,0 @@
    -YUI.add('api-filter', function (Y) {
    -
    -Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    -    // -- Initializer ----------------------------------------------------------
    -    initializer: function () {
    -        this._bindUIACBase();
    -        this._syncUIACBase();
    -    },
    -    getDisplayName: function(name) {
    -
    -        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    -            if (i.name === name && i.displayName) {
    -                name = i.displayName;
    -            }
    -        });
    -
    -        return name;
    -    }
    -
    -}, {
    -    // -- Attributes -----------------------------------------------------------
    -    ATTRS: {
    -        resultHighlighter: {
    -            value: 'phraseMatch'
    -        },
    -
    -        // May be set to "classes" or "modules".
    -        queryType: {
    -            value: 'classes'
    -        },
    -
    -        source: {
    -            valueFn: function() {
    -                var self = this;
    -                return function(q) {
    -                    var data = Y.YUIDoc.meta[self.get('queryType')],
    -                        out = [];
    -                    Y.each(data, function(v) {
    -                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    -                            out.push(v);
    -                        }
    -                    });
    -                    return out;
    -                };
    -            }
    -        }
    -    }
    -});
    -
    -}, '3.4.0', {requires: [
    -    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    -]});
    diff --git a/tutorial-3/pixi.js-master/docs/assets/js/api-list.js b/tutorial-3/pixi.js-master/docs/assets/js/api-list.js
    deleted file mode 100755
    index 88905b5..0000000
    --- a/tutorial-3/pixi.js-master/docs/assets/js/api-list.js
    +++ /dev/null
    @@ -1,251 +0,0 @@
    -YUI.add('api-list', function (Y) {
    -
    -var Lang   = Y.Lang,
    -    YArray = Y.Array,
    -
    -    APIList = Y.namespace('APIList'),
    -
    -    classesNode    = Y.one('#api-classes'),
    -    inputNode      = Y.one('#api-filter'),
    -    modulesNode    = Y.one('#api-modules'),
    -    tabviewNode    = Y.one('#api-tabview'),
    -
    -    tabs = APIList.tabs = {},
    -
    -    filter = APIList.filter = new Y.APIFilter({
    -        inputNode : inputNode,
    -        maxResults: 1000,
    -
    -        on: {
    -            results: onFilterResults
    -        }
    -    }),
    -
    -    search = APIList.search = new Y.APISearch({
    -        inputNode : inputNode,
    -        maxResults: 100,
    -
    -        on: {
    -            clear  : onSearchClear,
    -            results: onSearchResults
    -        }
    -    }),
    -
    -    tabview = APIList.tabview = new Y.TabView({
    -        srcNode  : tabviewNode,
    -        panelNode: '#api-tabview-panel',
    -        render   : true,
    -
    -        on: {
    -            selectionChange: onTabSelectionChange
    -        }
    -    }),
    -
    -    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    -        circular   : true,
    -        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    -        keys       : {next: 'down:40', previous: 'down:38'}
    -    }).focusManager,
    -
    -    LIST_ITEM_TEMPLATE =
    -        '
  • ' + - '{displayName}' + - '
  • '; - -// -- Init --------------------------------------------------------------------- - -// Duckpunch FocusManager's key event handling to prevent it from handling key -// events when a modifier is pressed. -Y.before(function (e, activeDescendant) { - if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { - return new Y.Do.Prevent(); - } -}, focusManager, '_focusPrevious', focusManager); - -Y.before(function (e, activeDescendant) { - if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { - return new Y.Do.Prevent(); - } -}, focusManager, '_focusNext', focusManager); - -// Create a mapping of tabs in the tabview so we can refer to them easily later. -tabview.each(function (tab, index) { - var name = tab.get('label').toLowerCase(); - - tabs[name] = { - index: index, - name : name, - tab : tab - }; -}); - -// Switch tabs on Ctrl/Cmd-Left/Right arrows. -tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); - -// Focus the filter input when the `/` key is pressed. -Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); - -// Keep the Focus Manager up to date. -inputNode.on('focus', function () { - focusManager.set('activeDescendant', inputNode); -}); - -// Update all tabview links to resolved URLs. -tabview.get('panelNode').all('a').each(function (link) { - link.setAttribute('href', link.get('href')); -}); - -// -- Private Functions -------------------------------------------------------- -function getFilterResultNode() { - return filter.get('queryType') === 'classes' ? classesNode : modulesNode; -} - -// -- Event Handlers ----------------------------------------------------------- -function onFilterResults(e) { - var frag = Y.one(Y.config.doc.createDocumentFragment()), - resultNode = getFilterResultNode(), - typePlural = filter.get('queryType'), - typeSingular = typePlural === 'classes' ? 'class' : 'module'; - - if (e.results.length) { - YArray.each(e.results, function (result) { - frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { - rootPath : APIList.rootPath, - displayName : filter.getDisplayName(result.highlighted), - name : result.text, - typePlural : typePlural, - typeSingular: typeSingular - })); - }); - } else { - frag.append( - '
  • ' + - 'No ' + typePlural + ' found.' + - '
  • ' - ); - } - - resultNode.empty(true); - resultNode.append(frag); - - focusManager.refresh(); -} - -function onSearchClear(e) { - - focusManager.refresh(); -} - -function onSearchKey(e) { - var target = e.target; - - if (target.test('input,select,textarea') - || target.get('isContentEditable')) { - return; - } - - e.preventDefault(); - - inputNode.focus(); - focusManager.refresh(); -} - -function onSearchResults(e) { - var frag = Y.one(Y.config.doc.createDocumentFragment()); - - if (e.results.length) { - YArray.each(e.results, function (result) { - frag.append(result.display); - }); - } else { - frag.append( - '
  • ' + - 'No results found. Maybe you\'ll have better luck with a ' + - 'different query?' + - '
  • ' - ); - } - - - focusManager.refresh(); -} - -function onTabSelectionChange(e) { - var tab = e.newVal, - name = tab.get('label').toLowerCase(); - - tabs.selected = { - index: tab.get('index'), - name : name, - tab : tab - }; - - switch (name) { - case 'classes': // fallthru - case 'modules': - filter.setAttrs({ - minQueryLength: 0, - queryType : name - }); - - search.set('minQueryLength', -1); - - // Only send a request if this isn't the initially-selected tab. - if (e.prevVal) { - filter.sendRequest(filter.get('value')); - } - break; - - case 'everything': - filter.set('minQueryLength', -1); - search.set('minQueryLength', 1); - - if (search.get('value')) { - search.sendRequest(search.get('value')); - } else { - inputNode.focus(); - } - break; - - default: - // WTF? We shouldn't be here! - filter.set('minQueryLength', -1); - search.set('minQueryLength', -1); - } - - if (focusManager) { - setTimeout(function () { - focusManager.refresh(); - }, 1); - } -} - -function onTabSwitchKey(e) { - var currentTabIndex = tabs.selected.index; - - if (!(e.ctrlKey || e.metaKey)) { - return; - } - - e.preventDefault(); - - switch (e.keyCode) { - case 37: // left arrow - if (currentTabIndex > 0) { - tabview.selectChild(currentTabIndex - 1); - inputNode.focus(); - } - break; - - case 39: // right arrow - if (currentTabIndex < (Y.Object.size(tabs) - 2)) { - tabview.selectChild(currentTabIndex + 1); - inputNode.focus(); - } - break; - } -} - -}, '3.4.0', {requires: [ - 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' -]}); diff --git a/tutorial-3/pixi.js-master/docs/assets/js/api-search.js b/tutorial-3/pixi.js-master/docs/assets/js/api-search.js deleted file mode 100755 index 175f6a6..0000000 --- a/tutorial-3/pixi.js-master/docs/assets/js/api-search.js +++ /dev/null @@ -1,98 +0,0 @@ -YUI.add('api-search', function (Y) { - -var Lang = Y.Lang, - Node = Y.Node, - YArray = Y.Array; - -Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { - // -- Public Properties ---------------------------------------------------- - RESULT_TEMPLATE: - '
  • ' + - '' + - '

    {name}

    ' + - '{resultType}' + - '
    {description}
    ' + - '{class}' + - '
    ' + - '
  • ', - - // -- Initializer ---------------------------------------------------------- - initializer: function () { - this._bindUIACBase(); - this._syncUIACBase(); - }, - - // -- Protected Methods ---------------------------------------------------- - _apiResultFilter: function (query, results) { - // Filter components out of the results. - return YArray.filter(results, function (result) { - return result.raw.resultType === 'component' ? false : result; - }); - }, - - _apiResultFormatter: function (query, results) { - return YArray.map(results, function (result) { - var raw = Y.merge(result.raw), // create a copy - desc = raw.description || ''; - - // Convert description to text and truncate it if necessary. - desc = Node.create('
    ' + desc + '
    ').get('text'); - - if (desc.length > 65) { - desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; - } else { - desc = Y.Escape.html(desc); - } - - raw['class'] || (raw['class'] = ''); - raw.description = desc; - - // Use the highlighted result name. - raw.name = result.highlighted; - - return Lang.sub(this.RESULT_TEMPLATE, raw); - }, this); - }, - - _apiTextLocator: function (result) { - return result.displayName || result.name; - } -}, { - // -- Attributes ----------------------------------------------------------- - ATTRS: { - resultFormatter: { - valueFn: function () { - return this._apiResultFormatter; - } - }, - - resultFilters: { - valueFn: function () { - return this._apiResultFilter; - } - }, - - resultHighlighter: { - value: 'phraseMatch' - }, - - resultListLocator: { - value: 'data.results' - }, - - resultTextLocator: { - valueFn: function () { - return this._apiTextLocator; - } - }, - - source: { - value: '/api/v1/search?q={query}&count={maxResults}' - } - } -}); - -}, '3.4.0', {requires: [ - 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', - 'escape' -]}); diff --git a/tutorial-3/pixi.js-master/docs/assets/js/apidocs.js b/tutorial-3/pixi.js-master/docs/assets/js/apidocs.js deleted file mode 100755 index c64bb46..0000000 --- a/tutorial-3/pixi.js-master/docs/assets/js/apidocs.js +++ /dev/null @@ -1,370 +0,0 @@ -YUI().use( - 'yuidoc-meta', - 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', -function (Y) { - -var win = Y.config.win, - localStorage = win.localStorage, - - bdNode = Y.one('#bd'), - - pjax, - defaultRoute, - - classTabView, - selectedTab; - -// Kill pjax functionality unless serving over HTTP. -if (!Y.getLocation().protocol.match(/^https?\:/)) { - Y.Router.html5 = false; -} - -// Create the default route with middleware which enables syntax highlighting -// on the loaded content. -defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { - prettyPrint(); - bdNode.removeClass('loading'); - - next(); -}); - -pjax = new Y.Pjax({ - container : '#docs-main', - contentSelector: '#docs-main > .content', - linkSelector : '#bd a', - titleSelector : '#xhr-title', - - navigateOnHash: true, - root : '/', - routes : [ - // -- / ---------------------------------------------------------------- - { - path : '/(index.html)?', - callbacks: defaultRoute - }, - - // -- /classes/* ------------------------------------------------------- - { - path : '/classes/:class.html*', - callbacks: [defaultRoute, 'handleClasses'] - }, - - // -- /files/* --------------------------------------------------------- - { - path : '/files/*file', - callbacks: [defaultRoute, 'handleFiles'] - }, - - // -- /modules/* ------------------------------------------------------- - { - path : '/modules/:module.html*', - callbacks: defaultRoute - } - ] -}); - -// -- Utility Functions -------------------------------------------------------- - -pjax.checkVisibility = function (tab) { - tab || (tab = selectedTab); - - if (!tab) { return; } - - var panelNode = tab.get('panelNode'), - visibleItems; - - // If no items are visible in the tab panel due to the current visibility - // settings, display a message to that effect. - visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { - if (itemNode.getComputedStyle('display') !== 'none') { - return true; - } - }); - - panelNode.all('.no-visible-items').remove(); - - if (!visibleItems) { - if (Y.one('#index .index-item')) { - panelNode.append( - '
    ' + - '

    ' + - 'Some items are not shown due to the current visibility ' + - 'settings. Use the checkboxes at the upper right of this ' + - 'page to change the visibility settings.' + - '

    ' + - '
    ' - ); - } else { - panelNode.append( - '
    ' + - '

    ' + - 'This class doesn\'t provide any methods, properties, ' + - 'attributes, or events.' + - '

    ' + - '
    ' - ); - } - } - - // Hide index sections without any visible items. - Y.all('.index-section').each(function (section) { - var items = 0, - visibleItems = 0; - - section.all('.index-item').each(function (itemNode) { - items += 1; - - if (itemNode.getComputedStyle('display') !== 'none') { - visibleItems += 1; - } - }); - - section.toggleClass('hidden', !visibleItems); - section.toggleClass('no-columns', visibleItems < 4); - }); -}; - -pjax.initClassTabView = function () { - if (!Y.all('#classdocs .api-class-tab').size()) { - return; - } - - if (classTabView) { - classTabView.destroy(); - selectedTab = null; - } - - classTabView = new Y.TabView({ - srcNode: '#classdocs', - - on: { - selectionChange: pjax.onTabSelectionChange - } - }); - - pjax.updateTabState(); - classTabView.render(); -}; - -pjax.initLineNumbers = function () { - var hash = win.location.hash.substring(1), - container = pjax.get('container'), - hasLines, node; - - // Add ids for each line number in the file source view. - container.all('.linenums>li').each(function (lineNode, index) { - lineNode.set('id', 'l' + (index + 1)); - lineNode.addClass('file-line'); - hasLines = true; - }); - - // Scroll to the desired line. - if (hasLines && /^l\d+$/.test(hash)) { - if ((node = container.getById(hash))) { - win.scroll(0, node.getY()); - } - } -}; - -pjax.initRoot = function () { - var terminators = /^(?:classes|files|modules)$/, - parts = pjax._getPathRoot().split('/'), - root = [], - i, len, part; - - for (i = 0, len = parts.length; i < len; i += 1) { - part = parts[i]; - - if (part.match(terminators)) { - // Makes sure the path will end with a "/". - root.push(''); - break; - } - - root.push(part); - } - - pjax.set('root', root.join('/')); -}; - -pjax.updateTabState = function (src) { - var hash = win.location.hash.substring(1), - defaultTab, node, tab, tabPanel; - - function scrollToNode() { - if (node.hasClass('protected')) { - Y.one('#api-show-protected').set('checked', true); - pjax.updateVisibility(); - } - - if (node.hasClass('private')) { - Y.one('#api-show-private').set('checked', true); - pjax.updateVisibility(); - } - - setTimeout(function () { - // For some reason, unless we re-get the node instance here, - // getY() always returns 0. - var node = Y.one('#classdocs').getById(hash); - win.scrollTo(0, node.getY() - 70); - }, 1); - } - - if (!classTabView) { - return; - } - - if (src === 'hashchange' && !hash) { - defaultTab = 'index'; - } else { - if (localStorage) { - defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || - 'index'; - } else { - defaultTab = 'index'; - } - } - - if (hash && (node = Y.one('#classdocs').getById(hash))) { - if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { - if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { - if (classTabView.get('rendered')) { - Y.Widget.getByNode(tab).set('selected', 1); - } else { - tab.addClass('yui3-tab-selected'); - } - } - } - - // Scroll to the desired element if this is a hash URL. - if (node) { - if (classTabView.get('rendered')) { - scrollToNode(); - } else { - classTabView.once('renderedChange', scrollToNode); - } - } - } else { - tab = Y.one('#classdocs .api-class-tab.' + defaultTab); - - // When the `defaultTab` node isn't found, `localStorage` is stale. - if (!tab && defaultTab !== 'index') { - tab = Y.one('#classdocs .api-class-tab.index'); - } - - if (classTabView.get('rendered')) { - Y.Widget.getByNode(tab).set('selected', 1); - } else { - tab.addClass('yui3-tab-selected'); - } - } -}; - -pjax.updateVisibility = function () { - var container = pjax.get('container'); - - container.toggleClass('hide-inherited', - !Y.one('#api-show-inherited').get('checked')); - - container.toggleClass('show-deprecated', - Y.one('#api-show-deprecated').get('checked')); - - container.toggleClass('show-protected', - Y.one('#api-show-protected').get('checked')); - - container.toggleClass('show-private', - Y.one('#api-show-private').get('checked')); - - pjax.checkVisibility(); -}; - -// -- Route Handlers ----------------------------------------------------------- - -pjax.handleClasses = function (req, res, next) { - var status = res.ioResponse.status; - - // Handles success and local filesystem XHRs. - if (!status || (status >= 200 && status < 300)) { - pjax.initClassTabView(); - } - - next(); -}; - -pjax.handleFiles = function (req, res, next) { - var status = res.ioResponse.status; - - // Handles success and local filesystem XHRs. - if (!status || (status >= 200 && status < 300)) { - pjax.initLineNumbers(); - } - - next(); -}; - -// -- Event Handlers ----------------------------------------------------------- - -pjax.onNavigate = function (e) { - var hash = e.hash, - originTarget = e.originEvent && e.originEvent.target, - tab; - - if (hash) { - tab = originTarget && originTarget.ancestor('.yui3-tab', true); - - if (hash === win.location.hash) { - pjax.updateTabState('hashchange'); - } else if (!tab) { - win.location.hash = hash; - } - - e.preventDefault(); - return; - } - - // Only scroll to the top of the page when the URL doesn't have a hash. - this.set('scrollToTop', !e.url.match(/#.+$/)); - - bdNode.addClass('loading'); -}; - -pjax.onOptionClick = function (e) { - pjax.updateVisibility(); -}; - -pjax.onTabSelectionChange = function (e) { - var tab = e.newVal, - tabId = tab.get('contentBox').getAttribute('href').substring(1); - - selectedTab = tab; - - // If switching from a previous tab (i.e., this is not the default tab), - // replace the history entry with a hash URL that will cause this tab to - // be selected if the user navigates away and then returns using the back - // or forward buttons. - if (e.prevVal && localStorage) { - localStorage.setItem('tab_' + pjax.getPath(), tabId); - } - - pjax.checkVisibility(tab); -}; - -// -- Init --------------------------------------------------------------------- - -pjax.on('navigate', pjax.onNavigate); - -pjax.initRoot(); -pjax.upgrade(); -pjax.initClassTabView(); -pjax.initLineNumbers(); -pjax.updateVisibility(); - -Y.APIList.rootPath = pjax.get('root'); - -Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); - -Y.on('hashchange', function (e) { - pjax.updateTabState('hashchange'); -}, win); - -}); diff --git a/tutorial-3/pixi.js-master/docs/assets/js/yui-prettify.js b/tutorial-3/pixi.js-master/docs/assets/js/yui-prettify.js deleted file mode 100755 index 18de864..0000000 --- a/tutorial-3/pixi.js-master/docs/assets/js/yui-prettify.js +++ /dev/null @@ -1,17 +0,0 @@ -YUI().use('node', function(Y) { - var code = Y.all('.prettyprint.linenums'); - if (code.size()) { - code.each(function(c) { - var lis = c.all('ol li'), - l = 1; - lis.each(function(n) { - n.prepend(''); - l++; - }); - }); - var h = location.hash; - location.hash = ''; - h = h.replace('LINE_', 'LINENUM_'); - location.hash = h; - } -}); diff --git a/tutorial-3/pixi.js-master/docs/assets/vendor/prettify/CHANGES.html b/tutorial-3/pixi.js-master/docs/assets/vendor/prettify/CHANGES.html deleted file mode 100755 index b50b841..0000000 --- a/tutorial-3/pixi.js-master/docs/assets/vendor/prettify/CHANGES.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - Change Log - - - README - -

    Known Issues

    -
      -
    • Perl formatting is really crappy. Partly because the author is lazy and - partly because Perl is - hard to parse. -
    • On some browsers, <code> elements with newlines in the text - which use CSS to specify white-space:pre will have the newlines - improperly stripped if the element is not attached to the document at the time - the stripping is done. Also, on IE 6, all newlines will be stripped from - <code> elements because of the way IE6 produces - innerHTML. Workaround: use <pre> for code with - newlines. -
    - -

    Change Log

    -

    29 March 2007

    -
      -
    • Added tests for PHP support - to address - issue 3. -
    • Fixed - bug: prettyPrintOne was not halting. This was not - reachable through the normal entry point. -
    • Fixed - bug: recursing into a script block or PHP tag that was not properly - closed would not silently drop the content. - (test) -
    • Fixed - bug: was eating tabs - (test) -
    • Fixed entity handling so that the caveat -
      -

      Caveats: please properly escape less-thans. x&lt;y - instead of x<y, and use " instead of - &quot; for string delimiters.

      -
      - is no longer applicable. -
    • Added noisefree's C# - patch -
    • Added a distribution that has comments and - whitespace removed to reduce download size from 45.5kB to 12.8kB. -
    -

    4 Jul 2008

    -
      -
    • Added language specific formatters that are triggered by the presence - of a lang-<language-file-extension>
    • -
    • Fixed bug: python handling of '''string''' -
    • Fixed bug: / in regex [charsets] should not end regex -
    -

    5 Jul 2008

    -
      -
    • Defined language extensions for Lisp and Lua -
    -

    14 Jul 2008

    -
      -
    • Language handlers for F#, OCAML, SQL -
    • Support for nocode spans to allow embedding of line - numbers and code annotations which should not be styled or otherwise - affect the tokenization of prettified code. - See the issue 22 - testcase. -
    -

    6 Jan 2009

    -
      -
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • -
    • Added .mxml extension to the markup style handler for - Flex MXML files. See - issue 37. -
    • Added .m extension to the C style handler so that Objective - C source files properly highlight. See - issue 58. -
    • Changed HTML lexer to use the same embedded source mechanism as the - wiki language handler, and changed to use the registered - CSS handler for STYLE element content. -
    -

    21 May 2009

    -
      -
    • Rewrote to improve performance on large files. - See benchmarks.
    • -
    • Fixed bugs with highlighting of Haskell line comments, Lisp - number literals, Lua strings, C preprocessor directives, - newlines in Wiki code on Windows, and newlines in IE6.
    • -
    -

    14 August 2009

    -
      -
    • Fixed prettifying of <code> blocks with embedded newlines. -
    -

    3 October 2009

    -
      -
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. -
    -

    19 July 2010

    -
      -
    • Added support for line numbers. Bug - 22
    • -
    • Added YAML support. Bug - 123
    • -
    • Added VHDL support courtesy Le Poussin.
    • -
    • IE performance improvements. Bug - 102 courtesy jacobly.
    • -
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • -
    • Fixed copy and paste in IE[678]. -
    • Changed output to use &#160; instead of - &nbsp; so that the output works when embedded in XML. - Bug - 108.
    • -
    - - diff --git a/tutorial-3/pixi.js-master/docs/assets/vendor/prettify/COPYING b/tutorial-3/pixi.js-master/docs/assets/vendor/prettify/COPYING deleted file mode 100755 index d645695..0000000 --- a/tutorial-3/pixi.js-master/docs/assets/vendor/prettify/COPYING +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/tutorial-3/pixi.js-master/docs/assets/vendor/prettify/README.html b/tutorial-3/pixi.js-master/docs/assets/vendor/prettify/README.html deleted file mode 100755 index c6fe1a3..0000000 --- a/tutorial-3/pixi.js-master/docs/assets/vendor/prettify/README.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - - Javascript code prettifier - - - - - - - - - - Languages : CH -

    Javascript code prettifier

    - -

    Setup

    -
      -
    1. Download a distribution -
    2. Include the script and stylesheets in your document - (you will need to make sure the css and js file are on your server, and - adjust the paths in the script and link tag) -
      -<link href="prettify.css" type="text/css" rel="stylesheet" />
      -<script type="text/javascript" src="prettify.js"></script>
      -
    3. Add onload="prettyPrint()" to your - document's body tag. -
    4. Modify the stylesheet to get the coloring you prefer
    5. -
    - -

    Usage

    -

    Put code snippets in - <pre class="prettyprint">...</pre> - or <code class="prettyprint">...</code> - and it will automatically be pretty printed. - - - - -
    The original - Prettier -
    class Voila {
    -public:
    -  // Voila
    -  static const string VOILA = "Voila";
    -
    -  // will not interfere with embedded tags.
    -}
    - -
    class Voila {
    -public:
    -  // Voila
    -  static const string VOILA = "Voila";
    -
    -  // will not interfere with embedded tags.
    -}
    -
    - -

    FAQ

    -

    Which languages does it work for?

    -

    The comments in prettify.js are authoritative but the lexer - should work on a number of languages including C and friends, - Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. - It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl - and Ruby, but, because of commenting conventions, doesn't work on - Smalltalk, or CAML-like languages.

    - -

    LISPy languages are supported via an extension: - lang-lisp.js.

    -

    And similarly for - CSS, - Haskell, - Lua, - OCAML, SML, F#, - Visual Basic, - SQL, - Protocol Buffers, and - WikiText.. - -

    If you'd like to add an extension for your favorite language, please - look at src/lang-lisp.js and file an - issue including your language extension, and a testcase.

    - -

    How do I specify which language my code is in?

    -

    You don't need to specify the language since prettyprint() - will guess. You can specify a language by specifying the language extension - along with the prettyprint class like so:

    -
    <pre class="prettyprint lang-html">
    -  The lang-* class specifies the language file extensions.
    -  File extensions supported by default include
    -    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    -    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    -    "xhtml", "xml", "xsl".
    -</pre>
    - -

    It doesn't work on <obfuscated code sample>?

    -

    Yes. Prettifying obfuscated code is like putting lipstick on a pig - — i.e. outside the scope of this tool.

    - -

    Which browsers does it work with?

    -

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. - Look at the test page to see if it - works in your browser.

    - -

    What's changed?

    -

    See the change log

    - -

    Why doesn't Prettyprinting of strings work on WordPress?

    -

    Apparently wordpress does "smart quoting" which changes close quotes. - This causes end quotes to not match up with open quotes. -

    This breaks prettifying as well as copying and pasting of code samples. - See - WordPress's help center for info on how to stop smart quoting of code - snippets.

    - -

    How do I put line numbers in my code?

    -

    You can use the linenums class to turn on line - numbering. If your code doesn't start at line number 1, you can - add a colon and a line number to the end of that class as in - linenums:52. - -

    For example -

    <pre class="prettyprint linenums:4"
    ->// This is line 4.
    -foo();
    -bar();
    -baz();
    -boo();
    -far();
    -faz();
    -<pre>
    - produces -
    // This is line 4.
    -foo();
    -bar();
    -baz();
    -boo();
    -far();
    -faz();
    -
    - -

    How do I prevent a portion of markup from being marked as code?

    -

    You can use the nocode class to identify a span of markup - that is not code. -

    <pre class=prettyprint>
    -int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    -  Continuation of comment */
    -int y = bar();
    -</pre>
    -produces -
    -int x = foo();  /* This is a comment  This is not code
    -  Continuation of comment */
    -int y = bar();
    -
    - -

    For a more complete example see the issue22 - testcase.

    - -

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    -

    If you are calling prettyPrint via an event handler, wrap it in a function. - Instead of doing -

    - addEventListener('load', prettyPrint, false); -
    - wrap it in a closure like -
    - addEventListener('load', function (event) { prettyPrint() }, false); -
    - so that the browser does not pass an event object to prettyPrint which - will confuse it. - -


    - - - - diff --git a/tutorial-3/pixi.js-master/docs/assets/vendor/prettify/prettify-min.css b/tutorial-3/pixi.js-master/docs/assets/vendor/prettify/prettify-min.css deleted file mode 100755 index d44b3a2..0000000 --- a/tutorial-3/pixi.js-master/docs/assets/vendor/prettify/prettify-min.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/tutorial-3/pixi.js-master/docs/assets/vendor/prettify/prettify-min.js b/tutorial-3/pixi.js-master/docs/assets/vendor/prettify/prettify-min.js deleted file mode 100755 index 4845d05..0000000 --- a/tutorial-3/pixi.js-master/docs/assets/vendor/prettify/prettify-min.js +++ /dev/null @@ -1 +0,0 @@ -window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/tutorial-3/pixi.js-master/docs/classes/AbstractFilter.html b/tutorial-3/pixi.js-master/docs/classes/AbstractFilter.html deleted file mode 100755 index c98665e..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/AbstractFilter.html +++ /dev/null @@ -1,857 +0,0 @@ - - - - - AbstractFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AbstractFilter Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This is the base class for creating a PIXI filter. Currently only webGL supports filters. -If you want to make a custom filter this should be your base class.

    - -
    - - -
    -

    Constructor

    -
    -

    AbstractFilter

    - - -
    - (
      - -
    • - - fragmentSrc - -
    • - -
    • - - uniforms - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - fragmentSrc - Array - - - - -
      -

      The fragment source in an array of strings.

      - -
      - - -
    • - -
    • - - uniforms - Object - - - - -
      -

      An object containing the uniforms for this filter.

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/AjaxRequest.html b/tutorial-3/pixi.js-master/docs/classes/AjaxRequest.html deleted file mode 100755 index 473c83e..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/AjaxRequest.html +++ /dev/null @@ -1,978 +0,0 @@ - - - - - AjaxRequest - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AjaxRequest Class

    -
    - - - - - -
    - Defined in: src/pixi/utils/Utils.js:108 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    A wrapper for ajax requests to be handled cross browser

    - -
    - - -
    -

    Constructor

    -
    -

    AjaxRequest

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:108 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    bind

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:74 - -

    - - - - - -
    - -
    -

    A polyfill for Function.prototype.bind

    - -
    - - - - - - -
    - - -
    -

    cancelAnimationFrame

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:20 - -

    - - - - - -
    - -
    -

    A polyfill for cancelAnimationFrame

    - -
    - - - - - - -
    - - -
    -

    canUseNewCanvasBlendModes

    - - - () - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:168 - -

    - - - - - -
    - -
    -

    Checks whether the Canvas BlendModes are supported by the current browser

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    whether they are supported

    - - -
    -
    - - - -
    - - -
    -

    getNextPowerOfTwo

    - - -
    - (
      - -
    • - - number - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:189 - -

    - - - - - -
    - -
    -

    Given a number, this function returns the closest number that is a power of two -this function is taken from Starling Framework as its pretty neat ;)

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - number - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    the closest number that is a power of two

    - - -
    -
    - - - -
    - - -
    -

    hex2rgb

    - - -
    - (
      - -
    • - - hex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:54 - -

    - - - - - -
    - -
    -

    Converts a hex color number to an [R, G, B] array

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - hex - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    requestAnimationFrame

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:12 - -

    - - - - - -
    - -
    -

    A polyfill for requestAnimationFrame -You can actually use both requestAnimationFrame and requestAnimFrame, -you will still benefit from the polyfill

    - -
    - - - - - - -
    - - -
    -

    rgb2hex

    - - -
    - (
      - -
    • - - rgb - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:64 - -

    - - - - - -
    - -
    -

    Converts a color as an [R, G, B] array to a hex number

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - rgb - Array - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/AlphaMaskFilter.html b/tutorial-3/pixi.js-master/docs/classes/AlphaMaskFilter.html deleted file mode 100755 index 6c2abe0..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/AlphaMaskFilter.html +++ /dev/null @@ -1,933 +0,0 @@ - - - - - AlphaMaskFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AlphaMaskFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The AlphaMaskFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. -You can use this filter to apply all manor of crazy warping effects -Currently the r property of the texture is used to offset the x and the g property of the texture is used to offset the y.

    - -
    - - -
    -

    Constructor

    -
    -

    AlphaMaskFilter

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AlphaMaskFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The texture used for the displacement map * must be power of 2 texture at the moment

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    onTextureLoaded

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AlphaMaskFilter.js:71 - -

    - - - - - -
    - -
    -

    Sets the map dimensions uniforms when the texture becomes available.

    - -
    - - - - - - -
    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    map

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AlphaMaskFilter.js:84 - -

    - - - - -
    - -
    -

    The texture used for the displacement map. Must be power of 2 sized texture.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/AsciiFilter.html b/tutorial-3/pixi.js-master/docs/classes/AsciiFilter.html deleted file mode 100755 index eee96f8..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/AsciiFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - AsciiFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AsciiFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    An ASCII filter.

    - -
    - - -
    -

    Constructor

    -
    -

    AsciiFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AsciiFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    size

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AsciiFilter.js:73 - -

    - - - - -
    - -
    -

    The pixel size used by the filter.

    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/AssetLoader.html b/tutorial-3/pixi.js-master/docs/classes/AssetLoader.html deleted file mode 100755 index 9485b58..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/AssetLoader.html +++ /dev/null @@ -1,1743 +0,0 @@ - - - - - AssetLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AssetLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    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

    - -
    - - -
    -

    Constructor

    -
    -

    AssetLoader

    - - -
    - (
      - -
    • - - assetURLs - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - 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. Supported bitmap font - data formats include 'xml' and 'fnt'.

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    -

    Events

    - - -
    - -
    - - -
    -

    Methods

    - - -
    -

    _getDataType

    - - -
    - (
      - -
    • - - str - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:74 - -

    - - - - - -
    - -
    -

    Given a filename, returns its extension.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - str - String - - - - -
      -

      the name of the asset

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:107 - -

    - - - - - -
    - -
    -

    Starts loading the assets sequentially

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onAssetLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:143 - -

    - - - - - -
    - -
    -

    Invoked after each file is loaded

    - -
    - - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    assetURLs

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:23 - -

    - - - - -
    - -
    -

    The array of asset URLs that are going to be loaded

    - -
    - - - - - - -
    - - -
    -

    crossorigin

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:31 - -

    - - - - -
    - -
    -

    Whether the requests should be treated as cross origin

    - -
    - - - - - - -
    - - -
    -

    loadersByType

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:39 - -

    - - - - -
    - -
    -

    Maps file extension to loader types

    - -
    - - - - - - -
    - - -
    - - - - - -
    -

    Events

    - - -
    -

    onComplete

    - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:66 - -

    - - - - -
    - -
    -

    Fired when all the assets have loaded

    - -
    - - - - - -
    - - -
    -

    onProgress

    - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:61 - -

    - - - - -
    - -
    -

    Fired when an item has loaded

    - -
    - - - - - -
    - - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/AtlasLoader.html b/tutorial-3/pixi.js-master/docs/classes/AtlasLoader.html deleted file mode 100755 index a7cc254..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/AtlasLoader.html +++ /dev/null @@ -1,1481 +0,0 @@ - - - - - AtlasLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AtlasLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event.

    -

    To generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format.

    -

    It is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to 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.fromFrameId()

    - -
    - - -
    -

    Constructor

    -
    -

    AtlasLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AtlasLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the JSON file

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AtlasLoader.js:32 - -

    - - - - - -
    - -
    -

    Starts loading the JSON file

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onAtlasLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AtlasLoader.js:46 - -

    - - - - - -
    - -
    -

    Invoked when the Atlas has fully loaded. Parses the JSON and builds the texture frames.

    - -
    - - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onError

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AtlasLoader.js:182 - -

    - - - - - -
    - -
    -

    Invoked when an error occurs.

    - -
    - - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AtlasLoader.js:166 - -

    - - - - - -
    - -
    -

    Invoked when json file has loaded.

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/BaseTexture.html b/tutorial-3/pixi.js-master/docs/classes/BaseTexture.html deleted file mode 100755 index ad0c53e..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/BaseTexture.html +++ /dev/null @@ -1,2399 +0,0 @@ - - - - - BaseTexture - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BaseTexture Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A texture stores the information that represents an image. All textures have a base texture.

    - -
    - - -
    -

    Constructor

    -
    -

    BaseTexture

    - - -
    - (
      - -
    • - - source - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:9 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - source - String - - - - -
      -

      the source object (image or canvas)

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:151 - -

    - - - - - -
    - -
    -

    Destroys this base texture

    - -
    - - - - - - -
    - - -
    -

    dirty

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:187 - -

    - - - - - -
    - -
    -

    Sets all glTextures to be dirty.

    - -
    - - - - - - -
    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    fromCanvas

    - - -
    - (
      - -
    • - - canvas - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:270 - -

    - - - - - -
    - -
    -

    Helper function that creates a base texture from the given canvas element.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - canvas - Canvas - - - - -
      -

      The canvas element source of the texture

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - -

    BaseTexture

    - - -
    -
    - - - -
    - - -
    -

    fromImage

    - - -
    - (
      - -
    • - - imageUrl - -
    • - -
    • - - crossorigin - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:228 - -

    - - - - - -
    - -
    -

    Helper function that creates a base texture from the given image url. -If the image is not in the base texture cache it will be created and loaded.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - imageUrl - String - - - - -
      -

      The image url of the texture

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - -

    BaseTexture

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    unloadFromGPU

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:200 - -

    - - - - - -
    - -
    -

    Removes the base texture from the GPU, useful for managing resources on the GPU. -Atexture is still 100% usable and will simply be reuploaded if there is a sprite on screen that is using it.

    - -
    - - - - - - -
    - - -
    -

    updateSourceImage

    - - -
    - (
      - -
    • - - newSrc - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:174 - -

    - - - - - -
    - -
    -

    Changes the source image of the texture

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - newSrc - String - - - - -
      -

      the path of the image

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _dirty

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:95 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    _glTextures

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:85 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    _powerOf2

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:138 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    hasLoaded

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:55 - -

    - - - - -
    - -
    -

    [read-only] Set to true once the base texture has loaded

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:37 - -

    - - - - -
    - -
    -

    [read-only] The height of the base texture set when the image has loaded

    - -
    - - - - - - -
    - - -
    -

    imageUrl

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:132 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    premultipliedAlpha

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:74 - -

    - - - - -
    - -
    -

    Controls if RGB channels should be pre-multiplied by Alpha (WebGL only)

    - -
    - - -

    Default: true

    - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:20 - -

    - - - - -
    - -
    -

    The Resolution of the texture.

    - -
    - - - - - - -
    - - -
    -

    scaleMode

    - PIXI.scaleModes - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:46 - -

    - - - - -
    - -
    -

    The scale mode to apply when scaling this texture

    - -
    - - -

    Default: PIXI.scaleModes.LINEAR

    - - - - - -
    - - -
    -

    source

    - Image - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:64 - -

    - - - - -
    - -
    -

    The image source that is used to create the texture.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:28 - -

    - - - - -
    - -
    -

    [read-only] The width of the base texture set when the image has loaded

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/BitmapFontLoader.html b/tutorial-3/pixi.js-master/docs/classes/BitmapFontLoader.html deleted file mode 100755 index 670a3d2..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/BitmapFontLoader.html +++ /dev/null @@ -1,1641 +0,0 @@ - - - - - BitmapFontLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BitmapFontLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    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

    - -
    - - -
    -

    Constructor

    -
    -

    BitmapFontLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the sprite sheet JSON file

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:57 - -

    - - - - - -
    - -
    -

    Loads the XML font data

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:152 - -

    - - - - - -
    - -
    -

    Invoked when all files are loaded (xml/fnt and texture)

    - -
    - - - - - - -
    - - -
    -

    onXMLLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:72 - -

    - - - - - -
    - -
    -

    Invoked when the XML file is loaded, parses the data.

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    baseUrl

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:35 - -

    - - - - -
    - -
    -

    [read-only] The base url of the bitmap font data

    - -
    - - - - - - -
    - - -
    -

    crossorigin

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:27 - -

    - - - - -
    - -
    -

    Whether the requests should be treated as cross origin

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:44 - -

    - - - - -
    - -
    -

    [read-only] The texture of the bitmap font

    - -
    - - - - - - -
    - - -
    -

    url

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:19 - -

    - - - - -
    - -
    -

    The url of the bitmap font data

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/BitmapText.html b/tutorial-3/pixi.js-master/docs/classes/BitmapText.html deleted file mode 100755 index 2dfc95f..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/BitmapText.html +++ /dev/null @@ -1,6161 +0,0 @@ - - - - - BitmapText - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BitmapText Class

    -
    - - - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A BitmapText object will create a line or multiple lines of text using bitmap font. To split a line you can use '\n', '\r' or '\r\n' in your string. -You can generate the fnt files using -http://www.angelcode.com/products/bmfont/ for windows or -http://www.bmglyph.com/ for mac.

    - -
    - - -
    -

    Constructor

    -
    -

    BitmapText

    - - -
    - (
      - -
    • - - text - -
    • - -
    • - - style - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - text - String - - - - -
      -

      The copy that you would like the text to display

      - -
      - - -
    • - -
    • - - style - Object - - - - -
      -

      The style parameters

      - -
      - - -
        - -
      • - - font - String - - -
        -

        The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)

        - -
        - - -
      • - -
      • - - [align='left'] - String - optional - - -
        -

        Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text

        - -
        - - -
      • - -
      - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStyle

    - - -
    - (
      - -
    • - - style - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:78 - -

    - - - - - -
    - -
    -

    Set the style of the text -style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously) -[style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single lines of text

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - style - Object - - - - -
      -

      The style parameters, contained as properties of an object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setText

    - - -
    - (
      - -
    • - - text - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:66 - -

    - - - - - -
    - -
    -

    Set the text string to be rendered.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - text - String - - - - -
      -

      The text that you would like displayed

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    -

    updateText

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:100 - -

    - - - - - -
    - -
    -

    Renders text and updates it when needed

    - -
    - - - - - - -
    - - -
    -

    updateTransform

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:198 - -

    - - - - - -
    - -
    -

    Updates the transform of this object

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _pool

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:54 - -

    - - - - -
    - -
    -

    The dirty state of this object.

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    textHeight

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:33 - -

    - - - - -
    - -
    -

    [read-only] The height of the overall text, different from fontSize, -which is defined in the style object

    - -
    - - - - - - -
    - - -
    -

    textWidth

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:23 - -

    - - - - -
    - -
    -

    [read-only] The width of the overall text, different from fontSize, -which is defined in the style object

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/BlurFilter.html b/tutorial-3/pixi.js-master/docs/classes/BlurFilter.html deleted file mode 100755 index 0922ab3..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/BlurFilter.html +++ /dev/null @@ -1,946 +0,0 @@ - - - - - BlurFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BlurFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The BlurFilter applies a Gaussian blur to an object. -The strength of the blur can be set for x- and y-axis separately (always relative to the stage).

    - -
    - - -
    -

    Constructor

    -
    -

    BlurFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number the strength of the blur - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurFilter.js:24 - -

    - - - - -
    - -
    -

    Sets the strength of both the blurX and blurY properties simultaneously

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    blurX

    - Number the strength of the blurX - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurFilter.js:40 - -

    - - - - -
    - -
    -

    Sets the strength of the blurX property

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    blurY

    - Number the strength of the blurY - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurFilter.js:56 - -

    - - - - -
    - -
    -

    Sets the strength of the blurY property

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/BlurXFilter.html b/tutorial-3/pixi.js-master/docs/classes/BlurXFilter.html deleted file mode 100755 index a29861a..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/BlurXFilter.html +++ /dev/null @@ -1,837 +0,0 @@ - - - - - BlurXFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BlurXFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The BlurXFilter applies a horizontal Gaussian blur to an object.

    - -
    - - -
    -

    Constructor

    -
    -

    BlurXFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurXFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number the strength of the blur - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurXFilter.js:51 - -

    - - - - -
    - -
    -

    Sets the strength of both the blur.

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/BlurYFilter.html b/tutorial-3/pixi.js-master/docs/classes/BlurYFilter.html deleted file mode 100755 index e2e564b..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/BlurYFilter.html +++ /dev/null @@ -1,837 +0,0 @@ - - - - - BlurYFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BlurYFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The BlurYFilter applies a vertical Gaussian blur to an object.

    - -
    - - -
    -

    Constructor

    -
    -

    BlurYFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurYFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number the strength of the blur - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurYFilter.js:51 - -

    - - - - -
    - -
    -

    Sets the strength of both the blur.

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/CanvasBuffer.html b/tutorial-3/pixi.js-master/docs/classes/CanvasBuffer.html deleted file mode 100755 index e39dba6..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/CanvasBuffer.html +++ /dev/null @@ -1,868 +0,0 @@ - - - - - CanvasBuffer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CanvasBuffer Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    Creates a Canvas element of the given size.

    - -
    - - -
    -

    Constructor

    -
    -

    CanvasBuffer

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      the width for the newly created canvas

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the height for the newly created canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clear

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:53 - -

    - - - - - -
    - -
    -

    Clears the canvas that was created by the CanvasBuffer class.

    - -
    - - - - - - -
    - - -
    -

    resize

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:65 - -

    - - - - - -
    - -
    -

    Resizes the canvas to the specified width and height.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      the new width of the canvas

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the new height of the canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    canvas

    - HTMLCanvasElement - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:31 - -

    - - - - -
    - -
    -

    The Canvas object that belongs to this CanvasBuffer.

    - -
    - - - - - - -
    - - -
    -

    context

    - CanvasRenderingContext2D - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:39 - -

    - - - - -
    - -
    -

    A CanvasRenderingContext2D object representing a two-dimensional rendering context.

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:23 - -

    - - - - -
    - -
    -

    The height of the Canvas in pixels.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:15 - -

    - - - - -
    - -
    -

    The width of the Canvas in pixels.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/CanvasGraphics.html b/tutorial-3/pixi.js-master/docs/classes/CanvasGraphics.html deleted file mode 100755 index 59addfe..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/CanvasGraphics.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - CanvasGraphics - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CanvasGraphics Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A set of functions used by the canvas renderer to draw the primitive graphics data.

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - - - - - - - -
    - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/CanvasMaskManager.html b/tutorial-3/pixi.js-master/docs/classes/CanvasMaskManager.html deleted file mode 100755 index 0a31f57..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/CanvasMaskManager.html +++ /dev/null @@ -1,620 +0,0 @@ - - - - - CanvasMaskManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CanvasMaskManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A set of functions used to handle masking.

    - -
    - - -
    -

    Constructor

    -
    -

    CanvasMaskManager

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasMaskManager.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    popMask

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasMaskManager.js:49 - -

    - - - - - -
    - -
    -

    Restores the current drawing context to the state it was before the mask was applied.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The renderSession whose context will be used for this mask manager.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    pushMask

    - - -
    - (
      - -
    • - - maskData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasMaskManager.js:17 - -

    - - - - - -
    - -
    -

    This method adds it to the current stack of masks.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - maskData - Object - - - - -
      -

      the maskData that will be pushed

      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      -

      The renderSession whose context will be used for this mask manager.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/CanvasRenderer.html b/tutorial-3/pixi.js-master/docs/classes/CanvasRenderer.html deleted file mode 100755 index 5c96035..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/CanvasRenderer.html +++ /dev/null @@ -1,1761 +0,0 @@ - - - - - CanvasRenderer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CanvasRenderer Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The CanvasRenderer draws the Stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. -Don't forget to add the CanvasRenderer.view to your DOM or you will not see anything :)

    - -
    - - -
    -

    Constructor

    -
    -

    CanvasRenderer

    - - -
    - (
      - -
    • - - [width=800] - -
    • - -
    • - - [height=600] - -
    • - -
    • - - [options] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - [width=800] - Number - optional - - - - -
      -

      the width of the canvas view

      - -
      - - -
    • - -
    • - - [height=600] - Number - optional - - - - -
      -

      the height of the canvas view

      - -
      - - -
    • - -
    • - - [options] - Object - optional - - - - -
      -

      The optional renderer parameters

      - -
      - - -
        - -
      • - - [view] - HTMLCanvasElement - optional - - -
        -

        the canvas to use as a view, optional

        - -
        - - -
      • - -
      • - - [transparent=false] - Boolean - optional - - -
        -

        If the render view is transparent, default false

        - -
        - - -
      • - -
      • - - [autoResize=false] - Boolean - optional - - -
        -

        If the render view is automatically resized, default false

        - -
        - - -
      • - -
      • - - [resolution=1] - Number - optional - - -
        -

        the resolution of the renderer retina would be 2

        - -
        - - -
      • - -
      • - - [clearBeforeRender=true] - Boolean - optional - - -
        -

        This sets if the CanvasRenderer will clear the canvas or not before the new render pass.

        - -
        - - -
      • - -
      - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - -
    - (
      - -
    • - - [removeView=true] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:233 - -

    - - - - - -
    - -
    -

    Removes everything from the renderer and optionally removes the Canvas DOM element.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - [removeView=true] - Boolean - optional - - - - -
      -

      Removes the Canvas element from the DOM.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    mapBlendModes

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:291 - -

    - - - - - -
    - -
    -

    Maps Pixi blend modes to canvas blend modes.

    - -
    - - - - - - -
    - - -
    -

    render

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:184 - -

    - - - - - -
    - -
    -

    Renders the Stage to this canvas view

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the Stage element to be rendered

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderDisplayObject

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - context - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:276 - -

    - - - - - -
    - -
    -

    Renders a display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      The displayObject to render

      - -
      - - -
    • - -
    • - - context - CanvasRenderingContext2D - - - - -
      -

      the context 2d method of the canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    resize

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:255 - -

    - - - - - -
    - -
    -

    Resizes the canvas view to the specified width and height

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      the new width of the canvas view

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the new height of the canvas view

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    autoResize

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:76 - -

    - - - - -
    - -
    -

    Whether the render view should be resized automatically

    - -
    - - - - - - -
    - - -
    -

    CanvasMaskManager

    - CanvasMaskManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:140 - -

    - - - - -
    - -
    -

    Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer

    - -
    - - - - - - -
    - - -
    -

    clearBeforeRender

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:56 - -

    - - - - -
    - -
    -

    This sets if the CanvasRenderer will clear the canvas or not before the new render pass. -If the Stage is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color. -If the Stage is transparent Pixi will use clearRect to clear the canvas every frame. -Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.

    - -
    - - - - - - -
    - - -
    -

    context

    - CanvasRenderingContext2D - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:114 - -

    - - - - -
    - -
    -

    The canvas 2d context that everything is drawn with

    - -
    - - - - - - -
    - - -
    -

    count

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:132 - -

    - - - - -
    - -
    -

    Internal var.

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:94 - -

    - - - - -
    - -
    -

    The height of the canvas view

    - -
    - - -

    Default: 600

    - - - - - -
    - - -
    -

    refresh

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:121 - -

    - - - - -
    - -
    -

    Boolean flag controlling canvas refresh.

    - -
    - - - - - - -
    - - -
    -

    renderSession

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:147 - -

    - - - - -
    - -
    -

    The render session is just a bunch of parameter used for rendering

    - -
    - - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:48 - -

    - - - - -
    - -
    -

    The resolution of the canvas.

    - -
    - - - - - - -
    - - -
    -

    transparent

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:68 - -

    - - - - -
    - -
    -

    Whether the render view is transparent

    - -
    - - - - - - -
    - - -
    -

    type

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:40 - -

    - - - - -
    - -
    -

    The renderer type.

    - -
    - - - - - - -
    - - -
    -

    view

    - HTMLCanvasElement - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:106 - -

    - - - - -
    - -
    -

    The canvas element that everything is drawn to.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:85 - -

    - - - - -
    - -
    -

    The width of the canvas view

    - -
    - - -

    Default: 800

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/CanvasTinter.html b/tutorial-3/pixi.js-master/docs/classes/CanvasTinter.html deleted file mode 100755 index 3cedea0..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/CanvasTinter.html +++ /dev/null @@ -1,1293 +0,0 @@ - - - - - CanvasTinter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CanvasTinter Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    CanvasTinter

    - - - () - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    getTintedTexture

    - - -
    - (
      - -
    • - - sprite - -
    • - -
    • - - color - -
    • - -
    ) -
    - - - - - HTMLCanvasElement - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:14 - -

    - - - - - -
    - -
    -

    Basically this method just needs a sprite and a color and tints the sprite with the given color.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - sprite - Sprite - - - - -
      -

      the sprite to tint

      - -
      - - -
    • - -
    • - - color - Number - - - - -
      -

      the color to use to tint the sprite with

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - HTMLCanvasElement: - -

    The tinted canvas

    - - -
    -
    - - - -
    - - -
    -

    roundColor

    - - -
    - (
      - -
    • - - color - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:184 - -

    - - - - - -
    - -
    -

    Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - color - Number - - - - -
      -

      the color to round, should be a hex color

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    tintMethod

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:227 - -

    - - - - - -
    - -
    -

    The tinting method that will be used.

    - -
    - - - - - - -
    - - -
    -

    tintPerPixel

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - color - -
    • - -
    • - - canvas - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:139 - -

    - - - - - -
    - -
    -

    Tint a texture pixel per pixel.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      the texture to tint

      - -
      - - -
    • - -
    • - - color - Number - - - - -
      -

      the color to use to tint the sprite with

      - -
      - - -
    • - -
    • - - canvas - HTMLCanvasElement - - - - -
      -

      the current canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    tintWithMultiply

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - color - -
    • - -
    • - - canvas - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:58 - -

    - - - - - -
    - -
    -

    Tint a texture using the "multiply" operation.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      the texture to tint

      - -
      - - -
    • - -
    • - - color - Number - - - - -
      -

      the color to use to tint the sprite with

      - -
      - - -
    • - -
    • - - canvas - HTMLCanvasElement - - - - -
      -

      the current canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    tintWithOverlay

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - color - -
    • - -
    • - - canvas - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:104 - -

    - - - - - -
    - -
    -

    Tint a texture using the "overlay" operation.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      the texture to tint

      - -
      - - -
    • - -
    • - - color - Number - - - - -
      -

      the color to use to tint the sprite with

      - -
      - - -
    • - -
    • - - canvas - HTMLCanvasElement - - - - -
      -

      the current canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    cacheStepsPerColorChannel

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:203 - -

    - - - - -
    - -
    -

    Number of steps which will be used as a cap when rounding colors.

    - -
    - - - - - - -
    - - -
    -

    canUseMultiply

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:219 - -

    - - - - -
    - -
    -

    Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method.

    - -
    - - - - - - -
    - - -
    -

    convertTintToImage

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:211 - -

    - - - - -
    - -
    -

    Tint cache boolean flag.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/Circle.html b/tutorial-3/pixi.js-master/docs/classes/Circle.html deleted file mode 100755 index f65b051..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/Circle.html +++ /dev/null @@ -1,955 +0,0 @@ - - - - - Circle - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Circle Class

    -
    - - - - - -
    - Defined in: src/pixi/geom/Circle.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Circle object can be used to specify a hit area for displayObjects

    - -
    - - -
    -

    Constructor

    -
    -

    Circle

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - radius - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the center of this circle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the center of this circle

      - -
      - - -
    • - -
    • - - radius - Number - - - - -
      -

      The radius of the circle

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - -
      - -
    • - radius - - - -
    • - -
    • - x - - - -
    • - -
    • - y - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Circle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:38 - -

    - - - - - -
    - -
    -

    Creates a clone of this Circle instance

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Circle: - -

    a copy of the Circle

    - - -
    -
    - - - -
    - - -
    -

    contains

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:49 - -

    - - - - - -
    - -
    -

    Checks whether the x and y coordinates given are contained within this circle

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the point to test

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the point to test

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Whether the x/y coordinates are within this Circle

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:72 - -

    - - - - - -
    - -
    -

    Returns the framing rectangle of the circle as a PIXI.Rectangle object

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    radius

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:30 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:16 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:23 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/ColorMatrixFilter.html b/tutorial-3/pixi.js-master/docs/classes/ColorMatrixFilter.html deleted file mode 100755 index c1a365b..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/ColorMatrixFilter.html +++ /dev/null @@ -1,839 +0,0 @@ - - - - - ColorMatrixFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    ColorMatrixFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The ColorMatrixFilter class lets you apply a 4x4 matrix transformation on the RGBA -color and alpha values of every pixel on your displayObject to produce a result -with a new set of RGBA color and alpha values. It's pretty powerful!

    - -
    - - -
    -

    Constructor

    -
    -

    ColorMatrixFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ColorMatrixFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    matrix

    - Array and array of 26 numbers - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ColorMatrixFilter.js:46 - -

    - - - - -
    - -
    -

    Sets the matrix of the color matrix filter

    - -
    - - -

    Default: [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]

    - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/ColorStepFilter.html b/tutorial-3/pixi.js-master/docs/classes/ColorStepFilter.html deleted file mode 100755 index 74ec410..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/ColorStepFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - ColorStepFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    ColorStepFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This lowers the color depth of your image by the given amount, producing an image with a smaller palette.

    - -
    - - -
    -

    Constructor

    -
    -

    ColorStepFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ColorStepFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    step

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ColorStepFilter.js:41 - -

    - - - - -
    - -
    -

    The number of steps to reduce the palette by.

    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/ComplexPrimitiveShader.html b/tutorial-3/pixi.js-master/docs/classes/ComplexPrimitiveShader.html deleted file mode 100755 index 7d2a7a7..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/ComplexPrimitiveShader.html +++ /dev/null @@ -1,839 +0,0 @@ - - - - - ComplexPrimitiveShader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    ComplexPrimitiveShader Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    ComplexPrimitiveShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:109 - -

    - - - - - -
    - -
    -

    Destroys the shader.

    - -
    - - - - - - -
    - - -
    -

    init

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:79 - -

    - - - - - -
    - -
    -

    Initialises the shader.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _UID

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:32 - -

    - - - - -
    - -
    -

    The fragment shader.

    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:19 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    program

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:25 - -

    - - - - -
    - -
    -

    The WebGL program.

    - -
    - - - - - - -
    - - -
    -

    vertexSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:48 - -

    - - - - -
    - -
    -

    The vertex shader.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/ConvolutionFilter.html b/tutorial-3/pixi.js-master/docs/classes/ConvolutionFilter.html deleted file mode 100755 index 2177569..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/ConvolutionFilter.html +++ /dev/null @@ -1,1020 +0,0 @@ - - - - - ConvolutionFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    ConvolutionFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The ConvolutionFilter class applies a matrix convolution filter effect. -A convolution combines pixels in the input image with neighboring pixels to produce a new image. -A wide variety of image effects can be achieved through convolutions, including blurring, edge detection, sharpening, embossing, and beveling. -The matrix should be specified as a 9 point Array. See http://docs.gimp.org/en/plug-in-convmatrix.html for more info.

    - -
    - - -
    -

    Constructor

    -
    -

    ConvolutionFilter

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ConvolutionFilter.js:1 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Array - - - - -
      -

      An array of values used for matrix transformation. Specified as a 9 point Array.

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      Width of the object you are transforming

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      Height of the object you are transforming

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ConvolutionFilter.js:93 - -

    - - - - -
    - -
    -

    Height of the object you are transforming

    - -
    - - - - - - -
    - - -
    -

    matrix

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ConvolutionFilter.js:63 - -

    - - - - -
    - -
    -

    An array of values used for matrix transformation. Specified as a 9 point Array.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ConvolutionFilter.js:78 - -

    - - - - -
    - -
    -

    Width of the object you are transforming

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/CrossHatchFilter.html b/tutorial-3/pixi.js-master/docs/classes/CrossHatchFilter.html deleted file mode 100755 index 0f422cc..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/CrossHatchFilter.html +++ /dev/null @@ -1,837 +0,0 @@ - - - - - CrossHatchFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CrossHatchFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A Cross Hatch effect filter.

    - -
    - - -
    -

    Constructor

    -
    -

    CrossHatchFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/CrossHatchFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number the strength of the blur - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/CrossHatchFilter.js:65 - -

    - - - - -
    - -
    -

    Sets the strength of both the blur.

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/DisplacementFilter.html b/tutorial-3/pixi.js-master/docs/classes/DisplacementFilter.html deleted file mode 100755 index 9871925..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/DisplacementFilter.html +++ /dev/null @@ -1,1037 +0,0 @@ - - - - - DisplacementFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    DisplacementFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The DisplacementFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. -You can use this filter to apply all manor of crazy warping effects -Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.

    - -
    - - -
    -

    Constructor

    -
    -

    DisplacementFilter

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DisplacementFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The texture used for the displacement map * must be power of 2 texture at the moment

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    onTextureLoaded

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DisplacementFilter.js:78 - -

    - - - - - -
    - -
    -

    Sets the map dimensions uniforms when the texture becomes available.

    - -
    - - - - - - -
    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    map

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DisplacementFilter.js:91 - -

    - - - - -
    - -
    -

    The texture used for the displacement map. Must be power of 2 texture.

    - -
    - - - - - - -
    - - -
    -

    offset

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DisplacementFilter.js:121 - -

    - - - - -
    - -
    -

    The offset used to move the displacement map.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DisplacementFilter.js:106 - -

    - - - - -
    - -
    -

    The multiplier used to scale the displacement result from the map calculation.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/DisplayObject.html b/tutorial-3/pixi.js-master/docs/classes/DisplayObject.html deleted file mode 100755 index bb55a56..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/DisplayObject.html +++ /dev/null @@ -1,4530 +0,0 @@ - - - - - DisplayObject - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    DisplayObject Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The base class for all objects that are rendered on the screen. -This is an abstract class and should not be used on its own rather it should be extended.

    - -
    - - -
    -

    Constructor

    -
    -

    DisplayObject

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:719 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:705 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    ) -
    - - - - - Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:523 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObject as a rectangle object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Matrix - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:536 - -

    - - - - - -
    - -
    -

    Retrieves the local bounds of the displayObject as a rectangle object

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:547 - -

    - - - - - -
    - -
    -

    Sets the object's stage reference, the stage this object is connected to

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the object will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:188 - -

    - - - - -
    - -
    -

    The original, cached mask of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/DisplayObjectContainer.html b/tutorial-3/pixi.js-master/docs/classes/DisplayObjectContainer.html deleted file mode 100755 index a2f19a5..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/DisplayObjectContainer.html +++ /dev/null @@ -1,5576 +0,0 @@ - - - - - DisplayObjectContainer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    DisplayObjectContainer Class

    -
    - - - -
    - Extends DisplayObject -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A DisplayObjectContainer represents a collection of display objects. -It is the base class of all display objects that act as a container for other objects.

    - -
    - - -
    -

    Constructor

    -
    -

    DisplayObjectContainer

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/DotScreenFilter.html b/tutorial-3/pixi.js-master/docs/classes/DotScreenFilter.html deleted file mode 100755 index dc7b6d7..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/DotScreenFilter.html +++ /dev/null @@ -1,887 +0,0 @@ - - - - - DotScreenFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    DotScreenFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This filter applies a dotscreen effect making display objects appear to be made out of black and white halftone dots like an old printer.

    - -
    - - -
    -

    Constructor

    -
    -

    DotScreenFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DotScreenFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    angle

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DotScreenFilter.js:72 - -

    - - - - -
    - -
    -

    The radius of the effect.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DotScreenFilter.js:57 - -

    - - - - -
    - -
    -

    The scale of the effect.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/Ellipse.html b/tutorial-3/pixi.js-master/docs/classes/Ellipse.html deleted file mode 100755 index 8c53367..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/Ellipse.html +++ /dev/null @@ -1,1030 +0,0 @@ - - - - - Ellipse - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Ellipse Class

    -
    - - - - - -
    - Defined in: src/pixi/geom/Ellipse.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Ellipse object can be used to specify a hit area for displayObjects

    - -
    - - -
    -

    Constructor

    -
    -

    Ellipse

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the center of the ellipse

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the center of the ellipse

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The half width of this ellipse

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The half height of this ellipse

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - -
      - -
    • - height - - - -
    • - -
    • - width - - - -
    • - -
    • - x - - - -
    • - -
    • - y - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Ellipse - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:46 - -

    - - - - - -
    - -
    -

    Creates a clone of this Ellipse instance

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Ellipse: - -

    a copy of the ellipse

    - - -
    -
    - - - -
    - - -
    -

    contains

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:57 - -

    - - - - - -
    - -
    -

    Checks whether the x and y coordinates given are contained within this ellipse

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the point to test

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the point to test

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Whether the x/y coords are within this ellipse

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:80 - -

    - - - - - -
    - -
    -

    Returns the framing rectangle of the ellipse as a PIXI.Rectangle object

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:38 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:31 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:17 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:24 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/Event.html b/tutorial-3/pixi.js-master/docs/classes/Event.html deleted file mode 100755 index 417223d..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/Event.html +++ /dev/null @@ -1,946 +0,0 @@ - - - - - Event - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Event Class

    -
    - - - -
    - Extends Object -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    Creates an homogenous object for tracking events so users can know what to expect.

    - -
    - - -
    -

    Constructor

    -
    -

    Event

    - - -
    - (
      - -
    • - - target - -
    • - -
    • - - name - -
    • - -
    • - - data - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:192 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - target - Object - - - - -
      -

      The target object that the event is called on

      - -
      - - -
    • - -
    • - - name - String - - - - -
      -

      The string name of the event that was triggered

      - -
      - - -
    • - -
    • - - data - Object - - - - -
      -

      Arbitrary event data to pass along

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    stopImmediatePropagation

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:277 - -

    - - - - - -
    - -
    -

    Stops the propagation of events to sibling listeners (no longer calls any listeners).

    - -
    - - - - - - -
    - - -
    -

    stopPropagation

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:268 - -

    - - - - - -
    - -
    -

    Stops the propagation of events up the scene graph (prevents bubbling).

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    data

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:246 - -

    - - - - -
    - -
    -

    The data that was passed in with this event.

    - -
    - - - - - - -
    - - -
    -

    stopped

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:206 - -

    - - - - -
    - -
    -

    Tracks the state of bubbling propagation. Do not -set this directly, instead use event.stopPropagation()

    - -
    - - - - - - -
    - - -
    -

    stoppedImmediate

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:217 - -

    - - - - -
    - -
    -

    Tracks the state of sibling listener propagation. Do not -set this directly, instead use event.stopImmediatePropagation()

    - -
    - - - - - - -
    - - -
    -

    target

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:228 - -

    - - - - -
    - -
    -

    The original target the event triggered on.

    - -
    - - - - - - -
    - - -
    -

    timeStamp

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:258 - -

    - - - - -
    - -
    -

    The timestamp when the event occurred.

    - -
    - - - - - - -
    - - -
    -

    type

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:237 - -

    - - - - -
    - -
    -

    The string name of the event that this represents.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/EventTarget.html b/tutorial-3/pixi.js-master/docs/classes/EventTarget.html deleted file mode 100755 index caab8e5..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/EventTarget.html +++ /dev/null @@ -1,1123 +0,0 @@ - - - - - EventTarget - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    EventTarget Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    Mixins event emitter functionality to a class

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/FilterBlock.html b/tutorial-3/pixi.js-master/docs/classes/FilterBlock.html deleted file mode 100755 index 381971a..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/FilterBlock.html +++ /dev/null @@ -1,510 +0,0 @@ - - - - - FilterBlock - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    FilterBlock Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A target and pass info object for filters.

    - -
    - - -
    -

    Constructor

    -
    -

    FilterBlock

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/FilterBlock.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - - - -
    -

    Properties

    - - -
    - - - - - -
    - - - - -
    -

    Properties

    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/FilterBlock.js:21 - -

    - - - - -
    - -
    -

    The renderable state of this FilterBlock.

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/FilterBlock.js:13 - -

    - - - - -
    - -
    -

    The visible state of this FilterBlock.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/FilterTexture.html b/tutorial-3/pixi.js-master/docs/classes/FilterTexture.html deleted file mode 100755 index fa30bda..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/FilterTexture.html +++ /dev/null @@ -1,967 +0,0 @@ - - - - - FilterTexture - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    FilterTexture Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    FilterTexture

    - - -
    - (
      - -
    • - - gl - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      the horizontal range of the filter

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the vertical range of the filter

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clear

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:61 - -

    - - - - - -
    - -
    -

    Clears the filter texture.

    - -
    - - - - - - -
    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:97 - -

    - - - - - -
    - -
    -

    Destroys the filter texture.

    - -
    - - - - - - -
    - - -
    -

    resize

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:74 - -

    - - - - - -
    - -
    -

    Resizes the texture to the specified width and height

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      the new width of the texture

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the new height of the texture

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    frameBuffer

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:23 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:15 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    scaleMode

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:35 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    texture

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:29 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/Graphics.html b/tutorial-3/pixi.js-master/docs/classes/Graphics.html deleted file mode 100755 index 2d012fa..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/Graphics.html +++ /dev/null @@ -1,8669 +0,0 @@ - - - - - Graphics - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Graphics Class

    -
    - - - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and color and fill them.

    - -
    - - -
    -

    Constructor

    -
    -

    Graphics

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:983 - -

    - - - - - -
    - -
    -

    Generates the cached sprite when the sprite has cacheAsBitmap = true

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:736 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:656 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    arc

    - - -
    - (
      - -
    • - - cx - -
    • - -
    • - - cy - -
    • - -
    • - - radius - -
    • - -
    • - - startAngle - -
    • - -
    • - - endAngle - -
    • - -
    • - - anticlockwise - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:414 - -

    - - - - - -
    - -
    -

    The arc method creates an arc/curve (used to create circles, or parts of circles).

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - cx - Number - - - - -
      -

      The x-coordinate of the center of the circle

      - -
      - - -
    • - -
    • - - cy - Number - - - - -
      -

      The y-coordinate of the center of the circle

      - -
      - - -
    • - -
    • - - radius - Number - - - - -
      -

      The radius of the circle

      - -
      - - -
    • - -
    • - - startAngle - Number - - - - -
      -

      The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle)

      - -
      - - -
    • - -
    • - - endAngle - Number - - - - -
      -

      The ending angle, in radians

      - -
      - - -
    • - -
    • - - anticlockwise - Boolean - - - - -
      -

      Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    beginFill

    - - -
    - (
      - -
    • - - color - -
    • - -
    • - - alpha - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:488 - -

    - - - - - -
    - -
    -

    Specifies a simple one-color fill that subsequent calls to other Graphics methods -(such as lineTo() or drawCircle()) use when drawing.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - color - Number - - - - -
      -

      the color of the fill

      - -
      - - -
    • - -
    • - - alpha - Number - - - - -
      -

      the alpha of the fill

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    bezierCurveTo

    - - -
    - (
      - -
    • - - cpX - -
    • - -
    • - - cpY - -
    • - -
    • - - cpX2 - -
    • - -
    • - - cpY2 - -
    • - -
    • - - toX - -
    • - -
    • - - toY - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:287 - -

    - - - - - -
    - -
    -

    Calculate the points for a bezier curve and then draws it.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - cpX - Number - - - - -
      -

      Control point x

      - -
      - - -
    • - -
    • - - cpY - Number - - - - -
      -

      Control point y

      - -
      - - -
    • - -
    • - - cpX2 - Number - - - - -
      -

      Second Control point x

      - -
      - - -
    • - -
    • - - cpY2 - Number - - - - -
      -

      Second Control point y

      - -
      - - -
    • - -
    • - - toX - Number - - - - -
      -

      Destination point x

      - -
      - - -
    • - -
    • - - toY - Number - - - - -
      -

      Destination point y

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    clear

    - - - () - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:609 - -

    - - - - - -
    - -
    -

    Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    destroyCachedSprite

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:1047 - -

    - - - - - -
    - -
    -

    Destroys a previous cached sprite.

    - -
    - - - - - - -
    - - -
    -

    drawCircle

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - radius - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:562 - -

    - - - - - -
    - -
    -

    Draws a circle.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the center of the circle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the center of the circle

      - -
      - - -
    • - -
    • - - radius - Number - - - - -
      -

      The radius of the circle

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    drawEllipse

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:578 - -

    - - - - - -
    - -
    -

    Draws an ellipse.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the center of the ellipse

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the center of the ellipse

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The half width of the ellipse

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The half height of the ellipse

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    drawPolygon

    - - -
    - (
      - -
    • - - path - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:595 - -

    - - - - - -
    - -
    -

    Draws a polygon using the given path.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - path - Array - - - - -
      -

      The path data used to construct the polygon.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    drawRect

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:530 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coord of the top-left of the rectangle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coord of the top-left of the rectangle

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The width of the rectangle

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The height of the rectangle

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    drawRoundedRect

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    • - - radius - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:546 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coord of the top-left of the rectangle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coord of the top-left of the rectangle

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The width of the rectangle

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The height of the rectangle

      - -
      - - -
    • - -
    • - - radius - Number - - - - -
      -

      Radius of the rectangle corners

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    drawShape

    - - -
    - (
      - -
    • - - shape - -
    • - -
    ) -
    - - - - - GraphicsData - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:1061 - -

    - - - - - -
    - -
    -

    Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - -
    -

    Returns:

    - -
    - - - GraphicsData: - -

    The generated GraphicsData object.

    - - -
    -
    - - - -
    - - -
    -

    endFill

    - - - () - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:515 - -

    - - - - - -
    - -
    -

    Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:627 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the graphics object that can then be used to create sprites -This can be quite useful if your geometry is complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:805 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the graphic shape as a rectangle object

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    lineStyle

    - - -
    - (
      - -
    • - - lineWidth - -
    • - -
    • - - color - -
    • - -
    • - - alpha - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:171 - -

    - - - - - -
    - -
    -

    Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - lineWidth - Number - - - - -
      -

      width of the line to draw, will update the objects stored style

      - -
      - - -
    • - -
    • - - color - Number - - - - -
      -

      color of the line to draw, will update the objects stored style

      - -
      - - -
    • - -
    • - - alpha - Number - - - - -
      -

      alpha of the line to draw, will update the objects stored style

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    lineTo

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:220 - -

    - - - - - -
    - -
    -

    Draws a line using the current line style from the current drawing position to (x, y); -The current drawing position is then set to (x, y).

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      the X coordinate to draw to

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      the Y coordinate to draw to

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    moveTo

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:205 - -

    - - - - - -
    - -
    -

    Moves the current drawing position to x, y.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      the X coordinate to move to

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      the Y coordinate to move to

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    quadraticCurveTo

    - - -
    - (
      - -
    • - - cpX - -
    • - -
    • - - cpY - -
    • - -
    • - - toX - -
    • - -
    • - - toY - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:237 - -

    - - - - - -
    - -
    -

    Calculate the points for a quadratic bezier curve and then draws it. -Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - cpX - Number - - - - -
      -

      Control point x

      - -
      - - -
    • - -
    • - - cpY - Number - - - - -
      -

      Control point y

      - -
      - - -
    • - -
    • - - toX - Number - - - - -
      -

      Destination point x

      - -
      - - -
    • - -
    • - - toY - Number - - - - -
      -

      Destination point y

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    -

    updateCachedSpriteTexture

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:1023 - -

    - - - - - -
    - -
    -

    Updates texture size based on canvas size

    - -
    - - - - - - -
    - - -
    -

    updateLocalBounds

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:884 - -

    - - - - - -
    - -
    -

    Update the bounds of the object

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _webGL

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:79 - -

    - - - - -
    - -
    -

    Array containing some WebGL-related properties used by the WebGL renderer.

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    blendMode

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:61 - -

    - - - - -
    - -
    -

    The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode.

    - -
    - - -

    Default: PIXI.blendModes.NORMAL;

    - - - - - -
    - - -
    -

    boundsPadding

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:96 - -

    - - - - -
    - -
    -

    The bounds' padding used for bounds calculation.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:139 - -

    - - - - -
    - -
    -

    When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. -This is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory. -It is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas. -This is not recommended if you are constantly redrawing the graphics element.

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    cachedSpriteDirty

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:124 - -

    - - - - -
    - -
    -

    Used to detect if the cached sprite object needs to be updated.

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    currentPath

    - Object - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:70 - -

    - - - - -
    - -
    -

    Current path

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:106 - -

    - - - - -
    - -
    -

    Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated.

    - -
    - - - - - - -
    - - -
    -

    fillAlpha

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:18 - -

    - - - - -
    - -
    -

    The alpha value used when filling the Graphics object.

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    graphicsData

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:43 - -

    - - - - -
    - -
    -

    Graphics data

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    isMask

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:88 - -

    - - - - -
    - -
    -

    Whether this shape is being used as a mask.

    - -
    - - - - - - -
    - - -
    -

    lineColor

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:34 - -

    - - - - -
    - -
    -

    The color of any lines drawn.

    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    lineWidth

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:26 - -

    - - - - -
    - -
    -

    The width (thickness) of any lines drawn.

    - -
    - - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    tint

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:52 - -

    - - - - -
    - -
    -

    The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint.

    - -
    - - -

    Default: 0xFFFFFF

    - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    webGLDirty

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:115 - -

    - - - - -
    - -
    -

    Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/GraphicsData.html b/tutorial-3/pixi.js-master/docs/classes/GraphicsData.html deleted file mode 100755 index dc8ff74..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/GraphicsData.html +++ /dev/null @@ -1,390 +0,0 @@ - - - - - GraphicsData - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    GraphicsData Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A GraphicsData object.

    - -
    - - -
    -

    Constructor

    -
    -

    GraphicsData

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:1093 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - - - - - - - -
    - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/GrayFilter.html b/tutorial-3/pixi.js-master/docs/classes/GrayFilter.html deleted file mode 100755 index cbf95ad..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/GrayFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - GrayFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    GrayFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This greyscales the palette of your Display Objects.

    - -
    - - -
    -

    Constructor

    -
    -

    GrayFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/GrayFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    gray

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/GrayFilter.js:41 - -

    - - - - -
    - -
    -

    The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/ImageLoader.html b/tutorial-3/pixi.js-master/docs/classes/ImageLoader.html deleted file mode 100755 index 6b068d2..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/ImageLoader.html +++ /dev/null @@ -1,1613 +0,0 @@ - - - - - ImageLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    ImageLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    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.fromFrame() and PIXI.Sprite.fromFrame() -When loaded this class will dispatch a 'loaded' event

    - -
    - - -
    -

    Constructor

    -
    -

    ImageLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the image

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:42 - -

    - - - - - -
    - -
    -

    Loads image or takes it from cache

    - -
    - - - - - - -
    - - -
    -

    loadFramedSpriteSheet

    - - -
    - (
      - -
    • - - frameWidth - -
    • - -
    • - - frameHeight - -
    • - -
    • - - textureName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:70 - -

    - - - - - -
    - -
    -

    Loads image and split it to uniform sized frames

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frameWidth - Number - - - - -
      -

      width of each frame

      - -
      - - -
    • - -
    • - - frameHeight - Number - - - - -
      -

      height of each frame

      - -
      - - -
    • - -
    • - - textureName - String - - - - -
      -

      if given, the frames will be cached in - format

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:59 - -

    - - - - - -
    - -
    -

    Invoked when image file is loaded or it is already cached and ready to use

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    frames

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:26 - -

    - - - - -
    - -
    -

    if the image is loaded with loadFramedSpriteSheet -frames will contain the sprite sheet frames

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:18 - -

    - - - - -
    - -
    -

    The texture being loaded

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/InteractionData.html b/tutorial-3/pixi.js-master/docs/classes/InteractionData.html deleted file mode 100755 index b31635a..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/InteractionData.html +++ /dev/null @@ -1,715 +0,0 @@ - - - - - InteractionData - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    InteractionData Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    Holds all information related to an Interaction event

    - -
    - - -
    -

    Constructor

    -
    -

    InteractionData

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionData.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    getLocalPosition

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - [point] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionData.js:38 - -

    - - - - - -
    - -
    -

    This will return the local coordinates of the specified displayObject for this InteractionData

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      The DisplayObject that you would like the local coords off

      - -
      - - -
    • - -
    • - - [point] - Point - optional - - - - -
      -

      A Point object in which to store the value, optional (otherwise will create a new point)

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point containing the coordinates of the InteractionData position relative to the DisplayObject

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    global

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionData.js:13 - -

    - - - - -
    - -
    -

    This point stores the global coords of where the touch/mouse event happened

    - -
    - - - - - - -
    - - -
    -

    originalEvent

    - Event - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionData.js:29 - -

    - - - - -
    - -
    -

    When passed to an event handler, this will be the original DOM Event that was captured

    - -
    - - - - - - -
    - - -
    -

    target

    - Sprite - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionData.js:21 - -

    - - - - -
    - -
    -

    The target Sprite that was interacted with

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/InteractionManager.html b/tutorial-3/pixi.js-master/docs/classes/InteractionManager.html deleted file mode 100755 index 952b5f9..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/InteractionManager.html +++ /dev/null @@ -1,2755 +0,0 @@ - - - - - InteractionManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    InteractionManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive -if its interactive parameter is set to true -This manager also supports multitouch.

    - -
    - - -
    -

    Constructor

    -
    -

    InteractionManager

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      The stage to handle interactions

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    collectInteractiveSprite

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - iParent - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:152 - -

    - - - - - -
    - -
    -

    Collects an interactive sprite recursively to have their interactions managed

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      the displayObject to collect

      - -
      - - -
    • - -
    • - - iParent - DisplayObject - - - - -
      -

      the display object's parent

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    hitTest

    - - -
    - (
      - -
    • - - item - -
    • - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:586 - -

    - - - - - -
    - -
    -

    Tests if the current mouse coordinates hit a sprite

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - item - DisplayObject - - - - -
      -

      The displayObject to test for a hit

      - -
      - - -
    • - -
    • - - interactionData - InteractionData - - - - -
      -

      The interactionData object to update in the case there is a hit

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onMouseDown

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:416 - -

    - - - - - -
    - -
    -

    Is called when the mouse button is pressed down on the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a mouse button being pressed down

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onMouseMove

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:380 - -

    - - - - - -
    - -
    -

    Is called when the mouse moves across the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of the mouse moving

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onMouseOut

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:477 - -

    - - - - - -
    - -
    -

    Is called when the mouse is moved out of the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a mouse being moved out

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onMouseUp

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:518 - -

    - - - - - -
    - -
    -

    Is called when the mouse button is released on the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a mouse button being released

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onTouchEnd

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:798 - -

    - - - - - -
    - -
    -

    Is called when a touch is ended on the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a touch ending on the renderer view

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onTouchMove

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:683 - -

    - - - - - -
    - -
    -

    Is called when a touch is moved across the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a touch moving across the renderer view

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onTouchStart

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:729 - -

    - - - - - -
    - -
    -

    Is called when a touch is started on the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a touch starting on the renderer view

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    rebuildInteractiveGraph

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:355 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    removeEvents

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:245 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    setTarget

    - - -
    - (
      - -
    • - - target - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:193 - -

    - - - - - -
    - -
    -

    Sets the target for event delegation

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setTargetDomElement

    - - -
    - (
      - -
    • - - domElement - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:211 - -

    - - - - - -
    - -
    -

    Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM -elements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element -to receive those events

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - domElement - DOMElement - - - - -
      -

      the DOM element which will receive mouse and touch events

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    update

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:270 - -

    - - - - - -
    - -
    -

    updates the state of interactive objects

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    currentCursorStyle

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:128 - -

    - - - - -
    - -
    -

    The css style of the cursor that is being used

    - -
    - - - - - - -
    - - -
    -

    interactionDOMElement

    - HTMLCanvasElement - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:70 - -

    - - - - -
    - -
    -

    Our canvas

    - -
    - - - - - - -
    - - -
    -

    interactiveItems

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:62 - -

    - - - - -
    - -
    -

    An array containing all the iterative items from the our interactive tree

    - -
    - - - - - - -
    - - -
    -

    last

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:122 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    mouse

    - InteractionData - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:24 - -

    - - - - -
    - -
    -

    The mouse data

    - -
    - - - - - - -
    - - -
    -

    mouseOut

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:135 - -

    - - - - -
    - -
    -

    Is set to true when the mouse is moved out of the canvas

    - -
    - - - - - - -
    - - -
    -

    mouseoverEnabled

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:47 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onMouseDown

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:86 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onMouseMove

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:80 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onMouseOut

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:92 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onMouseUp

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:98 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onTouchEnd

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:110 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onTouchMove

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:116 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onTouchStart

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:104 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    pool

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:54 - -

    - - - - -
    - -
    -

    Tiny little interactiveData pool !

    - -
    - - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:142 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:16 - -

    - - - - -
    - -
    -

    A reference to the stage

    - -
    - - - - - - -
    - - -
    -

    tempPoint

    - Point - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:40 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    touches

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:32 - -

    - - - - -
    - -
    -

    An object that stores current touches (InteractionData) by id reference

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/InvertFilter.html b/tutorial-3/pixi.js-master/docs/classes/InvertFilter.html deleted file mode 100755 index 458f3a4..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/InvertFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - InvertFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    InvertFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This inverts your Display Objects colors.

    - -
    - - -
    -

    Constructor

    -
    -

    InvertFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/InvertFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    invert

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/InvertFilter.js:42 - -

    - - - - -
    - -
    -

    The strength of the invert. 1 will fully invert the colors, 0 will make the object its normal color

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/JsonLoader.html b/tutorial-3/pixi.js-master/docs/classes/JsonLoader.html deleted file mode 100755 index 30fbfb4..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/JsonLoader.html +++ /dev/null @@ -1,1704 +0,0 @@ - - - - - JsonLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    JsonLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The json file loader is used to load in JSON data and parse it -When loaded this class will dispatch a 'loaded' event -If loading fails this class will dispatch an 'error' event

    - -
    - - -
    -

    Constructor

    -
    -

    JsonLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the JSON file

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:59 - -

    - - - - - -
    - -
    -

    Loads the JSON data

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onError

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:176 - -

    - - - - - -
    - -
    -

    Invoked if an error occurs.

    - -
    - - - - - - -
    - - -
    -

    onJSONLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:98 - -

    - - - - - -
    - -
    -

    Invoked when the JSON file is loaded.

    - -
    - - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:162 - -

    - - - - - -
    - -
    -

    Invoked when the json file has loaded.

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    baseUrl

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:34 - -

    - - - - -
    - -
    -

    [read-only] The base url of the bitmap font data

    - -
    - - - - - - -
    - - -
    -

    crossorigin

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:26 - -

    - - - - -
    - -
    -

    Whether the requests should be treated as cross origin

    - -
    - - - - - - -
    - - -
    -

    loaded

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:43 - -

    - - - - -
    - -
    -

    [read-only] Whether the data has loaded yet

    - -
    - - - - - - -
    - - -
    -

    url

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:18 - -

    - - - - -
    - -
    -

    The url of the bitmap font data

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/Matrix.html b/tutorial-3/pixi.js-master/docs/classes/Matrix.html deleted file mode 100755 index 8909572..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/Matrix.html +++ /dev/null @@ -1,1813 +0,0 @@ - - - - - Matrix - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Matrix Class

    -
    - - - - - -
    - Defined in: src/pixi/geom/Matrix.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Matrix class is now an object, which makes it a lot faster, -here is a representation of it : -| a | b | tx| -| c | d | ty| -| 0 | 0 | 1 |

    - -
    - - -
    -

    Constructor

    -
    -

    Matrix

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - -
      - -
    • - a - - - -
    • - -
    • - b - - - -
    • - -
    • - c - - - -
    • - -
    • - d - - - -
    • - -
    • - tx - - - -
    • - -
    • - ty - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    append

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    ) -
    - - - - - Matrix - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:225 - -

    - - - - - -
    - -
    -

    Appends the given Matrix to this Matrix.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Matrix - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Matrix: - -

    This matrix. Good for chaining method calls.

    - - -
    -
    - - - -
    - - -
    -

    apply

    - - -
    - (
      - -
    • - - pos - -
    • - -
    • - - [newPos] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:123 - -

    - - - - - -
    - -
    -

    Get a new position with the current transformation applied. -Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - pos - Point - - - - -
      -

      The origin

      - -
      - - -
    • - -
    • - - [newPos] - Point - optional - - - - -
      -

      The point that the new position is assigned to (allowed to be same as input)

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    The new point, transformed through this matrix

    - - -
    -
    - - - -
    - - -
    -

    applyInverse

    - - -
    - (
      - -
    • - - pos - -
    • - -
    • - - [newPos] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:142 - -

    - - - - - -
    - -
    -

    Get a new position with the inverse of the current transformation applied. -Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - pos - Point - - - - -
      -

      The origin

      - -
      - - -
    • - -
    • - - [newPos] - Point - optional - - - - -
      -

      The point that the new position is assigned to (allowed to be same as input)

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    The new point, inverse-transformed through this matrix

    - - -
    -
    - - - -
    - - -
    -

    fromArray

    - - -
    - (
      - -
    • - - array - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:60 - -

    - - - - - -
    - -
    -

    Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:

    -

    a = array[0] -b = array[1] -c = array[3] -d = array[4] -tx = array[2] -ty = array[5]

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - array - Array - - - - -
      -

      The array that the matrix will be populated from.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    identity

    - - - () - - - - - Matrix - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:250 - -

    - - - - - -
    - -
    -

    Resets this Matix to an identity (default) matrix.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Matrix: - -

    This matrix. Good for chaining method calls.

    - - -
    -
    - - - -
    - - -
    -

    rotate

    - - -
    - (
      - -
    • - - angle - -
    • - -
    ) -
    - - - - - Matrix - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:200 - -

    - - - - - -
    - -
    -

    Applies a rotation transformation to the matrix.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - angle - Number - - - - -
      -

      The angle in radians.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Matrix: - -

    This matrix. Good for chaining method calls.

    - - -
    -
    - - - -
    - - -
    -

    scale

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Matrix - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:179 - -

    - - - - - -
    - -
    -

    Applies a scale transformation to the matrix.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The amount to scale horizontally

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The amount to scale vertically

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Matrix: - -

    This matrix. Good for chaining method calls.

    - - -
    -
    - - - -
    - - -
    -

    toArray

    - - -
    - (
      - -
    • - - transpose - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:83 - -

    - - - - - -
    - -
    -

    Creates an array from the current Matrix object.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - transpose - Boolean - - - - -
      -

      Whether we need to transpose the matrix or not

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    the newly created array which contains the matrix

    - - -
    -
    - - - -
    - - -
    -

    translate

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Matrix - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:163 - -

    - - - - - -
    - -
    -

    Translates the matrix on the x and y.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      - -
      - - -
    • - -
    • - - y - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Matrix: - -

    This matrix. Good for chaining method calls.

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    a

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:17 - -

    - - - - -
    - -
    - -
    - - -

    Default: 1

    - - - - - -
    - - -
    -

    b

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:24 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    c

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:31 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    d

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:38 - -

    - - - - -
    - -
    - -
    - - -

    Default: 1

    - - - - - -
    - - -
    -

    tx

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:45 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    ty

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:52 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/MovieClip.html b/tutorial-3/pixi.js-master/docs/classes/MovieClip.html deleted file mode 100755 index 6ff435e..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/MovieClip.html +++ /dev/null @@ -1,7042 +0,0 @@ - - - - - MovieClip - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    MovieClip Class

    -
    - - - -
    - Extends Sprite -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    - -
    - - -
    -

    Constructor

    -
    -

    MovieClip

    - - -
    - (
      - -
    • - - textures - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - textures - Array - - - - -
      -

      an array of {Texture} objects that make up the animation

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:305 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:242 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    fromFrames

    - - -
    - (
      - -
    • - - frames - -
    • - -
    ) -
    - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:169 - -

    - - - - - -
    - -
    -

    A short hand way of creating a movieclip from an array of frame ids

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frames - Array - - - - -
      -

      the array of frames ids the movieclip will use as its texture frames

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    fromImages

    - - -
    - (
      - -
    • - - frames - -
    • - -
    ) -
    - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:188 - -

    - - - - - -
    - -
    -

    A short hand way of creating a movieclip from an array of image ids

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frames - Array - - - - -
      -

      the array of image ids the movieclip will use as its texture frames

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    ) -
    - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:163 - -

    - - - - - -
    - -
    -

    Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Matrix - - - - -
      -

      the transformation matrix of the sprite

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    gotoAndPlay

    - - -
    - (
      - -
    • - - frameNumber - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:125 - -

    - - - - - -
    - -
    -

    Goes to a specific frame and begins playing the MovieClip

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frameNumber - Number - - - - -
      -

      frame index to start at

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    gotoAndStop

    - - -
    - (
      - -
    • - - frameNumber - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:111 - -

    - - - - - -
    - -
    -

    Stops the MovieClip and goes to a specific frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frameNumber - Number - - - - -
      -

      frame index to stop at

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:147 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    play

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:101 - -

    - - - - - -
    - -
    -

    Plays the MovieClip

    - -
    - - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setTexture

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:135 - -

    - - - - - -
    - -
    -

    Sets the texture of the sprite

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The PIXI texture that is displayed by the sprite

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    stop

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:91 - -

    - - - - - -
    - -
    -

    Stops the MovieClip

    - -
    - - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _height

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:50 - -

    - - - - -
    - -
    -

    The height of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _width

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:41 - -

    - - - - -
    - -
    -

    The width of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    anchor

    - Point - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:22 - -

    - - - - -
    - -
    -

    The anchor sets the origin point of the texture. -The default is 0,0 this means the texture's origin is the top left -Setting than anchor to 0.5,0.5 means the textures origin is centered -Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner

    - -
    - - - - - - -
    - - -
    -

    animationSpeed

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:25 - -

    - - - - -
    - -
    -

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    - -
    - - -

    Default: 1

    - - - - - -
    - - -
    -

    blendMode

    - Number - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:68 - -

    - - - - -
    - -
    -

    The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.

    - -
    - - -

    Default: PIXI.blendModes.NORMAL;

    - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    currentFrame

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:51 - -

    - - - - -
    - -
    -

    [read-only] The MovieClips current frame index (this may not have to be a whole number)

    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/display/Sprite.js:119 - -

    - - - - -
    - -
    -

    The height of the sprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    loop

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:34 - -

    - - - - -
    - -
    -

    Whether or not the movie clip repeats after playing.

    - -
    - - -

    Default: true

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    onComplete

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:43 - -

    - - - - -
    - -
    -

    Function to call when a MovieClip finishes playing

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    playing

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:61 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the MovieClip is currently playing

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    shader

    - PIXI.AbstractFilter - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:77 - -

    - - - - -
    - -
    -

    The shader that will be used to render the texture to the stage. Set to null to remove a current shader.

    - -
    - - -

    Default: null

    - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:33 - -

    - - - - -
    - -
    -

    The texture that the sprite is using

    - -
    - - - - - - -
    - - -
    -

    textures

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:17 - -

    - - - - -
    - -
    -

    The array of textures that make up the animation

    - -
    - - - - - - -
    - - -
    -

    tint

    - Number - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:59 - -

    - - - - -
    - -
    -

    The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.

    - -
    - - -

    Default: 0xFFFFFF

    - - - - - -
    - - -
    -

    totalFrames

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:75 - -

    - - - - -
    - -
    -

    [read-only] totalFrames is the total number of frames in the MovieClip. This is the same as number of textures -assigned to the MovieClip.

    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/display/Sprite.js:103 - -

    - - - - -
    - -
    -

    The width of the sprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/NoiseFilter.html b/tutorial-3/pixi.js-master/docs/classes/NoiseFilter.html deleted file mode 100755 index 0a2e317..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/NoiseFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - NoiseFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    NoiseFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A Noise effect filter.

    - -
    - - -
    -

    Constructor

    -
    -

    NoiseFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NoiseFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    noise

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NoiseFilter.js:49 - -

    - - - - -
    - -
    -

    The amount of noise to apply.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/NormalMapFilter.html b/tutorial-3/pixi.js-master/docs/classes/NormalMapFilter.html deleted file mode 100755 index f553ab2..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/NormalMapFilter.html +++ /dev/null @@ -1,1037 +0,0 @@ - - - - - NormalMapFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    NormalMapFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The NormalMapFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. -You can use this filter to apply all manor of crazy warping effects -Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.

    - -
    - - -
    -

    Constructor

    -
    -

    NormalMapFilter

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NormalMapFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The texture used for the displacement map * must be power of 2 texture at the moment

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    onTextureLoaded

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NormalMapFilter.js:140 - -

    - - - - - -
    - -
    -

    Sets the map dimensions uniforms when the texture becomes available.

    - -
    - - - - - - -
    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    map

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NormalMapFilter.js:153 - -

    - - - - -
    - -
    -

    The texture used for the displacement map. Must be power of 2 texture.

    - -
    - - - - - - -
    - - -
    -

    offset

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NormalMapFilter.js:183 - -

    - - - - -
    - -
    -

    The offset used to move the displacement map.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NormalMapFilter.js:168 - -

    - - - - -
    - -
    -

    The multiplier used to scale the displacement result from the map calculation.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/PixelateFilter.html b/tutorial-3/pixi.js-master/docs/classes/PixelateFilter.html deleted file mode 100755 index 50fd174..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/PixelateFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - PixelateFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PixelateFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This filter applies a pixelate effect making display objects appear 'blocky'.

    - -
    - - -
    -

    Constructor

    -
    -

    PixelateFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/PixelateFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    size

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/PixelateFilter.js:48 - -

    - - - - -
    - -
    -

    This a point that describes the size of the blocks. x is the width of the block and y is the height.

    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/PixiFastShader.html b/tutorial-3/pixi.js-master/docs/classes/PixiFastShader.html deleted file mode 100755 index 5c0596a..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/PixiFastShader.html +++ /dev/null @@ -1,891 +0,0 @@ - - - - - PixiFastShader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PixiFastShader Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    PixiFastShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:143 - -

    - - - - - -
    - -
    -

    Destroys the shader.

    - -
    - - - - - - -
    - - -
    -

    init

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:94 - -

    - - - - - -
    - -
    -

    Initialises the shader.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _UID

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:32 - -

    - - - - -
    - -
    -

    The fragment shader.

    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:19 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    program

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:25 - -

    - - - - -
    - -
    -

    The WebGL program.

    - -
    - - - - - - -
    - - -
    -

    textureCount

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:82 - -

    - - - - -
    - -
    -

    A local texture counter for multi-texture shaders.

    - -
    - - - - - - -
    - - -
    -

    vertexSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:47 - -

    - - - - -
    - -
    -

    The vertex shader.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/PixiShader.html b/tutorial-3/pixi.js-master/docs/classes/PixiShader.html deleted file mode 100755 index 79f93ed..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/PixiShader.html +++ /dev/null @@ -1,1239 +0,0 @@ - - - - - PixiShader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PixiShader Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    PixiShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:6 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:351 - -

    - - - - - -
    - -
    -

    Destroys the shader.

    - -
    - - - - - - -
    - - -
    -

    init

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:83 - -

    - - - - - -
    - -
    -

    Initialises the shader.

    - -
    - - - - - - -
    - - -
    -

    initSampler2D

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:208 - -

    - - - - - -
    - -
    -

    Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded)

    - -
    - - - - - - -
    - - -
    -

    initUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:134 - -

    - - - - - -
    - -
    -

    Initialises the shader uniform values.

    -

    Uniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/ -http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf

    - -
    - - - - - - -
    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:283 - -

    - - - - - -
    - -
    -

    Updates the shader uniform values.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _UID

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:13 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    attributes

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:70 - -

    - - - - -
    - -
    -

    Uniform attributes cache.

    - -
    - - - - - - -
    - - -
    -

    defaultVertexSrc

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:365 - -

    - - - - -
    - -
    -

    The Default Vertex shader source.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:63 - -

    - - - - -
    - -
    -

    A dirty flag

    - -
    - - - - - - -
    - - -
    -

    firstRun

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:55 - -

    - - - - -
    - -
    -

    A local flag

    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:33 - -

    - - - - -
    - -
    -

    The fragment shader.

    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:20 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    program

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:26 - -

    - - - - -
    - -
    -

    The WebGL program.

    - -
    - - - - - - -
    - - -
    -

    textureCount

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:48 - -

    - - - - -
    - -
    -

    A local texture counter for multi-texture shaders.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/Point.html b/tutorial-3/pixi.js-master/docs/classes/Point.html deleted file mode 100755 index d2030b9..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/Point.html +++ /dev/null @@ -1,785 +0,0 @@ - - - - - Point - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Point Class

    -
    - - - - - -
    - Defined in: src/pixi/geom/Point.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    - -
    - - -
    -

    Constructor

    -
    -

    Point

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Point.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      position of the point on the x axis

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      position of the point on the y axis

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - -
      - -
    • - clone - - - -
    • - -
    • - set - - - -
    • - -
    -
    - - - -
    -

    Properties

    - -
      - -
    • - x - - - -
    • - -
    • - y - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Point.js:30 - -

    - - - - - -
    - -
    -

    Creates a clone of this point

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Point: - -

    a copy of the point

    - - -
    -
    - - - -
    - - -
    -

    set

    - - -
    - (
      - -
    • - - [x=0] - -
    • - -
    • - - [y=0] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Point.js:41 - -

    - - - - - -
    - -
    -

    Sets the point to a new x and y position. -If y is omitted, both x and y will be set to x.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - [x=0] - Number - optional - - - - -
      -

      position of the point on the x axis

      - -
      - - -
    • - -
    • - - [y=0] - Number - optional - - - - -
      -

      position of the point on the y axis

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Point.js:15 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Point.js:22 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/PolyK.html b/tutorial-3/pixi.js-master/docs/classes/PolyK.html deleted file mode 100755 index e1d21ed..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/PolyK.html +++ /dev/null @@ -1,761 +0,0 @@ - - - - - PolyK - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PolyK Class

    -
    - - - - - -
    - Defined in: src/pixi/utils/Polyk.js:34 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    Based on the Polyk library http://polyk.ivank.net released under MIT licence. -This is an amazing lib! -Slightly modified by Mat Groves (matgroves.com);

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _convex

    - - - () - - - - - Boolean - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Polyk.js:158 - -

    - - - - - -
    - -
    -

    Checks whether a shape is convex

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Boolean: - - -
    -
    - - - -
    - - -
    -

    _PointInTriangle

    - - -
    - (
      - -
    • - - px - -
    • - -
    • - - py - -
    • - -
    • - - ax - -
    • - -
    • - - ay - -
    • - -
    • - - bx - -
    • - -
    • - - by - -
    • - -
    • - - cx - -
    • - -
    • - - cy - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Polyk.js:120 - -

    - - - - - -
    - -
    -

    Checks whether a point is within a triangle

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - px - Number - - - - -
      -

      x coordinate of the point to test

      - -
      - - -
    • - -
    • - - py - Number - - - - -
      -

      y coordinate of the point to test

      - -
      - - -
    • - -
    • - - ax - Number - - - - -
      -

      x coordinate of the a point of the triangle

      - -
      - - -
    • - -
    • - - ay - Number - - - - -
      -

      y coordinate of the a point of the triangle

      - -
      - - -
    • - -
    • - - bx - Number - - - - -
      -

      x coordinate of the b point of the triangle

      - -
      - - -
    • - -
    • - - by - Number - - - - -
      -

      y coordinate of the b point of the triangle

      - -
      - - -
    • - -
    • - - cx - Number - - - - -
      -

      x coordinate of the c point of the triangle

      - -
      - - -
    • - -
    • - - cy - Number - - - - -
      -

      y coordinate of the c point of the triangle

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - - -
    -
    - - - -
    - - -
    -

    Triangulate

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Polyk.js:42 - -

    - - - - - -
    - -
    -

    Triangulates shapes for webGL graphic fills.

    - -
    - - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/Polygon.html b/tutorial-3/pixi.js-master/docs/classes/Polygon.html deleted file mode 100755 index 6fa4c44..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/Polygon.html +++ /dev/null @@ -1,661 +0,0 @@ - - - - - Polygon - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Polygon Class

    -
    - - - - - -
    - Defined in: src/pixi/geom/Polygon.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    Polygon

    - - -
    - (
      - -
    • - - points - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Polygon.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - points - Array | Array | Point... | Number... - - - - multiple - - -
      -

      This can be an array of Points that form the polygon, - a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be - all the points of the polygon e.g. new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...), or the - arguments passed can be flat x,y values e.g. new PIXI.Polygon(x,y, x,y, x,y, ...) where x and y are - Numbers.

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Polygon - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Polygon.js:35 - -

    - - - - - -
    - -
    -

    Creates a clone of this polygon

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Polygon: - -

    a copy of the polygon

    - - -
    -
    - - - -
    - - -
    -

    contains

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Polygon.js:47 - -

    - - - - - -
    - -
    -

    Checks whether the x and y coordinates passed to this function are contained within this polygon

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the point to test

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the point to test

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Whether the x/y coordinates are within this polygon

    - - -
    -
    - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/PrimitiveShader.html b/tutorial-3/pixi.js-master/docs/classes/PrimitiveShader.html deleted file mode 100755 index 0641655..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/PrimitiveShader.html +++ /dev/null @@ -1,839 +0,0 @@ - - - - - PrimitiveShader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PrimitiveShader Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    PrimitiveShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:103 - -

    - - - - - -
    - -
    -

    Destroys the shader.

    - -
    - - - - - - -
    - - -
    -

    init

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:74 - -

    - - - - - -
    - -
    -

    Initialises the shader.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _UID

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:32 - -

    - - - - -
    - -
    -

    The fragment shader.

    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:19 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    program

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:25 - -

    - - - - -
    - -
    -

    The WebGL program.

    - -
    - - - - - - -
    - - -
    -

    vertexSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:46 - -

    - - - - -
    - -
    -

    The vertex shader.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/RGBSplitFilter.html b/tutorial-3/pixi.js-master/docs/classes/RGBSplitFilter.html deleted file mode 100755 index ffb75a6..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/RGBSplitFilter.html +++ /dev/null @@ -1,939 +0,0 @@ - - - - - RGBSplitFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    RGBSplitFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    An RGB Split Filter.

    - -
    - - -
    -

    Constructor

    -
    -

    RGBSplitFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/RGBSplitFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blue

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/RGBSplitFilter.js:78 - -

    - - - - -
    - -
    -

    Blue offset.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    green

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/RGBSplitFilter.js:63 - -

    - - - - -
    - -
    -

    Green channel offset.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    red

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/RGBSplitFilter.js:48 - -

    - - - - -
    - -
    -

    Red channel offset.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/Rectangle.html b/tutorial-3/pixi.js-master/docs/classes/Rectangle.html deleted file mode 100755 index 2180606..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/Rectangle.html +++ /dev/null @@ -1,950 +0,0 @@ - - - - - Rectangle - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Rectangle Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    - -
    - - -
    -

    Constructor

    -
    -

    Rectangle

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the upper-left corner of the rectangle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the upper-left corner of the rectangle

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The overall width of this rectangle

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The overall height of this rectangle

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - -
      - -
    • - height - - - -
    • - -
    • - width - - - -
    • - -
    • - x - - - -
    • - -
    • - y - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:46 - -

    - - - - - -
    - -
    -

    Creates a clone of this Rectangle

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    a copy of the rectangle

    - - -
    -
    - - - -
    - - -
    -

    contains

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:57 - -

    - - - - - -
    - -
    -

    Checks whether the x and y coordinates given are contained within this Rectangle

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the point to test

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the point to test

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Whether the x/y coordinates are within this Rectangle

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:38 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:31 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:17 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:24 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/RenderTexture.html b/tutorial-3/pixi.js-master/docs/classes/RenderTexture.html deleted file mode 100755 index f7c7c7e..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/RenderTexture.html +++ /dev/null @@ -1,2964 +0,0 @@ - - - - - RenderTexture - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    RenderTexture Class

    -
    - - - -
    - Extends Texture -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A RenderTexture is a special texture that allows any Pixi display object to be rendered to it.

    -

    Hint: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead.

    -

    A RenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example:

    -

    var renderTexture = new PIXI.RenderTexture(800, 600); - var sprite = PIXI.Sprite.fromImage("spinObj_01.png"); - sprite.position.x = 800/2; - sprite.position.y = 600/2; - sprite.anchor.x = 0.5; - sprite.anchor.y = 0.5; - renderTexture.render(sprite);

    -

    The Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual position a DisplayObjectContainer should be used:

    -

    var doc = new PIXI.DisplayObjectContainer(); - doc.addChild(sprite); - renderTexture.render(doc); // Renders to center of renderTexture

    - -
    - - -
    -

    Constructor

    -
    -

    RenderTexture

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    • - - renderer - -
    • - -
    • - - scaleMode - -
    • - -
    • - - resolution - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      The width of the render texture

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The height of the render texture

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used for this RenderTexture

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _updateUvs

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:200 - -

    - - - - - -
    - -
    -

    Updates the internal WebGL UV cache.

    - -
    - - - - - - -
    - - -
    -

    clear

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:171 - -

    - - - - - -
    - -
    -

    Clears the RenderTexture.

    - -
    - - - - - - -
    - - -
    -

    destroy

    - - -
    - (
      - -
    • - - destroyBase - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:149 - -

    - - - - - -
    - -
    -

    Destroys this texture

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - destroyBase - Boolean - - - - -
      -

      Whether to destroy the base texture as well

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    getBase64

    - - - () - - - - - String - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:291 - -

    - - - - - -
    - -
    -

    Will return a a base64 encoded string of this texture. It works by calling RenderTexture.getCanvas and then running toDataURL on that.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - String: - -

    A base64 encoded string of the texture.

    - - -
    -
    - - - -
    - - -
    -

    getCanvas

    - - - () - - - - - HTMLCanvasElement - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:302 - -

    - - - - - -
    - -
    -

    Creates a Canvas element, renders this RenderTexture to it and then returns it.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - HTMLCanvasElement: - -

    A Canvas element with the texture rendered on.

    - - -
    -
    - - - -
    - - -
    -

    getImage

    - - - () - - - - - Image - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:278 - -

    - - - - - -
    - -
    -

    Will return a HTML Image of the texture

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Image: - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onBaseTextureLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:131 - -

    - - - - - -
    - -
    -

    Called when the base texture is loaded

    - -
    - - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderCanvas

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - [matrix] - -
    • - -
    • - - [clear] - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:237 - -

    - - - - - -
    - -
    -

    This function will draw the display object to the texture.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      The display object to render this texture on

      - -
      - - -
    • - -
    • - - [matrix] - Matrix - optional - - - - -
      -

      Optional matrix to apply to the display object before rendering.

      - -
      - - -
    • - -
    • - - [clear] - Boolean - optional - - - - -
      -

      If true the texture will be cleared before the displayObject is drawn

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderWebGL

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - [matrix] - -
    • - -
    • - - [clear] - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:188 - -

    - - - - - -
    - -
    -

    This function will draw the display object to the texture.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      The display object to render this texture on

      - -
      - - -
    • - -
    • - - [matrix] - Matrix - optional - - - - -
      -

      Optional matrix to apply to the display object before rendering.

      - -
      - - -
    • - -
    • - - [clear] - Boolean - optional - - - - -
      -

      If true the texture will be cleared before the displayObject is drawn

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    resize

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    • - - updateBase - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:137 - -

    - - - - - -
    - -
    -

    Resizes the RenderTexture.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      The width to resize to.

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The height to resize to.

      - -
      - - -
    • - -
    • - - updateBase - Boolean - - - - -
      -

      Should the baseTexture.width and height values be resized as well?

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setFrame

    - - -
    - (
      - -
    • - - frame - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:162 - -

    - - - - - -
    - -
    -

    Specifies the region of the baseTexture that this texture will use.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frame - Rectangle - - - - -
      -

      The frame of the texture to set it to

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _uvs

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:83 - -

    - - - - -
    - -
    -

    The WebGL UV data cache.

    - -
    - - - - - - -
    - - -
    -

    baseTexture

    - BaseTexture - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:78 - -

    - - - - -
    - -
    -

    The base texture object that this texture uses

    - -
    - - - - - - -
    - - -
    -

    crop

    - Rectangle - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:69 - -

    - - - - -
    - -
    -

    This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, -irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)

    - -
    - - - - - - -
    - - -
    -

    frame

    - Rectangle - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:61 - -

    - - - - -
    - -
    -

    The framing rectangle of the render texture

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:45 - -

    - - - - -
    - -
    -

    The height of the render texture

    - -
    - - - - - - -
    - - -
    -

    noFrame

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:24 - -

    - - - - -
    - -
    -

    Does this Texture have any frame data assigned to it?

    - -
    - - - - - - -
    - - -
    -

    renderer

    - CanvasRenderer | WebGLRenderer - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:99 - -

    - - - - -
    - -
    -

    The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL.

    - -
    - - - - - - -
    - - -
    -

    requiresUpdate

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:75 - -

    - - - - -
    - -
    -

    This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)

    - -
    - - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:53 - -

    - - - - -
    - -
    -

    The Resolution of the texture.

    - -
    - - - - - - -
    - - -
    -

    trim

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:59 - -

    - - - - -
    - -
    -

    The texture trim data.

    - -
    - - - - - - -
    - - -
    -

    valid

    - Boolean - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:125 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:37 - -

    - - - - -
    - -
    -

    The with of the render texture

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/Rope.html b/tutorial-3/pixi.js-master/docs/classes/Rope.html deleted file mode 100755 index c1c314b..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/Rope.html +++ /dev/null @@ -1,5931 +0,0 @@ - - - - - Rope - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Rope Class

    -
    - - - -
    - Extends Strip -
    - - - -
    - Defined in: src/pixi/extras/Rope.js:6 -
    - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    Rope

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - points - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Rope.js:6 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -
        -
      • The texture to use on the rope.
      • -
      - -
      - - -
    • - -
    • - - points - Array - - - - -
      -
        -
      • An array of {PIXI.Point}.
      • -
      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Strip: - - - - src/pixi/extras/Strip.js:341 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    renderStripFlat

    - - -
    - (
      - -
    • - - strip - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Strip: - - - - src/pixi/extras/Strip.js:293 - -

    - - - - - -
    - -
    -

    Renders a flat strip

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - strip - Strip - - - - -
      -

      The Strip to render

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - Strip: - - - - src/pixi/extras/Strip.js:43 - -

    - - - - -
    - -
    -

    Whether the strip is dirty or not

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - Strip: - - - - src/pixi/extras/Strip.js:52 - -

    - - - - -
    - -
    -

    if you need a padding, not yet implemented

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - -

    Inherited from - Strip: - - - - src/pixi/extras/Strip.js:20 - -

    - - - - -
    - -
    -

    The texture of the strip

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/Rounded Rectangle.html b/tutorial-3/pixi.js-master/docs/classes/Rounded Rectangle.html deleted file mode 100755 index 00a3e40..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/Rounded Rectangle.html +++ /dev/null @@ -1,1025 +0,0 @@ - - - - - Rounded Rectangle - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Rounded Rectangle Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    the Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height.

    - -
    - - -
    -

    Constructor

    -
    -

    Rounded Rectangle

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    • - - radius - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the upper-left corner of the rounded rectangle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the upper-left corner of the rounded rectangle

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The overall width of this rounded rectangle

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The overall height of this rounded rectangle

      - -
      - - -
    • - -
    • - - radius - Number - - - - -
      -

      The overall radius of this corners of this rounded rectangle

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - -
      - -
    • - height - - - -
    • - -
    • - radius - - - -
    • - -
    • - width - - - -
    • - -
    • - x - - - -
    • - -
    • - y - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Rounded Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:54 - -

    - - - - - -
    - -
    -

    Creates a clone of this Rounded Rectangle

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rounded Rectangle: - -

    a copy of the rounded rectangle

    - - -
    -
    - - - -
    - - -
    -

    contains

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:65 - -

    - - - - - -
    - -
    -

    Checks whether the x and y coordinates given are contained within this Rounded Rectangle

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the point to test

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the point to test

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Whether the x/y coordinates are within this Rounded Rectangle

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:39 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    radius

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:46 - -

    - - - - -
    - -
    - -
    - - -

    Default: 20

    - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:32 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:18 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:25 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/SepiaFilter.html b/tutorial-3/pixi.js-master/docs/classes/SepiaFilter.html deleted file mode 100755 index fee5fe6..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/SepiaFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - SepiaFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    SepiaFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This applies a sepia effect to your Display Objects.

    - -
    - - -
    -

    Constructor

    -
    -

    SepiaFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/SepiaFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    sepia

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/SepiaFilter.js:43 - -

    - - - - -
    - -
    -

    The strength of the sepia. 1 will apply the full sepia effect, 0 will make the object its normal color.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/SmartBlurFilter.html b/tutorial-3/pixi.js-master/docs/classes/SmartBlurFilter.html deleted file mode 100755 index 4f1da72..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/SmartBlurFilter.html +++ /dev/null @@ -1,837 +0,0 @@ - - - - - SmartBlurFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    SmartBlurFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A Smart Blur Filter.

    - -
    - - -
    -

    Constructor

    -
    -

    SmartBlurFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/SmartBlurFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number the strength of the blur - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/SmartBlurFilter.js:61 - -

    - - - - -
    - -
    -

    The strength of the blur.

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/Spine.html b/tutorial-3/pixi.js-master/docs/classes/Spine.html deleted file mode 100755 index 4c0f0fa..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/Spine.html +++ /dev/null @@ -1,5572 +0,0 @@ - - - - - Spine - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Spine Class

    -
    - - - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A class that enables the you to import and run your spine animations in pixi. -Spine animation data needs to be loaded using the PIXI.AssetLoader or PIXI.SpineLoader before it can be used by this class -See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source

    - -
    - - -
    -

    Constructor

    -
    -

    Spine

    - - -
    - (
      - -
    • - - url - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Spine.js:1357 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the spine anim file to be used

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/SpineLoader.html b/tutorial-3/pixi.js-master/docs/classes/SpineLoader.html deleted file mode 100755 index ed00edc..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/SpineLoader.html +++ /dev/null @@ -1,1527 +0,0 @@ - - - - - SpineLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    SpineLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Spine loader is used to load in JSON spine data -To generate the data you need to use http://esotericsoftware.com/ and export in the "JSON" format -Due to a clash of names You will need to change the extension of the spine file from .json to .anim for it to load -See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source -You will need to generate a sprite sheet to accompany the spine data -When loaded this class will dispatch a "loaded" event

    - -
    - - -
    -

    Constructor

    -
    -

    SpineLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:10 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the JSON file

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:56 - -

    - - - - - -
    - -
    -

    Loads the JSON data

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:72 - -

    - - - - - -
    - -
    -

    Invoked when JSON file is loaded.

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    crossorigin

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:34 - -

    - - - - -
    - -
    -

    Whether the requests should be treated as cross origin

    - -
    - - - - - - -
    - - -
    -

    loaded

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:42 - -

    - - - - -
    - -
    -

    [read-only] Whether the data has loaded yet

    - -
    - - - - - - -
    - - -
    -

    url

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:26 - -

    - - - - -
    - -
    -

    The url of the bitmap font data

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/Sprite.html b/tutorial-3/pixi.js-master/docs/classes/Sprite.html deleted file mode 100755 index 59ecf6e..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/Sprite.html +++ /dev/null @@ -1,6422 +0,0 @@ - - - - - Sprite - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Sprite Class

    -
    - - - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Sprite object is the base for all textured objects that are rendered to the screen

    - -
    - - -
    -

    Constructor

    -
    -

    Sprite

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The texture for this sprite

      -

      A sprite can be created directly from an image like this : -var sprite = new PIXI.Sprite.fromImage('assets/image.png'); -yourStage.addChild(sprite); -then obviously don't forget to add it to the stage you have already created

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:305 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:242 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    fromFrame

    - - -
    - (
      - -
    • - - frameId - -
    • - -
    ) -
    - - - - - Sprite - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:418 - -

    - - - - - -
    - -
    -

    Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId - The frame ids are created when a Texture packer file has been loaded

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frameId - String - - - - -
      -

      The frame Id of the texture in the cache

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Sprite: - -

    A new Sprite using a texture from the texture cache matching the frameId

    - - -
    -
    - - - -
    - - -
    -

    fromImage

    - - -
    - (
      - -
    • - - imageId - -
    • - -
    ) -
    - - - - - Sprite - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:435 - -

    - - - - - -
    - -
    -

    Helper function that creates a sprite that will contain a texture based on an image url - If the image is not in the texture cache it will be loaded

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - imageId - String - - - - -
      -

      The image url of the texture

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Sprite: - -

    A new Sprite using a texture from the texture cache matching the image id

    - - -
    -
    - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    ) -
    - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:163 - -

    - - - - - -
    - -
    -

    Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Matrix - - - - -
      -

      the transformation matrix of the sprite

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:147 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setTexture

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:135 - -

    - - - - - -
    - -
    -

    Sets the texture of the sprite

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The PIXI texture that is displayed by the sprite

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _height

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:50 - -

    - - - - -
    - -
    -

    The height of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _width

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:41 - -

    - - - - -
    - -
    -

    The width of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    anchor

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:22 - -

    - - - - -
    - -
    -

    The anchor sets the origin point of the texture. -The default is 0,0 this means the texture's origin is the top left -Setting than anchor to 0.5,0.5 means the textures origin is centered -Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner

    - -
    - - - - - - -
    - - -
    -

    blendMode

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:68 - -

    - - - - -
    - -
    -

    The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.

    - -
    - - -

    Default: PIXI.blendModes.NORMAL;

    - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/display/Sprite.js:119 - -

    - - - - -
    - -
    -

    The height of the sprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    shader

    - PIXI.AbstractFilter - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:77 - -

    - - - - -
    - -
    -

    The shader that will be used to render the texture to the stage. Set to null to remove a current shader.

    - -
    - - -

    Default: null

    - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:33 - -

    - - - - -
    - -
    -

    The texture that the sprite is using

    - -
    - - - - - - -
    - - -
    -

    tint

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:59 - -

    - - - - -
    - -
    -

    The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.

    - -
    - - -

    Default: 0xFFFFFF

    - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/display/Sprite.js:103 - -

    - - - - -
    - -
    -

    The width of the sprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/SpriteBatch.html b/tutorial-3/pixi.js-master/docs/classes/SpriteBatch.html deleted file mode 100755 index d55ac22..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/SpriteBatch.html +++ /dev/null @@ -1,643 +0,0 @@ - - - - - SpriteBatch - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    SpriteBatch Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The SpriteBatch class is a really fast version of the DisplayObjectContainer -built solely for speed, so use when you need a lot of sprites or particles. -And it's extremely easy to use :

    -

    var container = new PIXI.SpriteBatch();

    -

    stage.addChild(container);

    -

    for(var i = 0; i < 100; i++) - { - var sprite = new PIXI.Sprite.fromImage("myImage.png"); - container.addChild(sprite); - } -And here you have a hundred sprites that will be renderer at the speed of light

    - -
    - - -
    -

    Constructor

    -
    -

    SpriteBatch

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/SpriteBatch.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/SpriteBatch.js:90 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/SpriteBatch.js:66 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/SpriteSheetLoader.html b/tutorial-3/pixi.js-master/docs/classes/SpriteSheetLoader.html deleted file mode 100755 index d2f8285..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/SpriteSheetLoader.html +++ /dev/null @@ -1,1632 +0,0 @@ - - - - - SpriteSheetLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    SpriteSheetLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    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 in 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 a 'texture atlas') as it means sprites 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.fromFrameId() -This loader will load the image file that the Spritesheet points to as well as the data. -When loaded this class will dispatch a 'loaded' event

    - -
    - - -
    -

    Constructor

    -
    -

    SpriteSheetLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the sprite sheet JSON file

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:69 - -

    - - - - - -
    - -
    -

    This will begin loading the JSON file

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:84 - -

    - - - - - -
    - -
    -

    Invoke when all files are loaded (json and texture)

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    baseUrl

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:38 - -

    - - - - -
    - -
    -

    [read-only] The base url of the bitmap font data

    - -
    - - - - - - -
    - - -
    -

    crossorigin

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:30 - -

    - - - - -
    - -
    -

    Whether the requests should be treated as cross origin

    - -
    - - - - - - -
    - - -
    -

    frames

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:55 - -

    - - - - -
    - -
    -

    The frames of the sprite sheet

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:47 - -

    - - - - -
    - -
    -

    The texture being loaded

    - -
    - - - - - - -
    - - -
    -

    url

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:22 - -

    - - - - -
    - -
    -

    The url of the atlas data

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/Stage.html b/tutorial-3/pixi.js-master/docs/classes/Stage.html deleted file mode 100755 index 27d0d6a..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/Stage.html +++ /dev/null @@ -1,5961 +0,0 @@ - - - - - Stage - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Stage Class

    -
    - - - - - - - -
    - Defined in: src/pixi/display/Stage.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    - -
    - - -
    -

    Constructor

    -
    -

    Stage

    - - -
    - (
      - -
    • - - backgroundColor - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - backgroundColor - Number - - - - -
      -

      the background color of the stage, you have to pass this in is in hex format - like: 0xFFFFFF for white

      -

      Creating a stage is a mandatory process when you use Pixi, which is as simple as this : -var stage = new PIXI.Stage(0xFFFFFF); -where the parameter given is the background colour of the stage, in hex -you will use this stage instance to add your sprites to it and therefore to the renderer -Here is how to add a sprite to the stage : -stage.addChild(sprite);

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getMousePosition

    - - - () - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:126 - -

    - - - - - -
    - -
    -

    This will return the point containing global coordinates of the mouse.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point containing the coordinates of the global InteractionData position.

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setBackgroundColor

    - - -
    - (
      - -
    • - - backgroundColor - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:110 - -

    - - - - - -
    - -
    -

    Sets the background color for the stage

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - backgroundColor - Number - - - - -
      -

      the color of the background, easiest way to pass this in is in hex format - like: 0xFFFFFF for white

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setInteractionDelegate

    - - -
    - (
      - -
    • - - domElement - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:73 - -

    - - - - - -
    - -
    -

    Sets another DOM element which can receive mouse/touch interactions instead of the default Canvas element. -This is useful for when you have other DOM elements on top of the Canvas element.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - domElement - DOMElement - - - - -
      -

      This new domElement which will receive mouse/touch events

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:51 - -

    - - - - -
    - -
    -

    Whether the stage is dirty and needs to have interactions updated

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactionManager

    - InteractionManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:43 - -

    - - - - -
    - -
    -

    The interaction manage for this stage, manages all interactive activity on the stage

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Stage.js:35 - -

    - - - - -
    - -
    -

    Whether or not the stage is interactive

    - -
    - - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Stage.js:25 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/Strip.html b/tutorial-3/pixi.js-master/docs/classes/Strip.html deleted file mode 100755 index d93f5d3..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/Strip.html +++ /dev/null @@ -1,5964 +0,0 @@ - - - - - Strip - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Strip Class

    -
    - - - - - - - -
    - Defined in: src/pixi/extras/Strip.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    Strip

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The texture to use

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      the width

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the height

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:341 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    renderStripFlat

    - - -
    - (
      - -
    • - - strip - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:293 - -

    - - - - - -
    - -
    -

    Renders a flat strip

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - strip - Strip - - - - -
      -

      The Strip to render

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:43 - -

    - - - - -
    - -
    -

    Whether the strip is dirty or not

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:52 - -

    - - - - -
    - -
    -

    if you need a padding, not yet implemented

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:20 - -

    - - - - -
    - -
    -

    The texture of the strip

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/StripShader.html b/tutorial-3/pixi.js-master/docs/classes/StripShader.html deleted file mode 100755 index 612ff3b..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/StripShader.html +++ /dev/null @@ -1,839 +0,0 @@ - - - - - StripShader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    StripShader Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    StripShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:111 - -

    - - - - - -
    - -
    -

    Destroys the shader.

    - -
    - - - - - - -
    - - -
    -

    init

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:80 - -

    - - - - - -
    - -
    -

    Initialises the shader.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _UID

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:32 - -

    - - - - -
    - -
    -

    The fragment shader.

    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:19 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    program

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:25 - -

    - - - - -
    - -
    -

    The WebGL program.

    - -
    - - - - - - -
    - - -
    -

    vertexSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:50 - -

    - - - - -
    - -
    -

    The vertex shader.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/Text.html b/tutorial-3/pixi.js-master/docs/classes/Text.html deleted file mode 100755 index 8604a47..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/Text.html +++ /dev/null @@ -1,7290 +0,0 @@ - - - - - Text - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Text Class

    -
    - - - -
    - Extends Sprite -
    - - - -
    - Defined in: src/pixi/text/Text.js:6 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    A Text Object will create a line or multiple lines of text. To split a line you can use '\n' in your text string, -or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object.

    - -
    - - -
    -

    Constructor

    -
    -

    Text

    - - -
    - (
      - -
    • - - text - -
    • - -
    • - - [style] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:6 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - text - String - - - - -
      -

      The copy that you would like the text to display

      - -
      - - -
    • - -
    • - - [style] - Object - optional - - - - -
      -

      The style parameters

      - -
      - - -
        - -
      • - - [font] - String - optional - - -
        -

        default 'bold 20px Arial' The style and size of the font

        - -
        - - -
      • - -
      • - - [fill='black'] - String | Number - optional - - -
        -

        A canvas fillstyle that will be used on the text e.g 'red', '#00FF00'

        - -
        - - -
      • - -
      • - - [align='left'] - String - optional - - -
        -

        Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text

        - -
        - - -
      • - -
      • - - [stroke] - String | Number - optional - - -
        -

        A canvas fillstyle that will be used on the text stroke e.g 'blue', '#FCFF00'

        - -
        - - -
      • - -
      • - - [strokeThickness=0] - Number - optional - - -
        -

        A number that represents the thickness of the stroke. Default is 0 (no stroke)

        - -
        - - -
      • - -
      • - - [wordWrap=false] - Boolean - optional - - -
        -

        Indicates if word wrap should be used

        - -
        - - -
      • - -
      • - - [wordWrapWidth=100] - Number - optional - - -
        -

        The width at which text will wrap, it needs wordWrap to be set to true

        - -
        - - -
      • - -
      • - - [dropShadow=false] - Boolean - optional - - -
        -

        Set a drop shadow for the text

        - -
        - - -
      • - -
      • - - [dropShadowColor='#000000'] - String - optional - - -
        -

        A fill style to be used on the dropshadow e.g 'red', '#00FF00'

        - -
        - - -
      • - -
      • - - [dropShadowAngle=Math.PI/4] - Number - optional - - -
        -

        Set a angle of the drop shadow

        - -
        - - -
      • - -
      • - - [dropShadowDistance=5] - Number - optional - - -
        -

        Set a distance of the drop shadow

        - -
        - - -
      • - -
      - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/text/Text.js:321 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/text/Text.js:301 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    destroy

    - - -
    - (
      - -
    • - - destroyBaseTexture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:510 - -

    - - - - - -
    - -
    -

    Destroys this text object.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - destroyBaseTexture - Boolean - - - - -
      -

      whether to destroy the base texture as well

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    determineFontProperties

    - - -
    - (
      - -
    • - - fontStyle - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:341 - -

    - - - - - -
    - -
    -

    Calculates the ascent, descent and fontSize of a given fontStyle

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - fontStyle - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    ) -
    - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/text/Text.js:492 - -

    - - - - - -
    - -
    -

    Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Matrix - - - - -
      -

      the transformation matrix of the Text

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:147 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStyle

    - - -
    - (
      - -
    • - - [style] - -
    • - -
    • - - [style.font='bold - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:110 - -

    - - - - - -
    - -
    -

    Set the style of the text

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - [style] - Object - optional - - - - -
      -

      The style parameters

      - -
      - - -
        - -
      • - - [fill='black'] - Object - optional - - -
        -

        A canvas fillstyle that will be used on the text eg 'red', '#00FF00'

        - -
        - - -
      • - -
      • - - [align='left'] - String - optional - - -
        -

        Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text

        - -
        - - -
      • - -
      • - - [stroke='black'] - String - optional - - -
        -

        A canvas fillstyle that will be used on the text stroke eg 'blue', '#FCFF00'

        - -
        - - -
      • - -
      • - - [strokeThickness=0] - Number - optional - - -
        -

        A number that represents the thickness of the stroke. Default is 0 (no stroke)

        - -
        - - -
      • - -
      • - - [wordWrap=false] - Boolean - optional - - -
        -

        Indicates if word wrap should be used

        - -
        - - -
      • - -
      • - - [wordWrapWidth=100] - Number - optional - - -
        -

        The width at which text will wrap

        - -
        - - -
      • - -
      • - - [dropShadow=false] - Boolean - optional - - -
        -

        Set a drop shadow for the text

        - -
        - - -
      • - -
      • - - [dropShadowColor='#000000'] - String - optional - - -
        -

        A fill style to be used on the dropshadow e.g 'red', '#00FF00'

        - -
        - - -
      • - -
      • - - [dropShadowAngle=Math.PI/4] - Number - optional - - -
        -

        Set a angle of the drop shadow

        - -
        - - -
      • - -
      • - - [dropShadowDistance=5] - Number - optional - - -
        -

        Set a distance of the drop shadow

        - -
        - - -
      • - -
      - -
    • - -
    • - - [style.font='bold - String - - - - -
      -

      20pt Arial'] The style and size of the font

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setText

    - - -
    - (
      - -
    • - - text - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:147 - -

    - - - - - -
    - -
    -

    Set the copy for the text object. To split a line you can use '\n'.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - text - String - - - - -
      -

      The copy that you would like the text to display

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setTexture

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:135 - -

    - - - - - -
    - -
    -

    Sets the texture of the sprite

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The PIXI texture that is displayed by the sprite

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    -

    updateText

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:159 - -

    - - - - - -
    - -
    -

    Renders text and updates it when needed

    - -
    - - - - - - -
    - - -
    -

    updateTexture

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:281 - -

    - - - - - -
    - -
    -

    Updates texture size based on canvas size

    - -
    - - - - - - -
    - - -
    -

    wordWrap

    - - -
    - (
      - -
    • - - text - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:444 - -

    - - - - - -
    - -
    -

    Applies newlines to a string to have it optimally fit into the horizontal -bounds set by the Text object's wordWrapWidth property.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - text - String - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _height

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:50 - -

    - - - - -
    - -
    -

    The height of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _width

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:41 - -

    - - - - -
    - -
    -

    The width of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    anchor

    - Point - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:22 - -

    - - - - -
    - -
    -

    The anchor sets the origin point of the texture. -The default is 0,0 this means the texture's origin is the top left -Setting than anchor to 0.5,0.5 means the textures origin is centered -Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner

    - -
    - - - - - - -
    - - -
    -

    blendMode

    - Number - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:68 - -

    - - - - -
    - -
    -

    The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.

    - -
    - - -

    Default: PIXI.blendModes.NORMAL;

    - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    canvas

    - HTMLCanvasElement - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:29 - -

    - - - - -
    - -
    -

    The canvas element that everything is drawn to

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    context

    - HTMLCanvasElement - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:37 - -

    - - - - -
    - -
    -

    The canvas 2d context that everything is drawn with

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/text/Text.js:86 - -

    - - - - -
    - -
    -

    The height of the Text, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:44 - -

    - - - - -
    - -
    -

    The resolution of the canvas.

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    shader

    - PIXI.AbstractFilter - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:77 - -

    - - - - -
    - -
    -

    The shader that will be used to render the texture to the stage. Set to null to remove a current shader.

    - -
    - - -

    Default: null

    - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:33 - -

    - - - - -
    - -
    -

    The texture that the sprite is using

    - -
    - - - - - - -
    - - -
    -

    tint

    - Number - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:59 - -

    - - - - -
    - -
    -

    The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.

    - -
    - - -

    Default: 0xFFFFFF

    - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/text/Text.js:62 - -

    - - - - -
    - -
    -

    The width of the Text, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/Texture.html b/tutorial-3/pixi.js-master/docs/classes/Texture.html deleted file mode 100755 index c797d9a..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/Texture.html +++ /dev/null @@ -1,2786 +0,0 @@ - - - - - Texture - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Texture Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A texture stores the information that represents an image or part of an image. It cannot be added -to the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used.

    - -
    - - -
    -

    Constructor

    -
    -

    Texture

    - - -
    - (
      - -
    • - - baseTexture - -
    • - -
    • - - frame - -
    • - -
    • - - [crop] - -
    • - -
    • - - [trim] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:10 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - baseTexture - BaseTexture - - - - -
      -

      The base texture source to create the texture from

      - -
      - - -
    • - -
    • - - frame - Rectangle - - - - -
      -

      The rectangle frame of the texture to show

      - -
      - - -
    • - -
    • - - [crop] - Rectangle - optional - - - - -
      -

      The area of original texture

      - -
      - - -
    • - -
    • - - [trim] - Rectangle - optional - - - - -
      -

      Trimmed texture rectangle

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _updateUvs

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:200 - -

    - - - - - -
    - -
    -

    Updates the internal WebGL UV cache.

    - -
    - - - - - - -
    - - -
    -

    addTextureToCache

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - id - -
    • - -
    ) -
    - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:284 - -

    - - - - - -
    - -
    -

    Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The Texture to add to the cache.

      - -
      - - -
    • - -
    • - - id - String - - - - -
      -

      The id that the texture will be stored against.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    destroy

    - - -
    - (
      - -
    • - - destroyBase - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:149 - -

    - - - - - -
    - -
    -

    Destroys this texture

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - destroyBase - Boolean - - - - -
      -

      Whether to destroy the base texture as well

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    fromCanvas

    - - -
    - (
      - -
    • - - canvas - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:267 - -

    - - - - - -
    - -
    -

    Helper function that creates a new a Texture based on the given canvas element.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - canvas - Canvas - - - - -
      -

      The canvas element source of the texture

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - -

    Texture

    - - -
    -
    - - - -
    - - -
    -

    fromFrame

    - - -
    - (
      - -
    • - - frameId - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:251 - -

    - - - - - -
    - -
    -

    Helper function that returns a Texture objected based on the given frame id. -If the frame id is not in the texture cache an error will be thrown.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frameId - String - - - - -
      -

      The frame id of the texture

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - -

    Texture

    - - -
    -
    - - - -
    - - -
    -

    fromImage

    - - -
    - (
      - -
    • - - imageUrl - -
    • - -
    • - - crossorigin - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:227 - -

    - - - - - -
    - -
    -

    Helper function that creates a Texture object from the given image url. -If the image is not in the texture cache it will be created and loaded.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - imageUrl - String - - - - -
      -

      The image url of the texture

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - -

    Texture

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onBaseTextureLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:131 - -

    - - - - - -
    - -
    -

    Called when the base texture is loaded

    - -
    - - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeTextureFromCache

    - - -
    - (
      - -
    • - - id - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:297 - -

    - - - - - -
    - -
    -

    Remove a texture from the global PIXI.TextureCache.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - id - String - - - - -
      -

      The id of the texture to be removed

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    The texture that was removed

    - - -
    -
    - - - -
    - - -
    -

    setFrame

    - - -
    - (
      - -
    • - - frame - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:162 - -

    - - - - - -
    - -
    -

    Specifies the region of the baseTexture that this texture will use.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frame - Rectangle - - - - -
      -

      The frame of the texture to set it to

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _uvs

    - Object - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:83 - -

    - - - - -
    - -
    -

    The WebGL UV data cache.

    - -
    - - - - - - -
    - - -
    -

    baseTexture

    - BaseTexture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:43 - -

    - - - - -
    - -
    -

    The base texture that this texture uses.

    - -
    - - - - - - -
    - - -
    -

    crop

    - Rectangle - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:108 - -

    - - - - -
    - -
    -

    This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, -irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)

    - -
    - - - - - - -
    - - -
    -

    frame

    - Rectangle - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:51 - -

    - - - - -
    - -
    -

    The frame specifies the region of the base texture that this texture uses

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:100 - -

    - - - - -
    - -
    -

    The height of the Texture in pixels.

    - -
    - - - - - - -
    - - -
    -

    noFrame

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:24 - -

    - - - - -
    - -
    -

    Does this Texture have any frame data assigned to it?

    - -
    - - - - - - -
    - - -
    -

    requiresUpdate

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:75 - -

    - - - - -
    - -
    -

    This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)

    - -
    - - - - - - -
    - - -
    -

    trim

    - Rectangle - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:59 - -

    - - - - -
    - -
    -

    The texture trim data.

    - -
    - - - - - - -
    - - -
    -

    valid

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:67 - -

    - - - - -
    - -
    -

    This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:92 - -

    - - - - -
    - -
    -

    The width of the Texture in pixels.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/TilingSprite.html b/tutorial-3/pixi.js-master/docs/classes/TilingSprite.html deleted file mode 100755 index 00426d9..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/TilingSprite.html +++ /dev/null @@ -1,6532 +0,0 @@ - - - - - TilingSprite - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    TilingSprite Class

    -
    - - - -
    - Extends Sprite -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A tiling sprite is a fast way of rendering a tiling image

    - -
    - - -
    -

    Constructor

    -
    -

    TilingSprite

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      the texture of the tiling sprite

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      the width of the tiling sprite

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the height of the tiling sprite

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:194 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:137 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    generateTilingTexture

    - - -
    - (
      - -
    • - - forcePowerOfTwo - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:373 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - forcePowerOfTwo - Boolean - - - - -
      -

      Whether we want to force the texture to be a power of two

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:280 - -

    - - - - - -
    - -
    -

    Returns the framing rectangle of the sprite as a PIXI.Rectangle object

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - Sprite - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:360 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setTexture

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:135 - -

    - - - - - -
    - -
    -

    Sets the texture of the sprite

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The PIXI texture that is displayed by the sprite

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _height

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:50 - -

    - - - - -
    - -
    -

    The height of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _width

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:41 - -

    - - - - -
    - -
    -

    The width of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    anchor

    - Point - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:22 - -

    - - - - -
    - -
    -

    The anchor sets the origin point of the texture. -The default is 0,0 this means the texture's origin is the top left -Setting than anchor to 0.5,0.5 means the textures origin is centered -Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner

    - -
    - - - - - - -
    - - -
    -

    blendMode

    - Number - - - - - - - - - -
    - -

    Inherited from - - Sprite - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:77 - -

    - - - - -
    - -
    -

    The blend mode to be applied to the sprite

    - -
    - - -

    Default: PIXI.blendModes.NORMAL;

    - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:111 - -

    - - - - -
    - -
    -

    The height of the TilingSprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:27 - -

    - - - - -
    - -
    -

    The height of the tiling sprite

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:59 - -

    - - - - -
    - -
    -

    Whether this sprite is renderable or not

    - -
    - - -

    Default: true

    - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    shader

    - PIXI.AbstractFilter - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:77 - -

    - - - - -
    - -
    -

    The shader that will be used to render the texture to the stage. Set to null to remove a current shader.

    - -
    - - -

    Default: null

    - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:33 - -

    - - - - -
    - -
    -

    The texture that the sprite is using

    - -
    - - - - - - -
    - - -
    -

    tilePosition

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:51 - -

    - - - - -
    - -
    -

    The offset position of the image that is being tiled

    - -
    - - - - - - -
    - - -
    -

    tileScale

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:35 - -

    - - - - -
    - -
    -

    The scaling of the image that is being tiled

    - -
    - - - - - - -
    - - -
    -

    tileScaleOffset

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:43 - -

    - - - - -
    - -
    -

    A point that represents the scale of the texture object

    - -
    - - - - - - -
    - - -
    -

    tint

    - Number - - - - - - - - - -
    - -

    Inherited from - - Sprite - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:68 - -

    - - - - -
    - -
    -

    The tint applied to the sprite. This is a hex value

    - -
    - - -

    Default: 0xFFFFFF

    - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:19 - -

    - - - - -
    - -
    -

    The with of the tiling sprite

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:95 - -

    - - - - -
    - -
    -

    The width of the sprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/TiltShiftFilter.html b/tutorial-3/pixi.js-master/docs/classes/TiltShiftFilter.html deleted file mode 100755 index f8c853f..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/TiltShiftFilter.html +++ /dev/null @@ -1,614 +0,0 @@ - - - - - TiltShiftFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    TiltShiftFilter Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A TiltShift Filter. Manages the pass of both a TiltShiftXFilter and TiltShiftYFilter.

    - -
    - - -
    -

    Constructor

    -
    -

    TiltShiftFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - - - -
    -

    Properties

    - - -
    - - - - - -
    - - - - -
    -

    Properties

    - - -
    -

    blur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftFilter.js:24 - -

    - - - - -
    - -
    -

    The strength of the blur.

    - -
    - - - - - - -
    - - -
    -

    end

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftFilter.js:69 - -

    - - - - -
    - -
    -

    The Y value to end the effect at.

    - -
    - - - - - - -
    - - -
    -

    gradientBlur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftFilter.js:39 - -

    - - - - -
    - -
    -

    The strength of the gradient blur.

    - -
    - - - - - - -
    - - -
    -

    start

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftFilter.js:54 - -

    - - - - -
    - -
    -

    The Y value to start the effect at.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/TiltShiftXFilter.html b/tutorial-3/pixi.js-master/docs/classes/TiltShiftXFilter.html deleted file mode 100755 index 56c306a..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/TiltShiftXFilter.html +++ /dev/null @@ -1,1053 +0,0 @@ - - - - - TiltShiftXFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    TiltShiftXFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A TiltShiftXFilter.

    - -
    - - -
    -

    Constructor

    -
    -

    TiltShiftXFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    -

    updateDelta

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:138 - -

    - - - - - -
    - -
    -

    Updates the filter delta values.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:72 - -

    - - - - -
    - -
    -

    The strength of the blur.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    end

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:121 - -

    - - - - -
    - -
    -

    The X value to end the effect at.

    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    gradientBlur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:88 - -

    - - - - -
    - -
    -

    The strength of the gradient blur.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    start

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:104 - -

    - - - - -
    - -
    -

    The X value to start the effect at.

    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/TiltShiftYFilter.html b/tutorial-3/pixi.js-master/docs/classes/TiltShiftYFilter.html deleted file mode 100755 index cd66a7f..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/TiltShiftYFilter.html +++ /dev/null @@ -1,1053 +0,0 @@ - - - - - TiltShiftYFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    TiltShiftYFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A TiltShiftYFilter.

    - -
    - - -
    -

    Constructor

    -
    -

    TiltShiftYFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    -

    updateDelta

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:138 - -

    - - - - - -
    - -
    -

    Updates the filter delta values.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:72 - -

    - - - - -
    - -
    -

    The strength of the blur.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    end

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:121 - -

    - - - - -
    - -
    -

    The Y value to end the effect at.

    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    gradientBlur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:88 - -

    - - - - -
    - -
    -

    The strength of the gradient blur.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    start

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:104 - -

    - - - - -
    - -
    -

    The Y value to start the effect at.

    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/TwistFilter.html b/tutorial-3/pixi.js-master/docs/classes/TwistFilter.html deleted file mode 100755 index 482d5a9..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/TwistFilter.html +++ /dev/null @@ -1,939 +0,0 @@ - - - - - TwistFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    TwistFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This filter applies a twist effect making display objects appear twisted in the given direction.

    - -
    - - -
    -

    Constructor

    -
    -

    TwistFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TwistFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    angle

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TwistFilter.js:88 - -

    - - - - -
    - -
    -

    This angle of the twist.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    offset

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TwistFilter.js:56 - -

    - - - - -
    - -
    -

    This point describes the the offset of the twist.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    radius

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TwistFilter.js:72 - -

    - - - - -
    - -
    -

    This radius of the twist.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/WebGLBlendModeManager.html b/tutorial-3/pixi.js-master/docs/classes/WebGLBlendModeManager.html deleted file mode 100755 index f69e5db..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/WebGLBlendModeManager.html +++ /dev/null @@ -1,760 +0,0 @@ - - - - - WebGLBlendModeManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLBlendModeManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLBlendModeManager

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:50 - -

    - - - - - -
    - -
    -

    Destroys this object.

    - -
    - - - - - - -
    - - -
    -

    setBlendMode

    - - -
    - (
      - -
    • - - blendMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:32 - -

    - - - - - -
    - -
    -

    Sets-up the given blendMode from WebGL's point of view.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - blendMode - Number - - - - -
      -

      the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:21 - -

    - - - - - -
    - -
    -

    Sets the WebGL Context.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    currentBlendMode

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/WebGLFastSpriteBatch.html b/tutorial-3/pixi.js-master/docs/classes/WebGLFastSpriteBatch.html deleted file mode 100755 index fcc1a27..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/WebGLFastSpriteBatch.html +++ /dev/null @@ -1,1831 +0,0 @@ - - - - - WebGLFastSpriteBatch - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLFastSpriteBatch Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLFastSpriteBatch

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:11 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    begin

    - - -
    - (
      - -
    • - - spriteBatch - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:154 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - spriteBatch - WebGLSpriteBatch - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    end

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:169 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    flush

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:349 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    render

    - - -
    - (
      - -
    • - - spriteBatch - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:177 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    renderSprite

    - - -
    - (
      - -
    • - - sprite - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:208 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - sprite - Sprite - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:130 - -

    - - - - - -
    - -
    -

    Sets the WebGL Context.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    start

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:397 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    stop

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:389 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    currentBaseTexture

    - BaseTexture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:95 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    currentBatchSize

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:89 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    currentBlendMode

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:101 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    drawing

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:83 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    indexBuffer

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:61 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    indices

    - Uint16Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:48 - -

    - - - - -
    - -
    -

    Index data

    - -
    - - - - - - -
    - - -
    -

    lastIndexCount

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:67 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    matrix

    - Matrix - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:119 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    maxSize

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:23 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    renderSession

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:107 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    shader

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:113 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    size

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:29 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    vertexBuffer

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:55 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    vertices

    - Float32Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:41 - -

    - - - - -
    - -
    -

    Vertex data

    - -
    - - - - - - -
    - - -
    -

    vertSize

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:17 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/WebGLFilterManager.html b/tutorial-3/pixi.js-master/docs/classes/WebGLFilterManager.html deleted file mode 100755 index 004f51f..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/WebGLFilterManager.html +++ /dev/null @@ -1,1229 +0,0 @@ - - - - - WebGLFilterManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLFilterManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLFilterManager

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    applyFilterPass

    - - -
    - (
      - -
    • - - filter - -
    • - -
    • - - filterArea - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:315 - -

    - - - - - -
    - -
    -

    Applies the filter to the specified area.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - filter - AbstractFilter - - - - -
      -

      the filter that needs to be applied

      - -
      - - -
    • - -
    • - - filterArea - Texture - - - - -
      -

      TODO - might need an update

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      the horizontal range of the filter

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the vertical range of the filter

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    begin

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    • - - buffer - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:46 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    • - - buffer - ArrayBuffer - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:424 - -

    - - - - - -
    - -
    -

    Destroys the filter and removes it from the filter stack.

    - -
    - - - - - - -
    - - -
    -

    initShaderBuffers

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:376 - -

    - - - - - -
    - -
    -

    Initialises the shader buffers.

    - -
    - - - - - - -
    - - -
    -

    popFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:138 - -

    - - - - - -
    - -
    -

    Removes the last filter from the filter stack and doesn't return it.

    - -
    - - - - - - -
    - - -
    -

    pushFilter

    - - -
    - (
      - -
    • - - filterBlock - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:62 - -

    - - - - - -
    - -
    -

    Applies the filter and adds it to the current filter stack.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - filterBlock - Object - - - - -
      -

      the filter that will be pushed to the current filter stack

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:32 - -

    - - - - - -
    - -
    -

    Initialises the context and the properties.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    filterStack

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:11 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    offsetX

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:17 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    offsetY

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:23 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/WebGLGraphics.html b/tutorial-3/pixi.js-master/docs/classes/WebGLGraphics.html deleted file mode 100755 index f33138b..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/WebGLGraphics.html +++ /dev/null @@ -1,1683 +0,0 @@ - - - - - WebGLGraphics - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLGraphics Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A set of functions used by the webGL renderer to draw the primitive graphics data

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    buildCircle

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:421 - -

    - - - - - -
    - -
    -

    Builds a circle to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object to draw

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    buildComplexPoly

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:716 - -

    - - - - - -
    - -
    -

    Builds a complex polygon to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object containing all the necessary properties

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    buildLine

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:504 - -

    - - - - - -
    - -
    -

    Builds a line to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object containing all the necessary properties

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    buildPoly

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:778 - -

    - - - - - -
    - -
    -

    Builds a polygon to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object containing all the necessary properties

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    buildRectangle

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:233 - -

    - - - - - -
    - -
    -

    Builds a rectangle to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object containing all the necessary properties

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    buildRoundedRectangle

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:301 - -

    - - - - - -
    - -
    -

    Builds a rounded rectangle to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object containing all the necessary properties

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    quadraticBezierCurve

    - - -
    - (
      - -
    • - - fromX - -
    • - -
    • - - fromY - -
    • - -
    • - - cpX - -
    • - -
    • - - cpY - -
    • - -
    • - - toX - -
    • - -
    • - - toY - -
    • - -
    ) -
    - - - - - Array - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:369 - -

    - - - - - -
    - -
    -

    Calculate the points for a quadratic bezier curve. (helper function..) -Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - fromX - Number - - - - -
      -

      Origin point x

      - -
      - - -
    • - -
    • - - fromY - Number - - - - -
      -

      Origin point x

      - -
      - - -
    • - -
    • - - cpX - Number - - - - -
      -

      Control point x

      - -
      - - -
    • - -
    • - - cpY - Number - - - - -
      -

      Control point y

      - -
      - - -
    • - -
    • - - toX - Number - - - - -
      -

      Destination point x

      - -
      - - -
    • - -
    • - - toY - Number - - - - -
      -

      Destination point y

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - - -
    -
    - - - -
    - - -
    -

    renderGraphics

    - - -
    - (
      - -
    • - - graphics - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:16 - -

    - - - - - -
    - -
    -

    Renders the graphics object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphics - Graphics - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    switchMode

    - - -
    - (
      - -
    • - - webGL - -
    • - -
    • - - type - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:199 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - webGL - WebGLContext - - - - -
      - -
      - - -
    • - -
    • - - type - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    updateGraphics

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:84 - -

    - - - - - -
    - -
    -

    Updates the graphics object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object to update

      - -
      - - -
    • - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/WebGLGraphicsData.html b/tutorial-3/pixi.js-master/docs/classes/WebGLGraphicsData.html deleted file mode 100755 index d099949..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/WebGLGraphicsData.html +++ /dev/null @@ -1,470 +0,0 @@ - - - - - WebGLGraphicsData - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLGraphicsData Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    reset

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:850 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    upload

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:860 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/WebGLMaskManager.html b/tutorial-3/pixi.js-master/docs/classes/WebGLMaskManager.html deleted file mode 100755 index 0642f8b..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/WebGLMaskManager.html +++ /dev/null @@ -1,798 +0,0 @@ - - - - - WebGLMaskManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLMaskManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLMaskManager

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js:61 - -

    - - - - - -
    - -
    -

    Destroys the mask stack.

    - -
    - - - - - - -
    - - -
    -

    popMask

    - - -
    - (
      - -
    • - - maskData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js:48 - -

    - - - - - -
    - -
    -

    Removes the last filter from the filter stack and doesn't return it.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - maskData - Array - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      -

      an object containing all the useful parameters

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    pushMask

    - - -
    - (
      - -
    • - - maskData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js:27 - -

    - - - - - -
    - -
    -

    Applies the Mask and adds it to the current filter stack.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - maskData - Array - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js:16 - -

    - - - - - -
    - -
    -

    Sets the drawing context to the one given in parameter.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/WebGLRenderer.html b/tutorial-3/pixi.js-master/docs/classes/WebGLRenderer.html deleted file mode 100755 index 15691a5..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/WebGLRenderer.html +++ /dev/null @@ -1,2526 +0,0 @@ - - - - - WebGLRenderer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLRenderer Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer -should be used for browsers that support webGL. This Render works by automatically managing webGLBatchs. -So no need for Sprite Batches or Sprite Clouds. -Don't forget to add the view to your DOM or you will not see anything :)

    - -
    - - -
    -

    Constructor

    -
    -

    WebGLRenderer

    - - -
    - (
      - -
    • - - [width=0] - -
    • - -
    • - - [height=0] - -
    • - -
    • - - [options] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:8 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - [width=0] - Number - optional - - - - -
      -

      the width of the canvas view

      - -
      - - -
    • - -
    • - - [height=0] - Number - optional - - - - -
      -

      the height of the canvas view

      - -
      - - -
    • - -
    • - - [options] - Object - optional - - - - -
      -

      The optional renderer parameters

      - -
      - - -
        - -
      • - - [view] - HTMLCanvasElement - optional - - -
        -

        the canvas to use as a view, optional

        - -
        - - -
      • - -
      • - - [transparent=false] - Boolean - optional - - -
        -

        If the render view is transparent, default false

        - -
        - - -
      • - -
      • - - [autoResize=false] - Boolean - optional - - -
        -

        If the render view is automatically resized, default false

        - -
        - - -
      • - -
      • - - [antialias=false] - Boolean - optional - - -
        -

        sets antialias (only applicable in chrome at the moment)

        - -
        - - -
      • - -
      • - - [preserveDrawingBuffer=false] - Boolean - optional - - -
        -

        enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context

        - -
        - - -
      • - -
      • - - [resolution=1] - Number - optional - - -
        -

        the resolution of the renderer retina would be 2

        - -
        - - -
      • - -
      - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:477 - -

    - - - - - -
    - -
    -

    Removes everything from the renderer (event listeners, spritebatch, etc...)

    - -
    - - - - - - -
    - - -
    -

    handleContextLost

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:443 - -

    - - - - - -
    - -
    -

    Handles a lost webgl context

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    handleContextRestored

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:456 - -

    - - - - - -
    - -
    -

    Handles a restored webgl context

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    initContext

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:238 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    mapBlendModes

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:508 - -

    - - - - - -
    - -
    -

    Maps Pixi blend modes to WebGL blend modes.

    - -
    - - - - - - -
    - - -
    -

    render

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:276 - -

    - - - - - -
    - -
    -

    Renders the stage to its webGL view

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the Stage element to be rendered

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderDisplayObject

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - projection - -
    • - -
    • - - buffer - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:344 - -

    - - - - - -
    - -
    -

    Renders a Display Object.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      The DisplayObject to render

      - -
      - - -
    • - -
    • - - projection - Point - - - - -
      -

      The projection

      - -
      - - -
    • - -
    • - - buffer - Array - - - - -
      -

      a standard WebGL buffer

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    resize

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:378 - -

    - - - - - -
    - -
    -

    Resizes the webGL view to the specified width and height.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      the new width of the webGL view

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the new height of the webGL view

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    updateTexture

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:404 - -

    - - - - - -
    - -
    -

    Updates and Creates a WebGL texture for the renderers context.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      the texture to update

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _contextOptions

    - Object - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:142 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    autoResize

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:71 - -

    - - - - -
    - -
    -

    Whether the render view should be resized automatically

    - -
    - - - - - - -
    - - -
    -

    blendModeManager

    - WebGLBlendModeManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:204 - -

    - - - - -
    - -
    -

    Manages the blendModes

    - -
    - - - - - - -
    - - -
    -

    clearBeforeRender

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:87 - -

    - - - - -
    - -
    -

    This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true: -If the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0). -If the Stage is transparent, Pixi will clear to the target Stage's background color. -Disable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set.

    - -
    - - - - - - -
    - - -
    -

    contextLostBound

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:127 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    contextRestoredBound

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:133 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    filterManager

    - WebGLFilterManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:190 - -

    - - - - -
    - -
    -

    Manages the filters

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:108 - -

    - - - - -
    - -
    -

    The height of the canvas view

    - -
    - - -

    Default: 600

    - - - - - -
    - - -
    -

    maskManager

    - WebGLMaskManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:183 - -

    - - - - -
    - -
    -

    Manages the masks using the stencil buffer

    - -
    - - - - - - -
    - - -
    -

    offset

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:161 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    preserveDrawingBuffer

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:79 - -

    - - - - -
    - -
    -

    The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering.

    - -
    - - - - - - -
    - - -
    -

    projection

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:155 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    renderSession

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:211 - -

    - - - - -
    - -
    -

    TODO remove

    - -
    - - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:52 - -

    - - - - -
    - -
    -

    The resolution of the renderer

    - -
    - - -

    Default: 1

    - - - - - -
    - - -
    -

    shaderManager

    - WebGLShaderManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:169 - -

    - - - - -
    - -
    -

    Deals with managing the shader programs and their attribs

    - -
    - - - - - - -
    - - -
    -

    spriteBatch

    - WebGLSpriteBatch - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:176 - -

    - - - - -
    - -
    -

    Manages the rendering of sprites

    - -
    - - - - - - -
    - - -
    -

    stencilManager

    - WebGLStencilManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:197 - -

    - - - - -
    - -
    -

    Manages the stencil buffer

    - -
    - - - - - - -
    - - -
    -

    transparent

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:63 - -

    - - - - -
    - -
    -

    Whether the render view is transparent

    - -
    - - - - - - -
    - - -
    -

    type

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:46 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    view

    - HTMLCanvasElement - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:117 - -

    - - - - -
    - -
    -

    The canvas element that everything is drawn to

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:99 - -

    - - - - -
    - -
    -

    The width of the canvas view

    - -
    - - -

    Default: 800

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/WebGLShaderManager.html b/tutorial-3/pixi.js-master/docs/classes/WebGLShaderManager.html deleted file mode 100755 index 376b9d7..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/WebGLShaderManager.html +++ /dev/null @@ -1,976 +0,0 @@ - - - - - WebGLShaderManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLShaderManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLShaderManager

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:135 - -

    - - - - - -
    - -
    -

    Destroys this object.

    - -
    - - - - - - -
    - - -
    -

    setAttribs

    - - -
    - (
      - -
    • - - attribs - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:72 - -

    - - - - - -
    - -
    -

    Takes the attributes given in parameters.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - attribs - Array - - - - -
      -

      attribs

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:45 - -

    - - - - - -
    - -
    -

    Initialises the context and the properties.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setShader

    - - -
    - (
      - -
    • - - shader - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:115 - -

    - - - - - -
    - -
    -

    Sets the current shader.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - shader - Any - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    attribState

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:18 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    maxAttibs

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    stack

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:35 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    tempAttribState

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/WebGLSpriteBatch.html b/tutorial-3/pixi.js-master/docs/classes/WebGLSpriteBatch.html deleted file mode 100755 index b4101f2..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/WebGLSpriteBatch.html +++ /dev/null @@ -1,2619 +0,0 @@ - - - - - WebGLSpriteBatch - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLSpriteBatch Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLSpriteBatch

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:11 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _CompileShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    • - - shaderSrc - -
    • - -
    • - - shaderType - -
    • - -
    ) -
    - - - - - Any - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:38 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    • - - shaderSrc - Array - - - - -
      - -
      - - -
    • - -
    • - - shaderType - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Any: - - -
    -
    - - - -
    - - -
    -

    begin

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:164 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The RenderSession object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    CompileFragmentShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    • - - shaderSrc - -
    • - -
    ) -
    - - - - - Any - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:26 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    • - - shaderSrc - Array - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Any: - - -
    -
    - - - -
    - - -
    -

    compileProgram

    - - -
    - (
      - -
    • - - gl - -
    • - -
    • - - vertexSrc - -
    • - -
    • - - fragmentSrc - -
    • - -
    ) -
    - - - - - Any - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:63 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    • - - vertexSrc - Array - - - - -
      - -
      - - -
    • - -
    • - - fragmentSrc - Array - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Any: - - -
    -
    - - - -
    - - -
    -

    CompileVertexShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    • - - shaderSrc - -
    • - -
    ) -
    - - - - - Any - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:14 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    • - - shaderSrc - Array - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Any: - - -
    -
    - - - -
    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:589 - -

    - - - - - -
    - -
    -

    Destroys the SpriteBatch.

    - -
    - - - - - - -
    - - -
    -

    end

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:176 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    flush

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:418 - -

    - - - - - -
    - -
    -

    Renders the content and empties the current batch.

    - -
    - - - - - - -
    - - -
    -

    initDefaultShaders

    - - - () - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    render

    - - -
    - (
      - -
    • - - sprite - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:184 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - sprite - Sprite - - - - -
      -

      the sprite to render when using this spritebatch

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderBatch

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - size - -
    • - -
    • - - startIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:542 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      - -
      - - -
    • - -
    • - - size - Number - - - - -
      - -
      - - -
    • - -
    • - - startIndex - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderTilingSprite

    - - -
    - (
      - -
    • - - sprite - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:297 - -

    - - - - - -
    - -
    -

    Renders a TilingSprite using the spriteBatch.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - sprite - TilingSprite - - - - -
      -

      the tilingSprite to render

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:132 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    start

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:581 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    stop

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:572 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blendModes

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:99 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    currentBaseTexture

    - BaseTexture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:81 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    currentBatchSize

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:75 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    defaultShader

    - AbstractFilter - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:117 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:87 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    drawing

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:69 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    indices

    - Uint16Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:45 - -

    - - - - -
    - -
    -

    Holds the indices

    - -
    - - - - - - -
    - - -
    -

    lastIndexCount

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:53 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:105 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    size

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:25 - -

    - - - - -
    - -
    -

    The number of images in the SpriteBatch before it flushes

    - -
    - - - - - - -
    - - -
    -

    sprites

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:111 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    textures

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:93 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    vertices

    - Float32Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:37 - -

    - - - - -
    - -
    -

    Holds the vertices

    - -
    - - - - - - -
    - - -
    -

    vertSize

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:19 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/WebGLStencilManager.html b/tutorial-3/pixi.js-master/docs/classes/WebGLStencilManager.html deleted file mode 100755 index 2dac12b..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/WebGLStencilManager.html +++ /dev/null @@ -1,975 +0,0 @@ - - - - - WebGLStencilManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLStencilManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLStencilManager

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    bindGraphics

    - - -
    - (
      - -
    • - - graphics - -
    • - -
    • - - webGLData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:120 - -

    - - - - - -
    - -
    -

    TODO this does not belong here!

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphics - Graphics - - - - -
      - -
      - - -
    • - -
    • - - webGLData - Array - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:285 - -

    - - - - - -
    - -
    -

    Destroys the mask stack.

    - -
    - - - - - - -
    - - -
    -

    popStencil

    - - -
    - (
      - -
    • - - graphics - -
    • - -
    • - - webGLData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:190 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphics - Graphics - - - - -
      - -
      - - -
    • - -
    • - - webGLData - Array - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    pushMask

    - - -
    - (
      - -
    • - - graphics - -
    • - -
    • - - webGLData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:28 - -

    - - - - - -
    - -
    -

    Applies the Mask and adds it to the current filter stack.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphics - Graphics - - - - -
      - -
      - - -
    • - -
    • - - webGLData - Array - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:17 - -

    - - - - - -
    - -
    -

    Sets the drawing context to the one given in parameter.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/autoDetectRecommendedRenderer.html b/tutorial-3/pixi.js-master/docs/classes/autoDetectRecommendedRenderer.html deleted file mode 100755 index c222af0..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/autoDetectRecommendedRenderer.html +++ /dev/null @@ -1,336 +0,0 @@ - - - - - autoDetectRecommendedRenderer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    autoDetectRecommendedRenderer Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This helper function will automatically detect which renderer you should be using. -This function is very similar to the autoDetectRenderer function except that is will return a canvas renderer for android. -Even thought both android chrome supports webGL the canvas implementation perform better at the time of writing. -This function will likely change and update as webGL performance improves on these devices.

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - - - - - - - -
    - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/autoDetectRenderer.html b/tutorial-3/pixi.js-master/docs/classes/autoDetectRenderer.html deleted file mode 100755 index bbf799f..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/autoDetectRenderer.html +++ /dev/null @@ -1,335 +0,0 @@ - - - - - autoDetectRenderer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    autoDetectRenderer Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This helper function will automatically detect which renderer you should be using. -WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by -the browser then this function will return a canvas renderer

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - - - - - - - -
    - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/classes/index.html b/tutorial-3/pixi.js-master/docs/classes/index.html deleted file mode 100755 index 487fe15..0000000 --- a/tutorial-3/pixi.js-master/docs/classes/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Redirector - - - - Click here to redirect - - diff --git a/tutorial-3/pixi.js-master/docs/data.json b/tutorial-3/pixi.js-master/docs/data.json deleted file mode 100755 index e0b8298..0000000 --- a/tutorial-3/pixi.js-master/docs/data.json +++ /dev/null @@ -1,12399 +0,0 @@ -{ - "project": { - "name": "pixi.js", - "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", - "version": "2.1.0", - "url": "http://goodboydigital.com/", - "logo": "http://www.goodboydigital.com/pixijs/logo_small.png" - }, - "files": { - "src/pixi/display/DisplayObject.js": { - "name": "src/pixi/display/DisplayObject.js", - "modules": {}, - "classes": { - "DisplayObject": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/display/DisplayObjectContainer.js": { - "name": "src/pixi/display/DisplayObjectContainer.js", - "modules": {}, - "classes": { - "DisplayObjectContainer": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/display/MovieClip.js": { - "name": "src/pixi/display/MovieClip.js", - "modules": {}, - "classes": { - "MovieClip": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/display/Sprite.js": { - "name": "src/pixi/display/Sprite.js", - "modules": {}, - "classes": { - "Sprite": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/display/SpriteBatch.js": { - "name": "src/pixi/display/SpriteBatch.js", - "modules": {}, - "classes": { - "SpriteBatch": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/display/Stage.js": { - "name": "src/pixi/display/Stage.js", - "modules": {}, - "classes": { - "Stage": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/extras/Rope.js": { - "name": "src/pixi/extras/Rope.js", - "modules": {}, - "classes": { - "Rope": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/extras/Spine.js": { - "name": "src/pixi/extras/Spine.js", - "modules": {}, - "classes": { - "Spine": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/extras/Strip.js": { - "name": "src/pixi/extras/Strip.js", - "modules": {}, - "classes": { - "Strip": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/extras/TilingSprite.js": { - "name": "src/pixi/extras/TilingSprite.js", - "modules": {}, - "classes": { - "TilingSprite": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/AbstractFilter.js": { - "name": "src/pixi/filters/AbstractFilter.js", - "modules": {}, - "classes": { - "AbstractFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/AlphaMaskFilter.js": { - "name": "src/pixi/filters/AlphaMaskFilter.js", - "modules": {}, - "classes": { - "AlphaMaskFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/AsciiFilter.js": { - "name": "src/pixi/filters/AsciiFilter.js", - "modules": {}, - "classes": { - "AsciiFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/BlurFilter.js": { - "name": "src/pixi/filters/BlurFilter.js", - "modules": {}, - "classes": { - "BlurFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/BlurXFilter.js": { - "name": "src/pixi/filters/BlurXFilter.js", - "modules": {}, - "classes": { - "BlurXFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/BlurYFilter.js": { - "name": "src/pixi/filters/BlurYFilter.js", - "modules": {}, - "classes": { - "BlurYFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/ColorMatrixFilter.js": { - "name": "src/pixi/filters/ColorMatrixFilter.js", - "modules": {}, - "classes": { - "ColorMatrixFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/ColorStepFilter.js": { - "name": "src/pixi/filters/ColorStepFilter.js", - "modules": {}, - "classes": { - "ColorStepFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/ConvolutionFilter.js": { - "name": "src/pixi/filters/ConvolutionFilter.js", - "modules": {}, - "classes": { - "ConvolutionFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/CrossHatchFilter.js": { - "name": "src/pixi/filters/CrossHatchFilter.js", - "modules": {}, - "classes": { - "CrossHatchFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/DisplacementFilter.js": { - "name": "src/pixi/filters/DisplacementFilter.js", - "modules": {}, - "classes": { - "DisplacementFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/DotScreenFilter.js": { - "name": "src/pixi/filters/DotScreenFilter.js", - "modules": {}, - "classes": { - "DotScreenFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/FilterBlock.js": { - "name": "src/pixi/filters/FilterBlock.js", - "modules": {}, - "classes": { - "FilterBlock": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/GrayFilter.js": { - "name": "src/pixi/filters/GrayFilter.js", - "modules": {}, - "classes": { - "GrayFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/InvertFilter.js": { - "name": "src/pixi/filters/InvertFilter.js", - "modules": {}, - "classes": { - "InvertFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/NoiseFilter.js": { - "name": "src/pixi/filters/NoiseFilter.js", - "modules": {}, - "classes": { - "NoiseFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/NormalMapFilter.js": { - "name": "src/pixi/filters/NormalMapFilter.js", - "modules": {}, - "classes": { - "NormalMapFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/PixelateFilter.js": { - "name": "src/pixi/filters/PixelateFilter.js", - "modules": {}, - "classes": { - "PixelateFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/RGBSplitFilter.js": { - "name": "src/pixi/filters/RGBSplitFilter.js", - "modules": {}, - "classes": { - "RGBSplitFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/SepiaFilter.js": { - "name": "src/pixi/filters/SepiaFilter.js", - "modules": {}, - "classes": { - "SepiaFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/SmartBlurFilter.js": { - "name": "src/pixi/filters/SmartBlurFilter.js", - "modules": {}, - "classes": { - "SmartBlurFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/TiltShiftFilter.js": { - "name": "src/pixi/filters/TiltShiftFilter.js", - "modules": {}, - "classes": { - "TiltShiftFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/TiltShiftXFilter.js": { - "name": "src/pixi/filters/TiltShiftXFilter.js", - "modules": {}, - "classes": { - "TiltShiftXFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/TiltShiftYFilter.js": { - "name": "src/pixi/filters/TiltShiftYFilter.js", - "modules": {}, - "classes": { - "TiltShiftYFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/TwistFilter.js": { - "name": "src/pixi/filters/TwistFilter.js", - "modules": {}, - "classes": { - "TwistFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Circle.js": { - "name": "src/pixi/geom/Circle.js", - "modules": {}, - "classes": { - "Circle": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Ellipse.js": { - "name": "src/pixi/geom/Ellipse.js", - "modules": {}, - "classes": { - "Ellipse": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Matrix.js": { - "name": "src/pixi/geom/Matrix.js", - "modules": {}, - "classes": { - "Matrix": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Point.js": { - "name": "src/pixi/geom/Point.js", - "modules": {}, - "classes": { - "Point": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Polygon.js": { - "name": "src/pixi/geom/Polygon.js", - "modules": {}, - "classes": { - "Polygon": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Rectangle.js": { - "name": "src/pixi/geom/Rectangle.js", - "modules": {}, - "classes": { - "Rectangle": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/RoundedRectangle.js": { - "name": "src/pixi/geom/RoundedRectangle.js", - "modules": {}, - "classes": { - "Rounded Rectangle": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/loaders/AssetLoader.js": { - "name": "src/pixi/loaders/AssetLoader.js", - "modules": {}, - "classes": { - "AssetLoader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/loaders/AtlasLoader.js": { - "name": "src/pixi/loaders/AtlasLoader.js", - "modules": {}, - "classes": { - "AtlasLoader": 1 - }, - "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/JsonLoader.js": { - "name": "src/pixi/loaders/JsonLoader.js", - "modules": {}, - "classes": { - "JsonLoader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/loaders/SpineLoader.js": { - "name": "src/pixi/loaders/SpineLoader.js", - "modules": {}, - "classes": { - "SpineLoader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/loaders/SpriteSheetLoader.js": { - "name": "src/pixi/loaders/SpriteSheetLoader.js", - "modules": {}, - "classes": { - "SpriteSheetLoader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/primitives/Graphics.js": { - "name": "src/pixi/primitives/Graphics.js", - "modules": {}, - "classes": { - "Graphics": 1, - "GraphicsData": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/canvas/utils/CanvasBuffer.js": { - "name": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "modules": {}, - "classes": { - "CanvasBuffer": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/canvas/utils/CanvasMaskManager.js": { - "name": "src/pixi/renderers/canvas/utils/CanvasMaskManager.js", - "modules": {}, - "classes": { - "CanvasMaskManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/canvas/utils/CanvasTinter.js": { - "name": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "modules": {}, - "classes": { - "CanvasTinter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/canvas/CanvasGraphics.js": { - "name": "src/pixi/renderers/canvas/CanvasGraphics.js", - "modules": {}, - "classes": { - "CanvasGraphics": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/canvas/CanvasRenderer.js": { - "name": "src/pixi/renderers/canvas/CanvasRenderer.js", - "modules": {}, - "classes": { - "CanvasRenderer": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js": { - "name": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "modules": {}, - "classes": { - "ComplexPrimitiveShader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/shaders/PixiFastShader.js": { - "name": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "modules": {}, - "classes": { - "PixiFastShader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/shaders/PixiShader.js": { - "name": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "modules": {}, - "classes": { - "PixiShader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/shaders/PrimitiveShader.js": { - "name": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "modules": {}, - "classes": { - "PrimitiveShader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/shaders/StripShader.js": { - "name": "src/pixi/renderers/webgl/shaders/StripShader.js", - "modules": {}, - "classes": { - "StripShader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/FilterTexture.js": { - "name": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "modules": {}, - "classes": { - "FilterTexture": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "modules": {}, - "classes": { - "WebGLBlendModeManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "modules": {}, - "classes": { - "WebGLFastSpriteBatch": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLFilterManager.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "modules": {}, - "classes": { - "WebGLFilterManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLGraphics.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "modules": {}, - "classes": { - "WebGLGraphics": 1, - "WebGLGraphicsData": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLMaskManager.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "modules": {}, - "classes": { - "WebGLMaskManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLShaderManager.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "modules": {}, - "classes": { - "WebGLShaderManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "modules": {}, - "classes": { - "WebGLSpriteBatch": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLStencilManager.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "modules": {}, - "classes": { - "WebGLStencilManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/WebGLRenderer.js": { - "name": "src/pixi/renderers/webgl/WebGLRenderer.js", - "modules": {}, - "classes": { - "WebGLRenderer": 1 - }, - "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": {}, - "classes": { - "BaseTexture": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/textures/RenderTexture.js": { - "name": "src/pixi/textures/RenderTexture.js", - "modules": {}, - "classes": { - "RenderTexture": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/textures/Texture.js": { - "name": "src/pixi/textures/Texture.js", - "modules": {}, - "classes": { - "Texture": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/textures/VideoTexture.js": { - "name": "src/pixi/textures/VideoTexture.js", - "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} - }, - "src/pixi/utils/Detector.js": { - "name": "src/pixi/utils/Detector.js", - "modules": {}, - "classes": { - "autoDetectRenderer": 1, - "autoDetectRecommendedRenderer": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/utils/EventTarget.js": { - "name": "src/pixi/utils/EventTarget.js", - "modules": {}, - "classes": { - "EventTarget": 1, - "Event": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/utils/Polyk.js": { - "name": "src/pixi/utils/Polyk.js", - "modules": {}, - "classes": { - "PolyK": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/utils/Utils.js": { - "name": "src/pixi/utils/Utils.js", - "modules": {}, - "classes": { - "AjaxRequest": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/InteractionData.js": { - "name": "src/pixi/InteractionData.js", - "modules": {}, - "classes": { - "InteractionData": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/InteractionManager.js": { - "name": "src/pixi/InteractionManager.js", - "modules": {}, - "classes": { - "InteractionManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/Intro.js": { - "name": "src/pixi/Intro.js", - "modules": {}, - "classes": {}, - "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": { - "PIXI": 1 - }, - "classes": {}, - "fors": {}, - "namespaces": {} - } - }, - "modules": { - "PIXI": { - "name": "PIXI", - "submodules": {}, - "classes": { - "DisplayObject": 1, - "DisplayObjectContainer": 1, - "MovieClip": 1, - "Sprite": 1, - "SpriteBatch": 1, - "Stage": 1, - "Rope": 1, - "Spine": 1, - "Strip": 1, - "TilingSprite": 1, - "AbstractFilter": 1, - "AlphaMaskFilter": 1, - "AsciiFilter": 1, - "BlurFilter": 1, - "BlurXFilter": 1, - "BlurYFilter": 1, - "ColorMatrixFilter": 1, - "ColorStepFilter": 1, - "ConvolutionFilter": 1, - "CrossHatchFilter": 1, - "DisplacementFilter": 1, - "DotScreenFilter": 1, - "FilterBlock": 1, - "GrayFilter": 1, - "InvertFilter": 1, - "NoiseFilter": 1, - "NormalMapFilter": 1, - "PixelateFilter": 1, - "RGBSplitFilter": 1, - "SepiaFilter": 1, - "SmartBlurFilter": 1, - "TiltShiftFilter": 1, - "TiltShiftXFilter": 1, - "TiltShiftYFilter": 1, - "TwistFilter": 1, - "Circle": 1, - "Ellipse": 1, - "Matrix": 1, - "Point": 1, - "Polygon": 1, - "Rectangle": 1, - "Rounded Rectangle": 1, - "AssetLoader": 1, - "AtlasLoader": 1, - "BitmapFontLoader": 1, - "ImageLoader": 1, - "JsonLoader": 1, - "SpineLoader": 1, - "SpriteSheetLoader": 1, - "Graphics": 1, - "GraphicsData": 1, - "CanvasBuffer": 1, - "CanvasMaskManager": 1, - "CanvasTinter": 1, - "CanvasGraphics": 1, - "CanvasRenderer": 1, - "ComplexPrimitiveShader": 1, - "PixiFastShader": 1, - "PixiShader": 1, - "PrimitiveShader": 1, - "StripShader": 1, - "FilterTexture": 1, - "WebGLBlendModeManager": 1, - "WebGLFastSpriteBatch": 1, - "WebGLFilterManager": 1, - "WebGLGraphics": 1, - "WebGLGraphicsData": 1, - "WebGLMaskManager": 1, - "WebGLShaderManager": 1, - "WebGLSpriteBatch": 1, - "WebGLStencilManager": 1, - "WebGLRenderer": 1, - "BitmapText": 1, - "Text": 1, - "BaseTexture": 1, - "RenderTexture": 1, - "Texture": 1, - "autoDetectRenderer": 1, - "autoDetectRecommendedRenderer": 1, - "EventTarget": 1, - "Event": 1, - "PolyK": 1, - "AjaxRequest": 1, - "InteractionData": 1, - "InteractionManager": 1 - }, - "fors": {}, - "namespaces": {}, - "tag": "module", - "file": "src/pixi/InteractionManager.js", - "line": 5 - } - }, - "classes": { - "DisplayObject": { - "name": "DisplayObject", - "shortname": "DisplayObject", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/DisplayObject.js", - "line": 5, - "description": "The base class for all objects that are rendered on the screen.\nThis is an abstract class and should not be used on its own rather it should be extended.", - "is_constructor": 1 - }, - "DisplayObjectContainer": { - "name": "DisplayObjectContainer", - "shortname": "DisplayObjectContainer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 5, - "description": "A DisplayObjectContainer represents a collection of display objects.\nIt is the base class of all display objects that act as a container for other objects.", - "extends": "DisplayObject", - "is_constructor": 1 - }, - "MovieClip": { - "name": "MovieClip", - "shortname": "MovieClip", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/MovieClip.js", - "line": 5, - "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", - "extends": "Sprite", - "is_constructor": 1, - "params": [ - { - "name": "textures", - "description": "an array of {Texture} objects that make up the animation", - "type": "Array" - } - ] - }, - "Sprite": { - "name": "Sprite", - "shortname": "Sprite", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/Sprite.js", - "line": 5, - "description": "The Sprite object is the base for all textured objects that are rendered to the screen", - "extends": "DisplayObjectContainer", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "The texture for this sprite\n\nA sprite can be created directly from an image like this :\nvar sprite = new PIXI.Sprite.fromImage('assets/image.png');\nyourStage.addChild(sprite);\nthen obviously don't forget to add it to the stage you have already created", - "type": "Texture" - } - ] - }, - "SpriteBatch": { - "name": "SpriteBatch", - "shortname": "SpriteBatch", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/SpriteBatch.js", - "line": 5, - "description": "The SpriteBatch class is a really fast version of the DisplayObjectContainer \nbuilt solely for speed, so use when you need a lot of sprites or particles.\nAnd it's extremely easy to use : \n\n var container = new PIXI.SpriteBatch();\n\n stage.addChild(container);\n\n for(var i = 0; i < 100; i++)\n {\n var sprite = new PIXI.Sprite.fromImage(\"myImage.png\");\n container.addChild(sprite);\n }\nAnd here you have a hundred sprites that will be renderer at the speed of light", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "", - "type": "Texture" - } - ] - }, - "Stage": { - "name": "Stage", - "shortname": "Stage", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/Stage.js", - "line": 5, - "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", - "extends": "DisplayObjectContainer", - "is_constructor": 1, - "params": [ - { - "name": "backgroundColor", - "description": "the background color of the stage, you have to pass this in is in hex format\n like: 0xFFFFFF for white\n\nCreating a stage is a mandatory process when you use Pixi, which is as simple as this : \nvar stage = new PIXI.Stage(0xFFFFFF);\nwhere the parameter given is the background colour of the stage, in hex\nyou will use this stage instance to add your sprites to it and therefore to the renderer\nHere is how to add a sprite to the stage : \nstage.addChild(sprite);", - "type": "Number" - } - ] - }, - "Rope": { - "name": "Rope", - "shortname": "Rope", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/extras/Rope.js", - "line": 6, - "is_constructor": 1, - "extends": "Strip", - "params": [ - { - "name": "texture", - "description": "- The texture to use on the rope.", - "type": "Texture" - }, - { - "name": "points", - "description": "- An array of {PIXI.Point}.", - "type": "Array" - } - ] - }, - "Spine": { - "name": "Spine", - "shortname": "Spine", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/extras/Spine.js", - "line": 1357, - "description": "A class that enables the you to import and run your spine animations in pixi.\nSpine animation data needs to be loaded using the PIXI.AssetLoader or PIXI.SpineLoader before it can be used by this class\nSee example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source", - "extends": "DisplayObjectContainer", - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the spine anim file to be used", - "type": "String" - } - ] - }, - "Strip": { - "name": "Strip", - "shortname": "Strip", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/extras/Strip.js", - "line": 5, - "extends": "DisplayObjectContainer", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "The texture to use", - "type": "Texture" - }, - { - "name": "width", - "description": "the width", - "type": "Number" - }, - { - "name": "height", - "description": "the height", - "type": "Number" - } - ] - }, - "TilingSprite": { - "name": "TilingSprite", - "shortname": "TilingSprite", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/extras/TilingSprite.js", - "line": 5, - "description": "A tiling sprite is a fast way of rendering a tiling image", - "extends": "Sprite", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "the texture of the tiling sprite", - "type": "Texture" - }, - { - "name": "width", - "description": "the width of the tiling sprite", - "type": "Number" - }, - { - "name": "height", - "description": "the height of the tiling sprite", - "type": "Number" - } - ] - }, - "AbstractFilter": { - "name": "AbstractFilter", - "shortname": "AbstractFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/AbstractFilter.js", - "line": 5, - "description": "This is the base class for creating a PIXI filter. Currently only webGL supports filters.\nIf you want to make a custom filter this should be your base class.", - "is_constructor": 1, - "params": [ - { - "name": "fragmentSrc", - "description": "The fragment source in an array of strings.", - "type": "Array" - }, - { - "name": "uniforms", - "description": "An object containing the uniforms for this filter.", - "type": "Object" - } - ] - }, - "AlphaMaskFilter": { - "name": "AlphaMaskFilter", - "shortname": "AlphaMaskFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/AlphaMaskFilter.js", - "line": 5, - "description": "The AlphaMaskFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object.\nYou can use this filter to apply all manor of crazy warping effects\nCurrently the r property of the texture is used to offset the x and the g property of the texture is used to offset the y.", - "extends": "AbstractFilter", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "The texture used for the displacement map * must be power of 2 texture at the moment", - "type": "Texture" - } - ] - }, - "AsciiFilter": { - "name": "AsciiFilter", - "shortname": "AsciiFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/AsciiFilter.js", - "line": 6, - "description": "An ASCII filter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "BlurFilter": { - "name": "BlurFilter", - "shortname": "BlurFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/BlurFilter.js", - "line": 5, - "description": "The BlurFilter applies a Gaussian blur to an object.\nThe strength of the blur can be set for x- and y-axis separately (always relative to the stage).", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "BlurXFilter": { - "name": "BlurXFilter", - "shortname": "BlurXFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/BlurXFilter.js", - "line": 5, - "description": "The BlurXFilter applies a horizontal Gaussian blur to an object.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "BlurYFilter": { - "name": "BlurYFilter", - "shortname": "BlurYFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/BlurYFilter.js", - "line": 5, - "description": "The BlurYFilter applies a vertical Gaussian blur to an object.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "ColorMatrixFilter": { - "name": "ColorMatrixFilter", - "shortname": "ColorMatrixFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/ColorMatrixFilter.js", - "line": 5, - "description": "The ColorMatrixFilter class lets you apply a 4x4 matrix transformation on the RGBA\ncolor and alpha values of every pixel on your displayObject to produce a result\nwith a new set of RGBA color and alpha values. It's pretty powerful!", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "ColorStepFilter": { - "name": "ColorStepFilter", - "shortname": "ColorStepFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/ColorStepFilter.js", - "line": 5, - "description": "This lowers the color depth of your image by the given amount, producing an image with a smaller palette.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "ConvolutionFilter": { - "name": "ConvolutionFilter", - "shortname": "ConvolutionFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/ConvolutionFilter.js", - "line": 1, - "description": "The ConvolutionFilter class applies a matrix convolution filter effect. \nA convolution combines pixels in the input image with neighboring pixels to produce a new image. \nA wide variety of image effects can be achieved through convolutions, including blurring, edge detection, sharpening, embossing, and beveling.\nThe matrix should be specified as a 9 point Array. See http://docs.gimp.org/en/plug-in-convmatrix.html for more info.", - "extends": "AbstractFilter", - "is_constructor": 1, - "params": [ - { - "name": "matrix", - "description": "An array of values used for matrix transformation. Specified as a 9 point Array.", - "type": "Array" - }, - { - "name": "width", - "description": "Width of the object you are transforming", - "type": "Number" - }, - { - "name": "height", - "description": "Height of the object you are transforming", - "type": "Number" - } - ] - }, - "CrossHatchFilter": { - "name": "CrossHatchFilter", - "shortname": "CrossHatchFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/CrossHatchFilter.js", - "line": 5, - "description": "A Cross Hatch effect filter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "DisplacementFilter": { - "name": "DisplacementFilter", - "shortname": "DisplacementFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 5, - "description": "The DisplacementFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object.\nYou can use this filter to apply all manor of crazy warping effects\nCurrently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.", - "extends": "AbstractFilter", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "The texture used for the displacement map * must be power of 2 texture at the moment", - "type": "Texture" - } - ] - }, - "DotScreenFilter": { - "name": "DotScreenFilter", - "shortname": "DotScreenFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/DotScreenFilter.js", - "line": 6, - "description": "This filter applies a dotscreen effect making display objects appear to be made out of black and white halftone dots like an old printer.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "FilterBlock": { - "name": "FilterBlock", - "shortname": "FilterBlock", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/FilterBlock.js", - "line": 5, - "description": "A target and pass info object for filters.", - "is_constructor": 1 - }, - "GrayFilter": { - "name": "GrayFilter", - "shortname": "GrayFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/GrayFilter.js", - "line": 5, - "description": "This greyscales the palette of your Display Objects.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "InvertFilter": { - "name": "InvertFilter", - "shortname": "InvertFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/InvertFilter.js", - "line": 5, - "description": "This inverts your Display Objects colors.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "NoiseFilter": { - "name": "NoiseFilter", - "shortname": "NoiseFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/NoiseFilter.js", - "line": 6, - "description": "A Noise effect filter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "NormalMapFilter": { - "name": "NormalMapFilter", - "shortname": "NormalMapFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 6, - "description": "The NormalMapFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. \nYou can use this filter to apply all manor of crazy warping effects\nCurrently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.", - "extends": "AbstractFilter", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "The texture used for the displacement map * must be power of 2 texture at the moment", - "type": "Texture" - } - ] - }, - "PixelateFilter": { - "name": "PixelateFilter", - "shortname": "PixelateFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/PixelateFilter.js", - "line": 5, - "description": "This filter applies a pixelate effect making display objects appear 'blocky'.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "RGBSplitFilter": { - "name": "RGBSplitFilter", - "shortname": "RGBSplitFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/RGBSplitFilter.js", - "line": 5, - "description": "An RGB Split Filter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "SepiaFilter": { - "name": "SepiaFilter", - "shortname": "SepiaFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/SepiaFilter.js", - "line": 5, - "description": "This applies a sepia effect to your Display Objects.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "SmartBlurFilter": { - "name": "SmartBlurFilter", - "shortname": "SmartBlurFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/SmartBlurFilter.js", - "line": 5, - "description": "A Smart Blur Filter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "TiltShiftFilter": { - "name": "TiltShiftFilter", - "shortname": "TiltShiftFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 6, - "description": "A TiltShift Filter. Manages the pass of both a TiltShiftXFilter and TiltShiftYFilter.", - "is_constructor": 1 - }, - "TiltShiftXFilter": { - "name": "TiltShiftXFilter", - "shortname": "TiltShiftXFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 6, - "description": "A TiltShiftXFilter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "TiltShiftYFilter": { - "name": "TiltShiftYFilter", - "shortname": "TiltShiftYFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 6, - "description": "A TiltShiftYFilter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "TwistFilter": { - "name": "TwistFilter", - "shortname": "TwistFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/TwistFilter.js", - "line": 5, - "description": "This filter applies a twist effect making display objects appear twisted in the given direction.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "Circle": { - "name": "Circle", - "shortname": "Circle", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Circle.js", - "line": 5, - "description": "The Circle object can be used to specify a hit area for displayObjects", - "is_constructor": 1, - "params": [ - { - "name": "x", - "description": "The X coordinate of the center of this circle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the center of this circle", - "type": "Number" - }, - { - "name": "radius", - "description": "The radius of the circle", - "type": "Number" - } - ] - }, - "Ellipse": { - "name": "Ellipse", - "shortname": "Ellipse", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Ellipse.js", - "line": 5, - "description": "The Ellipse object can be used to specify a hit area for displayObjects", - "is_constructor": 1, - "params": [ - { - "name": "x", - "description": "The X coordinate of the center of the ellipse", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the center of the ellipse", - "type": "Number" - }, - { - "name": "width", - "description": "The half width of this ellipse", - "type": "Number" - }, - { - "name": "height", - "description": "The half height of this ellipse", - "type": "Number" - } - ] - }, - "Matrix": { - "name": "Matrix", - "shortname": "Matrix", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Matrix.js", - "line": 5, - "description": "The Matrix class is now an object, which makes it a lot faster, \nhere is a representation of it : \n| a | b | tx|\n| c | d | ty|\n| 0 | 0 | 1 |", - "is_constructor": 1 - }, - "Point": { - "name": "Point", - "shortname": "Point", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Point.js", - "line": 5, - "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", - "is_constructor": 1, - "params": [ - { - "name": "x", - "description": "position of the point on the x axis", - "type": "Number" - }, - { - "name": "y", - "description": "position of the point on the y axis", - "type": "Number" - } - ] - }, - "Polygon": { - "name": "Polygon", - "shortname": "Polygon", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Polygon.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "points", - "description": "This can be an array of Points that form the polygon,\n a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be\n all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the\n arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are\n Numbers.", - "type": "Array|Array|Point...|Number...", - "multiple": true - } - ] - }, - "Rectangle": { - "name": "Rectangle", - "shortname": "Rectangle", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Rectangle.js", - "line": 5, - "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", - "is_constructor": 1, - "params": [ - { - "name": "x", - "description": "The X coordinate of the upper-left corner of the rectangle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the upper-left corner of the rectangle", - "type": "Number" - }, - { - "name": "width", - "description": "The overall width of this rectangle", - "type": "Number" - }, - { - "name": "height", - "description": "The overall height of this rectangle", - "type": "Number" - } - ] - }, - "Rounded Rectangle": { - "name": "Rounded Rectangle", - "shortname": "Rounded Rectangle", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 5, - "description": "the Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height.", - "is_constructor": 1, - "params": [ - { - "name": "x", - "description": "The X coordinate of the upper-left corner of the rounded rectangle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the upper-left corner of the rounded rectangle", - "type": "Number" - }, - { - "name": "width", - "description": "The overall width of this rounded rectangle", - "type": "Number" - }, - { - "name": "height", - "description": "The overall height of this rounded rectangle", - "type": "Number" - }, - { - "name": "radius", - "description": "The overall radius of this corners of this rounded rectangle", - "type": "Number" - } - ] - }, - "AssetLoader": { - "name": "AssetLoader", - "shortname": "AssetLoader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/loaders/AssetLoader.js", - "line": 5, - "description": "A Class that loads a bunch of images / sprite sheet / bitmap font files. Once the\nassets have been loaded they are added to the PIXI Texture cache and can be accessed\neasily 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, - "uses": [ - "EventTarget" - ], - "params": [ - { - "name": "assetURLs", - "description": "An array of image/sprite sheet urls that you would like loaded\n supported. Supported image formats include 'jpeg', 'jpg', 'png', 'gif'. Supported\n sprite sheet data formats only include 'JSON' at this time. Supported bitmap font\n data formats include 'xml' and 'fnt'.", - "type": "Array" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "AtlasLoader": { - "name": "AtlasLoader", - "shortname": "AtlasLoader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 5, - "description": "The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event.\n\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format.\n\nIt is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to 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.fromFrameId()", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the JSON file", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "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", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the sprite sheet JSON file", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "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.fromFrame() and PIXI.Sprite.fromFrame()\nWhen loaded this class will dispatch a 'loaded' event", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the image", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "JsonLoader": { - "name": "JsonLoader", - "shortname": "JsonLoader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/loaders/JsonLoader.js", - "line": 5, - "description": "The json file loader is used to load in JSON data and parse it\nWhen loaded this class will dispatch a 'loaded' event\nIf loading fails this class will dispatch an 'error' event", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the JSON file", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "SpineLoader": { - "name": "SpineLoader", - "shortname": "SpineLoader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/loaders/SpineLoader.js", - "line": 10, - "description": "The Spine loader is used to load in JSON spine data\nTo generate the data you need to use http://esotericsoftware.com/ and export in the \"JSON\" format\nDue to a clash of names You will need to change the extension of the spine file from *.json to *.anim for it to load\nSee example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source\nYou will need to generate a sprite sheet to accompany the spine data\nWhen loaded this class will dispatch a \"loaded\" event", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the JSON file", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "SpriteSheetLoader": { - "name": "SpriteSheetLoader", - "shortname": "SpriteSheetLoader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "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 in 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 a 'texture atlas') as it means sprites 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.fromFrameId()\nThis loader will load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the sprite sheet JSON file", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "Graphics": { - "name": "Graphics", - "shortname": "Graphics", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/primitives/Graphics.js", - "line": 5, - "description": "The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and color and fill them.", - "extends": "DisplayObjectContainer", - "is_constructor": 1 - }, - "GraphicsData": { - "name": "GraphicsData", - "shortname": "GraphicsData", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/primitives/Graphics.js", - "line": 1093, - "description": "A GraphicsData object.", - "is_constructor": 1 - }, - "CanvasBuffer": { - "name": "CanvasBuffer", - "shortname": "CanvasBuffer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 5, - "description": "Creates a Canvas element of the given size.", - "is_constructor": 1, - "params": [ - { - "name": "width", - "description": "the width for the newly created canvas", - "type": "Number" - }, - { - "name": "height", - "description": "the height for the newly created canvas", - "type": "Number" - } - ] - }, - "CanvasMaskManager": { - "name": "CanvasMaskManager", - "shortname": "CanvasMaskManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/canvas/utils/CanvasMaskManager.js", - "line": 5, - "description": "A set of functions used to handle masking.", - "is_constructor": 1 - }, - "CanvasTinter": { - "name": "CanvasTinter", - "shortname": "CanvasTinter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 5, - "is_constructor": 1, - "static": 1 - }, - "CanvasGraphics": { - "name": "CanvasGraphics", - "shortname": "CanvasGraphics", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/canvas/CanvasGraphics.js", - "line": 6, - "description": "A set of functions used by the canvas renderer to draw the primitive graphics data.", - "static": 1 - }, - "CanvasRenderer": { - "name": "CanvasRenderer", - "shortname": "CanvasRenderer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 5, - "description": "The CanvasRenderer draws the Stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDon't forget to add the CanvasRenderer.view to your DOM or you will not see anything :)", - "is_constructor": 1, - "params": [ - { - "name": "width", - "description": "the width of the canvas view", - "type": "Number", - "optional": true, - "optdefault": "800" - }, - { - "name": "height", - "description": "the height of the canvas view", - "type": "Number", - "optional": true, - "optdefault": "600" - }, - { - "name": "options", - "description": "The optional renderer parameters", - "type": "Object", - "optional": true, - "props": [ - { - "name": "view", - "description": "the canvas to use as a view, optional", - "type": "HTMLCanvasElement", - "optional": true - }, - { - "name": "transparent", - "description": "If the render view is transparent, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "autoResize", - "description": "If the render view is automatically resized, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "resolution", - "description": "the resolution of the renderer retina would be 2", - "type": "Number", - "optional": true, - "optdefault": "1" - }, - { - "name": "clearBeforeRender", - "description": "This sets if the CanvasRenderer will clear the canvas or not before the new render pass.", - "type": "Boolean", - "optional": true, - "optdefault": "true" - } - ] - } - ] - }, - "ComplexPrimitiveShader": { - "name": "ComplexPrimitiveShader", - "shortname": "ComplexPrimitiveShader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "PixiFastShader": { - "name": "PixiFastShader", - "shortname": "PixiFastShader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "PixiShader": { - "name": "PixiShader", - "shortname": "PixiShader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 6, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "PrimitiveShader": { - "name": "PrimitiveShader", - "shortname": "PrimitiveShader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "StripShader": { - "name": "StripShader", - "shortname": "StripShader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "FilterTexture": { - "name": "FilterTexture", - "shortname": "FilterTexture", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - }, - { - "name": "width", - "description": "the horizontal range of the filter", - "type": "Number" - }, - { - "name": "height", - "description": "the vertical range of the filter", - "type": "Number" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ] - }, - "WebGLBlendModeManager": { - "name": "WebGLBlendModeManager", - "shortname": "WebGLBlendModeManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "WebGLFastSpriteBatch": { - "name": "WebGLFastSpriteBatch", - "shortname": "WebGLFastSpriteBatch", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 11, - "is_constructor": 1 - }, - "WebGLFilterManager": { - "name": "WebGLFilterManager", - "shortname": "WebGLFilterManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 5, - "is_constructor": 1 - }, - "WebGLGraphics": { - "name": "WebGLGraphics", - "shortname": "WebGLGraphics", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 5, - "description": "A set of functions used by the webGL renderer to draw the primitive graphics data", - "access": "private", - "tagname": "", - "static": 1 - }, - "WebGLGraphicsData": { - "name": "WebGLGraphicsData", - "shortname": "WebGLGraphicsData", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 829, - "access": "private", - "tagname": "", - "static": 1 - }, - "WebGLMaskManager": { - "name": "WebGLMaskManager", - "shortname": "WebGLMaskManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 5, - "is_constructor": 1, - "access": "private", - "tagname": "" - }, - "WebGLShaderManager": { - "name": "WebGLShaderManager", - "shortname": "WebGLShaderManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 5, - "is_constructor": 1, - "access": "private", - "tagname": "" - }, - "WebGLSpriteBatch": { - "name": "WebGLSpriteBatch", - "shortname": "WebGLSpriteBatch", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 11, - "access": "private", - "tagname": "", - "is_constructor": 1 - }, - "WebGLStencilManager": { - "name": "WebGLStencilManager", - "shortname": "WebGLStencilManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 5, - "is_constructor": 1, - "access": "private", - "tagname": "" - }, - "WebGLRenderer": { - "name": "WebGLRenderer", - "shortname": "WebGLRenderer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 8, - "description": "The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer\nshould be used for browsers that support webGL. This Render works by automatically managing webGLBatchs.\nSo no need for Sprite Batches or Sprite Clouds.\nDon't forget to add the view to your DOM or you will not see anything :)", - "is_constructor": 1, - "params": [ - { - "name": "width", - "description": "the width of the canvas view", - "type": "Number", - "optional": true, - "optdefault": "0" - }, - { - "name": "height", - "description": "the height of the canvas view", - "type": "Number", - "optional": true, - "optdefault": "0" - }, - { - "name": "options", - "description": "The optional renderer parameters", - "type": "Object", - "optional": true, - "props": [ - { - "name": "view", - "description": "the canvas to use as a view, optional", - "type": "HTMLCanvasElement", - "optional": true - }, - { - "name": "transparent", - "description": "If the render view is transparent, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "autoResize", - "description": "If the render view is automatically resized, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "antialias", - "description": "sets antialias (only applicable in chrome at the moment)", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "preserveDrawingBuffer", - "description": "enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "resolution", - "description": "the resolution of the renderer retina would be 2", - "type": "Number", - "optional": true, - "optdefault": "1" - } - ] - } - ] - }, - "BitmapText": { - "name": "BitmapText", - "shortname": "BitmapText", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/text/BitmapText.js", - "line": 5, - "description": "A BitmapText object will create a line or multiple lines of text using bitmap font. To split a line you can use '\\n', '\\r' or '\\r\\n' in your string.\nYou can generate the fnt files using\nhttp://www.angelcode.com/products/bmfont/ for windows or\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", - "props": [ - { - "name": "font", - "description": "The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)", - "type": "String" - }, - { - "name": "align", - "description": "Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text", - "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": 6, - "description": "A Text Object will create a line or multiple lines of text. To split a line you can use '\\n' in your text string,\nor add a wordWrap property set to true and and wordWrapWidth property with a value in the style object.", - "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 20px 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 e.g 'red', '#00FF00'", - "type": "String|Number", - "optional": true, - "optdefault": "'black'" - }, - { - "name": "align", - "description": "Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text", - "type": "String", - "optional": true, - "optdefault": "'left'" - }, - { - "name": "stroke", - "description": "A canvas fillstyle that will be used on the text stroke e.g 'blue', '#FCFF00'", - "type": "String|Number", - "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": "wordWrap", - "description": "Indicates if word wrap should be used", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "wordWrapWidth", - "description": "The width at which text will wrap, it needs wordWrap to be set to true", - "type": "Number", - "optional": true, - "optdefault": "100" - }, - { - "name": "dropShadow", - "description": "Set a drop shadow for the text", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "dropShadowColor", - "description": "A fill style to be used on the dropshadow e.g 'red', '#00FF00'", - "type": "String", - "optional": true, - "optdefault": "'#000000'" - }, - { - "name": "dropShadowAngle", - "description": "Set a angle of the drop shadow", - "type": "Number", - "optional": true, - "optdefault": "Math.PI/4" - }, - { - "name": "dropShadowDistance", - "description": "Set a distance of the drop shadow", - "type": "Number", - "optional": true, - "optdefault": "5" - } - ] - } - ] - }, - "BaseTexture": { - "name": "BaseTexture", - "shortname": "BaseTexture", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/textures/BaseTexture.js", - "line": 9, - "description": "A texture stores the information that represents an image. All textures have a base texture.", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "source", - "description": "the source object (image or canvas)", - "type": "String" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ] - }, - "RenderTexture": { - "name": "RenderTexture", - "shortname": "RenderTexture", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/textures/RenderTexture.js", - "line": 5, - "description": "A RenderTexture is a special texture that allows any Pixi display object to be rendered to it.\n\n__Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead.\n\nA RenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example:\n\n var renderTexture = new PIXI.RenderTexture(800, 600);\n var sprite = PIXI.Sprite.fromImage(\"spinObj_01.png\");\n sprite.position.x = 800/2;\n sprite.position.y = 600/2;\n sprite.anchor.x = 0.5;\n sprite.anchor.y = 0.5;\n renderTexture.render(sprite);\n\nThe Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual position a DisplayObjectContainer should be used:\n\n var doc = new PIXI.DisplayObjectContainer();\n doc.addChild(sprite);\n renderTexture.render(doc); // Renders to center of renderTexture", - "extends": "Texture", - "is_constructor": 1, - "params": [ - { - "name": "width", - "description": "The width of the render texture", - "type": "Number" - }, - { - "name": "height", - "description": "The height of the render texture", - "type": "Number" - }, - { - "name": "renderer", - "description": "The renderer used for this RenderTexture", - "type": "CanvasRenderer|WebGLRenderer" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - }, - { - "name": "resolution", - "description": "The resolution of the texture being generated", - "type": "Number" - } - ] - }, - "Texture": { - "name": "Texture", - "shortname": "Texture", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/textures/Texture.js", - "line": 10, - "description": "A texture stores the information that represents an image or part of an image. It cannot be added\nto the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used.", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "baseTexture", - "description": "The base texture source to create the texture from", - "type": "BaseTexture" - }, - { - "name": "frame", - "description": "The rectangle frame of the texture to show", - "type": "Rectangle" - }, - { - "name": "crop", - "description": "The area of original texture", - "type": "Rectangle", - "optional": true - }, - { - "name": "trim", - "description": "Trimmed texture rectangle", - "type": "Rectangle", - "optional": true - } - ] - }, - "autoDetectRenderer": { - "name": "autoDetectRenderer", - "shortname": "autoDetectRenderer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/utils/Detector.js", - "line": 5, - "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot faster. If webGL is not supported by\nthe browser then this function will return a canvas renderer", - "static": 1, - "params": [ - { - "name": "width=800", - "description": "the width of the renderers view", - "type": "Number" - }, - { - "name": "height=600", - "description": "the height of the renderers view", - "type": "Number" - }, - { - "name": "options", - "description": "The optional renderer parameters", - "type": "Object", - "optional": true, - "props": [ - { - "name": "view", - "description": "the canvas to use as a view, optional", - "type": "HTMLCanvasElement", - "optional": true - }, - { - "name": "transparent", - "description": "If the render view is transparent, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "antialias", - "description": "sets antialias (only applicable in chrome at the moment)", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "preserveDrawingBuffer", - "description": "enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "resolution", - "description": "the resolution of the renderer retina would be 2", - "type": "Number", - "optional": true, - "optdefault": "1" - } - ] - } - ] - }, - "autoDetectRecommendedRenderer": { - "name": "autoDetectRecommendedRenderer", - "shortname": "autoDetectRecommendedRenderer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/utils/Detector.js", - "line": 44, - "description": "This helper function will automatically detect which renderer you should be using.\nThis function is very similar to the autoDetectRenderer function except that is will return a canvas renderer for android.\nEven thought both android chrome supports webGL the canvas implementation perform better at the time of writing. \nThis function will likely change and update as webGL performance improves on these devices.", - "static": 1, - "params": [ - { - "name": "width=800", - "description": "the width of the renderers view", - "type": "Number" - }, - { - "name": "height=600", - "description": "the height of the renderers view", - "type": "Number" - }, - { - "name": "options", - "description": "The optional renderer parameters", - "type": "Object", - "optional": true, - "props": [ - { - "name": "view", - "description": "the canvas to use as a view, optional", - "type": "HTMLCanvasElement", - "optional": true - }, - { - "name": "transparent", - "description": "If the render view is transparent, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "antialias", - "description": "sets antialias (only applicable in chrome at the moment)", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "preserveDrawingBuffer", - "description": "enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "resolution", - "description": "the resolution of the renderer retina would be 2", - "type": "Number", - "optional": true, - "optdefault": "1" - } - ] - } - ] - }, - "EventTarget": { - "name": "EventTarget", - "shortname": "EventTarget", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [ - "AssetLoader", - "AtlasLoader", - "BitmapFontLoader", - "ImageLoader", - "JsonLoader", - "SpineLoader", - "SpriteSheetLoader", - "BaseTexture", - "Texture" - ], - "module": "PIXI", - "file": "src/pixi/utils/EventTarget.js", - "line": 11, - "description": "Mixins event emitter functionality to a class", - "example": [ - "\n function MyEmitter() {}\n\n PIXI.EventTarget.mixin(MyEmitter.prototype);\n\n var em = new MyEmitter();\n em.emit('eventName', 'some data', 'some more data', {}, null, ...);" - ] - }, - "Event": { - "name": "Event", - "shortname": "Event", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/utils/EventTarget.js", - "line": 192, - "description": "Creates an homogenous object for tracking events so users can know what to expect.", - "extends": "Object", - "is_constructor": 1, - "params": [ - { - "name": "target", - "description": "The target object that the event is called on", - "type": "Object" - }, - { - "name": "name", - "description": "The string name of the event that was triggered", - "type": "String" - }, - { - "name": "data", - "description": "Arbitrary event data to pass along", - "type": "Object" - } - ] - }, - "PolyK": { - "name": "PolyK", - "shortname": "PolyK", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/utils/Polyk.js", - "line": 34, - "description": "Based on the Polyk library http://polyk.ivank.net released under MIT licence.\nThis is an amazing lib!\nSlightly modified by Mat Groves (matgroves.com);" - }, - "AjaxRequest": { - "name": "AjaxRequest", - "shortname": "AjaxRequest", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/utils/Utils.js", - "line": 108, - "description": "A wrapper for ajax requests to be handled cross browser", - "is_constructor": 1 - }, - "InteractionData": { - "name": "InteractionData", - "shortname": "InteractionData", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/InteractionData.js", - "line": 5, - "description": "Holds all information related to an Interaction event", - "is_constructor": 1 - }, - "InteractionManager": { - "name": "InteractionManager", - "shortname": "InteractionManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/InteractionManager.js", - "line": 5, - "description": "The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive\nif its interactive parameter is set to true\nThis manager also supports multitouch.", - "is_constructor": 1, - "params": [ - { - "name": "stage", - "description": "The stage to handle interactions", - "type": "Stage" - } - ] - } - }, - "classitems": [ - { - "file": "src/pixi/display/DisplayObject.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 14, - "description": "The coordinate of the object relative to the local coordinates of the parent.", - "itemtype": "property", - "name": "position", - "type": "Point", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 22, - "description": "The scale factor of the object.", - "itemtype": "property", - "name": "scale", - "type": "Point", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 30, - "description": "The pivot point of the displayObject that it rotates around", - "itemtype": "property", - "name": "pivot", - "type": "Point", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 38, - "description": "The rotation of the object in radians.", - "itemtype": "property", - "name": "rotation", - "type": "Number", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 46, - "description": "The opacity of the object.", - "itemtype": "property", - "name": "alpha", - "type": "Number", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 54, - "description": "The visibility of the object.", - "itemtype": "property", - "name": "visible", - "type": "Boolean", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 62, - "description": "This is the defined area that will pick up mouse / touch events. It is null by default.\nSetting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)", - "itemtype": "property", - "name": "hitArea", - "type": "Rectangle|Circle|Ellipse|Polygon", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 71, - "description": "This is used to indicate if the displayObject should display a mouse hand cursor on rollover", - "itemtype": "property", - "name": "buttonMode", - "type": "Boolean", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 79, - "description": "Can this object be rendered", - "itemtype": "property", - "name": "renderable", - "type": "Boolean", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 87, - "description": "[read-only] The display object container that contains this display object.", - "itemtype": "property", - "name": "parent", - "type": "DisplayObjectContainer", - "readonly": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 96, - "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", - "itemtype": "property", - "name": "stage", - "type": "Stage", - "readonly": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 105, - "description": "[read-only] The multiplied alpha of the displayObject", - "itemtype": "property", - "name": "worldAlpha", - "type": "Number", - "readonly": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 114, - "description": "[read-only] Whether or not the object is interactive, do not toggle directly! use the `interactive` property", - "itemtype": "property", - "name": "_interactive", - "type": "Boolean", - "readonly": "", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 124, - "description": "This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true", - "itemtype": "property", - "name": "defaultCursor", - "type": "String", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 133, - "description": "[read-only] Current transform of the object based on world (parent) factors", - "itemtype": "property", - "name": "worldTransform", - "type": "Matrix", - "readonly": "", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 143, - "description": "cached sin rotation and cos rotation", - "itemtype": "property", - "name": "_sr", - "type": "Number", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 152, - "description": "cached sin rotation and cos rotation", - "itemtype": "property", - "name": "_cr", - "type": "Number", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 161, - "description": "The area the filter is applied to like the hitArea this is used as more of an optimisation\nrather than figuring out the dimensions of the displayObject each frame you can set this rectangle", - "itemtype": "property", - "name": "filterArea", - "type": "Rectangle", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 170, - "description": "The original, cached bounds of the object", - "itemtype": "property", - "name": "_bounds", - "type": "Rectangle", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 179, - "description": "The most up-to-date bounds of the object", - "itemtype": "property", - "name": "_currentBounds", - "type": "Rectangle", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 188, - "description": "The original, cached mask of the object", - "itemtype": "property", - "name": "_currentBounds", - "type": "Rectangle", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 197, - "description": "Cached internal flag.", - "itemtype": "property", - "name": "_cacheAsBitmap", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 206, - "description": "Cached internal flag.", - "itemtype": "property", - "name": "_cacheIsDirty", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 220, - "description": "A callback that is used when the users mouse rolls over the displayObject", - "itemtype": "method", - "name": "mouseover", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 226, - "description": "A callback that is used when the users mouse leaves the displayObject", - "itemtype": "method", - "name": "mouseout", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 233, - "description": "A callback that is used when the users clicks on the displayObject with their mouse's left button", - "itemtype": "method", - "name": "click", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 239, - "description": "A callback that is used when the user clicks the mouse's left button down over the sprite", - "itemtype": "method", - "name": "mousedown", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 245, - "description": "A callback that is used when the user releases the mouse's left button that was over the displayObject\nfor this callback to be fired, the mouse's left button must have been pressed down over the displayObject", - "itemtype": "method", - "name": "mouseup", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 252, - "description": "A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject\nfor this callback to be fired, the mouse's left button must have been pressed down over the displayObject", - "itemtype": "method", - "name": "mouseupoutside", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 260, - "description": "A callback that is used when the users clicks on the displayObject with their mouse's right button", - "itemtype": "method", - "name": "rightclick", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 266, - "description": "A callback that is used when the user clicks the mouse's right button down over the sprite", - "itemtype": "method", - "name": "rightdown", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 272, - "description": "A callback that is used when the user releases the mouse's right button that was over the displayObject\nfor this callback to be fired the mouse's right button must have been pressed down over the displayObject", - "itemtype": "method", - "name": "rightup", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 279, - "description": "A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject\nfor this callback to be fired, the mouse's right button must have been pressed down over the displayObject", - "itemtype": "method", - "name": "rightupoutside", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 290, - "description": "A callback that is used when the users taps on the sprite with their finger\nbasically a touch version of click", - "itemtype": "method", - "name": "tap", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 297, - "description": "A callback that is used when the user touches over the displayObject", - "itemtype": "method", - "name": "touchstart", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 303, - "description": "A callback that is used when the user releases a touch over the displayObject", - "itemtype": "method", - "name": "touchend", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 309, - "description": "A callback that is used when the user releases the touch that was over the displayObject\nfor this callback to be fired, The touch must have started over the sprite", - "itemtype": "method", - "name": "touchendoutside", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 320, - "description": "Indicates if the sprite will have touch and mouse interactivity. It is false by default", - "itemtype": "property", - "name": "interactive", - "type": "Boolean", - "default": "false", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 340, - "description": "[read-only] Indicates if the sprite is globally visible.", - "itemtype": "property", - "name": "worldVisible", - "type": "Boolean", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 361, - "description": "Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.\nIn PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping.\nTo remove a mask, set this property to null.", - "itemtype": "property", - "name": "mask", - "type": "Graphics", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 381, - "description": "Sets the filters for the displayObject.\n* IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer.\nTo remove filters simply set this property to 'null'", - "itemtype": "property", - "name": "filters", - "type": "Array An array of filters", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 417, - "description": "Set if this display object is cached as a bitmap.\nThis basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects.\nTo remove simply set this property to 'null'", - "itemtype": "property", - "name": "cacheAsBitmap", - "type": "Boolean", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 523, - "description": "Retrieves the bounds of the displayObject as a rectangle object", - "itemtype": "method", - "name": "getBounds", - "params": [ - { - "name": "matrix", - "description": "", - "type": "Matrix" - } - ], - "return": { - "description": "the rectangular bounding area", - "type": "Rectangle" - }, - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 536, - "description": "Retrieves the local bounds of the displayObject as a rectangle object", - "itemtype": "method", - "name": "getLocalBounds", - "return": { - "description": "the rectangular bounding area", - "type": "Rectangle" - }, - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 547, - "description": "Sets the object's stage reference, the stage this object is connected to", - "itemtype": "method", - "name": "setStageReference", - "params": [ - { - "name": "stage", - "description": "the stage that the object will have as its current stage reference", - "type": "Stage" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 559, - "description": "Useful function that returns a texture of the displayObject object that can then be used to create sprites\nThis can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.", - "itemtype": "method", - "name": "generateTexture", - "params": [ - { - "name": "resolution", - "description": "The resolution of the texture being generated", - "type": "Number" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - }, - { - "name": "renderer", - "description": "The renderer used to generate the texture.", - "type": "CanvasRenderer|WebGLRenderer" - } - ], - "return": { - "description": "a texture of the graphics object", - "type": "Texture" - }, - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 583, - "description": "Generates and updates the cached sprite for this object.", - "itemtype": "method", - "name": "updateCache", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 593, - "description": "Calculates the global position of the display object", - "itemtype": "method", - "name": "toGlobal", - "params": [ - { - "name": "position", - "description": "The world origin to calculate from", - "type": "Point" - } - ], - "return": { - "description": "A point object representing the position of this object", - "type": "Point" - }, - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 606, - "description": "Calculates the local position of the display object relative to another point", - "itemtype": "method", - "name": "toLocal", - "params": [ - { - "name": "position", - "description": "The world origin to calculate from", - "type": "Point" - }, - { - "name": "from", - "description": "The DisplayObject to calculate the global position from", - "type": "DisplayObject", - "optional": true - } - ], - "return": { - "description": "A point object representing the position of this object", - "type": "Point" - }, - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 626, - "description": "Internal method.", - "itemtype": "method", - "name": "_renderCachedSprite", - "params": [ - { - "name": "renderSession", - "description": "The render session", - "type": "Object" - } - ], - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 647, - "description": "Internal method.", - "itemtype": "method", - "name": "_generateCachedSprite", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 689, - "description": "Destroys the cached sprite.", - "itemtype": "method", - "name": "_destroyCachedSprite", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 705, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 719, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 736, - "description": "The position of the displayObject on the x axis relative to the local coordinates of the parent.", - "itemtype": "property", - "name": "x", - "type": "Number", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 751, - "description": "The position of the displayObject on the y axis relative to the local coordinates of the parent.", - "itemtype": "property", - "name": "y", - "type": "Number", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 17, - "description": "[read-only] The array of children of this container.", - "itemtype": "property", - "name": "children", - "type": "Array", - "readonly": "", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 35, - "description": "The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 63, - "description": "The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 90, - "description": "Adds a child to the container.", - "itemtype": "method", - "name": "addChild", - "params": [ - { - "name": "child", - "description": "The DisplayObject to add to the container", - "type": "DisplayObject" - } - ], - "return": { - "description": "The child that was added.", - "type": "DisplayObject" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 102, - "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", - "itemtype": "method", - "name": "addChildAt", - "params": [ - { - "name": "child", - "description": "The child to add", - "type": "DisplayObject" - }, - { - "name": "index", - "description": "The index to place the child in", - "type": "Number" - } - ], - "return": { - "description": "The child that was added.", - "type": "DisplayObject" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 133, - "description": "Swaps the position of 2 Display Objects within this container.", - "itemtype": "method", - "name": "swapChildren", - "params": [ - { - "name": "child", - "description": "", - "type": "DisplayObject" - }, - { - "name": "child2", - "description": "", - "type": "DisplayObject" - } - ], - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 158, - "description": "Returns the index position of a child DisplayObject instance", - "itemtype": "method", - "name": "getChildIndex", - "params": [ - { - "name": "child", - "description": "The DisplayObject instance to identify", - "type": "DisplayObject" - } - ], - "return": { - "description": "The index position of the child display object to identify", - "type": "Number" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 175, - "description": "Changes the position of an existing child in the display object container", - "itemtype": "method", - "name": "setChildIndex", - "params": [ - { - "name": "child", - "description": "The child DisplayObject instance for which you want to change the index number", - "type": "DisplayObject" - }, - { - "name": "index", - "description": "The resulting index number for the child display object", - "type": "Number" - } - ], - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 193, - "description": "Returns the child at the specified index", - "itemtype": "method", - "name": "getChildAt", - "params": [ - { - "name": "index", - "description": "The index to get the child from", - "type": "Number" - } - ], - "return": { - "description": "The child at the given index, if any.", - "type": "DisplayObject" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 210, - "description": "Removes a child from the container.", - "itemtype": "method", - "name": "removeChild", - "params": [ - { - "name": "child", - "description": "The DisplayObject to remove", - "type": "DisplayObject" - } - ], - "return": { - "description": "The child that was removed.", - "type": "DisplayObject" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 225, - "description": "Removes a child from the specified index position.", - "itemtype": "method", - "name": "removeChildAt", - "params": [ - { - "name": "index", - "description": "The index to get the child from", - "type": "Number" - } - ], - "return": { - "description": "The child that was removed.", - "type": "DisplayObject" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 243, - "description": "Removes all children from this container that are within the begin and end indexes.", - "itemtype": "method", - "name": "removeChildren", - "params": [ - { - "name": "beginIndex", - "description": "The beginning position. Default value is 0.", - "type": "Number" - }, - { - "name": "endIndex", - "description": "The ending position. Default value is size of the container.", - "type": "Number" - } - ], - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 302, - "description": "Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.", - "itemtype": "method", - "name": "getBounds", - "return": { - "description": "The rectangular bounding area", - "type": "Rectangle" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 362, - "description": "Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.", - "itemtype": "method", - "name": "getLocalBounds", - "return": { - "description": "The rectangular bounding area", - "type": "Rectangle" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 386, - "description": "Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.", - "itemtype": "method", - "name": "setStageReference", - "params": [ - { - "name": "stage", - "description": "the stage that the container will have as its current stage reference", - "type": "Stage" - } - ], - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 404, - "description": "Removes the current stage reference from the container and all of its children.", - "itemtype": "method", - "name": "removeStageReference", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 423, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 482, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 17, - "description": "The array of textures that make up the animation", - "itemtype": "property", - "name": "textures", - "type": "Array", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 25, - "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", - "itemtype": "property", - "name": "animationSpeed", - "type": "Number", - "default": "1", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 34, - "description": "Whether or not the movie clip repeats after playing.", - "itemtype": "property", - "name": "loop", - "type": "Boolean", - "default": "true", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 43, - "description": "Function to call when a MovieClip finishes playing", - "itemtype": "property", - "name": "onComplete", - "type": "Function", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 51, - "description": "[read-only] The MovieClips current frame index (this may not have to be a whole number)", - "itemtype": "property", - "name": "currentFrame", - "type": "Number", - "default": "0", - "readonly": "", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 61, - "description": "[read-only] Indicates if the MovieClip is currently playing", - "itemtype": "property", - "name": "playing", - "type": "Boolean", - "readonly": "", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 75, - "description": "[read-only] totalFrames is the total number of frames in the MovieClip. This is the same as number of textures\nassigned to the MovieClip.", - "itemtype": "property", - "name": "totalFrames", - "type": "Number", - "default": "0", - "readonly": "", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 91, - "description": "Stops the MovieClip", - "itemtype": "method", - "name": "stop", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 101, - "description": "Plays the MovieClip", - "itemtype": "method", - "name": "play", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 111, - "description": "Stops the MovieClip and goes to a specific frame", - "itemtype": "method", - "name": "gotoAndStop", - "params": [ - { - "name": "frameNumber", - "description": "frame index to stop at", - "type": "Number" - } - ], - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 125, - "description": "Goes to a specific frame and begins playing the MovieClip", - "itemtype": "method", - "name": "gotoAndPlay", - "params": [ - { - "name": "frameNumber", - "description": "frame index to start at", - "type": "Number" - } - ], - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 169, - "description": "A short hand way of creating a movieclip from an array of frame ids", - "static": 1, - "itemtype": "method", - "name": "fromFrames", - "params": [ - { - "name": "frames", - "description": "the array of frames ids the movieclip will use as its texture frames", - "type": "Array" - } - ], - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 188, - "description": "A short hand way of creating a movieclip from an array of image ids", - "static": 1, - "itemtype": "method", - "name": "fromImages", - "params": [ - { - "name": "frames", - "description": "the array of image ids the movieclip will use as its texture frames", - "type": "Array" - } - ], - "class": "MovieClip" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 22, - "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the texture's origin is the top left\nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right corner", - "itemtype": "property", - "name": "anchor", - "type": "Point", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 33, - "description": "The texture that the sprite is using", - "itemtype": "property", - "name": "texture", - "type": "Texture", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 41, - "description": "The width of the sprite (this is initially set by the texture)", - "itemtype": "property", - "name": "_width", - "type": "Number", - "access": "private", - "tagname": "", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 50, - "description": "The height of the sprite (this is initially set by the texture)", - "itemtype": "property", - "name": "_height", - "type": "Number", - "access": "private", - "tagname": "", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 59, - "description": "The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.", - "itemtype": "property", - "name": "tint", - "type": "Number", - "default": "0xFFFFFF", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 68, - "description": "The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.", - "itemtype": "property", - "name": "blendMode", - "type": "Number", - "default": "PIXI.blendModes.NORMAL;", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 77, - "description": "The shader that will be used to render the texture to the stage. Set to null to remove a current shader.", - "itemtype": "property", - "name": "shader", - "type": "PIXI.AbstractFilter", - "default": "null", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 103, - "description": "The width of the sprite, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 119, - "description": "The height of the sprite, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 135, - "description": "Sets the texture of the sprite", - "itemtype": "method", - "name": "setTexture", - "params": [ - { - "name": "texture", - "description": "The PIXI texture that is displayed by the sprite", - "type": "Texture" - } - ], - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 147, - "description": "When the texture is updated, this event will fire to update the scale and frame", - "itemtype": "method", - "name": "onTextureUpdate", - "params": [ - { - "name": "event", - "description": "" - } - ], - "access": "private", - "tagname": "", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 163, - "description": "Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account.", - "itemtype": "method", - "name": "getBounds", - "params": [ - { - "name": "matrix", - "description": "the transformation matrix of the sprite", - "type": "Matrix" - } - ], - "return": { - "description": "the framing rectangle", - "type": "Rectangle" - }, - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 242, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 305, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 418, - "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId\n The frame ids are created when a Texture packer file has been loaded", - "itemtype": "method", - "name": "fromFrame", - "static": 1, - "params": [ - { - "name": "frameId", - "description": "The frame Id of the texture in the cache", - "type": "String" - } - ], - "return": { - "description": "A new Sprite using a texture from the texture cache matching the frameId", - "type": "Sprite" - }, - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 435, - "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", - "itemtype": "method", - "name": "fromImage", - "static": 1, - "params": [ - { - "name": "imageId", - "description": "The image url of the texture", - "type": "String" - } - ], - "return": { - "description": "A new Sprite using a texture from the texture cache matching the image id", - "type": "Sprite" - }, - "class": "Sprite" - }, - { - "file": "src/pixi/display/SpriteBatch.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/", - "class": "SpriteBatch" - }, - { - "file": "src/pixi/display/SpriteBatch.js", - "line": 66, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "SpriteBatch" - }, - { - "file": "src/pixi/display/SpriteBatch.js", - "line": 90, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "SpriteBatch" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 25, - "description": "[read-only] Current transform of the object based on world (parent) factors", - "itemtype": "property", - "name": "worldTransform", - "type": "Matrix", - "readonly": "", - "access": "private", - "tagname": "", - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 35, - "description": "Whether or not the stage is interactive", - "itemtype": "property", - "name": "interactive", - "type": "Boolean", - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 43, - "description": "The interaction manage for this stage, manages all interactive activity on the stage", - "itemtype": "property", - "name": "interactionManager", - "type": "InteractionManager", - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 51, - "description": "Whether the stage is dirty and needs to have interactions updated", - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 73, - "description": "Sets another DOM element which can receive mouse/touch interactions instead of the default Canvas element.\nThis is useful for when you have other DOM elements on top of the Canvas element.", - "itemtype": "method", - "name": "setInteractionDelegate", - "params": [ - { - "name": "domElement", - "description": "This new domElement which will receive mouse/touch events", - "type": "DOMElement" - } - ], - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 110, - "description": "Sets the background color for the stage", - "itemtype": "method", - "name": "setBackgroundColor", - "params": [ - { - "name": "backgroundColor", - "description": "the color of the background, easiest way to pass this in is in hex format\n like: 0xFFFFFF for white", - "type": "Number" - } - ], - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 126, - "description": "This will return the point containing global coordinates of the mouse.", - "itemtype": "method", - "name": "getMousePosition", - "return": { - "description": "A point containing the coordinates of the global InteractionData position.", - "type": "Point" - }, - "class": "Stage" - }, - { - "file": "src/pixi/extras/Rope.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "copyright": "Mat Groves, Rovanion Luckey", - "class": "Rope" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23\nbased on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi\n\nAwesome JS run time provided by EsotericSoftware\nhttps://github.com/EsotericSoftware/spine-runtimes", - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 213, - "description": "cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of", - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 506, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 513, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 520, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 528, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 535, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 542, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 577, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 585, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 600, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 604, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 611, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 618, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 625, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 637, - "description": "from the new skin are attached if the corresponding attachment from the old skin was attached.", - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 644, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 648, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 657, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 849, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 855, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 861, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 867, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 885, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 1310, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/", - "class": "Strip" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 20, - "description": "The texture of the strip", - "itemtype": "property", - "name": "texture", - "type": "Texture", - "class": "Strip" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 43, - "description": "Whether the strip is dirty or not", - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "class": "Strip" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 52, - "description": "if you need a padding, not yet implemented", - "itemtype": "property", - "name": "padding", - "type": "Number", - "class": "Strip" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 293, - "description": "Renders a flat strip", - "itemtype": "method", - "name": "renderStripFlat", - "params": [ - { - "name": "strip", - "description": "The Strip to render", - "type": "Strip" - } - ], - "access": "private", - "tagname": "", - "class": "Strip" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 341, - "description": "When the texture is updated, this event will fire to update the scale and frame", - "itemtype": "method", - "name": "onTextureUpdate", - "params": [ - { - "name": "event", - "description": "" - } - ], - "access": "private", - "tagname": "", - "class": "Strip" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 19, - "description": "The with of the tiling sprite", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 27, - "description": "The height of the tiling sprite", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 35, - "description": "The scaling of the image that is being tiled", - "itemtype": "property", - "name": "tileScale", - "type": "Point", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 43, - "description": "A point that represents the scale of the texture object", - "itemtype": "property", - "name": "tileScaleOffset", - "type": "Point", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 51, - "description": "The offset position of the image that is being tiled", - "itemtype": "property", - "name": "tilePosition", - "type": "Point", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 59, - "description": "Whether this sprite is renderable or not", - "itemtype": "property", - "name": "renderable", - "type": "Boolean", - "default": "true", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 68, - "description": "The tint applied to the sprite. This is a hex value", - "itemtype": "property", - "name": "tint", - "type": "Number", - "default": "0xFFFFFF", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 77, - "description": "The blend mode to be applied to the sprite", - "itemtype": "property", - "name": "blendMode", - "type": "Number", - "default": "PIXI.blendModes.NORMAL;", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 95, - "description": "The width of the sprite, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 111, - "description": "The height of the TilingSprite, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 137, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 194, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 280, - "description": "Returns the framing rectangle of the sprite as a PIXI.Rectangle object", - "itemtype": "method", - "name": "getBounds", - "return": { - "description": "the framing rectangle", - "type": "Rectangle" - }, - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 360, - "description": "When the texture is updated, this event will fire to update the scale and frame", - "itemtype": "method", - "name": "onTextureUpdate", - "params": [ - { - "name": "event", - "description": "" - } - ], - "access": "private", - "tagname": "", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 373, - "itemtype": "method", - "name": "generateTilingTexture", - "params": [ - { - "name": "forcePowerOfTwo", - "description": "Whether we want to force the texture to be a power of two", - "type": "Boolean" - } - ], - "class": "TilingSprite" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 15, - "description": "An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion.\nFor example the blur filter has two passes blurX and blurY.", - "itemtype": "property", - "name": "passes", - "type": "Array an array of filter objects", - "access": "private", - "tagname": "", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 24, - "itemtype": "property", - "name": "shaders", - "type": "Array an array of shaders", - "access": "private", - "tagname": "", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 31, - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 37, - "itemtype": "property", - "name": "padding", - "type": "Number", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 43, - "itemtype": "property", - "name": "uniforms", - "type": "object", - "access": "private", - "tagname": "", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 50, - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "access": "private", - "tagname": "", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 60, - "description": "Syncs the uniforms between the class object and the shaders.", - "itemtype": "method", - "name": "syncUniforms", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AlphaMaskFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "AlphaMaskFilter" - }, - { - "file": "src/pixi/filters/AlphaMaskFilter.js", - "line": 71, - "description": "Sets the map dimensions uniforms when the texture becomes available.", - "itemtype": "method", - "name": "onTextureLoaded", - "class": "AlphaMaskFilter" - }, - { - "file": "src/pixi/filters/AlphaMaskFilter.js", - "line": 84, - "description": "The texture used for the displacement map. Must be power of 2 sized texture.", - "itemtype": "property", - "name": "map", - "type": "Texture", - "class": "AlphaMaskFilter" - }, - { - "file": "src/pixi/filters/AsciiFilter.js", - "line": 1, - "author": "Vico @vicocotea\noriginal shader : https://www.shadertoy.com/view/lssGDj by @movAX13h", - "class": "AsciiFilter" - }, - { - "file": "src/pixi/filters/AsciiFilter.js", - "line": 73, - "description": "The pixel size used by the filter.", - "itemtype": "property", - "name": "size", - "type": "Number", - "class": "AsciiFilter" - }, - { - "file": "src/pixi/filters/BlurFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BlurFilter" - }, - { - "file": "src/pixi/filters/BlurFilter.js", - "line": 24, - "description": "Sets the strength of both the blurX and blurY properties simultaneously", - "itemtype": "property", - "name": "blur", - "type": "Number the strength of the blur", - "default": "2", - "class": "BlurFilter" - }, - { - "file": "src/pixi/filters/BlurFilter.js", - "line": 40, - "description": "Sets the strength of the blurX property", - "itemtype": "property", - "name": "blurX", - "type": "Number the strength of the blurX", - "default": "2", - "class": "BlurFilter" - }, - { - "file": "src/pixi/filters/BlurFilter.js", - "line": 56, - "description": "Sets the strength of the blurY property", - "itemtype": "property", - "name": "blurY", - "type": "Number the strength of the blurY", - "default": "2", - "class": "BlurFilter" - }, - { - "file": "src/pixi/filters/BlurXFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BlurXFilter" - }, - { - "file": "src/pixi/filters/BlurXFilter.js", - "line": 51, - "description": "Sets the strength of both the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number the strength of the blur", - "default": "2", - "class": "BlurXFilter" - }, - { - "file": "src/pixi/filters/BlurYFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BlurYFilter" - }, - { - "file": "src/pixi/filters/BlurYFilter.js", - "line": 51, - "description": "Sets the strength of both the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number the strength of the blur", - "default": "2", - "class": "BlurYFilter" - }, - { - "file": "src/pixi/filters/ColorMatrixFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "ColorMatrixFilter" - }, - { - "file": "src/pixi/filters/ColorMatrixFilter.js", - "line": 46, - "description": "Sets the matrix of the color matrix filter", - "itemtype": "property", - "name": "matrix", - "type": "Array and array of 26 numbers", - "default": "[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]", - "class": "ColorMatrixFilter" - }, - { - "file": "src/pixi/filters/ColorStepFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "ColorStepFilter" - }, - { - "file": "src/pixi/filters/ColorStepFilter.js", - "line": 41, - "description": "The number of steps to reduce the palette by.", - "itemtype": "property", - "name": "step", - "type": "Number", - "class": "ColorStepFilter" - }, - { - "file": "src/pixi/filters/ConvolutionFilter.js", - "line": 63, - "description": "An array of values used for matrix transformation. Specified as a 9 point Array.", - "itemtype": "property", - "name": "matrix", - "type": "Array", - "class": "ConvolutionFilter" - }, - { - "file": "src/pixi/filters/ConvolutionFilter.js", - "line": 78, - "description": "Width of the object you are transforming", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "ConvolutionFilter" - }, - { - "file": "src/pixi/filters/ConvolutionFilter.js", - "line": 93, - "description": "Height of the object you are transforming", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "ConvolutionFilter" - }, - { - "file": "src/pixi/filters/CrossHatchFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CrossHatchFilter" - }, - { - "file": "src/pixi/filters/CrossHatchFilter.js", - "line": 65, - "description": "Sets the strength of both the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number the strength of the blur", - "default": "2", - "class": "CrossHatchFilter" - }, - { - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "DisplacementFilter" - }, - { - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 78, - "description": "Sets the map dimensions uniforms when the texture becomes available.", - "itemtype": "method", - "name": "onTextureLoaded", - "class": "DisplacementFilter" - }, - { - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 91, - "description": "The texture used for the displacement map. Must be power of 2 texture.", - "itemtype": "property", - "name": "map", - "type": "Texture", - "class": "DisplacementFilter" - }, - { - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 106, - "description": "The multiplier used to scale the displacement result from the map calculation.", - "itemtype": "property", - "name": "scale", - "type": "Point", - "class": "DisplacementFilter" - }, - { - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 121, - "description": "The offset used to move the displacement map.", - "itemtype": "property", - "name": "offset", - "type": "Point", - "class": "DisplacementFilter" - }, - { - "file": "src/pixi/filters/DotScreenFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23\noriginal filter: https://github.com/evanw/glfx.js/blob/master/src/filters/fun/dotscreen.js", - "class": "DotScreenFilter" - }, - { - "file": "src/pixi/filters/DotScreenFilter.js", - "line": 57, - "description": "The scale of the effect.", - "itemtype": "property", - "name": "scale", - "type": "Number", - "class": "DotScreenFilter" - }, - { - "file": "src/pixi/filters/DotScreenFilter.js", - "line": 72, - "description": "The radius of the effect.", - "itemtype": "property", - "name": "angle", - "type": "Number", - "class": "DotScreenFilter" - }, - { - "file": "src/pixi/filters/FilterBlock.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "FilterBlock" - }, - { - "file": "src/pixi/filters/FilterBlock.js", - "line": 13, - "description": "The visible state of this FilterBlock.", - "itemtype": "property", - "name": "visible", - "type": "Boolean", - "class": "FilterBlock" - }, - { - "file": "src/pixi/filters/FilterBlock.js", - "line": 21, - "description": "The renderable state of this FilterBlock.", - "itemtype": "property", - "name": "renderable", - "type": "Boolean", - "class": "FilterBlock" - }, - { - "file": "src/pixi/filters/GrayFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "GrayFilter" - }, - { - "file": "src/pixi/filters/GrayFilter.js", - "line": 41, - "description": "The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color.", - "itemtype": "property", - "name": "gray", - "type": "Number", - "class": "GrayFilter" - }, - { - "file": "src/pixi/filters/InvertFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "InvertFilter" - }, - { - "file": "src/pixi/filters/InvertFilter.js", - "line": 42, - "description": "The strength of the invert. 1 will fully invert the colors, 0 will make the object its normal color", - "itemtype": "property", - "name": "invert", - "type": "Number", - "class": "InvertFilter" - }, - { - "file": "src/pixi/filters/NoiseFilter.js", - "line": 1, - "author": "Vico @vicocotea\noriginal filter: https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js", - "class": "NoiseFilter" - }, - { - "file": "src/pixi/filters/NoiseFilter.js", - "line": 49, - "description": "The amount of noise to apply.", - "itemtype": "property", - "name": "noise", - "type": "Number", - "class": "NoiseFilter" - }, - { - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "NormalMapFilter" - }, - { - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 140, - "description": "Sets the map dimensions uniforms when the texture becomes available.", - "itemtype": "method", - "name": "onTextureLoaded", - "class": "NormalMapFilter" - }, - { - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 153, - "description": "The texture used for the displacement map. Must be power of 2 texture.", - "itemtype": "property", - "name": "map", - "type": "Texture", - "class": "NormalMapFilter" - }, - { - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 168, - "description": "The multiplier used to scale the displacement result from the map calculation.", - "itemtype": "property", - "name": "scale", - "type": "Point", - "class": "NormalMapFilter" - }, - { - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 183, - "description": "The offset used to move the displacement map.", - "itemtype": "property", - "name": "offset", - "type": "Point", - "class": "NormalMapFilter" - }, - { - "file": "src/pixi/filters/PixelateFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "PixelateFilter" - }, - { - "file": "src/pixi/filters/PixelateFilter.js", - "line": 48, - "description": "This a point that describes the size of the blocks. x is the width of the block and y is the height.", - "itemtype": "property", - "name": "size", - "type": "Point", - "class": "PixelateFilter" - }, - { - "file": "src/pixi/filters/RGBSplitFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "RGBSplitFilter" - }, - { - "file": "src/pixi/filters/RGBSplitFilter.js", - "line": 48, - "description": "Red channel offset.", - "itemtype": "property", - "name": "red", - "type": "Point", - "class": "RGBSplitFilter" - }, - { - "file": "src/pixi/filters/RGBSplitFilter.js", - "line": 63, - "description": "Green channel offset.", - "itemtype": "property", - "name": "green", - "type": "Point", - "class": "RGBSplitFilter" - }, - { - "file": "src/pixi/filters/RGBSplitFilter.js", - "line": 78, - "description": "Blue offset.", - "itemtype": "property", - "name": "blue", - "type": "Point", - "class": "RGBSplitFilter" - }, - { - "file": "src/pixi/filters/SepiaFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "SepiaFilter" - }, - { - "file": "src/pixi/filters/SepiaFilter.js", - "line": 43, - "description": "The strength of the sepia. 1 will apply the full sepia effect, 0 will make the object its normal color.", - "itemtype": "property", - "name": "sepia", - "type": "Number", - "class": "SepiaFilter" - }, - { - "file": "src/pixi/filters/SmartBlurFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "SmartBlurFilter" - }, - { - "file": "src/pixi/filters/SmartBlurFilter.js", - "line": 61, - "description": "The strength of the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number the strength of the blur", - "default": "2", - "class": "SmartBlurFilter" - }, - { - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 1, - "author": "Vico @vicocotea\noriginal filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/", - "class": "TiltShiftFilter" - }, - { - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 24, - "description": "The strength of the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number", - "class": "TiltShiftFilter" - }, - { - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 39, - "description": "The strength of the gradient blur.", - "itemtype": "property", - "name": "gradientBlur", - "type": "Number", - "class": "TiltShiftFilter" - }, - { - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 54, - "description": "The Y value to start the effect at.", - "itemtype": "property", - "name": "start", - "type": "Number", - "class": "TiltShiftFilter" - }, - { - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 69, - "description": "The Y value to end the effect at.", - "itemtype": "property", - "name": "end", - "type": "Number", - "class": "TiltShiftFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 1, - "author": "Vico @vicocotea\noriginal filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 72, - "description": "The strength of the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 88, - "description": "The strength of the gradient blur.", - "itemtype": "property", - "name": "gradientBlur", - "type": "Number", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 104, - "description": "The X value to start the effect at.", - "itemtype": "property", - "name": "start", - "type": "Number", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 121, - "description": "The X value to end the effect at.", - "itemtype": "property", - "name": "end", - "type": "Number", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 138, - "description": "Updates the filter delta values.", - "itemtype": "method", - "name": "updateDelta", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 1, - "author": "Vico @vicocotea\noriginal filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 72, - "description": "The strength of the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 88, - "description": "The strength of the gradient blur.", - "itemtype": "property", - "name": "gradientBlur", - "type": "Number", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 104, - "description": "The Y value to start the effect at.", - "itemtype": "property", - "name": "start", - "type": "Number", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 121, - "description": "The Y value to end the effect at.", - "itemtype": "property", - "name": "end", - "type": "Number", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 138, - "description": "Updates the filter delta values.", - "itemtype": "method", - "name": "updateDelta", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TwistFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "TwistFilter" - }, - { - "file": "src/pixi/filters/TwistFilter.js", - "line": 56, - "description": "This point describes the the offset of the twist.", - "itemtype": "property", - "name": "offset", - "type": "Point", - "class": "TwistFilter" - }, - { - "file": "src/pixi/filters/TwistFilter.js", - "line": 72, - "description": "This radius of the twist.", - "itemtype": "property", - "name": "radius", - "type": "Number", - "class": "TwistFilter" - }, - { - "file": "src/pixi/filters/TwistFilter.js", - "line": 88, - "description": "This angle of the twist.", - "itemtype": "property", - "name": "angle", - "type": "Number", - "class": "TwistFilter" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 1, - "author": "Chad Engler ", - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 16, - "itemtype": "property", - "name": "x", - "type": "Number", - "default": "0", - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 23, - "itemtype": "property", - "name": "y", - "type": "Number", - "default": "0", - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 30, - "itemtype": "property", - "name": "radius", - "type": "Number", - "default": "0", - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 38, - "description": "Creates a clone of this Circle instance", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the Circle", - "type": "Circle" - }, - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 49, - "description": "Checks whether the x and y coordinates given are contained within this circle", - "itemtype": "method", - "name": "contains", - "params": [ - { - "name": "x", - "description": "The X coordinate of the point to test", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the point to test", - "type": "Number" - } - ], - "return": { - "description": "Whether the x/y coordinates are within this Circle", - "type": "Boolean" - }, - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 72, - "description": "Returns the framing rectangle of the circle as a PIXI.Rectangle object", - "itemtype": "method", - "name": "getBounds", - "return": { - "description": "the framing rectangle", - "type": "Rectangle" - }, - "class": "Circle" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 1, - "author": "Chad Engler ", - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 17, - "itemtype": "property", - "name": "x", - "type": "Number", - "default": "0", - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 24, - "itemtype": "property", - "name": "y", - "type": "Number", - "default": "0", - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 31, - "itemtype": "property", - "name": "width", - "type": "Number", - "default": "0", - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 38, - "itemtype": "property", - "name": "height", - "type": "Number", - "default": "0", - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 46, - "description": "Creates a clone of this Ellipse instance", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the ellipse", - "type": "Ellipse" - }, - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 57, - "description": "Checks whether the x and y coordinates given are contained within this ellipse", - "itemtype": "method", - "name": "contains", - "params": [ - { - "name": "x", - "description": "The X coordinate of the point to test", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the point to test", - "type": "Number" - } - ], - "return": { - "description": "Whether the x/y coords are within this ellipse", - "type": "Boolean" - }, - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 80, - "description": "Returns the framing rectangle of the ellipse as a PIXI.Rectangle object", - "itemtype": "method", - "name": "getBounds", - "return": { - "description": "the framing rectangle", - "type": "Rectangle" - }, - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 17, - "itemtype": "property", - "name": "a", - "type": "Number", - "default": "1", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 24, - "itemtype": "property", - "name": "b", - "type": "Number", - "default": "0", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 31, - "itemtype": "property", - "name": "c", - "type": "Number", - "default": "0", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 38, - "itemtype": "property", - "name": "d", - "type": "Number", - "default": "1", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 45, - "itemtype": "property", - "name": "tx", - "type": "Number", - "default": "0", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 52, - "itemtype": "property", - "name": "ty", - "type": "Number", - "default": "0", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 60, - "description": "Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:\n\na = array[0]\nb = array[1]\nc = array[3]\nd = array[4]\ntx = array[2]\nty = array[5]", - "itemtype": "method", - "name": "fromArray", - "params": [ - { - "name": "array", - "description": "The array that the matrix will be populated from.", - "type": "Array" - } - ], - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 83, - "description": "Creates an array from the current Matrix object.", - "itemtype": "method", - "name": "toArray", - "params": [ - { - "name": "transpose", - "description": "Whether we need to transpose the matrix or not", - "type": "Boolean" - } - ], - "return": { - "description": "the newly created array which contains the matrix", - "type": "Array" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 123, - "description": "Get a new position with the current transformation applied.\nCan be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)", - "itemtype": "method", - "name": "apply", - "params": [ - { - "name": "pos", - "description": "The origin", - "type": "Point" - }, - { - "name": "newPos", - "description": "The point that the new position is assigned to (allowed to be same as input)", - "type": "Point", - "optional": true - } - ], - "return": { - "description": "The new point, transformed through this matrix", - "type": "Point" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 142, - "description": "Get a new position with the inverse of the current transformation applied.\nCan be used to go from the world coordinate space to a child's coordinate space. (e.g. input)", - "itemtype": "method", - "name": "applyInverse", - "params": [ - { - "name": "pos", - "description": "The origin", - "type": "Point" - }, - { - "name": "newPos", - "description": "The point that the new position is assigned to (allowed to be same as input)", - "type": "Point", - "optional": true - } - ], - "return": { - "description": "The new point, inverse-transformed through this matrix", - "type": "Point" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 163, - "description": "Translates the matrix on the x and y.", - "itemtype": "method", - "name": "translate", - "params": [ - { - "name": "x", - "description": "", - "type": "Number" - }, - { - "name": "y", - "description": "", - "type": "Number" - } - ], - "return": { - "description": "This matrix. Good for chaining method calls.", - "type": "Matrix" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 179, - "description": "Applies a scale transformation to the matrix.", - "itemtype": "method", - "name": "scale", - "params": [ - { - "name": "x", - "description": "The amount to scale horizontally", - "type": "Number" - }, - { - "name": "y", - "description": "The amount to scale vertically", - "type": "Number" - } - ], - "return": { - "description": "This matrix. Good for chaining method calls.", - "type": "Matrix" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 200, - "description": "Applies a rotation transformation to the matrix.", - "itemtype": "method", - "name": "rotate", - "params": [ - { - "name": "angle", - "description": "The angle in radians.", - "type": "Number" - } - ], - "return": { - "description": "This matrix. Good for chaining method calls.", - "type": "Matrix" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 225, - "description": "Appends the given Matrix to this Matrix.", - "itemtype": "method", - "name": "append", - "params": [ - { - "name": "matrix", - "description": "", - "type": "Matrix" - } - ], - "return": { - "description": "This matrix. Good for chaining method calls.", - "type": "Matrix" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 250, - "description": "Resets this Matix to an identity (default) matrix.", - "itemtype": "method", - "name": "identity", - "return": { - "description": "This matrix. Good for chaining method calls.", - "type": "Matrix" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Point.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Point" - }, - { - "file": "src/pixi/geom/Point.js", - "line": 15, - "itemtype": "property", - "name": "x", - "type": "Number", - "default": "0", - "class": "Point" - }, - { - "file": "src/pixi/geom/Point.js", - "line": 22, - "itemtype": "property", - "name": "y", - "type": "Number", - "default": "0", - "class": "Point" - }, - { - "file": "src/pixi/geom/Point.js", - "line": 30, - "description": "Creates a clone of this point", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the point", - "type": "Point" - }, - "class": "Point" - }, - { - "file": "src/pixi/geom/Point.js", - "line": 41, - "description": "Sets the point to a new x and y position.\nIf y is omitted, both x and y will be set to x.", - "itemtype": "method", - "name": "set", - "params": [ - { - "name": "x", - "description": "position of the point on the x axis", - "type": "Number", - "optional": true, - "optdefault": "0" - }, - { - "name": "y", - "description": "position of the point on the y axis", - "type": "Number", - "optional": true, - "optdefault": "0" - } - ], - "class": "Point" - }, - { - "file": "src/pixi/geom/Polygon.js", - "line": 1, - "author": "Adrien Brault ", - "class": "Polygon" - }, - { - "file": "src/pixi/geom/Polygon.js", - "line": 35, - "description": "Creates a clone of this polygon", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the polygon", - "type": "Polygon" - }, - "class": "Polygon" - }, - { - "file": "src/pixi/geom/Polygon.js", - "line": 47, - "description": "Checks whether the x and y coordinates passed to this function are contained within this polygon", - "itemtype": "method", - "name": "contains", - "params": [ - { - "name": "x", - "description": "The X coordinate of the point to test", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the point to test", - "type": "Number" - } - ], - "return": { - "description": "Whether the x/y coordinates are within this polygon", - "type": "Boolean" - }, - "class": "Polygon" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/", - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 17, - "itemtype": "property", - "name": "x", - "type": "Number", - "default": "0", - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 24, - "itemtype": "property", - "name": "y", - "type": "Number", - "default": "0", - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 31, - "itemtype": "property", - "name": "width", - "type": "Number", - "default": "0", - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 38, - "itemtype": "property", - "name": "height", - "type": "Number", - "default": "0", - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 46, - "description": "Creates a clone of this Rectangle", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the rectangle", - "type": "Rectangle" - }, - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 57, - "description": "Checks whether the x and y coordinates given are contained within this Rectangle", - "itemtype": "method", - "name": "contains", - "params": [ - { - "name": "x", - "description": "The X coordinate of the point to test", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the point to test", - "type": "Number" - } - ], - "return": { - "description": "Whether the x/y coordinates are within this Rectangle", - "type": "Boolean" - }, - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 18, - "itemtype": "property", - "name": "x", - "type": "Number", - "default": "0", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 25, - "itemtype": "property", - "name": "y", - "type": "Number", - "default": "0", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 32, - "itemtype": "property", - "name": "width", - "type": "Number", - "default": "0", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 39, - "itemtype": "property", - "name": "height", - "type": "Number", - "default": "0", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 46, - "itemtype": "property", - "name": "radius", - "type": "Number", - "default": "20", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 54, - "description": "Creates a clone of this Rounded Rectangle", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the rounded rectangle", - "type": "Rounded Rectangle" - }, - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 65, - "description": "Checks whether the x and y coordinates given are contained within this Rounded Rectangle", - "itemtype": "method", - "name": "contains", - "params": [ - { - "name": "x", - "description": "The X coordinate of the point to test", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the point to test", - "type": "Number" - } - ], - "return": { - "description": "Whether the x/y coordinates are within this Rounded Rectangle", - "type": "Boolean" - }, - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 23, - "description": "The array of asset URLs that are going to be loaded", - "itemtype": "property", - "name": "assetURLs", - "type": "Array", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 31, - "description": "Whether the requests should be treated as cross origin", - "itemtype": "property", - "name": "crossorigin", - "type": "Boolean", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 39, - "description": "Maps file extension to loader types", - "itemtype": "property", - "name": "loadersByType", - "type": "Object", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 61, - "description": "Fired when an item has loaded", - "itemtype": "event", - "name": "onProgress", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 66, - "description": "Fired when all the assets have loaded", - "itemtype": "event", - "name": "onComplete", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 74, - "description": "Given a filename, returns its extension.", - "itemtype": "method", - "name": "_getDataType", - "params": [ - { - "name": "str", - "description": "the name of the asset", - "type": "String" - } - ], - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 107, - "description": "Starts loading the assets sequentially", - "itemtype": "method", - "name": "load", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 143, - "description": "Invoked after each file is loaded", - "itemtype": "method", - "name": "onAssetLoaded", - "access": "private", - "tagname": "", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 1, - "author": "Martin Kelm http://mkelm.github.com", - "class": "AtlasLoader" - }, - { - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 32, - "description": "Starts loading the JSON file", - "itemtype": "method", - "name": "load", - "class": "AtlasLoader" - }, - { - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 46, - "description": "Invoked when the Atlas has fully loaded. Parses the JSON and builds the texture frames.", - "itemtype": "method", - "name": "onAtlasLoaded", - "access": "private", - "tagname": "", - "class": "AtlasLoader" - }, - { - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 166, - "description": "Invoked when json file has loaded.", - "itemtype": "method", - "name": "onLoaded", - "access": "private", - "tagname": "", - "class": "AtlasLoader" - }, - { - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 182, - "description": "Invoked when an error occurs.", - "itemtype": "method", - "name": "onError", - "access": "private", - "tagname": "", - "class": "AtlasLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 19, - "description": "The url of the bitmap font data", - "itemtype": "property", - "name": "url", - "type": "String", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 27, - "description": "Whether the requests should be treated as cross origin", - "itemtype": "property", - "name": "crossorigin", - "type": "Boolean", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 35, - "description": "[read-only] The base url of the bitmap font data", - "itemtype": "property", - "name": "baseUrl", - "type": "String", - "readonly": "", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 44, - "description": "[read-only] The texture of the bitmap font", - "itemtype": "property", - "name": "texture", - "type": "Texture", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 57, - "description": "Loads the XML font data", - "itemtype": "method", - "name": "load", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 72, - "description": "Invoked when the XML file is loaded, parses the data.", - "itemtype": "method", - "name": "onXMLLoaded", - "access": "private", - "tagname": "", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 152, - "description": "Invoked when all files are loaded (xml/fnt and texture)", - "itemtype": "method", - "name": "onLoaded", - "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": 18, - "description": "The texture being loaded", - "itemtype": "property", - "name": "texture", - "type": "Texture", - "class": "ImageLoader" - }, - { - "file": "src/pixi/loaders/ImageLoader.js", - "line": 26, - "description": "if the image is loaded with loadFramedSpriteSheet\nframes will contain the sprite sheet frames", - "itemtype": "property", - "name": "frames", - "type": "Array", - "readonly": "", - "class": "ImageLoader" - }, - { - "file": "src/pixi/loaders/ImageLoader.js", - "line": 42, - "description": "Loads image or takes it from cache", - "itemtype": "method", - "name": "load", - "class": "ImageLoader" - }, - { - "file": "src/pixi/loaders/ImageLoader.js", - "line": 59, - "description": "Invoked when image file is loaded or it is already cached and ready to use", - "itemtype": "method", - "name": "onLoaded", - "access": "private", - "tagname": "", - "class": "ImageLoader" - }, - { - "file": "src/pixi/loaders/ImageLoader.js", - "line": 70, - "description": "Loads image and split it to uniform sized frames", - "itemtype": "method", - "name": "loadFramedSpriteSheet", - "params": [ - { - "name": "frameWidth", - "description": "width of each frame", - "type": "Number" - }, - { - "name": "frameHeight", - "description": "height of each frame", - "type": "Number" - }, - { - "name": "textureName", - "description": "if given, the frames will be cached in - format", - "type": "String" - } - ], - "class": "ImageLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 18, - "description": "The url of the bitmap font data", - "itemtype": "property", - "name": "url", - "type": "String", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 26, - "description": "Whether the requests should be treated as cross origin", - "itemtype": "property", - "name": "crossorigin", - "type": "Boolean", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 34, - "description": "[read-only] The base url of the bitmap font data", - "itemtype": "property", - "name": "baseUrl", - "type": "String", - "readonly": "", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 43, - "description": "[read-only] Whether the data has loaded yet", - "itemtype": "property", - "name": "loaded", - "type": "Boolean", - "readonly": "", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 59, - "description": "Loads the JSON data", - "itemtype": "method", - "name": "load", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 98, - "description": "Invoked when the JSON file is loaded.", - "itemtype": "method", - "name": "onJSONLoaded", - "access": "private", - "tagname": "", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 162, - "description": "Invoked when the json file has loaded.", - "itemtype": "method", - "name": "onLoaded", - "access": "private", - "tagname": "", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 176, - "description": "Invoked if an error occurs.", - "itemtype": "method", - "name": "onError", - "access": "private", - "tagname": "", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23\nbased on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi\n\nAwesome JS run time provided by EsotericSoftware\nhttps://github.com/EsotericSoftware/spine-runtimes", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 26, - "description": "The url of the bitmap font data", - "itemtype": "property", - "name": "url", - "type": "String", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 34, - "description": "Whether the requests should be treated as cross origin", - "itemtype": "property", - "name": "crossorigin", - "type": "Boolean", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 42, - "description": "[read-only] Whether the data has loaded yet", - "itemtype": "property", - "name": "loaded", - "type": "Boolean", - "readonly": "", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 56, - "description": "Loads the JSON data", - "itemtype": "method", - "name": "load", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 72, - "description": "Invoked when JSON file is loaded.", - "itemtype": "method", - "name": "onLoaded", - "access": "private", - "tagname": "", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 22, - "description": "The url of the atlas data", - "itemtype": "property", - "name": "url", - "type": "String", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 30, - "description": "Whether the requests should be treated as cross origin", - "itemtype": "property", - "name": "crossorigin", - "type": "Boolean", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 38, - "description": "[read-only] The base url of the bitmap font data", - "itemtype": "property", - "name": "baseUrl", - "type": "String", - "readonly": "", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 47, - "description": "The texture being loaded", - "itemtype": "property", - "name": "texture", - "type": "Texture", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 55, - "description": "The frames of the sprite sheet", - "itemtype": "property", - "name": "frames", - "type": "Object", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 69, - "description": "This will begin loading the JSON file", - "itemtype": "method", - "name": "load", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 84, - "description": "Invoke when all files are loaded (json and texture)", - "itemtype": "method", - "name": "onLoaded", - "access": "private", - "tagname": "", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 18, - "description": "The alpha value used when filling the Graphics object.", - "itemtype": "property", - "name": "fillAlpha", - "type": "Number", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 26, - "description": "The width (thickness) of any lines drawn.", - "itemtype": "property", - "name": "lineWidth", - "type": "Number", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 34, - "description": "The color of any lines drawn.", - "itemtype": "property", - "name": "lineColor", - "type": "String", - "default": "0", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 43, - "description": "Graphics data", - "itemtype": "property", - "name": "graphicsData", - "type": "Array", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 52, - "description": "The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint.", - "itemtype": "property", - "name": "tint", - "type": "Number", - "default": "0xFFFFFF", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 61, - "description": "The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode.", - "itemtype": "property", - "name": "blendMode", - "type": "Number", - "default": "PIXI.blendModes.NORMAL;", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 70, - "description": "Current path", - "itemtype": "property", - "name": "currentPath", - "type": "Object", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 79, - "description": "Array containing some WebGL-related properties used by the WebGL renderer.", - "itemtype": "property", - "name": "_webGL", - "type": "Array", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 88, - "description": "Whether this shape is being used as a mask.", - "itemtype": "property", - "name": "isMask", - "type": "Boolean", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 96, - "description": "The bounds' padding used for bounds calculation.", - "itemtype": "property", - "name": "boundsPadding", - "type": "Number", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 106, - "description": "Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated.", - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 115, - "description": "Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated.", - "itemtype": "property", - "name": "webGLDirty", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 124, - "description": "Used to detect if the cached sprite object needs to be updated.", - "itemtype": "property", - "name": "cachedSpriteDirty", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 139, - "description": "When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite.\nThis is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory.\nIt is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas.\nThis is not recommended if you are constantly redrawing the graphics element.", - "itemtype": "property", - "name": "cacheAsBitmap", - "type": "Boolean", - "default": "false", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 171, - "description": "Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.", - "itemtype": "method", - "name": "lineStyle", - "params": [ - { - "name": "lineWidth", - "description": "width of the line to draw, will update the objects stored style", - "type": "Number" - }, - { - "name": "color", - "description": "color of the line to draw, will update the objects stored style", - "type": "Number" - }, - { - "name": "alpha", - "description": "alpha of the line to draw, will update the objects stored style", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 205, - "description": "Moves the current drawing position to x, y.", - "itemtype": "method", - "name": "moveTo", - "params": [ - { - "name": "x", - "description": "the X coordinate to move to", - "type": "Number" - }, - { - "name": "y", - "description": "the Y coordinate to move to", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 220, - "description": "Draws a line using the current line style from the current drawing position to (x, y);\nThe current drawing position is then set to (x, y).", - "itemtype": "method", - "name": "lineTo", - "params": [ - { - "name": "x", - "description": "the X coordinate to draw to", - "type": "Number" - }, - { - "name": "y", - "description": "the Y coordinate to draw to", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 237, - "description": "Calculate the points for a quadratic bezier curve and then draws it.\nBased on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c", - "itemtype": "method", - "name": "quadraticCurveTo", - "params": [ - { - "name": "cpX", - "description": "Control point x", - "type": "Number" - }, - { - "name": "cpY", - "description": "Control point y", - "type": "Number" - }, - { - "name": "toX", - "description": "Destination point x", - "type": "Number" - }, - { - "name": "toY", - "description": "Destination point y", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 287, - "description": "Calculate the points for a bezier curve and then draws it.", - "itemtype": "method", - "name": "bezierCurveTo", - "params": [ - { - "name": "cpX", - "description": "Control point x", - "type": "Number" - }, - { - "name": "cpY", - "description": "Control point y", - "type": "Number" - }, - { - "name": "cpX2", - "description": "Second Control point x", - "type": "Number" - }, - { - "name": "cpY2", - "description": "Second Control point y", - "type": "Number" - }, - { - "name": "toX", - "description": "Destination point x", - "type": "Number" - }, - { - "name": "toY", - "description": "Destination point y", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 414, - "description": "The arc method creates an arc/curve (used to create circles, or parts of circles).", - "itemtype": "method", - "name": "arc", - "params": [ - { - "name": "cx", - "description": "The x-coordinate of the center of the circle", - "type": "Number" - }, - { - "name": "cy", - "description": "The y-coordinate of the center of the circle", - "type": "Number" - }, - { - "name": "radius", - "description": "The radius of the circle", - "type": "Number" - }, - { - "name": "startAngle", - "description": "The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle)", - "type": "Number" - }, - { - "name": "endAngle", - "description": "The ending angle, in radians", - "type": "Number" - }, - { - "name": "anticlockwise", - "description": "Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise.", - "type": "Boolean" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 488, - "description": "Specifies a simple one-color fill that subsequent calls to other Graphics methods\n(such as lineTo() or drawCircle()) use when drawing.", - "itemtype": "method", - "name": "beginFill", - "params": [ - { - "name": "color", - "description": "the color of the fill", - "type": "Number" - }, - { - "name": "alpha", - "description": "the alpha of the fill", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 515, - "description": "Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.", - "itemtype": "method", - "name": "endFill", - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 530, - "itemtype": "method", - "name": "drawRect", - "params": [ - { - "name": "x", - "description": "The X coord of the top-left of the rectangle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coord of the top-left of the rectangle", - "type": "Number" - }, - { - "name": "width", - "description": "The width of the rectangle", - "type": "Number" - }, - { - "name": "height", - "description": "The height of the rectangle", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 546, - "itemtype": "method", - "name": "drawRoundedRect", - "params": [ - { - "name": "x", - "description": "The X coord of the top-left of the rectangle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coord of the top-left of the rectangle", - "type": "Number" - }, - { - "name": "width", - "description": "The width of the rectangle", - "type": "Number" - }, - { - "name": "height", - "description": "The height of the rectangle", - "type": "Number" - }, - { - "name": "radius", - "description": "Radius of the rectangle corners", - "type": "Number" - } - ], - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 562, - "description": "Draws a circle.", - "itemtype": "method", - "name": "drawCircle", - "params": [ - { - "name": "x", - "description": "The X coordinate of the center of the circle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the center of the circle", - "type": "Number" - }, - { - "name": "radius", - "description": "The radius of the circle", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 578, - "description": "Draws an ellipse.", - "itemtype": "method", - "name": "drawEllipse", - "params": [ - { - "name": "x", - "description": "The X coordinate of the center of the ellipse", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the center of the ellipse", - "type": "Number" - }, - { - "name": "width", - "description": "The half width of the ellipse", - "type": "Number" - }, - { - "name": "height", - "description": "The half height of the ellipse", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 595, - "description": "Draws a polygon using the given path.", - "itemtype": "method", - "name": "drawPolygon", - "params": [ - { - "name": "path", - "description": "The path data used to construct the polygon.", - "type": "Array" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 609, - "description": "Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.", - "itemtype": "method", - "name": "clear", - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 627, - "description": "Useful function that returns a texture of the graphics object that can then be used to create sprites\nThis can be quite useful if your geometry is complicated and needs to be reused multiple times.", - "itemtype": "method", - "name": "generateTexture", - "params": [ - { - "name": "resolution", - "description": "The resolution of the texture being generated", - "type": "Number" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ], - "return": { - "description": "a texture of the graphics object", - "type": "Texture" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 656, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 736, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 805, - "description": "Retrieves the bounds of the graphic shape as a rectangle object", - "itemtype": "method", - "name": "getBounds", - "return": { - "description": "the rectangular bounding area", - "type": "Rectangle" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 884, - "description": "Update the bounds of the object", - "itemtype": "method", - "name": "updateLocalBounds", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 983, - "description": "Generates the cached sprite when the sprite has cacheAsBitmap = true", - "itemtype": "method", - "name": "_generateCachedSprite", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 1023, - "description": "Updates texture size based on canvas size", - "itemtype": "method", - "name": "updateCachedSpriteTexture", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 1047, - "description": "Destroys a previous cached sprite.", - "itemtype": "method", - "name": "destroyCachedSprite", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 1061, - "description": "Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.", - "itemtype": "method", - "name": "drawShape", - "params": [ - { - "name": "shape", - "description": "The Shape object to draw.", - "type": "Circle|Rectangle|Ellipse|Line|Polygon" - } - ], - "return": { - "description": "The generated GraphicsData object.", - "type": "GraphicsData" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 15, - "description": "The width of the Canvas in pixels.", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 23, - "description": "The height of the Canvas in pixels.", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 31, - "description": "The Canvas object that belongs to this CanvasBuffer.", - "itemtype": "property", - "name": "canvas", - "type": "HTMLCanvasElement", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 39, - "description": "A CanvasRenderingContext2D object representing a two-dimensional rendering context.", - "itemtype": "property", - "name": "context", - "type": "CanvasRenderingContext2D", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 53, - "description": "Clears the canvas that was created by the CanvasBuffer class.", - "itemtype": "method", - "name": "clear", - "access": "private", - "tagname": "", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 65, - "description": "Resizes the canvas to the specified width and height.", - "itemtype": "method", - "name": "resize", - "params": [ - { - "name": "width", - "description": "the new width of the canvas", - "type": "Number" - }, - { - "name": "height", - "description": "the new height of the canvas", - "type": "Number" - } - ], - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasMaskManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CanvasMaskManager" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasMaskManager.js", - "line": 17, - "description": "This method adds it to the current stack of masks.", - "itemtype": "method", - "name": "pushMask", - "params": [ - { - "name": "maskData", - "description": "the maskData that will be pushed", - "type": "Object" - }, - { - "name": "renderSession", - "description": "The renderSession whose context will be used for this mask manager.", - "type": "Object" - } - ], - "class": "CanvasMaskManager" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasMaskManager.js", - "line": 49, - "description": "Restores the current drawing context to the state it was before the mask was applied.", - "itemtype": "method", - "name": "popMask", - "params": [ - { - "name": "renderSession", - "description": "The renderSession whose context will be used for this mask manager.", - "type": "Object" - } - ], - "class": "CanvasMaskManager" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 14, - "description": "Basically this method just needs a sprite and a color and tints the sprite with the given color.", - "itemtype": "method", - "name": "getTintedTexture", - "params": [ - { - "name": "sprite", - "description": "the sprite to tint", - "type": "Sprite" - }, - { - "name": "color", - "description": "the color to use to tint the sprite with", - "type": "Number" - } - ], - "return": { - "description": "The tinted canvas", - "type": "HTMLCanvasElement" - }, - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 58, - "description": "Tint a texture using the \"multiply\" operation.", - "itemtype": "method", - "name": "tintWithMultiply", - "params": [ - { - "name": "texture", - "description": "the texture to tint", - "type": "Texture" - }, - { - "name": "color", - "description": "the color to use to tint the sprite with", - "type": "Number" - }, - { - "name": "canvas", - "description": "the current canvas", - "type": "HTMLCanvasElement" - } - ], - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 104, - "description": "Tint a texture using the \"overlay\" operation.", - "itemtype": "method", - "name": "tintWithOverlay", - "params": [ - { - "name": "texture", - "description": "the texture to tint", - "type": "Texture" - }, - { - "name": "color", - "description": "the color to use to tint the sprite with", - "type": "Number" - }, - { - "name": "canvas", - "description": "the current canvas", - "type": "HTMLCanvasElement" - } - ], - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 139, - "description": "Tint a texture pixel per pixel.", - "itemtype": "method", - "name": "tintPerPixel", - "params": [ - { - "name": "texture", - "description": "the texture to tint", - "type": "Texture" - }, - { - "name": "color", - "description": "the color to use to tint the sprite with", - "type": "Number" - }, - { - "name": "canvas", - "description": "the current canvas", - "type": "HTMLCanvasElement" - } - ], - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 184, - "description": "Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel.", - "itemtype": "method", - "name": "roundColor", - "params": [ - { - "name": "color", - "description": "the color to round, should be a hex color", - "type": "Number" - } - ], - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 203, - "description": "Number of steps which will be used as a cap when rounding colors.", - "itemtype": "property", - "name": "cacheStepsPerColorChannel", - "type": "Number", - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 211, - "description": "Tint cache boolean flag.", - "itemtype": "property", - "name": "convertTintToImage", - "type": "Boolean", - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 219, - "description": "Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method.", - "itemtype": "property", - "name": "canUseMultiply", - "type": "Boolean", - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 227, - "description": "The tinting method that will be used.", - "itemtype": "method", - "name": "tintMethod", - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/CanvasGraphics.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CanvasGraphics" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 40, - "description": "The renderer type.", - "itemtype": "property", - "name": "type", - "type": "Number", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 48, - "description": "The resolution of the canvas.", - "itemtype": "property", - "name": "resolution", - "type": "Number", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 56, - "description": "This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\nIf the Stage is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\nIf the Stage is transparent Pixi will use clearRect to clear the canvas every frame.\nDisable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.", - "itemtype": "property", - "name": "clearBeforeRender", - "type": "Boolean", - "default": "", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 68, - "description": "Whether the render view is transparent", - "itemtype": "property", - "name": "transparent", - "type": "Boolean", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 76, - "description": "Whether the render view should be resized automatically", - "itemtype": "property", - "name": "autoResize", - "type": "Boolean", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 85, - "description": "The width of the canvas view", - "itemtype": "property", - "name": "width", - "type": "Number", - "default": "800", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 94, - "description": "The height of the canvas view", - "itemtype": "property", - "name": "height", - "type": "Number", - "default": "600", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 106, - "description": "The canvas element that everything is drawn to.", - "itemtype": "property", - "name": "view", - "type": "HTMLCanvasElement", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 114, - "description": "The canvas 2d context that everything is drawn with", - "itemtype": "property", - "name": "context", - "type": "CanvasRenderingContext2D", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 121, - "description": "Boolean flag controlling canvas refresh.", - "itemtype": "property", - "name": "refresh", - "type": "Boolean", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 132, - "description": "Internal var.", - "itemtype": "property", - "name": "count", - "type": "Number", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 140, - "description": "Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer", - "itemtype": "property", - "name": "CanvasMaskManager", - "type": "CanvasMaskManager", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 147, - "description": "The render session is just a bunch of parameter used for rendering", - "itemtype": "property", - "name": "renderSession", - "type": "Object", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 157, - "description": "If true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation.\nHandy for crisp pixel art and speed on legacy devices.", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 184, - "description": "Renders the Stage to this canvas view", - "itemtype": "method", - "name": "render", - "params": [ - { - "name": "stage", - "description": "the Stage element to be rendered", - "type": "Stage" - } - ], - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 233, - "description": "Removes everything from the renderer and optionally removes the Canvas DOM element.", - "itemtype": "method", - "name": "destroy", - "params": [ - { - "name": "removeView", - "description": "Removes the Canvas element from the DOM.", - "type": "Boolean", - "optional": true, - "optdefault": "true" - } - ], - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 255, - "description": "Resizes the canvas view to the specified width and height", - "itemtype": "method", - "name": "resize", - "params": [ - { - "name": "width", - "description": "the new width of the canvas view", - "type": "Number" - }, - { - "name": "height", - "description": "the new height of the canvas view", - "type": "Number" - } - ], - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 276, - "description": "Renders a display object", - "itemtype": "method", - "name": "renderDisplayObject", - "params": [ - { - "name": "displayObject", - "description": "The displayObject to render", - "type": "DisplayObject" - }, - { - "name": "context", - "description": "the context 2d method of the canvas", - "type": "CanvasRenderingContext2D" - } - ], - "access": "private", - "tagname": "", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 291, - "description": "Maps Pixi blend modes to canvas blend modes.", - "itemtype": "method", - "name": "mapBlendModes", - "access": "private", - "tagname": "", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 12, - "itemtype": "property", - "name": "_UID", - "type": "Number", - "access": "private", - "tagname": "", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 19, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 25, - "description": "The WebGL program.", - "itemtype": "property", - "name": "program", - "type": "{Any}", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 32, - "description": "The fragment shader.", - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 48, - "description": "The vertex shader.", - "itemtype": "property", - "name": "vertexSrc", - "type": "Array", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 79, - "description": "Initialises the shader.", - "itemtype": "method", - "name": "init", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 109, - "description": "Destroys the shader.", - "itemtype": "method", - "name": "destroy", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 12, - "itemtype": "property", - "name": "_UID", - "type": "Number", - "access": "private", - "tagname": "", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 19, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 25, - "description": "The WebGL program.", - "itemtype": "property", - "name": "program", - "type": "{Any}", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 32, - "description": "The fragment shader.", - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 47, - "description": "The vertex shader.", - "itemtype": "property", - "name": "vertexSrc", - "type": "Array", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 82, - "description": "A local texture counter for multi-texture shaders.", - "itemtype": "property", - "name": "textureCount", - "type": "Number", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 94, - "description": "Initialises the shader.", - "itemtype": "method", - "name": "init", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 143, - "description": "Destroys the shader.", - "itemtype": "method", - "name": "destroy", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 1, - "author": "Richard Davey http://www.photonstorm.com @photonstorm", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 13, - "itemtype": "property", - "name": "_UID", - "type": "Number", - "access": "private", - "tagname": "", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 20, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 26, - "description": "The WebGL program.", - "itemtype": "property", - "name": "program", - "type": "{Any}", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 33, - "description": "The fragment shader.", - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 48, - "description": "A local texture counter for multi-texture shaders.", - "itemtype": "property", - "name": "textureCount", - "type": "Number", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 55, - "description": "A local flag", - "itemtype": "property", - "name": "firstRun", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 63, - "description": "A dirty flag", - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 70, - "description": "Uniform attributes cache.", - "itemtype": "property", - "name": "attributes", - "type": "Array", - "access": "private", - "tagname": "", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 83, - "description": "Initialises the shader.", - "itemtype": "method", - "name": "init", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 134, - "description": "Initialises the shader uniform values.\n\nUniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/\nhttp://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf", - "itemtype": "method", - "name": "initUniforms", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 208, - "description": "Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded)", - "itemtype": "method", - "name": "initSampler2D", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 283, - "description": "Updates the shader uniform values.", - "itemtype": "method", - "name": "syncUniforms", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 351, - "description": "Destroys the shader.", - "itemtype": "method", - "name": "destroy", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 365, - "description": "The Default Vertex shader source.", - "itemtype": "property", - "name": "defaultVertexSrc", - "type": "String", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 12, - "itemtype": "property", - "name": "_UID", - "type": "Number", - "access": "private", - "tagname": "", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 19, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 25, - "description": "The WebGL program.", - "itemtype": "property", - "name": "program", - "type": "{Any}", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 32, - "description": "The fragment shader.", - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 46, - "description": "The vertex shader.", - "itemtype": "property", - "name": "vertexSrc", - "type": "Array", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 74, - "description": "Initialises the shader.", - "itemtype": "method", - "name": "init", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 103, - "description": "Destroys the shader.", - "itemtype": "method", - "name": "destroy", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 12, - "itemtype": "property", - "name": "_UID", - "type": "Number", - "access": "private", - "tagname": "", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 19, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 25, - "description": "The WebGL program.", - "itemtype": "property", - "name": "program", - "type": "{Any}", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 32, - "description": "The fragment shader.", - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 50, - "description": "The vertex shader.", - "itemtype": "property", - "name": "vertexSrc", - "type": "Array", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 80, - "description": "Initialises the shader.", - "itemtype": "method", - "name": "init", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 111, - "description": "Destroys the shader.", - "itemtype": "method", - "name": "destroy", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 15, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 23, - "itemtype": "property", - "name": "frameBuffer", - "type": "Any", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 29, - "itemtype": "property", - "name": "texture", - "type": "Any", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 35, - "itemtype": "property", - "name": "scaleMode", - "type": "Number", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 61, - "description": "Clears the filter texture.", - "itemtype": "method", - "name": "clear", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 74, - "description": "Resizes the texture to the specified width and height", - "itemtype": "method", - "name": "resize", - "params": [ - { - "name": "width", - "description": "the new width of the texture", - "type": "Number" - }, - { - "name": "height", - "description": "the new height of the texture", - "type": "Number" - } - ], - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 97, - "description": "Destroys the filter texture.", - "itemtype": "method", - "name": "destroy", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLBlendModeManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 12, - "itemtype": "property", - "name": "currentBlendMode", - "type": "Number", - "class": "WebGLBlendModeManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 21, - "description": "Sets the WebGL Context.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLBlendModeManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 32, - "description": "Sets-up the given blendMode from WebGL's point of view.", - "itemtype": "method", - "name": "setBlendMode", - "params": [ - { - "name": "blendMode", - "description": "the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD", - "type": "Number" - } - ], - "class": "WebGLBlendModeManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 50, - "description": "Destroys this object.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLBlendModeManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 1, - "author": "Mat Groves\n\nBig thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\nfor creating the original pixi version!\n\nHeavily inspired by LibGDX's WebGLSpriteBatch:\nhttps://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 17, - "itemtype": "property", - "name": "vertSize", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 23, - "itemtype": "property", - "name": "maxSize", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 29, - "itemtype": "property", - "name": "size", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 41, - "description": "Vertex data", - "itemtype": "property", - "name": "vertices", - "type": "Float32Array", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 48, - "description": "Index data", - "itemtype": "property", - "name": "indices", - "type": "Uint16Array", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 55, - "itemtype": "property", - "name": "vertexBuffer", - "type": "Object", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 61, - "itemtype": "property", - "name": "indexBuffer", - "type": "Object", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 67, - "itemtype": "property", - "name": "lastIndexCount", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 83, - "itemtype": "property", - "name": "drawing", - "type": "Boolean", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 89, - "itemtype": "property", - "name": "currentBatchSize", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 95, - "itemtype": "property", - "name": "currentBaseTexture", - "type": "BaseTexture", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 101, - "itemtype": "property", - "name": "currentBlendMode", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 107, - "itemtype": "property", - "name": "renderSession", - "type": "Object", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 113, - "itemtype": "property", - "name": "shader", - "type": "Object", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 119, - "itemtype": "property", - "name": "matrix", - "type": "Matrix", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 130, - "description": "Sets the WebGL Context.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 154, - "itemtype": "method", - "name": "begin", - "params": [ - { - "name": "spriteBatch", - "description": "", - "type": "WebGLSpriteBatch" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 169, - "itemtype": "method", - "name": "end", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 177, - "itemtype": "method", - "name": "render", - "params": [ - { - "name": "spriteBatch", - "description": "", - "type": "WebGLSpriteBatch" - } - ], - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 208, - "itemtype": "method", - "name": "renderSprite", - "params": [ - { - "name": "sprite", - "description": "", - "type": "Sprite" - } - ], - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 349, - "itemtype": "method", - "name": "flush", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 389, - "itemtype": "method", - "name": "stop", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 397, - "itemtype": "method", - "name": "start", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 11, - "itemtype": "property", - "name": "filterStack", - "type": "Array", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 17, - "itemtype": "property", - "name": "offsetX", - "type": "Number", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 23, - "itemtype": "property", - "name": "offsetY", - "type": "Number", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 32, - "description": "Initialises the context and the properties.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 46, - "itemtype": "method", - "name": "begin", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - }, - { - "name": "buffer", - "description": "", - "type": "ArrayBuffer" - } - ], - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 62, - "description": "Applies the filter and adds it to the current filter stack.", - "itemtype": "method", - "name": "pushFilter", - "params": [ - { - "name": "filterBlock", - "description": "the filter that will be pushed to the current filter stack", - "type": "Object" - } - ], - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 138, - "description": "Removes the last filter from the filter stack and doesn't return it.", - "itemtype": "method", - "name": "popFilter", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 315, - "description": "Applies the filter to the specified area.", - "itemtype": "method", - "name": "applyFilterPass", - "params": [ - { - "name": "filter", - "description": "the filter that needs to be applied", - "type": "AbstractFilter" - }, - { - "name": "filterArea", - "description": "TODO - might need an update", - "type": "Texture" - }, - { - "name": "width", - "description": "the horizontal range of the filter", - "type": "Number" - }, - { - "name": "height", - "description": "the vertical range of the filter", - "type": "Number" - } - ], - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 376, - "description": "Initialises the shader buffers.", - "itemtype": "method", - "name": "initShaderBuffers", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 424, - "description": "Destroys the filter and removes it from the filter stack.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 16, - "description": "Renders the graphics object", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "renderGraphics", - "params": [ - { - "name": "graphics", - "description": "", - "type": "Graphics" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 84, - "description": "Updates the graphics object", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "updateGraphics", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object to update", - "type": "Graphics" - }, - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 199, - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "switchMode", - "params": [ - { - "name": "webGL", - "description": "", - "type": "WebGLContext" - }, - { - "name": "type", - "description": "", - "type": "Number" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 233, - "description": "Builds a rectangle to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildRectangle", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object containing all the necessary properties", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 301, - "description": "Builds a rounded rectangle to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildRoundedRectangle", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object containing all the necessary properties", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 369, - "description": "Calculate the points for a quadratic bezier curve. (helper function..)\nBased on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "quadraticBezierCurve", - "params": [ - { - "name": "fromX", - "description": "Origin point x", - "type": "Number" - }, - { - "name": "fromY", - "description": "Origin point x", - "type": "Number" - }, - { - "name": "cpX", - "description": "Control point x", - "type": "Number" - }, - { - "name": "cpY", - "description": "Control point y", - "type": "Number" - }, - { - "name": "toX", - "description": "Destination point x", - "type": "Number" - }, - { - "name": "toY", - "description": "Destination point y", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Array" - }, - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 421, - "description": "Builds a circle to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildCircle", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object to draw", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 504, - "description": "Builds a line to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildLine", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object containing all the necessary properties", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 716, - "description": "Builds a complex polygon to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildComplexPoly", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object containing all the necessary properties", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 778, - "description": "Builds a polygon to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildPoly", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object containing all the necessary properties", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 850, - "itemtype": "method", - "name": "reset", - "class": "WebGLGraphicsData" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 860, - "itemtype": "method", - "name": "upload", - "class": "WebGLGraphicsData" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLMaskManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 16, - "description": "Sets the drawing context to the one given in parameter.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLMaskManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 27, - "description": "Applies the Mask and adds it to the current filter stack.", - "itemtype": "method", - "name": "pushMask", - "params": [ - { - "name": "maskData", - "description": "", - "type": "Array" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLMaskManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 48, - "description": "Removes the last filter from the filter stack and doesn't return it.", - "itemtype": "method", - "name": "popMask", - "params": [ - { - "name": "maskData", - "description": "", - "type": "Array" - }, - { - "name": "renderSession", - "description": "an object containing all the useful parameters", - "type": "Object" - } - ], - "class": "WebGLMaskManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 61, - "description": "Destroys the mask stack.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLMaskManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 12, - "itemtype": "property", - "name": "maxAttibs", - "type": "Number", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 18, - "itemtype": "property", - "name": "attribState", - "type": "Array", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 24, - "itemtype": "property", - "name": "tempAttribState", - "type": "Array", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 35, - "itemtype": "property", - "name": "stack", - "type": "Array", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 45, - "description": "Initialises the context and the properties.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 72, - "description": "Takes the attributes given in parameters.", - "itemtype": "method", - "name": "setAttribs", - "params": [ - { - "name": "attribs", - "description": "attribs", - "type": "Array" - } - ], - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 115, - "description": "Sets the current shader.", - "itemtype": "method", - "name": "setShader", - "params": [ - { - "name": "shader", - "description": "", - "type": "Any" - } - ], - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 135, - "description": "Destroys this object.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 5, - "itemtype": "method", - "name": "initDefaultShaders", - "static": 1, - "access": "private", - "tagname": "", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 14, - "itemtype": "method", - "name": "CompileVertexShader", - "static": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - }, - { - "name": "shaderSrc", - "description": "", - "type": "Array" - } - ], - "return": { - "description": "", - "type": "Any" - }, - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 26, - "itemtype": "method", - "name": "CompileFragmentShader", - "static": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - }, - { - "name": "shaderSrc", - "description": "", - "type": "Array" - } - ], - "return": { - "description": "", - "type": "Any" - }, - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 38, - "itemtype": "method", - "name": "_CompileShader", - "static": 1, - "access": "private", - "tagname": "", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - }, - { - "name": "shaderSrc", - "description": "", - "type": "Array" - }, - { - "name": "shaderType", - "description": "", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Any" - }, - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 63, - "itemtype": "method", - "name": "compileProgram", - "static": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - }, - { - "name": "vertexSrc", - "description": "", - "type": "Array" - }, - { - "name": "fragmentSrc", - "description": "", - "type": "Array" - } - ], - "return": { - "description": "", - "type": "Any" - }, - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 1, - "author": "Mat Groves\n\nBig thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\nfor creating the original pixi version!\n\nHeavily inspired by LibGDX's WebGLSpriteBatch:\nhttps://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 19, - "itemtype": "property", - "name": "vertSize", - "type": "Number", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 25, - "description": "The number of images in the SpriteBatch before it flushes", - "itemtype": "property", - "name": "size", - "type": "Number", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 37, - "description": "Holds the vertices", - "itemtype": "property", - "name": "vertices", - "type": "Float32Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 45, - "description": "Holds the indices", - "itemtype": "property", - "name": "indices", - "type": "Uint16Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 53, - "itemtype": "property", - "name": "lastIndexCount", - "type": "Number", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 69, - "itemtype": "property", - "name": "drawing", - "type": "Boolean", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 75, - "itemtype": "property", - "name": "currentBatchSize", - "type": "Number", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 81, - "itemtype": "property", - "name": "currentBaseTexture", - "type": "BaseTexture", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 87, - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 93, - "itemtype": "property", - "name": "textures", - "type": "Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 99, - "itemtype": "property", - "name": "blendModes", - "type": "Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 105, - "itemtype": "property", - "name": "shaders", - "type": "Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 111, - "itemtype": "property", - "name": "sprites", - "type": "Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 117, - "itemtype": "property", - "name": "defaultShader", - "type": "AbstractFilter", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 132, - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 164, - "itemtype": "method", - "name": "begin", - "params": [ - { - "name": "renderSession", - "description": "The RenderSession object", - "type": "Object" - } - ], - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 176, - "itemtype": "method", - "name": "end", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 184, - "itemtype": "method", - "name": "render", - "params": [ - { - "name": "sprite", - "description": "the sprite to render when using this spritebatch", - "type": "Sprite" - } - ], - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 297, - "description": "Renders a TilingSprite using the spriteBatch.", - "itemtype": "method", - "name": "renderTilingSprite", - "params": [ - { - "name": "sprite", - "description": "the tilingSprite to render", - "type": "TilingSprite" - } - ], - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 418, - "description": "Renders the content and empties the current batch.", - "itemtype": "method", - "name": "flush", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 542, - "itemtype": "method", - "name": "renderBatch", - "params": [ - { - "name": "texture", - "description": "", - "type": "Texture" - }, - { - "name": "size", - "description": "", - "type": "Number" - }, - { - "name": "startIndex", - "description": "", - "type": "Number" - } - ], - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 572, - "itemtype": "method", - "name": "stop", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 581, - "itemtype": "method", - "name": "start", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 589, - "description": "Destroys the SpriteBatch.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 17, - "description": "Sets the drawing context to the one given in parameter.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 28, - "description": "Applies the Mask and adds it to the current filter stack.", - "itemtype": "method", - "name": "pushMask", - "params": [ - { - "name": "graphics", - "description": "", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Array" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 120, - "description": "TODO this does not belong here!", - "itemtype": "method", - "name": "bindGraphics", - "params": [ - { - "name": "graphics", - "description": "", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Array" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 190, - "itemtype": "method", - "name": "popStencil", - "params": [ - { - "name": "graphics", - "description": "", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Array" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 285, - "description": "Destroys the mask stack.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 46, - "itemtype": "property", - "name": "type", - "type": "Number", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 52, - "description": "The resolution of the renderer", - "itemtype": "property", - "name": "resolution", - "type": "Number", - "default": "1", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 63, - "description": "Whether the render view is transparent", - "itemtype": "property", - "name": "transparent", - "type": "Boolean", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 71, - "description": "Whether the render view should be resized automatically", - "itemtype": "property", - "name": "autoResize", - "type": "Boolean", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 79, - "description": "The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering.", - "itemtype": "property", - "name": "preserveDrawingBuffer", - "type": "Boolean", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 87, - "description": "This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true:\nIf the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0).\nIf the Stage is transparent, Pixi will clear to the target Stage's background color.\nDisable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set.", - "itemtype": "property", - "name": "clearBeforeRender", - "type": "Boolean", - "default": "", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 99, - "description": "The width of the canvas view", - "itemtype": "property", - "name": "width", - "type": "Number", - "default": "800", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 108, - "description": "The height of the canvas view", - "itemtype": "property", - "name": "height", - "type": "Number", - "default": "600", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 117, - "description": "The canvas element that everything is drawn to", - "itemtype": "property", - "name": "view", - "type": "HTMLCanvasElement", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 127, - "itemtype": "property", - "name": "contextLostBound", - "type": "Function", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 133, - "itemtype": "property", - "name": "contextRestoredBound", - "type": "Function", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 142, - "itemtype": "property", - "name": "_contextOptions", - "type": "Object", - "access": "private", - "tagname": "", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 155, - "itemtype": "property", - "name": "projection", - "type": "Point", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 161, - "itemtype": "property", - "name": "offset", - "type": "Point", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 169, - "description": "Deals with managing the shader programs and their attribs", - "itemtype": "property", - "name": "shaderManager", - "type": "WebGLShaderManager", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 176, - "description": "Manages the rendering of sprites", - "itemtype": "property", - "name": "spriteBatch", - "type": "WebGLSpriteBatch", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 183, - "description": "Manages the masks using the stencil buffer", - "itemtype": "property", - "name": "maskManager", - "type": "WebGLMaskManager", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 190, - "description": "Manages the filters", - "itemtype": "property", - "name": "filterManager", - "type": "WebGLFilterManager", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 197, - "description": "Manages the stencil buffer", - "itemtype": "property", - "name": "stencilManager", - "type": "WebGLStencilManager", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 204, - "description": "Manages the blendModes", - "itemtype": "property", - "name": "blendModeManager", - "type": "WebGLBlendModeManager", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 211, - "description": "TODO remove", - "itemtype": "property", - "name": "renderSession", - "type": "Object", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 238, - "itemtype": "method", - "name": "initContext", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 276, - "description": "Renders the stage to its webGL view", - "itemtype": "method", - "name": "render", - "params": [ - { - "name": "stage", - "description": "the Stage element to be rendered", - "type": "Stage" - } - ], - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 344, - "description": "Renders a Display Object.", - "itemtype": "method", - "name": "renderDisplayObject", - "params": [ - { - "name": "displayObject", - "description": "The DisplayObject to render", - "type": "DisplayObject" - }, - { - "name": "projection", - "description": "The projection", - "type": "Point" - }, - { - "name": "buffer", - "description": "a standard WebGL buffer", - "type": "Array" - } - ], - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 378, - "description": "Resizes the webGL view to the specified width and height.", - "itemtype": "method", - "name": "resize", - "params": [ - { - "name": "width", - "description": "the new width of the webGL view", - "type": "Number" - }, - { - "name": "height", - "description": "the new height of the webGL view", - "type": "Number" - } - ], - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 404, - "description": "Updates and Creates a WebGL texture for the renderers context.", - "itemtype": "method", - "name": "updateTexture", - "params": [ - { - "name": "texture", - "description": "the texture to update", - "type": "Texture" - } - ], - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 443, - "description": "Handles a lost webgl context", - "itemtype": "method", - "name": "handleContextLost", - "params": [ - { - "name": "event", - "description": "", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 456, - "description": "Handles a restored webgl context", - "itemtype": "method", - "name": "handleContextRestored", - "params": [ - { - "name": "event", - "description": "", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 477, - "description": "Removes everything from the renderer (event listeners, spritebatch, etc...)", - "itemtype": "method", - "name": "destroy", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 508, - "description": "Maps Pixi blend modes to WebGL blend modes.", - "itemtype": "method", - "name": "mapBlendModes", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 23, - "description": "[read-only] The width of the overall text, different from fontSize,\nwhich is defined in the style object", - "itemtype": "property", - "name": "textWidth", - "type": "Number", - "readonly": "", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 33, - "description": "[read-only] The height of the overall text, different from fontSize,\nwhich is defined in the style object", - "itemtype": "property", - "name": "textHeight", - "type": "Number", - "readonly": "", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 43, - "itemtype": "property", - "name": "_pool", - "type": "Array", - "access": "private", - "tagname": "", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 54, - "description": "The dirty state of this object.", - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 66, - "description": "Set the text string to be rendered.", - "itemtype": "method", - "name": "setText", - "params": [ - { - "name": "text", - "description": "The text that you would like displayed", - "type": "String" - } - ], - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 78, - "description": "Set the style of the text\nstyle.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)\n[style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single lines of text", - "itemtype": "method", - "name": "setStyle", - "params": [ - { - "name": "style", - "description": "The style parameters, contained as properties of an object", - "type": "Object" - } - ], - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 100, - "description": "Renders text and updates it when needed", - "itemtype": "method", - "name": "updateText", - "access": "private", - "tagname": "", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 198, - "description": "Updates the transform of this object", - "itemtype": "method", - "name": "updateTransform", - "access": "private", - "tagname": "", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/Text.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23\nModified by Tom Slezakowski http://www.tomslezakowski.com @TomSlezakowski (24/03/2014) - Added dropShadowColor.", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 29, - "description": "The canvas element that everything is drawn to", - "itemtype": "property", - "name": "canvas", - "type": "HTMLCanvasElement", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 37, - "description": "The canvas 2d context that everything is drawn with", - "itemtype": "property", - "name": "context", - "type": "HTMLCanvasElement", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 44, - "description": "The resolution of the canvas.", - "itemtype": "property", - "name": "resolution", - "type": "Number", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 62, - "description": "The width of the Text, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 86, - "description": "The height of the Text, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 110, - "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": "Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text", - "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, - "optdefault": "'black'" - }, - { - "name": "strokeThickness", - "description": "A number that represents the thickness of the stroke. Default is 0 (no stroke)", - "type": "Number", - "optional": true, - "optdefault": "0" - }, - { - "name": "wordWrap", - "description": "Indicates if word wrap should be used", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "wordWrapWidth", - "description": "The width at which text will wrap", - "type": "Number", - "optional": true, - "optdefault": "100" - }, - { - "name": "dropShadow", - "description": "Set a drop shadow for the text", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "dropShadowColor", - "description": "A fill style to be used on the dropshadow e.g 'red', '#00FF00'", - "type": "String", - "optional": true, - "optdefault": "'#000000'" - }, - { - "name": "dropShadowAngle", - "description": "Set a angle of the drop shadow", - "type": "Number", - "optional": true, - "optdefault": "Math.PI/4" - }, - { - "name": "dropShadowDistance", - "description": "Set a distance of the drop shadow", - "type": "Number", - "optional": true, - "optdefault": "5" - } - ] - }, - { - "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": 147, - "description": "Set the copy for the text object. To split a line you can use '\\n'.", - "itemtype": "method", - "name": "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": 159, - "description": "Renders text and updates it when needed", - "itemtype": "method", - "name": "updateText", - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 281, - "description": "Updates texture size based on canvas size", - "itemtype": "method", - "name": "updateTexture", - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 301, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 321, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 341, - "description": "Calculates the ascent, descent and fontSize of a given fontStyle", - "itemtype": "method", - "name": "determineFontProperties", - "params": [ - { - "name": "fontStyle", - "description": "", - "type": "Object" - } - ], - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 444, - "description": "Applies newlines to a string to have it optimally fit into the horizontal\nbounds set by the Text object's wordWrapWidth property.", - "itemtype": "method", - "name": "wordWrap", - "params": [ - { - "name": "text", - "description": "", - "type": "String" - } - ], - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 492, - "description": "Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account.", - "itemtype": "method", - "name": "getBounds", - "params": [ - { - "name": "matrix", - "description": "the transformation matrix of the Text", - "type": "Matrix" - } - ], - "return": { - "description": "the framing rectangle", - "type": "Rectangle" - }, - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 510, - "description": "Destroys this text object.", - "itemtype": "method", - "name": "destroy", - "params": [ - { - "name": "destroyBaseTexture", - "description": "whether to destroy the base texture as well", - "type": "Boolean" - } - ], - "class": "Text" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 20, - "description": "The Resolution of the texture.", - "itemtype": "property", - "name": "resolution", - "type": "Number", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 28, - "description": "[read-only] The width of the base texture set when the image has loaded", - "itemtype": "property", - "name": "width", - "type": "Number", - "readonly": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 37, - "description": "[read-only] The height of the base texture set when the image has loaded", - "itemtype": "property", - "name": "height", - "type": "Number", - "readonly": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 46, - "description": "The scale mode to apply when scaling this texture", - "itemtype": "property", - "name": "scaleMode", - "type": "PIXI.scaleModes", - "default": "PIXI.scaleModes.LINEAR", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 55, - "description": "[read-only] Set to true once the base texture has loaded", - "itemtype": "property", - "name": "hasLoaded", - "type": "Boolean", - "readonly": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 64, - "description": "The image source that is used to create the texture.", - "itemtype": "property", - "name": "source", - "type": "Image", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 74, - "description": "Controls if RGB channels should be pre-multiplied by Alpha (WebGL only)", - "itemtype": "property", - "name": "premultipliedAlpha", - "type": "Boolean", - "default": "true", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 85, - "itemtype": "property", - "name": "_glTextures", - "type": "Array", - "access": "private", - "tagname": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 95, - "itemtype": "property", - "name": "_dirty", - "type": "Array", - "access": "private", - "tagname": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 132, - "itemtype": "property", - "name": "imageUrl", - "type": "String", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 138, - "itemtype": "property", - "name": "_powerOf2", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 151, - "description": "Destroys this base texture", - "itemtype": "method", - "name": "destroy", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 174, - "description": "Changes the source image of the texture", - "itemtype": "method", - "name": "updateSourceImage", - "params": [ - { - "name": "newSrc", - "description": "the path of the image", - "type": "String" - } - ], - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 187, - "description": "Sets all glTextures to be dirty.", - "itemtype": "method", - "name": "dirty", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 200, - "description": "Removes the base texture from the GPU, useful for managing resources on the GPU.\nAtexture is still 100% usable and will simply be reuploaded if there is a sprite on screen that is using it.", - "itemtype": "method", - "name": "unloadFromGPU", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 228, - "description": "Helper function that creates a base texture from the given image url.\nIf the image is not in the base texture cache it will be created and loaded.", - "static": 1, - "itemtype": "method", - "name": "fromImage", - "params": [ - { - "name": "imageUrl", - "description": "The image url of the texture", - "type": "String" - }, - { - "name": "crossorigin", - "description": "", - "type": "Boolean" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ], - "return": { - "description": "BaseTexture" - }, - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 270, - "description": "Helper function that creates a base texture from the given canvas element.", - "static": 1, - "itemtype": "method", - "name": "fromCanvas", - "params": [ - { - "name": "canvas", - "description": "The canvas element source of the texture", - "type": "Canvas" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ], - "return": { - "description": "BaseTexture" - }, - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 37, - "description": "The with of the render texture", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 45, - "description": "The height of the render texture", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 53, - "description": "The Resolution of the texture.", - "itemtype": "property", - "name": "resolution", - "type": "Number", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 61, - "description": "The framing rectangle of the render texture", - "itemtype": "property", - "name": "frame", - "type": "Rectangle", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 69, - "description": "This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,\nirrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)", - "itemtype": "property", - "name": "crop", - "type": "Rectangle", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 78, - "description": "The base texture object that this texture uses", - "itemtype": "property", - "name": "baseTexture", - "type": "BaseTexture", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 99, - "description": "The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL.", - "itemtype": "property", - "name": "renderer", - "type": "CanvasRenderer|WebGLRenderer", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 125, - "itemtype": "property", - "name": "valid", - "type": "Boolean", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 137, - "description": "Resizes the RenderTexture.", - "itemtype": "method", - "name": "resize", - "params": [ - { - "name": "width", - "description": "The width to resize to.", - "type": "Number" - }, - { - "name": "height", - "description": "The height to resize to.", - "type": "Number" - }, - { - "name": "updateBase", - "description": "Should the baseTexture.width and height values be resized as well?", - "type": "Boolean" - } - ], - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 171, - "description": "Clears the RenderTexture.", - "itemtype": "method", - "name": "clear", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 188, - "description": "This function will draw the display object to the texture.", - "itemtype": "method", - "name": "renderWebGL", - "params": [ - { - "name": "displayObject", - "description": "The display object to render this texture on", - "type": "DisplayObject" - }, - { - "name": "matrix", - "description": "Optional matrix to apply to the display object before rendering.", - "type": "Matrix", - "optional": true - }, - { - "name": "clear", - "description": "If true the texture will be cleared before the displayObject is drawn", - "type": "Boolean", - "optional": true - } - ], - "access": "private", - "tagname": "", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 237, - "description": "This function will draw the display object to the texture.", - "itemtype": "method", - "name": "renderCanvas", - "params": [ - { - "name": "displayObject", - "description": "The display object to render this texture on", - "type": "DisplayObject" - }, - { - "name": "matrix", - "description": "Optional matrix to apply to the display object before rendering.", - "type": "Matrix", - "optional": true - }, - { - "name": "clear", - "description": "If true the texture will be cleared before the displayObject is drawn", - "type": "Boolean", - "optional": true - } - ], - "access": "private", - "tagname": "", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 278, - "description": "Will return a HTML Image of the texture", - "itemtype": "method", - "name": "getImage", - "return": { - "description": "", - "type": "Image" - }, - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 291, - "description": "Will return a a base64 encoded string of this texture. It works by calling RenderTexture.getCanvas and then running toDataURL on that.", - "itemtype": "method", - "name": "getBase64", - "return": { - "description": "A base64 encoded string of the texture.", - "type": "String" - }, - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 302, - "description": "Creates a Canvas element, renders this RenderTexture to it and then returns it.", - "itemtype": "method", - "name": "getCanvas", - "return": { - "description": "A Canvas element with the texture rendered on.", - "type": "HTMLCanvasElement" - }, - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 24, - "description": "Does this Texture have any frame data assigned to it?", - "itemtype": "property", - "name": "noFrame", - "type": "Boolean", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 43, - "description": "The base texture that this texture uses.", - "itemtype": "property", - "name": "baseTexture", - "type": "BaseTexture", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 51, - "description": "The frame specifies the region of the base texture that this texture uses", - "itemtype": "property", - "name": "frame", - "type": "Rectangle", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 59, - "description": "The texture trim data.", - "itemtype": "property", - "name": "trim", - "type": "Rectangle", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 67, - "description": "This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.", - "itemtype": "property", - "name": "valid", - "type": "Boolean", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 75, - "description": "This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)", - "itemtype": "property", - "name": "requiresUpdate", - "type": "Boolean", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 83, - "description": "The WebGL UV data cache.", - "itemtype": "property", - "name": "_uvs", - "type": "Object", - "access": "private", - "tagname": "", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 92, - "description": "The width of the Texture in pixels.", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 100, - "description": "The height of the Texture in pixels.", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 108, - "description": "This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,\nirrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)", - "itemtype": "property", - "name": "crop", - "type": "Rectangle", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 131, - "description": "Called when the base texture is loaded", - "itemtype": "method", - "name": "onBaseTextureLoaded", - "access": "private", - "tagname": "", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 149, - "description": "Destroys this texture", - "itemtype": "method", - "name": "destroy", - "params": [ - { - "name": "destroyBase", - "description": "Whether to destroy the base texture as well", - "type": "Boolean" - } - ], - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 162, - "description": "Specifies the region of the baseTexture that this texture will use.", - "itemtype": "method", - "name": "setFrame", - "params": [ - { - "name": "frame", - "description": "The frame of the texture to set it to", - "type": "Rectangle" - } - ], - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 200, - "description": "Updates the internal WebGL UV cache.", - "itemtype": "method", - "name": "_updateUvs", - "access": "private", - "tagname": "", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 227, - "description": "Helper function that creates a Texture object from the given image url.\nIf the image is not in the texture cache it will be created and loaded.", - "static": 1, - "itemtype": "method", - "name": "fromImage", - "params": [ - { - "name": "imageUrl", - "description": "The image url of the texture", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ], - "return": { - "description": "Texture" - }, - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 251, - "description": "Helper function that returns a Texture objected based on the given frame id.\nIf the frame id is not in the texture cache an error will be thrown.", - "static": 1, - "itemtype": "method", - "name": "fromFrame", - "params": [ - { - "name": "frameId", - "description": "The frame id of the texture", - "type": "String" - } - ], - "return": { - "description": "Texture" - }, - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 267, - "description": "Helper function that creates a new a Texture based on the given canvas element.", - "static": 1, - "itemtype": "method", - "name": "fromCanvas", - "params": [ - { - "name": "canvas", - "description": "The canvas element source of the texture", - "type": "Canvas" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ], - "return": { - "description": "Texture" - }, - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 284, - "description": "Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object.", - "static": 1, - "itemtype": "method", - "name": "addTextureToCache", - "params": [ - { - "name": "texture", - "description": "The Texture to add to the cache.", - "type": "Texture" - }, - { - "name": "id", - "description": "The id that the texture will be stored against.", - "type": "String" - } - ], - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 297, - "description": "Remove a texture from the global PIXI.TextureCache.", - "static": 1, - "itemtype": "method", - "name": "removeTextureFromCache", - "params": [ - { - "name": "id", - "description": "The id of the texture to be removed", - "type": "String" - } - ], - "return": { - "description": "The texture that was removed", - "type": "Texture" - }, - "class": "Texture" - }, - { - "file": "src/pixi/textures/VideoTexture.js", - "line": 87, - "description": "Mimic Pixi BaseTexture.from.... method.", - "params": [ - { - "name": "video", - "description": "" - }, - { - "name": "scaleMode", - "description": "" - } - ], - "return": { - "description": "", - "type": "PIXI.VideoTexture" - }, - "class": "autoDetectRenderer" - }, - { - "file": "src/pixi/textures/VideoTexture.js", - "line": 126, - "description": "Mimic PIXI Texture.from... method.", - "params": [ - { - "name": "video", - "description": "" - }, - { - "name": "scaleMode", - "description": "" - } - ], - "return": { - "description": "", - "type": "PIXI.Texture" - }, - "class": "autoDetectRenderer" - }, - { - "file": "src/pixi/utils/Detector.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "autoDetectRenderer" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 1, - "author": "Chad Engler https://github.com/englercj @Rolnaaba", - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 6, - "description": "Originally based on https://github.com/mrdoob/eventtarget.js/ from mr Doob.\nCurrently takes inspiration from the nodejs EventEmitter, EventEmitter3, and smokesignals", - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 24, - "description": "Backward compat from when this used to be a function", - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 34, - "description": "Mixes in the properties of the EventTarget prototype onto another object", - "itemtype": "method", - "name": "mixin", - "params": [ - { - "name": "object", - "description": "The obj to mix into", - "type": "Object" - } - ], - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 41, - "description": "Return a list of assigned event listeners.", - "itemtype": "method", - "name": "listeners", - "params": [ - { - "name": "eventName", - "description": "The events that should be listed.", - "type": "String" - } - ], - "return": { - "description": "An array of listener functions", - "type": "Array" - }, - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 54, - "description": "Emit an event to all registered event listeners.", - "itemtype": "method", - "name": "emit", - "alias": "dispatchEvent", - "params": [ - { - "name": "eventName", - "description": "The name of the event.", - "type": "String" - } - ], - "return": { - "description": "Indication if we've emitted an event.", - "type": "Boolean" - }, - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 107, - "description": "Register a new EventListener for the given event.", - "itemtype": "method", - "name": "on", - "alias": "addEventListener", - "params": [ - { - "name": "eventName", - "description": "Name of the event.", - "type": "String" - }, - { - "name": "callback", - "description": "fn Callback function.", - "type": "Functon" - } - ], - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 124, - "description": "Add an EventListener that's only called once.", - "itemtype": "method", - "name": "once", - "params": [ - { - "name": "eventName", - "description": "Name of the event.", - "type": "String" - }, - { - "name": "callback", - "description": "Callback function.", - "type": "Function" - } - ], - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 143, - "description": "Remove event listeners.", - "itemtype": "method", - "name": "off", - "alias": "removeEventListener", - "params": [ - { - "name": "eventName", - "description": "The event we want to remove.", - "type": "String" - }, - { - "name": "callback", - "description": "The listener that we need to find.", - "type": "Function" - } - ], - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 173, - "description": "Remove all listeners or only the listeners for the specified event.", - "itemtype": "method", - "name": "removeAllListeners", - "params": [ - { - "name": "eventName", - "description": "The event you want to remove all listeners for.", - "type": "String" - } - ], - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 206, - "description": "Tracks the state of bubbling propagation. Do not\nset this directly, instead use `event.stopPropagation()`", - "itemtype": "property", - "name": "stopped", - "type": "Boolean", - "access": "private", - "tagname": "", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 217, - "description": "Tracks the state of sibling listener propagation. Do not\nset this directly, instead use `event.stopImmediatePropagation()`", - "itemtype": "property", - "name": "stoppedImmediate", - "type": "Boolean", - "access": "private", - "tagname": "", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 228, - "description": "The original target the event triggered on.", - "itemtype": "property", - "name": "target", - "type": "Object", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 237, - "description": "The string name of the event that this represents.", - "itemtype": "property", - "name": "type", - "type": "String", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 246, - "description": "The data that was passed in with this event.", - "itemtype": "property", - "name": "data", - "type": "Object", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 258, - "description": "The timestamp when the event occurred.", - "itemtype": "property", - "name": "timeStamp", - "type": "Number", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 268, - "description": "Stops the propagation of events up the scene graph (prevents bubbling).", - "itemtype": "method", - "name": "stopPropagation", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 277, - "description": "Stops the propagation of events to sibling listeners (no longer calls any listeners).", - "itemtype": "method", - "name": "stopImmediatePropagation", - "class": "Event" - }, - { - "file": "src/pixi/utils/Polyk.js", - "line": 42, - "description": "Triangulates shapes for webGL graphic fills.", - "itemtype": "method", - "name": "Triangulate", - "class": "PolyK" - }, - { - "file": "src/pixi/utils/Polyk.js", - "line": 120, - "description": "Checks whether a point is within a triangle", - "itemtype": "method", - "name": "_PointInTriangle", - "params": [ - { - "name": "px", - "description": "x coordinate of the point to test", - "type": "Number" - }, - { - "name": "py", - "description": "y coordinate of the point to test", - "type": "Number" - }, - { - "name": "ax", - "description": "x coordinate of the a point of the triangle", - "type": "Number" - }, - { - "name": "ay", - "description": "y coordinate of the a point of the triangle", - "type": "Number" - }, - { - "name": "bx", - "description": "x coordinate of the b point of the triangle", - "type": "Number" - }, - { - "name": "by", - "description": "y coordinate of the b point of the triangle", - "type": "Number" - }, - { - "name": "cx", - "description": "x coordinate of the c point of the triangle", - "type": "Number" - }, - { - "name": "cy", - "description": "y coordinate of the c point of the triangle", - "type": "Number" - } - ], - "access": "private", - "tagname": "", - "return": { - "description": "", - "type": "Boolean" - }, - "class": "PolyK" - }, - { - "file": "src/pixi/utils/Polyk.js", - "line": 158, - "description": "Checks whether a shape is convex", - "itemtype": "method", - "name": "_convex", - "access": "private", - "tagname": "", - "return": { - "description": "", - "type": "Boolean" - }, - "class": "PolyK" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 12, - "description": "A polyfill for requestAnimationFrame\nYou can actually use both requestAnimationFrame and requestAnimFrame, \nyou will still benefit from the polyfill", - "itemtype": "method", - "name": "requestAnimationFrame", - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 20, - "description": "A polyfill for cancelAnimationFrame", - "itemtype": "method", - "name": "cancelAnimationFrame", - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 54, - "description": "Converts a hex color number to an [R, G, B] array", - "itemtype": "method", - "name": "hex2rgb", - "params": [ - { - "name": "hex", - "description": "", - "type": "Number" - } - ], - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 64, - "description": "Converts a color as an [R, G, B] array to a hex number", - "itemtype": "method", - "name": "rgb2hex", - "params": [ - { - "name": "rgb", - "description": "", - "type": "Array" - } - ], - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 74, - "description": "A polyfill for Function.prototype.bind", - "itemtype": "method", - "name": "bind", - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 168, - "description": "Checks whether the Canvas BlendModes are supported by the current browser", - "itemtype": "method", - "name": "canUseNewCanvasBlendModes", - "return": { - "description": "whether they are supported", - "type": "Boolean" - }, - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 189, - "description": "Given a number, this function returns the closest number that is a power of two\nthis function is taken from Starling Framework as its pretty neat ;)", - "itemtype": "method", - "name": "getNextPowerOfTwo", - "params": [ - { - "name": "number", - "description": "", - "type": "Number" - } - ], - "return": { - "description": "the closest number that is a power of two", - "type": "Number" - }, - "class": "AjaxRequest" - }, - { - "file": "src/pixi/InteractionData.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "InteractionData" - }, - { - "file": "src/pixi/InteractionData.js", - "line": 13, - "description": "This point stores the global coords of where the touch/mouse event happened", - "itemtype": "property", - "name": "global", - "type": "Point", - "class": "InteractionData" - }, - { - "file": "src/pixi/InteractionData.js", - "line": 21, - "description": "The target Sprite that was interacted with", - "itemtype": "property", - "name": "target", - "type": "Sprite", - "class": "InteractionData" - }, - { - "file": "src/pixi/InteractionData.js", - "line": 29, - "description": "When passed to an event handler, this will be the original DOM Event that was captured", - "itemtype": "property", - "name": "originalEvent", - "type": "Event", - "class": "InteractionData" - }, - { - "file": "src/pixi/InteractionData.js", - "line": 38, - "description": "This will return the local coordinates of the specified displayObject for this InteractionData", - "itemtype": "method", - "name": "getLocalPosition", - "params": [ - { - "name": "displayObject", - "description": "The DisplayObject that you would like the local coords off", - "type": "DisplayObject" - }, - { - "name": "point", - "description": "A Point object in which to store the value, optional (otherwise will create a new point)", - "type": "Point", - "optional": true - } - ], - "return": { - "description": "A point containing the coordinates of the InteractionData position relative to the DisplayObject", - "type": "Point" - }, - "class": "InteractionData" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 16, - "description": "A reference to the stage", - "itemtype": "property", - "name": "stage", - "type": "Stage", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 24, - "description": "The mouse data", - "itemtype": "property", - "name": "mouse", - "type": "InteractionData", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 32, - "description": "An object that stores current touches (InteractionData) by id reference", - "itemtype": "property", - "name": "touches", - "type": "Object", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 40, - "itemtype": "property", - "name": "tempPoint", - "type": "Point", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 47, - "itemtype": "property", - "name": "mouseoverEnabled", - "type": "Boolean", - "default": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 54, - "description": "Tiny little interactiveData pool !", - "itemtype": "property", - "name": "pool", - "type": "Array", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 62, - "description": "An array containing all the iterative items from the our interactive tree", - "itemtype": "property", - "name": "interactiveItems", - "type": "Array", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 70, - "description": "Our canvas", - "itemtype": "property", - "name": "interactionDOMElement", - "type": "HTMLCanvasElement", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 80, - "itemtype": "property", - "name": "onMouseMove", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 86, - "itemtype": "property", - "name": "onMouseDown", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 92, - "itemtype": "property", - "name": "onMouseOut", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 98, - "itemtype": "property", - "name": "onMouseUp", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 104, - "itemtype": "property", - "name": "onTouchStart", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 110, - "itemtype": "property", - "name": "onTouchEnd", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 116, - "itemtype": "property", - "name": "onTouchMove", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 122, - "itemtype": "property", - "name": "last", - "type": "Number", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 128, - "description": "The css style of the cursor that is being used", - "itemtype": "property", - "name": "currentCursorStyle", - "type": "String", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 135, - "description": "Is set to true when the mouse is moved out of the canvas", - "itemtype": "property", - "name": "mouseOut", - "type": "Boolean", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 142, - "itemtype": "property", - "name": "resolution", - "type": "Number", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 152, - "description": "Collects an interactive sprite recursively to have their interactions managed", - "itemtype": "method", - "name": "collectInteractiveSprite", - "params": [ - { - "name": "displayObject", - "description": "the displayObject to collect", - "type": "DisplayObject" - }, - { - "name": "iParent", - "description": "the display object's parent", - "type": "DisplayObject" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 193, - "description": "Sets the target for event delegation", - "itemtype": "method", - "name": "setTarget", - "params": [ - { - "name": "target", - "description": "the renderer to bind events to", - "type": "WebGLRenderer|CanvasRenderer" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 211, - "description": "Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM\nelements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element\nto receive those events", - "itemtype": "method", - "name": "setTargetDomElement", - "params": [ - { - "name": "domElement", - "description": "the DOM element which will receive mouse and touch events", - "type": "DOMElement" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 245, - "itemtype": "method", - "name": "removeEvents", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 270, - "description": "updates the state of interactive objects", - "itemtype": "method", - "name": "update", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 355, - "itemtype": "method", - "name": "rebuildInteractiveGraph", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 380, - "description": "Is called when the mouse moves across the renderer element", - "itemtype": "method", - "name": "onMouseMove", - "params": [ - { - "name": "event", - "description": "The DOM event of the mouse moving", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 416, - "description": "Is called when the mouse button is pressed down on the renderer element", - "itemtype": "method", - "name": "onMouseDown", - "params": [ - { - "name": "event", - "description": "The DOM event of a mouse button being pressed down", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 477, - "description": "Is called when the mouse is moved out of the renderer element", - "itemtype": "method", - "name": "onMouseOut", - "params": [ - { - "name": "event", - "description": "The DOM event of a mouse being moved out", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 518, - "description": "Is called when the mouse button is released on the renderer element", - "itemtype": "method", - "name": "onMouseUp", - "params": [ - { - "name": "event", - "description": "The DOM event of a mouse button being released", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 586, - "description": "Tests if the current mouse coordinates hit a sprite", - "itemtype": "method", - "name": "hitTest", - "params": [ - { - "name": "item", - "description": "The displayObject to test for a hit", - "type": "DisplayObject" - }, - { - "name": "interactionData", - "description": "The interactionData object to update in the case there is a hit", - "type": "InteractionData" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 683, - "description": "Is called when a touch is moved across the renderer element", - "itemtype": "method", - "name": "onTouchMove", - "params": [ - { - "name": "event", - "description": "The DOM event of a touch moving across the renderer view", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 729, - "description": "Is called when a touch is started on the renderer element", - "itemtype": "method", - "name": "onTouchStart", - "params": [ - { - "name": "event", - "description": "The DOM event of a touch starting on the renderer view", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 798, - "description": "Is called when a touch is ended on the renderer element", - "itemtype": "method", - "name": "onTouchEnd", - "params": [ - { - "name": "event", - "description": "The DOM event of a touch ending on the renderer view", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/Intro.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "" - }, - { - "file": "src/pixi/Outro.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "" - }, - { - "file": "src/pixi/Pixi.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "" - } - ], - "warnings": [ - { - "message": "unknown tag: copyright", - "line": " src/pixi/extras/Rope.js:1" - }, - { - "message": "replacing incorrect tag: returns with return", - "line": " src/pixi/textures/VideoTexture.js:87" - }, - { - "message": "replacing incorrect tag: returns with return", - "line": " src/pixi/textures/VideoTexture.js:126" - }, - { - "message": "replacing incorrect tag: returns with return", - "line": " src/pixi/utils/EventTarget.js:41" - }, - { - "message": "unknown tag: alias", - "line": " src/pixi/utils/EventTarget.js:54" - }, - { - "message": "replacing incorrect tag: returns with return", - "line": " src/pixi/utils/EventTarget.js:54" - }, - { - "message": "unknown tag: alias", - "line": " src/pixi/utils/EventTarget.js:107" - }, - { - "message": "unknown tag: alias", - "line": " src/pixi/utils/EventTarget.js:143" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/DisplayObject.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/DisplayObjectContainer.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/MovieClip.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/Sprite.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/SpriteBatch.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/Stage.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Rope.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:1" - }, - { - "message": "Missing item type\ncx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of", - "line": " src/pixi/extras/Spine.js:213" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:506" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:513" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:520" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:528" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:535" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:542" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:577" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:585" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:600" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:604" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:611" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:618" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:625" - }, - { - "message": "Missing item type\nfrom the new skin are attached if the corresponding attachment from the old skin was attached.", - "line": " src/pixi/extras/Spine.js:637" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:644" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:648" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:657" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:849" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:855" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:861" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:867" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:885" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:1310" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Strip.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/TilingSprite.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/AbstractFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/AlphaMaskFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/AsciiFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/BlurFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/BlurXFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/BlurYFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/ColorMatrixFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/ColorStepFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/CrossHatchFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/DisplacementFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/DotScreenFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/FilterBlock.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/GrayFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/InvertFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/NoiseFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/NormalMapFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/PixelateFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/RGBSplitFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/SepiaFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/SmartBlurFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/TiltShiftFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/TiltShiftXFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/TiltShiftYFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/TwistFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Circle.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Ellipse.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Matrix.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Point.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Polygon.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Rectangle.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/RoundedRectangle.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/AssetLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/AtlasLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/BitmapFontLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/ImageLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/JsonLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/SpineLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/SpriteSheetLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/primitives/Graphics.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/canvas/utils/CanvasBuffer.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/canvas/utils/CanvasMaskManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/canvas/utils/CanvasTinter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/canvas/CanvasGraphics.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/canvas/CanvasRenderer.js:1" - }, - { - "message": "Missing item type\nIf true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation.\nHandy for crisp pixel art and speed on legacy devices.", - "line": " src/pixi/renderers/canvas/CanvasRenderer.js:157" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/shaders/PixiFastShader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/shaders/PixiShader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/shaders/PrimitiveShader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/shaders/StripShader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/FilterTexture.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLFilterManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLGraphics.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLMaskManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLShaderManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLStencilManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/WebGLRenderer.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/text/BitmapText.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/text/Text.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/textures/BaseTexture.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/textures/RenderTexture.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/textures/Texture.js:1" - }, - { - "message": "Missing item type\nMimic Pixi BaseTexture.from.... method.", - "line": " src/pixi/textures/VideoTexture.js:87" - }, - { - "message": "Missing item type\nMimic PIXI Texture.from... method.", - "line": " src/pixi/textures/VideoTexture.js:126" - }, - { - "message": "Missing item type", - "line": " src/pixi/utils/Detector.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/utils/EventTarget.js:1" - }, - { - "message": "Missing item type\nOriginally based on https://github.com/mrdoob/eventtarget.js/ from mr Doob.\nCurrently takes inspiration from the nodejs EventEmitter, EventEmitter3, and smokesignals", - "line": " src/pixi/utils/EventTarget.js:6" - }, - { - "message": "Missing item type\nBackward compat from when this used to be a function", - "line": " src/pixi/utils/EventTarget.js:24" - }, - { - "message": "Missing item type", - "line": " src/pixi/utils/Utils.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/InteractionData.js:1" - }, - { - "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/Outro.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/Pixi.js:1" - } - ] -} \ No newline at end of file diff --git a/tutorial-3/pixi.js-master/docs/files/index.html b/tutorial-3/pixi.js-master/docs/files/index.html deleted file mode 100755 index 487fe15..0000000 --- a/tutorial-3/pixi.js-master/docs/files/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Redirector - - - - Click here to redirect - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_InteractionData.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_InteractionData.js.html deleted file mode 100755 index f913d34..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_InteractionData.js.html +++ /dev/null @@ -1,344 +0,0 @@ - - - - - src/pixi/InteractionData.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/InteractionData.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * Holds all information related to an Interaction event
    - *
    - * @class InteractionData
    - * @constructor
    - */
    -PIXI.InteractionData = function()
    -{
    -    /**
    -     * This point stores the global coords of where the touch/mouse event happened
    -     *
    -     * @property global
    -     * @type Point
    -     */
    -    this.global = new PIXI.Point();
    -
    -    /**
    -     * The target Sprite that was interacted with
    -     *
    -     * @property target
    -     * @type Sprite
    -     */
    -    this.target = null;
    -
    -    /**
    -     * When passed to an event handler, this will be the original DOM Event that was captured
    -     *
    -     * @property originalEvent
    -     * @type Event
    -     */
    -    this.originalEvent = null;
    -};
    -
    -/**
    - * This will return the local coordinates of the specified displayObject for this InteractionData
    - *
    - * @method getLocalPosition
    - * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off
    - * @param [point] {Point} A Point object in which to store the value, optional (otherwise will create a new point)
    - * @return {Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject
    - */
    -PIXI.InteractionData.prototype.getLocalPosition = function(displayObject, point)
    -{
    -    var worldTransform = displayObject.worldTransform;
    -    var global = this.global;
    -
    -    // do a cheeky transform to get the mouse coords;
    -    var a00 = worldTransform.a, a01 = worldTransform.c, a02 = worldTransform.tx,
    -        a10 = worldTransform.b, a11 = worldTransform.d, a12 = worldTransform.ty,
    -        id = 1 / (a00 * a11 + a01 * -a10);
    -
    -    point = point || new PIXI.Point();
    -
    -    point.x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id;
    -    point.y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id;
    -
    -    // set the mouse coords...
    -    return point;
    -};
    -
    -// constructor
    -PIXI.InteractionData.prototype.constructor = PIXI.InteractionData;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_InteractionManager.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_InteractionManager.js.html deleted file mode 100755 index 824229b..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_InteractionManager.js.html +++ /dev/null @@ -1,1156 +0,0 @@ - - - - - src/pixi/InteractionManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/InteractionManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    - /**
    - * The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive
    - * if its interactive parameter is set to true
    - * This manager also supports multitouch.
    - *
    - * @class InteractionManager
    - * @constructor
    - * @param stage {Stage} The stage to handle interactions
    - */
    -PIXI.InteractionManager = function(stage)
    -{
    -    /**
    -     * A reference to the stage
    -     *
    -     * @property stage
    -     * @type Stage
    -     */
    -    this.stage = stage;
    -
    -    /**
    -     * The mouse data
    -     *
    -     * @property mouse
    -     * @type InteractionData
    -     */
    -    this.mouse = new PIXI.InteractionData();
    -
    -    /**
    -     * An object that stores current touches (InteractionData) by id reference
    -     *
    -     * @property touches
    -     * @type Object
    -     */
    -    this.touches = {};
    -
    -    /**
    -     * @property tempPoint
    -     * @type Point
    -     * @private
    -     */
    -    this.tempPoint = new PIXI.Point();
    -
    -    /**
    -     * @property mouseoverEnabled
    -     * @type Boolean
    -     * @default
    -     */
    -    this.mouseoverEnabled = true;
    -
    -    /**
    -     * Tiny little interactiveData pool !
    -     *
    -     * @property pool
    -     * @type Array
    -     */
    -    this.pool = [];
    -
    -    /**
    -     * An array containing all the iterative items from the our interactive tree
    -     * @property interactiveItems
    -     * @type Array
    -     * @private
    -     */
    -    this.interactiveItems = [];
    -
    -    /**
    -     * Our canvas
    -     * @property interactionDOMElement
    -     * @type HTMLCanvasElement
    -     * @private
    -     */
    -    this.interactionDOMElement = null;
    -
    -    //this will make it so that you don't have to call bind all the time
    -
    -    /**
    -     * @property onMouseMove
    -     * @type Function
    -     */
    -    this.onMouseMove = this.onMouseMove.bind( this );
    -
    -    /**
    -     * @property onMouseDown
    -     * @type Function
    -     */
    -    this.onMouseDown = this.onMouseDown.bind(this);
    -
    -    /**
    -     * @property onMouseOut
    -     * @type Function
    -     */
    -    this.onMouseOut = this.onMouseOut.bind(this);
    -
    -    /**
    -     * @property onMouseUp
    -     * @type Function
    -     */
    -    this.onMouseUp = this.onMouseUp.bind(this);
    -
    -    /**
    -     * @property onTouchStart
    -     * @type Function
    -     */
    -    this.onTouchStart = this.onTouchStart.bind(this);
    -
    -    /**
    -     * @property onTouchEnd
    -     * @type Function
    -     */
    -    this.onTouchEnd = this.onTouchEnd.bind(this);
    -
    -    /**
    -     * @property onTouchMove
    -     * @type Function
    -     */
    -    this.onTouchMove = this.onTouchMove.bind(this);
    -
    -    /**
    -     * @property last
    -     * @type Number
    -     */
    -    this.last = 0;
    -
    -    /**
    -     * The css style of the cursor that is being used
    -     * @property currentCursorStyle
    -     * @type String
    -     */
    -    this.currentCursorStyle = 'inherit';
    -
    -    /**
    -     * Is set to true when the mouse is moved out of the canvas
    -     * @property mouseOut
    -     * @type Boolean
    -     */
    -    this.mouseOut = false;
    -
    -    /**
    -     * @property resolution
    -     * @type Number
    -     */
    -    this.resolution = 1;
    -};
    -
    -// constructor
    -PIXI.InteractionManager.prototype.constructor = PIXI.InteractionManager;
    -
    -/**
    - * Collects an interactive sprite recursively to have their interactions managed
    - *
    - * @method collectInteractiveSprite
    - * @param displayObject {DisplayObject} the displayObject to collect
    - * @param iParent {DisplayObject} the display object's parent
    - * @private
    - */
    -PIXI.InteractionManager.prototype.collectInteractiveSprite = function(displayObject, iParent)
    -{
    -    var children = displayObject.children;
    -    var length = children.length;
    -
    -    // make an interaction tree... {item.__interactiveParent}
    -    for (var i = length - 1; i >= 0; i--)
    -    {
    -        var child = children[i];
    -
    -        // push all interactive bits
    -        if (child._interactive)
    -        {
    -            iParent.interactiveChildren = true;
    -            //child.__iParent = iParent;
    -            this.interactiveItems.push(child);
    -
    -            if (child.children.length > 0) {
    -                this.collectInteractiveSprite(child, child);
    -            }
    -        }
    -        else
    -        {
    -            child.__iParent = null;
    -            if (child.children.length > 0)
    -            {
    -                this.collectInteractiveSprite(child, iParent);
    -            }
    -        }
    -
    -    }
    -};
    -
    -/**
    - * Sets the target for event delegation
    - *
    - * @method setTarget
    - * @param target {WebGLRenderer|CanvasRenderer} the renderer to bind events to
    - * @private
    - */
    -PIXI.InteractionManager.prototype.setTarget = function(target)
    -{
    -    this.target = target;
    -    this.resolution = target.resolution;
    -
    -    // Check if the dom element has been set. If it has don't do anything.
    -    if (this.interactionDOMElement !== null) return;
    -
    -    this.setTargetDomElement (target.view);
    -};
    -
    -/**
    - * Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM
    - * elements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element
    - * to receive those events
    - *
    - * @method setTargetDomElement
    - * @param domElement {DOMElement} the DOM element which will receive mouse and touch events
    - * @private
    - */
    -PIXI.InteractionManager.prototype.setTargetDomElement = function(domElement)
    -{
    -    this.removeEvents();
    -
    -    if (window.navigator.msPointerEnabled)
    -    {
    -        // time to remove some of that zoom in ja..
    -        domElement.style['-ms-content-zooming'] = 'none';
    -        domElement.style['-ms-touch-action'] = 'none';
    -    }
    -
    -    this.interactionDOMElement = domElement;
    -
    -    domElement.addEventListener('mousemove',  this.onMouseMove, true);
    -    domElement.addEventListener('mousedown',  this.onMouseDown, true);
    -    domElement.addEventListener('mouseout',   this.onMouseOut, true);
    -
    -    // aint no multi touch just yet!
    -    domElement.addEventListener('touchstart', this.onTouchStart, true);
    -    domElement.addEventListener('touchend', this.onTouchEnd, true);
    -    domElement.addEventListener('touchmove', this.onTouchMove, true);
    -
    -    window.addEventListener('mouseup',  this.onMouseUp, true);
    -};
    -
    -/**
    - * @method removeEvents
    - * @private
    - */
    -PIXI.InteractionManager.prototype.removeEvents = function()
    -{
    -    if (!this.interactionDOMElement) return;
    -
    -    this.interactionDOMElement.style['-ms-content-zooming'] = '';
    -    this.interactionDOMElement.style['-ms-touch-action'] = '';
    -
    -    this.interactionDOMElement.removeEventListener('mousemove',  this.onMouseMove, true);
    -    this.interactionDOMElement.removeEventListener('mousedown',  this.onMouseDown, true);
    -    this.interactionDOMElement.removeEventListener('mouseout',   this.onMouseOut, true);
    -
    -    // aint no multi touch just yet!
    -    this.interactionDOMElement.removeEventListener('touchstart', this.onTouchStart, true);
    -    this.interactionDOMElement.removeEventListener('touchend', this.onTouchEnd, true);
    -    this.interactionDOMElement.removeEventListener('touchmove', this.onTouchMove, true);
    -
    -    this.interactionDOMElement = null;
    -
    -    window.removeEventListener('mouseup',  this.onMouseUp, true);
    -};
    -
    -/**
    - * updates the state of interactive objects
    - *
    - * @method update
    - * @private
    - */
    -PIXI.InteractionManager.prototype.update = function()
    -{
    -    if (!this.target) return;
    -
    -    // frequency of 30fps??
    -    var now = Date.now();
    -    var diff = now - this.last;
    -    diff = (diff * PIXI.INTERACTION_FREQUENCY ) / 1000;
    -    if (diff < 1) return;
    -    this.last = now;
    -
    -    var i = 0;
    -
    -    // ok.. so mouse events??
    -    // yes for now :)
    -    // OPTIMISE - how often to check??
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    // loop through interactive objects!
    -    var length = this.interactiveItems.length;
    -    var cursor = 'inherit';
    -    var over = false;
    -
    -    for (i = 0; i < length; i++)
    -    {
    -        var item = this.interactiveItems[i];
    -
    -        // OPTIMISATION - only calculate every time if the mousemove function exists..
    -        // OK so.. does the object have any other interactive functions?
    -        // hit-test the clip!
    -       // if (item.mouseover || item.mouseout || item.buttonMode)
    -       // {
    -        // ok so there are some functions so lets hit test it..
    -        item.__hit = this.hitTest(item, this.mouse);
    -        this.mouse.target = item;
    -        // ok so deal with interactions..
    -        // looks like there was a hit!
    -        if (item.__hit && !over)
    -        {
    -            if (item.buttonMode) cursor = item.defaultCursor;
    -
    -            if (!item.interactiveChildren)
    -            {
    -                over = true;
    -            }
    -
    -            if (!item.__isOver)
    -            {
    -                if (item.mouseover)
    -                {
    -                    item.mouseover (this.mouse);
    -                }
    -                item.__isOver = true;
    -            }
    -        }
    -        else
    -        {
    -            if (item.__isOver)
    -            {
    -                // roll out!
    -                if (item.mouseout)
    -                {
    -                    item.mouseout (this.mouse);
    -                }
    -                item.__isOver = false;
    -            }
    -        }
    -    }
    -
    -    if (this.currentCursorStyle !== cursor)
    -    {
    -        this.currentCursorStyle = cursor;
    -        this.interactionDOMElement.style.cursor = cursor;
    -    }
    -};
    -
    -/**
    - * @method rebuildInteractiveGraph
    - * @private
    - */
    -PIXI.InteractionManager.prototype.rebuildInteractiveGraph = function()
    -{
    -    this.dirty = false;
    -
    -    var len = this.interactiveItems.length;
    -
    -    for (var i = 0; i < len; i++) {
    -        this.interactiveItems[i].interactiveChildren = false;
    -    }
    -
    -    this.interactiveItems = [];
    -
    -    if (this.stage.interactive)
    -    {
    -        this.interactiveItems.push(this.stage);
    -    }
    -
    -    // Go through and collect all the objects that are interactive..
    -    this.collectInteractiveSprite(this.stage, this.stage);
    -};
    -
    -/**
    - * Is called when the mouse moves across the renderer element
    - *
    - * @method onMouseMove
    - * @param event {Event} The DOM event of the mouse moving
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onMouseMove = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    this.mouse.originalEvent = event;
    -
    -    // TODO optimize by not check EVERY TIME! maybe half as often? //
    -    var rect = this.interactionDOMElement.getBoundingClientRect();
    -
    -    this.mouse.global.x = (event.clientX - rect.left) * (this.target.width / rect.width) / this.resolution;
    -    this.mouse.global.y = (event.clientY - rect.top) * ( this.target.height / rect.height) / this.resolution;
    -
    -    var length = this.interactiveItems.length;
    -
    -    for (var i = 0; i < length; i++)
    -    {
    -        var item = this.interactiveItems[i];
    -
    -        // Call the function!
    -        if (item.mousemove)
    -        {
    -            item.mousemove(this.mouse);
    -        }
    -    }
    -};
    -
    -/**
    - * Is called when the mouse button is pressed down on the renderer element
    - *
    - * @method onMouseDown
    - * @param event {Event} The DOM event of a mouse button being pressed down
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onMouseDown = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    this.mouse.originalEvent = event;
    -
    -    if (PIXI.AUTO_PREVENT_DEFAULT)
    -    {
    -        this.mouse.originalEvent.preventDefault();
    -    }
    -
    -    // loop through interaction tree...
    -    // hit test each item! ->
    -    // get interactive items under point??
    -    //stage.__i
    -    var length = this.interactiveItems.length;
    -
    -    var e = this.mouse.originalEvent;
    -    var isRightButton = e.button === 2 || e.which === 3;
    -    var downFunction = isRightButton ? 'rightdown' : 'mousedown';
    -    var clickFunction = isRightButton ? 'rightclick' : 'click';
    -    var buttonIsDown = isRightButton ? '__rightIsDown' : '__mouseIsDown';
    -    var isDown = isRightButton ? '__isRightDown' : '__isDown';
    -
    -    // while
    -    // hit test
    -    for (var i = 0; i < length; i++)
    -    {
    -        var item = this.interactiveItems[i];
    -
    -        if (item[downFunction] || item[clickFunction])
    -        {
    -            item[buttonIsDown] = true;
    -            item.__hit = this.hitTest(item, this.mouse);
    -
    -            if (item.__hit)
    -            {
    -                //call the function!
    -                if (item[downFunction])
    -                {
    -                    item[downFunction](this.mouse);
    -                }
    -                item[isDown] = true;
    -
    -                // just the one!
    -                if (!item.interactiveChildren) break;
    -            }
    -        }
    -    }
    -};
    -
    -/**
    - * Is called when the mouse is moved out of the renderer element
    - *
    - * @method onMouseOut
    - * @param event {Event} The DOM event of a mouse being moved out
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onMouseOut = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    this.mouse.originalEvent = event;
    -
    -    var length = this.interactiveItems.length;
    -
    -    this.interactionDOMElement.style.cursor = 'inherit';
    -
    -    for (var i = 0; i < length; i++)
    -    {
    -        var item = this.interactiveItems[i];
    -        if (item.__isOver)
    -        {
    -            this.mouse.target = item;
    -            if (item.mouseout)
    -            {
    -                item.mouseout(this.mouse);
    -            }
    -            item.__isOver = false;
    -        }
    -    }
    -
    -    this.mouseOut = true;
    -
    -    // move the mouse to an impossible position
    -    this.mouse.global.x = -10000;
    -    this.mouse.global.y = -10000;
    -};
    -
    -/**
    - * Is called when the mouse button is released on the renderer element
    - *
    - * @method onMouseUp
    - * @param event {Event} The DOM event of a mouse button being released
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onMouseUp = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    this.mouse.originalEvent = event;
    -
    -    var length = this.interactiveItems.length;
    -    var up = false;
    -
    -    var e = this.mouse.originalEvent;
    -    var isRightButton = e.button === 2 || e.which === 3;
    -
    -    var upFunction = isRightButton ? 'rightup' : 'mouseup';
    -    var clickFunction = isRightButton ? 'rightclick' : 'click';
    -    var upOutsideFunction = isRightButton ? 'rightupoutside' : 'mouseupoutside';
    -    var isDown = isRightButton ? '__isRightDown' : '__isDown';
    -
    -    for (var i = 0; i < length; i++)
    -    {
    -        var item = this.interactiveItems[i];
    -
    -        if (item[clickFunction] || item[upFunction] || item[upOutsideFunction])
    -        {
    -            item.__hit = this.hitTest(item, this.mouse);
    -
    -            if (item.__hit && !up)
    -            {
    -                //call the function!
    -                if (item[upFunction])
    -                {
    -                    item[upFunction](this.mouse);
    -                }
    -                if (item[isDown])
    -                {
    -                    if (item[clickFunction])
    -                    {
    -                        item[clickFunction](this.mouse);
    -                    }
    -                }
    -
    -                if (!item.interactiveChildren)
    -                {
    -                    up = true;
    -                }
    -            }
    -            else
    -            {
    -                if (item[isDown])
    -                {
    -                    if (item[upOutsideFunction]) item[upOutsideFunction](this.mouse);
    -                }
    -            }
    -
    -            item[isDown] = false;
    -        }
    -    }
    -};
    -
    -/**
    - * Tests if the current mouse coordinates hit a sprite
    - *
    - * @method hitTest
    - * @param item {DisplayObject} The displayObject to test for a hit
    - * @param interactionData {InteractionData} The interactionData object to update in the case there is a hit
    - * @private
    - */
    -PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
    -{
    -    var global = interactionData.global;
    -
    -    if (!item.worldVisible)
    -    {
    -        return false;
    -    }
    -
    -    // temp fix for if the element is in a non visible
    -
    -    var worldTransform = item.worldTransform, i,
    -        a = worldTransform.a, b = worldTransform.b,
    -        c = worldTransform.c, tx = worldTransform.tx,
    -        d = worldTransform.d, ty = worldTransform.ty,
    -     
    -        id = 1 / (a * d + c * -b),
    -        x = d * id * global.x + -c * id * global.y + (ty * c - tx * d) * id,
    -        y = a * id * global.y + -b * id * global.x + (-ty * a + tx * b) * id;
    -
    -
    -    interactionData.target = item;
    -
    -    //a sprite or display object with a hit area defined
    -    if (item.hitArea && item.hitArea.contains)
    -    {
    -        if (item.hitArea.contains(x, y))
    -        {
    -            interactionData.target = item;
    -            return true;
    -        }
    -        return false;
    -    }
    -    // a sprite with no hitarea defined
    -    else if(item instanceof PIXI.Sprite)
    -    {
    -        var width = item.texture.frame.width;
    -        var height = item.texture.frame.height;
    -        var x1 = -width * item.anchor.x;
    -        var y1;
    -
    -        if (x > x1 && x < x1 + width)
    -        {
    -            y1 = -height * item.anchor.y;
    -
    -            if (y > y1 && y < y1 + height)
    -            {
    -                // set the target property if a hit is true!
    -                interactionData.target = item;
    -                return true;
    -            }
    -        }
    -    }
    -    else if(item instanceof PIXI.Graphics)
    -    {
    -        var graphicsData = item.graphicsData;
    -        for (i = 0; i < graphicsData.length; i++)
    -        {
    -            var data = graphicsData[i];
    -            if(!data.fill)continue;
    -
    -            // only deal with fills..
    -            if(data.shape)
    -            {
    -                if(data.shape.contains(x, y))
    -                {
    -                    interactionData.target = item;
    -                    return true;
    -                }
    -            }
    -        }
    -    }
    -
    -    var length = item.children.length;
    -
    -    for (i = 0; i < length; i++)
    -    {
    -        var tempItem = item.children[i];
    -        var hit = this.hitTest(tempItem, interactionData);
    -        if (hit)
    -        {
    -            // hmm.. TODO SET CORRECT TARGET?
    -            interactionData.target = item;
    -            return true;
    -        }
    -    }
    -    return false;
    -};
    -
    -/**
    - * Is called when a touch is moved across the renderer element
    - *
    - * @method onTouchMove
    - * @param event {Event} The DOM event of a touch moving across the renderer view
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onTouchMove = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    var rect = this.interactionDOMElement.getBoundingClientRect();
    -    var changedTouches = event.changedTouches;
    -    var touchData;
    -    var i = 0;
    -
    -    for (i = 0; i < changedTouches.length; i++)
    -    {
    -        var touchEvent = changedTouches[i];
    -        touchData = this.touches[touchEvent.identifier];
    -        touchData.originalEvent = event;
    -
    -        // update the touch position
    -        touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution;
    -        touchData.global.y = ( (touchEvent.clientY - rect.top)  * (this.target.height / rect.height) )  / this.resolution;
    -        if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height)
    -        {
    -            //Support for CocoonJS fullscreen scale modes
    -            touchData.global.x = touchEvent.clientX;
    -            touchData.global.y = touchEvent.clientY;
    -        }
    -
    -        for (var j = 0; j < this.interactiveItems.length; j++)
    -        {
    -            var item = this.interactiveItems[j];
    -            if (item.touchmove && item.__touchData && item.__touchData[touchEvent.identifier])
    -            {
    -                item.touchmove(touchData);
    -            }
    -        }
    -    }
    -};
    -
    -/**
    - * Is called when a touch is started on the renderer element
    - *
    - * @method onTouchStart
    - * @param event {Event} The DOM event of a touch starting on the renderer view
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onTouchStart = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    var rect = this.interactionDOMElement.getBoundingClientRect();
    -
    -    if (PIXI.AUTO_PREVENT_DEFAULT)
    -    {
    -        event.preventDefault();
    -    }
    -
    -    var changedTouches = event.changedTouches;
    -    for (var i=0; i < changedTouches.length; i++)
    -    {
    -        var touchEvent = changedTouches[i];
    -
    -        var touchData = this.pool.pop();
    -        if (!touchData)
    -        {
    -            touchData = new PIXI.InteractionData();
    -        }
    -
    -        touchData.originalEvent = event;
    -
    -        this.touches[touchEvent.identifier] = touchData;
    -        touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution;
    -        touchData.global.y = ( (touchEvent.clientY - rect.top)  * (this.target.height / rect.height) ) / this.resolution;
    -        if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height)
    -        {
    -            //Support for CocoonJS fullscreen scale modes
    -            touchData.global.x = touchEvent.clientX;
    -            touchData.global.y = touchEvent.clientY;
    -        }
    -
    -        var length = this.interactiveItems.length;
    -
    -        for (var j = 0; j < length; j++)
    -        {
    -            var item = this.interactiveItems[j];
    -
    -            if (item.touchstart || item.tap)
    -            {
    -                item.__hit = this.hitTest(item, touchData);
    -
    -                if (item.__hit)
    -                {
    -                    //call the function!
    -                    if (item.touchstart)item.touchstart(touchData);
    -                    item.__isDown = true;
    -                    item.__touchData = item.__touchData || {};
    -                    item.__touchData[touchEvent.identifier] = touchData;
    -
    -                    if (!item.interactiveChildren) break;
    -                }
    -            }
    -        }
    -    }
    -};
    -
    -/**
    - * Is called when a touch is ended on the renderer element
    - *
    - * @method onTouchEnd
    - * @param event {Event} The DOM event of a touch ending on the renderer view
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onTouchEnd = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    var rect = this.interactionDOMElement.getBoundingClientRect();
    -    var changedTouches = event.changedTouches;
    -
    -    for (var i=0; i < changedTouches.length; i++)
    -    {
    -        var touchEvent = changedTouches[i];
    -        var touchData = this.touches[touchEvent.identifier];
    -        var up = false;
    -        touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution;
    -        touchData.global.y = ( (touchEvent.clientY - rect.top)  * (this.target.height / rect.height) ) / this.resolution;
    -        if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height)
    -        {
    -            //Support for CocoonJS fullscreen scale modes
    -            touchData.global.x = touchEvent.clientX;
    -            touchData.global.y = touchEvent.clientY;
    -        }
    -
    -        var length = this.interactiveItems.length;
    -        for (var j = 0; j < length; j++)
    -        {
    -            var item = this.interactiveItems[j];
    -
    -            if (item.__touchData && item.__touchData[touchEvent.identifier])
    -            {
    -
    -                item.__hit = this.hitTest(item, item.__touchData[touchEvent.identifier]);
    -
    -                // so this one WAS down...
    -                touchData.originalEvent = event;
    -                // hitTest??
    -
    -                if (item.touchend || item.tap)
    -                {
    -                    if (item.__hit && !up)
    -                    {
    -                        if (item.touchend)
    -                        {
    -                            item.touchend(touchData);
    -                        }
    -                        if (item.__isDown && item.tap)
    -                        {
    -                            item.tap(touchData);
    -                        }
    -                        if (!item.interactiveChildren)
    -                        {
    -                            up = true;
    -                        }
    -                    }
    -                    else
    -                    {
    -                        if (item.__isDown && item.touchendoutside)
    -                        {
    -                            item.touchendoutside(touchData);
    -                        }
    -                    }
    -
    -                    item.__isDown = false;
    -                }
    -
    -                item.__touchData[touchEvent.identifier] = null;
    -            }
    -        }
    -        // remove the touch..
    -        this.pool.push(touchData);
    -        this.touches[touchEvent.identifier] = null;
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_Intro.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_Intro.js.html deleted file mode 100755 index 39c4332..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_Intro.js.html +++ /dev/null @@ -1,285 +0,0 @@ - - - - - src/pixi/Intro.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/Intro.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -(function(){
    -
    -    var root = this;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_Outro.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_Outro.js.html deleted file mode 100755 index a3fd28d..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_Outro.js.html +++ /dev/null @@ -1,292 +0,0 @@ - - - - - src/pixi/Outro.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/Outro.js

    - -
    -
    -/**
    - * @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 if (typeof define !== 'undefined' && define.amd) {
    -        define(PIXI);
    -    } else {
    -        root.PIXI = PIXI;
    -    }
    -}).call(this);
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_Pixi.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_Pixi.js.html deleted file mode 100755 index 3533110..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_Pixi.js.html +++ /dev/null @@ -1,395 +0,0 @@ - - - - - src/pixi/Pixi.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/Pixi.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * @module PIXI
    - */
    -var PIXI = PIXI || {};
    -
    -/* 
    -* 
    -* This file contains a lot of pixi consts which are used across the rendering engine
    -* @class Consts
    -*/
    -PIXI.WEBGL_RENDERER = 0;
    -PIXI.CANVAS_RENDERER = 1;
    -
    -// useful for testing against if your lib is using pixi.
    -PIXI.VERSION = "v2.1.0";
    -
    -
    -// the various blend modes supported by pixi
    -PIXI.blendModes = {
    -    NORMAL:0,
    -    ADD:1,
    -    MULTIPLY:2,
    -    SCREEN:3,
    -    OVERLAY:4,
    -    DARKEN:5,
    -    LIGHTEN:6,
    -    COLOR_DODGE:7,
    -    COLOR_BURN:8,
    -    HARD_LIGHT:9,
    -    SOFT_LIGHT:10,
    -    DIFFERENCE:11,
    -    EXCLUSION:12,
    -    HUE:13,
    -    SATURATION:14,
    -    COLOR:15,
    -    LUMINOSITY:16
    -};
    -
    -// the scale modes
    -PIXI.scaleModes = {
    -    DEFAULT:0,
    -    LINEAR:0,
    -    NEAREST:1
    -};
    -
    -// used to create uids for various pixi objects..
    -PIXI._UID = 0;
    -
    -if(typeof(Float32Array) != 'undefined')
    -{
    -    PIXI.Float32Array = Float32Array;
    -    PIXI.Uint16Array = Uint16Array;
    -}
    -else
    -{
    -    PIXI.Float32Array = Array;
    -    PIXI.Uint16Array = Array;
    -}
    -
    -// interaction frequency 
    -PIXI.INTERACTION_FREQUENCY = 30;
    -PIXI.AUTO_PREVENT_DEFAULT = true;
    -
    -PIXI.PI_2 = Math.PI * 2;
    -PIXI.RAD_TO_DEG = 180 / Math.PI;
    -PIXI.DEG_TO_RAD = Math.PI / 180;
    -
    -PIXI.RETINA_PREFIX = "@2x";
    -//PIXI.SCALE_PREFIX "@x%%";
    -
    -PIXI.dontSayHello = false;
    -
    -
    -PIXI.defaultRenderOptions = {
    -    view:null, 
    -    transparent:false, 
    -    antialias:false, 
    -    preserveDrawingBuffer:false,
    -    resolution:1,
    -    clearBeforeRender:true,
    -    autoResize:false
    -}
    -
    -PIXI.sayHello = function (type) 
    -{
    -    if(PIXI.dontSayHello)return;
    -
    -    if ( navigator.userAgent.toLowerCase().indexOf('chrome') > -1 )
    -    {
    -        var args = [
    -            '%c %c %c Pixi.js ' + PIXI.VERSION + ' - ' + type + '  %c ' + ' %c ' + ' http://www.pixijs.com/  %c %c ♥%c♥%c♥ ',
    -            'background: #ff66a5',
    -            'background: #ff66a5',
    -            'color: #ff66a5; background: #030307;',
    -            'background: #ff66a5',
    -            'background: #ffc3dc',
    -            'background: #ff66a5',
    -            'color: #ff2424; background: #fff',
    -            'color: #ff2424; background: #fff',
    -            'color: #ff2424; background: #fff'
    -        ];
    -
    -       
    -
    -        console.log.apply(console, args);
    -    }
    -    else if (window['console'])
    -    {
    -        console.log('Pixi.js ' + PIXI.VERSION + ' - http://www.pixijs.com/');
    -    }
    -
    -    PIXI.dontSayHello = true;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_display_DisplayObject.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_display_DisplayObject.js.html deleted file mode 100755 index d3de5e4..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_display_DisplayObject.js.html +++ /dev/null @@ -1,1042 +0,0 @@ - - - - - src/pixi/display/DisplayObject.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/DisplayObject.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The base class for all objects that are rendered on the screen.
    - * This is an abstract class and should not be used on its own rather it should be extended.
    - *
    - * @class DisplayObject
    - * @constructor
    - */
    -PIXI.DisplayObject = function()
    -{
    -    /**
    -     * The coordinate of the object relative to the local coordinates of the parent.
    -     *
    -     * @property position
    -     * @type Point
    -     */
    -    this.position = new PIXI.Point();
    -
    -    /**
    -     * The scale factor of the object.
    -     *
    -     * @property scale
    -     * @type Point
    -     */
    -    this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    -
    -    /**
    -     * The pivot point of the displayObject that it rotates around
    -     *
    -     * @property pivot
    -     * @type Point
    -     */
    -    this.pivot = new PIXI.Point(0,0);
    -
    -    /**
    -     * The rotation of the object in radians.
    -     *
    -     * @property rotation
    -     * @type Number
    -     */
    -    this.rotation = 0;
    -
    -    /**
    -     * The opacity of the object.
    -     *
    -     * @property alpha
    -     * @type Number
    -     */
    -    this.alpha = 1;
    -
    -    /**
    -     * The visibility of the object.
    -     *
    -     * @property visible
    -     * @type Boolean
    -     */
    -    this.visible = true;
    -
    -    /**
    -     * This is the defined area that will pick up mouse / touch events. It is null by default.
    -     * Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)
    -     *
    -     * @property hitArea
    -     * @type Rectangle|Circle|Ellipse|Polygon
    -     */
    -    this.hitArea = null;
    -
    -    /**
    -     * This is used to indicate if the displayObject should display a mouse hand cursor on rollover
    -     *
    -     * @property buttonMode
    -     * @type Boolean
    -     */
    -    this.buttonMode = false;
    -
    -    /**
    -     * Can this object be rendered
    -     *
    -     * @property renderable
    -     * @type Boolean
    -     */
    -    this.renderable = false;
    -
    -    /**
    -     * [read-only] The display object container that contains this display object.
    -     *
    -     * @property parent
    -     * @type DisplayObjectContainer
    -     * @readOnly
    -     */
    -    this.parent = null;
    -
    -    /**
    -     * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    -     *
    -     * @property stage
    -     * @type Stage
    -     * @readOnly
    -     */
    -    this.stage = null;
    -
    -    /**
    -     * [read-only] The multiplied alpha of the displayObject
    -     *
    -     * @property worldAlpha
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.worldAlpha = 1;
    -
    -    /**
    -     * [read-only] Whether or not the object is interactive, do not toggle directly! use the `interactive` property
    -     *
    -     * @property _interactive
    -     * @type Boolean
    -     * @readOnly
    -     * @private
    -     */
    -    this._interactive = false;
    -
    -    /**
    -     * This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
    -     *
    -     * @property defaultCursor
    -     * @type String
    -     *
    -    */
    -    this.defaultCursor = 'pointer';
    -
    -    /**
    -     * [read-only] Current transform of the object based on world (parent) factors
    -     *
    -     * @property worldTransform
    -     * @type Matrix
    -     * @readOnly
    -     * @private
    -     */
    -    this.worldTransform = new PIXI.Matrix();
    -
    -    /**
    -     * cached sin rotation and cos rotation
    -     *
    -     * @property _sr
    -     * @type Number
    -     * @private
    -     */
    -    this._sr = 0;
    -
    -    /**
    -     * cached sin rotation and cos rotation
    -     *
    -     * @property _cr
    -     * @type Number
    -     * @private
    -     */
    -    this._cr = 1;
    -
    -    /**
    -     * The area the filter is applied to like the hitArea this is used as more of an optimisation
    -     * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle
    -     *
    -     * @property filterArea
    -     * @type Rectangle
    -     */
    -    this.filterArea = null;//new PIXI.Rectangle(0,0,1,1);
    -
    -    /**
    -     * The original, cached bounds of the object
    -     *
    -     * @property _bounds
    -     * @type Rectangle
    -     * @private
    -     */
    -    this._bounds = new PIXI.Rectangle(0, 0, 1, 1);
    -
    -    /**
    -     * The most up-to-date bounds of the object
    -     *
    -     * @property _currentBounds
    -     * @type Rectangle
    -     * @private
    -     */
    -    this._currentBounds = null;
    -
    -    /**
    -     * The original, cached mask of the object
    -     *
    -     * @property _currentBounds
    -     * @type Rectangle
    -     * @private
    -     */
    -    this._mask = null;
    -
    -    /**
    -     * Cached internal flag.
    -     *
    -     * @property _cacheAsBitmap
    -     * @type Boolean
    -     * @private
    -     */
    -    this._cacheAsBitmap = false;
    -
    -    /**
    -     * Cached internal flag.
    -     *
    -     * @property _cacheIsDirty
    -     * @type Boolean
    -     * @private
    -     */
    -    this._cacheIsDirty = false;
    -
    -
    -    /*
    -     * MOUSE Callbacks
    -     */
    -    
    -    /**
    -     * A callback that is used when the users mouse rolls over the displayObject
    -     * @method mouseover
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the users mouse leaves the displayObject
    -     * @method mouseout
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    //Left button
    -    /**
    -     * A callback that is used when the users clicks on the displayObject with their mouse's left button
    -     * @method click
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user clicks the mouse's left button down over the sprite
    -     * @method mousedown
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases the mouse's left button that was over the displayObject
    -     * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject
    -     * @method mouseup
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject
    -     * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject
    -     * @method mouseupoutside
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    //Right button
    -    /**
    -     * A callback that is used when the users clicks on the displayObject with their mouse's right button
    -     * @method rightclick
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user clicks the mouse's right button down over the sprite
    -     * @method rightdown
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases the mouse's right button that was over the displayObject
    -     * for this callback to be fired the mouse's right button must have been pressed down over the displayObject
    -     * @method rightup
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject
    -     * for this callback to be fired, the mouse's right button must have been pressed down over the displayObject
    -     * @method rightupoutside
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /*
    -     * TOUCH Callbacks
    -     */
    -
    -    /**
    -     * A callback that is used when the users taps on the sprite with their finger
    -     * basically a touch version of click
    -     * @method tap
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user touches over the displayObject
    -     * @method touchstart
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases a touch over the displayObject
    -     * @method touchend
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases the touch that was over the displayObject
    -     * for this callback to be fired, The touch must have started over the sprite
    -     * @method touchendoutside
    -     * @param interactionData {InteractionData}
    -     */
    -};
    -
    -// constructor
    -PIXI.DisplayObject.prototype.constructor = PIXI.DisplayObject;
    -
    -/**
    - * Indicates if the sprite will have touch and mouse interactivity. It is false by default
    - *
    - * @property interactive
    - * @type Boolean
    - * @default false
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'interactive', {
    -    get: function() {
    -        return this._interactive;
    -    },
    -    set: function(value) {
    -        this._interactive = value;
    -
    -        // TODO more to be done here..
    -        // need to sort out a re-crawl!
    -        if(this.stage)this.stage.dirty = true;
    -    }
    -});
    -
    -/**
    - * [read-only] Indicates if the sprite is globally visible.
    - *
    - * @property worldVisible
    - * @type Boolean
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'worldVisible', {
    -    get: function() {
    -        var item = this;
    -
    -        do
    -        {
    -            if(!item.visible)return false;
    -            item = item.parent;
    -        }
    -        while(item);
    -
    -        return true;
    -    }
    -});
    -
    -/**
    - * Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.
    - * In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping.
    - * To remove a mask, set this property to null.
    - *
    - * @property mask
    - * @type Graphics
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'mask', {
    -    get: function() {
    -        return this._mask;
    -    },
    -    set: function(value) {
    -
    -        if(this._mask)this._mask.isMask = false;
    -        this._mask = value;
    -        if(this._mask)this._mask.isMask = true;
    -    }
    -});
    -
    -/**
    - * Sets the filters for the displayObject.
    - * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer.
    - * To remove filters simply set this property to 'null'
    - * @property filters
    - * @type Array An array of filters
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', {
    -
    -    get: function() {
    -        return this._filters;
    -    },
    -
    -    set: function(value) {
    -
    -        if(value)
    -        {
    -            // now put all the passes in one place..
    -            var passes = [];
    -            for (var i = 0; i < value.length; i++)
    -            {
    -                var filterPasses = value[i].passes;
    -                for (var j = 0; j < filterPasses.length; j++)
    -                {
    -                    passes.push(filterPasses[j]);
    -                }
    -            }
    -
    -            // TODO change this as it is legacy
    -            this._filterBlock = {target:this, filterPasses:passes};
    -        }
    -
    -        this._filters = value;
    -    }
    -});
    -
    -/**
    - * Set if this display object is cached as a bitmap.
    - * This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects.
    - * To remove simply set this property to 'null'
    - * @property cacheAsBitmap
    - * @type Boolean
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'cacheAsBitmap', {
    -
    -    get: function() {
    -        return  this._cacheAsBitmap;
    -    },
    -
    -    set: function(value) {
    -
    -        if(this._cacheAsBitmap === value)return;
    -
    -        if(value)
    -        {
    -            this._generateCachedSprite();
    -        }
    -        else
    -        {
    -            this._destroyCachedSprite();
    -        }
    -
    -        this._cacheAsBitmap = value;
    -    }
    -});
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.DisplayObject.prototype.updateTransform = function()
    -{
    -    // create some matrix refs for easy access
    -    var pt = this.parent.worldTransform;
    -    var wt = this.worldTransform;
    -
    -    // temporary matrix variables
    -    var a, b, c, d, tx, ty;
    -
    -    // TODO create a const for 2_PI 
    -    // so if rotation is between 0 then we can simplify the multiplication process..
    -    if(this.rotation % PIXI.PI_2)
    -    {
    -        // check to see if the rotation is the same as the previous render. This means we only need to use sin and cos when rotation actually changes
    -        if(this.rotation !== this.rotationCache)
    -        {
    -            this.rotationCache = this.rotation;
    -            this._sr = Math.sin(this.rotation);
    -            this._cr = Math.cos(this.rotation);
    -        }
    -
    -        // get the matrix values of the displayobject based on its transform properties..
    -        a  =  this._cr * this.scale.x;
    -        b  =  this._sr * this.scale.x;
    -        c  = -this._sr * this.scale.y;
    -        d  =  this._cr * this.scale.y;
    -        tx =  this.position.x;
    -        ty =  this.position.y;
    -        
    -        // check for pivot.. not often used so geared towards that fact!
    -        if(this.pivot.x || this.pivot.y)
    -        {
    -            tx -= this.pivot.x * a + this.pivot.y * c;
    -            ty -= this.pivot.x * b + this.pivot.y * d;
    -        }
    -
    -        // concat the parent matrix with the objects transform.
    -        wt.a  = a  * pt.a + b  * pt.c;
    -        wt.b  = a  * pt.b + b  * pt.d;
    -        wt.c  = c  * pt.a + d  * pt.c;
    -        wt.d  = c  * pt.b + d  * pt.d;
    -        wt.tx = tx * pt.a + ty * pt.c + pt.tx;
    -        wt.ty = tx * pt.b + ty * pt.d + pt.ty;
    -
    -        
    -    }
    -    else
    -    {
    -        // lets do the fast version as we know there is no rotation..
    -        a  = this.scale.x;
    -        d  = this.scale.y;
    -
    -        tx =  this.position.x;
    -        ty =  this.position.y;
    -
    -        wt.a  = a  * pt.a;
    -        wt.b  = a  * pt.b;
    -        wt.c  = d  * pt.c;
    -        wt.d  = d  * pt.d;
    -        wt.tx = tx * pt.a + ty * pt.c + pt.tx;
    -        wt.ty = tx * pt.b + ty * pt.d + pt.ty;
    -    }
    -
    -    // multiply the alphas..
    -    this.worldAlpha = this.alpha * this.parent.worldAlpha;
    -};
    -
    -// performance increase to avoid using call.. (10x faster)
    -PIXI.DisplayObject.prototype.displayObjectUpdateTransform = PIXI.DisplayObject.prototype.updateTransform;
    -
    -/**
    - * Retrieves the bounds of the displayObject as a rectangle object
    - *
    - * @method getBounds
    - * @param matrix {Matrix}
    - * @return {Rectangle} the rectangular bounding area
    - */
    -PIXI.DisplayObject.prototype.getBounds = function(matrix)
    -{
    -    matrix = matrix;//just to get passed js hinting (and preserve inheritance)
    -    return PIXI.EmptyRectangle;
    -};
    -
    -/**
    - * Retrieves the local bounds of the displayObject as a rectangle object
    - *
    - * @method getLocalBounds
    - * @return {Rectangle} the rectangular bounding area
    - */
    -PIXI.DisplayObject.prototype.getLocalBounds = function()
    -{
    -    return this.getBounds(PIXI.identityMatrix);///PIXI.EmptyRectangle();
    -};
    -
    -/**
    - * Sets the object's stage reference, the stage this object is connected to
    - *
    - * @method setStageReference
    - * @param stage {Stage} the stage that the object will have as its current stage reference
    - */
    -PIXI.DisplayObject.prototype.setStageReference = function(stage)
    -{
    -    this.stage = stage;
    -    if(this._interactive)this.stage.dirty = true;
    -};
    -
    -/**
    - * Useful function that returns a texture of the displayObject object that can then be used to create sprites
    - * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.
    - *
    - * @method generateTexture
    - * @param resolution {Number} The resolution of the texture being generated
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture.
    - * @return {Texture} a texture of the graphics object
    - */
    -PIXI.DisplayObject.prototype.generateTexture = function(resolution, scaleMode, renderer)
    -{
    -    var bounds = this.getLocalBounds();
    -
    -    var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0, renderer, scaleMode, resolution);
    -    
    -    PIXI.DisplayObject._tempMatrix.tx = -bounds.x;
    -    PIXI.DisplayObject._tempMatrix.ty = -bounds.y;
    -    
    -    renderTexture.render(this, PIXI.DisplayObject._tempMatrix);
    -
    -    return renderTexture;
    -};
    -
    -/**
    - * Generates and updates the cached sprite for this object.
    - *
    - * @method updateCache
    - */
    -PIXI.DisplayObject.prototype.updateCache = function()
    -{
    -    this._generateCachedSprite();
    -};
    -
    -/**
    - * Calculates the global position of the display object
    - *
    - * @method toGlobal
    - * @param position {Point} The world origin to calculate from
    - * @return {Point} A point object representing the position of this object
    - */
    -PIXI.DisplayObject.prototype.toGlobal = function(position)
    -{
    -    this.updateTransform();
    -    return this.worldTransform.apply(position);
    -};
    -
    -/**
    - * Calculates the local position of the display object relative to another point
    - *
    - * @method toLocal
    - * @param position {Point} The world origin to calculate from
    - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from
    - * @return {Point} A point object representing the position of this object
    - */
    -PIXI.DisplayObject.prototype.toLocal = function(position, from)
    -{
    -    if (from)
    -    {
    -        position = from.toGlobal(position);
    -    }
    -
    -    this.updateTransform();
    -
    -    return this.worldTransform.applyInverse(position);
    -};
    -
    -/**
    - * Internal method.
    - *
    - * @method _renderCachedSprite
    - * @param renderSession {Object} The render session
    - * @private
    - */
    -PIXI.DisplayObject.prototype._renderCachedSprite = function(renderSession)
    -{
    -    this._cachedSprite.worldAlpha = this.worldAlpha;
    -
    -    if(renderSession.gl)
    -    {
    -        PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession);
    -    }
    -    else
    -    {
    -        PIXI.Sprite.prototype._renderCanvas.call(this._cachedSprite, renderSession);
    -    }
    -};
    -
    -/**
    - * Internal method.
    - *
    - * @method _generateCachedSprite
    - * @private
    - */
    -PIXI.DisplayObject.prototype._generateCachedSprite = function()
    -{
    -    this._cacheAsBitmap = false;
    -    var bounds = this.getLocalBounds();
    -
    -    if(!this._cachedSprite)
    -    {
    -        var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0);//, renderSession.renderer);
    -
    -        this._cachedSprite = new PIXI.Sprite(renderTexture);
    -        this._cachedSprite.worldTransform = this.worldTransform;
    -    }
    -    else
    -    {
    -        this._cachedSprite.texture.resize(bounds.width | 0, bounds.height | 0);
    -    }
    -
    -    //REMOVE filter!
    -    var tempFilters = this._filters;
    -    this._filters = null;
    -
    -    this._cachedSprite.filters = tempFilters;
    -
    -    PIXI.DisplayObject._tempMatrix.tx = -bounds.x;
    -    PIXI.DisplayObject._tempMatrix.ty = -bounds.y;
    -    
    -    this._cachedSprite.texture.render(this, PIXI.DisplayObject._tempMatrix );
    -
    -    this._cachedSprite.anchor.x = -( bounds.x / bounds.width );
    -    this._cachedSprite.anchor.y = -( bounds.y / bounds.height );
    -
    -    this._filters = tempFilters;
    -
    -    this._cacheAsBitmap = true;
    -};
    -
    -/**
    -* Destroys the cached sprite.
    -*
    -* @method _destroyCachedSprite
    -* @private
    -*/
    -PIXI.DisplayObject.prototype._destroyCachedSprite = function()
    -{
    -    if(!this._cachedSprite)return;
    -
    -    this._cachedSprite.texture.destroy(true);
    -
    -    // TODO could be object pooled!
    -    this._cachedSprite = null;
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession}
    -* @private
    -*/
    -PIXI.DisplayObject.prototype._renderWebGL = function(renderSession)
    -{
    -    // OVERWRITE;
    -    // this line is just here to pass jshinting :)
    -    renderSession = renderSession;
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession}
    -* @private
    -*/
    -PIXI.DisplayObject.prototype._renderCanvas = function(renderSession)
    -{
    -    // OVERWRITE;
    -    // this line is just here to pass jshinting :)
    -    renderSession = renderSession;
    -};
    -
    -
    -PIXI.DisplayObject._tempMatrix = new PIXI.Matrix();
    -
    -/**
    - * The position of the displayObject on the x axis relative to the local coordinates of the parent.
    - *
    - * @property x
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'x', {
    -    get: function() {
    -        return  this.position.x;
    -    },
    -    set: function(value) {
    -        this.position.x = value;
    -    }
    -});
    -
    -/**
    - * The position of the displayObject on the y axis relative to the local coordinates of the parent.
    - *
    - * @property y
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'y', {
    -    get: function() {
    -        return  this.position.y;
    -    },
    -    set: function(value) {
    -        this.position.y = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_display_DisplayObjectContainer.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_display_DisplayObjectContainer.js.html deleted file mode 100755 index 0c8eb24..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_display_DisplayObjectContainer.js.html +++ /dev/null @@ -1,793 +0,0 @@ - - - - - src/pixi/display/DisplayObjectContainer.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/DisplayObjectContainer.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A DisplayObjectContainer represents a collection of display objects.
    - * It is the base class of all display objects that act as a container for other objects.
    - *
    - * @class DisplayObjectContainer
    - * @extends DisplayObject
    - * @constructor
    - */
    -PIXI.DisplayObjectContainer = function()
    -{
    -    PIXI.DisplayObject.call( this );
    -
    -    /**
    -     * [read-only] The array of children of this container.
    -     *
    -     * @property children
    -     * @type Array<DisplayObject>
    -     * @readOnly
    -     */
    -    this.children = [];
    -
    -    // fast access to update transform..
    -    
    -};
    -
    -// constructor
    -PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    -PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer;
    -
    -
    -/**
    - * The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
    - *
    - * @property width
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', {
    -    get: function() {
    -        return this.scale.x * this.getLocalBounds().width;
    -    },
    -    set: function(value) {
    -        
    -        var width = this.getLocalBounds().width;
    -
    -        if(width !== 0)
    -        {
    -            this.scale.x = value / ( width/this.scale.x );
    -        }
    -        else
    -        {
    -            this.scale.x = 1;
    -        }
    -
    -        
    -        this._width = value;
    -    }
    -});
    -
    -/**
    - * The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
    - *
    - * @property height
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', {
    -    get: function() {
    -        return  this.scale.y * this.getLocalBounds().height;
    -    },
    -    set: function(value) {
    -
    -        var height = this.getLocalBounds().height;
    -
    -        if(height !== 0)
    -        {
    -            this.scale.y = value / ( height/this.scale.y );
    -        }
    -        else
    -        {
    -            this.scale.y = 1;
    -        }
    -
    -        this._height = value;
    -    }
    -});
    -
    -/**
    - * Adds a child to the container.
    - *
    - * @method addChild
    - * @param child {DisplayObject} The DisplayObject to add to the container
    - * @return {DisplayObject} The child that was added.
    - */
    -PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    -{
    -    return this.addChildAt(child, this.children.length);
    -};
    -
    -/**
    - * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    - *
    - * @method addChildAt
    - * @param child {DisplayObject} The child to add
    - * @param index {Number} The index to place the child in
    - * @return {DisplayObject} The child that was added.
    - */
    -PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    -{
    -    if(index >= 0 && index <= this.children.length)
    -    {
    -        if(child.parent)
    -        {
    -            child.parent.removeChild(child);
    -        }
    -
    -        child.parent = this;
    -
    -        this.children.splice(index, 0, child);
    -
    -        if(this.stage)child.setStageReference(this.stage);
    -
    -        return child;
    -    }
    -    else
    -    {
    -        throw new Error(child + 'addChildAt: The index '+ index +' supplied is out of bounds ' + this.children.length);
    -    }
    -};
    -
    -/**
    - * Swaps the position of 2 Display Objects within this container.
    - *
    - * @method swapChildren
    - * @param child {DisplayObject}
    - * @param child2 {DisplayObject}
    - */
    -PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2)
    -{
    -    if(child === child2) {
    -        return;
    -    }
    -
    -    var index1 = this.getChildIndex(child);
    -    var index2 = this.getChildIndex(child2);
    -
    -    if(index1 < 0 || index2 < 0) {
    -        throw new Error('swapChildren: Both the supplied DisplayObjects must be a child of the caller.');
    -    }
    -
    -    this.children[index1] = child2;
    -    this.children[index2] = child;
    -
    -};
    -
    -/**
    - * Returns the index position of a child DisplayObject instance
    - *
    - * @method getChildIndex
    - * @param child {DisplayObject} The DisplayObject instance to identify
    - * @return {Number} The index position of the child display object to identify
    - */
    -PIXI.DisplayObjectContainer.prototype.getChildIndex = function(child)
    -{
    -    var index = this.children.indexOf(child);
    -    if (index === -1)
    -    {
    -        throw new Error('The supplied DisplayObject must be a child of the caller');
    -    }
    -    return index;
    -};
    -
    -/**
    - * Changes the position of an existing child in the display object container
    - *
    - * @method setChildIndex
    - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number
    - * @param index {Number} The resulting index number for the child display object
    - */
    -PIXI.DisplayObjectContainer.prototype.setChildIndex = function(child, index)
    -{
    -    if (index < 0 || index >= this.children.length)
    -    {
    -        throw new Error('The supplied index is out of bounds');
    -    }
    -    var currentIndex = this.getChildIndex(child);
    -    this.children.splice(currentIndex, 1); //remove from old position
    -    this.children.splice(index, 0, child); //add at new position
    -};
    -
    -/**
    - * Returns the child at the specified index
    - *
    - * @method getChildAt
    - * @param index {Number} The index to get the child from
    - * @return {DisplayObject} The child at the given index, if any.
    - */
    -PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
    -{
    -    if (index < 0 || index >= this.children.length)
    -    {
    -        throw new Error('getChildAt: Supplied index '+ index +' does not exist in the child list, or the supplied DisplayObject must be a child of the caller');
    -    }
    -    return this.children[index];
    -    
    -};
    -
    -/**
    - * Removes a child from the container.
    - *
    - * @method removeChild
    - * @param child {DisplayObject} The DisplayObject to remove
    - * @return {DisplayObject} The child that was removed.
    - */
    -PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    -{
    -    var index = this.children.indexOf( child );
    -    if(index === -1)return;
    -    
    -    return this.removeChildAt( index );
    -};
    -
    -/**
    - * Removes a child from the specified index position.
    - *
    - * @method removeChildAt
    - * @param index {Number} The index to get the child from
    - * @return {DisplayObject} The child that was removed.
    - */
    -PIXI.DisplayObjectContainer.prototype.removeChildAt = function(index)
    -{
    -    var child = this.getChildAt( index );
    -    if(this.stage)
    -        child.removeStageReference();
    -
    -    child.parent = undefined;
    -    this.children.splice( index, 1 );
    -    return child;
    -};
    -
    -/**
    -* Removes all children from this container that are within the begin and end indexes.
    -*
    -* @method removeChildren
    -* @param beginIndex {Number} The beginning position. Default value is 0.
    -* @param endIndex {Number} The ending position. Default value is size of the container.
    -*/
    -PIXI.DisplayObjectContainer.prototype.removeChildren = function(beginIndex, endIndex)
    -{
    -    var begin = beginIndex || 0;
    -    var end = typeof endIndex === 'number' ? endIndex : this.children.length;
    -    var range = end - begin;
    -
    -    if (range > 0 && range <= end)
    -    {
    -        var removed = this.children.splice(begin, range);
    -        for (var i = 0; i < removed.length; i++) {
    -            var child = removed[i];
    -            if(this.stage)
    -                child.removeStageReference();
    -            child.parent = undefined;
    -        }
    -        return removed;
    -    }
    -    else if (range === 0 && this.children.length === 0)
    -    {
    -        return [];
    -    }
    -    else
    -    {
    -        throw new Error( 'removeChildren: Range Error, numeric values are outside the acceptable range' );
    -    }
    -};
    -
    -/*
    - * Updates the transform on all children of this container for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    -{
    -    if(!this.visible)return;
    -
    -    this.displayObjectUpdateTransform();
    -
    -    //PIXI.DisplayObject.prototype.updateTransform.call( this );
    -
    -    if(this._cacheAsBitmap)return;
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        this.children[i].updateTransform();
    -    }
    -};
    -
    -// performance increase to avoid using call.. (10x faster)
    -PIXI.DisplayObjectContainer.prototype.displayObjectContainerUpdateTransform = PIXI.DisplayObjectContainer.prototype.updateTransform;
    -
    -/**
    - * Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.
    - *
    - * @method getBounds
    - * @return {Rectangle} The rectangular bounding area
    - */
    -PIXI.DisplayObjectContainer.prototype.getBounds = function()
    -{
    -    if(this.children.length === 0)return PIXI.EmptyRectangle;
    -
    -    // TODO the bounds have already been calculated this render session so return what we have
    -
    -    var minX = Infinity;
    -    var minY = Infinity;
    -
    -    var maxX = -Infinity;
    -    var maxY = -Infinity;
    -
    -    var childBounds;
    -    var childMaxX;
    -    var childMaxY;
    -
    -    var childVisible = false;
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        var child = this.children[i];
    -        
    -        if(!child.visible)continue;
    -
    -        childVisible = true;
    -
    -        childBounds = this.children[i].getBounds();
    -     
    -        minX = minX < childBounds.x ? minX : childBounds.x;
    -        minY = minY < childBounds.y ? minY : childBounds.y;
    -
    -        childMaxX = childBounds.width + childBounds.x;
    -        childMaxY = childBounds.height + childBounds.y;
    -
    -        maxX = maxX > childMaxX ? maxX : childMaxX;
    -        maxY = maxY > childMaxY ? maxY : childMaxY;
    -    }
    -
    -    if(!childVisible)
    -        return PIXI.EmptyRectangle;
    -
    -    var bounds = this._bounds;
    -
    -    bounds.x = minX;
    -    bounds.y = minY;
    -    bounds.width = maxX - minX;
    -    bounds.height = maxY - minY;
    -
    -    // TODO: store a reference so that if this function gets called again in the render cycle we do not have to recalculate
    -    //this._currentBounds = bounds;
    -   
    -    return bounds;
    -};
    -
    -/**
    - * Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.
    - *
    - * @method getLocalBounds
    - * @return {Rectangle} The rectangular bounding area
    - */
    -PIXI.DisplayObjectContainer.prototype.getLocalBounds = function()
    -{
    -    var matrixCache = this.worldTransform;
    -
    -    this.worldTransform = PIXI.identityMatrix;
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        this.children[i].updateTransform();
    -    }
    -
    -    var bounds = this.getBounds();
    -
    -    this.worldTransform = matrixCache;
    -
    -    return bounds;
    -};
    -
    -/**
    - * Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.
    - *
    - * @method setStageReference
    - * @param stage {Stage} the stage that the container will have as its current stage reference
    - */
    -PIXI.DisplayObjectContainer.prototype.setStageReference = function(stage)
    -{
    -    this.stage = stage;
    -    if(this._interactive)this.stage.dirty = true;
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        var child = this.children[i];
    -        child.setStageReference(stage);
    -    }
    -};
    -
    -/**
    - * Removes the current stage reference from the container and all of its children.
    - *
    - * @method removeStageReference
    - */
    -PIXI.DisplayObjectContainer.prototype.removeStageReference = function()
    -{
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        var child = this.children[i];
    -        child.removeStageReference();
    -    }
    -
    -    if(this._interactive)this.stage.dirty = true;
    -    
    -    this.stage = null;
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.DisplayObjectContainer.prototype._renderWebGL = function(renderSession)
    -{
    -    if(!this.visible || this.alpha <= 0)return;
    -    
    -    if(this._cacheAsBitmap)
    -    {
    -        this._renderCachedSprite(renderSession);
    -        return;
    -    }
    -    
    -    var i,j;
    -
    -    if(this._mask || this._filters)
    -    {
    -        
    -        // push filter first as we need to ensure the stencil buffer is correct for any masking
    -        if(this._filters)
    -        {
    -            renderSession.spriteBatch.flush();
    -            renderSession.filterManager.pushFilter(this._filterBlock);
    -        }
    -
    -        if(this._mask)
    -        {
    -            renderSession.spriteBatch.stop();
    -            renderSession.maskManager.pushMask(this.mask, renderSession);
    -            renderSession.spriteBatch.start();
    -        }
    -
    -        // simple render children!
    -        for(i=0,j=this.children.length; i<j; i++)
    -        {
    -            this.children[i]._renderWebGL(renderSession);
    -        }
    -
    -        renderSession.spriteBatch.stop();
    -
    -        if(this._mask)renderSession.maskManager.popMask(this._mask, renderSession);
    -        if(this._filters)renderSession.filterManager.popFilter();
    -        
    -        renderSession.spriteBatch.start();
    -    }
    -    else
    -    {
    -        // simple render children!
    -        for(i=0,j=this.children.length; i<j; i++)
    -        {
    -            this.children[i]._renderWebGL(renderSession);
    -        }
    -    }
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.DisplayObjectContainer.prototype._renderCanvas = function(renderSession)
    -{
    -    if(this.visible === false || this.alpha === 0)return;
    -
    -    if(this._cacheAsBitmap)
    -    {
    -
    -        this._renderCachedSprite(renderSession);
    -        return;
    -    }
    -
    -    if(this._mask)
    -    {
    -        renderSession.maskManager.pushMask(this._mask, renderSession);
    -    }
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        var child = this.children[i];
    -        child._renderCanvas(renderSession);
    -    }
    -
    -    if(this._mask)
    -    {
    -        renderSession.maskManager.popMask(renderSession);
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_display_MovieClip.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_display_MovieClip.js.html deleted file mode 100755 index 7096ce6..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_display_MovieClip.js.html +++ /dev/null @@ -1,483 +0,0 @@ - - - - - src/pixi/display/MovieClip.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/MovieClip.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A MovieClip is a simple way to display an animation depicted by a list of textures.
    - *
    - * @class MovieClip
    - * @extends Sprite
    - * @constructor
    - * @param textures {Array<Texture>} an array of {Texture} objects that make up the animation
    - */
    -PIXI.MovieClip = function(textures)
    -{
    -    PIXI.Sprite.call(this, textures[0]);
    -
    -    /**
    -     * The array of textures that make up the animation
    -     *
    -     * @property textures
    -     * @type Array
    -     */
    -    this.textures = textures;
    -
    -    /**
    -     * The speed that the MovieClip will play at. Higher is faster, lower is slower
    -     *
    -     * @property animationSpeed
    -     * @type Number
    -     * @default 1
    -     */
    -    this.animationSpeed = 1;
    -
    -    /**
    -     * Whether or not the movie clip repeats after playing.
    -     *
    -     * @property loop
    -     * @type Boolean
    -     * @default true
    -     */
    -    this.loop = true;
    -
    -    /**
    -     * Function to call when a MovieClip finishes playing
    -     *
    -     * @property onComplete
    -     * @type Function
    -     */
    -    this.onComplete = null;
    -
    -    /**
    -     * [read-only] The MovieClips current frame index (this may not have to be a whole number)
    -     *
    -     * @property currentFrame
    -     * @type Number
    -     * @default 0
    -     * @readOnly
    -     */
    -    this.currentFrame = 0;
    -
    -    /**
    -     * [read-only] Indicates if the MovieClip is currently playing
    -     *
    -     * @property playing
    -     * @type Boolean
    -     * @readOnly
    -     */
    -    this.playing = false;
    -};
    -
    -// constructor
    -PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    -PIXI.MovieClip.prototype.constructor = PIXI.MovieClip;
    -
    -/**
    -* [read-only] totalFrames is the total number of frames in the MovieClip. This is the same as number of textures
    -* assigned to the MovieClip.
    -*
    -* @property totalFrames
    -* @type Number
    -* @default 0
    -* @readOnly
    -*/
    -Object.defineProperty( PIXI.MovieClip.prototype, 'totalFrames', {
    -	get: function() {
    -
    -		return this.textures.length;
    -	}
    -});
    -
    -/**
    - * Stops the MovieClip
    - *
    - * @method stop
    - */
    -PIXI.MovieClip.prototype.stop = function()
    -{
    -    this.playing = false;
    -};
    -
    -/**
    - * Plays the MovieClip
    - *
    - * @method play
    - */
    -PIXI.MovieClip.prototype.play = function()
    -{
    -    this.playing = true;
    -};
    -
    -/**
    - * Stops the MovieClip and goes to a specific frame
    - *
    - * @method gotoAndStop
    - * @param frameNumber {Number} frame index to stop at
    - */
    -PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    -{
    -    this.playing = false;
    -    this.currentFrame = frameNumber;
    -    var round = (this.currentFrame + 0.5) | 0;
    -    this.setTexture(this.textures[round % this.textures.length]);
    -};
    -
    -/**
    - * Goes to a specific frame and begins playing the MovieClip
    - *
    - * @method gotoAndPlay
    - * @param frameNumber {Number} frame index to start at
    - */
    -PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    -{
    -    this.currentFrame = frameNumber;
    -    this.playing = true;
    -};
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.MovieClip.prototype.updateTransform = function()
    -{
    -    PIXI.Sprite.prototype.updateTransform.call(this);
    -
    -    if(!this.playing)return;
    -
    -    this.currentFrame += this.animationSpeed;
    -
    -    var round = (this.currentFrame + 0.5) | 0;
    -
    -    this.currentFrame = this.currentFrame % this.textures.length;
    -
    -    if(this.loop || round < this.textures.length)
    -    {
    -        this.setTexture(this.textures[round % this.textures.length]);
    -    }
    -    else if(round >= this.textures.length)
    -    {
    -        this.gotoAndStop(this.textures.length - 1);
    -        if(this.onComplete)
    -        {
    -            this.onComplete();
    -        }
    -    }
    -};
    -
    -/**
    - * A short hand way of creating a movieclip from an array of frame ids
    - *
    - * @static
    - * @method fromFrames
    - * @param frames {Array} the array of frames ids the movieclip will use as its texture frames
    - */
    -PIXI.MovieClip.fromFrames = function(frames)
    -{
    -    var textures = [];
    -
    -    for (var i = 0; i < frames.length; i++)
    -    {
    -        textures.push(new PIXI.Texture.fromFrame(frames[i]));
    -    }
    -
    -    return new PIXI.MovieClip(textures);
    -};
    -
    -/**
    - * A short hand way of creating a movieclip from an array of image ids
    - *
    - * @static
    - * @method fromImages
    - * @param frames {Array} the array of image ids the movieclip will use as its texture frames
    - */
    -PIXI.MovieClip.fromImages = function(images)
    -{
    -    var textures = [];
    -
    -    for (var i = 0; i < images.length; i++)
    -    {
    -        textures.push(new PIXI.Texture.fromImage(images[i]));
    -    }
    -
    -    return new PIXI.MovieClip(textures);
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_display_Sprite.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_display_Sprite.js.html deleted file mode 100755 index f92d36c..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_display_Sprite.js.html +++ /dev/null @@ -1,727 +0,0 @@ - - - - - src/pixi/display/Sprite.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/Sprite.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The Sprite object is the base for all textured objects that are rendered to the screen
    - *
    - * @class Sprite
    - * @extends DisplayObjectContainer
    - * @constructor
    - * @param texture {Texture} The texture for this sprite
    - *
    - * A sprite can be created directly from an image like this :
    - * var sprite = new PIXI.Sprite.fromImage('assets/image.png');
    - * yourStage.addChild(sprite);
    - * then obviously don't forget to add it to the stage you have already created
    - */
    -PIXI.Sprite = function(texture)
    -{
    -    PIXI.DisplayObjectContainer.call( this );
    -
    -    /**
    -     * The anchor sets the origin point of the texture.
    -     * The default is 0,0 this means the texture's origin is the top left
    -     * Setting than anchor to 0.5,0.5 means the textures origin is centered
    -     * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner
    -     *
    -     * @property anchor
    -     * @type Point
    -     */
    -    this.anchor = new PIXI.Point();
    -
    -    /**
    -     * The texture that the sprite is using
    -     *
    -     * @property texture
    -     * @type Texture
    -     */
    -    this.texture = texture;
    -
    -    /**
    -     * The width of the sprite (this is initially set by the texture)
    -     *
    -     * @property _width
    -     * @type Number
    -     * @private
    -     */
    -    this._width = 0;
    -
    -    /**
    -     * The height of the sprite (this is initially set by the texture)
    -     *
    -     * @property _height
    -     * @type Number
    -     * @private
    -     */
    -    this._height = 0;
    -
    -    /**
    -     * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.
    -     *
    -     * @property tint
    -     * @type Number
    -     * @default 0xFFFFFF
    -     */
    -    this.tint = 0xFFFFFF;
    -
    -    /**
    -     * The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.
    -     *
    -     * @property blendMode
    -     * @type Number
    -     * @default PIXI.blendModes.NORMAL;
    -     */
    -    this.blendMode = PIXI.blendModes.NORMAL;
    -
    -    /**
    -     * The shader that will be used to render the texture to the stage. Set to null to remove a current shader.
    -     *
    -     * @property shader
    -     * @type PIXI.AbstractFilter
    -     * @default null
    -     */
    -    this.shader = null;
    -
    -    if(texture.baseTexture.hasLoaded)
    -    {
    -        this.onTextureUpdate();
    -    }
    -    else
    -    {
    -        this.texture.on( 'update', this.onTextureUpdate.bind(this) );
    -    }
    -
    -    this.renderable = true;
    -
    -};
    -
    -// constructor
    -PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    -PIXI.Sprite.prototype.constructor = PIXI.Sprite;
    -
    -/**
    - * The width of the sprite, setting this will actually modify the scale to achieve the value set
    - *
    - * @property width
    - * @type Number
    - */
    -Object.defineProperty(PIXI.Sprite.prototype, 'width', {
    -    get: function() {
    -        return this.scale.x * this.texture.frame.width;
    -    },
    -    set: function(value) {
    -        this.scale.x = value / this.texture.frame.width;
    -        this._width = value;
    -    }
    -});
    -
    -/**
    - * The height of the sprite, setting this will actually modify the scale to achieve the value set
    - *
    - * @property height
    - * @type Number
    - */
    -Object.defineProperty(PIXI.Sprite.prototype, 'height', {
    -    get: function() {
    -        return  this.scale.y * this.texture.frame.height;
    -    },
    -    set: function(value) {
    -        this.scale.y = value / this.texture.frame.height;
    -        this._height = value;
    -    }
    -});
    -
    -/**
    - * Sets the texture of the sprite
    - *
    - * @method setTexture
    - * @param texture {Texture} The PIXI texture that is displayed by the sprite
    - */
    -PIXI.Sprite.prototype.setTexture = function(texture)
    -{
    -    this.texture = texture;
    -    this.cachedTint = 0xFFFFFF;
    -};
    -
    -/**
    - * When the texture is updated, this event will fire to update the scale and frame
    - *
    - * @method onTextureUpdate
    - * @param event
    - * @private
    - */
    -PIXI.Sprite.prototype.onTextureUpdate = function()
    -{
    -    // so if _width is 0 then width was not set..
    -    if(this._width)this.scale.x = this._width / this.texture.frame.width;
    -    if(this._height)this.scale.y = this._height / this.texture.frame.height;
    -
    -    //this.updateFrame = true;
    -};
    -
    -/**
    -* Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account.
    -*
    -* @method getBounds
    -* @param matrix {Matrix} the transformation matrix of the sprite
    -* @return {Rectangle} the framing rectangle
    -*/
    -PIXI.Sprite.prototype.getBounds = function(matrix)
    -{
    -    var width = this.texture.frame.width;
    -    var height = this.texture.frame.height;
    -
    -    var w0 = width * (1-this.anchor.x);
    -    var w1 = width * -this.anchor.x;
    -
    -    var h0 = height * (1-this.anchor.y);
    -    var h1 = height * -this.anchor.y;
    -
    -    var worldTransform = matrix || this.worldTransform ;
    -
    -    var a = worldTransform.a;
    -    var b = worldTransform.b;
    -    var c = worldTransform.c;
    -    var d = worldTransform.d;
    -    var tx = worldTransform.tx;
    -    var ty = worldTransform.ty;
    -
    -    var x1 = a * w1 + c * h1 + tx;
    -    var y1 = d * h1 + b * w1 + ty;
    -
    -    var x2 = a * w0 + c * h1 + tx;
    -    var y2 = d * h1 + b * w0 + ty;
    -
    -    var x3 = a * w0 + c * h0 + tx;
    -    var y3 = d * h0 + b * w0 + ty;
    -
    -    var x4 =  a * w1 + c * h0 + tx;
    -    var y4 =  d * h0 + b * w1 + ty;
    -
    -    var maxX = -Infinity;
    -    var maxY = -Infinity;
    -
    -    var minX = Infinity;
    -    var minY = Infinity;
    -
    -    minX = x1 < minX ? x1 : minX;
    -    minX = x2 < minX ? x2 : minX;
    -    minX = x3 < minX ? x3 : minX;
    -    minX = x4 < minX ? x4 : minX;
    -
    -    minY = y1 < minY ? y1 : minY;
    -    minY = y2 < minY ? y2 : minY;
    -    minY = y3 < minY ? y3 : minY;
    -    minY = y4 < minY ? y4 : minY;
    -
    -    maxX = x1 > maxX ? x1 : maxX;
    -    maxX = x2 > maxX ? x2 : maxX;
    -    maxX = x3 > maxX ? x3 : maxX;
    -    maxX = x4 > maxX ? x4 : maxX;
    -
    -    maxY = y1 > maxY ? y1 : maxY;
    -    maxY = y2 > maxY ? y2 : maxY;
    -    maxY = y3 > maxY ? y3 : maxY;
    -    maxY = y4 > maxY ? y4 : maxY;
    -
    -    var bounds = this._bounds;
    -
    -    bounds.x = minX;
    -    bounds.width = maxX - minX;
    -
    -    bounds.y = minY;
    -    bounds.height = maxY - minY;
    -
    -    // store a reference so that if this function gets called again in the render cycle we do not have to recalculate
    -    this._currentBounds = bounds;
    -
    -    return bounds;
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession}
    -* @private
    -*/
    -PIXI.Sprite.prototype._renderWebGL = function(renderSession)
    -{
    -    // if the sprite is not visible or the alpha is 0 then no need to render this element
    -    if(!this.visible || this.alpha <= 0)return;
    -
    -    var i,j;
    -
    -    // do a quick check to see if this element has a mask or a filter.
    -    if(this._mask || this._filters)
    -    {
    -        var spriteBatch =  renderSession.spriteBatch;
    -
    -        // push filter first as we need to ensure the stencil buffer is correct for any masking
    -        if(this._filters)
    -        {
    -            spriteBatch.flush();
    -            renderSession.filterManager.pushFilter(this._filterBlock);
    -        }
    -
    -        if(this._mask)
    -        {
    -            spriteBatch.stop();
    -            renderSession.maskManager.pushMask(this.mask, renderSession);
    -            spriteBatch.start();
    -        }
    -
    -        // add this sprite to the batch
    -        spriteBatch.render(this);
    -
    -        // now loop through the children and make sure they get rendered
    -        for(i=0,j=this.children.length; i<j; i++)
    -        {
    -            this.children[i]._renderWebGL(renderSession);
    -        }
    -
    -        // time to stop the sprite batch as either a mask element or a filter draw will happen next
    -        spriteBatch.stop();
    -
    -        if(this._mask)renderSession.maskManager.popMask(this._mask, renderSession);
    -        if(this._filters)renderSession.filterManager.popFilter();
    -
    -        spriteBatch.start();
    -    }
    -    else
    -    {
    -        renderSession.spriteBatch.render(this);
    -
    -        // simple render children!
    -        for(i=0,j=this.children.length; i<j; i++)
    -        {
    -            this.children[i]._renderWebGL(renderSession);
    -        }
    -
    -    }
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession}
    -* @private
    -*/
    -PIXI.Sprite.prototype._renderCanvas = function(renderSession)
    -{
    -    // If the sprite is not visible or the alpha is 0 then no need to render this element
    -    if (this.visible === false || this.alpha === 0 || this.texture.crop.width <= 0 || this.texture.crop.height <= 0) return;
    -
    -    if (this.blendMode !== renderSession.currentBlendMode)
    -    {
    -        renderSession.currentBlendMode = this.blendMode;
    -        renderSession.context.globalCompositeOperation = PIXI.blendModesCanvas[renderSession.currentBlendMode];
    -    }
    -
    -    if (this._mask)
    -    {
    -        renderSession.maskManager.pushMask(this._mask, renderSession);
    -    }
    -
    -    //  Ignore null sources
    -    if (this.texture.valid)
    -    {
    -        var resolution = this.texture.baseTexture.resolution / renderSession.resolution;
    -
    -        renderSession.context.globalAlpha = this.worldAlpha;
    -
    -        //  Allow for pixel rounding
    -        if (renderSession.roundPixels)
    -        {
    -            renderSession.context.setTransform(
    -                this.worldTransform.a,
    -                this.worldTransform.b,
    -                this.worldTransform.c,
    -                this.worldTransform.d,
    -                (this.worldTransform.tx* renderSession.resolution) | 0,
    -                (this.worldTransform.ty* renderSession.resolution) | 0);
    -        }
    -        else
    -        {
    -            renderSession.context.setTransform(
    -                this.worldTransform.a,
    -                this.worldTransform.b,
    -                this.worldTransform.c,
    -                this.worldTransform.d,
    -                this.worldTransform.tx * renderSession.resolution,
    -                this.worldTransform.ty * renderSession.resolution);
    -        }
    -
    -        //  If smoothingEnabled is supported and we need to change the smoothing property for this texture
    -        if (renderSession.smoothProperty && renderSession.scaleMode !== this.texture.baseTexture.scaleMode)
    -        {
    -            renderSession.scaleMode = this.texture.baseTexture.scaleMode;
    -            renderSession.context[renderSession.smoothProperty] = (renderSession.scaleMode === PIXI.scaleModes.LINEAR);
    -        }
    -
    -        //  If the texture is trimmed we offset by the trim x/y, otherwise we use the frame dimensions
    -        var dx = (this.texture.trim) ? this.texture.trim.x - this.anchor.x * this.texture.trim.width : this.anchor.x * -this.texture.frame.width;
    -        var dy = (this.texture.trim) ? this.texture.trim.y - this.anchor.y * this.texture.trim.height : this.anchor.y * -this.texture.frame.height;
    -
    -        if (this.tint !== 0xFFFFFF)
    -        {
    -            if (this.cachedTint !== this.tint)
    -            {
    -                this.cachedTint = this.tint;
    -
    -                //  TODO clean up caching - how to clean up the caches?
    -                this.tintedTexture = PIXI.CanvasTinter.getTintedTexture(this, this.tint);
    -            }
    -
    -            renderSession.context.drawImage(
    -                                this.tintedTexture,
    -                                0,
    -                                0,
    -                                this.texture.crop.width,
    -                                this.texture.crop.height,
    -                                dx / resolution,
    -                                dy / resolution,
    -                                this.texture.crop.width / resolution,
    -                                this.texture.crop.height / resolution);
    -        }
    -        else
    -        {
    -            renderSession.context.drawImage(
    -                                this.texture.baseTexture.source,
    -                                this.texture.crop.x,
    -                                this.texture.crop.y,
    -                                this.texture.crop.width,
    -                                this.texture.crop.height,
    -                                dx / resolution,
    -                                dy / resolution,
    -                                this.texture.crop.width / resolution,
    -                                this.texture.crop.height / resolution);
    -        }
    -    }
    -
    -    // OVERWRITE
    -    for (var i = 0, j = this.children.length; i < j; i++)
    -    {
    -        this.children[i]._renderCanvas(renderSession);
    -    }
    -
    -    if (this._mask)
    -    {
    -        renderSession.maskManager.popMask(renderSession);
    -    }
    -};
    -
    -// some helper functions..
    -
    -/**
    - *
    - * Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId
    - * The frame ids are created when a Texture packer file has been loaded
    - *
    - * @method fromFrame
    - * @static
    - * @param frameId {String} The frame Id of the texture in the cache
    - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    - */
    -PIXI.Sprite.fromFrame = function(frameId)
    -{
    -    var texture = PIXI.TextureCache[frameId];
    -    if(!texture) throw new Error('The frameId "' + frameId + '" does not exist in the texture cache' + this);
    -    return new PIXI.Sprite(texture);
    -};
    -
    -/**
    - *
    - * Helper function that creates a sprite that will contain a texture based on an image url
    - * If the image is not in the texture cache it will be loaded
    - *
    - * @method fromImage
    - * @static
    - * @param imageId {String} The image url of the texture
    - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    - */
    -PIXI.Sprite.fromImage = function(imageId, crossorigin, scaleMode)
    -{
    -    var texture = PIXI.Texture.fromImage(imageId, crossorigin, scaleMode);
    -    return new PIXI.Sprite(texture);
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_display_SpriteBatch.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_display_SpriteBatch.js.html deleted file mode 100755 index b54f4c1..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_display_SpriteBatch.js.html +++ /dev/null @@ -1,455 +0,0 @@ - - - - - src/pixi/display/SpriteBatch.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/SpriteBatch.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/
    - */
    -
    -/**
    - * The SpriteBatch class is a really fast version of the DisplayObjectContainer 
    - * built solely for speed, so use when you need a lot of sprites or particles.
    - * And it's extremely easy to use : 
    -
    -    var container = new PIXI.SpriteBatch();
    - 
    -    stage.addChild(container);
    - 
    -    for(var i  = 0; i < 100; i++)
    -    {
    -        var sprite = new PIXI.Sprite.fromImage("myImage.png");
    -        container.addChild(sprite);
    -    }
    - * And here you have a hundred sprites that will be renderer at the speed of light
    - *
    - * @class SpriteBatch
    - * @constructor
    - * @param texture {Texture}
    - */
    -
    -//TODO RENAME to PARTICLE CONTAINER?
    -PIXI.SpriteBatch = function(texture)
    -{
    -    PIXI.DisplayObjectContainer.call( this);
    -
    -    this.textureThing = texture;
    -
    -    this.ready = false;
    -};
    -
    -PIXI.SpriteBatch.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
    -PIXI.SpriteBatch.prototype.constructor = PIXI.SpriteBatch;
    -
    -/*
    - * Initialises the spriteBatch
    - *
    - * @method initWebGL
    - * @param gl {WebGLContext} the current WebGL drawing context
    - */
    -PIXI.SpriteBatch.prototype.initWebGL = function(gl)
    -{
    -    // TODO only one needed for the whole engine really?
    -    this.fastSpriteBatch = new PIXI.WebGLFastSpriteBatch(gl);
    -
    -    this.ready = true;
    -};
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.SpriteBatch.prototype.updateTransform = function()
    -{
    -    // TODO don't need to!
    -    PIXI.DisplayObject.prototype.updateTransform.call( this );
    -    //  PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.SpriteBatch.prototype._renderWebGL = function(renderSession)
    -{
    -    if(!this.visible || this.alpha <= 0 || !this.children.length)return;
    -
    -    if(!this.ready)this.initWebGL( renderSession.gl );
    -    
    -    renderSession.spriteBatch.stop();
    -    
    -    renderSession.shaderManager.setShader(renderSession.shaderManager.fastShader);
    -    
    -    this.fastSpriteBatch.begin(this, renderSession);
    -    this.fastSpriteBatch.render(this);
    -
    -    renderSession.spriteBatch.start();
    - 
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.SpriteBatch.prototype._renderCanvas = function(renderSession)
    -{
    -    if(!this.visible || this.alpha <= 0 || !this.children.length)return;
    -    
    -    var context = renderSession.context;
    -    context.globalAlpha = this.worldAlpha;
    -
    -    PIXI.DisplayObject.prototype.updateTransform.call(this);
    -
    -    var transform = this.worldTransform;
    -    // alow for trimming
    -       
    -    var isRotated = true;
    -
    -    for (var i = 0; i < this.children.length; i++) {
    -       
    -        var child = this.children[i];
    -
    -        if(!child.visible)continue;
    -
    -        var texture = child.texture;
    -        var frame = texture.frame;
    -
    -        context.globalAlpha = this.worldAlpha * child.alpha;
    -
    -        if(child.rotation % (Math.PI * 2) === 0)
    -        {
    -            if(isRotated)
    -            {
    -                context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);
    -                isRotated = false;
    -            }
    -
    -            // this is the fastest  way to optimise! - if rotation is 0 then we can avoid any kind of setTransform call
    -            context.drawImage(texture.baseTexture.source,
    -                                 frame.x,
    -                                 frame.y,
    -                                 frame.width,
    -                                 frame.height,
    -                                 ((child.anchor.x) * (-frame.width * child.scale.x) + child.position.x  + 0.5) | 0,
    -                                 ((child.anchor.y) * (-frame.height * child.scale.y) + child.position.y  + 0.5) | 0,
    -                                 frame.width * child.scale.x,
    -                                 frame.height * child.scale.y);
    -        }
    -        else
    -        {
    -            if(!isRotated)isRotated = true;
    -    
    -            PIXI.DisplayObject.prototype.updateTransform.call(child);
    -           
    -            var childTransform = child.worldTransform;
    -
    -            // allow for trimming
    -           
    -            if (renderSession.roundPixels)
    -            {
    -                context.setTransform(childTransform.a, childTransform.b, childTransform.c, childTransform.d, childTransform.tx | 0, childTransform.ty | 0);
    -            }
    -            else
    -            {
    -                context.setTransform(childTransform.a, childTransform.b, childTransform.c, childTransform.d, childTransform.tx, childTransform.ty);
    -            }
    -
    -            context.drawImage(texture.baseTexture.source,
    -                                 frame.x,
    -                                 frame.y,
    -                                 frame.width,
    -                                 frame.height,
    -                                 ((child.anchor.x) * (-frame.width) + 0.5) | 0,
    -                                 ((child.anchor.y) * (-frame.height) + 0.5) | 0,
    -                                 frame.width,
    -                                 frame.height);
    -           
    -
    -        }
    -
    -       // context.restore();
    -    }
    -
    -//    context.restore();
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_display_Stage.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_display_Stage.js.html deleted file mode 100755 index 435f9dd..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_display_Stage.js.html +++ /dev/null @@ -1,413 +0,0 @@ - - - - - src/pixi/display/Stage.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/Stage.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A Stage represents the root of the display tree. Everything connected to the stage is rendered
    - *
    - * @class Stage
    - * @extends DisplayObjectContainer
    - * @constructor
    - * @param backgroundColor {Number} the background color of the stage, you have to pass this in is in hex format
    - *      like: 0xFFFFFF for white
    - * 
    - * Creating a stage is a mandatory process when you use Pixi, which is as simple as this : 
    - * var stage = new PIXI.Stage(0xFFFFFF);
    - * where the parameter given is the background colour of the stage, in hex
    - * you will use this stage instance to add your sprites to it and therefore to the renderer
    - * Here is how to add a sprite to the stage : 
    - * stage.addChild(sprite);
    - */
    -PIXI.Stage = function(backgroundColor)
    -{
    -    PIXI.DisplayObjectContainer.call( this );
    -
    -    /**
    -     * [read-only] Current transform of the object based on world (parent) factors
    -     *
    -     * @property worldTransform
    -     * @type Matrix
    -     * @readOnly
    -     * @private
    -     */
    -    this.worldTransform = new PIXI.Matrix();
    -
    -    /**
    -     * Whether or not the stage is interactive
    -     *
    -     * @property interactive
    -     * @type Boolean
    -     */
    -    this.interactive = true;
    -
    -    /**
    -     * The interaction manage for this stage, manages all interactive activity on the stage
    -     *
    -     * @property interactionManager
    -     * @type InteractionManager
    -     */
    -    this.interactionManager = new PIXI.InteractionManager(this);
    -
    -    /**
    -     * Whether the stage is dirty and needs to have interactions updated
    -     *
    -     * @property dirty
    -     * @type Boolean
    -     * @private
    -     */
    -    this.dirty = true;
    -
    -    //the stage is its own stage
    -    this.stage = this;
    -
    -    //optimize hit detection a bit
    -    this.stage.hitArea = new PIXI.Rectangle(0, 0, 100000, 100000);
    -
    -    this.setBackgroundColor(backgroundColor);
    -};
    -
    -// constructor
    -PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    -PIXI.Stage.prototype.constructor = PIXI.Stage;
    -
    -/**
    - * Sets another DOM element which can receive mouse/touch interactions instead of the default Canvas element.
    - * This is useful for when you have other DOM elements on top of the Canvas element.
    - *
    - * @method setInteractionDelegate
    - * @param domElement {DOMElement} This new domElement which will receive mouse/touch events
    - */
    -PIXI.Stage.prototype.setInteractionDelegate = function(domElement)
    -{
    -    this.interactionManager.setTargetDomElement( domElement );
    -};
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.Stage.prototype.updateTransform = function()
    -{
    -    this.worldAlpha = 1;
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        this.children[i].updateTransform();
    -    }
    -
    -    if(this.dirty)
    -    {
    -        this.dirty = false;
    -        // update interactive!
    -        this.interactionManager.dirty = true;
    -    }
    -
    -    if(this.interactive)this.interactionManager.update();
    -};
    -
    -/**
    - * Sets the background color for the stage
    - *
    - * @method setBackgroundColor
    - * @param backgroundColor {Number} the color of the background, easiest way to pass this in is in hex format
    - *      like: 0xFFFFFF for white
    - */
    -PIXI.Stage.prototype.setBackgroundColor = function(backgroundColor)
    -{
    -    this.backgroundColor = backgroundColor || 0x000000;
    -    this.backgroundColorSplit = PIXI.hex2rgb(this.backgroundColor);
    -    var hex = this.backgroundColor.toString(16);
    -    hex = '000000'.substr(0, 6 - hex.length) + hex;
    -    this.backgroundColorString = '#' + hex;
    -};
    -
    -/**
    - * This will return the point containing global coordinates of the mouse.
    - *
    - * @method getMousePosition
    - * @return {Point} A point containing the coordinates of the global InteractionData position.
    - */
    -PIXI.Stage.prototype.getMousePosition = function()
    -{
    -    return this.interactionManager.mouse.global;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_extras_Rope.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_extras_Rope.js.html deleted file mode 100755 index f4fd44c..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_extras_Rope.js.html +++ /dev/null @@ -1,452 +0,0 @@ - - - - - src/pixi/extras/Rope.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/extras/Rope.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * @copyright Mat Groves, Rovanion Luckey
    - */
    -
    -/**
    - *
    - * @class Rope
    - * @constructor
    - * @extends Strip
    - * @param {Texture} texture - The texture to use on the rope.
    - * @param {Array} points - An array of {PIXI.Point}.
    - *
    - */
    -PIXI.Rope = function(texture, points)
    -{
    -    PIXI.Strip.call( this, texture );
    -    this.points = points;
    -
    -    this.verticies = new PIXI.Float32Array(points.length * 4);
    -    this.uvs = new PIXI.Float32Array(points.length * 4);
    -    this.colors = new PIXI.Float32Array(points.length * 2);
    -    this.indices = new PIXI.Uint16Array(points.length * 2);
    -
    -
    -    this.refresh();
    -};
    -
    -
    -// constructor
    -PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    -PIXI.Rope.prototype.constructor = PIXI.Rope;
    -
    -/*
    - * Refreshes
    - *
    - * @method refresh
    - */
    -PIXI.Rope.prototype.refresh = function()
    -{
    -    var points = this.points;
    -    if(points.length < 1) return;
    -
    -    var uvs = this.uvs;
    -
    -    var lastPoint = points[0];
    -    var indices = this.indices;
    -    var colors = this.colors;
    -
    -    this.count-=0.2;
    -
    -    uvs[0] = 0;
    -    uvs[1] = 0;
    -    uvs[2] = 0;
    -    uvs[3] = 1;
    -
    -    colors[0] = 1;
    -    colors[1] = 1;
    -
    -    indices[0] = 0;
    -    indices[1] = 1;
    -
    -    var total = points.length,
    -        point, index, amount;
    -
    -    for (var i = 1; i < total; i++)
    -    {
    -        point = points[i];
    -        index = i * 4;
    -        // time to do some smart drawing!
    -        amount = i / (total-1);
    -
    -        if(i%2)
    -        {
    -            uvs[index] = amount;
    -            uvs[index+1] = 0;
    -
    -            uvs[index+2] = amount;
    -            uvs[index+3] = 1;
    -        }
    -        else
    -        {
    -            uvs[index] = amount;
    -            uvs[index+1] = 0;
    -
    -            uvs[index+2] = amount;
    -            uvs[index+3] = 1;
    -        }
    -
    -        index = i * 2;
    -        colors[index] = 1;
    -        colors[index+1] = 1;
    -
    -        index = i * 2;
    -        indices[index] = index;
    -        indices[index + 1] = index + 1;
    -
    -        lastPoint = point;
    -    }
    -};
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.Rope.prototype.updateTransform = function()
    -{
    -
    -    var points = this.points;
    -    if(points.length < 1)return;
    -
    -    var lastPoint = points[0];
    -    var nextPoint;
    -    var perp = {x:0, y:0};
    -
    -    this.count-=0.2;
    -
    -    var verticies = this.verticies;
    -    var total = points.length,
    -        point, index, ratio, perpLength, num;
    -
    -    for (var i = 0; i < total; i++)
    -    {
    -        point = points[i];
    -        index = i * 4;
    -
    -        if(i < points.length-1)
    -        {
    -            nextPoint = points[i+1];
    -        }
    -        else
    -        {
    -            nextPoint = point;
    -        }
    -
    -        perp.y = -(nextPoint.x - lastPoint.x);
    -        perp.x = nextPoint.y - lastPoint.y;
    -
    -        ratio = (1 - (i / (total-1))) * 10;
    -
    -        if(ratio > 1) ratio = 1;
    -
    -        perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    -        num = this.texture.height / 2; //(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    -        perp.x /= perpLength;
    -        perp.y /= perpLength;
    -
    -        perp.x *= num;
    -        perp.y *= num;
    -
    -        verticies[index] = point.x + perp.x;
    -        verticies[index+1] = point.y + perp.y;
    -        verticies[index+2] = point.x - perp.x;
    -        verticies[index+3] = point.y - perp.y;
    -
    -        lastPoint = point;
    -    }
    -
    -    PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    -};
    -/*
    - * Sets the texture that the Rope will use
    - *
    - * @method setTexture
    - * @param texture {Texture} the texture that will be used
    - */
    -PIXI.Rope.prototype.setTexture = function(texture)
    -{
    -    // stop current texture
    -    this.texture = texture;
    -    //this.updateFrame = true;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_extras_Spine.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_extras_Spine.js.html deleted file mode 100755 index a534e13..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_extras_Spine.js.html +++ /dev/null @@ -1,1752 +0,0 @@ - - - - - src/pixi/extras/Spine.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/extras/Spine.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * based on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi
    - *
    - * Awesome JS run time provided by EsotericSoftware
    - * https://github.com/EsotericSoftware/spine-runtimes
    - *
    - */
    -
    -/*
    - * Awesome JS run time provided by EsotericSoftware
    - *
    - * https://github.com/EsotericSoftware/spine-runtimes
    - *
    - */
    -
    -
    -
    -var spine = {};
    -
    -spine.BoneData = function (name, parent) {
    -    this.name = name;
    -    this.parent = parent;
    -};
    -spine.BoneData.prototype = {
    -    length: 0,
    -    x: 0, y: 0,
    -    rotation: 0,
    -    scaleX: 1, scaleY: 1
    -};
    -
    -spine.SlotData = function (name, boneData) {
    -    this.name = name;
    -    this.boneData = boneData;
    -};
    -spine.SlotData.prototype = {
    -    r: 1, g: 1, b: 1, a: 1,
    -    attachmentName: null
    -};
    -
    -spine.Bone = function (boneData, parent) {
    -    this.data = boneData;
    -    this.parent = parent;
    -    this.setToSetupPose();
    -};
    -spine.Bone.yDown = false;
    -spine.Bone.prototype = {
    -    x: 0, y: 0,
    -    rotation: 0,
    -    scaleX: 1, scaleY: 1,
    -    m00: 0, m01: 0, worldX: 0, // a b x
    -    m10: 0, m11: 0, worldY: 0, // c d y
    -    worldRotation: 0,
    -    worldScaleX: 1, worldScaleY: 1,
    -    updateWorldTransform: function (flipX, flipY) {
    -        var parent = this.parent;
    -        if (parent != null) {
    -            this.worldX = this.x * parent.m00 + this.y * parent.m01 + parent.worldX;
    -            this.worldY = this.x * parent.m10 + this.y * parent.m11 + parent.worldY;
    -            this.worldScaleX = parent.worldScaleX * this.scaleX;
    -            this.worldScaleY = parent.worldScaleY * this.scaleY;
    -            this.worldRotation = parent.worldRotation + this.rotation;
    -        } else {
    -            this.worldX = this.x;
    -            this.worldY = this.y;
    -            this.worldScaleX = this.scaleX;
    -            this.worldScaleY = this.scaleY;
    -            this.worldRotation = this.rotation;
    -        }
    -        var radians = this.worldRotation * Math.PI / 180;
    -        var cos = Math.cos(radians);
    -        var sin = Math.sin(radians);
    -        this.m00 = cos * this.worldScaleX;
    -        this.m10 = sin * this.worldScaleX;
    -        this.m01 = -sin * this.worldScaleY;
    -        this.m11 = cos * this.worldScaleY;
    -        if (flipX) {
    -            this.m00 = -this.m00;
    -            this.m01 = -this.m01;
    -        }
    -        if (flipY) {
    -            this.m10 = -this.m10;
    -            this.m11 = -this.m11;
    -        }
    -        if (spine.Bone.yDown) {
    -            this.m10 = -this.m10;
    -            this.m11 = -this.m11;
    -        }
    -    },
    -    setToSetupPose: function () {
    -        var data = this.data;
    -        this.x = data.x;
    -        this.y = data.y;
    -        this.rotation = data.rotation;
    -        this.scaleX = data.scaleX;
    -        this.scaleY = data.scaleY;
    -    }
    -};
    -
    -spine.Slot = function (slotData, skeleton, bone) {
    -    this.data = slotData;
    -    this.skeleton = skeleton;
    -    this.bone = bone;
    -    this.setToSetupPose();
    -};
    -spine.Slot.prototype = {
    -    r: 1, g: 1, b: 1, a: 1,
    -    _attachmentTime: 0,
    -    attachment: null,
    -    setAttachment: function (attachment) {
    -        this.attachment = attachment;
    -        this._attachmentTime = this.skeleton.time;
    -    },
    -    setAttachmentTime: function (time) {
    -        this._attachmentTime = this.skeleton.time - time;
    -    },
    -    getAttachmentTime: function () {
    -        return this.skeleton.time - this._attachmentTime;
    -    },
    -    setToSetupPose: function () {
    -        var data = this.data;
    -        this.r = data.r;
    -        this.g = data.g;
    -        this.b = data.b;
    -        this.a = data.a;
    -
    -        var slotDatas = this.skeleton.data.slots;
    -        for (var i = 0, n = slotDatas.length; i < n; i++) {
    -            if (slotDatas[i] == data) {
    -                this.setAttachment(!data.attachmentName ? null : this.skeleton.getAttachmentBySlotIndex(i, data.attachmentName));
    -                break;
    -            }
    -        }
    -    }
    -};
    -
    -spine.Skin = function (name) {
    -    this.name = name;
    -    this.attachments = {};
    -};
    -spine.Skin.prototype = {
    -    addAttachment: function (slotIndex, name, attachment) {
    -        this.attachments[slotIndex + ":" + name] = attachment;
    -    },
    -    getAttachment: function (slotIndex, name) {
    -        return this.attachments[slotIndex + ":" + name];
    -    },
    -    _attachAll: function (skeleton, oldSkin) {
    -        for (var key in oldSkin.attachments) {
    -            var colon = key.indexOf(":");
    -            var slotIndex = parseInt(key.substring(0, colon), 10);
    -            var name = key.substring(colon + 1);
    -            var slot = skeleton.slots[slotIndex];
    -            if (slot.attachment && slot.attachment.name == name) {
    -                var attachment = this.getAttachment(slotIndex, name);
    -                if (attachment) slot.setAttachment(attachment);
    -            }
    -        }
    -    }
    -};
    -
    -spine.Animation = function (name, timelines, duration) {
    -    this.name = name;
    -    this.timelines = timelines;
    -    this.duration = duration;
    -};
    -spine.Animation.prototype = {
    -    apply: function (skeleton, time, loop) {
    -        if (loop && this.duration) time %= this.duration;
    -        var timelines = this.timelines;
    -        for (var i = 0, n = timelines.length; i < n; i++)
    -            timelines[i].apply(skeleton, time, 1);
    -    },
    -    mix: function (skeleton, time, loop, alpha) {
    -        if (loop && this.duration) time %= this.duration;
    -        var timelines = this.timelines;
    -        for (var i = 0, n = timelines.length; i < n; i++)
    -            timelines[i].apply(skeleton, time, alpha);
    -    }
    -};
    -
    -spine.binarySearch = function (values, target, step) {
    -    var low = 0;
    -    var high = Math.floor(values.length / step) - 2;
    -    if (!high) return step;
    -    var current = high >>> 1;
    -    while (true) {
    -        if (values[(current + 1) * step] <= target)
    -            low = current + 1;
    -        else
    -            high = current;
    -        if (low == high) return (low + 1) * step;
    -        current = (low + high) >>> 1;
    -    }
    -};
    -spine.linearSearch = function (values, target, step) {
    -    for (var i = 0, last = values.length - step; i <= last; i += step)
    -        if (values[i] > target) return i;
    -    return -1;
    -};
    -
    -spine.Curves = function (frameCount) {
    -    this.curves = []; // dfx, dfy, ddfx, ddfy, dddfx, dddfy, ...
    -    this.curves.length = (frameCount - 1) * 6;
    -};
    -spine.Curves.prototype = {
    -    setLinear: function (frameIndex) {
    -        this.curves[frameIndex * 6] = 0/*LINEAR*/;
    -    },
    -    setStepped: function (frameIndex) {
    -        this.curves[frameIndex * 6] = -1/*STEPPED*/;
    -    },
    -    /** Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next.
    -     * cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of
    -     * the difference between the keyframe's values. */
    -    setCurve: function (frameIndex, cx1, cy1, cx2, cy2) {
    -        var subdiv_step = 1 / 10/*BEZIER_SEGMENTS*/;
    -        var subdiv_step2 = subdiv_step * subdiv_step;
    -        var subdiv_step3 = subdiv_step2 * subdiv_step;
    -        var pre1 = 3 * subdiv_step;
    -        var pre2 = 3 * subdiv_step2;
    -        var pre4 = 6 * subdiv_step2;
    -        var pre5 = 6 * subdiv_step3;
    -        var tmp1x = -cx1 * 2 + cx2;
    -        var tmp1y = -cy1 * 2 + cy2;
    -        var tmp2x = (cx1 - cx2) * 3 + 1;
    -        var tmp2y = (cy1 - cy2) * 3 + 1;
    -        var i = frameIndex * 6;
    -        var curves = this.curves;
    -        curves[i] = cx1 * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3;
    -        curves[i + 1] = cy1 * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3;
    -        curves[i + 2] = tmp1x * pre4 + tmp2x * pre5;
    -        curves[i + 3] = tmp1y * pre4 + tmp2y * pre5;
    -        curves[i + 4] = tmp2x * pre5;
    -        curves[i + 5] = tmp2y * pre5;
    -    },
    -    getCurvePercent: function (frameIndex, percent) {
    -        percent = percent < 0 ? 0 : (percent > 1 ? 1 : percent);
    -        var curveIndex = frameIndex * 6;
    -        var curves = this.curves;
    -        var dfx = curves[curveIndex];
    -        if (!dfx/*LINEAR*/) return percent;
    -        if (dfx == -1/*STEPPED*/) return 0;
    -        var dfy = curves[curveIndex + 1];
    -        var ddfx = curves[curveIndex + 2];
    -        var ddfy = curves[curveIndex + 3];
    -        var dddfx = curves[curveIndex + 4];
    -        var dddfy = curves[curveIndex + 5];
    -        var x = dfx, y = dfy;
    -        var i = 10/*BEZIER_SEGMENTS*/ - 2;
    -        while (true) {
    -            if (x >= percent) {
    -                var lastX = x - dfx;
    -                var lastY = y - dfy;
    -                return lastY + (y - lastY) * (percent - lastX) / (x - lastX);
    -            }
    -            if (!i) break;
    -            i--;
    -            dfx += ddfx;
    -            dfy += ddfy;
    -            ddfx += dddfx;
    -            ddfy += dddfy;
    -            x += dfx;
    -            y += dfy;
    -        }
    -        return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1.
    -    }
    -};
    -
    -spine.RotateTimeline = function (frameCount) {
    -    this.curves = new spine.Curves(frameCount);
    -    this.frames = []; // time, angle, ...
    -    this.frames.length = frameCount * 2;
    -};
    -spine.RotateTimeline.prototype = {
    -    boneIndex: 0,
    -    getFrameCount: function () {
    -        return this.frames.length / 2;
    -    },
    -    setFrame: function (frameIndex, time, angle) {
    -        frameIndex *= 2;
    -        this.frames[frameIndex] = time;
    -        this.frames[frameIndex + 1] = angle;
    -    },
    -    apply: function (skeleton, time, alpha) {
    -        var frames = this.frames,
    -            amount;
    -
    -        if (time < frames[0]) return; // Time is before first frame.
    -
    -        var bone = skeleton.bones[this.boneIndex];
    -
    -        if (time >= frames[frames.length - 2]) { // Time is after last frame.
    -            amount = bone.data.rotation + frames[frames.length - 1] - bone.rotation;
    -            while (amount > 180)
    -                amount -= 360;
    -            while (amount < -180)
    -                amount += 360;
    -            bone.rotation += amount * alpha;
    -            return;
    -        }
    -
    -        // Interpolate between the last frame and the current frame.
    -        var frameIndex = spine.binarySearch(frames, time, 2);
    -        var lastFrameValue = frames[frameIndex - 1];
    -        var frameTime = frames[frameIndex];
    -        var percent = 1 - (time - frameTime) / (frames[frameIndex - 2/*LAST_FRAME_TIME*/] - frameTime);
    -        percent = this.curves.getCurvePercent(frameIndex / 2 - 1, percent);
    -
    -        amount = frames[frameIndex + 1/*FRAME_VALUE*/] - lastFrameValue;
    -        while (amount > 180)
    -            amount -= 360;
    -        while (amount < -180)
    -            amount += 360;
    -        amount = bone.data.rotation + (lastFrameValue + amount * percent) - bone.rotation;
    -        while (amount > 180)
    -            amount -= 360;
    -        while (amount < -180)
    -            amount += 360;
    -        bone.rotation += amount * alpha;
    -    }
    -};
    -
    -spine.TranslateTimeline = function (frameCount) {
    -    this.curves = new spine.Curves(frameCount);
    -    this.frames = []; // time, x, y, ...
    -    this.frames.length = frameCount * 3;
    -};
    -spine.TranslateTimeline.prototype = {
    -    boneIndex: 0,
    -    getFrameCount: function () {
    -        return this.frames.length / 3;
    -    },
    -    setFrame: function (frameIndex, time, x, y) {
    -        frameIndex *= 3;
    -        this.frames[frameIndex] = time;
    -        this.frames[frameIndex + 1] = x;
    -        this.frames[frameIndex + 2] = y;
    -    },
    -    apply: function (skeleton, time, alpha) {
    -        var frames = this.frames;
    -        if (time < frames[0]) return; // Time is before first frame.
    -
    -        var bone = skeleton.bones[this.boneIndex];
    -
    -        if (time >= frames[frames.length - 3]) { // Time is after last frame.
    -            bone.x += (bone.data.x + frames[frames.length - 2] - bone.x) * alpha;
    -            bone.y += (bone.data.y + frames[frames.length - 1] - bone.y) * alpha;
    -            return;
    -        }
    -
    -        // Interpolate between the last frame and the current frame.
    -        var frameIndex = spine.binarySearch(frames, time, 3);
    -        var lastFrameX = frames[frameIndex - 2];
    -        var lastFrameY = frames[frameIndex - 1];
    -        var frameTime = frames[frameIndex];
    -        var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*LAST_FRAME_TIME*/] - frameTime);
    -        percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent);
    -
    -        bone.x += (bone.data.x + lastFrameX + (frames[frameIndex + 1/*FRAME_X*/] - lastFrameX) * percent - bone.x) * alpha;
    -        bone.y += (bone.data.y + lastFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - lastFrameY) * percent - bone.y) * alpha;
    -    }
    -};
    -
    -spine.ScaleTimeline = function (frameCount) {
    -    this.curves = new spine.Curves(frameCount);
    -    this.frames = []; // time, x, y, ...
    -    this.frames.length = frameCount * 3;
    -};
    -spine.ScaleTimeline.prototype = {
    -    boneIndex: 0,
    -    getFrameCount: function () {
    -        return this.frames.length / 3;
    -    },
    -    setFrame: function (frameIndex, time, x, y) {
    -        frameIndex *= 3;
    -        this.frames[frameIndex] = time;
    -        this.frames[frameIndex + 1] = x;
    -        this.frames[frameIndex + 2] = y;
    -    },
    -    apply: function (skeleton, time, alpha) {
    -        var frames = this.frames;
    -        if (time < frames[0]) return; // Time is before first frame.
    -
    -        var bone = skeleton.bones[this.boneIndex];
    -
    -        if (time >= frames[frames.length - 3]) { // Time is after last frame.
    -            bone.scaleX += (bone.data.scaleX - 1 + frames[frames.length - 2] - bone.scaleX) * alpha;
    -            bone.scaleY += (bone.data.scaleY - 1 + frames[frames.length - 1] - bone.scaleY) * alpha;
    -            return;
    -        }
    -
    -        // Interpolate between the last frame and the current frame.
    -        var frameIndex = spine.binarySearch(frames, time, 3);
    -        var lastFrameX = frames[frameIndex - 2];
    -        var lastFrameY = frames[frameIndex - 1];
    -        var frameTime = frames[frameIndex];
    -        var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*LAST_FRAME_TIME*/] - frameTime);
    -        percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent);
    -
    -        bone.scaleX += (bone.data.scaleX - 1 + lastFrameX + (frames[frameIndex + 1/*FRAME_X*/] - lastFrameX) * percent - bone.scaleX) * alpha;
    -        bone.scaleY += (bone.data.scaleY - 1 + lastFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - lastFrameY) * percent - bone.scaleY) * alpha;
    -    }
    -};
    -
    -spine.ColorTimeline = function (frameCount) {
    -    this.curves = new spine.Curves(frameCount);
    -    this.frames = []; // time, r, g, b, a, ...
    -    this.frames.length = frameCount * 5;
    -};
    -spine.ColorTimeline.prototype = {
    -    slotIndex: 0,
    -    getFrameCount: function () {
    -        return this.frames.length / 5;
    -    },
    -    setFrame: function (frameIndex, time, r, g, b, a) {
    -        frameIndex *= 5;
    -        this.frames[frameIndex] = time;
    -        this.frames[frameIndex + 1] = r;
    -        this.frames[frameIndex + 2] = g;
    -        this.frames[frameIndex + 3] = b;
    -        this.frames[frameIndex + 4] = a;
    -    },
    -    apply: function (skeleton, time, alpha) {
    -        var frames = this.frames;
    -        if (time < frames[0]) return; // Time is before first frame.
    -
    -        var slot = skeleton.slots[this.slotIndex];
    -
    -        if (time >= frames[frames.length - 5]) { // Time is after last frame.
    -            var i = frames.length - 1;
    -            slot.r = frames[i - 3];
    -            slot.g = frames[i - 2];
    -            slot.b = frames[i - 1];
    -            slot.a = frames[i];
    -            return;
    -        }
    -
    -        // Interpolate between the last frame and the current frame.
    -        var frameIndex = spine.binarySearch(frames, time, 5);
    -        var lastFrameR = frames[frameIndex - 4];
    -        var lastFrameG = frames[frameIndex - 3];
    -        var lastFrameB = frames[frameIndex - 2];
    -        var lastFrameA = frames[frameIndex - 1];
    -        var frameTime = frames[frameIndex];
    -        var percent = 1 - (time - frameTime) / (frames[frameIndex - 5/*LAST_FRAME_TIME*/] - frameTime);
    -        percent = this.curves.getCurvePercent(frameIndex / 5 - 1, percent);
    -
    -        var r = lastFrameR + (frames[frameIndex + 1/*FRAME_R*/] - lastFrameR) * percent;
    -        var g = lastFrameG + (frames[frameIndex + 2/*FRAME_G*/] - lastFrameG) * percent;
    -        var b = lastFrameB + (frames[frameIndex + 3/*FRAME_B*/] - lastFrameB) * percent;
    -        var a = lastFrameA + (frames[frameIndex + 4/*FRAME_A*/] - lastFrameA) * percent;
    -        if (alpha < 1) {
    -            slot.r += (r - slot.r) * alpha;
    -            slot.g += (g - slot.g) * alpha;
    -            slot.b += (b - slot.b) * alpha;
    -            slot.a += (a - slot.a) * alpha;
    -        } else {
    -            slot.r = r;
    -            slot.g = g;
    -            slot.b = b;
    -            slot.a = a;
    -        }
    -    }
    -};
    -
    -spine.AttachmentTimeline = function (frameCount) {
    -    this.curves = new spine.Curves(frameCount);
    -    this.frames = []; // time, ...
    -    this.frames.length = frameCount;
    -    this.attachmentNames = []; // time, ...
    -    this.attachmentNames.length = frameCount;
    -};
    -spine.AttachmentTimeline.prototype = {
    -    slotIndex: 0,
    -    getFrameCount: function () {
    -            return this.frames.length;
    -    },
    -    setFrame: function (frameIndex, time, attachmentName) {
    -        this.frames[frameIndex] = time;
    -        this.attachmentNames[frameIndex] = attachmentName;
    -    },
    -    apply: function (skeleton, time, alpha) {
    -        var frames = this.frames;
    -        if (time < frames[0]) return; // Time is before first frame.
    -
    -        var frameIndex;
    -        if (time >= frames[frames.length - 1]) // Time is after last frame.
    -            frameIndex = frames.length - 1;
    -        else
    -            frameIndex = spine.binarySearch(frames, time, 1) - 1;
    -
    -        var attachmentName = this.attachmentNames[frameIndex];
    -        skeleton.slots[this.slotIndex].setAttachment(!attachmentName ? null : skeleton.getAttachmentBySlotIndex(this.slotIndex, attachmentName));
    -    }
    -};
    -
    -spine.SkeletonData = function () {
    -    this.bones = [];
    -    this.slots = [];
    -    this.skins = [];
    -    this.animations = [];
    -};
    -spine.SkeletonData.prototype = {
    -    defaultSkin: null,
    -    /** @return May be null. */
    -    findBone: function (boneName) {
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            if (bones[i].name == boneName) return bones[i];
    -        return null;
    -    },
    -    /** @return -1 if the bone was not found. */
    -    findBoneIndex: function (boneName) {
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            if (bones[i].name == boneName) return i;
    -        return -1;
    -    },
    -    /** @return May be null. */
    -    findSlot: function (slotName) {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.length; i < n; i++) {
    -            if (slots[i].name == slotName) return slot[i];
    -        }
    -        return null;
    -    },
    -    /** @return -1 if the bone was not found. */
    -    findSlotIndex: function (slotName) {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.length; i < n; i++)
    -            if (slots[i].name == slotName) return i;
    -        return -1;
    -    },
    -    /** @return May be null. */
    -    findSkin: function (skinName) {
    -        var skins = this.skins;
    -        for (var i = 0, n = skins.length; i < n; i++)
    -            if (skins[i].name == skinName) return skins[i];
    -        return null;
    -    },
    -    /** @return May be null. */
    -    findAnimation: function (animationName) {
    -        var animations = this.animations;
    -        for (var i = 0, n = animations.length; i < n; i++)
    -            if (animations[i].name == animationName) return animations[i];
    -        return null;
    -    }
    -};
    -
    -spine.Skeleton = function (skeletonData) {
    -    this.data = skeletonData;
    -
    -    this.bones = [];
    -    for (var i = 0, n = skeletonData.bones.length; i < n; i++) {
    -        var boneData = skeletonData.bones[i];
    -        var parent = !boneData.parent ? null : this.bones[skeletonData.bones.indexOf(boneData.parent)];
    -        this.bones.push(new spine.Bone(boneData, parent));
    -    }
    -
    -    this.slots = [];
    -    this.drawOrder = [];
    -    for (i = 0, n = skeletonData.slots.length; i < n; i++) {
    -        var slotData = skeletonData.slots[i];
    -        var bone = this.bones[skeletonData.bones.indexOf(slotData.boneData)];
    -        var slot = new spine.Slot(slotData, this, bone);
    -        this.slots.push(slot);
    -        this.drawOrder.push(slot);
    -    }
    -};
    -spine.Skeleton.prototype = {
    -    x: 0, y: 0,
    -    skin: null,
    -    r: 1, g: 1, b: 1, a: 1,
    -    time: 0,
    -    flipX: false, flipY: false,
    -    /** Updates the world transform for each bone. */
    -    updateWorldTransform: function () {
    -        var flipX = this.flipX;
    -        var flipY = this.flipY;
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            bones[i].updateWorldTransform(flipX, flipY);
    -    },
    -    /** Sets the bones and slots to their setup pose values. */
    -    setToSetupPose: function () {
    -        this.setBonesToSetupPose();
    -        this.setSlotsToSetupPose();
    -    },
    -    setBonesToSetupPose: function () {
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            bones[i].setToSetupPose();
    -    },
    -    setSlotsToSetupPose: function () {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.length; i < n; i++)
    -            slots[i].setToSetupPose(i);
    -    },
    -    /** @return May return null. */
    -    getRootBone: function () {
    -        return this.bones.length ? this.bones[0] : null;
    -    },
    -    /** @return May be null. */
    -    findBone: function (boneName) {
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            if (bones[i].data.name == boneName) return bones[i];
    -        return null;
    -    },
    -    /** @return -1 if the bone was not found. */
    -    findBoneIndex: function (boneName) {
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            if (bones[i].data.name == boneName) return i;
    -        return -1;
    -    },
    -    /** @return May be null. */
    -    findSlot: function (slotName) {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.length; i < n; i++)
    -            if (slots[i].data.name == slotName) return slots[i];
    -        return null;
    -    },
    -    /** @return -1 if the bone was not found. */
    -    findSlotIndex: function (slotName) {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.length; i < n; i++)
    -            if (slots[i].data.name == slotName) return i;
    -        return -1;
    -    },
    -    setSkinByName: function (skinName) {
    -        var skin = this.data.findSkin(skinName);
    -        if (!skin) throw "Skin not found: " + skinName;
    -        this.setSkin(skin);
    -    },
    -    /** Sets the skin used to look up attachments not found in the {@link SkeletonData#getDefaultSkin() default skin}. Attachments
    -     * from the new skin are attached if the corresponding attachment from the old skin was attached.
    -     * @param newSkin May be null. */
    -    setSkin: function (newSkin) {
    -        if (this.skin && newSkin) newSkin._attachAll(this, this.skin);
    -        this.skin = newSkin;
    -    },
    -    /** @return May be null. */
    -    getAttachmentBySlotName: function (slotName, attachmentName) {
    -        return this.getAttachmentBySlotIndex(this.data.findSlotIndex(slotName), attachmentName);
    -    },
    -    /** @return May be null. */
    -    getAttachmentBySlotIndex: function (slotIndex, attachmentName) {
    -        if (this.skin) {
    -            var attachment = this.skin.getAttachment(slotIndex, attachmentName);
    -            if (attachment) return attachment;
    -        }
    -        if (this.data.defaultSkin) return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);
    -        return null;
    -    },
    -    /** @param attachmentName May be null. */
    -    setAttachment: function (slotName, attachmentName) {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.size; i < n; i++) {
    -            var slot = slots[i];
    -            if (slot.data.name == slotName) {
    -                var attachment = null;
    -                if (attachmentName) {
    -                    attachment = this.getAttachment(i, attachmentName);
    -                    if (attachment == null) throw "Attachment not found: " + attachmentName + ", for slot: " + slotName;
    -                }
    -                slot.setAttachment(attachment);
    -                return;
    -            }
    -        }
    -        throw "Slot not found: " + slotName;
    -    },
    -    update: function (delta) {
    -        time += delta;
    -    }
    -};
    -
    -spine.AttachmentType = {
    -    region: 0
    -};
    -
    -spine.RegionAttachment = function () {
    -    this.offset = [];
    -    this.offset.length = 8;
    -    this.uvs = [];
    -    this.uvs.length = 8;
    -};
    -spine.RegionAttachment.prototype = {
    -    x: 0, y: 0,
    -    rotation: 0,
    -    scaleX: 1, scaleY: 1,
    -    width: 0, height: 0,
    -    rendererObject: null,
    -    regionOffsetX: 0, regionOffsetY: 0,
    -    regionWidth: 0, regionHeight: 0,
    -    regionOriginalWidth: 0, regionOriginalHeight: 0,
    -    setUVs: function (u, v, u2, v2, rotate) {
    -        var uvs = this.uvs;
    -        if (rotate) {
    -            uvs[2/*X2*/] = u;
    -            uvs[3/*Y2*/] = v2;
    -            uvs[4/*X3*/] = u;
    -            uvs[5/*Y3*/] = v;
    -            uvs[6/*X4*/] = u2;
    -            uvs[7/*Y4*/] = v;
    -            uvs[0/*X1*/] = u2;
    -            uvs[1/*Y1*/] = v2;
    -        } else {
    -            uvs[0/*X1*/] = u;
    -            uvs[1/*Y1*/] = v2;
    -            uvs[2/*X2*/] = u;
    -            uvs[3/*Y2*/] = v;
    -            uvs[4/*X3*/] = u2;
    -            uvs[5/*Y3*/] = v;
    -            uvs[6/*X4*/] = u2;
    -            uvs[7/*Y4*/] = v2;
    -        }
    -    },
    -    updateOffset: function () {
    -        var regionScaleX = this.width / this.regionOriginalWidth * this.scaleX;
    -        var regionScaleY = this.height / this.regionOriginalHeight * this.scaleY;
    -        var localX = -this.width / 2 * this.scaleX + this.regionOffsetX * regionScaleX;
    -        var localY = -this.height / 2 * this.scaleY + this.regionOffsetY * regionScaleY;
    -        var localX2 = localX + this.regionWidth * regionScaleX;
    -        var localY2 = localY + this.regionHeight * regionScaleY;
    -        var radians = this.rotation * Math.PI / 180;
    -        var cos = Math.cos(radians);
    -        var sin = Math.sin(radians);
    -        var localXCos = localX * cos + this.x;
    -        var localXSin = localX * sin;
    -        var localYCos = localY * cos + this.y;
    -        var localYSin = localY * sin;
    -        var localX2Cos = localX2 * cos + this.x;
    -        var localX2Sin = localX2 * sin;
    -        var localY2Cos = localY2 * cos + this.y;
    -        var localY2Sin = localY2 * sin;
    -        var offset = this.offset;
    -        offset[0/*X1*/] = localXCos - localYSin;
    -        offset[1/*Y1*/] = localYCos + localXSin;
    -        offset[2/*X2*/] = localXCos - localY2Sin;
    -        offset[3/*Y2*/] = localY2Cos + localXSin;
    -        offset[4/*X3*/] = localX2Cos - localY2Sin;
    -        offset[5/*Y3*/] = localY2Cos + localX2Sin;
    -        offset[6/*X4*/] = localX2Cos - localYSin;
    -        offset[7/*Y4*/] = localYCos + localX2Sin;
    -    },
    -    computeVertices: function (x, y, bone, vertices) {
    -        x += bone.worldX;
    -        y += bone.worldY;
    -        var m00 = bone.m00;
    -        var m01 = bone.m01;
    -        var m10 = bone.m10;
    -        var m11 = bone.m11;
    -        var offset = this.offset;
    -        vertices[0/*X1*/] = offset[0/*X1*/] * m00 + offset[1/*Y1*/] * m01 + x;
    -        vertices[1/*Y1*/] = offset[0/*X1*/] * m10 + offset[1/*Y1*/] * m11 + y;
    -        vertices[2/*X2*/] = offset[2/*X2*/] * m00 + offset[3/*Y2*/] * m01 + x;
    -        vertices[3/*Y2*/] = offset[2/*X2*/] * m10 + offset[3/*Y2*/] * m11 + y;
    -        vertices[4/*X3*/] = offset[4/*X3*/] * m00 + offset[5/*X3*/] * m01 + x;
    -        vertices[5/*X3*/] = offset[4/*X3*/] * m10 + offset[5/*X3*/] * m11 + y;
    -        vertices[6/*X4*/] = offset[6/*X4*/] * m00 + offset[7/*Y4*/] * m01 + x;
    -        vertices[7/*Y4*/] = offset[6/*X4*/] * m10 + offset[7/*Y4*/] * m11 + y;
    -    }
    -}
    -
    -spine.AnimationStateData = function (skeletonData) {
    -    this.skeletonData = skeletonData;
    -    this.animationToMixTime = {};
    -};
    -spine.AnimationStateData.prototype = {
    -        defaultMix: 0,
    -    setMixByName: function (fromName, toName, duration) {
    -        var from = this.skeletonData.findAnimation(fromName);
    -        if (!from) throw "Animation not found: " + fromName;
    -        var to = this.skeletonData.findAnimation(toName);
    -        if (!to) throw "Animation not found: " + toName;
    -        this.setMix(from, to, duration);
    -    },
    -    setMix: function (from, to, duration) {
    -        this.animationToMixTime[from.name + ":" + to.name] = duration;
    -    },
    -    getMix: function (from, to) {
    -        var time = this.animationToMixTime[from.name + ":" + to.name];
    -            return time ? time : this.defaultMix;
    -    }
    -};
    -
    -spine.AnimationState = function (stateData) {
    -    this.data = stateData;
    -    this.queue = [];
    -};
    -spine.AnimationState.prototype = {
    -    animationSpeed: 1,
    -    current: null,
    -    previous: null,
    -    currentTime: 0,
    -    previousTime: 0,
    -    currentLoop: false,
    -    previousLoop: false,
    -    mixTime: 0,
    -    mixDuration: 0,
    -    update: function (delta) {
    -        this.currentTime += (delta * this.animationSpeed); //timeScale: Multiply delta by the speed of animation required.
    -        this.previousTime += delta;
    -        this.mixTime += delta;
    -
    -        if (this.queue.length > 0) {
    -            var entry = this.queue[0];
    -            if (this.currentTime >= entry.delay) {
    -                this._setAnimation(entry.animation, entry.loop);
    -                this.queue.shift();
    -            }
    -        }
    -    },
    -    apply: function (skeleton) {
    -        if (!this.current) return;
    -        if (this.previous) {
    -            this.previous.apply(skeleton, this.previousTime, this.previousLoop);
    -            var alpha = this.mixTime / this.mixDuration;
    -            if (alpha >= 1) {
    -                alpha = 1;
    -                this.previous = null;
    -            }
    -            this.current.mix(skeleton, this.currentTime, this.currentLoop, alpha);
    -        } else
    -            this.current.apply(skeleton, this.currentTime, this.currentLoop);
    -    },
    -    clearAnimation: function () {
    -        this.previous = null;
    -        this.current = null;
    -        this.queue.length = 0;
    -    },
    -    _setAnimation: function (animation, loop) {
    -        this.previous = null;
    -        if (animation && this.current) {
    -            this.mixDuration = this.data.getMix(this.current, animation);
    -            if (this.mixDuration > 0) {
    -                this.mixTime = 0;
    -                this.previous = this.current;
    -                this.previousTime = this.currentTime;
    -                this.previousLoop = this.currentLoop;
    -            }
    -        }
    -        this.current = animation;
    -        this.currentLoop = loop;
    -        this.currentTime = 0;
    -    },
    -    /** @see #setAnimation(Animation, Boolean) */
    -    setAnimationByName: function (animationName, loop) {
    -        var animation = this.data.skeletonData.findAnimation(animationName);
    -        if (!animation) throw "Animation not found: " + animationName;
    -        this.setAnimation(animation, loop);
    -    },
    -    /** Set the current animation. Any queued animations are cleared and the current animation time is set to 0.
    -     * @param animation May be null. */
    -    setAnimation: function (animation, loop) {
    -        this.queue.length = 0;
    -        this._setAnimation(animation, loop);
    -    },
    -    /** @see #addAnimation(Animation, Boolean, Number) */
    -    addAnimationByName: function (animationName, loop, delay) {
    -        var animation = this.data.skeletonData.findAnimation(animationName);
    -        if (!animation) throw "Animation not found: " + animationName;
    -        this.addAnimation(animation, loop, delay);
    -    },
    -    /** Adds an animation to be played delay seconds after the current or last queued animation.
    -     * @param delay May be <= 0 to use duration of previous animation minus any mix duration plus the negative delay. */
    -    addAnimation: function (animation, loop, delay) {
    -        var entry = {};
    -        entry.animation = animation;
    -        entry.loop = loop;
    -
    -        if (!delay || delay <= 0) {
    -            var previousAnimation = this.queue.length ? this.queue[this.queue.length - 1].animation : this.current;
    -            if (previousAnimation != null)
    -                delay = previousAnimation.duration - this.data.getMix(previousAnimation, animation) + (delay || 0);
    -            else
    -                delay = 0;
    -        }
    -        entry.delay = delay;
    -
    -        this.queue.push(entry);
    -    },
    -    /** Returns true if no animation is set or if the current time is greater than the animation duration, regardless of looping. */
    -    isComplete: function () {
    -        return !this.current || this.currentTime >= this.current.duration;
    -    }
    -};
    -
    -spine.SkeletonJson = function (attachmentLoader) {
    -    this.attachmentLoader = attachmentLoader;
    -};
    -spine.SkeletonJson.prototype = {
    -    scale: 1,
    -    readSkeletonData: function (root) {
    -        /*jshint -W069*/
    -        var skeletonData = new spine.SkeletonData(),
    -            boneData;
    -
    -        // Bones.
    -        var bones = root["bones"];
    -        for (var i = 0, n = bones.length; i < n; i++) {
    -            var boneMap = bones[i];
    -            var parent = null;
    -            if (boneMap["parent"]) {
    -                parent = skeletonData.findBone(boneMap["parent"]);
    -                if (!parent) throw "Parent bone not found: " + boneMap["parent"];
    -            }
    -            boneData = new spine.BoneData(boneMap["name"], parent);
    -            boneData.length = (boneMap["length"] || 0) * this.scale;
    -            boneData.x = (boneMap["x"] || 0) * this.scale;
    -            boneData.y = (boneMap["y"] || 0) * this.scale;
    -            boneData.rotation = (boneMap["rotation"] || 0);
    -            boneData.scaleX = boneMap["scaleX"] || 1;
    -            boneData.scaleY = boneMap["scaleY"] || 1;
    -            skeletonData.bones.push(boneData);
    -        }
    -
    -        // Slots.
    -        var slots = root["slots"];
    -        for (i = 0, n = slots.length; i < n; i++) {
    -            var slotMap = slots[i];
    -            boneData = skeletonData.findBone(slotMap["bone"]);
    -            if (!boneData) throw "Slot bone not found: " + slotMap["bone"];
    -            var slotData = new spine.SlotData(slotMap["name"], boneData);
    -
    -            var color = slotMap["color"];
    -            if (color) {
    -                slotData.r = spine.SkeletonJson.toColor(color, 0);
    -                slotData.g = spine.SkeletonJson.toColor(color, 1);
    -                slotData.b = spine.SkeletonJson.toColor(color, 2);
    -                slotData.a = spine.SkeletonJson.toColor(color, 3);
    -            }
    -
    -            slotData.attachmentName = slotMap["attachment"];
    -
    -            skeletonData.slots.push(slotData);
    -        }
    -
    -        // Skins.
    -        var skins = root["skins"];
    -        for (var skinName in skins) {
    -            if (!skins.hasOwnProperty(skinName)) continue;
    -            var skinMap = skins[skinName];
    -            var skin = new spine.Skin(skinName);
    -            for (var slotName in skinMap) {
    -                if (!skinMap.hasOwnProperty(slotName)) continue;
    -                var slotIndex = skeletonData.findSlotIndex(slotName);
    -                var slotEntry = skinMap[slotName];
    -                for (var attachmentName in slotEntry) {
    -                    if (!slotEntry.hasOwnProperty(attachmentName)) continue;
    -                    var attachment = this.readAttachment(skin, attachmentName, slotEntry[attachmentName]);
    -                    if (attachment != null) skin.addAttachment(slotIndex, attachmentName, attachment);
    -                }
    -            }
    -            skeletonData.skins.push(skin);
    -            if (skin.name == "default") skeletonData.defaultSkin = skin;
    -        }
    -
    -        // Animations.
    -        var animations = root["animations"];
    -        for (var animationName in animations) {
    -            if (!animations.hasOwnProperty(animationName)) continue;
    -            this.readAnimation(animationName, animations[animationName], skeletonData);
    -        }
    -
    -        return skeletonData;
    -    },
    -    readAttachment: function (skin, name, map) {
    -        /*jshint -W069*/
    -        name = map["name"] || name;
    -
    -        var type = spine.AttachmentType[map["type"] || "region"];
    -
    -        if (type == spine.AttachmentType.region) {
    -            var attachment = new spine.RegionAttachment();
    -            attachment.x = (map["x"] || 0) * this.scale;
    -            attachment.y = (map["y"] || 0) * this.scale;
    -            attachment.scaleX = map["scaleX"] || 1;
    -            attachment.scaleY = map["scaleY"] || 1;
    -            attachment.rotation = map["rotation"] || 0;
    -            attachment.width = (map["width"] || 32) * this.scale;
    -            attachment.height = (map["height"] || 32) * this.scale;
    -            attachment.updateOffset();
    -
    -            attachment.rendererObject = {};
    -            attachment.rendererObject.name = name;
    -            attachment.rendererObject.scale = {};
    -            attachment.rendererObject.scale.x = attachment.scaleX;
    -            attachment.rendererObject.scale.y = attachment.scaleY;
    -            attachment.rendererObject.rotation = -attachment.rotation * Math.PI / 180;
    -            return attachment;
    -        }
    -
    -            throw "Unknown attachment type: " + type;
    -    },
    -
    -    readAnimation: function (name, map, skeletonData) {
    -        /*jshint -W069*/
    -        var timelines = [];
    -        var duration = 0;
    -        var frameIndex, timeline, timelineName, valueMap, values,
    -            i, n;
    -
    -        var bones = map["bones"];
    -        for (var boneName in bones) {
    -            if (!bones.hasOwnProperty(boneName)) continue;
    -            var boneIndex = skeletonData.findBoneIndex(boneName);
    -            if (boneIndex == -1) throw "Bone not found: " + boneName;
    -            var boneMap = bones[boneName];
    -
    -            for (timelineName in boneMap) {
    -                if (!boneMap.hasOwnProperty(timelineName)) continue;
    -                values = boneMap[timelineName];
    -                if (timelineName == "rotate") {
    -                    timeline = new spine.RotateTimeline(values.length);
    -                    timeline.boneIndex = boneIndex;
    -
    -                    frameIndex = 0;
    -                    for (i = 0, n = values.length; i < n; i++) {
    -                        valueMap = values[i];
    -                        timeline.setFrame(frameIndex, valueMap["time"], valueMap["angle"]);
    -                        spine.SkeletonJson.readCurve(timeline, frameIndex, valueMap);
    -                        frameIndex++;
    -                    }
    -                    timelines.push(timeline);
    -                    duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 2 - 2]);
    -
    -                } else if (timelineName == "translate" || timelineName == "scale") {
    -                    var timelineScale = 1;
    -                    if (timelineName == "scale")
    -                        timeline = new spine.ScaleTimeline(values.length);
    -                    else {
    -                        timeline = new spine.TranslateTimeline(values.length);
    -                        timelineScale = this.scale;
    -                    }
    -                    timeline.boneIndex = boneIndex;
    -
    -                    frameIndex = 0;
    -                    for (i = 0, n = values.length; i < n; i++) {
    -                        valueMap = values[i];
    -                        var x = (valueMap["x"] || 0) * timelineScale;
    -                        var y = (valueMap["y"] || 0) * timelineScale;
    -                        timeline.setFrame(frameIndex, valueMap["time"], x, y);
    -                        spine.SkeletonJson.readCurve(timeline, frameIndex, valueMap);
    -                        frameIndex++;
    -                    }
    -                    timelines.push(timeline);
    -                    duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 3 - 3]);
    -
    -                } else
    -                    throw "Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")";
    -            }
    -        }
    -        var slots = map["slots"];
    -        for (var slotName in slots) {
    -            if (!slots.hasOwnProperty(slotName)) continue;
    -            var slotMap = slots[slotName];
    -            var slotIndex = skeletonData.findSlotIndex(slotName);
    -
    -            for (timelineName in slotMap) {
    -                if (!slotMap.hasOwnProperty(timelineName)) continue;
    -                values = slotMap[timelineName];
    -                if (timelineName == "color") {
    -                    timeline = new spine.ColorTimeline(values.length);
    -                    timeline.slotIndex = slotIndex;
    -
    -                    frameIndex = 0;
    -                    for (i = 0, n = values.length; i < n; i++) {
    -                        valueMap = values[i];
    -                        var color = valueMap["color"];
    -                        var r = spine.SkeletonJson.toColor(color, 0);
    -                        var g = spine.SkeletonJson.toColor(color, 1);
    -                        var b = spine.SkeletonJson.toColor(color, 2);
    -                        var a = spine.SkeletonJson.toColor(color, 3);
    -                        timeline.setFrame(frameIndex, valueMap["time"], r, g, b, a);
    -                        spine.SkeletonJson.readCurve(timeline, frameIndex, valueMap);
    -                        frameIndex++;
    -                    }
    -                    timelines.push(timeline);
    -                    duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 5 - 5]);
    -
    -                } else if (timelineName == "attachment") {
    -                    timeline = new spine.AttachmentTimeline(values.length);
    -                    timeline.slotIndex = slotIndex;
    -
    -                    frameIndex = 0;
    -                    for (i = 0, n = values.length; i < n; i++) {
    -                        valueMap = values[i];
    -                        timeline.setFrame(frameIndex++, valueMap["time"], valueMap["name"]);
    -                    }
    -                    timelines.push(timeline);
    -                        duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);
    -
    -                } else
    -                    throw "Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")";
    -            }
    -        }
    -        skeletonData.animations.push(new spine.Animation(name, timelines, duration));
    -    }
    -};
    -spine.SkeletonJson.readCurve = function (timeline, frameIndex, valueMap) {
    -    /*jshint -W069*/
    -    var curve = valueMap["curve"];
    -    if (!curve) return;
    -    if (curve == "stepped")
    -        timeline.curves.setStepped(frameIndex);
    -    else if (curve instanceof Array)
    -        timeline.curves.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]);
    -};
    -spine.SkeletonJson.toColor = function (hexString, colorIndex) {
    -    if (hexString.length != 8) throw "Color hexidecimal length must be 8, recieved: " + hexString;
    -    return parseInt(hexString.substr(colorIndex * 2, 2), 16) / 255;
    -};
    -
    -spine.Atlas = function (atlasText, textureLoader) {
    -    this.textureLoader = textureLoader;
    -    this.pages = [];
    -    this.regions = [];
    -
    -    var reader = new spine.AtlasReader(atlasText);
    -    var tuple = [];
    -    tuple.length = 4;
    -    var page = null;
    -    while (true) {
    -        var line = reader.readLine();
    -        if (line == null) break;
    -        line = reader.trim(line);
    -        if (!line.length)
    -            page = null;
    -        else if (!page) {
    -            page = new spine.AtlasPage();
    -            page.name = line;
    -
    -            page.format = spine.Atlas.Format[reader.readValue()];
    -
    -            reader.readTuple(tuple);
    -            page.minFilter = spine.Atlas.TextureFilter[tuple[0]];
    -            page.magFilter = spine.Atlas.TextureFilter[tuple[1]];
    -
    -            var direction = reader.readValue();
    -            page.uWrap = spine.Atlas.TextureWrap.clampToEdge;
    -            page.vWrap = spine.Atlas.TextureWrap.clampToEdge;
    -            if (direction == "x")
    -                page.uWrap = spine.Atlas.TextureWrap.repeat;
    -            else if (direction == "y")
    -                page.vWrap = spine.Atlas.TextureWrap.repeat;
    -            else if (direction == "xy")
    -                page.uWrap = page.vWrap = spine.Atlas.TextureWrap.repeat;
    -
    -            textureLoader.load(page, line);
    -
    -            this.pages.push(page);
    -
    -        } else {
    -            var region = new spine.AtlasRegion();
    -            region.name = line;
    -            region.page = page;
    -
    -            region.rotate = reader.readValue() == "true";
    -
    -            reader.readTuple(tuple);
    -            var x = parseInt(tuple[0], 10);
    -            var y = parseInt(tuple[1], 10);
    -
    -            reader.readTuple(tuple);
    -            var width = parseInt(tuple[0], 10);
    -            var height = parseInt(tuple[1], 10);
    -
    -            region.u = x / page.width;
    -            region.v = y / page.height;
    -            if (region.rotate) {
    -                region.u2 = (x + height) / page.width;
    -                region.v2 = (y + width) / page.height;
    -            } else {
    -                region.u2 = (x + width) / page.width;
    -                region.v2 = (y + height) / page.height;
    -            }
    -            region.x = x;
    -            region.y = y;
    -            region.width = Math.abs(width);
    -            region.height = Math.abs(height);
    -
    -            if (reader.readTuple(tuple) == 4) { // split is optional
    -                region.splits = [parseInt(tuple[0], 10), parseInt(tuple[1], 10), parseInt(tuple[2], 10), parseInt(tuple[3], 10)];
    -
    -                if (reader.readTuple(tuple) == 4) { // pad is optional, but only present with splits
    -                    region.pads = [parseInt(tuple[0], 10), parseInt(tuple[1], 10), parseInt(tuple[2], 10), parseInt(tuple[3], 10)];
    -
    -                    reader.readTuple(tuple);
    -                }
    -            }
    -
    -            region.originalWidth = parseInt(tuple[0], 10);
    -            region.originalHeight = parseInt(tuple[1], 10);
    -
    -            reader.readTuple(tuple);
    -            region.offsetX = parseInt(tuple[0], 10);
    -            region.offsetY = parseInt(tuple[1], 10);
    -
    -            region.index = parseInt(reader.readValue(), 10);
    -
    -            this.regions.push(region);
    -        }
    -    }
    -};
    -spine.Atlas.prototype = {
    -    findRegion: function (name) {
    -        var regions = this.regions;
    -        for (var i = 0, n = regions.length; i < n; i++)
    -            if (regions[i].name == name) return regions[i];
    -        return null;
    -    },
    -    dispose: function () {
    -        var pages = this.pages;
    -        for (var i = 0, n = pages.length; i < n; i++)
    -            this.textureLoader.unload(pages[i].rendererObject);
    -    },
    -    updateUVs: function (page) {
    -        var regions = this.regions;
    -        for (var i = 0, n = regions.length; i < n; i++) {
    -            var region = regions[i];
    -            if (region.page != page) continue;
    -            region.u = region.x / page.width;
    -            region.v = region.y / page.height;
    -            if (region.rotate) {
    -                region.u2 = (region.x + region.height) / page.width;
    -                region.v2 = (region.y + region.width) / page.height;
    -            } else {
    -                region.u2 = (region.x + region.width) / page.width;
    -                region.v2 = (region.y + region.height) / page.height;
    -            }
    -        }
    -    }
    -};
    -
    -spine.Atlas.Format = {
    -    alpha: 0,
    -    intensity: 1,
    -    luminanceAlpha: 2,
    -    rgb565: 3,
    -    rgba4444: 4,
    -    rgb888: 5,
    -    rgba8888: 6
    -};
    -
    -spine.Atlas.TextureFilter = {
    -    nearest: 0,
    -    linear: 1,
    -    mipMap: 2,
    -    mipMapNearestNearest: 3,
    -    mipMapLinearNearest: 4,
    -    mipMapNearestLinear: 5,
    -    mipMapLinearLinear: 6
    -};
    -
    -spine.Atlas.TextureWrap = {
    -    mirroredRepeat: 0,
    -    clampToEdge: 1,
    -    repeat: 2
    -};
    -
    -spine.AtlasPage = function () {};
    -spine.AtlasPage.prototype = {
    -    name: null,
    -    format: null,
    -    minFilter: null,
    -    magFilter: null,
    -    uWrap: null,
    -    vWrap: null,
    -    rendererObject: null,
    -    width: 0,
    -    height: 0
    -};
    -
    -spine.AtlasRegion = function () {};
    -spine.AtlasRegion.prototype = {
    -    page: null,
    -    name: null,
    -    x: 0, y: 0,
    -    width: 0, height: 0,
    -    u: 0, v: 0, u2: 0, v2: 0,
    -    offsetX: 0, offsetY: 0,
    -    originalWidth: 0, originalHeight: 0,
    -    index: 0,
    -    rotate: false,
    -    splits: null,
    -    pads: null
    -};
    -
    -spine.AtlasReader = function (text) {
    -    this.lines = text.split(/\r\n|\r|\n/);
    -};
    -spine.AtlasReader.prototype = {
    -    index: 0,
    -    trim: function (value) {
    -        return value.replace(/^\s+|\s+$/g, "");
    -    },
    -    readLine: function () {
    -        if (this.index >= this.lines.length) return null;
    -        return this.lines[this.index++];
    -    },
    -    readValue: function () {
    -        var line = this.readLine();
    -        var colon = line.indexOf(":");
    -        if (colon == -1) throw "Invalid line: " + line;
    -        return this.trim(line.substring(colon + 1));
    -    },
    -    /** Returns the number of tuple values read (2 or 4). */
    -    readTuple: function (tuple) {
    -        var line = this.readLine();
    -        var colon = line.indexOf(":");
    -        if (colon == -1) throw "Invalid line: " + line;
    -        var i = 0, lastMatch= colon + 1;
    -        for (; i < 3; i++) {
    -            var comma = line.indexOf(",", lastMatch);
    -            if (comma == -1) {
    -                if (!i) throw "Invalid line: " + line;
    -                break;
    -            }
    -            tuple[i] = this.trim(line.substr(lastMatch, comma - lastMatch));
    -            lastMatch = comma + 1;
    -        }
    -        tuple[i] = this.trim(line.substring(lastMatch));
    -        return i + 1;
    -    }
    -}
    -
    -spine.AtlasAttachmentLoader = function (atlas) {
    -    this.atlas = atlas;
    -}
    -spine.AtlasAttachmentLoader.prototype = {
    -    newAttachment: function (skin, type, name) {
    -        switch (type) {
    -        case spine.AttachmentType.region:
    -            var region = this.atlas.findRegion(name);
    -            if (!region) throw "Region not found in atlas: " + name + " (" + type + ")";
    -            var attachment = new spine.RegionAttachment(name);
    -            attachment.rendererObject = region;
    -            attachment.setUVs(region.u, region.v, region.u2, region.v2, region.rotate);
    -            attachment.regionOffsetX = region.offsetX;
    -            attachment.regionOffsetY = region.offsetY;
    -            attachment.regionWidth = region.width;
    -            attachment.regionHeight = region.height;
    -            attachment.regionOriginalWidth = region.originalWidth;
    -            attachment.regionOriginalHeight = region.originalHeight;
    -            return attachment;
    -        }
    -        throw "Unknown attachment type: " + type;
    -    }
    -}
    -
    -spine.Bone.yDown = true;
    -PIXI.AnimCache = {};
    -
    -/**
    - * A class that enables the you to import and run your spine animations in pixi.
    - * Spine animation data needs to be loaded using the PIXI.AssetLoader or PIXI.SpineLoader before it can be used by this class
    - * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source
    - *
    - * @class Spine
    - * @extends DisplayObjectContainer
    - * @constructor
    - * @param url {String} The url of the spine anim file to be used
    - */
    -PIXI.Spine = function (url) {
    -    PIXI.DisplayObjectContainer.call(this);
    -
    -    this.spineData = PIXI.AnimCache[url];
    -
    -    if (!this.spineData) {
    -        throw new Error("Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: " + url);
    -    }
    -
    -    this.skeleton = new spine.Skeleton(this.spineData);
    -    this.skeleton.updateWorldTransform();
    -
    -    this.stateData = new spine.AnimationStateData(this.spineData);
    -    this.state = new spine.AnimationState(this.stateData);
    -
    -    this.slotContainers = [];
    -
    -    for (var i = 0, n = this.skeleton.drawOrder.length; i < n; i++) {
    -        var slot = this.skeleton.drawOrder[i];
    -        var attachment = slot.attachment;
    -        var slotContainer = new PIXI.DisplayObjectContainer();
    -        this.slotContainers.push(slotContainer);
    -        this.addChild(slotContainer);
    -        if (!(attachment instanceof spine.RegionAttachment)) {
    -            continue;
    -        }
    -        var spriteName = attachment.rendererObject.name;
    -        var sprite = this.createSprite(slot, attachment.rendererObject);
    -        slot.currentSprite = sprite;
    -        slot.currentSpriteName = spriteName;
    -        slotContainer.addChild(sprite);
    -    }
    -};
    -
    -PIXI.Spine.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
    -PIXI.Spine.prototype.constructor = PIXI.Spine;
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.Spine.prototype.updateTransform = function () {
    -    this.lastTime = this.lastTime || Date.now();
    -    var timeDelta = (Date.now() - this.lastTime) * 0.001;
    -    this.lastTime = Date.now();
    -    this.state.update(timeDelta);
    -    this.state.apply(this.skeleton);
    -    this.skeleton.updateWorldTransform();
    -
    -    var drawOrder = this.skeleton.drawOrder;
    -    for (var i = 0, n = drawOrder.length; i < n; i++) {
    -        var slot = drawOrder[i];
    -        var attachment = slot.attachment;
    -        var slotContainer = this.slotContainers[i];
    -        if (!(attachment instanceof spine.RegionAttachment)) {
    -            slotContainer.visible = false;
    -            continue;
    -        }
    -
    -        if (attachment.rendererObject) {
    -            if (!slot.currentSpriteName || slot.currentSpriteName != attachment.name) {
    -                var spriteName = attachment.rendererObject.name;
    -                if (slot.currentSprite !== undefined) {
    -                    slot.currentSprite.visible = false;
    -                }
    -                slot.sprites = slot.sprites || {};
    -                if (slot.sprites[spriteName] !== undefined) {
    -                    slot.sprites[spriteName].visible = true;
    -                } else {
    -                    var sprite = this.createSprite(slot, attachment.rendererObject);
    -                    slotContainer.addChild(sprite);
    -                }
    -                slot.currentSprite = slot.sprites[spriteName];
    -                slot.currentSpriteName = spriteName;
    -            }
    -        }
    -        slotContainer.visible = true;
    -
    -        var bone = slot.bone;
    -
    -        slotContainer.position.x = bone.worldX + attachment.x * bone.m00 + attachment.y * bone.m01;
    -        slotContainer.position.y = bone.worldY + attachment.x * bone.m10 + attachment.y * bone.m11;
    -        slotContainer.scale.x = bone.worldScaleX;
    -        slotContainer.scale.y = bone.worldScaleY;
    -
    -        slotContainer.rotation = -(slot.bone.worldRotation * Math.PI / 180);
    -
    -        slotContainer.alpha = slot.a;
    -        slot.currentSprite.tint = PIXI.rgb2hex([slot.r,slot.g,slot.b]);
    -    }
    -
    -    PIXI.DisplayObjectContainer.prototype.updateTransform.call(this);
    -};
    -
    -
    -PIXI.Spine.prototype.createSprite = function (slot, descriptor) {
    -    var name = PIXI.TextureCache[descriptor.name] ? descriptor.name : descriptor.name + ".png";
    -    var sprite = new PIXI.Sprite(PIXI.Texture.fromFrame(name));
    -    sprite.scale = descriptor.scale;
    -    sprite.rotation = descriptor.rotation;
    -    sprite.anchor.x = sprite.anchor.y = 0.5;
    -
    -    slot.sprites = slot.sprites || {};
    -    slot.sprites[descriptor.name] = sprite;
    -    return sprite;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_extras_Strip.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_extras_Strip.js.html deleted file mode 100755 index bb4a3f6..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_extras_Strip.js.html +++ /dev/null @@ -1,629 +0,0 @@ - - - - - src/pixi/extras/Strip.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/extras/Strip.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/
    - */
    -
    - /**
    - * 
    - * @class Strip
    - * @extends DisplayObjectContainer
    - * @constructor
    - * @param texture {Texture} The texture to use
    - * @param width {Number} the width 
    - * @param height {Number} the height
    - * 
    - */
    -PIXI.Strip = function(texture)
    -{
    -    PIXI.DisplayObjectContainer.call( this );
    -    
    -
    -    /**
    -     * The texture of the strip
    -     *
    -     * @property texture
    -     * @type Texture
    -     */
    -    this.texture = texture;
    -
    -    // set up the main bits..
    -    this.uvs = new PIXI.Float32Array([0, 1,
    -                                      1, 1,
    -                                      1, 0,
    -                                      0, 1]);
    -
    -    this.verticies = new PIXI.Float32Array([0, 0,
    -                                            100, 0,
    -                                            100, 100,
    -                                            0, 100]);
    -
    -    this.colors = new PIXI.Float32Array([1, 1, 1, 1]);
    -
    -    this.indices = new PIXI.Uint16Array([0, 1, 2, 3]);
    -    
    -    /**
    -     * Whether the strip is dirty or not
    -     *
    -     * @property dirty
    -     * @type Boolean
    -     */
    -    this.dirty = true;
    -
    -
    -    /**
    -     * if you need a padding, not yet implemented
    -     *
    -     * @property padding
    -     * @type Number
    -     */
    -    this.padding = 0;
    -     // NYI, TODO padding ?
    -
    -};
    -
    -// constructor
    -PIXI.Strip.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
    -PIXI.Strip.prototype.constructor = PIXI.Strip;
    -
    -PIXI.Strip.prototype._renderWebGL = function(renderSession)
    -{
    -    // if the sprite is not visible or the alpha is 0 then no need to render this element
    -    if(!this.visible || this.alpha <= 0)return;
    -    // render triangle strip..
    -
    -    renderSession.spriteBatch.stop();
    -
    -    // init! init!
    -    if(!this._vertexBuffer)this._initWebGL(renderSession);
    -    
    -    renderSession.shaderManager.setShader(renderSession.shaderManager.stripShader);
    -
    -    this._renderStrip(renderSession);
    -
    -    ///renderSession.shaderManager.activateDefaultShader();
    -
    -    renderSession.spriteBatch.start();
    -
    -    //TODO check culling  
    -};
    -
    -PIXI.Strip.prototype._initWebGL = function(renderSession)
    -{
    -    // build the strip!
    -    var gl = renderSession.gl;
    -    
    -    this._vertexBuffer = gl.createBuffer();
    -    this._indexBuffer = gl.createBuffer();
    -    this._uvBuffer = gl.createBuffer();
    -    this._colorBuffer = gl.createBuffer();
    -    
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.verticies, gl.DYNAMIC_DRAW);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER,  this.uvs, gl.STATIC_DRAW);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this._colorBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.colors, gl.STATIC_DRAW);
    - 
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);
    -    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    -};
    -
    -PIXI.Strip.prototype._renderStrip = function(renderSession)
    -{
    -    var gl = renderSession.gl;
    -    var projection = renderSession.projection,
    -        offset = renderSession.offset,
    -        shader = renderSession.shaderManager.stripShader;
    -
    -
    -    // gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mat4Real);
    -
    -    gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    -
    -    // set uniforms
    -    gl.uniformMatrix3fv(shader.translationMatrix, false, this.worldTransform.toArray(true));
    -    gl.uniform2f(shader.projectionVector, projection.x, -projection.y);
    -    gl.uniform2f(shader.offsetVector, -offset.x, -offset.y);
    -    gl.uniform1f(shader.alpha, this.worldAlpha);
    -
    -    if(!this.dirty)
    -    {
    -        
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies);
    -        gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0);
    -        
    -        // update the uvs
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer);
    -        gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0);
    -            
    -        gl.activeTexture(gl.TEXTURE0);
    -
    -        // check if a texture is dirty..
    -        if(this.texture.baseTexture._dirty[gl.id])
    -        {
    -            renderSession.renderer.updateTexture(this.texture.baseTexture);
    -        }
    -        else
    -        {
    -            // bind the current texture
    -            gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]);
    -        }
    -    
    -        // dont need to upload!
    -        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);
    -    
    -    
    -    }
    -    else
    -    {
    -
    -        this.dirty = false;
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);
    -        gl.bufferData(gl.ARRAY_BUFFER, this.verticies, gl.STATIC_DRAW);
    -        gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0);
    -        
    -        // update the uvs
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer);
    -        gl.bufferData(gl.ARRAY_BUFFER, this.uvs, gl.STATIC_DRAW);
    -        gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0);
    -            
    -        gl.activeTexture(gl.TEXTURE0);
    -
    -        // check if a texture is dirty..
    -        if(this.texture.baseTexture._dirty[gl.id])
    -        {
    -            renderSession.renderer.updateTexture(this.texture.baseTexture);
    -        }
    -        else
    -        {
    -            gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]);
    -        }
    -    
    -        // dont need to upload!
    -        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);
    -        gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    -        
    -    }
    -    //console.log(gl.TRIANGLE_STRIP)
    -    //
    -    //
    -    gl.drawElements(gl.TRIANGLE_STRIP, this.indices.length, gl.UNSIGNED_SHORT, 0);
    -    
    -  
    -};
    -
    -
    -
    -PIXI.Strip.prototype._renderCanvas = function(renderSession)
    -{
    -    var context = renderSession.context;
    -    
    -    var transform = this.worldTransform;
    -
    -    if (renderSession.roundPixels)
    -    {
    -        context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx | 0, transform.ty | 0);
    -    }
    -    else
    -    {
    -        context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);
    -    }
    -        
    -    var strip = this;
    -    // draw triangles!!
    -    var verticies = strip.verticies;
    -    var uvs = strip.uvs;
    -
    -    var length = verticies.length/2;
    -    this.count++;
    -
    -    for (var i = 0; i < length-2; i++)
    -    {
    -        // draw some triangles!
    -        var index = i*2;
    -
    -        var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    -        var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    -
    -        if(this.padding > 0)
    -        {
    -            var centerX = (x0 + x1 + x2)/3;
    -            var centerY = (y0 + y1 + y2)/3;
    -
    -            var normX = x0 - centerX;
    -            var normY = y0 - centerY;
    -
    -            var dist = Math.sqrt( normX * normX + normY * normY );
    -            x0 = centerX + (normX / dist) * (dist + 3);
    -            y0 = centerY + (normY / dist) * (dist + 3);
    -
    -            // 
    -            
    -            normX = x1 - centerX;
    -            normY = y1 - centerY;
    -
    -            dist = Math.sqrt( normX * normX + normY * normY );
    -            x1 = centerX + (normX / dist) * (dist + 3);
    -            y1 = centerY + (normY / dist) * (dist + 3);
    -
    -            normX = x2 - centerX;
    -            normY = y2 - centerY;
    -
    -            dist = Math.sqrt( normX * normX + normY * normY );
    -            x2 = centerX + (normX / dist) * (dist + 3);
    -            y2 = centerY + (normY / dist) * (dist + 3);
    -        }
    -
    -        var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2] * strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    -        var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3] * strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    -
    -        context.save();
    -        context.beginPath();
    -
    -
    -        context.moveTo(x0, y0);
    -        context.lineTo(x1, y1);
    -        context.lineTo(x2, y2);
    -
    -        context.closePath();
    -
    -        context.clip();
    -
    -        // Compute matrix transform
    -        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    -        var deltaA = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    -        var deltaB = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    -        var deltaC = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    -        var deltaD = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    -        var deltaE = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    -        var deltaF = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    -
    -        context.transform(deltaA / delta, deltaD / delta,
    -                            deltaB / delta, deltaE / delta,
    -                            deltaC / delta, deltaF / delta);
    -
    -        context.drawImage(strip.texture.baseTexture.source, 0, 0);
    -        context.restore();
    -    }
    -};
    -
    -
    -/**
    - * Renders a flat strip
    - *
    - * @method renderStripFlat
    - * @param strip {Strip} The Strip to render
    - * @private
    - */
    -PIXI.Strip.prototype.renderStripFlat = function(strip)
    -{
    -    var context = this.context;
    -    var verticies = strip.verticies;
    -
    -    var length = verticies.length/2;
    -    this.count++;
    -
    -    context.beginPath();
    -    for (var i=1; i < length-2; i++)
    -    {
    -        // draw some triangles!
    -        var index = i*2;
    -
    -        var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    -        var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    -
    -        context.moveTo(x0, y0);
    -        context.lineTo(x1, y1);
    -        context.lineTo(x2, y2);
    -    }
    -
    -    context.fillStyle = "#FF0000";
    -    context.fill();
    -    context.closePath();
    -};
    -
    -/*
    -PIXI.Strip.prototype.setTexture = function(texture)
    -{
    -    //TODO SET THE TEXTURES
    -    //TODO VISIBILITY
    -
    -    // stop current texture
    -    this.texture = texture;
    -    this.width   = texture.frame.width;
    -    this.height  = texture.frame.height;
    -    this.updateFrame = true;
    -};
    -*/
    -
    -/**
    - * When the texture is updated, this event will fire to update the scale and frame
    - *
    - * @method onTextureUpdate
    - * @param event
    - * @private
    - */
    -
    -PIXI.Strip.prototype.onTextureUpdate = function()
    -{
    -    this.updateFrame = true;
    -};
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_extras_TilingSprite.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_extras_TilingSprite.js.html deleted file mode 100755 index d95a188..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_extras_TilingSprite.js.html +++ /dev/null @@ -1,743 +0,0 @@ - - - - - src/pixi/extras/TilingSprite.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/extras/TilingSprite.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/
    - */
    -
    -/**
    - * A tiling sprite is a fast way of rendering a tiling image
    - *
    - * @class TilingSprite
    - * @extends Sprite
    - * @constructor
    - * @param texture {Texture} the texture of the tiling sprite
    - * @param width {Number}  the width of the tiling sprite
    - * @param height {Number} the height of the tiling sprite
    - */
    -PIXI.TilingSprite = function(texture, width, height)
    -{
    -    PIXI.Sprite.call( this, texture);
    -
    -    /**
    -     * The with of the tiling sprite
    -     *
    -     * @property width
    -     * @type Number
    -     */
    -    this._width = width || 100;
    -
    -    /**
    -     * The height of the tiling sprite
    -     *
    -     * @property height
    -     * @type Number
    -     */
    -    this._height = height || 100;
    -
    -    /**
    -     * The scaling of the image that is being tiled
    -     *
    -     * @property tileScale
    -     * @type Point
    -     */
    -    this.tileScale = new PIXI.Point(1,1);
    -
    -    /**
    -     * A point that represents the scale of the texture object
    -     *
    -     * @property tileScaleOffset
    -     * @type Point
    -     */
    -    this.tileScaleOffset = new PIXI.Point(1,1);
    -    
    -    /**
    -     * The offset position of the image that is being tiled
    -     *
    -     * @property tilePosition
    -     * @type Point
    -     */
    -    this.tilePosition = new PIXI.Point(0,0);
    -
    -    /**
    -     * Whether this sprite is renderable or not
    -     *
    -     * @property renderable
    -     * @type Boolean
    -     * @default true
    -     */
    -    this.renderable = true;
    -
    -    /**
    -     * The tint applied to the sprite. This is a hex value
    -     *
    -     * @property tint
    -     * @type Number
    -     * @default 0xFFFFFF
    -     */
    -    this.tint = 0xFFFFFF;
    -    
    -    /**
    -     * The blend mode to be applied to the sprite
    -     *
    -     * @property blendMode
    -     * @type Number
    -     * @default PIXI.blendModes.NORMAL;
    -     */
    -    this.blendMode = PIXI.blendModes.NORMAL;
    -
    -    
    -
    -};
    -
    -// constructor
    -PIXI.TilingSprite.prototype = Object.create(PIXI.Sprite.prototype);
    -PIXI.TilingSprite.prototype.constructor = PIXI.TilingSprite;
    -
    -
    -/**
    - * The width of the sprite, setting this will actually modify the scale to achieve the value set
    - *
    - * @property width
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TilingSprite.prototype, 'width', {
    -    get: function() {
    -        return this._width;
    -    },
    -    set: function(value) {
    -        
    -        this._width = value;
    -    }
    -});
    -
    -/**
    - * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set
    - *
    - * @property height
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TilingSprite.prototype, 'height', {
    -    get: function() {
    -        return  this._height;
    -    },
    -    set: function(value) {
    -        this._height = value;
    -    }
    -});
    -
    -PIXI.TilingSprite.prototype.setTexture = function(texture)
    -{
    -    if (this.texture === texture) return;
    -
    -    this.texture = texture;
    -
    -    this.refreshTexture = true;
    -
    -    this.cachedTint = 0xFFFFFF;
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.TilingSprite.prototype._renderWebGL = function(renderSession)
    -{
    -    if (this.visible === false || this.alpha === 0) return;
    -    var i,j;
    -
    -    if (this._mask)
    -    {
    -        renderSession.spriteBatch.stop();
    -        renderSession.maskManager.pushMask(this.mask, renderSession);
    -        renderSession.spriteBatch.start();
    -    }
    -
    -    if (this._filters)
    -    {
    -        renderSession.spriteBatch.flush();
    -        renderSession.filterManager.pushFilter(this._filterBlock);
    -    }
    -
    -   
    -
    -    if (!this.tilingTexture || this.refreshTexture)
    -    {
    -        this.generateTilingTexture(true);
    -
    -        if (this.tilingTexture && this.tilingTexture.needsUpdate)
    -        {
    -            //TODO - tweaking
    -            PIXI.updateWebGLTexture(this.tilingTexture.baseTexture, renderSession.gl);
    -            this.tilingTexture.needsUpdate = false;
    -           // this.tilingTexture._uvs = null;
    -        }
    -    }
    -    else
    -    {
    -        renderSession.spriteBatch.renderTilingSprite(this);
    -    }
    -    // simple render children!
    -    for (i=0,j=this.children.length; i<j; i++)
    -    {
    -        this.children[i]._renderWebGL(renderSession);
    -    }
    -
    -    renderSession.spriteBatch.stop();
    -
    -    if (this._filters) renderSession.filterManager.popFilter();
    -    if (this._mask) renderSession.maskManager.popMask(this._mask, renderSession);
    -    
    -    renderSession.spriteBatch.start();
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.TilingSprite.prototype._renderCanvas = function(renderSession)
    -{
    -    if (this.visible === false || this.alpha === 0)return;
    -    
    -    var context = renderSession.context;
    -
    -    if (this._mask)
    -    {
    -        renderSession.maskManager.pushMask(this._mask, context);
    -    }
    -
    -    context.globalAlpha = this.worldAlpha;
    -    
    -    var transform = this.worldTransform;
    -
    -    var i,j;
    -
    -    var resolution = renderSession.resolution;
    -
    -    context.setTransform(transform.a * resolution,
    -                         transform.c * resolution,
    -                         transform.b * resolution,
    -                         transform.d * resolution,
    -                         transform.tx * resolution,
    -                         transform.ty * resolution);
    -
    -    if (!this.__tilePattern ||  this.refreshTexture)
    -    {
    -        this.generateTilingTexture(false);
    -    
    -        if (this.tilingTexture)
    -        {
    -            this.__tilePattern = context.createPattern(this.tilingTexture.baseTexture.source, 'repeat');
    -        }
    -        else
    -        {
    -            return;
    -        }
    -    }
    -
    -    // check blend mode
    -    if (this.blendMode !== renderSession.currentBlendMode)
    -    {
    -        renderSession.currentBlendMode = this.blendMode;
    -        context.globalCompositeOperation = PIXI.blendModesCanvas[renderSession.currentBlendMode];
    -    }
    -
    -    var tilePosition = this.tilePosition;
    -    var tileScale = this.tileScale;
    -
    -    tilePosition.x %= this.tilingTexture.baseTexture.width;
    -    tilePosition.y %= this.tilingTexture.baseTexture.height;
    -
    -    // offset - make sure to account for the anchor point..
    -    context.scale(tileScale.x,tileScale.y);
    -    context.translate(tilePosition.x + (this.anchor.x * -this._width), tilePosition.y + (this.anchor.y * -this._height));
    -
    -    context.fillStyle = this.__tilePattern;
    -
    -    context.fillRect(-tilePosition.x,
    -                    -tilePosition.y,
    -                    this._width / tileScale.x,
    -                    this._height / tileScale.y);
    -
    -    context.scale(1 / tileScale.x, 1 / tileScale.y);
    -    context.translate(-tilePosition.x + (this.anchor.x * this._width), -tilePosition.y + (this.anchor.y * this._height));
    -
    -    if (this._mask)
    -    {
    -        renderSession.maskManager.popMask(renderSession.context);
    -    }
    -
    -    for (i=0,j=this.children.length; i<j; i++)
    -    {
    -        this.children[i]._renderCanvas(renderSession);
    -    }
    -};
    -
    -
    -/**
    -* Returns the framing rectangle of the sprite as a PIXI.Rectangle object
    -*
    -* @method getBounds
    -* @return {Rectangle} the framing rectangle
    -*/
    -PIXI.TilingSprite.prototype.getBounds = function()
    -{
    -    var width = this._width;
    -    var height = this._height;
    -
    -    var w0 = width * (1-this.anchor.x);
    -    var w1 = width * -this.anchor.x;
    -
    -    var h0 = height * (1-this.anchor.y);
    -    var h1 = height * -this.anchor.y;
    -
    -    var worldTransform = this.worldTransform;
    -
    -    var a = worldTransform.a;
    -    var b = worldTransform.b;
    -    var c = worldTransform.c;
    -    var d = worldTransform.d;
    -    var tx = worldTransform.tx;
    -    var ty = worldTransform.ty;
    -    
    -    var x1 = a * w1 + c * h1 + tx;
    -    var y1 = d * h1 + b * w1 + ty;
    -
    -    var x2 = a * w0 + c * h1 + tx;
    -    var y2 = d * h1 + b * w0 + ty;
    -
    -    var x3 = a * w0 + c * h0 + tx;
    -    var y3 = d * h0 + b * w0 + ty;
    -
    -    var x4 =  a * w1 + c * h0 + tx;
    -    var y4 =  d * h0 + b * w1 + ty;
    -
    -    var maxX = -Infinity;
    -    var maxY = -Infinity;
    -
    -    var minX = Infinity;
    -    var minY = Infinity;
    -
    -    minX = x1 < minX ? x1 : minX;
    -    minX = x2 < minX ? x2 : minX;
    -    minX = x3 < minX ? x3 : minX;
    -    minX = x4 < minX ? x4 : minX;
    -
    -    minY = y1 < minY ? y1 : minY;
    -    minY = y2 < minY ? y2 : minY;
    -    minY = y3 < minY ? y3 : minY;
    -    minY = y4 < minY ? y4 : minY;
    -
    -    maxX = x1 > maxX ? x1 : maxX;
    -    maxX = x2 > maxX ? x2 : maxX;
    -    maxX = x3 > maxX ? x3 : maxX;
    -    maxX = x4 > maxX ? x4 : maxX;
    -
    -    maxY = y1 > maxY ? y1 : maxY;
    -    maxY = y2 > maxY ? y2 : maxY;
    -    maxY = y3 > maxY ? y3 : maxY;
    -    maxY = y4 > maxY ? y4 : maxY;
    -
    -    var bounds = this._bounds;
    -
    -    bounds.x = minX;
    -    bounds.width = maxX - minX;
    -
    -    bounds.y = minY;
    -    bounds.height = maxY - minY;
    -
    -    // store a reference so that if this function gets called again in the render cycle we do not have to recalculate
    -    this._currentBounds = bounds;
    -
    -    return bounds;
    -};
    -
    -
    -
    -/**
    - * When the texture is updated, this event will fire to update the scale and frame
    - *
    - * @method onTextureUpdate
    - * @param event
    - * @private
    - */
    -PIXI.TilingSprite.prototype.onTextureUpdate = function()
    -{
    -   // overriding the sprite version of this!
    -};
    -
    -
    -/**
    -* 
    -* @method generateTilingTexture
    -* 
    -* @param forcePowerOfTwo {Boolean} Whether we want to force the texture to be a power of two
    -*/
    -PIXI.TilingSprite.prototype.generateTilingTexture = function(forcePowerOfTwo)
    -{
    -    if (!this.texture.baseTexture.hasLoaded) return;
    -
    -    var texture = this.originalTexture || this.texture;
    -    var frame = texture.frame;
    -    var targetWidth, targetHeight;
    -
    -    //  Check that the frame is the same size as the base texture.
    -    var isFrame = frame.width !== texture.baseTexture.width || frame.height !== texture.baseTexture.height;
    -
    -    var newTextureRequired = false;
    -
    -    if (!forcePowerOfTwo)
    -    {
    -        if (isFrame)
    -        {
    -            targetWidth = frame.width;
    -            targetHeight = frame.height;
    -           
    -            newTextureRequired = true;
    -        }
    -    }
    -    else
    -    {
    -        targetWidth = PIXI.getNextPowerOfTwo(frame.width);
    -        targetHeight = PIXI.getNextPowerOfTwo(frame.height);
    -
    -        if (frame.width !== targetWidth || frame.height !== targetHeight) newTextureRequired = true;
    -    }
    -
    -    if (newTextureRequired)
    -    {
    -        var canvasBuffer;
    -
    -        if (this.tilingTexture && this.tilingTexture.isTiling)
    -        {
    -            canvasBuffer = this.tilingTexture.canvasBuffer;
    -            canvasBuffer.resize(targetWidth, targetHeight);
    -            this.tilingTexture.baseTexture.width = targetWidth;
    -            this.tilingTexture.baseTexture.height = targetHeight;
    -            this.tilingTexture.needsUpdate = true;
    -        }
    -        else
    -        {
    -            canvasBuffer = new PIXI.CanvasBuffer(targetWidth, targetHeight);
    -
    -            this.tilingTexture = PIXI.Texture.fromCanvas(canvasBuffer.canvas);
    -            this.tilingTexture.canvasBuffer = canvasBuffer;
    -            this.tilingTexture.isTiling = true;
    -        }
    -
    -        canvasBuffer.context.drawImage(texture.baseTexture.source,
    -                               texture.crop.x,
    -                               texture.crop.y,
    -                               texture.crop.width,
    -                               texture.crop.height,
    -                               0,
    -                               0,
    -                               targetWidth,
    -                               targetHeight);
    -
    -        this.tileScaleOffset.x = frame.width / targetWidth;
    -        this.tileScaleOffset.y = frame.height / targetHeight;
    -    }
    -    else
    -    {
    -        //  TODO - switching?
    -        if (this.tilingTexture && this.tilingTexture.isTiling)
    -        {
    -            // destroy the tiling texture!
    -            // TODO could store this somewhere?
    -            this.tilingTexture.destroy(true);
    -        }
    -
    -        this.tileScaleOffset.x = 1;
    -        this.tileScaleOffset.y = 1;
    -        this.tilingTexture = texture;
    -    }
    -
    -    this.refreshTexture = false;
    -    
    -    this.originalTexture = this.texture;
    -    this.texture = this.tilingTexture;
    -    
    -    this.tilingTexture.baseTexture._powerOf2 = true;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_AbstractFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_AbstractFilter.js.html deleted file mode 100755 index d4ac332..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_AbstractFilter.js.html +++ /dev/null @@ -1,355 +0,0 @@ - - - - - src/pixi/filters/AbstractFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/AbstractFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This is the base class for creating a PIXI filter. Currently only webGL supports filters.
    - * If you want to make a custom filter this should be your base class.
    - * @class AbstractFilter
    - * @constructor
    - * @param fragmentSrc {Array} The fragment source in an array of strings.
    - * @param uniforms {Object} An object containing the uniforms for this filter.
    - */
    -PIXI.AbstractFilter = function(fragmentSrc, uniforms)
    -{
    -    /**
    -    * An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion.
    -    * For example the blur filter has two passes blurX and blurY.
    -    * @property passes
    -    * @type Array an array of filter objects
    -    * @private
    -    */
    -    this.passes = [this];
    -
    -    /**
    -    * @property shaders
    -    * @type Array an array of shaders
    -    * @private
    -    */
    -    this.shaders = [];
    -    
    -    /**
    -    * @property dirty
    -    * @type Boolean
    -    */
    -    this.dirty = true;
    -
    -    /**
    -    * @property padding
    -    * @type Number
    -    */
    -    this.padding = 0;
    -
    -    /**
    -    * @property uniforms
    -    * @type object
    -    * @private
    -    */
    -    this.uniforms = uniforms || {};
    -
    -    /**
    -    * @property fragmentSrc
    -    * @type Array
    -    * @private
    -    */
    -    this.fragmentSrc = fragmentSrc || [];
    -};
    -
    -PIXI.AbstractFilter.prototype.constructor = PIXI.AbstractFilter;
    -
    -/**
    - * Syncs the uniforms between the class object and the shaders.
    - *
    - * @method syncUniforms
    - */
    -PIXI.AbstractFilter.prototype.syncUniforms = function()
    -{
    -    for(var i=0,j=this.shaders.length; i<j; i++)
    -    {
    -        this.shaders[i].dirty = true;
    -    }
    -};
    -
    -/*
    -PIXI.AbstractFilter.prototype.apply = function(frameBuffer)
    -{
    -    // TODO :)
    -};
    -*/
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_AlphaMaskFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_AlphaMaskFilter.js.html deleted file mode 100755 index e332a02..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_AlphaMaskFilter.js.html +++ /dev/null @@ -1,375 +0,0 @@ - - - - - src/pixi/filters/AlphaMaskFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/AlphaMaskFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The AlphaMaskFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object.
    - * You can use this filter to apply all manor of crazy warping effects
    - * Currently the r property of the texture is used to offset the x and the g property of the texture is used to offset the y.
    - * 
    - * @class AlphaMaskFilter
    - * @extends AbstractFilter
    - * @constructor
    - * @param texture {Texture} The texture used for the displacement map * must be power of 2 texture at the moment
    - */
    -PIXI.AlphaMaskFilter = function(texture)
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -    texture.baseTexture._powerOf2 = true;
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        mask: {type: 'sampler2D', value:texture},
    -        mapDimensions:   {type: '2f', value:{x:1, y:5112}},
    -        dimensions:   {type: '4fv', value:[0,0,0,0]}
    -    };
    -
    -    if(texture.baseTexture.hasLoaded)
    -    {
    -        this.uniforms.mask.value.x = texture.width;
    -        this.uniforms.mask.value.y = texture.height;
    -    }
    -    else
    -    {
    -        this.boundLoadedFunction = this.onTextureLoaded.bind(this);
    -
    -        texture.baseTexture.on('loaded', this.boundLoadedFunction);
    -    }
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D mask;',
    -        'uniform sampler2D uSampler;',
    -        'uniform vec2 offset;',
    -        'uniform vec4 dimensions;',
    -        'uniform vec2 mapDimensions;',
    -
    -        'void main(void) {',
    -        '   vec2 mapCords = vTextureCoord.xy;',
    -        '   mapCords += (dimensions.zw + offset)/ dimensions.xy ;',
    -        '   mapCords.y *= -1.0;',
    -        '   mapCords.y += 1.0;',
    -        '   mapCords *= dimensions.xy / mapDimensions;',
    -
    -        '   vec4 original =  texture2D(uSampler, vTextureCoord);',
    -        '   float maskAlpha =  texture2D(mask, mapCords).r;',
    -        '   original *= maskAlpha;',
    -        //'   original.rgb *= maskAlpha;',
    -        '   gl_FragColor =  original;',
    -        //'   gl_FragColor = gl_FragColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.AlphaMaskFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.AlphaMaskFilter.prototype.constructor = PIXI.AlphaMaskFilter;
    -
    -/**
    - * Sets the map dimensions uniforms when the texture becomes available.
    - *
    - * @method onTextureLoaded
    - */
    -PIXI.AlphaMaskFilter.prototype.onTextureLoaded = function()
    -{
    -    this.uniforms.mapDimensions.value.x = this.uniforms.mask.value.width;
    -    this.uniforms.mapDimensions.value.y = this.uniforms.mask.value.height;
    -
    -    this.uniforms.mask.value.baseTexture.off('loaded', this.boundLoadedFunction);
    -};
    -
    -/**
    - * The texture used for the displacement map. Must be power of 2 sized texture.
    - *
    - * @property map
    - * @type Texture
    - */
    -Object.defineProperty(PIXI.AlphaMaskFilter.prototype, 'map', {
    -    get: function() {
    -        return this.uniforms.mask.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.mask.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_AsciiFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_AsciiFilter.js.html deleted file mode 100755 index fecc5d2..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_AsciiFilter.js.html +++ /dev/null @@ -1,364 +0,0 @@ - - - - - src/pixi/filters/AsciiFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/AsciiFilter.js

    - -
    -
    -/**
    - * @author Vico @vicocotea
    - * original shader : https://www.shadertoy.com/view/lssGDj by @movAX13h
    - */
    -
    -/**
    - * An ASCII filter.
    - * 
    - * @class AsciiFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.AsciiFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        dimensions: {type: '4fv', value:new PIXI.Float32Array([10000, 100, 10, 10])},
    -        pixelSize: {type: '1f', value:8}
    -    };
    -
    -    this.fragmentSrc = [
    -        
    -        'precision mediump float;',
    -        'uniform vec4 dimensions;',
    -        'uniform float pixelSize;',
    -        'uniform sampler2D uSampler;',
    -
    -        'float character(float n, vec2 p)',
    -        '{',
    -        '    p = floor(p*vec2(4.0, -4.0) + 2.5);',
    -        '    if (clamp(p.x, 0.0, 4.0) == p.x && clamp(p.y, 0.0, 4.0) == p.y)',
    -        '    {',
    -        '        if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0;',
    -        '    }',
    -        '    return 0.0;',
    -        '}',
    -
    -        'void main()',
    -        '{',
    -        '    vec2 uv = gl_FragCoord.xy;',
    -        '    vec3 col = texture2D(uSampler, floor( uv / pixelSize ) * pixelSize / dimensions.xy).rgb;',
    -            
    -        '    #ifdef HAS_GREENSCREEN',
    -        '    float gray = (col.r + col.b)/2.0;', 
    -        '    #else',
    -        '    float gray = (col.r + col.g + col.b)/3.0;',
    -        '    #endif',
    -  
    -        '    float n =  65536.0;             // .',
    -        '    if (gray > 0.2) n = 65600.0;    // :',
    -        '    if (gray > 0.3) n = 332772.0;   // *',
    -        '    if (gray > 0.4) n = 15255086.0; // o',
    -        '    if (gray > 0.5) n = 23385164.0; // &',
    -        '    if (gray > 0.6) n = 15252014.0; // 8',
    -        '    if (gray > 0.7) n = 13199452.0; // @',
    -        '    if (gray > 0.8) n = 11512810.0; // #',
    -            
    -        '    vec2 p = mod( uv / ( pixelSize * 0.5 ), 2.0) - vec2(1.0);',
    -        '    col = col * character(n, p);',
    -            
    -        '    gl_FragColor = vec4(col, 1.0);',
    -        '}'
    -    ];
    -};
    -
    -PIXI.AsciiFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.AsciiFilter.prototype.constructor = PIXI.AsciiFilter;
    -
    -/**
    - * The pixel size used by the filter.
    - *
    - * @property size
    - * @type Number
    - */
    -Object.defineProperty(PIXI.AsciiFilter.prototype, 'size', {
    -    get: function() {
    -        return this.uniforms.pixelSize.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.pixelSize.value = value;
    -    }
    -});
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_BlurFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_BlurFilter.js.html deleted file mode 100755 index f7c0d25..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_BlurFilter.js.html +++ /dev/null @@ -1,348 +0,0 @@ - - - - - src/pixi/filters/BlurFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/BlurFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The BlurFilter applies a Gaussian blur to an object.
    - * The strength of the blur can be set for x- and y-axis separately (always relative to the stage).
    - *
    - * @class BlurFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.BlurFilter = function()
    -{
    -    this.blurXFilter = new PIXI.BlurXFilter();
    -    this.blurYFilter = new PIXI.BlurYFilter();
    -
    -    this.passes =[this.blurXFilter, this.blurYFilter];
    -};
    -
    -PIXI.BlurFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.BlurFilter.prototype.constructor = PIXI.BlurFilter;
    -
    -/**
    - * Sets the strength of both the blurX and blurY properties simultaneously
    - *
    - * @property blur
    - * @type Number the strength of the blur
    - * @default 2
    - */
    -Object.defineProperty(PIXI.BlurFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.blurXFilter.blur;
    -    },
    -    set: function(value) {
    -        this.blurXFilter.blur = this.blurYFilter.blur = value;
    -    }
    -});
    -
    -/**
    - * Sets the strength of the blurX property
    - *
    - * @property blurX
    - * @type Number the strength of the blurX
    - * @default 2
    - */
    -Object.defineProperty(PIXI.BlurFilter.prototype, 'blurX', {
    -    get: function() {
    -        return this.blurXFilter.blur;
    -    },
    -    set: function(value) {
    -        this.blurXFilter.blur = value;
    -    }
    -});
    -
    -/**
    - * Sets the strength of the blurY property
    - *
    - * @property blurY
    - * @type Number the strength of the blurY
    - * @default 2
    - */
    -Object.defineProperty(PIXI.BlurFilter.prototype, 'blurY', {
    -    get: function() {
    -        return this.blurYFilter.blur;
    -    },
    -    set: function(value) {
    -        this.blurYFilter.blur = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_BlurXFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_BlurXFilter.js.html deleted file mode 100755 index 622c2f6..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_BlurXFilter.js.html +++ /dev/null @@ -1,345 +0,0 @@ - - - - - src/pixi/filters/BlurXFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/BlurXFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The BlurXFilter applies a horizontal Gaussian blur to an object.
    - *
    - * @class BlurXFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.BlurXFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 1/512}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float blur;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   vec4 sum = vec4(0.0);',
    -
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x - 4.0*blur, vTextureCoord.y)) * 0.05;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x - 3.0*blur, vTextureCoord.y)) * 0.09;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x - 2.0*blur, vTextureCoord.y)) * 0.12;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x - blur, vTextureCoord.y)) * 0.15;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x + blur, vTextureCoord.y)) * 0.15;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x + 2.0*blur, vTextureCoord.y)) * 0.12;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x + 3.0*blur, vTextureCoord.y)) * 0.09;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x + 4.0*blur, vTextureCoord.y)) * 0.05;',
    -
    -        '   gl_FragColor = sum;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.BlurXFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.BlurXFilter.prototype.constructor = PIXI.BlurXFilter;
    -
    -/**
    - * Sets the strength of both the blur.
    - *
    - * @property blur
    - * @type Number the strength of the blur
    - * @default 2
    - */
    -Object.defineProperty(PIXI.BlurXFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value / (1/7000);
    -    },
    -    set: function(value) {
    -
    -        this.dirty = true;
    -        this.uniforms.blur.value = (1/7000) * value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_BlurYFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_BlurYFilter.js.html deleted file mode 100755 index a6c7290..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_BlurYFilter.js.html +++ /dev/null @@ -1,344 +0,0 @@ - - - - - src/pixi/filters/BlurYFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/BlurYFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The BlurYFilter applies a vertical Gaussian blur to an object.
    - *
    - * @class BlurYFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.BlurYFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 1/512}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float blur;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   vec4 sum = vec4(0.0);',
    -
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 4.0*blur)) * 0.05;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 3.0*blur)) * 0.09;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 2.0*blur)) * 0.12;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - blur)) * 0.15;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + blur)) * 0.15;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 2.0*blur)) * 0.12;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 3.0*blur)) * 0.09;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 4.0*blur)) * 0.05;',
    -
    -        '   gl_FragColor = sum;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.BlurYFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.BlurYFilter.prototype.constructor = PIXI.BlurYFilter;
    -
    -/**
    - * Sets the strength of both the blur.
    - *
    - * @property blur
    - * @type Number the strength of the blur
    - * @default 2
    - */
    -Object.defineProperty(PIXI.BlurYFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value / (1/7000);
    -    },
    -    set: function(value) {
    -        //this.padding = value;
    -        this.uniforms.blur.value = (1/7000) * value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_ColorMatrixFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_ColorMatrixFilter.js.html deleted file mode 100755 index 86702fe..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_ColorMatrixFilter.js.html +++ /dev/null @@ -1,337 +0,0 @@ - - - - - src/pixi/filters/ColorMatrixFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/ColorMatrixFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The ColorMatrixFilter class lets you apply a 4x4 matrix transformation on the RGBA
    - * color and alpha values of every pixel on your displayObject to produce a result
    - * with a new set of RGBA color and alpha values. It's pretty powerful!
    - * 
    - * @class ColorMatrixFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.ColorMatrixFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        matrix: {type: 'mat4', value: [1,0,0,0,
    -                                       0,1,0,0,
    -                                       0,0,1,0,
    -                                       0,0,0,1]}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float invert;',
    -        'uniform mat4 matrix;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord) * matrix;',
    -      //  '   gl_FragColor = gl_FragColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.ColorMatrixFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.ColorMatrixFilter.prototype.constructor = PIXI.ColorMatrixFilter;
    -
    -/**
    - * Sets the matrix of the color matrix filter
    - *
    - * @property matrix
    - * @type Array and array of 26 numbers
    - * @default [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]
    - */
    -Object.defineProperty(PIXI.ColorMatrixFilter.prototype, 'matrix', {
    -    get: function() {
    -        return this.uniforms.matrix.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.matrix.value = value;
    -    }
    -});
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_ColorStepFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_ColorStepFilter.js.html deleted file mode 100755 index eb21f70..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_ColorStepFilter.js.html +++ /dev/null @@ -1,332 +0,0 @@ - - - - - src/pixi/filters/ColorStepFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/ColorStepFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This lowers the color depth of your image by the given amount, producing an image with a smaller palette.
    - * 
    - * @class ColorStepFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.ColorStepFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        step: {type: '1f', value: 5}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D uSampler;',
    -        'uniform float step;',
    -
    -        'void main(void) {',
    -        '   vec4 color = texture2D(uSampler, vTextureCoord);',
    -        '   color = floor(color * step) / step;',
    -        '   gl_FragColor = color;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.ColorStepFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.ColorStepFilter.prototype.constructor = PIXI.ColorStepFilter;
    -
    -/**
    - * The number of steps to reduce the palette by.
    - *
    - * @property step
    - * @type Number
    - */
    -Object.defineProperty(PIXI.ColorStepFilter.prototype, 'step', {
    -    get: function() {
    -        return this.uniforms.step.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.step.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_ConvolutionFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_ConvolutionFilter.js.html deleted file mode 100755 index e6acdc3..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_ConvolutionFilter.js.html +++ /dev/null @@ -1,384 +0,0 @@ - - - - - src/pixi/filters/ConvolutionFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/ConvolutionFilter.js

    - -
    -
    -/**
    - * The ConvolutionFilter class applies a matrix convolution filter effect. 
    - * A convolution combines pixels in the input image with neighboring pixels to produce a new image. 
    - * A wide variety of image effects can be achieved through convolutions, including blurring, edge detection, sharpening, embossing, and beveling.
    - * The matrix should be specified as a 9 point Array. See http://docs.gimp.org/en/plug-in-convmatrix.html for more info.
    - * 
    - * @class ConvolutionFilter
    - * @extends AbstractFilter
    - * @constructor
    - * @param matrix {Array} An array of values used for matrix transformation. Specified as a 9 point Array.
    - * @param width {Number} Width of the object you are transforming
    - * @param height {Number} Height of the object you are transforming
    - */
    -PIXI.ConvolutionFilter = function(matrix, width, height)
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        m : {type: '1fv', value: new PIXI.Float32Array(matrix)},
    -        texelSizeX: {type: '1f', value: 1 / width},
    -        texelSizeY: {type: '1f', value: 1 / height}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying mediump vec2 vTextureCoord;',
    -        'uniform sampler2D texture;',
    -        'uniform float texelSizeX;',
    -        'uniform float texelSizeY;',
    -        'uniform float m[9];',
    -
    -        'vec2 px = vec2(texelSizeX, texelSizeY);',
    -
    -        'void main(void) {',
    -            'vec4 c11 = texture2D(texture, vTextureCoord - px);', // top left
    -            'vec4 c12 = texture2D(texture, vec2(vTextureCoord.x, vTextureCoord.y - px.y));', // top center
    -            'vec4 c13 = texture2D(texture, vec2(vTextureCoord.x + px.x, vTextureCoord.y - px.y));', // top right
    -
    -            'vec4 c21 = texture2D(texture, vec2(vTextureCoord.x - px.x, vTextureCoord.y) );', // mid left
    -            'vec4 c22 = texture2D(texture, vTextureCoord);', // mid center
    -            'vec4 c23 = texture2D(texture, vec2(vTextureCoord.x + px.x, vTextureCoord.y) );', // mid right
    -
    -            'vec4 c31 = texture2D(texture, vec2(vTextureCoord.x - px.x, vTextureCoord.y + px.y) );', // bottom left
    -            'vec4 c32 = texture2D(texture, vec2(vTextureCoord.x, vTextureCoord.y + px.y) );', // bottom center
    -            'vec4 c33 = texture2D(texture, vTextureCoord + px );', // bottom right
    -
    -            'gl_FragColor = ',
    -            'c11 * m[0] + c12 * m[1] + c22 * m[2] +',
    -            'c21 * m[3] + c22 * m[4] + c23 * m[5] +',
    -            'c31 * m[6] + c32 * m[7] + c33 * m[8];',
    -            'gl_FragColor.a = c22.a;',
    -        '}'
    -    ];
    -
    -};
    -
    -PIXI.ConvolutionFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.ConvolutionFilter.prototype.constructor = PIXI.ConvolutionFilter;
    -
    -/**
    - * An array of values used for matrix transformation. Specified as a 9 point Array.
    - *
    - * @property matrix
    - * @type Array
    - */
    -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'matrix', {
    -    get: function() {
    -        return this.uniforms.m.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.m.value = new PIXI.Float32Array(value);
    -    }
    -});
    -
    -/**
    - * Width of the object you are transforming
    - *
    - * @property width
    - * @type Number
    - */
    -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'width', {
    -    get: function() {
    -        return this.uniforms.texelSizeX.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.texelSizeX.value = 1/value;
    -    }
    -});
    -
    -/**
    - * Height of the object you are transforming
    - *
    - * @property height
    - * @type Number
    - */
    -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'height', {
    -    get: function() {
    -        return this.uniforms.texelSizeY.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.texelSizeY.value = 1/value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_CrossHatchFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_CrossHatchFilter.js.html deleted file mode 100755 index 5c8509e..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_CrossHatchFilter.js.html +++ /dev/null @@ -1,358 +0,0 @@ - - - - - src/pixi/filters/CrossHatchFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/CrossHatchFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A Cross Hatch effect filter.
    - * 
    - * @class CrossHatchFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.CrossHatchFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 1 / 512}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float blur;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '    float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);',
    -
    -        '    gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);',
    -
    -        '    if (lum < 1.00) {',
    -        '        if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {',
    -        '            gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);',
    -        '        }',
    -        '    }',
    -
    -        '    if (lum < 0.75) {',
    -        '        if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {',
    -        '            gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);',
    -        '        }',
    -        '    }',
    -
    -        '    if (lum < 0.50) {',
    -        '        if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {',
    -        '            gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);',
    -        '        }',
    -        '    }',
    -
    -        '    if (lum < 0.3) {',
    -        '        if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {',
    -        '            gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);',
    -        '        }',
    -        '    }',
    -        '}'
    -    ];
    -};
    -
    -PIXI.CrossHatchFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.CrossHatchFilter.prototype.constructor = PIXI.CrossHatchFilter;
    -
    -/**
    - * Sets the strength of both the blur.
    - *
    - * @property blur
    - * @type Number the strength of the blur
    - * @default 2
    - */
    -Object.defineProperty(PIXI.CrossHatchFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value / (1/7000);
    -    },
    -    set: function(value) {
    -        //this.padding = value;
    -        this.uniforms.blur.value = (1/7000) * value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_DisplacementFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_DisplacementFilter.js.html deleted file mode 100755 index 06dd7d5..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_DisplacementFilter.js.html +++ /dev/null @@ -1,412 +0,0 @@ - - - - - src/pixi/filters/DisplacementFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/DisplacementFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The DisplacementFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object.
    - * You can use this filter to apply all manor of crazy warping effects
    - * Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.
    - * 
    - * @class DisplacementFilter
    - * @extends AbstractFilter
    - * @constructor
    - * @param texture {Texture} The texture used for the displacement map * must be power of 2 texture at the moment
    - */
    -PIXI.DisplacementFilter = function(texture)
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -    texture.baseTexture._powerOf2 = true;
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        displacementMap: {type: 'sampler2D', value:texture},
    -        scale:           {type: '2f', value:{x:30, y:30}},
    -        offset:          {type: '2f', value:{x:0, y:0}},
    -        mapDimensions:   {type: '2f', value:{x:1, y:5112}},
    -        dimensions:   {type: '4fv', value:[0,0,0,0]}
    -    };
    -
    -    if(texture.baseTexture.hasLoaded)
    -    {
    -        this.uniforms.mapDimensions.value.x = texture.width;
    -        this.uniforms.mapDimensions.value.y = texture.height;
    -    }
    -    else
    -    {
    -        this.boundLoadedFunction = this.onTextureLoaded.bind(this);
    -
    -        texture.baseTexture.on('loaded', this.boundLoadedFunction);
    -    }
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D displacementMap;',
    -        'uniform sampler2D uSampler;',
    -        'uniform vec2 scale;',
    -        'uniform vec2 offset;',
    -        'uniform vec4 dimensions;',
    -        'uniform vec2 mapDimensions;',// = vec2(256.0, 256.0);',
    -        // 'const vec2 textureDimensions = vec2(750.0, 750.0);',
    -
    -        'void main(void) {',
    -        '   vec2 mapCords = vTextureCoord.xy;',
    -        //'   mapCords -= ;',
    -        '   mapCords += (dimensions.zw + offset)/ dimensions.xy ;',
    -        '   mapCords.y *= -1.0;',
    -        '   mapCords.y += 1.0;',
    -        '   vec2 matSample = texture2D(displacementMap, mapCords).xy;',
    -        '   matSample -= 0.5;',
    -        '   matSample *= scale;',
    -        '   matSample /= mapDimensions;',
    -        '   gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + matSample.x, vTextureCoord.y + matSample.y));',
    -        '   gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb, 1.0);',
    -        '   vec2 cord = vTextureCoord;',
    -
    -        //'   gl_FragColor =  texture2D(displacementMap, cord);',
    -     //   '   gl_FragColor = gl_FragColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.DisplacementFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.DisplacementFilter.prototype.constructor = PIXI.DisplacementFilter;
    -
    -/**
    - * Sets the map dimensions uniforms when the texture becomes available.
    - *
    - * @method onTextureLoaded
    - */
    -PIXI.DisplacementFilter.prototype.onTextureLoaded = function()
    -{
    -    this.uniforms.mapDimensions.value.x = this.uniforms.displacementMap.value.width;
    -    this.uniforms.mapDimensions.value.y = this.uniforms.displacementMap.value.height;
    -
    -    this.uniforms.displacementMap.value.baseTexture.off('loaded', this.boundLoadedFunction);
    -};
    -
    -/**
    - * The texture used for the displacement map. Must be power of 2 texture.
    - *
    - * @property map
    - * @type Texture
    - */
    -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'map', {
    -    get: function() {
    -        return this.uniforms.displacementMap.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.displacementMap.value = value;
    -    }
    -});
    -
    -/**
    - * The multiplier used to scale the displacement result from the map calculation.
    - *
    - * @property scale
    - * @type Point
    - */
    -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'scale', {
    -    get: function() {
    -        return this.uniforms.scale.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.scale.value = value;
    -    }
    -});
    -
    -/**
    - * The offset used to move the displacement map.
    - *
    - * @property offset
    - * @type Point
    - */
    -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'offset', {
    -    get: function() {
    -        return this.uniforms.offset.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.offset.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_DotScreenFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_DotScreenFilter.js.html deleted file mode 100755 index b0cf737..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_DotScreenFilter.js.html +++ /dev/null @@ -1,363 +0,0 @@ - - - - - src/pixi/filters/DotScreenFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/DotScreenFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/fun/dotscreen.js
    - */
    -
    -/**
    - * This filter applies a dotscreen effect making display objects appear to be made out of black and white halftone dots like an old printer.
    - * 
    - * @class DotScreenFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.DotScreenFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        scale: {type: '1f', value:1},
    -        angle: {type: '1f', value:5},
    -        dimensions:   {type: '4fv', value:[0,0,0,0]}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform vec4 dimensions;',
    -        'uniform sampler2D uSampler;',
    -
    -        'uniform float angle;',
    -        'uniform float scale;',
    -
    -        'float pattern() {',
    -        '   float s = sin(angle), c = cos(angle);',
    -        '   vec2 tex = vTextureCoord * dimensions.xy;',
    -        '   vec2 point = vec2(',
    -        '       c * tex.x - s * tex.y,',
    -        '       s * tex.x + c * tex.y',
    -        '   ) * scale;',
    -        '   return (sin(point.x) * sin(point.y)) * 4.0;',
    -        '}',
    -
    -        'void main() {',
    -        '   vec4 color = texture2D(uSampler, vTextureCoord);',
    -        '   float average = (color.r + color.g + color.b) / 3.0;',
    -        '   gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);',
    -        '}'
    -    ];
    -};
    -
    -PIXI.DotScreenFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.DotScreenFilter.prototype.constructor = PIXI.DotScreenFilter;
    -
    -/**
    - * The scale of the effect.
    - * @property scale
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DotScreenFilter.prototype, 'scale', {
    -    get: function() {
    -        return this.uniforms.scale.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.scale.value = value;
    -    }
    -});
    -
    -/**
    - * The radius of the effect.
    - * @property angle
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DotScreenFilter.prototype, 'angle', {
    -    get: function() {
    -        return this.uniforms.angle.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.angle.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_FilterBlock.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_FilterBlock.js.html deleted file mode 100755 index 275cc3d..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_FilterBlock.js.html +++ /dev/null @@ -1,308 +0,0 @@ - - - - - src/pixi/filters/FilterBlock.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/FilterBlock.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A target and pass info object for filters.
    - * 
    - * @class FilterBlock
    - * @constructor
    - */
    -PIXI.FilterBlock = function()
    -{
    -    /**
    -     * The visible state of this FilterBlock.
    -     *
    -     * @property visible
    -     * @type Boolean
    -     */
    -    this.visible = true;
    -
    -    /**
    -     * The renderable state of this FilterBlock.
    -     *
    -     * @property renderable
    -     * @type Boolean
    -     */
    -    this.renderable = true;
    -};
    -
    -PIXI.FilterBlock.prototype.constructor = PIXI.FilterBlock;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_GrayFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_GrayFilter.js.html deleted file mode 100755 index 5ac5889..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_GrayFilter.js.html +++ /dev/null @@ -1,331 +0,0 @@ - - - - - src/pixi/filters/GrayFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/GrayFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This greyscales the palette of your Display Objects.
    - * 
    - * @class GrayFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.GrayFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        gray: {type: '1f', value: 1}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D uSampler;',
    -        'uniform float gray;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord);',
    -        '   gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(0.2126*gl_FragColor.r + 0.7152*gl_FragColor.g + 0.0722*gl_FragColor.b), gray);',
    -     //   '   gl_FragColor = gl_FragColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.GrayFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.GrayFilter.prototype.constructor = PIXI.GrayFilter;
    -
    -/**
    - * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color.
    - * @property gray
    - * @type Number
    - */
    -Object.defineProperty(PIXI.GrayFilter.prototype, 'gray', {
    -    get: function() {
    -        return this.uniforms.gray.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.gray.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_InvertFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_InvertFilter.js.html deleted file mode 100755 index 8c3dabd..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_InvertFilter.js.html +++ /dev/null @@ -1,332 +0,0 @@ - - - - - src/pixi/filters/InvertFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/InvertFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This inverts your Display Objects colors.
    - * 
    - * @class InvertFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.InvertFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        invert: {type: '1f', value: 1}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float invert;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord);',
    -        '   gl_FragColor.rgb = mix( (vec3(1)-gl_FragColor.rgb) * gl_FragColor.a, gl_FragColor.rgb, 1.0 - invert);',
    -        //'   gl_FragColor.rgb = gl_FragColor.rgb  * gl_FragColor.a;',
    -      //  '   gl_FragColor = gl_FragColor * vColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.InvertFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.InvertFilter.prototype.constructor = PIXI.InvertFilter;
    -
    -/**
    - * The strength of the invert. 1 will fully invert the colors, 0 will make the object its normal color
    - * @property invert
    - * @type Number
    -*/
    -Object.defineProperty(PIXI.InvertFilter.prototype, 'invert', {
    -    get: function() {
    -        return this.uniforms.invert.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.invert.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_NoiseFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_NoiseFilter.js.html deleted file mode 100755 index 2949784..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_NoiseFilter.js.html +++ /dev/null @@ -1,340 +0,0 @@ - - - - - src/pixi/filters/NoiseFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/NoiseFilter.js

    - -
    -
    -/**
    - * @author Vico @vicocotea
    - * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js
    - */
    -
    -/**
    - * A Noise effect filter.
    - * 
    - * @class NoiseFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.NoiseFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        noise: {type: '1f', value: 0.5}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'uniform sampler2D uSampler;',
    -        'uniform float noise;',
    -        'varying vec2 vTextureCoord;',
    -
    -        'float rand(vec2 co) {',
    -        '    return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);',
    -        '}',
    -        'void main() {',
    -        '    vec4 color = texture2D(uSampler, vTextureCoord);',
    -            
    -        '    float diff = (rand(vTextureCoord) - 0.5) * noise;',
    -        '    color.r += diff;',
    -        '    color.g += diff;',
    -        '    color.b += diff;',
    -            
    -        '    gl_FragColor = color;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.NoiseFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.NoiseFilter.prototype.constructor = PIXI.NoiseFilter;
    -
    -/**
    - * The amount of noise to apply.
    - * @property noise
    - * @type Number
    -*/
    -Object.defineProperty(PIXI.NoiseFilter.prototype, 'noise', {
    -    get: function() {
    -        return this.uniforms.noise.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.noise.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_NormalMapFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_NormalMapFilter.js.html deleted file mode 100755 index eca90e7..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_NormalMapFilter.js.html +++ /dev/null @@ -1,474 +0,0 @@ - - - - - src/pixi/filters/NormalMapFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/NormalMapFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -
    -/**
    - * The NormalMapFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. 
    - * You can use this filter to apply all manor of crazy warping effects
    - * Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.
    - * 
    - * @class NormalMapFilter
    - * @extends AbstractFilter
    - * @constructor
    - * @param texture {Texture} The texture used for the displacement map * must be power of 2 texture at the moment
    - */
    -PIXI.NormalMapFilter = function(texture)
    -{
    -	PIXI.AbstractFilter.call( this );
    -	
    -	this.passes = [this];
    -	texture.baseTexture._powerOf2 = true;
    -
    -	// set the uniforms
    -	this.uniforms = {
    -		displacementMap: {type: 'sampler2D', value:texture},
    -		scale:			 {type: '2f', value:{x:15, y:15}},
    -		offset:			 {type: '2f', value:{x:0, y:0}},
    -		mapDimensions:   {type: '2f', value:{x:1, y:1}},
    -		dimensions:   {type: '4f', value:[0,0,0,0]},
    -	//	LightDir: {type: 'f3', value:[0, 1, 0]},
    -		LightPos: {type: '3f', value:[0, 1, 0]}
    -	};
    -	
    -
    -	if(texture.baseTexture.hasLoaded)
    -	{
    -		this.uniforms.mapDimensions.value.x = texture.width;
    -		this.uniforms.mapDimensions.value.y = texture.height;
    -	}
    -	else
    -	{
    -		this.boundLoadedFunction = this.onTextureLoaded.bind(this);
    -
    -		texture.baseTexture.on("loaded", this.boundLoadedFunction);
    -	}
    -
    -	this.fragmentSrc = [
    -	  "precision mediump float;",
    -	  "varying vec2 vTextureCoord;",
    -	  "varying float vColor;",
    -	  "uniform sampler2D displacementMap;",
    -	  "uniform sampler2D uSampler;",
    -	 
    -	  "uniform vec4 dimensions;",
    -	  
    -		"const vec2 Resolution = vec2(1.0,1.0);",      //resolution of screen
    -		"uniform vec3 LightPos;",    //light position, normalized
    -		"const vec4 LightColor = vec4(1.0, 1.0, 1.0, 1.0);",      //light RGBA -- alpha is intensity
    -		"const vec4 AmbientColor = vec4(1.0, 1.0, 1.0, 0.5);",    //ambient RGBA -- alpha is intensity 
    -		"const vec3 Falloff = vec3(0.0, 1.0, 0.2);",         //attenuation coefficients
    -
    -		"uniform vec3 LightDir;",//" = vec3(1.0, 0.0, 1.0);",
    -
    -
    -	  "uniform vec2 mapDimensions;",// = vec2(256.0, 256.0);",
    -	 
    -
    -	  "void main(void) {",
    -	  	"vec2 mapCords = vTextureCoord.xy;",
    -
    -	  	"vec4 color = texture2D(uSampler, vTextureCoord.st);",
    -        "vec3 nColor = texture2D(displacementMap, vTextureCoord.st).rgb;",
    - 
    -
    -	  	"mapCords *= vec2(dimensions.x/512.0, dimensions.y/512.0);",
    -	  
    -	  	"mapCords.y *= -1.0;",
    -	 	"mapCords.y += 1.0;",
    -
    -	 	//RGBA of our diffuse color
    -		"vec4 DiffuseColor = texture2D(uSampler, vTextureCoord);",
    -
    -		//RGB of our normal map
    -		"vec3 NormalMap = texture2D(displacementMap, mapCords).rgb;",
    -
    -		//The delta position of light
    -		//"vec3 LightDir = vec3(LightPos.xy - (gl_FragCoord.xy / Resolution.xy), LightPos.z);",
    -		"vec3 LightDir = vec3(LightPos.xy - (mapCords.xy), LightPos.z);",
    -		//Correct for aspect ratio
    -		//"LightDir.x *= Resolution.x / Resolution.y;",
    -
    -		//Determine distance (used for attenuation) BEFORE we normalize our LightDir
    -		"float D = length(LightDir);",
    -
    -		//normalize our vectors
    -		"vec3 N = normalize(NormalMap * 2.0 - 1.0);",
    -		"vec3 L = normalize(LightDir);",
    -
    -		//Pre-multiply light color with intensity
    -		//Then perform "N dot L" to determine our diffuse term
    -		"vec3 Diffuse = (LightColor.rgb * LightColor.a) * max(dot(N, L), 0.0);",
    -
    -		//pre-multiply ambient color with intensity
    -		"vec3 Ambient = AmbientColor.rgb * AmbientColor.a;",
    -
    -		//calculate attenuation
    -		"float Attenuation = 1.0 / ( Falloff.x + (Falloff.y*D) + (Falloff.z*D*D) );",
    -
    -		//the calculation which brings it all together
    -		"vec3 Intensity = Ambient + Diffuse * Attenuation;",
    -		"vec3 FinalColor = DiffuseColor.rgb * Intensity;",
    -		"gl_FragColor = vColor * vec4(FinalColor, DiffuseColor.a);",
    -		//"gl_FragColor = vec4(1.0, 0.0, 0.0, Attenuation);",//vColor * vec4(FinalColor, DiffuseColor.a);",
    -	/*
    -	 	// normalise color
    -	 	"vec3 normal = normalize(nColor * 2.0 - 1.0);",
    -	 	
    -	 	"vec3 deltaPos = vec3( (light.xy - gl_FragCoord.xy) / resolution.xy, light.z );",
    -
    -	 	"float lambert = clamp(dot(normal, lightDir), 0.0, 1.0);",
    -
    -	 	"float d = sqrt(dot(deltaPos, deltaPos));", 
    -        "float att = 1.0 / ( attenuation.x + (attenuation.y*d) + (attenuation.z*d*d) );",
    -
    -        "vec3 result = (ambientColor * ambientIntensity) + (lightColor.rgb * lambert) * att;",
    -        "result *= color.rgb;",
    -       
    -        "gl_FragColor = vec4(result, 1.0);",*/
    -
    -	  	
    -
    -	  "}"
    -	];
    -	
    -}
    -
    -PIXI.NormalMapFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.NormalMapFilter.prototype.constructor = PIXI.NormalMapFilter;
    -
    -/**
    - * Sets the map dimensions uniforms when the texture becomes available.
    - *
    - * @method onTextureLoaded
    - */
    -PIXI.NormalMapFilter.prototype.onTextureLoaded = function()
    -{
    -	this.uniforms.mapDimensions.value.x = this.uniforms.displacementMap.value.width;
    -	this.uniforms.mapDimensions.value.y = this.uniforms.displacementMap.value.height;
    -
    -	this.uniforms.displacementMap.value.baseTexture.off("loaded", this.boundLoadedFunction)
    -};
    -
    -/**
    - * The texture used for the displacement map. Must be power of 2 texture.
    - *
    - * @property map
    - * @type Texture
    - */
    -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'map', {
    -    get: function() {
    -        return this.uniforms.displacementMap.value;
    -    },
    -    set: function(value) {
    -    	this.uniforms.displacementMap.value = value;
    -    }
    -});
    -
    -/**
    - * The multiplier used to scale the displacement result from the map calculation.
    - *
    - * @property scale
    - * @type Point
    - */
    -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'scale', {
    -    get: function() {
    -        return this.uniforms.scale.value;
    -    },
    -    set: function(value) {
    -    	this.uniforms.scale.value = value;
    -    }
    -});
    -
    -/**
    - * The offset used to move the displacement map.
    - *
    - * @property offset
    - * @type Point
    - */
    -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'offset', {
    -    get: function() {
    -        return this.uniforms.offset.value;
    -    },
    -    set: function(value) {
    -    	this.uniforms.offset.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_PixelateFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_PixelateFilter.js.html deleted file mode 100755 index 3413e27..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_PixelateFilter.js.html +++ /dev/null @@ -1,340 +0,0 @@ - - - - - src/pixi/filters/PixelateFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/PixelateFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This filter applies a pixelate effect making display objects appear 'blocky'.
    - * 
    - * @class PixelateFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.PixelateFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        invert: {type: '1f', value: 0},
    -        dimensions: {type: '4fv', value:new PIXI.Float32Array([10000, 100, 10, 10])},
    -        pixelSize: {type: '2f', value:{x:10, y:10}}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform vec2 testDim;',
    -        'uniform vec4 dimensions;',
    -        'uniform vec2 pixelSize;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   vec2 coord = vTextureCoord;',
    -
    -        '   vec2 size = dimensions.xy/pixelSize;',
    -
    -        '   vec2 color = floor( ( vTextureCoord * size ) ) / size + pixelSize/dimensions.xy * 0.5;',
    -        '   gl_FragColor = texture2D(uSampler, color);',
    -        '}'
    -    ];
    -};
    -
    -PIXI.PixelateFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.PixelateFilter.prototype.constructor = PIXI.PixelateFilter;
    -
    -/**
    - * This a point that describes the size of the blocks. x is the width of the block and y is the height.
    - * 
    - * @property size
    - * @type Point
    - */
    -Object.defineProperty(PIXI.PixelateFilter.prototype, 'size', {
    -    get: function() {
    -        return this.uniforms.pixelSize.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.pixelSize.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_RGBSplitFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_RGBSplitFilter.js.html deleted file mode 100755 index dca385c..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_RGBSplitFilter.js.html +++ /dev/null @@ -1,369 +0,0 @@ - - - - - src/pixi/filters/RGBSplitFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/RGBSplitFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * An RGB Split Filter.
    - * 
    - * @class RGBSplitFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.RGBSplitFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        red: {type: '2f', value: {x:20, y:20}},
    -        green: {type: '2f', value: {x:-20, y:20}},
    -        blue: {type: '2f', value: {x:20, y:-20}},
    -        dimensions:   {type: '4fv', value:[0,0,0,0]}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform vec2 red;',
    -        'uniform vec2 green;',
    -        'uniform vec2 blue;',
    -        'uniform vec4 dimensions;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/dimensions.xy).r;',
    -        '   gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/dimensions.xy).g;',
    -        '   gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/dimensions.xy).b;',
    -        '   gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.RGBSplitFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.RGBSplitFilter.prototype.constructor = PIXI.RGBSplitFilter;
    -
    -/**
    - * Red channel offset.
    - * 
    - * @property red
    - * @type Point
    - */
    -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'red', {
    -    get: function() {
    -        return this.uniforms.red.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.red.value = value;
    -    }
    -});
    -
    -/**
    - * Green channel offset.
    - * 
    - * @property green
    - * @type Point
    - */
    -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'green', {
    -    get: function() {
    -        return this.uniforms.green.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.green.value = value;
    -    }
    -});
    -
    -/**
    - * Blue offset.
    - * 
    - * @property blue
    - * @type Point
    - */
    -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'blue', {
    -    get: function() {
    -        return this.uniforms.blue.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.blue.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_SepiaFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_SepiaFilter.js.html deleted file mode 100755 index aa41b56..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_SepiaFilter.js.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - src/pixi/filters/SepiaFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/SepiaFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This applies a sepia effect to your Display Objects.
    - * 
    - * @class SepiaFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.SepiaFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        sepia: {type: '1f', value: 1}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float sepia;',
    -        'uniform sampler2D uSampler;',
    -
    -        'const mat3 sepiaMatrix = mat3(0.3588, 0.7044, 0.1368, 0.2990, 0.5870, 0.1140, 0.2392, 0.4696, 0.0912);',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord);',
    -        '   gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb * sepiaMatrix, sepia);',
    -       // '   gl_FragColor = gl_FragColor * vColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.SepiaFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.SepiaFilter.prototype.constructor = PIXI.SepiaFilter;
    -
    -/**
    - * The strength of the sepia. 1 will apply the full sepia effect, 0 will make the object its normal color.
    - * @property sepia
    - * @type Number
    -*/
    -Object.defineProperty(PIXI.SepiaFilter.prototype, 'sepia', {
    -    get: function() {
    -        return this.uniforms.sepia.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.sepia.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_SmartBlurFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_SmartBlurFilter.js.html deleted file mode 100755 index d879bbe..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_SmartBlurFilter.js.html +++ /dev/null @@ -1,353 +0,0 @@ - - - - - src/pixi/filters/SmartBlurFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/SmartBlurFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A Smart Blur Filter.
    - * 
    - * @class SmartBlurFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.SmartBlurFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 1/512}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'uniform sampler2D uSampler;',
    -        //'uniform vec2 delta;',
    -        'const vec2 delta = vec2(1.0/10.0, 0.0);',
    -        //'uniform float darkness;',
    -
    -        'float random(vec3 scale, float seed) {',
    -        '   return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);',
    -        '}',
    -
    -
    -        'void main(void) {',
    -        '   vec4 color = vec4(0.0);',
    -        '   float total = 0.0;',
    -
    -        '   float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);',
    -
    -        '   for (float t = -30.0; t <= 30.0; t++) {',
    -        '       float percent = (t + offset - 0.5) / 30.0;',
    -        '       float weight = 1.0 - abs(percent);',
    -        '       vec4 sample = texture2D(uSampler, vTextureCoord + delta * percent);',
    -        '       sample.rgb *= sample.a;',
    -        '       color += sample * weight;',
    -        '       total += weight;',
    -        '   }',
    -
    -        '   gl_FragColor = color / total;',
    -        '   gl_FragColor.rgb /= gl_FragColor.a + 0.00001;',
    -        //'   gl_FragColor.rgb *= darkness;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.SmartBlurFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.SmartBlurFilter.prototype.constructor = PIXI.SmartBlurFilter;
    -
    -/**
    - * The strength of the blur.
    - *
    - * @property blur
    - * @type Number the strength of the blur
    - * @default 2
    - */
    -Object.defineProperty(PIXI.SmartBlurFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.blur.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_TiltShiftFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_TiltShiftFilter.js.html deleted file mode 100755 index d42187b..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_TiltShiftFilter.js.html +++ /dev/null @@ -1,360 +0,0 @@ - - - - - src/pixi/filters/TiltShiftFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/TiltShiftFilter.js

    - -
    -
    -/**
    - * @author Vico @vicocotea
    - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/
    - */
    -
    -/**
    - * A TiltShift Filter. Manages the pass of both a TiltShiftXFilter and TiltShiftYFilter.
    - * 
    - * @class TiltShiftFilter
    - * @constructor
    - */
    -PIXI.TiltShiftFilter = function()
    -{
    -    this.tiltShiftXFilter = new PIXI.TiltShiftXFilter();
    -    this.tiltShiftYFilter = new PIXI.TiltShiftYFilter();
    -    this.tiltShiftXFilter.updateDelta();
    -    this.tiltShiftXFilter.updateDelta();
    -
    -    this.passes = [this.tiltShiftXFilter, this.tiltShiftYFilter];
    -};
    -
    -PIXI.TiltShiftFilter.prototype.constructor = PIXI.TiltShiftFilter;
    -
    -/**
    - * The strength of the blur.
    - *
    - * @property blur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.tiltShiftXFilter.blur;
    -    },
    -    set: function(value) {
    -        this.tiltShiftXFilter.blur = this.tiltShiftYFilter.blur = value;
    -    }
    -});
    -
    -/**
    - * The strength of the gradient blur.
    - *
    - * @property gradientBlur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'gradientBlur', {
    -    get: function() {
    -        return this.tiltShiftXFilter.gradientBlur;
    -    },
    -    set: function(value) {
    -        this.tiltShiftXFilter.gradientBlur = this.tiltShiftYFilter.gradientBlur = value;
    -    }
    -});
    -
    -/**
    - * The Y value to start the effect at.
    - *
    - * @property start
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'start', {
    -    get: function() {
    -        return this.tiltShiftXFilter.start;
    -    },
    -    set: function(value) {
    -        this.tiltShiftXFilter.start = this.tiltShiftYFilter.start = value;
    -    }
    -});
    -
    -/**
    - * The Y value to end the effect at.
    - *
    - * @property end
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'end', {
    -    get: function() {
    -        return this.tiltShiftXFilter.end;
    -    },
    -    set: function(value) {
    -        this.tiltShiftXFilter.end = this.tiltShiftYFilter.end = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_TiltShiftXFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_TiltShiftXFilter.js.html deleted file mode 100755 index bdd0ee0..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_TiltShiftXFilter.js.html +++ /dev/null @@ -1,427 +0,0 @@ - - - - - src/pixi/filters/TiltShiftXFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/TiltShiftXFilter.js

    - -
    -
    -/**
    - * @author Vico @vicocotea
    - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/
    - */
    -
    -/**
    - * A TiltShiftXFilter.
    - * 
    - * @class TiltShiftXFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.TiltShiftXFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 100.0},
    -        gradientBlur: {type: '1f', value: 600.0},
    -        start: {type: '2f', value:{x:0, y:window.screenHeight / 2}},
    -        end: {type: '2f', value:{x:600, y:window.screenHeight / 2}},
    -        delta: {type: '2f', value:{x:30, y:30}},
    -        texSize: {type: '2f', value:{x:window.screenWidth, y:window.screenHeight}}
    -    };
    -
    -    this.updateDelta();
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'uniform sampler2D uSampler;',
    -        'uniform float blur;',
    -        'uniform float gradientBlur;',
    -        'uniform vec2 start;',
    -        'uniform vec2 end;',
    -        'uniform vec2 delta;',
    -        'uniform vec2 texSize;',
    -        'varying vec2 vTextureCoord;',
    -
    -        'float random(vec3 scale, float seed) {',
    -        '   return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);',
    -        '}',
    -
    -        'void main(void) {',
    -        '    vec4 color = vec4(0.0);',
    -        '    float total = 0.0;',
    -        
    -        '    float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);',
    -        '    vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));',
    -        '    float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;',
    -        
    -        '    for (float t = -30.0; t <= 30.0; t++) {',
    -        '        float percent = (t + offset - 0.5) / 30.0;',
    -        '        float weight = 1.0 - abs(percent);',
    -        '        vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);',
    -        '        sample.rgb *= sample.a;',
    -        '        color += sample * weight;',
    -        '        total += weight;',
    -        '    }',
    -
    -        '    gl_FragColor = color / total;',
    -        '    gl_FragColor.rgb /= gl_FragColor.a + 0.00001;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.TiltShiftXFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.TiltShiftXFilter.prototype.constructor = PIXI.TiltShiftXFilter;
    -
    -/**
    - * The strength of the blur.
    - *
    - * @property blur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.blur.value = value;
    -    }
    -});
    -
    -/**
    - * The strength of the gradient blur.
    - *
    - * @property gradientBlur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'gradientBlur', {
    -    get: function() {
    -        return this.uniforms.gradientBlur.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.gradientBlur.value = value;
    -    }
    -});
    -
    -/**
    - * The X value to start the effect at.
    - *
    - * @property start
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'start', {
    -    get: function() {
    -        return this.uniforms.start.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.start.value = value;
    -        this.updateDelta();
    -    }
    -});
    -
    -/**
    - * The X value to end the effect at.
    - *
    - * @property end
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'end', {
    -    get: function() {
    -        return this.uniforms.end.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.end.value = value;
    -        this.updateDelta();
    -    }
    -});
    -
    -/**
    - * Updates the filter delta values.
    - *
    - * @method updateDelta
    - */
    -PIXI.TiltShiftXFilter.prototype.updateDelta = function(){
    -    var dx = this.uniforms.end.value.x - this.uniforms.start.value.x;
    -    var dy = this.uniforms.end.value.y - this.uniforms.start.value.y;
    -    var d = Math.sqrt(dx * dx + dy * dy);
    -    this.uniforms.delta.value.x = dx / d;
    -    this.uniforms.delta.value.y = dy / d;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_TiltShiftYFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_TiltShiftYFilter.js.html deleted file mode 100755 index d99d3d8..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_TiltShiftYFilter.js.html +++ /dev/null @@ -1,427 +0,0 @@ - - - - - src/pixi/filters/TiltShiftYFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/TiltShiftYFilter.js

    - -
    -
    -/**
    - * @author Vico @vicocotea
    - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/
    - */
    -
    -/**
    - * A TiltShiftYFilter.
    - * 
    - * @class TiltShiftYFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.TiltShiftYFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 100.0},
    -        gradientBlur: {type: '1f', value: 600.0},
    -        start: {type: '2f', value:{x:0, y:window.screenHeight / 2}},
    -        end: {type: '2f', value:{x:600, y:window.screenHeight / 2}},
    -        delta: {type: '2f', value:{x:30, y:30}},
    -        texSize: {type: '2f', value:{x:window.screenWidth, y:window.screenHeight}}
    -    };
    -    
    -    this.updateDelta();
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'uniform sampler2D uSampler;',
    -        'uniform float blur;',
    -        'uniform float gradientBlur;',
    -        'uniform vec2 start;',
    -        'uniform vec2 end;',
    -        'uniform vec2 delta;',
    -        'uniform vec2 texSize;',
    -        'varying vec2 vTextureCoord;',
    -
    -        'float random(vec3 scale, float seed) {',
    -        '   return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);',
    -        '}',
    -
    -        'void main(void) {',
    -        '    vec4 color = vec4(0.0);',
    -        '    float total = 0.0;',
    -        
    -        '    float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);',
    -        '    vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));',
    -        '    float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;',
    -        
    -        '    for (float t = -30.0; t <= 30.0; t++) {',
    -        '        float percent = (t + offset - 0.5) / 30.0;',
    -        '        float weight = 1.0 - abs(percent);',
    -        '        vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);',
    -        '        sample.rgb *= sample.a;',
    -        '        color += sample * weight;',
    -        '        total += weight;',
    -        '    }',
    -
    -        '    gl_FragColor = color / total;',
    -        '    gl_FragColor.rgb /= gl_FragColor.a + 0.00001;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.TiltShiftYFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.TiltShiftYFilter.prototype.constructor = PIXI.TiltShiftYFilter;
    -
    -/**
    - * The strength of the blur.
    - *
    - * @property blur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.blur.value = value;
    -    }
    -});
    -
    -/**
    - * The strength of the gradient blur.
    - *
    - * @property gradientBlur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'gradientBlur', {
    -    get: function() {
    -        return this.uniforms.gradientBlur.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.gradientBlur.value = value;
    -    }
    -});
    -
    -/**
    - * The Y value to start the effect at.
    - *
    - * @property start
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'start', {
    -    get: function() {
    -        return this.uniforms.start.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.start.value = value;
    -        this.updateDelta();
    -    }
    -});
    -
    -/**
    - * The Y value to end the effect at.
    - *
    - * @property end
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'end', {
    -    get: function() {
    -        return this.uniforms.end.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.end.value = value;
    -        this.updateDelta();
    -    }
    -});
    -
    -/**
    - * Updates the filter delta values.
    - *
    - * @method updateDelta
    - */
    -PIXI.TiltShiftYFilter.prototype.updateDelta = function(){
    -    var dx = this.uniforms.end.value.x - this.uniforms.start.value.x;
    -    var dy = this.uniforms.end.value.y - this.uniforms.start.value.y;
    -    var d = Math.sqrt(dx * dx + dy * dy);
    -    this.uniforms.delta.value.x = -dy / d;
    -    this.uniforms.delta.value.y = dx / d;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_TwistFilter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_TwistFilter.js.html deleted file mode 100755 index 97e8f4f..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_filters_TwistFilter.js.html +++ /dev/null @@ -1,380 +0,0 @@ - - - - - src/pixi/filters/TwistFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/TwistFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This filter applies a twist effect making display objects appear twisted in the given direction.
    - * 
    - * @class TwistFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.TwistFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        radius: {type: '1f', value:0.5},
    -        angle: {type: '1f', value:5},
    -        offset: {type: '2f', value:{x:0.5, y:0.5}}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform vec4 dimensions;',
    -        'uniform sampler2D uSampler;',
    -
    -        'uniform float radius;',
    -        'uniform float angle;',
    -        'uniform vec2 offset;',
    -
    -        'void main(void) {',
    -        '   vec2 coord = vTextureCoord - offset;',
    -        '   float distance = length(coord);',
    -
    -        '   if (distance < radius) {',
    -        '       float ratio = (radius - distance) / radius;',
    -        '       float angleMod = ratio * ratio * angle;',
    -        '       float s = sin(angleMod);',
    -        '       float c = cos(angleMod);',
    -        '       coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);',
    -        '   }',
    -
    -        '   gl_FragColor = texture2D(uSampler, coord+offset);',
    -        '}'
    -    ];
    -};
    -
    -PIXI.TwistFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.TwistFilter.prototype.constructor = PIXI.TwistFilter;
    -
    -/**
    - * This point describes the the offset of the twist.
    - * 
    - * @property offset
    - * @type Point
    - */
    -Object.defineProperty(PIXI.TwistFilter.prototype, 'offset', {
    -    get: function() {
    -        return this.uniforms.offset.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.offset.value = value;
    -    }
    -});
    -
    -/**
    - * This radius of the twist.
    - * 
    - * @property radius
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TwistFilter.prototype, 'radius', {
    -    get: function() {
    -        return this.uniforms.radius.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.radius.value = value;
    -    }
    -});
    -
    -/**
    - * This angle of the twist.
    - * 
    - * @property angle
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TwistFilter.prototype, 'angle', {
    -    get: function() {
    -        return this.uniforms.angle.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.angle.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_geom_Circle.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_geom_Circle.js.html deleted file mode 100755 index 8c0c076..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_geom_Circle.js.html +++ /dev/null @@ -1,362 +0,0 @@ - - - - - src/pixi/geom/Circle.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Circle.js

    - -
    -
    -/**
    - * @author Chad Engler <chad@pantherdev.com>
    - */
    -
    -/**
    - * The Circle object can be used to specify a hit area for displayObjects
    - *
    - * @class Circle
    - * @constructor
    - * @param x {Number} The X coordinate of the center of this circle
    - * @param y {Number} The Y coordinate of the center of this circle
    - * @param radius {Number} The radius of the circle
    - */
    -PIXI.Circle = function(x, y, radius)
    -{
    -    /**
    -     * @property x
    -     * @type Number
    -     * @default 0
    -     */
    -    this.x = x || 0;
    -
    -    /**
    -     * @property y
    -     * @type Number
    -     * @default 0
    -     */
    -    this.y = y || 0;
    -
    -    /**
    -     * @property radius
    -     * @type Number
    -     * @default 0
    -     */
    -    this.radius = radius || 0;
    -};
    -
    -/**
    - * Creates a clone of this Circle instance
    - *
    - * @method clone
    - * @return {Circle} a copy of the Circle
    - */
    -PIXI.Circle.prototype.clone = function()
    -{
    -    return new PIXI.Circle(this.x, this.y, this.radius);
    -};
    -
    -/**
    - * Checks whether the x and y coordinates given are contained within this circle
    - *
    - * @method contains
    - * @param x {Number} The X coordinate of the point to test
    - * @param y {Number} The Y coordinate of the point to test
    - * @return {Boolean} Whether the x/y coordinates are within this Circle
    - */
    -PIXI.Circle.prototype.contains = function(x, y)
    -{
    -    if(this.radius <= 0)
    -        return false;
    -
    -    var dx = (this.x - x),
    -        dy = (this.y - y),
    -        r2 = this.radius * this.radius;
    -
    -    dx *= dx;
    -    dy *= dy;
    -
    -    return (dx + dy <= r2);
    -};
    -
    -/**
    -* Returns the framing rectangle of the circle as a PIXI.Rectangle object
    -*
    -* @method getBounds
    -* @return {Rectangle} the framing rectangle
    -*/
    -PIXI.Circle.prototype.getBounds = function()
    -{
    -    return new PIXI.Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2);
    -};
    -
    -// constructor
    -PIXI.Circle.prototype.constructor = PIXI.Circle;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_geom_Ellipse.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_geom_Ellipse.js.html deleted file mode 100755 index f4ebbfb..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_geom_Ellipse.js.html +++ /dev/null @@ -1,370 +0,0 @@ - - - - - src/pixi/geom/Ellipse.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Ellipse.js

    - -
    -
    -/**
    - * @author Chad Engler <chad@pantherdev.com>
    - */
    -
    -/**
    - * The Ellipse object can be used to specify a hit area for displayObjects
    - *
    - * @class Ellipse
    - * @constructor
    - * @param x {Number} The X coordinate of the center of the ellipse
    - * @param y {Number} The Y coordinate of the center of the ellipse
    - * @param width {Number} The half width of this ellipse
    - * @param height {Number} The half height of this ellipse
    - */
    -PIXI.Ellipse = function(x, y, width, height)
    -{
    -    /**
    -     * @property x
    -     * @type Number
    -     * @default 0
    -     */
    -    this.x = x || 0;
    -
    -    /**
    -     * @property y
    -     * @type Number
    -     * @default 0
    -     */
    -    this.y = y || 0;
    -
    -    /**
    -     * @property width
    -     * @type Number
    -     * @default 0
    -     */
    -    this.width = width || 0;
    -
    -    /**
    -     * @property height
    -     * @type Number
    -     * @default 0
    -     */
    -    this.height = height || 0;
    -};
    -
    -/**
    - * Creates a clone of this Ellipse instance
    - *
    - * @method clone
    - * @return {Ellipse} a copy of the ellipse
    - */
    -PIXI.Ellipse.prototype.clone = function()
    -{
    -    return new PIXI.Ellipse(this.x, this.y, this.width, this.height);
    -};
    -
    -/**
    - * Checks whether the x and y coordinates given are contained within this ellipse
    - *
    - * @method contains
    - * @param x {Number} The X coordinate of the point to test
    - * @param y {Number} The Y coordinate of the point to test
    - * @return {Boolean} Whether the x/y coords are within this ellipse
    - */
    -PIXI.Ellipse.prototype.contains = function(x, y)
    -{
    -    if(this.width <= 0 || this.height <= 0)
    -        return false;
    -
    -    //normalize the coords to an ellipse with center 0,0
    -    var normx = ((x - this.x) / this.width),
    -        normy = ((y - this.y) / this.height);
    -
    -    normx *= normx;
    -    normy *= normy;
    -
    -    return (normx + normy <= 1);
    -};
    -
    -/**
    -* Returns the framing rectangle of the ellipse as a PIXI.Rectangle object
    -*
    -* @method getBounds
    -* @return {Rectangle} the framing rectangle
    -*/
    -PIXI.Ellipse.prototype.getBounds = function()
    -{
    -    return new PIXI.Rectangle(this.x - this.width, this.y - this.height, this.width, this.height);
    -};
    -
    -// constructor
    -PIXI.Ellipse.prototype.constructor = PIXI.Ellipse;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_geom_Matrix.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_geom_Matrix.js.html deleted file mode 100755 index f57168e..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_geom_Matrix.js.html +++ /dev/null @@ -1,546 +0,0 @@ - - - - - src/pixi/geom/Matrix.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Matrix.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The Matrix class is now an object, which makes it a lot faster, 
    - * here is a representation of it : 
    - * | a | b | tx|
    - * | c | d | ty|
    - * | 0 | 0 | 1 |
    - *
    - * @class Matrix
    - * @constructor
    - */
    -PIXI.Matrix = function()
    -{
    -    /**
    -     * @property a
    -     * @type Number
    -     * @default 1
    -     */
    -    this.a = 1;
    -
    -    /**
    -     * @property b
    -     * @type Number
    -     * @default 0
    -     */
    -    this.b = 0;
    -
    -    /**
    -     * @property c
    -     * @type Number
    -     * @default 0
    -     */
    -    this.c = 0;
    -
    -    /**
    -     * @property d
    -     * @type Number
    -     * @default 1
    -     */
    -    this.d = 1;
    -
    -    /**
    -     * @property tx
    -     * @type Number
    -     * @default 0
    -     */
    -    this.tx = 0;
    -
    -    /**
    -     * @property ty
    -     * @type Number
    -     * @default 0
    -     */
    -    this.ty = 0;
    -};
    -
    -/**
    - * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:
    - *
    - * a = array[0]
    - * b = array[1]
    - * c = array[3]
    - * d = array[4]
    - * tx = array[2]
    - * ty = array[5]
    - *
    - * @method fromArray
    - * @param array {Array} The array that the matrix will be populated from.
    - */
    -PIXI.Matrix.prototype.fromArray = function(array)
    -{
    -    this.a = array[0];
    -    this.b = array[1];
    -    this.c = array[3];
    -    this.d = array[4];
    -    this.tx = array[2];
    -    this.ty = array[5];
    -};
    -
    -/**
    - * Creates an array from the current Matrix object.
    - *
    - * @method toArray
    - * @param transpose {Boolean} Whether we need to transpose the matrix or not
    - * @return {Array} the newly created array which contains the matrix
    - */
    -PIXI.Matrix.prototype.toArray = function(transpose)
    -{
    -    if(!this.array) this.array = new PIXI.Float32Array(9);
    -    var array = this.array;
    -
    -    if(transpose)
    -    {
    -        array[0] = this.a;
    -        array[1] = this.b;
    -        array[2] = 0;
    -        array[3] = this.c;
    -        array[4] = this.d;
    -        array[5] = 0;
    -        array[6] = this.tx;
    -        array[7] = this.ty;
    -        array[8] = 1;
    -    }
    -    else
    -    {
    -        array[0] = this.a;
    -        array[1] = this.c;
    -        array[2] = this.tx;
    -        array[3] = this.b;
    -        array[4] = this.d;
    -        array[5] = this.ty;
    -        array[6] = 0;
    -        array[7] = 0;
    -        array[8] = 1;
    -    }
    -
    -    return array;
    -};
    -
    -/**
    - * Get a new position with the current transformation applied.
    - * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)
    - *
    - * @method apply
    - * @param pos {Point} The origin
    - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input)
    - * @return {Point} The new point, transformed through this matrix
    - */
    -PIXI.Matrix.prototype.apply = function(pos, newPos)
    -{
    -    newPos = newPos || new PIXI.Point();
    -
    -    newPos.x = this.a * pos.x + this.c * pos.y + this.tx;
    -    newPos.y = this.b * pos.x + this.d * pos.y + this.ty;
    -
    -    return newPos;
    -};
    -
    -/**
    - * Get a new position with the inverse of the current transformation applied.
    - * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)
    - *
    - * @method applyInverse
    - * @param pos {Point} The origin
    - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input)
    - * @return {Point} The new point, inverse-transformed through this matrix
    - */
    -PIXI.Matrix.prototype.applyInverse = function(pos, newPos)
    -{
    -    newPos = newPos || new PIXI.Point();
    -
    -    var id = 1 / (this.a * this.d + this.c * -this.b);
    -     
    -    newPos.x = this.d * id * pos.x + -this.c * id * pos.y + (this.ty * this.c - this.tx * this.d) * id;
    -    newPos.y = this.a * id * pos.y + -this.b * id * pos.x + (-this.ty * this.a + this.tx * this.b) * id;
    -
    -    return newPos;
    -};
    -
    -/**
    - * Translates the matrix on the x and y.
    - * 
    - * @method translate
    - * @param {Number} x
    - * @param {Number} y
    - * @return {Matrix} This matrix. Good for chaining method calls.
    - **/
    -PIXI.Matrix.prototype.translate = function(x, y)
    -{
    -    this.tx += x;
    -    this.ty += y;
    -    
    -    return this;
    -};
    -
    -/**
    - * Applies a scale transformation to the matrix.
    - * 
    - * @method scale
    - * @param {Number} x The amount to scale horizontally
    - * @param {Number} y The amount to scale vertically
    - * @return {Matrix} This matrix. Good for chaining method calls.
    - **/
    -PIXI.Matrix.prototype.scale = function(x, y)
    -{
    -    this.a *= x;
    -    this.d *= y;
    -    this.c *= x;
    -    this.b *= y;
    -    this.tx *= x;
    -    this.ty *= y;
    -
    -    return this;
    -};
    -
    -
    -/**
    - * Applies a rotation transformation to the matrix.
    - * @method rotate
    - * @param {Number} angle The angle in radians.
    - * @return {Matrix} This matrix. Good for chaining method calls.
    - **/
    -PIXI.Matrix.prototype.rotate = function(angle)
    -{
    -    var cos = Math.cos( angle );
    -    var sin = Math.sin( angle );
    -
    -    var a1 = this.a;
    -    var c1 = this.c;
    -    var tx1 = this.tx;
    -
    -    this.a = a1 * cos-this.b * sin;
    -    this.b = a1 * sin+this.b * cos;
    -    this.c = c1 * cos-this.d * sin;
    -    this.d = c1 * sin+this.d * cos;
    -    this.tx = tx1 * cos - this.ty * sin;
    -    this.ty = tx1 * sin + this.ty * cos;
    - 
    -    return this;
    -};
    -
    -/**
    - * Appends the given Matrix to this Matrix.
    - * 
    - * @method append
    - * @param {Matrix} matrix
    - * @return {Matrix} This matrix. Good for chaining method calls.
    - */
    -PIXI.Matrix.prototype.append = function(matrix)
    -{
    -    var a1 = this.a;
    -    var b1 = this.b;
    -    var c1 = this.c;
    -    var d1 = this.d;
    -
    -    this.a  = matrix.a * a1 + matrix.b * c1;
    -    this.b  = matrix.a * b1 + matrix.b * d1;
    -    this.c  = matrix.c * a1 + matrix.d * c1;
    -    this.d  = matrix.c * b1 + matrix.d * d1;
    -
    -    this.tx = matrix.tx * a1 + matrix.ty * c1 + this.tx;
    -    this.ty = matrix.tx * b1 + matrix.ty * d1 + this.ty;
    -    
    -    return this;
    -};
    -
    -/**
    - * Resets this Matix to an identity (default) matrix.
    - * 
    - * @method identity
    - * @return {Matrix} This matrix. Good for chaining method calls.
    - */
    -PIXI.Matrix.prototype.identity = function()
    -{
    -    this.a = 1;
    -    this.b = 0;
    -    this.c = 0;
    -    this.d = 1;
    -    this.tx = 0;
    -    this.ty = 0;
    -
    -    return this;
    -};
    -
    -PIXI.identityMatrix = new PIXI.Matrix();
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_geom_Point.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_geom_Point.js.html deleted file mode 100755 index c8dfbb2..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_geom_Point.js.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - src/pixi/geom/Point.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Point.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    - *
    - * @class Point
    - * @constructor
    - * @param x {Number} position of the point on the x axis
    - * @param y {Number} position of the point on the y axis
    - */
    -PIXI.Point = function(x, y)
    -{
    -    /**
    -     * @property x
    -     * @type Number
    -     * @default 0
    -     */
    -    this.x = x || 0;
    -
    -    /**
    -     * @property y
    -     * @type Number
    -     * @default 0
    -     */
    -    this.y = y || 0;
    -};
    -
    -/**
    - * Creates a clone of this point
    - *
    - * @method clone
    - * @return {Point} a copy of the point
    - */
    -PIXI.Point.prototype.clone = function()
    -{
    -    return new PIXI.Point(this.x, this.y);
    -};
    -
    -/**
    - * Sets the point to a new x and y position.
    - * If y is omitted, both x and y will be set to x.
    - * 
    - * @method set
    - * @param [x=0] {Number} position of the point on the x axis
    - * @param [y=0] {Number} position of the point on the y axis
    - */
    -PIXI.Point.prototype.set = function(x, y)
    -{
    -    this.x = x || 0;
    -    this.y = y || ( (y !== 0) ? this.x : 0 ) ;
    -};
    -
    -// constructor
    -PIXI.Point.prototype.constructor = PIXI.Point;
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_geom_Polygon.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_geom_Polygon.js.html deleted file mode 100755 index b0bc19f..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_geom_Polygon.js.html +++ /dev/null @@ -1,354 +0,0 @@ - - - - - src/pixi/geom/Polygon.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Polygon.js

    - -
    -
    -/**
    - * @author Adrien Brault <adrien.brault@gmail.com>
    - */
    -
    -/**
    - * @class Polygon
    - * @constructor
    - * @param points* {Array<Point>|Array<Number>|Point...|Number...} This can be an array of Points that form the polygon,
    - *      a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be
    - *      all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the
    - *      arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are
    - *      Numbers.
    - */
    -PIXI.Polygon = function(points)
    -{
    -    //if points isn't an array, use arguments as the array
    -    if(!(points instanceof Array))points = Array.prototype.slice.call(arguments);
    -
    -    //if this is a flat array of numbers, convert it to points
    -    if(points[0] instanceof PIXI.Point)
    -    {
    -        var p = [];
    -        for(var i = 0, il = points.length; i < il; i++)
    -        {
    -            p.push(points[i].x, points[i].y);
    -        }
    -
    -        points = p;
    -    }
    -
    -    this.closed = true;
    -    this.points = points;
    -};
    -
    -/**
    - * Creates a clone of this polygon
    - *
    - * @method clone
    - * @return {Polygon} a copy of the polygon
    - */
    -PIXI.Polygon.prototype.clone = function()
    -{
    -    var points = this.points.slice();
    -    return new PIXI.Polygon(points);
    -};
    -
    -/**
    - * Checks whether the x and y coordinates passed to this function are contained within this polygon
    - *
    - * @method contains
    - * @param x {Number} The X coordinate of the point to test
    - * @param y {Number} The Y coordinate of the point to test
    - * @return {Boolean} Whether the x/y coordinates are within this polygon
    - */
    -PIXI.Polygon.prototype.contains = function(x, y)
    -{
    -    var inside = false;
    -
    -    // use some raycasting to test hits
    -    // https://github.com/substack/point-in-polygon/blob/master/index.js
    -    var length = this.points.length / 2;
    -
    -    for(var i = 0, j = length - 1; i < length; j = i++)
    -    {
    -        var xi = this.points[i * 2], yi = this.points[i * 2 + 1],
    -            xj = this.points[j * 2], yj = this.points[j * 2 + 1],
    -            intersect = ((yi > y) !== (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi);
    -
    -        if(intersect) inside = !inside;
    -    }
    -
    -    return inside;
    -};
    -
    -// constructor
    -PIXI.Polygon.prototype.constructor = PIXI.Polygon;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_geom_Rectangle.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_geom_Rectangle.js.html deleted file mode 100755 index c17bec4..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_geom_Rectangle.js.html +++ /dev/null @@ -1,364 +0,0 @@ - - - - - src/pixi/geom/Rectangle.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Rectangle.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/
    - */
    -
    -/**
    - * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    - *
    - * @class Rectangle
    - * @constructor
    - * @param x {Number} The X coordinate of the upper-left corner of the rectangle
    - * @param y {Number} The Y coordinate of the upper-left corner of the rectangle
    - * @param width {Number} The overall width of this rectangle
    - * @param height {Number} The overall height of this rectangle
    - */
    -PIXI.Rectangle = function(x, y, width, height)
    -{
    -    /**
    -     * @property x
    -     * @type Number
    -     * @default 0
    -     */
    -    this.x = x || 0;
    -
    -    /**
    -     * @property y
    -     * @type Number
    -     * @default 0
    -     */
    -    this.y = y || 0;
    -
    -    /**
    -     * @property width
    -     * @type Number
    -     * @default 0
    -     */
    -    this.width = width || 0;
    -
    -    /**
    -     * @property height
    -     * @type Number
    -     * @default 0
    -     */
    -    this.height = height || 0;
    -};
    -
    -/**
    - * Creates a clone of this Rectangle
    - *
    - * @method clone
    - * @return {Rectangle} a copy of the rectangle
    - */
    -PIXI.Rectangle.prototype.clone = function()
    -{
    -    return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    -};
    -
    -/**
    - * Checks whether the x and y coordinates given are contained within this Rectangle
    - *
    - * @method contains
    - * @param x {Number} The X coordinate of the point to test
    - * @param y {Number} The Y coordinate of the point to test
    - * @return {Boolean} Whether the x/y coordinates are within this Rectangle
    - */
    -PIXI.Rectangle.prototype.contains = function(x, y)
    -{
    -    if(this.width <= 0 || this.height <= 0)
    -        return false;
    -
    -    var x1 = this.x;
    -    if(x >= x1 && x <= x1 + this.width)
    -    {
    -        var y1 = this.y;
    -
    -        if(y >= y1 && y <= y1 + this.height)
    -        {
    -            return true;
    -        }
    -    }
    -
    -    return false;
    -};
    -
    -// constructor
    -PIXI.Rectangle.prototype.constructor = PIXI.Rectangle;
    -
    -PIXI.EmptyRectangle = new PIXI.Rectangle(0,0,0,0);
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_geom_RoundedRectangle.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_geom_RoundedRectangle.js.html deleted file mode 100755 index 153da24..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_geom_RoundedRectangle.js.html +++ /dev/null @@ -1,372 +0,0 @@ - - - - - src/pixi/geom/RoundedRectangle.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/RoundedRectangle.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/
    - */
    -
    -/**
    - * the Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height.
    - *
    - * @class Rounded Rectangle
    - * @constructor
    - * @param x {Number} The X coordinate of the upper-left corner of the rounded rectangle
    - * @param y {Number} The Y coordinate of the upper-left corner of the rounded rectangle
    - * @param width {Number} The overall width of this rounded rectangle
    - * @param height {Number} The overall height of this rounded rectangle
    - * @param radius {Number} The overall radius of this corners of this rounded rectangle
    - */
    -PIXI.RoundedRectangle = function(x, y, width, height, radius)
    -{
    -    /**
    -     * @property x
    -     * @type Number
    -     * @default 0
    -     */
    -    this.x = x || 0;
    -
    -    /**
    -     * @property y
    -     * @type Number
    -     * @default 0
    -     */
    -    this.y = y || 0;
    -
    -    /**
    -     * @property width
    -     * @type Number
    -     * @default 0
    -     */
    -    this.width = width || 0;
    -
    -    /**
    -     * @property height
    -     * @type Number
    -     * @default 0
    -     */
    -    this.height = height || 0;
    -
    -    /**
    -     * @property radius
    -     * @type Number
    -     * @default 20
    -     */
    -    this.radius = radius || 20;
    -};
    -
    -/**
    - * Creates a clone of this Rounded Rectangle
    - *
    - * @method clone
    - * @return {rounded Rectangle} a copy of the rounded rectangle
    - */
    -PIXI.RoundedRectangle.prototype.clone = function()
    -{
    -    return new PIXI.RoundedRectangle(this.x, this.y, this.width, this.height, this.radius);
    -};
    -
    -/**
    - * Checks whether the x and y coordinates given are contained within this Rounded Rectangle
    - *
    - * @method contains
    - * @param x {Number} The X coordinate of the point to test
    - * @param y {Number} The Y coordinate of the point to test
    - * @return {Boolean} Whether the x/y coordinates are within this Rounded Rectangle
    - */
    -PIXI.RoundedRectangle.prototype.contains = function(x, y)
    -{
    -    if(this.width <= 0 || this.height <= 0)
    -        return false;
    -
    -    var x1 = this.x;
    -    if(x >= x1 && x <= x1 + this.width)
    -    {
    -        var y1 = this.y;
    -
    -        if(y >= y1 && y <= y1 + this.height)
    -        {
    -            return true;
    -        }
    -    }
    -
    -    return false;
    -};
    -
    -// constructor
    -PIXI.RoundedRectangle.prototype.constructor = PIXI.RoundedRectangle;
    -
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_loaders_AssetLoader.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_loaders_AssetLoader.js.html deleted file mode 100755 index 43a5333..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_loaders_AssetLoader.js.html +++ /dev/null @@ -1,438 +0,0 @@ - - - - - src/pixi/loaders/AssetLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/AssetLoader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * 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
    - * @uses EventTarget
    - * @param assetURLs {Array<String>} 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'.
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.AssetLoader = function(assetURLs, crossorigin)
    -{
    -    /**
    -     * The array of asset URLs that are going to be loaded
    -     *
    -     * @property assetURLs
    -     * @type Array<String>
    -     */
    -    this.assetURLs = assetURLs;
    -
    -    /**
    -     * Whether the requests should be treated as cross origin
    -     *
    -     * @property crossorigin
    -     * @type Boolean
    -     */
    -    this.crossorigin = crossorigin;
    -
    -    /**
    -     * Maps file extension to loader types
    -     *
    -     * @property loadersByType
    -     * @type Object
    -     */
    -    this.loadersByType = {
    -        'jpg':  PIXI.ImageLoader,
    -        'jpeg': PIXI.ImageLoader,
    -        'png':  PIXI.ImageLoader,
    -        'gif':  PIXI.ImageLoader,
    -        'webp': PIXI.ImageLoader,
    -        'json': PIXI.JsonLoader,
    -        'atlas': PIXI.AtlasLoader,
    -        'anim': PIXI.SpineLoader,
    -        'xml':  PIXI.BitmapFontLoader,
    -        'fnt':  PIXI.BitmapFontLoader
    -    };
    -};
    -
    -PIXI.EventTarget.mixin(PIXI.AssetLoader.prototype);
    -
    -/**
    - * Fired when an item has loaded
    - * @event onProgress
    - */
    -
    -/**
    - * Fired when all the assets have loaded
    - * @event onComplete
    - */
    -
    -// constructor
    -PIXI.AssetLoader.prototype.constructor = PIXI.AssetLoader;
    -
    -/**
    - * Given a filename, returns its extension.
    - *
    - * @method _getDataType
    - * @param str {String} the name of the asset
    - */
    -PIXI.AssetLoader.prototype._getDataType = function(str)
    -{
    -    var test = 'data:';
    -    //starts with 'data:'
    -    var start = str.slice(0, test.length).toLowerCase();
    -    if (start === test) {
    -        var data = str.slice(test.length);
    -
    -        var sepIdx = data.indexOf(',');
    -        if (sepIdx === -1) //malformed data URI scheme
    -            return null;
    -
    -        //e.g. 'image/gif;base64' => 'image/gif'
    -        var info = data.slice(0, sepIdx).split(';')[0];
    -
    -        //We might need to handle some special cases here...
    -        //standardize text/plain to 'txt' file extension
    -        if (!info || info.toLowerCase() === 'text/plain')
    -            return 'txt';
    -
    -        //User specified mime type, try splitting it by '/'
    -        return info.split('/').pop().toLowerCase();
    -    }
    -
    -    return null;
    -};
    -
    -/**
    - * Starts loading the assets sequentially
    - *
    - * @method load
    - */
    -PIXI.AssetLoader.prototype.load = function()
    -{
    -    var scope = this;
    -
    -    function onLoad(evt) {
    -        scope.onAssetLoaded(evt.data.content);
    -    }
    -
    -    this.loadCount = this.assetURLs.length;
    -
    -    for (var i=0; i < this.assetURLs.length; i++)
    -    {
    -        var fileName = this.assetURLs[i];
    -        //first see if we have a data URI scheme..
    -        var fileType = this._getDataType(fileName);
    -
    -        //if not, assume it's a file URI
    -        if (!fileType)
    -            fileType = fileName.split('?').shift().split('.').pop().toLowerCase();
    -
    -        var Constructor = this.loadersByType[fileType];
    -        if(!Constructor)
    -            throw new Error(fileType + ' is an unsupported file type');
    -
    -        var loader = new Constructor(fileName, this.crossorigin);
    -
    -        loader.on('loaded', onLoad);
    -        loader.load();
    -    }
    -};
    -
    -/**
    - * Invoked after each file is loaded
    - *
    - * @method onAssetLoaded
    - * @private
    - */
    -PIXI.AssetLoader.prototype.onAssetLoaded = function(loader)
    -{
    -    this.loadCount--;
    -    this.emit('onProgress', { content: this, loader: loader });
    -    if (this.onProgress) this.onProgress(loader);
    -
    -    if (!this.loadCount)
    -    {
    -        this.emit('onComplete', { content: this });
    -        if(this.onComplete) this.onComplete();
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_loaders_AtlasLoader.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_loaders_AtlasLoader.js.html deleted file mode 100755 index 13fc730..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_loaders_AtlasLoader.js.html +++ /dev/null @@ -1,468 +0,0 @@ - - - - - src/pixi/loaders/AtlasLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/AtlasLoader.js

    - -
    -
    -/**
    - * @author Martin Kelm http://mkelm.github.com
    - */
    -
    -/**
    - * The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event.
    - *
    - * To generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format.
    - * 
    - * It is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to 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.fromFrameId()
    - * 
    - * @class AtlasLoader
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the JSON file
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.AtlasLoader = function (url, crossorigin) {
    -    this.url = url;
    -    this.baseUrl = url.replace(/[^\/]*$/, '');
    -    this.crossorigin = crossorigin;
    -    this.loaded = false;
    -
    -};
    -
    -// constructor
    -PIXI.AtlasLoader.constructor = PIXI.AtlasLoader;
    -
    -PIXI.EventTarget.mixin(PIXI.AtlasLoader.prototype);
    -
    - /**
    - * Starts loading the JSON file
    - *
    - * @method load
    - */
    -PIXI.AtlasLoader.prototype.load = function () {
    -    this.ajaxRequest = new PIXI.AjaxRequest();
    -    this.ajaxRequest.onreadystatechange = this.onAtlasLoaded.bind(this);
    -
    -    this.ajaxRequest.open('GET', this.url, true);
    -    if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/json');
    -    this.ajaxRequest.send(null);
    -};
    -
    -/**
    - * Invoked when the Atlas has fully loaded. Parses the JSON and builds the texture frames.
    - * 
    - * @method onAtlasLoaded
    - * @private
    - */
    -PIXI.AtlasLoader.prototype.onAtlasLoaded = function () {
    -    if (this.ajaxRequest.readyState === 4) {
    -        if (this.ajaxRequest.status === 200 || window.location.href.indexOf('http') === -1) {
    -            this.atlas = {
    -                meta : {
    -                    image : []
    -                },
    -                frames : []
    -            };
    -            var result = this.ajaxRequest.responseText.split(/\r?\n/);
    -            var lineCount = -3;
    -
    -            var currentImageId = 0;
    -            var currentFrame = null;
    -            var nameInNextLine = false;
    -
    -            var i = 0,
    -                j = 0,
    -                selfOnLoaded = this.onLoaded.bind(this);
    -
    -            // parser without rotation support yet!
    -            for (i = 0; i < result.length; i++) {
    -                result[i] = result[i].replace(/^\s+|\s+$/g, '');
    -                if (result[i] === '') {
    -                    nameInNextLine = i+1;
    -                }
    -                if (result[i].length > 0) {
    -                    if (nameInNextLine === i) {
    -                        this.atlas.meta.image.push(result[i]);
    -                        currentImageId = this.atlas.meta.image.length - 1;
    -                        this.atlas.frames.push({});
    -                        lineCount = -3;
    -                    } else if (lineCount > 0) {
    -                        if (lineCount % 7 === 1) { // frame name
    -                            if (currentFrame != null) { //jshint ignore:line
    -                                this.atlas.frames[currentImageId][currentFrame.name] = currentFrame;
    -                            }
    -                            currentFrame = { name: result[i], frame : {} };
    -                        } else {
    -                            var text = result[i].split(' ');
    -                            if (lineCount % 7 === 3) { // position
    -                                currentFrame.frame.x = Number(text[1].replace(',', ''));
    -                                currentFrame.frame.y = Number(text[2]);
    -                            } else if (lineCount % 7 === 4) { // size
    -                                currentFrame.frame.w = Number(text[1].replace(',', ''));
    -                                currentFrame.frame.h = Number(text[2]);
    -                            } else if (lineCount % 7 === 5) { // real size
    -                                var realSize = {
    -                                    x : 0,
    -                                    y : 0,
    -                                    w : Number(text[1].replace(',', '')),
    -                                    h : Number(text[2])
    -                                };
    -
    -                                if (realSize.w > currentFrame.frame.w || realSize.h > currentFrame.frame.h) {
    -                                    currentFrame.trimmed = true;
    -                                    currentFrame.realSize = realSize;
    -                                } else {
    -                                    currentFrame.trimmed = false;
    -                                }
    -                            }
    -                        }
    -                    }
    -                    lineCount++;
    -                }
    -            }
    -
    -            if (currentFrame != null) { //jshint ignore:line
    -                this.atlas.frames[currentImageId][currentFrame.name] = currentFrame;
    -            }
    -
    -            if (this.atlas.meta.image.length > 0) {
    -                this.images = [];
    -                for (j = 0; j < this.atlas.meta.image.length; j++) {
    -                    // sprite sheet
    -                    var textureUrl = this.baseUrl + this.atlas.meta.image[j];
    -                    var frameData = this.atlas.frames[j];
    -                    this.images.push(new PIXI.ImageLoader(textureUrl, this.crossorigin));
    -
    -                    for (i in frameData) {
    -                        var rect = frameData[i].frame;
    -                        if (rect) {
    -                            PIXI.TextureCache[i] = new PIXI.Texture(this.images[j].texture.baseTexture, {
    -                                x: rect.x,
    -                                y: rect.y,
    -                                width: rect.w,
    -                                height: rect.h
    -                            });
    -                            if (frameData[i].trimmed) {
    -                                PIXI.TextureCache[i].realSize = frameData[i].realSize;
    -                                // trim in pixi not supported yet, todo update trim properties if it is done ...
    -                                PIXI.TextureCache[i].trim.x = 0;
    -                                PIXI.TextureCache[i].trim.y = 0;
    -                            }
    -                        }
    -                    }
    -                }
    -
    -                this.currentImageId = 0;
    -                for (j = 0; j < this.images.length; j++) {
    -                    this.images[j].on('loaded', selfOnLoaded);
    -                }
    -                this.images[this.currentImageId].load();
    -
    -            } else {
    -                this.onLoaded();
    -            }
    -
    -        } else {
    -            this.onError();
    -        }
    -    }
    -};
    -
    -/**
    - * Invoked when json file has loaded.
    - * 
    - * @method onLoaded
    - * @private
    - */
    -PIXI.AtlasLoader.prototype.onLoaded = function () {
    -    if (this.images.length - 1 > this.currentImageId) {
    -        this.currentImageId++;
    -        this.images[this.currentImageId].load();
    -    } else {
    -        this.loaded = true;
    -        this.emit('loaded', { content: this });
    -    }
    -};
    -
    -/**
    - * Invoked when an error occurs.
    - * 
    - * @method onError
    - * @private
    - */
    -PIXI.AtlasLoader.prototype.onError = function () {
    -    this.emit('error', { content: this });
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_loaders_BitmapFontLoader.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_loaders_BitmapFontLoader.js.html deleted file mode 100755 index 489b3b0..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_loaders_BitmapFontLoader.js.html +++ /dev/null @@ -1,439 +0,0 @@ - - - - - src/pixi/loaders/BitmapFontLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/BitmapFontLoader.js

    - -
    -
    -/**
    - * @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
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the sprite sheet JSON file
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.BitmapFontLoader = function(url, crossorigin)
    -{
    -    /**
    -     * The url of the bitmap font data
    -     *
    -     * @property url
    -     * @type String
    -     */
    -    this.url = url;
    -
    -    /**
    -     * Whether the requests should be treated as cross origin
    -     *
    -     * @property crossorigin
    -     * @type Boolean
    -     */
    -    this.crossorigin = crossorigin;
    -
    -    /**
    -     * [read-only] The base url of the bitmap font data
    -     *
    -     * @property baseUrl
    -     * @type String
    -     * @readOnly
    -     */
    -    this.baseUrl = url.replace(/[^\/]*$/, '');
    -
    -    /**
    -     * [read-only] The texture of the bitmap font
    -     *
    -     * @property texture
    -     * @type Texture
    -     */
    -    this.texture = null;
    -};
    -
    -// constructor
    -PIXI.BitmapFontLoader.prototype.constructor = PIXI.BitmapFontLoader;
    -PIXI.EventTarget.mixin(PIXI.BitmapFontLoader.prototype);
    -
    -/**
    - * Loads the XML font data
    - *
    - * @method load
    - */
    -PIXI.BitmapFontLoader.prototype.load = function()
    -{
    -    this.ajaxRequest = new PIXI.AjaxRequest();
    -    this.ajaxRequest.onreadystatechange = this.onXMLLoaded.bind(this);
    -
    -    this.ajaxRequest.open('GET', this.url, true);
    -    if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/xml');
    -    this.ajaxRequest.send(null);
    -};
    -
    -/**
    - * Invoked when the XML file is loaded, parses the data.
    - *
    - * @method onXMLLoaded
    - * @private
    - */
    -PIXI.BitmapFontLoader.prototype.onXMLLoaded = function()
    -{
    -    if (this.ajaxRequest.readyState === 4)
    -    {
    -        if (this.ajaxRequest.status === 200 || window.location.protocol.indexOf('http') === -1)
    -        {
    -            var responseXML = this.ajaxRequest.responseXML;
    -            if(!responseXML || /MSIE 9/i.test(navigator.userAgent) || navigator.isCocoonJS) {
    -                if(typeof(window.DOMParser) === 'function') {
    -                    var domparser = new DOMParser();
    -                    responseXML = domparser.parseFromString(this.ajaxRequest.responseText, 'text/xml');
    -                } else {
    -                    var div = document.createElement('div');
    -                    div.innerHTML = this.ajaxRequest.responseText;
    -                    responseXML = div;
    -                }
    -            }
    -
    -            var textureUrl = this.baseUrl + responseXML.getElementsByTagName('page')[0].getAttribute('file');
    -            var image = new PIXI.ImageLoader(textureUrl, this.crossorigin);
    -            this.texture = image.texture.baseTexture;
    -
    -            var data = {};
    -            var info = responseXML.getElementsByTagName('info')[0];
    -            var common = responseXML.getElementsByTagName('common')[0];
    -            data.font = info.getAttribute('face');
    -            data.size = parseInt(info.getAttribute('size'), 10);
    -            data.lineHeight = parseInt(common.getAttribute('lineHeight'), 10);
    -            data.chars = {};
    -
    -            //parse letters
    -            var letters = responseXML.getElementsByTagName('char');
    -
    -            for (var i = 0; i < letters.length; i++)
    -            {
    -                var charCode = parseInt(letters[i].getAttribute('id'), 10);
    -
    -                var textureRect = new PIXI.Rectangle(
    -                    parseInt(letters[i].getAttribute('x'), 10),
    -                    parseInt(letters[i].getAttribute('y'), 10),
    -                    parseInt(letters[i].getAttribute('width'), 10),
    -                    parseInt(letters[i].getAttribute('height'), 10)
    -                );
    -
    -                data.chars[charCode] = {
    -                    xOffset: parseInt(letters[i].getAttribute('xoffset'), 10),
    -                    yOffset: parseInt(letters[i].getAttribute('yoffset'), 10),
    -                    xAdvance: parseInt(letters[i].getAttribute('xadvance'), 10),
    -                    kerning: {},
    -                    texture: PIXI.TextureCache[charCode] = new PIXI.Texture(this.texture, textureRect)
    -
    -                };
    -            }
    -
    -            //parse kernings
    -            var kernings = responseXML.getElementsByTagName('kerning');
    -            for (i = 0; i < kernings.length; i++)
    -            {
    -                var first = parseInt(kernings[i].getAttribute('first'), 10);
    -                var second = parseInt(kernings[i].getAttribute('second'), 10);
    -                var amount = parseInt(kernings[i].getAttribute('amount'), 10);
    -
    -                data.chars[second].kerning[first] = amount;
    -
    -            }
    -
    -            PIXI.BitmapText.fonts[data.font] = data;
    -
    -            image.addEventListener('loaded', this.onLoaded.bind(this));
    -            image.load();
    -        }
    -    }
    -};
    -
    -/**
    - * Invoked when all files are loaded (xml/fnt and texture)
    - *
    - * @method onLoaded
    - * @private
    - */
    -PIXI.BitmapFontLoader.prototype.onLoaded = function()
    -{
    -    this.emit('loaded', { content: this });
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_loaders_ImageLoader.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_loaders_ImageLoader.js.html deleted file mode 100755 index 7ca22b2..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_loaders_ImageLoader.js.html +++ /dev/null @@ -1,380 +0,0 @@ - - - - - src/pixi/loaders/ImageLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/ImageLoader.js

    - -
    -
    -/**
    - * @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.fromFrame() and PIXI.Sprite.fromFrame()
    - * When loaded this class will dispatch a 'loaded' event
    - *
    - * @class ImageLoader
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the image
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.ImageLoader = function(url, crossorigin)
    -{
    -    /**
    -     * The texture being loaded
    -     *
    -     * @property texture
    -     * @type Texture
    -     */
    -    this.texture = PIXI.Texture.fromImage(url, crossorigin);
    -
    -    /**
    -     * if the image is loaded with loadFramedSpriteSheet
    -     * frames will contain the sprite sheet frames
    -     *
    -     * @property frames
    -     * @type Array
    -     * @readOnly
    -     */
    -    this.frames = [];
    -};
    -
    -// constructor
    -PIXI.ImageLoader.prototype.constructor = PIXI.ImageLoader;
    -
    -PIXI.EventTarget.mixin(PIXI.ImageLoader.prototype);
    -
    -/**
    - * Loads image or takes it from cache
    - *
    - * @method load
    - */
    -PIXI.ImageLoader.prototype.load = function()
    -{
    -    if(!this.texture.baseTexture.hasLoaded)
    -    {
    -        this.texture.baseTexture.on('loaded', this.onLoaded.bind(this));
    -    }
    -    else
    -    {
    -        this.onLoaded();
    -    }
    -};
    -
    -/**
    - * Invoked when image file is loaded or it is already cached and ready to use
    - *
    - * @method onLoaded
    - * @private
    - */
    -PIXI.ImageLoader.prototype.onLoaded = function()
    -{
    -    this.emit('loaded', { content: this });
    -};
    -
    -/**
    - * Loads image and split it to uniform sized frames
    - *
    - * @method loadFramedSpriteSheet
    - * @param frameWidth {Number} width of each frame
    - * @param frameHeight {Number} height of each frame
    - * @param textureName {String} if given, the frames will be cached in <textureName>-<ord> format
    - */
    -PIXI.ImageLoader.prototype.loadFramedSpriteSheet = function(frameWidth, frameHeight, textureName)
    -{
    -    this.frames = [];
    -    var cols = Math.floor(this.texture.width / frameWidth);
    -    var rows = Math.floor(this.texture.height / frameHeight);
    -
    -    var i=0;
    -    for (var y=0; y<rows; y++)
    -    {
    -        for (var x=0; x<cols; x++,i++)
    -        {
    -            var texture = new PIXI.Texture(this.texture.baseTexture, {
    -                x: x*frameWidth,
    -                y: y*frameHeight,
    -                width: frameWidth,
    -                height: frameHeight
    -            });
    -
    -            this.frames.push(texture);
    -            if (textureName) PIXI.TextureCache[textureName + '-' + i] = texture;
    -        }
    -    }
    -
    -	this.load();
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_loaders_JsonLoader.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_loaders_JsonLoader.js.html deleted file mode 100755 index 0aeaff7..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_loaders_JsonLoader.js.html +++ /dev/null @@ -1,466 +0,0 @@ - - - - - src/pixi/loaders/JsonLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/JsonLoader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The json file loader is used to load in JSON data and parse it
    - * When loaded this class will dispatch a 'loaded' event
    - * If loading fails this class will dispatch an 'error' event
    - *
    - * @class JsonLoader
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the JSON file
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.JsonLoader = function (url, crossorigin) {
    -
    -    /**
    -     * The url of the bitmap font data
    -     *
    -     * @property url
    -     * @type String
    -     */
    -    this.url = url;
    -
    -    /**
    -     * Whether the requests should be treated as cross origin
    -     *
    -     * @property crossorigin
    -     * @type Boolean
    -     */
    -    this.crossorigin = crossorigin;
    -
    -    /**
    -     * [read-only] The base url of the bitmap font data
    -     *
    -     * @property baseUrl
    -     * @type String
    -     * @readOnly
    -     */
    -    this.baseUrl = url.replace(/[^\/]*$/, '');
    -
    -    /**
    -     * [read-only] Whether the data has loaded yet
    -     *
    -     * @property loaded
    -     * @type Boolean
    -     * @readOnly
    -     */
    -    this.loaded = false;
    -
    -};
    -
    -// constructor
    -PIXI.JsonLoader.prototype.constructor = PIXI.JsonLoader;
    -
    -PIXI.EventTarget.mixin(PIXI.JsonLoader.prototype);
    -
    -/**
    - * Loads the JSON data
    - *
    - * @method load
    - */
    -PIXI.JsonLoader.prototype.load = function () {
    -
    -    if(window.XDomainRequest && this.crossorigin)
    -    {
    -        this.ajaxRequest = new window.XDomainRequest();
    -
    -        // XDomainRequest has a few quirks. Occasionally it will abort requests
    -        // A way to avoid this is to make sure ALL callbacks are set even if not used
    -        // More info here: http://stackoverflow.com/questions/15786966/xdomainrequest-aborts-post-on-ie-9
    -        this.ajaxRequest.timeout = 3000;
    -
    -        this.ajaxRequest.onerror = this.onError.bind(this);
    -
    -        this.ajaxRequest.ontimeout = this.onError.bind(this);
    -
    -        this.ajaxRequest.onprogress = function() {};
    -
    -    }
    -    else if (window.XMLHttpRequest)
    -    {
    -        this.ajaxRequest = new window.XMLHttpRequest();
    -    }
    -    else
    -    {
    -        this.ajaxRequest = new window.ActiveXObject('Microsoft.XMLHTTP');
    -    }
    -
    -    this.ajaxRequest.onload = this.onJSONLoaded.bind(this);
    -
    -    this.ajaxRequest.open('GET',this.url,true);
    -
    -    this.ajaxRequest.send();
    -};
    -
    -/**
    - * Invoked when the JSON file is loaded.
    - *
    - * @method onJSONLoaded
    - * @private
    - */
    -PIXI.JsonLoader.prototype.onJSONLoaded = function () {
    -
    -    if(!this.ajaxRequest.responseText )
    -    {
    -        this.onError();
    -        return;
    -    }
    -
    -    this.json = JSON.parse(this.ajaxRequest.responseText);
    -
    -    if(this.json.frames)
    -    {
    -        // sprite sheet
    -        var textureUrl = this.baseUrl + this.json.meta.image;
    -        var image = new PIXI.ImageLoader(textureUrl, this.crossorigin);
    -        var frameData = this.json.frames;
    -
    -        this.texture = image.texture.baseTexture;
    -        image.addEventListener('loaded', this.onLoaded.bind(this));
    -
    -        for (var i in frameData)
    -        {
    -            var rect = frameData[i].frame;
    -
    -            if (rect)
    -            {
    -                var textureSize = new PIXI.Rectangle(rect.x, rect.y, rect.w, rect.h);
    -                var crop = textureSize.clone();
    -                var trim = null;
    -                
    -                //  Check to see if the sprite is trimmed
    -                if (frameData[i].trimmed)
    -                {
    -                    var actualSize = frameData[i].sourceSize;
    -                    var realSize = frameData[i].spriteSourceSize;
    -                    trim = new PIXI.Rectangle(realSize.x, realSize.y, actualSize.w, actualSize.h);
    -                }
    -                PIXI.TextureCache[i] = new PIXI.Texture(this.texture, textureSize, crop, trim);
    -            }
    -        }
    -
    -        image.load();
    -
    -    }
    -    else if(this.json.bones)
    -    {
    -        // spine animation
    -        var spineJsonParser = new spine.SkeletonJson();
    -        var skeletonData = spineJsonParser.readSkeletonData(this.json);
    -        PIXI.AnimCache[this.url] = skeletonData;
    -        this.onLoaded();
    -    }
    -    else
    -    {
    -        this.onLoaded();
    -    }
    -};
    -
    -/**
    - * Invoked when the json file has loaded.
    - *
    - * @method onLoaded
    - * @private
    - */
    -PIXI.JsonLoader.prototype.onLoaded = function () {
    -    this.loaded = true;
    -    this.dispatchEvent({
    -        type: 'loaded',
    -        content: this
    -    });
    -};
    -
    -/**
    - * Invoked if an error occurs.
    - *
    - * @method onError
    - * @private
    - */
    -PIXI.JsonLoader.prototype.onError = function () {
    -
    -    this.dispatchEvent({
    -        type: 'error',
    -        content: this
    -    });
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_loaders_SpineLoader.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_loaders_SpineLoader.js.html deleted file mode 100755 index d56935e..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_loaders_SpineLoader.js.html +++ /dev/null @@ -1,359 +0,0 @@ - - - - - src/pixi/loaders/SpineLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/SpineLoader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * based on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi
    - *
    - * Awesome JS run time provided by EsotericSoftware
    - * https://github.com/EsotericSoftware/spine-runtimes
    - *
    - */
    -
    -/**
    - * The Spine loader is used to load in JSON spine data
    - * To generate the data you need to use http://esotericsoftware.com/ and export in the "JSON" format
    - * Due to a clash of names  You will need to change the extension of the spine file from *.json to *.anim for it to load
    - * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source
    - * You will need to generate a sprite sheet to accompany the spine data
    - * When loaded this class will dispatch a "loaded" event
    - *
    - * @class SpineLoader
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the JSON file
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.SpineLoader = function(url, crossorigin)
    -{
    -    /**
    -     * The url of the bitmap font data
    -     *
    -     * @property url
    -     * @type String
    -     */
    -    this.url = url;
    -
    -    /**
    -     * Whether the requests should be treated as cross origin
    -     *
    -     * @property crossorigin
    -     * @type Boolean
    -     */
    -    this.crossorigin = crossorigin;
    -
    -    /**
    -     * [read-only] Whether the data has loaded yet
    -     *
    -     * @property loaded
    -     * @type Boolean
    -     * @readOnly
    -     */
    -    this.loaded = false;
    -};
    -
    -PIXI.SpineLoader.prototype.constructor = PIXI.SpineLoader;
    -
    -PIXI.EventTarget.mixin(PIXI.SpineLoader.prototype);
    -
    -/**
    - * Loads the JSON data
    - *
    - * @method load
    - */
    -PIXI.SpineLoader.prototype.load = function () {
    -
    -    var scope = this;
    -    var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin);
    -    jsonLoader.on('loaded', function (event) {
    -        scope.json = event.data.content.json;
    -        scope.onLoaded();
    -    });
    -    jsonLoader.load();
    -};
    -
    -/**
    - * Invoked when JSON file is loaded.
    - *
    - * @method onLoaded
    - * @private
    - */
    -PIXI.SpineLoader.prototype.onLoaded = function () {
    -    this.loaded = true;
    -    this.emit('loaded', { content: this });
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_loaders_SpriteSheetLoader.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_loaders_SpriteSheetLoader.js.html deleted file mode 100755 index 60e57df..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_loaders_SpriteSheetLoader.js.html +++ /dev/null @@ -1,372 +0,0 @@ - - - - - src/pixi/loaders/SpriteSheetLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/SpriteSheetLoader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * 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 in 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 a 'texture atlas') as it means sprites 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.fromFrameId()
    - * This loader will load the image file that the Spritesheet points to as well as the data.
    - * When loaded this class will dispatch a 'loaded' event
    - *
    - * @class SpriteSheetLoader
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the sprite sheet JSON file
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.SpriteSheetLoader = function (url, crossorigin) {
    -
    -    /**
    -     * The url of the atlas data
    -     *
    -     * @property url
    -     * @type String
    -     */
    -    this.url = url;
    -
    -    /**
    -     * Whether the requests should be treated as cross origin
    -     *
    -     * @property crossorigin
    -     * @type Boolean
    -     */
    -    this.crossorigin = crossorigin;
    -
    -    /**
    -     * [read-only] The base url of the bitmap font data
    -     *
    -     * @property baseUrl
    -     * @type String
    -     * @readOnly
    -     */
    -    this.baseUrl = url.replace(/[^\/]*$/, '');
    -
    -    /**
    -     * The texture being loaded
    -     *
    -     * @property texture
    -     * @type Texture
    -     */
    -    this.texture = null;
    -
    -    /**
    -     * The frames of the sprite sheet
    -     *
    -     * @property frames
    -     * @type Object
    -     */
    -    this.frames = {};
    -};
    -
    -// constructor
    -PIXI.SpriteSheetLoader.prototype.constructor = PIXI.SpriteSheetLoader;
    -
    -PIXI.EventTarget.mixin(PIXI.SpriteSheetLoader.prototype);
    -
    -/**
    - * This will begin loading the JSON file
    - *
    - * @method load
    - */
    -PIXI.SpriteSheetLoader.prototype.load = function () {
    -    var scope = this;
    -    var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin);
    -    jsonLoader.on('loaded', function (event) {
    -        scope.json = event.data.content.json;
    -        scope.onLoaded();
    -    });
    -    jsonLoader.load();
    -};
    -
    -/**
    - * Invoke when all files are loaded (json and texture)
    - *
    - * @method onLoaded
    - * @private
    - */
    -PIXI.SpriteSheetLoader.prototype.onLoaded = function () {
    -    this.emit('loaded', {
    -        content: this
    -    });
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_primitives_Graphics.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_primitives_Graphics.js.html deleted file mode 100755 index 4161dd1..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_primitives_Graphics.js.html +++ /dev/null @@ -1,1403 +0,0 @@ - - - - - src/pixi/primitives/Graphics.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/primitives/Graphics.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and color and fill them.
    - * 
    - * @class Graphics
    - * @extends DisplayObjectContainer
    - * @constructor
    - */
    -PIXI.Graphics = function()
    -{
    -    PIXI.DisplayObjectContainer.call( this );
    -
    -    this.renderable = true;
    -
    -    /**
    -     * The alpha value used when filling the Graphics object.
    -     *
    -     * @property fillAlpha
    -     * @type Number
    -     */
    -    this.fillAlpha = 1;
    -
    -    /**
    -     * The width (thickness) of any lines drawn.
    -     *
    -     * @property lineWidth
    -     * @type Number
    -     */
    -    this.lineWidth = 0;
    -
    -    /**
    -     * The color of any lines drawn.
    -     *
    -     * @property lineColor
    -     * @type String
    -     * @default 0
    -     */
    -    this.lineColor = 0;
    -
    -    /**
    -     * Graphics data
    -     *
    -     * @property graphicsData
    -     * @type Array
    -     * @private
    -     */
    -    this.graphicsData = [];
    -
    -    /**
    -     * The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint.
    -     *
    -     * @property tint
    -     * @type Number
    -     * @default 0xFFFFFF
    -     */
    -    this.tint = 0xFFFFFF;
    -    
    -    /**
    -     * The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode.
    -     *
    -     * @property blendMode
    -     * @type Number
    -     * @default PIXI.blendModes.NORMAL;
    -     */
    -    this.blendMode = PIXI.blendModes.NORMAL;
    -    
    -    /**
    -     * Current path
    -     *
    -     * @property currentPath
    -     * @type Object
    -     * @private
    -     */
    -    this.currentPath = null;
    -    
    -    /**
    -     * Array containing some WebGL-related properties used by the WebGL renderer.
    -     *
    -     * @property _webGL
    -     * @type Array
    -     * @private
    -     */
    -    this._webGL = [];
    -
    -    /**
    -     * Whether this shape is being used as a mask.
    -     *
    -     * @property isMask
    -     * @type Boolean
    -     */
    -    this.isMask = false;
    -
    -    /**
    -     * The bounds' padding used for bounds calculation.
    -     *
    -     * @property boundsPadding
    -     * @type Number
    -     */
    -    this.boundsPadding = 0;
    -
    -    this._localBounds = new PIXI.Rectangle(0,0,1,1);
    -
    -    /**
    -     * Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated.
    -     * 
    -     * @property dirty
    -     * @type Boolean
    -     * @private
    -     */
    -    this.dirty = true;
    -
    -    /**
    -     * Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated.
    -     * 
    -     * @property webGLDirty
    -     * @type Boolean
    -     * @private
    -     */
    -    this.webGLDirty = false;
    -
    -    /**
    -     * Used to detect if the cached sprite object needs to be updated.
    -     * 
    -     * @property cachedSpriteDirty
    -     * @type Boolean
    -     * @private
    -     */
    -    this.cachedSpriteDirty = false;
    -
    -};
    -
    -// constructor
    -PIXI.Graphics.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    -PIXI.Graphics.prototype.constructor = PIXI.Graphics;
    -
    -/**
    - * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite.
    - * This is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory.
    - * It is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas.
    - * This is not recommended if you are constantly redrawing the graphics element.
    - *
    - * @property cacheAsBitmap
    - * @type Boolean
    - * @default false
    - * @private
    - */
    -Object.defineProperty(PIXI.Graphics.prototype, "cacheAsBitmap", {
    -    get: function() {
    -        return  this._cacheAsBitmap;
    -    },
    -    set: function(value) {
    -        this._cacheAsBitmap = value;
    -
    -        if(this._cacheAsBitmap)
    -        {
    -
    -            this._generateCachedSprite();
    -        }
    -        else
    -        {
    -            this.destroyCachedSprite();
    -            this.dirty = true;
    -        }
    -
    -    }
    -});
    -
    -/**
    - * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.
    - *
    - * @method lineStyle
    - * @param lineWidth {Number} width of the line to draw, will update the objects stored style
    - * @param color {Number} color of the line to draw, will update the objects stored style
    - * @param alpha {Number} alpha of the line to draw, will update the objects stored style
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha)
    -{
    -    this.lineWidth = lineWidth || 0;
    -    this.lineColor = color || 0;
    -    this.lineAlpha = (arguments.length < 3) ? 1 : alpha;
    -
    -    if(this.currentPath)
    -    {
    -        if(this.currentPath.shape.points.length)
    -        {
    -            // halfway through a line? start a new one!
    -            this.drawShape( new PIXI.Polygon( this.currentPath.shape.points.slice(-2) ));
    -            return this;
    -        }
    -
    -        // otherwise its empty so lets just set the line properties
    -        this.currentPath.lineWidth = this.lineWidth;
    -        this.currentPath.lineColor = this.lineColor;
    -        this.currentPath.lineAlpha = this.lineAlpha;
    -        
    -    }
    -
    -    return this;
    -};
    -
    -/**
    - * Moves the current drawing position to x, y.
    - *
    - * @method moveTo
    - * @param x {Number} the X coordinate to move to
    - * @param y {Number} the Y coordinate to move to
    - * @return {Graphics}
    -  */
    -PIXI.Graphics.prototype.moveTo = function(x, y)
    -{
    -    this.drawShape(new PIXI.Polygon([x,y]));
    -
    -    return this;
    -};
    -
    -/**
    - * Draws a line using the current line style from the current drawing position to (x, y);
    - * The current drawing position is then set to (x, y).
    - *
    - * @method lineTo
    - * @param x {Number} the X coordinate to draw to
    - * @param y {Number} the Y coordinate to draw to
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.lineTo = function(x, y)
    -{
    -    this.currentPath.shape.points.push(x, y);
    -    this.dirty = true;
    -
    -    return this;
    -};
    -
    -/**
    - * Calculate the points for a quadratic bezier curve and then draws it.
    - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c
    - *
    - * @method quadraticCurveTo
    - * @param cpX {Number} Control point x
    - * @param cpY {Number} Control point y
    - * @param toX {Number} Destination point x
    - * @param toY {Number} Destination point y
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.quadraticCurveTo = function(cpX, cpY, toX, toY)
    -{
    -    if( this.currentPath )
    -    {
    -        if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0];
    -    }
    -    else
    -    {
    -        this.moveTo(0,0);
    -    }
    -
    -    var xa,
    -    ya,
    -    n = 20,
    -    points = this.currentPath.shape.points;
    -    if(points.length === 0)this.moveTo(0, 0);
    -    
    -
    -    var fromX = points[points.length-2];
    -    var fromY = points[points.length-1];
    -
    -    var j = 0;
    -    for (var i = 1; i <= n; i++ )
    -    {
    -        j = i / n;
    -
    -        xa = fromX + ( (cpX - fromX) * j );
    -        ya = fromY + ( (cpY - fromY) * j );
    -
    -        points.push( xa + ( ((cpX + ( (toX - cpX) * j )) - xa) * j ),
    -                     ya + ( ((cpY + ( (toY - cpY) * j )) - ya) * j ) );
    -    }
    -
    -
    -    this.dirty = true;
    -
    -    return this;
    -};
    -
    -/**
    - * Calculate the points for a bezier curve and then draws it.
    - *
    - * @method bezierCurveTo
    - * @param cpX {Number} Control point x
    - * @param cpY {Number} Control point y
    - * @param cpX2 {Number} Second Control point x
    - * @param cpY2 {Number} Second Control point y
    - * @param toX {Number} Destination point x
    - * @param toY {Number} Destination point y
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.bezierCurveTo = function(cpX, cpY, cpX2, cpY2, toX, toY)
    -{
    -    if( this.currentPath )
    -    {
    -        if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0];
    -    }
    -    else
    -    {
    -        this.moveTo(0,0);
    -    }
    -
    -    var n = 20,
    -    dt,
    -    dt2,
    -    dt3,
    -    t2,
    -    t3,
    -    points = this.currentPath.shape.points;
    -
    -    var fromX = points[points.length-2];
    -    var fromY = points[points.length-1];
    -    
    -    var j = 0;
    -
    -    for (var i=1; i<=n; i++)
    -    {
    -        j = i / n;
    -
    -        dt = (1 - j);
    -        dt2 = dt * dt;
    -        dt3 = dt2 * dt;
    -
    -        t2 = j * j;
    -        t3 = t2 * j;
    -        
    -        points.push( dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX,
    -                     dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY);
    -    }
    -    
    -    this.dirty = true;
    -
    -    return this;
    -};
    -
    -/*
    - * The arcTo() method creates an arc/curve between two tangents on the canvas.
    - * 
    - * "borrowed" from https://code.google.com/p/fxcanvas/ - thanks google!
    - *
    - * @method arcTo
    - * @param x1 {Number} The x-coordinate of the beginning of the arc
    - * @param y1 {Number} The y-coordinate of the beginning of the arc
    - * @param x2 {Number} The x-coordinate of the end of the arc
    - * @param y2 {Number} The y-coordinate of the end of the arc
    - * @param radius {Number} The radius of the arc
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.arcTo = function(x1, y1, x2, y2, radius)
    -{
    -    if( this.currentPath )
    -    {
    -        if(this.currentPath.shape.points.length === 0)
    -        {
    -            this.currentPath.shape.points.push(x1, y1);
    -        }
    -    }
    -    else
    -    {
    -        this.moveTo(x1, y1);
    -    }
    -
    -    var points = this.currentPath.shape.points;
    -    var fromX = points[points.length-2];
    -    var fromY = points[points.length-1];
    -    var a1 = fromY - y1;
    -    var b1 = fromX - x1;
    -    var a2 = y2   - y1;
    -    var b2 = x2   - x1;
    -    var mm = Math.abs(a1 * b2 - b1 * a2);
    -
    -
    -    if (mm < 1.0e-8 || radius === 0)
    -    {
    -        if( points[points.length-2] !== x1 || points[points.length-1] !== y1)
    -        {
    -            //console.log(">>")
    -            points.push(x1, y1);
    -        }
    -    }
    -    else
    -    {
    -        var dd = a1 * a1 + b1 * b1;
    -        var cc = a2 * a2 + b2 * b2;
    -        var tt = a1 * a2 + b1 * b2;
    -        var k1 = radius * Math.sqrt(dd) / mm;
    -        var k2 = radius * Math.sqrt(cc) / mm;
    -        var j1 = k1 * tt / dd;
    -        var j2 = k2 * tt / cc;
    -        var cx = k1 * b2 + k2 * b1;
    -        var cy = k1 * a2 + k2 * a1;
    -        var px = b1 * (k2 + j1);
    -        var py = a1 * (k2 + j1);
    -        var qx = b2 * (k1 + j2);
    -        var qy = a2 * (k1 + j2);
    -        var startAngle = Math.atan2(py - cy, px - cx);
    -        var endAngle   = Math.atan2(qy - cy, qx - cx);
    -
    -        this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1);
    -    }
    -
    -    this.dirty = true;
    -
    -    return this;
    -};
    -
    -/**
    - * The arc method creates an arc/curve (used to create circles, or parts of circles).
    - *
    - * @method arc
    - * @param cx {Number} The x-coordinate of the center of the circle
    - * @param cy {Number} The y-coordinate of the center of the circle
    - * @param radius {Number} The radius of the circle
    - * @param startAngle {Number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle)
    - * @param endAngle {Number} The ending angle, in radians
    - * @param anticlockwise {Boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise.
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise)
    -{
    -    var startX = cx + Math.cos(startAngle) * radius;
    -    var startY = cy + Math.sin(startAngle) * radius;
    -   
    -    var points = this.currentPath.shape.points;
    -
    -    if(points.length === 0)
    -    {
    -        this.moveTo(startX, startY);
    -        points = this.currentPath.shape.points;
    -    }
    -    else if( points[points.length-2] !== startX || points[points.length-1] !== startY)
    -    {
    -        points.push(startX, startY);
    -    }
    -  
    -    if (startAngle === endAngle)return this;
    -
    -    if( !anticlockwise && endAngle <= startAngle )
    -    {
    -        endAngle += Math.PI * 2;
    -    }
    -    else if( anticlockwise && startAngle <= endAngle )
    -    {
    -        startAngle += Math.PI * 2;
    -    }
    -
    -    var sweep = anticlockwise ? (startAngle - endAngle) *-1 : (endAngle - startAngle);
    -    var segs =  ( Math.abs(sweep)/ (Math.PI * 2) ) * 40;
    -
    -    if( sweep === 0 ) return this;
    -
    -    var theta = sweep/(segs*2);
    -    var theta2 = theta*2;
    -
    -    var cTheta = Math.cos(theta);
    -    var sTheta = Math.sin(theta);
    -    
    -    var segMinus = segs - 1;
    -
    -    var remainder = ( segMinus % 1 ) / segMinus;
    -
    -    for(var i=0; i<=segMinus; i++)
    -    {
    -        var real =  i + remainder * i;
    -
    -    
    -        var angle = ((theta) + startAngle + (theta2 * real));
    -
    -        var c = Math.cos(angle);
    -        var s = -Math.sin(angle);
    -
    -        points.push(( (cTheta *  c) + (sTheta * s) ) * radius + cx,
    -                    ( (cTheta * -s) + (sTheta * c) ) * radius + cy);
    -    }
    -
    -    this.dirty = true;
    -
    -    return this;
    -};
    -
    -/**
    - * Specifies a simple one-color fill that subsequent calls to other Graphics methods
    - * (such as lineTo() or drawCircle()) use when drawing.
    - *
    - * @method beginFill
    - * @param color {Number} the color of the fill
    - * @param alpha {Number} the alpha of the fill
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.beginFill = function(color, alpha)
    -{
    -    this.filling = true;
    -    this.fillColor = color || 0;
    -    this.fillAlpha = (alpha === undefined) ? 1 : alpha;
    -
    -    if(this.currentPath)
    -    {
    -        if(this.currentPath.shape.points.length <= 2)
    -        {
    -            this.currentPath.fill = this.filling;
    -            this.currentPath.fillColor = this.fillColor;
    -            this.currentPath.fillAlpha = this.fillAlpha;
    -        }
    -    }
    -    return this;
    -};
    -
    -/**
    - * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.
    - *
    - * @method endFill
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.endFill = function()
    -{
    -    this.filling = false;
    -    this.fillColor = null;
    -    this.fillAlpha = 1;
    -
    -    return this;
    -};
    -
    -/**
    - * @method drawRect
    - *
    - * @param x {Number} The X coord of the top-left of the rectangle
    - * @param y {Number} The Y coord of the top-left of the rectangle
    - * @param width {Number} The width of the rectangle
    - * @param height {Number} The height of the rectangle
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.drawRect = function( x, y, width, height )
    -{
    -    this.drawShape(new PIXI.Rectangle(x,y, width, height));
    -
    -    return this;
    -};
    -
    -/**
    - * @method drawRoundedRect
    - *
    - * @param x {Number} The X coord of the top-left of the rectangle
    - * @param y {Number} The Y coord of the top-left of the rectangle
    - * @param width {Number} The width of the rectangle
    - * @param height {Number} The height of the rectangle
    - * @param radius {Number} Radius of the rectangle corners
    - */
    -PIXI.Graphics.prototype.drawRoundedRect = function( x, y, width, height, radius )
    -{
    -    this.drawShape(new PIXI.RoundedRectangle(x, y, width, height, radius));
    -
    -    return this;
    -};
    -
    -/**
    - * Draws a circle.
    - *
    - * @method drawCircle
    - * @param x {Number} The X coordinate of the center of the circle
    - * @param y {Number} The Y coordinate of the center of the circle
    - * @param radius {Number} The radius of the circle
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.drawCircle = function(x, y, radius)
    -{
    -    this.drawShape(new PIXI.Circle(x,y, radius));
    -
    -    return this;
    -};
    -
    -/**
    - * Draws an ellipse.
    - *
    - * @method drawEllipse
    - * @param x {Number} The X coordinate of the center of the ellipse
    - * @param y {Number} The Y coordinate of the center of the ellipse
    - * @param width {Number} The half width of the ellipse
    - * @param height {Number} The half height of the ellipse
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.drawEllipse = function(x, y, width, height)
    -{
    -    this.drawShape(new PIXI.Ellipse(x, y, width, height));
    -
    -    return this;
    -};
    -
    -/**
    - * Draws a polygon using the given path.
    - *
    - * @method drawPolygon
    - * @param path {Array} The path data used to construct the polygon.
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.drawPolygon = function(path)
    -{
    -    if(!(path instanceof Array))path = Array.prototype.slice.call(arguments);
    -    this.drawShape(new PIXI.Polygon(path));
    -    return this;
    -};
    -
    -/**
    - * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.
    - *
    - * @method clear
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.clear = function()
    -{
    -    this.lineWidth = 0;
    -    this.filling = false;
    -
    -    this.dirty = true;
    -    this.clearDirty = true;
    -    this.graphicsData = [];
    -
    -    return this;
    -};
    -
    -/**
    - * Useful function that returns a texture of the graphics object that can then be used to create sprites
    - * This can be quite useful if your geometry is complicated and needs to be reused multiple times.
    - *
    - * @method generateTexture
    - * @param resolution {Number} The resolution of the texture being generated
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @return {Texture} a texture of the graphics object
    - */
    -PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode)
    -{
    -    resolution = resolution || 1;
    -
    -    var bounds = this.getBounds();
    -   
    -    var canvasBuffer = new PIXI.CanvasBuffer(bounds.width * resolution, bounds.height * resolution);
    -    
    -    var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas, scaleMode);
    -    texture.baseTexture.resolution = resolution;
    -
    -    canvasBuffer.context.scale(resolution, resolution);
    -
    -    canvasBuffer.context.translate(-bounds.x,-bounds.y);
    -    
    -    PIXI.CanvasGraphics.renderGraphics(this, canvasBuffer.context);
    -
    -    return texture;
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.Graphics.prototype._renderWebGL = function(renderSession)
    -{
    -    // if the sprite is not visible or the alpha is 0 then no need to render this element
    -    if(this.visible === false || this.alpha === 0 || this.isMask === true)return;
    -
    -    if(this._cacheAsBitmap)
    -    {
    -
    -        if(this.dirty || this.cachedSpriteDirty)
    -        {
    -
    -            this._generateCachedSprite();
    -   
    -            // we will also need to update the texture on the gpu too!
    -            this.updateCachedSpriteTexture();
    -
    -            this.cachedSpriteDirty = false;
    -            this.dirty = false;
    -        }
    -
    -        this._cachedSprite.worldAlpha = this.worldAlpha;
    -        PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession);
    -
    -        return;
    -    }
    -    else
    -    {
    -        renderSession.spriteBatch.stop();
    -        renderSession.blendModeManager.setBlendMode(this.blendMode);
    -
    -        if(this._mask)renderSession.maskManager.pushMask(this._mask, renderSession);
    -        if(this._filters)renderSession.filterManager.pushFilter(this._filterBlock);
    -      
    -        // check blend mode
    -        if(this.blendMode !== renderSession.spriteBatch.currentBlendMode)
    -        {
    -            renderSession.spriteBatch.currentBlendMode = this.blendMode;
    -            var blendModeWebGL = PIXI.blendModesWebGL[renderSession.spriteBatch.currentBlendMode];
    -            renderSession.spriteBatch.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]);
    -        }
    -        
    -        // check if the webgl graphic needs to be updated
    -        if(this.webGLDirty)
    -        {
    -            this.dirty = true;
    -            this.webGLDirty = false;
    -        }
    -        
    -        PIXI.WebGLGraphics.renderGraphics(this, renderSession);
    -        
    -        // only render if it has children!
    -        if(this.children.length)
    -        {
    -            renderSession.spriteBatch.start();
    -
    -             // simple render children!
    -            for(var i=0, j=this.children.length; i<j; i++)
    -            {
    -                this.children[i]._renderWebGL(renderSession);
    -            }
    -
    -            renderSession.spriteBatch.stop();
    -        }
    -
    -        if(this._filters)renderSession.filterManager.popFilter();
    -        if(this._mask)renderSession.maskManager.popMask(this.mask, renderSession);
    -          
    -        renderSession.drawCount++;
    -
    -        renderSession.spriteBatch.start();
    -    }
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.Graphics.prototype._renderCanvas = function(renderSession)
    -{
    -    // if the sprite is not visible or the alpha is 0 then no need to render this element
    -    if(this.visible === false || this.alpha === 0 || this.isMask === true)return;
    -    
    -    if(this._cacheAsBitmap)
    -    {
    -        if(this.dirty || this.cachedSpriteDirty)
    -        {
    -            this._generateCachedSprite();
    -   
    -            // we will also need to update the texture
    -            this.updateCachedSpriteTexture();
    -
    -            this.cachedSpriteDirty = false;
    -            this.dirty = false;
    -        }
    -
    -        this._cachedSprite.alpha = this.alpha;
    -        PIXI.Sprite.prototype._renderCanvas.call(this._cachedSprite, renderSession);
    -
    -        return;
    -    }
    -    else
    -    {
    -        var context = renderSession.context;
    -        var transform = this.worldTransform;
    -        
    -        if(this.blendMode !== renderSession.currentBlendMode)
    -        {
    -            renderSession.currentBlendMode = this.blendMode;
    -            context.globalCompositeOperation = PIXI.blendModesCanvas[renderSession.currentBlendMode];
    -        }
    -
    -        if(this._mask)
    -        {
    -            renderSession.maskManager.pushMask(this._mask, renderSession);
    -        }
    -
    -        var resolution = renderSession.resolution;
    -        context.setTransform(transform.a * resolution,
    -                             transform.b * resolution,
    -                             transform.c * resolution,
    -                             transform.d * resolution,
    -                             transform.tx * resolution,
    -                             transform.ty * resolution);
    -
    -        PIXI.CanvasGraphics.renderGraphics(this, context);
    -
    -         // simple render children!
    -        for(var i=0, j=this.children.length; i<j; i++)
    -        {
    -            this.children[i]._renderCanvas(renderSession);
    -        }
    -
    -        if(this._mask)
    -        {
    -            renderSession.maskManager.popMask(renderSession);
    -        }
    -    }
    -};
    -
    -/**
    - * Retrieves the bounds of the graphic shape as a rectangle object
    - *
    - * @method getBounds
    - * @return {Rectangle} the rectangular bounding area
    - */
    -PIXI.Graphics.prototype.getBounds = function( matrix )
    -{
    -    // return an empty object if the item is a mask!
    -    if(this.isMask)return PIXI.EmptyRectangle;
    -
    -    if(this.dirty)
    -    {
    -        this.updateLocalBounds();
    -        this.webGLDirty = true;
    -        this.cachedSpriteDirty = true;
    -        this.dirty = false;
    -    }
    -
    -    var bounds = this._localBounds;
    -
    -    var w0 = bounds.x;
    -    var w1 = bounds.width + bounds.x;
    -
    -    var h0 = bounds.y;
    -    var h1 = bounds.height + bounds.y;
    -
    -    var worldTransform = matrix || this.worldTransform;
    -
    -    var a = worldTransform.a;
    -    var b = worldTransform.b;
    -    var c = worldTransform.c;
    -    var d = worldTransform.d;
    -    var tx = worldTransform.tx;
    -    var ty = worldTransform.ty;
    -
    -    var x1 = a * w1 + c * h1 + tx;
    -    var y1 = d * h1 + b * w1 + ty;
    -
    -    var x2 = a * w0 + c * h1 + tx;
    -    var y2 = d * h1 + b * w0 + ty;
    -
    -    var x3 = a * w0 + c * h0 + tx;
    -    var y3 = d * h0 + b * w0 + ty;
    -
    -    var x4 =  a * w1 + c * h0 + tx;
    -    var y4 =  d * h0 + b * w1 + ty;
    -
    -    var maxX = x1;
    -    var maxY = y1;
    -
    -    var minX = x1;
    -    var minY = y1;
    -
    -    minX = x2 < minX ? x2 : minX;
    -    minX = x3 < minX ? x3 : minX;
    -    minX = x4 < minX ? x4 : minX;
    -
    -    minY = y2 < minY ? y2 : minY;
    -    minY = y3 < minY ? y3 : minY;
    -    minY = y4 < minY ? y4 : minY;
    -
    -    maxX = x2 > maxX ? x2 : maxX;
    -    maxX = x3 > maxX ? x3 : maxX;
    -    maxX = x4 > maxX ? x4 : maxX;
    -
    -    maxY = y2 > maxY ? y2 : maxY;
    -    maxY = y3 > maxY ? y3 : maxY;
    -    maxY = y4 > maxY ? y4 : maxY;
    -
    -    this._bounds.x = minX;
    -    this._bounds.width = maxX - minX;
    -
    -    this._bounds.y = minY;
    -    this._bounds.height = maxY - minY;
    -
    -    return  this._bounds;
    -};
    -
    -/**
    - * Update the bounds of the object
    - *
    - * @method updateLocalBounds
    - */
    -PIXI.Graphics.prototype.updateLocalBounds = function()
    -{
    -    var minX = Infinity;
    -    var maxX = -Infinity;
    -
    -    var minY = Infinity;
    -    var maxY = -Infinity;
    -
    -    if(this.graphicsData.length)
    -    {
    -        var shape, points, x, y, w, h;
    -
    -        for (var i = 0; i < this.graphicsData.length; i++) {
    -            var data = this.graphicsData[i];
    -            var type = data.type;
    -            var lineWidth = data.lineWidth;
    -            shape = data.shape;
    -           
    -
    -            if(type === PIXI.Graphics.RECT || type === PIXI.Graphics.RREC)
    -            {
    -                x = shape.x - lineWidth/2;
    -                y = shape.y - lineWidth/2;
    -                w = shape.width + lineWidth;
    -                h = shape.height + lineWidth;
    -
    -                minX = x < minX ? x : minX;
    -                maxX = x + w > maxX ? x + w : maxX;
    -
    -                minY = y < minY ? y : minY;
    -                maxY = y + h > maxY ? y + h : maxY;
    -            }
    -            else if(type === PIXI.Graphics.CIRC)
    -            {
    -                x = shape.x;
    -                y = shape.y;
    -                w = shape.radius + lineWidth/2;
    -                h = shape.radius + lineWidth/2;
    -
    -                minX = x - w < minX ? x - w : minX;
    -                maxX = x + w > maxX ? x + w : maxX;
    -
    -                minY = y - h < minY ? y - h : minY;
    -                maxY = y + h > maxY ? y + h : maxY;
    -            }
    -            else if(type === PIXI.Graphics.ELIP)
    -            {
    -                x = shape.x;
    -                y = shape.y;
    -                w = shape.width + lineWidth/2;
    -                h = shape.height + lineWidth/2;
    -
    -                minX = x - w < minX ? x - w : minX;
    -                maxX = x + w > maxX ? x + w : maxX;
    -
    -                minY = y - h < minY ? y - h : minY;
    -                maxY = y + h > maxY ? y + h : maxY;
    -            }
    -            else
    -            {
    -                // POLY
    -                points = shape.points;
    -                
    -                for (var j = 0; j < points.length; j+=2)
    -                {
    -
    -                    x = points[j];
    -                    y = points[j+1];
    -                    minX = x-lineWidth < minX ? x-lineWidth : minX;
    -                    maxX = x+lineWidth > maxX ? x+lineWidth : maxX;
    -
    -                    minY = y-lineWidth < minY ? y-lineWidth : minY;
    -                    maxY = y+lineWidth > maxY ? y+lineWidth : maxY;
    -                }
    -            }
    -        }
    -    }
    -    else
    -    {
    -        minX = 0;
    -        maxX = 0;
    -        minY = 0;
    -        maxY = 0;
    -    }
    -
    -    var padding = this.boundsPadding;
    -    
    -    this._localBounds.x = minX - padding;
    -    this._localBounds.width = (maxX - minX) + padding * 2;
    -
    -    this._localBounds.y = minY - padding;
    -    this._localBounds.height = (maxY - minY) + padding * 2;
    -};
    -
    -/**
    - * Generates the cached sprite when the sprite has cacheAsBitmap = true
    - *
    - * @method _generateCachedSprite
    - * @private
    - */
    -PIXI.Graphics.prototype._generateCachedSprite = function()
    -{
    -    var bounds = this.getLocalBounds();
    -
    -    if(!this._cachedSprite)
    -    {
    -        var canvasBuffer = new PIXI.CanvasBuffer(bounds.width, bounds.height);
    -        var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas);
    -        
    -        this._cachedSprite = new PIXI.Sprite(texture);
    -        this._cachedSprite.buffer = canvasBuffer;
    -
    -        this._cachedSprite.worldTransform = this.worldTransform;
    -    }
    -    else
    -    {
    -        this._cachedSprite.buffer.resize(bounds.width, bounds.height);
    -    }
    -
    -    // leverage the anchor to account for the offset of the element
    -    this._cachedSprite.anchor.x = -( bounds.x / bounds.width );
    -    this._cachedSprite.anchor.y = -( bounds.y / bounds.height );
    -
    -   // this._cachedSprite.buffer.context.save();
    -    this._cachedSprite.buffer.context.translate(-bounds.x,-bounds.y);
    -    
    -    // make sure we set the alpha of the graphics to 1 for the render.. 
    -    this.worldAlpha = 1;
    -
    -    // now render the graphic..
    -    PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context);
    -    this._cachedSprite.alpha = this.alpha;
    -};
    -
    -/**
    - * Updates texture size based on canvas size
    - *
    - * @method updateCachedSpriteTexture
    - * @private
    - */
    -PIXI.Graphics.prototype.updateCachedSpriteTexture = function()
    -{
    -    var cachedSprite = this._cachedSprite;
    -    var texture = cachedSprite.texture;
    -    var canvas = cachedSprite.buffer.canvas;
    -
    -    texture.baseTexture.width = canvas.width;
    -    texture.baseTexture.height = canvas.height;
    -    texture.crop.width = texture.frame.width = canvas.width;
    -    texture.crop.height = texture.frame.height = canvas.height;
    -
    -    cachedSprite._width = canvas.width;
    -    cachedSprite._height = canvas.height;
    -
    -    // update the dirty base textures
    -    texture.baseTexture.dirty();
    -};
    -
    -/**
    - * Destroys a previous cached sprite.
    - *
    - * @method destroyCachedSprite
    - */
    -PIXI.Graphics.prototype.destroyCachedSprite = function()
    -{
    -    this._cachedSprite.texture.destroy(true);
    -
    -    // let the gc collect the unused sprite
    -    // TODO could be object pooled!
    -    this._cachedSprite = null;
    -};
    -
    -/**
    - * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.
    - *
    - * @method drawShape
    - * @param {Circle|Rectangle|Ellipse|Line|Polygon} shape The Shape object to draw.
    - * @return {GraphicsData} The generated GraphicsData object.
    - */
    -PIXI.Graphics.prototype.drawShape = function(shape)
    -{
    -    if(this.currentPath)
    -    {
    -        // check current path!
    -        if(this.currentPath.shape.points.length <= 2)this.graphicsData.pop();
    -    }
    -
    -    this.currentPath = null;
    -
    -    var data = new PIXI.GraphicsData(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, shape);
    -    
    -    this.graphicsData.push(data);
    -    
    -    if(data.type === PIXI.Graphics.POLY)
    -    {
    -        data.shape.closed = this.filling;
    -        this.currentPath = data;
    -    }
    -
    -    this.dirty = true;
    -
    -    return data;
    -};
    -
    -/**
    - * A GraphicsData object.
    - * 
    - * @class GraphicsData
    - * @constructor
    - */
    -PIXI.GraphicsData = function(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, shape)
    -{
    -    this.lineWidth = lineWidth;
    -    this.lineColor = lineColor;
    -    this.lineAlpha = lineAlpha;
    -
    -    this.fillColor = fillColor;
    -    this.fillAlpha = fillAlpha;
    -    this.fill = fill;
    -
    -    this.shape = shape;
    -    this.type = shape.type;
    -};
    -
    -// SOME TYPES:
    -PIXI.Graphics.POLY = 0;
    -PIXI.Graphics.RECT = 1;
    -PIXI.Graphics.CIRC = 2;
    -PIXI.Graphics.ELIP = 3;
    -PIXI.Graphics.RREC = 4;
    -
    -PIXI.Polygon.prototype.type = PIXI.Graphics.POLY;
    -PIXI.Rectangle.prototype.type = PIXI.Graphics.RECT;
    -PIXI.Circle.prototype.type = PIXI.Graphics.CIRC;
    -PIXI.Ellipse.prototype.type = PIXI.Graphics.ELIP;
    -PIXI.RoundedRectangle.prototype.type = PIXI.Graphics.RREC;
    -
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasGraphics.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasGraphics.js.html deleted file mode 100755 index 61eb8da..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasGraphics.js.html +++ /dev/null @@ -1,579 +0,0 @@ - - - - - src/pixi/renderers/canvas/CanvasGraphics.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/canvas/CanvasGraphics.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -
    -/**
    - * A set of functions used by the canvas renderer to draw the primitive graphics data.
    - *
    - * @class CanvasGraphics
    - * @static
    - */
    -PIXI.CanvasGraphics = function()
    -{
    -};
    -
    -/*
    - * Renders a PIXI.Graphics object to a canvas.
    - *
    - * @method renderGraphics
    - * @static
    - * @param graphics {Graphics} the actual graphics object to render
    - * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas
    - */
    -PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
    -{
    -    var worldAlpha = graphics.worldAlpha;
    -    var color = '';
    -
    -    for (var i = 0; i < graphics.graphicsData.length; i++)
    -    {
    -        var data = graphics.graphicsData[i];
    -        var shape = data.shape;
    -
    -        context.strokeStyle = color = '#' + ('00000' + ( data.lineColor | 0).toString(16)).substr(-6);
    -
    -        context.lineWidth = data.lineWidth;
    -
    -        if(data.type === PIXI.Graphics.POLY)
    -        {
    -            context.beginPath();
    -
    -            var points = shape.points;
    -
    -            context.moveTo(points[0], points[1]);
    -
    -            for (var j=1; j < points.length/2; j++)
    -            {
    -                context.lineTo(points[j * 2], points[j * 2 + 1]);
    -            }
    -
    -            if(shape.closed)
    -            {
    -                context.lineTo(points[0], points[1]);
    -            }
    -
    -            // if the first and last point are the same close the path - much neater :)
    -            if(points[0] === points[points.length-2] && points[1] === points[points.length-1])
    -            {
    -                context.closePath();
    -            }
    -
    -            if(data.fill)
    -            {
    -                context.globalAlpha = data.fillAlpha * worldAlpha;
    -                context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
    -                context.fill();
    -            }
    -            if(data.lineWidth)
    -            {
    -                context.globalAlpha = data.lineAlpha * worldAlpha;
    -                context.stroke();
    -            }
    -        }
    -        else if(data.type === PIXI.Graphics.RECT)
    -        {
    -
    -            if(data.fillColor || data.fillColor === 0)
    -            {
    -                context.globalAlpha = data.fillAlpha * worldAlpha;
    -                context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
    -                context.fillRect(shape.x, shape.y, shape.width, shape.height);
    -
    -            }
    -            if(data.lineWidth)
    -            {
    -                context.globalAlpha = data.lineAlpha * worldAlpha;
    -                context.strokeRect(shape.x, shape.y, shape.width, shape.height);
    -            }
    -        }
    -        else if(data.type === PIXI.Graphics.CIRC)
    -        {
    -            // TODO - need to be Undefined!
    -            context.beginPath();
    -            context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI);
    -            context.closePath();
    -
    -            if(data.fill)
    -            {
    -                context.globalAlpha = data.fillAlpha * worldAlpha;
    -                context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
    -                context.fill();
    -            }
    -            if(data.lineWidth)
    -            {
    -                context.globalAlpha = data.lineAlpha * worldAlpha;
    -                context.stroke();
    -            }
    -        }
    -        else if(data.type === PIXI.Graphics.ELIP)
    -        {
    -            // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas
    -
    -            var w = shape.width * 2;
    -            var h = shape.height * 2;
    -
    -            var x = shape.x - w/2;
    -            var y = shape.y - h/2;
    -
    -            context.beginPath();
    -
    -            var kappa = 0.5522848,
    -                ox = (w / 2) * kappa, // control point offset horizontal
    -                oy = (h / 2) * kappa, // control point offset vertical
    -                xe = x + w,           // x-end
    -                ye = y + h,           // y-end
    -                xm = x + w / 2,       // x-middle
    -                ym = y + h / 2;       // y-middle
    -
    -            context.moveTo(x, ym);
    -            context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
    -            context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
    -            context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
    -            context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
    -
    -            context.closePath();
    -
    -            if(data.fill)
    -            {
    -                context.globalAlpha = data.fillAlpha * worldAlpha;
    -                context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
    -                context.fill();
    -            }
    -            if(data.lineWidth)
    -            {
    -                context.globalAlpha = data.lineAlpha * worldAlpha;
    -                context.stroke();
    -            }
    -        }
    -        else if (data.type === PIXI.Graphics.RREC)
    -        {
    -            var rx = shape.x;
    -            var ry = shape.y;
    -            var width = shape.width;
    -            var height = shape.height;
    -            var radius = shape.radius;
    -
    -            var maxRadius = Math.min(width, height) / 2 | 0;
    -            radius = radius > maxRadius ? maxRadius : radius;
    -
    -            context.beginPath();
    -            context.moveTo(rx, ry + radius);
    -            context.lineTo(rx, ry + height - radius);
    -            context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height);
    -            context.lineTo(rx + width - radius, ry + height);
    -            context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius);
    -            context.lineTo(rx + width, ry + radius);
    -            context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry);
    -            context.lineTo(rx + radius, ry);
    -            context.quadraticCurveTo(rx, ry, rx, ry + radius);
    -            context.closePath();
    -
    -            if(data.fillColor || data.fillColor === 0)
    -            {
    -                context.globalAlpha = data.fillAlpha * worldAlpha;
    -                context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
    -                context.fill();
    -
    -            }
    -            if(data.lineWidth)
    -            {
    -                context.globalAlpha = data.lineAlpha * worldAlpha;
    -                context.stroke();
    -            }
    -        }
    -    }
    -};
    -
    -/*
    - * Renders a graphics mask
    - *
    - * @static
    - * @private
    - * @method renderGraphicsMask
    - * @param graphics {Graphics} the graphics which will be used as a mask
    - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas
    - */
    -PIXI.CanvasGraphics.renderGraphicsMask = function(graphics, context)
    -{
    -    var len = graphics.graphicsData.length;
    -
    -    if(len === 0) return;
    -
    -    if(len > 1)
    -    {
    -        len = 1;
    -        window.console.log('Pixi.js warning: masks in canvas can only mask using the first path in the graphics object');
    -    }
    -
    -    for (var i = 0; i < 1; i++)
    -    {
    -        var data = graphics.graphicsData[i];
    -        var shape = data.shape;
    -
    -        if(data.type === PIXI.Graphics.POLY)
    -        {
    -            context.beginPath();
    -        
    -            var points = shape.points;
    -        
    -            context.moveTo(points[0], points[1]);
    -
    -            for (var j=1; j < points.length/2; j++)
    -            {
    -                context.lineTo(points[j * 2], points[j * 2 + 1]);
    -            }
    -
    -            // if the first and last point are the same close the path - much neater :)
    -            if(points[0] === points[points.length-2] && points[1] === points[points.length-1])
    -            {
    -                context.closePath();
    -            }
    -
    -        }
    -        else if(data.type === PIXI.Graphics.RECT)
    -        {
    -            context.beginPath();
    -            context.rect(shape.x, shape.y, shape.width, shape.height);
    -            context.closePath();
    -        }
    -        else if(data.type === PIXI.Graphics.CIRC)
    -        {
    -            // TODO - need to be Undefined!
    -            context.beginPath();
    -            context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI);
    -            context.closePath();
    -        }
    -        else if(data.type === PIXI.Graphics.ELIP)
    -        {
    -
    -            // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas
    -
    -            var w = shape.width * 2;
    -            var h = shape.height * 2;
    -
    -            var x = shape.x - w/2;
    -            var y = shape.y - h/2;
    -
    -            context.beginPath();
    -
    -            var kappa = 0.5522848,
    -                ox = (w / 2) * kappa, // control point offset horizontal
    -                oy = (h / 2) * kappa, // control point offset vertical
    -                xe = x + w,           // x-end
    -                ye = y + h,           // y-end
    -                xm = x + w / 2,       // x-middle
    -                ym = y + h / 2;       // y-middle
    -
    -            context.moveTo(x, ym);
    -            context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
    -            context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
    -            context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
    -            context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
    -            context.closePath();
    -        }
    -        else if (data.type === PIXI.Graphics.RREC)
    -        {
    -        
    -            var pts = shape.points;
    -            var rx = pts[0];
    -            var ry = pts[1];
    -            var width = pts[2];
    -            var height = pts[3];
    -            var radius = pts[4];
    -
    -            var maxRadius = Math.min(width, height) / 2 | 0;
    -            radius = radius > maxRadius ? maxRadius : radius;
    -
    -            context.beginPath();
    -            context.moveTo(rx, ry + radius);
    -            context.lineTo(rx, ry + height - radius);
    -            context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height);
    -            context.lineTo(rx + width - radius, ry + height);
    -            context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius);
    -            context.lineTo(rx + width, ry + radius);
    -            context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry);
    -            context.lineTo(rx + radius, ry);
    -            context.quadraticCurveTo(rx, ry, rx, ry + radius);
    -            context.closePath();
    -        }
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasRenderer.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasRenderer.js.html deleted file mode 100755 index 0cc3085..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasRenderer.js.html +++ /dev/null @@ -1,623 +0,0 @@ - - - - - src/pixi/renderers/canvas/CanvasRenderer.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/canvas/CanvasRenderer.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The CanvasRenderer draws the Stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    - * Don't forget to add the CanvasRenderer.view to your DOM or you will not see anything :)
    - *
    - * @class CanvasRenderer
    - * @constructor
    - * @param [width=800] {Number} the width of the canvas view
    - * @param [height=600] {Number} the height of the canvas view
    - * @param [options] {Object} The optional renderer parameters
    - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional
    - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false
    - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false
    - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2
    - * @param [options.clearBeforeRender=true] {Boolean} This sets if the CanvasRenderer will clear the canvas or not before the new render pass.
    - */
    -PIXI.CanvasRenderer = function(width, height, options)
    -{
    -    if(options)
    -    {
    -        for (var i in PIXI.defaultRenderOptions)
    -        {
    -            if (typeof options[i] === "undefined") options[i] = PIXI.defaultRenderOptions[i];
    -        }
    -    }
    -    else
    -    {
    -        options = PIXI.defaultRenderOptions;
    -    }
    -
    -    if(!PIXI.defaultRenderer)
    -    {
    -        PIXI.sayHello("Canvas");
    -        PIXI.defaultRenderer = this;
    -    }
    -
    -    /**
    -     * The renderer type.
    -     *
    -     * @property type
    -     * @type Number
    -     */
    -    this.type = PIXI.CANVAS_RENDERER;
    -
    -    /**
    -     * The resolution of the canvas.
    -     *
    -     * @property resolution
    -     * @type Number
    -     */
    -    this.resolution = options.resolution;
    -
    -    /**
    -     * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.
    -     * If the Stage is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.
    -     * If the Stage is transparent Pixi will use clearRect to clear the canvas every frame.
    -     * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.
    -     *
    -     * @property clearBeforeRender
    -     * @type Boolean
    -     * @default
    -     */
    -    this.clearBeforeRender = options.clearBeforeRender;
    -
    -    /**
    -     * Whether the render view is transparent
    -     *
    -     * @property transparent
    -     * @type Boolean
    -     */
    -    this.transparent = options.transparent;
    -
    -    /**
    -     * Whether the render view should be resized automatically
    -     *
    -     * @property autoResize
    -     * @type Boolean
    -     */
    -    this.autoResize = options.autoResize || false;
    -
    -
    -    /**
    -     * The width of the canvas view
    -     *
    -     * @property width
    -     * @type Number
    -     * @default 800
    -     */
    -    this.width = width || 800;
    -
    -    /**
    -     * The height of the canvas view
    -     *
    -     * @property height
    -     * @type Number
    -     * @default 600
    -     */
    -    this.height = height || 600;
    -
    -    this.width *= this.resolution;
    -    this.height *= this.resolution;
    -
    -    /**
    -     * The canvas element that everything is drawn to.
    -     *
    -     * @property view
    -     * @type HTMLCanvasElement
    -     */
    -    this.view = options.view || document.createElement( "canvas" );
    -
    -    /**
    -     * The canvas 2d context that everything is drawn with
    -     * @property context
    -     * @type CanvasRenderingContext2D
    -     */
    -    this.context = this.view.getContext( "2d", { alpha: this.transparent } );
    -
    -    /**
    -     * Boolean flag controlling canvas refresh.
    -     *
    -     * @property refresh
    -     * @type Boolean
    -     */
    -    this.refresh = true;
    -
    -    this.view.width = this.width * this.resolution;
    -    this.view.height = this.height * this.resolution;
    -
    -    /**
    -     * Internal var.
    -     *
    -     * @property count
    -     * @type Number
    -     */
    -    this.count = 0;
    -
    -    /**
    -     * Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer
    -     * @property CanvasMaskManager
    -     * @type CanvasMaskManager
    -     */
    -    this.maskManager = new PIXI.CanvasMaskManager();
    -
    -    /**
    -     * The render session is just a bunch of parameter used for rendering
    -     * @property renderSession
    -     * @type Object
    -     */
    -    this.renderSession = {
    -        context: this.context,
    -        maskManager: this.maskManager,
    -        scaleMode: null,
    -        smoothProperty: null,
    -        /**
    -         * If true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation.
    -         * Handy for crisp pixel art and speed on legacy devices.
    -         *
    -         */
    -        roundPixels: false
    -    };
    -
    -    this.mapBlendModes();
    -    
    -    this.resize(width, height);
    -
    -    if("imageSmoothingEnabled" in this.context)
    -        this.renderSession.smoothProperty = "imageSmoothingEnabled";
    -    else if("webkitImageSmoothingEnabled" in this.context)
    -        this.renderSession.smoothProperty = "webkitImageSmoothingEnabled";
    -    else if("mozImageSmoothingEnabled" in this.context)
    -        this.renderSession.smoothProperty = "mozImageSmoothingEnabled";
    -    else if("oImageSmoothingEnabled" in this.context)
    -        this.renderSession.smoothProperty = "oImageSmoothingEnabled";
    -    else if ("msImageSmoothingEnabled" in this.context)
    -        this.renderSession.smoothProperty = "msImageSmoothingEnabled";
    -};
    -
    -// constructor
    -PIXI.CanvasRenderer.prototype.constructor = PIXI.CanvasRenderer;
    -
    -/**
    - * Renders the Stage to this canvas view
    - *
    - * @method render
    - * @param stage {Stage} the Stage element to be rendered
    - */
    -PIXI.CanvasRenderer.prototype.render = function(stage)
    -{
    -    stage.updateTransform();
    -
    -    this.context.setTransform(1,0,0,1,0,0);
    -
    -    this.context.globalAlpha = 1;
    -
    -    this.renderSession.currentBlendMode = PIXI.blendModes.NORMAL;
    -    this.context.globalCompositeOperation = PIXI.blendModesCanvas[PIXI.blendModes.NORMAL];
    -
    -    if (navigator.isCocoonJS && this.view.screencanvas) {
    -        this.context.fillStyle = "black";
    -        this.context.clear();
    -    }
    -    
    -    if (this.clearBeforeRender)
    -    {
    -        if (this.transparent)
    -        {
    -            this.context.clearRect(0, 0, this.width, this.height);
    -        }
    -        else
    -        {
    -            this.context.fillStyle = stage.backgroundColorString;
    -            this.context.fillRect(0, 0, this.width , this.height);
    -        }
    -    }
    -    
    -    this.renderDisplayObject(stage);
    -
    -    // run interaction!
    -    if(stage.interactive)
    -    {
    -        //need to add some events!
    -        if(!stage._interactiveEventsAdded)
    -        {
    -            stage._interactiveEventsAdded = true;
    -            stage.interactionManager.setTarget(this);
    -        }
    -    }
    -};
    -
    -/**
    - * Removes everything from the renderer and optionally removes the Canvas DOM element.
    - *
    - * @method destroy
    - * @param [removeView=true] {boolean} Removes the Canvas element from the DOM.
    - */
    -PIXI.CanvasRenderer.prototype.destroy = function(removeView)
    -{
    -    if (typeof removeView === "undefined") { removeView = true; }
    -
    -    if (removeView && this.view.parent)
    -    {
    -        this.view.parent.removeChild(this.view);
    -    }
    -
    -    this.view = null;
    -    this.context = null;
    -    this.maskManager = null;
    -    this.renderSession = null;
    -
    -};
    -
    -/**
    - * Resizes the canvas view to the specified width and height
    - *
    - * @method resize
    - * @param width {Number} the new width of the canvas view
    - * @param height {Number} the new height of the canvas view
    - */
    -PIXI.CanvasRenderer.prototype.resize = function(width, height)
    -{
    -    this.width = width * this.resolution;
    -    this.height = height * this.resolution;
    -
    -    this.view.width = this.width;
    -    this.view.height = this.height;
    -
    -    if (this.autoResize) {
    -        this.view.style.width = this.width / this.resolution + "px";
    -        this.view.style.height = this.height / this.resolution + "px";
    -    }
    -};
    -
    -/**
    - * Renders a display object
    - *
    - * @method renderDisplayObject
    - * @param displayObject {DisplayObject} The displayObject to render
    - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas
    - * @private
    - */
    -PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject, context)
    -{
    -    this.renderSession.context = context || this.context;
    -    this.renderSession.resolution = this.resolution;
    -    displayObject._renderCanvas(this.renderSession);
    -};
    -
    -/**
    - * Maps Pixi blend modes to canvas blend modes.
    - *
    - * @method mapBlendModes
    - * @private
    - */
    -PIXI.CanvasRenderer.prototype.mapBlendModes = function()
    -{
    -    if(!PIXI.blendModesCanvas)
    -    {
    -        PIXI.blendModesCanvas = [];
    -
    -        if(PIXI.canUseNewCanvasBlendModes())
    -        {
    -            PIXI.blendModesCanvas[PIXI.blendModes.NORMAL]   = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.ADD]      = "lighter"; //IS THIS OK???
    -            PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "multiply";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SCREEN]   = "screen";
    -            PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY]  = "overlay";
    -            PIXI.blendModesCanvas[PIXI.blendModes.DARKEN]   = "darken";
    -            PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN]  = "lighten";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "color-dodge";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "color-burn";
    -            PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "hard-light";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "soft-light";
    -            PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "difference";
    -            PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "exclusion";
    -            PIXI.blendModesCanvas[PIXI.blendModes.HUE]       = "hue";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "saturation";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR]      = "color";
    -            PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "luminosity";
    -        }
    -        else
    -        {
    -            // this means that the browser does not support the cool new blend modes in canvas "cough" ie "cough"
    -            PIXI.blendModesCanvas[PIXI.blendModes.NORMAL]   = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.ADD]      = "lighter"; //IS THIS OK???
    -            PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SCREEN]   = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY]  = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.DARKEN]   = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN]  = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.HUE]       = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR]      = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "source-over";
    -        }
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasBuffer.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasBuffer.js.html deleted file mode 100755 index 1705871..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasBuffer.js.html +++ /dev/null @@ -1,354 +0,0 @@ - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/canvas/utils/CanvasBuffer.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * Creates a Canvas element of the given size.
    - *
    - * @class CanvasBuffer
    - * @constructor
    - * @param width {Number} the width for the newly created canvas
    - * @param height {Number} the height for the newly created canvas
    - */
    -PIXI.CanvasBuffer = function(width, height)
    -{
    -    /**
    -     * The width of the Canvas in pixels.
    -     *
    -     * @property width
    -     * @type Number
    -     */
    -    this.width = width;
    -
    -    /**
    -     * The height of the Canvas in pixels.
    -     *
    -     * @property height
    -     * @type Number
    -     */
    -    this.height = height;
    -
    -    /**
    -     * The Canvas object that belongs to this CanvasBuffer.
    -     *
    -     * @property canvas
    -     * @type HTMLCanvasElement
    -     */
    -    this.canvas = document.createElement("canvas");
    -
    -    /**
    -     * A CanvasRenderingContext2D object representing a two-dimensional rendering context.
    -     *
    -     * @property context
    -     * @type CanvasRenderingContext2D
    -     */
    -    this.context = this.canvas.getContext("2d");
    -
    -    this.canvas.width = width;
    -    this.canvas.height = height;
    -};
    -
    -PIXI.CanvasBuffer.prototype.constructor = PIXI.CanvasBuffer;
    -
    -/**
    - * Clears the canvas that was created by the CanvasBuffer class.
    - *
    - * @method clear
    - * @private
    - */
    -PIXI.CanvasBuffer.prototype.clear = function()
    -{
    -    this.context.setTransform(1, 0, 0, 1, 0, 0);
    -    this.context.clearRect(0,0, this.width, this.height);
    -};
    -
    -/**
    - * Resizes the canvas to the specified width and height.
    - *
    - * @method resize
    - * @param width {Number} the new width of the canvas
    - * @param height {Number} the new height of the canvas
    - */
    -PIXI.CanvasBuffer.prototype.resize = function(width, height)
    -{
    -    this.width = this.canvas.width = width;
    -    this.height = this.canvas.height = height;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasMaskManager.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasMaskManager.js.html deleted file mode 100755 index a4c4114..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasMaskManager.js.html +++ /dev/null @@ -1,336 +0,0 @@ - - - - - src/pixi/renderers/canvas/utils/CanvasMaskManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/canvas/utils/CanvasMaskManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A set of functions used to handle masking.
    - *
    - * @class CanvasMaskManager
    - * @constructor
    - */
    -PIXI.CanvasMaskManager = function()
    -{
    -};
    -
    -PIXI.CanvasMaskManager.prototype.constructor = PIXI.CanvasMaskManager;
    -
    -/**
    - * This method adds it to the current stack of masks.
    - *
    - * @method pushMask
    - * @param maskData {Object} the maskData that will be pushed
    - * @param renderSession {Object} The renderSession whose context will be used for this mask manager.
    - */
    -PIXI.CanvasMaskManager.prototype.pushMask = function(maskData, renderSession)
    -{
    -	var context = renderSession.context;
    -
    -    context.save();
    -    
    -    var cacheAlpha = maskData.alpha;
    -    var transform = maskData.worldTransform;
    -
    -    var resolution = renderSession.resolution;
    -
    -    context.setTransform(transform.a * resolution,
    -                         transform.b * resolution,
    -                         transform.c * resolution,
    -                         transform.d * resolution,
    -                         transform.tx * resolution,
    -                         transform.ty * resolution);
    -
    -    PIXI.CanvasGraphics.renderGraphicsMask(maskData, context);
    -
    -    context.clip();
    -
    -    maskData.worldAlpha = cacheAlpha;
    -};
    -
    -/**
    - * Restores the current drawing context to the state it was before the mask was applied.
    - *
    - * @method popMask
    - * @param renderSession {Object} The renderSession whose context will be used for this mask manager.
    - */
    -PIXI.CanvasMaskManager.prototype.popMask = function(renderSession)
    -{
    -    renderSession.context.restore();
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasTinter.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasTinter.js.html deleted file mode 100755 index 679a98c..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasTinter.js.html +++ /dev/null @@ -1,510 +0,0 @@ - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/canvas/utils/CanvasTinter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * @class CanvasTinter
    - * @constructor
    - * @static
    - */
    -PIXI.CanvasTinter = function()
    -{
    -};
    -
    -/**
    - * Basically this method just needs a sprite and a color and tints the sprite with the given color.
    - * 
    - * @method getTintedTexture 
    - * @param sprite {Sprite} the sprite to tint
    - * @param color {Number} the color to use to tint the sprite with
    - * @return {HTMLCanvasElement} The tinted canvas
    - */
    -PIXI.CanvasTinter.getTintedTexture = function(sprite, color)
    -{
    -    var texture = sprite.texture;
    -
    -    color = PIXI.CanvasTinter.roundColor(color);
    -
    -    var stringColor = "#" + ("00000" + ( color | 0).toString(16)).substr(-6);
    -   
    -    texture.tintCache = texture.tintCache || {};
    -
    -    if(texture.tintCache[stringColor]) return texture.tintCache[stringColor];
    -
    -     // clone texture..
    -    var canvas = PIXI.CanvasTinter.canvas || document.createElement("canvas");
    -    
    -    //PIXI.CanvasTinter.tintWithPerPixel(texture, stringColor, canvas);
    -    PIXI.CanvasTinter.tintMethod(texture, color, canvas);
    -
    -    if(PIXI.CanvasTinter.convertTintToImage)
    -    {
    -        // is this better?
    -        var tintImage = new Image();
    -        tintImage.src = canvas.toDataURL();
    -
    -        texture.tintCache[stringColor] = tintImage;
    -    }
    -    else
    -    {
    -        texture.tintCache[stringColor] = canvas;
    -        // if we are not converting the texture to an image then we need to lose the reference to the canvas
    -        PIXI.CanvasTinter.canvas = null;
    -    }
    -
    -    return canvas;
    -};
    -
    -/**
    - * Tint a texture using the "multiply" operation.
    - * 
    - * @method tintWithMultiply
    - * @param texture {Texture} the texture to tint
    - * @param color {Number} the color to use to tint the sprite with
    - * @param canvas {HTMLCanvasElement} the current canvas
    - */
    -PIXI.CanvasTinter.tintWithMultiply = function(texture, color, canvas)
    -{
    -    var context = canvas.getContext( "2d" );
    -
    -    var crop = texture.crop;
    -
    -    canvas.width = crop.width;
    -    canvas.height = crop.height;
    -
    -    context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6);
    -    
    -    context.fillRect(0, 0, crop.width, crop.height);
    -    
    -    context.globalCompositeOperation = "multiply";
    -
    -    context.drawImage(texture.baseTexture.source,
    -                           crop.x,
    -                           crop.y,
    -                           crop.width,
    -                           crop.height,
    -                           0,
    -                           0,
    -                           crop.width,
    -                           crop.height);
    -
    -    context.globalCompositeOperation = "destination-atop";
    -
    -    context.drawImage(texture.baseTexture.source,
    -                           crop.x,
    -                           crop.y,
    -                           crop.width,
    -                           crop.height,
    -                           0,
    -                           0,
    -                           crop.width,
    -                           crop.height);
    -};
    -
    -/**
    - * Tint a texture using the "overlay" operation.
    - * 
    - * @method tintWithOverlay
    - * @param texture {Texture} the texture to tint
    - * @param color {Number} the color to use to tint the sprite with
    - * @param canvas {HTMLCanvasElement} the current canvas
    - */
    -PIXI.CanvasTinter.tintWithOverlay = function(texture, color, canvas)
    -{
    -    var context = canvas.getContext( "2d" );
    -
    -    var crop = texture.crop;
    -
    -    canvas.width = crop.width;
    -    canvas.height = crop.height;
    -    
    -    context.globalCompositeOperation = "copy";
    -    context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6);
    -    context.fillRect(0, 0, crop.width, crop.height);
    -
    -    context.globalCompositeOperation = "destination-atop";
    -    context.drawImage(texture.baseTexture.source,
    -                           crop.x,
    -                           crop.y,
    -                           crop.width,
    -                           crop.height,
    -                           0,
    -                           0,
    -                           crop.width,
    -                           crop.height);
    -    
    -    //context.globalCompositeOperation = "copy";
    -};
    -
    -/**
    - * Tint a texture pixel per pixel.
    - * 
    - * @method tintPerPixel
    - * @param texture {Texture} the texture to tint
    - * @param color {Number} the color to use to tint the sprite with
    - * @param canvas {HTMLCanvasElement} the current canvas
    - */
    -PIXI.CanvasTinter.tintWithPerPixel = function(texture, color, canvas)
    -{
    -    var context = canvas.getContext( "2d" );
    -
    -    var crop = texture.crop;
    -
    -    canvas.width = crop.width;
    -    canvas.height = crop.height;
    -  
    -    context.globalCompositeOperation = "copy";
    -    context.drawImage(texture.baseTexture.source,
    -                           crop.x,
    -                           crop.y,
    -                           crop.width,
    -                           crop.height,
    -                           0,
    -                           0,
    -                           crop.width,
    -                           crop.height);
    -
    -    var rgbValues = PIXI.hex2rgb(color);
    -    var r = rgbValues[0], g = rgbValues[1], b = rgbValues[2];
    -
    -    var pixelData = context.getImageData(0, 0, crop.width, crop.height);
    -
    -    var pixels = pixelData.data;
    -
    -    for (var i = 0; i < pixels.length; i += 4)
    -    {
    -        pixels[i+0] *= r;
    -        pixels[i+1] *= g;
    -        pixels[i+2] *= b;
    -    }
    -
    -    context.putImageData(pixelData, 0, 0);
    -};
    -
    -/**
    - * Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel.
    - * 
    - * @method roundColor
    - * @param color {number} the color to round, should be a hex color
    - */
    -PIXI.CanvasTinter.roundColor = function(color)
    -{
    -    var step = PIXI.CanvasTinter.cacheStepsPerColorChannel;
    -
    -    var rgbValues = PIXI.hex2rgb(color);
    -
    -    rgbValues[0] = Math.min(255, (rgbValues[0] / step) * step);
    -    rgbValues[1] = Math.min(255, (rgbValues[1] / step) * step);
    -    rgbValues[2] = Math.min(255, (rgbValues[2] / step) * step);
    -
    -    return PIXI.rgb2hex(rgbValues);
    -};
    -
    -/**
    - * Number of steps which will be used as a cap when rounding colors.
    - *
    - * @property cacheStepsPerColorChannel
    - * @type Number
    - */
    -PIXI.CanvasTinter.cacheStepsPerColorChannel = 8;
    -
    -/**
    - * Tint cache boolean flag.
    - *
    - * @property convertTintToImage
    - * @type Boolean
    - */
    -PIXI.CanvasTinter.convertTintToImage = false;
    -
    -/**
    - * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method.
    - *
    - * @property canUseMultiply
    - * @type Boolean
    - */
    -PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes();
    -
    -/**
    - * The tinting method that will be used.
    - * 
    - * @method tintMethod
    - */
    -PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply :  PIXI.CanvasTinter.tintWithPerPixel;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_WebGLRenderer.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_WebGLRenderer.js.html deleted file mode 100755 index 5fb7452..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_WebGLRenderer.js.html +++ /dev/null @@ -1,820 +0,0 @@ - - - - - src/pixi/renderers/webgl/WebGLRenderer.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/WebGLRenderer.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -PIXI.glContexts = []; // this is where we store the webGL contexts for easy access.
    -PIXI.instances = [];
    -
    -/**
    - * The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer
    - * should be used for browsers that support webGL. This Render works by automatically managing webGLBatchs.
    - * So no need for Sprite Batches or Sprite Clouds.
    - * Don't forget to add the view to your DOM or you will not see anything :)
    - *
    - * @class WebGLRenderer
    - * @constructor
    - * @param [width=0] {Number} the width of the canvas view
    - * @param [height=0] {Number} the height of the canvas view
    - * @param [options] {Object} The optional renderer parameters
    - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional
    - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false
    - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false
    - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment)
    - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context
    - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2
    - */
    -PIXI.WebGLRenderer = function(width, height, options)
    -{
    -    if(options)
    -    {
    -        for (var i in PIXI.defaultRenderOptions)
    -        {
    -            if (typeof options[i] === 'undefined') options[i] = PIXI.defaultRenderOptions[i];
    -        }
    -    }
    -    else
    -    {
    -        options = PIXI.defaultRenderOptions;
    -    }
    -
    -    if(!PIXI.defaultRenderer)
    -    {
    -        PIXI.sayHello('webGL');
    -        PIXI.defaultRenderer = this;
    -    }
    -
    -    /**
    -     * @property type
    -     * @type Number
    -     */
    -    this.type = PIXI.WEBGL_RENDERER;
    -
    -    /**
    -     * The resolution of the renderer
    -     *
    -     * @property resolution
    -     * @type Number
    -     * @default 1
    -     */
    -    this.resolution = options.resolution;
    -
    -    // do a catch.. only 1 webGL renderer..
    -
    -    /**
    -     * Whether the render view is transparent
    -     *
    -     * @property transparent
    -     * @type Boolean
    -     */
    -    this.transparent = options.transparent;
    -
    -    /**
    -     * Whether the render view should be resized automatically
    -     *
    -     * @property autoResize
    -     * @type Boolean
    -     */
    -    this.autoResize = options.autoResize || false;
    -
    -    /**
    -     * The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering.
    -     *
    -     * @property preserveDrawingBuffer
    -     * @type Boolean
    -     */
    -    this.preserveDrawingBuffer = options.preserveDrawingBuffer;
    -
    -    /**
    -     * This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true:
    -     * If the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0).
    -     * If the Stage is transparent, Pixi will clear to the target Stage's background color.
    -     * Disable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set.
    -     *
    -     * @property clearBeforeRender
    -     * @type Boolean
    -     * @default
    -     */
    -    this.clearBeforeRender = options.clearBeforeRender;
    -
    -    /**
    -     * The width of the canvas view
    -     *
    -     * @property width
    -     * @type Number
    -     * @default 800
    -     */
    -    this.width = width || 800;
    -
    -    /**
    -     * The height of the canvas view
    -     *
    -     * @property height
    -     * @type Number
    -     * @default 600
    -     */
    -    this.height = height || 600;
    -
    -    /**
    -     * The canvas element that everything is drawn to
    -     *
    -     * @property view
    -     * @type HTMLCanvasElement
    -     */
    -    this.view = options.view || document.createElement( 'canvas' );
    -
    -    // deal with losing context..
    -
    -    /**
    -     * @property contextLostBound
    -     * @type Function
    -     */
    -    this.contextLostBound = this.handleContextLost.bind(this);
    -
    -    /**
    -     * @property contextRestoredBound
    -     * @type Function
    -     */
    -    this.contextRestoredBound = this.handleContextRestored.bind(this);
    -
    -    this.view.addEventListener('webglcontextlost', this.contextLostBound, false);
    -    this.view.addEventListener('webglcontextrestored', this.contextRestoredBound, false);
    -
    -    /**
    -     * @property _contextOptions
    -     * @type Object
    -     * @private
    -     */
    -    this._contextOptions = {
    -        alpha: this.transparent,
    -        antialias: options.antialias, // SPEED UP??
    -        premultipliedAlpha:this.transparent && this.transparent !== 'notMultiplied',
    -        stencil:true,
    -        preserveDrawingBuffer: options.preserveDrawingBuffer
    -    };
    -
    -    /**
    -     * @property projection
    -     * @type Point
    -     */
    -    this.projection = new PIXI.Point();
    -
    -    /**
    -     * @property offset
    -     * @type Point
    -     */
    -    this.offset = new PIXI.Point(0, 0);
    -
    -    // time to create the render managers! each one focuses on managing a state in webGL
    -
    -    /**
    -     * Deals with managing the shader programs and their attribs
    -     * @property shaderManager
    -     * @type WebGLShaderManager
    -     */
    -    this.shaderManager = new PIXI.WebGLShaderManager();
    -
    -    /**
    -     * Manages the rendering of sprites
    -     * @property spriteBatch
    -     * @type WebGLSpriteBatch
    -     */
    -    this.spriteBatch = new PIXI.WebGLSpriteBatch();
    -
    -    /**
    -     * Manages the masks using the stencil buffer
    -     * @property maskManager
    -     * @type WebGLMaskManager
    -     */
    -    this.maskManager = new PIXI.WebGLMaskManager();
    -
    -    /**
    -     * Manages the filters
    -     * @property filterManager
    -     * @type WebGLFilterManager
    -     */
    -    this.filterManager = new PIXI.WebGLFilterManager();
    -
    -    /**
    -     * Manages the stencil buffer
    -     * @property stencilManager
    -     * @type WebGLStencilManager
    -     */
    -    this.stencilManager = new PIXI.WebGLStencilManager();
    -
    -    /**
    -     * Manages the blendModes
    -     * @property blendModeManager
    -     * @type WebGLBlendModeManager
    -     */
    -    this.blendModeManager = new PIXI.WebGLBlendModeManager();
    -
    -    /**
    -     * TODO remove
    -     * @property renderSession
    -     * @type Object
    -     */
    -    this.renderSession = {};
    -    this.renderSession.gl = this.gl;
    -    this.renderSession.drawCount = 0;
    -    this.renderSession.shaderManager = this.shaderManager;
    -    this.renderSession.maskManager = this.maskManager;
    -    this.renderSession.filterManager = this.filterManager;
    -    this.renderSession.blendModeManager = this.blendModeManager;
    -    this.renderSession.spriteBatch = this.spriteBatch;
    -    this.renderSession.stencilManager = this.stencilManager;
    -    this.renderSession.renderer = this;
    -    this.renderSession.resolution = this.resolution;
    -
    -    // time init the context..
    -    this.initContext();
    -
    -    // map some webGL blend modes..
    -    this.mapBlendModes();
    -};
    -
    -// constructor
    -PIXI.WebGLRenderer.prototype.constructor = PIXI.WebGLRenderer;
    -
    -/**
    -* @method initContext
    -*/
    -PIXI.WebGLRenderer.prototype.initContext = function()
    -{
    -    var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions);
    -    this.gl = gl;
    -
    -    if (!gl) {
    -        // fail, not able to get a context
    -        throw new Error('This browser does not support webGL. Try using the canvas renderer');
    -    }
    -
    -    this.glContextId = gl.id = PIXI.WebGLRenderer.glContextId ++;
    -
    -    PIXI.glContexts[this.glContextId] = gl;
    -
    -    PIXI.instances[this.glContextId] = this;
    -
    -    // set up the default pixi settings..
    -    gl.disable(gl.DEPTH_TEST);
    -    gl.disable(gl.CULL_FACE);
    -    gl.enable(gl.BLEND);
    -
    -    // need to set the context for all the managers...
    -    this.shaderManager.setContext(gl);
    -    this.spriteBatch.setContext(gl);
    -    this.maskManager.setContext(gl);
    -    this.filterManager.setContext(gl);
    -    this.blendModeManager.setContext(gl);
    -    this.stencilManager.setContext(gl);
    -
    -    this.renderSession.gl = this.gl;
    -
    -    // now resize and we are good to go!
    -    this.resize(this.width, this.height);
    -};
    -
    -/**
    - * Renders the stage to its webGL view
    - *
    - * @method render
    - * @param stage {Stage} the Stage element to be rendered
    - */
    -PIXI.WebGLRenderer.prototype.render = function(stage)
    -{
    -    // no point rendering if our context has been blown up!
    -    if(this.contextLost)return;
    -
    -    // if rendering a new stage clear the batches..
    -    if(this.__stage !== stage)
    -    {
    -        if(stage.interactive)stage.interactionManager.removeEvents();
    -
    -        // TODO make this work
    -        // dont think this is needed any more?
    -        this.__stage = stage;
    -    }
    -
    -    // update the scene graph
    -    stage.updateTransform();
    -
    -    var gl = this.gl;
    -
    -    // interaction
    -    if(stage._interactive)
    -    {
    -        //need to add some events!
    -        if(!stage._interactiveEventsAdded)
    -        {
    -            stage._interactiveEventsAdded = true;
    -            stage.interactionManager.setTarget(this);
    -        }
    -    }
    -    else
    -    {
    -        if(stage._interactiveEventsAdded)
    -        {
    -            stage._interactiveEventsAdded = false;
    -            stage.interactionManager.setTarget(this);
    -        }
    -    }
    -
    -    // -- Does this need to be set every frame? -- //
    -    gl.viewport(0, 0, this.width, this.height);
    -
    -    // make sure we are bound to the main frame buffer
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, null);
    -
    -    if (this.clearBeforeRender)
    -        {
    -        if(this.transparent)
    -        {
    -            gl.clearColor(0, 0, 0, 0);
    -        }
    -        else
    -        {
    -            gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], 1);
    -        }
    -
    -        gl.clear (gl.COLOR_BUFFER_BIT);
    -    }
    -
    -    this.renderDisplayObject( stage, this.projection );
    -};
    -
    -/**
    - * Renders a Display Object.
    - *
    - * @method renderDisplayObject
    - * @param displayObject {DisplayObject} The DisplayObject to render
    - * @param projection {Point} The projection
    - * @param buffer {Array} a standard WebGL buffer
    - */
    -PIXI.WebGLRenderer.prototype.renderDisplayObject = function(displayObject, projection, buffer)
    -{
    -    this.renderSession.blendModeManager.setBlendMode(PIXI.blendModes.NORMAL);
    -
    -    // reset the render session data..
    -    this.renderSession.drawCount = 0;
    -
    -    // set the default projection
    -    this.renderSession.projection = projection;
    -
    -    //set the default offset
    -    this.renderSession.offset = this.offset;
    -
    -    // start the sprite batch
    -    this.spriteBatch.begin(this.renderSession);
    -
    -    // start the filter manager
    -    this.filterManager.begin(this.renderSession, buffer);
    -
    -    // render the scene!
    -    displayObject._renderWebGL(this.renderSession);
    -
    -    // finish the sprite batch
    -    this.spriteBatch.end();
    -};
    -
    -/**
    - * Resizes the webGL view to the specified width and height.
    - *
    - * @method resize
    - * @param width {Number} the new width of the webGL view
    - * @param height {Number} the new height of the webGL view
    - */
    -PIXI.WebGLRenderer.prototype.resize = function(width, height)
    -{
    -    this.width = width * this.resolution;
    -    this.height = height * this.resolution;
    -
    -    this.view.width = this.width;
    -    this.view.height = this.height;
    -
    -    if (this.autoResize) {
    -        this.view.style.width = this.width / this.resolution + 'px';
    -        this.view.style.height = this.height / this.resolution + 'px';
    -    }
    -
    -    this.gl.viewport(0, 0, this.width, this.height);
    -
    -    this.projection.x =  this.width / 2 / this.resolution;
    -    this.projection.y =  -this.height / 2 / this.resolution;
    -};
    -
    -/**
    - * Updates and Creates a WebGL texture for the renderers context.
    - *
    - * @method updateTexture
    - * @param texture {Texture} the texture to update
    - */
    -PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    -{
    -    if(!texture.hasLoaded )return;
    -
    -    var gl = this.gl;
    -
    -    if(!texture._glTextures[gl.id])texture._glTextures[gl.id] = gl.createTexture();
    -
    -    gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]);
    -
    -    gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultipliedAlpha);
    -    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source);
    -
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
    -
    -    // reguler...
    -    if(!texture._powerOf2)
    -    {
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    -    }
    -    else
    -    {
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
    -    }
    -
    -    texture._dirty[gl.id] = false;
    -
    -    return  texture._glTextures[gl.id];
    -};
    -
    -/**
    - * Handles a lost webgl context
    - *
    - * @method handleContextLost
    - * @param event {Event}
    - * @private
    - */
    -PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    -{
    -    event.preventDefault();
    -    this.contextLost = true;
    -};
    -
    -/**
    - * Handles a restored webgl context
    - *
    - * @method handleContextRestored
    - * @param event {Event}
    - * @private
    - */
    -PIXI.WebGLRenderer.prototype.handleContextRestored = function()
    -{
    -    this.initContext();
    -
    -    // empty all the ol gl textures as they are useless now
    -    for(var key in PIXI.TextureCache)
    -    {
    -        var texture = PIXI.TextureCache[key].baseTexture;
    -        texture._glTextures = [];
    -    }
    -
    -    this.contextLost = false;
    -};
    -
    -/**
    - * Removes everything from the renderer (event listeners, spritebatch, etc...)
    - *
    - * @method destroy
    - */
    -PIXI.WebGLRenderer.prototype.destroy = function()
    -{
    -    // remove listeners
    -    this.view.removeEventListener('webglcontextlost', this.contextLostBound);
    -    this.view.removeEventListener('webglcontextrestored', this.contextRestoredBound);
    -
    -    PIXI.glContexts[this.glContextId] = null;
    -
    -    this.projection = null;
    -    this.offset = null;
    -
    -    // time to create the render managers! each one focuses on managine a state in webGL
    -    this.shaderManager.destroy();
    -    this.spriteBatch.destroy();
    -    this.maskManager.destroy();
    -    this.filterManager.destroy();
    -
    -    this.shaderManager = null;
    -    this.spriteBatch = null;
    -    this.maskManager = null;
    -    this.filterManager = null;
    -
    -    this.gl = null;
    -    this.renderSession = null;
    -};
    -
    -/**
    - * Maps Pixi blend modes to WebGL blend modes.
    - *
    - * @method mapBlendModes
    - */
    -PIXI.WebGLRenderer.prototype.mapBlendModes = function()
    -{
    -    var gl = this.gl;
    -
    -    if(!PIXI.blendModesWebGL)
    -    {
    -        PIXI.blendModesWebGL = [];
    -
    -        PIXI.blendModesWebGL[PIXI.blendModes.NORMAL]        = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.ADD]           = [gl.SRC_ALPHA, gl.DST_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.MULTIPLY]      = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.SCREEN]        = [gl.SRC_ALPHA, gl.ONE];
    -        PIXI.blendModesWebGL[PIXI.blendModes.OVERLAY]       = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.DARKEN]        = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.LIGHTEN]       = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.COLOR_DODGE]   = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.COLOR_BURN]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.HARD_LIGHT]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.SOFT_LIGHT]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.DIFFERENCE]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.EXCLUSION]     = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.HUE]           = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.SATURATION]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.COLOR]         = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.LUMINOSITY]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -    }
    -};
    -
    -PIXI.WebGLRenderer.glContextId = 0;
    -PIXI.WebGLRenderer.instances = [];
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_ComplexPrimitiveShader.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_ComplexPrimitiveShader.js.html deleted file mode 100755 index 696e890..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_ComplexPrimitiveShader.js.html +++ /dev/null @@ -1,399 +0,0 @@ - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class ComplexPrimitiveShader
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.ComplexPrimitiveShader = function(gl)
    -{
    -    /**
    -     * @property _UID
    -     * @type Number
    -     * @private
    -     */
    -    this._UID = PIXI._UID++;
    -
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    /**
    -     * The WebGL program.
    -     * @property program
    -     * @type {Any}
    -     */
    -    this.program = null;
    -
    -    /**
    -     * The fragment shader.
    -     * @property fragmentSrc
    -     * @type Array
    -     */
    -    this.fragmentSrc = [
    -
    -        'precision mediump float;',
    -
    -        'varying vec4 vColor;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = vColor;',
    -        '}'
    -    ];
    -
    -    /**
    -     * The vertex shader.
    -     * @property vertexSrc
    -     * @type Array
    -     */
    -    this.vertexSrc  = [
    -        'attribute vec2 aVertexPosition;',
    -        //'attribute vec4 aColor;',
    -        'uniform mat3 translationMatrix;',
    -        'uniform vec2 projectionVector;',
    -        'uniform vec2 offsetVector;',
    -        
    -        'uniform vec3 tint;',
    -        'uniform float alpha;',
    -        'uniform vec3 color;',
    -
    -        'varying vec4 vColor;',
    -
    -        'void main(void) {',
    -        '   vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);',
    -        '   v -= offsetVector.xyx;',
    -        '   gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);',
    -        '   vColor = vec4(color * alpha * tint, alpha);',//" * vec4(tint * alpha, alpha);',
    -        '}'
    -    ];
    -
    -    this.init();
    -};
    -
    -PIXI.ComplexPrimitiveShader.prototype.constructor = PIXI.ComplexPrimitiveShader;
    -
    -/**
    -* Initialises the shader.
    -* 
    -* @method init
    -*/
    -PIXI.ComplexPrimitiveShader.prototype.init = function()
    -{
    -    var gl = this.gl;
    -
    -    var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc);
    -    gl.useProgram(program);
    -
    -    // get and store the uniforms for the shader
    -    this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
    -    this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
    -    this.tintColor = gl.getUniformLocation(program, 'tint');
    -    this.color = gl.getUniformLocation(program, 'color');
    -
    -    // get and store the attributes
    -    this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
    -   // this.colorAttribute = gl.getAttribLocation(program, 'aColor');
    -
    -    this.attributes = [this.aVertexPosition, this.colorAttribute];
    -
    -    this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix');
    -    this.alpha = gl.getUniformLocation(program, 'alpha');
    -
    -    this.program = program;
    -};
    -
    -/**
    -* Destroys the shader.
    -* 
    -* @method destroy
    -*/
    -PIXI.ComplexPrimitiveShader.prototype.destroy = function()
    -{
    -    this.gl.deleteProgram( this.program );
    -    this.uniforms = null;
    -    this.gl = null;
    -
    -    this.attribute = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiFastShader.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiFastShader.js.html deleted file mode 100755 index 05dda36..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiFastShader.js.html +++ /dev/null @@ -1,433 +0,0 @@ - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/shaders/PixiFastShader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class PixiFastShader
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.PixiFastShader = function(gl)
    -{
    -    /**
    -     * @property _UID
    -     * @type Number
    -     * @private
    -     */
    -    this._UID = PIXI._UID++;
    -    
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    /**
    -     * The WebGL program.
    -     * @property program
    -     * @type {Any}
    -     */
    -    this.program = null;
    -
    -    /**
    -     * The fragment shader.
    -     * @property fragmentSrc
    -     * @type Array
    -     */
    -    this.fragmentSrc = [
    -        'precision lowp float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying float vColor;',
    -        'uniform sampler2D uSampler;',
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;',
    -        '}'
    -    ];
    -
    -    /**
    -     * The vertex shader.
    -     * @property vertexSrc
    -     * @type Array
    -     */
    -    this.vertexSrc = [
    -        'attribute vec2 aVertexPosition;',
    -        'attribute vec2 aPositionCoord;',
    -        'attribute vec2 aScale;',
    -        'attribute float aRotation;',
    -        'attribute vec2 aTextureCoord;',
    -        'attribute float aColor;',
    -
    -        'uniform vec2 projectionVector;',
    -        'uniform vec2 offsetVector;',
    -        'uniform mat3 uMatrix;',
    -
    -        'varying vec2 vTextureCoord;',
    -        'varying float vColor;',
    -
    -        'const vec2 center = vec2(-1.0, 1.0);',
    -
    -        'void main(void) {',
    -        '   vec2 v;',
    -        '   vec2 sv = aVertexPosition * aScale;',
    -        '   v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);',
    -        '   v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);',
    -        '   v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;',
    -        '   gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);',
    -        '   vTextureCoord = aTextureCoord;',
    -      //  '   vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;',
    -        '   vColor = aColor;',
    -        '}'
    -    ];
    -
    -    /**
    -     * A local texture counter for multi-texture shaders.
    -     * @property textureCount
    -     * @type Number
    -     */
    -    this.textureCount = 0;
    -    
    -    this.init();
    -};
    -
    -PIXI.PixiFastShader.prototype.constructor = PIXI.PixiFastShader;
    -
    -/**
    -* Initialises the shader.
    -* 
    -* @method init
    -*/
    -PIXI.PixiFastShader.prototype.init = function()
    -{
    -    var gl = this.gl;
    -
    -    var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc);
    -    
    -    gl.useProgram(program);
    -
    -    // get and store the uniforms for the shader
    -    this.uSampler = gl.getUniformLocation(program, 'uSampler');
    -
    -    this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
    -    this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
    -    this.dimensions = gl.getUniformLocation(program, 'dimensions');
    -    this.uMatrix = gl.getUniformLocation(program, 'uMatrix');
    -
    -    // get and store the attributes
    -    this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
    -    this.aPositionCoord = gl.getAttribLocation(program, 'aPositionCoord');
    -
    -    this.aScale = gl.getAttribLocation(program, 'aScale');
    -    this.aRotation = gl.getAttribLocation(program, 'aRotation');
    -
    -    this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord');
    -    this.colorAttribute = gl.getAttribLocation(program, 'aColor');
    -   
    -    // Begin worst hack eva //
    -
    -    // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters?
    -    // maybe its somthing to do with the current state of the gl context.
    -    // Im convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel
    -    // If theres any webGL people that know why could happen please help :)
    -    if(this.colorAttribute === -1)
    -    {
    -        this.colorAttribute = 2;
    -    }
    -
    -    this.attributes = [this.aVertexPosition, this.aPositionCoord,  this.aScale, this.aRotation, this.aTextureCoord, this.colorAttribute];
    -    
    -    // End worst hack eva //
    -
    -    this.program = program;
    -};
    -
    -/**
    -* Destroys the shader.
    -* 
    -* @method destroy
    -*/
    -PIXI.PixiFastShader.prototype.destroy = function()
    -{
    -    this.gl.deleteProgram( this.program );
    -    this.uniforms = null;
    -    this.gl = null;
    -
    -    this.attributes = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiShader.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiShader.js.html deleted file mode 100755 index 89d83ac..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiShader.js.html +++ /dev/null @@ -1,668 +0,0 @@ - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/shaders/PixiShader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * @author Richard Davey http://www.photonstorm.com @photonstorm
    - */
    -
    -/**
    -* @class PixiShader
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.PixiShader = function(gl)
    -{
    -    /**
    -     * @property _UID
    -     * @type Number
    -     * @private
    -     */
    -    this._UID = PIXI._UID++;
    -
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    /**
    -     * The WebGL program.
    -     * @property program
    -     * @type {Any}
    -     */
    -    this.program = null;
    -
    -    /**
    -     * The fragment shader.
    -     * @property fragmentSrc
    -     * @type Array
    -     */
    -    this.fragmentSrc = [
    -        'precision lowp float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D uSampler;',
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;',
    -        '}'
    -    ];
    -
    -    /**
    -     * A local texture counter for multi-texture shaders.
    -     * @property textureCount
    -     * @type Number
    -     */
    -    this.textureCount = 0;
    -
    -    /**
    -     * A local flag
    -     * @property firstRun
    -     * @type Boolean
    -     * @private
    -     */
    -    this.firstRun = true;
    -
    -    /**
    -     * A dirty flag
    -     * @property dirty
    -     * @type Boolean
    -     */
    -    this.dirty = true;
    -
    -    /**
    -     * Uniform attributes cache.
    -     * @property attributes
    -     * @type Array
    -     * @private
    -     */
    -    this.attributes = [];
    -
    -    this.init();
    -};
    -
    -PIXI.PixiShader.prototype.constructor = PIXI.PixiShader;
    -
    -/**
    -* Initialises the shader.
    -*
    -* @method init
    -*/
    -PIXI.PixiShader.prototype.init = function()
    -{
    -    var gl = this.gl;
    -
    -    var program = PIXI.compileProgram(gl, this.vertexSrc || PIXI.PixiShader.defaultVertexSrc, this.fragmentSrc);
    -
    -    gl.useProgram(program);
    -
    -    // get and store the uniforms for the shader
    -    this.uSampler = gl.getUniformLocation(program, 'uSampler');
    -    this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
    -    this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
    -    this.dimensions = gl.getUniformLocation(program, 'dimensions');
    -
    -    // get and store the attributes
    -    this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
    -    this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord');
    -    this.colorAttribute = gl.getAttribLocation(program, 'aColor');
    -
    -    // Begin worst hack eva //
    -
    -    // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters?
    -    // maybe its something to do with the current state of the gl context.
    -    // I'm convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel
    -    // If theres any webGL people that know why could happen please help :)
    -    if(this.colorAttribute === -1)
    -    {
    -        this.colorAttribute = 2;
    -    }
    -
    -    this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
    -
    -    // End worst hack eva //
    -
    -    // add those custom shaders!
    -    for (var key in this.uniforms)
    -    {
    -        // get the uniform locations..
    -        this.uniforms[key].uniformLocation = gl.getUniformLocation(program, key);
    -    }
    -
    -    this.initUniforms();
    -
    -    this.program = program;
    -};
    -
    -/**
    -* Initialises the shader uniform values.
    -*
    -* Uniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/
    -* http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf
    -*
    -* @method initUniforms
    -*/
    -PIXI.PixiShader.prototype.initUniforms = function()
    -{
    -    this.textureCount = 1;
    -    var gl = this.gl;
    -    var uniform;
    -
    -    for (var key in this.uniforms)
    -    {
    -        uniform = this.uniforms[key];
    -
    -        var type = uniform.type;
    -
    -        if (type === 'sampler2D')
    -        {
    -            uniform._init = false;
    -
    -            if (uniform.value !== null)
    -            {
    -                this.initSampler2D(uniform);
    -            }
    -        }
    -        else if (type === 'mat2' || type === 'mat3' || type === 'mat4')
    -        {
    -            //  These require special handling
    -            uniform.glMatrix = true;
    -            uniform.glValueLength = 1;
    -
    -            if (type === 'mat2')
    -            {
    -                uniform.glFunc = gl.uniformMatrix2fv;
    -            }
    -            else if (type === 'mat3')
    -            {
    -                uniform.glFunc = gl.uniformMatrix3fv;
    -            }
    -            else if (type === 'mat4')
    -            {
    -                uniform.glFunc = gl.uniformMatrix4fv;
    -            }
    -        }
    -        else
    -        {
    -            //  GL function reference
    -            uniform.glFunc = gl['uniform' + type];
    -
    -            if (type === '2f' || type === '2i')
    -            {
    -                uniform.glValueLength = 2;
    -            }
    -            else if (type === '3f' || type === '3i')
    -            {
    -                uniform.glValueLength = 3;
    -            }
    -            else if (type === '4f' || type === '4i')
    -            {
    -                uniform.glValueLength = 4;
    -            }
    -            else
    -            {
    -                uniform.glValueLength = 1;
    -            }
    -        }
    -    }
    -
    -};
    -
    -/**
    -* Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded)
    -*
    -* @method initSampler2D
    -*/
    -PIXI.PixiShader.prototype.initSampler2D = function(uniform)
    -{
    -    if (!uniform.value || !uniform.value.baseTexture || !uniform.value.baseTexture.hasLoaded)
    -    {
    -        return;
    -    }
    -
    -    var gl = this.gl;
    -
    -    gl.activeTexture(gl['TEXTURE' + this.textureCount]);
    -    gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]);
    -
    -    //  Extended texture data
    -    if (uniform.textureData)
    -    {
    -        var data = uniform.textureData;
    -
    -        // GLTexture = mag linear, min linear_mipmap_linear, wrap repeat + gl.generateMipmap(gl.TEXTURE_2D);
    -        // GLTextureLinear = mag/min linear, wrap clamp
    -        // GLTextureNearestRepeat = mag/min NEAREST, wrap repeat
    -        // GLTextureNearest = mag/min nearest, wrap clamp
    -        // AudioTexture = whatever + luminance + width 512, height 2, border 0
    -        // KeyTexture = whatever + luminance + width 256, height 2, border 0
    -
    -        //  magFilter can be: gl.LINEAR, gl.LINEAR_MIPMAP_LINEAR or gl.NEAREST
    -        //  wrapS/T can be: gl.CLAMP_TO_EDGE or gl.REPEAT
    -
    -        var magFilter = (data.magFilter) ? data.magFilter : gl.LINEAR;
    -        var minFilter = (data.minFilter) ? data.minFilter : gl.LINEAR;
    -        var wrapS = (data.wrapS) ? data.wrapS : gl.CLAMP_TO_EDGE;
    -        var wrapT = (data.wrapT) ? data.wrapT : gl.CLAMP_TO_EDGE;
    -        var format = (data.luminance) ? gl.LUMINANCE : gl.RGBA;
    -
    -        if (data.repeat)
    -        {
    -            wrapS = gl.REPEAT;
    -            wrapT = gl.REPEAT;
    -        }
    -
    -        gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, !!data.flipY);
    -
    -        if (data.width)
    -        {
    -            var width = (data.width) ? data.width : 512;
    -            var height = (data.height) ? data.height : 2;
    -            var border = (data.border) ? data.border : 0;
    -
    -            // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels);
    -            gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, border, format, gl.UNSIGNED_BYTE, null);
    -        }
    -        else
    -        {
    -            //  void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, ImageData? pixels);
    -            gl.texImage2D(gl.TEXTURE_2D, 0, format, gl.RGBA, gl.UNSIGNED_BYTE, uniform.value.baseTexture.source);
    -        }
    -
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter);
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter);
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrapS);
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT);
    -    }
    -
    -    gl.uniform1i(uniform.uniformLocation, this.textureCount);
    -
    -    uniform._init = true;
    -
    -    this.textureCount++;
    -
    -};
    -
    -/**
    -* Updates the shader uniform values.
    -*
    -* @method syncUniforms
    -*/
    -PIXI.PixiShader.prototype.syncUniforms = function()
    -{
    -    this.textureCount = 1;
    -    var uniform;
    -    var gl = this.gl;
    -
    -    //  This would probably be faster in an array and it would guarantee key order
    -    for (var key in this.uniforms)
    -    {
    -        uniform = this.uniforms[key];
    -
    -        if (uniform.glValueLength === 1)
    -        {
    -            if (uniform.glMatrix === true)
    -            {
    -                uniform.glFunc.call(gl, uniform.uniformLocation, uniform.transpose, uniform.value);
    -            }
    -            else
    -            {
    -                uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value);
    -            }
    -        }
    -        else if (uniform.glValueLength === 2)
    -        {
    -            uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y);
    -        }
    -        else if (uniform.glValueLength === 3)
    -        {
    -            uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z);
    -        }
    -        else if (uniform.glValueLength === 4)
    -        {
    -            uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z, uniform.value.w);
    -        }
    -        else if (uniform.type === 'sampler2D')
    -        {
    -            if (uniform._init)
    -            {
    -                gl.activeTexture(gl['TEXTURE' + this.textureCount]);
    -
    -                if(uniform.value.baseTexture._dirty[gl.id])
    -                {
    -                    PIXI.WebGLRenderer.instances[gl.id].updateTexture(uniform.value.baseTexture);
    -                }
    -                else
    -                {
    -                    // bind the current texture
    -                    gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]);
    -                }
    -
    -             //   gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id] || PIXI.createWebGLTexture( uniform.value.baseTexture, gl));
    -                gl.uniform1i(uniform.uniformLocation, this.textureCount);
    -                this.textureCount++;
    -            }
    -            else
    -            {
    -                this.initSampler2D(uniform);
    -            }
    -        }
    -    }
    -
    -};
    -
    -/**
    -* Destroys the shader.
    -*
    -* @method destroy
    -*/
    -PIXI.PixiShader.prototype.destroy = function()
    -{
    -    this.gl.deleteProgram( this.program );
    -    this.uniforms = null;
    -    this.gl = null;
    -
    -    this.attributes = null;
    -};
    -
    -/**
    -* The Default Vertex shader source.
    -*
    -* @property defaultVertexSrc
    -* @type String
    -*/
    -PIXI.PixiShader.defaultVertexSrc = [
    -    'attribute vec2 aVertexPosition;',
    -    'attribute vec2 aTextureCoord;',
    -    'attribute vec4 aColor;',
    -
    -    'uniform vec2 projectionVector;',
    -    'uniform vec2 offsetVector;',
    -
    -    'varying vec2 vTextureCoord;',
    -    'varying vec4 vColor;',
    -
    -    'const vec2 center = vec2(-1.0, 1.0);',
    -
    -    'void main(void) {',
    -    '   gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);',
    -    '   vTextureCoord = aTextureCoord;',
    -    '   vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;',
    -    '   vColor = vec4(color * aColor.x, aColor.x);',
    -    '}'
    -];
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PrimitiveShader.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PrimitiveShader.js.html deleted file mode 100755 index de2db53..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PrimitiveShader.js.html +++ /dev/null @@ -1,393 +0,0 @@ - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/shaders/PrimitiveShader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class PrimitiveShader
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.PrimitiveShader = function(gl)
    -{
    -    /**
    -     * @property _UID
    -     * @type Number
    -     * @private
    -     */
    -    this._UID = PIXI._UID++;
    - 
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    /**
    -     * The WebGL program.
    -     * @property program
    -     * @type {Any}
    -     */
    -    this.program = null;
    -
    -    /**
    -     * The fragment shader.
    -     * @property fragmentSrc
    -     * @type Array
    -     */
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec4 vColor;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = vColor;',
    -        '}'
    -    ];
    -
    -    /**
    -     * The vertex shader.
    -     * @property vertexSrc
    -     * @type Array
    -     */
    -    this.vertexSrc  = [
    -        'attribute vec2 aVertexPosition;',
    -        'attribute vec4 aColor;',
    -        'uniform mat3 translationMatrix;',
    -        'uniform vec2 projectionVector;',
    -        'uniform vec2 offsetVector;',
    -        'uniform float alpha;',
    -        'uniform vec3 tint;',
    -        'varying vec4 vColor;',
    -
    -        'void main(void) {',
    -        '   vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);',
    -        '   v -= offsetVector.xyx;',
    -        '   gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);',
    -        '   vColor = aColor * vec4(tint * alpha, alpha);',
    -        '}'
    -    ];
    -
    -    this.init();
    -};
    -
    -PIXI.PrimitiveShader.prototype.constructor = PIXI.PrimitiveShader;
    -
    -/**
    -* Initialises the shader.
    -* 
    -* @method init
    -*/
    -PIXI.PrimitiveShader.prototype.init = function()
    -{
    -    var gl = this.gl;
    -
    -    var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc);
    -    gl.useProgram(program);
    -
    -    // get and store the uniforms for the shader
    -    this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
    -    this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
    -    this.tintColor = gl.getUniformLocation(program, 'tint');
    -
    -    // get and store the attributes
    -    this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
    -    this.colorAttribute = gl.getAttribLocation(program, 'aColor');
    -
    -    this.attributes = [this.aVertexPosition, this.colorAttribute];
    -
    -    this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix');
    -    this.alpha = gl.getUniformLocation(program, 'alpha');
    -
    -    this.program = program;
    -};
    -
    -/**
    -* Destroys the shader.
    -* 
    -* @method destroy
    -*/
    -PIXI.PrimitiveShader.prototype.destroy = function()
    -{
    -    this.gl.deleteProgram( this.program );
    -    this.uniforms = null;
    -    this.gl = null;
    -
    -    this.attributes = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_StripShader.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_StripShader.js.html deleted file mode 100755 index 39bc977..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_StripShader.js.html +++ /dev/null @@ -1,401 +0,0 @@ - - - - - src/pixi/renderers/webgl/shaders/StripShader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/shaders/StripShader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class StripShader
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.StripShader = function(gl)
    -{
    -    /**
    -     * @property _UID
    -     * @type Number
    -     * @private
    -     */
    -    this._UID = PIXI._UID++;
    -    
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    /**
    -     * The WebGL program.
    -     * @property program
    -     * @type {Any}
    -     */
    -    this.program = null;
    -
    -    /**
    -     * The fragment shader.
    -     * @property fragmentSrc
    -     * @type Array
    -     */
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -     //   'varying float vColor;',
    -        'uniform float alpha;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * alpha;',
    -      //  '   gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);',//gl_FragColor * alpha;',
    -        '}'
    -    ];
    -
    -    /**
    -     * The vertex shader.
    -     * @property vertexSrc
    -     * @type Array
    -     */
    -    this.vertexSrc  = [
    -        'attribute vec2 aVertexPosition;',
    -        'attribute vec2 aTextureCoord;',
    -        'uniform mat3 translationMatrix;',
    -        'uniform vec2 projectionVector;',
    -        'uniform vec2 offsetVector;',
    -      //  'uniform float alpha;',
    -       // 'uniform vec3 tint;',
    -        'varying vec2 vTextureCoord;',
    -      //  'varying vec4 vColor;',
    -
    -        'void main(void) {',
    -        '   vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);',
    -        '   v -= offsetVector.xyx;',
    -        '   gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);',
    -        '   vTextureCoord = aTextureCoord;',
    -       // '   vColor = aColor * vec4(tint * alpha, alpha);',
    -        '}'
    -    ];
    -
    -    this.init();
    -};
    -
    -PIXI.StripShader.prototype.constructor = PIXI.StripShader;
    -
    -/**
    -* Initialises the shader.
    -* 
    -* @method init
    -*/
    -PIXI.StripShader.prototype.init = function()
    -{
    -    var gl = this.gl;
    -
    -    var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc);
    -    gl.useProgram(program);
    -
    -    // get and store the uniforms for the shader
    -    this.uSampler = gl.getUniformLocation(program, 'uSampler');
    -    this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
    -    this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
    -    this.colorAttribute = gl.getAttribLocation(program, 'aColor');
    -    //this.dimensions = gl.getUniformLocation(this.program, 'dimensions');
    -
    -    // get and store the attributes
    -    this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
    -    this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord');
    -
    -    this.attributes = [this.aVertexPosition, this.aTextureCoord];
    -
    -    this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix');
    -    this.alpha = gl.getUniformLocation(program, 'alpha');
    -
    -    this.program = program;
    -};
    -
    -/**
    -* Destroys the shader.
    -* 
    -* @method destroy
    -*/
    -PIXI.StripShader.prototype.destroy = function()
    -{
    -    this.gl.deleteProgram( this.program );
    -    this.uniforms = null;
    -    this.gl = null;
    -
    -    this.attribute = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_FilterTexture.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_FilterTexture.js.html deleted file mode 100755 index f1ce334..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_FilterTexture.js.html +++ /dev/null @@ -1,388 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/FilterTexture.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class FilterTexture
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -* @param width {Number} the horizontal range of the filter
    -* @param height {Number} the vertical range of the filter
    -* @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    -*/
    -PIXI.FilterTexture = function(gl, width, height, scaleMode)
    -{
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    // next time to create a frame buffer and texture
    -
    -    /**
    -     * @property frameBuffer
    -     * @type Any
    -     */
    -    this.frameBuffer = gl.createFramebuffer();
    -
    -    /**
    -     * @property texture
    -     * @type Any
    -     */
    -    this.texture = gl.createTexture();
    -
    -    /**
    -     * @property scaleMode
    -     * @type Number
    -     */
    -    scaleMode = scaleMode || PIXI.scaleModes.DEFAULT;
    -
    -    gl.bindTexture(gl.TEXTURE_2D,  this.texture);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer );
    -
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer );
    -    gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0);
    -
    -    // required for masking a mask??
    -    this.renderBuffer = gl.createRenderbuffer();
    -    gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer);
    -    gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.renderBuffer);
    -  
    -    this.resize(width, height);
    -};
    -
    -PIXI.FilterTexture.prototype.constructor = PIXI.FilterTexture;
    -
    -/**
    -* Clears the filter texture.
    -* 
    -* @method clear
    -*/
    -PIXI.FilterTexture.prototype.clear = function()
    -{
    -    var gl = this.gl;
    -    
    -    gl.clearColor(0,0,0, 0);
    -    gl.clear(gl.COLOR_BUFFER_BIT);
    -};
    -
    -/**
    - * Resizes the texture to the specified width and height
    - *
    - * @method resize
    - * @param width {Number} the new width of the texture
    - * @param height {Number} the new height of the texture
    - */
    -PIXI.FilterTexture.prototype.resize = function(width, height)
    -{
    -    if(this.width === width && this.height === height) return;
    -
    -    this.width = width;
    -    this.height = height;
    -
    -    var gl = this.gl;
    -
    -    gl.bindTexture(gl.TEXTURE_2D,  this.texture);
    -    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA,  width , height , 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
    -    // update the stencil buffer width and height
    -    gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer);
    -    gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width , height );
    -};
    -
    -/**
    -* Destroys the filter texture.
    -* 
    -* @method destroy
    -*/
    -PIXI.FilterTexture.prototype.destroy = function()
    -{
    -    var gl = this.gl;
    -    gl.deleteFramebuffer( this.frameBuffer );
    -    gl.deleteTexture( this.texture );
    -
    -    this.frameBuffer = null;
    -    this.texture = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLBlendModeManager.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLBlendModeManager.js.html deleted file mode 100755 index f2bd028..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLBlendModeManager.js.html +++ /dev/null @@ -1,336 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class WebGLBlendModeManager
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLBlendModeManager = function()
    -{
    -    /**
    -     * @property currentBlendMode
    -     * @type Number
    -     */
    -    this.currentBlendMode = 99999;
    -};
    -
    -PIXI.WebGLBlendModeManager.prototype.constructor = PIXI.WebGLBlendModeManager;
    -
    -/**
    - * Sets the WebGL Context.
    - *
    - * @method setContext
    - * @param gl {WebGLContext} the current WebGL drawing context
    - */
    -PIXI.WebGLBlendModeManager.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -};
    -
    -/**
    -* Sets-up the given blendMode from WebGL's point of view.
    -* 
    -* @method setBlendMode 
    -* @param blendMode {Number} the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD
    -*/
    -PIXI.WebGLBlendModeManager.prototype.setBlendMode = function(blendMode)
    -{
    -    if(this.currentBlendMode === blendMode)return false;
    -
    -    this.currentBlendMode = blendMode;
    -    
    -    var blendModeWebGL = PIXI.blendModesWebGL[this.currentBlendMode];
    -    this.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]);
    -    
    -    return true;
    -};
    -
    -/**
    -* Destroys this object.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLBlendModeManager.prototype.destroy = function()
    -{
    -    this.gl = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFastSpriteBatch.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFastSpriteBatch.js.html deleted file mode 100755 index 4a22a54..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFastSpriteBatch.js.html +++ /dev/null @@ -1,706 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js

    - -
    -
    -/**
    - * @author Mat Groves
    - * 
    - * Big thanks to the very clever Matt DesLauriers <mattdesl> https://github.com/mattdesl/
    - * for creating the original pixi version!
    - *
    - * Heavily inspired by LibGDX's WebGLSpriteBatch:
    - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java
    - */
    -
    -/**
    -* @class WebGLFastSpriteBatch
    -* @constructor
    -*/
    -PIXI.WebGLFastSpriteBatch = function(gl)
    -{
    -    /**
    -     * @property vertSize
    -     * @type Number
    -     */
    -    this.vertSize = 10;
    -
    -    /**
    -     * @property maxSize
    -     * @type Number
    -     */
    -    this.maxSize = 6000;//Math.pow(2, 16) /  this.vertSize;
    -
    -    /**
    -     * @property size
    -     * @type Number
    -     */
    -    this.size = this.maxSize;
    -
    -    //the total number of floats in our batch
    -    var numVerts = this.size * 4 *  this.vertSize;
    -
    -    //the total number of indices in our batch
    -    var numIndices = this.maxSize * 6;
    -
    -    /**
    -     * Vertex data
    -     * @property vertices
    -     * @type Float32Array
    -     */
    -    this.vertices = new PIXI.Float32Array(numVerts);
    -
    -    /**
    -     * Index data
    -     * @property indices
    -     * @type Uint16Array
    -     */
    -    this.indices = new PIXI.Uint16Array(numIndices);
    -    
    -    /**
    -     * @property vertexBuffer
    -     * @type Object
    -     */
    -    this.vertexBuffer = null;
    -
    -    /**
    -     * @property indexBuffer
    -     * @type Object
    -     */
    -    this.indexBuffer = null;
    -
    -    /**
    -     * @property lastIndexCount
    -     * @type Number
    -     */
    -    this.lastIndexCount = 0;
    -
    -    for (var i=0, j=0; i < numIndices; i += 6, j += 4)
    -    {
    -        this.indices[i + 0] = j + 0;
    -        this.indices[i + 1] = j + 1;
    -        this.indices[i + 2] = j + 2;
    -        this.indices[i + 3] = j + 0;
    -        this.indices[i + 4] = j + 2;
    -        this.indices[i + 5] = j + 3;
    -    }
    -
    -    /**
    -     * @property drawing
    -     * @type Boolean
    -     */
    -    this.drawing = false;
    -
    -    /**
    -     * @property currentBatchSize
    -     * @type Number
    -     */
    -    this.currentBatchSize = 0;
    -
    -    /**
    -     * @property currentBaseTexture
    -     * @type BaseTexture
    -     */
    -    this.currentBaseTexture = null;
    -   
    -    /**
    -     * @property currentBlendMode
    -     * @type Number
    -     */
    -    this.currentBlendMode = 0;
    -
    -    /**
    -     * @property renderSession
    -     * @type Object
    -     */
    -    this.renderSession = null;
    -    
    -    /**
    -     * @property shader
    -     * @type Object
    -     */
    -    this.shader = null;
    -
    -    /**
    -     * @property matrix
    -     * @type Matrix
    -     */
    -    this.matrix = null;
    -
    -    this.setContext(gl);
    -};
    -
    -PIXI.WebGLFastSpriteBatch.prototype.constructor = PIXI.WebGLFastSpriteBatch;
    -
    -/**
    - * Sets the WebGL Context.
    - *
    - * @method setContext
    - * @param gl {WebGLContext} the current WebGL drawing context
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -
    -    // create a couple of buffers
    -    this.vertexBuffer = gl.createBuffer();
    -    this.indexBuffer = gl.createBuffer();
    -
    -    // 65535 is max index, so 65535 / 6 = 10922.
    -
    -    //upload the index data
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW);
    -};
    -
    -/**
    - * @method begin
    - * @param spriteBatch {WebGLSpriteBatch}
    - * @param renderSession {Object}
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.begin = function(spriteBatch, renderSession)
    -{
    -    this.renderSession = renderSession;
    -    this.shader = this.renderSession.shaderManager.fastShader;
    -
    -    this.matrix = spriteBatch.worldTransform.toArray(true);
    -
    -    this.start();
    -};
    -
    -/**
    - * @method end
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.end = function()
    -{
    -    this.flush();
    -};
    -
    -/**
    - * @method render
    - * @param spriteBatch {WebGLSpriteBatch}
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.render = function(spriteBatch)
    -{
    -    var children = spriteBatch.children;
    -    var sprite = children[0];
    -
    -    // if the uvs have not updated then no point rendering just yet!
    -    
    -    // check texture.
    -    if(!sprite.texture._uvs)return;
    -   
    -    this.currentBaseTexture = sprite.texture.baseTexture;
    -    
    -    // check blend mode
    -    if(sprite.blendMode !== this.renderSession.blendModeManager.currentBlendMode)
    -    {
    -        this.flush();
    -        this.renderSession.blendModeManager.setBlendMode(sprite.blendMode);
    -    }
    -    
    -    for(var i=0,j= children.length; i<j; i++)
    -    {
    -        this.renderSprite(children[i]);
    -    }
    -
    -    this.flush();
    -};
    -
    -/**
    - * @method renderSprite
    - * @param sprite {Sprite}
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.renderSprite = function(sprite)
    -{
    -    //sprite = children[i];
    -    if(!sprite.visible)return;
    -    
    -    // TODO trim??
    -    if(sprite.texture.baseTexture !== this.currentBaseTexture)
    -    {
    -        this.flush();
    -        this.currentBaseTexture = sprite.texture.baseTexture;
    -        
    -        if(!sprite.texture._uvs)return;
    -    }
    -
    -    var uvs, verticies = this.vertices, width, height, w0, w1, h0, h1, index;
    -
    -    uvs = sprite.texture._uvs;
    -
    -    width = sprite.texture.frame.width;
    -    height = sprite.texture.frame.height;
    -
    -    if (sprite.texture.trim)
    -    {
    -        // if the sprite is trimmed then we need to add the extra space before transforming the sprite coords..
    -        var trim = sprite.texture.trim;
    -
    -        w1 = trim.x - sprite.anchor.x * trim.width;
    -        w0 = w1 + sprite.texture.crop.width;
    -
    -        h1 = trim.y - sprite.anchor.y * trim.height;
    -        h0 = h1 + sprite.texture.crop.height;
    -    }
    -    else
    -    {
    -        w0 = (sprite.texture.frame.width ) * (1-sprite.anchor.x);
    -        w1 = (sprite.texture.frame.width ) * -sprite.anchor.x;
    -
    -        h0 = sprite.texture.frame.height * (1-sprite.anchor.y);
    -        h1 = sprite.texture.frame.height * -sprite.anchor.y;
    -    }
    -
    -    index = this.currentBatchSize * 4 * this.vertSize;
    -
    -    // xy
    -    verticies[index++] = w1;
    -    verticies[index++] = h1;
    -
    -    verticies[index++] = sprite.position.x;
    -    verticies[index++] = sprite.position.y;
    -
    -    //scale
    -    verticies[index++] = sprite.scale.x;
    -    verticies[index++] = sprite.scale.y;
    -
    -    //rotation
    -    verticies[index++] = sprite.rotation;
    -
    -    // uv
    -    verticies[index++] = uvs.x0;
    -    verticies[index++] = uvs.y1;
    -    // color
    -    verticies[index++] = sprite.alpha;
    - 
    -
    -    // xy
    -    verticies[index++] = w0;
    -    verticies[index++] = h1;
    -
    -    verticies[index++] = sprite.position.x;
    -    verticies[index++] = sprite.position.y;
    -
    -    //scale
    -    verticies[index++] = sprite.scale.x;
    -    verticies[index++] = sprite.scale.y;
    -
    -     //rotation
    -    verticies[index++] = sprite.rotation;
    -
    -    // uv
    -    verticies[index++] = uvs.x1;
    -    verticies[index++] = uvs.y1;
    -    // color
    -    verticies[index++] = sprite.alpha;
    -  
    -
    -    // xy
    -    verticies[index++] = w0;
    -    verticies[index++] = h0;
    -
    -    verticies[index++] = sprite.position.x;
    -    verticies[index++] = sprite.position.y;
    -
    -    //scale
    -    verticies[index++] = sprite.scale.x;
    -    verticies[index++] = sprite.scale.y;
    -
    -     //rotation
    -    verticies[index++] = sprite.rotation;
    -
    -    // uv
    -    verticies[index++] = uvs.x2;
    -    verticies[index++] = uvs.y2;
    -    // color
    -    verticies[index++] = sprite.alpha;
    - 
    -
    -
    -
    -    // xy
    -    verticies[index++] = w1;
    -    verticies[index++] = h0;
    -
    -    verticies[index++] = sprite.position.x;
    -    verticies[index++] = sprite.position.y;
    -
    -    //scale
    -    verticies[index++] = sprite.scale.x;
    -    verticies[index++] = sprite.scale.y;
    -
    -     //rotation
    -    verticies[index++] = sprite.rotation;
    -
    -    // uv
    -    verticies[index++] = uvs.x3;
    -    verticies[index++] = uvs.y3;
    -    // color
    -    verticies[index++] = sprite.alpha;
    -
    -    // increment the batchs
    -    this.currentBatchSize++;
    -
    -    if(this.currentBatchSize >= this.size)
    -    {
    -        this.flush();
    -    }
    -};
    -
    -/**
    - * @method flush
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.flush = function()
    -{
    -    // If the batch is length 0 then return as there is nothing to draw
    -    if (this.currentBatchSize===0)return;
    -
    -    var gl = this.gl;
    -    
    -    // bind the current texture
    -
    -    if(!this.currentBaseTexture._glTextures[gl.id])this.renderSession.renderer.updateTexture(this.currentBaseTexture, gl);
    -
    -    gl.bindTexture(gl.TEXTURE_2D, this.currentBaseTexture._glTextures[gl.id]);
    -
    -    // upload the verts to the buffer
    -   
    -    if(this.currentBatchSize > ( this.size * 0.5 ) )
    -    {
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices);
    -    }
    -    else
    -    {
    -        var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize);
    -
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, view);
    -    }
    -    
    -    // now draw those suckas!
    -    gl.drawElements(gl.TRIANGLES, this.currentBatchSize * 6, gl.UNSIGNED_SHORT, 0);
    -   
    -    // then reset the batch!
    -    this.currentBatchSize = 0;
    -
    -    // increment the draw count
    -    this.renderSession.drawCount++;
    -};
    -
    -
    -/**
    - * @method stop
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.stop = function()
    -{
    -    this.flush();
    -};
    -
    -/**
    - * @method start
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.start = function()
    -{
    -    var gl = this.gl;
    -
    -    // bind the main texture
    -    gl.activeTexture(gl.TEXTURE0);
    -
    -    // bind the buffers
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -
    -    // set the projection
    -    var projection = this.renderSession.projection;
    -    gl.uniform2f(this.shader.projectionVector, projection.x, projection.y);
    -
    -    // set the matrix
    -    gl.uniformMatrix3fv(this.shader.uMatrix, false, this.matrix);
    -
    -    // set the pointers
    -    var stride =  this.vertSize * 4;
    -
    -    gl.vertexAttribPointer(this.shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0);
    -    gl.vertexAttribPointer(this.shader.aPositionCoord, 2, gl.FLOAT, false, stride, 2 * 4);
    -    gl.vertexAttribPointer(this.shader.aScale, 2, gl.FLOAT, false, stride, 4 * 4);
    -    gl.vertexAttribPointer(this.shader.aRotation, 1, gl.FLOAT, false, stride, 6 * 4);
    -    gl.vertexAttribPointer(this.shader.aTextureCoord, 2, gl.FLOAT, false, stride, 7 * 4);
    -    gl.vertexAttribPointer(this.shader.colorAttribute, 1, gl.FLOAT, false, stride, 9 * 4);
    -    
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFilterManager.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFilterManager.js.html deleted file mode 100755 index 389585a..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFilterManager.js.html +++ /dev/null @@ -1,728 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLFilterManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class WebGLFilterManager
    -* @constructor
    -*/
    -PIXI.WebGLFilterManager = function()
    -{
    -    /**
    -     * @property filterStack
    -     * @type Array
    -     */
    -    this.filterStack = [];
    -    
    -    /**
    -     * @property offsetX
    -     * @type Number
    -     */
    -    this.offsetX = 0;
    -
    -    /**
    -     * @property offsetY
    -     * @type Number
    -     */
    -    this.offsetY = 0;
    -};
    -
    -PIXI.WebGLFilterManager.prototype.constructor = PIXI.WebGLFilterManager;
    -
    -/**
    -* Initialises the context and the properties.
    -* 
    -* @method setContext 
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLFilterManager.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -    this.texturePool = [];
    -
    -    this.initShaderBuffers();
    -};
    -
    -/**
    -* @method begin
    -* @param renderSession {RenderSession} 
    -* @param buffer {ArrayBuffer} 
    -*/
    -PIXI.WebGLFilterManager.prototype.begin = function(renderSession, buffer)
    -{
    -    this.renderSession = renderSession;
    -    this.defaultShader = renderSession.shaderManager.defaultShader;
    -
    -    var projection = this.renderSession.projection;
    -    this.width = projection.x * 2;
    -    this.height = -projection.y * 2;
    -    this.buffer = buffer;
    -};
    -
    -/**
    -* Applies the filter and adds it to the current filter stack.
    -* 
    -* @method pushFilter
    -* @param filterBlock {Object} the filter that will be pushed to the current filter stack
    -*/
    -PIXI.WebGLFilterManager.prototype.pushFilter = function(filterBlock)
    -{
    -    var gl = this.gl;
    -
    -    var projection = this.renderSession.projection;
    -    var offset = this.renderSession.offset;
    -
    -    filterBlock._filterArea = filterBlock.target.filterArea || filterBlock.target.getBounds();
    -
    -    // filter program
    -    // OPTIMISATION - the first filter is free if its a simple color change?
    -    this.filterStack.push(filterBlock);
    -
    -    var filter = filterBlock.filterPasses[0];
    -
    -    this.offsetX += filterBlock._filterArea.x;
    -    this.offsetY += filterBlock._filterArea.y;
    -
    -    var texture = this.texturePool.pop();
    -    if(!texture)
    -    {
    -        texture = new PIXI.FilterTexture(this.gl, this.width, this.height);
    -    }
    -    else
    -    {
    -        texture.resize(this.width, this.height);
    -    }
    -
    -    gl.bindTexture(gl.TEXTURE_2D,  texture.texture);
    -
    -    var filterArea = filterBlock._filterArea;// filterBlock.target.getBounds();///filterBlock.target.filterArea;
    -
    -    var padding = filter.padding;
    -    filterArea.x -= padding;
    -    filterArea.y -= padding;
    -    filterArea.width += padding * 2;
    -    filterArea.height += padding * 2;
    -
    -    // cap filter to screen size..
    -    if(filterArea.x < 0)filterArea.x = 0;
    -    if(filterArea.width > this.width)filterArea.width = this.width;
    -    if(filterArea.y < 0)filterArea.y = 0;
    -    if(filterArea.height > this.height)filterArea.height = this.height;
    -
    -    //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA,  filterArea.width, filterArea.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, texture.frameBuffer);
    -
    -    // set view port
    -    gl.viewport(0, 0, filterArea.width, filterArea.height);
    -
    -    projection.x = filterArea.width/2;
    -    projection.y = -filterArea.height/2;
    -
    -    offset.x = -filterArea.x;
    -    offset.y = -filterArea.y;
    -
    -    // update projection
    -    // now restore the regular shader..
    -    // this.renderSession.shaderManager.setShader(this.defaultShader);
    -    //gl.uniform2f(this.defaultShader.projectionVector, filterArea.width/2, -filterArea.height/2);
    -    //gl.uniform2f(this.defaultShader.offsetVector, -filterArea.x, -filterArea.y);
    -
    -    gl.colorMask(true, true, true, true);
    -    gl.clearColor(0,0,0, 0);
    -    gl.clear(gl.COLOR_BUFFER_BIT);
    -
    -    filterBlock._glFilterTexture = texture;
    -
    -};
    -
    -/**
    -* Removes the last filter from the filter stack and doesn't return it.
    -* 
    -* @method popFilter
    -*/
    -PIXI.WebGLFilterManager.prototype.popFilter = function()
    -{
    -    var gl = this.gl;
    -    var filterBlock = this.filterStack.pop();
    -    var filterArea = filterBlock._filterArea;
    -    var texture = filterBlock._glFilterTexture;
    -    var projection = this.renderSession.projection;
    -    var offset = this.renderSession.offset;
    -
    -    if(filterBlock.filterPasses.length > 1)
    -    {
    -        gl.viewport(0, 0, filterArea.width, filterArea.height);
    -
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -
    -        this.vertexArray[0] = 0;
    -        this.vertexArray[1] = filterArea.height;
    -
    -        this.vertexArray[2] = filterArea.width;
    -        this.vertexArray[3] = filterArea.height;
    -
    -        this.vertexArray[4] = 0;
    -        this.vertexArray[5] = 0;
    -
    -        this.vertexArray[6] = filterArea.width;
    -        this.vertexArray[7] = 0;
    -
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray);
    -
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    -        // now set the uvs..
    -        this.uvArray[2] = filterArea.width/this.width;
    -        this.uvArray[5] = filterArea.height/this.height;
    -        this.uvArray[6] = filterArea.width/this.width;
    -        this.uvArray[7] = filterArea.height/this.height;
    -
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray);
    -
    -        var inputTexture = texture;
    -        var outputTexture = this.texturePool.pop();
    -        if(!outputTexture)outputTexture = new PIXI.FilterTexture(this.gl, this.width, this.height);
    -        outputTexture.resize(this.width, this.height);
    -
    -        // need to clear this FBO as it may have some left over elements from a previous filter.
    -        gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer );
    -        gl.clear(gl.COLOR_BUFFER_BIT);
    -
    -        gl.disable(gl.BLEND);
    -
    -        for (var i = 0; i < filterBlock.filterPasses.length-1; i++)
    -        {
    -            var filterPass = filterBlock.filterPasses[i];
    -
    -            gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer );
    -
    -            // set texture
    -            gl.activeTexture(gl.TEXTURE0);
    -            gl.bindTexture(gl.TEXTURE_2D, inputTexture.texture);
    -
    -            // draw texture..
    -            //filterPass.applyFilterPass(filterArea.width, filterArea.height);
    -            this.applyFilterPass(filterPass, filterArea, filterArea.width, filterArea.height);
    -
    -            // swap the textures..
    -            var temp = inputTexture;
    -            inputTexture = outputTexture;
    -            outputTexture = temp;
    -        }
    -
    -        gl.enable(gl.BLEND);
    -
    -        texture = inputTexture;
    -        this.texturePool.push(outputTexture);
    -    }
    -
    -    var filter = filterBlock.filterPasses[filterBlock.filterPasses.length-1];
    -
    -    this.offsetX -= filterArea.x;
    -    this.offsetY -= filterArea.y;
    -
    -    var sizeX = this.width;
    -    var sizeY = this.height;
    -
    -    var offsetX = 0;
    -    var offsetY = 0;
    -
    -    var buffer = this.buffer;
    -
    -    // time to render the filters texture to the previous scene
    -    if(this.filterStack.length === 0)
    -    {
    -        gl.colorMask(true, true, true, true);//this.transparent);
    -    }
    -    else
    -    {
    -        var currentFilter = this.filterStack[this.filterStack.length-1];
    -        filterArea = currentFilter._filterArea;
    -
    -        sizeX = filterArea.width;
    -        sizeY = filterArea.height;
    -
    -        offsetX = filterArea.x;
    -        offsetY = filterArea.y;
    -
    -        buffer =  currentFilter._glFilterTexture.frameBuffer;
    -    }
    -
    -    // TODO need to remove these global elements..
    -    projection.x = sizeX/2;
    -    projection.y = -sizeY/2;
    -
    -    offset.x = offsetX;
    -    offset.y = offsetY;
    -
    -    filterArea = filterBlock._filterArea;
    -
    -    var x = filterArea.x-offsetX;
    -    var y = filterArea.y-offsetY;
    -
    -    // update the buffers..
    -    // make sure to flip the y!
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -
    -    this.vertexArray[0] = x;
    -    this.vertexArray[1] = y + filterArea.height;
    -
    -    this.vertexArray[2] = x + filterArea.width;
    -    this.vertexArray[3] = y + filterArea.height;
    -
    -    this.vertexArray[4] = x;
    -    this.vertexArray[5] = y;
    -
    -    this.vertexArray[6] = x + filterArea.width;
    -    this.vertexArray[7] = y;
    -
    -    gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    -
    -    this.uvArray[2] = filterArea.width/this.width;
    -    this.uvArray[5] = filterArea.height/this.height;
    -    this.uvArray[6] = filterArea.width/this.width;
    -    this.uvArray[7] = filterArea.height/this.height;
    -
    -    gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray);
    -
    -    gl.viewport(0, 0, sizeX, sizeY);
    -
    -    // bind the buffer
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, buffer );
    -
    -    // set the blend mode! 
    -    //gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA)
    -
    -    // set texture
    -    gl.activeTexture(gl.TEXTURE0);
    -    gl.bindTexture(gl.TEXTURE_2D, texture.texture);
    -
    -    // apply!
    -    this.applyFilterPass(filter, filterArea, sizeX, sizeY);
    -
    -    // now restore the regular shader.. should happen automatically now..
    -    // this.renderSession.shaderManager.setShader(this.defaultShader);
    -    // gl.uniform2f(this.defaultShader.projectionVector, sizeX/2, -sizeY/2);
    -    // gl.uniform2f(this.defaultShader.offsetVector, -offsetX, -offsetY);
    -
    -    // return the texture to the pool
    -    this.texturePool.push(texture);
    -    filterBlock._glFilterTexture = null;
    -};
    -
    -
    -/**
    -* Applies the filter to the specified area.
    -* 
    -* @method applyFilterPass
    -* @param filter {AbstractFilter} the filter that needs to be applied
    -* @param filterArea {Texture} TODO - might need an update
    -* @param width {Number} the horizontal range of the filter
    -* @param height {Number} the vertical range of the filter
    -*/
    -PIXI.WebGLFilterManager.prototype.applyFilterPass = function(filter, filterArea, width, height)
    -{
    -    // use program
    -    var gl = this.gl;
    -    var shader = filter.shaders[gl.id];
    -
    -    if(!shader)
    -    {
    -        shader = new PIXI.PixiShader(gl);
    -
    -        shader.fragmentSrc = filter.fragmentSrc;
    -        shader.uniforms = filter.uniforms;
    -        shader.init();
    -
    -        filter.shaders[gl.id] = shader;
    -    }
    -
    -    // set the shader
    -    this.renderSession.shaderManager.setShader(shader);
    -
    -//    gl.useProgram(shader.program);
    -
    -    gl.uniform2f(shader.projectionVector, width/2, -height/2);
    -    gl.uniform2f(shader.offsetVector, 0,0);
    -
    -    if(filter.uniforms.dimensions)
    -    {
    -        filter.uniforms.dimensions.value[0] = this.width;//width;
    -        filter.uniforms.dimensions.value[1] = this.height;//height;
    -        filter.uniforms.dimensions.value[2] = this.vertexArray[0];
    -        filter.uniforms.dimensions.value[3] = this.vertexArray[5];//filterArea.height;
    -    }
    -
    -    shader.syncUniforms();
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -    gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    -    gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    -    gl.vertexAttribPointer(shader.colorAttribute, 2, gl.FLOAT, false, 0, 0);
    -
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -
    -    // draw the filter...
    -    gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 );
    -
    -    this.renderSession.drawCount++;
    -};
    -
    -/**
    -* Initialises the shader buffers.
    -* 
    -* @method initShaderBuffers
    -*/
    -PIXI.WebGLFilterManager.prototype.initShaderBuffers = function()
    -{
    -    var gl = this.gl;
    -
    -    // create some buffers
    -    this.vertexBuffer = gl.createBuffer();
    -    this.uvBuffer = gl.createBuffer();
    -    this.colorBuffer = gl.createBuffer();
    -    this.indexBuffer = gl.createBuffer();
    -
    -    // bind and upload the vertexs..
    -    // keep a reference to the vertexFloatData..
    -    this.vertexArray = new PIXI.Float32Array([0.0, 0.0,
    -                                         1.0, 0.0,
    -                                         0.0, 1.0,
    -                                         1.0, 1.0]);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.vertexArray, gl.STATIC_DRAW);
    -
    -    // bind and upload the uv buffer
    -    this.uvArray = new PIXI.Float32Array([0.0, 0.0,
    -                                     1.0, 0.0,
    -                                     0.0, 1.0,
    -                                     1.0, 1.0]);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.uvArray, gl.STATIC_DRAW);
    -
    -    this.colorArray = new PIXI.Float32Array([1.0, 0xFFFFFF,
    -                                        1.0, 0xFFFFFF,
    -                                        1.0, 0xFFFFFF,
    -                                        1.0, 0xFFFFFF]);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.colorArray, gl.STATIC_DRAW);
    -
    -    // bind and upload the index
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 1, 3, 2]), gl.STATIC_DRAW);
    -
    -};
    -
    -/**
    -* Destroys the filter and removes it from the filter stack.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLFilterManager.prototype.destroy = function()
    -{
    -    var gl = this.gl;
    -
    -    this.filterStack = null;
    -    
    -    this.offsetX = 0;
    -    this.offsetY = 0;
    -
    -    // destroy textures
    -    for (var i = 0; i < this.texturePool.length; i++) {
    -        this.texturePool[i].destroy();
    -    }
    -    
    -    this.texturePool = null;
    -
    -    //destroy buffers..
    -    gl.deleteBuffer(this.vertexBuffer);
    -    gl.deleteBuffer(this.uvBuffer);
    -    gl.deleteBuffer(this.colorBuffer);
    -    gl.deleteBuffer(this.indexBuffer);
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLGraphics.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLGraphics.js.html deleted file mode 100755 index 121a416..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLGraphics.js.html +++ /dev/null @@ -1,1157 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLGraphics.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A set of functions used by the webGL renderer to draw the primitive graphics data
    - *
    - * @class WebGLGraphics
    - * @private
    - * @static
    - */
    -PIXI.WebGLGraphics = function()
    -{
    -};
    -
    -/**
    - * Renders the graphics object
    - *
    - * @static
    - * @private
    - * @method renderGraphics
    - * @param graphics {Graphics}
    - * @param renderSession {Object}
    - */
    -PIXI.WebGLGraphics.renderGraphics = function(graphics, renderSession)//projection, offset)
    -{
    -    var gl = renderSession.gl;
    -    var projection = renderSession.projection,
    -        offset = renderSession.offset,
    -        shader = renderSession.shaderManager.primitiveShader,
    -        webGLData;
    -
    -    if(graphics.dirty)
    -    {
    -        PIXI.WebGLGraphics.updateGraphics(graphics, gl);
    -    }
    -
    -    var webGL = graphics._webGL[gl.id];
    -
    -    // This  could be speeded up for sure!
    -
    -    for (var i = 0; i < webGL.data.length; i++)
    -    {
    -        if(webGL.data[i].mode === 1)
    -        {
    -            webGLData = webGL.data[i];
    -
    -            renderSession.stencilManager.pushStencil(graphics, webGLData, renderSession);
    -
    -            // render quad..
    -            gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 );
    -            
    -            renderSession.stencilManager.popStencil(graphics, webGLData, renderSession);
    -        }
    -        else
    -        {
    -            webGLData = webGL.data[i];
    -           
    -
    -            renderSession.shaderManager.setShader( shader );//activatePrimitiveShader();
    -            shader = renderSession.shaderManager.primitiveShader;
    -            gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true));
    -
    -            gl.uniform2f(shader.projectionVector, projection.x, -projection.y);
    -            gl.uniform2f(shader.offsetVector, -offset.x, -offset.y);
    -
    -            gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint));
    -
    -            gl.uniform1f(shader.alpha, graphics.worldAlpha);
    -            
    -
    -            gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer);
    -
    -            gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0);
    -            gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4);
    -
    -            // set the index buffer!
    -            gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer);
    -            gl.drawElements(gl.TRIANGLE_STRIP,  webGLData.indices.length, gl.UNSIGNED_SHORT, 0 );
    -        }
    -    }
    -};
    -
    -/**
    - * Updates the graphics object
    - *
    - * @static
    - * @private
    - * @method updateGraphics
    - * @param graphicsData {Graphics} The graphics object to update
    - * @param gl {WebGLContext} the current WebGL drawing context
    - */
    -PIXI.WebGLGraphics.updateGraphics = function(graphics, gl)
    -{
    -    // get the contexts graphics object
    -    var webGL = graphics._webGL[gl.id];
    -    // if the graphics object does not exist in the webGL context time to create it!
    -    if(!webGL)webGL = graphics._webGL[gl.id] = {lastIndex:0, data:[], gl:gl};
    -
    -    // flag the graphics as not dirty as we are about to update it...
    -    graphics.dirty = false;
    -
    -    var i;
    -
    -    // if the user cleared the graphics object we will need to clear every object
    -    if(graphics.clearDirty)
    -    {
    -        graphics.clearDirty = false;
    -
    -        // lop through and return all the webGLDatas to the object pool so than can be reused later on
    -        for (i = 0; i < webGL.data.length; i++)
    -        {
    -            var graphicsData = webGL.data[i];
    -            graphicsData.reset();
    -            PIXI.WebGLGraphics.graphicsDataPool.push( graphicsData );
    -        }
    -
    -        // clear the array and reset the index.. 
    -        webGL.data = [];
    -        webGL.lastIndex = 0;
    -    }
    -    
    -    var webGLData;
    -    
    -    // loop through the graphics datas and construct each one..
    -    // if the object is a complex fill then the new stencil buffer technique will be used
    -    // other wise graphics objects will be pushed into a batch..
    -    for (i = webGL.lastIndex; i < graphics.graphicsData.length; i++)
    -    {
    -        var data = graphics.graphicsData[i];
    -
    -        if(data.type === PIXI.Graphics.POLY)
    -        {
    -            // need to add the points the the graphics object..
    -            data.points = data.shape.points.slice();
    -            if(data.shape.closed)
    -            {
    -                // close the poly if the valu is true!
    -                if(data.points[0] !== data.points[data.points.length-2] && data.points[1] !== data.points[data.points.length-1])
    -                {
    -                    data.points.push(data.points[0], data.points[1]);
    -                }
    -            }
    -
    -            // MAKE SURE WE HAVE THE CORRECT TYPE..
    -            if(data.fill)
    -            {
    -                if(data.points.length >= 6)
    -                {
    -                    if(data.points.length > 5 * 2)
    -                    {
    -                        webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1);
    -                        PIXI.WebGLGraphics.buildComplexPoly(data, webGLData);
    -                    }
    -                    else
    -                    {
    -                        webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0);
    -                        PIXI.WebGLGraphics.buildPoly(data, webGLData);
    -                    }
    -                }
    -            }
    -
    -            if(data.lineWidth > 0)
    -            {
    -                webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0);
    -                PIXI.WebGLGraphics.buildLine(data, webGLData);
    -
    -            }
    -        }
    -        else
    -        {
    -            webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0);
    -            
    -            if(data.type === PIXI.Graphics.RECT)
    -            {
    -                PIXI.WebGLGraphics.buildRectangle(data, webGLData);
    -            }
    -            else if(data.type === PIXI.Graphics.CIRC || data.type === PIXI.Graphics.ELIP)
    -            {
    -                PIXI.WebGLGraphics.buildCircle(data, webGLData);
    -            }
    -            else if(data.type === PIXI.Graphics.RREC)
    -            {
    -                PIXI.WebGLGraphics.buildRoundedRectangle(data, webGLData);
    -            }
    -        }
    -
    -        webGL.lastIndex++;
    -    }
    -
    -    // upload all the dirty data...
    -    for (i = 0; i < webGL.data.length; i++)
    -    {
    -        webGLData = webGL.data[i];
    -        if(webGLData.dirty)webGLData.upload();
    -    }
    -};
    -
    -/**
    - * @static
    - * @private
    - * @method switchMode
    - * @param webGL {WebGLContext}
    - * @param type {Number}
    - */
    -PIXI.WebGLGraphics.switchMode = function(webGL, type)
    -{
    -    var webGLData;
    -
    -    if(!webGL.data.length)
    -    {
    -        webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl);
    -        webGLData.mode = type;
    -        webGL.data.push(webGLData);
    -    }
    -    else
    -    {
    -        webGLData = webGL.data[webGL.data.length-1];
    -
    -        if(webGLData.mode !== type || type === 1)
    -        {
    -            webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl);
    -            webGLData.mode = type;
    -            webGL.data.push(webGLData);
    -        }
    -    }
    -
    -    webGLData.dirty = true;
    -
    -    return webGLData;
    -};
    -
    -/**
    - * Builds a rectangle to draw
    - *
    - * @static
    - * @private
    - * @method buildRectangle
    - * @param graphicsData {Graphics} The graphics object containing all the necessary properties
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildRectangle = function(graphicsData, webGLData)
    -{
    -    // --- //
    -    // need to convert points to a nice regular data
    -    //
    -    var rectData = graphicsData.shape;
    -    var x = rectData.x;
    -    var y = rectData.y;
    -    var width = rectData.width;
    -    var height = rectData.height;
    -
    -    if(graphicsData.fill)
    -    {
    -        var color = PIXI.hex2rgb(graphicsData.fillColor);
    -        var alpha = graphicsData.fillAlpha;
    -
    -        var r = color[0] * alpha;
    -        var g = color[1] * alpha;
    -        var b = color[2] * alpha;
    -
    -        var verts = webGLData.points;
    -        var indices = webGLData.indices;
    -
    -        var vertPos = verts.length/6;
    -
    -        // start
    -        verts.push(x, y);
    -        verts.push(r, g, b, alpha);
    -
    -        verts.push(x + width, y);
    -        verts.push(r, g, b, alpha);
    -
    -        verts.push(x , y + height);
    -        verts.push(r, g, b, alpha);
    -
    -        verts.push(x + width, y + height);
    -        verts.push(r, g, b, alpha);
    -
    -        // insert 2 dead triangles..
    -        indices.push(vertPos, vertPos, vertPos+1, vertPos+2, vertPos+3, vertPos+3);
    -    }
    -
    -    if(graphicsData.lineWidth)
    -    {
    -        var tempPoints = graphicsData.points;
    -
    -        graphicsData.points = [x, y,
    -                  x + width, y,
    -                  x + width, y + height,
    -                  x, y + height,
    -                  x, y];
    -
    -
    -        PIXI.WebGLGraphics.buildLine(graphicsData, webGLData);
    -
    -        graphicsData.points = tempPoints;
    -    }
    -};
    -
    -/**
    - * Builds a rounded rectangle to draw
    - *
    - * @static
    - * @private
    - * @method buildRoundedRectangle
    - * @param graphicsData {Graphics} The graphics object containing all the necessary properties
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildRoundedRectangle = function(graphicsData, webGLData)
    -{
    -    var rrectData = graphicsData.shape;
    -    var x = rrectData.x;
    -    var y = rrectData.y;
    -    var width = rrectData.width;
    -    var height = rrectData.height;
    -
    -    var radius = rrectData.radius;
    -
    -    var recPoints = [];
    -    recPoints.push(x, y + radius);
    -    recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x, y + height - radius, x, y + height, x + radius, y + height));
    -    recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius));
    -    recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width, y + radius, x + width, y, x + width - radius, y));
    -    recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + radius, y, x, y, x, y + radius));
    -
    -    if (graphicsData.fill) {
    -        var color = PIXI.hex2rgb(graphicsData.fillColor);
    -        var alpha = graphicsData.fillAlpha;
    -
    -        var r = color[0] * alpha;
    -        var g = color[1] * alpha;
    -        var b = color[2] * alpha;
    -
    -        var verts = webGLData.points;
    -        var indices = webGLData.indices;
    -
    -        var vecPos = verts.length/6;
    -
    -        var triangles = PIXI.PolyK.Triangulate(recPoints);
    -
    -        var i = 0;
    -        for (i = 0; i < triangles.length; i+=3)
    -        {
    -            indices.push(triangles[i] + vecPos);
    -            indices.push(triangles[i] + vecPos);
    -            indices.push(triangles[i+1] + vecPos);
    -            indices.push(triangles[i+2] + vecPos);
    -            indices.push(triangles[i+2] + vecPos);
    -        }
    -
    -        for (i = 0; i < recPoints.length; i++)
    -        {
    -            verts.push(recPoints[i], recPoints[++i], r, g, b, alpha);
    -        }
    -    }
    -
    -    if (graphicsData.lineWidth) {
    -        var tempPoints = graphicsData.points;
    -
    -        graphicsData.points = recPoints;
    -
    -        PIXI.WebGLGraphics.buildLine(graphicsData, webGLData);
    -
    -        graphicsData.points = tempPoints;
    -    }
    -};
    -
    -/**
    - * Calculate the points for a quadratic bezier curve. (helper function..)
    - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c
    - *
    - * @static
    - * @private
    - * @method quadraticBezierCurve
    - * @param fromX {Number} Origin point x
    - * @param fromY {Number} Origin point x
    - * @param cpX {Number} Control point x
    - * @param cpY {Number} Control point y
    - * @param toX {Number} Destination point x
    - * @param toY {Number} Destination point y
    - * @return {Array<Number>}
    - */
    -PIXI.WebGLGraphics.quadraticBezierCurve = function(fromX, fromY, cpX, cpY, toX, toY) {
    -
    -    var xa,
    -        ya,
    -        xb,
    -        yb,
    -        x,
    -        y,
    -        n = 20,
    -        points = [];
    -
    -    function getPt(n1 , n2, perc) {
    -        var diff = n2 - n1;
    -
    -        return n1 + ( diff * perc );
    -    }
    -
    -    var j = 0;
    -    for (var i = 0; i <= n; i++ )
    -    {
    -        j = i / n;
    -
    -        // The Green Line
    -        xa = getPt( fromX , cpX , j );
    -        ya = getPt( fromY , cpY , j );
    -        xb = getPt( cpX , toX , j );
    -        yb = getPt( cpY , toY , j );
    -
    -        // The Black Dot
    -        x = getPt( xa , xb , j );
    -        y = getPt( ya , yb , j );
    -
    -        points.push(x, y);
    -    }
    -    return points;
    -};
    -
    -/**
    - * Builds a circle to draw
    - *
    - * @static
    - * @private
    - * @method buildCircle
    - * @param graphicsData {Graphics} The graphics object to draw
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildCircle = function(graphicsData, webGLData)
    -{
    -    // need to convert points to a nice regular data
    -    var circleData = graphicsData.shape;
    -    var x = circleData.x;
    -    var y = circleData.y;
    -    var width;
    -    var height;
    -    
    -    // TODO - bit hacky??
    -    if(graphicsData.type === PIXI.Graphics.CIRC)
    -    {
    -        width = circleData.radius;
    -        height = circleData.radius;
    -    }
    -    else
    -    {
    -        width = circleData.width;
    -        height = circleData.height;
    -    }
    -
    -    var totalSegs = 40;
    -    var seg = (Math.PI * 2) / totalSegs ;
    -
    -    var i = 0;
    -
    -    if(graphicsData.fill)
    -    {
    -        var color = PIXI.hex2rgb(graphicsData.fillColor);
    -        var alpha = graphicsData.fillAlpha;
    -
    -        var r = color[0] * alpha;
    -        var g = color[1] * alpha;
    -        var b = color[2] * alpha;
    -
    -        var verts = webGLData.points;
    -        var indices = webGLData.indices;
    -
    -        var vecPos = verts.length/6;
    -
    -        indices.push(vecPos);
    -
    -        for (i = 0; i < totalSegs + 1 ; i++)
    -        {
    -            verts.push(x,y, r, g, b, alpha);
    -
    -            verts.push(x + Math.sin(seg * i) * width,
    -                       y + Math.cos(seg * i) * height,
    -                       r, g, b, alpha);
    -
    -            indices.push(vecPos++, vecPos++);
    -        }
    -
    -        indices.push(vecPos-1);
    -    }
    -
    -    if(graphicsData.lineWidth)
    -    {
    -        var tempPoints = graphicsData.points;
    -
    -        graphicsData.points = [];
    -
    -        for (i = 0; i < totalSegs + 1; i++)
    -        {
    -            graphicsData.points.push(x + Math.sin(seg * i) * width,
    -                                     y + Math.cos(seg * i) * height);
    -        }
    -
    -        PIXI.WebGLGraphics.buildLine(graphicsData, webGLData);
    -
    -        graphicsData.points = tempPoints;
    -    }
    -};
    -
    -/**
    - * Builds a line to draw
    - *
    - * @static
    - * @private
    - * @method buildLine
    - * @param graphicsData {Graphics} The graphics object containing all the necessary properties
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildLine = function(graphicsData, webGLData)
    -{
    -    // TODO OPTIMISE!
    -    var i = 0;
    -    var points = graphicsData.points;
    -    if(points.length === 0)return;
    -
    -    // if the line width is an odd number add 0.5 to align to a whole pixel
    -    if(graphicsData.lineWidth%2)
    -    {
    -        for (i = 0; i < points.length; i++) {
    -            points[i] += 0.5;
    -        }
    -    }
    -
    -    // get first and last point.. figure out the middle!
    -    var firstPoint = new PIXI.Point( points[0], points[1] );
    -    var lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] );
    -
    -    // if the first point is the last point - gonna have issues :)
    -    if(firstPoint.x === lastPoint.x && firstPoint.y === lastPoint.y)
    -    {
    -        // need to clone as we are going to slightly modify the shape..
    -        points = points.slice();
    -
    -        points.pop();
    -        points.pop();
    -
    -        lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] );
    -
    -        var midPointX = lastPoint.x + (firstPoint.x - lastPoint.x) *0.5;
    -        var midPointY = lastPoint.y + (firstPoint.y - lastPoint.y) *0.5;
    -
    -        points.unshift(midPointX, midPointY);
    -        points.push(midPointX, midPointY);
    -    }
    -
    -    var verts = webGLData.points;
    -    var indices = webGLData.indices;
    -    var length = points.length / 2;
    -    var indexCount = points.length;
    -    var indexStart = verts.length/6;
    -
    -    // DRAW the Line
    -    var width = graphicsData.lineWidth / 2;
    -
    -    // sort color
    -    var color = PIXI.hex2rgb(graphicsData.lineColor);
    -    var alpha = graphicsData.lineAlpha;
    -    var r = color[0] * alpha;
    -    var g = color[1] * alpha;
    -    var b = color[2] * alpha;
    -
    -    var px, py, p1x, p1y, p2x, p2y, p3x, p3y;
    -    var perpx, perpy, perp2x, perp2y, perp3x, perp3y;
    -    var a1, b1, c1, a2, b2, c2;
    -    var denom, pdist, dist;
    -
    -    p1x = points[0];
    -    p1y = points[1];
    -
    -    p2x = points[2];
    -    p2y = points[3];
    -
    -    perpx = -(p1y - p2y);
    -    perpy =  p1x - p2x;
    -
    -    dist = Math.sqrt(perpx*perpx + perpy*perpy);
    -
    -    perpx /= dist;
    -    perpy /= dist;
    -    perpx *= width;
    -    perpy *= width;
    -
    -    // start
    -    verts.push(p1x - perpx , p1y - perpy,
    -                r, g, b, alpha);
    -
    -    verts.push(p1x + perpx , p1y + perpy,
    -                r, g, b, alpha);
    -
    -    for (i = 1; i < length-1; i++)
    -    {
    -        p1x = points[(i-1)*2];
    -        p1y = points[(i-1)*2 + 1];
    -
    -        p2x = points[(i)*2];
    -        p2y = points[(i)*2 + 1];
    -
    -        p3x = points[(i+1)*2];
    -        p3y = points[(i+1)*2 + 1];
    -
    -        perpx = -(p1y - p2y);
    -        perpy = p1x - p2x;
    -
    -        dist = Math.sqrt(perpx*perpx + perpy*perpy);
    -        perpx /= dist;
    -        perpy /= dist;
    -        perpx *= width;
    -        perpy *= width;
    -
    -        perp2x = -(p2y - p3y);
    -        perp2y = p2x - p3x;
    -
    -        dist = Math.sqrt(perp2x*perp2x + perp2y*perp2y);
    -        perp2x /= dist;
    -        perp2y /= dist;
    -        perp2x *= width;
    -        perp2y *= width;
    -
    -        a1 = (-perpy + p1y) - (-perpy + p2y);
    -        b1 = (-perpx + p2x) - (-perpx + p1x);
    -        c1 = (-perpx + p1x) * (-perpy + p2y) - (-perpx + p2x) * (-perpy + p1y);
    -        a2 = (-perp2y + p3y) - (-perp2y + p2y);
    -        b2 = (-perp2x + p2x) - (-perp2x + p3x);
    -        c2 = (-perp2x + p3x) * (-perp2y + p2y) - (-perp2x + p2x) * (-perp2y + p3y);
    -
    -        denom = a1*b2 - a2*b1;
    -
    -        if(Math.abs(denom) < 0.1 )
    -        {
    -
    -            denom+=10.1;
    -            verts.push(p2x - perpx , p2y - perpy,
    -                r, g, b, alpha);
    -
    -            verts.push(p2x + perpx , p2y + perpy,
    -                r, g, b, alpha);
    -
    -            continue;
    -        }
    -
    -        px = (b1*c2 - b2*c1)/denom;
    -        py = (a2*c1 - a1*c2)/denom;
    -
    -
    -        pdist = (px -p2x) * (px -p2x) + (py -p2y) + (py -p2y);
    -
    -
    -        if(pdist > 140 * 140)
    -        {
    -            perp3x = perpx - perp2x;
    -            perp3y = perpy - perp2y;
    -
    -            dist = Math.sqrt(perp3x*perp3x + perp3y*perp3y);
    -            perp3x /= dist;
    -            perp3y /= dist;
    -            perp3x *= width;
    -            perp3y *= width;
    -
    -            verts.push(p2x - perp3x, p2y -perp3y);
    -            verts.push(r, g, b, alpha);
    -
    -            verts.push(p2x + perp3x, p2y +perp3y);
    -            verts.push(r, g, b, alpha);
    -
    -            verts.push(p2x - perp3x, p2y -perp3y);
    -            verts.push(r, g, b, alpha);
    -
    -            indexCount++;
    -        }
    -        else
    -        {
    -
    -            verts.push(px , py);
    -            verts.push(r, g, b, alpha);
    -
    -            verts.push(p2x - (px-p2x), p2y - (py - p2y));
    -            verts.push(r, g, b, alpha);
    -        }
    -    }
    -
    -    p1x = points[(length-2)*2];
    -    p1y = points[(length-2)*2 + 1];
    -
    -    p2x = points[(length-1)*2];
    -    p2y = points[(length-1)*2 + 1];
    -
    -    perpx = -(p1y - p2y);
    -    perpy = p1x - p2x;
    -
    -    dist = Math.sqrt(perpx*perpx + perpy*perpy);
    -    perpx /= dist;
    -    perpy /= dist;
    -    perpx *= width;
    -    perpy *= width;
    -
    -    verts.push(p2x - perpx , p2y - perpy);
    -    verts.push(r, g, b, alpha);
    -
    -    verts.push(p2x + perpx , p2y + perpy);
    -    verts.push(r, g, b, alpha);
    -
    -    indices.push(indexStart);
    -
    -    for (i = 0; i < indexCount; i++)
    -    {
    -        indices.push(indexStart++);
    -    }
    -
    -    indices.push(indexStart-1);
    -};
    -
    -/**
    - * Builds a complex polygon to draw
    - *
    - * @static
    - * @private
    - * @method buildComplexPoly
    - * @param graphicsData {Graphics} The graphics object containing all the necessary properties
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildComplexPoly = function(graphicsData, webGLData)
    -{
    -    //TODO - no need to copy this as it gets turned into a FLoat32Array anyways..
    -    var points = graphicsData.points.slice();
    -    if(points.length < 6)return;
    -
    -    // get first and last point.. figure out the middle!
    -    var indices = webGLData.indices;
    -    webGLData.points = points;
    -    webGLData.alpha = graphicsData.fillAlpha;
    -    webGLData.color = PIXI.hex2rgb(graphicsData.fillColor);
    -
    -    /*
    -        calclate the bounds..
    -    */
    -    var minX = Infinity;
    -    var maxX = -Infinity;
    -
    -    var minY = Infinity;
    -    var maxY = -Infinity;
    -
    -    var x,y;
    -
    -    // get size..
    -    for (var i = 0; i < points.length; i+=2)
    -    {
    -        x = points[i];
    -        y = points[i+1];
    -
    -        minX = x < minX ? x : minX;
    -        maxX = x > maxX ? x : maxX;
    -
    -        minY = y < minY ? y : minY;
    -        maxY = y > maxY ? y : maxY;
    -    }
    -
    -    // add a quad to the end cos there is no point making another buffer!
    -    points.push(minX, minY,
    -                maxX, minY,
    -                maxX, maxY,
    -                minX, maxY);
    -
    -    // push a quad onto the end.. 
    -    
    -    //TODO - this aint needed!
    -    var length = points.length / 2;
    -    for (i = 0; i < length; i++)
    -    {
    -        indices.push( i );
    -    }
    -
    -};
    -
    -/**
    - * Builds a polygon to draw
    - *
    - * @static
    - * @private
    - * @method buildPoly
    - * @param graphicsData {Graphics} The graphics object containing all the necessary properties
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildPoly = function(graphicsData, webGLData)
    -{
    -    var points = graphicsData.points;
    -
    -    if(points.length < 6)return;
    -    // get first and last point.. figure out the middle!
    -    var verts = webGLData.points;
    -    var indices = webGLData.indices;
    -
    -    var length = points.length / 2;
    -
    -    // sort color
    -    var color = PIXI.hex2rgb(graphicsData.fillColor);
    -    var alpha = graphicsData.fillAlpha;
    -    var r = color[0] * alpha;
    -    var g = color[1] * alpha;
    -    var b = color[2] * alpha;
    -
    -    var triangles = PIXI.PolyK.Triangulate(points);
    -    var vertPos = verts.length / 6;
    -
    -    var i = 0;
    -
    -    for (i = 0; i < triangles.length; i+=3)
    -    {
    -        indices.push(triangles[i] + vertPos);
    -        indices.push(triangles[i] + vertPos);
    -        indices.push(triangles[i+1] + vertPos);
    -        indices.push(triangles[i+2] +vertPos);
    -        indices.push(triangles[i+2] + vertPos);
    -    }
    -
    -    for (i = 0; i < length; i++)
    -    {
    -        verts.push(points[i * 2], points[i * 2 + 1],
    -                   r, g, b, alpha);
    -    }
    -
    -};
    -
    -PIXI.WebGLGraphics.graphicsDataPool = [];
    -
    -/**
    - * @class WebGLGraphicsData
    - * @private
    - * @static
    - */
    -PIXI.WebGLGraphicsData = function(gl)
    -{
    -    this.gl = gl;
    -
    -    //TODO does this need to be split before uploding??
    -    this.color = [0,0,0]; // color split!
    -    this.points = [];
    -    this.indices = [];
    -    this.lastIndex = 0;
    -    this.buffer = gl.createBuffer();
    -    this.indexBuffer = gl.createBuffer();
    -    this.mode = 1;
    -    this.alpha = 1;
    -    this.dirty = true;
    -};
    -
    -/**
    - * @method reset
    - */
    -PIXI.WebGLGraphicsData.prototype.reset = function()
    -{
    -    this.points = [];
    -    this.indices = [];
    -    this.lastIndex = 0;
    -};
    -
    -/**
    - * @method upload
    - */
    -PIXI.WebGLGraphicsData.prototype.upload = function()
    -{
    -    var gl = this.gl;
    -
    -//    this.lastIndex = graphics.graphicsData.length;
    -    this.glPoints = new PIXI.Float32Array(this.points);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.glPoints, gl.STATIC_DRAW);
    -
    -    this.glIndicies = new PIXI.Uint16Array(this.indices);
    -
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.glIndicies, gl.STATIC_DRAW);
    -
    -    this.dirty = false;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLMaskManager.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLMaskManager.js.html deleted file mode 100755 index 40c6e1f..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLMaskManager.js.html +++ /dev/null @@ -1,347 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLMaskManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class WebGLMaskManager
    -* @constructor
    -* @private
    -*/
    -PIXI.WebGLMaskManager = function()
    -{
    -};
    -
    -PIXI.WebGLMaskManager.prototype.constructor = PIXI.WebGLMaskManager;
    -
    -/**
    -* Sets the drawing context to the one given in parameter.
    -* 
    -* @method setContext 
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLMaskManager.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -};
    -
    -/**
    -* Applies the Mask and adds it to the current filter stack.
    -* 
    -* @method pushMask
    -* @param maskData {Array}
    -* @param renderSession {Object}
    -*/
    -PIXI.WebGLMaskManager.prototype.pushMask = function(maskData, renderSession)
    -{
    -    var gl = renderSession.gl;
    -
    -    if(maskData.dirty)
    -    {
    -        PIXI.WebGLGraphics.updateGraphics(maskData, gl);
    -    }
    -
    -    if(!maskData._webGL[gl.id].data.length)return;
    -
    -    renderSession.stencilManager.pushStencil(maskData, maskData._webGL[gl.id].data[0], renderSession);
    -};
    -
    -/**
    -* Removes the last filter from the filter stack and doesn't return it.
    -* 
    -* @method popMask
    -* @param maskData {Array}
    -* @param renderSession {Object} an object containing all the useful parameters
    -*/
    -PIXI.WebGLMaskManager.prototype.popMask = function(maskData, renderSession)
    -{
    -    var gl = this.gl;
    -    renderSession.stencilManager.popStencil(maskData, maskData._webGL[gl.id].data[0], renderSession);
    -};
    -
    -/**
    -* Destroys the mask stack.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLMaskManager.prototype.destroy = function()
    -{
    -    this.gl = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderManager.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderManager.js.html deleted file mode 100755 index 89f1c45..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderManager.js.html +++ /dev/null @@ -1,435 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLShaderManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class WebGLShaderManager
    -* @constructor
    -* @private
    -*/
    -PIXI.WebGLShaderManager = function()
    -{
    -    /**
    -     * @property maxAttibs
    -     * @type Number
    -     */
    -    this.maxAttibs = 10;
    -
    -    /**
    -     * @property attribState
    -     * @type Array
    -     */
    -    this.attribState = [];
    -
    -    /**
    -     * @property tempAttribState
    -     * @type Array
    -     */
    -    this.tempAttribState = [];
    -
    -    for (var i = 0; i < this.maxAttibs; i++)
    -    {
    -        this.attribState[i] = false;
    -    }
    -
    -    /**
    -     * @property stack
    -     * @type Array
    -     */
    -    this.stack = [];
    -
    -};
    -
    -PIXI.WebGLShaderManager.prototype.constructor = PIXI.WebGLShaderManager;
    -
    -/**
    -* Initialises the context and the properties.
    -* 
    -* @method setContext 
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLShaderManager.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -    
    -    // the next one is used for rendering primitives
    -    this.primitiveShader = new PIXI.PrimitiveShader(gl);
    -
    -    // the next one is used for rendering triangle strips
    -    this.complexPrimitiveShader = new PIXI.ComplexPrimitiveShader(gl);
    -
    -    // this shader is used for the default sprite rendering
    -    this.defaultShader = new PIXI.PixiShader(gl);
    -
    -    // this shader is used for the fast sprite rendering
    -    this.fastShader = new PIXI.PixiFastShader(gl);
    -
    -    // the next one is used for rendering triangle strips
    -    this.stripShader = new PIXI.StripShader(gl);
    -    this.setShader(this.defaultShader);
    -};
    -
    -/**
    -* Takes the attributes given in parameters.
    -* 
    -* @method setAttribs
    -* @param attribs {Array} attribs 
    -*/
    -PIXI.WebGLShaderManager.prototype.setAttribs = function(attribs)
    -{
    -    // reset temp state
    -    var i;
    -
    -    for (i = 0; i < this.tempAttribState.length; i++)
    -    {
    -        this.tempAttribState[i] = false;
    -    }
    -
    -    // set the new attribs
    -    for (i = 0; i < attribs.length; i++)
    -    {
    -        var attribId = attribs[i];
    -        this.tempAttribState[attribId] = true;
    -    }
    -
    -    var gl = this.gl;
    -
    -    for (i = 0; i < this.attribState.length; i++)
    -    {
    -        if(this.attribState[i] !== this.tempAttribState[i])
    -        {
    -            this.attribState[i] = this.tempAttribState[i];
    -
    -            if(this.tempAttribState[i])
    -            {
    -                gl.enableVertexAttribArray(i);
    -            }
    -            else
    -            {
    -                gl.disableVertexAttribArray(i);
    -            }
    -        }
    -    }
    -};
    -
    -/**
    -* Sets the current shader.
    -* 
    -* @method setShader
    -* @param shader {Any}
    -*/
    -PIXI.WebGLShaderManager.prototype.setShader = function(shader)
    -{
    -    if(this._currentId === shader._UID)return false;
    -    
    -    this._currentId = shader._UID;
    -
    -    this.currentShader = shader;
    -
    -    this.gl.useProgram(shader.program);
    -    this.setAttribs(shader.attributes);
    -
    -    return true;
    -};
    -
    -/**
    -* Destroys this object.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLShaderManager.prototype.destroy = function()
    -{
    -    this.attribState = null;
    -
    -    this.tempAttribState = null;
    -
    -    this.primitiveShader.destroy();
    -
    -    this.complexPrimitiveShader.destroy();
    -
    -    this.defaultShader.destroy();
    -
    -    this.fastShader.destroy();
    -
    -    this.stripShader.destroy();
    -
    -    this.gl = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderUtils.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderUtils.js.html deleted file mode 100755 index eabb242..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderUtils.js.html +++ /dev/null @@ -1,366 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLShaderUtils.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @method initDefaultShaders
    -* @static
    -* @private
    -*/
    -PIXI.initDefaultShaders = function()
    -{
    -};
    -
    -/**
    -* @method CompileVertexShader
    -* @static
    -* @param gl {WebGLContext} the current WebGL drawing context
    -* @param shaderSrc {Array}
    -* @return {Any}
    -*/
    -PIXI.CompileVertexShader = function(gl, shaderSrc)
    -{
    -    return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER);
    -};
    -
    -/**
    -* @method CompileFragmentShader
    -* @static
    -* @param gl {WebGLContext} the current WebGL drawing context
    -* @param shaderSrc {Array}
    -* @return {Any}
    -*/
    -PIXI.CompileFragmentShader = function(gl, shaderSrc)
    -{
    -    return PIXI._CompileShader(gl, shaderSrc, gl.FRAGMENT_SHADER);
    -};
    -
    -/**
    -* @method _CompileShader
    -* @static
    -* @private
    -* @param gl {WebGLContext} the current WebGL drawing context
    -* @param shaderSrc {Array}
    -* @param shaderType {Number}
    -* @return {Any}
    -*/
    -PIXI._CompileShader = function(gl, shaderSrc, shaderType)
    -{
    -    var src = shaderSrc.join("\n");
    -    var shader = gl.createShader(shaderType);
    -    gl.shaderSource(shader, src);
    -    gl.compileShader(shader);
    -
    -    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS))
    -    {
    -        window.console.log(gl.getShaderInfoLog(shader));
    -        return null;
    -    }
    -
    -    return shader;
    -};
    -
    -/**
    -* @method compileProgram
    -* @static
    -* @param gl {WebGLContext} the current WebGL drawing context
    -* @param vertexSrc {Array}
    -* @param fragmentSrc {Array}
    -* @return {Any}
    -*/
    -PIXI.compileProgram = function(gl, vertexSrc, fragmentSrc)
    -{
    -    var fragmentShader = PIXI.CompileFragmentShader(gl, fragmentSrc);
    -    var vertexShader = PIXI.CompileVertexShader(gl, vertexSrc);
    -
    -    var shaderProgram = gl.createProgram();
    -
    -    gl.attachShader(shaderProgram, vertexShader);
    -    gl.attachShader(shaderProgram, fragmentShader);
    -    gl.linkProgram(shaderProgram);
    -
    -    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS))
    -    {
    -        window.console.log("Could not initialise shaders");
    -    }
    -
    -    return shaderProgram;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLSpriteBatch.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLSpriteBatch.js.html deleted file mode 100755 index dd2dd3e..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLSpriteBatch.js.html +++ /dev/null @@ -1,883 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js

    - -
    -
    -/**
    - * @author Mat Groves
    - * 
    - * Big thanks to the very clever Matt DesLauriers <mattdesl> https://github.com/mattdesl/
    - * for creating the original pixi version!
    - *
    - * Heavily inspired by LibGDX's WebGLSpriteBatch:
    - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java
    - */
    -
    - /**
    - *
    - * @class WebGLSpriteBatch
    - * @private
    - * @constructor
    - */
    -PIXI.WebGLSpriteBatch = function()
    -{
    -    /**
    -     * @property vertSize
    -     * @type Number
    -     */
    -    this.vertSize = 6;
    -
    -    /**
    -     * The number of images in the SpriteBatch before it flushes
    -     * @property size
    -     * @type Number
    -     */
    -    this.size = 2000;//Math.pow(2, 16) /  this.vertSize;
    -
    -    //the total number of floats in our batch
    -    var numVerts = this.size * 4 *  this.vertSize;
    -    //the total number of indices in our batch
    -    var numIndices = this.size * 6;
    -
    -    /**
    -    * Holds the vertices
    -    *
    -    * @property vertices
    -    * @type Float32Array
    -    */
    -    this.vertices = new PIXI.Float32Array(numVerts);
    -
    -    /**
    -     * Holds the indices
    -     *
    -     * @property indices
    -     * @type Uint16Array
    -     */
    -    this.indices = new PIXI.Uint16Array(numIndices);
    -    
    -    /**
    -     * @property lastIndexCount
    -     * @type Number
    -     */
    -    this.lastIndexCount = 0;
    -
    -    for (var i=0, j=0; i < numIndices; i += 6, j += 4)
    -    {
    -        this.indices[i + 0] = j + 0;
    -        this.indices[i + 1] = j + 1;
    -        this.indices[i + 2] = j + 2;
    -        this.indices[i + 3] = j + 0;
    -        this.indices[i + 4] = j + 2;
    -        this.indices[i + 5] = j + 3;
    -    }
    -
    -    /**
    -     * @property drawing
    -     * @type Boolean
    -     */
    -    this.drawing = false;
    -
    -    /**
    -     * @property currentBatchSize
    -     * @type Number
    -     */
    -    this.currentBatchSize = 0;
    -
    -    /**
    -     * @property currentBaseTexture
    -     * @type BaseTexture
    -     */
    -    this.currentBaseTexture = null;
    -
    -    /**
    -     * @property dirty
    -     * @type Boolean
    -     */
    -    this.dirty = true;
    -
    -    /**
    -     * @property textures
    -     * @type Array
    -     */
    -    this.textures = [];
    -
    -    /**
    -     * @property blendModes
    -     * @type Array
    -     */
    -    this.blendModes = [];
    -
    -    /**
    -     * @property shaders
    -     * @type Array
    -     */
    -    this.shaders = [];
    -
    -    /**
    -     * @property sprites
    -     * @type Array
    -     */
    -    this.sprites = [];
    -
    -    /**
    -     * @property defaultShader
    -     * @type AbstractFilter
    -     */
    -    this.defaultShader = new PIXI.AbstractFilter([
    -        'precision lowp float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D uSampler;',
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;',
    -        '}'
    -    ]);
    -};
    -
    -/**
    -* @method setContext
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLSpriteBatch.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -
    -    // create a couple of buffers
    -    this.vertexBuffer = gl.createBuffer();
    -    this.indexBuffer = gl.createBuffer();
    -
    -    // 65535 is max index, so 65535 / 6 = 10922.
    -
    -    //upload the index data
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW);
    -
    -    this.currentBlendMode = 99999;
    -
    -    var shader = new PIXI.PixiShader(gl);
    -
    -    shader.fragmentSrc = this.defaultShader.fragmentSrc;
    -    shader.uniforms = {};
    -    shader.init();
    -
    -    this.defaultShader.shaders[gl.id] = shader;
    -};
    -
    -/**
    -* @method begin
    -* @param renderSession {Object} The RenderSession object
    -*/
    -PIXI.WebGLSpriteBatch.prototype.begin = function(renderSession)
    -{
    -    this.renderSession = renderSession;
    -    this.shader = this.renderSession.shaderManager.defaultShader;
    -
    -    this.start();
    -};
    -
    -/**
    -* @method end
    -*/
    -PIXI.WebGLSpriteBatch.prototype.end = function()
    -{
    -    this.flush();
    -};
    -
    -/**
    -* @method render
    -* @param sprite {Sprite} the sprite to render when using this spritebatch
    -*/
    -PIXI.WebGLSpriteBatch.prototype.render = function(sprite)
    -{
    -    var texture = sprite.texture;
    -    
    -   //TODO set blend modes.. 
    -    // check texture..
    -    if(this.currentBatchSize >= this.size)
    -    {
    -        this.flush();
    -        this.currentBaseTexture = texture.baseTexture;
    -    }
    -
    -    // get the uvs for the texture
    -    var uvs = texture._uvs;
    -    // if the uvs have not updated then no point rendering just yet!
    -    if(!uvs)return;
    -
    -    // get the sprites current alpha
    -    var alpha = sprite.worldAlpha;
    -    var tint = sprite.tint;
    -
    -    var verticies = this.vertices;
    -
    -    // TODO trim??
    -    var aX = sprite.anchor.x;
    -    var aY = sprite.anchor.y;
    -
    -    var w0, w1, h0, h1;
    -        
    -    if (texture.trim)
    -    {
    -        // if the sprite is trimmed then we need to add the extra space before transforming the sprite coords..
    -        var trim = texture.trim;
    -
    -        w1 = trim.x - aX * trim.width;
    -        w0 = w1 + texture.crop.width;
    -
    -        h1 = trim.y - aY * trim.height;
    -        h0 = h1 + texture.crop.height;
    -
    -    }
    -    else
    -    {
    -        w0 = (texture.frame.width ) * (1-aX);
    -        w1 = (texture.frame.width ) * -aX;
    -
    -        h0 = texture.frame.height * (1-aY);
    -        h1 = texture.frame.height * -aY;
    -    }
    -
    -    var index = this.currentBatchSize * 4 * this.vertSize;
    -    
    -    var resolution = texture.baseTexture.resolution;
    -
    -    var worldTransform = sprite.worldTransform;
    -
    -    var a = worldTransform.a / resolution;
    -    var b = worldTransform.b / resolution;
    -    var c = worldTransform.c / resolution;
    -    var d = worldTransform.d / resolution;
    -    var tx = worldTransform.tx;
    -    var ty = worldTransform.ty;
    -
    -
    -    // xy
    -    verticies[index++] = a * w1 + c * h1 + tx;
    -    verticies[index++] = d * h1 + b * w1 + ty;
    -    // uv
    -    verticies[index++] = uvs.x0;
    -    verticies[index++] = uvs.y0;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // xy
    -    verticies[index++] = a * w0 + c * h1 + tx;
    -    verticies[index++] = d * h1 + b * w0 + ty;
    -    // uv
    -    verticies[index++] = uvs.x1;
    -    verticies[index++] = uvs.y1;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // xy
    -    verticies[index++] = a * w0 + c * h0 + tx;
    -    verticies[index++] = d * h0 + b * w0 + ty;
    -    // uv
    -    verticies[index++] = uvs.x2;
    -    verticies[index++] = uvs.y2;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // xy
    -    verticies[index++] = a * w1 + c * h0 + tx;
    -    verticies[index++] = d * h0 + b * w1 + ty;
    -    // uv
    -    verticies[index++] = uvs.x3;
    -    verticies[index++] = uvs.y3;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -    
    -    // increment the batchsize
    -    this.sprites[this.currentBatchSize++] = sprite;
    -
    -};
    -
    -/**
    -* Renders a TilingSprite using the spriteBatch.
    -* 
    -* @method renderTilingSprite
    -* @param sprite {TilingSprite} the tilingSprite to render
    -*/
    -PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite)
    -{
    -    var texture = tilingSprite.tilingTexture;
    -
    -    // check texture..
    -    if(this.currentBatchSize >= this.size)
    -    {
    -        //return;
    -        this.flush();
    -        this.currentBaseTexture = texture.baseTexture;
    -    }
    -
    -     // set the textures uvs temporarily
    -    // TODO create a separate texture so that we can tile part of a texture
    -
    -    if(!tilingSprite._uvs)tilingSprite._uvs = new PIXI.TextureUvs();
    -
    -    var uvs = tilingSprite._uvs;
    -
    -    tilingSprite.tilePosition.x %= texture.baseTexture.width * tilingSprite.tileScaleOffset.x;
    -    tilingSprite.tilePosition.y %= texture.baseTexture.height * tilingSprite.tileScaleOffset.y;
    -
    -    var offsetX =  tilingSprite.tilePosition.x/(texture.baseTexture.width*tilingSprite.tileScaleOffset.x);
    -    var offsetY =  tilingSprite.tilePosition.y/(texture.baseTexture.height*tilingSprite.tileScaleOffset.y);
    -
    -    var scaleX =  (tilingSprite.width / texture.baseTexture.width)  / (tilingSprite.tileScale.x * tilingSprite.tileScaleOffset.x);
    -    var scaleY =  (tilingSprite.height / texture.baseTexture.height) / (tilingSprite.tileScale.y * tilingSprite.tileScaleOffset.y);
    -
    -    uvs.x0 = 0 - offsetX;
    -    uvs.y0 = 0 - offsetY;
    -
    -    uvs.x1 = (1 * scaleX) - offsetX;
    -    uvs.y1 = 0 - offsetY;
    -
    -    uvs.x2 = (1 * scaleX) - offsetX;
    -    uvs.y2 = (1 * scaleY) - offsetY;
    -
    -    uvs.x3 = 0 - offsetX;
    -    uvs.y3 = (1 *scaleY) - offsetY;
    -
    -    // get the tilingSprites current alpha
    -    var alpha = tilingSprite.worldAlpha;
    -    var tint = tilingSprite.tint;
    -
    -    var  verticies = this.vertices;
    -
    -    var width = tilingSprite.width;
    -    var height = tilingSprite.height;
    -
    -    // TODO trim??
    -    var aX = tilingSprite.anchor.x;
    -    var aY = tilingSprite.anchor.y;
    -    var w0 = width * (1-aX);
    -    var w1 = width * -aX;
    -
    -    var h0 = height * (1-aY);
    -    var h1 = height * -aY;
    -
    -    var index = this.currentBatchSize * 4 * this.vertSize;
    -
    -    var resolution = texture.baseTexture.resolution;
    -
    -    var worldTransform = tilingSprite.worldTransform;
    -
    -    var a = worldTransform.a / resolution;//[0];
    -    var b = worldTransform.b / resolution;//[3];
    -    var c = worldTransform.c / resolution;//[1];
    -    var d = worldTransform.d / resolution;//[4];
    -    var tx = worldTransform.tx;//[2];
    -    var ty = worldTransform.ty;///[5];
    -
    -    // xy
    -    verticies[index++] = a * w1 + c * h1 + tx;
    -    verticies[index++] = d * h1 + b * w1 + ty;
    -    // uv
    -    verticies[index++] = uvs.x0;
    -    verticies[index++] = uvs.y0;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // xy
    -    verticies[index++] = (a * w0 + c * h1 + tx);
    -    verticies[index++] = d * h1 + b * w0 + ty;
    -    // uv
    -    verticies[index++] = uvs.x1;
    -    verticies[index++] = uvs.y1;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -    
    -    // xy
    -    verticies[index++] = a * w0 + c * h0 + tx;
    -    verticies[index++] = d * h0 + b * w0 + ty;
    -    // uv
    -    verticies[index++] = uvs.x2;
    -    verticies[index++] = uvs.y2;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // xy
    -    verticies[index++] = a * w1 + c * h0 + tx;
    -    verticies[index++] = d * h0 + b * w1 + ty;
    -    // uv
    -    verticies[index++] = uvs.x3;
    -    verticies[index++] = uvs.y3;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // increment the batchsize
    -    this.sprites[this.currentBatchSize++] = tilingSprite;
    -};
    -
    -/**
    -* Renders the content and empties the current batch.
    -*
    -* @method flush
    -*/
    -PIXI.WebGLSpriteBatch.prototype.flush = function()
    -{
    -    // If the batch is length 0 then return as there is nothing to draw
    -    if (this.currentBatchSize===0)return;
    -
    -    var gl = this.gl;
    -    var shader;
    -
    -    if(this.dirty)
    -    {
    -        this.dirty = false;
    -        // bind the main texture
    -        gl.activeTexture(gl.TEXTURE0);
    -
    -        // bind the buffers
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -
    -        shader =  this.defaultShader.shaders[gl.id];
    -
    -        // this is the same for each shader?
    -        var stride =  this.vertSize * 4;
    -        gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0);
    -        gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, stride, 2 * 4);
    -        gl.vertexAttribPointer(shader.colorAttribute, 2, gl.FLOAT, false, stride, 4 * 4);
    -    }
    -
    -    // upload the verts to the buffer  
    -    if(this.currentBatchSize > ( this.size * 0.5 ) )
    -    {
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices);
    -    }
    -    else
    -    {
    -        var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize);
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, view);
    -    }
    -
    -    var nextTexture, nextBlendMode, nextShader;
    -    var batchSize = 0;
    -    var start = 0;
    -
    -    var currentBaseTexture = null;
    -    var currentBlendMode = this.renderSession.blendModeManager.currentBlendMode;
    -    var currentShader = null;
    -
    -    var blendSwap = false;
    -    var shaderSwap = false;
    -    var sprite;
    -
    -    for (var i = 0, j = this.currentBatchSize; i < j; i++) {
    -        
    -        sprite = this.sprites[i];
    -
    -        nextTexture = sprite.texture.baseTexture;
    -        nextBlendMode = sprite.blendMode;
    -        nextShader = sprite.shader || this.defaultShader;
    -
    -        blendSwap = currentBlendMode !== nextBlendMode;
    -        shaderSwap = currentShader !== nextShader; // should I use _UIDS???
    -
    -        if(currentBaseTexture !== nextTexture || blendSwap || shaderSwap)
    -        {
    -            this.renderBatch(currentBaseTexture, batchSize, start);
    -
    -            start = i;
    -            batchSize = 0;
    -            currentBaseTexture = nextTexture;
    -
    -            if( blendSwap )
    -            {
    -                currentBlendMode = nextBlendMode;
    -                this.renderSession.blendModeManager.setBlendMode( currentBlendMode );
    -            }
    -
    -            if( shaderSwap )
    -            {
    -                currentShader = nextShader;
    -                
    -                shader = currentShader.shaders[gl.id];
    -
    -                if(!shader)
    -                {
    -                    shader = new PIXI.PixiShader(gl);
    -
    -                    shader.fragmentSrc =currentShader.fragmentSrc;
    -                    shader.uniforms =currentShader.uniforms;
    -                    shader.init();
    -
    -                    currentShader.shaders[gl.id] = shader;
    -                }
    -
    -                // set shader function???
    -                this.renderSession.shaderManager.setShader(shader);
    -
    -                if(shader.dirty)shader.syncUniforms();
    -                
    -                // both thease only need to be set if they are changing..
    -                // set the projection
    -                var projection = this.renderSession.projection;
    -                gl.uniform2f(shader.projectionVector, projection.x, projection.y);
    -
    -                // TODO - this is temprorary!
    -                var offsetVector = this.renderSession.offset;
    -                gl.uniform2f(shader.offsetVector, offsetVector.x, offsetVector.y);
    -
    -                // set the pointers
    -            }
    -        }
    -
    -        batchSize++;
    -    }
    -
    -    this.renderBatch(currentBaseTexture, batchSize, start);
    -
    -    // then reset the batch!
    -    this.currentBatchSize = 0;
    -};
    -
    -/**
    -* @method renderBatch
    -* @param texture {Texture}
    -* @param size {Number}
    -* @param startIndex {Number}
    -*/
    -PIXI.WebGLSpriteBatch.prototype.renderBatch = function(texture, size, startIndex)
    -{
    -    if(size === 0)return;
    -
    -    var gl = this.gl;
    -
    -    // check if a texture is dirty..
    -    if(texture._dirty[gl.id])
    -    {
    -        this.renderSession.renderer.updateTexture(texture);
    -    }
    -    else
    -    {
    -        // bind the current texture
    -        gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]);
    -    }
    -
    -    // now draw those suckas!
    -    gl.drawElements(gl.TRIANGLES, size * 6, gl.UNSIGNED_SHORT, startIndex * 6 * 2);
    -    
    -    // increment the draw count
    -    this.renderSession.drawCount++;
    -};
    -
    -/**
    -* @method stop
    -*/
    -PIXI.WebGLSpriteBatch.prototype.stop = function()
    -{
    -    this.flush();
    -    this.dirty = true;
    -};
    -
    -/**
    -* @method start
    -*/
    -PIXI.WebGLSpriteBatch.prototype.start = function()
    -{
    -    this.dirty = true;
    -};
    -
    -/**
    -* Destroys the SpriteBatch.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLSpriteBatch.prototype.destroy = function()
    -{
    -    this.vertices = null;
    -    this.indices = null;
    -    
    -    this.gl.deleteBuffer( this.vertexBuffer );
    -    this.gl.deleteBuffer( this.indexBuffer );
    -    
    -    this.currentBaseTexture = null;
    -    
    -    this.gl = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLStencilManager.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLStencilManager.js.html deleted file mode 100755 index 20b4a01..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLStencilManager.js.html +++ /dev/null @@ -1,572 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLStencilManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class WebGLStencilManager
    -* @constructor
    -* @private
    -*/
    -PIXI.WebGLStencilManager = function()
    -{
    -    this.stencilStack = [];
    -    this.reverse = true;
    -    this.count = 0;
    -};
    -
    -/**
    -* Sets the drawing context to the one given in parameter.
    -* 
    -* @method setContext 
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLStencilManager.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -};
    -
    -/**
    -* Applies the Mask and adds it to the current filter stack.
    -* 
    -* @method pushMask
    -* @param graphics {Graphics}
    -* @param webGLData {Array}
    -* @param renderSession {Object}
    -*/
    -PIXI.WebGLStencilManager.prototype.pushStencil = function(graphics, webGLData, renderSession)
    -{
    -    var gl = this.gl;
    -    this.bindGraphics(graphics, webGLData, renderSession);
    -
    -    if(this.stencilStack.length === 0)
    -    {
    -        gl.enable(gl.STENCIL_TEST);
    -        gl.clear(gl.STENCIL_BUFFER_BIT);
    -        this.reverse = true;
    -        this.count = 0;
    -    }
    -
    -    this.stencilStack.push(webGLData);
    -
    -    var level = this.count;
    -
    -    gl.colorMask(false, false, false, false);
    -
    -    gl.stencilFunc(gl.ALWAYS,0,0xFF);
    -    gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT);
    -
    -    // draw the triangle strip!
    -
    -    if(webGLData.mode === 1)
    -    {
    -        gl.drawElements(gl.TRIANGLE_FAN,  webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 );
    -       
    -        if(this.reverse)
    -        {
    -            gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF);
    -            gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR);
    -        }
    -        else
    -        {
    -            gl.stencilFunc(gl.EQUAL,level, 0xFF);
    -            gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR);
    -        }
    -
    -        // draw a quad to increment..
    -        gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 );
    -               
    -        if(this.reverse)
    -        {
    -            gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF);
    -        }
    -        else
    -        {
    -            gl.stencilFunc(gl.EQUAL,level+1, 0xFF);
    -        }
    -
    -        this.reverse = !this.reverse;
    -    }
    -    else
    -    {
    -        if(!this.reverse)
    -        {
    -            gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF);
    -            gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR);
    -        }
    -        else
    -        {
    -            gl.stencilFunc(gl.EQUAL,level, 0xFF);
    -            gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR);
    -        }
    -
    -        gl.drawElements(gl.TRIANGLE_STRIP,  webGLData.indices.length, gl.UNSIGNED_SHORT, 0 );
    -
    -        if(!this.reverse)
    -        {
    -            gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF);
    -        }
    -        else
    -        {
    -            gl.stencilFunc(gl.EQUAL,level+1, 0xFF);
    -        }
    -    }
    -
    -    gl.colorMask(true, true, true, true);
    -    gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP);
    -
    -    this.count++;
    -};
    -
    -/**
    - * TODO this does not belong here!
    - * 
    - * @method bindGraphics
    - * @param graphics {Graphics}
    - * @param webGLData {Array}
    - * @param renderSession {Object}
    - */
    -PIXI.WebGLStencilManager.prototype.bindGraphics = function(graphics, webGLData, renderSession)
    -{
    -    //if(this._currentGraphics === graphics)return;
    -    this._currentGraphics = graphics;
    -
    -    var gl = this.gl;
    -
    -     // bind the graphics object..
    -    var projection = renderSession.projection,
    -        offset = renderSession.offset,
    -        shader;// = renderSession.shaderManager.primitiveShader;
    -
    -    if(webGLData.mode === 1)
    -    {
    -        shader = renderSession.shaderManager.complexPrimitiveShader;
    -
    -        renderSession.shaderManager.setShader( shader );
    -
    -        gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true));
    -
    -        gl.uniform2f(shader.projectionVector, projection.x, -projection.y);
    -        gl.uniform2f(shader.offsetVector, -offset.x, -offset.y);
    -
    -        gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint));
    -        gl.uniform3fv(shader.color, webGLData.color);
    -
    -        gl.uniform1f(shader.alpha, graphics.worldAlpha * webGLData.alpha);
    -
    -        gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer);
    -
    -        gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 2, 0);
    -
    -
    -        // now do the rest..
    -        // set the index buffer!
    -        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer);
    -    }
    -    else
    -    {
    -        //renderSession.shaderManager.activatePrimitiveShader();
    -        shader = renderSession.shaderManager.primitiveShader;
    -        renderSession.shaderManager.setShader( shader );
    -
    -        gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true));
    -
    -        gl.uniform2f(shader.projectionVector, projection.x, -projection.y);
    -        gl.uniform2f(shader.offsetVector, -offset.x, -offset.y);
    -
    -        gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint));
    -
    -        gl.uniform1f(shader.alpha, graphics.worldAlpha);
    -        
    -        gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer);
    -
    -        gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0);
    -        gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4);
    -
    -        // set the index buffer!
    -        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer);
    -    }
    -};
    -
    -/**
    - * @method popStencil
    - * @param graphics {Graphics}
    - * @param webGLData {Array}
    - * @param renderSession {Object}
    - */
    -PIXI.WebGLStencilManager.prototype.popStencil = function(graphics, webGLData, renderSession)
    -{
    -	var gl = this.gl;
    -    this.stencilStack.pop();
    -   
    -    this.count--;
    -
    -    if(this.stencilStack.length === 0)
    -    {
    -        // the stack is empty!
    -        gl.disable(gl.STENCIL_TEST);
    -
    -    }
    -    else
    -    {
    -
    -        var level = this.count;
    -
    -        this.bindGraphics(graphics, webGLData, renderSession);
    -
    -        gl.colorMask(false, false, false, false);
    -    
    -        if(webGLData.mode === 1)
    -        {
    -            this.reverse = !this.reverse;
    -
    -            if(this.reverse)
    -            {
    -                gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF);
    -                gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR);
    -            }
    -            else
    -            {
    -                gl.stencilFunc(gl.EQUAL,level+1, 0xFF);
    -                gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR);
    -            }
    -
    -            // draw a quad to increment..
    -            gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 );
    -            
    -            gl.stencilFunc(gl.ALWAYS,0,0xFF);
    -            gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT);
    -
    -            // draw the triangle strip!
    -            gl.drawElements(gl.TRIANGLE_FAN,  webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 );
    -           
    -            if(!this.reverse)
    -            {
    -                gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF);
    -            }
    -            else
    -            {
    -                gl.stencilFunc(gl.EQUAL,level, 0xFF);
    -            }
    -
    -        }
    -        else
    -        {
    -          //  console.log("<<>>")
    -            if(!this.reverse)
    -            {
    -                gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF);
    -                gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR);
    -            }
    -            else
    -            {
    -                gl.stencilFunc(gl.EQUAL,level+1, 0xFF);
    -                gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR);
    -            }
    -
    -            gl.drawElements(gl.TRIANGLE_STRIP,  webGLData.indices.length, gl.UNSIGNED_SHORT, 0 );
    -
    -            if(!this.reverse)
    -            {
    -                gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF);
    -            }
    -            else
    -            {
    -                gl.stencilFunc(gl.EQUAL,level, 0xFF);
    -            }
    -        }
    -
    -        gl.colorMask(true, true, true, true);
    -        gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP);
    -
    -
    -    }
    -};
    -
    -/**
    -* Destroys the mask stack.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLStencilManager.prototype.destroy = function()
    -{
    -    this.stencilStack = null;
    -    this.gl = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_text_BitmapText.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_text_BitmapText.js.html deleted file mode 100755 index 1a2e2ce..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_text_BitmapText.js.html +++ /dev/null @@ -1,493 +0,0 @@ - - - - - src/pixi/text/BitmapText.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/text/BitmapText.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A BitmapText object will create a line or multiple lines of text using bitmap font. To split a line you can use '\n', '\r' or '\r\n' in your string.
    - * You can generate the fnt files using
    - * http://www.angelcode.com/products/bmfont/ for windows or
    - * http://www.bmglyph.com/ for mac.
    - *
    - * @class BitmapText
    - * @extends DisplayObjectContainer
    - * @constructor
    - * @param text {String} The copy that you would like the text to display
    - * @param style {Object} The style parameters
    - * @param style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)
    - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
    - */
    -PIXI.BitmapText = function(text, style)
    -{
    -    PIXI.DisplayObjectContainer.call(this);
    -
    -    /**
    -     * [read-only] The width of the overall text, different from fontSize,
    -     * which is defined in the style object
    -     *
    -     * @property textWidth
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.textWidth = 0;
    -
    -    /**
    -     * [read-only] The height of the overall text, different from fontSize,
    -     * which is defined in the style object
    -     *
    -     * @property textHeight
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.textHeight = 0;
    -
    -    /**
    -     * @property _pool
    -     * @type Array
    -     * @private
    -     */
    -    this._pool = [];
    -
    -    this.setText(text);
    -    this.setStyle(style);
    -    this.updateText();
    -
    -    /**
    -     * The dirty state of this object.
    -     * @property dirty
    -     * @type Boolean
    -     */
    -    this.dirty = false;
    -};
    -
    -// constructor
    -PIXI.BitmapText.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
    -PIXI.BitmapText.prototype.constructor = PIXI.BitmapText;
    -
    -/**
    - * Set the text string to be rendered.
    - *
    - * @method setText
    - * @param text {String} The text that you would like displayed
    - */
    -PIXI.BitmapText.prototype.setText = function(text)
    -{
    -    this.text = text || ' ';
    -    this.dirty = true;
    -};
    -
    -/**
    - * Set the style of the text
    - * style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)
    - * [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single lines of text
    - *
    - * @method setStyle
    - * @param style {Object} The style parameters, contained as properties of an object
    - */
    -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;
    -    this.tint = style.tint;
    -};
    -
    -/**
    - * Renders text and updates it when needed
    - *
    - * @method updateText
    - * @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(/(?:\r\n|\r|\n)/.test(this.text.charAt(i)))
    -        {
    -            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.kerning[prevCharCode])
    -        {
    -            pos.x += charData.kerning[prevCharCode];
    -        }
    -
    -        chars.push({texture:charData.texture, 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);
    -    }
    -
    -    var lenChildren = this.children.length;
    -    var lenChars = chars.length;
    -    var tint = this.tint || 0xFFFFFF;
    -
    -    for(i = 0; i < lenChars; i++)
    -    {
    -        var c = i < lenChildren ? this.children[i] : this._pool.pop(); // get old child if have. if not - take from pool.
    -
    -        if (c) c.setTexture(chars[i].texture); // check if got one before.
    -        else c = new PIXI.Sprite(chars[i].texture); // if no create new one.
    -
    -        c.position.x = (chars[i].position.x + lineAlignOffsets[chars[i].line]) * scale;
    -        c.position.y = chars[i].position.y * scale;
    -        c.scale.x = c.scale.y = scale;
    -        c.tint = tint;
    -        if (!c.parent) this.addChild(c);
    -    }
    -
    -    // remove unnecessary children.
    -    // and put their into the pool.
    -    while(this.children.length > lenChars)
    -    {
    -        var child = this.getChildAt(this.children.length - 1);
    -        this._pool.push(child);
    -        this.removeChild(child);
    -    }
    -
    -    this.textWidth = maxLineWidth * scale;
    -    this.textHeight = (pos.y + data.lineHeight) * scale;
    -};
    -
    -/**
    - * Updates the transform of this object
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.BitmapText.prototype.updateTransform = function()
    -{
    -    if(this.dirty)
    -    {
    -        this.updateText();
    -        this.dirty = false;
    -    }
    -
    -    PIXI.DisplayObjectContainer.prototype.updateTransform.call(this);
    -};
    -
    -PIXI.BitmapText.fonts = {};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_text_Text.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_text_Text.js.html deleted file mode 100755 index fb28604..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_text_Text.js.html +++ /dev/null @@ -1,805 +0,0 @@ - - - - - src/pixi/text/Text.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/text/Text.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * Modified by Tom Slezakowski http://www.tomslezakowski.com @TomSlezakowski (24/03/2014) - Added dropShadowColor.
    - */
    -
    -/**
    - * A Text Object will create a line or multiple lines of text. To split a line you can use '\n' in your text string,
    - * or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object.
    - *
    - * @class Text
    - * @extends Sprite
    - * @constructor
    - * @param text {String} The copy that you would like the text to display
    - * @param [style] {Object} The style parameters
    - * @param [style.font] {String} default 'bold 20px Arial' The style and size of the font
    - * @param [style.fill='black'] {String|Number} A canvas fillstyle that will be used on the text e.g 'red', '#00FF00'
    - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
    - * @param [style.stroke] {String|Number} A canvas fillstyle that will be used on the text stroke e.g 'blue', '#FCFF00'
    - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke)
    - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used
    - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap, it needs wordWrap to be set to true
    - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text
    - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00'
    - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow
    - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow
    - */
    -PIXI.Text = function(text, style)
    -{
    -    /**
    -     * The canvas element that everything is drawn to
    -     *
    -     * @property canvas
    -     * @type HTMLCanvasElement
    -     */
    -    this.canvas = document.createElement('canvas');
    -
    -    /**
    -     * The canvas 2d context that everything is drawn with
    -     * @property context
    -     * @type HTMLCanvasElement
    -     */
    -    this.context = this.canvas.getContext('2d');
    -
    -    /**
    -     * The resolution of the canvas.
    -     * @property resolution
    -     * @type Number
    -     */
    -    this.resolution = 1;
    -
    -    PIXI.Sprite.call(this, PIXI.Texture.fromCanvas(this.canvas));
    -
    -    this.setText(text);
    -    this.setStyle(style);
    -
    -};
    -
    -// constructor
    -PIXI.Text.prototype = Object.create(PIXI.Sprite.prototype);
    -PIXI.Text.prototype.constructor = PIXI.Text;
    -
    -/**
    - * The width of the Text, setting this will actually modify the scale to achieve the value set
    - *
    - * @property width
    - * @type Number
    - */
    -Object.defineProperty(PIXI.Text.prototype, 'width', {
    -    get: function() {
    -
    -        if(this.dirty)
    -        {
    -            this.updateText();
    -            this.dirty = false;
    -        }
    -
    -
    -        return this.scale.x * this.texture.frame.width;
    -    },
    -    set: function(value) {
    -        this.scale.x = value / this.texture.frame.width;
    -        this._width = value;
    -    }
    -});
    -
    -/**
    - * The height of the Text, setting this will actually modify the scale to achieve the value set
    - *
    - * @property height
    - * @type Number
    - */
    -Object.defineProperty(PIXI.Text.prototype, 'height', {
    -    get: function() {
    -
    -        if(this.dirty)
    -        {
    -            this.updateText();
    -            this.dirty = false;
    -        }
    -
    -
    -        return  this.scale.y * this.texture.frame.height;
    -    },
    -    set: function(value) {
    -        this.scale.y = value / this.texture.frame.height;
    -        this._height = value;
    -    }
    -});
    -
    -/**
    - * Set the style of the text
    - *
    - * @method setStyle
    - * @param [style] {Object} The style parameters
    - * @param [style.font='bold 20pt Arial'] {String} The style and size of the font
    - * @param [style.fill='black'] {Object} A canvas fillstyle that will be used on the text eg 'red', '#00FF00'
    - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
    - * @param [style.stroke='black'] {String} A canvas fillstyle that will be used on the text stroke eg 'blue', '#FCFF00'
    - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke)
    - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used
    - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap
    - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text
    - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00'
    - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow
    - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow
    - */
    -PIXI.Text.prototype.setStyle = function(style)
    -{
    -    style = style || {};
    -    style.font = style.font || 'bold 20pt Arial';
    -    style.fill = style.fill || 'black';
    -    style.align = style.align || 'left';
    -    style.stroke = style.stroke || 'black'; //provide a default, see: https://github.com/GoodBoyDigital/pixi.js/issues/136
    -    style.strokeThickness = style.strokeThickness || 0;
    -    style.wordWrap = style.wordWrap || false;
    -    style.wordWrapWidth = style.wordWrapWidth || 100;
    -    
    -    style.dropShadow = style.dropShadow || false;
    -    style.dropShadowAngle = style.dropShadowAngle || Math.PI / 6;
    -    style.dropShadowDistance = style.dropShadowDistance || 4;
    -    style.dropShadowColor = style.dropShadowColor || 'black';
    -
    -    this.style = style;
    -    this.dirty = true;
    -};
    -
    -/**
    - * Set the copy for the text object. To split a line you can use '\n'.
    - *
    - * @method setText
    - * @param text {String} The copy that you would like the text to display
    - */
    -PIXI.Text.prototype.setText = function(text)
    -{
    -    this.text = text.toString() || ' ';
    -    this.dirty = true;
    -};
    -
    -/**
    - * Renders text and updates it when needed
    - *
    - * @method updateText
    - * @private
    - */
    -PIXI.Text.prototype.updateText = function()
    -{
    -    this.texture.baseTexture.resolution = this.resolution;
    -
    -    this.context.font = this.style.font;
    -
    -    var outputText = this.text;
    -
    -    // word wrap
    -    // preserve original text
    -    if(this.style.wordWrap)outputText = this.wordWrap(this.text);
    -
    -    //split text into lines
    -    var lines = outputText.split(/(?:\r\n|\r|\n)/);
    -
    -    //calculate text width
    -    var lineWidths = [];
    -    var maxLineWidth = 0;
    -    var fontProperties = this.determineFontProperties(this.style.font);
    -    for (var i = 0; i < lines.length; i++)
    -    {
    -        var lineWidth = this.context.measureText(lines[i]).width;
    -        lineWidths[i] = lineWidth;
    -        maxLineWidth = Math.max(maxLineWidth, lineWidth);
    -    }
    -
    -    var width = maxLineWidth + this.style.strokeThickness;
    -    if(this.style.dropShadow)width += this.style.dropShadowDistance;
    -
    -    this.canvas.width = ( width + this.context.lineWidth ) * this.resolution;
    -    
    -    //calculate text height
    -    var lineHeight = fontProperties.fontSize + this.style.strokeThickness;
    - 
    -    var height = lineHeight * lines.length;
    -    if(this.style.dropShadow)height += this.style.dropShadowDistance;
    -
    -    this.canvas.height = height * this.resolution;
    -
    -    this.context.scale( this.resolution, this.resolution);
    -
    -    if(navigator.isCocoonJS) this.context.clearRect(0,0,this.canvas.width,this.canvas.height);
    -    
    -    this.context.font = this.style.font;
    -    this.context.strokeStyle = this.style.stroke;
    -    this.context.lineWidth = this.style.strokeThickness;
    -    this.context.textBaseline = 'alphabetic';
    -    //this.context.lineJoin = 'round';
    -
    -    var linePositionX;
    -    var linePositionY;
    -
    -    if(this.style.dropShadow)
    -    {
    -        this.context.fillStyle = this.style.dropShadowColor;
    -
    -        var xShadowOffset = Math.sin(this.style.dropShadowAngle) * this.style.dropShadowDistance;
    -        var yShadowOffset = Math.cos(this.style.dropShadowAngle) * this.style.dropShadowDistance;
    -
    -        for (i = 0; i < lines.length; i++)
    -        {
    -            linePositionX = this.style.strokeThickness / 2;
    -            linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent;
    -
    -            if(this.style.align === 'right')
    -            {
    -                linePositionX += maxLineWidth - lineWidths[i];
    -            }
    -            else if(this.style.align === 'center')
    -            {
    -                linePositionX += (maxLineWidth - lineWidths[i]) / 2;
    -            }
    -
    -            if(this.style.fill)
    -            {
    -                this.context.fillText(lines[i], linePositionX + xShadowOffset, linePositionY + yShadowOffset);
    -            }
    -
    -          //  if(dropShadow)
    -        }
    -    }
    -
    -    //set canvas text styles
    -    this.context.fillStyle = this.style.fill;
    -    
    -    //draw lines line by line
    -    for (i = 0; i < lines.length; i++)
    -    {
    -        linePositionX = this.style.strokeThickness / 2;
    -        linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent;
    -
    -        if(this.style.align === 'right')
    -        {
    -            linePositionX += maxLineWidth - lineWidths[i];
    -        }
    -        else if(this.style.align === 'center')
    -        {
    -            linePositionX += (maxLineWidth - lineWidths[i]) / 2;
    -        }
    -
    -        if(this.style.stroke && this.style.strokeThickness)
    -        {
    -            this.context.strokeText(lines[i], linePositionX, linePositionY);
    -        }
    -
    -        if(this.style.fill)
    -        {
    -            this.context.fillText(lines[i], linePositionX, linePositionY);
    -        }
    -
    -      //  if(dropShadow)
    -    }
    -
    -    this.updateTexture();
    -};
    -
    -/**
    - * Updates texture size based on canvas size
    - *
    - * @method updateTexture
    - * @private
    - */
    -PIXI.Text.prototype.updateTexture = function()
    -{
    -    this.texture.baseTexture.width = this.canvas.width;
    -    this.texture.baseTexture.height = this.canvas.height;
    -    this.texture.crop.width = this.texture.frame.width = this.canvas.width;
    -    this.texture.crop.height = this.texture.frame.height = this.canvas.height;
    -
    -    this._width = this.canvas.width;
    -    this._height = this.canvas.height;
    -
    -    // update the dirty base textures
    -    this.texture.baseTexture.dirty();
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.Text.prototype._renderWebGL = function(renderSession)
    -{
    -    if(this.dirty)
    -    {
    -        this.resolution = renderSession.resolution;
    -
    -        this.updateText();
    -        this.dirty = false;
    -    }
    -
    -    PIXI.Sprite.prototype._renderWebGL.call(this, renderSession);
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.Text.prototype._renderCanvas = function(renderSession)
    -{
    -    if(this.dirty)
    -    {
    -        this.resolution = renderSession.resolution;
    -
    -        this.updateText();
    -        this.dirty = false;
    -    }
    -     
    -    PIXI.Sprite.prototype._renderCanvas.call(this, renderSession);
    -};
    -
    -/**
    -* Calculates the ascent, descent and fontSize of a given fontStyle
    -*
    -* @method determineFontProperties
    -* @param fontStyle {Object}
    -* @private
    -*/
    -PIXI.Text.prototype.determineFontProperties = function(fontStyle)
    -{
    -    var properties = PIXI.Text.fontPropertiesCache[fontStyle];
    -
    -    if(!properties)
    -    {
    -        properties = {};
    -        
    -        var canvas = PIXI.Text.fontPropertiesCanvas;
    -        var context = PIXI.Text.fontPropertiesContext;
    -
    -        context.font = fontStyle;
    -
    -        var width = Math.ceil(context.measureText('|Mq').width);
    -        var baseline = Math.ceil(context.measureText('M').width);
    -        var height = 2 * baseline;
    -
    -        baseline = baseline * 1.4 | 0;
    -
    -        canvas.width = width;
    -        canvas.height = height;
    -
    -        context.fillStyle = '#f00';
    -        context.fillRect(0, 0, width, height);
    -
    -        context.font = fontStyle;
    -
    -        context.textBaseline = 'alphabetic';
    -        context.fillStyle = '#000';
    -        context.fillText('|Mq', 0, baseline);
    -
    -        var imagedata = context.getImageData(0, 0, width, height).data;
    -        var pixels = imagedata.length;
    -        var line = width * 4;
    -
    -        var i, j;
    -
    -        var idx = 0;
    -        var stop = false;
    -
    -        // ascent. scan from top to bottom until we find a non red pixel
    -        for(i = 0; i < baseline; i++)
    -        {
    -            for(j = 0; j < line; j += 4)
    -            {
    -                if(imagedata[idx + j] !== 255)
    -                {
    -                    stop = true;
    -                    break;
    -                }
    -            }
    -            if(!stop)
    -            {
    -                idx += line;
    -            }
    -            else
    -            {
    -                break;
    -            }
    -        }
    -
    -        properties.ascent = baseline - i;
    -
    -        idx = pixels - line;
    -        stop = false;
    -
    -        // descent. scan from bottom to top until we find a non red pixel
    -        for(i = height; i > baseline; i--)
    -        {
    -            for(j = 0; j < line; j += 4)
    -            {
    -                if(imagedata[idx + j] !== 255)
    -                {
    -                    stop = true;
    -                    break;
    -                }
    -            }
    -            if(!stop)
    -            {
    -                idx -= line;
    -            }
    -            else
    -            {
    -                break;
    -            }
    -        }
    -
    -        properties.descent = i - baseline;
    -        properties.fontSize = properties.ascent + properties.descent;
    -
    -        PIXI.Text.fontPropertiesCache[fontStyle] = properties;
    -    }
    -
    -    return properties;
    -};
    -
    -/**
    - * Applies newlines to a string to have it optimally fit into the horizontal
    - * bounds set by the Text object's wordWrapWidth property.
    - *
    - * @method wordWrap
    - * @param text {String}
    - * @private
    - */
    -PIXI.Text.prototype.wordWrap = function(text)
    -{
    -    // Greedy wrapping algorithm that will wrap words as the line grows longer
    -    // than its horizontal bounds.
    -    var result = '';
    -    var lines = text.split('\n');
    -    for (var i = 0; i < lines.length; i++)
    -    {
    -        var spaceLeft = this.style.wordWrapWidth;
    -        var words = lines[i].split(' ');
    -        for (var j = 0; j < words.length; j++)
    -        {
    -            var wordWidth = this.context.measureText(words[j]).width;
    -            var wordWidthWithSpace = wordWidth + this.context.measureText(' ').width;
    -            if(j === 0 || wordWidthWithSpace > spaceLeft)
    -            {
    -                // Skip printing the newline if it's the first word of the line that is
    -                // greater than the word wrap width.
    -                if(j > 0)
    -                {
    -                    result += '\n';
    -                }
    -                result += words[j];
    -                spaceLeft = this.style.wordWrapWidth - wordWidth;
    -            }
    -            else
    -            {
    -                spaceLeft -= wordWidthWithSpace;
    -                result += ' ' + words[j];
    -            }
    -        }
    -
    -        if (i < lines.length-1)
    -        {
    -            result += '\n';
    -        }
    -    }
    -    return result;
    -};
    -
    -/**
    -* Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account.
    -*
    -* @method getBounds
    -* @param matrix {Matrix} the transformation matrix of the Text
    -* @return {Rectangle} the framing rectangle
    -*/
    -PIXI.Text.prototype.getBounds = function(matrix)
    -{
    -    if(this.dirty)
    -    {
    -        this.updateText();
    -        this.dirty = false;
    -    }
    -
    -    return PIXI.Sprite.prototype.getBounds.call(this, matrix);
    -};
    -
    -/**
    - * Destroys this text object.
    - *
    - * @method destroy
    - * @param destroyBaseTexture {Boolean} whether to destroy the base texture as well
    - */
    -PIXI.Text.prototype.destroy = function(destroyBaseTexture)
    -{
    -    // make sure to reset the the context and canvas.. dont want this hanging around in memory!
    -    this.context = null;
    -    this.canvas = null;
    -
    -    this.texture.destroy(destroyBaseTexture === undefined ? true : destroyBaseTexture);
    -};
    -
    -PIXI.Text.fontPropertiesCache = {};
    -PIXI.Text.fontPropertiesCanvas = document.createElement('canvas');
    -PIXI.Text.fontPropertiesContext = PIXI.Text.fontPropertiesCanvas.getContext('2d');
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_textures_BaseTexture.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_textures_BaseTexture.js.html deleted file mode 100755 index 4c34275..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_textures_BaseTexture.js.html +++ /dev/null @@ -1,573 +0,0 @@ - - - - - src/pixi/textures/BaseTexture.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/textures/BaseTexture.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -PIXI.BaseTextureCache = {};
    -
    -PIXI.BaseTextureCacheIdGenerator = 0;
    -
    -/**
    - * A texture stores the information that represents an image. All textures have a base texture.
    - *
    - * @class BaseTexture
    - * @uses EventTarget
    - * @constructor
    - * @param source {String} the source object (image or canvas)
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - */
    -PIXI.BaseTexture = function(source, scaleMode)
    -{
    -    /**
    -     * The Resolution of the texture. 
    -     *
    -     * @property resolution
    -     * @type Number
    -     */
    -    this.resolution = 1;
    -    
    -    /**
    -     * [read-only] The width of the base texture set when the image has loaded
    -     *
    -     * @property width
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.width = 100;
    -
    -    /**
    -     * [read-only] The height of the base texture set when the image has loaded
    -     *
    -     * @property height
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.height = 100;
    -
    -    /**
    -     * The scale mode to apply when scaling this texture
    -     * 
    -     * @property scaleMode
    -     * @type PIXI.scaleModes
    -     * @default PIXI.scaleModes.LINEAR
    -     */
    -    this.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT;
    -
    -    /**
    -     * [read-only] Set to true once the base texture has loaded
    -     *
    -     * @property hasLoaded
    -     * @type Boolean
    -     * @readOnly
    -     */
    -    this.hasLoaded = false;
    -
    -    /**
    -     * The image source that is used to create the texture.
    -     *
    -     * @property source
    -     * @type Image
    -     */
    -    this.source = source;
    -
    -    this._UID = PIXI._UID++;
    -
    -    /**
    -     * Controls if RGB channels should be pre-multiplied by Alpha  (WebGL only)
    -     *
    -     * @property premultipliedAlpha
    -     * @type Boolean
    -     * @default true
    -     */
    -    this.premultipliedAlpha = true;
    -
    -    // used for webGL
    -
    -    /**
    -     * @property _glTextures
    -     * @type Array
    -     * @private
    -     */
    -    this._glTextures = [];
    -
    -    // used for webGL texture updating...
    -    // TODO - this needs to be addressed
    -
    -    /**
    -     * @property _dirty
    -     * @type Array
    -     * @private
    -     */
    -    this._dirty = [true, true, true, true];
    -
    -    if(!source)return;
    -
    -    if((this.source.complete || this.source.getContext) && this.source.width && this.source.height)
    -    {
    -        this.hasLoaded = true;
    -        this.width = this.source.naturalWidth || this.source.width;
    -        this.height = this.source.naturalHeight || this.source.height;
    -        this.dirty();
    -    }
    -    else
    -    {
    -        var scope = this;
    -
    -        this.source.onload = function() {
    -
    -            scope.hasLoaded = true;
    -            scope.width = scope.source.naturalWidth || scope.source.width;
    -            scope.height = scope.source.naturalHeight || scope.source.height;
    -
    -            scope.dirty();
    -
    -            // add it to somewhere...
    -            scope.dispatchEvent( { type: 'loaded', content: scope } );
    -        };
    -
    -        this.source.onerror = function() {
    -            scope.dispatchEvent( { type: 'error', content: scope } );
    -        };
    -    }
    -
    -    /**
    -     * @property imageUrl
    -     * @type String
    -     */
    -    this.imageUrl = null;
    -
    -    /**
    -     * @property _powerOf2
    -     * @type Boolean
    -     * @private
    -     */
    -    this._powerOf2 = false;
    -
    -};
    -
    -PIXI.BaseTexture.prototype.constructor = PIXI.BaseTexture;
    -
    -PIXI.EventTarget.mixin(PIXI.BaseTexture.prototype);
    -
    -/**
    - * Destroys this base texture
    - *
    - * @method destroy
    - */
    -PIXI.BaseTexture.prototype.destroy = function()
    -{
    -    if(this.imageUrl)
    -    {
    -        delete PIXI.BaseTextureCache[this.imageUrl];
    -        delete PIXI.TextureCache[this.imageUrl];
    -        this.imageUrl = null;
    -        if (!navigator.isCocoonJS) this.source.src = '';
    -    }
    -    else if (this.source && this.source._pixiId)
    -    {
    -        delete PIXI.BaseTextureCache[this.source._pixiId];
    -    }
    -    this.source = null;
    -
    -    this.unloadFromGPU();
    -};
    -
    -/**
    - * Changes the source image of the texture
    - *
    - * @method updateSourceImage
    - * @param newSrc {String} the path of the image
    - */
    -PIXI.BaseTexture.prototype.updateSourceImage = function(newSrc)
    -{
    -    this.hasLoaded = false;
    -    this.source.src = null;
    -    this.source.src = newSrc;
    -};
    -
    -/**
    - * Sets all glTextures to be dirty.
    - *
    - * @method dirty
    - */
    -PIXI.BaseTexture.prototype.dirty = function()
    -{
    -    for (var i = 0; i < this._glTextures.length; i++)
    -    {
    -        this._dirty[i] = true;
    -    }
    -};
    -
    -/**
    - * Removes the base texture from the GPU, useful for managing resources on the GPU.
    - * Atexture is still 100% usable and will simply be reuploaded if there is a sprite on screen that is using it.
    - *
    - * @method unloadFromGPU
    - */
    -PIXI.BaseTexture.prototype.unloadFromGPU = function()
    -{
    -    this.dirty();
    -
    -    // delete the webGL textures if any.
    -    for (var i = this._glTextures.length - 1; i >= 0; i--)
    -    {
    -        var glTexture = this._glTextures[i];
    -        var gl = PIXI.glContexts[i];
    -
    -        if(gl && glTexture)
    -        {
    -            gl.deleteTexture(glTexture);
    -        }
    -        
    -    }
    -
    -    this._glTextures.length = 0;
    -
    -    this.dirty();
    -};
    -
    -/**
    - * Helper function that creates a base texture from the given image url.
    - * If the image is not in the base texture cache it will be created and loaded.
    - *
    - * @static
    - * @method fromImage
    - * @param imageUrl {String} The image url of the texture
    - * @param crossorigin {Boolean}
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @return BaseTexture
    - */
    -PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode)
    -{
    -    var baseTexture = PIXI.BaseTextureCache[imageUrl];
    -
    -    if(crossorigin === undefined && imageUrl.indexOf('data:') === -1) crossorigin = true;
    -
    -    if(!baseTexture)
    -    {
    -        // new Image() breaks tex loading in some versions of Chrome.
    -        // See https://code.google.com/p/chromium/issues/detail?id=238071
    -        var image = new Image();//document.createElement('img');
    -        if (crossorigin)
    -        {
    -            image.crossOrigin = '';
    -        }
    -
    -        image.src = imageUrl;
    -        baseTexture = new PIXI.BaseTexture(image, scaleMode);
    -        baseTexture.imageUrl = imageUrl;
    -        PIXI.BaseTextureCache[imageUrl] = baseTexture;
    -
    -        // if there is an @2x at the end of the url we are going to assume its a highres image
    -        if( imageUrl.indexOf(PIXI.RETINA_PREFIX + '.') !== -1)
    -        {
    -            baseTexture.resolution = 2;
    -        }
    -    }
    -
    -    return baseTexture;
    -};
    -
    -/**
    - * Helper function that creates a base texture from the given canvas element.
    - *
    - * @static
    - * @method fromCanvas
    - * @param canvas {Canvas} The canvas element source of the texture
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @return BaseTexture
    - */
    -PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode)
    -{
    -    if(!canvas._pixiId)
    -    {
    -        canvas._pixiId = 'canvas_' + PIXI.TextureCacheIdGenerator++;
    -    }
    -
    -    var baseTexture = PIXI.BaseTextureCache[canvas._pixiId];
    -
    -    if(!baseTexture)
    -    {
    -        baseTexture = new PIXI.BaseTexture(canvas, scaleMode);
    -        PIXI.BaseTextureCache[canvas._pixiId] = baseTexture;
    -    }
    -
    -    return baseTexture;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_textures_RenderTexture.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_textures_RenderTexture.js.html deleted file mode 100755 index 23c4f84..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_textures_RenderTexture.js.html +++ /dev/null @@ -1,614 +0,0 @@ - - - - - src/pixi/textures/RenderTexture.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/textures/RenderTexture.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A RenderTexture is a special texture that allows any Pixi display object to be rendered to it.
    - *
    - * __Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead.
    - *
    - * A RenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example:
    - *
    - *    var renderTexture = new PIXI.RenderTexture(800, 600);
    - *    var sprite = PIXI.Sprite.fromImage("spinObj_01.png");
    - *    sprite.position.x = 800/2;
    - *    sprite.position.y = 600/2;
    - *    sprite.anchor.x = 0.5;
    - *    sprite.anchor.y = 0.5;
    - *    renderTexture.render(sprite);
    - *
    - * The Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual position a DisplayObjectContainer should be used:
    - *
    - *    var doc = new PIXI.DisplayObjectContainer();
    - *    doc.addChild(sprite);
    - *    renderTexture.render(doc);  // Renders to center of renderTexture
    - *
    - * @class RenderTexture
    - * @extends Texture
    - * @constructor
    - * @param width {Number} The width of the render texture
    - * @param height {Number} The height of the render texture
    - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @param resolution {Number} The resolution of the texture being generated
    - */
    -PIXI.RenderTexture = function(width, height, renderer, scaleMode, resolution)
    -{
    -    /**
    -     * The with of the render texture
    -     *
    -     * @property width
    -     * @type Number
    -     */
    -    this.width = width || 100;
    -
    -    /**
    -     * The height of the render texture
    -     *
    -     * @property height
    -     * @type Number
    -     */
    -    this.height = height || 100;
    -
    -    /**
    -     * The Resolution of the texture.
    -     *
    -     * @property resolution
    -     * @type Number
    -     */
    -    this.resolution = resolution || 1;
    -
    -    /**
    -     * The framing rectangle of the render texture
    -     *
    -     * @property frame
    -     * @type Rectangle
    -     */
    -    this.frame = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution);
    -
    -    /**
    -     * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,
    -     * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)
    -     *
    -     * @property crop
    -     * @type Rectangle
    -     */
    -    this.crop = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution);
    -
    -    /**
    -     * The base texture object that this texture uses
    -     *
    -     * @property baseTexture
    -     * @type BaseTexture
    -     */
    -    this.baseTexture = new PIXI.BaseTexture();
    -    this.baseTexture.width = this.width * this.resolution;
    -    this.baseTexture.height = this.height * this.resolution;
    -    this.baseTexture._glTextures = [];
    -    this.baseTexture.resolution = this.resolution;
    -
    -    this.baseTexture.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT;
    -
    -    this.baseTexture.hasLoaded = true;
    -
    -    PIXI.Texture.call(this,
    -        this.baseTexture,
    -        new PIXI.Rectangle(0, 0, this.width, this.height)
    -    );
    -
    -    /**
    -     * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL.
    -     *
    -     * @property renderer
    -     * @type CanvasRenderer|WebGLRenderer
    -     */
    -    this.renderer = renderer || PIXI.defaultRenderer;
    -
    -    if(this.renderer.type === PIXI.WEBGL_RENDERER)
    -    {
    -        var gl = this.renderer.gl;
    -        this.baseTexture._dirty[gl.id] = false;
    -
    -        this.textureBuffer = new PIXI.FilterTexture(gl, this.width * this.resolution, this.height * this.resolution, this.baseTexture.scaleMode);
    -        this.baseTexture._glTextures[gl.id] =  this.textureBuffer.texture;
    -
    -        this.render = this.renderWebGL;
    -        this.projection = new PIXI.Point(this.width*0.5, -this.height*0.5);
    -    }
    -    else
    -    {
    -        this.render = this.renderCanvas;
    -        this.textureBuffer = new PIXI.CanvasBuffer(this.width* this.resolution, this.height* this.resolution);
    -        this.baseTexture.source = this.textureBuffer.canvas;
    -    }
    -
    -    /**
    -     * @property valid
    -     * @type Boolean
    -     */
    -    this.valid = true;
    -
    -    this._updateUvs();
    -};
    -
    -PIXI.RenderTexture.prototype = Object.create(PIXI.Texture.prototype);
    -PIXI.RenderTexture.prototype.constructor = PIXI.RenderTexture;
    -
    -/**
    - * Resizes the RenderTexture.
    - *
    - * @method resize
    - * @param width {Number} The width to resize to.
    - * @param height {Number} The height to resize to.
    - * @param updateBase {Boolean} Should the baseTexture.width and height values be resized as well?
    - */
    -PIXI.RenderTexture.prototype.resize = function(width, height, updateBase)
    -{
    -    if (width === this.width && height === this.height)return;
    -
    -    this.valid = (width > 0 && height > 0);
    -
    -    this.width = this.frame.width = this.crop.width = width;
    -    this.height =  this.frame.height = this.crop.height = height;
    -
    -    if (updateBase)
    -    {
    -        this.baseTexture.width = this.width;
    -        this.baseTexture.height = this.height;
    -    }
    -
    -    if (this.renderer.type === PIXI.WEBGL_RENDERER)
    -    {
    -        this.projection.x = this.width / 2;
    -        this.projection.y = -this.height / 2;
    -    }
    -
    -    if(!this.valid)return;
    -
    -    this.textureBuffer.resize(this.width * this.resolution, this.height * this.resolution);
    -};
    -
    -/**
    - * Clears the RenderTexture.
    - *
    - * @method clear
    - */
    -PIXI.RenderTexture.prototype.clear = function()
    -{
    -    if(!this.valid)return;
    -
    -    if (this.renderer.type === PIXI.WEBGL_RENDERER)
    -    {
    -        this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer);
    -    }
    -
    -    this.textureBuffer.clear();
    -};
    -
    -/**
    - * This function will draw the display object to the texture.
    - *
    - * @method renderWebGL
    - * @param displayObject {DisplayObject} The display object to render this texture on
    - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering.
    - * @param [clear] {Boolean} If true the texture will be cleared before the displayObject is drawn
    - * @private
    - */
    -PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, matrix, clear)
    -{
    -    if(!this.valid)return;
    -    //TOOD replace position with matrix..
    -   
    -    //Lets create a nice matrix to apply to our display object. Frame buffers come in upside down so we need to flip the matrix 
    -    var wt = displayObject.worldTransform;
    -    wt.identity();
    -    wt.translate(0, this.projection.y * 2);
    -    if(matrix)wt.append(matrix);
    -    wt.scale(1,-1);
    -
    -    // setWorld Alpha to ensure that the object is renderer at full opacity
    -    displayObject.worldAlpha = 1;
    -
    -    // Time to update all the children of the displayObject with the new matrix..    
    -    var children = displayObject.children;
    -
    -    for(var i=0,j=children.length; i<j; i++)
    -    {
    -        children[i].updateTransform();
    -    }
    -    
    -    // time for the webGL fun stuff!
    -    var gl = this.renderer.gl;
    -
    -    gl.viewport(0, 0, this.width * this.resolution, this.height * this.resolution);
    -
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, this.textureBuffer.frameBuffer );
    -
    -    if(clear)this.textureBuffer.clear();
    -
    -    this.renderer.spriteBatch.dirty = true;
    -
    -    this.renderer.renderDisplayObject(displayObject, this.projection, this.textureBuffer.frameBuffer);
    -
    -    this.renderer.spriteBatch.dirty = true;
    -};
    -
    -
    -/**
    - * This function will draw the display object to the texture.
    - *
    - * @method renderCanvas
    - * @param displayObject {DisplayObject} The display object to render this texture on
    - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering.
    - * @param [clear] {Boolean} If true the texture will be cleared before the displayObject is drawn
    - * @private
    - */
    -PIXI.RenderTexture.prototype.renderCanvas = function(displayObject, matrix, clear)
    -{
    -    if(!this.valid)return;
    -
    -    var wt = displayObject.worldTransform;
    -    wt.identity();
    -    if(matrix)wt.append(matrix);
    -    
    -    // setWorld Alpha to ensure that the object is renderer at full opacity
    -    displayObject.worldAlpha = 1;
    -
    -    // Time to update all the children of the displayObject with the new matrix..    
    -    var children = displayObject.children;
    -
    -    for(var i = 0, j = children.length; i < j; i++)
    -    {
    -        children[i].updateTransform();
    -    }
    -
    -    if(clear)this.textureBuffer.clear();
    -
    -    var context = this.textureBuffer.context;
    -
    -    var realResolution = this.renderer.resolution;
    -
    -    this.renderer.resolution = this.resolution;
    -
    -    this.renderer.renderDisplayObject(displayObject, context);
    -
    -    this.renderer.resolution = realResolution;
    -};
    -
    -/**
    - * Will return a HTML Image of the texture
    - *
    - * @method getImage
    - * @return {Image}
    - */
    -PIXI.RenderTexture.prototype.getImage = function()
    -{
    -    var image = new Image();
    -    image.src = this.getBase64();
    -    return image;
    -};
    -
    -/**
    - * Will return a a base64 encoded string of this texture. It works by calling RenderTexture.getCanvas and then running toDataURL on that.
    - *
    - * @method getBase64
    - * @return {String} A base64 encoded string of the texture.
    - */
    -PIXI.RenderTexture.prototype.getBase64 = function()
    -{
    -    return this.getCanvas().toDataURL();
    -};
    -
    -/**
    - * Creates a Canvas element, renders this RenderTexture to it and then returns it.
    - *
    - * @method getCanvas
    - * @return {HTMLCanvasElement} A Canvas element with the texture rendered on.
    - */
    -PIXI.RenderTexture.prototype.getCanvas = function()
    -{
    -    if (this.renderer.type === PIXI.WEBGL_RENDERER)
    -    {
    -        var gl =  this.renderer.gl;
    -        var width = this.textureBuffer.width;
    -        var height = this.textureBuffer.height;
    -
    -        var webGLPixels = new Uint8Array(4 * width * height);
    -
    -        gl.bindFramebuffer(gl.FRAMEBUFFER, this.textureBuffer.frameBuffer);
    -        gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, webGLPixels);
    -        gl.bindFramebuffer(gl.FRAMEBUFFER, null);
    -
    -        var tempCanvas = new PIXI.CanvasBuffer(width, height);
    -        var canvasData = tempCanvas.context.getImageData(0, 0, width, height);
    -        canvasData.data.set(webGLPixels);
    -
    -        tempCanvas.context.putImageData(canvasData, 0, 0);
    -
    -        return tempCanvas.canvas;
    -    }
    -    else
    -    {
    -        return this.textureBuffer.canvas;
    -    }
    -};
    -
    -PIXI.RenderTexture.tempMatrix = new PIXI.Matrix();
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_textures_Texture.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_textures_Texture.js.html deleted file mode 100755 index 179da16..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_textures_Texture.js.html +++ /dev/null @@ -1,607 +0,0 @@ - - - - - src/pixi/textures/Texture.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/textures/Texture.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -PIXI.TextureCache = {};
    -PIXI.FrameCache = {};
    -
    -PIXI.TextureCacheIdGenerator = 0;
    -
    -/**
    - * A texture stores the information that represents an image or part of an image. It cannot be added
    - * to the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used.
    - *
    - * @class Texture
    - * @uses EventTarget
    - * @constructor
    - * @param baseTexture {BaseTexture} The base texture source to create the texture from
    - * @param frame {Rectangle} The rectangle frame of the texture to show
    - * @param [crop] {Rectangle} The area of original texture 
    - * @param [trim] {Rectangle} Trimmed texture rectangle
    - */
    -PIXI.Texture = function(baseTexture, frame, crop, trim)
    -{
    -    /**
    -     * Does this Texture have any frame data assigned to it?
    -     *
    -     * @property noFrame
    -     * @type Boolean
    -     */
    -    this.noFrame = false;
    -
    -    if (!frame)
    -    {
    -        this.noFrame = true;
    -        frame = new PIXI.Rectangle(0,0,1,1);
    -    }
    -
    -    if (baseTexture instanceof PIXI.Texture)
    -    {
    -        baseTexture = baseTexture.baseTexture;
    -    }
    -
    -    /**
    -     * The base texture that this texture uses.
    -     *
    -     * @property baseTexture
    -     * @type BaseTexture
    -     */
    -    this.baseTexture = baseTexture;
    -
    -    /**
    -     * The frame specifies the region of the base texture that this texture uses
    -     *
    -     * @property frame
    -     * @type Rectangle
    -     */
    -    this.frame = frame;
    -
    -    /**
    -     * The texture trim data.
    -     *
    -     * @property trim
    -     * @type Rectangle
    -     */
    -    this.trim = trim;
    -
    -    /**
    -     * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.
    -     *
    -     * @property valid
    -     * @type Boolean
    -     */
    -    this.valid = false;
    -
    -    /**
    -     * This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)
    -     *
    -     * @property requiresUpdate
    -     * @type Boolean
    -     */
    -    this.requiresUpdate = false;
    -
    -    /**
    -     * The WebGL UV data cache.
    -     *
    -     * @property _uvs
    -     * @type Object
    -     * @private
    -     */
    -    this._uvs = null;
    -
    -    /**
    -     * The width of the Texture in pixels.
    -     *
    -     * @property width
    -     * @type Number
    -     */
    -    this.width = 0;
    -
    -    /**
    -     * The height of the Texture in pixels.
    -     *
    -     * @property height
    -     * @type Number
    -     */
    -    this.height = 0;
    -
    -    /**
    -     * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,
    -     * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)
    -     *
    -     * @property crop
    -     * @type Rectangle
    -     */
    -    this.crop = crop || new PIXI.Rectangle(0, 0, 1, 1);
    -
    -    if (baseTexture.hasLoaded)
    -    {
    -        if (this.noFrame) frame = new PIXI.Rectangle(0, 0, baseTexture.width, baseTexture.height);
    -        this.setFrame(frame);
    -    }
    -    else
    -    {
    -        baseTexture.addEventListener('loaded', this.onBaseTextureLoaded.bind(this));
    -    }
    -};
    -
    -PIXI.Texture.prototype.constructor = PIXI.Texture;
    -PIXI.EventTarget.mixin(PIXI.Texture.prototype);
    -
    -/**
    - * Called when the base texture is loaded
    - *
    - * @method onBaseTextureLoaded
    - * @private
    - */
    -PIXI.Texture.prototype.onBaseTextureLoaded = function()
    -{
    -    var baseTexture = this.baseTexture;
    -    baseTexture.removeEventListener('loaded', this.onLoaded);
    -
    -    if (this.noFrame) this.frame = new PIXI.Rectangle(0, 0, baseTexture.width, baseTexture.height);
    -
    -    this.setFrame(this.frame);
    -
    -    this.dispatchEvent( { type: 'update', content: this } );
    -};
    -
    -/**
    - * Destroys this texture
    - *
    - * @method destroy
    - * @param destroyBase {Boolean} Whether to destroy the base texture as well
    - */
    -PIXI.Texture.prototype.destroy = function(destroyBase)
    -{
    -    if (destroyBase) this.baseTexture.destroy();
    -
    -    this.valid = false;
    -};
    -
    -/**
    - * Specifies the region of the baseTexture that this texture will use.
    - *
    - * @method setFrame
    - * @param frame {Rectangle} The frame of the texture to set it to
    - */
    -PIXI.Texture.prototype.setFrame = function(frame)
    -{
    -    this.noFrame = false;
    -
    -    this.frame = frame;
    -    this.width = frame.width;
    -    this.height = frame.height;
    -
    -    this.crop.x = frame.x;
    -    this.crop.y = frame.y;
    -    this.crop.width = frame.width;
    -    this.crop.height = frame.height;
    -
    -    if (!this.trim && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height))
    -    {
    -        throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this);
    -    }
    -
    -    this.valid = frame && frame.width && frame.height && this.baseTexture.source && this.baseTexture.hasLoaded;
    -
    -    if (this.trim)
    -    {
    -        this.width = this.trim.width;
    -        this.height = this.trim.height;
    -        this.frame.width = this.trim.width;
    -        this.frame.height = this.trim.height;
    -    }
    -    
    -    if (this.valid) this._updateUvs();
    -
    -};
    -
    -/**
    - * Updates the internal WebGL UV cache.
    - *
    - * @method _updateUvs
    - * @private
    - */
    -PIXI.Texture.prototype._updateUvs = function()
    -{
    -    if(!this._uvs)this._uvs = new PIXI.TextureUvs();
    -
    -    var frame = this.crop;
    -    var tw = this.baseTexture.width;
    -    var th = this.baseTexture.height;
    -    
    -    this._uvs.x0 = frame.x / tw;
    -    this._uvs.y0 = frame.y / th;
    -
    -    this._uvs.x1 = (frame.x + frame.width) / tw;
    -    this._uvs.y1 = frame.y / th;
    -
    -    this._uvs.x2 = (frame.x + frame.width) / tw;
    -    this._uvs.y2 = (frame.y + frame.height) / th;
    -
    -    this._uvs.x3 = frame.x / tw;
    -    this._uvs.y3 = (frame.y + frame.height) / th;
    -};
    -
    -/**
    - * Helper function that creates a Texture object from the given image url.
    - * If the image is not in the texture cache it will be  created and loaded.
    - *
    - * @static
    - * @method fromImage
    - * @param imageUrl {String} The image url of the texture
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @return Texture
    - */
    -PIXI.Texture.fromImage = function(imageUrl, crossorigin, scaleMode)
    -{
    -    var texture = PIXI.TextureCache[imageUrl];
    -
    -    if(!texture)
    -    {
    -        texture = new PIXI.Texture(PIXI.BaseTexture.fromImage(imageUrl, crossorigin, scaleMode));
    -        PIXI.TextureCache[imageUrl] = texture;
    -    }
    -
    -    return texture;
    -};
    -
    -/**
    - * Helper function that returns a Texture objected based on the given frame id.
    - * If the frame id is not in the texture cache an error will be thrown.
    - *
    - * @static
    - * @method fromFrame
    - * @param frameId {String} The frame id of the texture
    - * @return Texture
    - */
    -PIXI.Texture.fromFrame = function(frameId)
    -{
    -    var texture = PIXI.TextureCache[frameId];
    -    if(!texture) throw new Error('The frameId "' + frameId + '" does not exist in the texture cache ');
    -    return texture;
    -};
    -
    -/**
    - * Helper function that creates a new a Texture based on the given canvas element.
    - *
    - * @static
    - * @method fromCanvas
    - * @param canvas {Canvas} The canvas element source of the texture
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @return Texture
    - */
    -PIXI.Texture.fromCanvas = function(canvas, scaleMode)
    -{
    -    var baseTexture = PIXI.BaseTexture.fromCanvas(canvas, scaleMode);
    -
    -    return new PIXI.Texture( baseTexture );
    -
    -};
    -
    -/**
    - * Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object.
    - *
    - * @static
    - * @method addTextureToCache
    - * @param texture {Texture} The Texture to add to the cache.
    - * @param id {String} The id that the texture will be stored against.
    - */
    -PIXI.Texture.addTextureToCache = function(texture, id)
    -{
    -    PIXI.TextureCache[id] = texture;
    -};
    -
    -/**
    - * Remove a texture from the global PIXI.TextureCache.
    - *
    - * @static
    - * @method removeTextureFromCache
    - * @param id {String} The id of the texture to be removed
    - * @return {Texture} The texture that was removed
    - */
    -PIXI.Texture.removeTextureFromCache = function(id)
    -{
    -    var texture = PIXI.TextureCache[id];
    -    delete PIXI.TextureCache[id];
    -    delete PIXI.BaseTextureCache[id];
    -    return texture;
    -};
    -
    -PIXI.TextureUvs = function()
    -{
    -    this.x0 = 0;
    -    this.y0 = 0;
    -
    -    this.x1 = 0;
    -    this.y1 = 0;
    -
    -    this.x2 = 0;
    -    this.y2 = 0;
    -
    -    this.x3 = 0;
    -    this.y3 = 0;
    -};
    -
    -PIXI.Texture.emptyTexture = new PIXI.Texture(new PIXI.BaseTexture());
    -
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_textures_VideoTexture.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_textures_VideoTexture.js.html deleted file mode 100755 index 4e746c8..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_textures_VideoTexture.js.html +++ /dev/null @@ -1,424 +0,0 @@ - - - - - src/pixi/textures/VideoTexture.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/textures/VideoTexture.js

    - -
    -
    -
    -PIXI.VideoTexture = function( source, scaleMode )
    -{
    -    if( !source ){
    -        throw new Error( 'No video source element specified.' );
    -    }
    -
    -    // hook in here to check if video is already available.
    -    // PIXI.BaseTexture looks for a source.complete boolean, plus width & height.
    -
    -    if( (source.readyState === source.HAVE_ENOUGH_DATA || source.readyState === source.HAVE_FUTURE_DATA ) && source.width && source.height )
    -    {
    -        source.complete = true;
    -    }
    -
    -    PIXI.BaseTexture.call( this, source, scaleMode );
    -
    -    this.autoUpdate = false;
    -    this.updateBound = this._onUpdate.bind(this);
    -
    -    if( !source.complete )
    -    {
    -        this._onCanPlay = this.onCanPlay.bind(this);
    -
    -        source.addEventListener( 'canplay', this._onCanPlay );
    -        source.addEventListener( 'canplaythrough', this._onCanPlay );
    -
    -        // started playing..
    -        source.addEventListener( 'play', this.onPlayStart.bind(this) );
    -        source.addEventListener( 'pause', this.onPlayStop.bind(this) );
    -    }
    -
    -};
    -
    -PIXI.VideoTexture.prototype   = Object.create( PIXI.BaseTexture.prototype );
    -
    -PIXI.VideoTexture.constructor = PIXI.VideoTexture;
    -
    -PIXI.VideoTexture.prototype._onUpdate = function()
    -{
    -    if(this.autoUpdate)
    -    {
    -        window.requestAnimationFrame(this.updateBound);
    -        this.dirty();
    -    }
    -};
    -
    -PIXI.VideoTexture.prototype.onPlayStart = function()
    -{
    -    if(!this.autoUpdate)
    -    {
    -        window.requestAnimationFrame(this.updateBound);
    -        this.autoUpdate = true;
    -    }
    -};
    -
    -PIXI.VideoTexture.prototype.onPlayStop = function()
    -{
    -    this.autoUpdate = false;
    -};
    -
    -PIXI.VideoTexture.prototype.onCanPlay = function()
    -{
    -    if( event.type === 'canplaythrough' )
    -    {
    -        this.hasLoaded  = true;
    -
    -
    -        if( this.source )
    -        {
    -            this.source.removeEventListener( 'canplay', this._onCanPlay );
    -            this.source.removeEventListener( 'canplaythrough', this._onCanPlay );
    -
    -            this.width      = this.source.videoWidth;
    -            this.height     = this.source.videoHeight;
    -
    -            // prevent multiple loaded dispatches..
    -            if( !this.__loaded ){
    -                this.__loaded = true;
    -                this.dispatchEvent( { type: 'loaded', content: this } );
    -            }
    -        }
    -    }
    -};
    -
    -
    -/**
    - * Mimic Pixi BaseTexture.from.... method.
    - * @param video
    - * @param scaleMode
    - * @returns {PIXI.VideoTexture}
    - */
    -PIXI.VideoTexture.baseTextureFromVideo = function( video, scaleMode )
    -{
    -    if( !video._pixiId )
    -    {
    -        video._pixiId = 'video_' + PIXI.TextureCacheIdGenerator++;
    -    }
    -
    -    var baseTexture = PIXI.BaseTextureCache[ video._pixiId ];
    -
    -    if( !baseTexture )
    -    {
    -        baseTexture = new PIXI.VideoTexture( video, scaleMode );
    -        PIXI.BaseTextureCache[ video._pixiId ] = baseTexture;
    -    }
    -
    -    return baseTexture;
    -};
    -
    -
    -PIXI.VideoTexture.prototype.destroy = function()
    -{
    -    if( this.source && this.source._pixiId )
    -    {
    -        PIXI.BaseTextureCache[ this.source._pixiId ] = null;
    -        delete PIXI.BaseTextureCache[ this.source._pixiId ];
    -
    -        this.source._pixiId = null;
    -        delete this.source._pixiId;
    -    }
    -
    -    PIXI.BaseTexture.prototype.destroy.call( this );
    -};
    -
    -/**
    - * Mimic PIXI Texture.from... method.
    - * @param video
    - * @param scaleMode
    - * @returns {PIXI.Texture}
    - */
    -PIXI.VideoTexture.textureFromVideo = function( video, scaleMode )
    -{
    -    var baseTexture = PIXI.VideoTexture.baseTextureFromVideo( video, scaleMode );
    -    return new PIXI.Texture( baseTexture );
    -};
    -
    -PIXI.VideoTexture.fromUrl = function( videoSrc, scaleMode )
    -{
    -    var video = document.createElement('video');
    -    video.src = videoSrc;
    -    video.autoPlay = true;
    -    video.play();
    -    return PIXI.VideoTexture.textureFromVideo( video, scaleMode);
    -};
    -
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_utils_Detector.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_utils_Detector.js.html deleted file mode 100755 index 3e9861a..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_utils_Detector.js.html +++ /dev/null @@ -1,363 +0,0 @@ - - - - - src/pixi/utils/Detector.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/utils/Detector.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This helper function will automatically detect which renderer you should be using.
    - * WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by
    - * the browser then this function will return a canvas renderer
    - * @class autoDetectRenderer
    - * @static
    - * @param width=800 {Number} the width of the renderers view
    - * @param height=600 {Number} the height of the renderers view
    - * 
    - * @param [options] {Object} The optional renderer parameters
    - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional
    - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false
    - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment)
    - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context
    - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2
    - * 
    - */
    -PIXI.autoDetectRenderer = function(width, height, options)
    -{
    -    if(!width)width = 800;
    -    if(!height)height = 600;
    -
    -    // BORROWED from Mr Doob (mrdoob.com)
    -    var webgl = ( function () { try {
    -                                    var canvas = document.createElement( 'canvas' );
    -                                    return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) );
    -                                } catch( e ) {
    -                                    return false;
    -                                }
    -                            } )();
    -
    -    if( webgl )
    -    {
    -        return new PIXI.WebGLRenderer(width, height, options);
    -    }
    -
    -    return  new PIXI.CanvasRenderer(width, height, options);
    -};
    -
    -/**
    - * This helper function will automatically detect which renderer you should be using.
    - * This function is very similar to the autoDetectRenderer function except that is will return a canvas renderer for android.
    - * Even thought both android chrome supports webGL the canvas implementation perform better at the time of writing. 
    - * This function will likely change and update as webGL performance improves on these devices.
    - * 
    - * @class autoDetectRecommendedRenderer
    - * @static
    - * @param width=800 {Number} the width of the renderers view
    - * @param height=600 {Number} the height of the renderers view
    - * 
    - * @param [options] {Object} The optional renderer parameters
    - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional
    - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false
    - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment)
    - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context
    - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2
    - * 
    - */
    -PIXI.autoDetectRecommendedRenderer = function(width, height, options)
    -{
    -    if(!width)width = 800;
    -    if(!height)height = 600;
    -
    -    // BORROWED from Mr Doob (mrdoob.com)
    -    var webgl = ( function () { try {
    -                                    var canvas = document.createElement( 'canvas' );
    -                                    return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) );
    -                                } catch( e ) {
    -                                    return false;
    -                                }
    -                            } )();
    -
    -    var isAndroid = /Android/i.test(navigator.userAgent);
    -
    -    if( webgl && !isAndroid)
    -    {
    -        return new PIXI.WebGLRenderer(width, height, options);
    -    }
    -
    -    return  new PIXI.CanvasRenderer(width, height, options);
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_utils_EventTarget.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_utils_EventTarget.js.html deleted file mode 100755 index 39afb18..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_utils_EventTarget.js.html +++ /dev/null @@ -1,562 +0,0 @@ - - - - - src/pixi/utils/EventTarget.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/utils/EventTarget.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * @author Chad Engler https://github.com/englercj @Rolnaaba
    - */
    -
    -/**
    - * Originally based on https://github.com/mrdoob/eventtarget.js/ from mr Doob.
    - * Currently takes inspiration from the nodejs EventEmitter, EventEmitter3, and smokesignals
    - */
    -
    -/**
    - * Mixins event emitter functionality to a class
    - *
    - * @class EventTarget
    - * @example
    - *      function MyEmitter() {}
    - *
    - *      PIXI.EventTarget.mixin(MyEmitter.prototype);
    - *
    - *      var em = new MyEmitter();
    - *      em.emit('eventName', 'some data', 'some more data', {}, null, ...);
    - */
    -PIXI.EventTarget = {
    -    /**
    -     * Backward compat from when this used to be a function
    -     */
    -    call: function callCompat(obj) {
    -        if(obj) {
    -            obj = obj.prototype || obj;
    -            PIXI.EventTarget.mixin(obj);
    -        }
    -    },
    -
    -    /**
    -     * Mixes in the properties of the EventTarget prototype onto another object
    -     *
    -     * @method mixin
    -     * @param object {Object} The obj to mix into
    -     */
    -    mixin: function mixin(obj) {
    -        /**
    -         * Return a list of assigned event listeners.
    -         *
    -         * @method listeners
    -         * @param eventName {String} The events that should be listed.
    -         * @returns {Array} An array of listener functions
    -         */
    -        obj.listeners = function listeners(eventName) {
    -            this._listeners = this._listeners || {};
    -
    -            return this._listeners[eventName] ? this._listeners[eventName].slice() : [];
    -        };
    -
    -        /**
    -         * Emit an event to all registered event listeners.
    -         *
    -         * @method emit
    -         * @alias dispatchEvent
    -         * @param eventName {String} The name of the event.
    -         * @returns {Boolean} Indication if we've emitted an event.
    -         */
    -        obj.emit = obj.dispatchEvent = function emit(eventName, data) {
    -            this._listeners = this._listeners || {};
    -
    -            //backwards compat with old method ".emit({ type: 'something' })"
    -            if(typeof eventName === 'object') {
    -                data = eventName;
    -                eventName = eventName.type;
    -            }
    -
    -            //ensure we are using a real pixi event
    -            if(!data || data.__isEventObject !== true) {
    -                data = new PIXI.Event(this, eventName, data);
    -            }
    -
    -            //iterate the listeners
    -            if(this._listeners && this._listeners[eventName]) {
    -                var listeners = this._listeners[eventName].slice(0),
    -                    length = listeners.length,
    -                    fn = listeners[0],
    -                    i;
    -
    -                for(i = 0; i < length; fn = listeners[++i]) {
    -                    //call the event listener
    -                    fn.call(this, data);
    -
    -                    //if "stopImmediatePropagation" is called, stop calling sibling events
    -                    if(data.stoppedImmediate) {
    -                        return this;
    -                    }
    -                }
    -
    -                //if "stopPropagation" is called then don't bubble the event
    -                if(data.stopped) {
    -                    return this;
    -                }
    -            }
    -
    -            //bubble this event up the scene graph
    -            if(this.parent && this.parent.emit) {
    -                this.parent.emit.call(this.parent, eventName, data);
    -            }
    -
    -            return this;
    -        };
    -
    -        /**
    -         * Register a new EventListener for the given event.
    -         *
    -         * @method on
    -         * @alias addEventListener
    -         * @param eventName {String} Name of the event.
    -         * @param callback {Functon} fn Callback function.
    -         */
    -        obj.on = obj.addEventListener = function on(eventName, fn) {
    -            this._listeners = this._listeners || {};
    -
    -            (this._listeners[eventName] = this._listeners[eventName] || [])
    -                .push(fn);
    -
    -            return this;
    -        };
    -
    -        /**
    -         * Add an EventListener that's only called once.
    -         *
    -         * @method once
    -         * @param eventName {String} Name of the event.
    -         * @param callback {Function} Callback function.
    -         */
    -        obj.once = function once(eventName, fn) {
    -            this._listeners = this._listeners || {};
    -
    -            var self = this;
    -            function onceHandlerWrapper() {
    -                fn.apply(self.off(eventName, onceHandlerWrapper), arguments);
    -            }
    -            onceHandlerWrapper._originalHandler = fn;
    -
    -            return this.on(eventName, onceHandlerWrapper);
    -        };
    -
    -        /**
    -         * Remove event listeners.
    -         *
    -         * @method off
    -         * @alias removeEventListener
    -         * @param eventName {String} The event we want to remove.
    -         * @param callback {Function} The listener that we need to find.
    -         */
    -        obj.off = obj.removeEventListener = function off(eventName, fn) {
    -            this._listeners = this._listeners || {};
    -
    -            if(!this._listeners[eventName])
    -                return this;
    -
    -            var list = this._listeners[eventName],
    -                i = fn ? list.length : 0;
    -
    -            while(i-- > 0) {
    -                if(list[i] === fn || list[i]._originalHandler === fn) {
    -                    list.splice(i, 1);
    -                }
    -            }
    -
    -            if(list.length === 0) {
    -                delete this._listeners[eventName];
    -            }
    -
    -            return this;
    -        };
    -
    -        /**
    -         * Remove all listeners or only the listeners for the specified event.
    -         *
    -         * @method removeAllListeners
    -         * @param eventName {String} The event you want to remove all listeners for.
    -         */
    -        obj.removeAllListeners = function removeAllListeners(eventName) {
    -            this._listeners = this._listeners || {};
    -
    -            if(!this._listeners[eventName])
    -                return this;
    -
    -            delete this._listeners[eventName];
    -
    -            return this;
    -        };
    -    }
    -};
    -
    -/**
    - * Creates an homogenous object for tracking events so users can know what to expect.
    - *
    - * @class Event
    - * @extends Object
    - * @constructor
    - * @param target {Object} The target object that the event is called on
    - * @param name {String} The string name of the event that was triggered
    - * @param data {Object} Arbitrary event data to pass along
    - */
    -PIXI.Event = function(target, name, data) {
    -    //for duck typing in the ".on()" function
    -    this.__isEventObject = true;
    -
    -    /**
    -     * Tracks the state of bubbling propagation. Do not
    -     * set this directly, instead use `event.stopPropagation()`
    -     *
    -     * @property stopped
    -     * @type Boolean
    -     * @private
    -     * @readOnly
    -     */
    -    this.stopped = false;
    -
    -    /**
    -     * Tracks the state of sibling listener propagation. Do not
    -     * set this directly, instead use `event.stopImmediatePropagation()`
    -     *
    -     * @property stoppedImmediate
    -     * @type Boolean
    -     * @private
    -     * @readOnly
    -     */
    -    this.stoppedImmediate = false;
    -
    -    /**
    -     * The original target the event triggered on.
    -     *
    -     * @property target
    -     * @type Object
    -     * @readOnly
    -     */
    -    this.target = target;
    -
    -    /**
    -     * The string name of the event that this represents.
    -     *
    -     * @property type
    -     * @type String
    -     * @readOnly
    -     */
    -    this.type = name;
    -
    -    /**
    -     * The data that was passed in with this event.
    -     *
    -     * @property data
    -     * @type Object
    -     * @readOnly
    -     */
    -    this.data = data;
    -
    -    //backwards compat with older version of events
    -    this.content = data;
    -
    -    /**
    -     * The timestamp when the event occurred.
    -     *
    -     * @property timeStamp
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.timeStamp = Date.now();
    -};
    -
    -/**
    - * Stops the propagation of events up the scene graph (prevents bubbling).
    - *
    - * @method stopPropagation
    - */
    -PIXI.Event.prototype.stopPropagation = function stopPropagation() {
    -    this.stopped = true;
    -};
    -
    -/**
    - * Stops the propagation of events to sibling listeners (no longer calls any listeners).
    - *
    - * @method stopImmediatePropagation
    - */
    -PIXI.Event.prototype.stopImmediatePropagation = function stopImmediatePropagation() {
    -    this.stoppedImmediate = true;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_utils_Polyk.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_utils_Polyk.js.html deleted file mode 100755 index a0a2226..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_utils_Polyk.js.html +++ /dev/null @@ -1,446 +0,0 @@ - - - - - src/pixi/utils/Polyk.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/utils/Polyk.js

    - -
    -
    -/*
    -    PolyK library
    -    url: http://polyk.ivank.net
    -    Released under MIT licence.
    -
    -    Copyright (c) 2012 Ivan Kuckir
    -
    -    Permission is hereby granted, free of charge, to any person
    -    obtaining a copy of this software and associated documentation
    -    files (the "Software"), to deal in the Software without
    -    restriction, including without limitation the rights to use,
    -    copy, modify, merge, publish, distribute, sublicense, and/or sell
    -    copies of the Software, and to permit persons to whom the
    -    Software is furnished to do so, subject to the following
    -    conditions:
    -
    -    The above copyright notice and this permission notice shall be
    -    included in all copies or substantial portions of the Software.
    -
    -    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    -    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
    -    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    -    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
    -    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
    -    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    -    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
    -    OTHER DEALINGS IN THE SOFTWARE.
    -
    -    This is an amazing lib!
    -
    -    Slightly modified by Mat Groves (matgroves.com);
    -*/
    -
    -/**
    - * Based on the Polyk library http://polyk.ivank.net released under MIT licence.
    - * This is an amazing lib!
    - * Slightly modified by Mat Groves (matgroves.com);
    - * @class PolyK
    - */
    -PIXI.PolyK = {};
    -
    -/**
    - * Triangulates shapes for webGL graphic fills.
    - *
    - * @method Triangulate
    - */
    -PIXI.PolyK.Triangulate = function(p)
    -{
    -    var sign = true;
    -
    -    var n = p.length >> 1;
    -    if(n < 3) return [];
    -
    -    var tgs = [];
    -    var avl = [];
    -    for(var i = 0; i < n; i++) avl.push(i);
    -
    -    i = 0;
    -    var al = n;
    -    while(al > 3)
    -    {
    -        var i0 = avl[(i+0)%al];
    -        var i1 = avl[(i+1)%al];
    -        var i2 = avl[(i+2)%al];
    -
    -        var ax = p[2*i0],  ay = p[2*i0+1];
    -        var bx = p[2*i1],  by = p[2*i1+1];
    -        var cx = p[2*i2],  cy = p[2*i2+1];
    -
    -        var earFound = false;
    -        if(PIXI.PolyK._convex(ax, ay, bx, by, cx, cy, sign))
    -        {
    -            earFound = true;
    -            for(var j = 0; j < al; j++)
    -            {
    -                var vi = avl[j];
    -                if(vi === i0 || vi === i1 || vi === i2) continue;
    -
    -                if(PIXI.PolyK._PointInTriangle(p[2*vi], p[2*vi+1], ax, ay, bx, by, cx, cy)) {
    -                    earFound = false;
    -                    break;
    -                }
    -            }
    -        }
    -
    -        if(earFound)
    -        {
    -            tgs.push(i0, i1, i2);
    -            avl.splice((i+1)%al, 1);
    -            al--;
    -            i = 0;
    -        }
    -        else if(i++ > 3*al)
    -        {
    -            // need to flip flip reverse it!
    -            // reset!
    -            if(sign)
    -            {
    -                tgs = [];
    -                avl = [];
    -                for(i = 0; i < n; i++) avl.push(i);
    -
    -                i = 0;
    -                al = n;
    -
    -                sign = false;
    -            }
    -            else
    -            {
    -                window.console.log("PIXI Warning: shape too complex to fill");
    -                return [];
    -            }
    -        }
    -    }
    -
    -    tgs.push(avl[0], avl[1], avl[2]);
    -    return tgs;
    -};
    -
    -/**
    - * Checks whether a point is within a triangle
    - *
    - * @method _PointInTriangle
    - * @param px {Number} x coordinate of the point to test
    - * @param py {Number} y coordinate of the point to test
    - * @param ax {Number} x coordinate of the a point of the triangle
    - * @param ay {Number} y coordinate of the a point of the triangle
    - * @param bx {Number} x coordinate of the b point of the triangle
    - * @param by {Number} y coordinate of the b point of the triangle
    - * @param cx {Number} x coordinate of the c point of the triangle
    - * @param cy {Number} y coordinate of the c point of the triangle
    - * @private
    - * @return {Boolean}
    - */
    -PIXI.PolyK._PointInTriangle = function(px, py, ax, ay, bx, by, cx, cy)
    -{
    -    var v0x = cx-ax;
    -    var v0y = cy-ay;
    -    var v1x = bx-ax;
    -    var v1y = by-ay;
    -    var v2x = px-ax;
    -    var v2y = py-ay;
    -
    -    var dot00 = v0x*v0x+v0y*v0y;
    -    var dot01 = v0x*v1x+v0y*v1y;
    -    var dot02 = v0x*v2x+v0y*v2y;
    -    var dot11 = v1x*v1x+v1y*v1y;
    -    var dot12 = v1x*v2x+v1y*v2y;
    -
    -    var invDenom = 1 / (dot00 * dot11 - dot01 * dot01);
    -    var u = (dot11 * dot02 - dot01 * dot12) * invDenom;
    -    var v = (dot00 * dot12 - dot01 * dot02) * invDenom;
    -
    -    // Check if point is in triangle
    -    return (u >= 0) && (v >= 0) && (u + v < 1);
    -};
    -
    -/**
    - * Checks whether a shape is convex
    - *
    - * @method _convex
    - * @private
    - * @return {Boolean}
    - */
    -PIXI.PolyK._convex = function(ax, ay, bx, by, cx, cy, sign)
    -{
    -    return ((ay-by)*(cx-bx) + (bx-ax)*(cy-by) >= 0) === sign;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/files/src_pixi_utils_Utils.js.html b/tutorial-3/pixi.js-master/docs/files/src_pixi_utils_Utils.js.html deleted file mode 100755 index 2bcfa6e..0000000 --- a/tutorial-3/pixi.js-master/docs/files/src_pixi_utils_Utils.js.html +++ /dev/null @@ -1,485 +0,0 @@ - - - - - src/pixi/utils/Utils.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/utils/Utils.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    - 
    -// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
    -// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
    -
    -// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
    -
    -// MIT license
    -
    -/**
    - * A polyfill for requestAnimationFrame
    - * You can actually use both requestAnimationFrame and requestAnimFrame, 
    - * you will still benefit from the polyfill
    - *
    - * @method requestAnimationFrame
    - */
    -
    -/**
    - * A polyfill for cancelAnimationFrame
    - *
    - * @method cancelAnimationFrame
    - */
    -(function(window) {
    -    var lastTime = 0;
    -    var vendors = ['ms', 'moz', 'webkit', 'o'];
    -    for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
    -        window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
    -        window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] ||
    -            window[vendors[x] + 'CancelRequestAnimationFrame'];
    -    }
    -
    -    if (!window.requestAnimationFrame) {
    -        window.requestAnimationFrame = function(callback) {
    -            var currTime = new Date().getTime();
    -            var timeToCall = Math.max(0, 16 - (currTime - lastTime));
    -            var id = window.setTimeout(function() { callback(currTime + timeToCall); },
    -              timeToCall);
    -            lastTime = currTime + timeToCall;
    -            return id;
    -        };
    -    }
    -
    -    if (!window.cancelAnimationFrame) {
    -        window.cancelAnimationFrame = function(id) {
    -            clearTimeout(id);
    -        };
    -    }
    -
    -    window.requestAnimFrame = window.requestAnimationFrame;
    -})(this);
    -
    -/**
    - * Converts a hex color number to an [R, G, B] array
    - *
    - * @method hex2rgb
    - * @param hex {Number}
    - */
    -PIXI.hex2rgb = function(hex) {
    -    return [(hex >> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255];
    -};
    -
    -/**
    - * Converts a color as an [R, G, B] array to a hex number
    - *
    - * @method rgb2hex
    - * @param rgb {Array}
    - */
    -PIXI.rgb2hex = function(rgb) {
    -    return ((rgb[0]*255 << 16) + (rgb[1]*255 << 8) + rgb[2]*255);
    -};
    -
    -/**
    - * A polyfill for Function.prototype.bind
    - *
    - * @method bind
    - */
    -if (typeof Function.prototype.bind !== 'function') {
    -    Function.prototype.bind = (function () {
    -        return function (thisArg) {
    -            var target = this, i = arguments.length - 1, boundArgs = [];
    -            if (i > 0)
    -            {
    -                boundArgs.length = i;
    -                while (i--) boundArgs[i] = arguments[i + 1];
    -            }
    -
    -            if (typeof target !== 'function') throw new TypeError();
    -
    -            function bound() {
    -                var i = arguments.length, args = new Array(i);
    -                while (i--) args[i] = arguments[i];
    -                args = boundArgs.concat(args);
    -                return target.apply(this instanceof bound ? this : thisArg, args);
    -            }
    -
    -            bound.prototype = (function F(proto) {
    -                if (proto) F.prototype = proto;
    -                if (!(this instanceof F)) return new F();
    -            })(target.prototype);
    -
    -            return bound;
    -        };
    -    })();
    -}
    -
    -/**
    - * A wrapper for ajax requests to be handled cross browser
    - *
    - * @class AjaxRequest
    - * @constructor
    - */
    -PIXI.AjaxRequest = function()
    -{
    -    var activexmodes = ['Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.3.0', 'Microsoft.XMLHTTP']; //activeX versions to check for in IE
    -
    -    if (window.ActiveXObject)
    -    { //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    -        for (var i=0; i<activexmodes.length; i++)
    -        {
    -            try{
    -                return new window.ActiveXObject(activexmodes[i]);
    -            }
    -            catch(e) {
    -                //suppress error
    -            }
    -        }
    -    }
    -    else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    -    {
    -        return new window.XMLHttpRequest();
    -    }
    -    else
    -    {
    -        return false;
    -    }
    -};
    -/*
    -PIXI.packColorRGBA = function(r, g, b, a)//r, g, b, a)
    -{
    -  //  console.log(r, b, c, d)
    -  return (Math.floor((r)*63) << 18) | (Math.floor((g)*63) << 12) | (Math.floor((b)*63) << 6);// | (Math.floor((a)*63))
    -  //  i = i | (Math.floor((a)*63));
    -   // return i;
    -   // var r = (i / 262144.0 ) / 64;
    -   // var g = (i / 4096.0)%64 / 64;
    -  //  var b = (i / 64.0)%64 / 64;
    -  //  var a = (i)%64 / 64;
    -     
    -  //  console.log(r, g, b, a);
    -  //  return i;
    -
    -};
    -*/
    -/*
    -PIXI.packColorRGB = function(r, g, b)//r, g, b, a)
    -{
    -    return (Math.floor((r)*255) << 16) | (Math.floor((g)*255) << 8) | (Math.floor((b)*255));
    -};
    -
    -PIXI.unpackColorRGB = function(r, g, b)//r, g, b, a)
    -{
    -    return (Math.floor((r)*255) << 16) | (Math.floor((g)*255) << 8) | (Math.floor((b)*255));
    -};
    -*/
    -
    -/**
    - * Checks whether the Canvas BlendModes are supported by the current browser
    - *
    - * @method canUseNewCanvasBlendModes
    - * @return {Boolean} whether they are supported
    - */
    -PIXI.canUseNewCanvasBlendModes = function()
    -{
    -    if (typeof document === 'undefined') return false;
    -    var canvas = document.createElement('canvas');
    -    canvas.width = 1;
    -    canvas.height = 1;
    -    var context = canvas.getContext('2d');
    -    context.fillStyle = '#000';
    -    context.fillRect(0,0,1,1);
    -    context.globalCompositeOperation = 'multiply';
    -    context.fillStyle = '#fff';
    -    context.fillRect(0,0,1,1);
    -    return context.getImageData(0,0,1,1).data[0] === 0;
    -};
    -
    -/**
    - * Given a number, this function returns the closest number that is a power of two
    - * this function is taken from Starling Framework as its pretty neat ;)
    - *
    - * @method getNextPowerOfTwo
    - * @param number {Number}
    - * @return {Number} the closest number that is a power of two
    - */
    -PIXI.getNextPowerOfTwo = function(number)
    -{
    -    if (number > 0 && (number & (number - 1)) === 0) // see: http://goo.gl/D9kPj
    -        return number;
    -    else
    -    {
    -        var result = 1;
    -        while (result < number) result <<= 1;
    -        return result;
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/index.html b/tutorial-3/pixi.js-master/docs/index.html deleted file mode 100755 index d44cf89..0000000 --- a/tutorial-3/pixi.js-master/docs/index.html +++ /dev/null @@ -1,292 +0,0 @@ - - - - - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -
    -
    -

    - Browse to a module or class using the sidebar to view its API documentation. -

    - -

    Keyboard Shortcuts

    - -
      -
    • Press s to focus the API search box.

    • - -
    • Use Up and Down to select classes, modules, and search results.

    • - -
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • - -
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/modules/PIXI.html b/tutorial-3/pixi.js-master/docs/modules/PIXI.html deleted file mode 100755 index 3621bb3..0000000 --- a/tutorial-3/pixi.js-master/docs/modules/PIXI.html +++ /dev/null @@ -1,819 +0,0 @@ - - - - - PIXI - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PIXI Module

    -
    - - - - - - - - - -
    - - - -
    - -
    - - - -
    -
    - -

    This module provides the following classes:

    - - - -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/docs/modules/index.html b/tutorial-3/pixi.js-master/docs/modules/index.html deleted file mode 100755 index 487fe15..0000000 --- a/tutorial-3/pixi.js-master/docs/modules/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Redirector - - - - Click here to redirect - - diff --git a/tutorial-3/pixi.js-master/examples/example 1 - Basics/bunny.png b/tutorial-3/pixi.js-master/examples/example 1 - Basics/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 1 - Basics/bunny.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 1 - Basics/index.html b/tutorial-3/pixi.js-master/examples/example 1 - Basics/index.html deleted file mode 100755 index 7da84bb..0000000 --- a/tutorial-3/pixi.js-master/examples/example 1 - Basics/index.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - pixi.js example 1 - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 1 - Basics/indexTest2.html b/tutorial-3/pixi.js-master/examples/example 1 - Basics/indexTest2.html deleted file mode 100755 index 681f6bf..0000000 --- a/tutorial-3/pixi.js-master/examples/example 1 - Basics/indexTest2.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - pixi.js example 1 - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 1 - Basics/mark.html b/tutorial-3/pixi.js-master/examples/example 1 - Basics/mark.html deleted file mode 100755 index b71350c..0000000 --- a/tutorial-3/pixi.js-master/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
    - - -
    - - -
    - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 1 - Basics/stats.min.js b/tutorial-3/pixi.js-master/examples/example 1 - Basics/stats.min.js deleted file mode 100755 index 52539f4..0000000 --- a/tutorial-3/pixi.js-master/examples/example 1 - Basics/stats.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// stats.js - http://github.com/mrdoob/stats.js -var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; -i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); -k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= -"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= -a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); diff --git a/tutorial-3/pixi.js-master/examples/example 10 - Text/desyrel.png b/tutorial-3/pixi.js-master/examples/example 10 - Text/desyrel.png deleted file mode 100755 index c3559e1..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 10 - Text/desyrel.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 10 - Text/desyrel.xml b/tutorial-3/pixi.js-master/examples/example 10 - Text/desyrel.xml deleted file mode 100755 index 54fcdbb..0000000 --- a/tutorial-3/pixi.js-master/examples/example 10 - Text/desyrel.xml +++ /dev/null @@ -1,1922 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tutorial-3/pixi.js-master/examples/example 10 - Text/index.html b/tutorial-3/pixi.js-master/examples/example 10 - Text/index.html deleted file mode 100755 index 23fae9a..0000000 --- a/tutorial-3/pixi.js-master/examples/example 10 - Text/index.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - pixi.js example 10 Text - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 10 - Text/textDemoBG.jpg b/tutorial-3/pixi.js-master/examples/example 10 - Text/textDemoBG.jpg deleted file mode 100755 index 5955e59..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 10 - Text/textDemoBG.jpg and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/index.html b/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/index.html deleted file mode 100755 index 88a7396..0000000 --- a/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/index.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - pixi.js example 11 RenderTexture - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/indexNew.html b/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/indexNew.html deleted file mode 100755 index 9c8e727..0000000 --- a/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/indexNew.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - pixi.js example 11 RenderTexture - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_01.png b/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_01.png deleted file mode 100755 index 8687366..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_01.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_02.png b/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_02.png deleted file mode 100755 index a140876..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_02.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_03.png b/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_03.png deleted file mode 100755 index 82532c7..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_03.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_04.png b/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_04.png deleted file mode 100755 index 9c790c3..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_04.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_05.png b/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_05.png deleted file mode 100755 index ebb28c8..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_05.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_06.png b/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_06.png deleted file mode 100755 index 1dec5c8..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_06.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_07.png b/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_07.png deleted file mode 100755 index e14a021..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_07.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_08.png b/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_08.png deleted file mode 100755 index 0197fef..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 11 - RenderTexture/spinObj_08.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/Pixie.atlas b/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/Pixie.atlas deleted file mode 100755 index 68a8013..0000000 --- a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/Pixie.atlas +++ /dev/null @@ -1,158 +0,0 @@ -Pixie.png -format: RGBA8888 -filter: Linear,Linear -repeat: none -L_foot - rotate: false - xy: 1048, 355 - size: 68, 51 - orig: 68, 51 - offset: 0, 0 - index: -1 -L_hand - rotate: true - xy: 916, 355 - size: 55, 64 - orig: 55, 64 - offset: 0, 0 - index: -1 -L_lower_arm - rotate: false - xy: 1273, 226 - size: 70, 31 - orig: 70, 31 - offset: 0, 0 - index: -1 -L_lower_leg - rotate: false - xy: 1201, 345 - size: 57, 65 - orig: 57, 65 - offset: 0, 0 - index: -1 -L_upper_arm - rotate: true - xy: 1399, 2 - size: 78, 74 - orig: 78, 74 - offset: 0, 0 - index: -1 -L_upper_leg - rotate: false - xy: 1351, 259 - size: 124, 71 - orig: 124, 71 - offset: 0, 0 - index: -1 -R_foot - rotate: false - xy: 1319, 345 - size: 68, 51 - orig: 68, 51 - offset: 0, 0 - index: -1 -R_hand - rotate: true - xy: 982, 355 - size: 55, 64 - orig: 55, 64 - offset: 0, 0 - index: -1 -R_lower_arm - rotate: false - xy: 1345, 226 - size: 70, 31 - orig: 70, 31 - offset: 0, 0 - index: -1 -R_lower_leg - rotate: false - xy: 1260, 345 - size: 57, 65 - orig: 57, 65 - offset: 0, 0 - index: -1 -R_upper_arm - rotate: true - xy: 1399, 82 - size: 78, 74 - orig: 78, 74 - offset: 0, 0 - index: -1 -R_upper_leg - rotate: false - xy: 1389, 332 - size: 124, 71 - orig: 124, 71 - offset: 0, 0 - index: -1 -backHair - rotate: true - xy: 1096, 2 - size: 261, 175 - orig: 261, 175 - offset: 0, 0 - index: -1 -foreWing - rotate: false - xy: 1096, 265 - size: 253, 78 - orig: 253, 78 - offset: 0, 0 - index: -1 -frontHair - rotate: true - xy: 617, 2 - size: 396, 297 - orig: 396, 297 - offset: 0, 0 - index: -1 -groinal - rotate: true - xy: 1515, 296 - size: 103, 84 - orig: 103, 84 - offset: 0, 0 - index: -1 -head - rotate: false - xy: 2, 2 - size: 613, 408 - orig: 613, 408 - offset: 0, 0 - index: -1 -jaw - rotate: true - xy: 1273, 2 - size: 222, 124 - orig: 222, 124 - offset: 0, 0 - index: -1 -midHair - rotate: true - xy: 916, 2 - size: 351, 178 - orig: 351, 178 - offset: 0, 0 - index: -1 -neck - rotate: true - xy: 1118, 345 - size: 65, 81 - orig: 65, 81 - offset: 0, 0 - index: -1 -rearWing - rotate: false - xy: 1477, 148 - size: 136, 146 - orig: 136, 146 - offset: 0, 0 - index: -1 -vest - rotate: false - xy: 1477, 2 - size: 139, 144 - orig: 139, 144 - offset: 0, 0 - index: -1 diff --git a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/Pixie.json b/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/Pixie.json deleted file mode 100755 index bc7e888..0000000 --- a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/Pixie.json +++ /dev/null @@ -1,924 +0,0 @@ -{ -"bones": [ - { "name": "root" }, - { "name": "hip", "parent": "root", "x": -5.36, "y": 120.63 }, - { "name": "L leg upper", "parent": "hip", "length": 90.28, "x": -21.3, "y": -8.59, "rotation": -123.16 }, - { "name": "R leg upper", "parent": "hip", "length": 79.63, "x": 14.54, "y": -29.09, "rotation": -12.07 }, - { "name": "back", "parent": "hip", "length": 117.04, "x": 3.43, "y": 0.51, "rotation": 64.34 }, - { "name": "L arm upper", "parent": "back", "length": 88.01, "x": 120.71, "y": -25.79, "rotation": 108.03 }, - { "name": "L leg lower", "parent": "L leg upper", "length": 77.82, "x": 89.23, "y": 3.84, "rotation": -74.59 }, - { "name": "R arm upper", "parent": "back", "length": 82.87, "x": 107.42, "y": 16.92, "rotation": -108.18 }, - { "name": "R leg lower", "parent": "R leg upper", "length": 67.73, "x": 79.31, "y": -0.23, "rotation": -35.49 }, - { "name": "fore wing", "parent": "back", "length": 174.95, "x": 78.26, "y": 14.47, "rotation": 111.09 }, - { "name": "neck", "parent": "back", "length": 65.79, "x": 115.87, "y": -0.67, "rotation": -1.35 }, - { "name": "L arm lower", "parent": "L arm upper", "length": 57.67, "x": 84.14, "y": -0.57, "rotation": 35.83 }, - { "name": "L foot", "parent": "L leg lower", "length": 57.67, "x": 74.89, "y": -3.37, "rotation": 79.65 }, - { "name": "R arm lower", "parent": "R arm upper", "length": 58.76, "x": 80.97, "y": -3.48, "rotation": 56.62 }, - { "name": "R foot", "parent": "R leg lower", "length": 51.26, "x": 67.69, "y": -1.98, "rotation": 84.54 }, - { "name": "bone1", "parent": "fore wing", "x": 50.67, "y": 19.71 }, - { "name": "head", "parent": "neck", "length": 132.5, "x": 116.13, "y": 41.67, "rotation": -40.37 }, - { "name": "rear wing", "parent": "fore wing", "length": 123.2, "x": 2.22, "y": -11.57, "rotation": -30.89 }, - { "name": "L hand", "parent": "L arm lower", "length": 33.27, "x": 55.37, "y": 1.3, "rotation": 30.89 }, - { "name": "R hand", "parent": "R arm lower", "length": 33.34, "x": 58.46, "y": -1.24, "rotation": 25.65 }, - { "name": "hair back", "parent": "head", "length": 156.52, "x": 43.77, "y": 270.91, "rotation": 22.07 }, - { "name": "jaw", "parent": "head", "length": 139.22, "x": 8.71, "y": -33.25, "rotation": -46.82 }, - { "name": "hair mid", "parent": "hair back", "length": 191.57, "x": 155.16, "y": -89.36, "rotation": -17.61 }, - { "name": "hair front", "parent": "hair mid", "length": 202.73, "x": 48, "y": -100.58, "rotation": -18.29 } -], -"slots": [ - { "name": "L hand", "bone": "L hand", "attachment": "L_hand" }, - { "name": "L arm lower", "bone": "L arm lower", "attachment": "L_lower_arm" }, - { "name": "L arm upper", "bone": "L arm upper", "attachment": "L_upper_arm" }, - { "name": "rear wing", "bone": "rear wing", "attachment": "rearWing" }, - { "name": "L foot", "bone": "L foot", "attachment": "L_foot" }, - { "name": "L leg lower", "bone": "L leg lower", "attachment": "L_lower_leg" }, - { "name": "L leg upper", "bone": "L leg upper", "attachment": "L_upper_leg" }, - { "name": "R foot", "bone": "R foot", "attachment": "R_foot" }, - { "name": "R lower", "bone": "R leg lower", "attachment": "R_lower_leg" }, - { "name": "R upper", "bone": "R leg upper", "attachment": "R_upper_leg" }, - { "name": "hip", "bone": "hip", "attachment": "groinal" }, - { "name": "fore wing", "bone": "fore wing", "attachment": "foreWing" }, - { "name": "neck", "bone": "neck", "attachment": "neck" }, - { "name": "back", "bone": "back", "attachment": "vest" }, - { "name": "R arm upper", "bone": "R arm upper", "attachment": "R_upper_arm" }, - { "name": "R arm lower", "bone": "R arm lower", "attachment": "R_lower_arm" }, - { "name": "R hand", "bone": "R hand", "attachment": "R_hand" }, - { "name": "hair back", "bone": "hair back", "attachment": "backHair" }, - { "name": "hair front", "bone": "hair front", "attachment": "frontHair" }, - { "name": "head", "bone": "head", "attachment": "head" }, - { "name": "jaw", "bone": "jaw", "attachment": "jaw" }, - { "name": "hair mid", "bone": "hair mid", "attachment": "midHair" } -], -"skins": { - "default": { - "L arm lower": { - "L_lower_arm": { "x": 26.8, "y": 0.38, "rotation": -12.92, "width": 70, "height": 31 } - }, - "L arm upper": { - "L_upper_arm": { "x": 43.44, "y": -0.75, "rotation": 43.61, "width": 78, "height": 74 } - }, - "L foot": { - "L_foot": { "x": 25.73, "y": -3.97, "rotation": -37.09, "width": 68, "height": 51 } - }, - "L hand": { - "L_hand": { "x": 16.53, "y": 5.33, "rotation": -19.13, "width": 55, "height": 64 } - }, - "L leg lower": { - "L_lower_leg": { "x": 32.98, "y": 3.71, "rotation": 50.68, "width": 57, "height": 65 } - }, - "L leg upper": { - "L_upper_leg": { "x": 34.37, "y": 6.89, "rotation": 14.72, "width": 124, "height": 71 } - }, - "R arm lower": { - "R_lower_arm": { "x": 27.12, "y": 1.85, "rotation": -12.78, "width": 70, "height": 31 } - }, - "R arm upper": { - "R_upper_arm": { "x": 40.47, "y": -2.66, "rotation": 43.84, "width": 78, "height": 74 } - }, - "R foot": { - "R_foot": { "x": 19.53, "y": -8.7, "rotation": -36.33, "width": 68, "height": 51 } - }, - "R hand": { - "R_hand": { "x": 17.09, "y": -3.59, "rotation": -38.44, "width": 55, "height": 64 } - }, - "R lower": { - "R_lower_leg": { "x": 33.18, "y": -0.42, "rotation": 50.06, "width": 57, "height": 65 } - }, - "R upper": { - "R_upper_leg": { "x": 26.1, "y": 2.57, "rotation": 14.14, "width": 124, "height": 71 } - }, - "back": { - "vest": { "x": 47.37, "y": 12.63, "rotation": -64.34, "width": 139, "height": 144 } - }, - "fore wing": { - "foreWing": { "x": 103.77, "y": -7.39, "rotation": -175.44, "width": 253, "height": 78 } - }, - "hair back": { - "backHair": { "x": 71.84, "y": -6.96, "rotation": -44.69, "width": 261, "height": 175 } - }, - "hair front": { - "frontHair": { "x": 144.79, "y": -43.44, "rotation": -8.77, "width": 396, "height": 297 } - }, - "hair mid": { - "midHair": { "x": 98.77, "y": -24.19, "rotation": -27.07, "width": 351, "height": 178 } - }, - "head": { - "head": { "x": 54.08, "y": 79.01, "rotation": -22.61, "width": 613, "height": 408 } - }, - "hip": { - "groinal": { "x": -1.3, "y": -22.13, "width": 103, "height": 84 } - }, - "jaw": { - "jaw": { "x": 37.24, "y": -10.62, "rotation": 16.36, "width": 222, "height": 124 } - }, - "neck": { - "neck": { "x": 11.64, "y": 0.09, "rotation": -62.99, "width": 65, "height": 81 } - }, - "rear wing": { - "rearWing": { "x": 72.18, "y": -9.33, "rotation": -144.54, "width": 136, "height": 146 } - } - } -}, -"animations": { - "jump": { - "bones": { - "hip": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { - "time": 0, - "x": 0, - "y": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.3666, - "x": 48.25, - "y": 387.29, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L leg upper": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": -52.49 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R leg upper": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 42.23 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "back": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 17.45 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.3666, "x": -12.48, "y": 6.24 }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L arm upper": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": -23.04 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L leg lower": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 21.33 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R arm upper": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": -20.49 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R leg lower": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 18.73 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "fore wing": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1333, "angle": -17.83 }, - { "time": 0.2333, "angle": -0.57 }, - { "time": 0.3333, "angle": -22.57 }, - { "time": 0.4333, "angle": 6.45 }, - { "time": 0.5333, "angle": -15.51 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "neck": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L arm lower": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 16.6 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L foot": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3333, "angle": -19.99 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.3333, "x": -13.89, "y": -5.83 }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R arm lower": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 54.98 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R foot": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": -4.87 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "bone1": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "head": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.3743, - "angle": 13.84, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "rear wing": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1333, "angle": 30.94 }, - { "time": 0.2333, "angle": -24.35 }, - { "time": 0.3333, "angle": 25.11 }, - { "time": 0.4333, "angle": -6.54 }, - { "time": 0.5333, "angle": 24.65 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L hand": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 57.5 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R hand": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 3.65 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "hair back": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3333, "angle": 6.5 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "jaw": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 5.72 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.3666, "x": -4.28, "y": 3.04 }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.3666, "x": 1.169, "y": 1 }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "hair mid": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3333, "angle": 6.71 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "hair front": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3333, "angle": -8.18 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.3333, "x": -17.24, "y": 20.35 }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - } - } - }, - "running": { - "bones": { - "hip": { - "rotate": [ - { "time": 0, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 2.79 }, - { "time": 0.2333, "x": 0, "y": -15.43 }, - { "time": 0.5, "x": 0, "y": 8 }, - { "time": 0.7, "x": 0, "y": -8.92 }, - { "time": 0.9666, "x": 0, "y": 2.79 } - ] - }, - "R leg upper": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.5, "angle": -150.25 }, - { "time": 0.7, "angle": -110.91 }, - { - "time": 0.8333, - "angle": -25.14, - "curve": [ 0.155, 0.16, 0.75, 1 ] - }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.5, "x": -35.15, "y": 0 }, - { "time": 0.7, "x": -6.5, "y": 0 }, - { "time": 1, "x": 2.6, "y": 0 } - ] - }, - "R leg lower": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.5, "angle": 7.47 }, - { "time": 0.7, "angle": -53.49 }, - { - "time": 0.8333, - "angle": -85.3, - "curve": [ 0.16, 0.21, 0.75, 1 ] - }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0.7, "x": 2.5, "y": -1.47 }, - { "time": 0.8333, "x": 3.93, "y": -5.18 } - ] - }, - "R foot": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.2, "angle": 7.03 }, - { "time": 0.2333, "angle": 18.45 }, - { "time": 0.2666, "angle": 26.41 }, - { "time": 0.3, "angle": 29.63 }, - { "time": 0.5, "angle": -22.49 }, - { "time": 0.7, "angle": -30.93 }, - { "time": 0.8333, "angle": -50.37 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0.5, "x": 0.7, "y": -3.84 } - ] - }, - "L leg upper": { - "rotate": [ - { - "time": 0, - "angle": -30.25, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.2333, "angle": 77.26 }, - { - "time": 0.5, - "angle": 104.21, - "curve": [ 0.25, 0, 0.29, 1 ] - }, - { "time": 1, "angle": -30.25 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.5, "x": 22.13, "y": -16.92 }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L leg lower": { - "rotate": [ - { - "time": 0, - "angle": 22.34, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.2333, - "angle": -65.53, - "curve": [ 0.094, -0.03, 0.678, 1.08 ] - }, - { - "time": 0.5, - "angle": 43.39, - "curve": [ 0.25, 0, 0.287, 1 ] - }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 1, "x": 0.58, "y": -1.74 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L foot": { - "rotate": [ - { "time": 0, "angle": -22.23 }, - { "time": 0.2333, "angle": -1.44 }, - { "time": 0.5, "angle": 5.06 }, - { "time": 0.6333, "angle": 27.11 }, - { "time": 0.6666, "angle": 50.34 }, - { "time": 1, "angle": -12.47 } - ], - "translate": [ - { "time": 0, "x": -4.13, "y": -3.42 }, - { "time": 0.6333, "x": 1.22, "y": 1.73 }, - { "time": 0.6666, "x": -0.56, "y": 5.49 }, - { "time": 1, "x": -0.87, "y": -0.96 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "back": { - "rotate": [ - { "time": 0, "angle": -1.79 }, - { "time": 0.2333, "angle": -10.71 }, - { "time": 0.5, "angle": -2.16 }, - { "time": 0.7, "angle": -10.27 }, - { "time": 0.9666, "angle": -1.79 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.2333, "x": 5.2, "y": -6.5 }, - { "time": 0.5, "x": 1.3, "y": -2.6 }, - { "time": 0.7, "x": 7.81, "y": -6.5 }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "R arm upper": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.5, "angle": 235.62 }, - { "time": 0.7, "angle": -57.38 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 } - ] - }, - "R arm lower": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.068, 0, 0.632, 1.14 ] - }, - { "time": 0.5, "angle": -34.21 }, - { - "time": 0.7, - "angle": 17.35, - "curve": [ 0.221, 0.26, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 } - ] - }, - "R hand": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": 30.13 }, - { "time": 0.7, "angle": 3.91 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 } - ] - }, - "L arm upper": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.5, - "angle": -190.85, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "L hand": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 1, 0.75, 1 ] - }, - { - "time": 0.5, - "angle": -15.76, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "L arm lower": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3, "angle": 45.27 }, - { "time": 0.5, "angle": -20.97 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "fore wing": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.2333, "angle": 17.36 }, - { "time": 0.5333, "angle": -2.27 }, - { "time": 0.7333, "angle": 20.14 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "rear wing": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.2333, "angle": 17.36 }, - { "time": 0.5333, "angle": -2.27 }, - { "time": 0.7333, "angle": 20.14 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "head": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.2666, "angle": -13.61 }, - { "time": 0.5, "angle": 0 }, - { "time": 0.7333, "angle": -11.08 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.2666, "x": 4.54, "y": -38.81 }, - { "time": 0.5, "x": 0, "y": 0 }, - { "time": 0.7333, "x": 0.32, "y": -40.1 }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "jaw": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.2333, "angle": -3.93 }, - { "time": 0.4666, "angle": 8.79 }, - { "time": 0.7333, "angle": 13.97 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.2333, "x": 4.63, "y": 6.7 }, - { "time": 0.4666, "x": 6.67, "y": -4.82 }, - { "time": 0.7333, "x": 6.8, "y": -7.61 }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "hair back": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.2333, - "angle": -3.9, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.5, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.7666, - "angle": -4, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.2333, "x": -1.3, "y": -6.5 }, - { "time": 0.5, "x": 0, "y": 0 }, - { "time": 0.7666, "x": -3.49, "y": -10.15 }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "hair front": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.2333, - "angle": -3.9, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.5, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.7666, - "angle": -4, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "hair mid": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.2333, - "angle": -3.9, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.5, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.7666, - "angle": -4, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - } - } - } -} -} diff --git a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/Pixie.png b/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/Pixie.png deleted file mode 100755 index b1e5b77..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/Pixie.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/dragon.atlas b/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/dragon.atlas deleted file mode 100755 index eefbc1d..0000000 --- a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/dragon.atlas +++ /dev/null @@ -1,290 +0,0 @@ - -dragon.png -format: RGBA8888 -filter: Linear,Linear -repeat: none -L_rear_thigh - rotate: false - xy: 895, 20 - size: 91, 148 - orig: 91, 149 - offset: 0, 0 - index: -1 -L_wing01 - rotate: false - xy: 814, 672 - size: 191, 256 - orig: 191, 256 - offset: 0, 0 - index: -1 -L_wing02 - rotate: false - xy: 714, 189 - size: 179, 269 - orig: 179, 269 - offset: 0, 0 - index: -1 -L_wing03 - rotate: false - xy: 785, 463 - size: 186, 207 - orig: 186, 207 - offset: 0, 0 - index: -1 -L_wing05 - rotate: true - xy: 2, 9 - size: 218, 213 - orig: 218, 213 - offset: 0, 0 - index: -1 -L_wing06 - rotate: false - xy: 2, 229 - size: 192, 331 - orig: 192, 331 - offset: 0, 0 - index: -1 -R_wing01 - rotate: true - xy: 502, 709 - size: 219, 310 - orig: 219, 310 - offset: 0, 0 - index: -1 -R_wing02 - rotate: true - xy: 204, 463 - size: 203, 305 - orig: 203, 305 - offset: 0, 0 - index: -1 -R_wing03 - rotate: false - xy: 511, 460 - size: 272, 247 - orig: 272, 247 - offset: 0, 0 - index: -1 -R_wing05 - rotate: false - xy: 196, 232 - size: 251, 229 - orig: 251, 229 - offset: 0, 0 - index: -1 -R_wing06 - rotate: false - xy: 2, 562 - size: 200, 366 - orig: 200, 366 - offset: 0, 0 - index: -1 -R_wing07 - rotate: true - xy: 449, 258 - size: 200, 263 - orig: 200, 263 - offset: 0, 0 - index: -1 -R_wing08 - rotate: false - xy: 467, 2 - size: 234, 254 - orig: 234, 254 - offset: 0, 0 - index: -1 -R_wing09 - rotate: false - xy: 217, 26 - size: 248, 204 - orig: 248, 204 - offset: 0, 0 - index: -1 -back - rotate: false - xy: 703, 2 - size: 190, 185 - orig: 190, 185 - offset: 0, 0 - index: -1 -chest - rotate: true - xy: 895, 170 - size: 136, 122 - orig: 136, 122 - offset: 0, 0 - index: -1 -front_toeA - rotate: false - xy: 976, 972 - size: 29, 50 - orig: 29, 50 - offset: 0, 0 - index: -1 -head - rotate: false - xy: 204, 668 - size: 296, 260 - orig: 296, 260 - offset: 0, 0 - index: -1 -logo - rotate: false - xy: 2, 930 - size: 897, 92 - orig: 897, 92 - offset: 0, 0 - index: -1 -tail01 - rotate: false - xy: 895, 308 - size: 120, 153 - orig: 120, 153 - offset: 0, 0 - index: -1 -tail03 - rotate: false - xy: 901, 930 - size: 73, 92 - orig: 73, 92 - offset: 0, 0 - index: -1 - -dragon2.png -format: RGBA8888 -filter: Linear,Linear -repeat: none -L_front_leg - rotate: true - xy: 391, 141 - size: 84, 57 - orig: 84, 57 - offset: 0, 0 - index: -1 -L_front_thigh - rotate: false - xy: 446, 269 - size: 84, 72 - orig: 84, 72 - offset: 0, 0 - index: -1 -L_rear_leg - rotate: true - xy: 888, 342 - size: 168, 132 - orig: 206, 177 - offset: 19, 20 - index: -1 -L_wing04 - rotate: false - xy: 256, 227 - size: 188, 135 - orig: 188, 135 - offset: 0, 0 - index: -1 -L_wing07 - rotate: false - xy: 2, 109 - size: 159, 255 - orig: 159, 255 - offset: 0, 0 - index: -1 -L_wing08 - rotate: true - xy: 705, 346 - size: 164, 181 - orig: 164, 181 - offset: 0, 0 - index: -1 -L_wing09 - rotate: false - xy: 499, 343 - size: 204, 167 - orig: 204, 167 - offset: 0, 0 - index: -1 -R_front_leg - rotate: false - xy: 273, 34 - size: 101, 89 - orig: 101, 89 - offset: 0, 0 - index: -1 -R_front_thigh - rotate: false - xy: 163, 106 - size: 108, 108 - orig: 108, 108 - offset: 0, 0 - index: -1 -R_rear_leg - rotate: false - xy: 273, 125 - size: 116, 100 - orig: 116, 100 - offset: 0, 0 - index: -1 -R_rear_thigh - rotate: false - xy: 163, 216 - size: 91, 148 - orig: 91, 149 - offset: 0, 0 - index: -1 -R_wing04 - rotate: false - xy: 2, 366 - size: 279, 144 - orig: 279, 144 - offset: 0, 0 - index: -1 -chin - rotate: false - xy: 283, 364 - size: 214, 146 - orig: 214, 146 - offset: 0, 0 - index: -1 -front_toeB - rotate: false - xy: 590, 284 - size: 56, 57 - orig: 56, 57 - offset: 0, 0 - index: -1 -rear-toe - rotate: true - xy: 2, 2 - size: 105, 77 - orig: 109, 77 - offset: 0, 0 - index: -1 -tail02 - rotate: true - xy: 151, 9 - size: 95, 120 - orig: 95, 120 - offset: 0, 0 - index: -1 -tail04 - rotate: false - xy: 532, 270 - size: 56, 71 - orig: 56, 71 - offset: 0, 0 - index: -1 -tail05 - rotate: false - xy: 648, 282 - size: 52, 59 - orig: 52, 59 - offset: 0, 0 - index: -1 -tail06 - rotate: true - xy: 81, 12 - size: 95, 68 - orig: 95, 68 - offset: 0, 0 - index: -1 diff --git a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/dragon.json b/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/dragon.json deleted file mode 100755 index 0d25038..0000000 --- a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/dragon.json +++ /dev/null @@ -1,783 +0,0 @@ -{ -"bones": [ - { "name": "root", "y": -176.12 }, - { "name": "COG", "parent": "root", "y": 176.12 }, - { "name": "back", "parent": "COG", "length": 115.37, "x": 16.03, "y": 27.94, "rotation": 151.83 }, - { "name": "chest", "parent": "COG", "length": 31.24, "x": 52.52, "y": 15.34, "rotation": 161.7 }, - { "name": "neck", "parent": "COG", "length": 41.36, "x": 64.75, "y": 11.98, "rotation": 39.05 }, - { "name": "L_front_thigh", "parent": "chest", "length": 67.42, "x": -45.58, "y": 7.92, "rotation": 138.94 }, - { "name": "L_wing", "parent": "chest", "length": 301.12, "x": -7.24, "y": -24.65, "rotation": -75.51 }, - { "name": "R_front_thigh", "parent": "chest", "length": 81.63, "x": -10.89, "y": 28.25, "rotation": 67.96 }, - { "name": "R_rear_thigh", "parent": "back", "length": 123.46, "x": 65.31, "y": 59.89, "rotation": 104.87 }, - { "name": "chin", "parent": "neck", "length": 153.15, "x": 64.62, "y": -6.99, "rotation": -69.07 }, - { "name": "head", "parent": "neck", "length": 188.83, "x": 69.96, "y": 2.49, "rotation": 8.06 }, - { "name": "tail1", "parent": "back", "length": 65.65, "x": 115.37, "y": -0.19, "rotation": 44.31 }, - { "name": "L_front_leg", "parent": "L_front_thigh", "length": 51.57, "x": 67.42, "y": 0.02, "rotation": 43.36 }, - { "name": "L_rear_thigh", "parent": "R_rear_thigh", "length": 88.05, "x": -8.59, "y": 30.18, "rotation": 28.35 }, - { "name": "R_front_leg", "parent": "R_front_thigh", "length": 66.52, "x": 83.04, "y": -0.3, "rotation": 92.7 }, - { "name": "R_rear_leg", "parent": "R_rear_thigh", "length": 91.06, "x": 123.46, "y": -0.26, "rotation": -129.04 }, - { "name": "R_wing", "parent": "head", "length": 359.5, "x": -74.68, "y": 20.9, "rotation": 83.21 }, - { "name": "tail2", "parent": "tail1", "length": 54.5, "x": 65.65, "y": 0.22, "rotation": 12 }, - { "name": "L_front_toe1", "parent": "L_front_leg", "length": 51.44, "x": 45.53, "y": 2.43, "rotation": -98 }, - { "name": "L_front_toe2", "parent": "L_front_leg", "length": 61.97, "x": 51.57, "y": -0.12, "rotation": -55.26 }, - { "name": "L_front_toe3", "parent": "L_front_leg", "length": 45.65, "x": 54.19, "y": 0.6, "scaleX": 1.134, "rotation": -11.13 }, - { "name": "L_front_toe4", "parent": "L_front_leg", "length": 53.47, "x": 50.6, "y": 7.08, "scaleX": 1.134, "rotation": 19.42 }, - { "name": "L_rear_leg", "parent": "L_rear_thigh", "length": 103.74, "x": 96.04, "y": -0.97, "rotation": -122.41 }, - { "name": "R_front_toe1", "parent": "R_front_leg", "length": 46.65, "x": 70.03, "y": 5.31, "rotation": 8.59 }, - { "name": "R_front_toe2", "parent": "R_front_leg", "length": 53.66, "x": 66.52, "y": 0.33, "rotation": -35.02 }, - { "name": "R_front_toe3", "parent": "R_front_leg", "length": 58.38, "x": 62.1, "y": -0.79, "rotation": -74.67 }, - { "name": "R_rear_toe1", "parent": "R_rear_leg", "length": 94.99, "x": 90.06, "y": 2.12, "rotation": 141.98 }, - { "name": "R_rear_toe2", "parent": "R_rear_leg", "length": 99.29, "x": 89.6, "y": 1.52, "rotation": 125.32 }, - { "name": "R_rear_toe3", "parent": "R_rear_leg", "length": 103.45, "x": 91.06, "y": -0.35, "rotation": 112.26 }, - { "name": "tail3", "parent": "tail2", "length": 41.78, "x": 54.5, "y": 0.37, "rotation": 1.8 }, - { "name": "tail4", "parent": "tail3", "length": 34.19, "x": 41.78, "y": 0.16, "rotation": -1.8 }, - { "name": "tail5", "parent": "tail4", "length": 32.32, "x": 34.19, "y": -0.19, "rotation": -3.15 }, - { "name": "tail6", "parent": "tail5", "length": 80.08, "x": 32.32, "y": -0.23, "rotation": -29.55 } -], -"slots": [ - { "name": "L_rear_leg", "bone": "L_rear_leg", "attachment": "L_rear_leg" }, - { "name": "L_rear_thigh", "bone": "L_rear_thigh", "attachment": "L_rear_thigh" }, - { "name": "L_wing", "bone": "L_wing", "attachment": "L_wing01" }, - { "name": "tail6", "bone": "tail6", "attachment": "tail06" }, - { "name": "tail5", "bone": "tail5", "attachment": "tail05" }, - { "name": "tail4", "bone": "tail4", "attachment": "tail04" }, - { "name": "tail3", "bone": "tail3", "attachment": "tail03" }, - { "name": "tail2", "bone": "tail2", "attachment": "tail02" }, - { "name": "tail1", "bone": "tail1", "attachment": "tail01" }, - { "name": "back", "bone": "back", "attachment": "back" }, - { "name": "L_front_thigh", "bone": "L_front_thigh", "attachment": "L_front_thigh" }, - { "name": "L_front_leg", "bone": "L_front_leg", "attachment": "L_front_leg" }, - { "name": "L_front_toe1", "bone": "L_front_toe1", "attachment": "front_toeA" }, - { "name": "L_front_toe4", "bone": "L_front_toe4", "attachment": "front_toeB" }, - { "name": "L_front_toe3", "bone": "L_front_toe3", "attachment": "front_toeB" }, - { "name": "L_front_toe2", "bone": "L_front_toe2", "attachment": "front_toeB" }, - { "name": "chest", "bone": "chest", "attachment": "chest" }, - { "name": "R_rear_toe1", "bone": "R_rear_toe1", "attachment": "rear-toe" }, - { "name": "R_rear_toe2", "bone": "R_rear_toe2", "attachment": "rear-toe" }, - { "name": "R_rear_toe3", "bone": "R_rear_toe3", "attachment": "rear-toe" }, - { "name": "R_rear_leg", "bone": "R_rear_leg", "attachment": "R_rear_leg" }, - { "name": "R_rear_thigh", "bone": "R_rear_thigh", "attachment": "R_rear_thigh" }, - { "name": "R_front_toe1", "bone": "R_front_toe1", "attachment": "front_toeB" }, - { "name": "R_front_thigh", "bone": "R_front_thigh", "attachment": "R_front_thigh" }, - { "name": "R_front_leg", "bone": "R_front_leg", "attachment": "R_front_leg" }, - { "name": "R_front_toe2", "bone": "R_front_toe2", "attachment": "front_toeB" }, - { "name": "R_front_toe3", "bone": "R_front_toe3", "attachment": "front_toeB" }, - { "name": "chin", "bone": "chin", "attachment": "chin" }, - { "name": "R_wing", "bone": "R_wing", "attachment": "R_wing01" }, - { "name": "head", "bone": "head", "attachment": "head" }, - { "name": "logo", "bone": "root", "attachment": "logo" } -], -"skins": { - "default": { - "L_front_leg": { - "L_front_leg": { "x": 14.68, "y": 0.48, "rotation": 15.99, "width": 84, "height": 57 } - }, - "L_front_thigh": { - "L_front_thigh": { "x": 27.66, "y": -11.58, "rotation": 58.66, "width": 84, "height": 72 } - }, - "L_front_toe1": { - "front_toeA": { "x": 31.92, "y": 0.61, "rotation": 109.55, "width": 29, "height": 50 } - }, - "L_front_toe2": { - "front_toeB": { "x": 26.83, "y": -4.94, "rotation": 109.51, "width": 56, "height": 57 } - }, - "L_front_toe3": { - "front_toeB": { "x": 18.21, "y": -7.21, "scaleX": 0.881, "scaleY": 0.94, "rotation": 99.71, "width": 56, "height": 57 } - }, - "L_front_toe4": { - "front_toeB": { "x": 23.21, "y": -11.68, "scaleX": 0.881, "rotation": 79.89, "width": 56, "height": 57 } - }, - "L_rear_leg": { - "L_rear_leg": { "x": 67.29, "y": 12.62, "rotation": -162.65, "width": 206, "height": 177 } - }, - "L_rear_thigh": { - "L_rear_thigh": { "x": 56.03, "y": 27.38, "rotation": 74.93, "width": 91, "height": 149 } - }, - "L_wing": { - "L_wing01": { "x": 129.21, "y": -45.49, "rotation": -83.7, "width": 191, "height": 256 }, - "L_wing02": { "x": 126.37, "y": -31.69, "rotation": -86.18, "width": 179, "height": 269 }, - "L_wing03": { "x": 110.26, "y": -90.89, "rotation": -86.18, "width": 186, "height": 207 }, - "L_wing04": { "x": -61.61, "y": -83.26, "rotation": -86.18, "width": 188, "height": 135 }, - "L_wing05": { "x": -90.01, "y": -78.14, "rotation": -86.18, "width": 218, "height": 213 }, - "L_wing06": { "x": -143.76, "y": -83.71, "rotation": -86.18, "width": 192, "height": 331 }, - "L_wing07": { "x": -133.04, "y": -33.89, "rotation": -86.18, "width": 159, "height": 255 }, - "L_wing08": { "x": 50.15, "y": -15.71, "rotation": -86.18, "width": 164, "height": 181 }, - "L_wing09": { "x": 85.94, "y": -11.32, "rotation": -86.18, "width": 204, "height": 167 } - }, - "R_front_leg": { - "R_front_leg": { "x": 17.79, "y": 4.22, "rotation": 37.62, "width": 101, "height": 89 } - }, - "R_front_thigh": { - "R_front_thigh": { "x": 35.28, "y": 2.11, "rotation": 130.33, "width": 108, "height": 108 } - }, - "R_front_toe1": { - "front_toeB": { "x": 24.49, "y": -2.61, "rotation": 104.18, "width": 56, "height": 57 } - }, - "R_front_toe2": { - "front_toeB": { "x": 26.39, "y": 1.16, "rotation": 104.57, "width": 56, "height": 57 } - }, - "R_front_toe3": { - "front_toeB": { "x": 30.66, "y": -0.06, "rotation": 112.29, "width": 56, "height": 57 } - }, - "R_rear_leg": { - "R_rear_leg": { "x": 60.87, "y": -5.72, "rotation": -127.66, "width": 116, "height": 100 } - }, - "R_rear_thigh": { - "R_rear_thigh": { "x": 53.25, "y": 12.58, "rotation": 103.29, "width": 91, "height": 149 } - }, - "R_rear_toe1": { - "rear-toe": { "x": 54.75, "y": -5.72, "rotation": 134.79, "width": 109, "height": 77 } - }, - "R_rear_toe2": { - "rear-toe": { "x": 57.02, "y": -7.22, "rotation": 134.42, "width": 109, "height": 77 } - }, - "R_rear_toe3": { - "rear-toe": { "x": 47.46, "y": -7.64, "rotation": 134.34, "width": 109, "height": 77 } - }, - "R_wing": { - "R_wing01": { "x": 170.08, "y": -23.67, "rotation": -130.33, "width": 219, "height": 310 }, - "R_wing02": { "x": 171.14, "y": -19.33, "rotation": -130.33, "width": 203, "height": 305 }, - "R_wing03": { "x": 166.46, "y": 29.23, "rotation": -130.33, "width": 272, "height": 247 }, - "R_wing04": { "x": 42.94, "y": 134.05, "rotation": -130.33, "width": 279, "height": 144 }, - "R_wing05": { "x": -8.83, "y": 142.59, "rotation": -130.33, "width": 251, "height": 229 }, - "R_wing06": { "x": -123.33, "y": 111.22, "rotation": -130.33, "width": 200, "height": 366 }, - "R_wing07": { "x": -40.17, "y": 118.03, "rotation": -130.33, "width": 200, "height": 263 }, - "R_wing08": { "x": 48.01, "y": 28.76, "rotation": -130.33, "width": 234, "height": 254 }, - "R_wing09": { "x": 128.1, "y": 21.12, "rotation": -130.33, "width": 248, "height": 204 } - }, - "back": { - "back": { "x": 35.84, "y": 19.99, "rotation": -151.83, "width": 190, "height": 185 } - }, - "chest": { - "chest": { "x": -14.6, "y": 24.78, "rotation": -161.7, "width": 136, "height": 122 } - }, - "chin": { - "chin": { "x": 66.55, "y": 7.32, "rotation": 30.01, "width": 214, "height": 146 } - }, - "head": { - "head": { "x": 76.68, "y": 32.21, "rotation": -47.12, "width": 296, "height": 260 } - }, - "logo": { - "logo": { "y": -176.72, "width": 897, "height": 92 } - }, - "tail1": { - "tail01": { "x": 22.59, "y": -4.5, "rotation": 163.85, "width": 120, "height": 153 } - }, - "tail2": { - "tail02": { "x": 18.11, "y": -1.75, "rotation": 151.84, "width": 95, "height": 120 } - }, - "tail3": { - "tail03": { "x": 16.94, "y": -2, "rotation": 150.04, "width": 73, "height": 92 } - }, - "tail4": { - "tail04": { "x": 15.34, "y": -2.17, "rotation": 151.84, "width": 56, "height": 71 } - }, - "tail5": { - "tail05": { "x": 15.05, "y": -3.57, "rotation": 155, "width": 52, "height": 59 } - }, - "tail6": { - "tail06": { "x": 28.02, "y": -16.83, "rotation": -175.44, "width": 95, "height": 68 } - } - } -}, -"animations": { - "flying": { - "slots": { - "L_wing": { - "attachment": [ - { "time": 0, "name": "L_wing01" }, - { "time": 0.0666, "name": "L_wing02" }, - { "time": 0.1333, "name": "L_wing03" }, - { "time": 0.2, "name": "L_wing04" }, - { "time": 0.2666, "name": "L_wing05" }, - { "time": 0.3333, "name": "L_wing06" }, - { "time": 0.4, "name": "L_wing07" }, - { "time": 0.4666, "name": "L_wing08" }, - { "time": 0.5333, "name": "L_wing09" }, - { "time": 0.6, "name": "L_wing01" }, - { "time": 0.7333, "name": "L_wing02" }, - { "time": 0.8, "name": "L_wing03" }, - { "time": 0.8333, "name": "L_wing04" }, - { "time": 0.8666, "name": "L_wing05" }, - { "time": 0.9, "name": "L_wing06" }, - { "time": 0.9333, "name": "L_wing07" }, - { "time": 0.9666, "name": "L_wing08" }, - { "time": 1, "name": "L_wing01" } - ] - }, - "R_wing": { - "attachment": [ - { "time": 0, "name": "R_wing01" }, - { "time": 0.0666, "name": "R_wing02" }, - { "time": 0.1333, "name": "R_wing03" }, - { "time": 0.2, "name": "R_wing04" }, - { "time": 0.2666, "name": "R_wing05" }, - { "time": 0.3333, "name": "R_wing06" }, - { "time": 0.4, "name": "R_wing07" }, - { "time": 0.4666, "name": "R_wing08" }, - { "time": 0.5333, "name": "R_wing09" }, - { "time": 0.6, "name": "R_wing01" }, - { "time": 0.7333, "name": "R_wing02" }, - { "time": 0.7666, "name": "R_wing02" }, - { "time": 0.8, "name": "R_wing03" }, - { "time": 0.8333, "name": "R_wing04" }, - { "time": 0.8666, "name": "R_wing05" }, - { "time": 0.9, "name": "R_wing06" }, - { "time": 0.9333, "name": "R_wing07" }, - { "time": 0.9666, "name": "R_wing08" }, - { "time": 1, "name": "R_wing01" } - ] - } - }, - "bones": { - "back": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 17.39 }, - { "time": 0.5, "angle": 0 }, - { "time": 0.8333, "angle": 7 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "neck": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -8.18 }, - { "time": 0.3333, "angle": -23.16 }, - { "time": 0.5, "angle": -18.01 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "chest": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail1": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -2.42 }, - { "time": 0.3333, "angle": -26.2 }, - { "time": 0.5, "angle": -29.65 }, - { "time": 0.6666, "angle": -23.15 }, - { "time": 0.8333, "angle": -55.46 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_rear_thigh": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail2": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -1.12 }, - { "time": 0.3333, "angle": 10.48 }, - { "time": 0.5, "angle": 7.89 }, - { "time": 0.8333, "angle": -10.38 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail3": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 8.24 }, - { "time": 0.3333, "angle": 15.21 }, - { "time": 0.5, "angle": 14.84 }, - { "time": 0.8333, "angle": -18.9 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail4": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 17.46 }, - { "time": 0.3333, "angle": 22.15 }, - { "time": 0.5, "angle": 22.76 }, - { "time": 0.8333, "angle": -4.37 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail5": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 7.4 }, - { "time": 0.3333, "angle": 28.5 }, - { "time": 0.5, "angle": 21.33 }, - { "time": 0.8333, "angle": -1.27 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail6": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 45.99 }, - { "time": 0.4, "angle": 43.53 }, - { "time": 0.5, "angle": 61.79 }, - { "time": 0.8333, "angle": 13.28 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_rear_leg": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -14.21 }, - { "time": 0.5, "angle": 47.17 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_rear_toe3": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": -36.06 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_rear_toe2": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": -20.32 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_rear_toe1": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": -18.71 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "head": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.408, 1.36, 0.675, 1.43 ] - }, - { "time": 0.5, "angle": 1.03 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "chin": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.416, 1.15, 0.494, 1.27 ] - }, - { "time": 0.3333, "angle": -5.15 }, - { "time": 0.5, "angle": 9.79 }, - { "time": 0.6666, "angle": 18.94 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_thigh": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -19.18 }, - { "time": 0.3333, "angle": -32.02 }, - { "time": 0.5, "angle": -19.62 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_front_thigh": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -12.96 }, - { "time": 0.5, "angle": 16.2 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_leg": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 37.77 }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_toe1": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -16.08 }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_toe2": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.33, "y": 1.029 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_toe4": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": 26.51 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.239, "y": 0.993 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_toe3": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": 16.99 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.402, "y": 1.007 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_front_leg": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 26.07 }, - { "time": 0.5, "angle": -21.6 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_front_toe1": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 29.23 }, - { "time": 0.5, "angle": 34.83 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.412, "y": 1 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_front_toe2": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 24.89 }, - { "time": 0.5, "angle": 23.16 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.407, "y": 1.057 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_front_toe3": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 11.01 }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.329, "y": 1.181 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_rear_leg": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 25.19 }, - { "time": 0.6666, "angle": -15.65 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 } - ] - }, - "COG": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.456, 0.2, 0.422, 1.06 ] - }, - { "time": 0.3333, "angle": 23.93 }, - { - "time": 0.6666, - "angle": 337.8, - "curve": [ 0.41, 0, 0.887, 0.75 ] - }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { - "time": 0, - "x": 0, - "y": 0, - "curve": [ 0.33, 1, 0.816, 1.33 ] - }, - { - "time": 0.5, - "x": 0, - "y": 113.01, - "curve": [ 0.396, 0, 0.709, 2.03 ] - }, - { "time": 1, "x": 0, "y": 0 } - ] - } - } - } -} -} \ No newline at end of file diff --git a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/dragon.png b/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/dragon.png deleted file mode 100755 index bb1fc41..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/dragon.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/dragon2.png b/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/dragon2.png deleted file mode 100755 index 381e77a..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/dragon2.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/goblins.atlas b/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/goblins.atlas deleted file mode 100755 index c9cb702..0000000 --- a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/goblins.atlas +++ /dev/null @@ -1,293 +0,0 @@ - -goblins.png -size: 228,523 -format: RGBA8888 -filter: Linear,Linear -repeat: none -dagger - rotate: false - xy: 2, 43 - size: 26, 108 - orig: 26, 108 - offset: 0, 0 - index: -1 -goblin/eyes-closed - rotate: false - xy: 166, 237 - size: 34, 12 - orig: 34, 12 - offset: 0, 0 - index: -1 -goblin/head - rotate: false - xy: 26, 372 - size: 103, 66 - orig: 103, 66 - offset: 0, 0 - index: -1 -goblin/left-arm - rotate: false - xy: 166, 251 - size: 37, 35 - orig: 37, 35 - offset: 0, 0 - index: -1 -goblin/left-foot - rotate: true - xy: 195, 358 - size: 65, 31 - orig: 65, 31 - offset: 0, 0 - index: -1 -goblin/left-hand - rotate: false - xy: 49, 2 - size: 36, 41 - orig: 36, 41 - offset: 0, 0 - index: -1 -goblin/left-lower-leg - rotate: false - xy: 30, 45 - size: 33, 70 - orig: 33, 70 - offset: 0, 0 - index: -1 -goblin/left-shoulder - rotate: true - xy: 169, 288 - size: 29, 44 - orig: 29, 44 - offset: 0, 0 - index: -1 -goblin/left-upper-leg - rotate: false - xy: 134, 305 - size: 33, 73 - orig: 33, 73 - offset: 0, 0 - index: -1 -goblin/neck - rotate: false - xy: 87, 2 - size: 36, 41 - orig: 36, 41 - offset: 0, 0 - index: -1 -goblin/pelvis - rotate: false - xy: 131, 380 - size: 62, 43 - orig: 62, 43 - offset: 0, 0 - index: -1 -goblin/right-arm - rotate: false - xy: 135, 69 - size: 23, 50 - orig: 23, 50 - offset: 0, 0 - index: -1 -goblin/right-foot - rotate: true - xy: 104, 157 - size: 63, 33 - orig: 63, 33 - offset: 0, 0 - index: -1 -goblin/right-hand - rotate: false - xy: 190, 319 - size: 36, 37 - orig: 36, 37 - offset: 0, 0 - index: -1 -goblin/right-lower-leg - rotate: false - xy: 96, 294 - size: 36, 76 - orig: 36, 76 - offset: 0, 0 - index: -1 -goblin/right-shoulder - rotate: true - xy: 2, 2 - size: 39, 45 - orig: 39, 45 - offset: 0, 0 - index: -1 -goblin/right-upper-leg - rotate: false - xy: 139, 162 - size: 34, 63 - orig: 34, 63 - offset: 0, 0 - index: -1 -goblin/torso - rotate: false - xy: 131, 425 - size: 68, 96 - orig: 68, 96 - offset: 0, 0 - index: -1 -goblin/undie-straps - rotate: true - xy: 201, 466 - size: 55, 19 - orig: 55, 19 - offset: 0, 0 - index: -1 -goblin/undies - rotate: false - xy: 190, 51 - size: 36, 29 - orig: 36, 29 - offset: 0, 0 - index: -1 -goblingirl/eyes-closed - rotate: true - xy: 201, 427 - size: 37, 21 - orig: 37, 21 - offset: 0, 0 - index: -1 -goblingirl/head - rotate: false - xy: 26, 440 - size: 103, 81 - orig: 103, 81 - offset: 0, 0 - index: -1 -goblingirl/left-arm - rotate: true - xy: 175, 198 - size: 37, 35 - orig: 37, 35 - offset: 0, 0 - index: -1 -goblingirl/left-foot - rotate: true - xy: 133, 227 - size: 65, 31 - orig: 65, 31 - offset: 0, 0 - index: -1 -goblingirl/left-hand - rotate: true - xy: 168, 2 - size: 35, 40 - orig: 35, 40 - offset: 0, 0 - index: -1 -goblingirl/left-lower-leg - rotate: false - xy: 65, 45 - size: 33, 70 - orig: 33, 70 - offset: 0, 0 - index: -1 -goblingirl/left-shoulder - rotate: true - xy: 135, 39 - size: 28, 46 - orig: 28, 46 - offset: 0, 0 - index: -1 -goblingirl/left-upper-leg - rotate: false - xy: 98, 222 - size: 33, 70 - orig: 33, 70 - offset: 0, 0 - index: -1 -goblingirl/neck - rotate: true - xy: 125, 2 - size: 35, 41 - orig: 35, 41 - offset: 0, 0 - index: -1 -goblingirl/pelvis - rotate: false - xy: 30, 117 - size: 62, 43 - orig: 62, 43 - offset: 0, 0 - index: -1 -goblingirl/right-arm - rotate: false - xy: 160, 69 - size: 28, 50 - orig: 28, 50 - offset: 0, 0 - index: -1 -goblingirl/right-foot - rotate: true - xy: 100, 56 - size: 63, 33 - orig: 63, 33 - offset: 0, 0 - index: -1 -goblingirl/right-hand - rotate: false - xy: 190, 82 - size: 36, 37 - orig: 36, 37 - offset: 0, 0 - index: -1 -goblingirl/right-lower-leg - rotate: true - xy: 26, 162 - size: 36, 76 - orig: 36, 76 - offset: 0, 0 - index: -1 -goblingirl/right-shoulder - rotate: true - xy: 159, 121 - size: 39, 45 - orig: 39, 45 - offset: 0, 0 - index: -1 -goblingirl/right-upper-leg - rotate: true - xy: 94, 121 - size: 34, 63 - orig: 34, 63 - offset: 0, 0 - index: -1 -goblingirl/torso - rotate: false - xy: 26, 274 - size: 68, 96 - orig: 68, 96 - offset: 0, 0 - index: -1 -goblingirl/undie-straps - rotate: true - xy: 169, 323 - size: 55, 19 - orig: 55, 19 - offset: 0, 0 - index: -1 -goblingirl/undies - rotate: false - xy: 175, 167 - size: 36, 29 - orig: 36, 29 - offset: 0, 0 - index: -1 -shield - rotate: false - xy: 26, 200 - size: 70, 72 - orig: 70, 72 - offset: 0, 0 - index: -1 -spear - rotate: false - xy: 2, 153 - size: 22, 368 - orig: 22, 368 - offset: 0, 0 - index: -1 diff --git a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/goblins.json b/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/goblins.json deleted file mode 100755 index 5d83ae1..0000000 --- a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/goblins.json +++ /dev/null @@ -1 +0,0 @@ -{"skeleton":{"hash":"BMzsp4a1APif5tjCQwomTTo3Ino","spine":"2.1.05","width":233.95,"height":354.87},"bones":[{"name":"root"},{"name":"hip","parent":"root","x":0.64,"y":114.41},{"name":"left upper leg","parent":"hip","length":50.39,"x":14.45,"y":2.81,"rotation":-89.09},{"name":"pelvis","parent":"hip","x":1.41,"y":-6.57},{"name":"right upper leg","parent":"hip","length":42.45,"x":-20.07,"y":-6.83,"rotation":-97.49},{"name":"torso","parent":"hip","length":85.82,"x":-6.42,"y":1.97,"rotation":93.92},{"name":"left lower leg","parent":"left upper leg","length":49.89,"x":56.34,"y":0.98,"rotation":-16.65},{"name":"left shoulder","parent":"torso","length":35.43,"x":74.04,"y":-20.38,"rotation":-156.96},{"name":"neck","parent":"torso","length":18.38,"x":81.67,"y":-6.34,"rotation":-1.51},{"name":"right lower leg","parent":"right upper leg","length":58.52,"x":42.99,"y":-0.61,"rotation":-14.34},{"name":"right shoulder","parent":"torso","length":37.24,"x":76.02,"y":18.14,"rotation":133.88},{"name":"head","parent":"neck","length":68.28,"x":20.93,"y":11.59,"rotation":-13.92},{"name":"left arm","parent":"left shoulder","length":35.62,"x":37.85,"y":-2.34,"rotation":28.16},{"name":"left foot","parent":"left lower leg","length":46.5,"x":58.94,"y":-7.61,"rotation":102.43},{"name":"right arm","parent":"right shoulder","length":36.74,"x":37.6,"y":0.31,"rotation":36.32},{"name":"right foot","parent":"right lower leg","length":45.45,"x":64.88,"y":0.04,"rotation":110.3},{"name":"left hand","parent":"left arm","length":11.52,"x":35.62,"y":0.07,"rotation":2.7},{"name":"right hand","parent":"right arm","length":15.32,"x":36.9,"y":0.34,"rotation":2.35}],"slots":[{"name":"left shoulder","bone":"left shoulder","attachment":"left shoulder"},{"name":"left arm","bone":"left arm","attachment":"left arm"},{"name":"left hand item","bone":"left hand","attachment":"spear"},{"name":"left hand","bone":"left hand","attachment":"left hand"},{"name":"left foot","bone":"left foot","attachment":"left foot"},{"name":"left lower leg","bone":"left lower leg","attachment":"left lower leg"},{"name":"left upper leg","bone":"left upper leg","attachment":"left upper leg"},{"name":"neck","bone":"neck","attachment":"neck"},{"name":"torso","bone":"torso","attachment":"torso"},{"name":"pelvis","bone":"pelvis","attachment":"pelvis"},{"name":"right foot","bone":"right foot","attachment":"right foot"},{"name":"right lower leg","bone":"right lower leg","attachment":"right lower leg"},{"name":"undie straps","bone":"pelvis","attachment":"undie straps"},{"name":"undies","bone":"pelvis","attachment":"undies"},{"name":"right upper leg","bone":"right upper leg","attachment":"right upper leg"},{"name":"head","bone":"head","attachment":"head"},{"name":"eyes","bone":"head"},{"name":"right shoulder","bone":"right shoulder","attachment":"right shoulder"},{"name":"right arm","bone":"right arm","attachment":"right arm"},{"name":"right hand item","bone":"right hand"},{"name":"right hand","bone":"right hand","attachment":"right hand"},{"name":"right hand item top","bone":"right hand","attachment":"shield"}],"skins":{"default":{"left hand item":{"dagger":{"x":7.88,"y":-23.45,"rotation":10.47,"width":26,"height":108},"spear":{"x":-4.55,"y":39.2,"rotation":13.04,"width":22,"height":368}},"right hand item":{"dagger":{"x":6.51,"y":-24.15,"rotation":-8.06,"width":26,"height":108}},"right hand item top":{"shield":{"rotation":93.49,"width":70,"height":72}}},"goblin":{"eyes":{"eyes closed":{"name":"goblin/eyes-closed","x":32.21,"y":-21.27,"rotation":-88.92,"width":34,"height":12}},"head":{"head":{"name":"goblin/head","x":25.73,"y":2.33,"rotation":-92.29,"width":103,"height":66}},"left arm":{"left arm":{"name":"goblin/left-arm","x":16.7,"y":-1.69,"scaleX":1.057,"scaleY":1.057,"rotation":33.84,"width":37,"height":35}},"left foot":{"left foot":{"name":"goblin/left-foot","x":24.85,"y":8.74,"rotation":3.32,"width":65,"height":31}},"left hand":{"left hand":{"name":"goblin/left-hand","x":3.47,"y":3.41,"scaleX":0.892,"scaleY":0.892,"rotation":31.14,"width":36,"height":41}},"left lower leg":{"left lower leg":{"name":"goblin/left-lower-leg","x":23.58,"y":-2.06,"rotation":105.75,"width":33,"height":70}},"left shoulder":{"left shoulder":{"name":"goblin/left-shoulder","x":15.56,"y":-2.26,"rotation":62.01,"width":29,"height":44}},"left upper leg":{"left upper leg":{"name":"goblin/left-upper-leg","x":29.68,"y":-3.87,"rotation":89.09,"width":33,"height":73}},"neck":{"neck":{"name":"goblin/neck","x":10.1,"y":0.42,"rotation":-93.69,"width":36,"height":41}},"pelvis":{"pelvis":{"name":"goblin/pelvis","x":-5.61,"y":0.76,"width":62,"height":43}},"right arm":{"right arm":{"name":"goblin/right-arm","x":16.44,"y":-1.04,"rotation":94.32,"width":23,"height":50}},"right foot":{"right foot":{"name":"goblin/right-foot","x":23.56,"y":9.8,"rotation":1.52,"width":63,"height":33}},"right hand":{"right hand":{"name":"goblin/right-hand","x":7.88,"y":2.78,"rotation":91.96,"width":36,"height":37}},"right lower leg":{"right lower leg":{"name":"goblin/right-lower-leg","x":25.68,"y":-3.15,"rotation":111.83,"width":36,"height":76}},"right shoulder":{"right shoulder":{"name":"goblin/right-shoulder","x":15.68,"y":-1.03,"rotation":130.65,"width":39,"height":45}},"right upper leg":{"right upper leg":{"name":"goblin/right-upper-leg","x":20.35,"y":1.47,"rotation":97.49,"width":34,"height":63}},"torso":{"torso":{"name":"goblin/torso","x":38.09,"y":-3.87,"rotation":-94.95,"width":68,"height":96}},"undie straps":{"undie straps":{"name":"goblin/undie-straps","x":-3.87,"y":13.1,"scaleX":1.089,"width":55,"height":19}},"undies":{"undies":{"name":"goblin/undies","x":6.3,"y":0.12,"rotation":0.91,"width":36,"height":29}}},"goblingirl":{"eyes":{"eyes closed":{"name":"goblingirl/eyes-closed","x":28,"y":-25.54,"rotation":-87.04,"width":37,"height":21}},"head":{"head":{"name":"goblingirl/head","x":27.71,"y":-4.32,"rotation":-85.58,"width":103,"height":81}},"left arm":{"left arm":{"name":"goblingirl/left-arm","x":19.64,"y":-2.42,"rotation":33.05,"width":37,"height":35}},"left foot":{"left foot":{"name":"goblingirl/left-foot","x":25.17,"y":7.92,"rotation":3.32,"width":65,"height":31}},"left hand":{"left hand":{"name":"goblingirl/left-hand","x":4.34,"y":2.39,"scaleX":0.896,"scaleY":0.896,"rotation":30.34,"width":35,"height":40}},"left lower leg":{"left lower leg":{"name":"goblingirl/left-lower-leg","x":25.02,"y":-0.6,"rotation":105.75,"width":33,"height":70}},"left shoulder":{"left shoulder":{"name":"goblingirl/left-shoulder","x":19.8,"y":-0.42,"rotation":61.21,"width":28,"height":46}},"left upper leg":{"left upper leg":{"name":"goblingirl/left-upper-leg","x":30.21,"y":-2.95,"rotation":89.09,"width":33,"height":70}},"neck":{"neck":{"name":"goblingirl/neck","x":6.16,"y":-3.14,"rotation":-98.86,"width":35,"height":41}},"pelvis":{"pelvis":{"name":"goblingirl/pelvis","x":-3.87,"y":3.18,"width":62,"height":43}},"right arm":{"right arm":{"name":"goblingirl/right-arm","x":16.85,"y":-0.66,"rotation":93.52,"width":28,"height":50}},"right foot":{"right foot":{"name":"goblingirl/right-foot","x":23.46,"y":9.66,"rotation":1.52,"width":63,"height":33}},"right hand":{"right hand":{"name":"goblingirl/right-hand","x":7.21,"y":3.43,"rotation":91.16,"width":36,"height":37}},"right lower leg":{"right lower leg":{"name":"goblingirl/right-lower-leg","x":26.15,"y":-3.27,"rotation":111.83,"width":36,"height":76}},"right shoulder":{"right shoulder":{"name":"goblingirl/right-shoulder","x":14.46,"y":0.45,"rotation":129.85,"width":39,"height":45}},"right upper leg":{"right upper leg":{"name":"goblingirl/right-upper-leg","x":19.69,"y":2.13,"rotation":97.49,"width":34,"height":63}},"torso":{"torso":{"name":"goblingirl/torso","x":36.28,"y":-5.14,"rotation":-95.74,"width":68,"height":96}},"undie straps":{"undie straps":{"name":"goblingirl/undie-straps","x":-1.51,"y":14.18,"width":55,"height":19}},"undies":{"undies":{"name":"goblingirl/undies","x":5.4,"y":1.7,"width":36,"height":29}}}},"animations":{"walk":{"slots":{"eyes":{"attachment":[{"time":0.7,"name":"eyes closed"},{"time":0.8,"name":null}]}},"bones":{"left upper leg":{"rotate":[{"time":0,"angle":-26.55},{"time":0.1333,"angle":-8.78},{"time":0.2333,"angle":9.51},{"time":0.3666,"angle":30.74},{"time":0.5,"angle":25.33},{"time":0.6333,"angle":26.11},{"time":0.7333,"angle":-7.7},{"time":0.8666,"angle":-21.19},{"time":1,"angle":-26.55}],"translate":[{"time":0,"x":-1.32,"y":1.7},{"time":0.3666,"x":-0.06,"y":2.42},{"time":1,"x":-1.32,"y":1.7}]},"right upper leg":{"rotate":[{"time":0,"angle":42.45},{"time":0.1333,"angle":52.1},{"time":0.2333,"angle":8.53},{"time":0.5,"angle":-16.93},{"time":0.6333,"angle":1.89},{"time":0.7333,"angle":28.06,"curve":[0.462,0.11,1,1]},{"time":0.8666,"angle":58.68,"curve":[0.5,0.02,1,1]},{"time":1,"angle":42.45}],"translate":[{"time":0,"x":6.23,"y":0},{"time":0.2333,"x":2.14,"y":2.4},{"time":0.5,"x":2.44,"y":4.8},{"time":1,"x":6.23,"y":0}]},"left lower leg":{"rotate":[{"time":0,"angle":-22.98},{"time":0.1333,"angle":-63.5},{"time":0.2333,"angle":-73.76},{"time":0.5,"angle":5.11},{"time":0.6333,"angle":-28.29},{"time":0.7333,"angle":4.08},{"time":0.8666,"angle":3.53},{"time":1,"angle":-22.98}],"translate":[{"time":0,"x":0,"y":0},{"time":0.2333,"x":2.55,"y":-0.47},{"time":0.5,"x":0,"y":0,"curve":"stepped"},{"time":1,"x":0,"y":0}]},"left foot":{"rotate":[{"time":0,"angle":-3.69},{"time":0.1333,"angle":-10.42},{"time":0.2333,"angle":-5.01},{"time":0.3666,"angle":3.87},{"time":0.5,"angle":-3.87},{"time":0.6333,"angle":2.78},{"time":0.7333,"angle":1.68},{"time":0.8666,"angle":-8.54},{"time":1,"angle":-3.69}]},"right shoulder":{"rotate":[{"time":0,"angle":5.29,"curve":[0.264,0,0.75,1]},{"time":0.6333,"angle":6.65},{"time":1,"angle":5.29}]},"right arm":{"rotate":[{"time":0,"angle":-4.02,"curve":[0.267,0,0.804,0.99]},{"time":0.6333,"angle":19.78,"curve":[0.307,0,0.787,0.99]},{"time":1,"angle":-4.02}]},"right hand":{"rotate":[{"time":0,"angle":8.98},{"time":0.6333,"angle":0.51},{"time":1,"angle":8.98}]},"left shoulder":{"rotate":[{"time":0,"angle":6.25,"curve":[0.339,0,0.683,1]},{"time":0.5,"angle":-11.78,"curve":[0.281,0,0.686,0.99]},{"time":1,"angle":6.25}],"translate":[{"time":0,"x":1.15,"y":0.23}]},"left hand":{"rotate":[{"time":0,"angle":-21.23,"curve":[0.295,0,0.755,0.98]},{"time":0.5,"angle":-27.28,"curve":[0.241,0,0.75,0.97]},{"time":1,"angle":-21.23}]},"left arm":{"rotate":[{"time":0,"angle":28.37,"curve":[0.339,0,0.683,1]},{"time":0.5,"angle":60.09,"curve":[0.281,0,0.686,0.99]},{"time":1,"angle":28.37}]},"torso":{"rotate":[{"time":0,"angle":-10.28},{"time":0.1333,"angle":-15.38,"curve":[0.545,0,0.818,1]},{"time":0.3666,"angle":-9.78,"curve":[0.58,0.17,0.669,0.99]},{"time":0.6333,"angle":-15.75,"curve":[0.235,0.01,0.795,1]},{"time":0.8666,"angle":-7.06,"curve":[0.209,0,0.816,0.98]},{"time":1,"angle":-10.28}],"translate":[{"time":0,"x":-1.29,"y":1.68}]},"right foot":{"rotate":[{"time":0,"angle":-5.25},{"time":0.2333,"angle":-1.91},{"time":0.3666,"angle":-6.45},{"time":0.5,"angle":-5.39},{"time":0.7333,"angle":-11.68},{"time":0.8666,"angle":0.46},{"time":1,"angle":-5.25}]},"right lower leg":{"rotate":[{"time":0,"angle":-3.39,"curve":[0.316,0.01,0.741,0.98]},{"time":0.1333,"angle":-45.53,"curve":[0.229,0,0.738,0.97]},{"time":0.2333,"angle":-4.83},{"time":0.5,"angle":-19.53},{"time":0.6333,"angle":-64.8},{"time":0.7333,"angle":-82.56,"curve":[0.557,0.18,1,1]},{"time":1,"angle":-3.39}],"translate":[{"time":0,"x":0,"y":0,"curve":"stepped"},{"time":0.5,"x":0,"y":0},{"time":0.6333,"x":2.18,"y":0.21},{"time":1,"x":0,"y":0}]},"hip":{"rotate":[{"time":0,"angle":0,"curve":"stepped"},{"time":1,"angle":0}],"translate":[{"time":0,"x":0,"y":-4.16},{"time":0.1333,"x":0,"y":-7.05,"curve":[0.359,0.47,0.646,0.74]},{"time":0.3666,"x":0,"y":6.78},{"time":0.5,"x":0,"y":-6.13},{"time":0.6333,"x":0,"y":-7.05,"curve":[0.359,0.47,0.646,0.74]},{"time":0.8666,"x":0,"y":6.78},{"time":1,"x":0,"y":-4.16}]},"neck":{"rotate":[{"time":0,"angle":3.6},{"time":0.1333,"angle":17.49},{"time":0.2333,"angle":6.1},{"time":0.3666,"angle":3.45},{"time":0.5,"angle":5.17},{"time":0.6333,"angle":18.36},{"time":0.7333,"angle":6.09},{"time":0.8666,"angle":2.28},{"time":1,"angle":3.6}]},"head":{"rotate":[{"time":0,"angle":3.6,"curve":[0,0,0.704,1.17]},{"time":0.1333,"angle":-0.2},{"time":0.2333,"angle":6.1},{"time":0.3666,"angle":3.45},{"time":0.5,"angle":5.17,"curve":[0,0,0.704,1.61]},{"time":0.6666,"angle":1.1},{"time":0.7333,"angle":6.09},{"time":0.8666,"angle":2.28},{"time":1,"angle":3.6}]}}}}} \ No newline at end of file diff --git a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/goblins.png b/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/goblins.png deleted file mode 100755 index f2cdf16..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/goblins.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/iP4_BGtile.jpg b/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/iP4_BGtile.jpg deleted file mode 100755 index 767a4fd..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/iP4_BGtile.jpg and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/iP4_ground.png b/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/iP4_ground.png deleted file mode 100755 index a7f92af..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/iP4_ground.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/spineboy.atlas b/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/spineboy.atlas deleted file mode 100755 index cf32cd0..0000000 --- a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/spineboy.atlas +++ /dev/null @@ -1,165 +0,0 @@ -spineboy.png -format: RGBA8888 -filter: Linear,Linear -repeat: none -eyes-closed - rotate: false - xy: 73, 509 - size: 34, 27 - orig: 34, 27 - offset: 0, 0 - index: -1 -eyes - rotate: false - xy: 75, 464 - size: 34, 27 - orig: 34, 27 - offset: 0, 0 - index: -1 -head - rotate: false - xy: 2, 2 - size: 121, 132 - orig: 121, 132 - offset: 0, 0 - index: -1 -left-ankle - rotate: false - xy: 96, 351 - size: 25, 32 - orig: 25, 32 - offset: 0, 0 - index: -1 -left-arm - rotate: false - xy: 39, 423 - size: 35, 29 - orig: 35, 29 - offset: 0, 0 - index: -1 -left-foot - rotate: false - xy: 2, 262 - size: 65, 30 - orig: 65, 30 - offset: 0, 0 - index: -1 -left-hand - rotate: false - xy: 2, 423 - size: 35, 38 - orig: 35, 38 - offset: 0, 0 - index: -1 -left-lower-leg - rotate: false - xy: 72, 202 - size: 49, 64 - orig: 49, 64 - offset: 0, 0 - index: -1 -left-pant-bottom - rotate: false - xy: 2, 363 - size: 44, 22 - orig: 44, 22 - offset: 0, 0 - index: -1 -left-shoulder - rotate: false - xy: 39, 454 - size: 34, 53 - orig: 34, 53 - offset: 0, 0 - index: -1 -left-upper-leg - rotate: false - xy: 2, 464 - size: 33, 67 - orig: 33, 67 - offset: 0, 0 - index: -1 -neck - rotate: false - xy: 37, 509 - size: 34, 28 - orig: 34, 28 - offset: 0, 0 - index: -1 -pelvis - rotate: false - xy: 2, 294 - size: 63, 47 - orig: 63, 47 - offset: 0, 0 - index: -1 -right-ankle - rotate: false - xy: 96, 385 - size: 25, 30 - orig: 25, 30 - offset: 0, 0 - index: -1 -right-arm - rotate: false - xy: 96, 417 - size: 21, 45 - orig: 21, 45 - offset: 0, 0 - index: -1 -right-foot-idle - rotate: false - xy: 69, 268 - size: 53, 28 - orig: 53, 28 - offset: 0, 0 - index: -1 -right-foot - rotate: false - xy: 2, 230 - size: 67, 30 - orig: 67, 30 - offset: 0, 0 - index: -1 -right-hand - rotate: false - xy: 2, 387 - size: 32, 32 - orig: 32, 32 - offset: 0, 0 - index: -1 -right-lower-leg - rotate: false - xy: 72, 136 - size: 51, 64 - orig: 51, 64 - offset: 0, 0 - index: -1 -right-pant-bottom - rotate: false - xy: 2, 343 - size: 46, 18 - orig: 46, 18 - offset: 0, 0 - index: -1 -right-shoulder - rotate: false - xy: 67, 298 - size: 52, 51 - orig: 52, 51 - offset: 0, 0 - index: -1 -right-upper-leg - rotate: false - xy: 50, 351 - size: 44, 70 - orig: 44, 70 - offset: 0, 0 - index: -1 -torso - rotate: false - xy: 2, 136 - size: 68, 92 - orig: 68, 92 - offset: 0, 0 - index: -1 diff --git a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/spineboy.json b/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/spineboy.json deleted file mode 100755 index 17c5095..0000000 --- a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/spineboy.json +++ /dev/null @@ -1,787 +0,0 @@ -{ -"bones": [ - { "name": "root" }, - { "name": "hip", "parent": "root", "x": 0.64, "y": 114.41 }, - { "name": "left upper leg", "parent": "hip", "length": 50.39, "x": 14.45, "y": 2.81, "rotation": -89.09 }, - { "name": "left lower leg", "parent": "left upper leg", "length": 56.45, "x": 51.78, "y": 3.46, "rotation": -16.65 }, - { "name": "left foot", "parent": "left lower leg", "length": 46.5, "x": 64.02, "y": -8.67, "rotation": 102.43 }, - { "name": "right upper leg", "parent": "hip", "length": 45.76, "x": -18.27, "rotation": -101.13 }, - { "name": "right lower leg", "parent": "right upper leg", "length": 58.52, "x": 50.21, "y": 0.6, "rotation": -10.7 }, - { "name": "right foot", "parent": "right lower leg", "length": 45.45, "x": 64.88, "y": 0.04, "rotation": 110.3 }, - { "name": "torso", "parent": "hip", "length": 85.82, "x": -6.42, "y": 1.97, "rotation": 94.95 }, - { "name": "neck", "parent": "torso", "length": 18.38, "x": 83.64, "y": -1.78, "rotation": 0.9 }, - { "name": "head", "parent": "neck", "length": 68.28, "x": 19.09, "y": 6.97, "rotation": -8.94 }, - { "name": "right shoulder", "parent": "torso", "length": 49.95, "x": 81.9, "y": 6.79, "rotation": 130.6 }, - { "name": "right arm", "parent": "right shoulder", "length": 36.74, "x": 49.95, "y": -0.12, "rotation": 40.12 }, - { "name": "right hand", "parent": "right arm", "length": 15.32, "x": 36.9, "y": 0.34, "rotation": 2.35 }, - { "name": "left shoulder", "parent": "torso", "length": 44.19, "x": 78.96, "y": -15.75, "rotation": -156.96 }, - { "name": "left arm", "parent": "left shoulder", "length": 35.62, "x": 44.19, "y": -0.01, "rotation": 28.16 }, - { "name": "left hand", "parent": "left arm", "length": 11.52, "x": 35.62, "y": 0.07, "rotation": 2.7 }, - { "name": "pelvis", "parent": "hip", "x": 1.41, "y": -6.57 } -], -"slots": [ - { "name": "left shoulder", "bone": "left shoulder", "attachment": "left-shoulder" }, - { "name": "left arm", "bone": "left arm", "attachment": "left-arm" }, - { "name": "left hand", "bone": "left hand", "attachment": "left-hand" }, - { "name": "left foot", "bone": "left foot", "attachment": "left-foot" }, - { "name": "left lower leg", "bone": "left lower leg", "attachment": "left-lower-leg" }, - { "name": "left upper leg", "bone": "left upper leg", "attachment": "left-upper-leg" }, - { "name": "pelvis", "bone": "pelvis", "attachment": "pelvis" }, - { "name": "right foot", "bone": "right foot", "attachment": "right-foot" }, - { "name": "right lower leg", "bone": "right lower leg", "attachment": "right-lower-leg" }, - { "name": "right upper leg", "bone": "right upper leg", "attachment": "right-upper-leg" }, - { "name": "torso", "bone": "torso", "attachment": "torso" }, - { "name": "neck", "bone": "neck", "attachment": "neck" }, - { "name": "head", "bone": "head", "attachment": "head" }, - { "name": "eyes", "bone": "head", "attachment": "eyes" }, - { "name": "right shoulder", "bone": "right shoulder", "attachment": "right-shoulder" }, - { "name": "right arm", "bone": "right arm", "attachment": "right-arm" }, - { "name": "right hand", "bone": "right hand", "attachment": "right-hand" } -], -"skins": { - "default": { - "left shoulder": { - "left-shoulder": { "x": 23.74, "y": 0.11, "rotation": 62.01, "width": 34, "height": 53 } - }, - "left arm": { - "left-arm": { "x": 15.11, "y": -0.44, "rotation": 33.84, "width": 35, "height": 29 } - }, - "left hand": { - "left-hand": { "x": 0.75, "y": 1.86, "rotation": 31.14, "width": 35, "height": 38 } - }, - "left foot": { - "left-foot": { "x": 24.35, "y": 8.88, "rotation": 3.32, "width": 65, "height": 30 } - }, - "left lower leg": { - "left-lower-leg": { "x": 24.55, "y": -1.92, "rotation": 105.75, "width": 49, "height": 64 } - }, - "left upper leg": { - "left-upper-leg": { "x": 26.12, "y": -1.85, "rotation": 89.09, "width": 33, "height": 67 } - }, - "pelvis": { - "pelvis": { "x": -4.83, "y": 10.62, "width": 63, "height": 47 } - }, - "right foot": { - "right-foot": { "x": 19.02, "y": 8.47, "rotation": 1.52, "width": 67, "height": 30 } - }, - "right lower leg": { - "right-lower-leg": { "x": 23.28, "y": -2.59, "rotation": 111.83, "width": 51, "height": 64 } - }, - "right upper leg": { - "right-upper-leg": { "x": 23.03, "y": 0.25, "rotation": 101.13, "width": 44, "height": 70 } - }, - "torso": { - "torso": { "x": 44.57, "y": -7.08, "rotation": -94.95, "width": 68, "height": 92 } - }, - "neck": { - "neck": { "x": 9.42, "y": -3.66, "rotation": -100.15, "width": 34, "height": 28 } - }, - "head": { - "head": { "x": 53.94, "y": -5.75, "rotation": -86.9, "width": 121, "height": 132 } - }, - "eyes": { - "eyes": { "x": 28.94, "y": -32.92, "rotation": -86.9, "width": 34, "height": 27 }, - "eyes-closed": { "x": 28.77, "y": -32.86, "rotation": -86.9, "width": 34, "height": 27 } - }, - "right shoulder": { - "right-shoulder": { "x": 25.86, "y": 0.03, "rotation": 134.44, "width": 52, "height": 51 } - }, - "right arm": { - "right-arm": { "x": 18.34, "y": -2.64, "rotation": 94.32, "width": 21, "height": 45 } - }, - "right hand": { - "right-hand": { "x": 6.82, "y": 1.25, "rotation": 91.96, "width": 32, "height": 32 } - } - } -}, -"animations": { - "walk": { - "bones": { - "left upper leg": { - "rotate": [ - { "time": 0, "angle": -26.55 }, - { "time": 0.1333, "angle": -8.78 }, - { "time": 0.2666, "angle": 9.51 }, - { "time": 0.4, "angle": 30.74 }, - { "time": 0.5333, "angle": 25.33 }, - { "time": 0.6666, "angle": 26.11 }, - { "time": 0.8, "angle": -7.7 }, - { "time": 0.9333, "angle": -21.19 }, - { "time": 1.0666, "angle": -26.55 } - ], - "translate": [ - { "time": 0, "x": -3, "y": -2.25 }, - { "time": 0.4, "x": -2.18, "y": -2.25 }, - { "time": 1.0666, "x": -3, "y": -2.25 } - ] - }, - "right upper leg": { - "rotate": [ - { "time": 0, "angle": 42.45 }, - { "time": 0.1333, "angle": 52.1 }, - { "time": 0.2666, "angle": 5.96 }, - { "time": 0.5333, "angle": -16.93 }, - { "time": 0.6666, "angle": 1.89 }, - { - "time": 0.8, - "angle": 28.06, - "curve": [ 0.462, 0.11, 1, 1 ] - }, - { - "time": 0.9333, - "angle": 58.68, - "curve": [ 0.5, 0.02, 1, 1 ] - }, - { "time": 1.0666, "angle": 42.45 } - ], - "translate": [ - { "time": 0, "x": 8.11, "y": -2.36 }, - { "time": 0.1333, "x": 10.03, "y": -2.56 }, - { "time": 0.4, "x": 2.76, "y": -2.97 }, - { "time": 0.5333, "x": 2.76, "y": -2.81 }, - { "time": 0.9333, "x": 8.67, "y": -2.54 }, - { "time": 1.0666, "x": 8.11, "y": -2.36 } - ] - }, - "left lower leg": { - "rotate": [ - { "time": 0, "angle": -10.21 }, - { "time": 0.1333, "angle": -55.64 }, - { "time": 0.2666, "angle": -68.12 }, - { "time": 0.5333, "angle": 5.11 }, - { "time": 0.6666, "angle": -28.29 }, - { "time": 0.8, "angle": 4.08 }, - { "time": 0.9333, "angle": 3.53 }, - { "time": 1.0666, "angle": -10.21 } - ] - }, - "left foot": { - "rotate": [ - { "time": 0, "angle": -3.69 }, - { "time": 0.1333, "angle": -10.42 }, - { "time": 0.2666, "angle": -17.14 }, - { "time": 0.4, "angle": -2.83 }, - { "time": 0.5333, "angle": -3.87 }, - { "time": 0.6666, "angle": 2.78 }, - { "time": 0.8, "angle": 1.68 }, - { "time": 0.9333, "angle": -8.54 }, - { "time": 1.0666, "angle": -3.69 } - ] - }, - "right shoulder": { - "rotate": [ - { - "time": 0, - "angle": 20.89, - "curve": [ 0.264, 0, 0.75, 1 ] - }, - { - "time": 0.1333, - "angle": 3.72, - "curve": [ 0.272, 0, 0.841, 1 ] - }, - { "time": 0.6666, "angle": -278.28 }, - { "time": 1.0666, "angle": 20.89 } - ], - "translate": [ - { "time": 0, "x": -7.84, "y": 7.19 }, - { "time": 0.1333, "x": -6.36, "y": 6.42 }, - { "time": 0.6666, "x": -11.07, "y": 5.25 }, - { "time": 1.0666, "x": -7.84, "y": 7.19 } - ] - }, - "right arm": { - "rotate": [ - { - "time": 0, - "angle": -4.02, - "curve": [ 0.267, 0, 0.804, 0.99 ] - }, - { - "time": 0.1333, - "angle": -13.99, - "curve": [ 0.341, 0, 1, 1 ] - }, - { - "time": 0.6666, - "angle": 36.54, - "curve": [ 0.307, 0, 0.787, 0.99 ] - }, - { "time": 1.0666, "angle": -4.02 } - ] - }, - "right hand": { - "rotate": [ - { "time": 0, "angle": 22.92 }, - { "time": 0.4, "angle": -8.97 }, - { "time": 0.6666, "angle": 0.51 }, - { "time": 1.0666, "angle": 22.92 } - ] - }, - "left shoulder": { - "rotate": [ - { "time": 0, "angle": -1.47 }, - { "time": 0.1333, "angle": 13.6 }, - { "time": 0.6666, "angle": 280.74 }, - { "time": 1.0666, "angle": -1.47 } - ], - "translate": [ - { "time": 0, "x": -1.76, "y": 0.56 }, - { "time": 0.6666, "x": -2.47, "y": 8.14 }, - { "time": 1.0666, "x": -1.76, "y": 0.56 } - ] - }, - "left hand": { - "rotate": [ - { - "time": 0, - "angle": 11.58, - "curve": [ 0.169, 0.37, 0.632, 1.55 ] - }, - { - "time": 0.1333, - "angle": 28.13, - "curve": [ 0.692, 0, 0.692, 0.99 ] - }, - { - "time": 0.6666, - "angle": -27.42, - "curve": [ 0.117, 0.41, 0.738, 1.76 ] - }, - { "time": 0.8, "angle": -36.32 }, - { "time": 1.0666, "angle": 11.58 } - ] - }, - "left arm": { - "rotate": [ - { "time": 0, "angle": -8.27 }, - { "time": 0.1333, "angle": 18.43 }, - { "time": 0.6666, "angle": 0.88 }, - { "time": 1.0666, "angle": -8.27 } - ] - }, - "torso": { - "rotate": [ - { "time": 0, "angle": -10.28 }, - { - "time": 0.1333, - "angle": -15.38, - "curve": [ 0.545, 0, 1, 1 ] - }, - { - "time": 0.4, - "angle": -9.78, - "curve": [ 0.58, 0.17, 1, 1 ] - }, - { "time": 0.6666, "angle": -15.75 }, - { "time": 0.9333, "angle": -7.06 }, - { "time": 1.0666, "angle": -10.28 } - ], - "translate": [ - { "time": 0, "x": -3.67, "y": 1.68 }, - { "time": 0.1333, "x": -3.67, "y": 0.68 }, - { "time": 0.4, "x": -3.67, "y": 1.97 }, - { "time": 0.6666, "x": -3.67, "y": -0.14 }, - { "time": 1.0666, "x": -3.67, "y": 1.68 } - ] - }, - "right foot": { - "rotate": [ - { "time": 0, "angle": -5.25 }, - { "time": 0.2666, "angle": -4.08 }, - { "time": 0.4, "angle": -6.45 }, - { "time": 0.5333, "angle": -5.39 }, - { "time": 0.8, "angle": -11.68 }, - { "time": 0.9333, "angle": 0.46 }, - { "time": 1.0666, "angle": -5.25 } - ] - }, - "right lower leg": { - "rotate": [ - { "time": 0, "angle": -3.39 }, - { "time": 0.1333, "angle": -45.53 }, - { "time": 0.2666, "angle": -2.59 }, - { "time": 0.5333, "angle": -19.53 }, - { "time": 0.6666, "angle": -64.8 }, - { - "time": 0.8, - "angle": -82.56, - "curve": [ 0.557, 0.18, 1, 1 ] - }, - { "time": 1.0666, "angle": -3.39 } - ] - }, - "hip": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 1.0666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { - "time": 0.1333, - "x": 0, - "y": -7.61, - "curve": [ 0.272, 0.86, 1, 1 ] - }, - { "time": 0.4, "x": 0, "y": 8.7 }, - { "time": 0.5333, "x": 0, "y": -0.41 }, - { - "time": 0.6666, - "x": 0, - "y": -7.05, - "curve": [ 0.235, 0.89, 1, 1 ] - }, - { "time": 0.8, "x": 0, "y": 2.92 }, - { "time": 0.9333, "x": 0, "y": 6.78 }, - { "time": 1.0666, "x": 0, "y": 0 } - ] - }, - "neck": { - "rotate": [ - { "time": 0, "angle": 3.6 }, - { "time": 0.1333, "angle": 17.49 }, - { "time": 0.2666, "angle": 6.1 }, - { "time": 0.4, "angle": 3.45 }, - { "time": 0.5333, "angle": 5.17 }, - { "time": 0.6666, "angle": 18.36 }, - { "time": 0.8, "angle": 6.09 }, - { "time": 0.9333, "angle": 2.28 }, - { "time": 1.0666, "angle": 3.6 } - ] - }, - "head": { - "rotate": [ - { - "time": 0, - "angle": 3.6, - "curve": [ 0, 0, 0.704, 1.61 ] - }, - { "time": 0.1666, "angle": -0.2 }, - { "time": 0.2666, "angle": 6.1 }, - { "time": 0.4, "angle": 3.45 }, - { - "time": 0.5333, - "angle": 5.17, - "curve": [ 0, 0, 0.704, 1.61 ] - }, - { "time": 0.7, "angle": 1.1 }, - { "time": 0.8, "angle": 6.09 }, - { "time": 0.9333, "angle": 2.28 }, - { "time": 1.0666, "angle": 3.6 } - ] - } - } - }, - "jump": { - "bones": { - "hip": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.9333, "angle": 0, "curve": "stepped" }, - { "time": 1.3666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": -11.57, "y": -3 }, - { "time": 0.2333, "x": -16.2, "y": -19.43 }, - { - "time": 0.3333, - "x": 7.66, - "y": -8.48, - "curve": [ 0.057, 0.06, 0.712, 1 ] - }, - { "time": 0.3666, "x": 15.38, "y": 5.01 }, - { "time": 0.4666, "x": -7.84, "y": 57.22 }, - { - "time": 0.6, - "x": -10.81, - "y": 96.34, - "curve": [ 0.241, 0, 1, 1 ] - }, - { "time": 0.7333, "x": -7.01, "y": 54.7 }, - { "time": 0.8, "x": -10.58, "y": 32.2 }, - { "time": 0.9333, "x": -31.99, "y": 0.45 }, - { "time": 1.0666, "x": -12.48, "y": -29.47 }, - { "time": 1.3666, "x": -11.57, "y": -3 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left upper leg": { - "rotate": [ - { "time": 0, "angle": 17.13 }, - { "time": 0.2333, "angle": 44.35 }, - { "time": 0.3333, "angle": 16.46 }, - { "time": 0.4, "angle": -9.88 }, - { "time": 0.4666, "angle": -11.42 }, - { "time": 0.5666, "angle": 23.46 }, - { "time": 0.7666, "angle": 71.82 }, - { "time": 0.9333, "angle": 65.53 }, - { "time": 1.0666, "angle": 51.01 }, - { "time": 1.3666, "angle": 17.13 } - ], - "translate": [ - { "time": 0, "x": -3, "y": -2.25, "curve": "stepped" }, - { "time": 0.9333, "x": -3, "y": -2.25, "curve": "stepped" }, - { "time": 1.3666, "x": -3, "y": -2.25 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left lower leg": { - "rotate": [ - { "time": 0, "angle": -16.25 }, - { "time": 0.2333, "angle": -52.21 }, - { "time": 0.4, "angle": 15.04 }, - { "time": 0.4666, "angle": -8.95 }, - { "time": 0.5666, "angle": -39.53 }, - { "time": 0.7666, "angle": -27.27 }, - { "time": 0.9333, "angle": -3.52 }, - { "time": 1.0666, "angle": -61.92 }, - { "time": 1.3666, "angle": -16.25 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left foot": { - "rotate": [ - { "time": 0, "angle": 0.33 }, - { "time": 0.2333, "angle": 6.2 }, - { "time": 0.3333, "angle": 14.73 }, - { "time": 0.4, "angle": -15.54 }, - { "time": 0.4333, "angle": -21.2 }, - { "time": 0.5666, "angle": -7.55 }, - { "time": 0.7666, "angle": -0.67 }, - { "time": 0.9333, "angle": -0.58 }, - { "time": 1.0666, "angle": 14.64 }, - { "time": 1.3666, "angle": 0.33 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right upper leg": { - "rotate": [ - { "time": 0, "angle": 25.97 }, - { "time": 0.2333, "angle": 46.43 }, - { "time": 0.3333, "angle": 22.61 }, - { "time": 0.4, "angle": 2.13 }, - { - "time": 0.4666, - "angle": 0.04, - "curve": [ 0, 0, 0.637, 0.98 ] - }, - { "time": 0.6, "angle": 65.55 }, - { "time": 0.7666, "angle": 64.93 }, - { "time": 0.9333, "angle": 41.08 }, - { "time": 1.0666, "angle": 66.25 }, - { "time": 1.3666, "angle": 25.97 } - ], - "translate": [ - { "time": 0, "x": 5.74, "y": 0.61 }, - { "time": 0.2333, "x": 4.79, "y": 1.79 }, - { "time": 0.3333, "x": 6.05, "y": -4.55 }, - { "time": 0.9333, "x": 4.79, "y": 1.79, "curve": "stepped" }, - { "time": 1.0666, "x": 4.79, "y": 1.79 }, - { "time": 1.3666, "x": 5.74, "y": 0.61 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right lower leg": { - "rotate": [ - { "time": 0, "angle": -27.46 }, - { "time": 0.2333, "angle": -64.03 }, - { "time": 0.4, "angle": -48.36 }, - { "time": 0.5666, "angle": -76.86 }, - { "time": 0.7666, "angle": -26.89 }, - { "time": 0.9, "angle": -18.97 }, - { "time": 0.9333, "angle": -14.18 }, - { "time": 1.0666, "angle": -80.45 }, - { "time": 1.3666, "angle": -27.46 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right foot": { - "rotate": [ - { "time": 0, "angle": 1.08 }, - { "time": 0.2333, "angle": 16.02 }, - { "time": 0.3, "angle": 12.94 }, - { "time": 0.3333, "angle": 15.16 }, - { "time": 0.4, "angle": -14.7 }, - { "time": 0.4333, "angle": -12.85 }, - { "time": 0.4666, "angle": -19.18 }, - { "time": 0.5666, "angle": -15.82 }, - { "time": 0.6, "angle": -3.59 }, - { "time": 0.7666, "angle": -3.56 }, - { "time": 0.9333, "angle": 1.86 }, - { "time": 1.0666, "angle": 16.02 }, - { "time": 1.3666, "angle": 1.08 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "torso": { - "rotate": [ - { "time": 0, "angle": -13.35 }, - { "time": 0.2333, "angle": -48.95 }, - { "time": 0.4333, "angle": -35.77 }, - { "time": 0.6, "angle": -4.59 }, - { "time": 0.7666, "angle": 14.61 }, - { "time": 0.9333, "angle": 15.74 }, - { "time": 1.0666, "angle": -32.44 }, - { "time": 1.3666, "angle": -13.35 } - ], - "translate": [ - { "time": 0, "x": -3.67, "y": 1.68, "curve": "stepped" }, - { "time": 0.9333, "x": -3.67, "y": 1.68, "curve": "stepped" }, - { "time": 1.3666, "x": -3.67, "y": 1.68 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "neck": { - "rotate": [ - { "time": 0, "angle": 12.78 }, - { "time": 0.2333, "angle": 16.46 }, - { "time": 0.4, "angle": 26.49 }, - { "time": 0.6, "angle": 15.51 }, - { "time": 0.7666, "angle": 1.34 }, - { "time": 0.9333, "angle": 2.35 }, - { "time": 1.0666, "angle": 6.08 }, - { "time": 1.3, "angle": 21.23 }, - { "time": 1.3666, "angle": 12.78 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "head": { - "rotate": [ - { "time": 0, "angle": 5.19 }, - { "time": 0.2333, "angle": 20.27 }, - { "time": 0.4, "angle": 15.27 }, - { "time": 0.6, "angle": -24.69 }, - { "time": 0.7666, "angle": -11.02 }, - { "time": 0.9333, "angle": -24.38 }, - { "time": 1.0666, "angle": 11.99 }, - { "time": 1.3, "angle": 4.86 }, - { "time": 1.3666, "angle": 5.19 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left shoulder": { - "rotate": [ - { - "time": 0, - "angle": 0.05, - "curve": [ 0, 0, 0.62, 1 ] - }, - { - "time": 0.2333, - "angle": 279.66, - "curve": [ 0.218, 0.67, 0.66, 0.99 ] - }, - { - "time": 0.5, - "angle": 62.27, - "curve": [ 0.462, 0, 0.764, 0.58 ] - }, - { "time": 0.9333, "angle": 28.91 }, - { "time": 1.0666, "angle": -8.62 }, - { "time": 1.1666, "angle": -18.43 }, - { "time": 1.3666, "angle": 0.05 } - ], - "translate": [ - { "time": 0, "x": -1.76, "y": 0.56, "curve": "stepped" }, - { "time": 0.9333, "x": -1.76, "y": 0.56, "curve": "stepped" }, - { "time": 1.3666, "x": -1.76, "y": 0.56 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left hand": { - "rotate": [ - { "time": 0, "angle": 11.58, "curve": "stepped" }, - { "time": 0.9333, "angle": 11.58, "curve": "stepped" }, - { "time": 1.3666, "angle": 11.58 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left arm": { - "rotate": [ - { "time": 0, "angle": 0.51 }, - { "time": 0.4333, "angle": 12.82 }, - { "time": 0.6, "angle": 47.55 }, - { "time": 0.9333, "angle": 12.82 }, - { "time": 1.1666, "angle": -6.5 }, - { "time": 1.3666, "angle": 0.51 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right shoulder": { - "rotate": [ - { - "time": 0, - "angle": 43.82, - "curve": [ 0, 0, 0.62, 1 ] - }, - { - "time": 0.2333, - "angle": -8.74, - "curve": [ 0.304, 0.58, 0.709, 0.97 ] - }, - { - "time": 0.5333, - "angle": -208.02, - "curve": [ 0.462, 0, 0.764, 0.58 ] - }, - { "time": 0.9333, "angle": -246.72 }, - { "time": 1.0666, "angle": -307.13 }, - { "time": 1.1666, "angle": 37.15 }, - { "time": 1.3666, "angle": 43.82 } - ], - "translate": [ - { "time": 0, "x": -7.84, "y": 7.19, "curve": "stepped" }, - { "time": 0.9333, "x": -7.84, "y": 7.19, "curve": "stepped" }, - { "time": 1.3666, "x": -7.84, "y": 7.19 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right arm": { - "rotate": [ - { "time": 0, "angle": -4.02 }, - { "time": 0.6, "angle": 17.5 }, - { "time": 0.9333, "angle": -4.02 }, - { "time": 1.1666, "angle": -16.72 }, - { "time": 1.3666, "angle": -4.02 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right hand": { - "rotate": [ - { "time": 0, "angle": 22.92, "curve": "stepped" }, - { "time": 0.9333, "angle": 22.92, "curve": "stepped" }, - { "time": 1.3666, "angle": 22.92 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "root": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.4333, "angle": -14.52 }, - { "time": 0.8, "angle": 9.86 }, - { "time": 1.3666, "angle": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - } - } - } -} -} diff --git a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/spineboy.png b/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/spineboy.png deleted file mode 100755 index ab85747..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 12 - Spine/data/spineboy.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 12 - Spine/index.html b/tutorial-3/pixi.js-master/examples/example 12 - Spine/index.html deleted file mode 100755 index 514267d..0000000 --- a/tutorial-3/pixi.js-master/examples/example 12 - Spine/index.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - pixi.js example 12 Spine - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 12 - Spine/index_dragon.html b/tutorial-3/pixi.js-master/examples/example 12 - Spine/index_dragon.html deleted file mode 100755 index a4f62d6..0000000 --- a/tutorial-3/pixi.js-master/examples/example 12 - Spine/index_dragon.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - pixi.js example 12 Spine - - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 12 - Spine/index_goblins.html b/tutorial-3/pixi.js-master/examples/example 12 - Spine/index_goblins.html deleted file mode 100755 index 245e9a0..0000000 --- a/tutorial-3/pixi.js-master/examples/example 12 - Spine/index_goblins.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - pixi.js example 12 Spine - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 12 - Spine/index_pixie.html b/tutorial-3/pixi.js-master/examples/example 12 - Spine/index_pixie.html deleted file mode 100755 index 59d0b36..0000000 --- a/tutorial-3/pixi.js-master/examples/example 12 - Spine/index_pixie.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - pixi.js example 12 Spine - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 13 - Graphics/index.html b/tutorial-3/pixi.js-master/examples/example 13 - Graphics/index.html deleted file mode 100755 index 1164b62..0000000 --- a/tutorial-3/pixi.js-master/examples/example 13 - Graphics/index.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - pixi.js example 13 - Graphics - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 13 - Graphics/indexLineTest.html b/tutorial-3/pixi.js-master/examples/example 13 - Graphics/indexLineTest.html deleted file mode 100755 index 2856845..0000000 --- a/tutorial-3/pixi.js-master/examples/example 13 - Graphics/indexLineTest.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - pixi.js example 13 - Graphics - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_01.png b/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_01.png deleted file mode 100755 index 8687366..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_01.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_02.png b/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_02.png deleted file mode 100755 index a140876..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_02.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_03.png b/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_03.png deleted file mode 100755 index 82532c7..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_03.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_04.png b/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_04.png deleted file mode 100755 index 9c790c3..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_04.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_05.png b/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_05.png deleted file mode 100755 index ebb28c8..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_05.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_06.png b/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_06.png deleted file mode 100755 index 1dec5c8..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_06.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_07.png b/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_07.png deleted file mode 100755 index e14a021..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_07.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_08.png b/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_08.png deleted file mode 100755 index 0197fef..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 13 - Graphics/spinObj_08.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 14 - Masking/BGrotate.jpg b/tutorial-3/pixi.js-master/examples/example 14 - Masking/BGrotate.jpg deleted file mode 100755 index f33f7d4..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 14 - Masking/BGrotate.jpg and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 14 - Masking/Copy of index.html b/tutorial-3/pixi.js-master/examples/example 14 - Masking/Copy of index.html deleted file mode 100755 index ef90f62..0000000 --- a/tutorial-3/pixi.js-master/examples/example 14 - Masking/Copy of index.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - pixi.js example 14 - Masking - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 14 - Masking/LightRotate1.png b/tutorial-3/pixi.js-master/examples/example 14 - Masking/LightRotate1.png deleted file mode 100755 index 44966cf..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 14 - Masking/LightRotate1.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 14 - Masking/LightRotate2.png b/tutorial-3/pixi.js-master/examples/example 14 - Masking/LightRotate2.png deleted file mode 100755 index a6e63c0..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 14 - Masking/LightRotate2.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 14 - Masking/SceneRotate.jpg b/tutorial-3/pixi.js-master/examples/example 14 - Masking/SceneRotate.jpg deleted file mode 100755 index 26fe78b..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 14 - Masking/SceneRotate.jpg and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 14 - Masking/index double mask.html b/tutorial-3/pixi.js-master/examples/example 14 - Masking/index double mask.html deleted file mode 100755 index 5751e7b..0000000 --- a/tutorial-3/pixi.js-master/examples/example 14 - Masking/index double mask.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - pixi.js example 14 - Masking - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 14 - Masking/index nested masks.html b/tutorial-3/pixi.js-master/examples/example 14 - Masking/index nested masks.html deleted file mode 100755 index 7113762..0000000 --- a/tutorial-3/pixi.js-master/examples/example 14 - Masking/index nested masks.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - pixi.js example 14 - Masking - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 14 - Masking/index.html b/tutorial-3/pixi.js-master/examples/example 14 - Masking/index.html deleted file mode 100755 index d786ce1..0000000 --- a/tutorial-3/pixi.js-master/examples/example 14 - Masking/index.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - pixi.js example 14 - Masking - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 14 - Masking/panda.png b/tutorial-3/pixi.js-master/examples/example 14 - Masking/panda.png deleted file mode 100755 index 215a4a9..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 14 - Masking/panda.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 15 - Filters/BGrotate.jpg b/tutorial-3/pixi.js-master/examples/example 15 - Filters/BGrotate.jpg deleted file mode 100755 index f33f7d4..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 15 - Filters/BGrotate.jpg and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 15 - Filters/LightRotate1.png b/tutorial-3/pixi.js-master/examples/example 15 - Filters/LightRotate1.png deleted file mode 100755 index 44966cf..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 15 - Filters/LightRotate1.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 15 - Filters/LightRotate2.png b/tutorial-3/pixi.js-master/examples/example 15 - Filters/LightRotate2.png deleted file mode 100755 index a6e63c0..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 15 - Filters/LightRotate2.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 15 - Filters/SceneRotate.jpg b/tutorial-3/pixi.js-master/examples/example 15 - Filters/SceneRotate.jpg deleted file mode 100755 index 26fe78b..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 15 - Filters/SceneRotate.jpg and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 15 - Filters/dat.gui.min.js b/tutorial-3/pixi.js-master/examples/example 15 - Filters/dat.gui.min.js deleted file mode 100755 index 17e4a3c..0000000 --- a/tutorial-3/pixi.js-master/examples/example 15 - Filters/dat.gui.min.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ -var dat=dat||{};dat.gui=dat.gui||{};dat.utils=dat.utils||{};dat.controllers=dat.controllers||{};dat.dom=dat.dom||{};dat.color=dat.color||{};dat.utils.css=function(){return{load:function(e,a){var a=a||document,c=a.createElement("link");c.type="text/css";c.rel="stylesheet";c.href=e;a.getElementsByTagName("head")[0].appendChild(c)},inject:function(e,a){var a=a||document,c=document.createElement("style");c.type="text/css";c.innerHTML=e;a.getElementsByTagName("head")[0].appendChild(c)}}}(); -dat.utils.common=function(){var e=Array.prototype.forEach,a=Array.prototype.slice;return{BREAK:{},extend:function(c){this.each(a.call(arguments,1),function(a){for(var f in a)this.isUndefined(a[f])||(c[f]=a[f])},this);return c},defaults:function(c){this.each(a.call(arguments,1),function(a){for(var f in a)this.isUndefined(c[f])&&(c[f]=a[f])},this);return c},compose:function(){var c=a.call(arguments);return function(){for(var d=a.call(arguments),f=c.length-1;f>=0;f--)d=[c[f].apply(this,d)];return d[0]}}, -each:function(a,d,f){if(e&&a.forEach===e)a.forEach(d,f);else if(a.length===a.length+0)for(var b=0,n=a.length;b-1?d.length-d.indexOf(".")-1:0};c.superclass=e;a.extend(c.prototype,e.prototype,{setValue:function(a){if(this.__min!==void 0&&athis.__max)a=this.__max;this.__step!==void 0&&a%this.__step!=0&&(a=Math.round(a/this.__step)*this.__step);return c.superclass.prototype.setValue.call(this,a)},min:function(a){this.__min=a;return this},max:function(a){this.__max=a;return this},step:function(a){this.__step=a;return this}});return c}(dat.controllers.Controller,dat.utils.common); -dat.controllers.NumberControllerBox=function(e,a,c){var d=function(f,b,e){function h(){var a=parseFloat(l.__input.value);c.isNaN(a)||l.setValue(a)}function j(a){var b=o-a.clientY;l.setValue(l.getValue()+b*l.__impliedStep);o=a.clientY}function m(){a.unbind(window,"mousemove",j);a.unbind(window,"mouseup",m)}this.__truncationSuspended=false;d.superclass.call(this,f,b,e);var l=this,o;this.__input=document.createElement("input");this.__input.setAttribute("type","text");a.bind(this.__input,"change",h); -a.bind(this.__input,"blur",function(){h();l.__onFinishChange&&l.__onFinishChange.call(l,l.getValue())});a.bind(this.__input,"mousedown",function(b){a.bind(window,"mousemove",j);a.bind(window,"mouseup",m);o=b.clientY});a.bind(this.__input,"keydown",function(a){if(a.keyCode===13)l.__truncationSuspended=true,this.blur(),l.__truncationSuspended=false});this.updateDisplay();this.domElement.appendChild(this.__input)};d.superclass=e;c.extend(d.prototype,e.prototype,{updateDisplay:function(){var a=this.__input, -b;if(this.__truncationSuspended)b=this.getValue();else{b=this.getValue();var c=Math.pow(10,this.__precision);b=Math.round(b*c)/c}a.value=b;return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.NumberController,dat.dom.dom,dat.utils.common); -dat.controllers.NumberControllerSlider=function(e,a,c,d,f){var b=function(d,c,f,e,l){function o(b){b.preventDefault();var d=a.getOffset(g.__background),c=a.getWidth(g.__background);g.setValue(g.__min+(g.__max-g.__min)*((b.clientX-d.left)/(d.left+c-d.left)));return false}function y(){a.unbind(window,"mousemove",o);a.unbind(window,"mouseup",y);g.__onFinishChange&&g.__onFinishChange.call(g,g.getValue())}b.superclass.call(this,d,c,{min:f,max:e,step:l});var g=this;this.__background=document.createElement("div"); -this.__foreground=document.createElement("div");a.bind(this.__background,"mousedown",function(b){a.bind(window,"mousemove",o);a.bind(window,"mouseup",y);o(b)});a.addClass(this.__background,"slider");a.addClass(this.__foreground,"slider-fg");this.updateDisplay();this.__background.appendChild(this.__foreground);this.domElement.appendChild(this.__background)};b.superclass=e;b.useDefaultStyles=function(){c.inject(f)};d.extend(b.prototype,e.prototype,{updateDisplay:function(){this.__foreground.style.width= -(this.getValue()-this.__min)/(this.__max-this.__min)*100+"%";return b.superclass.prototype.updateDisplay.call(this)}});return b}(dat.controllers.NumberController,dat.dom.dom,dat.utils.css,dat.utils.common,".slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}"); -dat.controllers.FunctionController=function(e,a,c){var d=function(c,b,e){d.superclass.call(this,c,b);var h=this;this.__button=document.createElement("div");this.__button.innerHTML=e===void 0?"Fire":e;a.bind(this.__button,"click",function(a){a.preventDefault();h.fire();return false});a.addClass(this.__button,"button");this.domElement.appendChild(this.__button)};d.superclass=e;c.extend(d.prototype,e.prototype,{fire:function(){this.__onChange&&this.__onChange.call(this);this.__onFinishChange&&this.__onFinishChange.call(this, -this.getValue());this.getValue().call(this.object)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common); -dat.controllers.BooleanController=function(e,a,c){var d=function(c,b){d.superclass.call(this,c,b);var e=this;this.__prev=this.getValue();this.__checkbox=document.createElement("input");this.__checkbox.setAttribute("type","checkbox");a.bind(this.__checkbox,"change",function(){e.setValue(!e.__prev)},false);this.domElement.appendChild(this.__checkbox);this.updateDisplay()};d.superclass=e;c.extend(d.prototype,e.prototype,{setValue:function(a){a=d.superclass.prototype.setValue.call(this,a);this.__onFinishChange&& -this.__onFinishChange.call(this,this.getValue());this.__prev=this.getValue();return a},updateDisplay:function(){this.getValue()===true?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=true):this.__checkbox.checked=false;return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common); -dat.color.toString=function(e){return function(a){if(a.a==1||e.isUndefined(a.a)){for(a=a.hex.toString(16);a.length<6;)a="0"+a;return"#"+a}else return"rgba("+Math.round(a.r)+","+Math.round(a.g)+","+Math.round(a.b)+","+a.a+")"}}(dat.utils.common); -dat.color.interpret=function(e,a){var c,d,f=[{litmus:a.isString,conversions:{THREE_CHAR_HEX:{read:function(a){a=a.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return a===null?false:{space:"HEX",hex:parseInt("0x"+a[1].toString()+a[1].toString()+a[2].toString()+a[2].toString()+a[3].toString()+a[3].toString())}},write:e},SIX_CHAR_HEX:{read:function(a){a=a.match(/^#([A-F0-9]{6})$/i);return a===null?false:{space:"HEX",hex:parseInt("0x"+a[1].toString())}},write:e},CSS_RGB:{read:function(a){a=a.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/); -return a===null?false:{space:"RGB",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3])}},write:e},CSS_RGBA:{read:function(a){a=a.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);return a===null?false:{space:"RGB",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3]),a:parseFloat(a[4])}},write:e}}},{litmus:a.isNumber,conversions:{HEX:{read:function(a){return{space:"HEX",hex:a,conversionName:"HEX"}},write:function(a){return a.hex}}}},{litmus:a.isArray,conversions:{RGB_ARRAY:{read:function(a){return a.length!= -3?false:{space:"RGB",r:a[0],g:a[1],b:a[2]}},write:function(a){return[a.r,a.g,a.b]}},RGBA_ARRAY:{read:function(a){return a.length!=4?false:{space:"RGB",r:a[0],g:a[1],b:a[2],a:a[3]}},write:function(a){return[a.r,a.g,a.b,a.a]}}}},{litmus:a.isObject,conversions:{RGBA_OBJ:{read:function(b){return a.isNumber(b.r)&&a.isNumber(b.g)&&a.isNumber(b.b)&&a.isNumber(b.a)?{space:"RGB",r:b.r,g:b.g,b:b.b,a:b.a}:false},write:function(a){return{r:a.r,g:a.g,b:a.b,a:a.a}}},RGB_OBJ:{read:function(b){return a.isNumber(b.r)&& -a.isNumber(b.g)&&a.isNumber(b.b)?{space:"RGB",r:b.r,g:b.g,b:b.b}:false},write:function(a){return{r:a.r,g:a.g,b:a.b}}},HSVA_OBJ:{read:function(b){return a.isNumber(b.h)&&a.isNumber(b.s)&&a.isNumber(b.v)&&a.isNumber(b.a)?{space:"HSV",h:b.h,s:b.s,v:b.v,a:b.a}:false},write:function(a){return{h:a.h,s:a.s,v:a.v,a:a.a}}},HSV_OBJ:{read:function(b){return a.isNumber(b.h)&&a.isNumber(b.s)&&a.isNumber(b.v)?{space:"HSV",h:b.h,s:b.s,v:b.v}:false},write:function(a){return{h:a.h,s:a.s,v:a.v}}}}}];return function(){d= -false;var b=arguments.length>1?a.toArray(arguments):arguments[0];a.each(f,function(e){if(e.litmus(b))return a.each(e.conversions,function(e,f){c=e.read(b);if(d===false&&c!==false)return d=c,c.conversionName=f,c.conversion=e,a.BREAK}),a.BREAK});return d}}(dat.color.toString,dat.utils.common); -dat.GUI=dat.gui.GUI=function(e,a,c,d,f,b,n,h,j,m,l,o,y,g,i){function q(a,b,r,c){if(b[r]===void 0)throw Error("Object "+b+' has no property "'+r+'"');c.color?b=new l(b,r):(b=[b,r].concat(c.factoryArgs),b=d.apply(a,b));if(c.before instanceof f)c.before=c.before.__li;t(a,b);g.addClass(b.domElement,"c");r=document.createElement("span");g.addClass(r,"property-name");r.innerHTML=b.property;var e=document.createElement("div");e.appendChild(r);e.appendChild(b.domElement);c=s(a,e,c.before);g.addClass(c,k.CLASS_CONTROLLER_ROW); -g.addClass(c,typeof b.getValue());p(a,c,b);a.__controllers.push(b);return b}function s(a,b,d){var c=document.createElement("li");b&&c.appendChild(b);d?a.__ul.insertBefore(c,params.before):a.__ul.appendChild(c);a.onResize();return c}function p(a,d,c){c.__li=d;c.__gui=a;i.extend(c,{options:function(b){if(arguments.length>1)return c.remove(),q(a,c.object,c.property,{before:c.__li.nextElementSibling,factoryArgs:[i.toArray(arguments)]});if(i.isArray(b)||i.isObject(b))return c.remove(),q(a,c.object,c.property, -{before:c.__li.nextElementSibling,factoryArgs:[b]})},name:function(a){c.__li.firstElementChild.firstElementChild.innerHTML=a;return c},listen:function(){c.__gui.listen(c);return c},remove:function(){c.__gui.remove(c);return c}});if(c instanceof j){var e=new h(c.object,c.property,{min:c.__min,max:c.__max,step:c.__step});i.each(["updateDisplay","onChange","onFinishChange"],function(a){var b=c[a],H=e[a];c[a]=e[a]=function(){var a=Array.prototype.slice.call(arguments);b.apply(c,a);return H.apply(e,a)}}); -g.addClass(d,"has-slider");c.domElement.insertBefore(e.domElement,c.domElement.firstElementChild)}else if(c instanceof h){var f=function(b){return i.isNumber(c.__min)&&i.isNumber(c.__max)?(c.remove(),q(a,c.object,c.property,{before:c.__li.nextElementSibling,factoryArgs:[c.__min,c.__max,c.__step]})):b};c.min=i.compose(f,c.min);c.max=i.compose(f,c.max)}else if(c instanceof b)g.bind(d,"click",function(){g.fakeEvent(c.__checkbox,"click")}),g.bind(c.__checkbox,"click",function(a){a.stopPropagation()}); -else if(c instanceof n)g.bind(d,"click",function(){g.fakeEvent(c.__button,"click")}),g.bind(d,"mouseover",function(){g.addClass(c.__button,"hover")}),g.bind(d,"mouseout",function(){g.removeClass(c.__button,"hover")});else if(c instanceof l)g.addClass(d,"color"),c.updateDisplay=i.compose(function(a){d.style.borderLeftColor=c.__color.toString();return a},c.updateDisplay),c.updateDisplay();c.setValue=i.compose(function(b){a.getRoot().__preset_select&&c.isModified()&&B(a.getRoot(),true);return b},c.setValue)} -function t(a,b){var c=a.getRoot(),d=c.__rememberedObjects.indexOf(b.object);if(d!=-1){var e=c.__rememberedObjectIndecesToControllers[d];e===void 0&&(e={},c.__rememberedObjectIndecesToControllers[d]=e);e[b.property]=b;if(c.load&&c.load.remembered){c=c.load.remembered;if(c[a.preset])c=c[a.preset];else if(c[w])c=c[w];else return;if(c[d]&&c[d][b.property]!==void 0)d=c[d][b.property],b.initialValue=d,b.setValue(d)}}}function I(a){var b=a.__save_row=document.createElement("li");g.addClass(a.domElement, -"has-save");a.__ul.insertBefore(b,a.__ul.firstChild);g.addClass(b,"save-row");var c=document.createElement("span");c.innerHTML=" ";g.addClass(c,"button gears");var d=document.createElement("span");d.innerHTML="Save";g.addClass(d,"button");g.addClass(d,"save");var e=document.createElement("span");e.innerHTML="New";g.addClass(e,"button");g.addClass(e,"save-as");var f=document.createElement("span");f.innerHTML="Revert";g.addClass(f,"button");g.addClass(f,"revert");var m=a.__preset_select=document.createElement("select"); -a.load&&a.load.remembered?i.each(a.load.remembered,function(b,c){C(a,c,c==a.preset)}):C(a,w,false);g.bind(m,"change",function(){for(var b=0;b0){a.preset=this.preset;if(!a.remembered)a.remembered={};a.remembered[this.preset]=z(this)}a.folders={};i.each(this.__folders,function(b, -c){a.folders[c]=b.getSaveObject()});return a},save:function(){if(!this.load.remembered)this.load.remembered={};this.load.remembered[this.preset]=z(this);B(this,false)},saveAs:function(a){if(!this.load.remembered)this.load.remembered={},this.load.remembered[w]=z(this,true);this.load.remembered[a]=z(this);this.preset=a;C(this,a,true)},revert:function(a){i.each(this.__controllers,function(b){this.getRoot().load.remembered?t(a||this.getRoot(),b):b.setValue(b.initialValue)},this);i.each(this.__folders, -function(a){a.revert(a)});a||B(this.getRoot(),false)},listen:function(a){var b=this.__listening.length==0;this.__listening.push(a);b&&E(this.__listening)}});return k}(dat.utils.css,'
    \n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n
    \n\n Automatically save\n values to localStorage on exit.\n\n
    The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n \n
    \n \n
    \n\n
    ', -".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear;border:0;position:absolute;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-x:hidden}.dg.a.has-save ul{margin-top:27px}.dg.a.has-save ul.closed{margin-top:0}.dg.a .save-row{position:fixed;top:0;z-index:1002}.dg li{-webkit-transition:height 0.1s ease-out;-o-transition:height 0.1s ease-out;-moz-transition:height 0.1s ease-out;transition:height 0.1s ease-out}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;overflow:hidden;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li > *{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:9px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n", -dat.controllers.factory=function(e,a,c,d,f,b,n){return function(h,j,m,l){var o=h[j];if(n.isArray(m)||n.isObject(m))return new e(h,j,m);if(n.isNumber(o))return n.isNumber(m)&&n.isNumber(l)?new c(h,j,m,l):new a(h,j,{min:m,max:l});if(n.isString(o))return new d(h,j);if(n.isFunction(o))return new f(h,j,"");if(n.isBoolean(o))return new b(h,j)}}(dat.controllers.OptionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.StringController=function(e,a,c){var d= -function(c,b){function e(){h.setValue(h.__input.value)}d.superclass.call(this,c,b);var h=this;this.__input=document.createElement("input");this.__input.setAttribute("type","text");a.bind(this.__input,"keyup",e);a.bind(this.__input,"change",e);a.bind(this.__input,"blur",function(){h.__onFinishChange&&h.__onFinishChange.call(h,h.getValue())});a.bind(this.__input,"keydown",function(a){a.keyCode===13&&this.blur()});this.updateDisplay();this.domElement.appendChild(this.__input)};d.superclass=e;c.extend(d.prototype, -e.prototype,{updateDisplay:function(){if(!a.isActive(this.__input))this.__input.value=this.getValue();return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common),dat.controllers.FunctionController,dat.controllers.BooleanController,dat.utils.common),dat.controllers.Controller,dat.controllers.BooleanController,dat.controllers.FunctionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.OptionController, -dat.controllers.ColorController=function(e,a,c,d,f){function b(a,b,c,d){a.style.background="";f.each(j,function(e){a.style.cssText+="background: "+e+"linear-gradient("+b+", "+c+" 0%, "+d+" 100%); "})}function n(a){a.style.background="";a.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);";a.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"; -a.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);";a.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);";a.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}var h=function(e,l){function o(b){q(b);a.bind(window,"mousemove",q);a.bind(window, -"mouseup",j)}function j(){a.unbind(window,"mousemove",q);a.unbind(window,"mouseup",j)}function g(){var a=d(this.value);a!==false?(p.__color.__state=a,p.setValue(p.__color.toOriginal())):this.value=p.__color.toString()}function i(){a.unbind(window,"mousemove",s);a.unbind(window,"mouseup",i)}function q(b){b.preventDefault();var c=a.getWidth(p.__saturation_field),d=a.getOffset(p.__saturation_field),e=(b.clientX-d.left+document.body.scrollLeft)/c,b=1-(b.clientY-d.top+document.body.scrollTop)/c;b>1?b= -1:b<0&&(b=0);e>1?e=1:e<0&&(e=0);p.__color.v=b;p.__color.s=e;p.setValue(p.__color.toOriginal());return false}function s(b){b.preventDefault();var c=a.getHeight(p.__hue_field),d=a.getOffset(p.__hue_field),b=1-(b.clientY-d.top+document.body.scrollTop)/c;b>1?b=1:b<0&&(b=0);p.__color.h=b*360;p.setValue(p.__color.toOriginal());return false}h.superclass.call(this,e,l);this.__color=new c(this.getValue());this.__temp=new c(0);var p=this;this.domElement=document.createElement("div");a.makeSelectable(this.domElement, -false);this.__selector=document.createElement("div");this.__selector.className="selector";this.__saturation_field=document.createElement("div");this.__saturation_field.className="saturation-field";this.__field_knob=document.createElement("div");this.__field_knob.className="field-knob";this.__field_knob_border="2px solid ";this.__hue_knob=document.createElement("div");this.__hue_knob.className="hue-knob";this.__hue_field=document.createElement("div");this.__hue_field.className="hue-field";this.__input= -document.createElement("input");this.__input.type="text";this.__input_textShadow="0 1px 1px ";a.bind(this.__input,"keydown",function(a){a.keyCode===13&&g.call(this)});a.bind(this.__input,"blur",g);a.bind(this.__selector,"mousedown",function(){a.addClass(this,"drag").bind(window,"mouseup",function(){a.removeClass(p.__selector,"drag")})});var t=document.createElement("div");f.extend(this.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}); -f.extend(this.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:this.__field_knob_border+(this.__color.v<0.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1});f.extend(this.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1});f.extend(this.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"});f.extend(t.style, -{width:"100%",height:"100%",background:"none"});b(t,"top","rgba(0,0,0,0)","#000");f.extend(this.__hue_field.style,{width:"15px",height:"100px",display:"inline-block",border:"1px solid #555",cursor:"ns-resize"});n(this.__hue_field);f.extend(this.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:this.__input_textShadow+"rgba(0,0,0,0.7)"});a.bind(this.__saturation_field,"mousedown",o);a.bind(this.__field_knob,"mousedown",o);a.bind(this.__hue_field,"mousedown", -function(b){s(b);a.bind(window,"mousemove",s);a.bind(window,"mouseup",i)});this.__saturation_field.appendChild(t);this.__selector.appendChild(this.__field_knob);this.__selector.appendChild(this.__saturation_field);this.__selector.appendChild(this.__hue_field);this.__hue_field.appendChild(this.__hue_knob);this.domElement.appendChild(this.__input);this.domElement.appendChild(this.__selector);this.updateDisplay()};h.superclass=e;f.extend(h.prototype,e.prototype,{updateDisplay:function(){var a=d(this.getValue()); -if(a!==false){var e=false;f.each(c.COMPONENTS,function(b){if(!f.isUndefined(a[b])&&!f.isUndefined(this.__color.__state[b])&&a[b]!==this.__color.__state[b])return e=true,{}},this);e&&f.extend(this.__color.__state,a)}f.extend(this.__temp.__state,this.__color.__state);this.__temp.a=1;var h=this.__color.v<0.5||this.__color.s>0.5?255:0,j=255-h;f.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toString(),border:this.__field_knob_border+ -"rgb("+h+","+h+","+h+")"});this.__hue_knob.style.marginTop=(1-this.__color.h/360)*100+"px";this.__temp.s=1;this.__temp.v=1;b(this.__saturation_field,"left","#fff",this.__temp.toString());f.extend(this.__input.style,{backgroundColor:this.__input.value=this.__color.toString(),color:"rgb("+h+","+h+","+h+")",textShadow:this.__input_textShadow+"rgba("+j+","+j+","+j+",.7)"})}});var j=["-moz-","-o-","-webkit-","-ms-",""];return h}(dat.controllers.Controller,dat.dom.dom,dat.color.Color=function(e,a,c,d){function f(a, -b,c){Object.defineProperty(a,b,{get:function(){if(this.__state.space==="RGB")return this.__state[b];n(this,b,c);return this.__state[b]},set:function(a){if(this.__state.space!=="RGB")n(this,b,c),this.__state.space="RGB";this.__state[b]=a}})}function b(a,b){Object.defineProperty(a,b,{get:function(){if(this.__state.space==="HSV")return this.__state[b];h(this);return this.__state[b]},set:function(a){if(this.__state.space!=="HSV")h(this),this.__state.space="HSV";this.__state[b]=a}})}function n(b,c,e){if(b.__state.space=== -"HEX")b.__state[c]=a.component_from_hex(b.__state.hex,e);else if(b.__state.space==="HSV")d.extend(b.__state,a.hsv_to_rgb(b.__state.h,b.__state.s,b.__state.v));else throw"Corrupted color state";}function h(b){var c=a.rgb_to_hsv(b.r,b.g,b.b);d.extend(b.__state,{s:c.s,v:c.v});if(d.isNaN(c.h)){if(d.isUndefined(b.__state.h))b.__state.h=0}else b.__state.h=c.h}var j=function(){this.__state=e.apply(this,arguments);if(this.__state===false)throw"Failed to interpret color arguments";this.__state.a=this.__state.a|| -1};j.COMPONENTS="r,g,b,h,s,v,hex,a".split(",");d.extend(j.prototype,{toString:function(){return c(this)},toOriginal:function(){return this.__state.conversion.write(this)}});f(j.prototype,"r",2);f(j.prototype,"g",1);f(j.prototype,"b",0);b(j.prototype,"h");b(j.prototype,"s");b(j.prototype,"v");Object.defineProperty(j.prototype,"a",{get:function(){return this.__state.a},set:function(a){this.__state.a=a}});Object.defineProperty(j.prototype,"hex",{get:function(){if(!this.__state.space!=="HEX")this.__state.hex= -a.rgb_to_hex(this.r,this.g,this.b);return this.__state.hex},set:function(a){this.__state.space="HEX";this.__state.hex=a}});return j}(dat.color.interpret,dat.color.math=function(){var e;return{hsv_to_rgb:function(a,c,d){var e=a/60-Math.floor(a/60),b=d*(1-c),n=d*(1-e*c),c=d*(1-(1-e)*c),a=[[d,c,b],[n,d,b],[b,d,c],[b,n,d],[c,b,d],[d,b,n]][Math.floor(a/60)%6];return{r:a[0]*255,g:a[1]*255,b:a[2]*255}},rgb_to_hsv:function(a,c,d){var e=Math.min(a,c,d),b=Math.max(a,c,d),e=b-e;if(b==0)return{h:NaN,s:0,v:0}; -a=a==b?(c-d)/e:c==b?2+(d-a)/e:4+(a-c)/e;a/=6;a<0&&(a+=1);return{h:a*360,s:e/b,v:b/255}},rgb_to_hex:function(a,c,d){a=this.hex_with_component(0,2,a);a=this.hex_with_component(a,1,c);return a=this.hex_with_component(a,0,d)},component_from_hex:function(a,c){return a>>c*8&255},hex_with_component:function(a,c,d){return d<<(e=c*8)|a&~(255< - - - pixi.js example 15 - Filters - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 15 - Filters/indexAll.html b/tutorial-3/pixi.js-master/examples/example 15 - Filters/indexAll.html deleted file mode 100755 index 4e83cb8..0000000 --- a/tutorial-3/pixi.js-master/examples/example 15 - Filters/indexAll.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - pixi.js example 15 - Filters - - - - - - - - - -
    - - - - - -
    - - - diff --git a/tutorial-3/pixi.js-master/examples/example 15 - Filters/indexBlur.html b/tutorial-3/pixi.js-master/examples/example 15 - Filters/indexBlur.html deleted file mode 100755 index dc899dc..0000000 --- a/tutorial-3/pixi.js-master/examples/example 15 - Filters/indexBlur.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - pixi.js example 15 - Filters - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 15 - Filters/indexDisplacement.html b/tutorial-3/pixi.js-master/examples/example 15 - Filters/indexDisplacement.html deleted file mode 100755 index 23f7f96..0000000 --- a/tutorial-3/pixi.js-master/examples/example 15 - Filters/indexDisplacement.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - pixi.js example 15 - Filters - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 15 - Filters/indexDisplacement_2.html b/tutorial-3/pixi.js-master/examples/example 15 - Filters/indexDisplacement_2.html deleted file mode 100755 index 8cda5d9..0000000 --- a/tutorial-3/pixi.js-master/examples/example 15 - Filters/indexDisplacement_2.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - pixi.js example 15 - Filters - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 15 - Filters/panda.png b/tutorial-3/pixi.js-master/examples/example 15 - Filters/panda.png deleted file mode 100755 index 215a4a9..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 15 - Filters/panda.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 15 - Filters/zeldaWaves.png b/tutorial-3/pixi.js-master/examples/example 15 - Filters/zeldaWaves.png deleted file mode 100755 index 01552c0..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 15 - Filters/zeldaWaves.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 16 - BlendModes/BGrotate.jpg b/tutorial-3/pixi.js-master/examples/example 16 - BlendModes/BGrotate.jpg deleted file mode 100755 index eab4d57..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 16 - BlendModes/BGrotate.jpg and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 16 - BlendModes/flowerTop.png b/tutorial-3/pixi.js-master/examples/example 16 - BlendModes/flowerTop.png deleted file mode 100755 index 041cf2a..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 16 - BlendModes/flowerTop.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 16 - BlendModes/index.html b/tutorial-3/pixi.js-master/examples/example 16 - BlendModes/index.html deleted file mode 100755 index 5bb21a8..0000000 --- a/tutorial-3/pixi.js-master/examples/example 16 - BlendModes/index.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - Pixi.js Blend Modes - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 17 - Tinting/BGrotate.jpg b/tutorial-3/pixi.js-master/examples/example 17 - Tinting/BGrotate.jpg deleted file mode 100755 index eab4d57..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 17 - Tinting/BGrotate.jpg and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 17 - Tinting/eggHead.png b/tutorial-3/pixi.js-master/examples/example 17 - Tinting/eggHead.png deleted file mode 100755 index f8bff53..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 17 - Tinting/eggHead.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 17 - Tinting/index.html b/tutorial-3/pixi.js-master/examples/example 17 - Tinting/index.html deleted file mode 100755 index f051fd1..0000000 --- a/tutorial-3/pixi.js-master/examples/example 17 - Tinting/index.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - Tinting - - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 18 - Batch/click.png b/tutorial-3/pixi.js-master/examples/example 18 - Batch/click.png deleted file mode 100755 index b796e52..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 18 - Batch/click.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 18 - Batch/index.html b/tutorial-3/pixi.js-master/examples/example 18 - Batch/index.html deleted file mode 100755 index ce7c542..0000000 --- a/tutorial-3/pixi.js-master/examples/example 18 - Batch/index.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - Sprite Batch - - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 18 - Batch/logo_small.png b/tutorial-3/pixi.js-master/examples/example 18 - Batch/logo_small.png deleted file mode 100755 index 3a63544..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 18 - Batch/logo_small.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 18 - Batch/tinyMaggot.png b/tutorial-3/pixi.js-master/examples/example 18 - Batch/tinyMaggot.png deleted file mode 100755 index c0b1c00..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 18 - Batch/tinyMaggot.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.json b/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.json deleted file mode 100755 index 7dddba8..0000000 --- a/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.json +++ /dev/null @@ -1,44 +0,0 @@ -{"frames": { - -"eggHead.png": -{ - "frame": {"x":2,"y":169,"w":142,"h":157}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":142,"h":157}, - "sourceSize": {"w":142,"h":157} -}, -"flowerTop.png": -{ - "frame": {"x":2,"y":328,"w":119,"h":181}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":119,"h":181}, - "sourceSize": {"w":119,"h":181} -}, -"helmlok.png": -{ - "frame": {"x":123,"y":328,"w":123,"h":177}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":123,"h":177}, - "sourceSize": {"w":123,"h":177} -}, -"skully.png": -{ - "frame": {"x":2,"y":2,"w":155,"h":165}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":155,"h":165}, - "sourceSize": {"w":155,"h":165} -}}, -"meta": { - "app": "http://www.texturepacker.com", - "version": "1.0", - "image": "SpriteSheet.png", - "format": "RGBA8888", - "size": {"w":256,"h":512}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:9e3e5afd01ea8e418afabfbdcd724485$" -} -} diff --git a/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.png b/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.png deleted file mode 100755 index 210acb1..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/index.html b/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/index.html deleted file mode 100755 index ca82cdc..0000000 --- a/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/index.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - pixi.js example 2 loading a sprite sheet - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/SpriteSheet.tps b/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/SpriteSheet.tps deleted file mode 100755 index c81ef28..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/SpriteSheet.tps and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/eggHead.png b/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/eggHead.png deleted file mode 100755 index f8bff53..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/eggHead.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/flowerTop.png b/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/flowerTop.png deleted file mode 100755 index 041cf2a..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/flowerTop.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/helmlok.png b/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/helmlok.png deleted file mode 100755 index c6b96c0..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/helmlok.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/skully.png b/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/skully.png deleted file mode 100755 index c21b40d..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/skully.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.json b/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.json deleted file mode 100755 index 7dddba8..0000000 --- a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.json +++ /dev/null @@ -1,44 +0,0 @@ -{"frames": { - -"eggHead.png": -{ - "frame": {"x":2,"y":169,"w":142,"h":157}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":142,"h":157}, - "sourceSize": {"w":142,"h":157} -}, -"flowerTop.png": -{ - "frame": {"x":2,"y":328,"w":119,"h":181}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":119,"h":181}, - "sourceSize": {"w":119,"h":181} -}, -"helmlok.png": -{ - "frame": {"x":123,"y":328,"w":123,"h":177}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":123,"h":177}, - "sourceSize": {"w":123,"h":177} -}, -"skully.png": -{ - "frame": {"x":2,"y":2,"w":155,"h":165}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":155,"h":165}, - "sourceSize": {"w":155,"h":165} -}}, -"meta": { - "app": "http://www.texturepacker.com", - "version": "1.0", - "image": "SpriteSheet.png", - "format": "RGBA8888", - "size": {"w":256,"h":512}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:9e3e5afd01ea8e418afabfbdcd724485$" -} -} diff --git a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.png b/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.png deleted file mode 100755 index 210acb1..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/fighter.json b/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/fighter.json deleted file mode 100755 index e20b4a6..0000000 --- a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/fighter.json +++ /dev/null @@ -1,252 +0,0 @@ -{"frames": { - -"rollSequence0000.png": -{ - "frame": {"x":483,"y":692,"w":169,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":4,"w":169,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0001.png": -{ - "frame": {"x":468,"y":2,"w":169,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":4,"w":169,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0002.png": -{ - "frame": {"x":639,"y":2,"w":167,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":5,"w":167,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0003.png": -{ - "frame": {"x":808,"y":2,"w":165,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":5,"w":165,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0004.png": -{ - "frame": {"x":654,"y":688,"w":161,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":5,"w":161,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0005.png": -{ - "frame": {"x":817,"y":458,"w":151,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":6,"y":5,"w":151,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0006.png": -{ - "frame": {"x":817,"y":686,"w":137,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":11,"y":5,"w":137,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0007.png": -{ - "frame": {"x":290,"y":2,"w":113,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":22,"y":3,"w":113,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0008.png": -{ - "frame": {"x":284,"y":692,"w":79,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":40,"y":3,"w":79,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0009.png": -{ - "frame": {"x":405,"y":2,"w":61,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":53,"y":3,"w":61,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0010.png": -{ - "frame": {"x":444,"y":462,"w":49,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":64,"y":3,"w":49,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0011.png": -{ - "frame": {"x":377,"y":462,"w":65,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":52,"y":3,"w":65,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0012.png": -{ - "frame": {"x":272,"y":462,"w":103,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":37,"y":3,"w":103,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0013.png": -{ - "frame": {"x":143,"y":692,"w":139,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":3,"w":139,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0014.png": -{ - "frame": {"x":2,"y":462,"w":163,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":7,"y":3,"w":163,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0015.png": -{ - "frame": {"x":2,"y":2,"w":171,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":2,"y":3,"w":171,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0016.png": -{ - "frame": {"x":2,"y":232,"w":163,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":4,"y":3,"w":163,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0017.png": -{ - "frame": {"x":2,"y":692,"w":139,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":16,"y":3,"w":139,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0018.png": -{ - "frame": {"x":167,"y":462,"w":103,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":35,"y":3,"w":103,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0019.png": -{ - "frame": {"x":365,"y":692,"w":65,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":58,"y":3,"w":65,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0020.png": -{ - "frame": {"x":432,"y":692,"w":49,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":62,"y":3,"w":49,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0021.png": -{ - "frame": {"x":389,"y":232,"w":61,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":61,"y":3,"w":61,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0022.png": -{ - "frame": {"x":306,"y":232,"w":81,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":55,"y":3,"w":81,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0023.png": -{ - "frame": {"x":175,"y":2,"w":113,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":39,"y":3,"w":113,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0024.png": -{ - "frame": {"x":167,"y":232,"w":137,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":26,"y":3,"w":137,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0025.png": -{ - "frame": {"x":664,"y":458,"w":151,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":5,"w":151,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0026.png": -{ - "frame": {"x":792,"y":230,"w":161,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":11,"y":5,"w":161,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0027.png": -{ - "frame": {"x":623,"y":230,"w":167,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":6,"y":5,"w":167,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0028.png": -{ - "frame": {"x":495,"y":460,"w":167,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":5,"y":5,"w":167,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0029.png": -{ - "frame": {"x":452,"y":232,"w":169,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":4,"w":169,"h":226}, - "sourceSize": {"w":175,"h":240} -}}, -"meta": { - "app": "http://www.texturepacker.com", - "version": "1.0", - "image": "fighter.png", - "format": "RGBA8888", - "size": {"w":1024,"h":1024}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:2f213a6b451f9f5719773418dfe80ae8$" -} -} diff --git a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/fighter.png b/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/fighter.png deleted file mode 100755 index 5395f7b..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/fighter.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/index.html b/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/index.html deleted file mode 100755 index ecd4b55..0000000 --- a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/index.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - pixi.js example 2 loading a sprite sheet - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/indexTrim.html b/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/indexTrim.html deleted file mode 100755 index 4682c4e..0000000 --- a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/indexTrim.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - pixi.js example 2 loading a sprite sheet - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/tp/SpriteSheet.tps b/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/tp/SpriteSheet.tps deleted file mode 100755 index c81ef28..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/tp/SpriteSheet.tps and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/tp/eggHead.png b/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/tp/eggHead.png deleted file mode 100755 index f8bff53..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/tp/eggHead.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/tp/flowerTop.png b/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/tp/flowerTop.png deleted file mode 100755 index 041cf2a..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/tp/flowerTop.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/tp/helmlok.png b/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/tp/helmlok.png deleted file mode 100755 index c6b96c0..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/tp/helmlok.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/tp/skully.png b/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/tp/skully.png deleted file mode 100755 index c21b40d..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 2 - SpriteSheet/tp/skully.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 20 - Strip/index.html b/tutorial-3/pixi.js-master/examples/example 20 - Strip/index.html deleted file mode 100755 index 95cd621..0000000 --- a/tutorial-3/pixi.js-master/examples/example 20 - Strip/index.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - pixi.js example 20 - strip - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 20 - Strip/snake.png b/tutorial-3/pixi.js-master/examples/example 20 - Strip/snake.png deleted file mode 100755 index 0cb81d4..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 20 - Strip/snake.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 21 - Complex Graphics/index.html b/tutorial-3/pixi.js-master/examples/example 21 - Complex Graphics/index.html deleted file mode 100755 index 2424e38..0000000 --- a/tutorial-3/pixi.js-master/examples/example 21 - Complex Graphics/index.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - pixi.js example 21 Complex Graphics - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 22 - Complex Masking/eggHead.png b/tutorial-3/pixi.js-master/examples/example 22 - Complex Masking/eggHead.png deleted file mode 100755 index f8bff53..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 22 - Complex Masking/eggHead.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 22 - Complex Masking/flowerTop.png b/tutorial-3/pixi.js-master/examples/example 22 - Complex Masking/flowerTop.png deleted file mode 100755 index 041cf2a..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 22 - Complex Masking/flowerTop.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 22 - Complex Masking/helmlok.png b/tutorial-3/pixi.js-master/examples/example 22 - Complex Masking/helmlok.png deleted file mode 100755 index c6b96c0..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 22 - Complex Masking/helmlok.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 22 - Complex Masking/index.html b/tutorial-3/pixi.js-master/examples/example 22 - Complex Masking/index.html deleted file mode 100755 index db7d0a5..0000000 --- a/tutorial-3/pixi.js-master/examples/example 22 - Complex Masking/index.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - pixi.js example 22 complex masking - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 22 - Complex Masking/skully.png b/tutorial-3/pixi.js-master/examples/example 22 - Complex Masking/skully.png deleted file mode 100755 index c21b40d..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 22 - Complex Masking/skully.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 23 - Texture Swap/eggHead.png b/tutorial-3/pixi.js-master/examples/example 23 - Texture Swap/eggHead.png deleted file mode 100755 index f8bff53..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 23 - Texture Swap/eggHead.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 23 - Texture Swap/flowerTop.png b/tutorial-3/pixi.js-master/examples/example 23 - Texture Swap/flowerTop.png deleted file mode 100755 index 041cf2a..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 23 - Texture Swap/flowerTop.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 23 - Texture Swap/index.html b/tutorial-3/pixi.js-master/examples/example 23 - Texture Swap/index.html deleted file mode 100755 index 21feded..0000000 --- a/tutorial-3/pixi.js-master/examples/example 23 - Texture Swap/index.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - pixi.js example 23 - Texture Swap - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 24 - Box2D Integration/box2d.min.js b/tutorial-3/pixi.js-master/examples/example 24 - Box2D Integration/box2d.min.js deleted file mode 100755 index 1b579fd..0000000 --- a/tutorial-3/pixi.js-master/examples/example 24 - Box2D Integration/box2d.min.js +++ /dev/null @@ -1,112 +0,0 @@ -var b2Settings=function(){};b2Settings.prototype={};b2Settings.USHRT_MAX=65535;b2Settings.b2_pi=Math.PI;b2Settings.b2_massUnitsPerKilogram=1;b2Settings.b2_timeUnitsPerSecond=1;b2Settings.b2_lengthUnitsPerMeter=30;b2Settings.b2_maxManifoldPoints=2;b2Settings.b2_maxShapesPerBody=64;b2Settings.b2_maxPolyVertices=8;b2Settings.b2_maxProxies=1024;b2Settings.b2_maxPairs=8*b2Settings.b2_maxProxies;b2Settings.b2_linearSlop=0.005*b2Settings.b2_lengthUnitsPerMeter;b2Settings.b2_angularSlop=2/180*b2Settings.b2_pi;b2Settings.b2_velocityThreshold=1*b2Settings.b2_lengthUnitsPerMeter/b2Settings.b2_timeUnitsPerSecond;b2Settings.b2_maxLinearCorrection=0.2*b2Settings.b2_lengthUnitsPerMeter;b2Settings.b2_maxAngularCorrection=8/180*b2Settings.b2_pi;b2Settings.b2_contactBaumgarte=0.2;b2Settings.b2_timeToSleep=0.5*b2Settings.b2_timeUnitsPerSecond;b2Settings.b2_linearSleepTolerance=0.01*b2Settings.b2_lengthUnitsPerMeter/b2Settings.b2_timeUnitsPerSecond;b2Settings.b2_angularSleepTolerance=2/180/b2Settings.b2_timeUnitsPerSecond; -b2Settings.b2Assert=function(b){if(!b){var c;c.x++}};Object.extend=function(a,c){for(var b in c){a[b]=c[b]}return a};var b2Vec2=function(a,b){this.x=a;this.y=b};b2Vec2.prototype={SetZero:function(){this.x=0;this.y=0},Set:function(a,b){this.x=a;this.y=b},SetV:function(a){this.x=a.x;this.y=a.y},Negative:function(){return new b2Vec2(-this.x,-this.y)},Copy:function(){return new b2Vec2(this.x,this.y)},Add:function(a){this.x+=a.x;this.y+=a.y},Subtract:function(a){this.x-=a.x;this.y-=a.y},Multiply:function(b){this.x*=b;this.y*=b},MulM:function(b){var a=this.x;this.x=b.col1.x*a+b.col2.x*this.y;this.y=b.col1.y*a+b.col2.y*this.y},MulTM:function(b){var a=b2Math.b2Dot(this,b.col1);this.y=b2Math.b2Dot(this,b.col2);this.x=a},CrossVF:function(b){var a=this.x;this.x=b*this.y;this.y=-b*a},CrossFV:function(b){var a=this.x;this.x=-b*this.y;this.y=b*a},MinV:function(a){this.x=this.xa.x?this.x:a.x;this.y=this.y>a.y?this.y:a.y},Abs:function(){this.x=Math.abs(this.x);this.y=Math.abs(this.y)},Length:function(){return Math.sqrt(this.x*this.x+this.y*this.y) -},Normalize:function(){var b=this.Length();if(b0?b:-b};b2Math.b2AbsV=function(d){var c=new b2Vec2(b2Math.b2Abs(d.x),b2Math.b2Abs(d.y));return c};b2Math.b2AbsM=function(a){var b=new b2Mat22(0,b2Math.b2AbsV(a.col1),b2Math.b2AbsV(a.col2));return b};b2Math.b2Min=function(d,c){return dc?d:c};b2Math.b2MaxV=function(e,d){var f=new b2Vec2(b2Math.b2Max(e.x,d.x),b2Math.b2Max(e.y,d.y));return f};b2Math.b2Clamp=function(c,b,d){return b2Math.b2Max(b,b2Math.b2Min(c,d))};b2Math.b2ClampV=function(c,b,d){return b2Math.b2MaxV(b,b2Math.b2MinV(c,d))};b2Math.b2Swap=function(d,c){var e=d[0];d[0]=c[0];c[0]=e};b2Math.b2Random=function(){return Math.random()*2-1};b2Math.b2NextPowerOfTwo=function(a){a|=(a>>1)&2147483647;a|=(a>>2)&1073741823;a|=(a>>4)&268435455;a|=(a>>8)&16777215; -a|=(a>>16)&65535;return a+1};b2Math.b2IsPowerOfTwo=function(b){var a=b>0&&(b&(b-1))==0;return a};b2Math.tempVec2=new b2Vec2();b2Math.tempVec3=new b2Vec2();b2Math.tempVec4=new b2Vec2();b2Math.tempVec5=new b2Vec2();b2Math.tempMat=new b2Mat22();var b2AABB=function(){this.minVertex=new b2Vec2();this.maxVertex=new b2Vec2()};b2AABB.prototype={IsValid:function(){var b=this.maxVertex.x;var a=this.maxVertex.y;b=this.maxVertex.x;a=this.maxVertex.y;b-=this.minVertex.x;a-=this.minVertex.y;var c=b>=0&&a>=0;c=c&&this.minVertex.IsValid()&&this.maxVertex.IsValid();return c},minVertex:new b2Vec2(),maxVertex:new b2Vec2()};var b2Bound=function(){};b2Bound.prototype={IsLower:function(){return(this.value&1)==0},IsUpper:function(){return(this.value&1)==1},Swap:function(c){var e=this.value;var d=this.proxyId;var a=this.stabbingCount;this.value=c.value;this.proxyId=c.proxyId;this.stabbingCount=c.stabbingCount;c.value=e;c.proxyId=d;c.stabbingCount=a},value:0,proxyId:0,stabbingCount:0};var b2BoundValues=function(){this.lowerValues=[0,0];this.upperValues=[0,0]};b2BoundValues.prototype={lowerValues:[0,0],upperValues:[0,0]};var b2Pair=function(){};b2Pair.prototype={SetBuffered:function(){this.status|=b2Pair.e_pairBuffered},ClearBuffered:function(){this.status&=~b2Pair.e_pairBuffered},IsBuffered:function(){return(this.status&b2Pair.e_pairBuffered)==b2Pair.e_pairBuffered},SetRemoved:function(){this.status|=b2Pair.e_pairRemoved},ClearRemoved:function(){this.status&=~b2Pair.e_pairRemoved},IsRemoved:function(){return(this.status&b2Pair.e_pairRemoved)==b2Pair.e_pairRemoved},SetFinal:function(){this.status|=b2Pair.e_pairFinal},IsFinal:function(){return(this.status&b2Pair.e_pairFinal)==b2Pair.e_pairFinal},userData:null,proxyId1:0,proxyId2:0,next:0,status:0};b2Pair.b2_nullPair=b2Settings.USHRT_MAX;b2Pair.b2_nullProxy=b2Settings.USHRT_MAX;b2Pair.b2_tableCapacity=b2Settings.b2_maxPairs;b2Pair.b2_tableMask=b2Pair.b2_tableCapacity-1;b2Pair.e_pairBuffered=1;b2Pair.e_pairRemoved=2;b2Pair.e_pairFinal=4;var b2PairCallback=function(){};b2PairCallback.prototype={PairAdded:function(b,a){return null},PairRemoved:function(c,b,a){}};var b2BufferedPair=function(){};b2BufferedPair.prototype={proxyId1:0,proxyId2:0};var b2PairManager=function(){var a=0;this.m_hashTable=new Array(b2Pair.b2_tableCapacity);for(a=0;aa){var c=b;b=a;a=c}var d=b2PairManager.Hash(b,a)&b2Pair.b2_tableMask;var f=f=this.FindHash(b,a,d);if(f!=null){return f}var e=this.m_freePair;f=this.m_pairs[e];this.m_freePair=f.next;f.proxyId1=b;f.proxyId2=a;f.status=0;f.userData=null;f.next=this.m_hashTable[d];this.m_hashTable[d]=e;++this.m_pairCount;return f},RemovePair:function(g,f){if(g>f){var i=g;g=f;f=i}var d=b2PairManager.Hash(g,f)&b2Pair.b2_tableMask;var b=this.m_hashTable[d];var h=null;while(b!=b2Pair.b2_nullPair){if(b2PairManager.Equals(this.m_pairs[b],g,f)){var e=b;if(h){h.next=this.m_pairs[b].next}else{this.m_hashTable[d]=this.m_pairs[b].next}var c=this.m_pairs[e];var a=c.userData;c.next=this.m_freePair;c.proxyId1=b2Pair.b2_nullProxy;c.proxyId2=b2Pair.b2_nullProxy;c.userData=null;c.status=0;this.m_freePair=e;--this.m_pairCount;return a}else{h=this.m_pairs[b];b=h.next}}return null},Find:function(b,a){if(b>a){var c=b;b=a;a=c -}var d=b2PairManager.Hash(b,a)&b2Pair.b2_tableMask;return this.FindHash(b,a,d)},FindHash:function(b,a,d){var c=this.m_hashTable[d];while(c!=b2Pair.b2_nullPair&&b2PairManager.Equals(this.m_pairs[c],b,a)==false){c=this.m_pairs[c].next}if(c==b2Pair.b2_nullPair){return null}return this.m_pairs[c]},ValidateBuffer:function(){},ValidateTable:function(){},m_broadPhase:null,m_callback:null,m_pairs:null,m_freePair:0,m_pairCount:0,m_pairBuffer:null,m_pairBufferCount:0,m_hashTable:null};b2PairManager.Hash=function(b,a){var c=((a<<16)&4294901760)|b;c=~c+((c<<15)&4294934528);c=c^((c>>12)&1048575);c=c+((c<<2)&4294967292);c=c^((c>>4)&268435455);c=c*2057;c=c^((c>>16)&65535);return c};b2PairManager.Equals=function(c,b,a){return(c.proxyId1==b&&c.proxyId2==a)};b2PairManager.EqualsPair=function(b,a){return b.proxyId1==a.proxyId1&&b.proxyId2==a.proxyId2};var b2BroadPhase=function(f,g){this.m_pairManager=new b2PairManager();this.m_proxyPool=new Array(b2Settings.b2_maxPairs);this.m_bounds=new Array(2*b2Settings.b2_maxProxies);this.m_queryResults=new Array(b2Settings.b2_maxProxies);this.m_quantizationFactor=new b2Vec2();var d=0;this.m_pairManager.Initialize(this,g);this.m_worldAABB=f;this.m_proxyCount=0;for(d=0;d0&&t0){g=m;while(g0){g=k;while(g0&&bb[c.upperBounds[a]].value){return false}if(b[d.upperBounds[a]].valued[e.upperBounds[c]].value){return false}if(a.upperValues[c]0){var g=c-1;var n=a[g].stabbingCount;while(n){if(a[g].IsLower()){var k=this.m_proxyPool[a[g].proxyId];if(c<=k.upperBounds[b]){this.IncrementOverlapCount(a[g].proxyId);--n}}--g}}h[0]=c;d[0]=l},IncrementOverlapCount:function(b){var a=this.m_proxyPool[b];if(a.timeStampf){e=b-1}else{if(d[b].value0){f[c].id=b[0].id}else{f[c].id=b[1].id}++c}return c};b2Collision.EdgeSeparation=function(p,q,o){var f=p.m_vertices;var g=o.m_vertexCount;var r=o.m_vertices;var e=p.m_normals[q].x;var d=p.m_normals[q].y;var s=e;var l=p.m_R;e=l.col1.x*s+l.col2.x*d;d=l.col1.y*s+l.col2.y*d;var v=e;var u=d;l=o.m_R;s=v*l.col1.x+u*l.col1.y;u=v*l.col2.x+u*l.col2.y;v=s;var n=0;var m=Number.MAX_VALUE;for(var w=0;wa){a=o;h=p}}var n=b2Collision.EdgeSeparation(m,h,l);if(n>0&&w==false){return n}var g=h-1>=0?h-1:j-1;var t=b2Collision.EdgeSeparation(m,g,l);if(t>0&&w==false){return t}var q=h+10&&w==false){return u}var b=0;var k;var v=0;if(t>n&&t>u){v=-1;b=g;k=t}else{if(u>n){v=1;b=q;k=u}else{r[0]=h;return n}}while(true){if(v==-1){h=b-1>=0?b-1:j-1}else{h=b+10&&w==false){return n}if(n>k){b=h;k=n}else{break}}r[0]=b;return k};b2Collision.FindIncidentEdge=function(D,p,q,n){var h=p.m_vertexCount;var f=p.m_vertices;var g=n.m_vertexCount;var s=n.m_vertices;var a=q; -var F=q+1==h?0:q+1;var e=f[F];var C=e.x;var A=e.y;e=f[a];C-=e.x;A-=e.y;var v=C;C=A;A=-v;var E=1/Math.sqrt(C*C+A*A);C*=E;A*=E;var r=C;var o=A;v=r;var l=p.m_R;r=l.col1.x*v+l.col2.x*o;o=l.col1.y*v+l.col2.y*o;var d=r;var b=o;l=n.m_R;v=d*l.col1.x+b*l.col1.y;b=d*l.col2.x+b*l.col2.y;d=v;var k=0;var j=0;var m=Number.MAX_VALUE;for(var B=0;B0&&b==false){return -}var K=0;var g=[K];var E=b2Collision.FindMaxSeparation(g,j,k,b);K=g[0];if(E>0&&b==false){return}var p;var o;var a=0;var R=0;var d=0.98;var O=0.001;if(E>d*F+O){p=j;o=k;a=K;R=1}else{p=k;o=j;a=M;R=0}var c=[new ClipVertex(),new ClipVertex()];b2Collision.FindIncidentEdge(c,p,a,o);var B=p.m_vertexCount;var q=p.m_vertices;var I=q[a];var H=a+1l*l&&b==false){return}var d;if(mg){return}if(t>o){o=t;B=A}}if(og){return}x.pointCount=1;x.normal.Set(n.col1.x*e+n.col2.x*d,n.col1.y*e+n.col2.y*d);h=x.points[0];h.id.features.incidentEdge=b2Collision.b2_nullFeature;h.id.features.incidentVertex=b;h.id.features.referenceFace=b2Collision.b2_nullFeature;h.id.features.flip=0;h.position.x=k.m_position.x-g*x.normal.x;h.position.y=k.m_position.y-g*x.normal.y;h.separation=w-g;return}var q=(z-m.m_vertices[b].x)*r+(y-m.m_vertices[b].y)*p;h=x.points[0];h.id.features.incidentEdge=b2Collision.b2_nullFeature;h.id.features.incidentVertex=b2Collision.b2_nullFeature;h.id.features.referenceFace=b2Collision.b2_nullFeature;h.id.features.flip=0;var l,j;if(q<=0){l=m.m_vertices[b].x;j=m.m_vertices[b].y;h.id.features.incidentVertex=b}else{if(q>=f){l=m.m_vertices[a].x;j=m.m_vertices[a].y;h.id.features.incidentVertex=a}else{l=r*q+m.m_vertices[b].x;j=p*q+m.m_vertices[b].y;h.id.features.incidentEdge=b}}e=z-l;d=y-j;w=Math.sqrt(e*e+d*d);e/=w;d/=w;if(w>g){return}x.pointCount=1;x.normal.Set(n.col1.x*e+n.col2.x*d,n.col1.y*e+n.col2.y*d); -h.position.x=k.m_position.x-g*x.normal.x;h.position.y=k.m_position.y-g*x.normal.y;h.separation=w-g};b2Collision.b2TestOverlap=function(d,c){var i=c.minVertex;var g=d.maxVertex;var f=i.x-g.x;var e=i.y-g.y;i=d.minVertex;g=c.maxVertex;var j=i.x-g.x;var h=i.y-g.y;if(f>0||e>0){return false}if(j>0||h>0){return false}return true};var Features=function(){};Features.prototype={set_referenceFace:function(a){this._referenceFace=a;this._m_id._key=(this._m_id._key&4294967040)|(this._referenceFace&255)},get_referenceFace:function(){return this._referenceFace},_referenceFace:0,set_incidentEdge:function(a){this._incidentEdge=a;this._m_id._key=(this._m_id._key&4294902015)|((this._incidentEdge<<8)&65280)},get_incidentEdge:function(){return this._incidentEdge},_incidentEdge:0,set_incidentVertex:function(a){this._incidentVertex=a;this._m_id._key=(this._m_id._key&4278255615)|((this._incidentVertex<<16)&16711680)},get_incidentVertex:function(){return this._incidentVertex},_incidentVertex:0,set_flip:function(a){this._flip=a;this._m_id._key=(this._m_id._key&16777215)|((this._flip<<24)&4278190080)},get_flip:function(){return this._flip},_flip:0,_m_id:null};var b2ContactID=function(){this.features=new Features();this.features._m_id=this};b2ContactID.prototype={Set:function(a){this.set_key(a._key)},Copy:function(){var a=new b2ContactID();a.set_key(this._key);return a},get_key:function(){return this._key},set_key:function(a){this._key=a;this.features._referenceFace=this._key&255;this.features._incidentEdge=((this._key&65280)>>8)&255;this.features._incidentVertex=((this._key&16711680)>>16)&255;this.features._flip=((this._key&4278190080)>>24)&255},features:new Features(),_key:0};var b2ContactPoint=function(){this.position=new b2Vec2();this.id=new b2ContactID()};b2ContactPoint.prototype={position:new b2Vec2(),separation:null,normalImpulse:null,tangentImpulse:null,id:new b2ContactID()};var b2Distance=function(){};b2Distance.prototype={};b2Distance.ProcessTwo=function(j,h,b,k,i){var f=-i[1].x;var e=-i[1].y;var d=i[0].x-i[1].x;var c=i[0].y-i[1].y;var a=Math.sqrt(d*d+c*c);d/=a;c/=a;var g=f*d+e*c;if(g<=0||a=0&&F>=0){var B=x/(x+F);q.x=m[1].x+B*(m[2].x-m[1].x);q.y=m[1].y+B*(m[2].y-m[1].y);D.x=C[1].x+B*(C[2].x-C[1].x); -D.y=C[1].y+B*(C[2].y-C[1].y);m[0].SetV(m[2]);C[0].SetV(C[2]);G[0].SetV(G[2]);return 2}var f=E*(J*h-I*k);if(f<=0&&j>=0&&o>=0){var B=j/(j+o);q.x=m[0].x+B*(m[2].x-m[0].x);q.y=m[0].y+B*(m[2].y-m[0].y);D.x=C[0].x+B*(C[2].x-C[0].x);D.y=C[0].y+B*(C[2].y-C[0].y);m[1].SetV(m[2]);C[1].SetV(C[2]);G[1].SetV(G[2]);return 2}var d=g+f+e;d=1/d;var A=g*d;var t=f*d;var p=1-A-t;q.x=A*m[0].x+t*m[1].x+p*m[2].x;q.y=A*m[0].y+t*m[1].y+p*m[2].y;D.x=A*C[0].x+t*C[1].x+p*C[2].x;D.y=A*C[0].y+t*C[1].y+p*C[2].y;return 3};b2Distance.InPoinsts=function(a,c,d){for(var b=0;bNumber.MIN_VALUE){D*=1/d;C*=1/d}this.m_coreVertices[w].x=this.m_vertices[w].x-2*b2Settings.b2_linearSlop*D;this.m_coreVertices[w].y=this.m_vertices[w].y-2*b2Settings.b2_linearSlop*C}}var y=Number.MAX_VALUE;var x=Number.MAX_VALUE;var m=-Number.MAX_VALUE;var l=-Number.MAX_VALUE;this.m_maxRadius=0;for(w=0;w0){return false}}return true},syncAABB:new b2AABB(),syncMat:new b2Mat22(),Synchronize:function(c,e,a,b){this.m_R.SetM(b); -this.m_position.x=this.m_body.m_position.x+(b.col1.x*this.m_localCentroid.x+b.col2.x*this.m_localCentroid.y);this.m_position.y=this.m_body.m_position.y+(b.col1.y*this.m_localCentroid.x+b.col2.y*this.m_localCentroid.y);if(this.m_proxyId==b2Pair.b2_nullProxy){return}var m;var l;var k=e.col1;var j=e.col2;var i=this.m_localOBB.R.col1;var h=this.m_localOBB.R.col2;this.syncMat.col1.x=k.x*i.x+j.x*i.y;this.syncMat.col1.y=k.y*i.x+j.y*i.y;this.syncMat.col2.x=k.x*h.x+j.x*h.y;this.syncMat.col2.y=k.y*h.x+j.y*h.y;this.syncMat.Abs();m=this.m_localCentroid.x+this.m_localOBB.center.x;l=this.m_localCentroid.y+this.m_localOBB.center.y;var f=c.x+(e.col1.x*m+e.col2.x*l);var d=c.y+(e.col1.y*m+e.col2.y*l);m=this.syncMat.col1.x*this.m_localOBB.extents.x+this.syncMat.col2.x*this.m_localOBB.extents.y;l=this.syncMat.col1.y*this.m_localOBB.extents.x+this.syncMat.col2.y*this.m_localOBB.extents.y;this.syncAABB.minVertex.x=f-m;this.syncAABB.minVertex.y=d-l;this.syncAABB.maxVertex.x=f+m;this.syncAABB.maxVertex.y=d+l;k=b.col1; -j=b.col2;i=this.m_localOBB.R.col1;h=this.m_localOBB.R.col2;this.syncMat.col1.x=k.x*i.x+j.x*i.y;this.syncMat.col1.y=k.y*i.x+j.y*i.y;this.syncMat.col2.x=k.x*h.x+j.x*h.y;this.syncMat.col2.y=k.y*h.x+j.y*h.y;this.syncMat.Abs();m=this.m_localCentroid.x+this.m_localOBB.center.x;l=this.m_localCentroid.y+this.m_localOBB.center.y;f=a.x+(b.col1.x*m+b.col2.x*l);d=a.y+(b.col1.y*m+b.col2.y*l);m=this.syncMat.col1.x*this.m_localOBB.extents.x+this.syncMat.col2.x*this.m_localOBB.extents.y;l=this.syncMat.col1.y*this.m_localOBB.extents.x+this.syncMat.col2.y*this.m_localOBB.extents.y;this.syncAABB.minVertex.x=Math.min(this.syncAABB.minVertex.x,f-m);this.syncAABB.minVertex.y=Math.min(this.syncAABB.minVertex.y,d-l);this.syncAABB.maxVertex.x=Math.max(this.syncAABB.maxVertex.x,f+m);this.syncAABB.maxVertex.y=Math.max(this.syncAABB.maxVertex.y,d+l);var g=this.m_body.m_world.m_broadPhase;if(g.InRange(this.syncAABB)){g.MoveProxy(this.m_proxyId,this.syncAABB)}else{this.m_body.Freeze()}},QuickSync:function(a,b){this.m_R.SetM(b); -this.m_position.x=a.x+(b.col1.x*this.m_localCentroid.x+b.col2.x*this.m_localCentroid.y);this.m_position.y=a.y+(b.col1.y*this.m_localCentroid.x+b.col2.y*this.m_localCentroid.y)},ResetProxy:function(b){if(this.m_proxyId==b2Pair.b2_nullProxy){return}var e=b.GetProxy(this.m_proxyId);b.DestroyProxy(this.m_proxyId);e=null;var g=b2Math.b2MulMM(this.m_R,this.m_localOBB.R);var d=b2Math.b2AbsM(g);var f=b2Math.b2MulMV(d,this.m_localOBB.extents);var a=b2Math.b2MulMV(this.m_R,this.m_localOBB.center);a.Add(this.m_position);var c=new b2AABB();c.minVertex.SetV(a);c.minVertex.Subtract(f);c.maxVertex.SetV(a);c.maxVertex.Add(f);if(b.InRange(c)){this.m_proxyId=b.CreateProxy(c,this)}else{this.m_proxyId=b2Pair.b2_nullProxy}if(this.m_proxyId==b2Pair.b2_nullProxy){this.m_body.Freeze()}},Support:function(c,a,b){var g=(c*this.m_R.col1.x+a*this.m_R.col1.y);var f=(c*this.m_R.col2.x+a*this.m_R.col2.y);var e=0;var j=(this.m_coreVertices[0].x*g+this.m_coreVertices[0].y*f);for(var d=1;dj){e=d;j=h}}b.Set(this.m_position.x+(this.m_R.col1.x*this.m_coreVertices[e].x+this.m_R.col2.x*this.m_coreVertices[e].y),this.m_position.y+(this.m_R.col1.y*this.m_coreVertices[e].x+this.m_R.col2.y*this.m_coreVertices[e].y))},m_localCentroid:new b2Vec2(),m_localOBB:new b2OBB(),m_vertices:null,m_coreVertices:null,m_vertexCount:0,m_normals:null});b2PolyShape.tempVec=new b2Vec2();b2PolyShape.tAbsR=new b2Mat22();var b2Body=function(f,e){this.sMat0=new b2Mat22();this.m_position=new b2Vec2();this.m_R=new b2Mat22(0);this.m_position0=new b2Vec2();var c=0;var g;var a;this.m_flags=0;this.m_position.SetV(f.position);this.m_rotation=f.rotation;this.m_R.Set(this.m_rotation);this.m_position0.SetV(this.m_position);this.m_rotation0=this.m_rotation;this.m_world=e;this.m_linearDamping=b2Math.b2Clamp(1-f.linearDamping,0,1);this.m_angularDamping=b2Math.b2Clamp(1-f.angularDamping,0,1);this.m_force=new b2Vec2(0,0);this.m_torque=0;this.m_mass=0;var h=new Array(b2Settings.b2_maxShapesPerBody);for(c=0;c0){this.m_center.Multiply(1/this.m_mass);this.m_position.Add(b2Math.b2MulMV(this.m_R,this.m_center)) -}else{this.m_flags|=b2Body.e_staticFlag}this.m_I=0;for(c=0;c0){this.m_invMass=1/this.m_mass}else{this.m_invMass=0}if(this.m_I>0&&f.preventRotation==false){this.m_invI=1/this.m_I}else{this.m_I=0;this.m_invI=0}this.m_linearVelocity=b2Math.AddVV(f.linearVelocity,b2Math.b2CrossFV(f.angularVelocity,this.m_center));this.m_angularVelocity=f.angularVelocity;this.m_jointList=null;this.m_contactList=null;this.m_prev=null;this.m_next=null;this.m_shapeList=null;for(c=0;c0}var c=(b.m_maskBits&a.m_categoryBits)!=0&&(b.m_categoryBits&a.m_maskBits)!=0;return c}};b2CollisionFilter.b2_defaultFilter=new b2CollisionFilter;var b2Island=function(e,d,c,a){var b=0;this.m_bodyCapacity=e;this.m_contactCapacity=d;this.m_jointCapacity=c;this.m_bodyCount=0;this.m_contactCount=0;this.m_jointCount=0;this.m_bodies=new Array(e);for(b=0;bc||b2Math.b2Dot(a.m_linearVelocity,a.m_linearVelocity)>d){a.m_sleepTime=0;e=0}else{a.m_sleepTime+=g;e=b2Math.b2Min(e,a.m_sleepTime)}}if(e>=b2Settings.b2_timeToSleep){for(f=0;f0){a.m_shape1.m_body.WakeUp();a.m_shape2.m_body.WakeUp()}var d=a.m_shape1.m_type;var b=a.m_shape2.m_type;var e=b2Contact.s_registers[d][b].destroyFcn;e(a,c)};b2Contact.s_registers=null;b2Contact.s_initialized=false;var b2ContactConstraint=function(){this.normal=new b2Vec2();this.points=new Array(b2Settings.b2_maxManifoldPoints);for(var a=0;a0){b.velocityBias=-60*b.separation}var h=f+(-F*C)-u-(-G*Q);var g=d+(F*D)-s-(G*S);var P=V.normal.x*h+V.normal.y*g;if(P<-b2Settings.b2_velocityThreshold){b.velocityBias+=-V.restitution*P}}++L}}};b2ContactSolver.prototype={PreSolve:function(){var b;var A;var r;for(var w=0;w=-b2Settings.b2_linearSlop},PostSolve:function(){for(var d=0;d0){this.m_manifoldCount=1 -}else{this.m_manifoldCount=0}},GetManifolds:function(){return this.m_manifold},m_manifold:[new b2Manifold()]});b2CircleContact.Create=function(b,a,c){return new b2CircleContact(b,a)};b2CircleContact.Destroy=function(a,b){};var b2Conservative=function(){};b2Conservative.prototype={};b2Conservative.R1=new b2Mat22();b2Conservative.R2=new b2Mat22();b2Conservative.x1=new b2Vec2();b2Conservative.x2=new b2Vec2();b2Conservative.Conservative=function(k,j){var i=k.GetBody();var h=j.GetBody();var s=i.m_position.x-i.m_position0.x;var q=i.m_position.y-i.m_position0.y;var H=i.m_rotation-i.m_rotation0;var b=h.m_position.x-h.m_position0.x;var a=h.m_position.y-h.m_position0.y;var F=h.m_rotation-h.m_rotation0;var m=k.GetMaxRadius();var l=j.GetMaxRadius();var I=i.m_position0.x;var D=i.m_position0.y;var z=i.m_rotation0;var E=h.m_position0.x;var C=h.m_position0.y;var n=h.m_rotation0;var e=I;var c=D;var J=z;var B=E;var A=C;var G=n;b2Conservative.R1.Set(J);b2Conservative.R2.Set(G);k.QuickSync(p1,b2Conservative.R1);j.QuickSync(p2,b2Conservative.R2);var L=0;var o=10;var u;var t;var y=0;var v=true;for(var w=0;wFLT_EPSILON){d*=b2_linearSlop/p}if(i.IsStatic()){i.m_position.x=e;i.m_position.y=c}else{i.m_position.x=e-u;i.m_position.y=c-t}i.m_rotation=J;i.m_R.Set(J);i.QuickSyncShapes();if(h.IsStatic()){h.m_position.x=B;h.m_position.y=A}else{h.m_position.x=B+u;h.m_position.y=A+t}h.m_position.x=B+u;h.m_position.y=A+t;h.m_rotation=G;h.m_R.Set(G);h.QuickSyncShapes();return true -}k.QuickSync(i.m_position,i.m_R);j.QuickSync(h.m_position,h.m_R);return false};var b2NullContact=function(b,a){this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!b||!a){this.m_shape1=null;this.m_shape2=null;return}this.m_shape1=b;this.m_shape2=a;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null};Object.extend(b2NullContact.prototype,b2Contact.prototype);Object.extend(b2NullContact.prototype,{Evaluate:function(){},GetManifolds:function(){return null}});var b2PolyAndCircleContact=function(b,a){this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!b||!a){this.m_shape1=null;this.m_shape2=null;return}this.m_shape1=b;this.m_shape2=a;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null;this.m_manifold=[new b2Manifold()];b2Settings.b2Assert(this.m_shape1.m_type==b2Shape.e_polyShape);b2Settings.b2Assert(this.m_shape2.m_type==b2Shape.e_circleShape);this.m_manifold[0].pointCount=0;this.m_manifold[0].points[0].normalImpulse=0;this.m_manifold[0].points[0].tangentImpulse=0};Object.extend(b2PolyAndCircleContact.prototype,b2Contact.prototype);Object.extend(b2PolyAndCircleContact.prototype,{Evaluate:function(){b2Collision.b2CollidePolyAndCircle(this.m_manifold[0],this.m_shape1,this.m_shape2,false); -if(this.m_manifold[0].pointCount>0){this.m_manifoldCount=1}else{this.m_manifoldCount=0}},GetManifolds:function(){return this.m_manifold},m_manifold:[new b2Manifold()]});b2PolyAndCircleContact.Create=function(b,a,c){return new b2PolyAndCircleContact(b,a)};b2PolyAndCircleContact.Destroy=function(a,b){};var b2PolyContact=function(b,a){this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!b||!a){this.m_shape1=null;this.m_shape2=null;return}this.m_shape1=b;this.m_shape2=a;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null;this.m0=new b2Manifold();this.m_manifold=[new b2Manifold()];this.m_manifold[0].pointCount=0};Object.extend(b2PolyContact.prototype,b2Contact.prototype);Object.extend(b2PolyContact.prototype,{m0:new b2Manifold(),Evaluate:function(){var a=this.m_manifold[0];var b=this.m0.points;for(var d=0;d0){var h=[false,false];for(var f=0;f0){var e=f.m_shape1.m_body;var d=f.m_shape2.m_body;var b=f.m_node1;var a=f.m_node2;e.WakeUp();d.WakeUp();if(b.prev){b.prev.next=b.next}if(b.next){b.next.prev=b.prev}if(b==e.m_contactList){e.m_contactList=b.next}b.prev=null;b.next=null;if(a.prev){a.prev.next=a.next}if(a.next){a.next.prev=a.prev}if(a==d.m_contactList){d.m_contactList=a.next}a.prev=null;a.next=null}b2Contact.Destroy(f,this.m_world.m_blockAllocator);--this.m_world.m_contactCount},CleanContactList:function(){var b=this.m_world.m_contactList;while(b!=null){var a=b;b=b.m_next;if(a.m_flags&b2Contact.e_destroyFlag){this.DestroyContact(a);a=null}}},Collide:function(){var f;var e;var d;var a;for(var h=this.m_world.m_contactList;h!=null;h=h.m_next){if(h.m_shape1.m_body.IsSleeping()&&h.m_shape2.m_body.IsSleeping()){continue -}var b=h.GetManifoldCount();h.Evaluate();var g=h.GetManifoldCount();if(b==0&&g>0){f=h.m_shape1.m_body;e=h.m_shape2.m_body;d=h.m_node1;a=h.m_node2;d.contact=h;d.other=e;d.prev=null;d.next=f.m_contactList;if(d.next!=null){d.next.prev=h.m_node1}f.m_contactList=h.m_node1;a.contact=h;a.other=f;a.prev=null;a.next=e.m_contactList;if(a.next!=null){a.next.prev=a}e.m_contactList=a}else{if(b>0&&g==0){f=h.m_shape1.m_body;e=h.m_shape2.m_body;d=h.m_node1;a=h.m_node2;if(d.prev){d.prev.next=d.next}if(d.next){d.next.prev=d.prev}if(d==f.m_contactList){f.m_contactList=d.next}d.prev=null;d.next=null;if(a.prev){a.prev.next=a.next}if(a.next){a.next.prev=a.prev}if(a==e.m_contactList){e.m_contactList=a.next}a.prev=null;a.next=null}}}},m_world:null,m_nullContact:new b2NullContact(),m_destroyImmediate:null});var b2World=function(a,d,c){this.step=new b2TimeStep();this.m_contactManager=new b2ContactManager();this.m_listener=null;this.m_filter=b2CollisionFilter.b2_defaultFilter;this.m_bodyList=null;this.m_contactList=null;this.m_jointList=null;this.m_bodyCount=0;this.m_contactCount=0;this.m_jointCount=0;this.m_bodyDestroyList=null;this.m_allowSleep=c;this.m_gravity=d;this.m_contactManager.m_world=this;this.m_broadPhase=new b2BroadPhase(a,this.m_contactManager);var b=new b2BodyDef();this.m_groundBody=this.CreateBody(b)};b2World.prototype={SetListener:function(a){this.m_listener=a},SetFilter:function(a){this.m_filter=a},CreateBody:function(c){var a=new b2Body(c,this);a.m_prev=null;a.m_next=this.m_bodyList;if(this.m_bodyList){this.m_bodyList.m_prev=a}this.m_bodyList=a;++this.m_bodyCount;return a},DestroyBody:function(a){if(a.m_flags&b2Body.e_destroyFlag){return}if(a.m_prev){a.m_prev.m_next=a.m_next}if(a.m_next){a.m_next.m_prev=a.m_prev}if(a==this.m_bodyList){this.m_bodyList=a.m_next}a.m_flags|=b2Body.e_destroyFlag; ---this.m_bodyCount;a.m_prev=null;a.m_next=this.m_bodyDestroyList;this.m_bodyDestroyList=a},CleanBodyList:function(){this.m_contactManager.m_destroyImmediate=true;var c=this.m_bodyDestroyList;while(c){var e=c;c=c.m_next;var d=e.m_jointList;while(d){var a=d;d=d.next;if(this.m_listener){this.m_listener.NotifyJointDestroyed(a.joint)}this.DestroyJoint(a.joint)}e.Destroy()}this.m_bodyDestroyList=null;this.m_contactManager.m_destroyImmediate=false},CreateJoint:function(e){var c=b2Joint.Create(e,this.m_blockAllocator);c.m_prev=null;c.m_next=this.m_jointList;if(this.m_jointList){this.m_jointList.m_prev=c}this.m_jointList=c;++this.m_jointCount;c.m_node1.joint=c;c.m_node1.other=c.m_body2;c.m_node1.prev=null;c.m_node1.next=c.m_body1.m_jointList;if(c.m_body1.m_jointList){c.m_body1.m_jointList.prev=c.m_node1}c.m_body1.m_jointList=c.m_node1;c.m_node2.joint=c;c.m_node2.other=c.m_body1;c.m_node2.prev=null;c.m_node2.next=c.m_body2.m_jointList;if(c.m_body2.m_jointList){c.m_body2.m_jointList.prev=c.m_node2 -}c.m_body2.m_jointList=c.m_node2;if(e.collideConnected==false){var a=e.body1.m_shapeCount0){this.step.inv_dt=1/a}else{this.step.inv_dt=0}this.m_positionIterationCount=0;this.m_contactManager.CleanContactList();this.CleanBodyList();this.m_contactManager.Collide();var n=new b2Island(this.m_bodyCount,this.m_contactCount,this.m_jointCount,this.m_stackAllocator);for(r=this.m_bodyList;r!=null;r=r.m_next){r.m_flags&=~b2Body.e_islandFlag}for(var p=this.m_contactList;p!=null;p=p.m_next){p.m_flags&=~b2Contact.e_islandFlag}for(var h=this.m_jointList;h!=null;h=h.m_next){h.m_islandFlag=false}var u=this.m_bodyCount;var q=new Array(this.m_bodyCount);for(var g=0;g0){r=q[--t];n.AddBody(r);r.m_flags&=~b2Body.e_sleepFlag; -if(r.m_flags&b2Body.e_staticFlag){continue}for(var s=r.m_contactList;s!=null;s=s.next){if(s.contact.m_flags&b2Contact.e_islandFlag){continue}n.AddContact(s.contact);s.contact.m_flags|=b2Contact.e_islandFlag;o=s.other;if(o.m_flags&b2Body.e_islandFlag){continue}q[t++]=o;o.m_flags|=b2Body.e_islandFlag}for(var f=r.m_jointList;f!=null;f=f.next){if(f.joint.m_islandFlag==true){continue}n.AddJoint(f.joint);f.joint.m_islandFlag=true;o=f.other;if(o.m_flags&b2Body.e_islandFlag){continue}q[t++]=o;o.m_flags|=b2Body.e_islandFlag}}n.Solve(this.step,this.m_gravity);this.m_positionIterationCount=b2Math.b2Max(this.m_positionIterationCount,b2Island.m_positionIterationCount);if(this.m_allowSleep){n.UpdateSleep(a)}for(var l=0;lb2Settings.b2_linearSlop){this.m_u.Multiply(1/a)}else{this.m_u.SetZero()}var h=(j*this.m_u.y-i*this.m_u.x);var d=(f*this.m_u.y-e*this.m_u.x);this.m_mass=this.m_body1.m_invMass+this.m_body1.m_invI*h*h+this.m_body2.m_invMass+this.m_body2.m_invI*d*d;this.m_mass=1/this.m_mass;if(b2World.s_enableWarmStarting){var c=this.m_impulse*this.m_u.x;var b=this.m_impulse*this.m_u.y;this.m_body1.m_linearVelocity.x-=this.m_body1.m_invMass*c;this.m_body1.m_linearVelocity.y-=this.m_body1.m_invMass*b;this.m_body1.m_angularVelocity-=this.m_body1.m_invI*(j*b-i*c); -this.m_body2.m_linearVelocity.x+=this.m_body2.m_invMass*c;this.m_body2.m_linearVelocity.y+=this.m_body2.m_invMass*b;this.m_body2.m_angularVelocity+=this.m_body2.m_invI*(f*b-e*c)}else{this.m_impulse=0}},SolveVelocityConstraints:function(b){var j;j=this.m_body1.m_R;var n=j.col1.x*this.m_localAnchor1.x+j.col2.x*this.m_localAnchor1.y;var m=j.col1.y*this.m_localAnchor1.x+j.col2.y*this.m_localAnchor1.y;j=this.m_body2.m_R;var h=j.col1.x*this.m_localAnchor2.x+j.col2.x*this.m_localAnchor2.y;var g=j.col1.y*this.m_localAnchor2.x+j.col2.y*this.m_localAnchor2.y;var l=this.m_body1.m_linearVelocity.x+(-this.m_body1.m_angularVelocity*m);var k=this.m_body1.m_linearVelocity.y+(this.m_body1.m_angularVelocity*n);var f=this.m_body2.m_linearVelocity.x+(-this.m_body2.m_angularVelocity*g);var e=this.m_body2.m_linearVelocity.y+(this.m_body2.m_angularVelocity*h);var i=(this.m_u.x*(f-l)+this.m_u.y*(e-k));var a=-this.m_mass*i;this.m_impulse+=a;var d=a*this.m_u.x;var c=a*this.m_u.y;this.m_body1.m_linearVelocity.x-=this.m_body1.m_invMass*d; -this.m_body1.m_linearVelocity.y-=this.m_body1.m_invMass*c;this.m_body1.m_angularVelocity-=this.m_body1.m_invI*(n*c-m*d);this.m_body2.m_linearVelocity.x+=this.m_body2.m_invMass*d;this.m_body2.m_linearVelocity.y+=this.m_body2.m_invMass*c;this.m_body2.m_angularVelocity+=this.m_body2.m_invI*(h*c-g*d)},SolvePositionConstraints:function(){var j;j=this.m_body1.m_R;var l=j.col1.x*this.m_localAnchor1.x+j.col2.x*this.m_localAnchor1.y;var k=j.col1.y*this.m_localAnchor1.x+j.col2.y*this.m_localAnchor1.y;j=this.m_body2.m_R;var i=j.col1.x*this.m_localAnchor2.x+j.col2.x*this.m_localAnchor2.y;var h=j.col1.y*this.m_localAnchor2.x+j.col2.y*this.m_localAnchor2.y;var g=this.m_body2.m_position.x+i-this.m_body1.m_position.x-l;var f=this.m_body2.m_position.y+h-this.m_body1.m_position.y-k;var c=Math.sqrt(g*g+f*f);g/=c;f/=c;var a=c-this.m_length;a=b2Math.b2Clamp(a,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);var b=-this.m_mass*a;this.m_u.Set(g,f);var e=b*this.m_u.x;var d=b*this.m_u.y;this.m_body1.m_position.x-=this.m_body1.m_invMass*e; -this.m_body1.m_position.y-=this.m_body1.m_invMass*d;this.m_body1.m_rotation-=this.m_body1.m_invI*(l*d-k*e);this.m_body2.m_position.x+=this.m_body2.m_invMass*e;this.m_body2.m_position.y+=this.m_body2.m_invMass*d;this.m_body2.m_rotation+=this.m_body2.m_invI*(i*d-h*e);this.m_body1.m_R.Set(this.m_body1.m_rotation);this.m_body2.m_R.Set(this.m_body2.m_rotation);return b2Math.b2Abs(a)d.dt*this.m_maxForce){this.m_impulse.Multiply(d.dt*this.m_maxForce/b)}e=this.m_impulse.x-j;c=this.m_impulse.y-g;i.m_linearVelocity.x+=i.m_invMass*e;i.m_linearVelocity.y+=i.m_invMass*c; -i.m_angularVelocity+=i.m_invI*(h*c-f*e)},SolvePositionConstraints:function(){return true},m_localAnchor:new b2Vec2(),m_target:new b2Vec2(),m_impulse:new b2Vec2(),m_ptpMass:new b2Mat22(),m_C:new b2Vec2(),m_maxForce:null,m_beta:null,m_gamma:null});var b2MouseJointDef=function(){this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.target=new b2Vec2();this.type=b2Joint.e_mouseJoint;this.maxForce=0;this.frequencyHz=5;this.dampingRatio=0.7;this.timeStep=1/60};Object.extend(b2MouseJointDef.prototype,b2JointDef.prototype);Object.extend(b2MouseJointDef.prototype,{target:new b2Vec2(),maxForce:null,frequencyHz:null,dampingRatio:null,timeStep:null});var b2PrismaticJoint=function(c){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=c.type;this.m_prev=null;this.m_next=null;this.m_body1=c.body1;this.m_body2=c.body2;this.m_collideConnected=c.collideConnected;this.m_islandFlag=false;this.m_userData=c.userData;this.m_localAnchor1=new b2Vec2();this.m_localAnchor2=new b2Vec2();this.m_localXAxis1=new b2Vec2();this.m_localYAxis1=new b2Vec2();this.m_linearJacobian=new b2Jacobian();this.m_motorJacobian=new b2Jacobian();var b;var a;var d;b=this.m_body1.m_R;a=(c.anchorPoint.x-this.m_body1.m_position.x);d=(c.anchorPoint.y-this.m_body1.m_position.y);this.m_localAnchor1.Set((a*b.col1.x+d*b.col1.y),(a*b.col2.x+d*b.col2.y));b=this.m_body2.m_R;a=(c.anchorPoint.x-this.m_body2.m_position.x);d=(c.anchorPoint.y-this.m_body2.m_position.y);this.m_localAnchor2.Set((a*b.col1.x+d*b.col1.y),(a*b.col2.x+d*b.col2.y));b=this.m_body1.m_R;a=c.axis.x;d=c.axis.y;this.m_localXAxis1.Set((a*b.col1.x+d*b.col1.y),(a*b.col2.x+d*b.col2.y));this.m_localYAxis1.x=-this.m_localXAxis1.y; -this.m_localYAxis1.y=this.m_localXAxis1.x;this.m_initialAngle=this.m_body2.m_rotation-this.m_body1.m_rotation;this.m_linearJacobian.SetZero();this.m_linearMass=0;this.m_linearImpulse=0;this.m_angularMass=0;this.m_angularImpulse=0;this.m_motorJacobian.SetZero();this.m_motorMass=0;this.m_motorImpulse=0;this.m_limitImpulse=0;this.m_limitPositionImpulse=0;this.m_lowerTranslation=c.lowerTranslation;this.m_upperTranslation=c.upperTranslation;this.m_maxMotorForce=c.motorForce;this.m_motorSpeed=c.motorSpeed;this.m_enableLimit=c.enableLimit;this.m_enableMotor=c.enableMotor};Object.extend(b2PrismaticJoint.prototype,b2Joint.prototype);Object.extend(b2PrismaticJoint.prototype,{GetAnchor1:function(){var a=this.m_body1;var b=new b2Vec2();b.SetV(this.m_localAnchor1);b.MulM(a.m_R);b.Add(a.m_position);return b},GetAnchor2:function(){var a=this.m_body2;var b=new b2Vec2();b.SetV(this.m_localAnchor2);b.MulM(a.m_R);b.Add(a.m_position);return b},GetJointTranslation:function(){var l=this.m_body1;var k=this.m_body2; -var j;j=l.m_R;var p=j.col1.x*this.m_localAnchor1.x+j.col2.x*this.m_localAnchor1.y;var n=j.col1.y*this.m_localAnchor1.x+j.col2.y*this.m_localAnchor1.y;j=k.m_R;var i=j.col1.x*this.m_localAnchor2.x+j.col2.x*this.m_localAnchor2.y;var h=j.col1.y*this.m_localAnchor2.x+j.col2.y*this.m_localAnchor2.y;var g=l.m_position.x+p;var f=l.m_position.y+n;var c=k.m_position.x+i;var b=k.m_position.y+h;var e=c-g;var d=b-f;j=l.m_R;var o=j.col1.x*this.m_localXAxis1.x+j.col2.x*this.m_localXAxis1.y;var m=j.col1.y*this.m_localXAxis1.x+j.col2.y*this.m_localXAxis1.y;var a=o*e+m*d;return a},GetJointSpeed:function(){var j=this.m_body1;var i=this.m_body2;var k;k=j.m_R;var t=k.col1.x*this.m_localAnchor1.x+k.col2.x*this.m_localAnchor1.y;var s=k.col1.y*this.m_localAnchor1.x+k.col2.y*this.m_localAnchor1.y;k=i.m_R;var h=k.col1.x*this.m_localAnchor2.x+k.col2.x*this.m_localAnchor2.y;var g=k.col1.y*this.m_localAnchor2.x+k.col2.y*this.m_localAnchor2.y;var r=j.m_position.x+t;var p=j.m_position.y+s;var c=i.m_position.x+h;var a=i.m_position.y+g; -var f=c-r;var e=a-p;k=j.m_R;var o=k.col1.x*this.m_localXAxis1.x+k.col2.x*this.m_localXAxis1.y;var n=k.col1.y*this.m_localXAxis1.x+k.col2.y*this.m_localXAxis1.y;var d=j.m_linearVelocity;var b=i.m_linearVelocity;var m=j.m_angularVelocity;var l=i.m_angularVelocity;var q=(f*(-m*n)+e*(m*o))+(o*(((b.x+(-l*g))-d.x)-(-m*s))+n*(((b.y+(l*h))-d.y)-(m*t)));return q},GetMotorForce:function(a){return a*this.m_motorImpulse},SetMotorSpeed:function(a){this.m_motorSpeed=a},SetMotorForce:function(a){this.m_maxMotorForce=a},GetReactionForce:function(b){var e=b*this.m_limitImpulse;var d;d=this.m_body1.m_R;var g=e*(d.col1.x*this.m_localXAxis1.x+d.col2.x*this.m_localXAxis1.y);var f=e*(d.col1.y*this.m_localXAxis1.x+d.col2.y*this.m_localXAxis1.y);var c=e*(d.col1.x*this.m_localYAxis1.x+d.col2.x*this.m_localYAxis1.y);var a=e*(d.col1.y*this.m_localYAxis1.x+d.col2.y*this.m_localYAxis1.y);return new b2Vec2(g+c,f+a)},GetReactionTorque:function(a){return a*this.m_angularImpulse},PrepareVelocitySolver:function(){var m=this.m_body1; -var l=this.m_body2;var p;p=m.m_R;var z=p.col1.x*this.m_localAnchor1.x+p.col2.x*this.m_localAnchor1.y;var y=p.col1.y*this.m_localAnchor1.x+p.col2.y*this.m_localAnchor1.y;p=l.m_R;var i=p.col1.x*this.m_localAnchor2.x+p.col2.x*this.m_localAnchor2.y;var g=p.col1.y*this.m_localAnchor2.x+p.col2.y*this.m_localAnchor2.y;var s=m.m_invMass;var r=l.m_invMass;var k=m.m_invI;var j=l.m_invI;p=m.m_R;var h=p.col1.x*this.m_localYAxis1.x+p.col2.x*this.m_localYAxis1.y;var f=p.col1.y*this.m_localYAxis1.x+p.col2.y*this.m_localYAxis1.y;var t=l.m_position.x+i-m.m_position.x;var q=l.m_position.y+g-m.m_position.y;this.m_linearJacobian.linear1.x=-h;this.m_linearJacobian.linear1.y=-f;this.m_linearJacobian.linear2.x=h;this.m_linearJacobian.linear2.y=f;this.m_linearJacobian.angular1=-(t*f-q*h);this.m_linearJacobian.angular2=i*f-g*h;this.m_linearMass=s+k*this.m_linearJacobian.angular1*this.m_linearJacobian.angular1+r+j*this.m_linearJacobian.angular2*this.m_linearJacobian.angular2;this.m_linearMass=1/this.m_linearMass; -this.m_angularMass=1/(k+j);if(this.m_enableLimit||this.m_enableMotor){p=m.m_R;var v=p.col1.x*this.m_localXAxis1.x+p.col2.x*this.m_localXAxis1.y;var u=p.col1.y*this.m_localXAxis1.x+p.col2.y*this.m_localXAxis1.y;this.m_motorJacobian.linear1.x=-v;this.m_motorJacobian.linear1.y=-u;this.m_motorJacobian.linear2.x=v;this.m_motorJacobian.linear2.y=u;this.m_motorJacobian.angular1=-(t*u-q*v);this.m_motorJacobian.angular2=i*u-g*v;this.m_motorMass=s+k*this.m_motorJacobian.angular1*this.m_motorJacobian.angular1+r+j*this.m_motorJacobian.angular2*this.m_motorJacobian.angular2;this.m_motorMass=1/this.m_motorMass;if(this.m_enableLimit){var e=t-z;var d=q-y;var c=v*e+u*d;if(b2Math.b2Abs(this.m_upperTranslation-this.m_lowerTranslation)<2*b2Settings.b2_linearSlop){this.m_limitState=b2Joint.e_equalLimits}else{if(c<=this.m_lowerTranslation){if(this.m_limitState!=b2Joint.e_atLowerLimit){this.m_limitImpulse=0}this.m_limitState=b2Joint.e_atLowerLimit}else{if(c>=this.m_upperTranslation){if(this.m_limitState!=b2Joint.e_atUpperLimit){this.m_limitImpulse=0 -}this.m_limitState=b2Joint.e_atUpperLimit}else{this.m_limitState=b2Joint.e_inactiveLimit;this.m_limitImpulse=0}}}}}if(this.m_enableMotor==false){this.m_motorImpulse=0}if(this.m_enableLimit==false){this.m_limitImpulse=0}if(b2World.s_enableWarmStarting){var b=this.m_linearImpulse*this.m_linearJacobian.linear1.x+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear1.x;var a=this.m_linearImpulse*this.m_linearJacobian.linear1.y+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear1.y;var o=this.m_linearImpulse*this.m_linearJacobian.linear2.x+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear2.x;var n=this.m_linearImpulse*this.m_linearJacobian.linear2.y+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear2.y;var x=this.m_linearImpulse*this.m_linearJacobian.angular1-this.m_angularImpulse+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.angular1;var w=this.m_linearImpulse*this.m_linearJacobian.angular2+this.m_angularImpulse+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.angular2; -m.m_linearVelocity.x+=s*b;m.m_linearVelocity.y+=s*a;m.m_angularVelocity+=k*x;l.m_linearVelocity.x+=r*o;l.m_linearVelocity.y+=r*n;l.m_angularVelocity+=j*w}else{this.m_linearImpulse=0;this.m_angularImpulse=0;this.m_limitImpulse=0;this.m_motorImpulse=0}this.m_limitPositionImpulse=0},SolveVelocityConstraints:function(b){var l=this.m_body1;var k=this.m_body2;var q=l.m_invMass;var o=k.m_invMass;var d=l.m_invI;var c=k.m_invI;var p;var e=this.m_linearJacobian.Compute(l.m_linearVelocity,l.m_angularVelocity,k.m_linearVelocity,k.m_angularVelocity);var j=-this.m_linearMass*e;this.m_linearImpulse+=j;l.m_linearVelocity.x+=(q*j)*this.m_linearJacobian.linear1.x;l.m_linearVelocity.y+=(q*j)*this.m_linearJacobian.linear1.y;l.m_angularVelocity+=d*j*this.m_linearJacobian.angular1;k.m_linearVelocity.x+=(o*j)*this.m_linearJacobian.linear2.x;k.m_linearVelocity.y+=(o*j)*this.m_linearJacobian.linear2.y;k.m_angularVelocity+=c*j*this.m_linearJacobian.angular2;var h=k.m_angularVelocity-l.m_angularVelocity;var a=-this.m_angularMass*h; -this.m_angularImpulse+=a;l.m_angularVelocity-=d*a;k.m_angularVelocity+=c*a;if(this.m_enableMotor&&this.m_limitState!=b2Joint.e_equalLimits){var m=this.m_motorJacobian.Compute(l.m_linearVelocity,l.m_angularVelocity,k.m_linearVelocity,k.m_angularVelocity)-this.m_motorSpeed;var f=-this.m_motorMass*m;var n=this.m_motorImpulse;this.m_motorImpulse=b2Math.b2Clamp(this.m_motorImpulse+f,-b.dt*this.m_maxMotorForce,b.dt*this.m_maxMotorForce);f=this.m_motorImpulse-n;l.m_linearVelocity.x+=(q*f)*this.m_motorJacobian.linear1.x;l.m_linearVelocity.y+=(q*f)*this.m_motorJacobian.linear1.y;l.m_angularVelocity+=d*f*this.m_motorJacobian.angular1;k.m_linearVelocity.x+=(o*f)*this.m_motorJacobian.linear2.x;k.m_linearVelocity.y+=(o*f)*this.m_motorJacobian.linear2.y;k.m_angularVelocity+=c*f*this.m_motorJacobian.angular2}if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit){var i=this.m_motorJacobian.Compute(l.m_linearVelocity,l.m_angularVelocity,k.m_linearVelocity,k.m_angularVelocity);var g=-this.m_motorMass*i; -if(this.m_limitState==b2Joint.e_equalLimits){this.m_limitImpulse+=g}else{if(this.m_limitState==b2Joint.e_atLowerLimit){p=this.m_limitImpulse;this.m_limitImpulse=b2Math.b2Max(this.m_limitImpulse+g,0);g=this.m_limitImpulse-p}else{if(this.m_limitState==b2Joint.e_atUpperLimit){p=this.m_limitImpulse;this.m_limitImpulse=b2Math.b2Min(this.m_limitImpulse+g,0);g=this.m_limitImpulse-p}}}l.m_linearVelocity.x+=(q*g)*this.m_motorJacobian.linear1.x;l.m_linearVelocity.y+=(q*g)*this.m_motorJacobian.linear1.y;l.m_angularVelocity+=d*g*this.m_motorJacobian.angular1;k.m_linearVelocity.x+=(o*g)*this.m_motorJacobian.linear2.x;k.m_linearVelocity.y+=(o*g)*this.m_motorJacobian.linear2.y;k.m_angularVelocity+=c*g*this.m_motorJacobian.angular2}},SolvePositionConstraints:function(){var o;var y;var m=this.m_body1;var k=this.m_body2;var t=m.m_invMass;var s=k.m_invMass;var j=m.m_invI;var i=k.m_invI;var q;q=m.m_R;var E=q.col1.x*this.m_localAnchor1.x+q.col2.x*this.m_localAnchor1.y;var D=q.col1.y*this.m_localAnchor1.x+q.col2.y*this.m_localAnchor1.y; -q=k.m_R;var h=q.col1.x*this.m_localAnchor2.x+q.col2.x*this.m_localAnchor2.y;var g=q.col1.y*this.m_localAnchor2.x+q.col2.y*this.m_localAnchor2.y;var B=m.m_position.x+E;var z=m.m_position.y+D;var b=k.m_position.x+h;var a=k.m_position.y+g;var e=b-B;var c=a-z;q=m.m_R;var f=q.col1.x*this.m_localYAxis1.x+q.col2.x*this.m_localYAxis1.y;var d=q.col1.y*this.m_localYAxis1.x+q.col2.y*this.m_localYAxis1.y;var l=f*e+d*c;l=b2Math.b2Clamp(l,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);var x=-this.m_linearMass*l;m.m_position.x+=(t*x)*this.m_linearJacobian.linear1.x;m.m_position.y+=(t*x)*this.m_linearJacobian.linear1.y;m.m_rotation+=j*x*this.m_linearJacobian.angular1;k.m_position.x+=(s*x)*this.m_linearJacobian.linear2.x;k.m_position.y+=(s*x)*this.m_linearJacobian.linear2.y;k.m_rotation+=i*x*this.m_linearJacobian.angular2;var p=b2Math.b2Abs(l);var A=k.m_rotation-m.m_rotation-this.m_initialAngle;A=b2Math.b2Clamp(A,-b2Settings.b2_maxAngularCorrection,b2Settings.b2_maxAngularCorrection); -var r=-this.m_angularMass*A;m.m_rotation-=m.m_invI*r;m.m_R.Set(m.m_rotation);k.m_rotation+=k.m_invI*r;k.m_R.Set(k.m_rotation);var C=b2Math.b2Abs(A);if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit){q=m.m_R;E=q.col1.x*this.m_localAnchor1.x+q.col2.x*this.m_localAnchor1.y;D=q.col1.y*this.m_localAnchor1.x+q.col2.y*this.m_localAnchor1.y;q=k.m_R;h=q.col1.x*this.m_localAnchor2.x+q.col2.x*this.m_localAnchor2.y;g=q.col1.y*this.m_localAnchor2.x+q.col2.y*this.m_localAnchor2.y;B=m.m_position.x+E;z=m.m_position.y+D;b=k.m_position.x+h;a=k.m_position.y+g;e=b-B;c=a-z;q=m.m_R;var v=q.col1.x*this.m_localXAxis1.x+q.col2.x*this.m_localXAxis1.y;var u=q.col1.y*this.m_localXAxis1.x+q.col2.y*this.m_localXAxis1.y;var n=(v*e+u*c);var w=0;if(this.m_limitState==b2Joint.e_equalLimits){o=b2Math.b2Clamp(n,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);w=-this.m_motorMass*o;p=b2Math.b2Max(p,b2Math.b2Abs(A))}else{if(this.m_limitState==b2Joint.e_atLowerLimit){o=n-this.m_lowerTranslation; -p=b2Math.b2Max(p,-o);o=b2Math.b2Clamp(o+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0);w=-this.m_motorMass*o;y=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Max(this.m_limitPositionImpulse+w,0);w=this.m_limitPositionImpulse-y}else{if(this.m_limitState==b2Joint.e_atUpperLimit){o=n-this.m_upperTranslation;p=b2Math.b2Max(p,o);o=b2Math.b2Clamp(o-b2Settings.b2_linearSlop,0,b2Settings.b2_maxLinearCorrection);w=-this.m_motorMass*o;y=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Min(this.m_limitPositionImpulse+w,0);w=this.m_limitPositionImpulse-y}}}m.m_position.x+=(t*w)*this.m_motorJacobian.linear1.x;m.m_position.y+=(t*w)*this.m_motorJacobian.linear1.y;m.m_rotation+=j*w*this.m_motorJacobian.angular1;m.m_R.Set(m.m_rotation);k.m_position.x+=(s*w)*this.m_motorJacobian.linear2.x;k.m_position.y+=(s*w)*this.m_motorJacobian.linear2.y;k.m_rotation+=i*w*this.m_motorJacobian.angular2;k.m_R.Set(k.m_rotation)}return p<=b2Settings.b2_linearSlop&&C<=b2Settings.b2_angularSlop -},m_localAnchor1:new b2Vec2(),m_localAnchor2:new b2Vec2(),m_localXAxis1:new b2Vec2(),m_localYAxis1:new b2Vec2(),m_initialAngle:null,m_linearJacobian:new b2Jacobian(),m_linearMass:null,m_linearImpulse:null,m_angularMass:null,m_angularImpulse:null,m_motorJacobian:new b2Jacobian(),m_motorMass:null,m_motorImpulse:null,m_limitImpulse:null,m_limitPositionImpulse:null,m_lowerTranslation:null,m_upperTranslation:null,m_maxMotorForce:null,m_motorSpeed:null,m_enableLimit:null,m_enableMotor:null,m_limitState:0});var b2PrismaticJointDef=function(){this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.type=b2Joint.e_prismaticJoint;this.anchorPoint=new b2Vec2(0,0);this.axis=new b2Vec2(0,0);this.lowerTranslation=0;this.upperTranslation=0;this.motorForce=0;this.motorSpeed=0;this.enableLimit=false;this.enableMotor=false};Object.extend(b2PrismaticJointDef.prototype,b2JointDef.prototype);Object.extend(b2PrismaticJointDef.prototype,{anchorPoint:null,axis:null,lowerTranslation:null,upperTranslation:null,motorForce:null,motorSpeed:null,enableLimit:null,enableMotor:null,Initialize:function(b,a,d,c){this.body1=b;this.body2=a;this.anchorPoint=d;this.axis=c}});var b2PulleyJoint=function(d){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=d.type;this.m_prev=null;this.m_next=null;this.m_body1=d.body1;this.m_body2=d.body2;this.m_collideConnected=d.collideConnected;this.m_islandFlag=false;this.m_userData=d.userData;this.m_groundAnchor1=new b2Vec2();this.m_groundAnchor2=new b2Vec2();this.m_localAnchor1=new b2Vec2();this.m_localAnchor2=new b2Vec2();this.m_u1=new b2Vec2();this.m_u2=new b2Vec2();var b;var a;var h;this.m_ground=this.m_body1.m_world.m_groundBody;this.m_groundAnchor1.x=d.groundPoint1.x-this.m_ground.m_position.x;this.m_groundAnchor1.y=d.groundPoint1.y-this.m_ground.m_position.y;this.m_groundAnchor2.x=d.groundPoint2.x-this.m_ground.m_position.x;this.m_groundAnchor2.y=d.groundPoint2.y-this.m_ground.m_position.y;b=this.m_body1.m_R;a=d.anchorPoint1.x-this.m_body1.m_position.x;h=d.anchorPoint1.y-this.m_body1.m_position.y;this.m_localAnchor1.x=a*b.col1.x+h*b.col1.y;this.m_localAnchor1.y=a*b.col2.x+h*b.col2.y;b=this.m_body2.m_R; -a=d.anchorPoint2.x-this.m_body2.m_position.x;h=d.anchorPoint2.y-this.m_body2.m_position.y;this.m_localAnchor2.x=a*b.col1.x+h*b.col1.y;this.m_localAnchor2.y=a*b.col2.x+h*b.col2.y;this.m_ratio=d.ratio;a=d.groundPoint1.x-d.anchorPoint1.x;h=d.groundPoint1.y-d.anchorPoint1.y;var f=Math.sqrt(a*a+h*h);a=d.groundPoint2.x-d.anchorPoint2.x;h=d.groundPoint2.y-d.anchorPoint2.y;var c=Math.sqrt(a*a+h*h);var g=b2Math.b2Max(0.5*b2PulleyJoint.b2_minPulleyLength,f);var e=b2Math.b2Max(0.5*b2PulleyJoint.b2_minPulleyLength,c);this.m_constant=g+this.m_ratio*e;this.m_maxLength1=b2Math.b2Clamp(d.maxLength1,g,this.m_constant-this.m_ratio*b2PulleyJoint.b2_minPulleyLength);this.m_maxLength2=b2Math.b2Clamp(d.maxLength2,e,(this.m_constant-b2PulleyJoint.b2_minPulleyLength)/this.m_ratio);this.m_pulleyImpulse=0;this.m_limitImpulse1=0;this.m_limitImpulse2=0};Object.extend(b2PulleyJoint.prototype,b2Joint.prototype);Object.extend(b2PulleyJoint.prototype,{GetAnchor1:function(){var a=this.m_body1.m_R;return new b2Vec2(this.m_body1.m_position.x+(a.col1.x*this.m_localAnchor1.x+a.col2.x*this.m_localAnchor1.y),this.m_body1.m_position.y+(a.col1.y*this.m_localAnchor1.x+a.col2.y*this.m_localAnchor1.y)) -},GetAnchor2:function(){var a=this.m_body2.m_R;return new b2Vec2(this.m_body2.m_position.x+(a.col1.x*this.m_localAnchor2.x+a.col2.x*this.m_localAnchor2.y),this.m_body2.m_position.y+(a.col1.y*this.m_localAnchor2.x+a.col2.y*this.m_localAnchor2.y))},GetGroundPoint1:function(){return new b2Vec2(this.m_ground.m_position.x+this.m_groundAnchor1.x,this.m_ground.m_position.y+this.m_groundAnchor1.y)},GetGroundPoint2:function(){return new b2Vec2(this.m_ground.m_position.x+this.m_groundAnchor2.x,this.m_ground.m_position.y+this.m_groundAnchor2.y)},GetReactionForce:function(a){return new b2Vec2()},GetReactionTorque:function(a){return 0},GetLength1:function(){var e;e=this.m_body1.m_R;var d=this.m_body1.m_position.x+(e.col1.x*this.m_localAnchor1.x+e.col2.x*this.m_localAnchor1.y);var c=this.m_body1.m_position.y+(e.col1.y*this.m_localAnchor1.x+e.col2.y*this.m_localAnchor1.y);var b=d-(this.m_ground.m_position.x+this.m_groundAnchor1.x);var a=c-(this.m_ground.m_position.y+this.m_groundAnchor1.y);return Math.sqrt(b*b+a*a) -},GetLength2:function(){var e;e=this.m_body2.m_R;var d=this.m_body2.m_position.x+(e.col1.x*this.m_localAnchor2.x+e.col2.x*this.m_localAnchor2.y);var c=this.m_body2.m_position.y+(e.col1.y*this.m_localAnchor2.x+e.col2.y*this.m_localAnchor2.y);var b=d-(this.m_ground.m_position.x+this.m_groundAnchor2.x);var a=c-(this.m_ground.m_position.y+this.m_groundAnchor2.y);return Math.sqrt(b*b+a*a)},GetRatio:function(){return this.m_ratio},PrepareVelocitySolver:function(){var h=this.m_body1;var g=this.m_body2;var l;l=h.m_R;var v=l.col1.x*this.m_localAnchor1.x+l.col2.x*this.m_localAnchor1.y;var u=l.col1.y*this.m_localAnchor1.x+l.col2.y*this.m_localAnchor1.y;l=g.m_R;var f=l.col1.x*this.m_localAnchor2.x+l.col2.x*this.m_localAnchor2.y;var e=l.col1.y*this.m_localAnchor2.x+l.col2.y*this.m_localAnchor2.y;var t=h.m_position.x+v;var r=h.m_position.y+u;var d=g.m_position.x+f;var c=g.m_position.y+e;var m=this.m_ground.m_position.x+this.m_groundAnchor1.x;var k=this.m_ground.m_position.y+this.m_groundAnchor1.y;var s=this.m_ground.m_position.x+this.m_groundAnchor2.x; -var q=this.m_ground.m_position.y+this.m_groundAnchor2.y;this.m_u1.Set(t-m,r-k);this.m_u2.Set(d-s,c-q);var p=this.m_u1.Length();var o=this.m_u2.Length();if(p>b2Settings.b2_linearSlop){this.m_u1.Multiply(1/p)}else{this.m_u1.SetZero()}if(o>b2Settings.b2_linearSlop){this.m_u2.Multiply(1/o)}else{this.m_u2.SetZero()}if(pb2Settings.b2_linearSlop){this.m_u1.Multiply(1/n)}else{this.m_u1.SetZero()}if(m>b2Settings.b2_linearSlop){this.m_u2.Multiply(1/m)}else{this.m_u2.SetZero()}l=this.m_constant-n-this.m_ratio*m;e=b2Math.b2Max(e,Math.abs(l));l=b2Math.b2Clamp(l,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);h=-this.m_pulleyMass*l;r=-h*this.m_u1.x;p=-h*this.m_u1.y;b=-this.m_ratio*h*this.m_u2.x;a=-this.m_ratio*h*this.m_u2.y;g.m_position.x+=g.m_invMass*r;g.m_position.y+=g.m_invMass*p;g.m_rotation+=g.m_invI*(u*p-t*r);f.m_position.x+=f.m_invMass*b;f.m_position.y+=f.m_invMass*a;f.m_rotation+=f.m_invI*(d*a-c*b);g.m_R.Set(g.m_rotation);f.m_R.Set(f.m_rotation);if(this.m_limitState1==b2Joint.e_atUpperLimit){j=g.m_R;u=j.col1.x*this.m_localAnchor1.x+j.col2.x*this.m_localAnchor1.y;t=j.col1.y*this.m_localAnchor1.x+j.col2.y*this.m_localAnchor1.y; -r=g.m_position.x+u;p=g.m_position.y+t;this.m_u1.Set(r-k,p-i);n=this.m_u1.Length();if(n>b2Settings.b2_linearSlop){this.m_u1.x*=1/n;this.m_u1.y*=1/n}else{this.m_u1.SetZero()}l=this.m_maxLength1-n;e=b2Math.b2Max(e,-l);l=b2Math.b2Clamp(l+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0);h=-this.m_limitMass1*l;s=this.m_limitPositionImpulse1;this.m_limitPositionImpulse1=b2Math.b2Max(0,this.m_limitPositionImpulse1+h);h=this.m_limitPositionImpulse1-s;r=-h*this.m_u1.x;p=-h*this.m_u1.y;g.m_position.x+=g.m_invMass*r;g.m_position.y+=g.m_invMass*p;g.m_rotation+=g.m_invI*(u*p-t*r);g.m_R.Set(g.m_rotation)}if(this.m_limitState2==b2Joint.e_atUpperLimit){j=f.m_R;d=j.col1.x*this.m_localAnchor2.x+j.col2.x*this.m_localAnchor2.y;c=j.col1.y*this.m_localAnchor2.x+j.col2.y*this.m_localAnchor2.y;b=f.m_position.x+d;a=f.m_position.y+c;this.m_u2.Set(b-q,a-o);m=this.m_u2.Length();if(m>b2Settings.b2_linearSlop){this.m_u2.x*=1/m;this.m_u2.y*=1/m}else{this.m_u2.SetZero()}l=this.m_maxLength2-m;e=b2Math.b2Max(e,-l); -l=b2Math.b2Clamp(l+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0);h=-this.m_limitMass2*l;s=this.m_limitPositionImpulse2;this.m_limitPositionImpulse2=b2Math.b2Max(0,this.m_limitPositionImpulse2+h);h=this.m_limitPositionImpulse2-s;b=-h*this.m_u2.x;a=-h*this.m_u2.y;f.m_position.x+=f.m_invMass*b;f.m_position.y+=f.m_invMass*a;f.m_rotation+=f.m_invI*(d*a-c*b);f.m_R.Set(f.m_rotation)}return e=this.m_upperAngle){if(this.m_limitState!=b2Joint.e_atUpperLimit){this.m_limitImpulse=0}this.m_limitState=b2Joint.e_atUpperLimit}else{this.m_limitState=b2Joint.e_inactiveLimit;this.m_limitImpulse=0}}}}else{this.m_limitImpulse=0}if(b2World.s_enableWarmStarting){h.m_linearVelocity.x-=l*this.m_ptpImpulse.x;h.m_linearVelocity.y-=l*this.m_ptpImpulse.y;h.m_angularVelocity-=c*((k*this.m_ptpImpulse.y-i*this.m_ptpImpulse.x)+this.m_motorImpulse+this.m_limitImpulse); -g.m_linearVelocity.x+=j*this.m_ptpImpulse.x;g.m_linearVelocity.y+=j*this.m_ptpImpulse.y;g.m_angularVelocity+=b*((e*this.m_ptpImpulse.y-d*this.m_ptpImpulse.x)+this.m_motorImpulse+this.m_limitImpulse)}else{this.m_ptpImpulse.SetZero();this.m_motorImpulse=0;this.m_limitImpulse=0}this.m_limitPositionImpulse=0},SolveVelocityConstraints:function(f){var g=this.m_body1;var e=this.m_body2;var i;i=g.m_R;var o=i.col1.x*this.m_localAnchor1.x+i.col2.x*this.m_localAnchor1.y;var n=i.col1.y*this.m_localAnchor1.x+i.col2.y*this.m_localAnchor1.y;i=e.m_R;var b=i.col1.x*this.m_localAnchor2.x+i.col2.x*this.m_localAnchor2.y;var a=i.col1.y*this.m_localAnchor2.x+i.col2.y*this.m_localAnchor2.y;var k;var q=e.m_linearVelocity.x+(-e.m_angularVelocity*a)-g.m_linearVelocity.x-(-g.m_angularVelocity*n);var p=e.m_linearVelocity.y+(e.m_angularVelocity*b)-g.m_linearVelocity.y-(g.m_angularVelocity*o);var m=-(this.m_ptpMass.col1.x*q+this.m_ptpMass.col2.x*p);var l=-(this.m_ptpMass.col1.y*q+this.m_ptpMass.col2.y*p);this.m_ptpImpulse.x+=m; -this.m_ptpImpulse.y+=l;g.m_linearVelocity.x-=g.m_invMass*m;g.m_linearVelocity.y-=g.m_invMass*l;g.m_angularVelocity-=g.m_invI*(o*l-n*m);e.m_linearVelocity.x+=e.m_invMass*m;e.m_linearVelocity.y+=e.m_invMass*l;e.m_angularVelocity+=e.m_invI*(b*l-a*m);if(this.m_enableMotor&&this.m_limitState!=b2Joint.e_equalLimits){var r=e.m_angularVelocity-g.m_angularVelocity-this.m_motorSpeed;var c=-this.m_motorMass*r;var d=this.m_motorImpulse;this.m_motorImpulse=b2Math.b2Clamp(this.m_motorImpulse+c,-f.dt*this.m_maxMotorTorque,f.dt*this.m_maxMotorTorque);c=this.m_motorImpulse-d;g.m_angularVelocity-=g.m_invI*c;e.m_angularVelocity+=e.m_invI*c}if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit){var h=e.m_angularVelocity-g.m_angularVelocity;var j=-this.m_motorMass*h;if(this.m_limitState==b2Joint.e_equalLimits){this.m_limitImpulse+=j}else{if(this.m_limitState==b2Joint.e_atLowerLimit){k=this.m_limitImpulse;this.m_limitImpulse=b2Math.b2Max(this.m_limitImpulse+j,0);j=this.m_limitImpulse-k}else{if(this.m_limitState==b2Joint.e_atUpperLimit){k=this.m_limitImpulse; -this.m_limitImpulse=b2Math.b2Min(this.m_limitImpulse+j,0);j=this.m_limitImpulse-k}}}g.m_angularVelocity-=g.m_invI*j;e.m_angularVelocity+=e.m_invI*j}},SolvePositionConstraints:function(){var s;var m;var l=this.m_body1;var k=this.m_body2;var o=0;var n;n=l.m_R;var y=n.col1.x*this.m_localAnchor1.x+n.col2.x*this.m_localAnchor1.y;var x=n.col1.y*this.m_localAnchor1.x+n.col2.y*this.m_localAnchor1.y;n=k.m_R;var f=n.col1.x*this.m_localAnchor2.x+n.col2.x*this.m_localAnchor2.y;var e=n.col1.y*this.m_localAnchor2.x+n.col2.y*this.m_localAnchor2.y;var u=l.m_position.x+y;var t=l.m_position.y+x;var d=k.m_position.x+f;var c=k.m_position.y+e;var j=d-u;var i=c-t;o=Math.sqrt(j*j+i*i);var q=l.m_invMass;var p=k.m_invMass;var h=l.m_invI;var g=k.m_invI;this.K1.col1.x=q+p;this.K1.col2.x=0;this.K1.col1.y=0;this.K1.col2.y=q+p;this.K2.col1.x=h*x*x;this.K2.col2.x=-h*y*x;this.K2.col1.y=-h*y*x;this.K2.col2.y=h*y*y;this.K3.col1.x=g*e*e;this.K3.col2.x=-g*f*e;this.K3.col1.y=-g*f*e;this.K3.col2.y=g*f*f;this.K.SetM(this.K1); -this.K.AddM(this.K2);this.K.AddM(this.K3);this.K.Solve(b2RevoluteJoint.tImpulse,-j,-i);var b=b2RevoluteJoint.tImpulse.x;var a=b2RevoluteJoint.tImpulse.y;l.m_position.x-=l.m_invMass*b;l.m_position.y-=l.m_invMass*a;l.m_rotation-=l.m_invI*(y*a-x*b);l.m_R.Set(l.m_rotation);k.m_position.x+=k.m_invMass*b;k.m_position.y+=k.m_invMass*a;k.m_rotation+=k.m_invI*(f*a-e*b);k.m_R.Set(k.m_rotation);var w=0;if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit){var v=k.m_rotation-l.m_rotation-this.m_intialAngle;var r=0;if(this.m_limitState==b2Joint.e_equalLimits){m=b2Math.b2Clamp(v,-b2Settings.b2_maxAngularCorrection,b2Settings.b2_maxAngularCorrection);r=-this.m_motorMass*m;w=b2Math.b2Abs(m)}else{if(this.m_limitState==b2Joint.e_atLowerLimit){m=v-this.m_lowerAngle;w=b2Math.b2Max(0,-m);m=b2Math.b2Clamp(m+b2Settings.b2_angularSlop,-b2Settings.b2_maxAngularCorrection,0);r=-this.m_motorMass*m;s=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Max(this.m_limitPositionImpulse+r,0); -r=this.m_limitPositionImpulse-s}else{if(this.m_limitState==b2Joint.e_atUpperLimit){m=v-this.m_upperAngle;w=b2Math.b2Max(0,m);m=b2Math.b2Clamp(m-b2Settings.b2_angularSlop,0,b2Settings.b2_maxAngularCorrection);r=-this.m_motorMass*m;s=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Min(this.m_limitPositionImpulse+r,0);r=this.m_limitPositionImpulse-s}}}l.m_rotation-=l.m_invI*r;l.m_R.Set(l.m_rotation);k.m_rotation+=k.m_invI*r;k.m_R.Set(k.m_rotation)}return o<=b2Settings.b2_linearSlop&&w<=b2Settings.b2_angularSlop},m_localAnchor1:new b2Vec2(),m_localAnchor2:new b2Vec2(),m_ptpImpulse:new b2Vec2(),m_motorImpulse:null,m_limitImpulse:null,m_limitPositionImpulse:null,m_ptpMass:new b2Mat22(),m_motorMass:null,m_intialAngle:null,m_lowerAngle:null,m_upperAngle:null,m_maxMotorTorque:null,m_motorSpeed:null,m_enableLimit:null,m_enableMotor:null,m_limitState:0});b2RevoluteJoint.tImpulse=new b2Vec2();var b2RevoluteJointDef=function(){this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.type=b2Joint.e_revoluteJoint;this.anchorPoint=new b2Vec2(0,0);this.lowerAngle=0;this.upperAngle=0;this.motorTorque=0;this.motorSpeed=0;this.enableLimit=false;this.enableMotor=false};Object.extend(b2RevoluteJointDef.prototype,b2JointDef.prototype);Object.extend(b2RevoluteJointDef.prototype,{anchorPoint:null,lowerAngle:null,upperAngle:null,motorTorque:null,motorSpeed:null,enableLimit:null,enableMotor:null,Initialize:function(b,a,c){this.body1=b;this.body2=a;this.anchorPoint=c}}); \ No newline at end of file diff --git a/tutorial-3/pixi.js-master/examples/example 24 - Box2D Integration/bricks.png b/tutorial-3/pixi.js-master/examples/example 24 - Box2D Integration/bricks.png deleted file mode 100755 index 4495016..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 24 - Box2D Integration/bricks.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 24 - Box2D Integration/bunny.png b/tutorial-3/pixi.js-master/examples/example 24 - Box2D Integration/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 24 - Box2D Integration/bunny.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 24 - Box2D Integration/grass.png b/tutorial-3/pixi.js-master/examples/example 24 - Box2D Integration/grass.png deleted file mode 100755 index a9dd3a9..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 24 - Box2D Integration/grass.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 24 - Box2D Integration/index.html b/tutorial-3/pixi.js-master/examples/example 24 - Box2D Integration/index.html deleted file mode 100755 index 1cdfabf..0000000 --- a/tutorial-3/pixi.js-master/examples/example 24 - Box2D Integration/index.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - pixi.js example 24 - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 25 - Video/bunny.png b/tutorial-3/pixi.js-master/examples/example 25 - Video/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 25 - Video/bunny.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 25 - Video/index.html b/tutorial-3/pixi.js-master/examples/example 25 - Video/index.html deleted file mode 100755 index ac6fd8f..0000000 --- a/tutorial-3/pixi.js-master/examples/example 25 - Video/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - deus - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 25 - Video/testVideo.mp4 b/tutorial-3/pixi.js-master/examples/example 25 - Video/testVideo.mp4 deleted file mode 100755 index aa45029..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 25 - Video/testVideo.mp4 and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.json b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.json deleted file mode 100755 index 3e419a2..0000000 --- a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.json +++ /dev/null @@ -1,228 +0,0 @@ -{"frames": { - -"Explosion_Sequence_A 1.png": -{ - "frame": {"x":244,"y":1454,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 10.png": -{ - "frame": {"x":244,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 11.png": -{ - "frame": {"x":2,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 12.png": -{ - "frame": {"x":728,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 13.png": -{ - "frame": {"x":486,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 14.png": -{ - "frame": {"x":244,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 15.png": -{ - "frame": {"x":2,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 16.png": -{ - "frame": {"x":728,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 17.png": -{ - "frame": {"x":486,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 18.png": -{ - "frame": {"x":244,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 19.png": -{ - "frame": {"x":2,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 2.png": -{ - "frame": {"x":728,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 20.png": -{ - "frame": {"x":728,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 21.png": -{ - "frame": {"x":486,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 22.png": -{ - "frame": {"x":244,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 23.png": -{ - "frame": {"x":2,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 24.png": -{ - "frame": {"x":728,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 25.png": -{ - "frame": {"x":486,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 26.png": -{ - "frame": {"x":244,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 27.png": -{ - "frame": {"x":2,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 3.png": -{ - "frame": {"x":486,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 4.png": -{ - "frame": {"x":244,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 5.png": -{ - "frame": {"x":2,"y":1696,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 6.png": -{ - "frame": {"x":2,"y":1454,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 7.png": -{ - "frame": {"x":2,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 8.png": -{ - "frame": {"x":728,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 9.png": -{ - "frame": {"x":486,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}}, -"meta": { - "app": "http://www.texturepacker.com", - "version": "1.0", - "image": "SpriteSheet.png", - "format": "RGBA8888", - "size": {"w":1024,"h":2048}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:17e4a2d92ff3e27832c3f4938cec7c85$" -} -} diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.png deleted file mode 100755 index 79e1a69..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/index.html b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/index.html deleted file mode 100755 index 7c7c79e..0000000 --- a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/index.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - pixi.js example 3 using a movieclip - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/SpriteSheet.tps b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/SpriteSheet.tps deleted file mode 100755 index ba7d215..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/SpriteSheet.tps and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 1.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 1.png deleted file mode 100755 index 0e3b33a..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 1.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 10.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 10.png deleted file mode 100755 index 42629ac..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 10.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 11.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 11.png deleted file mode 100755 index f286b30..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 11.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 12.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 12.png deleted file mode 100755 index c4b19db..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 12.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 13.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 13.png deleted file mode 100755 index b57ec0c..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 13.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 14.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 14.png deleted file mode 100755 index a4c8458..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 14.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 15.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 15.png deleted file mode 100755 index 4b7e8e6..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 15.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 16.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 16.png deleted file mode 100755 index edbfd79..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 16.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 17.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 17.png deleted file mode 100755 index 2378b55..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 17.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 18.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 18.png deleted file mode 100755 index 61a13d6..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 18.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 19.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 19.png deleted file mode 100755 index a507ce1..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 19.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 2.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 2.png deleted file mode 100755 index 6cfe0d7..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 2.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 20.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 20.png deleted file mode 100755 index f371ecc..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 20.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 21.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 21.png deleted file mode 100755 index 389aa20..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 21.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 22.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 22.png deleted file mode 100755 index 5d324e5..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 22.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 23.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 23.png deleted file mode 100755 index 9e03ef7..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 23.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 24.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 24.png deleted file mode 100755 index 5a7b29e..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 24.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 25.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 25.png deleted file mode 100755 index 32fed5a..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 25.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 26.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 26.png deleted file mode 100755 index aed27f4..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 26.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 27.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 27.png deleted file mode 100755 index 03efab1..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 27.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 3.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 3.png deleted file mode 100755 index 400ef98..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 3.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 4.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 4.png deleted file mode 100755 index 13368c7..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 4.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 5.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 5.png deleted file mode 100755 index 8bbcfcd..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 5.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 6.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 6.png deleted file mode 100755 index b13a53b..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 6.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 7.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 7.png deleted file mode 100755 index 7a97e9c..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 7.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 8.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 8.png deleted file mode 100755 index 2daf240..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 8.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 9.png b/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 9.png deleted file mode 100755 index 72cd176..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 9.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 4 - Balls/assets/bubble_32x32.png b/tutorial-3/pixi.js-master/examples/example 4 - Balls/assets/bubble_32x32.png deleted file mode 100755 index 33b877e..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 4 - Balls/assets/bubble_32x32.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 4 - Balls/assets/bubble_64x64.png b/tutorial-3/pixi.js-master/examples/example 4 - Balls/assets/bubble_64x64.png deleted file mode 100755 index 573822c..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 4 - Balls/assets/bubble_64x64.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 4 - Balls/assets/photonstorm.png b/tutorial-3/pixi.js-master/examples/example 4 - Balls/assets/photonstorm.png deleted file mode 100755 index c24685b..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 4 - Balls/assets/photonstorm.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 4 - Balls/assets/pixi.png b/tutorial-3/pixi.js-master/examples/example 4 - Balls/assets/pixi.png deleted file mode 100755 index 13276bb..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 4 - Balls/assets/pixi.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 4 - Balls/index.html b/tutorial-3/pixi.js-master/examples/example 4 - Balls/index.html deleted file mode 100755 index 8f3b930..0000000 --- a/tutorial-3/pixi.js-master/examples/example 4 - Balls/index.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - Pixi Balls by Photon Storm - - - - - - - - - - -
    SX: 0
    SY: 0
    - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 4 - Balls/storm.css b/tutorial-3/pixi.js-master/examples/example 4 - Balls/storm.css deleted file mode 100755 index 2807f21..0000000 --- a/tutorial-3/pixi.js-master/examples/example 4 - Balls/storm.css +++ /dev/null @@ -1,34 +0,0 @@ -body { - margin: 0; - padding: 0; - background-color: #000000; -} - -#rnd { - position: absolute; - top: 16px; - left: 16px; -} - -#photonstorm { - position: absolute; - bottom: 16px; - right: 16px; -} - -#pixi { - position: absolute; - bottom: 16px; - left: 16px; -} - -#sx { - position: absolute; - top: 16px; - right: 16px; - width: 200px; - height: 48px; - font-size: 12px; - font-family: Arial; - color: rgba(255,255,255,0.8); -} diff --git a/tutorial-3/pixi.js-master/examples/example 5 - Morph/assets/photonstorm.png b/tutorial-3/pixi.js-master/examples/example 5 - Morph/assets/photonstorm.png deleted file mode 100755 index c24685b..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 5 - Morph/assets/photonstorm.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 5 - Morph/assets/pixel.png b/tutorial-3/pixi.js-master/examples/example 5 - Morph/assets/pixel.png deleted file mode 100755 index 5fdbb86..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 5 - Morph/assets/pixel.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 5 - Morph/assets/pixi.png b/tutorial-3/pixi.js-master/examples/example 5 - Morph/assets/pixi.png deleted file mode 100755 index 13276bb..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 5 - Morph/assets/pixi.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 5 - Morph/index.html b/tutorial-3/pixi.js-master/examples/example 5 - Morph/index.html deleted file mode 100755 index 8cf6639..0000000 --- a/tutorial-3/pixi.js-master/examples/example 5 - Morph/index.html +++ /dev/null @@ -1,312 +0,0 @@ - - - - Pixi Morph by Photon Storm - - - - - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 5 - Morph/storm.css b/tutorial-3/pixi.js-master/examples/example 5 - Morph/storm.css deleted file mode 100755 index 625022e..0000000 --- a/tutorial-3/pixi.js-master/examples/example 5 - Morph/storm.css +++ /dev/null @@ -1,17 +0,0 @@ -body { - margin: 0; - padding: 0; - background-color: #000000; -} - -#photonstorm { - position: absolute; - bottom: 16px; - right: 16px; -} - -#pixi { - position: absolute; - bottom: 16px; - left: 16px; -} diff --git a/tutorial-3/pixi.js-master/examples/example 6 - Interactivity/button.png b/tutorial-3/pixi.js-master/examples/example 6 - Interactivity/button.png deleted file mode 100755 index b0cd012..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 6 - Interactivity/button.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 6 - Interactivity/buttonDown.png b/tutorial-3/pixi.js-master/examples/example 6 - Interactivity/buttonDown.png deleted file mode 100755 index 643b757..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 6 - Interactivity/buttonDown.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 6 - Interactivity/buttonOver.png b/tutorial-3/pixi.js-master/examples/example 6 - Interactivity/buttonOver.png deleted file mode 100755 index 8117a2d..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 6 - Interactivity/buttonOver.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 6 - Interactivity/button_test_BG.jpg b/tutorial-3/pixi.js-master/examples/example 6 - Interactivity/button_test_BG.jpg deleted file mode 100755 index 0449cbb..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 6 - Interactivity/button_test_BG.jpg and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 6 - Interactivity/index.html b/tutorial-3/pixi.js-master/examples/example 6 - Interactivity/index.html deleted file mode 100755 index 29bd4cf..0000000 --- a/tutorial-3/pixi.js-master/examples/example 6 - Interactivity/index.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - pixi.js example 6 Interactivity - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 6 - Interactivity/pixi.png b/tutorial-3/pixi.js-master/examples/example 6 - Interactivity/pixi.png deleted file mode 100755 index 13276bb..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 6 - Interactivity/pixi.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 7 - Transparent Background/bunny.png b/tutorial-3/pixi.js-master/examples/example 7 - Transparent Background/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 7 - Transparent Background/bunny.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 7 - Transparent Background/index.html b/tutorial-3/pixi.js-master/examples/example 7 - Transparent Background/index.html deleted file mode 100755 index 305c3bd..0000000 --- a/tutorial-3/pixi.js-master/examples/example 7 - Transparent Background/index.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - pixi.js example 7 transparency - - - - -
    Hi there, I'm some HTML text... blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
    - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 7 - Transparent Background/shapeTris.png b/tutorial-3/pixi.js-master/examples/example 7 - Transparent Background/shapeTris.png deleted file mode 100755 index 426ff68..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 7 - Transparent Background/shapeTris.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 8 - Dragging/bunny.png b/tutorial-3/pixi.js-master/examples/example 8 - Dragging/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 8 - Dragging/bunny.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/example 8 - Dragging/index.html b/tutorial-3/pixi.js-master/examples/example 8 - Dragging/index.html deleted file mode 100755 index 69352af..0000000 --- a/tutorial-3/pixi.js-master/examples/example 8 - Dragging/index.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - pixi.js example 8 Dragging - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 9 - Tiling Texture/index.html b/tutorial-3/pixi.js-master/examples/example 9 - Tiling Texture/index.html deleted file mode 100755 index 411ded9..0000000 --- a/tutorial-3/pixi.js-master/examples/example 9 - Tiling Texture/index.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - pixi.js example 9 Tiling Texture - - - - - - - - diff --git a/tutorial-3/pixi.js-master/examples/example 9 - Tiling Texture/p2.jpeg b/tutorial-3/pixi.js-master/examples/example 9 - Tiling Texture/p2.jpeg deleted file mode 100755 index 4943288..0000000 Binary files a/tutorial-3/pixi.js-master/examples/example 9 - Tiling Texture/p2.jpeg and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/test/bunny.png b/tutorial-3/pixi.js-master/examples/test/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-3/pixi.js-master/examples/test/bunny.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/examples/test/index.html b/tutorial-3/pixi.js-master/examples/test/index.html deleted file mode 100755 index f1009cb..0000000 --- a/tutorial-3/pixi.js-master/examples/test/index.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - pixi.js test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tutorial-3/pixi.js-master/logo.png b/tutorial-3/pixi.js-master/logo.png deleted file mode 100755 index 654d77f..0000000 Binary files a/tutorial-3/pixi.js-master/logo.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/logo_small.png b/tutorial-3/pixi.js-master/logo_small.png deleted file mode 100755 index f7c1f4f..0000000 Binary files a/tutorial-3/pixi.js-master/logo_small.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/package.json b/tutorial-3/pixi.js-master/package.json deleted file mode 100755 index 463e77c..0000000 --- a/tutorial-3/pixi.js-master/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "pixi.js", - "version": "2.2.7", - "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", - "author": "Mat Groves", - "contributors": [ - "Chad Engler " - ], - "logo": "http://www.goodboydigital.com/pixijs/logo_small.png", - "homepage": "http://goodboydigital.com/", - "bugs": "https://github.com/GoodBoyDigital/pixi.js/issues", - "license": "MIT", - "licenseUrl": "http://www.opensource.org/licenses/mit-license.php", - "repository": { - "type": "git", - "url": "https://github.com/GoodBoyDigital/pixi.js.git" - }, - "main": "bin/pixi.dev.js", - "scripts": { - "test": "grunt travis --verbose" - }, - "dependencies": {}, - "devDependencies": { - "grunt": "~0.4.1", - "grunt-contrib-jshint": "~0.8", - "grunt-contrib-uglify": "~0.2", - "grunt-contrib-connect": "~0.5", - "grunt-contrib-yuidoc": "~0.5", - "grunt-concat-sourcemap": "~0.4", - "grunt-contrib-concat": "~0.3", - "mocha": "~1.15", - "chai": "~1.8", - "karma": "~0.12", - "karma-chrome-launcher": "~0.1", - "karma-firefox-launcher": "~0.1", - "karma-mocha": "~0.1", - "karma-spec-reporter": "~0.0.6", - "grunt-contrib-watch": "~0.5.3" - } -} diff --git a/tutorial-3/pixi.js-master/src/pixi/InteractionData.js b/tutorial-3/pixi.js-master/src/pixi/InteractionData.js deleted file mode 100755 index b0d8a6a..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/InteractionData.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Holds all information related to an Interaction event - * - * @class InteractionData - * @constructor - */ -PIXI.InteractionData = function() -{ - /** - * This point stores the global coords of where the touch/mouse event happened - * - * @property global - * @type Point - */ - this.global = new PIXI.Point(); - - /** - * The target Sprite that was interacted with - * - * @property target - * @type Sprite - */ - this.target = null; - - /** - * When passed to an event handler, this will be the original DOM Event that was captured - * - * @property originalEvent - * @type Event - */ - this.originalEvent = null; -}; - -/** - * This will return the local coordinates of the specified displayObject for this InteractionData - * - * @method getLocalPosition - * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off - * @param [point] {Point} A Point object in which to store the value, optional (otherwise will create a new point) - * @return {Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject - */ -PIXI.InteractionData.prototype.getLocalPosition = function(displayObject, point) -{ - var worldTransform = displayObject.worldTransform; - var global = this.global; - - // do a cheeky transform to get the mouse coords; - var a00 = worldTransform.a, a01 = worldTransform.c, a02 = worldTransform.tx, - a10 = worldTransform.b, a11 = worldTransform.d, a12 = worldTransform.ty, - id = 1 / (a00 * a11 + a01 * -a10); - - point = point || new PIXI.Point(); - - point.x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id; - point.y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; - - // set the mouse coords... - return point; -}; - -// constructor -PIXI.InteractionData.prototype.constructor = PIXI.InteractionData; diff --git a/tutorial-3/pixi.js-master/src/pixi/InteractionManager.js b/tutorial-3/pixi.js-master/src/pixi/InteractionManager.js deleted file mode 100755 index 646d0a8..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/InteractionManager.js +++ /dev/null @@ -1,944 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - - /** - * The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive - * if its interactive parameter is set to true - * This manager also supports multitouch. - * - * @class InteractionManager - * @constructor - * @param stage {Stage} The stage to handle interactions - */ -PIXI.InteractionManager = function(stage) -{ - /** - * A reference to the stage - * - * @property stage - * @type Stage - */ - this.stage = stage; - - /** - * The mouse data - * - * @property mouse - * @type InteractionData - */ - this.mouse = new PIXI.InteractionData(); - - /** - * An object that stores current touches (InteractionData) by id reference - * - * @property touches - * @type Object - */ - this.touches = {}; - - /** - * @property tempPoint - * @type Point - * @private - */ - this.tempPoint = new PIXI.Point(); - - /** - * @property mouseoverEnabled - * @type Boolean - * @default - */ - this.mouseoverEnabled = true; - - /** - * Tiny little interactiveData pool ! - * - * @property pool - * @type Array - */ - this.pool = []; - - /** - * An array containing all the iterative items from the our interactive tree - * @property interactiveItems - * @type Array - * @private - */ - this.interactiveItems = []; - - /** - * Our canvas - * @property interactionDOMElement - * @type HTMLCanvasElement - * @private - */ - this.interactionDOMElement = null; - - //this will make it so that you don't have to call bind all the time - - /** - * @property onMouseMove - * @type Function - */ - this.onMouseMove = this.onMouseMove.bind( this ); - - /** - * @property onMouseDown - * @type Function - */ - this.onMouseDown = this.onMouseDown.bind(this); - - /** - * @property onMouseOut - * @type Function - */ - this.onMouseOut = this.onMouseOut.bind(this); - - /** - * @property onMouseUp - * @type Function - */ - this.onMouseUp = this.onMouseUp.bind(this); - - /** - * @property onTouchStart - * @type Function - */ - this.onTouchStart = this.onTouchStart.bind(this); - - /** - * @property onTouchEnd - * @type Function - */ - this.onTouchEnd = this.onTouchEnd.bind(this); - - /** - * @property onTouchCancel - * @type Function - */ - this.onTouchCancel = this.onTouchCancel.bind(this); - - /** - * @property onTouchMove - * @type Function - */ - this.onTouchMove = this.onTouchMove.bind(this); - - /** - * @property last - * @type Number - */ - this.last = 0; - - /** - * The css style of the cursor that is being used - * @property currentCursorStyle - * @type String - */ - this.currentCursorStyle = 'inherit'; - - /** - * Is set to true when the mouse is moved out of the canvas - * @property mouseOut - * @type Boolean - */ - this.mouseOut = false; - - /** - * @property resolution - * @type Number - */ - this.resolution = 1; - - // used for hit testing - this._tempPoint = new PIXI.Point(); -}; - -// constructor -PIXI.InteractionManager.prototype.constructor = PIXI.InteractionManager; - -/** - * Collects an interactive sprite recursively to have their interactions managed - * - * @method collectInteractiveSprite - * @param displayObject {DisplayObject} the displayObject to collect - * @param iParent {DisplayObject} the display object's parent - * @private - */ -PIXI.InteractionManager.prototype.collectInteractiveSprite = function(displayObject, iParent) -{ - var children = displayObject.children; - var length = children.length; - - // make an interaction tree... {item.__interactiveParent} - for (var i = length - 1; i >= 0; i--) - { - var child = children[i]; - - // push all interactive bits - if (child._interactive) - { - iParent.interactiveChildren = true; - //child.__iParent = iParent; - this.interactiveItems.push(child); - - if (child.children.length > 0) { - this.collectInteractiveSprite(child, child); - } - } - else - { - child.__iParent = null; - if (child.children.length > 0) - { - this.collectInteractiveSprite(child, iParent); - } - } - - } -}; - -/** - * Sets the target for event delegation - * - * @method setTarget - * @param target {WebGLRenderer|CanvasRenderer} the renderer to bind events to - * @private - */ -PIXI.InteractionManager.prototype.setTarget = function(target) -{ - this.target = target; - this.resolution = target.resolution; - - // Check if the dom element has been set. If it has don't do anything. - if (this.interactionDOMElement !== null) return; - - this.setTargetDomElement (target.view); -}; - -/** - * Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM - * elements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element - * to receive those events - * - * @method setTargetDomElement - * @param domElement {DOMElement} the DOM element which will receive mouse and touch events - * @private - */ -PIXI.InteractionManager.prototype.setTargetDomElement = function(domElement) -{ - this.removeEvents(); - - if (window.navigator.msPointerEnabled) - { - // time to remove some of that zoom in ja.. - domElement.style['-ms-content-zooming'] = 'none'; - domElement.style['-ms-touch-action'] = 'none'; - } - - this.interactionDOMElement = domElement; - - domElement.addEventListener('mousemove', this.onMouseMove, true); - domElement.addEventListener('mousedown', this.onMouseDown, true); - domElement.addEventListener('mouseout', this.onMouseOut, true); - - // aint no multi touch just yet! - domElement.addEventListener('touchstart', this.onTouchStart, true); - domElement.addEventListener('touchend', this.onTouchEnd, true); - domElement.addEventListener('touchleave', this.onTouchCancel, true); - domElement.addEventListener('touchcancel', this.onTouchCancel, true); - domElement.addEventListener('touchmove', this.onTouchMove, true); - - window.addEventListener('mouseup', this.onMouseUp, true); -}; - -/** - * @method removeEvents - * @private - */ -PIXI.InteractionManager.prototype.removeEvents = function() -{ - if (!this.interactionDOMElement) return; - - this.interactionDOMElement.style['-ms-content-zooming'] = ''; - this.interactionDOMElement.style['-ms-touch-action'] = ''; - - this.interactionDOMElement.removeEventListener('mousemove', this.onMouseMove, true); - this.interactionDOMElement.removeEventListener('mousedown', this.onMouseDown, true); - this.interactionDOMElement.removeEventListener('mouseout', this.onMouseOut, true); - - // aint no multi touch just yet! - this.interactionDOMElement.removeEventListener('touchstart', this.onTouchStart, true); - this.interactionDOMElement.removeEventListener('touchend', this.onTouchEnd, true); - this.interactionDOMElement.removeEventListener('touchleave', this.onTouchCancel, true); - this.interactionDOMElement.removeEventListener('touchcancel', this.onTouchCancel, true); - this.interactionDOMElement.removeEventListener('touchmove', this.onTouchMove, true); - - this.interactionDOMElement = null; - - window.removeEventListener('mouseup', this.onMouseUp, true); -}; - -/** - * updates the state of interactive objects - * - * @method update - * @private - */ -PIXI.InteractionManager.prototype.update = function() -{ - if (!this.target) return; - - // frequency of 30fps?? - var now = Date.now(); - var diff = now - this.last; - diff = (diff * PIXI.INTERACTION_FREQUENCY ) / 1000; - if (diff < 1) return; - this.last = now; - - var i = 0; - - // ok.. so mouse events?? - // yes for now :) - // OPTIMISE - how often to check?? - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - // loop through interactive objects! - var length = this.interactiveItems.length; - var cursor = 'inherit'; - var over = false; - - for (i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - // OPTIMISATION - only calculate every time if the mousemove function exists.. - // OK so.. does the object have any other interactive functions? - // hit-test the clip! - // if (item.mouseover || item.mouseout || item.buttonMode) - // { - // ok so there are some functions so lets hit test it.. - item.__hit = this.hitTest(item, this.mouse); - this.mouse.target = item; - // ok so deal with interactions.. - // looks like there was a hit! - if (item.__hit && !over) - { - if (item.buttonMode) cursor = item.defaultCursor; - - if (!item.interactiveChildren) - { - over = true; - } - - if (!item.__isOver) - { - if (item.mouseover) - { - item.mouseover (this.mouse); - } - item.__isOver = true; - } - } - else - { - if (item.__isOver) - { - // roll out! - if (item.mouseout) - { - item.mouseout (this.mouse); - } - item.__isOver = false; - } - } - } - - if (this.currentCursorStyle !== cursor) - { - this.currentCursorStyle = cursor; - this.interactionDOMElement.style.cursor = cursor; - } -}; - -/** - * @method rebuildInteractiveGraph - * @private - */ -PIXI.InteractionManager.prototype.rebuildInteractiveGraph = function() -{ - this.dirty = false; - - var len = this.interactiveItems.length; - - for (var i = 0; i < len; i++) { - this.interactiveItems[i].interactiveChildren = false; - } - - this.interactiveItems = []; - - if (this.stage.interactive) - { - this.interactiveItems.push(this.stage); - } - - // Go through and collect all the objects that are interactive.. - this.collectInteractiveSprite(this.stage, this.stage); -}; - -/** - * Is called when the mouse moves across the renderer element - * - * @method onMouseMove - * @param event {Event} The DOM event of the mouse moving - * @private - */ -PIXI.InteractionManager.prototype.onMouseMove = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - // TODO optimize by not check EVERY TIME! maybe half as often? // - var rect = this.interactionDOMElement.getBoundingClientRect(); - - this.mouse.global.x = (event.clientX - rect.left) * (this.target.width / rect.width) / this.resolution; - this.mouse.global.y = (event.clientY - rect.top) * ( this.target.height / rect.height) / this.resolution; - - var length = this.interactiveItems.length; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - // Call the function! - if (item.mousemove) - { - item.mousemove(this.mouse); - } - } -}; - -/** - * Is called when the mouse button is pressed down on the renderer element - * - * @method onMouseDown - * @param event {Event} The DOM event of a mouse button being pressed down - * @private - */ -PIXI.InteractionManager.prototype.onMouseDown = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - if (PIXI.AUTO_PREVENT_DEFAULT) - { - this.mouse.originalEvent.preventDefault(); - } - - // loop through interaction tree... - // hit test each item! -> - // get interactive items under point?? - //stage.__i - var length = this.interactiveItems.length; - - var e = this.mouse.originalEvent; - var isRightButton = e.button === 2 || e.which === 3; - var downFunction = isRightButton ? 'rightdown' : 'mousedown'; - var clickFunction = isRightButton ? 'rightclick' : 'click'; - var buttonIsDown = isRightButton ? '__rightIsDown' : '__mouseIsDown'; - var isDown = isRightButton ? '__isRightDown' : '__isDown'; - - // while - // hit test - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - if (item[downFunction] || item[clickFunction]) - { - item[buttonIsDown] = true; - item.__hit = this.hitTest(item, this.mouse); - - if (item.__hit) - { - //call the function! - if (item[downFunction]) - { - item[downFunction](this.mouse); - } - item[isDown] = true; - - // just the one! - if (!item.interactiveChildren) break; - } - } - } -}; - -/** - * Is called when the mouse is moved out of the renderer element - * - * @method onMouseOut - * @param event {Event} The DOM event of a mouse being moved out - * @private - */ -PIXI.InteractionManager.prototype.onMouseOut = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - var length = this.interactiveItems.length; - - this.interactionDOMElement.style.cursor = 'inherit'; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - if (item.__isOver) - { - this.mouse.target = item; - if (item.mouseout) - { - item.mouseout(this.mouse); - } - item.__isOver = false; - } - } - - this.mouseOut = true; - - // move the mouse to an impossible position - this.mouse.global.x = -10000; - this.mouse.global.y = -10000; -}; - -/** - * Is called when the mouse button is released on the renderer element - * - * @method onMouseUp - * @param event {Event} The DOM event of a mouse button being released - * @private - */ -PIXI.InteractionManager.prototype.onMouseUp = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - var length = this.interactiveItems.length; - var up = false; - - var e = this.mouse.originalEvent; - var isRightButton = e.button === 2 || e.which === 3; - - var upFunction = isRightButton ? 'rightup' : 'mouseup'; - var clickFunction = isRightButton ? 'rightclick' : 'click'; - var upOutsideFunction = isRightButton ? 'rightupoutside' : 'mouseupoutside'; - var isDown = isRightButton ? '__isRightDown' : '__isDown'; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - if (item[clickFunction] || item[upFunction] || item[upOutsideFunction]) - { - item.__hit = this.hitTest(item, this.mouse); - - if (item.__hit && !up) - { - //call the function! - if (item[upFunction]) - { - item[upFunction](this.mouse); - } - if (item[isDown]) - { - if (item[clickFunction]) - { - item[clickFunction](this.mouse); - } - } - - if (!item.interactiveChildren) - { - up = true; - } - } - else - { - if (item[isDown]) - { - if (item[upOutsideFunction]) item[upOutsideFunction](this.mouse); - } - } - - item[isDown] = false; - } - } -}; - -/** - * Tests if the current mouse coordinates hit a sprite - * - * @method hitTest - * @param item {DisplayObject} The displayObject to test for a hit - * @param interactionData {InteractionData} The interactionData object to update in the case there is a hit - * @private - */ -PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) -{ - var global = interactionData.global; - - if (!item.worldVisible) - { - return false; - } - - // map the global point to local space. - item.worldTransform.applyInverse(global, this._tempPoint); - - var x = this._tempPoint.x, - y = this._tempPoint.y, - i; - - interactionData.target = item; - - //a sprite or display object with a hit area defined - if (item.hitArea && item.hitArea.contains) - { - return item.hitArea.contains(x, y); - } - // a sprite with no hitarea defined - else if(item instanceof PIXI.Sprite) - { - var width = item.texture.frame.width; - var height = item.texture.frame.height; - var x1 = -width * item.anchor.x; - var y1; - - if (x > x1 && x < x1 + width) - { - y1 = -height * item.anchor.y; - - if (y > y1 && y < y1 + height) - { - // set the target property if a hit is true! - return true; - } - } - } - else if(item instanceof PIXI.Graphics) - { - var graphicsData = item.graphicsData; - for (i = 0; i < graphicsData.length; i++) - { - var data = graphicsData[i]; - if(!data.fill)continue; - - // only deal with fills.. - if(data.shape) - { - if(data.shape.contains(x, y)) - { - //interactionData.target = item; - return true; - } - } - } - } - - var length = item.children.length; - - for (i = 0; i < length; i++) - { - var tempItem = item.children[i]; - var hit = this.hitTest(tempItem, interactionData); - if (hit) - { - // hmm.. TODO SET CORRECT TARGET? - interactionData.target = item; - return true; - } - } - return false; -}; - -/** - * Is called when a touch is moved across the renderer element - * - * @method onTouchMove - * @param event {Event} The DOM event of a touch moving across the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchMove = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - var touchData; - var i = 0; - - for (i = 0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - touchData = this.touches[touchEvent.identifier]; - touchData.originalEvent = event; - - // update the touch position - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - for (var j = 0; j < this.interactiveItems.length; j++) - { - var item = this.interactiveItems[j]; - if (item.touchmove && item.__touchData && item.__touchData[touchEvent.identifier]) - { - item.touchmove(touchData); - } - } - } -}; - -/** - * Is called when a touch is started on the renderer element - * - * @method onTouchStart - * @param event {Event} The DOM event of a touch starting on the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchStart = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - - if (PIXI.AUTO_PREVENT_DEFAULT) - { - event.preventDefault(); - } - - var changedTouches = event.changedTouches; - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - - var touchData = this.pool.pop(); - if (!touchData) - { - touchData = new PIXI.InteractionData(); - } - - touchData.originalEvent = event; - - this.touches[touchEvent.identifier] = touchData; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.touchstart || item.tap) - { - item.__hit = this.hitTest(item, touchData); - - if (item.__hit) - { - //call the function! - if (item.touchstart)item.touchstart(touchData); - item.__isDown = true; - item.__touchData = item.__touchData || {}; - item.__touchData[touchEvent.identifier] = touchData; - - if (!item.interactiveChildren) break; - } - } - } - } -}; - -/** - * Is called when a touch is ended on the renderer element - * - * @method onTouchEnd - * @param event {Event} The DOM event of a touch ending on the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchEnd = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - var touchData = this.touches[touchEvent.identifier]; - var up = false; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.__touchData && item.__touchData[touchEvent.identifier]) - { - - item.__hit = this.hitTest(item, item.__touchData[touchEvent.identifier]); - - // so this one WAS down... - touchData.originalEvent = event; - // hitTest?? - - if (item.touchend || item.tap) - { - if (item.__hit && !up) - { - if (item.touchend) - { - item.touchend(touchData); - } - if (item.__isDown && item.tap) - { - item.tap(touchData); - } - if (!item.interactiveChildren) - { - up = true; - } - } - else - { - if (item.__isDown && item.touchendoutside) - { - item.touchendoutside(touchData); - } - } - - item.__isDown = false; - } - - item.__touchData[touchEvent.identifier] = null; - } - } - // remove the touch.. - this.pool.push(touchData); - this.touches[touchEvent.identifier] = null; - } -}; - -/** - * Is called when a touch is canceled - * - * @method onTouchCancel - * @param event {Event} The DOM event of a touch canceled - * @private - */ -PIXI.InteractionManager.prototype.onTouchCancel = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - var touchData = this.touches[touchEvent.identifier]; - var up = false; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.__touchData && item.__touchData[touchEvent.identifier]) - { - - item.__hit = this.hitTest(item, item.__touchData[touchEvent.identifier]); - - // so this one WAS down... - touchData.originalEvent = event; - // hitTest?? - - if (item.touchcancel && !up) - { - item.touchcancel(touchData); - if (!item.interactiveChildren) - { - up = true; - } - } - - item.__isDown = false; - item.__touchData[touchEvent.identifier] = null; - } - } - // remove the touch.. - this.pool.push(touchData); - this.touches[touchEvent.identifier] = null; - } -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/Intro.js b/tutorial-3/pixi.js-master/src/pixi/Intro.js deleted file mode 100755 index 07d01da..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/Intro.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -(function(){ - - var root = this; diff --git a/tutorial-3/pixi.js-master/src/pixi/Outro.js b/tutorial-3/pixi.js-master/src/pixi/Outro.js deleted file mode 100755 index bf38bbc..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/Outro.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @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 if (typeof define !== 'undefined' && define.amd) { - define(PIXI); - } else { - root.PIXI = PIXI; - } -}).call(this); \ No newline at end of file diff --git a/tutorial-3/pixi.js-master/src/pixi/Pixi.js b/tutorial-3/pixi.js-master/src/pixi/Pixi.js deleted file mode 100755 index 1b17b5c..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/Pixi.js +++ /dev/null @@ -1,213 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The [pixi.js](http://www.pixijs.com/) module/namespace. - * - * @module PIXI - */ - -/** - * Namespace-class for [pixi.js](http://www.pixijs.com/). - * - * Contains assorted static properties and enumerations. - * - * @class PIXI - * @static - */ -var PIXI = PIXI || {}; - -/** - * @property {Number} WEBGL_RENDERER - * @protected - * @static - */ -PIXI.WEBGL_RENDERER = 0; -/** - * @property {Number} CANVAS_RENDERER - * @protected - * @static - */ -PIXI.CANVAS_RENDERER = 1; - -/** - * Version of pixi that is loaded. - * @property {String} VERSION - * @static - */ -PIXI.VERSION = "v2.2.7"; - -/** - * Various blend modes supported by pixi. IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes. - * @property {Object} blendModes - * @property {Number} blendModes.NORMAL - * @property {Number} blendModes.ADD - * @property {Number} blendModes.MULTIPLY - * @property {Number} blendModes.SCREEN - * @property {Number} blendModes.OVERLAY - * @property {Number} blendModes.DARKEN - * @property {Number} blendModes.LIGHTEN - * @property {Number} blendModes.COLOR_DODGE - * @property {Number} blendModes.COLOR_BURN - * @property {Number} blendModes.HARD_LIGHT - * @property {Number} blendModes.SOFT_LIGHT - * @property {Number} blendModes.DIFFERENCE - * @property {Number} blendModes.EXCLUSION - * @property {Number} blendModes.HUE - * @property {Number} blendModes.SATURATION - * @property {Number} blendModes.COLOR - * @property {Number} blendModes.LUMINOSITY - * @static - */ -PIXI.blendModes = { - NORMAL:0, - ADD:1, - MULTIPLY:2, - SCREEN:3, - OVERLAY:4, - DARKEN:5, - LIGHTEN:6, - COLOR_DODGE:7, - COLOR_BURN:8, - HARD_LIGHT:9, - SOFT_LIGHT:10, - DIFFERENCE:11, - EXCLUSION:12, - HUE:13, - SATURATION:14, - COLOR:15, - LUMINOSITY:16 -}; - -/** - * The scale modes that are supported by pixi. - * - * The DEFAULT scale mode affects the default scaling mode of future operations. - * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. - * - * @property {Object} scaleModes - * @property {Number} scaleModes.DEFAULT=LINEAR - * @property {Number} scaleModes.LINEAR Smooth scaling - * @property {Number} scaleModes.NEAREST Pixelating scaling - * @static - */ -PIXI.scaleModes = { - DEFAULT:0, - LINEAR:0, - NEAREST:1 -}; - -// used to create uids for various pixi objects.. -PIXI._UID = 0; - -if(typeof(Float32Array) != 'undefined') -{ - PIXI.Float32Array = Float32Array; - PIXI.Uint16Array = Uint16Array; - - // Uint32Array and ArrayBuffer only used by WebGL renderer - // We can suppose that if WebGL is supported then typed arrays are supported too - // as they predate WebGL support for all browsers: - // see typed arrays support: http://caniuse.com/#search=TypedArrays - // see WebGL support: http://caniuse.com/#search=WebGL - PIXI.Uint32Array = Uint32Array; - PIXI.ArrayBuffer = ArrayBuffer; -} -else -{ - PIXI.Float32Array = Array; - PIXI.Uint16Array = Array; -} - -// interaction frequency -PIXI.INTERACTION_FREQUENCY = 30; -PIXI.AUTO_PREVENT_DEFAULT = true; - -/** - * @property {Number} PI_2 - * @static - */ -PIXI.PI_2 = Math.PI * 2; - -/** - * @property {Number} RAD_TO_DEG - * @static - */ -PIXI.RAD_TO_DEG = 180 / Math.PI; - -/** - * @property {Number} DEG_TO_RAD - * @static - */ -PIXI.DEG_TO_RAD = Math.PI / 180; - -/** - * @property {String} RETINA_PREFIX - * @protected - * @static - */ -PIXI.RETINA_PREFIX = "@2x"; -//PIXI.SCALE_PREFIX "@x%%"; - -/** - * If true the default pixi startup (console) banner message will be suppressed. - * - * @property {Boolean} dontSayHello - * @default false - * @static - */ -PIXI.dontSayHello = false; - -/** - * The default render options if none are supplied to - * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. - * - * @property {Object} defaultRenderOptions - * @property {Object} defaultRenderOptions.view=null - * @property {Boolean} defaultRenderOptions.transparent=false - * @property {Boolean} defaultRenderOptions.antialias=false - * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false - * @property {Number} defaultRenderOptions.resolution=1 - * @property {Boolean} defaultRenderOptions.clearBeforeRender=true - * @property {Boolean} defaultRenderOptions.autoResize=false - * @static - */ -PIXI.defaultRenderOptions = { - view:null, - transparent:false, - antialias:false, - preserveDrawingBuffer:false, - resolution:1, - clearBeforeRender:true, - autoResize:false -} - -PIXI.sayHello = function (type) -{ - if(PIXI.dontSayHello)return; - - if ( navigator.userAgent.toLowerCase().indexOf('chrome') > -1 ) - { - var args = [ - '%c %c %c Pixi.js ' + PIXI.VERSION + ' - ' + type + ' %c ' + ' %c ' + ' http://www.pixijs.com/ %c %c ♥%c♥%c♥ ', - 'background: #ff66a5', - 'background: #ff66a5', - 'color: #ff66a5; background: #030307;', - 'background: #ff66a5', - 'background: #ffc3dc', - 'background: #ff66a5', - 'color: #ff2424; background: #fff', - 'color: #ff2424; background: #fff', - 'color: #ff2424; background: #fff' - ]; - - console.log.apply(console, args); - } - else if (window['console']) - { - console.log('Pixi.js ' + PIXI.VERSION + ' - http://www.pixijs.com/'); - } - - PIXI.dontSayHello = true; -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/display/DisplayObject.js b/tutorial-3/pixi.js-master/src/pixi/display/DisplayObject.js deleted file mode 100755 index 58b375c..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/display/DisplayObject.js +++ /dev/null @@ -1,765 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The base class for all objects that are rendered on the screen. - * This is an abstract class and should not be used on its own rather it should be extended. - * - * @class DisplayObject - * @constructor - */ -PIXI.DisplayObject = function() -{ - /** - * The coordinate of the object relative to the local coordinates of the parent. - * - * @property position - * @type Point - */ - this.position = new PIXI.Point(); - - /** - * The scale factor of the object. - * - * @property scale - * @type Point - */ - this.scale = new PIXI.Point(1,1);//{x:1, y:1}; - - /** - * The pivot point of the displayObject that it rotates around - * - * @property pivot - * @type Point - */ - this.pivot = new PIXI.Point(0,0); - - /** - * The rotation of the object in radians. - * - * @property rotation - * @type Number - */ - this.rotation = 0; - - /** - * The opacity of the object. - * - * @property alpha - * @type Number - */ - this.alpha = 1; - - /** - * The visibility of the object. - * - * @property visible - * @type Boolean - */ - this.visible = true; - - /** - * This is the defined area that will pick up mouse / touch events. It is null by default. - * Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children) - * - * @property hitArea - * @type Rectangle|Circle|Ellipse|Polygon - */ - this.hitArea = null; - - /** - * This is used to indicate if the displayObject should display a mouse hand cursor on rollover - * - * @property buttonMode - * @type Boolean - */ - this.buttonMode = false; - - /** - * Can this object be rendered - * - * @property renderable - * @type Boolean - */ - this.renderable = false; - - /** - * [read-only] The display object container that contains this display object. - * - * @property parent - * @type DisplayObjectContainer - * @readOnly - */ - this.parent = null; - - /** - * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage. - * - * @property stage - * @type Stage - * @readOnly - */ - this.stage = null; - - /** - * [read-only] The multiplied alpha of the displayObject - * - * @property worldAlpha - * @type Number - * @readOnly - */ - this.worldAlpha = 1; - - /** - * [read-only] Whether or not the object is interactive, do not toggle directly! use the `interactive` property - * - * @property _interactive - * @type Boolean - * @readOnly - * @private - */ - this._interactive = false; - - /** - * This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true - * - * @property defaultCursor - * @type String - * - */ - this.defaultCursor = 'pointer'; - - /** - * [read-only] Current transform of the object based on world (parent) factors - * - * @property worldTransform - * @type Matrix - * @readOnly - * @private - */ - this.worldTransform = new PIXI.Matrix(); - - /** - * cached sin rotation and cos rotation - * - * @property _sr - * @type Number - * @private - */ - this._sr = 0; - - /** - * cached sin rotation and cos rotation - * - * @property _cr - * @type Number - * @private - */ - this._cr = 1; - - /** - * The area the filter is applied to like the hitArea this is used as more of an optimisation - * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle - * - * @property filterArea - * @type Rectangle - */ - this.filterArea = null;//new PIXI.Rectangle(0,0,1,1); - - /** - * The original, cached bounds of the object - * - * @property _bounds - * @type Rectangle - * @private - */ - this._bounds = new PIXI.Rectangle(0, 0, 1, 1); - - /** - * The most up-to-date bounds of the object - * - * @property _currentBounds - * @type Rectangle - * @private - */ - this._currentBounds = null; - - /** - * The original, cached mask of the object - * - * @property _currentBounds - * @type Rectangle - * @private - */ - this._mask = null; - - /** - * Cached internal flag. - * - * @property _cacheAsBitmap - * @type Boolean - * @private - */ - this._cacheAsBitmap = false; - - /** - * Cached internal flag. - * - * @property _cacheIsDirty - * @type Boolean - * @private - */ - this._cacheIsDirty = false; - - - /* - * MOUSE Callbacks - */ - - /** - * A callback that is used when the users mouse rolls over the displayObject - * @method mouseover - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the users mouse leaves the displayObject - * @method mouseout - * @param interactionData {InteractionData} - */ - - //Left button - /** - * A callback that is used when the users clicks on the displayObject with their mouse's left button - * @method click - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user clicks the mouse's left button down over the sprite - * @method mousedown - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's left button that was over the displayObject - * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject - * @method mouseup - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject - * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject - * @method mouseupoutside - * @param interactionData {InteractionData} - */ - - //Right button - /** - * A callback that is used when the users clicks on the displayObject with their mouse's right button - * @method rightclick - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user clicks the mouse's right button down over the sprite - * @method rightdown - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's right button that was over the displayObject - * for this callback to be fired the mouse's right button must have been pressed down over the displayObject - * @method rightup - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject - * for this callback to be fired, the mouse's right button must have been pressed down over the displayObject - * @method rightupoutside - * @param interactionData {InteractionData} - */ - - /* - * TOUCH Callbacks - */ - - /** - * A callback that is used when the users taps on the sprite with their finger - * basically a touch version of click - * @method tap - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user touches over the displayObject - * @method touchstart - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases a touch over the displayObject - * @method touchend - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the touch that was over the displayObject - * for this callback to be fired, The touch must have started over the sprite - * @method touchendoutside - * @param interactionData {InteractionData} - */ -}; - -// constructor -PIXI.DisplayObject.prototype.constructor = PIXI.DisplayObject; - -/** - * Indicates if the sprite will have touch and mouse interactivity. It is false by default - * - * @property interactive - * @type Boolean - * @default false - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'interactive', { - get: function() { - return this._interactive; - }, - set: function(value) { - this._interactive = value; - - // TODO more to be done here.. - // need to sort out a re-crawl! - if(this.stage)this.stage.dirty = true; - } -}); - -/** - * [read-only] Indicates if the sprite is globally visible. - * - * @property worldVisible - * @type Boolean - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'worldVisible', { - get: function() { - var item = this; - - do - { - if(!item.visible)return false; - item = item.parent; - } - while(item); - - return true; - } -}); - -/** - * Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. - * In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. - * To remove a mask, set this property to null. - * - * @property mask - * @type Graphics - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'mask', { - get: function() { - return this._mask; - }, - set: function(value) { - - if(this._mask)this._mask.isMask = false; - this._mask = value; - if(this._mask)this._mask.isMask = true; - } -}); - -/** - * Sets the filters for the displayObject. - * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. - * To remove filters simply set this property to 'null' - * @property filters - * @type Array(Filter) - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { - - get: function() { - return this._filters; - }, - - set: function(value) { - - if(value) - { - // now put all the passes in one place.. - var passes = []; - for (var i = 0; i < value.length; i++) - { - var filterPasses = value[i].passes; - for (var j = 0; j < filterPasses.length; j++) - { - passes.push(filterPasses[j]); - } - } - - // TODO change this as it is legacy - this._filterBlock = {target:this, filterPasses:passes}; - } - - this._filters = value; - } -}); - -/** - * Set if this display object is cached as a bitmap. - * This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. - * To remove simply set this property to 'null' - * @property cacheAsBitmap - * @type Boolean - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'cacheAsBitmap', { - - get: function() { - return this._cacheAsBitmap; - }, - - set: function(value) { - - if(this._cacheAsBitmap === value)return; - - if(value) - { - this._generateCachedSprite(); - } - else - { - this._destroyCachedSprite(); - } - - this._cacheAsBitmap = value; - } -}); - -/* - * Updates the object transform for rendering - * - * @method updateTransform - * @private - */ -PIXI.DisplayObject.prototype.updateTransform = function() -{ - // create some matrix refs for easy access - var pt = this.parent.worldTransform; - var wt = this.worldTransform; - - // temporary matrix variables - var a, b, c, d, tx, ty; - - // so if rotation is between 0 then we can simplify the multiplication process.. - if(this.rotation % PIXI.PI_2) - { - // check to see if the rotation is the same as the previous render. This means we only need to use sin and cos when rotation actually changes - if(this.rotation !== this.rotationCache) - { - this.rotationCache = this.rotation; - this._sr = Math.sin(this.rotation); - this._cr = Math.cos(this.rotation); - } - - // get the matrix values of the displayobject based on its transform properties.. - a = this._cr * this.scale.x; - b = this._sr * this.scale.x; - c = -this._sr * this.scale.y; - d = this._cr * this.scale.y; - tx = this.position.x; - ty = this.position.y; - - // check for pivot.. not often used so geared towards that fact! - if(this.pivot.x || this.pivot.y) - { - tx -= this.pivot.x * a + this.pivot.y * c; - ty -= this.pivot.x * b + this.pivot.y * d; - } - - // concat the parent matrix with the objects transform. - wt.a = a * pt.a + b * pt.c; - wt.b = a * pt.b + b * pt.d; - wt.c = c * pt.a + d * pt.c; - wt.d = c * pt.b + d * pt.d; - wt.tx = tx * pt.a + ty * pt.c + pt.tx; - wt.ty = tx * pt.b + ty * pt.d + pt.ty; - - - } - else - { - // lets do the fast version as we know there is no rotation.. - a = this.scale.x; - d = this.scale.y; - - tx = this.position.x - this.pivot.x * a; - ty = this.position.y - this.pivot.y * d; - - wt.a = a * pt.a; - wt.b = a * pt.b; - wt.c = d * pt.c; - wt.d = d * pt.d; - wt.tx = tx * pt.a + ty * pt.c + pt.tx; - wt.ty = tx * pt.b + ty * pt.d + pt.ty; - } - - // multiply the alphas.. - this.worldAlpha = this.alpha * this.parent.worldAlpha; -}; - -// performance increase to avoid using call.. (10x faster) -PIXI.DisplayObject.prototype.displayObjectUpdateTransform = PIXI.DisplayObject.prototype.updateTransform; - -/** - * Retrieves the bounds of the displayObject as a rectangle object - * - * @method getBounds - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area - */ -PIXI.DisplayObject.prototype.getBounds = function(matrix) -{ - matrix = matrix;//just to get passed js hinting (and preserve inheritance) - return PIXI.EmptyRectangle; -}; - -/** - * Retrieves the local bounds of the displayObject as a rectangle object - * - * @method getLocalBounds - * @return {Rectangle} the rectangular bounding area - */ -PIXI.DisplayObject.prototype.getLocalBounds = function() -{ - return this.getBounds(PIXI.identityMatrix);///PIXI.EmptyRectangle(); -}; - -/** - * Sets the object's stage reference, the stage this object is connected to - * - * @method setStageReference - * @param stage {Stage} the stage that the object will have as its current stage reference - */ -PIXI.DisplayObject.prototype.setStageReference = function(stage) -{ - this.stage = stage; - if(this._interactive)this.stage.dirty = true; -}; - -/** - * Useful function that returns a texture of the displayObject object that can then be used to create sprites - * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. - * - * @method generateTexture - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @return {Texture} a texture of the graphics object - */ -PIXI.DisplayObject.prototype.generateTexture = function(resolution, scaleMode, renderer) -{ - var bounds = this.getLocalBounds(); - - var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0, renderer, scaleMode, resolution); - - PIXI.DisplayObject._tempMatrix.tx = -bounds.x; - PIXI.DisplayObject._tempMatrix.ty = -bounds.y; - - renderTexture.render(this, PIXI.DisplayObject._tempMatrix); - - return renderTexture; -}; - -/** - * Generates and updates the cached sprite for this object. - * - * @method updateCache - */ -PIXI.DisplayObject.prototype.updateCache = function() -{ - this._generateCachedSprite(); -}; - -/** - * Calculates the global position of the display object - * - * @method toGlobal - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object - */ -PIXI.DisplayObject.prototype.toGlobal = function(position) -{ - // don't need to u[date the lot - this.displayObjectUpdateTransform(); - return this.worldTransform.apply(position); -}; - -/** - * Calculates the local position of the display object relative to another point - * - * @method toLocal - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object - */ -PIXI.DisplayObject.prototype.toLocal = function(position, from) -{ - // - if (from) - { - position = from.toGlobal(position); - } - - // don't need to u[date the lot - this.displayObjectUpdateTransform(); - return this.worldTransform.applyInverse(position); -}; - -/** - * Internal method. - * - * @method _renderCachedSprite - * @param renderSession {Object} The render session - * @private - */ -PIXI.DisplayObject.prototype._renderCachedSprite = function(renderSession) -{ - this._cachedSprite.worldAlpha = this.worldAlpha; - - if(renderSession.gl) - { - PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession); - } - else - { - PIXI.Sprite.prototype._renderCanvas.call(this._cachedSprite, renderSession); - } -}; - -/** - * Internal method. - * - * @method _generateCachedSprite - * @private - */ -PIXI.DisplayObject.prototype._generateCachedSprite = function() -{ - this._cacheAsBitmap = false; - var bounds = this.getLocalBounds(); - - if(!this._cachedSprite) - { - var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0);//, renderSession.renderer); - - this._cachedSprite = new PIXI.Sprite(renderTexture); - this._cachedSprite.worldTransform = this.worldTransform; - } - else - { - this._cachedSprite.texture.resize(bounds.width | 0, bounds.height | 0); - } - - //REMOVE filter! - var tempFilters = this._filters; - this._filters = null; - - this._cachedSprite.filters = tempFilters; - - PIXI.DisplayObject._tempMatrix.tx = -bounds.x; - PIXI.DisplayObject._tempMatrix.ty = -bounds.y; - - this._cachedSprite.texture.render(this, PIXI.DisplayObject._tempMatrix, true); - - this._cachedSprite.anchor.x = -( bounds.x / bounds.width ); - this._cachedSprite.anchor.y = -( bounds.y / bounds.height ); - - this._filters = tempFilters; - - this._cacheAsBitmap = true; -}; - -/** -* Destroys the cached sprite. -* -* @method _destroyCachedSprite -* @private -*/ -PIXI.DisplayObject.prototype._destroyCachedSprite = function() -{ - if(!this._cachedSprite)return; - - this._cachedSprite.texture.destroy(true); - - // TODO could be object pooled! - this._cachedSprite = null; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.DisplayObject.prototype._renderWebGL = function(renderSession) -{ - // OVERWRITE; - // this line is just here to pass jshinting :) - renderSession = renderSession; -}; - -/** -* Renders the object using the Canvas renderer -* -* @method _renderCanvas -* @param renderSession {RenderSession} -* @private -*/ -PIXI.DisplayObject.prototype._renderCanvas = function(renderSession) -{ - // OVERWRITE; - // this line is just here to pass jshinting :) - renderSession = renderSession; -}; - - -PIXI.DisplayObject._tempMatrix = new PIXI.Matrix(); - -/** - * The position of the displayObject on the x axis relative to the local coordinates of the parent. - * - * @property x - * @type Number - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'x', { - get: function() { - return this.position.x; - }, - set: function(value) { - this.position.x = value; - } -}); - -/** - * The position of the displayObject on the y axis relative to the local coordinates of the parent. - * - * @property y - * @type Number - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'y', { - get: function() { - return this.position.y; - }, - set: function(value) { - this.position.y = value; - } -}); diff --git a/tutorial-3/pixi.js-master/src/pixi/display/DisplayObjectContainer.js b/tutorial-3/pixi.js-master/src/pixi/display/DisplayObjectContainer.js deleted file mode 100755 index e3ccc20..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/display/DisplayObjectContainer.js +++ /dev/null @@ -1,515 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A DisplayObjectContainer represents a collection of display objects. - * It is the base class of all display objects that act as a container for other objects. - * - * @class DisplayObjectContainer - * @extends DisplayObject - * @constructor - */ -PIXI.DisplayObjectContainer = function() -{ - PIXI.DisplayObject.call( this ); - - /** - * [read-only] The array of children of this container. - * - * @property children - * @type Array(DisplayObject) - * @readOnly - */ - this.children = []; - - // fast access to update transform.. - -}; - -// constructor -PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); -PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer; - - -/** - * The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', { - get: function() { - return this.scale.x * this.getLocalBounds().width; - }, - set: function(value) { - - var width = this.getLocalBounds().width; - - if(width !== 0) - { - this.scale.x = value / width; - } - else - { - this.scale.x = 1; - } - - - this._width = value; - } -}); - -/** - * The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', { - get: function() { - return this.scale.y * this.getLocalBounds().height; - }, - set: function(value) { - - var height = this.getLocalBounds().height; - - if(height !== 0) - { - this.scale.y = value / height ; - } - else - { - this.scale.y = 1; - } - - this._height = value; - } -}); - -/** - * Adds a child to the container. - * - * @method addChild - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. - */ -PIXI.DisplayObjectContainer.prototype.addChild = function(child) -{ - return this.addChildAt(child, this.children.length); -}; - -/** - * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown - * - * @method addChildAt - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. - */ -PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) -{ - if(index >= 0 && index <= this.children.length) - { - if(child.parent) - { - child.parent.removeChild(child); - } - - child.parent = this; - - this.children.splice(index, 0, child); - - if(this.stage)child.setStageReference(this.stage); - - return child; - } - else - { - throw new Error(child + 'addChildAt: The index '+ index +' supplied is out of bounds ' + this.children.length); - } -}; - -/** - * Swaps the position of 2 Display Objects within this container. - * - * @method swapChildren - * @param child {DisplayObject} - * @param child2 {DisplayObject} - */ -PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2) -{ - if(child === child2) { - return; - } - - var index1 = this.getChildIndex(child); - var index2 = this.getChildIndex(child2); - - if(index1 < 0 || index2 < 0) { - throw new Error('swapChildren: Both the supplied DisplayObjects must be a child of the caller.'); - } - - this.children[index1] = child2; - this.children[index2] = child; - -}; - -/** - * Returns the index position of a child DisplayObject instance - * - * @method getChildIndex - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify - */ -PIXI.DisplayObjectContainer.prototype.getChildIndex = function(child) -{ - var index = this.children.indexOf(child); - if (index === -1) - { - throw new Error('The supplied DisplayObject must be a child of the caller'); - } - return index; -}; - -/** - * Changes the position of an existing child in the display object container - * - * @method setChildIndex - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object - */ -PIXI.DisplayObjectContainer.prototype.setChildIndex = function(child, index) -{ - if (index < 0 || index >= this.children.length) - { - throw new Error('The supplied index is out of bounds'); - } - var currentIndex = this.getChildIndex(child); - this.children.splice(currentIndex, 1); //remove from old position - this.children.splice(index, 0, child); //add at new position -}; - -/** - * Returns the child at the specified index - * - * @method getChildAt - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child at the given index, if any. - */ -PIXI.DisplayObjectContainer.prototype.getChildAt = function(index) -{ - if (index < 0 || index >= this.children.length) - { - throw new Error('getChildAt: Supplied index '+ index +' does not exist in the child list, or the supplied DisplayObject must be a child of the caller'); - } - return this.children[index]; - -}; - -/** - * Removes a child from the container. - * - * @method removeChild - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. - */ -PIXI.DisplayObjectContainer.prototype.removeChild = function(child) -{ - var index = this.children.indexOf( child ); - if(index === -1)return; - - return this.removeChildAt( index ); -}; - -/** - * Removes a child from the specified index position. - * - * @method removeChildAt - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. - */ -PIXI.DisplayObjectContainer.prototype.removeChildAt = function(index) -{ - var child = this.getChildAt( index ); - if(this.stage) - child.removeStageReference(); - - child.parent = undefined; - this.children.splice( index, 1 ); - return child; -}; - -/** -* Removes all children from this container that are within the begin and end indexes. -* -* @method removeChildren -* @param beginIndex {Number} The beginning position. Default value is 0. -* @param endIndex {Number} The ending position. Default value is size of the container. -*/ -PIXI.DisplayObjectContainer.prototype.removeChildren = function(beginIndex, endIndex) -{ - var begin = beginIndex || 0; - var end = typeof endIndex === 'number' ? endIndex : this.children.length; - var range = end - begin; - - if (range > 0 && range <= end) - { - var removed = this.children.splice(begin, range); - for (var i = 0; i < removed.length; i++) { - var child = removed[i]; - if(this.stage) - child.removeStageReference(); - child.parent = undefined; - } - return removed; - } - else if (range === 0 && this.children.length === 0) - { - return []; - } - else - { - throw new Error( 'removeChildren: Range Error, numeric values are outside the acceptable range' ); - } -}; - -/* - * Updates the transform on all children of this container for rendering - * - * @method updateTransform - * @private - */ -PIXI.DisplayObjectContainer.prototype.updateTransform = function() -{ - if(!this.visible)return; - - this.displayObjectUpdateTransform(); - - //PIXI.DisplayObject.prototype.updateTransform.call( this ); - - if(this._cacheAsBitmap)return; - - for(var i=0,j=this.children.length; i childMaxX ? maxX : childMaxX; - maxY = maxY > childMaxY ? maxY : childMaxY; - } - - if(!childVisible) - return PIXI.EmptyRectangle; - - var bounds = this._bounds; - - bounds.x = minX; - bounds.y = minY; - bounds.width = maxX - minX; - bounds.height = maxY - minY; - - // TODO: store a reference so that if this function gets called again in the render cycle we do not have to recalculate - //this._currentBounds = bounds; - - return bounds; -}; - -/** - * Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration. - * - * @method getLocalBounds - * @return {Rectangle} The rectangular bounding area - */ -PIXI.DisplayObjectContainer.prototype.getLocalBounds = function() -{ - var matrixCache = this.worldTransform; - - this.worldTransform = PIXI.identityMatrix; - - for(var i=0,j=this.children.length; i= this.textures.length) - { - this.gotoAndStop(this.textures.length - 1); - if(this.onComplete) - { - this.onComplete(); - } - } -}; - -/** - * A short hand way of creating a movieclip from an array of frame ids - * - * @static - * @method fromFrames - * @param frames {Array} the array of frames ids the movieclip will use as its texture frames - * @return {MovieClip} - */ -PIXI.MovieClip.fromFrames = function(frames) -{ - var textures = []; - - for (var i = 0; i < frames.length; i++) - { - textures.push(new PIXI.Texture.fromFrame(frames[i])); - } - - return new PIXI.MovieClip(textures); -}; - -/** - * A short hand way of creating a movieclip from an array of image ids - * - * @static - * @method fromImages - * @param frames {Array} the array of image ids the movieclip will use as its texture frames - * @return {MovieClip} - */ -PIXI.MovieClip.fromImages = function(images) -{ - var textures = []; - - for (var i = 0; i < images.length; i++) - { - textures.push(new PIXI.Texture.fromImage(images[i])); - } - - return new PIXI.MovieClip(textures); -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/display/Sprite.js b/tutorial-3/pixi.js-master/src/pixi/display/Sprite.js deleted file mode 100755 index aab559a..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/display/Sprite.js +++ /dev/null @@ -1,471 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Sprite object is the base for all textured objects that are rendered to the screen - * - * @class Sprite - * @extends DisplayObjectContainer - * @constructor - * @param texture {Texture} The texture for this sprite - * - * A sprite can be created directly from an image like this : - * var sprite = new PIXI.Sprite.fromImage('assets/image.png'); - * yourStage.addChild(sprite); - * then obviously don't forget to add it to the stage you have already created - */ -PIXI.Sprite = function(texture) -{ - PIXI.DisplayObjectContainer.call( this ); - - /** - * The anchor sets the origin point of the texture. - * The default is 0,0 this means the texture's origin is the top left - * Setting than anchor to 0.5,0.5 means the textures origin is centered - * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner - * - * @property anchor - * @type Point - */ - this.anchor = new PIXI.Point(); - - /** - * The texture that the sprite is using - * - * @property texture - * @type Texture - */ - this.texture = texture || PIXI.Texture.emptyTexture; - - /** - * The width of the sprite (this is initially set by the texture) - * - * @property _width - * @type Number - * @private - */ - this._width = 0; - - /** - * The height of the sprite (this is initially set by the texture) - * - * @property _height - * @type Number - * @private - */ - this._height = 0; - - /** - * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. - * - * @property tint - * @type Number - * @default 0xFFFFFF - */ - this.tint = 0xFFFFFF; - - /** - * The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode. - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - /** - * The shader that will be used to render the texture to the stage. Set to null to remove a current shader. - * - * @property shader - * @type AbstractFilter - * @default null - */ - this.shader = null; - - if(this.texture.baseTexture.hasLoaded) - { - this.onTextureUpdate(); - } - else - { - this.texture.on( 'update', this.onTextureUpdate.bind(this) ); - } - - this.renderable = true; - -}; - -// constructor -PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); -PIXI.Sprite.prototype.constructor = PIXI.Sprite; - -/** - * The width of the sprite, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.Sprite.prototype, 'width', { - get: function() { - return this.scale.x * this.texture.frame.width; - }, - set: function(value) { - this.scale.x = value / this.texture.frame.width; - this._width = value; - } -}); - -/** - * The height of the sprite, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.Sprite.prototype, 'height', { - get: function() { - return this.scale.y * this.texture.frame.height; - }, - set: function(value) { - this.scale.y = value / this.texture.frame.height; - this._height = value; - } -}); - -/** - * Sets the texture of the sprite - * - * @method setTexture - * @param texture {Texture} The PIXI texture that is displayed by the sprite - */ -PIXI.Sprite.prototype.setTexture = function(texture) -{ - this.texture = texture; - this.cachedTint = 0xFFFFFF; -}; - -/** - * When the texture is updated, this event will fire to update the scale and frame - * - * @method onTextureUpdate - * @param event - * @private - */ -PIXI.Sprite.prototype.onTextureUpdate = function() -{ - // so if _width is 0 then width was not set.. - if(this._width)this.scale.x = this._width / this.texture.frame.width; - if(this._height)this.scale.y = this._height / this.texture.frame.height; - - //this.updateFrame = true; -}; - -/** -* Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. -* -* @method getBounds -* @param matrix {Matrix} the transformation matrix of the sprite -* @return {Rectangle} the framing rectangle -*/ -PIXI.Sprite.prototype.getBounds = function(matrix) -{ - var width = this.texture.frame.width; - var height = this.texture.frame.height; - - var w0 = width * (1-this.anchor.x); - var w1 = width * -this.anchor.x; - - var h0 = height * (1-this.anchor.y); - var h1 = height * -this.anchor.y; - - var worldTransform = matrix || this.worldTransform ; - - var a = worldTransform.a; - var b = worldTransform.b; - var c = worldTransform.c; - var d = worldTransform.d; - var tx = worldTransform.tx; - var ty = worldTransform.ty; - - var maxX = -Infinity; - var maxY = -Infinity; - - var minX = Infinity; - var minY = Infinity; - - if(b === 0 && c === 0) - { - // scale may be negative! - if(a < 0)a *= -1; - if(d < 0)d *= -1; - - // this means there is no rotation going on right? RIGHT? - // if thats the case then we can avoid checking the bound values! yay - minX = a * w1 + tx; - maxX = a * w0 + tx; - minY = d * h1 + ty; - maxY = d * h0 + ty; - } - else - { - var x1 = a * w1 + c * h1 + tx; - var y1 = d * h1 + b * w1 + ty; - - var x2 = a * w0 + c * h1 + tx; - var y2 = d * h1 + b * w0 + ty; - - var x3 = a * w0 + c * h0 + tx; - var y3 = d * h0 + b * w0 + ty; - - var x4 = a * w1 + c * h0 + tx; - var y4 = d * h0 + b * w1 + ty; - - minX = x1 < minX ? x1 : minX; - minX = x2 < minX ? x2 : minX; - minX = x3 < minX ? x3 : minX; - minX = x4 < minX ? x4 : minX; - - minY = y1 < minY ? y1 : minY; - minY = y2 < minY ? y2 : minY; - minY = y3 < minY ? y3 : minY; - minY = y4 < minY ? y4 : minY; - - maxX = x1 > maxX ? x1 : maxX; - maxX = x2 > maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y1 > maxY ? y1 : maxY; - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - } - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Sprite.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(!this.visible || this.alpha <= 0)return; - - var i,j; - - // do a quick check to see if this element has a mask or a filter. - if(this._mask || this._filters) - { - var spriteBatch = renderSession.spriteBatch; - - // push filter first as we need to ensure the stencil buffer is correct for any masking - if(this._filters) - { - spriteBatch.flush(); - renderSession.filterManager.pushFilter(this._filterBlock); - } - - if(this._mask) - { - spriteBatch.stop(); - renderSession.maskManager.pushMask(this.mask, renderSession); - spriteBatch.start(); - } - - // add this sprite to the batch - spriteBatch.render(this); - - // now loop through the children and make sure they get rendered - for(i=0,j=this.children.length; i 1) ratio = 1; - - perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y); - num = this.texture.height / 2; //(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio; - perp.x /= perpLength; - perp.y /= perpLength; - - perp.x *= num; - perp.y *= num; - - vertices[index] = point.x + perp.x; - vertices[index+1] = point.y + perp.y; - vertices[index+2] = point.x - perp.x; - vertices[index+3] = point.y - perp.y; - - lastPoint = point; - } - - PIXI.DisplayObjectContainer.prototype.updateTransform.call( this ); -}; -/* - * Sets the texture that the Rope will use - * - * @method setTexture - * @param texture {Texture} the texture that will be used - */ -PIXI.Rope.prototype.setTexture = function(texture) -{ - // stop current texture - this.texture = texture; - //this.updateFrame = true; -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/extras/SPINE-LICENSE b/tutorial-3/pixi.js-master/src/pixi/extras/SPINE-LICENSE deleted file mode 100755 index 7bb7566..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/extras/SPINE-LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Spine Runtimes Software License -Version 2.1 - -Copyright (c) 2013, Esoteric Software -All rights reserved. - -You are granted a perpetual, non-exclusive, non-sublicensable and -non-transferable license to install, execute and perform the Spine Runtimes -Software (the "Software") solely for internal use. Without the written -permission of Esoteric Software (typically granted by licensing Spine), you -may not (a) modify, translate, adapt or otherwise create derivative works, -improvements of the Software or develop new applications using the Software -or (b) remove, delete, alter or obscure any trademarks or any copyright, -trademark, patent or other intellectual property or proprietary rights notices -on or in the Software, including any copy thereof. Redistributions in binary -or source form must include this license and terms. - -THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tutorial-3/pixi.js-master/src/pixi/extras/Spine.js b/tutorial-3/pixi.js-master/src/pixi/extras/Spine.js deleted file mode 100755 index 06ce610..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/extras/Spine.js +++ /dev/null @@ -1,2626 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License - * Version 2.1 - * - * Copyright (c) 2013, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable and - * non-transferable license to install, execute and perform the Spine Runtimes - * Software (the "Software") solely for internal use. Without the written - * permission of Esoteric Software (typically granted by licensing Spine), you - * may not (a) modify, translate, adapt or otherwise create derivative works, - * improvements of the Software or develop new applications using the Software - * or (b) remove, delete, alter or obscure any trademarks or any copyright, - * trademark, patent or other intellectual property or proprietary rights - * notices on or in the Software, including any copy thereof. Redistributions - * in binary or source form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -var spine = { - radDeg: 180 / Math.PI, - degRad: Math.PI / 180, - temp: [], - Float32Array: (typeof(Float32Array) === 'undefined') ? Array : Float32Array, - Uint16Array: (typeof(Uint16Array) === 'undefined') ? Array : Uint16Array -}; - -spine.BoneData = function (name, parent) { - this.name = name; - this.parent = parent; -}; -spine.BoneData.prototype = { - length: 0, - x: 0, y: 0, - rotation: 0, - scaleX: 1, scaleY: 1, - inheritScale: true, - inheritRotation: true, - flipX: false, flipY: false -}; - -spine.SlotData = function (name, boneData) { - this.name = name; - this.boneData = boneData; -}; -spine.SlotData.prototype = { - r: 1, g: 1, b: 1, a: 1, - attachmentName: null, - additiveBlending: false -}; - -spine.IkConstraintData = function (name) { - this.name = name; - this.bones = []; -}; -spine.IkConstraintData.prototype = { - target: null, - bendDirection: 1, - mix: 1 -}; - -spine.Bone = function (boneData, skeleton, parent) { - this.data = boneData; - this.skeleton = skeleton; - this.parent = parent; - this.setToSetupPose(); -}; -spine.Bone.yDown = false; -spine.Bone.prototype = { - x: 0, y: 0, - rotation: 0, rotationIK: 0, - scaleX: 1, scaleY: 1, - flipX: false, flipY: false, - m00: 0, m01: 0, worldX: 0, // a b x - m10: 0, m11: 0, worldY: 0, // c d y - worldRotation: 0, - worldScaleX: 1, worldScaleY: 1, - worldFlipX: false, worldFlipY: false, - updateWorldTransform: function () { - var parent = this.parent; - if (parent) { - this.worldX = this.x * parent.m00 + this.y * parent.m01 + parent.worldX; - this.worldY = this.x * parent.m10 + this.y * parent.m11 + parent.worldY; - if (this.data.inheritScale) { - this.worldScaleX = parent.worldScaleX * this.scaleX; - this.worldScaleY = parent.worldScaleY * this.scaleY; - } else { - this.worldScaleX = this.scaleX; - this.worldScaleY = this.scaleY; - } - this.worldRotation = this.data.inheritRotation ? (parent.worldRotation + this.rotationIK) : this.rotationIK; - this.worldFlipX = parent.worldFlipX != this.flipX; - this.worldFlipY = parent.worldFlipY != this.flipY; - } else { - var skeletonFlipX = this.skeleton.flipX, skeletonFlipY = this.skeleton.flipY; - this.worldX = skeletonFlipX ? -this.x : this.x; - this.worldY = (skeletonFlipY != spine.Bone.yDown) ? -this.y : this.y; - this.worldScaleX = this.scaleX; - this.worldScaleY = this.scaleY; - this.worldRotation = this.rotationIK; - this.worldFlipX = skeletonFlipX != this.flipX; - this.worldFlipY = skeletonFlipY != this.flipY; - } - var radians = this.worldRotation * spine.degRad; - var cos = Math.cos(radians); - var sin = Math.sin(radians); - if (this.worldFlipX) { - this.m00 = -cos * this.worldScaleX; - this.m01 = sin * this.worldScaleY; - } else { - this.m00 = cos * this.worldScaleX; - this.m01 = -sin * this.worldScaleY; - } - if (this.worldFlipY != spine.Bone.yDown) { - this.m10 = -sin * this.worldScaleX; - this.m11 = -cos * this.worldScaleY; - } else { - this.m10 = sin * this.worldScaleX; - this.m11 = cos * this.worldScaleY; - } - }, - setToSetupPose: function () { - var data = this.data; - this.x = data.x; - this.y = data.y; - this.rotation = data.rotation; - this.rotationIK = this.rotation; - this.scaleX = data.scaleX; - this.scaleY = data.scaleY; - this.flipX = data.flipX; - this.flipY = data.flipY; - }, - worldToLocal: function (world) { - var dx = world[0] - this.worldX, dy = world[1] - this.worldY; - var m00 = this.m00, m10 = this.m10, m01 = this.m01, m11 = this.m11; - if (this.worldFlipX != (this.worldFlipY != spine.Bone.yDown)) { - m00 = -m00; - m11 = -m11; - } - var invDet = 1 / (m00 * m11 - m01 * m10); - world[0] = dx * m00 * invDet - dy * m01 * invDet; - world[1] = dy * m11 * invDet - dx * m10 * invDet; - }, - localToWorld: function (local) { - var localX = local[0], localY = local[1]; - local[0] = localX * this.m00 + localY * this.m01 + this.worldX; - local[1] = localX * this.m10 + localY * this.m11 + this.worldY; - } -}; - -spine.Slot = function (slotData, bone) { - this.data = slotData; - this.bone = bone; - this.setToSetupPose(); -}; -spine.Slot.prototype = { - r: 1, g: 1, b: 1, a: 1, - _attachmentTime: 0, - attachment: null, - attachmentVertices: [], - setAttachment: function (attachment) { - this.attachment = attachment; - this._attachmentTime = this.bone.skeleton.time; - this.attachmentVertices.length = 0; - }, - setAttachmentTime: function (time) { - this._attachmentTime = this.bone.skeleton.time - time; - }, - getAttachmentTime: function () { - return this.bone.skeleton.time - this._attachmentTime; - }, - setToSetupPose: function () { - var data = this.data; - this.r = data.r; - this.g = data.g; - this.b = data.b; - this.a = data.a; - - var slotDatas = this.bone.skeleton.data.slots; - for (var i = 0, n = slotDatas.length; i < n; i++) { - if (slotDatas[i] == data) { - this.setAttachment(!data.attachmentName ? null : this.bone.skeleton.getAttachmentBySlotIndex(i, data.attachmentName)); - break; - } - } - } -}; - -spine.IkConstraint = function (data, skeleton) { - this.data = data; - this.mix = data.mix; - this.bendDirection = data.bendDirection; - - this.bones = []; - for (var i = 0, n = data.bones.length; i < n; i++) - this.bones.push(skeleton.findBone(data.bones[i].name)); - this.target = skeleton.findBone(data.target.name); -}; -spine.IkConstraint.prototype = { - apply: function () { - var target = this.target; - var bones = this.bones; - switch (bones.length) { - case 1: - spine.IkConstraint.apply1(bones[0], target.worldX, target.worldY, this.mix); - break; - case 2: - spine.IkConstraint.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.mix); - break; - } - } -}; -/** Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified in the world - * coordinate system. */ -spine.IkConstraint.apply1 = function (bone, targetX, targetY, alpha) { - var parentRotation = (!bone.data.inheritRotation || !bone.parent) ? 0 : bone.parent.worldRotation; - var rotation = bone.rotation; - var rotationIK = Math.atan2(targetY - bone.worldY, targetX - bone.worldX) * spine.radDeg - parentRotation; - bone.rotationIK = rotation + (rotationIK - rotation) * alpha; -}; -/** Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as possible. The - * target is specified in the world coordinate system. - * @param child Any descendant bone of the parent. */ -spine.IkConstraint.apply2 = function (parent, child, targetX, targetY, bendDirection, alpha) { - var childRotation = child.rotation, parentRotation = parent.rotation; - if (!alpha) { - child.rotationIK = childRotation; - parent.rotationIK = parentRotation; - return; - } - var positionX, positionY, tempPosition = spine.temp; - var parentParent = parent.parent; - if (parentParent) { - tempPosition[0] = targetX; - tempPosition[1] = targetY; - parentParent.worldToLocal(tempPosition); - targetX = (tempPosition[0] - parent.x) * parentParent.worldScaleX; - targetY = (tempPosition[1] - parent.y) * parentParent.worldScaleY; - } else { - targetX -= parent.x; - targetY -= parent.y; - } - if (child.parent == parent) { - positionX = child.x; - positionY = child.y; - } else { - tempPosition[0] = child.x; - tempPosition[1] = child.y; - child.parent.localToWorld(tempPosition); - parent.worldToLocal(tempPosition); - positionX = tempPosition[0]; - positionY = tempPosition[1]; - } - var childX = positionX * parent.worldScaleX, childY = positionY * parent.worldScaleY; - var offset = Math.atan2(childY, childX); - var len1 = Math.sqrt(childX * childX + childY * childY), len2 = child.data.length * child.worldScaleX; - // Based on code by Ryan Juckett with permission: Copyright (c) 2008-2009 Ryan Juckett, http://www.ryanjuckett.com/ - var cosDenom = 2 * len1 * len2; - if (cosDenom < 0.0001) { - child.rotationIK = childRotation + (Math.atan2(targetY, targetX) * spine.radDeg - parentRotation - childRotation) * alpha; - return; - } - var cos = (targetX * targetX + targetY * targetY - len1 * len1 - len2 * len2) / cosDenom; - if (cos < -1) - cos = -1; - else if (cos > 1) - cos = 1; - var childAngle = Math.acos(cos) * bendDirection; - var adjacent = len1 + len2 * cos, opposite = len2 * Math.sin(childAngle); - var parentAngle = Math.atan2(targetY * adjacent - targetX * opposite, targetX * adjacent + targetY * opposite); - var rotation = (parentAngle - offset) * spine.radDeg - parentRotation; - if (rotation > 180) - rotation -= 360; - else if (rotation < -180) // - rotation += 360; - parent.rotationIK = parentRotation + rotation * alpha; - rotation = (childAngle + offset) * spine.radDeg - childRotation; - if (rotation > 180) - rotation -= 360; - else if (rotation < -180) // - rotation += 360; - child.rotationIK = childRotation + (rotation + parent.worldRotation - child.parent.worldRotation) * alpha; -}; - -spine.Skin = function (name) { - this.name = name; - this.attachments = {}; -}; -spine.Skin.prototype = { - addAttachment: function (slotIndex, name, attachment) { - this.attachments[slotIndex + ":" + name] = attachment; - }, - getAttachment: function (slotIndex, name) { - return this.attachments[slotIndex + ":" + name]; - }, - _attachAll: function (skeleton, oldSkin) { - for (var key in oldSkin.attachments) { - var colon = key.indexOf(":"); - var slotIndex = parseInt(key.substring(0, colon)); - var name = key.substring(colon + 1); - var slot = skeleton.slots[slotIndex]; - if (slot.attachment && slot.attachment.name == name) { - var attachment = this.getAttachment(slotIndex, name); - if (attachment) slot.setAttachment(attachment); - } - } - } -}; - -spine.Animation = function (name, timelines, duration) { - this.name = name; - this.timelines = timelines; - this.duration = duration; -}; -spine.Animation.prototype = { - apply: function (skeleton, lastTime, time, loop, events) { - if (loop && this.duration != 0) { - time %= this.duration; - lastTime %= this.duration; - } - var timelines = this.timelines; - for (var i = 0, n = timelines.length; i < n; i++) - timelines[i].apply(skeleton, lastTime, time, events, 1); - }, - mix: function (skeleton, lastTime, time, loop, events, alpha) { - if (loop && this.duration != 0) { - time %= this.duration; - lastTime %= this.duration; - } - var timelines = this.timelines; - for (var i = 0, n = timelines.length; i < n; i++) - timelines[i].apply(skeleton, lastTime, time, events, alpha); - } -}; -spine.Animation.binarySearch = function (values, target, step) { - var low = 0; - var high = Math.floor(values.length / step) - 2; - if (!high) return step; - var current = high >>> 1; - while (true) { - if (values[(current + 1) * step] <= target) - low = current + 1; - else - high = current; - if (low == high) return (low + 1) * step; - current = (low + high) >>> 1; - } -}; -spine.Animation.binarySearch1 = function (values, target) { - var low = 0; - var high = values.length - 2; - if (!high) return 1; - var current = high >>> 1; - while (true) { - if (values[current + 1] <= target) - low = current + 1; - else - high = current; - if (low == high) return low + 1; - current = (low + high) >>> 1; - } -}; -spine.Animation.linearSearch = function (values, target, step) { - for (var i = 0, last = values.length - step; i <= last; i += step) - if (values[i] > target) return i; - return -1; -}; - -spine.Curves = function (frameCount) { - this.curves = []; // type, x, y, ... - //this.curves.length = (frameCount - 1) * 19/*BEZIER_SIZE*/; -}; -spine.Curves.prototype = { - setLinear: function (frameIndex) { - this.curves[frameIndex * 19/*BEZIER_SIZE*/] = 0/*LINEAR*/; - }, - setStepped: function (frameIndex) { - this.curves[frameIndex * 19/*BEZIER_SIZE*/] = 1/*STEPPED*/; - }, - /** Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next. - * cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of - * the difference between the keyframe's values. */ - setCurve: function (frameIndex, cx1, cy1, cx2, cy2) { - var subdiv1 = 1 / 10/*BEZIER_SEGMENTS*/, subdiv2 = subdiv1 * subdiv1, subdiv3 = subdiv2 * subdiv1; - var pre1 = 3 * subdiv1, pre2 = 3 * subdiv2, pre4 = 6 * subdiv2, pre5 = 6 * subdiv3; - var tmp1x = -cx1 * 2 + cx2, tmp1y = -cy1 * 2 + cy2, tmp2x = (cx1 - cx2) * 3 + 1, tmp2y = (cy1 - cy2) * 3 + 1; - var dfx = cx1 * pre1 + tmp1x * pre2 + tmp2x * subdiv3, dfy = cy1 * pre1 + tmp1y * pre2 + tmp2y * subdiv3; - var ddfx = tmp1x * pre4 + tmp2x * pre5, ddfy = tmp1y * pre4 + tmp2y * pre5; - var dddfx = tmp2x * pre5, dddfy = tmp2y * pre5; - - var i = frameIndex * 19/*BEZIER_SIZE*/; - var curves = this.curves; - curves[i++] = 2/*BEZIER*/; - - var x = dfx, y = dfy; - for (var n = i + 19/*BEZIER_SIZE*/ - 1; i < n; i += 2) { - curves[i] = x; - curves[i + 1] = y; - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - x += dfx; - y += dfy; - } - }, - getCurvePercent: function (frameIndex, percent) { - percent = percent < 0 ? 0 : (percent > 1 ? 1 : percent); - var curves = this.curves; - var i = frameIndex * 19/*BEZIER_SIZE*/; - var type = curves[i]; - if (type === 0/*LINEAR*/) return percent; - if (type == 1/*STEPPED*/) return 0; - i++; - var x = 0; - for (var start = i, n = i + 19/*BEZIER_SIZE*/ - 1; i < n; i += 2) { - x = curves[i]; - if (x >= percent) { - var prevX, prevY; - if (i == start) { - prevX = 0; - prevY = 0; - } else { - prevX = curves[i - 2]; - prevY = curves[i - 1]; - } - return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX); - } - } - var y = curves[i - 1]; - return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1. - } -}; - -spine.RotateTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, angle, ... - this.frames.length = frameCount * 2; -}; -spine.RotateTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, angle) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = angle; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 2]) { // Time is after last frame. - var amount = bone.data.rotation + frames[frames.length - 1] - bone.rotation; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - bone.rotation += amount * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 2); - var prevFrameValue = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 2/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 2 - 1, percent); - - var amount = frames[frameIndex + 1/*FRAME_VALUE*/] - prevFrameValue; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - amount = bone.data.rotation + (prevFrameValue + amount * percent) - bone.rotation; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - bone.rotation += amount * alpha; - } -}; - -spine.TranslateTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, x, y, ... - this.frames.length = frameCount * 3; -}; -spine.TranslateTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, x, y) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = x; - this.frames[frameIndex + 2] = y; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - bone.x += (bone.data.x + frames[frames.length - 2] - bone.x) * alpha; - bone.y += (bone.data.y + frames[frames.length - 1] - bone.y) * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameX = frames[frameIndex - 2]; - var prevFrameY = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - bone.x += (bone.data.x + prevFrameX + (frames[frameIndex + 1/*FRAME_X*/] - prevFrameX) * percent - bone.x) * alpha; - bone.y += (bone.data.y + prevFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - prevFrameY) * percent - bone.y) * alpha; - } -}; - -spine.ScaleTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, x, y, ... - this.frames.length = frameCount * 3; -}; -spine.ScaleTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, x, y) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = x; - this.frames[frameIndex + 2] = y; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - bone.scaleX += (bone.data.scaleX * frames[frames.length - 2] - bone.scaleX) * alpha; - bone.scaleY += (bone.data.scaleY * frames[frames.length - 1] - bone.scaleY) * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameX = frames[frameIndex - 2]; - var prevFrameY = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - bone.scaleX += (bone.data.scaleX * (prevFrameX + (frames[frameIndex + 1/*FRAME_X*/] - prevFrameX) * percent) - bone.scaleX) * alpha; - bone.scaleY += (bone.data.scaleY * (prevFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - prevFrameY) * percent) - bone.scaleY) * alpha; - } -}; - -spine.ColorTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, r, g, b, a, ... - this.frames.length = frameCount * 5; -}; -spine.ColorTimeline.prototype = { - slotIndex: 0, - getFrameCount: function () { - return this.frames.length / 5; - }, - setFrame: function (frameIndex, time, r, g, b, a) { - frameIndex *= 5; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = r; - this.frames[frameIndex + 2] = g; - this.frames[frameIndex + 3] = b; - this.frames[frameIndex + 4] = a; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var r, g, b, a; - if (time >= frames[frames.length - 5]) { - // Time is after last frame. - var i = frames.length - 1; - r = frames[i - 3]; - g = frames[i - 2]; - b = frames[i - 1]; - a = frames[i]; - } else { - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 5); - var prevFrameR = frames[frameIndex - 4]; - var prevFrameG = frames[frameIndex - 3]; - var prevFrameB = frames[frameIndex - 2]; - var prevFrameA = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 5/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 5 - 1, percent); - - r = prevFrameR + (frames[frameIndex + 1/*FRAME_R*/] - prevFrameR) * percent; - g = prevFrameG + (frames[frameIndex + 2/*FRAME_G*/] - prevFrameG) * percent; - b = prevFrameB + (frames[frameIndex + 3/*FRAME_B*/] - prevFrameB) * percent; - a = prevFrameA + (frames[frameIndex + 4/*FRAME_A*/] - prevFrameA) * percent; - } - var slot = skeleton.slots[this.slotIndex]; - if (alpha < 1) { - slot.r += (r - slot.r) * alpha; - slot.g += (g - slot.g) * alpha; - slot.b += (b - slot.b) * alpha; - slot.a += (a - slot.a) * alpha; - } else { - slot.r = r; - slot.g = g; - slot.b = b; - slot.a = a; - } - } -}; - -spine.AttachmentTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, ... - this.frames.length = frameCount; - this.attachmentNames = []; - this.attachmentNames.length = frameCount; -}; -spine.AttachmentTimeline.prototype = { - slotIndex: 0, - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, attachmentName) { - this.frames[frameIndex] = time; - this.attachmentNames[frameIndex] = attachmentName; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - - var frameIndex = time >= frames[frames.length - 1] ? frames.length - 1 : spine.Animation.binarySearch1(frames, time) - 1; - if (frames[frameIndex] < lastTime) return; - - var attachmentName = this.attachmentNames[frameIndex]; - skeleton.slots[this.slotIndex].setAttachment( - !attachmentName ? null : skeleton.getAttachmentBySlotIndex(this.slotIndex, attachmentName)); - } -}; - -spine.EventTimeline = function (frameCount) { - this.frames = []; // time, ... - this.frames.length = frameCount; - this.events = []; - this.events.length = frameCount; -}; -spine.EventTimeline.prototype = { - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, event) { - this.frames[frameIndex] = time; - this.events[frameIndex] = event; - }, - /** Fires events for frames > lastTime and <= time. */ - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - if (!firedEvents) return; - - var frames = this.frames; - var frameCount = frames.length; - - if (lastTime > time) { // Fire events after last time for looped animations. - this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha); - lastTime = -1; - } else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame. - return; - if (time < frames[0]) return; // Time is before first frame. - - var frameIndex; - if (lastTime < frames[0]) - frameIndex = 0; - else { - frameIndex = spine.Animation.binarySearch1(frames, lastTime); - var frame = frames[frameIndex]; - while (frameIndex > 0) { // Fire multiple events with the same frame. - if (frames[frameIndex - 1] != frame) break; - frameIndex--; - } - } - var events = this.events; - for (; frameIndex < frameCount && time >= frames[frameIndex]; frameIndex++) - firedEvents.push(events[frameIndex]); - } -}; - -spine.DrawOrderTimeline = function (frameCount) { - this.frames = []; // time, ... - this.frames.length = frameCount; - this.drawOrders = []; - this.drawOrders.length = frameCount; -}; -spine.DrawOrderTimeline.prototype = { - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, drawOrder) { - this.frames[frameIndex] = time; - this.drawOrders[frameIndex] = drawOrder; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var frameIndex; - if (time >= frames[frames.length - 1]) // Time is after last frame. - frameIndex = frames.length - 1; - else - frameIndex = spine.Animation.binarySearch1(frames, time) - 1; - - var drawOrder = skeleton.drawOrder; - var slots = skeleton.slots; - var drawOrderToSetupIndex = this.drawOrders[frameIndex]; - if (!drawOrderToSetupIndex) { - for (var i = 0, n = slots.length; i < n; i++) - drawOrder[i] = slots[i]; - } else { - for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++) - drawOrder[i] = skeleton.slots[drawOrderToSetupIndex[i]]; - } - - } -}; - -spine.FfdTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; - this.frames.length = frameCount; - this.frameVertices = []; - this.frameVertices.length = frameCount; -}; -spine.FfdTimeline.prototype = { - slotIndex: 0, - attachment: 0, - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, vertices) { - this.frames[frameIndex] = time; - this.frameVertices[frameIndex] = vertices; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var slot = skeleton.slots[this.slotIndex]; - if (slot.attachment != this.attachment) return; - - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var frameVertices = this.frameVertices; - var vertexCount = frameVertices[0].length; - - var vertices = slot.attachmentVertices; - if (vertices.length != vertexCount) alpha = 1; - vertices.length = vertexCount; - - if (time >= frames[frames.length - 1]) { // Time is after last frame. - var lastVertices = frameVertices[frames.length - 1]; - if (alpha < 1) { - for (var i = 0; i < vertexCount; i++) - vertices[i] += (lastVertices[i] - vertices[i]) * alpha; - } else { - for (var i = 0; i < vertexCount; i++) - vertices[i] = lastVertices[i]; - } - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch1(frames, time); - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 1] - frameTime); - percent = this.curves.getCurvePercent(frameIndex - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent)); - - var prevVertices = frameVertices[frameIndex - 1]; - var nextVertices = frameVertices[frameIndex]; - - if (alpha < 1) { - for (var i = 0; i < vertexCount; i++) { - var prev = prevVertices[i]; - vertices[i] += (prev + (nextVertices[i] - prev) * percent - vertices[i]) * alpha; - } - } else { - for (var i = 0; i < vertexCount; i++) { - var prev = prevVertices[i]; - vertices[i] = prev + (nextVertices[i] - prev) * percent; - } - } - } -}; - -spine.IkConstraintTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, mix, bendDirection, ... - this.frames.length = frameCount * 3; -}; -spine.IkConstraintTimeline.prototype = { - ikConstraintIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, mix, bendDirection) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = mix; - this.frames[frameIndex + 2] = bendDirection; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var ikConstraint = skeleton.ikConstraints[this.ikConstraintIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - ikConstraint.mix += (frames[frames.length - 2] - ikConstraint.mix) * alpha; - ikConstraint.bendDirection = frames[frames.length - 1]; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameMix = frames[frameIndex + -2/*PREV_FRAME_MIX*/]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - var mix = prevFrameMix + (frames[frameIndex + 1/*FRAME_MIX*/] - prevFrameMix) * percent; - ikConstraint.mix += (mix - ikConstraint.mix) * alpha; - ikConstraint.bendDirection = frames[frameIndex + -1/*PREV_FRAME_BEND_DIRECTION*/]; - } -}; - -spine.FlipXTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, flip, ... - this.frames.length = frameCount * 2; -}; -spine.FlipXTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, flip) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = flip ? 1 : 0; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - var frameIndex = (time >= frames[frames.length - 2] ? frames.length : spine.Animation.binarySearch(frames, time, 2)) - 2; - if (frames[frameIndex] < lastTime) return; - skeleton.bones[boneIndex].flipX = frames[frameIndex + 1] != 0; - } -}; - -spine.FlipYTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, flip, ... - this.frames.length = frameCount * 2; -}; -spine.FlipYTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, flip) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = flip ? 1 : 0; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - var frameIndex = (time >= frames[frames.length - 2] ? frames.length : spine.Animation.binarySearch(frames, time, 2)) - 2; - if (frames[frameIndex] < lastTime) return; - skeleton.bones[boneIndex].flipY = frames[frameIndex + 1] != 0; - } -}; - -spine.SkeletonData = function () { - this.bones = []; - this.slots = []; - this.skins = []; - this.events = []; - this.animations = []; - this.ikConstraints = []; -}; -spine.SkeletonData.prototype = { - name: null, - defaultSkin: null, - width: 0, height: 0, - version: null, hash: null, - /** @return May be null. */ - findBone: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].name == boneName) return bones[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findBoneIndex: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].name == boneName) return i; - return -1; - }, - /** @return May be null. */ - findSlot: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - if (slots[i].name == slotName) return slot[i]; - } - return null; - }, - /** @return -1 if the bone was not found. */ - findSlotIndex: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].name == slotName) return i; - return -1; - }, - /** @return May be null. */ - findSkin: function (skinName) { - var skins = this.skins; - for (var i = 0, n = skins.length; i < n; i++) - if (skins[i].name == skinName) return skins[i]; - return null; - }, - /** @return May be null. */ - findEvent: function (eventName) { - var events = this.events; - for (var i = 0, n = events.length; i < n; i++) - if (events[i].name == eventName) return events[i]; - return null; - }, - /** @return May be null. */ - findAnimation: function (animationName) { - var animations = this.animations; - for (var i = 0, n = animations.length; i < n; i++) - if (animations[i].name == animationName) return animations[i]; - return null; - }, - /** @return May be null. */ - findIkConstraint: function (ikConstraintName) { - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) - if (ikConstraints[i].name == ikConstraintName) return ikConstraints[i]; - return null; - } -}; - -spine.Skeleton = function (skeletonData) { - this.data = skeletonData; - - this.bones = []; - for (var i = 0, n = skeletonData.bones.length; i < n; i++) { - var boneData = skeletonData.bones[i]; - var parent = !boneData.parent ? null : this.bones[skeletonData.bones.indexOf(boneData.parent)]; - this.bones.push(new spine.Bone(boneData, this, parent)); - } - - this.slots = []; - this.drawOrder = []; - for (var i = 0, n = skeletonData.slots.length; i < n; i++) { - var slotData = skeletonData.slots[i]; - var bone = this.bones[skeletonData.bones.indexOf(slotData.boneData)]; - var slot = new spine.Slot(slotData, bone); - this.slots.push(slot); - this.drawOrder.push(slot); - } - - this.ikConstraints = []; - for (var i = 0, n = skeletonData.ikConstraints.length; i < n; i++) - this.ikConstraints.push(new spine.IkConstraint(skeletonData.ikConstraints[i], this)); - - this.boneCache = []; - this.updateCache(); -}; -spine.Skeleton.prototype = { - x: 0, y: 0, - skin: null, - r: 1, g: 1, b: 1, a: 1, - time: 0, - flipX: false, flipY: false, - /** Caches information about bones and IK constraints. Must be called if bones or IK constraints are added or removed. */ - updateCache: function () { - var ikConstraints = this.ikConstraints; - var ikConstraintsCount = ikConstraints.length; - - var arrayCount = ikConstraintsCount + 1; - var boneCache = this.boneCache; - if (boneCache.length > arrayCount) boneCache.length = arrayCount; - for (var i = 0, n = boneCache.length; i < n; i++) - boneCache[i].length = 0; - while (boneCache.length < arrayCount) - boneCache[boneCache.length] = []; - - var nonIkBones = boneCache[0]; - var bones = this.bones; - - outer: - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - var current = bone; - do { - for (var ii = 0; ii < ikConstraintsCount; ii++) { - var ikConstraint = ikConstraints[ii]; - var parent = ikConstraint.bones[0]; - var child= ikConstraint.bones[ikConstraint.bones.length - 1]; - while (true) { - if (current == child) { - boneCache[ii].push(bone); - boneCache[ii + 1].push(bone); - continue outer; - } - if (child == parent) break; - child = child.parent; - } - } - current = current.parent; - } while (current); - nonIkBones[nonIkBones.length] = bone; - } - }, - /** Updates the world transform for each bone. */ - updateWorldTransform: function () { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - bone.rotationIK = bone.rotation; - } - var i = 0, last = this.boneCache.length - 1; - while (true) { - var cacheBones = this.boneCache[i]; - for (var ii = 0, nn = cacheBones.length; ii < nn; ii++) - cacheBones[ii].updateWorldTransform(); - if (i == last) break; - this.ikConstraints[i].apply(); - i++; - } - }, - /** Sets the bones and slots to their setup pose values. */ - setToSetupPose: function () { - this.setBonesToSetupPose(); - this.setSlotsToSetupPose(); - }, - setBonesToSetupPose: function () { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - bones[i].setToSetupPose(); - - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) { - var ikConstraint = ikConstraints[i]; - ikConstraint.bendDirection = ikConstraint.data.bendDirection; - ikConstraint.mix = ikConstraint.data.mix; - } - }, - setSlotsToSetupPose: function () { - var slots = this.slots; - var drawOrder = this.drawOrder; - for (var i = 0, n = slots.length; i < n; i++) { - drawOrder[i] = slots[i]; - slots[i].setToSetupPose(i); - } - }, - /** @return May return null. */ - getRootBone: function () { - return this.bones.length ? this.bones[0] : null; - }, - /** @return May be null. */ - findBone: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].data.name == boneName) return bones[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findBoneIndex: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].data.name == boneName) return i; - return -1; - }, - /** @return May be null. */ - findSlot: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].data.name == slotName) return slots[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findSlotIndex: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].data.name == slotName) return i; - return -1; - }, - setSkinByName: function (skinName) { - var skin = this.data.findSkin(skinName); - if (!skin) throw "Skin not found: " + skinName; - this.setSkin(skin); - }, - /** Sets the skin used to look up attachments before looking in the {@link SkeletonData#getDefaultSkin() default skin}. - * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was - * no old skin, each slot's setup mode attachment is attached from the new skin. - * @param newSkin May be null. */ - setSkin: function (newSkin) { - if (newSkin) { - if (this.skin) - newSkin._attachAll(this, this.skin); - else { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - var name = slot.data.attachmentName; - if (name) { - var attachment = newSkin.getAttachment(i, name); - if (attachment) slot.setAttachment(attachment); - } - } - } - } - this.skin = newSkin; - }, - /** @return May be null. */ - getAttachmentBySlotName: function (slotName, attachmentName) { - return this.getAttachmentBySlotIndex(this.data.findSlotIndex(slotName), attachmentName); - }, - /** @return May be null. */ - getAttachmentBySlotIndex: function (slotIndex, attachmentName) { - if (this.skin) { - var attachment = this.skin.getAttachment(slotIndex, attachmentName); - if (attachment) return attachment; - } - if (this.data.defaultSkin) return this.data.defaultSkin.getAttachment(slotIndex, attachmentName); - return null; - }, - /** @param attachmentName May be null. */ - setAttachment: function (slotName, attachmentName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - if (slot.data.name == slotName) { - var attachment = null; - if (attachmentName) { - attachment = this.getAttachmentBySlotIndex(i, attachmentName); - if (!attachment) throw "Attachment not found: " + attachmentName + ", for slot: " + slotName; - } - slot.setAttachment(attachment); - return; - } - } - throw "Slot not found: " + slotName; - }, - /** @return May be null. */ - findIkConstraint: function (ikConstraintName) { - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) - if (ikConstraints[i].data.name == ikConstraintName) return ikConstraints[i]; - return null; - }, - update: function (delta) { - this.time += delta; - } -}; - -spine.EventData = function (name) { - this.name = name; -}; -spine.EventData.prototype = { - intValue: 0, - floatValue: 0, - stringValue: null -}; - -spine.Event = function (data) { - this.data = data; -}; -spine.Event.prototype = { - intValue: 0, - floatValue: 0, - stringValue: null -}; - -spine.AttachmentType = { - region: 0, - boundingbox: 1, - mesh: 2, - skinnedmesh: 3 -}; - -spine.RegionAttachment = function (name) { - this.name = name; - this.offset = []; - this.offset.length = 8; - this.uvs = []; - this.uvs.length = 8; -}; -spine.RegionAttachment.prototype = { - type: spine.AttachmentType.region, - x: 0, y: 0, - rotation: 0, - scaleX: 1, scaleY: 1, - width: 0, height: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - setUVs: function (u, v, u2, v2, rotate) { - var uvs = this.uvs; - if (rotate) { - uvs[2/*X2*/] = u; - uvs[3/*Y2*/] = v2; - uvs[4/*X3*/] = u; - uvs[5/*Y3*/] = v; - uvs[6/*X4*/] = u2; - uvs[7/*Y4*/] = v; - uvs[0/*X1*/] = u2; - uvs[1/*Y1*/] = v2; - } else { - uvs[0/*X1*/] = u; - uvs[1/*Y1*/] = v2; - uvs[2/*X2*/] = u; - uvs[3/*Y2*/] = v; - uvs[4/*X3*/] = u2; - uvs[5/*Y3*/] = v; - uvs[6/*X4*/] = u2; - uvs[7/*Y4*/] = v2; - } - }, - updateOffset: function () { - var regionScaleX = this.width / this.regionOriginalWidth * this.scaleX; - var regionScaleY = this.height / this.regionOriginalHeight * this.scaleY; - var localX = -this.width / 2 * this.scaleX + this.regionOffsetX * regionScaleX; - var localY = -this.height / 2 * this.scaleY + this.regionOffsetY * regionScaleY; - var localX2 = localX + this.regionWidth * regionScaleX; - var localY2 = localY + this.regionHeight * regionScaleY; - var radians = this.rotation * spine.degRad; - var cos = Math.cos(radians); - var sin = Math.sin(radians); - var localXCos = localX * cos + this.x; - var localXSin = localX * sin; - var localYCos = localY * cos + this.y; - var localYSin = localY * sin; - var localX2Cos = localX2 * cos + this.x; - var localX2Sin = localX2 * sin; - var localY2Cos = localY2 * cos + this.y; - var localY2Sin = localY2 * sin; - var offset = this.offset; - offset[0/*X1*/] = localXCos - localYSin; - offset[1/*Y1*/] = localYCos + localXSin; - offset[2/*X2*/] = localXCos - localY2Sin; - offset[3/*Y2*/] = localY2Cos + localXSin; - offset[4/*X3*/] = localX2Cos - localY2Sin; - offset[5/*Y3*/] = localY2Cos + localX2Sin; - offset[6/*X4*/] = localX2Cos - localYSin; - offset[7/*Y4*/] = localYCos + localX2Sin; - }, - computeVertices: function (x, y, bone, vertices) { - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var offset = this.offset; - vertices[0/*X1*/] = offset[0/*X1*/] * m00 + offset[1/*Y1*/] * m01 + x; - vertices[1/*Y1*/] = offset[0/*X1*/] * m10 + offset[1/*Y1*/] * m11 + y; - vertices[2/*X2*/] = offset[2/*X2*/] * m00 + offset[3/*Y2*/] * m01 + x; - vertices[3/*Y2*/] = offset[2/*X2*/] * m10 + offset[3/*Y2*/] * m11 + y; - vertices[4/*X3*/] = offset[4/*X3*/] * m00 + offset[5/*X3*/] * m01 + x; - vertices[5/*X3*/] = offset[4/*X3*/] * m10 + offset[5/*X3*/] * m11 + y; - vertices[6/*X4*/] = offset[6/*X4*/] * m00 + offset[7/*Y4*/] * m01 + x; - vertices[7/*Y4*/] = offset[6/*X4*/] * m10 + offset[7/*Y4*/] * m11 + y; - } -}; - -spine.MeshAttachment = function (name) { - this.name = name; -}; -spine.MeshAttachment.prototype = { - type: spine.AttachmentType.mesh, - vertices: null, - uvs: null, - regionUVs: null, - triangles: null, - hullLength: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionU: 0, regionV: 0, regionU2: 0, regionV2: 0, regionRotate: false, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - edges: null, - width: 0, height: 0, - updateUVs: function () { - var width = this.regionU2 - this.regionU, height = this.regionV2 - this.regionV; - var n = this.regionUVs.length; - if (!this.uvs || this.uvs.length != n) { - this.uvs = new spine.Float32Array(n); - } - if (this.regionRotate) { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i + 1] * width; - this.uvs[i + 1] = this.regionV + height - this.regionUVs[i] * height; - } - } else { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i] * width; - this.uvs[i + 1] = this.regionV + this.regionUVs[i + 1] * height; - } - } - }, - computeWorldVertices: function (x, y, slot, worldVertices) { - var bone = slot.bone; - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var vertices = this.vertices; - var verticesCount = vertices.length; - if (slot.attachmentVertices.length == verticesCount) vertices = slot.attachmentVertices; - for (var i = 0; i < verticesCount; i += 2) { - var vx = vertices[i]; - var vy = vertices[i + 1]; - worldVertices[i] = vx * m00 + vy * m01 + x; - worldVertices[i + 1] = vx * m10 + vy * m11 + y; - } - } -}; - -spine.SkinnedMeshAttachment = function (name) { - this.name = name; -}; -spine.SkinnedMeshAttachment.prototype = { - type: spine.AttachmentType.skinnedmesh, - bones: null, - weights: null, - uvs: null, - regionUVs: null, - triangles: null, - hullLength: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionU: 0, regionV: 0, regionU2: 0, regionV2: 0, regionRotate: false, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - edges: null, - width: 0, height: 0, - updateUVs: function (u, v, u2, v2, rotate) { - var width = this.regionU2 - this.regionU, height = this.regionV2 - this.regionV; - var n = this.regionUVs.length; - if (!this.uvs || this.uvs.length != n) { - this.uvs = new spine.Float32Array(n); - } - if (this.regionRotate) { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i + 1] * width; - this.uvs[i + 1] = this.regionV + height - this.regionUVs[i] * height; - } - } else { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i] * width; - this.uvs[i + 1] = this.regionV + this.regionUVs[i + 1] * height; - } - } - }, - computeWorldVertices: function (x, y, slot, worldVertices) { - var skeletonBones = slot.bone.skeleton.bones; - var weights = this.weights; - var bones = this.bones; - - var w = 0, v = 0, b = 0, f = 0, n = bones.length, nn; - var wx, wy, bone, vx, vy, weight; - if (!slot.attachmentVertices.length) { - for (; v < n; w += 2) { - wx = 0; - wy = 0; - nn = bones[v++] + v; - for (; v < nn; v++, b += 3) { - bone = skeletonBones[bones[v]]; - vx = weights[b]; - vy = weights[b + 1]; - weight = weights[b + 2]; - wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight; - wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight; - } - worldVertices[w] = wx + x; - worldVertices[w + 1] = wy + y; - } - } else { - var ffd = slot.attachmentVertices; - for (; v < n; w += 2) { - wx = 0; - wy = 0; - nn = bones[v++] + v; - for (; v < nn; v++, b += 3, f += 2) { - bone = skeletonBones[bones[v]]; - vx = weights[b] + ffd[f]; - vy = weights[b + 1] + ffd[f + 1]; - weight = weights[b + 2]; - wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight; - wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight; - } - worldVertices[w] = wx + x; - worldVertices[w + 1] = wy + y; - } - } - } -}; - -spine.BoundingBoxAttachment = function (name) { - this.name = name; - this.vertices = []; -}; -spine.BoundingBoxAttachment.prototype = { - type: spine.AttachmentType.boundingbox, - computeWorldVertices: function (x, y, bone, worldVertices) { - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var vertices = this.vertices; - for (var i = 0, n = vertices.length; i < n; i += 2) { - var px = vertices[i]; - var py = vertices[i + 1]; - worldVertices[i] = px * m00 + py * m01 + x; - worldVertices[i + 1] = px * m10 + py * m11 + y; - } - } -}; - -spine.AnimationStateData = function (skeletonData) { - this.skeletonData = skeletonData; - this.animationToMixTime = {}; -}; -spine.AnimationStateData.prototype = { - defaultMix: 0, - setMixByName: function (fromName, toName, duration) { - var from = this.skeletonData.findAnimation(fromName); - if (!from) throw "Animation not found: " + fromName; - var to = this.skeletonData.findAnimation(toName); - if (!to) throw "Animation not found: " + toName; - this.setMix(from, to, duration); - }, - setMix: function (from, to, duration) { - this.animationToMixTime[from.name + ":" + to.name] = duration; - }, - getMix: function (from, to) { - var key = from.name + ":" + to.name; - return this.animationToMixTime.hasOwnProperty(key) ? this.animationToMixTime[key] : this.defaultMix; - } -}; - -spine.TrackEntry = function () {}; -spine.TrackEntry.prototype = { - next: null, previous: null, - animation: null, - loop: false, - delay: 0, time: 0, lastTime: -1, endTime: 0, - timeScale: 1, - mixTime: 0, mixDuration: 0, mix: 1, - onStart: null, onEnd: null, onComplete: null, onEvent: null -}; - -spine.AnimationState = function (stateData) { - this.data = stateData; - this.tracks = []; - this.events = []; -}; -spine.AnimationState.prototype = { - onStart: null, - onEnd: null, - onComplete: null, - onEvent: null, - timeScale: 1, - update: function (delta) { - delta *= this.timeScale; - for (var i = 0; i < this.tracks.length; i++) { - var current = this.tracks[i]; - if (!current) continue; - - current.time += delta * current.timeScale; - if (current.previous) { - var previousDelta = delta * current.previous.timeScale; - current.previous.time += previousDelta; - current.mixTime += previousDelta; - } - - var next = current.next; - if (next) { - next.time = current.lastTime - next.delay; - if (next.time >= 0) this.setCurrent(i, next); - } else { - // End non-looping animation when it reaches its end time and there is no next entry. - if (!current.loop && current.lastTime >= current.endTime) this.clearTrack(i); - } - } - }, - apply: function (skeleton) { - for (var i = 0; i < this.tracks.length; i++) { - var current = this.tracks[i]; - if (!current) continue; - - this.events.length = 0; - - var time = current.time; - var lastTime = current.lastTime; - var endTime = current.endTime; - var loop = current.loop; - if (!loop && time > endTime) time = endTime; - - var previous = current.previous; - if (!previous) { - if (current.mix == 1) - current.animation.apply(skeleton, current.lastTime, time, loop, this.events); - else - current.animation.mix(skeleton, current.lastTime, time, loop, this.events, current.mix); - } else { - var previousTime = previous.time; - if (!previous.loop && previousTime > previous.endTime) previousTime = previous.endTime; - previous.animation.apply(skeleton, previousTime, previousTime, previous.loop, null); - - var alpha = current.mixTime / current.mixDuration * current.mix; - if (alpha >= 1) { - alpha = 1; - current.previous = null; - } - current.animation.mix(skeleton, current.lastTime, time, loop, this.events, alpha); - } - - for (var ii = 0, nn = this.events.length; ii < nn; ii++) { - var event = this.events[ii]; - if (current.onEvent) current.onEvent(i, event); - if (this.onEvent) this.onEvent(i, event); - } - - // Check if completed the animation or a loop iteration. - if (loop ? (lastTime % endTime > time % endTime) : (lastTime < endTime && time >= endTime)) { - var count = Math.floor(time / endTime); - if (current.onComplete) current.onComplete(i, count); - if (this.onComplete) this.onComplete(i, count); - } - - current.lastTime = current.time; - } - }, - clearTracks: function () { - for (var i = 0, n = this.tracks.length; i < n; i++) - this.clearTrack(i); - this.tracks.length = 0; - }, - clearTrack: function (trackIndex) { - if (trackIndex >= this.tracks.length) return; - var current = this.tracks[trackIndex]; - if (!current) return; - - if (current.onEnd) current.onEnd(trackIndex); - if (this.onEnd) this.onEnd(trackIndex); - - this.tracks[trackIndex] = null; - }, - _expandToIndex: function (index) { - if (index < this.tracks.length) return this.tracks[index]; - while (index >= this.tracks.length) - this.tracks.push(null); - return null; - }, - setCurrent: function (index, entry) { - var current = this._expandToIndex(index); - if (current) { - var previous = current.previous; - current.previous = null; - - if (current.onEnd) current.onEnd(index); - if (this.onEnd) this.onEnd(index); - - entry.mixDuration = this.data.getMix(current.animation, entry.animation); - if (entry.mixDuration > 0) { - entry.mixTime = 0; - // If a mix is in progress, mix from the closest animation. - if (previous && current.mixTime / current.mixDuration < 0.5) - entry.previous = previous; - else - entry.previous = current; - } - } - - this.tracks[index] = entry; - - if (entry.onStart) entry.onStart(index); - if (this.onStart) this.onStart(index); - }, - setAnimationByName: function (trackIndex, animationName, loop) { - var animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) throw "Animation not found: " + animationName; - return this.setAnimation(trackIndex, animation, loop); - }, - /** Set the current animation. Any queued animations are cleared. */ - setAnimation: function (trackIndex, animation, loop) { - var entry = new spine.TrackEntry(); - entry.animation = animation; - entry.loop = loop; - entry.endTime = animation.duration; - this.setCurrent(trackIndex, entry); - return entry; - }, - addAnimationByName: function (trackIndex, animationName, loop, delay) { - var animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) throw "Animation not found: " + animationName; - return this.addAnimation(trackIndex, animation, loop, delay); - }, - /** Adds an animation to be played delay seconds after the current or last queued animation. - * @param delay May be <= 0 to use duration of previous animation minus any mix duration plus the negative delay. */ - addAnimation: function (trackIndex, animation, loop, delay) { - var entry = new spine.TrackEntry(); - entry.animation = animation; - entry.loop = loop; - entry.endTime = animation.duration; - - var last = this._expandToIndex(trackIndex); - if (last) { - while (last.next) - last = last.next; - last.next = entry; - } else - this.tracks[trackIndex] = entry; - - if (delay <= 0) { - if (last) - delay += last.endTime - this.data.getMix(last.animation, animation); - else - delay = 0; - } - entry.delay = delay; - - return entry; - }, - /** May be null. */ - getCurrent: function (trackIndex) { - if (trackIndex >= this.tracks.length) return null; - return this.tracks[trackIndex]; - } -}; - -spine.SkeletonJson = function (attachmentLoader) { - this.attachmentLoader = attachmentLoader; -}; -spine.SkeletonJson.prototype = { - scale: 1, - readSkeletonData: function (root, name) { - var skeletonData = new spine.SkeletonData(); - skeletonData.name = name; - - // Skeleton. - var skeletonMap = root["skeleton"]; - if (skeletonMap) { - skeletonData.hash = skeletonMap["hash"]; - skeletonData.version = skeletonMap["spine"]; - skeletonData.width = skeletonMap["width"] || 0; - skeletonData.height = skeletonMap["height"] || 0; - } - - // Bones. - var bones = root["bones"]; - for (var i = 0, n = bones.length; i < n; i++) { - var boneMap = bones[i]; - var parent = null; - if (boneMap["parent"]) { - parent = skeletonData.findBone(boneMap["parent"]); - if (!parent) throw "Parent bone not found: " + boneMap["parent"]; - } - var boneData = new spine.BoneData(boneMap["name"], parent); - boneData.length = (boneMap["length"] || 0) * this.scale; - boneData.x = (boneMap["x"] || 0) * this.scale; - boneData.y = (boneMap["y"] || 0) * this.scale; - boneData.rotation = (boneMap["rotation"] || 0); - boneData.scaleX = boneMap.hasOwnProperty("scaleX") ? boneMap["scaleX"] : 1; - boneData.scaleY = boneMap.hasOwnProperty("scaleY") ? boneMap["scaleY"] : 1; - boneData.inheritScale = boneMap.hasOwnProperty("inheritScale") ? boneMap["inheritScale"] : true; - boneData.inheritRotation = boneMap.hasOwnProperty("inheritRotation") ? boneMap["inheritRotation"] : true; - skeletonData.bones.push(boneData); - } - - // IK constraints. - var ik = root["ik"]; - if (ik) { - for (var i = 0, n = ik.length; i < n; i++) { - var ikMap = ik[i]; - var ikConstraintData = new spine.IkConstraintData(ikMap["name"]); - - var bones = ikMap["bones"]; - for (var ii = 0, nn = bones.length; ii < nn; ii++) { - var bone = skeletonData.findBone(bones[ii]); - if (!bone) throw "IK bone not found: " + bones[ii]; - ikConstraintData.bones.push(bone); - } - - ikConstraintData.target = skeletonData.findBone(ikMap["target"]); - if (!ikConstraintData.target) throw "Target bone not found: " + ikMap["target"]; - - ikConstraintData.bendDirection = (!ikMap.hasOwnProperty("bendPositive") || ikMap["bendPositive"]) ? 1 : -1; - ikConstraintData.mix = ikMap.hasOwnProperty("mix") ? ikMap["mix"] : 1; - - skeletonData.ikConstraints.push(ikConstraintData); - } - } - - // Slots. - var slots = root["slots"]; - for (var i = 0, n = slots.length; i < n; i++) { - var slotMap = slots[i]; - var boneData = skeletonData.findBone(slotMap["bone"]); - if (!boneData) throw "Slot bone not found: " + slotMap["bone"]; - var slotData = new spine.SlotData(slotMap["name"], boneData); - - var color = slotMap["color"]; - if (color) { - slotData.r = this.toColor(color, 0); - slotData.g = this.toColor(color, 1); - slotData.b = this.toColor(color, 2); - slotData.a = this.toColor(color, 3); - } - - slotData.attachmentName = slotMap["attachment"]; - slotData.additiveBlending = slotMap["additive"] && slotMap["additive"] == "true"; - - skeletonData.slots.push(slotData); - } - - // Skins. - var skins = root["skins"]; - for (var skinName in skins) { - if (!skins.hasOwnProperty(skinName)) continue; - var skinMap = skins[skinName]; - var skin = new spine.Skin(skinName); - for (var slotName in skinMap) { - if (!skinMap.hasOwnProperty(slotName)) continue; - var slotIndex = skeletonData.findSlotIndex(slotName); - var slotEntry = skinMap[slotName]; - for (var attachmentName in slotEntry) { - if (!slotEntry.hasOwnProperty(attachmentName)) continue; - var attachment = this.readAttachment(skin, attachmentName, slotEntry[attachmentName]); - if (attachment) skin.addAttachment(slotIndex, attachmentName, attachment); - } - } - skeletonData.skins.push(skin); - if (skin.name == "default") skeletonData.defaultSkin = skin; - } - - // Events. - var events = root["events"]; - for (var eventName in events) { - if (!events.hasOwnProperty(eventName)) continue; - var eventMap = events[eventName]; - var eventData = new spine.EventData(eventName); - eventData.intValue = eventMap["int"] || 0; - eventData.floatValue = eventMap["float"] || 0; - eventData.stringValue = eventMap["string"] || null; - skeletonData.events.push(eventData); - } - - // Animations. - var animations = root["animations"]; - for (var animationName in animations) { - if (!animations.hasOwnProperty(animationName)) continue; - this.readAnimation(animationName, animations[animationName], skeletonData); - } - - return skeletonData; - }, - readAttachment: function (skin, name, map) { - name = map["name"] || name; - - var type = spine.AttachmentType[map["type"] || "region"]; - var path = map["path"] || name; - - var scale = this.scale; - if (type == spine.AttachmentType.region) { - var region = this.attachmentLoader.newRegionAttachment(skin, name, path); - if (!region) return null; - region.path = path; - region.x = (map["x"] || 0) * scale; - region.y = (map["y"] || 0) * scale; - region.scaleX = map.hasOwnProperty("scaleX") ? map["scaleX"] : 1; - region.scaleY = map.hasOwnProperty("scaleY") ? map["scaleY"] : 1; - region.rotation = map["rotation"] || 0; - region.width = (map["width"] || 0) * scale; - region.height = (map["height"] || 0) * scale; - - var color = map["color"]; - if (color) { - region.r = this.toColor(color, 0); - region.g = this.toColor(color, 1); - region.b = this.toColor(color, 2); - region.a = this.toColor(color, 3); - } - - region.updateOffset(); - return region; - } else if (type == spine.AttachmentType.mesh) { - var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path); - if (!mesh) return null; - mesh.path = path; - mesh.vertices = this.getFloatArray(map, "vertices", scale); - mesh.triangles = this.getIntArray(map, "triangles"); - mesh.regionUVs = this.getFloatArray(map, "uvs", 1); - mesh.updateUVs(); - - color = map["color"]; - if (color) { - mesh.r = this.toColor(color, 0); - mesh.g = this.toColor(color, 1); - mesh.b = this.toColor(color, 2); - mesh.a = this.toColor(color, 3); - } - - mesh.hullLength = (map["hull"] || 0) * 2; - if (map["edges"]) mesh.edges = this.getIntArray(map, "edges"); - mesh.width = (map["width"] || 0) * scale; - mesh.height = (map["height"] || 0) * scale; - return mesh; - } else if (type == spine.AttachmentType.skinnedmesh) { - var mesh = this.attachmentLoader.newSkinnedMeshAttachment(skin, name, path); - if (!mesh) return null; - mesh.path = path; - - var uvs = this.getFloatArray(map, "uvs", 1); - var vertices = this.getFloatArray(map, "vertices", 1); - var weights = []; - var bones = []; - for (var i = 0, n = vertices.length; i < n; ) { - var boneCount = vertices[i++] | 0; - bones[bones.length] = boneCount; - for (var nn = i + boneCount * 4; i < nn; ) { - bones[bones.length] = vertices[i]; - weights[weights.length] = vertices[i + 1] * scale; - weights[weights.length] = vertices[i + 2] * scale; - weights[weights.length] = vertices[i + 3]; - i += 4; - } - } - mesh.bones = bones; - mesh.weights = weights; - mesh.triangles = this.getIntArray(map, "triangles"); - mesh.regionUVs = uvs; - mesh.updateUVs(); - - color = map["color"]; - if (color) { - mesh.r = this.toColor(color, 0); - mesh.g = this.toColor(color, 1); - mesh.b = this.toColor(color, 2); - mesh.a = this.toColor(color, 3); - } - - mesh.hullLength = (map["hull"] || 0) * 2; - if (map["edges"]) mesh.edges = this.getIntArray(map, "edges"); - mesh.width = (map["width"] || 0) * scale; - mesh.height = (map["height"] || 0) * scale; - return mesh; - } else if (type == spine.AttachmentType.boundingbox) { - var attachment = this.attachmentLoader.newBoundingBoxAttachment(skin, name); - var vertices = map["vertices"]; - for (var i = 0, n = vertices.length; i < n; i++) - attachment.vertices.push(vertices[i] * scale); - return attachment; - } - throw "Unknown attachment type: " + type; - }, - readAnimation: function (name, map, skeletonData) { - var timelines = []; - var duration = 0; - - var slots = map["slots"]; - for (var slotName in slots) { - if (!slots.hasOwnProperty(slotName)) continue; - var slotMap = slots[slotName]; - var slotIndex = skeletonData.findSlotIndex(slotName); - - for (var timelineName in slotMap) { - if (!slotMap.hasOwnProperty(timelineName)) continue; - var values = slotMap[timelineName]; - if (timelineName == "color") { - var timeline = new spine.ColorTimeline(values.length); - timeline.slotIndex = slotIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var color = valueMap["color"]; - var r = this.toColor(color, 0); - var g = this.toColor(color, 1); - var b = this.toColor(color, 2); - var a = this.toColor(color, 3); - timeline.setFrame(frameIndex, valueMap["time"], r, g, b, a); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 5 - 5]); - - } else if (timelineName == "attachment") { - var timeline = new spine.AttachmentTimeline(values.length); - timeline.slotIndex = slotIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex++, valueMap["time"], valueMap["name"]); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - - } else - throw "Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")"; - } - } - - var bones = map["bones"]; - for (var boneName in bones) { - if (!bones.hasOwnProperty(boneName)) continue; - var boneIndex = skeletonData.findBoneIndex(boneName); - if (boneIndex == -1) throw "Bone not found: " + boneName; - var boneMap = bones[boneName]; - - for (var timelineName in boneMap) { - if (!boneMap.hasOwnProperty(timelineName)) continue; - var values = boneMap[timelineName]; - if (timelineName == "rotate") { - var timeline = new spine.RotateTimeline(values.length); - timeline.boneIndex = boneIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex, valueMap["time"], valueMap["angle"]); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 2 - 2]); - - } else if (timelineName == "translate" || timelineName == "scale") { - var timeline; - var timelineScale = 1; - if (timelineName == "scale") - timeline = new spine.ScaleTimeline(values.length); - else { - timeline = new spine.TranslateTimeline(values.length); - timelineScale = this.scale; - } - timeline.boneIndex = boneIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var x = (valueMap["x"] || 0) * timelineScale; - var y = (valueMap["y"] || 0) * timelineScale; - timeline.setFrame(frameIndex, valueMap["time"], x, y); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 3 - 3]); - - } else if (timelineName == "flipX" || timelineName == "flipY") { - var x = timelineName == "flipX"; - var timeline = x ? new spine.FlipXTimeline(values.length) : new spine.FlipYTimeline(values.length); - timeline.boneIndex = boneIndex; - - var field = x ? "x" : "y"; - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex, valueMap["time"], valueMap[field] || false); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 2 - 2]); - } else - throw "Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")"; - } - } - - var ikMap = map["ik"]; - for (var ikConstraintName in ikMap) { - if (!ikMap.hasOwnProperty(ikConstraintName)) continue; - var ikConstraint = skeletonData.findIkConstraint(ikConstraintName); - var values = ikMap[ikConstraintName]; - var timeline = new spine.IkConstraintTimeline(values.length); - timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(ikConstraint); - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var mix = valueMap.hasOwnProperty("mix") ? valueMap["mix"] : 1; - var bendDirection = (!valueMap.hasOwnProperty("bendPositive") || valueMap["bendPositive"]) ? 1 : -1; - timeline.setFrame(frameIndex, valueMap["time"], mix, bendDirection); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.frameCount * 3 - 3]); - } - - var ffd = map["ffd"]; - for (var skinName in ffd) { - var skin = skeletonData.findSkin(skinName); - var slotMap = ffd[skinName]; - for (slotName in slotMap) { - var slotIndex = skeletonData.findSlotIndex(slotName); - var meshMap = slotMap[slotName]; - for (var meshName in meshMap) { - var values = meshMap[meshName]; - var timeline = new spine.FfdTimeline(values.length); - var attachment = skin.getAttachment(slotIndex, meshName); - if (!attachment) throw "FFD attachment not found: " + meshName; - timeline.slotIndex = slotIndex; - timeline.attachment = attachment; - - var isMesh = attachment.type == spine.AttachmentType.mesh; - var vertexCount; - if (isMesh) - vertexCount = attachment.vertices.length; - else - vertexCount = attachment.weights.length / 3 * 2; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var vertices; - if (!valueMap["vertices"]) { - if (isMesh) - vertices = attachment.vertices; - else { - vertices = []; - vertices.length = vertexCount; - } - } else { - var verticesValue = valueMap["vertices"]; - var vertices = []; - vertices.length = vertexCount; - var start = valueMap["offset"] || 0; - var nn = verticesValue.length; - if (this.scale == 1) { - for (var ii = 0; ii < nn; ii++) - vertices[ii + start] = verticesValue[ii]; - } else { - for (var ii = 0; ii < nn; ii++) - vertices[ii + start] = verticesValue[ii] * this.scale; - } - if (isMesh) { - var meshVertices = attachment.vertices; - for (var ii = 0, nn = vertices.length; ii < nn; ii++) - vertices[ii] += meshVertices[ii]; - } - } - - timeline.setFrame(frameIndex, valueMap["time"], vertices); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines[timelines.length] = timeline; - duration = Math.max(duration, timeline.frames[timeline.frameCount - 1]); - } - } - } - - var drawOrderValues = map["drawOrder"]; - if (!drawOrderValues) drawOrderValues = map["draworder"]; - if (drawOrderValues) { - var timeline = new spine.DrawOrderTimeline(drawOrderValues.length); - var slotCount = skeletonData.slots.length; - var frameIndex = 0; - for (var i = 0, n = drawOrderValues.length; i < n; i++) { - var drawOrderMap = drawOrderValues[i]; - var drawOrder = null; - if (drawOrderMap["offsets"]) { - drawOrder = []; - drawOrder.length = slotCount; - for (var ii = slotCount - 1; ii >= 0; ii--) - drawOrder[ii] = -1; - var offsets = drawOrderMap["offsets"]; - var unchanged = []; - unchanged.length = slotCount - offsets.length; - var originalIndex = 0, unchangedIndex = 0; - for (var ii = 0, nn = offsets.length; ii < nn; ii++) { - var offsetMap = offsets[ii]; - var slotIndex = skeletonData.findSlotIndex(offsetMap["slot"]); - if (slotIndex == -1) throw "Slot not found: " + offsetMap["slot"]; - // Collect unchanged items. - while (originalIndex != slotIndex) - unchanged[unchangedIndex++] = originalIndex++; - // Set changed items. - drawOrder[originalIndex + offsetMap["offset"]] = originalIndex++; - } - // Collect remaining unchanged items. - while (originalIndex < slotCount) - unchanged[unchangedIndex++] = originalIndex++; - // Fill in unchanged items. - for (var ii = slotCount - 1; ii >= 0; ii--) - if (drawOrder[ii] == -1) drawOrder[ii] = unchanged[--unchangedIndex]; - } - timeline.setFrame(frameIndex++, drawOrderMap["time"], drawOrder); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - - var events = map["events"]; - if (events) { - var timeline = new spine.EventTimeline(events.length); - var frameIndex = 0; - for (var i = 0, n = events.length; i < n; i++) { - var eventMap = events[i]; - var eventData = skeletonData.findEvent(eventMap["name"]); - if (!eventData) throw "Event not found: " + eventMap["name"]; - var event = new spine.Event(eventData); - event.intValue = eventMap.hasOwnProperty("int") ? eventMap["int"] : eventData.intValue; - event.floatValue = eventMap.hasOwnProperty("float") ? eventMap["float"] : eventData.floatValue; - event.stringValue = eventMap.hasOwnProperty("string") ? eventMap["string"] : eventData.stringValue; - timeline.setFrame(frameIndex++, eventMap["time"], event); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - - skeletonData.animations.push(new spine.Animation(name, timelines, duration)); - }, - readCurve: function (timeline, frameIndex, valueMap) { - var curve = valueMap["curve"]; - if (!curve) - timeline.curves.setLinear(frameIndex); - else if (curve == "stepped") - timeline.curves.setStepped(frameIndex); - else if (curve instanceof Array) - timeline.curves.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]); - }, - toColor: function (hexString, colorIndex) { - if (hexString.length != 8) throw "Color hexidecimal length must be 8, recieved: " + hexString; - return parseInt(hexString.substring(colorIndex * 2, (colorIndex * 2) + 2), 16) / 255; - }, - getFloatArray: function (map, name, scale) { - var list = map[name]; - var values = new spine.Float32Array(list.length); - var i = 0, n = list.length; - if (scale == 1) { - for (; i < n; i++) - values[i] = list[i]; - } else { - for (; i < n; i++) - values[i] = list[i] * scale; - } - return values; - }, - getIntArray: function (map, name) { - var list = map[name]; - var values = new spine.Uint16Array(list.length); - for (var i = 0, n = list.length; i < n; i++) - values[i] = list[i] | 0; - return values; - } -}; - -spine.Atlas = function (atlasText, textureLoader) { - this.textureLoader = textureLoader; - this.pages = []; - this.regions = []; - - var reader = new spine.AtlasReader(atlasText); - var tuple = []; - tuple.length = 4; - var page = null; - while (true) { - var line = reader.readLine(); - if (line === null) break; - line = reader.trim(line); - if (!line.length) - page = null; - else if (!page) { - page = new spine.AtlasPage(); - page.name = line; - - if (reader.readTuple(tuple) == 2) { // size is only optional for an atlas packed with an old TexturePacker. - page.width = parseInt(tuple[0]); - page.height = parseInt(tuple[1]); - reader.readTuple(tuple); - } - page.format = spine.Atlas.Format[tuple[0]]; - - reader.readTuple(tuple); - page.minFilter = spine.Atlas.TextureFilter[tuple[0]]; - page.magFilter = spine.Atlas.TextureFilter[tuple[1]]; - - var direction = reader.readValue(); - page.uWrap = spine.Atlas.TextureWrap.clampToEdge; - page.vWrap = spine.Atlas.TextureWrap.clampToEdge; - if (direction == "x") - page.uWrap = spine.Atlas.TextureWrap.repeat; - else if (direction == "y") - page.vWrap = spine.Atlas.TextureWrap.repeat; - else if (direction == "xy") - page.uWrap = page.vWrap = spine.Atlas.TextureWrap.repeat; - - textureLoader.load(page, line, this); - - this.pages.push(page); - - } else { - var region = new spine.AtlasRegion(); - region.name = line; - region.page = page; - - region.rotate = reader.readValue() == "true"; - - reader.readTuple(tuple); - var x = parseInt(tuple[0]); - var y = parseInt(tuple[1]); - - reader.readTuple(tuple); - var width = parseInt(tuple[0]); - var height = parseInt(tuple[1]); - - region.u = x / page.width; - region.v = y / page.height; - if (region.rotate) { - region.u2 = (x + height) / page.width; - region.v2 = (y + width) / page.height; - } else { - region.u2 = (x + width) / page.width; - region.v2 = (y + height) / page.height; - } - region.x = x; - region.y = y; - region.width = Math.abs(width); - region.height = Math.abs(height); - - if (reader.readTuple(tuple) == 4) { // split is optional - region.splits = [parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3])]; - - if (reader.readTuple(tuple) == 4) { // pad is optional, but only present with splits - region.pads = [parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3])]; - - reader.readTuple(tuple); - } - } - - region.originalWidth = parseInt(tuple[0]); - region.originalHeight = parseInt(tuple[1]); - - reader.readTuple(tuple); - region.offsetX = parseInt(tuple[0]); - region.offsetY = parseInt(tuple[1]); - - region.index = parseInt(reader.readValue()); - - this.regions.push(region); - } - } -}; -spine.Atlas.prototype = { - findRegion: function (name) { - var regions = this.regions; - for (var i = 0, n = regions.length; i < n; i++) - if (regions[i].name == name) return regions[i]; - return null; - }, - dispose: function () { - var pages = this.pages; - for (var i = 0, n = pages.length; i < n; i++) - this.textureLoader.unload(pages[i].rendererObject); - }, - updateUVs: function (page) { - var regions = this.regions; - for (var i = 0, n = regions.length; i < n; i++) { - var region = regions[i]; - if (region.page != page) continue; - region.u = region.x / page.width; - region.v = region.y / page.height; - if (region.rotate) { - region.u2 = (region.x + region.height) / page.width; - region.v2 = (region.y + region.width) / page.height; - } else { - region.u2 = (region.x + region.width) / page.width; - region.v2 = (region.y + region.height) / page.height; - } - } - } -}; - -spine.Atlas.Format = { - alpha: 0, - intensity: 1, - luminanceAlpha: 2, - rgb565: 3, - rgba4444: 4, - rgb888: 5, - rgba8888: 6 -}; - -spine.Atlas.TextureFilter = { - nearest: 0, - linear: 1, - mipMap: 2, - mipMapNearestNearest: 3, - mipMapLinearNearest: 4, - mipMapNearestLinear: 5, - mipMapLinearLinear: 6 -}; - -spine.Atlas.TextureWrap = { - mirroredRepeat: 0, - clampToEdge: 1, - repeat: 2 -}; - -spine.AtlasPage = function () {}; -spine.AtlasPage.prototype = { - name: null, - format: null, - minFilter: null, - magFilter: null, - uWrap: null, - vWrap: null, - rendererObject: null, - width: 0, - height: 0 -}; - -spine.AtlasRegion = function () {}; -spine.AtlasRegion.prototype = { - page: null, - name: null, - x: 0, y: 0, - width: 0, height: 0, - u: 0, v: 0, u2: 0, v2: 0, - offsetX: 0, offsetY: 0, - originalWidth: 0, originalHeight: 0, - index: 0, - rotate: false, - splits: null, - pads: null -}; - -spine.AtlasReader = function (text) { - this.lines = text.split(/\r\n|\r|\n/); -}; -spine.AtlasReader.prototype = { - index: 0, - trim: function (value) { - return value.replace(/^\s+|\s+$/g, ""); - }, - readLine: function () { - if (this.index >= this.lines.length) return null; - return this.lines[this.index++]; - }, - readValue: function () { - var line = this.readLine(); - var colon = line.indexOf(":"); - if (colon == -1) throw "Invalid line: " + line; - return this.trim(line.substring(colon + 1)); - }, - /** Returns the number of tuple values read (1, 2 or 4). */ - readTuple: function (tuple) { - var line = this.readLine(); - var colon = line.indexOf(":"); - if (colon == -1) throw "Invalid line: " + line; - var i = 0, lastMatch = colon + 1; - for (; i < 3; i++) { - var comma = line.indexOf(",", lastMatch); - if (comma == -1) break; - tuple[i] = this.trim(line.substr(lastMatch, comma - lastMatch)); - lastMatch = comma + 1; - } - tuple[i] = this.trim(line.substring(lastMatch)); - return i + 1; - } -}; - -spine.AtlasAttachmentLoader = function (atlas) { - this.atlas = atlas; -}; -spine.AtlasAttachmentLoader.prototype = { - newRegionAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (region attachment: " + name + ")"; - var attachment = new spine.RegionAttachment(name); - attachment.rendererObject = region; - attachment.setUVs(region.u, region.v, region.u2, region.v2, region.rotate); - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newMeshAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (mesh attachment: " + name + ")"; - var attachment = new spine.MeshAttachment(name); - attachment.rendererObject = region; - attachment.regionU = region.u; - attachment.regionV = region.v; - attachment.regionU2 = region.u2; - attachment.regionV2 = region.v2; - attachment.regionRotate = region.rotate; - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newSkinnedMeshAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (skinned mesh attachment: " + name + ")"; - var attachment = new spine.SkinnedMeshAttachment(name); - attachment.rendererObject = region; - attachment.regionU = region.u; - attachment.regionV = region.v; - attachment.regionU2 = region.u2; - attachment.regionV2 = region.v2; - attachment.regionRotate = region.rotate; - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newBoundingBoxAttachment: function (skin, name) { - return new spine.BoundingBoxAttachment(name); - } -}; - -spine.SkeletonBounds = function () { - this.polygonPool = []; - this.polygons = []; - this.boundingBoxes = []; -}; -spine.SkeletonBounds.prototype = { - minX: 0, minY: 0, maxX: 0, maxY: 0, - update: function (skeleton, updateAabb) { - var slots = skeleton.slots; - var slotCount = slots.length; - var x = skeleton.x, y = skeleton.y; - var boundingBoxes = this.boundingBoxes; - var polygonPool = this.polygonPool; - var polygons = this.polygons; - - boundingBoxes.length = 0; - for (var i = 0, n = polygons.length; i < n; i++) - polygonPool.push(polygons[i]); - polygons.length = 0; - - for (var i = 0; i < slotCount; i++) { - var slot = slots[i]; - var boundingBox = slot.attachment; - if (boundingBox.type != spine.AttachmentType.boundingbox) continue; - boundingBoxes.push(boundingBox); - - var poolCount = polygonPool.length, polygon; - if (poolCount > 0) { - polygon = polygonPool[poolCount - 1]; - polygonPool.splice(poolCount - 1, 1); - } else - polygon = []; - polygons.push(polygon); - - polygon.length = boundingBox.vertices.length; - boundingBox.computeWorldVertices(x, y, slot.bone, polygon); - } - - if (updateAabb) this.aabbCompute(); - }, - aabbCompute: function () { - var polygons = this.polygons; - var minX = Number.MAX_VALUE, minY = Number.MAX_VALUE, maxX = Number.MIN_VALUE, maxY = Number.MIN_VALUE; - for (var i = 0, n = polygons.length; i < n; i++) { - var vertices = polygons[i]; - for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) { - var x = vertices[ii]; - var y = vertices[ii + 1]; - minX = Math.min(minX, x); - minY = Math.min(minY, y); - maxX = Math.max(maxX, x); - maxY = Math.max(maxY, y); - } - } - this.minX = minX; - this.minY = minY; - this.maxX = maxX; - this.maxY = maxY; - }, - /** Returns true if the axis aligned bounding box contains the point. */ - aabbContainsPoint: function (x, y) { - return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY; - }, - /** Returns true if the axis aligned bounding box intersects the line segment. */ - aabbIntersectsSegment: function (x1, y1, x2, y2) { - var minX = this.minX, minY = this.minY, maxX = this.maxX, maxY = this.maxY; - if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY)) - return false; - var m = (y2 - y1) / (x2 - x1); - var y = m * (minX - x1) + y1; - if (y > minY && y < maxY) return true; - y = m * (maxX - x1) + y1; - if (y > minY && y < maxY) return true; - var x = (minY - y1) / m + x1; - if (x > minX && x < maxX) return true; - x = (maxY - y1) / m + x1; - if (x > minX && x < maxX) return true; - return false; - }, - /** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */ - aabbIntersectsSkeleton: function (bounds) { - return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY; - }, - /** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more - * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */ - containsPoint: function (x, y) { - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) - if (this.polygonContainsPoint(polygons[i], x, y)) return this.boundingBoxes[i]; - return null; - }, - /** Returns the first bounding box attachment that contains the line segment, or null. When doing many checks, it is usually - * more efficient to only call this method if {@link #aabbIntersectsSegment(float, float, float, float)} returns true. */ - intersectsSegment: function (x1, y1, x2, y2) { - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) - if (polygons[i].intersectsSegment(x1, y1, x2, y2)) return this.boundingBoxes[i]; - return null; - }, - /** Returns true if the polygon contains the point. */ - polygonContainsPoint: function (polygon, x, y) { - var nn = polygon.length; - var prevIndex = nn - 2; - var inside = false; - for (var ii = 0; ii < nn; ii += 2) { - var vertexY = polygon[ii + 1]; - var prevY = polygon[prevIndex + 1]; - if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) { - var vertexX = polygon[ii]; - if (vertexX + (y - vertexY) / (prevY - vertexY) * (polygon[prevIndex] - vertexX) < x) inside = !inside; - } - prevIndex = ii; - } - return inside; - }, - /** Returns true if the polygon contains the line segment. */ - polygonIntersectsSegment: function (polygon, x1, y1, x2, y2) { - var nn = polygon.length; - var width12 = x1 - x2, height12 = y1 - y2; - var det1 = x1 * y2 - y1 * x2; - var x3 = polygon[nn - 2], y3 = polygon[nn - 1]; - for (var ii = 0; ii < nn; ii += 2) { - var x4 = polygon[ii], y4 = polygon[ii + 1]; - var det2 = x3 * y4 - y3 * x4; - var width34 = x3 - x4, height34 = y3 - y4; - var det3 = width12 * height34 - height12 * width34; - var x = (det1 * width34 - width12 * det2) / det3; - if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) { - var y = (det1 * height34 - height12 * det2) / det3; - if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) return true; - } - x3 = x4; - y3 = y4; - } - return false; - }, - getPolygon: function (attachment) { - var index = this.boundingBoxes.indexOf(attachment); - return index == -1 ? null : this.polygons[index]; - }, - getWidth: function () { - return this.maxX - this.minX; - }, - getHeight: function () { - return this.maxY - this.minY; - } -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/extras/Strip.js b/tutorial-3/pixi.js-master/src/pixi/extras/Strip.js deleted file mode 100755 index 6cff5df..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/extras/Strip.js +++ /dev/null @@ -1,469 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ - */ - - /** - * - * @class Strip - * @extends DisplayObjectContainer - * @constructor - * @param texture {Texture} The texture to use - * @param width {Number} the width - * @param height {Number} the height - * - */ -PIXI.Strip = function(texture) -{ - PIXI.DisplayObjectContainer.call( this ); - - - /** - * The texture of the strip - * - * @property texture - * @type Texture - */ - this.texture = texture; - - // set up the main bits.. - this.uvs = new PIXI.Float32Array([0, 1, - 1, 1, - 1, 0, - 0, 1]); - - this.vertices = new PIXI.Float32Array([0, 0, - 100, 0, - 100, 100, - 0, 100]); - - this.colors = new PIXI.Float32Array([1, 1, 1, 1]); - - this.indices = new PIXI.Uint16Array([0, 1, 2, 3]); - - /** - * Whether the strip is dirty or not - * - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode. - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - /** - * Triangles in canvas mode are automatically antialiased, use this value to force triangles to overlap a bit with each other. - * - * @property canvasPadding - * @type Number - */ - this.canvasPadding = 0; - - this.drawMode = PIXI.Strip.DrawModes.TRIANGLE_STRIP; - -}; - -// constructor -PIXI.Strip.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); -PIXI.Strip.prototype.constructor = PIXI.Strip; - -PIXI.Strip.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(!this.visible || this.alpha <= 0)return; - // render triangle strip.. - - renderSession.spriteBatch.stop(); - - // init! init! - if(!this._vertexBuffer)this._initWebGL(renderSession); - - renderSession.shaderManager.setShader(renderSession.shaderManager.stripShader); - - this._renderStrip(renderSession); - - ///renderSession.shaderManager.activateDefaultShader(); - - renderSession.spriteBatch.start(); - - //TODO check culling -}; - -PIXI.Strip.prototype._initWebGL = function(renderSession) -{ - // build the strip! - var gl = renderSession.gl; - - this._vertexBuffer = gl.createBuffer(); - this._indexBuffer = gl.createBuffer(); - this._uvBuffer = gl.createBuffer(); - this._colorBuffer = gl.createBuffer(); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvs, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._colorBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.colors, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); -}; - -PIXI.Strip.prototype._renderStrip = function(renderSession) -{ - var gl = renderSession.gl; - var projection = renderSession.projection, - offset = renderSession.offset, - shader = renderSession.shaderManager.stripShader; - - var drawMode = this.drawMode === PIXI.Strip.DrawModes.TRIANGLE_STRIP ? gl.TRIANGLE_STRIP : gl.TRIANGLES; - - // gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mat4Real); - - renderSession.blendModeManager.setBlendMode(this.blendMode); - - - // set uniforms - gl.uniformMatrix3fv(shader.translationMatrix, false, this.worldTransform.toArray(true)); - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - gl.uniform1f(shader.alpha, this.worldAlpha); - - if(!this.dirty) - { - - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - // update the uvs - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.activeTexture(gl.TEXTURE0); - - // check if a texture is dirty.. - if(this.texture.baseTexture._dirty[gl.id]) - { - renderSession.renderer.updateTexture(this.texture.baseTexture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]); - } - - // dont need to upload! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - - - } - else - { - - this.dirty = false; - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.STATIC_DRAW); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - // update the uvs - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvs, gl.STATIC_DRAW); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.activeTexture(gl.TEXTURE0); - - // check if a texture is dirty.. - if(this.texture.baseTexture._dirty[gl.id]) - { - renderSession.renderer.updateTexture(this.texture.baseTexture); - } - else - { - gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]); - } - - // dont need to upload! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - } - //console.log(gl.TRIANGLE_STRIP) - // - // - gl.drawElements(drawMode, this.indices.length, gl.UNSIGNED_SHORT, 0); - - -}; - - - -PIXI.Strip.prototype._renderCanvas = function(renderSession) -{ - var context = renderSession.context; - - var transform = this.worldTransform; - - if (renderSession.roundPixels) - { - context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx | 0, transform.ty | 0); - } - else - { - context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty); - } - - if (this.drawMode === PIXI.Strip.DrawModes.TRIANGLE_STRIP) - { - this._renderCanvasTriangleStrip(context); - } - else - { - this._renderCanvasTriangles(context); - } -}; - -PIXI.Strip.prototype._renderCanvasTriangleStrip = function(context) -{ - // draw triangles!! - var vertices = this.vertices; - var uvs = this.uvs; - - var length = vertices.length / 2; - this.count++; - - for (var i = 0; i < length - 2; i++) { - // draw some triangles! - var index = i * 2; - this._renderCanvasDrawTriangle(context, vertices, uvs, index, (index + 2), (index + 4)); - } -}; - -PIXI.Strip.prototype._renderCanvasTriangles = function(context) -{ - // draw triangles!! - var vertices = this.vertices; - var uvs = this.uvs; - var indices = this.indices; - - var length = indices.length; - this.count++; - - for (var i = 0; i < length; i += 3) { - // draw some triangles! - var index0 = indices[i] * 2, index1 = indices[i + 1] * 2, index2 = indices[i + 2] * 2; - this._renderCanvasDrawTriangle(context, vertices, uvs, index0, index1, index2); - } -}; - -PIXI.Strip.prototype._renderCanvasDrawTriangle = function(context, vertices, uvs, index0, index1, index2) -{ - var textureSource = this.texture.baseTexture.source; - var textureWidth = this.texture.width; - var textureHeight = this.texture.height; - - var x0 = vertices[index0], x1 = vertices[index1], x2 = vertices[index2]; - var y0 = vertices[index0 + 1], y1 = vertices[index1 + 1], y2 = vertices[index2 + 1]; - - var u0 = uvs[index0] * textureWidth, u1 = uvs[index1] * textureWidth, u2 = uvs[index2] * textureWidth; - var v0 = uvs[index0 + 1] * textureHeight, v1 = uvs[index1 + 1] * textureHeight, v2 = uvs[index2 + 1] * textureHeight; - - if (this.canvasPadding > 0) { - var paddingX = this.canvasPadding / this.worldTransform.a; - var paddingY = this.canvasPadding / this.worldTransform.d; - var centerX = (x0 + x1 + x2) / 3; - var centerY = (y0 + y1 + y2) / 3; - - var normX = x0 - centerX; - var normY = y0 - centerY; - - var dist = Math.sqrt(normX * normX + normY * normY); - x0 = centerX + (normX / dist) * (dist + paddingX); - y0 = centerY + (normY / dist) * (dist + paddingY); - - // - - normX = x1 - centerX; - normY = y1 - centerY; - - dist = Math.sqrt(normX * normX + normY * normY); - x1 = centerX + (normX / dist) * (dist + paddingX); - y1 = centerY + (normY / dist) * (dist + paddingY); - - normX = x2 - centerX; - normY = y2 - centerY; - - dist = Math.sqrt(normX * normX + normY * normY); - x2 = centerX + (normX / dist) * (dist + paddingX); - y2 = centerY + (normY / dist) * (dist + paddingY); - } - - context.save(); - context.beginPath(); - - - context.moveTo(x0, y0); - context.lineTo(x1, y1); - context.lineTo(x2, y2); - - context.closePath(); - - context.clip(); - - // Compute matrix transform - var delta = (u0 * v1) + (v0 * u2) + (u1 * v2) - (v1 * u2) - (v0 * u1) - (u0 * v2); - var deltaA = (x0 * v1) + (v0 * x2) + (x1 * v2) - (v1 * x2) - (v0 * x1) - (x0 * v2); - var deltaB = (u0 * x1) + (x0 * u2) + (u1 * x2) - (x1 * u2) - (x0 * u1) - (u0 * x2); - var deltaC = (u0 * v1 * x2) + (v0 * x1 * u2) + (x0 * u1 * v2) - (x0 * v1 * u2) - (v0 * u1 * x2) - (u0 * x1 * v2); - var deltaD = (y0 * v1) + (v0 * y2) + (y1 * v2) - (v1 * y2) - (v0 * y1) - (y0 * v2); - var deltaE = (u0 * y1) + (y0 * u2) + (u1 * y2) - (y1 * u2) - (y0 * u1) - (u0 * y2); - var deltaF = (u0 * v1 * y2) + (v0 * y1 * u2) + (y0 * u1 * v2) - (y0 * v1 * u2) - (v0 * u1 * y2) - (u0 * y1 * v2); - - context.transform(deltaA / delta, deltaD / delta, - deltaB / delta, deltaE / delta, - deltaC / delta, deltaF / delta); - - context.drawImage(textureSource, 0, 0); - context.restore(); -}; - - - -/** - * Renders a flat strip - * - * @method renderStripFlat - * @param strip {Strip} The Strip to render - * @private - */ -PIXI.Strip.prototype.renderStripFlat = function(strip) -{ - var context = this.context; - var vertices = strip.vertices; - - var length = vertices.length/2; - this.count++; - - context.beginPath(); - for (var i=1; i < length-2; i++) - { - // draw some triangles! - var index = i*2; - - var x0 = vertices[index], x1 = vertices[index+2], x2 = vertices[index+4]; - var y0 = vertices[index+1], y1 = vertices[index+3], y2 = vertices[index+5]; - - context.moveTo(x0, y0); - context.lineTo(x1, y1); - context.lineTo(x2, y2); - } - - context.fillStyle = '#FF0000'; - context.fill(); - context.closePath(); -}; - -/* -PIXI.Strip.prototype.setTexture = function(texture) -{ - //TODO SET THE TEXTURES - //TODO VISIBILITY - - // stop current texture - this.texture = texture; - this.width = texture.frame.width; - this.height = texture.frame.height; - this.updateFrame = true; -}; -*/ - -/** - * When the texture is updated, this event will fire to update the scale and frame - * - * @method onTextureUpdate - * @param event - * @private - */ - -PIXI.Strip.prototype.onTextureUpdate = function() -{ - this.updateFrame = true; -}; - -/** - * Returns the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account. - * - * @method getBounds - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle - */ -PIXI.Strip.prototype.getBounds = function(matrix) -{ - var worldTransform = matrix || this.worldTransform; - - var a = worldTransform.a; - var b = worldTransform.b; - var c = worldTransform.c; - var d = worldTransform.d; - var tx = worldTransform.tx; - var ty = worldTransform.ty; - - var maxX = -Infinity; - var maxY = -Infinity; - - var minX = Infinity; - var minY = Infinity; - - var vertices = this.vertices; - for (var i = 0, n = vertices.length; i < n; i += 2) - { - var rawX = vertices[i], rawY = vertices[i + 1]; - var x = (a * rawX) + (c * rawY) + tx; - var y = (d * rawY) + (b * rawX) + ty; - - minX = x < minX ? x : minX; - minY = y < minY ? y : minY; - - maxX = x > maxX ? x : maxX; - maxY = y > maxY ? y : maxY; - } - - if (minX === -Infinity || maxY === Infinity) - { - return PIXI.EmptyRectangle; - } - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - -/** - * Different drawing buffer modes supported - * - * @property - * @type {{TRIANGLE_STRIP: number, TRIANGLES: number}} - * @static - */ -PIXI.Strip.DrawModes = { - TRIANGLE_STRIP: 0, - TRIANGLES: 1 -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/extras/TilingSprite.js b/tutorial-3/pixi.js-master/src/pixi/extras/TilingSprite.js deleted file mode 100755 index 2ad39d2..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/extras/TilingSprite.js +++ /dev/null @@ -1,485 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * A tiling sprite is a fast way of rendering a tiling image - * - * @class TilingSprite - * @extends Sprite - * @constructor - * @param texture {Texture} the texture of the tiling sprite - * @param width {Number} the width of the tiling sprite - * @param height {Number} the height of the tiling sprite - */ -PIXI.TilingSprite = function(texture, width, height) -{ - PIXI.Sprite.call( this, texture); - - /** - * The with of the tiling sprite - * - * @property width - * @type Number - */ - this._width = width || 100; - - /** - * The height of the tiling sprite - * - * @property height - * @type Number - */ - this._height = height || 100; - - /** - * The scaling of the image that is being tiled - * - * @property tileScale - * @type Point - */ - this.tileScale = new PIXI.Point(1,1); - - /** - * A point that represents the scale of the texture object - * - * @property tileScaleOffset - * @type Point - */ - this.tileScaleOffset = new PIXI.Point(1,1); - - /** - * The offset position of the image that is being tiled - * - * @property tilePosition - * @type Point - */ - this.tilePosition = new PIXI.Point(0,0); - - /** - * Whether this sprite is renderable or not - * - * @property renderable - * @type Boolean - * @default true - */ - this.renderable = true; - - /** - * The tint applied to the sprite. This is a hex value - * - * @property tint - * @type Number - * @default 0xFFFFFF - */ - this.tint = 0xFFFFFF; - - /** - * The blend mode to be applied to the sprite - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - - -}; - -// constructor -PIXI.TilingSprite.prototype = Object.create(PIXI.Sprite.prototype); -PIXI.TilingSprite.prototype.constructor = PIXI.TilingSprite; - - -/** - * The width of the sprite, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.TilingSprite.prototype, 'width', { - get: function() { - return this._width; - }, - set: function(value) { - - this._width = value; - } -}); - -/** - * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.TilingSprite.prototype, 'height', { - get: function() { - return this._height; - }, - set: function(value) { - this._height = value; - } -}); - -PIXI.TilingSprite.prototype.setTexture = function(texture) -{ - if (this.texture === texture) return; - - this.texture = texture; - - this.refreshTexture = true; - - this.cachedTint = 0xFFFFFF; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.TilingSprite.prototype._renderWebGL = function(renderSession) -{ - if (this.visible === false || this.alpha === 0) return; - var i,j; - - if (this._mask) - { - renderSession.spriteBatch.stop(); - renderSession.maskManager.pushMask(this.mask, renderSession); - renderSession.spriteBatch.start(); - } - - if (this._filters) - { - renderSession.spriteBatch.flush(); - renderSession.filterManager.pushFilter(this._filterBlock); - } - - - - if (!this.tilingTexture || this.refreshTexture) - { - this.generateTilingTexture(true); - - if (this.tilingTexture && this.tilingTexture.needsUpdate) - { - //TODO - tweaking - renderSession.renderer.updateTexture(this.tilingTexture.baseTexture); - this.tilingTexture.needsUpdate = false; - // this.tilingTexture._uvs = null; - } - } - else - { - renderSession.spriteBatch.renderTilingSprite(this); - } - // simple render children! - for (i=0,j=this.children.length; i maxX ? x1 : maxX; - maxX = x2 > maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y1 > maxY ? y1 : maxY; - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - - - -/** - * When the texture is updated, this event will fire to update the scale and frame - * - * @method onTextureUpdate - * @param event - * @private - */ -PIXI.TilingSprite.prototype.onTextureUpdate = function() -{ - // overriding the sprite version of this! -}; - - -/** -* -* @method generateTilingTexture -* -* @param forcePowerOfTwo {Boolean} Whether we want to force the texture to be a power of two -*/ -PIXI.TilingSprite.prototype.generateTilingTexture = function(forcePowerOfTwo) -{ - if (!this.texture.baseTexture.hasLoaded) return; - - var texture = this.originalTexture || this.texture; - var frame = texture.frame; - var targetWidth, targetHeight; - - // Check that the frame is the same size as the base texture. - var isFrame = frame.width !== texture.baseTexture.width || frame.height !== texture.baseTexture.height; - - var newTextureRequired = false; - - if (!forcePowerOfTwo) - { - if (isFrame) - { - if (texture.trim) - { - targetWidth = texture.trim.width; - targetHeight = texture.trim.height; - } - else - { - targetWidth = frame.width; - targetHeight = frame.height; - } - - newTextureRequired = true; - } - } - else - { - targetWidth = PIXI.getNextPowerOfTwo(frame.width); - targetHeight = PIXI.getNextPowerOfTwo(frame.height); - - // If the BaseTexture dimensions don't match the texture frame then we need a new texture anyway because it's part of a texture atlas - if (frame.width !== targetWidth || frame.height !== targetHeight || texture.baseTexture.width !== targetWidth || texture.baseTexture.height || targetHeight) newTextureRequired = true; - } - - if (newTextureRequired) - { - var canvasBuffer; - - if (this.tilingTexture && this.tilingTexture.isTiling) - { - canvasBuffer = this.tilingTexture.canvasBuffer; - canvasBuffer.resize(targetWidth, targetHeight); - this.tilingTexture.baseTexture.width = targetWidth; - this.tilingTexture.baseTexture.height = targetHeight; - this.tilingTexture.needsUpdate = true; - } - else - { - canvasBuffer = new PIXI.CanvasBuffer(targetWidth, targetHeight); - - this.tilingTexture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); - this.tilingTexture.canvasBuffer = canvasBuffer; - this.tilingTexture.isTiling = true; - } - - canvasBuffer.context.drawImage(texture.baseTexture.source, - texture.crop.x, - texture.crop.y, - texture.crop.width, - texture.crop.height, - 0, - 0, - targetWidth, - targetHeight); - - this.tileScaleOffset.x = frame.width / targetWidth; - this.tileScaleOffset.y = frame.height / targetHeight; - } - else - { - // TODO - switching? - if (this.tilingTexture && this.tilingTexture.isTiling) - { - // destroy the tiling texture! - // TODO could store this somewhere? - this.tilingTexture.destroy(true); - } - - this.tileScaleOffset.x = 1; - this.tileScaleOffset.y = 1; - this.tilingTexture = texture; - } - - this.refreshTexture = false; - - this.originalTexture = this.texture; - this.texture = this.tilingTexture; - - this.tilingTexture.baseTexture._powerOf2 = true; -}; - -PIXI.TilingSprite.prototype.destroy = function () { - PIXI.Sprite.prototype.destroy.call(this); - - this.tileScale = null; - this.tileScaleOffset = null; - this.tilePosition = null; - - this.tilingTexture.destroy(true); - this.tilingTexture = null; -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/AbstractFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/AbstractFilter.js deleted file mode 100755 index 6727dc5..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/AbstractFilter.js +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This is the base class for creating a PIXI filter. Currently only webGL supports filters. - * If you want to make a custom filter this should be your base class. - * @class AbstractFilter - * @constructor - * @param fragmentSrc {Array} The fragment source in an array of strings. - * @param uniforms {Object} An object containing the uniforms for this filter. - */ -PIXI.AbstractFilter = function(fragmentSrc, uniforms) -{ - /** - * An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. - * For example the blur filter has two passes blurX and blurY. - * @property passes - * @type Array(Filter) - * @private - */ - this.passes = [this]; - - /** - * @property shaders - * @type Array(Shader) - * @private - */ - this.shaders = []; - - /** - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * @property padding - * @type Number - */ - this.padding = 0; - - /** - * @property uniforms - * @type object - * @private - */ - this.uniforms = uniforms || {}; - - /** - * @property fragmentSrc - * @type Array - * @private - */ - this.fragmentSrc = fragmentSrc || []; -}; - -PIXI.AbstractFilter.prototype.constructor = PIXI.AbstractFilter; - -/** - * Syncs the uniforms between the class object and the shaders. - * - * @method syncUniforms - */ -PIXI.AbstractFilter.prototype.syncUniforms = function() -{ - for(var i=0,j=this.shaders.length; i 0.2) n = 65600.0; // :', - ' if (gray > 0.3) n = 332772.0; // *', - ' if (gray > 0.4) n = 15255086.0; // o', - ' if (gray > 0.5) n = 23385164.0; // &', - ' if (gray > 0.6) n = 15252014.0; // 8', - ' if (gray > 0.7) n = 13199452.0; // @', - ' if (gray > 0.8) n = 11512810.0; // #', - - ' vec2 p = mod( uv / ( pixelSize * 0.5 ), 2.0) - vec2(1.0);', - ' col = col * character(n, p);', - - ' gl_FragColor = vec4(col, 1.0);', - '}' - ]; -}; - -PIXI.AsciiFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.AsciiFilter.prototype.constructor = PIXI.AsciiFilter; - -/** - * The pixel size used by the filter. - * - * @property size - * @type Number - */ -Object.defineProperty(PIXI.AsciiFilter.prototype, 'size', { - get: function() { - return this.uniforms.pixelSize.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.pixelSize.value = value; - } -}); \ No newline at end of file diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/BlurFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/BlurFilter.js deleted file mode 100755 index d93d147..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/BlurFilter.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The BlurFilter applies a Gaussian blur to an object. - * The strength of the blur can be set for x- and y-axis separately (always relative to the stage). - * - * @class BlurFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.BlurFilter = function() -{ - this.blurXFilter = new PIXI.BlurXFilter(); - this.blurYFilter = new PIXI.BlurYFilter(); - - this.passes =[this.blurXFilter, this.blurYFilter]; -}; - -PIXI.BlurFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.BlurFilter.prototype.constructor = PIXI.BlurFilter; - -/** - * Sets the strength of both the blurX and blurY properties simultaneously - * - * @property blur - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.BlurFilter.prototype, 'blur', { - get: function() { - return this.blurXFilter.blur; - }, - set: function(value) { - this.blurXFilter.blur = this.blurYFilter.blur = value; - } -}); - -/** - * Sets the strength of the blurX property - * - * @property blurX - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.BlurFilter.prototype, 'blurX', { - get: function() { - return this.blurXFilter.blur; - }, - set: function(value) { - this.blurXFilter.blur = value; - } -}); - -/** - * Sets the strength of the blurY property - * - * @property blurY - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.BlurFilter.prototype, 'blurY', { - get: function() { - return this.blurYFilter.blur; - }, - set: function(value) { - this.blurYFilter.blur = value; - } -}); diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/BlurXFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/BlurXFilter.js deleted file mode 100755 index 13f67c3..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/BlurXFilter.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The BlurXFilter applies a horizontal Gaussian blur to an object. - * - * @class BlurXFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.BlurXFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 1/512} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float blur;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' vec4 sum = vec4(0.0);', - - ' sum += texture2D(uSampler, vec2(vTextureCoord.x - 4.0*blur, vTextureCoord.y)) * 0.05;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x - 3.0*blur, vTextureCoord.y)) * 0.09;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x - 2.0*blur, vTextureCoord.y)) * 0.12;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x - blur, vTextureCoord.y)) * 0.15;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x + blur, vTextureCoord.y)) * 0.15;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x + 2.0*blur, vTextureCoord.y)) * 0.12;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x + 3.0*blur, vTextureCoord.y)) * 0.09;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x + 4.0*blur, vTextureCoord.y)) * 0.05;', - - ' gl_FragColor = sum;', - '}' - ]; -}; - -PIXI.BlurXFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.BlurXFilter.prototype.constructor = PIXI.BlurXFilter; - -/** - * Sets the strength of both the blur. - * - * @property blur - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.BlurXFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value / (1/7000); - }, - set: function(value) { - - this.dirty = true; - this.uniforms.blur.value = (1/7000) * value; - } -}); diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/BlurYFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/BlurYFilter.js deleted file mode 100755 index 5aecfef..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/BlurYFilter.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The BlurYFilter applies a vertical Gaussian blur to an object. - * - * @class BlurYFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.BlurYFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 1/512} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float blur;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' vec4 sum = vec4(0.0);', - - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 4.0*blur)) * 0.05;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 3.0*blur)) * 0.09;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 2.0*blur)) * 0.12;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - blur)) * 0.15;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + blur)) * 0.15;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 2.0*blur)) * 0.12;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 3.0*blur)) * 0.09;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 4.0*blur)) * 0.05;', - - ' gl_FragColor = sum;', - '}' - ]; -}; - -PIXI.BlurYFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.BlurYFilter.prototype.constructor = PIXI.BlurYFilter; - -/** - * Sets the strength of both the blur. - * - * @property blur - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.BlurYFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value / (1/7000); - }, - set: function(value) { - //this.padding = value; - this.uniforms.blur.value = (1/7000) * value; - } -}); diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/ColorMatrixFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/ColorMatrixFilter.js deleted file mode 100755 index 8f1dcbe..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/ColorMatrixFilter.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The ColorMatrixFilter class lets you apply a 4x4 matrix transformation on the RGBA - * color and alpha values of every pixel on your displayObject to produce a result - * with a new set of RGBA color and alpha values. It's pretty powerful! - * - * @class ColorMatrixFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.ColorMatrixFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - matrix: {type: 'mat4', value: [1,0,0,0, - 0,1,0,0, - 0,0,1,0, - 0,0,0,1]} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float invert;', - 'uniform mat4 matrix;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * matrix;', - // ' gl_FragColor = gl_FragColor;', - '}' - ]; -}; - -PIXI.ColorMatrixFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.ColorMatrixFilter.prototype.constructor = PIXI.ColorMatrixFilter; - -/** - * Sets the matrix of the color matrix filter - * - * @property matrix - * @type Array(Number) - * @default [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] - */ -Object.defineProperty(PIXI.ColorMatrixFilter.prototype, 'matrix', { - get: function() { - return this.uniforms.matrix.value; - }, - set: function(value) { - this.uniforms.matrix.value = value; - } -}); \ No newline at end of file diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/ColorStepFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/ColorStepFilter.js deleted file mode 100755 index 9481acd..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/ColorStepFilter.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This lowers the color depth of your image by the given amount, producing an image with a smaller palette. - * - * @class ColorStepFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.ColorStepFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - step: {type: '1f', value: 5} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'uniform float step;', - - 'void main(void) {', - ' vec4 color = texture2D(uSampler, vTextureCoord);', - ' color = floor(color * step) / step;', - ' gl_FragColor = color;', - '}' - ]; -}; - -PIXI.ColorStepFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.ColorStepFilter.prototype.constructor = PIXI.ColorStepFilter; - -/** - * The number of steps to reduce the palette by. - * - * @property step - * @type Number - */ -Object.defineProperty(PIXI.ColorStepFilter.prototype, 'step', { - get: function() { - return this.uniforms.step.value; - }, - set: function(value) { - this.uniforms.step.value = value; - } -}); diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/ConvolutionFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/ConvolutionFilter.js deleted file mode 100755 index 1d180d7..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/ConvolutionFilter.js +++ /dev/null @@ -1,106 +0,0 @@ -/** - * The ConvolutionFilter class applies a matrix convolution filter effect. - * A convolution combines pixels in the input image with neighboring pixels to produce a new image. - * A wide variety of image effects can be achieved through convolutions, including blurring, edge detection, sharpening, embossing, and beveling. - * The matrix should be specified as a 9 point Array. See http://docs.gimp.org/en/plug-in-convmatrix.html for more info. - * - * @class ConvolutionFilter - * @extends AbstractFilter - * @constructor - * @param matrix {Array} An array of values used for matrix transformation. Specified as a 9 point Array. - * @param width {Number} Width of the object you are transforming - * @param height {Number} Height of the object you are transforming - */ -PIXI.ConvolutionFilter = function(matrix, width, height) -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - m : {type: '1fv', value: new PIXI.Float32Array(matrix)}, - texelSizeX: {type: '1f', value: 1 / width}, - texelSizeY: {type: '1f', value: 1 / height} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying mediump vec2 vTextureCoord;', - 'uniform sampler2D texture;', - 'uniform float texelSizeX;', - 'uniform float texelSizeY;', - 'uniform float m[9];', - - 'vec2 px = vec2(texelSizeX, texelSizeY);', - - 'void main(void) {', - 'vec4 c11 = texture2D(texture, vTextureCoord - px);', // top left - 'vec4 c12 = texture2D(texture, vec2(vTextureCoord.x, vTextureCoord.y - px.y));', // top center - 'vec4 c13 = texture2D(texture, vec2(vTextureCoord.x + px.x, vTextureCoord.y - px.y));', // top right - - 'vec4 c21 = texture2D(texture, vec2(vTextureCoord.x - px.x, vTextureCoord.y) );', // mid left - 'vec4 c22 = texture2D(texture, vTextureCoord);', // mid center - 'vec4 c23 = texture2D(texture, vec2(vTextureCoord.x + px.x, vTextureCoord.y) );', // mid right - - 'vec4 c31 = texture2D(texture, vec2(vTextureCoord.x - px.x, vTextureCoord.y + px.y) );', // bottom left - 'vec4 c32 = texture2D(texture, vec2(vTextureCoord.x, vTextureCoord.y + px.y) );', // bottom center - 'vec4 c33 = texture2D(texture, vTextureCoord + px );', // bottom right - - 'gl_FragColor = ', - 'c11 * m[0] + c12 * m[1] + c22 * m[2] +', - 'c21 * m[3] + c22 * m[4] + c23 * m[5] +', - 'c31 * m[6] + c32 * m[7] + c33 * m[8];', - 'gl_FragColor.a = c22.a;', - '}' - ]; - -}; - -PIXI.ConvolutionFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.ConvolutionFilter.prototype.constructor = PIXI.ConvolutionFilter; - -/** - * An array of values used for matrix transformation. Specified as a 9 point Array. - * - * @property matrix - * @type Array - */ -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'matrix', { - get: function() { - return this.uniforms.m.value; - }, - set: function(value) { - this.uniforms.m.value = new PIXI.Float32Array(value); - } -}); - -/** - * Width of the object you are transforming - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'width', { - get: function() { - return this.uniforms.texelSizeX.value; - }, - set: function(value) { - this.uniforms.texelSizeX.value = 1/value; - } -}); - -/** - * Height of the object you are transforming - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'height', { - get: function() { - return this.uniforms.texelSizeY.value; - }, - set: function(value) { - this.uniforms.texelSizeY.value = 1/value; - } -}); diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/CrossHatchFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/CrossHatchFilter.js deleted file mode 100755 index 4b9f381..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/CrossHatchFilter.js +++ /dev/null @@ -1,80 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A Cross Hatch effect filter. - * - * @class CrossHatchFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.CrossHatchFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 1 / 512} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float blur;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);', - - ' gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);', - - ' if (lum < 1.00) {', - ' if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {', - ' gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);', - ' }', - ' }', - - ' if (lum < 0.75) {', - ' if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {', - ' gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);', - ' }', - ' }', - - ' if (lum < 0.50) {', - ' if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {', - ' gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);', - ' }', - ' }', - - ' if (lum < 0.3) {', - ' if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {', - ' gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);', - ' }', - ' }', - '}' - ]; -}; - -PIXI.CrossHatchFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.CrossHatchFilter.prototype.constructor = PIXI.CrossHatchFilter; - -/** - * Sets the strength of both the blur. - * - * @property blur - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.CrossHatchFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value / (1/7000); - }, - set: function(value) { - //this.padding = value; - this.uniforms.blur.value = (1/7000) * value; - } -}); diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/DisplacementFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/DisplacementFilter.js deleted file mode 100755 index 803b7b8..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/DisplacementFilter.js +++ /dev/null @@ -1,134 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The DisplacementFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. - * You can use this filter to apply all manor of crazy warping effects - * Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y. - * - * @class DisplacementFilter - * @extends AbstractFilter - * @constructor - * @param texture {Texture} The texture used for the displacement map * must be power of 2 texture at the moment - */ -PIXI.DisplacementFilter = function(texture) -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - texture.baseTexture._powerOf2 = true; - - // set the uniforms - this.uniforms = { - displacementMap: {type: 'sampler2D', value:texture}, - scale: {type: '2f', value:{x:30, y:30}}, - offset: {type: '2f', value:{x:0, y:0}}, - mapDimensions: {type: '2f', value:{x:1, y:5112}}, - dimensions: {type: '4fv', value:[0,0,0,0]} - }; - - if(texture.baseTexture.hasLoaded) - { - this.uniforms.mapDimensions.value.x = texture.width; - this.uniforms.mapDimensions.value.y = texture.height; - } - else - { - this.boundLoadedFunction = this.onTextureLoaded.bind(this); - - texture.baseTexture.on('loaded', this.boundLoadedFunction); - } - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D displacementMap;', - 'uniform sampler2D uSampler;', - 'uniform vec2 scale;', - 'uniform vec2 offset;', - 'uniform vec4 dimensions;', - 'uniform vec2 mapDimensions;',// = vec2(256.0, 256.0);', - // 'const vec2 textureDimensions = vec2(750.0, 750.0);', - - 'void main(void) {', - ' vec2 mapCords = vTextureCoord.xy;', - //' mapCords -= ;', - ' mapCords += (dimensions.zw + offset)/ dimensions.xy ;', - ' mapCords.y *= -1.0;', - ' mapCords.y += 1.0;', - ' vec2 matSample = texture2D(displacementMap, mapCords).xy;', - ' matSample -= 0.5;', - ' matSample *= scale;', - ' matSample /= mapDimensions;', - ' gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + matSample.x, vTextureCoord.y + matSample.y));', - ' gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb, 1.0);', - ' vec2 cord = vTextureCoord;', - - //' gl_FragColor = texture2D(displacementMap, cord);', - // ' gl_FragColor = gl_FragColor;', - '}' - ]; -}; - -PIXI.DisplacementFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.DisplacementFilter.prototype.constructor = PIXI.DisplacementFilter; - -/** - * Sets the map dimensions uniforms when the texture becomes available. - * - * @method onTextureLoaded - */ -PIXI.DisplacementFilter.prototype.onTextureLoaded = function() -{ - this.uniforms.mapDimensions.value.x = this.uniforms.displacementMap.value.width; - this.uniforms.mapDimensions.value.y = this.uniforms.displacementMap.value.height; - - this.uniforms.displacementMap.value.baseTexture.off('loaded', this.boundLoadedFunction); -}; - -/** - * The texture used for the displacement map. Must be power of 2 texture. - * - * @property map - * @type Texture - */ -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'map', { - get: function() { - return this.uniforms.displacementMap.value; - }, - set: function(value) { - this.uniforms.displacementMap.value = value; - } -}); - -/** - * The multiplier used to scale the displacement result from the map calculation. - * - * @property scale - * @type Point - */ -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'scale', { - get: function() { - return this.uniforms.scale.value; - }, - set: function(value) { - this.uniforms.scale.value = value; - } -}); - -/** - * The offset used to move the displacement map. - * - * @property offset - * @type Point - */ -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'offset', { - get: function() { - return this.uniforms.offset.value; - }, - set: function(value) { - this.uniforms.offset.value = value; - } -}); diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/DotScreenFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/DotScreenFilter.js deleted file mode 100755 index 5a7462f..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/DotScreenFilter.js +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/fun/dotscreen.js - */ - -/** - * This filter applies a dotscreen effect making display objects appear to be made out of black and white halftone dots like an old printer. - * - * @class DotScreenFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.DotScreenFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - scale: {type: '1f', value:1}, - angle: {type: '1f', value:5}, - dimensions: {type: '4fv', value:[0,0,0,0]} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform vec4 dimensions;', - 'uniform sampler2D uSampler;', - - 'uniform float angle;', - 'uniform float scale;', - - 'float pattern() {', - ' float s = sin(angle), c = cos(angle);', - ' vec2 tex = vTextureCoord * dimensions.xy;', - ' vec2 point = vec2(', - ' c * tex.x - s * tex.y,', - ' s * tex.x + c * tex.y', - ' ) * scale;', - ' return (sin(point.x) * sin(point.y)) * 4.0;', - '}', - - 'void main() {', - ' vec4 color = texture2D(uSampler, vTextureCoord);', - ' float average = (color.r + color.g + color.b) / 3.0;', - ' gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);', - '}' - ]; -}; - -PIXI.DotScreenFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.DotScreenFilter.prototype.constructor = PIXI.DotScreenFilter; - -/** - * The scale of the effect. - * @property scale - * @type Number - */ -Object.defineProperty(PIXI.DotScreenFilter.prototype, 'scale', { - get: function() { - return this.uniforms.scale.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.scale.value = value; - } -}); - -/** - * The radius of the effect. - * @property angle - * @type Number - */ -Object.defineProperty(PIXI.DotScreenFilter.prototype, 'angle', { - get: function() { - return this.uniforms.angle.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.angle.value = value; - } -}); diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/FilterBlock.js b/tutorial-3/pixi.js-master/src/pixi/filters/FilterBlock.js deleted file mode 100755 index fbdacc2..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/FilterBlock.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A target and pass info object for filters. - * - * @class FilterBlock - * @constructor - */ -PIXI.FilterBlock = function() -{ - /** - * The visible state of this FilterBlock. - * - * @property visible - * @type Boolean - */ - this.visible = true; - - /** - * The renderable state of this FilterBlock. - * - * @property renderable - * @type Boolean - */ - this.renderable = true; -}; - -PIXI.FilterBlock.prototype.constructor = PIXI.FilterBlock; diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/GrayFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/GrayFilter.js deleted file mode 100755 index 201d026..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/GrayFilter.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This greyscales the palette of your Display Objects. - * - * @class GrayFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.GrayFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - gray: {type: '1f', value: 1} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'uniform float gray;', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord);', - ' gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(0.2126*gl_FragColor.r + 0.7152*gl_FragColor.g + 0.0722*gl_FragColor.b), gray);', - // ' gl_FragColor = gl_FragColor;', - '}' - ]; -}; - -PIXI.GrayFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.GrayFilter.prototype.constructor = PIXI.GrayFilter; - -/** - * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color. - * @property gray - * @type Number - */ -Object.defineProperty(PIXI.GrayFilter.prototype, 'gray', { - get: function() { - return this.uniforms.gray.value; - }, - set: function(value) { - this.uniforms.gray.value = value; - } -}); diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/InvertFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/InvertFilter.js deleted file mode 100755 index 7f5e84c..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/InvertFilter.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This inverts your Display Objects colors. - * - * @class InvertFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.InvertFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - invert: {type: '1f', value: 1} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float invert;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord);', - ' gl_FragColor.rgb = mix( (vec3(1)-gl_FragColor.rgb) * gl_FragColor.a, gl_FragColor.rgb, 1.0 - invert);', - //' gl_FragColor.rgb = gl_FragColor.rgb * gl_FragColor.a;', - // ' gl_FragColor = gl_FragColor * vColor;', - '}' - ]; -}; - -PIXI.InvertFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.InvertFilter.prototype.constructor = PIXI.InvertFilter; - -/** - * The strength of the invert. 1 will fully invert the colors, 0 will make the object its normal color - * @property invert - * @type Number -*/ -Object.defineProperty(PIXI.InvertFilter.prototype, 'invert', { - get: function() { - return this.uniforms.invert.value; - }, - set: function(value) { - this.uniforms.invert.value = value; - } -}); diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/NoiseFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/NoiseFilter.js deleted file mode 100755 index ff248e4..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/NoiseFilter.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @author Vico @vicocotea - * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js - */ - -/** - * A Noise effect filter. - * - * @class NoiseFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.NoiseFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - noise: {type: '1f', value: 0.5} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'uniform sampler2D uSampler;', - 'uniform float noise;', - 'varying vec2 vTextureCoord;', - - 'float rand(vec2 co) {', - ' return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);', - '}', - 'void main() {', - ' vec4 color = texture2D(uSampler, vTextureCoord);', - - ' float diff = (rand(vTextureCoord) - 0.5) * noise;', - ' color.r += diff;', - ' color.g += diff;', - ' color.b += diff;', - - ' gl_FragColor = color;', - '}' - ]; -}; - -PIXI.NoiseFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.NoiseFilter.prototype.constructor = PIXI.NoiseFilter; - -/** - * The amount of noise to apply. - * @property noise - * @type Number -*/ -Object.defineProperty(PIXI.NoiseFilter.prototype, 'noise', { - get: function() { - return this.uniforms.noise.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.noise.value = value; - } -}); diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/NormalMapFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/NormalMapFilter.js deleted file mode 100755 index e686905..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/NormalMapFilter.js +++ /dev/null @@ -1,196 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - - -/** - * The NormalMapFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. - * You can use this filter to apply all manor of crazy warping effects - * Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y. - * - * @class NormalMapFilter - * @extends AbstractFilter - * @constructor - * @param texture {Texture} The texture used for the displacement map * must be power of 2 texture at the moment - */ -PIXI.NormalMapFilter = function(texture) -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - texture.baseTexture._powerOf2 = true; - - // set the uniforms - this.uniforms = { - displacementMap: {type: 'sampler2D', value:texture}, - scale: {type: '2f', value:{x:15, y:15}}, - offset: {type: '2f', value:{x:0, y:0}}, - mapDimensions: {type: '2f', value:{x:1, y:1}}, - dimensions: {type: '4f', value:[0,0,0,0]}, - // LightDir: {type: 'f3', value:[0, 1, 0]}, - LightPos: {type: '3f', value:[0, 1, 0]} - }; - - - if(texture.baseTexture.hasLoaded) - { - this.uniforms.mapDimensions.value.x = texture.width; - this.uniforms.mapDimensions.value.y = texture.height; - } - else - { - this.boundLoadedFunction = this.onTextureLoaded.bind(this); - - texture.baseTexture.on("loaded", this.boundLoadedFunction); - } - - this.fragmentSrc = [ - "precision mediump float;", - "varying vec2 vTextureCoord;", - "varying float vColor;", - "uniform sampler2D displacementMap;", - "uniform sampler2D uSampler;", - - "uniform vec4 dimensions;", - - "const vec2 Resolution = vec2(1.0,1.0);", //resolution of screen - "uniform vec3 LightPos;", //light position, normalized - "const vec4 LightColor = vec4(1.0, 1.0, 1.0, 1.0);", //light RGBA -- alpha is intensity - "const vec4 AmbientColor = vec4(1.0, 1.0, 1.0, 0.5);", //ambient RGBA -- alpha is intensity - "const vec3 Falloff = vec3(0.0, 1.0, 0.2);", //attenuation coefficients - - "uniform vec3 LightDir;",//" = vec3(1.0, 0.0, 1.0);", - - - "uniform vec2 mapDimensions;",// = vec2(256.0, 256.0);", - - - "void main(void) {", - "vec2 mapCords = vTextureCoord.xy;", - - "vec4 color = texture2D(uSampler, vTextureCoord.st);", - "vec3 nColor = texture2D(displacementMap, vTextureCoord.st).rgb;", - - - "mapCords *= vec2(dimensions.x/512.0, dimensions.y/512.0);", - - "mapCords.y *= -1.0;", - "mapCords.y += 1.0;", - - //RGBA of our diffuse color - "vec4 DiffuseColor = texture2D(uSampler, vTextureCoord);", - - //RGB of our normal map - "vec3 NormalMap = texture2D(displacementMap, mapCords).rgb;", - - //The delta position of light - //"vec3 LightDir = vec3(LightPos.xy - (gl_FragCoord.xy / Resolution.xy), LightPos.z);", - "vec3 LightDir = vec3(LightPos.xy - (mapCords.xy), LightPos.z);", - //Correct for aspect ratio - //"LightDir.x *= Resolution.x / Resolution.y;", - - //Determine distance (used for attenuation) BEFORE we normalize our LightDir - "float D = length(LightDir);", - - //normalize our vectors - "vec3 N = normalize(NormalMap * 2.0 - 1.0);", - "vec3 L = normalize(LightDir);", - - //Pre-multiply light color with intensity - //Then perform "N dot L" to determine our diffuse term - "vec3 Diffuse = (LightColor.rgb * LightColor.a) * max(dot(N, L), 0.0);", - - //pre-multiply ambient color with intensity - "vec3 Ambient = AmbientColor.rgb * AmbientColor.a;", - - //calculate attenuation - "float Attenuation = 1.0 / ( Falloff.x + (Falloff.y*D) + (Falloff.z*D*D) );", - - //the calculation which brings it all together - "vec3 Intensity = Ambient + Diffuse * Attenuation;", - "vec3 FinalColor = DiffuseColor.rgb * Intensity;", - "gl_FragColor = vColor * vec4(FinalColor, DiffuseColor.a);", - //"gl_FragColor = vec4(1.0, 0.0, 0.0, Attenuation);",//vColor * vec4(FinalColor, DiffuseColor.a);", - /* - // normalise color - "vec3 normal = normalize(nColor * 2.0 - 1.0);", - - "vec3 deltaPos = vec3( (light.xy - gl_FragCoord.xy) / resolution.xy, light.z );", - - "float lambert = clamp(dot(normal, lightDir), 0.0, 1.0);", - - "float d = sqrt(dot(deltaPos, deltaPos));", - "float att = 1.0 / ( attenuation.x + (attenuation.y*d) + (attenuation.z*d*d) );", - - "vec3 result = (ambientColor * ambientIntensity) + (lightColor.rgb * lambert) * att;", - "result *= color.rgb;", - - "gl_FragColor = vec4(result, 1.0);",*/ - - - - "}" - ]; - -} - -PIXI.NormalMapFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.NormalMapFilter.prototype.constructor = PIXI.NormalMapFilter; - -/** - * Sets the map dimensions uniforms when the texture becomes available. - * - * @method onTextureLoaded - */ -PIXI.NormalMapFilter.prototype.onTextureLoaded = function() -{ - this.uniforms.mapDimensions.value.x = this.uniforms.displacementMap.value.width; - this.uniforms.mapDimensions.value.y = this.uniforms.displacementMap.value.height; - - this.uniforms.displacementMap.value.baseTexture.off("loaded", this.boundLoadedFunction) -}; - -/** - * The texture used for the displacement map. Must be power of 2 texture. - * - * @property map - * @type Texture - */ -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'map', { - get: function() { - return this.uniforms.displacementMap.value; - }, - set: function(value) { - this.uniforms.displacementMap.value = value; - } -}); - -/** - * The multiplier used to scale the displacement result from the map calculation. - * - * @property scale - * @type Point - */ -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'scale', { - get: function() { - return this.uniforms.scale.value; - }, - set: function(value) { - this.uniforms.scale.value = value; - } -}); - -/** - * The offset used to move the displacement map. - * - * @property offset - * @type Point - */ -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'offset', { - get: function() { - return this.uniforms.offset.value; - }, - set: function(value) { - this.uniforms.offset.value = value; - } -}); diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/PixelateFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/PixelateFilter.js deleted file mode 100755 index 2a3127d..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/PixelateFilter.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This filter applies a pixelate effect making display objects appear 'blocky'. - * - * @class PixelateFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.PixelateFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - invert: {type: '1f', value: 0}, - dimensions: {type: '4fv', value:new PIXI.Float32Array([10000, 100, 10, 10])}, - pixelSize: {type: '2f', value:{x:10, y:10}} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform vec2 testDim;', - 'uniform vec4 dimensions;', - 'uniform vec2 pixelSize;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' vec2 coord = vTextureCoord;', - - ' vec2 size = dimensions.xy/pixelSize;', - - ' vec2 color = floor( ( vTextureCoord * size ) ) / size + pixelSize/dimensions.xy * 0.5;', - ' gl_FragColor = texture2D(uSampler, color);', - '}' - ]; -}; - -PIXI.PixelateFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.PixelateFilter.prototype.constructor = PIXI.PixelateFilter; - -/** - * This a point that describes the size of the blocks. x is the width of the block and y is the height. - * - * @property size - * @type Point - */ -Object.defineProperty(PIXI.PixelateFilter.prototype, 'size', { - get: function() { - return this.uniforms.pixelSize.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.pixelSize.value = value; - } -}); diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/RGBSplitFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/RGBSplitFilter.js deleted file mode 100755 index 7169637..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/RGBSplitFilter.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * An RGB Split Filter. - * - * @class RGBSplitFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.RGBSplitFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - red: {type: '2f', value: {x:20, y:20}}, - green: {type: '2f', value: {x:-20, y:20}}, - blue: {type: '2f', value: {x:20, y:-20}}, - dimensions: {type: '4fv', value:[0,0,0,0]} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform vec2 red;', - 'uniform vec2 green;', - 'uniform vec2 blue;', - 'uniform vec4 dimensions;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/dimensions.xy).r;', - ' gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/dimensions.xy).g;', - ' gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/dimensions.xy).b;', - ' gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;', - '}' - ]; -}; - -PIXI.RGBSplitFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.RGBSplitFilter.prototype.constructor = PIXI.RGBSplitFilter; - -/** - * Red channel offset. - * - * @property red - * @type Point - */ -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'red', { - get: function() { - return this.uniforms.red.value; - }, - set: function(value) { - this.uniforms.red.value = value; - } -}); - -/** - * Green channel offset. - * - * @property green - * @type Point - */ -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'green', { - get: function() { - return this.uniforms.green.value; - }, - set: function(value) { - this.uniforms.green.value = value; - } -}); - -/** - * Blue offset. - * - * @property blue - * @type Point - */ -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'blue', { - get: function() { - return this.uniforms.blue.value; - }, - set: function(value) { - this.uniforms.blue.value = value; - } -}); diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/SepiaFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/SepiaFilter.js deleted file mode 100755 index 5596e53..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/SepiaFilter.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This applies a sepia effect to your Display Objects. - * - * @class SepiaFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.SepiaFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - sepia: {type: '1f', value: 1} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float sepia;', - 'uniform sampler2D uSampler;', - - 'const mat3 sepiaMatrix = mat3(0.3588, 0.7044, 0.1368, 0.2990, 0.5870, 0.1140, 0.2392, 0.4696, 0.0912);', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord);', - ' gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb * sepiaMatrix, sepia);', - // ' gl_FragColor = gl_FragColor * vColor;', - '}' - ]; -}; - -PIXI.SepiaFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.SepiaFilter.prototype.constructor = PIXI.SepiaFilter; - -/** - * The strength of the sepia. 1 will apply the full sepia effect, 0 will make the object its normal color. - * @property sepia - * @type Number -*/ -Object.defineProperty(PIXI.SepiaFilter.prototype, 'sepia', { - get: function() { - return this.uniforms.sepia.value; - }, - set: function(value) { - this.uniforms.sepia.value = value; - } -}); diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/SmartBlurFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/SmartBlurFilter.js deleted file mode 100755 index 44a47f4..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/SmartBlurFilter.js +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A Smart Blur Filter. - * - * @class SmartBlurFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.SmartBlurFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 1/512} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'uniform sampler2D uSampler;', - //'uniform vec2 delta;', - 'const vec2 delta = vec2(1.0/10.0, 0.0);', - //'uniform float darkness;', - - 'float random(vec3 scale, float seed) {', - ' return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);', - '}', - - - 'void main(void) {', - ' vec4 color = vec4(0.0);', - ' float total = 0.0;', - - ' float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);', - - ' for (float t = -30.0; t <= 30.0; t++) {', - ' float percent = (t + offset - 0.5) / 30.0;', - ' float weight = 1.0 - abs(percent);', - ' vec4 sample = texture2D(uSampler, vTextureCoord + delta * percent);', - ' sample.rgb *= sample.a;', - ' color += sample * weight;', - ' total += weight;', - ' }', - - ' gl_FragColor = color / total;', - ' gl_FragColor.rgb /= gl_FragColor.a + 0.00001;', - //' gl_FragColor.rgb *= darkness;', - '}' - ]; -}; - -PIXI.SmartBlurFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.SmartBlurFilter.prototype.constructor = PIXI.SmartBlurFilter; - -/** - * The strength of the blur. - * - * @property blur - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.SmartBlurFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value; - }, - set: function(value) { - this.uniforms.blur.value = value; - } -}); diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/TiltShiftFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/TiltShiftFilter.js deleted file mode 100755 index 2eb3776..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/TiltShiftFilter.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @author Vico @vicocotea - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/ - */ - -/** - * A TiltShift Filter. Manages the pass of both a TiltShiftXFilter and TiltShiftYFilter. - * - * @class TiltShiftFilter - * @constructor - */ -PIXI.TiltShiftFilter = function() -{ - this.tiltShiftXFilter = new PIXI.TiltShiftXFilter(); - this.tiltShiftYFilter = new PIXI.TiltShiftYFilter(); - this.tiltShiftXFilter.updateDelta(); - this.tiltShiftXFilter.updateDelta(); - - this.passes = [this.tiltShiftXFilter, this.tiltShiftYFilter]; -}; - -PIXI.TiltShiftFilter.prototype.constructor = PIXI.TiltShiftFilter; - -/** - * The strength of the blur. - * - * @property blur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'blur', { - get: function() { - return this.tiltShiftXFilter.blur; - }, - set: function(value) { - this.tiltShiftXFilter.blur = this.tiltShiftYFilter.blur = value; - } -}); - -/** - * The strength of the gradient blur. - * - * @property gradientBlur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'gradientBlur', { - get: function() { - return this.tiltShiftXFilter.gradientBlur; - }, - set: function(value) { - this.tiltShiftXFilter.gradientBlur = this.tiltShiftYFilter.gradientBlur = value; - } -}); - -/** - * The Y value to start the effect at. - * - * @property start - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'start', { - get: function() { - return this.tiltShiftXFilter.start; - }, - set: function(value) { - this.tiltShiftXFilter.start = this.tiltShiftYFilter.start = value; - } -}); - -/** - * The Y value to end the effect at. - * - * @property end - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'end', { - get: function() { - return this.tiltShiftXFilter.end; - }, - set: function(value) { - this.tiltShiftXFilter.end = this.tiltShiftYFilter.end = value; - } -}); diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/TiltShiftXFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/TiltShiftXFilter.js deleted file mode 100755 index 29d8f38..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/TiltShiftXFilter.js +++ /dev/null @@ -1,149 +0,0 @@ -/** - * @author Vico @vicocotea - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/ - */ - -/** - * A TiltShiftXFilter. - * - * @class TiltShiftXFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.TiltShiftXFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 100.0}, - gradientBlur: {type: '1f', value: 600.0}, - start: {type: '2f', value:{x:0, y:window.screenHeight / 2}}, - end: {type: '2f', value:{x:600, y:window.screenHeight / 2}}, - delta: {type: '2f', value:{x:30, y:30}}, - texSize: {type: '2f', value:{x:window.screenWidth, y:window.screenHeight}} - }; - - this.updateDelta(); - - this.fragmentSrc = [ - 'precision mediump float;', - 'uniform sampler2D uSampler;', - 'uniform float blur;', - 'uniform float gradientBlur;', - 'uniform vec2 start;', - 'uniform vec2 end;', - 'uniform vec2 delta;', - 'uniform vec2 texSize;', - 'varying vec2 vTextureCoord;', - - 'float random(vec3 scale, float seed) {', - ' return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);', - '}', - - 'void main(void) {', - ' vec4 color = vec4(0.0);', - ' float total = 0.0;', - - ' float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);', - ' vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));', - ' float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;', - - ' for (float t = -30.0; t <= 30.0; t++) {', - ' float percent = (t + offset - 0.5) / 30.0;', - ' float weight = 1.0 - abs(percent);', - ' vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);', - ' sample.rgb *= sample.a;', - ' color += sample * weight;', - ' total += weight;', - ' }', - - ' gl_FragColor = color / total;', - ' gl_FragColor.rgb /= gl_FragColor.a + 0.00001;', - '}' - ]; -}; - -PIXI.TiltShiftXFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.TiltShiftXFilter.prototype.constructor = PIXI.TiltShiftXFilter; - -/** - * The strength of the blur. - * - * @property blur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.blur.value = value; - } -}); - -/** - * The strength of the gradient blur. - * - * @property gradientBlur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'gradientBlur', { - get: function() { - return this.uniforms.gradientBlur.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.gradientBlur.value = value; - } -}); - -/** - * The X value to start the effect at. - * - * @property start - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'start', { - get: function() { - return this.uniforms.start.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.start.value = value; - this.updateDelta(); - } -}); - -/** - * The X value to end the effect at. - * - * @property end - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'end', { - get: function() { - return this.uniforms.end.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.end.value = value; - this.updateDelta(); - } -}); - -/** - * Updates the filter delta values. - * - * @method updateDelta - */ -PIXI.TiltShiftXFilter.prototype.updateDelta = function(){ - var dx = this.uniforms.end.value.x - this.uniforms.start.value.x; - var dy = this.uniforms.end.value.y - this.uniforms.start.value.y; - var d = Math.sqrt(dx * dx + dy * dy); - this.uniforms.delta.value.x = dx / d; - this.uniforms.delta.value.y = dy / d; -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/TiltShiftYFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/TiltShiftYFilter.js deleted file mode 100755 index 3a92851..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/TiltShiftYFilter.js +++ /dev/null @@ -1,149 +0,0 @@ -/** - * @author Vico @vicocotea - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/ - */ - -/** - * A TiltShiftYFilter. - * - * @class TiltShiftYFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.TiltShiftYFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 100.0}, - gradientBlur: {type: '1f', value: 600.0}, - start: {type: '2f', value:{x:0, y:window.screenHeight / 2}}, - end: {type: '2f', value:{x:600, y:window.screenHeight / 2}}, - delta: {type: '2f', value:{x:30, y:30}}, - texSize: {type: '2f', value:{x:window.screenWidth, y:window.screenHeight}} - }; - - this.updateDelta(); - - this.fragmentSrc = [ - 'precision mediump float;', - 'uniform sampler2D uSampler;', - 'uniform float blur;', - 'uniform float gradientBlur;', - 'uniform vec2 start;', - 'uniform vec2 end;', - 'uniform vec2 delta;', - 'uniform vec2 texSize;', - 'varying vec2 vTextureCoord;', - - 'float random(vec3 scale, float seed) {', - ' return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);', - '}', - - 'void main(void) {', - ' vec4 color = vec4(0.0);', - ' float total = 0.0;', - - ' float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);', - ' vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));', - ' float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;', - - ' for (float t = -30.0; t <= 30.0; t++) {', - ' float percent = (t + offset - 0.5) / 30.0;', - ' float weight = 1.0 - abs(percent);', - ' vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);', - ' sample.rgb *= sample.a;', - ' color += sample * weight;', - ' total += weight;', - ' }', - - ' gl_FragColor = color / total;', - ' gl_FragColor.rgb /= gl_FragColor.a + 0.00001;', - '}' - ]; -}; - -PIXI.TiltShiftYFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.TiltShiftYFilter.prototype.constructor = PIXI.TiltShiftYFilter; - -/** - * The strength of the blur. - * - * @property blur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.blur.value = value; - } -}); - -/** - * The strength of the gradient blur. - * - * @property gradientBlur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'gradientBlur', { - get: function() { - return this.uniforms.gradientBlur.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.gradientBlur.value = value; - } -}); - -/** - * The Y value to start the effect at. - * - * @property start - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'start', { - get: function() { - return this.uniforms.start.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.start.value = value; - this.updateDelta(); - } -}); - -/** - * The Y value to end the effect at. - * - * @property end - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'end', { - get: function() { - return this.uniforms.end.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.end.value = value; - this.updateDelta(); - } -}); - -/** - * Updates the filter delta values. - * - * @method updateDelta - */ -PIXI.TiltShiftYFilter.prototype.updateDelta = function(){ - var dx = this.uniforms.end.value.x - this.uniforms.start.value.x; - var dy = this.uniforms.end.value.y - this.uniforms.start.value.y; - var d = Math.sqrt(dx * dx + dy * dy); - this.uniforms.delta.value.x = -dy / d; - this.uniforms.delta.value.y = dx / d; -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/filters/TwistFilter.js b/tutorial-3/pixi.js-master/src/pixi/filters/TwistFilter.js deleted file mode 100755 index 08a3122..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/filters/TwistFilter.js +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This filter applies a twist effect making display objects appear twisted in the given direction. - * - * @class TwistFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.TwistFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - radius: {type: '1f', value:0.5}, - angle: {type: '1f', value:5}, - offset: {type: '2f', value:{x:0.5, y:0.5}} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform vec4 dimensions;', - 'uniform sampler2D uSampler;', - - 'uniform float radius;', - 'uniform float angle;', - 'uniform vec2 offset;', - - 'void main(void) {', - ' vec2 coord = vTextureCoord - offset;', - ' float distance = length(coord);', - - ' if (distance < radius) {', - ' float ratio = (radius - distance) / radius;', - ' float angleMod = ratio * ratio * angle;', - ' float s = sin(angleMod);', - ' float c = cos(angleMod);', - ' coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);', - ' }', - - ' gl_FragColor = texture2D(uSampler, coord+offset);', - '}' - ]; -}; - -PIXI.TwistFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.TwistFilter.prototype.constructor = PIXI.TwistFilter; - -/** - * This point describes the the offset of the twist. - * - * @property offset - * @type Point - */ -Object.defineProperty(PIXI.TwistFilter.prototype, 'offset', { - get: function() { - return this.uniforms.offset.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.offset.value = value; - } -}); - -/** - * This radius of the twist. - * - * @property radius - * @type Number - */ -Object.defineProperty(PIXI.TwistFilter.prototype, 'radius', { - get: function() { - return this.uniforms.radius.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.radius.value = value; - } -}); - -/** - * This angle of the twist. - * - * @property angle - * @type Number - */ -Object.defineProperty(PIXI.TwistFilter.prototype, 'angle', { - get: function() { - return this.uniforms.angle.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.angle.value = value; - } -}); diff --git a/tutorial-3/pixi.js-master/src/pixi/geom/Circle.js b/tutorial-3/pixi.js-master/src/pixi/geom/Circle.js deleted file mode 100755 index 47288c6..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/geom/Circle.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @author Chad Engler - */ - -/** - * The Circle object can be used to specify a hit area for displayObjects - * - * @class Circle - * @constructor - * @param x {Number} The X coordinate of the center of this circle - * @param y {Number} The Y coordinate of the center of this circle - * @param radius {Number} The radius of the circle - */ -PIXI.Circle = function(x, y, radius) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property radius - * @type Number - * @default 0 - */ - this.radius = radius || 0; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.CIRC in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Circle instance - * - * @method clone - * @return {Circle} a copy of the Circle - */ -PIXI.Circle.prototype.clone = function() -{ - return new PIXI.Circle(this.x, this.y, this.radius); -}; - -/** - * Checks whether the x and y coordinates given are contained within this circle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Circle - */ -PIXI.Circle.prototype.contains = function(x, y) -{ - if(this.radius <= 0) - return false; - - var dx = (this.x - x), - dy = (this.y - y), - r2 = this.radius * this.radius; - - dx *= dx; - dy *= dy; - - return (dx + dy <= r2); -}; - -/** -* Returns the framing rectangle of the circle as a PIXI.Rectangle object -* -* @method getBounds -* @return {Rectangle} the framing rectangle -*/ -PIXI.Circle.prototype.getBounds = function() -{ - return new PIXI.Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2); -}; - -// constructor -PIXI.Circle.prototype.constructor = PIXI.Circle; diff --git a/tutorial-3/pixi.js-master/src/pixi/geom/Ellipse.js b/tutorial-3/pixi.js-master/src/pixi/geom/Ellipse.js deleted file mode 100755 index 2700a71..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/geom/Ellipse.js +++ /dev/null @@ -1,100 +0,0 @@ -/** - * @author Chad Engler - */ - -/** - * The Ellipse object can be used to specify a hit area for displayObjects - * - * @class Ellipse - * @constructor - * @param x {Number} The X coordinate of the center of the ellipse - * @param y {Number} The Y coordinate of the center of the ellipse - * @param width {Number} The half width of this ellipse - * @param height {Number} The half height of this ellipse - */ -PIXI.Ellipse = function(x, y, width, height) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.ELIP in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Ellipse instance - * - * @method clone - * @return {Ellipse} a copy of the ellipse - */ -PIXI.Ellipse.prototype.clone = function() -{ - return new PIXI.Ellipse(this.x, this.y, this.width, this.height); -}; - -/** - * Checks whether the x and y coordinates given are contained within this ellipse - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coords are within this ellipse - */ -PIXI.Ellipse.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - //normalize the coords to an ellipse with center 0,0 - var normx = ((x - this.x) / this.width), - normy = ((y - this.y) / this.height); - - normx *= normx; - normy *= normy; - - return (normx + normy <= 1); -}; - -/** -* Returns the framing rectangle of the ellipse as a PIXI.Rectangle object -* -* @method getBounds -* @return {Rectangle} the framing rectangle -*/ -PIXI.Ellipse.prototype.getBounds = function() -{ - return new PIXI.Rectangle(this.x - this.width, this.y - this.height, this.width, this.height); -}; - -// constructor -PIXI.Ellipse.prototype.constructor = PIXI.Ellipse; diff --git a/tutorial-3/pixi.js-master/src/pixi/geom/Matrix.js b/tutorial-3/pixi.js-master/src/pixi/geom/Matrix.js deleted file mode 100755 index b0f043f..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/geom/Matrix.js +++ /dev/null @@ -1,268 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Matrix class is now an object, which makes it a lot faster, - * here is a representation of it : - * | a | b | tx| - * | c | d | ty| - * | 0 | 0 | 1 | - * - * @class Matrix - * @constructor - */ -PIXI.Matrix = function() -{ - /** - * @property a - * @type Number - * @default 1 - */ - this.a = 1; - - /** - * @property b - * @type Number - * @default 0 - */ - this.b = 0; - - /** - * @property c - * @type Number - * @default 0 - */ - this.c = 0; - - /** - * @property d - * @type Number - * @default 1 - */ - this.d = 1; - - /** - * @property tx - * @type Number - * @default 0 - */ - this.tx = 0; - - /** - * @property ty - * @type Number - * @default 0 - */ - this.ty = 0; -}; - -/** - * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows: - * - * a = array[0] - * b = array[1] - * c = array[3] - * d = array[4] - * tx = array[2] - * ty = array[5] - * - * @method fromArray - * @param array {Array} The array that the matrix will be populated from. - */ -PIXI.Matrix.prototype.fromArray = function(array) -{ - this.a = array[0]; - this.b = array[1]; - this.c = array[3]; - this.d = array[4]; - this.tx = array[2]; - this.ty = array[5]; -}; - -/** - * Creates an array from the current Matrix object. - * - * @method toArray - * @param transpose {Boolean} Whether we need to transpose the matrix or not - * @return {Array} the newly created array which contains the matrix - */ -PIXI.Matrix.prototype.toArray = function(transpose) -{ - if(!this.array) this.array = new PIXI.Float32Array(9); - var array = this.array; - - if(transpose) - { - array[0] = this.a; - array[1] = this.b; - array[2] = 0; - array[3] = this.c; - array[4] = this.d; - array[5] = 0; - array[6] = this.tx; - array[7] = this.ty; - array[8] = 1; - } - else - { - array[0] = this.a; - array[1] = this.c; - array[2] = this.tx; - array[3] = this.b; - array[4] = this.d; - array[5] = this.ty; - array[6] = 0; - array[7] = 0; - array[8] = 1; - } - - return array; -}; - -/** - * Get a new position with the current transformation applied. - * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) - * - * @method apply - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix - */ -PIXI.Matrix.prototype.apply = function(pos, newPos) -{ - newPos = newPos || new PIXI.Point(); - - newPos.x = this.a * pos.x + this.c * pos.y + this.tx; - newPos.y = this.b * pos.x + this.d * pos.y + this.ty; - - return newPos; -}; - -/** - * Get a new position with the inverse of the current transformation applied. - * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) - * - * @method applyInverse - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix - */ -PIXI.Matrix.prototype.applyInverse = function(pos, newPos) -{ - newPos = newPos || new PIXI.Point(); - - var id = 1 / (this.a * this.d + this.c * -this.b); - - newPos.x = this.d * id * pos.x + -this.c * id * pos.y + (this.ty * this.c - this.tx * this.d) * id; - newPos.y = this.a * id * pos.y + -this.b * id * pos.x + (-this.ty * this.a + this.tx * this.b) * id; - - return newPos; -}; - -/** - * Translates the matrix on the x and y. - * - * @method translate - * @param {Number} x - * @param {Number} y - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.translate = function(x, y) -{ - this.tx += x; - this.ty += y; - - return this; -}; - -/** - * Applies a scale transformation to the matrix. - * - * @method scale - * @param {Number} x The amount to scale horizontally - * @param {Number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.scale = function(x, y) -{ - this.a *= x; - this.d *= y; - this.c *= x; - this.b *= y; - this.tx *= x; - this.ty *= y; - - return this; -}; - - -/** - * Applies a rotation transformation to the matrix. - * @method rotate - * @param {Number} angle The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.rotate = function(angle) -{ - var cos = Math.cos( angle ); - var sin = Math.sin( angle ); - - var a1 = this.a; - var c1 = this.c; - var tx1 = this.tx; - - this.a = a1 * cos-this.b * sin; - this.b = a1 * sin+this.b * cos; - this.c = c1 * cos-this.d * sin; - this.d = c1 * sin+this.d * cos; - this.tx = tx1 * cos - this.ty * sin; - this.ty = tx1 * sin + this.ty * cos; - - return this; -}; - -/** - * Appends the given Matrix to this Matrix. - * - * @method append - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. - */ -PIXI.Matrix.prototype.append = function(matrix) -{ - var a1 = this.a; - var b1 = this.b; - var c1 = this.c; - var d1 = this.d; - - this.a = matrix.a * a1 + matrix.b * c1; - this.b = matrix.a * b1 + matrix.b * d1; - this.c = matrix.c * a1 + matrix.d * c1; - this.d = matrix.c * b1 + matrix.d * d1; - - this.tx = matrix.tx * a1 + matrix.ty * c1 + this.tx; - this.ty = matrix.tx * b1 + matrix.ty * d1 + this.ty; - - return this; -}; - -/** - * Resets this Matix to an identity (default) matrix. - * - * @method identity - * @return {Matrix} This matrix. Good for chaining method calls. - */ -PIXI.Matrix.prototype.identity = function() -{ - this.a = 1; - this.b = 0; - this.c = 0; - this.d = 1; - this.tx = 0; - this.ty = 0; - - return this; -}; - -PIXI.identityMatrix = new PIXI.Matrix(); diff --git a/tutorial-3/pixi.js-master/src/pixi/geom/Point.js b/tutorial-3/pixi.js-master/src/pixi/geom/Point.js deleted file mode 100755 index 2adcb13..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/geom/Point.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis. - * - * @class Point - * @constructor - * @param x {Number} position of the point on the x axis - * @param y {Number} position of the point on the y axis - */ -PIXI.Point = function(x, y) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; -}; - -/** - * Creates a clone of this point - * - * @method clone - * @return {Point} a copy of the point - */ -PIXI.Point.prototype.clone = function() -{ - return new PIXI.Point(this.x, this.y); -}; - -/** - * Sets the point to a new x and y position. - * If y is omitted, both x and y will be set to x. - * - * @method set - * @param [x=0] {Number} position of the point on the x axis - * @param [y=0] {Number} position of the point on the y axis - */ -PIXI.Point.prototype.set = function(x, y) -{ - this.x = x || 0; - this.y = y || ( (y !== 0) ? this.x : 0 ) ; -}; - -// constructor -PIXI.Point.prototype.constructor = PIXI.Point; \ No newline at end of file diff --git a/tutorial-3/pixi.js-master/src/pixi/geom/Polygon.js b/tutorial-3/pixi.js-master/src/pixi/geom/Polygon.js deleted file mode 100755 index 77f8f56..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/geom/Polygon.js +++ /dev/null @@ -1,90 +0,0 @@ -/** - * @author Adrien Brault - */ - -/** - * @class Polygon - * @constructor - * @param points* {Array(Point)|Array(Number)|Point...|Number...} This can be an array of Points that form the polygon, - * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be - * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the - * arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are - * Numbers. - */ -PIXI.Polygon = function(points) -{ - //if points isn't an array, use arguments as the array - if(!(points instanceof Array))points = Array.prototype.slice.call(arguments); - - //if this is a flat array of numbers, convert it to points - if(points[0] instanceof PIXI.Point) - { - var p = []; - for(var i = 0, il = points.length; i < il; i++) - { - p.push(points[i].x, points[i].y); - } - - points = p; - } - - this.closed = true; - - /** - * An array of the points of this polygon - * @property points - * @type Array(Point)|Array(Number) - * - */ - this.points = points; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.POLY in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this polygon - * - * @method clone - * @return {Polygon} a copy of the polygon - */ -PIXI.Polygon.prototype.clone = function() -{ - var points = this.points.slice(); - return new PIXI.Polygon(points); -}; - -/** - * Checks whether the x and y coordinates passed to this function are contained within this polygon - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this polygon - */ -PIXI.Polygon.prototype.contains = function(x, y) -{ - var inside = false; - - // use some raycasting to test hits - // https://github.com/substack/point-in-polygon/blob/master/index.js - var length = this.points.length / 2; - - for(var i = 0, j = length - 1; i < length; j = i++) - { - var xi = this.points[i * 2], yi = this.points[i * 2 + 1], - xj = this.points[j * 2], yj = this.points[j * 2 + 1], - intersect = ((yi > y) !== (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi); - - if(intersect) inside = !inside; - } - - return inside; -}; - -// constructor -PIXI.Polygon.prototype.constructor = PIXI.Polygon; diff --git a/tutorial-3/pixi.js-master/src/pixi/geom/Rectangle.js b/tutorial-3/pixi.js-master/src/pixi/geom/Rectangle.js deleted file mode 100755 index 61985fa..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/geom/Rectangle.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height. - * - * @class Rectangle - * @constructor - * @param x {Number} The X coordinate of the upper-left corner of the rectangle - * @param y {Number} The Y coordinate of the upper-left corner of the rectangle - * @param width {Number} The overall width of this rectangle - * @param height {Number} The overall height of this rectangle - */ -PIXI.Rectangle = function(x, y, width, height) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RECT in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Rectangle - * - * @method clone - * @return {Rectangle} a copy of the rectangle - */ -PIXI.Rectangle.prototype.clone = function() -{ - return new PIXI.Rectangle(this.x, this.y, this.width, this.height); -}; - -/** - * Checks whether the x and y coordinates given are contained within this Rectangle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Rectangle - */ -PIXI.Rectangle.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - var x1 = this.x; - if(x >= x1 && x <= x1 + this.width) - { - var y1 = this.y; - - if(y >= y1 && y <= y1 + this.height) - { - return true; - } - } - - return false; -}; - -// constructor -PIXI.Rectangle.prototype.constructor = PIXI.Rectangle; - -PIXI.EmptyRectangle = new PIXI.Rectangle(0,0,0,0); \ No newline at end of file diff --git a/tutorial-3/pixi.js-master/src/pixi/geom/RoundedRectangle.js b/tutorial-3/pixi.js-master/src/pixi/geom/RoundedRectangle.js deleted file mode 100755 index 4f75723..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/geom/RoundedRectangle.js +++ /dev/null @@ -1,101 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * The Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height. - * - * @class RoundedRectangle - * @constructor - * @param x {Number} The X coordinate of the upper-left corner of the rounded rectangle - * @param y {Number} The Y coordinate of the upper-left corner of the rounded rectangle - * @param width {Number} The overall width of this rounded rectangle - * @param height {Number} The overall height of this rounded rectangle - * @param radius {Number} Controls the radius of the rounded corners - */ -PIXI.RoundedRectangle = function(x, y, width, height, radius) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - /** - * @property radius - * @type Number - * @default 20 - */ - this.radius = radius || 20; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RRECT in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Rounded Rectangle - * - * @method clone - * @return {RoundedRectangle} a copy of the rounded rectangle - */ -PIXI.RoundedRectangle.prototype.clone = function() -{ - return new PIXI.RoundedRectangle(this.x, this.y, this.width, this.height, this.radius); -}; - -/** - * Checks whether the x and y coordinates given are contained within this Rounded Rectangle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Rounded Rectangle - */ -PIXI.RoundedRectangle.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - var x1 = this.x; - if(x >= x1 && x <= x1 + this.width) - { - var y1 = this.y; - - if(y >= y1 && y <= y1 + this.height) - { - return true; - } - } - - return false; -}; - -// constructor -PIXI.RoundedRectangle.prototype.constructor = PIXI.RoundedRectangle; - diff --git a/tutorial-3/pixi.js-master/src/pixi/loaders/AssetLoader.js b/tutorial-3/pixi.js-master/src/pixi/loaders/AssetLoader.js deleted file mode 100755 index 0e4b858..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/loaders/AssetLoader.js +++ /dev/null @@ -1,167 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * 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 - * @uses EventTarget - * @param assetURLs {Array(String)} 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'. - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.AssetLoader = function(assetURLs, crossorigin) -{ - /** - * The array of asset URLs that are going to be loaded - * - * @property assetURLs - * @type Array(String) - */ - this.assetURLs = assetURLs; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * Maps file extension to loader types - * - * @property loadersByType - * @type Object - */ - this.loadersByType = { - 'jpg': PIXI.ImageLoader, - 'jpeg': PIXI.ImageLoader, - 'png': PIXI.ImageLoader, - 'gif': PIXI.ImageLoader, - 'webp': PIXI.ImageLoader, - 'json': PIXI.JsonLoader, - 'atlas': PIXI.AtlasLoader, - 'anim': PIXI.SpineLoader, - 'xml': PIXI.BitmapFontLoader, - 'fnt': PIXI.BitmapFontLoader - }; -}; - -PIXI.EventTarget.mixin(PIXI.AssetLoader.prototype); - -/** - * Fired when an item has loaded - * @event onProgress - */ - -/** - * Fired when all the assets have loaded - * @event onComplete - */ - -// constructor -PIXI.AssetLoader.prototype.constructor = PIXI.AssetLoader; - -/** - * Given a filename, returns its extension. - * - * @method _getDataType - * @param str {String} the name of the asset - */ -PIXI.AssetLoader.prototype._getDataType = function(str) -{ - var test = 'data:'; - //starts with 'data:' - var start = str.slice(0, test.length).toLowerCase(); - if (start === test) { - var data = str.slice(test.length); - - var sepIdx = data.indexOf(','); - if (sepIdx === -1) //malformed data URI scheme - return null; - - //e.g. 'image/gif;base64' => 'image/gif' - var info = data.slice(0, sepIdx).split(';')[0]; - - //We might need to handle some special cases here... - //standardize text/plain to 'txt' file extension - if (!info || info.toLowerCase() === 'text/plain') - return 'txt'; - - //User specified mime type, try splitting it by '/' - return info.split('/').pop().toLowerCase(); - } - - return null; -}; - -/** - * Starts loading the assets sequentially - * - * @method load - */ -PIXI.AssetLoader.prototype.load = function() -{ - var scope = this; - - function onLoad(evt) { - scope.onAssetLoaded(evt.data.content); - } - - this.loadCount = this.assetURLs.length; - - for (var i=0; i < this.assetURLs.length; i++) - { - var fileName = this.assetURLs[i]; - //first see if we have a data URI scheme.. - var fileType = this._getDataType(fileName); - - //if not, assume it's a file URI - if (!fileType) - fileType = fileName.split('?').shift().split('.').pop().toLowerCase(); - - var Constructor = this.loadersByType[fileType]; - if(!Constructor) - throw new Error(fileType + ' is an unsupported file type'); - - var loader = new Constructor(fileName, this.crossorigin); - - loader.on('loaded', onLoad); - loader.load(); - } -}; - -/** - * Invoked after each file is loaded - * - * @method onAssetLoaded - * @private - */ -PIXI.AssetLoader.prototype.onAssetLoaded = function(loader) -{ - this.loadCount--; - - this.emit('onProgress', { - content: this, - loader: loader, - loaded: this.assetURLs.length - this.loadCount, - total: this.assetURLs.length - }); - - if (this.onProgress) this.onProgress(loader); - - if (!this.loadCount) - { - this.emit('onComplete', { content: this }); - if(this.onComplete) this.onComplete(); - } -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/loaders/AtlasLoader.js b/tutorial-3/pixi.js-master/src/pixi/loaders/AtlasLoader.js deleted file mode 100755 index 5368b6b..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/loaders/AtlasLoader.js +++ /dev/null @@ -1,190 +0,0 @@ -/** - * @author Martin Kelm http://mkelm.github.com - */ - -/** - * The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event. - * - * To generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format. - * - * It is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to 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.fromFrameId() - * - * @class AtlasLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.AtlasLoader = function (url, crossorigin) { - this.url = url; - this.baseUrl = url.replace(/[^\/]*$/, ''); - this.crossorigin = crossorigin; - this.loaded = false; - -}; - -// constructor -PIXI.AtlasLoader.constructor = PIXI.AtlasLoader; - -PIXI.EventTarget.mixin(PIXI.AtlasLoader.prototype); - - /** - * Starts loading the JSON file - * - * @method load - */ -PIXI.AtlasLoader.prototype.load = function () { - this.ajaxRequest = new PIXI.AjaxRequest(); - this.ajaxRequest.onreadystatechange = this.onAtlasLoaded.bind(this); - - this.ajaxRequest.open('GET', this.url, true); - if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/json'); - this.ajaxRequest.send(null); -}; - -/** - * Invoked when the Atlas has fully loaded. Parses the JSON and builds the texture frames. - * - * @method onAtlasLoaded - * @private - */ -PIXI.AtlasLoader.prototype.onAtlasLoaded = function () { - if (this.ajaxRequest.readyState === 4) { - if (this.ajaxRequest.status === 200 || window.location.href.indexOf('http') === -1) { - this.atlas = { - meta : { - image : [] - }, - frames : [] - }; - var result = this.ajaxRequest.responseText.split(/\r?\n/); - var lineCount = -3; - - var currentImageId = 0; - var currentFrame = null; - var nameInNextLine = false; - - var i = 0, - j = 0, - selfOnLoaded = this.onLoaded.bind(this); - - // parser without rotation support yet! - for (i = 0; i < result.length; i++) { - result[i] = result[i].replace(/^\s+|\s+$/g, ''); - if (result[i] === '') { - nameInNextLine = i+1; - } - if (result[i].length > 0) { - if (nameInNextLine === i) { - this.atlas.meta.image.push(result[i]); - currentImageId = this.atlas.meta.image.length - 1; - this.atlas.frames.push({}); - lineCount = -3; - } else if (lineCount > 0) { - if (lineCount % 7 === 1) { // frame name - if (currentFrame != null) { //jshint ignore:line - this.atlas.frames[currentImageId][currentFrame.name] = currentFrame; - } - currentFrame = { name: result[i], frame : {} }; - } else { - var text = result[i].split(' '); - if (lineCount % 7 === 3) { // position - currentFrame.frame.x = Number(text[1].replace(',', '')); - currentFrame.frame.y = Number(text[2]); - } else if (lineCount % 7 === 4) { // size - currentFrame.frame.w = Number(text[1].replace(',', '')); - currentFrame.frame.h = Number(text[2]); - } else if (lineCount % 7 === 5) { // real size - var realSize = { - x : 0, - y : 0, - w : Number(text[1].replace(',', '')), - h : Number(text[2]) - }; - - if (realSize.w > currentFrame.frame.w || realSize.h > currentFrame.frame.h) { - currentFrame.trimmed = true; - currentFrame.realSize = realSize; - } else { - currentFrame.trimmed = false; - } - } - } - } - lineCount++; - } - } - - if (currentFrame != null) { //jshint ignore:line - this.atlas.frames[currentImageId][currentFrame.name] = currentFrame; - } - - if (this.atlas.meta.image.length > 0) { - this.images = []; - for (j = 0; j < this.atlas.meta.image.length; j++) { - // sprite sheet - var textureUrl = this.baseUrl + this.atlas.meta.image[j]; - var frameData = this.atlas.frames[j]; - this.images.push(new PIXI.ImageLoader(textureUrl, this.crossorigin)); - - for (i in frameData) { - var rect = frameData[i].frame; - if (rect) { - PIXI.TextureCache[i] = new PIXI.Texture(this.images[j].texture.baseTexture, { - x: rect.x, - y: rect.y, - width: rect.w, - height: rect.h - }); - if (frameData[i].trimmed) { - PIXI.TextureCache[i].realSize = frameData[i].realSize; - // trim in pixi not supported yet, todo update trim properties if it is done ... - PIXI.TextureCache[i].trim.x = 0; - PIXI.TextureCache[i].trim.y = 0; - } - } - } - } - - this.currentImageId = 0; - for (j = 0; j < this.images.length; j++) { - this.images[j].on('loaded', selfOnLoaded); - } - this.images[this.currentImageId].load(); - - } else { - this.onLoaded(); - } - - } else { - this.onError(); - } - } -}; - -/** - * Invoked when json file has loaded. - * - * @method onLoaded - * @private - */ -PIXI.AtlasLoader.prototype.onLoaded = function () { - if (this.images.length - 1 > this.currentImageId) { - this.currentImageId++; - this.images[this.currentImageId].load(); - } else { - this.loaded = true; - this.emit('loaded', { content: this }); - } -}; - -/** - * Invoked when an error occurs. - * - * @method onError - * @private - */ -PIXI.AtlasLoader.prototype.onError = function () { - this.emit('error', { content: this }); -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/loaders/BitmapFontLoader.js b/tutorial-3/pixi.js-master/src/pixi/loaders/BitmapFontLoader.js deleted file mode 100755 index 3eb54c4..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/loaders/BitmapFontLoader.js +++ /dev/null @@ -1,161 +0,0 @@ -/** - * @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 - * @uses EventTarget - * @constructor - * @param url {String} The url of the sprite sheet JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.BitmapFontLoader = function(url, crossorigin) -{ - /** - * The url of the bitmap font data - * - * @property url - * @type String - */ - this.url = url; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * [read-only] The base url of the bitmap font data - * - * @property baseUrl - * @type String - * @readOnly - */ - this.baseUrl = url.replace(/[^\/]*$/, ''); - - /** - * [read-only] The texture of the bitmap font - * - * @property texture - * @type Texture - */ - this.texture = null; -}; - -// constructor -PIXI.BitmapFontLoader.prototype.constructor = PIXI.BitmapFontLoader; -PIXI.EventTarget.mixin(PIXI.BitmapFontLoader.prototype); - -/** - * Loads the XML font data - * - * @method load - */ -PIXI.BitmapFontLoader.prototype.load = function() -{ - this.ajaxRequest = new PIXI.AjaxRequest(); - this.ajaxRequest.onreadystatechange = this.onXMLLoaded.bind(this); - - this.ajaxRequest.open('GET', this.url, true); - if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/xml'); - this.ajaxRequest.send(null); -}; - -/** - * Invoked when the XML file is loaded, parses the data. - * - * @method onXMLLoaded - * @private - */ -PIXI.BitmapFontLoader.prototype.onXMLLoaded = function() -{ - if (this.ajaxRequest.readyState === 4) - { - if (this.ajaxRequest.status === 200 || window.location.protocol.indexOf('http') === -1) - { - var responseXML = this.ajaxRequest.responseXML; - if(!responseXML || /MSIE 9/i.test(navigator.userAgent) || navigator.isCocoonJS) { - if(typeof(window.DOMParser) === 'function') { - var domparser = new DOMParser(); - responseXML = domparser.parseFromString(this.ajaxRequest.responseText, 'text/xml'); - } else { - var div = document.createElement('div'); - div.innerHTML = this.ajaxRequest.responseText; - responseXML = div; - } - } - - var textureUrl = this.baseUrl + responseXML.getElementsByTagName('page')[0].getAttribute('file'); - var image = new PIXI.ImageLoader(textureUrl, this.crossorigin); - this.texture = image.texture.baseTexture; - - var data = {}; - var info = responseXML.getElementsByTagName('info')[0]; - var common = responseXML.getElementsByTagName('common')[0]; - data.font = info.getAttribute('face'); - data.size = parseInt(info.getAttribute('size'), 10); - data.lineHeight = parseInt(common.getAttribute('lineHeight'), 10); - data.chars = {}; - - //parse letters - var letters = responseXML.getElementsByTagName('char'); - - for (var i = 0; i < letters.length; i++) - { - var charCode = parseInt(letters[i].getAttribute('id'), 10); - - var textureRect = new PIXI.Rectangle( - parseInt(letters[i].getAttribute('x'), 10), - parseInt(letters[i].getAttribute('y'), 10), - parseInt(letters[i].getAttribute('width'), 10), - parseInt(letters[i].getAttribute('height'), 10) - ); - - data.chars[charCode] = { - xOffset: parseInt(letters[i].getAttribute('xoffset'), 10), - yOffset: parseInt(letters[i].getAttribute('yoffset'), 10), - xAdvance: parseInt(letters[i].getAttribute('xadvance'), 10), - kerning: {}, - texture: PIXI.TextureCache[charCode] = new PIXI.Texture(this.texture, textureRect) - - }; - } - - //parse kernings - var kernings = responseXML.getElementsByTagName('kerning'); - for (i = 0; i < kernings.length; i++) - { - var first = parseInt(kernings[i].getAttribute('first'), 10); - var second = parseInt(kernings[i].getAttribute('second'), 10); - var amount = parseInt(kernings[i].getAttribute('amount'), 10); - - data.chars[second].kerning[first] = amount; - - } - - PIXI.BitmapText.fonts[data.font] = data; - - image.addEventListener('loaded', this.onLoaded.bind(this)); - image.load(); - } - } -}; - -/** - * Invoked when all files are loaded (xml/fnt and texture) - * - * @method onLoaded - * @private - */ -PIXI.BitmapFontLoader.prototype.onLoaded = function() -{ - this.emit('loaded', { content: this }); -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/loaders/ImageLoader.js b/tutorial-3/pixi.js-master/src/pixi/loaders/ImageLoader.js deleted file mode 100755 index 1567f29..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/loaders/ImageLoader.js +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @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.fromFrame() and PIXI.Sprite.fromFrame() - * When loaded this class will dispatch a 'loaded' event - * - * @class ImageLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the image - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.ImageLoader = function(url, crossorigin) -{ - /** - * The texture being loaded - * - * @property texture - * @type Texture - */ - this.texture = PIXI.Texture.fromImage(url, crossorigin); - - /** - * if the image is loaded with loadFramedSpriteSheet - * frames will contain the sprite sheet frames - * - * @property frames - * @type Array - * @readOnly - */ - this.frames = []; -}; - -// constructor -PIXI.ImageLoader.prototype.constructor = PIXI.ImageLoader; - -PIXI.EventTarget.mixin(PIXI.ImageLoader.prototype); - -/** - * Loads image or takes it from cache - * - * @method load - */ -PIXI.ImageLoader.prototype.load = function() -{ - if(!this.texture.baseTexture.hasLoaded) - { - this.texture.baseTexture.on('loaded', this.onLoaded.bind(this)); - } - else - { - this.onLoaded(); - } -}; - -/** - * Invoked when image file is loaded or it is already cached and ready to use - * - * @method onLoaded - * @private - */ -PIXI.ImageLoader.prototype.onLoaded = function() -{ - this.emit('loaded', { content: this }); -}; - -/** - * Loads image and split it to uniform sized frames - * - * @method loadFramedSpriteSheet - * @param frameWidth {Number} width of each frame - * @param frameHeight {Number} height of each frame - * @param textureName {String} if given, the frames will be cached in - format - */ -PIXI.ImageLoader.prototype.loadFramedSpriteSheet = function(frameWidth, frameHeight, textureName) -{ - this.frames = []; - var cols = Math.floor(this.texture.width / frameWidth); - var rows = Math.floor(this.texture.height / frameHeight); - - var i=0; - for (var y=0; y 0) - { - textureLoader.addEventListener('loadedBaseTexture', function(evt){ - if (evt.content.content.loadingCount <= 0) - { - originalLoader.onLoaded(); - } - }); - } - else - { - originalLoader.onLoaded(); - } - }; - // start the loading // - atlasLoader.load(); - } - } - else - { - this.onLoaded(); - } -}; - -/** - * Invoke when json file loaded - * - * @method onLoaded - * @private - */ -PIXI.JsonLoader.prototype.onLoaded = function () { - this.loaded = true; - this.dispatchEvent({ - type: 'loaded', - content: this - }); -}; - -/** - * Invoke when error occured - * - * @method onError - * @private - */ -PIXI.JsonLoader.prototype.onError = function () { - - this.dispatchEvent({ - type: 'error', - content: this - }); -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/loaders/SpineLoader.js b/tutorial-3/pixi.js-master/src/pixi/loaders/SpineLoader.js deleted file mode 100755 index c736c50..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/loaders/SpineLoader.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * based on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi - * - * Awesome JS run time provided by EsotericSoftware - * https://github.com/EsotericSoftware/spine-runtimes - * - */ - -/** - * The Spine loader is used to load in JSON spine data - * To generate the data you need to use http://esotericsoftware.com/ and export in the "JSON" format - * Due to a clash of names You will need to change the extension of the spine file from *.json to *.anim for it to load - * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source - * You will need to generate a sprite sheet to accompany the spine data - * When loaded this class will dispatch a "loaded" event - * - * @class SpineLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.SpineLoader = function(url, crossorigin) -{ - /** - * The url of the bitmap font data - * - * @property url - * @type String - */ - this.url = url; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * [read-only] Whether the data has loaded yet - * - * @property loaded - * @type Boolean - * @readOnly - */ - this.loaded = false; -}; - -PIXI.SpineLoader.prototype.constructor = PIXI.SpineLoader; - -PIXI.EventTarget.mixin(PIXI.SpineLoader.prototype); - -/** - * Loads the JSON data - * - * @method load - */ -PIXI.SpineLoader.prototype.load = function () { - - var scope = this; - var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin); - jsonLoader.on('loaded', function (event) { - scope.json = event.data.content.json; - scope.onLoaded(); - }); - jsonLoader.load(); -}; - -/** - * Invoked when JSON file is loaded. - * - * @method onLoaded - * @private - */ -PIXI.SpineLoader.prototype.onLoaded = function () { - this.loaded = true; - this.emit('loaded', { content: this }); -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/loaders/SpriteSheetLoader.js b/tutorial-3/pixi.js-master/src/pixi/loaders/SpriteSheetLoader.js deleted file mode 100755 index 4d50430..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/loaders/SpriteSheetLoader.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * 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 in 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 a 'texture atlas') as it means sprites 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.fromFrameId() - * This loader will load the image file that the Spritesheet points to as well as the data. - * When loaded this class will dispatch a 'loaded' event - * - * @class SpriteSheetLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the sprite sheet JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.SpriteSheetLoader = function (url, crossorigin) { - - /** - * The url of the atlas data - * - * @property url - * @type String - */ - this.url = url; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * [read-only] The base url of the bitmap font data - * - * @property baseUrl - * @type String - * @readOnly - */ - this.baseUrl = url.replace(/[^\/]*$/, ''); - - /** - * The texture being loaded - * - * @property texture - * @type Texture - */ - this.texture = null; - - /** - * The frames of the sprite sheet - * - * @property frames - * @type Object - */ - this.frames = {}; -}; - -// constructor -PIXI.SpriteSheetLoader.prototype.constructor = PIXI.SpriteSheetLoader; - -PIXI.EventTarget.mixin(PIXI.SpriteSheetLoader.prototype); - -/** - * This will begin loading the JSON file - * - * @method load - */ -PIXI.SpriteSheetLoader.prototype.load = function () { - var scope = this; - var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin); - jsonLoader.on('loaded', function (event) { - scope.json = event.data.content.json; - scope.onLoaded(); - }); - jsonLoader.load(); -}; - -/** - * Invoke when all files are loaded (json and texture) - * - * @method onLoaded - * @private - */ -PIXI.SpriteSheetLoader.prototype.onLoaded = function () { - this.emit('loaded', { - content: this - }); -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/primitives/Graphics.js b/tutorial-3/pixi.js-master/src/pixi/primitives/Graphics.js deleted file mode 100755 index fcfdbb9..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/primitives/Graphics.js +++ /dev/null @@ -1,1140 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and color and fill them. - * - * @class Graphics - * @extends DisplayObjectContainer - * @constructor - */ -PIXI.Graphics = function() -{ - PIXI.DisplayObjectContainer.call( this ); - - this.renderable = true; - - /** - * The alpha value used when filling the Graphics object. - * - * @property fillAlpha - * @type Number - */ - this.fillAlpha = 1; - - /** - * The width (thickness) of any lines drawn. - * - * @property lineWidth - * @type Number - */ - this.lineWidth = 0; - - /** - * The color of any lines drawn. - * - * @property lineColor - * @type String - * @default 0 - */ - this.lineColor = 0; - - /** - * Graphics data - * - * @property graphicsData - * @type Array - * @private - */ - this.graphicsData = []; - - /** - * The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint. - * - * @property tint - * @type Number - * @default 0xFFFFFF - */ - this.tint = 0xFFFFFF; - - /** - * The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode. - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - /** - * Current path - * - * @property currentPath - * @type Object - * @private - */ - this.currentPath = null; - - /** - * Array containing some WebGL-related properties used by the WebGL renderer. - * - * @property _webGL - * @type Array - * @private - */ - this._webGL = []; - - /** - * Whether this shape is being used as a mask. - * - * @property isMask - * @type Boolean - */ - this.isMask = false; - - /** - * The bounds' padding used for bounds calculation. - * - * @property boundsPadding - * @type Number - */ - this.boundsPadding = 0; - - this._localBounds = new PIXI.Rectangle(0,0,1,1); - - /** - * Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated. - * - * @property dirty - * @type Boolean - * @private - */ - this.dirty = true; - - /** - * Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated. - * - * @property webGLDirty - * @type Boolean - * @private - */ - this.webGLDirty = false; - - /** - * Used to detect if the cached sprite object needs to be updated. - * - * @property cachedSpriteDirty - * @type Boolean - * @private - */ - this.cachedSpriteDirty = false; - -}; - -// constructor -PIXI.Graphics.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); -PIXI.Graphics.prototype.constructor = PIXI.Graphics; - -/** - * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. - * This is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory. - * It is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas. - * This is not recommended if you are constantly redrawing the graphics element. - * - * @property cacheAsBitmap - * @type Boolean - * @default false - * @private - */ -Object.defineProperty(PIXI.Graphics.prototype, "cacheAsBitmap", { - get: function() { - return this._cacheAsBitmap; - }, - set: function(value) { - this._cacheAsBitmap = value; - - if(this._cacheAsBitmap) - { - - this._generateCachedSprite(); - } - else - { - this.destroyCachedSprite(); - this.dirty = true; - } - - } -}); - -/** - * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method. - * - * @method lineStyle - * @param lineWidth {Number} width of the line to draw, will update the objects stored style - * @param color {Number} color of the line to draw, will update the objects stored style - * @param alpha {Number} alpha of the line to draw, will update the objects stored style - * @return {Graphics} - */ -PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha) -{ - this.lineWidth = lineWidth || 0; - this.lineColor = color || 0; - this.lineAlpha = (arguments.length < 3) ? 1 : alpha; - - if(this.currentPath) - { - if(this.currentPath.shape.points.length) - { - // halfway through a line? start a new one! - this.drawShape( new PIXI.Polygon( this.currentPath.shape.points.slice(-2) )); - return this; - } - - // otherwise its empty so lets just set the line properties - this.currentPath.lineWidth = this.lineWidth; - this.currentPath.lineColor = this.lineColor; - this.currentPath.lineAlpha = this.lineAlpha; - - } - - return this; -}; - -/** - * Moves the current drawing position to x, y. - * - * @method moveTo - * @param x {Number} the X coordinate to move to - * @param y {Number} the Y coordinate to move to - * @return {Graphics} - */ -PIXI.Graphics.prototype.moveTo = function(x, y) -{ - this.drawShape(new PIXI.Polygon([x,y])); - - return this; -}; - -/** - * Draws a line using the current line style from the current drawing position to (x, y); - * The current drawing position is then set to (x, y). - * - * @method lineTo - * @param x {Number} the X coordinate to draw to - * @param y {Number} the Y coordinate to draw to - * @return {Graphics} - */ -PIXI.Graphics.prototype.lineTo = function(x, y) -{ - this.currentPath.shape.points.push(x, y); - this.dirty = true; - - return this; -}; - -/** - * Calculate the points for a quadratic bezier curve and then draws it. - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c - * - * @method quadraticCurveTo - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Graphics} - */ -PIXI.Graphics.prototype.quadraticCurveTo = function(cpX, cpY, toX, toY) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0]; - } - else - { - this.moveTo(0,0); - } - - var xa, - ya, - n = 20, - points = this.currentPath.shape.points; - if(points.length === 0)this.moveTo(0, 0); - - - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - - var j = 0; - for (var i = 1; i <= n; i++ ) - { - j = i / n; - - xa = fromX + ( (cpX - fromX) * j ); - ya = fromY + ( (cpY - fromY) * j ); - - points.push( xa + ( ((cpX + ( (toX - cpX) * j )) - xa) * j ), - ya + ( ((cpY + ( (toY - cpY) * j )) - ya) * j ) ); - } - - - this.dirty = true; - - return this; -}; - -/** - * Calculate the points for a bezier curve and then draws it. - * - * @method bezierCurveTo - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param cpX2 {Number} Second Control point x - * @param cpY2 {Number} Second Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Graphics} - */ -PIXI.Graphics.prototype.bezierCurveTo = function(cpX, cpY, cpX2, cpY2, toX, toY) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0]; - } - else - { - this.moveTo(0,0); - } - - var n = 20, - dt, - dt2, - dt3, - t2, - t3, - points = this.currentPath.shape.points; - - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - - var j = 0; - - for (var i=1; i<=n; i++) - { - j = i / n; - - dt = (1 - j); - dt2 = dt * dt; - dt3 = dt2 * dt; - - t2 = j * j; - t3 = t2 * j; - - points.push( dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX, - dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY); - } - - this.dirty = true; - - return this; -}; - -/* - * The arcTo() method creates an arc/curve between two tangents on the canvas. - * - * "borrowed" from https://code.google.com/p/fxcanvas/ - thanks google! - * - * @method arcTo - * @param x1 {Number} The x-coordinate of the beginning of the arc - * @param y1 {Number} The y-coordinate of the beginning of the arc - * @param x2 {Number} The x-coordinate of the end of the arc - * @param y2 {Number} The y-coordinate of the end of the arc - * @param radius {Number} The radius of the arc - * @return {Graphics} - */ -PIXI.Graphics.prototype.arcTo = function(x1, y1, x2, y2, radius) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0) - { - this.currentPath.shape.points.push(x1, y1); - } - } - else - { - this.moveTo(x1, y1); - } - - var points = this.currentPath.shape.points; - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - var a1 = fromY - y1; - var b1 = fromX - x1; - var a2 = y2 - y1; - var b2 = x2 - x1; - var mm = Math.abs(a1 * b2 - b1 * a2); - - - if (mm < 1.0e-8 || radius === 0) - { - if( points[points.length-2] !== x1 || points[points.length-1] !== y1) - { - //console.log(">>") - points.push(x1, y1); - } - } - else - { - var dd = a1 * a1 + b1 * b1; - var cc = a2 * a2 + b2 * b2; - var tt = a1 * a2 + b1 * b2; - var k1 = radius * Math.sqrt(dd) / mm; - var k2 = radius * Math.sqrt(cc) / mm; - var j1 = k1 * tt / dd; - var j2 = k2 * tt / cc; - var cx = k1 * b2 + k2 * b1; - var cy = k1 * a2 + k2 * a1; - var px = b1 * (k2 + j1); - var py = a1 * (k2 + j1); - var qx = b2 * (k1 + j2); - var qy = a2 * (k1 + j2); - var startAngle = Math.atan2(py - cy, px - cx); - var endAngle = Math.atan2(qy - cy, qx - cx); - - this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1); - } - - this.dirty = true; - - return this; -}; - -/** - * The arc method creates an arc/curve (used to create circles, or parts of circles). - * - * @method arc - * @param cx {Number} The x-coordinate of the center of the circle - * @param cy {Number} The y-coordinate of the center of the circle - * @param radius {Number} The radius of the circle - * @param startAngle {Number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) - * @param endAngle {Number} The ending angle, in radians - * @param anticlockwise {Boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {Graphics} - */ -PIXI.Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) -{ - var startX = cx + Math.cos(startAngle) * radius; - var startY = cy + Math.sin(startAngle) * radius; - var points; - - if( this.currentPath ) - { - points = this.currentPath.shape.points; - - if(points.length === 0) - { - points.push(startX, startY); - } - else if( points[points.length-2] !== startX || points[points.length-1] !== startY) - { - points.push(startX, startY); - } - } - else - { - this.moveTo(startX, startY); - points = this.currentPath.shape.points; - } - - if (startAngle === endAngle)return this; - - if( !anticlockwise && endAngle <= startAngle ) - { - endAngle += Math.PI * 2; - } - else if( anticlockwise && startAngle <= endAngle ) - { - startAngle += Math.PI * 2; - } - - var sweep = anticlockwise ? (startAngle - endAngle) *-1 : (endAngle - startAngle); - var segs = ( Math.abs(sweep)/ (Math.PI * 2) ) * 40; - - if( sweep === 0 ) return this; - - var theta = sweep/(segs*2); - var theta2 = theta*2; - - var cTheta = Math.cos(theta); - var sTheta = Math.sin(theta); - - var segMinus = segs - 1; - - var remainder = ( segMinus % 1 ) / segMinus; - - for(var i=0; i<=segMinus; i++) - { - var real = i + remainder * i; - - - var angle = ((theta) + startAngle + (theta2 * real)); - - var c = Math.cos(angle); - var s = -Math.sin(angle); - - points.push(( (cTheta * c) + (sTheta * s) ) * radius + cx, - ( (cTheta * -s) + (sTheta * c) ) * radius + cy); - } - - this.dirty = true; - - return this; -}; - -/** - * Specifies a simple one-color fill that subsequent calls to other Graphics methods - * (such as lineTo() or drawCircle()) use when drawing. - * - * @method beginFill - * @param color {Number} the color of the fill - * @param alpha {Number} the alpha of the fill - * @return {Graphics} - */ -PIXI.Graphics.prototype.beginFill = function(color, alpha) -{ - this.filling = true; - this.fillColor = color || 0; - this.fillAlpha = (alpha === undefined) ? 1 : alpha; - - if(this.currentPath) - { - if(this.currentPath.shape.points.length <= 2) - { - this.currentPath.fill = this.filling; - this.currentPath.fillColor = this.fillColor; - this.currentPath.fillAlpha = this.fillAlpha; - } - } - return this; -}; - -/** - * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. - * - * @method endFill - * @return {Graphics} - */ -PIXI.Graphics.prototype.endFill = function() -{ - this.filling = false; - this.fillColor = null; - this.fillAlpha = 1; - - return this; -}; - -/** - * Draws a rectangle. - * - * @method drawRect - * - * @param x {Number} The X coord of the top-left of the rectangle - * @param y {Number} The Y coord of the top-left of the rectangle - * @param width {Number} The width of the rectangle - * @param height {Number} The height of the rectangle - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawRect = function( x, y, width, height ) -{ - this.drawShape(new PIXI.Rectangle(x,y, width, height)); - - return this; -}; - -/** - * Draws a rounded rectangle. - * - * @method drawRoundedRect - * - * @param x {Number} The X coord of the top-left of the rectangle - * @param y {Number} The Y coord of the top-left of the rectangle - * @param width {Number} The width of the rectangle - * @param height {Number} The height of the rectangle - * @param radius {Number} Radius of the rectangle corners - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawRoundedRect = function( x, y, width, height, radius ) -{ - this.drawShape(new PIXI.RoundedRectangle(x, y, width, height, radius)); - - return this; -}; - -/** - * Draws a circle. - * - * @method drawCircle - * @param x {Number} The X coordinate of the center of the circle - * @param y {Number} The Y coordinate of the center of the circle - * @param radius {Number} The radius of the circle - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawCircle = function(x, y, radius) -{ - this.drawShape(new PIXI.Circle(x,y, radius)); - - return this; -}; - -/** - * Draws an ellipse. - * - * @method drawEllipse - * @param x {Number} The X coordinate of the center of the ellipse - * @param y {Number} The Y coordinate of the center of the ellipse - * @param width {Number} The half width of the ellipse - * @param height {Number} The half height of the ellipse - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawEllipse = function(x, y, width, height) -{ - this.drawShape(new PIXI.Ellipse(x, y, width, height)); - - return this; -}; - -/** - * Draws a polygon using the given path. - * - * @method drawPolygon - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawPolygon = function(path) -{ - if(!(path instanceof Array))path = Array.prototype.slice.call(arguments); - this.drawShape(new PIXI.Polygon(path)); - return this; -}; - -/** - * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. - * - * @method clear - * @return {Graphics} - */ -PIXI.Graphics.prototype.clear = function() -{ - this.lineWidth = 0; - this.filling = false; - - this.dirty = true; - this.clearDirty = true; - this.graphicsData = []; - - return this; -}; - -/** - * Useful function that returns a texture of the graphics object that can then be used to create sprites - * This can be quite useful if your geometry is complicated and needs to be reused multiple times. - * - * @method generateTexture - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts - * @return {Texture} a texture of the graphics object - */ -PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode) -{ - resolution = resolution || 1; - - var bounds = this.getBounds(); - - var canvasBuffer = new PIXI.CanvasBuffer(bounds.width * resolution, bounds.height * resolution); - - var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas, scaleMode); - texture.baseTexture.resolution = resolution; - - canvasBuffer.context.scale(resolution, resolution); - - canvasBuffer.context.translate(-bounds.x,-bounds.y); - - PIXI.CanvasGraphics.renderGraphics(this, canvasBuffer.context); - - return texture; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Graphics.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(this.visible === false || this.alpha === 0 || this.isMask === true)return; - - if(this._cacheAsBitmap) - { - - if(this.dirty || this.cachedSpriteDirty) - { - - this._generateCachedSprite(); - - // we will also need to update the texture on the gpu too! - this.updateCachedSpriteTexture(); - - this.cachedSpriteDirty = false; - this.dirty = false; - } - - this._cachedSprite.worldAlpha = this.worldAlpha; - PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession); - - return; - } - else - { - renderSession.spriteBatch.stop(); - renderSession.blendModeManager.setBlendMode(this.blendMode); - - if(this._mask)renderSession.maskManager.pushMask(this._mask, renderSession); - if(this._filters)renderSession.filterManager.pushFilter(this._filterBlock); - - // check blend mode - if(this.blendMode !== renderSession.spriteBatch.currentBlendMode) - { - renderSession.spriteBatch.currentBlendMode = this.blendMode; - var blendModeWebGL = PIXI.blendModesWebGL[renderSession.spriteBatch.currentBlendMode]; - renderSession.spriteBatch.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); - } - - // check if the webgl graphic needs to be updated - if(this.webGLDirty) - { - this.dirty = true; - this.webGLDirty = false; - } - - PIXI.WebGLGraphics.renderGraphics(this, renderSession); - - // only render if it has children! - if(this.children.length) - { - renderSession.spriteBatch.start(); - - // simple render children! - for(var i=0, j=this.children.length; i maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - - this._bounds.x = minX; - this._bounds.width = maxX - minX; - - this._bounds.y = minY; - this._bounds.height = maxY - minY; - - return this._bounds; -}; - -/** - * Update the bounds of the object - * - * @method updateLocalBounds - */ -PIXI.Graphics.prototype.updateLocalBounds = function() -{ - var minX = Infinity; - var maxX = -Infinity; - - var minY = Infinity; - var maxY = -Infinity; - - if(this.graphicsData.length) - { - var shape, points, x, y, w, h; - - for (var i = 0; i < this.graphicsData.length; i++) { - var data = this.graphicsData[i]; - var type = data.type; - var lineWidth = data.lineWidth; - shape = data.shape; - - - if(type === PIXI.Graphics.RECT || type === PIXI.Graphics.RREC) - { - x = shape.x - lineWidth/2; - y = shape.y - lineWidth/2; - w = shape.width + lineWidth; - h = shape.height + lineWidth; - - minX = x < minX ? x : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y < minY ? y : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else if(type === PIXI.Graphics.CIRC) - { - x = shape.x; - y = shape.y; - w = shape.radius + lineWidth/2; - h = shape.radius + lineWidth/2; - - minX = x - w < minX ? x - w : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y - h < minY ? y - h : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else if(type === PIXI.Graphics.ELIP) - { - x = shape.x; - y = shape.y; - w = shape.width + lineWidth/2; - h = shape.height + lineWidth/2; - - minX = x - w < minX ? x - w : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y - h < minY ? y - h : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else - { - // POLY - points = shape.points; - - for (var j = 0; j < points.length; j+=2) - { - - x = points[j]; - y = points[j+1]; - minX = x-lineWidth < minX ? x-lineWidth : minX; - maxX = x+lineWidth > maxX ? x+lineWidth : maxX; - - minY = y-lineWidth < minY ? y-lineWidth : minY; - maxY = y+lineWidth > maxY ? y+lineWidth : maxY; - } - } - } - } - else - { - minX = 0; - maxX = 0; - minY = 0; - maxY = 0; - } - - var padding = this.boundsPadding; - - this._localBounds.x = minX - padding; - this._localBounds.width = (maxX - minX) + padding * 2; - - this._localBounds.y = minY - padding; - this._localBounds.height = (maxY - minY) + padding * 2; -}; - -/** - * Generates the cached sprite when the sprite has cacheAsBitmap = true - * - * @method _generateCachedSprite - * @private - */ -PIXI.Graphics.prototype._generateCachedSprite = function() -{ - var bounds = this.getLocalBounds(); - - if(!this._cachedSprite) - { - var canvasBuffer = new PIXI.CanvasBuffer(bounds.width, bounds.height); - var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); - - this._cachedSprite = new PIXI.Sprite(texture); - this._cachedSprite.buffer = canvasBuffer; - - this._cachedSprite.worldTransform = this.worldTransform; - } - else - { - this._cachedSprite.buffer.resize(bounds.width, bounds.height); - } - - // leverage the anchor to account for the offset of the element - this._cachedSprite.anchor.x = -( bounds.x / bounds.width ); - this._cachedSprite.anchor.y = -( bounds.y / bounds.height ); - - // this._cachedSprite.buffer.context.save(); - this._cachedSprite.buffer.context.translate(-bounds.x,-bounds.y); - - // make sure we set the alpha of the graphics to 1 for the render.. - this.worldAlpha = 1; - - // now render the graphic.. - PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context); - this._cachedSprite.alpha = this.alpha; -}; - -/** - * Updates texture size based on canvas size - * - * @method updateCachedSpriteTexture - * @private - */ -PIXI.Graphics.prototype.updateCachedSpriteTexture = function() -{ - var cachedSprite = this._cachedSprite; - var texture = cachedSprite.texture; - var canvas = cachedSprite.buffer.canvas; - - texture.baseTexture.width = canvas.width; - texture.baseTexture.height = canvas.height; - texture.crop.width = texture.frame.width = canvas.width; - texture.crop.height = texture.frame.height = canvas.height; - - cachedSprite._width = canvas.width; - cachedSprite._height = canvas.height; - - // update the dirty base textures - texture.baseTexture.dirty(); -}; - -/** - * Destroys a previous cached sprite. - * - * @method destroyCachedSprite - */ -PIXI.Graphics.prototype.destroyCachedSprite = function() -{ - this._cachedSprite.texture.destroy(true); - - // let the gc collect the unused sprite - // TODO could be object pooled! - this._cachedSprite = null; -}; - -/** - * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. - * - * @method drawShape - * @param {Circle|Rectangle|Ellipse|Line|Polygon} shape The Shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. - */ -PIXI.Graphics.prototype.drawShape = function(shape) -{ - if(this.currentPath) - { - // check current path! - if(this.currentPath.shape.points.length <= 2)this.graphicsData.pop(); - } - - this.currentPath = null; - - var data = new PIXI.GraphicsData(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, shape); - - this.graphicsData.push(data); - - if(data.type === PIXI.Graphics.POLY) - { - data.shape.closed = this.filling; - this.currentPath = data; - } - - this.dirty = true; - - return data; -}; - -/** - * A GraphicsData object. - * - * @class GraphicsData - * @constructor - */ -PIXI.GraphicsData = function(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, shape) -{ - this.lineWidth = lineWidth; - this.lineColor = lineColor; - this.lineAlpha = lineAlpha; - this._lineTint = lineColor; - - this.fillColor = fillColor; - this.fillAlpha = fillAlpha; - this._fillTint = fillColor; - this.fill = fill; - - this.shape = shape; - this.type = shape.type; -}; - -// SOME TYPES: -PIXI.Graphics.POLY = 0; -PIXI.Graphics.RECT = 1; -PIXI.Graphics.CIRC = 2; -PIXI.Graphics.ELIP = 3; -PIXI.Graphics.RREC = 4; - -PIXI.Polygon.prototype.type = PIXI.Graphics.POLY; -PIXI.Rectangle.prototype.type = PIXI.Graphics.RECT; -PIXI.Circle.prototype.type = PIXI.Graphics.CIRC; -PIXI.Ellipse.prototype.type = PIXI.Graphics.ELIP; -PIXI.RoundedRectangle.prototype.type = PIXI.Graphics.RREC; - diff --git a/tutorial-3/pixi.js-master/src/pixi/renderers/canvas/CanvasGraphics.js b/tutorial-3/pixi.js-master/src/pixi/renderers/canvas/CanvasGraphics.js deleted file mode 100755 index 1fb5372..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/renderers/canvas/CanvasGraphics.js +++ /dev/null @@ -1,358 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - - -/** - * A set of functions used by the canvas renderer to draw the primitive graphics data. - * - * @class CanvasGraphics - * @static - */ -PIXI.CanvasGraphics = function() -{ -}; - -/* - * Renders a PIXI.Graphics object to a canvas. - * - * @method renderGraphics - * @static - * @param graphics {Graphics} the actual graphics object to render - * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas - */ -PIXI.CanvasGraphics.renderGraphics = function(graphics, context) -{ - var worldAlpha = graphics.worldAlpha; - - if(graphics.dirty) - { - this.updateGraphicsTint(graphics); - graphics.dirty = false; - } - - - for (var i = 0; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - var shape = data.shape; - - var fillColor = data._fillTint; - var lineColor = data._lineTint; - - context.lineWidth = data.lineWidth; - - if(data.type === PIXI.Graphics.POLY) - { - context.beginPath(); - - var points = shape.points; - - context.moveTo(points[0], points[1]); - - for (var j=1; j < points.length/2; j++) - { - context.lineTo(points[j * 2], points[j * 2 + 1]); - } - - if(shape.closed) - { - context.lineTo(points[0], points[1]); - } - - // if the first and last point are the same close the path - much neater :) - if(points[0] === points[points.length-2] && points[1] === points[points.length-1]) - { - context.closePath(); - } - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if(data.type === PIXI.Graphics.RECT) - { - - if(data.fillColor || data.fillColor === 0) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fillRect(shape.x, shape.y, shape.width, shape.height); - - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.strokeRect(shape.x, shape.y, shape.width, shape.height); - } - } - else if(data.type === PIXI.Graphics.CIRC) - { - // TODO - need to be Undefined! - context.beginPath(); - context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI); - context.closePath(); - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if(data.type === PIXI.Graphics.ELIP) - { - // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas - - var w = shape.width * 2; - var h = shape.height * 2; - - var x = shape.x - w/2; - var y = shape.y - h/2; - - context.beginPath(); - - var kappa = 0.5522848, - ox = (w / 2) * kappa, // control point offset horizontal - oy = (h / 2) * kappa, // control point offset vertical - xe = x + w, // x-end - ye = y + h, // y-end - xm = x + w / 2, // x-middle - ym = y + h / 2; // y-middle - - context.moveTo(x, ym); - context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); - context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); - context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); - context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); - - context.closePath(); - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if (data.type === PIXI.Graphics.RREC) - { - var rx = shape.x; - var ry = shape.y; - var width = shape.width; - var height = shape.height; - var radius = shape.radius; - - var maxRadius = Math.min(width, height) / 2 | 0; - radius = radius > maxRadius ? maxRadius : radius; - - context.beginPath(); - context.moveTo(rx, ry + radius); - context.lineTo(rx, ry + height - radius); - context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height); - context.lineTo(rx + width - radius, ry + height); - context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius); - context.lineTo(rx + width, ry + radius); - context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry); - context.lineTo(rx + radius, ry); - context.quadraticCurveTo(rx, ry, rx, ry + radius); - context.closePath(); - - if(data.fillColor || data.fillColor === 0) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - } -}; - -/* - * Renders a graphics mask - * - * @static - * @private - * @method renderGraphicsMask - * @param graphics {Graphics} the graphics which will be used as a mask - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas - */ -PIXI.CanvasGraphics.renderGraphicsMask = function(graphics, context) -{ - var len = graphics.graphicsData.length; - - if(len === 0) return; - - if(len > 1) - { - len = 1; - window.console.log('Pixi.js warning: masks in canvas can only mask using the first path in the graphics object'); - } - - for (var i = 0; i < 1; i++) - { - var data = graphics.graphicsData[i]; - var shape = data.shape; - - if(data.type === PIXI.Graphics.POLY) - { - context.beginPath(); - - var points = shape.points; - - context.moveTo(points[0], points[1]); - - for (var j=1; j < points.length/2; j++) - { - context.lineTo(points[j * 2], points[j * 2 + 1]); - } - - // if the first and last point are the same close the path - much neater :) - if(points[0] === points[points.length-2] && points[1] === points[points.length-1]) - { - context.closePath(); - } - - } - else if(data.type === PIXI.Graphics.RECT) - { - context.beginPath(); - context.rect(shape.x, shape.y, shape.width, shape.height); - context.closePath(); - } - else if(data.type === PIXI.Graphics.CIRC) - { - // TODO - need to be Undefined! - context.beginPath(); - context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI); - context.closePath(); - } - else if(data.type === PIXI.Graphics.ELIP) - { - - // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas - - var w = shape.width * 2; - var h = shape.height * 2; - - var x = shape.x - w/2; - var y = shape.y - h/2; - - context.beginPath(); - - var kappa = 0.5522848, - ox = (w / 2) * kappa, // control point offset horizontal - oy = (h / 2) * kappa, // control point offset vertical - xe = x + w, // x-end - ye = y + h, // y-end - xm = x + w / 2, // x-middle - ym = y + h / 2; // y-middle - - context.moveTo(x, ym); - context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); - context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); - context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); - context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); - context.closePath(); - } - else if (data.type === PIXI.Graphics.RREC) - { - - var pts = shape.points; - var rx = pts[0]; - var ry = pts[1]; - var width = pts[2]; - var height = pts[3]; - var radius = pts[4]; - - var maxRadius = Math.min(width, height) / 2 | 0; - radius = radius > maxRadius ? maxRadius : radius; - - context.beginPath(); - context.moveTo(rx, ry + radius); - context.lineTo(rx, ry + height - radius); - context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height); - context.lineTo(rx + width - radius, ry + height); - context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius); - context.lineTo(rx + width, ry + radius); - context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry); - context.lineTo(rx + radius, ry); - context.quadraticCurveTo(rx, ry, rx, ry + radius); - context.closePath(); - } - } -}; - -PIXI.CanvasGraphics.updateGraphicsTint = function(graphics) -{ - if(graphics.tint === 0xFFFFFF)return; - - var tintR = (graphics.tint >> 16 & 0xFF) / 255; - var tintG = (graphics.tint >> 8 & 0xFF) / 255; - var tintB = (graphics.tint & 0xFF)/ 255; - - for (var i = 0; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - - var fillColor = data.fillColor | 0; - var lineColor = data.lineColor | 0; - - /* - var colorR = (fillColor >> 16 & 0xFF) / 255; - var colorG = (fillColor >> 8 & 0xFF) / 255; - var colorB = (fillColor & 0xFF) / 255; - - colorR *= tintR; - colorG *= tintG; - colorB *= tintB; - - fillColor = ((colorR*255 << 16) + (colorG*255 << 8) + colorB*255); - - colorR = (lineColor >> 16 & 0xFF) / 255; - colorG = (lineColor >> 8 & 0xFF) / 255; - colorB = (lineColor & 0xFF) / 255; - - colorR *= tintR; - colorG *= tintG; - colorB *= tintB; - - lineColor = ((colorR*255 << 16) + (colorG*255 << 8) + colorB*255); - */ - - // super inline cos im an optimization NAZI :) - data._fillTint = (((fillColor >> 16 & 0xFF) / 255 * tintR*255 << 16) + ((fillColor >> 8 & 0xFF) / 255 * tintG*255 << 8) + (fillColor & 0xFF) / 255 * tintB*255); - data._lineTint = (((lineColor >> 16 & 0xFF) / 255 * tintR*255 << 16) + ((lineColor >> 8 & 0xFF) / 255 * tintG*255 << 8) + (lineColor & 0xFF) / 255 * tintB*255); - - } -}; - diff --git a/tutorial-3/pixi.js-master/src/pixi/renderers/canvas/CanvasRenderer.js b/tutorial-3/pixi.js-master/src/pixi/renderers/canvas/CanvasRenderer.js deleted file mode 100755 index 86a12f9..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/renderers/canvas/CanvasRenderer.js +++ /dev/null @@ -1,345 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The CanvasRenderer draws the Stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. - * Don't forget to add the CanvasRenderer.view to your DOM or you will not see anything :) - * - * @class CanvasRenderer - * @constructor - * @param [width=800] {Number} the width of the canvas view - * @param [height=600] {Number} the height of the canvas view - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * @param [options.clearBeforeRender=true] {Boolean} This sets if the CanvasRenderer will clear the canvas or not before the new render pass. - */ -PIXI.CanvasRenderer = function(width, height, options) -{ - if(options) - { - for (var i in PIXI.defaultRenderOptions) - { - if (typeof options[i] === "undefined") options[i] = PIXI.defaultRenderOptions[i]; - } - } - else - { - options = PIXI.defaultRenderOptions; - } - - if(!PIXI.defaultRenderer) - { - PIXI.sayHello("Canvas"); - PIXI.defaultRenderer = this; - } - - /** - * The renderer type. - * - * @property type - * @type Number - */ - this.type = PIXI.CANVAS_RENDERER; - - /** - * The resolution of the canvas. - * - * @property resolution - * @type Number - */ - this.resolution = options.resolution; - - /** - * This sets if the CanvasRenderer will clear the canvas or not before the new render pass. - * If the Stage is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color. - * If the Stage is transparent Pixi will use clearRect to clear the canvas every frame. - * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set. - * - * @property clearBeforeRender - * @type Boolean - * @default - */ - this.clearBeforeRender = options.clearBeforeRender; - - /** - * Whether the render view is transparent - * - * @property transparent - * @type Boolean - */ - this.transparent = options.transparent; - - /** - * Whether the render view should be resized automatically - * - * @property autoResize - * @type Boolean - */ - this.autoResize = options.autoResize || false; - - - /** - * The width of the canvas view - * - * @property width - * @type Number - * @default 800 - */ - this.width = width || 800; - - /** - * The height of the canvas view - * - * @property height - * @type Number - * @default 600 - */ - this.height = height || 600; - - this.width *= this.resolution; - this.height *= this.resolution; - - /** - * The canvas element that everything is drawn to. - * - * @property view - * @type HTMLCanvasElement - */ - this.view = options.view || document.createElement( "canvas" ); - - /** - * The canvas 2d context that everything is drawn with - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.view.getContext( "2d", { alpha: this.transparent } ); - - /** - * Boolean flag controlling canvas refresh. - * - * @property refresh - * @type Boolean - */ - this.refresh = true; - - this.view.width = this.width * this.resolution; - this.view.height = this.height * this.resolution; - - /** - * Internal var. - * - * @property count - * @type Number - */ - this.count = 0; - - /** - * Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer - * @property maskManager - * @type CanvasMaskManager - */ - this.maskManager = new PIXI.CanvasMaskManager(); - - /** - * The render session is just a bunch of parameter used for rendering - * @property renderSession - * @type Object - */ - this.renderSession = { - context: this.context, - maskManager: this.maskManager, - scaleMode: null, - smoothProperty: null, - /** - * If true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation. - * Handy for crisp pixel art and speed on legacy devices. - * - */ - roundPixels: false - }; - - this.mapBlendModes(); - - this.resize(width, height); - - if("imageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "imageSmoothingEnabled"; - else if("webkitImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "webkitImageSmoothingEnabled"; - else if("mozImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "mozImageSmoothingEnabled"; - else if("oImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "oImageSmoothingEnabled"; - else if ("msImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "msImageSmoothingEnabled"; -}; - -// constructor -PIXI.CanvasRenderer.prototype.constructor = PIXI.CanvasRenderer; - -/** - * Renders the Stage to this canvas view - * - * @method render - * @param stage {Stage} the Stage element to be rendered - */ -PIXI.CanvasRenderer.prototype.render = function(stage) -{ - stage.updateTransform(); - - this.context.setTransform(1,0,0,1,0,0); - - this.context.globalAlpha = 1; - - this.renderSession.currentBlendMode = PIXI.blendModes.NORMAL; - this.context.globalCompositeOperation = PIXI.blendModesCanvas[PIXI.blendModes.NORMAL]; - - if (navigator.isCocoonJS && this.view.screencanvas) { - this.context.fillStyle = "black"; - this.context.clear(); - } - - if (this.clearBeforeRender) - { - if (this.transparent) - { - this.context.clearRect(0, 0, this.width, this.height); - } - else - { - this.context.fillStyle = stage.backgroundColorString; - this.context.fillRect(0, 0, this.width , this.height); - } - } - - this.renderDisplayObject(stage); - - // run interaction! - if(stage.interactive) - { - //need to add some events! - if(!stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = true; - stage.interactionManager.setTarget(this); - } - } -}; - -/** - * Removes everything from the renderer and optionally removes the Canvas DOM element. - * - * @method destroy - * @param [removeView=true] {boolean} Removes the Canvas element from the DOM. - */ -PIXI.CanvasRenderer.prototype.destroy = function(removeView) -{ - if (typeof removeView === "undefined") { removeView = true; } - - if (removeView && this.view.parent) - { - this.view.parent.removeChild(this.view); - } - - this.view = null; - this.context = null; - this.maskManager = null; - this.renderSession = null; - -}; - -/** - * Resizes the canvas view to the specified width and height - * - * @method resize - * @param width {Number} the new width of the canvas view - * @param height {Number} the new height of the canvas view - */ -PIXI.CanvasRenderer.prototype.resize = function(width, height) -{ - this.width = width * this.resolution; - this.height = height * this.resolution; - - this.view.width = this.width; - this.view.height = this.height; - - if (this.autoResize) { - this.view.style.width = this.width / this.resolution + "px"; - this.view.style.height = this.height / this.resolution + "px"; - } -}; - -/** - * Renders a display object - * - * @method renderDisplayObject - * @param displayObject {DisplayObject} The displayObject to render - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas - * @private - */ -PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject, context) -{ - this.renderSession.context = context || this.context; - this.renderSession.resolution = this.resolution; - displayObject._renderCanvas(this.renderSession); -}; - -/** - * Maps Pixi blend modes to canvas blend modes. - * - * @method mapBlendModes - * @private - */ -PIXI.CanvasRenderer.prototype.mapBlendModes = function() -{ - if(!PIXI.blendModesCanvas) - { - PIXI.blendModesCanvas = []; - - if(PIXI.canUseNewCanvasBlendModes()) - { - PIXI.blendModesCanvas[PIXI.blendModes.NORMAL] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.ADD] = "lighter"; //IS THIS OK??? - PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "multiply"; - PIXI.blendModesCanvas[PIXI.blendModes.SCREEN] = "screen"; - PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY] = "overlay"; - PIXI.blendModesCanvas[PIXI.blendModes.DARKEN] = "darken"; - PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN] = "lighten"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "color-dodge"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "color-burn"; - PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "hard-light"; - PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "soft-light"; - PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "difference"; - PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "exclusion"; - PIXI.blendModesCanvas[PIXI.blendModes.HUE] = "hue"; - PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "saturation"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR] = "color"; - PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "luminosity"; - } - else - { - // this means that the browser does not support the cool new blend modes in canvas "cough" ie "cough" - PIXI.blendModesCanvas[PIXI.blendModes.NORMAL] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.ADD] = "lighter"; //IS THIS OK??? - PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SCREEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.DARKEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.HUE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "source-over"; - } - } -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasBuffer.js b/tutorial-3/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasBuffer.js deleted file mode 100755 index b53d851..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasBuffer.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Creates a Canvas element of the given size. - * - * @class CanvasBuffer - * @constructor - * @param width {Number} the width for the newly created canvas - * @param height {Number} the height for the newly created canvas - */ -PIXI.CanvasBuffer = function(width, height) -{ - /** - * The width of the Canvas in pixels. - * - * @property width - * @type Number - */ - this.width = width; - - /** - * The height of the Canvas in pixels. - * - * @property height - * @type Number - */ - this.height = height; - - /** - * The Canvas object that belongs to this CanvasBuffer. - * - * @property canvas - * @type HTMLCanvasElement - */ - this.canvas = document.createElement("canvas"); - - /** - * A CanvasRenderingContext2D object representing a two-dimensional rendering context. - * - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.canvas.getContext("2d"); - - this.canvas.width = width; - this.canvas.height = height; -}; - -PIXI.CanvasBuffer.prototype.constructor = PIXI.CanvasBuffer; - -/** - * Clears the canvas that was created by the CanvasBuffer class. - * - * @method clear - * @private - */ -PIXI.CanvasBuffer.prototype.clear = function() -{ - this.context.setTransform(1, 0, 0, 1, 0, 0); - this.context.clearRect(0,0, this.width, this.height); -}; - -/** - * Resizes the canvas to the specified width and height. - * - * @method resize - * @param width {Number} the new width of the canvas - * @param height {Number} the new height of the canvas - */ -PIXI.CanvasBuffer.prototype.resize = function(width, height) -{ - this.width = this.canvas.width = width; - this.height = this.canvas.height = height; -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasMaskManager.js b/tutorial-3/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasMaskManager.js deleted file mode 100755 index 748adda..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasMaskManager.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A set of functions used to handle masking. - * - * @class CanvasMaskManager - * @constructor - */ -PIXI.CanvasMaskManager = function() -{ -}; - -PIXI.CanvasMaskManager.prototype.constructor = PIXI.CanvasMaskManager; - -/** - * This method adds it to the current stack of masks. - * - * @method pushMask - * @param maskData {Object} the maskData that will be pushed - * @param renderSession {Object} The renderSession whose context will be used for this mask manager. - */ -PIXI.CanvasMaskManager.prototype.pushMask = function(maskData, renderSession) -{ - var context = renderSession.context; - - context.save(); - - var cacheAlpha = maskData.alpha; - var transform = maskData.worldTransform; - - var resolution = renderSession.resolution; - - context.setTransform(transform.a * resolution, - transform.b * resolution, - transform.c * resolution, - transform.d * resolution, - transform.tx * resolution, - transform.ty * resolution); - - PIXI.CanvasGraphics.renderGraphicsMask(maskData, context); - - context.clip(); - - maskData.worldAlpha = cacheAlpha; -}; - -/** - * Restores the current drawing context to the state it was before the mask was applied. - * - * @method popMask - * @param renderSession {Object} The renderSession whose context will be used for this mask manager. - */ -PIXI.CanvasMaskManager.prototype.popMask = function(renderSession) -{ - renderSession.context.restore(); -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasTinter.js b/tutorial-3/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasTinter.js deleted file mode 100755 index dd50b06..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasTinter.js +++ /dev/null @@ -1,242 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Utility methods for Sprite/Texture tinting. - * - * @class CanvasTinter - * @static - */ -PIXI.CanvasTinter = function() -{ -}; - -/** - * Basically this method just needs a sprite and a color and tints the sprite with the given color. - * - * @method getTintedTexture - * @static - * @param sprite {Sprite} the sprite to tint - * @param color {Number} the color to use to tint the sprite with - * @return {HTMLCanvasElement} The tinted canvas - */ -PIXI.CanvasTinter.getTintedTexture = function(sprite, color) -{ - var texture = sprite.texture; - - color = PIXI.CanvasTinter.roundColor(color); - - var stringColor = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - - texture.tintCache = texture.tintCache || {}; - - if(texture.tintCache[stringColor]) return texture.tintCache[stringColor]; - - // clone texture.. - var canvas = PIXI.CanvasTinter.canvas || document.createElement("canvas"); - - //PIXI.CanvasTinter.tintWithPerPixel(texture, stringColor, canvas); - PIXI.CanvasTinter.tintMethod(texture, color, canvas); - - if(PIXI.CanvasTinter.convertTintToImage) - { - // is this better? - var tintImage = new Image(); - tintImage.src = canvas.toDataURL(); - - texture.tintCache[stringColor] = tintImage; - } - else - { - texture.tintCache[stringColor] = canvas; - // if we are not converting the texture to an image then we need to lose the reference to the canvas - PIXI.CanvasTinter.canvas = null; - } - - return canvas; -}; - -/** - * Tint a texture using the "multiply" operation. - * - * @method tintWithMultiply - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithMultiply = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - - context.fillRect(0, 0, crop.width, crop.height); - - context.globalCompositeOperation = "multiply"; - - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - context.globalCompositeOperation = "destination-atop"; - - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); -}; - -/** - * Tint a texture using the "overlay" operation. - * - * @method tintWithOverlay - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithOverlay = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.globalCompositeOperation = "copy"; - context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - context.fillRect(0, 0, crop.width, crop.height); - - context.globalCompositeOperation = "destination-atop"; - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - //context.globalCompositeOperation = "copy"; -}; - -/** - * Tint a texture pixel per pixel. - * - * @method tintPerPixel - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithPerPixel = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.globalCompositeOperation = "copy"; - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - var rgbValues = PIXI.hex2rgb(color); - var r = rgbValues[0], g = rgbValues[1], b = rgbValues[2]; - - var pixelData = context.getImageData(0, 0, crop.width, crop.height); - - var pixels = pixelData.data; - - for (var i = 0; i < pixels.length; i += 4) - { - pixels[i+0] *= r; - pixels[i+1] *= g; - pixels[i+2] *= b; - } - - context.putImageData(pixelData, 0, 0); -}; - -/** - * Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel. - * - * @method roundColor - * @static - * @param color {number} the color to round, should be a hex color - */ -PIXI.CanvasTinter.roundColor = function(color) -{ - var step = PIXI.CanvasTinter.cacheStepsPerColorChannel; - - var rgbValues = PIXI.hex2rgb(color); - - rgbValues[0] = Math.min(255, (rgbValues[0] / step) * step); - rgbValues[1] = Math.min(255, (rgbValues[1] / step) * step); - rgbValues[2] = Math.min(255, (rgbValues[2] / step) * step); - - return PIXI.rgb2hex(rgbValues); -}; - -/** - * Number of steps which will be used as a cap when rounding colors. - * - * @property cacheStepsPerColorChannel - * @type Number - * @static - */ -PIXI.CanvasTinter.cacheStepsPerColorChannel = 8; - -/** - * Tint cache boolean flag. - * - * @property convertTintToImage - * @type Boolean - * @static - */ -PIXI.CanvasTinter.convertTintToImage = false; - -/** - * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. - * - * @property canUseMultiply - * @type Boolean - * @static - */ -PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes(); - -/** - * The tinting method that will be used. - * - * @method tintMethod - * @static - */ -PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel; diff --git a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/WebGLRenderer.js b/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/WebGLRenderer.js deleted file mode 100755 index 02b30e4..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/WebGLRenderer.js +++ /dev/null @@ -1,554 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -PIXI.glContexts = []; // this is where we store the webGL contexts for easy access. -PIXI.instances = []; - -/** - * The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer - * should be used for browsers that support webGL. This Render works by automatically managing webGLBatchs. - * So no need for Sprite Batches or Sprite Clouds. - * Don't forget to add the view to your DOM or you will not see anything :) - * - * @class WebGLRenderer - * @constructor - * @param [width=0] {Number} the width of the canvas view - * @param [height=0] {Number} the height of the canvas view - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - */ -PIXI.WebGLRenderer = function(width, height, options) -{ - if(options) - { - for (var i in PIXI.defaultRenderOptions) - { - if (typeof options[i] === 'undefined') options[i] = PIXI.defaultRenderOptions[i]; - } - } - else - { - options = PIXI.defaultRenderOptions; - } - - if(!PIXI.defaultRenderer) - { - PIXI.sayHello('webGL'); - PIXI.defaultRenderer = this; - } - - /** - * @property type - * @type Number - */ - this.type = PIXI.WEBGL_RENDERER; - - /** - * The resolution of the renderer - * - * @property resolution - * @type Number - * @default 1 - */ - this.resolution = options.resolution; - - // do a catch.. only 1 webGL renderer.. - - /** - * Whether the render view is transparent - * - * @property transparent - * @type Boolean - */ - this.transparent = options.transparent; - - /** - * Whether the render view should be resized automatically - * - * @property autoResize - * @type Boolean - */ - this.autoResize = options.autoResize || false; - - /** - * The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering. - * - * @property preserveDrawingBuffer - * @type Boolean - */ - this.preserveDrawingBuffer = options.preserveDrawingBuffer; - - /** - * This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true: - * If the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0). - * If the Stage is transparent, Pixi will clear to the target Stage's background color. - * Disable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set. - * - * @property clearBeforeRender - * @type Boolean - * @default - */ - this.clearBeforeRender = options.clearBeforeRender; - - /** - * The width of the canvas view - * - * @property width - * @type Number - * @default 800 - */ - this.width = width || 800; - - /** - * The height of the canvas view - * - * @property height - * @type Number - * @default 600 - */ - this.height = height || 600; - - /** - * The canvas element that everything is drawn to - * - * @property view - * @type HTMLCanvasElement - */ - this.view = options.view || document.createElement( 'canvas' ); - - // deal with losing context.. - - /** - * @property contextLostBound - * @type Function - */ - this.contextLostBound = this.handleContextLost.bind(this); - - /** - * @property contextRestoredBound - * @type Function - */ - this.contextRestoredBound = this.handleContextRestored.bind(this); - - this.view.addEventListener('webglcontextlost', this.contextLostBound, false); - this.view.addEventListener('webglcontextrestored', this.contextRestoredBound, false); - - /** - * @property _contextOptions - * @type Object - * @private - */ - this._contextOptions = { - alpha: this.transparent, - antialias: options.antialias, // SPEED UP?? - premultipliedAlpha:this.transparent && this.transparent !== 'notMultiplied', - stencil:true, - preserveDrawingBuffer: options.preserveDrawingBuffer - }; - - /** - * @property projection - * @type Point - */ - this.projection = new PIXI.Point(); - - /** - * @property offset - * @type Point - */ - this.offset = new PIXI.Point(0, 0); - - // time to create the render managers! each one focuses on managing a state in webGL - - /** - * Deals with managing the shader programs and their attribs - * @property shaderManager - * @type WebGLShaderManager - */ - this.shaderManager = new PIXI.WebGLShaderManager(); - - /** - * Manages the rendering of sprites - * @property spriteBatch - * @type WebGLSpriteBatch - */ - this.spriteBatch = new PIXI.WebGLSpriteBatch(); - - /** - * Manages the masks using the stencil buffer - * @property maskManager - * @type WebGLMaskManager - */ - this.maskManager = new PIXI.WebGLMaskManager(); - - /** - * Manages the filters - * @property filterManager - * @type WebGLFilterManager - */ - this.filterManager = new PIXI.WebGLFilterManager(); - - /** - * Manages the stencil buffer - * @property stencilManager - * @type WebGLStencilManager - */ - this.stencilManager = new PIXI.WebGLStencilManager(); - - /** - * Manages the blendModes - * @property blendModeManager - * @type WebGLBlendModeManager - */ - this.blendModeManager = new PIXI.WebGLBlendModeManager(); - - /** - * TODO remove - * @property renderSession - * @type Object - */ - this.renderSession = {}; - this.renderSession.gl = this.gl; - this.renderSession.drawCount = 0; - this.renderSession.shaderManager = this.shaderManager; - this.renderSession.maskManager = this.maskManager; - this.renderSession.filterManager = this.filterManager; - this.renderSession.blendModeManager = this.blendModeManager; - this.renderSession.spriteBatch = this.spriteBatch; - this.renderSession.stencilManager = this.stencilManager; - this.renderSession.renderer = this; - this.renderSession.resolution = this.resolution; - - // time init the context.. - this.initContext(); - - // map some webGL blend modes.. - this.mapBlendModes(); -}; - -// constructor -PIXI.WebGLRenderer.prototype.constructor = PIXI.WebGLRenderer; - -/** -* @method initContext -*/ -PIXI.WebGLRenderer.prototype.initContext = function() -{ - var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); - this.gl = gl; - - if (!gl) { - // fail, not able to get a context - throw new Error('This browser does not support webGL. Try using the canvas renderer'); - } - - this.glContextId = gl.id = PIXI.WebGLRenderer.glContextId ++; - - PIXI.glContexts[this.glContextId] = gl; - - PIXI.instances[this.glContextId] = this; - - // set up the default pixi settings.. - gl.disable(gl.DEPTH_TEST); - gl.disable(gl.CULL_FACE); - gl.enable(gl.BLEND); - - // need to set the context for all the managers... - this.shaderManager.setContext(gl); - this.spriteBatch.setContext(gl); - this.maskManager.setContext(gl); - this.filterManager.setContext(gl); - this.blendModeManager.setContext(gl); - this.stencilManager.setContext(gl); - - this.renderSession.gl = this.gl; - - // now resize and we are good to go! - this.resize(this.width, this.height); -}; - -/** - * Renders the stage to its webGL view - * - * @method render - * @param stage {Stage} the Stage element to be rendered - */ -PIXI.WebGLRenderer.prototype.render = function(stage) -{ - // no point rendering if our context has been blown up! - if(this.contextLost)return; - - // if rendering a new stage clear the batches.. - if(this.__stage !== stage) - { - if(stage.interactive)stage.interactionManager.removeEvents(); - - // TODO make this work - // dont think this is needed any more? - this.__stage = stage; - } - - // update the scene graph - stage.updateTransform(); - - var gl = this.gl; - - // interaction - if(stage._interactive) - { - //need to add some events! - if(!stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = true; - stage.interactionManager.setTarget(this); - } - } - else - { - if(stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = false; - stage.interactionManager.setTarget(this); - } - } - - // -- Does this need to be set every frame? -- // - gl.viewport(0, 0, this.width, this.height); - - // make sure we are bound to the main frame buffer - gl.bindFramebuffer(gl.FRAMEBUFFER, null); - - if (this.clearBeforeRender) - { - if(this.transparent) - { - gl.clearColor(0, 0, 0, 0); - } - else - { - gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], 1); - } - - gl.clear (gl.COLOR_BUFFER_BIT); - } - - this.renderDisplayObject( stage, this.projection ); -}; - -/** - * Renders a Display Object. - * - * @method renderDisplayObject - * @param displayObject {DisplayObject} The DisplayObject to render - * @param projection {Point} The projection - * @param buffer {Array} a standard WebGL buffer - */ -PIXI.WebGLRenderer.prototype.renderDisplayObject = function(displayObject, projection, buffer) -{ - this.renderSession.blendModeManager.setBlendMode(PIXI.blendModes.NORMAL); - - // reset the render session data.. - this.renderSession.drawCount = 0; - - // make sure to flip the Y if using a render texture.. - this.renderSession.flipY = buffer ? -1 : 1; - - // set the default projection - this.renderSession.projection = projection; - - //set the default offset - this.renderSession.offset = this.offset; - - // start the sprite batch - this.spriteBatch.begin(this.renderSession); - - // start the filter manager - this.filterManager.begin(this.renderSession, buffer); - - // render the scene! - displayObject._renderWebGL(this.renderSession); - - // finish the sprite batch - this.spriteBatch.end(); -}; - -/** - * Resizes the webGL view to the specified width and height. - * - * @method resize - * @param width {Number} the new width of the webGL view - * @param height {Number} the new height of the webGL view - */ -PIXI.WebGLRenderer.prototype.resize = function(width, height) -{ - this.width = width * this.resolution; - this.height = height * this.resolution; - - this.view.width = this.width; - this.view.height = this.height; - - if (this.autoResize) { - this.view.style.width = this.width / this.resolution + 'px'; - this.view.style.height = this.height / this.resolution + 'px'; - } - - this.gl.viewport(0, 0, this.width, this.height); - - this.projection.x = this.width / 2 / this.resolution; - this.projection.y = -this.height / 2 / this.resolution; -}; - -/** - * Updates and Creates a WebGL texture for the renderers context. - * - * @method updateTexture - * @param texture {Texture} the texture to update - */ -PIXI.WebGLRenderer.prototype.updateTexture = function(texture) -{ - if(!texture.hasLoaded )return; - - var gl = this.gl; - - if(!texture._glTextures[gl.id])texture._glTextures[gl.id] = gl.createTexture(); - - gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]); - - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultipliedAlpha); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source); - - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - - - if(texture.mipmap && PIXI.isPowerOfTwo(texture.width, texture.height)) - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR_MIPMAP_LINEAR : gl.NEAREST_MIPMAP_NEAREST); - gl.generateMipmap(gl.TEXTURE_2D); - } - else - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - } - - // reguler... - if(!texture._powerOf2) - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - } - else - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT); - } - - texture._dirty[gl.id] = false; - - return texture._glTextures[gl.id]; -}; - -/** - * Handles a lost webgl context - * - * @method handleContextLost - * @param event {Event} - * @private - */ -PIXI.WebGLRenderer.prototype.handleContextLost = function(event) -{ - event.preventDefault(); - this.contextLost = true; -}; - -/** - * Handles a restored webgl context - * - * @method handleContextRestored - * @param event {Event} - * @private - */ -PIXI.WebGLRenderer.prototype.handleContextRestored = function() -{ - this.initContext(); - - // empty all the ol gl textures as they are useless now - for(var key in PIXI.TextureCache) - { - var texture = PIXI.TextureCache[key].baseTexture; - texture._glTextures = []; - } - - this.contextLost = false; -}; - -/** - * Removes everything from the renderer (event listeners, spritebatch, etc...) - * - * @method destroy - */ -PIXI.WebGLRenderer.prototype.destroy = function() -{ - // remove listeners - this.view.removeEventListener('webglcontextlost', this.contextLostBound); - this.view.removeEventListener('webglcontextrestored', this.contextRestoredBound); - - PIXI.glContexts[this.glContextId] = null; - - this.projection = null; - this.offset = null; - - // time to create the render managers! each one focuses on managine a state in webGL - this.shaderManager.destroy(); - this.spriteBatch.destroy(); - this.maskManager.destroy(); - this.filterManager.destroy(); - - this.shaderManager = null; - this.spriteBatch = null; - this.maskManager = null; - this.filterManager = null; - - this.gl = null; - this.renderSession = null; -}; - -/** - * Maps Pixi blend modes to WebGL blend modes. - * - * @method mapBlendModes - */ -PIXI.WebGLRenderer.prototype.mapBlendModes = function() -{ - var gl = this.gl; - - if(!PIXI.blendModesWebGL) - { - PIXI.blendModesWebGL = []; - - PIXI.blendModesWebGL[PIXI.blendModes.NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.ADD] = [gl.SRC_ALPHA, gl.DST_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SCREEN] = [gl.SRC_ALPHA, gl.ONE]; - PIXI.blendModesWebGL[PIXI.blendModes.OVERLAY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.DARKEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.LIGHTEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR_DODGE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR_BURN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.HARD_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SOFT_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.DIFFERENCE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.EXCLUSION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.HUE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SATURATION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.LUMINOSITY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - } -}; - -PIXI.WebGLRenderer.glContextId = 0; diff --git a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js b/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js deleted file mode 100755 index bbd3259..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ /dev/null @@ -1,122 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class ComplexPrimitiveShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.ComplexPrimitiveShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - - 'precision mediump float;', - - 'varying vec4 vColor;', - - 'void main(void) {', - ' gl_FragColor = vColor;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - //'attribute vec4 aColor;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - - 'uniform vec3 tint;', - 'uniform float alpha;', - 'uniform vec3 color;', - 'uniform float flipY;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);', - ' vColor = vec4(color * alpha * tint, alpha);',//" * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.ComplexPrimitiveShader.prototype.constructor = PIXI.ComplexPrimitiveShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.ComplexPrimitiveShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.tintColor = gl.getUniformLocation(program, 'tint'); - this.color = gl.getUniformLocation(program, 'color'); - this.flipY = gl.getUniformLocation(program, 'flipY'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - // this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - this.attributes = [this.aVertexPosition, this.colorAttribute]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.ComplexPrimitiveShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attribute = null; -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiFastShader.js b/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiFastShader.js deleted file mode 100755 index 8e685e7..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiFastShader.js +++ /dev/null @@ -1,155 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class PixiFastShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PixiFastShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying float vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aPositionCoord;', - 'attribute vec2 aScale;', - 'attribute float aRotation;', - 'attribute vec2 aTextureCoord;', - 'attribute float aColor;', - - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - 'uniform mat3 uMatrix;', - - 'varying vec2 vTextureCoord;', - 'varying float vColor;', - - 'const vec2 center = vec2(-1.0, 1.0);', - - 'void main(void) {', - ' vec2 v;', - ' vec2 sv = aVertexPosition * aScale;', - ' v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);', - ' v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);', - ' v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;', - ' gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - // ' vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;', - ' vColor = aColor;', - '}' - ]; - - /** - * A local texture counter for multi-texture shaders. - * @property textureCount - * @type Number - */ - this.textureCount = 0; - - this.init(); -}; - -PIXI.PixiFastShader.prototype.constructor = PIXI.PixiFastShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PixiFastShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.dimensions = gl.getUniformLocation(program, 'dimensions'); - this.uMatrix = gl.getUniformLocation(program, 'uMatrix'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aPositionCoord = gl.getAttribLocation(program, 'aPositionCoord'); - - this.aScale = gl.getAttribLocation(program, 'aScale'); - this.aRotation = gl.getAttribLocation(program, 'aRotation'); - - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - // Begin worst hack eva // - - // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? - // maybe its somthing to do with the current state of the gl context. - // Im convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel - // If theres any webGL people that know why could happen please help :) - if(this.colorAttribute === -1) - { - this.colorAttribute = 2; - } - - this.attributes = [this.aVertexPosition, this.aPositionCoord, this.aScale, this.aRotation, this.aTextureCoord, this.colorAttribute]; - - // End worst hack eva // - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PixiFastShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiShader.js b/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiShader.js deleted file mode 100755 index e70be7f..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiShader.js +++ /dev/null @@ -1,389 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * @author Richard Davey http://www.photonstorm.com @photonstorm - */ - -/** -* @class PixiShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PixiShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]; - - /** - * A local texture counter for multi-texture shaders. - * @property textureCount - * @type Number - */ - this.textureCount = 0; - - /** - * A local flag - * @property firstRun - * @type Boolean - * @private - */ - this.firstRun = true; - - /** - * A dirty flag - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * Uniform attributes cache. - * @property attributes - * @type Array - * @private - */ - this.attributes = []; - - this.init(); -}; - -PIXI.PixiShader.prototype.constructor = PIXI.PixiShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PixiShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc || PIXI.PixiShader.defaultVertexSrc, this.fragmentSrc); - - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.dimensions = gl.getUniformLocation(program, 'dimensions'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - // Begin worst hack eva // - - // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? - // maybe its something to do with the current state of the gl context. - // I'm convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel - // If theres any webGL people that know why could happen please help :) - if(this.colorAttribute === -1) - { - this.colorAttribute = 2; - } - - this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute]; - - // End worst hack eva // - - // add those custom shaders! - for (var key in this.uniforms) - { - // get the uniform locations.. - this.uniforms[key].uniformLocation = gl.getUniformLocation(program, key); - } - - this.initUniforms(); - - this.program = program; -}; - -/** -* Initialises the shader uniform values. -* -* Uniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/ -* http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf -* -* @method initUniforms -*/ -PIXI.PixiShader.prototype.initUniforms = function() -{ - this.textureCount = 1; - var gl = this.gl; - var uniform; - - for (var key in this.uniforms) - { - uniform = this.uniforms[key]; - - var type = uniform.type; - - if (type === 'sampler2D') - { - uniform._init = false; - - if (uniform.value !== null) - { - this.initSampler2D(uniform); - } - } - else if (type === 'mat2' || type === 'mat3' || type === 'mat4') - { - // These require special handling - uniform.glMatrix = true; - uniform.glValueLength = 1; - - if (type === 'mat2') - { - uniform.glFunc = gl.uniformMatrix2fv; - } - else if (type === 'mat3') - { - uniform.glFunc = gl.uniformMatrix3fv; - } - else if (type === 'mat4') - { - uniform.glFunc = gl.uniformMatrix4fv; - } - } - else - { - // GL function reference - uniform.glFunc = gl['uniform' + type]; - - if (type === '2f' || type === '2i') - { - uniform.glValueLength = 2; - } - else if (type === '3f' || type === '3i') - { - uniform.glValueLength = 3; - } - else if (type === '4f' || type === '4i') - { - uniform.glValueLength = 4; - } - else - { - uniform.glValueLength = 1; - } - } - } - -}; - -/** -* Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded) -* -* @method initSampler2D -*/ -PIXI.PixiShader.prototype.initSampler2D = function(uniform) -{ - if (!uniform.value || !uniform.value.baseTexture || !uniform.value.baseTexture.hasLoaded) - { - return; - } - - var gl = this.gl; - - gl.activeTexture(gl['TEXTURE' + this.textureCount]); - gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]); - - // Extended texture data - if (uniform.textureData) - { - var data = uniform.textureData; - - // GLTexture = mag linear, min linear_mipmap_linear, wrap repeat + gl.generateMipmap(gl.TEXTURE_2D); - // GLTextureLinear = mag/min linear, wrap clamp - // GLTextureNearestRepeat = mag/min NEAREST, wrap repeat - // GLTextureNearest = mag/min nearest, wrap clamp - // AudioTexture = whatever + luminance + width 512, height 2, border 0 - // KeyTexture = whatever + luminance + width 256, height 2, border 0 - - // magFilter can be: gl.LINEAR, gl.LINEAR_MIPMAP_LINEAR or gl.NEAREST - // wrapS/T can be: gl.CLAMP_TO_EDGE or gl.REPEAT - - var magFilter = (data.magFilter) ? data.magFilter : gl.LINEAR; - var minFilter = (data.minFilter) ? data.minFilter : gl.LINEAR; - var wrapS = (data.wrapS) ? data.wrapS : gl.CLAMP_TO_EDGE; - var wrapT = (data.wrapT) ? data.wrapT : gl.CLAMP_TO_EDGE; - var format = (data.luminance) ? gl.LUMINANCE : gl.RGBA; - - if (data.repeat) - { - wrapS = gl.REPEAT; - wrapT = gl.REPEAT; - } - - gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, !!data.flipY); - - if (data.width) - { - var width = (data.width) ? data.width : 512; - var height = (data.height) ? data.height : 2; - var border = (data.border) ? data.border : 0; - - // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels); - gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, border, format, gl.UNSIGNED_BYTE, null); - } - else - { - // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, ImageData? pixels); - gl.texImage2D(gl.TEXTURE_2D, 0, format, gl.RGBA, gl.UNSIGNED_BYTE, uniform.value.baseTexture.source); - } - - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrapS); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT); - } - - gl.uniform1i(uniform.uniformLocation, this.textureCount); - - uniform._init = true; - - this.textureCount++; - -}; - -/** -* Updates the shader uniform values. -* -* @method syncUniforms -*/ -PIXI.PixiShader.prototype.syncUniforms = function() -{ - this.textureCount = 1; - var uniform; - var gl = this.gl; - - // This would probably be faster in an array and it would guarantee key order - for (var key in this.uniforms) - { - uniform = this.uniforms[key]; - - if (uniform.glValueLength === 1) - { - if (uniform.glMatrix === true) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.transpose, uniform.value); - } - else - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value); - } - } - else if (uniform.glValueLength === 2) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y); - } - else if (uniform.glValueLength === 3) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z); - } - else if (uniform.glValueLength === 4) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z, uniform.value.w); - } - else if (uniform.type === 'sampler2D') - { - if (uniform._init) - { - gl.activeTexture(gl['TEXTURE' + this.textureCount]); - - if(uniform.value.baseTexture._dirty[gl.id]) - { - PIXI.instances[gl.id].updateTexture(uniform.value.baseTexture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]); - } - - // gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id] || PIXI.createWebGLTexture( uniform.value.baseTexture, gl)); - gl.uniform1i(uniform.uniformLocation, this.textureCount); - this.textureCount++; - } - else - { - this.initSampler2D(uniform); - } - } - } - -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PixiShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; - -/** -* The Default Vertex shader source. -* -* @property defaultVertexSrc -* @type String -*/ -PIXI.PixiShader.defaultVertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aTextureCoord;', - 'attribute vec4 aColor;', - - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - - 'const vec2 center = vec2(-1.0, 1.0);', - - 'void main(void) {', - ' gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - ' vColor = vec4(aColor.rgb * aColor.a, aColor.a);', - '}' -]; \ No newline at end of file diff --git a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/shaders/PrimitiveShader.js b/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/shaders/PrimitiveShader.js deleted file mode 100755 index bdaab89..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/shaders/PrimitiveShader.js +++ /dev/null @@ -1,117 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class PrimitiveShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PrimitiveShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' gl_FragColor = vColor;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec4 aColor;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - 'uniform float alpha;', - 'uniform float flipY;', - 'uniform vec3 tint;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);', - ' vColor = aColor * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.PrimitiveShader.prototype.constructor = PIXI.PrimitiveShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PrimitiveShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.tintColor = gl.getUniformLocation(program, 'tint'); - this.flipY = gl.getUniformLocation(program, 'flipY'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - this.attributes = [this.aVertexPosition, this.colorAttribute]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PrimitiveShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/shaders/StripShader.js b/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/shaders/StripShader.js deleted file mode 100755 index 6b47244..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/shaders/StripShader.js +++ /dev/null @@ -1,123 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class StripShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.StripShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - // 'varying float vColor;', - 'uniform float alpha;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * alpha;', - // ' gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);',//gl_FragColor * alpha;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aTextureCoord;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - // 'uniform float alpha;', - // 'uniform vec3 tint;', - 'varying vec2 vTextureCoord;', - // 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - // ' vColor = aColor * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.StripShader.prototype.constructor = PIXI.StripShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.StripShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - //this.dimensions = gl.getUniformLocation(this.program, 'dimensions'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - - this.attributes = [this.aVertexPosition, this.aTextureCoord]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.StripShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attribute = null; -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/FilterTexture.js b/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/FilterTexture.js deleted file mode 100755 index 0340289..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/FilterTexture.js +++ /dev/null @@ -1,110 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class FilterTexture -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -* @param width {Number} the horizontal range of the filter -* @param height {Number} the vertical range of the filter -* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values -*/ -PIXI.FilterTexture = function(gl, width, height, scaleMode) -{ - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - // next time to create a frame buffer and texture - - /** - * @property frameBuffer - * @type Any - */ - this.frameBuffer = gl.createFramebuffer(); - - /** - * @property texture - * @type Any - */ - this.texture = gl.createTexture(); - - /** - * @property scaleMode - * @type Number - */ - scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - gl.bindTexture(gl.TEXTURE_2D, this.texture); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer ); - - gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer ); - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); - - // required for masking a mask?? - this.renderBuffer = gl.createRenderbuffer(); - gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer); - gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.renderBuffer); - - this.resize(width, height); -}; - -PIXI.FilterTexture.prototype.constructor = PIXI.FilterTexture; - -/** -* Clears the filter texture. -* -* @method clear -*/ -PIXI.FilterTexture.prototype.clear = function() -{ - var gl = this.gl; - - gl.clearColor(0,0,0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); -}; - -/** - * Resizes the texture to the specified width and height - * - * @method resize - * @param width {Number} the new width of the texture - * @param height {Number} the new height of the texture - */ -PIXI.FilterTexture.prototype.resize = function(width, height) -{ - if(this.width === width && this.height === height) return; - - this.width = width; - this.height = height; - - var gl = this.gl; - - gl.bindTexture(gl.TEXTURE_2D, this.texture); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width , height , 0, gl.RGBA, gl.UNSIGNED_BYTE, null); - // update the stencil buffer width and height - gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer); - gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width , height ); -}; - -/** -* Destroys the filter texture. -* -* @method destroy -*/ -PIXI.FilterTexture.prototype.destroy = function() -{ - var gl = this.gl; - gl.deleteFramebuffer( this.frameBuffer ); - gl.deleteTexture( this.texture ); - - this.frameBuffer = null; - this.texture = null; -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js b/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js deleted file mode 100755 index 3de0ec9..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLBlendModeManager -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLBlendModeManager = function() -{ - /** - * @property currentBlendMode - * @type Number - */ - this.currentBlendMode = 99999; -}; - -PIXI.WebGLBlendModeManager.prototype.constructor = PIXI.WebGLBlendModeManager; - -/** - * Sets the WebGL Context. - * - * @method setContext - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLBlendModeManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Sets-up the given blendMode from WebGL's point of view. -* -* @method setBlendMode -* @param blendMode {Number} the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD -*/ -PIXI.WebGLBlendModeManager.prototype.setBlendMode = function(blendMode) -{ - if(this.currentBlendMode === blendMode)return false; - - this.currentBlendMode = blendMode; - - var blendModeWebGL = PIXI.blendModesWebGL[this.currentBlendMode]; - this.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); - - return true; -}; - -/** -* Destroys this object. -* -* @method destroy -*/ -PIXI.WebGLBlendModeManager.prototype.destroy = function() -{ - this.gl = null; -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js b/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js deleted file mode 100755 index d870f50..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js +++ /dev/null @@ -1,428 +0,0 @@ -/** - * @author Mat Groves - * - * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ - * for creating the original pixi version! - * - * Heavily inspired by LibGDX's WebGLSpriteBatch: - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java - */ - -/** -* @class WebGLFastSpriteBatch -* @constructor -*/ -PIXI.WebGLFastSpriteBatch = function(gl) -{ - /** - * @property vertSize - * @type Number - */ - this.vertSize = 10; - - /** - * @property maxSize - * @type Number - */ - this.maxSize = 6000;//Math.pow(2, 16) / this.vertSize; - - /** - * @property size - * @type Number - */ - this.size = this.maxSize; - - //the total number of floats in our batch - var numVerts = this.size * 4 * this.vertSize; - - //the total number of indices in our batch - var numIndices = this.maxSize * 6; - - /** - * Vertex data - * @property vertices - * @type Float32Array - */ - this.vertices = new PIXI.Float32Array(numVerts); - - /** - * Index data - * @property indices - * @type Uint16Array - */ - this.indices = new PIXI.Uint16Array(numIndices); - - /** - * @property vertexBuffer - * @type Object - */ - this.vertexBuffer = null; - - /** - * @property indexBuffer - * @type Object - */ - this.indexBuffer = null; - - /** - * @property lastIndexCount - * @type Number - */ - this.lastIndexCount = 0; - - for (var i=0, j=0; i < numIndices; i += 6, j += 4) - { - this.indices[i + 0] = j + 0; - this.indices[i + 1] = j + 1; - this.indices[i + 2] = j + 2; - this.indices[i + 3] = j + 0; - this.indices[i + 4] = j + 2; - this.indices[i + 5] = j + 3; - } - - /** - * @property drawing - * @type Boolean - */ - this.drawing = false; - - /** - * @property currentBatchSize - * @type Number - */ - this.currentBatchSize = 0; - - /** - * @property currentBaseTexture - * @type BaseTexture - */ - this.currentBaseTexture = null; - - /** - * @property currentBlendMode - * @type Number - */ - this.currentBlendMode = 0; - - /** - * @property renderSession - * @type Object - */ - this.renderSession = null; - - /** - * @property shader - * @type Object - */ - this.shader = null; - - /** - * @property matrix - * @type Matrix - */ - this.matrix = null; - - this.setContext(gl); -}; - -PIXI.WebGLFastSpriteBatch.prototype.constructor = PIXI.WebGLFastSpriteBatch; - -/** - * Sets the WebGL Context. - * - * @method setContext - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLFastSpriteBatch.prototype.setContext = function(gl) -{ - this.gl = gl; - - // create a couple of buffers - this.vertexBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // 65535 is max index, so 65535 / 6 = 10922. - - //upload the index data - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); -}; - -/** - * @method begin - * @param spriteBatch {WebGLSpriteBatch} - * @param renderSession {Object} - */ -PIXI.WebGLFastSpriteBatch.prototype.begin = function(spriteBatch, renderSession) -{ - this.renderSession = renderSession; - this.shader = this.renderSession.shaderManager.fastShader; - - this.matrix = spriteBatch.worldTransform.toArray(true); - - this.start(); -}; - -/** - * @method end - */ -PIXI.WebGLFastSpriteBatch.prototype.end = function() -{ - this.flush(); -}; - -/** - * @method render - * @param spriteBatch {WebGLSpriteBatch} - */ -PIXI.WebGLFastSpriteBatch.prototype.render = function(spriteBatch) -{ - var children = spriteBatch.children; - var sprite = children[0]; - - // if the uvs have not updated then no point rendering just yet! - - // check texture. - if(!sprite.texture._uvs)return; - - this.currentBaseTexture = sprite.texture.baseTexture; - - // check blend mode - if(sprite.blendMode !== this.renderSession.blendModeManager.currentBlendMode) - { - this.flush(); - this.renderSession.blendModeManager.setBlendMode(sprite.blendMode); - } - - for(var i=0,j= children.length; i= this.size) - { - this.flush(); - } -}; - -/** - * @method flush - */ -PIXI.WebGLFastSpriteBatch.prototype.flush = function() -{ - // If the batch is length 0 then return as there is nothing to draw - if (this.currentBatchSize===0)return; - - var gl = this.gl; - - // bind the current texture - - if(!this.currentBaseTexture._glTextures[gl.id])this.renderSession.renderer.updateTexture(this.currentBaseTexture, gl); - - gl.bindTexture(gl.TEXTURE_2D, this.currentBaseTexture._glTextures[gl.id]); - - // upload the verts to the buffer - - if(this.currentBatchSize > ( this.size * 0.5 ) ) - { - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - } - else - { - var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize); - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); - } - - // now draw those suckas! - gl.drawElements(gl.TRIANGLES, this.currentBatchSize * 6, gl.UNSIGNED_SHORT, 0); - - // then reset the batch! - this.currentBatchSize = 0; - - // increment the draw count - this.renderSession.drawCount++; -}; - - -/** - * @method stop - */ -PIXI.WebGLFastSpriteBatch.prototype.stop = function() -{ - this.flush(); -}; - -/** - * @method start - */ -PIXI.WebGLFastSpriteBatch.prototype.start = function() -{ - var gl = this.gl; - - // bind the main texture - gl.activeTexture(gl.TEXTURE0); - - // bind the buffers - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - // set the projection - var projection = this.renderSession.projection; - gl.uniform2f(this.shader.projectionVector, projection.x, projection.y); - - // set the matrix - gl.uniformMatrix3fv(this.shader.uMatrix, false, this.matrix); - - // set the pointers - var stride = this.vertSize * 4; - - gl.vertexAttribPointer(this.shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0); - gl.vertexAttribPointer(this.shader.aPositionCoord, 2, gl.FLOAT, false, stride, 2 * 4); - gl.vertexAttribPointer(this.shader.aScale, 2, gl.FLOAT, false, stride, 4 * 4); - gl.vertexAttribPointer(this.shader.aRotation, 1, gl.FLOAT, false, stride, 6 * 4); - gl.vertexAttribPointer(this.shader.aTextureCoord, 2, gl.FLOAT, false, stride, 7 * 4); - gl.vertexAttribPointer(this.shader.colorAttribute, 1, gl.FLOAT, false, stride, 9 * 4); - -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFilterManager.js b/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFilterManager.js deleted file mode 100755 index e726891..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFilterManager.js +++ /dev/null @@ -1,450 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLFilterManager -* @constructor -*/ -PIXI.WebGLFilterManager = function() -{ - /** - * @property filterStack - * @type Array - */ - this.filterStack = []; - - /** - * @property offsetX - * @type Number - */ - this.offsetX = 0; - - /** - * @property offsetY - * @type Number - */ - this.offsetY = 0; -}; - -PIXI.WebGLFilterManager.prototype.constructor = PIXI.WebGLFilterManager; - -/** -* Initialises the context and the properties. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLFilterManager.prototype.setContext = function(gl) -{ - this.gl = gl; - this.texturePool = []; - - this.initShaderBuffers(); -}; - -/** -* @method begin -* @param renderSession {RenderSession} -* @param buffer {ArrayBuffer} -*/ -PIXI.WebGLFilterManager.prototype.begin = function(renderSession, buffer) -{ - this.renderSession = renderSession; - this.defaultShader = renderSession.shaderManager.defaultShader; - - var projection = this.renderSession.projection; - this.width = projection.x * 2; - this.height = -projection.y * 2; - this.buffer = buffer; -}; - -/** -* Applies the filter and adds it to the current filter stack. -* -* @method pushFilter -* @param filterBlock {Object} the filter that will be pushed to the current filter stack -*/ -PIXI.WebGLFilterManager.prototype.pushFilter = function(filterBlock) -{ - var gl = this.gl; - - var projection = this.renderSession.projection; - var offset = this.renderSession.offset; - - filterBlock._filterArea = filterBlock.target.filterArea || filterBlock.target.getBounds(); - - // filter program - // OPTIMISATION - the first filter is free if its a simple color change? - this.filterStack.push(filterBlock); - - var filter = filterBlock.filterPasses[0]; - - this.offsetX += filterBlock._filterArea.x; - this.offsetY += filterBlock._filterArea.y; - - var texture = this.texturePool.pop(); - if(!texture) - { - texture = new PIXI.FilterTexture(this.gl, this.width, this.height); - } - else - { - texture.resize(this.width, this.height); - } - - gl.bindTexture(gl.TEXTURE_2D, texture.texture); - - var filterArea = filterBlock._filterArea;// filterBlock.target.getBounds();///filterBlock.target.filterArea; - - var padding = filter.padding; - filterArea.x -= padding; - filterArea.y -= padding; - filterArea.width += padding * 2; - filterArea.height += padding * 2; - - // cap filter to screen size.. - if(filterArea.x < 0)filterArea.x = 0; - if(filterArea.width > this.width)filterArea.width = this.width; - if(filterArea.y < 0)filterArea.y = 0; - if(filterArea.height > this.height)filterArea.height = this.height; - - //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, filterArea.width, filterArea.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); - gl.bindFramebuffer(gl.FRAMEBUFFER, texture.frameBuffer); - - // set view port - gl.viewport(0, 0, filterArea.width, filterArea.height); - - projection.x = filterArea.width/2; - projection.y = -filterArea.height/2; - - offset.x = -filterArea.x; - offset.y = -filterArea.y; - - // update projection - // now restore the regular shader.. - // this.renderSession.shaderManager.setShader(this.defaultShader); - //gl.uniform2f(this.defaultShader.projectionVector, filterArea.width/2, -filterArea.height/2); - //gl.uniform2f(this.defaultShader.offsetVector, -filterArea.x, -filterArea.y); - - gl.colorMask(true, true, true, true); - gl.clearColor(0,0,0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); - - filterBlock._glFilterTexture = texture; - -}; - -/** -* Removes the last filter from the filter stack and doesn't return it. -* -* @method popFilter -*/ -PIXI.WebGLFilterManager.prototype.popFilter = function() -{ - var gl = this.gl; - var filterBlock = this.filterStack.pop(); - var filterArea = filterBlock._filterArea; - var texture = filterBlock._glFilterTexture; - var projection = this.renderSession.projection; - var offset = this.renderSession.offset; - - if(filterBlock.filterPasses.length > 1) - { - gl.viewport(0, 0, filterArea.width, filterArea.height); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - - this.vertexArray[0] = 0; - this.vertexArray[1] = filterArea.height; - - this.vertexArray[2] = filterArea.width; - this.vertexArray[3] = filterArea.height; - - this.vertexArray[4] = 0; - this.vertexArray[5] = 0; - - this.vertexArray[6] = filterArea.width; - this.vertexArray[7] = 0; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - // now set the uvs.. - this.uvArray[2] = filterArea.width/this.width; - this.uvArray[5] = filterArea.height/this.height; - this.uvArray[6] = filterArea.width/this.width; - this.uvArray[7] = filterArea.height/this.height; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray); - - var inputTexture = texture; - var outputTexture = this.texturePool.pop(); - if(!outputTexture)outputTexture = new PIXI.FilterTexture(this.gl, this.width, this.height); - outputTexture.resize(this.width, this.height); - - // need to clear this FBO as it may have some left over elements from a previous filter. - gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer ); - gl.clear(gl.COLOR_BUFFER_BIT); - - gl.disable(gl.BLEND); - - for (var i = 0; i < filterBlock.filterPasses.length-1; i++) - { - var filterPass = filterBlock.filterPasses[i]; - - gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer ); - - // set texture - gl.activeTexture(gl.TEXTURE0); - gl.bindTexture(gl.TEXTURE_2D, inputTexture.texture); - - // draw texture.. - //filterPass.applyFilterPass(filterArea.width, filterArea.height); - this.applyFilterPass(filterPass, filterArea, filterArea.width, filterArea.height); - - // swap the textures.. - var temp = inputTexture; - inputTexture = outputTexture; - outputTexture = temp; - } - - gl.enable(gl.BLEND); - - texture = inputTexture; - this.texturePool.push(outputTexture); - } - - var filter = filterBlock.filterPasses[filterBlock.filterPasses.length-1]; - - this.offsetX -= filterArea.x; - this.offsetY -= filterArea.y; - - var sizeX = this.width; - var sizeY = this.height; - - var offsetX = 0; - var offsetY = 0; - - var buffer = this.buffer; - - // time to render the filters texture to the previous scene - if(this.filterStack.length === 0) - { - gl.colorMask(true, true, true, true);//this.transparent); - } - else - { - var currentFilter = this.filterStack[this.filterStack.length-1]; - filterArea = currentFilter._filterArea; - - sizeX = filterArea.width; - sizeY = filterArea.height; - - offsetX = filterArea.x; - offsetY = filterArea.y; - - buffer = currentFilter._glFilterTexture.frameBuffer; - } - - // TODO need to remove these global elements.. - projection.x = sizeX/2; - projection.y = -sizeY/2; - - offset.x = offsetX; - offset.y = offsetY; - - filterArea = filterBlock._filterArea; - - var x = filterArea.x-offsetX; - var y = filterArea.y-offsetY; - - // update the buffers.. - // make sure to flip the y! - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - - this.vertexArray[0] = x; - this.vertexArray[1] = y + filterArea.height; - - this.vertexArray[2] = x + filterArea.width; - this.vertexArray[3] = y + filterArea.height; - - this.vertexArray[4] = x; - this.vertexArray[5] = y; - - this.vertexArray[6] = x + filterArea.width; - this.vertexArray[7] = y; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - - this.uvArray[2] = filterArea.width/this.width; - this.uvArray[5] = filterArea.height/this.height; - this.uvArray[6] = filterArea.width/this.width; - this.uvArray[7] = filterArea.height/this.height; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray); - - gl.viewport(0, 0, sizeX * this.renderSession.resolution, sizeY * this.renderSession.resolution); - - // bind the buffer - gl.bindFramebuffer(gl.FRAMEBUFFER, buffer ); - - // set the blend mode! - //gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA) - - // set texture - gl.activeTexture(gl.TEXTURE0); - gl.bindTexture(gl.TEXTURE_2D, texture.texture); - - // apply! - this.applyFilterPass(filter, filterArea, sizeX, sizeY); - - // now restore the regular shader.. should happen automatically now.. - // this.renderSession.shaderManager.setShader(this.defaultShader); - // gl.uniform2f(this.defaultShader.projectionVector, sizeX/2, -sizeY/2); - // gl.uniform2f(this.defaultShader.offsetVector, -offsetX, -offsetY); - - // return the texture to the pool - this.texturePool.push(texture); - filterBlock._glFilterTexture = null; -}; - - -/** -* Applies the filter to the specified area. -* -* @method applyFilterPass -* @param filter {AbstractFilter} the filter that needs to be applied -* @param filterArea {Texture} TODO - might need an update -* @param width {Number} the horizontal range of the filter -* @param height {Number} the vertical range of the filter -*/ -PIXI.WebGLFilterManager.prototype.applyFilterPass = function(filter, filterArea, width, height) -{ - // use program - var gl = this.gl; - var shader = filter.shaders[gl.id]; - - if(!shader) - { - shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc = filter.fragmentSrc; - shader.uniforms = filter.uniforms; - shader.init(); - - filter.shaders[gl.id] = shader; - } - - // set the shader - this.renderSession.shaderManager.setShader(shader); - -// gl.useProgram(shader.program); - - gl.uniform2f(shader.projectionVector, width/2, -height/2); - gl.uniform2f(shader.offsetVector, 0,0); - - if(filter.uniforms.dimensions) - { - filter.uniforms.dimensions.value[0] = this.width;//width; - filter.uniforms.dimensions.value[1] = this.height;//height; - filter.uniforms.dimensions.value[2] = this.vertexArray[0]; - filter.uniforms.dimensions.value[3] = this.vertexArray[5];//filterArea.height; - } - - shader.syncUniforms(); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer); - gl.vertexAttribPointer(shader.colorAttribute, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - // draw the filter... - gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 ); - - this.renderSession.drawCount++; -}; - -/** -* Initialises the shader buffers. -* -* @method initShaderBuffers -*/ -PIXI.WebGLFilterManager.prototype.initShaderBuffers = function() -{ - var gl = this.gl; - - // create some buffers - this.vertexBuffer = gl.createBuffer(); - this.uvBuffer = gl.createBuffer(); - this.colorBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // bind and upload the vertexs.. - // keep a reference to the vertexFloatData.. - this.vertexArray = new PIXI.Float32Array([0.0, 0.0, - 1.0, 0.0, - 0.0, 1.0, - 1.0, 1.0]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertexArray, gl.STATIC_DRAW); - - // bind and upload the uv buffer - this.uvArray = new PIXI.Float32Array([0.0, 0.0, - 1.0, 0.0, - 0.0, 1.0, - 1.0, 1.0]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvArray, gl.STATIC_DRAW); - - this.colorArray = new PIXI.Float32Array([1.0, 0xFFFFFF, - 1.0, 0xFFFFFF, - 1.0, 0xFFFFFF, - 1.0, 0xFFFFFF]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.colorArray, gl.STATIC_DRAW); - - // bind and upload the index - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 1, 3, 2]), gl.STATIC_DRAW); - -}; - -/** -* Destroys the filter and removes it from the filter stack. -* -* @method destroy -*/ -PIXI.WebGLFilterManager.prototype.destroy = function() -{ - var gl = this.gl; - - this.filterStack = null; - - this.offsetX = 0; - this.offsetY = 0; - - // destroy textures - for (var i = 0; i < this.texturePool.length; i++) { - this.texturePool[i].destroy(); - } - - this.texturePool = null; - - //destroy buffers.. - gl.deleteBuffer(this.vertexBuffer); - gl.deleteBuffer(this.uvBuffer); - gl.deleteBuffer(this.colorBuffer); - gl.deleteBuffer(this.indexBuffer); -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLGraphics.js b/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLGraphics.js deleted file mode 100755 index 710383c..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLGraphics.js +++ /dev/null @@ -1,896 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A set of functions used by the webGL renderer to draw the primitive graphics data - * - * @class WebGLGraphics - * @private - * @static - */ -PIXI.WebGLGraphics = function() -{ -}; - -/** - * Renders the graphics object - * - * @static - * @private - * @method renderGraphics - * @param graphics {Graphics} - * @param renderSession {Object} - */ -PIXI.WebGLGraphics.renderGraphics = function(graphics, renderSession)//projection, offset) -{ - var gl = renderSession.gl; - var projection = renderSession.projection, - offset = renderSession.offset, - shader = renderSession.shaderManager.primitiveShader, - webGLData; - - if(graphics.dirty) - { - PIXI.WebGLGraphics.updateGraphics(graphics, gl); - } - - var webGL = graphics._webGL[gl.id]; - - // This could be speeded up for sure! - - for (var i = 0; i < webGL.data.length; i++) - { - if(webGL.data[i].mode === 1) - { - webGLData = webGL.data[i]; - - renderSession.stencilManager.pushStencil(graphics, webGLData, renderSession); - - // render quad.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - renderSession.stencilManager.popStencil(graphics, webGLData, renderSession); - } - else - { - webGLData = webGL.data[i]; - - - renderSession.shaderManager.setShader( shader );//activatePrimitiveShader(); - shader = renderSession.shaderManager.primitiveShader; - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform1f(shader.flipY, 1); - - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - - gl.uniform1f(shader.alpha, graphics.worldAlpha); - - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0); - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4); - - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - } - } -}; - -/** - * Updates the graphics object - * - * @static - * @private - * @method updateGraphics - * @param graphicsData {Graphics} The graphics object to update - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLGraphics.updateGraphics = function(graphics, gl) -{ - // get the contexts graphics object - var webGL = graphics._webGL[gl.id]; - // if the graphics object does not exist in the webGL context time to create it! - if(!webGL)webGL = graphics._webGL[gl.id] = {lastIndex:0, data:[], gl:gl}; - - // flag the graphics as not dirty as we are about to update it... - graphics.dirty = false; - - var i; - - // if the user cleared the graphics object we will need to clear every object - if(graphics.clearDirty) - { - graphics.clearDirty = false; - - // lop through and return all the webGLDatas to the object pool so than can be reused later on - for (i = 0; i < webGL.data.length; i++) - { - var graphicsData = webGL.data[i]; - graphicsData.reset(); - PIXI.WebGLGraphics.graphicsDataPool.push( graphicsData ); - } - - // clear the array and reset the index.. - webGL.data = []; - webGL.lastIndex = 0; - } - - var webGLData; - - // loop through the graphics datas and construct each one.. - // if the object is a complex fill then the new stencil buffer technique will be used - // other wise graphics objects will be pushed into a batch.. - for (i = webGL.lastIndex; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - - if(data.type === PIXI.Graphics.POLY) - { - // need to add the points the the graphics object.. - data.points = data.shape.points.slice(); - if(data.shape.closed) - { - // close the poly if the value is true! - if(data.points[0] !== data.points[data.points.length-2] || data.points[1] !== data.points[data.points.length-1]) - { - data.points.push(data.points[0], data.points[1]); - } - } - - // MAKE SURE WE HAVE THE CORRECT TYPE.. - if(data.fill) - { - if(data.points.length >= 6) - { - if(data.points.length < 6 * 2) - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - - var canDrawUsingSimple = PIXI.WebGLGraphics.buildPoly(data, webGLData); - // console.log(canDrawUsingSimple); - - if(!canDrawUsingSimple) - { - // console.log("<>>>") - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1); - PIXI.WebGLGraphics.buildComplexPoly(data, webGLData); - } - - } - else - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1); - PIXI.WebGLGraphics.buildComplexPoly(data, webGLData); - } - } - } - - if(data.lineWidth > 0) - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - PIXI.WebGLGraphics.buildLine(data, webGLData); - - } - } - else - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - - if(data.type === PIXI.Graphics.RECT) - { - PIXI.WebGLGraphics.buildRectangle(data, webGLData); - } - else if(data.type === PIXI.Graphics.CIRC || data.type === PIXI.Graphics.ELIP) - { - PIXI.WebGLGraphics.buildCircle(data, webGLData); - } - else if(data.type === PIXI.Graphics.RREC) - { - PIXI.WebGLGraphics.buildRoundedRectangle(data, webGLData); - } - } - - webGL.lastIndex++; - } - - // upload all the dirty data... - for (i = 0; i < webGL.data.length; i++) - { - webGLData = webGL.data[i]; - if(webGLData.dirty)webGLData.upload(); - } -}; - -/** - * @static - * @private - * @method switchMode - * @param webGL {WebGLContext} - * @param type {Number} - */ -PIXI.WebGLGraphics.switchMode = function(webGL, type) -{ - var webGLData; - - if(!webGL.data.length) - { - webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl); - webGLData.mode = type; - webGL.data.push(webGLData); - } - else - { - webGLData = webGL.data[webGL.data.length-1]; - - if(webGLData.mode !== type || type === 1) - { - webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl); - webGLData.mode = type; - webGL.data.push(webGLData); - } - } - - webGLData.dirty = true; - - return webGLData; -}; - -/** - * Builds a rectangle to draw - * - * @static - * @private - * @method buildRectangle - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildRectangle = function(graphicsData, webGLData) -{ - // --- // - // need to convert points to a nice regular data - // - var rectData = graphicsData.shape; - var x = rectData.x; - var y = rectData.y; - var width = rectData.width; - var height = rectData.height; - - if(graphicsData.fill) - { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vertPos = verts.length/6; - - // start - verts.push(x, y); - verts.push(r, g, b, alpha); - - verts.push(x + width, y); - verts.push(r, g, b, alpha); - - verts.push(x , y + height); - verts.push(r, g, b, alpha); - - verts.push(x + width, y + height); - verts.push(r, g, b, alpha); - - // insert 2 dead triangles.. - indices.push(vertPos, vertPos, vertPos+1, vertPos+2, vertPos+3, vertPos+3); - } - - if(graphicsData.lineWidth) - { - var tempPoints = graphicsData.points; - - graphicsData.points = [x, y, - x + width, y, - x + width, y + height, - x, y + height, - x, y]; - - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Builds a rounded rectangle to draw - * - * @static - * @private - * @method buildRoundedRectangle - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildRoundedRectangle = function(graphicsData, webGLData) -{ - var rrectData = graphicsData.shape; - var x = rrectData.x; - var y = rrectData.y; - var width = rrectData.width; - var height = rrectData.height; - - var radius = rrectData.radius; - - var recPoints = []; - recPoints.push(x, y + radius); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x, y + height - radius, x, y + height, x + radius, y + height)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width, y + radius, x + width, y, x + width - radius, y)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + radius, y, x, y, x, y + radius)); - - if (graphicsData.fill) { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vecPos = verts.length/6; - - var triangles = PIXI.PolyK.Triangulate(recPoints); - - // - - var i = 0; - for (i = 0; i < triangles.length; i+=3) - { - indices.push(triangles[i] + vecPos); - indices.push(triangles[i] + vecPos); - indices.push(triangles[i+1] + vecPos); - indices.push(triangles[i+2] + vecPos); - indices.push(triangles[i+2] + vecPos); - } - - - for (i = 0; i < recPoints.length; i++) - { - verts.push(recPoints[i], recPoints[++i], r, g, b, alpha); - } - } - - if (graphicsData.lineWidth) { - var tempPoints = graphicsData.points; - - graphicsData.points = recPoints; - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Calculate the points for a quadratic bezier curve. (helper function..) - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c - * - * @static - * @private - * @method quadraticBezierCurve - * @param fromX {Number} Origin point x - * @param fromY {Number} Origin point x - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Array(Number)} - */ -PIXI.WebGLGraphics.quadraticBezierCurve = function(fromX, fromY, cpX, cpY, toX, toY) { - - var xa, - ya, - xb, - yb, - x, - y, - n = 20, - points = []; - - function getPt(n1 , n2, perc) { - var diff = n2 - n1; - - return n1 + ( diff * perc ); - } - - var j = 0; - for (var i = 0; i <= n; i++ ) - { - j = i / n; - - // The Green Line - xa = getPt( fromX , cpX , j ); - ya = getPt( fromY , cpY , j ); - xb = getPt( cpX , toX , j ); - yb = getPt( cpY , toY , j ); - - // The Black Dot - x = getPt( xa , xb , j ); - y = getPt( ya , yb , j ); - - points.push(x, y); - } - return points; -}; - -/** - * Builds a circle to draw - * - * @static - * @private - * @method buildCircle - * @param graphicsData {Graphics} The graphics object to draw - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildCircle = function(graphicsData, webGLData) -{ - // need to convert points to a nice regular data - var circleData = graphicsData.shape; - var x = circleData.x; - var y = circleData.y; - var width; - var height; - - // TODO - bit hacky?? - if(graphicsData.type === PIXI.Graphics.CIRC) - { - width = circleData.radius; - height = circleData.radius; - } - else - { - width = circleData.width; - height = circleData.height; - } - - var totalSegs = 40; - var seg = (Math.PI * 2) / totalSegs ; - - var i = 0; - - if(graphicsData.fill) - { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vecPos = verts.length/6; - - indices.push(vecPos); - - for (i = 0; i < totalSegs + 1 ; i++) - { - verts.push(x,y, r, g, b, alpha); - - verts.push(x + Math.sin(seg * i) * width, - y + Math.cos(seg * i) * height, - r, g, b, alpha); - - indices.push(vecPos++, vecPos++); - } - - indices.push(vecPos-1); - } - - if(graphicsData.lineWidth) - { - var tempPoints = graphicsData.points; - - graphicsData.points = []; - - for (i = 0; i < totalSegs + 1; i++) - { - graphicsData.points.push(x + Math.sin(seg * i) * width, - y + Math.cos(seg * i) * height); - } - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Builds a line to draw - * - * @static - * @private - * @method buildLine - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildLine = function(graphicsData, webGLData) -{ - // TODO OPTIMISE! - var i = 0; - var points = graphicsData.points; - if(points.length === 0)return; - - // if the line width is an odd number add 0.5 to align to a whole pixel - if(graphicsData.lineWidth%2) - { - for (i = 0; i < points.length; i++) { - points[i] += 0.5; - } - } - - // get first and last point.. figure out the middle! - var firstPoint = new PIXI.Point( points[0], points[1] ); - var lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); - - // if the first point is the last point - gonna have issues :) - if(firstPoint.x === lastPoint.x && firstPoint.y === lastPoint.y) - { - // need to clone as we are going to slightly modify the shape.. - points = points.slice(); - - points.pop(); - points.pop(); - - lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); - - var midPointX = lastPoint.x + (firstPoint.x - lastPoint.x) *0.5; - var midPointY = lastPoint.y + (firstPoint.y - lastPoint.y) *0.5; - - points.unshift(midPointX, midPointY); - points.push(midPointX, midPointY); - } - - var verts = webGLData.points; - var indices = webGLData.indices; - var length = points.length / 2; - var indexCount = points.length; - var indexStart = verts.length/6; - - // DRAW the Line - var width = graphicsData.lineWidth / 2; - - // sort color - var color = PIXI.hex2rgb(graphicsData.lineColor); - var alpha = graphicsData.lineAlpha; - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var px, py, p1x, p1y, p2x, p2y, p3x, p3y; - var perpx, perpy, perp2x, perp2y, perp3x, perp3y; - var a1, b1, c1, a2, b2, c2; - var denom, pdist, dist; - - p1x = points[0]; - p1y = points[1]; - - p2x = points[2]; - p2y = points[3]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - // start - verts.push(p1x - perpx , p1y - perpy, - r, g, b, alpha); - - verts.push(p1x + perpx , p1y + perpy, - r, g, b, alpha); - - for (i = 1; i < length-1; i++) - { - p1x = points[(i-1)*2]; - p1y = points[(i-1)*2 + 1]; - - p2x = points[(i)*2]; - p2y = points[(i)*2 + 1]; - - p3x = points[(i+1)*2]; - p3y = points[(i+1)*2 + 1]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - perp2x = -(p2y - p3y); - perp2y = p2x - p3x; - - dist = Math.sqrt(perp2x*perp2x + perp2y*perp2y); - perp2x /= dist; - perp2y /= dist; - perp2x *= width; - perp2y *= width; - - a1 = (-perpy + p1y) - (-perpy + p2y); - b1 = (-perpx + p2x) - (-perpx + p1x); - c1 = (-perpx + p1x) * (-perpy + p2y) - (-perpx + p2x) * (-perpy + p1y); - a2 = (-perp2y + p3y) - (-perp2y + p2y); - b2 = (-perp2x + p2x) - (-perp2x + p3x); - c2 = (-perp2x + p3x) * (-perp2y + p2y) - (-perp2x + p2x) * (-perp2y + p3y); - - denom = a1*b2 - a2*b1; - - if(Math.abs(denom) < 0.1 ) - { - - denom+=10.1; - verts.push(p2x - perpx , p2y - perpy, - r, g, b, alpha); - - verts.push(p2x + perpx , p2y + perpy, - r, g, b, alpha); - - continue; - } - - px = (b1*c2 - b2*c1)/denom; - py = (a2*c1 - a1*c2)/denom; - - - pdist = (px -p2x) * (px -p2x) + (py -p2y) + (py -p2y); - - - if(pdist > 140 * 140) - { - perp3x = perpx - perp2x; - perp3y = perpy - perp2y; - - dist = Math.sqrt(perp3x*perp3x + perp3y*perp3y); - perp3x /= dist; - perp3y /= dist; - perp3x *= width; - perp3y *= width; - - verts.push(p2x - perp3x, p2y -perp3y); - verts.push(r, g, b, alpha); - - verts.push(p2x + perp3x, p2y +perp3y); - verts.push(r, g, b, alpha); - - verts.push(p2x - perp3x, p2y -perp3y); - verts.push(r, g, b, alpha); - - indexCount++; - } - else - { - - verts.push(px , py); - verts.push(r, g, b, alpha); - - verts.push(p2x - (px-p2x), p2y - (py - p2y)); - verts.push(r, g, b, alpha); - } - } - - p1x = points[(length-2)*2]; - p1y = points[(length-2)*2 + 1]; - - p2x = points[(length-1)*2]; - p2y = points[(length-1)*2 + 1]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - verts.push(p2x - perpx , p2y - perpy); - verts.push(r, g, b, alpha); - - verts.push(p2x + perpx , p2y + perpy); - verts.push(r, g, b, alpha); - - indices.push(indexStart); - - for (i = 0; i < indexCount; i++) - { - indices.push(indexStart++); - } - - indices.push(indexStart-1); -}; - -/** - * Builds a complex polygon to draw - * - * @static - * @private - * @method buildComplexPoly - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildComplexPoly = function(graphicsData, webGLData) -{ - //TODO - no need to copy this as it gets turned into a FLoat32Array anyways.. - var points = graphicsData.points.slice(); - if(points.length < 6)return; - - // get first and last point.. figure out the middle! - var indices = webGLData.indices; - webGLData.points = points; - webGLData.alpha = graphicsData.fillAlpha; - webGLData.color = PIXI.hex2rgb(graphicsData.fillColor); - - /* - calclate the bounds.. - */ - var minX = Infinity; - var maxX = -Infinity; - - var minY = Infinity; - var maxY = -Infinity; - - var x,y; - - // get size.. - for (var i = 0; i < points.length; i+=2) - { - x = points[i]; - y = points[i+1]; - - minX = x < minX ? x : minX; - maxX = x > maxX ? x : maxX; - - minY = y < minY ? y : minY; - maxY = y > maxY ? y : maxY; - } - - // add a quad to the end cos there is no point making another buffer! - points.push(minX, minY, - maxX, minY, - maxX, maxY, - minX, maxY); - - // push a quad onto the end.. - - //TODO - this aint needed! - var length = points.length / 2; - for (i = 0; i < length; i++) - { - indices.push( i ); - } - -}; - -/** - * Builds a polygon to draw - * - * @static - * @private - * @method buildPoly - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildPoly = function(graphicsData, webGLData) -{ - var points = graphicsData.points; - - if(points.length < 6)return; - // get first and last point.. figure out the middle! - var verts = webGLData.points; - var indices = webGLData.indices; - - var length = points.length / 2; - - // sort color - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var triangles = PIXI.PolyK.Triangulate(points); - - if(!triangles)return false; - - var vertPos = verts.length / 6; - - var i = 0; - - for (i = 0; i < triangles.length; i+=3) - { - indices.push(triangles[i] + vertPos); - indices.push(triangles[i] + vertPos); - indices.push(triangles[i+1] + vertPos); - indices.push(triangles[i+2] +vertPos); - indices.push(triangles[i+2] + vertPos); - } - - for (i = 0; i < length; i++) - { - verts.push(points[i * 2], points[i * 2 + 1], - r, g, b, alpha); - } - - return true; -}; - -PIXI.WebGLGraphics.graphicsDataPool = []; - -/** - * @class WebGLGraphicsData - * @private - * @static - */ -PIXI.WebGLGraphicsData = function(gl) -{ - this.gl = gl; - - //TODO does this need to be split before uploding?? - this.color = [0,0,0]; // color split! - this.points = []; - this.indices = []; - this.buffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - this.mode = 1; - this.alpha = 1; - this.dirty = true; -}; - -/** - * @method reset - */ -PIXI.WebGLGraphicsData.prototype.reset = function() -{ - this.points = []; - this.indices = []; -}; - -/** - * @method upload - */ -PIXI.WebGLGraphicsData.prototype.upload = function() -{ - var gl = this.gl; - -// this.lastIndex = graphics.graphicsData.length; - this.glPoints = new PIXI.Float32Array(this.points); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer); - gl.bufferData(gl.ARRAY_BUFFER, this.glPoints, gl.STATIC_DRAW); - - this.glIndicies = new PIXI.Uint16Array(this.indices); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.glIndicies, gl.STATIC_DRAW); - - this.dirty = false; -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLMaskManager.js b/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLMaskManager.js deleted file mode 100755 index 607d5dd..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLMaskManager.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLMaskManager -* @constructor -* @private -*/ -PIXI.WebGLMaskManager = function() -{ -}; - -PIXI.WebGLMaskManager.prototype.constructor = PIXI.WebGLMaskManager; - -/** -* Sets the drawing context to the one given in parameter. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLMaskManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Applies the Mask and adds it to the current filter stack. -* -* @method pushMask -* @param maskData {Array} -* @param renderSession {Object} -*/ -PIXI.WebGLMaskManager.prototype.pushMask = function(maskData, renderSession) -{ - var gl = renderSession.gl; - - if(maskData.dirty) - { - PIXI.WebGLGraphics.updateGraphics(maskData, gl); - } - - if(!maskData._webGL[gl.id].data.length)return; - - renderSession.stencilManager.pushStencil(maskData, maskData._webGL[gl.id].data[0], renderSession); -}; - -/** -* Removes the last filter from the filter stack and doesn't return it. -* -* @method popMask -* @param maskData {Array} -* @param renderSession {Object} an object containing all the useful parameters -*/ -PIXI.WebGLMaskManager.prototype.popMask = function(maskData, renderSession) -{ - var gl = this.gl; - renderSession.stencilManager.popStencil(maskData, maskData._webGL[gl.id].data[0], renderSession); -}; - -/** -* Destroys the mask stack. -* -* @method destroy -*/ -PIXI.WebGLMaskManager.prototype.destroy = function() -{ - this.gl = null; -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderManager.js b/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderManager.js deleted file mode 100755 index a15974e..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderManager.js +++ /dev/null @@ -1,157 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLShaderManager -* @constructor -* @private -*/ -PIXI.WebGLShaderManager = function() -{ - /** - * @property maxAttibs - * @type Number - */ - this.maxAttibs = 10; - - /** - * @property attribState - * @type Array - */ - this.attribState = []; - - /** - * @property tempAttribState - * @type Array - */ - this.tempAttribState = []; - - for (var i = 0; i < this.maxAttibs; i++) - { - this.attribState[i] = false; - } - - /** - * @property stack - * @type Array - */ - this.stack = []; - -}; - -PIXI.WebGLShaderManager.prototype.constructor = PIXI.WebGLShaderManager; - -/** -* Initialises the context and the properties. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLShaderManager.prototype.setContext = function(gl) -{ - this.gl = gl; - - // the next one is used for rendering primitives - this.primitiveShader = new PIXI.PrimitiveShader(gl); - - // the next one is used for rendering triangle strips - this.complexPrimitiveShader = new PIXI.ComplexPrimitiveShader(gl); - - // this shader is used for the default sprite rendering - this.defaultShader = new PIXI.PixiShader(gl); - - // this shader is used for the fast sprite rendering - this.fastShader = new PIXI.PixiFastShader(gl); - - // the next one is used for rendering triangle strips - this.stripShader = new PIXI.StripShader(gl); - this.setShader(this.defaultShader); -}; - -/** -* Takes the attributes given in parameters. -* -* @method setAttribs -* @param attribs {Array} attribs -*/ -PIXI.WebGLShaderManager.prototype.setAttribs = function(attribs) -{ - // reset temp state - var i; - - for (i = 0; i < this.tempAttribState.length; i++) - { - this.tempAttribState[i] = false; - } - - // set the new attribs - for (i = 0; i < attribs.length; i++) - { - var attribId = attribs[i]; - this.tempAttribState[attribId] = true; - } - - var gl = this.gl; - - for (i = 0; i < this.attribState.length; i++) - { - if(this.attribState[i] !== this.tempAttribState[i]) - { - this.attribState[i] = this.tempAttribState[i]; - - if(this.tempAttribState[i]) - { - gl.enableVertexAttribArray(i); - } - else - { - gl.disableVertexAttribArray(i); - } - } - } -}; - -/** -* Sets the current shader. -* -* @method setShader -* @param shader {Any} -*/ -PIXI.WebGLShaderManager.prototype.setShader = function(shader) -{ - if(this._currentId === shader._UID)return false; - - this._currentId = shader._UID; - - this.currentShader = shader; - - this.gl.useProgram(shader.program); - this.setAttribs(shader.attributes); - - return true; -}; - -/** -* Destroys this object. -* -* @method destroy -*/ -PIXI.WebGLShaderManager.prototype.destroy = function() -{ - this.attribState = null; - - this.tempAttribState = null; - - this.primitiveShader.destroy(); - - this.complexPrimitiveShader.destroy(); - - this.defaultShader.destroy(); - - this.fastShader.destroy(); - - this.stripShader.destroy(); - - this.gl = null; -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderUtils.js b/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderUtils.js deleted file mode 100755 index a7d7826..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderUtils.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @method initDefaultShaders -* @static -* @private -*/ -PIXI.initDefaultShaders = function() -{ -}; - -/** -* @method CompileVertexShader -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @return {Any} -*/ -PIXI.CompileVertexShader = function(gl, shaderSrc) -{ - return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER); -}; - -/** -* @method CompileFragmentShader -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @return {Any} -*/ -PIXI.CompileFragmentShader = function(gl, shaderSrc) -{ - return PIXI._CompileShader(gl, shaderSrc, gl.FRAGMENT_SHADER); -}; - -/** -* @method _CompileShader -* @static -* @private -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @param shaderType {Number} -* @return {Any} -*/ -PIXI._CompileShader = function(gl, shaderSrc, shaderType) -{ - var src = shaderSrc.join("\n"); - var shader = gl.createShader(shaderType); - gl.shaderSource(shader, src); - gl.compileShader(shader); - - if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) - { - window.console.log(gl.getShaderInfoLog(shader)); - return null; - } - - return shader; -}; - -/** -* @method compileProgram -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param vertexSrc {Array} -* @param fragmentSrc {Array} -* @return {Any} -*/ -PIXI.compileProgram = function(gl, vertexSrc, fragmentSrc) -{ - var fragmentShader = PIXI.CompileFragmentShader(gl, fragmentSrc); - var vertexShader = PIXI.CompileVertexShader(gl, vertexSrc); - - var shaderProgram = gl.createProgram(); - - gl.attachShader(shaderProgram, vertexShader); - gl.attachShader(shaderProgram, fragmentShader); - gl.linkProgram(shaderProgram); - - if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) - { - window.console.log("Could not initialise shaders"); - } - - return shaderProgram; -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js b/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js deleted file mode 100755 index 711b4da..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js +++ /dev/null @@ -1,635 +0,0 @@ -/** - * @author Mat Groves - * - * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ - * for creating the original pixi version! - * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now share 4 bytes on the vertex buffer - * - * Heavily inspired by LibGDX's WebGLSpriteBatch: - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java - */ - - /** - * - * @class WebGLSpriteBatch - * @private - * @constructor - */ -PIXI.WebGLSpriteBatch = function() -{ - /** - * @property vertSize - * @type Number - */ - this.vertSize = 5; - - /** - * The number of images in the SpriteBatch before it flushes - * @property size - * @type Number - */ - this.size = 2000;//Math.pow(2, 16) / this.vertSize; - - //the total number of bytes in our batch - var numVerts = this.size * 4 * 4 * this.vertSize; - //the total number of indices in our batch - var numIndices = this.size * 6; - - /** - * Holds the vertices - * - * @property vertices - * @type ArrayBuffer - */ - this.vertices = new PIXI.ArrayBuffer(numVerts); - - /** - * View on the vertices as a Float32Array - * - * @property positions - * @type Float32Array - */ - this.positions = new PIXI.Float32Array(this.vertices); - - /** - * View on the vertices as a Uint32Array - * - * @property colors - * @type Uint32Array - */ - this.colors = new PIXI.Uint32Array(this.vertices); - - /** - * Holds the indices - * - * @property indices - * @type Uint16Array - */ - this.indices = new PIXI.Uint16Array(numIndices); - - /** - * @property lastIndexCount - * @type Number - */ - this.lastIndexCount = 0; - - for (var i=0, j=0; i < numIndices; i += 6, j += 4) - { - this.indices[i + 0] = j + 0; - this.indices[i + 1] = j + 1; - this.indices[i + 2] = j + 2; - this.indices[i + 3] = j + 0; - this.indices[i + 4] = j + 2; - this.indices[i + 5] = j + 3; - } - - /** - * @property drawing - * @type Boolean - */ - this.drawing = false; - - /** - * @property currentBatchSize - * @type Number - */ - this.currentBatchSize = 0; - - /** - * @property currentBaseTexture - * @type BaseTexture - */ - this.currentBaseTexture = null; - - /** - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * @property textures - * @type Array - */ - this.textures = []; - - /** - * @property blendModes - * @type Array - */ - this.blendModes = []; - - /** - * @property shaders - * @type Array - */ - this.shaders = []; - - /** - * @property sprites - * @type Array - */ - this.sprites = []; - - /** - * @property defaultShader - * @type AbstractFilter - */ - this.defaultShader = new PIXI.AbstractFilter([ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]); -}; - -/** -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLSpriteBatch.prototype.setContext = function(gl) -{ - this.gl = gl; - - // create a couple of buffers - this.vertexBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // 65535 is max index, so 65535 / 6 = 10922. - - //upload the index data - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); - - this.currentBlendMode = 99999; - - var shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc = this.defaultShader.fragmentSrc; - shader.uniforms = {}; - shader.init(); - - this.defaultShader.shaders[gl.id] = shader; -}; - -/** -* @method begin -* @param renderSession {Object} The RenderSession object -*/ -PIXI.WebGLSpriteBatch.prototype.begin = function(renderSession) -{ - this.renderSession = renderSession; - this.shader = this.renderSession.shaderManager.defaultShader; - - this.start(); -}; - -/** -* @method end -*/ -PIXI.WebGLSpriteBatch.prototype.end = function() -{ - this.flush(); -}; - -/** -* @method render -* @param sprite {Sprite} the sprite to render when using this spritebatch -*/ -PIXI.WebGLSpriteBatch.prototype.render = function(sprite) -{ - var texture = sprite.texture; - - //TODO set blend modes.. - // check texture.. - if(this.currentBatchSize >= this.size) - { - this.flush(); - this.currentBaseTexture = texture.baseTexture; - } - - // get the uvs for the texture - var uvs = texture._uvs; - // if the uvs have not updated then no point rendering just yet! - if(!uvs)return; - - // TODO trim?? - var aX = sprite.anchor.x; - var aY = sprite.anchor.y; - - var w0, w1, h0, h1; - - if (texture.trim) - { - // if the sprite is trimmed then we need to add the extra space before transforming the sprite coords.. - var trim = texture.trim; - - w1 = trim.x - aX * trim.width; - w0 = w1 + texture.crop.width; - - h1 = trim.y - aY * trim.height; - h0 = h1 + texture.crop.height; - - } - else - { - w0 = (texture.frame.width ) * (1-aX); - w1 = (texture.frame.width ) * -aX; - - h0 = texture.frame.height * (1-aY); - h1 = texture.frame.height * -aY; - } - - var index = this.currentBatchSize * 4 * this.vertSize; - - var resolution = texture.baseTexture.resolution; - - var worldTransform = sprite.worldTransform; - - var a = worldTransform.a / resolution; - var b = worldTransform.b / resolution; - var c = worldTransform.c / resolution; - var d = worldTransform.d / resolution; - var tx = worldTransform.tx; - var ty = worldTransform.ty; - - var colors = this.colors; - var positions = this.positions; - - if(this.renderSession.roundPixels) - { - // xy - positions[index] = a * w1 + c * h1 + tx | 0; - positions[index+1] = d * h1 + b * w1 + ty | 0; - - // xy - positions[index+5] = a * w0 + c * h1 + tx | 0; - positions[index+6] = d * h1 + b * w0 + ty | 0; - - // xy - positions[index+10] = a * w0 + c * h0 + tx | 0; - positions[index+11] = d * h0 + b * w0 + ty | 0; - - // xy - positions[index+15] = a * w1 + c * h0 + tx | 0; - positions[index+16] = d * h0 + b * w1 + ty | 0; - } - else - { - // xy - positions[index] = a * w1 + c * h1 + tx; - positions[index+1] = d * h1 + b * w1 + ty; - - // xy - positions[index+5] = a * w0 + c * h1 + tx; - positions[index+6] = d * h1 + b * w0 + ty; - - // xy - positions[index+10] = a * w0 + c * h0 + tx; - positions[index+11] = d * h0 + b * w0 + ty; - - // xy - positions[index+15] = a * w1 + c * h0 + tx; - positions[index+16] = d * h0 + b * w1 + ty; - } - - // uv - positions[index+2] = uvs.x0; - positions[index+3] = uvs.y0; - - // uv - positions[index+7] = uvs.x1; - positions[index+8] = uvs.y1; - - // uv - positions[index+12] = uvs.x2; - positions[index+13] = uvs.y2; - - // uv - positions[index+17] = uvs.x3; - positions[index+18] = uvs.y3; - - // color and alpha - var tint = sprite.tint; - colors[index+4] = colors[index+9] = colors[index+14] = colors[index+19] = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16) + (sprite.worldAlpha * 255 << 24); - - // increment the batchsize - this.sprites[this.currentBatchSize++] = sprite; - - -}; - -/** -* Renders a TilingSprite using the spriteBatch. -* -* @method renderTilingSprite -* @param sprite {TilingSprite} the tilingSprite to render -*/ -PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite) -{ - var texture = tilingSprite.tilingTexture; - - // check texture.. - if(this.currentBatchSize >= this.size) - { - //return; - this.flush(); - this.currentBaseTexture = texture.baseTexture; - } - - // set the textures uvs temporarily - // TODO create a separate texture so that we can tile part of a texture - - if(!tilingSprite._uvs)tilingSprite._uvs = new PIXI.TextureUvs(); - - var uvs = tilingSprite._uvs; - - tilingSprite.tilePosition.x %= texture.baseTexture.width * tilingSprite.tileScaleOffset.x; - tilingSprite.tilePosition.y %= texture.baseTexture.height * tilingSprite.tileScaleOffset.y; - - var offsetX = tilingSprite.tilePosition.x/(texture.baseTexture.width*tilingSprite.tileScaleOffset.x); - var offsetY = tilingSprite.tilePosition.y/(texture.baseTexture.height*tilingSprite.tileScaleOffset.y); - - var scaleX = (tilingSprite.width / texture.baseTexture.width) / (tilingSprite.tileScale.x * tilingSprite.tileScaleOffset.x); - var scaleY = (tilingSprite.height / texture.baseTexture.height) / (tilingSprite.tileScale.y * tilingSprite.tileScaleOffset.y); - - uvs.x0 = 0 - offsetX; - uvs.y0 = 0 - offsetY; - - uvs.x1 = (1 * scaleX) - offsetX; - uvs.y1 = 0 - offsetY; - - uvs.x2 = (1 * scaleX) - offsetX; - uvs.y2 = (1 * scaleY) - offsetY; - - uvs.x3 = 0 - offsetX; - uvs.y3 = (1 * scaleY) - offsetY; - - // get the tilingSprites current alpha and tint and combining them into a single color - var tint = tilingSprite.tint; - var color = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16) + (tilingSprite.alpha * 255 << 24); - - var positions = this.positions; - var colors = this.colors; - - var width = tilingSprite.width; - var height = tilingSprite.height; - - // TODO trim?? - var aX = tilingSprite.anchor.x; - var aY = tilingSprite.anchor.y; - var w0 = width * (1-aX); - var w1 = width * -aX; - - var h0 = height * (1-aY); - var h1 = height * -aY; - - var index = this.currentBatchSize * 4 * this.vertSize; - - var resolution = texture.baseTexture.resolution; - - var worldTransform = tilingSprite.worldTransform; - - var a = worldTransform.a / resolution;//[0]; - var b = worldTransform.b / resolution;//[3]; - var c = worldTransform.c / resolution;//[1]; - var d = worldTransform.d / resolution;//[4]; - var tx = worldTransform.tx;//[2]; - var ty = worldTransform.ty;//[5]; - - // xy - positions[index++] = a * w1 + c * h1 + tx; - positions[index++] = d * h1 + b * w1 + ty; - // uv - positions[index++] = uvs.x0; - positions[index++] = uvs.y0; - // color - colors[index++] = color; - - // xy - positions[index++] = (a * w0 + c * h1 + tx); - positions[index++] = d * h1 + b * w0 + ty; - // uv - positions[index++] = uvs.x1; - positions[index++] = uvs.y1; - // color - colors[index++] = color; - - // xy - positions[index++] = a * w0 + c * h0 + tx; - positions[index++] = d * h0 + b * w0 + ty; - // uv - positions[index++] = uvs.x2; - positions[index++] = uvs.y2; - // color - colors[index++] = color; - - // xy - positions[index++] = a * w1 + c * h0 + tx; - positions[index++] = d * h0 + b * w1 + ty; - // uv - positions[index++] = uvs.x3; - positions[index++] = uvs.y3; - // color - colors[index++] = color; - - // increment the batchsize - this.sprites[this.currentBatchSize++] = tilingSprite; -}; - -/** -* Renders the content and empties the current batch. -* -* @method flush -*/ -PIXI.WebGLSpriteBatch.prototype.flush = function() -{ - // If the batch is length 0 then return as there is nothing to draw - if (this.currentBatchSize===0)return; - - var gl = this.gl; - var shader; - - if(this.dirty) - { - this.dirty = false; - // bind the main texture - gl.activeTexture(gl.TEXTURE0); - - // bind the buffers - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - shader = this.defaultShader.shaders[gl.id]; - - // this is the same for each shader? - var stride = this.vertSize * 4; - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, stride, 2 * 4); - - // color attributes will be interpreted as unsigned bytes and normalized - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.UNSIGNED_BYTE, true, stride, 4 * 4); - } - - // upload the verts to the buffer - if(this.currentBatchSize > ( this.size * 0.5 ) ) - { - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - } - else - { - var view = this.positions.subarray(0, this.currentBatchSize * 4 * this.vertSize); - gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); - } - - var nextTexture, nextBlendMode, nextShader; - var batchSize = 0; - var start = 0; - - var currentBaseTexture = null; - var currentBlendMode = this.renderSession.blendModeManager.currentBlendMode; - var currentShader = null; - - var blendSwap = false; - var shaderSwap = false; - var sprite; - - for (var i = 0, j = this.currentBatchSize; i < j; i++) { - - sprite = this.sprites[i]; - - nextTexture = sprite.texture.baseTexture; - nextBlendMode = sprite.blendMode; - nextShader = sprite.shader || this.defaultShader; - - blendSwap = currentBlendMode !== nextBlendMode; - shaderSwap = currentShader !== nextShader; // should I use _UIDS??? - - if(currentBaseTexture !== nextTexture || blendSwap || shaderSwap) - { - this.renderBatch(currentBaseTexture, batchSize, start); - - start = i; - batchSize = 0; - currentBaseTexture = nextTexture; - - if( blendSwap ) - { - currentBlendMode = nextBlendMode; - this.renderSession.blendModeManager.setBlendMode( currentBlendMode ); - } - - if( shaderSwap ) - { - currentShader = nextShader; - - shader = currentShader.shaders[gl.id]; - - if(!shader) - { - shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc =currentShader.fragmentSrc; - shader.uniforms =currentShader.uniforms; - shader.init(); - - currentShader.shaders[gl.id] = shader; - } - - // set shader function??? - this.renderSession.shaderManager.setShader(shader); - - if(shader.dirty)shader.syncUniforms(); - - // both thease only need to be set if they are changing.. - // set the projection - var projection = this.renderSession.projection; - gl.uniform2f(shader.projectionVector, projection.x, projection.y); - - // TODO - this is temprorary! - var offsetVector = this.renderSession.offset; - gl.uniform2f(shader.offsetVector, offsetVector.x, offsetVector.y); - - // set the pointers - } - } - - batchSize++; - } - - this.renderBatch(currentBaseTexture, batchSize, start); - - // then reset the batch! - this.currentBatchSize = 0; -}; - -/** -* @method renderBatch -* @param texture {Texture} -* @param size {Number} -* @param startIndex {Number} -*/ -PIXI.WebGLSpriteBatch.prototype.renderBatch = function(texture, size, startIndex) -{ - if(size === 0)return; - - var gl = this.gl; - - // check if a texture is dirty.. - if(texture._dirty[gl.id]) - { - this.renderSession.renderer.updateTexture(texture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]); - } - - // now draw those suckas! - gl.drawElements(gl.TRIANGLES, size * 6, gl.UNSIGNED_SHORT, startIndex * 6 * 2); - - // increment the draw count - this.renderSession.drawCount++; -}; - -/** -* @method stop -*/ -PIXI.WebGLSpriteBatch.prototype.stop = function() -{ - this.flush(); - this.dirty = true; -}; - -/** -* @method start -*/ -PIXI.WebGLSpriteBatch.prototype.start = function() -{ - this.dirty = true; -}; - -/** -* Destroys the SpriteBatch. -* -* @method destroy -*/ -PIXI.WebGLSpriteBatch.prototype.destroy = function() -{ - this.vertices = null; - this.indices = null; - - this.gl.deleteBuffer( this.vertexBuffer ); - this.gl.deleteBuffer( this.indexBuffer ); - - this.currentBaseTexture = null; - - this.gl = null; -}; \ No newline at end of file diff --git a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLStencilManager.js b/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLStencilManager.js deleted file mode 100755 index 989d8cf..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLStencilManager.js +++ /dev/null @@ -1,297 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLStencilManager -* @constructor -* @private -*/ -PIXI.WebGLStencilManager = function() -{ - this.stencilStack = []; - this.reverse = true; - this.count = 0; -}; - -/** -* Sets the drawing context to the one given in parameter. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLStencilManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Applies the Mask and adds it to the current filter stack. -* -* @method pushMask -* @param graphics {Graphics} -* @param webGLData {Array} -* @param renderSession {Object} -*/ -PIXI.WebGLStencilManager.prototype.pushStencil = function(graphics, webGLData, renderSession) -{ - var gl = this.gl; - this.bindGraphics(graphics, webGLData, renderSession); - - if(this.stencilStack.length === 0) - { - gl.enable(gl.STENCIL_TEST); - gl.clear(gl.STENCIL_BUFFER_BIT); - this.reverse = true; - this.count = 0; - } - - this.stencilStack.push(webGLData); - - var level = this.count; - - gl.colorMask(false, false, false, false); - - gl.stencilFunc(gl.ALWAYS,0,0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT); - - // draw the triangle strip! - - if(webGLData.mode === 1) - { - gl.drawElements(gl.TRIANGLE_FAN, webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 ); - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - - // draw a quad to increment.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - } - - this.reverse = !this.reverse; - } - else - { - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - } - } - - gl.colorMask(true, true, true, true); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP); - - this.count++; -}; - -/** - * TODO this does not belong here! - * - * @method bindGraphics - * @param graphics {Graphics} - * @param webGLData {Array} - * @param renderSession {Object} - */ -PIXI.WebGLStencilManager.prototype.bindGraphics = function(graphics, webGLData, renderSession) -{ - //if(this._currentGraphics === graphics)return; - this._currentGraphics = graphics; - - var gl = this.gl; - - // bind the graphics object.. - var projection = renderSession.projection, - offset = renderSession.offset, - shader;// = renderSession.shaderManager.primitiveShader; - - if(webGLData.mode === 1) - { - shader = renderSession.shaderManager.complexPrimitiveShader; - - renderSession.shaderManager.setShader( shader ); - - gl.uniform1f(shader.flipY, renderSession.flipY); - - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - gl.uniform3fv(shader.color, webGLData.color); - - gl.uniform1f(shader.alpha, graphics.worldAlpha * webGLData.alpha); - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 2, 0); - - - // now do the rest.. - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - } - else - { - //renderSession.shaderManager.activatePrimitiveShader(); - shader = renderSession.shaderManager.primitiveShader; - renderSession.shaderManager.setShader( shader ); - - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform1f(shader.flipY, renderSession.flipY); - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - - gl.uniform1f(shader.alpha, graphics.worldAlpha); - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0); - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4); - - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - } -}; - -/** - * @method popStencil - * @param graphics {Graphics} - * @param webGLData {Array} - * @param renderSession {Object} - */ -PIXI.WebGLStencilManager.prototype.popStencil = function(graphics, webGLData, renderSession) -{ - var gl = this.gl; - this.stencilStack.pop(); - - this.count--; - - if(this.stencilStack.length === 0) - { - // the stack is empty! - gl.disable(gl.STENCIL_TEST); - - } - else - { - - var level = this.count; - - this.bindGraphics(graphics, webGLData, renderSession); - - gl.colorMask(false, false, false, false); - - if(webGLData.mode === 1) - { - this.reverse = !this.reverse; - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - - // draw a quad to increment.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - gl.stencilFunc(gl.ALWAYS,0,0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT); - - // draw the triangle strip! - gl.drawElements(gl.TRIANGLE_FAN, webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - } - - } - else - { - // console.log("<<>>") - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - } - } - - gl.colorMask(true, true, true, true); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP); - - - } -}; - -/** -* Destroys the mask stack. -* -* @method destroy -*/ -PIXI.WebGLStencilManager.prototype.destroy = function() -{ - this.stencilStack = null; - this.gl = null; -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/text/BitmapText.js b/tutorial-3/pixi.js-master/src/pixi/text/BitmapText.js deleted file mode 100755 index a1d20af..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/text/BitmapText.js +++ /dev/null @@ -1,215 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A BitmapText object will create a line or multiple lines of text using bitmap font. To split a line you can use '\n', '\r' or '\r\n' in your string. - * You can generate the fnt files using - * http://www.angelcode.com/products/bmfont/ for windows or - * http://www.bmglyph.com/ for mac. - * - * @class BitmapText - * @extends DisplayObjectContainer - * @constructor - * @param text {String} The copy that you would like the text to display - * @param style {Object} The style parameters - * @param style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously) - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - */ -PIXI.BitmapText = function(text, style) -{ - PIXI.DisplayObjectContainer.call(this); - - /** - * [read-only] The width of the overall text, different from fontSize, - * which is defined in the style object - * - * @property textWidth - * @type Number - * @readOnly - */ - this.textWidth = 0; - - /** - * [read-only] The height of the overall text, different from fontSize, - * which is defined in the style object - * - * @property textHeight - * @type Number - * @readOnly - */ - this.textHeight = 0; - - /** - * @property _pool - * @type Array - * @private - */ - this._pool = []; - - this.setText(text); - this.setStyle(style); - this.updateText(); - - /** - * The dirty state of this object. - * @property dirty - * @type Boolean - */ - this.dirty = false; -}; - -// constructor -PIXI.BitmapText.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); -PIXI.BitmapText.prototype.constructor = PIXI.BitmapText; - -/** - * Set the text string to be rendered. - * - * @method setText - * @param text {String} The text that you would like displayed - */ -PIXI.BitmapText.prototype.setText = function(text) -{ - this.text = text || ' '; - this.dirty = true; -}; - -/** - * Set the style of the text - * style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously) - * [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single lines of text - * - * @method setStyle - * @param style {Object} The style parameters, contained as properties of an object - */ -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; - this.tint = style.tint; -}; - -/** - * Renders text and updates it when needed - * - * @method updateText - * @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(/(?:\r\n|\r|\n)/.test(this.text.charAt(i))) - { - 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.kerning[prevCharCode]) - { - pos.x += charData.kerning[prevCharCode]; - } - - chars.push({texture:charData.texture, 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); - } - - var lenChildren = this.children.length; - var lenChars = chars.length; - var tint = this.tint || 0xFFFFFF; - - for(i = 0; i < lenChars; i++) - { - var c = i < lenChildren ? this.children[i] : this._pool.pop(); // get old child if have. if not - take from pool. - - if (c) c.setTexture(chars[i].texture); // check if got one before. - else c = new PIXI.Sprite(chars[i].texture); // if no create new one. - - c.position.x = (chars[i].position.x + lineAlignOffsets[chars[i].line]) * scale; - c.position.y = chars[i].position.y * scale; - c.scale.x = c.scale.y = scale; - c.tint = tint; - if (!c.parent) this.addChild(c); - } - - // remove unnecessary children. - // and put their into the pool. - while(this.children.length > lenChars) - { - var child = this.getChildAt(this.children.length - 1); - this._pool.push(child); - this.removeChild(child); - } - - this.textWidth = maxLineWidth * scale; - this.textHeight = (pos.y + data.lineHeight) * scale; -}; - -/** - * Updates the transform of this object - * - * @method updateTransform - * @private - */ -PIXI.BitmapText.prototype.updateTransform = function() -{ - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - PIXI.DisplayObjectContainer.prototype.updateTransform.call(this); -}; - -PIXI.BitmapText.fonts = {}; diff --git a/tutorial-3/pixi.js-master/src/pixi/text/Text.js b/tutorial-3/pixi.js-master/src/pixi/text/Text.js deleted file mode 100755 index b5a6e30..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/text/Text.js +++ /dev/null @@ -1,533 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * Modified by Tom Slezakowski http://www.tomslezakowski.com @TomSlezakowski (24/03/2014) - Added dropShadowColor. - */ - -/** - * A Text Object will create a line or multiple lines of text. To split a line you can use '\n' in your text string, - * or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object. - * - * @class Text - * @extends Sprite - * @constructor - * @param text {String} The copy that you would like the text to display - * @param [style] {Object} The style parameters - * @param [style.font] {String} default 'bold 20px Arial' The style and size of the font - * @param [style.fill='black'] {String|Number} A canvas fillstyle that will be used on the text e.g 'red', '#00FF00' - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - * @param [style.stroke] {String|Number} A canvas fillstyle that will be used on the text stroke e.g 'blue', '#FCFF00' - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke) - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap, it needs wordWrap to be set to true - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00' - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow - */ -PIXI.Text = function(text, style) -{ - /** - * The canvas element that everything is drawn to - * - * @property canvas - * @type HTMLCanvasElement - */ - this.canvas = document.createElement('canvas'); - - /** - * The canvas 2d context that everything is drawn with - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.canvas.getContext('2d'); - - /** - * The resolution of the canvas. - * @property resolution - * @type Number - */ - this.resolution = 1; - - PIXI.Sprite.call(this, PIXI.Texture.fromCanvas(this.canvas)); - - this.setText(text); - this.setStyle(style); - -}; - -// constructor -PIXI.Text.prototype = Object.create(PIXI.Sprite.prototype); -PIXI.Text.prototype.constructor = PIXI.Text; - -/** - * The width of the Text, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.Text.prototype, 'width', { - get: function() { - - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - - return this.scale.x * this.texture.frame.width; - }, - set: function(value) { - this.scale.x = value / this.texture.frame.width; - this._width = value; - } -}); - -/** - * The height of the Text, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.Text.prototype, 'height', { - get: function() { - - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - - return this.scale.y * this.texture.frame.height; - }, - set: function(value) { - this.scale.y = value / this.texture.frame.height; - this._height = value; - } -}); - -/** - * Set the style of the text - * - * @method setStyle - * @param [style] {Object} The style parameters - * @param [style.font='bold 20pt Arial'] {String} The style and size of the font - * @param [style.fill='black'] {Object} A canvas fillstyle that will be used on the text eg 'red', '#00FF00' - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - * @param [style.stroke='black'] {String} A canvas fillstyle that will be used on the text stroke eg 'blue', '#FCFF00' - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke) - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00' - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow - */ -PIXI.Text.prototype.setStyle = function(style) -{ - style = style || {}; - style.font = style.font || 'bold 20pt Arial'; - style.fill = style.fill || 'black'; - style.align = style.align || 'left'; - style.stroke = style.stroke || 'black'; //provide a default, see: https://github.com/GoodBoyDigital/pixi.js/issues/136 - style.strokeThickness = style.strokeThickness || 0; - style.wordWrap = style.wordWrap || false; - style.wordWrapWidth = style.wordWrapWidth || 100; - - style.dropShadow = style.dropShadow || false; - style.dropShadowAngle = style.dropShadowAngle || Math.PI / 6; - style.dropShadowDistance = style.dropShadowDistance || 4; - style.dropShadowColor = style.dropShadowColor || 'black'; - - this.style = style; - this.dirty = true; -}; - -/** - * Set the copy for the text object. To split a line you can use '\n'. - * - * @method setText - * @param text {String} The copy that you would like the text to display - */ -PIXI.Text.prototype.setText = function(text) -{ - this.text = text.toString() || ' '; - this.dirty = true; -}; - -/** - * Renders text and updates it when needed - * - * @method updateText - * @private - */ -PIXI.Text.prototype.updateText = function() -{ - this.texture.baseTexture.resolution = this.resolution; - - this.context.font = this.style.font; - - var outputText = this.text; - - // word wrap - // preserve original text - if(this.style.wordWrap)outputText = this.wordWrap(this.text); - - //split text into lines - var lines = outputText.split(/(?:\r\n|\r|\n)/); - - //calculate text width - var lineWidths = []; - var maxLineWidth = 0; - var fontProperties = this.determineFontProperties(this.style.font); - for (var i = 0; i < lines.length; i++) - { - var lineWidth = this.context.measureText(lines[i]).width; - lineWidths[i] = lineWidth; - maxLineWidth = Math.max(maxLineWidth, lineWidth); - } - - var width = maxLineWidth + this.style.strokeThickness; - if(this.style.dropShadow)width += this.style.dropShadowDistance; - - this.canvas.width = ( width + this.context.lineWidth ) * this.resolution; - - //calculate text height - var lineHeight = fontProperties.fontSize + this.style.strokeThickness; - - var height = lineHeight * lines.length; - if(this.style.dropShadow)height += this.style.dropShadowDistance; - - this.canvas.height = height * this.resolution; - - this.context.scale( this.resolution, this.resolution); - - if(navigator.isCocoonJS) this.context.clearRect(0,0,this.canvas.width,this.canvas.height); - - // used for debugging.. - //this.context.fillStyle ="#FF0000" - //this.context.fillRect(0, 0, this.canvas.width,this.canvas.height); - - this.context.font = this.style.font; - this.context.strokeStyle = this.style.stroke; - this.context.lineWidth = this.style.strokeThickness; - this.context.textBaseline = 'alphabetic'; - //this.context.lineJoin = 'round'; - - var linePositionX; - var linePositionY; - - if(this.style.dropShadow) - { - this.context.fillStyle = this.style.dropShadowColor; - - var xShadowOffset = Math.sin(this.style.dropShadowAngle) * this.style.dropShadowDistance; - var yShadowOffset = Math.cos(this.style.dropShadowAngle) * this.style.dropShadowDistance; - - for (i = 0; i < lines.length; i++) - { - linePositionX = this.style.strokeThickness / 2; - linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent; - - if(this.style.align === 'right') - { - linePositionX += maxLineWidth - lineWidths[i]; - } - else if(this.style.align === 'center') - { - linePositionX += (maxLineWidth - lineWidths[i]) / 2; - } - - if(this.style.fill) - { - this.context.fillText(lines[i], linePositionX + xShadowOffset, linePositionY + yShadowOffset); - } - - // if(dropShadow) - } - } - - //set canvas text styles - this.context.fillStyle = this.style.fill; - - //draw lines line by line - for (i = 0; i < lines.length; i++) - { - linePositionX = this.style.strokeThickness / 2; - linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent; - - if(this.style.align === 'right') - { - linePositionX += maxLineWidth - lineWidths[i]; - } - else if(this.style.align === 'center') - { - linePositionX += (maxLineWidth - lineWidths[i]) / 2; - } - - if(this.style.stroke && this.style.strokeThickness) - { - this.context.strokeText(lines[i], linePositionX, linePositionY); - } - - if(this.style.fill) - { - this.context.fillText(lines[i], linePositionX, linePositionY); - } - - // if(dropShadow) - } - - this.updateTexture(); -}; - -/** - * Updates texture size based on canvas size - * - * @method updateTexture - * @private - */ -PIXI.Text.prototype.updateTexture = function() -{ - this.texture.baseTexture.width = this.canvas.width; - this.texture.baseTexture.height = this.canvas.height; - this.texture.crop.width = this.texture.frame.width = this.canvas.width; - this.texture.crop.height = this.texture.frame.height = this.canvas.height; - - this._width = this.canvas.width; - this._height = this.canvas.height; - - // update the dirty base textures - this.texture.baseTexture.dirty(); -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Text.prototype._renderWebGL = function(renderSession) -{ - if(this.dirty) - { - this.resolution = renderSession.resolution; - - this.updateText(); - this.dirty = false; - } - - PIXI.Sprite.prototype._renderWebGL.call(this, renderSession); -}; - -/** -* Renders the object using the Canvas renderer -* -* @method _renderCanvas -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Text.prototype._renderCanvas = function(renderSession) -{ - if(this.dirty) - { - this.resolution = renderSession.resolution; - - this.updateText(); - this.dirty = false; - } - - PIXI.Sprite.prototype._renderCanvas.call(this, renderSession); -}; - -/** -* Calculates the ascent, descent and fontSize of a given fontStyle -* -* @method determineFontProperties -* @param fontStyle {Object} -* @private -*/ -PIXI.Text.prototype.determineFontProperties = function(fontStyle) -{ - var properties = PIXI.Text.fontPropertiesCache[fontStyle]; - - if(!properties) - { - properties = {}; - - var canvas = PIXI.Text.fontPropertiesCanvas; - var context = PIXI.Text.fontPropertiesContext; - - context.font = fontStyle; - - var width = Math.ceil(context.measureText('|Mq').width); - var baseline = Math.ceil(context.measureText('M').width); - var height = 2 * baseline; - - baseline = baseline * 1.4 | 0; - - canvas.width = width; - canvas.height = height; - - context.fillStyle = '#f00'; - context.fillRect(0, 0, width, height); - - context.font = fontStyle; - - context.textBaseline = 'alphabetic'; - context.fillStyle = '#000'; - context.fillText('|MÉq', 0, baseline); - - var imagedata = context.getImageData(0, 0, width, height).data; - var pixels = imagedata.length; - var line = width * 4; - - var i, j; - - var idx = 0; - var stop = false; - - // ascent. scan from top to bottom until we find a non red pixel - for(i = 0; i < baseline; i++) - { - for(j = 0; j < line; j += 4) - { - if(imagedata[idx + j] !== 255) - { - stop = true; - break; - } - } - if(!stop) - { - idx += line; - } - else - { - break; - } - } - - properties.ascent = baseline - i; - - idx = pixels - line; - stop = false; - - // descent. scan from bottom to top until we find a non red pixel - for(i = height; i > baseline; i--) - { - for(j = 0; j < line; j += 4) - { - if(imagedata[idx + j] !== 255) - { - stop = true; - break; - } - } - if(!stop) - { - idx -= line; - } - else - { - break; - } - } - - properties.descent = i - baseline; - //TODO might need a tweak. kind of a temp fix! - properties.descent += 6; - properties.fontSize = properties.ascent + properties.descent; - - PIXI.Text.fontPropertiesCache[fontStyle] = properties; - } - - return properties; -}; - -/** - * Applies newlines to a string to have it optimally fit into the horizontal - * bounds set by the Text object's wordWrapWidth property. - * - * @method wordWrap - * @param text {String} - * @private - */ -PIXI.Text.prototype.wordWrap = function(text) -{ - // Greedy wrapping algorithm that will wrap words as the line grows longer - // than its horizontal bounds. - var result = ''; - var lines = text.split('\n'); - for (var i = 0; i < lines.length; i++) - { - var spaceLeft = this.style.wordWrapWidth; - var words = lines[i].split(' '); - for (var j = 0; j < words.length; j++) - { - var wordWidth = this.context.measureText(words[j]).width; - var wordWidthWithSpace = wordWidth + this.context.measureText(' ').width; - if(j === 0 || wordWidthWithSpace > spaceLeft) - { - // Skip printing the newline if it's the first word of the line that is - // greater than the word wrap width. - if(j > 0) - { - result += '\n'; - } - result += words[j]; - spaceLeft = this.style.wordWrapWidth - wordWidth; - } - else - { - spaceLeft -= wordWidthWithSpace; - result += ' ' + words[j]; - } - } - - if (i < lines.length-1) - { - result += '\n'; - } - } - return result; -}; - -/** -* Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. -* -* @method getBounds -* @param matrix {Matrix} the transformation matrix of the Text -* @return {Rectangle} the framing rectangle -*/ -PIXI.Text.prototype.getBounds = function(matrix) -{ - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - return PIXI.Sprite.prototype.getBounds.call(this, matrix); -}; - -/** - * Destroys this text object. - * - * @method destroy - * @param destroyBaseTexture {Boolean} whether to destroy the base texture as well - */ -PIXI.Text.prototype.destroy = function(destroyBaseTexture) -{ - // make sure to reset the the context and canvas.. dont want this hanging around in memory! - this.context = null; - this.canvas = null; - - this.texture.destroy(destroyBaseTexture === undefined ? true : destroyBaseTexture); -}; - -PIXI.Text.fontPropertiesCache = {}; -PIXI.Text.fontPropertiesCanvas = document.createElement('canvas'); -PIXI.Text.fontPropertiesContext = PIXI.Text.fontPropertiesCanvas.getContext('2d'); diff --git a/tutorial-3/pixi.js-master/src/pixi/textures/BaseTexture.js b/tutorial-3/pixi.js-master/src/pixi/textures/BaseTexture.js deleted file mode 100755 index 0145849..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/textures/BaseTexture.js +++ /dev/null @@ -1,305 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -PIXI.BaseTextureCache = {}; - -PIXI.BaseTextureCacheIdGenerator = 0; - -/** - * A texture stores the information that represents an image. All textures have a base texture. - * - * @class BaseTexture - * @uses EventTarget - * @constructor - * @param source {String} the source object (image or canvas) - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - */ -PIXI.BaseTexture = function(source, scaleMode) -{ - /** - * The Resolution of the texture. - * - * @property resolution - * @type Number - */ - this.resolution = 1; - - /** - * [read-only] The width of the base texture set when the image has loaded - * - * @property width - * @type Number - * @readOnly - */ - this.width = 100; - - /** - * [read-only] The height of the base texture set when the image has loaded - * - * @property height - * @type Number - * @readOnly - */ - this.height = 100; - - /** - * The scale mode to apply when scaling this texture - * - * @property scaleMode - * @type {Number} - * @default PIXI.scaleModes.LINEAR - */ - this.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - /** - * [read-only] Set to true once the base texture has loaded - * - * @property hasLoaded - * @type Boolean - * @readOnly - */ - this.hasLoaded = false; - - /** - * The image source that is used to create the texture. - * - * @property source - * @type Image - */ - this.source = source; - - this._UID = PIXI._UID++; - - /** - * Controls if RGB channels should be pre-multiplied by Alpha (WebGL only) - * - * @property premultipliedAlpha - * @type Boolean - * @default true - */ - this.premultipliedAlpha = true; - - // used for webGL - - /** - * @property _glTextures - * @type Array - * @private - */ - this._glTextures = []; - - /** - * - * Set this to true if a mipmap of this texture needs to be generated. This value needs to be set before the texture is used - * Also the texture must be a power of two size to work - * - * @property mipmap - * @type {Boolean} - */ - this.mipmap = false; - - // used for webGL texture updating... - // TODO - this needs to be addressed - - /** - * @property _dirty - * @type Array - * @private - */ - this._dirty = [true, true, true, true]; - - if(!source)return; - - if((this.source.complete || this.source.getContext) && this.source.width && this.source.height) - { - this.hasLoaded = true; - this.width = this.source.naturalWidth || this.source.width; - this.height = this.source.naturalHeight || this.source.height; - this.dirty(); - } - else - { - var scope = this; - - this.source.onload = function() { - - scope.hasLoaded = true; - scope.width = scope.source.naturalWidth || scope.source.width; - scope.height = scope.source.naturalHeight || scope.source.height; - - scope.dirty(); - - // add it to somewhere... - scope.dispatchEvent( { type: 'loaded', content: scope } ); - }; - - this.source.onerror = function() { - scope.dispatchEvent( { type: 'error', content: scope } ); - }; - } - - /** - * @property imageUrl - * @type String - */ - this.imageUrl = null; - - /** - * @property _powerOf2 - * @type Boolean - * @private - */ - this._powerOf2 = false; - -}; - -PIXI.BaseTexture.prototype.constructor = PIXI.BaseTexture; - -PIXI.EventTarget.mixin(PIXI.BaseTexture.prototype); - -/** - * Destroys this base texture - * - * @method destroy - */ -PIXI.BaseTexture.prototype.destroy = function() -{ - if(this.imageUrl) - { - delete PIXI.BaseTextureCache[this.imageUrl]; - delete PIXI.TextureCache[this.imageUrl]; - this.imageUrl = null; - if (!navigator.isCocoonJS) this.source.src = ''; - } - else if (this.source && this.source._pixiId) - { - delete PIXI.BaseTextureCache[this.source._pixiId]; - } - this.source = null; - - this.unloadFromGPU(); -}; - -/** - * Changes the source image of the texture - * - * @method updateSourceImage - * @param newSrc {String} the path of the image - */ -PIXI.BaseTexture.prototype.updateSourceImage = function(newSrc) -{ - this.hasLoaded = false; - this.source.src = null; - this.source.src = newSrc; -}; - -/** - * Sets all glTextures to be dirty. - * - * @method dirty - */ -PIXI.BaseTexture.prototype.dirty = function() -{ - for (var i = 0; i < this._glTextures.length; i++) - { - this._dirty[i] = true; - } -}; - -/** - * Removes the base texture from the GPU, useful for managing resources on the GPU. - * Atexture is still 100% usable and will simply be reuploaded if there is a sprite on screen that is using it. - * - * @method unloadFromGPU - */ -PIXI.BaseTexture.prototype.unloadFromGPU = function() -{ - this.dirty(); - - // delete the webGL textures if any. - for (var i = this._glTextures.length - 1; i >= 0; i--) - { - var glTexture = this._glTextures[i]; - var gl = PIXI.glContexts[i]; - - if(gl && glTexture) - { - gl.deleteTexture(glTexture); - } - - } - - this._glTextures.length = 0; - - this.dirty(); -}; - -/** - * Helper function that creates a base texture from the given image url. - * If the image is not in the base texture cache it will be created and loaded. - * - * @static - * @method fromImage - * @param imageUrl {String} The image url of the texture - * @param crossorigin {Boolean} - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return BaseTexture - */ -PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode) -{ - var baseTexture = PIXI.BaseTextureCache[imageUrl]; - - if(crossorigin === undefined && imageUrl.indexOf('data:') === -1) crossorigin = true; - - if(!baseTexture) - { - // new Image() breaks tex loading in some versions of Chrome. - // See https://code.google.com/p/chromium/issues/detail?id=238071 - var image = new Image();//document.createElement('img'); - if (crossorigin) - { - image.crossOrigin = ''; - } - - image.src = imageUrl; - baseTexture = new PIXI.BaseTexture(image, scaleMode); - baseTexture.imageUrl = imageUrl; - PIXI.BaseTextureCache[imageUrl] = baseTexture; - - // if there is an @2x at the end of the url we are going to assume its a highres image - if( imageUrl.indexOf(PIXI.RETINA_PREFIX + '.') !== -1) - { - baseTexture.resolution = 2; - } - } - - return baseTexture; -}; - -/** - * Helper function that creates a base texture from the given canvas element. - * - * @static - * @method fromCanvas - * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return BaseTexture - */ -PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode) -{ - if(!canvas._pixiId) - { - canvas._pixiId = 'canvas_' + PIXI.TextureCacheIdGenerator++; - } - - var baseTexture = PIXI.BaseTextureCache[canvas._pixiId]; - - if(!baseTexture) - { - baseTexture = new PIXI.BaseTexture(canvas, scaleMode); - PIXI.BaseTextureCache[canvas._pixiId] = baseTexture; - } - - return baseTexture; -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/textures/RenderTexture.js b/tutorial-3/pixi.js-master/src/pixi/textures/RenderTexture.js deleted file mode 100755 index 849ce47..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/textures/RenderTexture.js +++ /dev/null @@ -1,339 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A RenderTexture is a special texture that allows any Pixi display object to be rendered to it. - * - * __Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead. - * - * A RenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example: - * - * var renderTexture = new PIXI.RenderTexture(800, 600); - * var sprite = PIXI.Sprite.fromImage("spinObj_01.png"); - * sprite.position.x = 800/2; - * sprite.position.y = 600/2; - * sprite.anchor.x = 0.5; - * sprite.anchor.y = 0.5; - * renderTexture.render(sprite); - * - * The Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual position a DisplayObjectContainer should be used: - * - * var doc = new PIXI.DisplayObjectContainer(); - * doc.addChild(sprite); - * renderTexture.render(doc); // Renders to center of renderTexture - * - * @class RenderTexture - * @extends Texture - * @constructor - * @param width {Number} The width of the render texture - * @param height {Number} The height of the render texture - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @param resolution {Number} The resolution of the texture being generated - */ -PIXI.RenderTexture = function(width, height, renderer, scaleMode, resolution) -{ - /** - * The with of the render texture - * - * @property width - * @type Number - */ - this.width = width || 100; - - /** - * The height of the render texture - * - * @property height - * @type Number - */ - this.height = height || 100; - - /** - * The Resolution of the texture. - * - * @property resolution - * @type Number - */ - this.resolution = resolution || 1; - - /** - * The framing rectangle of the render texture - * - * @property frame - * @type Rectangle - */ - this.frame = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @property crop - * @type Rectangle - */ - this.crop = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * The base texture object that this texture uses - * - * @property baseTexture - * @type BaseTexture - */ - this.baseTexture = new PIXI.BaseTexture(); - this.baseTexture.width = this.width * this.resolution; - this.baseTexture.height = this.height * this.resolution; - this.baseTexture._glTextures = []; - this.baseTexture.resolution = this.resolution; - - this.baseTexture.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - this.baseTexture.hasLoaded = true; - - PIXI.Texture.call(this, - this.baseTexture, - new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution) - ); - - /** - * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. - * - * @property renderer - * @type CanvasRenderer|WebGLRenderer - */ - this.renderer = renderer || PIXI.defaultRenderer; - - if(this.renderer.type === PIXI.WEBGL_RENDERER) - { - var gl = this.renderer.gl; - this.baseTexture._dirty[gl.id] = false; - - this.textureBuffer = new PIXI.FilterTexture(gl, this.width, this.height, this.baseTexture.scaleMode); - this.baseTexture._glTextures[gl.id] = this.textureBuffer.texture; - - this.render = this.renderWebGL; - this.projection = new PIXI.Point(this.width*0.5, -this.height*0.5); - } - else - { - this.render = this.renderCanvas; - this.textureBuffer = new PIXI.CanvasBuffer(this.width* this.resolution, this.height* this.resolution); - this.baseTexture.source = this.textureBuffer.canvas; - } - - /** - * @property valid - * @type Boolean - */ - this.valid = true; - - this._updateUvs(); -}; - -PIXI.RenderTexture.prototype = Object.create(PIXI.Texture.prototype); -PIXI.RenderTexture.prototype.constructor = PIXI.RenderTexture; - -/** - * Resizes the RenderTexture. - * - * @method resize - * @param width {Number} The width to resize to. - * @param height {Number} The height to resize to. - * @param updateBase {Boolean} Should the baseTexture.width and height values be resized as well? - */ -PIXI.RenderTexture.prototype.resize = function(width, height, updateBase) -{ - if (width === this.width && height === this.height)return; - - this.valid = (width > 0 && height > 0); - - this.width = width; - this.height = height; - - this.frame.width = this.crop.width = width * this.resolution; - this.frame.height = this.crop.height = height * this.resolution; - - if (updateBase) - { - this.baseTexture.width = this.width * this.resolution; - this.baseTexture.height = this.height * this.resolution; - } - - if (this.renderer.type === PIXI.WEBGL_RENDERER) - { - this.projection.x = this.width / 2; - this.projection.y = -this.height / 2; - } - - if(!this.valid)return; - - this.textureBuffer.resize(this.width, this.height); -}; - -/** - * Clears the RenderTexture. - * - * @method clear - */ -PIXI.RenderTexture.prototype.clear = function() -{ - if(!this.valid)return; - - if (this.renderer.type === PIXI.WEBGL_RENDERER) - { - this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer); - } - - this.textureBuffer.clear(); -}; - -/** - * This function will draw the display object to the texture. - * - * @method renderWebGL - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. - * @param [clear] {Boolean} If true the texture will be cleared before the displayObject is drawn - * @private - */ -PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, matrix, clear) -{ - if(!this.valid)return; - //TOOD replace position with matrix.. - - //Lets create a nice matrix to apply to our display object. Frame buffers come in upside down so we need to flip the matrix - var wt = displayObject.worldTransform; - wt.identity(); - wt.translate(0, this.projection.y * 2); - if(matrix)wt.append(matrix); - wt.scale(1,-1); - - // setWorld Alpha to ensure that the object is renderer at full opacity - displayObject.worldAlpha = 1; - - // Time to update all the children of the displayObject with the new matrix.. - var children = displayObject.children; - - for(var i=0,j=children.length; i this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) - { - throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); - } - - this.valid = frame && frame.width && frame.height && this.baseTexture.source && this.baseTexture.hasLoaded; - - if (this.trim) - { - this.width = this.trim.width; - this.height = this.trim.height; - this.frame.width = this.trim.width; - this.frame.height = this.trim.height; - } - - if (this.valid) this._updateUvs(); - -}; - -/** - * Updates the internal WebGL UV cache. - * - * @method _updateUvs - * @private - */ -PIXI.Texture.prototype._updateUvs = function() -{ - if(!this._uvs)this._uvs = new PIXI.TextureUvs(); - - var frame = this.crop; - var tw = this.baseTexture.width; - var th = this.baseTexture.height; - - this._uvs.x0 = frame.x / tw; - this._uvs.y0 = frame.y / th; - - this._uvs.x1 = (frame.x + frame.width) / tw; - this._uvs.y1 = frame.y / th; - - this._uvs.x2 = (frame.x + frame.width) / tw; - this._uvs.y2 = (frame.y + frame.height) / th; - - this._uvs.x3 = frame.x / tw; - this._uvs.y3 = (frame.y + frame.height) / th; -}; - -/** - * Helper function that creates a Texture object from the given image url. - * If the image is not in the texture cache it will be created and loaded. - * - * @static - * @method fromImage - * @param imageUrl {String} The image url of the texture - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return Texture - */ -PIXI.Texture.fromImage = function(imageUrl, crossorigin, scaleMode) -{ - var texture = PIXI.TextureCache[imageUrl]; - - if(!texture) - { - texture = new PIXI.Texture(PIXI.BaseTexture.fromImage(imageUrl, crossorigin, scaleMode)); - PIXI.TextureCache[imageUrl] = texture; - } - - return texture; -}; - -/** - * Helper function that returns a Texture objected based on the given frame id. - * If the frame id is not in the texture cache an error will be thrown. - * - * @static - * @method fromFrame - * @param frameId {String} The frame id of the texture - * @return Texture - */ -PIXI.Texture.fromFrame = function(frameId) -{ - var texture = PIXI.TextureCache[frameId]; - if(!texture) throw new Error('The frameId "' + frameId + '" does not exist in the texture cache '); - return texture; -}; - -/** - * Helper function that creates a new a Texture based on the given canvas element. - * - * @static - * @method fromCanvas - * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return Texture - */ -PIXI.Texture.fromCanvas = function(canvas, scaleMode) -{ - var baseTexture = PIXI.BaseTexture.fromCanvas(canvas, scaleMode); - - return new PIXI.Texture( baseTexture ); - -}; - -/** - * Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object. - * - * @static - * @method addTextureToCache - * @param texture {Texture} The Texture to add to the cache. - * @param id {String} The id that the texture will be stored against. - */ -PIXI.Texture.addTextureToCache = function(texture, id) -{ - PIXI.TextureCache[id] = texture; -}; - -/** - * Remove a texture from the global PIXI.TextureCache. - * - * @static - * @method removeTextureFromCache - * @param id {String} The id of the texture to be removed - * @return {Texture} The texture that was removed - */ -PIXI.Texture.removeTextureFromCache = function(id) -{ - var texture = PIXI.TextureCache[id]; - delete PIXI.TextureCache[id]; - delete PIXI.BaseTextureCache[id]; - return texture; -}; - -PIXI.TextureUvs = function() -{ - this.x0 = 0; - this.y0 = 0; - - this.x1 = 0; - this.y1 = 0; - - this.x2 = 0; - this.y2 = 0; - - this.x3 = 0; - this.y3 = 0; -}; - -PIXI.Texture.emptyTexture = new PIXI.Texture(new PIXI.BaseTexture()); - diff --git a/tutorial-3/pixi.js-master/src/pixi/textures/VideoTexture.js b/tutorial-3/pixi.js-master/src/pixi/textures/VideoTexture.js deleted file mode 100755 index ad58ec5..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/textures/VideoTexture.js +++ /dev/null @@ -1,168 +0,0 @@ -/** - * A texture of a [playing] Video. - * - * See the ["deus" demo](http://www.goodboydigital.com/pixijs/examples/deus/). - * - * @class VideoTexture - * @extends BaseTexture - * @constructor - * @param source {HTMLVideoElement} - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - */ -PIXI.VideoTexture = function( source, scaleMode ) -{ - if( !source ){ - throw new Error( 'No video source element specified.' ); - } - - // hook in here to check if video is already available. - // PIXI.BaseTexture looks for a source.complete boolean, plus width & height. - - if( (source.readyState === source.HAVE_ENOUGH_DATA || source.readyState === source.HAVE_FUTURE_DATA ) && source.width && source.height ) - { - source.complete = true; - } - - PIXI.BaseTexture.call( this, source, scaleMode ); - - this.autoUpdate = false; - this.updateBound = this._onUpdate.bind(this); - - if( !source.complete ) - { - this._onCanPlay = this.onCanPlay.bind(this); - - source.addEventListener( 'canplay', this._onCanPlay ); - source.addEventListener( 'canplaythrough', this._onCanPlay ); - - // started playing.. - source.addEventListener( 'play', this.onPlayStart.bind(this) ); - source.addEventListener( 'pause', this.onPlayStop.bind(this) ); - } - -}; - -PIXI.VideoTexture.prototype = Object.create( PIXI.BaseTexture.prototype ); - -PIXI.VideoTexture.constructor = PIXI.VideoTexture; - -PIXI.VideoTexture.prototype._onUpdate = function() -{ - if(this.autoUpdate) - { - window.requestAnimationFrame(this.updateBound); - this.dirty(); - } -}; - -PIXI.VideoTexture.prototype.onPlayStart = function() -{ - if(!this.autoUpdate) - { - window.requestAnimationFrame(this.updateBound); - this.autoUpdate = true; - } -}; - -PIXI.VideoTexture.prototype.onPlayStop = function() -{ - this.autoUpdate = false; -}; - -PIXI.VideoTexture.prototype.onCanPlay = function() -{ - if( event.type === 'canplaythrough' ) - { - this.hasLoaded = true; - - - if( this.source ) - { - this.source.removeEventListener( 'canplay', this._onCanPlay ); - this.source.removeEventListener( 'canplaythrough', this._onCanPlay ); - - this.width = this.source.videoWidth; - this.height = this.source.videoHeight; - - // prevent multiple loaded dispatches.. - if( !this.__loaded ){ - this.__loaded = true; - this.dispatchEvent( { type: 'loaded', content: this } ); - } - } - } -}; - -PIXI.VideoTexture.prototype.destroy = function() -{ - if( this.source && this.source._pixiId ) - { - PIXI.BaseTextureCache[ this.source._pixiId ] = null; - delete PIXI.BaseTextureCache[ this.source._pixiId ]; - - this.source._pixiId = null; - delete this.source._pixiId; - } - - PIXI.BaseTexture.prototype.destroy.call( this ); -}; - -/** - * Mimic Pixi BaseTexture.from.... method. - * - * @static - * @method baseTextureFromVideo - * @param video {HTMLVideoElement} - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return {VideoTexture} - */ -PIXI.VideoTexture.baseTextureFromVideo = function( video, scaleMode ) -{ - if( !video._pixiId ) - { - video._pixiId = 'video_' + PIXI.TextureCacheIdGenerator++; - } - - var baseTexture = PIXI.BaseTextureCache[ video._pixiId ]; - - if( !baseTexture ) - { - baseTexture = new PIXI.VideoTexture( video, scaleMode ); - PIXI.BaseTextureCache[ video._pixiId ] = baseTexture; - } - - return baseTexture; -}; - -/** - * Mimic Pixi BaseTexture.from.... method. - * - * @static - * @method textureFromVideo - * @param video {HTMLVideoElement} - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture, but not a VideoTexture. - */ -PIXI.VideoTexture.textureFromVideo = function( video, scaleMode ) -{ - var baseTexture = PIXI.VideoTexture.baseTextureFromVideo( video, scaleMode ); - return new PIXI.Texture( baseTexture ); -}; - -/** - * Mimic Pixi BaseTexture.from.... method. - * - * @static - * @method fromUrl - * @param videoSrc {String} The URL for the video. - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return {VideoTexture} - */ -PIXI.VideoTexture.fromUrl = function( videoSrc, scaleMode ) -{ - var video = document.createElement('video'); - video.src = videoSrc; - video.autoPlay = true; - video.play(); - return PIXI.VideoTexture.textureFromVideo( video, scaleMode); -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/utils/Detector.js b/tutorial-3/pixi.js-master/src/pixi/utils/Detector.js deleted file mode 100755 index fe38f04..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/utils/Detector.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This helper function will automatically detect which renderer you should be using. - * WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by - * the browser then this function will return a canvas renderer - * - * @method autoDetectRenderer - * @for PIXI - * @static - * @param width=800 {Number} the width of the renderers view - * @param height=600 {Number} the height of the renderers view - * - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * - */ -PIXI.autoDetectRenderer = function(width, height, options) -{ - if(!width)width = 800; - if(!height)height = 600; - - // BORROWED from Mr Doob (mrdoob.com) - var webgl = ( function () { try { - var canvas = document.createElement( 'canvas' ); - return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ); - } catch( e ) { - return false; - } - } )(); - - if( webgl ) - { - return new PIXI.WebGLRenderer(width, height, options); - } - - return new PIXI.CanvasRenderer(width, height, options); -}; - -/** - * This helper function will automatically detect which renderer you should be using. - * This function is very similar to the autoDetectRenderer function except that is will return a canvas renderer for android. - * Even thought both android chrome supports webGL the canvas implementation perform better at the time of writing. - * This function will likely change and update as webGL performance improves on these devices. - * - * @method autoDetectRecommendedRenderer - * @for PIXI - * @static - * @param width=800 {Number} the width of the renderers view - * @param height=600 {Number} the height of the renderers view - * - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * - */ -PIXI.autoDetectRecommendedRenderer = function(width, height, options) -{ - if(!width)width = 800; - if(!height)height = 600; - - // BORROWED from Mr Doob (mrdoob.com) - var webgl = ( function () { try { - var canvas = document.createElement( 'canvas' ); - return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ); - } catch( e ) { - return false; - } - } )(); - - var isAndroid = /Android/i.test(navigator.userAgent); - - if( webgl && !isAndroid) - { - return new PIXI.WebGLRenderer(width, height, options); - } - - return new PIXI.CanvasRenderer(width, height, options); -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/utils/EventTarget.js b/tutorial-3/pixi.js-master/src/pixi/utils/EventTarget.js deleted file mode 100755 index 35aa31b..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/utils/EventTarget.js +++ /dev/null @@ -1,284 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * @author Chad Engler https://github.com/englercj @Rolnaaba - */ - -/** - * Originally based on https://github.com/mrdoob/eventtarget.js/ from mr Doob. - * Currently takes inspiration from the nodejs EventEmitter, EventEmitter3, and smokesignals - */ - -/** - * Mixins event emitter functionality to a class - * - * @class EventTarget - * @example - * function MyEmitter() {} - * - * PIXI.EventTarget.mixin(MyEmitter.prototype); - * - * var em = new MyEmitter(); - * em.emit('eventName', 'some data', 'some more data', {}, null, ...); - */ -PIXI.EventTarget = { - /** - * Backward compat from when this used to be a function - */ - call: function callCompat(obj) { - if(obj) { - obj = obj.prototype || obj; - PIXI.EventTarget.mixin(obj); - } - }, - - /** - * Mixes in the properties of the EventTarget prototype onto another object - * - * @method mixin - * @param object {Object} The obj to mix into - */ - mixin: function mixin(obj) { - /** - * Return a list of assigned event listeners. - * - * @method listeners - * @param eventName {String} The events that should be listed. - * @return {Array} An array of listener functions - */ - obj.listeners = function listeners(eventName) { - this._listeners = this._listeners || {}; - - return this._listeners[eventName] ? this._listeners[eventName].slice() : []; - }; - - /** - * Emit an event to all registered event listeners. - * - * @method emit - * @alias dispatchEvent - * @param eventName {String} The name of the event. - * @return {Boolean} Indication if we've emitted an event. - */ - obj.emit = obj.dispatchEvent = function emit(eventName, data) { - this._listeners = this._listeners || {}; - - //backwards compat with old method ".emit({ type: 'something' })" - if(typeof eventName === 'object') { - data = eventName; - eventName = eventName.type; - } - - //ensure we are using a real pixi event - if(!data || data.__isEventObject !== true) { - data = new PIXI.Event(this, eventName, data); - } - - //iterate the listeners - if(this._listeners && this._listeners[eventName]) { - var listeners = this._listeners[eventName].slice(0), - length = listeners.length, - fn = listeners[0], - i; - - for(i = 0; i < length; fn = listeners[++i]) { - //call the event listener - fn.call(this, data); - - //if "stopImmediatePropagation" is called, stop calling sibling events - if(data.stoppedImmediate) { - return this; - } - } - - //if "stopPropagation" is called then don't bubble the event - if(data.stopped) { - return this; - } - } - - //bubble this event up the scene graph - if(this.parent && this.parent.emit) { - this.parent.emit.call(this.parent, eventName, data); - } - - return this; - }; - - /** - * Register a new EventListener for the given event. - * - * @method on - * @alias addEventListener - * @param eventName {String} Name of the event. - * @param callback {Functon} fn Callback function. - */ - obj.on = obj.addEventListener = function on(eventName, fn) { - this._listeners = this._listeners || {}; - - (this._listeners[eventName] = this._listeners[eventName] || []) - .push(fn); - - return this; - }; - - /** - * Add an EventListener that's only called once. - * - * @method once - * @param eventName {String} Name of the event. - * @param callback {Function} Callback function. - */ - obj.once = function once(eventName, fn) { - this._listeners = this._listeners || {}; - - var self = this; - function onceHandlerWrapper() { - fn.apply(self.off(eventName, onceHandlerWrapper), arguments); - } - onceHandlerWrapper._originalHandler = fn; - - return this.on(eventName, onceHandlerWrapper); - }; - - /** - * Remove event listeners. - * - * @method off - * @alias removeEventListener - * @param eventName {String} The event we want to remove. - * @param callback {Function} The listener that we need to find. - */ - obj.off = obj.removeEventListener = function off(eventName, fn) { - this._listeners = this._listeners || {}; - - if(!this._listeners[eventName]) - return this; - - var list = this._listeners[eventName], - i = fn ? list.length : 0; - - while(i-- > 0) { - if(list[i] === fn || list[i]._originalHandler === fn) { - list.splice(i, 1); - } - } - - if(list.length === 0) { - delete this._listeners[eventName]; - } - - return this; - }; - - /** - * Remove all listeners or only the listeners for the specified event. - * - * @method removeAllListeners - * @param eventName {String} The event you want to remove all listeners for. - */ - obj.removeAllListeners = function removeAllListeners(eventName) { - this._listeners = this._listeners || {}; - - if(!this._listeners[eventName]) - return this; - - delete this._listeners[eventName]; - - return this; - }; - } -}; - -/** - * Creates an homogenous object for tracking events so users can know what to expect. - * - * @class Event - * @extends Object - * @constructor - * @param target {Object} The target object that the event is called on - * @param name {String} The string name of the event that was triggered - * @param data {Object} Arbitrary event data to pass along - */ -PIXI.Event = function(target, name, data) { - //for duck typing in the ".on()" function - this.__isEventObject = true; - - /** - * Tracks the state of bubbling propagation. Do not - * set this directly, instead use `event.stopPropagation()` - * - * @property stopped - * @type Boolean - * @private - * @readOnly - */ - this.stopped = false; - - /** - * Tracks the state of sibling listener propagation. Do not - * set this directly, instead use `event.stopImmediatePropagation()` - * - * @property stoppedImmediate - * @type Boolean - * @private - * @readOnly - */ - this.stoppedImmediate = false; - - /** - * The original target the event triggered on. - * - * @property target - * @type Object - * @readOnly - */ - this.target = target; - - /** - * The string name of the event that this represents. - * - * @property type - * @type String - * @readOnly - */ - this.type = name; - - /** - * The data that was passed in with this event. - * - * @property data - * @type Object - * @readOnly - */ - this.data = data; - - //backwards compat with older version of events - this.content = data; - - /** - * The timestamp when the event occurred. - * - * @property timeStamp - * @type Number - * @readOnly - */ - this.timeStamp = Date.now(); -}; - -/** - * Stops the propagation of events up the scene graph (prevents bubbling). - * - * @method stopPropagation - */ -PIXI.Event.prototype.stopPropagation = function stopPropagation() { - this.stopped = true; -}; - -/** - * Stops the propagation of events to sibling listeners (no longer calls any listeners). - * - * @method stopImmediatePropagation - */ -PIXI.Event.prototype.stopImmediatePropagation = function stopImmediatePropagation() { - this.stoppedImmediate = true; -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/utils/Polyk.js b/tutorial-3/pixi.js-master/src/pixi/utils/Polyk.js deleted file mode 100755 index 838e6a2..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/utils/Polyk.js +++ /dev/null @@ -1,168 +0,0 @@ -/* - PolyK library - url: http://polyk.ivank.net - Released under MIT licence. - - Copyright (c) 2012 Ivan Kuckir - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation - files (the "Software"), to deal in the Software without - restriction, including without limitation the rights to use, - copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following - conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. - - This is an amazing lib! - - Slightly modified by Mat Groves (matgroves.com); -*/ - -/** - * Based on the Polyk library http://polyk.ivank.net released under MIT licence. - * This is an amazing lib! - * Slightly modified by Mat Groves (matgroves.com); - * @class PolyK - */ -PIXI.PolyK = {}; - -/** - * Triangulates shapes for webGL graphic fills. - * - * @method Triangulate - */ -PIXI.PolyK.Triangulate = function(p) -{ - var sign = true; - - var n = p.length >> 1; - if(n < 3) return []; - - var tgs = []; - var avl = []; - for(var i = 0; i < n; i++) avl.push(i); - - i = 0; - var al = n; - while(al > 3) - { - var i0 = avl[(i+0)%al]; - var i1 = avl[(i+1)%al]; - var i2 = avl[(i+2)%al]; - - var ax = p[2*i0], ay = p[2*i0+1]; - var bx = p[2*i1], by = p[2*i1+1]; - var cx = p[2*i2], cy = p[2*i2+1]; - - var earFound = false; - if(PIXI.PolyK._convex(ax, ay, bx, by, cx, cy, sign)) - { - earFound = true; - for(var j = 0; j < al; j++) - { - var vi = avl[j]; - if(vi === i0 || vi === i1 || vi === i2) continue; - - if(PIXI.PolyK._PointInTriangle(p[2*vi], p[2*vi+1], ax, ay, bx, by, cx, cy)) { - earFound = false; - break; - } - } - } - - if(earFound) - { - tgs.push(i0, i1, i2); - avl.splice((i+1)%al, 1); - al--; - i = 0; - } - else if(i++ > 3*al) - { - // need to flip flip reverse it! - // reset! - if(sign) - { - tgs = []; - avl = []; - for(i = 0; i < n; i++) avl.push(i); - - i = 0; - al = n; - - sign = false; - } - else - { - // window.console.log("PIXI Warning: shape too complex to fill"); - return null; - } - } - } - - tgs.push(avl[0], avl[1], avl[2]); - return tgs; -}; - -/** - * Checks whether a point is within a triangle - * - * @method _PointInTriangle - * @param px {Number} x coordinate of the point to test - * @param py {Number} y coordinate of the point to test - * @param ax {Number} x coordinate of the a point of the triangle - * @param ay {Number} y coordinate of the a point of the triangle - * @param bx {Number} x coordinate of the b point of the triangle - * @param by {Number} y coordinate of the b point of the triangle - * @param cx {Number} x coordinate of the c point of the triangle - * @param cy {Number} y coordinate of the c point of the triangle - * @private - * @return {Boolean} - */ -PIXI.PolyK._PointInTriangle = function(px, py, ax, ay, bx, by, cx, cy) -{ - var v0x = cx-ax; - var v0y = cy-ay; - var v1x = bx-ax; - var v1y = by-ay; - var v2x = px-ax; - var v2y = py-ay; - - var dot00 = v0x*v0x+v0y*v0y; - var dot01 = v0x*v1x+v0y*v1y; - var dot02 = v0x*v2x+v0y*v2y; - var dot11 = v1x*v1x+v1y*v1y; - var dot12 = v1x*v2x+v1y*v2y; - - var invDenom = 1 / (dot00 * dot11 - dot01 * dot01); - var u = (dot11 * dot02 - dot01 * dot12) * invDenom; - var v = (dot00 * dot12 - dot01 * dot02) * invDenom; - - // Check if point is in triangle - return (u >= 0) && (v >= 0) && (u + v < 1); -}; - -/** - * Checks whether a shape is convex - * - * @method _convex - * @private - * @return {Boolean} - */ -PIXI.PolyK._convex = function(ax, ay, bx, by, cx, cy, sign) -{ - return ((ay-by)*(cx-bx) + (bx-ax)*(cy-by) >= 0) === sign; -}; diff --git a/tutorial-3/pixi.js-master/src/pixi/utils/Utils.js b/tutorial-3/pixi.js-master/src/pixi/utils/Utils.js deleted file mode 100755 index 1a0127d..0000000 --- a/tutorial-3/pixi.js-master/src/pixi/utils/Utils.js +++ /dev/null @@ -1,220 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ -// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating - -// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel - -// MIT license - -/** - * A polyfill for requestAnimationFrame - * You can actually use both requestAnimationFrame and requestAnimFrame, - * you will still benefit from the polyfill - * - * @method requestAnimationFrame - */ - -/** - * A polyfill for cancelAnimationFrame - * - * @method cancelAnimationFrame - */ -(function(window) { - var lastTime = 0; - var vendors = ['ms', 'moz', 'webkit', 'o']; - for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { - window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']; - window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || - window[vendors[x] + 'CancelRequestAnimationFrame']; - } - - if (!window.requestAnimationFrame) { - window.requestAnimationFrame = function(callback) { - var currTime = new Date().getTime(); - var timeToCall = Math.max(0, 16 - (currTime - lastTime)); - var id = window.setTimeout(function() { callback(currTime + timeToCall); }, - timeToCall); - lastTime = currTime + timeToCall; - return id; - }; - } - - if (!window.cancelAnimationFrame) { - window.cancelAnimationFrame = function(id) { - clearTimeout(id); - }; - } - - window.requestAnimFrame = window.requestAnimationFrame; -})(this); - -/** - * Converts a hex color number to an [R, G, B] array - * - * @method hex2rgb - * @param hex {Number} - */ -PIXI.hex2rgb = function(hex) { - return [(hex >> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255]; -}; - -/** - * Converts a color as an [R, G, B] array to a hex number - * - * @method rgb2hex - * @param rgb {Array} - */ -PIXI.rgb2hex = function(rgb) { - return ((rgb[0]*255 << 16) + (rgb[1]*255 << 8) + rgb[2]*255); -}; - -/** - * A polyfill for Function.prototype.bind - * - * @method bind - */ -if (typeof Function.prototype.bind !== 'function') { - Function.prototype.bind = (function () { - return function (thisArg) { - var target = this, i = arguments.length - 1, boundArgs = []; - if (i > 0) - { - boundArgs.length = i; - while (i--) boundArgs[i] = arguments[i + 1]; - } - - if (typeof target !== 'function') throw new TypeError(); - - function bound() { - var i = arguments.length, args = new Array(i); - while (i--) args[i] = arguments[i]; - args = boundArgs.concat(args); - return target.apply(this instanceof bound ? this : thisArg, args); - } - - bound.prototype = (function F(proto) { - if (proto) F.prototype = proto; - if (!(this instanceof F)) return new F(); - })(target.prototype); - - return bound; - }; - })(); -} - -/** - * A wrapper for ajax requests to be handled cross browser - * - * @class AjaxRequest - * @constructor - */ -PIXI.AjaxRequest = function() -{ - var activexmodes = ['Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.3.0', 'Microsoft.XMLHTTP']; //activeX versions to check for in IE - - if (window.ActiveXObject) - { //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken) - for (var i=0; i 0 && (number & (number - 1)) === 0) // see: http://goo.gl/D9kPj - return number; - else - { - var result = 1; - while (result < number) result <<= 1; - return result; - } -}; - -/** - * checks if the given width and height make a power of two texture - * @method isPowerOfTwo - * @param width {Number} - * @param height {Number} - * @return {Boolean} - */ -PIXI.isPowerOfTwo = function(width, height) -{ - return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0); - -}; diff --git a/tutorial-3/pixi.js-master/tasks/karma.js b/tutorial-3/pixi.js-master/tasks/karma.js deleted file mode 100755 index e20aca5..0000000 --- a/tutorial-3/pixi.js-master/tasks/karma.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = function (grunt) { - 'use strict'; - - var path = require('path'); - var server = require('karma').server; - - grunt.registerMultiTask('karma', 'run karma.', function(target) { - //merge data onto options, with data taking precedence - var options = grunt.util._.merge(this.options(), this.data), - done = this.async(); - - if (options.configFile) { - options.configFile = grunt.template.process(options.configFile); - options.configFile = path.resolve(options.configFile); - } - - done = this.async(); - server.start(options, function(code) { - done(!code); - }); - }); -}; diff --git a/tutorial-3/pixi.js-master/test/functional/example-1-basics/bunny.png b/tutorial-3/pixi.js-master/test/functional/example-1-basics/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-3/pixi.js-master/test/functional/example-1-basics/bunny.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/test/functional/example-1-basics/frame-30.png b/tutorial-3/pixi.js-master/test/functional/example-1-basics/frame-30.png deleted file mode 100755 index 96e3409..0000000 Binary files a/tutorial-3/pixi.js-master/test/functional/example-1-basics/frame-30.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/test/functional/example-1-basics/frame-60.png b/tutorial-3/pixi.js-master/test/functional/example-1-basics/frame-60.png deleted file mode 100755 index af3f4ce..0000000 Binary files a/tutorial-3/pixi.js-master/test/functional/example-1-basics/frame-60.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/test/functional/example-1-basics/frame-90.png b/tutorial-3/pixi.js-master/test/functional/example-1-basics/frame-90.png deleted file mode 100755 index 099b823..0000000 Binary files a/tutorial-3/pixi.js-master/test/functional/example-1-basics/frame-90.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/test/functional/example-1-basics/index.js b/tutorial-3/pixi.js-master/test/functional/example-1-basics/index.js deleted file mode 100755 index 2ad32bd..0000000 --- a/tutorial-3/pixi.js-master/test/functional/example-1-basics/index.js +++ /dev/null @@ -1,133 +0,0 @@ -describe('Example 1 - Basics', function () { - 'use strict'; - - var baseUri = '/base/test/functional/example-1-basics'; - var expect = chai.expect; - var currentFrame = 0; - var frameEvents = {}; - var stage; - var renderer; - var bunny; - - function onFrame(frame, callback) { - frameEvents[frame] = callback; - } - - function animate() { - currentFrame += 1; - - window.requestAnimFrame( animate ); - - // just for fun, lets rotate mr rabbit a little - bunny.rotation += 0.1; - - // render the stage - renderer.render(stage); - - if (frameEvents[currentFrame]) - frameEvents[currentFrame](currentFrame); - } - - function initScene() { - // create an new instance of a pixi stage - stage = new PIXI.Stage(0x66FF99); - - // create a renderer instance - renderer = PIXI.autoDetectRenderer(400, 300); - console.log('Is PIXI.WebGLRenderer: ' + (renderer instanceof PIXI.WebGLRenderer)); - - // add the renderer view element to the DOM - document.body.appendChild(renderer.view); - - window.requestAnimFrame( animate ); - - // create a texture from an image path - var texture = PIXI.Texture.fromImage(baseUri + '/bunny.png'); - // create a new Sprite using the texture - bunny = new PIXI.Sprite(texture); - - // center the sprites anchor point - bunny.anchor.x = 0.5; - bunny.anchor.y = 0.5; - - // move the sprite t the center of the screen - bunny.position.x = 200; - bunny.position.y = 150; - - stage.addChild(bunny); - } - - it('assets loaded', function (done) { - var loader = new PIXI.AssetLoader([ - baseUri + '/bunny.png', - baseUri + '/frame-30.png', - baseUri + '/frame-60.png', - baseUri + '/frame-90.png' - ]); - // loader.on('onProgress', function (event) { - // console.log(event.content); - // }); - loader.on('onComplete', function () { - done(); - initScene(); - }); - loader.load(); - }); - - it('frame 30 should match', function (done) { - this.timeout(700); - onFrame(30, function () { - var str = renderer.view.toDataURL('image/png'); - //console.log(''); - resemble(str) - .compareTo(baseUri + '/frame-30.png') - .onComplete(function (data) { - expect(data).to.be.an('object'); - expect(data.isSameDimensions).to.equal(true); - expect(data.misMatchPercentage).to.be.below(0.2); - done(); - }); - }); - }); - - it('frame 60 should match', function (done) { - this.timeout(1200); - onFrame(60, function () { - var str = renderer.view.toDataURL('image/png'); - //console.log(''); - resemble(str) - .compareTo(baseUri + '/frame-60.png') - .onComplete(function (data) { - expect(data).to.be.an('object'); - expect(data.isSameDimensions).to.equal(true); - expect(data.misMatchPercentage).to.be.below(0.2); - done(); - }); - }); - }); - - it('frame 90 should match', function (done) { - this.timeout(1700); - onFrame(90, function () { - var str = renderer.view.toDataURL('image/png'); - //console.log(''); - resemble(str) - .compareTo(baseUri + '/frame-90.png') - .onComplete(function (data) { - expect(data).to.be.an('object'); - expect(data.isSameDimensions).to.equal(true); - expect(data.misMatchPercentage).to.be.below(0.2); - done(); - }); - }); - }); - - // it('capture something', function (done) { - // this.timeout(2000000); - // onFrame(30, function () { - // var img = new Image(); - // img.src = renderer.view.toDataURL('image/png'); - // document.body.appendChild(img); - // }); - // }); -}); diff --git a/tutorial-3/pixi.js-master/test/karma.conf.js b/tutorial-3/pixi.js-master/test/karma.conf.js deleted file mode 100755 index 86715ab..0000000 --- a/tutorial-3/pixi.js-master/test/karma.conf.js +++ /dev/null @@ -1,83 +0,0 @@ -module.exports = function(config) { - config.set({ - - // base path, that will be used to resolve files and exclude - basePath : '../', - - frameworks : ['mocha'], - - // list of files / patterns to load in the browser - files : [ - 'node_modules/chai/chai.js', - 'bin/pixi.dev.js', - 'test/lib/**/*.js', - 'test/unit/**/*.js', - // 'test/functional/**/*.js', - {pattern: 'test/**/*.png', watched: false, included: false, served: true} - ], - - // list of files to exclude - //exclude : [], - - // use dolts reporter, as travis terminal does not support escaping sequences - // possible values: 'dots', 'progress', 'junit', 'teamcity' - // CLI --reporters progress - reporters : ['spec'], - - // web server port - // CLI --port 9876 - port : 9876, - - // cli runner port - // CLI --runner-port 9100 - runnerPort : 9100, - - // enable / disable colors in the output (reporters and logs) - // CLI --colors --no-colors - colors : true, - - // level of logging - // possible values: karma.LOG_DISABLE || karma.LOG_ERROR || karma.LOG_WARN || karma.LOG_INFO || karma.LOG_DEBUG - // CLI --log-level debug - logLevel : config.LOG_INFO, - - // enable / disable watching file and executing tests whenever any file changes - // CLI --auto-watch --no-auto-watch - autoWatch : false, - - // Start these browsers, currently available: - // - Chrome - // - ChromeCanary - // - Firefox - // - Opera - // - Safari (only Mac) - // - PhantomJS - // - IE (only Windows) - // CLI --browsers Chrome,Firefox,Safari - browsers : ['Firefox'], - - // If browser does not capture in given timeout [ms], kill it - // CLI --capture-timeout 60000 - captureTimeout : 60000, - - // Auto run tests on start (when browsers are captured) and exit - // CLI --single-run --no-single-run - singleRun : true, - - // report which specs are slower than 500ms - // CLI --report-slower-than 500 - reportSlowerThan : 500, - - preprocessors : { - // '**/client/js/*.js': 'coverage' - }, - - plugins : [ - 'karma-chrome-launcher', - 'karma-firefox-launcher', - 'karma-mocha', - // 'karma-phantomjs-launcher' - 'karma-spec-reporter' - ] - }); -}; diff --git a/tutorial-3/pixi.js-master/test/lib/pixi/core/Circle.js b/tutorial-3/pixi.js-master/test/lib/pixi/core/Circle.js deleted file mode 100755 index e7cbd4d..0000000 --- a/tutorial-3/pixi.js-master/test/lib/pixi/core/Circle.js +++ /dev/null @@ -1,22 +0,0 @@ -function pixi_core_Circle_confirmNewCircle(obj) { - var expect = chai.expect; - - expect(obj).to.be.an.instanceof(PIXI.Circle); - expect(obj).to.respondTo('clone'); - expect(obj).to.respondTo('contains'); - expect(obj).to.respondTo('getBounds'); - - expect(obj).to.have.property('x', 0); - expect(obj).to.have.property('y', 0); - expect(obj).to.have.property('radius', 0); -} - -function pixi_core_Circle_isBoundedByRectangle(obj, rect) { - var expect = chai.expect; - - expect(rect).to.have.property('x', obj.x - obj.radius); - expect(rect).to.have.property('y', obj.y - obj.radius); - - expect(rect).to.have.property('width', obj.radius * 2); - expect(rect).to.have.property('height', obj.radius * 2); -} diff --git a/tutorial-3/pixi.js-master/test/lib/pixi/core/Matrix.js b/tutorial-3/pixi.js-master/test/lib/pixi/core/Matrix.js deleted file mode 100755 index 77492c2..0000000 --- a/tutorial-3/pixi.js-master/test/lib/pixi/core/Matrix.js +++ /dev/null @@ -1,13 +0,0 @@ -function pixi_core_Matrix_confirmNewMatrix(matrix) { - var expect = chai.expect; - - expect(matrix).to.be.an.instanceof(PIXI.Matrix); - expect(matrix).to.not.be.empty; - - expect(matrix.a).to.equal(1); - expect(matrix.b).to.equal(0); - expect(matrix.c).to.equal(0); - expect(matrix.d).to.equal(1); - expect(matrix.tx).to.equal(0); - expect(matrix.ty).to.equal(0); -} \ No newline at end of file diff --git a/tutorial-3/pixi.js-master/test/lib/pixi/core/Point.js b/tutorial-3/pixi.js-master/test/lib/pixi/core/Point.js deleted file mode 100755 index e5df07b..0000000 --- a/tutorial-3/pixi.js-master/test/lib/pixi/core/Point.js +++ /dev/null @@ -1,10 +0,0 @@ - -function pixi_core_Point_confirm(obj, x, y) { - var expect = chai.expect; - - expect(obj).to.be.an.instanceof(PIXI.Point); - expect(obj).to.respondTo('clone'); - - expect(obj).to.have.property('x', x); - expect(obj).to.have.property('y', y); -} diff --git a/tutorial-3/pixi.js-master/test/lib/pixi/core/Rectangle.js b/tutorial-3/pixi.js-master/test/lib/pixi/core/Rectangle.js deleted file mode 100755 index 23f0d12..0000000 --- a/tutorial-3/pixi.js-master/test/lib/pixi/core/Rectangle.js +++ /dev/null @@ -1,13 +0,0 @@ - -function pixi_core_Rectangle_confirm(obj, x, y, width, height) { - var expect = chai.expect; - - expect(obj).to.be.an.instanceof(PIXI.Rectangle); - expect(obj).to.respondTo('clone'); - expect(obj).to.respondTo('contains'); - - expect(obj).to.have.property('x', x); - expect(obj).to.have.property('y', y); - expect(obj).to.have.property('width', width); - expect(obj).to.have.property('height', height); -} diff --git a/tutorial-3/pixi.js-master/test/lib/pixi/display/DisplayObject.js b/tutorial-3/pixi.js-master/test/lib/pixi/display/DisplayObject.js deleted file mode 100755 index 9ca495e..0000000 --- a/tutorial-3/pixi.js-master/test/lib/pixi/display/DisplayObject.js +++ /dev/null @@ -1,38 +0,0 @@ - -function pixi_display_DisplayObject_confirmNew(obj) { - var expect = chai.expect; - - expect(obj).to.be.an.instanceof(PIXI.DisplayObject); - //expect(obj).to.respondTo('setInteractive'); - //expect(obj).to.respondTo('addFilter'); - //expect(obj).to.respondTo('removeFilter'); - expect(obj).to.respondTo('updateTransform'); - - expect(obj).to.contain.property('position'); - pixi_core_Point_confirm(obj.position, 0, 0); - expect(obj).to.contain.property('scale'); - pixi_core_Point_confirm(obj.scale, 1, 1); - expect(obj).to.contain.property('pivot'); - pixi_core_Point_confirm(obj.pivot, 0, 0); - - expect(obj).to.have.property('rotation', 0); - expect(obj).to.have.property('alpha', 1); - expect(obj).to.have.property('visible', true); - expect(obj).to.have.property('buttonMode', false); - expect(obj).to.have.property('parent', null); - expect(obj).to.have.property('worldAlpha', 1); - - expect(obj).to.have.property('hitArea'); - expect(obj).to.have.property('interactive'); // TODO: Have a better default value - expect('mask' in obj).to.be.true; // TODO: Have a better default value - expect(obj.mask).to.be.null; - - expect(obj).to.have.property('renderable'); - expect(obj).to.have.property('stage'); - - expect(obj).to.have.deep.property('worldTransform'); - pixi_core_Matrix_confirmNewMatrix(obj.worldTransform); - - //expect(obj).to.have.deep.property('color.length', 0); - //expect(obj).to.have.property('dynamic', true); -} diff --git a/tutorial-3/pixi.js-master/test/lib/pixi/display/DisplayObjectContainer.js b/tutorial-3/pixi.js-master/test/lib/pixi/display/DisplayObjectContainer.js deleted file mode 100755 index 58160a9..0000000 --- a/tutorial-3/pixi.js-master/test/lib/pixi/display/DisplayObjectContainer.js +++ /dev/null @@ -1,18 +0,0 @@ - -function pixi_display_DisplayObjectContainer_confirmNew(obj) { - var expect = chai.expect; - - pixi_display_DisplayObject_confirmNew(obj); - - expect(obj).to.be.an.instanceof(PIXI.DisplayObjectContainer); - expect(obj).to.respondTo('addChild'); - expect(obj).to.respondTo('addChildAt'); - expect(obj).to.respondTo('swapChildren'); - expect(obj).to.respondTo('getChildAt'); - expect(obj).to.respondTo('getChildIndex'); - expect(obj).to.respondTo('setChildIndex'); - expect(obj).to.respondTo('removeChild'); - expect(obj).to.respondTo('updateTransform'); - - expect(obj).to.have.deep.property('children.length', 0); -} diff --git a/tutorial-3/pixi.js-master/test/lib/pixi/display/Sprite.js b/tutorial-3/pixi.js-master/test/lib/pixi/display/Sprite.js deleted file mode 100755 index 2288c16..0000000 --- a/tutorial-3/pixi.js-master/test/lib/pixi/display/Sprite.js +++ /dev/null @@ -1,30 +0,0 @@ - -function pixi_display_Sprite_confirmNew(obj, done) { - var expect = chai.expect; - - pixi_display_DisplayObjectContainer_confirmNew(obj); - - expect(obj).to.be.an.instanceof(PIXI.Sprite); - expect(obj).to.respondTo('setTexture'); - expect(obj).to.respondTo('onTextureUpdate'); - - expect(obj).to.have.property('hitArea', null); - expect(obj).to.have.property('interactive', false); - expect(obj).to.have.property('renderable', true); - expect(obj).to.have.property('stage', null); - - expect(obj).to.have.property('anchor'); - pixi_core_Point_confirm(obj.anchor, 0, 0); - - expect(obj).to.have.property('blendMode', PIXI.blendModes.NORMAL); - expect(obj).to.have.property('width', 1); // TODO: is 1 expected - expect(obj).to.have.property('height', 1); // TODO: is 1 expected - - expect(obj).to.have.property('tint', 0xFFFFFF); - - // FIXME: Just make this a boolean that is always there - expect(!!obj.updateFrame).to.equal(obj.texture.baseTexture.hasLoaded); - - expect(obj).to.have.property('texture'); - pixi_textures_Texture_confirmNew(obj.texture, done); -} diff --git a/tutorial-3/pixi.js-master/test/lib/pixi/extras/Strip.js b/tutorial-3/pixi.js-master/test/lib/pixi/extras/Strip.js deleted file mode 100755 index 8927a8a..0000000 --- a/tutorial-3/pixi.js-master/test/lib/pixi/extras/Strip.js +++ /dev/null @@ -1,12 +0,0 @@ - -function pixi_extras_Strip_confirmNew(obj) { - var expect = chai.expect; - - pixi_display_DisplayObjectContainer_confirmNew(obj); - - expect(obj).to.be.an.instanceof(PIXI.Strip); - expect(obj).to.respondTo('setTexture'); - expect(obj).to.respondTo('onTextureUpdate'); - - // TODO: Test properties -} diff --git a/tutorial-3/pixi.js-master/test/lib/pixi/textures/RenderTexture.js b/tutorial-3/pixi.js-master/test/lib/pixi/textures/RenderTexture.js deleted file mode 100755 index 8556501..0000000 --- a/tutorial-3/pixi.js-master/test/lib/pixi/textures/RenderTexture.js +++ /dev/null @@ -1,14 +0,0 @@ - -function pixi_textures_RenderTexture_confirmNew(obj, done) { - var expect = chai.expect; - - expect(obj).to.have.property('width'); - expect(obj).to.have.property('height'); - - expect(obj).to.have.property('render'); - expect(obj).to.have.property('renderer'); - // expect(obj).to.have.property('projection'); - expect(obj).to.have.property('textureBuffer'); - - pixi_textures_Texture_confirmNew(obj, done); -} diff --git a/tutorial-3/pixi.js-master/test/lib/pixi/textures/Texture.js b/tutorial-3/pixi.js-master/test/lib/pixi/textures/Texture.js deleted file mode 100755 index 2493385..0000000 --- a/tutorial-3/pixi.js-master/test/lib/pixi/textures/Texture.js +++ /dev/null @@ -1,26 +0,0 @@ - -function pixi_textures_Texture_confirmNew(obj, done) { - var expect = chai.expect; - - function confirmFrameDone() { - pixi_core_Rectangle_confirm(obj.frame, 0, 0, obj.baseTexture.width, obj.baseTexture.height); - - expect(obj).to.have.property('width', obj.baseTexture.width); - expect(obj).to.have.property('height', obj.baseTexture.height); - done(); - } - - expect(obj).to.be.an.instanceof(PIXI.Texture); - pixi_utils_EventTarget_confirm(obj); - - expect(obj).to.have.property('baseTexture') - .and.to.be.an.instanceof(PIXI.BaseTexture); - - expect(obj).to.have.property('frame'); - if (obj.baseTexture.hasLoaded) { - confirmFrameDone(); - } else { - obj.on('update', confirmFrameDone); - pixi_core_Rectangle_confirm(obj.frame, 0, 0, 1, 1); - } -} diff --git a/tutorial-3/pixi.js-master/test/lib/pixi/utils/EventTarget.js b/tutorial-3/pixi.js-master/test/lib/pixi/utils/EventTarget.js deleted file mode 100755 index a0c3924..0000000 --- a/tutorial-3/pixi.js-master/test/lib/pixi/utils/EventTarget.js +++ /dev/null @@ -1,34 +0,0 @@ - -function pixi_utils_EventTarget_confirm(obj) { - var expect = chai.expect; - - //public API - expect(obj).to.respondTo('listeners'); - expect(obj).to.respondTo('emit'); - expect(obj).to.respondTo('on'); - expect(obj).to.respondTo('once'); - expect(obj).to.respondTo('off'); - expect(obj).to.respondTo('removeAllListeners'); - - //Aliased names - expect(obj).to.respondTo('removeEventListener'); - expect(obj).to.respondTo('addEventListener'); - expect(obj).to.respondTo('dispatchEvent'); -} - -function pixi_utils_EventTarget_Event_confirm(event, obj, data) { - var expect = chai.expect; - - expect(event).to.be.an.instanceOf(PIXI.Event); - - expect(event).to.have.property('stopped', false); - expect(event).to.have.property('stoppedImmediate', false); - - expect(event).to.have.property('target', obj); - expect(event).to.have.property('type', data.type || 'myevent'); - expect(event).to.have.property('data', data); - expect(event).to.have.property('content', data); - - expect(event).to.respondTo('stopPropagation'); - expect(event).to.respondTo('stopImmediatePropagation'); -} \ No newline at end of file diff --git a/tutorial-3/pixi.js-master/test/lib/resemble.js b/tutorial-3/pixi.js-master/test/lib/resemble.js deleted file mode 100755 index 1cb8c29..0000000 --- a/tutorial-3/pixi.js-master/test/lib/resemble.js +++ /dev/null @@ -1,535 +0,0 @@ -/* -Author: James Cryer -Company: Huddle -Last updated date: 21 Feb 2013 -URL: https://github.com/Huddle/Resemble.js -*/ - -(function(_this){ - 'use strict'; - - _this['resemble'] = function( fileData ){ - - var data = {}; - var images = []; - var updateCallbackArray = []; - - var tolerance = { // between 0 and 255 - red: 16, - green: 16, - blue: 16, - minBrightness: 16, - maxBrightness: 240 - }; - - var ignoreAntialiasing = false; - var ignoreColors = false; - - function triggerDataUpdate(){ - var len = updateCallbackArray.length; - var i; - for(i=0;i tolerance.maxBrightness; - } - - function getHue(r,g,b){ - - r = r / 255; - g = g / 255; - b = b / 255; - var max = Math.max(r, g, b), min = Math.min(r, g, b); - var h; - var d; - - if (max == min){ - h = 0; // achromatic - } else{ - d = max - min; - switch(max){ - case r: h = (g - b) / d + (g < b ? 6 : 0); break; - case g: h = (b - r) / d + 2; break; - case b: h = (r - g) / d + 4; break; - } - h /= 6; - } - - return h; - } - - function isAntialiased(sourcePix, data, cacheSet, verticalPos, horizontalPos, width){ - var offset; - var targetPix; - var distance = 1; - var i; - var j; - var hasHighContrastSibling = 0; - var hasSiblingWithDifferentHue = 0; - var hasEquivilantSibling = 0; - - addHueInfo(sourcePix); - - for (i = distance*-1; i <= distance; i++){ - for (j = distance*-1; j <= distance; j++){ - - if(i===0 && j===0){ - // ignore source pixel - } else { - - offset = ((verticalPos+j)*width + (horizontalPos+i)) * 4; - targetPix = getPixelInfo(data, offset, cacheSet); - - if(targetPix === null){ - continue; - } - - addBrightnessInfo(targetPix); - addHueInfo(targetPix); - - if( isContrasting(sourcePix, targetPix) ){ - hasHighContrastSibling++; - } - - if( isRGBSame(sourcePix,targetPix) ){ - hasEquivilantSibling++; - } - - if( Math.abs(targetPix.h - sourcePix.h) > 0.3 ){ - hasSiblingWithDifferentHue++; - } - - if( hasSiblingWithDifferentHue > 1 || hasHighContrastSibling > 1){ - return true; - } - } - } - } - - if(hasEquivilantSibling < 2){ - return true; - } - - return false; - } - - function errorPixel(px, offset){ - px[offset] = 255; //r - px[offset + 1] = 0; //g - px[offset + 2] = 255; //b - px[offset + 3] = 255; //a - } - - function copyPixel(px, offset, data){ - px[offset] = data.r; //r - px[offset + 1] = data.g; //g - px[offset + 2] = data.b; //b - px[offset + 3] = 255; //a - } - - function copyGrayScalePixel(px, offset, data){ - px[offset] = data.brightness; //r - px[offset + 1] = data.brightness; //g - px[offset + 2] = data.brightness; //b - px[offset + 3] = 255; //a - } - - - function getPixelInfo(data, offset, cacheSet){ - var r; - var g; - var b; - var d; - - if(typeof data[offset] !== 'undefined'){ - r = data[offset]; - g = data[offset+1]; - b = data[offset+2]; - d = { - r: r, - g: g, - b: b - }; - - return d; - } else { - return null; - } - } - - function addBrightnessInfo(data){ - data.brightness = getBrightness(data.r,data.g,data.b); // 'corrected' lightness - } - - function addHueInfo(data){ - data.h = getHue(data.r,data.g,data.b); - } - - function analyseImages(img1, img2, width, height){ - - var hiddenCanvas = document.createElement('canvas'); - - var data1 = img1.data; - var data2 = img2.data; - - hiddenCanvas.width = width; - hiddenCanvas.height = height; - - var context = hiddenCanvas.getContext('2d'); - var imgd = context.createImageData(width,height); - var targetPix = imgd.data; - - var mismatchCount = 0; - - var time = Date.now(); - - var skip; - - if( (width > 1200 || height > 1200) && ignoreAntialiasing){ - skip = 6; - } - - loop(height, width, function(verticalPos, horizontalPos){ - - if(skip){ // only skip if the image isn't small - if(verticalPos % skip === 0 || horizontalPos % skip === 0){ - return; - } - } - - var offset = (verticalPos*width + horizontalPos) * 4; - var pixel1 = getPixelInfo(data1, offset, 1); - var pixel2 = getPixelInfo(data2, offset, 2); - - if(pixel1 === null || pixel2 === null){ - return; - } - - if (ignoreColors){ - - addBrightnessInfo(pixel1); - addBrightnessInfo(pixel2); - - if( isPixelBrightnessSimilar(pixel1, pixel2) ){ - copyGrayScalePixel(targetPix, offset, pixel2); - } else { - errorPixel(targetPix, offset); - mismatchCount++; - } - return; - } - - if( isRGBSimilar(pixel1, pixel2) ){ - copyPixel(targetPix, offset, pixel2); - - } else if( ignoreAntialiasing && ( - addBrightnessInfo(pixel1), // jit pixel info augmentation looks a little weird, sorry. - addBrightnessInfo(pixel2), - isAntialiased(pixel1, data1, 1, verticalPos, horizontalPos, width) || - isAntialiased(pixel2, data2, 2, verticalPos, horizontalPos, width) - )){ - - if( isPixelBrightnessSimilar(pixel1, pixel2) ){ - copyGrayScalePixel(targetPix, offset, pixel2); - } else { - errorPixel(targetPix, offset); - mismatchCount++; - } - } else { - errorPixel(targetPix, offset); - mismatchCount++; - } - - }); - - data.misMatchPercentage = (mismatchCount / (height*width) * 100).toFixed(2); - data.analysisTime = Date.now() - time; - - data.getImageDataUrl = function(text){ - var barHeight = 0; - - if(text){ - barHeight = addLabel(text,context,hiddenCanvas); - } - - context.putImageData(imgd, 0, barHeight); - - return hiddenCanvas.toDataURL("image/png"); - }; - } - - function addLabel(text, context, hiddenCanvas){ - var textPadding = 2; - - context.font = '12px sans-serif'; - - var textWidth = context.measureText(text).width + textPadding*2; - var barHeight = 22; - - if(textWidth > hiddenCanvas.width){ - hiddenCanvas.width = textWidth; - } - - hiddenCanvas.height += barHeight; - - context.fillStyle = "#666"; - context.fillRect(0,0,hiddenCanvas.width,barHeight -4); - context.fillStyle = "#fff"; - context.fillRect(0,barHeight -4,hiddenCanvas.width, 4); - - context.fillStyle = "#fff"; - context.textBaseline = "top"; - context.font = '12px sans-serif'; - context.fillText(text, textPadding, 1); - - return barHeight; - } - - function normalise(img, w, h){ - var c; - var context; - - if(img.height < h || img.width < w){ - c = document.createElement('canvas'); - c.width = w; - c.height = h; - context = c.getContext('2d'); - context.putImageData(img, 0, 0); - return context.getImageData(0, 0, w, h); - } - - return img; - } - - function compare(one, two){ - - function onceWeHaveBoth(){ - var width; - var height; - if(images.length === 2){ - width = images[0].width > images[1].width ? images[0].width : images[1].width; - height = images[0].height > images[1].height ? images[0].height : images[1].height; - - if( (images[0].width === images[1].width) && (images[0].height === images[1].height) ){ - data.isSameDimensions = true; - } else { - data.isSameDimensions = false; - } - - analyseImages( normalise(images[0],width, height), normalise(images[1],width, height), width, height); - - triggerDataUpdate(); - } - } - - images = []; - loadImageData(one, onceWeHaveBoth); - loadImageData(two, onceWeHaveBoth); - } - - function getCompareApi(param){ - - var secondFileData, - hasMethod = typeof param === 'function'; - - if( !hasMethod ){ - // assume it's file data - secondFileData = param; - } - - var self = { - ignoreNothing: function(){ - - tolerance.red = 16; - tolerance.green = 16; - tolerance.blue = 16; - tolerance.minBrightness = 16; - tolerance.maxBrightness = 240; - - ignoreAntialiasing = false; - ignoreColors = false; - - if(hasMethod) { param(); } - return self; - }, - ignoreAntialiasing: function(){ - - tolerance.red = 32; - tolerance.green = 32; - tolerance.blue = 32; - tolerance.minBrightness = 64; - tolerance.maxBrightness = 96; - - ignoreAntialiasing = true; - ignoreColors = false; - - if(hasMethod) { param(); } - return self; - }, - ignoreColors: function(){ - - tolerance.minBrightness = 16; - tolerance.maxBrightness = 240; - - ignoreAntialiasing = false; - ignoreColors = true; - - if(hasMethod) { param(); } - return self; - }, - onComplete: function( callback ){ - - updateCallbackArray.push(callback); - - var wrapper = function(){ - compare(fileData, secondFileData); - }; - - wrapper(); - - return getCompareApi(wrapper); - } - }; - - return self; - } - - return { - onComplete: function( callback ){ - updateCallbackArray.push(callback); - loadImageData(fileData, function(imageData, width, height){ - parseImage(imageData.data, width, height); - }); - }, - compareTo: function(secondFileData){ - return getCompareApi(secondFileData); - } - }; - - }; -}(this)); \ No newline at end of file diff --git a/tutorial-3/pixi.js-master/test/textures/SpriteSheet-Aliens.png b/tutorial-3/pixi.js-master/test/textures/SpriteSheet-Aliens.png deleted file mode 100755 index 210acb1..0000000 Binary files a/tutorial-3/pixi.js-master/test/textures/SpriteSheet-Aliens.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/test/textures/SpriteSheet-Explosion.png b/tutorial-3/pixi.js-master/test/textures/SpriteSheet-Explosion.png deleted file mode 100755 index 79e1a69..0000000 Binary files a/tutorial-3/pixi.js-master/test/textures/SpriteSheet-Explosion.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/test/textures/bunny.png b/tutorial-3/pixi.js-master/test/textures/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-3/pixi.js-master/test/textures/bunny.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/InteractionManager.js b/tutorial-3/pixi.js-master/test/unit/pixi/InteractionManager.js deleted file mode 100755 index ed3001f..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/InteractionManager.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/InteractionManager', function () { - 'use strict'; - - var expect = chai.expect; - var InteractionManager = PIXI.InteractionManager; - - it('Module exists', function () { - expect(InteractionManager).to.be.a('function'); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/Pixi.js b/tutorial-3/pixi.js-master/test/unit/pixi/Pixi.js deleted file mode 100755 index 27debc1..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/Pixi.js +++ /dev/null @@ -1,9 +0,0 @@ -describe('pixi/Pixi', function () { - 'use strict'; - - var expect = chai.expect; - - it('Module exists', function () { - expect(global).to.have.property('PIXI').and.to.be.an('object'); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/core/Circle.js b/tutorial-3/pixi.js-master/test/unit/pixi/core/Circle.js deleted file mode 100755 index fbcfa17..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/core/Circle.js +++ /dev/null @@ -1,21 +0,0 @@ -describe('pixi/core/Circle', function () { - 'use strict'; - - var expect = chai.expect; - var Circle = PIXI.Circle; - - it('Module exists', function () { - expect(Circle).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new Circle(); - pixi_core_Circle_confirmNewCircle(obj); - }); - - it("getBounds should return Rectangle that bounds the circle", function() { - var obj = new Circle(100, 250, 50); - var bounds = obj.getBounds(); - pixi_core_Circle_isBoundedByRectangle(obj, bounds); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/core/Ellipse.js b/tutorial-3/pixi.js-master/test/unit/pixi/core/Ellipse.js deleted file mode 100755 index 026b56f..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/core/Ellipse.js +++ /dev/null @@ -1,24 +0,0 @@ -describe('pixi/core/Ellipse', function () { - 'use strict'; - - var expect = chai.expect; - var Ellipse = PIXI.Ellipse; - - it('Module exists', function () { - expect(Ellipse).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new Ellipse(); - - expect(obj).to.be.an.instanceof(Ellipse); - expect(obj).to.respondTo('clone'); - expect(obj).to.respondTo('contains'); - expect(obj).to.respondTo('getBounds'); - - expect(obj).to.have.property('x', 0); - expect(obj).to.have.property('y', 0); - expect(obj).to.have.property('width', 0); - expect(obj).to.have.property('height', 0); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/core/Matrix.js b/tutorial-3/pixi.js-master/test/unit/pixi/core/Matrix.js deleted file mode 100755 index da75e2e..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/core/Matrix.js +++ /dev/null @@ -1,14 +0,0 @@ -describe('pixi/core/Matrix', function () { - 'use strict'; - - var expect = chai.expect; - - it('Matrix exists', function () { - expect(PIXI.Matrix).to.be.an('function'); - }); - - it('Confirm new Matrix', function () { - var matrix = new PIXI.Matrix(); - pixi_core_Matrix_confirmNewMatrix(matrix); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/core/Point.js b/tutorial-3/pixi.js-master/test/unit/pixi/core/Point.js deleted file mode 100755 index c4d5163..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/core/Point.js +++ /dev/null @@ -1,15 +0,0 @@ -describe('pixi/core/Point', function () { - 'use strict'; - - var expect = chai.expect; - var Point = PIXI.Point; - - it('Module exists', function () { - expect(Point).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new Point(); - pixi_core_Point_confirm(obj, 0, 0); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/core/Polygon.js b/tutorial-3/pixi.js-master/test/unit/pixi/core/Polygon.js deleted file mode 100755 index dc8c918..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/core/Polygon.js +++ /dev/null @@ -1,20 +0,0 @@ -describe('pixi/core/Polygon', function () { - 'use strict'; - - var expect = chai.expect; - var Polygon = PIXI.Polygon; - - it('Module exists', function () { - expect(Polygon).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new Polygon(); - - expect(obj).to.be.an.instanceof(Polygon); - expect(obj).to.respondTo('clone'); - expect(obj).to.respondTo('contains'); - - expect(obj).to.have.deep.property('points.length', 0); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/core/Rectangle.js b/tutorial-3/pixi.js-master/test/unit/pixi/core/Rectangle.js deleted file mode 100755 index d43316e..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/core/Rectangle.js +++ /dev/null @@ -1,15 +0,0 @@ -describe('pixi/core/Rectangle', function () { - 'use strict'; - - var expect = chai.expect; - var Rectangle = PIXI.Rectangle; - - it('Module exists', function () { - expect(Rectangle).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var rect = new Rectangle(); - pixi_core_Rectangle_confirm(rect, 0, 0, 0, 0); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/display/DisplayObject.js b/tutorial-3/pixi.js-master/test/unit/pixi/display/DisplayObject.js deleted file mode 100755 index 044acf8..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/display/DisplayObject.js +++ /dev/null @@ -1,21 +0,0 @@ -describe('pixi/display/DisplayObject', function () { - 'use strict'; - - var expect = chai.expect; - var DisplayObject = PIXI.DisplayObject; - - it('Module exists', function () { - expect(DisplayObject).to.be.a('function'); - // expect(PIXI).to.have.property('visibleCount', 0); - }); - - it('Confirm new instance', function () { - var obj = new DisplayObject(); - - pixi_display_DisplayObject_confirmNew(obj); - expect(obj).to.have.property('hitArea', null); - expect(obj).to.have.property('interactive', false); - expect(obj).to.have.property('renderable', false); - expect(obj).to.have.property('stage', null); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/display/DisplayObjectContainer.js b/tutorial-3/pixi.js-master/test/unit/pixi/display/DisplayObjectContainer.js deleted file mode 100755 index 15a3376..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/display/DisplayObjectContainer.js +++ /dev/null @@ -1,67 +0,0 @@ -describe('pixi/display/DisplayObjectContainer', function () { - 'use strict'; - - var expect = chai.expect; - var DisplayObjectContainer = PIXI.DisplayObjectContainer; - - it('Module exists', function () { - expect(DisplayObjectContainer).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new DisplayObjectContainer(); - - pixi_display_DisplayObjectContainer_confirmNew(obj); - expect(obj).to.have.property('hitArea', null); - expect(obj).to.have.property('interactive', false); - expect(obj).to.have.property('renderable', false); - expect(obj).to.have.property('stage', null); - }); - - it('Gets child index', function() { - var container = new PIXI.DisplayObjectContainer(); - var children = []; - for (var i = 0; i < 10; i++) { - var child = new PIXI.DisplayObject(); - children.push(child); - container.addChild(child); - } - - for (i = 0; i < children.length; i++) { - expect(i).to.eql(container.getChildIndex(children[i])); - } - }); - - it('throws error when trying to get index of not a child', function() { - var container = new PIXI.DisplayObjectContainer(); - var child = new PIXI.DisplayObject(); - - expect(function() { container.getChildIndex(child); }).to.throw(); - }); - - it('Sets child index', function() { - var container = new PIXI.DisplayObjectContainer(); - var children = []; - - for (var i = 0; i < 10; i++) { - var child = new PIXI.DisplayObject(); - children.push(child); - container.addChild(child); - } - children.reverse(); - - for (i = 0; i < children.length; i++) { - container.setChildIndex(children[i], i); - expect(i).to.eql(container.getChildIndex(children[i])); - } - }); - - it('throws error when trying to set incorect index', function() { - var container = new PIXI.DisplayObjectContainer(); - var child = new PIXI.DisplayObject(); - container.addChild(child); - - expect(function() { container.setChildIndex(child, -1); }).to.throw(); - expect(function() { container.setChildIndex(child, 1); }).to.throw(); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/display/MovieClip.js b/tutorial-3/pixi.js-master/test/unit/pixi/display/MovieClip.js deleted file mode 100755 index f3c6c6a..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/display/MovieClip.js +++ /dev/null @@ -1,33 +0,0 @@ -describe('pixi/display/MovieClip', function () { - 'use strict'; - - var expect = chai.expect; - var MovieClip = PIXI.MovieClip; - var Texture = PIXI.Texture; - - it('Module exists', function () { - expect(MovieClip).to.be.a('function'); - }); - - it('Confirm new instance', function (done) { - var texture = Texture.fromImage('/base/test/textures/SpriteSheet-Explosion.png'); - var obj = new MovieClip([texture]); - - pixi_display_Sprite_confirmNew(obj, done); - - expect(obj).to.be.an.instanceof(MovieClip); - expect(obj).to.respondTo('stop'); - expect(obj).to.respondTo('play'); - expect(obj).to.respondTo('gotoAndStop'); - expect(obj).to.respondTo('gotoAndPlay'); - expect(obj).to.respondTo('updateTransform'); - - expect(obj).to.have.deep.property('textures.length', 1); - expect(obj).to.have.deep.property('textures[0]', texture); - expect(obj).to.have.property('animationSpeed', 1); - expect(obj).to.have.property('loop', true); - expect(obj).to.have.property('onComplete', null); - expect(obj).to.have.property('currentFrame', 0); - expect(obj).to.have.property('playing', false); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/display/Sprite.js b/tutorial-3/pixi.js-master/test/unit/pixi/display/Sprite.js deleted file mode 100755 index 30c8076..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/display/Sprite.js +++ /dev/null @@ -1,28 +0,0 @@ -describe('pixi/display/Sprite', function () { - 'use strict'; - - var expect = chai.expect; - var Sprite = PIXI.Sprite; - var Texture = PIXI.Texture; - - it('Module exists', function () { - expect(Sprite).to.be.a('function'); - expect(PIXI).to.have.deep.property('blendModes.NORMAL', 0); - expect(PIXI).to.have.deep.property('blendModes.ADD', 1); - expect(PIXI).to.have.deep.property('blendModes.MULTIPLY', 2); - expect(PIXI).to.have.deep.property('blendModes.SCREEN', 3); - }); - - - it('Members exist', function () { - expect(Sprite).itself.to.respondTo('fromImage'); - expect(Sprite).itself.to.respondTo('fromFrame'); - }); - - it('Confirm new instance', function (done) { - var texture = Texture.fromImage('/base/test/textures/SpriteSheet-Aliens.png'); - var obj = new Sprite(texture); - - pixi_display_Sprite_confirmNew(obj, done); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/display/Stage.js b/tutorial-3/pixi.js-master/test/unit/pixi/display/Stage.js deleted file mode 100755 index 6974c2e..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/display/Stage.js +++ /dev/null @@ -1,49 +0,0 @@ -describe('pixi/display/Stage', function () { - 'use strict'; - - var expect = chai.expect; - var Stage = PIXI.Stage; - var InteractionManager = PIXI.InteractionManager; - var Rectangle = PIXI.Rectangle; - - it('Module exists', function () { - expect(Stage).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new Stage(null, true); - - pixi_display_DisplayObjectContainer_confirmNew(obj); - - expect(obj).to.be.an.instanceof(Stage); - expect(obj).to.respondTo('updateTransform'); - expect(obj).to.respondTo('setBackgroundColor'); - expect(obj).to.respondTo('getMousePosition'); - // FIXME: duplicate member in DisplayObject - pixi_core_Matrix_confirmNewMatrix(obj.worldTransform); - // FIXME: convert arg to bool in constructor - expect(obj).to.have.property('interactive', true); - - expect(obj).to.have.property('interactionManager') - .and.to.be.an.instanceof(InteractionManager) - .and.to.have.property('stage', obj); - - expect(obj).to.have.property('dirty', true); - - expect(obj).to.have.property('stage', obj); - - expect(obj).to.have.property('hitArea') - .and.to.be.an.instanceof(Rectangle); - pixi_core_Rectangle_confirm(obj.hitArea, 0, 0, 100000, 100000); - - expect(obj).to.have.property('backgroundColor', 0x000000); - expect(obj).to.have.deep.property('backgroundColorSplit.length', 3); - expect(obj).to.have.deep.property('backgroundColorSplit[0]', 0); - expect(obj).to.have.deep.property('backgroundColorSplit[1]', 0); - expect(obj).to.have.deep.property('backgroundColorSplit[2]', 0); - expect(obj).to.have.property('backgroundColorString', '#000000'); - - - expect(obj).to.have.property('worldVisible', true); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/extras/Rope.js b/tutorial-3/pixi.js-master/test/unit/pixi/extras/Rope.js deleted file mode 100755 index 05885ac..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/extras/Rope.js +++ /dev/null @@ -1,31 +0,0 @@ -describe('pixi/extras/Rope', function () { - 'use strict'; - - var expect = chai.expect; - var Rope = PIXI.Rope; - var Texture = PIXI.Texture; - var Point = PIXI.Point; - - it('Module exists', function () { - expect(Rope).to.be.a('function'); - }); - - it('Confirm new instance', function () { - - var texture = Texture.fromImage('/base/test/textures/bunny.png'); - - // TODO-Alvin - // Same as Strip - - // var obj = new Rope(texture, [new Point(), new Point(5, 10), new Point(10, 20)]); - - // pixi_extras_Strip_confirmNew(obj); - - // expect(obj).to.be.an.instanceof(Rope); - // expect(obj).to.respondTo('refresh'); - // expect(obj).to.respondTo('updateTransform'); - // expect(obj).to.respondTo('setTexture'); - - // TODO: Test properties - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/extras/Spine.js b/tutorial-3/pixi.js-master/test/unit/pixi/extras/Spine.js deleted file mode 100755 index 0708bc0..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/extras/Spine.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/extras/Spine', function () { - 'use strict'; - - var expect = chai.expect; - var Spine = PIXI.Spine; - - it('Module exists', function () { - expect(Spine).to.be.a('function'); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/extras/Strip.js b/tutorial-3/pixi.js-master/test/unit/pixi/extras/Strip.js deleted file mode 100755 index 230af90..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/extras/Strip.js +++ /dev/null @@ -1,26 +0,0 @@ -describe('pixi/extras/Strip', function () { - 'use strict'; - - var expect = chai.expect; - var Strip = PIXI.Strip; - var Texture = PIXI.Texture; - - it('Module exists', function () { - expect(Strip).to.be.a('function'); - }); - - it('Confirm new instance', function () { - - - // TODO-Alvin - // We tweaked it to make it pass the tests, but the whole strip class needs - // to be re-coded - - var texture = Texture.fromImage('/base/test/textures/bunny.png'); - - // var obj = new Strip(texture, 20, 10000); - - - // pixi_extras_Strip_confirmNew(obj); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/extras/TilingSprite.js b/tutorial-3/pixi.js-master/test/unit/pixi/extras/TilingSprite.js deleted file mode 100755 index 56aea14..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/extras/TilingSprite.js +++ /dev/null @@ -1,24 +0,0 @@ -describe('pixi/extras/TilingSprite', function () { - 'use strict'; - - var expect = chai.expect; - var TilingSprite = PIXI.TilingSprite; - var Texture = PIXI.Texture; - - it('Module exists', function () { - expect(TilingSprite).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var texture = Texture.fromImage('/base/test/textures/bunny.png'); - var obj = new TilingSprite(texture, 6000, 12000); - - pixi_display_DisplayObjectContainer_confirmNew(obj); - - expect(obj).to.be.an.instanceof(TilingSprite); - expect(obj).to.respondTo('setTexture'); - expect(obj).to.respondTo('onTextureUpdate'); - - // TODO: Test properties - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/filters/FilterBlock.js b/tutorial-3/pixi.js-master/test/unit/pixi/filters/FilterBlock.js deleted file mode 100755 index 870cec0..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/filters/FilterBlock.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/filters/FilterBlock', function () { - 'use strict'; - - var expect = chai.expect; - var FilterBlock = PIXI.FilterBlock; - - it('Module exists', function () { - expect(FilterBlock).to.be.a('function'); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/loaders/AssetLoader.js b/tutorial-3/pixi.js-master/test/unit/pixi/loaders/AssetLoader.js deleted file mode 100755 index a0aa0b5..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/loaders/AssetLoader.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/loaders/AssetLoader', function () { - 'use strict'; - - var expect = chai.expect; - var AssetLoader = PIXI.AssetLoader; - - it('Module exists', function () { - expect(AssetLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/loaders/BitmapFontLoader.js b/tutorial-3/pixi.js-master/test/unit/pixi/loaders/BitmapFontLoader.js deleted file mode 100755 index 046f018..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/loaders/BitmapFontLoader.js +++ /dev/null @@ -1,9 +0,0 @@ -describe('pixi/loaders/BitmapFontLoader', function () { - 'use strict'; - - var expect = chai.expect; - - it('Module exists', function () { - expect(PIXI.BitmapFontLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/loaders/ImageLoader.js b/tutorial-3/pixi.js-master/test/unit/pixi/loaders/ImageLoader.js deleted file mode 100755 index 8b1f556..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/loaders/ImageLoader.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/loaders/ImageLoader', function () { - 'use strict'; - - var expect = chai.expect; - var ImageLoader = PIXI.ImageLoader; - - it('Module exists', function () { - expect(ImageLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/loaders/JsonLoader.js b/tutorial-3/pixi.js-master/test/unit/pixi/loaders/JsonLoader.js deleted file mode 100755 index c577e83..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/loaders/JsonLoader.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/loaders/JsonLoader', function () { - 'use strict'; - - var expect = chai.expect; - var JsonLoader = PIXI.JsonLoader; - - it('Module exists', function () { - expect(JsonLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/loaders/SpineLoader.js b/tutorial-3/pixi.js-master/test/unit/pixi/loaders/SpineLoader.js deleted file mode 100755 index fdcc0b8..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/loaders/SpineLoader.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/loaders/SpineLoader', function () { - 'use strict'; - - var expect = chai.expect; - var SpineLoader = PIXI.SpineLoader; - - it('Module exists', function () { - expect(SpineLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/loaders/SpriteSheetLoader.js b/tutorial-3/pixi.js-master/test/unit/pixi/loaders/SpriteSheetLoader.js deleted file mode 100755 index 57beb27..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/loaders/SpriteSheetLoader.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/loaders/SpriteSheetLoader', function () { - 'use strict'; - - var expect = chai.expect; - var SpriteSheetLoader = PIXI.SpriteSheetLoader; - - it('Module exists', function () { - expect(SpriteSheetLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/primitives/Graphics.js b/tutorial-3/pixi.js-master/test/unit/pixi/primitives/Graphics.js deleted file mode 100755 index f3849eb..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/primitives/Graphics.js +++ /dev/null @@ -1,44 +0,0 @@ -describe('pixi/primitives/Graphics', function () { - 'use strict'; - - var expect = chai.expect; - var Graphics = PIXI.Graphics; - - it('Module exists', function () { - expect(Graphics).to.be.a('function'); - - expect(Graphics).itself.to.have.property('POLY', 0); - expect(Graphics).itself.to.have.property('RECT', 1); - expect(Graphics).itself.to.have.property('CIRC', 2); - expect(Graphics).itself.to.have.property('ELIP', 3); - expect(Graphics).itself.to.have.property('RREC', 4); - }); - - it('Confirm new instance', function () { - var obj = new Graphics(); - - pixi_display_DisplayObjectContainer_confirmNew(obj); - - expect(obj).to.be.an.instanceof(Graphics); - expect(obj).to.respondTo('lineStyle'); - expect(obj).to.respondTo('lineStyle'); - expect(obj).to.respondTo('moveTo'); - expect(obj).to.respondTo('lineTo'); - expect(obj).to.respondTo('beginFill'); - expect(obj).to.respondTo('endFill'); - expect(obj).to.respondTo('drawRect'); - // expect(obj).to.respondTo('drawRoundedRect'); - expect(obj).to.respondTo('drawCircle'); - expect(obj).to.respondTo('drawEllipse'); - expect(obj).to.respondTo('clear'); - - expect(obj).to.have.property('renderable', true); - expect(obj).to.have.property('fillAlpha', 1); - expect(obj).to.have.property('lineWidth', 0); - expect(obj).to.have.property('width', 0); - expect(obj).to.have.property('height', 0); - expect(obj).to.have.property('lineColor', 0); - expect(obj).to.have.deep.property('graphicsData.length', 0); - // expect(obj).to.have.deep.property('currentPath.points.length', 0); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasGraphics.js b/tutorial-3/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasGraphics.js deleted file mode 100755 index 8f44472..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasGraphics.js +++ /dev/null @@ -1,15 +0,0 @@ -describe('renders/canvas/CanvasGraphics', function () { - 'use strict'; - - var expect = chai.expect; - var CanvasGraphics = PIXI.CanvasGraphics; - - it('Module exists', function () { - expect(CanvasGraphics).to.be.a('function'); - }); - - it('Members exist', function () { - expect(CanvasGraphics).itself.to.respondTo('renderGraphics'); - expect(CanvasGraphics).itself.to.respondTo('renderGraphicsMask'); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasRenderer.js b/tutorial-3/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasRenderer.js deleted file mode 100755 index 1646444..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasRenderer.js +++ /dev/null @@ -1,36 +0,0 @@ -describe('renderers/canvas/CanvasRenderer', function () { - 'use strict'; - - var expect = chai.expect; - var CanvasRenderer = PIXI.CanvasRenderer; - - it('Module exists', function () { - expect(CanvasRenderer).to.be.a('function'); - }); - - describe('.autoResize', function () { - it('Should automatically resize view if enabled', function () { - var renderer = new CanvasRenderer(200, 200, { - autoResize: true - }); - - expect(renderer.view.style.width).to.equal('200px'); - }); - - it('Should not automatically resize view if disabled', function () { - var renderer = new CanvasRenderer(200, 200, { - autoResize: false - }); - - expect(renderer.view.style.width).to.equal(''); - }); - - it('Should not automatically resize view if not specified', function () { - var renderer = new CanvasRenderer(200, 200, { - resolution: 2 - }); - - expect(renderer.view.style.width).to.equal(''); - }); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLGraphics.js b/tutorial-3/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLGraphics.js deleted file mode 100755 index 5867b28..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLGraphics.js +++ /dev/null @@ -1,20 +0,0 @@ -describe('renderers/wegbl/WebGLGraphics', function () { - 'use strict'; - - var expect = chai.expect; - var WebGLGraphics = PIXI.WebGLGraphics; - - it('Module exists', function () { - expect(WebGLGraphics).to.be.a('function'); - }); - - it('Members exist', function () { - expect(WebGLGraphics).itself.to.respondTo('renderGraphics'); - expect(WebGLGraphics).itself.to.respondTo('updateGraphics'); - expect(WebGLGraphics).itself.to.respondTo('buildRectangle'); - expect(WebGLGraphics).itself.to.respondTo('buildRoundedRectangle'); - expect(WebGLGraphics).itself.to.respondTo('buildCircle'); - expect(WebGLGraphics).itself.to.respondTo('buildLine'); - expect(WebGLGraphics).itself.to.respondTo('buildPoly'); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLRenderer.js b/tutorial-3/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLRenderer.js deleted file mode 100755 index 1680a80..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLRenderer.js +++ /dev/null @@ -1,49 +0,0 @@ -describe('renderers/webgl/WebGLRenderer', function () { - 'use strict'; - - var expect = chai.expect; - var WebGLRenderer = PIXI.WebGLRenderer; - - it('Module exists', function () { - expect(WebGLRenderer).to.be.a('function'); - }); - - // Skip tests if WebGL is not available (WebGL not supported in Travis CI) - try { - var renderer = new WebGLRenderer(400, 300, {}); - renderer.destroy(); - } catch (error) { - return; - } - - it('Destroy renderer', function () { - var renderer = new WebGLRenderer(400, 300, {}); - renderer.destroy(); - }); - - describe('.autoResize', function () { - it('Should automatically resize view if enabled', function () { - var renderer = new WebGLRenderer(200, 200, { - autoResize: true - }); - - expect(renderer.view.style.width).to.equal('200px'); - }); - - it('Should not automatically resize view if disabled', function () { - var renderer = new WebGLRenderer(200, 200, { - autoResize: false - }); - - expect(renderer.view.style.width).to.equal(''); - }); - - it('Should not automatically resize view if not specified', function () { - var renderer = new WebGLRenderer(200, 200, { - resolution: 2 - }); - - expect(renderer.view.style.width).to.equal(''); - }); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLShaders.js b/tutorial-3/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLShaders.js deleted file mode 100755 index 6e33e4f..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLShaders.js +++ /dev/null @@ -1,13 +0,0 @@ -describe('renderers/webgl/WebGLShaders', function () { - 'use strict'; - - var expect = chai.expect; - - it('Module members exist', function () { - - expect(PIXI).to.respondTo('CompileVertexShader'); - expect(PIXI).to.respondTo('CompileFragmentShader'); - expect(PIXI).to.respondTo('_CompileShader'); - expect(PIXI).to.respondTo('compileProgram'); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLSpriteBatch.js b/tutorial-3/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLSpriteBatch.js deleted file mode 100755 index e662b63..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLSpriteBatch.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('renderers/webgl/utils/WebGLSpriteBatch', function () { - 'use strict'; - - var expect = chai.expect; - var WebGLSpriteBatch = PIXI.WebGLSpriteBatch; - - it('Module exists', function () { - expect(WebGLSpriteBatch).to.be.a('function'); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/text/BitmapText.js b/tutorial-3/pixi.js-master/test/unit/pixi/text/BitmapText.js deleted file mode 100755 index 9388e3d..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/text/BitmapText.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/text/BitmapText', function () { - 'use strict'; - - var expect = chai.expect; - var BitmapText = PIXI.BitmapText; - - it('Module exists', function () { - expect(BitmapText).to.be.a('function'); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/text/Text.js b/tutorial-3/pixi.js-master/test/unit/pixi/text/Text.js deleted file mode 100755 index 9bc9ac5..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/text/Text.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/text/Text', function () { - 'use strict'; - - var expect = chai.expect; - var Text = PIXI.Text; - - it('Module exists', function () { - expect(Text).to.be.a('function'); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/textures/BaseTexture.js b/tutorial-3/pixi.js-master/test/unit/pixi/textures/BaseTexture.js deleted file mode 100755 index 502b724..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/textures/BaseTexture.js +++ /dev/null @@ -1,11 +0,0 @@ -describe('pixi/textures/BaseTexture', function () { - 'use strict'; - - var expect = chai.expect; - var BaseTexture = PIXI.BaseTexture; - - it('Module exists', function () { - expect(BaseTexture).to.be.a('function'); - expect(PIXI).to.have.property('BaseTextureCache').and.to.be.an('object'); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/textures/RenderTexture.js b/tutorial-3/pixi.js-master/test/unit/pixi/textures/RenderTexture.js deleted file mode 100755 index 96acdb4..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/textures/RenderTexture.js +++ /dev/null @@ -1,15 +0,0 @@ -describe('pixi/textures/RenderTexture', function () { - 'use strict'; - - var expect = chai.expect; - var RenderTexture = PIXI.RenderTexture; - - it('Module exists', function () { - expect(RenderTexture).to.be.a('function'); - }); - - it('Confirm new instance', function (done) { - var texture = new RenderTexture(100, 100, new PIXI.CanvasRenderer()); - pixi_textures_RenderTexture_confirmNew(texture, done); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/textures/Texture.js b/tutorial-3/pixi.js-master/test/unit/pixi/textures/Texture.js deleted file mode 100755 index 090f64d..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/textures/Texture.js +++ /dev/null @@ -1,26 +0,0 @@ -describe('pixi/textures/Texture', function () { - 'use strict'; - - var expect = chai.expect; - var Texture = PIXI.Texture; - - it('Module exists', function () { - expect(Texture).to.be.a('function'); - expect(PIXI).to.have.property('TextureCache').and.to.be.an('object'); - }); - - it('Members exist', function () { - expect(Texture).itself.to.respondTo('fromImage'); - expect(Texture).itself.to.respondTo('fromFrame'); - expect(Texture).itself.to.respondTo('fromCanvas'); - expect(Texture).itself.to.respondTo('addTextureToCache'); - expect(Texture).itself.to.respondTo('removeTextureFromCache'); - - // expect(Texture).itself.to.have.deep.property('frameUpdates.length', 0); - }); - - it('Confirm new instance', function (done) { - var texture = Texture.fromImage('/base/test/textures/bunny.png'); - pixi_textures_Texture_confirmNew(texture, done); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/utils/Detector.js b/tutorial-3/pixi.js-master/test/unit/pixi/utils/Detector.js deleted file mode 100755 index 4cf6008..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/utils/Detector.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/utils/Detector', function () { - 'use strict'; - - var expect = chai.expect; - var autoDetectRenderer = PIXI.autoDetectRenderer; - - it('Module exists', function () { - expect(autoDetectRenderer).to.be.a('function'); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/utils/EventTarget.js b/tutorial-3/pixi.js-master/test/unit/pixi/utils/EventTarget.js deleted file mode 100755 index 1cfc3a4..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/utils/EventTarget.js +++ /dev/null @@ -1,361 +0,0 @@ -describe('pixi/utils/EventTarget', function () { - 'use strict'; - - var expect = chai.expect; - - var Clazz, PClazz, obj, pobj, obj2; - beforeEach(function () { - Clazz = function () {}; - PClazz = function () {}; - - PIXI.EventTarget.mixin(Clazz.prototype); - PIXI.EventTarget.mixin(PClazz.prototype); - - obj = new Clazz(); - obj2 = new Clazz(); - pobj = new PClazz(); - - obj.parent = pobj; - obj2.parent = obj; - }); - - it('Module exists', function () { - expect(PIXI.EventTarget).to.be.an('object'); - }); - - it('Confirm new instance', function () { - pixi_utils_EventTarget_confirm(obj); - }); - - it('simple on/emit case works', function () { - var myData = {}; - - obj.on('myevent', function (event) { - pixi_utils_EventTarget_Event_confirm(event, obj, myData); - }); - - obj.emit('myevent', myData); - }); - - it('simple once case works', function () { - var called = 0; - - obj.once('myevent', function() { called++; }); - - obj.emit('myevent'); - obj.emit('myevent'); - obj.emit('myevent'); - obj.emit('myevent'); - obj.emit('myevent'); - - expect(called).to.equal(1); - }); - - it('simple off case works', function (done) { - function onMyEvent() { - done(new Error('Event listener should not have been called')); - } - - obj.on('myevent', onMyEvent); - obj.off('myevent', onMyEvent); - obj.emit('myevent'); - - done(); - }); - - it('simple propagation case works', function (done) { - var myData = {}; - - pobj.on('myevent', function () { - done(); - }); - - obj.emit('myevent'); - }); - - it('simple stopPropagation case works', function (done) { - var myData = {}; - - pobj.on('myevent', function () { - done(new Error('Event listener should not have been called on the parent element')); - }); - - obj.on('myevent', function (evt) { - evt.stopPropagation(); - }); - - obj.emit('myevent'); - - done(); - }); - - it('simple stopImmediatePropagation case works', function (done) { - var myData = {}; - - pobj.on('myevent', function () { - done(new Error('Event listener should not have been called on the parent')); - }); - - obj.on('myevent', function (evt) { - evt.stopImmediatePropagation(); - }); - - obj.on('myevent', function () { - done(new Error('Event listener should not have been called on the second')); - }); - - obj.emit('myevent'); - - done(); - }); - - it('multiple dispatches work properly', function () { - var called = 0; - - function onMyEvent() { - called++; - } - - obj.on('myevent', onMyEvent); - obj.emit('myevent'); - obj.emit('myevent'); - obj.emit('myevent'); - obj.emit('myevent'); - - expect(called).to.equal(4); - }); - - it('multiple events work properly', function () { - var called = 0; - - function onMyEvent() { - called++; - } - - obj.on('myevent1', onMyEvent); - obj.on('myevent2', onMyEvent); - obj.on('myevent3', onMyEvent); - obj.emit('myevent1'); - obj.emit('myevent2'); - obj.emit('myevent3'); - - expect(called).to.equal(3); - }); - - it('multiple events one removed works properly', function () { - var called = 0; - - function onMyEvent() { - called++; - } - - obj.on('myevent1', onMyEvent); - obj.on('myevent2', onMyEvent); - obj.on('myevent3', onMyEvent); - - obj.emit('myevent1'); - obj.emit('myevent2'); - obj.emit('myevent3'); - - obj.off('myevent2', onMyEvent); - - obj.emit('myevent1'); - obj.emit('myevent2'); - obj.emit('myevent3'); - - expect(called).to.equal(5); - }); - - it('multiple handlers for one event with some removed', function () { - var called = 0; - - var onMyEvent = function () { - called++; - }, - onMyEvent2 = function () { - called++; - }; - - // add 2 handlers and confirm they both get called - obj.on('myevent', onMyEvent); - obj.on('myevent', onMyEvent); - obj.on('myevent', onMyEvent2); - obj.on('myevent', onMyEvent2); - - obj.emit('myevent'); - - expect(called).to.equal(4); - - // remove one of the handlers, emit again, then ensure 1 more call is made - obj.off('myevent', onMyEvent); - - obj.emit('myevent'); - - expect(called).to.equal(6); - }); - - it('calls to off without a handler do nothing', function () { - var called = 0; - - var onMyEvent = function () { - called++; - }; - - obj.on('myevent', onMyEvent); - obj.on('myevent', onMyEvent); - - obj.emit('myevent'); - - expect(called).to.equal(2); - - obj.off('myevent'); - - obj.emit('myevent'); - - expect(called).to.equal(4); - - obj.off('myevent', onMyEvent); - - obj.emit('myevent'); - - expect(called).to.equal(4); - }); - - it('handles multiple instances with the same prototype', function () { - var called = 0; - - function onMyEvent(e) { - called++; - } - - obj.on('myevent1', onMyEvent); - obj.on('myevent2', onMyEvent); - - obj2.istwo = true; - obj2.on('myevent1', onMyEvent); - obj2.on('myevent2', onMyEvent); - - obj.emit('myevent1'); - obj.emit('myevent2'); - obj2.emit('myevent1'); - obj2.emit('myevent2'); - - //we emit 4 times, but since obj2 is a child of obj the event should bubble - //up to obj and show up there as well. So the obj2.emit() calls each increment - //the counter twice. - expect(called).to.equal(6); - }); - - it('is backwards compatible with older .dispatchEvent({})', function () { - var called = 0, - data = { - some: 'thing', - hello: true - }; - - function onMyEvent(event) { - pixi_utils_EventTarget_Event_confirm(event, obj, data); - - called++; - } - - obj.on('myevent1', onMyEvent); - obj.on('myevent2', onMyEvent); - obj.on('myevent3', onMyEvent); - - data.type = 'myevent1'; - obj.emit(data); - - data.type = 'myevent2'; - obj.emit(data); - - data.type = 'myevent3'; - obj.emit(data); - - obj.off('myevent2', onMyEvent); - - data.type = 'myevent1'; - obj.emit(data); - - data.type = 'myevent2'; - obj.emit(data); - - data.type = 'myevent3'; - obj.emit(data); - - expect(called).to.equal(5); - }); - - it('is backwards compatible with older .call(this)', function () { - var Fn = function() { - PIXI.EventTarget.call(this); - }, - o = new Fn(); - - pixi_utils_EventTarget_confirm(o); - }); - - it('is backwards compatible with older .addEventListener("")', function () { - var called = 0, - data = { - some: 'thing', - hello: true - }; - - function onMyEvent(event) { - pixi_utils_EventTarget_Event_confirm(event, obj, data); - - called++; - } - - obj.addEventListener('myevent1', onMyEvent); - obj.addEventListener('myevent2', onMyEvent); - obj.addEventListener('myevent3', onMyEvent); - - data.type = 'myevent1'; - obj.emit(data); - - data.type = 'myevent2'; - obj.emit(data); - - data.type = 'myevent3'; - obj.emit(data); - - obj.off('myevent2', onMyEvent); - - data.type = 'myevent1'; - obj.emit(data); - - data.type = 'myevent2'; - obj.emit(data); - - data.type = 'myevent3'; - obj.emit(data); - - expect(called).to.equal(5); - }); - - it('event remove during emit call properly', function () { - var called = 0; - - function cb1() { - called++; - obj.off('myevent', cb1); - } - function cb2() { - called++; - obj.off('myevent', cb2); - } - function cb3() { - called++; - obj.off('myevent', cb3); - } - - obj.on('myevent', cb1); - obj.on('myevent', cb2); - obj.on('myevent', cb3); - obj.emit('myevent', ''); - - expect(called).to.equal(3); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/utils/Polyk.js b/tutorial-3/pixi.js-master/test/unit/pixi/utils/Polyk.js deleted file mode 100755 index dfc7128..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/utils/Polyk.js +++ /dev/null @@ -1,14 +0,0 @@ -describe('pixi/utils/Polyk', function () { - 'use strict'; - - var expect = chai.expect; - var PolyK = PIXI.PolyK; - - it('Module exists', function () { - expect(PolyK).to.be.an('object'); - }); - - it('Members exist', function () { - expect(PolyK).to.respondTo('Triangulate'); - }); -}); diff --git a/tutorial-3/pixi.js-master/test/unit/pixi/utils/Utils.js b/tutorial-3/pixi.js-master/test/unit/pixi/utils/Utils.js deleted file mode 100755 index c97b3c6..0000000 --- a/tutorial-3/pixi.js-master/test/unit/pixi/utils/Utils.js +++ /dev/null @@ -1,17 +0,0 @@ -describe('Utils', function () { - 'use strict'; - - var expect = chai.expect; - - it('requestAnimationFrame exists', function () { - expect(global).to.respondTo('requestAnimationFrame'); - }); - - it('cancelAnimationFrame exists', function () { - expect(global).to.respondTo('cancelAnimationFrame'); - }); - - it('requestAnimFrame exists', function () { - expect(global).to.respondTo('requestAnimFrame'); - }); -}); diff --git a/tutorial-3/pixi.js-master/trim/SpriteSheet.json b/tutorial-3/pixi.js-master/trim/SpriteSheet.json deleted file mode 100755 index 978c2f2..0000000 --- a/tutorial-3/pixi.js-master/trim/SpriteSheet.json +++ /dev/null @@ -1,228 +0,0 @@ -{"frames": { - -"Explosion_Sequence_A 1.png": -{ - "frame": {"x":244,"y":1454,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 10.png": -{ - "frame": {"x":244,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 11.png": -{ - "frame": {"x":2,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 12.png": -{ - "frame": {"x":728,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 13.png": -{ - "frame": {"x":486,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 14.png": -{ - "frame": {"x":244,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 15.png": -{ - "frame": {"x":2,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 16.png": -{ - "frame": {"x":728,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 17.png": -{ - "frame": {"x":486,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 18.png": -{ - "frame": {"x":244,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 19.png": -{ - "frame": {"x":2,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 2.png": -{ - "frame": {"x":728,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 20.png": -{ - "frame": {"x":728,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 21.png": -{ - "frame": {"x":486,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 22.png": -{ - "frame": {"x":244,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 23.png": -{ - "frame": {"x":2,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 24.png": -{ - "frame": {"x":728,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 25.png": -{ - "frame": {"x":486,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 26.png": -{ - "frame": {"x":244,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 27.png": -{ - "frame": {"x":2,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 3.png": -{ - "frame": {"x":486,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 4.png": -{ - "frame": {"x":244,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 5.png": -{ - "frame": {"x":2,"y":1696,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 6.png": -{ - "frame": {"x":2,"y":1454,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 7.png": -{ - "frame": {"x":2,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 8.png": -{ - "frame": {"x":728,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 9.png": -{ - "frame": {"x":486,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}}, -"meta": { - "app": "http://www.texturepacker.com", - "version": "1.0", - "image": "SpriteSheet.png", - "format": "RGBA8888", - "size": {"w":1024,"h":2048}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:17e4a2d92ff3e27832c3f4938cec7c85$" -} -} diff --git a/tutorial-3/pixi.js-master/trim/SpriteSheet.png b/tutorial-3/pixi.js-master/trim/SpriteSheet.png deleted file mode 100755 index 79e1a69..0000000 Binary files a/tutorial-3/pixi.js-master/trim/SpriteSheet.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/trim/SpriteSheetTrimmed.json b/tutorial-3/pixi.js-master/trim/SpriteSheetTrimmed.json deleted file mode 100755 index 7f9dd6a..0000000 --- a/tutorial-3/pixi.js-master/trim/SpriteSheetTrimmed.json +++ /dev/null @@ -1,228 +0,0 @@ -{"frames": { - -"TExplosion_Sequence_A 1.png": -{ - "frame": {"x":436,"y":1636,"w":204,"h":182}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":32,"y":38,"w":204,"h":182}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 10.png": -{ - "frame": {"x":2,"y":728,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 11.png": -{ - "frame": {"x":226,"y":486,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 12.png": -{ - "frame": {"x":2,"y":2,"w":224,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":16,"y":0,"w":224,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 13.png": -{ - "frame": {"x":2,"y":970,"w":224,"h":234}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":16,"y":0,"w":224,"h":234}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 14.png": -{ - "frame": {"x":2,"y":1206,"w":224,"h":220}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":16,"y":0,"w":224,"h":220}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 15.png": -{ - "frame": {"x":228,"y":1190,"w":216,"h":214}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":216,"h":214}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 16.png": -{ - "frame": {"x":228,"y":970,"w":216,"h":218}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":216,"h":218}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 17.png": -{ - "frame": {"x":2,"y":1428,"w":222,"h":220}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":220}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 18.png": -{ - "frame": {"x":440,"y":1416,"w":210,"h":218}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":210,"h":218}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 19.png": -{ - "frame": {"x":228,"y":1406,"w":210,"h":220}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":19,"y":0,"w":210,"h":220}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 2.png": -{ - "frame": {"x":2,"y":1650,"w":218,"h":198}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":22,"w":218,"h":198}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 20.png": -{ - "frame": {"x":226,"y":1628,"w":208,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":208,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 21.png": -{ - "frame": {"x":446,"y":1214,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 22.png": -{ - "frame": {"x":446,"y":1012,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 23.png": -{ - "frame": {"x":448,"y":810,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 24.png": -{ - "frame": {"x":450,"y":608,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 25.png": -{ - "frame": {"x":450,"y":406,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 26.png": -{ - "frame": {"x":452,"y":204,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 27.png": -{ - "frame": {"x":452,"y":2,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 3.png": -{ - "frame": {"x":442,"y":1820,"w":208,"h":196}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":19,"y":22,"w":208,"h":196}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 4.png": -{ - "frame": {"x":222,"y":1830,"w":218,"h":196}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":22,"w":218,"h":196}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 5.png": -{ - "frame": {"x":226,"y":728,"w":220,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":19,"y":0,"w":220,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 6.png": -{ - "frame": {"x":2,"y":486,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 7.png": -{ - "frame": {"x":226,"y":244,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 8.png": -{ - "frame": {"x":2,"y":244,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 9.png": -{ - "frame": {"x":228,"y":2,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}}, -"meta": { - "app": "http://www.codeandweb.com/texturepacker ", - "version": "1.0", - "image": "SpriteSheetTrimmed.png", - "format": "RGBA8888", - "size": {"w":654,"h":2028}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:6ba345a190bfe2d62301a49ce8112726:aaa6f60c39d4c316b8ed9667f27805ca:b0c0aa18e0b197cfe7bc02a7377aa72f$" -} -} diff --git a/tutorial-3/pixi.js-master/trim/SpriteSheetTrimmed.png b/tutorial-3/pixi.js-master/trim/SpriteSheetTrimmed.png deleted file mode 100755 index 9214f71..0000000 Binary files a/tutorial-3/pixi.js-master/trim/SpriteSheetTrimmed.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/trim/bikkuriman.png b/tutorial-3/pixi.js-master/trim/bikkuriman.png deleted file mode 100755 index 3bc5592..0000000 Binary files a/tutorial-3/pixi.js-master/trim/bikkuriman.png and /dev/null differ diff --git a/tutorial-3/pixi.js-master/trim/index.html b/tutorial-3/pixi.js-master/trim/index.html deleted file mode 100755 index d051dfa..0000000 --- a/tutorial-3/pixi.js-master/trim/index.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - Pixi Trim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Test 1

    -

    Test 2

    -

    Test 3

    - - - diff --git a/tutorial-3/pixi.js-master/trim/index2.html b/tutorial-3/pixi.js-master/trim/index2.html deleted file mode 100755 index 4276c57..0000000 --- a/tutorial-3/pixi.js-master/trim/index2.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - Pixi Trim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Test 1

    -

    Test 2

    -

    Test 3

    - - - diff --git a/tutorial-3/pixi.js-master/trim/index3.html b/tutorial-3/pixi.js-master/trim/index3.html deleted file mode 100755 index 1a506b3..0000000 --- a/tutorial-3/pixi.js-master/trim/index3.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - Pixi Trim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Test 1

    -

    Test 2

    -

    Test 3

    - - - diff --git a/tutorial-4/Far.js b/tutorial-4/Far.js index 6117065..2925273 100755 --- a/tutorial-4/Far.js +++ b/tutorial-4/Far.js @@ -1,6 +1,6 @@ function Far() { var texture = PIXI.Texture.fromImage("resources/bg-far.png"); - PIXI.TilingSprite.call(this, texture, 512, 256); + PIXI.extras.TilingSprite.call(this, texture, 512, 256); this.position.x = 0; this.position.y = 0; @@ -10,8 +10,7 @@ function Far() { this.viewportX = 0; } -Far.constructor = Far; -Far.prototype = Object.create(PIXI.TilingSprite.prototype); +Far.prototype = Object.create(PIXI.extras.TilingSprite.prototype); Far.DELTA_X = 0.064; diff --git a/tutorial-4/Main.js b/tutorial-4/Main.js index a4aa94c..ec78355 100755 --- a/tutorial-4/Main.js +++ b/tutorial-4/Main.js @@ -1,6 +1,6 @@ function Main() { - this.stage = new PIXI.Stage(0x66FF99); - this.renderer = new PIXI.autoDetectRenderer( + this.stage = new PIXI.Container(); + this.renderer = PIXI.autoDetectRenderer( 512, 384, {view:document.getElementById("game-canvas")} @@ -24,17 +24,19 @@ Main.prototype.update = function() { } this.renderer.render(this.stage); - requestAnimFrame(this.update.bind(this)); + requestAnimationFrame(this.update.bind(this)); }; Main.prototype.loadSpriteSheet = function() { - var assetsToLoad = ["resources/wall.json", "resources/bg-mid.png", "resources/bg-far.png"]; - loader = new PIXI.AssetLoader(assetsToLoad); - loader.onComplete = this.spriteSheetLoaded.bind(this); + var loader = PIXI.loader; + loader.add("wall", "resources/wall.json"); + loader.add("bg-mid", "resources/bg-mid.png"); + loader.add("bg-far", "resources/bg-far.png"); + loader.once("complete", this.spriteSheetLoaded.bind(this)); loader.load(); }; Main.prototype.spriteSheetLoaded = function() { this.scroller = new Scroller(this.stage); - requestAnimFrame(this.update.bind(this)); + requestAnimationFrame(this.update.bind(this)); }; diff --git a/tutorial-4/Mid.js b/tutorial-4/Mid.js index f86f802..3bb2618 100755 --- a/tutorial-4/Mid.js +++ b/tutorial-4/Mid.js @@ -1,6 +1,6 @@ function Mid() { var texture = PIXI.Texture.fromImage("resources/bg-mid.png"); - PIXI.TilingSprite.call(this, texture, 512, 256); + PIXI.extras.TilingSprite.call(this, texture, 512, 256); this.position.x = 0; this.position.y = 128; @@ -10,8 +10,7 @@ function Mid() { this.viewportX = 0; } -Mid.constructor = Mid; -Mid.prototype = Object.create(PIXI.TilingSprite.prototype); +Mid.prototype = Object.create(PIXI.extras.TilingSprite.prototype); Mid.DELTA_X = 0.32; diff --git a/tutorial-4/Walls.js b/tutorial-4/Walls.js index 3d77527..dc9e4a5 100644 --- a/tutorial-4/Walls.js +++ b/tutorial-4/Walls.js @@ -1,5 +1,5 @@ function Walls() { - PIXI.DisplayObjectContainer.call(this); + PIXI.Container.call(this); this.pool = new WallSpritesPool(); this.createLookupTables(); @@ -10,8 +10,7 @@ function Walls() { this.viewportSliceX = 0; } -Walls.constructor = Walls; -Walls.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); +Walls.prototype = Object.create(PIXI.Container.prototype); Walls.VIEWPORT_WIDTH = 512; Walls.VIEWPORT_NUM_SLICES = Math.ceil(Walls.VIEWPORT_WIDTH/WallSlice.WIDTH) + 1; diff --git a/tutorial-4/index.html b/tutorial-4/index.html index 18223db..49906b7 100755 --- a/tutorial-4/index.html +++ b/tutorial-4/index.html @@ -11,7 +11,7 @@
    - + diff --git a/tutorial-4/pixi.js-master/.editorconfig b/tutorial-4/pixi.js-master/.editorconfig deleted file mode 100755 index 347b5a2..0000000 --- a/tutorial-4/pixi.js-master/.editorconfig +++ /dev/null @@ -1,11 +0,0 @@ -; This file is for unifying the coding style for different editors and IDEs. -; More information at http://EditorConfig.org -root = true - -[**.js] -indent_style = space -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true diff --git a/tutorial-4/pixi.js-master/.gitignore b/tutorial-4/pixi.js-master/.gitignore deleted file mode 100755 index 52d83ed..0000000 --- a/tutorial-4/pixi.js-master/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -node_modules -.DS_Store -.project -*.sublime-* -*.log - -bin/pixi.dev.js.map diff --git a/tutorial-4/pixi.js-master/.jshintrc b/tutorial-4/pixi.js-master/.jshintrc deleted file mode 100755 index 08babe8..0000000 --- a/tutorial-4/pixi.js-master/.jshintrc +++ /dev/null @@ -1,127 +0,0 @@ -{ - // -------------------------------------------------------------------- - // JSHint Configuration - // -------------------------------------------------------------------- - // - // @author Chad Engler - - // == Enforcing Options =============================================== - // - // These options tell JSHint to be more strict towards your code. Use - // them if you want to allow only a safe subset of JavaScript, very - // useful when your codebase is shared with a big number of developers - // with different skill levels. - - "bitwise" : false, // Disallow bitwise operators (&, |, ^, etc.). - "camelcase" : true, // Force all variable names to use either camelCase or UPPER_CASE. - "curly" : false, // Require {} for every new block or scope. - "eqeqeq" : true, // Require triple equals i.e. `===`. - "es3" : false, // Enforce conforming to ECMAScript 3. - "forin" : false, // Disallow `for in` loops without `hasOwnPrototype`. - "immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );` - "indent" : 4, // Require that 4 spaces are used for indentation. - "latedef" : true, // Prohibit variable use before definition. - "newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`. - "noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`. - "noempty" : true, // Prohibit use of empty blocks. - "nonew" : true, // Prohibit use of constructors for side-effects. - "plusplus" : false, // Disallow use of `++` & `--`. - "quotmark" : true, // Force consistency when using quote marks. - "undef" : true, // Require all non-global variables be declared before they are used. - "unused" : true, // Warn when varaibles are created by not used. - "strict" : false, // Require `use strict` pragma in every file. - "trailing" : true, // Prohibit trailing whitespaces. - "maxparams" : 8, // Prohibit having more than X number of params in a function. - "maxdepth" : 8, // Prohibit nested blocks from going more than X levels deep. - "maxstatements" : false, // Restrict the number of statements in a function. - "maxcomplexity" : false, // Restrict the cyclomatic complexity of the code. - "maxlen" : 220, // Require that all lines are 100 characters or less. - "globals" : { // Register globals that are used in the code. - //commonjs globals - "module": false, - "require": false, - - // PIXI globals - "PIXI": false, - "spine": false, - - //chai globals - "chai": false, - - //mocha globals - "describe": false, - "it": false, - - //resemble globals - "resemble": false - }, - - // == Relaxing Options ================================================ - // - // These options allow you to suppress certain types of warnings. Use - // them only if you are absolutely positive that you know what you are - // doing. - - "asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons). - "boss" : true, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments. - "debug" : false, // Allow debugger statements e.g. browser breakpoints. - "eqnull" : false, // Tolerate use of `== null`. - "esnext" : false, // Allow ES.next specific features such as `const` and `let`. - "evil" : false, // Tolerate use of `eval`. - "expr" : false, // Tolerate `ExpressionStatement` as Programs. - "funcscope" : false, // Tolerate declarations of variables inside of control structures while accessing them later from the outside. - "globalstrict" : false, // Allow global "use strict" (also enables 'strict'). - "iterator" : false, // Allow usage of __iterator__ property. - "lastsemic" : false, // Tolerate missing semicolons when the it is omitted for the last statement in a one-line block. - "laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons. - "laxcomma" : false, // Suppress warnings about comma-first coding style. - "loopfunc" : false, // Allow functions to be defined within loops. - "moz" : false, // Code that uses Mozilla JS extensions will set this to true - "multistr" : false, // Tolerate multi-line strings. - "proto" : false, // Tolerate __proto__ property. This property is deprecated. - "scripturl" : false, // Tolerate script-targeted URLs. - "smarttabs" : false, // Tolerate mixed tabs and spaces when the latter are used for alignmnent only. - "shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`. - "sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`. - "supernew" : false, // Tolerate `new function () { ... };` and `new Object;`. - "validthis" : false, // Tolerate strict violations when the code is running in strict mode and you use this in a non-constructor function. - - // == Environments ==================================================== - // - // These options pre-define global variables that are exposed by - // popular JavaScript libraries and runtime environments—such as - // browser or node.js. - - "browser" : true, // Standard browser globals e.g. `window`, `document`. - "couch" : false, // Enable globals exposed by CouchDB. - "devel" : false, // Allow development statements e.g. `console.log();`. - "dojo" : false, // Enable globals exposed by Dojo Toolkit. - "jquery" : false, // Enable globals exposed by jQuery JavaScript library. - "mootools" : false, // Enable globals exposed by MooTools JavaScript framework. - "node" : false, // Enable globals available when code is running inside of the NodeJS runtime environment. (for Gruntfile) - "nonstandard" : false, // Define non-standard but widely adopted globals such as escape and unescape. - "prototypejs" : false, // Enable globals exposed by Prototype JavaScript framework. - "rhino" : false, // Enable globals available when your code is running inside of the Rhino runtime environment. - "worker" : false, // Enable globals available when your code is running as a WebWorker. - "wsh" : false, // Enable globals available when your code is running as a script for the Windows Script Host. - "yui" : false, // Enable globals exposed by YUI library. - - // == JSLint Legacy =================================================== - // - // These options are legacy from JSLint. Aside from bug fixes they will - // not be improved in any way and might be removed at any point. - - "nomen" : false, // Prohibit use of initial or trailing underbars in names. - "onevar" : false, // Allow only one `var` statement per function. - "passfail" : false, // Stop on first error. - "white" : false, // Check against strict whitespace and indentation rules. - - // == Undocumented Options ============================================ - // - // While I've found these options in some projects, they are not - // described in the [JSHint Options documentation][4]. - // - // [4]: http://www.jshint.com/options/ - - "maxerr" : 100 // Maximum errors before stopping. -} diff --git a/tutorial-4/pixi.js-master/.travis.yml b/tutorial-4/pixi.js-master/.travis.yml deleted file mode 100755 index 1c60690..0000000 --- a/tutorial-4/pixi.js-master/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: node_js -node_js: - - "0.10" - -branches: - only: - - master - - dev - -install: - - npm install grunt-cli - - npm install - -cache: - directories: - - node_modules - -before_script: - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start - -script: - - ./node_modules/.bin/grunt travis \ No newline at end of file diff --git a/tutorial-4/pixi.js-master/CONTRIBUTING.md b/tutorial-4/pixi.js-master/CONTRIBUTING.md deleted file mode 100755 index ddf5029..0000000 --- a/tutorial-4/pixi.js-master/CONTRIBUTING.md +++ /dev/null @@ -1,62 +0,0 @@ -# How to contribute - -It is essential to the development of pixi.js that the community is empowered -to make changes and get them into the library. Here are some guidlines to make -that process silky smooth for all involved. - -## Reporting issues - -To report a bug, request a feature, or even ask a question, make use of the GitHub Issues -section for [pixi.js][0]. When submitting an issue please take the following steps: - -1. **Seach for existing issues.** Your question or bug may have already been answered or fixed, -be sure to search the issues first before putting in a duplicate issue. - -2. **Create an isolated and reproducible test case.** If you are reporting a bug, make sure you -also have a minimal, runnable, code example that reproduces the problem you have. - -3. **Include a live example.** After narrowing your code down to only the problem areas, make use -of [jsFiddle][1], [jsBin][2], or a link to your live site so that we can view a live example of the problem. - -4. **Share as much information as possible.** Include browser version affected, your OS, version of -the library, steps to reproduce, etc. "X isn't working!!!1!" will probably just be closed. - - -## Making Changes - -To setup for making changes you will need node.js, and grunt installed. You can download node.js -from [nodejs.org][3]. After it has been installed open a console and run `npm i -g grunt-cli` to -install the global `grunt` executable. - -After that you can clone the pixi.js repository, and run `npm i` inside the cloned folder. -This will install dependencies necessary for building the project. Once that is ready, make your -changes and submit a Pull Request. When submitting a PR follow these guidlines: - -- **Send Pull Requests to the `dev` branch.** All Pull Requests must be sent to the `dev` branch, -`master` is the latest release and PRs to that branch will be closed. - -- **Ensure changes are jshint validated.** After making a change be sure to run the build process -to ensure that you didn't break anything. You can do this with `grunt && grunt test` which will run -jshint, rebuild, then run the test suite. - -- **Never commit new builds.** When making a code change, you should always run `grunt` which will -rebuild the project, *however* please do not commit these new builds or your PR will be closed. - -- **Only commit relevant changes.** Don't include changes that are not directly relevant to the fix -you are making. The more focused a PR is, the faster it will get attention and be merged. Extra files -changing only whitespace or trash files will likely get your PR closed. - -## Quickie Code Style Guide - -- Use 4 spaces for tabs, never tab characters. - -- No trailing whitespace, blank lines should have no whitespace. - -- Always favor strict equals `===` unless you *need* to use type coercion. - -- Follow conventions already in the code, and listen to jshint. - -[0]: https://github.com/GoodBoyDigital/pixi.js/issues -[1]: http://jsfiddle.net -[2]: http://jsbin.com/ -[3]: http://nodejs.org \ No newline at end of file diff --git a/tutorial-4/pixi.js-master/Gruntfile.js b/tutorial-4/pixi.js-master/Gruntfile.js deleted file mode 100755 index dda4a9e..0000000 --- a/tutorial-4/pixi.js-master/Gruntfile.js +++ /dev/null @@ -1,227 +0,0 @@ -module.exports = function(grunt) { - grunt.loadNpmTasks('grunt-concat-sourcemap'); - grunt.loadNpmTasks('grunt-contrib-concat'); - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-contrib-connect'); - grunt.loadNpmTasks('grunt-contrib-yuidoc'); - grunt.loadNpmTasks('grunt-contrib-watch'); - - grunt.loadTasks('tasks'); - - var srcFiles = [ - '<%= dirs.src %>/Intro.js', - '<%= dirs.src %>/Pixi.js', - '<%= dirs.src %>/geom/Point.js', - '<%= dirs.src %>/geom/Rectangle.js', - '<%= dirs.src %>/geom/Polygon.js', - '<%= dirs.src %>/geom/Circle.js', - '<%= dirs.src %>/geom/Ellipse.js', - '<%= dirs.src %>/geom/RoundedRectangle.js', - '<%= dirs.src %>/geom/Matrix.js', - '<%= dirs.src %>/display/DisplayObject.js', - '<%= dirs.src %>/display/DisplayObjectContainer.js', - '<%= dirs.src %>/display/Sprite.js', - '<%= dirs.src %>/display/SpriteBatch.js', - '<%= dirs.src %>/display/MovieClip.js', - '<%= dirs.src %>/filters/FilterBlock.js', - '<%= dirs.src %>/text/Text.js', - '<%= dirs.src %>/text/BitmapText.js', - '<%= dirs.src %>/InteractionData.js', - '<%= dirs.src %>/InteractionManager.js', - '<%= dirs.src %>/display/Stage.js', - '<%= dirs.src %>/utils/Utils.js', - '<%= dirs.src %>/utils/EventTarget.js', - '<%= dirs.src %>/utils/Detector.js', - '<%= dirs.src %>/utils/Polyk.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLShaderUtils.js', - '<%= dirs.src %>/renderers/webgl/shaders/PixiShader.js', - '<%= dirs.src %>/renderers/webgl/shaders/PixiFastShader.js', - '<%= dirs.src %>/renderers/webgl/shaders/StripShader.js', - '<%= dirs.src %>/renderers/webgl/shaders/PrimitiveShader.js', - '<%= dirs.src %>/renderers/webgl/shaders/ComplexPrimitiveShader.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLGraphics.js', - '<%= dirs.src %>/renderers/webgl/WebGLRenderer.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLBlendModeManager.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLMaskManager.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLStencilManager.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLShaderManager.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLSpriteBatch.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLFastSpriteBatch.js', - '<%= dirs.src %>/renderers/webgl/utils/WebGLFilterManager.js', - '<%= dirs.src %>/renderers/webgl/utils/FilterTexture.js', - '<%= dirs.src %>/renderers/canvas/utils/CanvasBuffer.js', - '<%= dirs.src %>/renderers/canvas/utils/CanvasMaskManager.js', - '<%= dirs.src %>/renderers/canvas/utils/CanvasTinter.js', - '<%= dirs.src %>/renderers/canvas/CanvasRenderer.js', - '<%= dirs.src %>/renderers/canvas/CanvasGraphics.js', - '<%= dirs.src %>/primitives/Graphics.js', - '<%= dirs.src %>/extras/Strip.js', - '<%= dirs.src %>/extras/Rope.js', - '<%= dirs.src %>/extras/TilingSprite.js', - '<%= dirs.src %>/extras/Spine.js', - '<%= dirs.src %>/extras/PIXISpine.js', - '<%= dirs.src %>/textures/BaseTexture.js', - '<%= dirs.src %>/textures/Texture.js', - '<%= dirs.src %>/textures/RenderTexture.js', - '<%= dirs.src %>/textures/VideoTexture.js', - '<%= dirs.src %>/loaders/AssetLoader.js', - '<%= dirs.src %>/loaders/JsonLoader.js', - '<%= dirs.src %>/loaders/AtlasLoader.js', - '<%= dirs.src %>/loaders/SpriteSheetLoader.js', - '<%= dirs.src %>/loaders/ImageLoader.js', - '<%= dirs.src %>/loaders/BitmapFontLoader.js', - '<%= dirs.src %>/loaders/SpineLoader.js', - '<%= dirs.src %>/filters/AbstractFilter.js', - '<%= dirs.src %>/filters/AlphaMaskFilter.js', - '<%= dirs.src %>/filters/ColorMatrixFilter.js', - '<%= dirs.src %>/filters/GrayFilter.js', - '<%= dirs.src %>/filters/DisplacementFilter.js', - '<%= dirs.src %>/filters/PixelateFilter.js', - '<%= dirs.src %>/filters/BlurXFilter.js', - '<%= dirs.src %>/filters/BlurYFilter.js', - '<%= dirs.src %>/filters/BlurFilter.js', - '<%= dirs.src %>/filters/InvertFilter.js', - '<%= dirs.src %>/filters/SepiaFilter.js', - '<%= dirs.src %>/filters/TwistFilter.js', - '<%= dirs.src %>/filters/ColorStepFilter.js', - '<%= dirs.src %>/filters/DotScreenFilter.js', - '<%= dirs.src %>/filters/CrossHatchFilter.js', - '<%= dirs.src %>/filters/RGBSplitFilter.js', - '<%= dirs.src %>/Outro.js' - ], - banner = [ - '/**', - ' * @license', - ' * <%= pkg.name %> - v<%= pkg.version %>', - ' * Copyright (c) 2012-2014, Mat Groves', - ' * <%= pkg.homepage %>', - ' *', - ' * Compiled: <%= grunt.template.today("yyyy-mm-dd") %>', - ' *', - ' * <%= pkg.name %> is licensed under the <%= pkg.license %> License.', - ' * <%= pkg.licenseUrl %>', - ' */', - '' - ].join('\n'); - - grunt.initConfig({ - pkg : grunt.file.readJSON('package.json'), - dirs: { - build: 'bin', - docs: 'docs', - src: 'src/pixi', - test: 'test' - }, - files: { - srcBlob: '<%= dirs.src %>/**/*.js', - testBlob: '<%= dirs.test %>/**/*.js', - testConf: '<%= dirs.test %>/karma.conf.js', - build: '<%= dirs.build %>/pixi.dev.js', - buildMin: '<%= dirs.build %>/pixi.js' - }, - concat: { - options: { - banner: banner - }, - dist: { - src: srcFiles, - dest: '<%= files.build %>' - } - }, - /* jshint -W106 */ - concat_sourcemap: { - dev: { - files: { - '<%= files.build %>': srcFiles - }, - options: { - sourceRoot: '../' - } - } - }, - jshint: { - options: { - jshintrc: './.jshintrc' - }, - source: { - src: srcFiles.concat('Gruntfile.js'), - options: { - ignores: '<%= dirs.src %>/**/{Intro,Outro,Spine,Pixi}.js' - } - }, - test: { - src: ['<%= files.testBlob %>'], - options: { - ignores: '<%= dirs.test %>/lib/resemble.js', - jshintrc: undefined, //don't use jshintrc for tests - expr: true, - undef: false, - camelcase: false - } - } - }, - uglify: { - options: { - banner: banner - }, - dist: { - src: '<%= files.build %>', - dest: '<%= files.buildMin %>' - } - }, - connect: { - test: { - options: { - port: grunt.option('port-test') || 9002, - base: './', - keepalive: true - } - } - }, - yuidoc: { - compile: { - name: '<%= pkg.name %>', - description: '<%= pkg.description %>', - version: '<%= pkg.version %>', - url: '<%= pkg.homepage %>', - logo: '<%= pkg.logo %>', - options: { - paths: '<%= dirs.src %>', - outdir: '<%= dirs.docs %>' - } - } - }, - //Watches and builds for _development_ (source maps) - watch: { - scripts: { - files: ['<%= dirs.src %>/**/*.js'], - tasks: ['concat_sourcemap'], - options: { - spawn: false, - } - } - }, - karma: { - unit: { - configFile: '<%= files.testConf %>', - // browsers: ['Chrome'], - singleRun: true - } - } - }); - - grunt.registerTask('default', ['build', 'test']); - - grunt.registerTask('build', ['jshint:source', 'concat', 'uglify']); - grunt.registerTask('build-debug', ['concat_sourcemap', 'uglify']); - - grunt.registerTask('test', ['concat', 'jshint:test', 'karma']); - - grunt.registerTask('docs', ['yuidoc']); - grunt.registerTask('travis', ['build', 'test']); - - grunt.registerTask('default', ['build', 'test']); - - grunt.registerTask('debug-watch', ['concat_sourcemap', 'watch:debug']); -}; diff --git a/tutorial-4/pixi.js-master/LICENSE b/tutorial-4/pixi.js-master/LICENSE deleted file mode 100755 index 39cbfb0..0000000 --- a/tutorial-4/pixi.js-master/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2013-2015 Mathew Groves - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tutorial-4/pixi.js-master/README.md b/tutorial-4/pixi.js-master/README.md deleted file mode 100755 index 1d3b3d4..0000000 --- a/tutorial-4/pixi.js-master/README.md +++ /dev/null @@ -1,181 +0,0 @@ -Pixi Renderer -============= - -#### *** IMPORTANT - V2 API CHANGES *** #### - -A heads up for anyone updating their version of pixi.js to version 2, as we have changed a couple of bits that you need to be aware of. Fortunately, there are only two changes, and both are small. - -1: Creating a renderer now accepts an options parameter that you can add specific settings to: -``` -// an optional object that contains the settings for the renderer -var options = { - view:myCanvas, - resolution:1 -}; - -var renderer = new PIXI.WebGLRenderer(800, 600, options) -``` - -2: A ```PIXI.RenderTexture``` now accepts a ```PIXI.Matrix``` as its second parameter instead of a point. This gives you much more flexibility: - -``` myRenderTexture.render(myDisplayObject, myMatrix) ``` - -Check out the docs for more info! - - -![pixi.js logo](http://www.goodboydigital.com/pixijs/logo_small.png) - -[](http://www.pixijs.com/projects) -#### JavaScript 2D Renderer #### - -The aim of this project is to provide a fast lightweight 2D library that works -across all devices. The Pixi renderer allows everyone to enjoy the power of -hardware acceleration without prior knowledge of webGL. Also, it's fast. - -If you’re interested in pixi.js then feel free to follow me on twitter -([@doormat23](https://twitter.com/doormat23)) and I will keep you posted! And -of course check back on [our site]() as -any breakthroughs will be posted up there too! - -[![Inline docs](http://inch-ci.org/github/GoodBoyDigital/pixi.js.svg?branch=master)](http://inch-ci.org/github/GoodBoyDigital/pixi.js) -[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/GoodBoyDigital/pixi.js/trend.png)](https://bitdeli.com/free "Bitdeli Badge") - -### Demos ### - -- [WebGL Filters!]() - -- [Run pixie run]() - -- [Fight for Everyone]() - -- [Flash vs HTML]() - -- [Bunny Demo]() - -- [Storm Brewing]() - -- [Filters Demo]() - -- [Render Texture Demo]() - -- [Primitives Demo]() - -- [Masking Demo]() - -- [Interaction Demo]() - -- [photonstorm Balls Demo]() - -- [photonstorm Morph Demo]() - -Thanks to [@photonstorm](https://twitter.com/photonstorm) for providing those -last 2 examples and allowing us to share the source code :) - -### Docs ### - -[Documentation can be found here]() - -### Resources ### - -[Tutorials and other helpful bits]() - -[Pixi.js forum]() - - -### Road Map ### - -* Create a Typescript definition file for Pixi.js -* Implement Flash animation to pixi -* Update Loader so that it support XHR2 if it is available -* Improve the Documentation of the Project -* Create an Asset Loader Tutorial -* Create a MovieClip Tutorial -* Create a small game Tutorial - -### Contribute ### - -Want to be part of the pixi.js project? Great! All are welcome! We will get there quicker together :) -Whether you find a bug, have a great feature request or you fancy owning a task from the road map above feel free to get in touch. - -Make sure to read the [Contributing Guide](https://github.com/GoodBoyDigital/pixi.js/blob/master/CONTRIBUTING.md) -before submitting changes. - -### How to build ### - -PixiJS is built with Grunt. If you don't already have this, go install Node and NPM then install the Grunt Command Line. - -``` -$> npm install -g grunt-cli -``` - -Then, in the folder where you have downloaded the source, install the build dependencies using npm: - -``` -$> npm install -``` - -Then build: - -``` -$> grunt -``` - -This will create a minified version at bin/pixi.js and a non-minified version at bin/pixi.dev.js. - -It also copies the non-minified version to the examples. - -### Current features ### - -- WebGL renderer (with automatic smart batching allowing for REALLY fast performance) -- Canvas renderer (Fastest in town!) -- Full scene graph -- Super easy to use API (similar to the flash display list API) -- Support for texture atlases -- Asset loader / sprite sheet loader -- Auto-detect which renderer should be used -- Full Mouse and Multi-touch Interaction -- Text -- BitmapFont text -- Multiline Text -- Render Texture -- Spine support -- Primitive Drawing -- Masking -- Filters - -### Usage ### - -```javascript - - // You can use either PIXI.WebGLRenderer or PIXI.CanvasRenderer - var renderer = new PIXI.WebGLRenderer(800, 600); - - document.body.appendChild(renderer.view); - - var stage = new PIXI.Stage; - - var bunnyTexture = PIXI.Texture.fromImage("bunny.png"); - var bunny = new PIXI.Sprite(bunnyTexture); - - bunny.position.x = 400; - bunny.position.y = 300; - - bunny.scale.x = 2; - bunny.scale.y = 2; - - stage.addChild(bunny); - - requestAnimationFrame(animate); - - function animate() { - bunny.rotation += 0.01; - - renderer.render(stage); - - requestAnimationFrame(animate); - } -``` - -This content is released under the (http://opensource.org/licenses/MIT) MIT License. - -[![Analytics](https://ga-beacon.appspot.com/UA-39213431-2/pixi.js/index)](https://github.com/igrigorik/ga-beacon) diff --git a/tutorial-4/pixi.js-master/bin/pixi.dev.js b/tutorial-4/pixi.js-master/bin/pixi.dev.js deleted file mode 100755 index c1cf45b..0000000 --- a/tutorial-4/pixi.js-master/bin/pixi.dev.js +++ /dev/null @@ -1,20265 +0,0 @@ -/** - * @license - * pixi.js - v2.2.7 - * Copyright (c) 2012-2014, Mat Groves - * http://goodboydigital.com/ - * - * Compiled: 2015-02-25 - * - * pixi.js is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license.php - */ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -(function(){ - - var root = this; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The [pixi.js](http://www.pixijs.com/) module/namespace. - * - * @module PIXI - */ - -/** - * Namespace-class for [pixi.js](http://www.pixijs.com/). - * - * Contains assorted static properties and enumerations. - * - * @class PIXI - * @static - */ -var PIXI = PIXI || {}; - -/** - * @property {Number} WEBGL_RENDERER - * @protected - * @static - */ -PIXI.WEBGL_RENDERER = 0; -/** - * @property {Number} CANVAS_RENDERER - * @protected - * @static - */ -PIXI.CANVAS_RENDERER = 1; - -/** - * Version of pixi that is loaded. - * @property {String} VERSION - * @static - */ -PIXI.VERSION = "v2.2.7"; - -/** - * Various blend modes supported by pixi. IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes. - * @property {Object} blendModes - * @property {Number} blendModes.NORMAL - * @property {Number} blendModes.ADD - * @property {Number} blendModes.MULTIPLY - * @property {Number} blendModes.SCREEN - * @property {Number} blendModes.OVERLAY - * @property {Number} blendModes.DARKEN - * @property {Number} blendModes.LIGHTEN - * @property {Number} blendModes.COLOR_DODGE - * @property {Number} blendModes.COLOR_BURN - * @property {Number} blendModes.HARD_LIGHT - * @property {Number} blendModes.SOFT_LIGHT - * @property {Number} blendModes.DIFFERENCE - * @property {Number} blendModes.EXCLUSION - * @property {Number} blendModes.HUE - * @property {Number} blendModes.SATURATION - * @property {Number} blendModes.COLOR - * @property {Number} blendModes.LUMINOSITY - * @static - */ -PIXI.blendModes = { - NORMAL:0, - ADD:1, - MULTIPLY:2, - SCREEN:3, - OVERLAY:4, - DARKEN:5, - LIGHTEN:6, - COLOR_DODGE:7, - COLOR_BURN:8, - HARD_LIGHT:9, - SOFT_LIGHT:10, - DIFFERENCE:11, - EXCLUSION:12, - HUE:13, - SATURATION:14, - COLOR:15, - LUMINOSITY:16 -}; - -/** - * The scale modes that are supported by pixi. - * - * The DEFAULT scale mode affects the default scaling mode of future operations. - * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. - * - * @property {Object} scaleModes - * @property {Number} scaleModes.DEFAULT=LINEAR - * @property {Number} scaleModes.LINEAR Smooth scaling - * @property {Number} scaleModes.NEAREST Pixelating scaling - * @static - */ -PIXI.scaleModes = { - DEFAULT:0, - LINEAR:0, - NEAREST:1 -}; - -// used to create uids for various pixi objects.. -PIXI._UID = 0; - -if(typeof(Float32Array) != 'undefined') -{ - PIXI.Float32Array = Float32Array; - PIXI.Uint16Array = Uint16Array; - - // Uint32Array and ArrayBuffer only used by WebGL renderer - // We can suppose that if WebGL is supported then typed arrays are supported too - // as they predate WebGL support for all browsers: - // see typed arrays support: http://caniuse.com/#search=TypedArrays - // see WebGL support: http://caniuse.com/#search=WebGL - PIXI.Uint32Array = Uint32Array; - PIXI.ArrayBuffer = ArrayBuffer; -} -else -{ - PIXI.Float32Array = Array; - PIXI.Uint16Array = Array; -} - -// interaction frequency -PIXI.INTERACTION_FREQUENCY = 30; -PIXI.AUTO_PREVENT_DEFAULT = true; - -/** - * @property {Number} PI_2 - * @static - */ -PIXI.PI_2 = Math.PI * 2; - -/** - * @property {Number} RAD_TO_DEG - * @static - */ -PIXI.RAD_TO_DEG = 180 / Math.PI; - -/** - * @property {Number} DEG_TO_RAD - * @static - */ -PIXI.DEG_TO_RAD = Math.PI / 180; - -/** - * @property {String} RETINA_PREFIX - * @protected - * @static - */ -PIXI.RETINA_PREFIX = "@2x"; -//PIXI.SCALE_PREFIX "@x%%"; - -/** - * If true the default pixi startup (console) banner message will be suppressed. - * - * @property {Boolean} dontSayHello - * @default false - * @static - */ -PIXI.dontSayHello = false; - -/** - * The default render options if none are supplied to - * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. - * - * @property {Object} defaultRenderOptions - * @property {Object} defaultRenderOptions.view=null - * @property {Boolean} defaultRenderOptions.transparent=false - * @property {Boolean} defaultRenderOptions.antialias=false - * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false - * @property {Number} defaultRenderOptions.resolution=1 - * @property {Boolean} defaultRenderOptions.clearBeforeRender=true - * @property {Boolean} defaultRenderOptions.autoResize=false - * @static - */ -PIXI.defaultRenderOptions = { - view:null, - transparent:false, - antialias:false, - preserveDrawingBuffer:false, - resolution:1, - clearBeforeRender:true, - autoResize:false -} - -PIXI.sayHello = function (type) -{ - if(PIXI.dontSayHello)return; - - if ( navigator.userAgent.toLowerCase().indexOf('chrome') > -1 ) - { - var args = [ - '%c %c %c Pixi.js ' + PIXI.VERSION + ' - ' + type + ' %c ' + ' %c ' + ' http://www.pixijs.com/ %c %c ♥%c♥%c♥ ', - 'background: #ff66a5', - 'background: #ff66a5', - 'color: #ff66a5; background: #030307;', - 'background: #ff66a5', - 'background: #ffc3dc', - 'background: #ff66a5', - 'color: #ff2424; background: #fff', - 'color: #ff2424; background: #fff', - 'color: #ff2424; background: #fff' - ]; - - console.log.apply(console, args); - } - else if (window['console']) - { - console.log('Pixi.js ' + PIXI.VERSION + ' - http://www.pixijs.com/'); - } - - PIXI.dontSayHello = true; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis. - * - * @class Point - * @constructor - * @param x {Number} position of the point on the x axis - * @param y {Number} position of the point on the y axis - */ -PIXI.Point = function(x, y) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; -}; - -/** - * Creates a clone of this point - * - * @method clone - * @return {Point} a copy of the point - */ -PIXI.Point.prototype.clone = function() -{ - return new PIXI.Point(this.x, this.y); -}; - -/** - * Sets the point to a new x and y position. - * If y is omitted, both x and y will be set to x. - * - * @method set - * @param [x=0] {Number} position of the point on the x axis - * @param [y=0] {Number} position of the point on the y axis - */ -PIXI.Point.prototype.set = function(x, y) -{ - this.x = x || 0; - this.y = y || ( (y !== 0) ? this.x : 0 ) ; -}; - -// constructor -PIXI.Point.prototype.constructor = PIXI.Point; -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height. - * - * @class Rectangle - * @constructor - * @param x {Number} The X coordinate of the upper-left corner of the rectangle - * @param y {Number} The Y coordinate of the upper-left corner of the rectangle - * @param width {Number} The overall width of this rectangle - * @param height {Number} The overall height of this rectangle - */ -PIXI.Rectangle = function(x, y, width, height) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RECT in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Rectangle - * - * @method clone - * @return {Rectangle} a copy of the rectangle - */ -PIXI.Rectangle.prototype.clone = function() -{ - return new PIXI.Rectangle(this.x, this.y, this.width, this.height); -}; - -/** - * Checks whether the x and y coordinates given are contained within this Rectangle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Rectangle - */ -PIXI.Rectangle.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - var x1 = this.x; - if(x >= x1 && x <= x1 + this.width) - { - var y1 = this.y; - - if(y >= y1 && y <= y1 + this.height) - { - return true; - } - } - - return false; -}; - -// constructor -PIXI.Rectangle.prototype.constructor = PIXI.Rectangle; - -PIXI.EmptyRectangle = new PIXI.Rectangle(0,0,0,0); -/** - * @author Adrien Brault - */ - -/** - * @class Polygon - * @constructor - * @param points* {Array(Point)|Array(Number)|Point...|Number...} This can be an array of Points that form the polygon, - * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be - * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the - * arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are - * Numbers. - */ -PIXI.Polygon = function(points) -{ - //if points isn't an array, use arguments as the array - if(!(points instanceof Array))points = Array.prototype.slice.call(arguments); - - //if this is a flat array of numbers, convert it to points - if(points[0] instanceof PIXI.Point) - { - var p = []; - for(var i = 0, il = points.length; i < il; i++) - { - p.push(points[i].x, points[i].y); - } - - points = p; - } - - this.closed = true; - - /** - * An array of the points of this polygon - * @property points - * @type Array(Point)|Array(Number) - * - */ - this.points = points; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.POLY in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this polygon - * - * @method clone - * @return {Polygon} a copy of the polygon - */ -PIXI.Polygon.prototype.clone = function() -{ - var points = this.points.slice(); - return new PIXI.Polygon(points); -}; - -/** - * Checks whether the x and y coordinates passed to this function are contained within this polygon - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this polygon - */ -PIXI.Polygon.prototype.contains = function(x, y) -{ - var inside = false; - - // use some raycasting to test hits - // https://github.com/substack/point-in-polygon/blob/master/index.js - var length = this.points.length / 2; - - for(var i = 0, j = length - 1; i < length; j = i++) - { - var xi = this.points[i * 2], yi = this.points[i * 2 + 1], - xj = this.points[j * 2], yj = this.points[j * 2 + 1], - intersect = ((yi > y) !== (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi); - - if(intersect) inside = !inside; - } - - return inside; -}; - -// constructor -PIXI.Polygon.prototype.constructor = PIXI.Polygon; - -/** - * @author Chad Engler - */ - -/** - * The Circle object can be used to specify a hit area for displayObjects - * - * @class Circle - * @constructor - * @param x {Number} The X coordinate of the center of this circle - * @param y {Number} The Y coordinate of the center of this circle - * @param radius {Number} The radius of the circle - */ -PIXI.Circle = function(x, y, radius) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property radius - * @type Number - * @default 0 - */ - this.radius = radius || 0; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.CIRC in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Circle instance - * - * @method clone - * @return {Circle} a copy of the Circle - */ -PIXI.Circle.prototype.clone = function() -{ - return new PIXI.Circle(this.x, this.y, this.radius); -}; - -/** - * Checks whether the x and y coordinates given are contained within this circle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Circle - */ -PIXI.Circle.prototype.contains = function(x, y) -{ - if(this.radius <= 0) - return false; - - var dx = (this.x - x), - dy = (this.y - y), - r2 = this.radius * this.radius; - - dx *= dx; - dy *= dy; - - return (dx + dy <= r2); -}; - -/** -* Returns the framing rectangle of the circle as a PIXI.Rectangle object -* -* @method getBounds -* @return {Rectangle} the framing rectangle -*/ -PIXI.Circle.prototype.getBounds = function() -{ - return new PIXI.Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2); -}; - -// constructor -PIXI.Circle.prototype.constructor = PIXI.Circle; - -/** - * @author Chad Engler - */ - -/** - * The Ellipse object can be used to specify a hit area for displayObjects - * - * @class Ellipse - * @constructor - * @param x {Number} The X coordinate of the center of the ellipse - * @param y {Number} The Y coordinate of the center of the ellipse - * @param width {Number} The half width of this ellipse - * @param height {Number} The half height of this ellipse - */ -PIXI.Ellipse = function(x, y, width, height) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.ELIP in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Ellipse instance - * - * @method clone - * @return {Ellipse} a copy of the ellipse - */ -PIXI.Ellipse.prototype.clone = function() -{ - return new PIXI.Ellipse(this.x, this.y, this.width, this.height); -}; - -/** - * Checks whether the x and y coordinates given are contained within this ellipse - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coords are within this ellipse - */ -PIXI.Ellipse.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - //normalize the coords to an ellipse with center 0,0 - var normx = ((x - this.x) / this.width), - normy = ((y - this.y) / this.height); - - normx *= normx; - normy *= normy; - - return (normx + normy <= 1); -}; - -/** -* Returns the framing rectangle of the ellipse as a PIXI.Rectangle object -* -* @method getBounds -* @return {Rectangle} the framing rectangle -*/ -PIXI.Ellipse.prototype.getBounds = function() -{ - return new PIXI.Rectangle(this.x - this.width, this.y - this.height, this.width, this.height); -}; - -// constructor -PIXI.Ellipse.prototype.constructor = PIXI.Ellipse; - -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * The Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height. - * - * @class RoundedRectangle - * @constructor - * @param x {Number} The X coordinate of the upper-left corner of the rounded rectangle - * @param y {Number} The Y coordinate of the upper-left corner of the rounded rectangle - * @param width {Number} The overall width of this rounded rectangle - * @param height {Number} The overall height of this rounded rectangle - * @param radius {Number} Controls the radius of the rounded corners - */ -PIXI.RoundedRectangle = function(x, y, width, height, radius) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - /** - * @property radius - * @type Number - * @default 20 - */ - this.radius = radius || 20; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RRECT in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Rounded Rectangle - * - * @method clone - * @return {RoundedRectangle} a copy of the rounded rectangle - */ -PIXI.RoundedRectangle.prototype.clone = function() -{ - return new PIXI.RoundedRectangle(this.x, this.y, this.width, this.height, this.radius); -}; - -/** - * Checks whether the x and y coordinates given are contained within this Rounded Rectangle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Rounded Rectangle - */ -PIXI.RoundedRectangle.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - var x1 = this.x; - if(x >= x1 && x <= x1 + this.width) - { - var y1 = this.y; - - if(y >= y1 && y <= y1 + this.height) - { - return true; - } - } - - return false; -}; - -// constructor -PIXI.RoundedRectangle.prototype.constructor = PIXI.RoundedRectangle; - - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Matrix class is now an object, which makes it a lot faster, - * here is a representation of it : - * | a | b | tx| - * | c | d | ty| - * | 0 | 0 | 1 | - * - * @class Matrix - * @constructor - */ -PIXI.Matrix = function() -{ - /** - * @property a - * @type Number - * @default 1 - */ - this.a = 1; - - /** - * @property b - * @type Number - * @default 0 - */ - this.b = 0; - - /** - * @property c - * @type Number - * @default 0 - */ - this.c = 0; - - /** - * @property d - * @type Number - * @default 1 - */ - this.d = 1; - - /** - * @property tx - * @type Number - * @default 0 - */ - this.tx = 0; - - /** - * @property ty - * @type Number - * @default 0 - */ - this.ty = 0; -}; - -/** - * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows: - * - * a = array[0] - * b = array[1] - * c = array[3] - * d = array[4] - * tx = array[2] - * ty = array[5] - * - * @method fromArray - * @param array {Array} The array that the matrix will be populated from. - */ -PIXI.Matrix.prototype.fromArray = function(array) -{ - this.a = array[0]; - this.b = array[1]; - this.c = array[3]; - this.d = array[4]; - this.tx = array[2]; - this.ty = array[5]; -}; - -/** - * Creates an array from the current Matrix object. - * - * @method toArray - * @param transpose {Boolean} Whether we need to transpose the matrix or not - * @return {Array} the newly created array which contains the matrix - */ -PIXI.Matrix.prototype.toArray = function(transpose) -{ - if(!this.array) this.array = new PIXI.Float32Array(9); - var array = this.array; - - if(transpose) - { - array[0] = this.a; - array[1] = this.b; - array[2] = 0; - array[3] = this.c; - array[4] = this.d; - array[5] = 0; - array[6] = this.tx; - array[7] = this.ty; - array[8] = 1; - } - else - { - array[0] = this.a; - array[1] = this.c; - array[2] = this.tx; - array[3] = this.b; - array[4] = this.d; - array[5] = this.ty; - array[6] = 0; - array[7] = 0; - array[8] = 1; - } - - return array; -}; - -/** - * Get a new position with the current transformation applied. - * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) - * - * @method apply - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix - */ -PIXI.Matrix.prototype.apply = function(pos, newPos) -{ - newPos = newPos || new PIXI.Point(); - - newPos.x = this.a * pos.x + this.c * pos.y + this.tx; - newPos.y = this.b * pos.x + this.d * pos.y + this.ty; - - return newPos; -}; - -/** - * Get a new position with the inverse of the current transformation applied. - * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) - * - * @method applyInverse - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix - */ -PIXI.Matrix.prototype.applyInverse = function(pos, newPos) -{ - newPos = newPos || new PIXI.Point(); - - var id = 1 / (this.a * this.d + this.c * -this.b); - - newPos.x = this.d * id * pos.x + -this.c * id * pos.y + (this.ty * this.c - this.tx * this.d) * id; - newPos.y = this.a * id * pos.y + -this.b * id * pos.x + (-this.ty * this.a + this.tx * this.b) * id; - - return newPos; -}; - -/** - * Translates the matrix on the x and y. - * - * @method translate - * @param {Number} x - * @param {Number} y - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.translate = function(x, y) -{ - this.tx += x; - this.ty += y; - - return this; -}; - -/** - * Applies a scale transformation to the matrix. - * - * @method scale - * @param {Number} x The amount to scale horizontally - * @param {Number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.scale = function(x, y) -{ - this.a *= x; - this.d *= y; - this.c *= x; - this.b *= y; - this.tx *= x; - this.ty *= y; - - return this; -}; - - -/** - * Applies a rotation transformation to the matrix. - * @method rotate - * @param {Number} angle The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.rotate = function(angle) -{ - var cos = Math.cos( angle ); - var sin = Math.sin( angle ); - - var a1 = this.a; - var c1 = this.c; - var tx1 = this.tx; - - this.a = a1 * cos-this.b * sin; - this.b = a1 * sin+this.b * cos; - this.c = c1 * cos-this.d * sin; - this.d = c1 * sin+this.d * cos; - this.tx = tx1 * cos - this.ty * sin; - this.ty = tx1 * sin + this.ty * cos; - - return this; -}; - -/** - * Appends the given Matrix to this Matrix. - * - * @method append - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. - */ -PIXI.Matrix.prototype.append = function(matrix) -{ - var a1 = this.a; - var b1 = this.b; - var c1 = this.c; - var d1 = this.d; - - this.a = matrix.a * a1 + matrix.b * c1; - this.b = matrix.a * b1 + matrix.b * d1; - this.c = matrix.c * a1 + matrix.d * c1; - this.d = matrix.c * b1 + matrix.d * d1; - - this.tx = matrix.tx * a1 + matrix.ty * c1 + this.tx; - this.ty = matrix.tx * b1 + matrix.ty * d1 + this.ty; - - return this; -}; - -/** - * Resets this Matix to an identity (default) matrix. - * - * @method identity - * @return {Matrix} This matrix. Good for chaining method calls. - */ -PIXI.Matrix.prototype.identity = function() -{ - this.a = 1; - this.b = 0; - this.c = 0; - this.d = 1; - this.tx = 0; - this.ty = 0; - - return this; -}; - -PIXI.identityMatrix = new PIXI.Matrix(); - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The base class for all objects that are rendered on the screen. - * This is an abstract class and should not be used on its own rather it should be extended. - * - * @class DisplayObject - * @constructor - */ -PIXI.DisplayObject = function() -{ - /** - * The coordinate of the object relative to the local coordinates of the parent. - * - * @property position - * @type Point - */ - this.position = new PIXI.Point(); - - /** - * The scale factor of the object. - * - * @property scale - * @type Point - */ - this.scale = new PIXI.Point(1,1);//{x:1, y:1}; - - /** - * The pivot point of the displayObject that it rotates around - * - * @property pivot - * @type Point - */ - this.pivot = new PIXI.Point(0,0); - - /** - * The rotation of the object in radians. - * - * @property rotation - * @type Number - */ - this.rotation = 0; - - /** - * The opacity of the object. - * - * @property alpha - * @type Number - */ - this.alpha = 1; - - /** - * The visibility of the object. - * - * @property visible - * @type Boolean - */ - this.visible = true; - - /** - * This is the defined area that will pick up mouse / touch events. It is null by default. - * Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children) - * - * @property hitArea - * @type Rectangle|Circle|Ellipse|Polygon - */ - this.hitArea = null; - - /** - * This is used to indicate if the displayObject should display a mouse hand cursor on rollover - * - * @property buttonMode - * @type Boolean - */ - this.buttonMode = false; - - /** - * Can this object be rendered - * - * @property renderable - * @type Boolean - */ - this.renderable = false; - - /** - * [read-only] The display object container that contains this display object. - * - * @property parent - * @type DisplayObjectContainer - * @readOnly - */ - this.parent = null; - - /** - * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage. - * - * @property stage - * @type Stage - * @readOnly - */ - this.stage = null; - - /** - * [read-only] The multiplied alpha of the displayObject - * - * @property worldAlpha - * @type Number - * @readOnly - */ - this.worldAlpha = 1; - - /** - * [read-only] Whether or not the object is interactive, do not toggle directly! use the `interactive` property - * - * @property _interactive - * @type Boolean - * @readOnly - * @private - */ - this._interactive = false; - - /** - * This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true - * - * @property defaultCursor - * @type String - * - */ - this.defaultCursor = 'pointer'; - - /** - * [read-only] Current transform of the object based on world (parent) factors - * - * @property worldTransform - * @type Matrix - * @readOnly - * @private - */ - this.worldTransform = new PIXI.Matrix(); - - /** - * cached sin rotation and cos rotation - * - * @property _sr - * @type Number - * @private - */ - this._sr = 0; - - /** - * cached sin rotation and cos rotation - * - * @property _cr - * @type Number - * @private - */ - this._cr = 1; - - /** - * The area the filter is applied to like the hitArea this is used as more of an optimisation - * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle - * - * @property filterArea - * @type Rectangle - */ - this.filterArea = null;//new PIXI.Rectangle(0,0,1,1); - - /** - * The original, cached bounds of the object - * - * @property _bounds - * @type Rectangle - * @private - */ - this._bounds = new PIXI.Rectangle(0, 0, 1, 1); - - /** - * The most up-to-date bounds of the object - * - * @property _currentBounds - * @type Rectangle - * @private - */ - this._currentBounds = null; - - /** - * The original, cached mask of the object - * - * @property _currentBounds - * @type Rectangle - * @private - */ - this._mask = null; - - /** - * Cached internal flag. - * - * @property _cacheAsBitmap - * @type Boolean - * @private - */ - this._cacheAsBitmap = false; - - /** - * Cached internal flag. - * - * @property _cacheIsDirty - * @type Boolean - * @private - */ - this._cacheIsDirty = false; - - - /* - * MOUSE Callbacks - */ - - /** - * A callback that is used when the users mouse rolls over the displayObject - * @method mouseover - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the users mouse leaves the displayObject - * @method mouseout - * @param interactionData {InteractionData} - */ - - //Left button - /** - * A callback that is used when the users clicks on the displayObject with their mouse's left button - * @method click - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user clicks the mouse's left button down over the sprite - * @method mousedown - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's left button that was over the displayObject - * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject - * @method mouseup - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject - * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject - * @method mouseupoutside - * @param interactionData {InteractionData} - */ - - //Right button - /** - * A callback that is used when the users clicks on the displayObject with their mouse's right button - * @method rightclick - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user clicks the mouse's right button down over the sprite - * @method rightdown - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's right button that was over the displayObject - * for this callback to be fired the mouse's right button must have been pressed down over the displayObject - * @method rightup - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject - * for this callback to be fired, the mouse's right button must have been pressed down over the displayObject - * @method rightupoutside - * @param interactionData {InteractionData} - */ - - /* - * TOUCH Callbacks - */ - - /** - * A callback that is used when the users taps on the sprite with their finger - * basically a touch version of click - * @method tap - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user touches over the displayObject - * @method touchstart - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases a touch over the displayObject - * @method touchend - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the touch that was over the displayObject - * for this callback to be fired, The touch must have started over the sprite - * @method touchendoutside - * @param interactionData {InteractionData} - */ -}; - -// constructor -PIXI.DisplayObject.prototype.constructor = PIXI.DisplayObject; - -/** - * Indicates if the sprite will have touch and mouse interactivity. It is false by default - * - * @property interactive - * @type Boolean - * @default false - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'interactive', { - get: function() { - return this._interactive; - }, - set: function(value) { - this._interactive = value; - - // TODO more to be done here.. - // need to sort out a re-crawl! - if(this.stage)this.stage.dirty = true; - } -}); - -/** - * [read-only] Indicates if the sprite is globally visible. - * - * @property worldVisible - * @type Boolean - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'worldVisible', { - get: function() { - var item = this; - - do - { - if(!item.visible)return false; - item = item.parent; - } - while(item); - - return true; - } -}); - -/** - * Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. - * In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. - * To remove a mask, set this property to null. - * - * @property mask - * @type Graphics - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'mask', { - get: function() { - return this._mask; - }, - set: function(value) { - - if(this._mask)this._mask.isMask = false; - this._mask = value; - if(this._mask)this._mask.isMask = true; - } -}); - -/** - * Sets the filters for the displayObject. - * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. - * To remove filters simply set this property to 'null' - * @property filters - * @type Array(Filter) - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { - - get: function() { - return this._filters; - }, - - set: function(value) { - - if(value) - { - // now put all the passes in one place.. - var passes = []; - for (var i = 0; i < value.length; i++) - { - var filterPasses = value[i].passes; - for (var j = 0; j < filterPasses.length; j++) - { - passes.push(filterPasses[j]); - } - } - - // TODO change this as it is legacy - this._filterBlock = {target:this, filterPasses:passes}; - } - - this._filters = value; - } -}); - -/** - * Set if this display object is cached as a bitmap. - * This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. - * To remove simply set this property to 'null' - * @property cacheAsBitmap - * @type Boolean - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'cacheAsBitmap', { - - get: function() { - return this._cacheAsBitmap; - }, - - set: function(value) { - - if(this._cacheAsBitmap === value)return; - - if(value) - { - this._generateCachedSprite(); - } - else - { - this._destroyCachedSprite(); - } - - this._cacheAsBitmap = value; - } -}); - -/* - * Updates the object transform for rendering - * - * @method updateTransform - * @private - */ -PIXI.DisplayObject.prototype.updateTransform = function() -{ - // create some matrix refs for easy access - var pt = this.parent.worldTransform; - var wt = this.worldTransform; - - // temporary matrix variables - var a, b, c, d, tx, ty; - - // so if rotation is between 0 then we can simplify the multiplication process.. - if(this.rotation % PIXI.PI_2) - { - // check to see if the rotation is the same as the previous render. This means we only need to use sin and cos when rotation actually changes - if(this.rotation !== this.rotationCache) - { - this.rotationCache = this.rotation; - this._sr = Math.sin(this.rotation); - this._cr = Math.cos(this.rotation); - } - - // get the matrix values of the displayobject based on its transform properties.. - a = this._cr * this.scale.x; - b = this._sr * this.scale.x; - c = -this._sr * this.scale.y; - d = this._cr * this.scale.y; - tx = this.position.x; - ty = this.position.y; - - // check for pivot.. not often used so geared towards that fact! - if(this.pivot.x || this.pivot.y) - { - tx -= this.pivot.x * a + this.pivot.y * c; - ty -= this.pivot.x * b + this.pivot.y * d; - } - - // concat the parent matrix with the objects transform. - wt.a = a * pt.a + b * pt.c; - wt.b = a * pt.b + b * pt.d; - wt.c = c * pt.a + d * pt.c; - wt.d = c * pt.b + d * pt.d; - wt.tx = tx * pt.a + ty * pt.c + pt.tx; - wt.ty = tx * pt.b + ty * pt.d + pt.ty; - - - } - else - { - // lets do the fast version as we know there is no rotation.. - a = this.scale.x; - d = this.scale.y; - - tx = this.position.x - this.pivot.x * a; - ty = this.position.y - this.pivot.y * d; - - wt.a = a * pt.a; - wt.b = a * pt.b; - wt.c = d * pt.c; - wt.d = d * pt.d; - wt.tx = tx * pt.a + ty * pt.c + pt.tx; - wt.ty = tx * pt.b + ty * pt.d + pt.ty; - } - - // multiply the alphas.. - this.worldAlpha = this.alpha * this.parent.worldAlpha; -}; - -// performance increase to avoid using call.. (10x faster) -PIXI.DisplayObject.prototype.displayObjectUpdateTransform = PIXI.DisplayObject.prototype.updateTransform; - -/** - * Retrieves the bounds of the displayObject as a rectangle object - * - * @method getBounds - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area - */ -PIXI.DisplayObject.prototype.getBounds = function(matrix) -{ - matrix = matrix;//just to get passed js hinting (and preserve inheritance) - return PIXI.EmptyRectangle; -}; - -/** - * Retrieves the local bounds of the displayObject as a rectangle object - * - * @method getLocalBounds - * @return {Rectangle} the rectangular bounding area - */ -PIXI.DisplayObject.prototype.getLocalBounds = function() -{ - return this.getBounds(PIXI.identityMatrix);///PIXI.EmptyRectangle(); -}; - -/** - * Sets the object's stage reference, the stage this object is connected to - * - * @method setStageReference - * @param stage {Stage} the stage that the object will have as its current stage reference - */ -PIXI.DisplayObject.prototype.setStageReference = function(stage) -{ - this.stage = stage; - if(this._interactive)this.stage.dirty = true; -}; - -/** - * Useful function that returns a texture of the displayObject object that can then be used to create sprites - * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. - * - * @method generateTexture - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @return {Texture} a texture of the graphics object - */ -PIXI.DisplayObject.prototype.generateTexture = function(resolution, scaleMode, renderer) -{ - var bounds = this.getLocalBounds(); - - var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0, renderer, scaleMode, resolution); - - PIXI.DisplayObject._tempMatrix.tx = -bounds.x; - PIXI.DisplayObject._tempMatrix.ty = -bounds.y; - - renderTexture.render(this, PIXI.DisplayObject._tempMatrix); - - return renderTexture; -}; - -/** - * Generates and updates the cached sprite for this object. - * - * @method updateCache - */ -PIXI.DisplayObject.prototype.updateCache = function() -{ - this._generateCachedSprite(); -}; - -/** - * Calculates the global position of the display object - * - * @method toGlobal - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object - */ -PIXI.DisplayObject.prototype.toGlobal = function(position) -{ - // don't need to u[date the lot - this.displayObjectUpdateTransform(); - return this.worldTransform.apply(position); -}; - -/** - * Calculates the local position of the display object relative to another point - * - * @method toLocal - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object - */ -PIXI.DisplayObject.prototype.toLocal = function(position, from) -{ - // - if (from) - { - position = from.toGlobal(position); - } - - // don't need to u[date the lot - this.displayObjectUpdateTransform(); - return this.worldTransform.applyInverse(position); -}; - -/** - * Internal method. - * - * @method _renderCachedSprite - * @param renderSession {Object} The render session - * @private - */ -PIXI.DisplayObject.prototype._renderCachedSprite = function(renderSession) -{ - this._cachedSprite.worldAlpha = this.worldAlpha; - - if(renderSession.gl) - { - PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession); - } - else - { - PIXI.Sprite.prototype._renderCanvas.call(this._cachedSprite, renderSession); - } -}; - -/** - * Internal method. - * - * @method _generateCachedSprite - * @private - */ -PIXI.DisplayObject.prototype._generateCachedSprite = function() -{ - this._cacheAsBitmap = false; - var bounds = this.getLocalBounds(); - - if(!this._cachedSprite) - { - var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0);//, renderSession.renderer); - - this._cachedSprite = new PIXI.Sprite(renderTexture); - this._cachedSprite.worldTransform = this.worldTransform; - } - else - { - this._cachedSprite.texture.resize(bounds.width | 0, bounds.height | 0); - } - - //REMOVE filter! - var tempFilters = this._filters; - this._filters = null; - - this._cachedSprite.filters = tempFilters; - - PIXI.DisplayObject._tempMatrix.tx = -bounds.x; - PIXI.DisplayObject._tempMatrix.ty = -bounds.y; - - this._cachedSprite.texture.render(this, PIXI.DisplayObject._tempMatrix, true); - - this._cachedSprite.anchor.x = -( bounds.x / bounds.width ); - this._cachedSprite.anchor.y = -( bounds.y / bounds.height ); - - this._filters = tempFilters; - - this._cacheAsBitmap = true; -}; - -/** -* Destroys the cached sprite. -* -* @method _destroyCachedSprite -* @private -*/ -PIXI.DisplayObject.prototype._destroyCachedSprite = function() -{ - if(!this._cachedSprite)return; - - this._cachedSprite.texture.destroy(true); - - // TODO could be object pooled! - this._cachedSprite = null; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.DisplayObject.prototype._renderWebGL = function(renderSession) -{ - // OVERWRITE; - // this line is just here to pass jshinting :) - renderSession = renderSession; -}; - -/** -* Renders the object using the Canvas renderer -* -* @method _renderCanvas -* @param renderSession {RenderSession} -* @private -*/ -PIXI.DisplayObject.prototype._renderCanvas = function(renderSession) -{ - // OVERWRITE; - // this line is just here to pass jshinting :) - renderSession = renderSession; -}; - - -PIXI.DisplayObject._tempMatrix = new PIXI.Matrix(); - -/** - * The position of the displayObject on the x axis relative to the local coordinates of the parent. - * - * @property x - * @type Number - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'x', { - get: function() { - return this.position.x; - }, - set: function(value) { - this.position.x = value; - } -}); - -/** - * The position of the displayObject on the y axis relative to the local coordinates of the parent. - * - * @property y - * @type Number - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'y', { - get: function() { - return this.position.y; - }, - set: function(value) { - this.position.y = value; - } -}); - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A DisplayObjectContainer represents a collection of display objects. - * It is the base class of all display objects that act as a container for other objects. - * - * @class DisplayObjectContainer - * @extends DisplayObject - * @constructor - */ -PIXI.DisplayObjectContainer = function() -{ - PIXI.DisplayObject.call( this ); - - /** - * [read-only] The array of children of this container. - * - * @property children - * @type Array(DisplayObject) - * @readOnly - */ - this.children = []; - - // fast access to update transform.. - -}; - -// constructor -PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); -PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer; - - -/** - * The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', { - get: function() { - return this.scale.x * this.getLocalBounds().width; - }, - set: function(value) { - - var width = this.getLocalBounds().width; - - if(width !== 0) - { - this.scale.x = value / width; - } - else - { - this.scale.x = 1; - } - - - this._width = value; - } -}); - -/** - * The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', { - get: function() { - return this.scale.y * this.getLocalBounds().height; - }, - set: function(value) { - - var height = this.getLocalBounds().height; - - if(height !== 0) - { - this.scale.y = value / height ; - } - else - { - this.scale.y = 1; - } - - this._height = value; - } -}); - -/** - * Adds a child to the container. - * - * @method addChild - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. - */ -PIXI.DisplayObjectContainer.prototype.addChild = function(child) -{ - return this.addChildAt(child, this.children.length); -}; - -/** - * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown - * - * @method addChildAt - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. - */ -PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) -{ - if(index >= 0 && index <= this.children.length) - { - if(child.parent) - { - child.parent.removeChild(child); - } - - child.parent = this; - - this.children.splice(index, 0, child); - - if(this.stage)child.setStageReference(this.stage); - - return child; - } - else - { - throw new Error(child + 'addChildAt: The index '+ index +' supplied is out of bounds ' + this.children.length); - } -}; - -/** - * Swaps the position of 2 Display Objects within this container. - * - * @method swapChildren - * @param child {DisplayObject} - * @param child2 {DisplayObject} - */ -PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2) -{ - if(child === child2) { - return; - } - - var index1 = this.getChildIndex(child); - var index2 = this.getChildIndex(child2); - - if(index1 < 0 || index2 < 0) { - throw new Error('swapChildren: Both the supplied DisplayObjects must be a child of the caller.'); - } - - this.children[index1] = child2; - this.children[index2] = child; - -}; - -/** - * Returns the index position of a child DisplayObject instance - * - * @method getChildIndex - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify - */ -PIXI.DisplayObjectContainer.prototype.getChildIndex = function(child) -{ - var index = this.children.indexOf(child); - if (index === -1) - { - throw new Error('The supplied DisplayObject must be a child of the caller'); - } - return index; -}; - -/** - * Changes the position of an existing child in the display object container - * - * @method setChildIndex - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object - */ -PIXI.DisplayObjectContainer.prototype.setChildIndex = function(child, index) -{ - if (index < 0 || index >= this.children.length) - { - throw new Error('The supplied index is out of bounds'); - } - var currentIndex = this.getChildIndex(child); - this.children.splice(currentIndex, 1); //remove from old position - this.children.splice(index, 0, child); //add at new position -}; - -/** - * Returns the child at the specified index - * - * @method getChildAt - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child at the given index, if any. - */ -PIXI.DisplayObjectContainer.prototype.getChildAt = function(index) -{ - if (index < 0 || index >= this.children.length) - { - throw new Error('getChildAt: Supplied index '+ index +' does not exist in the child list, or the supplied DisplayObject must be a child of the caller'); - } - return this.children[index]; - -}; - -/** - * Removes a child from the container. - * - * @method removeChild - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. - */ -PIXI.DisplayObjectContainer.prototype.removeChild = function(child) -{ - var index = this.children.indexOf( child ); - if(index === -1)return; - - return this.removeChildAt( index ); -}; - -/** - * Removes a child from the specified index position. - * - * @method removeChildAt - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. - */ -PIXI.DisplayObjectContainer.prototype.removeChildAt = function(index) -{ - var child = this.getChildAt( index ); - if(this.stage) - child.removeStageReference(); - - child.parent = undefined; - this.children.splice( index, 1 ); - return child; -}; - -/** -* Removes all children from this container that are within the begin and end indexes. -* -* @method removeChildren -* @param beginIndex {Number} The beginning position. Default value is 0. -* @param endIndex {Number} The ending position. Default value is size of the container. -*/ -PIXI.DisplayObjectContainer.prototype.removeChildren = function(beginIndex, endIndex) -{ - var begin = beginIndex || 0; - var end = typeof endIndex === 'number' ? endIndex : this.children.length; - var range = end - begin; - - if (range > 0 && range <= end) - { - var removed = this.children.splice(begin, range); - for (var i = 0; i < removed.length; i++) { - var child = removed[i]; - if(this.stage) - child.removeStageReference(); - child.parent = undefined; - } - return removed; - } - else if (range === 0 && this.children.length === 0) - { - return []; - } - else - { - throw new Error( 'removeChildren: Range Error, numeric values are outside the acceptable range' ); - } -}; - -/* - * Updates the transform on all children of this container for rendering - * - * @method updateTransform - * @private - */ -PIXI.DisplayObjectContainer.prototype.updateTransform = function() -{ - if(!this.visible)return; - - this.displayObjectUpdateTransform(); - - //PIXI.DisplayObject.prototype.updateTransform.call( this ); - - if(this._cacheAsBitmap)return; - - for(var i=0,j=this.children.length; i childMaxX ? maxX : childMaxX; - maxY = maxY > childMaxY ? maxY : childMaxY; - } - - if(!childVisible) - return PIXI.EmptyRectangle; - - var bounds = this._bounds; - - bounds.x = minX; - bounds.y = minY; - bounds.width = maxX - minX; - bounds.height = maxY - minY; - - // TODO: store a reference so that if this function gets called again in the render cycle we do not have to recalculate - //this._currentBounds = bounds; - - return bounds; -}; - -/** - * Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration. - * - * @method getLocalBounds - * @return {Rectangle} The rectangular bounding area - */ -PIXI.DisplayObjectContainer.prototype.getLocalBounds = function() -{ - var matrixCache = this.worldTransform; - - this.worldTransform = PIXI.identityMatrix; - - for(var i=0,j=this.children.length; i maxX ? x1 : maxX; - maxX = x2 > maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y1 > maxY ? y1 : maxY; - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - } - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Sprite.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(!this.visible || this.alpha <= 0)return; - - var i,j; - - // do a quick check to see if this element has a mask or a filter. - if(this._mask || this._filters) - { - var spriteBatch = renderSession.spriteBatch; - - // push filter first as we need to ensure the stencil buffer is correct for any masking - if(this._filters) - { - spriteBatch.flush(); - renderSession.filterManager.pushFilter(this._filterBlock); - } - - if(this._mask) - { - spriteBatch.stop(); - renderSession.maskManager.pushMask(this.mask, renderSession); - spriteBatch.start(); - } - - // add this sprite to the batch - spriteBatch.render(this); - - // now loop through the children and make sure they get rendered - for(i=0,j=this.children.length; i= this.textures.length) - { - this.gotoAndStop(this.textures.length - 1); - if(this.onComplete) - { - this.onComplete(); - } - } -}; - -/** - * A short hand way of creating a movieclip from an array of frame ids - * - * @static - * @method fromFrames - * @param frames {Array} the array of frames ids the movieclip will use as its texture frames - * @return {MovieClip} - */ -PIXI.MovieClip.fromFrames = function(frames) -{ - var textures = []; - - for (var i = 0; i < frames.length; i++) - { - textures.push(new PIXI.Texture.fromFrame(frames[i])); - } - - return new PIXI.MovieClip(textures); -}; - -/** - * A short hand way of creating a movieclip from an array of image ids - * - * @static - * @method fromImages - * @param frames {Array} the array of image ids the movieclip will use as its texture frames - * @return {MovieClip} - */ -PIXI.MovieClip.fromImages = function(images) -{ - var textures = []; - - for (var i = 0; i < images.length; i++) - { - textures.push(new PIXI.Texture.fromImage(images[i])); - } - - return new PIXI.MovieClip(textures); -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A target and pass info object for filters. - * - * @class FilterBlock - * @constructor - */ -PIXI.FilterBlock = function() -{ - /** - * The visible state of this FilterBlock. - * - * @property visible - * @type Boolean - */ - this.visible = true; - - /** - * The renderable state of this FilterBlock. - * - * @property renderable - * @type Boolean - */ - this.renderable = true; -}; - -PIXI.FilterBlock.prototype.constructor = PIXI.FilterBlock; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * Modified by Tom Slezakowski http://www.tomslezakowski.com @TomSlezakowski (24/03/2014) - Added dropShadowColor. - */ - -/** - * A Text Object will create a line or multiple lines of text. To split a line you can use '\n' in your text string, - * or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object. - * - * @class Text - * @extends Sprite - * @constructor - * @param text {String} The copy that you would like the text to display - * @param [style] {Object} The style parameters - * @param [style.font] {String} default 'bold 20px Arial' The style and size of the font - * @param [style.fill='black'] {String|Number} A canvas fillstyle that will be used on the text e.g 'red', '#00FF00' - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - * @param [style.stroke] {String|Number} A canvas fillstyle that will be used on the text stroke e.g 'blue', '#FCFF00' - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke) - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap, it needs wordWrap to be set to true - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00' - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow - */ -PIXI.Text = function(text, style) -{ - /** - * The canvas element that everything is drawn to - * - * @property canvas - * @type HTMLCanvasElement - */ - this.canvas = document.createElement('canvas'); - - /** - * The canvas 2d context that everything is drawn with - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.canvas.getContext('2d'); - - /** - * The resolution of the canvas. - * @property resolution - * @type Number - */ - this.resolution = 1; - - PIXI.Sprite.call(this, PIXI.Texture.fromCanvas(this.canvas)); - - this.setText(text); - this.setStyle(style); - -}; - -// constructor -PIXI.Text.prototype = Object.create(PIXI.Sprite.prototype); -PIXI.Text.prototype.constructor = PIXI.Text; - -/** - * The width of the Text, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.Text.prototype, 'width', { - get: function() { - - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - - return this.scale.x * this.texture.frame.width; - }, - set: function(value) { - this.scale.x = value / this.texture.frame.width; - this._width = value; - } -}); - -/** - * The height of the Text, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.Text.prototype, 'height', { - get: function() { - - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - - return this.scale.y * this.texture.frame.height; - }, - set: function(value) { - this.scale.y = value / this.texture.frame.height; - this._height = value; - } -}); - -/** - * Set the style of the text - * - * @method setStyle - * @param [style] {Object} The style parameters - * @param [style.font='bold 20pt Arial'] {String} The style and size of the font - * @param [style.fill='black'] {Object} A canvas fillstyle that will be used on the text eg 'red', '#00FF00' - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - * @param [style.stroke='black'] {String} A canvas fillstyle that will be used on the text stroke eg 'blue', '#FCFF00' - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke) - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00' - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow - */ -PIXI.Text.prototype.setStyle = function(style) -{ - style = style || {}; - style.font = style.font || 'bold 20pt Arial'; - style.fill = style.fill || 'black'; - style.align = style.align || 'left'; - style.stroke = style.stroke || 'black'; //provide a default, see: https://github.com/GoodBoyDigital/pixi.js/issues/136 - style.strokeThickness = style.strokeThickness || 0; - style.wordWrap = style.wordWrap || false; - style.wordWrapWidth = style.wordWrapWidth || 100; - - style.dropShadow = style.dropShadow || false; - style.dropShadowAngle = style.dropShadowAngle || Math.PI / 6; - style.dropShadowDistance = style.dropShadowDistance || 4; - style.dropShadowColor = style.dropShadowColor || 'black'; - - this.style = style; - this.dirty = true; -}; - -/** - * Set the copy for the text object. To split a line you can use '\n'. - * - * @method setText - * @param text {String} The copy that you would like the text to display - */ -PIXI.Text.prototype.setText = function(text) -{ - this.text = text.toString() || ' '; - this.dirty = true; -}; - -/** - * Renders text and updates it when needed - * - * @method updateText - * @private - */ -PIXI.Text.prototype.updateText = function() -{ - this.texture.baseTexture.resolution = this.resolution; - - this.context.font = this.style.font; - - var outputText = this.text; - - // word wrap - // preserve original text - if(this.style.wordWrap)outputText = this.wordWrap(this.text); - - //split text into lines - var lines = outputText.split(/(?:\r\n|\r|\n)/); - - //calculate text width - var lineWidths = []; - var maxLineWidth = 0; - var fontProperties = this.determineFontProperties(this.style.font); - for (var i = 0; i < lines.length; i++) - { - var lineWidth = this.context.measureText(lines[i]).width; - lineWidths[i] = lineWidth; - maxLineWidth = Math.max(maxLineWidth, lineWidth); - } - - var width = maxLineWidth + this.style.strokeThickness; - if(this.style.dropShadow)width += this.style.dropShadowDistance; - - this.canvas.width = ( width + this.context.lineWidth ) * this.resolution; - - //calculate text height - var lineHeight = fontProperties.fontSize + this.style.strokeThickness; - - var height = lineHeight * lines.length; - if(this.style.dropShadow)height += this.style.dropShadowDistance; - - this.canvas.height = height * this.resolution; - - this.context.scale( this.resolution, this.resolution); - - if(navigator.isCocoonJS) this.context.clearRect(0,0,this.canvas.width,this.canvas.height); - - // used for debugging.. - //this.context.fillStyle ="#FF0000" - //this.context.fillRect(0, 0, this.canvas.width,this.canvas.height); - - this.context.font = this.style.font; - this.context.strokeStyle = this.style.stroke; - this.context.lineWidth = this.style.strokeThickness; - this.context.textBaseline = 'alphabetic'; - //this.context.lineJoin = 'round'; - - var linePositionX; - var linePositionY; - - if(this.style.dropShadow) - { - this.context.fillStyle = this.style.dropShadowColor; - - var xShadowOffset = Math.sin(this.style.dropShadowAngle) * this.style.dropShadowDistance; - var yShadowOffset = Math.cos(this.style.dropShadowAngle) * this.style.dropShadowDistance; - - for (i = 0; i < lines.length; i++) - { - linePositionX = this.style.strokeThickness / 2; - linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent; - - if(this.style.align === 'right') - { - linePositionX += maxLineWidth - lineWidths[i]; - } - else if(this.style.align === 'center') - { - linePositionX += (maxLineWidth - lineWidths[i]) / 2; - } - - if(this.style.fill) - { - this.context.fillText(lines[i], linePositionX + xShadowOffset, linePositionY + yShadowOffset); - } - - // if(dropShadow) - } - } - - //set canvas text styles - this.context.fillStyle = this.style.fill; - - //draw lines line by line - for (i = 0; i < lines.length; i++) - { - linePositionX = this.style.strokeThickness / 2; - linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent; - - if(this.style.align === 'right') - { - linePositionX += maxLineWidth - lineWidths[i]; - } - else if(this.style.align === 'center') - { - linePositionX += (maxLineWidth - lineWidths[i]) / 2; - } - - if(this.style.stroke && this.style.strokeThickness) - { - this.context.strokeText(lines[i], linePositionX, linePositionY); - } - - if(this.style.fill) - { - this.context.fillText(lines[i], linePositionX, linePositionY); - } - - // if(dropShadow) - } - - this.updateTexture(); -}; - -/** - * Updates texture size based on canvas size - * - * @method updateTexture - * @private - */ -PIXI.Text.prototype.updateTexture = function() -{ - this.texture.baseTexture.width = this.canvas.width; - this.texture.baseTexture.height = this.canvas.height; - this.texture.crop.width = this.texture.frame.width = this.canvas.width; - this.texture.crop.height = this.texture.frame.height = this.canvas.height; - - this._width = this.canvas.width; - this._height = this.canvas.height; - - // update the dirty base textures - this.texture.baseTexture.dirty(); -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Text.prototype._renderWebGL = function(renderSession) -{ - if(this.dirty) - { - this.resolution = renderSession.resolution; - - this.updateText(); - this.dirty = false; - } - - PIXI.Sprite.prototype._renderWebGL.call(this, renderSession); -}; - -/** -* Renders the object using the Canvas renderer -* -* @method _renderCanvas -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Text.prototype._renderCanvas = function(renderSession) -{ - if(this.dirty) - { - this.resolution = renderSession.resolution; - - this.updateText(); - this.dirty = false; - } - - PIXI.Sprite.prototype._renderCanvas.call(this, renderSession); -}; - -/** -* Calculates the ascent, descent and fontSize of a given fontStyle -* -* @method determineFontProperties -* @param fontStyle {Object} -* @private -*/ -PIXI.Text.prototype.determineFontProperties = function(fontStyle) -{ - var properties = PIXI.Text.fontPropertiesCache[fontStyle]; - - if(!properties) - { - properties = {}; - - var canvas = PIXI.Text.fontPropertiesCanvas; - var context = PIXI.Text.fontPropertiesContext; - - context.font = fontStyle; - - var width = Math.ceil(context.measureText('|Mq').width); - var baseline = Math.ceil(context.measureText('M').width); - var height = 2 * baseline; - - baseline = baseline * 1.4 | 0; - - canvas.width = width; - canvas.height = height; - - context.fillStyle = '#f00'; - context.fillRect(0, 0, width, height); - - context.font = fontStyle; - - context.textBaseline = 'alphabetic'; - context.fillStyle = '#000'; - context.fillText('|MÉq', 0, baseline); - - var imagedata = context.getImageData(0, 0, width, height).data; - var pixels = imagedata.length; - var line = width * 4; - - var i, j; - - var idx = 0; - var stop = false; - - // ascent. scan from top to bottom until we find a non red pixel - for(i = 0; i < baseline; i++) - { - for(j = 0; j < line; j += 4) - { - if(imagedata[idx + j] !== 255) - { - stop = true; - break; - } - } - if(!stop) - { - idx += line; - } - else - { - break; - } - } - - properties.ascent = baseline - i; - - idx = pixels - line; - stop = false; - - // descent. scan from bottom to top until we find a non red pixel - for(i = height; i > baseline; i--) - { - for(j = 0; j < line; j += 4) - { - if(imagedata[idx + j] !== 255) - { - stop = true; - break; - } - } - if(!stop) - { - idx -= line; - } - else - { - break; - } - } - - properties.descent = i - baseline; - //TODO might need a tweak. kind of a temp fix! - properties.descent += 6; - properties.fontSize = properties.ascent + properties.descent; - - PIXI.Text.fontPropertiesCache[fontStyle] = properties; - } - - return properties; -}; - -/** - * Applies newlines to a string to have it optimally fit into the horizontal - * bounds set by the Text object's wordWrapWidth property. - * - * @method wordWrap - * @param text {String} - * @private - */ -PIXI.Text.prototype.wordWrap = function(text) -{ - // Greedy wrapping algorithm that will wrap words as the line grows longer - // than its horizontal bounds. - var result = ''; - var lines = text.split('\n'); - for (var i = 0; i < lines.length; i++) - { - var spaceLeft = this.style.wordWrapWidth; - var words = lines[i].split(' '); - for (var j = 0; j < words.length; j++) - { - var wordWidth = this.context.measureText(words[j]).width; - var wordWidthWithSpace = wordWidth + this.context.measureText(' ').width; - if(j === 0 || wordWidthWithSpace > spaceLeft) - { - // Skip printing the newline if it's the first word of the line that is - // greater than the word wrap width. - if(j > 0) - { - result += '\n'; - } - result += words[j]; - spaceLeft = this.style.wordWrapWidth - wordWidth; - } - else - { - spaceLeft -= wordWidthWithSpace; - result += ' ' + words[j]; - } - } - - if (i < lines.length-1) - { - result += '\n'; - } - } - return result; -}; - -/** -* Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. -* -* @method getBounds -* @param matrix {Matrix} the transformation matrix of the Text -* @return {Rectangle} the framing rectangle -*/ -PIXI.Text.prototype.getBounds = function(matrix) -{ - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - return PIXI.Sprite.prototype.getBounds.call(this, matrix); -}; - -/** - * Destroys this text object. - * - * @method destroy - * @param destroyBaseTexture {Boolean} whether to destroy the base texture as well - */ -PIXI.Text.prototype.destroy = function(destroyBaseTexture) -{ - // make sure to reset the the context and canvas.. dont want this hanging around in memory! - this.context = null; - this.canvas = null; - - this.texture.destroy(destroyBaseTexture === undefined ? true : destroyBaseTexture); -}; - -PIXI.Text.fontPropertiesCache = {}; -PIXI.Text.fontPropertiesCanvas = document.createElement('canvas'); -PIXI.Text.fontPropertiesContext = PIXI.Text.fontPropertiesCanvas.getContext('2d'); - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A BitmapText object will create a line or multiple lines of text using bitmap font. To split a line you can use '\n', '\r' or '\r\n' in your string. - * You can generate the fnt files using - * http://www.angelcode.com/products/bmfont/ for windows or - * http://www.bmglyph.com/ for mac. - * - * @class BitmapText - * @extends DisplayObjectContainer - * @constructor - * @param text {String} The copy that you would like the text to display - * @param style {Object} The style parameters - * @param style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously) - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - */ -PIXI.BitmapText = function(text, style) -{ - PIXI.DisplayObjectContainer.call(this); - - /** - * [read-only] The width of the overall text, different from fontSize, - * which is defined in the style object - * - * @property textWidth - * @type Number - * @readOnly - */ - this.textWidth = 0; - - /** - * [read-only] The height of the overall text, different from fontSize, - * which is defined in the style object - * - * @property textHeight - * @type Number - * @readOnly - */ - this.textHeight = 0; - - /** - * @property _pool - * @type Array - * @private - */ - this._pool = []; - - this.setText(text); - this.setStyle(style); - this.updateText(); - - /** - * The dirty state of this object. - * @property dirty - * @type Boolean - */ - this.dirty = false; -}; - -// constructor -PIXI.BitmapText.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); -PIXI.BitmapText.prototype.constructor = PIXI.BitmapText; - -/** - * Set the text string to be rendered. - * - * @method setText - * @param text {String} The text that you would like displayed - */ -PIXI.BitmapText.prototype.setText = function(text) -{ - this.text = text || ' '; - this.dirty = true; -}; - -/** - * Set the style of the text - * style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously) - * [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single lines of text - * - * @method setStyle - * @param style {Object} The style parameters, contained as properties of an object - */ -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; - this.tint = style.tint; -}; - -/** - * Renders text and updates it when needed - * - * @method updateText - * @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(/(?:\r\n|\r|\n)/.test(this.text.charAt(i))) - { - 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.kerning[prevCharCode]) - { - pos.x += charData.kerning[prevCharCode]; - } - - chars.push({texture:charData.texture, 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); - } - - var lenChildren = this.children.length; - var lenChars = chars.length; - var tint = this.tint || 0xFFFFFF; - - for(i = 0; i < lenChars; i++) - { - var c = i < lenChildren ? this.children[i] : this._pool.pop(); // get old child if have. if not - take from pool. - - if (c) c.setTexture(chars[i].texture); // check if got one before. - else c = new PIXI.Sprite(chars[i].texture); // if no create new one. - - c.position.x = (chars[i].position.x + lineAlignOffsets[chars[i].line]) * scale; - c.position.y = chars[i].position.y * scale; - c.scale.x = c.scale.y = scale; - c.tint = tint; - if (!c.parent) this.addChild(c); - } - - // remove unnecessary children. - // and put their into the pool. - while(this.children.length > lenChars) - { - var child = this.getChildAt(this.children.length - 1); - this._pool.push(child); - this.removeChild(child); - } - - this.textWidth = maxLineWidth * scale; - this.textHeight = (pos.y + data.lineHeight) * scale; -}; - -/** - * Updates the transform of this object - * - * @method updateTransform - * @private - */ -PIXI.BitmapText.prototype.updateTransform = function() -{ - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - PIXI.DisplayObjectContainer.prototype.updateTransform.call(this); -}; - -PIXI.BitmapText.fonts = {}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Holds all information related to an Interaction event - * - * @class InteractionData - * @constructor - */ -PIXI.InteractionData = function() -{ - /** - * This point stores the global coords of where the touch/mouse event happened - * - * @property global - * @type Point - */ - this.global = new PIXI.Point(); - - /** - * The target Sprite that was interacted with - * - * @property target - * @type Sprite - */ - this.target = null; - - /** - * When passed to an event handler, this will be the original DOM Event that was captured - * - * @property originalEvent - * @type Event - */ - this.originalEvent = null; -}; - -/** - * This will return the local coordinates of the specified displayObject for this InteractionData - * - * @method getLocalPosition - * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off - * @param [point] {Point} A Point object in which to store the value, optional (otherwise will create a new point) - * @return {Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject - */ -PIXI.InteractionData.prototype.getLocalPosition = function(displayObject, point) -{ - var worldTransform = displayObject.worldTransform; - var global = this.global; - - // do a cheeky transform to get the mouse coords; - var a00 = worldTransform.a, a01 = worldTransform.c, a02 = worldTransform.tx, - a10 = worldTransform.b, a11 = worldTransform.d, a12 = worldTransform.ty, - id = 1 / (a00 * a11 + a01 * -a10); - - point = point || new PIXI.Point(); - - point.x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id; - point.y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; - - // set the mouse coords... - return point; -}; - -// constructor -PIXI.InteractionData.prototype.constructor = PIXI.InteractionData; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - - /** - * The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive - * if its interactive parameter is set to true - * This manager also supports multitouch. - * - * @class InteractionManager - * @constructor - * @param stage {Stage} The stage to handle interactions - */ -PIXI.InteractionManager = function(stage) -{ - /** - * A reference to the stage - * - * @property stage - * @type Stage - */ - this.stage = stage; - - /** - * The mouse data - * - * @property mouse - * @type InteractionData - */ - this.mouse = new PIXI.InteractionData(); - - /** - * An object that stores current touches (InteractionData) by id reference - * - * @property touches - * @type Object - */ - this.touches = {}; - - /** - * @property tempPoint - * @type Point - * @private - */ - this.tempPoint = new PIXI.Point(); - - /** - * @property mouseoverEnabled - * @type Boolean - * @default - */ - this.mouseoverEnabled = true; - - /** - * Tiny little interactiveData pool ! - * - * @property pool - * @type Array - */ - this.pool = []; - - /** - * An array containing all the iterative items from the our interactive tree - * @property interactiveItems - * @type Array - * @private - */ - this.interactiveItems = []; - - /** - * Our canvas - * @property interactionDOMElement - * @type HTMLCanvasElement - * @private - */ - this.interactionDOMElement = null; - - //this will make it so that you don't have to call bind all the time - - /** - * @property onMouseMove - * @type Function - */ - this.onMouseMove = this.onMouseMove.bind( this ); - - /** - * @property onMouseDown - * @type Function - */ - this.onMouseDown = this.onMouseDown.bind(this); - - /** - * @property onMouseOut - * @type Function - */ - this.onMouseOut = this.onMouseOut.bind(this); - - /** - * @property onMouseUp - * @type Function - */ - this.onMouseUp = this.onMouseUp.bind(this); - - /** - * @property onTouchStart - * @type Function - */ - this.onTouchStart = this.onTouchStart.bind(this); - - /** - * @property onTouchEnd - * @type Function - */ - this.onTouchEnd = this.onTouchEnd.bind(this); - - /** - * @property onTouchCancel - * @type Function - */ - this.onTouchCancel = this.onTouchCancel.bind(this); - - /** - * @property onTouchMove - * @type Function - */ - this.onTouchMove = this.onTouchMove.bind(this); - - /** - * @property last - * @type Number - */ - this.last = 0; - - /** - * The css style of the cursor that is being used - * @property currentCursorStyle - * @type String - */ - this.currentCursorStyle = 'inherit'; - - /** - * Is set to true when the mouse is moved out of the canvas - * @property mouseOut - * @type Boolean - */ - this.mouseOut = false; - - /** - * @property resolution - * @type Number - */ - this.resolution = 1; - - // used for hit testing - this._tempPoint = new PIXI.Point(); -}; - -// constructor -PIXI.InteractionManager.prototype.constructor = PIXI.InteractionManager; - -/** - * Collects an interactive sprite recursively to have their interactions managed - * - * @method collectInteractiveSprite - * @param displayObject {DisplayObject} the displayObject to collect - * @param iParent {DisplayObject} the display object's parent - * @private - */ -PIXI.InteractionManager.prototype.collectInteractiveSprite = function(displayObject, iParent) -{ - var children = displayObject.children; - var length = children.length; - - // make an interaction tree... {item.__interactiveParent} - for (var i = length - 1; i >= 0; i--) - { - var child = children[i]; - - // push all interactive bits - if (child._interactive) - { - iParent.interactiveChildren = true; - //child.__iParent = iParent; - this.interactiveItems.push(child); - - if (child.children.length > 0) { - this.collectInteractiveSprite(child, child); - } - } - else - { - child.__iParent = null; - if (child.children.length > 0) - { - this.collectInteractiveSprite(child, iParent); - } - } - - } -}; - -/** - * Sets the target for event delegation - * - * @method setTarget - * @param target {WebGLRenderer|CanvasRenderer} the renderer to bind events to - * @private - */ -PIXI.InteractionManager.prototype.setTarget = function(target) -{ - this.target = target; - this.resolution = target.resolution; - - // Check if the dom element has been set. If it has don't do anything. - if (this.interactionDOMElement !== null) return; - - this.setTargetDomElement (target.view); -}; - -/** - * Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM - * elements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element - * to receive those events - * - * @method setTargetDomElement - * @param domElement {DOMElement} the DOM element which will receive mouse and touch events - * @private - */ -PIXI.InteractionManager.prototype.setTargetDomElement = function(domElement) -{ - this.removeEvents(); - - if (window.navigator.msPointerEnabled) - { - // time to remove some of that zoom in ja.. - domElement.style['-ms-content-zooming'] = 'none'; - domElement.style['-ms-touch-action'] = 'none'; - } - - this.interactionDOMElement = domElement; - - domElement.addEventListener('mousemove', this.onMouseMove, true); - domElement.addEventListener('mousedown', this.onMouseDown, true); - domElement.addEventListener('mouseout', this.onMouseOut, true); - - // aint no multi touch just yet! - domElement.addEventListener('touchstart', this.onTouchStart, true); - domElement.addEventListener('touchend', this.onTouchEnd, true); - domElement.addEventListener('touchleave', this.onTouchCancel, true); - domElement.addEventListener('touchcancel', this.onTouchCancel, true); - domElement.addEventListener('touchmove', this.onTouchMove, true); - - window.addEventListener('mouseup', this.onMouseUp, true); -}; - -/** - * @method removeEvents - * @private - */ -PIXI.InteractionManager.prototype.removeEvents = function() -{ - if (!this.interactionDOMElement) return; - - this.interactionDOMElement.style['-ms-content-zooming'] = ''; - this.interactionDOMElement.style['-ms-touch-action'] = ''; - - this.interactionDOMElement.removeEventListener('mousemove', this.onMouseMove, true); - this.interactionDOMElement.removeEventListener('mousedown', this.onMouseDown, true); - this.interactionDOMElement.removeEventListener('mouseout', this.onMouseOut, true); - - // aint no multi touch just yet! - this.interactionDOMElement.removeEventListener('touchstart', this.onTouchStart, true); - this.interactionDOMElement.removeEventListener('touchend', this.onTouchEnd, true); - this.interactionDOMElement.removeEventListener('touchleave', this.onTouchCancel, true); - this.interactionDOMElement.removeEventListener('touchcancel', this.onTouchCancel, true); - this.interactionDOMElement.removeEventListener('touchmove', this.onTouchMove, true); - - this.interactionDOMElement = null; - - window.removeEventListener('mouseup', this.onMouseUp, true); -}; - -/** - * updates the state of interactive objects - * - * @method update - * @private - */ -PIXI.InteractionManager.prototype.update = function() -{ - if (!this.target) return; - - // frequency of 30fps?? - var now = Date.now(); - var diff = now - this.last; - diff = (diff * PIXI.INTERACTION_FREQUENCY ) / 1000; - if (diff < 1) return; - this.last = now; - - var i = 0; - - // ok.. so mouse events?? - // yes for now :) - // OPTIMISE - how often to check?? - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - // loop through interactive objects! - var length = this.interactiveItems.length; - var cursor = 'inherit'; - var over = false; - - for (i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - // OPTIMISATION - only calculate every time if the mousemove function exists.. - // OK so.. does the object have any other interactive functions? - // hit-test the clip! - // if (item.mouseover || item.mouseout || item.buttonMode) - // { - // ok so there are some functions so lets hit test it.. - item.__hit = this.hitTest(item, this.mouse); - this.mouse.target = item; - // ok so deal with interactions.. - // looks like there was a hit! - if (item.__hit && !over) - { - if (item.buttonMode) cursor = item.defaultCursor; - - if (!item.interactiveChildren) - { - over = true; - } - - if (!item.__isOver) - { - if (item.mouseover) - { - item.mouseover (this.mouse); - } - item.__isOver = true; - } - } - else - { - if (item.__isOver) - { - // roll out! - if (item.mouseout) - { - item.mouseout (this.mouse); - } - item.__isOver = false; - } - } - } - - if (this.currentCursorStyle !== cursor) - { - this.currentCursorStyle = cursor; - this.interactionDOMElement.style.cursor = cursor; - } -}; - -/** - * @method rebuildInteractiveGraph - * @private - */ -PIXI.InteractionManager.prototype.rebuildInteractiveGraph = function() -{ - this.dirty = false; - - var len = this.interactiveItems.length; - - for (var i = 0; i < len; i++) { - this.interactiveItems[i].interactiveChildren = false; - } - - this.interactiveItems = []; - - if (this.stage.interactive) - { - this.interactiveItems.push(this.stage); - } - - // Go through and collect all the objects that are interactive.. - this.collectInteractiveSprite(this.stage, this.stage); -}; - -/** - * Is called when the mouse moves across the renderer element - * - * @method onMouseMove - * @param event {Event} The DOM event of the mouse moving - * @private - */ -PIXI.InteractionManager.prototype.onMouseMove = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - // TODO optimize by not check EVERY TIME! maybe half as often? // - var rect = this.interactionDOMElement.getBoundingClientRect(); - - this.mouse.global.x = (event.clientX - rect.left) * (this.target.width / rect.width) / this.resolution; - this.mouse.global.y = (event.clientY - rect.top) * ( this.target.height / rect.height) / this.resolution; - - var length = this.interactiveItems.length; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - // Call the function! - if (item.mousemove) - { - item.mousemove(this.mouse); - } - } -}; - -/** - * Is called when the mouse button is pressed down on the renderer element - * - * @method onMouseDown - * @param event {Event} The DOM event of a mouse button being pressed down - * @private - */ -PIXI.InteractionManager.prototype.onMouseDown = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - if (PIXI.AUTO_PREVENT_DEFAULT) - { - this.mouse.originalEvent.preventDefault(); - } - - // loop through interaction tree... - // hit test each item! -> - // get interactive items under point?? - //stage.__i - var length = this.interactiveItems.length; - - var e = this.mouse.originalEvent; - var isRightButton = e.button === 2 || e.which === 3; - var downFunction = isRightButton ? 'rightdown' : 'mousedown'; - var clickFunction = isRightButton ? 'rightclick' : 'click'; - var buttonIsDown = isRightButton ? '__rightIsDown' : '__mouseIsDown'; - var isDown = isRightButton ? '__isRightDown' : '__isDown'; - - // while - // hit test - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - if (item[downFunction] || item[clickFunction]) - { - item[buttonIsDown] = true; - item.__hit = this.hitTest(item, this.mouse); - - if (item.__hit) - { - //call the function! - if (item[downFunction]) - { - item[downFunction](this.mouse); - } - item[isDown] = true; - - // just the one! - if (!item.interactiveChildren) break; - } - } - } -}; - -/** - * Is called when the mouse is moved out of the renderer element - * - * @method onMouseOut - * @param event {Event} The DOM event of a mouse being moved out - * @private - */ -PIXI.InteractionManager.prototype.onMouseOut = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - var length = this.interactiveItems.length; - - this.interactionDOMElement.style.cursor = 'inherit'; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - if (item.__isOver) - { - this.mouse.target = item; - if (item.mouseout) - { - item.mouseout(this.mouse); - } - item.__isOver = false; - } - } - - this.mouseOut = true; - - // move the mouse to an impossible position - this.mouse.global.x = -10000; - this.mouse.global.y = -10000; -}; - -/** - * Is called when the mouse button is released on the renderer element - * - * @method onMouseUp - * @param event {Event} The DOM event of a mouse button being released - * @private - */ -PIXI.InteractionManager.prototype.onMouseUp = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - var length = this.interactiveItems.length; - var up = false; - - var e = this.mouse.originalEvent; - var isRightButton = e.button === 2 || e.which === 3; - - var upFunction = isRightButton ? 'rightup' : 'mouseup'; - var clickFunction = isRightButton ? 'rightclick' : 'click'; - var upOutsideFunction = isRightButton ? 'rightupoutside' : 'mouseupoutside'; - var isDown = isRightButton ? '__isRightDown' : '__isDown'; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - if (item[clickFunction] || item[upFunction] || item[upOutsideFunction]) - { - item.__hit = this.hitTest(item, this.mouse); - - if (item.__hit && !up) - { - //call the function! - if (item[upFunction]) - { - item[upFunction](this.mouse); - } - if (item[isDown]) - { - if (item[clickFunction]) - { - item[clickFunction](this.mouse); - } - } - - if (!item.interactiveChildren) - { - up = true; - } - } - else - { - if (item[isDown]) - { - if (item[upOutsideFunction]) item[upOutsideFunction](this.mouse); - } - } - - item[isDown] = false; - } - } -}; - -/** - * Tests if the current mouse coordinates hit a sprite - * - * @method hitTest - * @param item {DisplayObject} The displayObject to test for a hit - * @param interactionData {InteractionData} The interactionData object to update in the case there is a hit - * @private - */ -PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) -{ - var global = interactionData.global; - - if (!item.worldVisible) - { - return false; - } - - // map the global point to local space. - item.worldTransform.applyInverse(global, this._tempPoint); - - var x = this._tempPoint.x, - y = this._tempPoint.y, - i; - - interactionData.target = item; - - //a sprite or display object with a hit area defined - if (item.hitArea && item.hitArea.contains) - { - return item.hitArea.contains(x, y); - } - // a sprite with no hitarea defined - else if(item instanceof PIXI.Sprite) - { - var width = item.texture.frame.width; - var height = item.texture.frame.height; - var x1 = -width * item.anchor.x; - var y1; - - if (x > x1 && x < x1 + width) - { - y1 = -height * item.anchor.y; - - if (y > y1 && y < y1 + height) - { - // set the target property if a hit is true! - return true; - } - } - } - else if(item instanceof PIXI.Graphics) - { - var graphicsData = item.graphicsData; - for (i = 0; i < graphicsData.length; i++) - { - var data = graphicsData[i]; - if(!data.fill)continue; - - // only deal with fills.. - if(data.shape) - { - if(data.shape.contains(x, y)) - { - //interactionData.target = item; - return true; - } - } - } - } - - var length = item.children.length; - - for (i = 0; i < length; i++) - { - var tempItem = item.children[i]; - var hit = this.hitTest(tempItem, interactionData); - if (hit) - { - // hmm.. TODO SET CORRECT TARGET? - interactionData.target = item; - return true; - } - } - return false; -}; - -/** - * Is called when a touch is moved across the renderer element - * - * @method onTouchMove - * @param event {Event} The DOM event of a touch moving across the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchMove = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - var touchData; - var i = 0; - - for (i = 0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - touchData = this.touches[touchEvent.identifier]; - touchData.originalEvent = event; - - // update the touch position - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - for (var j = 0; j < this.interactiveItems.length; j++) - { - var item = this.interactiveItems[j]; - if (item.touchmove && item.__touchData && item.__touchData[touchEvent.identifier]) - { - item.touchmove(touchData); - } - } - } -}; - -/** - * Is called when a touch is started on the renderer element - * - * @method onTouchStart - * @param event {Event} The DOM event of a touch starting on the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchStart = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - - if (PIXI.AUTO_PREVENT_DEFAULT) - { - event.preventDefault(); - } - - var changedTouches = event.changedTouches; - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - - var touchData = this.pool.pop(); - if (!touchData) - { - touchData = new PIXI.InteractionData(); - } - - touchData.originalEvent = event; - - this.touches[touchEvent.identifier] = touchData; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.touchstart || item.tap) - { - item.__hit = this.hitTest(item, touchData); - - if (item.__hit) - { - //call the function! - if (item.touchstart)item.touchstart(touchData); - item.__isDown = true; - item.__touchData = item.__touchData || {}; - item.__touchData[touchEvent.identifier] = touchData; - - if (!item.interactiveChildren) break; - } - } - } - } -}; - -/** - * Is called when a touch is ended on the renderer element - * - * @method onTouchEnd - * @param event {Event} The DOM event of a touch ending on the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchEnd = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - var touchData = this.touches[touchEvent.identifier]; - var up = false; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.__touchData && item.__touchData[touchEvent.identifier]) - { - - item.__hit = this.hitTest(item, item.__touchData[touchEvent.identifier]); - - // so this one WAS down... - touchData.originalEvent = event; - // hitTest?? - - if (item.touchend || item.tap) - { - if (item.__hit && !up) - { - if (item.touchend) - { - item.touchend(touchData); - } - if (item.__isDown && item.tap) - { - item.tap(touchData); - } - if (!item.interactiveChildren) - { - up = true; - } - } - else - { - if (item.__isDown && item.touchendoutside) - { - item.touchendoutside(touchData); - } - } - - item.__isDown = false; - } - - item.__touchData[touchEvent.identifier] = null; - } - } - // remove the touch.. - this.pool.push(touchData); - this.touches[touchEvent.identifier] = null; - } -}; - -/** - * Is called when a touch is canceled - * - * @method onTouchCancel - * @param event {Event} The DOM event of a touch canceled - * @private - */ -PIXI.InteractionManager.prototype.onTouchCancel = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - var touchData = this.touches[touchEvent.identifier]; - var up = false; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.__touchData && item.__touchData[touchEvent.identifier]) - { - - item.__hit = this.hitTest(item, item.__touchData[touchEvent.identifier]); - - // so this one WAS down... - touchData.originalEvent = event; - // hitTest?? - - if (item.touchcancel && !up) - { - item.touchcancel(touchData); - if (!item.interactiveChildren) - { - up = true; - } - } - - item.__isDown = false; - item.__touchData[touchEvent.identifier] = null; - } - } - // remove the touch.. - this.pool.push(touchData); - this.touches[touchEvent.identifier] = null; - } -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A Stage represents the root of the display tree. Everything connected to the stage is rendered - * - * @class Stage - * @extends DisplayObjectContainer - * @constructor - * @param backgroundColor {Number} the background color of the stage, you have to pass this in is in hex format - * like: 0xFFFFFF for white - * - * Creating a stage is a mandatory process when you use Pixi, which is as simple as this : - * var stage = new PIXI.Stage(0xFFFFFF); - * where the parameter given is the background colour of the stage, in hex - * you will use this stage instance to add your sprites to it and therefore to the renderer - * Here is how to add a sprite to the stage : - * stage.addChild(sprite); - */ -PIXI.Stage = function(backgroundColor) -{ - PIXI.DisplayObjectContainer.call( this ); - - /** - * [read-only] Current transform of the object based on world (parent) factors - * - * @property worldTransform - * @type Matrix - * @readOnly - * @private - */ - this.worldTransform = new PIXI.Matrix(); - - /** - * Whether or not the stage is interactive - * - * @property interactive - * @type Boolean - */ - this.interactive = true; - - /** - * The interaction manage for this stage, manages all interactive activity on the stage - * - * @property interactionManager - * @type InteractionManager - */ - this.interactionManager = new PIXI.InteractionManager(this); - - /** - * Whether the stage is dirty and needs to have interactions updated - * - * @property dirty - * @type Boolean - * @private - */ - this.dirty = true; - - //the stage is its own stage - this.stage = this; - - //optimize hit detection a bit - this.stage.hitArea = new PIXI.Rectangle(0, 0, 100000, 100000); - - this.setBackgroundColor(backgroundColor); -}; - -// constructor -PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); -PIXI.Stage.prototype.constructor = PIXI.Stage; - -/** - * Sets another DOM element which can receive mouse/touch interactions instead of the default Canvas element. - * This is useful for when you have other DOM elements on top of the Canvas element. - * - * @method setInteractionDelegate - * @param domElement {DOMElement} This new domElement which will receive mouse/touch events - */ -PIXI.Stage.prototype.setInteractionDelegate = function(domElement) -{ - this.interactionManager.setTargetDomElement( domElement ); -}; - -/* - * Updates the object transform for rendering - * - * @method updateTransform - * @private - */ -PIXI.Stage.prototype.updateTransform = function() -{ - this.worldAlpha = 1; - - for(var i=0,j=this.children.length; i> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255]; -}; - -/** - * Converts a color as an [R, G, B] array to a hex number - * - * @method rgb2hex - * @param rgb {Array} - */ -PIXI.rgb2hex = function(rgb) { - return ((rgb[0]*255 << 16) + (rgb[1]*255 << 8) + rgb[2]*255); -}; - -/** - * A polyfill for Function.prototype.bind - * - * @method bind - */ -if (typeof Function.prototype.bind !== 'function') { - Function.prototype.bind = (function () { - return function (thisArg) { - var target = this, i = arguments.length - 1, boundArgs = []; - if (i > 0) - { - boundArgs.length = i; - while (i--) boundArgs[i] = arguments[i + 1]; - } - - if (typeof target !== 'function') throw new TypeError(); - - function bound() { - var i = arguments.length, args = new Array(i); - while (i--) args[i] = arguments[i]; - args = boundArgs.concat(args); - return target.apply(this instanceof bound ? this : thisArg, args); - } - - bound.prototype = (function F(proto) { - if (proto) F.prototype = proto; - if (!(this instanceof F)) return new F(); - })(target.prototype); - - return bound; - }; - })(); -} - -/** - * A wrapper for ajax requests to be handled cross browser - * - * @class AjaxRequest - * @constructor - */ -PIXI.AjaxRequest = function() -{ - var activexmodes = ['Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.3.0', 'Microsoft.XMLHTTP']; //activeX versions to check for in IE - - if (window.ActiveXObject) - { //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken) - for (var i=0; i 0 && (number & (number - 1)) === 0) // see: http://goo.gl/D9kPj - return number; - else - { - var result = 1; - while (result < number) result <<= 1; - return result; - } -}; - -/** - * checks if the given width and height make a power of two texture - * @method isPowerOfTwo - * @param width {Number} - * @param height {Number} - * @return {Boolean} - */ -PIXI.isPowerOfTwo = function(width, height) -{ - return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0); - -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * @author Chad Engler https://github.com/englercj @Rolnaaba - */ - -/** - * Originally based on https://github.com/mrdoob/eventtarget.js/ from mr Doob. - * Currently takes inspiration from the nodejs EventEmitter, EventEmitter3, and smokesignals - */ - -/** - * Mixins event emitter functionality to a class - * - * @class EventTarget - * @example - * function MyEmitter() {} - * - * PIXI.EventTarget.mixin(MyEmitter.prototype); - * - * var em = new MyEmitter(); - * em.emit('eventName', 'some data', 'some more data', {}, null, ...); - */ -PIXI.EventTarget = { - /** - * Backward compat from when this used to be a function - */ - call: function callCompat(obj) { - if(obj) { - obj = obj.prototype || obj; - PIXI.EventTarget.mixin(obj); - } - }, - - /** - * Mixes in the properties of the EventTarget prototype onto another object - * - * @method mixin - * @param object {Object} The obj to mix into - */ - mixin: function mixin(obj) { - /** - * Return a list of assigned event listeners. - * - * @method listeners - * @param eventName {String} The events that should be listed. - * @return {Array} An array of listener functions - */ - obj.listeners = function listeners(eventName) { - this._listeners = this._listeners || {}; - - return this._listeners[eventName] ? this._listeners[eventName].slice() : []; - }; - - /** - * Emit an event to all registered event listeners. - * - * @method emit - * @alias dispatchEvent - * @param eventName {String} The name of the event. - * @return {Boolean} Indication if we've emitted an event. - */ - obj.emit = obj.dispatchEvent = function emit(eventName, data) { - this._listeners = this._listeners || {}; - - //backwards compat with old method ".emit({ type: 'something' })" - if(typeof eventName === 'object') { - data = eventName; - eventName = eventName.type; - } - - //ensure we are using a real pixi event - if(!data || data.__isEventObject !== true) { - data = new PIXI.Event(this, eventName, data); - } - - //iterate the listeners - if(this._listeners && this._listeners[eventName]) { - var listeners = this._listeners[eventName].slice(0), - length = listeners.length, - fn = listeners[0], - i; - - for(i = 0; i < length; fn = listeners[++i]) { - //call the event listener - fn.call(this, data); - - //if "stopImmediatePropagation" is called, stop calling sibling events - if(data.stoppedImmediate) { - return this; - } - } - - //if "stopPropagation" is called then don't bubble the event - if(data.stopped) { - return this; - } - } - - //bubble this event up the scene graph - if(this.parent && this.parent.emit) { - this.parent.emit.call(this.parent, eventName, data); - } - - return this; - }; - - /** - * Register a new EventListener for the given event. - * - * @method on - * @alias addEventListener - * @param eventName {String} Name of the event. - * @param callback {Functon} fn Callback function. - */ - obj.on = obj.addEventListener = function on(eventName, fn) { - this._listeners = this._listeners || {}; - - (this._listeners[eventName] = this._listeners[eventName] || []) - .push(fn); - - return this; - }; - - /** - * Add an EventListener that's only called once. - * - * @method once - * @param eventName {String} Name of the event. - * @param callback {Function} Callback function. - */ - obj.once = function once(eventName, fn) { - this._listeners = this._listeners || {}; - - var self = this; - function onceHandlerWrapper() { - fn.apply(self.off(eventName, onceHandlerWrapper), arguments); - } - onceHandlerWrapper._originalHandler = fn; - - return this.on(eventName, onceHandlerWrapper); - }; - - /** - * Remove event listeners. - * - * @method off - * @alias removeEventListener - * @param eventName {String} The event we want to remove. - * @param callback {Function} The listener that we need to find. - */ - obj.off = obj.removeEventListener = function off(eventName, fn) { - this._listeners = this._listeners || {}; - - if(!this._listeners[eventName]) - return this; - - var list = this._listeners[eventName], - i = fn ? list.length : 0; - - while(i-- > 0) { - if(list[i] === fn || list[i]._originalHandler === fn) { - list.splice(i, 1); - } - } - - if(list.length === 0) { - delete this._listeners[eventName]; - } - - return this; - }; - - /** - * Remove all listeners or only the listeners for the specified event. - * - * @method removeAllListeners - * @param eventName {String} The event you want to remove all listeners for. - */ - obj.removeAllListeners = function removeAllListeners(eventName) { - this._listeners = this._listeners || {}; - - if(!this._listeners[eventName]) - return this; - - delete this._listeners[eventName]; - - return this; - }; - } -}; - -/** - * Creates an homogenous object for tracking events so users can know what to expect. - * - * @class Event - * @extends Object - * @constructor - * @param target {Object} The target object that the event is called on - * @param name {String} The string name of the event that was triggered - * @param data {Object} Arbitrary event data to pass along - */ -PIXI.Event = function(target, name, data) { - //for duck typing in the ".on()" function - this.__isEventObject = true; - - /** - * Tracks the state of bubbling propagation. Do not - * set this directly, instead use `event.stopPropagation()` - * - * @property stopped - * @type Boolean - * @private - * @readOnly - */ - this.stopped = false; - - /** - * Tracks the state of sibling listener propagation. Do not - * set this directly, instead use `event.stopImmediatePropagation()` - * - * @property stoppedImmediate - * @type Boolean - * @private - * @readOnly - */ - this.stoppedImmediate = false; - - /** - * The original target the event triggered on. - * - * @property target - * @type Object - * @readOnly - */ - this.target = target; - - /** - * The string name of the event that this represents. - * - * @property type - * @type String - * @readOnly - */ - this.type = name; - - /** - * The data that was passed in with this event. - * - * @property data - * @type Object - * @readOnly - */ - this.data = data; - - //backwards compat with older version of events - this.content = data; - - /** - * The timestamp when the event occurred. - * - * @property timeStamp - * @type Number - * @readOnly - */ - this.timeStamp = Date.now(); -}; - -/** - * Stops the propagation of events up the scene graph (prevents bubbling). - * - * @method stopPropagation - */ -PIXI.Event.prototype.stopPropagation = function stopPropagation() { - this.stopped = true; -}; - -/** - * Stops the propagation of events to sibling listeners (no longer calls any listeners). - * - * @method stopImmediatePropagation - */ -PIXI.Event.prototype.stopImmediatePropagation = function stopImmediatePropagation() { - this.stoppedImmediate = true; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This helper function will automatically detect which renderer you should be using. - * WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by - * the browser then this function will return a canvas renderer - * - * @method autoDetectRenderer - * @for PIXI - * @static - * @param width=800 {Number} the width of the renderers view - * @param height=600 {Number} the height of the renderers view - * - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * - */ -PIXI.autoDetectRenderer = function(width, height, options) -{ - if(!width)width = 800; - if(!height)height = 600; - - // BORROWED from Mr Doob (mrdoob.com) - var webgl = ( function () { try { - var canvas = document.createElement( 'canvas' ); - return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ); - } catch( e ) { - return false; - } - } )(); - - if( webgl ) - { - return new PIXI.WebGLRenderer(width, height, options); - } - - return new PIXI.CanvasRenderer(width, height, options); -}; - -/** - * This helper function will automatically detect which renderer you should be using. - * This function is very similar to the autoDetectRenderer function except that is will return a canvas renderer for android. - * Even thought both android chrome supports webGL the canvas implementation perform better at the time of writing. - * This function will likely change and update as webGL performance improves on these devices. - * - * @method autoDetectRecommendedRenderer - * @for PIXI - * @static - * @param width=800 {Number} the width of the renderers view - * @param height=600 {Number} the height of the renderers view - * - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * - */ -PIXI.autoDetectRecommendedRenderer = function(width, height, options) -{ - if(!width)width = 800; - if(!height)height = 600; - - // BORROWED from Mr Doob (mrdoob.com) - var webgl = ( function () { try { - var canvas = document.createElement( 'canvas' ); - return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ); - } catch( e ) { - return false; - } - } )(); - - var isAndroid = /Android/i.test(navigator.userAgent); - - if( webgl && !isAndroid) - { - return new PIXI.WebGLRenderer(width, height, options); - } - - return new PIXI.CanvasRenderer(width, height, options); -}; - -/* - PolyK library - url: http://polyk.ivank.net - Released under MIT licence. - - Copyright (c) 2012 Ivan Kuckir - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation - files (the "Software"), to deal in the Software without - restriction, including without limitation the rights to use, - copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following - conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. - - This is an amazing lib! - - Slightly modified by Mat Groves (matgroves.com); -*/ - -/** - * Based on the Polyk library http://polyk.ivank.net released under MIT licence. - * This is an amazing lib! - * Slightly modified by Mat Groves (matgroves.com); - * @class PolyK - */ -PIXI.PolyK = {}; - -/** - * Triangulates shapes for webGL graphic fills. - * - * @method Triangulate - */ -PIXI.PolyK.Triangulate = function(p) -{ - var sign = true; - - var n = p.length >> 1; - if(n < 3) return []; - - var tgs = []; - var avl = []; - for(var i = 0; i < n; i++) avl.push(i); - - i = 0; - var al = n; - while(al > 3) - { - var i0 = avl[(i+0)%al]; - var i1 = avl[(i+1)%al]; - var i2 = avl[(i+2)%al]; - - var ax = p[2*i0], ay = p[2*i0+1]; - var bx = p[2*i1], by = p[2*i1+1]; - var cx = p[2*i2], cy = p[2*i2+1]; - - var earFound = false; - if(PIXI.PolyK._convex(ax, ay, bx, by, cx, cy, sign)) - { - earFound = true; - for(var j = 0; j < al; j++) - { - var vi = avl[j]; - if(vi === i0 || vi === i1 || vi === i2) continue; - - if(PIXI.PolyK._PointInTriangle(p[2*vi], p[2*vi+1], ax, ay, bx, by, cx, cy)) { - earFound = false; - break; - } - } - } - - if(earFound) - { - tgs.push(i0, i1, i2); - avl.splice((i+1)%al, 1); - al--; - i = 0; - } - else if(i++ > 3*al) - { - // need to flip flip reverse it! - // reset! - if(sign) - { - tgs = []; - avl = []; - for(i = 0; i < n; i++) avl.push(i); - - i = 0; - al = n; - - sign = false; - } - else - { - // window.console.log("PIXI Warning: shape too complex to fill"); - return null; - } - } - } - - tgs.push(avl[0], avl[1], avl[2]); - return tgs; -}; - -/** - * Checks whether a point is within a triangle - * - * @method _PointInTriangle - * @param px {Number} x coordinate of the point to test - * @param py {Number} y coordinate of the point to test - * @param ax {Number} x coordinate of the a point of the triangle - * @param ay {Number} y coordinate of the a point of the triangle - * @param bx {Number} x coordinate of the b point of the triangle - * @param by {Number} y coordinate of the b point of the triangle - * @param cx {Number} x coordinate of the c point of the triangle - * @param cy {Number} y coordinate of the c point of the triangle - * @private - * @return {Boolean} - */ -PIXI.PolyK._PointInTriangle = function(px, py, ax, ay, bx, by, cx, cy) -{ - var v0x = cx-ax; - var v0y = cy-ay; - var v1x = bx-ax; - var v1y = by-ay; - var v2x = px-ax; - var v2y = py-ay; - - var dot00 = v0x*v0x+v0y*v0y; - var dot01 = v0x*v1x+v0y*v1y; - var dot02 = v0x*v2x+v0y*v2y; - var dot11 = v1x*v1x+v1y*v1y; - var dot12 = v1x*v2x+v1y*v2y; - - var invDenom = 1 / (dot00 * dot11 - dot01 * dot01); - var u = (dot11 * dot02 - dot01 * dot12) * invDenom; - var v = (dot00 * dot12 - dot01 * dot02) * invDenom; - - // Check if point is in triangle - return (u >= 0) && (v >= 0) && (u + v < 1); -}; - -/** - * Checks whether a shape is convex - * - * @method _convex - * @private - * @return {Boolean} - */ -PIXI.PolyK._convex = function(ax, ay, bx, by, cx, cy, sign) -{ - return ((ay-by)*(cx-bx) + (bx-ax)*(cy-by) >= 0) === sign; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @method initDefaultShaders -* @static -* @private -*/ -PIXI.initDefaultShaders = function() -{ -}; - -/** -* @method CompileVertexShader -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @return {Any} -*/ -PIXI.CompileVertexShader = function(gl, shaderSrc) -{ - return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER); -}; - -/** -* @method CompileFragmentShader -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @return {Any} -*/ -PIXI.CompileFragmentShader = function(gl, shaderSrc) -{ - return PIXI._CompileShader(gl, shaderSrc, gl.FRAGMENT_SHADER); -}; - -/** -* @method _CompileShader -* @static -* @private -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @param shaderType {Number} -* @return {Any} -*/ -PIXI._CompileShader = function(gl, shaderSrc, shaderType) -{ - var src = shaderSrc.join("\n"); - var shader = gl.createShader(shaderType); - gl.shaderSource(shader, src); - gl.compileShader(shader); - - if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) - { - window.console.log(gl.getShaderInfoLog(shader)); - return null; - } - - return shader; -}; - -/** -* @method compileProgram -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param vertexSrc {Array} -* @param fragmentSrc {Array} -* @return {Any} -*/ -PIXI.compileProgram = function(gl, vertexSrc, fragmentSrc) -{ - var fragmentShader = PIXI.CompileFragmentShader(gl, fragmentSrc); - var vertexShader = PIXI.CompileVertexShader(gl, vertexSrc); - - var shaderProgram = gl.createProgram(); - - gl.attachShader(shaderProgram, vertexShader); - gl.attachShader(shaderProgram, fragmentShader); - gl.linkProgram(shaderProgram); - - if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) - { - window.console.log("Could not initialise shaders"); - } - - return shaderProgram; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * @author Richard Davey http://www.photonstorm.com @photonstorm - */ - -/** -* @class PixiShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PixiShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]; - - /** - * A local texture counter for multi-texture shaders. - * @property textureCount - * @type Number - */ - this.textureCount = 0; - - /** - * A local flag - * @property firstRun - * @type Boolean - * @private - */ - this.firstRun = true; - - /** - * A dirty flag - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * Uniform attributes cache. - * @property attributes - * @type Array - * @private - */ - this.attributes = []; - - this.init(); -}; - -PIXI.PixiShader.prototype.constructor = PIXI.PixiShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PixiShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc || PIXI.PixiShader.defaultVertexSrc, this.fragmentSrc); - - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.dimensions = gl.getUniformLocation(program, 'dimensions'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - // Begin worst hack eva // - - // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? - // maybe its something to do with the current state of the gl context. - // I'm convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel - // If theres any webGL people that know why could happen please help :) - if(this.colorAttribute === -1) - { - this.colorAttribute = 2; - } - - this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute]; - - // End worst hack eva // - - // add those custom shaders! - for (var key in this.uniforms) - { - // get the uniform locations.. - this.uniforms[key].uniformLocation = gl.getUniformLocation(program, key); - } - - this.initUniforms(); - - this.program = program; -}; - -/** -* Initialises the shader uniform values. -* -* Uniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/ -* http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf -* -* @method initUniforms -*/ -PIXI.PixiShader.prototype.initUniforms = function() -{ - this.textureCount = 1; - var gl = this.gl; - var uniform; - - for (var key in this.uniforms) - { - uniform = this.uniforms[key]; - - var type = uniform.type; - - if (type === 'sampler2D') - { - uniform._init = false; - - if (uniform.value !== null) - { - this.initSampler2D(uniform); - } - } - else if (type === 'mat2' || type === 'mat3' || type === 'mat4') - { - // These require special handling - uniform.glMatrix = true; - uniform.glValueLength = 1; - - if (type === 'mat2') - { - uniform.glFunc = gl.uniformMatrix2fv; - } - else if (type === 'mat3') - { - uniform.glFunc = gl.uniformMatrix3fv; - } - else if (type === 'mat4') - { - uniform.glFunc = gl.uniformMatrix4fv; - } - } - else - { - // GL function reference - uniform.glFunc = gl['uniform' + type]; - - if (type === '2f' || type === '2i') - { - uniform.glValueLength = 2; - } - else if (type === '3f' || type === '3i') - { - uniform.glValueLength = 3; - } - else if (type === '4f' || type === '4i') - { - uniform.glValueLength = 4; - } - else - { - uniform.glValueLength = 1; - } - } - } - -}; - -/** -* Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded) -* -* @method initSampler2D -*/ -PIXI.PixiShader.prototype.initSampler2D = function(uniform) -{ - if (!uniform.value || !uniform.value.baseTexture || !uniform.value.baseTexture.hasLoaded) - { - return; - } - - var gl = this.gl; - - gl.activeTexture(gl['TEXTURE' + this.textureCount]); - gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]); - - // Extended texture data - if (uniform.textureData) - { - var data = uniform.textureData; - - // GLTexture = mag linear, min linear_mipmap_linear, wrap repeat + gl.generateMipmap(gl.TEXTURE_2D); - // GLTextureLinear = mag/min linear, wrap clamp - // GLTextureNearestRepeat = mag/min NEAREST, wrap repeat - // GLTextureNearest = mag/min nearest, wrap clamp - // AudioTexture = whatever + luminance + width 512, height 2, border 0 - // KeyTexture = whatever + luminance + width 256, height 2, border 0 - - // magFilter can be: gl.LINEAR, gl.LINEAR_MIPMAP_LINEAR or gl.NEAREST - // wrapS/T can be: gl.CLAMP_TO_EDGE or gl.REPEAT - - var magFilter = (data.magFilter) ? data.magFilter : gl.LINEAR; - var minFilter = (data.minFilter) ? data.minFilter : gl.LINEAR; - var wrapS = (data.wrapS) ? data.wrapS : gl.CLAMP_TO_EDGE; - var wrapT = (data.wrapT) ? data.wrapT : gl.CLAMP_TO_EDGE; - var format = (data.luminance) ? gl.LUMINANCE : gl.RGBA; - - if (data.repeat) - { - wrapS = gl.REPEAT; - wrapT = gl.REPEAT; - } - - gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, !!data.flipY); - - if (data.width) - { - var width = (data.width) ? data.width : 512; - var height = (data.height) ? data.height : 2; - var border = (data.border) ? data.border : 0; - - // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels); - gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, border, format, gl.UNSIGNED_BYTE, null); - } - else - { - // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, ImageData? pixels); - gl.texImage2D(gl.TEXTURE_2D, 0, format, gl.RGBA, gl.UNSIGNED_BYTE, uniform.value.baseTexture.source); - } - - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrapS); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT); - } - - gl.uniform1i(uniform.uniformLocation, this.textureCount); - - uniform._init = true; - - this.textureCount++; - -}; - -/** -* Updates the shader uniform values. -* -* @method syncUniforms -*/ -PIXI.PixiShader.prototype.syncUniforms = function() -{ - this.textureCount = 1; - var uniform; - var gl = this.gl; - - // This would probably be faster in an array and it would guarantee key order - for (var key in this.uniforms) - { - uniform = this.uniforms[key]; - - if (uniform.glValueLength === 1) - { - if (uniform.glMatrix === true) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.transpose, uniform.value); - } - else - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value); - } - } - else if (uniform.glValueLength === 2) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y); - } - else if (uniform.glValueLength === 3) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z); - } - else if (uniform.glValueLength === 4) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z, uniform.value.w); - } - else if (uniform.type === 'sampler2D') - { - if (uniform._init) - { - gl.activeTexture(gl['TEXTURE' + this.textureCount]); - - if(uniform.value.baseTexture._dirty[gl.id]) - { - PIXI.instances[gl.id].updateTexture(uniform.value.baseTexture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]); - } - - // gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id] || PIXI.createWebGLTexture( uniform.value.baseTexture, gl)); - gl.uniform1i(uniform.uniformLocation, this.textureCount); - this.textureCount++; - } - else - { - this.initSampler2D(uniform); - } - } - } - -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PixiShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; - -/** -* The Default Vertex shader source. -* -* @property defaultVertexSrc -* @type String -*/ -PIXI.PixiShader.defaultVertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aTextureCoord;', - 'attribute vec4 aColor;', - - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - - 'const vec2 center = vec2(-1.0, 1.0);', - - 'void main(void) {', - ' gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - ' vColor = vec4(aColor.rgb * aColor.a, aColor.a);', - '}' -]; -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class PixiFastShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PixiFastShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying float vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aPositionCoord;', - 'attribute vec2 aScale;', - 'attribute float aRotation;', - 'attribute vec2 aTextureCoord;', - 'attribute float aColor;', - - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - 'uniform mat3 uMatrix;', - - 'varying vec2 vTextureCoord;', - 'varying float vColor;', - - 'const vec2 center = vec2(-1.0, 1.0);', - - 'void main(void) {', - ' vec2 v;', - ' vec2 sv = aVertexPosition * aScale;', - ' v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);', - ' v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);', - ' v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;', - ' gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - // ' vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;', - ' vColor = aColor;', - '}' - ]; - - /** - * A local texture counter for multi-texture shaders. - * @property textureCount - * @type Number - */ - this.textureCount = 0; - - this.init(); -}; - -PIXI.PixiFastShader.prototype.constructor = PIXI.PixiFastShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PixiFastShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.dimensions = gl.getUniformLocation(program, 'dimensions'); - this.uMatrix = gl.getUniformLocation(program, 'uMatrix'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aPositionCoord = gl.getAttribLocation(program, 'aPositionCoord'); - - this.aScale = gl.getAttribLocation(program, 'aScale'); - this.aRotation = gl.getAttribLocation(program, 'aRotation'); - - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - // Begin worst hack eva // - - // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? - // maybe its somthing to do with the current state of the gl context. - // Im convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel - // If theres any webGL people that know why could happen please help :) - if(this.colorAttribute === -1) - { - this.colorAttribute = 2; - } - - this.attributes = [this.aVertexPosition, this.aPositionCoord, this.aScale, this.aRotation, this.aTextureCoord, this.colorAttribute]; - - // End worst hack eva // - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PixiFastShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class StripShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.StripShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - // 'varying float vColor;', - 'uniform float alpha;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * alpha;', - // ' gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);',//gl_FragColor * alpha;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aTextureCoord;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - // 'uniform float alpha;', - // 'uniform vec3 tint;', - 'varying vec2 vTextureCoord;', - // 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - // ' vColor = aColor * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.StripShader.prototype.constructor = PIXI.StripShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.StripShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - //this.dimensions = gl.getUniformLocation(this.program, 'dimensions'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - - this.attributes = [this.aVertexPosition, this.aTextureCoord]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.StripShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attribute = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class PrimitiveShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PrimitiveShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' gl_FragColor = vColor;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec4 aColor;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - 'uniform float alpha;', - 'uniform float flipY;', - 'uniform vec3 tint;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);', - ' vColor = aColor * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.PrimitiveShader.prototype.constructor = PIXI.PrimitiveShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PrimitiveShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.tintColor = gl.getUniformLocation(program, 'tint'); - this.flipY = gl.getUniformLocation(program, 'flipY'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - this.attributes = [this.aVertexPosition, this.colorAttribute]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PrimitiveShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class ComplexPrimitiveShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.ComplexPrimitiveShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - - 'precision mediump float;', - - 'varying vec4 vColor;', - - 'void main(void) {', - ' gl_FragColor = vColor;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - //'attribute vec4 aColor;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - - 'uniform vec3 tint;', - 'uniform float alpha;', - 'uniform vec3 color;', - 'uniform float flipY;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);', - ' vColor = vec4(color * alpha * tint, alpha);',//" * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.ComplexPrimitiveShader.prototype.constructor = PIXI.ComplexPrimitiveShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.ComplexPrimitiveShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.tintColor = gl.getUniformLocation(program, 'tint'); - this.color = gl.getUniformLocation(program, 'color'); - this.flipY = gl.getUniformLocation(program, 'flipY'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - // this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - this.attributes = [this.aVertexPosition, this.colorAttribute]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.ComplexPrimitiveShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attribute = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A set of functions used by the webGL renderer to draw the primitive graphics data - * - * @class WebGLGraphics - * @private - * @static - */ -PIXI.WebGLGraphics = function() -{ -}; - -/** - * Renders the graphics object - * - * @static - * @private - * @method renderGraphics - * @param graphics {Graphics} - * @param renderSession {Object} - */ -PIXI.WebGLGraphics.renderGraphics = function(graphics, renderSession)//projection, offset) -{ - var gl = renderSession.gl; - var projection = renderSession.projection, - offset = renderSession.offset, - shader = renderSession.shaderManager.primitiveShader, - webGLData; - - if(graphics.dirty) - { - PIXI.WebGLGraphics.updateGraphics(graphics, gl); - } - - var webGL = graphics._webGL[gl.id]; - - // This could be speeded up for sure! - - for (var i = 0; i < webGL.data.length; i++) - { - if(webGL.data[i].mode === 1) - { - webGLData = webGL.data[i]; - - renderSession.stencilManager.pushStencil(graphics, webGLData, renderSession); - - // render quad.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - renderSession.stencilManager.popStencil(graphics, webGLData, renderSession); - } - else - { - webGLData = webGL.data[i]; - - - renderSession.shaderManager.setShader( shader );//activatePrimitiveShader(); - shader = renderSession.shaderManager.primitiveShader; - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform1f(shader.flipY, 1); - - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - - gl.uniform1f(shader.alpha, graphics.worldAlpha); - - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0); - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4); - - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - } - } -}; - -/** - * Updates the graphics object - * - * @static - * @private - * @method updateGraphics - * @param graphicsData {Graphics} The graphics object to update - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLGraphics.updateGraphics = function(graphics, gl) -{ - // get the contexts graphics object - var webGL = graphics._webGL[gl.id]; - // if the graphics object does not exist in the webGL context time to create it! - if(!webGL)webGL = graphics._webGL[gl.id] = {lastIndex:0, data:[], gl:gl}; - - // flag the graphics as not dirty as we are about to update it... - graphics.dirty = false; - - var i; - - // if the user cleared the graphics object we will need to clear every object - if(graphics.clearDirty) - { - graphics.clearDirty = false; - - // lop through and return all the webGLDatas to the object pool so than can be reused later on - for (i = 0; i < webGL.data.length; i++) - { - var graphicsData = webGL.data[i]; - graphicsData.reset(); - PIXI.WebGLGraphics.graphicsDataPool.push( graphicsData ); - } - - // clear the array and reset the index.. - webGL.data = []; - webGL.lastIndex = 0; - } - - var webGLData; - - // loop through the graphics datas and construct each one.. - // if the object is a complex fill then the new stencil buffer technique will be used - // other wise graphics objects will be pushed into a batch.. - for (i = webGL.lastIndex; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - - if(data.type === PIXI.Graphics.POLY) - { - // need to add the points the the graphics object.. - data.points = data.shape.points.slice(); - if(data.shape.closed) - { - // close the poly if the value is true! - if(data.points[0] !== data.points[data.points.length-2] || data.points[1] !== data.points[data.points.length-1]) - { - data.points.push(data.points[0], data.points[1]); - } - } - - // MAKE SURE WE HAVE THE CORRECT TYPE.. - if(data.fill) - { - if(data.points.length >= 6) - { - if(data.points.length < 6 * 2) - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - - var canDrawUsingSimple = PIXI.WebGLGraphics.buildPoly(data, webGLData); - // console.log(canDrawUsingSimple); - - if(!canDrawUsingSimple) - { - // console.log("<>>>") - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1); - PIXI.WebGLGraphics.buildComplexPoly(data, webGLData); - } - - } - else - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1); - PIXI.WebGLGraphics.buildComplexPoly(data, webGLData); - } - } - } - - if(data.lineWidth > 0) - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - PIXI.WebGLGraphics.buildLine(data, webGLData); - - } - } - else - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - - if(data.type === PIXI.Graphics.RECT) - { - PIXI.WebGLGraphics.buildRectangle(data, webGLData); - } - else if(data.type === PIXI.Graphics.CIRC || data.type === PIXI.Graphics.ELIP) - { - PIXI.WebGLGraphics.buildCircle(data, webGLData); - } - else if(data.type === PIXI.Graphics.RREC) - { - PIXI.WebGLGraphics.buildRoundedRectangle(data, webGLData); - } - } - - webGL.lastIndex++; - } - - // upload all the dirty data... - for (i = 0; i < webGL.data.length; i++) - { - webGLData = webGL.data[i]; - if(webGLData.dirty)webGLData.upload(); - } -}; - -/** - * @static - * @private - * @method switchMode - * @param webGL {WebGLContext} - * @param type {Number} - */ -PIXI.WebGLGraphics.switchMode = function(webGL, type) -{ - var webGLData; - - if(!webGL.data.length) - { - webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl); - webGLData.mode = type; - webGL.data.push(webGLData); - } - else - { - webGLData = webGL.data[webGL.data.length-1]; - - if(webGLData.mode !== type || type === 1) - { - webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl); - webGLData.mode = type; - webGL.data.push(webGLData); - } - } - - webGLData.dirty = true; - - return webGLData; -}; - -/** - * Builds a rectangle to draw - * - * @static - * @private - * @method buildRectangle - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildRectangle = function(graphicsData, webGLData) -{ - // --- // - // need to convert points to a nice regular data - // - var rectData = graphicsData.shape; - var x = rectData.x; - var y = rectData.y; - var width = rectData.width; - var height = rectData.height; - - if(graphicsData.fill) - { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vertPos = verts.length/6; - - // start - verts.push(x, y); - verts.push(r, g, b, alpha); - - verts.push(x + width, y); - verts.push(r, g, b, alpha); - - verts.push(x , y + height); - verts.push(r, g, b, alpha); - - verts.push(x + width, y + height); - verts.push(r, g, b, alpha); - - // insert 2 dead triangles.. - indices.push(vertPos, vertPos, vertPos+1, vertPos+2, vertPos+3, vertPos+3); - } - - if(graphicsData.lineWidth) - { - var tempPoints = graphicsData.points; - - graphicsData.points = [x, y, - x + width, y, - x + width, y + height, - x, y + height, - x, y]; - - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Builds a rounded rectangle to draw - * - * @static - * @private - * @method buildRoundedRectangle - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildRoundedRectangle = function(graphicsData, webGLData) -{ - var rrectData = graphicsData.shape; - var x = rrectData.x; - var y = rrectData.y; - var width = rrectData.width; - var height = rrectData.height; - - var radius = rrectData.radius; - - var recPoints = []; - recPoints.push(x, y + radius); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x, y + height - radius, x, y + height, x + radius, y + height)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width, y + radius, x + width, y, x + width - radius, y)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + radius, y, x, y, x, y + radius)); - - if (graphicsData.fill) { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vecPos = verts.length/6; - - var triangles = PIXI.PolyK.Triangulate(recPoints); - - // - - var i = 0; - for (i = 0; i < triangles.length; i+=3) - { - indices.push(triangles[i] + vecPos); - indices.push(triangles[i] + vecPos); - indices.push(triangles[i+1] + vecPos); - indices.push(triangles[i+2] + vecPos); - indices.push(triangles[i+2] + vecPos); - } - - - for (i = 0; i < recPoints.length; i++) - { - verts.push(recPoints[i], recPoints[++i], r, g, b, alpha); - } - } - - if (graphicsData.lineWidth) { - var tempPoints = graphicsData.points; - - graphicsData.points = recPoints; - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Calculate the points for a quadratic bezier curve. (helper function..) - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c - * - * @static - * @private - * @method quadraticBezierCurve - * @param fromX {Number} Origin point x - * @param fromY {Number} Origin point x - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Array(Number)} - */ -PIXI.WebGLGraphics.quadraticBezierCurve = function(fromX, fromY, cpX, cpY, toX, toY) { - - var xa, - ya, - xb, - yb, - x, - y, - n = 20, - points = []; - - function getPt(n1 , n2, perc) { - var diff = n2 - n1; - - return n1 + ( diff * perc ); - } - - var j = 0; - for (var i = 0; i <= n; i++ ) - { - j = i / n; - - // The Green Line - xa = getPt( fromX , cpX , j ); - ya = getPt( fromY , cpY , j ); - xb = getPt( cpX , toX , j ); - yb = getPt( cpY , toY , j ); - - // The Black Dot - x = getPt( xa , xb , j ); - y = getPt( ya , yb , j ); - - points.push(x, y); - } - return points; -}; - -/** - * Builds a circle to draw - * - * @static - * @private - * @method buildCircle - * @param graphicsData {Graphics} The graphics object to draw - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildCircle = function(graphicsData, webGLData) -{ - // need to convert points to a nice regular data - var circleData = graphicsData.shape; - var x = circleData.x; - var y = circleData.y; - var width; - var height; - - // TODO - bit hacky?? - if(graphicsData.type === PIXI.Graphics.CIRC) - { - width = circleData.radius; - height = circleData.radius; - } - else - { - width = circleData.width; - height = circleData.height; - } - - var totalSegs = 40; - var seg = (Math.PI * 2) / totalSegs ; - - var i = 0; - - if(graphicsData.fill) - { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vecPos = verts.length/6; - - indices.push(vecPos); - - for (i = 0; i < totalSegs + 1 ; i++) - { - verts.push(x,y, r, g, b, alpha); - - verts.push(x + Math.sin(seg * i) * width, - y + Math.cos(seg * i) * height, - r, g, b, alpha); - - indices.push(vecPos++, vecPos++); - } - - indices.push(vecPos-1); - } - - if(graphicsData.lineWidth) - { - var tempPoints = graphicsData.points; - - graphicsData.points = []; - - for (i = 0; i < totalSegs + 1; i++) - { - graphicsData.points.push(x + Math.sin(seg * i) * width, - y + Math.cos(seg * i) * height); - } - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Builds a line to draw - * - * @static - * @private - * @method buildLine - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildLine = function(graphicsData, webGLData) -{ - // TODO OPTIMISE! - var i = 0; - var points = graphicsData.points; - if(points.length === 0)return; - - // if the line width is an odd number add 0.5 to align to a whole pixel - if(graphicsData.lineWidth%2) - { - for (i = 0; i < points.length; i++) { - points[i] += 0.5; - } - } - - // get first and last point.. figure out the middle! - var firstPoint = new PIXI.Point( points[0], points[1] ); - var lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); - - // if the first point is the last point - gonna have issues :) - if(firstPoint.x === lastPoint.x && firstPoint.y === lastPoint.y) - { - // need to clone as we are going to slightly modify the shape.. - points = points.slice(); - - points.pop(); - points.pop(); - - lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); - - var midPointX = lastPoint.x + (firstPoint.x - lastPoint.x) *0.5; - var midPointY = lastPoint.y + (firstPoint.y - lastPoint.y) *0.5; - - points.unshift(midPointX, midPointY); - points.push(midPointX, midPointY); - } - - var verts = webGLData.points; - var indices = webGLData.indices; - var length = points.length / 2; - var indexCount = points.length; - var indexStart = verts.length/6; - - // DRAW the Line - var width = graphicsData.lineWidth / 2; - - // sort color - var color = PIXI.hex2rgb(graphicsData.lineColor); - var alpha = graphicsData.lineAlpha; - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var px, py, p1x, p1y, p2x, p2y, p3x, p3y; - var perpx, perpy, perp2x, perp2y, perp3x, perp3y; - var a1, b1, c1, a2, b2, c2; - var denom, pdist, dist; - - p1x = points[0]; - p1y = points[1]; - - p2x = points[2]; - p2y = points[3]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - // start - verts.push(p1x - perpx , p1y - perpy, - r, g, b, alpha); - - verts.push(p1x + perpx , p1y + perpy, - r, g, b, alpha); - - for (i = 1; i < length-1; i++) - { - p1x = points[(i-1)*2]; - p1y = points[(i-1)*2 + 1]; - - p2x = points[(i)*2]; - p2y = points[(i)*2 + 1]; - - p3x = points[(i+1)*2]; - p3y = points[(i+1)*2 + 1]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - perp2x = -(p2y - p3y); - perp2y = p2x - p3x; - - dist = Math.sqrt(perp2x*perp2x + perp2y*perp2y); - perp2x /= dist; - perp2y /= dist; - perp2x *= width; - perp2y *= width; - - a1 = (-perpy + p1y) - (-perpy + p2y); - b1 = (-perpx + p2x) - (-perpx + p1x); - c1 = (-perpx + p1x) * (-perpy + p2y) - (-perpx + p2x) * (-perpy + p1y); - a2 = (-perp2y + p3y) - (-perp2y + p2y); - b2 = (-perp2x + p2x) - (-perp2x + p3x); - c2 = (-perp2x + p3x) * (-perp2y + p2y) - (-perp2x + p2x) * (-perp2y + p3y); - - denom = a1*b2 - a2*b1; - - if(Math.abs(denom) < 0.1 ) - { - - denom+=10.1; - verts.push(p2x - perpx , p2y - perpy, - r, g, b, alpha); - - verts.push(p2x + perpx , p2y + perpy, - r, g, b, alpha); - - continue; - } - - px = (b1*c2 - b2*c1)/denom; - py = (a2*c1 - a1*c2)/denom; - - - pdist = (px -p2x) * (px -p2x) + (py -p2y) + (py -p2y); - - - if(pdist > 140 * 140) - { - perp3x = perpx - perp2x; - perp3y = perpy - perp2y; - - dist = Math.sqrt(perp3x*perp3x + perp3y*perp3y); - perp3x /= dist; - perp3y /= dist; - perp3x *= width; - perp3y *= width; - - verts.push(p2x - perp3x, p2y -perp3y); - verts.push(r, g, b, alpha); - - verts.push(p2x + perp3x, p2y +perp3y); - verts.push(r, g, b, alpha); - - verts.push(p2x - perp3x, p2y -perp3y); - verts.push(r, g, b, alpha); - - indexCount++; - } - else - { - - verts.push(px , py); - verts.push(r, g, b, alpha); - - verts.push(p2x - (px-p2x), p2y - (py - p2y)); - verts.push(r, g, b, alpha); - } - } - - p1x = points[(length-2)*2]; - p1y = points[(length-2)*2 + 1]; - - p2x = points[(length-1)*2]; - p2y = points[(length-1)*2 + 1]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - verts.push(p2x - perpx , p2y - perpy); - verts.push(r, g, b, alpha); - - verts.push(p2x + perpx , p2y + perpy); - verts.push(r, g, b, alpha); - - indices.push(indexStart); - - for (i = 0; i < indexCount; i++) - { - indices.push(indexStart++); - } - - indices.push(indexStart-1); -}; - -/** - * Builds a complex polygon to draw - * - * @static - * @private - * @method buildComplexPoly - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildComplexPoly = function(graphicsData, webGLData) -{ - //TODO - no need to copy this as it gets turned into a FLoat32Array anyways.. - var points = graphicsData.points.slice(); - if(points.length < 6)return; - - // get first and last point.. figure out the middle! - var indices = webGLData.indices; - webGLData.points = points; - webGLData.alpha = graphicsData.fillAlpha; - webGLData.color = PIXI.hex2rgb(graphicsData.fillColor); - - /* - calclate the bounds.. - */ - var minX = Infinity; - var maxX = -Infinity; - - var minY = Infinity; - var maxY = -Infinity; - - var x,y; - - // get size.. - for (var i = 0; i < points.length; i+=2) - { - x = points[i]; - y = points[i+1]; - - minX = x < minX ? x : minX; - maxX = x > maxX ? x : maxX; - - minY = y < minY ? y : minY; - maxY = y > maxY ? y : maxY; - } - - // add a quad to the end cos there is no point making another buffer! - points.push(minX, minY, - maxX, minY, - maxX, maxY, - minX, maxY); - - // push a quad onto the end.. - - //TODO - this aint needed! - var length = points.length / 2; - for (i = 0; i < length; i++) - { - indices.push( i ); - } - -}; - -/** - * Builds a polygon to draw - * - * @static - * @private - * @method buildPoly - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildPoly = function(graphicsData, webGLData) -{ - var points = graphicsData.points; - - if(points.length < 6)return; - // get first and last point.. figure out the middle! - var verts = webGLData.points; - var indices = webGLData.indices; - - var length = points.length / 2; - - // sort color - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var triangles = PIXI.PolyK.Triangulate(points); - - if(!triangles)return false; - - var vertPos = verts.length / 6; - - var i = 0; - - for (i = 0; i < triangles.length; i+=3) - { - indices.push(triangles[i] + vertPos); - indices.push(triangles[i] + vertPos); - indices.push(triangles[i+1] + vertPos); - indices.push(triangles[i+2] +vertPos); - indices.push(triangles[i+2] + vertPos); - } - - for (i = 0; i < length; i++) - { - verts.push(points[i * 2], points[i * 2 + 1], - r, g, b, alpha); - } - - return true; -}; - -PIXI.WebGLGraphics.graphicsDataPool = []; - -/** - * @class WebGLGraphicsData - * @private - * @static - */ -PIXI.WebGLGraphicsData = function(gl) -{ - this.gl = gl; - - //TODO does this need to be split before uploding?? - this.color = [0,0,0]; // color split! - this.points = []; - this.indices = []; - this.buffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - this.mode = 1; - this.alpha = 1; - this.dirty = true; -}; - -/** - * @method reset - */ -PIXI.WebGLGraphicsData.prototype.reset = function() -{ - this.points = []; - this.indices = []; -}; - -/** - * @method upload - */ -PIXI.WebGLGraphicsData.prototype.upload = function() -{ - var gl = this.gl; - -// this.lastIndex = graphics.graphicsData.length; - this.glPoints = new PIXI.Float32Array(this.points); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer); - gl.bufferData(gl.ARRAY_BUFFER, this.glPoints, gl.STATIC_DRAW); - - this.glIndicies = new PIXI.Uint16Array(this.indices); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.glIndicies, gl.STATIC_DRAW); - - this.dirty = false; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -PIXI.glContexts = []; // this is where we store the webGL contexts for easy access. -PIXI.instances = []; - -/** - * The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer - * should be used for browsers that support webGL. This Render works by automatically managing webGLBatchs. - * So no need for Sprite Batches or Sprite Clouds. - * Don't forget to add the view to your DOM or you will not see anything :) - * - * @class WebGLRenderer - * @constructor - * @param [width=0] {Number} the width of the canvas view - * @param [height=0] {Number} the height of the canvas view - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - */ -PIXI.WebGLRenderer = function(width, height, options) -{ - if(options) - { - for (var i in PIXI.defaultRenderOptions) - { - if (typeof options[i] === 'undefined') options[i] = PIXI.defaultRenderOptions[i]; - } - } - else - { - options = PIXI.defaultRenderOptions; - } - - if(!PIXI.defaultRenderer) - { - PIXI.sayHello('webGL'); - PIXI.defaultRenderer = this; - } - - /** - * @property type - * @type Number - */ - this.type = PIXI.WEBGL_RENDERER; - - /** - * The resolution of the renderer - * - * @property resolution - * @type Number - * @default 1 - */ - this.resolution = options.resolution; - - // do a catch.. only 1 webGL renderer.. - - /** - * Whether the render view is transparent - * - * @property transparent - * @type Boolean - */ - this.transparent = options.transparent; - - /** - * Whether the render view should be resized automatically - * - * @property autoResize - * @type Boolean - */ - this.autoResize = options.autoResize || false; - - /** - * The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering. - * - * @property preserveDrawingBuffer - * @type Boolean - */ - this.preserveDrawingBuffer = options.preserveDrawingBuffer; - - /** - * This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true: - * If the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0). - * If the Stage is transparent, Pixi will clear to the target Stage's background color. - * Disable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set. - * - * @property clearBeforeRender - * @type Boolean - * @default - */ - this.clearBeforeRender = options.clearBeforeRender; - - /** - * The width of the canvas view - * - * @property width - * @type Number - * @default 800 - */ - this.width = width || 800; - - /** - * The height of the canvas view - * - * @property height - * @type Number - * @default 600 - */ - this.height = height || 600; - - /** - * The canvas element that everything is drawn to - * - * @property view - * @type HTMLCanvasElement - */ - this.view = options.view || document.createElement( 'canvas' ); - - // deal with losing context.. - - /** - * @property contextLostBound - * @type Function - */ - this.contextLostBound = this.handleContextLost.bind(this); - - /** - * @property contextRestoredBound - * @type Function - */ - this.contextRestoredBound = this.handleContextRestored.bind(this); - - this.view.addEventListener('webglcontextlost', this.contextLostBound, false); - this.view.addEventListener('webglcontextrestored', this.contextRestoredBound, false); - - /** - * @property _contextOptions - * @type Object - * @private - */ - this._contextOptions = { - alpha: this.transparent, - antialias: options.antialias, // SPEED UP?? - premultipliedAlpha:this.transparent && this.transparent !== 'notMultiplied', - stencil:true, - preserveDrawingBuffer: options.preserveDrawingBuffer - }; - - /** - * @property projection - * @type Point - */ - this.projection = new PIXI.Point(); - - /** - * @property offset - * @type Point - */ - this.offset = new PIXI.Point(0, 0); - - // time to create the render managers! each one focuses on managing a state in webGL - - /** - * Deals with managing the shader programs and their attribs - * @property shaderManager - * @type WebGLShaderManager - */ - this.shaderManager = new PIXI.WebGLShaderManager(); - - /** - * Manages the rendering of sprites - * @property spriteBatch - * @type WebGLSpriteBatch - */ - this.spriteBatch = new PIXI.WebGLSpriteBatch(); - - /** - * Manages the masks using the stencil buffer - * @property maskManager - * @type WebGLMaskManager - */ - this.maskManager = new PIXI.WebGLMaskManager(); - - /** - * Manages the filters - * @property filterManager - * @type WebGLFilterManager - */ - this.filterManager = new PIXI.WebGLFilterManager(); - - /** - * Manages the stencil buffer - * @property stencilManager - * @type WebGLStencilManager - */ - this.stencilManager = new PIXI.WebGLStencilManager(); - - /** - * Manages the blendModes - * @property blendModeManager - * @type WebGLBlendModeManager - */ - this.blendModeManager = new PIXI.WebGLBlendModeManager(); - - /** - * TODO remove - * @property renderSession - * @type Object - */ - this.renderSession = {}; - this.renderSession.gl = this.gl; - this.renderSession.drawCount = 0; - this.renderSession.shaderManager = this.shaderManager; - this.renderSession.maskManager = this.maskManager; - this.renderSession.filterManager = this.filterManager; - this.renderSession.blendModeManager = this.blendModeManager; - this.renderSession.spriteBatch = this.spriteBatch; - this.renderSession.stencilManager = this.stencilManager; - this.renderSession.renderer = this; - this.renderSession.resolution = this.resolution; - - // time init the context.. - this.initContext(); - - // map some webGL blend modes.. - this.mapBlendModes(); -}; - -// constructor -PIXI.WebGLRenderer.prototype.constructor = PIXI.WebGLRenderer; - -/** -* @method initContext -*/ -PIXI.WebGLRenderer.prototype.initContext = function() -{ - var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); - this.gl = gl; - - if (!gl) { - // fail, not able to get a context - throw new Error('This browser does not support webGL. Try using the canvas renderer'); - } - - this.glContextId = gl.id = PIXI.WebGLRenderer.glContextId ++; - - PIXI.glContexts[this.glContextId] = gl; - - PIXI.instances[this.glContextId] = this; - - // set up the default pixi settings.. - gl.disable(gl.DEPTH_TEST); - gl.disable(gl.CULL_FACE); - gl.enable(gl.BLEND); - - // need to set the context for all the managers... - this.shaderManager.setContext(gl); - this.spriteBatch.setContext(gl); - this.maskManager.setContext(gl); - this.filterManager.setContext(gl); - this.blendModeManager.setContext(gl); - this.stencilManager.setContext(gl); - - this.renderSession.gl = this.gl; - - // now resize and we are good to go! - this.resize(this.width, this.height); -}; - -/** - * Renders the stage to its webGL view - * - * @method render - * @param stage {Stage} the Stage element to be rendered - */ -PIXI.WebGLRenderer.prototype.render = function(stage) -{ - // no point rendering if our context has been blown up! - if(this.contextLost)return; - - // if rendering a new stage clear the batches.. - if(this.__stage !== stage) - { - if(stage.interactive)stage.interactionManager.removeEvents(); - - // TODO make this work - // dont think this is needed any more? - this.__stage = stage; - } - - // update the scene graph - stage.updateTransform(); - - var gl = this.gl; - - // interaction - if(stage._interactive) - { - //need to add some events! - if(!stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = true; - stage.interactionManager.setTarget(this); - } - } - else - { - if(stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = false; - stage.interactionManager.setTarget(this); - } - } - - // -- Does this need to be set every frame? -- // - gl.viewport(0, 0, this.width, this.height); - - // make sure we are bound to the main frame buffer - gl.bindFramebuffer(gl.FRAMEBUFFER, null); - - if (this.clearBeforeRender) - { - if(this.transparent) - { - gl.clearColor(0, 0, 0, 0); - } - else - { - gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], 1); - } - - gl.clear (gl.COLOR_BUFFER_BIT); - } - - this.renderDisplayObject( stage, this.projection ); -}; - -/** - * Renders a Display Object. - * - * @method renderDisplayObject - * @param displayObject {DisplayObject} The DisplayObject to render - * @param projection {Point} The projection - * @param buffer {Array} a standard WebGL buffer - */ -PIXI.WebGLRenderer.prototype.renderDisplayObject = function(displayObject, projection, buffer) -{ - this.renderSession.blendModeManager.setBlendMode(PIXI.blendModes.NORMAL); - - // reset the render session data.. - this.renderSession.drawCount = 0; - - // make sure to flip the Y if using a render texture.. - this.renderSession.flipY = buffer ? -1 : 1; - - // set the default projection - this.renderSession.projection = projection; - - //set the default offset - this.renderSession.offset = this.offset; - - // start the sprite batch - this.spriteBatch.begin(this.renderSession); - - // start the filter manager - this.filterManager.begin(this.renderSession, buffer); - - // render the scene! - displayObject._renderWebGL(this.renderSession); - - // finish the sprite batch - this.spriteBatch.end(); -}; - -/** - * Resizes the webGL view to the specified width and height. - * - * @method resize - * @param width {Number} the new width of the webGL view - * @param height {Number} the new height of the webGL view - */ -PIXI.WebGLRenderer.prototype.resize = function(width, height) -{ - this.width = width * this.resolution; - this.height = height * this.resolution; - - this.view.width = this.width; - this.view.height = this.height; - - if (this.autoResize) { - this.view.style.width = this.width / this.resolution + 'px'; - this.view.style.height = this.height / this.resolution + 'px'; - } - - this.gl.viewport(0, 0, this.width, this.height); - - this.projection.x = this.width / 2 / this.resolution; - this.projection.y = -this.height / 2 / this.resolution; -}; - -/** - * Updates and Creates a WebGL texture for the renderers context. - * - * @method updateTexture - * @param texture {Texture} the texture to update - */ -PIXI.WebGLRenderer.prototype.updateTexture = function(texture) -{ - if(!texture.hasLoaded )return; - - var gl = this.gl; - - if(!texture._glTextures[gl.id])texture._glTextures[gl.id] = gl.createTexture(); - - gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]); - - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultipliedAlpha); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source); - - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - - - if(texture.mipmap && PIXI.isPowerOfTwo(texture.width, texture.height)) - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR_MIPMAP_LINEAR : gl.NEAREST_MIPMAP_NEAREST); - gl.generateMipmap(gl.TEXTURE_2D); - } - else - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - } - - // reguler... - if(!texture._powerOf2) - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - } - else - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT); - } - - texture._dirty[gl.id] = false; - - return texture._glTextures[gl.id]; -}; - -/** - * Handles a lost webgl context - * - * @method handleContextLost - * @param event {Event} - * @private - */ -PIXI.WebGLRenderer.prototype.handleContextLost = function(event) -{ - event.preventDefault(); - this.contextLost = true; -}; - -/** - * Handles a restored webgl context - * - * @method handleContextRestored - * @param event {Event} - * @private - */ -PIXI.WebGLRenderer.prototype.handleContextRestored = function() -{ - this.initContext(); - - // empty all the ol gl textures as they are useless now - for(var key in PIXI.TextureCache) - { - var texture = PIXI.TextureCache[key].baseTexture; - texture._glTextures = []; - } - - this.contextLost = false; -}; - -/** - * Removes everything from the renderer (event listeners, spritebatch, etc...) - * - * @method destroy - */ -PIXI.WebGLRenderer.prototype.destroy = function() -{ - // remove listeners - this.view.removeEventListener('webglcontextlost', this.contextLostBound); - this.view.removeEventListener('webglcontextrestored', this.contextRestoredBound); - - PIXI.glContexts[this.glContextId] = null; - - this.projection = null; - this.offset = null; - - // time to create the render managers! each one focuses on managine a state in webGL - this.shaderManager.destroy(); - this.spriteBatch.destroy(); - this.maskManager.destroy(); - this.filterManager.destroy(); - - this.shaderManager = null; - this.spriteBatch = null; - this.maskManager = null; - this.filterManager = null; - - this.gl = null; - this.renderSession = null; -}; - -/** - * Maps Pixi blend modes to WebGL blend modes. - * - * @method mapBlendModes - */ -PIXI.WebGLRenderer.prototype.mapBlendModes = function() -{ - var gl = this.gl; - - if(!PIXI.blendModesWebGL) - { - PIXI.blendModesWebGL = []; - - PIXI.blendModesWebGL[PIXI.blendModes.NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.ADD] = [gl.SRC_ALPHA, gl.DST_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SCREEN] = [gl.SRC_ALPHA, gl.ONE]; - PIXI.blendModesWebGL[PIXI.blendModes.OVERLAY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.DARKEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.LIGHTEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR_DODGE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR_BURN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.HARD_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SOFT_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.DIFFERENCE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.EXCLUSION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.HUE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SATURATION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.LUMINOSITY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - } -}; - -PIXI.WebGLRenderer.glContextId = 0; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLBlendModeManager -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLBlendModeManager = function() -{ - /** - * @property currentBlendMode - * @type Number - */ - this.currentBlendMode = 99999; -}; - -PIXI.WebGLBlendModeManager.prototype.constructor = PIXI.WebGLBlendModeManager; - -/** - * Sets the WebGL Context. - * - * @method setContext - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLBlendModeManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Sets-up the given blendMode from WebGL's point of view. -* -* @method setBlendMode -* @param blendMode {Number} the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD -*/ -PIXI.WebGLBlendModeManager.prototype.setBlendMode = function(blendMode) -{ - if(this.currentBlendMode === blendMode)return false; - - this.currentBlendMode = blendMode; - - var blendModeWebGL = PIXI.blendModesWebGL[this.currentBlendMode]; - this.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); - - return true; -}; - -/** -* Destroys this object. -* -* @method destroy -*/ -PIXI.WebGLBlendModeManager.prototype.destroy = function() -{ - this.gl = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLMaskManager -* @constructor -* @private -*/ -PIXI.WebGLMaskManager = function() -{ -}; - -PIXI.WebGLMaskManager.prototype.constructor = PIXI.WebGLMaskManager; - -/** -* Sets the drawing context to the one given in parameter. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLMaskManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Applies the Mask and adds it to the current filter stack. -* -* @method pushMask -* @param maskData {Array} -* @param renderSession {Object} -*/ -PIXI.WebGLMaskManager.prototype.pushMask = function(maskData, renderSession) -{ - var gl = renderSession.gl; - - if(maskData.dirty) - { - PIXI.WebGLGraphics.updateGraphics(maskData, gl); - } - - if(!maskData._webGL[gl.id].data.length)return; - - renderSession.stencilManager.pushStencil(maskData, maskData._webGL[gl.id].data[0], renderSession); -}; - -/** -* Removes the last filter from the filter stack and doesn't return it. -* -* @method popMask -* @param maskData {Array} -* @param renderSession {Object} an object containing all the useful parameters -*/ -PIXI.WebGLMaskManager.prototype.popMask = function(maskData, renderSession) -{ - var gl = this.gl; - renderSession.stencilManager.popStencil(maskData, maskData._webGL[gl.id].data[0], renderSession); -}; - -/** -* Destroys the mask stack. -* -* @method destroy -*/ -PIXI.WebGLMaskManager.prototype.destroy = function() -{ - this.gl = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLStencilManager -* @constructor -* @private -*/ -PIXI.WebGLStencilManager = function() -{ - this.stencilStack = []; - this.reverse = true; - this.count = 0; -}; - -/** -* Sets the drawing context to the one given in parameter. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLStencilManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Applies the Mask and adds it to the current filter stack. -* -* @method pushMask -* @param graphics {Graphics} -* @param webGLData {Array} -* @param renderSession {Object} -*/ -PIXI.WebGLStencilManager.prototype.pushStencil = function(graphics, webGLData, renderSession) -{ - var gl = this.gl; - this.bindGraphics(graphics, webGLData, renderSession); - - if(this.stencilStack.length === 0) - { - gl.enable(gl.STENCIL_TEST); - gl.clear(gl.STENCIL_BUFFER_BIT); - this.reverse = true; - this.count = 0; - } - - this.stencilStack.push(webGLData); - - var level = this.count; - - gl.colorMask(false, false, false, false); - - gl.stencilFunc(gl.ALWAYS,0,0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT); - - // draw the triangle strip! - - if(webGLData.mode === 1) - { - gl.drawElements(gl.TRIANGLE_FAN, webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 ); - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - - // draw a quad to increment.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - } - - this.reverse = !this.reverse; - } - else - { - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - } - } - - gl.colorMask(true, true, true, true); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP); - - this.count++; -}; - -/** - * TODO this does not belong here! - * - * @method bindGraphics - * @param graphics {Graphics} - * @param webGLData {Array} - * @param renderSession {Object} - */ -PIXI.WebGLStencilManager.prototype.bindGraphics = function(graphics, webGLData, renderSession) -{ - //if(this._currentGraphics === graphics)return; - this._currentGraphics = graphics; - - var gl = this.gl; - - // bind the graphics object.. - var projection = renderSession.projection, - offset = renderSession.offset, - shader;// = renderSession.shaderManager.primitiveShader; - - if(webGLData.mode === 1) - { - shader = renderSession.shaderManager.complexPrimitiveShader; - - renderSession.shaderManager.setShader( shader ); - - gl.uniform1f(shader.flipY, renderSession.flipY); - - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - gl.uniform3fv(shader.color, webGLData.color); - - gl.uniform1f(shader.alpha, graphics.worldAlpha * webGLData.alpha); - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 2, 0); - - - // now do the rest.. - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - } - else - { - //renderSession.shaderManager.activatePrimitiveShader(); - shader = renderSession.shaderManager.primitiveShader; - renderSession.shaderManager.setShader( shader ); - - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform1f(shader.flipY, renderSession.flipY); - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - - gl.uniform1f(shader.alpha, graphics.worldAlpha); - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0); - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4); - - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - } -}; - -/** - * @method popStencil - * @param graphics {Graphics} - * @param webGLData {Array} - * @param renderSession {Object} - */ -PIXI.WebGLStencilManager.prototype.popStencil = function(graphics, webGLData, renderSession) -{ - var gl = this.gl; - this.stencilStack.pop(); - - this.count--; - - if(this.stencilStack.length === 0) - { - // the stack is empty! - gl.disable(gl.STENCIL_TEST); - - } - else - { - - var level = this.count; - - this.bindGraphics(graphics, webGLData, renderSession); - - gl.colorMask(false, false, false, false); - - if(webGLData.mode === 1) - { - this.reverse = !this.reverse; - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - - // draw a quad to increment.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - gl.stencilFunc(gl.ALWAYS,0,0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT); - - // draw the triangle strip! - gl.drawElements(gl.TRIANGLE_FAN, webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - } - - } - else - { - // console.log("<<>>") - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - } - } - - gl.colorMask(true, true, true, true); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP); - - - } -}; - -/** -* Destroys the mask stack. -* -* @method destroy -*/ -PIXI.WebGLStencilManager.prototype.destroy = function() -{ - this.stencilStack = null; - this.gl = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLShaderManager -* @constructor -* @private -*/ -PIXI.WebGLShaderManager = function() -{ - /** - * @property maxAttibs - * @type Number - */ - this.maxAttibs = 10; - - /** - * @property attribState - * @type Array - */ - this.attribState = []; - - /** - * @property tempAttribState - * @type Array - */ - this.tempAttribState = []; - - for (var i = 0; i < this.maxAttibs; i++) - { - this.attribState[i] = false; - } - - /** - * @property stack - * @type Array - */ - this.stack = []; - -}; - -PIXI.WebGLShaderManager.prototype.constructor = PIXI.WebGLShaderManager; - -/** -* Initialises the context and the properties. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLShaderManager.prototype.setContext = function(gl) -{ - this.gl = gl; - - // the next one is used for rendering primitives - this.primitiveShader = new PIXI.PrimitiveShader(gl); - - // the next one is used for rendering triangle strips - this.complexPrimitiveShader = new PIXI.ComplexPrimitiveShader(gl); - - // this shader is used for the default sprite rendering - this.defaultShader = new PIXI.PixiShader(gl); - - // this shader is used for the fast sprite rendering - this.fastShader = new PIXI.PixiFastShader(gl); - - // the next one is used for rendering triangle strips - this.stripShader = new PIXI.StripShader(gl); - this.setShader(this.defaultShader); -}; - -/** -* Takes the attributes given in parameters. -* -* @method setAttribs -* @param attribs {Array} attribs -*/ -PIXI.WebGLShaderManager.prototype.setAttribs = function(attribs) -{ - // reset temp state - var i; - - for (i = 0; i < this.tempAttribState.length; i++) - { - this.tempAttribState[i] = false; - } - - // set the new attribs - for (i = 0; i < attribs.length; i++) - { - var attribId = attribs[i]; - this.tempAttribState[attribId] = true; - } - - var gl = this.gl; - - for (i = 0; i < this.attribState.length; i++) - { - if(this.attribState[i] !== this.tempAttribState[i]) - { - this.attribState[i] = this.tempAttribState[i]; - - if(this.tempAttribState[i]) - { - gl.enableVertexAttribArray(i); - } - else - { - gl.disableVertexAttribArray(i); - } - } - } -}; - -/** -* Sets the current shader. -* -* @method setShader -* @param shader {Any} -*/ -PIXI.WebGLShaderManager.prototype.setShader = function(shader) -{ - if(this._currentId === shader._UID)return false; - - this._currentId = shader._UID; - - this.currentShader = shader; - - this.gl.useProgram(shader.program); - this.setAttribs(shader.attributes); - - return true; -}; - -/** -* Destroys this object. -* -* @method destroy -*/ -PIXI.WebGLShaderManager.prototype.destroy = function() -{ - this.attribState = null; - - this.tempAttribState = null; - - this.primitiveShader.destroy(); - - this.complexPrimitiveShader.destroy(); - - this.defaultShader.destroy(); - - this.fastShader.destroy(); - - this.stripShader.destroy(); - - this.gl = null; -}; - -/** - * @author Mat Groves - * - * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ - * for creating the original pixi version! - * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now share 4 bytes on the vertex buffer - * - * Heavily inspired by LibGDX's WebGLSpriteBatch: - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java - */ - - /** - * - * @class WebGLSpriteBatch - * @private - * @constructor - */ -PIXI.WebGLSpriteBatch = function() -{ - /** - * @property vertSize - * @type Number - */ - this.vertSize = 5; - - /** - * The number of images in the SpriteBatch before it flushes - * @property size - * @type Number - */ - this.size = 2000;//Math.pow(2, 16) / this.vertSize; - - //the total number of bytes in our batch - var numVerts = this.size * 4 * 4 * this.vertSize; - //the total number of indices in our batch - var numIndices = this.size * 6; - - /** - * Holds the vertices - * - * @property vertices - * @type ArrayBuffer - */ - this.vertices = new PIXI.ArrayBuffer(numVerts); - - /** - * View on the vertices as a Float32Array - * - * @property positions - * @type Float32Array - */ - this.positions = new PIXI.Float32Array(this.vertices); - - /** - * View on the vertices as a Uint32Array - * - * @property colors - * @type Uint32Array - */ - this.colors = new PIXI.Uint32Array(this.vertices); - - /** - * Holds the indices - * - * @property indices - * @type Uint16Array - */ - this.indices = new PIXI.Uint16Array(numIndices); - - /** - * @property lastIndexCount - * @type Number - */ - this.lastIndexCount = 0; - - for (var i=0, j=0; i < numIndices; i += 6, j += 4) - { - this.indices[i + 0] = j + 0; - this.indices[i + 1] = j + 1; - this.indices[i + 2] = j + 2; - this.indices[i + 3] = j + 0; - this.indices[i + 4] = j + 2; - this.indices[i + 5] = j + 3; - } - - /** - * @property drawing - * @type Boolean - */ - this.drawing = false; - - /** - * @property currentBatchSize - * @type Number - */ - this.currentBatchSize = 0; - - /** - * @property currentBaseTexture - * @type BaseTexture - */ - this.currentBaseTexture = null; - - /** - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * @property textures - * @type Array - */ - this.textures = []; - - /** - * @property blendModes - * @type Array - */ - this.blendModes = []; - - /** - * @property shaders - * @type Array - */ - this.shaders = []; - - /** - * @property sprites - * @type Array - */ - this.sprites = []; - - /** - * @property defaultShader - * @type AbstractFilter - */ - this.defaultShader = new PIXI.AbstractFilter([ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]); -}; - -/** -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLSpriteBatch.prototype.setContext = function(gl) -{ - this.gl = gl; - - // create a couple of buffers - this.vertexBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // 65535 is max index, so 65535 / 6 = 10922. - - //upload the index data - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); - - this.currentBlendMode = 99999; - - var shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc = this.defaultShader.fragmentSrc; - shader.uniforms = {}; - shader.init(); - - this.defaultShader.shaders[gl.id] = shader; -}; - -/** -* @method begin -* @param renderSession {Object} The RenderSession object -*/ -PIXI.WebGLSpriteBatch.prototype.begin = function(renderSession) -{ - this.renderSession = renderSession; - this.shader = this.renderSession.shaderManager.defaultShader; - - this.start(); -}; - -/** -* @method end -*/ -PIXI.WebGLSpriteBatch.prototype.end = function() -{ - this.flush(); -}; - -/** -* @method render -* @param sprite {Sprite} the sprite to render when using this spritebatch -*/ -PIXI.WebGLSpriteBatch.prototype.render = function(sprite) -{ - var texture = sprite.texture; - - //TODO set blend modes.. - // check texture.. - if(this.currentBatchSize >= this.size) - { - this.flush(); - this.currentBaseTexture = texture.baseTexture; - } - - // get the uvs for the texture - var uvs = texture._uvs; - // if the uvs have not updated then no point rendering just yet! - if(!uvs)return; - - // TODO trim?? - var aX = sprite.anchor.x; - var aY = sprite.anchor.y; - - var w0, w1, h0, h1; - - if (texture.trim) - { - // if the sprite is trimmed then we need to add the extra space before transforming the sprite coords.. - var trim = texture.trim; - - w1 = trim.x - aX * trim.width; - w0 = w1 + texture.crop.width; - - h1 = trim.y - aY * trim.height; - h0 = h1 + texture.crop.height; - - } - else - { - w0 = (texture.frame.width ) * (1-aX); - w1 = (texture.frame.width ) * -aX; - - h0 = texture.frame.height * (1-aY); - h1 = texture.frame.height * -aY; - } - - var index = this.currentBatchSize * 4 * this.vertSize; - - var resolution = texture.baseTexture.resolution; - - var worldTransform = sprite.worldTransform; - - var a = worldTransform.a / resolution; - var b = worldTransform.b / resolution; - var c = worldTransform.c / resolution; - var d = worldTransform.d / resolution; - var tx = worldTransform.tx; - var ty = worldTransform.ty; - - var colors = this.colors; - var positions = this.positions; - - if(this.renderSession.roundPixels) - { - // xy - positions[index] = a * w1 + c * h1 + tx | 0; - positions[index+1] = d * h1 + b * w1 + ty | 0; - - // xy - positions[index+5] = a * w0 + c * h1 + tx | 0; - positions[index+6] = d * h1 + b * w0 + ty | 0; - - // xy - positions[index+10] = a * w0 + c * h0 + tx | 0; - positions[index+11] = d * h0 + b * w0 + ty | 0; - - // xy - positions[index+15] = a * w1 + c * h0 + tx | 0; - positions[index+16] = d * h0 + b * w1 + ty | 0; - } - else - { - // xy - positions[index] = a * w1 + c * h1 + tx; - positions[index+1] = d * h1 + b * w1 + ty; - - // xy - positions[index+5] = a * w0 + c * h1 + tx; - positions[index+6] = d * h1 + b * w0 + ty; - - // xy - positions[index+10] = a * w0 + c * h0 + tx; - positions[index+11] = d * h0 + b * w0 + ty; - - // xy - positions[index+15] = a * w1 + c * h0 + tx; - positions[index+16] = d * h0 + b * w1 + ty; - } - - // uv - positions[index+2] = uvs.x0; - positions[index+3] = uvs.y0; - - // uv - positions[index+7] = uvs.x1; - positions[index+8] = uvs.y1; - - // uv - positions[index+12] = uvs.x2; - positions[index+13] = uvs.y2; - - // uv - positions[index+17] = uvs.x3; - positions[index+18] = uvs.y3; - - // color and alpha - var tint = sprite.tint; - colors[index+4] = colors[index+9] = colors[index+14] = colors[index+19] = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16) + (sprite.worldAlpha * 255 << 24); - - // increment the batchsize - this.sprites[this.currentBatchSize++] = sprite; - - -}; - -/** -* Renders a TilingSprite using the spriteBatch. -* -* @method renderTilingSprite -* @param sprite {TilingSprite} the tilingSprite to render -*/ -PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite) -{ - var texture = tilingSprite.tilingTexture; - - // check texture.. - if(this.currentBatchSize >= this.size) - { - //return; - this.flush(); - this.currentBaseTexture = texture.baseTexture; - } - - // set the textures uvs temporarily - // TODO create a separate texture so that we can tile part of a texture - - if(!tilingSprite._uvs)tilingSprite._uvs = new PIXI.TextureUvs(); - - var uvs = tilingSprite._uvs; - - tilingSprite.tilePosition.x %= texture.baseTexture.width * tilingSprite.tileScaleOffset.x; - tilingSprite.tilePosition.y %= texture.baseTexture.height * tilingSprite.tileScaleOffset.y; - - var offsetX = tilingSprite.tilePosition.x/(texture.baseTexture.width*tilingSprite.tileScaleOffset.x); - var offsetY = tilingSprite.tilePosition.y/(texture.baseTexture.height*tilingSprite.tileScaleOffset.y); - - var scaleX = (tilingSprite.width / texture.baseTexture.width) / (tilingSprite.tileScale.x * tilingSprite.tileScaleOffset.x); - var scaleY = (tilingSprite.height / texture.baseTexture.height) / (tilingSprite.tileScale.y * tilingSprite.tileScaleOffset.y); - - uvs.x0 = 0 - offsetX; - uvs.y0 = 0 - offsetY; - - uvs.x1 = (1 * scaleX) - offsetX; - uvs.y1 = 0 - offsetY; - - uvs.x2 = (1 * scaleX) - offsetX; - uvs.y2 = (1 * scaleY) - offsetY; - - uvs.x3 = 0 - offsetX; - uvs.y3 = (1 * scaleY) - offsetY; - - // get the tilingSprites current alpha and tint and combining them into a single color - var tint = tilingSprite.tint; - var color = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16) + (tilingSprite.alpha * 255 << 24); - - var positions = this.positions; - var colors = this.colors; - - var width = tilingSprite.width; - var height = tilingSprite.height; - - // TODO trim?? - var aX = tilingSprite.anchor.x; - var aY = tilingSprite.anchor.y; - var w0 = width * (1-aX); - var w1 = width * -aX; - - var h0 = height * (1-aY); - var h1 = height * -aY; - - var index = this.currentBatchSize * 4 * this.vertSize; - - var resolution = texture.baseTexture.resolution; - - var worldTransform = tilingSprite.worldTransform; - - var a = worldTransform.a / resolution;//[0]; - var b = worldTransform.b / resolution;//[3]; - var c = worldTransform.c / resolution;//[1]; - var d = worldTransform.d / resolution;//[4]; - var tx = worldTransform.tx;//[2]; - var ty = worldTransform.ty;//[5]; - - // xy - positions[index++] = a * w1 + c * h1 + tx; - positions[index++] = d * h1 + b * w1 + ty; - // uv - positions[index++] = uvs.x0; - positions[index++] = uvs.y0; - // color - colors[index++] = color; - - // xy - positions[index++] = (a * w0 + c * h1 + tx); - positions[index++] = d * h1 + b * w0 + ty; - // uv - positions[index++] = uvs.x1; - positions[index++] = uvs.y1; - // color - colors[index++] = color; - - // xy - positions[index++] = a * w0 + c * h0 + tx; - positions[index++] = d * h0 + b * w0 + ty; - // uv - positions[index++] = uvs.x2; - positions[index++] = uvs.y2; - // color - colors[index++] = color; - - // xy - positions[index++] = a * w1 + c * h0 + tx; - positions[index++] = d * h0 + b * w1 + ty; - // uv - positions[index++] = uvs.x3; - positions[index++] = uvs.y3; - // color - colors[index++] = color; - - // increment the batchsize - this.sprites[this.currentBatchSize++] = tilingSprite; -}; - -/** -* Renders the content and empties the current batch. -* -* @method flush -*/ -PIXI.WebGLSpriteBatch.prototype.flush = function() -{ - // If the batch is length 0 then return as there is nothing to draw - if (this.currentBatchSize===0)return; - - var gl = this.gl; - var shader; - - if(this.dirty) - { - this.dirty = false; - // bind the main texture - gl.activeTexture(gl.TEXTURE0); - - // bind the buffers - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - shader = this.defaultShader.shaders[gl.id]; - - // this is the same for each shader? - var stride = this.vertSize * 4; - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, stride, 2 * 4); - - // color attributes will be interpreted as unsigned bytes and normalized - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.UNSIGNED_BYTE, true, stride, 4 * 4); - } - - // upload the verts to the buffer - if(this.currentBatchSize > ( this.size * 0.5 ) ) - { - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - } - else - { - var view = this.positions.subarray(0, this.currentBatchSize * 4 * this.vertSize); - gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); - } - - var nextTexture, nextBlendMode, nextShader; - var batchSize = 0; - var start = 0; - - var currentBaseTexture = null; - var currentBlendMode = this.renderSession.blendModeManager.currentBlendMode; - var currentShader = null; - - var blendSwap = false; - var shaderSwap = false; - var sprite; - - for (var i = 0, j = this.currentBatchSize; i < j; i++) { - - sprite = this.sprites[i]; - - nextTexture = sprite.texture.baseTexture; - nextBlendMode = sprite.blendMode; - nextShader = sprite.shader || this.defaultShader; - - blendSwap = currentBlendMode !== nextBlendMode; - shaderSwap = currentShader !== nextShader; // should I use _UIDS??? - - if(currentBaseTexture !== nextTexture || blendSwap || shaderSwap) - { - this.renderBatch(currentBaseTexture, batchSize, start); - - start = i; - batchSize = 0; - currentBaseTexture = nextTexture; - - if( blendSwap ) - { - currentBlendMode = nextBlendMode; - this.renderSession.blendModeManager.setBlendMode( currentBlendMode ); - } - - if( shaderSwap ) - { - currentShader = nextShader; - - shader = currentShader.shaders[gl.id]; - - if(!shader) - { - shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc =currentShader.fragmentSrc; - shader.uniforms =currentShader.uniforms; - shader.init(); - - currentShader.shaders[gl.id] = shader; - } - - // set shader function??? - this.renderSession.shaderManager.setShader(shader); - - if(shader.dirty)shader.syncUniforms(); - - // both thease only need to be set if they are changing.. - // set the projection - var projection = this.renderSession.projection; - gl.uniform2f(shader.projectionVector, projection.x, projection.y); - - // TODO - this is temprorary! - var offsetVector = this.renderSession.offset; - gl.uniform2f(shader.offsetVector, offsetVector.x, offsetVector.y); - - // set the pointers - } - } - - batchSize++; - } - - this.renderBatch(currentBaseTexture, batchSize, start); - - // then reset the batch! - this.currentBatchSize = 0; -}; - -/** -* @method renderBatch -* @param texture {Texture} -* @param size {Number} -* @param startIndex {Number} -*/ -PIXI.WebGLSpriteBatch.prototype.renderBatch = function(texture, size, startIndex) -{ - if(size === 0)return; - - var gl = this.gl; - - // check if a texture is dirty.. - if(texture._dirty[gl.id]) - { - this.renderSession.renderer.updateTexture(texture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]); - } - - // now draw those suckas! - gl.drawElements(gl.TRIANGLES, size * 6, gl.UNSIGNED_SHORT, startIndex * 6 * 2); - - // increment the draw count - this.renderSession.drawCount++; -}; - -/** -* @method stop -*/ -PIXI.WebGLSpriteBatch.prototype.stop = function() -{ - this.flush(); - this.dirty = true; -}; - -/** -* @method start -*/ -PIXI.WebGLSpriteBatch.prototype.start = function() -{ - this.dirty = true; -}; - -/** -* Destroys the SpriteBatch. -* -* @method destroy -*/ -PIXI.WebGLSpriteBatch.prototype.destroy = function() -{ - this.vertices = null; - this.indices = null; - - this.gl.deleteBuffer( this.vertexBuffer ); - this.gl.deleteBuffer( this.indexBuffer ); - - this.currentBaseTexture = null; - - this.gl = null; -}; -/** - * @author Mat Groves - * - * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ - * for creating the original pixi version! - * - * Heavily inspired by LibGDX's WebGLSpriteBatch: - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java - */ - -/** -* @class WebGLFastSpriteBatch -* @constructor -*/ -PIXI.WebGLFastSpriteBatch = function(gl) -{ - /** - * @property vertSize - * @type Number - */ - this.vertSize = 10; - - /** - * @property maxSize - * @type Number - */ - this.maxSize = 6000;//Math.pow(2, 16) / this.vertSize; - - /** - * @property size - * @type Number - */ - this.size = this.maxSize; - - //the total number of floats in our batch - var numVerts = this.size * 4 * this.vertSize; - - //the total number of indices in our batch - var numIndices = this.maxSize * 6; - - /** - * Vertex data - * @property vertices - * @type Float32Array - */ - this.vertices = new PIXI.Float32Array(numVerts); - - /** - * Index data - * @property indices - * @type Uint16Array - */ - this.indices = new PIXI.Uint16Array(numIndices); - - /** - * @property vertexBuffer - * @type Object - */ - this.vertexBuffer = null; - - /** - * @property indexBuffer - * @type Object - */ - this.indexBuffer = null; - - /** - * @property lastIndexCount - * @type Number - */ - this.lastIndexCount = 0; - - for (var i=0, j=0; i < numIndices; i += 6, j += 4) - { - this.indices[i + 0] = j + 0; - this.indices[i + 1] = j + 1; - this.indices[i + 2] = j + 2; - this.indices[i + 3] = j + 0; - this.indices[i + 4] = j + 2; - this.indices[i + 5] = j + 3; - } - - /** - * @property drawing - * @type Boolean - */ - this.drawing = false; - - /** - * @property currentBatchSize - * @type Number - */ - this.currentBatchSize = 0; - - /** - * @property currentBaseTexture - * @type BaseTexture - */ - this.currentBaseTexture = null; - - /** - * @property currentBlendMode - * @type Number - */ - this.currentBlendMode = 0; - - /** - * @property renderSession - * @type Object - */ - this.renderSession = null; - - /** - * @property shader - * @type Object - */ - this.shader = null; - - /** - * @property matrix - * @type Matrix - */ - this.matrix = null; - - this.setContext(gl); -}; - -PIXI.WebGLFastSpriteBatch.prototype.constructor = PIXI.WebGLFastSpriteBatch; - -/** - * Sets the WebGL Context. - * - * @method setContext - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLFastSpriteBatch.prototype.setContext = function(gl) -{ - this.gl = gl; - - // create a couple of buffers - this.vertexBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // 65535 is max index, so 65535 / 6 = 10922. - - //upload the index data - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); -}; - -/** - * @method begin - * @param spriteBatch {WebGLSpriteBatch} - * @param renderSession {Object} - */ -PIXI.WebGLFastSpriteBatch.prototype.begin = function(spriteBatch, renderSession) -{ - this.renderSession = renderSession; - this.shader = this.renderSession.shaderManager.fastShader; - - this.matrix = spriteBatch.worldTransform.toArray(true); - - this.start(); -}; - -/** - * @method end - */ -PIXI.WebGLFastSpriteBatch.prototype.end = function() -{ - this.flush(); -}; - -/** - * @method render - * @param spriteBatch {WebGLSpriteBatch} - */ -PIXI.WebGLFastSpriteBatch.prototype.render = function(spriteBatch) -{ - var children = spriteBatch.children; - var sprite = children[0]; - - // if the uvs have not updated then no point rendering just yet! - - // check texture. - if(!sprite.texture._uvs)return; - - this.currentBaseTexture = sprite.texture.baseTexture; - - // check blend mode - if(sprite.blendMode !== this.renderSession.blendModeManager.currentBlendMode) - { - this.flush(); - this.renderSession.blendModeManager.setBlendMode(sprite.blendMode); - } - - for(var i=0,j= children.length; i= this.size) - { - this.flush(); - } -}; - -/** - * @method flush - */ -PIXI.WebGLFastSpriteBatch.prototype.flush = function() -{ - // If the batch is length 0 then return as there is nothing to draw - if (this.currentBatchSize===0)return; - - var gl = this.gl; - - // bind the current texture - - if(!this.currentBaseTexture._glTextures[gl.id])this.renderSession.renderer.updateTexture(this.currentBaseTexture, gl); - - gl.bindTexture(gl.TEXTURE_2D, this.currentBaseTexture._glTextures[gl.id]); - - // upload the verts to the buffer - - if(this.currentBatchSize > ( this.size * 0.5 ) ) - { - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - } - else - { - var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize); - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); - } - - // now draw those suckas! - gl.drawElements(gl.TRIANGLES, this.currentBatchSize * 6, gl.UNSIGNED_SHORT, 0); - - // then reset the batch! - this.currentBatchSize = 0; - - // increment the draw count - this.renderSession.drawCount++; -}; - - -/** - * @method stop - */ -PIXI.WebGLFastSpriteBatch.prototype.stop = function() -{ - this.flush(); -}; - -/** - * @method start - */ -PIXI.WebGLFastSpriteBatch.prototype.start = function() -{ - var gl = this.gl; - - // bind the main texture - gl.activeTexture(gl.TEXTURE0); - - // bind the buffers - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - // set the projection - var projection = this.renderSession.projection; - gl.uniform2f(this.shader.projectionVector, projection.x, projection.y); - - // set the matrix - gl.uniformMatrix3fv(this.shader.uMatrix, false, this.matrix); - - // set the pointers - var stride = this.vertSize * 4; - - gl.vertexAttribPointer(this.shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0); - gl.vertexAttribPointer(this.shader.aPositionCoord, 2, gl.FLOAT, false, stride, 2 * 4); - gl.vertexAttribPointer(this.shader.aScale, 2, gl.FLOAT, false, stride, 4 * 4); - gl.vertexAttribPointer(this.shader.aRotation, 1, gl.FLOAT, false, stride, 6 * 4); - gl.vertexAttribPointer(this.shader.aTextureCoord, 2, gl.FLOAT, false, stride, 7 * 4); - gl.vertexAttribPointer(this.shader.colorAttribute, 1, gl.FLOAT, false, stride, 9 * 4); - -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLFilterManager -* @constructor -*/ -PIXI.WebGLFilterManager = function() -{ - /** - * @property filterStack - * @type Array - */ - this.filterStack = []; - - /** - * @property offsetX - * @type Number - */ - this.offsetX = 0; - - /** - * @property offsetY - * @type Number - */ - this.offsetY = 0; -}; - -PIXI.WebGLFilterManager.prototype.constructor = PIXI.WebGLFilterManager; - -/** -* Initialises the context and the properties. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLFilterManager.prototype.setContext = function(gl) -{ - this.gl = gl; - this.texturePool = []; - - this.initShaderBuffers(); -}; - -/** -* @method begin -* @param renderSession {RenderSession} -* @param buffer {ArrayBuffer} -*/ -PIXI.WebGLFilterManager.prototype.begin = function(renderSession, buffer) -{ - this.renderSession = renderSession; - this.defaultShader = renderSession.shaderManager.defaultShader; - - var projection = this.renderSession.projection; - this.width = projection.x * 2; - this.height = -projection.y * 2; - this.buffer = buffer; -}; - -/** -* Applies the filter and adds it to the current filter stack. -* -* @method pushFilter -* @param filterBlock {Object} the filter that will be pushed to the current filter stack -*/ -PIXI.WebGLFilterManager.prototype.pushFilter = function(filterBlock) -{ - var gl = this.gl; - - var projection = this.renderSession.projection; - var offset = this.renderSession.offset; - - filterBlock._filterArea = filterBlock.target.filterArea || filterBlock.target.getBounds(); - - // filter program - // OPTIMISATION - the first filter is free if its a simple color change? - this.filterStack.push(filterBlock); - - var filter = filterBlock.filterPasses[0]; - - this.offsetX += filterBlock._filterArea.x; - this.offsetY += filterBlock._filterArea.y; - - var texture = this.texturePool.pop(); - if(!texture) - { - texture = new PIXI.FilterTexture(this.gl, this.width, this.height); - } - else - { - texture.resize(this.width, this.height); - } - - gl.bindTexture(gl.TEXTURE_2D, texture.texture); - - var filterArea = filterBlock._filterArea;// filterBlock.target.getBounds();///filterBlock.target.filterArea; - - var padding = filter.padding; - filterArea.x -= padding; - filterArea.y -= padding; - filterArea.width += padding * 2; - filterArea.height += padding * 2; - - // cap filter to screen size.. - if(filterArea.x < 0)filterArea.x = 0; - if(filterArea.width > this.width)filterArea.width = this.width; - if(filterArea.y < 0)filterArea.y = 0; - if(filterArea.height > this.height)filterArea.height = this.height; - - //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, filterArea.width, filterArea.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); - gl.bindFramebuffer(gl.FRAMEBUFFER, texture.frameBuffer); - - // set view port - gl.viewport(0, 0, filterArea.width, filterArea.height); - - projection.x = filterArea.width/2; - projection.y = -filterArea.height/2; - - offset.x = -filterArea.x; - offset.y = -filterArea.y; - - // update projection - // now restore the regular shader.. - // this.renderSession.shaderManager.setShader(this.defaultShader); - //gl.uniform2f(this.defaultShader.projectionVector, filterArea.width/2, -filterArea.height/2); - //gl.uniform2f(this.defaultShader.offsetVector, -filterArea.x, -filterArea.y); - - gl.colorMask(true, true, true, true); - gl.clearColor(0,0,0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); - - filterBlock._glFilterTexture = texture; - -}; - -/** -* Removes the last filter from the filter stack and doesn't return it. -* -* @method popFilter -*/ -PIXI.WebGLFilterManager.prototype.popFilter = function() -{ - var gl = this.gl; - var filterBlock = this.filterStack.pop(); - var filterArea = filterBlock._filterArea; - var texture = filterBlock._glFilterTexture; - var projection = this.renderSession.projection; - var offset = this.renderSession.offset; - - if(filterBlock.filterPasses.length > 1) - { - gl.viewport(0, 0, filterArea.width, filterArea.height); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - - this.vertexArray[0] = 0; - this.vertexArray[1] = filterArea.height; - - this.vertexArray[2] = filterArea.width; - this.vertexArray[3] = filterArea.height; - - this.vertexArray[4] = 0; - this.vertexArray[5] = 0; - - this.vertexArray[6] = filterArea.width; - this.vertexArray[7] = 0; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - // now set the uvs.. - this.uvArray[2] = filterArea.width/this.width; - this.uvArray[5] = filterArea.height/this.height; - this.uvArray[6] = filterArea.width/this.width; - this.uvArray[7] = filterArea.height/this.height; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray); - - var inputTexture = texture; - var outputTexture = this.texturePool.pop(); - if(!outputTexture)outputTexture = new PIXI.FilterTexture(this.gl, this.width, this.height); - outputTexture.resize(this.width, this.height); - - // need to clear this FBO as it may have some left over elements from a previous filter. - gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer ); - gl.clear(gl.COLOR_BUFFER_BIT); - - gl.disable(gl.BLEND); - - for (var i = 0; i < filterBlock.filterPasses.length-1; i++) - { - var filterPass = filterBlock.filterPasses[i]; - - gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer ); - - // set texture - gl.activeTexture(gl.TEXTURE0); - gl.bindTexture(gl.TEXTURE_2D, inputTexture.texture); - - // draw texture.. - //filterPass.applyFilterPass(filterArea.width, filterArea.height); - this.applyFilterPass(filterPass, filterArea, filterArea.width, filterArea.height); - - // swap the textures.. - var temp = inputTexture; - inputTexture = outputTexture; - outputTexture = temp; - } - - gl.enable(gl.BLEND); - - texture = inputTexture; - this.texturePool.push(outputTexture); - } - - var filter = filterBlock.filterPasses[filterBlock.filterPasses.length-1]; - - this.offsetX -= filterArea.x; - this.offsetY -= filterArea.y; - - var sizeX = this.width; - var sizeY = this.height; - - var offsetX = 0; - var offsetY = 0; - - var buffer = this.buffer; - - // time to render the filters texture to the previous scene - if(this.filterStack.length === 0) - { - gl.colorMask(true, true, true, true);//this.transparent); - } - else - { - var currentFilter = this.filterStack[this.filterStack.length-1]; - filterArea = currentFilter._filterArea; - - sizeX = filterArea.width; - sizeY = filterArea.height; - - offsetX = filterArea.x; - offsetY = filterArea.y; - - buffer = currentFilter._glFilterTexture.frameBuffer; - } - - // TODO need to remove these global elements.. - projection.x = sizeX/2; - projection.y = -sizeY/2; - - offset.x = offsetX; - offset.y = offsetY; - - filterArea = filterBlock._filterArea; - - var x = filterArea.x-offsetX; - var y = filterArea.y-offsetY; - - // update the buffers.. - // make sure to flip the y! - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - - this.vertexArray[0] = x; - this.vertexArray[1] = y + filterArea.height; - - this.vertexArray[2] = x + filterArea.width; - this.vertexArray[3] = y + filterArea.height; - - this.vertexArray[4] = x; - this.vertexArray[5] = y; - - this.vertexArray[6] = x + filterArea.width; - this.vertexArray[7] = y; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - - this.uvArray[2] = filterArea.width/this.width; - this.uvArray[5] = filterArea.height/this.height; - this.uvArray[6] = filterArea.width/this.width; - this.uvArray[7] = filterArea.height/this.height; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray); - - gl.viewport(0, 0, sizeX * this.renderSession.resolution, sizeY * this.renderSession.resolution); - - // bind the buffer - gl.bindFramebuffer(gl.FRAMEBUFFER, buffer ); - - // set the blend mode! - //gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA) - - // set texture - gl.activeTexture(gl.TEXTURE0); - gl.bindTexture(gl.TEXTURE_2D, texture.texture); - - // apply! - this.applyFilterPass(filter, filterArea, sizeX, sizeY); - - // now restore the regular shader.. should happen automatically now.. - // this.renderSession.shaderManager.setShader(this.defaultShader); - // gl.uniform2f(this.defaultShader.projectionVector, sizeX/2, -sizeY/2); - // gl.uniform2f(this.defaultShader.offsetVector, -offsetX, -offsetY); - - // return the texture to the pool - this.texturePool.push(texture); - filterBlock._glFilterTexture = null; -}; - - -/** -* Applies the filter to the specified area. -* -* @method applyFilterPass -* @param filter {AbstractFilter} the filter that needs to be applied -* @param filterArea {Texture} TODO - might need an update -* @param width {Number} the horizontal range of the filter -* @param height {Number} the vertical range of the filter -*/ -PIXI.WebGLFilterManager.prototype.applyFilterPass = function(filter, filterArea, width, height) -{ - // use program - var gl = this.gl; - var shader = filter.shaders[gl.id]; - - if(!shader) - { - shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc = filter.fragmentSrc; - shader.uniforms = filter.uniforms; - shader.init(); - - filter.shaders[gl.id] = shader; - } - - // set the shader - this.renderSession.shaderManager.setShader(shader); - -// gl.useProgram(shader.program); - - gl.uniform2f(shader.projectionVector, width/2, -height/2); - gl.uniform2f(shader.offsetVector, 0,0); - - if(filter.uniforms.dimensions) - { - filter.uniforms.dimensions.value[0] = this.width;//width; - filter.uniforms.dimensions.value[1] = this.height;//height; - filter.uniforms.dimensions.value[2] = this.vertexArray[0]; - filter.uniforms.dimensions.value[3] = this.vertexArray[5];//filterArea.height; - } - - shader.syncUniforms(); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer); - gl.vertexAttribPointer(shader.colorAttribute, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - // draw the filter... - gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 ); - - this.renderSession.drawCount++; -}; - -/** -* Initialises the shader buffers. -* -* @method initShaderBuffers -*/ -PIXI.WebGLFilterManager.prototype.initShaderBuffers = function() -{ - var gl = this.gl; - - // create some buffers - this.vertexBuffer = gl.createBuffer(); - this.uvBuffer = gl.createBuffer(); - this.colorBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // bind and upload the vertexs.. - // keep a reference to the vertexFloatData.. - this.vertexArray = new PIXI.Float32Array([0.0, 0.0, - 1.0, 0.0, - 0.0, 1.0, - 1.0, 1.0]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertexArray, gl.STATIC_DRAW); - - // bind and upload the uv buffer - this.uvArray = new PIXI.Float32Array([0.0, 0.0, - 1.0, 0.0, - 0.0, 1.0, - 1.0, 1.0]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvArray, gl.STATIC_DRAW); - - this.colorArray = new PIXI.Float32Array([1.0, 0xFFFFFF, - 1.0, 0xFFFFFF, - 1.0, 0xFFFFFF, - 1.0, 0xFFFFFF]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.colorArray, gl.STATIC_DRAW); - - // bind and upload the index - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 1, 3, 2]), gl.STATIC_DRAW); - -}; - -/** -* Destroys the filter and removes it from the filter stack. -* -* @method destroy -*/ -PIXI.WebGLFilterManager.prototype.destroy = function() -{ - var gl = this.gl; - - this.filterStack = null; - - this.offsetX = 0; - this.offsetY = 0; - - // destroy textures - for (var i = 0; i < this.texturePool.length; i++) { - this.texturePool[i].destroy(); - } - - this.texturePool = null; - - //destroy buffers.. - gl.deleteBuffer(this.vertexBuffer); - gl.deleteBuffer(this.uvBuffer); - gl.deleteBuffer(this.colorBuffer); - gl.deleteBuffer(this.indexBuffer); -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class FilterTexture -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -* @param width {Number} the horizontal range of the filter -* @param height {Number} the vertical range of the filter -* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values -*/ -PIXI.FilterTexture = function(gl, width, height, scaleMode) -{ - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - // next time to create a frame buffer and texture - - /** - * @property frameBuffer - * @type Any - */ - this.frameBuffer = gl.createFramebuffer(); - - /** - * @property texture - * @type Any - */ - this.texture = gl.createTexture(); - - /** - * @property scaleMode - * @type Number - */ - scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - gl.bindTexture(gl.TEXTURE_2D, this.texture); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer ); - - gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer ); - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); - - // required for masking a mask?? - this.renderBuffer = gl.createRenderbuffer(); - gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer); - gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.renderBuffer); - - this.resize(width, height); -}; - -PIXI.FilterTexture.prototype.constructor = PIXI.FilterTexture; - -/** -* Clears the filter texture. -* -* @method clear -*/ -PIXI.FilterTexture.prototype.clear = function() -{ - var gl = this.gl; - - gl.clearColor(0,0,0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); -}; - -/** - * Resizes the texture to the specified width and height - * - * @method resize - * @param width {Number} the new width of the texture - * @param height {Number} the new height of the texture - */ -PIXI.FilterTexture.prototype.resize = function(width, height) -{ - if(this.width === width && this.height === height) return; - - this.width = width; - this.height = height; - - var gl = this.gl; - - gl.bindTexture(gl.TEXTURE_2D, this.texture); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width , height , 0, gl.RGBA, gl.UNSIGNED_BYTE, null); - // update the stencil buffer width and height - gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer); - gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width , height ); -}; - -/** -* Destroys the filter texture. -* -* @method destroy -*/ -PIXI.FilterTexture.prototype.destroy = function() -{ - var gl = this.gl; - gl.deleteFramebuffer( this.frameBuffer ); - gl.deleteTexture( this.texture ); - - this.frameBuffer = null; - this.texture = null; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Creates a Canvas element of the given size. - * - * @class CanvasBuffer - * @constructor - * @param width {Number} the width for the newly created canvas - * @param height {Number} the height for the newly created canvas - */ -PIXI.CanvasBuffer = function(width, height) -{ - /** - * The width of the Canvas in pixels. - * - * @property width - * @type Number - */ - this.width = width; - - /** - * The height of the Canvas in pixels. - * - * @property height - * @type Number - */ - this.height = height; - - /** - * The Canvas object that belongs to this CanvasBuffer. - * - * @property canvas - * @type HTMLCanvasElement - */ - this.canvas = document.createElement("canvas"); - - /** - * A CanvasRenderingContext2D object representing a two-dimensional rendering context. - * - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.canvas.getContext("2d"); - - this.canvas.width = width; - this.canvas.height = height; -}; - -PIXI.CanvasBuffer.prototype.constructor = PIXI.CanvasBuffer; - -/** - * Clears the canvas that was created by the CanvasBuffer class. - * - * @method clear - * @private - */ -PIXI.CanvasBuffer.prototype.clear = function() -{ - this.context.setTransform(1, 0, 0, 1, 0, 0); - this.context.clearRect(0,0, this.width, this.height); -}; - -/** - * Resizes the canvas to the specified width and height. - * - * @method resize - * @param width {Number} the new width of the canvas - * @param height {Number} the new height of the canvas - */ -PIXI.CanvasBuffer.prototype.resize = function(width, height) -{ - this.width = this.canvas.width = width; - this.height = this.canvas.height = height; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A set of functions used to handle masking. - * - * @class CanvasMaskManager - * @constructor - */ -PIXI.CanvasMaskManager = function() -{ -}; - -PIXI.CanvasMaskManager.prototype.constructor = PIXI.CanvasMaskManager; - -/** - * This method adds it to the current stack of masks. - * - * @method pushMask - * @param maskData {Object} the maskData that will be pushed - * @param renderSession {Object} The renderSession whose context will be used for this mask manager. - */ -PIXI.CanvasMaskManager.prototype.pushMask = function(maskData, renderSession) -{ - var context = renderSession.context; - - context.save(); - - var cacheAlpha = maskData.alpha; - var transform = maskData.worldTransform; - - var resolution = renderSession.resolution; - - context.setTransform(transform.a * resolution, - transform.b * resolution, - transform.c * resolution, - transform.d * resolution, - transform.tx * resolution, - transform.ty * resolution); - - PIXI.CanvasGraphics.renderGraphicsMask(maskData, context); - - context.clip(); - - maskData.worldAlpha = cacheAlpha; -}; - -/** - * Restores the current drawing context to the state it was before the mask was applied. - * - * @method popMask - * @param renderSession {Object} The renderSession whose context will be used for this mask manager. - */ -PIXI.CanvasMaskManager.prototype.popMask = function(renderSession) -{ - renderSession.context.restore(); -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Utility methods for Sprite/Texture tinting. - * - * @class CanvasTinter - * @static - */ -PIXI.CanvasTinter = function() -{ -}; - -/** - * Basically this method just needs a sprite and a color and tints the sprite with the given color. - * - * @method getTintedTexture - * @static - * @param sprite {Sprite} the sprite to tint - * @param color {Number} the color to use to tint the sprite with - * @return {HTMLCanvasElement} The tinted canvas - */ -PIXI.CanvasTinter.getTintedTexture = function(sprite, color) -{ - var texture = sprite.texture; - - color = PIXI.CanvasTinter.roundColor(color); - - var stringColor = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - - texture.tintCache = texture.tintCache || {}; - - if(texture.tintCache[stringColor]) return texture.tintCache[stringColor]; - - // clone texture.. - var canvas = PIXI.CanvasTinter.canvas || document.createElement("canvas"); - - //PIXI.CanvasTinter.tintWithPerPixel(texture, stringColor, canvas); - PIXI.CanvasTinter.tintMethod(texture, color, canvas); - - if(PIXI.CanvasTinter.convertTintToImage) - { - // is this better? - var tintImage = new Image(); - tintImage.src = canvas.toDataURL(); - - texture.tintCache[stringColor] = tintImage; - } - else - { - texture.tintCache[stringColor] = canvas; - // if we are not converting the texture to an image then we need to lose the reference to the canvas - PIXI.CanvasTinter.canvas = null; - } - - return canvas; -}; - -/** - * Tint a texture using the "multiply" operation. - * - * @method tintWithMultiply - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithMultiply = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - - context.fillRect(0, 0, crop.width, crop.height); - - context.globalCompositeOperation = "multiply"; - - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - context.globalCompositeOperation = "destination-atop"; - - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); -}; - -/** - * Tint a texture using the "overlay" operation. - * - * @method tintWithOverlay - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithOverlay = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.globalCompositeOperation = "copy"; - context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - context.fillRect(0, 0, crop.width, crop.height); - - context.globalCompositeOperation = "destination-atop"; - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - //context.globalCompositeOperation = "copy"; -}; - -/** - * Tint a texture pixel per pixel. - * - * @method tintPerPixel - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithPerPixel = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.globalCompositeOperation = "copy"; - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - var rgbValues = PIXI.hex2rgb(color); - var r = rgbValues[0], g = rgbValues[1], b = rgbValues[2]; - - var pixelData = context.getImageData(0, 0, crop.width, crop.height); - - var pixels = pixelData.data; - - for (var i = 0; i < pixels.length; i += 4) - { - pixels[i+0] *= r; - pixels[i+1] *= g; - pixels[i+2] *= b; - } - - context.putImageData(pixelData, 0, 0); -}; - -/** - * Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel. - * - * @method roundColor - * @static - * @param color {number} the color to round, should be a hex color - */ -PIXI.CanvasTinter.roundColor = function(color) -{ - var step = PIXI.CanvasTinter.cacheStepsPerColorChannel; - - var rgbValues = PIXI.hex2rgb(color); - - rgbValues[0] = Math.min(255, (rgbValues[0] / step) * step); - rgbValues[1] = Math.min(255, (rgbValues[1] / step) * step); - rgbValues[2] = Math.min(255, (rgbValues[2] / step) * step); - - return PIXI.rgb2hex(rgbValues); -}; - -/** - * Number of steps which will be used as a cap when rounding colors. - * - * @property cacheStepsPerColorChannel - * @type Number - * @static - */ -PIXI.CanvasTinter.cacheStepsPerColorChannel = 8; - -/** - * Tint cache boolean flag. - * - * @property convertTintToImage - * @type Boolean - * @static - */ -PIXI.CanvasTinter.convertTintToImage = false; - -/** - * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. - * - * @property canUseMultiply - * @type Boolean - * @static - */ -PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes(); - -/** - * The tinting method that will be used. - * - * @method tintMethod - * @static - */ -PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The CanvasRenderer draws the Stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. - * Don't forget to add the CanvasRenderer.view to your DOM or you will not see anything :) - * - * @class CanvasRenderer - * @constructor - * @param [width=800] {Number} the width of the canvas view - * @param [height=600] {Number} the height of the canvas view - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * @param [options.clearBeforeRender=true] {Boolean} This sets if the CanvasRenderer will clear the canvas or not before the new render pass. - */ -PIXI.CanvasRenderer = function(width, height, options) -{ - if(options) - { - for (var i in PIXI.defaultRenderOptions) - { - if (typeof options[i] === "undefined") options[i] = PIXI.defaultRenderOptions[i]; - } - } - else - { - options = PIXI.defaultRenderOptions; - } - - if(!PIXI.defaultRenderer) - { - PIXI.sayHello("Canvas"); - PIXI.defaultRenderer = this; - } - - /** - * The renderer type. - * - * @property type - * @type Number - */ - this.type = PIXI.CANVAS_RENDERER; - - /** - * The resolution of the canvas. - * - * @property resolution - * @type Number - */ - this.resolution = options.resolution; - - /** - * This sets if the CanvasRenderer will clear the canvas or not before the new render pass. - * If the Stage is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color. - * If the Stage is transparent Pixi will use clearRect to clear the canvas every frame. - * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set. - * - * @property clearBeforeRender - * @type Boolean - * @default - */ - this.clearBeforeRender = options.clearBeforeRender; - - /** - * Whether the render view is transparent - * - * @property transparent - * @type Boolean - */ - this.transparent = options.transparent; - - /** - * Whether the render view should be resized automatically - * - * @property autoResize - * @type Boolean - */ - this.autoResize = options.autoResize || false; - - - /** - * The width of the canvas view - * - * @property width - * @type Number - * @default 800 - */ - this.width = width || 800; - - /** - * The height of the canvas view - * - * @property height - * @type Number - * @default 600 - */ - this.height = height || 600; - - this.width *= this.resolution; - this.height *= this.resolution; - - /** - * The canvas element that everything is drawn to. - * - * @property view - * @type HTMLCanvasElement - */ - this.view = options.view || document.createElement( "canvas" ); - - /** - * The canvas 2d context that everything is drawn with - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.view.getContext( "2d", { alpha: this.transparent } ); - - /** - * Boolean flag controlling canvas refresh. - * - * @property refresh - * @type Boolean - */ - this.refresh = true; - - this.view.width = this.width * this.resolution; - this.view.height = this.height * this.resolution; - - /** - * Internal var. - * - * @property count - * @type Number - */ - this.count = 0; - - /** - * Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer - * @property maskManager - * @type CanvasMaskManager - */ - this.maskManager = new PIXI.CanvasMaskManager(); - - /** - * The render session is just a bunch of parameter used for rendering - * @property renderSession - * @type Object - */ - this.renderSession = { - context: this.context, - maskManager: this.maskManager, - scaleMode: null, - smoothProperty: null, - /** - * If true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation. - * Handy for crisp pixel art and speed on legacy devices. - * - */ - roundPixels: false - }; - - this.mapBlendModes(); - - this.resize(width, height); - - if("imageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "imageSmoothingEnabled"; - else if("webkitImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "webkitImageSmoothingEnabled"; - else if("mozImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "mozImageSmoothingEnabled"; - else if("oImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "oImageSmoothingEnabled"; - else if ("msImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "msImageSmoothingEnabled"; -}; - -// constructor -PIXI.CanvasRenderer.prototype.constructor = PIXI.CanvasRenderer; - -/** - * Renders the Stage to this canvas view - * - * @method render - * @param stage {Stage} the Stage element to be rendered - */ -PIXI.CanvasRenderer.prototype.render = function(stage) -{ - stage.updateTransform(); - - this.context.setTransform(1,0,0,1,0,0); - - this.context.globalAlpha = 1; - - this.renderSession.currentBlendMode = PIXI.blendModes.NORMAL; - this.context.globalCompositeOperation = PIXI.blendModesCanvas[PIXI.blendModes.NORMAL]; - - if (navigator.isCocoonJS && this.view.screencanvas) { - this.context.fillStyle = "black"; - this.context.clear(); - } - - if (this.clearBeforeRender) - { - if (this.transparent) - { - this.context.clearRect(0, 0, this.width, this.height); - } - else - { - this.context.fillStyle = stage.backgroundColorString; - this.context.fillRect(0, 0, this.width , this.height); - } - } - - this.renderDisplayObject(stage); - - // run interaction! - if(stage.interactive) - { - //need to add some events! - if(!stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = true; - stage.interactionManager.setTarget(this); - } - } -}; - -/** - * Removes everything from the renderer and optionally removes the Canvas DOM element. - * - * @method destroy - * @param [removeView=true] {boolean} Removes the Canvas element from the DOM. - */ -PIXI.CanvasRenderer.prototype.destroy = function(removeView) -{ - if (typeof removeView === "undefined") { removeView = true; } - - if (removeView && this.view.parent) - { - this.view.parent.removeChild(this.view); - } - - this.view = null; - this.context = null; - this.maskManager = null; - this.renderSession = null; - -}; - -/** - * Resizes the canvas view to the specified width and height - * - * @method resize - * @param width {Number} the new width of the canvas view - * @param height {Number} the new height of the canvas view - */ -PIXI.CanvasRenderer.prototype.resize = function(width, height) -{ - this.width = width * this.resolution; - this.height = height * this.resolution; - - this.view.width = this.width; - this.view.height = this.height; - - if (this.autoResize) { - this.view.style.width = this.width / this.resolution + "px"; - this.view.style.height = this.height / this.resolution + "px"; - } -}; - -/** - * Renders a display object - * - * @method renderDisplayObject - * @param displayObject {DisplayObject} The displayObject to render - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas - * @private - */ -PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject, context) -{ - this.renderSession.context = context || this.context; - this.renderSession.resolution = this.resolution; - displayObject._renderCanvas(this.renderSession); -}; - -/** - * Maps Pixi blend modes to canvas blend modes. - * - * @method mapBlendModes - * @private - */ -PIXI.CanvasRenderer.prototype.mapBlendModes = function() -{ - if(!PIXI.blendModesCanvas) - { - PIXI.blendModesCanvas = []; - - if(PIXI.canUseNewCanvasBlendModes()) - { - PIXI.blendModesCanvas[PIXI.blendModes.NORMAL] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.ADD] = "lighter"; //IS THIS OK??? - PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "multiply"; - PIXI.blendModesCanvas[PIXI.blendModes.SCREEN] = "screen"; - PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY] = "overlay"; - PIXI.blendModesCanvas[PIXI.blendModes.DARKEN] = "darken"; - PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN] = "lighten"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "color-dodge"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "color-burn"; - PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "hard-light"; - PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "soft-light"; - PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "difference"; - PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "exclusion"; - PIXI.blendModesCanvas[PIXI.blendModes.HUE] = "hue"; - PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "saturation"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR] = "color"; - PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "luminosity"; - } - else - { - // this means that the browser does not support the cool new blend modes in canvas "cough" ie "cough" - PIXI.blendModesCanvas[PIXI.blendModes.NORMAL] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.ADD] = "lighter"; //IS THIS OK??? - PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SCREEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.DARKEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.HUE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "source-over"; - } - } -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - - -/** - * A set of functions used by the canvas renderer to draw the primitive graphics data. - * - * @class CanvasGraphics - * @static - */ -PIXI.CanvasGraphics = function() -{ -}; - -/* - * Renders a PIXI.Graphics object to a canvas. - * - * @method renderGraphics - * @static - * @param graphics {Graphics} the actual graphics object to render - * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas - */ -PIXI.CanvasGraphics.renderGraphics = function(graphics, context) -{ - var worldAlpha = graphics.worldAlpha; - - if(graphics.dirty) - { - this.updateGraphicsTint(graphics); - graphics.dirty = false; - } - - - for (var i = 0; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - var shape = data.shape; - - var fillColor = data._fillTint; - var lineColor = data._lineTint; - - context.lineWidth = data.lineWidth; - - if(data.type === PIXI.Graphics.POLY) - { - context.beginPath(); - - var points = shape.points; - - context.moveTo(points[0], points[1]); - - for (var j=1; j < points.length/2; j++) - { - context.lineTo(points[j * 2], points[j * 2 + 1]); - } - - if(shape.closed) - { - context.lineTo(points[0], points[1]); - } - - // if the first and last point are the same close the path - much neater :) - if(points[0] === points[points.length-2] && points[1] === points[points.length-1]) - { - context.closePath(); - } - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if(data.type === PIXI.Graphics.RECT) - { - - if(data.fillColor || data.fillColor === 0) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fillRect(shape.x, shape.y, shape.width, shape.height); - - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.strokeRect(shape.x, shape.y, shape.width, shape.height); - } - } - else if(data.type === PIXI.Graphics.CIRC) - { - // TODO - need to be Undefined! - context.beginPath(); - context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI); - context.closePath(); - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if(data.type === PIXI.Graphics.ELIP) - { - // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas - - var w = shape.width * 2; - var h = shape.height * 2; - - var x = shape.x - w/2; - var y = shape.y - h/2; - - context.beginPath(); - - var kappa = 0.5522848, - ox = (w / 2) * kappa, // control point offset horizontal - oy = (h / 2) * kappa, // control point offset vertical - xe = x + w, // x-end - ye = y + h, // y-end - xm = x + w / 2, // x-middle - ym = y + h / 2; // y-middle - - context.moveTo(x, ym); - context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); - context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); - context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); - context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); - - context.closePath(); - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if (data.type === PIXI.Graphics.RREC) - { - var rx = shape.x; - var ry = shape.y; - var width = shape.width; - var height = shape.height; - var radius = shape.radius; - - var maxRadius = Math.min(width, height) / 2 | 0; - radius = radius > maxRadius ? maxRadius : radius; - - context.beginPath(); - context.moveTo(rx, ry + radius); - context.lineTo(rx, ry + height - radius); - context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height); - context.lineTo(rx + width - radius, ry + height); - context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius); - context.lineTo(rx + width, ry + radius); - context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry); - context.lineTo(rx + radius, ry); - context.quadraticCurveTo(rx, ry, rx, ry + radius); - context.closePath(); - - if(data.fillColor || data.fillColor === 0) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - } -}; - -/* - * Renders a graphics mask - * - * @static - * @private - * @method renderGraphicsMask - * @param graphics {Graphics} the graphics which will be used as a mask - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas - */ -PIXI.CanvasGraphics.renderGraphicsMask = function(graphics, context) -{ - var len = graphics.graphicsData.length; - - if(len === 0) return; - - if(len > 1) - { - len = 1; - window.console.log('Pixi.js warning: masks in canvas can only mask using the first path in the graphics object'); - } - - for (var i = 0; i < 1; i++) - { - var data = graphics.graphicsData[i]; - var shape = data.shape; - - if(data.type === PIXI.Graphics.POLY) - { - context.beginPath(); - - var points = shape.points; - - context.moveTo(points[0], points[1]); - - for (var j=1; j < points.length/2; j++) - { - context.lineTo(points[j * 2], points[j * 2 + 1]); - } - - // if the first and last point are the same close the path - much neater :) - if(points[0] === points[points.length-2] && points[1] === points[points.length-1]) - { - context.closePath(); - } - - } - else if(data.type === PIXI.Graphics.RECT) - { - context.beginPath(); - context.rect(shape.x, shape.y, shape.width, shape.height); - context.closePath(); - } - else if(data.type === PIXI.Graphics.CIRC) - { - // TODO - need to be Undefined! - context.beginPath(); - context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI); - context.closePath(); - } - else if(data.type === PIXI.Graphics.ELIP) - { - - // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas - - var w = shape.width * 2; - var h = shape.height * 2; - - var x = shape.x - w/2; - var y = shape.y - h/2; - - context.beginPath(); - - var kappa = 0.5522848, - ox = (w / 2) * kappa, // control point offset horizontal - oy = (h / 2) * kappa, // control point offset vertical - xe = x + w, // x-end - ye = y + h, // y-end - xm = x + w / 2, // x-middle - ym = y + h / 2; // y-middle - - context.moveTo(x, ym); - context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); - context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); - context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); - context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); - context.closePath(); - } - else if (data.type === PIXI.Graphics.RREC) - { - - var pts = shape.points; - var rx = pts[0]; - var ry = pts[1]; - var width = pts[2]; - var height = pts[3]; - var radius = pts[4]; - - var maxRadius = Math.min(width, height) / 2 | 0; - radius = radius > maxRadius ? maxRadius : radius; - - context.beginPath(); - context.moveTo(rx, ry + radius); - context.lineTo(rx, ry + height - radius); - context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height); - context.lineTo(rx + width - radius, ry + height); - context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius); - context.lineTo(rx + width, ry + radius); - context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry); - context.lineTo(rx + radius, ry); - context.quadraticCurveTo(rx, ry, rx, ry + radius); - context.closePath(); - } - } -}; - -PIXI.CanvasGraphics.updateGraphicsTint = function(graphics) -{ - if(graphics.tint === 0xFFFFFF)return; - - var tintR = (graphics.tint >> 16 & 0xFF) / 255; - var tintG = (graphics.tint >> 8 & 0xFF) / 255; - var tintB = (graphics.tint & 0xFF)/ 255; - - for (var i = 0; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - - var fillColor = data.fillColor | 0; - var lineColor = data.lineColor | 0; - - /* - var colorR = (fillColor >> 16 & 0xFF) / 255; - var colorG = (fillColor >> 8 & 0xFF) / 255; - var colorB = (fillColor & 0xFF) / 255; - - colorR *= tintR; - colorG *= tintG; - colorB *= tintB; - - fillColor = ((colorR*255 << 16) + (colorG*255 << 8) + colorB*255); - - colorR = (lineColor >> 16 & 0xFF) / 255; - colorG = (lineColor >> 8 & 0xFF) / 255; - colorB = (lineColor & 0xFF) / 255; - - colorR *= tintR; - colorG *= tintG; - colorB *= tintB; - - lineColor = ((colorR*255 << 16) + (colorG*255 << 8) + colorB*255); - */ - - // super inline cos im an optimization NAZI :) - data._fillTint = (((fillColor >> 16 & 0xFF) / 255 * tintR*255 << 16) + ((fillColor >> 8 & 0xFF) / 255 * tintG*255 << 8) + (fillColor & 0xFF) / 255 * tintB*255); - data._lineTint = (((lineColor >> 16 & 0xFF) / 255 * tintR*255 << 16) + ((lineColor >> 8 & 0xFF) / 255 * tintG*255 << 8) + (lineColor & 0xFF) / 255 * tintB*255); - - } -}; - - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and color and fill them. - * - * @class Graphics - * @extends DisplayObjectContainer - * @constructor - */ -PIXI.Graphics = function() -{ - PIXI.DisplayObjectContainer.call( this ); - - this.renderable = true; - - /** - * The alpha value used when filling the Graphics object. - * - * @property fillAlpha - * @type Number - */ - this.fillAlpha = 1; - - /** - * The width (thickness) of any lines drawn. - * - * @property lineWidth - * @type Number - */ - this.lineWidth = 0; - - /** - * The color of any lines drawn. - * - * @property lineColor - * @type String - * @default 0 - */ - this.lineColor = 0; - - /** - * Graphics data - * - * @property graphicsData - * @type Array - * @private - */ - this.graphicsData = []; - - /** - * The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint. - * - * @property tint - * @type Number - * @default 0xFFFFFF - */ - this.tint = 0xFFFFFF; - - /** - * The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode. - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - /** - * Current path - * - * @property currentPath - * @type Object - * @private - */ - this.currentPath = null; - - /** - * Array containing some WebGL-related properties used by the WebGL renderer. - * - * @property _webGL - * @type Array - * @private - */ - this._webGL = []; - - /** - * Whether this shape is being used as a mask. - * - * @property isMask - * @type Boolean - */ - this.isMask = false; - - /** - * The bounds' padding used for bounds calculation. - * - * @property boundsPadding - * @type Number - */ - this.boundsPadding = 0; - - this._localBounds = new PIXI.Rectangle(0,0,1,1); - - /** - * Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated. - * - * @property dirty - * @type Boolean - * @private - */ - this.dirty = true; - - /** - * Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated. - * - * @property webGLDirty - * @type Boolean - * @private - */ - this.webGLDirty = false; - - /** - * Used to detect if the cached sprite object needs to be updated. - * - * @property cachedSpriteDirty - * @type Boolean - * @private - */ - this.cachedSpriteDirty = false; - -}; - -// constructor -PIXI.Graphics.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); -PIXI.Graphics.prototype.constructor = PIXI.Graphics; - -/** - * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. - * This is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory. - * It is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas. - * This is not recommended if you are constantly redrawing the graphics element. - * - * @property cacheAsBitmap - * @type Boolean - * @default false - * @private - */ -Object.defineProperty(PIXI.Graphics.prototype, "cacheAsBitmap", { - get: function() { - return this._cacheAsBitmap; - }, - set: function(value) { - this._cacheAsBitmap = value; - - if(this._cacheAsBitmap) - { - - this._generateCachedSprite(); - } - else - { - this.destroyCachedSprite(); - this.dirty = true; - } - - } -}); - -/** - * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method. - * - * @method lineStyle - * @param lineWidth {Number} width of the line to draw, will update the objects stored style - * @param color {Number} color of the line to draw, will update the objects stored style - * @param alpha {Number} alpha of the line to draw, will update the objects stored style - * @return {Graphics} - */ -PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha) -{ - this.lineWidth = lineWidth || 0; - this.lineColor = color || 0; - this.lineAlpha = (arguments.length < 3) ? 1 : alpha; - - if(this.currentPath) - { - if(this.currentPath.shape.points.length) - { - // halfway through a line? start a new one! - this.drawShape( new PIXI.Polygon( this.currentPath.shape.points.slice(-2) )); - return this; - } - - // otherwise its empty so lets just set the line properties - this.currentPath.lineWidth = this.lineWidth; - this.currentPath.lineColor = this.lineColor; - this.currentPath.lineAlpha = this.lineAlpha; - - } - - return this; -}; - -/** - * Moves the current drawing position to x, y. - * - * @method moveTo - * @param x {Number} the X coordinate to move to - * @param y {Number} the Y coordinate to move to - * @return {Graphics} - */ -PIXI.Graphics.prototype.moveTo = function(x, y) -{ - this.drawShape(new PIXI.Polygon([x,y])); - - return this; -}; - -/** - * Draws a line using the current line style from the current drawing position to (x, y); - * The current drawing position is then set to (x, y). - * - * @method lineTo - * @param x {Number} the X coordinate to draw to - * @param y {Number} the Y coordinate to draw to - * @return {Graphics} - */ -PIXI.Graphics.prototype.lineTo = function(x, y) -{ - this.currentPath.shape.points.push(x, y); - this.dirty = true; - - return this; -}; - -/** - * Calculate the points for a quadratic bezier curve and then draws it. - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c - * - * @method quadraticCurveTo - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Graphics} - */ -PIXI.Graphics.prototype.quadraticCurveTo = function(cpX, cpY, toX, toY) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0]; - } - else - { - this.moveTo(0,0); - } - - var xa, - ya, - n = 20, - points = this.currentPath.shape.points; - if(points.length === 0)this.moveTo(0, 0); - - - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - - var j = 0; - for (var i = 1; i <= n; i++ ) - { - j = i / n; - - xa = fromX + ( (cpX - fromX) * j ); - ya = fromY + ( (cpY - fromY) * j ); - - points.push( xa + ( ((cpX + ( (toX - cpX) * j )) - xa) * j ), - ya + ( ((cpY + ( (toY - cpY) * j )) - ya) * j ) ); - } - - - this.dirty = true; - - return this; -}; - -/** - * Calculate the points for a bezier curve and then draws it. - * - * @method bezierCurveTo - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param cpX2 {Number} Second Control point x - * @param cpY2 {Number} Second Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Graphics} - */ -PIXI.Graphics.prototype.bezierCurveTo = function(cpX, cpY, cpX2, cpY2, toX, toY) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0]; - } - else - { - this.moveTo(0,0); - } - - var n = 20, - dt, - dt2, - dt3, - t2, - t3, - points = this.currentPath.shape.points; - - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - - var j = 0; - - for (var i=1; i<=n; i++) - { - j = i / n; - - dt = (1 - j); - dt2 = dt * dt; - dt3 = dt2 * dt; - - t2 = j * j; - t3 = t2 * j; - - points.push( dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX, - dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY); - } - - this.dirty = true; - - return this; -}; - -/* - * The arcTo() method creates an arc/curve between two tangents on the canvas. - * - * "borrowed" from https://code.google.com/p/fxcanvas/ - thanks google! - * - * @method arcTo - * @param x1 {Number} The x-coordinate of the beginning of the arc - * @param y1 {Number} The y-coordinate of the beginning of the arc - * @param x2 {Number} The x-coordinate of the end of the arc - * @param y2 {Number} The y-coordinate of the end of the arc - * @param radius {Number} The radius of the arc - * @return {Graphics} - */ -PIXI.Graphics.prototype.arcTo = function(x1, y1, x2, y2, radius) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0) - { - this.currentPath.shape.points.push(x1, y1); - } - } - else - { - this.moveTo(x1, y1); - } - - var points = this.currentPath.shape.points; - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - var a1 = fromY - y1; - var b1 = fromX - x1; - var a2 = y2 - y1; - var b2 = x2 - x1; - var mm = Math.abs(a1 * b2 - b1 * a2); - - - if (mm < 1.0e-8 || radius === 0) - { - if( points[points.length-2] !== x1 || points[points.length-1] !== y1) - { - //console.log(">>") - points.push(x1, y1); - } - } - else - { - var dd = a1 * a1 + b1 * b1; - var cc = a2 * a2 + b2 * b2; - var tt = a1 * a2 + b1 * b2; - var k1 = radius * Math.sqrt(dd) / mm; - var k2 = radius * Math.sqrt(cc) / mm; - var j1 = k1 * tt / dd; - var j2 = k2 * tt / cc; - var cx = k1 * b2 + k2 * b1; - var cy = k1 * a2 + k2 * a1; - var px = b1 * (k2 + j1); - var py = a1 * (k2 + j1); - var qx = b2 * (k1 + j2); - var qy = a2 * (k1 + j2); - var startAngle = Math.atan2(py - cy, px - cx); - var endAngle = Math.atan2(qy - cy, qx - cx); - - this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1); - } - - this.dirty = true; - - return this; -}; - -/** - * The arc method creates an arc/curve (used to create circles, or parts of circles). - * - * @method arc - * @param cx {Number} The x-coordinate of the center of the circle - * @param cy {Number} The y-coordinate of the center of the circle - * @param radius {Number} The radius of the circle - * @param startAngle {Number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) - * @param endAngle {Number} The ending angle, in radians - * @param anticlockwise {Boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {Graphics} - */ -PIXI.Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) -{ - var startX = cx + Math.cos(startAngle) * radius; - var startY = cy + Math.sin(startAngle) * radius; - var points; - - if( this.currentPath ) - { - points = this.currentPath.shape.points; - - if(points.length === 0) - { - points.push(startX, startY); - } - else if( points[points.length-2] !== startX || points[points.length-1] !== startY) - { - points.push(startX, startY); - } - } - else - { - this.moveTo(startX, startY); - points = this.currentPath.shape.points; - } - - if (startAngle === endAngle)return this; - - if( !anticlockwise && endAngle <= startAngle ) - { - endAngle += Math.PI * 2; - } - else if( anticlockwise && startAngle <= endAngle ) - { - startAngle += Math.PI * 2; - } - - var sweep = anticlockwise ? (startAngle - endAngle) *-1 : (endAngle - startAngle); - var segs = ( Math.abs(sweep)/ (Math.PI * 2) ) * 40; - - if( sweep === 0 ) return this; - - var theta = sweep/(segs*2); - var theta2 = theta*2; - - var cTheta = Math.cos(theta); - var sTheta = Math.sin(theta); - - var segMinus = segs - 1; - - var remainder = ( segMinus % 1 ) / segMinus; - - for(var i=0; i<=segMinus; i++) - { - var real = i + remainder * i; - - - var angle = ((theta) + startAngle + (theta2 * real)); - - var c = Math.cos(angle); - var s = -Math.sin(angle); - - points.push(( (cTheta * c) + (sTheta * s) ) * radius + cx, - ( (cTheta * -s) + (sTheta * c) ) * radius + cy); - } - - this.dirty = true; - - return this; -}; - -/** - * Specifies a simple one-color fill that subsequent calls to other Graphics methods - * (such as lineTo() or drawCircle()) use when drawing. - * - * @method beginFill - * @param color {Number} the color of the fill - * @param alpha {Number} the alpha of the fill - * @return {Graphics} - */ -PIXI.Graphics.prototype.beginFill = function(color, alpha) -{ - this.filling = true; - this.fillColor = color || 0; - this.fillAlpha = (alpha === undefined) ? 1 : alpha; - - if(this.currentPath) - { - if(this.currentPath.shape.points.length <= 2) - { - this.currentPath.fill = this.filling; - this.currentPath.fillColor = this.fillColor; - this.currentPath.fillAlpha = this.fillAlpha; - } - } - return this; -}; - -/** - * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. - * - * @method endFill - * @return {Graphics} - */ -PIXI.Graphics.prototype.endFill = function() -{ - this.filling = false; - this.fillColor = null; - this.fillAlpha = 1; - - return this; -}; - -/** - * Draws a rectangle. - * - * @method drawRect - * - * @param x {Number} The X coord of the top-left of the rectangle - * @param y {Number} The Y coord of the top-left of the rectangle - * @param width {Number} The width of the rectangle - * @param height {Number} The height of the rectangle - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawRect = function( x, y, width, height ) -{ - this.drawShape(new PIXI.Rectangle(x,y, width, height)); - - return this; -}; - -/** - * Draws a rounded rectangle. - * - * @method drawRoundedRect - * - * @param x {Number} The X coord of the top-left of the rectangle - * @param y {Number} The Y coord of the top-left of the rectangle - * @param width {Number} The width of the rectangle - * @param height {Number} The height of the rectangle - * @param radius {Number} Radius of the rectangle corners - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawRoundedRect = function( x, y, width, height, radius ) -{ - this.drawShape(new PIXI.RoundedRectangle(x, y, width, height, radius)); - - return this; -}; - -/** - * Draws a circle. - * - * @method drawCircle - * @param x {Number} The X coordinate of the center of the circle - * @param y {Number} The Y coordinate of the center of the circle - * @param radius {Number} The radius of the circle - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawCircle = function(x, y, radius) -{ - this.drawShape(new PIXI.Circle(x,y, radius)); - - return this; -}; - -/** - * Draws an ellipse. - * - * @method drawEllipse - * @param x {Number} The X coordinate of the center of the ellipse - * @param y {Number} The Y coordinate of the center of the ellipse - * @param width {Number} The half width of the ellipse - * @param height {Number} The half height of the ellipse - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawEllipse = function(x, y, width, height) -{ - this.drawShape(new PIXI.Ellipse(x, y, width, height)); - - return this; -}; - -/** - * Draws a polygon using the given path. - * - * @method drawPolygon - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawPolygon = function(path) -{ - if(!(path instanceof Array))path = Array.prototype.slice.call(arguments); - this.drawShape(new PIXI.Polygon(path)); - return this; -}; - -/** - * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. - * - * @method clear - * @return {Graphics} - */ -PIXI.Graphics.prototype.clear = function() -{ - this.lineWidth = 0; - this.filling = false; - - this.dirty = true; - this.clearDirty = true; - this.graphicsData = []; - - return this; -}; - -/** - * Useful function that returns a texture of the graphics object that can then be used to create sprites - * This can be quite useful if your geometry is complicated and needs to be reused multiple times. - * - * @method generateTexture - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts - * @return {Texture} a texture of the graphics object - */ -PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode) -{ - resolution = resolution || 1; - - var bounds = this.getBounds(); - - var canvasBuffer = new PIXI.CanvasBuffer(bounds.width * resolution, bounds.height * resolution); - - var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas, scaleMode); - texture.baseTexture.resolution = resolution; - - canvasBuffer.context.scale(resolution, resolution); - - canvasBuffer.context.translate(-bounds.x,-bounds.y); - - PIXI.CanvasGraphics.renderGraphics(this, canvasBuffer.context); - - return texture; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Graphics.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(this.visible === false || this.alpha === 0 || this.isMask === true)return; - - if(this._cacheAsBitmap) - { - - if(this.dirty || this.cachedSpriteDirty) - { - - this._generateCachedSprite(); - - // we will also need to update the texture on the gpu too! - this.updateCachedSpriteTexture(); - - this.cachedSpriteDirty = false; - this.dirty = false; - } - - this._cachedSprite.worldAlpha = this.worldAlpha; - PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession); - - return; - } - else - { - renderSession.spriteBatch.stop(); - renderSession.blendModeManager.setBlendMode(this.blendMode); - - if(this._mask)renderSession.maskManager.pushMask(this._mask, renderSession); - if(this._filters)renderSession.filterManager.pushFilter(this._filterBlock); - - // check blend mode - if(this.blendMode !== renderSession.spriteBatch.currentBlendMode) - { - renderSession.spriteBatch.currentBlendMode = this.blendMode; - var blendModeWebGL = PIXI.blendModesWebGL[renderSession.spriteBatch.currentBlendMode]; - renderSession.spriteBatch.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); - } - - // check if the webgl graphic needs to be updated - if(this.webGLDirty) - { - this.dirty = true; - this.webGLDirty = false; - } - - PIXI.WebGLGraphics.renderGraphics(this, renderSession); - - // only render if it has children! - if(this.children.length) - { - renderSession.spriteBatch.start(); - - // simple render children! - for(var i=0, j=this.children.length; i maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - - this._bounds.x = minX; - this._bounds.width = maxX - minX; - - this._bounds.y = minY; - this._bounds.height = maxY - minY; - - return this._bounds; -}; - -/** - * Update the bounds of the object - * - * @method updateLocalBounds - */ -PIXI.Graphics.prototype.updateLocalBounds = function() -{ - var minX = Infinity; - var maxX = -Infinity; - - var minY = Infinity; - var maxY = -Infinity; - - if(this.graphicsData.length) - { - var shape, points, x, y, w, h; - - for (var i = 0; i < this.graphicsData.length; i++) { - var data = this.graphicsData[i]; - var type = data.type; - var lineWidth = data.lineWidth; - shape = data.shape; - - - if(type === PIXI.Graphics.RECT || type === PIXI.Graphics.RREC) - { - x = shape.x - lineWidth/2; - y = shape.y - lineWidth/2; - w = shape.width + lineWidth; - h = shape.height + lineWidth; - - minX = x < minX ? x : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y < minY ? y : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else if(type === PIXI.Graphics.CIRC) - { - x = shape.x; - y = shape.y; - w = shape.radius + lineWidth/2; - h = shape.radius + lineWidth/2; - - minX = x - w < minX ? x - w : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y - h < minY ? y - h : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else if(type === PIXI.Graphics.ELIP) - { - x = shape.x; - y = shape.y; - w = shape.width + lineWidth/2; - h = shape.height + lineWidth/2; - - minX = x - w < minX ? x - w : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y - h < minY ? y - h : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else - { - // POLY - points = shape.points; - - for (var j = 0; j < points.length; j+=2) - { - - x = points[j]; - y = points[j+1]; - minX = x-lineWidth < minX ? x-lineWidth : minX; - maxX = x+lineWidth > maxX ? x+lineWidth : maxX; - - minY = y-lineWidth < minY ? y-lineWidth : minY; - maxY = y+lineWidth > maxY ? y+lineWidth : maxY; - } - } - } - } - else - { - minX = 0; - maxX = 0; - minY = 0; - maxY = 0; - } - - var padding = this.boundsPadding; - - this._localBounds.x = minX - padding; - this._localBounds.width = (maxX - minX) + padding * 2; - - this._localBounds.y = minY - padding; - this._localBounds.height = (maxY - minY) + padding * 2; -}; - -/** - * Generates the cached sprite when the sprite has cacheAsBitmap = true - * - * @method _generateCachedSprite - * @private - */ -PIXI.Graphics.prototype._generateCachedSprite = function() -{ - var bounds = this.getLocalBounds(); - - if(!this._cachedSprite) - { - var canvasBuffer = new PIXI.CanvasBuffer(bounds.width, bounds.height); - var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); - - this._cachedSprite = new PIXI.Sprite(texture); - this._cachedSprite.buffer = canvasBuffer; - - this._cachedSprite.worldTransform = this.worldTransform; - } - else - { - this._cachedSprite.buffer.resize(bounds.width, bounds.height); - } - - // leverage the anchor to account for the offset of the element - this._cachedSprite.anchor.x = -( bounds.x / bounds.width ); - this._cachedSprite.anchor.y = -( bounds.y / bounds.height ); - - // this._cachedSprite.buffer.context.save(); - this._cachedSprite.buffer.context.translate(-bounds.x,-bounds.y); - - // make sure we set the alpha of the graphics to 1 for the render.. - this.worldAlpha = 1; - - // now render the graphic.. - PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context); - this._cachedSprite.alpha = this.alpha; -}; - -/** - * Updates texture size based on canvas size - * - * @method updateCachedSpriteTexture - * @private - */ -PIXI.Graphics.prototype.updateCachedSpriteTexture = function() -{ - var cachedSprite = this._cachedSprite; - var texture = cachedSprite.texture; - var canvas = cachedSprite.buffer.canvas; - - texture.baseTexture.width = canvas.width; - texture.baseTexture.height = canvas.height; - texture.crop.width = texture.frame.width = canvas.width; - texture.crop.height = texture.frame.height = canvas.height; - - cachedSprite._width = canvas.width; - cachedSprite._height = canvas.height; - - // update the dirty base textures - texture.baseTexture.dirty(); -}; - -/** - * Destroys a previous cached sprite. - * - * @method destroyCachedSprite - */ -PIXI.Graphics.prototype.destroyCachedSprite = function() -{ - this._cachedSprite.texture.destroy(true); - - // let the gc collect the unused sprite - // TODO could be object pooled! - this._cachedSprite = null; -}; - -/** - * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. - * - * @method drawShape - * @param {Circle|Rectangle|Ellipse|Line|Polygon} shape The Shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. - */ -PIXI.Graphics.prototype.drawShape = function(shape) -{ - if(this.currentPath) - { - // check current path! - if(this.currentPath.shape.points.length <= 2)this.graphicsData.pop(); - } - - this.currentPath = null; - - var data = new PIXI.GraphicsData(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, shape); - - this.graphicsData.push(data); - - if(data.type === PIXI.Graphics.POLY) - { - data.shape.closed = this.filling; - this.currentPath = data; - } - - this.dirty = true; - - return data; -}; - -/** - * A GraphicsData object. - * - * @class GraphicsData - * @constructor - */ -PIXI.GraphicsData = function(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, shape) -{ - this.lineWidth = lineWidth; - this.lineColor = lineColor; - this.lineAlpha = lineAlpha; - this._lineTint = lineColor; - - this.fillColor = fillColor; - this.fillAlpha = fillAlpha; - this._fillTint = fillColor; - this.fill = fill; - - this.shape = shape; - this.type = shape.type; -}; - -// SOME TYPES: -PIXI.Graphics.POLY = 0; -PIXI.Graphics.RECT = 1; -PIXI.Graphics.CIRC = 2; -PIXI.Graphics.ELIP = 3; -PIXI.Graphics.RREC = 4; - -PIXI.Polygon.prototype.type = PIXI.Graphics.POLY; -PIXI.Rectangle.prototype.type = PIXI.Graphics.RECT; -PIXI.Circle.prototype.type = PIXI.Graphics.CIRC; -PIXI.Ellipse.prototype.type = PIXI.Graphics.ELIP; -PIXI.RoundedRectangle.prototype.type = PIXI.Graphics.RREC; - - -/** - * @author Mat Groves http://matgroves.com/ - */ - - /** - * - * @class Strip - * @extends DisplayObjectContainer - * @constructor - * @param texture {Texture} The texture to use - * @param width {Number} the width - * @param height {Number} the height - * - */ -PIXI.Strip = function(texture) -{ - PIXI.DisplayObjectContainer.call( this ); - - - /** - * The texture of the strip - * - * @property texture - * @type Texture - */ - this.texture = texture; - - // set up the main bits.. - this.uvs = new PIXI.Float32Array([0, 1, - 1, 1, - 1, 0, - 0, 1]); - - this.vertices = new PIXI.Float32Array([0, 0, - 100, 0, - 100, 100, - 0, 100]); - - this.colors = new PIXI.Float32Array([1, 1, 1, 1]); - - this.indices = new PIXI.Uint16Array([0, 1, 2, 3]); - - /** - * Whether the strip is dirty or not - * - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode. - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - /** - * Triangles in canvas mode are automatically antialiased, use this value to force triangles to overlap a bit with each other. - * - * @property canvasPadding - * @type Number - */ - this.canvasPadding = 0; - - this.drawMode = PIXI.Strip.DrawModes.TRIANGLE_STRIP; - -}; - -// constructor -PIXI.Strip.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); -PIXI.Strip.prototype.constructor = PIXI.Strip; - -PIXI.Strip.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(!this.visible || this.alpha <= 0)return; - // render triangle strip.. - - renderSession.spriteBatch.stop(); - - // init! init! - if(!this._vertexBuffer)this._initWebGL(renderSession); - - renderSession.shaderManager.setShader(renderSession.shaderManager.stripShader); - - this._renderStrip(renderSession); - - ///renderSession.shaderManager.activateDefaultShader(); - - renderSession.spriteBatch.start(); - - //TODO check culling -}; - -PIXI.Strip.prototype._initWebGL = function(renderSession) -{ - // build the strip! - var gl = renderSession.gl; - - this._vertexBuffer = gl.createBuffer(); - this._indexBuffer = gl.createBuffer(); - this._uvBuffer = gl.createBuffer(); - this._colorBuffer = gl.createBuffer(); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvs, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._colorBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.colors, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); -}; - -PIXI.Strip.prototype._renderStrip = function(renderSession) -{ - var gl = renderSession.gl; - var projection = renderSession.projection, - offset = renderSession.offset, - shader = renderSession.shaderManager.stripShader; - - var drawMode = this.drawMode === PIXI.Strip.DrawModes.TRIANGLE_STRIP ? gl.TRIANGLE_STRIP : gl.TRIANGLES; - - // gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mat4Real); - - renderSession.blendModeManager.setBlendMode(this.blendMode); - - - // set uniforms - gl.uniformMatrix3fv(shader.translationMatrix, false, this.worldTransform.toArray(true)); - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - gl.uniform1f(shader.alpha, this.worldAlpha); - - if(!this.dirty) - { - - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - // update the uvs - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.activeTexture(gl.TEXTURE0); - - // check if a texture is dirty.. - if(this.texture.baseTexture._dirty[gl.id]) - { - renderSession.renderer.updateTexture(this.texture.baseTexture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]); - } - - // dont need to upload! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - - - } - else - { - - this.dirty = false; - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.STATIC_DRAW); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - // update the uvs - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvs, gl.STATIC_DRAW); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.activeTexture(gl.TEXTURE0); - - // check if a texture is dirty.. - if(this.texture.baseTexture._dirty[gl.id]) - { - renderSession.renderer.updateTexture(this.texture.baseTexture); - } - else - { - gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]); - } - - // dont need to upload! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - } - //console.log(gl.TRIANGLE_STRIP) - // - // - gl.drawElements(drawMode, this.indices.length, gl.UNSIGNED_SHORT, 0); - - -}; - - - -PIXI.Strip.prototype._renderCanvas = function(renderSession) -{ - var context = renderSession.context; - - var transform = this.worldTransform; - - if (renderSession.roundPixels) - { - context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx | 0, transform.ty | 0); - } - else - { - context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty); - } - - if (this.drawMode === PIXI.Strip.DrawModes.TRIANGLE_STRIP) - { - this._renderCanvasTriangleStrip(context); - } - else - { - this._renderCanvasTriangles(context); - } -}; - -PIXI.Strip.prototype._renderCanvasTriangleStrip = function(context) -{ - // draw triangles!! - var vertices = this.vertices; - var uvs = this.uvs; - - var length = vertices.length / 2; - this.count++; - - for (var i = 0; i < length - 2; i++) { - // draw some triangles! - var index = i * 2; - this._renderCanvasDrawTriangle(context, vertices, uvs, index, (index + 2), (index + 4)); - } -}; - -PIXI.Strip.prototype._renderCanvasTriangles = function(context) -{ - // draw triangles!! - var vertices = this.vertices; - var uvs = this.uvs; - var indices = this.indices; - - var length = indices.length; - this.count++; - - for (var i = 0; i < length; i += 3) { - // draw some triangles! - var index0 = indices[i] * 2, index1 = indices[i + 1] * 2, index2 = indices[i + 2] * 2; - this._renderCanvasDrawTriangle(context, vertices, uvs, index0, index1, index2); - } -}; - -PIXI.Strip.prototype._renderCanvasDrawTriangle = function(context, vertices, uvs, index0, index1, index2) -{ - var textureSource = this.texture.baseTexture.source; - var textureWidth = this.texture.width; - var textureHeight = this.texture.height; - - var x0 = vertices[index0], x1 = vertices[index1], x2 = vertices[index2]; - var y0 = vertices[index0 + 1], y1 = vertices[index1 + 1], y2 = vertices[index2 + 1]; - - var u0 = uvs[index0] * textureWidth, u1 = uvs[index1] * textureWidth, u2 = uvs[index2] * textureWidth; - var v0 = uvs[index0 + 1] * textureHeight, v1 = uvs[index1 + 1] * textureHeight, v2 = uvs[index2 + 1] * textureHeight; - - if (this.canvasPadding > 0) { - var paddingX = this.canvasPadding / this.worldTransform.a; - var paddingY = this.canvasPadding / this.worldTransform.d; - var centerX = (x0 + x1 + x2) / 3; - var centerY = (y0 + y1 + y2) / 3; - - var normX = x0 - centerX; - var normY = y0 - centerY; - - var dist = Math.sqrt(normX * normX + normY * normY); - x0 = centerX + (normX / dist) * (dist + paddingX); - y0 = centerY + (normY / dist) * (dist + paddingY); - - // - - normX = x1 - centerX; - normY = y1 - centerY; - - dist = Math.sqrt(normX * normX + normY * normY); - x1 = centerX + (normX / dist) * (dist + paddingX); - y1 = centerY + (normY / dist) * (dist + paddingY); - - normX = x2 - centerX; - normY = y2 - centerY; - - dist = Math.sqrt(normX * normX + normY * normY); - x2 = centerX + (normX / dist) * (dist + paddingX); - y2 = centerY + (normY / dist) * (dist + paddingY); - } - - context.save(); - context.beginPath(); - - - context.moveTo(x0, y0); - context.lineTo(x1, y1); - context.lineTo(x2, y2); - - context.closePath(); - - context.clip(); - - // Compute matrix transform - var delta = (u0 * v1) + (v0 * u2) + (u1 * v2) - (v1 * u2) - (v0 * u1) - (u0 * v2); - var deltaA = (x0 * v1) + (v0 * x2) + (x1 * v2) - (v1 * x2) - (v0 * x1) - (x0 * v2); - var deltaB = (u0 * x1) + (x0 * u2) + (u1 * x2) - (x1 * u2) - (x0 * u1) - (u0 * x2); - var deltaC = (u0 * v1 * x2) + (v0 * x1 * u2) + (x0 * u1 * v2) - (x0 * v1 * u2) - (v0 * u1 * x2) - (u0 * x1 * v2); - var deltaD = (y0 * v1) + (v0 * y2) + (y1 * v2) - (v1 * y2) - (v0 * y1) - (y0 * v2); - var deltaE = (u0 * y1) + (y0 * u2) + (u1 * y2) - (y1 * u2) - (y0 * u1) - (u0 * y2); - var deltaF = (u0 * v1 * y2) + (v0 * y1 * u2) + (y0 * u1 * v2) - (y0 * v1 * u2) - (v0 * u1 * y2) - (u0 * y1 * v2); - - context.transform(deltaA / delta, deltaD / delta, - deltaB / delta, deltaE / delta, - deltaC / delta, deltaF / delta); - - context.drawImage(textureSource, 0, 0); - context.restore(); -}; - - - -/** - * Renders a flat strip - * - * @method renderStripFlat - * @param strip {Strip} The Strip to render - * @private - */ -PIXI.Strip.prototype.renderStripFlat = function(strip) -{ - var context = this.context; - var vertices = strip.vertices; - - var length = vertices.length/2; - this.count++; - - context.beginPath(); - for (var i=1; i < length-2; i++) - { - // draw some triangles! - var index = i*2; - - var x0 = vertices[index], x1 = vertices[index+2], x2 = vertices[index+4]; - var y0 = vertices[index+1], y1 = vertices[index+3], y2 = vertices[index+5]; - - context.moveTo(x0, y0); - context.lineTo(x1, y1); - context.lineTo(x2, y2); - } - - context.fillStyle = '#FF0000'; - context.fill(); - context.closePath(); -}; - -/* -PIXI.Strip.prototype.setTexture = function(texture) -{ - //TODO SET THE TEXTURES - //TODO VISIBILITY - - // stop current texture - this.texture = texture; - this.width = texture.frame.width; - this.height = texture.frame.height; - this.updateFrame = true; -}; -*/ - -/** - * When the texture is updated, this event will fire to update the scale and frame - * - * @method onTextureUpdate - * @param event - * @private - */ - -PIXI.Strip.prototype.onTextureUpdate = function() -{ - this.updateFrame = true; -}; - -/** - * Returns the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account. - * - * @method getBounds - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle - */ -PIXI.Strip.prototype.getBounds = function(matrix) -{ - var worldTransform = matrix || this.worldTransform; - - var a = worldTransform.a; - var b = worldTransform.b; - var c = worldTransform.c; - var d = worldTransform.d; - var tx = worldTransform.tx; - var ty = worldTransform.ty; - - var maxX = -Infinity; - var maxY = -Infinity; - - var minX = Infinity; - var minY = Infinity; - - var vertices = this.vertices; - for (var i = 0, n = vertices.length; i < n; i += 2) - { - var rawX = vertices[i], rawY = vertices[i + 1]; - var x = (a * rawX) + (c * rawY) + tx; - var y = (d * rawY) + (b * rawX) + ty; - - minX = x < minX ? x : minX; - minY = y < minY ? y : minY; - - maxX = x > maxX ? x : maxX; - maxY = y > maxY ? y : maxY; - } - - if (minX === -Infinity || maxY === Infinity) - { - return PIXI.EmptyRectangle; - } - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - -/** - * Different drawing buffer modes supported - * - * @property - * @type {{TRIANGLE_STRIP: number, TRIANGLES: number}} - * @static - */ -PIXI.Strip.DrawModes = { - TRIANGLE_STRIP: 0, - TRIANGLES: 1 -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * @copyright Mat Groves, Rovanion Luckey - */ - -/** - * - * @class Rope - * @constructor - * @extends Strip - * @param {Texture} texture - The texture to use on the rope. - * @param {Array} points - An array of {PIXI.Point}. - * - */ -PIXI.Rope = function(texture, points) -{ - PIXI.Strip.call( this, texture ); - this.points = points; - - this.vertices = new PIXI.Float32Array(points.length * 4); - this.uvs = new PIXI.Float32Array(points.length * 4); - this.colors = new PIXI.Float32Array(points.length * 2); - this.indices = new PIXI.Uint16Array(points.length * 2); - - - this.refresh(); -}; - - -// constructor -PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype ); -PIXI.Rope.prototype.constructor = PIXI.Rope; - -/* - * Refreshes - * - * @method refresh - */ -PIXI.Rope.prototype.refresh = function() -{ - var points = this.points; - if(points.length < 1) return; - - var uvs = this.uvs; - - var lastPoint = points[0]; - var indices = this.indices; - var colors = this.colors; - - this.count-=0.2; - - uvs[0] = 0; - uvs[1] = 0; - uvs[2] = 0; - uvs[3] = 1; - - colors[0] = 1; - colors[1] = 1; - - indices[0] = 0; - indices[1] = 1; - - var total = points.length, - point, index, amount; - - for (var i = 1; i < total; i++) - { - point = points[i]; - index = i * 4; - // time to do some smart drawing! - amount = i / (total-1); - - if(i%2) - { - uvs[index] = amount; - uvs[index+1] = 0; - - uvs[index+2] = amount; - uvs[index+3] = 1; - } - else - { - uvs[index] = amount; - uvs[index+1] = 0; - - uvs[index+2] = amount; - uvs[index+3] = 1; - } - - index = i * 2; - colors[index] = 1; - colors[index+1] = 1; - - index = i * 2; - indices[index] = index; - indices[index + 1] = index + 1; - - lastPoint = point; - } -}; - -/* - * Updates the object transform for rendering - * - * @method updateTransform - * @private - */ -PIXI.Rope.prototype.updateTransform = function() -{ - - var points = this.points; - if(points.length < 1)return; - - var lastPoint = points[0]; - var nextPoint; - var perp = {x:0, y:0}; - - this.count-=0.2; - - var vertices = this.vertices; - var total = points.length, - point, index, ratio, perpLength, num; - - for (var i = 0; i < total; i++) - { - point = points[i]; - index = i * 4; - - if(i < points.length-1) - { - nextPoint = points[i+1]; - } - else - { - nextPoint = point; - } - - perp.y = -(nextPoint.x - lastPoint.x); - perp.x = nextPoint.y - lastPoint.y; - - ratio = (1 - (i / (total-1))) * 10; - - if(ratio > 1) ratio = 1; - - perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y); - num = this.texture.height / 2; //(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio; - perp.x /= perpLength; - perp.y /= perpLength; - - perp.x *= num; - perp.y *= num; - - vertices[index] = point.x + perp.x; - vertices[index+1] = point.y + perp.y; - vertices[index+2] = point.x - perp.x; - vertices[index+3] = point.y - perp.y; - - lastPoint = point; - } - - PIXI.DisplayObjectContainer.prototype.updateTransform.call( this ); -}; -/* - * Sets the texture that the Rope will use - * - * @method setTexture - * @param texture {Texture} the texture that will be used - */ -PIXI.Rope.prototype.setTexture = function(texture) -{ - // stop current texture - this.texture = texture; - //this.updateFrame = true; -}; - -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * A tiling sprite is a fast way of rendering a tiling image - * - * @class TilingSprite - * @extends Sprite - * @constructor - * @param texture {Texture} the texture of the tiling sprite - * @param width {Number} the width of the tiling sprite - * @param height {Number} the height of the tiling sprite - */ -PIXI.TilingSprite = function(texture, width, height) -{ - PIXI.Sprite.call( this, texture); - - /** - * The with of the tiling sprite - * - * @property width - * @type Number - */ - this._width = width || 100; - - /** - * The height of the tiling sprite - * - * @property height - * @type Number - */ - this._height = height || 100; - - /** - * The scaling of the image that is being tiled - * - * @property tileScale - * @type Point - */ - this.tileScale = new PIXI.Point(1,1); - - /** - * A point that represents the scale of the texture object - * - * @property tileScaleOffset - * @type Point - */ - this.tileScaleOffset = new PIXI.Point(1,1); - - /** - * The offset position of the image that is being tiled - * - * @property tilePosition - * @type Point - */ - this.tilePosition = new PIXI.Point(0,0); - - /** - * Whether this sprite is renderable or not - * - * @property renderable - * @type Boolean - * @default true - */ - this.renderable = true; - - /** - * The tint applied to the sprite. This is a hex value - * - * @property tint - * @type Number - * @default 0xFFFFFF - */ - this.tint = 0xFFFFFF; - - /** - * The blend mode to be applied to the sprite - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - - -}; - -// constructor -PIXI.TilingSprite.prototype = Object.create(PIXI.Sprite.prototype); -PIXI.TilingSprite.prototype.constructor = PIXI.TilingSprite; - - -/** - * The width of the sprite, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.TilingSprite.prototype, 'width', { - get: function() { - return this._width; - }, - set: function(value) { - - this._width = value; - } -}); - -/** - * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.TilingSprite.prototype, 'height', { - get: function() { - return this._height; - }, - set: function(value) { - this._height = value; - } -}); - -PIXI.TilingSprite.prototype.setTexture = function(texture) -{ - if (this.texture === texture) return; - - this.texture = texture; - - this.refreshTexture = true; - - this.cachedTint = 0xFFFFFF; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.TilingSprite.prototype._renderWebGL = function(renderSession) -{ - if (this.visible === false || this.alpha === 0) return; - var i,j; - - if (this._mask) - { - renderSession.spriteBatch.stop(); - renderSession.maskManager.pushMask(this.mask, renderSession); - renderSession.spriteBatch.start(); - } - - if (this._filters) - { - renderSession.spriteBatch.flush(); - renderSession.filterManager.pushFilter(this._filterBlock); - } - - - - if (!this.tilingTexture || this.refreshTexture) - { - this.generateTilingTexture(true); - - if (this.tilingTexture && this.tilingTexture.needsUpdate) - { - //TODO - tweaking - renderSession.renderer.updateTexture(this.tilingTexture.baseTexture); - this.tilingTexture.needsUpdate = false; - // this.tilingTexture._uvs = null; - } - } - else - { - renderSession.spriteBatch.renderTilingSprite(this); - } - // simple render children! - for (i=0,j=this.children.length; i maxX ? x1 : maxX; - maxX = x2 > maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y1 > maxY ? y1 : maxY; - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - - - -/** - * When the texture is updated, this event will fire to update the scale and frame - * - * @method onTextureUpdate - * @param event - * @private - */ -PIXI.TilingSprite.prototype.onTextureUpdate = function() -{ - // overriding the sprite version of this! -}; - - -/** -* -* @method generateTilingTexture -* -* @param forcePowerOfTwo {Boolean} Whether we want to force the texture to be a power of two -*/ -PIXI.TilingSprite.prototype.generateTilingTexture = function(forcePowerOfTwo) -{ - if (!this.texture.baseTexture.hasLoaded) return; - - var texture = this.originalTexture || this.texture; - var frame = texture.frame; - var targetWidth, targetHeight; - - // Check that the frame is the same size as the base texture. - var isFrame = frame.width !== texture.baseTexture.width || frame.height !== texture.baseTexture.height; - - var newTextureRequired = false; - - if (!forcePowerOfTwo) - { - if (isFrame) - { - if (texture.trim) - { - targetWidth = texture.trim.width; - targetHeight = texture.trim.height; - } - else - { - targetWidth = frame.width; - targetHeight = frame.height; - } - - newTextureRequired = true; - } - } - else - { - targetWidth = PIXI.getNextPowerOfTwo(frame.width); - targetHeight = PIXI.getNextPowerOfTwo(frame.height); - - // If the BaseTexture dimensions don't match the texture frame then we need a new texture anyway because it's part of a texture atlas - if (frame.width !== targetWidth || frame.height !== targetHeight || texture.baseTexture.width !== targetWidth || texture.baseTexture.height || targetHeight) newTextureRequired = true; - } - - if (newTextureRequired) - { - var canvasBuffer; - - if (this.tilingTexture && this.tilingTexture.isTiling) - { - canvasBuffer = this.tilingTexture.canvasBuffer; - canvasBuffer.resize(targetWidth, targetHeight); - this.tilingTexture.baseTexture.width = targetWidth; - this.tilingTexture.baseTexture.height = targetHeight; - this.tilingTexture.needsUpdate = true; - } - else - { - canvasBuffer = new PIXI.CanvasBuffer(targetWidth, targetHeight); - - this.tilingTexture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); - this.tilingTexture.canvasBuffer = canvasBuffer; - this.tilingTexture.isTiling = true; - } - - canvasBuffer.context.drawImage(texture.baseTexture.source, - texture.crop.x, - texture.crop.y, - texture.crop.width, - texture.crop.height, - 0, - 0, - targetWidth, - targetHeight); - - this.tileScaleOffset.x = frame.width / targetWidth; - this.tileScaleOffset.y = frame.height / targetHeight; - } - else - { - // TODO - switching? - if (this.tilingTexture && this.tilingTexture.isTiling) - { - // destroy the tiling texture! - // TODO could store this somewhere? - this.tilingTexture.destroy(true); - } - - this.tileScaleOffset.x = 1; - this.tileScaleOffset.y = 1; - this.tilingTexture = texture; - } - - this.refreshTexture = false; - - this.originalTexture = this.texture; - this.texture = this.tilingTexture; - - this.tilingTexture.baseTexture._powerOf2 = true; -}; - -PIXI.TilingSprite.prototype.destroy = function () { - PIXI.Sprite.prototype.destroy.call(this); - - this.tileScale = null; - this.tileScaleOffset = null; - this.tilePosition = null; - - this.tilingTexture.destroy(true); - this.tilingTexture = null; -}; - -/****************************************************************************** - * Spine Runtimes Software License - * Version 2.1 - * - * Copyright (c) 2013, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable and - * non-transferable license to install, execute and perform the Spine Runtimes - * Software (the "Software") solely for internal use. Without the written - * permission of Esoteric Software (typically granted by licensing Spine), you - * may not (a) modify, translate, adapt or otherwise create derivative works, - * improvements of the Software or develop new applications using the Software - * or (b) remove, delete, alter or obscure any trademarks or any copyright, - * trademark, patent or other intellectual property or proprietary rights - * notices on or in the Software, including any copy thereof. Redistributions - * in binary or source form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -var spine = { - radDeg: 180 / Math.PI, - degRad: Math.PI / 180, - temp: [], - Float32Array: (typeof(Float32Array) === 'undefined') ? Array : Float32Array, - Uint16Array: (typeof(Uint16Array) === 'undefined') ? Array : Uint16Array -}; - -spine.BoneData = function (name, parent) { - this.name = name; - this.parent = parent; -}; -spine.BoneData.prototype = { - length: 0, - x: 0, y: 0, - rotation: 0, - scaleX: 1, scaleY: 1, - inheritScale: true, - inheritRotation: true, - flipX: false, flipY: false -}; - -spine.SlotData = function (name, boneData) { - this.name = name; - this.boneData = boneData; -}; -spine.SlotData.prototype = { - r: 1, g: 1, b: 1, a: 1, - attachmentName: null, - additiveBlending: false -}; - -spine.IkConstraintData = function (name) { - this.name = name; - this.bones = []; -}; -spine.IkConstraintData.prototype = { - target: null, - bendDirection: 1, - mix: 1 -}; - -spine.Bone = function (boneData, skeleton, parent) { - this.data = boneData; - this.skeleton = skeleton; - this.parent = parent; - this.setToSetupPose(); -}; -spine.Bone.yDown = false; -spine.Bone.prototype = { - x: 0, y: 0, - rotation: 0, rotationIK: 0, - scaleX: 1, scaleY: 1, - flipX: false, flipY: false, - m00: 0, m01: 0, worldX: 0, // a b x - m10: 0, m11: 0, worldY: 0, // c d y - worldRotation: 0, - worldScaleX: 1, worldScaleY: 1, - worldFlipX: false, worldFlipY: false, - updateWorldTransform: function () { - var parent = this.parent; - if (parent) { - this.worldX = this.x * parent.m00 + this.y * parent.m01 + parent.worldX; - this.worldY = this.x * parent.m10 + this.y * parent.m11 + parent.worldY; - if (this.data.inheritScale) { - this.worldScaleX = parent.worldScaleX * this.scaleX; - this.worldScaleY = parent.worldScaleY * this.scaleY; - } else { - this.worldScaleX = this.scaleX; - this.worldScaleY = this.scaleY; - } - this.worldRotation = this.data.inheritRotation ? (parent.worldRotation + this.rotationIK) : this.rotationIK; - this.worldFlipX = parent.worldFlipX != this.flipX; - this.worldFlipY = parent.worldFlipY != this.flipY; - } else { - var skeletonFlipX = this.skeleton.flipX, skeletonFlipY = this.skeleton.flipY; - this.worldX = skeletonFlipX ? -this.x : this.x; - this.worldY = (skeletonFlipY != spine.Bone.yDown) ? -this.y : this.y; - this.worldScaleX = this.scaleX; - this.worldScaleY = this.scaleY; - this.worldRotation = this.rotationIK; - this.worldFlipX = skeletonFlipX != this.flipX; - this.worldFlipY = skeletonFlipY != this.flipY; - } - var radians = this.worldRotation * spine.degRad; - var cos = Math.cos(radians); - var sin = Math.sin(radians); - if (this.worldFlipX) { - this.m00 = -cos * this.worldScaleX; - this.m01 = sin * this.worldScaleY; - } else { - this.m00 = cos * this.worldScaleX; - this.m01 = -sin * this.worldScaleY; - } - if (this.worldFlipY != spine.Bone.yDown) { - this.m10 = -sin * this.worldScaleX; - this.m11 = -cos * this.worldScaleY; - } else { - this.m10 = sin * this.worldScaleX; - this.m11 = cos * this.worldScaleY; - } - }, - setToSetupPose: function () { - var data = this.data; - this.x = data.x; - this.y = data.y; - this.rotation = data.rotation; - this.rotationIK = this.rotation; - this.scaleX = data.scaleX; - this.scaleY = data.scaleY; - this.flipX = data.flipX; - this.flipY = data.flipY; - }, - worldToLocal: function (world) { - var dx = world[0] - this.worldX, dy = world[1] - this.worldY; - var m00 = this.m00, m10 = this.m10, m01 = this.m01, m11 = this.m11; - if (this.worldFlipX != (this.worldFlipY != spine.Bone.yDown)) { - m00 = -m00; - m11 = -m11; - } - var invDet = 1 / (m00 * m11 - m01 * m10); - world[0] = dx * m00 * invDet - dy * m01 * invDet; - world[1] = dy * m11 * invDet - dx * m10 * invDet; - }, - localToWorld: function (local) { - var localX = local[0], localY = local[1]; - local[0] = localX * this.m00 + localY * this.m01 + this.worldX; - local[1] = localX * this.m10 + localY * this.m11 + this.worldY; - } -}; - -spine.Slot = function (slotData, bone) { - this.data = slotData; - this.bone = bone; - this.setToSetupPose(); -}; -spine.Slot.prototype = { - r: 1, g: 1, b: 1, a: 1, - _attachmentTime: 0, - attachment: null, - attachmentVertices: [], - setAttachment: function (attachment) { - this.attachment = attachment; - this._attachmentTime = this.bone.skeleton.time; - this.attachmentVertices.length = 0; - }, - setAttachmentTime: function (time) { - this._attachmentTime = this.bone.skeleton.time - time; - }, - getAttachmentTime: function () { - return this.bone.skeleton.time - this._attachmentTime; - }, - setToSetupPose: function () { - var data = this.data; - this.r = data.r; - this.g = data.g; - this.b = data.b; - this.a = data.a; - - var slotDatas = this.bone.skeleton.data.slots; - for (var i = 0, n = slotDatas.length; i < n; i++) { - if (slotDatas[i] == data) { - this.setAttachment(!data.attachmentName ? null : this.bone.skeleton.getAttachmentBySlotIndex(i, data.attachmentName)); - break; - } - } - } -}; - -spine.IkConstraint = function (data, skeleton) { - this.data = data; - this.mix = data.mix; - this.bendDirection = data.bendDirection; - - this.bones = []; - for (var i = 0, n = data.bones.length; i < n; i++) - this.bones.push(skeleton.findBone(data.bones[i].name)); - this.target = skeleton.findBone(data.target.name); -}; -spine.IkConstraint.prototype = { - apply: function () { - var target = this.target; - var bones = this.bones; - switch (bones.length) { - case 1: - spine.IkConstraint.apply1(bones[0], target.worldX, target.worldY, this.mix); - break; - case 2: - spine.IkConstraint.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.mix); - break; - } - } -}; -/** Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified in the world - * coordinate system. */ -spine.IkConstraint.apply1 = function (bone, targetX, targetY, alpha) { - var parentRotation = (!bone.data.inheritRotation || !bone.parent) ? 0 : bone.parent.worldRotation; - var rotation = bone.rotation; - var rotationIK = Math.atan2(targetY - bone.worldY, targetX - bone.worldX) * spine.radDeg - parentRotation; - bone.rotationIK = rotation + (rotationIK - rotation) * alpha; -}; -/** Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as possible. The - * target is specified in the world coordinate system. - * @param child Any descendant bone of the parent. */ -spine.IkConstraint.apply2 = function (parent, child, targetX, targetY, bendDirection, alpha) { - var childRotation = child.rotation, parentRotation = parent.rotation; - if (!alpha) { - child.rotationIK = childRotation; - parent.rotationIK = parentRotation; - return; - } - var positionX, positionY, tempPosition = spine.temp; - var parentParent = parent.parent; - if (parentParent) { - tempPosition[0] = targetX; - tempPosition[1] = targetY; - parentParent.worldToLocal(tempPosition); - targetX = (tempPosition[0] - parent.x) * parentParent.worldScaleX; - targetY = (tempPosition[1] - parent.y) * parentParent.worldScaleY; - } else { - targetX -= parent.x; - targetY -= parent.y; - } - if (child.parent == parent) { - positionX = child.x; - positionY = child.y; - } else { - tempPosition[0] = child.x; - tempPosition[1] = child.y; - child.parent.localToWorld(tempPosition); - parent.worldToLocal(tempPosition); - positionX = tempPosition[0]; - positionY = tempPosition[1]; - } - var childX = positionX * parent.worldScaleX, childY = positionY * parent.worldScaleY; - var offset = Math.atan2(childY, childX); - var len1 = Math.sqrt(childX * childX + childY * childY), len2 = child.data.length * child.worldScaleX; - // Based on code by Ryan Juckett with permission: Copyright (c) 2008-2009 Ryan Juckett, http://www.ryanjuckett.com/ - var cosDenom = 2 * len1 * len2; - if (cosDenom < 0.0001) { - child.rotationIK = childRotation + (Math.atan2(targetY, targetX) * spine.radDeg - parentRotation - childRotation) * alpha; - return; - } - var cos = (targetX * targetX + targetY * targetY - len1 * len1 - len2 * len2) / cosDenom; - if (cos < -1) - cos = -1; - else if (cos > 1) - cos = 1; - var childAngle = Math.acos(cos) * bendDirection; - var adjacent = len1 + len2 * cos, opposite = len2 * Math.sin(childAngle); - var parentAngle = Math.atan2(targetY * adjacent - targetX * opposite, targetX * adjacent + targetY * opposite); - var rotation = (parentAngle - offset) * spine.radDeg - parentRotation; - if (rotation > 180) - rotation -= 360; - else if (rotation < -180) // - rotation += 360; - parent.rotationIK = parentRotation + rotation * alpha; - rotation = (childAngle + offset) * spine.radDeg - childRotation; - if (rotation > 180) - rotation -= 360; - else if (rotation < -180) // - rotation += 360; - child.rotationIK = childRotation + (rotation + parent.worldRotation - child.parent.worldRotation) * alpha; -}; - -spine.Skin = function (name) { - this.name = name; - this.attachments = {}; -}; -spine.Skin.prototype = { - addAttachment: function (slotIndex, name, attachment) { - this.attachments[slotIndex + ":" + name] = attachment; - }, - getAttachment: function (slotIndex, name) { - return this.attachments[slotIndex + ":" + name]; - }, - _attachAll: function (skeleton, oldSkin) { - for (var key in oldSkin.attachments) { - var colon = key.indexOf(":"); - var slotIndex = parseInt(key.substring(0, colon)); - var name = key.substring(colon + 1); - var slot = skeleton.slots[slotIndex]; - if (slot.attachment && slot.attachment.name == name) { - var attachment = this.getAttachment(slotIndex, name); - if (attachment) slot.setAttachment(attachment); - } - } - } -}; - -spine.Animation = function (name, timelines, duration) { - this.name = name; - this.timelines = timelines; - this.duration = duration; -}; -spine.Animation.prototype = { - apply: function (skeleton, lastTime, time, loop, events) { - if (loop && this.duration != 0) { - time %= this.duration; - lastTime %= this.duration; - } - var timelines = this.timelines; - for (var i = 0, n = timelines.length; i < n; i++) - timelines[i].apply(skeleton, lastTime, time, events, 1); - }, - mix: function (skeleton, lastTime, time, loop, events, alpha) { - if (loop && this.duration != 0) { - time %= this.duration; - lastTime %= this.duration; - } - var timelines = this.timelines; - for (var i = 0, n = timelines.length; i < n; i++) - timelines[i].apply(skeleton, lastTime, time, events, alpha); - } -}; -spine.Animation.binarySearch = function (values, target, step) { - var low = 0; - var high = Math.floor(values.length / step) - 2; - if (!high) return step; - var current = high >>> 1; - while (true) { - if (values[(current + 1) * step] <= target) - low = current + 1; - else - high = current; - if (low == high) return (low + 1) * step; - current = (low + high) >>> 1; - } -}; -spine.Animation.binarySearch1 = function (values, target) { - var low = 0; - var high = values.length - 2; - if (!high) return 1; - var current = high >>> 1; - while (true) { - if (values[current + 1] <= target) - low = current + 1; - else - high = current; - if (low == high) return low + 1; - current = (low + high) >>> 1; - } -}; -spine.Animation.linearSearch = function (values, target, step) { - for (var i = 0, last = values.length - step; i <= last; i += step) - if (values[i] > target) return i; - return -1; -}; - -spine.Curves = function (frameCount) { - this.curves = []; // type, x, y, ... - //this.curves.length = (frameCount - 1) * 19/*BEZIER_SIZE*/; -}; -spine.Curves.prototype = { - setLinear: function (frameIndex) { - this.curves[frameIndex * 19/*BEZIER_SIZE*/] = 0/*LINEAR*/; - }, - setStepped: function (frameIndex) { - this.curves[frameIndex * 19/*BEZIER_SIZE*/] = 1/*STEPPED*/; - }, - /** Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next. - * cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of - * the difference between the keyframe's values. */ - setCurve: function (frameIndex, cx1, cy1, cx2, cy2) { - var subdiv1 = 1 / 10/*BEZIER_SEGMENTS*/, subdiv2 = subdiv1 * subdiv1, subdiv3 = subdiv2 * subdiv1; - var pre1 = 3 * subdiv1, pre2 = 3 * subdiv2, pre4 = 6 * subdiv2, pre5 = 6 * subdiv3; - var tmp1x = -cx1 * 2 + cx2, tmp1y = -cy1 * 2 + cy2, tmp2x = (cx1 - cx2) * 3 + 1, tmp2y = (cy1 - cy2) * 3 + 1; - var dfx = cx1 * pre1 + tmp1x * pre2 + tmp2x * subdiv3, dfy = cy1 * pre1 + tmp1y * pre2 + tmp2y * subdiv3; - var ddfx = tmp1x * pre4 + tmp2x * pre5, ddfy = tmp1y * pre4 + tmp2y * pre5; - var dddfx = tmp2x * pre5, dddfy = tmp2y * pre5; - - var i = frameIndex * 19/*BEZIER_SIZE*/; - var curves = this.curves; - curves[i++] = 2/*BEZIER*/; - - var x = dfx, y = dfy; - for (var n = i + 19/*BEZIER_SIZE*/ - 1; i < n; i += 2) { - curves[i] = x; - curves[i + 1] = y; - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - x += dfx; - y += dfy; - } - }, - getCurvePercent: function (frameIndex, percent) { - percent = percent < 0 ? 0 : (percent > 1 ? 1 : percent); - var curves = this.curves; - var i = frameIndex * 19/*BEZIER_SIZE*/; - var type = curves[i]; - if (type === 0/*LINEAR*/) return percent; - if (type == 1/*STEPPED*/) return 0; - i++; - var x = 0; - for (var start = i, n = i + 19/*BEZIER_SIZE*/ - 1; i < n; i += 2) { - x = curves[i]; - if (x >= percent) { - var prevX, prevY; - if (i == start) { - prevX = 0; - prevY = 0; - } else { - prevX = curves[i - 2]; - prevY = curves[i - 1]; - } - return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX); - } - } - var y = curves[i - 1]; - return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1. - } -}; - -spine.RotateTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, angle, ... - this.frames.length = frameCount * 2; -}; -spine.RotateTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, angle) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = angle; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 2]) { // Time is after last frame. - var amount = bone.data.rotation + frames[frames.length - 1] - bone.rotation; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - bone.rotation += amount * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 2); - var prevFrameValue = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 2/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 2 - 1, percent); - - var amount = frames[frameIndex + 1/*FRAME_VALUE*/] - prevFrameValue; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - amount = bone.data.rotation + (prevFrameValue + amount * percent) - bone.rotation; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - bone.rotation += amount * alpha; - } -}; - -spine.TranslateTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, x, y, ... - this.frames.length = frameCount * 3; -}; -spine.TranslateTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, x, y) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = x; - this.frames[frameIndex + 2] = y; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - bone.x += (bone.data.x + frames[frames.length - 2] - bone.x) * alpha; - bone.y += (bone.data.y + frames[frames.length - 1] - bone.y) * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameX = frames[frameIndex - 2]; - var prevFrameY = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - bone.x += (bone.data.x + prevFrameX + (frames[frameIndex + 1/*FRAME_X*/] - prevFrameX) * percent - bone.x) * alpha; - bone.y += (bone.data.y + prevFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - prevFrameY) * percent - bone.y) * alpha; - } -}; - -spine.ScaleTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, x, y, ... - this.frames.length = frameCount * 3; -}; -spine.ScaleTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, x, y) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = x; - this.frames[frameIndex + 2] = y; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - bone.scaleX += (bone.data.scaleX * frames[frames.length - 2] - bone.scaleX) * alpha; - bone.scaleY += (bone.data.scaleY * frames[frames.length - 1] - bone.scaleY) * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameX = frames[frameIndex - 2]; - var prevFrameY = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - bone.scaleX += (bone.data.scaleX * (prevFrameX + (frames[frameIndex + 1/*FRAME_X*/] - prevFrameX) * percent) - bone.scaleX) * alpha; - bone.scaleY += (bone.data.scaleY * (prevFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - prevFrameY) * percent) - bone.scaleY) * alpha; - } -}; - -spine.ColorTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, r, g, b, a, ... - this.frames.length = frameCount * 5; -}; -spine.ColorTimeline.prototype = { - slotIndex: 0, - getFrameCount: function () { - return this.frames.length / 5; - }, - setFrame: function (frameIndex, time, r, g, b, a) { - frameIndex *= 5; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = r; - this.frames[frameIndex + 2] = g; - this.frames[frameIndex + 3] = b; - this.frames[frameIndex + 4] = a; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var r, g, b, a; - if (time >= frames[frames.length - 5]) { - // Time is after last frame. - var i = frames.length - 1; - r = frames[i - 3]; - g = frames[i - 2]; - b = frames[i - 1]; - a = frames[i]; - } else { - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 5); - var prevFrameR = frames[frameIndex - 4]; - var prevFrameG = frames[frameIndex - 3]; - var prevFrameB = frames[frameIndex - 2]; - var prevFrameA = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 5/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 5 - 1, percent); - - r = prevFrameR + (frames[frameIndex + 1/*FRAME_R*/] - prevFrameR) * percent; - g = prevFrameG + (frames[frameIndex + 2/*FRAME_G*/] - prevFrameG) * percent; - b = prevFrameB + (frames[frameIndex + 3/*FRAME_B*/] - prevFrameB) * percent; - a = prevFrameA + (frames[frameIndex + 4/*FRAME_A*/] - prevFrameA) * percent; - } - var slot = skeleton.slots[this.slotIndex]; - if (alpha < 1) { - slot.r += (r - slot.r) * alpha; - slot.g += (g - slot.g) * alpha; - slot.b += (b - slot.b) * alpha; - slot.a += (a - slot.a) * alpha; - } else { - slot.r = r; - slot.g = g; - slot.b = b; - slot.a = a; - } - } -}; - -spine.AttachmentTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, ... - this.frames.length = frameCount; - this.attachmentNames = []; - this.attachmentNames.length = frameCount; -}; -spine.AttachmentTimeline.prototype = { - slotIndex: 0, - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, attachmentName) { - this.frames[frameIndex] = time; - this.attachmentNames[frameIndex] = attachmentName; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - - var frameIndex = time >= frames[frames.length - 1] ? frames.length - 1 : spine.Animation.binarySearch1(frames, time) - 1; - if (frames[frameIndex] < lastTime) return; - - var attachmentName = this.attachmentNames[frameIndex]; - skeleton.slots[this.slotIndex].setAttachment( - !attachmentName ? null : skeleton.getAttachmentBySlotIndex(this.slotIndex, attachmentName)); - } -}; - -spine.EventTimeline = function (frameCount) { - this.frames = []; // time, ... - this.frames.length = frameCount; - this.events = []; - this.events.length = frameCount; -}; -spine.EventTimeline.prototype = { - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, event) { - this.frames[frameIndex] = time; - this.events[frameIndex] = event; - }, - /** Fires events for frames > lastTime and <= time. */ - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - if (!firedEvents) return; - - var frames = this.frames; - var frameCount = frames.length; - - if (lastTime > time) { // Fire events after last time for looped animations. - this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha); - lastTime = -1; - } else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame. - return; - if (time < frames[0]) return; // Time is before first frame. - - var frameIndex; - if (lastTime < frames[0]) - frameIndex = 0; - else { - frameIndex = spine.Animation.binarySearch1(frames, lastTime); - var frame = frames[frameIndex]; - while (frameIndex > 0) { // Fire multiple events with the same frame. - if (frames[frameIndex - 1] != frame) break; - frameIndex--; - } - } - var events = this.events; - for (; frameIndex < frameCount && time >= frames[frameIndex]; frameIndex++) - firedEvents.push(events[frameIndex]); - } -}; - -spine.DrawOrderTimeline = function (frameCount) { - this.frames = []; // time, ... - this.frames.length = frameCount; - this.drawOrders = []; - this.drawOrders.length = frameCount; -}; -spine.DrawOrderTimeline.prototype = { - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, drawOrder) { - this.frames[frameIndex] = time; - this.drawOrders[frameIndex] = drawOrder; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var frameIndex; - if (time >= frames[frames.length - 1]) // Time is after last frame. - frameIndex = frames.length - 1; - else - frameIndex = spine.Animation.binarySearch1(frames, time) - 1; - - var drawOrder = skeleton.drawOrder; - var slots = skeleton.slots; - var drawOrderToSetupIndex = this.drawOrders[frameIndex]; - if (!drawOrderToSetupIndex) { - for (var i = 0, n = slots.length; i < n; i++) - drawOrder[i] = slots[i]; - } else { - for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++) - drawOrder[i] = skeleton.slots[drawOrderToSetupIndex[i]]; - } - - } -}; - -spine.FfdTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; - this.frames.length = frameCount; - this.frameVertices = []; - this.frameVertices.length = frameCount; -}; -spine.FfdTimeline.prototype = { - slotIndex: 0, - attachment: 0, - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, vertices) { - this.frames[frameIndex] = time; - this.frameVertices[frameIndex] = vertices; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var slot = skeleton.slots[this.slotIndex]; - if (slot.attachment != this.attachment) return; - - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var frameVertices = this.frameVertices; - var vertexCount = frameVertices[0].length; - - var vertices = slot.attachmentVertices; - if (vertices.length != vertexCount) alpha = 1; - vertices.length = vertexCount; - - if (time >= frames[frames.length - 1]) { // Time is after last frame. - var lastVertices = frameVertices[frames.length - 1]; - if (alpha < 1) { - for (var i = 0; i < vertexCount; i++) - vertices[i] += (lastVertices[i] - vertices[i]) * alpha; - } else { - for (var i = 0; i < vertexCount; i++) - vertices[i] = lastVertices[i]; - } - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch1(frames, time); - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 1] - frameTime); - percent = this.curves.getCurvePercent(frameIndex - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent)); - - var prevVertices = frameVertices[frameIndex - 1]; - var nextVertices = frameVertices[frameIndex]; - - if (alpha < 1) { - for (var i = 0; i < vertexCount; i++) { - var prev = prevVertices[i]; - vertices[i] += (prev + (nextVertices[i] - prev) * percent - vertices[i]) * alpha; - } - } else { - for (var i = 0; i < vertexCount; i++) { - var prev = prevVertices[i]; - vertices[i] = prev + (nextVertices[i] - prev) * percent; - } - } - } -}; - -spine.IkConstraintTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, mix, bendDirection, ... - this.frames.length = frameCount * 3; -}; -spine.IkConstraintTimeline.prototype = { - ikConstraintIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, mix, bendDirection) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = mix; - this.frames[frameIndex + 2] = bendDirection; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var ikConstraint = skeleton.ikConstraints[this.ikConstraintIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - ikConstraint.mix += (frames[frames.length - 2] - ikConstraint.mix) * alpha; - ikConstraint.bendDirection = frames[frames.length - 1]; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameMix = frames[frameIndex + -2/*PREV_FRAME_MIX*/]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - var mix = prevFrameMix + (frames[frameIndex + 1/*FRAME_MIX*/] - prevFrameMix) * percent; - ikConstraint.mix += (mix - ikConstraint.mix) * alpha; - ikConstraint.bendDirection = frames[frameIndex + -1/*PREV_FRAME_BEND_DIRECTION*/]; - } -}; - -spine.FlipXTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, flip, ... - this.frames.length = frameCount * 2; -}; -spine.FlipXTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, flip) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = flip ? 1 : 0; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - var frameIndex = (time >= frames[frames.length - 2] ? frames.length : spine.Animation.binarySearch(frames, time, 2)) - 2; - if (frames[frameIndex] < lastTime) return; - skeleton.bones[boneIndex].flipX = frames[frameIndex + 1] != 0; - } -}; - -spine.FlipYTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, flip, ... - this.frames.length = frameCount * 2; -}; -spine.FlipYTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, flip) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = flip ? 1 : 0; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - var frameIndex = (time >= frames[frames.length - 2] ? frames.length : spine.Animation.binarySearch(frames, time, 2)) - 2; - if (frames[frameIndex] < lastTime) return; - skeleton.bones[boneIndex].flipY = frames[frameIndex + 1] != 0; - } -}; - -spine.SkeletonData = function () { - this.bones = []; - this.slots = []; - this.skins = []; - this.events = []; - this.animations = []; - this.ikConstraints = []; -}; -spine.SkeletonData.prototype = { - name: null, - defaultSkin: null, - width: 0, height: 0, - version: null, hash: null, - /** @return May be null. */ - findBone: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].name == boneName) return bones[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findBoneIndex: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].name == boneName) return i; - return -1; - }, - /** @return May be null. */ - findSlot: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - if (slots[i].name == slotName) return slot[i]; - } - return null; - }, - /** @return -1 if the bone was not found. */ - findSlotIndex: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].name == slotName) return i; - return -1; - }, - /** @return May be null. */ - findSkin: function (skinName) { - var skins = this.skins; - for (var i = 0, n = skins.length; i < n; i++) - if (skins[i].name == skinName) return skins[i]; - return null; - }, - /** @return May be null. */ - findEvent: function (eventName) { - var events = this.events; - for (var i = 0, n = events.length; i < n; i++) - if (events[i].name == eventName) return events[i]; - return null; - }, - /** @return May be null. */ - findAnimation: function (animationName) { - var animations = this.animations; - for (var i = 0, n = animations.length; i < n; i++) - if (animations[i].name == animationName) return animations[i]; - return null; - }, - /** @return May be null. */ - findIkConstraint: function (ikConstraintName) { - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) - if (ikConstraints[i].name == ikConstraintName) return ikConstraints[i]; - return null; - } -}; - -spine.Skeleton = function (skeletonData) { - this.data = skeletonData; - - this.bones = []; - for (var i = 0, n = skeletonData.bones.length; i < n; i++) { - var boneData = skeletonData.bones[i]; - var parent = !boneData.parent ? null : this.bones[skeletonData.bones.indexOf(boneData.parent)]; - this.bones.push(new spine.Bone(boneData, this, parent)); - } - - this.slots = []; - this.drawOrder = []; - for (var i = 0, n = skeletonData.slots.length; i < n; i++) { - var slotData = skeletonData.slots[i]; - var bone = this.bones[skeletonData.bones.indexOf(slotData.boneData)]; - var slot = new spine.Slot(slotData, bone); - this.slots.push(slot); - this.drawOrder.push(slot); - } - - this.ikConstraints = []; - for (var i = 0, n = skeletonData.ikConstraints.length; i < n; i++) - this.ikConstraints.push(new spine.IkConstraint(skeletonData.ikConstraints[i], this)); - - this.boneCache = []; - this.updateCache(); -}; -spine.Skeleton.prototype = { - x: 0, y: 0, - skin: null, - r: 1, g: 1, b: 1, a: 1, - time: 0, - flipX: false, flipY: false, - /** Caches information about bones and IK constraints. Must be called if bones or IK constraints are added or removed. */ - updateCache: function () { - var ikConstraints = this.ikConstraints; - var ikConstraintsCount = ikConstraints.length; - - var arrayCount = ikConstraintsCount + 1; - var boneCache = this.boneCache; - if (boneCache.length > arrayCount) boneCache.length = arrayCount; - for (var i = 0, n = boneCache.length; i < n; i++) - boneCache[i].length = 0; - while (boneCache.length < arrayCount) - boneCache[boneCache.length] = []; - - var nonIkBones = boneCache[0]; - var bones = this.bones; - - outer: - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - var current = bone; - do { - for (var ii = 0; ii < ikConstraintsCount; ii++) { - var ikConstraint = ikConstraints[ii]; - var parent = ikConstraint.bones[0]; - var child= ikConstraint.bones[ikConstraint.bones.length - 1]; - while (true) { - if (current == child) { - boneCache[ii].push(bone); - boneCache[ii + 1].push(bone); - continue outer; - } - if (child == parent) break; - child = child.parent; - } - } - current = current.parent; - } while (current); - nonIkBones[nonIkBones.length] = bone; - } - }, - /** Updates the world transform for each bone. */ - updateWorldTransform: function () { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - bone.rotationIK = bone.rotation; - } - var i = 0, last = this.boneCache.length - 1; - while (true) { - var cacheBones = this.boneCache[i]; - for (var ii = 0, nn = cacheBones.length; ii < nn; ii++) - cacheBones[ii].updateWorldTransform(); - if (i == last) break; - this.ikConstraints[i].apply(); - i++; - } - }, - /** Sets the bones and slots to their setup pose values. */ - setToSetupPose: function () { - this.setBonesToSetupPose(); - this.setSlotsToSetupPose(); - }, - setBonesToSetupPose: function () { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - bones[i].setToSetupPose(); - - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) { - var ikConstraint = ikConstraints[i]; - ikConstraint.bendDirection = ikConstraint.data.bendDirection; - ikConstraint.mix = ikConstraint.data.mix; - } - }, - setSlotsToSetupPose: function () { - var slots = this.slots; - var drawOrder = this.drawOrder; - for (var i = 0, n = slots.length; i < n; i++) { - drawOrder[i] = slots[i]; - slots[i].setToSetupPose(i); - } - }, - /** @return May return null. */ - getRootBone: function () { - return this.bones.length ? this.bones[0] : null; - }, - /** @return May be null. */ - findBone: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].data.name == boneName) return bones[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findBoneIndex: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].data.name == boneName) return i; - return -1; - }, - /** @return May be null. */ - findSlot: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].data.name == slotName) return slots[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findSlotIndex: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].data.name == slotName) return i; - return -1; - }, - setSkinByName: function (skinName) { - var skin = this.data.findSkin(skinName); - if (!skin) throw "Skin not found: " + skinName; - this.setSkin(skin); - }, - /** Sets the skin used to look up attachments before looking in the {@link SkeletonData#getDefaultSkin() default skin}. - * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was - * no old skin, each slot's setup mode attachment is attached from the new skin. - * @param newSkin May be null. */ - setSkin: function (newSkin) { - if (newSkin) { - if (this.skin) - newSkin._attachAll(this, this.skin); - else { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - var name = slot.data.attachmentName; - if (name) { - var attachment = newSkin.getAttachment(i, name); - if (attachment) slot.setAttachment(attachment); - } - } - } - } - this.skin = newSkin; - }, - /** @return May be null. */ - getAttachmentBySlotName: function (slotName, attachmentName) { - return this.getAttachmentBySlotIndex(this.data.findSlotIndex(slotName), attachmentName); - }, - /** @return May be null. */ - getAttachmentBySlotIndex: function (slotIndex, attachmentName) { - if (this.skin) { - var attachment = this.skin.getAttachment(slotIndex, attachmentName); - if (attachment) return attachment; - } - if (this.data.defaultSkin) return this.data.defaultSkin.getAttachment(slotIndex, attachmentName); - return null; - }, - /** @param attachmentName May be null. */ - setAttachment: function (slotName, attachmentName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - if (slot.data.name == slotName) { - var attachment = null; - if (attachmentName) { - attachment = this.getAttachmentBySlotIndex(i, attachmentName); - if (!attachment) throw "Attachment not found: " + attachmentName + ", for slot: " + slotName; - } - slot.setAttachment(attachment); - return; - } - } - throw "Slot not found: " + slotName; - }, - /** @return May be null. */ - findIkConstraint: function (ikConstraintName) { - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) - if (ikConstraints[i].data.name == ikConstraintName) return ikConstraints[i]; - return null; - }, - update: function (delta) { - this.time += delta; - } -}; - -spine.EventData = function (name) { - this.name = name; -}; -spine.EventData.prototype = { - intValue: 0, - floatValue: 0, - stringValue: null -}; - -spine.Event = function (data) { - this.data = data; -}; -spine.Event.prototype = { - intValue: 0, - floatValue: 0, - stringValue: null -}; - -spine.AttachmentType = { - region: 0, - boundingbox: 1, - mesh: 2, - skinnedmesh: 3 -}; - -spine.RegionAttachment = function (name) { - this.name = name; - this.offset = []; - this.offset.length = 8; - this.uvs = []; - this.uvs.length = 8; -}; -spine.RegionAttachment.prototype = { - type: spine.AttachmentType.region, - x: 0, y: 0, - rotation: 0, - scaleX: 1, scaleY: 1, - width: 0, height: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - setUVs: function (u, v, u2, v2, rotate) { - var uvs = this.uvs; - if (rotate) { - uvs[2/*X2*/] = u; - uvs[3/*Y2*/] = v2; - uvs[4/*X3*/] = u; - uvs[5/*Y3*/] = v; - uvs[6/*X4*/] = u2; - uvs[7/*Y4*/] = v; - uvs[0/*X1*/] = u2; - uvs[1/*Y1*/] = v2; - } else { - uvs[0/*X1*/] = u; - uvs[1/*Y1*/] = v2; - uvs[2/*X2*/] = u; - uvs[3/*Y2*/] = v; - uvs[4/*X3*/] = u2; - uvs[5/*Y3*/] = v; - uvs[6/*X4*/] = u2; - uvs[7/*Y4*/] = v2; - } - }, - updateOffset: function () { - var regionScaleX = this.width / this.regionOriginalWidth * this.scaleX; - var regionScaleY = this.height / this.regionOriginalHeight * this.scaleY; - var localX = -this.width / 2 * this.scaleX + this.regionOffsetX * regionScaleX; - var localY = -this.height / 2 * this.scaleY + this.regionOffsetY * regionScaleY; - var localX2 = localX + this.regionWidth * regionScaleX; - var localY2 = localY + this.regionHeight * regionScaleY; - var radians = this.rotation * spine.degRad; - var cos = Math.cos(radians); - var sin = Math.sin(radians); - var localXCos = localX * cos + this.x; - var localXSin = localX * sin; - var localYCos = localY * cos + this.y; - var localYSin = localY * sin; - var localX2Cos = localX2 * cos + this.x; - var localX2Sin = localX2 * sin; - var localY2Cos = localY2 * cos + this.y; - var localY2Sin = localY2 * sin; - var offset = this.offset; - offset[0/*X1*/] = localXCos - localYSin; - offset[1/*Y1*/] = localYCos + localXSin; - offset[2/*X2*/] = localXCos - localY2Sin; - offset[3/*Y2*/] = localY2Cos + localXSin; - offset[4/*X3*/] = localX2Cos - localY2Sin; - offset[5/*Y3*/] = localY2Cos + localX2Sin; - offset[6/*X4*/] = localX2Cos - localYSin; - offset[7/*Y4*/] = localYCos + localX2Sin; - }, - computeVertices: function (x, y, bone, vertices) { - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var offset = this.offset; - vertices[0/*X1*/] = offset[0/*X1*/] * m00 + offset[1/*Y1*/] * m01 + x; - vertices[1/*Y1*/] = offset[0/*X1*/] * m10 + offset[1/*Y1*/] * m11 + y; - vertices[2/*X2*/] = offset[2/*X2*/] * m00 + offset[3/*Y2*/] * m01 + x; - vertices[3/*Y2*/] = offset[2/*X2*/] * m10 + offset[3/*Y2*/] * m11 + y; - vertices[4/*X3*/] = offset[4/*X3*/] * m00 + offset[5/*X3*/] * m01 + x; - vertices[5/*X3*/] = offset[4/*X3*/] * m10 + offset[5/*X3*/] * m11 + y; - vertices[6/*X4*/] = offset[6/*X4*/] * m00 + offset[7/*Y4*/] * m01 + x; - vertices[7/*Y4*/] = offset[6/*X4*/] * m10 + offset[7/*Y4*/] * m11 + y; - } -}; - -spine.MeshAttachment = function (name) { - this.name = name; -}; -spine.MeshAttachment.prototype = { - type: spine.AttachmentType.mesh, - vertices: null, - uvs: null, - regionUVs: null, - triangles: null, - hullLength: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionU: 0, regionV: 0, regionU2: 0, regionV2: 0, regionRotate: false, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - edges: null, - width: 0, height: 0, - updateUVs: function () { - var width = this.regionU2 - this.regionU, height = this.regionV2 - this.regionV; - var n = this.regionUVs.length; - if (!this.uvs || this.uvs.length != n) { - this.uvs = new spine.Float32Array(n); - } - if (this.regionRotate) { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i + 1] * width; - this.uvs[i + 1] = this.regionV + height - this.regionUVs[i] * height; - } - } else { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i] * width; - this.uvs[i + 1] = this.regionV + this.regionUVs[i + 1] * height; - } - } - }, - computeWorldVertices: function (x, y, slot, worldVertices) { - var bone = slot.bone; - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var vertices = this.vertices; - var verticesCount = vertices.length; - if (slot.attachmentVertices.length == verticesCount) vertices = slot.attachmentVertices; - for (var i = 0; i < verticesCount; i += 2) { - var vx = vertices[i]; - var vy = vertices[i + 1]; - worldVertices[i] = vx * m00 + vy * m01 + x; - worldVertices[i + 1] = vx * m10 + vy * m11 + y; - } - } -}; - -spine.SkinnedMeshAttachment = function (name) { - this.name = name; -}; -spine.SkinnedMeshAttachment.prototype = { - type: spine.AttachmentType.skinnedmesh, - bones: null, - weights: null, - uvs: null, - regionUVs: null, - triangles: null, - hullLength: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionU: 0, regionV: 0, regionU2: 0, regionV2: 0, regionRotate: false, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - edges: null, - width: 0, height: 0, - updateUVs: function (u, v, u2, v2, rotate) { - var width = this.regionU2 - this.regionU, height = this.regionV2 - this.regionV; - var n = this.regionUVs.length; - if (!this.uvs || this.uvs.length != n) { - this.uvs = new spine.Float32Array(n); - } - if (this.regionRotate) { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i + 1] * width; - this.uvs[i + 1] = this.regionV + height - this.regionUVs[i] * height; - } - } else { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i] * width; - this.uvs[i + 1] = this.regionV + this.regionUVs[i + 1] * height; - } - } - }, - computeWorldVertices: function (x, y, slot, worldVertices) { - var skeletonBones = slot.bone.skeleton.bones; - var weights = this.weights; - var bones = this.bones; - - var w = 0, v = 0, b = 0, f = 0, n = bones.length, nn; - var wx, wy, bone, vx, vy, weight; - if (!slot.attachmentVertices.length) { - for (; v < n; w += 2) { - wx = 0; - wy = 0; - nn = bones[v++] + v; - for (; v < nn; v++, b += 3) { - bone = skeletonBones[bones[v]]; - vx = weights[b]; - vy = weights[b + 1]; - weight = weights[b + 2]; - wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight; - wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight; - } - worldVertices[w] = wx + x; - worldVertices[w + 1] = wy + y; - } - } else { - var ffd = slot.attachmentVertices; - for (; v < n; w += 2) { - wx = 0; - wy = 0; - nn = bones[v++] + v; - for (; v < nn; v++, b += 3, f += 2) { - bone = skeletonBones[bones[v]]; - vx = weights[b] + ffd[f]; - vy = weights[b + 1] + ffd[f + 1]; - weight = weights[b + 2]; - wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight; - wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight; - } - worldVertices[w] = wx + x; - worldVertices[w + 1] = wy + y; - } - } - } -}; - -spine.BoundingBoxAttachment = function (name) { - this.name = name; - this.vertices = []; -}; -spine.BoundingBoxAttachment.prototype = { - type: spine.AttachmentType.boundingbox, - computeWorldVertices: function (x, y, bone, worldVertices) { - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var vertices = this.vertices; - for (var i = 0, n = vertices.length; i < n; i += 2) { - var px = vertices[i]; - var py = vertices[i + 1]; - worldVertices[i] = px * m00 + py * m01 + x; - worldVertices[i + 1] = px * m10 + py * m11 + y; - } - } -}; - -spine.AnimationStateData = function (skeletonData) { - this.skeletonData = skeletonData; - this.animationToMixTime = {}; -}; -spine.AnimationStateData.prototype = { - defaultMix: 0, - setMixByName: function (fromName, toName, duration) { - var from = this.skeletonData.findAnimation(fromName); - if (!from) throw "Animation not found: " + fromName; - var to = this.skeletonData.findAnimation(toName); - if (!to) throw "Animation not found: " + toName; - this.setMix(from, to, duration); - }, - setMix: function (from, to, duration) { - this.animationToMixTime[from.name + ":" + to.name] = duration; - }, - getMix: function (from, to) { - var key = from.name + ":" + to.name; - return this.animationToMixTime.hasOwnProperty(key) ? this.animationToMixTime[key] : this.defaultMix; - } -}; - -spine.TrackEntry = function () {}; -spine.TrackEntry.prototype = { - next: null, previous: null, - animation: null, - loop: false, - delay: 0, time: 0, lastTime: -1, endTime: 0, - timeScale: 1, - mixTime: 0, mixDuration: 0, mix: 1, - onStart: null, onEnd: null, onComplete: null, onEvent: null -}; - -spine.AnimationState = function (stateData) { - this.data = stateData; - this.tracks = []; - this.events = []; -}; -spine.AnimationState.prototype = { - onStart: null, - onEnd: null, - onComplete: null, - onEvent: null, - timeScale: 1, - update: function (delta) { - delta *= this.timeScale; - for (var i = 0; i < this.tracks.length; i++) { - var current = this.tracks[i]; - if (!current) continue; - - current.time += delta * current.timeScale; - if (current.previous) { - var previousDelta = delta * current.previous.timeScale; - current.previous.time += previousDelta; - current.mixTime += previousDelta; - } - - var next = current.next; - if (next) { - next.time = current.lastTime - next.delay; - if (next.time >= 0) this.setCurrent(i, next); - } else { - // End non-looping animation when it reaches its end time and there is no next entry. - if (!current.loop && current.lastTime >= current.endTime) this.clearTrack(i); - } - } - }, - apply: function (skeleton) { - for (var i = 0; i < this.tracks.length; i++) { - var current = this.tracks[i]; - if (!current) continue; - - this.events.length = 0; - - var time = current.time; - var lastTime = current.lastTime; - var endTime = current.endTime; - var loop = current.loop; - if (!loop && time > endTime) time = endTime; - - var previous = current.previous; - if (!previous) { - if (current.mix == 1) - current.animation.apply(skeleton, current.lastTime, time, loop, this.events); - else - current.animation.mix(skeleton, current.lastTime, time, loop, this.events, current.mix); - } else { - var previousTime = previous.time; - if (!previous.loop && previousTime > previous.endTime) previousTime = previous.endTime; - previous.animation.apply(skeleton, previousTime, previousTime, previous.loop, null); - - var alpha = current.mixTime / current.mixDuration * current.mix; - if (alpha >= 1) { - alpha = 1; - current.previous = null; - } - current.animation.mix(skeleton, current.lastTime, time, loop, this.events, alpha); - } - - for (var ii = 0, nn = this.events.length; ii < nn; ii++) { - var event = this.events[ii]; - if (current.onEvent) current.onEvent(i, event); - if (this.onEvent) this.onEvent(i, event); - } - - // Check if completed the animation or a loop iteration. - if (loop ? (lastTime % endTime > time % endTime) : (lastTime < endTime && time >= endTime)) { - var count = Math.floor(time / endTime); - if (current.onComplete) current.onComplete(i, count); - if (this.onComplete) this.onComplete(i, count); - } - - current.lastTime = current.time; - } - }, - clearTracks: function () { - for (var i = 0, n = this.tracks.length; i < n; i++) - this.clearTrack(i); - this.tracks.length = 0; - }, - clearTrack: function (trackIndex) { - if (trackIndex >= this.tracks.length) return; - var current = this.tracks[trackIndex]; - if (!current) return; - - if (current.onEnd) current.onEnd(trackIndex); - if (this.onEnd) this.onEnd(trackIndex); - - this.tracks[trackIndex] = null; - }, - _expandToIndex: function (index) { - if (index < this.tracks.length) return this.tracks[index]; - while (index >= this.tracks.length) - this.tracks.push(null); - return null; - }, - setCurrent: function (index, entry) { - var current = this._expandToIndex(index); - if (current) { - var previous = current.previous; - current.previous = null; - - if (current.onEnd) current.onEnd(index); - if (this.onEnd) this.onEnd(index); - - entry.mixDuration = this.data.getMix(current.animation, entry.animation); - if (entry.mixDuration > 0) { - entry.mixTime = 0; - // If a mix is in progress, mix from the closest animation. - if (previous && current.mixTime / current.mixDuration < 0.5) - entry.previous = previous; - else - entry.previous = current; - } - } - - this.tracks[index] = entry; - - if (entry.onStart) entry.onStart(index); - if (this.onStart) this.onStart(index); - }, - setAnimationByName: function (trackIndex, animationName, loop) { - var animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) throw "Animation not found: " + animationName; - return this.setAnimation(trackIndex, animation, loop); - }, - /** Set the current animation. Any queued animations are cleared. */ - setAnimation: function (trackIndex, animation, loop) { - var entry = new spine.TrackEntry(); - entry.animation = animation; - entry.loop = loop; - entry.endTime = animation.duration; - this.setCurrent(trackIndex, entry); - return entry; - }, - addAnimationByName: function (trackIndex, animationName, loop, delay) { - var animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) throw "Animation not found: " + animationName; - return this.addAnimation(trackIndex, animation, loop, delay); - }, - /** Adds an animation to be played delay seconds after the current or last queued animation. - * @param delay May be <= 0 to use duration of previous animation minus any mix duration plus the negative delay. */ - addAnimation: function (trackIndex, animation, loop, delay) { - var entry = new spine.TrackEntry(); - entry.animation = animation; - entry.loop = loop; - entry.endTime = animation.duration; - - var last = this._expandToIndex(trackIndex); - if (last) { - while (last.next) - last = last.next; - last.next = entry; - } else - this.tracks[trackIndex] = entry; - - if (delay <= 0) { - if (last) - delay += last.endTime - this.data.getMix(last.animation, animation); - else - delay = 0; - } - entry.delay = delay; - - return entry; - }, - /** May be null. */ - getCurrent: function (trackIndex) { - if (trackIndex >= this.tracks.length) return null; - return this.tracks[trackIndex]; - } -}; - -spine.SkeletonJson = function (attachmentLoader) { - this.attachmentLoader = attachmentLoader; -}; -spine.SkeletonJson.prototype = { - scale: 1, - readSkeletonData: function (root, name) { - var skeletonData = new spine.SkeletonData(); - skeletonData.name = name; - - // Skeleton. - var skeletonMap = root["skeleton"]; - if (skeletonMap) { - skeletonData.hash = skeletonMap["hash"]; - skeletonData.version = skeletonMap["spine"]; - skeletonData.width = skeletonMap["width"] || 0; - skeletonData.height = skeletonMap["height"] || 0; - } - - // Bones. - var bones = root["bones"]; - for (var i = 0, n = bones.length; i < n; i++) { - var boneMap = bones[i]; - var parent = null; - if (boneMap["parent"]) { - parent = skeletonData.findBone(boneMap["parent"]); - if (!parent) throw "Parent bone not found: " + boneMap["parent"]; - } - var boneData = new spine.BoneData(boneMap["name"], parent); - boneData.length = (boneMap["length"] || 0) * this.scale; - boneData.x = (boneMap["x"] || 0) * this.scale; - boneData.y = (boneMap["y"] || 0) * this.scale; - boneData.rotation = (boneMap["rotation"] || 0); - boneData.scaleX = boneMap.hasOwnProperty("scaleX") ? boneMap["scaleX"] : 1; - boneData.scaleY = boneMap.hasOwnProperty("scaleY") ? boneMap["scaleY"] : 1; - boneData.inheritScale = boneMap.hasOwnProperty("inheritScale") ? boneMap["inheritScale"] : true; - boneData.inheritRotation = boneMap.hasOwnProperty("inheritRotation") ? boneMap["inheritRotation"] : true; - skeletonData.bones.push(boneData); - } - - // IK constraints. - var ik = root["ik"]; - if (ik) { - for (var i = 0, n = ik.length; i < n; i++) { - var ikMap = ik[i]; - var ikConstraintData = new spine.IkConstraintData(ikMap["name"]); - - var bones = ikMap["bones"]; - for (var ii = 0, nn = bones.length; ii < nn; ii++) { - var bone = skeletonData.findBone(bones[ii]); - if (!bone) throw "IK bone not found: " + bones[ii]; - ikConstraintData.bones.push(bone); - } - - ikConstraintData.target = skeletonData.findBone(ikMap["target"]); - if (!ikConstraintData.target) throw "Target bone not found: " + ikMap["target"]; - - ikConstraintData.bendDirection = (!ikMap.hasOwnProperty("bendPositive") || ikMap["bendPositive"]) ? 1 : -1; - ikConstraintData.mix = ikMap.hasOwnProperty("mix") ? ikMap["mix"] : 1; - - skeletonData.ikConstraints.push(ikConstraintData); - } - } - - // Slots. - var slots = root["slots"]; - for (var i = 0, n = slots.length; i < n; i++) { - var slotMap = slots[i]; - var boneData = skeletonData.findBone(slotMap["bone"]); - if (!boneData) throw "Slot bone not found: " + slotMap["bone"]; - var slotData = new spine.SlotData(slotMap["name"], boneData); - - var color = slotMap["color"]; - if (color) { - slotData.r = this.toColor(color, 0); - slotData.g = this.toColor(color, 1); - slotData.b = this.toColor(color, 2); - slotData.a = this.toColor(color, 3); - } - - slotData.attachmentName = slotMap["attachment"]; - slotData.additiveBlending = slotMap["additive"] && slotMap["additive"] == "true"; - - skeletonData.slots.push(slotData); - } - - // Skins. - var skins = root["skins"]; - for (var skinName in skins) { - if (!skins.hasOwnProperty(skinName)) continue; - var skinMap = skins[skinName]; - var skin = new spine.Skin(skinName); - for (var slotName in skinMap) { - if (!skinMap.hasOwnProperty(slotName)) continue; - var slotIndex = skeletonData.findSlotIndex(slotName); - var slotEntry = skinMap[slotName]; - for (var attachmentName in slotEntry) { - if (!slotEntry.hasOwnProperty(attachmentName)) continue; - var attachment = this.readAttachment(skin, attachmentName, slotEntry[attachmentName]); - if (attachment) skin.addAttachment(slotIndex, attachmentName, attachment); - } - } - skeletonData.skins.push(skin); - if (skin.name == "default") skeletonData.defaultSkin = skin; - } - - // Events. - var events = root["events"]; - for (var eventName in events) { - if (!events.hasOwnProperty(eventName)) continue; - var eventMap = events[eventName]; - var eventData = new spine.EventData(eventName); - eventData.intValue = eventMap["int"] || 0; - eventData.floatValue = eventMap["float"] || 0; - eventData.stringValue = eventMap["string"] || null; - skeletonData.events.push(eventData); - } - - // Animations. - var animations = root["animations"]; - for (var animationName in animations) { - if (!animations.hasOwnProperty(animationName)) continue; - this.readAnimation(animationName, animations[animationName], skeletonData); - } - - return skeletonData; - }, - readAttachment: function (skin, name, map) { - name = map["name"] || name; - - var type = spine.AttachmentType[map["type"] || "region"]; - var path = map["path"] || name; - - var scale = this.scale; - if (type == spine.AttachmentType.region) { - var region = this.attachmentLoader.newRegionAttachment(skin, name, path); - if (!region) return null; - region.path = path; - region.x = (map["x"] || 0) * scale; - region.y = (map["y"] || 0) * scale; - region.scaleX = map.hasOwnProperty("scaleX") ? map["scaleX"] : 1; - region.scaleY = map.hasOwnProperty("scaleY") ? map["scaleY"] : 1; - region.rotation = map["rotation"] || 0; - region.width = (map["width"] || 0) * scale; - region.height = (map["height"] || 0) * scale; - - var color = map["color"]; - if (color) { - region.r = this.toColor(color, 0); - region.g = this.toColor(color, 1); - region.b = this.toColor(color, 2); - region.a = this.toColor(color, 3); - } - - region.updateOffset(); - return region; - } else if (type == spine.AttachmentType.mesh) { - var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path); - if (!mesh) return null; - mesh.path = path; - mesh.vertices = this.getFloatArray(map, "vertices", scale); - mesh.triangles = this.getIntArray(map, "triangles"); - mesh.regionUVs = this.getFloatArray(map, "uvs", 1); - mesh.updateUVs(); - - color = map["color"]; - if (color) { - mesh.r = this.toColor(color, 0); - mesh.g = this.toColor(color, 1); - mesh.b = this.toColor(color, 2); - mesh.a = this.toColor(color, 3); - } - - mesh.hullLength = (map["hull"] || 0) * 2; - if (map["edges"]) mesh.edges = this.getIntArray(map, "edges"); - mesh.width = (map["width"] || 0) * scale; - mesh.height = (map["height"] || 0) * scale; - return mesh; - } else if (type == spine.AttachmentType.skinnedmesh) { - var mesh = this.attachmentLoader.newSkinnedMeshAttachment(skin, name, path); - if (!mesh) return null; - mesh.path = path; - - var uvs = this.getFloatArray(map, "uvs", 1); - var vertices = this.getFloatArray(map, "vertices", 1); - var weights = []; - var bones = []; - for (var i = 0, n = vertices.length; i < n; ) { - var boneCount = vertices[i++] | 0; - bones[bones.length] = boneCount; - for (var nn = i + boneCount * 4; i < nn; ) { - bones[bones.length] = vertices[i]; - weights[weights.length] = vertices[i + 1] * scale; - weights[weights.length] = vertices[i + 2] * scale; - weights[weights.length] = vertices[i + 3]; - i += 4; - } - } - mesh.bones = bones; - mesh.weights = weights; - mesh.triangles = this.getIntArray(map, "triangles"); - mesh.regionUVs = uvs; - mesh.updateUVs(); - - color = map["color"]; - if (color) { - mesh.r = this.toColor(color, 0); - mesh.g = this.toColor(color, 1); - mesh.b = this.toColor(color, 2); - mesh.a = this.toColor(color, 3); - } - - mesh.hullLength = (map["hull"] || 0) * 2; - if (map["edges"]) mesh.edges = this.getIntArray(map, "edges"); - mesh.width = (map["width"] || 0) * scale; - mesh.height = (map["height"] || 0) * scale; - return mesh; - } else if (type == spine.AttachmentType.boundingbox) { - var attachment = this.attachmentLoader.newBoundingBoxAttachment(skin, name); - var vertices = map["vertices"]; - for (var i = 0, n = vertices.length; i < n; i++) - attachment.vertices.push(vertices[i] * scale); - return attachment; - } - throw "Unknown attachment type: " + type; - }, - readAnimation: function (name, map, skeletonData) { - var timelines = []; - var duration = 0; - - var slots = map["slots"]; - for (var slotName in slots) { - if (!slots.hasOwnProperty(slotName)) continue; - var slotMap = slots[slotName]; - var slotIndex = skeletonData.findSlotIndex(slotName); - - for (var timelineName in slotMap) { - if (!slotMap.hasOwnProperty(timelineName)) continue; - var values = slotMap[timelineName]; - if (timelineName == "color") { - var timeline = new spine.ColorTimeline(values.length); - timeline.slotIndex = slotIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var color = valueMap["color"]; - var r = this.toColor(color, 0); - var g = this.toColor(color, 1); - var b = this.toColor(color, 2); - var a = this.toColor(color, 3); - timeline.setFrame(frameIndex, valueMap["time"], r, g, b, a); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 5 - 5]); - - } else if (timelineName == "attachment") { - var timeline = new spine.AttachmentTimeline(values.length); - timeline.slotIndex = slotIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex++, valueMap["time"], valueMap["name"]); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - - } else - throw "Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")"; - } - } - - var bones = map["bones"]; - for (var boneName in bones) { - if (!bones.hasOwnProperty(boneName)) continue; - var boneIndex = skeletonData.findBoneIndex(boneName); - if (boneIndex == -1) throw "Bone not found: " + boneName; - var boneMap = bones[boneName]; - - for (var timelineName in boneMap) { - if (!boneMap.hasOwnProperty(timelineName)) continue; - var values = boneMap[timelineName]; - if (timelineName == "rotate") { - var timeline = new spine.RotateTimeline(values.length); - timeline.boneIndex = boneIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex, valueMap["time"], valueMap["angle"]); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 2 - 2]); - - } else if (timelineName == "translate" || timelineName == "scale") { - var timeline; - var timelineScale = 1; - if (timelineName == "scale") - timeline = new spine.ScaleTimeline(values.length); - else { - timeline = new spine.TranslateTimeline(values.length); - timelineScale = this.scale; - } - timeline.boneIndex = boneIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var x = (valueMap["x"] || 0) * timelineScale; - var y = (valueMap["y"] || 0) * timelineScale; - timeline.setFrame(frameIndex, valueMap["time"], x, y); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 3 - 3]); - - } else if (timelineName == "flipX" || timelineName == "flipY") { - var x = timelineName == "flipX"; - var timeline = x ? new spine.FlipXTimeline(values.length) : new spine.FlipYTimeline(values.length); - timeline.boneIndex = boneIndex; - - var field = x ? "x" : "y"; - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex, valueMap["time"], valueMap[field] || false); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 2 - 2]); - } else - throw "Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")"; - } - } - - var ikMap = map["ik"]; - for (var ikConstraintName in ikMap) { - if (!ikMap.hasOwnProperty(ikConstraintName)) continue; - var ikConstraint = skeletonData.findIkConstraint(ikConstraintName); - var values = ikMap[ikConstraintName]; - var timeline = new spine.IkConstraintTimeline(values.length); - timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(ikConstraint); - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var mix = valueMap.hasOwnProperty("mix") ? valueMap["mix"] : 1; - var bendDirection = (!valueMap.hasOwnProperty("bendPositive") || valueMap["bendPositive"]) ? 1 : -1; - timeline.setFrame(frameIndex, valueMap["time"], mix, bendDirection); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.frameCount * 3 - 3]); - } - - var ffd = map["ffd"]; - for (var skinName in ffd) { - var skin = skeletonData.findSkin(skinName); - var slotMap = ffd[skinName]; - for (slotName in slotMap) { - var slotIndex = skeletonData.findSlotIndex(slotName); - var meshMap = slotMap[slotName]; - for (var meshName in meshMap) { - var values = meshMap[meshName]; - var timeline = new spine.FfdTimeline(values.length); - var attachment = skin.getAttachment(slotIndex, meshName); - if (!attachment) throw "FFD attachment not found: " + meshName; - timeline.slotIndex = slotIndex; - timeline.attachment = attachment; - - var isMesh = attachment.type == spine.AttachmentType.mesh; - var vertexCount; - if (isMesh) - vertexCount = attachment.vertices.length; - else - vertexCount = attachment.weights.length / 3 * 2; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var vertices; - if (!valueMap["vertices"]) { - if (isMesh) - vertices = attachment.vertices; - else { - vertices = []; - vertices.length = vertexCount; - } - } else { - var verticesValue = valueMap["vertices"]; - var vertices = []; - vertices.length = vertexCount; - var start = valueMap["offset"] || 0; - var nn = verticesValue.length; - if (this.scale == 1) { - for (var ii = 0; ii < nn; ii++) - vertices[ii + start] = verticesValue[ii]; - } else { - for (var ii = 0; ii < nn; ii++) - vertices[ii + start] = verticesValue[ii] * this.scale; - } - if (isMesh) { - var meshVertices = attachment.vertices; - for (var ii = 0, nn = vertices.length; ii < nn; ii++) - vertices[ii] += meshVertices[ii]; - } - } - - timeline.setFrame(frameIndex, valueMap["time"], vertices); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines[timelines.length] = timeline; - duration = Math.max(duration, timeline.frames[timeline.frameCount - 1]); - } - } - } - - var drawOrderValues = map["drawOrder"]; - if (!drawOrderValues) drawOrderValues = map["draworder"]; - if (drawOrderValues) { - var timeline = new spine.DrawOrderTimeline(drawOrderValues.length); - var slotCount = skeletonData.slots.length; - var frameIndex = 0; - for (var i = 0, n = drawOrderValues.length; i < n; i++) { - var drawOrderMap = drawOrderValues[i]; - var drawOrder = null; - if (drawOrderMap["offsets"]) { - drawOrder = []; - drawOrder.length = slotCount; - for (var ii = slotCount - 1; ii >= 0; ii--) - drawOrder[ii] = -1; - var offsets = drawOrderMap["offsets"]; - var unchanged = []; - unchanged.length = slotCount - offsets.length; - var originalIndex = 0, unchangedIndex = 0; - for (var ii = 0, nn = offsets.length; ii < nn; ii++) { - var offsetMap = offsets[ii]; - var slotIndex = skeletonData.findSlotIndex(offsetMap["slot"]); - if (slotIndex == -1) throw "Slot not found: " + offsetMap["slot"]; - // Collect unchanged items. - while (originalIndex != slotIndex) - unchanged[unchangedIndex++] = originalIndex++; - // Set changed items. - drawOrder[originalIndex + offsetMap["offset"]] = originalIndex++; - } - // Collect remaining unchanged items. - while (originalIndex < slotCount) - unchanged[unchangedIndex++] = originalIndex++; - // Fill in unchanged items. - for (var ii = slotCount - 1; ii >= 0; ii--) - if (drawOrder[ii] == -1) drawOrder[ii] = unchanged[--unchangedIndex]; - } - timeline.setFrame(frameIndex++, drawOrderMap["time"], drawOrder); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - - var events = map["events"]; - if (events) { - var timeline = new spine.EventTimeline(events.length); - var frameIndex = 0; - for (var i = 0, n = events.length; i < n; i++) { - var eventMap = events[i]; - var eventData = skeletonData.findEvent(eventMap["name"]); - if (!eventData) throw "Event not found: " + eventMap["name"]; - var event = new spine.Event(eventData); - event.intValue = eventMap.hasOwnProperty("int") ? eventMap["int"] : eventData.intValue; - event.floatValue = eventMap.hasOwnProperty("float") ? eventMap["float"] : eventData.floatValue; - event.stringValue = eventMap.hasOwnProperty("string") ? eventMap["string"] : eventData.stringValue; - timeline.setFrame(frameIndex++, eventMap["time"], event); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - - skeletonData.animations.push(new spine.Animation(name, timelines, duration)); - }, - readCurve: function (timeline, frameIndex, valueMap) { - var curve = valueMap["curve"]; - if (!curve) - timeline.curves.setLinear(frameIndex); - else if (curve == "stepped") - timeline.curves.setStepped(frameIndex); - else if (curve instanceof Array) - timeline.curves.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]); - }, - toColor: function (hexString, colorIndex) { - if (hexString.length != 8) throw "Color hexidecimal length must be 8, recieved: " + hexString; - return parseInt(hexString.substring(colorIndex * 2, (colorIndex * 2) + 2), 16) / 255; - }, - getFloatArray: function (map, name, scale) { - var list = map[name]; - var values = new spine.Float32Array(list.length); - var i = 0, n = list.length; - if (scale == 1) { - for (; i < n; i++) - values[i] = list[i]; - } else { - for (; i < n; i++) - values[i] = list[i] * scale; - } - return values; - }, - getIntArray: function (map, name) { - var list = map[name]; - var values = new spine.Uint16Array(list.length); - for (var i = 0, n = list.length; i < n; i++) - values[i] = list[i] | 0; - return values; - } -}; - -spine.Atlas = function (atlasText, textureLoader) { - this.textureLoader = textureLoader; - this.pages = []; - this.regions = []; - - var reader = new spine.AtlasReader(atlasText); - var tuple = []; - tuple.length = 4; - var page = null; - while (true) { - var line = reader.readLine(); - if (line === null) break; - line = reader.trim(line); - if (!line.length) - page = null; - else if (!page) { - page = new spine.AtlasPage(); - page.name = line; - - if (reader.readTuple(tuple) == 2) { // size is only optional for an atlas packed with an old TexturePacker. - page.width = parseInt(tuple[0]); - page.height = parseInt(tuple[1]); - reader.readTuple(tuple); - } - page.format = spine.Atlas.Format[tuple[0]]; - - reader.readTuple(tuple); - page.minFilter = spine.Atlas.TextureFilter[tuple[0]]; - page.magFilter = spine.Atlas.TextureFilter[tuple[1]]; - - var direction = reader.readValue(); - page.uWrap = spine.Atlas.TextureWrap.clampToEdge; - page.vWrap = spine.Atlas.TextureWrap.clampToEdge; - if (direction == "x") - page.uWrap = spine.Atlas.TextureWrap.repeat; - else if (direction == "y") - page.vWrap = spine.Atlas.TextureWrap.repeat; - else if (direction == "xy") - page.uWrap = page.vWrap = spine.Atlas.TextureWrap.repeat; - - textureLoader.load(page, line, this); - - this.pages.push(page); - - } else { - var region = new spine.AtlasRegion(); - region.name = line; - region.page = page; - - region.rotate = reader.readValue() == "true"; - - reader.readTuple(tuple); - var x = parseInt(tuple[0]); - var y = parseInt(tuple[1]); - - reader.readTuple(tuple); - var width = parseInt(tuple[0]); - var height = parseInt(tuple[1]); - - region.u = x / page.width; - region.v = y / page.height; - if (region.rotate) { - region.u2 = (x + height) / page.width; - region.v2 = (y + width) / page.height; - } else { - region.u2 = (x + width) / page.width; - region.v2 = (y + height) / page.height; - } - region.x = x; - region.y = y; - region.width = Math.abs(width); - region.height = Math.abs(height); - - if (reader.readTuple(tuple) == 4) { // split is optional - region.splits = [parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3])]; - - if (reader.readTuple(tuple) == 4) { // pad is optional, but only present with splits - region.pads = [parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3])]; - - reader.readTuple(tuple); - } - } - - region.originalWidth = parseInt(tuple[0]); - region.originalHeight = parseInt(tuple[1]); - - reader.readTuple(tuple); - region.offsetX = parseInt(tuple[0]); - region.offsetY = parseInt(tuple[1]); - - region.index = parseInt(reader.readValue()); - - this.regions.push(region); - } - } -}; -spine.Atlas.prototype = { - findRegion: function (name) { - var regions = this.regions; - for (var i = 0, n = regions.length; i < n; i++) - if (regions[i].name == name) return regions[i]; - return null; - }, - dispose: function () { - var pages = this.pages; - for (var i = 0, n = pages.length; i < n; i++) - this.textureLoader.unload(pages[i].rendererObject); - }, - updateUVs: function (page) { - var regions = this.regions; - for (var i = 0, n = regions.length; i < n; i++) { - var region = regions[i]; - if (region.page != page) continue; - region.u = region.x / page.width; - region.v = region.y / page.height; - if (region.rotate) { - region.u2 = (region.x + region.height) / page.width; - region.v2 = (region.y + region.width) / page.height; - } else { - region.u2 = (region.x + region.width) / page.width; - region.v2 = (region.y + region.height) / page.height; - } - } - } -}; - -spine.Atlas.Format = { - alpha: 0, - intensity: 1, - luminanceAlpha: 2, - rgb565: 3, - rgba4444: 4, - rgb888: 5, - rgba8888: 6 -}; - -spine.Atlas.TextureFilter = { - nearest: 0, - linear: 1, - mipMap: 2, - mipMapNearestNearest: 3, - mipMapLinearNearest: 4, - mipMapNearestLinear: 5, - mipMapLinearLinear: 6 -}; - -spine.Atlas.TextureWrap = { - mirroredRepeat: 0, - clampToEdge: 1, - repeat: 2 -}; - -spine.AtlasPage = function () {}; -spine.AtlasPage.prototype = { - name: null, - format: null, - minFilter: null, - magFilter: null, - uWrap: null, - vWrap: null, - rendererObject: null, - width: 0, - height: 0 -}; - -spine.AtlasRegion = function () {}; -spine.AtlasRegion.prototype = { - page: null, - name: null, - x: 0, y: 0, - width: 0, height: 0, - u: 0, v: 0, u2: 0, v2: 0, - offsetX: 0, offsetY: 0, - originalWidth: 0, originalHeight: 0, - index: 0, - rotate: false, - splits: null, - pads: null -}; - -spine.AtlasReader = function (text) { - this.lines = text.split(/\r\n|\r|\n/); -}; -spine.AtlasReader.prototype = { - index: 0, - trim: function (value) { - return value.replace(/^\s+|\s+$/g, ""); - }, - readLine: function () { - if (this.index >= this.lines.length) return null; - return this.lines[this.index++]; - }, - readValue: function () { - var line = this.readLine(); - var colon = line.indexOf(":"); - if (colon == -1) throw "Invalid line: " + line; - return this.trim(line.substring(colon + 1)); - }, - /** Returns the number of tuple values read (1, 2 or 4). */ - readTuple: function (tuple) { - var line = this.readLine(); - var colon = line.indexOf(":"); - if (colon == -1) throw "Invalid line: " + line; - var i = 0, lastMatch = colon + 1; - for (; i < 3; i++) { - var comma = line.indexOf(",", lastMatch); - if (comma == -1) break; - tuple[i] = this.trim(line.substr(lastMatch, comma - lastMatch)); - lastMatch = comma + 1; - } - tuple[i] = this.trim(line.substring(lastMatch)); - return i + 1; - } -}; - -spine.AtlasAttachmentLoader = function (atlas) { - this.atlas = atlas; -}; -spine.AtlasAttachmentLoader.prototype = { - newRegionAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (region attachment: " + name + ")"; - var attachment = new spine.RegionAttachment(name); - attachment.rendererObject = region; - attachment.setUVs(region.u, region.v, region.u2, region.v2, region.rotate); - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newMeshAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (mesh attachment: " + name + ")"; - var attachment = new spine.MeshAttachment(name); - attachment.rendererObject = region; - attachment.regionU = region.u; - attachment.regionV = region.v; - attachment.regionU2 = region.u2; - attachment.regionV2 = region.v2; - attachment.regionRotate = region.rotate; - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newSkinnedMeshAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (skinned mesh attachment: " + name + ")"; - var attachment = new spine.SkinnedMeshAttachment(name); - attachment.rendererObject = region; - attachment.regionU = region.u; - attachment.regionV = region.v; - attachment.regionU2 = region.u2; - attachment.regionV2 = region.v2; - attachment.regionRotate = region.rotate; - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newBoundingBoxAttachment: function (skin, name) { - return new spine.BoundingBoxAttachment(name); - } -}; - -spine.SkeletonBounds = function () { - this.polygonPool = []; - this.polygons = []; - this.boundingBoxes = []; -}; -spine.SkeletonBounds.prototype = { - minX: 0, minY: 0, maxX: 0, maxY: 0, - update: function (skeleton, updateAabb) { - var slots = skeleton.slots; - var slotCount = slots.length; - var x = skeleton.x, y = skeleton.y; - var boundingBoxes = this.boundingBoxes; - var polygonPool = this.polygonPool; - var polygons = this.polygons; - - boundingBoxes.length = 0; - for (var i = 0, n = polygons.length; i < n; i++) - polygonPool.push(polygons[i]); - polygons.length = 0; - - for (var i = 0; i < slotCount; i++) { - var slot = slots[i]; - var boundingBox = slot.attachment; - if (boundingBox.type != spine.AttachmentType.boundingbox) continue; - boundingBoxes.push(boundingBox); - - var poolCount = polygonPool.length, polygon; - if (poolCount > 0) { - polygon = polygonPool[poolCount - 1]; - polygonPool.splice(poolCount - 1, 1); - } else - polygon = []; - polygons.push(polygon); - - polygon.length = boundingBox.vertices.length; - boundingBox.computeWorldVertices(x, y, slot.bone, polygon); - } - - if (updateAabb) this.aabbCompute(); - }, - aabbCompute: function () { - var polygons = this.polygons; - var minX = Number.MAX_VALUE, minY = Number.MAX_VALUE, maxX = Number.MIN_VALUE, maxY = Number.MIN_VALUE; - for (var i = 0, n = polygons.length; i < n; i++) { - var vertices = polygons[i]; - for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) { - var x = vertices[ii]; - var y = vertices[ii + 1]; - minX = Math.min(minX, x); - minY = Math.min(minY, y); - maxX = Math.max(maxX, x); - maxY = Math.max(maxY, y); - } - } - this.minX = minX; - this.minY = minY; - this.maxX = maxX; - this.maxY = maxY; - }, - /** Returns true if the axis aligned bounding box contains the point. */ - aabbContainsPoint: function (x, y) { - return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY; - }, - /** Returns true if the axis aligned bounding box intersects the line segment. */ - aabbIntersectsSegment: function (x1, y1, x2, y2) { - var minX = this.minX, minY = this.minY, maxX = this.maxX, maxY = this.maxY; - if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY)) - return false; - var m = (y2 - y1) / (x2 - x1); - var y = m * (minX - x1) + y1; - if (y > minY && y < maxY) return true; - y = m * (maxX - x1) + y1; - if (y > minY && y < maxY) return true; - var x = (minY - y1) / m + x1; - if (x > minX && x < maxX) return true; - x = (maxY - y1) / m + x1; - if (x > minX && x < maxX) return true; - return false; - }, - /** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */ - aabbIntersectsSkeleton: function (bounds) { - return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY; - }, - /** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more - * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */ - containsPoint: function (x, y) { - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) - if (this.polygonContainsPoint(polygons[i], x, y)) return this.boundingBoxes[i]; - return null; - }, - /** Returns the first bounding box attachment that contains the line segment, or null. When doing many checks, it is usually - * more efficient to only call this method if {@link #aabbIntersectsSegment(float, float, float, float)} returns true. */ - intersectsSegment: function (x1, y1, x2, y2) { - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) - if (polygons[i].intersectsSegment(x1, y1, x2, y2)) return this.boundingBoxes[i]; - return null; - }, - /** Returns true if the polygon contains the point. */ - polygonContainsPoint: function (polygon, x, y) { - var nn = polygon.length; - var prevIndex = nn - 2; - var inside = false; - for (var ii = 0; ii < nn; ii += 2) { - var vertexY = polygon[ii + 1]; - var prevY = polygon[prevIndex + 1]; - if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) { - var vertexX = polygon[ii]; - if (vertexX + (y - vertexY) / (prevY - vertexY) * (polygon[prevIndex] - vertexX) < x) inside = !inside; - } - prevIndex = ii; - } - return inside; - }, - /** Returns true if the polygon contains the line segment. */ - polygonIntersectsSegment: function (polygon, x1, y1, x2, y2) { - var nn = polygon.length; - var width12 = x1 - x2, height12 = y1 - y2; - var det1 = x1 * y2 - y1 * x2; - var x3 = polygon[nn - 2], y3 = polygon[nn - 1]; - for (var ii = 0; ii < nn; ii += 2) { - var x4 = polygon[ii], y4 = polygon[ii + 1]; - var det2 = x3 * y4 - y3 * x4; - var width34 = x3 - x4, height34 = y3 - y4; - var det3 = width12 * height34 - height12 * width34; - var x = (det1 * width34 - width12 * det2) / det3; - if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) { - var y = (det1 * height34 - height12 * det2) / det3; - if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) return true; - } - x3 = x4; - y3 = y4; - } - return false; - }, - getPolygon: function (attachment) { - var index = this.boundingBoxes.indexOf(attachment); - return index == -1 ? null : this.polygons[index]; - }, - getWidth: function () { - return this.maxX - this.minX; - }, - getHeight: function () { - return this.maxY - this.minY; - } -}; - -/* Esoteric Software SPINE wrapper for pixi.js */ - -spine.Bone.yDown = true; -PIXI.AnimCache = {}; - -/** - * Supporting class to load images from spine atlases as per spine spec. - * - * @class SpineTextureLoader - * @uses EventTarget - * @constructor - * @param basePath {String} Tha base path where to look for the images to be loaded - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.SpineTextureLoader = function(basePath, crossorigin) -{ - PIXI.EventTarget.call(this); - - this.basePath = basePath; - this.crossorigin = crossorigin; - this.loadingCount = 0; -}; - -/* constructor */ -PIXI.SpineTextureLoader.prototype = PIXI.SpineTextureLoader; - -/** - * Starts loading a base texture as per spine specification - * - * @method load - * @param page {spine.AtlasPage} Atlas page to which texture belongs - * @param file {String} The file to load, this is just the file path relative to the base path configured in the constructor - */ -PIXI.SpineTextureLoader.prototype.load = function(page, file) -{ - page.rendererObject = PIXI.BaseTexture.fromImage(this.basePath + '/' + file, this.crossorigin); - if (!page.rendererObject.hasLoaded) - { - var scope = this; - ++scope.loadingCount; - page.rendererObject.addEventListener('loaded', function(){ - --scope.loadingCount; - scope.dispatchEvent({ - type: 'loadedBaseTexture', - content: scope - }); - }); - } -}; - -/** - * Unloads a previously loaded texture as per spine specification - * - * @method unload - * @param texture {BaseTexture} Texture object to destroy - */ -PIXI.SpineTextureLoader.prototype.unload = function(texture) -{ - texture.destroy(true); -}; - -/** - * A class that enables the you to import and run your spine animations in pixi. - * Spine animation data needs to be loaded using the PIXI.AssetLoader or PIXI.SpineLoader before it can be used by this class - * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source - * - * @class Spine - * @extends DisplayObjectContainer - * @constructor - * @param url {String} The url of the spine anim file to be used - */ -PIXI.Spine = function (url) { - PIXI.DisplayObjectContainer.call(this); - - this.spineData = PIXI.AnimCache[url]; - - if (!this.spineData) { - throw new Error('Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: ' + url); - } - - this.skeleton = new spine.Skeleton(this.spineData); - this.skeleton.updateWorldTransform(); - - this.stateData = new spine.AnimationStateData(this.spineData); - this.state = new spine.AnimationState(this.stateData); - - this.slotContainers = []; - - for (var i = 0, n = this.skeleton.drawOrder.length; i < n; i++) { - var slot = this.skeleton.drawOrder[i]; - var attachment = slot.attachment; - var slotContainer = new PIXI.DisplayObjectContainer(); - this.slotContainers.push(slotContainer); - this.addChild(slotContainer); - - if (attachment instanceof spine.RegionAttachment) - { - var spriteName = attachment.rendererObject.name; - var sprite = this.createSprite(slot, attachment); - slot.currentSprite = sprite; - slot.currentSpriteName = spriteName; - slotContainer.addChild(sprite); - } - else if (attachment instanceof spine.MeshAttachment) - { - var mesh = this.createMesh(slot, attachment); - slot.currentMesh = mesh; - slot.currentMeshName = attachment.name; - slotContainer.addChild(mesh); - } - else - { - continue; - } - - } - - this.autoUpdate = true; -}; - -PIXI.Spine.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); -PIXI.Spine.prototype.constructor = PIXI.Spine; - -/** - * If this flag is set to true, the spine animation will be autoupdated every time - * the object id drawn. The down side of this approach is that the delta time is - * automatically calculated and you could miss out on cool effects like slow motion, - * pause, skip ahead and the sorts. Most of these effects can be achieved even with - * autoupdate enabled but are harder to achieve. - * - * @property autoUpdate - * @type { Boolean } - * @default true - */ -Object.defineProperty(PIXI.Spine.prototype, 'autoUpdate', { - get: function() - { - return (this.updateTransform === PIXI.Spine.prototype.autoUpdateTransform); - }, - - set: function(value) - { - this.updateTransform = value ? PIXI.Spine.prototype.autoUpdateTransform : PIXI.DisplayObjectContainer.prototype.updateTransform; - } -}); - -/** - * Update the spine skeleton and its animations by delta time (dt) - * - * @method update - * @param dt {Number} Delta time. Time by which the animation should be updated - */ -PIXI.Spine.prototype.update = function(dt) -{ - this.state.update(dt); - this.state.apply(this.skeleton); - this.skeleton.updateWorldTransform(); - - var drawOrder = this.skeleton.drawOrder; - for (var i = 0, n = drawOrder.length; i < n; i++) { - var slot = drawOrder[i]; - var attachment = slot.attachment; - var slotContainer = this.slotContainers[i]; - - if (!attachment) - { - slotContainer.visible = false; - continue; - } - - var type = attachment.type; - if (type === spine.AttachmentType.region) - { - if (attachment.rendererObject) - { - if (!slot.currentSpriteName || slot.currentSpriteName !== attachment.name) - { - var spriteName = attachment.rendererObject.name; - if (slot.currentSprite !== undefined) - { - slot.currentSprite.visible = false; - } - slot.sprites = slot.sprites || {}; - if (slot.sprites[spriteName] !== undefined) - { - slot.sprites[spriteName].visible = true; - } - else - { - var sprite = this.createSprite(slot, attachment); - slotContainer.addChild(sprite); - } - slot.currentSprite = slot.sprites[spriteName]; - slot.currentSpriteName = spriteName; - } - } - - var bone = slot.bone; - - slotContainer.position.x = bone.worldX + attachment.x * bone.m00 + attachment.y * bone.m01; - slotContainer.position.y = bone.worldY + attachment.x * bone.m10 + attachment.y * bone.m11; - slotContainer.scale.x = bone.worldScaleX; - slotContainer.scale.y = bone.worldScaleY; - - slotContainer.rotation = -(slot.bone.worldRotation * spine.degRad); - - slot.currentSprite.tint = PIXI.rgb2hex([slot.r,slot.g,slot.b]); - } - else if (type === spine.AttachmentType.skinnedmesh) - { - if (!slot.currentMeshName || slot.currentMeshName !== attachment.name) - { - var meshName = attachment.name; - if (slot.currentMesh !== undefined) - { - slot.currentMesh.visible = false; - } - - slot.meshes = slot.meshes || {}; - - if (slot.meshes[meshName] !== undefined) - { - slot.meshes[meshName].visible = true; - } - else - { - var mesh = this.createMesh(slot, attachment); - slotContainer.addChild(mesh); - } - - slot.currentMesh = slot.meshes[meshName]; - slot.currentMeshName = meshName; - } - - attachment.computeWorldVertices(slot.bone.skeleton.x, slot.bone.skeleton.y, slot, slot.currentMesh.vertices); - - } - else - { - slotContainer.visible = false; - continue; - } - slotContainer.visible = true; - - slotContainer.alpha = slot.a; - } -}; - -/** - * When autoupdate is set to yes this function is used as pixi's updateTransform function - * - * @method autoUpdateTransform - * @private - */ -PIXI.Spine.prototype.autoUpdateTransform = function () { - this.lastTime = this.lastTime || Date.now(); - var timeDelta = (Date.now() - this.lastTime) * 0.001; - this.lastTime = Date.now(); - - this.update(timeDelta); - - PIXI.DisplayObjectContainer.prototype.updateTransform.call(this); -}; - -/** - * Create a new sprite to be used with spine.RegionAttachment - * - * @method createSprite - * @param slot {spine.Slot} The slot to which the attachment is parented - * @param attachment {spine.RegionAttachment} The attachment that the sprite will represent - * @private - */ -PIXI.Spine.prototype.createSprite = function (slot, attachment) { - var descriptor = attachment.rendererObject; - var baseTexture = descriptor.page.rendererObject; - var spriteRect = new PIXI.Rectangle(descriptor.x, - descriptor.y, - descriptor.rotate ? descriptor.height : descriptor.width, - descriptor.rotate ? descriptor.width : descriptor.height); - var spriteTexture = new PIXI.Texture(baseTexture, spriteRect); - var sprite = new PIXI.Sprite(spriteTexture); - - var baseRotation = descriptor.rotate ? Math.PI * 0.5 : 0.0; - sprite.scale.set(descriptor.width / descriptor.originalWidth, descriptor.height / descriptor.originalHeight); - sprite.rotation = baseRotation - (attachment.rotation * spine.degRad); - sprite.anchor.x = sprite.anchor.y = 0.5; - - slot.sprites = slot.sprites || {}; - slot.sprites[descriptor.name] = sprite; - return sprite; -}; - -PIXI.Spine.prototype.createMesh = function (slot, attachment) { - var descriptor = attachment.rendererObject; - var baseTexture = descriptor.page.rendererObject; - var texture = new PIXI.Texture(baseTexture); - - var strip = new PIXI.Strip(texture); - strip.drawMode = PIXI.Strip.DrawModes.TRIANGLES; - strip.canvasPadding = 1.5; - - strip.vertices = new PIXI.Float32Array(attachment.uvs.length); - strip.uvs = attachment.uvs; - strip.indices = attachment.triangles; - - slot.meshes = slot.meshes || {}; - slot.meshes[attachment.name] = strip; - - return strip; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -PIXI.BaseTextureCache = {}; - -PIXI.BaseTextureCacheIdGenerator = 0; - -/** - * A texture stores the information that represents an image. All textures have a base texture. - * - * @class BaseTexture - * @uses EventTarget - * @constructor - * @param source {String} the source object (image or canvas) - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - */ -PIXI.BaseTexture = function(source, scaleMode) -{ - /** - * The Resolution of the texture. - * - * @property resolution - * @type Number - */ - this.resolution = 1; - - /** - * [read-only] The width of the base texture set when the image has loaded - * - * @property width - * @type Number - * @readOnly - */ - this.width = 100; - - /** - * [read-only] The height of the base texture set when the image has loaded - * - * @property height - * @type Number - * @readOnly - */ - this.height = 100; - - /** - * The scale mode to apply when scaling this texture - * - * @property scaleMode - * @type {Number} - * @default PIXI.scaleModes.LINEAR - */ - this.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - /** - * [read-only] Set to true once the base texture has loaded - * - * @property hasLoaded - * @type Boolean - * @readOnly - */ - this.hasLoaded = false; - - /** - * The image source that is used to create the texture. - * - * @property source - * @type Image - */ - this.source = source; - - this._UID = PIXI._UID++; - - /** - * Controls if RGB channels should be pre-multiplied by Alpha (WebGL only) - * - * @property premultipliedAlpha - * @type Boolean - * @default true - */ - this.premultipliedAlpha = true; - - // used for webGL - - /** - * @property _glTextures - * @type Array - * @private - */ - this._glTextures = []; - - /** - * - * Set this to true if a mipmap of this texture needs to be generated. This value needs to be set before the texture is used - * Also the texture must be a power of two size to work - * - * @property mipmap - * @type {Boolean} - */ - this.mipmap = false; - - // used for webGL texture updating... - // TODO - this needs to be addressed - - /** - * @property _dirty - * @type Array - * @private - */ - this._dirty = [true, true, true, true]; - - if(!source)return; - - if((this.source.complete || this.source.getContext) && this.source.width && this.source.height) - { - this.hasLoaded = true; - this.width = this.source.naturalWidth || this.source.width; - this.height = this.source.naturalHeight || this.source.height; - this.dirty(); - } - else - { - var scope = this; - - this.source.onload = function() { - - scope.hasLoaded = true; - scope.width = scope.source.naturalWidth || scope.source.width; - scope.height = scope.source.naturalHeight || scope.source.height; - - scope.dirty(); - - // add it to somewhere... - scope.dispatchEvent( { type: 'loaded', content: scope } ); - }; - - this.source.onerror = function() { - scope.dispatchEvent( { type: 'error', content: scope } ); - }; - } - - /** - * @property imageUrl - * @type String - */ - this.imageUrl = null; - - /** - * @property _powerOf2 - * @type Boolean - * @private - */ - this._powerOf2 = false; - -}; - -PIXI.BaseTexture.prototype.constructor = PIXI.BaseTexture; - -PIXI.EventTarget.mixin(PIXI.BaseTexture.prototype); - -/** - * Destroys this base texture - * - * @method destroy - */ -PIXI.BaseTexture.prototype.destroy = function() -{ - if(this.imageUrl) - { - delete PIXI.BaseTextureCache[this.imageUrl]; - delete PIXI.TextureCache[this.imageUrl]; - this.imageUrl = null; - if (!navigator.isCocoonJS) this.source.src = ''; - } - else if (this.source && this.source._pixiId) - { - delete PIXI.BaseTextureCache[this.source._pixiId]; - } - this.source = null; - - this.unloadFromGPU(); -}; - -/** - * Changes the source image of the texture - * - * @method updateSourceImage - * @param newSrc {String} the path of the image - */ -PIXI.BaseTexture.prototype.updateSourceImage = function(newSrc) -{ - this.hasLoaded = false; - this.source.src = null; - this.source.src = newSrc; -}; - -/** - * Sets all glTextures to be dirty. - * - * @method dirty - */ -PIXI.BaseTexture.prototype.dirty = function() -{ - for (var i = 0; i < this._glTextures.length; i++) - { - this._dirty[i] = true; - } -}; - -/** - * Removes the base texture from the GPU, useful for managing resources on the GPU. - * Atexture is still 100% usable and will simply be reuploaded if there is a sprite on screen that is using it. - * - * @method unloadFromGPU - */ -PIXI.BaseTexture.prototype.unloadFromGPU = function() -{ - this.dirty(); - - // delete the webGL textures if any. - for (var i = this._glTextures.length - 1; i >= 0; i--) - { - var glTexture = this._glTextures[i]; - var gl = PIXI.glContexts[i]; - - if(gl && glTexture) - { - gl.deleteTexture(glTexture); - } - - } - - this._glTextures.length = 0; - - this.dirty(); -}; - -/** - * Helper function that creates a base texture from the given image url. - * If the image is not in the base texture cache it will be created and loaded. - * - * @static - * @method fromImage - * @param imageUrl {String} The image url of the texture - * @param crossorigin {Boolean} - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return BaseTexture - */ -PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode) -{ - var baseTexture = PIXI.BaseTextureCache[imageUrl]; - - if(crossorigin === undefined && imageUrl.indexOf('data:') === -1) crossorigin = true; - - if(!baseTexture) - { - // new Image() breaks tex loading in some versions of Chrome. - // See https://code.google.com/p/chromium/issues/detail?id=238071 - var image = new Image();//document.createElement('img'); - if (crossorigin) - { - image.crossOrigin = ''; - } - - image.src = imageUrl; - baseTexture = new PIXI.BaseTexture(image, scaleMode); - baseTexture.imageUrl = imageUrl; - PIXI.BaseTextureCache[imageUrl] = baseTexture; - - // if there is an @2x at the end of the url we are going to assume its a highres image - if( imageUrl.indexOf(PIXI.RETINA_PREFIX + '.') !== -1) - { - baseTexture.resolution = 2; - } - } - - return baseTexture; -}; - -/** - * Helper function that creates a base texture from the given canvas element. - * - * @static - * @method fromCanvas - * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return BaseTexture - */ -PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode) -{ - if(!canvas._pixiId) - { - canvas._pixiId = 'canvas_' + PIXI.TextureCacheIdGenerator++; - } - - var baseTexture = PIXI.BaseTextureCache[canvas._pixiId]; - - if(!baseTexture) - { - baseTexture = new PIXI.BaseTexture(canvas, scaleMode); - PIXI.BaseTextureCache[canvas._pixiId] = baseTexture; - } - - return baseTexture; -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -PIXI.TextureCache = {}; -PIXI.FrameCache = {}; - -PIXI.TextureCacheIdGenerator = 0; - -/** - * A texture stores the information that represents an image or part of an image. It cannot be added - * to the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used. - * - * @class Texture - * @uses EventTarget - * @constructor - * @param baseTexture {BaseTexture} The base texture source to create the texture from - * @param [frame] {Rectangle} The rectangle frame of the texture to show - * @param [crop] {Rectangle} The area of original texture - * @param [trim] {Rectangle} Trimmed texture rectangle - */ -PIXI.Texture = function(baseTexture, frame, crop, trim) -{ - /** - * Does this Texture have any frame data assigned to it? - * - * @property noFrame - * @type Boolean - */ - this.noFrame = false; - - if (!frame) - { - this.noFrame = true; - frame = new PIXI.Rectangle(0,0,1,1); - } - - if (baseTexture instanceof PIXI.Texture) - { - baseTexture = baseTexture.baseTexture; - } - - /** - * The base texture that this texture uses. - * - * @property baseTexture - * @type BaseTexture - */ - this.baseTexture = baseTexture; - - /** - * The frame specifies the region of the base texture that this texture uses - * - * @property frame - * @type Rectangle - */ - this.frame = frame; - - /** - * The texture trim data. - * - * @property trim - * @type Rectangle - */ - this.trim = trim; - - /** - * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. - * - * @property valid - * @type Boolean - */ - this.valid = false; - - /** - * This will let a renderer know that a texture has been updated (used mainly for webGL uv updates) - * - * @property requiresUpdate - * @type Boolean - */ - this.requiresUpdate = false; - - /** - * The WebGL UV data cache. - * - * @property _uvs - * @type Object - * @private - */ - this._uvs = null; - - /** - * The width of the Texture in pixels. - * - * @property width - * @type Number - */ - this.width = 0; - - /** - * The height of the Texture in pixels. - * - * @property height - * @type Number - */ - this.height = 0; - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @property crop - * @type Rectangle - */ - this.crop = crop || new PIXI.Rectangle(0, 0, 1, 1); - - if (baseTexture.hasLoaded) - { - if (this.noFrame) frame = new PIXI.Rectangle(0, 0, baseTexture.width, baseTexture.height); - this.setFrame(frame); - } - else - { - baseTexture.addEventListener('loaded', this.onBaseTextureLoaded.bind(this)); - } -}; - -PIXI.Texture.prototype.constructor = PIXI.Texture; -PIXI.EventTarget.mixin(PIXI.Texture.prototype); - -/** - * Called when the base texture is loaded - * - * @method onBaseTextureLoaded - * @private - */ -PIXI.Texture.prototype.onBaseTextureLoaded = function() -{ - var baseTexture = this.baseTexture; - baseTexture.removeEventListener('loaded', this.onLoaded); - - if (this.noFrame) this.frame = new PIXI.Rectangle(0, 0, baseTexture.width, baseTexture.height); - - this.setFrame(this.frame); - - this.dispatchEvent( { type: 'update', content: this } ); -}; - -/** - * Destroys this texture - * - * @method destroy - * @param destroyBase {Boolean} Whether to destroy the base texture as well - */ -PIXI.Texture.prototype.destroy = function(destroyBase) -{ - if (destroyBase) this.baseTexture.destroy(); - - this.valid = false; -}; - -/** - * Specifies the region of the baseTexture that this texture will use. - * - * @method setFrame - * @param frame {Rectangle} The frame of the texture to set it to - */ -PIXI.Texture.prototype.setFrame = function(frame) -{ - this.noFrame = false; - - this.frame = frame; - this.width = frame.width; - this.height = frame.height; - - this.crop.x = frame.x; - this.crop.y = frame.y; - this.crop.width = frame.width; - this.crop.height = frame.height; - - if (!this.trim && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) - { - throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); - } - - this.valid = frame && frame.width && frame.height && this.baseTexture.source && this.baseTexture.hasLoaded; - - if (this.trim) - { - this.width = this.trim.width; - this.height = this.trim.height; - this.frame.width = this.trim.width; - this.frame.height = this.trim.height; - } - - if (this.valid) this._updateUvs(); - -}; - -/** - * Updates the internal WebGL UV cache. - * - * @method _updateUvs - * @private - */ -PIXI.Texture.prototype._updateUvs = function() -{ - if(!this._uvs)this._uvs = new PIXI.TextureUvs(); - - var frame = this.crop; - var tw = this.baseTexture.width; - var th = this.baseTexture.height; - - this._uvs.x0 = frame.x / tw; - this._uvs.y0 = frame.y / th; - - this._uvs.x1 = (frame.x + frame.width) / tw; - this._uvs.y1 = frame.y / th; - - this._uvs.x2 = (frame.x + frame.width) / tw; - this._uvs.y2 = (frame.y + frame.height) / th; - - this._uvs.x3 = frame.x / tw; - this._uvs.y3 = (frame.y + frame.height) / th; -}; - -/** - * Helper function that creates a Texture object from the given image url. - * If the image is not in the texture cache it will be created and loaded. - * - * @static - * @method fromImage - * @param imageUrl {String} The image url of the texture - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return Texture - */ -PIXI.Texture.fromImage = function(imageUrl, crossorigin, scaleMode) -{ - var texture = PIXI.TextureCache[imageUrl]; - - if(!texture) - { - texture = new PIXI.Texture(PIXI.BaseTexture.fromImage(imageUrl, crossorigin, scaleMode)); - PIXI.TextureCache[imageUrl] = texture; - } - - return texture; -}; - -/** - * Helper function that returns a Texture objected based on the given frame id. - * If the frame id is not in the texture cache an error will be thrown. - * - * @static - * @method fromFrame - * @param frameId {String} The frame id of the texture - * @return Texture - */ -PIXI.Texture.fromFrame = function(frameId) -{ - var texture = PIXI.TextureCache[frameId]; - if(!texture) throw new Error('The frameId "' + frameId + '" does not exist in the texture cache '); - return texture; -}; - -/** - * Helper function that creates a new a Texture based on the given canvas element. - * - * @static - * @method fromCanvas - * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return Texture - */ -PIXI.Texture.fromCanvas = function(canvas, scaleMode) -{ - var baseTexture = PIXI.BaseTexture.fromCanvas(canvas, scaleMode); - - return new PIXI.Texture( baseTexture ); - -}; - -/** - * Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object. - * - * @static - * @method addTextureToCache - * @param texture {Texture} The Texture to add to the cache. - * @param id {String} The id that the texture will be stored against. - */ -PIXI.Texture.addTextureToCache = function(texture, id) -{ - PIXI.TextureCache[id] = texture; -}; - -/** - * Remove a texture from the global PIXI.TextureCache. - * - * @static - * @method removeTextureFromCache - * @param id {String} The id of the texture to be removed - * @return {Texture} The texture that was removed - */ -PIXI.Texture.removeTextureFromCache = function(id) -{ - var texture = PIXI.TextureCache[id]; - delete PIXI.TextureCache[id]; - delete PIXI.BaseTextureCache[id]; - return texture; -}; - -PIXI.TextureUvs = function() -{ - this.x0 = 0; - this.y0 = 0; - - this.x1 = 0; - this.y1 = 0; - - this.x2 = 0; - this.y2 = 0; - - this.x3 = 0; - this.y3 = 0; -}; - -PIXI.Texture.emptyTexture = new PIXI.Texture(new PIXI.BaseTexture()); - - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A RenderTexture is a special texture that allows any Pixi display object to be rendered to it. - * - * __Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead. - * - * A RenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example: - * - * var renderTexture = new PIXI.RenderTexture(800, 600); - * var sprite = PIXI.Sprite.fromImage("spinObj_01.png"); - * sprite.position.x = 800/2; - * sprite.position.y = 600/2; - * sprite.anchor.x = 0.5; - * sprite.anchor.y = 0.5; - * renderTexture.render(sprite); - * - * The Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual position a DisplayObjectContainer should be used: - * - * var doc = new PIXI.DisplayObjectContainer(); - * doc.addChild(sprite); - * renderTexture.render(doc); // Renders to center of renderTexture - * - * @class RenderTexture - * @extends Texture - * @constructor - * @param width {Number} The width of the render texture - * @param height {Number} The height of the render texture - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @param resolution {Number} The resolution of the texture being generated - */ -PIXI.RenderTexture = function(width, height, renderer, scaleMode, resolution) -{ - /** - * The with of the render texture - * - * @property width - * @type Number - */ - this.width = width || 100; - - /** - * The height of the render texture - * - * @property height - * @type Number - */ - this.height = height || 100; - - /** - * The Resolution of the texture. - * - * @property resolution - * @type Number - */ - this.resolution = resolution || 1; - - /** - * The framing rectangle of the render texture - * - * @property frame - * @type Rectangle - */ - this.frame = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @property crop - * @type Rectangle - */ - this.crop = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * The base texture object that this texture uses - * - * @property baseTexture - * @type BaseTexture - */ - this.baseTexture = new PIXI.BaseTexture(); - this.baseTexture.width = this.width * this.resolution; - this.baseTexture.height = this.height * this.resolution; - this.baseTexture._glTextures = []; - this.baseTexture.resolution = this.resolution; - - this.baseTexture.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - this.baseTexture.hasLoaded = true; - - PIXI.Texture.call(this, - this.baseTexture, - new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution) - ); - - /** - * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. - * - * @property renderer - * @type CanvasRenderer|WebGLRenderer - */ - this.renderer = renderer || PIXI.defaultRenderer; - - if(this.renderer.type === PIXI.WEBGL_RENDERER) - { - var gl = this.renderer.gl; - this.baseTexture._dirty[gl.id] = false; - - this.textureBuffer = new PIXI.FilterTexture(gl, this.width, this.height, this.baseTexture.scaleMode); - this.baseTexture._glTextures[gl.id] = this.textureBuffer.texture; - - this.render = this.renderWebGL; - this.projection = new PIXI.Point(this.width*0.5, -this.height*0.5); - } - else - { - this.render = this.renderCanvas; - this.textureBuffer = new PIXI.CanvasBuffer(this.width* this.resolution, this.height* this.resolution); - this.baseTexture.source = this.textureBuffer.canvas; - } - - /** - * @property valid - * @type Boolean - */ - this.valid = true; - - this._updateUvs(); -}; - -PIXI.RenderTexture.prototype = Object.create(PIXI.Texture.prototype); -PIXI.RenderTexture.prototype.constructor = PIXI.RenderTexture; - -/** - * Resizes the RenderTexture. - * - * @method resize - * @param width {Number} The width to resize to. - * @param height {Number} The height to resize to. - * @param updateBase {Boolean} Should the baseTexture.width and height values be resized as well? - */ -PIXI.RenderTexture.prototype.resize = function(width, height, updateBase) -{ - if (width === this.width && height === this.height)return; - - this.valid = (width > 0 && height > 0); - - this.width = width; - this.height = height; - - this.frame.width = this.crop.width = width * this.resolution; - this.frame.height = this.crop.height = height * this.resolution; - - if (updateBase) - { - this.baseTexture.width = this.width * this.resolution; - this.baseTexture.height = this.height * this.resolution; - } - - if (this.renderer.type === PIXI.WEBGL_RENDERER) - { - this.projection.x = this.width / 2; - this.projection.y = -this.height / 2; - } - - if(!this.valid)return; - - this.textureBuffer.resize(this.width, this.height); -}; - -/** - * Clears the RenderTexture. - * - * @method clear - */ -PIXI.RenderTexture.prototype.clear = function() -{ - if(!this.valid)return; - - if (this.renderer.type === PIXI.WEBGL_RENDERER) - { - this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer); - } - - this.textureBuffer.clear(); -}; - -/** - * This function will draw the display object to the texture. - * - * @method renderWebGL - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. - * @param [clear] {Boolean} If true the texture will be cleared before the displayObject is drawn - * @private - */ -PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, matrix, clear) -{ - if(!this.valid)return; - //TOOD replace position with matrix.. - - //Lets create a nice matrix to apply to our display object. Frame buffers come in upside down so we need to flip the matrix - var wt = displayObject.worldTransform; - wt.identity(); - wt.translate(0, this.projection.y * 2); - if(matrix)wt.append(matrix); - wt.scale(1,-1); - - // setWorld Alpha to ensure that the object is renderer at full opacity - displayObject.worldAlpha = 1; - - // Time to update all the children of the displayObject with the new matrix.. - var children = displayObject.children; - - for(var i=0,j=children.length; i 'image/gif' - var info = data.slice(0, sepIdx).split(';')[0]; - - //We might need to handle some special cases here... - //standardize text/plain to 'txt' file extension - if (!info || info.toLowerCase() === 'text/plain') - return 'txt'; - - //User specified mime type, try splitting it by '/' - return info.split('/').pop().toLowerCase(); - } - - return null; -}; - -/** - * Starts loading the assets sequentially - * - * @method load - */ -PIXI.AssetLoader.prototype.load = function() -{ - var scope = this; - - function onLoad(evt) { - scope.onAssetLoaded(evt.data.content); - } - - this.loadCount = this.assetURLs.length; - - for (var i=0; i < this.assetURLs.length; i++) - { - var fileName = this.assetURLs[i]; - //first see if we have a data URI scheme.. - var fileType = this._getDataType(fileName); - - //if not, assume it's a file URI - if (!fileType) - fileType = fileName.split('?').shift().split('.').pop().toLowerCase(); - - var Constructor = this.loadersByType[fileType]; - if(!Constructor) - throw new Error(fileType + ' is an unsupported file type'); - - var loader = new Constructor(fileName, this.crossorigin); - - loader.on('loaded', onLoad); - loader.load(); - } -}; - -/** - * Invoked after each file is loaded - * - * @method onAssetLoaded - * @private - */ -PIXI.AssetLoader.prototype.onAssetLoaded = function(loader) -{ - this.loadCount--; - - this.emit('onProgress', { - content: this, - loader: loader, - loaded: this.assetURLs.length - this.loadCount, - total: this.assetURLs.length - }); - - if (this.onProgress) this.onProgress(loader); - - if (!this.loadCount) - { - this.emit('onComplete', { content: this }); - if(this.onComplete) this.onComplete(); - } -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The json file loader is used to load in JSON data and parse it - * When loaded this class will dispatch a 'loaded' event - * If loading fails this class will dispatch an 'error' event - * - * @class JsonLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.JsonLoader = function (url, crossorigin) { - /** - * The url of the bitmap font data - * - * @property url - * @type String - */ - this.url = url; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * [read-only] The base url of the bitmap font data - * - * @property baseUrl - * @type String - * @readOnly - */ - this.baseUrl = url.replace(/[^\/]*$/, ''); - - /** - * [read-only] Whether the data has loaded yet - * - * @property loaded - * @type Boolean - * @readOnly - */ - this.loaded = false; - -}; - -// constructor -PIXI.JsonLoader.prototype.constructor = PIXI.JsonLoader; -PIXI.EventTarget.mixin(PIXI.JsonLoader.prototype); - -/** - * Loads the JSON data - * - * @method load - */ -PIXI.JsonLoader.prototype.load = function () { - - if(window.XDomainRequest && this.crossorigin) - { - this.ajaxRequest = new window.XDomainRequest(); - - // XDomainRequest has a few quirks. Occasionally it will abort requests - // A way to avoid this is to make sure ALL callbacks are set even if not used - // More info here: http://stackoverflow.com/questions/15786966/xdomainrequest-aborts-post-on-ie-9 - this.ajaxRequest.timeout = 3000; - - this.ajaxRequest.onerror = this.onError.bind(this); - - this.ajaxRequest.ontimeout = this.onError.bind(this); - - this.ajaxRequest.onprogress = function() {}; - - this.ajaxRequest.onload = this.onJSONLoaded.bind(this); - } - else - { - if (window.XMLHttpRequest) - { - this.ajaxRequest = new window.XMLHttpRequest(); - } - else - { - this.ajaxRequest = new window.ActiveXObject('Microsoft.XMLHTTP'); - } - - this.ajaxRequest.onreadystatechange = this.onReadyStateChanged.bind(this); - } - - this.ajaxRequest.open('GET',this.url,true); - - this.ajaxRequest.send(); -}; - -/** - * Bridge function to be able to use the more reliable onreadystatechange in XMLHttpRequest. - * - * @method onReadyStateChanged - * @private - */ -PIXI.JsonLoader.prototype.onReadyStateChanged = function () { - if (this.ajaxRequest.readyState === 4 && (this.ajaxRequest.status === 200 || window.location.href.indexOf('http') === -1)) { - this.onJSONLoaded(); - } -}; - -/** - * Invoke when JSON file is loaded - * - * @method onJSONLoaded - * @private - */ -PIXI.JsonLoader.prototype.onJSONLoaded = function () { - - if(!this.ajaxRequest.responseText ) - { - this.onError(); - return; - } - - this.json = JSON.parse(this.ajaxRequest.responseText); - - if(this.json.frames && this.json.meta && this.json.meta.image) - { - // sprite sheet - var textureUrl = this.baseUrl + this.json.meta.image; - var image = new PIXI.ImageLoader(textureUrl, this.crossorigin); - var frameData = this.json.frames; - - this.texture = image.texture.baseTexture; - image.addEventListener('loaded', this.onLoaded.bind(this)); - - for (var i in frameData) - { - var rect = frameData[i].frame; - - if (rect) - { - var textureSize = new PIXI.Rectangle(rect.x, rect.y, rect.w, rect.h); - var crop = textureSize.clone(); - var trim = null; - - // Check to see if the sprite is trimmed - if (frameData[i].trimmed) - { - var actualSize = frameData[i].sourceSize; - var realSize = frameData[i].spriteSourceSize; - trim = new PIXI.Rectangle(realSize.x, realSize.y, actualSize.w, actualSize.h); - } - PIXI.TextureCache[i] = new PIXI.Texture(this.texture, textureSize, crop, trim); - } - } - - image.load(); - - } - else if(this.json.bones) - { - /* check if the json was loaded before */ - if (PIXI.AnimCache[this.url]) - { - this.onLoaded(); - } - else - { - /* use a bit of hackery to load the atlas file, here we assume that the .json, .atlas and .png files - * that correspond to the spine file are in the same base URL and that the .json and .atlas files - * have the same name - */ - var atlasPath = this.url.substr(0, this.url.lastIndexOf('.')) + '.atlas'; - var atlasLoader = new PIXI.JsonLoader(atlasPath, this.crossorigin); - // save a copy of the current object for future reference // - var originalLoader = this; - // before loading the file, replace the "onJSONLoaded" function for our own // - atlasLoader.onJSONLoaded = function() - { - // at this point "this" points at the atlasLoader (JsonLoader) instance // - if(!this.ajaxRequest.responseText) - { - this.onError(); // FIXME: hmm, this is funny because we are not responding to errors yet - return; - } - // create a new instance of a spine texture loader for this spine object // - var textureLoader = new PIXI.SpineTextureLoader(this.url.substring(0, this.url.lastIndexOf('/'))); - // create a spine atlas using the loaded text and a spine texture loader instance // - var spineAtlas = new spine.Atlas(this.ajaxRequest.responseText, textureLoader); - // now we use an atlas attachment loader // - var attachmentLoader = new spine.AtlasAttachmentLoader(spineAtlas); - // spine animation - var spineJsonParser = new spine.SkeletonJson(attachmentLoader); - var skeletonData = spineJsonParser.readSkeletonData(originalLoader.json); - PIXI.AnimCache[originalLoader.url] = skeletonData; - originalLoader.spine = skeletonData; - originalLoader.spineAtlas = spineAtlas; - originalLoader.spineAtlasLoader = atlasLoader; - // wait for textures to finish loading if needed - if (textureLoader.loadingCount > 0) - { - textureLoader.addEventListener('loadedBaseTexture', function(evt){ - if (evt.content.content.loadingCount <= 0) - { - originalLoader.onLoaded(); - } - }); - } - else - { - originalLoader.onLoaded(); - } - }; - // start the loading // - atlasLoader.load(); - } - } - else - { - this.onLoaded(); - } -}; - -/** - * Invoke when json file loaded - * - * @method onLoaded - * @private - */ -PIXI.JsonLoader.prototype.onLoaded = function () { - this.loaded = true; - this.dispatchEvent({ - type: 'loaded', - content: this - }); -}; - -/** - * Invoke when error occured - * - * @method onError - * @private - */ -PIXI.JsonLoader.prototype.onError = function () { - - this.dispatchEvent({ - type: 'error', - content: this - }); -}; - -/** - * @author Martin Kelm http://mkelm.github.com - */ - -/** - * The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event. - * - * To generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format. - * - * It is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to 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.fromFrameId() - * - * @class AtlasLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.AtlasLoader = function (url, crossorigin) { - this.url = url; - this.baseUrl = url.replace(/[^\/]*$/, ''); - this.crossorigin = crossorigin; - this.loaded = false; - -}; - -// constructor -PIXI.AtlasLoader.constructor = PIXI.AtlasLoader; - -PIXI.EventTarget.mixin(PIXI.AtlasLoader.prototype); - - /** - * Starts loading the JSON file - * - * @method load - */ -PIXI.AtlasLoader.prototype.load = function () { - this.ajaxRequest = new PIXI.AjaxRequest(); - this.ajaxRequest.onreadystatechange = this.onAtlasLoaded.bind(this); - - this.ajaxRequest.open('GET', this.url, true); - if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/json'); - this.ajaxRequest.send(null); -}; - -/** - * Invoked when the Atlas has fully loaded. Parses the JSON and builds the texture frames. - * - * @method onAtlasLoaded - * @private - */ -PIXI.AtlasLoader.prototype.onAtlasLoaded = function () { - if (this.ajaxRequest.readyState === 4) { - if (this.ajaxRequest.status === 200 || window.location.href.indexOf('http') === -1) { - this.atlas = { - meta : { - image : [] - }, - frames : [] - }; - var result = this.ajaxRequest.responseText.split(/\r?\n/); - var lineCount = -3; - - var currentImageId = 0; - var currentFrame = null; - var nameInNextLine = false; - - var i = 0, - j = 0, - selfOnLoaded = this.onLoaded.bind(this); - - // parser without rotation support yet! - for (i = 0; i < result.length; i++) { - result[i] = result[i].replace(/^\s+|\s+$/g, ''); - if (result[i] === '') { - nameInNextLine = i+1; - } - if (result[i].length > 0) { - if (nameInNextLine === i) { - this.atlas.meta.image.push(result[i]); - currentImageId = this.atlas.meta.image.length - 1; - this.atlas.frames.push({}); - lineCount = -3; - } else if (lineCount > 0) { - if (lineCount % 7 === 1) { // frame name - if (currentFrame != null) { //jshint ignore:line - this.atlas.frames[currentImageId][currentFrame.name] = currentFrame; - } - currentFrame = { name: result[i], frame : {} }; - } else { - var text = result[i].split(' '); - if (lineCount % 7 === 3) { // position - currentFrame.frame.x = Number(text[1].replace(',', '')); - currentFrame.frame.y = Number(text[2]); - } else if (lineCount % 7 === 4) { // size - currentFrame.frame.w = Number(text[1].replace(',', '')); - currentFrame.frame.h = Number(text[2]); - } else if (lineCount % 7 === 5) { // real size - var realSize = { - x : 0, - y : 0, - w : Number(text[1].replace(',', '')), - h : Number(text[2]) - }; - - if (realSize.w > currentFrame.frame.w || realSize.h > currentFrame.frame.h) { - currentFrame.trimmed = true; - currentFrame.realSize = realSize; - } else { - currentFrame.trimmed = false; - } - } - } - } - lineCount++; - } - } - - if (currentFrame != null) { //jshint ignore:line - this.atlas.frames[currentImageId][currentFrame.name] = currentFrame; - } - - if (this.atlas.meta.image.length > 0) { - this.images = []; - for (j = 0; j < this.atlas.meta.image.length; j++) { - // sprite sheet - var textureUrl = this.baseUrl + this.atlas.meta.image[j]; - var frameData = this.atlas.frames[j]; - this.images.push(new PIXI.ImageLoader(textureUrl, this.crossorigin)); - - for (i in frameData) { - var rect = frameData[i].frame; - if (rect) { - PIXI.TextureCache[i] = new PIXI.Texture(this.images[j].texture.baseTexture, { - x: rect.x, - y: rect.y, - width: rect.w, - height: rect.h - }); - if (frameData[i].trimmed) { - PIXI.TextureCache[i].realSize = frameData[i].realSize; - // trim in pixi not supported yet, todo update trim properties if it is done ... - PIXI.TextureCache[i].trim.x = 0; - PIXI.TextureCache[i].trim.y = 0; - } - } - } - } - - this.currentImageId = 0; - for (j = 0; j < this.images.length; j++) { - this.images[j].on('loaded', selfOnLoaded); - } - this.images[this.currentImageId].load(); - - } else { - this.onLoaded(); - } - - } else { - this.onError(); - } - } -}; - -/** - * Invoked when json file has loaded. - * - * @method onLoaded - * @private - */ -PIXI.AtlasLoader.prototype.onLoaded = function () { - if (this.images.length - 1 > this.currentImageId) { - this.currentImageId++; - this.images[this.currentImageId].load(); - } else { - this.loaded = true; - this.emit('loaded', { content: this }); - } -}; - -/** - * Invoked when an error occurs. - * - * @method onError - * @private - */ -PIXI.AtlasLoader.prototype.onError = function () { - this.emit('error', { content: this }); -}; - -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * 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 in 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 a 'texture atlas') as it means sprites 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.fromFrameId() - * This loader will load the image file that the Spritesheet points to as well as the data. - * When loaded this class will dispatch a 'loaded' event - * - * @class SpriteSheetLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the sprite sheet JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.SpriteSheetLoader = function (url, crossorigin) { - - /** - * The url of the atlas data - * - * @property url - * @type String - */ - this.url = url; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * [read-only] The base url of the bitmap font data - * - * @property baseUrl - * @type String - * @readOnly - */ - this.baseUrl = url.replace(/[^\/]*$/, ''); - - /** - * The texture being loaded - * - * @property texture - * @type Texture - */ - this.texture = null; - - /** - * The frames of the sprite sheet - * - * @property frames - * @type Object - */ - this.frames = {}; -}; - -// constructor -PIXI.SpriteSheetLoader.prototype.constructor = PIXI.SpriteSheetLoader; - -PIXI.EventTarget.mixin(PIXI.SpriteSheetLoader.prototype); - -/** - * This will begin loading the JSON file - * - * @method load - */ -PIXI.SpriteSheetLoader.prototype.load = function () { - var scope = this; - var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin); - jsonLoader.on('loaded', function (event) { - scope.json = event.data.content.json; - scope.onLoaded(); - }); - jsonLoader.load(); -}; - -/** - * Invoke when all files are loaded (json and texture) - * - * @method onLoaded - * @private - */ -PIXI.SpriteSheetLoader.prototype.onLoaded = function () { - this.emit('loaded', { - content: this - }); -}; - -/** - * @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.fromFrame() and PIXI.Sprite.fromFrame() - * When loaded this class will dispatch a 'loaded' event - * - * @class ImageLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the image - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.ImageLoader = function(url, crossorigin) -{ - /** - * The texture being loaded - * - * @property texture - * @type Texture - */ - this.texture = PIXI.Texture.fromImage(url, crossorigin); - - /** - * if the image is loaded with loadFramedSpriteSheet - * frames will contain the sprite sheet frames - * - * @property frames - * @type Array - * @readOnly - */ - this.frames = []; -}; - -// constructor -PIXI.ImageLoader.prototype.constructor = PIXI.ImageLoader; - -PIXI.EventTarget.mixin(PIXI.ImageLoader.prototype); - -/** - * Loads image or takes it from cache - * - * @method load - */ -PIXI.ImageLoader.prototype.load = function() -{ - if(!this.texture.baseTexture.hasLoaded) - { - this.texture.baseTexture.on('loaded', this.onLoaded.bind(this)); - } - else - { - this.onLoaded(); - } -}; - -/** - * Invoked when image file is loaded or it is already cached and ready to use - * - * @method onLoaded - * @private - */ -PIXI.ImageLoader.prototype.onLoaded = function() -{ - this.emit('loaded', { content: this }); -}; - -/** - * Loads image and split it to uniform sized frames - * - * @method loadFramedSpriteSheet - * @param frameWidth {Number} width of each frame - * @param frameHeight {Number} height of each frame - * @param textureName {String} if given, the frames will be cached in - format - */ -PIXI.ImageLoader.prototype.loadFramedSpriteSheet = function(frameWidth, frameHeight, textureName) -{ - this.frames = []; - var cols = Math.floor(this.texture.width / frameWidth); - var rows = Math.floor(this.texture.height / frameHeight); - - var i=0; - for (var y=0; y-1){var c=["%c %c %c Pixi.js "+b.VERSION+" - "+a+" %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ ","background: #ff66a5","background: #ff66a5","color: #ff66a5; background: #030307;","background: #ff66a5","background: #ffc3dc","background: #ff66a5","color: #ff2424; background: #fff","color: #ff2424; background: #fff","color: #ff2424; background: #fff"];console.log.apply(console,c)}else window.console&&console.log("Pixi.js "+b.VERSION+" - http://www.pixijs.com/");b.dontSayHello=!0}},b.Point=function(a,b){this.x=a||0,this.y=b||0},b.Point.prototype.clone=function(){return new b.Point(this.x,this.y)},b.Point.prototype.set=function(a,b){this.x=a||0,this.y=b||(0!==b?this.x:0)},b.Point.prototype.constructor=b.Point,b.Rectangle=function(a,b,c,d){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0},b.Rectangle.prototype.clone=function(){return new b.Rectangle(this.x,this.y,this.width,this.height)},b.Rectangle.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=this.x;if(a>=c&&a<=c+this.width){var d=this.y;if(b>=d&&b<=d+this.height)return!0}return!1},b.Rectangle.prototype.constructor=b.Rectangle,b.EmptyRectangle=new b.Rectangle(0,0,0,0),b.Polygon=function(a){if(a instanceof Array||(a=Array.prototype.slice.call(arguments)),a[0]instanceof b.Point){for(var c=[],d=0,e=a.length;e>d;d++)c.push(a[d].x,a[d].y);a=c}this.closed=!0,this.points=a},b.Polygon.prototype.clone=function(){var a=this.points.slice();return new b.Polygon(a)},b.Polygon.prototype.contains=function(a,b){for(var c=!1,d=this.points.length/2,e=0,f=d-1;d>e;f=e++){var g=this.points[2*e],h=this.points[2*e+1],i=this.points[2*f],j=this.points[2*f+1],k=h>b!=j>b&&(i-g)*(b-h)/(j-h)+g>a;k&&(c=!c)}return c},b.Polygon.prototype.constructor=b.Polygon,b.Circle=function(a,b,c){this.x=a||0,this.y=b||0,this.radius=c||0},b.Circle.prototype.clone=function(){return new b.Circle(this.x,this.y,this.radius)},b.Circle.prototype.contains=function(a,b){if(this.radius<=0)return!1;var c=this.x-a,d=this.y-b,e=this.radius*this.radius;return c*=c,d*=d,e>=c+d},b.Circle.prototype.getBounds=function(){return new b.Rectangle(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},b.Circle.prototype.constructor=b.Circle,b.Ellipse=function(a,b,c,d){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0},b.Ellipse.prototype.clone=function(){return new b.Ellipse(this.x,this.y,this.width,this.height)},b.Ellipse.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=(a-this.x)/this.width,d=(b-this.y)/this.height;return c*=c,d*=d,1>=c+d},b.Ellipse.prototype.getBounds=function(){return new b.Rectangle(this.x-this.width,this.y-this.height,this.width,this.height)},b.Ellipse.prototype.constructor=b.Ellipse,b.RoundedRectangle=function(a,b,c,d,e){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0,this.radius=e||20},b.RoundedRectangle.prototype.clone=function(){return new b.RoundedRectangle(this.x,this.y,this.width,this.height,this.radius)},b.RoundedRectangle.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=this.x;if(a>=c&&a<=c+this.width){var d=this.y;if(b>=d&&b<=d+this.height)return!0}return!1},b.RoundedRectangle.prototype.constructor=b.RoundedRectangle,b.Matrix=function(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0},b.Matrix.prototype.fromArray=function(a){this.a=a[0],this.b=a[1],this.c=a[3],this.d=a[4],this.tx=a[2],this.ty=a[5]},b.Matrix.prototype.toArray=function(a){this.array||(this.array=new b.Float32Array(9));var c=this.array;return a?(c[0]=this.a,c[1]=this.b,c[2]=0,c[3]=this.c,c[4]=this.d,c[5]=0,c[6]=this.tx,c[7]=this.ty,c[8]=1):(c[0]=this.a,c[1]=this.c,c[2]=this.tx,c[3]=this.b,c[4]=this.d,c[5]=this.ty,c[6]=0,c[7]=0,c[8]=1),c},b.Matrix.prototype.apply=function(a,c){return c=c||new b.Point,c.x=this.a*a.x+this.c*a.y+this.tx,c.y=this.b*a.x+this.d*a.y+this.ty,c},b.Matrix.prototype.applyInverse=function(a,c){c=c||new b.Point;var d=1/(this.a*this.d+this.c*-this.b);return c.x=this.d*d*a.x+-this.c*d*a.y+(this.ty*this.c-this.tx*this.d)*d,c.y=this.a*d*a.y+-this.b*d*a.x+(-this.ty*this.a+this.tx*this.b)*d,c},b.Matrix.prototype.translate=function(a,b){return this.tx+=a,this.ty+=b,this},b.Matrix.prototype.scale=function(a,b){return this.a*=a,this.d*=b,this.c*=a,this.b*=b,this.tx*=a,this.ty*=b,this},b.Matrix.prototype.rotate=function(a){var b=Math.cos(a),c=Math.sin(a),d=this.a,e=this.c,f=this.tx;return this.a=d*b-this.b*c,this.b=d*c+this.b*b,this.c=e*b-this.d*c,this.d=e*c+this.d*b,this.tx=f*b-this.ty*c,this.ty=f*c+this.ty*b,this},b.Matrix.prototype.append=function(a){var b=this.a,c=this.b,d=this.c,e=this.d;return this.a=a.a*b+a.b*d,this.b=a.a*c+a.b*e,this.c=a.c*b+a.d*d,this.d=a.c*c+a.d*e,this.tx=a.tx*b+a.ty*d+this.tx,this.ty=a.tx*c+a.ty*e+this.ty,this},b.Matrix.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},b.identityMatrix=new b.Matrix,b.DisplayObject=function(){this.position=new b.Point,this.scale=new b.Point(1,1),this.pivot=new b.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.hitArea=null,this.buttonMode=!1,this.renderable=!1,this.parent=null,this.stage=null,this.worldAlpha=1,this._interactive=!1,this.defaultCursor="pointer",this.worldTransform=new b.Matrix,this._sr=0,this._cr=1,this.filterArea=null,this._bounds=new b.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null,this._cacheAsBitmap=!1,this._cacheIsDirty=!1},b.DisplayObject.prototype.constructor=b.DisplayObject,Object.defineProperty(b.DisplayObject.prototype,"interactive",{get:function(){return this._interactive},set:function(a){this._interactive=a,this.stage&&(this.stage.dirty=!0)}}),Object.defineProperty(b.DisplayObject.prototype,"worldVisible",{get:function(){var a=this;do{if(!a.visible)return!1;a=a.parent}while(a);return!0}}),Object.defineProperty(b.DisplayObject.prototype,"mask",{get:function(){return this._mask},set:function(a){this._mask&&(this._mask.isMask=!1),this._mask=a,this._mask&&(this._mask.isMask=!0)}}),Object.defineProperty(b.DisplayObject.prototype,"filters",{get:function(){return this._filters},set:function(a){if(a){for(var b=[],c=0;c=0&&b<=this.children.length)return a.parent&&a.parent.removeChild(a),a.parent=this,this.children.splice(b,0,a),this.stage&&a.setStageReference(this.stage),a;throw new Error(a+"addChildAt: The index "+b+" supplied is out of bounds "+this.children.length)},b.DisplayObjectContainer.prototype.swapChildren=function(a,b){if(a!==b){var c=this.getChildIndex(a),d=this.getChildIndex(b);if(0>c||0>d)throw new Error("swapChildren: Both the supplied DisplayObjects must be a child of the caller.");this.children[c]=b,this.children[d]=a}},b.DisplayObjectContainer.prototype.getChildIndex=function(a){var b=this.children.indexOf(a);if(-1===b)throw new Error("The supplied DisplayObject must be a child of the caller");return b},b.DisplayObjectContainer.prototype.setChildIndex=function(a,b){if(0>b||b>=this.children.length)throw new Error("The supplied index is out of bounds");var c=this.getChildIndex(a);this.children.splice(c,1),this.children.splice(b,0,a)},b.DisplayObjectContainer.prototype.getChildAt=function(a){if(0>a||a>=this.children.length)throw new Error("getChildAt: Supplied index "+a+" does not exist in the child list, or the supplied DisplayObject must be a child of the caller");return this.children[a]},b.DisplayObjectContainer.prototype.removeChild=function(a){var b=this.children.indexOf(a);if(-1!==b)return this.removeChildAt(b)},b.DisplayObjectContainer.prototype.removeChildAt=function(a){var b=this.getChildAt(a);return this.stage&&b.removeStageReference(),b.parent=void 0,this.children.splice(a,1),b},b.DisplayObjectContainer.prototype.removeChildren=function(a,b){var c=a||0,d="number"==typeof b?b:this.children.length,e=d-c;if(e>0&&d>=e){for(var f=this.children.splice(c,e),g=0;ga;a++)this.children[a].updateTransform()},b.DisplayObjectContainer.prototype.displayObjectContainerUpdateTransform=b.DisplayObjectContainer.prototype.updateTransform,b.DisplayObjectContainer.prototype.getBounds=function(){if(0===this.children.length)return b.EmptyRectangle;for(var a,c,d,e=1/0,f=1/0,g=-1/0,h=-1/0,i=!1,j=0,k=this.children.length;k>j;j++){var l=this.children[j];l.visible&&(i=!0,a=this.children[j].getBounds(),e=ec?g:c,h=h>d?h:d)}if(!i)return b.EmptyRectangle;var m=this._bounds;return m.x=e,m.y=f,m.width=g-e,m.height=h-f,m},b.DisplayObjectContainer.prototype.getLocalBounds=function(){var a=this.worldTransform;this.worldTransform=b.identityMatrix;for(var c=0,d=this.children.length;d>c;c++)this.children[c].updateTransform();var e=this.getBounds();return this.worldTransform=a,e},b.DisplayObjectContainer.prototype.setStageReference=function(a){this.stage=a,this._interactive&&(this.stage.dirty=!0);for(var b=0,c=this.children.length;c>b;b++){var d=this.children[b];d.setStageReference(a)}},b.DisplayObjectContainer.prototype.removeStageReference=function(){for(var a=0,b=this.children.length;b>a;a++){var c=this.children[a];c.removeStageReference()}this._interactive&&(this.stage.dirty=!0),this.stage=null},b.DisplayObjectContainer.prototype._renderWebGL=function(a){if(this.visible&&!(this.alpha<=0)){if(this._cacheAsBitmap)return void this._renderCachedSprite(a);var b,c;if(this._mask||this._filters){for(this._filters&&(a.spriteBatch.flush(),a.filterManager.pushFilter(this._filterBlock)),this._mask&&(a.spriteBatch.stop(),a.maskManager.pushMask(this.mask,a),a.spriteBatch.start()),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a);a.spriteBatch.stop(),this._mask&&a.maskManager.popMask(this._mask,a),this._filters&&a.filterManager.popFilter(),a.spriteBatch.start()}else for(b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a)}},b.DisplayObjectContainer.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){if(this._cacheAsBitmap)return void this._renderCachedSprite(a);this._mask&&a.maskManager.pushMask(this._mask,a);for(var b=0,c=this.children.length;c>b;b++){var d=this.children[b];d._renderCanvas(a)}this._mask&&a.maskManager.popMask(a)}},b.Sprite=function(a){b.DisplayObjectContainer.call(this),this.anchor=new b.Point,this.texture=a||b.Texture.emptyTexture,this._width=0,this._height=0,this.tint=16777215,this.blendMode=b.blendModes.NORMAL,this.shader=null,this.texture.baseTexture.hasLoaded?this.onTextureUpdate():this.texture.on("update",this.onTextureUpdate.bind(this)),this.renderable=!0},b.Sprite.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Sprite.prototype.constructor=b.Sprite,Object.defineProperty(b.Sprite.prototype,"width",{get:function(){return this.scale.x*this.texture.frame.width},set:function(a){this.scale.x=a/this.texture.frame.width,this._width=a}}),Object.defineProperty(b.Sprite.prototype,"height",{get:function(){return this.scale.y*this.texture.frame.height},set:function(a){this.scale.y=a/this.texture.frame.height,this._height=a}}),b.Sprite.prototype.setTexture=function(a){this.texture=a,this.cachedTint=16777215},b.Sprite.prototype.onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height)},b.Sprite.prototype.getBounds=function(a){var b=this.texture.frame.width,c=this.texture.frame.height,d=b*(1-this.anchor.x),e=b*-this.anchor.x,f=c*(1-this.anchor.y),g=c*-this.anchor.y,h=a||this.worldTransform,i=h.a,j=h.b,k=h.c,l=h.d,m=h.tx,n=h.ty,o=-1/0,p=-1/0,q=1/0,r=1/0;if(0===j&&0===k)0>i&&(i*=-1),0>l&&(l*=-1),q=i*e+m,o=i*d+m,r=l*g+n,p=l*f+n;else{var s=i*e+k*g+m,t=l*g+j*e+n,u=i*d+k*g+m,v=l*g+j*d+n,w=i*d+k*f+m,x=l*f+j*d+n,y=i*e+k*f+m,z=l*f+j*e+n;q=q>s?s:q,q=q>u?u:q,q=q>w?w:q,q=q>y?y:q,r=r>t?t:r,r=r>v?v:r,r=r>x?x:r,r=r>z?z:r,o=s>o?s:o,o=u>o?u:o,o=w>o?w:o,o=y>o?y:o,p=t>p?t:p,p=v>p?v:p,p=x>p?x:p,p=z>p?z:p}var A=this._bounds;return A.x=q,A.width=o-q,A.y=r,A.height=p-r,this._currentBounds=A,A},b.Sprite.prototype._renderWebGL=function(a){if(this.visible&&!(this.alpha<=0)){var b,c;if(this._mask||this._filters){var d=a.spriteBatch;for(this._filters&&(d.flush(),a.filterManager.pushFilter(this._filterBlock)),this._mask&&(d.stop(),a.maskManager.pushMask(this.mask,a),d.start()),d.render(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a);d.stop(),this._mask&&a.maskManager.popMask(this._mask,a),this._filters&&a.filterManager.popFilter(),d.start()}else for(a.spriteBatch.render(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a)}},b.Sprite.prototype._renderCanvas=function(a){if(!(this.visible===!1||0===this.alpha||this.texture.crop.width<=0||this.texture.crop.height<=0)){if(this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,a.context.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]),this._mask&&a.maskManager.pushMask(this._mask,a),this.texture.valid){var c=this.texture.baseTexture.resolution/a.resolution;a.context.globalAlpha=this.worldAlpha,a.smoothProperty&&a.scaleMode!==this.texture.baseTexture.scaleMode&&(a.scaleMode=this.texture.baseTexture.scaleMode,a.context[a.smoothProperty]=a.scaleMode===b.scaleModes.LINEAR);var d=this.texture.trim?this.texture.trim.x-this.anchor.x*this.texture.trim.width:this.anchor.x*-this.texture.frame.width,e=this.texture.trim?this.texture.trim.y-this.anchor.y*this.texture.trim.height:this.anchor.y*-this.texture.frame.height;a.roundPixels?(a.context.setTransform(this.worldTransform.a,this.worldTransform.b,this.worldTransform.c,this.worldTransform.d,this.worldTransform.tx*a.resolution|0,this.worldTransform.ty*a.resolution|0),d=0|d,e=0|e):a.context.setTransform(this.worldTransform.a,this.worldTransform.b,this.worldTransform.c,this.worldTransform.d,this.worldTransform.tx*a.resolution,this.worldTransform.ty*a.resolution),16777215!==this.tint?(this.cachedTint!==this.tint&&(this.cachedTint=this.tint,this.tintedTexture=b.CanvasTinter.getTintedTexture(this,this.tint)),a.context.drawImage(this.tintedTexture,0,0,this.texture.crop.width,this.texture.crop.height,d/c,e/c,this.texture.crop.width/c,this.texture.crop.height/c)):a.context.drawImage(this.texture.baseTexture.source,this.texture.crop.x,this.texture.crop.y,this.texture.crop.width,this.texture.crop.height,d/c,e/c,this.texture.crop.width/c,this.texture.crop.height/c)}for(var f=0,g=this.children.length;g>f;f++)this.children[f]._renderCanvas(a);this._mask&&a.maskManager.popMask(a)}},b.Sprite.fromFrame=function(a){var c=b.TextureCache[a];if(!c)throw new Error('The frameId "'+a+'" does not exist in the texture cache'+this);return new b.Sprite(c)},b.Sprite.fromImage=function(a,c,d){var e=b.Texture.fromImage(a,c,d);return new b.Sprite(e)},b.SpriteBatch=function(a){b.DisplayObjectContainer.call(this),this.textureThing=a,this.ready=!1},b.SpriteBatch.prototype=Object.create(b.DisplayObjectContainer.prototype),b.SpriteBatch.prototype.constructor=b.SpriteBatch,b.SpriteBatch.prototype.initWebGL=function(a){this.fastSpriteBatch=new b.WebGLFastSpriteBatch(a),this.ready=!0},b.SpriteBatch.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},b.SpriteBatch.prototype._renderWebGL=function(a){!this.visible||this.alpha<=0||!this.children.length||(this.ready||this.initWebGL(a.gl),this.fastSpriteBatch.gl!==a.gl&&this.fastSpriteBatch.setContext(a.gl),a.spriteBatch.stop(),a.shaderManager.setShader(a.shaderManager.fastShader),this.fastSpriteBatch.begin(this,a),this.fastSpriteBatch.render(this),a.spriteBatch.start())},b.SpriteBatch.prototype._renderCanvas=function(a){if(this.visible&&!(this.alpha<=0)&&this.children.length){var b=a.context;b.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var c=this.worldTransform,d=!0,e=0;e=this.textures.length&&(this.gotoAndStop(this.textures.length-1),this.onComplete&&this.onComplete())}},b.MovieClip.fromFrames=function(a){for(var c=[],d=0;di;i++){for(j=0;m>j;j+=4)if(255!==k[n+j]){o=!0;break}if(o)break;n+=m}for(c.ascent=g-i,n=l-m,o=!1,i=h;i>g;i--){for(j=0;m>j;j+=4)if(255!==k[n+j]){o=!0;break}if(o)break;n-=m}c.descent=i-g,c.descent+=6,c.fontSize=c.ascent+c.descent,b.Text.fontPropertiesCache[a]=c}return c},b.Text.prototype.wordWrap=function(a){for(var b="",c=a.split("\n"),d=0;de?(g>0&&(b+="\n"),b+=f[g],e=this.style.wordWrapWidth-h):(e-=i,b+=" "+f[g])}d=2?parseInt(c[c.length-2],10):b.BitmapText.fonts[this.fontName].size,this.dirty=!0,this.tint=a.tint},b.BitmapText.prototype.updateText=function(){for(var a=b.BitmapText.fonts[this.fontName],c=new b.Point,d=null,e=[],f=0,g=[],h=0,i=this.fontSize/a.size,j=0;j=j;j++){var n=0;"right"===this.style.align?n=f-g[j]:"center"===this.style.align&&(n=(f-g[j])/2),m.push(n)}var o=this.children.length,p=e.length,q=this.tint||16777215;for(j=0;p>j;j++){var r=o>j?this.children[j]:this._pool.pop();r?r.setTexture(e[j].texture):r=new b.Sprite(e[j].texture),r.position.x=(e[j].position.x+m[e[j].line])*i,r.position.y=e[j].position.y*i,r.scale.x=r.scale.y=i,r.tint=q,r.parent||this.addChild(r)}for(;this.children.length>p;){var s=this.getChildAt(this.children.length-1);this._pool.push(s),this.removeChild(s)}this.textWidth=f*i,this.textHeight=(c.y+a.lineHeight)*i},b.BitmapText.prototype.updateTransform=function(){this.dirty&&(this.updateText(),this.dirty=!1),b.DisplayObjectContainer.prototype.updateTransform.call(this)},b.BitmapText.fonts={},b.InteractionData=function(){this.global=new b.Point,this.target=null,this.originalEvent=null},b.InteractionData.prototype.getLocalPosition=function(a,c){var d=a.worldTransform,e=this.global,f=d.a,g=d.c,h=d.tx,i=d.b,j=d.d,k=d.ty,l=1/(f*j+g*-i);return c=c||new b.Point,c.x=j*l*e.x+-g*l*e.y+(k*g-h*j)*l,c.y=f*l*e.y+-i*l*e.x+(-k*f+h*i)*l,c},b.InteractionData.prototype.constructor=b.InteractionData,b.InteractionManager=function(a){this.stage=a,this.mouse=new b.InteractionData,this.touches={},this.tempPoint=new b.Point,this.mouseoverEnabled=!0,this.pool=[],this.interactiveItems=[],this.interactionDOMElement=null,this.onMouseMove=this.onMouseMove.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.onTouchCancel=this.onTouchCancel.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.last=0,this.currentCursorStyle="inherit",this.mouseOut=!1,this.resolution=1,this._tempPoint=new b.Point -},b.InteractionManager.prototype.constructor=b.InteractionManager,b.InteractionManager.prototype.collectInteractiveSprite=function(a,b){for(var c=a.children,d=c.length,e=d-1;e>=0;e--){var f=c[e];f._interactive?(b.interactiveChildren=!0,this.interactiveItems.push(f),f.children.length>0&&this.collectInteractiveSprite(f,f)):(f.__iParent=null,f.children.length>0&&this.collectInteractiveSprite(f,b))}},b.InteractionManager.prototype.setTarget=function(a){this.target=a,this.resolution=a.resolution,null===this.interactionDOMElement&&this.setTargetDomElement(a.view)},b.InteractionManager.prototype.setTargetDomElement=function(a){this.removeEvents(),window.navigator.msPointerEnabled&&(a.style["-ms-content-zooming"]="none",a.style["-ms-touch-action"]="none"),this.interactionDOMElement=a,a.addEventListener("mousemove",this.onMouseMove,!0),a.addEventListener("mousedown",this.onMouseDown,!0),a.addEventListener("mouseout",this.onMouseOut,!0),a.addEventListener("touchstart",this.onTouchStart,!0),a.addEventListener("touchend",this.onTouchEnd,!0),a.addEventListener("touchleave",this.onTouchCancel,!0),a.addEventListener("touchcancel",this.onTouchCancel,!0),a.addEventListener("touchmove",this.onTouchMove,!0),window.addEventListener("mouseup",this.onMouseUp,!0)},b.InteractionManager.prototype.removeEvents=function(){this.interactionDOMElement&&(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]="",this.interactionDOMElement.removeEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.removeEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.removeEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.removeEventListener("touchleave",this.onTouchCancel,!0),this.interactionDOMElement.removeEventListener("touchcancel",this.onTouchCancel,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onTouchMove,!0),this.interactionDOMElement=null,window.removeEventListener("mouseup",this.onMouseUp,!0))},b.InteractionManager.prototype.update=function(){if(this.target){var a=Date.now(),c=a-this.last;if(c=c*b.INTERACTION_FREQUENCY/1e3,!(1>c)){this.last=a;var d=0;this.dirty&&this.rebuildInteractiveGraph();var e=this.interactiveItems.length,f="inherit",g=!1;for(d=0;e>d;d++){var h=this.interactiveItems[d];h.__hit=this.hitTest(h,this.mouse),this.mouse.target=h,h.__hit&&!g?(h.buttonMode&&(f=h.defaultCursor),h.interactiveChildren||(g=!0),h.__isOver||(h.mouseover&&h.mouseover(this.mouse),h.__isOver=!0)):h.__isOver&&(h.mouseout&&h.mouseout(this.mouse),h.__isOver=!1)}this.currentCursorStyle!==f&&(this.currentCursorStyle=f,this.interactionDOMElement.style.cursor=f)}}},b.InteractionManager.prototype.rebuildInteractiveGraph=function(){this.dirty=!1;for(var a=this.interactiveItems.length,b=0;a>b;b++)this.interactiveItems[b].interactiveChildren=!1;this.interactiveItems=[],this.stage.interactive&&this.interactiveItems.push(this.stage),this.collectInteractiveSprite(this.stage,this.stage)},b.InteractionManager.prototype.onMouseMove=function(a){this.dirty&&this.rebuildInteractiveGraph(),this.mouse.originalEvent=a;var b=this.interactionDOMElement.getBoundingClientRect();this.mouse.global.x=(a.clientX-b.left)*(this.target.width/b.width)/this.resolution,this.mouse.global.y=(a.clientY-b.top)*(this.target.height/b.height)/this.resolution;for(var c=this.interactiveItems.length,d=0;c>d;d++){var e=this.interactiveItems[d];e.mousemove&&e.mousemove(this.mouse)}},b.InteractionManager.prototype.onMouseDown=function(a){this.dirty&&this.rebuildInteractiveGraph(),this.mouse.originalEvent=a,b.AUTO_PREVENT_DEFAULT&&this.mouse.originalEvent.preventDefault();for(var c=this.interactiveItems.length,d=this.mouse.originalEvent,e=2===d.button||3===d.which,f=e?"rightdown":"mousedown",g=e?"rightclick":"click",h=e?"__rightIsDown":"__mouseIsDown",i=e?"__isRightDown":"__isDown",j=0;c>j;j++){var k=this.interactiveItems[j];if((k[f]||k[g])&&(k[h]=!0,k.__hit=this.hitTest(k,this.mouse),k.__hit&&(k[f]&&k[f](this.mouse),k[i]=!0,!k.interactiveChildren)))break}},b.InteractionManager.prototype.onMouseOut=function(a){this.dirty&&this.rebuildInteractiveGraph(),this.mouse.originalEvent=a;var b=this.interactiveItems.length;this.interactionDOMElement.style.cursor="inherit";for(var c=0;b>c;c++){var d=this.interactiveItems[c];d.__isOver&&(this.mouse.target=d,d.mouseout&&d.mouseout(this.mouse),d.__isOver=!1)}this.mouseOut=!0,this.mouse.global.x=-1e4,this.mouse.global.y=-1e4},b.InteractionManager.prototype.onMouseUp=function(a){this.dirty&&this.rebuildInteractiveGraph(),this.mouse.originalEvent=a;for(var b=this.interactiveItems.length,c=!1,d=this.mouse.originalEvent,e=2===d.button||3===d.which,f=e?"rightup":"mouseup",g=e?"rightclick":"click",h=e?"rightupoutside":"mouseupoutside",i=e?"__isRightDown":"__isDown",j=0;b>j;j++){var k=this.interactiveItems[j];(k[g]||k[f]||k[h])&&(k.__hit=this.hitTest(k,this.mouse),k.__hit&&!c?(k[f]&&k[f](this.mouse),k[i]&&k[g]&&k[g](this.mouse),k.interactiveChildren||(c=!0)):k[i]&&k[h]&&k[h](this.mouse),k[i]=!1)}},b.InteractionManager.prototype.hitTest=function(a,c){var d=c.global;if(!a.worldVisible)return!1;a.worldTransform.applyInverse(d,this._tempPoint);var e,f=this._tempPoint.x,g=this._tempPoint.y;if(c.target=a,a.hitArea&&a.hitArea.contains)return a.hitArea.contains(f,g);if(a instanceof b.Sprite){var h,i=a.texture.frame.width,j=a.texture.frame.height,k=-i*a.anchor.x;if(f>k&&k+i>f&&(h=-j*a.anchor.y,g>h&&h+j>g))return!0}else if(a instanceof b.Graphics){var l=a.graphicsData;for(e=0;ee;e++){var o=a.children[e],p=this.hitTest(o,c);if(p)return c.target=a,!0}return!1},b.InteractionManager.prototype.onTouchMove=function(a){this.dirty&&this.rebuildInteractiveGraph();var b,c=this.interactionDOMElement.getBoundingClientRect(),d=a.changedTouches,e=0;for(e=0;ei;i++){var j=this.interactiveItems[i];if((j.touchstart||j.tap)&&(j.__hit=this.hitTest(j,g),j.__hit&&(j.touchstart&&j.touchstart(g),j.__isDown=!0,j.__touchData=j.__touchData||{},j.__touchData[f.identifier]=g,!j.interactiveChildren)))break}}},b.InteractionManager.prototype.onTouchEnd=function(a){this.dirty&&this.rebuildInteractiveGraph();for(var b=this.interactionDOMElement.getBoundingClientRect(),c=a.changedTouches,d=0;di;i++){var j=this.interactiveItems[i];j.__touchData&&j.__touchData[e.identifier]&&(j.__hit=this.hitTest(j,j.__touchData[e.identifier]),f.originalEvent=a,(j.touchend||j.tap)&&(j.__hit&&!g?(j.touchend&&j.touchend(f),j.__isDown&&j.tap&&j.tap(f),j.interactiveChildren||(g=!0)):j.__isDown&&j.touchendoutside&&j.touchendoutside(f),j.__isDown=!1),j.__touchData[e.identifier]=null)}this.pool.push(f),this.touches[e.identifier]=null}},b.InteractionManager.prototype.onTouchCancel=function(a){this.dirty&&this.rebuildInteractiveGraph();for(var b=this.interactionDOMElement.getBoundingClientRect(),c=a.changedTouches,d=0;di;i++){var j=this.interactiveItems[i];j.__touchData&&j.__touchData[e.identifier]&&(j.__hit=this.hitTest(j,j.__touchData[e.identifier]),f.originalEvent=a,j.touchcancel&&!g&&(j.touchcancel(f),j.interactiveChildren||(g=!0)),j.__isDown=!1,j.__touchData[e.identifier]=null)}this.pool.push(f),this.touches[e.identifier]=null}},b.Stage=function(a){b.DisplayObjectContainer.call(this),this.worldTransform=new b.Matrix,this.interactive=!0,this.interactionManager=new b.InteractionManager(this),this.dirty=!0,this.stage=this,this.stage.hitArea=new b.Rectangle(0,0,1e5,1e5),this.setBackgroundColor(a)},b.Stage.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Stage.prototype.constructor=b.Stage,b.Stage.prototype.setInteractionDelegate=function(a){this.interactionManager.setTargetDomElement(a)},b.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var a=0,b=this.children.length;b>a;a++)this.children[a].updateTransform();this.dirty&&(this.dirty=!1,this.interactionManager.dirty=!0),this.interactive&&this.interactionManager.update()},b.Stage.prototype.setBackgroundColor=function(a){this.backgroundColor=a||0,this.backgroundColorSplit=b.hex2rgb(this.backgroundColor);var c=this.backgroundColor.toString(16);c="000000".substr(0,6-c.length)+c,this.backgroundColorString="#"+c},b.Stage.prototype.getMousePosition=function(){return this.interactionManager.mouse.global},function(a){for(var b=0,c=["ms","moz","webkit","o"],d=0;d>16&255)/255,(a>>8&255)/255,(255&a)/255]},b.rgb2hex=function(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]},"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){return function(a){function b(){for(var d=arguments.length,f=new Array(d);d--;)f[d]=arguments[d];return f=e.concat(f),c.apply(this instanceof b?this:a,f)}var c=this,d=arguments.length-1,e=[];if(d>0)for(e.length=d;d--;)e[d]=arguments[d+1];if("function"!=typeof c)throw new TypeError;return b.prototype=function f(a){return a&&(f.prototype=a),this instanceof f?void 0:new f}(c.prototype),b}}()),b.AjaxRequest=function(){var a=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Microsoft.XMLHTTP"];if(!window.ActiveXObject)return window.XMLHttpRequest?new window.XMLHttpRequest:!1;for(var b=0;b0&&0===(a&a-1))return a;for(var b=1;a>b;)b<<=1;return b},b.isPowerOfTwo=function(a,b){return a>0&&0===(a&a-1)&&b>0&&0===(b&b-1)},b.EventTarget={call:function(a){a&&(a=a.prototype||a,b.EventTarget.mixin(a))},mixin:function(a){a.listeners=function(a){return this._listeners=this._listeners||{},this._listeners[a]?this._listeners[a].slice():[]},a.emit=a.dispatchEvent=function(a,c){if(this._listeners=this._listeners||{},"object"==typeof a&&(c=a,a=a.type),c&&c.__isEventObject===!0||(c=new b.Event(this,a,c)),this._listeners&&this._listeners[a]){var d,e=this._listeners[a].slice(0),f=e.length,g=e[0];for(d=0;f>d;g=e[++d])if(g.call(this,c),c.stoppedImmediate)return this;if(c.stopped)return this}return this.parent&&this.parent.emit&&this.parent.emit.call(this.parent,a,c),this},a.on=a.addEventListener=function(a,b){return this._listeners=this._listeners||{},(this._listeners[a]=this._listeners[a]||[]).push(b),this},a.once=function(a,b){function c(){b.apply(d.off(a,c),arguments)}this._listeners=this._listeners||{};var d=this;return c._originalHandler=b,this.on(a,c)},a.off=a.removeEventListener=function(a,b){if(this._listeners=this._listeners||{},!this._listeners[a])return this;for(var c=this._listeners[a],d=b?c.length:0;d-->0;)(c[d]===b||c[d]._originalHandler===b)&&c.splice(d,1);return 0===c.length&&delete this._listeners[a],this},a.removeAllListeners=function(a){return this._listeners=this._listeners||{},this._listeners[a]?(delete this._listeners[a],this):this}}},b.Event=function(a,b,c){this.__isEventObject=!0,this.stopped=!1,this.stoppedImmediate=!1,this.target=a,this.type=b,this.data=c,this.content=c,this.timeStamp=Date.now()},b.Event.prototype.stopPropagation=function(){this.stopped=!0},b.Event.prototype.stopImmediatePropagation=function(){this.stoppedImmediate=!0},b.autoDetectRenderer=function(a,c,d){a||(a=800),c||(c=600);var e=function(){try{var a=document.createElement("canvas");return!!window.WebGLRenderingContext&&(a.getContext("webgl")||a.getContext("experimental-webgl"))}catch(b){return!1}}();return e?new b.WebGLRenderer(a,c,d):new b.CanvasRenderer(a,c,d)},b.autoDetectRecommendedRenderer=function(a,c,d){a||(a=800),c||(c=600);var e=function(){try{var a=document.createElement("canvas");return!!window.WebGLRenderingContext&&(a.getContext("webgl")||a.getContext("experimental-webgl"))}catch(b){return!1}}(),f=/Android/i.test(navigator.userAgent);return e&&!f?new b.WebGLRenderer(a,c,d):new b.CanvasRenderer(a,c,d)},b.PolyK={},b.PolyK.Triangulate=function(a){var c=!0,d=a.length>>1;if(3>d)return[];for(var e=[],f=[],g=0;d>g;g++)f.push(g);g=0;for(var h=d;h>3;){var i=f[(g+0)%h],j=f[(g+1)%h],k=f[(g+2)%h],l=a[2*i],m=a[2*i+1],n=a[2*j],o=a[2*j+1],p=a[2*k],q=a[2*k+1],r=!1;if(b.PolyK._convex(l,m,n,o,p,q,c)){r=!0;for(var s=0;h>s;s++){var t=f[s];if(t!==i&&t!==j&&t!==k&&b.PolyK._PointInTriangle(a[2*t],a[2*t+1],l,m,n,o,p,q)){r=!1;break}}}if(r)e.push(i,j,k),f.splice((g+1)%h,1),h--,g=0;else if(g++>3*h){if(!c)return null;for(e=[],f=[],g=0;d>g;g++)f.push(g);g=0,h=d,c=!1}}return e.push(f[0],f[1],f[2]),e},b.PolyK._PointInTriangle=function(a,b,c,d,e,f,g,h){var i=g-c,j=h-d,k=e-c,l=f-d,m=a-c,n=b-d,o=i*i+j*j,p=i*k+j*l,q=i*m+j*n,r=k*k+l*l,s=k*m+l*n,t=1/(o*r-p*p),u=(r*q-p*s)*t,v=(o*s-p*q)*t;return u>=0&&v>=0&&1>u+v},b.PolyK._convex=function(a,b,c,d,e,f,g){return(b-d)*(e-c)+(c-a)*(f-d)>=0===g},b.initDefaultShaders=function(){},b.CompileVertexShader=function(a,c){return b._CompileShader(a,c,a.VERTEX_SHADER)},b.CompileFragmentShader=function(a,c){return b._CompileShader(a,c,a.FRAGMENT_SHADER)},b._CompileShader=function(a,b,c){var d=b.join("\n"),e=a.createShader(c);return a.shaderSource(e,d),a.compileShader(e),a.getShaderParameter(e,a.COMPILE_STATUS)?e:(window.console.log(a.getShaderInfoLog(e)),null)},b.compileProgram=function(a,c,d){var e=b.CompileFragmentShader(a,d),f=b.CompileVertexShader(a,c),g=a.createProgram();return a.attachShader(g,f),a.attachShader(g,e),a.linkProgram(g),a.getProgramParameter(g,a.LINK_STATUS)||window.console.log("Could not initialise shaders"),g},b.PixiShader=function(a){this._UID=b._UID++,this.gl=a,this.program=null,this.fragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"],this.textureCount=0,this.firstRun=!0,this.dirty=!0,this.attributes=[],this.init()},b.PixiShader.prototype.constructor=b.PixiShader,b.PixiShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc||b.PixiShader.defaultVertexSrc,this.fragmentSrc);a.useProgram(c),this.uSampler=a.getUniformLocation(c,"uSampler"),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.dimensions=a.getUniformLocation(c,"dimensions"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.aTextureCoord=a.getAttribLocation(c,"aTextureCoord"),this.colorAttribute=a.getAttribLocation(c,"aColor"),-1===this.colorAttribute&&(this.colorAttribute=2),this.attributes=[this.aVertexPosition,this.aTextureCoord,this.colorAttribute];for(var d in this.uniforms)this.uniforms[d].uniformLocation=a.getUniformLocation(c,d);this.initUniforms(),this.program=c},b.PixiShader.prototype.initUniforms=function(){this.textureCount=1;var a,b=this.gl;for(var c in this.uniforms){a=this.uniforms[c];var d=a.type;"sampler2D"===d?(a._init=!1,null!==a.value&&this.initSampler2D(a)):"mat2"===d||"mat3"===d||"mat4"===d?(a.glMatrix=!0,a.glValueLength=1,"mat2"===d?a.glFunc=b.uniformMatrix2fv:"mat3"===d?a.glFunc=b.uniformMatrix3fv:"mat4"===d&&(a.glFunc=b.uniformMatrix4fv)):(a.glFunc=b["uniform"+d],a.glValueLength="2f"===d||"2i"===d?2:"3f"===d||"3i"===d?3:"4f"===d||"4i"===d?4:1)}},b.PixiShader.prototype.initSampler2D=function(a){if(a.value&&a.value.baseTexture&&a.value.baseTexture.hasLoaded){var b=this.gl;if(b.activeTexture(b["TEXTURE"+this.textureCount]),b.bindTexture(b.TEXTURE_2D,a.value.baseTexture._glTextures[b.id]),a.textureData){var c=a.textureData,d=c.magFilter?c.magFilter:b.LINEAR,e=c.minFilter?c.minFilter:b.LINEAR,f=c.wrapS?c.wrapS:b.CLAMP_TO_EDGE,g=c.wrapT?c.wrapT:b.CLAMP_TO_EDGE,h=c.luminance?b.LUMINANCE:b.RGBA;if(c.repeat&&(f=b.REPEAT,g=b.REPEAT),b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!!c.flipY),c.width){var i=c.width?c.width:512,j=c.height?c.height:2,k=c.border?c.border:0;b.texImage2D(b.TEXTURE_2D,0,h,i,j,k,h,b.UNSIGNED_BYTE,null)}else b.texImage2D(b.TEXTURE_2D,0,h,b.RGBA,b.UNSIGNED_BYTE,a.value.baseTexture.source);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,d),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,e),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,f),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,g)}b.uniform1i(a.uniformLocation,this.textureCount),a._init=!0,this.textureCount++}},b.PixiShader.prototype.syncUniforms=function(){this.textureCount=1;var a,c=this.gl;for(var d in this.uniforms)a=this.uniforms[d],1===a.glValueLength?a.glMatrix===!0?a.glFunc.call(c,a.uniformLocation,a.transpose,a.value):a.glFunc.call(c,a.uniformLocation,a.value):2===a.glValueLength?a.glFunc.call(c,a.uniformLocation,a.value.x,a.value.y):3===a.glValueLength?a.glFunc.call(c,a.uniformLocation,a.value.x,a.value.y,a.value.z):4===a.glValueLength?a.glFunc.call(c,a.uniformLocation,a.value.x,a.value.y,a.value.z,a.value.w):"sampler2D"===a.type&&(a._init?(c.activeTexture(c["TEXTURE"+this.textureCount]),a.value.baseTexture._dirty[c.id]?b.instances[c.id].updateTexture(a.value.baseTexture):c.bindTexture(c.TEXTURE_2D,a.value.baseTexture._glTextures[c.id]),c.uniform1i(a.uniformLocation,this.textureCount),this.textureCount++):this.initSampler2D(a))},b.PixiShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},b.PixiShader.defaultVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec4 aColor;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","varying vec2 vTextureCoord;","varying vec4 vColor;","const vec2 center = vec2(-1.0, 1.0);","void main(void) {"," gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = vec4(aColor.rgb * aColor.a, aColor.a);","}"],b.PixiFastShader=function(a){this._UID=b._UID++,this.gl=a,this.program=null,this.fragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform mat3 uMatrix;","varying vec2 vTextureCoord;","varying float vColor;","const vec2 center = vec2(-1.0, 1.0);","void main(void) {"," vec2 v;"," vec2 sv = aVertexPosition * aScale;"," v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);"," v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);"," v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;"," gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"],this.textureCount=0,this.init()},b.PixiFastShader.prototype.constructor=b.PixiFastShader,b.PixiFastShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.uSampler=a.getUniformLocation(c,"uSampler"),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.dimensions=a.getUniformLocation(c,"dimensions"),this.uMatrix=a.getUniformLocation(c,"uMatrix"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.aPositionCoord=a.getAttribLocation(c,"aPositionCoord"),this.aScale=a.getAttribLocation(c,"aScale"),this.aRotation=a.getAttribLocation(c,"aRotation"),this.aTextureCoord=a.getAttribLocation(c,"aTextureCoord"),this.colorAttribute=a.getAttribLocation(c,"aColor"),-1===this.colorAttribute&&(this.colorAttribute=2),this.attributes=[this.aVertexPosition,this.aPositionCoord,this.aScale,this.aRotation,this.aTextureCoord,this.colorAttribute],this.program=c},b.PixiFastShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},b.StripShader=function(a){this._UID=b._UID++,this.gl=a,this.program=null,this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","uniform float alpha;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * alpha;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","varying vec2 vTextureCoord;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);"," vTextureCoord = aTextureCoord;","}"],this.init()},b.StripShader.prototype.constructor=b.StripShader,b.StripShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.uSampler=a.getUniformLocation(c,"uSampler"),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.colorAttribute=a.getAttribLocation(c,"aColor"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.aTextureCoord=a.getAttribLocation(c,"aTextureCoord"),this.attributes=[this.aVertexPosition,this.aTextureCoord],this.translationMatrix=a.getUniformLocation(c,"translationMatrix"),this.alpha=a.getUniformLocation(c,"alpha"),this.program=c},b.StripShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attribute=null},b.PrimitiveShader=function(a){this._UID=b._UID++,this.gl=a,this.program=null,this.fragmentSrc=["precision mediump float;","varying vec4 vColor;","void main(void) {"," gl_FragColor = vColor;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform float alpha;","uniform float flipY;","uniform vec3 tint;","varying vec4 vColor;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);"," vColor = aColor * vec4(tint * alpha, alpha);","}"],this.init()},b.PrimitiveShader.prototype.constructor=b.PrimitiveShader,b.PrimitiveShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.tintColor=a.getUniformLocation(c,"tint"),this.flipY=a.getUniformLocation(c,"flipY"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.colorAttribute=a.getAttribLocation(c,"aColor"),this.attributes=[this.aVertexPosition,this.colorAttribute],this.translationMatrix=a.getUniformLocation(c,"translationMatrix"),this.alpha=a.getUniformLocation(c,"alpha"),this.program=c},b.PrimitiveShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},b.ComplexPrimitiveShader=function(a){this._UID=b._UID++,this.gl=a,this.program=null,this.fragmentSrc=["precision mediump float;","varying vec4 vColor;","void main(void) {"," gl_FragColor = vColor;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform vec3 tint;","uniform float alpha;","uniform vec3 color;","uniform float flipY;","varying vec4 vColor;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);"," vColor = vec4(color * alpha * tint, alpha);","}"],this.init()},b.ComplexPrimitiveShader.prototype.constructor=b.ComplexPrimitiveShader,b.ComplexPrimitiveShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.tintColor=a.getUniformLocation(c,"tint"),this.color=a.getUniformLocation(c,"color"),this.flipY=a.getUniformLocation(c,"flipY"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.attributes=[this.aVertexPosition,this.colorAttribute],this.translationMatrix=a.getUniformLocation(c,"translationMatrix"),this.alpha=a.getUniformLocation(c,"alpha"),this.program=c},b.ComplexPrimitiveShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attribute=null},b.WebGLGraphics=function(){},b.WebGLGraphics.renderGraphics=function(a,c){var d,e=c.gl,f=c.projection,g=c.offset,h=c.shaderManager.primitiveShader;a.dirty&&b.WebGLGraphics.updateGraphics(a,e);for(var i=a._webGL[e.id],j=0;j=6)if(h.points.length<12){g=b.WebGLGraphics.switchMode(d,0);var i=b.WebGLGraphics.buildPoly(h,g);i||(g=b.WebGLGraphics.switchMode(d,1),b.WebGLGraphics.buildComplexPoly(h,g))}else g=b.WebGLGraphics.switchMode(d,1),b.WebGLGraphics.buildComplexPoly(h,g);h.lineWidth>0&&(g=b.WebGLGraphics.switchMode(d,0),b.WebGLGraphics.buildLine(h,g))}else g=b.WebGLGraphics.switchMode(d,0),h.type===b.Graphics.RECT?b.WebGLGraphics.buildRectangle(h,g):h.type===b.Graphics.CIRC||h.type===b.Graphics.ELIP?b.WebGLGraphics.buildCircle(h,g):h.type===b.Graphics.RREC&&b.WebGLGraphics.buildRoundedRectangle(h,g);d.lastIndex++}for(e=0;e=q;q++)p=q/n,h=g(a,c,p),i=g(b,d,p),j=g(c,e,p),k=g(d,f,p),l=g(h,j,p),m=g(i,k,p),o.push(l,m);return o},b.WebGLGraphics.buildCircle=function(a,c){var d,e,f=a.shape,g=f.x,h=f.y;a.type===b.Graphics.CIRC?(d=f.radius,e=f.radius):(d=f.width,e=f.height);var i=40,j=2*Math.PI/i,k=0;if(a.fill){var l=b.hex2rgb(a.fillColor),m=a.fillAlpha,n=l[0]*m,o=l[1]*m,p=l[2]*m,q=c.points,r=c.indices,s=q.length/6;for(r.push(s),k=0;i+1>k;k++)q.push(g,h,n,o,p,m),q.push(g+Math.sin(j*k)*d,h+Math.cos(j*k)*e,n,o,p,m),r.push(s++,s++);r.push(s-1) -}if(a.lineWidth){var t=a.points;for(a.points=[],k=0;i+1>k;k++)a.points.push(g+Math.sin(j*k)*d,h+Math.cos(j*k)*e);b.WebGLGraphics.buildLine(a,c),a.points=t}},b.WebGLGraphics.buildLine=function(a,c){var d=0,e=a.points;if(0!==e.length){if(a.lineWidth%2)for(d=0;dd;d++)l=e[2*(d-1)],m=e[2*(d-1)+1],n=e[2*d],o=e[2*d+1],p=e[2*(d+1)],q=e[2*(d+1)+1],r=-(m-o),s=l-n,F=Math.sqrt(r*r+s*s),r/=F,s/=F,r*=L,s*=L,t=-(o-q),u=n-p,F=Math.sqrt(t*t+u*u),t/=F,u/=F,t*=L,u*=L,x=-s+m-(-s+o),y=-r+n-(-r+l),z=(-r+l)*(-s+o)-(-r+n)*(-s+m),A=-u+q-(-u+o),B=-t+n-(-t+p),C=(-t+p)*(-u+o)-(-t+n)*(-u+q),D=x*B-A*y,Math.abs(D)<.1?(D+=10.1,G.push(n-r,o-s,O,P,Q,N),G.push(n+r,o+s,O,P,Q,N)):(j=(y*C-B*z)/D,k=(A*z-x*C)/D,E=(j-n)*(j-n)+(k-o)+(k-o),E>19600?(v=r-t,w=s-u,F=Math.sqrt(v*v+w*w),v/=F,w/=F,v*=L,w*=L,G.push(n-v,o-w),G.push(O,P,Q,N),G.push(n+v,o+w),G.push(O,P,Q,N),G.push(n-v,o-w),G.push(O,P,Q,N),J++):(G.push(j,k),G.push(O,P,Q,N),G.push(n-(j-n),o-(k-o)),G.push(O,P,Q,N)));for(l=e[2*(I-2)],m=e[2*(I-2)+1],n=e[2*(I-1)],o=e[2*(I-1)+1],r=-(m-o),s=l-n,F=Math.sqrt(r*r+s*s),r/=F,s/=F,r*=L,s*=L,G.push(n-r,o-s),G.push(O,P,Q,N),G.push(n+r,o+s),G.push(O,P,Q,N),H.push(K),d=0;J>d;d++)H.push(K++);H.push(K-1)}},b.WebGLGraphics.buildComplexPoly=function(a,c){var d=a.points.slice();if(!(d.length<6)){var e=c.indices;c.points=d,c.alpha=a.fillAlpha,c.color=b.hex2rgb(a.fillColor);for(var f,g,h=1/0,i=-1/0,j=1/0,k=-1/0,l=0;lf?f:h,i=f>i?f:i,j=j>g?g:j,k=g>k?g:k;d.push(h,j,i,j,i,k,h,k);var m=d.length/2;for(l=0;m>l;l++)e.push(l)}},b.WebGLGraphics.buildPoly=function(a,c){var d=a.points;if(!(d.length<6)){var e=c.points,f=c.indices,g=d.length/2,h=b.hex2rgb(a.fillColor),i=a.fillAlpha,j=h[0]*i,k=h[1]*i,l=h[2]*i,m=b.PolyK.Triangulate(d);if(!m)return!1;var n=e.length/6,o=0;for(o=0;oo;o++)e.push(d[2*o],d[2*o+1],j,k,l,i);return!0}},b.WebGLGraphics.graphicsDataPool=[],b.WebGLGraphicsData=function(a){this.gl=a,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),this.mode=1,this.alpha=1,this.dirty=!0},b.WebGLGraphicsData.prototype.reset=function(){this.points=[],this.indices=[]},b.WebGLGraphicsData.prototype.upload=function(){var a=this.gl;this.glPoints=new b.Float32Array(this.points),a.bindBuffer(a.ARRAY_BUFFER,this.buffer),a.bufferData(a.ARRAY_BUFFER,this.glPoints,a.STATIC_DRAW),this.glIndicies=new b.Uint16Array(this.indices),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.glIndicies,a.STATIC_DRAW),this.dirty=!1},b.glContexts=[],b.instances=[],b.WebGLRenderer=function(a,c,d){if(d)for(var e in b.defaultRenderOptions)"undefined"==typeof d[e]&&(d[e]=b.defaultRenderOptions[e]);else d=b.defaultRenderOptions;b.defaultRenderer||(b.sayHello("webGL"),b.defaultRenderer=this),this.type=b.WEBGL_RENDERER,this.resolution=d.resolution,this.transparent=d.transparent,this.autoResize=d.autoResize||!1,this.preserveDrawingBuffer=d.preserveDrawingBuffer,this.clearBeforeRender=d.clearBeforeRender,this.width=a||800,this.height=c||600,this.view=d.view||document.createElement("canvas"),this.contextLostBound=this.handleContextLost.bind(this),this.contextRestoredBound=this.handleContextRestored.bind(this),this.view.addEventListener("webglcontextlost",this.contextLostBound,!1),this.view.addEventListener("webglcontextrestored",this.contextRestoredBound,!1),this._contextOptions={alpha:this.transparent,antialias:d.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:d.preserveDrawingBuffer},this.projection=new b.Point,this.offset=new b.Point(0,0),this.shaderManager=new b.WebGLShaderManager,this.spriteBatch=new b.WebGLSpriteBatch,this.maskManager=new b.WebGLMaskManager,this.filterManager=new b.WebGLFilterManager,this.stencilManager=new b.WebGLStencilManager,this.blendModeManager=new b.WebGLBlendModeManager,this.renderSession={},this.renderSession.gl=this.gl,this.renderSession.drawCount=0,this.renderSession.shaderManager=this.shaderManager,this.renderSession.maskManager=this.maskManager,this.renderSession.filterManager=this.filterManager,this.renderSession.blendModeManager=this.blendModeManager,this.renderSession.spriteBatch=this.spriteBatch,this.renderSession.stencilManager=this.stencilManager,this.renderSession.renderer=this,this.renderSession.resolution=this.resolution,this.initContext(),this.mapBlendModes()},b.WebGLRenderer.prototype.constructor=b.WebGLRenderer,b.WebGLRenderer.prototype.initContext=function(){var a=this.view.getContext("webgl",this._contextOptions)||this.view.getContext("experimental-webgl",this._contextOptions);if(this.gl=a,!a)throw new Error("This browser does not support webGL. Try using the canvas renderer");this.glContextId=a.id=b.WebGLRenderer.glContextId++,b.glContexts[this.glContextId]=a,b.instances[this.glContextId]=this,a.disable(a.DEPTH_TEST),a.disable(a.CULL_FACE),a.enable(a.BLEND),this.shaderManager.setContext(a),this.spriteBatch.setContext(a),this.maskManager.setContext(a),this.filterManager.setContext(a),this.blendModeManager.setContext(a),this.stencilManager.setContext(a),this.renderSession.gl=this.gl,this.resize(this.width,this.height)},b.WebGLRenderer.prototype.render=function(a){if(!this.contextLost){this.__stage!==a&&(a.interactive&&a.interactionManager.removeEvents(),this.__stage=a),a.updateTransform();var b=this.gl;a._interactive?a._interactiveEventsAdded||(a._interactiveEventsAdded=!0,a.interactionManager.setTarget(this)):a._interactiveEventsAdded&&(a._interactiveEventsAdded=!1,a.interactionManager.setTarget(this)),b.viewport(0,0,this.width,this.height),b.bindFramebuffer(b.FRAMEBUFFER,null),this.clearBeforeRender&&(this.transparent?b.clearColor(0,0,0,0):b.clearColor(a.backgroundColorSplit[0],a.backgroundColorSplit[1],a.backgroundColorSplit[2],1),b.clear(b.COLOR_BUFFER_BIT)),this.renderDisplayObject(a,this.projection)}},b.WebGLRenderer.prototype.renderDisplayObject=function(a,c,d){this.renderSession.blendModeManager.setBlendMode(b.blendModes.NORMAL),this.renderSession.drawCount=0,this.renderSession.flipY=d?-1:1,this.renderSession.projection=c,this.renderSession.offset=this.offset,this.spriteBatch.begin(this.renderSession),this.filterManager.begin(this.renderSession,d),a._renderWebGL(this.renderSession),this.spriteBatch.end()},b.WebGLRenderer.prototype.resize=function(a,b){this.width=a*this.resolution,this.height=b*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px",this.view.style.height=this.height/this.resolution+"px"),this.gl.viewport(0,0,this.width,this.height),this.projection.x=this.width/2/this.resolution,this.projection.y=-this.height/2/this.resolution},b.WebGLRenderer.prototype.updateTexture=function(a){if(a.hasLoaded){var c=this.gl;return a._glTextures[c.id]||(a._glTextures[c.id]=c.createTexture()),c.bindTexture(c.TEXTURE_2D,a._glTextures[c.id]),c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultipliedAlpha),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a.source),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),a.mipmap&&b.isPowerOfTwo(a.width,a.height)?(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR_MIPMAP_LINEAR:c.NEAREST_MIPMAP_NEAREST),c.generateMipmap(c.TEXTURE_2D)):c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),a._powerOf2?(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.REPEAT),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.REPEAT)):(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE)),a._dirty[c.id]=!1,a._glTextures[c.id]}},b.WebGLRenderer.prototype.handleContextLost=function(a){a.preventDefault(),this.contextLost=!0},b.WebGLRenderer.prototype.handleContextRestored=function(){this.initContext();for(var a in b.TextureCache){var c=b.TextureCache[a].baseTexture;c._glTextures=[]}this.contextLost=!1},b.WebGLRenderer.prototype.destroy=function(){this.view.removeEventListener("webglcontextlost",this.contextLostBound),this.view.removeEventListener("webglcontextrestored",this.contextRestoredBound),b.glContexts[this.glContextId]=null,this.projection=null,this.offset=null,this.shaderManager.destroy(),this.spriteBatch.destroy(),this.maskManager.destroy(),this.filterManager.destroy(),this.shaderManager=null,this.spriteBatch=null,this.maskManager=null,this.filterManager=null,this.gl=null,this.renderSession=null},b.WebGLRenderer.prototype.mapBlendModes=function(){var a=this.gl;b.blendModesWebGL||(b.blendModesWebGL=[],b.blendModesWebGL[b.blendModes.NORMAL]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.ADD]=[a.SRC_ALPHA,a.DST_ALPHA],b.blendModesWebGL[b.blendModes.MULTIPLY]=[a.DST_COLOR,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.SCREEN]=[a.SRC_ALPHA,a.ONE],b.blendModesWebGL[b.blendModes.OVERLAY]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.DARKEN]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.LIGHTEN]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.COLOR_DODGE]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.COLOR_BURN]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.HARD_LIGHT]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.SOFT_LIGHT]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.DIFFERENCE]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.EXCLUSION]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.HUE]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.SATURATION]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.COLOR]=[a.ONE,a.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.LUMINOSITY]=[a.ONE,a.ONE_MINUS_SRC_ALPHA])},b.WebGLRenderer.glContextId=0,b.WebGLBlendModeManager=function(){this.currentBlendMode=99999},b.WebGLBlendModeManager.prototype.constructor=b.WebGLBlendModeManager,b.WebGLBlendModeManager.prototype.setContext=function(a){this.gl=a},b.WebGLBlendModeManager.prototype.setBlendMode=function(a){if(this.currentBlendMode===a)return!1;this.currentBlendMode=a;var c=b.blendModesWebGL[this.currentBlendMode];return this.gl.blendFunc(c[0],c[1]),!0},b.WebGLBlendModeManager.prototype.destroy=function(){this.gl=null},b.WebGLMaskManager=function(){},b.WebGLMaskManager.prototype.constructor=b.WebGLMaskManager,b.WebGLMaskManager.prototype.setContext=function(a){this.gl=a},b.WebGLMaskManager.prototype.pushMask=function(a,c){var d=c.gl;a.dirty&&b.WebGLGraphics.updateGraphics(a,d),a._webGL[d.id].data.length&&c.stencilManager.pushStencil(a,a._webGL[d.id].data[0],c)},b.WebGLMaskManager.prototype.popMask=function(a,b){var c=this.gl;b.stencilManager.popStencil(a,a._webGL[c.id].data[0],b)},b.WebGLMaskManager.prototype.destroy=function(){this.gl=null},b.WebGLStencilManager=function(){this.stencilStack=[],this.reverse=!0,this.count=0},b.WebGLStencilManager.prototype.setContext=function(a){this.gl=a},b.WebGLStencilManager.prototype.pushStencil=function(a,b,c){var d=this.gl;this.bindGraphics(a,b,c),0===this.stencilStack.length&&(d.enable(d.STENCIL_TEST),d.clear(d.STENCIL_BUFFER_BIT),this.reverse=!0,this.count=0),this.stencilStack.push(b);var e=this.count;d.colorMask(!1,!1,!1,!1),d.stencilFunc(d.ALWAYS,0,255),d.stencilOp(d.KEEP,d.KEEP,d.INVERT),1===b.mode?(d.drawElements(d.TRIANGLE_FAN,b.indices.length-4,d.UNSIGNED_SHORT,0),this.reverse?(d.stencilFunc(d.EQUAL,255-e,255),d.stencilOp(d.KEEP,d.KEEP,d.DECR)):(d.stencilFunc(d.EQUAL,e,255),d.stencilOp(d.KEEP,d.KEEP,d.INCR)),d.drawElements(d.TRIANGLE_FAN,4,d.UNSIGNED_SHORT,2*(b.indices.length-4)),this.reverse?d.stencilFunc(d.EQUAL,255-(e+1),255):d.stencilFunc(d.EQUAL,e+1,255),this.reverse=!this.reverse):(this.reverse?(d.stencilFunc(d.EQUAL,e,255),d.stencilOp(d.KEEP,d.KEEP,d.INCR)):(d.stencilFunc(d.EQUAL,255-e,255),d.stencilOp(d.KEEP,d.KEEP,d.DECR)),d.drawElements(d.TRIANGLE_STRIP,b.indices.length,d.UNSIGNED_SHORT,0),this.reverse?d.stencilFunc(d.EQUAL,e+1,255):d.stencilFunc(d.EQUAL,255-(e+1),255)),d.colorMask(!0,!0,!0,!0),d.stencilOp(d.KEEP,d.KEEP,d.KEEP),this.count++},b.WebGLStencilManager.prototype.bindGraphics=function(a,c,d){this._currentGraphics=a;var e,f=this.gl,g=d.projection,h=d.offset;1===c.mode?(e=d.shaderManager.complexPrimitiveShader,d.shaderManager.setShader(e),f.uniform1f(e.flipY,d.flipY),f.uniformMatrix3fv(e.translationMatrix,!1,a.worldTransform.toArray(!0)),f.uniform2f(e.projectionVector,g.x,-g.y),f.uniform2f(e.offsetVector,-h.x,-h.y),f.uniform3fv(e.tintColor,b.hex2rgb(a.tint)),f.uniform3fv(e.color,c.color),f.uniform1f(e.alpha,a.worldAlpha*c.alpha),f.bindBuffer(f.ARRAY_BUFFER,c.buffer),f.vertexAttribPointer(e.aVertexPosition,2,f.FLOAT,!1,8,0),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,c.indexBuffer)):(e=d.shaderManager.primitiveShader,d.shaderManager.setShader(e),f.uniformMatrix3fv(e.translationMatrix,!1,a.worldTransform.toArray(!0)),f.uniform1f(e.flipY,d.flipY),f.uniform2f(e.projectionVector,g.x,-g.y),f.uniform2f(e.offsetVector,-h.x,-h.y),f.uniform3fv(e.tintColor,b.hex2rgb(a.tint)),f.uniform1f(e.alpha,a.worldAlpha),f.bindBuffer(f.ARRAY_BUFFER,c.buffer),f.vertexAttribPointer(e.aVertexPosition,2,f.FLOAT,!1,24,0),f.vertexAttribPointer(e.colorAttribute,4,f.FLOAT,!1,24,8),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,c.indexBuffer))},b.WebGLStencilManager.prototype.popStencil=function(a,b,c){var d=this.gl;if(this.stencilStack.pop(),this.count--,0===this.stencilStack.length)d.disable(d.STENCIL_TEST);else{var e=this.count;this.bindGraphics(a,b,c),d.colorMask(!1,!1,!1,!1),1===b.mode?(this.reverse=!this.reverse,this.reverse?(d.stencilFunc(d.EQUAL,255-(e+1),255),d.stencilOp(d.KEEP,d.KEEP,d.INCR)):(d.stencilFunc(d.EQUAL,e+1,255),d.stencilOp(d.KEEP,d.KEEP,d.DECR)),d.drawElements(d.TRIANGLE_FAN,4,d.UNSIGNED_SHORT,2*(b.indices.length-4)),d.stencilFunc(d.ALWAYS,0,255),d.stencilOp(d.KEEP,d.KEEP,d.INVERT),d.drawElements(d.TRIANGLE_FAN,b.indices.length-4,d.UNSIGNED_SHORT,0),this.reverse?d.stencilFunc(d.EQUAL,e,255):d.stencilFunc(d.EQUAL,255-e,255)):(this.reverse?(d.stencilFunc(d.EQUAL,e+1,255),d.stencilOp(d.KEEP,d.KEEP,d.DECR)):(d.stencilFunc(d.EQUAL,255-(e+1),255),d.stencilOp(d.KEEP,d.KEEP,d.INCR)),d.drawElements(d.TRIANGLE_STRIP,b.indices.length,d.UNSIGNED_SHORT,0),this.reverse?d.stencilFunc(d.EQUAL,e,255):d.stencilFunc(d.EQUAL,255-e,255)),d.colorMask(!0,!0,!0,!0),d.stencilOp(d.KEEP,d.KEEP,d.KEEP)}},b.WebGLStencilManager.prototype.destroy=function(){this.stencilStack=null,this.gl=null},b.WebGLShaderManager=function(){this.maxAttibs=10,this.attribState=[],this.tempAttribState=[];for(var a=0;ad;d+=6,e+=4)this.indices[d+0]=e+0,this.indices[d+1]=e+1,this.indices[d+2]=e+2,this.indices[d+3]=e+0,this.indices[d+4]=e+2,this.indices[d+5]=e+3;this.drawing=!1,this.currentBatchSize=0,this.currentBaseTexture=null,this.dirty=!0,this.textures=[],this.blendModes=[],this.shaders=[],this.sprites=[],this.defaultShader=new b.AbstractFilter(["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"])},b.WebGLSpriteBatch.prototype.setContext=function(a){this.gl=a,this.vertexBuffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.indices,a.STATIC_DRAW),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferData(a.ARRAY_BUFFER,this.vertices,a.DYNAMIC_DRAW),this.currentBlendMode=99999;var c=new b.PixiShader(a);c.fragmentSrc=this.defaultShader.fragmentSrc,c.uniforms={},c.init(),this.defaultShader.shaders[a.id]=c},b.WebGLSpriteBatch.prototype.begin=function(a){this.renderSession=a,this.shader=this.renderSession.shaderManager.defaultShader,this.start()},b.WebGLSpriteBatch.prototype.end=function(){this.flush()},b.WebGLSpriteBatch.prototype.render=function(a){var b=a.texture;this.currentBatchSize>=this.size&&(this.flush(),this.currentBaseTexture=b.baseTexture);var c=b._uvs;if(c){var d,e,f,g,h=a.anchor.x,i=a.anchor.y;if(b.trim){var j=b.trim;e=j.x-h*j.width,d=e+b.crop.width,g=j.y-i*j.height,f=g+b.crop.height}else d=b.frame.width*(1-h),e=b.frame.width*-h,f=b.frame.height*(1-i),g=b.frame.height*-i;var k=4*this.currentBatchSize*this.vertSize,l=b.baseTexture.resolution,m=a.worldTransform,n=m.a/l,o=m.b/l,p=m.c/l,q=m.d/l,r=m.tx,s=m.ty,t=this.colors,u=this.positions;this.renderSession.roundPixels?(u[k]=n*e+p*g+r|0,u[k+1]=q*g+o*e+s|0,u[k+5]=n*d+p*g+r|0,u[k+6]=q*g+o*d+s|0,u[k+10]=n*d+p*f+r|0,u[k+11]=q*f+o*d+s|0,u[k+15]=n*e+p*f+r|0,u[k+16]=q*f+o*e+s|0):(u[k]=n*e+p*g+r,u[k+1]=q*g+o*e+s,u[k+5]=n*d+p*g+r,u[k+6]=q*g+o*d+s,u[k+10]=n*d+p*f+r,u[k+11]=q*f+o*d+s,u[k+15]=n*e+p*f+r,u[k+16]=q*f+o*e+s),u[k+2]=c.x0,u[k+3]=c.y0,u[k+7]=c.x1,u[k+8]=c.y1,u[k+12]=c.x2,u[k+13]=c.y2,u[k+17]=c.x3,u[k+18]=c.y3;var v=a.tint;t[k+4]=t[k+9]=t[k+14]=t[k+19]=(v>>16)+(65280&v)+((255&v)<<16)+(255*a.worldAlpha<<24),this.sprites[this.currentBatchSize++]=a}},b.WebGLSpriteBatch.prototype.renderTilingSprite=function(a){var c=a.tilingTexture;this.currentBatchSize>=this.size&&(this.flush(),this.currentBaseTexture=c.baseTexture),a._uvs||(a._uvs=new b.TextureUvs);var d=a._uvs;a.tilePosition.x%=c.baseTexture.width*a.tileScaleOffset.x,a.tilePosition.y%=c.baseTexture.height*a.tileScaleOffset.y;var e=a.tilePosition.x/(c.baseTexture.width*a.tileScaleOffset.x),f=a.tilePosition.y/(c.baseTexture.height*a.tileScaleOffset.y),g=a.width/c.baseTexture.width/(a.tileScale.x*a.tileScaleOffset.x),h=a.height/c.baseTexture.height/(a.tileScale.y*a.tileScaleOffset.y);d.x0=0-e,d.y0=0-f,d.x1=1*g-e,d.y1=0-f,d.x2=1*g-e,d.y2=1*h-f,d.x3=0-e,d.y3=1*h-f;var i=a.tint,j=(i>>16)+(65280&i)+((255&i)<<16)+(255*a.alpha<<24),k=this.positions,l=this.colors,m=a.width,n=a.height,o=a.anchor.x,p=a.anchor.y,q=m*(1-o),r=m*-o,s=n*(1-p),t=n*-p,u=4*this.currentBatchSize*this.vertSize,v=c.baseTexture.resolution,w=a.worldTransform,x=w.a/v,y=w.b/v,z=w.c/v,A=w.d/v,B=w.tx,C=w.ty;k[u++]=x*r+z*t+B,k[u++]=A*t+y*r+C,k[u++]=d.x0,k[u++]=d.y0,l[u++]=j,k[u++]=x*q+z*t+B,k[u++]=A*t+y*q+C,k[u++]=d.x1,k[u++]=d.y1,l[u++]=j,k[u++]=x*q+z*s+B,k[u++]=A*s+y*q+C,k[u++]=d.x2,k[u++]=d.y2,l[u++]=j,k[u++]=x*r+z*s+B,k[u++]=A*s+y*r+C,k[u++]=d.x3,k[u++]=d.y3,l[u++]=j,this.sprites[this.currentBatchSize++]=a},b.WebGLSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var a,c=this.gl;if(this.dirty){this.dirty=!1,c.activeTexture(c.TEXTURE0),c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a=this.defaultShader.shaders[c.id];var d=4*this.vertSize;c.vertexAttribPointer(a.aVertexPosition,2,c.FLOAT,!1,d,0),c.vertexAttribPointer(a.aTextureCoord,2,c.FLOAT,!1,d,8),c.vertexAttribPointer(a.colorAttribute,4,c.UNSIGNED_BYTE,!0,d,16)}if(this.currentBatchSize>.5*this.size)c.bufferSubData(c.ARRAY_BUFFER,0,this.vertices);else{var e=this.positions.subarray(0,4*this.currentBatchSize*this.vertSize);c.bufferSubData(c.ARRAY_BUFFER,0,e)}for(var f,g,h,i,j=0,k=0,l=null,m=this.renderSession.blendModeManager.currentBlendMode,n=null,o=!1,p=!1,q=0,r=this.currentBatchSize;r>q;q++){if(i=this.sprites[q],f=i.texture.baseTexture,g=i.blendMode,h=i.shader||this.defaultShader,o=m!==g,p=n!==h,(l!==f||o||p)&&(this.renderBatch(l,j,k),k=q,j=0,l=f,o&&(m=g,this.renderSession.blendModeManager.setBlendMode(m)),p)){n=h,a=n.shaders[c.id],a||(a=new b.PixiShader(c),a.fragmentSrc=n.fragmentSrc,a.uniforms=n.uniforms,a.init(),n.shaders[c.id]=a),this.renderSession.shaderManager.setShader(a),a.dirty&&a.syncUniforms();var s=this.renderSession.projection;c.uniform2f(a.projectionVector,s.x,s.y);var t=this.renderSession.offset;c.uniform2f(a.offsetVector,t.x,t.y)}j++}this.renderBatch(l,j,k),this.currentBatchSize=0}},b.WebGLSpriteBatch.prototype.renderBatch=function(a,b,c){if(0!==b){var d=this.gl;a._dirty[d.id]?this.renderSession.renderer.updateTexture(a):d.bindTexture(d.TEXTURE_2D,a._glTextures[d.id]),d.drawElements(d.TRIANGLES,6*b,d.UNSIGNED_SHORT,6*c*2),this.renderSession.drawCount++}},b.WebGLSpriteBatch.prototype.stop=function(){this.flush(),this.dirty=!0},b.WebGLSpriteBatch.prototype.start=function(){this.dirty=!0},b.WebGLSpriteBatch.prototype.destroy=function(){this.vertices=null,this.indices=null,this.gl.deleteBuffer(this.vertexBuffer),this.gl.deleteBuffer(this.indexBuffer),this.currentBaseTexture=null,this.gl=null},b.WebGLFastSpriteBatch=function(a){this.vertSize=10,this.maxSize=6e3,this.size=this.maxSize;var c=4*this.size*this.vertSize,d=6*this.maxSize;this.vertices=new b.Float32Array(c),this.indices=new b.Uint16Array(d),this.vertexBuffer=null,this.indexBuffer=null,this.lastIndexCount=0;for(var e=0,f=0;d>e;e+=6,f+=4)this.indices[e+0]=f+0,this.indices[e+1]=f+1,this.indices[e+2]=f+2,this.indices[e+3]=f+0,this.indices[e+4]=f+2,this.indices[e+5]=f+3;this.drawing=!1,this.currentBatchSize=0,this.currentBaseTexture=null,this.currentBlendMode=0,this.renderSession=null,this.shader=null,this.matrix=null,this.setContext(a)},b.WebGLFastSpriteBatch.prototype.constructor=b.WebGLFastSpriteBatch,b.WebGLFastSpriteBatch.prototype.setContext=function(a){this.gl=a,this.vertexBuffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.indices,a.STATIC_DRAW),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferData(a.ARRAY_BUFFER,this.vertices,a.DYNAMIC_DRAW)},b.WebGLFastSpriteBatch.prototype.begin=function(a,b){this.renderSession=b,this.shader=this.renderSession.shaderManager.fastShader,this.matrix=a.worldTransform.toArray(!0),this.start()},b.WebGLFastSpriteBatch.prototype.end=function(){this.flush()},b.WebGLFastSpriteBatch.prototype.render=function(a){var b=a.children,c=b[0];if(c.texture._uvs){this.currentBaseTexture=c.texture.baseTexture,c.blendMode!==this.renderSession.blendModeManager.currentBlendMode&&(this.flush(),this.renderSession.blendModeManager.setBlendMode(c.blendMode));for(var d=0,e=b.length;e>d;d++)this.renderSprite(b[d]);this.flush()}},b.WebGLFastSpriteBatch.prototype.renderSprite=function(a){if(a.visible&&(a.texture.baseTexture===this.currentBaseTexture||(this.flush(),this.currentBaseTexture=a.texture.baseTexture,a.texture._uvs))){var b,c,d,e,f,g,h,i,j=this.vertices;if(b=a.texture._uvs,c=a.texture.frame.width,d=a.texture.frame.height,a.texture.trim){var k=a.texture.trim;f=k.x-a.anchor.x*k.width,e=f+a.texture.crop.width,h=k.y-a.anchor.y*k.height,g=h+a.texture.crop.height}else e=a.texture.frame.width*(1-a.anchor.x),f=a.texture.frame.width*-a.anchor.x,g=a.texture.frame.height*(1-a.anchor.y),h=a.texture.frame.height*-a.anchor.y;i=4*this.currentBatchSize*this.vertSize,j[i++]=f,j[i++]=h,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b.x0,j[i++]=b.y1,j[i++]=a.alpha,j[i++]=e,j[i++]=h,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b.x1,j[i++]=b.y1,j[i++]=a.alpha,j[i++]=e,j[i++]=g,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b.x2,j[i++]=b.y2,j[i++]=a.alpha,j[i++]=f,j[i++]=g,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b.x3,j[i++]=b.y3,j[i++]=a.alpha,this.currentBatchSize++,this.currentBatchSize>=this.size&&this.flush()}},b.WebGLFastSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var a=this.gl;if(this.currentBaseTexture._glTextures[a.id]||this.renderSession.renderer.updateTexture(this.currentBaseTexture,a),a.bindTexture(a.TEXTURE_2D,this.currentBaseTexture._glTextures[a.id]),this.currentBatchSize>.5*this.size)a.bufferSubData(a.ARRAY_BUFFER,0,this.vertices);else{var b=this.vertices.subarray(0,4*this.currentBatchSize*this.vertSize);a.bufferSubData(a.ARRAY_BUFFER,0,b)}a.drawElements(a.TRIANGLES,6*this.currentBatchSize,a.UNSIGNED_SHORT,0),this.currentBatchSize=0,this.renderSession.drawCount++}},b.WebGLFastSpriteBatch.prototype.stop=function(){this.flush()},b.WebGLFastSpriteBatch.prototype.start=function(){var a=this.gl;a.activeTexture(a.TEXTURE0),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var b=this.renderSession.projection;a.uniform2f(this.shader.projectionVector,b.x,b.y),a.uniformMatrix3fv(this.shader.uMatrix,!1,this.matrix);var c=4*this.vertSize;a.vertexAttribPointer(this.shader.aVertexPosition,2,a.FLOAT,!1,c,0),a.vertexAttribPointer(this.shader.aPositionCoord,2,a.FLOAT,!1,c,8),a.vertexAttribPointer(this.shader.aScale,2,a.FLOAT,!1,c,16),a.vertexAttribPointer(this.shader.aRotation,1,a.FLOAT,!1,c,24),a.vertexAttribPointer(this.shader.aTextureCoord,2,a.FLOAT,!1,c,28),a.vertexAttribPointer(this.shader.colorAttribute,1,a.FLOAT,!1,c,36)},b.WebGLFilterManager=function(){this.filterStack=[],this.offsetX=0,this.offsetY=0},b.WebGLFilterManager.prototype.constructor=b.WebGLFilterManager,b.WebGLFilterManager.prototype.setContext=function(a){this.gl=a,this.texturePool=[],this.initShaderBuffers()},b.WebGLFilterManager.prototype.begin=function(a,b){this.renderSession=a,this.defaultShader=a.shaderManager.defaultShader;var c=this.renderSession.projection;this.width=2*c.x,this.height=2*-c.y,this.buffer=b},b.WebGLFilterManager.prototype.pushFilter=function(a){var c=this.gl,d=this.renderSession.projection,e=this.renderSession.offset;a._filterArea=a.target.filterArea||a.target.getBounds(),this.filterStack.push(a);var f=a.filterPasses[0];this.offsetX+=a._filterArea.x,this.offsetY+=a._filterArea.y;var g=this.texturePool.pop();g?g.resize(this.width,this.height):g=new b.FilterTexture(this.gl,this.width,this.height),c.bindTexture(c.TEXTURE_2D,g.texture);var h=a._filterArea,i=f.padding;h.x-=i,h.y-=i,h.width+=2*i,h.height+=2*i,h.x<0&&(h.x=0),h.width>this.width&&(h.width=this.width),h.y<0&&(h.y=0),h.height>this.height&&(h.height=this.height),c.bindFramebuffer(c.FRAMEBUFFER,g.frameBuffer),c.viewport(0,0,h.width,h.height),d.x=h.width/2,d.y=-h.height/2,e.x=-h.x,e.y=-h.y,c.colorMask(!0,!0,!0,!0),c.clearColor(0,0,0,0),c.clear(c.COLOR_BUFFER_BIT),a._glFilterTexture=g},b.WebGLFilterManager.prototype.popFilter=function(){var a=this.gl,c=this.filterStack.pop(),d=c._filterArea,e=c._glFilterTexture,f=this.renderSession.projection,g=this.renderSession.offset;if(c.filterPasses.length>1){a.viewport(0,0,d.width,d.height),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),this.vertexArray[0]=0,this.vertexArray[1]=d.height,this.vertexArray[2]=d.width,this.vertexArray[3]=d.height,this.vertexArray[4]=0,this.vertexArray[5]=0,this.vertexArray[6]=d.width,this.vertexArray[7]=0,a.bufferSubData(a.ARRAY_BUFFER,0,this.vertexArray),a.bindBuffer(a.ARRAY_BUFFER,this.uvBuffer),this.uvArray[2]=d.width/this.width,this.uvArray[5]=d.height/this.height,this.uvArray[6]=d.width/this.width,this.uvArray[7]=d.height/this.height,a.bufferSubData(a.ARRAY_BUFFER,0,this.uvArray);var h=e,i=this.texturePool.pop();i||(i=new b.FilterTexture(this.gl,this.width,this.height)),i.resize(this.width,this.height),a.bindFramebuffer(a.FRAMEBUFFER,i.frameBuffer),a.clear(a.COLOR_BUFFER_BIT),a.disable(a.BLEND);for(var j=0;jB?B:A,c.beginPath(),c.moveTo(w,x+A),c.lineTo(w,x+z-A),c.quadraticCurveTo(w,x+z,w+A,x+z),c.lineTo(w+y-A,x+z),c.quadraticCurveTo(w+y,x+z,w+y,x+z-A),c.lineTo(w+y,x+A),c.quadraticCurveTo(w+y,x,w+y-A,x),c.lineTo(w+A,x),c.quadraticCurveTo(w,x,w,x+A),c.closePath(),(f.fillColor||0===f.fillColor)&&(c.globalAlpha=f.fillAlpha*d,c.fillStyle="#"+("00000"+(0|h).toString(16)).substr(-6),c.fill()),f.lineWidth&&(c.globalAlpha=f.lineAlpha*d,c.strokeStyle="#"+("00000"+(0|i).toString(16)).substr(-6),c.stroke())}}},b.CanvasGraphics.renderGraphicsMask=function(a,c){var d=a.graphicsData.length;if(0!==d){d>1&&(d=1,window.console.log("Pixi.js warning: masks in canvas can only mask using the first path in the graphics object"));for(var e=0;1>e;e++){var f=a.graphicsData[e],g=f.shape;if(f.type===b.Graphics.POLY){c.beginPath();var h=g.points;c.moveTo(h[0],h[1]);for(var i=1;iA?A:z,c.beginPath(),c.moveTo(v,w+z),c.lineTo(v,w+y-z),c.quadraticCurveTo(v,w+y,v+z,w+y),c.lineTo(v+x-z,w+y),c.quadraticCurveTo(v+x,w+y,v+x,w+y-z),c.lineTo(v+x,w+z),c.quadraticCurveTo(v+x,w,v+x-z,w),c.lineTo(v+z,w),c.quadraticCurveTo(v,w,v,w+z),c.closePath()}}}},b.CanvasGraphics.updateGraphicsTint=function(a){if(16777215!==a.tint)for(var b=(a.tint>>16&255)/255,c=(a.tint>>8&255)/255,d=(255&a.tint)/255,e=0;e>16&255)/255*b*255<<16)+((g>>8&255)/255*c*255<<8)+(255&g)/255*d*255,f._lineTint=((h>>16&255)/255*b*255<<16)+((h>>8&255)/255*c*255<<8)+(255&h)/255*d*255}},b.Graphics=function(){b.DisplayObjectContainer.call(this),this.renderable=!0,this.fillAlpha=1,this.lineWidth=0,this.lineColor=0,this.graphicsData=[],this.tint=16777215,this.blendMode=b.blendModes.NORMAL,this.currentPath=null,this._webGL=[],this.isMask=!1,this.boundsPadding=0,this._localBounds=new b.Rectangle(0,0,1,1),this.dirty=!0,this.webGLDirty=!1,this.cachedSpriteDirty=!1},b.Graphics.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Graphics.prototype.constructor=b.Graphics,Object.defineProperty(b.Graphics.prototype,"cacheAsBitmap",{get:function(){return this._cacheAsBitmap},set:function(a){this._cacheAsBitmap=a,this._cacheAsBitmap?this._generateCachedSprite():(this.destroyCachedSprite(),this.dirty=!0)}}),b.Graphics.prototype.lineStyle=function(a,c,d){if(this.lineWidth=a||0,this.lineColor=c||0,this.lineAlpha=arguments.length<3?1:d,this.currentPath){if(this.currentPath.shape.points.length)return this.drawShape(new b.Polygon(this.currentPath.shape.points.slice(-2))),this;this.currentPath.lineWidth=this.lineWidth,this.currentPath.lineColor=this.lineColor,this.currentPath.lineAlpha=this.lineAlpha}return this},b.Graphics.prototype.moveTo=function(a,c){return this.drawShape(new b.Polygon([a,c])),this},b.Graphics.prototype.lineTo=function(a,b){return this.currentPath.shape.points.push(a,b),this.dirty=!0,this},b.Graphics.prototype.quadraticCurveTo=function(a,b,c,d){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);var e,f,g=20,h=this.currentPath.shape.points;0===h.length&&this.moveTo(0,0);for(var i=h[h.length-2],j=h[h.length-1],k=0,l=1;g>=l;l++)k=l/g,e=i+(a-i)*k,f=j+(b-j)*k,h.push(e+(a+(c-a)*k-e)*k,f+(b+(d-b)*k-f)*k);return this.dirty=!0,this},b.Graphics.prototype.bezierCurveTo=function(a,b,c,d,e,f){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);for(var g,h,i,j,k,l=20,m=this.currentPath.shape.points,n=m[m.length-2],o=m[m.length-1],p=0,q=1;l>=q;q++)p=q/l,g=1-p,h=g*g,i=h*g,j=p*p,k=j*p,m.push(i*n+3*h*p*a+3*g*j*c+k*e,i*o+3*h*p*b+3*g*j*d+k*f);return this.dirty=!0,this},b.Graphics.prototype.arcTo=function(a,b,c,d,e){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(a,b):this.moveTo(a,b);var f=this.currentPath.shape.points,g=f[f.length-2],h=f[f.length-1],i=h-b,j=g-a,k=d-b,l=c-a,m=Math.abs(i*l-j*k);if(1e-8>m||0===e)(f[f.length-2]!==a||f[f.length-1]!==b)&&f.push(a,b);else{var n=i*i+j*j,o=k*k+l*l,p=i*k+j*l,q=e*Math.sqrt(n)/m,r=e*Math.sqrt(o)/m,s=q*p/n,t=r*p/o,u=q*l+r*j,v=q*k+r*i,w=j*(r+s),x=i*(r+s),y=l*(q+t),z=k*(q+t),A=Math.atan2(x-v,w-u),B=Math.atan2(z-v,y-u);this.arc(u+a,v+b,e,A,B,j*k>l*i)}return this.dirty=!0,this},b.Graphics.prototype.arc=function(a,b,c,d,e,f){var g,h=a+Math.cos(d)*c,i=b+Math.sin(d)*c;if(this.currentPath?(g=this.currentPath.shape.points,0===g.length?g.push(h,i):(g[g.length-2]!==h||g[g.length-1]!==i)&&g.push(h,i)):(this.moveTo(h,i),g=this.currentPath.shape.points),d===e)return this;!f&&d>=e?e+=2*Math.PI:f&&e>=d&&(d+=2*Math.PI);var j=f?-1*(d-e):e-d,k=Math.abs(j)/(2*Math.PI)*40;if(0===j)return this;for(var l=j/(2*k),m=2*l,n=Math.cos(l),o=Math.sin(l),p=k-1,q=p%1/p,r=0;p>=r;r++){var s=r+q*r,t=l+d+m*s,u=Math.cos(t),v=-Math.sin(t);g.push((n*u+o*v)*c+a,(n*-v+o*u)*c+b)}return this.dirty=!0,this},b.Graphics.prototype.beginFill=function(a,b){return this.filling=!0,this.fillColor=a||0,this.fillAlpha=void 0===b?1:b,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},b.Graphics.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},b.Graphics.prototype.drawRect=function(a,c,d,e){return this.drawShape(new b.Rectangle(a,c,d,e)),this},b.Graphics.prototype.drawRoundedRect=function(a,c,d,e,f){return this.drawShape(new b.RoundedRectangle(a,c,d,e,f)),this},b.Graphics.prototype.drawCircle=function(a,c,d){return this.drawShape(new b.Circle(a,c,d)),this},b.Graphics.prototype.drawEllipse=function(a,c,d,e){return this.drawShape(new b.Ellipse(a,c,d,e)),this},b.Graphics.prototype.drawPolygon=function(a){return a instanceof Array||(a=Array.prototype.slice.call(arguments)),this.drawShape(new b.Polygon(a)),this},b.Graphics.prototype.clear=function(){return this.lineWidth=0,this.filling=!1,this.dirty=!0,this.clearDirty=!0,this.graphicsData=[],this},b.Graphics.prototype.generateTexture=function(a,c){a=a||1;var d=this.getBounds(),e=new b.CanvasBuffer(d.width*a,d.height*a),f=b.Texture.fromCanvas(e.canvas,c);return f.baseTexture.resolution=a,e.context.scale(a,a),e.context.translate(-d.x,-d.y),b.CanvasGraphics.renderGraphics(this,e.context),f},b.Graphics.prototype._renderWebGL=function(a){if(this.visible!==!1&&0!==this.alpha&&this.isMask!==!0){if(this._cacheAsBitmap)return(this.dirty||this.cachedSpriteDirty)&&(this._generateCachedSprite(),this.updateCachedSpriteTexture(),this.cachedSpriteDirty=!1,this.dirty=!1),this._cachedSprite.worldAlpha=this.worldAlpha,void b.Sprite.prototype._renderWebGL.call(this._cachedSprite,a);if(a.spriteBatch.stop(),a.blendModeManager.setBlendMode(this.blendMode),this._mask&&a.maskManager.pushMask(this._mask,a),this._filters&&a.filterManager.pushFilter(this._filterBlock),this.blendMode!==a.spriteBatch.currentBlendMode){a.spriteBatch.currentBlendMode=this.blendMode;var c=b.blendModesWebGL[a.spriteBatch.currentBlendMode];a.spriteBatch.gl.blendFunc(c[0],c[1])}if(this.webGLDirty&&(this.dirty=!0,this.webGLDirty=!1),b.WebGLGraphics.renderGraphics(this,a),this.children.length){a.spriteBatch.start();for(var d=0,e=this.children.length;e>d;d++)this.children[d]._renderWebGL(a);a.spriteBatch.stop()}this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(this.mask,a),a.drawCount++,a.spriteBatch.start()}},b.Graphics.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha&&this.isMask!==!0){if(this._cacheAsBitmap)return(this.dirty||this.cachedSpriteDirty)&&(this._generateCachedSprite(),this.updateCachedSpriteTexture(),this.cachedSpriteDirty=!1,this.dirty=!1),this._cachedSprite.alpha=this.alpha,void b.Sprite.prototype._renderCanvas.call(this._cachedSprite,a);var c=a.context,d=this.worldTransform;this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,c.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]),this._mask&&a.maskManager.pushMask(this._mask,a);var e=a.resolution;c.setTransform(d.a*e,d.b*e,d.c*e,d.d*e,d.tx*e,d.ty*e),b.CanvasGraphics.renderGraphics(this,c);for(var f=0,g=this.children.length;g>f;f++)this.children[f]._renderCanvas(a);this._mask&&a.maskManager.popMask(a)}},b.Graphics.prototype.getBounds=function(a){if(this.isMask)return b.EmptyRectangle;this.dirty&&(this.updateLocalBounds(),this.webGLDirty=!0,this.cachedSpriteDirty=!0,this.dirty=!1);var c=this._localBounds,d=c.x,e=c.width+c.x,f=c.y,g=c.height+c.y,h=a||this.worldTransform,i=h.a,j=h.b,k=h.c,l=h.d,m=h.tx,n=h.ty,o=i*e+k*g+m,p=l*g+j*e+n,q=i*d+k*g+m,r=l*g+j*d+n,s=i*d+k*f+m,t=l*f+j*d+n,u=i*e+k*f+m,v=l*f+j*e+n,w=o,x=p,y=o,z=p;return y=y>q?q:y,y=y>s?s:y,y=y>u?u:y,z=z>r?r:z,z=z>t?t:z,z=z>v?v:z,w=q>w?q:w,w=s>w?s:w,w=u>w?u:w,x=r>x?r:x,x=t>x?t:x,x=v>x?v:x,this._bounds.x=y,this._bounds.width=w-y,this._bounds.y=z,this._bounds.height=x-z,this._bounds},b.Graphics.prototype.updateLocalBounds=function(){var a=1/0,c=-1/0,d=1/0,e=-1/0;if(this.graphicsData.length)for(var f,g,h,i,j,k,l=0;lh?h:a,c=h+j>c?h+j:c,d=d>i?i:d,e=i+k>e?i+k:e;else if(n===b.Graphics.CIRC)h=f.x,i=f.y,j=f.radius+o/2,k=f.radius+o/2,a=a>h-j?h-j:a,c=h+j>c?h+j:c,d=d>i-k?i-k:d,e=i+k>e?i+k:e;else if(n===b.Graphics.ELIP)h=f.x,i=f.y,j=f.width+o/2,k=f.height+o/2,a=a>h-j?h-j:a,c=h+j>c?h+j:c,d=d>i-k?i-k:d,e=i+k>e?i+k:e;else{g=f.points;for(var p=0;ph-o?h-o:a,c=h+o>c?h+o:c,d=d>i-o?i-o:d,e=i+o>e?i+o:e}}else a=0,c=0,d=0,e=0;var q=this.boundsPadding;this._localBounds.x=a-q,this._localBounds.width=c-a+2*q,this._localBounds.y=d-q,this._localBounds.height=e-d+2*q},b.Graphics.prototype._generateCachedSprite=function(){var a=this.getLocalBounds();if(this._cachedSprite)this._cachedSprite.buffer.resize(a.width,a.height);else{var c=new b.CanvasBuffer(a.width,a.height),d=b.Texture.fromCanvas(c.canvas);this._cachedSprite=new b.Sprite(d),this._cachedSprite.buffer=c,this._cachedSprite.worldTransform=this.worldTransform}this._cachedSprite.anchor.x=-(a.x/a.width),this._cachedSprite.anchor.y=-(a.y/a.height),this._cachedSprite.buffer.context.translate(-a.x,-a.y),this.worldAlpha=1,b.CanvasGraphics.renderGraphics(this,this._cachedSprite.buffer.context),this._cachedSprite.alpha=this.alpha},b.Graphics.prototype.updateCachedSpriteTexture=function(){var a=this._cachedSprite,b=a.texture,c=a.buffer.canvas;b.baseTexture.width=c.width,b.baseTexture.height=c.height,b.crop.width=b.frame.width=c.width,b.crop.height=b.frame.height=c.height,a._width=c.width,a._height=c.height,b.baseTexture.dirty()},b.Graphics.prototype.destroyCachedSprite=function(){this._cachedSprite.texture.destroy(!0),this._cachedSprite=null},b.Graphics.prototype.drawShape=function(a){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null;var c=new b.GraphicsData(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,a);return this.graphicsData.push(c),c.type===b.Graphics.POLY&&(c.shape.closed=this.filling,this.currentPath=c),this.dirty=!0,c},b.GraphicsData=function(a,b,c,d,e,f,g){this.lineWidth=a,this.lineColor=b,this.lineAlpha=c,this._lineTint=b,this.fillColor=d,this.fillAlpha=e,this._fillTint=d,this.fill=f,this.shape=g,this.type=g.type},b.Graphics.POLY=0,b.Graphics.RECT=1,b.Graphics.CIRC=2,b.Graphics.ELIP=3,b.Graphics.RREC=4,b.Polygon.prototype.type=b.Graphics.POLY,b.Rectangle.prototype.type=b.Graphics.RECT,b.Circle.prototype.type=b.Graphics.CIRC,b.Ellipse.prototype.type=b.Graphics.ELIP,b.RoundedRectangle.prototype.type=b.Graphics.RREC,b.Strip=function(a){b.DisplayObjectContainer.call(this),this.texture=a,this.uvs=new b.Float32Array([0,1,1,1,1,0,0,1]),this.vertices=new b.Float32Array([0,0,100,0,100,100,0,100]),this.colors=new b.Float32Array([1,1,1,1]),this.indices=new b.Uint16Array([0,1,2,3]),this.dirty=!0,this.blendMode=b.blendModes.NORMAL,this.canvasPadding=0,this.drawMode=b.Strip.DrawModes.TRIANGLE_STRIP},b.Strip.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Strip.prototype.constructor=b.Strip,b.Strip.prototype._renderWebGL=function(a){!this.visible||this.alpha<=0||(a.spriteBatch.stop(),this._vertexBuffer||this._initWebGL(a),a.shaderManager.setShader(a.shaderManager.stripShader),this._renderStrip(a),a.spriteBatch.start())},b.Strip.prototype._initWebGL=function(a){var b=a.gl;this._vertexBuffer=b.createBuffer(),this._indexBuffer=b.createBuffer(),this._uvBuffer=b.createBuffer(),this._colorBuffer=b.createBuffer(),b.bindBuffer(b.ARRAY_BUFFER,this._vertexBuffer),b.bufferData(b.ARRAY_BUFFER,this.vertices,b.DYNAMIC_DRAW),b.bindBuffer(b.ARRAY_BUFFER,this._uvBuffer),b.bufferData(b.ARRAY_BUFFER,this.uvs,b.STATIC_DRAW),b.bindBuffer(b.ARRAY_BUFFER,this._colorBuffer),b.bufferData(b.ARRAY_BUFFER,this.colors,b.STATIC_DRAW),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this._indexBuffer),b.bufferData(b.ELEMENT_ARRAY_BUFFER,this.indices,b.STATIC_DRAW)},b.Strip.prototype._renderStrip=function(a){var c=a.gl,d=a.projection,e=a.offset,f=a.shaderManager.stripShader,g=this.drawMode===b.Strip.DrawModes.TRIANGLE_STRIP?c.TRIANGLE_STRIP:c.TRIANGLES;a.blendModeManager.setBlendMode(this.blendMode),c.uniformMatrix3fv(f.translationMatrix,!1,this.worldTransform.toArray(!0)),c.uniform2f(f.projectionVector,d.x,-d.y),c.uniform2f(f.offsetVector,-e.x,-e.y),c.uniform1f(f.alpha,this.worldAlpha),this.dirty?(this.dirty=!1,c.bindBuffer(c.ARRAY_BUFFER,this._vertexBuffer),c.bufferData(c.ARRAY_BUFFER,this.vertices,c.STATIC_DRAW),c.vertexAttribPointer(f.aVertexPosition,2,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,this._uvBuffer),c.bufferData(c.ARRAY_BUFFER,this.uvs,c.STATIC_DRAW),c.vertexAttribPointer(f.aTextureCoord,2,c.FLOAT,!1,0,0),c.activeTexture(c.TEXTURE0),this.texture.baseTexture._dirty[c.id]?a.renderer.updateTexture(this.texture.baseTexture):c.bindTexture(c.TEXTURE_2D,this.texture.baseTexture._glTextures[c.id]),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this._indexBuffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,this.indices,c.STATIC_DRAW)):(c.bindBuffer(c.ARRAY_BUFFER,this._vertexBuffer),c.bufferSubData(c.ARRAY_BUFFER,0,this.vertices),c.vertexAttribPointer(f.aVertexPosition,2,c.FLOAT,!1,0,0),c.bindBuffer(c.ARRAY_BUFFER,this._uvBuffer),c.vertexAttribPointer(f.aTextureCoord,2,c.FLOAT,!1,0,0),c.activeTexture(c.TEXTURE0),this.texture.baseTexture._dirty[c.id]?a.renderer.updateTexture(this.texture.baseTexture):c.bindTexture(c.TEXTURE_2D,this.texture.baseTexture._glTextures[c.id]),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this._indexBuffer)),c.drawElements(g,this.indices.length,c.UNSIGNED_SHORT,0)},b.Strip.prototype._renderCanvas=function(a){var c=a.context,d=this.worldTransform;a.roundPixels?c.setTransform(d.a,d.b,d.c,d.d,0|d.tx,0|d.ty):c.setTransform(d.a,d.b,d.c,d.d,d.tx,d.ty),this.drawMode===b.Strip.DrawModes.TRIANGLE_STRIP?this._renderCanvasTriangleStrip(c):this._renderCanvasTriangles(c)},b.Strip.prototype._renderCanvasTriangleStrip=function(a){var b=this.vertices,c=this.uvs,d=b.length/2;this.count++;for(var e=0;d-2>e;e++){var f=2*e;this._renderCanvasDrawTriangle(a,b,c,f,f+2,f+4)}},b.Strip.prototype._renderCanvasTriangles=function(a){var b=this.vertices,c=this.uvs,d=this.indices,e=d.length;this.count++;for(var f=0;e>f;f+=3){var g=2*d[f],h=2*d[f+1],i=2*d[f+2];this._renderCanvasDrawTriangle(a,b,c,g,h,i)}},b.Strip.prototype._renderCanvasDrawTriangle=function(a,b,c,d,e,f){var g=this.texture.baseTexture.source,h=this.texture.width,i=this.texture.height,j=b[d],k=b[e],l=b[f],m=b[d+1],n=b[e+1],o=b[f+1],p=c[d]*h,q=c[e]*h,r=c[f]*h,s=c[d+1]*i,t=c[e+1]*i,u=c[f+1]*i;if(this.canvasPadding>0){var v=this.canvasPadding/this.worldTransform.a,w=this.canvasPadding/this.worldTransform.d,x=(j+k+l)/3,y=(m+n+o)/3,z=j-x,A=m-y,B=Math.sqrt(z*z+A*A);j=x+z/B*(B+v),m=y+A/B*(B+w),z=k-x,A=n-y,B=Math.sqrt(z*z+A*A),k=x+z/B*(B+v),n=y+A/B*(B+w),z=l-x,A=o-y,B=Math.sqrt(z*z+A*A),l=x+z/B*(B+v),o=y+A/B*(B+w)}a.save(),a.beginPath(),a.moveTo(j,m),a.lineTo(k,n),a.lineTo(l,o),a.closePath(),a.clip();var C=p*t+s*r+q*u-t*r-s*q-p*u,D=j*t+s*l+k*u-t*l-s*k-j*u,E=p*k+j*r+q*l-k*r-j*q-p*l,F=p*t*l+s*k*r+j*q*u-j*t*r-s*q*l-p*k*u,G=m*t+s*o+n*u-t*o-s*n-m*u,H=p*n+m*r+q*o-n*r-m*q-p*o,I=p*t*o+s*n*r+m*q*u-m*t*r-s*q*o-p*n*u;a.transform(D/C,G/C,E/C,H/C,F/C,I/C),a.drawImage(g,0,0),a.restore()},b.Strip.prototype.renderStripFlat=function(a){var b=this.context,c=a.vertices,d=c.length/2;this.count++,b.beginPath();for(var e=1;d-2>e;e++){var f=2*e,g=c[f],h=c[f+2],i=c[f+4],j=c[f+1],k=c[f+3],l=c[f+5];b.moveTo(g,j),b.lineTo(h,k),b.lineTo(i,l)}b.fillStyle="#FF0000",b.fill(),b.closePath()},b.Strip.prototype.onTextureUpdate=function(){this.updateFrame=!0},b.Strip.prototype.getBounds=function(a){for(var c=a||this.worldTransform,d=c.a,e=c.b,f=c.c,g=c.d,h=c.tx,i=c.ty,j=-1/0,k=-1/0,l=1/0,m=1/0,n=this.vertices,o=0,p=n.length;p>o;o+=2){var q=n[o],r=n[o+1],s=d*q+f*r+h,t=g*r+e*q+i;l=l>s?s:l,m=m>t?t:m,j=s>j?s:j,k=t>k?t:k}if(l===-1/0||1/0===k)return b.EmptyRectangle;var u=this._bounds;return u.x=l,u.width=j-l,u.y=m,u.height=k-m,this._currentBounds=u,u},b.Strip.DrawModes={TRIANGLE_STRIP:0,TRIANGLES:1},b.Rope=function(a,c){b.Strip.call(this,a),this.points=c,this.vertices=new b.Float32Array(4*c.length),this.uvs=new b.Float32Array(4*c.length),this.colors=new b.Float32Array(2*c.length),this.indices=new b.Uint16Array(2*c.length),this.refresh()},b.Rope.prototype=Object.create(b.Strip.prototype),b.Rope.prototype.constructor=b.Rope,b.Rope.prototype.refresh=function(){var a=this.points;if(!(a.length<1)){var b=this.uvs,c=a[0],d=this.indices,e=this.colors;this.count-=.2,b[0]=0,b[1]=0,b[2]=0,b[3]=1,e[0]=1,e[1]=1,d[0]=0,d[1]=1;for(var f,g,h,i=a.length,j=1;i>j;j++)f=a[j],g=4*j,h=j/(i-1),j%2?(b[g]=h,b[g+1]=0,b[g+2]=h,b[g+3]=1):(b[g]=h,b[g+1]=0,b[g+2]=h,b[g+3]=1),g=2*j,e[g]=1,e[g+1]=1,g=2*j,d[g]=g,d[g+1]=g+1,c=f}},b.Rope.prototype.updateTransform=function(){var a=this.points;if(!(a.length<1)){var c,d=a[0],e={x:0,y:0};this.count-=.2;for(var f,g,h,i,j,k=this.vertices,l=a.length,m=0;l>m;m++)f=a[m],g=4*m,c=m1&&(h=1),i=Math.sqrt(e.x*e.x+e.y*e.y),j=this.texture.height/2,e.x/=i,e.y/=i,e.x*=j,e.y*=j,k[g]=f.x+e.x,k[g+1]=f.y+e.y,k[g+2]=f.x-e.x,k[g+3]=f.y-e.y,d=f;b.DisplayObjectContainer.prototype.updateTransform.call(this)}},b.Rope.prototype.setTexture=function(a){this.texture=a},b.TilingSprite=function(a,c,d){b.Sprite.call(this,a),this._width=c||100,this._height=d||100,this.tileScale=new b.Point(1,1),this.tileScaleOffset=new b.Point(1,1),this.tilePosition=new b.Point(0,0),this.renderable=!0,this.tint=16777215,this.blendMode=b.blendModes.NORMAL},b.TilingSprite.prototype=Object.create(b.Sprite.prototype),b.TilingSprite.prototype.constructor=b.TilingSprite,Object.defineProperty(b.TilingSprite.prototype,"width",{get:function(){return this._width},set:function(a){this._width=a}}),Object.defineProperty(b.TilingSprite.prototype,"height",{get:function(){return this._height},set:function(a){this._height=a}}),b.TilingSprite.prototype.setTexture=function(a){this.texture!==a&&(this.texture=a,this.refreshTexture=!0,this.cachedTint=16777215)},b.TilingSprite.prototype._renderWebGL=function(a){if(this.visible!==!1&&0!==this.alpha){var b,c;for(this._mask&&(a.spriteBatch.stop(),a.maskManager.pushMask(this.mask,a),a.spriteBatch.start()),this._filters&&(a.spriteBatch.flush(),a.filterManager.pushFilter(this._filterBlock)),!this.tilingTexture||this.refreshTexture?(this.generateTilingTexture(!0),this.tilingTexture&&this.tilingTexture.needsUpdate&&(a.renderer.updateTexture(this.tilingTexture.baseTexture),this.tilingTexture.needsUpdate=!1)):a.spriteBatch.renderTilingSprite(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a); -a.spriteBatch.stop(),this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(this._mask,a),a.spriteBatch.start()}},b.TilingSprite.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){var c=a.context;this._mask&&a.maskManager.pushMask(this._mask,a),c.globalAlpha=this.worldAlpha;var d,e,f=this.worldTransform,g=a.resolution;if(c.setTransform(f.a*g,f.b*g,f.c*g,f.d*g,f.tx*g,f.ty*g),!this.__tilePattern||this.refreshTexture){if(this.generateTilingTexture(!1),!this.tilingTexture)return;this.__tilePattern=c.createPattern(this.tilingTexture.baseTexture.source,"repeat")}this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,c.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]);var h=this.tilePosition,i=this.tileScale;for(h.x%=this.tilingTexture.baseTexture.width,h.y%=this.tilingTexture.baseTexture.height,c.scale(i.x,i.y),c.translate(h.x+this.anchor.x*-this._width,h.y+this.anchor.y*-this._height),c.fillStyle=this.__tilePattern,c.fillRect(-h.x,-h.y,this._width/i.x,this._height/i.y),c.scale(1/i.x,1/i.y),c.translate(-h.x+this.anchor.x*this._width,-h.y+this.anchor.y*this._height),this._mask&&a.maskManager.popMask(a),d=0,e=this.children.length;e>d;d++)this.children[d]._renderCanvas(a)}},b.TilingSprite.prototype.getBounds=function(){var a=this._width,b=this._height,c=a*(1-this.anchor.x),d=a*-this.anchor.x,e=b*(1-this.anchor.y),f=b*-this.anchor.y,g=this.worldTransform,h=g.a,i=g.b,j=g.c,k=g.d,l=g.tx,m=g.ty,n=h*d+j*f+l,o=k*f+i*d+m,p=h*c+j*f+l,q=k*f+i*c+m,r=h*c+j*e+l,s=k*e+i*c+m,t=h*d+j*e+l,u=k*e+i*d+m,v=-1/0,w=-1/0,x=1/0,y=1/0;x=x>n?n:x,x=x>p?p:x,x=x>r?r:x,x=x>t?t:x,y=y>o?o:y,y=y>q?q:y,y=y>s?s:y,y=y>u?u:y,v=n>v?n:v,v=p>v?p:v,v=r>v?r:v,v=t>v?t:v,w=o>w?o:w,w=q>w?q:w,w=s>w?s:w,w=u>w?u:w;var z=this._bounds;return z.x=x,z.width=v-x,z.y=y,z.height=w-y,this._currentBounds=z,z},b.TilingSprite.prototype.onTextureUpdate=function(){},b.TilingSprite.prototype.generateTilingTexture=function(a){if(this.texture.baseTexture.hasLoaded){var c,d,e=this.originalTexture||this.texture,f=e.frame,g=f.width!==e.baseTexture.width||f.height!==e.baseTexture.height,h=!1;if(a?(c=b.getNextPowerOfTwo(f.width),d=b.getNextPowerOfTwo(f.height),(f.width!==c||f.height!==d||e.baseTexture.width!==c||e.baseTexture.height||d)&&(h=!0)):g&&(e.trim?(c=e.trim.width,d=e.trim.height):(c=f.width,d=f.height),h=!0),h){var i;this.tilingTexture&&this.tilingTexture.isTiling?(i=this.tilingTexture.canvasBuffer,i.resize(c,d),this.tilingTexture.baseTexture.width=c,this.tilingTexture.baseTexture.height=d,this.tilingTexture.needsUpdate=!0):(i=new b.CanvasBuffer(c,d),this.tilingTexture=b.Texture.fromCanvas(i.canvas),this.tilingTexture.canvasBuffer=i,this.tilingTexture.isTiling=!0),i.context.drawImage(e.baseTexture.source,e.crop.x,e.crop.y,e.crop.width,e.crop.height,0,0,c,d),this.tileScaleOffset.x=f.width/c,this.tileScaleOffset.y=f.height/d}else this.tilingTexture&&this.tilingTexture.isTiling&&this.tilingTexture.destroy(!0),this.tileScaleOffset.x=1,this.tileScaleOffset.y=1,this.tilingTexture=e;this.refreshTexture=!1,this.originalTexture=this.texture,this.texture=this.tilingTexture,this.tilingTexture.baseTexture._powerOf2=!0}},b.TilingSprite.prototype.destroy=function(){b.Sprite.prototype.destroy.call(this),this.tileScale=null,this.tileScaleOffset=null,this.tilePosition=null,this.tilingTexture.destroy(!0),this.tilingTexture=null};var c={radDeg:180/Math.PI,degRad:Math.PI/180,temp:[],Float32Array:"undefined"==typeof Float32Array?Array:Float32Array,Uint16Array:"undefined"==typeof Uint16Array?Array:Uint16Array};c.BoneData=function(a,b){this.name=a,this.parent=b},c.BoneData.prototype={length:0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,inheritScale:!0,inheritRotation:!0,flipX:!1,flipY:!1},c.SlotData=function(a,b){this.name=a,this.boneData=b},c.SlotData.prototype={r:1,g:1,b:1,a:1,attachmentName:null,additiveBlending:!1},c.IkConstraintData=function(a){this.name=a,this.bones=[]},c.IkConstraintData.prototype={target:null,bendDirection:1,mix:1},c.Bone=function(a,b,c){this.data=a,this.skeleton=b,this.parent=c,this.setToSetupPose()},c.Bone.yDown=!1,c.Bone.prototype={x:0,y:0,rotation:0,rotationIK:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,m00:0,m01:0,worldX:0,m10:0,m11:0,worldY:0,worldRotation:0,worldScaleX:1,worldScaleY:1,worldFlipX:!1,worldFlipY:!1,updateWorldTransform:function(){var a=this.parent;if(a)this.worldX=this.x*a.m00+this.y*a.m01+a.worldX,this.worldY=this.x*a.m10+this.y*a.m11+a.worldY,this.data.inheritScale?(this.worldScaleX=a.worldScaleX*this.scaleX,this.worldScaleY=a.worldScaleY*this.scaleY):(this.worldScaleX=this.scaleX,this.worldScaleY=this.scaleY),this.worldRotation=this.data.inheritRotation?a.worldRotation+this.rotationIK:this.rotationIK,this.worldFlipX=a.worldFlipX!=this.flipX,this.worldFlipY=a.worldFlipY!=this.flipY;else{var b=this.skeleton.flipX,d=this.skeleton.flipY;this.worldX=b?-this.x:this.x,this.worldY=d!=c.Bone.yDown?-this.y:this.y,this.worldScaleX=this.scaleX,this.worldScaleY=this.scaleY,this.worldRotation=this.rotationIK,this.worldFlipX=b!=this.flipX,this.worldFlipY=d!=this.flipY}var e=this.worldRotation*c.degRad,f=Math.cos(e),g=Math.sin(e);this.worldFlipX?(this.m00=-f*this.worldScaleX,this.m01=g*this.worldScaleY):(this.m00=f*this.worldScaleX,this.m01=-g*this.worldScaleY),this.worldFlipY!=c.Bone.yDown?(this.m10=-g*this.worldScaleX,this.m11=-f*this.worldScaleY):(this.m10=g*this.worldScaleX,this.m11=f*this.worldScaleY)},setToSetupPose:function(){var a=this.data;this.x=a.x,this.y=a.y,this.rotation=a.rotation,this.rotationIK=this.rotation,this.scaleX=a.scaleX,this.scaleY=a.scaleY,this.flipX=a.flipX,this.flipY=a.flipY},worldToLocal:function(a){var b=a[0]-this.worldX,d=a[1]-this.worldY,e=this.m00,f=this.m10,g=this.m01,h=this.m11;this.worldFlipX!=(this.worldFlipY!=c.Bone.yDown)&&(e=-e,h=-h);var i=1/(e*h-g*f);a[0]=b*e*i-d*g*i,a[1]=d*h*i-b*f*i},localToWorld:function(a){var b=a[0],c=a[1];a[0]=b*this.m00+c*this.m01+this.worldX,a[1]=b*this.m10+c*this.m11+this.worldY}},c.Slot=function(a,b){this.data=a,this.bone=b,this.setToSetupPose()},c.Slot.prototype={r:1,g:1,b:1,a:1,_attachmentTime:0,attachment:null,attachmentVertices:[],setAttachment:function(a){this.attachment=a,this._attachmentTime=this.bone.skeleton.time,this.attachmentVertices.length=0},setAttachmentTime:function(a){this._attachmentTime=this.bone.skeleton.time-a},getAttachmentTime:function(){return this.bone.skeleton.time-this._attachmentTime},setToSetupPose:function(){var a=this.data;this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a;for(var b=this.bone.skeleton.data.slots,c=0,d=b.length;d>c;c++)if(b[c]==a){this.setAttachment(a.attachmentName?this.bone.skeleton.getAttachmentBySlotIndex(c,a.attachmentName):null);break}}},c.IkConstraint=function(a,b){this.data=a,this.mix=a.mix,this.bendDirection=a.bendDirection,this.bones=[];for(var c=0,d=a.bones.length;d>c;c++)this.bones.push(b.findBone(a.bones[c].name));this.target=b.findBone(a.target.name)},c.IkConstraint.prototype={apply:function(){var a=this.target,b=this.bones;switch(b.length){case 1:c.IkConstraint.apply1(b[0],a.worldX,a.worldY,this.mix);break;case 2:c.IkConstraint.apply2(b[0],b[1],a.worldX,a.worldY,this.bendDirection,this.mix)}}},c.IkConstraint.apply1=function(a,b,d,e){var f=a.data.inheritRotation&&a.parent?a.parent.worldRotation:0,g=a.rotation,h=Math.atan2(d-a.worldY,b-a.worldX)*c.radDeg-f;a.rotationIK=g+(h-g)*e},c.IkConstraint.apply2=function(a,b,d,e,f,g){var h=b.rotation,i=a.rotation;if(!g)return b.rotationIK=h,void(a.rotationIK=i);var j,k,l=c.temp,m=a.parent;m?(l[0]=d,l[1]=e,m.worldToLocal(l),d=(l[0]-a.x)*m.worldScaleX,e=(l[1]-a.y)*m.worldScaleY):(d-=a.x,e-=a.y),b.parent==a?(j=b.x,k=b.y):(l[0]=b.x,l[1]=b.y,b.parent.localToWorld(l),a.worldToLocal(l),j=l[0],k=l[1]);var n=j*a.worldScaleX,o=k*a.worldScaleY,p=Math.atan2(o,n),q=Math.sqrt(n*n+o*o),r=b.data.length*b.worldScaleX,s=2*q*r;if(1e-4>s)return void(b.rotationIK=h+(Math.atan2(e,d)*c.radDeg-i-h)*g);var t=(d*d+e*e-q*q-r*r)/s;-1>t?t=-1:t>1&&(t=1);var u=Math.acos(t)*f,v=q+r*t,w=r*Math.sin(u),x=Math.atan2(e*v-d*w,d*v+e*w),y=(x-p)*c.radDeg-i;y>180?y-=360:-180>y&&(y+=360),a.rotationIK=i+y*g,y=(u+p)*c.radDeg-h,y>180?y-=360:-180>y&&(y+=360),b.rotationIK=h+(y+a.worldRotation-b.parent.worldRotation)*g},c.Skin=function(a){this.name=a,this.attachments={}},c.Skin.prototype={addAttachment:function(a,b,c){this.attachments[a+":"+b]=c},getAttachment:function(a,b){return this.attachments[a+":"+b]},_attachAll:function(a,b){for(var c in b.attachments){var d=c.indexOf(":"),e=parseInt(c.substring(0,d)),f=c.substring(d+1),g=a.slots[e];if(g.attachment&&g.attachment.name==f){var h=this.getAttachment(e,f);h&&g.setAttachment(h)}}}},c.Animation=function(a,b,c){this.name=a,this.timelines=b,this.duration=c},c.Animation.prototype={apply:function(a,b,c,d,e){d&&0!=this.duration&&(c%=this.duration,b%=this.duration);for(var f=this.timelines,g=0,h=f.length;h>g;g++)f[g].apply(a,b,c,e,1)},mix:function(a,b,c,d,e,f){d&&0!=this.duration&&(c%=this.duration,b%=this.duration);for(var g=this.timelines,h=0,i=g.length;i>h;h++)g[h].apply(a,b,c,e,f)}},c.Animation.binarySearch=function(a,b,c){var d=0,e=Math.floor(a.length/c)-2;if(!e)return c;for(var f=e>>>1;;){if(a[(f+1)*c]<=b?d=f+1:e=f,d==e)return(d+1)*c;f=d+e>>>1}},c.Animation.binarySearch1=function(a,b){var c=0,d=a.length-2;if(!d)return 1;for(var e=d>>>1;;){if(a[e+1]<=b?c=e+1:d=e,c==d)return c+1;e=c+d>>>1}},c.Animation.linearSearch=function(a,b,c){for(var d=0,e=a.length-c;e>=d;d+=c)if(a[d]>b)return d;return-1},c.Curves=function(){this.curves=[]},c.Curves.prototype={setLinear:function(a){this.curves[19*a]=0},setStepped:function(a){this.curves[19*a]=1},setCurve:function(a,b,c,d,e){var f=.1,g=f*f,h=g*f,i=3*f,j=3*g,k=6*g,l=6*h,m=2*-b+d,n=2*-c+e,o=3*(b-d)+1,p=3*(c-e)+1,q=b*i+m*j+o*h,r=c*i+n*j+p*h,s=m*k+o*l,t=n*k+p*l,u=o*l,v=p*l,w=19*a,x=this.curves;x[w++]=2;for(var y=q,z=r,A=w+19-1;A>w;w+=2)x[w]=y,x[w+1]=z,q+=s,r+=t,s+=u,t+=v,y+=q,z+=r},getCurvePercent:function(a,b){b=0>b?0:b>1?1:b;var c=this.curves,d=19*a,e=c[d];if(0===e)return b;if(1==e)return 0;d++;for(var f=0,g=d,h=d+19-1;h>d;d+=2)if(f=c[d],f>=b){var i,j;return d==g?(i=0,j=0):(i=c[d-2],j=c[d-1]),j+(c[d+1]-j)*(b-i)/(f-i)}var k=c[d-1];return k+(1-k)*(b-f)/(1-f)}},c.RotateTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=2*a},c.RotateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(a,b,c){a*=2,this.frames[a]=b,this.frames[a+1]=c},apply:function(a,b,d,e,f){var g=this.frames;if(!(d=g[g.length-2]){for(var i=h.data.rotation+g[g.length-1]-h.rotation;i>180;)i-=360;for(;-180>i;)i+=360;return void(h.rotation+=i*f)}var j=c.Animation.binarySearch(g,d,2),k=g[j-1],l=g[j],m=1-(d-l)/(g[j-2]-l);m=this.curves.getCurvePercent(j/2-1,m);for(var i=g[j+1]-k;i>180;)i-=360;for(;-180>i;)i+=360;for(i=h.data.rotation+(k+i*m)-h.rotation;i>180;)i-=360;for(;-180>i;)i+=360;h.rotation+=i*f}}},c.TranslateTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=3*a},c.TranslateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(a,b,c,d){a*=3,this.frames[a]=b,this.frames[a+1]=c,this.frames[a+2]=d},apply:function(a,b,d,e,f){var g=this.frames;if(!(d=g[g.length-3])return h.x+=(h.data.x+g[g.length-2]-h.x)*f,void(h.y+=(h.data.y+g[g.length-1]-h.y)*f);var i=c.Animation.binarySearch(g,d,3),j=g[i-2],k=g[i-1],l=g[i],m=1-(d-l)/(g[i+-3]-l);m=this.curves.getCurvePercent(i/3-1,m),h.x+=(h.data.x+j+(g[i+1]-j)*m-h.x)*f,h.y+=(h.data.y+k+(g[i+2]-k)*m-h.y)*f}}},c.ScaleTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=3*a},c.ScaleTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(a,b,c,d){a*=3,this.frames[a]=b,this.frames[a+1]=c,this.frames[a+2]=d},apply:function(a,b,d,e,f){var g=this.frames;if(!(d=g[g.length-3])return h.scaleX+=(h.data.scaleX*g[g.length-2]-h.scaleX)*f,void(h.scaleY+=(h.data.scaleY*g[g.length-1]-h.scaleY)*f);var i=c.Animation.binarySearch(g,d,3),j=g[i-2],k=g[i-1],l=g[i],m=1-(d-l)/(g[i+-3]-l);m=this.curves.getCurvePercent(i/3-1,m),h.scaleX+=(h.data.scaleX*(j+(g[i+1]-j)*m)-h.scaleX)*f,h.scaleY+=(h.data.scaleY*(k+(g[i+2]-k)*m)-h.scaleY)*f}}},c.ColorTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=5*a},c.ColorTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/5},setFrame:function(a,b,c,d,e,f){a*=5,this.frames[a]=b,this.frames[a+1]=c,this.frames[a+2]=d,this.frames[a+3]=e,this.frames[a+4]=f},apply:function(a,b,d,e,f){var g=this.frames;if(!(d=g[g.length-5]){var l=g.length-1;h=g[l-3],i=g[l-2],j=g[l-1],k=g[l]}else{var m=c.Animation.binarySearch(g,d,5),n=g[m-4],o=g[m-3],p=g[m-2],q=g[m-1],r=g[m],s=1-(d-r)/(g[m-5]-r);s=this.curves.getCurvePercent(m/5-1,s),h=n+(g[m+1]-n)*s,i=o+(g[m+2]-o)*s,j=p+(g[m+3]-p)*s,k=q+(g[m+4]-q)*s}var t=a.slots[this.slotIndex];1>f?(t.r+=(h-t.r)*f,t.g+=(i-t.g)*f,t.b+=(j-t.b)*f,t.a+=(k-t.a)*f):(t.r=h,t.g=i,t.b=j,t.a=k)}}},c.AttachmentTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=a,this.attachmentNames=[],this.attachmentNames.length=a},c.AttachmentTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length},setFrame:function(a,b,c){this.frames[a]=b,this.attachmentNames[a]=c},apply:function(a,b,d){var e=this.frames;if(dd&&this.apply(a,b,Number.MAX_VALUE,null,0));b>d&&(b=-1);var f=d>=e[e.length-1]?e.length-1:c.Animation.binarySearch1(e,d)-1;if(!(e[f]d)this.apply(a,b,Number.MAX_VALUE,e,f),b=-1;else if(b>=g[h-1])return;if(!(d0&&g[i-1]==j;)i--}for(var k=this.events;h>i&&d>=g[i];i++)e.push(k[i])}}}},c.DrawOrderTimeline=function(a){this.frames=[],this.frames.length=a,this.drawOrders=[],this.drawOrders.length=a},c.DrawOrderTimeline.prototype={getFrameCount:function(){return this.frames.length},setFrame:function(a,b,c){this.frames[a]=b,this.drawOrders[a]=c},apply:function(a,b,d){var e=this.frames;if(!(d=e[e.length-1]?e.length-1:c.Animation.binarySearch1(e,d)-1;var g=a.drawOrder,h=a.slots,i=this.drawOrders[f];if(i)for(var j=0,k=i.length;k>j;j++)g[j]=a.slots[i[j]];else for(var j=0,k=h.length;k>j;j++)g[j]=h[j]}}},c.FfdTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=a,this.frameVertices=[],this.frameVertices.length=a},c.FfdTimeline.prototype={slotIndex:0,attachment:0,getFrameCount:function(){return this.frames.length},setFrame:function(a,b,c){this.frames[a]=b,this.frameVertices[a]=c},apply:function(a,b,d,e,f){var g=a.slots[this.slotIndex];if(g.attachment==this.attachment){var h=this.frames;if(!(d=h[h.length-1]){var l=i[h.length-1];if(1>f)for(var m=0;j>m;m++)k[m]+=(l[m]-k[m])*f;else for(var m=0;j>m;m++)k[m]=l[m]}else{var n=c.Animation.binarySearch1(h,d),o=h[n],p=1-(d-o)/(h[n-1]-o);p=this.curves.getCurvePercent(n-1,0>p?0:p>1?1:p);var q=i[n-1],r=i[n];if(1>f)for(var m=0;j>m;m++){var s=q[m];k[m]+=(s+(r[m]-s)*p-k[m])*f}else for(var m=0;j>m;m++){var s=q[m];k[m]=s+(r[m]-s)*p}}}}}},c.IkConstraintTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=3*a},c.IkConstraintTimeline.prototype={ikConstraintIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(a,b,c,d){a*=3,this.frames[a]=b,this.frames[a+1]=c,this.frames[a+2]=d},apply:function(a,b,d,e,f){var g=this.frames;if(!(d=g[g.length-3])return h.mix+=(g[g.length-2]-h.mix)*f,void(h.bendDirection=g[g.length-1]);var i=c.Animation.binarySearch(g,d,3),j=g[i+-2],k=g[i],l=1-(d-k)/(g[i+-3]-k);l=this.curves.getCurvePercent(i/3-1,l);var m=j+(g[i+1]-j)*l;h.mix+=(m-h.mix)*f,h.bendDirection=g[i+-1]}}},c.FlipXTimeline=function(a){this.curves=new c.Curves(a),this.frames=[],this.frames.length=2*a},c.FlipXTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(a,b,c){a*=2,this.frames[a]=b,this.frames[a+1]=c?1:0},apply:function(a,b,d){var e=this.frames;if(dd&&this.apply(a,b,Number.MAX_VALUE,null,0));b>d&&(b=-1);var f=(d>=e[e.length-2]?e.length:c.Animation.binarySearch(e,d,2))-2;e[f]d&&this.apply(a,b,Number.MAX_VALUE,null,0));b>d&&(b=-1);var f=(d>=e[e.length-2]?e.length:c.Animation.binarySearch(e,d,2))-2;e[f]c;c++)if(b[c].name==a)return b[c];return null},findBoneIndex:function(a){for(var b=this.bones,c=0,d=b.length;d>c;c++)if(b[c].name==a)return c;return-1},findSlot:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].name==a)return slot[c];return null},findSlotIndex:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].name==a)return c;return-1},findSkin:function(a){for(var b=this.skins,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},findEvent:function(a){for(var b=this.events,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},findAnimation:function(a){for(var b=this.animations,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},findIkConstraint:function(a){for(var b=this.ikConstraints,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null}},c.Skeleton=function(a){this.data=a,this.bones=[];for(var b=0,d=a.bones.length;d>b;b++){var e=a.bones[b],f=e.parent?this.bones[a.bones.indexOf(e.parent)]:null;this.bones.push(new c.Bone(e,this,f))}this.slots=[],this.drawOrder=[];for(var b=0,d=a.slots.length;d>b;b++){var g=a.slots[b],h=this.bones[a.bones.indexOf(g.boneData)],i=new c.Slot(g,h);this.slots.push(i),this.drawOrder.push(i)}this.ikConstraints=[];for(var b=0,d=a.ikConstraints.length;d>b;b++)this.ikConstraints.push(new c.IkConstraint(a.ikConstraints[b],this));this.boneCache=[],this.updateCache()},c.Skeleton.prototype={x:0,y:0,skin:null,r:1,g:1,b:1,a:1,time:0,flipX:!1,flipY:!1,updateCache:function(){var a=this.ikConstraints,b=a.length,c=b+1,d=this.boneCache;d.length>c&&(d.length=c);for(var e=0,f=d.length;f>e;e++)d[e].length=0;for(;d.lengthe;e++){var i=h[e],j=i;do{for(var k=0;b>k;k++)for(var l=a[k],m=l.bones[0],n=l.bones[l.bones.length-1];;){if(j==n){d[k].push(i),d[k+1].push(i);continue a}if(n==m)break;n=n.parent}j=j.parent}while(j);g[g.length]=i}},updateWorldTransform:function(){for(var a=this.bones,b=0,c=a.length;c>b;b++){var d=a[b];d.rotationIK=d.rotation}for(var b=0,e=this.boneCache.length-1;;){for(var f=this.boneCache[b],g=0,h=f.length;h>g;g++)f[g].updateWorldTransform();if(b==e)break;this.ikConstraints[b].apply(),b++}},setToSetupPose:function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},setBonesToSetupPose:function(){for(var a=this.bones,b=0,c=a.length;c>b;b++)a[b].setToSetupPose();for(var d=this.ikConstraints,b=0,c=d.length;c>b;b++){var e=d[b];e.bendDirection=e.data.bendDirection,e.mix=e.data.mix}},setSlotsToSetupPose:function(){for(var a=this.slots,b=this.drawOrder,c=0,d=a.length;d>c;c++)b[c]=a[c],a[c].setToSetupPose(c)},getRootBone:function(){return this.bones.length?this.bones[0]:null},findBone:function(a){for(var b=this.bones,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return b[c];return null},findBoneIndex:function(a){for(var b=this.bones,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return c;return-1},findSlot:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return b[c];return null},findSlotIndex:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return c;return-1},setSkinByName:function(a){var b=this.data.findSkin(a);if(!b)throw"Skin not found: "+a;this.setSkin(b)},setSkin:function(a){if(a)if(this.skin)a._attachAll(this,this.skin);else for(var b=this.slots,c=0,d=b.length;d>c;c++){var e=b[c],f=e.data.attachmentName;if(f){var g=a.getAttachment(c,f);g&&e.setAttachment(g)}}this.skin=a},getAttachmentBySlotName:function(a,b){return this.getAttachmentBySlotIndex(this.data.findSlotIndex(a),b)},getAttachmentBySlotIndex:function(a,b){if(this.skin){var c=this.skin.getAttachment(a,b);if(c)return c}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(a,b):null},setAttachment:function(a,b){for(var c=this.slots,d=0,e=c.length;e>d;d++){var f=c[d];if(f.data.name==a){var g=null;if(b&&(g=this.getAttachmentBySlotIndex(d,b),!g))throw"Attachment not found: "+b+", for slot: "+a;return void f.setAttachment(g)}}throw"Slot not found: "+a},findIkConstraint:function(a){for(var b=this.ikConstraints,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return b[c];return null},update:function(a){this.time+=a}},c.EventData=function(a){this.name=a},c.EventData.prototype={intValue:0,floatValue:0,stringValue:null},c.Event=function(a){this.data=a},c.Event.prototype={intValue:0,floatValue:0,stringValue:null},c.AttachmentType={region:0,boundingbox:1,mesh:2,skinnedmesh:3},c.RegionAttachment=function(a){this.name=a,this.offset=[],this.offset.length=8,this.uvs=[],this.uvs.length=8},c.RegionAttachment.prototype={type:c.AttachmentType.region,x:0,y:0,rotation:0,scaleX:1,scaleY:1,width:0,height:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,setUVs:function(a,b,c,d,e){var f=this.uvs;e?(f[2]=a,f[3]=d,f[4]=a,f[5]=b,f[6]=c,f[7]=b,f[0]=c,f[1]=d):(f[0]=a,f[1]=d,f[2]=a,f[3]=b,f[4]=c,f[5]=b,f[6]=c,f[7]=d)},updateOffset:function(){var a=this.width/this.regionOriginalWidth*this.scaleX,b=this.height/this.regionOriginalHeight*this.scaleY,d=-this.width/2*this.scaleX+this.regionOffsetX*a,e=-this.height/2*this.scaleY+this.regionOffsetY*b,f=d+this.regionWidth*a,g=e+this.regionHeight*b,h=this.rotation*c.degRad,i=Math.cos(h),j=Math.sin(h),k=d*i+this.x,l=d*j,m=e*i+this.y,n=e*j,o=f*i+this.x,p=f*j,q=g*i+this.y,r=g*j,s=this.offset;s[0]=k-n,s[1]=m+l,s[2]=k-r,s[3]=q+l,s[4]=o-r,s[5]=q+p,s[6]=o-n,s[7]=m+p},computeVertices:function(a,b,c,d){a+=c.worldX,b+=c.worldY;var e=c.m00,f=c.m01,g=c.m10,h=c.m11,i=this.offset;d[0]=i[0]*e+i[1]*f+a,d[1]=i[0]*g+i[1]*h+b,d[2]=i[2]*e+i[3]*f+a,d[3]=i[2]*g+i[3]*h+b,d[4]=i[4]*e+i[5]*f+a,d[5]=i[4]*g+i[5]*h+b,d[6]=i[6]*e+i[7]*f+a,d[7]=i[6]*g+i[7]*h+b}},c.MeshAttachment=function(a){this.name=a},c.MeshAttachment.prototype={type:c.AttachmentType.mesh,vertices:null,uvs:null,regionUVs:null,triangles:null,hullLength:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,regionU:0,regionV:0,regionU2:0,regionV2:0,regionRotate:!1,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,edges:null,width:0,height:0,updateUVs:function(){var a=this.regionU2-this.regionU,b=this.regionV2-this.regionV,d=this.regionUVs.length;if(this.uvs&&this.uvs.length==d||(this.uvs=new c.Float32Array(d)),this.regionRotate)for(var e=0;d>e;e+=2)this.uvs[e]=this.regionU+this.regionUVs[e+1]*a,this.uvs[e+1]=this.regionV+b-this.regionUVs[e]*b;else for(var e=0;d>e;e+=2)this.uvs[e]=this.regionU+this.regionUVs[e]*a,this.uvs[e+1]=this.regionV+this.regionUVs[e+1]*b},computeWorldVertices:function(a,b,c,d){var e=c.bone;a+=e.worldX,b+=e.worldY;var f=e.m00,g=e.m01,h=e.m10,i=e.m11,j=this.vertices,k=j.length;c.attachmentVertices.length==k&&(j=c.attachmentVertices);for(var l=0;k>l;l+=2){var m=j[l],n=j[l+1];d[l]=m*f+n*g+a,d[l+1]=m*h+n*i+b}}},c.SkinnedMeshAttachment=function(a){this.name=a},c.SkinnedMeshAttachment.prototype={type:c.AttachmentType.skinnedmesh,bones:null,weights:null,uvs:null,regionUVs:null,triangles:null,hullLength:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,regionU:0,regionV:0,regionU2:0,regionV2:0,regionRotate:!1,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,edges:null,width:0,height:0,updateUVs:function(){var a=this.regionU2-this.regionU,b=this.regionV2-this.regionV,d=this.regionUVs.length;if(this.uvs&&this.uvs.length==d||(this.uvs=new c.Float32Array(d)),this.regionRotate)for(var e=0;d>e;e+=2)this.uvs[e]=this.regionU+this.regionUVs[e+1]*a,this.uvs[e+1]=this.regionV+b-this.regionUVs[e]*b;else for(var e=0;d>e;e+=2)this.uvs[e]=this.regionU+this.regionUVs[e]*a,this.uvs[e+1]=this.regionV+this.regionUVs[e+1]*b},computeWorldVertices:function(a,b,c,d){var e,f,g,h,i,j,k,l=c.bone.skeleton.bones,m=this.weights,n=this.bones,o=0,p=0,q=0,r=0,s=n.length;if(c.attachmentVertices.length)for(var t=c.attachmentVertices;s>p;o+=2){for(f=0,g=0,e=n[p++]+p;e>p;p++,q+=3,r+=2)h=l[n[p]],i=m[q]+t[r],j=m[q+1]+t[r+1],k=m[q+2],f+=(i*h.m00+j*h.m01+h.worldX)*k,g+=(i*h.m10+j*h.m11+h.worldY)*k;d[o]=f+a,d[o+1]=g+b}else for(;s>p;o+=2){for(f=0,g=0,e=n[p++]+p;e>p;p++,q+=3)h=l[n[p]],i=m[q],j=m[q+1],k=m[q+2],f+=(i*h.m00+j*h.m01+h.worldX)*k,g+=(i*h.m10+j*h.m11+h.worldY)*k;d[o]=f+a,d[o+1]=g+b}}},c.BoundingBoxAttachment=function(a){this.name=a,this.vertices=[]},c.BoundingBoxAttachment.prototype={type:c.AttachmentType.boundingbox,computeWorldVertices:function(a,b,c,d){a+=c.worldX,b+=c.worldY;for(var e=c.m00,f=c.m01,g=c.m10,h=c.m11,i=this.vertices,j=0,k=i.length;k>j;j+=2){var l=i[j],m=i[j+1];d[j]=l*e+m*f+a,d[j+1]=l*g+m*h+b}}},c.AnimationStateData=function(a){this.skeletonData=a,this.animationToMixTime={}},c.AnimationStateData.prototype={defaultMix:0,setMixByName:function(a,b,c){var d=this.skeletonData.findAnimation(a);if(!d)throw"Animation not found: "+a;var e=this.skeletonData.findAnimation(b);if(!e)throw"Animation not found: "+b;this.setMix(d,e,c)},setMix:function(a,b,c){this.animationToMixTime[a.name+":"+b.name]=c},getMix:function(a,b){var c=a.name+":"+b.name;return this.animationToMixTime.hasOwnProperty(c)?this.animationToMixTime[c]:this.defaultMix}},c.TrackEntry=function(){},c.TrackEntry.prototype={next:null,previous:null,animation:null,loop:!1,delay:0,time:0,lastTime:-1,endTime:0,timeScale:1,mixTime:0,mixDuration:0,mix:1,onStart:null,onEnd:null,onComplete:null,onEvent:null},c.AnimationState=function(a){this.data=a,this.tracks=[],this.events=[]},c.AnimationState.prototype={onStart:null,onEnd:null,onComplete:null,onEvent:null,timeScale:1,update:function(a){a*=this.timeScale;for(var b=0;b=0&&this.setCurrent(b,e)):!c.loop&&c.lastTime>=c.endTime&&this.clearTrack(b)}}},apply:function(a){for(var b=0;bf&&(d=f);var h=c.previous;if(h){var i=h.time;!h.loop&&i>h.endTime&&(i=h.endTime),h.animation.apply(a,i,i,h.loop,null);var j=c.mixTime/c.mixDuration*c.mix;j>=1&&(j=1,c.previous=null),c.animation.mix(a,c.lastTime,d,g,this.events,j)}else 1==c.mix?c.animation.apply(a,c.lastTime,d,g,this.events):c.animation.mix(a,c.lastTime,d,g,this.events,c.mix);for(var k=0,l=this.events.length;l>k;k++){var m=this.events[k];c.onEvent&&c.onEvent(b,m),this.onEvent&&this.onEvent(b,m)}if(g?e%f>d%f:f>e&&d>=f){var n=Math.floor(d/f);c.onComplete&&c.onComplete(b,n),this.onComplete&&this.onComplete(b,n)}c.lastTime=c.time}}},clearTracks:function(){for(var a=0,b=this.tracks.length;b>a;a++)this.clearTrack(a);this.tracks.length=0},clearTrack:function(a){if(!(a>=this.tracks.length)){var b=this.tracks[a];b&&(b.onEnd&&b.onEnd(a),this.onEnd&&this.onEnd(a),this.tracks[a]=null)}},_expandToIndex:function(a){if(a=this.tracks.length;)this.tracks.push(null);return null},setCurrent:function(a,b){var c=this._expandToIndex(a);if(c){var d=c.previous;c.previous=null,c.onEnd&&c.onEnd(a),this.onEnd&&this.onEnd(a),b.mixDuration=this.data.getMix(c.animation,b.animation),b.mixDuration>0&&(b.mixTime=0,b.previous=d&&c.mixTime/c.mixDuration<.5?d:c)}this.tracks[a]=b,b.onStart&&b.onStart(a),this.onStart&&this.onStart(a)},setAnimationByName:function(a,b,c){var d=this.data.skeletonData.findAnimation(b);if(!d)throw"Animation not found: "+b;return this.setAnimation(a,d,c)},setAnimation:function(a,b,d){var e=new c.TrackEntry;return e.animation=b,e.loop=d,e.endTime=b.duration,this.setCurrent(a,e),e},addAnimationByName:function(a,b,c,d){var e=this.data.skeletonData.findAnimation(b);if(!e)throw"Animation not found: "+b;return this.addAnimation(a,e,c,d)},addAnimation:function(a,b,d,e){var f=new c.TrackEntry;f.animation=b,f.loop=d,f.endTime=b.duration;var g=this._expandToIndex(a);if(g){for(;g.next;)g=g.next;g.next=f}else this.tracks[a]=f;return 0>=e&&(g?e+=g.endTime-this.data.getMix(g.animation,b):e=0),f.delay=e,f},getCurrent:function(a){return a>=this.tracks.length?null:this.tracks[a]}},c.SkeletonJson=function(a){this.attachmentLoader=a},c.SkeletonJson.prototype={scale:1,readSkeletonData:function(a,b){var d=new c.SkeletonData;d.name=b;var e=a.skeleton;e&&(d.hash=e.hash,d.version=e.spine,d.width=e.width||0,d.height=e.height||0);for(var f=a.bones,g=0,h=f.length;h>g;g++){var i=f[g],j=null;if(i.parent&&(j=d.findBone(i.parent),!j))throw"Parent bone not found: "+i.parent;var k=new c.BoneData(i.name,j);k.length=(i.length||0)*this.scale,k.x=(i.x||0)*this.scale,k.y=(i.y||0)*this.scale,k.rotation=i.rotation||0,k.scaleX=i.hasOwnProperty("scaleX")?i.scaleX:1,k.scaleY=i.hasOwnProperty("scaleY")?i.scaleY:1,k.inheritScale=i.hasOwnProperty("inheritScale")?i.inheritScale:!0,k.inheritRotation=i.hasOwnProperty("inheritRotation")?i.inheritRotation:!0,d.bones.push(k)}var l=a.ik;if(l)for(var g=0,h=l.length;h>g;g++){for(var m=l[g],n=new c.IkConstraintData(m.name),f=m.bones,o=0,p=f.length;p>o;o++){var q=d.findBone(f[o]);if(!q)throw"IK bone not found: "+f[o];n.bones.push(q)}if(n.target=d.findBone(m.target),!n.target)throw"Target bone not found: "+m.target;n.bendDirection=!m.hasOwnProperty("bendPositive")||m.bendPositive?1:-1,n.mix=m.hasOwnProperty("mix")?m.mix:1,d.ikConstraints.push(n)}for(var r=a.slots,g=0,h=r.length;h>g;g++){var s=r[g],k=d.findBone(s.bone);if(!k)throw"Slot bone not found: "+s.bone;var t=new c.SlotData(s.name,k),u=s.color;u&&(t.r=this.toColor(u,0),t.g=this.toColor(u,1),t.b=this.toColor(u,2),t.a=this.toColor(u,3)),t.attachmentName=s.attachment,t.additiveBlending=s.additive&&"true"==s.additive,d.slots.push(t)}var v=a.skins;for(var w in v)if(v.hasOwnProperty(w)){var x=v[w],y=new c.Skin(w);for(var z in x)if(x.hasOwnProperty(z)){var A=d.findSlotIndex(z),B=x[z];for(var C in B)if(B.hasOwnProperty(C)){var D=this.readAttachment(y,C,B[C]);D&&y.addAttachment(A,C,D)}}d.skins.push(y),"default"==y.name&&(d.defaultSkin=y)}var E=a.events;for(var F in E)if(E.hasOwnProperty(F)){var G=E[F],H=new c.EventData(F);H.intValue=G["int"]||0,H.floatValue=G["float"]||0,H.stringValue=G.string||null,d.events.push(H)}var I=a.animations;for(var J in I)I.hasOwnProperty(J)&&this.readAnimation(J,I[J],d);return d},readAttachment:function(a,b,d){b=d.name||b;var e=c.AttachmentType[d.type||"region"],f=d.path||b,g=this.scale; -if(e==c.AttachmentType.region){var h=this.attachmentLoader.newRegionAttachment(a,b,f);if(!h)return null;h.path=f,h.x=(d.x||0)*g,h.y=(d.y||0)*g,h.scaleX=d.hasOwnProperty("scaleX")?d.scaleX:1,h.scaleY=d.hasOwnProperty("scaleY")?d.scaleY:1,h.rotation=d.rotation||0,h.width=(d.width||0)*g,h.height=(d.height||0)*g;var i=d.color;return i&&(h.r=this.toColor(i,0),h.g=this.toColor(i,1),h.b=this.toColor(i,2),h.a=this.toColor(i,3)),h.updateOffset(),h}if(e==c.AttachmentType.mesh){var j=this.attachmentLoader.newMeshAttachment(a,b,f);return j?(j.path=f,j.vertices=this.getFloatArray(d,"vertices",g),j.triangles=this.getIntArray(d,"triangles"),j.regionUVs=this.getFloatArray(d,"uvs",1),j.updateUVs(),i=d.color,i&&(j.r=this.toColor(i,0),j.g=this.toColor(i,1),j.b=this.toColor(i,2),j.a=this.toColor(i,3)),j.hullLength=2*(d.hull||0),d.edges&&(j.edges=this.getIntArray(d,"edges")),j.width=(d.width||0)*g,j.height=(d.height||0)*g,j):null}if(e==c.AttachmentType.skinnedmesh){var j=this.attachmentLoader.newSkinnedMeshAttachment(a,b,f);if(!j)return null;j.path=f;for(var k=this.getFloatArray(d,"uvs",1),l=this.getFloatArray(d,"vertices",1),m=[],n=[],o=0,p=l.length;p>o;){var q=0|l[o++];n[n.length]=q;for(var r=o+4*q;r>o;)n[n.length]=l[o],m[m.length]=l[o+1]*g,m[m.length]=l[o+2]*g,m[m.length]=l[o+3],o+=4}return j.bones=n,j.weights=m,j.triangles=this.getIntArray(d,"triangles"),j.regionUVs=k,j.updateUVs(),i=d.color,i&&(j.r=this.toColor(i,0),j.g=this.toColor(i,1),j.b=this.toColor(i,2),j.a=this.toColor(i,3)),j.hullLength=2*(d.hull||0),d.edges&&(j.edges=this.getIntArray(d,"edges")),j.width=(d.width||0)*g,j.height=(d.height||0)*g,j}if(e==c.AttachmentType.boundingbox){for(var s=this.attachmentLoader.newBoundingBoxAttachment(a,b),l=d.vertices,o=0,p=l.length;p>o;o++)s.vertices.push(l[o]*g);return s}throw"Unknown attachment type: "+e},readAnimation:function(a,b,d){var e=[],f=0,g=b.slots;for(var h in g)if(g.hasOwnProperty(h)){var i=g[h],j=d.findSlotIndex(h);for(var k in i)if(i.hasOwnProperty(k)){var l=i[k];if("color"==k){var m=new c.ColorTimeline(l.length);m.slotIndex=j;for(var n=0,o=0,p=l.length;p>o;o++){var q=l[o],r=q.color,s=this.toColor(r,0),t=this.toColor(r,1),u=this.toColor(r,2),v=this.toColor(r,3);m.setFrame(n,q.time,s,t,u,v),this.readCurve(m,n,q),n++}e.push(m),f=Math.max(f,m.frames[5*m.getFrameCount()-5])}else{if("attachment"!=k)throw"Invalid timeline type for a slot: "+k+" ("+h+")";var m=new c.AttachmentTimeline(l.length);m.slotIndex=j;for(var n=0,o=0,p=l.length;p>o;o++){var q=l[o];m.setFrame(n++,q.time,q.name)}e.push(m),f=Math.max(f,m.frames[m.getFrameCount()-1])}}}var w=b.bones;for(var x in w)if(w.hasOwnProperty(x)){var y=d.findBoneIndex(x);if(-1==y)throw"Bone not found: "+x;var z=w[x];for(var k in z)if(z.hasOwnProperty(k)){var l=z[k];if("rotate"==k){var m=new c.RotateTimeline(l.length);m.boneIndex=y;for(var n=0,o=0,p=l.length;p>o;o++){var q=l[o];m.setFrame(n,q.time,q.angle),this.readCurve(m,n,q),n++}e.push(m),f=Math.max(f,m.frames[2*m.getFrameCount()-2])}else if("translate"==k||"scale"==k){var m,A=1;"scale"==k?m=new c.ScaleTimeline(l.length):(m=new c.TranslateTimeline(l.length),A=this.scale),m.boneIndex=y;for(var n=0,o=0,p=l.length;p>o;o++){var q=l[o],B=(q.x||0)*A,C=(q.y||0)*A;m.setFrame(n,q.time,B,C),this.readCurve(m,n,q),n++}e.push(m),f=Math.max(f,m.frames[3*m.getFrameCount()-3])}else{if("flipX"!=k&&"flipY"!=k)throw"Invalid timeline type for a bone: "+k+" ("+x+")";var B="flipX"==k,m=B?new c.FlipXTimeline(l.length):new c.FlipYTimeline(l.length);m.boneIndex=y;for(var D=B?"x":"y",n=0,o=0,p=l.length;p>o;o++){var q=l[o];m.setFrame(n,q.time,q[D]||!1),n++}e.push(m),f=Math.max(f,m.frames[2*m.getFrameCount()-2])}}}var E=b.ik;for(var F in E)if(E.hasOwnProperty(F)){var G=d.findIkConstraint(F),l=E[F],m=new c.IkConstraintTimeline(l.length);m.ikConstraintIndex=d.ikConstraints.indexOf(G);for(var n=0,o=0,p=l.length;p>o;o++){var q=l[o],H=q.hasOwnProperty("mix")?q.mix:1,I=!q.hasOwnProperty("bendPositive")||q.bendPositive?1:-1;m.setFrame(n,q.time,H,I),this.readCurve(m,n,q),n++}e.push(m),f=Math.max(f,m.frames[3*m.frameCount-3])}var J=b.ffd;for(var K in J){var L=d.findSkin(K),i=J[K];for(h in i){var j=d.findSlotIndex(h),M=i[h];for(var N in M){var l=M[N],m=new c.FfdTimeline(l.length),O=L.getAttachment(j,N);if(!O)throw"FFD attachment not found: "+N;m.slotIndex=j,m.attachment=O;var P,Q=O.type==c.AttachmentType.mesh;P=Q?O.vertices.length:O.weights.length/3*2;for(var n=0,o=0,p=l.length;p>o;o++){var R,q=l[o];if(q.vertices){var S=q.vertices,R=[];R.length=P;var T=q.offset||0,U=S.length;if(1==this.scale)for(var V=0;U>V;V++)R[V+T]=S[V];else for(var V=0;U>V;V++)R[V+T]=S[V]*this.scale;if(Q)for(var W=O.vertices,V=0,U=R.length;U>V;V++)R[V]+=W[V]}else Q?R=O.vertices:(R=[],R.length=P);m.setFrame(n,q.time,R),this.readCurve(m,n,q),n++}e[e.length]=m,f=Math.max(f,m.frames[m.frameCount-1])}}}var X=b.drawOrder;if(X||(X=b.draworder),X){for(var m=new c.DrawOrderTimeline(X.length),Y=d.slots.length,n=0,o=0,p=X.length;p>o;o++){var Z=X[o],$=null;if(Z.offsets){$=[],$.length=Y;for(var V=Y-1;V>=0;V--)$[V]=-1;var _=Z.offsets,ab=[];ab.length=Y-_.length;for(var bb=0,cb=0,V=0,U=_.length;U>V;V++){var db=_[V],j=d.findSlotIndex(db.slot);if(-1==j)throw"Slot not found: "+db.slot;for(;bb!=j;)ab[cb++]=bb++;$[bb+db.offset]=bb++}for(;Y>bb;)ab[cb++]=bb++;for(var V=Y-1;V>=0;V--)-1==$[V]&&($[V]=ab[--cb])}m.setFrame(n++,Z.time,$)}e.push(m),f=Math.max(f,m.frames[m.getFrameCount()-1])}var eb=b.events;if(eb){for(var m=new c.EventTimeline(eb.length),n=0,o=0,p=eb.length;p>o;o++){var fb=eb[o],gb=d.findEvent(fb.name);if(!gb)throw"Event not found: "+fb.name;var hb=new c.Event(gb);hb.intValue=fb.hasOwnProperty("int")?fb["int"]:gb.intValue,hb.floatValue=fb.hasOwnProperty("float")?fb["float"]:gb.floatValue,hb.stringValue=fb.hasOwnProperty("string")?fb.string:gb.stringValue,m.setFrame(n++,fb.time,hb)}e.push(m),f=Math.max(f,m.frames[m.getFrameCount()-1])}d.animations.push(new c.Animation(a,e,f))},readCurve:function(a,b,c){var d=c.curve;d?"stepped"==d?a.curves.setStepped(b):d instanceof Array&&a.curves.setCurve(b,d[0],d[1],d[2],d[3]):a.curves.setLinear(b)},toColor:function(a,b){if(8!=a.length)throw"Color hexidecimal length must be 8, recieved: "+a;return parseInt(a.substring(2*b,2*b+2),16)/255},getFloatArray:function(a,b,d){var e=a[b],f=new c.Float32Array(e.length),g=0,h=e.length;if(1==d)for(;h>g;g++)f[g]=e[g];else for(;h>g;g++)f[g]=e[g]*d;return f},getIntArray:function(a,b){for(var d=a[b],e=new c.Uint16Array(d.length),f=0,g=d.length;g>f;f++)e[f]=0|d[f];return e}},c.Atlas=function(a,b){this.textureLoader=b,this.pages=[],this.regions=[];var d=new c.AtlasReader(a),e=[];e.length=4;for(var f=null;;){var g=d.readLine();if(null===g)break;if(g=d.trim(g),g.length)if(f){var h=new c.AtlasRegion;h.name=g,h.page=f,h.rotate="true"==d.readValue(),d.readTuple(e);var i=parseInt(e[0]),j=parseInt(e[1]);d.readTuple(e);var k=parseInt(e[0]),l=parseInt(e[1]);h.u=i/f.width,h.v=j/f.height,h.rotate?(h.u2=(i+l)/f.width,h.v2=(j+k)/f.height):(h.u2=(i+k)/f.width,h.v2=(j+l)/f.height),h.x=i,h.y=j,h.width=Math.abs(k),h.height=Math.abs(l),4==d.readTuple(e)&&(h.splits=[parseInt(e[0]),parseInt(e[1]),parseInt(e[2]),parseInt(e[3])],4==d.readTuple(e)&&(h.pads=[parseInt(e[0]),parseInt(e[1]),parseInt(e[2]),parseInt(e[3])],d.readTuple(e))),h.originalWidth=parseInt(e[0]),h.originalHeight=parseInt(e[1]),d.readTuple(e),h.offsetX=parseInt(e[0]),h.offsetY=parseInt(e[1]),h.index=parseInt(d.readValue()),this.regions.push(h)}else{f=new c.AtlasPage,f.name=g,2==d.readTuple(e)&&(f.width=parseInt(e[0]),f.height=parseInt(e[1]),d.readTuple(e)),f.format=c.Atlas.Format[e[0]],d.readTuple(e),f.minFilter=c.Atlas.TextureFilter[e[0]],f.magFilter=c.Atlas.TextureFilter[e[1]];var m=d.readValue();f.uWrap=c.Atlas.TextureWrap.clampToEdge,f.vWrap=c.Atlas.TextureWrap.clampToEdge,"x"==m?f.uWrap=c.Atlas.TextureWrap.repeat:"y"==m?f.vWrap=c.Atlas.TextureWrap.repeat:"xy"==m&&(f.uWrap=f.vWrap=c.Atlas.TextureWrap.repeat),b.load(f,g,this),this.pages.push(f)}else f=null}},c.Atlas.prototype={findRegion:function(a){for(var b=this.regions,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},dispose:function(){for(var a=this.pages,b=0,c=a.length;c>b;b++)this.textureLoader.unload(a[b].rendererObject)},updateUVs:function(a){for(var b=this.regions,c=0,d=b.length;d>c;c++){var e=b[c];e.page==a&&(e.u=e.x/a.width,e.v=e.y/a.height,e.rotate?(e.u2=(e.x+e.height)/a.width,e.v2=(e.y+e.width)/a.height):(e.u2=(e.x+e.width)/a.width,e.v2=(e.y+e.height)/a.height))}}},c.Atlas.Format={alpha:0,intensity:1,luminanceAlpha:2,rgb565:3,rgba4444:4,rgb888:5,rgba8888:6},c.Atlas.TextureFilter={nearest:0,linear:1,mipMap:2,mipMapNearestNearest:3,mipMapLinearNearest:4,mipMapNearestLinear:5,mipMapLinearLinear:6},c.Atlas.TextureWrap={mirroredRepeat:0,clampToEdge:1,repeat:2},c.AtlasPage=function(){},c.AtlasPage.prototype={name:null,format:null,minFilter:null,magFilter:null,uWrap:null,vWrap:null,rendererObject:null,width:0,height:0},c.AtlasRegion=function(){},c.AtlasRegion.prototype={page:null,name:null,x:0,y:0,width:0,height:0,u:0,v:0,u2:0,v2:0,offsetX:0,offsetY:0,originalWidth:0,originalHeight:0,index:0,rotate:!1,splits:null,pads:null},c.AtlasReader=function(a){this.lines=a.split(/\r\n|\r|\n/)},c.AtlasReader.prototype={index:0,trim:function(a){return a.replace(/^\s+|\s+$/g,"")},readLine:function(){return this.index>=this.lines.length?null:this.lines[this.index++]},readValue:function(){var a=this.readLine(),b=a.indexOf(":");if(-1==b)throw"Invalid line: "+a;return this.trim(a.substring(b+1))},readTuple:function(a){var b=this.readLine(),c=b.indexOf(":");if(-1==c)throw"Invalid line: "+b;for(var d=0,e=c+1;3>d;d++){var f=b.indexOf(",",e);if(-1==f)break;a[d]=this.trim(b.substr(e,f-e)),e=f+1}return a[d]=this.trim(b.substring(e)),d+1}},c.AtlasAttachmentLoader=function(a){this.atlas=a},c.AtlasAttachmentLoader.prototype={newRegionAttachment:function(a,b,d){var e=this.atlas.findRegion(d);if(!e)throw"Region not found in atlas: "+d+" (region attachment: "+b+")";var f=new c.RegionAttachment(b);return f.rendererObject=e,f.setUVs(e.u,e.v,e.u2,e.v2,e.rotate),f.regionOffsetX=e.offsetX,f.regionOffsetY=e.offsetY,f.regionWidth=e.width,f.regionHeight=e.height,f.regionOriginalWidth=e.originalWidth,f.regionOriginalHeight=e.originalHeight,f},newMeshAttachment:function(a,b,d){var e=this.atlas.findRegion(d);if(!e)throw"Region not found in atlas: "+d+" (mesh attachment: "+b+")";var f=new c.MeshAttachment(b);return f.rendererObject=e,f.regionU=e.u,f.regionV=e.v,f.regionU2=e.u2,f.regionV2=e.v2,f.regionRotate=e.rotate,f.regionOffsetX=e.offsetX,f.regionOffsetY=e.offsetY,f.regionWidth=e.width,f.regionHeight=e.height,f.regionOriginalWidth=e.originalWidth,f.regionOriginalHeight=e.originalHeight,f},newSkinnedMeshAttachment:function(a,b,d){var e=this.atlas.findRegion(d);if(!e)throw"Region not found in atlas: "+d+" (skinned mesh attachment: "+b+")";var f=new c.SkinnedMeshAttachment(b);return f.rendererObject=e,f.regionU=e.u,f.regionV=e.v,f.regionU2=e.u2,f.regionV2=e.v2,f.regionRotate=e.rotate,f.regionOffsetX=e.offsetX,f.regionOffsetY=e.offsetY,f.regionWidth=e.width,f.regionHeight=e.height,f.regionOriginalWidth=e.originalWidth,f.regionOriginalHeight=e.originalHeight,f},newBoundingBoxAttachment:function(a,b){return new c.BoundingBoxAttachment(b)}},c.SkeletonBounds=function(){this.polygonPool=[],this.polygons=[],this.boundingBoxes=[]},c.SkeletonBounds.prototype={minX:0,minY:0,maxX:0,maxY:0,update:function(a,b){var d=a.slots,e=d.length,f=a.x,g=a.y,h=this.boundingBoxes,i=this.polygonPool,j=this.polygons;h.length=0;for(var k=0,l=j.length;l>k;k++)i.push(j[k]);j.length=0;for(var k=0;e>k;k++){var m=d[k],n=m.attachment;if(n.type==c.AttachmentType.boundingbox){h.push(n);var o,p=i.length;p>0?(o=i[p-1],i.splice(p-1,1)):o=[],j.push(o),o.length=n.vertices.length,n.computeWorldVertices(f,g,m.bone,o)}}b&&this.aabbCompute()},aabbCompute:function(){for(var a=this.polygons,b=Number.MAX_VALUE,c=Number.MAX_VALUE,d=Number.MIN_VALUE,e=Number.MIN_VALUE,f=0,g=a.length;g>f;f++)for(var h=a[f],i=0,j=h.length;j>i;i+=2){var k=h[i],l=h[i+1];b=Math.min(b,k),c=Math.min(c,l),d=Math.max(d,k),e=Math.max(e,l)}this.minX=b,this.minY=c,this.maxX=d,this.maxY=e},aabbContainsPoint:function(a,b){return a>=this.minX&&a<=this.maxX&&b>=this.minY&&b<=this.maxY},aabbIntersectsSegment:function(a,b,c,d){var e=this.minX,f=this.minY,g=this.maxX,h=this.maxY;if(e>=a&&e>=c||f>=b&&f>=d||a>=g&&c>=g||b>=h&&d>=h)return!1;var i=(d-b)/(c-a),j=i*(e-a)+b;if(j>f&&h>j)return!0;if(j=i*(g-a)+b,j>f&&h>j)return!0;var k=(f-b)/i+a;return k>e&&g>k?!0:(k=(h-b)/i+a,k>e&&g>k?!0:!1)},aabbIntersectsSkeleton:function(a){return this.minXa.minX&&this.minYa.minY},containsPoint:function(a,b){for(var c=this.polygons,d=0,e=c.length;e>d;d++)if(this.polygonContainsPoint(c[d],a,b))return this.boundingBoxes[d];return null},intersectsSegment:function(a,b,c,d){for(var e=this.polygons,f=0,g=e.length;g>f;f++)if(e[f].intersectsSegment(a,b,c,d))return this.boundingBoxes[f];return null},polygonContainsPoint:function(a,b,c){for(var d=a.length,e=d-2,f=!1,g=0;d>g;g+=2){var h=a[g+1],i=a[e+1];if(c>h&&i>=c||c>i&&h>=c){var j=a[g];j+(c-h)/(i-h)*(a[e]-j)l;l+=2){var m=a[l],n=a[l+1],o=j*n-k*m,p=j-m,q=k-n,r=g*q-h*p,s=(i*p-g*o)/r;if((s>=j&&m>=s||s>=m&&j>=s)&&(s>=b&&d>=s||s>=d&&b>=s)){var t=(i*q-h*o)/r;if((t>=k&&n>=t||t>=n&&k>=t)&&(t>=c&&e>=t||t>=e&&c>=t))return!0}j=m,k=n}return!1},getPolygon:function(a){var b=this.boundingBoxes.indexOf(a);return-1==b?null:this.polygons[b]},getWidth:function(){return this.maxX-this.minX},getHeight:function(){return this.maxY-this.minY}},c.Bone.yDown=!0,b.AnimCache={},b.SpineTextureLoader=function(a,c){b.EventTarget.call(this),this.basePath=a,this.crossorigin=c,this.loadingCount=0},b.SpineTextureLoader.prototype=b.SpineTextureLoader,b.SpineTextureLoader.prototype.load=function(a,c){if(a.rendererObject=b.BaseTexture.fromImage(this.basePath+"/"+c,this.crossorigin),!a.rendererObject.hasLoaded){var d=this;++d.loadingCount,a.rendererObject.addEventListener("loaded",function(){--d.loadingCount,d.dispatchEvent({type:"loadedBaseTexture",content:d})})}},b.SpineTextureLoader.prototype.unload=function(a){a.destroy(!0)},b.Spine=function(a){if(b.DisplayObjectContainer.call(this),this.spineData=b.AnimCache[a],!this.spineData)throw new Error("Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: "+a);this.skeleton=new c.Skeleton(this.spineData),this.skeleton.updateWorldTransform(),this.stateData=new c.AnimationStateData(this.spineData),this.state=new c.AnimationState(this.stateData),this.slotContainers=[];for(var d=0,e=this.skeleton.drawOrder.length;e>d;d++){var f=this.skeleton.drawOrder[d],g=f.attachment,h=new b.DisplayObjectContainer;if(this.slotContainers.push(h),this.addChild(h),g instanceof c.RegionAttachment){var i=g.rendererObject.name,j=this.createSprite(f,g);f.currentSprite=j,f.currentSpriteName=i,h.addChild(j)}else{if(!(g instanceof c.MeshAttachment))continue;var k=this.createMesh(f,g);f.currentMesh=k,f.currentMeshName=g.name,h.addChild(k)}}this.autoUpdate=!0},b.Spine.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Spine.prototype.constructor=b.Spine,Object.defineProperty(b.Spine.prototype,"autoUpdate",{get:function(){return this.updateTransform===b.Spine.prototype.autoUpdateTransform},set:function(a){this.updateTransform=a?b.Spine.prototype.autoUpdateTransform:b.DisplayObjectContainer.prototype.updateTransform}}),b.Spine.prototype.update=function(a){this.state.update(a),this.state.apply(this.skeleton),this.skeleton.updateWorldTransform();for(var d=this.skeleton.drawOrder,e=0,f=d.length;f>e;e++){var g=d[e],h=g.attachment,i=this.slotContainers[e];if(h){var j=h.type;if(j===c.AttachmentType.region){if(h.rendererObject&&(!g.currentSpriteName||g.currentSpriteName!==h.name)){var k=h.rendererObject.name;if(void 0!==g.currentSprite&&(g.currentSprite.visible=!1),g.sprites=g.sprites||{},void 0!==g.sprites[k])g.sprites[k].visible=!0;else{var l=this.createSprite(g,h);i.addChild(l)}g.currentSprite=g.sprites[k],g.currentSpriteName=k}var m=g.bone;i.position.x=m.worldX+h.x*m.m00+h.y*m.m01,i.position.y=m.worldY+h.x*m.m10+h.y*m.m11,i.scale.x=m.worldScaleX,i.scale.y=m.worldScaleY,i.rotation=-(g.bone.worldRotation*c.degRad),g.currentSprite.tint=b.rgb2hex([g.r,g.g,g.b])}else{if(j!==c.AttachmentType.skinnedmesh){i.visible=!1;continue}if(!g.currentMeshName||g.currentMeshName!==h.name){var n=h.name;if(void 0!==g.currentMesh&&(g.currentMesh.visible=!1),g.meshes=g.meshes||{},void 0!==g.meshes[n])g.meshes[n].visible=!0;else{var o=this.createMesh(g,h);i.addChild(o)}g.currentMesh=g.meshes[n],g.currentMeshName=n}h.computeWorldVertices(g.bone.skeleton.x,g.bone.skeleton.y,g,g.currentMesh.vertices)}i.visible=!0,i.alpha=g.a}else i.visible=!1}},b.Spine.prototype.autoUpdateTransform=function(){this.lastTime=this.lastTime||Date.now();var a=.001*(Date.now()-this.lastTime);this.lastTime=Date.now(),this.update(a),b.DisplayObjectContainer.prototype.updateTransform.call(this)},b.Spine.prototype.createSprite=function(a,d){var e=d.rendererObject,f=e.page.rendererObject,g=new b.Rectangle(e.x,e.y,e.rotate?e.height:e.width,e.rotate?e.width:e.height),h=new b.Texture(f,g),i=new b.Sprite(h),j=e.rotate?.5*Math.PI:0;return i.scale.set(e.width/e.originalWidth,e.height/e.originalHeight),i.rotation=j-d.rotation*c.degRad,i.anchor.x=i.anchor.y=.5,a.sprites=a.sprites||{},a.sprites[e.name]=i,i},b.Spine.prototype.createMesh=function(a,c){var d=c.rendererObject,e=d.page.rendererObject,f=new b.Texture(e),g=new b.Strip(f);return g.drawMode=b.Strip.DrawModes.TRIANGLES,g.canvasPadding=1.5,g.vertices=new b.Float32Array(c.uvs.length),g.uvs=c.uvs,g.indices=c.triangles,a.meshes=a.meshes||{},a.meshes[c.name]=g,g},b.BaseTextureCache={},b.BaseTextureCacheIdGenerator=0,b.BaseTexture=function(a,c){if(this.resolution=1,this.width=100,this.height=100,this.scaleMode=c||b.scaleModes.DEFAULT,this.hasLoaded=!1,this.source=a,this._UID=b._UID++,this.premultipliedAlpha=!0,this._glTextures=[],this.mipmap=!1,this._dirty=[!0,!0,!0,!0],a){if((this.source.complete||this.source.getContext)&&this.source.width&&this.source.height)this.hasLoaded=!0,this.width=this.source.naturalWidth||this.source.width,this.height=this.source.naturalHeight||this.source.height,this.dirty();else{var d=this;this.source.onload=function(){d.hasLoaded=!0,d.width=d.source.naturalWidth||d.source.width,d.height=d.source.naturalHeight||d.source.height,d.dirty(),d.dispatchEvent({type:"loaded",content:d})},this.source.onerror=function(){d.dispatchEvent({type:"error",content:d})}}this.imageUrl=null,this._powerOf2=!1}},b.BaseTexture.prototype.constructor=b.BaseTexture,b.EventTarget.mixin(b.BaseTexture.prototype),b.BaseTexture.prototype.destroy=function(){this.imageUrl?(delete b.BaseTextureCache[this.imageUrl],delete b.TextureCache[this.imageUrl],this.imageUrl=null,navigator.isCocoonJS||(this.source.src="")):this.source&&this.source._pixiId&&delete b.BaseTextureCache[this.source._pixiId],this.source=null,this.unloadFromGPU()},b.BaseTexture.prototype.updateSourceImage=function(a){this.hasLoaded=!1,this.source.src=null,this.source.src=a},b.BaseTexture.prototype.dirty=function(){for(var a=0;a=0;a--){var c=this._glTextures[a],d=b.glContexts[a];d&&c&&d.deleteTexture(c)}this._glTextures.length=0,this.dirty()},b.BaseTexture.fromImage=function(a,c,d){var e=b.BaseTextureCache[a];if(void 0===c&&-1===a.indexOf("data:")&&(c=!0),!e){var f=new Image;c&&(f.crossOrigin=""),f.src=a,e=new b.BaseTexture(f,d),e.imageUrl=a,b.BaseTextureCache[a]=e,-1!==a.indexOf(b.RETINA_PREFIX+".")&&(e.resolution=2)}return e},b.BaseTexture.fromCanvas=function(a,c){a._pixiId||(a._pixiId="canvas_"+b.TextureCacheIdGenerator++);var d=b.BaseTextureCache[a._pixiId];return d||(d=new b.BaseTexture(a,c),b.BaseTextureCache[a._pixiId]=d),d},b.TextureCache={},b.FrameCache={},b.TextureCacheIdGenerator=0,b.Texture=function(a,c,d,e){this.noFrame=!1,c||(this.noFrame=!0,c=new b.Rectangle(0,0,1,1)),a instanceof b.Texture&&(a=a.baseTexture),this.baseTexture=a,this.frame=c,this.trim=e,this.valid=!1,this.requiresUpdate=!1,this._uvs=null,this.width=0,this.height=0,this.crop=d||new b.Rectangle(0,0,1,1),a.hasLoaded?(this.noFrame&&(c=new b.Rectangle(0,0,a.width,a.height)),this.setFrame(c)):a.addEventListener("loaded",this.onBaseTextureLoaded.bind(this))},b.Texture.prototype.constructor=b.Texture,b.EventTarget.mixin(b.Texture.prototype),b.Texture.prototype.onBaseTextureLoaded=function(){var a=this.baseTexture;a.removeEventListener("loaded",this.onLoaded),this.noFrame&&(this.frame=new b.Rectangle(0,0,a.width,a.height)),this.setFrame(this.frame),this.dispatchEvent({type:"update",content:this})},b.Texture.prototype.destroy=function(a){a&&this.baseTexture.destroy(),this.valid=!1},b.Texture.prototype.setFrame=function(a){if(this.noFrame=!1,this.frame=a,this.width=a.width,this.height=a.height,this.crop.x=a.x,this.crop.y=a.y,this.crop.width=a.width,this.crop.height=a.height,!this.trim&&(a.x+a.width>this.baseTexture.width||a.y+a.height>this.baseTexture.height))throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.valid=a&&a.width&&a.height&&this.baseTexture.source&&this.baseTexture.hasLoaded,this.trim&&(this.width=this.trim.width,this.height=this.trim.height,this.frame.width=this.trim.width,this.frame.height=this.trim.height),this.valid&&this._updateUvs()},b.Texture.prototype._updateUvs=function(){this._uvs||(this._uvs=new b.TextureUvs);var a=this.crop,c=this.baseTexture.width,d=this.baseTexture.height;this._uvs.x0=a.x/c,this._uvs.y0=a.y/d,this._uvs.x1=(a.x+a.width)/c,this._uvs.y1=a.y/d,this._uvs.x2=(a.x+a.width)/c,this._uvs.y2=(a.y+a.height)/d,this._uvs.x3=a.x/c,this._uvs.y3=(a.y+a.height)/d},b.Texture.fromImage=function(a,c,d){var e=b.TextureCache[a];return e||(e=new b.Texture(b.BaseTexture.fromImage(a,c,d)),b.TextureCache[a]=e),e},b.Texture.fromFrame=function(a){var c=b.TextureCache[a];if(!c)throw new Error('The frameId "'+a+'" does not exist in the texture cache ');return c},b.Texture.fromCanvas=function(a,c){var d=b.BaseTexture.fromCanvas(a,c);return new b.Texture(d)},b.Texture.addTextureToCache=function(a,c){b.TextureCache[c]=a},b.Texture.removeTextureFromCache=function(a){var c=b.TextureCache[a];return delete b.TextureCache[a],delete b.BaseTextureCache[a],c},b.TextureUvs=function(){this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0},b.Texture.emptyTexture=new b.Texture(new b.BaseTexture),b.RenderTexture=function(a,c,d,e,f){if(this.width=a||100,this.height=c||100,this.resolution=f||1,this.frame=new b.Rectangle(0,0,this.width*this.resolution,this.height*this.resolution),this.crop=new b.Rectangle(0,0,this.width*this.resolution,this.height*this.resolution),this.baseTexture=new b.BaseTexture,this.baseTexture.width=this.width*this.resolution,this.baseTexture.height=this.height*this.resolution,this.baseTexture._glTextures=[],this.baseTexture.resolution=this.resolution,this.baseTexture.scaleMode=e||b.scaleModes.DEFAULT,this.baseTexture.hasLoaded=!0,b.Texture.call(this,this.baseTexture,new b.Rectangle(0,0,this.width*this.resolution,this.height*this.resolution)),this.renderer=d||b.defaultRenderer,this.renderer.type===b.WEBGL_RENDERER){var g=this.renderer.gl;this.baseTexture._dirty[g.id]=!1,this.textureBuffer=new b.FilterTexture(g,this.width,this.height,this.baseTexture.scaleMode),this.baseTexture._glTextures[g.id]=this.textureBuffer.texture,this.render=this.renderWebGL,this.projection=new b.Point(.5*this.width,.5*-this.height)}else this.render=this.renderCanvas,this.textureBuffer=new b.CanvasBuffer(this.width*this.resolution,this.height*this.resolution),this.baseTexture.source=this.textureBuffer.canvas;this.valid=!0,this._updateUvs()},b.RenderTexture.prototype=Object.create(b.Texture.prototype),b.RenderTexture.prototype.constructor=b.RenderTexture,b.RenderTexture.prototype.resize=function(a,c,d){(a!==this.width||c!==this.height)&&(this.valid=a>0&&c>0,this.width=a,this.height=c,this.frame.width=this.crop.width=a*this.resolution,this.frame.height=this.crop.height=c*this.resolution,d&&(this.baseTexture.width=this.width*this.resolution,this.baseTexture.height=this.height*this.resolution),this.renderer.type===b.WEBGL_RENDERER&&(this.projection.x=this.width/2,this.projection.y=-this.height/2),this.valid&&this.textureBuffer.resize(this.width,this.height))},b.RenderTexture.prototype.clear=function(){this.valid&&(this.renderer.type===b.WEBGL_RENDERER&&this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER,this.textureBuffer.frameBuffer),this.textureBuffer.clear())},b.RenderTexture.prototype.renderWebGL=function(a,b,c){if(this.valid){var d=a.worldTransform;d.identity(),d.translate(0,2*this.projection.y),b&&d.append(b),d.scale(1,-1),a.worldAlpha=1;for(var e=a.children,f=0,g=e.length;g>f;f++)e[f].updateTransform();var h=this.renderer.gl;h.viewport(0,0,this.width*this.resolution,this.height*this.resolution),h.bindFramebuffer(h.FRAMEBUFFER,this.textureBuffer.frameBuffer),c&&this.textureBuffer.clear(),this.renderer.spriteBatch.dirty=!0,this.renderer.renderDisplayObject(a,this.projection,this.textureBuffer.frameBuffer),this.renderer.spriteBatch.dirty=!0}},b.RenderTexture.prototype.renderCanvas=function(a,b,c){if(this.valid){var d=a.worldTransform;d.identity(),b&&d.append(b),a.worldAlpha=1;for(var e=a.children,f=0,g=e.length;g>f;f++)e[f].updateTransform();c&&this.textureBuffer.clear();var h=this.textureBuffer.context,i=this.renderer.resolution;this.renderer.resolution=this.resolution,this.renderer.renderDisplayObject(a,h),this.renderer.resolution=i}},b.RenderTexture.prototype.getImage=function(){var a=new Image;return a.src=this.getBase64(),a},b.RenderTexture.prototype.getBase64=function(){return this.getCanvas().toDataURL()},b.RenderTexture.prototype.getCanvas=function(){if(this.renderer.type===b.WEBGL_RENDERER){var a=this.renderer.gl,c=this.textureBuffer.width,d=this.textureBuffer.height,e=new Uint8Array(4*c*d);a.bindFramebuffer(a.FRAMEBUFFER,this.textureBuffer.frameBuffer),a.readPixels(0,0,c,d,a.RGBA,a.UNSIGNED_BYTE,e),a.bindFramebuffer(a.FRAMEBUFFER,null);var f=new b.CanvasBuffer(c,d),g=f.context.getImageData(0,0,c,d);return g.data.set(e),f.context.putImageData(g,0,0),f.canvas}return this.textureBuffer.canvas},b.RenderTexture.tempMatrix=new b.Matrix,b.VideoTexture=function(a,c){if(!a)throw new Error("No video source element specified.");(a.readyState===a.HAVE_ENOUGH_DATA||a.readyState===a.HAVE_FUTURE_DATA)&&a.width&&a.height&&(a.complete=!0),b.BaseTexture.call(this,a,c),this.autoUpdate=!1,this.updateBound=this._onUpdate.bind(this),a.complete||(this._onCanPlay=this.onCanPlay.bind(this),a.addEventListener("canplay",this._onCanPlay),a.addEventListener("canplaythrough",this._onCanPlay),a.addEventListener("play",this.onPlayStart.bind(this)),a.addEventListener("pause",this.onPlayStop.bind(this)))},b.VideoTexture.prototype=Object.create(b.BaseTexture.prototype),b.VideoTexture.constructor=b.VideoTexture,b.VideoTexture.prototype._onUpdate=function(){this.autoUpdate&&(window.requestAnimationFrame(this.updateBound),this.dirty())},b.VideoTexture.prototype.onPlayStart=function(){this.autoUpdate||(window.requestAnimationFrame(this.updateBound),this.autoUpdate=!0)},b.VideoTexture.prototype.onPlayStop=function(){this.autoUpdate=!1},b.VideoTexture.prototype.onCanPlay=function(){"canplaythrough"===event.type&&(this.hasLoaded=!0,this.source&&(this.source.removeEventListener("canplay",this._onCanPlay),this.source.removeEventListener("canplaythrough",this._onCanPlay),this.width=this.source.videoWidth,this.height=this.source.videoHeight,this.__loaded||(this.__loaded=!0,this.dispatchEvent({type:"loaded",content:this}))))},b.VideoTexture.prototype.destroy=function(){this.source&&this.source._pixiId&&(b.BaseTextureCache[this.source._pixiId]=null,delete b.BaseTextureCache[this.source._pixiId],this.source._pixiId=null,delete this.source._pixiId),b.BaseTexture.prototype.destroy.call(this)},b.VideoTexture.baseTextureFromVideo=function(a,c){a._pixiId||(a._pixiId="video_"+b.TextureCacheIdGenerator++);var d=b.BaseTextureCache[a._pixiId];return d||(d=new b.VideoTexture(a,c),b.BaseTextureCache[a._pixiId]=d),d},b.VideoTexture.textureFromVideo=function(a,c){var d=b.VideoTexture.baseTextureFromVideo(a,c);return new b.Texture(d)},b.VideoTexture.fromUrl=function(a,c){var d=document.createElement("video");return d.src=a,d.autoPlay=!0,d.play(),b.VideoTexture.textureFromVideo(d,c)},b.AssetLoader=function(a,c){this.assetURLs=a,this.crossorigin=c,this.loadersByType={jpg:b.ImageLoader,jpeg:b.ImageLoader,png:b.ImageLoader,gif:b.ImageLoader,webp:b.ImageLoader,json:b.JsonLoader,atlas:b.AtlasLoader,anim:b.SpineLoader,xml:b.BitmapFontLoader,fnt:b.BitmapFontLoader}},b.EventTarget.mixin(b.AssetLoader.prototype),b.AssetLoader.prototype.constructor=b.AssetLoader,b.AssetLoader.prototype._getDataType=function(a){var b="data:",c=a.slice(0,b.length).toLowerCase();if(c===b){var d=a.slice(b.length),e=d.indexOf(",");if(-1===e)return null;var f=d.slice(0,e).split(";")[0];return f&&"text/plain"!==f.toLowerCase()?f.split("/").pop().toLowerCase():"txt"}return null},b.AssetLoader.prototype.load=function(){function a(a){b.onAssetLoaded(a.data.content)}var b=this;this.loadCount=this.assetURLs.length;for(var c=0;c0?a.addEventListener("loadedBaseTexture",function(a){a.content.content.loadingCount<=0&&o.onLoaded()}):o.onLoaded()},n.load()}else this.onLoaded()},b.JsonLoader.prototype.onLoaded=function(){this.loaded=!0,this.dispatchEvent({type:"loaded",content:this})},b.JsonLoader.prototype.onError=function(){this.dispatchEvent({type:"error",content:this})},b.AtlasLoader=function(a,b){this.url=a,this.baseUrl=a.replace(/[^\/]*$/,""),this.crossorigin=b,this.loaded=!1},b.AtlasLoader.constructor=b.AtlasLoader,b.EventTarget.mixin(b.AtlasLoader.prototype),b.AtlasLoader.prototype.load=function(){this.ajaxRequest=new b.AjaxRequest,this.ajaxRequest.onreadystatechange=this.onAtlasLoaded.bind(this),this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/json"),this.ajaxRequest.send(null)},b.AtlasLoader.prototype.onAtlasLoaded=function(){if(4===this.ajaxRequest.readyState)if(200===this.ajaxRequest.status||-1===window.location.href.indexOf("http")){this.atlas={meta:{image:[]},frames:[]};var a=this.ajaxRequest.responseText.split(/\r?\n/),c=-3,d=0,e=null,f=!1,g=0,h=0,i=this.onLoaded.bind(this);for(g=0;g0){if(f===g)this.atlas.meta.image.push(a[g]),d=this.atlas.meta.image.length-1,this.atlas.frames.push({}),c=-3;else if(c>0)if(c%7===1)null!=e&&(this.atlas.frames[d][e.name]=e),e={name:a[g],frame:{}};else{var j=a[g].split(" ");if(c%7===3)e.frame.x=Number(j[1].replace(",","")),e.frame.y=Number(j[2]);else if(c%7===4)e.frame.w=Number(j[1].replace(",","")),e.frame.h=Number(j[2]);else if(c%7===5){var k={x:0,y:0,w:Number(j[1].replace(",","")),h:Number(j[2])};k.w>e.frame.w||k.h>e.frame.h?(e.trimmed=!0,e.realSize=k):e.trimmed=!1}}c++}if(null!=e&&(this.atlas.frames[d][e.name]=e),this.atlas.meta.image.length>0){for(this.images=[],h=0;hthis.currentImageId?(this.currentImageId++,this.images[this.currentImageId].load()):(this.loaded=!0,this.emit("loaded",{content:this}))},b.AtlasLoader.prototype.onError=function(){this.emit("error",{content:this})},b.SpriteSheetLoader=function(a,b){this.url=a,this.crossorigin=b,this.baseUrl=a.replace(/[^\/]*$/,""),this.texture=null,this.frames={}},b.SpriteSheetLoader.prototype.constructor=b.SpriteSheetLoader,b.EventTarget.mixin(b.SpriteSheetLoader.prototype),b.SpriteSheetLoader.prototype.load=function(){var a=this,c=new b.JsonLoader(this.url,this.crossorigin);c.on("loaded",function(b){a.json=b.data.content.json,a.onLoaded()}),c.load()},b.SpriteSheetLoader.prototype.onLoaded=function(){this.emit("loaded",{content:this})},b.ImageLoader=function(a,c){this.texture=b.Texture.fromImage(a,c),this.frames=[]},b.ImageLoader.prototype.constructor=b.ImageLoader,b.EventTarget.mixin(b.ImageLoader.prototype),b.ImageLoader.prototype.load=function(){this.texture.baseTexture.hasLoaded?this.onLoaded():this.texture.baseTexture.on("loaded",this.onLoaded.bind(this))},b.ImageLoader.prototype.onLoaded=function(){this.emit("loaded",{content:this})},b.ImageLoader.prototype.loadFramedSpriteSheet=function(a,c,d){this.frames=[];for(var e=Math.floor(this.texture.width/a),f=Math.floor(this.texture.height/c),g=0,h=0;f>h;h++)for(var i=0;e>i;i++,g++){var j=new b.Texture(this.texture.baseTexture,{x:i*a,y:h*c,width:a,height:c});this.frames.push(j),d&&(b.TextureCache[d+"-"+g]=j)}this.load()},b.BitmapFontLoader=function(a,b){this.url=a,this.crossorigin=b,this.baseUrl=a.replace(/[^\/]*$/,""),this.texture=null},b.BitmapFontLoader.prototype.constructor=b.BitmapFontLoader,b.EventTarget.mixin(b.BitmapFontLoader.prototype),b.BitmapFontLoader.prototype.load=function(){this.ajaxRequest=new b.AjaxRequest,this.ajaxRequest.onreadystatechange=this.onXMLLoaded.bind(this),this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/xml"),this.ajaxRequest.send(null)},b.BitmapFontLoader.prototype.onXMLLoaded=function(){if(4===this.ajaxRequest.readyState&&(200===this.ajaxRequest.status||-1===window.location.protocol.indexOf("http"))){var a=this.ajaxRequest.responseXML;if(!a||/MSIE 9/i.test(navigator.userAgent)||navigator.isCocoonJS)if("function"==typeof window.DOMParser){var c=new DOMParser;a=c.parseFromString(this.ajaxRequest.responseText,"text/xml")}else{var d=document.createElement("div");d.innerHTML=this.ajaxRequest.responseText,a=d}var e=this.baseUrl+a.getElementsByTagName("page")[0].getAttribute("file"),f=new b.ImageLoader(e,this.crossorigin);this.texture=f.texture.baseTexture;var g={},h=a.getElementsByTagName("info")[0],i=a.getElementsByTagName("common")[0];g.font=h.getAttribute("face"),g.size=parseInt(h.getAttribute("size"),10),g.lineHeight=parseInt(i.getAttribute("lineHeight"),10),g.chars={};for(var j=a.getElementsByTagName("char"),k=0;ka;a++)this.shaders[a].dirty=!0},b.AlphaMaskFilter=function(a){b.AbstractFilter.call(this),this.passes=[this],a.baseTexture._powerOf2=!0,this.uniforms={mask:{type:"sampler2D",value:a},mapDimensions:{type:"2f",value:{x:1,y:5112}},dimensions:{type:"4fv",value:[0,0,0,0]}},a.baseTexture.hasLoaded?(this.uniforms.mask.value.x=a.width,this.uniforms.mask.value.y=a.height):(this.boundLoadedFunction=this.onTextureLoaded.bind(this),a.baseTexture.on("loaded",this.boundLoadedFunction)),this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D mask;","uniform sampler2D uSampler;","uniform vec2 offset;","uniform vec4 dimensions;","uniform vec2 mapDimensions;","void main(void) {"," vec2 mapCords = vTextureCoord.xy;"," mapCords += (dimensions.zw + offset)/ dimensions.xy ;"," mapCords.y *= -1.0;"," mapCords.y += 1.0;"," mapCords *= dimensions.xy / mapDimensions;"," vec4 original = texture2D(uSampler, vTextureCoord);"," float maskAlpha = texture2D(mask, mapCords).r;"," original *= maskAlpha;"," gl_FragColor = original;","}"]},b.AlphaMaskFilter.prototype=Object.create(b.AbstractFilter.prototype),b.AlphaMaskFilter.prototype.constructor=b.AlphaMaskFilter,b.AlphaMaskFilter.prototype.onTextureLoaded=function(){this.uniforms.mapDimensions.value.x=this.uniforms.mask.value.width,this.uniforms.mapDimensions.value.y=this.uniforms.mask.value.height,this.uniforms.mask.value.baseTexture.off("loaded",this.boundLoadedFunction)},Object.defineProperty(b.AlphaMaskFilter.prototype,"map",{get:function(){return this.uniforms.mask.value},set:function(a){this.uniforms.mask.value=a}}),b.ColorMatrixFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={matrix:{type:"mat4",value:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float invert;","uniform mat4 matrix;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * matrix;","}"]},b.ColorMatrixFilter.prototype=Object.create(b.AbstractFilter.prototype),b.ColorMatrixFilter.prototype.constructor=b.ColorMatrixFilter,Object.defineProperty(b.ColorMatrixFilter.prototype,"matrix",{get:function(){return this.uniforms.matrix.value},set:function(a){this.uniforms.matrix.value=a}}),b.GrayFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={gray:{type:"1f",value:1}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","uniform float gray;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord);"," gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(0.2126*gl_FragColor.r + 0.7152*gl_FragColor.g + 0.0722*gl_FragColor.b), gray);","}"]},b.GrayFilter.prototype=Object.create(b.AbstractFilter.prototype),b.GrayFilter.prototype.constructor=b.GrayFilter,Object.defineProperty(b.GrayFilter.prototype,"gray",{get:function(){return this.uniforms.gray.value},set:function(a){this.uniforms.gray.value=a}}),b.DisplacementFilter=function(a){b.AbstractFilter.call(this),this.passes=[this],a.baseTexture._powerOf2=!0,this.uniforms={displacementMap:{type:"sampler2D",value:a},scale:{type:"2f",value:{x:30,y:30}},offset:{type:"2f",value:{x:0,y:0}},mapDimensions:{type:"2f",value:{x:1,y:5112}},dimensions:{type:"4fv",value:[0,0,0,0]}},a.baseTexture.hasLoaded?(this.uniforms.mapDimensions.value.x=a.width,this.uniforms.mapDimensions.value.y=a.height):(this.boundLoadedFunction=this.onTextureLoaded.bind(this),a.baseTexture.on("loaded",this.boundLoadedFunction)),this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D displacementMap;","uniform sampler2D uSampler;","uniform vec2 scale;","uniform vec2 offset;","uniform vec4 dimensions;","uniform vec2 mapDimensions;","void main(void) {"," vec2 mapCords = vTextureCoord.xy;"," mapCords += (dimensions.zw + offset)/ dimensions.xy ;"," mapCords.y *= -1.0;"," mapCords.y += 1.0;"," vec2 matSample = texture2D(displacementMap, mapCords).xy;"," matSample -= 0.5;"," matSample *= scale;"," matSample /= mapDimensions;"," gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + matSample.x, vTextureCoord.y + matSample.y));"," gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb, 1.0);"," vec2 cord = vTextureCoord;","}"]},b.DisplacementFilter.prototype=Object.create(b.AbstractFilter.prototype),b.DisplacementFilter.prototype.constructor=b.DisplacementFilter,b.DisplacementFilter.prototype.onTextureLoaded=function(){this.uniforms.mapDimensions.value.x=this.uniforms.displacementMap.value.width,this.uniforms.mapDimensions.value.y=this.uniforms.displacementMap.value.height,this.uniforms.displacementMap.value.baseTexture.off("loaded",this.boundLoadedFunction)},Object.defineProperty(b.DisplacementFilter.prototype,"map",{get:function(){return this.uniforms.displacementMap.value},set:function(a){this.uniforms.displacementMap.value=a}}),Object.defineProperty(b.DisplacementFilter.prototype,"scale",{get:function(){return this.uniforms.scale.value},set:function(a){this.uniforms.scale.value=a}}),Object.defineProperty(b.DisplacementFilter.prototype,"offset",{get:function(){return this.uniforms.offset.value},set:function(a){this.uniforms.offset.value=a}}),b.PixelateFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={invert:{type:"1f",value:0},dimensions:{type:"4fv",value:new b.Float32Array([1e4,100,10,10])},pixelSize:{type:"2f",value:{x:10,y:10}}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform vec2 testDim;","uniform vec4 dimensions;","uniform vec2 pixelSize;","uniform sampler2D uSampler;","void main(void) {"," vec2 coord = vTextureCoord;"," vec2 size = dimensions.xy/pixelSize;"," vec2 color = floor( ( vTextureCoord * size ) ) / size + pixelSize/dimensions.xy * 0.5;"," gl_FragColor = texture2D(uSampler, color);","}"]},b.PixelateFilter.prototype=Object.create(b.AbstractFilter.prototype),b.PixelateFilter.prototype.constructor=b.PixelateFilter,Object.defineProperty(b.PixelateFilter.prototype,"size",{get:function(){return this.uniforms.pixelSize.value},set:function(a){this.dirty=!0,this.uniforms.pixelSize.value=a}}),b.BlurXFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={blur:{type:"1f",value:1/512}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float blur;","uniform sampler2D uSampler;","void main(void) {"," vec4 sum = vec4(0.0);"," sum += texture2D(uSampler, vec2(vTextureCoord.x - 4.0*blur, vTextureCoord.y)) * 0.05;"," sum += texture2D(uSampler, vec2(vTextureCoord.x - 3.0*blur, vTextureCoord.y)) * 0.09;"," sum += texture2D(uSampler, vec2(vTextureCoord.x - 2.0*blur, vTextureCoord.y)) * 0.12;"," sum += texture2D(uSampler, vec2(vTextureCoord.x - blur, vTextureCoord.y)) * 0.15;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;"," sum += texture2D(uSampler, vec2(vTextureCoord.x + blur, vTextureCoord.y)) * 0.15;"," sum += texture2D(uSampler, vec2(vTextureCoord.x + 2.0*blur, vTextureCoord.y)) * 0.12;"," sum += texture2D(uSampler, vec2(vTextureCoord.x + 3.0*blur, vTextureCoord.y)) * 0.09;"," sum += texture2D(uSampler, vec2(vTextureCoord.x + 4.0*blur, vTextureCoord.y)) * 0.05;"," gl_FragColor = sum;","}"]},b.BlurXFilter.prototype=Object.create(b.AbstractFilter.prototype),b.BlurXFilter.prototype.constructor=b.BlurXFilter,Object.defineProperty(b.BlurXFilter.prototype,"blur",{get:function(){return this.uniforms.blur.value/(1/7e3)},set:function(a){this.dirty=!0,this.uniforms.blur.value=1/7e3*a}}),b.BlurYFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={blur:{type:"1f",value:1/512}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float blur;","uniform sampler2D uSampler;","void main(void) {"," vec4 sum = vec4(0.0);"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 4.0*blur)) * 0.05;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 3.0*blur)) * 0.09;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 2.0*blur)) * 0.12;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - blur)) * 0.15;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + blur)) * 0.15;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 2.0*blur)) * 0.12;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 3.0*blur)) * 0.09;"," sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 4.0*blur)) * 0.05;"," gl_FragColor = sum;","}"]},b.BlurYFilter.prototype=Object.create(b.AbstractFilter.prototype),b.BlurYFilter.prototype.constructor=b.BlurYFilter,Object.defineProperty(b.BlurYFilter.prototype,"blur",{get:function(){return this.uniforms.blur.value/(1/7e3)},set:function(a){this.uniforms.blur.value=1/7e3*a}}),b.BlurFilter=function(){this.blurXFilter=new b.BlurXFilter,this.blurYFilter=new b.BlurYFilter,this.passes=[this.blurXFilter,this.blurYFilter]},b.BlurFilter.prototype=Object.create(b.AbstractFilter.prototype),b.BlurFilter.prototype.constructor=b.BlurFilter,Object.defineProperty(b.BlurFilter.prototype,"blur",{get:function(){return this.blurXFilter.blur},set:function(a){this.blurXFilter.blur=this.blurYFilter.blur=a}}),Object.defineProperty(b.BlurFilter.prototype,"blurX",{get:function(){return this.blurXFilter.blur},set:function(a){this.blurXFilter.blur=a}}),Object.defineProperty(b.BlurFilter.prototype,"blurY",{get:function(){return this.blurYFilter.blur},set:function(a){this.blurYFilter.blur=a}}),b.InvertFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={invert:{type:"1f",value:1}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float invert;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord);"," gl_FragColor.rgb = mix( (vec3(1)-gl_FragColor.rgb) * gl_FragColor.a, gl_FragColor.rgb, 1.0 - invert);","}"]},b.InvertFilter.prototype=Object.create(b.AbstractFilter.prototype),b.InvertFilter.prototype.constructor=b.InvertFilter,Object.defineProperty(b.InvertFilter.prototype,"invert",{get:function(){return this.uniforms.invert.value},set:function(a){this.uniforms.invert.value=a}}),b.SepiaFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={sepia:{type:"1f",value:1}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float sepia;","uniform sampler2D uSampler;","const mat3 sepiaMatrix = mat3(0.3588, 0.7044, 0.1368, 0.2990, 0.5870, 0.1140, 0.2392, 0.4696, 0.0912);","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord);"," gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb * sepiaMatrix, sepia);","}"]},b.SepiaFilter.prototype=Object.create(b.AbstractFilter.prototype),b.SepiaFilter.prototype.constructor=b.SepiaFilter,Object.defineProperty(b.SepiaFilter.prototype,"sepia",{get:function(){return this.uniforms.sepia.value},set:function(a){this.uniforms.sepia.value=a}}),b.TwistFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={radius:{type:"1f",value:.5},angle:{type:"1f",value:5},offset:{type:"2f",value:{x:.5,y:.5}}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform vec4 dimensions;","uniform sampler2D uSampler;","uniform float radius;","uniform float angle;","uniform vec2 offset;","void main(void) {"," vec2 coord = vTextureCoord - offset;"," float distance = length(coord);"," if (distance < radius) {"," float ratio = (radius - distance) / radius;"," float angleMod = ratio * ratio * angle;"," float s = sin(angleMod);"," float c = cos(angleMod);"," coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);"," }"," gl_FragColor = texture2D(uSampler, coord+offset);","}"]},b.TwistFilter.prototype=Object.create(b.AbstractFilter.prototype),b.TwistFilter.prototype.constructor=b.TwistFilter,Object.defineProperty(b.TwistFilter.prototype,"offset",{get:function(){return this.uniforms.offset.value},set:function(a){this.dirty=!0,this.uniforms.offset.value=a}}),Object.defineProperty(b.TwistFilter.prototype,"radius",{get:function(){return this.uniforms.radius.value},set:function(a){this.dirty=!0,this.uniforms.radius.value=a}}),Object.defineProperty(b.TwistFilter.prototype,"angle",{get:function(){return this.uniforms.angle.value},set:function(a){this.dirty=!0,this.uniforms.angle.value=a}}),b.ColorStepFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={step:{type:"1f",value:5}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","uniform float step;","void main(void) {"," vec4 color = texture2D(uSampler, vTextureCoord);"," color = floor(color * step) / step;"," gl_FragColor = color;","}"]},b.ColorStepFilter.prototype=Object.create(b.AbstractFilter.prototype),b.ColorStepFilter.prototype.constructor=b.ColorStepFilter,Object.defineProperty(b.ColorStepFilter.prototype,"step",{get:function(){return this.uniforms.step.value},set:function(a){this.uniforms.step.value=a}}),b.DotScreenFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={scale:{type:"1f",value:1},angle:{type:"1f",value:5},dimensions:{type:"4fv",value:[0,0,0,0]}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform vec4 dimensions;","uniform sampler2D uSampler;","uniform float angle;","uniform float scale;","float pattern() {"," float s = sin(angle), c = cos(angle);"," vec2 tex = vTextureCoord * dimensions.xy;"," vec2 point = vec2("," c * tex.x - s * tex.y,"," s * tex.x + c * tex.y"," ) * scale;"," return (sin(point.x) * sin(point.y)) * 4.0;","}","void main() {"," vec4 color = texture2D(uSampler, vTextureCoord);"," float average = (color.r + color.g + color.b) / 3.0;"," gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);","}"]},b.DotScreenFilter.prototype=Object.create(b.AbstractFilter.prototype),b.DotScreenFilter.prototype.constructor=b.DotScreenFilter,Object.defineProperty(b.DotScreenFilter.prototype,"scale",{get:function(){return this.uniforms.scale.value},set:function(a){this.dirty=!0,this.uniforms.scale.value=a}}),Object.defineProperty(b.DotScreenFilter.prototype,"angle",{get:function(){return this.uniforms.angle.value},set:function(a){this.dirty=!0,this.uniforms.angle.value=a}}),b.CrossHatchFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={blur:{type:"1f",value:1/512}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform float blur;","uniform sampler2D uSampler;","void main(void) {"," float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);"," gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);"," if (lum < 1.00) {"," if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {"," gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);"," }"," }"," if (lum < 0.75) {"," if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {"," gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);"," }"," }"," if (lum < 0.50) {"," if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {"," gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);"," }"," }"," if (lum < 0.3) {"," if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {"," gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);"," }"," }","}"]},b.CrossHatchFilter.prototype=Object.create(b.AbstractFilter.prototype),b.CrossHatchFilter.prototype.constructor=b.CrossHatchFilter,Object.defineProperty(b.CrossHatchFilter.prototype,"blur",{get:function(){return this.uniforms.blur.value/(1/7e3)},set:function(a){this.uniforms.blur.value=1/7e3*a}}),b.RGBSplitFilter=function(){b.AbstractFilter.call(this),this.passes=[this],this.uniforms={red:{type:"2f",value:{x:20,y:20}},green:{type:"2f",value:{x:-20,y:20}},blue:{type:"2f",value:{x:20,y:-20}},dimensions:{type:"4fv",value:[0,0,0,0]}},this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform vec2 red;","uniform vec2 green;","uniform vec2 blue;","uniform vec4 dimensions;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/dimensions.xy).r;"," gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/dimensions.xy).g;"," gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/dimensions.xy).b;"," gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;","}"]},b.RGBSplitFilter.prototype=Object.create(b.AbstractFilter.prototype),b.RGBSplitFilter.prototype.constructor=b.RGBSplitFilter,Object.defineProperty(b.RGBSplitFilter.prototype,"red",{get:function(){return this.uniforms.red.value},set:function(a){this.uniforms.red.value=a}}),Object.defineProperty(b.RGBSplitFilter.prototype,"green",{get:function(){return this.uniforms.green.value},set:function(a){this.uniforms.green.value=a}}),Object.defineProperty(b.RGBSplitFilter.prototype,"blue",{get:function(){return this.uniforms.blue.value},set:function(a){this.uniforms.blue.value=a}}),"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=b),exports.PIXI=b):"undefined"!=typeof define&&define.amd?define(b):a.PIXI=b}).call(this); \ No newline at end of file diff --git a/tutorial-4/pixi.js-master/bower.json b/tutorial-4/pixi.js-master/bower.json deleted file mode 100755 index 7d5d86b..0000000 --- a/tutorial-4/pixi.js-master/bower.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "pixi.js", - "version": "2.2.7", - - "main": "bin/pixi.dev.js", - - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test" - ], - "dependencies": { - }, - "devDependencies": { - } -} diff --git a/tutorial-4/pixi.js-master/docs/api.js b/tutorial-4/pixi.js-master/docs/api.js deleted file mode 100755 index c298d63..0000000 --- a/tutorial-4/pixi.js-master/docs/api.js +++ /dev/null @@ -1,100 +0,0 @@ -YUI.add("yuidoc-meta", function(Y) { - Y.YUIDoc = { meta: { - "classes": [ - "AbstractFilter", - "AjaxRequest", - "AlphaMaskFilter", - "AsciiFilter", - "AssetLoader", - "AtlasLoader", - "BaseTexture", - "BitmapFontLoader", - "BitmapText", - "BlurFilter", - "BlurXFilter", - "BlurYFilter", - "CanvasBuffer", - "CanvasGraphics", - "CanvasMaskManager", - "CanvasRenderer", - "CanvasTinter", - "Circle", - "ColorMatrixFilter", - "ColorStepFilter", - "ComplexPrimitiveShader", - "ConvolutionFilter", - "CrossHatchFilter", - "DisplacementFilter", - "DisplayObject", - "DisplayObjectContainer", - "DotScreenFilter", - "Ellipse", - "Event", - "EventTarget", - "FilterBlock", - "FilterTexture", - "Graphics", - "GraphicsData", - "GrayFilter", - "ImageLoader", - "InteractionData", - "InteractionManager", - "InvertFilter", - "JsonLoader", - "Matrix", - "MovieClip", - "NoiseFilter", - "NormalMapFilter", - "PixelateFilter", - "PixiFastShader", - "PixiShader", - "Point", - "PolyK", - "Polygon", - "PrimitiveShader", - "RGBSplitFilter", - "Rectangle", - "RenderTexture", - "Rope", - "Rounded Rectangle", - "SepiaFilter", - "SmartBlurFilter", - "Spine", - "SpineLoader", - "Sprite", - "SpriteBatch", - "SpriteSheetLoader", - "Stage", - "Strip", - "StripShader", - "Text", - "Texture", - "TilingSprite", - "TiltShiftFilter", - "TiltShiftXFilter", - "TiltShiftYFilter", - "TwistFilter", - "WebGLBlendModeManager", - "WebGLFastSpriteBatch", - "WebGLFilterManager", - "WebGLGraphics", - "WebGLGraphicsData", - "WebGLMaskManager", - "WebGLRenderer", - "WebGLShaderManager", - "WebGLSpriteBatch", - "WebGLStencilManager", - "autoDetectRecommendedRenderer", - "autoDetectRenderer" - ], - "modules": [ - "PIXI" - ], - "allModules": [ - { - "displayName": "PIXI", - "name": "PIXI" - } - ] -} }; -}); \ No newline at end of file diff --git a/tutorial-4/pixi.js-master/docs/assets/css/external-small.png b/tutorial-4/pixi.js-master/docs/assets/css/external-small.png deleted file mode 100755 index 759a1cd..0000000 Binary files a/tutorial-4/pixi.js-master/docs/assets/css/external-small.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/docs/assets/css/logo.png b/tutorial-4/pixi.js-master/docs/assets/css/logo.png deleted file mode 100755 index 609b336..0000000 Binary files a/tutorial-4/pixi.js-master/docs/assets/css/logo.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/docs/assets/css/main.css b/tutorial-4/pixi.js-master/docs/assets/css/main.css deleted file mode 100755 index d745d44..0000000 --- a/tutorial-4/pixi.js-master/docs/assets/css/main.css +++ /dev/null @@ -1,783 +0,0 @@ -/* -Font sizes for all selectors other than the body are given in percentages, -with 100% equal to 13px. To calculate a font size percentage, multiply the -desired size in pixels by 7.6923076923. - -Here's a quick lookup table: - -10px - 76.923% -11px - 84.615% -12px - 92.308% -13px - 100% -14px - 107.692% -15px - 115.385% -16px - 123.077% -17px - 130.769% -18px - 138.462% -19px - 146.154% -20px - 153.846% -*/ - -html { - background: #fff; - color: #333; - overflow-y: scroll; -} - -body { - /*font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif;*/ - font: 13px/1.4 'Helvetica', 'Arial', sans-serif; - margin: 0; - padding: 0; -} - -/* -- Links ----------------------------------------------------------------- */ -a { - color: #356de4; - text-decoration: none; -} - -.hidden { - display: none; -} - -a:hover { text-decoration: underline; } - -/* "Jump to Table of Contents" link is shown to assistive tools, but hidden from - sight until it's focused. */ -.jump { - position: absolute; - padding: 3px 6px; - left: -99999px; - top: 0; -} - -.jump:focus { left: 40%; } - -/* -- Paragraphs ------------------------------------------------------------ */ -p { margin: 1.3em 0; } -dd p, td p { margin-bottom: 0; } -dd p:first-child, td p:first-child { margin-top: 0; } - -/* -- Headings -------------------------------------------------------------- */ -h1, h2, h3, h4, h5, h6 { - color: #D98527;/*was #f80*/ - font-family: 'Trebuchet MS', sans-serif; - font-weight: bold; - line-height: 1.1; - margin: 1.1em 0 0.5em; -} - -h1 { - font-size: 184.6%; - color: #30418C; - margin: 0.75em 0 0.5em; -} - -h2 { - font-size: 153.846%; - color: #E48A2B; -} - -h3 { font-size: 138.462%; } - -h4 { - border-bottom: 1px solid #DBDFEA; - color: #E48A2B; - font-size: 115.385%; - font-weight: normal; - padding-bottom: 2px; -} - -h5, h6 { font-size: 107.692%; } - -/* -- Code and examples ----------------------------------------------------- */ -code, kbd, pre, samp { - font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; - font-size: 92.308%; - line-height: 1.35; -} - -p code, p kbd, p samp { - background: #FCFBFA; - border: 1px solid #EFEEED; - padding: 0 3px; -} - -a code, a kbd, a samp, -pre code, pre kbd, pre samp, -table code, table kbd, table samp, -.intro code, .intro kbd, .intro samp, -.toc code, .toc kbd, .toc samp { - background: none; - border: none; - padding: 0; -} - -pre.code, pre.terminal, pre.cmd { - overflow-x: auto; - *overflow-x: scroll; - padding: 0.3em 0.6em; -} - -pre.code { - background: #FCFBFA; - border: 1px solid #EFEEED; - border-left-width: 5px; -} - -pre.terminal, pre.cmd { - background: #F0EFFC; - border: 1px solid #D0CBFB; - border-left: 5px solid #D0CBFB; -} - -/* Don't reduce the font size of // elements inside
    -   blocks. */
    -pre code, pre kbd, pre samp { font-size: 100%; }
    -
    -/* Used to denote text that shouldn't be selectable, such as line numbers or
    -   shell prompts. Guess which browser this doesn't work in. */
    -.noselect {
    -    -moz-user-select: -moz-none;
    -    -khtml-user-select: none;
    -    -webkit-user-select: none;
    -    -o-user-select: none;
    -    user-select: none;
    -}
    -
    -/* -- Lists ----------------------------------------------------------------- */
    -dd { margin: 0.2em 0 0.7em 1em; }
    -dl { margin: 1em 0; }
    -dt { font-weight: bold; }
    -
    -/* -- Tables ---------------------------------------------------------------- */
    -caption, th { text-align: left; }
    -
    -table {
    -    border-collapse: collapse;
    -    width: 100%;
    -}
    -
    -td, th {
    -    border: 1px solid #fff;
    -    padding: 5px 12px;
    -    vertical-align: top;
    -}
    -
    -td { background: #E6E9F5; }
    -td dl { margin: 0; }
    -td dl dl { margin: 1em 0; }
    -td pre:first-child { margin-top: 0; }
    -
    -th {
    -    background: #D2D7E6;/*#97A0BF*/
    -    border-bottom: none;
    -    border-top: none;
    -    color: #000;/*#FFF1D5*/
    -    font-family: 'Trebuchet MS', sans-serif;
    -    font-weight: bold;
    -    line-height: 1.3;
    -    white-space: nowrap;
    -}
    -
    -
    -/* -- Layout and Content ---------------------------------------------------- */
    -#doc {
    -    margin: auto;
    -    min-width: 1024px;
    -}
    -
    -.content { padding: 0 20px 0 25px; }
    -
    -.sidebar {
    -    padding: 0 15px 0 10px;
    -}
    -#bd {
    -    padding: 7px 0 130px;
    -    position: relative;
    -    width: 99%;
    -}
    -
    -/* -- Table of Contents ----------------------------------------------------- */
    -
    -/* The #toc id refers to the single global table of contents, while the .toc
    -   class refers to generic TOC lists that could be used throughout the page. */
    -
    -.toc code, .toc kbd, .toc samp { font-size: 100%; }
    -.toc li { font-weight: bold; }
    -.toc li li { font-weight: normal; }
    -
    -/* -- Intro and Example Boxes ----------------------------------------------- */
    -/*
    -.intro, .example { margin-bottom: 2em; }
    -.example {
    -    -moz-border-radius: 4px;
    -    -webkit-border-radius: 4px;
    -    border-radius: 4px;
    -    -moz-box-shadow: 0 0 5px #bfbfbf;
    -    -webkit-box-shadow: 0 0 5px #bfbfbf;
    -    box-shadow: 0 0 5px #bfbfbf;
    -    padding: 1em;
    -}
    -.intro {
    -    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
    -}
    -*/
    -
    -/* -- Other Styles ---------------------------------------------------------- */
    -
    -/* These are probably YUI-specific, and should be moved out of Selleck's default
    -   theme. */
    -
    -.button {
    -    border: 1px solid #dadada;
    -    -moz-border-radius: 3px;
    -    -webkit-border-radius: 3px;
    -    border-radius: 3px;
    -    color: #444;
    -    display: inline-block;
    -    font-family: Helvetica, Arial, sans-serif;
    -    font-size: 92.308%;
    -    font-weight: bold;
    -    padding: 4px 13px 3px;
    -    -moz-text-shadow: 1px 1px 0 #fff;
    -    -webkit-text-shadow: 1px 1px 0 #fff;
    -    text-shadow: 1px 1px 0 #fff;
    -    white-space: nowrap;
    -
    -    background: #EFEFEF; /* old browsers */
    -    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    -    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    -    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
    -}
    -
    -.button:hover {
    -    border-color: #466899;
    -    color: #fff;
    -    text-decoration: none;
    -    -moz-text-shadow: 1px 1px 0 #222;
    -    -webkit-text-shadow: 1px 1px 0 #222;
    -    text-shadow: 1px 1px 0 #222;
    -
    -    background: #6396D8; /* old browsers */
    -    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    -    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    -    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
    -}
    -
    -.newwindow { text-align: center; }
    -
    -.header .version em {
    -    display: block;
    -    text-align: right;
    -}
    -
    -
    -#classdocs .item {
    -    border-bottom: 1px solid #466899;
    -    margin: 1em 0;
    -    padding: 1.5em;
    -}
    -
    -#classdocs .item .params p,
    -    #classdocs .item .returns p,{
    -    display: inline;
    -}
    -
    -#classdocs .item em code, #classdocs .item em.comment {
    -    color: green;
    -}
    -
    -#classdocs .item em.comment a {
    -    color: green;
    -    text-decoration: underline;
    -}
    -
    -#classdocs .foundat {
    -    font-size: 11px;
    -    font-style: normal;
    -}
    -
    -.attrs .emits {
    -    margin-left: 2em;
    -    padding: .5em;
    -    border-left: 1px dashed #ccc;
    -}
    -
    -abbr {
    -    border-bottom: 1px dashed #ccc;
    -    font-size: 80%;
    -    cursor: help;
    -}
    -
    -.prettyprint li.L0, 
    -.prettyprint li.L1, 
    -.prettyprint li.L2, 
    -.prettyprint li.L3, 
    -.prettyprint li.L5, 
    -.prettyprint li.L6, 
    -.prettyprint li.L7, 
    -.prettyprint li.L8 {
    -    list-style: decimal;
    -}
    -
    -ul li p {
    -    margin-top: 0;
    -}
    -
    -.method .name {
    -    font-size: 110%;
    -}
    -
    -.apidocs .methods .extends .method,
    -.apidocs .properties .extends .property,
    -.apidocs .attrs .extends .attr,
    -.apidocs .events .extends .event {
    -    font-weight: bold;
    -}
    -
    -.apidocs .methods .extends .inherited,
    -.apidocs .properties .extends .inherited,
    -.apidocs .attrs .extends .inherited,
    -.apidocs .events .extends .inherited {
    -    font-weight: normal;
    -}
    -
    -#hd {
    -    background: whiteSmoke;
    -    background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
    -    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
    -    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
    -    border-bottom: 1px solid #DFDFDF;
    -    padding: 0 15px 1px 20px;
    -    margin-bottom: 15px;
    -}
    -
    -#hd img {
    -    margin-right: 10px;
    -    vertical-align: middle;
    -}
    -
    -
    -/* -- API Docs CSS ---------------------------------------------------------- */
    -
    -/*
    -This file is organized so that more generic styles are nearer the top, and more
    -specific styles are nearer the bottom of the file. This allows us to take full
    -advantage of the cascade to avoid redundant style rules. Please respect this
    -convention when making changes.
    -*/
    -
    -/* -- Generic TabView styles ------------------------------------------------ */
    -
    -/*
    -These styles apply to all API doc tabviews. To change styles only for a
    -specific tabview, see the other sections below.
    -*/
    -
    -.yui3-js-enabled .apidocs .tabview {
    -    visibility: hidden; /* Hide until the TabView finishes rendering. */
    -    _visibility: visible;
    -}
    -
    -.apidocs .tabview.yui3-tabview-content { visibility: visible; }
    -.apidocs .tabview .yui3-tabview-panel { background: #fff; }
    -
    -/* -- Generic Content Styles ------------------------------------------------ */
    -
    -/* Headings */
    -h2, h3, h4, h5, h6 {
    -    border: none;
    -    color: #30418C;
    -    font-weight: bold;
    -    text-decoration: none;
    -}
    -
    -.link-docs {
    -    float: right;
    -    font-size: 15px;
    -    margin: 4px 4px 6px;
    -    padding: 6px 30px 5px;
    -}
    -
    -.apidocs { zoom: 1; }
    -
    -/* Generic box styles. */
    -.apidocs .box {
    -    border: 1px solid;
    -    border-radius: 3px;
    -    margin: 1em 0;
    -    padding: 0 1em;
    -}
    -
    -/* A flag is a compact, capsule-like indicator of some kind. It's used to
    -   indicate private and protected items, item return types, etc. in an
    -   attractive and unobtrusive way. */
    -.apidocs .flag {
    -    background: #bababa;
    -    border-radius: 3px;
    -    color: #fff;
    -    font-size: 11px;
    -    margin: 0 0.5em;
    -    padding: 2px 4px 1px;
    -}
    -
    -/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
    -.apidocs .meta {
    -    background: #f9f9f9;
    -    border-color: #efefef;
    -    color: #555;
    -    font-size: 11px;
    -    padding: 3px 6px;
    -}
    -
    -.apidocs .meta p { margin: 0; }
    -
    -/* Deprecation warning. */
    -.apidocs .box.deprecated,
    -.apidocs .flag.deprecated {
    -    background: #fdac9f;
    -    border: 1px solid #fd7775;
    -}
    -
    -.apidocs .box.deprecated p { margin: 0.5em 0; }
    -.apidocs .flag.deprecated { color: #333; }
    -
    -/* Module/Class intro description. */
    -.apidocs .intro {
    -    background: #f0f1f8;
    -    border-color: #d4d8eb;
    -}
    -
    -/* Loading spinners. */
    -#bd.loading .apidocs,
    -#api-list.loading .yui3-tabview-panel {
    -    background: #fff url(../img/spinner.gif) no-repeat center 70px;
    -    min-height: 150px;
    -}
    -
    -#bd.loading .apidocs .content,
    -#api-list.loading .yui3-tabview-panel .apis {
    -    display: none;
    -}
    -
    -.apidocs .no-visible-items { color: #666; }
    -
    -/* Generic inline list. */
    -.apidocs ul.inline {
    -    display: inline;
    -    list-style: none;
    -    margin: 0;
    -    padding: 0;
    -}
    -
    -.apidocs ul.inline li { display: inline; }
    -
    -/* Comma-separated list. */
    -.apidocs ul.commas li:after { content: ','; }
    -.apidocs ul.commas li:last-child:after { content: ''; }
    -
    -/* Keyboard shortcuts. */
    -kbd .cmd { font-family: Monaco, Helvetica; }
    -
    -/* -- Generic Access Level styles ------------------------------------------- */
    -.apidocs .item.protected,
    -.apidocs .item.private,
    -.apidocs .index-item.protected,
    -.apidocs .index-item.deprecated,
    -.apidocs .index-item.private {
    -    display: none;
    -}
    -
    -.show-deprecated .item.deprecated,
    -.show-deprecated .index-item.deprecated,
    -.show-protected .item.protected,
    -.show-protected .index-item.protected,
    -.show-private .item.private,
    -.show-private .index-item.private {
    -    display: block;
    -}
    -
    -.hide-inherited .item.inherited,
    -.hide-inherited .index-item.inherited {
    -    display: none;
    -}
    -
    -/* -- Generic Item Index styles --------------------------------------------- */
    -.apidocs .index { margin: 1.5em 0 3em; }
    -
    -.apidocs .index h3 {
    -    border-bottom: 1px solid #efefef;
    -    color: #333;
    -    font-size: 13px;
    -    margin: 2em 0 0.6em;
    -    padding-bottom: 2px;
    -}
    -
    -.apidocs .index .no-visible-items { margin-top: 2em; }
    -
    -.apidocs .index-list {
    -    border-color: #efefef;
    -    font-size: 12px;
    -    list-style: none;
    -    margin: 0;
    -    padding: 0;
    -    -moz-column-count: 4;
    -    -moz-column-gap: 10px;
    -    -moz-column-width: 170px;
    -    -ms-column-count: 4;
    -    -ms-column-gap: 10px;
    -    -ms-column-width: 170px;
    -    -o-column-count: 4;
    -    -o-column-gap: 10px;
    -    -o-column-width: 170px;
    -    -webkit-column-count: 4;
    -    -webkit-column-gap: 10px;
    -    -webkit-column-width: 170px;
    -    column-count: 4;
    -    column-gap: 10px;
    -    column-width: 170px;
    -}
    -
    -.apidocs .no-columns .index-list {
    -    -moz-column-count: 1;
    -    -ms-column-count: 1;
    -    -o-column-count: 1;
    -    -webkit-column-count: 1;
    -    column-count: 1;
    -}
    -
    -.apidocs .index-item { white-space: nowrap; }
    -
    -.apidocs .index-item .flag {
    -    background: none;
    -    border: none;
    -    color: #afafaf;
    -    display: inline;
    -    margin: 0 0 0 0.2em;
    -    padding: 0;
    -}
    -
    -/* -- Generic API item styles ----------------------------------------------- */
    -.apidocs .args {
    -    display: inline;
    -    margin: 0 0.5em;
    -}
    -
    -.apidocs .flag.chainable { background: #46ca3b; }
    -.apidocs .flag.protected { background: #9b86fc; }
    -.apidocs .flag.private { background: #fd6b1b; }
    -.apidocs .flag.async { background: #356de4; }
    -.apidocs .flag.required { background: #e60923; }
    -
    -.apidocs .item {
    -    border-bottom: 1px solid #efefef;
    -    margin: 1.5em 0 2em;
    -    padding-bottom: 2em;
    -}
    -
    -.apidocs .item h4,
    -.apidocs .item h5,
    -.apidocs .item h6 {
    -    color: #333;
    -    font-family: inherit;
    -    font-size: 100%;
    -}
    -
    -.apidocs .item .description p,
    -.apidocs .item pre.code {
    -    margin: 1em 0 0;
    -}
    -
    -.apidocs .item .meta {
    -    background: none;
    -    border: none;
    -    padding: 0;
    -}
    -
    -.apidocs .item .name {
    -    display: inline;
    -    font-size: 14px;
    -}
    -
    -.apidocs .item .type,
    -.apidocs .item .type a,
    -.apidocs .returns-inline {
    -    color: #555;
    -}
    -
    -.apidocs .item .type,
    -.apidocs .returns-inline {
    -    font-size: 11px;
    -    margin: 0 0 0 0;
    -}
    -
    -.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
    -.apidocs .item .type a:hover { border: none; }
    -
    -/* -- Item Parameter List --------------------------------------------------- */
    -.apidocs .params-list {
    -    list-style: square;
    -    margin: 1em 0 0 2em;
    -    padding: 0;
    -}
    -
    -.apidocs .param { margin-bottom: 1em; }
    -
    -.apidocs .param .type,
    -.apidocs .param .type a {
    -    color: #666;
    -}
    -
    -.apidocs .param .type {
    -    margin: 0 0 0 0.5em;
    -    *margin-left: 0.5em;
    -}
    -
    -.apidocs .param-name { font-weight: bold; }
    -
    -/* -- Item "Emits" block ---------------------------------------------------- */
    -.apidocs .item .emits {
    -    background: #f9f9f9;
    -    border-color: #eaeaea;
    -}
    -
    -/* -- Item "Returns" block -------------------------------------------------- */
    -.apidocs .item .returns .type,
    -.apidocs .item .returns .type a {
    -    font-size: 100%;
    -    margin: 0;
    -}
    -
    -/* -- Class Constructor block ----------------------------------------------- */
    -.apidocs .constructor .item {
    -    border: none;
    -    padding-bottom: 0;
    -}
    -
    -/* -- File Source View ------------------------------------------------------ */
    -.apidocs .file pre.code,
    -#doc .apidocs .file pre.prettyprint {
    -    background: inherit;
    -    border: none;
    -    overflow: visible;
    -    padding: 0;
    -}
    -
    -.apidocs .L0,
    -.apidocs .L1,
    -.apidocs .L2,
    -.apidocs .L3,
    -.apidocs .L4,
    -.apidocs .L5,
    -.apidocs .L6,
    -.apidocs .L7,
    -.apidocs .L8,
    -.apidocs .L9 {
    -    background: inherit;
    -}
    -
    -/* -- Submodule List -------------------------------------------------------- */
    -.apidocs .module-submodule-description {
    -    font-size: 12px;
    -    margin: 0.3em 0 1em;
    -}
    -
    -.apidocs .module-submodule-description p:first-child { margin-top: 0; }
    -
    -/* -- Sidebar TabView ------------------------------------------------------- */
    -#api-tabview { margin-top: 0.6em; }
    -
    -#api-tabview-filter,
    -#api-tabview-panel {
    -    border: 1px solid #dfdfdf;
    -}
    -
    -#api-tabview-filter {
    -    border-bottom: none;
    -    border-top: none;
    -    padding: 0.6em 10px 0 10px;
    -}
    -
    -#api-tabview-panel { border-top: none; }
    -#api-filter { width: 97%; }
    -
    -/* -- Content TabView ------------------------------------------------------- */
    -#classdocs .yui3-tabview-panel { border: none; }
    -
    -/* -- Source File Contents -------------------------------------------------- */
    -.prettyprint li.L0,
    -.prettyprint li.L1,
    -.prettyprint li.L2,
    -.prettyprint li.L3,
    -.prettyprint li.L5,
    -.prettyprint li.L6,
    -.prettyprint li.L7,
    -.prettyprint li.L8 {
    -    list-style: decimal;
    -}
    -
    -/* -- API options ----------------------------------------------------------- */
    -#api-options {
    -    font-size: 11px;
    -    margin-top: 2.2em;
    -    position: absolute;
    -    right: 1.5em;
    -}
    -
    -/*#api-options label { margin-right: 0.6em; }*/
    -
    -/* -- API list -------------------------------------------------------------- */
    -#api-list {
    -    margin-top: 1.5em;
    -    *zoom: 1;
    -}
    -
    -.apis {
    -    font-size: 12px;
    -    line-height: 1.4;
    -    list-style: none;
    -    margin: 0;
    -    padding: 0.5em 0 0.5em 0.4em;
    -}
    -
    -.apis a {
    -    border: 1px solid transparent;
    -    display: block;
    -    margin: 0 0 0 -4px;
    -    padding: 1px 4px 0;
    -    text-decoration: none;
    -    _border: none;
    -    _display: inline;
    -}
    -
    -.apis a:hover,
    -.apis a:focus {
    -    background: #E8EDFC;
    -    background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
    -    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
    -    border-color: #AAC0FA;
    -    border-radius: 3px;
    -    color: #333;
    -    outline: none;
    -}
    -
    -.api-list-item a:hover,
    -.api-list-item a:focus {
    -    font-weight: bold;
    -    text-shadow: 1px 1px 1px #fff;
    -}
    -
    -.apis .message { color: #888; }
    -.apis .result a { padding: 3px 5px 2px; }
    -
    -.apis .result .type {
    -    right: 4px;
    -    top: 7px;
    -}
    -
    -.api-list-item .yui3-highlight {
    -    font-weight: bold;
    -}
    -
    diff --git a/tutorial-4/pixi.js-master/docs/assets/favicon.png b/tutorial-4/pixi.js-master/docs/assets/favicon.png
    deleted file mode 100755
    index 5a95dda..0000000
    Binary files a/tutorial-4/pixi.js-master/docs/assets/favicon.png and /dev/null differ
    diff --git a/tutorial-4/pixi.js-master/docs/assets/img/spinner.gif b/tutorial-4/pixi.js-master/docs/assets/img/spinner.gif
    deleted file mode 100755
    index 44f96ba..0000000
    Binary files a/tutorial-4/pixi.js-master/docs/assets/img/spinner.gif and /dev/null differ
    diff --git a/tutorial-4/pixi.js-master/docs/assets/index.html b/tutorial-4/pixi.js-master/docs/assets/index.html
    deleted file mode 100755
    index 487fe15..0000000
    --- a/tutorial-4/pixi.js-master/docs/assets/index.html
    +++ /dev/null
    @@ -1,10 +0,0 @@
    -
    -
    -    
    -        Redirector
    -        
    -    
    -    
    -        Click here to redirect
    -    
    -
    diff --git a/tutorial-4/pixi.js-master/docs/assets/js/api-filter.js b/tutorial-4/pixi.js-master/docs/assets/js/api-filter.js
    deleted file mode 100755
    index 37aefba..0000000
    --- a/tutorial-4/pixi.js-master/docs/assets/js/api-filter.js
    +++ /dev/null
    @@ -1,52 +0,0 @@
    -YUI.add('api-filter', function (Y) {
    -
    -Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], {
    -    // -- Initializer ----------------------------------------------------------
    -    initializer: function () {
    -        this._bindUIACBase();
    -        this._syncUIACBase();
    -    },
    -    getDisplayName: function(name) {
    -
    -        Y.each(Y.YUIDoc.meta.allModules, function(i) {
    -            if (i.name === name && i.displayName) {
    -                name = i.displayName;
    -            }
    -        });
    -
    -        return name;
    -    }
    -
    -}, {
    -    // -- Attributes -----------------------------------------------------------
    -    ATTRS: {
    -        resultHighlighter: {
    -            value: 'phraseMatch'
    -        },
    -
    -        // May be set to "classes" or "modules".
    -        queryType: {
    -            value: 'classes'
    -        },
    -
    -        source: {
    -            valueFn: function() {
    -                var self = this;
    -                return function(q) {
    -                    var data = Y.YUIDoc.meta[self.get('queryType')],
    -                        out = [];
    -                    Y.each(data, function(v) {
    -                        if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    -                            out.push(v);
    -                        }
    -                    });
    -                    return out;
    -                };
    -            }
    -        }
    -    }
    -});
    -
    -}, '3.4.0', {requires: [
    -    'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources'
    -]});
    diff --git a/tutorial-4/pixi.js-master/docs/assets/js/api-list.js b/tutorial-4/pixi.js-master/docs/assets/js/api-list.js
    deleted file mode 100755
    index 88905b5..0000000
    --- a/tutorial-4/pixi.js-master/docs/assets/js/api-list.js
    +++ /dev/null
    @@ -1,251 +0,0 @@
    -YUI.add('api-list', function (Y) {
    -
    -var Lang   = Y.Lang,
    -    YArray = Y.Array,
    -
    -    APIList = Y.namespace('APIList'),
    -
    -    classesNode    = Y.one('#api-classes'),
    -    inputNode      = Y.one('#api-filter'),
    -    modulesNode    = Y.one('#api-modules'),
    -    tabviewNode    = Y.one('#api-tabview'),
    -
    -    tabs = APIList.tabs = {},
    -
    -    filter = APIList.filter = new Y.APIFilter({
    -        inputNode : inputNode,
    -        maxResults: 1000,
    -
    -        on: {
    -            results: onFilterResults
    -        }
    -    }),
    -
    -    search = APIList.search = new Y.APISearch({
    -        inputNode : inputNode,
    -        maxResults: 100,
    -
    -        on: {
    -            clear  : onSearchClear,
    -            results: onSearchResults
    -        }
    -    }),
    -
    -    tabview = APIList.tabview = new Y.TabView({
    -        srcNode  : tabviewNode,
    -        panelNode: '#api-tabview-panel',
    -        render   : true,
    -
    -        on: {
    -            selectionChange: onTabSelectionChange
    -        }
    -    }),
    -
    -    focusManager = APIList.focusManager = tabviewNode.plug(Y.Plugin.NodeFocusManager, {
    -        circular   : true,
    -        descendants: '#api-filter, .yui3-tab-panel-selected .api-list-item a, .yui3-tab-panel-selected .result a',
    -        keys       : {next: 'down:40', previous: 'down:38'}
    -    }).focusManager,
    -
    -    LIST_ITEM_TEMPLATE =
    -        '
  • ' + - '{displayName}' + - '
  • '; - -// -- Init --------------------------------------------------------------------- - -// Duckpunch FocusManager's key event handling to prevent it from handling key -// events when a modifier is pressed. -Y.before(function (e, activeDescendant) { - if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { - return new Y.Do.Prevent(); - } -}, focusManager, '_focusPrevious', focusManager); - -Y.before(function (e, activeDescendant) { - if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { - return new Y.Do.Prevent(); - } -}, focusManager, '_focusNext', focusManager); - -// Create a mapping of tabs in the tabview so we can refer to them easily later. -tabview.each(function (tab, index) { - var name = tab.get('label').toLowerCase(); - - tabs[name] = { - index: index, - name : name, - tab : tab - }; -}); - -// Switch tabs on Ctrl/Cmd-Left/Right arrows. -tabviewNode.on('key', onTabSwitchKey, 'down:37,39'); - -// Focus the filter input when the `/` key is pressed. -Y.one(Y.config.doc).on('key', onSearchKey, 'down:83'); - -// Keep the Focus Manager up to date. -inputNode.on('focus', function () { - focusManager.set('activeDescendant', inputNode); -}); - -// Update all tabview links to resolved URLs. -tabview.get('panelNode').all('a').each(function (link) { - link.setAttribute('href', link.get('href')); -}); - -// -- Private Functions -------------------------------------------------------- -function getFilterResultNode() { - return filter.get('queryType') === 'classes' ? classesNode : modulesNode; -} - -// -- Event Handlers ----------------------------------------------------------- -function onFilterResults(e) { - var frag = Y.one(Y.config.doc.createDocumentFragment()), - resultNode = getFilterResultNode(), - typePlural = filter.get('queryType'), - typeSingular = typePlural === 'classes' ? 'class' : 'module'; - - if (e.results.length) { - YArray.each(e.results, function (result) { - frag.append(Lang.sub(LIST_ITEM_TEMPLATE, { - rootPath : APIList.rootPath, - displayName : filter.getDisplayName(result.highlighted), - name : result.text, - typePlural : typePlural, - typeSingular: typeSingular - })); - }); - } else { - frag.append( - '
  • ' + - 'No ' + typePlural + ' found.' + - '
  • ' - ); - } - - resultNode.empty(true); - resultNode.append(frag); - - focusManager.refresh(); -} - -function onSearchClear(e) { - - focusManager.refresh(); -} - -function onSearchKey(e) { - var target = e.target; - - if (target.test('input,select,textarea') - || target.get('isContentEditable')) { - return; - } - - e.preventDefault(); - - inputNode.focus(); - focusManager.refresh(); -} - -function onSearchResults(e) { - var frag = Y.one(Y.config.doc.createDocumentFragment()); - - if (e.results.length) { - YArray.each(e.results, function (result) { - frag.append(result.display); - }); - } else { - frag.append( - '
  • ' + - 'No results found. Maybe you\'ll have better luck with a ' + - 'different query?' + - '
  • ' - ); - } - - - focusManager.refresh(); -} - -function onTabSelectionChange(e) { - var tab = e.newVal, - name = tab.get('label').toLowerCase(); - - tabs.selected = { - index: tab.get('index'), - name : name, - tab : tab - }; - - switch (name) { - case 'classes': // fallthru - case 'modules': - filter.setAttrs({ - minQueryLength: 0, - queryType : name - }); - - search.set('minQueryLength', -1); - - // Only send a request if this isn't the initially-selected tab. - if (e.prevVal) { - filter.sendRequest(filter.get('value')); - } - break; - - case 'everything': - filter.set('minQueryLength', -1); - search.set('minQueryLength', 1); - - if (search.get('value')) { - search.sendRequest(search.get('value')); - } else { - inputNode.focus(); - } - break; - - default: - // WTF? We shouldn't be here! - filter.set('minQueryLength', -1); - search.set('minQueryLength', -1); - } - - if (focusManager) { - setTimeout(function () { - focusManager.refresh(); - }, 1); - } -} - -function onTabSwitchKey(e) { - var currentTabIndex = tabs.selected.index; - - if (!(e.ctrlKey || e.metaKey)) { - return; - } - - e.preventDefault(); - - switch (e.keyCode) { - case 37: // left arrow - if (currentTabIndex > 0) { - tabview.selectChild(currentTabIndex - 1); - inputNode.focus(); - } - break; - - case 39: // right arrow - if (currentTabIndex < (Y.Object.size(tabs) - 2)) { - tabview.selectChild(currentTabIndex + 1); - inputNode.focus(); - } - break; - } -} - -}, '3.4.0', {requires: [ - 'api-filter', 'api-search', 'event-key', 'node-focusmanager', 'tabview' -]}); diff --git a/tutorial-4/pixi.js-master/docs/assets/js/api-search.js b/tutorial-4/pixi.js-master/docs/assets/js/api-search.js deleted file mode 100755 index 175f6a6..0000000 --- a/tutorial-4/pixi.js-master/docs/assets/js/api-search.js +++ /dev/null @@ -1,98 +0,0 @@ -YUI.add('api-search', function (Y) { - -var Lang = Y.Lang, - Node = Y.Node, - YArray = Y.Array; - -Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { - // -- Public Properties ---------------------------------------------------- - RESULT_TEMPLATE: - '
  • ' + - '' + - '

    {name}

    ' + - '{resultType}' + - '
    {description}
    ' + - '{class}' + - '
    ' + - '
  • ', - - // -- Initializer ---------------------------------------------------------- - initializer: function () { - this._bindUIACBase(); - this._syncUIACBase(); - }, - - // -- Protected Methods ---------------------------------------------------- - _apiResultFilter: function (query, results) { - // Filter components out of the results. - return YArray.filter(results, function (result) { - return result.raw.resultType === 'component' ? false : result; - }); - }, - - _apiResultFormatter: function (query, results) { - return YArray.map(results, function (result) { - var raw = Y.merge(result.raw), // create a copy - desc = raw.description || ''; - - // Convert description to text and truncate it if necessary. - desc = Node.create('
    ' + desc + '
    ').get('text'); - - if (desc.length > 65) { - desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; - } else { - desc = Y.Escape.html(desc); - } - - raw['class'] || (raw['class'] = ''); - raw.description = desc; - - // Use the highlighted result name. - raw.name = result.highlighted; - - return Lang.sub(this.RESULT_TEMPLATE, raw); - }, this); - }, - - _apiTextLocator: function (result) { - return result.displayName || result.name; - } -}, { - // -- Attributes ----------------------------------------------------------- - ATTRS: { - resultFormatter: { - valueFn: function () { - return this._apiResultFormatter; - } - }, - - resultFilters: { - valueFn: function () { - return this._apiResultFilter; - } - }, - - resultHighlighter: { - value: 'phraseMatch' - }, - - resultListLocator: { - value: 'data.results' - }, - - resultTextLocator: { - valueFn: function () { - return this._apiTextLocator; - } - }, - - source: { - value: '/api/v1/search?q={query}&count={maxResults}' - } - } -}); - -}, '3.4.0', {requires: [ - 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', - 'escape' -]}); diff --git a/tutorial-4/pixi.js-master/docs/assets/js/apidocs.js b/tutorial-4/pixi.js-master/docs/assets/js/apidocs.js deleted file mode 100755 index c64bb46..0000000 --- a/tutorial-4/pixi.js-master/docs/assets/js/apidocs.js +++ /dev/null @@ -1,370 +0,0 @@ -YUI().use( - 'yuidoc-meta', - 'api-list', 'history-hash', 'node-screen', 'node-style', 'pjax', -function (Y) { - -var win = Y.config.win, - localStorage = win.localStorage, - - bdNode = Y.one('#bd'), - - pjax, - defaultRoute, - - classTabView, - selectedTab; - -// Kill pjax functionality unless serving over HTTP. -if (!Y.getLocation().protocol.match(/^https?\:/)) { - Y.Router.html5 = false; -} - -// Create the default route with middleware which enables syntax highlighting -// on the loaded content. -defaultRoute = Y.Pjax.defaultRoute.concat(function (req, res, next) { - prettyPrint(); - bdNode.removeClass('loading'); - - next(); -}); - -pjax = new Y.Pjax({ - container : '#docs-main', - contentSelector: '#docs-main > .content', - linkSelector : '#bd a', - titleSelector : '#xhr-title', - - navigateOnHash: true, - root : '/', - routes : [ - // -- / ---------------------------------------------------------------- - { - path : '/(index.html)?', - callbacks: defaultRoute - }, - - // -- /classes/* ------------------------------------------------------- - { - path : '/classes/:class.html*', - callbacks: [defaultRoute, 'handleClasses'] - }, - - // -- /files/* --------------------------------------------------------- - { - path : '/files/*file', - callbacks: [defaultRoute, 'handleFiles'] - }, - - // -- /modules/* ------------------------------------------------------- - { - path : '/modules/:module.html*', - callbacks: defaultRoute - } - ] -}); - -// -- Utility Functions -------------------------------------------------------- - -pjax.checkVisibility = function (tab) { - tab || (tab = selectedTab); - - if (!tab) { return; } - - var panelNode = tab.get('panelNode'), - visibleItems; - - // If no items are visible in the tab panel due to the current visibility - // settings, display a message to that effect. - visibleItems = panelNode.all('.item,.index-item').some(function (itemNode) { - if (itemNode.getComputedStyle('display') !== 'none') { - return true; - } - }); - - panelNode.all('.no-visible-items').remove(); - - if (!visibleItems) { - if (Y.one('#index .index-item')) { - panelNode.append( - '
    ' + - '

    ' + - 'Some items are not shown due to the current visibility ' + - 'settings. Use the checkboxes at the upper right of this ' + - 'page to change the visibility settings.' + - '

    ' + - '
    ' - ); - } else { - panelNode.append( - '
    ' + - '

    ' + - 'This class doesn\'t provide any methods, properties, ' + - 'attributes, or events.' + - '

    ' + - '
    ' - ); - } - } - - // Hide index sections without any visible items. - Y.all('.index-section').each(function (section) { - var items = 0, - visibleItems = 0; - - section.all('.index-item').each(function (itemNode) { - items += 1; - - if (itemNode.getComputedStyle('display') !== 'none') { - visibleItems += 1; - } - }); - - section.toggleClass('hidden', !visibleItems); - section.toggleClass('no-columns', visibleItems < 4); - }); -}; - -pjax.initClassTabView = function () { - if (!Y.all('#classdocs .api-class-tab').size()) { - return; - } - - if (classTabView) { - classTabView.destroy(); - selectedTab = null; - } - - classTabView = new Y.TabView({ - srcNode: '#classdocs', - - on: { - selectionChange: pjax.onTabSelectionChange - } - }); - - pjax.updateTabState(); - classTabView.render(); -}; - -pjax.initLineNumbers = function () { - var hash = win.location.hash.substring(1), - container = pjax.get('container'), - hasLines, node; - - // Add ids for each line number in the file source view. - container.all('.linenums>li').each(function (lineNode, index) { - lineNode.set('id', 'l' + (index + 1)); - lineNode.addClass('file-line'); - hasLines = true; - }); - - // Scroll to the desired line. - if (hasLines && /^l\d+$/.test(hash)) { - if ((node = container.getById(hash))) { - win.scroll(0, node.getY()); - } - } -}; - -pjax.initRoot = function () { - var terminators = /^(?:classes|files|modules)$/, - parts = pjax._getPathRoot().split('/'), - root = [], - i, len, part; - - for (i = 0, len = parts.length; i < len; i += 1) { - part = parts[i]; - - if (part.match(terminators)) { - // Makes sure the path will end with a "/". - root.push(''); - break; - } - - root.push(part); - } - - pjax.set('root', root.join('/')); -}; - -pjax.updateTabState = function (src) { - var hash = win.location.hash.substring(1), - defaultTab, node, tab, tabPanel; - - function scrollToNode() { - if (node.hasClass('protected')) { - Y.one('#api-show-protected').set('checked', true); - pjax.updateVisibility(); - } - - if (node.hasClass('private')) { - Y.one('#api-show-private').set('checked', true); - pjax.updateVisibility(); - } - - setTimeout(function () { - // For some reason, unless we re-get the node instance here, - // getY() always returns 0. - var node = Y.one('#classdocs').getById(hash); - win.scrollTo(0, node.getY() - 70); - }, 1); - } - - if (!classTabView) { - return; - } - - if (src === 'hashchange' && !hash) { - defaultTab = 'index'; - } else { - if (localStorage) { - defaultTab = localStorage.getItem('tab_' + pjax.getPath()) || - 'index'; - } else { - defaultTab = 'index'; - } - } - - if (hash && (node = Y.one('#classdocs').getById(hash))) { - if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) { - if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) { - if (classTabView.get('rendered')) { - Y.Widget.getByNode(tab).set('selected', 1); - } else { - tab.addClass('yui3-tab-selected'); - } - } - } - - // Scroll to the desired element if this is a hash URL. - if (node) { - if (classTabView.get('rendered')) { - scrollToNode(); - } else { - classTabView.once('renderedChange', scrollToNode); - } - } - } else { - tab = Y.one('#classdocs .api-class-tab.' + defaultTab); - - // When the `defaultTab` node isn't found, `localStorage` is stale. - if (!tab && defaultTab !== 'index') { - tab = Y.one('#classdocs .api-class-tab.index'); - } - - if (classTabView.get('rendered')) { - Y.Widget.getByNode(tab).set('selected', 1); - } else { - tab.addClass('yui3-tab-selected'); - } - } -}; - -pjax.updateVisibility = function () { - var container = pjax.get('container'); - - container.toggleClass('hide-inherited', - !Y.one('#api-show-inherited').get('checked')); - - container.toggleClass('show-deprecated', - Y.one('#api-show-deprecated').get('checked')); - - container.toggleClass('show-protected', - Y.one('#api-show-protected').get('checked')); - - container.toggleClass('show-private', - Y.one('#api-show-private').get('checked')); - - pjax.checkVisibility(); -}; - -// -- Route Handlers ----------------------------------------------------------- - -pjax.handleClasses = function (req, res, next) { - var status = res.ioResponse.status; - - // Handles success and local filesystem XHRs. - if (!status || (status >= 200 && status < 300)) { - pjax.initClassTabView(); - } - - next(); -}; - -pjax.handleFiles = function (req, res, next) { - var status = res.ioResponse.status; - - // Handles success and local filesystem XHRs. - if (!status || (status >= 200 && status < 300)) { - pjax.initLineNumbers(); - } - - next(); -}; - -// -- Event Handlers ----------------------------------------------------------- - -pjax.onNavigate = function (e) { - var hash = e.hash, - originTarget = e.originEvent && e.originEvent.target, - tab; - - if (hash) { - tab = originTarget && originTarget.ancestor('.yui3-tab', true); - - if (hash === win.location.hash) { - pjax.updateTabState('hashchange'); - } else if (!tab) { - win.location.hash = hash; - } - - e.preventDefault(); - return; - } - - // Only scroll to the top of the page when the URL doesn't have a hash. - this.set('scrollToTop', !e.url.match(/#.+$/)); - - bdNode.addClass('loading'); -}; - -pjax.onOptionClick = function (e) { - pjax.updateVisibility(); -}; - -pjax.onTabSelectionChange = function (e) { - var tab = e.newVal, - tabId = tab.get('contentBox').getAttribute('href').substring(1); - - selectedTab = tab; - - // If switching from a previous tab (i.e., this is not the default tab), - // replace the history entry with a hash URL that will cause this tab to - // be selected if the user navigates away and then returns using the back - // or forward buttons. - if (e.prevVal && localStorage) { - localStorage.setItem('tab_' + pjax.getPath(), tabId); - } - - pjax.checkVisibility(tab); -}; - -// -- Init --------------------------------------------------------------------- - -pjax.on('navigate', pjax.onNavigate); - -pjax.initRoot(); -pjax.upgrade(); -pjax.initClassTabView(); -pjax.initLineNumbers(); -pjax.updateVisibility(); - -Y.APIList.rootPath = pjax.get('root'); - -Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input'); - -Y.on('hashchange', function (e) { - pjax.updateTabState('hashchange'); -}, win); - -}); diff --git a/tutorial-4/pixi.js-master/docs/assets/js/yui-prettify.js b/tutorial-4/pixi.js-master/docs/assets/js/yui-prettify.js deleted file mode 100755 index 18de864..0000000 --- a/tutorial-4/pixi.js-master/docs/assets/js/yui-prettify.js +++ /dev/null @@ -1,17 +0,0 @@ -YUI().use('node', function(Y) { - var code = Y.all('.prettyprint.linenums'); - if (code.size()) { - code.each(function(c) { - var lis = c.all('ol li'), - l = 1; - lis.each(function(n) { - n.prepend(''); - l++; - }); - }); - var h = location.hash; - location.hash = ''; - h = h.replace('LINE_', 'LINENUM_'); - location.hash = h; - } -}); diff --git a/tutorial-4/pixi.js-master/docs/assets/vendor/prettify/CHANGES.html b/tutorial-4/pixi.js-master/docs/assets/vendor/prettify/CHANGES.html deleted file mode 100755 index b50b841..0000000 --- a/tutorial-4/pixi.js-master/docs/assets/vendor/prettify/CHANGES.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - Change Log - - - README - -

    Known Issues

    -
      -
    • Perl formatting is really crappy. Partly because the author is lazy and - partly because Perl is - hard to parse. -
    • On some browsers, <code> elements with newlines in the text - which use CSS to specify white-space:pre will have the newlines - improperly stripped if the element is not attached to the document at the time - the stripping is done. Also, on IE 6, all newlines will be stripped from - <code> elements because of the way IE6 produces - innerHTML. Workaround: use <pre> for code with - newlines. -
    - -

    Change Log

    -

    29 March 2007

    -
      -
    • Added tests for PHP support - to address - issue 3. -
    • Fixed - bug: prettyPrintOne was not halting. This was not - reachable through the normal entry point. -
    • Fixed - bug: recursing into a script block or PHP tag that was not properly - closed would not silently drop the content. - (test) -
    • Fixed - bug: was eating tabs - (test) -
    • Fixed entity handling so that the caveat -
      -

      Caveats: please properly escape less-thans. x&lt;y - instead of x<y, and use " instead of - &quot; for string delimiters.

      -
      - is no longer applicable. -
    • Added noisefree's C# - patch -
    • Added a distribution that has comments and - whitespace removed to reduce download size from 45.5kB to 12.8kB. -
    -

    4 Jul 2008

    -
      -
    • Added language specific formatters that are triggered by the presence - of a lang-<language-file-extension>
    • -
    • Fixed bug: python handling of '''string''' -
    • Fixed bug: / in regex [charsets] should not end regex -
    -

    5 Jul 2008

    -
      -
    • Defined language extensions for Lisp and Lua -
    -

    14 Jul 2008

    -
      -
    • Language handlers for F#, OCAML, SQL -
    • Support for nocode spans to allow embedding of line - numbers and code annotations which should not be styled or otherwise - affect the tokenization of prettified code. - See the issue 22 - testcase. -
    -

    6 Jan 2009

    -
      -
    • Language handlers for Visual Basic, Haskell, CSS, and WikiText
    • -
    • Added .mxml extension to the markup style handler for - Flex MXML files. See - issue 37. -
    • Added .m extension to the C style handler so that Objective - C source files properly highlight. See - issue 58. -
    • Changed HTML lexer to use the same embedded source mechanism as the - wiki language handler, and changed to use the registered - CSS handler for STYLE element content. -
    -

    21 May 2009

    -
      -
    • Rewrote to improve performance on large files. - See benchmarks.
    • -
    • Fixed bugs with highlighting of Haskell line comments, Lisp - number literals, Lua strings, C preprocessor directives, - newlines in Wiki code on Windows, and newlines in IE6.
    • -
    -

    14 August 2009

    -
      -
    • Fixed prettifying of <code> blocks with embedded newlines. -
    -

    3 October 2009

    -
      -
    • Fixed prettifying of XML/HTML tags that contain uppercase letters. -
    -

    19 July 2010

    -
      -
    • Added support for line numbers. Bug - 22
    • -
    • Added YAML support. Bug - 123
    • -
    • Added VHDL support courtesy Le Poussin.
    • -
    • IE performance improvements. Bug - 102 courtesy jacobly.
    • -
    • A variety of markup formatting fixes courtesy smain and thezbyg.
    • -
    • Fixed copy and paste in IE[678]. -
    • Changed output to use &#160; instead of - &nbsp; so that the output works when embedded in XML. - Bug - 108.
    • -
    - - diff --git a/tutorial-4/pixi.js-master/docs/assets/vendor/prettify/COPYING b/tutorial-4/pixi.js-master/docs/assets/vendor/prettify/COPYING deleted file mode 100755 index d645695..0000000 --- a/tutorial-4/pixi.js-master/docs/assets/vendor/prettify/COPYING +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/tutorial-4/pixi.js-master/docs/assets/vendor/prettify/README.html b/tutorial-4/pixi.js-master/docs/assets/vendor/prettify/README.html deleted file mode 100755 index c6fe1a3..0000000 --- a/tutorial-4/pixi.js-master/docs/assets/vendor/prettify/README.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - - Javascript code prettifier - - - - - - - - - - Languages : CH -

    Javascript code prettifier

    - -

    Setup

    -
      -
    1. Download a distribution -
    2. Include the script and stylesheets in your document - (you will need to make sure the css and js file are on your server, and - adjust the paths in the script and link tag) -
      -<link href="prettify.css" type="text/css" rel="stylesheet" />
      -<script type="text/javascript" src="prettify.js"></script>
      -
    3. Add onload="prettyPrint()" to your - document's body tag. -
    4. Modify the stylesheet to get the coloring you prefer
    5. -
    - -

    Usage

    -

    Put code snippets in - <pre class="prettyprint">...</pre> - or <code class="prettyprint">...</code> - and it will automatically be pretty printed. - - - - -
    The original - Prettier -
    class Voila {
    -public:
    -  // Voila
    -  static const string VOILA = "Voila";
    -
    -  // will not interfere with embedded tags.
    -}
    - -
    class Voila {
    -public:
    -  // Voila
    -  static const string VOILA = "Voila";
    -
    -  // will not interfere with embedded tags.
    -}
    -
    - -

    FAQ

    -

    Which languages does it work for?

    -

    The comments in prettify.js are authoritative but the lexer - should work on a number of languages including C and friends, - Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. - It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl - and Ruby, but, because of commenting conventions, doesn't work on - Smalltalk, or CAML-like languages.

    - -

    LISPy languages are supported via an extension: - lang-lisp.js.

    -

    And similarly for - CSS, - Haskell, - Lua, - OCAML, SML, F#, - Visual Basic, - SQL, - Protocol Buffers, and - WikiText.. - -

    If you'd like to add an extension for your favorite language, please - look at src/lang-lisp.js and file an - issue including your language extension, and a testcase.

    - -

    How do I specify which language my code is in?

    -

    You don't need to specify the language since prettyprint() - will guess. You can specify a language by specifying the language extension - along with the prettyprint class like so:

    -
    <pre class="prettyprint lang-html">
    -  The lang-* class specifies the language file extensions.
    -  File extensions supported by default include
    -    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    -    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    -    "xhtml", "xml", "xsl".
    -</pre>
    - -

    It doesn't work on <obfuscated code sample>?

    -

    Yes. Prettifying obfuscated code is like putting lipstick on a pig - — i.e. outside the scope of this tool.

    - -

    Which browsers does it work with?

    -

    It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. - Look at the test page to see if it - works in your browser.

    - -

    What's changed?

    -

    See the change log

    - -

    Why doesn't Prettyprinting of strings work on WordPress?

    -

    Apparently wordpress does "smart quoting" which changes close quotes. - This causes end quotes to not match up with open quotes. -

    This breaks prettifying as well as copying and pasting of code samples. - See - WordPress's help center for info on how to stop smart quoting of code - snippets.

    - -

    How do I put line numbers in my code?

    -

    You can use the linenums class to turn on line - numbering. If your code doesn't start at line number 1, you can - add a colon and a line number to the end of that class as in - linenums:52. - -

    For example -

    <pre class="prettyprint linenums:4"
    ->// This is line 4.
    -foo();
    -bar();
    -baz();
    -boo();
    -far();
    -faz();
    -<pre>
    - produces -
    // This is line 4.
    -foo();
    -bar();
    -baz();
    -boo();
    -far();
    -faz();
    -
    - -

    How do I prevent a portion of markup from being marked as code?

    -

    You can use the nocode class to identify a span of markup - that is not code. -

    <pre class=prettyprint>
    -int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
    -  Continuation of comment */
    -int y = bar();
    -</pre>
    -produces -
    -int x = foo();  /* This is a comment  This is not code
    -  Continuation of comment */
    -int y = bar();
    -
    - -

    For a more complete example see the issue22 - testcase.

    - -

    I get an error message "a is not a function" or "opt_whenDone is not a function"

    -

    If you are calling prettyPrint via an event handler, wrap it in a function. - Instead of doing -

    - addEventListener('load', prettyPrint, false); -
    - wrap it in a closure like -
    - addEventListener('load', function (event) { prettyPrint() }, false); -
    - so that the browser does not pass an event object to prettyPrint which - will confuse it. - -


    - - - - diff --git a/tutorial-4/pixi.js-master/docs/assets/vendor/prettify/prettify-min.css b/tutorial-4/pixi.js-master/docs/assets/vendor/prettify/prettify-min.css deleted file mode 100755 index d44b3a2..0000000 --- a/tutorial-4/pixi.js-master/docs/assets/vendor/prettify/prettify-min.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/tutorial-4/pixi.js-master/docs/assets/vendor/prettify/prettify-min.js b/tutorial-4/pixi.js-master/docs/assets/vendor/prettify/prettify-min.js deleted file mode 100755 index 4845d05..0000000 --- a/tutorial-4/pixi.js-master/docs/assets/vendor/prettify/prettify-min.js +++ /dev/null @@ -1 +0,0 @@ -window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/tutorial-4/pixi.js-master/docs/classes/AbstractFilter.html b/tutorial-4/pixi.js-master/docs/classes/AbstractFilter.html deleted file mode 100755 index c98665e..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/AbstractFilter.html +++ /dev/null @@ -1,857 +0,0 @@ - - - - - AbstractFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AbstractFilter Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This is the base class for creating a PIXI filter. Currently only webGL supports filters. -If you want to make a custom filter this should be your base class.

    - -
    - - -
    -

    Constructor

    -
    -

    AbstractFilter

    - - -
    - (
      - -
    • - - fragmentSrc - -
    • - -
    • - - uniforms - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - fragmentSrc - Array - - - - -
      -

      The fragment source in an array of strings.

      - -
      - - -
    • - -
    • - - uniforms - Object - - - - -
      -

      An object containing the uniforms for this filter.

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/AjaxRequest.html b/tutorial-4/pixi.js-master/docs/classes/AjaxRequest.html deleted file mode 100755 index 473c83e..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/AjaxRequest.html +++ /dev/null @@ -1,978 +0,0 @@ - - - - - AjaxRequest - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AjaxRequest Class

    -
    - - - - - -
    - Defined in: src/pixi/utils/Utils.js:108 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    A wrapper for ajax requests to be handled cross browser

    - -
    - - -
    -

    Constructor

    -
    -

    AjaxRequest

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:108 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    bind

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:74 - -

    - - - - - -
    - -
    -

    A polyfill for Function.prototype.bind

    - -
    - - - - - - -
    - - -
    -

    cancelAnimationFrame

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:20 - -

    - - - - - -
    - -
    -

    A polyfill for cancelAnimationFrame

    - -
    - - - - - - -
    - - -
    -

    canUseNewCanvasBlendModes

    - - - () - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:168 - -

    - - - - - -
    - -
    -

    Checks whether the Canvas BlendModes are supported by the current browser

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    whether they are supported

    - - -
    -
    - - - -
    - - -
    -

    getNextPowerOfTwo

    - - -
    - (
      - -
    • - - number - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:189 - -

    - - - - - -
    - -
    -

    Given a number, this function returns the closest number that is a power of two -this function is taken from Starling Framework as its pretty neat ;)

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - number - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    the closest number that is a power of two

    - - -
    -
    - - - -
    - - -
    -

    hex2rgb

    - - -
    - (
      - -
    • - - hex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:54 - -

    - - - - - -
    - -
    -

    Converts a hex color number to an [R, G, B] array

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - hex - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    requestAnimationFrame

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:12 - -

    - - - - - -
    - -
    -

    A polyfill for requestAnimationFrame -You can actually use both requestAnimationFrame and requestAnimFrame, -you will still benefit from the polyfill

    - -
    - - - - - - -
    - - -
    -

    rgb2hex

    - - -
    - (
      - -
    • - - rgb - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Utils.js:64 - -

    - - - - - -
    - -
    -

    Converts a color as an [R, G, B] array to a hex number

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - rgb - Array - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/AlphaMaskFilter.html b/tutorial-4/pixi.js-master/docs/classes/AlphaMaskFilter.html deleted file mode 100755 index 6c2abe0..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/AlphaMaskFilter.html +++ /dev/null @@ -1,933 +0,0 @@ - - - - - AlphaMaskFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AlphaMaskFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The AlphaMaskFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. -You can use this filter to apply all manor of crazy warping effects -Currently the r property of the texture is used to offset the x and the g property of the texture is used to offset the y.

    - -
    - - -
    -

    Constructor

    -
    -

    AlphaMaskFilter

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AlphaMaskFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The texture used for the displacement map * must be power of 2 texture at the moment

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    onTextureLoaded

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AlphaMaskFilter.js:71 - -

    - - - - - -
    - -
    -

    Sets the map dimensions uniforms when the texture becomes available.

    - -
    - - - - - - -
    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    map

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AlphaMaskFilter.js:84 - -

    - - - - -
    - -
    -

    The texture used for the displacement map. Must be power of 2 sized texture.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/AsciiFilter.html b/tutorial-4/pixi.js-master/docs/classes/AsciiFilter.html deleted file mode 100755 index eee96f8..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/AsciiFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - AsciiFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AsciiFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    An ASCII filter.

    - -
    - - -
    -

    Constructor

    -
    -

    AsciiFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AsciiFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    size

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/AsciiFilter.js:73 - -

    - - - - -
    - -
    -

    The pixel size used by the filter.

    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/AssetLoader.html b/tutorial-4/pixi.js-master/docs/classes/AssetLoader.html deleted file mode 100755 index 9485b58..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/AssetLoader.html +++ /dev/null @@ -1,1743 +0,0 @@ - - - - - AssetLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AssetLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    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

    - -
    - - -
    -

    Constructor

    -
    -

    AssetLoader

    - - -
    - (
      - -
    • - - assetURLs - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - 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. Supported bitmap font - data formats include 'xml' and 'fnt'.

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    -

    Events

    - - -
    - -
    - - -
    -

    Methods

    - - -
    -

    _getDataType

    - - -
    - (
      - -
    • - - str - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:74 - -

    - - - - - -
    - -
    -

    Given a filename, returns its extension.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - str - String - - - - -
      -

      the name of the asset

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:107 - -

    - - - - - -
    - -
    -

    Starts loading the assets sequentially

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onAssetLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:143 - -

    - - - - - -
    - -
    -

    Invoked after each file is loaded

    - -
    - - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    assetURLs

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:23 - -

    - - - - -
    - -
    -

    The array of asset URLs that are going to be loaded

    - -
    - - - - - - -
    - - -
    -

    crossorigin

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:31 - -

    - - - - -
    - -
    -

    Whether the requests should be treated as cross origin

    - -
    - - - - - - -
    - - -
    -

    loadersByType

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:39 - -

    - - - - -
    - -
    -

    Maps file extension to loader types

    - -
    - - - - - - -
    - - -
    - - - - - -
    -

    Events

    - - -
    -

    onComplete

    - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:66 - -

    - - - - -
    - -
    -

    Fired when all the assets have loaded

    - -
    - - - - - -
    - - -
    -

    onProgress

    - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AssetLoader.js:61 - -

    - - - - -
    - -
    -

    Fired when an item has loaded

    - -
    - - - - - -
    - - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/AtlasLoader.html b/tutorial-4/pixi.js-master/docs/classes/AtlasLoader.html deleted file mode 100755 index a7cc254..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/AtlasLoader.html +++ /dev/null @@ -1,1481 +0,0 @@ - - - - - AtlasLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    AtlasLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event.

    -

    To generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format.

    -

    It is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to 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.fromFrameId()

    - -
    - - -
    -

    Constructor

    -
    -

    AtlasLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AtlasLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the JSON file

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AtlasLoader.js:32 - -

    - - - - - -
    - -
    -

    Starts loading the JSON file

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onAtlasLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AtlasLoader.js:46 - -

    - - - - - -
    - -
    -

    Invoked when the Atlas has fully loaded. Parses the JSON and builds the texture frames.

    - -
    - - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onError

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AtlasLoader.js:182 - -

    - - - - - -
    - -
    -

    Invoked when an error occurs.

    - -
    - - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/AtlasLoader.js:166 - -

    - - - - - -
    - -
    -

    Invoked when json file has loaded.

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/BaseTexture.html b/tutorial-4/pixi.js-master/docs/classes/BaseTexture.html deleted file mode 100755 index ad0c53e..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/BaseTexture.html +++ /dev/null @@ -1,2399 +0,0 @@ - - - - - BaseTexture - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BaseTexture Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A texture stores the information that represents an image. All textures have a base texture.

    - -
    - - -
    -

    Constructor

    -
    -

    BaseTexture

    - - -
    - (
      - -
    • - - source - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:9 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - source - String - - - - -
      -

      the source object (image or canvas)

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:151 - -

    - - - - - -
    - -
    -

    Destroys this base texture

    - -
    - - - - - - -
    - - -
    -

    dirty

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:187 - -

    - - - - - -
    - -
    -

    Sets all glTextures to be dirty.

    - -
    - - - - - - -
    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    fromCanvas

    - - -
    - (
      - -
    • - - canvas - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:270 - -

    - - - - - -
    - -
    -

    Helper function that creates a base texture from the given canvas element.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - canvas - Canvas - - - - -
      -

      The canvas element source of the texture

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - -

    BaseTexture

    - - -
    -
    - - - -
    - - -
    -

    fromImage

    - - -
    - (
      - -
    • - - imageUrl - -
    • - -
    • - - crossorigin - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:228 - -

    - - - - - -
    - -
    -

    Helper function that creates a base texture from the given image url. -If the image is not in the base texture cache it will be created and loaded.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - imageUrl - String - - - - -
      -

      The image url of the texture

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - -

    BaseTexture

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    unloadFromGPU

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:200 - -

    - - - - - -
    - -
    -

    Removes the base texture from the GPU, useful for managing resources on the GPU. -Atexture is still 100% usable and will simply be reuploaded if there is a sprite on screen that is using it.

    - -
    - - - - - - -
    - - -
    -

    updateSourceImage

    - - -
    - (
      - -
    • - - newSrc - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:174 - -

    - - - - - -
    - -
    -

    Changes the source image of the texture

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - newSrc - String - - - - -
      -

      the path of the image

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _dirty

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:95 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    _glTextures

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:85 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    _powerOf2

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:138 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    hasLoaded

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:55 - -

    - - - - -
    - -
    -

    [read-only] Set to true once the base texture has loaded

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:37 - -

    - - - - -
    - -
    -

    [read-only] The height of the base texture set when the image has loaded

    - -
    - - - - - - -
    - - -
    -

    imageUrl

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:132 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    premultipliedAlpha

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:74 - -

    - - - - -
    - -
    -

    Controls if RGB channels should be pre-multiplied by Alpha (WebGL only)

    - -
    - - -

    Default: true

    - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:20 - -

    - - - - -
    - -
    -

    The Resolution of the texture.

    - -
    - - - - - - -
    - - -
    -

    scaleMode

    - PIXI.scaleModes - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:46 - -

    - - - - -
    - -
    -

    The scale mode to apply when scaling this texture

    - -
    - - -

    Default: PIXI.scaleModes.LINEAR

    - - - - - -
    - - -
    -

    source

    - Image - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:64 - -

    - - - - -
    - -
    -

    The image source that is used to create the texture.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/BaseTexture.js:28 - -

    - - - - -
    - -
    -

    [read-only] The width of the base texture set when the image has loaded

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/BitmapFontLoader.html b/tutorial-4/pixi.js-master/docs/classes/BitmapFontLoader.html deleted file mode 100755 index 670a3d2..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/BitmapFontLoader.html +++ /dev/null @@ -1,1641 +0,0 @@ - - - - - BitmapFontLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BitmapFontLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    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

    - -
    - - -
    -

    Constructor

    -
    -

    BitmapFontLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the sprite sheet JSON file

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:57 - -

    - - - - - -
    - -
    -

    Loads the XML font data

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:152 - -

    - - - - - -
    - -
    -

    Invoked when all files are loaded (xml/fnt and texture)

    - -
    - - - - - - -
    - - -
    -

    onXMLLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:72 - -

    - - - - - -
    - -
    -

    Invoked when the XML file is loaded, parses the data.

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    baseUrl

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:35 - -

    - - - - -
    - -
    -

    [read-only] The base url of the bitmap font data

    - -
    - - - - - - -
    - - -
    -

    crossorigin

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:27 - -

    - - - - -
    - -
    -

    Whether the requests should be treated as cross origin

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:44 - -

    - - - - -
    - -
    -

    [read-only] The texture of the bitmap font

    - -
    - - - - - - -
    - - -
    -

    url

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/BitmapFontLoader.js:19 - -

    - - - - -
    - -
    -

    The url of the bitmap font data

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/BitmapText.html b/tutorial-4/pixi.js-master/docs/classes/BitmapText.html deleted file mode 100755 index 2dfc95f..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/BitmapText.html +++ /dev/null @@ -1,6161 +0,0 @@ - - - - - BitmapText - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BitmapText Class

    -
    - - - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A BitmapText object will create a line or multiple lines of text using bitmap font. To split a line you can use '\n', '\r' or '\r\n' in your string. -You can generate the fnt files using -http://www.angelcode.com/products/bmfont/ for windows or -http://www.bmglyph.com/ for mac.

    - -
    - - -
    -

    Constructor

    -
    -

    BitmapText

    - - -
    - (
      - -
    • - - text - -
    • - -
    • - - style - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - text - String - - - - -
      -

      The copy that you would like the text to display

      - -
      - - -
    • - -
    • - - style - Object - - - - -
      -

      The style parameters

      - -
      - - -
        - -
      • - - font - String - - -
        -

        The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)

        - -
        - - -
      • - -
      • - - [align='left'] - String - optional - - -
        -

        Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text

        - -
        - - -
      • - -
      - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStyle

    - - -
    - (
      - -
    • - - style - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:78 - -

    - - - - - -
    - -
    -

    Set the style of the text -style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously) -[style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single lines of text

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - style - Object - - - - -
      -

      The style parameters, contained as properties of an object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setText

    - - -
    - (
      - -
    • - - text - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:66 - -

    - - - - - -
    - -
    -

    Set the text string to be rendered.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - text - String - - - - -
      -

      The text that you would like displayed

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    -

    updateText

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:100 - -

    - - - - - -
    - -
    -

    Renders text and updates it when needed

    - -
    - - - - - - -
    - - -
    -

    updateTransform

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:198 - -

    - - - - - -
    - -
    -

    Updates the transform of this object

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _pool

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:54 - -

    - - - - -
    - -
    -

    The dirty state of this object.

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    textHeight

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:33 - -

    - - - - -
    - -
    -

    [read-only] The height of the overall text, different from fontSize, -which is defined in the style object

    - -
    - - - - - - -
    - - -
    -

    textWidth

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/BitmapText.js:23 - -

    - - - - -
    - -
    -

    [read-only] The width of the overall text, different from fontSize, -which is defined in the style object

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/BlurFilter.html b/tutorial-4/pixi.js-master/docs/classes/BlurFilter.html deleted file mode 100755 index 0922ab3..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/BlurFilter.html +++ /dev/null @@ -1,946 +0,0 @@ - - - - - BlurFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BlurFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The BlurFilter applies a Gaussian blur to an object. -The strength of the blur can be set for x- and y-axis separately (always relative to the stage).

    - -
    - - -
    -

    Constructor

    -
    -

    BlurFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number the strength of the blur - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurFilter.js:24 - -

    - - - - -
    - -
    -

    Sets the strength of both the blurX and blurY properties simultaneously

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    blurX

    - Number the strength of the blurX - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurFilter.js:40 - -

    - - - - -
    - -
    -

    Sets the strength of the blurX property

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    blurY

    - Number the strength of the blurY - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurFilter.js:56 - -

    - - - - -
    - -
    -

    Sets the strength of the blurY property

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/BlurXFilter.html b/tutorial-4/pixi.js-master/docs/classes/BlurXFilter.html deleted file mode 100755 index a29861a..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/BlurXFilter.html +++ /dev/null @@ -1,837 +0,0 @@ - - - - - BlurXFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BlurXFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The BlurXFilter applies a horizontal Gaussian blur to an object.

    - -
    - - -
    -

    Constructor

    -
    -

    BlurXFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurXFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number the strength of the blur - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurXFilter.js:51 - -

    - - - - -
    - -
    -

    Sets the strength of both the blur.

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/BlurYFilter.html b/tutorial-4/pixi.js-master/docs/classes/BlurYFilter.html deleted file mode 100755 index e2e564b..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/BlurYFilter.html +++ /dev/null @@ -1,837 +0,0 @@ - - - - - BlurYFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    BlurYFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The BlurYFilter applies a vertical Gaussian blur to an object.

    - -
    - - -
    -

    Constructor

    -
    -

    BlurYFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurYFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number the strength of the blur - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/BlurYFilter.js:51 - -

    - - - - -
    - -
    -

    Sets the strength of both the blur.

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/CanvasBuffer.html b/tutorial-4/pixi.js-master/docs/classes/CanvasBuffer.html deleted file mode 100755 index e39dba6..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/CanvasBuffer.html +++ /dev/null @@ -1,868 +0,0 @@ - - - - - CanvasBuffer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CanvasBuffer Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    Creates a Canvas element of the given size.

    - -
    - - -
    -

    Constructor

    -
    -

    CanvasBuffer

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      the width for the newly created canvas

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the height for the newly created canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clear

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:53 - -

    - - - - - -
    - -
    -

    Clears the canvas that was created by the CanvasBuffer class.

    - -
    - - - - - - -
    - - -
    -

    resize

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:65 - -

    - - - - - -
    - -
    -

    Resizes the canvas to the specified width and height.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      the new width of the canvas

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the new height of the canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    canvas

    - HTMLCanvasElement - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:31 - -

    - - - - -
    - -
    -

    The Canvas object that belongs to this CanvasBuffer.

    - -
    - - - - - - -
    - - -
    -

    context

    - CanvasRenderingContext2D - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:39 - -

    - - - - -
    - -
    -

    A CanvasRenderingContext2D object representing a two-dimensional rendering context.

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:23 - -

    - - - - -
    - -
    -

    The height of the Canvas in pixels.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js:15 - -

    - - - - -
    - -
    -

    The width of the Canvas in pixels.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/CanvasGraphics.html b/tutorial-4/pixi.js-master/docs/classes/CanvasGraphics.html deleted file mode 100755 index 59addfe..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/CanvasGraphics.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - CanvasGraphics - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CanvasGraphics Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A set of functions used by the canvas renderer to draw the primitive graphics data.

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - - - - - - - -
    - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/CanvasMaskManager.html b/tutorial-4/pixi.js-master/docs/classes/CanvasMaskManager.html deleted file mode 100755 index 0a31f57..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/CanvasMaskManager.html +++ /dev/null @@ -1,620 +0,0 @@ - - - - - CanvasMaskManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CanvasMaskManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A set of functions used to handle masking.

    - -
    - - -
    -

    Constructor

    -
    -

    CanvasMaskManager

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasMaskManager.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    popMask

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasMaskManager.js:49 - -

    - - - - - -
    - -
    -

    Restores the current drawing context to the state it was before the mask was applied.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The renderSession whose context will be used for this mask manager.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    pushMask

    - - -
    - (
      - -
    • - - maskData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasMaskManager.js:17 - -

    - - - - - -
    - -
    -

    This method adds it to the current stack of masks.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - maskData - Object - - - - -
      -

      the maskData that will be pushed

      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      -

      The renderSession whose context will be used for this mask manager.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/CanvasRenderer.html b/tutorial-4/pixi.js-master/docs/classes/CanvasRenderer.html deleted file mode 100755 index 5c96035..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/CanvasRenderer.html +++ /dev/null @@ -1,1761 +0,0 @@ - - - - - CanvasRenderer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CanvasRenderer Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The CanvasRenderer draws the Stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. -Don't forget to add the CanvasRenderer.view to your DOM or you will not see anything :)

    - -
    - - -
    -

    Constructor

    -
    -

    CanvasRenderer

    - - -
    - (
      - -
    • - - [width=800] - -
    • - -
    • - - [height=600] - -
    • - -
    • - - [options] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - [width=800] - Number - optional - - - - -
      -

      the width of the canvas view

      - -
      - - -
    • - -
    • - - [height=600] - Number - optional - - - - -
      -

      the height of the canvas view

      - -
      - - -
    • - -
    • - - [options] - Object - optional - - - - -
      -

      The optional renderer parameters

      - -
      - - -
        - -
      • - - [view] - HTMLCanvasElement - optional - - -
        -

        the canvas to use as a view, optional

        - -
        - - -
      • - -
      • - - [transparent=false] - Boolean - optional - - -
        -

        If the render view is transparent, default false

        - -
        - - -
      • - -
      • - - [autoResize=false] - Boolean - optional - - -
        -

        If the render view is automatically resized, default false

        - -
        - - -
      • - -
      • - - [resolution=1] - Number - optional - - -
        -

        the resolution of the renderer retina would be 2

        - -
        - - -
      • - -
      • - - [clearBeforeRender=true] - Boolean - optional - - -
        -

        This sets if the CanvasRenderer will clear the canvas or not before the new render pass.

        - -
        - - -
      • - -
      - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - -
    - (
      - -
    • - - [removeView=true] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:233 - -

    - - - - - -
    - -
    -

    Removes everything from the renderer and optionally removes the Canvas DOM element.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - [removeView=true] - Boolean - optional - - - - -
      -

      Removes the Canvas element from the DOM.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    mapBlendModes

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:291 - -

    - - - - - -
    - -
    -

    Maps Pixi blend modes to canvas blend modes.

    - -
    - - - - - - -
    - - -
    -

    render

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:184 - -

    - - - - - -
    - -
    -

    Renders the Stage to this canvas view

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the Stage element to be rendered

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderDisplayObject

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - context - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:276 - -

    - - - - - -
    - -
    -

    Renders a display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      The displayObject to render

      - -
      - - -
    • - -
    • - - context - CanvasRenderingContext2D - - - - -
      -

      the context 2d method of the canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    resize

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:255 - -

    - - - - - -
    - -
    -

    Resizes the canvas view to the specified width and height

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      the new width of the canvas view

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the new height of the canvas view

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    autoResize

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:76 - -

    - - - - -
    - -
    -

    Whether the render view should be resized automatically

    - -
    - - - - - - -
    - - -
    -

    CanvasMaskManager

    - CanvasMaskManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:140 - -

    - - - - -
    - -
    -

    Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer

    - -
    - - - - - - -
    - - -
    -

    clearBeforeRender

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:56 - -

    - - - - -
    - -
    -

    This sets if the CanvasRenderer will clear the canvas or not before the new render pass. -If the Stage is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color. -If the Stage is transparent Pixi will use clearRect to clear the canvas every frame. -Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.

    - -
    - - - - - - -
    - - -
    -

    context

    - CanvasRenderingContext2D - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:114 - -

    - - - - -
    - -
    -

    The canvas 2d context that everything is drawn with

    - -
    - - - - - - -
    - - -
    -

    count

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:132 - -

    - - - - -
    - -
    -

    Internal var.

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:94 - -

    - - - - -
    - -
    -

    The height of the canvas view

    - -
    - - -

    Default: 600

    - - - - - -
    - - -
    -

    refresh

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:121 - -

    - - - - -
    - -
    -

    Boolean flag controlling canvas refresh.

    - -
    - - - - - - -
    - - -
    -

    renderSession

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:147 - -

    - - - - -
    - -
    -

    The render session is just a bunch of parameter used for rendering

    - -
    - - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:48 - -

    - - - - -
    - -
    -

    The resolution of the canvas.

    - -
    - - - - - - -
    - - -
    -

    transparent

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:68 - -

    - - - - -
    - -
    -

    Whether the render view is transparent

    - -
    - - - - - - -
    - - -
    -

    type

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:40 - -

    - - - - -
    - -
    -

    The renderer type.

    - -
    - - - - - - -
    - - -
    -

    view

    - HTMLCanvasElement - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:106 - -

    - - - - -
    - -
    -

    The canvas element that everything is drawn to.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/CanvasRenderer.js:85 - -

    - - - - -
    - -
    -

    The width of the canvas view

    - -
    - - -

    Default: 800

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/CanvasTinter.html b/tutorial-4/pixi.js-master/docs/classes/CanvasTinter.html deleted file mode 100755 index 3cedea0..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/CanvasTinter.html +++ /dev/null @@ -1,1293 +0,0 @@ - - - - - CanvasTinter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CanvasTinter Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    CanvasTinter

    - - - () - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    getTintedTexture

    - - -
    - (
      - -
    • - - sprite - -
    • - -
    • - - color - -
    • - -
    ) -
    - - - - - HTMLCanvasElement - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:14 - -

    - - - - - -
    - -
    -

    Basically this method just needs a sprite and a color and tints the sprite with the given color.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - sprite - Sprite - - - - -
      -

      the sprite to tint

      - -
      - - -
    • - -
    • - - color - Number - - - - -
      -

      the color to use to tint the sprite with

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - HTMLCanvasElement: - -

    The tinted canvas

    - - -
    -
    - - - -
    - - -
    -

    roundColor

    - - -
    - (
      - -
    • - - color - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:184 - -

    - - - - - -
    - -
    -

    Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - color - Number - - - - -
      -

      the color to round, should be a hex color

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    tintMethod

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:227 - -

    - - - - - -
    - -
    -

    The tinting method that will be used.

    - -
    - - - - - - -
    - - -
    -

    tintPerPixel

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - color - -
    • - -
    • - - canvas - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:139 - -

    - - - - - -
    - -
    -

    Tint a texture pixel per pixel.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      the texture to tint

      - -
      - - -
    • - -
    • - - color - Number - - - - -
      -

      the color to use to tint the sprite with

      - -
      - - -
    • - -
    • - - canvas - HTMLCanvasElement - - - - -
      -

      the current canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    tintWithMultiply

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - color - -
    • - -
    • - - canvas - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:58 - -

    - - - - - -
    - -
    -

    Tint a texture using the "multiply" operation.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      the texture to tint

      - -
      - - -
    • - -
    • - - color - Number - - - - -
      -

      the color to use to tint the sprite with

      - -
      - - -
    • - -
    • - - canvas - HTMLCanvasElement - - - - -
      -

      the current canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    tintWithOverlay

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - color - -
    • - -
    • - - canvas - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:104 - -

    - - - - - -
    - -
    -

    Tint a texture using the "overlay" operation.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      the texture to tint

      - -
      - - -
    • - -
    • - - color - Number - - - - -
      -

      the color to use to tint the sprite with

      - -
      - - -
    • - -
    • - - canvas - HTMLCanvasElement - - - - -
      -

      the current canvas

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    cacheStepsPerColorChannel

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:203 - -

    - - - - -
    - -
    -

    Number of steps which will be used as a cap when rounding colors.

    - -
    - - - - - - -
    - - -
    -

    canUseMultiply

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:219 - -

    - - - - -
    - -
    -

    Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method.

    - -
    - - - - - - -
    - - -
    -

    convertTintToImage

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js:211 - -

    - - - - -
    - -
    -

    Tint cache boolean flag.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/Circle.html b/tutorial-4/pixi.js-master/docs/classes/Circle.html deleted file mode 100755 index f65b051..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/Circle.html +++ /dev/null @@ -1,955 +0,0 @@ - - - - - Circle - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Circle Class

    -
    - - - - - -
    - Defined in: src/pixi/geom/Circle.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Circle object can be used to specify a hit area for displayObjects

    - -
    - - -
    -

    Constructor

    -
    -

    Circle

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - radius - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the center of this circle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the center of this circle

      - -
      - - -
    • - -
    • - - radius - Number - - - - -
      -

      The radius of the circle

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - -
      - -
    • - radius - - - -
    • - -
    • - x - - - -
    • - -
    • - y - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Circle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:38 - -

    - - - - - -
    - -
    -

    Creates a clone of this Circle instance

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Circle: - -

    a copy of the Circle

    - - -
    -
    - - - -
    - - -
    -

    contains

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:49 - -

    - - - - - -
    - -
    -

    Checks whether the x and y coordinates given are contained within this circle

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the point to test

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the point to test

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Whether the x/y coordinates are within this Circle

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:72 - -

    - - - - - -
    - -
    -

    Returns the framing rectangle of the circle as a PIXI.Rectangle object

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    radius

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:30 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:16 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Circle.js:23 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/ColorMatrixFilter.html b/tutorial-4/pixi.js-master/docs/classes/ColorMatrixFilter.html deleted file mode 100755 index c1a365b..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/ColorMatrixFilter.html +++ /dev/null @@ -1,839 +0,0 @@ - - - - - ColorMatrixFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    ColorMatrixFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The ColorMatrixFilter class lets you apply a 4x4 matrix transformation on the RGBA -color and alpha values of every pixel on your displayObject to produce a result -with a new set of RGBA color and alpha values. It's pretty powerful!

    - -
    - - -
    -

    Constructor

    -
    -

    ColorMatrixFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ColorMatrixFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    matrix

    - Array and array of 26 numbers - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ColorMatrixFilter.js:46 - -

    - - - - -
    - -
    -

    Sets the matrix of the color matrix filter

    - -
    - - -

    Default: [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]

    - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/ColorStepFilter.html b/tutorial-4/pixi.js-master/docs/classes/ColorStepFilter.html deleted file mode 100755 index 74ec410..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/ColorStepFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - ColorStepFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    ColorStepFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This lowers the color depth of your image by the given amount, producing an image with a smaller palette.

    - -
    - - -
    -

    Constructor

    -
    -

    ColorStepFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ColorStepFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    step

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ColorStepFilter.js:41 - -

    - - - - -
    - -
    -

    The number of steps to reduce the palette by.

    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/ComplexPrimitiveShader.html b/tutorial-4/pixi.js-master/docs/classes/ComplexPrimitiveShader.html deleted file mode 100755 index 7d2a7a7..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/ComplexPrimitiveShader.html +++ /dev/null @@ -1,839 +0,0 @@ - - - - - ComplexPrimitiveShader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    ComplexPrimitiveShader Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    ComplexPrimitiveShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:109 - -

    - - - - - -
    - -
    -

    Destroys the shader.

    - -
    - - - - - - -
    - - -
    -

    init

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:79 - -

    - - - - - -
    - -
    -

    Initialises the shader.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _UID

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:32 - -

    - - - - -
    - -
    -

    The fragment shader.

    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:19 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    program

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:25 - -

    - - - - -
    - -
    -

    The WebGL program.

    - -
    - - - - - - -
    - - -
    -

    vertexSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:48 - -

    - - - - -
    - -
    -

    The vertex shader.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/ConvolutionFilter.html b/tutorial-4/pixi.js-master/docs/classes/ConvolutionFilter.html deleted file mode 100755 index 2177569..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/ConvolutionFilter.html +++ /dev/null @@ -1,1020 +0,0 @@ - - - - - ConvolutionFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    ConvolutionFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The ConvolutionFilter class applies a matrix convolution filter effect. -A convolution combines pixels in the input image with neighboring pixels to produce a new image. -A wide variety of image effects can be achieved through convolutions, including blurring, edge detection, sharpening, embossing, and beveling. -The matrix should be specified as a 9 point Array. See http://docs.gimp.org/en/plug-in-convmatrix.html for more info.

    - -
    - - -
    -

    Constructor

    -
    -

    ConvolutionFilter

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ConvolutionFilter.js:1 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Array - - - - -
      -

      An array of values used for matrix transformation. Specified as a 9 point Array.

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      Width of the object you are transforming

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      Height of the object you are transforming

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ConvolutionFilter.js:93 - -

    - - - - -
    - -
    -

    Height of the object you are transforming

    - -
    - - - - - - -
    - - -
    -

    matrix

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ConvolutionFilter.js:63 - -

    - - - - -
    - -
    -

    An array of values used for matrix transformation. Specified as a 9 point Array.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/ConvolutionFilter.js:78 - -

    - - - - -
    - -
    -

    Width of the object you are transforming

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/CrossHatchFilter.html b/tutorial-4/pixi.js-master/docs/classes/CrossHatchFilter.html deleted file mode 100755 index 0f422cc..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/CrossHatchFilter.html +++ /dev/null @@ -1,837 +0,0 @@ - - - - - CrossHatchFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    CrossHatchFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A Cross Hatch effect filter.

    - -
    - - -
    -

    Constructor

    -
    -

    CrossHatchFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/CrossHatchFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number the strength of the blur - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/CrossHatchFilter.js:65 - -

    - - - - -
    - -
    -

    Sets the strength of both the blur.

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/DisplacementFilter.html b/tutorial-4/pixi.js-master/docs/classes/DisplacementFilter.html deleted file mode 100755 index 9871925..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/DisplacementFilter.html +++ /dev/null @@ -1,1037 +0,0 @@ - - - - - DisplacementFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    DisplacementFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The DisplacementFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. -You can use this filter to apply all manor of crazy warping effects -Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.

    - -
    - - -
    -

    Constructor

    -
    -

    DisplacementFilter

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DisplacementFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The texture used for the displacement map * must be power of 2 texture at the moment

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    onTextureLoaded

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DisplacementFilter.js:78 - -

    - - - - - -
    - -
    -

    Sets the map dimensions uniforms when the texture becomes available.

    - -
    - - - - - - -
    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    map

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DisplacementFilter.js:91 - -

    - - - - -
    - -
    -

    The texture used for the displacement map. Must be power of 2 texture.

    - -
    - - - - - - -
    - - -
    -

    offset

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DisplacementFilter.js:121 - -

    - - - - -
    - -
    -

    The offset used to move the displacement map.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DisplacementFilter.js:106 - -

    - - - - -
    - -
    -

    The multiplier used to scale the displacement result from the map calculation.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/DisplayObject.html b/tutorial-4/pixi.js-master/docs/classes/DisplayObject.html deleted file mode 100755 index bb55a56..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/DisplayObject.html +++ /dev/null @@ -1,4530 +0,0 @@ - - - - - DisplayObject - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    DisplayObject Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The base class for all objects that are rendered on the screen. -This is an abstract class and should not be used on its own rather it should be extended.

    - -
    - - -
    -

    Constructor

    -
    -

    DisplayObject

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:719 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:705 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    ) -
    - - - - - Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:523 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObject as a rectangle object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Matrix - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:536 - -

    - - - - - -
    - -
    -

    Retrieves the local bounds of the displayObject as a rectangle object

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:547 - -

    - - - - - -
    - -
    -

    Sets the object's stage reference, the stage this object is connected to

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the object will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:188 - -

    - - - - -
    - -
    -

    The original, cached mask of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/DisplayObjectContainer.html b/tutorial-4/pixi.js-master/docs/classes/DisplayObjectContainer.html deleted file mode 100755 index a2f19a5..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/DisplayObjectContainer.html +++ /dev/null @@ -1,5576 +0,0 @@ - - - - - DisplayObjectContainer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    DisplayObjectContainer Class

    -
    - - - -
    - Extends DisplayObject -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A DisplayObjectContainer represents a collection of display objects. -It is the base class of all display objects that act as a container for other objects.

    - -
    - - -
    -

    Constructor

    -
    -

    DisplayObjectContainer

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/DotScreenFilter.html b/tutorial-4/pixi.js-master/docs/classes/DotScreenFilter.html deleted file mode 100755 index dc7b6d7..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/DotScreenFilter.html +++ /dev/null @@ -1,887 +0,0 @@ - - - - - DotScreenFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    DotScreenFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This filter applies a dotscreen effect making display objects appear to be made out of black and white halftone dots like an old printer.

    - -
    - - -
    -

    Constructor

    -
    -

    DotScreenFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DotScreenFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    angle

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DotScreenFilter.js:72 - -

    - - - - -
    - -
    -

    The radius of the effect.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/DotScreenFilter.js:57 - -

    - - - - -
    - -
    -

    The scale of the effect.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/Ellipse.html b/tutorial-4/pixi.js-master/docs/classes/Ellipse.html deleted file mode 100755 index 8c53367..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/Ellipse.html +++ /dev/null @@ -1,1030 +0,0 @@ - - - - - Ellipse - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Ellipse Class

    -
    - - - - - -
    - Defined in: src/pixi/geom/Ellipse.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Ellipse object can be used to specify a hit area for displayObjects

    - -
    - - -
    -

    Constructor

    -
    -

    Ellipse

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the center of the ellipse

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the center of the ellipse

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The half width of this ellipse

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The half height of this ellipse

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - -
      - -
    • - height - - - -
    • - -
    • - width - - - -
    • - -
    • - x - - - -
    • - -
    • - y - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Ellipse - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:46 - -

    - - - - - -
    - -
    -

    Creates a clone of this Ellipse instance

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Ellipse: - -

    a copy of the ellipse

    - - -
    -
    - - - -
    - - -
    -

    contains

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:57 - -

    - - - - - -
    - -
    -

    Checks whether the x and y coordinates given are contained within this ellipse

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the point to test

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the point to test

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Whether the x/y coords are within this ellipse

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:80 - -

    - - - - - -
    - -
    -

    Returns the framing rectangle of the ellipse as a PIXI.Rectangle object

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:38 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:31 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:17 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Ellipse.js:24 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/Event.html b/tutorial-4/pixi.js-master/docs/classes/Event.html deleted file mode 100755 index 417223d..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/Event.html +++ /dev/null @@ -1,946 +0,0 @@ - - - - - Event - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Event Class

    -
    - - - -
    - Extends Object -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    Creates an homogenous object for tracking events so users can know what to expect.

    - -
    - - -
    -

    Constructor

    -
    -

    Event

    - - -
    - (
      - -
    • - - target - -
    • - -
    • - - name - -
    • - -
    • - - data - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:192 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - target - Object - - - - -
      -

      The target object that the event is called on

      - -
      - - -
    • - -
    • - - name - String - - - - -
      -

      The string name of the event that was triggered

      - -
      - - -
    • - -
    • - - data - Object - - - - -
      -

      Arbitrary event data to pass along

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    stopImmediatePropagation

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:277 - -

    - - - - - -
    - -
    -

    Stops the propagation of events to sibling listeners (no longer calls any listeners).

    - -
    - - - - - - -
    - - -
    -

    stopPropagation

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:268 - -

    - - - - - -
    - -
    -

    Stops the propagation of events up the scene graph (prevents bubbling).

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    data

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:246 - -

    - - - - -
    - -
    -

    The data that was passed in with this event.

    - -
    - - - - - - -
    - - -
    -

    stopped

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:206 - -

    - - - - -
    - -
    -

    Tracks the state of bubbling propagation. Do not -set this directly, instead use event.stopPropagation()

    - -
    - - - - - - -
    - - -
    -

    stoppedImmediate

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:217 - -

    - - - - -
    - -
    -

    Tracks the state of sibling listener propagation. Do not -set this directly, instead use event.stopImmediatePropagation()

    - -
    - - - - - - -
    - - -
    -

    target

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:228 - -

    - - - - -
    - -
    -

    The original target the event triggered on.

    - -
    - - - - - - -
    - - -
    -

    timeStamp

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:258 - -

    - - - - -
    - -
    -

    The timestamp when the event occurred.

    - -
    - - - - - - -
    - - -
    -

    type

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:237 - -

    - - - - -
    - -
    -

    The string name of the event that this represents.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/EventTarget.html b/tutorial-4/pixi.js-master/docs/classes/EventTarget.html deleted file mode 100755 index caab8e5..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/EventTarget.html +++ /dev/null @@ -1,1123 +0,0 @@ - - - - - EventTarget - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    EventTarget Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    Mixins event emitter functionality to a class

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/FilterBlock.html b/tutorial-4/pixi.js-master/docs/classes/FilterBlock.html deleted file mode 100755 index 381971a..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/FilterBlock.html +++ /dev/null @@ -1,510 +0,0 @@ - - - - - FilterBlock - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    FilterBlock Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A target and pass info object for filters.

    - -
    - - -
    -

    Constructor

    -
    -

    FilterBlock

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/FilterBlock.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - - - -
    -

    Properties

    - - -
    - - - - - -
    - - - - -
    -

    Properties

    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/FilterBlock.js:21 - -

    - - - - -
    - -
    -

    The renderable state of this FilterBlock.

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/FilterBlock.js:13 - -

    - - - - -
    - -
    -

    The visible state of this FilterBlock.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/FilterTexture.html b/tutorial-4/pixi.js-master/docs/classes/FilterTexture.html deleted file mode 100755 index fa30bda..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/FilterTexture.html +++ /dev/null @@ -1,967 +0,0 @@ - - - - - FilterTexture - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    FilterTexture Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    FilterTexture

    - - -
    - (
      - -
    • - - gl - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      the horizontal range of the filter

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the vertical range of the filter

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clear

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:61 - -

    - - - - - -
    - -
    -

    Clears the filter texture.

    - -
    - - - - - - -
    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:97 - -

    - - - - - -
    - -
    -

    Destroys the filter texture.

    - -
    - - - - - - -
    - - -
    -

    resize

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:74 - -

    - - - - - -
    - -
    -

    Resizes the texture to the specified width and height

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      the new width of the texture

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the new height of the texture

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    frameBuffer

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:23 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:15 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    scaleMode

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:35 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    texture

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js:29 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/Graphics.html b/tutorial-4/pixi.js-master/docs/classes/Graphics.html deleted file mode 100755 index 2d012fa..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/Graphics.html +++ /dev/null @@ -1,8669 +0,0 @@ - - - - - Graphics - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Graphics Class

    -
    - - - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and color and fill them.

    - -
    - - -
    -

    Constructor

    -
    -

    Graphics

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:983 - -

    - - - - - -
    - -
    -

    Generates the cached sprite when the sprite has cacheAsBitmap = true

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:736 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:656 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    arc

    - - -
    - (
      - -
    • - - cx - -
    • - -
    • - - cy - -
    • - -
    • - - radius - -
    • - -
    • - - startAngle - -
    • - -
    • - - endAngle - -
    • - -
    • - - anticlockwise - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:414 - -

    - - - - - -
    - -
    -

    The arc method creates an arc/curve (used to create circles, or parts of circles).

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - cx - Number - - - - -
      -

      The x-coordinate of the center of the circle

      - -
      - - -
    • - -
    • - - cy - Number - - - - -
      -

      The y-coordinate of the center of the circle

      - -
      - - -
    • - -
    • - - radius - Number - - - - -
      -

      The radius of the circle

      - -
      - - -
    • - -
    • - - startAngle - Number - - - - -
      -

      The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle)

      - -
      - - -
    • - -
    • - - endAngle - Number - - - - -
      -

      The ending angle, in radians

      - -
      - - -
    • - -
    • - - anticlockwise - Boolean - - - - -
      -

      Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    beginFill

    - - -
    - (
      - -
    • - - color - -
    • - -
    • - - alpha - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:488 - -

    - - - - - -
    - -
    -

    Specifies a simple one-color fill that subsequent calls to other Graphics methods -(such as lineTo() or drawCircle()) use when drawing.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - color - Number - - - - -
      -

      the color of the fill

      - -
      - - -
    • - -
    • - - alpha - Number - - - - -
      -

      the alpha of the fill

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    bezierCurveTo

    - - -
    - (
      - -
    • - - cpX - -
    • - -
    • - - cpY - -
    • - -
    • - - cpX2 - -
    • - -
    • - - cpY2 - -
    • - -
    • - - toX - -
    • - -
    • - - toY - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:287 - -

    - - - - - -
    - -
    -

    Calculate the points for a bezier curve and then draws it.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - cpX - Number - - - - -
      -

      Control point x

      - -
      - - -
    • - -
    • - - cpY - Number - - - - -
      -

      Control point y

      - -
      - - -
    • - -
    • - - cpX2 - Number - - - - -
      -

      Second Control point x

      - -
      - - -
    • - -
    • - - cpY2 - Number - - - - -
      -

      Second Control point y

      - -
      - - -
    • - -
    • - - toX - Number - - - - -
      -

      Destination point x

      - -
      - - -
    • - -
    • - - toY - Number - - - - -
      -

      Destination point y

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    clear

    - - - () - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:609 - -

    - - - - - -
    - -
    -

    Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    destroyCachedSprite

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:1047 - -

    - - - - - -
    - -
    -

    Destroys a previous cached sprite.

    - -
    - - - - - - -
    - - -
    -

    drawCircle

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - radius - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:562 - -

    - - - - - -
    - -
    -

    Draws a circle.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the center of the circle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the center of the circle

      - -
      - - -
    • - -
    • - - radius - Number - - - - -
      -

      The radius of the circle

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    drawEllipse

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:578 - -

    - - - - - -
    - -
    -

    Draws an ellipse.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the center of the ellipse

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the center of the ellipse

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The half width of the ellipse

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The half height of the ellipse

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    drawPolygon

    - - -
    - (
      - -
    • - - path - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:595 - -

    - - - - - -
    - -
    -

    Draws a polygon using the given path.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - path - Array - - - - -
      -

      The path data used to construct the polygon.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    drawRect

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:530 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coord of the top-left of the rectangle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coord of the top-left of the rectangle

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The width of the rectangle

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The height of the rectangle

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    drawRoundedRect

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    • - - radius - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:546 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coord of the top-left of the rectangle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coord of the top-left of the rectangle

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The width of the rectangle

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The height of the rectangle

      - -
      - - -
    • - -
    • - - radius - Number - - - - -
      -

      Radius of the rectangle corners

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    drawShape

    - - -
    - (
      - -
    • - - shape - -
    • - -
    ) -
    - - - - - GraphicsData - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:1061 - -

    - - - - - -
    - -
    -

    Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - -
    -

    Returns:

    - -
    - - - GraphicsData: - -

    The generated GraphicsData object.

    - - -
    -
    - - - -
    - - -
    -

    endFill

    - - - () - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:515 - -

    - - - - - -
    - -
    -

    Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:627 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the graphics object that can then be used to create sprites -This can be quite useful if your geometry is complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:805 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the graphic shape as a rectangle object

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    lineStyle

    - - -
    - (
      - -
    • - - lineWidth - -
    • - -
    • - - color - -
    • - -
    • - - alpha - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:171 - -

    - - - - - -
    - -
    -

    Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - lineWidth - Number - - - - -
      -

      width of the line to draw, will update the objects stored style

      - -
      - - -
    • - -
    • - - color - Number - - - - -
      -

      color of the line to draw, will update the objects stored style

      - -
      - - -
    • - -
    • - - alpha - Number - - - - -
      -

      alpha of the line to draw, will update the objects stored style

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    lineTo

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:220 - -

    - - - - - -
    - -
    -

    Draws a line using the current line style from the current drawing position to (x, y); -The current drawing position is then set to (x, y).

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      the X coordinate to draw to

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      the Y coordinate to draw to

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    moveTo

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:205 - -

    - - - - - -
    - -
    -

    Moves the current drawing position to x, y.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      the X coordinate to move to

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      the Y coordinate to move to

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    quadraticCurveTo

    - - -
    - (
      - -
    • - - cpX - -
    • - -
    • - - cpY - -
    • - -
    • - - toX - -
    • - -
    • - - toY - -
    • - -
    ) -
    - - - - - Graphics - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:237 - -

    - - - - - -
    - -
    -

    Calculate the points for a quadratic bezier curve and then draws it. -Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - cpX - Number - - - - -
      -

      Control point x

      - -
      - - -
    • - -
    • - - cpY - Number - - - - -
      -

      Control point y

      - -
      - - -
    • - -
    • - - toX - Number - - - - -
      -

      Destination point x

      - -
      - - -
    • - -
    • - - toY - Number - - - - -
      -

      Destination point y

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Graphics: - - -
    -
    - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    -

    updateCachedSpriteTexture

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:1023 - -

    - - - - - -
    - -
    -

    Updates texture size based on canvas size

    - -
    - - - - - - -
    - - -
    -

    updateLocalBounds

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:884 - -

    - - - - - -
    - -
    -

    Update the bounds of the object

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _webGL

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:79 - -

    - - - - -
    - -
    -

    Array containing some WebGL-related properties used by the WebGL renderer.

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    blendMode

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:61 - -

    - - - - -
    - -
    -

    The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode.

    - -
    - - -

    Default: PIXI.blendModes.NORMAL;

    - - - - - -
    - - -
    -

    boundsPadding

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:96 - -

    - - - - -
    - -
    -

    The bounds' padding used for bounds calculation.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/primitives/Graphics.js:139 - -

    - - - - -
    - -
    -

    When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. -This is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory. -It is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas. -This is not recommended if you are constantly redrawing the graphics element.

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    cachedSpriteDirty

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:124 - -

    - - - - -
    - -
    -

    Used to detect if the cached sprite object needs to be updated.

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    currentPath

    - Object - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:70 - -

    - - - - -
    - -
    -

    Current path

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:106 - -

    - - - - -
    - -
    -

    Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated.

    - -
    - - - - - - -
    - - -
    -

    fillAlpha

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:18 - -

    - - - - -
    - -
    -

    The alpha value used when filling the Graphics object.

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    graphicsData

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:43 - -

    - - - - -
    - -
    -

    Graphics data

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    isMask

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:88 - -

    - - - - -
    - -
    -

    Whether this shape is being used as a mask.

    - -
    - - - - - - -
    - - -
    -

    lineColor

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:34 - -

    - - - - -
    - -
    -

    The color of any lines drawn.

    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    lineWidth

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:26 - -

    - - - - -
    - -
    -

    The width (thickness) of any lines drawn.

    - -
    - - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    tint

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:52 - -

    - - - - -
    - -
    -

    The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint.

    - -
    - - -

    Default: 0xFFFFFF

    - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    webGLDirty

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:115 - -

    - - - - -
    - -
    -

    Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/GraphicsData.html b/tutorial-4/pixi.js-master/docs/classes/GraphicsData.html deleted file mode 100755 index dc8ff74..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/GraphicsData.html +++ /dev/null @@ -1,390 +0,0 @@ - - - - - GraphicsData - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    GraphicsData Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A GraphicsData object.

    - -
    - - -
    -

    Constructor

    -
    -

    GraphicsData

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/primitives/Graphics.js:1093 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - - - - - - - -
    - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/GrayFilter.html b/tutorial-4/pixi.js-master/docs/classes/GrayFilter.html deleted file mode 100755 index cbf95ad..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/GrayFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - GrayFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    GrayFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This greyscales the palette of your Display Objects.

    - -
    - - -
    -

    Constructor

    -
    -

    GrayFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/GrayFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    gray

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/GrayFilter.js:41 - -

    - - - - -
    - -
    -

    The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/ImageLoader.html b/tutorial-4/pixi.js-master/docs/classes/ImageLoader.html deleted file mode 100755 index 6b068d2..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/ImageLoader.html +++ /dev/null @@ -1,1613 +0,0 @@ - - - - - ImageLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    ImageLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    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.fromFrame() and PIXI.Sprite.fromFrame() -When loaded this class will dispatch a 'loaded' event

    - -
    - - -
    -

    Constructor

    -
    -

    ImageLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the image

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:42 - -

    - - - - - -
    - -
    -

    Loads image or takes it from cache

    - -
    - - - - - - -
    - - -
    -

    loadFramedSpriteSheet

    - - -
    - (
      - -
    • - - frameWidth - -
    • - -
    • - - frameHeight - -
    • - -
    • - - textureName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:70 - -

    - - - - - -
    - -
    -

    Loads image and split it to uniform sized frames

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frameWidth - Number - - - - -
      -

      width of each frame

      - -
      - - -
    • - -
    • - - frameHeight - Number - - - - -
      -

      height of each frame

      - -
      - - -
    • - -
    • - - textureName - String - - - - -
      -

      if given, the frames will be cached in - format

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:59 - -

    - - - - - -
    - -
    -

    Invoked when image file is loaded or it is already cached and ready to use

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    frames

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:26 - -

    - - - - -
    - -
    -

    if the image is loaded with loadFramedSpriteSheet -frames will contain the sprite sheet frames

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/ImageLoader.js:18 - -

    - - - - -
    - -
    -

    The texture being loaded

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/InteractionData.html b/tutorial-4/pixi.js-master/docs/classes/InteractionData.html deleted file mode 100755 index b31635a..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/InteractionData.html +++ /dev/null @@ -1,715 +0,0 @@ - - - - - InteractionData - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    InteractionData Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    Holds all information related to an Interaction event

    - -
    - - -
    -

    Constructor

    -
    -

    InteractionData

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionData.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    getLocalPosition

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - [point] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionData.js:38 - -

    - - - - - -
    - -
    -

    This will return the local coordinates of the specified displayObject for this InteractionData

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      The DisplayObject that you would like the local coords off

      - -
      - - -
    • - -
    • - - [point] - Point - optional - - - - -
      -

      A Point object in which to store the value, optional (otherwise will create a new point)

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point containing the coordinates of the InteractionData position relative to the DisplayObject

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    global

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionData.js:13 - -

    - - - - -
    - -
    -

    This point stores the global coords of where the touch/mouse event happened

    - -
    - - - - - - -
    - - -
    -

    originalEvent

    - Event - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionData.js:29 - -

    - - - - -
    - -
    -

    When passed to an event handler, this will be the original DOM Event that was captured

    - -
    - - - - - - -
    - - -
    -

    target

    - Sprite - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionData.js:21 - -

    - - - - -
    - -
    -

    The target Sprite that was interacted with

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/InteractionManager.html b/tutorial-4/pixi.js-master/docs/classes/InteractionManager.html deleted file mode 100755 index 952b5f9..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/InteractionManager.html +++ /dev/null @@ -1,2755 +0,0 @@ - - - - - InteractionManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    InteractionManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive -if its interactive parameter is set to true -This manager also supports multitouch.

    - -
    - - -
    -

    Constructor

    -
    -

    InteractionManager

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      The stage to handle interactions

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    collectInteractiveSprite

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - iParent - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:152 - -

    - - - - - -
    - -
    -

    Collects an interactive sprite recursively to have their interactions managed

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      the displayObject to collect

      - -
      - - -
    • - -
    • - - iParent - DisplayObject - - - - -
      -

      the display object's parent

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    hitTest

    - - -
    - (
      - -
    • - - item - -
    • - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:586 - -

    - - - - - -
    - -
    -

    Tests if the current mouse coordinates hit a sprite

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - item - DisplayObject - - - - -
      -

      The displayObject to test for a hit

      - -
      - - -
    • - -
    • - - interactionData - InteractionData - - - - -
      -

      The interactionData object to update in the case there is a hit

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onMouseDown

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:416 - -

    - - - - - -
    - -
    -

    Is called when the mouse button is pressed down on the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a mouse button being pressed down

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onMouseMove

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:380 - -

    - - - - - -
    - -
    -

    Is called when the mouse moves across the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of the mouse moving

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onMouseOut

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:477 - -

    - - - - - -
    - -
    -

    Is called when the mouse is moved out of the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a mouse being moved out

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onMouseUp

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:518 - -

    - - - - - -
    - -
    -

    Is called when the mouse button is released on the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a mouse button being released

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onTouchEnd

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:798 - -

    - - - - - -
    - -
    -

    Is called when a touch is ended on the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a touch ending on the renderer view

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onTouchMove

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:683 - -

    - - - - - -
    - -
    -

    Is called when a touch is moved across the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a touch moving across the renderer view

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onTouchStart

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:729 - -

    - - - - - -
    - -
    -

    Is called when a touch is started on the renderer element

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      -

      The DOM event of a touch starting on the renderer view

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    rebuildInteractiveGraph

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:355 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    removeEvents

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:245 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    setTarget

    - - -
    - (
      - -
    • - - target - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:193 - -

    - - - - - -
    - -
    -

    Sets the target for event delegation

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setTargetDomElement

    - - -
    - (
      - -
    • - - domElement - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:211 - -

    - - - - - -
    - -
    -

    Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM -elements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element -to receive those events

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - domElement - DOMElement - - - - -
      -

      the DOM element which will receive mouse and touch events

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    update

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:270 - -

    - - - - - -
    - -
    -

    updates the state of interactive objects

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    currentCursorStyle

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:128 - -

    - - - - -
    - -
    -

    The css style of the cursor that is being used

    - -
    - - - - - - -
    - - -
    -

    interactionDOMElement

    - HTMLCanvasElement - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:70 - -

    - - - - -
    - -
    -

    Our canvas

    - -
    - - - - - - -
    - - -
    -

    interactiveItems

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:62 - -

    - - - - -
    - -
    -

    An array containing all the iterative items from the our interactive tree

    - -
    - - - - - - -
    - - -
    -

    last

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:122 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    mouse

    - InteractionData - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:24 - -

    - - - - -
    - -
    -

    The mouse data

    - -
    - - - - - - -
    - - -
    -

    mouseOut

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:135 - -

    - - - - -
    - -
    -

    Is set to true when the mouse is moved out of the canvas

    - -
    - - - - - - -
    - - -
    -

    mouseoverEnabled

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:47 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onMouseDown

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:86 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onMouseMove

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:80 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onMouseOut

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:92 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onMouseUp

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:98 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onTouchEnd

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:110 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onTouchMove

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:116 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    onTouchStart

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:104 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    pool

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:54 - -

    - - - - -
    - -
    -

    Tiny little interactiveData pool !

    - -
    - - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:142 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:16 - -

    - - - - -
    - -
    -

    A reference to the stage

    - -
    - - - - - - -
    - - -
    -

    tempPoint

    - Point - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:40 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    touches

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/InteractionManager.js:32 - -

    - - - - -
    - -
    -

    An object that stores current touches (InteractionData) by id reference

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/InvertFilter.html b/tutorial-4/pixi.js-master/docs/classes/InvertFilter.html deleted file mode 100755 index 458f3a4..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/InvertFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - InvertFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    InvertFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This inverts your Display Objects colors.

    - -
    - - -
    -

    Constructor

    -
    -

    InvertFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/InvertFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    invert

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/InvertFilter.js:42 - -

    - - - - -
    - -
    -

    The strength of the invert. 1 will fully invert the colors, 0 will make the object its normal color

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/JsonLoader.html b/tutorial-4/pixi.js-master/docs/classes/JsonLoader.html deleted file mode 100755 index 30fbfb4..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/JsonLoader.html +++ /dev/null @@ -1,1704 +0,0 @@ - - - - - JsonLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    JsonLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The json file loader is used to load in JSON data and parse it -When loaded this class will dispatch a 'loaded' event -If loading fails this class will dispatch an 'error' event

    - -
    - - -
    -

    Constructor

    -
    -

    JsonLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the JSON file

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:59 - -

    - - - - - -
    - -
    -

    Loads the JSON data

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onError

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:176 - -

    - - - - - -
    - -
    -

    Invoked if an error occurs.

    - -
    - - - - - - -
    - - -
    -

    onJSONLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:98 - -

    - - - - - -
    - -
    -

    Invoked when the JSON file is loaded.

    - -
    - - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:162 - -

    - - - - - -
    - -
    -

    Invoked when the json file has loaded.

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    baseUrl

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:34 - -

    - - - - -
    - -
    -

    [read-only] The base url of the bitmap font data

    - -
    - - - - - - -
    - - -
    -

    crossorigin

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:26 - -

    - - - - -
    - -
    -

    Whether the requests should be treated as cross origin

    - -
    - - - - - - -
    - - -
    -

    loaded

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:43 - -

    - - - - -
    - -
    -

    [read-only] Whether the data has loaded yet

    - -
    - - - - - - -
    - - -
    -

    url

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/JsonLoader.js:18 - -

    - - - - -
    - -
    -

    The url of the bitmap font data

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/Matrix.html b/tutorial-4/pixi.js-master/docs/classes/Matrix.html deleted file mode 100755 index 8909572..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/Matrix.html +++ /dev/null @@ -1,1813 +0,0 @@ - - - - - Matrix - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Matrix Class

    -
    - - - - - -
    - Defined in: src/pixi/geom/Matrix.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Matrix class is now an object, which makes it a lot faster, -here is a representation of it : -| a | b | tx| -| c | d | ty| -| 0 | 0 | 1 |

    - -
    - - -
    -

    Constructor

    -
    -

    Matrix

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - -
      - -
    • - a - - - -
    • - -
    • - b - - - -
    • - -
    • - c - - - -
    • - -
    • - d - - - -
    • - -
    • - tx - - - -
    • - -
    • - ty - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    append

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    ) -
    - - - - - Matrix - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:225 - -

    - - - - - -
    - -
    -

    Appends the given Matrix to this Matrix.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Matrix - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Matrix: - -

    This matrix. Good for chaining method calls.

    - - -
    -
    - - - -
    - - -
    -

    apply

    - - -
    - (
      - -
    • - - pos - -
    • - -
    • - - [newPos] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:123 - -

    - - - - - -
    - -
    -

    Get a new position with the current transformation applied. -Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - pos - Point - - - - -
      -

      The origin

      - -
      - - -
    • - -
    • - - [newPos] - Point - optional - - - - -
      -

      The point that the new position is assigned to (allowed to be same as input)

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    The new point, transformed through this matrix

    - - -
    -
    - - - -
    - - -
    -

    applyInverse

    - - -
    - (
      - -
    • - - pos - -
    • - -
    • - - [newPos] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:142 - -

    - - - - - -
    - -
    -

    Get a new position with the inverse of the current transformation applied. -Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - pos - Point - - - - -
      -

      The origin

      - -
      - - -
    • - -
    • - - [newPos] - Point - optional - - - - -
      -

      The point that the new position is assigned to (allowed to be same as input)

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    The new point, inverse-transformed through this matrix

    - - -
    -
    - - - -
    - - -
    -

    fromArray

    - - -
    - (
      - -
    • - - array - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:60 - -

    - - - - - -
    - -
    -

    Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:

    -

    a = array[0] -b = array[1] -c = array[3] -d = array[4] -tx = array[2] -ty = array[5]

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - array - Array - - - - -
      -

      The array that the matrix will be populated from.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    identity

    - - - () - - - - - Matrix - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:250 - -

    - - - - - -
    - -
    -

    Resets this Matix to an identity (default) matrix.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Matrix: - -

    This matrix. Good for chaining method calls.

    - - -
    -
    - - - -
    - - -
    -

    rotate

    - - -
    - (
      - -
    • - - angle - -
    • - -
    ) -
    - - - - - Matrix - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:200 - -

    - - - - - -
    - -
    -

    Applies a rotation transformation to the matrix.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - angle - Number - - - - -
      -

      The angle in radians.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Matrix: - -

    This matrix. Good for chaining method calls.

    - - -
    -
    - - - -
    - - -
    -

    scale

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Matrix - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:179 - -

    - - - - - -
    - -
    -

    Applies a scale transformation to the matrix.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The amount to scale horizontally

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The amount to scale vertically

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Matrix: - -

    This matrix. Good for chaining method calls.

    - - -
    -
    - - - -
    - - -
    -

    toArray

    - - -
    - (
      - -
    • - - transpose - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:83 - -

    - - - - - -
    - -
    -

    Creates an array from the current Matrix object.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - transpose - Boolean - - - - -
      -

      Whether we need to transpose the matrix or not

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    the newly created array which contains the matrix

    - - -
    -
    - - - -
    - - -
    -

    translate

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Matrix - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:163 - -

    - - - - - -
    - -
    -

    Translates the matrix on the x and y.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      - -
      - - -
    • - -
    • - - y - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Matrix: - -

    This matrix. Good for chaining method calls.

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    a

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:17 - -

    - - - - -
    - -
    - -
    - - -

    Default: 1

    - - - - - -
    - - -
    -

    b

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:24 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    c

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:31 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    d

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:38 - -

    - - - - -
    - -
    - -
    - - -

    Default: 1

    - - - - - -
    - - -
    -

    tx

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:45 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    ty

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Matrix.js:52 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/MovieClip.html b/tutorial-4/pixi.js-master/docs/classes/MovieClip.html deleted file mode 100755 index 6ff435e..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/MovieClip.html +++ /dev/null @@ -1,7042 +0,0 @@ - - - - - MovieClip - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    MovieClip Class

    -
    - - - -
    - Extends Sprite -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A MovieClip is a simple way to display an animation depicted by a list of textures.

    - -
    - - -
    -

    Constructor

    -
    -

    MovieClip

    - - -
    - (
      - -
    • - - textures - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - textures - Array - - - - -
      -

      an array of {Texture} objects that make up the animation

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:305 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:242 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    fromFrames

    - - -
    - (
      - -
    • - - frames - -
    • - -
    ) -
    - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:169 - -

    - - - - - -
    - -
    -

    A short hand way of creating a movieclip from an array of frame ids

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frames - Array - - - - -
      -

      the array of frames ids the movieclip will use as its texture frames

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    fromImages

    - - -
    - (
      - -
    • - - frames - -
    • - -
    ) -
    - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:188 - -

    - - - - - -
    - -
    -

    A short hand way of creating a movieclip from an array of image ids

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frames - Array - - - - -
      -

      the array of image ids the movieclip will use as its texture frames

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    ) -
    - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:163 - -

    - - - - - -
    - -
    -

    Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Matrix - - - - -
      -

      the transformation matrix of the sprite

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    gotoAndPlay

    - - -
    - (
      - -
    • - - frameNumber - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:125 - -

    - - - - - -
    - -
    -

    Goes to a specific frame and begins playing the MovieClip

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frameNumber - Number - - - - -
      -

      frame index to start at

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    gotoAndStop

    - - -
    - (
      - -
    • - - frameNumber - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:111 - -

    - - - - - -
    - -
    -

    Stops the MovieClip and goes to a specific frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frameNumber - Number - - - - -
      -

      frame index to stop at

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:147 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    play

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:101 - -

    - - - - - -
    - -
    -

    Plays the MovieClip

    - -
    - - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setTexture

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:135 - -

    - - - - - -
    - -
    -

    Sets the texture of the sprite

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The PIXI texture that is displayed by the sprite

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    stop

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:91 - -

    - - - - - -
    - -
    -

    Stops the MovieClip

    - -
    - - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _height

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:50 - -

    - - - - -
    - -
    -

    The height of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _width

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:41 - -

    - - - - -
    - -
    -

    The width of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    anchor

    - Point - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:22 - -

    - - - - -
    - -
    -

    The anchor sets the origin point of the texture. -The default is 0,0 this means the texture's origin is the top left -Setting than anchor to 0.5,0.5 means the textures origin is centered -Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner

    - -
    - - - - - - -
    - - -
    -

    animationSpeed

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:25 - -

    - - - - -
    - -
    -

    The speed that the MovieClip will play at. Higher is faster, lower is slower

    - -
    - - -

    Default: 1

    - - - - - -
    - - -
    -

    blendMode

    - Number - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:68 - -

    - - - - -
    - -
    -

    The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.

    - -
    - - -

    Default: PIXI.blendModes.NORMAL;

    - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    currentFrame

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:51 - -

    - - - - -
    - -
    -

    [read-only] The MovieClips current frame index (this may not have to be a whole number)

    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/display/Sprite.js:119 - -

    - - - - -
    - -
    -

    The height of the sprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    loop

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:34 - -

    - - - - -
    - -
    -

    Whether or not the movie clip repeats after playing.

    - -
    - - -

    Default: true

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    onComplete

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:43 - -

    - - - - -
    - -
    -

    Function to call when a MovieClip finishes playing

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    playing

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:61 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the MovieClip is currently playing

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    shader

    - PIXI.AbstractFilter - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:77 - -

    - - - - -
    - -
    -

    The shader that will be used to render the texture to the stage. Set to null to remove a current shader.

    - -
    - - -

    Default: null

    - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:33 - -

    - - - - -
    - -
    -

    The texture that the sprite is using

    - -
    - - - - - - -
    - - -
    -

    textures

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:17 - -

    - - - - -
    - -
    -

    The array of textures that make up the animation

    - -
    - - - - - - -
    - - -
    -

    tint

    - Number - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:59 - -

    - - - - -
    - -
    -

    The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.

    - -
    - - -

    Default: 0xFFFFFF

    - - - - - -
    - - -
    -

    totalFrames

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/MovieClip.js:75 - -

    - - - - -
    - -
    -

    [read-only] totalFrames is the total number of frames in the MovieClip. This is the same as number of textures -assigned to the MovieClip.

    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/display/Sprite.js:103 - -

    - - - - -
    - -
    -

    The width of the sprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/NoiseFilter.html b/tutorial-4/pixi.js-master/docs/classes/NoiseFilter.html deleted file mode 100755 index 0a2e317..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/NoiseFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - NoiseFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    NoiseFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A Noise effect filter.

    - -
    - - -
    -

    Constructor

    -
    -

    NoiseFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NoiseFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    noise

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NoiseFilter.js:49 - -

    - - - - -
    - -
    -

    The amount of noise to apply.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/NormalMapFilter.html b/tutorial-4/pixi.js-master/docs/classes/NormalMapFilter.html deleted file mode 100755 index f553ab2..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/NormalMapFilter.html +++ /dev/null @@ -1,1037 +0,0 @@ - - - - - NormalMapFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    NormalMapFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The NormalMapFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. -You can use this filter to apply all manor of crazy warping effects -Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.

    - -
    - - -
    -

    Constructor

    -
    -

    NormalMapFilter

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NormalMapFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The texture used for the displacement map * must be power of 2 texture at the moment

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    onTextureLoaded

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NormalMapFilter.js:140 - -

    - - - - - -
    - -
    -

    Sets the map dimensions uniforms when the texture becomes available.

    - -
    - - - - - - -
    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    map

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NormalMapFilter.js:153 - -

    - - - - -
    - -
    -

    The texture used for the displacement map. Must be power of 2 texture.

    - -
    - - - - - - -
    - - -
    -

    offset

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NormalMapFilter.js:183 - -

    - - - - -
    - -
    -

    The offset used to move the displacement map.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/NormalMapFilter.js:168 - -

    - - - - -
    - -
    -

    The multiplier used to scale the displacement result from the map calculation.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/PixelateFilter.html b/tutorial-4/pixi.js-master/docs/classes/PixelateFilter.html deleted file mode 100755 index 50fd174..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/PixelateFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - PixelateFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PixelateFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This filter applies a pixelate effect making display objects appear 'blocky'.

    - -
    - - -
    -

    Constructor

    -
    -

    PixelateFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/PixelateFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    size

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/PixelateFilter.js:48 - -

    - - - - -
    - -
    -

    This a point that describes the size of the blocks. x is the width of the block and y is the height.

    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/PixiFastShader.html b/tutorial-4/pixi.js-master/docs/classes/PixiFastShader.html deleted file mode 100755 index 5c0596a..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/PixiFastShader.html +++ /dev/null @@ -1,891 +0,0 @@ - - - - - PixiFastShader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PixiFastShader Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    PixiFastShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:143 - -

    - - - - - -
    - -
    -

    Destroys the shader.

    - -
    - - - - - - -
    - - -
    -

    init

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:94 - -

    - - - - - -
    - -
    -

    Initialises the shader.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _UID

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:32 - -

    - - - - -
    - -
    -

    The fragment shader.

    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:19 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    program

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:25 - -

    - - - - -
    - -
    -

    The WebGL program.

    - -
    - - - - - - -
    - - -
    -

    textureCount

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:82 - -

    - - - - -
    - -
    -

    A local texture counter for multi-texture shaders.

    - -
    - - - - - - -
    - - -
    -

    vertexSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js:47 - -

    - - - - -
    - -
    -

    The vertex shader.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/PixiShader.html b/tutorial-4/pixi.js-master/docs/classes/PixiShader.html deleted file mode 100755 index 79f93ed..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/PixiShader.html +++ /dev/null @@ -1,1239 +0,0 @@ - - - - - PixiShader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PixiShader Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    PixiShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:6 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:351 - -

    - - - - - -
    - -
    -

    Destroys the shader.

    - -
    - - - - - - -
    - - -
    -

    init

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:83 - -

    - - - - - -
    - -
    -

    Initialises the shader.

    - -
    - - - - - - -
    - - -
    -

    initSampler2D

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:208 - -

    - - - - - -
    - -
    -

    Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded)

    - -
    - - - - - - -
    - - -
    -

    initUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:134 - -

    - - - - - -
    - -
    -

    Initialises the shader uniform values.

    -

    Uniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/ -http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf

    - -
    - - - - - - -
    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:283 - -

    - - - - - -
    - -
    -

    Updates the shader uniform values.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _UID

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:13 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    attributes

    - Array - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:70 - -

    - - - - -
    - -
    -

    Uniform attributes cache.

    - -
    - - - - - - -
    - - -
    -

    defaultVertexSrc

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:365 - -

    - - - - -
    - -
    -

    The Default Vertex shader source.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:63 - -

    - - - - -
    - -
    -

    A dirty flag

    - -
    - - - - - - -
    - - -
    -

    firstRun

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:55 - -

    - - - - -
    - -
    -

    A local flag

    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:33 - -

    - - - - -
    - -
    -

    The fragment shader.

    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:20 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    program

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:26 - -

    - - - - -
    - -
    -

    The WebGL program.

    - -
    - - - - - - -
    - - -
    -

    textureCount

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js:48 - -

    - - - - -
    - -
    -

    A local texture counter for multi-texture shaders.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/Point.html b/tutorial-4/pixi.js-master/docs/classes/Point.html deleted file mode 100755 index d2030b9..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/Point.html +++ /dev/null @@ -1,785 +0,0 @@ - - - - - Point - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Point Class

    -
    - - - - - -
    - Defined in: src/pixi/geom/Point.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    - -
    - - -
    -

    Constructor

    -
    -

    Point

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Point.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      position of the point on the x axis

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      position of the point on the y axis

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - -
      - -
    • - clone - - - -
    • - -
    • - set - - - -
    • - -
    -
    - - - -
    -

    Properties

    - -
      - -
    • - x - - - -
    • - -
    • - y - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Point.js:30 - -

    - - - - - -
    - -
    -

    Creates a clone of this point

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Point: - -

    a copy of the point

    - - -
    -
    - - - -
    - - -
    -

    set

    - - -
    - (
      - -
    • - - [x=0] - -
    • - -
    • - - [y=0] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Point.js:41 - -

    - - - - - -
    - -
    -

    Sets the point to a new x and y position. -If y is omitted, both x and y will be set to x.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - [x=0] - Number - optional - - - - -
      -

      position of the point on the x axis

      - -
      - - -
    • - -
    • - - [y=0] - Number - optional - - - - -
      -

      position of the point on the y axis

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Point.js:15 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Point.js:22 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/PolyK.html b/tutorial-4/pixi.js-master/docs/classes/PolyK.html deleted file mode 100755 index e1d21ed..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/PolyK.html +++ /dev/null @@ -1,761 +0,0 @@ - - - - - PolyK - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PolyK Class

    -
    - - - - - -
    - Defined in: src/pixi/utils/Polyk.js:34 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    Based on the Polyk library http://polyk.ivank.net released under MIT licence. -This is an amazing lib! -Slightly modified by Mat Groves (matgroves.com);

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _convex

    - - - () - - - - - Boolean - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Polyk.js:158 - -

    - - - - - -
    - -
    -

    Checks whether a shape is convex

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Boolean: - - -
    -
    - - - -
    - - -
    -

    _PointInTriangle

    - - -
    - (
      - -
    • - - px - -
    • - -
    • - - py - -
    • - -
    • - - ax - -
    • - -
    • - - ay - -
    • - -
    • - - bx - -
    • - -
    • - - by - -
    • - -
    • - - cx - -
    • - -
    • - - cy - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Polyk.js:120 - -

    - - - - - -
    - -
    -

    Checks whether a point is within a triangle

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - px - Number - - - - -
      -

      x coordinate of the point to test

      - -
      - - -
    • - -
    • - - py - Number - - - - -
      -

      y coordinate of the point to test

      - -
      - - -
    • - -
    • - - ax - Number - - - - -
      -

      x coordinate of the a point of the triangle

      - -
      - - -
    • - -
    • - - ay - Number - - - - -
      -

      y coordinate of the a point of the triangle

      - -
      - - -
    • - -
    • - - bx - Number - - - - -
      -

      x coordinate of the b point of the triangle

      - -
      - - -
    • - -
    • - - by - Number - - - - -
      -

      y coordinate of the b point of the triangle

      - -
      - - -
    • - -
    • - - cx - Number - - - - -
      -

      x coordinate of the c point of the triangle

      - -
      - - -
    • - -
    • - - cy - Number - - - - -
      -

      y coordinate of the c point of the triangle

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - - -
    -
    - - - -
    - - -
    -

    Triangulate

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/utils/Polyk.js:42 - -

    - - - - - -
    - -
    -

    Triangulates shapes for webGL graphic fills.

    - -
    - - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/Polygon.html b/tutorial-4/pixi.js-master/docs/classes/Polygon.html deleted file mode 100755 index 6fa4c44..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/Polygon.html +++ /dev/null @@ -1,661 +0,0 @@ - - - - - Polygon - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Polygon Class

    -
    - - - - - -
    - Defined in: src/pixi/geom/Polygon.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    Polygon

    - - -
    - (
      - -
    • - - points - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Polygon.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - points - Array | Array | Point... | Number... - - - - multiple - - -
      -

      This can be an array of Points that form the polygon, - a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be - all the points of the polygon e.g. new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...), or the - arguments passed can be flat x,y values e.g. new PIXI.Polygon(x,y, x,y, x,y, ...) where x and y are - Numbers.

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Polygon - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Polygon.js:35 - -

    - - - - - -
    - -
    -

    Creates a clone of this polygon

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Polygon: - -

    a copy of the polygon

    - - -
    -
    - - - -
    - - -
    -

    contains

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Polygon.js:47 - -

    - - - - - -
    - -
    -

    Checks whether the x and y coordinates passed to this function are contained within this polygon

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the point to test

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the point to test

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Whether the x/y coordinates are within this polygon

    - - -
    -
    - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/PrimitiveShader.html b/tutorial-4/pixi.js-master/docs/classes/PrimitiveShader.html deleted file mode 100755 index 0641655..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/PrimitiveShader.html +++ /dev/null @@ -1,839 +0,0 @@ - - - - - PrimitiveShader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PrimitiveShader Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    PrimitiveShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:103 - -

    - - - - - -
    - -
    -

    Destroys the shader.

    - -
    - - - - - - -
    - - -
    -

    init

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:74 - -

    - - - - - -
    - -
    -

    Initialises the shader.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _UID

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:32 - -

    - - - - -
    - -
    -

    The fragment shader.

    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:19 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    program

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:25 - -

    - - - - -
    - -
    -

    The WebGL program.

    - -
    - - - - - - -
    - - -
    -

    vertexSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js:46 - -

    - - - - -
    - -
    -

    The vertex shader.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/RGBSplitFilter.html b/tutorial-4/pixi.js-master/docs/classes/RGBSplitFilter.html deleted file mode 100755 index ffb75a6..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/RGBSplitFilter.html +++ /dev/null @@ -1,939 +0,0 @@ - - - - - RGBSplitFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    RGBSplitFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    An RGB Split Filter.

    - -
    - - -
    -

    Constructor

    -
    -

    RGBSplitFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/RGBSplitFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blue

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/RGBSplitFilter.js:78 - -

    - - - - -
    - -
    -

    Blue offset.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    green

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/RGBSplitFilter.js:63 - -

    - - - - -
    - -
    -

    Green channel offset.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    red

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/RGBSplitFilter.js:48 - -

    - - - - -
    - -
    -

    Red channel offset.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/Rectangle.html b/tutorial-4/pixi.js-master/docs/classes/Rectangle.html deleted file mode 100755 index 2180606..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/Rectangle.html +++ /dev/null @@ -1,950 +0,0 @@ - - - - - Rectangle - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Rectangle Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

    - -
    - - -
    -

    Constructor

    -
    -

    Rectangle

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the upper-left corner of the rectangle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the upper-left corner of the rectangle

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The overall width of this rectangle

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The overall height of this rectangle

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - -
      - -
    • - height - - - -
    • - -
    • - width - - - -
    • - -
    • - x - - - -
    • - -
    • - y - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:46 - -

    - - - - - -
    - -
    -

    Creates a clone of this Rectangle

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    a copy of the rectangle

    - - -
    -
    - - - -
    - - -
    -

    contains

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:57 - -

    - - - - - -
    - -
    -

    Checks whether the x and y coordinates given are contained within this Rectangle

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the point to test

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the point to test

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Whether the x/y coordinates are within this Rectangle

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:38 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:31 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:17 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/Rectangle.js:24 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/RenderTexture.html b/tutorial-4/pixi.js-master/docs/classes/RenderTexture.html deleted file mode 100755 index f7c7c7e..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/RenderTexture.html +++ /dev/null @@ -1,2964 +0,0 @@ - - - - - RenderTexture - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    RenderTexture Class

    -
    - - - -
    - Extends Texture -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A RenderTexture is a special texture that allows any Pixi display object to be rendered to it.

    -

    Hint: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead.

    -

    A RenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example:

    -

    var renderTexture = new PIXI.RenderTexture(800, 600); - var sprite = PIXI.Sprite.fromImage("spinObj_01.png"); - sprite.position.x = 800/2; - sprite.position.y = 600/2; - sprite.anchor.x = 0.5; - sprite.anchor.y = 0.5; - renderTexture.render(sprite);

    -

    The Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual position a DisplayObjectContainer should be used:

    -

    var doc = new PIXI.DisplayObjectContainer(); - doc.addChild(sprite); - renderTexture.render(doc); // Renders to center of renderTexture

    - -
    - - -
    -

    Constructor

    -
    -

    RenderTexture

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    • - - renderer - -
    • - -
    • - - scaleMode - -
    • - -
    • - - resolution - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      The width of the render texture

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The height of the render texture

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used for this RenderTexture

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _updateUvs

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:200 - -

    - - - - - -
    - -
    -

    Updates the internal WebGL UV cache.

    - -
    - - - - - - -
    - - -
    -

    clear

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:171 - -

    - - - - - -
    - -
    -

    Clears the RenderTexture.

    - -
    - - - - - - -
    - - -
    -

    destroy

    - - -
    - (
      - -
    • - - destroyBase - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:149 - -

    - - - - - -
    - -
    -

    Destroys this texture

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - destroyBase - Boolean - - - - -
      -

      Whether to destroy the base texture as well

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    getBase64

    - - - () - - - - - String - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:291 - -

    - - - - - -
    - -
    -

    Will return a a base64 encoded string of this texture. It works by calling RenderTexture.getCanvas and then running toDataURL on that.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - String: - -

    A base64 encoded string of the texture.

    - - -
    -
    - - - -
    - - -
    -

    getCanvas

    - - - () - - - - - HTMLCanvasElement - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:302 - -

    - - - - - -
    - -
    -

    Creates a Canvas element, renders this RenderTexture to it and then returns it.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - HTMLCanvasElement: - -

    A Canvas element with the texture rendered on.

    - - -
    -
    - - - -
    - - -
    -

    getImage

    - - - () - - - - - Image - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:278 - -

    - - - - - -
    - -
    -

    Will return a HTML Image of the texture

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Image: - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onBaseTextureLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:131 - -

    - - - - - -
    - -
    -

    Called when the base texture is loaded

    - -
    - - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderCanvas

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - [matrix] - -
    • - -
    • - - [clear] - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:237 - -

    - - - - - -
    - -
    -

    This function will draw the display object to the texture.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      The display object to render this texture on

      - -
      - - -
    • - -
    • - - [matrix] - Matrix - optional - - - - -
      -

      Optional matrix to apply to the display object before rendering.

      - -
      - - -
    • - -
    • - - [clear] - Boolean - optional - - - - -
      -

      If true the texture will be cleared before the displayObject is drawn

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderWebGL

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - [matrix] - -
    • - -
    • - - [clear] - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:188 - -

    - - - - - -
    - -
    -

    This function will draw the display object to the texture.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      The display object to render this texture on

      - -
      - - -
    • - -
    • - - [matrix] - Matrix - optional - - - - -
      -

      Optional matrix to apply to the display object before rendering.

      - -
      - - -
    • - -
    • - - [clear] - Boolean - optional - - - - -
      -

      If true the texture will be cleared before the displayObject is drawn

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    resize

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    • - - updateBase - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:137 - -

    - - - - - -
    - -
    -

    Resizes the RenderTexture.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      The width to resize to.

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The height to resize to.

      - -
      - - -
    • - -
    • - - updateBase - Boolean - - - - -
      -

      Should the baseTexture.width and height values be resized as well?

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setFrame

    - - -
    - (
      - -
    • - - frame - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:162 - -

    - - - - - -
    - -
    -

    Specifies the region of the baseTexture that this texture will use.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frame - Rectangle - - - - -
      -

      The frame of the texture to set it to

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _uvs

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:83 - -

    - - - - -
    - -
    -

    The WebGL UV data cache.

    - -
    - - - - - - -
    - - -
    -

    baseTexture

    - BaseTexture - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:78 - -

    - - - - -
    - -
    -

    The base texture object that this texture uses

    - -
    - - - - - - -
    - - -
    -

    crop

    - Rectangle - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:69 - -

    - - - - -
    - -
    -

    This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, -irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)

    - -
    - - - - - - -
    - - -
    -

    frame

    - Rectangle - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:61 - -

    - - - - -
    - -
    -

    The framing rectangle of the render texture

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:45 - -

    - - - - -
    - -
    -

    The height of the render texture

    - -
    - - - - - - -
    - - -
    -

    noFrame

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:24 - -

    - - - - -
    - -
    -

    Does this Texture have any frame data assigned to it?

    - -
    - - - - - - -
    - - -
    -

    renderer

    - CanvasRenderer | WebGLRenderer - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:99 - -

    - - - - -
    - -
    -

    The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL.

    - -
    - - - - - - -
    - - -
    -

    requiresUpdate

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:75 - -

    - - - - -
    - -
    -

    This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)

    - -
    - - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/RenderTexture.js:53 - -

    - - - - -
    - -
    -

    The Resolution of the texture.

    - -
    - - - - - - -
    - - -
    -

    trim

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - Texture: - - - - src/pixi/textures/Texture.js:59 - -

    - - - - -
    - -
    -

    The texture trim data.

    - -
    - - - - - - -
    - - -
    -

    valid

    - Boolean - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:125 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - -

    Inherited from - - Texture - - - but overwritten in - - - - src/pixi/textures/RenderTexture.js:37 - -

    - - - - -
    - -
    -

    The with of the render texture

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/Rope.html b/tutorial-4/pixi.js-master/docs/classes/Rope.html deleted file mode 100755 index c1c314b..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/Rope.html +++ /dev/null @@ -1,5931 +0,0 @@ - - - - - Rope - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Rope Class

    -
    - - - -
    - Extends Strip -
    - - - -
    - Defined in: src/pixi/extras/Rope.js:6 -
    - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    Rope

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - points - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Rope.js:6 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -
        -
      • The texture to use on the rope.
      • -
      - -
      - - -
    • - -
    • - - points - Array - - - - -
      -
        -
      • An array of {PIXI.Point}.
      • -
      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Strip: - - - - src/pixi/extras/Strip.js:341 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    renderStripFlat

    - - -
    - (
      - -
    • - - strip - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Strip: - - - - src/pixi/extras/Strip.js:293 - -

    - - - - - -
    - -
    -

    Renders a flat strip

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - strip - Strip - - - - -
      -

      The Strip to render

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - Strip: - - - - src/pixi/extras/Strip.js:43 - -

    - - - - -
    - -
    -

    Whether the strip is dirty or not

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - Strip: - - - - src/pixi/extras/Strip.js:52 - -

    - - - - -
    - -
    -

    if you need a padding, not yet implemented

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - -

    Inherited from - Strip: - - - - src/pixi/extras/Strip.js:20 - -

    - - - - -
    - -
    -

    The texture of the strip

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/Rounded Rectangle.html b/tutorial-4/pixi.js-master/docs/classes/Rounded Rectangle.html deleted file mode 100755 index 00a3e40..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/Rounded Rectangle.html +++ /dev/null @@ -1,1025 +0,0 @@ - - - - - Rounded Rectangle - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Rounded Rectangle Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    the Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height.

    - -
    - - -
    -

    Constructor

    -
    -

    Rounded Rectangle

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    • - - radius - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the upper-left corner of the rounded rectangle

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the upper-left corner of the rounded rectangle

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      The overall width of this rounded rectangle

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      The overall height of this rounded rectangle

      - -
      - - -
    • - -
    • - - radius - Number - - - - -
      -

      The overall radius of this corners of this rounded rectangle

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - -
      - -
    • - height - - - -
    • - -
    • - radius - - - -
    • - -
    • - width - - - -
    • - -
    • - x - - - -
    • - -
    • - y - - - -
    • - -
    -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    clone

    - - - () - - - - - Rounded Rectangle - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:54 - -

    - - - - - -
    - -
    -

    Creates a clone of this Rounded Rectangle

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rounded Rectangle: - -

    a copy of the rounded rectangle

    - - -
    -
    - - - -
    - - -
    -

    contains

    - - -
    - (
      - -
    • - - x - -
    • - -
    • - - y - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:65 - -

    - - - - - -
    - -
    -

    Checks whether the x and y coordinates given are contained within this Rounded Rectangle

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - x - Number - - - - -
      -

      The X coordinate of the point to test

      - -
      - - -
    • - -
    • - - y - Number - - - - -
      -

      The Y coordinate of the point to test

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Whether the x/y coordinates are within this Rounded Rectangle

    - - -
    -
    - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:39 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    radius

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:46 - -

    - - - - -
    - -
    - -
    - - -

    Default: 20

    - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:32 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:18 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/geom/RoundedRectangle.js:25 - -

    - - - - -
    - -
    - -
    - - -

    Default: 0

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/SepiaFilter.html b/tutorial-4/pixi.js-master/docs/classes/SepiaFilter.html deleted file mode 100755 index fee5fe6..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/SepiaFilter.html +++ /dev/null @@ -1,835 +0,0 @@ - - - - - SepiaFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    SepiaFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This applies a sepia effect to your Display Objects.

    - -
    - - -
    -

    Constructor

    -
    -

    SepiaFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/SepiaFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    sepia

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/SepiaFilter.js:43 - -

    - - - - -
    - -
    -

    The strength of the sepia. 1 will apply the full sepia effect, 0 will make the object its normal color.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/SmartBlurFilter.html b/tutorial-4/pixi.js-master/docs/classes/SmartBlurFilter.html deleted file mode 100755 index 4f1da72..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/SmartBlurFilter.html +++ /dev/null @@ -1,837 +0,0 @@ - - - - - SmartBlurFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    SmartBlurFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A Smart Blur Filter.

    - -
    - - -
    -

    Constructor

    -
    -

    SmartBlurFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/SmartBlurFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number the strength of the blur - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/SmartBlurFilter.js:61 - -

    - - - - -
    - -
    -

    The strength of the blur.

    - -
    - - -

    Default: 2

    - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/Spine.html b/tutorial-4/pixi.js-master/docs/classes/Spine.html deleted file mode 100755 index 4c0f0fa..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/Spine.html +++ /dev/null @@ -1,5572 +0,0 @@ - - - - - Spine - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Spine Class

    -
    - - - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A class that enables the you to import and run your spine animations in pixi. -Spine animation data needs to be loaded using the PIXI.AssetLoader or PIXI.SpineLoader before it can be used by this class -See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source

    - -
    - - -
    -

    Constructor

    -
    -

    Spine

    - - -
    - (
      - -
    • - - url - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Spine.js:1357 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the spine anim file to be used

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/SpineLoader.html b/tutorial-4/pixi.js-master/docs/classes/SpineLoader.html deleted file mode 100755 index ed00edc..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/SpineLoader.html +++ /dev/null @@ -1,1527 +0,0 @@ - - - - - SpineLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    SpineLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Spine loader is used to load in JSON spine data -To generate the data you need to use http://esotericsoftware.com/ and export in the "JSON" format -Due to a clash of names You will need to change the extension of the spine file from .json to .anim for it to load -See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source -You will need to generate a sprite sheet to accompany the spine data -When loaded this class will dispatch a "loaded" event

    - -
    - - -
    -

    Constructor

    -
    -

    SpineLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:10 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the JSON file

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:56 - -

    - - - - - -
    - -
    -

    Loads the JSON data

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:72 - -

    - - - - - -
    - -
    -

    Invoked when JSON file is loaded.

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    crossorigin

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:34 - -

    - - - - -
    - -
    -

    Whether the requests should be treated as cross origin

    - -
    - - - - - - -
    - - -
    -

    loaded

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:42 - -

    - - - - -
    - -
    -

    [read-only] Whether the data has loaded yet

    - -
    - - - - - - -
    - - -
    -

    url

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpineLoader.js:26 - -

    - - - - -
    - -
    -

    The url of the bitmap font data

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/Sprite.html b/tutorial-4/pixi.js-master/docs/classes/Sprite.html deleted file mode 100755 index 59ecf6e..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/Sprite.html +++ /dev/null @@ -1,6422 +0,0 @@ - - - - - Sprite - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Sprite Class

    -
    - - - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The Sprite object is the base for all textured objects that are rendered to the screen

    - -
    - - -
    -

    Constructor

    -
    -

    Sprite

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The texture for this sprite

      -

      A sprite can be created directly from an image like this : -var sprite = new PIXI.Sprite.fromImage('assets/image.png'); -yourStage.addChild(sprite); -then obviously don't forget to add it to the stage you have already created

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:305 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:242 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    fromFrame

    - - -
    - (
      - -
    • - - frameId - -
    • - -
    ) -
    - - - - - Sprite - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:418 - -

    - - - - - -
    - -
    -

    Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId - The frame ids are created when a Texture packer file has been loaded

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frameId - String - - - - -
      -

      The frame Id of the texture in the cache

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Sprite: - -

    A new Sprite using a texture from the texture cache matching the frameId

    - - -
    -
    - - - -
    - - -
    -

    fromImage

    - - -
    - (
      - -
    • - - imageId - -
    • - -
    ) -
    - - - - - Sprite - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:435 - -

    - - - - - -
    - -
    -

    Helper function that creates a sprite that will contain a texture based on an image url - If the image is not in the texture cache it will be loaded

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - imageId - String - - - - -
      -

      The image url of the texture

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Sprite: - -

    A new Sprite using a texture from the texture cache matching the image id

    - - -
    -
    - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    ) -
    - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Sprite.js:163 - -

    - - - - - -
    - -
    -

    Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Matrix - - - - -
      -

      the transformation matrix of the sprite

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:147 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setTexture

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:135 - -

    - - - - - -
    - -
    -

    Sets the texture of the sprite

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The PIXI texture that is displayed by the sprite

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _height

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:50 - -

    - - - - -
    - -
    -

    The height of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _width

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:41 - -

    - - - - -
    - -
    -

    The width of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    anchor

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:22 - -

    - - - - -
    - -
    -

    The anchor sets the origin point of the texture. -The default is 0,0 this means the texture's origin is the top left -Setting than anchor to 0.5,0.5 means the textures origin is centered -Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner

    - -
    - - - - - - -
    - - -
    -

    blendMode

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:68 - -

    - - - - -
    - -
    -

    The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.

    - -
    - - -

    Default: PIXI.blendModes.NORMAL;

    - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/display/Sprite.js:119 - -

    - - - - -
    - -
    -

    The height of the sprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    shader

    - PIXI.AbstractFilter - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:77 - -

    - - - - -
    - -
    -

    The shader that will be used to render the texture to the stage. Set to null to remove a current shader.

    - -
    - - -

    Default: null

    - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:33 - -

    - - - - -
    - -
    -

    The texture that the sprite is using

    - -
    - - - - - - -
    - - -
    -

    tint

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Sprite.js:59 - -

    - - - - -
    - -
    -

    The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.

    - -
    - - -

    Default: 0xFFFFFF

    - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/display/Sprite.js:103 - -

    - - - - -
    - -
    -

    The width of the sprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/SpriteBatch.html b/tutorial-4/pixi.js-master/docs/classes/SpriteBatch.html deleted file mode 100755 index d55ac22..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/SpriteBatch.html +++ /dev/null @@ -1,643 +0,0 @@ - - - - - SpriteBatch - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    SpriteBatch Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The SpriteBatch class is a really fast version of the DisplayObjectContainer -built solely for speed, so use when you need a lot of sprites or particles. -And it's extremely easy to use :

    -

    var container = new PIXI.SpriteBatch();

    -

    stage.addChild(container);

    -

    for(var i = 0; i < 100; i++) - { - var sprite = new PIXI.Sprite.fromImage("myImage.png"); - container.addChild(sprite); - } -And here you have a hundred sprites that will be renderer at the speed of light

    - -
    - - -
    -

    Constructor

    -
    -

    SpriteBatch

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/SpriteBatch.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/SpriteBatch.js:90 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/SpriteBatch.js:66 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/SpriteSheetLoader.html b/tutorial-4/pixi.js-master/docs/classes/SpriteSheetLoader.html deleted file mode 100755 index d2f8285..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/SpriteSheetLoader.html +++ /dev/null @@ -1,1632 +0,0 @@ - - - - - SpriteSheetLoader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    SpriteSheetLoader Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    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 in 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 a 'texture atlas') as it means sprites 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.fromFrameId() -This loader will load the image file that the Spritesheet points to as well as the data. -When loaded this class will dispatch a 'loaded' event

    - -
    - - -
    -

    Constructor

    -
    -

    SpriteSheetLoader

    - - -
    - (
      - -
    • - - url - -
    • - -
    • - - crossorigin - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - url - String - - - - -
      -

      The url of the sprite sheet JSON file

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    load

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:69 - -

    - - - - - -
    - -
    -

    This will begin loading the JSON file

    - -
    - - - - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:84 - -

    - - - - - -
    - -
    -

    Invoke when all files are loaded (json and texture)

    - -
    - - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    baseUrl

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:38 - -

    - - - - -
    - -
    -

    [read-only] The base url of the bitmap font data

    - -
    - - - - - - -
    - - -
    -

    crossorigin

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:30 - -

    - - - - -
    - -
    -

    Whether the requests should be treated as cross origin

    - -
    - - - - - - -
    - - -
    -

    frames

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:55 - -

    - - - - -
    - -
    -

    The frames of the sprite sheet

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:47 - -

    - - - - -
    - -
    -

    The texture being loaded

    - -
    - - - - - - -
    - - -
    -

    url

    - String - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/loaders/SpriteSheetLoader.js:22 - -

    - - - - -
    - -
    -

    The url of the atlas data

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/Stage.html b/tutorial-4/pixi.js-master/docs/classes/Stage.html deleted file mode 100755 index 27d0d6a..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/Stage.html +++ /dev/null @@ -1,5961 +0,0 @@ - - - - - Stage - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Stage Class

    -
    - - - - - - - -
    - Defined in: src/pixi/display/Stage.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    A Stage represents the root of the display tree. Everything connected to the stage is rendered

    - -
    - - -
    -

    Constructor

    -
    -

    Stage

    - - -
    - (
      - -
    • - - backgroundColor - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - backgroundColor - Number - - - - -
      -

      the background color of the stage, you have to pass this in is in hex format - like: 0xFFFFFF for white

      -

      Creating a stage is a mandatory process when you use Pixi, which is as simple as this : -var stage = new PIXI.Stage(0xFFFFFF); -where the parameter given is the background colour of the stage, in hex -you will use this stage instance to add your sprites to it and therefore to the renderer -Here is how to add a sprite to the stage : -stage.addChild(sprite);

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getMousePosition

    - - - () - - - - - Point - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:126 - -

    - - - - - -
    - -
    -

    This will return the point containing global coordinates of the mouse.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point containing the coordinates of the global InteractionData position.

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setBackgroundColor

    - - -
    - (
      - -
    • - - backgroundColor - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:110 - -

    - - - - - -
    - -
    -

    Sets the background color for the stage

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - backgroundColor - Number - - - - -
      -

      the color of the background, easiest way to pass this in is in hex format - like: 0xFFFFFF for white

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setInteractionDelegate

    - - -
    - (
      - -
    • - - domElement - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:73 - -

    - - - - - -
    - -
    -

    Sets another DOM element which can receive mouse/touch interactions instead of the default Canvas element. -This is useful for when you have other DOM elements on top of the Canvas element.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - domElement - DOMElement - - - - -
      -

      This new domElement which will receive mouse/touch events

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:51 - -

    - - - - -
    - -
    -

    Whether the stage is dirty and needs to have interactions updated

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactionManager

    - InteractionManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/display/Stage.js:43 - -

    - - - - -
    - -
    -

    The interaction manage for this stage, manages all interactive activity on the stage

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Stage.js:35 - -

    - - - - -
    - -
    -

    Whether or not the stage is interactive

    - -
    - - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/Stage.js:25 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/Strip.html b/tutorial-4/pixi.js-master/docs/classes/Strip.html deleted file mode 100755 index d93f5d3..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/Strip.html +++ /dev/null @@ -1,5964 +0,0 @@ - - - - - Strip - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Strip Class

    -
    - - - - - - - -
    - Defined in: src/pixi/extras/Strip.js:5 -
    - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    Strip

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The texture to use

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      the width

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the height

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:482 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:423 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:302 - -

    - - - - - -
    - -
    -

    Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:341 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    renderStripFlat

    - - -
    - (
      - -
    • - - strip - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:293 - -

    - - - - - -
    - -
    -

    Renders a flat strip

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - strip - Strip - - - - -
      -

      The Strip to render

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:43 - -

    - - - - -
    - -
    -

    Whether the strip is dirty or not

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:63 - -

    - - - - -
    - -
    -

    The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:52 - -

    - - - - -
    - -
    -

    if you need a padding, not yet implemented

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/Strip.js:20 - -

    - - - - -
    - -
    -

    The texture of the strip

    - -
    - - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:35 - -

    - - - - -
    - -
    -

    The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/StripShader.html b/tutorial-4/pixi.js-master/docs/classes/StripShader.html deleted file mode 100755 index 612ff3b..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/StripShader.html +++ /dev/null @@ -1,839 +0,0 @@ - - - - - StripShader - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    StripShader Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    StripShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:111 - -

    - - - - - -
    - -
    -

    Destroys the shader.

    - -
    - - - - - - -
    - - -
    -

    init

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:80 - -

    - - - - - -
    - -
    -

    Initialises the shader.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _UID

    - Number - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:32 - -

    - - - - -
    - -
    -

    The fragment shader.

    - -
    - - - - - - -
    - - -
    -

    gl

    - WebGLContext - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:19 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    program

    - Any - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:25 - -

    - - - - -
    - -
    -

    The WebGL program.

    - -
    - - - - - - -
    - - -
    -

    vertexSrc

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/shaders/StripShader.js:50 - -

    - - - - -
    - -
    -

    The vertex shader.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/Text.html b/tutorial-4/pixi.js-master/docs/classes/Text.html deleted file mode 100755 index 8604a47..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/Text.html +++ /dev/null @@ -1,7290 +0,0 @@ - - - - - Text - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Text Class

    -
    - - - -
    - Extends Sprite -
    - - - -
    - Defined in: src/pixi/text/Text.js:6 -
    - - - - - Module: PIXI - - - - -
    - - - -
    -

    A Text Object will create a line or multiple lines of text. To split a line you can use '\n' in your text string, -or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object.

    - -
    - - -
    -

    Constructor

    -
    -

    Text

    - - -
    - (
      - -
    • - - text - -
    • - -
    • - - [style] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:6 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - text - String - - - - -
      -

      The copy that you would like the text to display

      - -
      - - -
    • - -
    • - - [style] - Object - optional - - - - -
      -

      The style parameters

      - -
      - - -
        - -
      • - - [font] - String - optional - - -
        -

        default 'bold 20px Arial' The style and size of the font

        - -
        - - -
      • - -
      • - - [fill='black'] - String | Number - optional - - -
        -

        A canvas fillstyle that will be used on the text e.g 'red', '#00FF00'

        - -
        - - -
      • - -
      • - - [align='left'] - String - optional - - -
        -

        Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text

        - -
        - - -
      • - -
      • - - [stroke] - String | Number - optional - - -
        -

        A canvas fillstyle that will be used on the text stroke e.g 'blue', '#FCFF00'

        - -
        - - -
      • - -
      • - - [strokeThickness=0] - Number - optional - - -
        -

        A number that represents the thickness of the stroke. Default is 0 (no stroke)

        - -
        - - -
      • - -
      • - - [wordWrap=false] - Boolean - optional - - -
        -

        Indicates if word wrap should be used

        - -
        - - -
      • - -
      • - - [wordWrapWidth=100] - Number - optional - - -
        -

        The width at which text will wrap, it needs wordWrap to be set to true

        - -
        - - -
      • - -
      • - - [dropShadow=false] - Boolean - optional - - -
        -

        Set a drop shadow for the text

        - -
        - - -
      • - -
      • - - [dropShadowColor='#000000'] - String - optional - - -
        -

        A fill style to be used on the dropshadow e.g 'red', '#00FF00'

        - -
        - - -
      • - -
      • - - [dropShadowAngle=Math.PI/4] - Number - optional - - -
        -

        Set a angle of the drop shadow

        - -
        - - -
      • - -
      • - - [dropShadowDistance=5] - Number - optional - - -
        -

        Set a distance of the drop shadow

        - -
        - - -
      • - -
      - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/text/Text.js:321 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/text/Text.js:301 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    destroy

    - - -
    - (
      - -
    • - - destroyBaseTexture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:510 - -

    - - - - - -
    - -
    -

    Destroys this text object.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - destroyBaseTexture - Boolean - - - - -
      -

      whether to destroy the base texture as well

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    determineFontProperties

    - - -
    - (
      - -
    • - - fontStyle - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:341 - -

    - - - - - -
    - -
    -

    Calculates the ascent, descent and fontSize of a given fontStyle

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - fontStyle - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    getBounds

    - - -
    - (
      - -
    • - - matrix - -
    • - -
    ) -
    - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/text/Text.js:492 - -

    - - - - - -
    - -
    -

    Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - matrix - Matrix - - - - -
      -

      the transformation matrix of the Text

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:147 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStyle

    - - -
    - (
      - -
    • - - [style] - -
    • - -
    • - - [style.font='bold - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:110 - -

    - - - - - -
    - -
    -

    Set the style of the text

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - [style] - Object - optional - - - - -
      -

      The style parameters

      - -
      - - -
        - -
      • - - [fill='black'] - Object - optional - - -
        -

        A canvas fillstyle that will be used on the text eg 'red', '#00FF00'

        - -
        - - -
      • - -
      • - - [align='left'] - String - optional - - -
        -

        Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text

        - -
        - - -
      • - -
      • - - [stroke='black'] - String - optional - - -
        -

        A canvas fillstyle that will be used on the text stroke eg 'blue', '#FCFF00'

        - -
        - - -
      • - -
      • - - [strokeThickness=0] - Number - optional - - -
        -

        A number that represents the thickness of the stroke. Default is 0 (no stroke)

        - -
        - - -
      • - -
      • - - [wordWrap=false] - Boolean - optional - - -
        -

        Indicates if word wrap should be used

        - -
        - - -
      • - -
      • - - [wordWrapWidth=100] - Number - optional - - -
        -

        The width at which text will wrap

        - -
        - - -
      • - -
      • - - [dropShadow=false] - Boolean - optional - - -
        -

        Set a drop shadow for the text

        - -
        - - -
      • - -
      • - - [dropShadowColor='#000000'] - String - optional - - -
        -

        A fill style to be used on the dropshadow e.g 'red', '#00FF00'

        - -
        - - -
      • - -
      • - - [dropShadowAngle=Math.PI/4] - Number - optional - - -
        -

        Set a angle of the drop shadow

        - -
        - - -
      • - -
      • - - [dropShadowDistance=5] - Number - optional - - -
        -

        Set a distance of the drop shadow

        - -
        - - -
      • - -
      - -
    • - -
    • - - [style.font='bold - String - - - - -
      -

      20pt Arial'] The style and size of the font

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setText

    - - -
    - (
      - -
    • - - text - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:147 - -

    - - - - - -
    - -
    -

    Set the copy for the text object. To split a line you can use '\n'.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - text - String - - - - -
      -

      The copy that you would like the text to display

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setTexture

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:135 - -

    - - - - - -
    - -
    -

    Sets the texture of the sprite

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The PIXI texture that is displayed by the sprite

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    -

    updateText

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:159 - -

    - - - - - -
    - -
    -

    Renders text and updates it when needed

    - -
    - - - - - - -
    - - -
    -

    updateTexture

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:281 - -

    - - - - - -
    - -
    -

    Updates texture size based on canvas size

    - -
    - - - - - - -
    - - -
    -

    wordWrap

    - - -
    - (
      - -
    • - - text - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:444 - -

    - - - - - -
    - -
    -

    Applies newlines to a string to have it optimally fit into the horizontal -bounds set by the Text object's wordWrapWidth property.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - text - String - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _height

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:50 - -

    - - - - -
    - -
    -

    The height of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _width

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:41 - -

    - - - - -
    - -
    -

    The width of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    anchor

    - Point - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:22 - -

    - - - - -
    - -
    -

    The anchor sets the origin point of the texture. -The default is 0,0 this means the texture's origin is the top left -Setting than anchor to 0.5,0.5 means the textures origin is centered -Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner

    - -
    - - - - - - -
    - - -
    -

    blendMode

    - Number - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:68 - -

    - - - - -
    - -
    -

    The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.

    - -
    - - -

    Default: PIXI.blendModes.NORMAL;

    - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    canvas

    - HTMLCanvasElement - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:29 - -

    - - - - -
    - -
    -

    The canvas element that everything is drawn to

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    context

    - HTMLCanvasElement - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:37 - -

    - - - - -
    - -
    -

    The canvas 2d context that everything is drawn with

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/text/Text.js:86 - -

    - - - - -
    - -
    -

    The height of the Text, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:79 - -

    - - - - -
    - -
    -

    Can this object be rendered

    - -
    - - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/text/Text.js:44 - -

    - - - - -
    - -
    -

    The resolution of the canvas.

    - -
    - - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    shader

    - PIXI.AbstractFilter - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:77 - -

    - - - - -
    - -
    -

    The shader that will be used to render the texture to the stage. Set to null to remove a current shader.

    - -
    - - -

    Default: null

    - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:33 - -

    - - - - -
    - -
    -

    The texture that the sprite is using

    - -
    - - - - - - -
    - - -
    -

    tint

    - Number - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:59 - -

    - - - - -
    - -
    -

    The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.

    - -
    - - -

    Default: 0xFFFFFF

    - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/text/Text.js:62 - -

    - - - - -
    - -
    -

    The width of the Text, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/Texture.html b/tutorial-4/pixi.js-master/docs/classes/Texture.html deleted file mode 100755 index c797d9a..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/Texture.html +++ /dev/null @@ -1,2786 +0,0 @@ - - - - - Texture - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    Texture Class

    -
    - -
    - Uses - -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A texture stores the information that represents an image or part of an image. It cannot be added -to the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used.

    - -
    - - -
    -

    Constructor

    -
    -

    Texture

    - - -
    - (
      - -
    • - - baseTexture - -
    • - -
    • - - frame - -
    • - -
    • - - [crop] - -
    • - -
    • - - [trim] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:10 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - baseTexture - BaseTexture - - - - -
      -

      The base texture source to create the texture from

      - -
      - - -
    • - -
    • - - frame - Rectangle - - - - -
      -

      The rectangle frame of the texture to show

      - -
      - - -
    • - -
    • - - [crop] - Rectangle - optional - - - - -
      -

      The area of original texture

      - -
      - - -
    • - -
    • - - [trim] - Rectangle - optional - - - - -
      -

      Trimmed texture rectangle

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _updateUvs

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:200 - -

    - - - - - -
    - -
    -

    Updates the internal WebGL UV cache.

    - -
    - - - - - - -
    - - -
    -

    addTextureToCache

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - id - -
    • - -
    ) -
    - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:284 - -

    - - - - - -
    - -
    -

    Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The Texture to add to the cache.

      - -
      - - -
    • - -
    • - - id - String - - - - -
      -

      The id that the texture will be stored against.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    destroy

    - - -
    - (
      - -
    • - - destroyBase - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:149 - -

    - - - - - -
    - -
    -

    Destroys this texture

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - destroyBase - Boolean - - - - -
      -

      Whether to destroy the base texture as well

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    emit

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Boolean - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:54 - -

    - - - - - -
    - -
    -

    Emit an event to all registered event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The name of the event.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Boolean: - -

    Indication if we've emitted an event.

    - - -
    -
    - - - -
    - - -
    -

    fromCanvas

    - - -
    - (
      - -
    • - - canvas - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:267 - -

    - - - - - -
    - -
    -

    Helper function that creates a new a Texture based on the given canvas element.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - canvas - Canvas - - - - -
      -

      The canvas element source of the texture

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - -

    Texture

    - - -
    -
    - - - -
    - - -
    -

    fromFrame

    - - -
    - (
      - -
    • - - frameId - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:251 - -

    - - - - - -
    - -
    -

    Helper function that returns a Texture objected based on the given frame id. -If the frame id is not in the texture cache an error will be thrown.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frameId - String - - - - -
      -

      The frame id of the texture

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - -

    Texture

    - - -
    -
    - - - -
    - - -
    -

    fromImage

    - - -
    - (
      - -
    • - - imageUrl - -
    • - -
    • - - crossorigin - -
    • - -
    • - - scaleMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:227 - -

    - - - - - -
    - -
    -

    Helper function that creates a Texture object from the given image url. -If the image is not in the texture cache it will be created and loaded.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - imageUrl - String - - - - -
      -

      The image url of the texture

      - -
      - - -
    • - -
    • - - crossorigin - Boolean - - - - -
      -

      Whether requests should be treated as crossorigin

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - -

    Texture

    - - -
    -
    - - - -
    - - -
    -

    listeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - Array - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:41 - -

    - - - - - -
    - -
    -

    Return a list of assigned event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The events that should be listed.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - -

    An array of listener functions

    - - -
    -
    - - - -
    - - -
    -

    mixin

    - - -
    - (
      - -
    • - - object - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:34 - -

    - - - - - -
    - -
    -

    Mixes in the properties of the EventTarget prototype onto another object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - object - Object - - - - -
      -

      The obj to mix into

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    off

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:143 - -

    - - - - - -
    - -
    -

    Remove event listeners.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event we want to remove.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      The listener that we need to find.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    on

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:107 - -

    - - - - - -
    - -
    -

    Register a new EventListener for the given event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Functon - - - - -
      -

      fn Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    onBaseTextureLoaded

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:131 - -

    - - - - - -
    - -
    -

    Called when the base texture is loaded

    - -
    - - - - - - -
    - - -
    -

    once

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    • - - callback - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:124 - -

    - - - - - -
    - -
    -

    Add an EventListener that's only called once.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      Name of the event.

      - -
      - - -
    • - -
    • - - callback - Function - - - - -
      -

      Callback function.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeAllListeners

    - - -
    - (
      - -
    • - - eventName - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - EventTarget: - - - - src/pixi/utils/EventTarget.js:173 - -

    - - - - - -
    - -
    -

    Remove all listeners or only the listeners for the specified event.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - eventName - String - - - - -
      -

      The event you want to remove all listeners for.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeTextureFromCache

    - - -
    - (
      - -
    • - - id - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:297 - -

    - - - - - -
    - -
    -

    Remove a texture from the global PIXI.TextureCache.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - id - String - - - - -
      -

      The id of the texture to be removed

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    The texture that was removed

    - - -
    -
    - - - -
    - - -
    -

    setFrame

    - - -
    - (
      - -
    • - - frame - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:162 - -

    - - - - - -
    - -
    -

    Specifies the region of the baseTexture that this texture will use.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - frame - Rectangle - - - - -
      -

      The frame of the texture to set it to

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _uvs

    - Object - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:83 - -

    - - - - -
    - -
    -

    The WebGL UV data cache.

    - -
    - - - - - - -
    - - -
    -

    baseTexture

    - BaseTexture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:43 - -

    - - - - -
    - -
    -

    The base texture that this texture uses.

    - -
    - - - - - - -
    - - -
    -

    crop

    - Rectangle - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:108 - -

    - - - - -
    - -
    -

    This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, -irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)

    - -
    - - - - - - -
    - - -
    -

    frame

    - Rectangle - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:51 - -

    - - - - -
    - -
    -

    The frame specifies the region of the base texture that this texture uses

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:100 - -

    - - - - -
    - -
    -

    The height of the Texture in pixels.

    - -
    - - - - - - -
    - - -
    -

    noFrame

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:24 - -

    - - - - -
    - -
    -

    Does this Texture have any frame data assigned to it?

    - -
    - - - - - - -
    - - -
    -

    requiresUpdate

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:75 - -

    - - - - -
    - -
    -

    This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)

    - -
    - - - - - - -
    - - -
    -

    trim

    - Rectangle - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:59 - -

    - - - - -
    - -
    -

    The texture trim data.

    - -
    - - - - - - -
    - - -
    -

    valid

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:67 - -

    - - - - -
    - -
    -

    This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/textures/Texture.js:92 - -

    - - - - -
    - -
    -

    The width of the Texture in pixels.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/TilingSprite.html b/tutorial-4/pixi.js-master/docs/classes/TilingSprite.html deleted file mode 100755 index 00426d9..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/TilingSprite.html +++ /dev/null @@ -1,6532 +0,0 @@ - - - - - TilingSprite - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    TilingSprite Class

    -
    - - - -
    - Extends Sprite -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A tiling sprite is a fast way of rendering a tiling image

    - -
    - - -
    -

    Constructor

    -
    -

    TilingSprite

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      the texture of the tiling sprite

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      the width of the tiling sprite

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the height of the tiling sprite

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _destroyCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:689 - -

    - - - - - -
    - -
    -

    Destroys the cached sprite.

    - -
    - - - - - - -
    - - -
    -

    _generateCachedSprite

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:647 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - - - - - -
    - - -
    -

    _renderCachedSprite

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:626 - -

    - - - - - -
    - -
    -

    Internal method.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The render session

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderCanvas

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:194 - -

    - - - - - -
    - -
    -

    Renders the object using the Canvas renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    _renderWebGL

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:137 - -

    - - - - - -
    - -
    -

    Renders the object using the WebGL renderer

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    addChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:90 - -

    - - - - - -
    - -
    -

    Adds a child to the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to add to the container

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    addChildAt

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:102 - -

    - - - - - -
    - -
    -

    Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child to add

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The index to place the child in

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was added.

    - - -
    -
    - - - -
    - - -
    -

    click

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:233 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's left button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    generateTexture

    - - -
    - (
      - -
    • - - resolution - -
    • - -
    • - - scaleMode - -
    • - -
    • - - renderer - -
    • - -
    ) -
    - - - - - Texture - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:559 - -

    - - - - - -
    - -
    -

    Useful function that returns a texture of the displayObject object that can then be used to create sprites -This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - resolution - Number - - - - -
      -

      The resolution of the texture being generated

      - -
      - - -
    • - -
    • - - scaleMode - Number - - - - -
      -

      Should be one of the PIXI.scaleMode consts

      - -
      - - -
    • - -
    • - - renderer - CanvasRenderer | WebGLRenderer - - - - -
      -

      The renderer used to generate the texture.

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Texture: - -

    a texture of the graphics object

    - - -
    -
    - - - -
    - - -
    -

    generateTilingTexture

    - - -
    - (
      - -
    • - - forcePowerOfTwo - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:373 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - forcePowerOfTwo - Boolean - - - - -
      -

      Whether we want to force the texture to be a power of two

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    getBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:280 - -

    - - - - - -
    - -
    -

    Returns the framing rectangle of the sprite as a PIXI.Rectangle object

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    the framing rectangle

    - - -
    -
    - - - -
    - - -
    -

    getChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:193 - -

    - - - - - -
    - -
    -

    Returns the child at the specified index

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child at the given index, if any.

    - - -
    -
    - - - -
    - - -
    -

    getChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - Number - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:158 - -

    - - - - - -
    - -
    -

    Returns the index position of a child DisplayObject instance

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject instance to identify

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Number: - -

    The index position of the child display object to identify

    - - -
    -
    - - - -
    - - -
    -

    getLocalBounds

    - - - () - - - - - Rectangle - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:362 - -

    - - - - - -
    - -
    -

    Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.

    - -
    - - - - -
    -

    Returns:

    - -
    - - - Rectangle: - -

    The rectangular bounding area

    - - -
    -
    - - - -
    - - -
    -

    mousedown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:239 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's left button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseout

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:226 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse leaves the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseover

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:220 - -

    - - - - - -
    - -
    -

    A callback that is used when the users mouse rolls over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:245 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    mouseupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:252 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's left button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    onTextureUpdate

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - -

    Inherited from - - Sprite - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:360 - -

    - - - - - -
    - -
    -

    When the texture is updated, this event will fire to update the scale and frame

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeChild

    - - -
    - (
      - -
    • - - child - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:210 - -

    - - - - - -
    - -
    -

    Removes a child from the container.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The DisplayObject to remove

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildAt

    - - -
    - (
      - -
    • - - index - -
    • - -
    ) -
    - - - - - DisplayObject - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:225 - -

    - - - - - -
    - -
    -

    Removes a child from the specified index position.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - index - Number - - - - -
      -

      The index to get the child from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - DisplayObject: - -

    The child that was removed.

    - - -
    -
    - - - -
    - - -
    -

    removeChildren

    - - -
    - (
      - -
    • - - beginIndex - -
    • - -
    • - - endIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:243 - -

    - - - - - -
    - -
    -

    Removes all children from this container that are within the begin and end indexes.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - beginIndex - Number - - - - -
      -

      The beginning position. Default value is 0.

      - -
      - - -
    • - -
    • - - endIndex - Number - - - - -
      -

      The ending position. Default value is size of the container.

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    removeStageReference

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:404 - -

    - - - - - -
    - -
    -

    Removes the current stage reference from the container and all of its children.

    - -
    - - - - - - -
    - - -
    -

    rightclick

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:260 - -

    - - - - - -
    - -
    -

    A callback that is used when the users clicks on the displayObject with their mouse's right button

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightdown

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:266 - -

    - - - - - -
    - -
    -

    A callback that is used when the user clicks the mouse's right button down over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightup

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:272 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject -for this callback to be fired the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    rightupoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:279 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject -for this callback to be fired, the mouse's right button must have been pressed down over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    setChildIndex

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - index - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:175 - -

    - - - - - -
    - -
    -

    Changes the position of an existing child in the display object container

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - child - DisplayObject - - - - -
      -

      The child DisplayObject instance for which you want to change the index number

      - -
      - - -
    • - -
    • - - index - Number - - - - -
      -

      The resulting index number for the child display object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setStageReference

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObjectContainer.js:386 - -

    - - - - - -
    - -
    -

    Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the stage that the container will have as its current stage reference

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setTexture

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:135 - -

    - - - - - -
    - -
    -

    Sets the texture of the sprite

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      The PIXI texture that is displayed by the sprite

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    swapChildren

    - - -
    - (
      - -
    • - - child - -
    • - -
    • - - child2 - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:133 - -

    - - - - - -
    - -
    -

    Swaps the position of 2 Display Objects within this container.

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    tap

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:290 - -

    - - - - - -
    - -
    -

    A callback that is used when the users taps on the sprite with their finger -basically a touch version of click

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    toGlobal

    - - -
    - (
      - -
    • - - position - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:593 - -

    - - - - - -
    - -
    -

    Calculates the global position of the display object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    toLocal

    - - -
    - (
      - -
    • - - position - -
    • - -
    • - - [from] - -
    • - -
    ) -
    - - - - - Point - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:606 - -

    - - - - - -
    - -
    -

    Calculates the local position of the display object relative to another point

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - position - Point - - - - -
      -

      The world origin to calculate from

      - -
      - - -
    • - -
    • - - [from] - DisplayObject - optional - - - - -
      -

      The DisplayObject to calculate the global position from

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Point: - -

    A point object representing the position of this object

    - - -
    -
    - - - -
    - - -
    -

    touchend

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:303 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases a touch over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchendoutside

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:309 - -

    - - - - - -
    - -
    -

    A callback that is used when the user releases the touch that was over the displayObject -for this callback to be fired, The touch must have started over the sprite

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    touchstart

    - - -
    - (
      - -
    • - - interactionData - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:297 - -

    - - - - - -
    - -
    -

    A callback that is used when the user touches over the displayObject

    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    updateCache

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:583 - -

    - - - - - -
    - -
    -

    Generates and updates the cached sprite for this object.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _bounds

    - Rectangle - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:170 - -

    - - - - -
    - -
    -

    The original, cached bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _cacheAsBitmap

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:197 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cacheIsDirty

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:206 - -

    - - - - -
    - -
    -

    Cached internal flag.

    - -
    - - - - - - -
    - - -
    -

    _cr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:152 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _currentBounds

    - Rectangle - - - - - private - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/display/DisplayObject.js:179 - -

    - - - - -
    - -
    -

    The most up-to-date bounds of the object

    - -
    - - - - - - -
    - - -
    -

    _height

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:50 - -

    - - - - -
    - -
    -

    The height of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    _interactive

    - Boolean - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:114 - -

    - - - - -
    - -
    -

    [read-only] Whether or not the object is interactive, do not toggle directly! use the interactive property

    - -
    - - - - - - -
    - - -
    -

    _sr

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:143 - -

    - - - - -
    - -
    -

    cached sin rotation and cos rotation

    - -
    - - - - - - -
    - - -
    -

    _width

    - Number - - - - - private - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:41 - -

    - - - - -
    - -
    -

    The width of the sprite (this is initially set by the texture)

    - -
    - - - - - - -
    - - -
    -

    alpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:46 - -

    - - - - -
    - -
    -

    The opacity of the object.

    - -
    - - - - - - -
    - - -
    -

    anchor

    - Point - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:22 - -

    - - - - -
    - -
    -

    The anchor sets the origin point of the texture. -The default is 0,0 this means the texture's origin is the top left -Setting than anchor to 0.5,0.5 means the textures origin is centered -Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner

    - -
    - - - - - - -
    - - -
    -

    blendMode

    - Number - - - - - - - - - -
    - -

    Inherited from - - Sprite - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:77 - -

    - - - - -
    - -
    -

    The blend mode to be applied to the sprite

    - -
    - - -

    Default: PIXI.blendModes.NORMAL;

    - - - - - -
    - - -
    -

    buttonMode

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:71 - -

    - - - - -
    - -
    -

    This is used to indicate if the displayObject should display a mouse hand cursor on rollover

    - -
    - - - - - - -
    - - -
    -

    cacheAsBitmap

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:417 - -

    - - - - -
    - -
    -

    Set if this display object is cached as a bitmap. -This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. -To remove simply set this property to 'null'

    - -
    - - - - - - -
    - - -
    -

    children

    - Array - - - - - - - - - -
    - - -

    Inherited from - DisplayObjectContainer: - - - - src/pixi/display/DisplayObjectContainer.js:17 - -

    - - - - -
    - -
    -

    [read-only] The array of children of this container.

    - -
    - - - - - - -
    - - -
    -

    defaultCursor

    - String - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:124 - -

    - - - - -
    - -
    -

    This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true

    - -
    - - - - - - -
    - - -
    -

    filterArea

    - Rectangle - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:161 - -

    - - - - -
    - -
    -

    The area the filter is applied to like the hitArea this is used as more of an optimisation -rather than figuring out the dimensions of the displayObject each frame you can set this rectangle

    - -
    - - - - - - -
    - - -
    -

    filters

    - Array An array of filters - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:381 - -

    - - - - -
    - -
    -

    Sets the filters for the displayObject.

    -
      -
    • IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. -To remove filters simply set this property to 'null'
    • -
    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:111 - -

    - - - - -
    - -
    -

    The height of the TilingSprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:27 - -

    - - - - -
    - -
    -

    The height of the tiling sprite

    - -
    - - - - - - -
    - - -
    -

    hitArea

    - Rectangle | Circle | Ellipse | Polygon - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:62 - -

    - - - - -
    - -
    -

    This is the defined area that will pick up mouse / touch events. It is null by default. -Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)

    - -
    - - - - - - -
    - - -
    -

    interactive

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:320 - -

    - - - - -
    - -
    -

    Indicates if the sprite will have touch and mouse interactivity. It is false by default

    - -
    - - -

    Default: false

    - - - - - -
    - - -
    -

    mask

    - Graphics - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:361 - -

    - - - - -
    - -
    -

    Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. -In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. -To remove a mask, set this property to null.

    - -
    - - - - - - -
    - - -
    -

    parent

    - DisplayObjectContainer - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:87 - -

    - - - - -
    - -
    -

    [read-only] The display object container that contains this display object.

    - -
    - - - - - - -
    - - -
    -

    pivot

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:30 - -

    - - - - -
    - -
    -

    The pivot point of the displayObject that it rotates around

    - -
    - - - - - - -
    - - -
    -

    position

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:14 - -

    - - - - -
    - -
    -

    The coordinate of the object relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    renderable

    - Boolean - - - - - - - - - -
    - -

    Inherited from - - DisplayObject - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:59 - -

    - - - - -
    - -
    -

    Whether this sprite is renderable or not

    - -
    - - -

    Default: true

    - - - - - -
    - - -
    -

    rotation

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:38 - -

    - - - - -
    - -
    -

    The rotation of the object in radians.

    - -
    - - - - - - -
    - - -
    -

    scale

    - Point - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:22 - -

    - - - - -
    - -
    -

    The scale factor of the object.

    - -
    - - - - - - -
    - - -
    -

    shader

    - PIXI.AbstractFilter - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:77 - -

    - - - - -
    - -
    -

    The shader that will be used to render the texture to the stage. Set to null to remove a current shader.

    - -
    - - -

    Default: null

    - - - - - -
    - - -
    -

    stage

    - Stage - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:96 - -

    - - - - -
    - -
    -

    [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.

    - -
    - - - - - - -
    - - -
    -

    texture

    - Texture - - - - - - - - - -
    - - -

    Inherited from - Sprite: - - - - src/pixi/display/Sprite.js:33 - -

    - - - - -
    - -
    -

    The texture that the sprite is using

    - -
    - - - - - - -
    - - -
    -

    tilePosition

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:51 - -

    - - - - -
    - -
    -

    The offset position of the image that is being tiled

    - -
    - - - - - - -
    - - -
    -

    tileScale

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:35 - -

    - - - - -
    - -
    -

    The scaling of the image that is being tiled

    - -
    - - - - - - -
    - - -
    -

    tileScaleOffset

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:43 - -

    - - - - -
    - -
    -

    A point that represents the scale of the texture object

    - -
    - - - - - - -
    - - -
    -

    tint

    - Number - - - - - - - - - -
    - -

    Inherited from - - Sprite - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:68 - -

    - - - - -
    - -
    -

    The tint applied to the sprite. This is a hex value

    - -
    - - -

    Default: 0xFFFFFF

    - - - - - -
    - - -
    -

    visible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:54 - -

    - - - - -
    - -
    -

    The visibility of the object.

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - -

    Inherited from - - DisplayObjectContainer - - - but overwritten in - - - - src/pixi/extras/TilingSprite.js:19 - -

    - - - - -
    - -
    -

    The with of the tiling sprite

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/extras/TilingSprite.js:95 - -

    - - - - -
    - -
    -

    The width of the sprite, setting this will actually modify the scale to achieve the value set

    - -
    - - - - - - -
    - - -
    -

    worldAlpha

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:105 - -

    - - - - -
    - -
    -

    [read-only] The multiplied alpha of the displayObject

    - -
    - - - - - - -
    - - -
    -

    worldTransform

    - Matrix - - - - - private - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:133 - -

    - - - - -
    - -
    -

    [read-only] Current transform of the object based on world (parent) factors

    - -
    - - - - - - -
    - - -
    -

    worldVisible

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:340 - -

    - - - - -
    - -
    -

    [read-only] Indicates if the sprite is globally visible.

    - -
    - - - - - - -
    - - -
    -

    x

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:736 - -

    - - - - -
    - -
    -

    The position of the displayObject on the x axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    -

    y

    - Number - - - - - - - - - -
    - - -

    Inherited from - DisplayObject: - - - - src/pixi/display/DisplayObject.js:751 - -

    - - - - -
    - -
    -

    The position of the displayObject on the y axis relative to the local coordinates of the parent.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/TiltShiftFilter.html b/tutorial-4/pixi.js-master/docs/classes/TiltShiftFilter.html deleted file mode 100755 index f8c853f..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/TiltShiftFilter.html +++ /dev/null @@ -1,614 +0,0 @@ - - - - - TiltShiftFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    TiltShiftFilter Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A TiltShift Filter. Manages the pass of both a TiltShiftXFilter and TiltShiftYFilter.

    - -
    - - -
    -

    Constructor

    -
    -

    TiltShiftFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - - - -
    -

    Properties

    - - -
    - - - - - -
    - - - - -
    -

    Properties

    - - -
    -

    blur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftFilter.js:24 - -

    - - - - -
    - -
    -

    The strength of the blur.

    - -
    - - - - - - -
    - - -
    -

    end

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftFilter.js:69 - -

    - - - - -
    - -
    -

    The Y value to end the effect at.

    - -
    - - - - - - -
    - - -
    -

    gradientBlur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftFilter.js:39 - -

    - - - - -
    - -
    -

    The strength of the gradient blur.

    - -
    - - - - - - -
    - - -
    -

    start

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftFilter.js:54 - -

    - - - - -
    - -
    -

    The Y value to start the effect at.

    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/TiltShiftXFilter.html b/tutorial-4/pixi.js-master/docs/classes/TiltShiftXFilter.html deleted file mode 100755 index 56c306a..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/TiltShiftXFilter.html +++ /dev/null @@ -1,1053 +0,0 @@ - - - - - TiltShiftXFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    TiltShiftXFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A TiltShiftXFilter.

    - -
    - - -
    -

    Constructor

    -
    -

    TiltShiftXFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    -

    updateDelta

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:138 - -

    - - - - - -
    - -
    -

    Updates the filter delta values.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:72 - -

    - - - - -
    - -
    -

    The strength of the blur.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    end

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:121 - -

    - - - - -
    - -
    -

    The X value to end the effect at.

    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    gradientBlur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:88 - -

    - - - - -
    - -
    -

    The strength of the gradient blur.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    start

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftXFilter.js:104 - -

    - - - - -
    - -
    -

    The X value to start the effect at.

    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/TiltShiftYFilter.html b/tutorial-4/pixi.js-master/docs/classes/TiltShiftYFilter.html deleted file mode 100755 index cd66a7f..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/TiltShiftYFilter.html +++ /dev/null @@ -1,1053 +0,0 @@ - - - - - TiltShiftYFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    TiltShiftYFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A TiltShiftYFilter.

    - -
    - - -
    -

    Constructor

    -
    -

    TiltShiftYFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:6 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    -

    updateDelta

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:138 - -

    - - - - - -
    - -
    -

    Updates the filter delta values.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:72 - -

    - - - - -
    - -
    -

    The strength of the blur.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    end

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:121 - -

    - - - - -
    - -
    -

    The Y value to end the effect at.

    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    gradientBlur

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:88 - -

    - - - - -
    - -
    -

    The strength of the gradient blur.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    start

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TiltShiftYFilter.js:104 - -

    - - - - -
    - -
    -

    The Y value to start the effect at.

    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/TwistFilter.html b/tutorial-4/pixi.js-master/docs/classes/TwistFilter.html deleted file mode 100755 index 482d5a9..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/TwistFilter.html +++ /dev/null @@ -1,939 +0,0 @@ - - - - - TwistFilter - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    TwistFilter Class

    -
    - - - -
    - Extends AbstractFilter -
    - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This filter applies a twist effect making display objects appear twisted in the given direction.

    - -
    - - -
    -

    Constructor

    -
    -

    TwistFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TwistFilter.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    syncUniforms

    - - - () - - - - - - - - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:60 - -

    - - - - - -
    - -
    -

    Syncs the uniforms between the class object and the shaders.

    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    angle

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TwistFilter.js:88 - -

    - - - - -
    - -
    -

    This angle of the twist.

    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:31 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    fragmentSrc

    - Array - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:50 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    offset

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TwistFilter.js:56 - -

    - - - - -
    - -
    -

    This point describes the the offset of the twist.

    - -
    - - - - - - -
    - - -
    -

    padding

    - Number - - - - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:37 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    passes

    - Array an array of filter objects - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:15 - -

    - - - - -
    - -
    -

    An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. -For example the blur filter has two passes blurX and blurY.

    - -
    - - - - - - -
    - - -
    -

    radius

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/filters/TwistFilter.js:72 - -

    - - - - -
    - -
    -

    This radius of the twist.

    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array an array of shaders - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    uniforms

    - Object - - - - - private - - - - - - -
    - - -

    Inherited from - AbstractFilter: - - - - src/pixi/filters/AbstractFilter.js:43 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/WebGLBlendModeManager.html b/tutorial-4/pixi.js-master/docs/classes/WebGLBlendModeManager.html deleted file mode 100755 index f69e5db..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/WebGLBlendModeManager.html +++ /dev/null @@ -1,760 +0,0 @@ - - - - - WebGLBlendModeManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLBlendModeManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLBlendModeManager

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:5 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:50 - -

    - - - - - -
    - -
    -

    Destroys this object.

    - -
    - - - - - - -
    - - -
    -

    setBlendMode

    - - -
    - (
      - -
    • - - blendMode - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:32 - -

    - - - - - -
    - -
    -

    Sets-up the given blendMode from WebGL's point of view.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - blendMode - Number - - - - -
      -

      the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:21 - -

    - - - - - -
    - -
    -

    Sets the WebGL Context.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    currentBlendMode

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/WebGLFastSpriteBatch.html b/tutorial-4/pixi.js-master/docs/classes/WebGLFastSpriteBatch.html deleted file mode 100755 index fcc1a27..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/WebGLFastSpriteBatch.html +++ /dev/null @@ -1,1831 +0,0 @@ - - - - - WebGLFastSpriteBatch - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLFastSpriteBatch Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLFastSpriteBatch

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:11 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    begin

    - - -
    - (
      - -
    • - - spriteBatch - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:154 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - spriteBatch - WebGLSpriteBatch - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    end

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:169 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    flush

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:349 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    render

    - - -
    - (
      - -
    • - - spriteBatch - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:177 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - - -
    - - - - - -
    - - -
    -

    renderSprite

    - - -
    - (
      - -
    • - - sprite - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:208 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - sprite - Sprite - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:130 - -

    - - - - - -
    - -
    -

    Sets the WebGL Context.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    start

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:397 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    stop

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:389 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    currentBaseTexture

    - BaseTexture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:95 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    currentBatchSize

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:89 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    currentBlendMode

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:101 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    drawing

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:83 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    indexBuffer

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:61 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    indices

    - Uint16Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:48 - -

    - - - - -
    - -
    -

    Index data

    - -
    - - - - - - -
    - - -
    -

    lastIndexCount

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:67 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    matrix

    - Matrix - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:119 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    maxSize

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:23 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    renderSession

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:107 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    shader

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:113 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    size

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:29 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    vertexBuffer

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:55 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    vertices

    - Float32Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:41 - -

    - - - - -
    - -
    -

    Vertex data

    - -
    - - - - - - -
    - - -
    -

    vertSize

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:17 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/WebGLFilterManager.html b/tutorial-4/pixi.js-master/docs/classes/WebGLFilterManager.html deleted file mode 100755 index 004f51f..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/WebGLFilterManager.html +++ /dev/null @@ -1,1229 +0,0 @@ - - - - - WebGLFilterManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLFilterManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLFilterManager

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    applyFilterPass

    - - -
    - (
      - -
    • - - filter - -
    • - -
    • - - filterArea - -
    • - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:315 - -

    - - - - - -
    - -
    -

    Applies the filter to the specified area.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - filter - AbstractFilter - - - - -
      -

      the filter that needs to be applied

      - -
      - - -
    • - -
    • - - filterArea - Texture - - - - -
      -

      TODO - might need an update

      - -
      - - -
    • - -
    • - - width - Number - - - - -
      -

      the horizontal range of the filter

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the vertical range of the filter

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    begin

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    • - - buffer - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:46 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - RenderSession - - - - -
      - -
      - - -
    • - -
    • - - buffer - ArrayBuffer - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:424 - -

    - - - - - -
    - -
    -

    Destroys the filter and removes it from the filter stack.

    - -
    - - - - - - -
    - - -
    -

    initShaderBuffers

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:376 - -

    - - - - - -
    - -
    -

    Initialises the shader buffers.

    - -
    - - - - - - -
    - - -
    -

    popFilter

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:138 - -

    - - - - - -
    - -
    -

    Removes the last filter from the filter stack and doesn't return it.

    - -
    - - - - - - -
    - - -
    -

    pushFilter

    - - -
    - (
      - -
    • - - filterBlock - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:62 - -

    - - - - - -
    - -
    -

    Applies the filter and adds it to the current filter stack.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - filterBlock - Object - - - - -
      -

      the filter that will be pushed to the current filter stack

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:32 - -

    - - - - - -
    - -
    -

    Initialises the context and the properties.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    filterStack

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:11 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    offsetX

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:17 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    offsetY

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js:23 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/WebGLGraphics.html b/tutorial-4/pixi.js-master/docs/classes/WebGLGraphics.html deleted file mode 100755 index f33138b..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/WebGLGraphics.html +++ /dev/null @@ -1,1683 +0,0 @@ - - - - - WebGLGraphics - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLGraphics Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    A set of functions used by the webGL renderer to draw the primitive graphics data

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    buildCircle

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:421 - -

    - - - - - -
    - -
    -

    Builds a circle to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object to draw

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    buildComplexPoly

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:716 - -

    - - - - - -
    - -
    -

    Builds a complex polygon to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object containing all the necessary properties

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    buildLine

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:504 - -

    - - - - - -
    - -
    -

    Builds a line to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object containing all the necessary properties

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    buildPoly

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:778 - -

    - - - - - -
    - -
    -

    Builds a polygon to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object containing all the necessary properties

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    buildRectangle

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:233 - -

    - - - - - -
    - -
    -

    Builds a rectangle to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object containing all the necessary properties

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    buildRoundedRectangle

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - webGLData - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:301 - -

    - - - - - -
    - -
    -

    Builds a rounded rectangle to draw

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object containing all the necessary properties

      - -
      - - -
    • - -
    • - - webGLData - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    quadraticBezierCurve

    - - -
    - (
      - -
    • - - fromX - -
    • - -
    • - - fromY - -
    • - -
    • - - cpX - -
    • - -
    • - - cpY - -
    • - -
    • - - toX - -
    • - -
    • - - toY - -
    • - -
    ) -
    - - - - - Array - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:369 - -

    - - - - - -
    - -
    -

    Calculate the points for a quadratic bezier curve. (helper function..) -Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - fromX - Number - - - - -
      -

      Origin point x

      - -
      - - -
    • - -
    • - - fromY - Number - - - - -
      -

      Origin point x

      - -
      - - -
    • - -
    • - - cpX - Number - - - - -
      -

      Control point x

      - -
      - - -
    • - -
    • - - cpY - Number - - - - -
      -

      Control point y

      - -
      - - -
    • - -
    • - - toX - Number - - - - -
      -

      Destination point x

      - -
      - - -
    • - -
    • - - toY - Number - - - - -
      -

      Destination point y

      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Array: - - -
    -
    - - - -
    - - -
    -

    renderGraphics

    - - -
    - (
      - -
    • - - graphics - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:16 - -

    - - - - - -
    - -
    -

    Renders the graphics object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphics - Graphics - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    switchMode

    - - -
    - (
      - -
    • - - webGL - -
    • - -
    • - - type - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:199 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - webGL - WebGLContext - - - - -
      - -
      - - -
    • - -
    • - - type - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    updateGraphics

    - - -
    - (
      - -
    • - - graphicsData - -
    • - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:84 - -

    - - - - - -
    - -
    -

    Updates the graphics object

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphicsData - Graphics - - - - -
      -

      The graphics object to update

      - -
      - - -
    • - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/WebGLGraphicsData.html b/tutorial-4/pixi.js-master/docs/classes/WebGLGraphicsData.html deleted file mode 100755 index d099949..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/WebGLGraphicsData.html +++ /dev/null @@ -1,470 +0,0 @@ - - - - - WebGLGraphicsData - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLGraphicsData Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    reset

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:850 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    upload

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js:860 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/WebGLMaskManager.html b/tutorial-4/pixi.js-master/docs/classes/WebGLMaskManager.html deleted file mode 100755 index 0642f8b..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/WebGLMaskManager.html +++ /dev/null @@ -1,798 +0,0 @@ - - - - - WebGLMaskManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLMaskManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLMaskManager

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js:61 - -

    - - - - - -
    - -
    -

    Destroys the mask stack.

    - -
    - - - - - - -
    - - -
    -

    popMask

    - - -
    - (
      - -
    • - - maskData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js:48 - -

    - - - - - -
    - -
    -

    Removes the last filter from the filter stack and doesn't return it.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - maskData - Array - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      -

      an object containing all the useful parameters

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    pushMask

    - - -
    - (
      - -
    • - - maskData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js:27 - -

    - - - - - -
    - -
    -

    Applies the Mask and adds it to the current filter stack.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - maskData - Array - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js:16 - -

    - - - - - -
    - -
    -

    Sets the drawing context to the one given in parameter.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/WebGLRenderer.html b/tutorial-4/pixi.js-master/docs/classes/WebGLRenderer.html deleted file mode 100755 index 15691a5..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/WebGLRenderer.html +++ /dev/null @@ -1,2526 +0,0 @@ - - - - - WebGLRenderer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLRenderer Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer -should be used for browsers that support webGL. This Render works by automatically managing webGLBatchs. -So no need for Sprite Batches or Sprite Clouds. -Don't forget to add the view to your DOM or you will not see anything :)

    - -
    - - -
    -

    Constructor

    -
    -

    WebGLRenderer

    - - -
    - (
      - -
    • - - [width=0] - -
    • - -
    • - - [height=0] - -
    • - -
    • - - [options] - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:8 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - [width=0] - Number - optional - - - - -
      -

      the width of the canvas view

      - -
      - - -
    • - -
    • - - [height=0] - Number - optional - - - - -
      -

      the height of the canvas view

      - -
      - - -
    • - -
    • - - [options] - Object - optional - - - - -
      -

      The optional renderer parameters

      - -
      - - -
        - -
      • - - [view] - HTMLCanvasElement - optional - - -
        -

        the canvas to use as a view, optional

        - -
        - - -
      • - -
      • - - [transparent=false] - Boolean - optional - - -
        -

        If the render view is transparent, default false

        - -
        - - -
      • - -
      • - - [autoResize=false] - Boolean - optional - - -
        -

        If the render view is automatically resized, default false

        - -
        - - -
      • - -
      • - - [antialias=false] - Boolean - optional - - -
        -

        sets antialias (only applicable in chrome at the moment)

        - -
        - - -
      • - -
      • - - [preserveDrawingBuffer=false] - Boolean - optional - - -
        -

        enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context

        - -
        - - -
      • - -
      • - - [resolution=1] - Number - optional - - -
        -

        the resolution of the renderer retina would be 2

        - -
        - - -
      • - -
      - -
    • - -
    -
    - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:477 - -

    - - - - - -
    - -
    -

    Removes everything from the renderer (event listeners, spritebatch, etc...)

    - -
    - - - - - - -
    - - -
    -

    handleContextLost

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:443 - -

    - - - - - -
    - -
    -

    Handles a lost webgl context

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    handleContextRestored

    - - -
    - (
      - -
    • - - event - -
    • - -
    ) -
    - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:456 - -

    - - - - - -
    - -
    -

    Handles a restored webgl context

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - event - Event - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    initContext

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:238 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    mapBlendModes

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:508 - -

    - - - - - -
    - -
    -

    Maps Pixi blend modes to WebGL blend modes.

    - -
    - - - - - - -
    - - -
    -

    render

    - - -
    - (
      - -
    • - - stage - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:276 - -

    - - - - - -
    - -
    -

    Renders the stage to its webGL view

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - stage - Stage - - - - -
      -

      the Stage element to be rendered

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderDisplayObject

    - - -
    - (
      - -
    • - - displayObject - -
    • - -
    • - - projection - -
    • - -
    • - - buffer - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:344 - -

    - - - - - -
    - -
    -

    Renders a Display Object.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - displayObject - DisplayObject - - - - -
      -

      The DisplayObject to render

      - -
      - - -
    • - -
    • - - projection - Point - - - - -
      -

      The projection

      - -
      - - -
    • - -
    • - - buffer - Array - - - - -
      -

      a standard WebGL buffer

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    resize

    - - -
    - (
      - -
    • - - width - -
    • - -
    • - - height - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:378 - -

    - - - - - -
    - -
    -

    Resizes the webGL view to the specified width and height.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - width - Number - - - - -
      -

      the new width of the webGL view

      - -
      - - -
    • - -
    • - - height - Number - - - - -
      -

      the new height of the webGL view

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    updateTexture

    - - -
    - (
      - -
    • - - texture - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:404 - -

    - - - - - -
    - -
    -

    Updates and Creates a WebGL texture for the renderers context.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      -

      the texture to update

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    _contextOptions

    - Object - - - - - private - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:142 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    autoResize

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:71 - -

    - - - - -
    - -
    -

    Whether the render view should be resized automatically

    - -
    - - - - - - -
    - - -
    -

    blendModeManager

    - WebGLBlendModeManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:204 - -

    - - - - -
    - -
    -

    Manages the blendModes

    - -
    - - - - - - -
    - - -
    -

    clearBeforeRender

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:87 - -

    - - - - -
    - -
    -

    This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true: -If the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0). -If the Stage is transparent, Pixi will clear to the target Stage's background color. -Disable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set.

    - -
    - - - - - - -
    - - -
    -

    contextLostBound

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:127 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    contextRestoredBound

    - Function - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:133 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    filterManager

    - WebGLFilterManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:190 - -

    - - - - -
    - -
    -

    Manages the filters

    - -
    - - - - - - -
    - - -
    -

    height

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:108 - -

    - - - - -
    - -
    -

    The height of the canvas view

    - -
    - - -

    Default: 600

    - - - - - -
    - - -
    -

    maskManager

    - WebGLMaskManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:183 - -

    - - - - -
    - -
    -

    Manages the masks using the stencil buffer

    - -
    - - - - - - -
    - - -
    -

    offset

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:161 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    preserveDrawingBuffer

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:79 - -

    - - - - -
    - -
    -

    The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering.

    - -
    - - - - - - -
    - - -
    -

    projection

    - Point - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:155 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    renderSession

    - Object - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:211 - -

    - - - - -
    - -
    -

    TODO remove

    - -
    - - - - - - -
    - - -
    -

    resolution

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:52 - -

    - - - - -
    - -
    -

    The resolution of the renderer

    - -
    - - -

    Default: 1

    - - - - - -
    - - -
    -

    shaderManager

    - WebGLShaderManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:169 - -

    - - - - -
    - -
    -

    Deals with managing the shader programs and their attribs

    - -
    - - - - - - -
    - - -
    -

    spriteBatch

    - WebGLSpriteBatch - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:176 - -

    - - - - -
    - -
    -

    Manages the rendering of sprites

    - -
    - - - - - - -
    - - -
    -

    stencilManager

    - WebGLStencilManager - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:197 - -

    - - - - -
    - -
    -

    Manages the stencil buffer

    - -
    - - - - - - -
    - - -
    -

    transparent

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:63 - -

    - - - - -
    - -
    -

    Whether the render view is transparent

    - -
    - - - - - - -
    - - -
    -

    type

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:46 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    view

    - HTMLCanvasElement - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:117 - -

    - - - - -
    - -
    -

    The canvas element that everything is drawn to

    - -
    - - - - - - -
    - - -
    -

    width

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/WebGLRenderer.js:99 - -

    - - - - -
    - -
    -

    The width of the canvas view

    - -
    - - -

    Default: 800

    - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/WebGLShaderManager.html b/tutorial-4/pixi.js-master/docs/classes/WebGLShaderManager.html deleted file mode 100755 index 376b9d7..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/WebGLShaderManager.html +++ /dev/null @@ -1,976 +0,0 @@ - - - - - WebGLShaderManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLShaderManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLShaderManager

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:135 - -

    - - - - - -
    - -
    -

    Destroys this object.

    - -
    - - - - - - -
    - - -
    -

    setAttribs

    - - -
    - (
      - -
    • - - attribs - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:72 - -

    - - - - - -
    - -
    -

    Takes the attributes given in parameters.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - attribs - Array - - - - -
      -

      attribs

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:45 - -

    - - - - - -
    - -
    -

    Initialises the context and the properties.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setShader

    - - -
    - (
      - -
    • - - shader - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:115 - -

    - - - - - -
    - -
    -

    Sets the current shader.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - shader - Any - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    attribState

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:18 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    maxAttibs

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:12 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    stack

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:35 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    tempAttribState

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js:24 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/WebGLSpriteBatch.html b/tutorial-4/pixi.js-master/docs/classes/WebGLSpriteBatch.html deleted file mode 100755 index b4101f2..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/WebGLSpriteBatch.html +++ /dev/null @@ -1,2619 +0,0 @@ - - - - - WebGLSpriteBatch - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLSpriteBatch Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLSpriteBatch

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:11 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - -
    -

    Properties

    - - -
    - - - - - -
    - - -
    -

    Methods

    - - -
    -

    _CompileShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    • - - shaderSrc - -
    • - -
    • - - shaderType - -
    • - -
    ) -
    - - - - - Any - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:38 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    • - - shaderSrc - Array - - - - -
      - -
      - - -
    • - -
    • - - shaderType - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Any: - - -
    -
    - - - -
    - - -
    -

    begin

    - - -
    - (
      - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:164 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - renderSession - Object - - - - -
      -

      The RenderSession object

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    CompileFragmentShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    • - - shaderSrc - -
    • - -
    ) -
    - - - - - Any - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:26 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    • - - shaderSrc - Array - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Any: - - -
    -
    - - - -
    - - -
    -

    compileProgram

    - - -
    - (
      - -
    • - - gl - -
    • - -
    • - - vertexSrc - -
    • - -
    • - - fragmentSrc - -
    • - -
    ) -
    - - - - - Any - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:63 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    • - - vertexSrc - Array - - - - -
      - -
      - - -
    • - -
    • - - fragmentSrc - Array - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Any: - - -
    -
    - - - -
    - - -
    -

    CompileVertexShader

    - - -
    - (
      - -
    • - - gl - -
    • - -
    • - - shaderSrc - -
    • - -
    ) -
    - - - - - Any - - - - - - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:14 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    • - - shaderSrc - Array - - - - -
      - -
      - - -
    • - -
    -
    - - - -
    -

    Returns:

    - -
    - - - Any: - - -
    -
    - - - -
    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:589 - -

    - - - - - -
    - -
    -

    Destroys the SpriteBatch.

    - -
    - - - - - - -
    - - -
    -

    end

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:176 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    flush

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:418 - -

    - - - - - -
    - -
    -

    Renders the content and empties the current batch.

    - -
    - - - - - - -
    - - -
    -

    initDefaultShaders

    - - - () - - - - - - - - private - - - - - - static - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    render

    - - -
    - (
      - -
    • - - sprite - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:184 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - sprite - Sprite - - - - -
      -

      the sprite to render when using this spritebatch

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderBatch

    - - -
    - (
      - -
    • - - texture - -
    • - -
    • - - size - -
    • - -
    • - - startIndex - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:542 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - texture - Texture - - - - -
      - -
      - - -
    • - -
    • - - size - Number - - - - -
      - -
      - - -
    • - -
    • - - startIndex - Number - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    renderTilingSprite

    - - -
    - (
      - -
    • - - sprite - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:297 - -

    - - - - - -
    - -
    -

    Renders a TilingSprite using the spriteBatch.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - sprite - TilingSprite - - - - -
      -

      the tilingSprite to render

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:132 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    start

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:581 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    stop

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:572 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - -
    -

    Properties

    - - -
    -

    blendModes

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:99 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    currentBaseTexture

    - BaseTexture - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:81 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    currentBatchSize

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:75 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    defaultShader

    - AbstractFilter - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:117 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    dirty

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:87 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    drawing

    - Boolean - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:69 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    indices

    - Uint16Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:45 - -

    - - - - -
    - -
    -

    Holds the indices

    - -
    - - - - - - -
    - - -
    -

    lastIndexCount

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:53 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    shaders

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:105 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    size

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:25 - -

    - - - - -
    - -
    -

    The number of images in the SpriteBatch before it flushes

    - -
    - - - - - - -
    - - -
    -

    sprites

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:111 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    textures

    - Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:93 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    -

    vertices

    - Float32Array - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:37 - -

    - - - - -
    - -
    -

    Holds the vertices

    - -
    - - - - - - -
    - - -
    -

    vertSize

    - Number - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:19 - -

    - - - - -
    - -
    - -
    - - - - - - -
    - - -
    - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/WebGLStencilManager.html b/tutorial-4/pixi.js-master/docs/classes/WebGLStencilManager.html deleted file mode 100755 index 2dac12b..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/WebGLStencilManager.html +++ /dev/null @@ -1,975 +0,0 @@ - - - - - WebGLStencilManager - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    WebGLStencilManager Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    - -
    - - -
    -

    Constructor

    -
    -

    WebGLStencilManager

    - - - () - - - - - - - - private - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:5 - -

    - - - - - -
    - -
    - -
    - - - - - - -
    - -
    - - -
    - - -
    -
    -

    Item Index

    - - -
    -

    Methods

    - - -
    - - - - - - - -
    - - -
    -

    Methods

    - - -
    -

    bindGraphics

    - - -
    - (
      - -
    • - - graphics - -
    • - -
    • - - webGLData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:120 - -

    - - - - - -
    - -
    -

    TODO this does not belong here!

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphics - Graphics - - - - -
      - -
      - - -
    • - -
    • - - webGLData - Array - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    destroy

    - - - () - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:285 - -

    - - - - - -
    - -
    -

    Destroys the mask stack.

    - -
    - - - - - - -
    - - -
    -

    popStencil

    - - -
    - (
      - -
    • - - graphics - -
    • - -
    • - - webGLData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:190 - -

    - - - - - -
    - -
    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphics - Graphics - - - - -
      - -
      - - -
    • - -
    • - - webGLData - Array - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    pushMask

    - - -
    - (
      - -
    • - - graphics - -
    • - -
    • - - webGLData - -
    • - -
    • - - renderSession - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:28 - -

    - - - - - -
    - -
    -

    Applies the Mask and adds it to the current filter stack.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - graphics - Graphics - - - - -
      - -
      - - -
    • - -
    • - - webGLData - Array - - - - -
      - -
      - - -
    • - -
    • - - renderSession - Object - - - - -
      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    -

    setContext

    - - -
    - (
      - -
    • - - gl - -
    • - -
    ) -
    - - - - - - - - - - - - - - - - -
    - - - -

    - - Defined in - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js:17 - -

    - - - - - -
    - -
    -

    Sets the drawing context to the one given in parameter.

    - -
    - - -
    -

    Parameters:

    - -
      - -
    • - - gl - WebGLContext - - - - -
      -

      the current WebGL drawing context

      - -
      - - -
    • - -
    -
    - - - - - -
    - - -
    - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/autoDetectRecommendedRenderer.html b/tutorial-4/pixi.js-master/docs/classes/autoDetectRecommendedRenderer.html deleted file mode 100755 index c222af0..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/autoDetectRecommendedRenderer.html +++ /dev/null @@ -1,336 +0,0 @@ - - - - - autoDetectRecommendedRenderer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    autoDetectRecommendedRenderer Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This helper function will automatically detect which renderer you should be using. -This function is very similar to the autoDetectRenderer function except that is will return a canvas renderer for android. -Even thought both android chrome supports webGL the canvas implementation perform better at the time of writing. -This function will likely change and update as webGL performance improves on these devices.

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - - - - - - - -
    - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/autoDetectRenderer.html b/tutorial-4/pixi.js-master/docs/classes/autoDetectRenderer.html deleted file mode 100755 index bbf799f..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/autoDetectRenderer.html +++ /dev/null @@ -1,335 +0,0 @@ - - - - - autoDetectRenderer - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    autoDetectRenderer Class

    -
    - - - - - - - - - - - Module: PIXI - - - - -
    - - - -
    -

    This helper function will automatically detect which renderer you should be using. -WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by -the browser then this function will return a canvas renderer

    - -
    - - - -
    - - -
    -
    -

    Item Index

    - - - - - - - - -
    - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/classes/index.html b/tutorial-4/pixi.js-master/docs/classes/index.html deleted file mode 100755 index 487fe15..0000000 --- a/tutorial-4/pixi.js-master/docs/classes/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Redirector - - - - Click here to redirect - - diff --git a/tutorial-4/pixi.js-master/docs/data.json b/tutorial-4/pixi.js-master/docs/data.json deleted file mode 100755 index e0b8298..0000000 --- a/tutorial-4/pixi.js-master/docs/data.json +++ /dev/null @@ -1,12399 +0,0 @@ -{ - "project": { - "name": "pixi.js", - "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", - "version": "2.1.0", - "url": "http://goodboydigital.com/", - "logo": "http://www.goodboydigital.com/pixijs/logo_small.png" - }, - "files": { - "src/pixi/display/DisplayObject.js": { - "name": "src/pixi/display/DisplayObject.js", - "modules": {}, - "classes": { - "DisplayObject": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/display/DisplayObjectContainer.js": { - "name": "src/pixi/display/DisplayObjectContainer.js", - "modules": {}, - "classes": { - "DisplayObjectContainer": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/display/MovieClip.js": { - "name": "src/pixi/display/MovieClip.js", - "modules": {}, - "classes": { - "MovieClip": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/display/Sprite.js": { - "name": "src/pixi/display/Sprite.js", - "modules": {}, - "classes": { - "Sprite": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/display/SpriteBatch.js": { - "name": "src/pixi/display/SpriteBatch.js", - "modules": {}, - "classes": { - "SpriteBatch": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/display/Stage.js": { - "name": "src/pixi/display/Stage.js", - "modules": {}, - "classes": { - "Stage": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/extras/Rope.js": { - "name": "src/pixi/extras/Rope.js", - "modules": {}, - "classes": { - "Rope": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/extras/Spine.js": { - "name": "src/pixi/extras/Spine.js", - "modules": {}, - "classes": { - "Spine": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/extras/Strip.js": { - "name": "src/pixi/extras/Strip.js", - "modules": {}, - "classes": { - "Strip": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/extras/TilingSprite.js": { - "name": "src/pixi/extras/TilingSprite.js", - "modules": {}, - "classes": { - "TilingSprite": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/AbstractFilter.js": { - "name": "src/pixi/filters/AbstractFilter.js", - "modules": {}, - "classes": { - "AbstractFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/AlphaMaskFilter.js": { - "name": "src/pixi/filters/AlphaMaskFilter.js", - "modules": {}, - "classes": { - "AlphaMaskFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/AsciiFilter.js": { - "name": "src/pixi/filters/AsciiFilter.js", - "modules": {}, - "classes": { - "AsciiFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/BlurFilter.js": { - "name": "src/pixi/filters/BlurFilter.js", - "modules": {}, - "classes": { - "BlurFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/BlurXFilter.js": { - "name": "src/pixi/filters/BlurXFilter.js", - "modules": {}, - "classes": { - "BlurXFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/BlurYFilter.js": { - "name": "src/pixi/filters/BlurYFilter.js", - "modules": {}, - "classes": { - "BlurYFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/ColorMatrixFilter.js": { - "name": "src/pixi/filters/ColorMatrixFilter.js", - "modules": {}, - "classes": { - "ColorMatrixFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/ColorStepFilter.js": { - "name": "src/pixi/filters/ColorStepFilter.js", - "modules": {}, - "classes": { - "ColorStepFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/ConvolutionFilter.js": { - "name": "src/pixi/filters/ConvolutionFilter.js", - "modules": {}, - "classes": { - "ConvolutionFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/CrossHatchFilter.js": { - "name": "src/pixi/filters/CrossHatchFilter.js", - "modules": {}, - "classes": { - "CrossHatchFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/DisplacementFilter.js": { - "name": "src/pixi/filters/DisplacementFilter.js", - "modules": {}, - "classes": { - "DisplacementFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/DotScreenFilter.js": { - "name": "src/pixi/filters/DotScreenFilter.js", - "modules": {}, - "classes": { - "DotScreenFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/FilterBlock.js": { - "name": "src/pixi/filters/FilterBlock.js", - "modules": {}, - "classes": { - "FilterBlock": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/GrayFilter.js": { - "name": "src/pixi/filters/GrayFilter.js", - "modules": {}, - "classes": { - "GrayFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/InvertFilter.js": { - "name": "src/pixi/filters/InvertFilter.js", - "modules": {}, - "classes": { - "InvertFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/NoiseFilter.js": { - "name": "src/pixi/filters/NoiseFilter.js", - "modules": {}, - "classes": { - "NoiseFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/NormalMapFilter.js": { - "name": "src/pixi/filters/NormalMapFilter.js", - "modules": {}, - "classes": { - "NormalMapFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/PixelateFilter.js": { - "name": "src/pixi/filters/PixelateFilter.js", - "modules": {}, - "classes": { - "PixelateFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/RGBSplitFilter.js": { - "name": "src/pixi/filters/RGBSplitFilter.js", - "modules": {}, - "classes": { - "RGBSplitFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/SepiaFilter.js": { - "name": "src/pixi/filters/SepiaFilter.js", - "modules": {}, - "classes": { - "SepiaFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/SmartBlurFilter.js": { - "name": "src/pixi/filters/SmartBlurFilter.js", - "modules": {}, - "classes": { - "SmartBlurFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/TiltShiftFilter.js": { - "name": "src/pixi/filters/TiltShiftFilter.js", - "modules": {}, - "classes": { - "TiltShiftFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/TiltShiftXFilter.js": { - "name": "src/pixi/filters/TiltShiftXFilter.js", - "modules": {}, - "classes": { - "TiltShiftXFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/TiltShiftYFilter.js": { - "name": "src/pixi/filters/TiltShiftYFilter.js", - "modules": {}, - "classes": { - "TiltShiftYFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/filters/TwistFilter.js": { - "name": "src/pixi/filters/TwistFilter.js", - "modules": {}, - "classes": { - "TwistFilter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Circle.js": { - "name": "src/pixi/geom/Circle.js", - "modules": {}, - "classes": { - "Circle": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Ellipse.js": { - "name": "src/pixi/geom/Ellipse.js", - "modules": {}, - "classes": { - "Ellipse": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Matrix.js": { - "name": "src/pixi/geom/Matrix.js", - "modules": {}, - "classes": { - "Matrix": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Point.js": { - "name": "src/pixi/geom/Point.js", - "modules": {}, - "classes": { - "Point": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Polygon.js": { - "name": "src/pixi/geom/Polygon.js", - "modules": {}, - "classes": { - "Polygon": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/Rectangle.js": { - "name": "src/pixi/geom/Rectangle.js", - "modules": {}, - "classes": { - "Rectangle": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/geom/RoundedRectangle.js": { - "name": "src/pixi/geom/RoundedRectangle.js", - "modules": {}, - "classes": { - "Rounded Rectangle": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/loaders/AssetLoader.js": { - "name": "src/pixi/loaders/AssetLoader.js", - "modules": {}, - "classes": { - "AssetLoader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/loaders/AtlasLoader.js": { - "name": "src/pixi/loaders/AtlasLoader.js", - "modules": {}, - "classes": { - "AtlasLoader": 1 - }, - "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/JsonLoader.js": { - "name": "src/pixi/loaders/JsonLoader.js", - "modules": {}, - "classes": { - "JsonLoader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/loaders/SpineLoader.js": { - "name": "src/pixi/loaders/SpineLoader.js", - "modules": {}, - "classes": { - "SpineLoader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/loaders/SpriteSheetLoader.js": { - "name": "src/pixi/loaders/SpriteSheetLoader.js", - "modules": {}, - "classes": { - "SpriteSheetLoader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/primitives/Graphics.js": { - "name": "src/pixi/primitives/Graphics.js", - "modules": {}, - "classes": { - "Graphics": 1, - "GraphicsData": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/canvas/utils/CanvasBuffer.js": { - "name": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "modules": {}, - "classes": { - "CanvasBuffer": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/canvas/utils/CanvasMaskManager.js": { - "name": "src/pixi/renderers/canvas/utils/CanvasMaskManager.js", - "modules": {}, - "classes": { - "CanvasMaskManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/canvas/utils/CanvasTinter.js": { - "name": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "modules": {}, - "classes": { - "CanvasTinter": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/canvas/CanvasGraphics.js": { - "name": "src/pixi/renderers/canvas/CanvasGraphics.js", - "modules": {}, - "classes": { - "CanvasGraphics": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/canvas/CanvasRenderer.js": { - "name": "src/pixi/renderers/canvas/CanvasRenderer.js", - "modules": {}, - "classes": { - "CanvasRenderer": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js": { - "name": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "modules": {}, - "classes": { - "ComplexPrimitiveShader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/shaders/PixiFastShader.js": { - "name": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "modules": {}, - "classes": { - "PixiFastShader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/shaders/PixiShader.js": { - "name": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "modules": {}, - "classes": { - "PixiShader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/shaders/PrimitiveShader.js": { - "name": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "modules": {}, - "classes": { - "PrimitiveShader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/shaders/StripShader.js": { - "name": "src/pixi/renderers/webgl/shaders/StripShader.js", - "modules": {}, - "classes": { - "StripShader": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/FilterTexture.js": { - "name": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "modules": {}, - "classes": { - "FilterTexture": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "modules": {}, - "classes": { - "WebGLBlendModeManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "modules": {}, - "classes": { - "WebGLFastSpriteBatch": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLFilterManager.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "modules": {}, - "classes": { - "WebGLFilterManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLGraphics.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "modules": {}, - "classes": { - "WebGLGraphics": 1, - "WebGLGraphicsData": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLMaskManager.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "modules": {}, - "classes": { - "WebGLMaskManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLShaderManager.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "modules": {}, - "classes": { - "WebGLShaderManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "modules": {}, - "classes": { - "WebGLSpriteBatch": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/utils/WebGLStencilManager.js": { - "name": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "modules": {}, - "classes": { - "WebGLStencilManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/renderers/webgl/WebGLRenderer.js": { - "name": "src/pixi/renderers/webgl/WebGLRenderer.js", - "modules": {}, - "classes": { - "WebGLRenderer": 1 - }, - "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": {}, - "classes": { - "BaseTexture": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/textures/RenderTexture.js": { - "name": "src/pixi/textures/RenderTexture.js", - "modules": {}, - "classes": { - "RenderTexture": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/textures/Texture.js": { - "name": "src/pixi/textures/Texture.js", - "modules": {}, - "classes": { - "Texture": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/textures/VideoTexture.js": { - "name": "src/pixi/textures/VideoTexture.js", - "modules": {}, - "classes": {}, - "fors": {}, - "namespaces": {} - }, - "src/pixi/utils/Detector.js": { - "name": "src/pixi/utils/Detector.js", - "modules": {}, - "classes": { - "autoDetectRenderer": 1, - "autoDetectRecommendedRenderer": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/utils/EventTarget.js": { - "name": "src/pixi/utils/EventTarget.js", - "modules": {}, - "classes": { - "EventTarget": 1, - "Event": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/utils/Polyk.js": { - "name": "src/pixi/utils/Polyk.js", - "modules": {}, - "classes": { - "PolyK": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/utils/Utils.js": { - "name": "src/pixi/utils/Utils.js", - "modules": {}, - "classes": { - "AjaxRequest": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/InteractionData.js": { - "name": "src/pixi/InteractionData.js", - "modules": {}, - "classes": { - "InteractionData": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/InteractionManager.js": { - "name": "src/pixi/InteractionManager.js", - "modules": {}, - "classes": { - "InteractionManager": 1 - }, - "fors": {}, - "namespaces": {} - }, - "src/pixi/Intro.js": { - "name": "src/pixi/Intro.js", - "modules": {}, - "classes": {}, - "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": { - "PIXI": 1 - }, - "classes": {}, - "fors": {}, - "namespaces": {} - } - }, - "modules": { - "PIXI": { - "name": "PIXI", - "submodules": {}, - "classes": { - "DisplayObject": 1, - "DisplayObjectContainer": 1, - "MovieClip": 1, - "Sprite": 1, - "SpriteBatch": 1, - "Stage": 1, - "Rope": 1, - "Spine": 1, - "Strip": 1, - "TilingSprite": 1, - "AbstractFilter": 1, - "AlphaMaskFilter": 1, - "AsciiFilter": 1, - "BlurFilter": 1, - "BlurXFilter": 1, - "BlurYFilter": 1, - "ColorMatrixFilter": 1, - "ColorStepFilter": 1, - "ConvolutionFilter": 1, - "CrossHatchFilter": 1, - "DisplacementFilter": 1, - "DotScreenFilter": 1, - "FilterBlock": 1, - "GrayFilter": 1, - "InvertFilter": 1, - "NoiseFilter": 1, - "NormalMapFilter": 1, - "PixelateFilter": 1, - "RGBSplitFilter": 1, - "SepiaFilter": 1, - "SmartBlurFilter": 1, - "TiltShiftFilter": 1, - "TiltShiftXFilter": 1, - "TiltShiftYFilter": 1, - "TwistFilter": 1, - "Circle": 1, - "Ellipse": 1, - "Matrix": 1, - "Point": 1, - "Polygon": 1, - "Rectangle": 1, - "Rounded Rectangle": 1, - "AssetLoader": 1, - "AtlasLoader": 1, - "BitmapFontLoader": 1, - "ImageLoader": 1, - "JsonLoader": 1, - "SpineLoader": 1, - "SpriteSheetLoader": 1, - "Graphics": 1, - "GraphicsData": 1, - "CanvasBuffer": 1, - "CanvasMaskManager": 1, - "CanvasTinter": 1, - "CanvasGraphics": 1, - "CanvasRenderer": 1, - "ComplexPrimitiveShader": 1, - "PixiFastShader": 1, - "PixiShader": 1, - "PrimitiveShader": 1, - "StripShader": 1, - "FilterTexture": 1, - "WebGLBlendModeManager": 1, - "WebGLFastSpriteBatch": 1, - "WebGLFilterManager": 1, - "WebGLGraphics": 1, - "WebGLGraphicsData": 1, - "WebGLMaskManager": 1, - "WebGLShaderManager": 1, - "WebGLSpriteBatch": 1, - "WebGLStencilManager": 1, - "WebGLRenderer": 1, - "BitmapText": 1, - "Text": 1, - "BaseTexture": 1, - "RenderTexture": 1, - "Texture": 1, - "autoDetectRenderer": 1, - "autoDetectRecommendedRenderer": 1, - "EventTarget": 1, - "Event": 1, - "PolyK": 1, - "AjaxRequest": 1, - "InteractionData": 1, - "InteractionManager": 1 - }, - "fors": {}, - "namespaces": {}, - "tag": "module", - "file": "src/pixi/InteractionManager.js", - "line": 5 - } - }, - "classes": { - "DisplayObject": { - "name": "DisplayObject", - "shortname": "DisplayObject", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/DisplayObject.js", - "line": 5, - "description": "The base class for all objects that are rendered on the screen.\nThis is an abstract class and should not be used on its own rather it should be extended.", - "is_constructor": 1 - }, - "DisplayObjectContainer": { - "name": "DisplayObjectContainer", - "shortname": "DisplayObjectContainer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 5, - "description": "A DisplayObjectContainer represents a collection of display objects.\nIt is the base class of all display objects that act as a container for other objects.", - "extends": "DisplayObject", - "is_constructor": 1 - }, - "MovieClip": { - "name": "MovieClip", - "shortname": "MovieClip", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/MovieClip.js", - "line": 5, - "description": "A MovieClip is a simple way to display an animation depicted by a list of textures.", - "extends": "Sprite", - "is_constructor": 1, - "params": [ - { - "name": "textures", - "description": "an array of {Texture} objects that make up the animation", - "type": "Array" - } - ] - }, - "Sprite": { - "name": "Sprite", - "shortname": "Sprite", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/Sprite.js", - "line": 5, - "description": "The Sprite object is the base for all textured objects that are rendered to the screen", - "extends": "DisplayObjectContainer", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "The texture for this sprite\n\nA sprite can be created directly from an image like this :\nvar sprite = new PIXI.Sprite.fromImage('assets/image.png');\nyourStage.addChild(sprite);\nthen obviously don't forget to add it to the stage you have already created", - "type": "Texture" - } - ] - }, - "SpriteBatch": { - "name": "SpriteBatch", - "shortname": "SpriteBatch", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/SpriteBatch.js", - "line": 5, - "description": "The SpriteBatch class is a really fast version of the DisplayObjectContainer \nbuilt solely for speed, so use when you need a lot of sprites or particles.\nAnd it's extremely easy to use : \n\n var container = new PIXI.SpriteBatch();\n\n stage.addChild(container);\n\n for(var i = 0; i < 100; i++)\n {\n var sprite = new PIXI.Sprite.fromImage(\"myImage.png\");\n container.addChild(sprite);\n }\nAnd here you have a hundred sprites that will be renderer at the speed of light", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "", - "type": "Texture" - } - ] - }, - "Stage": { - "name": "Stage", - "shortname": "Stage", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/display/Stage.js", - "line": 5, - "description": "A Stage represents the root of the display tree. Everything connected to the stage is rendered", - "extends": "DisplayObjectContainer", - "is_constructor": 1, - "params": [ - { - "name": "backgroundColor", - "description": "the background color of the stage, you have to pass this in is in hex format\n like: 0xFFFFFF for white\n\nCreating a stage is a mandatory process when you use Pixi, which is as simple as this : \nvar stage = new PIXI.Stage(0xFFFFFF);\nwhere the parameter given is the background colour of the stage, in hex\nyou will use this stage instance to add your sprites to it and therefore to the renderer\nHere is how to add a sprite to the stage : \nstage.addChild(sprite);", - "type": "Number" - } - ] - }, - "Rope": { - "name": "Rope", - "shortname": "Rope", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/extras/Rope.js", - "line": 6, - "is_constructor": 1, - "extends": "Strip", - "params": [ - { - "name": "texture", - "description": "- The texture to use on the rope.", - "type": "Texture" - }, - { - "name": "points", - "description": "- An array of {PIXI.Point}.", - "type": "Array" - } - ] - }, - "Spine": { - "name": "Spine", - "shortname": "Spine", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/extras/Spine.js", - "line": 1357, - "description": "A class that enables the you to import and run your spine animations in pixi.\nSpine animation data needs to be loaded using the PIXI.AssetLoader or PIXI.SpineLoader before it can be used by this class\nSee example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source", - "extends": "DisplayObjectContainer", - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the spine anim file to be used", - "type": "String" - } - ] - }, - "Strip": { - "name": "Strip", - "shortname": "Strip", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/extras/Strip.js", - "line": 5, - "extends": "DisplayObjectContainer", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "The texture to use", - "type": "Texture" - }, - { - "name": "width", - "description": "the width", - "type": "Number" - }, - { - "name": "height", - "description": "the height", - "type": "Number" - } - ] - }, - "TilingSprite": { - "name": "TilingSprite", - "shortname": "TilingSprite", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/extras/TilingSprite.js", - "line": 5, - "description": "A tiling sprite is a fast way of rendering a tiling image", - "extends": "Sprite", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "the texture of the tiling sprite", - "type": "Texture" - }, - { - "name": "width", - "description": "the width of the tiling sprite", - "type": "Number" - }, - { - "name": "height", - "description": "the height of the tiling sprite", - "type": "Number" - } - ] - }, - "AbstractFilter": { - "name": "AbstractFilter", - "shortname": "AbstractFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/AbstractFilter.js", - "line": 5, - "description": "This is the base class for creating a PIXI filter. Currently only webGL supports filters.\nIf you want to make a custom filter this should be your base class.", - "is_constructor": 1, - "params": [ - { - "name": "fragmentSrc", - "description": "The fragment source in an array of strings.", - "type": "Array" - }, - { - "name": "uniforms", - "description": "An object containing the uniforms for this filter.", - "type": "Object" - } - ] - }, - "AlphaMaskFilter": { - "name": "AlphaMaskFilter", - "shortname": "AlphaMaskFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/AlphaMaskFilter.js", - "line": 5, - "description": "The AlphaMaskFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object.\nYou can use this filter to apply all manor of crazy warping effects\nCurrently the r property of the texture is used to offset the x and the g property of the texture is used to offset the y.", - "extends": "AbstractFilter", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "The texture used for the displacement map * must be power of 2 texture at the moment", - "type": "Texture" - } - ] - }, - "AsciiFilter": { - "name": "AsciiFilter", - "shortname": "AsciiFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/AsciiFilter.js", - "line": 6, - "description": "An ASCII filter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "BlurFilter": { - "name": "BlurFilter", - "shortname": "BlurFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/BlurFilter.js", - "line": 5, - "description": "The BlurFilter applies a Gaussian blur to an object.\nThe strength of the blur can be set for x- and y-axis separately (always relative to the stage).", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "BlurXFilter": { - "name": "BlurXFilter", - "shortname": "BlurXFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/BlurXFilter.js", - "line": 5, - "description": "The BlurXFilter applies a horizontal Gaussian blur to an object.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "BlurYFilter": { - "name": "BlurYFilter", - "shortname": "BlurYFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/BlurYFilter.js", - "line": 5, - "description": "The BlurYFilter applies a vertical Gaussian blur to an object.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "ColorMatrixFilter": { - "name": "ColorMatrixFilter", - "shortname": "ColorMatrixFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/ColorMatrixFilter.js", - "line": 5, - "description": "The ColorMatrixFilter class lets you apply a 4x4 matrix transformation on the RGBA\ncolor and alpha values of every pixel on your displayObject to produce a result\nwith a new set of RGBA color and alpha values. It's pretty powerful!", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "ColorStepFilter": { - "name": "ColorStepFilter", - "shortname": "ColorStepFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/ColorStepFilter.js", - "line": 5, - "description": "This lowers the color depth of your image by the given amount, producing an image with a smaller palette.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "ConvolutionFilter": { - "name": "ConvolutionFilter", - "shortname": "ConvolutionFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/ConvolutionFilter.js", - "line": 1, - "description": "The ConvolutionFilter class applies a matrix convolution filter effect. \nA convolution combines pixels in the input image with neighboring pixels to produce a new image. \nA wide variety of image effects can be achieved through convolutions, including blurring, edge detection, sharpening, embossing, and beveling.\nThe matrix should be specified as a 9 point Array. See http://docs.gimp.org/en/plug-in-convmatrix.html for more info.", - "extends": "AbstractFilter", - "is_constructor": 1, - "params": [ - { - "name": "matrix", - "description": "An array of values used for matrix transformation. Specified as a 9 point Array.", - "type": "Array" - }, - { - "name": "width", - "description": "Width of the object you are transforming", - "type": "Number" - }, - { - "name": "height", - "description": "Height of the object you are transforming", - "type": "Number" - } - ] - }, - "CrossHatchFilter": { - "name": "CrossHatchFilter", - "shortname": "CrossHatchFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/CrossHatchFilter.js", - "line": 5, - "description": "A Cross Hatch effect filter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "DisplacementFilter": { - "name": "DisplacementFilter", - "shortname": "DisplacementFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 5, - "description": "The DisplacementFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object.\nYou can use this filter to apply all manor of crazy warping effects\nCurrently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.", - "extends": "AbstractFilter", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "The texture used for the displacement map * must be power of 2 texture at the moment", - "type": "Texture" - } - ] - }, - "DotScreenFilter": { - "name": "DotScreenFilter", - "shortname": "DotScreenFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/DotScreenFilter.js", - "line": 6, - "description": "This filter applies a dotscreen effect making display objects appear to be made out of black and white halftone dots like an old printer.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "FilterBlock": { - "name": "FilterBlock", - "shortname": "FilterBlock", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/FilterBlock.js", - "line": 5, - "description": "A target and pass info object for filters.", - "is_constructor": 1 - }, - "GrayFilter": { - "name": "GrayFilter", - "shortname": "GrayFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/GrayFilter.js", - "line": 5, - "description": "This greyscales the palette of your Display Objects.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "InvertFilter": { - "name": "InvertFilter", - "shortname": "InvertFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/InvertFilter.js", - "line": 5, - "description": "This inverts your Display Objects colors.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "NoiseFilter": { - "name": "NoiseFilter", - "shortname": "NoiseFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/NoiseFilter.js", - "line": 6, - "description": "A Noise effect filter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "NormalMapFilter": { - "name": "NormalMapFilter", - "shortname": "NormalMapFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 6, - "description": "The NormalMapFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. \nYou can use this filter to apply all manor of crazy warping effects\nCurrently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.", - "extends": "AbstractFilter", - "is_constructor": 1, - "params": [ - { - "name": "texture", - "description": "The texture used for the displacement map * must be power of 2 texture at the moment", - "type": "Texture" - } - ] - }, - "PixelateFilter": { - "name": "PixelateFilter", - "shortname": "PixelateFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/PixelateFilter.js", - "line": 5, - "description": "This filter applies a pixelate effect making display objects appear 'blocky'.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "RGBSplitFilter": { - "name": "RGBSplitFilter", - "shortname": "RGBSplitFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/RGBSplitFilter.js", - "line": 5, - "description": "An RGB Split Filter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "SepiaFilter": { - "name": "SepiaFilter", - "shortname": "SepiaFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/SepiaFilter.js", - "line": 5, - "description": "This applies a sepia effect to your Display Objects.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "SmartBlurFilter": { - "name": "SmartBlurFilter", - "shortname": "SmartBlurFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/SmartBlurFilter.js", - "line": 5, - "description": "A Smart Blur Filter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "TiltShiftFilter": { - "name": "TiltShiftFilter", - "shortname": "TiltShiftFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 6, - "description": "A TiltShift Filter. Manages the pass of both a TiltShiftXFilter and TiltShiftYFilter.", - "is_constructor": 1 - }, - "TiltShiftXFilter": { - "name": "TiltShiftXFilter", - "shortname": "TiltShiftXFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 6, - "description": "A TiltShiftXFilter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "TiltShiftYFilter": { - "name": "TiltShiftYFilter", - "shortname": "TiltShiftYFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 6, - "description": "A TiltShiftYFilter.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "TwistFilter": { - "name": "TwistFilter", - "shortname": "TwistFilter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/filters/TwistFilter.js", - "line": 5, - "description": "This filter applies a twist effect making display objects appear twisted in the given direction.", - "extends": "AbstractFilter", - "is_constructor": 1 - }, - "Circle": { - "name": "Circle", - "shortname": "Circle", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Circle.js", - "line": 5, - "description": "The Circle object can be used to specify a hit area for displayObjects", - "is_constructor": 1, - "params": [ - { - "name": "x", - "description": "The X coordinate of the center of this circle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the center of this circle", - "type": "Number" - }, - { - "name": "radius", - "description": "The radius of the circle", - "type": "Number" - } - ] - }, - "Ellipse": { - "name": "Ellipse", - "shortname": "Ellipse", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Ellipse.js", - "line": 5, - "description": "The Ellipse object can be used to specify a hit area for displayObjects", - "is_constructor": 1, - "params": [ - { - "name": "x", - "description": "The X coordinate of the center of the ellipse", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the center of the ellipse", - "type": "Number" - }, - { - "name": "width", - "description": "The half width of this ellipse", - "type": "Number" - }, - { - "name": "height", - "description": "The half height of this ellipse", - "type": "Number" - } - ] - }, - "Matrix": { - "name": "Matrix", - "shortname": "Matrix", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Matrix.js", - "line": 5, - "description": "The Matrix class is now an object, which makes it a lot faster, \nhere is a representation of it : \n| a | b | tx|\n| c | d | ty|\n| 0 | 0 | 1 |", - "is_constructor": 1 - }, - "Point": { - "name": "Point", - "shortname": "Point", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Point.js", - "line": 5, - "description": "The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.", - "is_constructor": 1, - "params": [ - { - "name": "x", - "description": "position of the point on the x axis", - "type": "Number" - }, - { - "name": "y", - "description": "position of the point on the y axis", - "type": "Number" - } - ] - }, - "Polygon": { - "name": "Polygon", - "shortname": "Polygon", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Polygon.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "points", - "description": "This can be an array of Points that form the polygon,\n a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be\n all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the\n arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are\n Numbers.", - "type": "Array|Array|Point...|Number...", - "multiple": true - } - ] - }, - "Rectangle": { - "name": "Rectangle", - "shortname": "Rectangle", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/Rectangle.js", - "line": 5, - "description": "the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.", - "is_constructor": 1, - "params": [ - { - "name": "x", - "description": "The X coordinate of the upper-left corner of the rectangle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the upper-left corner of the rectangle", - "type": "Number" - }, - { - "name": "width", - "description": "The overall width of this rectangle", - "type": "Number" - }, - { - "name": "height", - "description": "The overall height of this rectangle", - "type": "Number" - } - ] - }, - "Rounded Rectangle": { - "name": "Rounded Rectangle", - "shortname": "Rounded Rectangle", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 5, - "description": "the Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height.", - "is_constructor": 1, - "params": [ - { - "name": "x", - "description": "The X coordinate of the upper-left corner of the rounded rectangle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the upper-left corner of the rounded rectangle", - "type": "Number" - }, - { - "name": "width", - "description": "The overall width of this rounded rectangle", - "type": "Number" - }, - { - "name": "height", - "description": "The overall height of this rounded rectangle", - "type": "Number" - }, - { - "name": "radius", - "description": "The overall radius of this corners of this rounded rectangle", - "type": "Number" - } - ] - }, - "AssetLoader": { - "name": "AssetLoader", - "shortname": "AssetLoader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/loaders/AssetLoader.js", - "line": 5, - "description": "A Class that loads a bunch of images / sprite sheet / bitmap font files. Once the\nassets have been loaded they are added to the PIXI Texture cache and can be accessed\neasily 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, - "uses": [ - "EventTarget" - ], - "params": [ - { - "name": "assetURLs", - "description": "An array of image/sprite sheet urls that you would like loaded\n supported. Supported image formats include 'jpeg', 'jpg', 'png', 'gif'. Supported\n sprite sheet data formats only include 'JSON' at this time. Supported bitmap font\n data formats include 'xml' and 'fnt'.", - "type": "Array" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "AtlasLoader": { - "name": "AtlasLoader", - "shortname": "AtlasLoader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 5, - "description": "The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event.\n\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format.\n\nIt is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to 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.fromFrameId()", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the JSON file", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "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", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the sprite sheet JSON file", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "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.fromFrame() and PIXI.Sprite.fromFrame()\nWhen loaded this class will dispatch a 'loaded' event", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the image", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "JsonLoader": { - "name": "JsonLoader", - "shortname": "JsonLoader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/loaders/JsonLoader.js", - "line": 5, - "description": "The json file loader is used to load in JSON data and parse it\nWhen loaded this class will dispatch a 'loaded' event\nIf loading fails this class will dispatch an 'error' event", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the JSON file", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "SpineLoader": { - "name": "SpineLoader", - "shortname": "SpineLoader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/loaders/SpineLoader.js", - "line": 10, - "description": "The Spine loader is used to load in JSON spine data\nTo generate the data you need to use http://esotericsoftware.com/ and export in the \"JSON\" format\nDue to a clash of names You will need to change the extension of the spine file from *.json to *.anim for it to load\nSee example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source\nYou will need to generate a sprite sheet to accompany the spine data\nWhen loaded this class will dispatch a \"loaded\" event", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the JSON file", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "SpriteSheetLoader": { - "name": "SpriteSheetLoader", - "shortname": "SpriteSheetLoader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "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 in 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 a 'texture atlas') as it means sprites 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.fromFrameId()\nThis loader will load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "url", - "description": "The url of the sprite sheet JSON file", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - } - ] - }, - "Graphics": { - "name": "Graphics", - "shortname": "Graphics", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/primitives/Graphics.js", - "line": 5, - "description": "The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and color and fill them.", - "extends": "DisplayObjectContainer", - "is_constructor": 1 - }, - "GraphicsData": { - "name": "GraphicsData", - "shortname": "GraphicsData", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/primitives/Graphics.js", - "line": 1093, - "description": "A GraphicsData object.", - "is_constructor": 1 - }, - "CanvasBuffer": { - "name": "CanvasBuffer", - "shortname": "CanvasBuffer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 5, - "description": "Creates a Canvas element of the given size.", - "is_constructor": 1, - "params": [ - { - "name": "width", - "description": "the width for the newly created canvas", - "type": "Number" - }, - { - "name": "height", - "description": "the height for the newly created canvas", - "type": "Number" - } - ] - }, - "CanvasMaskManager": { - "name": "CanvasMaskManager", - "shortname": "CanvasMaskManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/canvas/utils/CanvasMaskManager.js", - "line": 5, - "description": "A set of functions used to handle masking.", - "is_constructor": 1 - }, - "CanvasTinter": { - "name": "CanvasTinter", - "shortname": "CanvasTinter", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 5, - "is_constructor": 1, - "static": 1 - }, - "CanvasGraphics": { - "name": "CanvasGraphics", - "shortname": "CanvasGraphics", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/canvas/CanvasGraphics.js", - "line": 6, - "description": "A set of functions used by the canvas renderer to draw the primitive graphics data.", - "static": 1 - }, - "CanvasRenderer": { - "name": "CanvasRenderer", - "shortname": "CanvasRenderer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 5, - "description": "The CanvasRenderer draws the Stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.\nDon't forget to add the CanvasRenderer.view to your DOM or you will not see anything :)", - "is_constructor": 1, - "params": [ - { - "name": "width", - "description": "the width of the canvas view", - "type": "Number", - "optional": true, - "optdefault": "800" - }, - { - "name": "height", - "description": "the height of the canvas view", - "type": "Number", - "optional": true, - "optdefault": "600" - }, - { - "name": "options", - "description": "The optional renderer parameters", - "type": "Object", - "optional": true, - "props": [ - { - "name": "view", - "description": "the canvas to use as a view, optional", - "type": "HTMLCanvasElement", - "optional": true - }, - { - "name": "transparent", - "description": "If the render view is transparent, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "autoResize", - "description": "If the render view is automatically resized, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "resolution", - "description": "the resolution of the renderer retina would be 2", - "type": "Number", - "optional": true, - "optdefault": "1" - }, - { - "name": "clearBeforeRender", - "description": "This sets if the CanvasRenderer will clear the canvas or not before the new render pass.", - "type": "Boolean", - "optional": true, - "optdefault": "true" - } - ] - } - ] - }, - "ComplexPrimitiveShader": { - "name": "ComplexPrimitiveShader", - "shortname": "ComplexPrimitiveShader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "PixiFastShader": { - "name": "PixiFastShader", - "shortname": "PixiFastShader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "PixiShader": { - "name": "PixiShader", - "shortname": "PixiShader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 6, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "PrimitiveShader": { - "name": "PrimitiveShader", - "shortname": "PrimitiveShader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "StripShader": { - "name": "StripShader", - "shortname": "StripShader", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "FilterTexture": { - "name": "FilterTexture", - "shortname": "FilterTexture", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - }, - { - "name": "width", - "description": "the horizontal range of the filter", - "type": "Number" - }, - { - "name": "height", - "description": "the vertical range of the filter", - "type": "Number" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ] - }, - "WebGLBlendModeManager": { - "name": "WebGLBlendModeManager", - "shortname": "WebGLBlendModeManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 5, - "is_constructor": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ] - }, - "WebGLFastSpriteBatch": { - "name": "WebGLFastSpriteBatch", - "shortname": "WebGLFastSpriteBatch", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 11, - "is_constructor": 1 - }, - "WebGLFilterManager": { - "name": "WebGLFilterManager", - "shortname": "WebGLFilterManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 5, - "is_constructor": 1 - }, - "WebGLGraphics": { - "name": "WebGLGraphics", - "shortname": "WebGLGraphics", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 5, - "description": "A set of functions used by the webGL renderer to draw the primitive graphics data", - "access": "private", - "tagname": "", - "static": 1 - }, - "WebGLGraphicsData": { - "name": "WebGLGraphicsData", - "shortname": "WebGLGraphicsData", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 829, - "access": "private", - "tagname": "", - "static": 1 - }, - "WebGLMaskManager": { - "name": "WebGLMaskManager", - "shortname": "WebGLMaskManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 5, - "is_constructor": 1, - "access": "private", - "tagname": "" - }, - "WebGLShaderManager": { - "name": "WebGLShaderManager", - "shortname": "WebGLShaderManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 5, - "is_constructor": 1, - "access": "private", - "tagname": "" - }, - "WebGLSpriteBatch": { - "name": "WebGLSpriteBatch", - "shortname": "WebGLSpriteBatch", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 11, - "access": "private", - "tagname": "", - "is_constructor": 1 - }, - "WebGLStencilManager": { - "name": "WebGLStencilManager", - "shortname": "WebGLStencilManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 5, - "is_constructor": 1, - "access": "private", - "tagname": "" - }, - "WebGLRenderer": { - "name": "WebGLRenderer", - "shortname": "WebGLRenderer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 8, - "description": "The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer\nshould be used for browsers that support webGL. This Render works by automatically managing webGLBatchs.\nSo no need for Sprite Batches or Sprite Clouds.\nDon't forget to add the view to your DOM or you will not see anything :)", - "is_constructor": 1, - "params": [ - { - "name": "width", - "description": "the width of the canvas view", - "type": "Number", - "optional": true, - "optdefault": "0" - }, - { - "name": "height", - "description": "the height of the canvas view", - "type": "Number", - "optional": true, - "optdefault": "0" - }, - { - "name": "options", - "description": "The optional renderer parameters", - "type": "Object", - "optional": true, - "props": [ - { - "name": "view", - "description": "the canvas to use as a view, optional", - "type": "HTMLCanvasElement", - "optional": true - }, - { - "name": "transparent", - "description": "If the render view is transparent, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "autoResize", - "description": "If the render view is automatically resized, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "antialias", - "description": "sets antialias (only applicable in chrome at the moment)", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "preserveDrawingBuffer", - "description": "enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "resolution", - "description": "the resolution of the renderer retina would be 2", - "type": "Number", - "optional": true, - "optdefault": "1" - } - ] - } - ] - }, - "BitmapText": { - "name": "BitmapText", - "shortname": "BitmapText", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/text/BitmapText.js", - "line": 5, - "description": "A BitmapText object will create a line or multiple lines of text using bitmap font. To split a line you can use '\\n', '\\r' or '\\r\\n' in your string.\nYou can generate the fnt files using\nhttp://www.angelcode.com/products/bmfont/ for windows or\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", - "props": [ - { - "name": "font", - "description": "The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)", - "type": "String" - }, - { - "name": "align", - "description": "Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text", - "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": 6, - "description": "A Text Object will create a line or multiple lines of text. To split a line you can use '\\n' in your text string,\nor add a wordWrap property set to true and and wordWrapWidth property with a value in the style object.", - "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 20px 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 e.g 'red', '#00FF00'", - "type": "String|Number", - "optional": true, - "optdefault": "'black'" - }, - { - "name": "align", - "description": "Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text", - "type": "String", - "optional": true, - "optdefault": "'left'" - }, - { - "name": "stroke", - "description": "A canvas fillstyle that will be used on the text stroke e.g 'blue', '#FCFF00'", - "type": "String|Number", - "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": "wordWrap", - "description": "Indicates if word wrap should be used", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "wordWrapWidth", - "description": "The width at which text will wrap, it needs wordWrap to be set to true", - "type": "Number", - "optional": true, - "optdefault": "100" - }, - { - "name": "dropShadow", - "description": "Set a drop shadow for the text", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "dropShadowColor", - "description": "A fill style to be used on the dropshadow e.g 'red', '#00FF00'", - "type": "String", - "optional": true, - "optdefault": "'#000000'" - }, - { - "name": "dropShadowAngle", - "description": "Set a angle of the drop shadow", - "type": "Number", - "optional": true, - "optdefault": "Math.PI/4" - }, - { - "name": "dropShadowDistance", - "description": "Set a distance of the drop shadow", - "type": "Number", - "optional": true, - "optdefault": "5" - } - ] - } - ] - }, - "BaseTexture": { - "name": "BaseTexture", - "shortname": "BaseTexture", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/textures/BaseTexture.js", - "line": 9, - "description": "A texture stores the information that represents an image. All textures have a base texture.", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "source", - "description": "the source object (image or canvas)", - "type": "String" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ] - }, - "RenderTexture": { - "name": "RenderTexture", - "shortname": "RenderTexture", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/textures/RenderTexture.js", - "line": 5, - "description": "A RenderTexture is a special texture that allows any Pixi display object to be rendered to it.\n\n__Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead.\n\nA RenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example:\n\n var renderTexture = new PIXI.RenderTexture(800, 600);\n var sprite = PIXI.Sprite.fromImage(\"spinObj_01.png\");\n sprite.position.x = 800/2;\n sprite.position.y = 600/2;\n sprite.anchor.x = 0.5;\n sprite.anchor.y = 0.5;\n renderTexture.render(sprite);\n\nThe Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual position a DisplayObjectContainer should be used:\n\n var doc = new PIXI.DisplayObjectContainer();\n doc.addChild(sprite);\n renderTexture.render(doc); // Renders to center of renderTexture", - "extends": "Texture", - "is_constructor": 1, - "params": [ - { - "name": "width", - "description": "The width of the render texture", - "type": "Number" - }, - { - "name": "height", - "description": "The height of the render texture", - "type": "Number" - }, - { - "name": "renderer", - "description": "The renderer used for this RenderTexture", - "type": "CanvasRenderer|WebGLRenderer" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - }, - { - "name": "resolution", - "description": "The resolution of the texture being generated", - "type": "Number" - } - ] - }, - "Texture": { - "name": "Texture", - "shortname": "Texture", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/textures/Texture.js", - "line": 10, - "description": "A texture stores the information that represents an image or part of an image. It cannot be added\nto the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used.", - "uses": [ - "EventTarget" - ], - "is_constructor": 1, - "params": [ - { - "name": "baseTexture", - "description": "The base texture source to create the texture from", - "type": "BaseTexture" - }, - { - "name": "frame", - "description": "The rectangle frame of the texture to show", - "type": "Rectangle" - }, - { - "name": "crop", - "description": "The area of original texture", - "type": "Rectangle", - "optional": true - }, - { - "name": "trim", - "description": "Trimmed texture rectangle", - "type": "Rectangle", - "optional": true - } - ] - }, - "autoDetectRenderer": { - "name": "autoDetectRenderer", - "shortname": "autoDetectRenderer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/utils/Detector.js", - "line": 5, - "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot faster. If webGL is not supported by\nthe browser then this function will return a canvas renderer", - "static": 1, - "params": [ - { - "name": "width=800", - "description": "the width of the renderers view", - "type": "Number" - }, - { - "name": "height=600", - "description": "the height of the renderers view", - "type": "Number" - }, - { - "name": "options", - "description": "The optional renderer parameters", - "type": "Object", - "optional": true, - "props": [ - { - "name": "view", - "description": "the canvas to use as a view, optional", - "type": "HTMLCanvasElement", - "optional": true - }, - { - "name": "transparent", - "description": "If the render view is transparent, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "antialias", - "description": "sets antialias (only applicable in chrome at the moment)", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "preserveDrawingBuffer", - "description": "enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "resolution", - "description": "the resolution of the renderer retina would be 2", - "type": "Number", - "optional": true, - "optdefault": "1" - } - ] - } - ] - }, - "autoDetectRecommendedRenderer": { - "name": "autoDetectRecommendedRenderer", - "shortname": "autoDetectRecommendedRenderer", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/utils/Detector.js", - "line": 44, - "description": "This helper function will automatically detect which renderer you should be using.\nThis function is very similar to the autoDetectRenderer function except that is will return a canvas renderer for android.\nEven thought both android chrome supports webGL the canvas implementation perform better at the time of writing. \nThis function will likely change and update as webGL performance improves on these devices.", - "static": 1, - "params": [ - { - "name": "width=800", - "description": "the width of the renderers view", - "type": "Number" - }, - { - "name": "height=600", - "description": "the height of the renderers view", - "type": "Number" - }, - { - "name": "options", - "description": "The optional renderer parameters", - "type": "Object", - "optional": true, - "props": [ - { - "name": "view", - "description": "the canvas to use as a view, optional", - "type": "HTMLCanvasElement", - "optional": true - }, - { - "name": "transparent", - "description": "If the render view is transparent, default false", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "antialias", - "description": "sets antialias (only applicable in chrome at the moment)", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "preserveDrawingBuffer", - "description": "enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "resolution", - "description": "the resolution of the renderer retina would be 2", - "type": "Number", - "optional": true, - "optdefault": "1" - } - ] - } - ] - }, - "EventTarget": { - "name": "EventTarget", - "shortname": "EventTarget", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [ - "AssetLoader", - "AtlasLoader", - "BitmapFontLoader", - "ImageLoader", - "JsonLoader", - "SpineLoader", - "SpriteSheetLoader", - "BaseTexture", - "Texture" - ], - "module": "PIXI", - "file": "src/pixi/utils/EventTarget.js", - "line": 11, - "description": "Mixins event emitter functionality to a class", - "example": [ - "\n function MyEmitter() {}\n\n PIXI.EventTarget.mixin(MyEmitter.prototype);\n\n var em = new MyEmitter();\n em.emit('eventName', 'some data', 'some more data', {}, null, ...);" - ] - }, - "Event": { - "name": "Event", - "shortname": "Event", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/utils/EventTarget.js", - "line": 192, - "description": "Creates an homogenous object for tracking events so users can know what to expect.", - "extends": "Object", - "is_constructor": 1, - "params": [ - { - "name": "target", - "description": "The target object that the event is called on", - "type": "Object" - }, - { - "name": "name", - "description": "The string name of the event that was triggered", - "type": "String" - }, - { - "name": "data", - "description": "Arbitrary event data to pass along", - "type": "Object" - } - ] - }, - "PolyK": { - "name": "PolyK", - "shortname": "PolyK", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/utils/Polyk.js", - "line": 34, - "description": "Based on the Polyk library http://polyk.ivank.net released under MIT licence.\nThis is an amazing lib!\nSlightly modified by Mat Groves (matgroves.com);" - }, - "AjaxRequest": { - "name": "AjaxRequest", - "shortname": "AjaxRequest", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/utils/Utils.js", - "line": 108, - "description": "A wrapper for ajax requests to be handled cross browser", - "is_constructor": 1 - }, - "InteractionData": { - "name": "InteractionData", - "shortname": "InteractionData", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/InteractionData.js", - "line": 5, - "description": "Holds all information related to an Interaction event", - "is_constructor": 1 - }, - "InteractionManager": { - "name": "InteractionManager", - "shortname": "InteractionManager", - "classitems": [], - "plugins": [], - "extensions": [], - "plugin_for": [], - "extension_for": [], - "module": "PIXI", - "file": "src/pixi/InteractionManager.js", - "line": 5, - "description": "The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive\nif its interactive parameter is set to true\nThis manager also supports multitouch.", - "is_constructor": 1, - "params": [ - { - "name": "stage", - "description": "The stage to handle interactions", - "type": "Stage" - } - ] - } - }, - "classitems": [ - { - "file": "src/pixi/display/DisplayObject.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 14, - "description": "The coordinate of the object relative to the local coordinates of the parent.", - "itemtype": "property", - "name": "position", - "type": "Point", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 22, - "description": "The scale factor of the object.", - "itemtype": "property", - "name": "scale", - "type": "Point", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 30, - "description": "The pivot point of the displayObject that it rotates around", - "itemtype": "property", - "name": "pivot", - "type": "Point", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 38, - "description": "The rotation of the object in radians.", - "itemtype": "property", - "name": "rotation", - "type": "Number", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 46, - "description": "The opacity of the object.", - "itemtype": "property", - "name": "alpha", - "type": "Number", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 54, - "description": "The visibility of the object.", - "itemtype": "property", - "name": "visible", - "type": "Boolean", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 62, - "description": "This is the defined area that will pick up mouse / touch events. It is null by default.\nSetting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)", - "itemtype": "property", - "name": "hitArea", - "type": "Rectangle|Circle|Ellipse|Polygon", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 71, - "description": "This is used to indicate if the displayObject should display a mouse hand cursor on rollover", - "itemtype": "property", - "name": "buttonMode", - "type": "Boolean", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 79, - "description": "Can this object be rendered", - "itemtype": "property", - "name": "renderable", - "type": "Boolean", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 87, - "description": "[read-only] The display object container that contains this display object.", - "itemtype": "property", - "name": "parent", - "type": "DisplayObjectContainer", - "readonly": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 96, - "description": "[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.", - "itemtype": "property", - "name": "stage", - "type": "Stage", - "readonly": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 105, - "description": "[read-only] The multiplied alpha of the displayObject", - "itemtype": "property", - "name": "worldAlpha", - "type": "Number", - "readonly": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 114, - "description": "[read-only] Whether or not the object is interactive, do not toggle directly! use the `interactive` property", - "itemtype": "property", - "name": "_interactive", - "type": "Boolean", - "readonly": "", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 124, - "description": "This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true", - "itemtype": "property", - "name": "defaultCursor", - "type": "String", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 133, - "description": "[read-only] Current transform of the object based on world (parent) factors", - "itemtype": "property", - "name": "worldTransform", - "type": "Matrix", - "readonly": "", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 143, - "description": "cached sin rotation and cos rotation", - "itemtype": "property", - "name": "_sr", - "type": "Number", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 152, - "description": "cached sin rotation and cos rotation", - "itemtype": "property", - "name": "_cr", - "type": "Number", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 161, - "description": "The area the filter is applied to like the hitArea this is used as more of an optimisation\nrather than figuring out the dimensions of the displayObject each frame you can set this rectangle", - "itemtype": "property", - "name": "filterArea", - "type": "Rectangle", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 170, - "description": "The original, cached bounds of the object", - "itemtype": "property", - "name": "_bounds", - "type": "Rectangle", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 179, - "description": "The most up-to-date bounds of the object", - "itemtype": "property", - "name": "_currentBounds", - "type": "Rectangle", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 188, - "description": "The original, cached mask of the object", - "itemtype": "property", - "name": "_currentBounds", - "type": "Rectangle", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 197, - "description": "Cached internal flag.", - "itemtype": "property", - "name": "_cacheAsBitmap", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 206, - "description": "Cached internal flag.", - "itemtype": "property", - "name": "_cacheIsDirty", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 220, - "description": "A callback that is used when the users mouse rolls over the displayObject", - "itemtype": "method", - "name": "mouseover", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 226, - "description": "A callback that is used when the users mouse leaves the displayObject", - "itemtype": "method", - "name": "mouseout", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 233, - "description": "A callback that is used when the users clicks on the displayObject with their mouse's left button", - "itemtype": "method", - "name": "click", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 239, - "description": "A callback that is used when the user clicks the mouse's left button down over the sprite", - "itemtype": "method", - "name": "mousedown", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 245, - "description": "A callback that is used when the user releases the mouse's left button that was over the displayObject\nfor this callback to be fired, the mouse's left button must have been pressed down over the displayObject", - "itemtype": "method", - "name": "mouseup", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 252, - "description": "A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject\nfor this callback to be fired, the mouse's left button must have been pressed down over the displayObject", - "itemtype": "method", - "name": "mouseupoutside", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 260, - "description": "A callback that is used when the users clicks on the displayObject with their mouse's right button", - "itemtype": "method", - "name": "rightclick", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 266, - "description": "A callback that is used when the user clicks the mouse's right button down over the sprite", - "itemtype": "method", - "name": "rightdown", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 272, - "description": "A callback that is used when the user releases the mouse's right button that was over the displayObject\nfor this callback to be fired the mouse's right button must have been pressed down over the displayObject", - "itemtype": "method", - "name": "rightup", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 279, - "description": "A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject\nfor this callback to be fired, the mouse's right button must have been pressed down over the displayObject", - "itemtype": "method", - "name": "rightupoutside", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 290, - "description": "A callback that is used when the users taps on the sprite with their finger\nbasically a touch version of click", - "itemtype": "method", - "name": "tap", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 297, - "description": "A callback that is used when the user touches over the displayObject", - "itemtype": "method", - "name": "touchstart", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 303, - "description": "A callback that is used when the user releases a touch over the displayObject", - "itemtype": "method", - "name": "touchend", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 309, - "description": "A callback that is used when the user releases the touch that was over the displayObject\nfor this callback to be fired, The touch must have started over the sprite", - "itemtype": "method", - "name": "touchendoutside", - "params": [ - { - "name": "interactionData", - "description": "", - "type": "InteractionData" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 320, - "description": "Indicates if the sprite will have touch and mouse interactivity. It is false by default", - "itemtype": "property", - "name": "interactive", - "type": "Boolean", - "default": "false", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 340, - "description": "[read-only] Indicates if the sprite is globally visible.", - "itemtype": "property", - "name": "worldVisible", - "type": "Boolean", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 361, - "description": "Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.\nIn PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping.\nTo remove a mask, set this property to null.", - "itemtype": "property", - "name": "mask", - "type": "Graphics", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 381, - "description": "Sets the filters for the displayObject.\n* IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer.\nTo remove filters simply set this property to 'null'", - "itemtype": "property", - "name": "filters", - "type": "Array An array of filters", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 417, - "description": "Set if this display object is cached as a bitmap.\nThis basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects.\nTo remove simply set this property to 'null'", - "itemtype": "property", - "name": "cacheAsBitmap", - "type": "Boolean", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 523, - "description": "Retrieves the bounds of the displayObject as a rectangle object", - "itemtype": "method", - "name": "getBounds", - "params": [ - { - "name": "matrix", - "description": "", - "type": "Matrix" - } - ], - "return": { - "description": "the rectangular bounding area", - "type": "Rectangle" - }, - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 536, - "description": "Retrieves the local bounds of the displayObject as a rectangle object", - "itemtype": "method", - "name": "getLocalBounds", - "return": { - "description": "the rectangular bounding area", - "type": "Rectangle" - }, - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 547, - "description": "Sets the object's stage reference, the stage this object is connected to", - "itemtype": "method", - "name": "setStageReference", - "params": [ - { - "name": "stage", - "description": "the stage that the object will have as its current stage reference", - "type": "Stage" - } - ], - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 559, - "description": "Useful function that returns a texture of the displayObject object that can then be used to create sprites\nThis can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.", - "itemtype": "method", - "name": "generateTexture", - "params": [ - { - "name": "resolution", - "description": "The resolution of the texture being generated", - "type": "Number" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - }, - { - "name": "renderer", - "description": "The renderer used to generate the texture.", - "type": "CanvasRenderer|WebGLRenderer" - } - ], - "return": { - "description": "a texture of the graphics object", - "type": "Texture" - }, - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 583, - "description": "Generates and updates the cached sprite for this object.", - "itemtype": "method", - "name": "updateCache", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 593, - "description": "Calculates the global position of the display object", - "itemtype": "method", - "name": "toGlobal", - "params": [ - { - "name": "position", - "description": "The world origin to calculate from", - "type": "Point" - } - ], - "return": { - "description": "A point object representing the position of this object", - "type": "Point" - }, - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 606, - "description": "Calculates the local position of the display object relative to another point", - "itemtype": "method", - "name": "toLocal", - "params": [ - { - "name": "position", - "description": "The world origin to calculate from", - "type": "Point" - }, - { - "name": "from", - "description": "The DisplayObject to calculate the global position from", - "type": "DisplayObject", - "optional": true - } - ], - "return": { - "description": "A point object representing the position of this object", - "type": "Point" - }, - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 626, - "description": "Internal method.", - "itemtype": "method", - "name": "_renderCachedSprite", - "params": [ - { - "name": "renderSession", - "description": "The render session", - "type": "Object" - } - ], - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 647, - "description": "Internal method.", - "itemtype": "method", - "name": "_generateCachedSprite", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 689, - "description": "Destroys the cached sprite.", - "itemtype": "method", - "name": "_destroyCachedSprite", - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 705, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 719, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 736, - "description": "The position of the displayObject on the x axis relative to the local coordinates of the parent.", - "itemtype": "property", - "name": "x", - "type": "Number", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObject.js", - "line": 751, - "description": "The position of the displayObject on the y axis relative to the local coordinates of the parent.", - "itemtype": "property", - "name": "y", - "type": "Number", - "class": "DisplayObject" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 17, - "description": "[read-only] The array of children of this container.", - "itemtype": "property", - "name": "children", - "type": "Array", - "readonly": "", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 35, - "description": "The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 63, - "description": "The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 90, - "description": "Adds a child to the container.", - "itemtype": "method", - "name": "addChild", - "params": [ - { - "name": "child", - "description": "The DisplayObject to add to the container", - "type": "DisplayObject" - } - ], - "return": { - "description": "The child that was added.", - "type": "DisplayObject" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 102, - "description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown", - "itemtype": "method", - "name": "addChildAt", - "params": [ - { - "name": "child", - "description": "The child to add", - "type": "DisplayObject" - }, - { - "name": "index", - "description": "The index to place the child in", - "type": "Number" - } - ], - "return": { - "description": "The child that was added.", - "type": "DisplayObject" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 133, - "description": "Swaps the position of 2 Display Objects within this container.", - "itemtype": "method", - "name": "swapChildren", - "params": [ - { - "name": "child", - "description": "", - "type": "DisplayObject" - }, - { - "name": "child2", - "description": "", - "type": "DisplayObject" - } - ], - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 158, - "description": "Returns the index position of a child DisplayObject instance", - "itemtype": "method", - "name": "getChildIndex", - "params": [ - { - "name": "child", - "description": "The DisplayObject instance to identify", - "type": "DisplayObject" - } - ], - "return": { - "description": "The index position of the child display object to identify", - "type": "Number" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 175, - "description": "Changes the position of an existing child in the display object container", - "itemtype": "method", - "name": "setChildIndex", - "params": [ - { - "name": "child", - "description": "The child DisplayObject instance for which you want to change the index number", - "type": "DisplayObject" - }, - { - "name": "index", - "description": "The resulting index number for the child display object", - "type": "Number" - } - ], - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 193, - "description": "Returns the child at the specified index", - "itemtype": "method", - "name": "getChildAt", - "params": [ - { - "name": "index", - "description": "The index to get the child from", - "type": "Number" - } - ], - "return": { - "description": "The child at the given index, if any.", - "type": "DisplayObject" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 210, - "description": "Removes a child from the container.", - "itemtype": "method", - "name": "removeChild", - "params": [ - { - "name": "child", - "description": "The DisplayObject to remove", - "type": "DisplayObject" - } - ], - "return": { - "description": "The child that was removed.", - "type": "DisplayObject" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 225, - "description": "Removes a child from the specified index position.", - "itemtype": "method", - "name": "removeChildAt", - "params": [ - { - "name": "index", - "description": "The index to get the child from", - "type": "Number" - } - ], - "return": { - "description": "The child that was removed.", - "type": "DisplayObject" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 243, - "description": "Removes all children from this container that are within the begin and end indexes.", - "itemtype": "method", - "name": "removeChildren", - "params": [ - { - "name": "beginIndex", - "description": "The beginning position. Default value is 0.", - "type": "Number" - }, - { - "name": "endIndex", - "description": "The ending position. Default value is size of the container.", - "type": "Number" - } - ], - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 302, - "description": "Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.", - "itemtype": "method", - "name": "getBounds", - "return": { - "description": "The rectangular bounding area", - "type": "Rectangle" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 362, - "description": "Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.", - "itemtype": "method", - "name": "getLocalBounds", - "return": { - "description": "The rectangular bounding area", - "type": "Rectangle" - }, - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 386, - "description": "Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.", - "itemtype": "method", - "name": "setStageReference", - "params": [ - { - "name": "stage", - "description": "the stage that the container will have as its current stage reference", - "type": "Stage" - } - ], - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 404, - "description": "Removes the current stage reference from the container and all of its children.", - "itemtype": "method", - "name": "removeStageReference", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 423, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/DisplayObjectContainer.js", - "line": 482, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "DisplayObjectContainer" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 17, - "description": "The array of textures that make up the animation", - "itemtype": "property", - "name": "textures", - "type": "Array", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 25, - "description": "The speed that the MovieClip will play at. Higher is faster, lower is slower", - "itemtype": "property", - "name": "animationSpeed", - "type": "Number", - "default": "1", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 34, - "description": "Whether or not the movie clip repeats after playing.", - "itemtype": "property", - "name": "loop", - "type": "Boolean", - "default": "true", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 43, - "description": "Function to call when a MovieClip finishes playing", - "itemtype": "property", - "name": "onComplete", - "type": "Function", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 51, - "description": "[read-only] The MovieClips current frame index (this may not have to be a whole number)", - "itemtype": "property", - "name": "currentFrame", - "type": "Number", - "default": "0", - "readonly": "", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 61, - "description": "[read-only] Indicates if the MovieClip is currently playing", - "itemtype": "property", - "name": "playing", - "type": "Boolean", - "readonly": "", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 75, - "description": "[read-only] totalFrames is the total number of frames in the MovieClip. This is the same as number of textures\nassigned to the MovieClip.", - "itemtype": "property", - "name": "totalFrames", - "type": "Number", - "default": "0", - "readonly": "", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 91, - "description": "Stops the MovieClip", - "itemtype": "method", - "name": "stop", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 101, - "description": "Plays the MovieClip", - "itemtype": "method", - "name": "play", - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 111, - "description": "Stops the MovieClip and goes to a specific frame", - "itemtype": "method", - "name": "gotoAndStop", - "params": [ - { - "name": "frameNumber", - "description": "frame index to stop at", - "type": "Number" - } - ], - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 125, - "description": "Goes to a specific frame and begins playing the MovieClip", - "itemtype": "method", - "name": "gotoAndPlay", - "params": [ - { - "name": "frameNumber", - "description": "frame index to start at", - "type": "Number" - } - ], - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 169, - "description": "A short hand way of creating a movieclip from an array of frame ids", - "static": 1, - "itemtype": "method", - "name": "fromFrames", - "params": [ - { - "name": "frames", - "description": "the array of frames ids the movieclip will use as its texture frames", - "type": "Array" - } - ], - "class": "MovieClip" - }, - { - "file": "src/pixi/display/MovieClip.js", - "line": 188, - "description": "A short hand way of creating a movieclip from an array of image ids", - "static": 1, - "itemtype": "method", - "name": "fromImages", - "params": [ - { - "name": "frames", - "description": "the array of image ids the movieclip will use as its texture frames", - "type": "Array" - } - ], - "class": "MovieClip" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 22, - "description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the texture's origin is the top left\nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right corner", - "itemtype": "property", - "name": "anchor", - "type": "Point", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 33, - "description": "The texture that the sprite is using", - "itemtype": "property", - "name": "texture", - "type": "Texture", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 41, - "description": "The width of the sprite (this is initially set by the texture)", - "itemtype": "property", - "name": "_width", - "type": "Number", - "access": "private", - "tagname": "", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 50, - "description": "The height of the sprite (this is initially set by the texture)", - "itemtype": "property", - "name": "_height", - "type": "Number", - "access": "private", - "tagname": "", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 59, - "description": "The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.", - "itemtype": "property", - "name": "tint", - "type": "Number", - "default": "0xFFFFFF", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 68, - "description": "The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.", - "itemtype": "property", - "name": "blendMode", - "type": "Number", - "default": "PIXI.blendModes.NORMAL;", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 77, - "description": "The shader that will be used to render the texture to the stage. Set to null to remove a current shader.", - "itemtype": "property", - "name": "shader", - "type": "PIXI.AbstractFilter", - "default": "null", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 103, - "description": "The width of the sprite, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 119, - "description": "The height of the sprite, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 135, - "description": "Sets the texture of the sprite", - "itemtype": "method", - "name": "setTexture", - "params": [ - { - "name": "texture", - "description": "The PIXI texture that is displayed by the sprite", - "type": "Texture" - } - ], - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 147, - "description": "When the texture is updated, this event will fire to update the scale and frame", - "itemtype": "method", - "name": "onTextureUpdate", - "params": [ - { - "name": "event", - "description": "" - } - ], - "access": "private", - "tagname": "", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 163, - "description": "Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account.", - "itemtype": "method", - "name": "getBounds", - "params": [ - { - "name": "matrix", - "description": "the transformation matrix of the sprite", - "type": "Matrix" - } - ], - "return": { - "description": "the framing rectangle", - "type": "Rectangle" - }, - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 242, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 305, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 418, - "description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId\n The frame ids are created when a Texture packer file has been loaded", - "itemtype": "method", - "name": "fromFrame", - "static": 1, - "params": [ - { - "name": "frameId", - "description": "The frame Id of the texture in the cache", - "type": "String" - } - ], - "return": { - "description": "A new Sprite using a texture from the texture cache matching the frameId", - "type": "Sprite" - }, - "class": "Sprite" - }, - { - "file": "src/pixi/display/Sprite.js", - "line": 435, - "description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded", - "itemtype": "method", - "name": "fromImage", - "static": 1, - "params": [ - { - "name": "imageId", - "description": "The image url of the texture", - "type": "String" - } - ], - "return": { - "description": "A new Sprite using a texture from the texture cache matching the image id", - "type": "Sprite" - }, - "class": "Sprite" - }, - { - "file": "src/pixi/display/SpriteBatch.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/", - "class": "SpriteBatch" - }, - { - "file": "src/pixi/display/SpriteBatch.js", - "line": 66, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "SpriteBatch" - }, - { - "file": "src/pixi/display/SpriteBatch.js", - "line": 90, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "SpriteBatch" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 25, - "description": "[read-only] Current transform of the object based on world (parent) factors", - "itemtype": "property", - "name": "worldTransform", - "type": "Matrix", - "readonly": "", - "access": "private", - "tagname": "", - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 35, - "description": "Whether or not the stage is interactive", - "itemtype": "property", - "name": "interactive", - "type": "Boolean", - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 43, - "description": "The interaction manage for this stage, manages all interactive activity on the stage", - "itemtype": "property", - "name": "interactionManager", - "type": "InteractionManager", - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 51, - "description": "Whether the stage is dirty and needs to have interactions updated", - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 73, - "description": "Sets another DOM element which can receive mouse/touch interactions instead of the default Canvas element.\nThis is useful for when you have other DOM elements on top of the Canvas element.", - "itemtype": "method", - "name": "setInteractionDelegate", - "params": [ - { - "name": "domElement", - "description": "This new domElement which will receive mouse/touch events", - "type": "DOMElement" - } - ], - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 110, - "description": "Sets the background color for the stage", - "itemtype": "method", - "name": "setBackgroundColor", - "params": [ - { - "name": "backgroundColor", - "description": "the color of the background, easiest way to pass this in is in hex format\n like: 0xFFFFFF for white", - "type": "Number" - } - ], - "class": "Stage" - }, - { - "file": "src/pixi/display/Stage.js", - "line": 126, - "description": "This will return the point containing global coordinates of the mouse.", - "itemtype": "method", - "name": "getMousePosition", - "return": { - "description": "A point containing the coordinates of the global InteractionData position.", - "type": "Point" - }, - "class": "Stage" - }, - { - "file": "src/pixi/extras/Rope.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "copyright": "Mat Groves, Rovanion Luckey", - "class": "Rope" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23\nbased on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi\n\nAwesome JS run time provided by EsotericSoftware\nhttps://github.com/EsotericSoftware/spine-runtimes", - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 213, - "description": "cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of", - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 506, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 513, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 520, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 528, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 535, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 542, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 577, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 585, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 600, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 604, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 611, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 618, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 625, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 637, - "description": "from the new skin are attached if the corresponding attachment from the old skin was attached.", - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 644, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 648, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 657, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 849, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 855, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 861, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 867, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 885, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Spine.js", - "line": 1310, - "class": "Spine" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/", - "class": "Strip" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 20, - "description": "The texture of the strip", - "itemtype": "property", - "name": "texture", - "type": "Texture", - "class": "Strip" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 43, - "description": "Whether the strip is dirty or not", - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "class": "Strip" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 52, - "description": "if you need a padding, not yet implemented", - "itemtype": "property", - "name": "padding", - "type": "Number", - "class": "Strip" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 293, - "description": "Renders a flat strip", - "itemtype": "method", - "name": "renderStripFlat", - "params": [ - { - "name": "strip", - "description": "The Strip to render", - "type": "Strip" - } - ], - "access": "private", - "tagname": "", - "class": "Strip" - }, - { - "file": "src/pixi/extras/Strip.js", - "line": 341, - "description": "When the texture is updated, this event will fire to update the scale and frame", - "itemtype": "method", - "name": "onTextureUpdate", - "params": [ - { - "name": "event", - "description": "" - } - ], - "access": "private", - "tagname": "", - "class": "Strip" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 19, - "description": "The with of the tiling sprite", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 27, - "description": "The height of the tiling sprite", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 35, - "description": "The scaling of the image that is being tiled", - "itemtype": "property", - "name": "tileScale", - "type": "Point", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 43, - "description": "A point that represents the scale of the texture object", - "itemtype": "property", - "name": "tileScaleOffset", - "type": "Point", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 51, - "description": "The offset position of the image that is being tiled", - "itemtype": "property", - "name": "tilePosition", - "type": "Point", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 59, - "description": "Whether this sprite is renderable or not", - "itemtype": "property", - "name": "renderable", - "type": "Boolean", - "default": "true", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 68, - "description": "The tint applied to the sprite. This is a hex value", - "itemtype": "property", - "name": "tint", - "type": "Number", - "default": "0xFFFFFF", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 77, - "description": "The blend mode to be applied to the sprite", - "itemtype": "property", - "name": "blendMode", - "type": "Number", - "default": "PIXI.blendModes.NORMAL;", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 95, - "description": "The width of the sprite, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 111, - "description": "The height of the TilingSprite, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 137, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 194, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 280, - "description": "Returns the framing rectangle of the sprite as a PIXI.Rectangle object", - "itemtype": "method", - "name": "getBounds", - "return": { - "description": "the framing rectangle", - "type": "Rectangle" - }, - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 360, - "description": "When the texture is updated, this event will fire to update the scale and frame", - "itemtype": "method", - "name": "onTextureUpdate", - "params": [ - { - "name": "event", - "description": "" - } - ], - "access": "private", - "tagname": "", - "class": "TilingSprite" - }, - { - "file": "src/pixi/extras/TilingSprite.js", - "line": 373, - "itemtype": "method", - "name": "generateTilingTexture", - "params": [ - { - "name": "forcePowerOfTwo", - "description": "Whether we want to force the texture to be a power of two", - "type": "Boolean" - } - ], - "class": "TilingSprite" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 15, - "description": "An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion.\nFor example the blur filter has two passes blurX and blurY.", - "itemtype": "property", - "name": "passes", - "type": "Array an array of filter objects", - "access": "private", - "tagname": "", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 24, - "itemtype": "property", - "name": "shaders", - "type": "Array an array of shaders", - "access": "private", - "tagname": "", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 31, - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 37, - "itemtype": "property", - "name": "padding", - "type": "Number", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 43, - "itemtype": "property", - "name": "uniforms", - "type": "object", - "access": "private", - "tagname": "", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 50, - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "access": "private", - "tagname": "", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AbstractFilter.js", - "line": 60, - "description": "Syncs the uniforms between the class object and the shaders.", - "itemtype": "method", - "name": "syncUniforms", - "class": "AbstractFilter" - }, - { - "file": "src/pixi/filters/AlphaMaskFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "AlphaMaskFilter" - }, - { - "file": "src/pixi/filters/AlphaMaskFilter.js", - "line": 71, - "description": "Sets the map dimensions uniforms when the texture becomes available.", - "itemtype": "method", - "name": "onTextureLoaded", - "class": "AlphaMaskFilter" - }, - { - "file": "src/pixi/filters/AlphaMaskFilter.js", - "line": 84, - "description": "The texture used for the displacement map. Must be power of 2 sized texture.", - "itemtype": "property", - "name": "map", - "type": "Texture", - "class": "AlphaMaskFilter" - }, - { - "file": "src/pixi/filters/AsciiFilter.js", - "line": 1, - "author": "Vico @vicocotea\noriginal shader : https://www.shadertoy.com/view/lssGDj by @movAX13h", - "class": "AsciiFilter" - }, - { - "file": "src/pixi/filters/AsciiFilter.js", - "line": 73, - "description": "The pixel size used by the filter.", - "itemtype": "property", - "name": "size", - "type": "Number", - "class": "AsciiFilter" - }, - { - "file": "src/pixi/filters/BlurFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BlurFilter" - }, - { - "file": "src/pixi/filters/BlurFilter.js", - "line": 24, - "description": "Sets the strength of both the blurX and blurY properties simultaneously", - "itemtype": "property", - "name": "blur", - "type": "Number the strength of the blur", - "default": "2", - "class": "BlurFilter" - }, - { - "file": "src/pixi/filters/BlurFilter.js", - "line": 40, - "description": "Sets the strength of the blurX property", - "itemtype": "property", - "name": "blurX", - "type": "Number the strength of the blurX", - "default": "2", - "class": "BlurFilter" - }, - { - "file": "src/pixi/filters/BlurFilter.js", - "line": 56, - "description": "Sets the strength of the blurY property", - "itemtype": "property", - "name": "blurY", - "type": "Number the strength of the blurY", - "default": "2", - "class": "BlurFilter" - }, - { - "file": "src/pixi/filters/BlurXFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BlurXFilter" - }, - { - "file": "src/pixi/filters/BlurXFilter.js", - "line": 51, - "description": "Sets the strength of both the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number the strength of the blur", - "default": "2", - "class": "BlurXFilter" - }, - { - "file": "src/pixi/filters/BlurYFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BlurYFilter" - }, - { - "file": "src/pixi/filters/BlurYFilter.js", - "line": 51, - "description": "Sets the strength of both the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number the strength of the blur", - "default": "2", - "class": "BlurYFilter" - }, - { - "file": "src/pixi/filters/ColorMatrixFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "ColorMatrixFilter" - }, - { - "file": "src/pixi/filters/ColorMatrixFilter.js", - "line": 46, - "description": "Sets the matrix of the color matrix filter", - "itemtype": "property", - "name": "matrix", - "type": "Array and array of 26 numbers", - "default": "[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]", - "class": "ColorMatrixFilter" - }, - { - "file": "src/pixi/filters/ColorStepFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "ColorStepFilter" - }, - { - "file": "src/pixi/filters/ColorStepFilter.js", - "line": 41, - "description": "The number of steps to reduce the palette by.", - "itemtype": "property", - "name": "step", - "type": "Number", - "class": "ColorStepFilter" - }, - { - "file": "src/pixi/filters/ConvolutionFilter.js", - "line": 63, - "description": "An array of values used for matrix transformation. Specified as a 9 point Array.", - "itemtype": "property", - "name": "matrix", - "type": "Array", - "class": "ConvolutionFilter" - }, - { - "file": "src/pixi/filters/ConvolutionFilter.js", - "line": 78, - "description": "Width of the object you are transforming", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "ConvolutionFilter" - }, - { - "file": "src/pixi/filters/ConvolutionFilter.js", - "line": 93, - "description": "Height of the object you are transforming", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "ConvolutionFilter" - }, - { - "file": "src/pixi/filters/CrossHatchFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CrossHatchFilter" - }, - { - "file": "src/pixi/filters/CrossHatchFilter.js", - "line": 65, - "description": "Sets the strength of both the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number the strength of the blur", - "default": "2", - "class": "CrossHatchFilter" - }, - { - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "DisplacementFilter" - }, - { - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 78, - "description": "Sets the map dimensions uniforms when the texture becomes available.", - "itemtype": "method", - "name": "onTextureLoaded", - "class": "DisplacementFilter" - }, - { - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 91, - "description": "The texture used for the displacement map. Must be power of 2 texture.", - "itemtype": "property", - "name": "map", - "type": "Texture", - "class": "DisplacementFilter" - }, - { - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 106, - "description": "The multiplier used to scale the displacement result from the map calculation.", - "itemtype": "property", - "name": "scale", - "type": "Point", - "class": "DisplacementFilter" - }, - { - "file": "src/pixi/filters/DisplacementFilter.js", - "line": 121, - "description": "The offset used to move the displacement map.", - "itemtype": "property", - "name": "offset", - "type": "Point", - "class": "DisplacementFilter" - }, - { - "file": "src/pixi/filters/DotScreenFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23\noriginal filter: https://github.com/evanw/glfx.js/blob/master/src/filters/fun/dotscreen.js", - "class": "DotScreenFilter" - }, - { - "file": "src/pixi/filters/DotScreenFilter.js", - "line": 57, - "description": "The scale of the effect.", - "itemtype": "property", - "name": "scale", - "type": "Number", - "class": "DotScreenFilter" - }, - { - "file": "src/pixi/filters/DotScreenFilter.js", - "line": 72, - "description": "The radius of the effect.", - "itemtype": "property", - "name": "angle", - "type": "Number", - "class": "DotScreenFilter" - }, - { - "file": "src/pixi/filters/FilterBlock.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "FilterBlock" - }, - { - "file": "src/pixi/filters/FilterBlock.js", - "line": 13, - "description": "The visible state of this FilterBlock.", - "itemtype": "property", - "name": "visible", - "type": "Boolean", - "class": "FilterBlock" - }, - { - "file": "src/pixi/filters/FilterBlock.js", - "line": 21, - "description": "The renderable state of this FilterBlock.", - "itemtype": "property", - "name": "renderable", - "type": "Boolean", - "class": "FilterBlock" - }, - { - "file": "src/pixi/filters/GrayFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "GrayFilter" - }, - { - "file": "src/pixi/filters/GrayFilter.js", - "line": 41, - "description": "The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color.", - "itemtype": "property", - "name": "gray", - "type": "Number", - "class": "GrayFilter" - }, - { - "file": "src/pixi/filters/InvertFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "InvertFilter" - }, - { - "file": "src/pixi/filters/InvertFilter.js", - "line": 42, - "description": "The strength of the invert. 1 will fully invert the colors, 0 will make the object its normal color", - "itemtype": "property", - "name": "invert", - "type": "Number", - "class": "InvertFilter" - }, - { - "file": "src/pixi/filters/NoiseFilter.js", - "line": 1, - "author": "Vico @vicocotea\noriginal filter: https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js", - "class": "NoiseFilter" - }, - { - "file": "src/pixi/filters/NoiseFilter.js", - "line": 49, - "description": "The amount of noise to apply.", - "itemtype": "property", - "name": "noise", - "type": "Number", - "class": "NoiseFilter" - }, - { - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "NormalMapFilter" - }, - { - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 140, - "description": "Sets the map dimensions uniforms when the texture becomes available.", - "itemtype": "method", - "name": "onTextureLoaded", - "class": "NormalMapFilter" - }, - { - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 153, - "description": "The texture used for the displacement map. Must be power of 2 texture.", - "itemtype": "property", - "name": "map", - "type": "Texture", - "class": "NormalMapFilter" - }, - { - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 168, - "description": "The multiplier used to scale the displacement result from the map calculation.", - "itemtype": "property", - "name": "scale", - "type": "Point", - "class": "NormalMapFilter" - }, - { - "file": "src/pixi/filters/NormalMapFilter.js", - "line": 183, - "description": "The offset used to move the displacement map.", - "itemtype": "property", - "name": "offset", - "type": "Point", - "class": "NormalMapFilter" - }, - { - "file": "src/pixi/filters/PixelateFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "PixelateFilter" - }, - { - "file": "src/pixi/filters/PixelateFilter.js", - "line": 48, - "description": "This a point that describes the size of the blocks. x is the width of the block and y is the height.", - "itemtype": "property", - "name": "size", - "type": "Point", - "class": "PixelateFilter" - }, - { - "file": "src/pixi/filters/RGBSplitFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "RGBSplitFilter" - }, - { - "file": "src/pixi/filters/RGBSplitFilter.js", - "line": 48, - "description": "Red channel offset.", - "itemtype": "property", - "name": "red", - "type": "Point", - "class": "RGBSplitFilter" - }, - { - "file": "src/pixi/filters/RGBSplitFilter.js", - "line": 63, - "description": "Green channel offset.", - "itemtype": "property", - "name": "green", - "type": "Point", - "class": "RGBSplitFilter" - }, - { - "file": "src/pixi/filters/RGBSplitFilter.js", - "line": 78, - "description": "Blue offset.", - "itemtype": "property", - "name": "blue", - "type": "Point", - "class": "RGBSplitFilter" - }, - { - "file": "src/pixi/filters/SepiaFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "SepiaFilter" - }, - { - "file": "src/pixi/filters/SepiaFilter.js", - "line": 43, - "description": "The strength of the sepia. 1 will apply the full sepia effect, 0 will make the object its normal color.", - "itemtype": "property", - "name": "sepia", - "type": "Number", - "class": "SepiaFilter" - }, - { - "file": "src/pixi/filters/SmartBlurFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "SmartBlurFilter" - }, - { - "file": "src/pixi/filters/SmartBlurFilter.js", - "line": 61, - "description": "The strength of the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number the strength of the blur", - "default": "2", - "class": "SmartBlurFilter" - }, - { - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 1, - "author": "Vico @vicocotea\noriginal filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/", - "class": "TiltShiftFilter" - }, - { - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 24, - "description": "The strength of the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number", - "class": "TiltShiftFilter" - }, - { - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 39, - "description": "The strength of the gradient blur.", - "itemtype": "property", - "name": "gradientBlur", - "type": "Number", - "class": "TiltShiftFilter" - }, - { - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 54, - "description": "The Y value to start the effect at.", - "itemtype": "property", - "name": "start", - "type": "Number", - "class": "TiltShiftFilter" - }, - { - "file": "src/pixi/filters/TiltShiftFilter.js", - "line": 69, - "description": "The Y value to end the effect at.", - "itemtype": "property", - "name": "end", - "type": "Number", - "class": "TiltShiftFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 1, - "author": "Vico @vicocotea\noriginal filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 72, - "description": "The strength of the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 88, - "description": "The strength of the gradient blur.", - "itemtype": "property", - "name": "gradientBlur", - "type": "Number", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 104, - "description": "The X value to start the effect at.", - "itemtype": "property", - "name": "start", - "type": "Number", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 121, - "description": "The X value to end the effect at.", - "itemtype": "property", - "name": "end", - "type": "Number", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftXFilter.js", - "line": 138, - "description": "Updates the filter delta values.", - "itemtype": "method", - "name": "updateDelta", - "class": "TiltShiftXFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 1, - "author": "Vico @vicocotea\noriginal filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 72, - "description": "The strength of the blur.", - "itemtype": "property", - "name": "blur", - "type": "Number", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 88, - "description": "The strength of the gradient blur.", - "itemtype": "property", - "name": "gradientBlur", - "type": "Number", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 104, - "description": "The Y value to start the effect at.", - "itemtype": "property", - "name": "start", - "type": "Number", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 121, - "description": "The Y value to end the effect at.", - "itemtype": "property", - "name": "end", - "type": "Number", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TiltShiftYFilter.js", - "line": 138, - "description": "Updates the filter delta values.", - "itemtype": "method", - "name": "updateDelta", - "class": "TiltShiftYFilter" - }, - { - "file": "src/pixi/filters/TwistFilter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "TwistFilter" - }, - { - "file": "src/pixi/filters/TwistFilter.js", - "line": 56, - "description": "This point describes the the offset of the twist.", - "itemtype": "property", - "name": "offset", - "type": "Point", - "class": "TwistFilter" - }, - { - "file": "src/pixi/filters/TwistFilter.js", - "line": 72, - "description": "This radius of the twist.", - "itemtype": "property", - "name": "radius", - "type": "Number", - "class": "TwistFilter" - }, - { - "file": "src/pixi/filters/TwistFilter.js", - "line": 88, - "description": "This angle of the twist.", - "itemtype": "property", - "name": "angle", - "type": "Number", - "class": "TwistFilter" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 1, - "author": "Chad Engler ", - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 16, - "itemtype": "property", - "name": "x", - "type": "Number", - "default": "0", - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 23, - "itemtype": "property", - "name": "y", - "type": "Number", - "default": "0", - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 30, - "itemtype": "property", - "name": "radius", - "type": "Number", - "default": "0", - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 38, - "description": "Creates a clone of this Circle instance", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the Circle", - "type": "Circle" - }, - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 49, - "description": "Checks whether the x and y coordinates given are contained within this circle", - "itemtype": "method", - "name": "contains", - "params": [ - { - "name": "x", - "description": "The X coordinate of the point to test", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the point to test", - "type": "Number" - } - ], - "return": { - "description": "Whether the x/y coordinates are within this Circle", - "type": "Boolean" - }, - "class": "Circle" - }, - { - "file": "src/pixi/geom/Circle.js", - "line": 72, - "description": "Returns the framing rectangle of the circle as a PIXI.Rectangle object", - "itemtype": "method", - "name": "getBounds", - "return": { - "description": "the framing rectangle", - "type": "Rectangle" - }, - "class": "Circle" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 1, - "author": "Chad Engler ", - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 17, - "itemtype": "property", - "name": "x", - "type": "Number", - "default": "0", - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 24, - "itemtype": "property", - "name": "y", - "type": "Number", - "default": "0", - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 31, - "itemtype": "property", - "name": "width", - "type": "Number", - "default": "0", - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 38, - "itemtype": "property", - "name": "height", - "type": "Number", - "default": "0", - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 46, - "description": "Creates a clone of this Ellipse instance", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the ellipse", - "type": "Ellipse" - }, - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 57, - "description": "Checks whether the x and y coordinates given are contained within this ellipse", - "itemtype": "method", - "name": "contains", - "params": [ - { - "name": "x", - "description": "The X coordinate of the point to test", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the point to test", - "type": "Number" - } - ], - "return": { - "description": "Whether the x/y coords are within this ellipse", - "type": "Boolean" - }, - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Ellipse.js", - "line": 80, - "description": "Returns the framing rectangle of the ellipse as a PIXI.Rectangle object", - "itemtype": "method", - "name": "getBounds", - "return": { - "description": "the framing rectangle", - "type": "Rectangle" - }, - "class": "Ellipse" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 17, - "itemtype": "property", - "name": "a", - "type": "Number", - "default": "1", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 24, - "itemtype": "property", - "name": "b", - "type": "Number", - "default": "0", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 31, - "itemtype": "property", - "name": "c", - "type": "Number", - "default": "0", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 38, - "itemtype": "property", - "name": "d", - "type": "Number", - "default": "1", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 45, - "itemtype": "property", - "name": "tx", - "type": "Number", - "default": "0", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 52, - "itemtype": "property", - "name": "ty", - "type": "Number", - "default": "0", - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 60, - "description": "Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:\n\na = array[0]\nb = array[1]\nc = array[3]\nd = array[4]\ntx = array[2]\nty = array[5]", - "itemtype": "method", - "name": "fromArray", - "params": [ - { - "name": "array", - "description": "The array that the matrix will be populated from.", - "type": "Array" - } - ], - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 83, - "description": "Creates an array from the current Matrix object.", - "itemtype": "method", - "name": "toArray", - "params": [ - { - "name": "transpose", - "description": "Whether we need to transpose the matrix or not", - "type": "Boolean" - } - ], - "return": { - "description": "the newly created array which contains the matrix", - "type": "Array" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 123, - "description": "Get a new position with the current transformation applied.\nCan be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)", - "itemtype": "method", - "name": "apply", - "params": [ - { - "name": "pos", - "description": "The origin", - "type": "Point" - }, - { - "name": "newPos", - "description": "The point that the new position is assigned to (allowed to be same as input)", - "type": "Point", - "optional": true - } - ], - "return": { - "description": "The new point, transformed through this matrix", - "type": "Point" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 142, - "description": "Get a new position with the inverse of the current transformation applied.\nCan be used to go from the world coordinate space to a child's coordinate space. (e.g. input)", - "itemtype": "method", - "name": "applyInverse", - "params": [ - { - "name": "pos", - "description": "The origin", - "type": "Point" - }, - { - "name": "newPos", - "description": "The point that the new position is assigned to (allowed to be same as input)", - "type": "Point", - "optional": true - } - ], - "return": { - "description": "The new point, inverse-transformed through this matrix", - "type": "Point" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 163, - "description": "Translates the matrix on the x and y.", - "itemtype": "method", - "name": "translate", - "params": [ - { - "name": "x", - "description": "", - "type": "Number" - }, - { - "name": "y", - "description": "", - "type": "Number" - } - ], - "return": { - "description": "This matrix. Good for chaining method calls.", - "type": "Matrix" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 179, - "description": "Applies a scale transformation to the matrix.", - "itemtype": "method", - "name": "scale", - "params": [ - { - "name": "x", - "description": "The amount to scale horizontally", - "type": "Number" - }, - { - "name": "y", - "description": "The amount to scale vertically", - "type": "Number" - } - ], - "return": { - "description": "This matrix. Good for chaining method calls.", - "type": "Matrix" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 200, - "description": "Applies a rotation transformation to the matrix.", - "itemtype": "method", - "name": "rotate", - "params": [ - { - "name": "angle", - "description": "The angle in radians.", - "type": "Number" - } - ], - "return": { - "description": "This matrix. Good for chaining method calls.", - "type": "Matrix" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 225, - "description": "Appends the given Matrix to this Matrix.", - "itemtype": "method", - "name": "append", - "params": [ - { - "name": "matrix", - "description": "", - "type": "Matrix" - } - ], - "return": { - "description": "This matrix. Good for chaining method calls.", - "type": "Matrix" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Matrix.js", - "line": 250, - "description": "Resets this Matix to an identity (default) matrix.", - "itemtype": "method", - "name": "identity", - "return": { - "description": "This matrix. Good for chaining method calls.", - "type": "Matrix" - }, - "class": "Matrix" - }, - { - "file": "src/pixi/geom/Point.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Point" - }, - { - "file": "src/pixi/geom/Point.js", - "line": 15, - "itemtype": "property", - "name": "x", - "type": "Number", - "default": "0", - "class": "Point" - }, - { - "file": "src/pixi/geom/Point.js", - "line": 22, - "itemtype": "property", - "name": "y", - "type": "Number", - "default": "0", - "class": "Point" - }, - { - "file": "src/pixi/geom/Point.js", - "line": 30, - "description": "Creates a clone of this point", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the point", - "type": "Point" - }, - "class": "Point" - }, - { - "file": "src/pixi/geom/Point.js", - "line": 41, - "description": "Sets the point to a new x and y position.\nIf y is omitted, both x and y will be set to x.", - "itemtype": "method", - "name": "set", - "params": [ - { - "name": "x", - "description": "position of the point on the x axis", - "type": "Number", - "optional": true, - "optdefault": "0" - }, - { - "name": "y", - "description": "position of the point on the y axis", - "type": "Number", - "optional": true, - "optdefault": "0" - } - ], - "class": "Point" - }, - { - "file": "src/pixi/geom/Polygon.js", - "line": 1, - "author": "Adrien Brault ", - "class": "Polygon" - }, - { - "file": "src/pixi/geom/Polygon.js", - "line": 35, - "description": "Creates a clone of this polygon", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the polygon", - "type": "Polygon" - }, - "class": "Polygon" - }, - { - "file": "src/pixi/geom/Polygon.js", - "line": 47, - "description": "Checks whether the x and y coordinates passed to this function are contained within this polygon", - "itemtype": "method", - "name": "contains", - "params": [ - { - "name": "x", - "description": "The X coordinate of the point to test", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the point to test", - "type": "Number" - } - ], - "return": { - "description": "Whether the x/y coordinates are within this polygon", - "type": "Boolean" - }, - "class": "Polygon" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/", - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 17, - "itemtype": "property", - "name": "x", - "type": "Number", - "default": "0", - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 24, - "itemtype": "property", - "name": "y", - "type": "Number", - "default": "0", - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 31, - "itemtype": "property", - "name": "width", - "type": "Number", - "default": "0", - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 38, - "itemtype": "property", - "name": "height", - "type": "Number", - "default": "0", - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 46, - "description": "Creates a clone of this Rectangle", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the rectangle", - "type": "Rectangle" - }, - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/Rectangle.js", - "line": 57, - "description": "Checks whether the x and y coordinates given are contained within this Rectangle", - "itemtype": "method", - "name": "contains", - "params": [ - { - "name": "x", - "description": "The X coordinate of the point to test", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the point to test", - "type": "Number" - } - ], - "return": { - "description": "Whether the x/y coordinates are within this Rectangle", - "type": "Boolean" - }, - "class": "Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 18, - "itemtype": "property", - "name": "x", - "type": "Number", - "default": "0", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 25, - "itemtype": "property", - "name": "y", - "type": "Number", - "default": "0", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 32, - "itemtype": "property", - "name": "width", - "type": "Number", - "default": "0", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 39, - "itemtype": "property", - "name": "height", - "type": "Number", - "default": "0", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 46, - "itemtype": "property", - "name": "radius", - "type": "Number", - "default": "20", - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 54, - "description": "Creates a clone of this Rounded Rectangle", - "itemtype": "method", - "name": "clone", - "return": { - "description": "a copy of the rounded rectangle", - "type": "Rounded Rectangle" - }, - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/geom/RoundedRectangle.js", - "line": 65, - "description": "Checks whether the x and y coordinates given are contained within this Rounded Rectangle", - "itemtype": "method", - "name": "contains", - "params": [ - { - "name": "x", - "description": "The X coordinate of the point to test", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the point to test", - "type": "Number" - } - ], - "return": { - "description": "Whether the x/y coordinates are within this Rounded Rectangle", - "type": "Boolean" - }, - "class": "Rounded Rectangle" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 23, - "description": "The array of asset URLs that are going to be loaded", - "itemtype": "property", - "name": "assetURLs", - "type": "Array", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 31, - "description": "Whether the requests should be treated as cross origin", - "itemtype": "property", - "name": "crossorigin", - "type": "Boolean", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 39, - "description": "Maps file extension to loader types", - "itemtype": "property", - "name": "loadersByType", - "type": "Object", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 61, - "description": "Fired when an item has loaded", - "itemtype": "event", - "name": "onProgress", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 66, - "description": "Fired when all the assets have loaded", - "itemtype": "event", - "name": "onComplete", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 74, - "description": "Given a filename, returns its extension.", - "itemtype": "method", - "name": "_getDataType", - "params": [ - { - "name": "str", - "description": "the name of the asset", - "type": "String" - } - ], - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 107, - "description": "Starts loading the assets sequentially", - "itemtype": "method", - "name": "load", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AssetLoader.js", - "line": 143, - "description": "Invoked after each file is loaded", - "itemtype": "method", - "name": "onAssetLoaded", - "access": "private", - "tagname": "", - "class": "AssetLoader" - }, - { - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 1, - "author": "Martin Kelm http://mkelm.github.com", - "class": "AtlasLoader" - }, - { - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 32, - "description": "Starts loading the JSON file", - "itemtype": "method", - "name": "load", - "class": "AtlasLoader" - }, - { - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 46, - "description": "Invoked when the Atlas has fully loaded. Parses the JSON and builds the texture frames.", - "itemtype": "method", - "name": "onAtlasLoaded", - "access": "private", - "tagname": "", - "class": "AtlasLoader" - }, - { - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 166, - "description": "Invoked when json file has loaded.", - "itemtype": "method", - "name": "onLoaded", - "access": "private", - "tagname": "", - "class": "AtlasLoader" - }, - { - "file": "src/pixi/loaders/AtlasLoader.js", - "line": 182, - "description": "Invoked when an error occurs.", - "itemtype": "method", - "name": "onError", - "access": "private", - "tagname": "", - "class": "AtlasLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 19, - "description": "The url of the bitmap font data", - "itemtype": "property", - "name": "url", - "type": "String", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 27, - "description": "Whether the requests should be treated as cross origin", - "itemtype": "property", - "name": "crossorigin", - "type": "Boolean", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 35, - "description": "[read-only] The base url of the bitmap font data", - "itemtype": "property", - "name": "baseUrl", - "type": "String", - "readonly": "", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 44, - "description": "[read-only] The texture of the bitmap font", - "itemtype": "property", - "name": "texture", - "type": "Texture", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 57, - "description": "Loads the XML font data", - "itemtype": "method", - "name": "load", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 72, - "description": "Invoked when the XML file is loaded, parses the data.", - "itemtype": "method", - "name": "onXMLLoaded", - "access": "private", - "tagname": "", - "class": "BitmapFontLoader" - }, - { - "file": "src/pixi/loaders/BitmapFontLoader.js", - "line": 152, - "description": "Invoked when all files are loaded (xml/fnt and texture)", - "itemtype": "method", - "name": "onLoaded", - "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": 18, - "description": "The texture being loaded", - "itemtype": "property", - "name": "texture", - "type": "Texture", - "class": "ImageLoader" - }, - { - "file": "src/pixi/loaders/ImageLoader.js", - "line": 26, - "description": "if the image is loaded with loadFramedSpriteSheet\nframes will contain the sprite sheet frames", - "itemtype": "property", - "name": "frames", - "type": "Array", - "readonly": "", - "class": "ImageLoader" - }, - { - "file": "src/pixi/loaders/ImageLoader.js", - "line": 42, - "description": "Loads image or takes it from cache", - "itemtype": "method", - "name": "load", - "class": "ImageLoader" - }, - { - "file": "src/pixi/loaders/ImageLoader.js", - "line": 59, - "description": "Invoked when image file is loaded or it is already cached and ready to use", - "itemtype": "method", - "name": "onLoaded", - "access": "private", - "tagname": "", - "class": "ImageLoader" - }, - { - "file": "src/pixi/loaders/ImageLoader.js", - "line": 70, - "description": "Loads image and split it to uniform sized frames", - "itemtype": "method", - "name": "loadFramedSpriteSheet", - "params": [ - { - "name": "frameWidth", - "description": "width of each frame", - "type": "Number" - }, - { - "name": "frameHeight", - "description": "height of each frame", - "type": "Number" - }, - { - "name": "textureName", - "description": "if given, the frames will be cached in - format", - "type": "String" - } - ], - "class": "ImageLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 18, - "description": "The url of the bitmap font data", - "itemtype": "property", - "name": "url", - "type": "String", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 26, - "description": "Whether the requests should be treated as cross origin", - "itemtype": "property", - "name": "crossorigin", - "type": "Boolean", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 34, - "description": "[read-only] The base url of the bitmap font data", - "itemtype": "property", - "name": "baseUrl", - "type": "String", - "readonly": "", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 43, - "description": "[read-only] Whether the data has loaded yet", - "itemtype": "property", - "name": "loaded", - "type": "Boolean", - "readonly": "", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 59, - "description": "Loads the JSON data", - "itemtype": "method", - "name": "load", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 98, - "description": "Invoked when the JSON file is loaded.", - "itemtype": "method", - "name": "onJSONLoaded", - "access": "private", - "tagname": "", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 162, - "description": "Invoked when the json file has loaded.", - "itemtype": "method", - "name": "onLoaded", - "access": "private", - "tagname": "", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/JsonLoader.js", - "line": 176, - "description": "Invoked if an error occurs.", - "itemtype": "method", - "name": "onError", - "access": "private", - "tagname": "", - "class": "JsonLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23\nbased on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi\n\nAwesome JS run time provided by EsotericSoftware\nhttps://github.com/EsotericSoftware/spine-runtimes", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 26, - "description": "The url of the bitmap font data", - "itemtype": "property", - "name": "url", - "type": "String", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 34, - "description": "Whether the requests should be treated as cross origin", - "itemtype": "property", - "name": "crossorigin", - "type": "Boolean", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 42, - "description": "[read-only] Whether the data has loaded yet", - "itemtype": "property", - "name": "loaded", - "type": "Boolean", - "readonly": "", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 56, - "description": "Loads the JSON data", - "itemtype": "method", - "name": "load", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpineLoader.js", - "line": 72, - "description": "Invoked when JSON file is loaded.", - "itemtype": "method", - "name": "onLoaded", - "access": "private", - "tagname": "", - "class": "SpineLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 22, - "description": "The url of the atlas data", - "itemtype": "property", - "name": "url", - "type": "String", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 30, - "description": "Whether the requests should be treated as cross origin", - "itemtype": "property", - "name": "crossorigin", - "type": "Boolean", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 38, - "description": "[read-only] The base url of the bitmap font data", - "itemtype": "property", - "name": "baseUrl", - "type": "String", - "readonly": "", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 47, - "description": "The texture being loaded", - "itemtype": "property", - "name": "texture", - "type": "Texture", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 55, - "description": "The frames of the sprite sheet", - "itemtype": "property", - "name": "frames", - "type": "Object", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 69, - "description": "This will begin loading the JSON file", - "itemtype": "method", - "name": "load", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/loaders/SpriteSheetLoader.js", - "line": 84, - "description": "Invoke when all files are loaded (json and texture)", - "itemtype": "method", - "name": "onLoaded", - "access": "private", - "tagname": "", - "class": "SpriteSheetLoader" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 18, - "description": "The alpha value used when filling the Graphics object.", - "itemtype": "property", - "name": "fillAlpha", - "type": "Number", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 26, - "description": "The width (thickness) of any lines drawn.", - "itemtype": "property", - "name": "lineWidth", - "type": "Number", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 34, - "description": "The color of any lines drawn.", - "itemtype": "property", - "name": "lineColor", - "type": "String", - "default": "0", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 43, - "description": "Graphics data", - "itemtype": "property", - "name": "graphicsData", - "type": "Array", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 52, - "description": "The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint.", - "itemtype": "property", - "name": "tint", - "type": "Number", - "default": "0xFFFFFF", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 61, - "description": "The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode.", - "itemtype": "property", - "name": "blendMode", - "type": "Number", - "default": "PIXI.blendModes.NORMAL;", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 70, - "description": "Current path", - "itemtype": "property", - "name": "currentPath", - "type": "Object", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 79, - "description": "Array containing some WebGL-related properties used by the WebGL renderer.", - "itemtype": "property", - "name": "_webGL", - "type": "Array", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 88, - "description": "Whether this shape is being used as a mask.", - "itemtype": "property", - "name": "isMask", - "type": "Boolean", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 96, - "description": "The bounds' padding used for bounds calculation.", - "itemtype": "property", - "name": "boundsPadding", - "type": "Number", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 106, - "description": "Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated.", - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 115, - "description": "Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated.", - "itemtype": "property", - "name": "webGLDirty", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 124, - "description": "Used to detect if the cached sprite object needs to be updated.", - "itemtype": "property", - "name": "cachedSpriteDirty", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 139, - "description": "When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite.\nThis is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory.\nIt is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas.\nThis is not recommended if you are constantly redrawing the graphics element.", - "itemtype": "property", - "name": "cacheAsBitmap", - "type": "Boolean", - "default": "false", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 171, - "description": "Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.", - "itemtype": "method", - "name": "lineStyle", - "params": [ - { - "name": "lineWidth", - "description": "width of the line to draw, will update the objects stored style", - "type": "Number" - }, - { - "name": "color", - "description": "color of the line to draw, will update the objects stored style", - "type": "Number" - }, - { - "name": "alpha", - "description": "alpha of the line to draw, will update the objects stored style", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 205, - "description": "Moves the current drawing position to x, y.", - "itemtype": "method", - "name": "moveTo", - "params": [ - { - "name": "x", - "description": "the X coordinate to move to", - "type": "Number" - }, - { - "name": "y", - "description": "the Y coordinate to move to", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 220, - "description": "Draws a line using the current line style from the current drawing position to (x, y);\nThe current drawing position is then set to (x, y).", - "itemtype": "method", - "name": "lineTo", - "params": [ - { - "name": "x", - "description": "the X coordinate to draw to", - "type": "Number" - }, - { - "name": "y", - "description": "the Y coordinate to draw to", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 237, - "description": "Calculate the points for a quadratic bezier curve and then draws it.\nBased on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c", - "itemtype": "method", - "name": "quadraticCurveTo", - "params": [ - { - "name": "cpX", - "description": "Control point x", - "type": "Number" - }, - { - "name": "cpY", - "description": "Control point y", - "type": "Number" - }, - { - "name": "toX", - "description": "Destination point x", - "type": "Number" - }, - { - "name": "toY", - "description": "Destination point y", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 287, - "description": "Calculate the points for a bezier curve and then draws it.", - "itemtype": "method", - "name": "bezierCurveTo", - "params": [ - { - "name": "cpX", - "description": "Control point x", - "type": "Number" - }, - { - "name": "cpY", - "description": "Control point y", - "type": "Number" - }, - { - "name": "cpX2", - "description": "Second Control point x", - "type": "Number" - }, - { - "name": "cpY2", - "description": "Second Control point y", - "type": "Number" - }, - { - "name": "toX", - "description": "Destination point x", - "type": "Number" - }, - { - "name": "toY", - "description": "Destination point y", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 414, - "description": "The arc method creates an arc/curve (used to create circles, or parts of circles).", - "itemtype": "method", - "name": "arc", - "params": [ - { - "name": "cx", - "description": "The x-coordinate of the center of the circle", - "type": "Number" - }, - { - "name": "cy", - "description": "The y-coordinate of the center of the circle", - "type": "Number" - }, - { - "name": "radius", - "description": "The radius of the circle", - "type": "Number" - }, - { - "name": "startAngle", - "description": "The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle)", - "type": "Number" - }, - { - "name": "endAngle", - "description": "The ending angle, in radians", - "type": "Number" - }, - { - "name": "anticlockwise", - "description": "Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise.", - "type": "Boolean" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 488, - "description": "Specifies a simple one-color fill that subsequent calls to other Graphics methods\n(such as lineTo() or drawCircle()) use when drawing.", - "itemtype": "method", - "name": "beginFill", - "params": [ - { - "name": "color", - "description": "the color of the fill", - "type": "Number" - }, - { - "name": "alpha", - "description": "the alpha of the fill", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 515, - "description": "Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.", - "itemtype": "method", - "name": "endFill", - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 530, - "itemtype": "method", - "name": "drawRect", - "params": [ - { - "name": "x", - "description": "The X coord of the top-left of the rectangle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coord of the top-left of the rectangle", - "type": "Number" - }, - { - "name": "width", - "description": "The width of the rectangle", - "type": "Number" - }, - { - "name": "height", - "description": "The height of the rectangle", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 546, - "itemtype": "method", - "name": "drawRoundedRect", - "params": [ - { - "name": "x", - "description": "The X coord of the top-left of the rectangle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coord of the top-left of the rectangle", - "type": "Number" - }, - { - "name": "width", - "description": "The width of the rectangle", - "type": "Number" - }, - { - "name": "height", - "description": "The height of the rectangle", - "type": "Number" - }, - { - "name": "radius", - "description": "Radius of the rectangle corners", - "type": "Number" - } - ], - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 562, - "description": "Draws a circle.", - "itemtype": "method", - "name": "drawCircle", - "params": [ - { - "name": "x", - "description": "The X coordinate of the center of the circle", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the center of the circle", - "type": "Number" - }, - { - "name": "radius", - "description": "The radius of the circle", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 578, - "description": "Draws an ellipse.", - "itemtype": "method", - "name": "drawEllipse", - "params": [ - { - "name": "x", - "description": "The X coordinate of the center of the ellipse", - "type": "Number" - }, - { - "name": "y", - "description": "The Y coordinate of the center of the ellipse", - "type": "Number" - }, - { - "name": "width", - "description": "The half width of the ellipse", - "type": "Number" - }, - { - "name": "height", - "description": "The half height of the ellipse", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 595, - "description": "Draws a polygon using the given path.", - "itemtype": "method", - "name": "drawPolygon", - "params": [ - { - "name": "path", - "description": "The path data used to construct the polygon.", - "type": "Array" - } - ], - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 609, - "description": "Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.", - "itemtype": "method", - "name": "clear", - "return": { - "description": "", - "type": "Graphics" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 627, - "description": "Useful function that returns a texture of the graphics object that can then be used to create sprites\nThis can be quite useful if your geometry is complicated and needs to be reused multiple times.", - "itemtype": "method", - "name": "generateTexture", - "params": [ - { - "name": "resolution", - "description": "The resolution of the texture being generated", - "type": "Number" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ], - "return": { - "description": "a texture of the graphics object", - "type": "Texture" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 656, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 736, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 805, - "description": "Retrieves the bounds of the graphic shape as a rectangle object", - "itemtype": "method", - "name": "getBounds", - "return": { - "description": "the rectangular bounding area", - "type": "Rectangle" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 884, - "description": "Update the bounds of the object", - "itemtype": "method", - "name": "updateLocalBounds", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 983, - "description": "Generates the cached sprite when the sprite has cacheAsBitmap = true", - "itemtype": "method", - "name": "_generateCachedSprite", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 1023, - "description": "Updates texture size based on canvas size", - "itemtype": "method", - "name": "updateCachedSpriteTexture", - "access": "private", - "tagname": "", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 1047, - "description": "Destroys a previous cached sprite.", - "itemtype": "method", - "name": "destroyCachedSprite", - "class": "Graphics" - }, - { - "file": "src/pixi/primitives/Graphics.js", - "line": 1061, - "description": "Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.", - "itemtype": "method", - "name": "drawShape", - "params": [ - { - "name": "shape", - "description": "The Shape object to draw.", - "type": "Circle|Rectangle|Ellipse|Line|Polygon" - } - ], - "return": { - "description": "The generated GraphicsData object.", - "type": "GraphicsData" - }, - "class": "Graphics" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 15, - "description": "The width of the Canvas in pixels.", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 23, - "description": "The height of the Canvas in pixels.", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 31, - "description": "The Canvas object that belongs to this CanvasBuffer.", - "itemtype": "property", - "name": "canvas", - "type": "HTMLCanvasElement", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 39, - "description": "A CanvasRenderingContext2D object representing a two-dimensional rendering context.", - "itemtype": "property", - "name": "context", - "type": "CanvasRenderingContext2D", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 53, - "description": "Clears the canvas that was created by the CanvasBuffer class.", - "itemtype": "method", - "name": "clear", - "access": "private", - "tagname": "", - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasBuffer.js", - "line": 65, - "description": "Resizes the canvas to the specified width and height.", - "itemtype": "method", - "name": "resize", - "params": [ - { - "name": "width", - "description": "the new width of the canvas", - "type": "Number" - }, - { - "name": "height", - "description": "the new height of the canvas", - "type": "Number" - } - ], - "class": "CanvasBuffer" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasMaskManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CanvasMaskManager" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasMaskManager.js", - "line": 17, - "description": "This method adds it to the current stack of masks.", - "itemtype": "method", - "name": "pushMask", - "params": [ - { - "name": "maskData", - "description": "the maskData that will be pushed", - "type": "Object" - }, - { - "name": "renderSession", - "description": "The renderSession whose context will be used for this mask manager.", - "type": "Object" - } - ], - "class": "CanvasMaskManager" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasMaskManager.js", - "line": 49, - "description": "Restores the current drawing context to the state it was before the mask was applied.", - "itemtype": "method", - "name": "popMask", - "params": [ - { - "name": "renderSession", - "description": "The renderSession whose context will be used for this mask manager.", - "type": "Object" - } - ], - "class": "CanvasMaskManager" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 14, - "description": "Basically this method just needs a sprite and a color and tints the sprite with the given color.", - "itemtype": "method", - "name": "getTintedTexture", - "params": [ - { - "name": "sprite", - "description": "the sprite to tint", - "type": "Sprite" - }, - { - "name": "color", - "description": "the color to use to tint the sprite with", - "type": "Number" - } - ], - "return": { - "description": "The tinted canvas", - "type": "HTMLCanvasElement" - }, - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 58, - "description": "Tint a texture using the \"multiply\" operation.", - "itemtype": "method", - "name": "tintWithMultiply", - "params": [ - { - "name": "texture", - "description": "the texture to tint", - "type": "Texture" - }, - { - "name": "color", - "description": "the color to use to tint the sprite with", - "type": "Number" - }, - { - "name": "canvas", - "description": "the current canvas", - "type": "HTMLCanvasElement" - } - ], - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 104, - "description": "Tint a texture using the \"overlay\" operation.", - "itemtype": "method", - "name": "tintWithOverlay", - "params": [ - { - "name": "texture", - "description": "the texture to tint", - "type": "Texture" - }, - { - "name": "color", - "description": "the color to use to tint the sprite with", - "type": "Number" - }, - { - "name": "canvas", - "description": "the current canvas", - "type": "HTMLCanvasElement" - } - ], - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 139, - "description": "Tint a texture pixel per pixel.", - "itemtype": "method", - "name": "tintPerPixel", - "params": [ - { - "name": "texture", - "description": "the texture to tint", - "type": "Texture" - }, - { - "name": "color", - "description": "the color to use to tint the sprite with", - "type": "Number" - }, - { - "name": "canvas", - "description": "the current canvas", - "type": "HTMLCanvasElement" - } - ], - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 184, - "description": "Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel.", - "itemtype": "method", - "name": "roundColor", - "params": [ - { - "name": "color", - "description": "the color to round, should be a hex color", - "type": "Number" - } - ], - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 203, - "description": "Number of steps which will be used as a cap when rounding colors.", - "itemtype": "property", - "name": "cacheStepsPerColorChannel", - "type": "Number", - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 211, - "description": "Tint cache boolean flag.", - "itemtype": "property", - "name": "convertTintToImage", - "type": "Boolean", - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 219, - "description": "Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method.", - "itemtype": "property", - "name": "canUseMultiply", - "type": "Boolean", - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/utils/CanvasTinter.js", - "line": 227, - "description": "The tinting method that will be used.", - "itemtype": "method", - "name": "tintMethod", - "class": "CanvasTinter" - }, - { - "file": "src/pixi/renderers/canvas/CanvasGraphics.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CanvasGraphics" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 40, - "description": "The renderer type.", - "itemtype": "property", - "name": "type", - "type": "Number", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 48, - "description": "The resolution of the canvas.", - "itemtype": "property", - "name": "resolution", - "type": "Number", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 56, - "description": "This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\nIf the Stage is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\nIf the Stage is transparent Pixi will use clearRect to clear the canvas every frame.\nDisable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.", - "itemtype": "property", - "name": "clearBeforeRender", - "type": "Boolean", - "default": "", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 68, - "description": "Whether the render view is transparent", - "itemtype": "property", - "name": "transparent", - "type": "Boolean", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 76, - "description": "Whether the render view should be resized automatically", - "itemtype": "property", - "name": "autoResize", - "type": "Boolean", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 85, - "description": "The width of the canvas view", - "itemtype": "property", - "name": "width", - "type": "Number", - "default": "800", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 94, - "description": "The height of the canvas view", - "itemtype": "property", - "name": "height", - "type": "Number", - "default": "600", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 106, - "description": "The canvas element that everything is drawn to.", - "itemtype": "property", - "name": "view", - "type": "HTMLCanvasElement", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 114, - "description": "The canvas 2d context that everything is drawn with", - "itemtype": "property", - "name": "context", - "type": "CanvasRenderingContext2D", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 121, - "description": "Boolean flag controlling canvas refresh.", - "itemtype": "property", - "name": "refresh", - "type": "Boolean", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 132, - "description": "Internal var.", - "itemtype": "property", - "name": "count", - "type": "Number", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 140, - "description": "Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer", - "itemtype": "property", - "name": "CanvasMaskManager", - "type": "CanvasMaskManager", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 147, - "description": "The render session is just a bunch of parameter used for rendering", - "itemtype": "property", - "name": "renderSession", - "type": "Object", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 157, - "description": "If true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation.\nHandy for crisp pixel art and speed on legacy devices.", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 184, - "description": "Renders the Stage to this canvas view", - "itemtype": "method", - "name": "render", - "params": [ - { - "name": "stage", - "description": "the Stage element to be rendered", - "type": "Stage" - } - ], - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 233, - "description": "Removes everything from the renderer and optionally removes the Canvas DOM element.", - "itemtype": "method", - "name": "destroy", - "params": [ - { - "name": "removeView", - "description": "Removes the Canvas element from the DOM.", - "type": "Boolean", - "optional": true, - "optdefault": "true" - } - ], - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 255, - "description": "Resizes the canvas view to the specified width and height", - "itemtype": "method", - "name": "resize", - "params": [ - { - "name": "width", - "description": "the new width of the canvas view", - "type": "Number" - }, - { - "name": "height", - "description": "the new height of the canvas view", - "type": "Number" - } - ], - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 276, - "description": "Renders a display object", - "itemtype": "method", - "name": "renderDisplayObject", - "params": [ - { - "name": "displayObject", - "description": "The displayObject to render", - "type": "DisplayObject" - }, - { - "name": "context", - "description": "the context 2d method of the canvas", - "type": "CanvasRenderingContext2D" - } - ], - "access": "private", - "tagname": "", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/canvas/CanvasRenderer.js", - "line": 291, - "description": "Maps Pixi blend modes to canvas blend modes.", - "itemtype": "method", - "name": "mapBlendModes", - "access": "private", - "tagname": "", - "class": "CanvasRenderer" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 12, - "itemtype": "property", - "name": "_UID", - "type": "Number", - "access": "private", - "tagname": "", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 19, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 25, - "description": "The WebGL program.", - "itemtype": "property", - "name": "program", - "type": "{Any}", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 32, - "description": "The fragment shader.", - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 48, - "description": "The vertex shader.", - "itemtype": "property", - "name": "vertexSrc", - "type": "Array", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 79, - "description": "Initialises the shader.", - "itemtype": "method", - "name": "init", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js", - "line": 109, - "description": "Destroys the shader.", - "itemtype": "method", - "name": "destroy", - "class": "ComplexPrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 12, - "itemtype": "property", - "name": "_UID", - "type": "Number", - "access": "private", - "tagname": "", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 19, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 25, - "description": "The WebGL program.", - "itemtype": "property", - "name": "program", - "type": "{Any}", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 32, - "description": "The fragment shader.", - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 47, - "description": "The vertex shader.", - "itemtype": "property", - "name": "vertexSrc", - "type": "Array", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 82, - "description": "A local texture counter for multi-texture shaders.", - "itemtype": "property", - "name": "textureCount", - "type": "Number", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 94, - "description": "Initialises the shader.", - "itemtype": "method", - "name": "init", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js", - "line": 143, - "description": "Destroys the shader.", - "itemtype": "method", - "name": "destroy", - "class": "PixiFastShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 1, - "author": "Richard Davey http://www.photonstorm.com @photonstorm", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 13, - "itemtype": "property", - "name": "_UID", - "type": "Number", - "access": "private", - "tagname": "", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 20, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 26, - "description": "The WebGL program.", - "itemtype": "property", - "name": "program", - "type": "{Any}", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 33, - "description": "The fragment shader.", - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 48, - "description": "A local texture counter for multi-texture shaders.", - "itemtype": "property", - "name": "textureCount", - "type": "Number", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 55, - "description": "A local flag", - "itemtype": "property", - "name": "firstRun", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 63, - "description": "A dirty flag", - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 70, - "description": "Uniform attributes cache.", - "itemtype": "property", - "name": "attributes", - "type": "Array", - "access": "private", - "tagname": "", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 83, - "description": "Initialises the shader.", - "itemtype": "method", - "name": "init", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 134, - "description": "Initialises the shader uniform values.\n\nUniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/\nhttp://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf", - "itemtype": "method", - "name": "initUniforms", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 208, - "description": "Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded)", - "itemtype": "method", - "name": "initSampler2D", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 283, - "description": "Updates the shader uniform values.", - "itemtype": "method", - "name": "syncUniforms", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 351, - "description": "Destroys the shader.", - "itemtype": "method", - "name": "destroy", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PixiShader.js", - "line": 365, - "description": "The Default Vertex shader source.", - "itemtype": "property", - "name": "defaultVertexSrc", - "type": "String", - "class": "PixiShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 12, - "itemtype": "property", - "name": "_UID", - "type": "Number", - "access": "private", - "tagname": "", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 19, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 25, - "description": "The WebGL program.", - "itemtype": "property", - "name": "program", - "type": "{Any}", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 32, - "description": "The fragment shader.", - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 46, - "description": "The vertex shader.", - "itemtype": "property", - "name": "vertexSrc", - "type": "Array", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 74, - "description": "Initialises the shader.", - "itemtype": "method", - "name": "init", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/PrimitiveShader.js", - "line": 103, - "description": "Destroys the shader.", - "itemtype": "method", - "name": "destroy", - "class": "PrimitiveShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 12, - "itemtype": "property", - "name": "_UID", - "type": "Number", - "access": "private", - "tagname": "", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 19, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 25, - "description": "The WebGL program.", - "itemtype": "property", - "name": "program", - "type": "{Any}", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 32, - "description": "The fragment shader.", - "itemtype": "property", - "name": "fragmentSrc", - "type": "Array", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 50, - "description": "The vertex shader.", - "itemtype": "property", - "name": "vertexSrc", - "type": "Array", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 80, - "description": "Initialises the shader.", - "itemtype": "method", - "name": "init", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/shaders/StripShader.js", - "line": 111, - "description": "Destroys the shader.", - "itemtype": "method", - "name": "destroy", - "class": "StripShader" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 15, - "itemtype": "property", - "name": "gl", - "type": "WebGLContext", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 23, - "itemtype": "property", - "name": "frameBuffer", - "type": "Any", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 29, - "itemtype": "property", - "name": "texture", - "type": "Any", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 35, - "itemtype": "property", - "name": "scaleMode", - "type": "Number", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 61, - "description": "Clears the filter texture.", - "itemtype": "method", - "name": "clear", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 74, - "description": "Resizes the texture to the specified width and height", - "itemtype": "method", - "name": "resize", - "params": [ - { - "name": "width", - "description": "the new width of the texture", - "type": "Number" - }, - { - "name": "height", - "description": "the new height of the texture", - "type": "Number" - } - ], - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/FilterTexture.js", - "line": 97, - "description": "Destroys the filter texture.", - "itemtype": "method", - "name": "destroy", - "class": "FilterTexture" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLBlendModeManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 12, - "itemtype": "property", - "name": "currentBlendMode", - "type": "Number", - "class": "WebGLBlendModeManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 21, - "description": "Sets the WebGL Context.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLBlendModeManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 32, - "description": "Sets-up the given blendMode from WebGL's point of view.", - "itemtype": "method", - "name": "setBlendMode", - "params": [ - { - "name": "blendMode", - "description": "the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD", - "type": "Number" - } - ], - "class": "WebGLBlendModeManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js", - "line": 50, - "description": "Destroys this object.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLBlendModeManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 1, - "author": "Mat Groves\n\nBig thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\nfor creating the original pixi version!\n\nHeavily inspired by LibGDX's WebGLSpriteBatch:\nhttps://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 17, - "itemtype": "property", - "name": "vertSize", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 23, - "itemtype": "property", - "name": "maxSize", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 29, - "itemtype": "property", - "name": "size", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 41, - "description": "Vertex data", - "itemtype": "property", - "name": "vertices", - "type": "Float32Array", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 48, - "description": "Index data", - "itemtype": "property", - "name": "indices", - "type": "Uint16Array", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 55, - "itemtype": "property", - "name": "vertexBuffer", - "type": "Object", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 61, - "itemtype": "property", - "name": "indexBuffer", - "type": "Object", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 67, - "itemtype": "property", - "name": "lastIndexCount", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 83, - "itemtype": "property", - "name": "drawing", - "type": "Boolean", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 89, - "itemtype": "property", - "name": "currentBatchSize", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 95, - "itemtype": "property", - "name": "currentBaseTexture", - "type": "BaseTexture", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 101, - "itemtype": "property", - "name": "currentBlendMode", - "type": "Number", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 107, - "itemtype": "property", - "name": "renderSession", - "type": "Object", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 113, - "itemtype": "property", - "name": "shader", - "type": "Object", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 119, - "itemtype": "property", - "name": "matrix", - "type": "Matrix", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 130, - "description": "Sets the WebGL Context.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 154, - "itemtype": "method", - "name": "begin", - "params": [ - { - "name": "spriteBatch", - "description": "", - "type": "WebGLSpriteBatch" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 169, - "itemtype": "method", - "name": "end", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 177, - "itemtype": "method", - "name": "render", - "params": [ - { - "name": "spriteBatch", - "description": "", - "type": "WebGLSpriteBatch" - } - ], - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 208, - "itemtype": "method", - "name": "renderSprite", - "params": [ - { - "name": "sprite", - "description": "", - "type": "Sprite" - } - ], - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 349, - "itemtype": "method", - "name": "flush", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 389, - "itemtype": "method", - "name": "stop", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js", - "line": 397, - "itemtype": "method", - "name": "start", - "class": "WebGLFastSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 11, - "itemtype": "property", - "name": "filterStack", - "type": "Array", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 17, - "itemtype": "property", - "name": "offsetX", - "type": "Number", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 23, - "itemtype": "property", - "name": "offsetY", - "type": "Number", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 32, - "description": "Initialises the context and the properties.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 46, - "itemtype": "method", - "name": "begin", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - }, - { - "name": "buffer", - "description": "", - "type": "ArrayBuffer" - } - ], - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 62, - "description": "Applies the filter and adds it to the current filter stack.", - "itemtype": "method", - "name": "pushFilter", - "params": [ - { - "name": "filterBlock", - "description": "the filter that will be pushed to the current filter stack", - "type": "Object" - } - ], - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 138, - "description": "Removes the last filter from the filter stack and doesn't return it.", - "itemtype": "method", - "name": "popFilter", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 315, - "description": "Applies the filter to the specified area.", - "itemtype": "method", - "name": "applyFilterPass", - "params": [ - { - "name": "filter", - "description": "the filter that needs to be applied", - "type": "AbstractFilter" - }, - { - "name": "filterArea", - "description": "TODO - might need an update", - "type": "Texture" - }, - { - "name": "width", - "description": "the horizontal range of the filter", - "type": "Number" - }, - { - "name": "height", - "description": "the vertical range of the filter", - "type": "Number" - } - ], - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 376, - "description": "Initialises the shader buffers.", - "itemtype": "method", - "name": "initShaderBuffers", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js", - "line": 424, - "description": "Destroys the filter and removes it from the filter stack.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLFilterManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 16, - "description": "Renders the graphics object", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "renderGraphics", - "params": [ - { - "name": "graphics", - "description": "", - "type": "Graphics" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 84, - "description": "Updates the graphics object", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "updateGraphics", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object to update", - "type": "Graphics" - }, - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 199, - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "switchMode", - "params": [ - { - "name": "webGL", - "description": "", - "type": "WebGLContext" - }, - { - "name": "type", - "description": "", - "type": "Number" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 233, - "description": "Builds a rectangle to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildRectangle", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object containing all the necessary properties", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 301, - "description": "Builds a rounded rectangle to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildRoundedRectangle", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object containing all the necessary properties", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 369, - "description": "Calculate the points for a quadratic bezier curve. (helper function..)\nBased on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "quadraticBezierCurve", - "params": [ - { - "name": "fromX", - "description": "Origin point x", - "type": "Number" - }, - { - "name": "fromY", - "description": "Origin point x", - "type": "Number" - }, - { - "name": "cpX", - "description": "Control point x", - "type": "Number" - }, - { - "name": "cpY", - "description": "Control point y", - "type": "Number" - }, - { - "name": "toX", - "description": "Destination point x", - "type": "Number" - }, - { - "name": "toY", - "description": "Destination point y", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Array" - }, - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 421, - "description": "Builds a circle to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildCircle", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object to draw", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 504, - "description": "Builds a line to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildLine", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object containing all the necessary properties", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 716, - "description": "Builds a complex polygon to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildComplexPoly", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object containing all the necessary properties", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 778, - "description": "Builds a polygon to draw", - "static": 1, - "access": "private", - "tagname": "", - "itemtype": "method", - "name": "buildPoly", - "params": [ - { - "name": "graphicsData", - "description": "The graphics object containing all the necessary properties", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Object" - } - ], - "class": "WebGLGraphics" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 850, - "itemtype": "method", - "name": "reset", - "class": "WebGLGraphicsData" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js", - "line": 860, - "itemtype": "method", - "name": "upload", - "class": "WebGLGraphicsData" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLMaskManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 16, - "description": "Sets the drawing context to the one given in parameter.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLMaskManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 27, - "description": "Applies the Mask and adds it to the current filter stack.", - "itemtype": "method", - "name": "pushMask", - "params": [ - { - "name": "maskData", - "description": "", - "type": "Array" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLMaskManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 48, - "description": "Removes the last filter from the filter stack and doesn't return it.", - "itemtype": "method", - "name": "popMask", - "params": [ - { - "name": "maskData", - "description": "", - "type": "Array" - }, - { - "name": "renderSession", - "description": "an object containing all the useful parameters", - "type": "Object" - } - ], - "class": "WebGLMaskManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLMaskManager.js", - "line": 61, - "description": "Destroys the mask stack.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLMaskManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 12, - "itemtype": "property", - "name": "maxAttibs", - "type": "Number", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 18, - "itemtype": "property", - "name": "attribState", - "type": "Array", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 24, - "itemtype": "property", - "name": "tempAttribState", - "type": "Array", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 35, - "itemtype": "property", - "name": "stack", - "type": "Array", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 45, - "description": "Initialises the context and the properties.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 72, - "description": "Takes the attributes given in parameters.", - "itemtype": "method", - "name": "setAttribs", - "params": [ - { - "name": "attribs", - "description": "attribs", - "type": "Array" - } - ], - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 115, - "description": "Sets the current shader.", - "itemtype": "method", - "name": "setShader", - "params": [ - { - "name": "shader", - "description": "", - "type": "Any" - } - ], - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderManager.js", - "line": 135, - "description": "Destroys this object.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLShaderManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 5, - "itemtype": "method", - "name": "initDefaultShaders", - "static": 1, - "access": "private", - "tagname": "", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 14, - "itemtype": "method", - "name": "CompileVertexShader", - "static": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - }, - { - "name": "shaderSrc", - "description": "", - "type": "Array" - } - ], - "return": { - "description": "", - "type": "Any" - }, - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 26, - "itemtype": "method", - "name": "CompileFragmentShader", - "static": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - }, - { - "name": "shaderSrc", - "description": "", - "type": "Array" - } - ], - "return": { - "description": "", - "type": "Any" - }, - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 38, - "itemtype": "method", - "name": "_CompileShader", - "static": 1, - "access": "private", - "tagname": "", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - }, - { - "name": "shaderSrc", - "description": "", - "type": "Array" - }, - { - "name": "shaderType", - "description": "", - "type": "Number" - } - ], - "return": { - "description": "", - "type": "Any" - }, - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLShaderUtils.js", - "line": 63, - "itemtype": "method", - "name": "compileProgram", - "static": 1, - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - }, - { - "name": "vertexSrc", - "description": "", - "type": "Array" - }, - { - "name": "fragmentSrc", - "description": "", - "type": "Array" - } - ], - "return": { - "description": "", - "type": "Any" - }, - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 1, - "author": "Mat Groves\n\nBig thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\nfor creating the original pixi version!\n\nHeavily inspired by LibGDX's WebGLSpriteBatch:\nhttps://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 19, - "itemtype": "property", - "name": "vertSize", - "type": "Number", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 25, - "description": "The number of images in the SpriteBatch before it flushes", - "itemtype": "property", - "name": "size", - "type": "Number", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 37, - "description": "Holds the vertices", - "itemtype": "property", - "name": "vertices", - "type": "Float32Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 45, - "description": "Holds the indices", - "itemtype": "property", - "name": "indices", - "type": "Uint16Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 53, - "itemtype": "property", - "name": "lastIndexCount", - "type": "Number", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 69, - "itemtype": "property", - "name": "drawing", - "type": "Boolean", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 75, - "itemtype": "property", - "name": "currentBatchSize", - "type": "Number", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 81, - "itemtype": "property", - "name": "currentBaseTexture", - "type": "BaseTexture", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 87, - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 93, - "itemtype": "property", - "name": "textures", - "type": "Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 99, - "itemtype": "property", - "name": "blendModes", - "type": "Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 105, - "itemtype": "property", - "name": "shaders", - "type": "Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 111, - "itemtype": "property", - "name": "sprites", - "type": "Array", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 117, - "itemtype": "property", - "name": "defaultShader", - "type": "AbstractFilter", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 132, - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 164, - "itemtype": "method", - "name": "begin", - "params": [ - { - "name": "renderSession", - "description": "The RenderSession object", - "type": "Object" - } - ], - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 176, - "itemtype": "method", - "name": "end", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 184, - "itemtype": "method", - "name": "render", - "params": [ - { - "name": "sprite", - "description": "the sprite to render when using this spritebatch", - "type": "Sprite" - } - ], - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 297, - "description": "Renders a TilingSprite using the spriteBatch.", - "itemtype": "method", - "name": "renderTilingSprite", - "params": [ - { - "name": "sprite", - "description": "the tilingSprite to render", - "type": "TilingSprite" - } - ], - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 418, - "description": "Renders the content and empties the current batch.", - "itemtype": "method", - "name": "flush", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 542, - "itemtype": "method", - "name": "renderBatch", - "params": [ - { - "name": "texture", - "description": "", - "type": "Texture" - }, - { - "name": "size", - "description": "", - "type": "Number" - }, - { - "name": "startIndex", - "description": "", - "type": "Number" - } - ], - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 572, - "itemtype": "method", - "name": "stop", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 581, - "itemtype": "method", - "name": "start", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js", - "line": 589, - "description": "Destroys the SpriteBatch.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLSpriteBatch" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 17, - "description": "Sets the drawing context to the one given in parameter.", - "itemtype": "method", - "name": "setContext", - "params": [ - { - "name": "gl", - "description": "the current WebGL drawing context", - "type": "WebGLContext" - } - ], - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 28, - "description": "Applies the Mask and adds it to the current filter stack.", - "itemtype": "method", - "name": "pushMask", - "params": [ - { - "name": "graphics", - "description": "", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Array" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 120, - "description": "TODO this does not belong here!", - "itemtype": "method", - "name": "bindGraphics", - "params": [ - { - "name": "graphics", - "description": "", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Array" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 190, - "itemtype": "method", - "name": "popStencil", - "params": [ - { - "name": "graphics", - "description": "", - "type": "Graphics" - }, - { - "name": "webGLData", - "description": "", - "type": "Array" - }, - { - "name": "renderSession", - "description": "", - "type": "Object" - } - ], - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/utils/WebGLStencilManager.js", - "line": 285, - "description": "Destroys the mask stack.", - "itemtype": "method", - "name": "destroy", - "class": "WebGLStencilManager" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 46, - "itemtype": "property", - "name": "type", - "type": "Number", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 52, - "description": "The resolution of the renderer", - "itemtype": "property", - "name": "resolution", - "type": "Number", - "default": "1", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 63, - "description": "Whether the render view is transparent", - "itemtype": "property", - "name": "transparent", - "type": "Boolean", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 71, - "description": "Whether the render view should be resized automatically", - "itemtype": "property", - "name": "autoResize", - "type": "Boolean", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 79, - "description": "The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering.", - "itemtype": "property", - "name": "preserveDrawingBuffer", - "type": "Boolean", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 87, - "description": "This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true:\nIf the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0).\nIf the Stage is transparent, Pixi will clear to the target Stage's background color.\nDisable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set.", - "itemtype": "property", - "name": "clearBeforeRender", - "type": "Boolean", - "default": "", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 99, - "description": "The width of the canvas view", - "itemtype": "property", - "name": "width", - "type": "Number", - "default": "800", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 108, - "description": "The height of the canvas view", - "itemtype": "property", - "name": "height", - "type": "Number", - "default": "600", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 117, - "description": "The canvas element that everything is drawn to", - "itemtype": "property", - "name": "view", - "type": "HTMLCanvasElement", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 127, - "itemtype": "property", - "name": "contextLostBound", - "type": "Function", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 133, - "itemtype": "property", - "name": "contextRestoredBound", - "type": "Function", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 142, - "itemtype": "property", - "name": "_contextOptions", - "type": "Object", - "access": "private", - "tagname": "", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 155, - "itemtype": "property", - "name": "projection", - "type": "Point", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 161, - "itemtype": "property", - "name": "offset", - "type": "Point", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 169, - "description": "Deals with managing the shader programs and their attribs", - "itemtype": "property", - "name": "shaderManager", - "type": "WebGLShaderManager", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 176, - "description": "Manages the rendering of sprites", - "itemtype": "property", - "name": "spriteBatch", - "type": "WebGLSpriteBatch", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 183, - "description": "Manages the masks using the stencil buffer", - "itemtype": "property", - "name": "maskManager", - "type": "WebGLMaskManager", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 190, - "description": "Manages the filters", - "itemtype": "property", - "name": "filterManager", - "type": "WebGLFilterManager", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 197, - "description": "Manages the stencil buffer", - "itemtype": "property", - "name": "stencilManager", - "type": "WebGLStencilManager", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 204, - "description": "Manages the blendModes", - "itemtype": "property", - "name": "blendModeManager", - "type": "WebGLBlendModeManager", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 211, - "description": "TODO remove", - "itemtype": "property", - "name": "renderSession", - "type": "Object", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 238, - "itemtype": "method", - "name": "initContext", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 276, - "description": "Renders the stage to its webGL view", - "itemtype": "method", - "name": "render", - "params": [ - { - "name": "stage", - "description": "the Stage element to be rendered", - "type": "Stage" - } - ], - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 344, - "description": "Renders a Display Object.", - "itemtype": "method", - "name": "renderDisplayObject", - "params": [ - { - "name": "displayObject", - "description": "The DisplayObject to render", - "type": "DisplayObject" - }, - { - "name": "projection", - "description": "The projection", - "type": "Point" - }, - { - "name": "buffer", - "description": "a standard WebGL buffer", - "type": "Array" - } - ], - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 378, - "description": "Resizes the webGL view to the specified width and height.", - "itemtype": "method", - "name": "resize", - "params": [ - { - "name": "width", - "description": "the new width of the webGL view", - "type": "Number" - }, - { - "name": "height", - "description": "the new height of the webGL view", - "type": "Number" - } - ], - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 404, - "description": "Updates and Creates a WebGL texture for the renderers context.", - "itemtype": "method", - "name": "updateTexture", - "params": [ - { - "name": "texture", - "description": "the texture to update", - "type": "Texture" - } - ], - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 443, - "description": "Handles a lost webgl context", - "itemtype": "method", - "name": "handleContextLost", - "params": [ - { - "name": "event", - "description": "", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 456, - "description": "Handles a restored webgl context", - "itemtype": "method", - "name": "handleContextRestored", - "params": [ - { - "name": "event", - "description": "", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 477, - "description": "Removes everything from the renderer (event listeners, spritebatch, etc...)", - "itemtype": "method", - "name": "destroy", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/renderers/webgl/WebGLRenderer.js", - "line": 508, - "description": "Maps Pixi blend modes to WebGL blend modes.", - "itemtype": "method", - "name": "mapBlendModes", - "class": "WebGLRenderer" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 23, - "description": "[read-only] The width of the overall text, different from fontSize,\nwhich is defined in the style object", - "itemtype": "property", - "name": "textWidth", - "type": "Number", - "readonly": "", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 33, - "description": "[read-only] The height of the overall text, different from fontSize,\nwhich is defined in the style object", - "itemtype": "property", - "name": "textHeight", - "type": "Number", - "readonly": "", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 43, - "itemtype": "property", - "name": "_pool", - "type": "Array", - "access": "private", - "tagname": "", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 54, - "description": "The dirty state of this object.", - "itemtype": "property", - "name": "dirty", - "type": "Boolean", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 66, - "description": "Set the text string to be rendered.", - "itemtype": "method", - "name": "setText", - "params": [ - { - "name": "text", - "description": "The text that you would like displayed", - "type": "String" - } - ], - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 78, - "description": "Set the style of the text\nstyle.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)\n[style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single lines of text", - "itemtype": "method", - "name": "setStyle", - "params": [ - { - "name": "style", - "description": "The style parameters, contained as properties of an object", - "type": "Object" - } - ], - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 100, - "description": "Renders text and updates it when needed", - "itemtype": "method", - "name": "updateText", - "access": "private", - "tagname": "", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/BitmapText.js", - "line": 198, - "description": "Updates the transform of this object", - "itemtype": "method", - "name": "updateTransform", - "access": "private", - "tagname": "", - "class": "BitmapText" - }, - { - "file": "src/pixi/text/Text.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23\nModified by Tom Slezakowski http://www.tomslezakowski.com @TomSlezakowski (24/03/2014) - Added dropShadowColor.", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 29, - "description": "The canvas element that everything is drawn to", - "itemtype": "property", - "name": "canvas", - "type": "HTMLCanvasElement", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 37, - "description": "The canvas 2d context that everything is drawn with", - "itemtype": "property", - "name": "context", - "type": "HTMLCanvasElement", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 44, - "description": "The resolution of the canvas.", - "itemtype": "property", - "name": "resolution", - "type": "Number", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 62, - "description": "The width of the Text, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 86, - "description": "The height of the Text, setting this will actually modify the scale to achieve the value set", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 110, - "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": "Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text", - "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, - "optdefault": "'black'" - }, - { - "name": "strokeThickness", - "description": "A number that represents the thickness of the stroke. Default is 0 (no stroke)", - "type": "Number", - "optional": true, - "optdefault": "0" - }, - { - "name": "wordWrap", - "description": "Indicates if word wrap should be used", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "wordWrapWidth", - "description": "The width at which text will wrap", - "type": "Number", - "optional": true, - "optdefault": "100" - }, - { - "name": "dropShadow", - "description": "Set a drop shadow for the text", - "type": "Boolean", - "optional": true, - "optdefault": "false" - }, - { - "name": "dropShadowColor", - "description": "A fill style to be used on the dropshadow e.g 'red', '#00FF00'", - "type": "String", - "optional": true, - "optdefault": "'#000000'" - }, - { - "name": "dropShadowAngle", - "description": "Set a angle of the drop shadow", - "type": "Number", - "optional": true, - "optdefault": "Math.PI/4" - }, - { - "name": "dropShadowDistance", - "description": "Set a distance of the drop shadow", - "type": "Number", - "optional": true, - "optdefault": "5" - } - ] - }, - { - "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": 147, - "description": "Set the copy for the text object. To split a line you can use '\\n'.", - "itemtype": "method", - "name": "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": 159, - "description": "Renders text and updates it when needed", - "itemtype": "method", - "name": "updateText", - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 281, - "description": "Updates texture size based on canvas size", - "itemtype": "method", - "name": "updateTexture", - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 301, - "description": "Renders the object using the WebGL renderer", - "itemtype": "method", - "name": "_renderWebGL", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 321, - "description": "Renders the object using the Canvas renderer", - "itemtype": "method", - "name": "_renderCanvas", - "params": [ - { - "name": "renderSession", - "description": "", - "type": "RenderSession" - } - ], - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 341, - "description": "Calculates the ascent, descent and fontSize of a given fontStyle", - "itemtype": "method", - "name": "determineFontProperties", - "params": [ - { - "name": "fontStyle", - "description": "", - "type": "Object" - } - ], - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 444, - "description": "Applies newlines to a string to have it optimally fit into the horizontal\nbounds set by the Text object's wordWrapWidth property.", - "itemtype": "method", - "name": "wordWrap", - "params": [ - { - "name": "text", - "description": "", - "type": "String" - } - ], - "access": "private", - "tagname": "", - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 492, - "description": "Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account.", - "itemtype": "method", - "name": "getBounds", - "params": [ - { - "name": "matrix", - "description": "the transformation matrix of the Text", - "type": "Matrix" - } - ], - "return": { - "description": "the framing rectangle", - "type": "Rectangle" - }, - "class": "Text" - }, - { - "file": "src/pixi/text/Text.js", - "line": 510, - "description": "Destroys this text object.", - "itemtype": "method", - "name": "destroy", - "params": [ - { - "name": "destroyBaseTexture", - "description": "whether to destroy the base texture as well", - "type": "Boolean" - } - ], - "class": "Text" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 20, - "description": "The Resolution of the texture.", - "itemtype": "property", - "name": "resolution", - "type": "Number", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 28, - "description": "[read-only] The width of the base texture set when the image has loaded", - "itemtype": "property", - "name": "width", - "type": "Number", - "readonly": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 37, - "description": "[read-only] The height of the base texture set when the image has loaded", - "itemtype": "property", - "name": "height", - "type": "Number", - "readonly": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 46, - "description": "The scale mode to apply when scaling this texture", - "itemtype": "property", - "name": "scaleMode", - "type": "PIXI.scaleModes", - "default": "PIXI.scaleModes.LINEAR", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 55, - "description": "[read-only] Set to true once the base texture has loaded", - "itemtype": "property", - "name": "hasLoaded", - "type": "Boolean", - "readonly": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 64, - "description": "The image source that is used to create the texture.", - "itemtype": "property", - "name": "source", - "type": "Image", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 74, - "description": "Controls if RGB channels should be pre-multiplied by Alpha (WebGL only)", - "itemtype": "property", - "name": "premultipliedAlpha", - "type": "Boolean", - "default": "true", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 85, - "itemtype": "property", - "name": "_glTextures", - "type": "Array", - "access": "private", - "tagname": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 95, - "itemtype": "property", - "name": "_dirty", - "type": "Array", - "access": "private", - "tagname": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 132, - "itemtype": "property", - "name": "imageUrl", - "type": "String", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 138, - "itemtype": "property", - "name": "_powerOf2", - "type": "Boolean", - "access": "private", - "tagname": "", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 151, - "description": "Destroys this base texture", - "itemtype": "method", - "name": "destroy", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 174, - "description": "Changes the source image of the texture", - "itemtype": "method", - "name": "updateSourceImage", - "params": [ - { - "name": "newSrc", - "description": "the path of the image", - "type": "String" - } - ], - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 187, - "description": "Sets all glTextures to be dirty.", - "itemtype": "method", - "name": "dirty", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 200, - "description": "Removes the base texture from the GPU, useful for managing resources on the GPU.\nAtexture is still 100% usable and will simply be reuploaded if there is a sprite on screen that is using it.", - "itemtype": "method", - "name": "unloadFromGPU", - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 228, - "description": "Helper function that creates a base texture from the given image url.\nIf the image is not in the base texture cache it will be created and loaded.", - "static": 1, - "itemtype": "method", - "name": "fromImage", - "params": [ - { - "name": "imageUrl", - "description": "The image url of the texture", - "type": "String" - }, - { - "name": "crossorigin", - "description": "", - "type": "Boolean" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ], - "return": { - "description": "BaseTexture" - }, - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/BaseTexture.js", - "line": 270, - "description": "Helper function that creates a base texture from the given canvas element.", - "static": 1, - "itemtype": "method", - "name": "fromCanvas", - "params": [ - { - "name": "canvas", - "description": "The canvas element source of the texture", - "type": "Canvas" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ], - "return": { - "description": "BaseTexture" - }, - "class": "BaseTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 37, - "description": "The with of the render texture", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 45, - "description": "The height of the render texture", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 53, - "description": "The Resolution of the texture.", - "itemtype": "property", - "name": "resolution", - "type": "Number", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 61, - "description": "The framing rectangle of the render texture", - "itemtype": "property", - "name": "frame", - "type": "Rectangle", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 69, - "description": "This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,\nirrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)", - "itemtype": "property", - "name": "crop", - "type": "Rectangle", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 78, - "description": "The base texture object that this texture uses", - "itemtype": "property", - "name": "baseTexture", - "type": "BaseTexture", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 99, - "description": "The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL.", - "itemtype": "property", - "name": "renderer", - "type": "CanvasRenderer|WebGLRenderer", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 125, - "itemtype": "property", - "name": "valid", - "type": "Boolean", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 137, - "description": "Resizes the RenderTexture.", - "itemtype": "method", - "name": "resize", - "params": [ - { - "name": "width", - "description": "The width to resize to.", - "type": "Number" - }, - { - "name": "height", - "description": "The height to resize to.", - "type": "Number" - }, - { - "name": "updateBase", - "description": "Should the baseTexture.width and height values be resized as well?", - "type": "Boolean" - } - ], - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 171, - "description": "Clears the RenderTexture.", - "itemtype": "method", - "name": "clear", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 188, - "description": "This function will draw the display object to the texture.", - "itemtype": "method", - "name": "renderWebGL", - "params": [ - { - "name": "displayObject", - "description": "The display object to render this texture on", - "type": "DisplayObject" - }, - { - "name": "matrix", - "description": "Optional matrix to apply to the display object before rendering.", - "type": "Matrix", - "optional": true - }, - { - "name": "clear", - "description": "If true the texture will be cleared before the displayObject is drawn", - "type": "Boolean", - "optional": true - } - ], - "access": "private", - "tagname": "", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 237, - "description": "This function will draw the display object to the texture.", - "itemtype": "method", - "name": "renderCanvas", - "params": [ - { - "name": "displayObject", - "description": "The display object to render this texture on", - "type": "DisplayObject" - }, - { - "name": "matrix", - "description": "Optional matrix to apply to the display object before rendering.", - "type": "Matrix", - "optional": true - }, - { - "name": "clear", - "description": "If true the texture will be cleared before the displayObject is drawn", - "type": "Boolean", - "optional": true - } - ], - "access": "private", - "tagname": "", - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 278, - "description": "Will return a HTML Image of the texture", - "itemtype": "method", - "name": "getImage", - "return": { - "description": "", - "type": "Image" - }, - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 291, - "description": "Will return a a base64 encoded string of this texture. It works by calling RenderTexture.getCanvas and then running toDataURL on that.", - "itemtype": "method", - "name": "getBase64", - "return": { - "description": "A base64 encoded string of the texture.", - "type": "String" - }, - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/RenderTexture.js", - "line": 302, - "description": "Creates a Canvas element, renders this RenderTexture to it and then returns it.", - "itemtype": "method", - "name": "getCanvas", - "return": { - "description": "A Canvas element with the texture rendered on.", - "type": "HTMLCanvasElement" - }, - "class": "RenderTexture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 24, - "description": "Does this Texture have any frame data assigned to it?", - "itemtype": "property", - "name": "noFrame", - "type": "Boolean", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 43, - "description": "The base texture that this texture uses.", - "itemtype": "property", - "name": "baseTexture", - "type": "BaseTexture", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 51, - "description": "The frame specifies the region of the base texture that this texture uses", - "itemtype": "property", - "name": "frame", - "type": "Rectangle", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 59, - "description": "The texture trim data.", - "itemtype": "property", - "name": "trim", - "type": "Rectangle", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 67, - "description": "This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.", - "itemtype": "property", - "name": "valid", - "type": "Boolean", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 75, - "description": "This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)", - "itemtype": "property", - "name": "requiresUpdate", - "type": "Boolean", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 83, - "description": "The WebGL UV data cache.", - "itemtype": "property", - "name": "_uvs", - "type": "Object", - "access": "private", - "tagname": "", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 92, - "description": "The width of the Texture in pixels.", - "itemtype": "property", - "name": "width", - "type": "Number", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 100, - "description": "The height of the Texture in pixels.", - "itemtype": "property", - "name": "height", - "type": "Number", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 108, - "description": "This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,\nirrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)", - "itemtype": "property", - "name": "crop", - "type": "Rectangle", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 131, - "description": "Called when the base texture is loaded", - "itemtype": "method", - "name": "onBaseTextureLoaded", - "access": "private", - "tagname": "", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 149, - "description": "Destroys this texture", - "itemtype": "method", - "name": "destroy", - "params": [ - { - "name": "destroyBase", - "description": "Whether to destroy the base texture as well", - "type": "Boolean" - } - ], - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 162, - "description": "Specifies the region of the baseTexture that this texture will use.", - "itemtype": "method", - "name": "setFrame", - "params": [ - { - "name": "frame", - "description": "The frame of the texture to set it to", - "type": "Rectangle" - } - ], - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 200, - "description": "Updates the internal WebGL UV cache.", - "itemtype": "method", - "name": "_updateUvs", - "access": "private", - "tagname": "", - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 227, - "description": "Helper function that creates a Texture object from the given image url.\nIf the image is not in the texture cache it will be created and loaded.", - "static": 1, - "itemtype": "method", - "name": "fromImage", - "params": [ - { - "name": "imageUrl", - "description": "The image url of the texture", - "type": "String" - }, - { - "name": "crossorigin", - "description": "Whether requests should be treated as crossorigin", - "type": "Boolean" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ], - "return": { - "description": "Texture" - }, - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 251, - "description": "Helper function that returns a Texture objected based on the given frame id.\nIf the frame id is not in the texture cache an error will be thrown.", - "static": 1, - "itemtype": "method", - "name": "fromFrame", - "params": [ - { - "name": "frameId", - "description": "The frame id of the texture", - "type": "String" - } - ], - "return": { - "description": "Texture" - }, - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 267, - "description": "Helper function that creates a new a Texture based on the given canvas element.", - "static": 1, - "itemtype": "method", - "name": "fromCanvas", - "params": [ - { - "name": "canvas", - "description": "The canvas element source of the texture", - "type": "Canvas" - }, - { - "name": "scaleMode", - "description": "Should be one of the PIXI.scaleMode consts", - "type": "Number" - } - ], - "return": { - "description": "Texture" - }, - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 284, - "description": "Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object.", - "static": 1, - "itemtype": "method", - "name": "addTextureToCache", - "params": [ - { - "name": "texture", - "description": "The Texture to add to the cache.", - "type": "Texture" - }, - { - "name": "id", - "description": "The id that the texture will be stored against.", - "type": "String" - } - ], - "class": "Texture" - }, - { - "file": "src/pixi/textures/Texture.js", - "line": 297, - "description": "Remove a texture from the global PIXI.TextureCache.", - "static": 1, - "itemtype": "method", - "name": "removeTextureFromCache", - "params": [ - { - "name": "id", - "description": "The id of the texture to be removed", - "type": "String" - } - ], - "return": { - "description": "The texture that was removed", - "type": "Texture" - }, - "class": "Texture" - }, - { - "file": "src/pixi/textures/VideoTexture.js", - "line": 87, - "description": "Mimic Pixi BaseTexture.from.... method.", - "params": [ - { - "name": "video", - "description": "" - }, - { - "name": "scaleMode", - "description": "" - } - ], - "return": { - "description": "", - "type": "PIXI.VideoTexture" - }, - "class": "autoDetectRenderer" - }, - { - "file": "src/pixi/textures/VideoTexture.js", - "line": 126, - "description": "Mimic PIXI Texture.from... method.", - "params": [ - { - "name": "video", - "description": "" - }, - { - "name": "scaleMode", - "description": "" - } - ], - "return": { - "description": "", - "type": "PIXI.Texture" - }, - "class": "autoDetectRenderer" - }, - { - "file": "src/pixi/utils/Detector.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "autoDetectRenderer" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 1, - "author": "Chad Engler https://github.com/englercj @Rolnaaba", - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 6, - "description": "Originally based on https://github.com/mrdoob/eventtarget.js/ from mr Doob.\nCurrently takes inspiration from the nodejs EventEmitter, EventEmitter3, and smokesignals", - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 24, - "description": "Backward compat from when this used to be a function", - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 34, - "description": "Mixes in the properties of the EventTarget prototype onto another object", - "itemtype": "method", - "name": "mixin", - "params": [ - { - "name": "object", - "description": "The obj to mix into", - "type": "Object" - } - ], - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 41, - "description": "Return a list of assigned event listeners.", - "itemtype": "method", - "name": "listeners", - "params": [ - { - "name": "eventName", - "description": "The events that should be listed.", - "type": "String" - } - ], - "return": { - "description": "An array of listener functions", - "type": "Array" - }, - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 54, - "description": "Emit an event to all registered event listeners.", - "itemtype": "method", - "name": "emit", - "alias": "dispatchEvent", - "params": [ - { - "name": "eventName", - "description": "The name of the event.", - "type": "String" - } - ], - "return": { - "description": "Indication if we've emitted an event.", - "type": "Boolean" - }, - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 107, - "description": "Register a new EventListener for the given event.", - "itemtype": "method", - "name": "on", - "alias": "addEventListener", - "params": [ - { - "name": "eventName", - "description": "Name of the event.", - "type": "String" - }, - { - "name": "callback", - "description": "fn Callback function.", - "type": "Functon" - } - ], - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 124, - "description": "Add an EventListener that's only called once.", - "itemtype": "method", - "name": "once", - "params": [ - { - "name": "eventName", - "description": "Name of the event.", - "type": "String" - }, - { - "name": "callback", - "description": "Callback function.", - "type": "Function" - } - ], - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 143, - "description": "Remove event listeners.", - "itemtype": "method", - "name": "off", - "alias": "removeEventListener", - "params": [ - { - "name": "eventName", - "description": "The event we want to remove.", - "type": "String" - }, - { - "name": "callback", - "description": "The listener that we need to find.", - "type": "Function" - } - ], - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 173, - "description": "Remove all listeners or only the listeners for the specified event.", - "itemtype": "method", - "name": "removeAllListeners", - "params": [ - { - "name": "eventName", - "description": "The event you want to remove all listeners for.", - "type": "String" - } - ], - "class": "EventTarget" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 206, - "description": "Tracks the state of bubbling propagation. Do not\nset this directly, instead use `event.stopPropagation()`", - "itemtype": "property", - "name": "stopped", - "type": "Boolean", - "access": "private", - "tagname": "", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 217, - "description": "Tracks the state of sibling listener propagation. Do not\nset this directly, instead use `event.stopImmediatePropagation()`", - "itemtype": "property", - "name": "stoppedImmediate", - "type": "Boolean", - "access": "private", - "tagname": "", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 228, - "description": "The original target the event triggered on.", - "itemtype": "property", - "name": "target", - "type": "Object", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 237, - "description": "The string name of the event that this represents.", - "itemtype": "property", - "name": "type", - "type": "String", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 246, - "description": "The data that was passed in with this event.", - "itemtype": "property", - "name": "data", - "type": "Object", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 258, - "description": "The timestamp when the event occurred.", - "itemtype": "property", - "name": "timeStamp", - "type": "Number", - "readonly": "", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 268, - "description": "Stops the propagation of events up the scene graph (prevents bubbling).", - "itemtype": "method", - "name": "stopPropagation", - "class": "Event" - }, - { - "file": "src/pixi/utils/EventTarget.js", - "line": 277, - "description": "Stops the propagation of events to sibling listeners (no longer calls any listeners).", - "itemtype": "method", - "name": "stopImmediatePropagation", - "class": "Event" - }, - { - "file": "src/pixi/utils/Polyk.js", - "line": 42, - "description": "Triangulates shapes for webGL graphic fills.", - "itemtype": "method", - "name": "Triangulate", - "class": "PolyK" - }, - { - "file": "src/pixi/utils/Polyk.js", - "line": 120, - "description": "Checks whether a point is within a triangle", - "itemtype": "method", - "name": "_PointInTriangle", - "params": [ - { - "name": "px", - "description": "x coordinate of the point to test", - "type": "Number" - }, - { - "name": "py", - "description": "y coordinate of the point to test", - "type": "Number" - }, - { - "name": "ax", - "description": "x coordinate of the a point of the triangle", - "type": "Number" - }, - { - "name": "ay", - "description": "y coordinate of the a point of the triangle", - "type": "Number" - }, - { - "name": "bx", - "description": "x coordinate of the b point of the triangle", - "type": "Number" - }, - { - "name": "by", - "description": "y coordinate of the b point of the triangle", - "type": "Number" - }, - { - "name": "cx", - "description": "x coordinate of the c point of the triangle", - "type": "Number" - }, - { - "name": "cy", - "description": "y coordinate of the c point of the triangle", - "type": "Number" - } - ], - "access": "private", - "tagname": "", - "return": { - "description": "", - "type": "Boolean" - }, - "class": "PolyK" - }, - { - "file": "src/pixi/utils/Polyk.js", - "line": 158, - "description": "Checks whether a shape is convex", - "itemtype": "method", - "name": "_convex", - "access": "private", - "tagname": "", - "return": { - "description": "", - "type": "Boolean" - }, - "class": "PolyK" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 12, - "description": "A polyfill for requestAnimationFrame\nYou can actually use both requestAnimationFrame and requestAnimFrame, \nyou will still benefit from the polyfill", - "itemtype": "method", - "name": "requestAnimationFrame", - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 20, - "description": "A polyfill for cancelAnimationFrame", - "itemtype": "method", - "name": "cancelAnimationFrame", - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 54, - "description": "Converts a hex color number to an [R, G, B] array", - "itemtype": "method", - "name": "hex2rgb", - "params": [ - { - "name": "hex", - "description": "", - "type": "Number" - } - ], - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 64, - "description": "Converts a color as an [R, G, B] array to a hex number", - "itemtype": "method", - "name": "rgb2hex", - "params": [ - { - "name": "rgb", - "description": "", - "type": "Array" - } - ], - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 74, - "description": "A polyfill for Function.prototype.bind", - "itemtype": "method", - "name": "bind", - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 168, - "description": "Checks whether the Canvas BlendModes are supported by the current browser", - "itemtype": "method", - "name": "canUseNewCanvasBlendModes", - "return": { - "description": "whether they are supported", - "type": "Boolean" - }, - "class": "AjaxRequest" - }, - { - "file": "src/pixi/utils/Utils.js", - "line": 189, - "description": "Given a number, this function returns the closest number that is a power of two\nthis function is taken from Starling Framework as its pretty neat ;)", - "itemtype": "method", - "name": "getNextPowerOfTwo", - "params": [ - { - "name": "number", - "description": "", - "type": "Number" - } - ], - "return": { - "description": "the closest number that is a power of two", - "type": "Number" - }, - "class": "AjaxRequest" - }, - { - "file": "src/pixi/InteractionData.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "InteractionData" - }, - { - "file": "src/pixi/InteractionData.js", - "line": 13, - "description": "This point stores the global coords of where the touch/mouse event happened", - "itemtype": "property", - "name": "global", - "type": "Point", - "class": "InteractionData" - }, - { - "file": "src/pixi/InteractionData.js", - "line": 21, - "description": "The target Sprite that was interacted with", - "itemtype": "property", - "name": "target", - "type": "Sprite", - "class": "InteractionData" - }, - { - "file": "src/pixi/InteractionData.js", - "line": 29, - "description": "When passed to an event handler, this will be the original DOM Event that was captured", - "itemtype": "property", - "name": "originalEvent", - "type": "Event", - "class": "InteractionData" - }, - { - "file": "src/pixi/InteractionData.js", - "line": 38, - "description": "This will return the local coordinates of the specified displayObject for this InteractionData", - "itemtype": "method", - "name": "getLocalPosition", - "params": [ - { - "name": "displayObject", - "description": "The DisplayObject that you would like the local coords off", - "type": "DisplayObject" - }, - { - "name": "point", - "description": "A Point object in which to store the value, optional (otherwise will create a new point)", - "type": "Point", - "optional": true - } - ], - "return": { - "description": "A point containing the coordinates of the InteractionData position relative to the DisplayObject", - "type": "Point" - }, - "class": "InteractionData" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 16, - "description": "A reference to the stage", - "itemtype": "property", - "name": "stage", - "type": "Stage", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 24, - "description": "The mouse data", - "itemtype": "property", - "name": "mouse", - "type": "InteractionData", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 32, - "description": "An object that stores current touches (InteractionData) by id reference", - "itemtype": "property", - "name": "touches", - "type": "Object", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 40, - "itemtype": "property", - "name": "tempPoint", - "type": "Point", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 47, - "itemtype": "property", - "name": "mouseoverEnabled", - "type": "Boolean", - "default": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 54, - "description": "Tiny little interactiveData pool !", - "itemtype": "property", - "name": "pool", - "type": "Array", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 62, - "description": "An array containing all the iterative items from the our interactive tree", - "itemtype": "property", - "name": "interactiveItems", - "type": "Array", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 70, - "description": "Our canvas", - "itemtype": "property", - "name": "interactionDOMElement", - "type": "HTMLCanvasElement", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 80, - "itemtype": "property", - "name": "onMouseMove", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 86, - "itemtype": "property", - "name": "onMouseDown", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 92, - "itemtype": "property", - "name": "onMouseOut", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 98, - "itemtype": "property", - "name": "onMouseUp", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 104, - "itemtype": "property", - "name": "onTouchStart", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 110, - "itemtype": "property", - "name": "onTouchEnd", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 116, - "itemtype": "property", - "name": "onTouchMove", - "type": "Function", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 122, - "itemtype": "property", - "name": "last", - "type": "Number", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 128, - "description": "The css style of the cursor that is being used", - "itemtype": "property", - "name": "currentCursorStyle", - "type": "String", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 135, - "description": "Is set to true when the mouse is moved out of the canvas", - "itemtype": "property", - "name": "mouseOut", - "type": "Boolean", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 142, - "itemtype": "property", - "name": "resolution", - "type": "Number", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 152, - "description": "Collects an interactive sprite recursively to have their interactions managed", - "itemtype": "method", - "name": "collectInteractiveSprite", - "params": [ - { - "name": "displayObject", - "description": "the displayObject to collect", - "type": "DisplayObject" - }, - { - "name": "iParent", - "description": "the display object's parent", - "type": "DisplayObject" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 193, - "description": "Sets the target for event delegation", - "itemtype": "method", - "name": "setTarget", - "params": [ - { - "name": "target", - "description": "the renderer to bind events to", - "type": "WebGLRenderer|CanvasRenderer" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 211, - "description": "Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM\nelements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element\nto receive those events", - "itemtype": "method", - "name": "setTargetDomElement", - "params": [ - { - "name": "domElement", - "description": "the DOM element which will receive mouse and touch events", - "type": "DOMElement" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 245, - "itemtype": "method", - "name": "removeEvents", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 270, - "description": "updates the state of interactive objects", - "itemtype": "method", - "name": "update", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 355, - "itemtype": "method", - "name": "rebuildInteractiveGraph", - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 380, - "description": "Is called when the mouse moves across the renderer element", - "itemtype": "method", - "name": "onMouseMove", - "params": [ - { - "name": "event", - "description": "The DOM event of the mouse moving", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 416, - "description": "Is called when the mouse button is pressed down on the renderer element", - "itemtype": "method", - "name": "onMouseDown", - "params": [ - { - "name": "event", - "description": "The DOM event of a mouse button being pressed down", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 477, - "description": "Is called when the mouse is moved out of the renderer element", - "itemtype": "method", - "name": "onMouseOut", - "params": [ - { - "name": "event", - "description": "The DOM event of a mouse being moved out", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 518, - "description": "Is called when the mouse button is released on the renderer element", - "itemtype": "method", - "name": "onMouseUp", - "params": [ - { - "name": "event", - "description": "The DOM event of a mouse button being released", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 586, - "description": "Tests if the current mouse coordinates hit a sprite", - "itemtype": "method", - "name": "hitTest", - "params": [ - { - "name": "item", - "description": "The displayObject to test for a hit", - "type": "DisplayObject" - }, - { - "name": "interactionData", - "description": "The interactionData object to update in the case there is a hit", - "type": "InteractionData" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 683, - "description": "Is called when a touch is moved across the renderer element", - "itemtype": "method", - "name": "onTouchMove", - "params": [ - { - "name": "event", - "description": "The DOM event of a touch moving across the renderer view", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 729, - "description": "Is called when a touch is started on the renderer element", - "itemtype": "method", - "name": "onTouchStart", - "params": [ - { - "name": "event", - "description": "The DOM event of a touch starting on the renderer view", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/InteractionManager.js", - "line": 798, - "description": "Is called when a touch is ended on the renderer element", - "itemtype": "method", - "name": "onTouchEnd", - "params": [ - { - "name": "event", - "description": "The DOM event of a touch ending on the renderer view", - "type": "Event" - } - ], - "access": "private", - "tagname": "", - "class": "InteractionManager" - }, - { - "file": "src/pixi/Intro.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "" - }, - { - "file": "src/pixi/Outro.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "" - }, - { - "file": "src/pixi/Pixi.js", - "line": 1, - "author": "Mat Groves http://matgroves.com/ @Doormat23", - "class": "" - } - ], - "warnings": [ - { - "message": "unknown tag: copyright", - "line": " src/pixi/extras/Rope.js:1" - }, - { - "message": "replacing incorrect tag: returns with return", - "line": " src/pixi/textures/VideoTexture.js:87" - }, - { - "message": "replacing incorrect tag: returns with return", - "line": " src/pixi/textures/VideoTexture.js:126" - }, - { - "message": "replacing incorrect tag: returns with return", - "line": " src/pixi/utils/EventTarget.js:41" - }, - { - "message": "unknown tag: alias", - "line": " src/pixi/utils/EventTarget.js:54" - }, - { - "message": "replacing incorrect tag: returns with return", - "line": " src/pixi/utils/EventTarget.js:54" - }, - { - "message": "unknown tag: alias", - "line": " src/pixi/utils/EventTarget.js:107" - }, - { - "message": "unknown tag: alias", - "line": " src/pixi/utils/EventTarget.js:143" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/DisplayObject.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/DisplayObjectContainer.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/MovieClip.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/Sprite.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/SpriteBatch.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/display/Stage.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Rope.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:1" - }, - { - "message": "Missing item type\ncx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of", - "line": " src/pixi/extras/Spine.js:213" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:506" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:513" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:520" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:528" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:535" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:542" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:577" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:585" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:600" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:604" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:611" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:618" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:625" - }, - { - "message": "Missing item type\nfrom the new skin are attached if the corresponding attachment from the old skin was attached.", - "line": " src/pixi/extras/Spine.js:637" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:644" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:648" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:657" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:849" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:855" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:861" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:867" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:885" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Spine.js:1310" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/Strip.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/extras/TilingSprite.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/AbstractFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/AlphaMaskFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/AsciiFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/BlurFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/BlurXFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/BlurYFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/ColorMatrixFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/ColorStepFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/CrossHatchFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/DisplacementFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/DotScreenFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/FilterBlock.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/GrayFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/InvertFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/NoiseFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/NormalMapFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/PixelateFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/RGBSplitFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/SepiaFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/SmartBlurFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/TiltShiftFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/TiltShiftXFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/TiltShiftYFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/filters/TwistFilter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Circle.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Ellipse.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Matrix.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Point.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Polygon.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/Rectangle.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/geom/RoundedRectangle.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/AssetLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/AtlasLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/BitmapFontLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/ImageLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/JsonLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/SpineLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/loaders/SpriteSheetLoader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/primitives/Graphics.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/canvas/utils/CanvasBuffer.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/canvas/utils/CanvasMaskManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/canvas/utils/CanvasTinter.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/canvas/CanvasGraphics.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/canvas/CanvasRenderer.js:1" - }, - { - "message": "Missing item type\nIf true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation.\nHandy for crisp pixel art and speed on legacy devices.", - "line": " src/pixi/renderers/canvas/CanvasRenderer.js:157" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/shaders/PixiFastShader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/shaders/PixiShader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/shaders/PrimitiveShader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/shaders/StripShader.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/FilterTexture.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLFilterManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLGraphics.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLMaskManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLShaderManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLShaderUtils.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/utils/WebGLStencilManager.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/renderers/webgl/WebGLRenderer.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/text/BitmapText.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/text/Text.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/textures/BaseTexture.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/textures/RenderTexture.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/textures/Texture.js:1" - }, - { - "message": "Missing item type\nMimic Pixi BaseTexture.from.... method.", - "line": " src/pixi/textures/VideoTexture.js:87" - }, - { - "message": "Missing item type\nMimic PIXI Texture.from... method.", - "line": " src/pixi/textures/VideoTexture.js:126" - }, - { - "message": "Missing item type", - "line": " src/pixi/utils/Detector.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/utils/EventTarget.js:1" - }, - { - "message": "Missing item type\nOriginally based on https://github.com/mrdoob/eventtarget.js/ from mr Doob.\nCurrently takes inspiration from the nodejs EventEmitter, EventEmitter3, and smokesignals", - "line": " src/pixi/utils/EventTarget.js:6" - }, - { - "message": "Missing item type\nBackward compat from when this used to be a function", - "line": " src/pixi/utils/EventTarget.js:24" - }, - { - "message": "Missing item type", - "line": " src/pixi/utils/Utils.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/InteractionData.js:1" - }, - { - "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/Outro.js:1" - }, - { - "message": "Missing item type", - "line": " src/pixi/Pixi.js:1" - } - ] -} \ No newline at end of file diff --git a/tutorial-4/pixi.js-master/docs/files/index.html b/tutorial-4/pixi.js-master/docs/files/index.html deleted file mode 100755 index 487fe15..0000000 --- a/tutorial-4/pixi.js-master/docs/files/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Redirector - - - - Click here to redirect - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_InteractionData.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_InteractionData.js.html deleted file mode 100755 index f913d34..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_InteractionData.js.html +++ /dev/null @@ -1,344 +0,0 @@ - - - - - src/pixi/InteractionData.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/InteractionData.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * Holds all information related to an Interaction event
    - *
    - * @class InteractionData
    - * @constructor
    - */
    -PIXI.InteractionData = function()
    -{
    -    /**
    -     * This point stores the global coords of where the touch/mouse event happened
    -     *
    -     * @property global
    -     * @type Point
    -     */
    -    this.global = new PIXI.Point();
    -
    -    /**
    -     * The target Sprite that was interacted with
    -     *
    -     * @property target
    -     * @type Sprite
    -     */
    -    this.target = null;
    -
    -    /**
    -     * When passed to an event handler, this will be the original DOM Event that was captured
    -     *
    -     * @property originalEvent
    -     * @type Event
    -     */
    -    this.originalEvent = null;
    -};
    -
    -/**
    - * This will return the local coordinates of the specified displayObject for this InteractionData
    - *
    - * @method getLocalPosition
    - * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off
    - * @param [point] {Point} A Point object in which to store the value, optional (otherwise will create a new point)
    - * @return {Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject
    - */
    -PIXI.InteractionData.prototype.getLocalPosition = function(displayObject, point)
    -{
    -    var worldTransform = displayObject.worldTransform;
    -    var global = this.global;
    -
    -    // do a cheeky transform to get the mouse coords;
    -    var a00 = worldTransform.a, a01 = worldTransform.c, a02 = worldTransform.tx,
    -        a10 = worldTransform.b, a11 = worldTransform.d, a12 = worldTransform.ty,
    -        id = 1 / (a00 * a11 + a01 * -a10);
    -
    -    point = point || new PIXI.Point();
    -
    -    point.x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id;
    -    point.y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id;
    -
    -    // set the mouse coords...
    -    return point;
    -};
    -
    -// constructor
    -PIXI.InteractionData.prototype.constructor = PIXI.InteractionData;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_InteractionManager.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_InteractionManager.js.html deleted file mode 100755 index 824229b..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_InteractionManager.js.html +++ /dev/null @@ -1,1156 +0,0 @@ - - - - - src/pixi/InteractionManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/InteractionManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    - /**
    - * The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive
    - * if its interactive parameter is set to true
    - * This manager also supports multitouch.
    - *
    - * @class InteractionManager
    - * @constructor
    - * @param stage {Stage} The stage to handle interactions
    - */
    -PIXI.InteractionManager = function(stage)
    -{
    -    /**
    -     * A reference to the stage
    -     *
    -     * @property stage
    -     * @type Stage
    -     */
    -    this.stage = stage;
    -
    -    /**
    -     * The mouse data
    -     *
    -     * @property mouse
    -     * @type InteractionData
    -     */
    -    this.mouse = new PIXI.InteractionData();
    -
    -    /**
    -     * An object that stores current touches (InteractionData) by id reference
    -     *
    -     * @property touches
    -     * @type Object
    -     */
    -    this.touches = {};
    -
    -    /**
    -     * @property tempPoint
    -     * @type Point
    -     * @private
    -     */
    -    this.tempPoint = new PIXI.Point();
    -
    -    /**
    -     * @property mouseoverEnabled
    -     * @type Boolean
    -     * @default
    -     */
    -    this.mouseoverEnabled = true;
    -
    -    /**
    -     * Tiny little interactiveData pool !
    -     *
    -     * @property pool
    -     * @type Array
    -     */
    -    this.pool = [];
    -
    -    /**
    -     * An array containing all the iterative items from the our interactive tree
    -     * @property interactiveItems
    -     * @type Array
    -     * @private
    -     */
    -    this.interactiveItems = [];
    -
    -    /**
    -     * Our canvas
    -     * @property interactionDOMElement
    -     * @type HTMLCanvasElement
    -     * @private
    -     */
    -    this.interactionDOMElement = null;
    -
    -    //this will make it so that you don't have to call bind all the time
    -
    -    /**
    -     * @property onMouseMove
    -     * @type Function
    -     */
    -    this.onMouseMove = this.onMouseMove.bind( this );
    -
    -    /**
    -     * @property onMouseDown
    -     * @type Function
    -     */
    -    this.onMouseDown = this.onMouseDown.bind(this);
    -
    -    /**
    -     * @property onMouseOut
    -     * @type Function
    -     */
    -    this.onMouseOut = this.onMouseOut.bind(this);
    -
    -    /**
    -     * @property onMouseUp
    -     * @type Function
    -     */
    -    this.onMouseUp = this.onMouseUp.bind(this);
    -
    -    /**
    -     * @property onTouchStart
    -     * @type Function
    -     */
    -    this.onTouchStart = this.onTouchStart.bind(this);
    -
    -    /**
    -     * @property onTouchEnd
    -     * @type Function
    -     */
    -    this.onTouchEnd = this.onTouchEnd.bind(this);
    -
    -    /**
    -     * @property onTouchMove
    -     * @type Function
    -     */
    -    this.onTouchMove = this.onTouchMove.bind(this);
    -
    -    /**
    -     * @property last
    -     * @type Number
    -     */
    -    this.last = 0;
    -
    -    /**
    -     * The css style of the cursor that is being used
    -     * @property currentCursorStyle
    -     * @type String
    -     */
    -    this.currentCursorStyle = 'inherit';
    -
    -    /**
    -     * Is set to true when the mouse is moved out of the canvas
    -     * @property mouseOut
    -     * @type Boolean
    -     */
    -    this.mouseOut = false;
    -
    -    /**
    -     * @property resolution
    -     * @type Number
    -     */
    -    this.resolution = 1;
    -};
    -
    -// constructor
    -PIXI.InteractionManager.prototype.constructor = PIXI.InteractionManager;
    -
    -/**
    - * Collects an interactive sprite recursively to have their interactions managed
    - *
    - * @method collectInteractiveSprite
    - * @param displayObject {DisplayObject} the displayObject to collect
    - * @param iParent {DisplayObject} the display object's parent
    - * @private
    - */
    -PIXI.InteractionManager.prototype.collectInteractiveSprite = function(displayObject, iParent)
    -{
    -    var children = displayObject.children;
    -    var length = children.length;
    -
    -    // make an interaction tree... {item.__interactiveParent}
    -    for (var i = length - 1; i >= 0; i--)
    -    {
    -        var child = children[i];
    -
    -        // push all interactive bits
    -        if (child._interactive)
    -        {
    -            iParent.interactiveChildren = true;
    -            //child.__iParent = iParent;
    -            this.interactiveItems.push(child);
    -
    -            if (child.children.length > 0) {
    -                this.collectInteractiveSprite(child, child);
    -            }
    -        }
    -        else
    -        {
    -            child.__iParent = null;
    -            if (child.children.length > 0)
    -            {
    -                this.collectInteractiveSprite(child, iParent);
    -            }
    -        }
    -
    -    }
    -};
    -
    -/**
    - * Sets the target for event delegation
    - *
    - * @method setTarget
    - * @param target {WebGLRenderer|CanvasRenderer} the renderer to bind events to
    - * @private
    - */
    -PIXI.InteractionManager.prototype.setTarget = function(target)
    -{
    -    this.target = target;
    -    this.resolution = target.resolution;
    -
    -    // Check if the dom element has been set. If it has don't do anything.
    -    if (this.interactionDOMElement !== null) return;
    -
    -    this.setTargetDomElement (target.view);
    -};
    -
    -/**
    - * Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM
    - * elements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element
    - * to receive those events
    - *
    - * @method setTargetDomElement
    - * @param domElement {DOMElement} the DOM element which will receive mouse and touch events
    - * @private
    - */
    -PIXI.InteractionManager.prototype.setTargetDomElement = function(domElement)
    -{
    -    this.removeEvents();
    -
    -    if (window.navigator.msPointerEnabled)
    -    {
    -        // time to remove some of that zoom in ja..
    -        domElement.style['-ms-content-zooming'] = 'none';
    -        domElement.style['-ms-touch-action'] = 'none';
    -    }
    -
    -    this.interactionDOMElement = domElement;
    -
    -    domElement.addEventListener('mousemove',  this.onMouseMove, true);
    -    domElement.addEventListener('mousedown',  this.onMouseDown, true);
    -    domElement.addEventListener('mouseout',   this.onMouseOut, true);
    -
    -    // aint no multi touch just yet!
    -    domElement.addEventListener('touchstart', this.onTouchStart, true);
    -    domElement.addEventListener('touchend', this.onTouchEnd, true);
    -    domElement.addEventListener('touchmove', this.onTouchMove, true);
    -
    -    window.addEventListener('mouseup',  this.onMouseUp, true);
    -};
    -
    -/**
    - * @method removeEvents
    - * @private
    - */
    -PIXI.InteractionManager.prototype.removeEvents = function()
    -{
    -    if (!this.interactionDOMElement) return;
    -
    -    this.interactionDOMElement.style['-ms-content-zooming'] = '';
    -    this.interactionDOMElement.style['-ms-touch-action'] = '';
    -
    -    this.interactionDOMElement.removeEventListener('mousemove',  this.onMouseMove, true);
    -    this.interactionDOMElement.removeEventListener('mousedown',  this.onMouseDown, true);
    -    this.interactionDOMElement.removeEventListener('mouseout',   this.onMouseOut, true);
    -
    -    // aint no multi touch just yet!
    -    this.interactionDOMElement.removeEventListener('touchstart', this.onTouchStart, true);
    -    this.interactionDOMElement.removeEventListener('touchend', this.onTouchEnd, true);
    -    this.interactionDOMElement.removeEventListener('touchmove', this.onTouchMove, true);
    -
    -    this.interactionDOMElement = null;
    -
    -    window.removeEventListener('mouseup',  this.onMouseUp, true);
    -};
    -
    -/**
    - * updates the state of interactive objects
    - *
    - * @method update
    - * @private
    - */
    -PIXI.InteractionManager.prototype.update = function()
    -{
    -    if (!this.target) return;
    -
    -    // frequency of 30fps??
    -    var now = Date.now();
    -    var diff = now - this.last;
    -    diff = (diff * PIXI.INTERACTION_FREQUENCY ) / 1000;
    -    if (diff < 1) return;
    -    this.last = now;
    -
    -    var i = 0;
    -
    -    // ok.. so mouse events??
    -    // yes for now :)
    -    // OPTIMISE - how often to check??
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    // loop through interactive objects!
    -    var length = this.interactiveItems.length;
    -    var cursor = 'inherit';
    -    var over = false;
    -
    -    for (i = 0; i < length; i++)
    -    {
    -        var item = this.interactiveItems[i];
    -
    -        // OPTIMISATION - only calculate every time if the mousemove function exists..
    -        // OK so.. does the object have any other interactive functions?
    -        // hit-test the clip!
    -       // if (item.mouseover || item.mouseout || item.buttonMode)
    -       // {
    -        // ok so there are some functions so lets hit test it..
    -        item.__hit = this.hitTest(item, this.mouse);
    -        this.mouse.target = item;
    -        // ok so deal with interactions..
    -        // looks like there was a hit!
    -        if (item.__hit && !over)
    -        {
    -            if (item.buttonMode) cursor = item.defaultCursor;
    -
    -            if (!item.interactiveChildren)
    -            {
    -                over = true;
    -            }
    -
    -            if (!item.__isOver)
    -            {
    -                if (item.mouseover)
    -                {
    -                    item.mouseover (this.mouse);
    -                }
    -                item.__isOver = true;
    -            }
    -        }
    -        else
    -        {
    -            if (item.__isOver)
    -            {
    -                // roll out!
    -                if (item.mouseout)
    -                {
    -                    item.mouseout (this.mouse);
    -                }
    -                item.__isOver = false;
    -            }
    -        }
    -    }
    -
    -    if (this.currentCursorStyle !== cursor)
    -    {
    -        this.currentCursorStyle = cursor;
    -        this.interactionDOMElement.style.cursor = cursor;
    -    }
    -};
    -
    -/**
    - * @method rebuildInteractiveGraph
    - * @private
    - */
    -PIXI.InteractionManager.prototype.rebuildInteractiveGraph = function()
    -{
    -    this.dirty = false;
    -
    -    var len = this.interactiveItems.length;
    -
    -    for (var i = 0; i < len; i++) {
    -        this.interactiveItems[i].interactiveChildren = false;
    -    }
    -
    -    this.interactiveItems = [];
    -
    -    if (this.stage.interactive)
    -    {
    -        this.interactiveItems.push(this.stage);
    -    }
    -
    -    // Go through and collect all the objects that are interactive..
    -    this.collectInteractiveSprite(this.stage, this.stage);
    -};
    -
    -/**
    - * Is called when the mouse moves across the renderer element
    - *
    - * @method onMouseMove
    - * @param event {Event} The DOM event of the mouse moving
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onMouseMove = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    this.mouse.originalEvent = event;
    -
    -    // TODO optimize by not check EVERY TIME! maybe half as often? //
    -    var rect = this.interactionDOMElement.getBoundingClientRect();
    -
    -    this.mouse.global.x = (event.clientX - rect.left) * (this.target.width / rect.width) / this.resolution;
    -    this.mouse.global.y = (event.clientY - rect.top) * ( this.target.height / rect.height) / this.resolution;
    -
    -    var length = this.interactiveItems.length;
    -
    -    for (var i = 0; i < length; i++)
    -    {
    -        var item = this.interactiveItems[i];
    -
    -        // Call the function!
    -        if (item.mousemove)
    -        {
    -            item.mousemove(this.mouse);
    -        }
    -    }
    -};
    -
    -/**
    - * Is called when the mouse button is pressed down on the renderer element
    - *
    - * @method onMouseDown
    - * @param event {Event} The DOM event of a mouse button being pressed down
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onMouseDown = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    this.mouse.originalEvent = event;
    -
    -    if (PIXI.AUTO_PREVENT_DEFAULT)
    -    {
    -        this.mouse.originalEvent.preventDefault();
    -    }
    -
    -    // loop through interaction tree...
    -    // hit test each item! ->
    -    // get interactive items under point??
    -    //stage.__i
    -    var length = this.interactiveItems.length;
    -
    -    var e = this.mouse.originalEvent;
    -    var isRightButton = e.button === 2 || e.which === 3;
    -    var downFunction = isRightButton ? 'rightdown' : 'mousedown';
    -    var clickFunction = isRightButton ? 'rightclick' : 'click';
    -    var buttonIsDown = isRightButton ? '__rightIsDown' : '__mouseIsDown';
    -    var isDown = isRightButton ? '__isRightDown' : '__isDown';
    -
    -    // while
    -    // hit test
    -    for (var i = 0; i < length; i++)
    -    {
    -        var item = this.interactiveItems[i];
    -
    -        if (item[downFunction] || item[clickFunction])
    -        {
    -            item[buttonIsDown] = true;
    -            item.__hit = this.hitTest(item, this.mouse);
    -
    -            if (item.__hit)
    -            {
    -                //call the function!
    -                if (item[downFunction])
    -                {
    -                    item[downFunction](this.mouse);
    -                }
    -                item[isDown] = true;
    -
    -                // just the one!
    -                if (!item.interactiveChildren) break;
    -            }
    -        }
    -    }
    -};
    -
    -/**
    - * Is called when the mouse is moved out of the renderer element
    - *
    - * @method onMouseOut
    - * @param event {Event} The DOM event of a mouse being moved out
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onMouseOut = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    this.mouse.originalEvent = event;
    -
    -    var length = this.interactiveItems.length;
    -
    -    this.interactionDOMElement.style.cursor = 'inherit';
    -
    -    for (var i = 0; i < length; i++)
    -    {
    -        var item = this.interactiveItems[i];
    -        if (item.__isOver)
    -        {
    -            this.mouse.target = item;
    -            if (item.mouseout)
    -            {
    -                item.mouseout(this.mouse);
    -            }
    -            item.__isOver = false;
    -        }
    -    }
    -
    -    this.mouseOut = true;
    -
    -    // move the mouse to an impossible position
    -    this.mouse.global.x = -10000;
    -    this.mouse.global.y = -10000;
    -};
    -
    -/**
    - * Is called when the mouse button is released on the renderer element
    - *
    - * @method onMouseUp
    - * @param event {Event} The DOM event of a mouse button being released
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onMouseUp = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    this.mouse.originalEvent = event;
    -
    -    var length = this.interactiveItems.length;
    -    var up = false;
    -
    -    var e = this.mouse.originalEvent;
    -    var isRightButton = e.button === 2 || e.which === 3;
    -
    -    var upFunction = isRightButton ? 'rightup' : 'mouseup';
    -    var clickFunction = isRightButton ? 'rightclick' : 'click';
    -    var upOutsideFunction = isRightButton ? 'rightupoutside' : 'mouseupoutside';
    -    var isDown = isRightButton ? '__isRightDown' : '__isDown';
    -
    -    for (var i = 0; i < length; i++)
    -    {
    -        var item = this.interactiveItems[i];
    -
    -        if (item[clickFunction] || item[upFunction] || item[upOutsideFunction])
    -        {
    -            item.__hit = this.hitTest(item, this.mouse);
    -
    -            if (item.__hit && !up)
    -            {
    -                //call the function!
    -                if (item[upFunction])
    -                {
    -                    item[upFunction](this.mouse);
    -                }
    -                if (item[isDown])
    -                {
    -                    if (item[clickFunction])
    -                    {
    -                        item[clickFunction](this.mouse);
    -                    }
    -                }
    -
    -                if (!item.interactiveChildren)
    -                {
    -                    up = true;
    -                }
    -            }
    -            else
    -            {
    -                if (item[isDown])
    -                {
    -                    if (item[upOutsideFunction]) item[upOutsideFunction](this.mouse);
    -                }
    -            }
    -
    -            item[isDown] = false;
    -        }
    -    }
    -};
    -
    -/**
    - * Tests if the current mouse coordinates hit a sprite
    - *
    - * @method hitTest
    - * @param item {DisplayObject} The displayObject to test for a hit
    - * @param interactionData {InteractionData} The interactionData object to update in the case there is a hit
    - * @private
    - */
    -PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
    -{
    -    var global = interactionData.global;
    -
    -    if (!item.worldVisible)
    -    {
    -        return false;
    -    }
    -
    -    // temp fix for if the element is in a non visible
    -
    -    var worldTransform = item.worldTransform, i,
    -        a = worldTransform.a, b = worldTransform.b,
    -        c = worldTransform.c, tx = worldTransform.tx,
    -        d = worldTransform.d, ty = worldTransform.ty,
    -     
    -        id = 1 / (a * d + c * -b),
    -        x = d * id * global.x + -c * id * global.y + (ty * c - tx * d) * id,
    -        y = a * id * global.y + -b * id * global.x + (-ty * a + tx * b) * id;
    -
    -
    -    interactionData.target = item;
    -
    -    //a sprite or display object with a hit area defined
    -    if (item.hitArea && item.hitArea.contains)
    -    {
    -        if (item.hitArea.contains(x, y))
    -        {
    -            interactionData.target = item;
    -            return true;
    -        }
    -        return false;
    -    }
    -    // a sprite with no hitarea defined
    -    else if(item instanceof PIXI.Sprite)
    -    {
    -        var width = item.texture.frame.width;
    -        var height = item.texture.frame.height;
    -        var x1 = -width * item.anchor.x;
    -        var y1;
    -
    -        if (x > x1 && x < x1 + width)
    -        {
    -            y1 = -height * item.anchor.y;
    -
    -            if (y > y1 && y < y1 + height)
    -            {
    -                // set the target property if a hit is true!
    -                interactionData.target = item;
    -                return true;
    -            }
    -        }
    -    }
    -    else if(item instanceof PIXI.Graphics)
    -    {
    -        var graphicsData = item.graphicsData;
    -        for (i = 0; i < graphicsData.length; i++)
    -        {
    -            var data = graphicsData[i];
    -            if(!data.fill)continue;
    -
    -            // only deal with fills..
    -            if(data.shape)
    -            {
    -                if(data.shape.contains(x, y))
    -                {
    -                    interactionData.target = item;
    -                    return true;
    -                }
    -            }
    -        }
    -    }
    -
    -    var length = item.children.length;
    -
    -    for (i = 0; i < length; i++)
    -    {
    -        var tempItem = item.children[i];
    -        var hit = this.hitTest(tempItem, interactionData);
    -        if (hit)
    -        {
    -            // hmm.. TODO SET CORRECT TARGET?
    -            interactionData.target = item;
    -            return true;
    -        }
    -    }
    -    return false;
    -};
    -
    -/**
    - * Is called when a touch is moved across the renderer element
    - *
    - * @method onTouchMove
    - * @param event {Event} The DOM event of a touch moving across the renderer view
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onTouchMove = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    var rect = this.interactionDOMElement.getBoundingClientRect();
    -    var changedTouches = event.changedTouches;
    -    var touchData;
    -    var i = 0;
    -
    -    for (i = 0; i < changedTouches.length; i++)
    -    {
    -        var touchEvent = changedTouches[i];
    -        touchData = this.touches[touchEvent.identifier];
    -        touchData.originalEvent = event;
    -
    -        // update the touch position
    -        touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution;
    -        touchData.global.y = ( (touchEvent.clientY - rect.top)  * (this.target.height / rect.height) )  / this.resolution;
    -        if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height)
    -        {
    -            //Support for CocoonJS fullscreen scale modes
    -            touchData.global.x = touchEvent.clientX;
    -            touchData.global.y = touchEvent.clientY;
    -        }
    -
    -        for (var j = 0; j < this.interactiveItems.length; j++)
    -        {
    -            var item = this.interactiveItems[j];
    -            if (item.touchmove && item.__touchData && item.__touchData[touchEvent.identifier])
    -            {
    -                item.touchmove(touchData);
    -            }
    -        }
    -    }
    -};
    -
    -/**
    - * Is called when a touch is started on the renderer element
    - *
    - * @method onTouchStart
    - * @param event {Event} The DOM event of a touch starting on the renderer view
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onTouchStart = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    var rect = this.interactionDOMElement.getBoundingClientRect();
    -
    -    if (PIXI.AUTO_PREVENT_DEFAULT)
    -    {
    -        event.preventDefault();
    -    }
    -
    -    var changedTouches = event.changedTouches;
    -    for (var i=0; i < changedTouches.length; i++)
    -    {
    -        var touchEvent = changedTouches[i];
    -
    -        var touchData = this.pool.pop();
    -        if (!touchData)
    -        {
    -            touchData = new PIXI.InteractionData();
    -        }
    -
    -        touchData.originalEvent = event;
    -
    -        this.touches[touchEvent.identifier] = touchData;
    -        touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution;
    -        touchData.global.y = ( (touchEvent.clientY - rect.top)  * (this.target.height / rect.height) ) / this.resolution;
    -        if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height)
    -        {
    -            //Support for CocoonJS fullscreen scale modes
    -            touchData.global.x = touchEvent.clientX;
    -            touchData.global.y = touchEvent.clientY;
    -        }
    -
    -        var length = this.interactiveItems.length;
    -
    -        for (var j = 0; j < length; j++)
    -        {
    -            var item = this.interactiveItems[j];
    -
    -            if (item.touchstart || item.tap)
    -            {
    -                item.__hit = this.hitTest(item, touchData);
    -
    -                if (item.__hit)
    -                {
    -                    //call the function!
    -                    if (item.touchstart)item.touchstart(touchData);
    -                    item.__isDown = true;
    -                    item.__touchData = item.__touchData || {};
    -                    item.__touchData[touchEvent.identifier] = touchData;
    -
    -                    if (!item.interactiveChildren) break;
    -                }
    -            }
    -        }
    -    }
    -};
    -
    -/**
    - * Is called when a touch is ended on the renderer element
    - *
    - * @method onTouchEnd
    - * @param event {Event} The DOM event of a touch ending on the renderer view
    - * @private
    - */
    -PIXI.InteractionManager.prototype.onTouchEnd = function(event)
    -{
    -    if (this.dirty)
    -    {
    -        this.rebuildInteractiveGraph();
    -    }
    -
    -    var rect = this.interactionDOMElement.getBoundingClientRect();
    -    var changedTouches = event.changedTouches;
    -
    -    for (var i=0; i < changedTouches.length; i++)
    -    {
    -        var touchEvent = changedTouches[i];
    -        var touchData = this.touches[touchEvent.identifier];
    -        var up = false;
    -        touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution;
    -        touchData.global.y = ( (touchEvent.clientY - rect.top)  * (this.target.height / rect.height) ) / this.resolution;
    -        if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height)
    -        {
    -            //Support for CocoonJS fullscreen scale modes
    -            touchData.global.x = touchEvent.clientX;
    -            touchData.global.y = touchEvent.clientY;
    -        }
    -
    -        var length = this.interactiveItems.length;
    -        for (var j = 0; j < length; j++)
    -        {
    -            var item = this.interactiveItems[j];
    -
    -            if (item.__touchData && item.__touchData[touchEvent.identifier])
    -            {
    -
    -                item.__hit = this.hitTest(item, item.__touchData[touchEvent.identifier]);
    -
    -                // so this one WAS down...
    -                touchData.originalEvent = event;
    -                // hitTest??
    -
    -                if (item.touchend || item.tap)
    -                {
    -                    if (item.__hit && !up)
    -                    {
    -                        if (item.touchend)
    -                        {
    -                            item.touchend(touchData);
    -                        }
    -                        if (item.__isDown && item.tap)
    -                        {
    -                            item.tap(touchData);
    -                        }
    -                        if (!item.interactiveChildren)
    -                        {
    -                            up = true;
    -                        }
    -                    }
    -                    else
    -                    {
    -                        if (item.__isDown && item.touchendoutside)
    -                        {
    -                            item.touchendoutside(touchData);
    -                        }
    -                    }
    -
    -                    item.__isDown = false;
    -                }
    -
    -                item.__touchData[touchEvent.identifier] = null;
    -            }
    -        }
    -        // remove the touch..
    -        this.pool.push(touchData);
    -        this.touches[touchEvent.identifier] = null;
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_Intro.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_Intro.js.html deleted file mode 100755 index 39c4332..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_Intro.js.html +++ /dev/null @@ -1,285 +0,0 @@ - - - - - src/pixi/Intro.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/Intro.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -(function(){
    -
    -    var root = this;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_Outro.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_Outro.js.html deleted file mode 100755 index a3fd28d..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_Outro.js.html +++ /dev/null @@ -1,292 +0,0 @@ - - - - - src/pixi/Outro.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/Outro.js

    - -
    -
    -/**
    - * @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 if (typeof define !== 'undefined' && define.amd) {
    -        define(PIXI);
    -    } else {
    -        root.PIXI = PIXI;
    -    }
    -}).call(this);
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_Pixi.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_Pixi.js.html deleted file mode 100755 index 3533110..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_Pixi.js.html +++ /dev/null @@ -1,395 +0,0 @@ - - - - - src/pixi/Pixi.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/Pixi.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * @module PIXI
    - */
    -var PIXI = PIXI || {};
    -
    -/* 
    -* 
    -* This file contains a lot of pixi consts which are used across the rendering engine
    -* @class Consts
    -*/
    -PIXI.WEBGL_RENDERER = 0;
    -PIXI.CANVAS_RENDERER = 1;
    -
    -// useful for testing against if your lib is using pixi.
    -PIXI.VERSION = "v2.1.0";
    -
    -
    -// the various blend modes supported by pixi
    -PIXI.blendModes = {
    -    NORMAL:0,
    -    ADD:1,
    -    MULTIPLY:2,
    -    SCREEN:3,
    -    OVERLAY:4,
    -    DARKEN:5,
    -    LIGHTEN:6,
    -    COLOR_DODGE:7,
    -    COLOR_BURN:8,
    -    HARD_LIGHT:9,
    -    SOFT_LIGHT:10,
    -    DIFFERENCE:11,
    -    EXCLUSION:12,
    -    HUE:13,
    -    SATURATION:14,
    -    COLOR:15,
    -    LUMINOSITY:16
    -};
    -
    -// the scale modes
    -PIXI.scaleModes = {
    -    DEFAULT:0,
    -    LINEAR:0,
    -    NEAREST:1
    -};
    -
    -// used to create uids for various pixi objects..
    -PIXI._UID = 0;
    -
    -if(typeof(Float32Array) != 'undefined')
    -{
    -    PIXI.Float32Array = Float32Array;
    -    PIXI.Uint16Array = Uint16Array;
    -}
    -else
    -{
    -    PIXI.Float32Array = Array;
    -    PIXI.Uint16Array = Array;
    -}
    -
    -// interaction frequency 
    -PIXI.INTERACTION_FREQUENCY = 30;
    -PIXI.AUTO_PREVENT_DEFAULT = true;
    -
    -PIXI.PI_2 = Math.PI * 2;
    -PIXI.RAD_TO_DEG = 180 / Math.PI;
    -PIXI.DEG_TO_RAD = Math.PI / 180;
    -
    -PIXI.RETINA_PREFIX = "@2x";
    -//PIXI.SCALE_PREFIX "@x%%";
    -
    -PIXI.dontSayHello = false;
    -
    -
    -PIXI.defaultRenderOptions = {
    -    view:null, 
    -    transparent:false, 
    -    antialias:false, 
    -    preserveDrawingBuffer:false,
    -    resolution:1,
    -    clearBeforeRender:true,
    -    autoResize:false
    -}
    -
    -PIXI.sayHello = function (type) 
    -{
    -    if(PIXI.dontSayHello)return;
    -
    -    if ( navigator.userAgent.toLowerCase().indexOf('chrome') > -1 )
    -    {
    -        var args = [
    -            '%c %c %c Pixi.js ' + PIXI.VERSION + ' - ' + type + '  %c ' + ' %c ' + ' http://www.pixijs.com/  %c %c ♥%c♥%c♥ ',
    -            'background: #ff66a5',
    -            'background: #ff66a5',
    -            'color: #ff66a5; background: #030307;',
    -            'background: #ff66a5',
    -            'background: #ffc3dc',
    -            'background: #ff66a5',
    -            'color: #ff2424; background: #fff',
    -            'color: #ff2424; background: #fff',
    -            'color: #ff2424; background: #fff'
    -        ];
    -
    -       
    -
    -        console.log.apply(console, args);
    -    }
    -    else if (window['console'])
    -    {
    -        console.log('Pixi.js ' + PIXI.VERSION + ' - http://www.pixijs.com/');
    -    }
    -
    -    PIXI.dontSayHello = true;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_display_DisplayObject.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_display_DisplayObject.js.html deleted file mode 100755 index d3de5e4..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_display_DisplayObject.js.html +++ /dev/null @@ -1,1042 +0,0 @@ - - - - - src/pixi/display/DisplayObject.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/DisplayObject.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The base class for all objects that are rendered on the screen.
    - * This is an abstract class and should not be used on its own rather it should be extended.
    - *
    - * @class DisplayObject
    - * @constructor
    - */
    -PIXI.DisplayObject = function()
    -{
    -    /**
    -     * The coordinate of the object relative to the local coordinates of the parent.
    -     *
    -     * @property position
    -     * @type Point
    -     */
    -    this.position = new PIXI.Point();
    -
    -    /**
    -     * The scale factor of the object.
    -     *
    -     * @property scale
    -     * @type Point
    -     */
    -    this.scale = new PIXI.Point(1,1);//{x:1, y:1};
    -
    -    /**
    -     * The pivot point of the displayObject that it rotates around
    -     *
    -     * @property pivot
    -     * @type Point
    -     */
    -    this.pivot = new PIXI.Point(0,0);
    -
    -    /**
    -     * The rotation of the object in radians.
    -     *
    -     * @property rotation
    -     * @type Number
    -     */
    -    this.rotation = 0;
    -
    -    /**
    -     * The opacity of the object.
    -     *
    -     * @property alpha
    -     * @type Number
    -     */
    -    this.alpha = 1;
    -
    -    /**
    -     * The visibility of the object.
    -     *
    -     * @property visible
    -     * @type Boolean
    -     */
    -    this.visible = true;
    -
    -    /**
    -     * This is the defined area that will pick up mouse / touch events. It is null by default.
    -     * Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)
    -     *
    -     * @property hitArea
    -     * @type Rectangle|Circle|Ellipse|Polygon
    -     */
    -    this.hitArea = null;
    -
    -    /**
    -     * This is used to indicate if the displayObject should display a mouse hand cursor on rollover
    -     *
    -     * @property buttonMode
    -     * @type Boolean
    -     */
    -    this.buttonMode = false;
    -
    -    /**
    -     * Can this object be rendered
    -     *
    -     * @property renderable
    -     * @type Boolean
    -     */
    -    this.renderable = false;
    -
    -    /**
    -     * [read-only] The display object container that contains this display object.
    -     *
    -     * @property parent
    -     * @type DisplayObjectContainer
    -     * @readOnly
    -     */
    -    this.parent = null;
    -
    -    /**
    -     * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
    -     *
    -     * @property stage
    -     * @type Stage
    -     * @readOnly
    -     */
    -    this.stage = null;
    -
    -    /**
    -     * [read-only] The multiplied alpha of the displayObject
    -     *
    -     * @property worldAlpha
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.worldAlpha = 1;
    -
    -    /**
    -     * [read-only] Whether or not the object is interactive, do not toggle directly! use the `interactive` property
    -     *
    -     * @property _interactive
    -     * @type Boolean
    -     * @readOnly
    -     * @private
    -     */
    -    this._interactive = false;
    -
    -    /**
    -     * This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
    -     *
    -     * @property defaultCursor
    -     * @type String
    -     *
    -    */
    -    this.defaultCursor = 'pointer';
    -
    -    /**
    -     * [read-only] Current transform of the object based on world (parent) factors
    -     *
    -     * @property worldTransform
    -     * @type Matrix
    -     * @readOnly
    -     * @private
    -     */
    -    this.worldTransform = new PIXI.Matrix();
    -
    -    /**
    -     * cached sin rotation and cos rotation
    -     *
    -     * @property _sr
    -     * @type Number
    -     * @private
    -     */
    -    this._sr = 0;
    -
    -    /**
    -     * cached sin rotation and cos rotation
    -     *
    -     * @property _cr
    -     * @type Number
    -     * @private
    -     */
    -    this._cr = 1;
    -
    -    /**
    -     * The area the filter is applied to like the hitArea this is used as more of an optimisation
    -     * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle
    -     *
    -     * @property filterArea
    -     * @type Rectangle
    -     */
    -    this.filterArea = null;//new PIXI.Rectangle(0,0,1,1);
    -
    -    /**
    -     * The original, cached bounds of the object
    -     *
    -     * @property _bounds
    -     * @type Rectangle
    -     * @private
    -     */
    -    this._bounds = new PIXI.Rectangle(0, 0, 1, 1);
    -
    -    /**
    -     * The most up-to-date bounds of the object
    -     *
    -     * @property _currentBounds
    -     * @type Rectangle
    -     * @private
    -     */
    -    this._currentBounds = null;
    -
    -    /**
    -     * The original, cached mask of the object
    -     *
    -     * @property _currentBounds
    -     * @type Rectangle
    -     * @private
    -     */
    -    this._mask = null;
    -
    -    /**
    -     * Cached internal flag.
    -     *
    -     * @property _cacheAsBitmap
    -     * @type Boolean
    -     * @private
    -     */
    -    this._cacheAsBitmap = false;
    -
    -    /**
    -     * Cached internal flag.
    -     *
    -     * @property _cacheIsDirty
    -     * @type Boolean
    -     * @private
    -     */
    -    this._cacheIsDirty = false;
    -
    -
    -    /*
    -     * MOUSE Callbacks
    -     */
    -    
    -    /**
    -     * A callback that is used when the users mouse rolls over the displayObject
    -     * @method mouseover
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the users mouse leaves the displayObject
    -     * @method mouseout
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    //Left button
    -    /**
    -     * A callback that is used when the users clicks on the displayObject with their mouse's left button
    -     * @method click
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user clicks the mouse's left button down over the sprite
    -     * @method mousedown
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases the mouse's left button that was over the displayObject
    -     * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject
    -     * @method mouseup
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject
    -     * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject
    -     * @method mouseupoutside
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    //Right button
    -    /**
    -     * A callback that is used when the users clicks on the displayObject with their mouse's right button
    -     * @method rightclick
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user clicks the mouse's right button down over the sprite
    -     * @method rightdown
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases the mouse's right button that was over the displayObject
    -     * for this callback to be fired the mouse's right button must have been pressed down over the displayObject
    -     * @method rightup
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject
    -     * for this callback to be fired, the mouse's right button must have been pressed down over the displayObject
    -     * @method rightupoutside
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /*
    -     * TOUCH Callbacks
    -     */
    -
    -    /**
    -     * A callback that is used when the users taps on the sprite with their finger
    -     * basically a touch version of click
    -     * @method tap
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user touches over the displayObject
    -     * @method touchstart
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases a touch over the displayObject
    -     * @method touchend
    -     * @param interactionData {InteractionData}
    -     */
    -
    -    /**
    -     * A callback that is used when the user releases the touch that was over the displayObject
    -     * for this callback to be fired, The touch must have started over the sprite
    -     * @method touchendoutside
    -     * @param interactionData {InteractionData}
    -     */
    -};
    -
    -// constructor
    -PIXI.DisplayObject.prototype.constructor = PIXI.DisplayObject;
    -
    -/**
    - * Indicates if the sprite will have touch and mouse interactivity. It is false by default
    - *
    - * @property interactive
    - * @type Boolean
    - * @default false
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'interactive', {
    -    get: function() {
    -        return this._interactive;
    -    },
    -    set: function(value) {
    -        this._interactive = value;
    -
    -        // TODO more to be done here..
    -        // need to sort out a re-crawl!
    -        if(this.stage)this.stage.dirty = true;
    -    }
    -});
    -
    -/**
    - * [read-only] Indicates if the sprite is globally visible.
    - *
    - * @property worldVisible
    - * @type Boolean
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'worldVisible', {
    -    get: function() {
    -        var item = this;
    -
    -        do
    -        {
    -            if(!item.visible)return false;
    -            item = item.parent;
    -        }
    -        while(item);
    -
    -        return true;
    -    }
    -});
    -
    -/**
    - * Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.
    - * In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping.
    - * To remove a mask, set this property to null.
    - *
    - * @property mask
    - * @type Graphics
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'mask', {
    -    get: function() {
    -        return this._mask;
    -    },
    -    set: function(value) {
    -
    -        if(this._mask)this._mask.isMask = false;
    -        this._mask = value;
    -        if(this._mask)this._mask.isMask = true;
    -    }
    -});
    -
    -/**
    - * Sets the filters for the displayObject.
    - * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer.
    - * To remove filters simply set this property to 'null'
    - * @property filters
    - * @type Array An array of filters
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', {
    -
    -    get: function() {
    -        return this._filters;
    -    },
    -
    -    set: function(value) {
    -
    -        if(value)
    -        {
    -            // now put all the passes in one place..
    -            var passes = [];
    -            for (var i = 0; i < value.length; i++)
    -            {
    -                var filterPasses = value[i].passes;
    -                for (var j = 0; j < filterPasses.length; j++)
    -                {
    -                    passes.push(filterPasses[j]);
    -                }
    -            }
    -
    -            // TODO change this as it is legacy
    -            this._filterBlock = {target:this, filterPasses:passes};
    -        }
    -
    -        this._filters = value;
    -    }
    -});
    -
    -/**
    - * Set if this display object is cached as a bitmap.
    - * This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects.
    - * To remove simply set this property to 'null'
    - * @property cacheAsBitmap
    - * @type Boolean
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'cacheAsBitmap', {
    -
    -    get: function() {
    -        return  this._cacheAsBitmap;
    -    },
    -
    -    set: function(value) {
    -
    -        if(this._cacheAsBitmap === value)return;
    -
    -        if(value)
    -        {
    -            this._generateCachedSprite();
    -        }
    -        else
    -        {
    -            this._destroyCachedSprite();
    -        }
    -
    -        this._cacheAsBitmap = value;
    -    }
    -});
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.DisplayObject.prototype.updateTransform = function()
    -{
    -    // create some matrix refs for easy access
    -    var pt = this.parent.worldTransform;
    -    var wt = this.worldTransform;
    -
    -    // temporary matrix variables
    -    var a, b, c, d, tx, ty;
    -
    -    // TODO create a const for 2_PI 
    -    // so if rotation is between 0 then we can simplify the multiplication process..
    -    if(this.rotation % PIXI.PI_2)
    -    {
    -        // check to see if the rotation is the same as the previous render. This means we only need to use sin and cos when rotation actually changes
    -        if(this.rotation !== this.rotationCache)
    -        {
    -            this.rotationCache = this.rotation;
    -            this._sr = Math.sin(this.rotation);
    -            this._cr = Math.cos(this.rotation);
    -        }
    -
    -        // get the matrix values of the displayobject based on its transform properties..
    -        a  =  this._cr * this.scale.x;
    -        b  =  this._sr * this.scale.x;
    -        c  = -this._sr * this.scale.y;
    -        d  =  this._cr * this.scale.y;
    -        tx =  this.position.x;
    -        ty =  this.position.y;
    -        
    -        // check for pivot.. not often used so geared towards that fact!
    -        if(this.pivot.x || this.pivot.y)
    -        {
    -            tx -= this.pivot.x * a + this.pivot.y * c;
    -            ty -= this.pivot.x * b + this.pivot.y * d;
    -        }
    -
    -        // concat the parent matrix with the objects transform.
    -        wt.a  = a  * pt.a + b  * pt.c;
    -        wt.b  = a  * pt.b + b  * pt.d;
    -        wt.c  = c  * pt.a + d  * pt.c;
    -        wt.d  = c  * pt.b + d  * pt.d;
    -        wt.tx = tx * pt.a + ty * pt.c + pt.tx;
    -        wt.ty = tx * pt.b + ty * pt.d + pt.ty;
    -
    -        
    -    }
    -    else
    -    {
    -        // lets do the fast version as we know there is no rotation..
    -        a  = this.scale.x;
    -        d  = this.scale.y;
    -
    -        tx =  this.position.x;
    -        ty =  this.position.y;
    -
    -        wt.a  = a  * pt.a;
    -        wt.b  = a  * pt.b;
    -        wt.c  = d  * pt.c;
    -        wt.d  = d  * pt.d;
    -        wt.tx = tx * pt.a + ty * pt.c + pt.tx;
    -        wt.ty = tx * pt.b + ty * pt.d + pt.ty;
    -    }
    -
    -    // multiply the alphas..
    -    this.worldAlpha = this.alpha * this.parent.worldAlpha;
    -};
    -
    -// performance increase to avoid using call.. (10x faster)
    -PIXI.DisplayObject.prototype.displayObjectUpdateTransform = PIXI.DisplayObject.prototype.updateTransform;
    -
    -/**
    - * Retrieves the bounds of the displayObject as a rectangle object
    - *
    - * @method getBounds
    - * @param matrix {Matrix}
    - * @return {Rectangle} the rectangular bounding area
    - */
    -PIXI.DisplayObject.prototype.getBounds = function(matrix)
    -{
    -    matrix = matrix;//just to get passed js hinting (and preserve inheritance)
    -    return PIXI.EmptyRectangle;
    -};
    -
    -/**
    - * Retrieves the local bounds of the displayObject as a rectangle object
    - *
    - * @method getLocalBounds
    - * @return {Rectangle} the rectangular bounding area
    - */
    -PIXI.DisplayObject.prototype.getLocalBounds = function()
    -{
    -    return this.getBounds(PIXI.identityMatrix);///PIXI.EmptyRectangle();
    -};
    -
    -/**
    - * Sets the object's stage reference, the stage this object is connected to
    - *
    - * @method setStageReference
    - * @param stage {Stage} the stage that the object will have as its current stage reference
    - */
    -PIXI.DisplayObject.prototype.setStageReference = function(stage)
    -{
    -    this.stage = stage;
    -    if(this._interactive)this.stage.dirty = true;
    -};
    -
    -/**
    - * Useful function that returns a texture of the displayObject object that can then be used to create sprites
    - * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.
    - *
    - * @method generateTexture
    - * @param resolution {Number} The resolution of the texture being generated
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture.
    - * @return {Texture} a texture of the graphics object
    - */
    -PIXI.DisplayObject.prototype.generateTexture = function(resolution, scaleMode, renderer)
    -{
    -    var bounds = this.getLocalBounds();
    -
    -    var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0, renderer, scaleMode, resolution);
    -    
    -    PIXI.DisplayObject._tempMatrix.tx = -bounds.x;
    -    PIXI.DisplayObject._tempMatrix.ty = -bounds.y;
    -    
    -    renderTexture.render(this, PIXI.DisplayObject._tempMatrix);
    -
    -    return renderTexture;
    -};
    -
    -/**
    - * Generates and updates the cached sprite for this object.
    - *
    - * @method updateCache
    - */
    -PIXI.DisplayObject.prototype.updateCache = function()
    -{
    -    this._generateCachedSprite();
    -};
    -
    -/**
    - * Calculates the global position of the display object
    - *
    - * @method toGlobal
    - * @param position {Point} The world origin to calculate from
    - * @return {Point} A point object representing the position of this object
    - */
    -PIXI.DisplayObject.prototype.toGlobal = function(position)
    -{
    -    this.updateTransform();
    -    return this.worldTransform.apply(position);
    -};
    -
    -/**
    - * Calculates the local position of the display object relative to another point
    - *
    - * @method toLocal
    - * @param position {Point} The world origin to calculate from
    - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from
    - * @return {Point} A point object representing the position of this object
    - */
    -PIXI.DisplayObject.prototype.toLocal = function(position, from)
    -{
    -    if (from)
    -    {
    -        position = from.toGlobal(position);
    -    }
    -
    -    this.updateTransform();
    -
    -    return this.worldTransform.applyInverse(position);
    -};
    -
    -/**
    - * Internal method.
    - *
    - * @method _renderCachedSprite
    - * @param renderSession {Object} The render session
    - * @private
    - */
    -PIXI.DisplayObject.prototype._renderCachedSprite = function(renderSession)
    -{
    -    this._cachedSprite.worldAlpha = this.worldAlpha;
    -
    -    if(renderSession.gl)
    -    {
    -        PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession);
    -    }
    -    else
    -    {
    -        PIXI.Sprite.prototype._renderCanvas.call(this._cachedSprite, renderSession);
    -    }
    -};
    -
    -/**
    - * Internal method.
    - *
    - * @method _generateCachedSprite
    - * @private
    - */
    -PIXI.DisplayObject.prototype._generateCachedSprite = function()
    -{
    -    this._cacheAsBitmap = false;
    -    var bounds = this.getLocalBounds();
    -
    -    if(!this._cachedSprite)
    -    {
    -        var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0);//, renderSession.renderer);
    -
    -        this._cachedSprite = new PIXI.Sprite(renderTexture);
    -        this._cachedSprite.worldTransform = this.worldTransform;
    -    }
    -    else
    -    {
    -        this._cachedSprite.texture.resize(bounds.width | 0, bounds.height | 0);
    -    }
    -
    -    //REMOVE filter!
    -    var tempFilters = this._filters;
    -    this._filters = null;
    -
    -    this._cachedSprite.filters = tempFilters;
    -
    -    PIXI.DisplayObject._tempMatrix.tx = -bounds.x;
    -    PIXI.DisplayObject._tempMatrix.ty = -bounds.y;
    -    
    -    this._cachedSprite.texture.render(this, PIXI.DisplayObject._tempMatrix );
    -
    -    this._cachedSprite.anchor.x = -( bounds.x / bounds.width );
    -    this._cachedSprite.anchor.y = -( bounds.y / bounds.height );
    -
    -    this._filters = tempFilters;
    -
    -    this._cacheAsBitmap = true;
    -};
    -
    -/**
    -* Destroys the cached sprite.
    -*
    -* @method _destroyCachedSprite
    -* @private
    -*/
    -PIXI.DisplayObject.prototype._destroyCachedSprite = function()
    -{
    -    if(!this._cachedSprite)return;
    -
    -    this._cachedSprite.texture.destroy(true);
    -
    -    // TODO could be object pooled!
    -    this._cachedSprite = null;
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession}
    -* @private
    -*/
    -PIXI.DisplayObject.prototype._renderWebGL = function(renderSession)
    -{
    -    // OVERWRITE;
    -    // this line is just here to pass jshinting :)
    -    renderSession = renderSession;
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession}
    -* @private
    -*/
    -PIXI.DisplayObject.prototype._renderCanvas = function(renderSession)
    -{
    -    // OVERWRITE;
    -    // this line is just here to pass jshinting :)
    -    renderSession = renderSession;
    -};
    -
    -
    -PIXI.DisplayObject._tempMatrix = new PIXI.Matrix();
    -
    -/**
    - * The position of the displayObject on the x axis relative to the local coordinates of the parent.
    - *
    - * @property x
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'x', {
    -    get: function() {
    -        return  this.position.x;
    -    },
    -    set: function(value) {
    -        this.position.x = value;
    -    }
    -});
    -
    -/**
    - * The position of the displayObject on the y axis relative to the local coordinates of the parent.
    - *
    - * @property y
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DisplayObject.prototype, 'y', {
    -    get: function() {
    -        return  this.position.y;
    -    },
    -    set: function(value) {
    -        this.position.y = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_display_DisplayObjectContainer.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_display_DisplayObjectContainer.js.html deleted file mode 100755 index 0c8eb24..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_display_DisplayObjectContainer.js.html +++ /dev/null @@ -1,793 +0,0 @@ - - - - - src/pixi/display/DisplayObjectContainer.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/DisplayObjectContainer.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A DisplayObjectContainer represents a collection of display objects.
    - * It is the base class of all display objects that act as a container for other objects.
    - *
    - * @class DisplayObjectContainer
    - * @extends DisplayObject
    - * @constructor
    - */
    -PIXI.DisplayObjectContainer = function()
    -{
    -    PIXI.DisplayObject.call( this );
    -
    -    /**
    -     * [read-only] The array of children of this container.
    -     *
    -     * @property children
    -     * @type Array<DisplayObject>
    -     * @readOnly
    -     */
    -    this.children = [];
    -
    -    // fast access to update transform..
    -    
    -};
    -
    -// constructor
    -PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
    -PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer;
    -
    -
    -/**
    - * The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
    - *
    - * @property width
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', {
    -    get: function() {
    -        return this.scale.x * this.getLocalBounds().width;
    -    },
    -    set: function(value) {
    -        
    -        var width = this.getLocalBounds().width;
    -
    -        if(width !== 0)
    -        {
    -            this.scale.x = value / ( width/this.scale.x );
    -        }
    -        else
    -        {
    -            this.scale.x = 1;
    -        }
    -
    -        
    -        this._width = value;
    -    }
    -});
    -
    -/**
    - * The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
    - *
    - * @property height
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', {
    -    get: function() {
    -        return  this.scale.y * this.getLocalBounds().height;
    -    },
    -    set: function(value) {
    -
    -        var height = this.getLocalBounds().height;
    -
    -        if(height !== 0)
    -        {
    -            this.scale.y = value / ( height/this.scale.y );
    -        }
    -        else
    -        {
    -            this.scale.y = 1;
    -        }
    -
    -        this._height = value;
    -    }
    -});
    -
    -/**
    - * Adds a child to the container.
    - *
    - * @method addChild
    - * @param child {DisplayObject} The DisplayObject to add to the container
    - * @return {DisplayObject} The child that was added.
    - */
    -PIXI.DisplayObjectContainer.prototype.addChild = function(child)
    -{
    -    return this.addChildAt(child, this.children.length);
    -};
    -
    -/**
    - * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
    - *
    - * @method addChildAt
    - * @param child {DisplayObject} The child to add
    - * @param index {Number} The index to place the child in
    - * @return {DisplayObject} The child that was added.
    - */
    -PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
    -{
    -    if(index >= 0 && index <= this.children.length)
    -    {
    -        if(child.parent)
    -        {
    -            child.parent.removeChild(child);
    -        }
    -
    -        child.parent = this;
    -
    -        this.children.splice(index, 0, child);
    -
    -        if(this.stage)child.setStageReference(this.stage);
    -
    -        return child;
    -    }
    -    else
    -    {
    -        throw new Error(child + 'addChildAt: The index '+ index +' supplied is out of bounds ' + this.children.length);
    -    }
    -};
    -
    -/**
    - * Swaps the position of 2 Display Objects within this container.
    - *
    - * @method swapChildren
    - * @param child {DisplayObject}
    - * @param child2 {DisplayObject}
    - */
    -PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2)
    -{
    -    if(child === child2) {
    -        return;
    -    }
    -
    -    var index1 = this.getChildIndex(child);
    -    var index2 = this.getChildIndex(child2);
    -
    -    if(index1 < 0 || index2 < 0) {
    -        throw new Error('swapChildren: Both the supplied DisplayObjects must be a child of the caller.');
    -    }
    -
    -    this.children[index1] = child2;
    -    this.children[index2] = child;
    -
    -};
    -
    -/**
    - * Returns the index position of a child DisplayObject instance
    - *
    - * @method getChildIndex
    - * @param child {DisplayObject} The DisplayObject instance to identify
    - * @return {Number} The index position of the child display object to identify
    - */
    -PIXI.DisplayObjectContainer.prototype.getChildIndex = function(child)
    -{
    -    var index = this.children.indexOf(child);
    -    if (index === -1)
    -    {
    -        throw new Error('The supplied DisplayObject must be a child of the caller');
    -    }
    -    return index;
    -};
    -
    -/**
    - * Changes the position of an existing child in the display object container
    - *
    - * @method setChildIndex
    - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number
    - * @param index {Number} The resulting index number for the child display object
    - */
    -PIXI.DisplayObjectContainer.prototype.setChildIndex = function(child, index)
    -{
    -    if (index < 0 || index >= this.children.length)
    -    {
    -        throw new Error('The supplied index is out of bounds');
    -    }
    -    var currentIndex = this.getChildIndex(child);
    -    this.children.splice(currentIndex, 1); //remove from old position
    -    this.children.splice(index, 0, child); //add at new position
    -};
    -
    -/**
    - * Returns the child at the specified index
    - *
    - * @method getChildAt
    - * @param index {Number} The index to get the child from
    - * @return {DisplayObject} The child at the given index, if any.
    - */
    -PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
    -{
    -    if (index < 0 || index >= this.children.length)
    -    {
    -        throw new Error('getChildAt: Supplied index '+ index +' does not exist in the child list, or the supplied DisplayObject must be a child of the caller');
    -    }
    -    return this.children[index];
    -    
    -};
    -
    -/**
    - * Removes a child from the container.
    - *
    - * @method removeChild
    - * @param child {DisplayObject} The DisplayObject to remove
    - * @return {DisplayObject} The child that was removed.
    - */
    -PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
    -{
    -    var index = this.children.indexOf( child );
    -    if(index === -1)return;
    -    
    -    return this.removeChildAt( index );
    -};
    -
    -/**
    - * Removes a child from the specified index position.
    - *
    - * @method removeChildAt
    - * @param index {Number} The index to get the child from
    - * @return {DisplayObject} The child that was removed.
    - */
    -PIXI.DisplayObjectContainer.prototype.removeChildAt = function(index)
    -{
    -    var child = this.getChildAt( index );
    -    if(this.stage)
    -        child.removeStageReference();
    -
    -    child.parent = undefined;
    -    this.children.splice( index, 1 );
    -    return child;
    -};
    -
    -/**
    -* Removes all children from this container that are within the begin and end indexes.
    -*
    -* @method removeChildren
    -* @param beginIndex {Number} The beginning position. Default value is 0.
    -* @param endIndex {Number} The ending position. Default value is size of the container.
    -*/
    -PIXI.DisplayObjectContainer.prototype.removeChildren = function(beginIndex, endIndex)
    -{
    -    var begin = beginIndex || 0;
    -    var end = typeof endIndex === 'number' ? endIndex : this.children.length;
    -    var range = end - begin;
    -
    -    if (range > 0 && range <= end)
    -    {
    -        var removed = this.children.splice(begin, range);
    -        for (var i = 0; i < removed.length; i++) {
    -            var child = removed[i];
    -            if(this.stage)
    -                child.removeStageReference();
    -            child.parent = undefined;
    -        }
    -        return removed;
    -    }
    -    else if (range === 0 && this.children.length === 0)
    -    {
    -        return [];
    -    }
    -    else
    -    {
    -        throw new Error( 'removeChildren: Range Error, numeric values are outside the acceptable range' );
    -    }
    -};
    -
    -/*
    - * Updates the transform on all children of this container for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.DisplayObjectContainer.prototype.updateTransform = function()
    -{
    -    if(!this.visible)return;
    -
    -    this.displayObjectUpdateTransform();
    -
    -    //PIXI.DisplayObject.prototype.updateTransform.call( this );
    -
    -    if(this._cacheAsBitmap)return;
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        this.children[i].updateTransform();
    -    }
    -};
    -
    -// performance increase to avoid using call.. (10x faster)
    -PIXI.DisplayObjectContainer.prototype.displayObjectContainerUpdateTransform = PIXI.DisplayObjectContainer.prototype.updateTransform;
    -
    -/**
    - * Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.
    - *
    - * @method getBounds
    - * @return {Rectangle} The rectangular bounding area
    - */
    -PIXI.DisplayObjectContainer.prototype.getBounds = function()
    -{
    -    if(this.children.length === 0)return PIXI.EmptyRectangle;
    -
    -    // TODO the bounds have already been calculated this render session so return what we have
    -
    -    var minX = Infinity;
    -    var minY = Infinity;
    -
    -    var maxX = -Infinity;
    -    var maxY = -Infinity;
    -
    -    var childBounds;
    -    var childMaxX;
    -    var childMaxY;
    -
    -    var childVisible = false;
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        var child = this.children[i];
    -        
    -        if(!child.visible)continue;
    -
    -        childVisible = true;
    -
    -        childBounds = this.children[i].getBounds();
    -     
    -        minX = minX < childBounds.x ? minX : childBounds.x;
    -        minY = minY < childBounds.y ? minY : childBounds.y;
    -
    -        childMaxX = childBounds.width + childBounds.x;
    -        childMaxY = childBounds.height + childBounds.y;
    -
    -        maxX = maxX > childMaxX ? maxX : childMaxX;
    -        maxY = maxY > childMaxY ? maxY : childMaxY;
    -    }
    -
    -    if(!childVisible)
    -        return PIXI.EmptyRectangle;
    -
    -    var bounds = this._bounds;
    -
    -    bounds.x = minX;
    -    bounds.y = minY;
    -    bounds.width = maxX - minX;
    -    bounds.height = maxY - minY;
    -
    -    // TODO: store a reference so that if this function gets called again in the render cycle we do not have to recalculate
    -    //this._currentBounds = bounds;
    -   
    -    return bounds;
    -};
    -
    -/**
    - * Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.
    - *
    - * @method getLocalBounds
    - * @return {Rectangle} The rectangular bounding area
    - */
    -PIXI.DisplayObjectContainer.prototype.getLocalBounds = function()
    -{
    -    var matrixCache = this.worldTransform;
    -
    -    this.worldTransform = PIXI.identityMatrix;
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        this.children[i].updateTransform();
    -    }
    -
    -    var bounds = this.getBounds();
    -
    -    this.worldTransform = matrixCache;
    -
    -    return bounds;
    -};
    -
    -/**
    - * Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.
    - *
    - * @method setStageReference
    - * @param stage {Stage} the stage that the container will have as its current stage reference
    - */
    -PIXI.DisplayObjectContainer.prototype.setStageReference = function(stage)
    -{
    -    this.stage = stage;
    -    if(this._interactive)this.stage.dirty = true;
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        var child = this.children[i];
    -        child.setStageReference(stage);
    -    }
    -};
    -
    -/**
    - * Removes the current stage reference from the container and all of its children.
    - *
    - * @method removeStageReference
    - */
    -PIXI.DisplayObjectContainer.prototype.removeStageReference = function()
    -{
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        var child = this.children[i];
    -        child.removeStageReference();
    -    }
    -
    -    if(this._interactive)this.stage.dirty = true;
    -    
    -    this.stage = null;
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.DisplayObjectContainer.prototype._renderWebGL = function(renderSession)
    -{
    -    if(!this.visible || this.alpha <= 0)return;
    -    
    -    if(this._cacheAsBitmap)
    -    {
    -        this._renderCachedSprite(renderSession);
    -        return;
    -    }
    -    
    -    var i,j;
    -
    -    if(this._mask || this._filters)
    -    {
    -        
    -        // push filter first as we need to ensure the stencil buffer is correct for any masking
    -        if(this._filters)
    -        {
    -            renderSession.spriteBatch.flush();
    -            renderSession.filterManager.pushFilter(this._filterBlock);
    -        }
    -
    -        if(this._mask)
    -        {
    -            renderSession.spriteBatch.stop();
    -            renderSession.maskManager.pushMask(this.mask, renderSession);
    -            renderSession.spriteBatch.start();
    -        }
    -
    -        // simple render children!
    -        for(i=0,j=this.children.length; i<j; i++)
    -        {
    -            this.children[i]._renderWebGL(renderSession);
    -        }
    -
    -        renderSession.spriteBatch.stop();
    -
    -        if(this._mask)renderSession.maskManager.popMask(this._mask, renderSession);
    -        if(this._filters)renderSession.filterManager.popFilter();
    -        
    -        renderSession.spriteBatch.start();
    -    }
    -    else
    -    {
    -        // simple render children!
    -        for(i=0,j=this.children.length; i<j; i++)
    -        {
    -            this.children[i]._renderWebGL(renderSession);
    -        }
    -    }
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.DisplayObjectContainer.prototype._renderCanvas = function(renderSession)
    -{
    -    if(this.visible === false || this.alpha === 0)return;
    -
    -    if(this._cacheAsBitmap)
    -    {
    -
    -        this._renderCachedSprite(renderSession);
    -        return;
    -    }
    -
    -    if(this._mask)
    -    {
    -        renderSession.maskManager.pushMask(this._mask, renderSession);
    -    }
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        var child = this.children[i];
    -        child._renderCanvas(renderSession);
    -    }
    -
    -    if(this._mask)
    -    {
    -        renderSession.maskManager.popMask(renderSession);
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_display_MovieClip.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_display_MovieClip.js.html deleted file mode 100755 index 7096ce6..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_display_MovieClip.js.html +++ /dev/null @@ -1,483 +0,0 @@ - - - - - src/pixi/display/MovieClip.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/MovieClip.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A MovieClip is a simple way to display an animation depicted by a list of textures.
    - *
    - * @class MovieClip
    - * @extends Sprite
    - * @constructor
    - * @param textures {Array<Texture>} an array of {Texture} objects that make up the animation
    - */
    -PIXI.MovieClip = function(textures)
    -{
    -    PIXI.Sprite.call(this, textures[0]);
    -
    -    /**
    -     * The array of textures that make up the animation
    -     *
    -     * @property textures
    -     * @type Array
    -     */
    -    this.textures = textures;
    -
    -    /**
    -     * The speed that the MovieClip will play at. Higher is faster, lower is slower
    -     *
    -     * @property animationSpeed
    -     * @type Number
    -     * @default 1
    -     */
    -    this.animationSpeed = 1;
    -
    -    /**
    -     * Whether or not the movie clip repeats after playing.
    -     *
    -     * @property loop
    -     * @type Boolean
    -     * @default true
    -     */
    -    this.loop = true;
    -
    -    /**
    -     * Function to call when a MovieClip finishes playing
    -     *
    -     * @property onComplete
    -     * @type Function
    -     */
    -    this.onComplete = null;
    -
    -    /**
    -     * [read-only] The MovieClips current frame index (this may not have to be a whole number)
    -     *
    -     * @property currentFrame
    -     * @type Number
    -     * @default 0
    -     * @readOnly
    -     */
    -    this.currentFrame = 0;
    -
    -    /**
    -     * [read-only] Indicates if the MovieClip is currently playing
    -     *
    -     * @property playing
    -     * @type Boolean
    -     * @readOnly
    -     */
    -    this.playing = false;
    -};
    -
    -// constructor
    -PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype );
    -PIXI.MovieClip.prototype.constructor = PIXI.MovieClip;
    -
    -/**
    -* [read-only] totalFrames is the total number of frames in the MovieClip. This is the same as number of textures
    -* assigned to the MovieClip.
    -*
    -* @property totalFrames
    -* @type Number
    -* @default 0
    -* @readOnly
    -*/
    -Object.defineProperty( PIXI.MovieClip.prototype, 'totalFrames', {
    -	get: function() {
    -
    -		return this.textures.length;
    -	}
    -});
    -
    -/**
    - * Stops the MovieClip
    - *
    - * @method stop
    - */
    -PIXI.MovieClip.prototype.stop = function()
    -{
    -    this.playing = false;
    -};
    -
    -/**
    - * Plays the MovieClip
    - *
    - * @method play
    - */
    -PIXI.MovieClip.prototype.play = function()
    -{
    -    this.playing = true;
    -};
    -
    -/**
    - * Stops the MovieClip and goes to a specific frame
    - *
    - * @method gotoAndStop
    - * @param frameNumber {Number} frame index to stop at
    - */
    -PIXI.MovieClip.prototype.gotoAndStop = function(frameNumber)
    -{
    -    this.playing = false;
    -    this.currentFrame = frameNumber;
    -    var round = (this.currentFrame + 0.5) | 0;
    -    this.setTexture(this.textures[round % this.textures.length]);
    -};
    -
    -/**
    - * Goes to a specific frame and begins playing the MovieClip
    - *
    - * @method gotoAndPlay
    - * @param frameNumber {Number} frame index to start at
    - */
    -PIXI.MovieClip.prototype.gotoAndPlay = function(frameNumber)
    -{
    -    this.currentFrame = frameNumber;
    -    this.playing = true;
    -};
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.MovieClip.prototype.updateTransform = function()
    -{
    -    PIXI.Sprite.prototype.updateTransform.call(this);
    -
    -    if(!this.playing)return;
    -
    -    this.currentFrame += this.animationSpeed;
    -
    -    var round = (this.currentFrame + 0.5) | 0;
    -
    -    this.currentFrame = this.currentFrame % this.textures.length;
    -
    -    if(this.loop || round < this.textures.length)
    -    {
    -        this.setTexture(this.textures[round % this.textures.length]);
    -    }
    -    else if(round >= this.textures.length)
    -    {
    -        this.gotoAndStop(this.textures.length - 1);
    -        if(this.onComplete)
    -        {
    -            this.onComplete();
    -        }
    -    }
    -};
    -
    -/**
    - * A short hand way of creating a movieclip from an array of frame ids
    - *
    - * @static
    - * @method fromFrames
    - * @param frames {Array} the array of frames ids the movieclip will use as its texture frames
    - */
    -PIXI.MovieClip.fromFrames = function(frames)
    -{
    -    var textures = [];
    -
    -    for (var i = 0; i < frames.length; i++)
    -    {
    -        textures.push(new PIXI.Texture.fromFrame(frames[i]));
    -    }
    -
    -    return new PIXI.MovieClip(textures);
    -};
    -
    -/**
    - * A short hand way of creating a movieclip from an array of image ids
    - *
    - * @static
    - * @method fromImages
    - * @param frames {Array} the array of image ids the movieclip will use as its texture frames
    - */
    -PIXI.MovieClip.fromImages = function(images)
    -{
    -    var textures = [];
    -
    -    for (var i = 0; i < images.length; i++)
    -    {
    -        textures.push(new PIXI.Texture.fromImage(images[i]));
    -    }
    -
    -    return new PIXI.MovieClip(textures);
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_display_Sprite.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_display_Sprite.js.html deleted file mode 100755 index f92d36c..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_display_Sprite.js.html +++ /dev/null @@ -1,727 +0,0 @@ - - - - - src/pixi/display/Sprite.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/Sprite.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The Sprite object is the base for all textured objects that are rendered to the screen
    - *
    - * @class Sprite
    - * @extends DisplayObjectContainer
    - * @constructor
    - * @param texture {Texture} The texture for this sprite
    - *
    - * A sprite can be created directly from an image like this :
    - * var sprite = new PIXI.Sprite.fromImage('assets/image.png');
    - * yourStage.addChild(sprite);
    - * then obviously don't forget to add it to the stage you have already created
    - */
    -PIXI.Sprite = function(texture)
    -{
    -    PIXI.DisplayObjectContainer.call( this );
    -
    -    /**
    -     * The anchor sets the origin point of the texture.
    -     * The default is 0,0 this means the texture's origin is the top left
    -     * Setting than anchor to 0.5,0.5 means the textures origin is centered
    -     * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner
    -     *
    -     * @property anchor
    -     * @type Point
    -     */
    -    this.anchor = new PIXI.Point();
    -
    -    /**
    -     * The texture that the sprite is using
    -     *
    -     * @property texture
    -     * @type Texture
    -     */
    -    this.texture = texture;
    -
    -    /**
    -     * The width of the sprite (this is initially set by the texture)
    -     *
    -     * @property _width
    -     * @type Number
    -     * @private
    -     */
    -    this._width = 0;
    -
    -    /**
    -     * The height of the sprite (this is initially set by the texture)
    -     *
    -     * @property _height
    -     * @type Number
    -     * @private
    -     */
    -    this._height = 0;
    -
    -    /**
    -     * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.
    -     *
    -     * @property tint
    -     * @type Number
    -     * @default 0xFFFFFF
    -     */
    -    this.tint = 0xFFFFFF;
    -
    -    /**
    -     * The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.
    -     *
    -     * @property blendMode
    -     * @type Number
    -     * @default PIXI.blendModes.NORMAL;
    -     */
    -    this.blendMode = PIXI.blendModes.NORMAL;
    -
    -    /**
    -     * The shader that will be used to render the texture to the stage. Set to null to remove a current shader.
    -     *
    -     * @property shader
    -     * @type PIXI.AbstractFilter
    -     * @default null
    -     */
    -    this.shader = null;
    -
    -    if(texture.baseTexture.hasLoaded)
    -    {
    -        this.onTextureUpdate();
    -    }
    -    else
    -    {
    -        this.texture.on( 'update', this.onTextureUpdate.bind(this) );
    -    }
    -
    -    this.renderable = true;
    -
    -};
    -
    -// constructor
    -PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    -PIXI.Sprite.prototype.constructor = PIXI.Sprite;
    -
    -/**
    - * The width of the sprite, setting this will actually modify the scale to achieve the value set
    - *
    - * @property width
    - * @type Number
    - */
    -Object.defineProperty(PIXI.Sprite.prototype, 'width', {
    -    get: function() {
    -        return this.scale.x * this.texture.frame.width;
    -    },
    -    set: function(value) {
    -        this.scale.x = value / this.texture.frame.width;
    -        this._width = value;
    -    }
    -});
    -
    -/**
    - * The height of the sprite, setting this will actually modify the scale to achieve the value set
    - *
    - * @property height
    - * @type Number
    - */
    -Object.defineProperty(PIXI.Sprite.prototype, 'height', {
    -    get: function() {
    -        return  this.scale.y * this.texture.frame.height;
    -    },
    -    set: function(value) {
    -        this.scale.y = value / this.texture.frame.height;
    -        this._height = value;
    -    }
    -});
    -
    -/**
    - * Sets the texture of the sprite
    - *
    - * @method setTexture
    - * @param texture {Texture} The PIXI texture that is displayed by the sprite
    - */
    -PIXI.Sprite.prototype.setTexture = function(texture)
    -{
    -    this.texture = texture;
    -    this.cachedTint = 0xFFFFFF;
    -};
    -
    -/**
    - * When the texture is updated, this event will fire to update the scale and frame
    - *
    - * @method onTextureUpdate
    - * @param event
    - * @private
    - */
    -PIXI.Sprite.prototype.onTextureUpdate = function()
    -{
    -    // so if _width is 0 then width was not set..
    -    if(this._width)this.scale.x = this._width / this.texture.frame.width;
    -    if(this._height)this.scale.y = this._height / this.texture.frame.height;
    -
    -    //this.updateFrame = true;
    -};
    -
    -/**
    -* Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account.
    -*
    -* @method getBounds
    -* @param matrix {Matrix} the transformation matrix of the sprite
    -* @return {Rectangle} the framing rectangle
    -*/
    -PIXI.Sprite.prototype.getBounds = function(matrix)
    -{
    -    var width = this.texture.frame.width;
    -    var height = this.texture.frame.height;
    -
    -    var w0 = width * (1-this.anchor.x);
    -    var w1 = width * -this.anchor.x;
    -
    -    var h0 = height * (1-this.anchor.y);
    -    var h1 = height * -this.anchor.y;
    -
    -    var worldTransform = matrix || this.worldTransform ;
    -
    -    var a = worldTransform.a;
    -    var b = worldTransform.b;
    -    var c = worldTransform.c;
    -    var d = worldTransform.d;
    -    var tx = worldTransform.tx;
    -    var ty = worldTransform.ty;
    -
    -    var x1 = a * w1 + c * h1 + tx;
    -    var y1 = d * h1 + b * w1 + ty;
    -
    -    var x2 = a * w0 + c * h1 + tx;
    -    var y2 = d * h1 + b * w0 + ty;
    -
    -    var x3 = a * w0 + c * h0 + tx;
    -    var y3 = d * h0 + b * w0 + ty;
    -
    -    var x4 =  a * w1 + c * h0 + tx;
    -    var y4 =  d * h0 + b * w1 + ty;
    -
    -    var maxX = -Infinity;
    -    var maxY = -Infinity;
    -
    -    var minX = Infinity;
    -    var minY = Infinity;
    -
    -    minX = x1 < minX ? x1 : minX;
    -    minX = x2 < minX ? x2 : minX;
    -    minX = x3 < minX ? x3 : minX;
    -    minX = x4 < minX ? x4 : minX;
    -
    -    minY = y1 < minY ? y1 : minY;
    -    minY = y2 < minY ? y2 : minY;
    -    minY = y3 < minY ? y3 : minY;
    -    minY = y4 < minY ? y4 : minY;
    -
    -    maxX = x1 > maxX ? x1 : maxX;
    -    maxX = x2 > maxX ? x2 : maxX;
    -    maxX = x3 > maxX ? x3 : maxX;
    -    maxX = x4 > maxX ? x4 : maxX;
    -
    -    maxY = y1 > maxY ? y1 : maxY;
    -    maxY = y2 > maxY ? y2 : maxY;
    -    maxY = y3 > maxY ? y3 : maxY;
    -    maxY = y4 > maxY ? y4 : maxY;
    -
    -    var bounds = this._bounds;
    -
    -    bounds.x = minX;
    -    bounds.width = maxX - minX;
    -
    -    bounds.y = minY;
    -    bounds.height = maxY - minY;
    -
    -    // store a reference so that if this function gets called again in the render cycle we do not have to recalculate
    -    this._currentBounds = bounds;
    -
    -    return bounds;
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession}
    -* @private
    -*/
    -PIXI.Sprite.prototype._renderWebGL = function(renderSession)
    -{
    -    // if the sprite is not visible or the alpha is 0 then no need to render this element
    -    if(!this.visible || this.alpha <= 0)return;
    -
    -    var i,j;
    -
    -    // do a quick check to see if this element has a mask or a filter.
    -    if(this._mask || this._filters)
    -    {
    -        var spriteBatch =  renderSession.spriteBatch;
    -
    -        // push filter first as we need to ensure the stencil buffer is correct for any masking
    -        if(this._filters)
    -        {
    -            spriteBatch.flush();
    -            renderSession.filterManager.pushFilter(this._filterBlock);
    -        }
    -
    -        if(this._mask)
    -        {
    -            spriteBatch.stop();
    -            renderSession.maskManager.pushMask(this.mask, renderSession);
    -            spriteBatch.start();
    -        }
    -
    -        // add this sprite to the batch
    -        spriteBatch.render(this);
    -
    -        // now loop through the children and make sure they get rendered
    -        for(i=0,j=this.children.length; i<j; i++)
    -        {
    -            this.children[i]._renderWebGL(renderSession);
    -        }
    -
    -        // time to stop the sprite batch as either a mask element or a filter draw will happen next
    -        spriteBatch.stop();
    -
    -        if(this._mask)renderSession.maskManager.popMask(this._mask, renderSession);
    -        if(this._filters)renderSession.filterManager.popFilter();
    -
    -        spriteBatch.start();
    -    }
    -    else
    -    {
    -        renderSession.spriteBatch.render(this);
    -
    -        // simple render children!
    -        for(i=0,j=this.children.length; i<j; i++)
    -        {
    -            this.children[i]._renderWebGL(renderSession);
    -        }
    -
    -    }
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession}
    -* @private
    -*/
    -PIXI.Sprite.prototype._renderCanvas = function(renderSession)
    -{
    -    // If the sprite is not visible or the alpha is 0 then no need to render this element
    -    if (this.visible === false || this.alpha === 0 || this.texture.crop.width <= 0 || this.texture.crop.height <= 0) return;
    -
    -    if (this.blendMode !== renderSession.currentBlendMode)
    -    {
    -        renderSession.currentBlendMode = this.blendMode;
    -        renderSession.context.globalCompositeOperation = PIXI.blendModesCanvas[renderSession.currentBlendMode];
    -    }
    -
    -    if (this._mask)
    -    {
    -        renderSession.maskManager.pushMask(this._mask, renderSession);
    -    }
    -
    -    //  Ignore null sources
    -    if (this.texture.valid)
    -    {
    -        var resolution = this.texture.baseTexture.resolution / renderSession.resolution;
    -
    -        renderSession.context.globalAlpha = this.worldAlpha;
    -
    -        //  Allow for pixel rounding
    -        if (renderSession.roundPixels)
    -        {
    -            renderSession.context.setTransform(
    -                this.worldTransform.a,
    -                this.worldTransform.b,
    -                this.worldTransform.c,
    -                this.worldTransform.d,
    -                (this.worldTransform.tx* renderSession.resolution) | 0,
    -                (this.worldTransform.ty* renderSession.resolution) | 0);
    -        }
    -        else
    -        {
    -            renderSession.context.setTransform(
    -                this.worldTransform.a,
    -                this.worldTransform.b,
    -                this.worldTransform.c,
    -                this.worldTransform.d,
    -                this.worldTransform.tx * renderSession.resolution,
    -                this.worldTransform.ty * renderSession.resolution);
    -        }
    -
    -        //  If smoothingEnabled is supported and we need to change the smoothing property for this texture
    -        if (renderSession.smoothProperty && renderSession.scaleMode !== this.texture.baseTexture.scaleMode)
    -        {
    -            renderSession.scaleMode = this.texture.baseTexture.scaleMode;
    -            renderSession.context[renderSession.smoothProperty] = (renderSession.scaleMode === PIXI.scaleModes.LINEAR);
    -        }
    -
    -        //  If the texture is trimmed we offset by the trim x/y, otherwise we use the frame dimensions
    -        var dx = (this.texture.trim) ? this.texture.trim.x - this.anchor.x * this.texture.trim.width : this.anchor.x * -this.texture.frame.width;
    -        var dy = (this.texture.trim) ? this.texture.trim.y - this.anchor.y * this.texture.trim.height : this.anchor.y * -this.texture.frame.height;
    -
    -        if (this.tint !== 0xFFFFFF)
    -        {
    -            if (this.cachedTint !== this.tint)
    -            {
    -                this.cachedTint = this.tint;
    -
    -                //  TODO clean up caching - how to clean up the caches?
    -                this.tintedTexture = PIXI.CanvasTinter.getTintedTexture(this, this.tint);
    -            }
    -
    -            renderSession.context.drawImage(
    -                                this.tintedTexture,
    -                                0,
    -                                0,
    -                                this.texture.crop.width,
    -                                this.texture.crop.height,
    -                                dx / resolution,
    -                                dy / resolution,
    -                                this.texture.crop.width / resolution,
    -                                this.texture.crop.height / resolution);
    -        }
    -        else
    -        {
    -            renderSession.context.drawImage(
    -                                this.texture.baseTexture.source,
    -                                this.texture.crop.x,
    -                                this.texture.crop.y,
    -                                this.texture.crop.width,
    -                                this.texture.crop.height,
    -                                dx / resolution,
    -                                dy / resolution,
    -                                this.texture.crop.width / resolution,
    -                                this.texture.crop.height / resolution);
    -        }
    -    }
    -
    -    // OVERWRITE
    -    for (var i = 0, j = this.children.length; i < j; i++)
    -    {
    -        this.children[i]._renderCanvas(renderSession);
    -    }
    -
    -    if (this._mask)
    -    {
    -        renderSession.maskManager.popMask(renderSession);
    -    }
    -};
    -
    -// some helper functions..
    -
    -/**
    - *
    - * Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId
    - * The frame ids are created when a Texture packer file has been loaded
    - *
    - * @method fromFrame
    - * @static
    - * @param frameId {String} The frame Id of the texture in the cache
    - * @return {Sprite} A new Sprite using a texture from the texture cache matching the frameId
    - */
    -PIXI.Sprite.fromFrame = function(frameId)
    -{
    -    var texture = PIXI.TextureCache[frameId];
    -    if(!texture) throw new Error('The frameId "' + frameId + '" does not exist in the texture cache' + this);
    -    return new PIXI.Sprite(texture);
    -};
    -
    -/**
    - *
    - * Helper function that creates a sprite that will contain a texture based on an image url
    - * If the image is not in the texture cache it will be loaded
    - *
    - * @method fromImage
    - * @static
    - * @param imageId {String} The image url of the texture
    - * @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
    - */
    -PIXI.Sprite.fromImage = function(imageId, crossorigin, scaleMode)
    -{
    -    var texture = PIXI.Texture.fromImage(imageId, crossorigin, scaleMode);
    -    return new PIXI.Sprite(texture);
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_display_SpriteBatch.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_display_SpriteBatch.js.html deleted file mode 100755 index b54f4c1..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_display_SpriteBatch.js.html +++ /dev/null @@ -1,455 +0,0 @@ - - - - - src/pixi/display/SpriteBatch.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/SpriteBatch.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/
    - */
    -
    -/**
    - * The SpriteBatch class is a really fast version of the DisplayObjectContainer 
    - * built solely for speed, so use when you need a lot of sprites or particles.
    - * And it's extremely easy to use : 
    -
    -    var container = new PIXI.SpriteBatch();
    - 
    -    stage.addChild(container);
    - 
    -    for(var i  = 0; i < 100; i++)
    -    {
    -        var sprite = new PIXI.Sprite.fromImage("myImage.png");
    -        container.addChild(sprite);
    -    }
    - * And here you have a hundred sprites that will be renderer at the speed of light
    - *
    - * @class SpriteBatch
    - * @constructor
    - * @param texture {Texture}
    - */
    -
    -//TODO RENAME to PARTICLE CONTAINER?
    -PIXI.SpriteBatch = function(texture)
    -{
    -    PIXI.DisplayObjectContainer.call( this);
    -
    -    this.textureThing = texture;
    -
    -    this.ready = false;
    -};
    -
    -PIXI.SpriteBatch.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
    -PIXI.SpriteBatch.prototype.constructor = PIXI.SpriteBatch;
    -
    -/*
    - * Initialises the spriteBatch
    - *
    - * @method initWebGL
    - * @param gl {WebGLContext} the current WebGL drawing context
    - */
    -PIXI.SpriteBatch.prototype.initWebGL = function(gl)
    -{
    -    // TODO only one needed for the whole engine really?
    -    this.fastSpriteBatch = new PIXI.WebGLFastSpriteBatch(gl);
    -
    -    this.ready = true;
    -};
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.SpriteBatch.prototype.updateTransform = function()
    -{
    -    // TODO don't need to!
    -    PIXI.DisplayObject.prototype.updateTransform.call( this );
    -    //  PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.SpriteBatch.prototype._renderWebGL = function(renderSession)
    -{
    -    if(!this.visible || this.alpha <= 0 || !this.children.length)return;
    -
    -    if(!this.ready)this.initWebGL( renderSession.gl );
    -    
    -    renderSession.spriteBatch.stop();
    -    
    -    renderSession.shaderManager.setShader(renderSession.shaderManager.fastShader);
    -    
    -    this.fastSpriteBatch.begin(this, renderSession);
    -    this.fastSpriteBatch.render(this);
    -
    -    renderSession.spriteBatch.start();
    - 
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.SpriteBatch.prototype._renderCanvas = function(renderSession)
    -{
    -    if(!this.visible || this.alpha <= 0 || !this.children.length)return;
    -    
    -    var context = renderSession.context;
    -    context.globalAlpha = this.worldAlpha;
    -
    -    PIXI.DisplayObject.prototype.updateTransform.call(this);
    -
    -    var transform = this.worldTransform;
    -    // alow for trimming
    -       
    -    var isRotated = true;
    -
    -    for (var i = 0; i < this.children.length; i++) {
    -       
    -        var child = this.children[i];
    -
    -        if(!child.visible)continue;
    -
    -        var texture = child.texture;
    -        var frame = texture.frame;
    -
    -        context.globalAlpha = this.worldAlpha * child.alpha;
    -
    -        if(child.rotation % (Math.PI * 2) === 0)
    -        {
    -            if(isRotated)
    -            {
    -                context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);
    -                isRotated = false;
    -            }
    -
    -            // this is the fastest  way to optimise! - if rotation is 0 then we can avoid any kind of setTransform call
    -            context.drawImage(texture.baseTexture.source,
    -                                 frame.x,
    -                                 frame.y,
    -                                 frame.width,
    -                                 frame.height,
    -                                 ((child.anchor.x) * (-frame.width * child.scale.x) + child.position.x  + 0.5) | 0,
    -                                 ((child.anchor.y) * (-frame.height * child.scale.y) + child.position.y  + 0.5) | 0,
    -                                 frame.width * child.scale.x,
    -                                 frame.height * child.scale.y);
    -        }
    -        else
    -        {
    -            if(!isRotated)isRotated = true;
    -    
    -            PIXI.DisplayObject.prototype.updateTransform.call(child);
    -           
    -            var childTransform = child.worldTransform;
    -
    -            // allow for trimming
    -           
    -            if (renderSession.roundPixels)
    -            {
    -                context.setTransform(childTransform.a, childTransform.b, childTransform.c, childTransform.d, childTransform.tx | 0, childTransform.ty | 0);
    -            }
    -            else
    -            {
    -                context.setTransform(childTransform.a, childTransform.b, childTransform.c, childTransform.d, childTransform.tx, childTransform.ty);
    -            }
    -
    -            context.drawImage(texture.baseTexture.source,
    -                                 frame.x,
    -                                 frame.y,
    -                                 frame.width,
    -                                 frame.height,
    -                                 ((child.anchor.x) * (-frame.width) + 0.5) | 0,
    -                                 ((child.anchor.y) * (-frame.height) + 0.5) | 0,
    -                                 frame.width,
    -                                 frame.height);
    -           
    -
    -        }
    -
    -       // context.restore();
    -    }
    -
    -//    context.restore();
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_display_Stage.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_display_Stage.js.html deleted file mode 100755 index 435f9dd..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_display_Stage.js.html +++ /dev/null @@ -1,413 +0,0 @@ - - - - - src/pixi/display/Stage.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/display/Stage.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A Stage represents the root of the display tree. Everything connected to the stage is rendered
    - *
    - * @class Stage
    - * @extends DisplayObjectContainer
    - * @constructor
    - * @param backgroundColor {Number} the background color of the stage, you have to pass this in is in hex format
    - *      like: 0xFFFFFF for white
    - * 
    - * Creating a stage is a mandatory process when you use Pixi, which is as simple as this : 
    - * var stage = new PIXI.Stage(0xFFFFFF);
    - * where the parameter given is the background colour of the stage, in hex
    - * you will use this stage instance to add your sprites to it and therefore to the renderer
    - * Here is how to add a sprite to the stage : 
    - * stage.addChild(sprite);
    - */
    -PIXI.Stage = function(backgroundColor)
    -{
    -    PIXI.DisplayObjectContainer.call( this );
    -
    -    /**
    -     * [read-only] Current transform of the object based on world (parent) factors
    -     *
    -     * @property worldTransform
    -     * @type Matrix
    -     * @readOnly
    -     * @private
    -     */
    -    this.worldTransform = new PIXI.Matrix();
    -
    -    /**
    -     * Whether or not the stage is interactive
    -     *
    -     * @property interactive
    -     * @type Boolean
    -     */
    -    this.interactive = true;
    -
    -    /**
    -     * The interaction manage for this stage, manages all interactive activity on the stage
    -     *
    -     * @property interactionManager
    -     * @type InteractionManager
    -     */
    -    this.interactionManager = new PIXI.InteractionManager(this);
    -
    -    /**
    -     * Whether the stage is dirty and needs to have interactions updated
    -     *
    -     * @property dirty
    -     * @type Boolean
    -     * @private
    -     */
    -    this.dirty = true;
    -
    -    //the stage is its own stage
    -    this.stage = this;
    -
    -    //optimize hit detection a bit
    -    this.stage.hitArea = new PIXI.Rectangle(0, 0, 100000, 100000);
    -
    -    this.setBackgroundColor(backgroundColor);
    -};
    -
    -// constructor
    -PIXI.Stage.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    -PIXI.Stage.prototype.constructor = PIXI.Stage;
    -
    -/**
    - * Sets another DOM element which can receive mouse/touch interactions instead of the default Canvas element.
    - * This is useful for when you have other DOM elements on top of the Canvas element.
    - *
    - * @method setInteractionDelegate
    - * @param domElement {DOMElement} This new domElement which will receive mouse/touch events
    - */
    -PIXI.Stage.prototype.setInteractionDelegate = function(domElement)
    -{
    -    this.interactionManager.setTargetDomElement( domElement );
    -};
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.Stage.prototype.updateTransform = function()
    -{
    -    this.worldAlpha = 1;
    -
    -    for(var i=0,j=this.children.length; i<j; i++)
    -    {
    -        this.children[i].updateTransform();
    -    }
    -
    -    if(this.dirty)
    -    {
    -        this.dirty = false;
    -        // update interactive!
    -        this.interactionManager.dirty = true;
    -    }
    -
    -    if(this.interactive)this.interactionManager.update();
    -};
    -
    -/**
    - * Sets the background color for the stage
    - *
    - * @method setBackgroundColor
    - * @param backgroundColor {Number} the color of the background, easiest way to pass this in is in hex format
    - *      like: 0xFFFFFF for white
    - */
    -PIXI.Stage.prototype.setBackgroundColor = function(backgroundColor)
    -{
    -    this.backgroundColor = backgroundColor || 0x000000;
    -    this.backgroundColorSplit = PIXI.hex2rgb(this.backgroundColor);
    -    var hex = this.backgroundColor.toString(16);
    -    hex = '000000'.substr(0, 6 - hex.length) + hex;
    -    this.backgroundColorString = '#' + hex;
    -};
    -
    -/**
    - * This will return the point containing global coordinates of the mouse.
    - *
    - * @method getMousePosition
    - * @return {Point} A point containing the coordinates of the global InteractionData position.
    - */
    -PIXI.Stage.prototype.getMousePosition = function()
    -{
    -    return this.interactionManager.mouse.global;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_extras_Rope.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_extras_Rope.js.html deleted file mode 100755 index f4fd44c..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_extras_Rope.js.html +++ /dev/null @@ -1,452 +0,0 @@ - - - - - src/pixi/extras/Rope.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/extras/Rope.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * @copyright Mat Groves, Rovanion Luckey
    - */
    -
    -/**
    - *
    - * @class Rope
    - * @constructor
    - * @extends Strip
    - * @param {Texture} texture - The texture to use on the rope.
    - * @param {Array} points - An array of {PIXI.Point}.
    - *
    - */
    -PIXI.Rope = function(texture, points)
    -{
    -    PIXI.Strip.call( this, texture );
    -    this.points = points;
    -
    -    this.verticies = new PIXI.Float32Array(points.length * 4);
    -    this.uvs = new PIXI.Float32Array(points.length * 4);
    -    this.colors = new PIXI.Float32Array(points.length * 2);
    -    this.indices = new PIXI.Uint16Array(points.length * 2);
    -
    -
    -    this.refresh();
    -};
    -
    -
    -// constructor
    -PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
    -PIXI.Rope.prototype.constructor = PIXI.Rope;
    -
    -/*
    - * Refreshes
    - *
    - * @method refresh
    - */
    -PIXI.Rope.prototype.refresh = function()
    -{
    -    var points = this.points;
    -    if(points.length < 1) return;
    -
    -    var uvs = this.uvs;
    -
    -    var lastPoint = points[0];
    -    var indices = this.indices;
    -    var colors = this.colors;
    -
    -    this.count-=0.2;
    -
    -    uvs[0] = 0;
    -    uvs[1] = 0;
    -    uvs[2] = 0;
    -    uvs[3] = 1;
    -
    -    colors[0] = 1;
    -    colors[1] = 1;
    -
    -    indices[0] = 0;
    -    indices[1] = 1;
    -
    -    var total = points.length,
    -        point, index, amount;
    -
    -    for (var i = 1; i < total; i++)
    -    {
    -        point = points[i];
    -        index = i * 4;
    -        // time to do some smart drawing!
    -        amount = i / (total-1);
    -
    -        if(i%2)
    -        {
    -            uvs[index] = amount;
    -            uvs[index+1] = 0;
    -
    -            uvs[index+2] = amount;
    -            uvs[index+3] = 1;
    -        }
    -        else
    -        {
    -            uvs[index] = amount;
    -            uvs[index+1] = 0;
    -
    -            uvs[index+2] = amount;
    -            uvs[index+3] = 1;
    -        }
    -
    -        index = i * 2;
    -        colors[index] = 1;
    -        colors[index+1] = 1;
    -
    -        index = i * 2;
    -        indices[index] = index;
    -        indices[index + 1] = index + 1;
    -
    -        lastPoint = point;
    -    }
    -};
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.Rope.prototype.updateTransform = function()
    -{
    -
    -    var points = this.points;
    -    if(points.length < 1)return;
    -
    -    var lastPoint = points[0];
    -    var nextPoint;
    -    var perp = {x:0, y:0};
    -
    -    this.count-=0.2;
    -
    -    var verticies = this.verticies;
    -    var total = points.length,
    -        point, index, ratio, perpLength, num;
    -
    -    for (var i = 0; i < total; i++)
    -    {
    -        point = points[i];
    -        index = i * 4;
    -
    -        if(i < points.length-1)
    -        {
    -            nextPoint = points[i+1];
    -        }
    -        else
    -        {
    -            nextPoint = point;
    -        }
    -
    -        perp.y = -(nextPoint.x - lastPoint.x);
    -        perp.x = nextPoint.y - lastPoint.y;
    -
    -        ratio = (1 - (i / (total-1))) * 10;
    -
    -        if(ratio > 1) ratio = 1;
    -
    -        perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y);
    -        num = this.texture.height / 2; //(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;
    -        perp.x /= perpLength;
    -        perp.y /= perpLength;
    -
    -        perp.x *= num;
    -        perp.y *= num;
    -
    -        verticies[index] = point.x + perp.x;
    -        verticies[index+1] = point.y + perp.y;
    -        verticies[index+2] = point.x - perp.x;
    -        verticies[index+3] = point.y - perp.y;
    -
    -        lastPoint = point;
    -    }
    -
    -    PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
    -};
    -/*
    - * Sets the texture that the Rope will use
    - *
    - * @method setTexture
    - * @param texture {Texture} the texture that will be used
    - */
    -PIXI.Rope.prototype.setTexture = function(texture)
    -{
    -    // stop current texture
    -    this.texture = texture;
    -    //this.updateFrame = true;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_extras_Spine.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_extras_Spine.js.html deleted file mode 100755 index a534e13..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_extras_Spine.js.html +++ /dev/null @@ -1,1752 +0,0 @@ - - - - - src/pixi/extras/Spine.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/extras/Spine.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * based on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi
    - *
    - * Awesome JS run time provided by EsotericSoftware
    - * https://github.com/EsotericSoftware/spine-runtimes
    - *
    - */
    -
    -/*
    - * Awesome JS run time provided by EsotericSoftware
    - *
    - * https://github.com/EsotericSoftware/spine-runtimes
    - *
    - */
    -
    -
    -
    -var spine = {};
    -
    -spine.BoneData = function (name, parent) {
    -    this.name = name;
    -    this.parent = parent;
    -};
    -spine.BoneData.prototype = {
    -    length: 0,
    -    x: 0, y: 0,
    -    rotation: 0,
    -    scaleX: 1, scaleY: 1
    -};
    -
    -spine.SlotData = function (name, boneData) {
    -    this.name = name;
    -    this.boneData = boneData;
    -};
    -spine.SlotData.prototype = {
    -    r: 1, g: 1, b: 1, a: 1,
    -    attachmentName: null
    -};
    -
    -spine.Bone = function (boneData, parent) {
    -    this.data = boneData;
    -    this.parent = parent;
    -    this.setToSetupPose();
    -};
    -spine.Bone.yDown = false;
    -spine.Bone.prototype = {
    -    x: 0, y: 0,
    -    rotation: 0,
    -    scaleX: 1, scaleY: 1,
    -    m00: 0, m01: 0, worldX: 0, // a b x
    -    m10: 0, m11: 0, worldY: 0, // c d y
    -    worldRotation: 0,
    -    worldScaleX: 1, worldScaleY: 1,
    -    updateWorldTransform: function (flipX, flipY) {
    -        var parent = this.parent;
    -        if (parent != null) {
    -            this.worldX = this.x * parent.m00 + this.y * parent.m01 + parent.worldX;
    -            this.worldY = this.x * parent.m10 + this.y * parent.m11 + parent.worldY;
    -            this.worldScaleX = parent.worldScaleX * this.scaleX;
    -            this.worldScaleY = parent.worldScaleY * this.scaleY;
    -            this.worldRotation = parent.worldRotation + this.rotation;
    -        } else {
    -            this.worldX = this.x;
    -            this.worldY = this.y;
    -            this.worldScaleX = this.scaleX;
    -            this.worldScaleY = this.scaleY;
    -            this.worldRotation = this.rotation;
    -        }
    -        var radians = this.worldRotation * Math.PI / 180;
    -        var cos = Math.cos(radians);
    -        var sin = Math.sin(radians);
    -        this.m00 = cos * this.worldScaleX;
    -        this.m10 = sin * this.worldScaleX;
    -        this.m01 = -sin * this.worldScaleY;
    -        this.m11 = cos * this.worldScaleY;
    -        if (flipX) {
    -            this.m00 = -this.m00;
    -            this.m01 = -this.m01;
    -        }
    -        if (flipY) {
    -            this.m10 = -this.m10;
    -            this.m11 = -this.m11;
    -        }
    -        if (spine.Bone.yDown) {
    -            this.m10 = -this.m10;
    -            this.m11 = -this.m11;
    -        }
    -    },
    -    setToSetupPose: function () {
    -        var data = this.data;
    -        this.x = data.x;
    -        this.y = data.y;
    -        this.rotation = data.rotation;
    -        this.scaleX = data.scaleX;
    -        this.scaleY = data.scaleY;
    -    }
    -};
    -
    -spine.Slot = function (slotData, skeleton, bone) {
    -    this.data = slotData;
    -    this.skeleton = skeleton;
    -    this.bone = bone;
    -    this.setToSetupPose();
    -};
    -spine.Slot.prototype = {
    -    r: 1, g: 1, b: 1, a: 1,
    -    _attachmentTime: 0,
    -    attachment: null,
    -    setAttachment: function (attachment) {
    -        this.attachment = attachment;
    -        this._attachmentTime = this.skeleton.time;
    -    },
    -    setAttachmentTime: function (time) {
    -        this._attachmentTime = this.skeleton.time - time;
    -    },
    -    getAttachmentTime: function () {
    -        return this.skeleton.time - this._attachmentTime;
    -    },
    -    setToSetupPose: function () {
    -        var data = this.data;
    -        this.r = data.r;
    -        this.g = data.g;
    -        this.b = data.b;
    -        this.a = data.a;
    -
    -        var slotDatas = this.skeleton.data.slots;
    -        for (var i = 0, n = slotDatas.length; i < n; i++) {
    -            if (slotDatas[i] == data) {
    -                this.setAttachment(!data.attachmentName ? null : this.skeleton.getAttachmentBySlotIndex(i, data.attachmentName));
    -                break;
    -            }
    -        }
    -    }
    -};
    -
    -spine.Skin = function (name) {
    -    this.name = name;
    -    this.attachments = {};
    -};
    -spine.Skin.prototype = {
    -    addAttachment: function (slotIndex, name, attachment) {
    -        this.attachments[slotIndex + ":" + name] = attachment;
    -    },
    -    getAttachment: function (slotIndex, name) {
    -        return this.attachments[slotIndex + ":" + name];
    -    },
    -    _attachAll: function (skeleton, oldSkin) {
    -        for (var key in oldSkin.attachments) {
    -            var colon = key.indexOf(":");
    -            var slotIndex = parseInt(key.substring(0, colon), 10);
    -            var name = key.substring(colon + 1);
    -            var slot = skeleton.slots[slotIndex];
    -            if (slot.attachment && slot.attachment.name == name) {
    -                var attachment = this.getAttachment(slotIndex, name);
    -                if (attachment) slot.setAttachment(attachment);
    -            }
    -        }
    -    }
    -};
    -
    -spine.Animation = function (name, timelines, duration) {
    -    this.name = name;
    -    this.timelines = timelines;
    -    this.duration = duration;
    -};
    -spine.Animation.prototype = {
    -    apply: function (skeleton, time, loop) {
    -        if (loop && this.duration) time %= this.duration;
    -        var timelines = this.timelines;
    -        for (var i = 0, n = timelines.length; i < n; i++)
    -            timelines[i].apply(skeleton, time, 1);
    -    },
    -    mix: function (skeleton, time, loop, alpha) {
    -        if (loop && this.duration) time %= this.duration;
    -        var timelines = this.timelines;
    -        for (var i = 0, n = timelines.length; i < n; i++)
    -            timelines[i].apply(skeleton, time, alpha);
    -    }
    -};
    -
    -spine.binarySearch = function (values, target, step) {
    -    var low = 0;
    -    var high = Math.floor(values.length / step) - 2;
    -    if (!high) return step;
    -    var current = high >>> 1;
    -    while (true) {
    -        if (values[(current + 1) * step] <= target)
    -            low = current + 1;
    -        else
    -            high = current;
    -        if (low == high) return (low + 1) * step;
    -        current = (low + high) >>> 1;
    -    }
    -};
    -spine.linearSearch = function (values, target, step) {
    -    for (var i = 0, last = values.length - step; i <= last; i += step)
    -        if (values[i] > target) return i;
    -    return -1;
    -};
    -
    -spine.Curves = function (frameCount) {
    -    this.curves = []; // dfx, dfy, ddfx, ddfy, dddfx, dddfy, ...
    -    this.curves.length = (frameCount - 1) * 6;
    -};
    -spine.Curves.prototype = {
    -    setLinear: function (frameIndex) {
    -        this.curves[frameIndex * 6] = 0/*LINEAR*/;
    -    },
    -    setStepped: function (frameIndex) {
    -        this.curves[frameIndex * 6] = -1/*STEPPED*/;
    -    },
    -    /** Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next.
    -     * cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of
    -     * the difference between the keyframe's values. */
    -    setCurve: function (frameIndex, cx1, cy1, cx2, cy2) {
    -        var subdiv_step = 1 / 10/*BEZIER_SEGMENTS*/;
    -        var subdiv_step2 = subdiv_step * subdiv_step;
    -        var subdiv_step3 = subdiv_step2 * subdiv_step;
    -        var pre1 = 3 * subdiv_step;
    -        var pre2 = 3 * subdiv_step2;
    -        var pre4 = 6 * subdiv_step2;
    -        var pre5 = 6 * subdiv_step3;
    -        var tmp1x = -cx1 * 2 + cx2;
    -        var tmp1y = -cy1 * 2 + cy2;
    -        var tmp2x = (cx1 - cx2) * 3 + 1;
    -        var tmp2y = (cy1 - cy2) * 3 + 1;
    -        var i = frameIndex * 6;
    -        var curves = this.curves;
    -        curves[i] = cx1 * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3;
    -        curves[i + 1] = cy1 * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3;
    -        curves[i + 2] = tmp1x * pre4 + tmp2x * pre5;
    -        curves[i + 3] = tmp1y * pre4 + tmp2y * pre5;
    -        curves[i + 4] = tmp2x * pre5;
    -        curves[i + 5] = tmp2y * pre5;
    -    },
    -    getCurvePercent: function (frameIndex, percent) {
    -        percent = percent < 0 ? 0 : (percent > 1 ? 1 : percent);
    -        var curveIndex = frameIndex * 6;
    -        var curves = this.curves;
    -        var dfx = curves[curveIndex];
    -        if (!dfx/*LINEAR*/) return percent;
    -        if (dfx == -1/*STEPPED*/) return 0;
    -        var dfy = curves[curveIndex + 1];
    -        var ddfx = curves[curveIndex + 2];
    -        var ddfy = curves[curveIndex + 3];
    -        var dddfx = curves[curveIndex + 4];
    -        var dddfy = curves[curveIndex + 5];
    -        var x = dfx, y = dfy;
    -        var i = 10/*BEZIER_SEGMENTS*/ - 2;
    -        while (true) {
    -            if (x >= percent) {
    -                var lastX = x - dfx;
    -                var lastY = y - dfy;
    -                return lastY + (y - lastY) * (percent - lastX) / (x - lastX);
    -            }
    -            if (!i) break;
    -            i--;
    -            dfx += ddfx;
    -            dfy += ddfy;
    -            ddfx += dddfx;
    -            ddfy += dddfy;
    -            x += dfx;
    -            y += dfy;
    -        }
    -        return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1.
    -    }
    -};
    -
    -spine.RotateTimeline = function (frameCount) {
    -    this.curves = new spine.Curves(frameCount);
    -    this.frames = []; // time, angle, ...
    -    this.frames.length = frameCount * 2;
    -};
    -spine.RotateTimeline.prototype = {
    -    boneIndex: 0,
    -    getFrameCount: function () {
    -        return this.frames.length / 2;
    -    },
    -    setFrame: function (frameIndex, time, angle) {
    -        frameIndex *= 2;
    -        this.frames[frameIndex] = time;
    -        this.frames[frameIndex + 1] = angle;
    -    },
    -    apply: function (skeleton, time, alpha) {
    -        var frames = this.frames,
    -            amount;
    -
    -        if (time < frames[0]) return; // Time is before first frame.
    -
    -        var bone = skeleton.bones[this.boneIndex];
    -
    -        if (time >= frames[frames.length - 2]) { // Time is after last frame.
    -            amount = bone.data.rotation + frames[frames.length - 1] - bone.rotation;
    -            while (amount > 180)
    -                amount -= 360;
    -            while (amount < -180)
    -                amount += 360;
    -            bone.rotation += amount * alpha;
    -            return;
    -        }
    -
    -        // Interpolate between the last frame and the current frame.
    -        var frameIndex = spine.binarySearch(frames, time, 2);
    -        var lastFrameValue = frames[frameIndex - 1];
    -        var frameTime = frames[frameIndex];
    -        var percent = 1 - (time - frameTime) / (frames[frameIndex - 2/*LAST_FRAME_TIME*/] - frameTime);
    -        percent = this.curves.getCurvePercent(frameIndex / 2 - 1, percent);
    -
    -        amount = frames[frameIndex + 1/*FRAME_VALUE*/] - lastFrameValue;
    -        while (amount > 180)
    -            amount -= 360;
    -        while (amount < -180)
    -            amount += 360;
    -        amount = bone.data.rotation + (lastFrameValue + amount * percent) - bone.rotation;
    -        while (amount > 180)
    -            amount -= 360;
    -        while (amount < -180)
    -            amount += 360;
    -        bone.rotation += amount * alpha;
    -    }
    -};
    -
    -spine.TranslateTimeline = function (frameCount) {
    -    this.curves = new spine.Curves(frameCount);
    -    this.frames = []; // time, x, y, ...
    -    this.frames.length = frameCount * 3;
    -};
    -spine.TranslateTimeline.prototype = {
    -    boneIndex: 0,
    -    getFrameCount: function () {
    -        return this.frames.length / 3;
    -    },
    -    setFrame: function (frameIndex, time, x, y) {
    -        frameIndex *= 3;
    -        this.frames[frameIndex] = time;
    -        this.frames[frameIndex + 1] = x;
    -        this.frames[frameIndex + 2] = y;
    -    },
    -    apply: function (skeleton, time, alpha) {
    -        var frames = this.frames;
    -        if (time < frames[0]) return; // Time is before first frame.
    -
    -        var bone = skeleton.bones[this.boneIndex];
    -
    -        if (time >= frames[frames.length - 3]) { // Time is after last frame.
    -            bone.x += (bone.data.x + frames[frames.length - 2] - bone.x) * alpha;
    -            bone.y += (bone.data.y + frames[frames.length - 1] - bone.y) * alpha;
    -            return;
    -        }
    -
    -        // Interpolate between the last frame and the current frame.
    -        var frameIndex = spine.binarySearch(frames, time, 3);
    -        var lastFrameX = frames[frameIndex - 2];
    -        var lastFrameY = frames[frameIndex - 1];
    -        var frameTime = frames[frameIndex];
    -        var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*LAST_FRAME_TIME*/] - frameTime);
    -        percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent);
    -
    -        bone.x += (bone.data.x + lastFrameX + (frames[frameIndex + 1/*FRAME_X*/] - lastFrameX) * percent - bone.x) * alpha;
    -        bone.y += (bone.data.y + lastFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - lastFrameY) * percent - bone.y) * alpha;
    -    }
    -};
    -
    -spine.ScaleTimeline = function (frameCount) {
    -    this.curves = new spine.Curves(frameCount);
    -    this.frames = []; // time, x, y, ...
    -    this.frames.length = frameCount * 3;
    -};
    -spine.ScaleTimeline.prototype = {
    -    boneIndex: 0,
    -    getFrameCount: function () {
    -        return this.frames.length / 3;
    -    },
    -    setFrame: function (frameIndex, time, x, y) {
    -        frameIndex *= 3;
    -        this.frames[frameIndex] = time;
    -        this.frames[frameIndex + 1] = x;
    -        this.frames[frameIndex + 2] = y;
    -    },
    -    apply: function (skeleton, time, alpha) {
    -        var frames = this.frames;
    -        if (time < frames[0]) return; // Time is before first frame.
    -
    -        var bone = skeleton.bones[this.boneIndex];
    -
    -        if (time >= frames[frames.length - 3]) { // Time is after last frame.
    -            bone.scaleX += (bone.data.scaleX - 1 + frames[frames.length - 2] - bone.scaleX) * alpha;
    -            bone.scaleY += (bone.data.scaleY - 1 + frames[frames.length - 1] - bone.scaleY) * alpha;
    -            return;
    -        }
    -
    -        // Interpolate between the last frame and the current frame.
    -        var frameIndex = spine.binarySearch(frames, time, 3);
    -        var lastFrameX = frames[frameIndex - 2];
    -        var lastFrameY = frames[frameIndex - 1];
    -        var frameTime = frames[frameIndex];
    -        var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*LAST_FRAME_TIME*/] - frameTime);
    -        percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent);
    -
    -        bone.scaleX += (bone.data.scaleX - 1 + lastFrameX + (frames[frameIndex + 1/*FRAME_X*/] - lastFrameX) * percent - bone.scaleX) * alpha;
    -        bone.scaleY += (bone.data.scaleY - 1 + lastFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - lastFrameY) * percent - bone.scaleY) * alpha;
    -    }
    -};
    -
    -spine.ColorTimeline = function (frameCount) {
    -    this.curves = new spine.Curves(frameCount);
    -    this.frames = []; // time, r, g, b, a, ...
    -    this.frames.length = frameCount * 5;
    -};
    -spine.ColorTimeline.prototype = {
    -    slotIndex: 0,
    -    getFrameCount: function () {
    -        return this.frames.length / 5;
    -    },
    -    setFrame: function (frameIndex, time, r, g, b, a) {
    -        frameIndex *= 5;
    -        this.frames[frameIndex] = time;
    -        this.frames[frameIndex + 1] = r;
    -        this.frames[frameIndex + 2] = g;
    -        this.frames[frameIndex + 3] = b;
    -        this.frames[frameIndex + 4] = a;
    -    },
    -    apply: function (skeleton, time, alpha) {
    -        var frames = this.frames;
    -        if (time < frames[0]) return; // Time is before first frame.
    -
    -        var slot = skeleton.slots[this.slotIndex];
    -
    -        if (time >= frames[frames.length - 5]) { // Time is after last frame.
    -            var i = frames.length - 1;
    -            slot.r = frames[i - 3];
    -            slot.g = frames[i - 2];
    -            slot.b = frames[i - 1];
    -            slot.a = frames[i];
    -            return;
    -        }
    -
    -        // Interpolate between the last frame and the current frame.
    -        var frameIndex = spine.binarySearch(frames, time, 5);
    -        var lastFrameR = frames[frameIndex - 4];
    -        var lastFrameG = frames[frameIndex - 3];
    -        var lastFrameB = frames[frameIndex - 2];
    -        var lastFrameA = frames[frameIndex - 1];
    -        var frameTime = frames[frameIndex];
    -        var percent = 1 - (time - frameTime) / (frames[frameIndex - 5/*LAST_FRAME_TIME*/] - frameTime);
    -        percent = this.curves.getCurvePercent(frameIndex / 5 - 1, percent);
    -
    -        var r = lastFrameR + (frames[frameIndex + 1/*FRAME_R*/] - lastFrameR) * percent;
    -        var g = lastFrameG + (frames[frameIndex + 2/*FRAME_G*/] - lastFrameG) * percent;
    -        var b = lastFrameB + (frames[frameIndex + 3/*FRAME_B*/] - lastFrameB) * percent;
    -        var a = lastFrameA + (frames[frameIndex + 4/*FRAME_A*/] - lastFrameA) * percent;
    -        if (alpha < 1) {
    -            slot.r += (r - slot.r) * alpha;
    -            slot.g += (g - slot.g) * alpha;
    -            slot.b += (b - slot.b) * alpha;
    -            slot.a += (a - slot.a) * alpha;
    -        } else {
    -            slot.r = r;
    -            slot.g = g;
    -            slot.b = b;
    -            slot.a = a;
    -        }
    -    }
    -};
    -
    -spine.AttachmentTimeline = function (frameCount) {
    -    this.curves = new spine.Curves(frameCount);
    -    this.frames = []; // time, ...
    -    this.frames.length = frameCount;
    -    this.attachmentNames = []; // time, ...
    -    this.attachmentNames.length = frameCount;
    -};
    -spine.AttachmentTimeline.prototype = {
    -    slotIndex: 0,
    -    getFrameCount: function () {
    -            return this.frames.length;
    -    },
    -    setFrame: function (frameIndex, time, attachmentName) {
    -        this.frames[frameIndex] = time;
    -        this.attachmentNames[frameIndex] = attachmentName;
    -    },
    -    apply: function (skeleton, time, alpha) {
    -        var frames = this.frames;
    -        if (time < frames[0]) return; // Time is before first frame.
    -
    -        var frameIndex;
    -        if (time >= frames[frames.length - 1]) // Time is after last frame.
    -            frameIndex = frames.length - 1;
    -        else
    -            frameIndex = spine.binarySearch(frames, time, 1) - 1;
    -
    -        var attachmentName = this.attachmentNames[frameIndex];
    -        skeleton.slots[this.slotIndex].setAttachment(!attachmentName ? null : skeleton.getAttachmentBySlotIndex(this.slotIndex, attachmentName));
    -    }
    -};
    -
    -spine.SkeletonData = function () {
    -    this.bones = [];
    -    this.slots = [];
    -    this.skins = [];
    -    this.animations = [];
    -};
    -spine.SkeletonData.prototype = {
    -    defaultSkin: null,
    -    /** @return May be null. */
    -    findBone: function (boneName) {
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            if (bones[i].name == boneName) return bones[i];
    -        return null;
    -    },
    -    /** @return -1 if the bone was not found. */
    -    findBoneIndex: function (boneName) {
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            if (bones[i].name == boneName) return i;
    -        return -1;
    -    },
    -    /** @return May be null. */
    -    findSlot: function (slotName) {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.length; i < n; i++) {
    -            if (slots[i].name == slotName) return slot[i];
    -        }
    -        return null;
    -    },
    -    /** @return -1 if the bone was not found. */
    -    findSlotIndex: function (slotName) {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.length; i < n; i++)
    -            if (slots[i].name == slotName) return i;
    -        return -1;
    -    },
    -    /** @return May be null. */
    -    findSkin: function (skinName) {
    -        var skins = this.skins;
    -        for (var i = 0, n = skins.length; i < n; i++)
    -            if (skins[i].name == skinName) return skins[i];
    -        return null;
    -    },
    -    /** @return May be null. */
    -    findAnimation: function (animationName) {
    -        var animations = this.animations;
    -        for (var i = 0, n = animations.length; i < n; i++)
    -            if (animations[i].name == animationName) return animations[i];
    -        return null;
    -    }
    -};
    -
    -spine.Skeleton = function (skeletonData) {
    -    this.data = skeletonData;
    -
    -    this.bones = [];
    -    for (var i = 0, n = skeletonData.bones.length; i < n; i++) {
    -        var boneData = skeletonData.bones[i];
    -        var parent = !boneData.parent ? null : this.bones[skeletonData.bones.indexOf(boneData.parent)];
    -        this.bones.push(new spine.Bone(boneData, parent));
    -    }
    -
    -    this.slots = [];
    -    this.drawOrder = [];
    -    for (i = 0, n = skeletonData.slots.length; i < n; i++) {
    -        var slotData = skeletonData.slots[i];
    -        var bone = this.bones[skeletonData.bones.indexOf(slotData.boneData)];
    -        var slot = new spine.Slot(slotData, this, bone);
    -        this.slots.push(slot);
    -        this.drawOrder.push(slot);
    -    }
    -};
    -spine.Skeleton.prototype = {
    -    x: 0, y: 0,
    -    skin: null,
    -    r: 1, g: 1, b: 1, a: 1,
    -    time: 0,
    -    flipX: false, flipY: false,
    -    /** Updates the world transform for each bone. */
    -    updateWorldTransform: function () {
    -        var flipX = this.flipX;
    -        var flipY = this.flipY;
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            bones[i].updateWorldTransform(flipX, flipY);
    -    },
    -    /** Sets the bones and slots to their setup pose values. */
    -    setToSetupPose: function () {
    -        this.setBonesToSetupPose();
    -        this.setSlotsToSetupPose();
    -    },
    -    setBonesToSetupPose: function () {
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            bones[i].setToSetupPose();
    -    },
    -    setSlotsToSetupPose: function () {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.length; i < n; i++)
    -            slots[i].setToSetupPose(i);
    -    },
    -    /** @return May return null. */
    -    getRootBone: function () {
    -        return this.bones.length ? this.bones[0] : null;
    -    },
    -    /** @return May be null. */
    -    findBone: function (boneName) {
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            if (bones[i].data.name == boneName) return bones[i];
    -        return null;
    -    },
    -    /** @return -1 if the bone was not found. */
    -    findBoneIndex: function (boneName) {
    -        var bones = this.bones;
    -        for (var i = 0, n = bones.length; i < n; i++)
    -            if (bones[i].data.name == boneName) return i;
    -        return -1;
    -    },
    -    /** @return May be null. */
    -    findSlot: function (slotName) {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.length; i < n; i++)
    -            if (slots[i].data.name == slotName) return slots[i];
    -        return null;
    -    },
    -    /** @return -1 if the bone was not found. */
    -    findSlotIndex: function (slotName) {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.length; i < n; i++)
    -            if (slots[i].data.name == slotName) return i;
    -        return -1;
    -    },
    -    setSkinByName: function (skinName) {
    -        var skin = this.data.findSkin(skinName);
    -        if (!skin) throw "Skin not found: " + skinName;
    -        this.setSkin(skin);
    -    },
    -    /** Sets the skin used to look up attachments not found in the {@link SkeletonData#getDefaultSkin() default skin}. Attachments
    -     * from the new skin are attached if the corresponding attachment from the old skin was attached.
    -     * @param newSkin May be null. */
    -    setSkin: function (newSkin) {
    -        if (this.skin && newSkin) newSkin._attachAll(this, this.skin);
    -        this.skin = newSkin;
    -    },
    -    /** @return May be null. */
    -    getAttachmentBySlotName: function (slotName, attachmentName) {
    -        return this.getAttachmentBySlotIndex(this.data.findSlotIndex(slotName), attachmentName);
    -    },
    -    /** @return May be null. */
    -    getAttachmentBySlotIndex: function (slotIndex, attachmentName) {
    -        if (this.skin) {
    -            var attachment = this.skin.getAttachment(slotIndex, attachmentName);
    -            if (attachment) return attachment;
    -        }
    -        if (this.data.defaultSkin) return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);
    -        return null;
    -    },
    -    /** @param attachmentName May be null. */
    -    setAttachment: function (slotName, attachmentName) {
    -        var slots = this.slots;
    -        for (var i = 0, n = slots.size; i < n; i++) {
    -            var slot = slots[i];
    -            if (slot.data.name == slotName) {
    -                var attachment = null;
    -                if (attachmentName) {
    -                    attachment = this.getAttachment(i, attachmentName);
    -                    if (attachment == null) throw "Attachment not found: " + attachmentName + ", for slot: " + slotName;
    -                }
    -                slot.setAttachment(attachment);
    -                return;
    -            }
    -        }
    -        throw "Slot not found: " + slotName;
    -    },
    -    update: function (delta) {
    -        time += delta;
    -    }
    -};
    -
    -spine.AttachmentType = {
    -    region: 0
    -};
    -
    -spine.RegionAttachment = function () {
    -    this.offset = [];
    -    this.offset.length = 8;
    -    this.uvs = [];
    -    this.uvs.length = 8;
    -};
    -spine.RegionAttachment.prototype = {
    -    x: 0, y: 0,
    -    rotation: 0,
    -    scaleX: 1, scaleY: 1,
    -    width: 0, height: 0,
    -    rendererObject: null,
    -    regionOffsetX: 0, regionOffsetY: 0,
    -    regionWidth: 0, regionHeight: 0,
    -    regionOriginalWidth: 0, regionOriginalHeight: 0,
    -    setUVs: function (u, v, u2, v2, rotate) {
    -        var uvs = this.uvs;
    -        if (rotate) {
    -            uvs[2/*X2*/] = u;
    -            uvs[3/*Y2*/] = v2;
    -            uvs[4/*X3*/] = u;
    -            uvs[5/*Y3*/] = v;
    -            uvs[6/*X4*/] = u2;
    -            uvs[7/*Y4*/] = v;
    -            uvs[0/*X1*/] = u2;
    -            uvs[1/*Y1*/] = v2;
    -        } else {
    -            uvs[0/*X1*/] = u;
    -            uvs[1/*Y1*/] = v2;
    -            uvs[2/*X2*/] = u;
    -            uvs[3/*Y2*/] = v;
    -            uvs[4/*X3*/] = u2;
    -            uvs[5/*Y3*/] = v;
    -            uvs[6/*X4*/] = u2;
    -            uvs[7/*Y4*/] = v2;
    -        }
    -    },
    -    updateOffset: function () {
    -        var regionScaleX = this.width / this.regionOriginalWidth * this.scaleX;
    -        var regionScaleY = this.height / this.regionOriginalHeight * this.scaleY;
    -        var localX = -this.width / 2 * this.scaleX + this.regionOffsetX * regionScaleX;
    -        var localY = -this.height / 2 * this.scaleY + this.regionOffsetY * regionScaleY;
    -        var localX2 = localX + this.regionWidth * regionScaleX;
    -        var localY2 = localY + this.regionHeight * regionScaleY;
    -        var radians = this.rotation * Math.PI / 180;
    -        var cos = Math.cos(radians);
    -        var sin = Math.sin(radians);
    -        var localXCos = localX * cos + this.x;
    -        var localXSin = localX * sin;
    -        var localYCos = localY * cos + this.y;
    -        var localYSin = localY * sin;
    -        var localX2Cos = localX2 * cos + this.x;
    -        var localX2Sin = localX2 * sin;
    -        var localY2Cos = localY2 * cos + this.y;
    -        var localY2Sin = localY2 * sin;
    -        var offset = this.offset;
    -        offset[0/*X1*/] = localXCos - localYSin;
    -        offset[1/*Y1*/] = localYCos + localXSin;
    -        offset[2/*X2*/] = localXCos - localY2Sin;
    -        offset[3/*Y2*/] = localY2Cos + localXSin;
    -        offset[4/*X3*/] = localX2Cos - localY2Sin;
    -        offset[5/*Y3*/] = localY2Cos + localX2Sin;
    -        offset[6/*X4*/] = localX2Cos - localYSin;
    -        offset[7/*Y4*/] = localYCos + localX2Sin;
    -    },
    -    computeVertices: function (x, y, bone, vertices) {
    -        x += bone.worldX;
    -        y += bone.worldY;
    -        var m00 = bone.m00;
    -        var m01 = bone.m01;
    -        var m10 = bone.m10;
    -        var m11 = bone.m11;
    -        var offset = this.offset;
    -        vertices[0/*X1*/] = offset[0/*X1*/] * m00 + offset[1/*Y1*/] * m01 + x;
    -        vertices[1/*Y1*/] = offset[0/*X1*/] * m10 + offset[1/*Y1*/] * m11 + y;
    -        vertices[2/*X2*/] = offset[2/*X2*/] * m00 + offset[3/*Y2*/] * m01 + x;
    -        vertices[3/*Y2*/] = offset[2/*X2*/] * m10 + offset[3/*Y2*/] * m11 + y;
    -        vertices[4/*X3*/] = offset[4/*X3*/] * m00 + offset[5/*X3*/] * m01 + x;
    -        vertices[5/*X3*/] = offset[4/*X3*/] * m10 + offset[5/*X3*/] * m11 + y;
    -        vertices[6/*X4*/] = offset[6/*X4*/] * m00 + offset[7/*Y4*/] * m01 + x;
    -        vertices[7/*Y4*/] = offset[6/*X4*/] * m10 + offset[7/*Y4*/] * m11 + y;
    -    }
    -}
    -
    -spine.AnimationStateData = function (skeletonData) {
    -    this.skeletonData = skeletonData;
    -    this.animationToMixTime = {};
    -};
    -spine.AnimationStateData.prototype = {
    -        defaultMix: 0,
    -    setMixByName: function (fromName, toName, duration) {
    -        var from = this.skeletonData.findAnimation(fromName);
    -        if (!from) throw "Animation not found: " + fromName;
    -        var to = this.skeletonData.findAnimation(toName);
    -        if (!to) throw "Animation not found: " + toName;
    -        this.setMix(from, to, duration);
    -    },
    -    setMix: function (from, to, duration) {
    -        this.animationToMixTime[from.name + ":" + to.name] = duration;
    -    },
    -    getMix: function (from, to) {
    -        var time = this.animationToMixTime[from.name + ":" + to.name];
    -            return time ? time : this.defaultMix;
    -    }
    -};
    -
    -spine.AnimationState = function (stateData) {
    -    this.data = stateData;
    -    this.queue = [];
    -};
    -spine.AnimationState.prototype = {
    -    animationSpeed: 1,
    -    current: null,
    -    previous: null,
    -    currentTime: 0,
    -    previousTime: 0,
    -    currentLoop: false,
    -    previousLoop: false,
    -    mixTime: 0,
    -    mixDuration: 0,
    -    update: function (delta) {
    -        this.currentTime += (delta * this.animationSpeed); //timeScale: Multiply delta by the speed of animation required.
    -        this.previousTime += delta;
    -        this.mixTime += delta;
    -
    -        if (this.queue.length > 0) {
    -            var entry = this.queue[0];
    -            if (this.currentTime >= entry.delay) {
    -                this._setAnimation(entry.animation, entry.loop);
    -                this.queue.shift();
    -            }
    -        }
    -    },
    -    apply: function (skeleton) {
    -        if (!this.current) return;
    -        if (this.previous) {
    -            this.previous.apply(skeleton, this.previousTime, this.previousLoop);
    -            var alpha = this.mixTime / this.mixDuration;
    -            if (alpha >= 1) {
    -                alpha = 1;
    -                this.previous = null;
    -            }
    -            this.current.mix(skeleton, this.currentTime, this.currentLoop, alpha);
    -        } else
    -            this.current.apply(skeleton, this.currentTime, this.currentLoop);
    -    },
    -    clearAnimation: function () {
    -        this.previous = null;
    -        this.current = null;
    -        this.queue.length = 0;
    -    },
    -    _setAnimation: function (animation, loop) {
    -        this.previous = null;
    -        if (animation && this.current) {
    -            this.mixDuration = this.data.getMix(this.current, animation);
    -            if (this.mixDuration > 0) {
    -                this.mixTime = 0;
    -                this.previous = this.current;
    -                this.previousTime = this.currentTime;
    -                this.previousLoop = this.currentLoop;
    -            }
    -        }
    -        this.current = animation;
    -        this.currentLoop = loop;
    -        this.currentTime = 0;
    -    },
    -    /** @see #setAnimation(Animation, Boolean) */
    -    setAnimationByName: function (animationName, loop) {
    -        var animation = this.data.skeletonData.findAnimation(animationName);
    -        if (!animation) throw "Animation not found: " + animationName;
    -        this.setAnimation(animation, loop);
    -    },
    -    /** Set the current animation. Any queued animations are cleared and the current animation time is set to 0.
    -     * @param animation May be null. */
    -    setAnimation: function (animation, loop) {
    -        this.queue.length = 0;
    -        this._setAnimation(animation, loop);
    -    },
    -    /** @see #addAnimation(Animation, Boolean, Number) */
    -    addAnimationByName: function (animationName, loop, delay) {
    -        var animation = this.data.skeletonData.findAnimation(animationName);
    -        if (!animation) throw "Animation not found: " + animationName;
    -        this.addAnimation(animation, loop, delay);
    -    },
    -    /** Adds an animation to be played delay seconds after the current or last queued animation.
    -     * @param delay May be <= 0 to use duration of previous animation minus any mix duration plus the negative delay. */
    -    addAnimation: function (animation, loop, delay) {
    -        var entry = {};
    -        entry.animation = animation;
    -        entry.loop = loop;
    -
    -        if (!delay || delay <= 0) {
    -            var previousAnimation = this.queue.length ? this.queue[this.queue.length - 1].animation : this.current;
    -            if (previousAnimation != null)
    -                delay = previousAnimation.duration - this.data.getMix(previousAnimation, animation) + (delay || 0);
    -            else
    -                delay = 0;
    -        }
    -        entry.delay = delay;
    -
    -        this.queue.push(entry);
    -    },
    -    /** Returns true if no animation is set or if the current time is greater than the animation duration, regardless of looping. */
    -    isComplete: function () {
    -        return !this.current || this.currentTime >= this.current.duration;
    -    }
    -};
    -
    -spine.SkeletonJson = function (attachmentLoader) {
    -    this.attachmentLoader = attachmentLoader;
    -};
    -spine.SkeletonJson.prototype = {
    -    scale: 1,
    -    readSkeletonData: function (root) {
    -        /*jshint -W069*/
    -        var skeletonData = new spine.SkeletonData(),
    -            boneData;
    -
    -        // Bones.
    -        var bones = root["bones"];
    -        for (var i = 0, n = bones.length; i < n; i++) {
    -            var boneMap = bones[i];
    -            var parent = null;
    -            if (boneMap["parent"]) {
    -                parent = skeletonData.findBone(boneMap["parent"]);
    -                if (!parent) throw "Parent bone not found: " + boneMap["parent"];
    -            }
    -            boneData = new spine.BoneData(boneMap["name"], parent);
    -            boneData.length = (boneMap["length"] || 0) * this.scale;
    -            boneData.x = (boneMap["x"] || 0) * this.scale;
    -            boneData.y = (boneMap["y"] || 0) * this.scale;
    -            boneData.rotation = (boneMap["rotation"] || 0);
    -            boneData.scaleX = boneMap["scaleX"] || 1;
    -            boneData.scaleY = boneMap["scaleY"] || 1;
    -            skeletonData.bones.push(boneData);
    -        }
    -
    -        // Slots.
    -        var slots = root["slots"];
    -        for (i = 0, n = slots.length; i < n; i++) {
    -            var slotMap = slots[i];
    -            boneData = skeletonData.findBone(slotMap["bone"]);
    -            if (!boneData) throw "Slot bone not found: " + slotMap["bone"];
    -            var slotData = new spine.SlotData(slotMap["name"], boneData);
    -
    -            var color = slotMap["color"];
    -            if (color) {
    -                slotData.r = spine.SkeletonJson.toColor(color, 0);
    -                slotData.g = spine.SkeletonJson.toColor(color, 1);
    -                slotData.b = spine.SkeletonJson.toColor(color, 2);
    -                slotData.a = spine.SkeletonJson.toColor(color, 3);
    -            }
    -
    -            slotData.attachmentName = slotMap["attachment"];
    -
    -            skeletonData.slots.push(slotData);
    -        }
    -
    -        // Skins.
    -        var skins = root["skins"];
    -        for (var skinName in skins) {
    -            if (!skins.hasOwnProperty(skinName)) continue;
    -            var skinMap = skins[skinName];
    -            var skin = new spine.Skin(skinName);
    -            for (var slotName in skinMap) {
    -                if (!skinMap.hasOwnProperty(slotName)) continue;
    -                var slotIndex = skeletonData.findSlotIndex(slotName);
    -                var slotEntry = skinMap[slotName];
    -                for (var attachmentName in slotEntry) {
    -                    if (!slotEntry.hasOwnProperty(attachmentName)) continue;
    -                    var attachment = this.readAttachment(skin, attachmentName, slotEntry[attachmentName]);
    -                    if (attachment != null) skin.addAttachment(slotIndex, attachmentName, attachment);
    -                }
    -            }
    -            skeletonData.skins.push(skin);
    -            if (skin.name == "default") skeletonData.defaultSkin = skin;
    -        }
    -
    -        // Animations.
    -        var animations = root["animations"];
    -        for (var animationName in animations) {
    -            if (!animations.hasOwnProperty(animationName)) continue;
    -            this.readAnimation(animationName, animations[animationName], skeletonData);
    -        }
    -
    -        return skeletonData;
    -    },
    -    readAttachment: function (skin, name, map) {
    -        /*jshint -W069*/
    -        name = map["name"] || name;
    -
    -        var type = spine.AttachmentType[map["type"] || "region"];
    -
    -        if (type == spine.AttachmentType.region) {
    -            var attachment = new spine.RegionAttachment();
    -            attachment.x = (map["x"] || 0) * this.scale;
    -            attachment.y = (map["y"] || 0) * this.scale;
    -            attachment.scaleX = map["scaleX"] || 1;
    -            attachment.scaleY = map["scaleY"] || 1;
    -            attachment.rotation = map["rotation"] || 0;
    -            attachment.width = (map["width"] || 32) * this.scale;
    -            attachment.height = (map["height"] || 32) * this.scale;
    -            attachment.updateOffset();
    -
    -            attachment.rendererObject = {};
    -            attachment.rendererObject.name = name;
    -            attachment.rendererObject.scale = {};
    -            attachment.rendererObject.scale.x = attachment.scaleX;
    -            attachment.rendererObject.scale.y = attachment.scaleY;
    -            attachment.rendererObject.rotation = -attachment.rotation * Math.PI / 180;
    -            return attachment;
    -        }
    -
    -            throw "Unknown attachment type: " + type;
    -    },
    -
    -    readAnimation: function (name, map, skeletonData) {
    -        /*jshint -W069*/
    -        var timelines = [];
    -        var duration = 0;
    -        var frameIndex, timeline, timelineName, valueMap, values,
    -            i, n;
    -
    -        var bones = map["bones"];
    -        for (var boneName in bones) {
    -            if (!bones.hasOwnProperty(boneName)) continue;
    -            var boneIndex = skeletonData.findBoneIndex(boneName);
    -            if (boneIndex == -1) throw "Bone not found: " + boneName;
    -            var boneMap = bones[boneName];
    -
    -            for (timelineName in boneMap) {
    -                if (!boneMap.hasOwnProperty(timelineName)) continue;
    -                values = boneMap[timelineName];
    -                if (timelineName == "rotate") {
    -                    timeline = new spine.RotateTimeline(values.length);
    -                    timeline.boneIndex = boneIndex;
    -
    -                    frameIndex = 0;
    -                    for (i = 0, n = values.length; i < n; i++) {
    -                        valueMap = values[i];
    -                        timeline.setFrame(frameIndex, valueMap["time"], valueMap["angle"]);
    -                        spine.SkeletonJson.readCurve(timeline, frameIndex, valueMap);
    -                        frameIndex++;
    -                    }
    -                    timelines.push(timeline);
    -                    duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 2 - 2]);
    -
    -                } else if (timelineName == "translate" || timelineName == "scale") {
    -                    var timelineScale = 1;
    -                    if (timelineName == "scale")
    -                        timeline = new spine.ScaleTimeline(values.length);
    -                    else {
    -                        timeline = new spine.TranslateTimeline(values.length);
    -                        timelineScale = this.scale;
    -                    }
    -                    timeline.boneIndex = boneIndex;
    -
    -                    frameIndex = 0;
    -                    for (i = 0, n = values.length; i < n; i++) {
    -                        valueMap = values[i];
    -                        var x = (valueMap["x"] || 0) * timelineScale;
    -                        var y = (valueMap["y"] || 0) * timelineScale;
    -                        timeline.setFrame(frameIndex, valueMap["time"], x, y);
    -                        spine.SkeletonJson.readCurve(timeline, frameIndex, valueMap);
    -                        frameIndex++;
    -                    }
    -                    timelines.push(timeline);
    -                    duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 3 - 3]);
    -
    -                } else
    -                    throw "Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")";
    -            }
    -        }
    -        var slots = map["slots"];
    -        for (var slotName in slots) {
    -            if (!slots.hasOwnProperty(slotName)) continue;
    -            var slotMap = slots[slotName];
    -            var slotIndex = skeletonData.findSlotIndex(slotName);
    -
    -            for (timelineName in slotMap) {
    -                if (!slotMap.hasOwnProperty(timelineName)) continue;
    -                values = slotMap[timelineName];
    -                if (timelineName == "color") {
    -                    timeline = new spine.ColorTimeline(values.length);
    -                    timeline.slotIndex = slotIndex;
    -
    -                    frameIndex = 0;
    -                    for (i = 0, n = values.length; i < n; i++) {
    -                        valueMap = values[i];
    -                        var color = valueMap["color"];
    -                        var r = spine.SkeletonJson.toColor(color, 0);
    -                        var g = spine.SkeletonJson.toColor(color, 1);
    -                        var b = spine.SkeletonJson.toColor(color, 2);
    -                        var a = spine.SkeletonJson.toColor(color, 3);
    -                        timeline.setFrame(frameIndex, valueMap["time"], r, g, b, a);
    -                        spine.SkeletonJson.readCurve(timeline, frameIndex, valueMap);
    -                        frameIndex++;
    -                    }
    -                    timelines.push(timeline);
    -                    duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 5 - 5]);
    -
    -                } else if (timelineName == "attachment") {
    -                    timeline = new spine.AttachmentTimeline(values.length);
    -                    timeline.slotIndex = slotIndex;
    -
    -                    frameIndex = 0;
    -                    for (i = 0, n = values.length; i < n; i++) {
    -                        valueMap = values[i];
    -                        timeline.setFrame(frameIndex++, valueMap["time"], valueMap["name"]);
    -                    }
    -                    timelines.push(timeline);
    -                        duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);
    -
    -                } else
    -                    throw "Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")";
    -            }
    -        }
    -        skeletonData.animations.push(new spine.Animation(name, timelines, duration));
    -    }
    -};
    -spine.SkeletonJson.readCurve = function (timeline, frameIndex, valueMap) {
    -    /*jshint -W069*/
    -    var curve = valueMap["curve"];
    -    if (!curve) return;
    -    if (curve == "stepped")
    -        timeline.curves.setStepped(frameIndex);
    -    else if (curve instanceof Array)
    -        timeline.curves.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]);
    -};
    -spine.SkeletonJson.toColor = function (hexString, colorIndex) {
    -    if (hexString.length != 8) throw "Color hexidecimal length must be 8, recieved: " + hexString;
    -    return parseInt(hexString.substr(colorIndex * 2, 2), 16) / 255;
    -};
    -
    -spine.Atlas = function (atlasText, textureLoader) {
    -    this.textureLoader = textureLoader;
    -    this.pages = [];
    -    this.regions = [];
    -
    -    var reader = new spine.AtlasReader(atlasText);
    -    var tuple = [];
    -    tuple.length = 4;
    -    var page = null;
    -    while (true) {
    -        var line = reader.readLine();
    -        if (line == null) break;
    -        line = reader.trim(line);
    -        if (!line.length)
    -            page = null;
    -        else if (!page) {
    -            page = new spine.AtlasPage();
    -            page.name = line;
    -
    -            page.format = spine.Atlas.Format[reader.readValue()];
    -
    -            reader.readTuple(tuple);
    -            page.minFilter = spine.Atlas.TextureFilter[tuple[0]];
    -            page.magFilter = spine.Atlas.TextureFilter[tuple[1]];
    -
    -            var direction = reader.readValue();
    -            page.uWrap = spine.Atlas.TextureWrap.clampToEdge;
    -            page.vWrap = spine.Atlas.TextureWrap.clampToEdge;
    -            if (direction == "x")
    -                page.uWrap = spine.Atlas.TextureWrap.repeat;
    -            else if (direction == "y")
    -                page.vWrap = spine.Atlas.TextureWrap.repeat;
    -            else if (direction == "xy")
    -                page.uWrap = page.vWrap = spine.Atlas.TextureWrap.repeat;
    -
    -            textureLoader.load(page, line);
    -
    -            this.pages.push(page);
    -
    -        } else {
    -            var region = new spine.AtlasRegion();
    -            region.name = line;
    -            region.page = page;
    -
    -            region.rotate = reader.readValue() == "true";
    -
    -            reader.readTuple(tuple);
    -            var x = parseInt(tuple[0], 10);
    -            var y = parseInt(tuple[1], 10);
    -
    -            reader.readTuple(tuple);
    -            var width = parseInt(tuple[0], 10);
    -            var height = parseInt(tuple[1], 10);
    -
    -            region.u = x / page.width;
    -            region.v = y / page.height;
    -            if (region.rotate) {
    -                region.u2 = (x + height) / page.width;
    -                region.v2 = (y + width) / page.height;
    -            } else {
    -                region.u2 = (x + width) / page.width;
    -                region.v2 = (y + height) / page.height;
    -            }
    -            region.x = x;
    -            region.y = y;
    -            region.width = Math.abs(width);
    -            region.height = Math.abs(height);
    -
    -            if (reader.readTuple(tuple) == 4) { // split is optional
    -                region.splits = [parseInt(tuple[0], 10), parseInt(tuple[1], 10), parseInt(tuple[2], 10), parseInt(tuple[3], 10)];
    -
    -                if (reader.readTuple(tuple) == 4) { // pad is optional, but only present with splits
    -                    region.pads = [parseInt(tuple[0], 10), parseInt(tuple[1], 10), parseInt(tuple[2], 10), parseInt(tuple[3], 10)];
    -
    -                    reader.readTuple(tuple);
    -                }
    -            }
    -
    -            region.originalWidth = parseInt(tuple[0], 10);
    -            region.originalHeight = parseInt(tuple[1], 10);
    -
    -            reader.readTuple(tuple);
    -            region.offsetX = parseInt(tuple[0], 10);
    -            region.offsetY = parseInt(tuple[1], 10);
    -
    -            region.index = parseInt(reader.readValue(), 10);
    -
    -            this.regions.push(region);
    -        }
    -    }
    -};
    -spine.Atlas.prototype = {
    -    findRegion: function (name) {
    -        var regions = this.regions;
    -        for (var i = 0, n = regions.length; i < n; i++)
    -            if (regions[i].name == name) return regions[i];
    -        return null;
    -    },
    -    dispose: function () {
    -        var pages = this.pages;
    -        for (var i = 0, n = pages.length; i < n; i++)
    -            this.textureLoader.unload(pages[i].rendererObject);
    -    },
    -    updateUVs: function (page) {
    -        var regions = this.regions;
    -        for (var i = 0, n = regions.length; i < n; i++) {
    -            var region = regions[i];
    -            if (region.page != page) continue;
    -            region.u = region.x / page.width;
    -            region.v = region.y / page.height;
    -            if (region.rotate) {
    -                region.u2 = (region.x + region.height) / page.width;
    -                region.v2 = (region.y + region.width) / page.height;
    -            } else {
    -                region.u2 = (region.x + region.width) / page.width;
    -                region.v2 = (region.y + region.height) / page.height;
    -            }
    -        }
    -    }
    -};
    -
    -spine.Atlas.Format = {
    -    alpha: 0,
    -    intensity: 1,
    -    luminanceAlpha: 2,
    -    rgb565: 3,
    -    rgba4444: 4,
    -    rgb888: 5,
    -    rgba8888: 6
    -};
    -
    -spine.Atlas.TextureFilter = {
    -    nearest: 0,
    -    linear: 1,
    -    mipMap: 2,
    -    mipMapNearestNearest: 3,
    -    mipMapLinearNearest: 4,
    -    mipMapNearestLinear: 5,
    -    mipMapLinearLinear: 6
    -};
    -
    -spine.Atlas.TextureWrap = {
    -    mirroredRepeat: 0,
    -    clampToEdge: 1,
    -    repeat: 2
    -};
    -
    -spine.AtlasPage = function () {};
    -spine.AtlasPage.prototype = {
    -    name: null,
    -    format: null,
    -    minFilter: null,
    -    magFilter: null,
    -    uWrap: null,
    -    vWrap: null,
    -    rendererObject: null,
    -    width: 0,
    -    height: 0
    -};
    -
    -spine.AtlasRegion = function () {};
    -spine.AtlasRegion.prototype = {
    -    page: null,
    -    name: null,
    -    x: 0, y: 0,
    -    width: 0, height: 0,
    -    u: 0, v: 0, u2: 0, v2: 0,
    -    offsetX: 0, offsetY: 0,
    -    originalWidth: 0, originalHeight: 0,
    -    index: 0,
    -    rotate: false,
    -    splits: null,
    -    pads: null
    -};
    -
    -spine.AtlasReader = function (text) {
    -    this.lines = text.split(/\r\n|\r|\n/);
    -};
    -spine.AtlasReader.prototype = {
    -    index: 0,
    -    trim: function (value) {
    -        return value.replace(/^\s+|\s+$/g, "");
    -    },
    -    readLine: function () {
    -        if (this.index >= this.lines.length) return null;
    -        return this.lines[this.index++];
    -    },
    -    readValue: function () {
    -        var line = this.readLine();
    -        var colon = line.indexOf(":");
    -        if (colon == -1) throw "Invalid line: " + line;
    -        return this.trim(line.substring(colon + 1));
    -    },
    -    /** Returns the number of tuple values read (2 or 4). */
    -    readTuple: function (tuple) {
    -        var line = this.readLine();
    -        var colon = line.indexOf(":");
    -        if (colon == -1) throw "Invalid line: " + line;
    -        var i = 0, lastMatch= colon + 1;
    -        for (; i < 3; i++) {
    -            var comma = line.indexOf(",", lastMatch);
    -            if (comma == -1) {
    -                if (!i) throw "Invalid line: " + line;
    -                break;
    -            }
    -            tuple[i] = this.trim(line.substr(lastMatch, comma - lastMatch));
    -            lastMatch = comma + 1;
    -        }
    -        tuple[i] = this.trim(line.substring(lastMatch));
    -        return i + 1;
    -    }
    -}
    -
    -spine.AtlasAttachmentLoader = function (atlas) {
    -    this.atlas = atlas;
    -}
    -spine.AtlasAttachmentLoader.prototype = {
    -    newAttachment: function (skin, type, name) {
    -        switch (type) {
    -        case spine.AttachmentType.region:
    -            var region = this.atlas.findRegion(name);
    -            if (!region) throw "Region not found in atlas: " + name + " (" + type + ")";
    -            var attachment = new spine.RegionAttachment(name);
    -            attachment.rendererObject = region;
    -            attachment.setUVs(region.u, region.v, region.u2, region.v2, region.rotate);
    -            attachment.regionOffsetX = region.offsetX;
    -            attachment.regionOffsetY = region.offsetY;
    -            attachment.regionWidth = region.width;
    -            attachment.regionHeight = region.height;
    -            attachment.regionOriginalWidth = region.originalWidth;
    -            attachment.regionOriginalHeight = region.originalHeight;
    -            return attachment;
    -        }
    -        throw "Unknown attachment type: " + type;
    -    }
    -}
    -
    -spine.Bone.yDown = true;
    -PIXI.AnimCache = {};
    -
    -/**
    - * A class that enables the you to import and run your spine animations in pixi.
    - * Spine animation data needs to be loaded using the PIXI.AssetLoader or PIXI.SpineLoader before it can be used by this class
    - * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source
    - *
    - * @class Spine
    - * @extends DisplayObjectContainer
    - * @constructor
    - * @param url {String} The url of the spine anim file to be used
    - */
    -PIXI.Spine = function (url) {
    -    PIXI.DisplayObjectContainer.call(this);
    -
    -    this.spineData = PIXI.AnimCache[url];
    -
    -    if (!this.spineData) {
    -        throw new Error("Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: " + url);
    -    }
    -
    -    this.skeleton = new spine.Skeleton(this.spineData);
    -    this.skeleton.updateWorldTransform();
    -
    -    this.stateData = new spine.AnimationStateData(this.spineData);
    -    this.state = new spine.AnimationState(this.stateData);
    -
    -    this.slotContainers = [];
    -
    -    for (var i = 0, n = this.skeleton.drawOrder.length; i < n; i++) {
    -        var slot = this.skeleton.drawOrder[i];
    -        var attachment = slot.attachment;
    -        var slotContainer = new PIXI.DisplayObjectContainer();
    -        this.slotContainers.push(slotContainer);
    -        this.addChild(slotContainer);
    -        if (!(attachment instanceof spine.RegionAttachment)) {
    -            continue;
    -        }
    -        var spriteName = attachment.rendererObject.name;
    -        var sprite = this.createSprite(slot, attachment.rendererObject);
    -        slot.currentSprite = sprite;
    -        slot.currentSpriteName = spriteName;
    -        slotContainer.addChild(sprite);
    -    }
    -};
    -
    -PIXI.Spine.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
    -PIXI.Spine.prototype.constructor = PIXI.Spine;
    -
    -/*
    - * Updates the object transform for rendering
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.Spine.prototype.updateTransform = function () {
    -    this.lastTime = this.lastTime || Date.now();
    -    var timeDelta = (Date.now() - this.lastTime) * 0.001;
    -    this.lastTime = Date.now();
    -    this.state.update(timeDelta);
    -    this.state.apply(this.skeleton);
    -    this.skeleton.updateWorldTransform();
    -
    -    var drawOrder = this.skeleton.drawOrder;
    -    for (var i = 0, n = drawOrder.length; i < n; i++) {
    -        var slot = drawOrder[i];
    -        var attachment = slot.attachment;
    -        var slotContainer = this.slotContainers[i];
    -        if (!(attachment instanceof spine.RegionAttachment)) {
    -            slotContainer.visible = false;
    -            continue;
    -        }
    -
    -        if (attachment.rendererObject) {
    -            if (!slot.currentSpriteName || slot.currentSpriteName != attachment.name) {
    -                var spriteName = attachment.rendererObject.name;
    -                if (slot.currentSprite !== undefined) {
    -                    slot.currentSprite.visible = false;
    -                }
    -                slot.sprites = slot.sprites || {};
    -                if (slot.sprites[spriteName] !== undefined) {
    -                    slot.sprites[spriteName].visible = true;
    -                } else {
    -                    var sprite = this.createSprite(slot, attachment.rendererObject);
    -                    slotContainer.addChild(sprite);
    -                }
    -                slot.currentSprite = slot.sprites[spriteName];
    -                slot.currentSpriteName = spriteName;
    -            }
    -        }
    -        slotContainer.visible = true;
    -
    -        var bone = slot.bone;
    -
    -        slotContainer.position.x = bone.worldX + attachment.x * bone.m00 + attachment.y * bone.m01;
    -        slotContainer.position.y = bone.worldY + attachment.x * bone.m10 + attachment.y * bone.m11;
    -        slotContainer.scale.x = bone.worldScaleX;
    -        slotContainer.scale.y = bone.worldScaleY;
    -
    -        slotContainer.rotation = -(slot.bone.worldRotation * Math.PI / 180);
    -
    -        slotContainer.alpha = slot.a;
    -        slot.currentSprite.tint = PIXI.rgb2hex([slot.r,slot.g,slot.b]);
    -    }
    -
    -    PIXI.DisplayObjectContainer.prototype.updateTransform.call(this);
    -};
    -
    -
    -PIXI.Spine.prototype.createSprite = function (slot, descriptor) {
    -    var name = PIXI.TextureCache[descriptor.name] ? descriptor.name : descriptor.name + ".png";
    -    var sprite = new PIXI.Sprite(PIXI.Texture.fromFrame(name));
    -    sprite.scale = descriptor.scale;
    -    sprite.rotation = descriptor.rotation;
    -    sprite.anchor.x = sprite.anchor.y = 0.5;
    -
    -    slot.sprites = slot.sprites || {};
    -    slot.sprites[descriptor.name] = sprite;
    -    return sprite;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_extras_Strip.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_extras_Strip.js.html deleted file mode 100755 index bb4a3f6..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_extras_Strip.js.html +++ /dev/null @@ -1,629 +0,0 @@ - - - - - src/pixi/extras/Strip.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/extras/Strip.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/
    - */
    -
    - /**
    - * 
    - * @class Strip
    - * @extends DisplayObjectContainer
    - * @constructor
    - * @param texture {Texture} The texture to use
    - * @param width {Number} the width 
    - * @param height {Number} the height
    - * 
    - */
    -PIXI.Strip = function(texture)
    -{
    -    PIXI.DisplayObjectContainer.call( this );
    -    
    -
    -    /**
    -     * The texture of the strip
    -     *
    -     * @property texture
    -     * @type Texture
    -     */
    -    this.texture = texture;
    -
    -    // set up the main bits..
    -    this.uvs = new PIXI.Float32Array([0, 1,
    -                                      1, 1,
    -                                      1, 0,
    -                                      0, 1]);
    -
    -    this.verticies = new PIXI.Float32Array([0, 0,
    -                                            100, 0,
    -                                            100, 100,
    -                                            0, 100]);
    -
    -    this.colors = new PIXI.Float32Array([1, 1, 1, 1]);
    -
    -    this.indices = new PIXI.Uint16Array([0, 1, 2, 3]);
    -    
    -    /**
    -     * Whether the strip is dirty or not
    -     *
    -     * @property dirty
    -     * @type Boolean
    -     */
    -    this.dirty = true;
    -
    -
    -    /**
    -     * if you need a padding, not yet implemented
    -     *
    -     * @property padding
    -     * @type Number
    -     */
    -    this.padding = 0;
    -     // NYI, TODO padding ?
    -
    -};
    -
    -// constructor
    -PIXI.Strip.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
    -PIXI.Strip.prototype.constructor = PIXI.Strip;
    -
    -PIXI.Strip.prototype._renderWebGL = function(renderSession)
    -{
    -    // if the sprite is not visible or the alpha is 0 then no need to render this element
    -    if(!this.visible || this.alpha <= 0)return;
    -    // render triangle strip..
    -
    -    renderSession.spriteBatch.stop();
    -
    -    // init! init!
    -    if(!this._vertexBuffer)this._initWebGL(renderSession);
    -    
    -    renderSession.shaderManager.setShader(renderSession.shaderManager.stripShader);
    -
    -    this._renderStrip(renderSession);
    -
    -    ///renderSession.shaderManager.activateDefaultShader();
    -
    -    renderSession.spriteBatch.start();
    -
    -    //TODO check culling  
    -};
    -
    -PIXI.Strip.prototype._initWebGL = function(renderSession)
    -{
    -    // build the strip!
    -    var gl = renderSession.gl;
    -    
    -    this._vertexBuffer = gl.createBuffer();
    -    this._indexBuffer = gl.createBuffer();
    -    this._uvBuffer = gl.createBuffer();
    -    this._colorBuffer = gl.createBuffer();
    -    
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.verticies, gl.DYNAMIC_DRAW);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER,  this.uvs, gl.STATIC_DRAW);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this._colorBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.colors, gl.STATIC_DRAW);
    - 
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);
    -    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    -};
    -
    -PIXI.Strip.prototype._renderStrip = function(renderSession)
    -{
    -    var gl = renderSession.gl;
    -    var projection = renderSession.projection,
    -        offset = renderSession.offset,
    -        shader = renderSession.shaderManager.stripShader;
    -
    -
    -    // gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mat4Real);
    -
    -    gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
    -
    -    // set uniforms
    -    gl.uniformMatrix3fv(shader.translationMatrix, false, this.worldTransform.toArray(true));
    -    gl.uniform2f(shader.projectionVector, projection.x, -projection.y);
    -    gl.uniform2f(shader.offsetVector, -offset.x, -offset.y);
    -    gl.uniform1f(shader.alpha, this.worldAlpha);
    -
    -    if(!this.dirty)
    -    {
    -        
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.verticies);
    -        gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0);
    -        
    -        // update the uvs
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer);
    -        gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0);
    -            
    -        gl.activeTexture(gl.TEXTURE0);
    -
    -        // check if a texture is dirty..
    -        if(this.texture.baseTexture._dirty[gl.id])
    -        {
    -            renderSession.renderer.updateTexture(this.texture.baseTexture);
    -        }
    -        else
    -        {
    -            // bind the current texture
    -            gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]);
    -        }
    -    
    -        // dont need to upload!
    -        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);
    -    
    -    
    -    }
    -    else
    -    {
    -
    -        this.dirty = false;
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);
    -        gl.bufferData(gl.ARRAY_BUFFER, this.verticies, gl.STATIC_DRAW);
    -        gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0);
    -        
    -        // update the uvs
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer);
    -        gl.bufferData(gl.ARRAY_BUFFER, this.uvs, gl.STATIC_DRAW);
    -        gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0);
    -            
    -        gl.activeTexture(gl.TEXTURE0);
    -
    -        // check if a texture is dirty..
    -        if(this.texture.baseTexture._dirty[gl.id])
    -        {
    -            renderSession.renderer.updateTexture(this.texture.baseTexture);
    -        }
    -        else
    -        {
    -            gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]);
    -        }
    -    
    -        // dont need to upload!
    -        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);
    -        gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    -        
    -    }
    -    //console.log(gl.TRIANGLE_STRIP)
    -    //
    -    //
    -    gl.drawElements(gl.TRIANGLE_STRIP, this.indices.length, gl.UNSIGNED_SHORT, 0);
    -    
    -  
    -};
    -
    -
    -
    -PIXI.Strip.prototype._renderCanvas = function(renderSession)
    -{
    -    var context = renderSession.context;
    -    
    -    var transform = this.worldTransform;
    -
    -    if (renderSession.roundPixels)
    -    {
    -        context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx | 0, transform.ty | 0);
    -    }
    -    else
    -    {
    -        context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);
    -    }
    -        
    -    var strip = this;
    -    // draw triangles!!
    -    var verticies = strip.verticies;
    -    var uvs = strip.uvs;
    -
    -    var length = verticies.length/2;
    -    this.count++;
    -
    -    for (var i = 0; i < length-2; i++)
    -    {
    -        // draw some triangles!
    -        var index = i*2;
    -
    -        var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    -        var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    -
    -        if(this.padding > 0)
    -        {
    -            var centerX = (x0 + x1 + x2)/3;
    -            var centerY = (y0 + y1 + y2)/3;
    -
    -            var normX = x0 - centerX;
    -            var normY = y0 - centerY;
    -
    -            var dist = Math.sqrt( normX * normX + normY * normY );
    -            x0 = centerX + (normX / dist) * (dist + 3);
    -            y0 = centerY + (normY / dist) * (dist + 3);
    -
    -            // 
    -            
    -            normX = x1 - centerX;
    -            normY = y1 - centerY;
    -
    -            dist = Math.sqrt( normX * normX + normY * normY );
    -            x1 = centerX + (normX / dist) * (dist + 3);
    -            y1 = centerY + (normY / dist) * (dist + 3);
    -
    -            normX = x2 - centerX;
    -            normY = y2 - centerY;
    -
    -            dist = Math.sqrt( normX * normX + normY * normY );
    -            x2 = centerX + (normX / dist) * (dist + 3);
    -            y2 = centerY + (normY / dist) * (dist + 3);
    -        }
    -
    -        var u0 = uvs[index] * strip.texture.width,   u1 = uvs[index+2] * strip.texture.width, u2 = uvs[index+4]* strip.texture.width;
    -        var v0 = uvs[index+1]* strip.texture.height, v1 = uvs[index+3] * strip.texture.height, v2 = uvs[index+5]* strip.texture.height;
    -
    -        context.save();
    -        context.beginPath();
    -
    -
    -        context.moveTo(x0, y0);
    -        context.lineTo(x1, y1);
    -        context.lineTo(x2, y2);
    -
    -        context.closePath();
    -
    -        context.clip();
    -
    -        // Compute matrix transform
    -        var delta = u0*v1 + v0*u2 + u1*v2 - v1*u2 - v0*u1 - u0*v2;
    -        var deltaA = x0*v1 + v0*x2 + x1*v2 - v1*x2 - v0*x1 - x0*v2;
    -        var deltaB = u0*x1 + x0*u2 + u1*x2 - x1*u2 - x0*u1 - u0*x2;
    -        var deltaC = u0*v1*x2 + v0*x1*u2 + x0*u1*v2 - x0*v1*u2 - v0*u1*x2 - u0*x1*v2;
    -        var deltaD = y0*v1 + v0*y2 + y1*v2 - v1*y2 - v0*y1 - y0*v2;
    -        var deltaE = u0*y1 + y0*u2 + u1*y2 - y1*u2 - y0*u1 - u0*y2;
    -        var deltaF = u0*v1*y2 + v0*y1*u2 + y0*u1*v2 - y0*v1*u2 - v0*u1*y2 - u0*y1*v2;
    -
    -        context.transform(deltaA / delta, deltaD / delta,
    -                            deltaB / delta, deltaE / delta,
    -                            deltaC / delta, deltaF / delta);
    -
    -        context.drawImage(strip.texture.baseTexture.source, 0, 0);
    -        context.restore();
    -    }
    -};
    -
    -
    -/**
    - * Renders a flat strip
    - *
    - * @method renderStripFlat
    - * @param strip {Strip} The Strip to render
    - * @private
    - */
    -PIXI.Strip.prototype.renderStripFlat = function(strip)
    -{
    -    var context = this.context;
    -    var verticies = strip.verticies;
    -
    -    var length = verticies.length/2;
    -    this.count++;
    -
    -    context.beginPath();
    -    for (var i=1; i < length-2; i++)
    -    {
    -        // draw some triangles!
    -        var index = i*2;
    -
    -        var x0 = verticies[index],   x1 = verticies[index+2], x2 = verticies[index+4];
    -        var y0 = verticies[index+1], y1 = verticies[index+3], y2 = verticies[index+5];
    -
    -        context.moveTo(x0, y0);
    -        context.lineTo(x1, y1);
    -        context.lineTo(x2, y2);
    -    }
    -
    -    context.fillStyle = "#FF0000";
    -    context.fill();
    -    context.closePath();
    -};
    -
    -/*
    -PIXI.Strip.prototype.setTexture = function(texture)
    -{
    -    //TODO SET THE TEXTURES
    -    //TODO VISIBILITY
    -
    -    // stop current texture
    -    this.texture = texture;
    -    this.width   = texture.frame.width;
    -    this.height  = texture.frame.height;
    -    this.updateFrame = true;
    -};
    -*/
    -
    -/**
    - * When the texture is updated, this event will fire to update the scale and frame
    - *
    - * @method onTextureUpdate
    - * @param event
    - * @private
    - */
    -
    -PIXI.Strip.prototype.onTextureUpdate = function()
    -{
    -    this.updateFrame = true;
    -};
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_extras_TilingSprite.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_extras_TilingSprite.js.html deleted file mode 100755 index d95a188..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_extras_TilingSprite.js.html +++ /dev/null @@ -1,743 +0,0 @@ - - - - - src/pixi/extras/TilingSprite.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/extras/TilingSprite.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/
    - */
    -
    -/**
    - * A tiling sprite is a fast way of rendering a tiling image
    - *
    - * @class TilingSprite
    - * @extends Sprite
    - * @constructor
    - * @param texture {Texture} the texture of the tiling sprite
    - * @param width {Number}  the width of the tiling sprite
    - * @param height {Number} the height of the tiling sprite
    - */
    -PIXI.TilingSprite = function(texture, width, height)
    -{
    -    PIXI.Sprite.call( this, texture);
    -
    -    /**
    -     * The with of the tiling sprite
    -     *
    -     * @property width
    -     * @type Number
    -     */
    -    this._width = width || 100;
    -
    -    /**
    -     * The height of the tiling sprite
    -     *
    -     * @property height
    -     * @type Number
    -     */
    -    this._height = height || 100;
    -
    -    /**
    -     * The scaling of the image that is being tiled
    -     *
    -     * @property tileScale
    -     * @type Point
    -     */
    -    this.tileScale = new PIXI.Point(1,1);
    -
    -    /**
    -     * A point that represents the scale of the texture object
    -     *
    -     * @property tileScaleOffset
    -     * @type Point
    -     */
    -    this.tileScaleOffset = new PIXI.Point(1,1);
    -    
    -    /**
    -     * The offset position of the image that is being tiled
    -     *
    -     * @property tilePosition
    -     * @type Point
    -     */
    -    this.tilePosition = new PIXI.Point(0,0);
    -
    -    /**
    -     * Whether this sprite is renderable or not
    -     *
    -     * @property renderable
    -     * @type Boolean
    -     * @default true
    -     */
    -    this.renderable = true;
    -
    -    /**
    -     * The tint applied to the sprite. This is a hex value
    -     *
    -     * @property tint
    -     * @type Number
    -     * @default 0xFFFFFF
    -     */
    -    this.tint = 0xFFFFFF;
    -    
    -    /**
    -     * The blend mode to be applied to the sprite
    -     *
    -     * @property blendMode
    -     * @type Number
    -     * @default PIXI.blendModes.NORMAL;
    -     */
    -    this.blendMode = PIXI.blendModes.NORMAL;
    -
    -    
    -
    -};
    -
    -// constructor
    -PIXI.TilingSprite.prototype = Object.create(PIXI.Sprite.prototype);
    -PIXI.TilingSprite.prototype.constructor = PIXI.TilingSprite;
    -
    -
    -/**
    - * The width of the sprite, setting this will actually modify the scale to achieve the value set
    - *
    - * @property width
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TilingSprite.prototype, 'width', {
    -    get: function() {
    -        return this._width;
    -    },
    -    set: function(value) {
    -        
    -        this._width = value;
    -    }
    -});
    -
    -/**
    - * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set
    - *
    - * @property height
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TilingSprite.prototype, 'height', {
    -    get: function() {
    -        return  this._height;
    -    },
    -    set: function(value) {
    -        this._height = value;
    -    }
    -});
    -
    -PIXI.TilingSprite.prototype.setTexture = function(texture)
    -{
    -    if (this.texture === texture) return;
    -
    -    this.texture = texture;
    -
    -    this.refreshTexture = true;
    -
    -    this.cachedTint = 0xFFFFFF;
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.TilingSprite.prototype._renderWebGL = function(renderSession)
    -{
    -    if (this.visible === false || this.alpha === 0) return;
    -    var i,j;
    -
    -    if (this._mask)
    -    {
    -        renderSession.spriteBatch.stop();
    -        renderSession.maskManager.pushMask(this.mask, renderSession);
    -        renderSession.spriteBatch.start();
    -    }
    -
    -    if (this._filters)
    -    {
    -        renderSession.spriteBatch.flush();
    -        renderSession.filterManager.pushFilter(this._filterBlock);
    -    }
    -
    -   
    -
    -    if (!this.tilingTexture || this.refreshTexture)
    -    {
    -        this.generateTilingTexture(true);
    -
    -        if (this.tilingTexture && this.tilingTexture.needsUpdate)
    -        {
    -            //TODO - tweaking
    -            PIXI.updateWebGLTexture(this.tilingTexture.baseTexture, renderSession.gl);
    -            this.tilingTexture.needsUpdate = false;
    -           // this.tilingTexture._uvs = null;
    -        }
    -    }
    -    else
    -    {
    -        renderSession.spriteBatch.renderTilingSprite(this);
    -    }
    -    // simple render children!
    -    for (i=0,j=this.children.length; i<j; i++)
    -    {
    -        this.children[i]._renderWebGL(renderSession);
    -    }
    -
    -    renderSession.spriteBatch.stop();
    -
    -    if (this._filters) renderSession.filterManager.popFilter();
    -    if (this._mask) renderSession.maskManager.popMask(this._mask, renderSession);
    -    
    -    renderSession.spriteBatch.start();
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.TilingSprite.prototype._renderCanvas = function(renderSession)
    -{
    -    if (this.visible === false || this.alpha === 0)return;
    -    
    -    var context = renderSession.context;
    -
    -    if (this._mask)
    -    {
    -        renderSession.maskManager.pushMask(this._mask, context);
    -    }
    -
    -    context.globalAlpha = this.worldAlpha;
    -    
    -    var transform = this.worldTransform;
    -
    -    var i,j;
    -
    -    var resolution = renderSession.resolution;
    -
    -    context.setTransform(transform.a * resolution,
    -                         transform.c * resolution,
    -                         transform.b * resolution,
    -                         transform.d * resolution,
    -                         transform.tx * resolution,
    -                         transform.ty * resolution);
    -
    -    if (!this.__tilePattern ||  this.refreshTexture)
    -    {
    -        this.generateTilingTexture(false);
    -    
    -        if (this.tilingTexture)
    -        {
    -            this.__tilePattern = context.createPattern(this.tilingTexture.baseTexture.source, 'repeat');
    -        }
    -        else
    -        {
    -            return;
    -        }
    -    }
    -
    -    // check blend mode
    -    if (this.blendMode !== renderSession.currentBlendMode)
    -    {
    -        renderSession.currentBlendMode = this.blendMode;
    -        context.globalCompositeOperation = PIXI.blendModesCanvas[renderSession.currentBlendMode];
    -    }
    -
    -    var tilePosition = this.tilePosition;
    -    var tileScale = this.tileScale;
    -
    -    tilePosition.x %= this.tilingTexture.baseTexture.width;
    -    tilePosition.y %= this.tilingTexture.baseTexture.height;
    -
    -    // offset - make sure to account for the anchor point..
    -    context.scale(tileScale.x,tileScale.y);
    -    context.translate(tilePosition.x + (this.anchor.x * -this._width), tilePosition.y + (this.anchor.y * -this._height));
    -
    -    context.fillStyle = this.__tilePattern;
    -
    -    context.fillRect(-tilePosition.x,
    -                    -tilePosition.y,
    -                    this._width / tileScale.x,
    -                    this._height / tileScale.y);
    -
    -    context.scale(1 / tileScale.x, 1 / tileScale.y);
    -    context.translate(-tilePosition.x + (this.anchor.x * this._width), -tilePosition.y + (this.anchor.y * this._height));
    -
    -    if (this._mask)
    -    {
    -        renderSession.maskManager.popMask(renderSession.context);
    -    }
    -
    -    for (i=0,j=this.children.length; i<j; i++)
    -    {
    -        this.children[i]._renderCanvas(renderSession);
    -    }
    -};
    -
    -
    -/**
    -* Returns the framing rectangle of the sprite as a PIXI.Rectangle object
    -*
    -* @method getBounds
    -* @return {Rectangle} the framing rectangle
    -*/
    -PIXI.TilingSprite.prototype.getBounds = function()
    -{
    -    var width = this._width;
    -    var height = this._height;
    -
    -    var w0 = width * (1-this.anchor.x);
    -    var w1 = width * -this.anchor.x;
    -
    -    var h0 = height * (1-this.anchor.y);
    -    var h1 = height * -this.anchor.y;
    -
    -    var worldTransform = this.worldTransform;
    -
    -    var a = worldTransform.a;
    -    var b = worldTransform.b;
    -    var c = worldTransform.c;
    -    var d = worldTransform.d;
    -    var tx = worldTransform.tx;
    -    var ty = worldTransform.ty;
    -    
    -    var x1 = a * w1 + c * h1 + tx;
    -    var y1 = d * h1 + b * w1 + ty;
    -
    -    var x2 = a * w0 + c * h1 + tx;
    -    var y2 = d * h1 + b * w0 + ty;
    -
    -    var x3 = a * w0 + c * h0 + tx;
    -    var y3 = d * h0 + b * w0 + ty;
    -
    -    var x4 =  a * w1 + c * h0 + tx;
    -    var y4 =  d * h0 + b * w1 + ty;
    -
    -    var maxX = -Infinity;
    -    var maxY = -Infinity;
    -
    -    var minX = Infinity;
    -    var minY = Infinity;
    -
    -    minX = x1 < minX ? x1 : minX;
    -    minX = x2 < minX ? x2 : minX;
    -    minX = x3 < minX ? x3 : minX;
    -    minX = x4 < minX ? x4 : minX;
    -
    -    minY = y1 < minY ? y1 : minY;
    -    minY = y2 < minY ? y2 : minY;
    -    minY = y3 < minY ? y3 : minY;
    -    minY = y4 < minY ? y4 : minY;
    -
    -    maxX = x1 > maxX ? x1 : maxX;
    -    maxX = x2 > maxX ? x2 : maxX;
    -    maxX = x3 > maxX ? x3 : maxX;
    -    maxX = x4 > maxX ? x4 : maxX;
    -
    -    maxY = y1 > maxY ? y1 : maxY;
    -    maxY = y2 > maxY ? y2 : maxY;
    -    maxY = y3 > maxY ? y3 : maxY;
    -    maxY = y4 > maxY ? y4 : maxY;
    -
    -    var bounds = this._bounds;
    -
    -    bounds.x = minX;
    -    bounds.width = maxX - minX;
    -
    -    bounds.y = minY;
    -    bounds.height = maxY - minY;
    -
    -    // store a reference so that if this function gets called again in the render cycle we do not have to recalculate
    -    this._currentBounds = bounds;
    -
    -    return bounds;
    -};
    -
    -
    -
    -/**
    - * When the texture is updated, this event will fire to update the scale and frame
    - *
    - * @method onTextureUpdate
    - * @param event
    - * @private
    - */
    -PIXI.TilingSprite.prototype.onTextureUpdate = function()
    -{
    -   // overriding the sprite version of this!
    -};
    -
    -
    -/**
    -* 
    -* @method generateTilingTexture
    -* 
    -* @param forcePowerOfTwo {Boolean} Whether we want to force the texture to be a power of two
    -*/
    -PIXI.TilingSprite.prototype.generateTilingTexture = function(forcePowerOfTwo)
    -{
    -    if (!this.texture.baseTexture.hasLoaded) return;
    -
    -    var texture = this.originalTexture || this.texture;
    -    var frame = texture.frame;
    -    var targetWidth, targetHeight;
    -
    -    //  Check that the frame is the same size as the base texture.
    -    var isFrame = frame.width !== texture.baseTexture.width || frame.height !== texture.baseTexture.height;
    -
    -    var newTextureRequired = false;
    -
    -    if (!forcePowerOfTwo)
    -    {
    -        if (isFrame)
    -        {
    -            targetWidth = frame.width;
    -            targetHeight = frame.height;
    -           
    -            newTextureRequired = true;
    -        }
    -    }
    -    else
    -    {
    -        targetWidth = PIXI.getNextPowerOfTwo(frame.width);
    -        targetHeight = PIXI.getNextPowerOfTwo(frame.height);
    -
    -        if (frame.width !== targetWidth || frame.height !== targetHeight) newTextureRequired = true;
    -    }
    -
    -    if (newTextureRequired)
    -    {
    -        var canvasBuffer;
    -
    -        if (this.tilingTexture && this.tilingTexture.isTiling)
    -        {
    -            canvasBuffer = this.tilingTexture.canvasBuffer;
    -            canvasBuffer.resize(targetWidth, targetHeight);
    -            this.tilingTexture.baseTexture.width = targetWidth;
    -            this.tilingTexture.baseTexture.height = targetHeight;
    -            this.tilingTexture.needsUpdate = true;
    -        }
    -        else
    -        {
    -            canvasBuffer = new PIXI.CanvasBuffer(targetWidth, targetHeight);
    -
    -            this.tilingTexture = PIXI.Texture.fromCanvas(canvasBuffer.canvas);
    -            this.tilingTexture.canvasBuffer = canvasBuffer;
    -            this.tilingTexture.isTiling = true;
    -        }
    -
    -        canvasBuffer.context.drawImage(texture.baseTexture.source,
    -                               texture.crop.x,
    -                               texture.crop.y,
    -                               texture.crop.width,
    -                               texture.crop.height,
    -                               0,
    -                               0,
    -                               targetWidth,
    -                               targetHeight);
    -
    -        this.tileScaleOffset.x = frame.width / targetWidth;
    -        this.tileScaleOffset.y = frame.height / targetHeight;
    -    }
    -    else
    -    {
    -        //  TODO - switching?
    -        if (this.tilingTexture && this.tilingTexture.isTiling)
    -        {
    -            // destroy the tiling texture!
    -            // TODO could store this somewhere?
    -            this.tilingTexture.destroy(true);
    -        }
    -
    -        this.tileScaleOffset.x = 1;
    -        this.tileScaleOffset.y = 1;
    -        this.tilingTexture = texture;
    -    }
    -
    -    this.refreshTexture = false;
    -    
    -    this.originalTexture = this.texture;
    -    this.texture = this.tilingTexture;
    -    
    -    this.tilingTexture.baseTexture._powerOf2 = true;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_AbstractFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_AbstractFilter.js.html deleted file mode 100755 index d4ac332..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_AbstractFilter.js.html +++ /dev/null @@ -1,355 +0,0 @@ - - - - - src/pixi/filters/AbstractFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/AbstractFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This is the base class for creating a PIXI filter. Currently only webGL supports filters.
    - * If you want to make a custom filter this should be your base class.
    - * @class AbstractFilter
    - * @constructor
    - * @param fragmentSrc {Array} The fragment source in an array of strings.
    - * @param uniforms {Object} An object containing the uniforms for this filter.
    - */
    -PIXI.AbstractFilter = function(fragmentSrc, uniforms)
    -{
    -    /**
    -    * An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion.
    -    * For example the blur filter has two passes blurX and blurY.
    -    * @property passes
    -    * @type Array an array of filter objects
    -    * @private
    -    */
    -    this.passes = [this];
    -
    -    /**
    -    * @property shaders
    -    * @type Array an array of shaders
    -    * @private
    -    */
    -    this.shaders = [];
    -    
    -    /**
    -    * @property dirty
    -    * @type Boolean
    -    */
    -    this.dirty = true;
    -
    -    /**
    -    * @property padding
    -    * @type Number
    -    */
    -    this.padding = 0;
    -
    -    /**
    -    * @property uniforms
    -    * @type object
    -    * @private
    -    */
    -    this.uniforms = uniforms || {};
    -
    -    /**
    -    * @property fragmentSrc
    -    * @type Array
    -    * @private
    -    */
    -    this.fragmentSrc = fragmentSrc || [];
    -};
    -
    -PIXI.AbstractFilter.prototype.constructor = PIXI.AbstractFilter;
    -
    -/**
    - * Syncs the uniforms between the class object and the shaders.
    - *
    - * @method syncUniforms
    - */
    -PIXI.AbstractFilter.prototype.syncUniforms = function()
    -{
    -    for(var i=0,j=this.shaders.length; i<j; i++)
    -    {
    -        this.shaders[i].dirty = true;
    -    }
    -};
    -
    -/*
    -PIXI.AbstractFilter.prototype.apply = function(frameBuffer)
    -{
    -    // TODO :)
    -};
    -*/
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_AlphaMaskFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_AlphaMaskFilter.js.html deleted file mode 100755 index e332a02..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_AlphaMaskFilter.js.html +++ /dev/null @@ -1,375 +0,0 @@ - - - - - src/pixi/filters/AlphaMaskFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/AlphaMaskFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The AlphaMaskFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object.
    - * You can use this filter to apply all manor of crazy warping effects
    - * Currently the r property of the texture is used to offset the x and the g property of the texture is used to offset the y.
    - * 
    - * @class AlphaMaskFilter
    - * @extends AbstractFilter
    - * @constructor
    - * @param texture {Texture} The texture used for the displacement map * must be power of 2 texture at the moment
    - */
    -PIXI.AlphaMaskFilter = function(texture)
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -    texture.baseTexture._powerOf2 = true;
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        mask: {type: 'sampler2D', value:texture},
    -        mapDimensions:   {type: '2f', value:{x:1, y:5112}},
    -        dimensions:   {type: '4fv', value:[0,0,0,0]}
    -    };
    -
    -    if(texture.baseTexture.hasLoaded)
    -    {
    -        this.uniforms.mask.value.x = texture.width;
    -        this.uniforms.mask.value.y = texture.height;
    -    }
    -    else
    -    {
    -        this.boundLoadedFunction = this.onTextureLoaded.bind(this);
    -
    -        texture.baseTexture.on('loaded', this.boundLoadedFunction);
    -    }
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D mask;',
    -        'uniform sampler2D uSampler;',
    -        'uniform vec2 offset;',
    -        'uniform vec4 dimensions;',
    -        'uniform vec2 mapDimensions;',
    -
    -        'void main(void) {',
    -        '   vec2 mapCords = vTextureCoord.xy;',
    -        '   mapCords += (dimensions.zw + offset)/ dimensions.xy ;',
    -        '   mapCords.y *= -1.0;',
    -        '   mapCords.y += 1.0;',
    -        '   mapCords *= dimensions.xy / mapDimensions;',
    -
    -        '   vec4 original =  texture2D(uSampler, vTextureCoord);',
    -        '   float maskAlpha =  texture2D(mask, mapCords).r;',
    -        '   original *= maskAlpha;',
    -        //'   original.rgb *= maskAlpha;',
    -        '   gl_FragColor =  original;',
    -        //'   gl_FragColor = gl_FragColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.AlphaMaskFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.AlphaMaskFilter.prototype.constructor = PIXI.AlphaMaskFilter;
    -
    -/**
    - * Sets the map dimensions uniforms when the texture becomes available.
    - *
    - * @method onTextureLoaded
    - */
    -PIXI.AlphaMaskFilter.prototype.onTextureLoaded = function()
    -{
    -    this.uniforms.mapDimensions.value.x = this.uniforms.mask.value.width;
    -    this.uniforms.mapDimensions.value.y = this.uniforms.mask.value.height;
    -
    -    this.uniforms.mask.value.baseTexture.off('loaded', this.boundLoadedFunction);
    -};
    -
    -/**
    - * The texture used for the displacement map. Must be power of 2 sized texture.
    - *
    - * @property map
    - * @type Texture
    - */
    -Object.defineProperty(PIXI.AlphaMaskFilter.prototype, 'map', {
    -    get: function() {
    -        return this.uniforms.mask.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.mask.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_AsciiFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_AsciiFilter.js.html deleted file mode 100755 index fecc5d2..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_AsciiFilter.js.html +++ /dev/null @@ -1,364 +0,0 @@ - - - - - src/pixi/filters/AsciiFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/AsciiFilter.js

    - -
    -
    -/**
    - * @author Vico @vicocotea
    - * original shader : https://www.shadertoy.com/view/lssGDj by @movAX13h
    - */
    -
    -/**
    - * An ASCII filter.
    - * 
    - * @class AsciiFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.AsciiFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        dimensions: {type: '4fv', value:new PIXI.Float32Array([10000, 100, 10, 10])},
    -        pixelSize: {type: '1f', value:8}
    -    };
    -
    -    this.fragmentSrc = [
    -        
    -        'precision mediump float;',
    -        'uniform vec4 dimensions;',
    -        'uniform float pixelSize;',
    -        'uniform sampler2D uSampler;',
    -
    -        'float character(float n, vec2 p)',
    -        '{',
    -        '    p = floor(p*vec2(4.0, -4.0) + 2.5);',
    -        '    if (clamp(p.x, 0.0, 4.0) == p.x && clamp(p.y, 0.0, 4.0) == p.y)',
    -        '    {',
    -        '        if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0;',
    -        '    }',
    -        '    return 0.0;',
    -        '}',
    -
    -        'void main()',
    -        '{',
    -        '    vec2 uv = gl_FragCoord.xy;',
    -        '    vec3 col = texture2D(uSampler, floor( uv / pixelSize ) * pixelSize / dimensions.xy).rgb;',
    -            
    -        '    #ifdef HAS_GREENSCREEN',
    -        '    float gray = (col.r + col.b)/2.0;', 
    -        '    #else',
    -        '    float gray = (col.r + col.g + col.b)/3.0;',
    -        '    #endif',
    -  
    -        '    float n =  65536.0;             // .',
    -        '    if (gray > 0.2) n = 65600.0;    // :',
    -        '    if (gray > 0.3) n = 332772.0;   // *',
    -        '    if (gray > 0.4) n = 15255086.0; // o',
    -        '    if (gray > 0.5) n = 23385164.0; // &',
    -        '    if (gray > 0.6) n = 15252014.0; // 8',
    -        '    if (gray > 0.7) n = 13199452.0; // @',
    -        '    if (gray > 0.8) n = 11512810.0; // #',
    -            
    -        '    vec2 p = mod( uv / ( pixelSize * 0.5 ), 2.0) - vec2(1.0);',
    -        '    col = col * character(n, p);',
    -            
    -        '    gl_FragColor = vec4(col, 1.0);',
    -        '}'
    -    ];
    -};
    -
    -PIXI.AsciiFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.AsciiFilter.prototype.constructor = PIXI.AsciiFilter;
    -
    -/**
    - * The pixel size used by the filter.
    - *
    - * @property size
    - * @type Number
    - */
    -Object.defineProperty(PIXI.AsciiFilter.prototype, 'size', {
    -    get: function() {
    -        return this.uniforms.pixelSize.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.pixelSize.value = value;
    -    }
    -});
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_BlurFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_BlurFilter.js.html deleted file mode 100755 index f7c0d25..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_BlurFilter.js.html +++ /dev/null @@ -1,348 +0,0 @@ - - - - - src/pixi/filters/BlurFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/BlurFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The BlurFilter applies a Gaussian blur to an object.
    - * The strength of the blur can be set for x- and y-axis separately (always relative to the stage).
    - *
    - * @class BlurFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.BlurFilter = function()
    -{
    -    this.blurXFilter = new PIXI.BlurXFilter();
    -    this.blurYFilter = new PIXI.BlurYFilter();
    -
    -    this.passes =[this.blurXFilter, this.blurYFilter];
    -};
    -
    -PIXI.BlurFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.BlurFilter.prototype.constructor = PIXI.BlurFilter;
    -
    -/**
    - * Sets the strength of both the blurX and blurY properties simultaneously
    - *
    - * @property blur
    - * @type Number the strength of the blur
    - * @default 2
    - */
    -Object.defineProperty(PIXI.BlurFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.blurXFilter.blur;
    -    },
    -    set: function(value) {
    -        this.blurXFilter.blur = this.blurYFilter.blur = value;
    -    }
    -});
    -
    -/**
    - * Sets the strength of the blurX property
    - *
    - * @property blurX
    - * @type Number the strength of the blurX
    - * @default 2
    - */
    -Object.defineProperty(PIXI.BlurFilter.prototype, 'blurX', {
    -    get: function() {
    -        return this.blurXFilter.blur;
    -    },
    -    set: function(value) {
    -        this.blurXFilter.blur = value;
    -    }
    -});
    -
    -/**
    - * Sets the strength of the blurY property
    - *
    - * @property blurY
    - * @type Number the strength of the blurY
    - * @default 2
    - */
    -Object.defineProperty(PIXI.BlurFilter.prototype, 'blurY', {
    -    get: function() {
    -        return this.blurYFilter.blur;
    -    },
    -    set: function(value) {
    -        this.blurYFilter.blur = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_BlurXFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_BlurXFilter.js.html deleted file mode 100755 index 622c2f6..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_BlurXFilter.js.html +++ /dev/null @@ -1,345 +0,0 @@ - - - - - src/pixi/filters/BlurXFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/BlurXFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The BlurXFilter applies a horizontal Gaussian blur to an object.
    - *
    - * @class BlurXFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.BlurXFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 1/512}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float blur;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   vec4 sum = vec4(0.0);',
    -
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x - 4.0*blur, vTextureCoord.y)) * 0.05;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x - 3.0*blur, vTextureCoord.y)) * 0.09;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x - 2.0*blur, vTextureCoord.y)) * 0.12;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x - blur, vTextureCoord.y)) * 0.15;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x + blur, vTextureCoord.y)) * 0.15;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x + 2.0*blur, vTextureCoord.y)) * 0.12;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x + 3.0*blur, vTextureCoord.y)) * 0.09;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x + 4.0*blur, vTextureCoord.y)) * 0.05;',
    -
    -        '   gl_FragColor = sum;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.BlurXFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.BlurXFilter.prototype.constructor = PIXI.BlurXFilter;
    -
    -/**
    - * Sets the strength of both the blur.
    - *
    - * @property blur
    - * @type Number the strength of the blur
    - * @default 2
    - */
    -Object.defineProperty(PIXI.BlurXFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value / (1/7000);
    -    },
    -    set: function(value) {
    -
    -        this.dirty = true;
    -        this.uniforms.blur.value = (1/7000) * value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_BlurYFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_BlurYFilter.js.html deleted file mode 100755 index a6c7290..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_BlurYFilter.js.html +++ /dev/null @@ -1,344 +0,0 @@ - - - - - src/pixi/filters/BlurYFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/BlurYFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The BlurYFilter applies a vertical Gaussian blur to an object.
    - *
    - * @class BlurYFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.BlurYFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 1/512}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float blur;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   vec4 sum = vec4(0.0);',
    -
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 4.0*blur)) * 0.05;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 3.0*blur)) * 0.09;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 2.0*blur)) * 0.12;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - blur)) * 0.15;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + blur)) * 0.15;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 2.0*blur)) * 0.12;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 3.0*blur)) * 0.09;',
    -        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 4.0*blur)) * 0.05;',
    -
    -        '   gl_FragColor = sum;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.BlurYFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.BlurYFilter.prototype.constructor = PIXI.BlurYFilter;
    -
    -/**
    - * Sets the strength of both the blur.
    - *
    - * @property blur
    - * @type Number the strength of the blur
    - * @default 2
    - */
    -Object.defineProperty(PIXI.BlurYFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value / (1/7000);
    -    },
    -    set: function(value) {
    -        //this.padding = value;
    -        this.uniforms.blur.value = (1/7000) * value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_ColorMatrixFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_ColorMatrixFilter.js.html deleted file mode 100755 index 86702fe..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_ColorMatrixFilter.js.html +++ /dev/null @@ -1,337 +0,0 @@ - - - - - src/pixi/filters/ColorMatrixFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/ColorMatrixFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The ColorMatrixFilter class lets you apply a 4x4 matrix transformation on the RGBA
    - * color and alpha values of every pixel on your displayObject to produce a result
    - * with a new set of RGBA color and alpha values. It's pretty powerful!
    - * 
    - * @class ColorMatrixFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.ColorMatrixFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        matrix: {type: 'mat4', value: [1,0,0,0,
    -                                       0,1,0,0,
    -                                       0,0,1,0,
    -                                       0,0,0,1]}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float invert;',
    -        'uniform mat4 matrix;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord) * matrix;',
    -      //  '   gl_FragColor = gl_FragColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.ColorMatrixFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.ColorMatrixFilter.prototype.constructor = PIXI.ColorMatrixFilter;
    -
    -/**
    - * Sets the matrix of the color matrix filter
    - *
    - * @property matrix
    - * @type Array and array of 26 numbers
    - * @default [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]
    - */
    -Object.defineProperty(PIXI.ColorMatrixFilter.prototype, 'matrix', {
    -    get: function() {
    -        return this.uniforms.matrix.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.matrix.value = value;
    -    }
    -});
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_ColorStepFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_ColorStepFilter.js.html deleted file mode 100755 index eb21f70..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_ColorStepFilter.js.html +++ /dev/null @@ -1,332 +0,0 @@ - - - - - src/pixi/filters/ColorStepFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/ColorStepFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This lowers the color depth of your image by the given amount, producing an image with a smaller palette.
    - * 
    - * @class ColorStepFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.ColorStepFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        step: {type: '1f', value: 5}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D uSampler;',
    -        'uniform float step;',
    -
    -        'void main(void) {',
    -        '   vec4 color = texture2D(uSampler, vTextureCoord);',
    -        '   color = floor(color * step) / step;',
    -        '   gl_FragColor = color;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.ColorStepFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.ColorStepFilter.prototype.constructor = PIXI.ColorStepFilter;
    -
    -/**
    - * The number of steps to reduce the palette by.
    - *
    - * @property step
    - * @type Number
    - */
    -Object.defineProperty(PIXI.ColorStepFilter.prototype, 'step', {
    -    get: function() {
    -        return this.uniforms.step.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.step.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_ConvolutionFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_ConvolutionFilter.js.html deleted file mode 100755 index e6acdc3..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_ConvolutionFilter.js.html +++ /dev/null @@ -1,384 +0,0 @@ - - - - - src/pixi/filters/ConvolutionFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/ConvolutionFilter.js

    - -
    -
    -/**
    - * The ConvolutionFilter class applies a matrix convolution filter effect. 
    - * A convolution combines pixels in the input image with neighboring pixels to produce a new image. 
    - * A wide variety of image effects can be achieved through convolutions, including blurring, edge detection, sharpening, embossing, and beveling.
    - * The matrix should be specified as a 9 point Array. See http://docs.gimp.org/en/plug-in-convmatrix.html for more info.
    - * 
    - * @class ConvolutionFilter
    - * @extends AbstractFilter
    - * @constructor
    - * @param matrix {Array} An array of values used for matrix transformation. Specified as a 9 point Array.
    - * @param width {Number} Width of the object you are transforming
    - * @param height {Number} Height of the object you are transforming
    - */
    -PIXI.ConvolutionFilter = function(matrix, width, height)
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        m : {type: '1fv', value: new PIXI.Float32Array(matrix)},
    -        texelSizeX: {type: '1f', value: 1 / width},
    -        texelSizeY: {type: '1f', value: 1 / height}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying mediump vec2 vTextureCoord;',
    -        'uniform sampler2D texture;',
    -        'uniform float texelSizeX;',
    -        'uniform float texelSizeY;',
    -        'uniform float m[9];',
    -
    -        'vec2 px = vec2(texelSizeX, texelSizeY);',
    -
    -        'void main(void) {',
    -            'vec4 c11 = texture2D(texture, vTextureCoord - px);', // top left
    -            'vec4 c12 = texture2D(texture, vec2(vTextureCoord.x, vTextureCoord.y - px.y));', // top center
    -            'vec4 c13 = texture2D(texture, vec2(vTextureCoord.x + px.x, vTextureCoord.y - px.y));', // top right
    -
    -            'vec4 c21 = texture2D(texture, vec2(vTextureCoord.x - px.x, vTextureCoord.y) );', // mid left
    -            'vec4 c22 = texture2D(texture, vTextureCoord);', // mid center
    -            'vec4 c23 = texture2D(texture, vec2(vTextureCoord.x + px.x, vTextureCoord.y) );', // mid right
    -
    -            'vec4 c31 = texture2D(texture, vec2(vTextureCoord.x - px.x, vTextureCoord.y + px.y) );', // bottom left
    -            'vec4 c32 = texture2D(texture, vec2(vTextureCoord.x, vTextureCoord.y + px.y) );', // bottom center
    -            'vec4 c33 = texture2D(texture, vTextureCoord + px );', // bottom right
    -
    -            'gl_FragColor = ',
    -            'c11 * m[0] + c12 * m[1] + c22 * m[2] +',
    -            'c21 * m[3] + c22 * m[4] + c23 * m[5] +',
    -            'c31 * m[6] + c32 * m[7] + c33 * m[8];',
    -            'gl_FragColor.a = c22.a;',
    -        '}'
    -    ];
    -
    -};
    -
    -PIXI.ConvolutionFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.ConvolutionFilter.prototype.constructor = PIXI.ConvolutionFilter;
    -
    -/**
    - * An array of values used for matrix transformation. Specified as a 9 point Array.
    - *
    - * @property matrix
    - * @type Array
    - */
    -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'matrix', {
    -    get: function() {
    -        return this.uniforms.m.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.m.value = new PIXI.Float32Array(value);
    -    }
    -});
    -
    -/**
    - * Width of the object you are transforming
    - *
    - * @property width
    - * @type Number
    - */
    -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'width', {
    -    get: function() {
    -        return this.uniforms.texelSizeX.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.texelSizeX.value = 1/value;
    -    }
    -});
    -
    -/**
    - * Height of the object you are transforming
    - *
    - * @property height
    - * @type Number
    - */
    -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'height', {
    -    get: function() {
    -        return this.uniforms.texelSizeY.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.texelSizeY.value = 1/value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_CrossHatchFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_CrossHatchFilter.js.html deleted file mode 100755 index 5c8509e..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_CrossHatchFilter.js.html +++ /dev/null @@ -1,358 +0,0 @@ - - - - - src/pixi/filters/CrossHatchFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/CrossHatchFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A Cross Hatch effect filter.
    - * 
    - * @class CrossHatchFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.CrossHatchFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 1 / 512}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float blur;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '    float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);',
    -
    -        '    gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);',
    -
    -        '    if (lum < 1.00) {',
    -        '        if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {',
    -        '            gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);',
    -        '        }',
    -        '    }',
    -
    -        '    if (lum < 0.75) {',
    -        '        if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {',
    -        '            gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);',
    -        '        }',
    -        '    }',
    -
    -        '    if (lum < 0.50) {',
    -        '        if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {',
    -        '            gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);',
    -        '        }',
    -        '    }',
    -
    -        '    if (lum < 0.3) {',
    -        '        if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {',
    -        '            gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);',
    -        '        }',
    -        '    }',
    -        '}'
    -    ];
    -};
    -
    -PIXI.CrossHatchFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.CrossHatchFilter.prototype.constructor = PIXI.CrossHatchFilter;
    -
    -/**
    - * Sets the strength of both the blur.
    - *
    - * @property blur
    - * @type Number the strength of the blur
    - * @default 2
    - */
    -Object.defineProperty(PIXI.CrossHatchFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value / (1/7000);
    -    },
    -    set: function(value) {
    -        //this.padding = value;
    -        this.uniforms.blur.value = (1/7000) * value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_DisplacementFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_DisplacementFilter.js.html deleted file mode 100755 index 06dd7d5..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_DisplacementFilter.js.html +++ /dev/null @@ -1,412 +0,0 @@ - - - - - src/pixi/filters/DisplacementFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/DisplacementFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The DisplacementFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object.
    - * You can use this filter to apply all manor of crazy warping effects
    - * Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.
    - * 
    - * @class DisplacementFilter
    - * @extends AbstractFilter
    - * @constructor
    - * @param texture {Texture} The texture used for the displacement map * must be power of 2 texture at the moment
    - */
    -PIXI.DisplacementFilter = function(texture)
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -    texture.baseTexture._powerOf2 = true;
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        displacementMap: {type: 'sampler2D', value:texture},
    -        scale:           {type: '2f', value:{x:30, y:30}},
    -        offset:          {type: '2f', value:{x:0, y:0}},
    -        mapDimensions:   {type: '2f', value:{x:1, y:5112}},
    -        dimensions:   {type: '4fv', value:[0,0,0,0]}
    -    };
    -
    -    if(texture.baseTexture.hasLoaded)
    -    {
    -        this.uniforms.mapDimensions.value.x = texture.width;
    -        this.uniforms.mapDimensions.value.y = texture.height;
    -    }
    -    else
    -    {
    -        this.boundLoadedFunction = this.onTextureLoaded.bind(this);
    -
    -        texture.baseTexture.on('loaded', this.boundLoadedFunction);
    -    }
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D displacementMap;',
    -        'uniform sampler2D uSampler;',
    -        'uniform vec2 scale;',
    -        'uniform vec2 offset;',
    -        'uniform vec4 dimensions;',
    -        'uniform vec2 mapDimensions;',// = vec2(256.0, 256.0);',
    -        // 'const vec2 textureDimensions = vec2(750.0, 750.0);',
    -
    -        'void main(void) {',
    -        '   vec2 mapCords = vTextureCoord.xy;',
    -        //'   mapCords -= ;',
    -        '   mapCords += (dimensions.zw + offset)/ dimensions.xy ;',
    -        '   mapCords.y *= -1.0;',
    -        '   mapCords.y += 1.0;',
    -        '   vec2 matSample = texture2D(displacementMap, mapCords).xy;',
    -        '   matSample -= 0.5;',
    -        '   matSample *= scale;',
    -        '   matSample /= mapDimensions;',
    -        '   gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + matSample.x, vTextureCoord.y + matSample.y));',
    -        '   gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb, 1.0);',
    -        '   vec2 cord = vTextureCoord;',
    -
    -        //'   gl_FragColor =  texture2D(displacementMap, cord);',
    -     //   '   gl_FragColor = gl_FragColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.DisplacementFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.DisplacementFilter.prototype.constructor = PIXI.DisplacementFilter;
    -
    -/**
    - * Sets the map dimensions uniforms when the texture becomes available.
    - *
    - * @method onTextureLoaded
    - */
    -PIXI.DisplacementFilter.prototype.onTextureLoaded = function()
    -{
    -    this.uniforms.mapDimensions.value.x = this.uniforms.displacementMap.value.width;
    -    this.uniforms.mapDimensions.value.y = this.uniforms.displacementMap.value.height;
    -
    -    this.uniforms.displacementMap.value.baseTexture.off('loaded', this.boundLoadedFunction);
    -};
    -
    -/**
    - * The texture used for the displacement map. Must be power of 2 texture.
    - *
    - * @property map
    - * @type Texture
    - */
    -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'map', {
    -    get: function() {
    -        return this.uniforms.displacementMap.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.displacementMap.value = value;
    -    }
    -});
    -
    -/**
    - * The multiplier used to scale the displacement result from the map calculation.
    - *
    - * @property scale
    - * @type Point
    - */
    -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'scale', {
    -    get: function() {
    -        return this.uniforms.scale.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.scale.value = value;
    -    }
    -});
    -
    -/**
    - * The offset used to move the displacement map.
    - *
    - * @property offset
    - * @type Point
    - */
    -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'offset', {
    -    get: function() {
    -        return this.uniforms.offset.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.offset.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_DotScreenFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_DotScreenFilter.js.html deleted file mode 100755 index b0cf737..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_DotScreenFilter.js.html +++ /dev/null @@ -1,363 +0,0 @@ - - - - - src/pixi/filters/DotScreenFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/DotScreenFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/fun/dotscreen.js
    - */
    -
    -/**
    - * This filter applies a dotscreen effect making display objects appear to be made out of black and white halftone dots like an old printer.
    - * 
    - * @class DotScreenFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.DotScreenFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        scale: {type: '1f', value:1},
    -        angle: {type: '1f', value:5},
    -        dimensions:   {type: '4fv', value:[0,0,0,0]}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform vec4 dimensions;',
    -        'uniform sampler2D uSampler;',
    -
    -        'uniform float angle;',
    -        'uniform float scale;',
    -
    -        'float pattern() {',
    -        '   float s = sin(angle), c = cos(angle);',
    -        '   vec2 tex = vTextureCoord * dimensions.xy;',
    -        '   vec2 point = vec2(',
    -        '       c * tex.x - s * tex.y,',
    -        '       s * tex.x + c * tex.y',
    -        '   ) * scale;',
    -        '   return (sin(point.x) * sin(point.y)) * 4.0;',
    -        '}',
    -
    -        'void main() {',
    -        '   vec4 color = texture2D(uSampler, vTextureCoord);',
    -        '   float average = (color.r + color.g + color.b) / 3.0;',
    -        '   gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);',
    -        '}'
    -    ];
    -};
    -
    -PIXI.DotScreenFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.DotScreenFilter.prototype.constructor = PIXI.DotScreenFilter;
    -
    -/**
    - * The scale of the effect.
    - * @property scale
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DotScreenFilter.prototype, 'scale', {
    -    get: function() {
    -        return this.uniforms.scale.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.scale.value = value;
    -    }
    -});
    -
    -/**
    - * The radius of the effect.
    - * @property angle
    - * @type Number
    - */
    -Object.defineProperty(PIXI.DotScreenFilter.prototype, 'angle', {
    -    get: function() {
    -        return this.uniforms.angle.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.angle.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_FilterBlock.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_FilterBlock.js.html deleted file mode 100755 index 275cc3d..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_FilterBlock.js.html +++ /dev/null @@ -1,308 +0,0 @@ - - - - - src/pixi/filters/FilterBlock.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/FilterBlock.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A target and pass info object for filters.
    - * 
    - * @class FilterBlock
    - * @constructor
    - */
    -PIXI.FilterBlock = function()
    -{
    -    /**
    -     * The visible state of this FilterBlock.
    -     *
    -     * @property visible
    -     * @type Boolean
    -     */
    -    this.visible = true;
    -
    -    /**
    -     * The renderable state of this FilterBlock.
    -     *
    -     * @property renderable
    -     * @type Boolean
    -     */
    -    this.renderable = true;
    -};
    -
    -PIXI.FilterBlock.prototype.constructor = PIXI.FilterBlock;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_GrayFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_GrayFilter.js.html deleted file mode 100755 index 5ac5889..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_GrayFilter.js.html +++ /dev/null @@ -1,331 +0,0 @@ - - - - - src/pixi/filters/GrayFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/GrayFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This greyscales the palette of your Display Objects.
    - * 
    - * @class GrayFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.GrayFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        gray: {type: '1f', value: 1}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D uSampler;',
    -        'uniform float gray;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord);',
    -        '   gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(0.2126*gl_FragColor.r + 0.7152*gl_FragColor.g + 0.0722*gl_FragColor.b), gray);',
    -     //   '   gl_FragColor = gl_FragColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.GrayFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.GrayFilter.prototype.constructor = PIXI.GrayFilter;
    -
    -/**
    - * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color.
    - * @property gray
    - * @type Number
    - */
    -Object.defineProperty(PIXI.GrayFilter.prototype, 'gray', {
    -    get: function() {
    -        return this.uniforms.gray.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.gray.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_InvertFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_InvertFilter.js.html deleted file mode 100755 index 8c3dabd..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_InvertFilter.js.html +++ /dev/null @@ -1,332 +0,0 @@ - - - - - src/pixi/filters/InvertFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/InvertFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This inverts your Display Objects colors.
    - * 
    - * @class InvertFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.InvertFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        invert: {type: '1f', value: 1}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float invert;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord);',
    -        '   gl_FragColor.rgb = mix( (vec3(1)-gl_FragColor.rgb) * gl_FragColor.a, gl_FragColor.rgb, 1.0 - invert);',
    -        //'   gl_FragColor.rgb = gl_FragColor.rgb  * gl_FragColor.a;',
    -      //  '   gl_FragColor = gl_FragColor * vColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.InvertFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.InvertFilter.prototype.constructor = PIXI.InvertFilter;
    -
    -/**
    - * The strength of the invert. 1 will fully invert the colors, 0 will make the object its normal color
    - * @property invert
    - * @type Number
    -*/
    -Object.defineProperty(PIXI.InvertFilter.prototype, 'invert', {
    -    get: function() {
    -        return this.uniforms.invert.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.invert.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_NoiseFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_NoiseFilter.js.html deleted file mode 100755 index 2949784..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_NoiseFilter.js.html +++ /dev/null @@ -1,340 +0,0 @@ - - - - - src/pixi/filters/NoiseFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/NoiseFilter.js

    - -
    -
    -/**
    - * @author Vico @vicocotea
    - * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js
    - */
    -
    -/**
    - * A Noise effect filter.
    - * 
    - * @class NoiseFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.NoiseFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        noise: {type: '1f', value: 0.5}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'uniform sampler2D uSampler;',
    -        'uniform float noise;',
    -        'varying vec2 vTextureCoord;',
    -
    -        'float rand(vec2 co) {',
    -        '    return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);',
    -        '}',
    -        'void main() {',
    -        '    vec4 color = texture2D(uSampler, vTextureCoord);',
    -            
    -        '    float diff = (rand(vTextureCoord) - 0.5) * noise;',
    -        '    color.r += diff;',
    -        '    color.g += diff;',
    -        '    color.b += diff;',
    -            
    -        '    gl_FragColor = color;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.NoiseFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.NoiseFilter.prototype.constructor = PIXI.NoiseFilter;
    -
    -/**
    - * The amount of noise to apply.
    - * @property noise
    - * @type Number
    -*/
    -Object.defineProperty(PIXI.NoiseFilter.prototype, 'noise', {
    -    get: function() {
    -        return this.uniforms.noise.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.noise.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_NormalMapFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_NormalMapFilter.js.html deleted file mode 100755 index eca90e7..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_NormalMapFilter.js.html +++ /dev/null @@ -1,474 +0,0 @@ - - - - - src/pixi/filters/NormalMapFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/NormalMapFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -
    -/**
    - * The NormalMapFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. 
    - * You can use this filter to apply all manor of crazy warping effects
    - * Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y.
    - * 
    - * @class NormalMapFilter
    - * @extends AbstractFilter
    - * @constructor
    - * @param texture {Texture} The texture used for the displacement map * must be power of 2 texture at the moment
    - */
    -PIXI.NormalMapFilter = function(texture)
    -{
    -	PIXI.AbstractFilter.call( this );
    -	
    -	this.passes = [this];
    -	texture.baseTexture._powerOf2 = true;
    -
    -	// set the uniforms
    -	this.uniforms = {
    -		displacementMap: {type: 'sampler2D', value:texture},
    -		scale:			 {type: '2f', value:{x:15, y:15}},
    -		offset:			 {type: '2f', value:{x:0, y:0}},
    -		mapDimensions:   {type: '2f', value:{x:1, y:1}},
    -		dimensions:   {type: '4f', value:[0,0,0,0]},
    -	//	LightDir: {type: 'f3', value:[0, 1, 0]},
    -		LightPos: {type: '3f', value:[0, 1, 0]}
    -	};
    -	
    -
    -	if(texture.baseTexture.hasLoaded)
    -	{
    -		this.uniforms.mapDimensions.value.x = texture.width;
    -		this.uniforms.mapDimensions.value.y = texture.height;
    -	}
    -	else
    -	{
    -		this.boundLoadedFunction = this.onTextureLoaded.bind(this);
    -
    -		texture.baseTexture.on("loaded", this.boundLoadedFunction);
    -	}
    -
    -	this.fragmentSrc = [
    -	  "precision mediump float;",
    -	  "varying vec2 vTextureCoord;",
    -	  "varying float vColor;",
    -	  "uniform sampler2D displacementMap;",
    -	  "uniform sampler2D uSampler;",
    -	 
    -	  "uniform vec4 dimensions;",
    -	  
    -		"const vec2 Resolution = vec2(1.0,1.0);",      //resolution of screen
    -		"uniform vec3 LightPos;",    //light position, normalized
    -		"const vec4 LightColor = vec4(1.0, 1.0, 1.0, 1.0);",      //light RGBA -- alpha is intensity
    -		"const vec4 AmbientColor = vec4(1.0, 1.0, 1.0, 0.5);",    //ambient RGBA -- alpha is intensity 
    -		"const vec3 Falloff = vec3(0.0, 1.0, 0.2);",         //attenuation coefficients
    -
    -		"uniform vec3 LightDir;",//" = vec3(1.0, 0.0, 1.0);",
    -
    -
    -	  "uniform vec2 mapDimensions;",// = vec2(256.0, 256.0);",
    -	 
    -
    -	  "void main(void) {",
    -	  	"vec2 mapCords = vTextureCoord.xy;",
    -
    -	  	"vec4 color = texture2D(uSampler, vTextureCoord.st);",
    -        "vec3 nColor = texture2D(displacementMap, vTextureCoord.st).rgb;",
    - 
    -
    -	  	"mapCords *= vec2(dimensions.x/512.0, dimensions.y/512.0);",
    -	  
    -	  	"mapCords.y *= -1.0;",
    -	 	"mapCords.y += 1.0;",
    -
    -	 	//RGBA of our diffuse color
    -		"vec4 DiffuseColor = texture2D(uSampler, vTextureCoord);",
    -
    -		//RGB of our normal map
    -		"vec3 NormalMap = texture2D(displacementMap, mapCords).rgb;",
    -
    -		//The delta position of light
    -		//"vec3 LightDir = vec3(LightPos.xy - (gl_FragCoord.xy / Resolution.xy), LightPos.z);",
    -		"vec3 LightDir = vec3(LightPos.xy - (mapCords.xy), LightPos.z);",
    -		//Correct for aspect ratio
    -		//"LightDir.x *= Resolution.x / Resolution.y;",
    -
    -		//Determine distance (used for attenuation) BEFORE we normalize our LightDir
    -		"float D = length(LightDir);",
    -
    -		//normalize our vectors
    -		"vec3 N = normalize(NormalMap * 2.0 - 1.0);",
    -		"vec3 L = normalize(LightDir);",
    -
    -		//Pre-multiply light color with intensity
    -		//Then perform "N dot L" to determine our diffuse term
    -		"vec3 Diffuse = (LightColor.rgb * LightColor.a) * max(dot(N, L), 0.0);",
    -
    -		//pre-multiply ambient color with intensity
    -		"vec3 Ambient = AmbientColor.rgb * AmbientColor.a;",
    -
    -		//calculate attenuation
    -		"float Attenuation = 1.0 / ( Falloff.x + (Falloff.y*D) + (Falloff.z*D*D) );",
    -
    -		//the calculation which brings it all together
    -		"vec3 Intensity = Ambient + Diffuse * Attenuation;",
    -		"vec3 FinalColor = DiffuseColor.rgb * Intensity;",
    -		"gl_FragColor = vColor * vec4(FinalColor, DiffuseColor.a);",
    -		//"gl_FragColor = vec4(1.0, 0.0, 0.0, Attenuation);",//vColor * vec4(FinalColor, DiffuseColor.a);",
    -	/*
    -	 	// normalise color
    -	 	"vec3 normal = normalize(nColor * 2.0 - 1.0);",
    -	 	
    -	 	"vec3 deltaPos = vec3( (light.xy - gl_FragCoord.xy) / resolution.xy, light.z );",
    -
    -	 	"float lambert = clamp(dot(normal, lightDir), 0.0, 1.0);",
    -
    -	 	"float d = sqrt(dot(deltaPos, deltaPos));", 
    -        "float att = 1.0 / ( attenuation.x + (attenuation.y*d) + (attenuation.z*d*d) );",
    -
    -        "vec3 result = (ambientColor * ambientIntensity) + (lightColor.rgb * lambert) * att;",
    -        "result *= color.rgb;",
    -       
    -        "gl_FragColor = vec4(result, 1.0);",*/
    -
    -	  	
    -
    -	  "}"
    -	];
    -	
    -}
    -
    -PIXI.NormalMapFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.NormalMapFilter.prototype.constructor = PIXI.NormalMapFilter;
    -
    -/**
    - * Sets the map dimensions uniforms when the texture becomes available.
    - *
    - * @method onTextureLoaded
    - */
    -PIXI.NormalMapFilter.prototype.onTextureLoaded = function()
    -{
    -	this.uniforms.mapDimensions.value.x = this.uniforms.displacementMap.value.width;
    -	this.uniforms.mapDimensions.value.y = this.uniforms.displacementMap.value.height;
    -
    -	this.uniforms.displacementMap.value.baseTexture.off("loaded", this.boundLoadedFunction)
    -};
    -
    -/**
    - * The texture used for the displacement map. Must be power of 2 texture.
    - *
    - * @property map
    - * @type Texture
    - */
    -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'map', {
    -    get: function() {
    -        return this.uniforms.displacementMap.value;
    -    },
    -    set: function(value) {
    -    	this.uniforms.displacementMap.value = value;
    -    }
    -});
    -
    -/**
    - * The multiplier used to scale the displacement result from the map calculation.
    - *
    - * @property scale
    - * @type Point
    - */
    -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'scale', {
    -    get: function() {
    -        return this.uniforms.scale.value;
    -    },
    -    set: function(value) {
    -    	this.uniforms.scale.value = value;
    -    }
    -});
    -
    -/**
    - * The offset used to move the displacement map.
    - *
    - * @property offset
    - * @type Point
    - */
    -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'offset', {
    -    get: function() {
    -        return this.uniforms.offset.value;
    -    },
    -    set: function(value) {
    -    	this.uniforms.offset.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_PixelateFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_PixelateFilter.js.html deleted file mode 100755 index 3413e27..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_PixelateFilter.js.html +++ /dev/null @@ -1,340 +0,0 @@ - - - - - src/pixi/filters/PixelateFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/PixelateFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This filter applies a pixelate effect making display objects appear 'blocky'.
    - * 
    - * @class PixelateFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.PixelateFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        invert: {type: '1f', value: 0},
    -        dimensions: {type: '4fv', value:new PIXI.Float32Array([10000, 100, 10, 10])},
    -        pixelSize: {type: '2f', value:{x:10, y:10}}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform vec2 testDim;',
    -        'uniform vec4 dimensions;',
    -        'uniform vec2 pixelSize;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   vec2 coord = vTextureCoord;',
    -
    -        '   vec2 size = dimensions.xy/pixelSize;',
    -
    -        '   vec2 color = floor( ( vTextureCoord * size ) ) / size + pixelSize/dimensions.xy * 0.5;',
    -        '   gl_FragColor = texture2D(uSampler, color);',
    -        '}'
    -    ];
    -};
    -
    -PIXI.PixelateFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.PixelateFilter.prototype.constructor = PIXI.PixelateFilter;
    -
    -/**
    - * This a point that describes the size of the blocks. x is the width of the block and y is the height.
    - * 
    - * @property size
    - * @type Point
    - */
    -Object.defineProperty(PIXI.PixelateFilter.prototype, 'size', {
    -    get: function() {
    -        return this.uniforms.pixelSize.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.pixelSize.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_RGBSplitFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_RGBSplitFilter.js.html deleted file mode 100755 index dca385c..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_RGBSplitFilter.js.html +++ /dev/null @@ -1,369 +0,0 @@ - - - - - src/pixi/filters/RGBSplitFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/RGBSplitFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * An RGB Split Filter.
    - * 
    - * @class RGBSplitFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.RGBSplitFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        red: {type: '2f', value: {x:20, y:20}},
    -        green: {type: '2f', value: {x:-20, y:20}},
    -        blue: {type: '2f', value: {x:20, y:-20}},
    -        dimensions:   {type: '4fv', value:[0,0,0,0]}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform vec2 red;',
    -        'uniform vec2 green;',
    -        'uniform vec2 blue;',
    -        'uniform vec4 dimensions;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/dimensions.xy).r;',
    -        '   gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/dimensions.xy).g;',
    -        '   gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/dimensions.xy).b;',
    -        '   gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.RGBSplitFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.RGBSplitFilter.prototype.constructor = PIXI.RGBSplitFilter;
    -
    -/**
    - * Red channel offset.
    - * 
    - * @property red
    - * @type Point
    - */
    -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'red', {
    -    get: function() {
    -        return this.uniforms.red.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.red.value = value;
    -    }
    -});
    -
    -/**
    - * Green channel offset.
    - * 
    - * @property green
    - * @type Point
    - */
    -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'green', {
    -    get: function() {
    -        return this.uniforms.green.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.green.value = value;
    -    }
    -});
    -
    -/**
    - * Blue offset.
    - * 
    - * @property blue
    - * @type Point
    - */
    -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'blue', {
    -    get: function() {
    -        return this.uniforms.blue.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.blue.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_SepiaFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_SepiaFilter.js.html deleted file mode 100755 index aa41b56..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_SepiaFilter.js.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - src/pixi/filters/SepiaFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/SepiaFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This applies a sepia effect to your Display Objects.
    - * 
    - * @class SepiaFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.SepiaFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        sepia: {type: '1f', value: 1}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform float sepia;',
    -        'uniform sampler2D uSampler;',
    -
    -        'const mat3 sepiaMatrix = mat3(0.3588, 0.7044, 0.1368, 0.2990, 0.5870, 0.1140, 0.2392, 0.4696, 0.0912);',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord);',
    -        '   gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb * sepiaMatrix, sepia);',
    -       // '   gl_FragColor = gl_FragColor * vColor;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.SepiaFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.SepiaFilter.prototype.constructor = PIXI.SepiaFilter;
    -
    -/**
    - * The strength of the sepia. 1 will apply the full sepia effect, 0 will make the object its normal color.
    - * @property sepia
    - * @type Number
    -*/
    -Object.defineProperty(PIXI.SepiaFilter.prototype, 'sepia', {
    -    get: function() {
    -        return this.uniforms.sepia.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.sepia.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_SmartBlurFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_SmartBlurFilter.js.html deleted file mode 100755 index d879bbe..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_SmartBlurFilter.js.html +++ /dev/null @@ -1,353 +0,0 @@ - - - - - src/pixi/filters/SmartBlurFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/SmartBlurFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A Smart Blur Filter.
    - * 
    - * @class SmartBlurFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.SmartBlurFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 1/512}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'uniform sampler2D uSampler;',
    -        //'uniform vec2 delta;',
    -        'const vec2 delta = vec2(1.0/10.0, 0.0);',
    -        //'uniform float darkness;',
    -
    -        'float random(vec3 scale, float seed) {',
    -        '   return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);',
    -        '}',
    -
    -
    -        'void main(void) {',
    -        '   vec4 color = vec4(0.0);',
    -        '   float total = 0.0;',
    -
    -        '   float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);',
    -
    -        '   for (float t = -30.0; t <= 30.0; t++) {',
    -        '       float percent = (t + offset - 0.5) / 30.0;',
    -        '       float weight = 1.0 - abs(percent);',
    -        '       vec4 sample = texture2D(uSampler, vTextureCoord + delta * percent);',
    -        '       sample.rgb *= sample.a;',
    -        '       color += sample * weight;',
    -        '       total += weight;',
    -        '   }',
    -
    -        '   gl_FragColor = color / total;',
    -        '   gl_FragColor.rgb /= gl_FragColor.a + 0.00001;',
    -        //'   gl_FragColor.rgb *= darkness;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.SmartBlurFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.SmartBlurFilter.prototype.constructor = PIXI.SmartBlurFilter;
    -
    -/**
    - * The strength of the blur.
    - *
    - * @property blur
    - * @type Number the strength of the blur
    - * @default 2
    - */
    -Object.defineProperty(PIXI.SmartBlurFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value;
    -    },
    -    set: function(value) {
    -        this.uniforms.blur.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_TiltShiftFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_TiltShiftFilter.js.html deleted file mode 100755 index d42187b..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_TiltShiftFilter.js.html +++ /dev/null @@ -1,360 +0,0 @@ - - - - - src/pixi/filters/TiltShiftFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/TiltShiftFilter.js

    - -
    -
    -/**
    - * @author Vico @vicocotea
    - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/
    - */
    -
    -/**
    - * A TiltShift Filter. Manages the pass of both a TiltShiftXFilter and TiltShiftYFilter.
    - * 
    - * @class TiltShiftFilter
    - * @constructor
    - */
    -PIXI.TiltShiftFilter = function()
    -{
    -    this.tiltShiftXFilter = new PIXI.TiltShiftXFilter();
    -    this.tiltShiftYFilter = new PIXI.TiltShiftYFilter();
    -    this.tiltShiftXFilter.updateDelta();
    -    this.tiltShiftXFilter.updateDelta();
    -
    -    this.passes = [this.tiltShiftXFilter, this.tiltShiftYFilter];
    -};
    -
    -PIXI.TiltShiftFilter.prototype.constructor = PIXI.TiltShiftFilter;
    -
    -/**
    - * The strength of the blur.
    - *
    - * @property blur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.tiltShiftXFilter.blur;
    -    },
    -    set: function(value) {
    -        this.tiltShiftXFilter.blur = this.tiltShiftYFilter.blur = value;
    -    }
    -});
    -
    -/**
    - * The strength of the gradient blur.
    - *
    - * @property gradientBlur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'gradientBlur', {
    -    get: function() {
    -        return this.tiltShiftXFilter.gradientBlur;
    -    },
    -    set: function(value) {
    -        this.tiltShiftXFilter.gradientBlur = this.tiltShiftYFilter.gradientBlur = value;
    -    }
    -});
    -
    -/**
    - * The Y value to start the effect at.
    - *
    - * @property start
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'start', {
    -    get: function() {
    -        return this.tiltShiftXFilter.start;
    -    },
    -    set: function(value) {
    -        this.tiltShiftXFilter.start = this.tiltShiftYFilter.start = value;
    -    }
    -});
    -
    -/**
    - * The Y value to end the effect at.
    - *
    - * @property end
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'end', {
    -    get: function() {
    -        return this.tiltShiftXFilter.end;
    -    },
    -    set: function(value) {
    -        this.tiltShiftXFilter.end = this.tiltShiftYFilter.end = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_TiltShiftXFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_TiltShiftXFilter.js.html deleted file mode 100755 index bdd0ee0..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_TiltShiftXFilter.js.html +++ /dev/null @@ -1,427 +0,0 @@ - - - - - src/pixi/filters/TiltShiftXFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/TiltShiftXFilter.js

    - -
    -
    -/**
    - * @author Vico @vicocotea
    - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/
    - */
    -
    -/**
    - * A TiltShiftXFilter.
    - * 
    - * @class TiltShiftXFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.TiltShiftXFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 100.0},
    -        gradientBlur: {type: '1f', value: 600.0},
    -        start: {type: '2f', value:{x:0, y:window.screenHeight / 2}},
    -        end: {type: '2f', value:{x:600, y:window.screenHeight / 2}},
    -        delta: {type: '2f', value:{x:30, y:30}},
    -        texSize: {type: '2f', value:{x:window.screenWidth, y:window.screenHeight}}
    -    };
    -
    -    this.updateDelta();
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'uniform sampler2D uSampler;',
    -        'uniform float blur;',
    -        'uniform float gradientBlur;',
    -        'uniform vec2 start;',
    -        'uniform vec2 end;',
    -        'uniform vec2 delta;',
    -        'uniform vec2 texSize;',
    -        'varying vec2 vTextureCoord;',
    -
    -        'float random(vec3 scale, float seed) {',
    -        '   return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);',
    -        '}',
    -
    -        'void main(void) {',
    -        '    vec4 color = vec4(0.0);',
    -        '    float total = 0.0;',
    -        
    -        '    float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);',
    -        '    vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));',
    -        '    float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;',
    -        
    -        '    for (float t = -30.0; t <= 30.0; t++) {',
    -        '        float percent = (t + offset - 0.5) / 30.0;',
    -        '        float weight = 1.0 - abs(percent);',
    -        '        vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);',
    -        '        sample.rgb *= sample.a;',
    -        '        color += sample * weight;',
    -        '        total += weight;',
    -        '    }',
    -
    -        '    gl_FragColor = color / total;',
    -        '    gl_FragColor.rgb /= gl_FragColor.a + 0.00001;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.TiltShiftXFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.TiltShiftXFilter.prototype.constructor = PIXI.TiltShiftXFilter;
    -
    -/**
    - * The strength of the blur.
    - *
    - * @property blur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.blur.value = value;
    -    }
    -});
    -
    -/**
    - * The strength of the gradient blur.
    - *
    - * @property gradientBlur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'gradientBlur', {
    -    get: function() {
    -        return this.uniforms.gradientBlur.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.gradientBlur.value = value;
    -    }
    -});
    -
    -/**
    - * The X value to start the effect at.
    - *
    - * @property start
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'start', {
    -    get: function() {
    -        return this.uniforms.start.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.start.value = value;
    -        this.updateDelta();
    -    }
    -});
    -
    -/**
    - * The X value to end the effect at.
    - *
    - * @property end
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'end', {
    -    get: function() {
    -        return this.uniforms.end.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.end.value = value;
    -        this.updateDelta();
    -    }
    -});
    -
    -/**
    - * Updates the filter delta values.
    - *
    - * @method updateDelta
    - */
    -PIXI.TiltShiftXFilter.prototype.updateDelta = function(){
    -    var dx = this.uniforms.end.value.x - this.uniforms.start.value.x;
    -    var dy = this.uniforms.end.value.y - this.uniforms.start.value.y;
    -    var d = Math.sqrt(dx * dx + dy * dy);
    -    this.uniforms.delta.value.x = dx / d;
    -    this.uniforms.delta.value.y = dy / d;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_TiltShiftYFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_TiltShiftYFilter.js.html deleted file mode 100755 index d99d3d8..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_TiltShiftYFilter.js.html +++ /dev/null @@ -1,427 +0,0 @@ - - - - - src/pixi/filters/TiltShiftYFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/TiltShiftYFilter.js

    - -
    -
    -/**
    - * @author Vico @vicocotea
    - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/
    - */
    -
    -/**
    - * A TiltShiftYFilter.
    - * 
    - * @class TiltShiftYFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.TiltShiftYFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        blur: {type: '1f', value: 100.0},
    -        gradientBlur: {type: '1f', value: 600.0},
    -        start: {type: '2f', value:{x:0, y:window.screenHeight / 2}},
    -        end: {type: '2f', value:{x:600, y:window.screenHeight / 2}},
    -        delta: {type: '2f', value:{x:30, y:30}},
    -        texSize: {type: '2f', value:{x:window.screenWidth, y:window.screenHeight}}
    -    };
    -    
    -    this.updateDelta();
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'uniform sampler2D uSampler;',
    -        'uniform float blur;',
    -        'uniform float gradientBlur;',
    -        'uniform vec2 start;',
    -        'uniform vec2 end;',
    -        'uniform vec2 delta;',
    -        'uniform vec2 texSize;',
    -        'varying vec2 vTextureCoord;',
    -
    -        'float random(vec3 scale, float seed) {',
    -        '   return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);',
    -        '}',
    -
    -        'void main(void) {',
    -        '    vec4 color = vec4(0.0);',
    -        '    float total = 0.0;',
    -        
    -        '    float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);',
    -        '    vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));',
    -        '    float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;',
    -        
    -        '    for (float t = -30.0; t <= 30.0; t++) {',
    -        '        float percent = (t + offset - 0.5) / 30.0;',
    -        '        float weight = 1.0 - abs(percent);',
    -        '        vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);',
    -        '        sample.rgb *= sample.a;',
    -        '        color += sample * weight;',
    -        '        total += weight;',
    -        '    }',
    -
    -        '    gl_FragColor = color / total;',
    -        '    gl_FragColor.rgb /= gl_FragColor.a + 0.00001;',
    -        '}'
    -    ];
    -};
    -
    -PIXI.TiltShiftYFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.TiltShiftYFilter.prototype.constructor = PIXI.TiltShiftYFilter;
    -
    -/**
    - * The strength of the blur.
    - *
    - * @property blur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'blur', {
    -    get: function() {
    -        return this.uniforms.blur.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.blur.value = value;
    -    }
    -});
    -
    -/**
    - * The strength of the gradient blur.
    - *
    - * @property gradientBlur
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'gradientBlur', {
    -    get: function() {
    -        return this.uniforms.gradientBlur.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.gradientBlur.value = value;
    -    }
    -});
    -
    -/**
    - * The Y value to start the effect at.
    - *
    - * @property start
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'start', {
    -    get: function() {
    -        return this.uniforms.start.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.start.value = value;
    -        this.updateDelta();
    -    }
    -});
    -
    -/**
    - * The Y value to end the effect at.
    - *
    - * @property end
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'end', {
    -    get: function() {
    -        return this.uniforms.end.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.end.value = value;
    -        this.updateDelta();
    -    }
    -});
    -
    -/**
    - * Updates the filter delta values.
    - *
    - * @method updateDelta
    - */
    -PIXI.TiltShiftYFilter.prototype.updateDelta = function(){
    -    var dx = this.uniforms.end.value.x - this.uniforms.start.value.x;
    -    var dy = this.uniforms.end.value.y - this.uniforms.start.value.y;
    -    var d = Math.sqrt(dx * dx + dy * dy);
    -    this.uniforms.delta.value.x = -dy / d;
    -    this.uniforms.delta.value.y = dx / d;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_TwistFilter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_TwistFilter.js.html deleted file mode 100755 index 97e8f4f..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_filters_TwistFilter.js.html +++ /dev/null @@ -1,380 +0,0 @@ - - - - - src/pixi/filters/TwistFilter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/filters/TwistFilter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This filter applies a twist effect making display objects appear twisted in the given direction.
    - * 
    - * @class TwistFilter
    - * @extends AbstractFilter
    - * @constructor
    - */
    -PIXI.TwistFilter = function()
    -{
    -    PIXI.AbstractFilter.call( this );
    -
    -    this.passes = [this];
    -
    -    // set the uniforms
    -    this.uniforms = {
    -        radius: {type: '1f', value:0.5},
    -        angle: {type: '1f', value:5},
    -        offset: {type: '2f', value:{x:0.5, y:0.5}}
    -    };
    -
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform vec4 dimensions;',
    -        'uniform sampler2D uSampler;',
    -
    -        'uniform float radius;',
    -        'uniform float angle;',
    -        'uniform vec2 offset;',
    -
    -        'void main(void) {',
    -        '   vec2 coord = vTextureCoord - offset;',
    -        '   float distance = length(coord);',
    -
    -        '   if (distance < radius) {',
    -        '       float ratio = (radius - distance) / radius;',
    -        '       float angleMod = ratio * ratio * angle;',
    -        '       float s = sin(angleMod);',
    -        '       float c = cos(angleMod);',
    -        '       coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);',
    -        '   }',
    -
    -        '   gl_FragColor = texture2D(uSampler, coord+offset);',
    -        '}'
    -    ];
    -};
    -
    -PIXI.TwistFilter.prototype = Object.create( PIXI.AbstractFilter.prototype );
    -PIXI.TwistFilter.prototype.constructor = PIXI.TwistFilter;
    -
    -/**
    - * This point describes the the offset of the twist.
    - * 
    - * @property offset
    - * @type Point
    - */
    -Object.defineProperty(PIXI.TwistFilter.prototype, 'offset', {
    -    get: function() {
    -        return this.uniforms.offset.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.offset.value = value;
    -    }
    -});
    -
    -/**
    - * This radius of the twist.
    - * 
    - * @property radius
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TwistFilter.prototype, 'radius', {
    -    get: function() {
    -        return this.uniforms.radius.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.radius.value = value;
    -    }
    -});
    -
    -/**
    - * This angle of the twist.
    - * 
    - * @property angle
    - * @type Number
    - */
    -Object.defineProperty(PIXI.TwistFilter.prototype, 'angle', {
    -    get: function() {
    -        return this.uniforms.angle.value;
    -    },
    -    set: function(value) {
    -        this.dirty = true;
    -        this.uniforms.angle.value = value;
    -    }
    -});
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_geom_Circle.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_geom_Circle.js.html deleted file mode 100755 index 8c0c076..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_geom_Circle.js.html +++ /dev/null @@ -1,362 +0,0 @@ - - - - - src/pixi/geom/Circle.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Circle.js

    - -
    -
    -/**
    - * @author Chad Engler <chad@pantherdev.com>
    - */
    -
    -/**
    - * The Circle object can be used to specify a hit area for displayObjects
    - *
    - * @class Circle
    - * @constructor
    - * @param x {Number} The X coordinate of the center of this circle
    - * @param y {Number} The Y coordinate of the center of this circle
    - * @param radius {Number} The radius of the circle
    - */
    -PIXI.Circle = function(x, y, radius)
    -{
    -    /**
    -     * @property x
    -     * @type Number
    -     * @default 0
    -     */
    -    this.x = x || 0;
    -
    -    /**
    -     * @property y
    -     * @type Number
    -     * @default 0
    -     */
    -    this.y = y || 0;
    -
    -    /**
    -     * @property radius
    -     * @type Number
    -     * @default 0
    -     */
    -    this.radius = radius || 0;
    -};
    -
    -/**
    - * Creates a clone of this Circle instance
    - *
    - * @method clone
    - * @return {Circle} a copy of the Circle
    - */
    -PIXI.Circle.prototype.clone = function()
    -{
    -    return new PIXI.Circle(this.x, this.y, this.radius);
    -};
    -
    -/**
    - * Checks whether the x and y coordinates given are contained within this circle
    - *
    - * @method contains
    - * @param x {Number} The X coordinate of the point to test
    - * @param y {Number} The Y coordinate of the point to test
    - * @return {Boolean} Whether the x/y coordinates are within this Circle
    - */
    -PIXI.Circle.prototype.contains = function(x, y)
    -{
    -    if(this.radius <= 0)
    -        return false;
    -
    -    var dx = (this.x - x),
    -        dy = (this.y - y),
    -        r2 = this.radius * this.radius;
    -
    -    dx *= dx;
    -    dy *= dy;
    -
    -    return (dx + dy <= r2);
    -};
    -
    -/**
    -* Returns the framing rectangle of the circle as a PIXI.Rectangle object
    -*
    -* @method getBounds
    -* @return {Rectangle} the framing rectangle
    -*/
    -PIXI.Circle.prototype.getBounds = function()
    -{
    -    return new PIXI.Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2);
    -};
    -
    -// constructor
    -PIXI.Circle.prototype.constructor = PIXI.Circle;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_geom_Ellipse.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_geom_Ellipse.js.html deleted file mode 100755 index f4ebbfb..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_geom_Ellipse.js.html +++ /dev/null @@ -1,370 +0,0 @@ - - - - - src/pixi/geom/Ellipse.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Ellipse.js

    - -
    -
    -/**
    - * @author Chad Engler <chad@pantherdev.com>
    - */
    -
    -/**
    - * The Ellipse object can be used to specify a hit area for displayObjects
    - *
    - * @class Ellipse
    - * @constructor
    - * @param x {Number} The X coordinate of the center of the ellipse
    - * @param y {Number} The Y coordinate of the center of the ellipse
    - * @param width {Number} The half width of this ellipse
    - * @param height {Number} The half height of this ellipse
    - */
    -PIXI.Ellipse = function(x, y, width, height)
    -{
    -    /**
    -     * @property x
    -     * @type Number
    -     * @default 0
    -     */
    -    this.x = x || 0;
    -
    -    /**
    -     * @property y
    -     * @type Number
    -     * @default 0
    -     */
    -    this.y = y || 0;
    -
    -    /**
    -     * @property width
    -     * @type Number
    -     * @default 0
    -     */
    -    this.width = width || 0;
    -
    -    /**
    -     * @property height
    -     * @type Number
    -     * @default 0
    -     */
    -    this.height = height || 0;
    -};
    -
    -/**
    - * Creates a clone of this Ellipse instance
    - *
    - * @method clone
    - * @return {Ellipse} a copy of the ellipse
    - */
    -PIXI.Ellipse.prototype.clone = function()
    -{
    -    return new PIXI.Ellipse(this.x, this.y, this.width, this.height);
    -};
    -
    -/**
    - * Checks whether the x and y coordinates given are contained within this ellipse
    - *
    - * @method contains
    - * @param x {Number} The X coordinate of the point to test
    - * @param y {Number} The Y coordinate of the point to test
    - * @return {Boolean} Whether the x/y coords are within this ellipse
    - */
    -PIXI.Ellipse.prototype.contains = function(x, y)
    -{
    -    if(this.width <= 0 || this.height <= 0)
    -        return false;
    -
    -    //normalize the coords to an ellipse with center 0,0
    -    var normx = ((x - this.x) / this.width),
    -        normy = ((y - this.y) / this.height);
    -
    -    normx *= normx;
    -    normy *= normy;
    -
    -    return (normx + normy <= 1);
    -};
    -
    -/**
    -* Returns the framing rectangle of the ellipse as a PIXI.Rectangle object
    -*
    -* @method getBounds
    -* @return {Rectangle} the framing rectangle
    -*/
    -PIXI.Ellipse.prototype.getBounds = function()
    -{
    -    return new PIXI.Rectangle(this.x - this.width, this.y - this.height, this.width, this.height);
    -};
    -
    -// constructor
    -PIXI.Ellipse.prototype.constructor = PIXI.Ellipse;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_geom_Matrix.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_geom_Matrix.js.html deleted file mode 100755 index f57168e..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_geom_Matrix.js.html +++ /dev/null @@ -1,546 +0,0 @@ - - - - - src/pixi/geom/Matrix.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Matrix.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The Matrix class is now an object, which makes it a lot faster, 
    - * here is a representation of it : 
    - * | a | b | tx|
    - * | c | d | ty|
    - * | 0 | 0 | 1 |
    - *
    - * @class Matrix
    - * @constructor
    - */
    -PIXI.Matrix = function()
    -{
    -    /**
    -     * @property a
    -     * @type Number
    -     * @default 1
    -     */
    -    this.a = 1;
    -
    -    /**
    -     * @property b
    -     * @type Number
    -     * @default 0
    -     */
    -    this.b = 0;
    -
    -    /**
    -     * @property c
    -     * @type Number
    -     * @default 0
    -     */
    -    this.c = 0;
    -
    -    /**
    -     * @property d
    -     * @type Number
    -     * @default 1
    -     */
    -    this.d = 1;
    -
    -    /**
    -     * @property tx
    -     * @type Number
    -     * @default 0
    -     */
    -    this.tx = 0;
    -
    -    /**
    -     * @property ty
    -     * @type Number
    -     * @default 0
    -     */
    -    this.ty = 0;
    -};
    -
    -/**
    - * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:
    - *
    - * a = array[0]
    - * b = array[1]
    - * c = array[3]
    - * d = array[4]
    - * tx = array[2]
    - * ty = array[5]
    - *
    - * @method fromArray
    - * @param array {Array} The array that the matrix will be populated from.
    - */
    -PIXI.Matrix.prototype.fromArray = function(array)
    -{
    -    this.a = array[0];
    -    this.b = array[1];
    -    this.c = array[3];
    -    this.d = array[4];
    -    this.tx = array[2];
    -    this.ty = array[5];
    -};
    -
    -/**
    - * Creates an array from the current Matrix object.
    - *
    - * @method toArray
    - * @param transpose {Boolean} Whether we need to transpose the matrix or not
    - * @return {Array} the newly created array which contains the matrix
    - */
    -PIXI.Matrix.prototype.toArray = function(transpose)
    -{
    -    if(!this.array) this.array = new PIXI.Float32Array(9);
    -    var array = this.array;
    -
    -    if(transpose)
    -    {
    -        array[0] = this.a;
    -        array[1] = this.b;
    -        array[2] = 0;
    -        array[3] = this.c;
    -        array[4] = this.d;
    -        array[5] = 0;
    -        array[6] = this.tx;
    -        array[7] = this.ty;
    -        array[8] = 1;
    -    }
    -    else
    -    {
    -        array[0] = this.a;
    -        array[1] = this.c;
    -        array[2] = this.tx;
    -        array[3] = this.b;
    -        array[4] = this.d;
    -        array[5] = this.ty;
    -        array[6] = 0;
    -        array[7] = 0;
    -        array[8] = 1;
    -    }
    -
    -    return array;
    -};
    -
    -/**
    - * Get a new position with the current transformation applied.
    - * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)
    - *
    - * @method apply
    - * @param pos {Point} The origin
    - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input)
    - * @return {Point} The new point, transformed through this matrix
    - */
    -PIXI.Matrix.prototype.apply = function(pos, newPos)
    -{
    -    newPos = newPos || new PIXI.Point();
    -
    -    newPos.x = this.a * pos.x + this.c * pos.y + this.tx;
    -    newPos.y = this.b * pos.x + this.d * pos.y + this.ty;
    -
    -    return newPos;
    -};
    -
    -/**
    - * Get a new position with the inverse of the current transformation applied.
    - * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)
    - *
    - * @method applyInverse
    - * @param pos {Point} The origin
    - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input)
    - * @return {Point} The new point, inverse-transformed through this matrix
    - */
    -PIXI.Matrix.prototype.applyInverse = function(pos, newPos)
    -{
    -    newPos = newPos || new PIXI.Point();
    -
    -    var id = 1 / (this.a * this.d + this.c * -this.b);
    -     
    -    newPos.x = this.d * id * pos.x + -this.c * id * pos.y + (this.ty * this.c - this.tx * this.d) * id;
    -    newPos.y = this.a * id * pos.y + -this.b * id * pos.x + (-this.ty * this.a + this.tx * this.b) * id;
    -
    -    return newPos;
    -};
    -
    -/**
    - * Translates the matrix on the x and y.
    - * 
    - * @method translate
    - * @param {Number} x
    - * @param {Number} y
    - * @return {Matrix} This matrix. Good for chaining method calls.
    - **/
    -PIXI.Matrix.prototype.translate = function(x, y)
    -{
    -    this.tx += x;
    -    this.ty += y;
    -    
    -    return this;
    -};
    -
    -/**
    - * Applies a scale transformation to the matrix.
    - * 
    - * @method scale
    - * @param {Number} x The amount to scale horizontally
    - * @param {Number} y The amount to scale vertically
    - * @return {Matrix} This matrix. Good for chaining method calls.
    - **/
    -PIXI.Matrix.prototype.scale = function(x, y)
    -{
    -    this.a *= x;
    -    this.d *= y;
    -    this.c *= x;
    -    this.b *= y;
    -    this.tx *= x;
    -    this.ty *= y;
    -
    -    return this;
    -};
    -
    -
    -/**
    - * Applies a rotation transformation to the matrix.
    - * @method rotate
    - * @param {Number} angle The angle in radians.
    - * @return {Matrix} This matrix. Good for chaining method calls.
    - **/
    -PIXI.Matrix.prototype.rotate = function(angle)
    -{
    -    var cos = Math.cos( angle );
    -    var sin = Math.sin( angle );
    -
    -    var a1 = this.a;
    -    var c1 = this.c;
    -    var tx1 = this.tx;
    -
    -    this.a = a1 * cos-this.b * sin;
    -    this.b = a1 * sin+this.b * cos;
    -    this.c = c1 * cos-this.d * sin;
    -    this.d = c1 * sin+this.d * cos;
    -    this.tx = tx1 * cos - this.ty * sin;
    -    this.ty = tx1 * sin + this.ty * cos;
    - 
    -    return this;
    -};
    -
    -/**
    - * Appends the given Matrix to this Matrix.
    - * 
    - * @method append
    - * @param {Matrix} matrix
    - * @return {Matrix} This matrix. Good for chaining method calls.
    - */
    -PIXI.Matrix.prototype.append = function(matrix)
    -{
    -    var a1 = this.a;
    -    var b1 = this.b;
    -    var c1 = this.c;
    -    var d1 = this.d;
    -
    -    this.a  = matrix.a * a1 + matrix.b * c1;
    -    this.b  = matrix.a * b1 + matrix.b * d1;
    -    this.c  = matrix.c * a1 + matrix.d * c1;
    -    this.d  = matrix.c * b1 + matrix.d * d1;
    -
    -    this.tx = matrix.tx * a1 + matrix.ty * c1 + this.tx;
    -    this.ty = matrix.tx * b1 + matrix.ty * d1 + this.ty;
    -    
    -    return this;
    -};
    -
    -/**
    - * Resets this Matix to an identity (default) matrix.
    - * 
    - * @method identity
    - * @return {Matrix} This matrix. Good for chaining method calls.
    - */
    -PIXI.Matrix.prototype.identity = function()
    -{
    -    this.a = 1;
    -    this.b = 0;
    -    this.c = 0;
    -    this.d = 1;
    -    this.tx = 0;
    -    this.ty = 0;
    -
    -    return this;
    -};
    -
    -PIXI.identityMatrix = new PIXI.Matrix();
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_geom_Point.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_geom_Point.js.html deleted file mode 100755 index c8dfbb2..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_geom_Point.js.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - src/pixi/geom/Point.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Point.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    - *
    - * @class Point
    - * @constructor
    - * @param x {Number} position of the point on the x axis
    - * @param y {Number} position of the point on the y axis
    - */
    -PIXI.Point = function(x, y)
    -{
    -    /**
    -     * @property x
    -     * @type Number
    -     * @default 0
    -     */
    -    this.x = x || 0;
    -
    -    /**
    -     * @property y
    -     * @type Number
    -     * @default 0
    -     */
    -    this.y = y || 0;
    -};
    -
    -/**
    - * Creates a clone of this point
    - *
    - * @method clone
    - * @return {Point} a copy of the point
    - */
    -PIXI.Point.prototype.clone = function()
    -{
    -    return new PIXI.Point(this.x, this.y);
    -};
    -
    -/**
    - * Sets the point to a new x and y position.
    - * If y is omitted, both x and y will be set to x.
    - * 
    - * @method set
    - * @param [x=0] {Number} position of the point on the x axis
    - * @param [y=0] {Number} position of the point on the y axis
    - */
    -PIXI.Point.prototype.set = function(x, y)
    -{
    -    this.x = x || 0;
    -    this.y = y || ( (y !== 0) ? this.x : 0 ) ;
    -};
    -
    -// constructor
    -PIXI.Point.prototype.constructor = PIXI.Point;
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_geom_Polygon.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_geom_Polygon.js.html deleted file mode 100755 index b0bc19f..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_geom_Polygon.js.html +++ /dev/null @@ -1,354 +0,0 @@ - - - - - src/pixi/geom/Polygon.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Polygon.js

    - -
    -
    -/**
    - * @author Adrien Brault <adrien.brault@gmail.com>
    - */
    -
    -/**
    - * @class Polygon
    - * @constructor
    - * @param points* {Array<Point>|Array<Number>|Point...|Number...} This can be an array of Points that form the polygon,
    - *      a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be
    - *      all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the
    - *      arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are
    - *      Numbers.
    - */
    -PIXI.Polygon = function(points)
    -{
    -    //if points isn't an array, use arguments as the array
    -    if(!(points instanceof Array))points = Array.prototype.slice.call(arguments);
    -
    -    //if this is a flat array of numbers, convert it to points
    -    if(points[0] instanceof PIXI.Point)
    -    {
    -        var p = [];
    -        for(var i = 0, il = points.length; i < il; i++)
    -        {
    -            p.push(points[i].x, points[i].y);
    -        }
    -
    -        points = p;
    -    }
    -
    -    this.closed = true;
    -    this.points = points;
    -};
    -
    -/**
    - * Creates a clone of this polygon
    - *
    - * @method clone
    - * @return {Polygon} a copy of the polygon
    - */
    -PIXI.Polygon.prototype.clone = function()
    -{
    -    var points = this.points.slice();
    -    return new PIXI.Polygon(points);
    -};
    -
    -/**
    - * Checks whether the x and y coordinates passed to this function are contained within this polygon
    - *
    - * @method contains
    - * @param x {Number} The X coordinate of the point to test
    - * @param y {Number} The Y coordinate of the point to test
    - * @return {Boolean} Whether the x/y coordinates are within this polygon
    - */
    -PIXI.Polygon.prototype.contains = function(x, y)
    -{
    -    var inside = false;
    -
    -    // use some raycasting to test hits
    -    // https://github.com/substack/point-in-polygon/blob/master/index.js
    -    var length = this.points.length / 2;
    -
    -    for(var i = 0, j = length - 1; i < length; j = i++)
    -    {
    -        var xi = this.points[i * 2], yi = this.points[i * 2 + 1],
    -            xj = this.points[j * 2], yj = this.points[j * 2 + 1],
    -            intersect = ((yi > y) !== (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi);
    -
    -        if(intersect) inside = !inside;
    -    }
    -
    -    return inside;
    -};
    -
    -// constructor
    -PIXI.Polygon.prototype.constructor = PIXI.Polygon;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_geom_Rectangle.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_geom_Rectangle.js.html deleted file mode 100755 index c17bec4..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_geom_Rectangle.js.html +++ /dev/null @@ -1,364 +0,0 @@ - - - - - src/pixi/geom/Rectangle.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/Rectangle.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/
    - */
    -
    -/**
    - * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
    - *
    - * @class Rectangle
    - * @constructor
    - * @param x {Number} The X coordinate of the upper-left corner of the rectangle
    - * @param y {Number} The Y coordinate of the upper-left corner of the rectangle
    - * @param width {Number} The overall width of this rectangle
    - * @param height {Number} The overall height of this rectangle
    - */
    -PIXI.Rectangle = function(x, y, width, height)
    -{
    -    /**
    -     * @property x
    -     * @type Number
    -     * @default 0
    -     */
    -    this.x = x || 0;
    -
    -    /**
    -     * @property y
    -     * @type Number
    -     * @default 0
    -     */
    -    this.y = y || 0;
    -
    -    /**
    -     * @property width
    -     * @type Number
    -     * @default 0
    -     */
    -    this.width = width || 0;
    -
    -    /**
    -     * @property height
    -     * @type Number
    -     * @default 0
    -     */
    -    this.height = height || 0;
    -};
    -
    -/**
    - * Creates a clone of this Rectangle
    - *
    - * @method clone
    - * @return {Rectangle} a copy of the rectangle
    - */
    -PIXI.Rectangle.prototype.clone = function()
    -{
    -    return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    -};
    -
    -/**
    - * Checks whether the x and y coordinates given are contained within this Rectangle
    - *
    - * @method contains
    - * @param x {Number} The X coordinate of the point to test
    - * @param y {Number} The Y coordinate of the point to test
    - * @return {Boolean} Whether the x/y coordinates are within this Rectangle
    - */
    -PIXI.Rectangle.prototype.contains = function(x, y)
    -{
    -    if(this.width <= 0 || this.height <= 0)
    -        return false;
    -
    -    var x1 = this.x;
    -    if(x >= x1 && x <= x1 + this.width)
    -    {
    -        var y1 = this.y;
    -
    -        if(y >= y1 && y <= y1 + this.height)
    -        {
    -            return true;
    -        }
    -    }
    -
    -    return false;
    -};
    -
    -// constructor
    -PIXI.Rectangle.prototype.constructor = PIXI.Rectangle;
    -
    -PIXI.EmptyRectangle = new PIXI.Rectangle(0,0,0,0);
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_geom_RoundedRectangle.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_geom_RoundedRectangle.js.html deleted file mode 100755 index 153da24..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_geom_RoundedRectangle.js.html +++ /dev/null @@ -1,372 +0,0 @@ - - - - - src/pixi/geom/RoundedRectangle.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/geom/RoundedRectangle.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/
    - */
    -
    -/**
    - * the Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height.
    - *
    - * @class Rounded Rectangle
    - * @constructor
    - * @param x {Number} The X coordinate of the upper-left corner of the rounded rectangle
    - * @param y {Number} The Y coordinate of the upper-left corner of the rounded rectangle
    - * @param width {Number} The overall width of this rounded rectangle
    - * @param height {Number} The overall height of this rounded rectangle
    - * @param radius {Number} The overall radius of this corners of this rounded rectangle
    - */
    -PIXI.RoundedRectangle = function(x, y, width, height, radius)
    -{
    -    /**
    -     * @property x
    -     * @type Number
    -     * @default 0
    -     */
    -    this.x = x || 0;
    -
    -    /**
    -     * @property y
    -     * @type Number
    -     * @default 0
    -     */
    -    this.y = y || 0;
    -
    -    /**
    -     * @property width
    -     * @type Number
    -     * @default 0
    -     */
    -    this.width = width || 0;
    -
    -    /**
    -     * @property height
    -     * @type Number
    -     * @default 0
    -     */
    -    this.height = height || 0;
    -
    -    /**
    -     * @property radius
    -     * @type Number
    -     * @default 20
    -     */
    -    this.radius = radius || 20;
    -};
    -
    -/**
    - * Creates a clone of this Rounded Rectangle
    - *
    - * @method clone
    - * @return {rounded Rectangle} a copy of the rounded rectangle
    - */
    -PIXI.RoundedRectangle.prototype.clone = function()
    -{
    -    return new PIXI.RoundedRectangle(this.x, this.y, this.width, this.height, this.radius);
    -};
    -
    -/**
    - * Checks whether the x and y coordinates given are contained within this Rounded Rectangle
    - *
    - * @method contains
    - * @param x {Number} The X coordinate of the point to test
    - * @param y {Number} The Y coordinate of the point to test
    - * @return {Boolean} Whether the x/y coordinates are within this Rounded Rectangle
    - */
    -PIXI.RoundedRectangle.prototype.contains = function(x, y)
    -{
    -    if(this.width <= 0 || this.height <= 0)
    -        return false;
    -
    -    var x1 = this.x;
    -    if(x >= x1 && x <= x1 + this.width)
    -    {
    -        var y1 = this.y;
    -
    -        if(y >= y1 && y <= y1 + this.height)
    -        {
    -            return true;
    -        }
    -    }
    -
    -    return false;
    -};
    -
    -// constructor
    -PIXI.RoundedRectangle.prototype.constructor = PIXI.RoundedRectangle;
    -
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_loaders_AssetLoader.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_loaders_AssetLoader.js.html deleted file mode 100755 index 43a5333..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_loaders_AssetLoader.js.html +++ /dev/null @@ -1,438 +0,0 @@ - - - - - src/pixi/loaders/AssetLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/AssetLoader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * 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
    - * @uses EventTarget
    - * @param assetURLs {Array<String>} 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'.
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.AssetLoader = function(assetURLs, crossorigin)
    -{
    -    /**
    -     * The array of asset URLs that are going to be loaded
    -     *
    -     * @property assetURLs
    -     * @type Array<String>
    -     */
    -    this.assetURLs = assetURLs;
    -
    -    /**
    -     * Whether the requests should be treated as cross origin
    -     *
    -     * @property crossorigin
    -     * @type Boolean
    -     */
    -    this.crossorigin = crossorigin;
    -
    -    /**
    -     * Maps file extension to loader types
    -     *
    -     * @property loadersByType
    -     * @type Object
    -     */
    -    this.loadersByType = {
    -        'jpg':  PIXI.ImageLoader,
    -        'jpeg': PIXI.ImageLoader,
    -        'png':  PIXI.ImageLoader,
    -        'gif':  PIXI.ImageLoader,
    -        'webp': PIXI.ImageLoader,
    -        'json': PIXI.JsonLoader,
    -        'atlas': PIXI.AtlasLoader,
    -        'anim': PIXI.SpineLoader,
    -        'xml':  PIXI.BitmapFontLoader,
    -        'fnt':  PIXI.BitmapFontLoader
    -    };
    -};
    -
    -PIXI.EventTarget.mixin(PIXI.AssetLoader.prototype);
    -
    -/**
    - * Fired when an item has loaded
    - * @event onProgress
    - */
    -
    -/**
    - * Fired when all the assets have loaded
    - * @event onComplete
    - */
    -
    -// constructor
    -PIXI.AssetLoader.prototype.constructor = PIXI.AssetLoader;
    -
    -/**
    - * Given a filename, returns its extension.
    - *
    - * @method _getDataType
    - * @param str {String} the name of the asset
    - */
    -PIXI.AssetLoader.prototype._getDataType = function(str)
    -{
    -    var test = 'data:';
    -    //starts with 'data:'
    -    var start = str.slice(0, test.length).toLowerCase();
    -    if (start === test) {
    -        var data = str.slice(test.length);
    -
    -        var sepIdx = data.indexOf(',');
    -        if (sepIdx === -1) //malformed data URI scheme
    -            return null;
    -
    -        //e.g. 'image/gif;base64' => 'image/gif'
    -        var info = data.slice(0, sepIdx).split(';')[0];
    -
    -        //We might need to handle some special cases here...
    -        //standardize text/plain to 'txt' file extension
    -        if (!info || info.toLowerCase() === 'text/plain')
    -            return 'txt';
    -
    -        //User specified mime type, try splitting it by '/'
    -        return info.split('/').pop().toLowerCase();
    -    }
    -
    -    return null;
    -};
    -
    -/**
    - * Starts loading the assets sequentially
    - *
    - * @method load
    - */
    -PIXI.AssetLoader.prototype.load = function()
    -{
    -    var scope = this;
    -
    -    function onLoad(evt) {
    -        scope.onAssetLoaded(evt.data.content);
    -    }
    -
    -    this.loadCount = this.assetURLs.length;
    -
    -    for (var i=0; i < this.assetURLs.length; i++)
    -    {
    -        var fileName = this.assetURLs[i];
    -        //first see if we have a data URI scheme..
    -        var fileType = this._getDataType(fileName);
    -
    -        //if not, assume it's a file URI
    -        if (!fileType)
    -            fileType = fileName.split('?').shift().split('.').pop().toLowerCase();
    -
    -        var Constructor = this.loadersByType[fileType];
    -        if(!Constructor)
    -            throw new Error(fileType + ' is an unsupported file type');
    -
    -        var loader = new Constructor(fileName, this.crossorigin);
    -
    -        loader.on('loaded', onLoad);
    -        loader.load();
    -    }
    -};
    -
    -/**
    - * Invoked after each file is loaded
    - *
    - * @method onAssetLoaded
    - * @private
    - */
    -PIXI.AssetLoader.prototype.onAssetLoaded = function(loader)
    -{
    -    this.loadCount--;
    -    this.emit('onProgress', { content: this, loader: loader });
    -    if (this.onProgress) this.onProgress(loader);
    -
    -    if (!this.loadCount)
    -    {
    -        this.emit('onComplete', { content: this });
    -        if(this.onComplete) this.onComplete();
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_loaders_AtlasLoader.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_loaders_AtlasLoader.js.html deleted file mode 100755 index 13fc730..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_loaders_AtlasLoader.js.html +++ /dev/null @@ -1,468 +0,0 @@ - - - - - src/pixi/loaders/AtlasLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/AtlasLoader.js

    - -
    -
    -/**
    - * @author Martin Kelm http://mkelm.github.com
    - */
    -
    -/**
    - * The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event.
    - *
    - * To generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format.
    - * 
    - * It is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to 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.fromFrameId()
    - * 
    - * @class AtlasLoader
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the JSON file
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.AtlasLoader = function (url, crossorigin) {
    -    this.url = url;
    -    this.baseUrl = url.replace(/[^\/]*$/, '');
    -    this.crossorigin = crossorigin;
    -    this.loaded = false;
    -
    -};
    -
    -// constructor
    -PIXI.AtlasLoader.constructor = PIXI.AtlasLoader;
    -
    -PIXI.EventTarget.mixin(PIXI.AtlasLoader.prototype);
    -
    - /**
    - * Starts loading the JSON file
    - *
    - * @method load
    - */
    -PIXI.AtlasLoader.prototype.load = function () {
    -    this.ajaxRequest = new PIXI.AjaxRequest();
    -    this.ajaxRequest.onreadystatechange = this.onAtlasLoaded.bind(this);
    -
    -    this.ajaxRequest.open('GET', this.url, true);
    -    if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/json');
    -    this.ajaxRequest.send(null);
    -};
    -
    -/**
    - * Invoked when the Atlas has fully loaded. Parses the JSON and builds the texture frames.
    - * 
    - * @method onAtlasLoaded
    - * @private
    - */
    -PIXI.AtlasLoader.prototype.onAtlasLoaded = function () {
    -    if (this.ajaxRequest.readyState === 4) {
    -        if (this.ajaxRequest.status === 200 || window.location.href.indexOf('http') === -1) {
    -            this.atlas = {
    -                meta : {
    -                    image : []
    -                },
    -                frames : []
    -            };
    -            var result = this.ajaxRequest.responseText.split(/\r?\n/);
    -            var lineCount = -3;
    -
    -            var currentImageId = 0;
    -            var currentFrame = null;
    -            var nameInNextLine = false;
    -
    -            var i = 0,
    -                j = 0,
    -                selfOnLoaded = this.onLoaded.bind(this);
    -
    -            // parser without rotation support yet!
    -            for (i = 0; i < result.length; i++) {
    -                result[i] = result[i].replace(/^\s+|\s+$/g, '');
    -                if (result[i] === '') {
    -                    nameInNextLine = i+1;
    -                }
    -                if (result[i].length > 0) {
    -                    if (nameInNextLine === i) {
    -                        this.atlas.meta.image.push(result[i]);
    -                        currentImageId = this.atlas.meta.image.length - 1;
    -                        this.atlas.frames.push({});
    -                        lineCount = -3;
    -                    } else if (lineCount > 0) {
    -                        if (lineCount % 7 === 1) { // frame name
    -                            if (currentFrame != null) { //jshint ignore:line
    -                                this.atlas.frames[currentImageId][currentFrame.name] = currentFrame;
    -                            }
    -                            currentFrame = { name: result[i], frame : {} };
    -                        } else {
    -                            var text = result[i].split(' ');
    -                            if (lineCount % 7 === 3) { // position
    -                                currentFrame.frame.x = Number(text[1].replace(',', ''));
    -                                currentFrame.frame.y = Number(text[2]);
    -                            } else if (lineCount % 7 === 4) { // size
    -                                currentFrame.frame.w = Number(text[1].replace(',', ''));
    -                                currentFrame.frame.h = Number(text[2]);
    -                            } else if (lineCount % 7 === 5) { // real size
    -                                var realSize = {
    -                                    x : 0,
    -                                    y : 0,
    -                                    w : Number(text[1].replace(',', '')),
    -                                    h : Number(text[2])
    -                                };
    -
    -                                if (realSize.w > currentFrame.frame.w || realSize.h > currentFrame.frame.h) {
    -                                    currentFrame.trimmed = true;
    -                                    currentFrame.realSize = realSize;
    -                                } else {
    -                                    currentFrame.trimmed = false;
    -                                }
    -                            }
    -                        }
    -                    }
    -                    lineCount++;
    -                }
    -            }
    -
    -            if (currentFrame != null) { //jshint ignore:line
    -                this.atlas.frames[currentImageId][currentFrame.name] = currentFrame;
    -            }
    -
    -            if (this.atlas.meta.image.length > 0) {
    -                this.images = [];
    -                for (j = 0; j < this.atlas.meta.image.length; j++) {
    -                    // sprite sheet
    -                    var textureUrl = this.baseUrl + this.atlas.meta.image[j];
    -                    var frameData = this.atlas.frames[j];
    -                    this.images.push(new PIXI.ImageLoader(textureUrl, this.crossorigin));
    -
    -                    for (i in frameData) {
    -                        var rect = frameData[i].frame;
    -                        if (rect) {
    -                            PIXI.TextureCache[i] = new PIXI.Texture(this.images[j].texture.baseTexture, {
    -                                x: rect.x,
    -                                y: rect.y,
    -                                width: rect.w,
    -                                height: rect.h
    -                            });
    -                            if (frameData[i].trimmed) {
    -                                PIXI.TextureCache[i].realSize = frameData[i].realSize;
    -                                // trim in pixi not supported yet, todo update trim properties if it is done ...
    -                                PIXI.TextureCache[i].trim.x = 0;
    -                                PIXI.TextureCache[i].trim.y = 0;
    -                            }
    -                        }
    -                    }
    -                }
    -
    -                this.currentImageId = 0;
    -                for (j = 0; j < this.images.length; j++) {
    -                    this.images[j].on('loaded', selfOnLoaded);
    -                }
    -                this.images[this.currentImageId].load();
    -
    -            } else {
    -                this.onLoaded();
    -            }
    -
    -        } else {
    -            this.onError();
    -        }
    -    }
    -};
    -
    -/**
    - * Invoked when json file has loaded.
    - * 
    - * @method onLoaded
    - * @private
    - */
    -PIXI.AtlasLoader.prototype.onLoaded = function () {
    -    if (this.images.length - 1 > this.currentImageId) {
    -        this.currentImageId++;
    -        this.images[this.currentImageId].load();
    -    } else {
    -        this.loaded = true;
    -        this.emit('loaded', { content: this });
    -    }
    -};
    -
    -/**
    - * Invoked when an error occurs.
    - * 
    - * @method onError
    - * @private
    - */
    -PIXI.AtlasLoader.prototype.onError = function () {
    -    this.emit('error', { content: this });
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_loaders_BitmapFontLoader.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_loaders_BitmapFontLoader.js.html deleted file mode 100755 index 489b3b0..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_loaders_BitmapFontLoader.js.html +++ /dev/null @@ -1,439 +0,0 @@ - - - - - src/pixi/loaders/BitmapFontLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/BitmapFontLoader.js

    - -
    -
    -/**
    - * @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
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the sprite sheet JSON file
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.BitmapFontLoader = function(url, crossorigin)
    -{
    -    /**
    -     * The url of the bitmap font data
    -     *
    -     * @property url
    -     * @type String
    -     */
    -    this.url = url;
    -
    -    /**
    -     * Whether the requests should be treated as cross origin
    -     *
    -     * @property crossorigin
    -     * @type Boolean
    -     */
    -    this.crossorigin = crossorigin;
    -
    -    /**
    -     * [read-only] The base url of the bitmap font data
    -     *
    -     * @property baseUrl
    -     * @type String
    -     * @readOnly
    -     */
    -    this.baseUrl = url.replace(/[^\/]*$/, '');
    -
    -    /**
    -     * [read-only] The texture of the bitmap font
    -     *
    -     * @property texture
    -     * @type Texture
    -     */
    -    this.texture = null;
    -};
    -
    -// constructor
    -PIXI.BitmapFontLoader.prototype.constructor = PIXI.BitmapFontLoader;
    -PIXI.EventTarget.mixin(PIXI.BitmapFontLoader.prototype);
    -
    -/**
    - * Loads the XML font data
    - *
    - * @method load
    - */
    -PIXI.BitmapFontLoader.prototype.load = function()
    -{
    -    this.ajaxRequest = new PIXI.AjaxRequest();
    -    this.ajaxRequest.onreadystatechange = this.onXMLLoaded.bind(this);
    -
    -    this.ajaxRequest.open('GET', this.url, true);
    -    if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/xml');
    -    this.ajaxRequest.send(null);
    -};
    -
    -/**
    - * Invoked when the XML file is loaded, parses the data.
    - *
    - * @method onXMLLoaded
    - * @private
    - */
    -PIXI.BitmapFontLoader.prototype.onXMLLoaded = function()
    -{
    -    if (this.ajaxRequest.readyState === 4)
    -    {
    -        if (this.ajaxRequest.status === 200 || window.location.protocol.indexOf('http') === -1)
    -        {
    -            var responseXML = this.ajaxRequest.responseXML;
    -            if(!responseXML || /MSIE 9/i.test(navigator.userAgent) || navigator.isCocoonJS) {
    -                if(typeof(window.DOMParser) === 'function') {
    -                    var domparser = new DOMParser();
    -                    responseXML = domparser.parseFromString(this.ajaxRequest.responseText, 'text/xml');
    -                } else {
    -                    var div = document.createElement('div');
    -                    div.innerHTML = this.ajaxRequest.responseText;
    -                    responseXML = div;
    -                }
    -            }
    -
    -            var textureUrl = this.baseUrl + responseXML.getElementsByTagName('page')[0].getAttribute('file');
    -            var image = new PIXI.ImageLoader(textureUrl, this.crossorigin);
    -            this.texture = image.texture.baseTexture;
    -
    -            var data = {};
    -            var info = responseXML.getElementsByTagName('info')[0];
    -            var common = responseXML.getElementsByTagName('common')[0];
    -            data.font = info.getAttribute('face');
    -            data.size = parseInt(info.getAttribute('size'), 10);
    -            data.lineHeight = parseInt(common.getAttribute('lineHeight'), 10);
    -            data.chars = {};
    -
    -            //parse letters
    -            var letters = responseXML.getElementsByTagName('char');
    -
    -            for (var i = 0; i < letters.length; i++)
    -            {
    -                var charCode = parseInt(letters[i].getAttribute('id'), 10);
    -
    -                var textureRect = new PIXI.Rectangle(
    -                    parseInt(letters[i].getAttribute('x'), 10),
    -                    parseInt(letters[i].getAttribute('y'), 10),
    -                    parseInt(letters[i].getAttribute('width'), 10),
    -                    parseInt(letters[i].getAttribute('height'), 10)
    -                );
    -
    -                data.chars[charCode] = {
    -                    xOffset: parseInt(letters[i].getAttribute('xoffset'), 10),
    -                    yOffset: parseInt(letters[i].getAttribute('yoffset'), 10),
    -                    xAdvance: parseInt(letters[i].getAttribute('xadvance'), 10),
    -                    kerning: {},
    -                    texture: PIXI.TextureCache[charCode] = new PIXI.Texture(this.texture, textureRect)
    -
    -                };
    -            }
    -
    -            //parse kernings
    -            var kernings = responseXML.getElementsByTagName('kerning');
    -            for (i = 0; i < kernings.length; i++)
    -            {
    -                var first = parseInt(kernings[i].getAttribute('first'), 10);
    -                var second = parseInt(kernings[i].getAttribute('second'), 10);
    -                var amount = parseInt(kernings[i].getAttribute('amount'), 10);
    -
    -                data.chars[second].kerning[first] = amount;
    -
    -            }
    -
    -            PIXI.BitmapText.fonts[data.font] = data;
    -
    -            image.addEventListener('loaded', this.onLoaded.bind(this));
    -            image.load();
    -        }
    -    }
    -};
    -
    -/**
    - * Invoked when all files are loaded (xml/fnt and texture)
    - *
    - * @method onLoaded
    - * @private
    - */
    -PIXI.BitmapFontLoader.prototype.onLoaded = function()
    -{
    -    this.emit('loaded', { content: this });
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_loaders_ImageLoader.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_loaders_ImageLoader.js.html deleted file mode 100755 index 7ca22b2..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_loaders_ImageLoader.js.html +++ /dev/null @@ -1,380 +0,0 @@ - - - - - src/pixi/loaders/ImageLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/ImageLoader.js

    - -
    -
    -/**
    - * @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.fromFrame() and PIXI.Sprite.fromFrame()
    - * When loaded this class will dispatch a 'loaded' event
    - *
    - * @class ImageLoader
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the image
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.ImageLoader = function(url, crossorigin)
    -{
    -    /**
    -     * The texture being loaded
    -     *
    -     * @property texture
    -     * @type Texture
    -     */
    -    this.texture = PIXI.Texture.fromImage(url, crossorigin);
    -
    -    /**
    -     * if the image is loaded with loadFramedSpriteSheet
    -     * frames will contain the sprite sheet frames
    -     *
    -     * @property frames
    -     * @type Array
    -     * @readOnly
    -     */
    -    this.frames = [];
    -};
    -
    -// constructor
    -PIXI.ImageLoader.prototype.constructor = PIXI.ImageLoader;
    -
    -PIXI.EventTarget.mixin(PIXI.ImageLoader.prototype);
    -
    -/**
    - * Loads image or takes it from cache
    - *
    - * @method load
    - */
    -PIXI.ImageLoader.prototype.load = function()
    -{
    -    if(!this.texture.baseTexture.hasLoaded)
    -    {
    -        this.texture.baseTexture.on('loaded', this.onLoaded.bind(this));
    -    }
    -    else
    -    {
    -        this.onLoaded();
    -    }
    -};
    -
    -/**
    - * Invoked when image file is loaded or it is already cached and ready to use
    - *
    - * @method onLoaded
    - * @private
    - */
    -PIXI.ImageLoader.prototype.onLoaded = function()
    -{
    -    this.emit('loaded', { content: this });
    -};
    -
    -/**
    - * Loads image and split it to uniform sized frames
    - *
    - * @method loadFramedSpriteSheet
    - * @param frameWidth {Number} width of each frame
    - * @param frameHeight {Number} height of each frame
    - * @param textureName {String} if given, the frames will be cached in <textureName>-<ord> format
    - */
    -PIXI.ImageLoader.prototype.loadFramedSpriteSheet = function(frameWidth, frameHeight, textureName)
    -{
    -    this.frames = [];
    -    var cols = Math.floor(this.texture.width / frameWidth);
    -    var rows = Math.floor(this.texture.height / frameHeight);
    -
    -    var i=0;
    -    for (var y=0; y<rows; y++)
    -    {
    -        for (var x=0; x<cols; x++,i++)
    -        {
    -            var texture = new PIXI.Texture(this.texture.baseTexture, {
    -                x: x*frameWidth,
    -                y: y*frameHeight,
    -                width: frameWidth,
    -                height: frameHeight
    -            });
    -
    -            this.frames.push(texture);
    -            if (textureName) PIXI.TextureCache[textureName + '-' + i] = texture;
    -        }
    -    }
    -
    -	this.load();
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_loaders_JsonLoader.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_loaders_JsonLoader.js.html deleted file mode 100755 index 0aeaff7..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_loaders_JsonLoader.js.html +++ /dev/null @@ -1,466 +0,0 @@ - - - - - src/pixi/loaders/JsonLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/JsonLoader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The json file loader is used to load in JSON data and parse it
    - * When loaded this class will dispatch a 'loaded' event
    - * If loading fails this class will dispatch an 'error' event
    - *
    - * @class JsonLoader
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the JSON file
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.JsonLoader = function (url, crossorigin) {
    -
    -    /**
    -     * The url of the bitmap font data
    -     *
    -     * @property url
    -     * @type String
    -     */
    -    this.url = url;
    -
    -    /**
    -     * Whether the requests should be treated as cross origin
    -     *
    -     * @property crossorigin
    -     * @type Boolean
    -     */
    -    this.crossorigin = crossorigin;
    -
    -    /**
    -     * [read-only] The base url of the bitmap font data
    -     *
    -     * @property baseUrl
    -     * @type String
    -     * @readOnly
    -     */
    -    this.baseUrl = url.replace(/[^\/]*$/, '');
    -
    -    /**
    -     * [read-only] Whether the data has loaded yet
    -     *
    -     * @property loaded
    -     * @type Boolean
    -     * @readOnly
    -     */
    -    this.loaded = false;
    -
    -};
    -
    -// constructor
    -PIXI.JsonLoader.prototype.constructor = PIXI.JsonLoader;
    -
    -PIXI.EventTarget.mixin(PIXI.JsonLoader.prototype);
    -
    -/**
    - * Loads the JSON data
    - *
    - * @method load
    - */
    -PIXI.JsonLoader.prototype.load = function () {
    -
    -    if(window.XDomainRequest && this.crossorigin)
    -    {
    -        this.ajaxRequest = new window.XDomainRequest();
    -
    -        // XDomainRequest has a few quirks. Occasionally it will abort requests
    -        // A way to avoid this is to make sure ALL callbacks are set even if not used
    -        // More info here: http://stackoverflow.com/questions/15786966/xdomainrequest-aborts-post-on-ie-9
    -        this.ajaxRequest.timeout = 3000;
    -
    -        this.ajaxRequest.onerror = this.onError.bind(this);
    -
    -        this.ajaxRequest.ontimeout = this.onError.bind(this);
    -
    -        this.ajaxRequest.onprogress = function() {};
    -
    -    }
    -    else if (window.XMLHttpRequest)
    -    {
    -        this.ajaxRequest = new window.XMLHttpRequest();
    -    }
    -    else
    -    {
    -        this.ajaxRequest = new window.ActiveXObject('Microsoft.XMLHTTP');
    -    }
    -
    -    this.ajaxRequest.onload = this.onJSONLoaded.bind(this);
    -
    -    this.ajaxRequest.open('GET',this.url,true);
    -
    -    this.ajaxRequest.send();
    -};
    -
    -/**
    - * Invoked when the JSON file is loaded.
    - *
    - * @method onJSONLoaded
    - * @private
    - */
    -PIXI.JsonLoader.prototype.onJSONLoaded = function () {
    -
    -    if(!this.ajaxRequest.responseText )
    -    {
    -        this.onError();
    -        return;
    -    }
    -
    -    this.json = JSON.parse(this.ajaxRequest.responseText);
    -
    -    if(this.json.frames)
    -    {
    -        // sprite sheet
    -        var textureUrl = this.baseUrl + this.json.meta.image;
    -        var image = new PIXI.ImageLoader(textureUrl, this.crossorigin);
    -        var frameData = this.json.frames;
    -
    -        this.texture = image.texture.baseTexture;
    -        image.addEventListener('loaded', this.onLoaded.bind(this));
    -
    -        for (var i in frameData)
    -        {
    -            var rect = frameData[i].frame;
    -
    -            if (rect)
    -            {
    -                var textureSize = new PIXI.Rectangle(rect.x, rect.y, rect.w, rect.h);
    -                var crop = textureSize.clone();
    -                var trim = null;
    -                
    -                //  Check to see if the sprite is trimmed
    -                if (frameData[i].trimmed)
    -                {
    -                    var actualSize = frameData[i].sourceSize;
    -                    var realSize = frameData[i].spriteSourceSize;
    -                    trim = new PIXI.Rectangle(realSize.x, realSize.y, actualSize.w, actualSize.h);
    -                }
    -                PIXI.TextureCache[i] = new PIXI.Texture(this.texture, textureSize, crop, trim);
    -            }
    -        }
    -
    -        image.load();
    -
    -    }
    -    else if(this.json.bones)
    -    {
    -        // spine animation
    -        var spineJsonParser = new spine.SkeletonJson();
    -        var skeletonData = spineJsonParser.readSkeletonData(this.json);
    -        PIXI.AnimCache[this.url] = skeletonData;
    -        this.onLoaded();
    -    }
    -    else
    -    {
    -        this.onLoaded();
    -    }
    -};
    -
    -/**
    - * Invoked when the json file has loaded.
    - *
    - * @method onLoaded
    - * @private
    - */
    -PIXI.JsonLoader.prototype.onLoaded = function () {
    -    this.loaded = true;
    -    this.dispatchEvent({
    -        type: 'loaded',
    -        content: this
    -    });
    -};
    -
    -/**
    - * Invoked if an error occurs.
    - *
    - * @method onError
    - * @private
    - */
    -PIXI.JsonLoader.prototype.onError = function () {
    -
    -    this.dispatchEvent({
    -        type: 'error',
    -        content: this
    -    });
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_loaders_SpineLoader.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_loaders_SpineLoader.js.html deleted file mode 100755 index d56935e..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_loaders_SpineLoader.js.html +++ /dev/null @@ -1,359 +0,0 @@ - - - - - src/pixi/loaders/SpineLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/SpineLoader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * based on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi
    - *
    - * Awesome JS run time provided by EsotericSoftware
    - * https://github.com/EsotericSoftware/spine-runtimes
    - *
    - */
    -
    -/**
    - * The Spine loader is used to load in JSON spine data
    - * To generate the data you need to use http://esotericsoftware.com/ and export in the "JSON" format
    - * Due to a clash of names  You will need to change the extension of the spine file from *.json to *.anim for it to load
    - * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source
    - * You will need to generate a sprite sheet to accompany the spine data
    - * When loaded this class will dispatch a "loaded" event
    - *
    - * @class SpineLoader
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the JSON file
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.SpineLoader = function(url, crossorigin)
    -{
    -    /**
    -     * The url of the bitmap font data
    -     *
    -     * @property url
    -     * @type String
    -     */
    -    this.url = url;
    -
    -    /**
    -     * Whether the requests should be treated as cross origin
    -     *
    -     * @property crossorigin
    -     * @type Boolean
    -     */
    -    this.crossorigin = crossorigin;
    -
    -    /**
    -     * [read-only] Whether the data has loaded yet
    -     *
    -     * @property loaded
    -     * @type Boolean
    -     * @readOnly
    -     */
    -    this.loaded = false;
    -};
    -
    -PIXI.SpineLoader.prototype.constructor = PIXI.SpineLoader;
    -
    -PIXI.EventTarget.mixin(PIXI.SpineLoader.prototype);
    -
    -/**
    - * Loads the JSON data
    - *
    - * @method load
    - */
    -PIXI.SpineLoader.prototype.load = function () {
    -
    -    var scope = this;
    -    var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin);
    -    jsonLoader.on('loaded', function (event) {
    -        scope.json = event.data.content.json;
    -        scope.onLoaded();
    -    });
    -    jsonLoader.load();
    -};
    -
    -/**
    - * Invoked when JSON file is loaded.
    - *
    - * @method onLoaded
    - * @private
    - */
    -PIXI.SpineLoader.prototype.onLoaded = function () {
    -    this.loaded = true;
    -    this.emit('loaded', { content: this });
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_loaders_SpriteSheetLoader.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_loaders_SpriteSheetLoader.js.html deleted file mode 100755 index 60e57df..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_loaders_SpriteSheetLoader.js.html +++ /dev/null @@ -1,372 +0,0 @@ - - - - - src/pixi/loaders/SpriteSheetLoader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/loaders/SpriteSheetLoader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * 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 in 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 a 'texture atlas') as it means sprites 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.fromFrameId()
    - * This loader will load the image file that the Spritesheet points to as well as the data.
    - * When loaded this class will dispatch a 'loaded' event
    - *
    - * @class SpriteSheetLoader
    - * @uses EventTarget
    - * @constructor
    - * @param url {String} The url of the sprite sheet JSON file
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - */
    -PIXI.SpriteSheetLoader = function (url, crossorigin) {
    -
    -    /**
    -     * The url of the atlas data
    -     *
    -     * @property url
    -     * @type String
    -     */
    -    this.url = url;
    -
    -    /**
    -     * Whether the requests should be treated as cross origin
    -     *
    -     * @property crossorigin
    -     * @type Boolean
    -     */
    -    this.crossorigin = crossorigin;
    -
    -    /**
    -     * [read-only] The base url of the bitmap font data
    -     *
    -     * @property baseUrl
    -     * @type String
    -     * @readOnly
    -     */
    -    this.baseUrl = url.replace(/[^\/]*$/, '');
    -
    -    /**
    -     * The texture being loaded
    -     *
    -     * @property texture
    -     * @type Texture
    -     */
    -    this.texture = null;
    -
    -    /**
    -     * The frames of the sprite sheet
    -     *
    -     * @property frames
    -     * @type Object
    -     */
    -    this.frames = {};
    -};
    -
    -// constructor
    -PIXI.SpriteSheetLoader.prototype.constructor = PIXI.SpriteSheetLoader;
    -
    -PIXI.EventTarget.mixin(PIXI.SpriteSheetLoader.prototype);
    -
    -/**
    - * This will begin loading the JSON file
    - *
    - * @method load
    - */
    -PIXI.SpriteSheetLoader.prototype.load = function () {
    -    var scope = this;
    -    var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin);
    -    jsonLoader.on('loaded', function (event) {
    -        scope.json = event.data.content.json;
    -        scope.onLoaded();
    -    });
    -    jsonLoader.load();
    -};
    -
    -/**
    - * Invoke when all files are loaded (json and texture)
    - *
    - * @method onLoaded
    - * @private
    - */
    -PIXI.SpriteSheetLoader.prototype.onLoaded = function () {
    -    this.emit('loaded', {
    -        content: this
    -    });
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_primitives_Graphics.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_primitives_Graphics.js.html deleted file mode 100755 index 4161dd1..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_primitives_Graphics.js.html +++ /dev/null @@ -1,1403 +0,0 @@ - - - - - src/pixi/primitives/Graphics.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/primitives/Graphics.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and color and fill them.
    - * 
    - * @class Graphics
    - * @extends DisplayObjectContainer
    - * @constructor
    - */
    -PIXI.Graphics = function()
    -{
    -    PIXI.DisplayObjectContainer.call( this );
    -
    -    this.renderable = true;
    -
    -    /**
    -     * The alpha value used when filling the Graphics object.
    -     *
    -     * @property fillAlpha
    -     * @type Number
    -     */
    -    this.fillAlpha = 1;
    -
    -    /**
    -     * The width (thickness) of any lines drawn.
    -     *
    -     * @property lineWidth
    -     * @type Number
    -     */
    -    this.lineWidth = 0;
    -
    -    /**
    -     * The color of any lines drawn.
    -     *
    -     * @property lineColor
    -     * @type String
    -     * @default 0
    -     */
    -    this.lineColor = 0;
    -
    -    /**
    -     * Graphics data
    -     *
    -     * @property graphicsData
    -     * @type Array
    -     * @private
    -     */
    -    this.graphicsData = [];
    -
    -    /**
    -     * The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint.
    -     *
    -     * @property tint
    -     * @type Number
    -     * @default 0xFFFFFF
    -     */
    -    this.tint = 0xFFFFFF;
    -    
    -    /**
    -     * The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode.
    -     *
    -     * @property blendMode
    -     * @type Number
    -     * @default PIXI.blendModes.NORMAL;
    -     */
    -    this.blendMode = PIXI.blendModes.NORMAL;
    -    
    -    /**
    -     * Current path
    -     *
    -     * @property currentPath
    -     * @type Object
    -     * @private
    -     */
    -    this.currentPath = null;
    -    
    -    /**
    -     * Array containing some WebGL-related properties used by the WebGL renderer.
    -     *
    -     * @property _webGL
    -     * @type Array
    -     * @private
    -     */
    -    this._webGL = [];
    -
    -    /**
    -     * Whether this shape is being used as a mask.
    -     *
    -     * @property isMask
    -     * @type Boolean
    -     */
    -    this.isMask = false;
    -
    -    /**
    -     * The bounds' padding used for bounds calculation.
    -     *
    -     * @property boundsPadding
    -     * @type Number
    -     */
    -    this.boundsPadding = 0;
    -
    -    this._localBounds = new PIXI.Rectangle(0,0,1,1);
    -
    -    /**
    -     * Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated.
    -     * 
    -     * @property dirty
    -     * @type Boolean
    -     * @private
    -     */
    -    this.dirty = true;
    -
    -    /**
    -     * Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated.
    -     * 
    -     * @property webGLDirty
    -     * @type Boolean
    -     * @private
    -     */
    -    this.webGLDirty = false;
    -
    -    /**
    -     * Used to detect if the cached sprite object needs to be updated.
    -     * 
    -     * @property cachedSpriteDirty
    -     * @type Boolean
    -     * @private
    -     */
    -    this.cachedSpriteDirty = false;
    -
    -};
    -
    -// constructor
    -PIXI.Graphics.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
    -PIXI.Graphics.prototype.constructor = PIXI.Graphics;
    -
    -/**
    - * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite.
    - * This is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory.
    - * It is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas.
    - * This is not recommended if you are constantly redrawing the graphics element.
    - *
    - * @property cacheAsBitmap
    - * @type Boolean
    - * @default false
    - * @private
    - */
    -Object.defineProperty(PIXI.Graphics.prototype, "cacheAsBitmap", {
    -    get: function() {
    -        return  this._cacheAsBitmap;
    -    },
    -    set: function(value) {
    -        this._cacheAsBitmap = value;
    -
    -        if(this._cacheAsBitmap)
    -        {
    -
    -            this._generateCachedSprite();
    -        }
    -        else
    -        {
    -            this.destroyCachedSprite();
    -            this.dirty = true;
    -        }
    -
    -    }
    -});
    -
    -/**
    - * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.
    - *
    - * @method lineStyle
    - * @param lineWidth {Number} width of the line to draw, will update the objects stored style
    - * @param color {Number} color of the line to draw, will update the objects stored style
    - * @param alpha {Number} alpha of the line to draw, will update the objects stored style
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha)
    -{
    -    this.lineWidth = lineWidth || 0;
    -    this.lineColor = color || 0;
    -    this.lineAlpha = (arguments.length < 3) ? 1 : alpha;
    -
    -    if(this.currentPath)
    -    {
    -        if(this.currentPath.shape.points.length)
    -        {
    -            // halfway through a line? start a new one!
    -            this.drawShape( new PIXI.Polygon( this.currentPath.shape.points.slice(-2) ));
    -            return this;
    -        }
    -
    -        // otherwise its empty so lets just set the line properties
    -        this.currentPath.lineWidth = this.lineWidth;
    -        this.currentPath.lineColor = this.lineColor;
    -        this.currentPath.lineAlpha = this.lineAlpha;
    -        
    -    }
    -
    -    return this;
    -};
    -
    -/**
    - * Moves the current drawing position to x, y.
    - *
    - * @method moveTo
    - * @param x {Number} the X coordinate to move to
    - * @param y {Number} the Y coordinate to move to
    - * @return {Graphics}
    -  */
    -PIXI.Graphics.prototype.moveTo = function(x, y)
    -{
    -    this.drawShape(new PIXI.Polygon([x,y]));
    -
    -    return this;
    -};
    -
    -/**
    - * Draws a line using the current line style from the current drawing position to (x, y);
    - * The current drawing position is then set to (x, y).
    - *
    - * @method lineTo
    - * @param x {Number} the X coordinate to draw to
    - * @param y {Number} the Y coordinate to draw to
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.lineTo = function(x, y)
    -{
    -    this.currentPath.shape.points.push(x, y);
    -    this.dirty = true;
    -
    -    return this;
    -};
    -
    -/**
    - * Calculate the points for a quadratic bezier curve and then draws it.
    - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c
    - *
    - * @method quadraticCurveTo
    - * @param cpX {Number} Control point x
    - * @param cpY {Number} Control point y
    - * @param toX {Number} Destination point x
    - * @param toY {Number} Destination point y
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.quadraticCurveTo = function(cpX, cpY, toX, toY)
    -{
    -    if( this.currentPath )
    -    {
    -        if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0];
    -    }
    -    else
    -    {
    -        this.moveTo(0,0);
    -    }
    -
    -    var xa,
    -    ya,
    -    n = 20,
    -    points = this.currentPath.shape.points;
    -    if(points.length === 0)this.moveTo(0, 0);
    -    
    -
    -    var fromX = points[points.length-2];
    -    var fromY = points[points.length-1];
    -
    -    var j = 0;
    -    for (var i = 1; i <= n; i++ )
    -    {
    -        j = i / n;
    -
    -        xa = fromX + ( (cpX - fromX) * j );
    -        ya = fromY + ( (cpY - fromY) * j );
    -
    -        points.push( xa + ( ((cpX + ( (toX - cpX) * j )) - xa) * j ),
    -                     ya + ( ((cpY + ( (toY - cpY) * j )) - ya) * j ) );
    -    }
    -
    -
    -    this.dirty = true;
    -
    -    return this;
    -};
    -
    -/**
    - * Calculate the points for a bezier curve and then draws it.
    - *
    - * @method bezierCurveTo
    - * @param cpX {Number} Control point x
    - * @param cpY {Number} Control point y
    - * @param cpX2 {Number} Second Control point x
    - * @param cpY2 {Number} Second Control point y
    - * @param toX {Number} Destination point x
    - * @param toY {Number} Destination point y
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.bezierCurveTo = function(cpX, cpY, cpX2, cpY2, toX, toY)
    -{
    -    if( this.currentPath )
    -    {
    -        if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0];
    -    }
    -    else
    -    {
    -        this.moveTo(0,0);
    -    }
    -
    -    var n = 20,
    -    dt,
    -    dt2,
    -    dt3,
    -    t2,
    -    t3,
    -    points = this.currentPath.shape.points;
    -
    -    var fromX = points[points.length-2];
    -    var fromY = points[points.length-1];
    -    
    -    var j = 0;
    -
    -    for (var i=1; i<=n; i++)
    -    {
    -        j = i / n;
    -
    -        dt = (1 - j);
    -        dt2 = dt * dt;
    -        dt3 = dt2 * dt;
    -
    -        t2 = j * j;
    -        t3 = t2 * j;
    -        
    -        points.push( dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX,
    -                     dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY);
    -    }
    -    
    -    this.dirty = true;
    -
    -    return this;
    -};
    -
    -/*
    - * The arcTo() method creates an arc/curve between two tangents on the canvas.
    - * 
    - * "borrowed" from https://code.google.com/p/fxcanvas/ - thanks google!
    - *
    - * @method arcTo
    - * @param x1 {Number} The x-coordinate of the beginning of the arc
    - * @param y1 {Number} The y-coordinate of the beginning of the arc
    - * @param x2 {Number} The x-coordinate of the end of the arc
    - * @param y2 {Number} The y-coordinate of the end of the arc
    - * @param radius {Number} The radius of the arc
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.arcTo = function(x1, y1, x2, y2, radius)
    -{
    -    if( this.currentPath )
    -    {
    -        if(this.currentPath.shape.points.length === 0)
    -        {
    -            this.currentPath.shape.points.push(x1, y1);
    -        }
    -    }
    -    else
    -    {
    -        this.moveTo(x1, y1);
    -    }
    -
    -    var points = this.currentPath.shape.points;
    -    var fromX = points[points.length-2];
    -    var fromY = points[points.length-1];
    -    var a1 = fromY - y1;
    -    var b1 = fromX - x1;
    -    var a2 = y2   - y1;
    -    var b2 = x2   - x1;
    -    var mm = Math.abs(a1 * b2 - b1 * a2);
    -
    -
    -    if (mm < 1.0e-8 || radius === 0)
    -    {
    -        if( points[points.length-2] !== x1 || points[points.length-1] !== y1)
    -        {
    -            //console.log(">>")
    -            points.push(x1, y1);
    -        }
    -    }
    -    else
    -    {
    -        var dd = a1 * a1 + b1 * b1;
    -        var cc = a2 * a2 + b2 * b2;
    -        var tt = a1 * a2 + b1 * b2;
    -        var k1 = radius * Math.sqrt(dd) / mm;
    -        var k2 = radius * Math.sqrt(cc) / mm;
    -        var j1 = k1 * tt / dd;
    -        var j2 = k2 * tt / cc;
    -        var cx = k1 * b2 + k2 * b1;
    -        var cy = k1 * a2 + k2 * a1;
    -        var px = b1 * (k2 + j1);
    -        var py = a1 * (k2 + j1);
    -        var qx = b2 * (k1 + j2);
    -        var qy = a2 * (k1 + j2);
    -        var startAngle = Math.atan2(py - cy, px - cx);
    -        var endAngle   = Math.atan2(qy - cy, qx - cx);
    -
    -        this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1);
    -    }
    -
    -    this.dirty = true;
    -
    -    return this;
    -};
    -
    -/**
    - * The arc method creates an arc/curve (used to create circles, or parts of circles).
    - *
    - * @method arc
    - * @param cx {Number} The x-coordinate of the center of the circle
    - * @param cy {Number} The y-coordinate of the center of the circle
    - * @param radius {Number} The radius of the circle
    - * @param startAngle {Number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle)
    - * @param endAngle {Number} The ending angle, in radians
    - * @param anticlockwise {Boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise.
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise)
    -{
    -    var startX = cx + Math.cos(startAngle) * radius;
    -    var startY = cy + Math.sin(startAngle) * radius;
    -   
    -    var points = this.currentPath.shape.points;
    -
    -    if(points.length === 0)
    -    {
    -        this.moveTo(startX, startY);
    -        points = this.currentPath.shape.points;
    -    }
    -    else if( points[points.length-2] !== startX || points[points.length-1] !== startY)
    -    {
    -        points.push(startX, startY);
    -    }
    -  
    -    if (startAngle === endAngle)return this;
    -
    -    if( !anticlockwise && endAngle <= startAngle )
    -    {
    -        endAngle += Math.PI * 2;
    -    }
    -    else if( anticlockwise && startAngle <= endAngle )
    -    {
    -        startAngle += Math.PI * 2;
    -    }
    -
    -    var sweep = anticlockwise ? (startAngle - endAngle) *-1 : (endAngle - startAngle);
    -    var segs =  ( Math.abs(sweep)/ (Math.PI * 2) ) * 40;
    -
    -    if( sweep === 0 ) return this;
    -
    -    var theta = sweep/(segs*2);
    -    var theta2 = theta*2;
    -
    -    var cTheta = Math.cos(theta);
    -    var sTheta = Math.sin(theta);
    -    
    -    var segMinus = segs - 1;
    -
    -    var remainder = ( segMinus % 1 ) / segMinus;
    -
    -    for(var i=0; i<=segMinus; i++)
    -    {
    -        var real =  i + remainder * i;
    -
    -    
    -        var angle = ((theta) + startAngle + (theta2 * real));
    -
    -        var c = Math.cos(angle);
    -        var s = -Math.sin(angle);
    -
    -        points.push(( (cTheta *  c) + (sTheta * s) ) * radius + cx,
    -                    ( (cTheta * -s) + (sTheta * c) ) * radius + cy);
    -    }
    -
    -    this.dirty = true;
    -
    -    return this;
    -};
    -
    -/**
    - * Specifies a simple one-color fill that subsequent calls to other Graphics methods
    - * (such as lineTo() or drawCircle()) use when drawing.
    - *
    - * @method beginFill
    - * @param color {Number} the color of the fill
    - * @param alpha {Number} the alpha of the fill
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.beginFill = function(color, alpha)
    -{
    -    this.filling = true;
    -    this.fillColor = color || 0;
    -    this.fillAlpha = (alpha === undefined) ? 1 : alpha;
    -
    -    if(this.currentPath)
    -    {
    -        if(this.currentPath.shape.points.length <= 2)
    -        {
    -            this.currentPath.fill = this.filling;
    -            this.currentPath.fillColor = this.fillColor;
    -            this.currentPath.fillAlpha = this.fillAlpha;
    -        }
    -    }
    -    return this;
    -};
    -
    -/**
    - * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.
    - *
    - * @method endFill
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.endFill = function()
    -{
    -    this.filling = false;
    -    this.fillColor = null;
    -    this.fillAlpha = 1;
    -
    -    return this;
    -};
    -
    -/**
    - * @method drawRect
    - *
    - * @param x {Number} The X coord of the top-left of the rectangle
    - * @param y {Number} The Y coord of the top-left of the rectangle
    - * @param width {Number} The width of the rectangle
    - * @param height {Number} The height of the rectangle
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.drawRect = function( x, y, width, height )
    -{
    -    this.drawShape(new PIXI.Rectangle(x,y, width, height));
    -
    -    return this;
    -};
    -
    -/**
    - * @method drawRoundedRect
    - *
    - * @param x {Number} The X coord of the top-left of the rectangle
    - * @param y {Number} The Y coord of the top-left of the rectangle
    - * @param width {Number} The width of the rectangle
    - * @param height {Number} The height of the rectangle
    - * @param radius {Number} Radius of the rectangle corners
    - */
    -PIXI.Graphics.prototype.drawRoundedRect = function( x, y, width, height, radius )
    -{
    -    this.drawShape(new PIXI.RoundedRectangle(x, y, width, height, radius));
    -
    -    return this;
    -};
    -
    -/**
    - * Draws a circle.
    - *
    - * @method drawCircle
    - * @param x {Number} The X coordinate of the center of the circle
    - * @param y {Number} The Y coordinate of the center of the circle
    - * @param radius {Number} The radius of the circle
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.drawCircle = function(x, y, radius)
    -{
    -    this.drawShape(new PIXI.Circle(x,y, radius));
    -
    -    return this;
    -};
    -
    -/**
    - * Draws an ellipse.
    - *
    - * @method drawEllipse
    - * @param x {Number} The X coordinate of the center of the ellipse
    - * @param y {Number} The Y coordinate of the center of the ellipse
    - * @param width {Number} The half width of the ellipse
    - * @param height {Number} The half height of the ellipse
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.drawEllipse = function(x, y, width, height)
    -{
    -    this.drawShape(new PIXI.Ellipse(x, y, width, height));
    -
    -    return this;
    -};
    -
    -/**
    - * Draws a polygon using the given path.
    - *
    - * @method drawPolygon
    - * @param path {Array} The path data used to construct the polygon.
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.drawPolygon = function(path)
    -{
    -    if(!(path instanceof Array))path = Array.prototype.slice.call(arguments);
    -    this.drawShape(new PIXI.Polygon(path));
    -    return this;
    -};
    -
    -/**
    - * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.
    - *
    - * @method clear
    - * @return {Graphics}
    - */
    -PIXI.Graphics.prototype.clear = function()
    -{
    -    this.lineWidth = 0;
    -    this.filling = false;
    -
    -    this.dirty = true;
    -    this.clearDirty = true;
    -    this.graphicsData = [];
    -
    -    return this;
    -};
    -
    -/**
    - * Useful function that returns a texture of the graphics object that can then be used to create sprites
    - * This can be quite useful if your geometry is complicated and needs to be reused multiple times.
    - *
    - * @method generateTexture
    - * @param resolution {Number} The resolution of the texture being generated
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @return {Texture} a texture of the graphics object
    - */
    -PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode)
    -{
    -    resolution = resolution || 1;
    -
    -    var bounds = this.getBounds();
    -   
    -    var canvasBuffer = new PIXI.CanvasBuffer(bounds.width * resolution, bounds.height * resolution);
    -    
    -    var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas, scaleMode);
    -    texture.baseTexture.resolution = resolution;
    -
    -    canvasBuffer.context.scale(resolution, resolution);
    -
    -    canvasBuffer.context.translate(-bounds.x,-bounds.y);
    -    
    -    PIXI.CanvasGraphics.renderGraphics(this, canvasBuffer.context);
    -
    -    return texture;
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.Graphics.prototype._renderWebGL = function(renderSession)
    -{
    -    // if the sprite is not visible or the alpha is 0 then no need to render this element
    -    if(this.visible === false || this.alpha === 0 || this.isMask === true)return;
    -
    -    if(this._cacheAsBitmap)
    -    {
    -
    -        if(this.dirty || this.cachedSpriteDirty)
    -        {
    -
    -            this._generateCachedSprite();
    -   
    -            // we will also need to update the texture on the gpu too!
    -            this.updateCachedSpriteTexture();
    -
    -            this.cachedSpriteDirty = false;
    -            this.dirty = false;
    -        }
    -
    -        this._cachedSprite.worldAlpha = this.worldAlpha;
    -        PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession);
    -
    -        return;
    -    }
    -    else
    -    {
    -        renderSession.spriteBatch.stop();
    -        renderSession.blendModeManager.setBlendMode(this.blendMode);
    -
    -        if(this._mask)renderSession.maskManager.pushMask(this._mask, renderSession);
    -        if(this._filters)renderSession.filterManager.pushFilter(this._filterBlock);
    -      
    -        // check blend mode
    -        if(this.blendMode !== renderSession.spriteBatch.currentBlendMode)
    -        {
    -            renderSession.spriteBatch.currentBlendMode = this.blendMode;
    -            var blendModeWebGL = PIXI.blendModesWebGL[renderSession.spriteBatch.currentBlendMode];
    -            renderSession.spriteBatch.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]);
    -        }
    -        
    -        // check if the webgl graphic needs to be updated
    -        if(this.webGLDirty)
    -        {
    -            this.dirty = true;
    -            this.webGLDirty = false;
    -        }
    -        
    -        PIXI.WebGLGraphics.renderGraphics(this, renderSession);
    -        
    -        // only render if it has children!
    -        if(this.children.length)
    -        {
    -            renderSession.spriteBatch.start();
    -
    -             // simple render children!
    -            for(var i=0, j=this.children.length; i<j; i++)
    -            {
    -                this.children[i]._renderWebGL(renderSession);
    -            }
    -
    -            renderSession.spriteBatch.stop();
    -        }
    -
    -        if(this._filters)renderSession.filterManager.popFilter();
    -        if(this._mask)renderSession.maskManager.popMask(this.mask, renderSession);
    -          
    -        renderSession.drawCount++;
    -
    -        renderSession.spriteBatch.start();
    -    }
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.Graphics.prototype._renderCanvas = function(renderSession)
    -{
    -    // if the sprite is not visible or the alpha is 0 then no need to render this element
    -    if(this.visible === false || this.alpha === 0 || this.isMask === true)return;
    -    
    -    if(this._cacheAsBitmap)
    -    {
    -        if(this.dirty || this.cachedSpriteDirty)
    -        {
    -            this._generateCachedSprite();
    -   
    -            // we will also need to update the texture
    -            this.updateCachedSpriteTexture();
    -
    -            this.cachedSpriteDirty = false;
    -            this.dirty = false;
    -        }
    -
    -        this._cachedSprite.alpha = this.alpha;
    -        PIXI.Sprite.prototype._renderCanvas.call(this._cachedSprite, renderSession);
    -
    -        return;
    -    }
    -    else
    -    {
    -        var context = renderSession.context;
    -        var transform = this.worldTransform;
    -        
    -        if(this.blendMode !== renderSession.currentBlendMode)
    -        {
    -            renderSession.currentBlendMode = this.blendMode;
    -            context.globalCompositeOperation = PIXI.blendModesCanvas[renderSession.currentBlendMode];
    -        }
    -
    -        if(this._mask)
    -        {
    -            renderSession.maskManager.pushMask(this._mask, renderSession);
    -        }
    -
    -        var resolution = renderSession.resolution;
    -        context.setTransform(transform.a * resolution,
    -                             transform.b * resolution,
    -                             transform.c * resolution,
    -                             transform.d * resolution,
    -                             transform.tx * resolution,
    -                             transform.ty * resolution);
    -
    -        PIXI.CanvasGraphics.renderGraphics(this, context);
    -
    -         // simple render children!
    -        for(var i=0, j=this.children.length; i<j; i++)
    -        {
    -            this.children[i]._renderCanvas(renderSession);
    -        }
    -
    -        if(this._mask)
    -        {
    -            renderSession.maskManager.popMask(renderSession);
    -        }
    -    }
    -};
    -
    -/**
    - * Retrieves the bounds of the graphic shape as a rectangle object
    - *
    - * @method getBounds
    - * @return {Rectangle} the rectangular bounding area
    - */
    -PIXI.Graphics.prototype.getBounds = function( matrix )
    -{
    -    // return an empty object if the item is a mask!
    -    if(this.isMask)return PIXI.EmptyRectangle;
    -
    -    if(this.dirty)
    -    {
    -        this.updateLocalBounds();
    -        this.webGLDirty = true;
    -        this.cachedSpriteDirty = true;
    -        this.dirty = false;
    -    }
    -
    -    var bounds = this._localBounds;
    -
    -    var w0 = bounds.x;
    -    var w1 = bounds.width + bounds.x;
    -
    -    var h0 = bounds.y;
    -    var h1 = bounds.height + bounds.y;
    -
    -    var worldTransform = matrix || this.worldTransform;
    -
    -    var a = worldTransform.a;
    -    var b = worldTransform.b;
    -    var c = worldTransform.c;
    -    var d = worldTransform.d;
    -    var tx = worldTransform.tx;
    -    var ty = worldTransform.ty;
    -
    -    var x1 = a * w1 + c * h1 + tx;
    -    var y1 = d * h1 + b * w1 + ty;
    -
    -    var x2 = a * w0 + c * h1 + tx;
    -    var y2 = d * h1 + b * w0 + ty;
    -
    -    var x3 = a * w0 + c * h0 + tx;
    -    var y3 = d * h0 + b * w0 + ty;
    -
    -    var x4 =  a * w1 + c * h0 + tx;
    -    var y4 =  d * h0 + b * w1 + ty;
    -
    -    var maxX = x1;
    -    var maxY = y1;
    -
    -    var minX = x1;
    -    var minY = y1;
    -
    -    minX = x2 < minX ? x2 : minX;
    -    minX = x3 < minX ? x3 : minX;
    -    minX = x4 < minX ? x4 : minX;
    -
    -    minY = y2 < minY ? y2 : minY;
    -    minY = y3 < minY ? y3 : minY;
    -    minY = y4 < minY ? y4 : minY;
    -
    -    maxX = x2 > maxX ? x2 : maxX;
    -    maxX = x3 > maxX ? x3 : maxX;
    -    maxX = x4 > maxX ? x4 : maxX;
    -
    -    maxY = y2 > maxY ? y2 : maxY;
    -    maxY = y3 > maxY ? y3 : maxY;
    -    maxY = y4 > maxY ? y4 : maxY;
    -
    -    this._bounds.x = minX;
    -    this._bounds.width = maxX - minX;
    -
    -    this._bounds.y = minY;
    -    this._bounds.height = maxY - minY;
    -
    -    return  this._bounds;
    -};
    -
    -/**
    - * Update the bounds of the object
    - *
    - * @method updateLocalBounds
    - */
    -PIXI.Graphics.prototype.updateLocalBounds = function()
    -{
    -    var minX = Infinity;
    -    var maxX = -Infinity;
    -
    -    var minY = Infinity;
    -    var maxY = -Infinity;
    -
    -    if(this.graphicsData.length)
    -    {
    -        var shape, points, x, y, w, h;
    -
    -        for (var i = 0; i < this.graphicsData.length; i++) {
    -            var data = this.graphicsData[i];
    -            var type = data.type;
    -            var lineWidth = data.lineWidth;
    -            shape = data.shape;
    -           
    -
    -            if(type === PIXI.Graphics.RECT || type === PIXI.Graphics.RREC)
    -            {
    -                x = shape.x - lineWidth/2;
    -                y = shape.y - lineWidth/2;
    -                w = shape.width + lineWidth;
    -                h = shape.height + lineWidth;
    -
    -                minX = x < minX ? x : minX;
    -                maxX = x + w > maxX ? x + w : maxX;
    -
    -                minY = y < minY ? y : minY;
    -                maxY = y + h > maxY ? y + h : maxY;
    -            }
    -            else if(type === PIXI.Graphics.CIRC)
    -            {
    -                x = shape.x;
    -                y = shape.y;
    -                w = shape.radius + lineWidth/2;
    -                h = shape.radius + lineWidth/2;
    -
    -                minX = x - w < minX ? x - w : minX;
    -                maxX = x + w > maxX ? x + w : maxX;
    -
    -                minY = y - h < minY ? y - h : minY;
    -                maxY = y + h > maxY ? y + h : maxY;
    -            }
    -            else if(type === PIXI.Graphics.ELIP)
    -            {
    -                x = shape.x;
    -                y = shape.y;
    -                w = shape.width + lineWidth/2;
    -                h = shape.height + lineWidth/2;
    -
    -                minX = x - w < minX ? x - w : minX;
    -                maxX = x + w > maxX ? x + w : maxX;
    -
    -                minY = y - h < minY ? y - h : minY;
    -                maxY = y + h > maxY ? y + h : maxY;
    -            }
    -            else
    -            {
    -                // POLY
    -                points = shape.points;
    -                
    -                for (var j = 0; j < points.length; j+=2)
    -                {
    -
    -                    x = points[j];
    -                    y = points[j+1];
    -                    minX = x-lineWidth < minX ? x-lineWidth : minX;
    -                    maxX = x+lineWidth > maxX ? x+lineWidth : maxX;
    -
    -                    minY = y-lineWidth < minY ? y-lineWidth : minY;
    -                    maxY = y+lineWidth > maxY ? y+lineWidth : maxY;
    -                }
    -            }
    -        }
    -    }
    -    else
    -    {
    -        minX = 0;
    -        maxX = 0;
    -        minY = 0;
    -        maxY = 0;
    -    }
    -
    -    var padding = this.boundsPadding;
    -    
    -    this._localBounds.x = minX - padding;
    -    this._localBounds.width = (maxX - minX) + padding * 2;
    -
    -    this._localBounds.y = minY - padding;
    -    this._localBounds.height = (maxY - minY) + padding * 2;
    -};
    -
    -/**
    - * Generates the cached sprite when the sprite has cacheAsBitmap = true
    - *
    - * @method _generateCachedSprite
    - * @private
    - */
    -PIXI.Graphics.prototype._generateCachedSprite = function()
    -{
    -    var bounds = this.getLocalBounds();
    -
    -    if(!this._cachedSprite)
    -    {
    -        var canvasBuffer = new PIXI.CanvasBuffer(bounds.width, bounds.height);
    -        var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas);
    -        
    -        this._cachedSprite = new PIXI.Sprite(texture);
    -        this._cachedSprite.buffer = canvasBuffer;
    -
    -        this._cachedSprite.worldTransform = this.worldTransform;
    -    }
    -    else
    -    {
    -        this._cachedSprite.buffer.resize(bounds.width, bounds.height);
    -    }
    -
    -    // leverage the anchor to account for the offset of the element
    -    this._cachedSprite.anchor.x = -( bounds.x / bounds.width );
    -    this._cachedSprite.anchor.y = -( bounds.y / bounds.height );
    -
    -   // this._cachedSprite.buffer.context.save();
    -    this._cachedSprite.buffer.context.translate(-bounds.x,-bounds.y);
    -    
    -    // make sure we set the alpha of the graphics to 1 for the render.. 
    -    this.worldAlpha = 1;
    -
    -    // now render the graphic..
    -    PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context);
    -    this._cachedSprite.alpha = this.alpha;
    -};
    -
    -/**
    - * Updates texture size based on canvas size
    - *
    - * @method updateCachedSpriteTexture
    - * @private
    - */
    -PIXI.Graphics.prototype.updateCachedSpriteTexture = function()
    -{
    -    var cachedSprite = this._cachedSprite;
    -    var texture = cachedSprite.texture;
    -    var canvas = cachedSprite.buffer.canvas;
    -
    -    texture.baseTexture.width = canvas.width;
    -    texture.baseTexture.height = canvas.height;
    -    texture.crop.width = texture.frame.width = canvas.width;
    -    texture.crop.height = texture.frame.height = canvas.height;
    -
    -    cachedSprite._width = canvas.width;
    -    cachedSprite._height = canvas.height;
    -
    -    // update the dirty base textures
    -    texture.baseTexture.dirty();
    -};
    -
    -/**
    - * Destroys a previous cached sprite.
    - *
    - * @method destroyCachedSprite
    - */
    -PIXI.Graphics.prototype.destroyCachedSprite = function()
    -{
    -    this._cachedSprite.texture.destroy(true);
    -
    -    // let the gc collect the unused sprite
    -    // TODO could be object pooled!
    -    this._cachedSprite = null;
    -};
    -
    -/**
    - * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.
    - *
    - * @method drawShape
    - * @param {Circle|Rectangle|Ellipse|Line|Polygon} shape The Shape object to draw.
    - * @return {GraphicsData} The generated GraphicsData object.
    - */
    -PIXI.Graphics.prototype.drawShape = function(shape)
    -{
    -    if(this.currentPath)
    -    {
    -        // check current path!
    -        if(this.currentPath.shape.points.length <= 2)this.graphicsData.pop();
    -    }
    -
    -    this.currentPath = null;
    -
    -    var data = new PIXI.GraphicsData(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, shape);
    -    
    -    this.graphicsData.push(data);
    -    
    -    if(data.type === PIXI.Graphics.POLY)
    -    {
    -        data.shape.closed = this.filling;
    -        this.currentPath = data;
    -    }
    -
    -    this.dirty = true;
    -
    -    return data;
    -};
    -
    -/**
    - * A GraphicsData object.
    - * 
    - * @class GraphicsData
    - * @constructor
    - */
    -PIXI.GraphicsData = function(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, shape)
    -{
    -    this.lineWidth = lineWidth;
    -    this.lineColor = lineColor;
    -    this.lineAlpha = lineAlpha;
    -
    -    this.fillColor = fillColor;
    -    this.fillAlpha = fillAlpha;
    -    this.fill = fill;
    -
    -    this.shape = shape;
    -    this.type = shape.type;
    -};
    -
    -// SOME TYPES:
    -PIXI.Graphics.POLY = 0;
    -PIXI.Graphics.RECT = 1;
    -PIXI.Graphics.CIRC = 2;
    -PIXI.Graphics.ELIP = 3;
    -PIXI.Graphics.RREC = 4;
    -
    -PIXI.Polygon.prototype.type = PIXI.Graphics.POLY;
    -PIXI.Rectangle.prototype.type = PIXI.Graphics.RECT;
    -PIXI.Circle.prototype.type = PIXI.Graphics.CIRC;
    -PIXI.Ellipse.prototype.type = PIXI.Graphics.ELIP;
    -PIXI.RoundedRectangle.prototype.type = PIXI.Graphics.RREC;
    -
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasGraphics.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasGraphics.js.html deleted file mode 100755 index 61eb8da..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasGraphics.js.html +++ /dev/null @@ -1,579 +0,0 @@ - - - - - src/pixi/renderers/canvas/CanvasGraphics.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/canvas/CanvasGraphics.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -
    -/**
    - * A set of functions used by the canvas renderer to draw the primitive graphics data.
    - *
    - * @class CanvasGraphics
    - * @static
    - */
    -PIXI.CanvasGraphics = function()
    -{
    -};
    -
    -/*
    - * Renders a PIXI.Graphics object to a canvas.
    - *
    - * @method renderGraphics
    - * @static
    - * @param graphics {Graphics} the actual graphics object to render
    - * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas
    - */
    -PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
    -{
    -    var worldAlpha = graphics.worldAlpha;
    -    var color = '';
    -
    -    for (var i = 0; i < graphics.graphicsData.length; i++)
    -    {
    -        var data = graphics.graphicsData[i];
    -        var shape = data.shape;
    -
    -        context.strokeStyle = color = '#' + ('00000' + ( data.lineColor | 0).toString(16)).substr(-6);
    -
    -        context.lineWidth = data.lineWidth;
    -
    -        if(data.type === PIXI.Graphics.POLY)
    -        {
    -            context.beginPath();
    -
    -            var points = shape.points;
    -
    -            context.moveTo(points[0], points[1]);
    -
    -            for (var j=1; j < points.length/2; j++)
    -            {
    -                context.lineTo(points[j * 2], points[j * 2 + 1]);
    -            }
    -
    -            if(shape.closed)
    -            {
    -                context.lineTo(points[0], points[1]);
    -            }
    -
    -            // if the first and last point are the same close the path - much neater :)
    -            if(points[0] === points[points.length-2] && points[1] === points[points.length-1])
    -            {
    -                context.closePath();
    -            }
    -
    -            if(data.fill)
    -            {
    -                context.globalAlpha = data.fillAlpha * worldAlpha;
    -                context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
    -                context.fill();
    -            }
    -            if(data.lineWidth)
    -            {
    -                context.globalAlpha = data.lineAlpha * worldAlpha;
    -                context.stroke();
    -            }
    -        }
    -        else if(data.type === PIXI.Graphics.RECT)
    -        {
    -
    -            if(data.fillColor || data.fillColor === 0)
    -            {
    -                context.globalAlpha = data.fillAlpha * worldAlpha;
    -                context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
    -                context.fillRect(shape.x, shape.y, shape.width, shape.height);
    -
    -            }
    -            if(data.lineWidth)
    -            {
    -                context.globalAlpha = data.lineAlpha * worldAlpha;
    -                context.strokeRect(shape.x, shape.y, shape.width, shape.height);
    -            }
    -        }
    -        else if(data.type === PIXI.Graphics.CIRC)
    -        {
    -            // TODO - need to be Undefined!
    -            context.beginPath();
    -            context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI);
    -            context.closePath();
    -
    -            if(data.fill)
    -            {
    -                context.globalAlpha = data.fillAlpha * worldAlpha;
    -                context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
    -                context.fill();
    -            }
    -            if(data.lineWidth)
    -            {
    -                context.globalAlpha = data.lineAlpha * worldAlpha;
    -                context.stroke();
    -            }
    -        }
    -        else if(data.type === PIXI.Graphics.ELIP)
    -        {
    -            // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas
    -
    -            var w = shape.width * 2;
    -            var h = shape.height * 2;
    -
    -            var x = shape.x - w/2;
    -            var y = shape.y - h/2;
    -
    -            context.beginPath();
    -
    -            var kappa = 0.5522848,
    -                ox = (w / 2) * kappa, // control point offset horizontal
    -                oy = (h / 2) * kappa, // control point offset vertical
    -                xe = x + w,           // x-end
    -                ye = y + h,           // y-end
    -                xm = x + w / 2,       // x-middle
    -                ym = y + h / 2;       // y-middle
    -
    -            context.moveTo(x, ym);
    -            context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
    -            context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
    -            context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
    -            context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
    -
    -            context.closePath();
    -
    -            if(data.fill)
    -            {
    -                context.globalAlpha = data.fillAlpha * worldAlpha;
    -                context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
    -                context.fill();
    -            }
    -            if(data.lineWidth)
    -            {
    -                context.globalAlpha = data.lineAlpha * worldAlpha;
    -                context.stroke();
    -            }
    -        }
    -        else if (data.type === PIXI.Graphics.RREC)
    -        {
    -            var rx = shape.x;
    -            var ry = shape.y;
    -            var width = shape.width;
    -            var height = shape.height;
    -            var radius = shape.radius;
    -
    -            var maxRadius = Math.min(width, height) / 2 | 0;
    -            radius = radius > maxRadius ? maxRadius : radius;
    -
    -            context.beginPath();
    -            context.moveTo(rx, ry + radius);
    -            context.lineTo(rx, ry + height - radius);
    -            context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height);
    -            context.lineTo(rx + width - radius, ry + height);
    -            context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius);
    -            context.lineTo(rx + width, ry + radius);
    -            context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry);
    -            context.lineTo(rx + radius, ry);
    -            context.quadraticCurveTo(rx, ry, rx, ry + radius);
    -            context.closePath();
    -
    -            if(data.fillColor || data.fillColor === 0)
    -            {
    -                context.globalAlpha = data.fillAlpha * worldAlpha;
    -                context.fillStyle = color = '#' + ('00000' + ( data.fillColor | 0).toString(16)).substr(-6);
    -                context.fill();
    -
    -            }
    -            if(data.lineWidth)
    -            {
    -                context.globalAlpha = data.lineAlpha * worldAlpha;
    -                context.stroke();
    -            }
    -        }
    -    }
    -};
    -
    -/*
    - * Renders a graphics mask
    - *
    - * @static
    - * @private
    - * @method renderGraphicsMask
    - * @param graphics {Graphics} the graphics which will be used as a mask
    - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas
    - */
    -PIXI.CanvasGraphics.renderGraphicsMask = function(graphics, context)
    -{
    -    var len = graphics.graphicsData.length;
    -
    -    if(len === 0) return;
    -
    -    if(len > 1)
    -    {
    -        len = 1;
    -        window.console.log('Pixi.js warning: masks in canvas can only mask using the first path in the graphics object');
    -    }
    -
    -    for (var i = 0; i < 1; i++)
    -    {
    -        var data = graphics.graphicsData[i];
    -        var shape = data.shape;
    -
    -        if(data.type === PIXI.Graphics.POLY)
    -        {
    -            context.beginPath();
    -        
    -            var points = shape.points;
    -        
    -            context.moveTo(points[0], points[1]);
    -
    -            for (var j=1; j < points.length/2; j++)
    -            {
    -                context.lineTo(points[j * 2], points[j * 2 + 1]);
    -            }
    -
    -            // if the first and last point are the same close the path - much neater :)
    -            if(points[0] === points[points.length-2] && points[1] === points[points.length-1])
    -            {
    -                context.closePath();
    -            }
    -
    -        }
    -        else if(data.type === PIXI.Graphics.RECT)
    -        {
    -            context.beginPath();
    -            context.rect(shape.x, shape.y, shape.width, shape.height);
    -            context.closePath();
    -        }
    -        else if(data.type === PIXI.Graphics.CIRC)
    -        {
    -            // TODO - need to be Undefined!
    -            context.beginPath();
    -            context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI);
    -            context.closePath();
    -        }
    -        else if(data.type === PIXI.Graphics.ELIP)
    -        {
    -
    -            // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas
    -
    -            var w = shape.width * 2;
    -            var h = shape.height * 2;
    -
    -            var x = shape.x - w/2;
    -            var y = shape.y - h/2;
    -
    -            context.beginPath();
    -
    -            var kappa = 0.5522848,
    -                ox = (w / 2) * kappa, // control point offset horizontal
    -                oy = (h / 2) * kappa, // control point offset vertical
    -                xe = x + w,           // x-end
    -                ye = y + h,           // y-end
    -                xm = x + w / 2,       // x-middle
    -                ym = y + h / 2;       // y-middle
    -
    -            context.moveTo(x, ym);
    -            context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
    -            context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
    -            context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
    -            context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
    -            context.closePath();
    -        }
    -        else if (data.type === PIXI.Graphics.RREC)
    -        {
    -        
    -            var pts = shape.points;
    -            var rx = pts[0];
    -            var ry = pts[1];
    -            var width = pts[2];
    -            var height = pts[3];
    -            var radius = pts[4];
    -
    -            var maxRadius = Math.min(width, height) / 2 | 0;
    -            radius = radius > maxRadius ? maxRadius : radius;
    -
    -            context.beginPath();
    -            context.moveTo(rx, ry + radius);
    -            context.lineTo(rx, ry + height - radius);
    -            context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height);
    -            context.lineTo(rx + width - radius, ry + height);
    -            context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius);
    -            context.lineTo(rx + width, ry + radius);
    -            context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry);
    -            context.lineTo(rx + radius, ry);
    -            context.quadraticCurveTo(rx, ry, rx, ry + radius);
    -            context.closePath();
    -        }
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasRenderer.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasRenderer.js.html deleted file mode 100755 index 0cc3085..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_canvas_CanvasRenderer.js.html +++ /dev/null @@ -1,623 +0,0 @@ - - - - - src/pixi/renderers/canvas/CanvasRenderer.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/canvas/CanvasRenderer.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * The CanvasRenderer draws the Stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL.
    - * Don't forget to add the CanvasRenderer.view to your DOM or you will not see anything :)
    - *
    - * @class CanvasRenderer
    - * @constructor
    - * @param [width=800] {Number} the width of the canvas view
    - * @param [height=600] {Number} the height of the canvas view
    - * @param [options] {Object} The optional renderer parameters
    - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional
    - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false
    - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false
    - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2
    - * @param [options.clearBeforeRender=true] {Boolean} This sets if the CanvasRenderer will clear the canvas or not before the new render pass.
    - */
    -PIXI.CanvasRenderer = function(width, height, options)
    -{
    -    if(options)
    -    {
    -        for (var i in PIXI.defaultRenderOptions)
    -        {
    -            if (typeof options[i] === "undefined") options[i] = PIXI.defaultRenderOptions[i];
    -        }
    -    }
    -    else
    -    {
    -        options = PIXI.defaultRenderOptions;
    -    }
    -
    -    if(!PIXI.defaultRenderer)
    -    {
    -        PIXI.sayHello("Canvas");
    -        PIXI.defaultRenderer = this;
    -    }
    -
    -    /**
    -     * The renderer type.
    -     *
    -     * @property type
    -     * @type Number
    -     */
    -    this.type = PIXI.CANVAS_RENDERER;
    -
    -    /**
    -     * The resolution of the canvas.
    -     *
    -     * @property resolution
    -     * @type Number
    -     */
    -    this.resolution = options.resolution;
    -
    -    /**
    -     * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.
    -     * If the Stage is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.
    -     * If the Stage is transparent Pixi will use clearRect to clear the canvas every frame.
    -     * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.
    -     *
    -     * @property clearBeforeRender
    -     * @type Boolean
    -     * @default
    -     */
    -    this.clearBeforeRender = options.clearBeforeRender;
    -
    -    /**
    -     * Whether the render view is transparent
    -     *
    -     * @property transparent
    -     * @type Boolean
    -     */
    -    this.transparent = options.transparent;
    -
    -    /**
    -     * Whether the render view should be resized automatically
    -     *
    -     * @property autoResize
    -     * @type Boolean
    -     */
    -    this.autoResize = options.autoResize || false;
    -
    -
    -    /**
    -     * The width of the canvas view
    -     *
    -     * @property width
    -     * @type Number
    -     * @default 800
    -     */
    -    this.width = width || 800;
    -
    -    /**
    -     * The height of the canvas view
    -     *
    -     * @property height
    -     * @type Number
    -     * @default 600
    -     */
    -    this.height = height || 600;
    -
    -    this.width *= this.resolution;
    -    this.height *= this.resolution;
    -
    -    /**
    -     * The canvas element that everything is drawn to.
    -     *
    -     * @property view
    -     * @type HTMLCanvasElement
    -     */
    -    this.view = options.view || document.createElement( "canvas" );
    -
    -    /**
    -     * The canvas 2d context that everything is drawn with
    -     * @property context
    -     * @type CanvasRenderingContext2D
    -     */
    -    this.context = this.view.getContext( "2d", { alpha: this.transparent } );
    -
    -    /**
    -     * Boolean flag controlling canvas refresh.
    -     *
    -     * @property refresh
    -     * @type Boolean
    -     */
    -    this.refresh = true;
    -
    -    this.view.width = this.width * this.resolution;
    -    this.view.height = this.height * this.resolution;
    -
    -    /**
    -     * Internal var.
    -     *
    -     * @property count
    -     * @type Number
    -     */
    -    this.count = 0;
    -
    -    /**
    -     * Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer
    -     * @property CanvasMaskManager
    -     * @type CanvasMaskManager
    -     */
    -    this.maskManager = new PIXI.CanvasMaskManager();
    -
    -    /**
    -     * The render session is just a bunch of parameter used for rendering
    -     * @property renderSession
    -     * @type Object
    -     */
    -    this.renderSession = {
    -        context: this.context,
    -        maskManager: this.maskManager,
    -        scaleMode: null,
    -        smoothProperty: null,
    -        /**
    -         * If true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation.
    -         * Handy for crisp pixel art and speed on legacy devices.
    -         *
    -         */
    -        roundPixels: false
    -    };
    -
    -    this.mapBlendModes();
    -    
    -    this.resize(width, height);
    -
    -    if("imageSmoothingEnabled" in this.context)
    -        this.renderSession.smoothProperty = "imageSmoothingEnabled";
    -    else if("webkitImageSmoothingEnabled" in this.context)
    -        this.renderSession.smoothProperty = "webkitImageSmoothingEnabled";
    -    else if("mozImageSmoothingEnabled" in this.context)
    -        this.renderSession.smoothProperty = "mozImageSmoothingEnabled";
    -    else if("oImageSmoothingEnabled" in this.context)
    -        this.renderSession.smoothProperty = "oImageSmoothingEnabled";
    -    else if ("msImageSmoothingEnabled" in this.context)
    -        this.renderSession.smoothProperty = "msImageSmoothingEnabled";
    -};
    -
    -// constructor
    -PIXI.CanvasRenderer.prototype.constructor = PIXI.CanvasRenderer;
    -
    -/**
    - * Renders the Stage to this canvas view
    - *
    - * @method render
    - * @param stage {Stage} the Stage element to be rendered
    - */
    -PIXI.CanvasRenderer.prototype.render = function(stage)
    -{
    -    stage.updateTransform();
    -
    -    this.context.setTransform(1,0,0,1,0,0);
    -
    -    this.context.globalAlpha = 1;
    -
    -    this.renderSession.currentBlendMode = PIXI.blendModes.NORMAL;
    -    this.context.globalCompositeOperation = PIXI.blendModesCanvas[PIXI.blendModes.NORMAL];
    -
    -    if (navigator.isCocoonJS && this.view.screencanvas) {
    -        this.context.fillStyle = "black";
    -        this.context.clear();
    -    }
    -    
    -    if (this.clearBeforeRender)
    -    {
    -        if (this.transparent)
    -        {
    -            this.context.clearRect(0, 0, this.width, this.height);
    -        }
    -        else
    -        {
    -            this.context.fillStyle = stage.backgroundColorString;
    -            this.context.fillRect(0, 0, this.width , this.height);
    -        }
    -    }
    -    
    -    this.renderDisplayObject(stage);
    -
    -    // run interaction!
    -    if(stage.interactive)
    -    {
    -        //need to add some events!
    -        if(!stage._interactiveEventsAdded)
    -        {
    -            stage._interactiveEventsAdded = true;
    -            stage.interactionManager.setTarget(this);
    -        }
    -    }
    -};
    -
    -/**
    - * Removes everything from the renderer and optionally removes the Canvas DOM element.
    - *
    - * @method destroy
    - * @param [removeView=true] {boolean} Removes the Canvas element from the DOM.
    - */
    -PIXI.CanvasRenderer.prototype.destroy = function(removeView)
    -{
    -    if (typeof removeView === "undefined") { removeView = true; }
    -
    -    if (removeView && this.view.parent)
    -    {
    -        this.view.parent.removeChild(this.view);
    -    }
    -
    -    this.view = null;
    -    this.context = null;
    -    this.maskManager = null;
    -    this.renderSession = null;
    -
    -};
    -
    -/**
    - * Resizes the canvas view to the specified width and height
    - *
    - * @method resize
    - * @param width {Number} the new width of the canvas view
    - * @param height {Number} the new height of the canvas view
    - */
    -PIXI.CanvasRenderer.prototype.resize = function(width, height)
    -{
    -    this.width = width * this.resolution;
    -    this.height = height * this.resolution;
    -
    -    this.view.width = this.width;
    -    this.view.height = this.height;
    -
    -    if (this.autoResize) {
    -        this.view.style.width = this.width / this.resolution + "px";
    -        this.view.style.height = this.height / this.resolution + "px";
    -    }
    -};
    -
    -/**
    - * Renders a display object
    - *
    - * @method renderDisplayObject
    - * @param displayObject {DisplayObject} The displayObject to render
    - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas
    - * @private
    - */
    -PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject, context)
    -{
    -    this.renderSession.context = context || this.context;
    -    this.renderSession.resolution = this.resolution;
    -    displayObject._renderCanvas(this.renderSession);
    -};
    -
    -/**
    - * Maps Pixi blend modes to canvas blend modes.
    - *
    - * @method mapBlendModes
    - * @private
    - */
    -PIXI.CanvasRenderer.prototype.mapBlendModes = function()
    -{
    -    if(!PIXI.blendModesCanvas)
    -    {
    -        PIXI.blendModesCanvas = [];
    -
    -        if(PIXI.canUseNewCanvasBlendModes())
    -        {
    -            PIXI.blendModesCanvas[PIXI.blendModes.NORMAL]   = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.ADD]      = "lighter"; //IS THIS OK???
    -            PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "multiply";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SCREEN]   = "screen";
    -            PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY]  = "overlay";
    -            PIXI.blendModesCanvas[PIXI.blendModes.DARKEN]   = "darken";
    -            PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN]  = "lighten";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "color-dodge";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "color-burn";
    -            PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "hard-light";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "soft-light";
    -            PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "difference";
    -            PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "exclusion";
    -            PIXI.blendModesCanvas[PIXI.blendModes.HUE]       = "hue";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "saturation";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR]      = "color";
    -            PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "luminosity";
    -        }
    -        else
    -        {
    -            // this means that the browser does not support the cool new blend modes in canvas "cough" ie "cough"
    -            PIXI.blendModesCanvas[PIXI.blendModes.NORMAL]   = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.ADD]      = "lighter"; //IS THIS OK???
    -            PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SCREEN]   = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY]  = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.DARKEN]   = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN]  = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.HUE]       = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.COLOR]      = "source-over";
    -            PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "source-over";
    -        }
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasBuffer.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasBuffer.js.html deleted file mode 100755 index 1705871..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasBuffer.js.html +++ /dev/null @@ -1,354 +0,0 @@ - - - - - src/pixi/renderers/canvas/utils/CanvasBuffer.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/canvas/utils/CanvasBuffer.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * Creates a Canvas element of the given size.
    - *
    - * @class CanvasBuffer
    - * @constructor
    - * @param width {Number} the width for the newly created canvas
    - * @param height {Number} the height for the newly created canvas
    - */
    -PIXI.CanvasBuffer = function(width, height)
    -{
    -    /**
    -     * The width of the Canvas in pixels.
    -     *
    -     * @property width
    -     * @type Number
    -     */
    -    this.width = width;
    -
    -    /**
    -     * The height of the Canvas in pixels.
    -     *
    -     * @property height
    -     * @type Number
    -     */
    -    this.height = height;
    -
    -    /**
    -     * The Canvas object that belongs to this CanvasBuffer.
    -     *
    -     * @property canvas
    -     * @type HTMLCanvasElement
    -     */
    -    this.canvas = document.createElement("canvas");
    -
    -    /**
    -     * A CanvasRenderingContext2D object representing a two-dimensional rendering context.
    -     *
    -     * @property context
    -     * @type CanvasRenderingContext2D
    -     */
    -    this.context = this.canvas.getContext("2d");
    -
    -    this.canvas.width = width;
    -    this.canvas.height = height;
    -};
    -
    -PIXI.CanvasBuffer.prototype.constructor = PIXI.CanvasBuffer;
    -
    -/**
    - * Clears the canvas that was created by the CanvasBuffer class.
    - *
    - * @method clear
    - * @private
    - */
    -PIXI.CanvasBuffer.prototype.clear = function()
    -{
    -    this.context.setTransform(1, 0, 0, 1, 0, 0);
    -    this.context.clearRect(0,0, this.width, this.height);
    -};
    -
    -/**
    - * Resizes the canvas to the specified width and height.
    - *
    - * @method resize
    - * @param width {Number} the new width of the canvas
    - * @param height {Number} the new height of the canvas
    - */
    -PIXI.CanvasBuffer.prototype.resize = function(width, height)
    -{
    -    this.width = this.canvas.width = width;
    -    this.height = this.canvas.height = height;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasMaskManager.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasMaskManager.js.html deleted file mode 100755 index a4c4114..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasMaskManager.js.html +++ /dev/null @@ -1,336 +0,0 @@ - - - - - src/pixi/renderers/canvas/utils/CanvasMaskManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/canvas/utils/CanvasMaskManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A set of functions used to handle masking.
    - *
    - * @class CanvasMaskManager
    - * @constructor
    - */
    -PIXI.CanvasMaskManager = function()
    -{
    -};
    -
    -PIXI.CanvasMaskManager.prototype.constructor = PIXI.CanvasMaskManager;
    -
    -/**
    - * This method adds it to the current stack of masks.
    - *
    - * @method pushMask
    - * @param maskData {Object} the maskData that will be pushed
    - * @param renderSession {Object} The renderSession whose context will be used for this mask manager.
    - */
    -PIXI.CanvasMaskManager.prototype.pushMask = function(maskData, renderSession)
    -{
    -	var context = renderSession.context;
    -
    -    context.save();
    -    
    -    var cacheAlpha = maskData.alpha;
    -    var transform = maskData.worldTransform;
    -
    -    var resolution = renderSession.resolution;
    -
    -    context.setTransform(transform.a * resolution,
    -                         transform.b * resolution,
    -                         transform.c * resolution,
    -                         transform.d * resolution,
    -                         transform.tx * resolution,
    -                         transform.ty * resolution);
    -
    -    PIXI.CanvasGraphics.renderGraphicsMask(maskData, context);
    -
    -    context.clip();
    -
    -    maskData.worldAlpha = cacheAlpha;
    -};
    -
    -/**
    - * Restores the current drawing context to the state it was before the mask was applied.
    - *
    - * @method popMask
    - * @param renderSession {Object} The renderSession whose context will be used for this mask manager.
    - */
    -PIXI.CanvasMaskManager.prototype.popMask = function(renderSession)
    -{
    -    renderSession.context.restore();
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasTinter.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasTinter.js.html deleted file mode 100755 index 679a98c..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_canvas_utils_CanvasTinter.js.html +++ /dev/null @@ -1,510 +0,0 @@ - - - - - src/pixi/renderers/canvas/utils/CanvasTinter.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/canvas/utils/CanvasTinter.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * @class CanvasTinter
    - * @constructor
    - * @static
    - */
    -PIXI.CanvasTinter = function()
    -{
    -};
    -
    -/**
    - * Basically this method just needs a sprite and a color and tints the sprite with the given color.
    - * 
    - * @method getTintedTexture 
    - * @param sprite {Sprite} the sprite to tint
    - * @param color {Number} the color to use to tint the sprite with
    - * @return {HTMLCanvasElement} The tinted canvas
    - */
    -PIXI.CanvasTinter.getTintedTexture = function(sprite, color)
    -{
    -    var texture = sprite.texture;
    -
    -    color = PIXI.CanvasTinter.roundColor(color);
    -
    -    var stringColor = "#" + ("00000" + ( color | 0).toString(16)).substr(-6);
    -   
    -    texture.tintCache = texture.tintCache || {};
    -
    -    if(texture.tintCache[stringColor]) return texture.tintCache[stringColor];
    -
    -     // clone texture..
    -    var canvas = PIXI.CanvasTinter.canvas || document.createElement("canvas");
    -    
    -    //PIXI.CanvasTinter.tintWithPerPixel(texture, stringColor, canvas);
    -    PIXI.CanvasTinter.tintMethod(texture, color, canvas);
    -
    -    if(PIXI.CanvasTinter.convertTintToImage)
    -    {
    -        // is this better?
    -        var tintImage = new Image();
    -        tintImage.src = canvas.toDataURL();
    -
    -        texture.tintCache[stringColor] = tintImage;
    -    }
    -    else
    -    {
    -        texture.tintCache[stringColor] = canvas;
    -        // if we are not converting the texture to an image then we need to lose the reference to the canvas
    -        PIXI.CanvasTinter.canvas = null;
    -    }
    -
    -    return canvas;
    -};
    -
    -/**
    - * Tint a texture using the "multiply" operation.
    - * 
    - * @method tintWithMultiply
    - * @param texture {Texture} the texture to tint
    - * @param color {Number} the color to use to tint the sprite with
    - * @param canvas {HTMLCanvasElement} the current canvas
    - */
    -PIXI.CanvasTinter.tintWithMultiply = function(texture, color, canvas)
    -{
    -    var context = canvas.getContext( "2d" );
    -
    -    var crop = texture.crop;
    -
    -    canvas.width = crop.width;
    -    canvas.height = crop.height;
    -
    -    context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6);
    -    
    -    context.fillRect(0, 0, crop.width, crop.height);
    -    
    -    context.globalCompositeOperation = "multiply";
    -
    -    context.drawImage(texture.baseTexture.source,
    -                           crop.x,
    -                           crop.y,
    -                           crop.width,
    -                           crop.height,
    -                           0,
    -                           0,
    -                           crop.width,
    -                           crop.height);
    -
    -    context.globalCompositeOperation = "destination-atop";
    -
    -    context.drawImage(texture.baseTexture.source,
    -                           crop.x,
    -                           crop.y,
    -                           crop.width,
    -                           crop.height,
    -                           0,
    -                           0,
    -                           crop.width,
    -                           crop.height);
    -};
    -
    -/**
    - * Tint a texture using the "overlay" operation.
    - * 
    - * @method tintWithOverlay
    - * @param texture {Texture} the texture to tint
    - * @param color {Number} the color to use to tint the sprite with
    - * @param canvas {HTMLCanvasElement} the current canvas
    - */
    -PIXI.CanvasTinter.tintWithOverlay = function(texture, color, canvas)
    -{
    -    var context = canvas.getContext( "2d" );
    -
    -    var crop = texture.crop;
    -
    -    canvas.width = crop.width;
    -    canvas.height = crop.height;
    -    
    -    context.globalCompositeOperation = "copy";
    -    context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6);
    -    context.fillRect(0, 0, crop.width, crop.height);
    -
    -    context.globalCompositeOperation = "destination-atop";
    -    context.drawImage(texture.baseTexture.source,
    -                           crop.x,
    -                           crop.y,
    -                           crop.width,
    -                           crop.height,
    -                           0,
    -                           0,
    -                           crop.width,
    -                           crop.height);
    -    
    -    //context.globalCompositeOperation = "copy";
    -};
    -
    -/**
    - * Tint a texture pixel per pixel.
    - * 
    - * @method tintPerPixel
    - * @param texture {Texture} the texture to tint
    - * @param color {Number} the color to use to tint the sprite with
    - * @param canvas {HTMLCanvasElement} the current canvas
    - */
    -PIXI.CanvasTinter.tintWithPerPixel = function(texture, color, canvas)
    -{
    -    var context = canvas.getContext( "2d" );
    -
    -    var crop = texture.crop;
    -
    -    canvas.width = crop.width;
    -    canvas.height = crop.height;
    -  
    -    context.globalCompositeOperation = "copy";
    -    context.drawImage(texture.baseTexture.source,
    -                           crop.x,
    -                           crop.y,
    -                           crop.width,
    -                           crop.height,
    -                           0,
    -                           0,
    -                           crop.width,
    -                           crop.height);
    -
    -    var rgbValues = PIXI.hex2rgb(color);
    -    var r = rgbValues[0], g = rgbValues[1], b = rgbValues[2];
    -
    -    var pixelData = context.getImageData(0, 0, crop.width, crop.height);
    -
    -    var pixels = pixelData.data;
    -
    -    for (var i = 0; i < pixels.length; i += 4)
    -    {
    -        pixels[i+0] *= r;
    -        pixels[i+1] *= g;
    -        pixels[i+2] *= b;
    -    }
    -
    -    context.putImageData(pixelData, 0, 0);
    -};
    -
    -/**
    - * Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel.
    - * 
    - * @method roundColor
    - * @param color {number} the color to round, should be a hex color
    - */
    -PIXI.CanvasTinter.roundColor = function(color)
    -{
    -    var step = PIXI.CanvasTinter.cacheStepsPerColorChannel;
    -
    -    var rgbValues = PIXI.hex2rgb(color);
    -
    -    rgbValues[0] = Math.min(255, (rgbValues[0] / step) * step);
    -    rgbValues[1] = Math.min(255, (rgbValues[1] / step) * step);
    -    rgbValues[2] = Math.min(255, (rgbValues[2] / step) * step);
    -
    -    return PIXI.rgb2hex(rgbValues);
    -};
    -
    -/**
    - * Number of steps which will be used as a cap when rounding colors.
    - *
    - * @property cacheStepsPerColorChannel
    - * @type Number
    - */
    -PIXI.CanvasTinter.cacheStepsPerColorChannel = 8;
    -
    -/**
    - * Tint cache boolean flag.
    - *
    - * @property convertTintToImage
    - * @type Boolean
    - */
    -PIXI.CanvasTinter.convertTintToImage = false;
    -
    -/**
    - * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method.
    - *
    - * @property canUseMultiply
    - * @type Boolean
    - */
    -PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes();
    -
    -/**
    - * The tinting method that will be used.
    - * 
    - * @method tintMethod
    - */
    -PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply :  PIXI.CanvasTinter.tintWithPerPixel;
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_WebGLRenderer.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_WebGLRenderer.js.html deleted file mode 100755 index 5fb7452..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_WebGLRenderer.js.html +++ /dev/null @@ -1,820 +0,0 @@ - - - - - src/pixi/renderers/webgl/WebGLRenderer.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/WebGLRenderer.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -PIXI.glContexts = []; // this is where we store the webGL contexts for easy access.
    -PIXI.instances = [];
    -
    -/**
    - * The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer
    - * should be used for browsers that support webGL. This Render works by automatically managing webGLBatchs.
    - * So no need for Sprite Batches or Sprite Clouds.
    - * Don't forget to add the view to your DOM or you will not see anything :)
    - *
    - * @class WebGLRenderer
    - * @constructor
    - * @param [width=0] {Number} the width of the canvas view
    - * @param [height=0] {Number} the height of the canvas view
    - * @param [options] {Object} The optional renderer parameters
    - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional
    - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false
    - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false
    - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment)
    - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context
    - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2
    - */
    -PIXI.WebGLRenderer = function(width, height, options)
    -{
    -    if(options)
    -    {
    -        for (var i in PIXI.defaultRenderOptions)
    -        {
    -            if (typeof options[i] === 'undefined') options[i] = PIXI.defaultRenderOptions[i];
    -        }
    -    }
    -    else
    -    {
    -        options = PIXI.defaultRenderOptions;
    -    }
    -
    -    if(!PIXI.defaultRenderer)
    -    {
    -        PIXI.sayHello('webGL');
    -        PIXI.defaultRenderer = this;
    -    }
    -
    -    /**
    -     * @property type
    -     * @type Number
    -     */
    -    this.type = PIXI.WEBGL_RENDERER;
    -
    -    /**
    -     * The resolution of the renderer
    -     *
    -     * @property resolution
    -     * @type Number
    -     * @default 1
    -     */
    -    this.resolution = options.resolution;
    -
    -    // do a catch.. only 1 webGL renderer..
    -
    -    /**
    -     * Whether the render view is transparent
    -     *
    -     * @property transparent
    -     * @type Boolean
    -     */
    -    this.transparent = options.transparent;
    -
    -    /**
    -     * Whether the render view should be resized automatically
    -     *
    -     * @property autoResize
    -     * @type Boolean
    -     */
    -    this.autoResize = options.autoResize || false;
    -
    -    /**
    -     * The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering.
    -     *
    -     * @property preserveDrawingBuffer
    -     * @type Boolean
    -     */
    -    this.preserveDrawingBuffer = options.preserveDrawingBuffer;
    -
    -    /**
    -     * This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true:
    -     * If the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0).
    -     * If the Stage is transparent, Pixi will clear to the target Stage's background color.
    -     * Disable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set.
    -     *
    -     * @property clearBeforeRender
    -     * @type Boolean
    -     * @default
    -     */
    -    this.clearBeforeRender = options.clearBeforeRender;
    -
    -    /**
    -     * The width of the canvas view
    -     *
    -     * @property width
    -     * @type Number
    -     * @default 800
    -     */
    -    this.width = width || 800;
    -
    -    /**
    -     * The height of the canvas view
    -     *
    -     * @property height
    -     * @type Number
    -     * @default 600
    -     */
    -    this.height = height || 600;
    -
    -    /**
    -     * The canvas element that everything is drawn to
    -     *
    -     * @property view
    -     * @type HTMLCanvasElement
    -     */
    -    this.view = options.view || document.createElement( 'canvas' );
    -
    -    // deal with losing context..
    -
    -    /**
    -     * @property contextLostBound
    -     * @type Function
    -     */
    -    this.contextLostBound = this.handleContextLost.bind(this);
    -
    -    /**
    -     * @property contextRestoredBound
    -     * @type Function
    -     */
    -    this.contextRestoredBound = this.handleContextRestored.bind(this);
    -
    -    this.view.addEventListener('webglcontextlost', this.contextLostBound, false);
    -    this.view.addEventListener('webglcontextrestored', this.contextRestoredBound, false);
    -
    -    /**
    -     * @property _contextOptions
    -     * @type Object
    -     * @private
    -     */
    -    this._contextOptions = {
    -        alpha: this.transparent,
    -        antialias: options.antialias, // SPEED UP??
    -        premultipliedAlpha:this.transparent && this.transparent !== 'notMultiplied',
    -        stencil:true,
    -        preserveDrawingBuffer: options.preserveDrawingBuffer
    -    };
    -
    -    /**
    -     * @property projection
    -     * @type Point
    -     */
    -    this.projection = new PIXI.Point();
    -
    -    /**
    -     * @property offset
    -     * @type Point
    -     */
    -    this.offset = new PIXI.Point(0, 0);
    -
    -    // time to create the render managers! each one focuses on managing a state in webGL
    -
    -    /**
    -     * Deals with managing the shader programs and their attribs
    -     * @property shaderManager
    -     * @type WebGLShaderManager
    -     */
    -    this.shaderManager = new PIXI.WebGLShaderManager();
    -
    -    /**
    -     * Manages the rendering of sprites
    -     * @property spriteBatch
    -     * @type WebGLSpriteBatch
    -     */
    -    this.spriteBatch = new PIXI.WebGLSpriteBatch();
    -
    -    /**
    -     * Manages the masks using the stencil buffer
    -     * @property maskManager
    -     * @type WebGLMaskManager
    -     */
    -    this.maskManager = new PIXI.WebGLMaskManager();
    -
    -    /**
    -     * Manages the filters
    -     * @property filterManager
    -     * @type WebGLFilterManager
    -     */
    -    this.filterManager = new PIXI.WebGLFilterManager();
    -
    -    /**
    -     * Manages the stencil buffer
    -     * @property stencilManager
    -     * @type WebGLStencilManager
    -     */
    -    this.stencilManager = new PIXI.WebGLStencilManager();
    -
    -    /**
    -     * Manages the blendModes
    -     * @property blendModeManager
    -     * @type WebGLBlendModeManager
    -     */
    -    this.blendModeManager = new PIXI.WebGLBlendModeManager();
    -
    -    /**
    -     * TODO remove
    -     * @property renderSession
    -     * @type Object
    -     */
    -    this.renderSession = {};
    -    this.renderSession.gl = this.gl;
    -    this.renderSession.drawCount = 0;
    -    this.renderSession.shaderManager = this.shaderManager;
    -    this.renderSession.maskManager = this.maskManager;
    -    this.renderSession.filterManager = this.filterManager;
    -    this.renderSession.blendModeManager = this.blendModeManager;
    -    this.renderSession.spriteBatch = this.spriteBatch;
    -    this.renderSession.stencilManager = this.stencilManager;
    -    this.renderSession.renderer = this;
    -    this.renderSession.resolution = this.resolution;
    -
    -    // time init the context..
    -    this.initContext();
    -
    -    // map some webGL blend modes..
    -    this.mapBlendModes();
    -};
    -
    -// constructor
    -PIXI.WebGLRenderer.prototype.constructor = PIXI.WebGLRenderer;
    -
    -/**
    -* @method initContext
    -*/
    -PIXI.WebGLRenderer.prototype.initContext = function()
    -{
    -    var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions);
    -    this.gl = gl;
    -
    -    if (!gl) {
    -        // fail, not able to get a context
    -        throw new Error('This browser does not support webGL. Try using the canvas renderer');
    -    }
    -
    -    this.glContextId = gl.id = PIXI.WebGLRenderer.glContextId ++;
    -
    -    PIXI.glContexts[this.glContextId] = gl;
    -
    -    PIXI.instances[this.glContextId] = this;
    -
    -    // set up the default pixi settings..
    -    gl.disable(gl.DEPTH_TEST);
    -    gl.disable(gl.CULL_FACE);
    -    gl.enable(gl.BLEND);
    -
    -    // need to set the context for all the managers...
    -    this.shaderManager.setContext(gl);
    -    this.spriteBatch.setContext(gl);
    -    this.maskManager.setContext(gl);
    -    this.filterManager.setContext(gl);
    -    this.blendModeManager.setContext(gl);
    -    this.stencilManager.setContext(gl);
    -
    -    this.renderSession.gl = this.gl;
    -
    -    // now resize and we are good to go!
    -    this.resize(this.width, this.height);
    -};
    -
    -/**
    - * Renders the stage to its webGL view
    - *
    - * @method render
    - * @param stage {Stage} the Stage element to be rendered
    - */
    -PIXI.WebGLRenderer.prototype.render = function(stage)
    -{
    -    // no point rendering if our context has been blown up!
    -    if(this.contextLost)return;
    -
    -    // if rendering a new stage clear the batches..
    -    if(this.__stage !== stage)
    -    {
    -        if(stage.interactive)stage.interactionManager.removeEvents();
    -
    -        // TODO make this work
    -        // dont think this is needed any more?
    -        this.__stage = stage;
    -    }
    -
    -    // update the scene graph
    -    stage.updateTransform();
    -
    -    var gl = this.gl;
    -
    -    // interaction
    -    if(stage._interactive)
    -    {
    -        //need to add some events!
    -        if(!stage._interactiveEventsAdded)
    -        {
    -            stage._interactiveEventsAdded = true;
    -            stage.interactionManager.setTarget(this);
    -        }
    -    }
    -    else
    -    {
    -        if(stage._interactiveEventsAdded)
    -        {
    -            stage._interactiveEventsAdded = false;
    -            stage.interactionManager.setTarget(this);
    -        }
    -    }
    -
    -    // -- Does this need to be set every frame? -- //
    -    gl.viewport(0, 0, this.width, this.height);
    -
    -    // make sure we are bound to the main frame buffer
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, null);
    -
    -    if (this.clearBeforeRender)
    -        {
    -        if(this.transparent)
    -        {
    -            gl.clearColor(0, 0, 0, 0);
    -        }
    -        else
    -        {
    -            gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], 1);
    -        }
    -
    -        gl.clear (gl.COLOR_BUFFER_BIT);
    -    }
    -
    -    this.renderDisplayObject( stage, this.projection );
    -};
    -
    -/**
    - * Renders a Display Object.
    - *
    - * @method renderDisplayObject
    - * @param displayObject {DisplayObject} The DisplayObject to render
    - * @param projection {Point} The projection
    - * @param buffer {Array} a standard WebGL buffer
    - */
    -PIXI.WebGLRenderer.prototype.renderDisplayObject = function(displayObject, projection, buffer)
    -{
    -    this.renderSession.blendModeManager.setBlendMode(PIXI.blendModes.NORMAL);
    -
    -    // reset the render session data..
    -    this.renderSession.drawCount = 0;
    -
    -    // set the default projection
    -    this.renderSession.projection = projection;
    -
    -    //set the default offset
    -    this.renderSession.offset = this.offset;
    -
    -    // start the sprite batch
    -    this.spriteBatch.begin(this.renderSession);
    -
    -    // start the filter manager
    -    this.filterManager.begin(this.renderSession, buffer);
    -
    -    // render the scene!
    -    displayObject._renderWebGL(this.renderSession);
    -
    -    // finish the sprite batch
    -    this.spriteBatch.end();
    -};
    -
    -/**
    - * Resizes the webGL view to the specified width and height.
    - *
    - * @method resize
    - * @param width {Number} the new width of the webGL view
    - * @param height {Number} the new height of the webGL view
    - */
    -PIXI.WebGLRenderer.prototype.resize = function(width, height)
    -{
    -    this.width = width * this.resolution;
    -    this.height = height * this.resolution;
    -
    -    this.view.width = this.width;
    -    this.view.height = this.height;
    -
    -    if (this.autoResize) {
    -        this.view.style.width = this.width / this.resolution + 'px';
    -        this.view.style.height = this.height / this.resolution + 'px';
    -    }
    -
    -    this.gl.viewport(0, 0, this.width, this.height);
    -
    -    this.projection.x =  this.width / 2 / this.resolution;
    -    this.projection.y =  -this.height / 2 / this.resolution;
    -};
    -
    -/**
    - * Updates and Creates a WebGL texture for the renderers context.
    - *
    - * @method updateTexture
    - * @param texture {Texture} the texture to update
    - */
    -PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
    -{
    -    if(!texture.hasLoaded )return;
    -
    -    var gl = this.gl;
    -
    -    if(!texture._glTextures[gl.id])texture._glTextures[gl.id] = gl.createTexture();
    -
    -    gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]);
    -
    -    gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultipliedAlpha);
    -    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source);
    -
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
    -
    -    // reguler...
    -    if(!texture._powerOf2)
    -    {
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    -    }
    -    else
    -    {
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
    -    }
    -
    -    texture._dirty[gl.id] = false;
    -
    -    return  texture._glTextures[gl.id];
    -};
    -
    -/**
    - * Handles a lost webgl context
    - *
    - * @method handleContextLost
    - * @param event {Event}
    - * @private
    - */
    -PIXI.WebGLRenderer.prototype.handleContextLost = function(event)
    -{
    -    event.preventDefault();
    -    this.contextLost = true;
    -};
    -
    -/**
    - * Handles a restored webgl context
    - *
    - * @method handleContextRestored
    - * @param event {Event}
    - * @private
    - */
    -PIXI.WebGLRenderer.prototype.handleContextRestored = function()
    -{
    -    this.initContext();
    -
    -    // empty all the ol gl textures as they are useless now
    -    for(var key in PIXI.TextureCache)
    -    {
    -        var texture = PIXI.TextureCache[key].baseTexture;
    -        texture._glTextures = [];
    -    }
    -
    -    this.contextLost = false;
    -};
    -
    -/**
    - * Removes everything from the renderer (event listeners, spritebatch, etc...)
    - *
    - * @method destroy
    - */
    -PIXI.WebGLRenderer.prototype.destroy = function()
    -{
    -    // remove listeners
    -    this.view.removeEventListener('webglcontextlost', this.contextLostBound);
    -    this.view.removeEventListener('webglcontextrestored', this.contextRestoredBound);
    -
    -    PIXI.glContexts[this.glContextId] = null;
    -
    -    this.projection = null;
    -    this.offset = null;
    -
    -    // time to create the render managers! each one focuses on managine a state in webGL
    -    this.shaderManager.destroy();
    -    this.spriteBatch.destroy();
    -    this.maskManager.destroy();
    -    this.filterManager.destroy();
    -
    -    this.shaderManager = null;
    -    this.spriteBatch = null;
    -    this.maskManager = null;
    -    this.filterManager = null;
    -
    -    this.gl = null;
    -    this.renderSession = null;
    -};
    -
    -/**
    - * Maps Pixi blend modes to WebGL blend modes.
    - *
    - * @method mapBlendModes
    - */
    -PIXI.WebGLRenderer.prototype.mapBlendModes = function()
    -{
    -    var gl = this.gl;
    -
    -    if(!PIXI.blendModesWebGL)
    -    {
    -        PIXI.blendModesWebGL = [];
    -
    -        PIXI.blendModesWebGL[PIXI.blendModes.NORMAL]        = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.ADD]           = [gl.SRC_ALPHA, gl.DST_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.MULTIPLY]      = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.SCREEN]        = [gl.SRC_ALPHA, gl.ONE];
    -        PIXI.blendModesWebGL[PIXI.blendModes.OVERLAY]       = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.DARKEN]        = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.LIGHTEN]       = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.COLOR_DODGE]   = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.COLOR_BURN]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.HARD_LIGHT]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.SOFT_LIGHT]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.DIFFERENCE]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.EXCLUSION]     = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.HUE]           = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.SATURATION]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.COLOR]         = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -        PIXI.blendModesWebGL[PIXI.blendModes.LUMINOSITY]    = [gl.ONE,       gl.ONE_MINUS_SRC_ALPHA];
    -    }
    -};
    -
    -PIXI.WebGLRenderer.glContextId = 0;
    -PIXI.WebGLRenderer.instances = [];
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_ComplexPrimitiveShader.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_ComplexPrimitiveShader.js.html deleted file mode 100755 index 696e890..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_ComplexPrimitiveShader.js.html +++ /dev/null @@ -1,399 +0,0 @@ - - - - - src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class ComplexPrimitiveShader
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.ComplexPrimitiveShader = function(gl)
    -{
    -    /**
    -     * @property _UID
    -     * @type Number
    -     * @private
    -     */
    -    this._UID = PIXI._UID++;
    -
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    /**
    -     * The WebGL program.
    -     * @property program
    -     * @type {Any}
    -     */
    -    this.program = null;
    -
    -    /**
    -     * The fragment shader.
    -     * @property fragmentSrc
    -     * @type Array
    -     */
    -    this.fragmentSrc = [
    -
    -        'precision mediump float;',
    -
    -        'varying vec4 vColor;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = vColor;',
    -        '}'
    -    ];
    -
    -    /**
    -     * The vertex shader.
    -     * @property vertexSrc
    -     * @type Array
    -     */
    -    this.vertexSrc  = [
    -        'attribute vec2 aVertexPosition;',
    -        //'attribute vec4 aColor;',
    -        'uniform mat3 translationMatrix;',
    -        'uniform vec2 projectionVector;',
    -        'uniform vec2 offsetVector;',
    -        
    -        'uniform vec3 tint;',
    -        'uniform float alpha;',
    -        'uniform vec3 color;',
    -
    -        'varying vec4 vColor;',
    -
    -        'void main(void) {',
    -        '   vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);',
    -        '   v -= offsetVector.xyx;',
    -        '   gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);',
    -        '   vColor = vec4(color * alpha * tint, alpha);',//" * vec4(tint * alpha, alpha);',
    -        '}'
    -    ];
    -
    -    this.init();
    -};
    -
    -PIXI.ComplexPrimitiveShader.prototype.constructor = PIXI.ComplexPrimitiveShader;
    -
    -/**
    -* Initialises the shader.
    -* 
    -* @method init
    -*/
    -PIXI.ComplexPrimitiveShader.prototype.init = function()
    -{
    -    var gl = this.gl;
    -
    -    var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc);
    -    gl.useProgram(program);
    -
    -    // get and store the uniforms for the shader
    -    this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
    -    this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
    -    this.tintColor = gl.getUniformLocation(program, 'tint');
    -    this.color = gl.getUniformLocation(program, 'color');
    -
    -    // get and store the attributes
    -    this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
    -   // this.colorAttribute = gl.getAttribLocation(program, 'aColor');
    -
    -    this.attributes = [this.aVertexPosition, this.colorAttribute];
    -
    -    this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix');
    -    this.alpha = gl.getUniformLocation(program, 'alpha');
    -
    -    this.program = program;
    -};
    -
    -/**
    -* Destroys the shader.
    -* 
    -* @method destroy
    -*/
    -PIXI.ComplexPrimitiveShader.prototype.destroy = function()
    -{
    -    this.gl.deleteProgram( this.program );
    -    this.uniforms = null;
    -    this.gl = null;
    -
    -    this.attribute = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiFastShader.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiFastShader.js.html deleted file mode 100755 index 05dda36..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiFastShader.js.html +++ /dev/null @@ -1,433 +0,0 @@ - - - - - src/pixi/renderers/webgl/shaders/PixiFastShader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/shaders/PixiFastShader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class PixiFastShader
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.PixiFastShader = function(gl)
    -{
    -    /**
    -     * @property _UID
    -     * @type Number
    -     * @private
    -     */
    -    this._UID = PIXI._UID++;
    -    
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    /**
    -     * The WebGL program.
    -     * @property program
    -     * @type {Any}
    -     */
    -    this.program = null;
    -
    -    /**
    -     * The fragment shader.
    -     * @property fragmentSrc
    -     * @type Array
    -     */
    -    this.fragmentSrc = [
    -        'precision lowp float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying float vColor;',
    -        'uniform sampler2D uSampler;',
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;',
    -        '}'
    -    ];
    -
    -    /**
    -     * The vertex shader.
    -     * @property vertexSrc
    -     * @type Array
    -     */
    -    this.vertexSrc = [
    -        'attribute vec2 aVertexPosition;',
    -        'attribute vec2 aPositionCoord;',
    -        'attribute vec2 aScale;',
    -        'attribute float aRotation;',
    -        'attribute vec2 aTextureCoord;',
    -        'attribute float aColor;',
    -
    -        'uniform vec2 projectionVector;',
    -        'uniform vec2 offsetVector;',
    -        'uniform mat3 uMatrix;',
    -
    -        'varying vec2 vTextureCoord;',
    -        'varying float vColor;',
    -
    -        'const vec2 center = vec2(-1.0, 1.0);',
    -
    -        'void main(void) {',
    -        '   vec2 v;',
    -        '   vec2 sv = aVertexPosition * aScale;',
    -        '   v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);',
    -        '   v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);',
    -        '   v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;',
    -        '   gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);',
    -        '   vTextureCoord = aTextureCoord;',
    -      //  '   vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;',
    -        '   vColor = aColor;',
    -        '}'
    -    ];
    -
    -    /**
    -     * A local texture counter for multi-texture shaders.
    -     * @property textureCount
    -     * @type Number
    -     */
    -    this.textureCount = 0;
    -    
    -    this.init();
    -};
    -
    -PIXI.PixiFastShader.prototype.constructor = PIXI.PixiFastShader;
    -
    -/**
    -* Initialises the shader.
    -* 
    -* @method init
    -*/
    -PIXI.PixiFastShader.prototype.init = function()
    -{
    -    var gl = this.gl;
    -
    -    var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc);
    -    
    -    gl.useProgram(program);
    -
    -    // get and store the uniforms for the shader
    -    this.uSampler = gl.getUniformLocation(program, 'uSampler');
    -
    -    this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
    -    this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
    -    this.dimensions = gl.getUniformLocation(program, 'dimensions');
    -    this.uMatrix = gl.getUniformLocation(program, 'uMatrix');
    -
    -    // get and store the attributes
    -    this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
    -    this.aPositionCoord = gl.getAttribLocation(program, 'aPositionCoord');
    -
    -    this.aScale = gl.getAttribLocation(program, 'aScale');
    -    this.aRotation = gl.getAttribLocation(program, 'aRotation');
    -
    -    this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord');
    -    this.colorAttribute = gl.getAttribLocation(program, 'aColor');
    -   
    -    // Begin worst hack eva //
    -
    -    // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters?
    -    // maybe its somthing to do with the current state of the gl context.
    -    // Im convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel
    -    // If theres any webGL people that know why could happen please help :)
    -    if(this.colorAttribute === -1)
    -    {
    -        this.colorAttribute = 2;
    -    }
    -
    -    this.attributes = [this.aVertexPosition, this.aPositionCoord,  this.aScale, this.aRotation, this.aTextureCoord, this.colorAttribute];
    -    
    -    // End worst hack eva //
    -
    -    this.program = program;
    -};
    -
    -/**
    -* Destroys the shader.
    -* 
    -* @method destroy
    -*/
    -PIXI.PixiFastShader.prototype.destroy = function()
    -{
    -    this.gl.deleteProgram( this.program );
    -    this.uniforms = null;
    -    this.gl = null;
    -
    -    this.attributes = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiShader.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiShader.js.html deleted file mode 100755 index 89d83ac..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PixiShader.js.html +++ /dev/null @@ -1,668 +0,0 @@ - - - - - src/pixi/renderers/webgl/shaders/PixiShader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/shaders/PixiShader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * @author Richard Davey http://www.photonstorm.com @photonstorm
    - */
    -
    -/**
    -* @class PixiShader
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.PixiShader = function(gl)
    -{
    -    /**
    -     * @property _UID
    -     * @type Number
    -     * @private
    -     */
    -    this._UID = PIXI._UID++;
    -
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    /**
    -     * The WebGL program.
    -     * @property program
    -     * @type {Any}
    -     */
    -    this.program = null;
    -
    -    /**
    -     * The fragment shader.
    -     * @property fragmentSrc
    -     * @type Array
    -     */
    -    this.fragmentSrc = [
    -        'precision lowp float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D uSampler;',
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;',
    -        '}'
    -    ];
    -
    -    /**
    -     * A local texture counter for multi-texture shaders.
    -     * @property textureCount
    -     * @type Number
    -     */
    -    this.textureCount = 0;
    -
    -    /**
    -     * A local flag
    -     * @property firstRun
    -     * @type Boolean
    -     * @private
    -     */
    -    this.firstRun = true;
    -
    -    /**
    -     * A dirty flag
    -     * @property dirty
    -     * @type Boolean
    -     */
    -    this.dirty = true;
    -
    -    /**
    -     * Uniform attributes cache.
    -     * @property attributes
    -     * @type Array
    -     * @private
    -     */
    -    this.attributes = [];
    -
    -    this.init();
    -};
    -
    -PIXI.PixiShader.prototype.constructor = PIXI.PixiShader;
    -
    -/**
    -* Initialises the shader.
    -*
    -* @method init
    -*/
    -PIXI.PixiShader.prototype.init = function()
    -{
    -    var gl = this.gl;
    -
    -    var program = PIXI.compileProgram(gl, this.vertexSrc || PIXI.PixiShader.defaultVertexSrc, this.fragmentSrc);
    -
    -    gl.useProgram(program);
    -
    -    // get and store the uniforms for the shader
    -    this.uSampler = gl.getUniformLocation(program, 'uSampler');
    -    this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
    -    this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
    -    this.dimensions = gl.getUniformLocation(program, 'dimensions');
    -
    -    // get and store the attributes
    -    this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
    -    this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord');
    -    this.colorAttribute = gl.getAttribLocation(program, 'aColor');
    -
    -    // Begin worst hack eva //
    -
    -    // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters?
    -    // maybe its something to do with the current state of the gl context.
    -    // I'm convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel
    -    // If theres any webGL people that know why could happen please help :)
    -    if(this.colorAttribute === -1)
    -    {
    -        this.colorAttribute = 2;
    -    }
    -
    -    this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
    -
    -    // End worst hack eva //
    -
    -    // add those custom shaders!
    -    for (var key in this.uniforms)
    -    {
    -        // get the uniform locations..
    -        this.uniforms[key].uniformLocation = gl.getUniformLocation(program, key);
    -    }
    -
    -    this.initUniforms();
    -
    -    this.program = program;
    -};
    -
    -/**
    -* Initialises the shader uniform values.
    -*
    -* Uniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/
    -* http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf
    -*
    -* @method initUniforms
    -*/
    -PIXI.PixiShader.prototype.initUniforms = function()
    -{
    -    this.textureCount = 1;
    -    var gl = this.gl;
    -    var uniform;
    -
    -    for (var key in this.uniforms)
    -    {
    -        uniform = this.uniforms[key];
    -
    -        var type = uniform.type;
    -
    -        if (type === 'sampler2D')
    -        {
    -            uniform._init = false;
    -
    -            if (uniform.value !== null)
    -            {
    -                this.initSampler2D(uniform);
    -            }
    -        }
    -        else if (type === 'mat2' || type === 'mat3' || type === 'mat4')
    -        {
    -            //  These require special handling
    -            uniform.glMatrix = true;
    -            uniform.glValueLength = 1;
    -
    -            if (type === 'mat2')
    -            {
    -                uniform.glFunc = gl.uniformMatrix2fv;
    -            }
    -            else if (type === 'mat3')
    -            {
    -                uniform.glFunc = gl.uniformMatrix3fv;
    -            }
    -            else if (type === 'mat4')
    -            {
    -                uniform.glFunc = gl.uniformMatrix4fv;
    -            }
    -        }
    -        else
    -        {
    -            //  GL function reference
    -            uniform.glFunc = gl['uniform' + type];
    -
    -            if (type === '2f' || type === '2i')
    -            {
    -                uniform.glValueLength = 2;
    -            }
    -            else if (type === '3f' || type === '3i')
    -            {
    -                uniform.glValueLength = 3;
    -            }
    -            else if (type === '4f' || type === '4i')
    -            {
    -                uniform.glValueLength = 4;
    -            }
    -            else
    -            {
    -                uniform.glValueLength = 1;
    -            }
    -        }
    -    }
    -
    -};
    -
    -/**
    -* Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded)
    -*
    -* @method initSampler2D
    -*/
    -PIXI.PixiShader.prototype.initSampler2D = function(uniform)
    -{
    -    if (!uniform.value || !uniform.value.baseTexture || !uniform.value.baseTexture.hasLoaded)
    -    {
    -        return;
    -    }
    -
    -    var gl = this.gl;
    -
    -    gl.activeTexture(gl['TEXTURE' + this.textureCount]);
    -    gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]);
    -
    -    //  Extended texture data
    -    if (uniform.textureData)
    -    {
    -        var data = uniform.textureData;
    -
    -        // GLTexture = mag linear, min linear_mipmap_linear, wrap repeat + gl.generateMipmap(gl.TEXTURE_2D);
    -        // GLTextureLinear = mag/min linear, wrap clamp
    -        // GLTextureNearestRepeat = mag/min NEAREST, wrap repeat
    -        // GLTextureNearest = mag/min nearest, wrap clamp
    -        // AudioTexture = whatever + luminance + width 512, height 2, border 0
    -        // KeyTexture = whatever + luminance + width 256, height 2, border 0
    -
    -        //  magFilter can be: gl.LINEAR, gl.LINEAR_MIPMAP_LINEAR or gl.NEAREST
    -        //  wrapS/T can be: gl.CLAMP_TO_EDGE or gl.REPEAT
    -
    -        var magFilter = (data.magFilter) ? data.magFilter : gl.LINEAR;
    -        var minFilter = (data.minFilter) ? data.minFilter : gl.LINEAR;
    -        var wrapS = (data.wrapS) ? data.wrapS : gl.CLAMP_TO_EDGE;
    -        var wrapT = (data.wrapT) ? data.wrapT : gl.CLAMP_TO_EDGE;
    -        var format = (data.luminance) ? gl.LUMINANCE : gl.RGBA;
    -
    -        if (data.repeat)
    -        {
    -            wrapS = gl.REPEAT;
    -            wrapT = gl.REPEAT;
    -        }
    -
    -        gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, !!data.flipY);
    -
    -        if (data.width)
    -        {
    -            var width = (data.width) ? data.width : 512;
    -            var height = (data.height) ? data.height : 2;
    -            var border = (data.border) ? data.border : 0;
    -
    -            // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels);
    -            gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, border, format, gl.UNSIGNED_BYTE, null);
    -        }
    -        else
    -        {
    -            //  void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, ImageData? pixels);
    -            gl.texImage2D(gl.TEXTURE_2D, 0, format, gl.RGBA, gl.UNSIGNED_BYTE, uniform.value.baseTexture.source);
    -        }
    -
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter);
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter);
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrapS);
    -        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT);
    -    }
    -
    -    gl.uniform1i(uniform.uniformLocation, this.textureCount);
    -
    -    uniform._init = true;
    -
    -    this.textureCount++;
    -
    -};
    -
    -/**
    -* Updates the shader uniform values.
    -*
    -* @method syncUniforms
    -*/
    -PIXI.PixiShader.prototype.syncUniforms = function()
    -{
    -    this.textureCount = 1;
    -    var uniform;
    -    var gl = this.gl;
    -
    -    //  This would probably be faster in an array and it would guarantee key order
    -    for (var key in this.uniforms)
    -    {
    -        uniform = this.uniforms[key];
    -
    -        if (uniform.glValueLength === 1)
    -        {
    -            if (uniform.glMatrix === true)
    -            {
    -                uniform.glFunc.call(gl, uniform.uniformLocation, uniform.transpose, uniform.value);
    -            }
    -            else
    -            {
    -                uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value);
    -            }
    -        }
    -        else if (uniform.glValueLength === 2)
    -        {
    -            uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y);
    -        }
    -        else if (uniform.glValueLength === 3)
    -        {
    -            uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z);
    -        }
    -        else if (uniform.glValueLength === 4)
    -        {
    -            uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z, uniform.value.w);
    -        }
    -        else if (uniform.type === 'sampler2D')
    -        {
    -            if (uniform._init)
    -            {
    -                gl.activeTexture(gl['TEXTURE' + this.textureCount]);
    -
    -                if(uniform.value.baseTexture._dirty[gl.id])
    -                {
    -                    PIXI.WebGLRenderer.instances[gl.id].updateTexture(uniform.value.baseTexture);
    -                }
    -                else
    -                {
    -                    // bind the current texture
    -                    gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]);
    -                }
    -
    -             //   gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id] || PIXI.createWebGLTexture( uniform.value.baseTexture, gl));
    -                gl.uniform1i(uniform.uniformLocation, this.textureCount);
    -                this.textureCount++;
    -            }
    -            else
    -            {
    -                this.initSampler2D(uniform);
    -            }
    -        }
    -    }
    -
    -};
    -
    -/**
    -* Destroys the shader.
    -*
    -* @method destroy
    -*/
    -PIXI.PixiShader.prototype.destroy = function()
    -{
    -    this.gl.deleteProgram( this.program );
    -    this.uniforms = null;
    -    this.gl = null;
    -
    -    this.attributes = null;
    -};
    -
    -/**
    -* The Default Vertex shader source.
    -*
    -* @property defaultVertexSrc
    -* @type String
    -*/
    -PIXI.PixiShader.defaultVertexSrc = [
    -    'attribute vec2 aVertexPosition;',
    -    'attribute vec2 aTextureCoord;',
    -    'attribute vec4 aColor;',
    -
    -    'uniform vec2 projectionVector;',
    -    'uniform vec2 offsetVector;',
    -
    -    'varying vec2 vTextureCoord;',
    -    'varying vec4 vColor;',
    -
    -    'const vec2 center = vec2(-1.0, 1.0);',
    -
    -    'void main(void) {',
    -    '   gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);',
    -    '   vTextureCoord = aTextureCoord;',
    -    '   vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;',
    -    '   vColor = vec4(color * aColor.x, aColor.x);',
    -    '}'
    -];
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PrimitiveShader.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PrimitiveShader.js.html deleted file mode 100755 index de2db53..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_PrimitiveShader.js.html +++ /dev/null @@ -1,393 +0,0 @@ - - - - - src/pixi/renderers/webgl/shaders/PrimitiveShader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/shaders/PrimitiveShader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class PrimitiveShader
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.PrimitiveShader = function(gl)
    -{
    -    /**
    -     * @property _UID
    -     * @type Number
    -     * @private
    -     */
    -    this._UID = PIXI._UID++;
    - 
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    /**
    -     * The WebGL program.
    -     * @property program
    -     * @type {Any}
    -     */
    -    this.program = null;
    -
    -    /**
    -     * The fragment shader.
    -     * @property fragmentSrc
    -     * @type Array
    -     */
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec4 vColor;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = vColor;',
    -        '}'
    -    ];
    -
    -    /**
    -     * The vertex shader.
    -     * @property vertexSrc
    -     * @type Array
    -     */
    -    this.vertexSrc  = [
    -        'attribute vec2 aVertexPosition;',
    -        'attribute vec4 aColor;',
    -        'uniform mat3 translationMatrix;',
    -        'uniform vec2 projectionVector;',
    -        'uniform vec2 offsetVector;',
    -        'uniform float alpha;',
    -        'uniform vec3 tint;',
    -        'varying vec4 vColor;',
    -
    -        'void main(void) {',
    -        '   vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);',
    -        '   v -= offsetVector.xyx;',
    -        '   gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);',
    -        '   vColor = aColor * vec4(tint * alpha, alpha);',
    -        '}'
    -    ];
    -
    -    this.init();
    -};
    -
    -PIXI.PrimitiveShader.prototype.constructor = PIXI.PrimitiveShader;
    -
    -/**
    -* Initialises the shader.
    -* 
    -* @method init
    -*/
    -PIXI.PrimitiveShader.prototype.init = function()
    -{
    -    var gl = this.gl;
    -
    -    var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc);
    -    gl.useProgram(program);
    -
    -    // get and store the uniforms for the shader
    -    this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
    -    this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
    -    this.tintColor = gl.getUniformLocation(program, 'tint');
    -
    -    // get and store the attributes
    -    this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
    -    this.colorAttribute = gl.getAttribLocation(program, 'aColor');
    -
    -    this.attributes = [this.aVertexPosition, this.colorAttribute];
    -
    -    this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix');
    -    this.alpha = gl.getUniformLocation(program, 'alpha');
    -
    -    this.program = program;
    -};
    -
    -/**
    -* Destroys the shader.
    -* 
    -* @method destroy
    -*/
    -PIXI.PrimitiveShader.prototype.destroy = function()
    -{
    -    this.gl.deleteProgram( this.program );
    -    this.uniforms = null;
    -    this.gl = null;
    -
    -    this.attributes = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_StripShader.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_StripShader.js.html deleted file mode 100755 index 39bc977..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_shaders_StripShader.js.html +++ /dev/null @@ -1,401 +0,0 @@ - - - - - src/pixi/renderers/webgl/shaders/StripShader.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/shaders/StripShader.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class StripShader
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.StripShader = function(gl)
    -{
    -    /**
    -     * @property _UID
    -     * @type Number
    -     * @private
    -     */
    -    this._UID = PIXI._UID++;
    -    
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    /**
    -     * The WebGL program.
    -     * @property program
    -     * @type {Any}
    -     */
    -    this.program = null;
    -
    -    /**
    -     * The fragment shader.
    -     * @property fragmentSrc
    -     * @type Array
    -     */
    -    this.fragmentSrc = [
    -        'precision mediump float;',
    -        'varying vec2 vTextureCoord;',
    -     //   'varying float vColor;',
    -        'uniform float alpha;',
    -        'uniform sampler2D uSampler;',
    -
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * alpha;',
    -      //  '   gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);',//gl_FragColor * alpha;',
    -        '}'
    -    ];
    -
    -    /**
    -     * The vertex shader.
    -     * @property vertexSrc
    -     * @type Array
    -     */
    -    this.vertexSrc  = [
    -        'attribute vec2 aVertexPosition;',
    -        'attribute vec2 aTextureCoord;',
    -        'uniform mat3 translationMatrix;',
    -        'uniform vec2 projectionVector;',
    -        'uniform vec2 offsetVector;',
    -      //  'uniform float alpha;',
    -       // 'uniform vec3 tint;',
    -        'varying vec2 vTextureCoord;',
    -      //  'varying vec4 vColor;',
    -
    -        'void main(void) {',
    -        '   vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);',
    -        '   v -= offsetVector.xyx;',
    -        '   gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);',
    -        '   vTextureCoord = aTextureCoord;',
    -       // '   vColor = aColor * vec4(tint * alpha, alpha);',
    -        '}'
    -    ];
    -
    -    this.init();
    -};
    -
    -PIXI.StripShader.prototype.constructor = PIXI.StripShader;
    -
    -/**
    -* Initialises the shader.
    -* 
    -* @method init
    -*/
    -PIXI.StripShader.prototype.init = function()
    -{
    -    var gl = this.gl;
    -
    -    var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc);
    -    gl.useProgram(program);
    -
    -    // get and store the uniforms for the shader
    -    this.uSampler = gl.getUniformLocation(program, 'uSampler');
    -    this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
    -    this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
    -    this.colorAttribute = gl.getAttribLocation(program, 'aColor');
    -    //this.dimensions = gl.getUniformLocation(this.program, 'dimensions');
    -
    -    // get and store the attributes
    -    this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
    -    this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord');
    -
    -    this.attributes = [this.aVertexPosition, this.aTextureCoord];
    -
    -    this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix');
    -    this.alpha = gl.getUniformLocation(program, 'alpha');
    -
    -    this.program = program;
    -};
    -
    -/**
    -* Destroys the shader.
    -* 
    -* @method destroy
    -*/
    -PIXI.StripShader.prototype.destroy = function()
    -{
    -    this.gl.deleteProgram( this.program );
    -    this.uniforms = null;
    -    this.gl = null;
    -
    -    this.attribute = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_FilterTexture.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_FilterTexture.js.html deleted file mode 100755 index f1ce334..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_FilterTexture.js.html +++ /dev/null @@ -1,388 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/FilterTexture.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/FilterTexture.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class FilterTexture
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -* @param width {Number} the horizontal range of the filter
    -* @param height {Number} the vertical range of the filter
    -* @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    -*/
    -PIXI.FilterTexture = function(gl, width, height, scaleMode)
    -{
    -    /**
    -     * @property gl
    -     * @type WebGLContext
    -     */
    -    this.gl = gl;
    -
    -    // next time to create a frame buffer and texture
    -
    -    /**
    -     * @property frameBuffer
    -     * @type Any
    -     */
    -    this.frameBuffer = gl.createFramebuffer();
    -
    -    /**
    -     * @property texture
    -     * @type Any
    -     */
    -    this.texture = gl.createTexture();
    -
    -    /**
    -     * @property scaleMode
    -     * @type Number
    -     */
    -    scaleMode = scaleMode || PIXI.scaleModes.DEFAULT;
    -
    -    gl.bindTexture(gl.TEXTURE_2D,  this.texture);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer );
    -
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer );
    -    gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0);
    -
    -    // required for masking a mask??
    -    this.renderBuffer = gl.createRenderbuffer();
    -    gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer);
    -    gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.renderBuffer);
    -  
    -    this.resize(width, height);
    -};
    -
    -PIXI.FilterTexture.prototype.constructor = PIXI.FilterTexture;
    -
    -/**
    -* Clears the filter texture.
    -* 
    -* @method clear
    -*/
    -PIXI.FilterTexture.prototype.clear = function()
    -{
    -    var gl = this.gl;
    -    
    -    gl.clearColor(0,0,0, 0);
    -    gl.clear(gl.COLOR_BUFFER_BIT);
    -};
    -
    -/**
    - * Resizes the texture to the specified width and height
    - *
    - * @method resize
    - * @param width {Number} the new width of the texture
    - * @param height {Number} the new height of the texture
    - */
    -PIXI.FilterTexture.prototype.resize = function(width, height)
    -{
    -    if(this.width === width && this.height === height) return;
    -
    -    this.width = width;
    -    this.height = height;
    -
    -    var gl = this.gl;
    -
    -    gl.bindTexture(gl.TEXTURE_2D,  this.texture);
    -    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA,  width , height , 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
    -    // update the stencil buffer width and height
    -    gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer);
    -    gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width , height );
    -};
    -
    -/**
    -* Destroys the filter texture.
    -* 
    -* @method destroy
    -*/
    -PIXI.FilterTexture.prototype.destroy = function()
    -{
    -    var gl = this.gl;
    -    gl.deleteFramebuffer( this.frameBuffer );
    -    gl.deleteTexture( this.texture );
    -
    -    this.frameBuffer = null;
    -    this.texture = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLBlendModeManager.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLBlendModeManager.js.html deleted file mode 100755 index f2bd028..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLBlendModeManager.js.html +++ /dev/null @@ -1,336 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class WebGLBlendModeManager
    -* @constructor
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLBlendModeManager = function()
    -{
    -    /**
    -     * @property currentBlendMode
    -     * @type Number
    -     */
    -    this.currentBlendMode = 99999;
    -};
    -
    -PIXI.WebGLBlendModeManager.prototype.constructor = PIXI.WebGLBlendModeManager;
    -
    -/**
    - * Sets the WebGL Context.
    - *
    - * @method setContext
    - * @param gl {WebGLContext} the current WebGL drawing context
    - */
    -PIXI.WebGLBlendModeManager.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -};
    -
    -/**
    -* Sets-up the given blendMode from WebGL's point of view.
    -* 
    -* @method setBlendMode 
    -* @param blendMode {Number} the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD
    -*/
    -PIXI.WebGLBlendModeManager.prototype.setBlendMode = function(blendMode)
    -{
    -    if(this.currentBlendMode === blendMode)return false;
    -
    -    this.currentBlendMode = blendMode;
    -    
    -    var blendModeWebGL = PIXI.blendModesWebGL[this.currentBlendMode];
    -    this.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]);
    -    
    -    return true;
    -};
    -
    -/**
    -* Destroys this object.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLBlendModeManager.prototype.destroy = function()
    -{
    -    this.gl = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFastSpriteBatch.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFastSpriteBatch.js.html deleted file mode 100755 index 4a22a54..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFastSpriteBatch.js.html +++ /dev/null @@ -1,706 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js

    - -
    -
    -/**
    - * @author Mat Groves
    - * 
    - * Big thanks to the very clever Matt DesLauriers <mattdesl> https://github.com/mattdesl/
    - * for creating the original pixi version!
    - *
    - * Heavily inspired by LibGDX's WebGLSpriteBatch:
    - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java
    - */
    -
    -/**
    -* @class WebGLFastSpriteBatch
    -* @constructor
    -*/
    -PIXI.WebGLFastSpriteBatch = function(gl)
    -{
    -    /**
    -     * @property vertSize
    -     * @type Number
    -     */
    -    this.vertSize = 10;
    -
    -    /**
    -     * @property maxSize
    -     * @type Number
    -     */
    -    this.maxSize = 6000;//Math.pow(2, 16) /  this.vertSize;
    -
    -    /**
    -     * @property size
    -     * @type Number
    -     */
    -    this.size = this.maxSize;
    -
    -    //the total number of floats in our batch
    -    var numVerts = this.size * 4 *  this.vertSize;
    -
    -    //the total number of indices in our batch
    -    var numIndices = this.maxSize * 6;
    -
    -    /**
    -     * Vertex data
    -     * @property vertices
    -     * @type Float32Array
    -     */
    -    this.vertices = new PIXI.Float32Array(numVerts);
    -
    -    /**
    -     * Index data
    -     * @property indices
    -     * @type Uint16Array
    -     */
    -    this.indices = new PIXI.Uint16Array(numIndices);
    -    
    -    /**
    -     * @property vertexBuffer
    -     * @type Object
    -     */
    -    this.vertexBuffer = null;
    -
    -    /**
    -     * @property indexBuffer
    -     * @type Object
    -     */
    -    this.indexBuffer = null;
    -
    -    /**
    -     * @property lastIndexCount
    -     * @type Number
    -     */
    -    this.lastIndexCount = 0;
    -
    -    for (var i=0, j=0; i < numIndices; i += 6, j += 4)
    -    {
    -        this.indices[i + 0] = j + 0;
    -        this.indices[i + 1] = j + 1;
    -        this.indices[i + 2] = j + 2;
    -        this.indices[i + 3] = j + 0;
    -        this.indices[i + 4] = j + 2;
    -        this.indices[i + 5] = j + 3;
    -    }
    -
    -    /**
    -     * @property drawing
    -     * @type Boolean
    -     */
    -    this.drawing = false;
    -
    -    /**
    -     * @property currentBatchSize
    -     * @type Number
    -     */
    -    this.currentBatchSize = 0;
    -
    -    /**
    -     * @property currentBaseTexture
    -     * @type BaseTexture
    -     */
    -    this.currentBaseTexture = null;
    -   
    -    /**
    -     * @property currentBlendMode
    -     * @type Number
    -     */
    -    this.currentBlendMode = 0;
    -
    -    /**
    -     * @property renderSession
    -     * @type Object
    -     */
    -    this.renderSession = null;
    -    
    -    /**
    -     * @property shader
    -     * @type Object
    -     */
    -    this.shader = null;
    -
    -    /**
    -     * @property matrix
    -     * @type Matrix
    -     */
    -    this.matrix = null;
    -
    -    this.setContext(gl);
    -};
    -
    -PIXI.WebGLFastSpriteBatch.prototype.constructor = PIXI.WebGLFastSpriteBatch;
    -
    -/**
    - * Sets the WebGL Context.
    - *
    - * @method setContext
    - * @param gl {WebGLContext} the current WebGL drawing context
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -
    -    // create a couple of buffers
    -    this.vertexBuffer = gl.createBuffer();
    -    this.indexBuffer = gl.createBuffer();
    -
    -    // 65535 is max index, so 65535 / 6 = 10922.
    -
    -    //upload the index data
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW);
    -};
    -
    -/**
    - * @method begin
    - * @param spriteBatch {WebGLSpriteBatch}
    - * @param renderSession {Object}
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.begin = function(spriteBatch, renderSession)
    -{
    -    this.renderSession = renderSession;
    -    this.shader = this.renderSession.shaderManager.fastShader;
    -
    -    this.matrix = spriteBatch.worldTransform.toArray(true);
    -
    -    this.start();
    -};
    -
    -/**
    - * @method end
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.end = function()
    -{
    -    this.flush();
    -};
    -
    -/**
    - * @method render
    - * @param spriteBatch {WebGLSpriteBatch}
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.render = function(spriteBatch)
    -{
    -    var children = spriteBatch.children;
    -    var sprite = children[0];
    -
    -    // if the uvs have not updated then no point rendering just yet!
    -    
    -    // check texture.
    -    if(!sprite.texture._uvs)return;
    -   
    -    this.currentBaseTexture = sprite.texture.baseTexture;
    -    
    -    // check blend mode
    -    if(sprite.blendMode !== this.renderSession.blendModeManager.currentBlendMode)
    -    {
    -        this.flush();
    -        this.renderSession.blendModeManager.setBlendMode(sprite.blendMode);
    -    }
    -    
    -    for(var i=0,j= children.length; i<j; i++)
    -    {
    -        this.renderSprite(children[i]);
    -    }
    -
    -    this.flush();
    -};
    -
    -/**
    - * @method renderSprite
    - * @param sprite {Sprite}
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.renderSprite = function(sprite)
    -{
    -    //sprite = children[i];
    -    if(!sprite.visible)return;
    -    
    -    // TODO trim??
    -    if(sprite.texture.baseTexture !== this.currentBaseTexture)
    -    {
    -        this.flush();
    -        this.currentBaseTexture = sprite.texture.baseTexture;
    -        
    -        if(!sprite.texture._uvs)return;
    -    }
    -
    -    var uvs, verticies = this.vertices, width, height, w0, w1, h0, h1, index;
    -
    -    uvs = sprite.texture._uvs;
    -
    -    width = sprite.texture.frame.width;
    -    height = sprite.texture.frame.height;
    -
    -    if (sprite.texture.trim)
    -    {
    -        // if the sprite is trimmed then we need to add the extra space before transforming the sprite coords..
    -        var trim = sprite.texture.trim;
    -
    -        w1 = trim.x - sprite.anchor.x * trim.width;
    -        w0 = w1 + sprite.texture.crop.width;
    -
    -        h1 = trim.y - sprite.anchor.y * trim.height;
    -        h0 = h1 + sprite.texture.crop.height;
    -    }
    -    else
    -    {
    -        w0 = (sprite.texture.frame.width ) * (1-sprite.anchor.x);
    -        w1 = (sprite.texture.frame.width ) * -sprite.anchor.x;
    -
    -        h0 = sprite.texture.frame.height * (1-sprite.anchor.y);
    -        h1 = sprite.texture.frame.height * -sprite.anchor.y;
    -    }
    -
    -    index = this.currentBatchSize * 4 * this.vertSize;
    -
    -    // xy
    -    verticies[index++] = w1;
    -    verticies[index++] = h1;
    -
    -    verticies[index++] = sprite.position.x;
    -    verticies[index++] = sprite.position.y;
    -
    -    //scale
    -    verticies[index++] = sprite.scale.x;
    -    verticies[index++] = sprite.scale.y;
    -
    -    //rotation
    -    verticies[index++] = sprite.rotation;
    -
    -    // uv
    -    verticies[index++] = uvs.x0;
    -    verticies[index++] = uvs.y1;
    -    // color
    -    verticies[index++] = sprite.alpha;
    - 
    -
    -    // xy
    -    verticies[index++] = w0;
    -    verticies[index++] = h1;
    -
    -    verticies[index++] = sprite.position.x;
    -    verticies[index++] = sprite.position.y;
    -
    -    //scale
    -    verticies[index++] = sprite.scale.x;
    -    verticies[index++] = sprite.scale.y;
    -
    -     //rotation
    -    verticies[index++] = sprite.rotation;
    -
    -    // uv
    -    verticies[index++] = uvs.x1;
    -    verticies[index++] = uvs.y1;
    -    // color
    -    verticies[index++] = sprite.alpha;
    -  
    -
    -    // xy
    -    verticies[index++] = w0;
    -    verticies[index++] = h0;
    -
    -    verticies[index++] = sprite.position.x;
    -    verticies[index++] = sprite.position.y;
    -
    -    //scale
    -    verticies[index++] = sprite.scale.x;
    -    verticies[index++] = sprite.scale.y;
    -
    -     //rotation
    -    verticies[index++] = sprite.rotation;
    -
    -    // uv
    -    verticies[index++] = uvs.x2;
    -    verticies[index++] = uvs.y2;
    -    // color
    -    verticies[index++] = sprite.alpha;
    - 
    -
    -
    -
    -    // xy
    -    verticies[index++] = w1;
    -    verticies[index++] = h0;
    -
    -    verticies[index++] = sprite.position.x;
    -    verticies[index++] = sprite.position.y;
    -
    -    //scale
    -    verticies[index++] = sprite.scale.x;
    -    verticies[index++] = sprite.scale.y;
    -
    -     //rotation
    -    verticies[index++] = sprite.rotation;
    -
    -    // uv
    -    verticies[index++] = uvs.x3;
    -    verticies[index++] = uvs.y3;
    -    // color
    -    verticies[index++] = sprite.alpha;
    -
    -    // increment the batchs
    -    this.currentBatchSize++;
    -
    -    if(this.currentBatchSize >= this.size)
    -    {
    -        this.flush();
    -    }
    -};
    -
    -/**
    - * @method flush
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.flush = function()
    -{
    -    // If the batch is length 0 then return as there is nothing to draw
    -    if (this.currentBatchSize===0)return;
    -
    -    var gl = this.gl;
    -    
    -    // bind the current texture
    -
    -    if(!this.currentBaseTexture._glTextures[gl.id])this.renderSession.renderer.updateTexture(this.currentBaseTexture, gl);
    -
    -    gl.bindTexture(gl.TEXTURE_2D, this.currentBaseTexture._glTextures[gl.id]);
    -
    -    // upload the verts to the buffer
    -   
    -    if(this.currentBatchSize > ( this.size * 0.5 ) )
    -    {
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices);
    -    }
    -    else
    -    {
    -        var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize);
    -
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, view);
    -    }
    -    
    -    // now draw those suckas!
    -    gl.drawElements(gl.TRIANGLES, this.currentBatchSize * 6, gl.UNSIGNED_SHORT, 0);
    -   
    -    // then reset the batch!
    -    this.currentBatchSize = 0;
    -
    -    // increment the draw count
    -    this.renderSession.drawCount++;
    -};
    -
    -
    -/**
    - * @method stop
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.stop = function()
    -{
    -    this.flush();
    -};
    -
    -/**
    - * @method start
    - */
    -PIXI.WebGLFastSpriteBatch.prototype.start = function()
    -{
    -    var gl = this.gl;
    -
    -    // bind the main texture
    -    gl.activeTexture(gl.TEXTURE0);
    -
    -    // bind the buffers
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -
    -    // set the projection
    -    var projection = this.renderSession.projection;
    -    gl.uniform2f(this.shader.projectionVector, projection.x, projection.y);
    -
    -    // set the matrix
    -    gl.uniformMatrix3fv(this.shader.uMatrix, false, this.matrix);
    -
    -    // set the pointers
    -    var stride =  this.vertSize * 4;
    -
    -    gl.vertexAttribPointer(this.shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0);
    -    gl.vertexAttribPointer(this.shader.aPositionCoord, 2, gl.FLOAT, false, stride, 2 * 4);
    -    gl.vertexAttribPointer(this.shader.aScale, 2, gl.FLOAT, false, stride, 4 * 4);
    -    gl.vertexAttribPointer(this.shader.aRotation, 1, gl.FLOAT, false, stride, 6 * 4);
    -    gl.vertexAttribPointer(this.shader.aTextureCoord, 2, gl.FLOAT, false, stride, 7 * 4);
    -    gl.vertexAttribPointer(this.shader.colorAttribute, 1, gl.FLOAT, false, stride, 9 * 4);
    -    
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFilterManager.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFilterManager.js.html deleted file mode 100755 index 389585a..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLFilterManager.js.html +++ /dev/null @@ -1,728 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLFilterManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLFilterManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class WebGLFilterManager
    -* @constructor
    -*/
    -PIXI.WebGLFilterManager = function()
    -{
    -    /**
    -     * @property filterStack
    -     * @type Array
    -     */
    -    this.filterStack = [];
    -    
    -    /**
    -     * @property offsetX
    -     * @type Number
    -     */
    -    this.offsetX = 0;
    -
    -    /**
    -     * @property offsetY
    -     * @type Number
    -     */
    -    this.offsetY = 0;
    -};
    -
    -PIXI.WebGLFilterManager.prototype.constructor = PIXI.WebGLFilterManager;
    -
    -/**
    -* Initialises the context and the properties.
    -* 
    -* @method setContext 
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLFilterManager.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -    this.texturePool = [];
    -
    -    this.initShaderBuffers();
    -};
    -
    -/**
    -* @method begin
    -* @param renderSession {RenderSession} 
    -* @param buffer {ArrayBuffer} 
    -*/
    -PIXI.WebGLFilterManager.prototype.begin = function(renderSession, buffer)
    -{
    -    this.renderSession = renderSession;
    -    this.defaultShader = renderSession.shaderManager.defaultShader;
    -
    -    var projection = this.renderSession.projection;
    -    this.width = projection.x * 2;
    -    this.height = -projection.y * 2;
    -    this.buffer = buffer;
    -};
    -
    -/**
    -* Applies the filter and adds it to the current filter stack.
    -* 
    -* @method pushFilter
    -* @param filterBlock {Object} the filter that will be pushed to the current filter stack
    -*/
    -PIXI.WebGLFilterManager.prototype.pushFilter = function(filterBlock)
    -{
    -    var gl = this.gl;
    -
    -    var projection = this.renderSession.projection;
    -    var offset = this.renderSession.offset;
    -
    -    filterBlock._filterArea = filterBlock.target.filterArea || filterBlock.target.getBounds();
    -
    -    // filter program
    -    // OPTIMISATION - the first filter is free if its a simple color change?
    -    this.filterStack.push(filterBlock);
    -
    -    var filter = filterBlock.filterPasses[0];
    -
    -    this.offsetX += filterBlock._filterArea.x;
    -    this.offsetY += filterBlock._filterArea.y;
    -
    -    var texture = this.texturePool.pop();
    -    if(!texture)
    -    {
    -        texture = new PIXI.FilterTexture(this.gl, this.width, this.height);
    -    }
    -    else
    -    {
    -        texture.resize(this.width, this.height);
    -    }
    -
    -    gl.bindTexture(gl.TEXTURE_2D,  texture.texture);
    -
    -    var filterArea = filterBlock._filterArea;// filterBlock.target.getBounds();///filterBlock.target.filterArea;
    -
    -    var padding = filter.padding;
    -    filterArea.x -= padding;
    -    filterArea.y -= padding;
    -    filterArea.width += padding * 2;
    -    filterArea.height += padding * 2;
    -
    -    // cap filter to screen size..
    -    if(filterArea.x < 0)filterArea.x = 0;
    -    if(filterArea.width > this.width)filterArea.width = this.width;
    -    if(filterArea.y < 0)filterArea.y = 0;
    -    if(filterArea.height > this.height)filterArea.height = this.height;
    -
    -    //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA,  filterArea.width, filterArea.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, texture.frameBuffer);
    -
    -    // set view port
    -    gl.viewport(0, 0, filterArea.width, filterArea.height);
    -
    -    projection.x = filterArea.width/2;
    -    projection.y = -filterArea.height/2;
    -
    -    offset.x = -filterArea.x;
    -    offset.y = -filterArea.y;
    -
    -    // update projection
    -    // now restore the regular shader..
    -    // this.renderSession.shaderManager.setShader(this.defaultShader);
    -    //gl.uniform2f(this.defaultShader.projectionVector, filterArea.width/2, -filterArea.height/2);
    -    //gl.uniform2f(this.defaultShader.offsetVector, -filterArea.x, -filterArea.y);
    -
    -    gl.colorMask(true, true, true, true);
    -    gl.clearColor(0,0,0, 0);
    -    gl.clear(gl.COLOR_BUFFER_BIT);
    -
    -    filterBlock._glFilterTexture = texture;
    -
    -};
    -
    -/**
    -* Removes the last filter from the filter stack and doesn't return it.
    -* 
    -* @method popFilter
    -*/
    -PIXI.WebGLFilterManager.prototype.popFilter = function()
    -{
    -    var gl = this.gl;
    -    var filterBlock = this.filterStack.pop();
    -    var filterArea = filterBlock._filterArea;
    -    var texture = filterBlock._glFilterTexture;
    -    var projection = this.renderSession.projection;
    -    var offset = this.renderSession.offset;
    -
    -    if(filterBlock.filterPasses.length > 1)
    -    {
    -        gl.viewport(0, 0, filterArea.width, filterArea.height);
    -
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -
    -        this.vertexArray[0] = 0;
    -        this.vertexArray[1] = filterArea.height;
    -
    -        this.vertexArray[2] = filterArea.width;
    -        this.vertexArray[3] = filterArea.height;
    -
    -        this.vertexArray[4] = 0;
    -        this.vertexArray[5] = 0;
    -
    -        this.vertexArray[6] = filterArea.width;
    -        this.vertexArray[7] = 0;
    -
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray);
    -
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    -        // now set the uvs..
    -        this.uvArray[2] = filterArea.width/this.width;
    -        this.uvArray[5] = filterArea.height/this.height;
    -        this.uvArray[6] = filterArea.width/this.width;
    -        this.uvArray[7] = filterArea.height/this.height;
    -
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray);
    -
    -        var inputTexture = texture;
    -        var outputTexture = this.texturePool.pop();
    -        if(!outputTexture)outputTexture = new PIXI.FilterTexture(this.gl, this.width, this.height);
    -        outputTexture.resize(this.width, this.height);
    -
    -        // need to clear this FBO as it may have some left over elements from a previous filter.
    -        gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer );
    -        gl.clear(gl.COLOR_BUFFER_BIT);
    -
    -        gl.disable(gl.BLEND);
    -
    -        for (var i = 0; i < filterBlock.filterPasses.length-1; i++)
    -        {
    -            var filterPass = filterBlock.filterPasses[i];
    -
    -            gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer );
    -
    -            // set texture
    -            gl.activeTexture(gl.TEXTURE0);
    -            gl.bindTexture(gl.TEXTURE_2D, inputTexture.texture);
    -
    -            // draw texture..
    -            //filterPass.applyFilterPass(filterArea.width, filterArea.height);
    -            this.applyFilterPass(filterPass, filterArea, filterArea.width, filterArea.height);
    -
    -            // swap the textures..
    -            var temp = inputTexture;
    -            inputTexture = outputTexture;
    -            outputTexture = temp;
    -        }
    -
    -        gl.enable(gl.BLEND);
    -
    -        texture = inputTexture;
    -        this.texturePool.push(outputTexture);
    -    }
    -
    -    var filter = filterBlock.filterPasses[filterBlock.filterPasses.length-1];
    -
    -    this.offsetX -= filterArea.x;
    -    this.offsetY -= filterArea.y;
    -
    -    var sizeX = this.width;
    -    var sizeY = this.height;
    -
    -    var offsetX = 0;
    -    var offsetY = 0;
    -
    -    var buffer = this.buffer;
    -
    -    // time to render the filters texture to the previous scene
    -    if(this.filterStack.length === 0)
    -    {
    -        gl.colorMask(true, true, true, true);//this.transparent);
    -    }
    -    else
    -    {
    -        var currentFilter = this.filterStack[this.filterStack.length-1];
    -        filterArea = currentFilter._filterArea;
    -
    -        sizeX = filterArea.width;
    -        sizeY = filterArea.height;
    -
    -        offsetX = filterArea.x;
    -        offsetY = filterArea.y;
    -
    -        buffer =  currentFilter._glFilterTexture.frameBuffer;
    -    }
    -
    -    // TODO need to remove these global elements..
    -    projection.x = sizeX/2;
    -    projection.y = -sizeY/2;
    -
    -    offset.x = offsetX;
    -    offset.y = offsetY;
    -
    -    filterArea = filterBlock._filterArea;
    -
    -    var x = filterArea.x-offsetX;
    -    var y = filterArea.y-offsetY;
    -
    -    // update the buffers..
    -    // make sure to flip the y!
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -
    -    this.vertexArray[0] = x;
    -    this.vertexArray[1] = y + filterArea.height;
    -
    -    this.vertexArray[2] = x + filterArea.width;
    -    this.vertexArray[3] = y + filterArea.height;
    -
    -    this.vertexArray[4] = x;
    -    this.vertexArray[5] = y;
    -
    -    this.vertexArray[6] = x + filterArea.width;
    -    this.vertexArray[7] = y;
    -
    -    gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    -
    -    this.uvArray[2] = filterArea.width/this.width;
    -    this.uvArray[5] = filterArea.height/this.height;
    -    this.uvArray[6] = filterArea.width/this.width;
    -    this.uvArray[7] = filterArea.height/this.height;
    -
    -    gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray);
    -
    -    gl.viewport(0, 0, sizeX, sizeY);
    -
    -    // bind the buffer
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, buffer );
    -
    -    // set the blend mode! 
    -    //gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA)
    -
    -    // set texture
    -    gl.activeTexture(gl.TEXTURE0);
    -    gl.bindTexture(gl.TEXTURE_2D, texture.texture);
    -
    -    // apply!
    -    this.applyFilterPass(filter, filterArea, sizeX, sizeY);
    -
    -    // now restore the regular shader.. should happen automatically now..
    -    // this.renderSession.shaderManager.setShader(this.defaultShader);
    -    // gl.uniform2f(this.defaultShader.projectionVector, sizeX/2, -sizeY/2);
    -    // gl.uniform2f(this.defaultShader.offsetVector, -offsetX, -offsetY);
    -
    -    // return the texture to the pool
    -    this.texturePool.push(texture);
    -    filterBlock._glFilterTexture = null;
    -};
    -
    -
    -/**
    -* Applies the filter to the specified area.
    -* 
    -* @method applyFilterPass
    -* @param filter {AbstractFilter} the filter that needs to be applied
    -* @param filterArea {Texture} TODO - might need an update
    -* @param width {Number} the horizontal range of the filter
    -* @param height {Number} the vertical range of the filter
    -*/
    -PIXI.WebGLFilterManager.prototype.applyFilterPass = function(filter, filterArea, width, height)
    -{
    -    // use program
    -    var gl = this.gl;
    -    var shader = filter.shaders[gl.id];
    -
    -    if(!shader)
    -    {
    -        shader = new PIXI.PixiShader(gl);
    -
    -        shader.fragmentSrc = filter.fragmentSrc;
    -        shader.uniforms = filter.uniforms;
    -        shader.init();
    -
    -        filter.shaders[gl.id] = shader;
    -    }
    -
    -    // set the shader
    -    this.renderSession.shaderManager.setShader(shader);
    -
    -//    gl.useProgram(shader.program);
    -
    -    gl.uniform2f(shader.projectionVector, width/2, -height/2);
    -    gl.uniform2f(shader.offsetVector, 0,0);
    -
    -    if(filter.uniforms.dimensions)
    -    {
    -        filter.uniforms.dimensions.value[0] = this.width;//width;
    -        filter.uniforms.dimensions.value[1] = this.height;//height;
    -        filter.uniforms.dimensions.value[2] = this.vertexArray[0];
    -        filter.uniforms.dimensions.value[3] = this.vertexArray[5];//filterArea.height;
    -    }
    -
    -    shader.syncUniforms();
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -    gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    -    gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    -    gl.vertexAttribPointer(shader.colorAttribute, 2, gl.FLOAT, false, 0, 0);
    -
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -
    -    // draw the filter...
    -    gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 );
    -
    -    this.renderSession.drawCount++;
    -};
    -
    -/**
    -* Initialises the shader buffers.
    -* 
    -* @method initShaderBuffers
    -*/
    -PIXI.WebGLFilterManager.prototype.initShaderBuffers = function()
    -{
    -    var gl = this.gl;
    -
    -    // create some buffers
    -    this.vertexBuffer = gl.createBuffer();
    -    this.uvBuffer = gl.createBuffer();
    -    this.colorBuffer = gl.createBuffer();
    -    this.indexBuffer = gl.createBuffer();
    -
    -    // bind and upload the vertexs..
    -    // keep a reference to the vertexFloatData..
    -    this.vertexArray = new PIXI.Float32Array([0.0, 0.0,
    -                                         1.0, 0.0,
    -                                         0.0, 1.0,
    -                                         1.0, 1.0]);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.vertexArray, gl.STATIC_DRAW);
    -
    -    // bind and upload the uv buffer
    -    this.uvArray = new PIXI.Float32Array([0.0, 0.0,
    -                                     1.0, 0.0,
    -                                     0.0, 1.0,
    -                                     1.0, 1.0]);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.uvArray, gl.STATIC_DRAW);
    -
    -    this.colorArray = new PIXI.Float32Array([1.0, 0xFFFFFF,
    -                                        1.0, 0xFFFFFF,
    -                                        1.0, 0xFFFFFF,
    -                                        1.0, 0xFFFFFF]);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.colorArray, gl.STATIC_DRAW);
    -
    -    // bind and upload the index
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 1, 3, 2]), gl.STATIC_DRAW);
    -
    -};
    -
    -/**
    -* Destroys the filter and removes it from the filter stack.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLFilterManager.prototype.destroy = function()
    -{
    -    var gl = this.gl;
    -
    -    this.filterStack = null;
    -    
    -    this.offsetX = 0;
    -    this.offsetY = 0;
    -
    -    // destroy textures
    -    for (var i = 0; i < this.texturePool.length; i++) {
    -        this.texturePool[i].destroy();
    -    }
    -    
    -    this.texturePool = null;
    -
    -    //destroy buffers..
    -    gl.deleteBuffer(this.vertexBuffer);
    -    gl.deleteBuffer(this.uvBuffer);
    -    gl.deleteBuffer(this.colorBuffer);
    -    gl.deleteBuffer(this.indexBuffer);
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLGraphics.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLGraphics.js.html deleted file mode 100755 index 121a416..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLGraphics.js.html +++ /dev/null @@ -1,1157 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLGraphics.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLGraphics.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A set of functions used by the webGL renderer to draw the primitive graphics data
    - *
    - * @class WebGLGraphics
    - * @private
    - * @static
    - */
    -PIXI.WebGLGraphics = function()
    -{
    -};
    -
    -/**
    - * Renders the graphics object
    - *
    - * @static
    - * @private
    - * @method renderGraphics
    - * @param graphics {Graphics}
    - * @param renderSession {Object}
    - */
    -PIXI.WebGLGraphics.renderGraphics = function(graphics, renderSession)//projection, offset)
    -{
    -    var gl = renderSession.gl;
    -    var projection = renderSession.projection,
    -        offset = renderSession.offset,
    -        shader = renderSession.shaderManager.primitiveShader,
    -        webGLData;
    -
    -    if(graphics.dirty)
    -    {
    -        PIXI.WebGLGraphics.updateGraphics(graphics, gl);
    -    }
    -
    -    var webGL = graphics._webGL[gl.id];
    -
    -    // This  could be speeded up for sure!
    -
    -    for (var i = 0; i < webGL.data.length; i++)
    -    {
    -        if(webGL.data[i].mode === 1)
    -        {
    -            webGLData = webGL.data[i];
    -
    -            renderSession.stencilManager.pushStencil(graphics, webGLData, renderSession);
    -
    -            // render quad..
    -            gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 );
    -            
    -            renderSession.stencilManager.popStencil(graphics, webGLData, renderSession);
    -        }
    -        else
    -        {
    -            webGLData = webGL.data[i];
    -           
    -
    -            renderSession.shaderManager.setShader( shader );//activatePrimitiveShader();
    -            shader = renderSession.shaderManager.primitiveShader;
    -            gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true));
    -
    -            gl.uniform2f(shader.projectionVector, projection.x, -projection.y);
    -            gl.uniform2f(shader.offsetVector, -offset.x, -offset.y);
    -
    -            gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint));
    -
    -            gl.uniform1f(shader.alpha, graphics.worldAlpha);
    -            
    -
    -            gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer);
    -
    -            gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0);
    -            gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4);
    -
    -            // set the index buffer!
    -            gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer);
    -            gl.drawElements(gl.TRIANGLE_STRIP,  webGLData.indices.length, gl.UNSIGNED_SHORT, 0 );
    -        }
    -    }
    -};
    -
    -/**
    - * Updates the graphics object
    - *
    - * @static
    - * @private
    - * @method updateGraphics
    - * @param graphicsData {Graphics} The graphics object to update
    - * @param gl {WebGLContext} the current WebGL drawing context
    - */
    -PIXI.WebGLGraphics.updateGraphics = function(graphics, gl)
    -{
    -    // get the contexts graphics object
    -    var webGL = graphics._webGL[gl.id];
    -    // if the graphics object does not exist in the webGL context time to create it!
    -    if(!webGL)webGL = graphics._webGL[gl.id] = {lastIndex:0, data:[], gl:gl};
    -
    -    // flag the graphics as not dirty as we are about to update it...
    -    graphics.dirty = false;
    -
    -    var i;
    -
    -    // if the user cleared the graphics object we will need to clear every object
    -    if(graphics.clearDirty)
    -    {
    -        graphics.clearDirty = false;
    -
    -        // lop through and return all the webGLDatas to the object pool so than can be reused later on
    -        for (i = 0; i < webGL.data.length; i++)
    -        {
    -            var graphicsData = webGL.data[i];
    -            graphicsData.reset();
    -            PIXI.WebGLGraphics.graphicsDataPool.push( graphicsData );
    -        }
    -
    -        // clear the array and reset the index.. 
    -        webGL.data = [];
    -        webGL.lastIndex = 0;
    -    }
    -    
    -    var webGLData;
    -    
    -    // loop through the graphics datas and construct each one..
    -    // if the object is a complex fill then the new stencil buffer technique will be used
    -    // other wise graphics objects will be pushed into a batch..
    -    for (i = webGL.lastIndex; i < graphics.graphicsData.length; i++)
    -    {
    -        var data = graphics.graphicsData[i];
    -
    -        if(data.type === PIXI.Graphics.POLY)
    -        {
    -            // need to add the points the the graphics object..
    -            data.points = data.shape.points.slice();
    -            if(data.shape.closed)
    -            {
    -                // close the poly if the valu is true!
    -                if(data.points[0] !== data.points[data.points.length-2] && data.points[1] !== data.points[data.points.length-1])
    -                {
    -                    data.points.push(data.points[0], data.points[1]);
    -                }
    -            }
    -
    -            // MAKE SURE WE HAVE THE CORRECT TYPE..
    -            if(data.fill)
    -            {
    -                if(data.points.length >= 6)
    -                {
    -                    if(data.points.length > 5 * 2)
    -                    {
    -                        webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1);
    -                        PIXI.WebGLGraphics.buildComplexPoly(data, webGLData);
    -                    }
    -                    else
    -                    {
    -                        webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0);
    -                        PIXI.WebGLGraphics.buildPoly(data, webGLData);
    -                    }
    -                }
    -            }
    -
    -            if(data.lineWidth > 0)
    -            {
    -                webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0);
    -                PIXI.WebGLGraphics.buildLine(data, webGLData);
    -
    -            }
    -        }
    -        else
    -        {
    -            webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0);
    -            
    -            if(data.type === PIXI.Graphics.RECT)
    -            {
    -                PIXI.WebGLGraphics.buildRectangle(data, webGLData);
    -            }
    -            else if(data.type === PIXI.Graphics.CIRC || data.type === PIXI.Graphics.ELIP)
    -            {
    -                PIXI.WebGLGraphics.buildCircle(data, webGLData);
    -            }
    -            else if(data.type === PIXI.Graphics.RREC)
    -            {
    -                PIXI.WebGLGraphics.buildRoundedRectangle(data, webGLData);
    -            }
    -        }
    -
    -        webGL.lastIndex++;
    -    }
    -
    -    // upload all the dirty data...
    -    for (i = 0; i < webGL.data.length; i++)
    -    {
    -        webGLData = webGL.data[i];
    -        if(webGLData.dirty)webGLData.upload();
    -    }
    -};
    -
    -/**
    - * @static
    - * @private
    - * @method switchMode
    - * @param webGL {WebGLContext}
    - * @param type {Number}
    - */
    -PIXI.WebGLGraphics.switchMode = function(webGL, type)
    -{
    -    var webGLData;
    -
    -    if(!webGL.data.length)
    -    {
    -        webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl);
    -        webGLData.mode = type;
    -        webGL.data.push(webGLData);
    -    }
    -    else
    -    {
    -        webGLData = webGL.data[webGL.data.length-1];
    -
    -        if(webGLData.mode !== type || type === 1)
    -        {
    -            webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl);
    -            webGLData.mode = type;
    -            webGL.data.push(webGLData);
    -        }
    -    }
    -
    -    webGLData.dirty = true;
    -
    -    return webGLData;
    -};
    -
    -/**
    - * Builds a rectangle to draw
    - *
    - * @static
    - * @private
    - * @method buildRectangle
    - * @param graphicsData {Graphics} The graphics object containing all the necessary properties
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildRectangle = function(graphicsData, webGLData)
    -{
    -    // --- //
    -    // need to convert points to a nice regular data
    -    //
    -    var rectData = graphicsData.shape;
    -    var x = rectData.x;
    -    var y = rectData.y;
    -    var width = rectData.width;
    -    var height = rectData.height;
    -
    -    if(graphicsData.fill)
    -    {
    -        var color = PIXI.hex2rgb(graphicsData.fillColor);
    -        var alpha = graphicsData.fillAlpha;
    -
    -        var r = color[0] * alpha;
    -        var g = color[1] * alpha;
    -        var b = color[2] * alpha;
    -
    -        var verts = webGLData.points;
    -        var indices = webGLData.indices;
    -
    -        var vertPos = verts.length/6;
    -
    -        // start
    -        verts.push(x, y);
    -        verts.push(r, g, b, alpha);
    -
    -        verts.push(x + width, y);
    -        verts.push(r, g, b, alpha);
    -
    -        verts.push(x , y + height);
    -        verts.push(r, g, b, alpha);
    -
    -        verts.push(x + width, y + height);
    -        verts.push(r, g, b, alpha);
    -
    -        // insert 2 dead triangles..
    -        indices.push(vertPos, vertPos, vertPos+1, vertPos+2, vertPos+3, vertPos+3);
    -    }
    -
    -    if(graphicsData.lineWidth)
    -    {
    -        var tempPoints = graphicsData.points;
    -
    -        graphicsData.points = [x, y,
    -                  x + width, y,
    -                  x + width, y + height,
    -                  x, y + height,
    -                  x, y];
    -
    -
    -        PIXI.WebGLGraphics.buildLine(graphicsData, webGLData);
    -
    -        graphicsData.points = tempPoints;
    -    }
    -};
    -
    -/**
    - * Builds a rounded rectangle to draw
    - *
    - * @static
    - * @private
    - * @method buildRoundedRectangle
    - * @param graphicsData {Graphics} The graphics object containing all the necessary properties
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildRoundedRectangle = function(graphicsData, webGLData)
    -{
    -    var rrectData = graphicsData.shape;
    -    var x = rrectData.x;
    -    var y = rrectData.y;
    -    var width = rrectData.width;
    -    var height = rrectData.height;
    -
    -    var radius = rrectData.radius;
    -
    -    var recPoints = [];
    -    recPoints.push(x, y + radius);
    -    recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x, y + height - radius, x, y + height, x + radius, y + height));
    -    recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius));
    -    recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width, y + radius, x + width, y, x + width - radius, y));
    -    recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + radius, y, x, y, x, y + radius));
    -
    -    if (graphicsData.fill) {
    -        var color = PIXI.hex2rgb(graphicsData.fillColor);
    -        var alpha = graphicsData.fillAlpha;
    -
    -        var r = color[0] * alpha;
    -        var g = color[1] * alpha;
    -        var b = color[2] * alpha;
    -
    -        var verts = webGLData.points;
    -        var indices = webGLData.indices;
    -
    -        var vecPos = verts.length/6;
    -
    -        var triangles = PIXI.PolyK.Triangulate(recPoints);
    -
    -        var i = 0;
    -        for (i = 0; i < triangles.length; i+=3)
    -        {
    -            indices.push(triangles[i] + vecPos);
    -            indices.push(triangles[i] + vecPos);
    -            indices.push(triangles[i+1] + vecPos);
    -            indices.push(triangles[i+2] + vecPos);
    -            indices.push(triangles[i+2] + vecPos);
    -        }
    -
    -        for (i = 0; i < recPoints.length; i++)
    -        {
    -            verts.push(recPoints[i], recPoints[++i], r, g, b, alpha);
    -        }
    -    }
    -
    -    if (graphicsData.lineWidth) {
    -        var tempPoints = graphicsData.points;
    -
    -        graphicsData.points = recPoints;
    -
    -        PIXI.WebGLGraphics.buildLine(graphicsData, webGLData);
    -
    -        graphicsData.points = tempPoints;
    -    }
    -};
    -
    -/**
    - * Calculate the points for a quadratic bezier curve. (helper function..)
    - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c
    - *
    - * @static
    - * @private
    - * @method quadraticBezierCurve
    - * @param fromX {Number} Origin point x
    - * @param fromY {Number} Origin point x
    - * @param cpX {Number} Control point x
    - * @param cpY {Number} Control point y
    - * @param toX {Number} Destination point x
    - * @param toY {Number} Destination point y
    - * @return {Array<Number>}
    - */
    -PIXI.WebGLGraphics.quadraticBezierCurve = function(fromX, fromY, cpX, cpY, toX, toY) {
    -
    -    var xa,
    -        ya,
    -        xb,
    -        yb,
    -        x,
    -        y,
    -        n = 20,
    -        points = [];
    -
    -    function getPt(n1 , n2, perc) {
    -        var diff = n2 - n1;
    -
    -        return n1 + ( diff * perc );
    -    }
    -
    -    var j = 0;
    -    for (var i = 0; i <= n; i++ )
    -    {
    -        j = i / n;
    -
    -        // The Green Line
    -        xa = getPt( fromX , cpX , j );
    -        ya = getPt( fromY , cpY , j );
    -        xb = getPt( cpX , toX , j );
    -        yb = getPt( cpY , toY , j );
    -
    -        // The Black Dot
    -        x = getPt( xa , xb , j );
    -        y = getPt( ya , yb , j );
    -
    -        points.push(x, y);
    -    }
    -    return points;
    -};
    -
    -/**
    - * Builds a circle to draw
    - *
    - * @static
    - * @private
    - * @method buildCircle
    - * @param graphicsData {Graphics} The graphics object to draw
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildCircle = function(graphicsData, webGLData)
    -{
    -    // need to convert points to a nice regular data
    -    var circleData = graphicsData.shape;
    -    var x = circleData.x;
    -    var y = circleData.y;
    -    var width;
    -    var height;
    -    
    -    // TODO - bit hacky??
    -    if(graphicsData.type === PIXI.Graphics.CIRC)
    -    {
    -        width = circleData.radius;
    -        height = circleData.radius;
    -    }
    -    else
    -    {
    -        width = circleData.width;
    -        height = circleData.height;
    -    }
    -
    -    var totalSegs = 40;
    -    var seg = (Math.PI * 2) / totalSegs ;
    -
    -    var i = 0;
    -
    -    if(graphicsData.fill)
    -    {
    -        var color = PIXI.hex2rgb(graphicsData.fillColor);
    -        var alpha = graphicsData.fillAlpha;
    -
    -        var r = color[0] * alpha;
    -        var g = color[1] * alpha;
    -        var b = color[2] * alpha;
    -
    -        var verts = webGLData.points;
    -        var indices = webGLData.indices;
    -
    -        var vecPos = verts.length/6;
    -
    -        indices.push(vecPos);
    -
    -        for (i = 0; i < totalSegs + 1 ; i++)
    -        {
    -            verts.push(x,y, r, g, b, alpha);
    -
    -            verts.push(x + Math.sin(seg * i) * width,
    -                       y + Math.cos(seg * i) * height,
    -                       r, g, b, alpha);
    -
    -            indices.push(vecPos++, vecPos++);
    -        }
    -
    -        indices.push(vecPos-1);
    -    }
    -
    -    if(graphicsData.lineWidth)
    -    {
    -        var tempPoints = graphicsData.points;
    -
    -        graphicsData.points = [];
    -
    -        for (i = 0; i < totalSegs + 1; i++)
    -        {
    -            graphicsData.points.push(x + Math.sin(seg * i) * width,
    -                                     y + Math.cos(seg * i) * height);
    -        }
    -
    -        PIXI.WebGLGraphics.buildLine(graphicsData, webGLData);
    -
    -        graphicsData.points = tempPoints;
    -    }
    -};
    -
    -/**
    - * Builds a line to draw
    - *
    - * @static
    - * @private
    - * @method buildLine
    - * @param graphicsData {Graphics} The graphics object containing all the necessary properties
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildLine = function(graphicsData, webGLData)
    -{
    -    // TODO OPTIMISE!
    -    var i = 0;
    -    var points = graphicsData.points;
    -    if(points.length === 0)return;
    -
    -    // if the line width is an odd number add 0.5 to align to a whole pixel
    -    if(graphicsData.lineWidth%2)
    -    {
    -        for (i = 0; i < points.length; i++) {
    -            points[i] += 0.5;
    -        }
    -    }
    -
    -    // get first and last point.. figure out the middle!
    -    var firstPoint = new PIXI.Point( points[0], points[1] );
    -    var lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] );
    -
    -    // if the first point is the last point - gonna have issues :)
    -    if(firstPoint.x === lastPoint.x && firstPoint.y === lastPoint.y)
    -    {
    -        // need to clone as we are going to slightly modify the shape..
    -        points = points.slice();
    -
    -        points.pop();
    -        points.pop();
    -
    -        lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] );
    -
    -        var midPointX = lastPoint.x + (firstPoint.x - lastPoint.x) *0.5;
    -        var midPointY = lastPoint.y + (firstPoint.y - lastPoint.y) *0.5;
    -
    -        points.unshift(midPointX, midPointY);
    -        points.push(midPointX, midPointY);
    -    }
    -
    -    var verts = webGLData.points;
    -    var indices = webGLData.indices;
    -    var length = points.length / 2;
    -    var indexCount = points.length;
    -    var indexStart = verts.length/6;
    -
    -    // DRAW the Line
    -    var width = graphicsData.lineWidth / 2;
    -
    -    // sort color
    -    var color = PIXI.hex2rgb(graphicsData.lineColor);
    -    var alpha = graphicsData.lineAlpha;
    -    var r = color[0] * alpha;
    -    var g = color[1] * alpha;
    -    var b = color[2] * alpha;
    -
    -    var px, py, p1x, p1y, p2x, p2y, p3x, p3y;
    -    var perpx, perpy, perp2x, perp2y, perp3x, perp3y;
    -    var a1, b1, c1, a2, b2, c2;
    -    var denom, pdist, dist;
    -
    -    p1x = points[0];
    -    p1y = points[1];
    -
    -    p2x = points[2];
    -    p2y = points[3];
    -
    -    perpx = -(p1y - p2y);
    -    perpy =  p1x - p2x;
    -
    -    dist = Math.sqrt(perpx*perpx + perpy*perpy);
    -
    -    perpx /= dist;
    -    perpy /= dist;
    -    perpx *= width;
    -    perpy *= width;
    -
    -    // start
    -    verts.push(p1x - perpx , p1y - perpy,
    -                r, g, b, alpha);
    -
    -    verts.push(p1x + perpx , p1y + perpy,
    -                r, g, b, alpha);
    -
    -    for (i = 1; i < length-1; i++)
    -    {
    -        p1x = points[(i-1)*2];
    -        p1y = points[(i-1)*2 + 1];
    -
    -        p2x = points[(i)*2];
    -        p2y = points[(i)*2 + 1];
    -
    -        p3x = points[(i+1)*2];
    -        p3y = points[(i+1)*2 + 1];
    -
    -        perpx = -(p1y - p2y);
    -        perpy = p1x - p2x;
    -
    -        dist = Math.sqrt(perpx*perpx + perpy*perpy);
    -        perpx /= dist;
    -        perpy /= dist;
    -        perpx *= width;
    -        perpy *= width;
    -
    -        perp2x = -(p2y - p3y);
    -        perp2y = p2x - p3x;
    -
    -        dist = Math.sqrt(perp2x*perp2x + perp2y*perp2y);
    -        perp2x /= dist;
    -        perp2y /= dist;
    -        perp2x *= width;
    -        perp2y *= width;
    -
    -        a1 = (-perpy + p1y) - (-perpy + p2y);
    -        b1 = (-perpx + p2x) - (-perpx + p1x);
    -        c1 = (-perpx + p1x) * (-perpy + p2y) - (-perpx + p2x) * (-perpy + p1y);
    -        a2 = (-perp2y + p3y) - (-perp2y + p2y);
    -        b2 = (-perp2x + p2x) - (-perp2x + p3x);
    -        c2 = (-perp2x + p3x) * (-perp2y + p2y) - (-perp2x + p2x) * (-perp2y + p3y);
    -
    -        denom = a1*b2 - a2*b1;
    -
    -        if(Math.abs(denom) < 0.1 )
    -        {
    -
    -            denom+=10.1;
    -            verts.push(p2x - perpx , p2y - perpy,
    -                r, g, b, alpha);
    -
    -            verts.push(p2x + perpx , p2y + perpy,
    -                r, g, b, alpha);
    -
    -            continue;
    -        }
    -
    -        px = (b1*c2 - b2*c1)/denom;
    -        py = (a2*c1 - a1*c2)/denom;
    -
    -
    -        pdist = (px -p2x) * (px -p2x) + (py -p2y) + (py -p2y);
    -
    -
    -        if(pdist > 140 * 140)
    -        {
    -            perp3x = perpx - perp2x;
    -            perp3y = perpy - perp2y;
    -
    -            dist = Math.sqrt(perp3x*perp3x + perp3y*perp3y);
    -            perp3x /= dist;
    -            perp3y /= dist;
    -            perp3x *= width;
    -            perp3y *= width;
    -
    -            verts.push(p2x - perp3x, p2y -perp3y);
    -            verts.push(r, g, b, alpha);
    -
    -            verts.push(p2x + perp3x, p2y +perp3y);
    -            verts.push(r, g, b, alpha);
    -
    -            verts.push(p2x - perp3x, p2y -perp3y);
    -            verts.push(r, g, b, alpha);
    -
    -            indexCount++;
    -        }
    -        else
    -        {
    -
    -            verts.push(px , py);
    -            verts.push(r, g, b, alpha);
    -
    -            verts.push(p2x - (px-p2x), p2y - (py - p2y));
    -            verts.push(r, g, b, alpha);
    -        }
    -    }
    -
    -    p1x = points[(length-2)*2];
    -    p1y = points[(length-2)*2 + 1];
    -
    -    p2x = points[(length-1)*2];
    -    p2y = points[(length-1)*2 + 1];
    -
    -    perpx = -(p1y - p2y);
    -    perpy = p1x - p2x;
    -
    -    dist = Math.sqrt(perpx*perpx + perpy*perpy);
    -    perpx /= dist;
    -    perpy /= dist;
    -    perpx *= width;
    -    perpy *= width;
    -
    -    verts.push(p2x - perpx , p2y - perpy);
    -    verts.push(r, g, b, alpha);
    -
    -    verts.push(p2x + perpx , p2y + perpy);
    -    verts.push(r, g, b, alpha);
    -
    -    indices.push(indexStart);
    -
    -    for (i = 0; i < indexCount; i++)
    -    {
    -        indices.push(indexStart++);
    -    }
    -
    -    indices.push(indexStart-1);
    -};
    -
    -/**
    - * Builds a complex polygon to draw
    - *
    - * @static
    - * @private
    - * @method buildComplexPoly
    - * @param graphicsData {Graphics} The graphics object containing all the necessary properties
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildComplexPoly = function(graphicsData, webGLData)
    -{
    -    //TODO - no need to copy this as it gets turned into a FLoat32Array anyways..
    -    var points = graphicsData.points.slice();
    -    if(points.length < 6)return;
    -
    -    // get first and last point.. figure out the middle!
    -    var indices = webGLData.indices;
    -    webGLData.points = points;
    -    webGLData.alpha = graphicsData.fillAlpha;
    -    webGLData.color = PIXI.hex2rgb(graphicsData.fillColor);
    -
    -    /*
    -        calclate the bounds..
    -    */
    -    var minX = Infinity;
    -    var maxX = -Infinity;
    -
    -    var minY = Infinity;
    -    var maxY = -Infinity;
    -
    -    var x,y;
    -
    -    // get size..
    -    for (var i = 0; i < points.length; i+=2)
    -    {
    -        x = points[i];
    -        y = points[i+1];
    -
    -        minX = x < minX ? x : minX;
    -        maxX = x > maxX ? x : maxX;
    -
    -        minY = y < minY ? y : minY;
    -        maxY = y > maxY ? y : maxY;
    -    }
    -
    -    // add a quad to the end cos there is no point making another buffer!
    -    points.push(minX, minY,
    -                maxX, minY,
    -                maxX, maxY,
    -                minX, maxY);
    -
    -    // push a quad onto the end.. 
    -    
    -    //TODO - this aint needed!
    -    var length = points.length / 2;
    -    for (i = 0; i < length; i++)
    -    {
    -        indices.push( i );
    -    }
    -
    -};
    -
    -/**
    - * Builds a polygon to draw
    - *
    - * @static
    - * @private
    - * @method buildPoly
    - * @param graphicsData {Graphics} The graphics object containing all the necessary properties
    - * @param webGLData {Object}
    - */
    -PIXI.WebGLGraphics.buildPoly = function(graphicsData, webGLData)
    -{
    -    var points = graphicsData.points;
    -
    -    if(points.length < 6)return;
    -    // get first and last point.. figure out the middle!
    -    var verts = webGLData.points;
    -    var indices = webGLData.indices;
    -
    -    var length = points.length / 2;
    -
    -    // sort color
    -    var color = PIXI.hex2rgb(graphicsData.fillColor);
    -    var alpha = graphicsData.fillAlpha;
    -    var r = color[0] * alpha;
    -    var g = color[1] * alpha;
    -    var b = color[2] * alpha;
    -
    -    var triangles = PIXI.PolyK.Triangulate(points);
    -    var vertPos = verts.length / 6;
    -
    -    var i = 0;
    -
    -    for (i = 0; i < triangles.length; i+=3)
    -    {
    -        indices.push(triangles[i] + vertPos);
    -        indices.push(triangles[i] + vertPos);
    -        indices.push(triangles[i+1] + vertPos);
    -        indices.push(triangles[i+2] +vertPos);
    -        indices.push(triangles[i+2] + vertPos);
    -    }
    -
    -    for (i = 0; i < length; i++)
    -    {
    -        verts.push(points[i * 2], points[i * 2 + 1],
    -                   r, g, b, alpha);
    -    }
    -
    -};
    -
    -PIXI.WebGLGraphics.graphicsDataPool = [];
    -
    -/**
    - * @class WebGLGraphicsData
    - * @private
    - * @static
    - */
    -PIXI.WebGLGraphicsData = function(gl)
    -{
    -    this.gl = gl;
    -
    -    //TODO does this need to be split before uploding??
    -    this.color = [0,0,0]; // color split!
    -    this.points = [];
    -    this.indices = [];
    -    this.lastIndex = 0;
    -    this.buffer = gl.createBuffer();
    -    this.indexBuffer = gl.createBuffer();
    -    this.mode = 1;
    -    this.alpha = 1;
    -    this.dirty = true;
    -};
    -
    -/**
    - * @method reset
    - */
    -PIXI.WebGLGraphicsData.prototype.reset = function()
    -{
    -    this.points = [];
    -    this.indices = [];
    -    this.lastIndex = 0;
    -};
    -
    -/**
    - * @method upload
    - */
    -PIXI.WebGLGraphicsData.prototype.upload = function()
    -{
    -    var gl = this.gl;
    -
    -//    this.lastIndex = graphics.graphicsData.length;
    -    this.glPoints = new PIXI.Float32Array(this.points);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.glPoints, gl.STATIC_DRAW);
    -
    -    this.glIndicies = new PIXI.Uint16Array(this.indices);
    -
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.glIndicies, gl.STATIC_DRAW);
    -
    -    this.dirty = false;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLMaskManager.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLMaskManager.js.html deleted file mode 100755 index 40c6e1f..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLMaskManager.js.html +++ /dev/null @@ -1,347 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLMaskManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLMaskManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class WebGLMaskManager
    -* @constructor
    -* @private
    -*/
    -PIXI.WebGLMaskManager = function()
    -{
    -};
    -
    -PIXI.WebGLMaskManager.prototype.constructor = PIXI.WebGLMaskManager;
    -
    -/**
    -* Sets the drawing context to the one given in parameter.
    -* 
    -* @method setContext 
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLMaskManager.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -};
    -
    -/**
    -* Applies the Mask and adds it to the current filter stack.
    -* 
    -* @method pushMask
    -* @param maskData {Array}
    -* @param renderSession {Object}
    -*/
    -PIXI.WebGLMaskManager.prototype.pushMask = function(maskData, renderSession)
    -{
    -    var gl = renderSession.gl;
    -
    -    if(maskData.dirty)
    -    {
    -        PIXI.WebGLGraphics.updateGraphics(maskData, gl);
    -    }
    -
    -    if(!maskData._webGL[gl.id].data.length)return;
    -
    -    renderSession.stencilManager.pushStencil(maskData, maskData._webGL[gl.id].data[0], renderSession);
    -};
    -
    -/**
    -* Removes the last filter from the filter stack and doesn't return it.
    -* 
    -* @method popMask
    -* @param maskData {Array}
    -* @param renderSession {Object} an object containing all the useful parameters
    -*/
    -PIXI.WebGLMaskManager.prototype.popMask = function(maskData, renderSession)
    -{
    -    var gl = this.gl;
    -    renderSession.stencilManager.popStencil(maskData, maskData._webGL[gl.id].data[0], renderSession);
    -};
    -
    -/**
    -* Destroys the mask stack.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLMaskManager.prototype.destroy = function()
    -{
    -    this.gl = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderManager.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderManager.js.html deleted file mode 100755 index 89f1c45..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderManager.js.html +++ /dev/null @@ -1,435 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLShaderManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLShaderManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class WebGLShaderManager
    -* @constructor
    -* @private
    -*/
    -PIXI.WebGLShaderManager = function()
    -{
    -    /**
    -     * @property maxAttibs
    -     * @type Number
    -     */
    -    this.maxAttibs = 10;
    -
    -    /**
    -     * @property attribState
    -     * @type Array
    -     */
    -    this.attribState = [];
    -
    -    /**
    -     * @property tempAttribState
    -     * @type Array
    -     */
    -    this.tempAttribState = [];
    -
    -    for (var i = 0; i < this.maxAttibs; i++)
    -    {
    -        this.attribState[i] = false;
    -    }
    -
    -    /**
    -     * @property stack
    -     * @type Array
    -     */
    -    this.stack = [];
    -
    -};
    -
    -PIXI.WebGLShaderManager.prototype.constructor = PIXI.WebGLShaderManager;
    -
    -/**
    -* Initialises the context and the properties.
    -* 
    -* @method setContext 
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLShaderManager.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -    
    -    // the next one is used for rendering primitives
    -    this.primitiveShader = new PIXI.PrimitiveShader(gl);
    -
    -    // the next one is used for rendering triangle strips
    -    this.complexPrimitiveShader = new PIXI.ComplexPrimitiveShader(gl);
    -
    -    // this shader is used for the default sprite rendering
    -    this.defaultShader = new PIXI.PixiShader(gl);
    -
    -    // this shader is used for the fast sprite rendering
    -    this.fastShader = new PIXI.PixiFastShader(gl);
    -
    -    // the next one is used for rendering triangle strips
    -    this.stripShader = new PIXI.StripShader(gl);
    -    this.setShader(this.defaultShader);
    -};
    -
    -/**
    -* Takes the attributes given in parameters.
    -* 
    -* @method setAttribs
    -* @param attribs {Array} attribs 
    -*/
    -PIXI.WebGLShaderManager.prototype.setAttribs = function(attribs)
    -{
    -    // reset temp state
    -    var i;
    -
    -    for (i = 0; i < this.tempAttribState.length; i++)
    -    {
    -        this.tempAttribState[i] = false;
    -    }
    -
    -    // set the new attribs
    -    for (i = 0; i < attribs.length; i++)
    -    {
    -        var attribId = attribs[i];
    -        this.tempAttribState[attribId] = true;
    -    }
    -
    -    var gl = this.gl;
    -
    -    for (i = 0; i < this.attribState.length; i++)
    -    {
    -        if(this.attribState[i] !== this.tempAttribState[i])
    -        {
    -            this.attribState[i] = this.tempAttribState[i];
    -
    -            if(this.tempAttribState[i])
    -            {
    -                gl.enableVertexAttribArray(i);
    -            }
    -            else
    -            {
    -                gl.disableVertexAttribArray(i);
    -            }
    -        }
    -    }
    -};
    -
    -/**
    -* Sets the current shader.
    -* 
    -* @method setShader
    -* @param shader {Any}
    -*/
    -PIXI.WebGLShaderManager.prototype.setShader = function(shader)
    -{
    -    if(this._currentId === shader._UID)return false;
    -    
    -    this._currentId = shader._UID;
    -
    -    this.currentShader = shader;
    -
    -    this.gl.useProgram(shader.program);
    -    this.setAttribs(shader.attributes);
    -
    -    return true;
    -};
    -
    -/**
    -* Destroys this object.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLShaderManager.prototype.destroy = function()
    -{
    -    this.attribState = null;
    -
    -    this.tempAttribState = null;
    -
    -    this.primitiveShader.destroy();
    -
    -    this.complexPrimitiveShader.destroy();
    -
    -    this.defaultShader.destroy();
    -
    -    this.fastShader.destroy();
    -
    -    this.stripShader.destroy();
    -
    -    this.gl = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderUtils.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderUtils.js.html deleted file mode 100755 index eabb242..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderUtils.js.html +++ /dev/null @@ -1,366 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLShaderUtils.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLShaderUtils.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @method initDefaultShaders
    -* @static
    -* @private
    -*/
    -PIXI.initDefaultShaders = function()
    -{
    -};
    -
    -/**
    -* @method CompileVertexShader
    -* @static
    -* @param gl {WebGLContext} the current WebGL drawing context
    -* @param shaderSrc {Array}
    -* @return {Any}
    -*/
    -PIXI.CompileVertexShader = function(gl, shaderSrc)
    -{
    -    return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER);
    -};
    -
    -/**
    -* @method CompileFragmentShader
    -* @static
    -* @param gl {WebGLContext} the current WebGL drawing context
    -* @param shaderSrc {Array}
    -* @return {Any}
    -*/
    -PIXI.CompileFragmentShader = function(gl, shaderSrc)
    -{
    -    return PIXI._CompileShader(gl, shaderSrc, gl.FRAGMENT_SHADER);
    -};
    -
    -/**
    -* @method _CompileShader
    -* @static
    -* @private
    -* @param gl {WebGLContext} the current WebGL drawing context
    -* @param shaderSrc {Array}
    -* @param shaderType {Number}
    -* @return {Any}
    -*/
    -PIXI._CompileShader = function(gl, shaderSrc, shaderType)
    -{
    -    var src = shaderSrc.join("\n");
    -    var shader = gl.createShader(shaderType);
    -    gl.shaderSource(shader, src);
    -    gl.compileShader(shader);
    -
    -    if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS))
    -    {
    -        window.console.log(gl.getShaderInfoLog(shader));
    -        return null;
    -    }
    -
    -    return shader;
    -};
    -
    -/**
    -* @method compileProgram
    -* @static
    -* @param gl {WebGLContext} the current WebGL drawing context
    -* @param vertexSrc {Array}
    -* @param fragmentSrc {Array}
    -* @return {Any}
    -*/
    -PIXI.compileProgram = function(gl, vertexSrc, fragmentSrc)
    -{
    -    var fragmentShader = PIXI.CompileFragmentShader(gl, fragmentSrc);
    -    var vertexShader = PIXI.CompileVertexShader(gl, vertexSrc);
    -
    -    var shaderProgram = gl.createProgram();
    -
    -    gl.attachShader(shaderProgram, vertexShader);
    -    gl.attachShader(shaderProgram, fragmentShader);
    -    gl.linkProgram(shaderProgram);
    -
    -    if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS))
    -    {
    -        window.console.log("Could not initialise shaders");
    -    }
    -
    -    return shaderProgram;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLSpriteBatch.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLSpriteBatch.js.html deleted file mode 100755 index dd2dd3e..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLSpriteBatch.js.html +++ /dev/null @@ -1,883 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js

    - -
    -
    -/**
    - * @author Mat Groves
    - * 
    - * Big thanks to the very clever Matt DesLauriers <mattdesl> https://github.com/mattdesl/
    - * for creating the original pixi version!
    - *
    - * Heavily inspired by LibGDX's WebGLSpriteBatch:
    - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java
    - */
    -
    - /**
    - *
    - * @class WebGLSpriteBatch
    - * @private
    - * @constructor
    - */
    -PIXI.WebGLSpriteBatch = function()
    -{
    -    /**
    -     * @property vertSize
    -     * @type Number
    -     */
    -    this.vertSize = 6;
    -
    -    /**
    -     * The number of images in the SpriteBatch before it flushes
    -     * @property size
    -     * @type Number
    -     */
    -    this.size = 2000;//Math.pow(2, 16) /  this.vertSize;
    -
    -    //the total number of floats in our batch
    -    var numVerts = this.size * 4 *  this.vertSize;
    -    //the total number of indices in our batch
    -    var numIndices = this.size * 6;
    -
    -    /**
    -    * Holds the vertices
    -    *
    -    * @property vertices
    -    * @type Float32Array
    -    */
    -    this.vertices = new PIXI.Float32Array(numVerts);
    -
    -    /**
    -     * Holds the indices
    -     *
    -     * @property indices
    -     * @type Uint16Array
    -     */
    -    this.indices = new PIXI.Uint16Array(numIndices);
    -    
    -    /**
    -     * @property lastIndexCount
    -     * @type Number
    -     */
    -    this.lastIndexCount = 0;
    -
    -    for (var i=0, j=0; i < numIndices; i += 6, j += 4)
    -    {
    -        this.indices[i + 0] = j + 0;
    -        this.indices[i + 1] = j + 1;
    -        this.indices[i + 2] = j + 2;
    -        this.indices[i + 3] = j + 0;
    -        this.indices[i + 4] = j + 2;
    -        this.indices[i + 5] = j + 3;
    -    }
    -
    -    /**
    -     * @property drawing
    -     * @type Boolean
    -     */
    -    this.drawing = false;
    -
    -    /**
    -     * @property currentBatchSize
    -     * @type Number
    -     */
    -    this.currentBatchSize = 0;
    -
    -    /**
    -     * @property currentBaseTexture
    -     * @type BaseTexture
    -     */
    -    this.currentBaseTexture = null;
    -
    -    /**
    -     * @property dirty
    -     * @type Boolean
    -     */
    -    this.dirty = true;
    -
    -    /**
    -     * @property textures
    -     * @type Array
    -     */
    -    this.textures = [];
    -
    -    /**
    -     * @property blendModes
    -     * @type Array
    -     */
    -    this.blendModes = [];
    -
    -    /**
    -     * @property shaders
    -     * @type Array
    -     */
    -    this.shaders = [];
    -
    -    /**
    -     * @property sprites
    -     * @type Array
    -     */
    -    this.sprites = [];
    -
    -    /**
    -     * @property defaultShader
    -     * @type AbstractFilter
    -     */
    -    this.defaultShader = new PIXI.AbstractFilter([
    -        'precision lowp float;',
    -        'varying vec2 vTextureCoord;',
    -        'varying vec4 vColor;',
    -        'uniform sampler2D uSampler;',
    -        'void main(void) {',
    -        '   gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;',
    -        '}'
    -    ]);
    -};
    -
    -/**
    -* @method setContext
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLSpriteBatch.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -
    -    // create a couple of buffers
    -    this.vertexBuffer = gl.createBuffer();
    -    this.indexBuffer = gl.createBuffer();
    -
    -    // 65535 is max index, so 65535 / 6 = 10922.
    -
    -    //upload the index data
    -    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
    -
    -    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -    gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW);
    -
    -    this.currentBlendMode = 99999;
    -
    -    var shader = new PIXI.PixiShader(gl);
    -
    -    shader.fragmentSrc = this.defaultShader.fragmentSrc;
    -    shader.uniforms = {};
    -    shader.init();
    -
    -    this.defaultShader.shaders[gl.id] = shader;
    -};
    -
    -/**
    -* @method begin
    -* @param renderSession {Object} The RenderSession object
    -*/
    -PIXI.WebGLSpriteBatch.prototype.begin = function(renderSession)
    -{
    -    this.renderSession = renderSession;
    -    this.shader = this.renderSession.shaderManager.defaultShader;
    -
    -    this.start();
    -};
    -
    -/**
    -* @method end
    -*/
    -PIXI.WebGLSpriteBatch.prototype.end = function()
    -{
    -    this.flush();
    -};
    -
    -/**
    -* @method render
    -* @param sprite {Sprite} the sprite to render when using this spritebatch
    -*/
    -PIXI.WebGLSpriteBatch.prototype.render = function(sprite)
    -{
    -    var texture = sprite.texture;
    -    
    -   //TODO set blend modes.. 
    -    // check texture..
    -    if(this.currentBatchSize >= this.size)
    -    {
    -        this.flush();
    -        this.currentBaseTexture = texture.baseTexture;
    -    }
    -
    -    // get the uvs for the texture
    -    var uvs = texture._uvs;
    -    // if the uvs have not updated then no point rendering just yet!
    -    if(!uvs)return;
    -
    -    // get the sprites current alpha
    -    var alpha = sprite.worldAlpha;
    -    var tint = sprite.tint;
    -
    -    var verticies = this.vertices;
    -
    -    // TODO trim??
    -    var aX = sprite.anchor.x;
    -    var aY = sprite.anchor.y;
    -
    -    var w0, w1, h0, h1;
    -        
    -    if (texture.trim)
    -    {
    -        // if the sprite is trimmed then we need to add the extra space before transforming the sprite coords..
    -        var trim = texture.trim;
    -
    -        w1 = trim.x - aX * trim.width;
    -        w0 = w1 + texture.crop.width;
    -
    -        h1 = trim.y - aY * trim.height;
    -        h0 = h1 + texture.crop.height;
    -
    -    }
    -    else
    -    {
    -        w0 = (texture.frame.width ) * (1-aX);
    -        w1 = (texture.frame.width ) * -aX;
    -
    -        h0 = texture.frame.height * (1-aY);
    -        h1 = texture.frame.height * -aY;
    -    }
    -
    -    var index = this.currentBatchSize * 4 * this.vertSize;
    -    
    -    var resolution = texture.baseTexture.resolution;
    -
    -    var worldTransform = sprite.worldTransform;
    -
    -    var a = worldTransform.a / resolution;
    -    var b = worldTransform.b / resolution;
    -    var c = worldTransform.c / resolution;
    -    var d = worldTransform.d / resolution;
    -    var tx = worldTransform.tx;
    -    var ty = worldTransform.ty;
    -
    -
    -    // xy
    -    verticies[index++] = a * w1 + c * h1 + tx;
    -    verticies[index++] = d * h1 + b * w1 + ty;
    -    // uv
    -    verticies[index++] = uvs.x0;
    -    verticies[index++] = uvs.y0;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // xy
    -    verticies[index++] = a * w0 + c * h1 + tx;
    -    verticies[index++] = d * h1 + b * w0 + ty;
    -    // uv
    -    verticies[index++] = uvs.x1;
    -    verticies[index++] = uvs.y1;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // xy
    -    verticies[index++] = a * w0 + c * h0 + tx;
    -    verticies[index++] = d * h0 + b * w0 + ty;
    -    // uv
    -    verticies[index++] = uvs.x2;
    -    verticies[index++] = uvs.y2;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // xy
    -    verticies[index++] = a * w1 + c * h0 + tx;
    -    verticies[index++] = d * h0 + b * w1 + ty;
    -    // uv
    -    verticies[index++] = uvs.x3;
    -    verticies[index++] = uvs.y3;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -    
    -    // increment the batchsize
    -    this.sprites[this.currentBatchSize++] = sprite;
    -
    -};
    -
    -/**
    -* Renders a TilingSprite using the spriteBatch.
    -* 
    -* @method renderTilingSprite
    -* @param sprite {TilingSprite} the tilingSprite to render
    -*/
    -PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite)
    -{
    -    var texture = tilingSprite.tilingTexture;
    -
    -    // check texture..
    -    if(this.currentBatchSize >= this.size)
    -    {
    -        //return;
    -        this.flush();
    -        this.currentBaseTexture = texture.baseTexture;
    -    }
    -
    -     // set the textures uvs temporarily
    -    // TODO create a separate texture so that we can tile part of a texture
    -
    -    if(!tilingSprite._uvs)tilingSprite._uvs = new PIXI.TextureUvs();
    -
    -    var uvs = tilingSprite._uvs;
    -
    -    tilingSprite.tilePosition.x %= texture.baseTexture.width * tilingSprite.tileScaleOffset.x;
    -    tilingSprite.tilePosition.y %= texture.baseTexture.height * tilingSprite.tileScaleOffset.y;
    -
    -    var offsetX =  tilingSprite.tilePosition.x/(texture.baseTexture.width*tilingSprite.tileScaleOffset.x);
    -    var offsetY =  tilingSprite.tilePosition.y/(texture.baseTexture.height*tilingSprite.tileScaleOffset.y);
    -
    -    var scaleX =  (tilingSprite.width / texture.baseTexture.width)  / (tilingSprite.tileScale.x * tilingSprite.tileScaleOffset.x);
    -    var scaleY =  (tilingSprite.height / texture.baseTexture.height) / (tilingSprite.tileScale.y * tilingSprite.tileScaleOffset.y);
    -
    -    uvs.x0 = 0 - offsetX;
    -    uvs.y0 = 0 - offsetY;
    -
    -    uvs.x1 = (1 * scaleX) - offsetX;
    -    uvs.y1 = 0 - offsetY;
    -
    -    uvs.x2 = (1 * scaleX) - offsetX;
    -    uvs.y2 = (1 * scaleY) - offsetY;
    -
    -    uvs.x3 = 0 - offsetX;
    -    uvs.y3 = (1 *scaleY) - offsetY;
    -
    -    // get the tilingSprites current alpha
    -    var alpha = tilingSprite.worldAlpha;
    -    var tint = tilingSprite.tint;
    -
    -    var  verticies = this.vertices;
    -
    -    var width = tilingSprite.width;
    -    var height = tilingSprite.height;
    -
    -    // TODO trim??
    -    var aX = tilingSprite.anchor.x;
    -    var aY = tilingSprite.anchor.y;
    -    var w0 = width * (1-aX);
    -    var w1 = width * -aX;
    -
    -    var h0 = height * (1-aY);
    -    var h1 = height * -aY;
    -
    -    var index = this.currentBatchSize * 4 * this.vertSize;
    -
    -    var resolution = texture.baseTexture.resolution;
    -
    -    var worldTransform = tilingSprite.worldTransform;
    -
    -    var a = worldTransform.a / resolution;//[0];
    -    var b = worldTransform.b / resolution;//[3];
    -    var c = worldTransform.c / resolution;//[1];
    -    var d = worldTransform.d / resolution;//[4];
    -    var tx = worldTransform.tx;//[2];
    -    var ty = worldTransform.ty;///[5];
    -
    -    // xy
    -    verticies[index++] = a * w1 + c * h1 + tx;
    -    verticies[index++] = d * h1 + b * w1 + ty;
    -    // uv
    -    verticies[index++] = uvs.x0;
    -    verticies[index++] = uvs.y0;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // xy
    -    verticies[index++] = (a * w0 + c * h1 + tx);
    -    verticies[index++] = d * h1 + b * w0 + ty;
    -    // uv
    -    verticies[index++] = uvs.x1;
    -    verticies[index++] = uvs.y1;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -    
    -    // xy
    -    verticies[index++] = a * w0 + c * h0 + tx;
    -    verticies[index++] = d * h0 + b * w0 + ty;
    -    // uv
    -    verticies[index++] = uvs.x2;
    -    verticies[index++] = uvs.y2;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // xy
    -    verticies[index++] = a * w1 + c * h0 + tx;
    -    verticies[index++] = d * h0 + b * w1 + ty;
    -    // uv
    -    verticies[index++] = uvs.x3;
    -    verticies[index++] = uvs.y3;
    -    // color
    -    verticies[index++] = alpha;
    -    verticies[index++] = tint;
    -
    -    // increment the batchsize
    -    this.sprites[this.currentBatchSize++] = tilingSprite;
    -};
    -
    -/**
    -* Renders the content and empties the current batch.
    -*
    -* @method flush
    -*/
    -PIXI.WebGLSpriteBatch.prototype.flush = function()
    -{
    -    // If the batch is length 0 then return as there is nothing to draw
    -    if (this.currentBatchSize===0)return;
    -
    -    var gl = this.gl;
    -    var shader;
    -
    -    if(this.dirty)
    -    {
    -        this.dirty = false;
    -        // bind the main texture
    -        gl.activeTexture(gl.TEXTURE0);
    -
    -        // bind the buffers
    -        gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    -        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    -
    -        shader =  this.defaultShader.shaders[gl.id];
    -
    -        // this is the same for each shader?
    -        var stride =  this.vertSize * 4;
    -        gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0);
    -        gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, stride, 2 * 4);
    -        gl.vertexAttribPointer(shader.colorAttribute, 2, gl.FLOAT, false, stride, 4 * 4);
    -    }
    -
    -    // upload the verts to the buffer  
    -    if(this.currentBatchSize > ( this.size * 0.5 ) )
    -    {
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices);
    -    }
    -    else
    -    {
    -        var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize);
    -        gl.bufferSubData(gl.ARRAY_BUFFER, 0, view);
    -    }
    -
    -    var nextTexture, nextBlendMode, nextShader;
    -    var batchSize = 0;
    -    var start = 0;
    -
    -    var currentBaseTexture = null;
    -    var currentBlendMode = this.renderSession.blendModeManager.currentBlendMode;
    -    var currentShader = null;
    -
    -    var blendSwap = false;
    -    var shaderSwap = false;
    -    var sprite;
    -
    -    for (var i = 0, j = this.currentBatchSize; i < j; i++) {
    -        
    -        sprite = this.sprites[i];
    -
    -        nextTexture = sprite.texture.baseTexture;
    -        nextBlendMode = sprite.blendMode;
    -        nextShader = sprite.shader || this.defaultShader;
    -
    -        blendSwap = currentBlendMode !== nextBlendMode;
    -        shaderSwap = currentShader !== nextShader; // should I use _UIDS???
    -
    -        if(currentBaseTexture !== nextTexture || blendSwap || shaderSwap)
    -        {
    -            this.renderBatch(currentBaseTexture, batchSize, start);
    -
    -            start = i;
    -            batchSize = 0;
    -            currentBaseTexture = nextTexture;
    -
    -            if( blendSwap )
    -            {
    -                currentBlendMode = nextBlendMode;
    -                this.renderSession.blendModeManager.setBlendMode( currentBlendMode );
    -            }
    -
    -            if( shaderSwap )
    -            {
    -                currentShader = nextShader;
    -                
    -                shader = currentShader.shaders[gl.id];
    -
    -                if(!shader)
    -                {
    -                    shader = new PIXI.PixiShader(gl);
    -
    -                    shader.fragmentSrc =currentShader.fragmentSrc;
    -                    shader.uniforms =currentShader.uniforms;
    -                    shader.init();
    -
    -                    currentShader.shaders[gl.id] = shader;
    -                }
    -
    -                // set shader function???
    -                this.renderSession.shaderManager.setShader(shader);
    -
    -                if(shader.dirty)shader.syncUniforms();
    -                
    -                // both thease only need to be set if they are changing..
    -                // set the projection
    -                var projection = this.renderSession.projection;
    -                gl.uniform2f(shader.projectionVector, projection.x, projection.y);
    -
    -                // TODO - this is temprorary!
    -                var offsetVector = this.renderSession.offset;
    -                gl.uniform2f(shader.offsetVector, offsetVector.x, offsetVector.y);
    -
    -                // set the pointers
    -            }
    -        }
    -
    -        batchSize++;
    -    }
    -
    -    this.renderBatch(currentBaseTexture, batchSize, start);
    -
    -    // then reset the batch!
    -    this.currentBatchSize = 0;
    -};
    -
    -/**
    -* @method renderBatch
    -* @param texture {Texture}
    -* @param size {Number}
    -* @param startIndex {Number}
    -*/
    -PIXI.WebGLSpriteBatch.prototype.renderBatch = function(texture, size, startIndex)
    -{
    -    if(size === 0)return;
    -
    -    var gl = this.gl;
    -
    -    // check if a texture is dirty..
    -    if(texture._dirty[gl.id])
    -    {
    -        this.renderSession.renderer.updateTexture(texture);
    -    }
    -    else
    -    {
    -        // bind the current texture
    -        gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]);
    -    }
    -
    -    // now draw those suckas!
    -    gl.drawElements(gl.TRIANGLES, size * 6, gl.UNSIGNED_SHORT, startIndex * 6 * 2);
    -    
    -    // increment the draw count
    -    this.renderSession.drawCount++;
    -};
    -
    -/**
    -* @method stop
    -*/
    -PIXI.WebGLSpriteBatch.prototype.stop = function()
    -{
    -    this.flush();
    -    this.dirty = true;
    -};
    -
    -/**
    -* @method start
    -*/
    -PIXI.WebGLSpriteBatch.prototype.start = function()
    -{
    -    this.dirty = true;
    -};
    -
    -/**
    -* Destroys the SpriteBatch.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLSpriteBatch.prototype.destroy = function()
    -{
    -    this.vertices = null;
    -    this.indices = null;
    -    
    -    this.gl.deleteBuffer( this.vertexBuffer );
    -    this.gl.deleteBuffer( this.indexBuffer );
    -    
    -    this.currentBaseTexture = null;
    -    
    -    this.gl = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLStencilManager.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLStencilManager.js.html deleted file mode 100755 index 20b4a01..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_renderers_webgl_utils_WebGLStencilManager.js.html +++ /dev/null @@ -1,572 +0,0 @@ - - - - - src/pixi/renderers/webgl/utils/WebGLStencilManager.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/renderers/webgl/utils/WebGLStencilManager.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    -* @class WebGLStencilManager
    -* @constructor
    -* @private
    -*/
    -PIXI.WebGLStencilManager = function()
    -{
    -    this.stencilStack = [];
    -    this.reverse = true;
    -    this.count = 0;
    -};
    -
    -/**
    -* Sets the drawing context to the one given in parameter.
    -* 
    -* @method setContext 
    -* @param gl {WebGLContext} the current WebGL drawing context
    -*/
    -PIXI.WebGLStencilManager.prototype.setContext = function(gl)
    -{
    -    this.gl = gl;
    -};
    -
    -/**
    -* Applies the Mask and adds it to the current filter stack.
    -* 
    -* @method pushMask
    -* @param graphics {Graphics}
    -* @param webGLData {Array}
    -* @param renderSession {Object}
    -*/
    -PIXI.WebGLStencilManager.prototype.pushStencil = function(graphics, webGLData, renderSession)
    -{
    -    var gl = this.gl;
    -    this.bindGraphics(graphics, webGLData, renderSession);
    -
    -    if(this.stencilStack.length === 0)
    -    {
    -        gl.enable(gl.STENCIL_TEST);
    -        gl.clear(gl.STENCIL_BUFFER_BIT);
    -        this.reverse = true;
    -        this.count = 0;
    -    }
    -
    -    this.stencilStack.push(webGLData);
    -
    -    var level = this.count;
    -
    -    gl.colorMask(false, false, false, false);
    -
    -    gl.stencilFunc(gl.ALWAYS,0,0xFF);
    -    gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT);
    -
    -    // draw the triangle strip!
    -
    -    if(webGLData.mode === 1)
    -    {
    -        gl.drawElements(gl.TRIANGLE_FAN,  webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 );
    -       
    -        if(this.reverse)
    -        {
    -            gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF);
    -            gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR);
    -        }
    -        else
    -        {
    -            gl.stencilFunc(gl.EQUAL,level, 0xFF);
    -            gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR);
    -        }
    -
    -        // draw a quad to increment..
    -        gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 );
    -               
    -        if(this.reverse)
    -        {
    -            gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF);
    -        }
    -        else
    -        {
    -            gl.stencilFunc(gl.EQUAL,level+1, 0xFF);
    -        }
    -
    -        this.reverse = !this.reverse;
    -    }
    -    else
    -    {
    -        if(!this.reverse)
    -        {
    -            gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF);
    -            gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR);
    -        }
    -        else
    -        {
    -            gl.stencilFunc(gl.EQUAL,level, 0xFF);
    -            gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR);
    -        }
    -
    -        gl.drawElements(gl.TRIANGLE_STRIP,  webGLData.indices.length, gl.UNSIGNED_SHORT, 0 );
    -
    -        if(!this.reverse)
    -        {
    -            gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF);
    -        }
    -        else
    -        {
    -            gl.stencilFunc(gl.EQUAL,level+1, 0xFF);
    -        }
    -    }
    -
    -    gl.colorMask(true, true, true, true);
    -    gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP);
    -
    -    this.count++;
    -};
    -
    -/**
    - * TODO this does not belong here!
    - * 
    - * @method bindGraphics
    - * @param graphics {Graphics}
    - * @param webGLData {Array}
    - * @param renderSession {Object}
    - */
    -PIXI.WebGLStencilManager.prototype.bindGraphics = function(graphics, webGLData, renderSession)
    -{
    -    //if(this._currentGraphics === graphics)return;
    -    this._currentGraphics = graphics;
    -
    -    var gl = this.gl;
    -
    -     // bind the graphics object..
    -    var projection = renderSession.projection,
    -        offset = renderSession.offset,
    -        shader;// = renderSession.shaderManager.primitiveShader;
    -
    -    if(webGLData.mode === 1)
    -    {
    -        shader = renderSession.shaderManager.complexPrimitiveShader;
    -
    -        renderSession.shaderManager.setShader( shader );
    -
    -        gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true));
    -
    -        gl.uniform2f(shader.projectionVector, projection.x, -projection.y);
    -        gl.uniform2f(shader.offsetVector, -offset.x, -offset.y);
    -
    -        gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint));
    -        gl.uniform3fv(shader.color, webGLData.color);
    -
    -        gl.uniform1f(shader.alpha, graphics.worldAlpha * webGLData.alpha);
    -
    -        gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer);
    -
    -        gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 2, 0);
    -
    -
    -        // now do the rest..
    -        // set the index buffer!
    -        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer);
    -    }
    -    else
    -    {
    -        //renderSession.shaderManager.activatePrimitiveShader();
    -        shader = renderSession.shaderManager.primitiveShader;
    -        renderSession.shaderManager.setShader( shader );
    -
    -        gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true));
    -
    -        gl.uniform2f(shader.projectionVector, projection.x, -projection.y);
    -        gl.uniform2f(shader.offsetVector, -offset.x, -offset.y);
    -
    -        gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint));
    -
    -        gl.uniform1f(shader.alpha, graphics.worldAlpha);
    -        
    -        gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer);
    -
    -        gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0);
    -        gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4);
    -
    -        // set the index buffer!
    -        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer);
    -    }
    -};
    -
    -/**
    - * @method popStencil
    - * @param graphics {Graphics}
    - * @param webGLData {Array}
    - * @param renderSession {Object}
    - */
    -PIXI.WebGLStencilManager.prototype.popStencil = function(graphics, webGLData, renderSession)
    -{
    -	var gl = this.gl;
    -    this.stencilStack.pop();
    -   
    -    this.count--;
    -
    -    if(this.stencilStack.length === 0)
    -    {
    -        // the stack is empty!
    -        gl.disable(gl.STENCIL_TEST);
    -
    -    }
    -    else
    -    {
    -
    -        var level = this.count;
    -
    -        this.bindGraphics(graphics, webGLData, renderSession);
    -
    -        gl.colorMask(false, false, false, false);
    -    
    -        if(webGLData.mode === 1)
    -        {
    -            this.reverse = !this.reverse;
    -
    -            if(this.reverse)
    -            {
    -                gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF);
    -                gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR);
    -            }
    -            else
    -            {
    -                gl.stencilFunc(gl.EQUAL,level+1, 0xFF);
    -                gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR);
    -            }
    -
    -            // draw a quad to increment..
    -            gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 );
    -            
    -            gl.stencilFunc(gl.ALWAYS,0,0xFF);
    -            gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT);
    -
    -            // draw the triangle strip!
    -            gl.drawElements(gl.TRIANGLE_FAN,  webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 );
    -           
    -            if(!this.reverse)
    -            {
    -                gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF);
    -            }
    -            else
    -            {
    -                gl.stencilFunc(gl.EQUAL,level, 0xFF);
    -            }
    -
    -        }
    -        else
    -        {
    -          //  console.log("<<>>")
    -            if(!this.reverse)
    -            {
    -                gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF);
    -                gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR);
    -            }
    -            else
    -            {
    -                gl.stencilFunc(gl.EQUAL,level+1, 0xFF);
    -                gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR);
    -            }
    -
    -            gl.drawElements(gl.TRIANGLE_STRIP,  webGLData.indices.length, gl.UNSIGNED_SHORT, 0 );
    -
    -            if(!this.reverse)
    -            {
    -                gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF);
    -            }
    -            else
    -            {
    -                gl.stencilFunc(gl.EQUAL,level, 0xFF);
    -            }
    -        }
    -
    -        gl.colorMask(true, true, true, true);
    -        gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP);
    -
    -
    -    }
    -};
    -
    -/**
    -* Destroys the mask stack.
    -* 
    -* @method destroy
    -*/
    -PIXI.WebGLStencilManager.prototype.destroy = function()
    -{
    -    this.stencilStack = null;
    -    this.gl = null;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_text_BitmapText.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_text_BitmapText.js.html deleted file mode 100755 index 1a2e2ce..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_text_BitmapText.js.html +++ /dev/null @@ -1,493 +0,0 @@ - - - - - src/pixi/text/BitmapText.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/text/BitmapText.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A BitmapText object will create a line or multiple lines of text using bitmap font. To split a line you can use '\n', '\r' or '\r\n' in your string.
    - * You can generate the fnt files using
    - * http://www.angelcode.com/products/bmfont/ for windows or
    - * http://www.bmglyph.com/ for mac.
    - *
    - * @class BitmapText
    - * @extends DisplayObjectContainer
    - * @constructor
    - * @param text {String} The copy that you would like the text to display
    - * @param style {Object} The style parameters
    - * @param style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)
    - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
    - */
    -PIXI.BitmapText = function(text, style)
    -{
    -    PIXI.DisplayObjectContainer.call(this);
    -
    -    /**
    -     * [read-only] The width of the overall text, different from fontSize,
    -     * which is defined in the style object
    -     *
    -     * @property textWidth
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.textWidth = 0;
    -
    -    /**
    -     * [read-only] The height of the overall text, different from fontSize,
    -     * which is defined in the style object
    -     *
    -     * @property textHeight
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.textHeight = 0;
    -
    -    /**
    -     * @property _pool
    -     * @type Array
    -     * @private
    -     */
    -    this._pool = [];
    -
    -    this.setText(text);
    -    this.setStyle(style);
    -    this.updateText();
    -
    -    /**
    -     * The dirty state of this object.
    -     * @property dirty
    -     * @type Boolean
    -     */
    -    this.dirty = false;
    -};
    -
    -// constructor
    -PIXI.BitmapText.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
    -PIXI.BitmapText.prototype.constructor = PIXI.BitmapText;
    -
    -/**
    - * Set the text string to be rendered.
    - *
    - * @method setText
    - * @param text {String} The text that you would like displayed
    - */
    -PIXI.BitmapText.prototype.setText = function(text)
    -{
    -    this.text = text || ' ';
    -    this.dirty = true;
    -};
    -
    -/**
    - * Set the style of the text
    - * style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)
    - * [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single lines of text
    - *
    - * @method setStyle
    - * @param style {Object} The style parameters, contained as properties of an object
    - */
    -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;
    -    this.tint = style.tint;
    -};
    -
    -/**
    - * Renders text and updates it when needed
    - *
    - * @method updateText
    - * @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(/(?:\r\n|\r|\n)/.test(this.text.charAt(i)))
    -        {
    -            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.kerning[prevCharCode])
    -        {
    -            pos.x += charData.kerning[prevCharCode];
    -        }
    -
    -        chars.push({texture:charData.texture, 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);
    -    }
    -
    -    var lenChildren = this.children.length;
    -    var lenChars = chars.length;
    -    var tint = this.tint || 0xFFFFFF;
    -
    -    for(i = 0; i < lenChars; i++)
    -    {
    -        var c = i < lenChildren ? this.children[i] : this._pool.pop(); // get old child if have. if not - take from pool.
    -
    -        if (c) c.setTexture(chars[i].texture); // check if got one before.
    -        else c = new PIXI.Sprite(chars[i].texture); // if no create new one.
    -
    -        c.position.x = (chars[i].position.x + lineAlignOffsets[chars[i].line]) * scale;
    -        c.position.y = chars[i].position.y * scale;
    -        c.scale.x = c.scale.y = scale;
    -        c.tint = tint;
    -        if (!c.parent) this.addChild(c);
    -    }
    -
    -    // remove unnecessary children.
    -    // and put their into the pool.
    -    while(this.children.length > lenChars)
    -    {
    -        var child = this.getChildAt(this.children.length - 1);
    -        this._pool.push(child);
    -        this.removeChild(child);
    -    }
    -
    -    this.textWidth = maxLineWidth * scale;
    -    this.textHeight = (pos.y + data.lineHeight) * scale;
    -};
    -
    -/**
    - * Updates the transform of this object
    - *
    - * @method updateTransform
    - * @private
    - */
    -PIXI.BitmapText.prototype.updateTransform = function()
    -{
    -    if(this.dirty)
    -    {
    -        this.updateText();
    -        this.dirty = false;
    -    }
    -
    -    PIXI.DisplayObjectContainer.prototype.updateTransform.call(this);
    -};
    -
    -PIXI.BitmapText.fonts = {};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_text_Text.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_text_Text.js.html deleted file mode 100755 index fb28604..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_text_Text.js.html +++ /dev/null @@ -1,805 +0,0 @@ - - - - - src/pixi/text/Text.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/text/Text.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * Modified by Tom Slezakowski http://www.tomslezakowski.com @TomSlezakowski (24/03/2014) - Added dropShadowColor.
    - */
    -
    -/**
    - * A Text Object will create a line or multiple lines of text. To split a line you can use '\n' in your text string,
    - * or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object.
    - *
    - * @class Text
    - * @extends Sprite
    - * @constructor
    - * @param text {String} The copy that you would like the text to display
    - * @param [style] {Object} The style parameters
    - * @param [style.font] {String} default 'bold 20px Arial' The style and size of the font
    - * @param [style.fill='black'] {String|Number} A canvas fillstyle that will be used on the text e.g 'red', '#00FF00'
    - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
    - * @param [style.stroke] {String|Number} A canvas fillstyle that will be used on the text stroke e.g 'blue', '#FCFF00'
    - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke)
    - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used
    - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap, it needs wordWrap to be set to true
    - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text
    - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00'
    - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow
    - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow
    - */
    -PIXI.Text = function(text, style)
    -{
    -    /**
    -     * The canvas element that everything is drawn to
    -     *
    -     * @property canvas
    -     * @type HTMLCanvasElement
    -     */
    -    this.canvas = document.createElement('canvas');
    -
    -    /**
    -     * The canvas 2d context that everything is drawn with
    -     * @property context
    -     * @type HTMLCanvasElement
    -     */
    -    this.context = this.canvas.getContext('2d');
    -
    -    /**
    -     * The resolution of the canvas.
    -     * @property resolution
    -     * @type Number
    -     */
    -    this.resolution = 1;
    -
    -    PIXI.Sprite.call(this, PIXI.Texture.fromCanvas(this.canvas));
    -
    -    this.setText(text);
    -    this.setStyle(style);
    -
    -};
    -
    -// constructor
    -PIXI.Text.prototype = Object.create(PIXI.Sprite.prototype);
    -PIXI.Text.prototype.constructor = PIXI.Text;
    -
    -/**
    - * The width of the Text, setting this will actually modify the scale to achieve the value set
    - *
    - * @property width
    - * @type Number
    - */
    -Object.defineProperty(PIXI.Text.prototype, 'width', {
    -    get: function() {
    -
    -        if(this.dirty)
    -        {
    -            this.updateText();
    -            this.dirty = false;
    -        }
    -
    -
    -        return this.scale.x * this.texture.frame.width;
    -    },
    -    set: function(value) {
    -        this.scale.x = value / this.texture.frame.width;
    -        this._width = value;
    -    }
    -});
    -
    -/**
    - * The height of the Text, setting this will actually modify the scale to achieve the value set
    - *
    - * @property height
    - * @type Number
    - */
    -Object.defineProperty(PIXI.Text.prototype, 'height', {
    -    get: function() {
    -
    -        if(this.dirty)
    -        {
    -            this.updateText();
    -            this.dirty = false;
    -        }
    -
    -
    -        return  this.scale.y * this.texture.frame.height;
    -    },
    -    set: function(value) {
    -        this.scale.y = value / this.texture.frame.height;
    -        this._height = value;
    -    }
    -});
    -
    -/**
    - * Set the style of the text
    - *
    - * @method setStyle
    - * @param [style] {Object} The style parameters
    - * @param [style.font='bold 20pt Arial'] {String} The style and size of the font
    - * @param [style.fill='black'] {Object} A canvas fillstyle that will be used on the text eg 'red', '#00FF00'
    - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
    - * @param [style.stroke='black'] {String} A canvas fillstyle that will be used on the text stroke eg 'blue', '#FCFF00'
    - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke)
    - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used
    - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap
    - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text
    - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00'
    - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow
    - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow
    - */
    -PIXI.Text.prototype.setStyle = function(style)
    -{
    -    style = style || {};
    -    style.font = style.font || 'bold 20pt Arial';
    -    style.fill = style.fill || 'black';
    -    style.align = style.align || 'left';
    -    style.stroke = style.stroke || 'black'; //provide a default, see: https://github.com/GoodBoyDigital/pixi.js/issues/136
    -    style.strokeThickness = style.strokeThickness || 0;
    -    style.wordWrap = style.wordWrap || false;
    -    style.wordWrapWidth = style.wordWrapWidth || 100;
    -    
    -    style.dropShadow = style.dropShadow || false;
    -    style.dropShadowAngle = style.dropShadowAngle || Math.PI / 6;
    -    style.dropShadowDistance = style.dropShadowDistance || 4;
    -    style.dropShadowColor = style.dropShadowColor || 'black';
    -
    -    this.style = style;
    -    this.dirty = true;
    -};
    -
    -/**
    - * Set the copy for the text object. To split a line you can use '\n'.
    - *
    - * @method setText
    - * @param text {String} The copy that you would like the text to display
    - */
    -PIXI.Text.prototype.setText = function(text)
    -{
    -    this.text = text.toString() || ' ';
    -    this.dirty = true;
    -};
    -
    -/**
    - * Renders text and updates it when needed
    - *
    - * @method updateText
    - * @private
    - */
    -PIXI.Text.prototype.updateText = function()
    -{
    -    this.texture.baseTexture.resolution = this.resolution;
    -
    -    this.context.font = this.style.font;
    -
    -    var outputText = this.text;
    -
    -    // word wrap
    -    // preserve original text
    -    if(this.style.wordWrap)outputText = this.wordWrap(this.text);
    -
    -    //split text into lines
    -    var lines = outputText.split(/(?:\r\n|\r|\n)/);
    -
    -    //calculate text width
    -    var lineWidths = [];
    -    var maxLineWidth = 0;
    -    var fontProperties = this.determineFontProperties(this.style.font);
    -    for (var i = 0; i < lines.length; i++)
    -    {
    -        var lineWidth = this.context.measureText(lines[i]).width;
    -        lineWidths[i] = lineWidth;
    -        maxLineWidth = Math.max(maxLineWidth, lineWidth);
    -    }
    -
    -    var width = maxLineWidth + this.style.strokeThickness;
    -    if(this.style.dropShadow)width += this.style.dropShadowDistance;
    -
    -    this.canvas.width = ( width + this.context.lineWidth ) * this.resolution;
    -    
    -    //calculate text height
    -    var lineHeight = fontProperties.fontSize + this.style.strokeThickness;
    - 
    -    var height = lineHeight * lines.length;
    -    if(this.style.dropShadow)height += this.style.dropShadowDistance;
    -
    -    this.canvas.height = height * this.resolution;
    -
    -    this.context.scale( this.resolution, this.resolution);
    -
    -    if(navigator.isCocoonJS) this.context.clearRect(0,0,this.canvas.width,this.canvas.height);
    -    
    -    this.context.font = this.style.font;
    -    this.context.strokeStyle = this.style.stroke;
    -    this.context.lineWidth = this.style.strokeThickness;
    -    this.context.textBaseline = 'alphabetic';
    -    //this.context.lineJoin = 'round';
    -
    -    var linePositionX;
    -    var linePositionY;
    -
    -    if(this.style.dropShadow)
    -    {
    -        this.context.fillStyle = this.style.dropShadowColor;
    -
    -        var xShadowOffset = Math.sin(this.style.dropShadowAngle) * this.style.dropShadowDistance;
    -        var yShadowOffset = Math.cos(this.style.dropShadowAngle) * this.style.dropShadowDistance;
    -
    -        for (i = 0; i < lines.length; i++)
    -        {
    -            linePositionX = this.style.strokeThickness / 2;
    -            linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent;
    -
    -            if(this.style.align === 'right')
    -            {
    -                linePositionX += maxLineWidth - lineWidths[i];
    -            }
    -            else if(this.style.align === 'center')
    -            {
    -                linePositionX += (maxLineWidth - lineWidths[i]) / 2;
    -            }
    -
    -            if(this.style.fill)
    -            {
    -                this.context.fillText(lines[i], linePositionX + xShadowOffset, linePositionY + yShadowOffset);
    -            }
    -
    -          //  if(dropShadow)
    -        }
    -    }
    -
    -    //set canvas text styles
    -    this.context.fillStyle = this.style.fill;
    -    
    -    //draw lines line by line
    -    for (i = 0; i < lines.length; i++)
    -    {
    -        linePositionX = this.style.strokeThickness / 2;
    -        linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent;
    -
    -        if(this.style.align === 'right')
    -        {
    -            linePositionX += maxLineWidth - lineWidths[i];
    -        }
    -        else if(this.style.align === 'center')
    -        {
    -            linePositionX += (maxLineWidth - lineWidths[i]) / 2;
    -        }
    -
    -        if(this.style.stroke && this.style.strokeThickness)
    -        {
    -            this.context.strokeText(lines[i], linePositionX, linePositionY);
    -        }
    -
    -        if(this.style.fill)
    -        {
    -            this.context.fillText(lines[i], linePositionX, linePositionY);
    -        }
    -
    -      //  if(dropShadow)
    -    }
    -
    -    this.updateTexture();
    -};
    -
    -/**
    - * Updates texture size based on canvas size
    - *
    - * @method updateTexture
    - * @private
    - */
    -PIXI.Text.prototype.updateTexture = function()
    -{
    -    this.texture.baseTexture.width = this.canvas.width;
    -    this.texture.baseTexture.height = this.canvas.height;
    -    this.texture.crop.width = this.texture.frame.width = this.canvas.width;
    -    this.texture.crop.height = this.texture.frame.height = this.canvas.height;
    -
    -    this._width = this.canvas.width;
    -    this._height = this.canvas.height;
    -
    -    // update the dirty base textures
    -    this.texture.baseTexture.dirty();
    -};
    -
    -/**
    -* Renders the object using the WebGL renderer
    -*
    -* @method _renderWebGL
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.Text.prototype._renderWebGL = function(renderSession)
    -{
    -    if(this.dirty)
    -    {
    -        this.resolution = renderSession.resolution;
    -
    -        this.updateText();
    -        this.dirty = false;
    -    }
    -
    -    PIXI.Sprite.prototype._renderWebGL.call(this, renderSession);
    -};
    -
    -/**
    -* Renders the object using the Canvas renderer
    -*
    -* @method _renderCanvas
    -* @param renderSession {RenderSession} 
    -* @private
    -*/
    -PIXI.Text.prototype._renderCanvas = function(renderSession)
    -{
    -    if(this.dirty)
    -    {
    -        this.resolution = renderSession.resolution;
    -
    -        this.updateText();
    -        this.dirty = false;
    -    }
    -     
    -    PIXI.Sprite.prototype._renderCanvas.call(this, renderSession);
    -};
    -
    -/**
    -* Calculates the ascent, descent and fontSize of a given fontStyle
    -*
    -* @method determineFontProperties
    -* @param fontStyle {Object}
    -* @private
    -*/
    -PIXI.Text.prototype.determineFontProperties = function(fontStyle)
    -{
    -    var properties = PIXI.Text.fontPropertiesCache[fontStyle];
    -
    -    if(!properties)
    -    {
    -        properties = {};
    -        
    -        var canvas = PIXI.Text.fontPropertiesCanvas;
    -        var context = PIXI.Text.fontPropertiesContext;
    -
    -        context.font = fontStyle;
    -
    -        var width = Math.ceil(context.measureText('|Mq').width);
    -        var baseline = Math.ceil(context.measureText('M').width);
    -        var height = 2 * baseline;
    -
    -        baseline = baseline * 1.4 | 0;
    -
    -        canvas.width = width;
    -        canvas.height = height;
    -
    -        context.fillStyle = '#f00';
    -        context.fillRect(0, 0, width, height);
    -
    -        context.font = fontStyle;
    -
    -        context.textBaseline = 'alphabetic';
    -        context.fillStyle = '#000';
    -        context.fillText('|Mq', 0, baseline);
    -
    -        var imagedata = context.getImageData(0, 0, width, height).data;
    -        var pixels = imagedata.length;
    -        var line = width * 4;
    -
    -        var i, j;
    -
    -        var idx = 0;
    -        var stop = false;
    -
    -        // ascent. scan from top to bottom until we find a non red pixel
    -        for(i = 0; i < baseline; i++)
    -        {
    -            for(j = 0; j < line; j += 4)
    -            {
    -                if(imagedata[idx + j] !== 255)
    -                {
    -                    stop = true;
    -                    break;
    -                }
    -            }
    -            if(!stop)
    -            {
    -                idx += line;
    -            }
    -            else
    -            {
    -                break;
    -            }
    -        }
    -
    -        properties.ascent = baseline - i;
    -
    -        idx = pixels - line;
    -        stop = false;
    -
    -        // descent. scan from bottom to top until we find a non red pixel
    -        for(i = height; i > baseline; i--)
    -        {
    -            for(j = 0; j < line; j += 4)
    -            {
    -                if(imagedata[idx + j] !== 255)
    -                {
    -                    stop = true;
    -                    break;
    -                }
    -            }
    -            if(!stop)
    -            {
    -                idx -= line;
    -            }
    -            else
    -            {
    -                break;
    -            }
    -        }
    -
    -        properties.descent = i - baseline;
    -        properties.fontSize = properties.ascent + properties.descent;
    -
    -        PIXI.Text.fontPropertiesCache[fontStyle] = properties;
    -    }
    -
    -    return properties;
    -};
    -
    -/**
    - * Applies newlines to a string to have it optimally fit into the horizontal
    - * bounds set by the Text object's wordWrapWidth property.
    - *
    - * @method wordWrap
    - * @param text {String}
    - * @private
    - */
    -PIXI.Text.prototype.wordWrap = function(text)
    -{
    -    // Greedy wrapping algorithm that will wrap words as the line grows longer
    -    // than its horizontal bounds.
    -    var result = '';
    -    var lines = text.split('\n');
    -    for (var i = 0; i < lines.length; i++)
    -    {
    -        var spaceLeft = this.style.wordWrapWidth;
    -        var words = lines[i].split(' ');
    -        for (var j = 0; j < words.length; j++)
    -        {
    -            var wordWidth = this.context.measureText(words[j]).width;
    -            var wordWidthWithSpace = wordWidth + this.context.measureText(' ').width;
    -            if(j === 0 || wordWidthWithSpace > spaceLeft)
    -            {
    -                // Skip printing the newline if it's the first word of the line that is
    -                // greater than the word wrap width.
    -                if(j > 0)
    -                {
    -                    result += '\n';
    -                }
    -                result += words[j];
    -                spaceLeft = this.style.wordWrapWidth - wordWidth;
    -            }
    -            else
    -            {
    -                spaceLeft -= wordWidthWithSpace;
    -                result += ' ' + words[j];
    -            }
    -        }
    -
    -        if (i < lines.length-1)
    -        {
    -            result += '\n';
    -        }
    -    }
    -    return result;
    -};
    -
    -/**
    -* Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account.
    -*
    -* @method getBounds
    -* @param matrix {Matrix} the transformation matrix of the Text
    -* @return {Rectangle} the framing rectangle
    -*/
    -PIXI.Text.prototype.getBounds = function(matrix)
    -{
    -    if(this.dirty)
    -    {
    -        this.updateText();
    -        this.dirty = false;
    -    }
    -
    -    return PIXI.Sprite.prototype.getBounds.call(this, matrix);
    -};
    -
    -/**
    - * Destroys this text object.
    - *
    - * @method destroy
    - * @param destroyBaseTexture {Boolean} whether to destroy the base texture as well
    - */
    -PIXI.Text.prototype.destroy = function(destroyBaseTexture)
    -{
    -    // make sure to reset the the context and canvas.. dont want this hanging around in memory!
    -    this.context = null;
    -    this.canvas = null;
    -
    -    this.texture.destroy(destroyBaseTexture === undefined ? true : destroyBaseTexture);
    -};
    -
    -PIXI.Text.fontPropertiesCache = {};
    -PIXI.Text.fontPropertiesCanvas = document.createElement('canvas');
    -PIXI.Text.fontPropertiesContext = PIXI.Text.fontPropertiesCanvas.getContext('2d');
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_textures_BaseTexture.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_textures_BaseTexture.js.html deleted file mode 100755 index 4c34275..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_textures_BaseTexture.js.html +++ /dev/null @@ -1,573 +0,0 @@ - - - - - src/pixi/textures/BaseTexture.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/textures/BaseTexture.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -PIXI.BaseTextureCache = {};
    -
    -PIXI.BaseTextureCacheIdGenerator = 0;
    -
    -/**
    - * A texture stores the information that represents an image. All textures have a base texture.
    - *
    - * @class BaseTexture
    - * @uses EventTarget
    - * @constructor
    - * @param source {String} the source object (image or canvas)
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - */
    -PIXI.BaseTexture = function(source, scaleMode)
    -{
    -    /**
    -     * The Resolution of the texture. 
    -     *
    -     * @property resolution
    -     * @type Number
    -     */
    -    this.resolution = 1;
    -    
    -    /**
    -     * [read-only] The width of the base texture set when the image has loaded
    -     *
    -     * @property width
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.width = 100;
    -
    -    /**
    -     * [read-only] The height of the base texture set when the image has loaded
    -     *
    -     * @property height
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.height = 100;
    -
    -    /**
    -     * The scale mode to apply when scaling this texture
    -     * 
    -     * @property scaleMode
    -     * @type PIXI.scaleModes
    -     * @default PIXI.scaleModes.LINEAR
    -     */
    -    this.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT;
    -
    -    /**
    -     * [read-only] Set to true once the base texture has loaded
    -     *
    -     * @property hasLoaded
    -     * @type Boolean
    -     * @readOnly
    -     */
    -    this.hasLoaded = false;
    -
    -    /**
    -     * The image source that is used to create the texture.
    -     *
    -     * @property source
    -     * @type Image
    -     */
    -    this.source = source;
    -
    -    this._UID = PIXI._UID++;
    -
    -    /**
    -     * Controls if RGB channels should be pre-multiplied by Alpha  (WebGL only)
    -     *
    -     * @property premultipliedAlpha
    -     * @type Boolean
    -     * @default true
    -     */
    -    this.premultipliedAlpha = true;
    -
    -    // used for webGL
    -
    -    /**
    -     * @property _glTextures
    -     * @type Array
    -     * @private
    -     */
    -    this._glTextures = [];
    -
    -    // used for webGL texture updating...
    -    // TODO - this needs to be addressed
    -
    -    /**
    -     * @property _dirty
    -     * @type Array
    -     * @private
    -     */
    -    this._dirty = [true, true, true, true];
    -
    -    if(!source)return;
    -
    -    if((this.source.complete || this.source.getContext) && this.source.width && this.source.height)
    -    {
    -        this.hasLoaded = true;
    -        this.width = this.source.naturalWidth || this.source.width;
    -        this.height = this.source.naturalHeight || this.source.height;
    -        this.dirty();
    -    }
    -    else
    -    {
    -        var scope = this;
    -
    -        this.source.onload = function() {
    -
    -            scope.hasLoaded = true;
    -            scope.width = scope.source.naturalWidth || scope.source.width;
    -            scope.height = scope.source.naturalHeight || scope.source.height;
    -
    -            scope.dirty();
    -
    -            // add it to somewhere...
    -            scope.dispatchEvent( { type: 'loaded', content: scope } );
    -        };
    -
    -        this.source.onerror = function() {
    -            scope.dispatchEvent( { type: 'error', content: scope } );
    -        };
    -    }
    -
    -    /**
    -     * @property imageUrl
    -     * @type String
    -     */
    -    this.imageUrl = null;
    -
    -    /**
    -     * @property _powerOf2
    -     * @type Boolean
    -     * @private
    -     */
    -    this._powerOf2 = false;
    -
    -};
    -
    -PIXI.BaseTexture.prototype.constructor = PIXI.BaseTexture;
    -
    -PIXI.EventTarget.mixin(PIXI.BaseTexture.prototype);
    -
    -/**
    - * Destroys this base texture
    - *
    - * @method destroy
    - */
    -PIXI.BaseTexture.prototype.destroy = function()
    -{
    -    if(this.imageUrl)
    -    {
    -        delete PIXI.BaseTextureCache[this.imageUrl];
    -        delete PIXI.TextureCache[this.imageUrl];
    -        this.imageUrl = null;
    -        if (!navigator.isCocoonJS) this.source.src = '';
    -    }
    -    else if (this.source && this.source._pixiId)
    -    {
    -        delete PIXI.BaseTextureCache[this.source._pixiId];
    -    }
    -    this.source = null;
    -
    -    this.unloadFromGPU();
    -};
    -
    -/**
    - * Changes the source image of the texture
    - *
    - * @method updateSourceImage
    - * @param newSrc {String} the path of the image
    - */
    -PIXI.BaseTexture.prototype.updateSourceImage = function(newSrc)
    -{
    -    this.hasLoaded = false;
    -    this.source.src = null;
    -    this.source.src = newSrc;
    -};
    -
    -/**
    - * Sets all glTextures to be dirty.
    - *
    - * @method dirty
    - */
    -PIXI.BaseTexture.prototype.dirty = function()
    -{
    -    for (var i = 0; i < this._glTextures.length; i++)
    -    {
    -        this._dirty[i] = true;
    -    }
    -};
    -
    -/**
    - * Removes the base texture from the GPU, useful for managing resources on the GPU.
    - * Atexture is still 100% usable and will simply be reuploaded if there is a sprite on screen that is using it.
    - *
    - * @method unloadFromGPU
    - */
    -PIXI.BaseTexture.prototype.unloadFromGPU = function()
    -{
    -    this.dirty();
    -
    -    // delete the webGL textures if any.
    -    for (var i = this._glTextures.length - 1; i >= 0; i--)
    -    {
    -        var glTexture = this._glTextures[i];
    -        var gl = PIXI.glContexts[i];
    -
    -        if(gl && glTexture)
    -        {
    -            gl.deleteTexture(glTexture);
    -        }
    -        
    -    }
    -
    -    this._glTextures.length = 0;
    -
    -    this.dirty();
    -};
    -
    -/**
    - * Helper function that creates a base texture from the given image url.
    - * If the image is not in the base texture cache it will be created and loaded.
    - *
    - * @static
    - * @method fromImage
    - * @param imageUrl {String} The image url of the texture
    - * @param crossorigin {Boolean}
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @return BaseTexture
    - */
    -PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode)
    -{
    -    var baseTexture = PIXI.BaseTextureCache[imageUrl];
    -
    -    if(crossorigin === undefined && imageUrl.indexOf('data:') === -1) crossorigin = true;
    -
    -    if(!baseTexture)
    -    {
    -        // new Image() breaks tex loading in some versions of Chrome.
    -        // See https://code.google.com/p/chromium/issues/detail?id=238071
    -        var image = new Image();//document.createElement('img');
    -        if (crossorigin)
    -        {
    -            image.crossOrigin = '';
    -        }
    -
    -        image.src = imageUrl;
    -        baseTexture = new PIXI.BaseTexture(image, scaleMode);
    -        baseTexture.imageUrl = imageUrl;
    -        PIXI.BaseTextureCache[imageUrl] = baseTexture;
    -
    -        // if there is an @2x at the end of the url we are going to assume its a highres image
    -        if( imageUrl.indexOf(PIXI.RETINA_PREFIX + '.') !== -1)
    -        {
    -            baseTexture.resolution = 2;
    -        }
    -    }
    -
    -    return baseTexture;
    -};
    -
    -/**
    - * Helper function that creates a base texture from the given canvas element.
    - *
    - * @static
    - * @method fromCanvas
    - * @param canvas {Canvas} The canvas element source of the texture
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @return BaseTexture
    - */
    -PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode)
    -{
    -    if(!canvas._pixiId)
    -    {
    -        canvas._pixiId = 'canvas_' + PIXI.TextureCacheIdGenerator++;
    -    }
    -
    -    var baseTexture = PIXI.BaseTextureCache[canvas._pixiId];
    -
    -    if(!baseTexture)
    -    {
    -        baseTexture = new PIXI.BaseTexture(canvas, scaleMode);
    -        PIXI.BaseTextureCache[canvas._pixiId] = baseTexture;
    -    }
    -
    -    return baseTexture;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_textures_RenderTexture.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_textures_RenderTexture.js.html deleted file mode 100755 index 23c4f84..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_textures_RenderTexture.js.html +++ /dev/null @@ -1,614 +0,0 @@ - - - - - src/pixi/textures/RenderTexture.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/textures/RenderTexture.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * A RenderTexture is a special texture that allows any Pixi display object to be rendered to it.
    - *
    - * __Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead.
    - *
    - * A RenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example:
    - *
    - *    var renderTexture = new PIXI.RenderTexture(800, 600);
    - *    var sprite = PIXI.Sprite.fromImage("spinObj_01.png");
    - *    sprite.position.x = 800/2;
    - *    sprite.position.y = 600/2;
    - *    sprite.anchor.x = 0.5;
    - *    sprite.anchor.y = 0.5;
    - *    renderTexture.render(sprite);
    - *
    - * The Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual position a DisplayObjectContainer should be used:
    - *
    - *    var doc = new PIXI.DisplayObjectContainer();
    - *    doc.addChild(sprite);
    - *    renderTexture.render(doc);  // Renders to center of renderTexture
    - *
    - * @class RenderTexture
    - * @extends Texture
    - * @constructor
    - * @param width {Number} The width of the render texture
    - * @param height {Number} The height of the render texture
    - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @param resolution {Number} The resolution of the texture being generated
    - */
    -PIXI.RenderTexture = function(width, height, renderer, scaleMode, resolution)
    -{
    -    /**
    -     * The with of the render texture
    -     *
    -     * @property width
    -     * @type Number
    -     */
    -    this.width = width || 100;
    -
    -    /**
    -     * The height of the render texture
    -     *
    -     * @property height
    -     * @type Number
    -     */
    -    this.height = height || 100;
    -
    -    /**
    -     * The Resolution of the texture.
    -     *
    -     * @property resolution
    -     * @type Number
    -     */
    -    this.resolution = resolution || 1;
    -
    -    /**
    -     * The framing rectangle of the render texture
    -     *
    -     * @property frame
    -     * @type Rectangle
    -     */
    -    this.frame = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution);
    -
    -    /**
    -     * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,
    -     * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)
    -     *
    -     * @property crop
    -     * @type Rectangle
    -     */
    -    this.crop = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution);
    -
    -    /**
    -     * The base texture object that this texture uses
    -     *
    -     * @property baseTexture
    -     * @type BaseTexture
    -     */
    -    this.baseTexture = new PIXI.BaseTexture();
    -    this.baseTexture.width = this.width * this.resolution;
    -    this.baseTexture.height = this.height * this.resolution;
    -    this.baseTexture._glTextures = [];
    -    this.baseTexture.resolution = this.resolution;
    -
    -    this.baseTexture.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT;
    -
    -    this.baseTexture.hasLoaded = true;
    -
    -    PIXI.Texture.call(this,
    -        this.baseTexture,
    -        new PIXI.Rectangle(0, 0, this.width, this.height)
    -    );
    -
    -    /**
    -     * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL.
    -     *
    -     * @property renderer
    -     * @type CanvasRenderer|WebGLRenderer
    -     */
    -    this.renderer = renderer || PIXI.defaultRenderer;
    -
    -    if(this.renderer.type === PIXI.WEBGL_RENDERER)
    -    {
    -        var gl = this.renderer.gl;
    -        this.baseTexture._dirty[gl.id] = false;
    -
    -        this.textureBuffer = new PIXI.FilterTexture(gl, this.width * this.resolution, this.height * this.resolution, this.baseTexture.scaleMode);
    -        this.baseTexture._glTextures[gl.id] =  this.textureBuffer.texture;
    -
    -        this.render = this.renderWebGL;
    -        this.projection = new PIXI.Point(this.width*0.5, -this.height*0.5);
    -    }
    -    else
    -    {
    -        this.render = this.renderCanvas;
    -        this.textureBuffer = new PIXI.CanvasBuffer(this.width* this.resolution, this.height* this.resolution);
    -        this.baseTexture.source = this.textureBuffer.canvas;
    -    }
    -
    -    /**
    -     * @property valid
    -     * @type Boolean
    -     */
    -    this.valid = true;
    -
    -    this._updateUvs();
    -};
    -
    -PIXI.RenderTexture.prototype = Object.create(PIXI.Texture.prototype);
    -PIXI.RenderTexture.prototype.constructor = PIXI.RenderTexture;
    -
    -/**
    - * Resizes the RenderTexture.
    - *
    - * @method resize
    - * @param width {Number} The width to resize to.
    - * @param height {Number} The height to resize to.
    - * @param updateBase {Boolean} Should the baseTexture.width and height values be resized as well?
    - */
    -PIXI.RenderTexture.prototype.resize = function(width, height, updateBase)
    -{
    -    if (width === this.width && height === this.height)return;
    -
    -    this.valid = (width > 0 && height > 0);
    -
    -    this.width = this.frame.width = this.crop.width = width;
    -    this.height =  this.frame.height = this.crop.height = height;
    -
    -    if (updateBase)
    -    {
    -        this.baseTexture.width = this.width;
    -        this.baseTexture.height = this.height;
    -    }
    -
    -    if (this.renderer.type === PIXI.WEBGL_RENDERER)
    -    {
    -        this.projection.x = this.width / 2;
    -        this.projection.y = -this.height / 2;
    -    }
    -
    -    if(!this.valid)return;
    -
    -    this.textureBuffer.resize(this.width * this.resolution, this.height * this.resolution);
    -};
    -
    -/**
    - * Clears the RenderTexture.
    - *
    - * @method clear
    - */
    -PIXI.RenderTexture.prototype.clear = function()
    -{
    -    if(!this.valid)return;
    -
    -    if (this.renderer.type === PIXI.WEBGL_RENDERER)
    -    {
    -        this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer);
    -    }
    -
    -    this.textureBuffer.clear();
    -};
    -
    -/**
    - * This function will draw the display object to the texture.
    - *
    - * @method renderWebGL
    - * @param displayObject {DisplayObject} The display object to render this texture on
    - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering.
    - * @param [clear] {Boolean} If true the texture will be cleared before the displayObject is drawn
    - * @private
    - */
    -PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, matrix, clear)
    -{
    -    if(!this.valid)return;
    -    //TOOD replace position with matrix..
    -   
    -    //Lets create a nice matrix to apply to our display object. Frame buffers come in upside down so we need to flip the matrix 
    -    var wt = displayObject.worldTransform;
    -    wt.identity();
    -    wt.translate(0, this.projection.y * 2);
    -    if(matrix)wt.append(matrix);
    -    wt.scale(1,-1);
    -
    -    // setWorld Alpha to ensure that the object is renderer at full opacity
    -    displayObject.worldAlpha = 1;
    -
    -    // Time to update all the children of the displayObject with the new matrix..    
    -    var children = displayObject.children;
    -
    -    for(var i=0,j=children.length; i<j; i++)
    -    {
    -        children[i].updateTransform();
    -    }
    -    
    -    // time for the webGL fun stuff!
    -    var gl = this.renderer.gl;
    -
    -    gl.viewport(0, 0, this.width * this.resolution, this.height * this.resolution);
    -
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, this.textureBuffer.frameBuffer );
    -
    -    if(clear)this.textureBuffer.clear();
    -
    -    this.renderer.spriteBatch.dirty = true;
    -
    -    this.renderer.renderDisplayObject(displayObject, this.projection, this.textureBuffer.frameBuffer);
    -
    -    this.renderer.spriteBatch.dirty = true;
    -};
    -
    -
    -/**
    - * This function will draw the display object to the texture.
    - *
    - * @method renderCanvas
    - * @param displayObject {DisplayObject} The display object to render this texture on
    - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering.
    - * @param [clear] {Boolean} If true the texture will be cleared before the displayObject is drawn
    - * @private
    - */
    -PIXI.RenderTexture.prototype.renderCanvas = function(displayObject, matrix, clear)
    -{
    -    if(!this.valid)return;
    -
    -    var wt = displayObject.worldTransform;
    -    wt.identity();
    -    if(matrix)wt.append(matrix);
    -    
    -    // setWorld Alpha to ensure that the object is renderer at full opacity
    -    displayObject.worldAlpha = 1;
    -
    -    // Time to update all the children of the displayObject with the new matrix..    
    -    var children = displayObject.children;
    -
    -    for(var i = 0, j = children.length; i < j; i++)
    -    {
    -        children[i].updateTransform();
    -    }
    -
    -    if(clear)this.textureBuffer.clear();
    -
    -    var context = this.textureBuffer.context;
    -
    -    var realResolution = this.renderer.resolution;
    -
    -    this.renderer.resolution = this.resolution;
    -
    -    this.renderer.renderDisplayObject(displayObject, context);
    -
    -    this.renderer.resolution = realResolution;
    -};
    -
    -/**
    - * Will return a HTML Image of the texture
    - *
    - * @method getImage
    - * @return {Image}
    - */
    -PIXI.RenderTexture.prototype.getImage = function()
    -{
    -    var image = new Image();
    -    image.src = this.getBase64();
    -    return image;
    -};
    -
    -/**
    - * Will return a a base64 encoded string of this texture. It works by calling RenderTexture.getCanvas and then running toDataURL on that.
    - *
    - * @method getBase64
    - * @return {String} A base64 encoded string of the texture.
    - */
    -PIXI.RenderTexture.prototype.getBase64 = function()
    -{
    -    return this.getCanvas().toDataURL();
    -};
    -
    -/**
    - * Creates a Canvas element, renders this RenderTexture to it and then returns it.
    - *
    - * @method getCanvas
    - * @return {HTMLCanvasElement} A Canvas element with the texture rendered on.
    - */
    -PIXI.RenderTexture.prototype.getCanvas = function()
    -{
    -    if (this.renderer.type === PIXI.WEBGL_RENDERER)
    -    {
    -        var gl =  this.renderer.gl;
    -        var width = this.textureBuffer.width;
    -        var height = this.textureBuffer.height;
    -
    -        var webGLPixels = new Uint8Array(4 * width * height);
    -
    -        gl.bindFramebuffer(gl.FRAMEBUFFER, this.textureBuffer.frameBuffer);
    -        gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, webGLPixels);
    -        gl.bindFramebuffer(gl.FRAMEBUFFER, null);
    -
    -        var tempCanvas = new PIXI.CanvasBuffer(width, height);
    -        var canvasData = tempCanvas.context.getImageData(0, 0, width, height);
    -        canvasData.data.set(webGLPixels);
    -
    -        tempCanvas.context.putImageData(canvasData, 0, 0);
    -
    -        return tempCanvas.canvas;
    -    }
    -    else
    -    {
    -        return this.textureBuffer.canvas;
    -    }
    -};
    -
    -PIXI.RenderTexture.tempMatrix = new PIXI.Matrix();
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_textures_Texture.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_textures_Texture.js.html deleted file mode 100755 index 179da16..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_textures_Texture.js.html +++ /dev/null @@ -1,607 +0,0 @@ - - - - - src/pixi/textures/Texture.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/textures/Texture.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -PIXI.TextureCache = {};
    -PIXI.FrameCache = {};
    -
    -PIXI.TextureCacheIdGenerator = 0;
    -
    -/**
    - * A texture stores the information that represents an image or part of an image. It cannot be added
    - * to the display list directly. Instead use it as the texture for a PIXI.Sprite. If no frame is provided then the whole image is used.
    - *
    - * @class Texture
    - * @uses EventTarget
    - * @constructor
    - * @param baseTexture {BaseTexture} The base texture source to create the texture from
    - * @param frame {Rectangle} The rectangle frame of the texture to show
    - * @param [crop] {Rectangle} The area of original texture 
    - * @param [trim] {Rectangle} Trimmed texture rectangle
    - */
    -PIXI.Texture = function(baseTexture, frame, crop, trim)
    -{
    -    /**
    -     * Does this Texture have any frame data assigned to it?
    -     *
    -     * @property noFrame
    -     * @type Boolean
    -     */
    -    this.noFrame = false;
    -
    -    if (!frame)
    -    {
    -        this.noFrame = true;
    -        frame = new PIXI.Rectangle(0,0,1,1);
    -    }
    -
    -    if (baseTexture instanceof PIXI.Texture)
    -    {
    -        baseTexture = baseTexture.baseTexture;
    -    }
    -
    -    /**
    -     * The base texture that this texture uses.
    -     *
    -     * @property baseTexture
    -     * @type BaseTexture
    -     */
    -    this.baseTexture = baseTexture;
    -
    -    /**
    -     * The frame specifies the region of the base texture that this texture uses
    -     *
    -     * @property frame
    -     * @type Rectangle
    -     */
    -    this.frame = frame;
    -
    -    /**
    -     * The texture trim data.
    -     *
    -     * @property trim
    -     * @type Rectangle
    -     */
    -    this.trim = trim;
    -
    -    /**
    -     * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.
    -     *
    -     * @property valid
    -     * @type Boolean
    -     */
    -    this.valid = false;
    -
    -    /**
    -     * This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)
    -     *
    -     * @property requiresUpdate
    -     * @type Boolean
    -     */
    -    this.requiresUpdate = false;
    -
    -    /**
    -     * The WebGL UV data cache.
    -     *
    -     * @property _uvs
    -     * @type Object
    -     * @private
    -     */
    -    this._uvs = null;
    -
    -    /**
    -     * The width of the Texture in pixels.
    -     *
    -     * @property width
    -     * @type Number
    -     */
    -    this.width = 0;
    -
    -    /**
    -     * The height of the Texture in pixels.
    -     *
    -     * @property height
    -     * @type Number
    -     */
    -    this.height = 0;
    -
    -    /**
    -     * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,
    -     * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)
    -     *
    -     * @property crop
    -     * @type Rectangle
    -     */
    -    this.crop = crop || new PIXI.Rectangle(0, 0, 1, 1);
    -
    -    if (baseTexture.hasLoaded)
    -    {
    -        if (this.noFrame) frame = new PIXI.Rectangle(0, 0, baseTexture.width, baseTexture.height);
    -        this.setFrame(frame);
    -    }
    -    else
    -    {
    -        baseTexture.addEventListener('loaded', this.onBaseTextureLoaded.bind(this));
    -    }
    -};
    -
    -PIXI.Texture.prototype.constructor = PIXI.Texture;
    -PIXI.EventTarget.mixin(PIXI.Texture.prototype);
    -
    -/**
    - * Called when the base texture is loaded
    - *
    - * @method onBaseTextureLoaded
    - * @private
    - */
    -PIXI.Texture.prototype.onBaseTextureLoaded = function()
    -{
    -    var baseTexture = this.baseTexture;
    -    baseTexture.removeEventListener('loaded', this.onLoaded);
    -
    -    if (this.noFrame) this.frame = new PIXI.Rectangle(0, 0, baseTexture.width, baseTexture.height);
    -
    -    this.setFrame(this.frame);
    -
    -    this.dispatchEvent( { type: 'update', content: this } );
    -};
    -
    -/**
    - * Destroys this texture
    - *
    - * @method destroy
    - * @param destroyBase {Boolean} Whether to destroy the base texture as well
    - */
    -PIXI.Texture.prototype.destroy = function(destroyBase)
    -{
    -    if (destroyBase) this.baseTexture.destroy();
    -
    -    this.valid = false;
    -};
    -
    -/**
    - * Specifies the region of the baseTexture that this texture will use.
    - *
    - * @method setFrame
    - * @param frame {Rectangle} The frame of the texture to set it to
    - */
    -PIXI.Texture.prototype.setFrame = function(frame)
    -{
    -    this.noFrame = false;
    -
    -    this.frame = frame;
    -    this.width = frame.width;
    -    this.height = frame.height;
    -
    -    this.crop.x = frame.x;
    -    this.crop.y = frame.y;
    -    this.crop.width = frame.width;
    -    this.crop.height = frame.height;
    -
    -    if (!this.trim && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height))
    -    {
    -        throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this);
    -    }
    -
    -    this.valid = frame && frame.width && frame.height && this.baseTexture.source && this.baseTexture.hasLoaded;
    -
    -    if (this.trim)
    -    {
    -        this.width = this.trim.width;
    -        this.height = this.trim.height;
    -        this.frame.width = this.trim.width;
    -        this.frame.height = this.trim.height;
    -    }
    -    
    -    if (this.valid) this._updateUvs();
    -
    -};
    -
    -/**
    - * Updates the internal WebGL UV cache.
    - *
    - * @method _updateUvs
    - * @private
    - */
    -PIXI.Texture.prototype._updateUvs = function()
    -{
    -    if(!this._uvs)this._uvs = new PIXI.TextureUvs();
    -
    -    var frame = this.crop;
    -    var tw = this.baseTexture.width;
    -    var th = this.baseTexture.height;
    -    
    -    this._uvs.x0 = frame.x / tw;
    -    this._uvs.y0 = frame.y / th;
    -
    -    this._uvs.x1 = (frame.x + frame.width) / tw;
    -    this._uvs.y1 = frame.y / th;
    -
    -    this._uvs.x2 = (frame.x + frame.width) / tw;
    -    this._uvs.y2 = (frame.y + frame.height) / th;
    -
    -    this._uvs.x3 = frame.x / tw;
    -    this._uvs.y3 = (frame.y + frame.height) / th;
    -};
    -
    -/**
    - * Helper function that creates a Texture object from the given image url.
    - * If the image is not in the texture cache it will be  created and loaded.
    - *
    - * @static
    - * @method fromImage
    - * @param imageUrl {String} The image url of the texture
    - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @return Texture
    - */
    -PIXI.Texture.fromImage = function(imageUrl, crossorigin, scaleMode)
    -{
    -    var texture = PIXI.TextureCache[imageUrl];
    -
    -    if(!texture)
    -    {
    -        texture = new PIXI.Texture(PIXI.BaseTexture.fromImage(imageUrl, crossorigin, scaleMode));
    -        PIXI.TextureCache[imageUrl] = texture;
    -    }
    -
    -    return texture;
    -};
    -
    -/**
    - * Helper function that returns a Texture objected based on the given frame id.
    - * If the frame id is not in the texture cache an error will be thrown.
    - *
    - * @static
    - * @method fromFrame
    - * @param frameId {String} The frame id of the texture
    - * @return Texture
    - */
    -PIXI.Texture.fromFrame = function(frameId)
    -{
    -    var texture = PIXI.TextureCache[frameId];
    -    if(!texture) throw new Error('The frameId "' + frameId + '" does not exist in the texture cache ');
    -    return texture;
    -};
    -
    -/**
    - * Helper function that creates a new a Texture based on the given canvas element.
    - *
    - * @static
    - * @method fromCanvas
    - * @param canvas {Canvas} The canvas element source of the texture
    - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
    - * @return Texture
    - */
    -PIXI.Texture.fromCanvas = function(canvas, scaleMode)
    -{
    -    var baseTexture = PIXI.BaseTexture.fromCanvas(canvas, scaleMode);
    -
    -    return new PIXI.Texture( baseTexture );
    -
    -};
    -
    -/**
    - * Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object.
    - *
    - * @static
    - * @method addTextureToCache
    - * @param texture {Texture} The Texture to add to the cache.
    - * @param id {String} The id that the texture will be stored against.
    - */
    -PIXI.Texture.addTextureToCache = function(texture, id)
    -{
    -    PIXI.TextureCache[id] = texture;
    -};
    -
    -/**
    - * Remove a texture from the global PIXI.TextureCache.
    - *
    - * @static
    - * @method removeTextureFromCache
    - * @param id {String} The id of the texture to be removed
    - * @return {Texture} The texture that was removed
    - */
    -PIXI.Texture.removeTextureFromCache = function(id)
    -{
    -    var texture = PIXI.TextureCache[id];
    -    delete PIXI.TextureCache[id];
    -    delete PIXI.BaseTextureCache[id];
    -    return texture;
    -};
    -
    -PIXI.TextureUvs = function()
    -{
    -    this.x0 = 0;
    -    this.y0 = 0;
    -
    -    this.x1 = 0;
    -    this.y1 = 0;
    -
    -    this.x2 = 0;
    -    this.y2 = 0;
    -
    -    this.x3 = 0;
    -    this.y3 = 0;
    -};
    -
    -PIXI.Texture.emptyTexture = new PIXI.Texture(new PIXI.BaseTexture());
    -
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_textures_VideoTexture.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_textures_VideoTexture.js.html deleted file mode 100755 index 4e746c8..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_textures_VideoTexture.js.html +++ /dev/null @@ -1,424 +0,0 @@ - - - - - src/pixi/textures/VideoTexture.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/textures/VideoTexture.js

    - -
    -
    -
    -PIXI.VideoTexture = function( source, scaleMode )
    -{
    -    if( !source ){
    -        throw new Error( 'No video source element specified.' );
    -    }
    -
    -    // hook in here to check if video is already available.
    -    // PIXI.BaseTexture looks for a source.complete boolean, plus width & height.
    -
    -    if( (source.readyState === source.HAVE_ENOUGH_DATA || source.readyState === source.HAVE_FUTURE_DATA ) && source.width && source.height )
    -    {
    -        source.complete = true;
    -    }
    -
    -    PIXI.BaseTexture.call( this, source, scaleMode );
    -
    -    this.autoUpdate = false;
    -    this.updateBound = this._onUpdate.bind(this);
    -
    -    if( !source.complete )
    -    {
    -        this._onCanPlay = this.onCanPlay.bind(this);
    -
    -        source.addEventListener( 'canplay', this._onCanPlay );
    -        source.addEventListener( 'canplaythrough', this._onCanPlay );
    -
    -        // started playing..
    -        source.addEventListener( 'play', this.onPlayStart.bind(this) );
    -        source.addEventListener( 'pause', this.onPlayStop.bind(this) );
    -    }
    -
    -};
    -
    -PIXI.VideoTexture.prototype   = Object.create( PIXI.BaseTexture.prototype );
    -
    -PIXI.VideoTexture.constructor = PIXI.VideoTexture;
    -
    -PIXI.VideoTexture.prototype._onUpdate = function()
    -{
    -    if(this.autoUpdate)
    -    {
    -        window.requestAnimationFrame(this.updateBound);
    -        this.dirty();
    -    }
    -};
    -
    -PIXI.VideoTexture.prototype.onPlayStart = function()
    -{
    -    if(!this.autoUpdate)
    -    {
    -        window.requestAnimationFrame(this.updateBound);
    -        this.autoUpdate = true;
    -    }
    -};
    -
    -PIXI.VideoTexture.prototype.onPlayStop = function()
    -{
    -    this.autoUpdate = false;
    -};
    -
    -PIXI.VideoTexture.prototype.onCanPlay = function()
    -{
    -    if( event.type === 'canplaythrough' )
    -    {
    -        this.hasLoaded  = true;
    -
    -
    -        if( this.source )
    -        {
    -            this.source.removeEventListener( 'canplay', this._onCanPlay );
    -            this.source.removeEventListener( 'canplaythrough', this._onCanPlay );
    -
    -            this.width      = this.source.videoWidth;
    -            this.height     = this.source.videoHeight;
    -
    -            // prevent multiple loaded dispatches..
    -            if( !this.__loaded ){
    -                this.__loaded = true;
    -                this.dispatchEvent( { type: 'loaded', content: this } );
    -            }
    -        }
    -    }
    -};
    -
    -
    -/**
    - * Mimic Pixi BaseTexture.from.... method.
    - * @param video
    - * @param scaleMode
    - * @returns {PIXI.VideoTexture}
    - */
    -PIXI.VideoTexture.baseTextureFromVideo = function( video, scaleMode )
    -{
    -    if( !video._pixiId )
    -    {
    -        video._pixiId = 'video_' + PIXI.TextureCacheIdGenerator++;
    -    }
    -
    -    var baseTexture = PIXI.BaseTextureCache[ video._pixiId ];
    -
    -    if( !baseTexture )
    -    {
    -        baseTexture = new PIXI.VideoTexture( video, scaleMode );
    -        PIXI.BaseTextureCache[ video._pixiId ] = baseTexture;
    -    }
    -
    -    return baseTexture;
    -};
    -
    -
    -PIXI.VideoTexture.prototype.destroy = function()
    -{
    -    if( this.source && this.source._pixiId )
    -    {
    -        PIXI.BaseTextureCache[ this.source._pixiId ] = null;
    -        delete PIXI.BaseTextureCache[ this.source._pixiId ];
    -
    -        this.source._pixiId = null;
    -        delete this.source._pixiId;
    -    }
    -
    -    PIXI.BaseTexture.prototype.destroy.call( this );
    -};
    -
    -/**
    - * Mimic PIXI Texture.from... method.
    - * @param video
    - * @param scaleMode
    - * @returns {PIXI.Texture}
    - */
    -PIXI.VideoTexture.textureFromVideo = function( video, scaleMode )
    -{
    -    var baseTexture = PIXI.VideoTexture.baseTextureFromVideo( video, scaleMode );
    -    return new PIXI.Texture( baseTexture );
    -};
    -
    -PIXI.VideoTexture.fromUrl = function( videoSrc, scaleMode )
    -{
    -    var video = document.createElement('video');
    -    video.src = videoSrc;
    -    video.autoPlay = true;
    -    video.play();
    -    return PIXI.VideoTexture.textureFromVideo( video, scaleMode);
    -};
    -
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_utils_Detector.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_utils_Detector.js.html deleted file mode 100755 index 3e9861a..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_utils_Detector.js.html +++ /dev/null @@ -1,363 +0,0 @@ - - - - - src/pixi/utils/Detector.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/utils/Detector.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    -
    -/**
    - * This helper function will automatically detect which renderer you should be using.
    - * WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by
    - * the browser then this function will return a canvas renderer
    - * @class autoDetectRenderer
    - * @static
    - * @param width=800 {Number} the width of the renderers view
    - * @param height=600 {Number} the height of the renderers view
    - * 
    - * @param [options] {Object} The optional renderer parameters
    - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional
    - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false
    - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment)
    - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context
    - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2
    - * 
    - */
    -PIXI.autoDetectRenderer = function(width, height, options)
    -{
    -    if(!width)width = 800;
    -    if(!height)height = 600;
    -
    -    // BORROWED from Mr Doob (mrdoob.com)
    -    var webgl = ( function () { try {
    -                                    var canvas = document.createElement( 'canvas' );
    -                                    return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) );
    -                                } catch( e ) {
    -                                    return false;
    -                                }
    -                            } )();
    -
    -    if( webgl )
    -    {
    -        return new PIXI.WebGLRenderer(width, height, options);
    -    }
    -
    -    return  new PIXI.CanvasRenderer(width, height, options);
    -};
    -
    -/**
    - * This helper function will automatically detect which renderer you should be using.
    - * This function is very similar to the autoDetectRenderer function except that is will return a canvas renderer for android.
    - * Even thought both android chrome supports webGL the canvas implementation perform better at the time of writing. 
    - * This function will likely change and update as webGL performance improves on these devices.
    - * 
    - * @class autoDetectRecommendedRenderer
    - * @static
    - * @param width=800 {Number} the width of the renderers view
    - * @param height=600 {Number} the height of the renderers view
    - * 
    - * @param [options] {Object} The optional renderer parameters
    - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional
    - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false
    - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment)
    - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context
    - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2
    - * 
    - */
    -PIXI.autoDetectRecommendedRenderer = function(width, height, options)
    -{
    -    if(!width)width = 800;
    -    if(!height)height = 600;
    -
    -    // BORROWED from Mr Doob (mrdoob.com)
    -    var webgl = ( function () { try {
    -                                    var canvas = document.createElement( 'canvas' );
    -                                    return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) );
    -                                } catch( e ) {
    -                                    return false;
    -                                }
    -                            } )();
    -
    -    var isAndroid = /Android/i.test(navigator.userAgent);
    -
    -    if( webgl && !isAndroid)
    -    {
    -        return new PIXI.WebGLRenderer(width, height, options);
    -    }
    -
    -    return  new PIXI.CanvasRenderer(width, height, options);
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_utils_EventTarget.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_utils_EventTarget.js.html deleted file mode 100755 index 39afb18..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_utils_EventTarget.js.html +++ /dev/null @@ -1,562 +0,0 @@ - - - - - src/pixi/utils/EventTarget.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/utils/EventTarget.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - * @author Chad Engler https://github.com/englercj @Rolnaaba
    - */
    -
    -/**
    - * Originally based on https://github.com/mrdoob/eventtarget.js/ from mr Doob.
    - * Currently takes inspiration from the nodejs EventEmitter, EventEmitter3, and smokesignals
    - */
    -
    -/**
    - * Mixins event emitter functionality to a class
    - *
    - * @class EventTarget
    - * @example
    - *      function MyEmitter() {}
    - *
    - *      PIXI.EventTarget.mixin(MyEmitter.prototype);
    - *
    - *      var em = new MyEmitter();
    - *      em.emit('eventName', 'some data', 'some more data', {}, null, ...);
    - */
    -PIXI.EventTarget = {
    -    /**
    -     * Backward compat from when this used to be a function
    -     */
    -    call: function callCompat(obj) {
    -        if(obj) {
    -            obj = obj.prototype || obj;
    -            PIXI.EventTarget.mixin(obj);
    -        }
    -    },
    -
    -    /**
    -     * Mixes in the properties of the EventTarget prototype onto another object
    -     *
    -     * @method mixin
    -     * @param object {Object} The obj to mix into
    -     */
    -    mixin: function mixin(obj) {
    -        /**
    -         * Return a list of assigned event listeners.
    -         *
    -         * @method listeners
    -         * @param eventName {String} The events that should be listed.
    -         * @returns {Array} An array of listener functions
    -         */
    -        obj.listeners = function listeners(eventName) {
    -            this._listeners = this._listeners || {};
    -
    -            return this._listeners[eventName] ? this._listeners[eventName].slice() : [];
    -        };
    -
    -        /**
    -         * Emit an event to all registered event listeners.
    -         *
    -         * @method emit
    -         * @alias dispatchEvent
    -         * @param eventName {String} The name of the event.
    -         * @returns {Boolean} Indication if we've emitted an event.
    -         */
    -        obj.emit = obj.dispatchEvent = function emit(eventName, data) {
    -            this._listeners = this._listeners || {};
    -
    -            //backwards compat with old method ".emit({ type: 'something' })"
    -            if(typeof eventName === 'object') {
    -                data = eventName;
    -                eventName = eventName.type;
    -            }
    -
    -            //ensure we are using a real pixi event
    -            if(!data || data.__isEventObject !== true) {
    -                data = new PIXI.Event(this, eventName, data);
    -            }
    -
    -            //iterate the listeners
    -            if(this._listeners && this._listeners[eventName]) {
    -                var listeners = this._listeners[eventName].slice(0),
    -                    length = listeners.length,
    -                    fn = listeners[0],
    -                    i;
    -
    -                for(i = 0; i < length; fn = listeners[++i]) {
    -                    //call the event listener
    -                    fn.call(this, data);
    -
    -                    //if "stopImmediatePropagation" is called, stop calling sibling events
    -                    if(data.stoppedImmediate) {
    -                        return this;
    -                    }
    -                }
    -
    -                //if "stopPropagation" is called then don't bubble the event
    -                if(data.stopped) {
    -                    return this;
    -                }
    -            }
    -
    -            //bubble this event up the scene graph
    -            if(this.parent && this.parent.emit) {
    -                this.parent.emit.call(this.parent, eventName, data);
    -            }
    -
    -            return this;
    -        };
    -
    -        /**
    -         * Register a new EventListener for the given event.
    -         *
    -         * @method on
    -         * @alias addEventListener
    -         * @param eventName {String} Name of the event.
    -         * @param callback {Functon} fn Callback function.
    -         */
    -        obj.on = obj.addEventListener = function on(eventName, fn) {
    -            this._listeners = this._listeners || {};
    -
    -            (this._listeners[eventName] = this._listeners[eventName] || [])
    -                .push(fn);
    -
    -            return this;
    -        };
    -
    -        /**
    -         * Add an EventListener that's only called once.
    -         *
    -         * @method once
    -         * @param eventName {String} Name of the event.
    -         * @param callback {Function} Callback function.
    -         */
    -        obj.once = function once(eventName, fn) {
    -            this._listeners = this._listeners || {};
    -
    -            var self = this;
    -            function onceHandlerWrapper() {
    -                fn.apply(self.off(eventName, onceHandlerWrapper), arguments);
    -            }
    -            onceHandlerWrapper._originalHandler = fn;
    -
    -            return this.on(eventName, onceHandlerWrapper);
    -        };
    -
    -        /**
    -         * Remove event listeners.
    -         *
    -         * @method off
    -         * @alias removeEventListener
    -         * @param eventName {String} The event we want to remove.
    -         * @param callback {Function} The listener that we need to find.
    -         */
    -        obj.off = obj.removeEventListener = function off(eventName, fn) {
    -            this._listeners = this._listeners || {};
    -
    -            if(!this._listeners[eventName])
    -                return this;
    -
    -            var list = this._listeners[eventName],
    -                i = fn ? list.length : 0;
    -
    -            while(i-- > 0) {
    -                if(list[i] === fn || list[i]._originalHandler === fn) {
    -                    list.splice(i, 1);
    -                }
    -            }
    -
    -            if(list.length === 0) {
    -                delete this._listeners[eventName];
    -            }
    -
    -            return this;
    -        };
    -
    -        /**
    -         * Remove all listeners or only the listeners for the specified event.
    -         *
    -         * @method removeAllListeners
    -         * @param eventName {String} The event you want to remove all listeners for.
    -         */
    -        obj.removeAllListeners = function removeAllListeners(eventName) {
    -            this._listeners = this._listeners || {};
    -
    -            if(!this._listeners[eventName])
    -                return this;
    -
    -            delete this._listeners[eventName];
    -
    -            return this;
    -        };
    -    }
    -};
    -
    -/**
    - * Creates an homogenous object for tracking events so users can know what to expect.
    - *
    - * @class Event
    - * @extends Object
    - * @constructor
    - * @param target {Object} The target object that the event is called on
    - * @param name {String} The string name of the event that was triggered
    - * @param data {Object} Arbitrary event data to pass along
    - */
    -PIXI.Event = function(target, name, data) {
    -    //for duck typing in the ".on()" function
    -    this.__isEventObject = true;
    -
    -    /**
    -     * Tracks the state of bubbling propagation. Do not
    -     * set this directly, instead use `event.stopPropagation()`
    -     *
    -     * @property stopped
    -     * @type Boolean
    -     * @private
    -     * @readOnly
    -     */
    -    this.stopped = false;
    -
    -    /**
    -     * Tracks the state of sibling listener propagation. Do not
    -     * set this directly, instead use `event.stopImmediatePropagation()`
    -     *
    -     * @property stoppedImmediate
    -     * @type Boolean
    -     * @private
    -     * @readOnly
    -     */
    -    this.stoppedImmediate = false;
    -
    -    /**
    -     * The original target the event triggered on.
    -     *
    -     * @property target
    -     * @type Object
    -     * @readOnly
    -     */
    -    this.target = target;
    -
    -    /**
    -     * The string name of the event that this represents.
    -     *
    -     * @property type
    -     * @type String
    -     * @readOnly
    -     */
    -    this.type = name;
    -
    -    /**
    -     * The data that was passed in with this event.
    -     *
    -     * @property data
    -     * @type Object
    -     * @readOnly
    -     */
    -    this.data = data;
    -
    -    //backwards compat with older version of events
    -    this.content = data;
    -
    -    /**
    -     * The timestamp when the event occurred.
    -     *
    -     * @property timeStamp
    -     * @type Number
    -     * @readOnly
    -     */
    -    this.timeStamp = Date.now();
    -};
    -
    -/**
    - * Stops the propagation of events up the scene graph (prevents bubbling).
    - *
    - * @method stopPropagation
    - */
    -PIXI.Event.prototype.stopPropagation = function stopPropagation() {
    -    this.stopped = true;
    -};
    -
    -/**
    - * Stops the propagation of events to sibling listeners (no longer calls any listeners).
    - *
    - * @method stopImmediatePropagation
    - */
    -PIXI.Event.prototype.stopImmediatePropagation = function stopImmediatePropagation() {
    -    this.stoppedImmediate = true;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_utils_Polyk.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_utils_Polyk.js.html deleted file mode 100755 index a0a2226..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_utils_Polyk.js.html +++ /dev/null @@ -1,446 +0,0 @@ - - - - - src/pixi/utils/Polyk.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/utils/Polyk.js

    - -
    -
    -/*
    -    PolyK library
    -    url: http://polyk.ivank.net
    -    Released under MIT licence.
    -
    -    Copyright (c) 2012 Ivan Kuckir
    -
    -    Permission is hereby granted, free of charge, to any person
    -    obtaining a copy of this software and associated documentation
    -    files (the "Software"), to deal in the Software without
    -    restriction, including without limitation the rights to use,
    -    copy, modify, merge, publish, distribute, sublicense, and/or sell
    -    copies of the Software, and to permit persons to whom the
    -    Software is furnished to do so, subject to the following
    -    conditions:
    -
    -    The above copyright notice and this permission notice shall be
    -    included in all copies or substantial portions of the Software.
    -
    -    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    -    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
    -    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    -    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
    -    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
    -    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    -    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
    -    OTHER DEALINGS IN THE SOFTWARE.
    -
    -    This is an amazing lib!
    -
    -    Slightly modified by Mat Groves (matgroves.com);
    -*/
    -
    -/**
    - * Based on the Polyk library http://polyk.ivank.net released under MIT licence.
    - * This is an amazing lib!
    - * Slightly modified by Mat Groves (matgroves.com);
    - * @class PolyK
    - */
    -PIXI.PolyK = {};
    -
    -/**
    - * Triangulates shapes for webGL graphic fills.
    - *
    - * @method Triangulate
    - */
    -PIXI.PolyK.Triangulate = function(p)
    -{
    -    var sign = true;
    -
    -    var n = p.length >> 1;
    -    if(n < 3) return [];
    -
    -    var tgs = [];
    -    var avl = [];
    -    for(var i = 0; i < n; i++) avl.push(i);
    -
    -    i = 0;
    -    var al = n;
    -    while(al > 3)
    -    {
    -        var i0 = avl[(i+0)%al];
    -        var i1 = avl[(i+1)%al];
    -        var i2 = avl[(i+2)%al];
    -
    -        var ax = p[2*i0],  ay = p[2*i0+1];
    -        var bx = p[2*i1],  by = p[2*i1+1];
    -        var cx = p[2*i2],  cy = p[2*i2+1];
    -
    -        var earFound = false;
    -        if(PIXI.PolyK._convex(ax, ay, bx, by, cx, cy, sign))
    -        {
    -            earFound = true;
    -            for(var j = 0; j < al; j++)
    -            {
    -                var vi = avl[j];
    -                if(vi === i0 || vi === i1 || vi === i2) continue;
    -
    -                if(PIXI.PolyK._PointInTriangle(p[2*vi], p[2*vi+1], ax, ay, bx, by, cx, cy)) {
    -                    earFound = false;
    -                    break;
    -                }
    -            }
    -        }
    -
    -        if(earFound)
    -        {
    -            tgs.push(i0, i1, i2);
    -            avl.splice((i+1)%al, 1);
    -            al--;
    -            i = 0;
    -        }
    -        else if(i++ > 3*al)
    -        {
    -            // need to flip flip reverse it!
    -            // reset!
    -            if(sign)
    -            {
    -                tgs = [];
    -                avl = [];
    -                for(i = 0; i < n; i++) avl.push(i);
    -
    -                i = 0;
    -                al = n;
    -
    -                sign = false;
    -            }
    -            else
    -            {
    -                window.console.log("PIXI Warning: shape too complex to fill");
    -                return [];
    -            }
    -        }
    -    }
    -
    -    tgs.push(avl[0], avl[1], avl[2]);
    -    return tgs;
    -};
    -
    -/**
    - * Checks whether a point is within a triangle
    - *
    - * @method _PointInTriangle
    - * @param px {Number} x coordinate of the point to test
    - * @param py {Number} y coordinate of the point to test
    - * @param ax {Number} x coordinate of the a point of the triangle
    - * @param ay {Number} y coordinate of the a point of the triangle
    - * @param bx {Number} x coordinate of the b point of the triangle
    - * @param by {Number} y coordinate of the b point of the triangle
    - * @param cx {Number} x coordinate of the c point of the triangle
    - * @param cy {Number} y coordinate of the c point of the triangle
    - * @private
    - * @return {Boolean}
    - */
    -PIXI.PolyK._PointInTriangle = function(px, py, ax, ay, bx, by, cx, cy)
    -{
    -    var v0x = cx-ax;
    -    var v0y = cy-ay;
    -    var v1x = bx-ax;
    -    var v1y = by-ay;
    -    var v2x = px-ax;
    -    var v2y = py-ay;
    -
    -    var dot00 = v0x*v0x+v0y*v0y;
    -    var dot01 = v0x*v1x+v0y*v1y;
    -    var dot02 = v0x*v2x+v0y*v2y;
    -    var dot11 = v1x*v1x+v1y*v1y;
    -    var dot12 = v1x*v2x+v1y*v2y;
    -
    -    var invDenom = 1 / (dot00 * dot11 - dot01 * dot01);
    -    var u = (dot11 * dot02 - dot01 * dot12) * invDenom;
    -    var v = (dot00 * dot12 - dot01 * dot02) * invDenom;
    -
    -    // Check if point is in triangle
    -    return (u >= 0) && (v >= 0) && (u + v < 1);
    -};
    -
    -/**
    - * Checks whether a shape is convex
    - *
    - * @method _convex
    - * @private
    - * @return {Boolean}
    - */
    -PIXI.PolyK._convex = function(ax, ay, bx, by, cx, cy, sign)
    -{
    -    return ((ay-by)*(cx-bx) + (bx-ax)*(cy-by) >= 0) === sign;
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/files/src_pixi_utils_Utils.js.html b/tutorial-4/pixi.js-master/docs/files/src_pixi_utils_Utils.js.html deleted file mode 100755 index 2bcfa6e..0000000 --- a/tutorial-4/pixi.js-master/docs/files/src_pixi_utils_Utils.js.html +++ /dev/null @@ -1,485 +0,0 @@ - - - - - src/pixi/utils/Utils.js - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    File: src/pixi/utils/Utils.js

    - -
    -
    -/**
    - * @author Mat Groves http://matgroves.com/ @Doormat23
    - */
    - 
    -// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
    -// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
    -
    -// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
    -
    -// MIT license
    -
    -/**
    - * A polyfill for requestAnimationFrame
    - * You can actually use both requestAnimationFrame and requestAnimFrame, 
    - * you will still benefit from the polyfill
    - *
    - * @method requestAnimationFrame
    - */
    -
    -/**
    - * A polyfill for cancelAnimationFrame
    - *
    - * @method cancelAnimationFrame
    - */
    -(function(window) {
    -    var lastTime = 0;
    -    var vendors = ['ms', 'moz', 'webkit', 'o'];
    -    for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
    -        window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
    -        window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] ||
    -            window[vendors[x] + 'CancelRequestAnimationFrame'];
    -    }
    -
    -    if (!window.requestAnimationFrame) {
    -        window.requestAnimationFrame = function(callback) {
    -            var currTime = new Date().getTime();
    -            var timeToCall = Math.max(0, 16 - (currTime - lastTime));
    -            var id = window.setTimeout(function() { callback(currTime + timeToCall); },
    -              timeToCall);
    -            lastTime = currTime + timeToCall;
    -            return id;
    -        };
    -    }
    -
    -    if (!window.cancelAnimationFrame) {
    -        window.cancelAnimationFrame = function(id) {
    -            clearTimeout(id);
    -        };
    -    }
    -
    -    window.requestAnimFrame = window.requestAnimationFrame;
    -})(this);
    -
    -/**
    - * Converts a hex color number to an [R, G, B] array
    - *
    - * @method hex2rgb
    - * @param hex {Number}
    - */
    -PIXI.hex2rgb = function(hex) {
    -    return [(hex >> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255];
    -};
    -
    -/**
    - * Converts a color as an [R, G, B] array to a hex number
    - *
    - * @method rgb2hex
    - * @param rgb {Array}
    - */
    -PIXI.rgb2hex = function(rgb) {
    -    return ((rgb[0]*255 << 16) + (rgb[1]*255 << 8) + rgb[2]*255);
    -};
    -
    -/**
    - * A polyfill for Function.prototype.bind
    - *
    - * @method bind
    - */
    -if (typeof Function.prototype.bind !== 'function') {
    -    Function.prototype.bind = (function () {
    -        return function (thisArg) {
    -            var target = this, i = arguments.length - 1, boundArgs = [];
    -            if (i > 0)
    -            {
    -                boundArgs.length = i;
    -                while (i--) boundArgs[i] = arguments[i + 1];
    -            }
    -
    -            if (typeof target !== 'function') throw new TypeError();
    -
    -            function bound() {
    -                var i = arguments.length, args = new Array(i);
    -                while (i--) args[i] = arguments[i];
    -                args = boundArgs.concat(args);
    -                return target.apply(this instanceof bound ? this : thisArg, args);
    -            }
    -
    -            bound.prototype = (function F(proto) {
    -                if (proto) F.prototype = proto;
    -                if (!(this instanceof F)) return new F();
    -            })(target.prototype);
    -
    -            return bound;
    -        };
    -    })();
    -}
    -
    -/**
    - * A wrapper for ajax requests to be handled cross browser
    - *
    - * @class AjaxRequest
    - * @constructor
    - */
    -PIXI.AjaxRequest = function()
    -{
    -    var activexmodes = ['Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.3.0', 'Microsoft.XMLHTTP']; //activeX versions to check for in IE
    -
    -    if (window.ActiveXObject)
    -    { //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
    -        for (var i=0; i<activexmodes.length; i++)
    -        {
    -            try{
    -                return new window.ActiveXObject(activexmodes[i]);
    -            }
    -            catch(e) {
    -                //suppress error
    -            }
    -        }
    -    }
    -    else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    -    {
    -        return new window.XMLHttpRequest();
    -    }
    -    else
    -    {
    -        return false;
    -    }
    -};
    -/*
    -PIXI.packColorRGBA = function(r, g, b, a)//r, g, b, a)
    -{
    -  //  console.log(r, b, c, d)
    -  return (Math.floor((r)*63) << 18) | (Math.floor((g)*63) << 12) | (Math.floor((b)*63) << 6);// | (Math.floor((a)*63))
    -  //  i = i | (Math.floor((a)*63));
    -   // return i;
    -   // var r = (i / 262144.0 ) / 64;
    -   // var g = (i / 4096.0)%64 / 64;
    -  //  var b = (i / 64.0)%64 / 64;
    -  //  var a = (i)%64 / 64;
    -     
    -  //  console.log(r, g, b, a);
    -  //  return i;
    -
    -};
    -*/
    -/*
    -PIXI.packColorRGB = function(r, g, b)//r, g, b, a)
    -{
    -    return (Math.floor((r)*255) << 16) | (Math.floor((g)*255) << 8) | (Math.floor((b)*255));
    -};
    -
    -PIXI.unpackColorRGB = function(r, g, b)//r, g, b, a)
    -{
    -    return (Math.floor((r)*255) << 16) | (Math.floor((g)*255) << 8) | (Math.floor((b)*255));
    -};
    -*/
    -
    -/**
    - * Checks whether the Canvas BlendModes are supported by the current browser
    - *
    - * @method canUseNewCanvasBlendModes
    - * @return {Boolean} whether they are supported
    - */
    -PIXI.canUseNewCanvasBlendModes = function()
    -{
    -    if (typeof document === 'undefined') return false;
    -    var canvas = document.createElement('canvas');
    -    canvas.width = 1;
    -    canvas.height = 1;
    -    var context = canvas.getContext('2d');
    -    context.fillStyle = '#000';
    -    context.fillRect(0,0,1,1);
    -    context.globalCompositeOperation = 'multiply';
    -    context.fillStyle = '#fff';
    -    context.fillRect(0,0,1,1);
    -    return context.getImageData(0,0,1,1).data[0] === 0;
    -};
    -
    -/**
    - * Given a number, this function returns the closest number that is a power of two
    - * this function is taken from Starling Framework as its pretty neat ;)
    - *
    - * @method getNextPowerOfTwo
    - * @param number {Number}
    - * @return {Number} the closest number that is a power of two
    - */
    -PIXI.getNextPowerOfTwo = function(number)
    -{
    -    if (number > 0 && (number & (number - 1)) === 0) // see: http://goo.gl/D9kPj
    -        return number;
    -    else
    -    {
    -        var result = 1;
    -        while (result < number) result <<= 1;
    -        return result;
    -    }
    -};
    -
    -    
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/index.html b/tutorial-4/pixi.js-master/docs/index.html deleted file mode 100755 index d44cf89..0000000 --- a/tutorial-4/pixi.js-master/docs/index.html +++ /dev/null @@ -1,292 +0,0 @@ - - - - - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -
    -
    -

    - Browse to a module or class using the sidebar to view its API documentation. -

    - -

    Keyboard Shortcuts

    - -
      -
    • Press s to focus the API search box.

    • - -
    • Use Up and Down to select classes, modules, and search results.

    • - -
    • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

    • - -
    • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

    • -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/modules/PIXI.html b/tutorial-4/pixi.js-master/docs/modules/PIXI.html deleted file mode 100755 index 3621bb3..0000000 --- a/tutorial-4/pixi.js-master/docs/modules/PIXI.html +++ /dev/null @@ -1,819 +0,0 @@ - - - - - PIXI - pixi.js - - - - - - - - -
    -
    -
    - -

    - -
    -
    - API Docs for: 2.1.0 -
    -
    -
    - -
    - -
    -
    -
    - Show: - - - - - - - -
    - - -
    -
    -
    -

    PIXI Module

    -
    - - - - - - - - - -
    - - - -
    - -
    - - - -
    -
    - -

    This module provides the following classes:

    - - - -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/docs/modules/index.html b/tutorial-4/pixi.js-master/docs/modules/index.html deleted file mode 100755 index 487fe15..0000000 --- a/tutorial-4/pixi.js-master/docs/modules/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Redirector - - - - Click here to redirect - - diff --git a/tutorial-4/pixi.js-master/examples/example 1 - Basics/bunny.png b/tutorial-4/pixi.js-master/examples/example 1 - Basics/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 1 - Basics/bunny.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 1 - Basics/index.html b/tutorial-4/pixi.js-master/examples/example 1 - Basics/index.html deleted file mode 100755 index 7da84bb..0000000 --- a/tutorial-4/pixi.js-master/examples/example 1 - Basics/index.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - pixi.js example 1 - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 1 - Basics/indexTest2.html b/tutorial-4/pixi.js-master/examples/example 1 - Basics/indexTest2.html deleted file mode 100755 index 681f6bf..0000000 --- a/tutorial-4/pixi.js-master/examples/example 1 - Basics/indexTest2.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - pixi.js example 1 - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 1 - Basics/mark.html b/tutorial-4/pixi.js-master/examples/example 1 - Basics/mark.html deleted file mode 100755 index b71350c..0000000 --- a/tutorial-4/pixi.js-master/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
    - - -
    - - -
    - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 1 - Basics/stats.min.js b/tutorial-4/pixi.js-master/examples/example 1 - Basics/stats.min.js deleted file mode 100755 index 52539f4..0000000 --- a/tutorial-4/pixi.js-master/examples/example 1 - Basics/stats.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// stats.js - http://github.com/mrdoob/stats.js -var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; -i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); -k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= -"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= -a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); diff --git a/tutorial-4/pixi.js-master/examples/example 10 - Text/desyrel.png b/tutorial-4/pixi.js-master/examples/example 10 - Text/desyrel.png deleted file mode 100755 index c3559e1..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 10 - Text/desyrel.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 10 - Text/desyrel.xml b/tutorial-4/pixi.js-master/examples/example 10 - Text/desyrel.xml deleted file mode 100755 index 54fcdbb..0000000 --- a/tutorial-4/pixi.js-master/examples/example 10 - Text/desyrel.xml +++ /dev/null @@ -1,1922 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tutorial-4/pixi.js-master/examples/example 10 - Text/index.html b/tutorial-4/pixi.js-master/examples/example 10 - Text/index.html deleted file mode 100755 index 23fae9a..0000000 --- a/tutorial-4/pixi.js-master/examples/example 10 - Text/index.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - pixi.js example 10 Text - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 10 - Text/textDemoBG.jpg b/tutorial-4/pixi.js-master/examples/example 10 - Text/textDemoBG.jpg deleted file mode 100755 index 5955e59..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 10 - Text/textDemoBG.jpg and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/index.html b/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/index.html deleted file mode 100755 index 88a7396..0000000 --- a/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/index.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - pixi.js example 11 RenderTexture - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/indexNew.html b/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/indexNew.html deleted file mode 100755 index 9c8e727..0000000 --- a/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/indexNew.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - pixi.js example 11 RenderTexture - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_01.png b/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_01.png deleted file mode 100755 index 8687366..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_01.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_02.png b/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_02.png deleted file mode 100755 index a140876..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_02.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_03.png b/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_03.png deleted file mode 100755 index 82532c7..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_03.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_04.png b/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_04.png deleted file mode 100755 index 9c790c3..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_04.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_05.png b/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_05.png deleted file mode 100755 index ebb28c8..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_05.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_06.png b/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_06.png deleted file mode 100755 index 1dec5c8..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_06.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_07.png b/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_07.png deleted file mode 100755 index e14a021..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_07.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_08.png b/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_08.png deleted file mode 100755 index 0197fef..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 11 - RenderTexture/spinObj_08.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/Pixie.atlas b/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/Pixie.atlas deleted file mode 100755 index 68a8013..0000000 --- a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/Pixie.atlas +++ /dev/null @@ -1,158 +0,0 @@ -Pixie.png -format: RGBA8888 -filter: Linear,Linear -repeat: none -L_foot - rotate: false - xy: 1048, 355 - size: 68, 51 - orig: 68, 51 - offset: 0, 0 - index: -1 -L_hand - rotate: true - xy: 916, 355 - size: 55, 64 - orig: 55, 64 - offset: 0, 0 - index: -1 -L_lower_arm - rotate: false - xy: 1273, 226 - size: 70, 31 - orig: 70, 31 - offset: 0, 0 - index: -1 -L_lower_leg - rotate: false - xy: 1201, 345 - size: 57, 65 - orig: 57, 65 - offset: 0, 0 - index: -1 -L_upper_arm - rotate: true - xy: 1399, 2 - size: 78, 74 - orig: 78, 74 - offset: 0, 0 - index: -1 -L_upper_leg - rotate: false - xy: 1351, 259 - size: 124, 71 - orig: 124, 71 - offset: 0, 0 - index: -1 -R_foot - rotate: false - xy: 1319, 345 - size: 68, 51 - orig: 68, 51 - offset: 0, 0 - index: -1 -R_hand - rotate: true - xy: 982, 355 - size: 55, 64 - orig: 55, 64 - offset: 0, 0 - index: -1 -R_lower_arm - rotate: false - xy: 1345, 226 - size: 70, 31 - orig: 70, 31 - offset: 0, 0 - index: -1 -R_lower_leg - rotate: false - xy: 1260, 345 - size: 57, 65 - orig: 57, 65 - offset: 0, 0 - index: -1 -R_upper_arm - rotate: true - xy: 1399, 82 - size: 78, 74 - orig: 78, 74 - offset: 0, 0 - index: -1 -R_upper_leg - rotate: false - xy: 1389, 332 - size: 124, 71 - orig: 124, 71 - offset: 0, 0 - index: -1 -backHair - rotate: true - xy: 1096, 2 - size: 261, 175 - orig: 261, 175 - offset: 0, 0 - index: -1 -foreWing - rotate: false - xy: 1096, 265 - size: 253, 78 - orig: 253, 78 - offset: 0, 0 - index: -1 -frontHair - rotate: true - xy: 617, 2 - size: 396, 297 - orig: 396, 297 - offset: 0, 0 - index: -1 -groinal - rotate: true - xy: 1515, 296 - size: 103, 84 - orig: 103, 84 - offset: 0, 0 - index: -1 -head - rotate: false - xy: 2, 2 - size: 613, 408 - orig: 613, 408 - offset: 0, 0 - index: -1 -jaw - rotate: true - xy: 1273, 2 - size: 222, 124 - orig: 222, 124 - offset: 0, 0 - index: -1 -midHair - rotate: true - xy: 916, 2 - size: 351, 178 - orig: 351, 178 - offset: 0, 0 - index: -1 -neck - rotate: true - xy: 1118, 345 - size: 65, 81 - orig: 65, 81 - offset: 0, 0 - index: -1 -rearWing - rotate: false - xy: 1477, 148 - size: 136, 146 - orig: 136, 146 - offset: 0, 0 - index: -1 -vest - rotate: false - xy: 1477, 2 - size: 139, 144 - orig: 139, 144 - offset: 0, 0 - index: -1 diff --git a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/Pixie.json b/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/Pixie.json deleted file mode 100755 index bc7e888..0000000 --- a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/Pixie.json +++ /dev/null @@ -1,924 +0,0 @@ -{ -"bones": [ - { "name": "root" }, - { "name": "hip", "parent": "root", "x": -5.36, "y": 120.63 }, - { "name": "L leg upper", "parent": "hip", "length": 90.28, "x": -21.3, "y": -8.59, "rotation": -123.16 }, - { "name": "R leg upper", "parent": "hip", "length": 79.63, "x": 14.54, "y": -29.09, "rotation": -12.07 }, - { "name": "back", "parent": "hip", "length": 117.04, "x": 3.43, "y": 0.51, "rotation": 64.34 }, - { "name": "L arm upper", "parent": "back", "length": 88.01, "x": 120.71, "y": -25.79, "rotation": 108.03 }, - { "name": "L leg lower", "parent": "L leg upper", "length": 77.82, "x": 89.23, "y": 3.84, "rotation": -74.59 }, - { "name": "R arm upper", "parent": "back", "length": 82.87, "x": 107.42, "y": 16.92, "rotation": -108.18 }, - { "name": "R leg lower", "parent": "R leg upper", "length": 67.73, "x": 79.31, "y": -0.23, "rotation": -35.49 }, - { "name": "fore wing", "parent": "back", "length": 174.95, "x": 78.26, "y": 14.47, "rotation": 111.09 }, - { "name": "neck", "parent": "back", "length": 65.79, "x": 115.87, "y": -0.67, "rotation": -1.35 }, - { "name": "L arm lower", "parent": "L arm upper", "length": 57.67, "x": 84.14, "y": -0.57, "rotation": 35.83 }, - { "name": "L foot", "parent": "L leg lower", "length": 57.67, "x": 74.89, "y": -3.37, "rotation": 79.65 }, - { "name": "R arm lower", "parent": "R arm upper", "length": 58.76, "x": 80.97, "y": -3.48, "rotation": 56.62 }, - { "name": "R foot", "parent": "R leg lower", "length": 51.26, "x": 67.69, "y": -1.98, "rotation": 84.54 }, - { "name": "bone1", "parent": "fore wing", "x": 50.67, "y": 19.71 }, - { "name": "head", "parent": "neck", "length": 132.5, "x": 116.13, "y": 41.67, "rotation": -40.37 }, - { "name": "rear wing", "parent": "fore wing", "length": 123.2, "x": 2.22, "y": -11.57, "rotation": -30.89 }, - { "name": "L hand", "parent": "L arm lower", "length": 33.27, "x": 55.37, "y": 1.3, "rotation": 30.89 }, - { "name": "R hand", "parent": "R arm lower", "length": 33.34, "x": 58.46, "y": -1.24, "rotation": 25.65 }, - { "name": "hair back", "parent": "head", "length": 156.52, "x": 43.77, "y": 270.91, "rotation": 22.07 }, - { "name": "jaw", "parent": "head", "length": 139.22, "x": 8.71, "y": -33.25, "rotation": -46.82 }, - { "name": "hair mid", "parent": "hair back", "length": 191.57, "x": 155.16, "y": -89.36, "rotation": -17.61 }, - { "name": "hair front", "parent": "hair mid", "length": 202.73, "x": 48, "y": -100.58, "rotation": -18.29 } -], -"slots": [ - { "name": "L hand", "bone": "L hand", "attachment": "L_hand" }, - { "name": "L arm lower", "bone": "L arm lower", "attachment": "L_lower_arm" }, - { "name": "L arm upper", "bone": "L arm upper", "attachment": "L_upper_arm" }, - { "name": "rear wing", "bone": "rear wing", "attachment": "rearWing" }, - { "name": "L foot", "bone": "L foot", "attachment": "L_foot" }, - { "name": "L leg lower", "bone": "L leg lower", "attachment": "L_lower_leg" }, - { "name": "L leg upper", "bone": "L leg upper", "attachment": "L_upper_leg" }, - { "name": "R foot", "bone": "R foot", "attachment": "R_foot" }, - { "name": "R lower", "bone": "R leg lower", "attachment": "R_lower_leg" }, - { "name": "R upper", "bone": "R leg upper", "attachment": "R_upper_leg" }, - { "name": "hip", "bone": "hip", "attachment": "groinal" }, - { "name": "fore wing", "bone": "fore wing", "attachment": "foreWing" }, - { "name": "neck", "bone": "neck", "attachment": "neck" }, - { "name": "back", "bone": "back", "attachment": "vest" }, - { "name": "R arm upper", "bone": "R arm upper", "attachment": "R_upper_arm" }, - { "name": "R arm lower", "bone": "R arm lower", "attachment": "R_lower_arm" }, - { "name": "R hand", "bone": "R hand", "attachment": "R_hand" }, - { "name": "hair back", "bone": "hair back", "attachment": "backHair" }, - { "name": "hair front", "bone": "hair front", "attachment": "frontHair" }, - { "name": "head", "bone": "head", "attachment": "head" }, - { "name": "jaw", "bone": "jaw", "attachment": "jaw" }, - { "name": "hair mid", "bone": "hair mid", "attachment": "midHair" } -], -"skins": { - "default": { - "L arm lower": { - "L_lower_arm": { "x": 26.8, "y": 0.38, "rotation": -12.92, "width": 70, "height": 31 } - }, - "L arm upper": { - "L_upper_arm": { "x": 43.44, "y": -0.75, "rotation": 43.61, "width": 78, "height": 74 } - }, - "L foot": { - "L_foot": { "x": 25.73, "y": -3.97, "rotation": -37.09, "width": 68, "height": 51 } - }, - "L hand": { - "L_hand": { "x": 16.53, "y": 5.33, "rotation": -19.13, "width": 55, "height": 64 } - }, - "L leg lower": { - "L_lower_leg": { "x": 32.98, "y": 3.71, "rotation": 50.68, "width": 57, "height": 65 } - }, - "L leg upper": { - "L_upper_leg": { "x": 34.37, "y": 6.89, "rotation": 14.72, "width": 124, "height": 71 } - }, - "R arm lower": { - "R_lower_arm": { "x": 27.12, "y": 1.85, "rotation": -12.78, "width": 70, "height": 31 } - }, - "R arm upper": { - "R_upper_arm": { "x": 40.47, "y": -2.66, "rotation": 43.84, "width": 78, "height": 74 } - }, - "R foot": { - "R_foot": { "x": 19.53, "y": -8.7, "rotation": -36.33, "width": 68, "height": 51 } - }, - "R hand": { - "R_hand": { "x": 17.09, "y": -3.59, "rotation": -38.44, "width": 55, "height": 64 } - }, - "R lower": { - "R_lower_leg": { "x": 33.18, "y": -0.42, "rotation": 50.06, "width": 57, "height": 65 } - }, - "R upper": { - "R_upper_leg": { "x": 26.1, "y": 2.57, "rotation": 14.14, "width": 124, "height": 71 } - }, - "back": { - "vest": { "x": 47.37, "y": 12.63, "rotation": -64.34, "width": 139, "height": 144 } - }, - "fore wing": { - "foreWing": { "x": 103.77, "y": -7.39, "rotation": -175.44, "width": 253, "height": 78 } - }, - "hair back": { - "backHair": { "x": 71.84, "y": -6.96, "rotation": -44.69, "width": 261, "height": 175 } - }, - "hair front": { - "frontHair": { "x": 144.79, "y": -43.44, "rotation": -8.77, "width": 396, "height": 297 } - }, - "hair mid": { - "midHair": { "x": 98.77, "y": -24.19, "rotation": -27.07, "width": 351, "height": 178 } - }, - "head": { - "head": { "x": 54.08, "y": 79.01, "rotation": -22.61, "width": 613, "height": 408 } - }, - "hip": { - "groinal": { "x": -1.3, "y": -22.13, "width": 103, "height": 84 } - }, - "jaw": { - "jaw": { "x": 37.24, "y": -10.62, "rotation": 16.36, "width": 222, "height": 124 } - }, - "neck": { - "neck": { "x": 11.64, "y": 0.09, "rotation": -62.99, "width": 65, "height": 81 } - }, - "rear wing": { - "rearWing": { "x": 72.18, "y": -9.33, "rotation": -144.54, "width": 136, "height": 146 } - } - } -}, -"animations": { - "jump": { - "bones": { - "hip": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { - "time": 0, - "x": 0, - "y": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.3666, - "x": 48.25, - "y": 387.29, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L leg upper": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": -52.49 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R leg upper": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 42.23 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "back": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 17.45 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.3666, "x": -12.48, "y": 6.24 }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L arm upper": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": -23.04 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L leg lower": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 21.33 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R arm upper": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": -20.49 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R leg lower": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 18.73 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "fore wing": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1333, "angle": -17.83 }, - { "time": 0.2333, "angle": -0.57 }, - { "time": 0.3333, "angle": -22.57 }, - { "time": 0.4333, "angle": 6.45 }, - { "time": 0.5333, "angle": -15.51 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "neck": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L arm lower": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 16.6 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L foot": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3333, "angle": -19.99 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.3333, "x": -13.89, "y": -5.83 }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R arm lower": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 54.98 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R foot": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": -4.87 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "bone1": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "head": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.3743, - "angle": 13.84, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "rear wing": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1333, "angle": 30.94 }, - { "time": 0.2333, "angle": -24.35 }, - { "time": 0.3333, "angle": 25.11 }, - { "time": 0.4333, "angle": -6.54 }, - { "time": 0.5333, "angle": 24.65 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "L hand": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 57.5 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "R hand": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 3.65 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "hair back": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3333, "angle": 6.5 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "jaw": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 5.72 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.3666, "x": -4.28, "y": 3.04 }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.3666, "x": 1.169, "y": 1 }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "hair mid": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3333, "angle": 6.71 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - }, - "hair front": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3333, "angle": -8.18 }, - { "time": 0.6666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.3333, "x": -17.24, "y": 20.35 }, - { "time": 0.6666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.6666, "x": 1, "y": 1 } - ] - } - } - }, - "running": { - "bones": { - "hip": { - "rotate": [ - { "time": 0, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 2.79 }, - { "time": 0.2333, "x": 0, "y": -15.43 }, - { "time": 0.5, "x": 0, "y": 8 }, - { "time": 0.7, "x": 0, "y": -8.92 }, - { "time": 0.9666, "x": 0, "y": 2.79 } - ] - }, - "R leg upper": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.5, "angle": -150.25 }, - { "time": 0.7, "angle": -110.91 }, - { - "time": 0.8333, - "angle": -25.14, - "curve": [ 0.155, 0.16, 0.75, 1 ] - }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.5, "x": -35.15, "y": 0 }, - { "time": 0.7, "x": -6.5, "y": 0 }, - { "time": 1, "x": 2.6, "y": 0 } - ] - }, - "R leg lower": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.5, "angle": 7.47 }, - { "time": 0.7, "angle": -53.49 }, - { - "time": 0.8333, - "angle": -85.3, - "curve": [ 0.16, 0.21, 0.75, 1 ] - }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0.7, "x": 2.5, "y": -1.47 }, - { "time": 0.8333, "x": 3.93, "y": -5.18 } - ] - }, - "R foot": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.2, "angle": 7.03 }, - { "time": 0.2333, "angle": 18.45 }, - { "time": 0.2666, "angle": 26.41 }, - { "time": 0.3, "angle": 29.63 }, - { "time": 0.5, "angle": -22.49 }, - { "time": 0.7, "angle": -30.93 }, - { "time": 0.8333, "angle": -50.37 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0.5, "x": 0.7, "y": -3.84 } - ] - }, - "L leg upper": { - "rotate": [ - { - "time": 0, - "angle": -30.25, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.2333, "angle": 77.26 }, - { - "time": 0.5, - "angle": 104.21, - "curve": [ 0.25, 0, 0.29, 1 ] - }, - { "time": 1, "angle": -30.25 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.5, "x": 22.13, "y": -16.92 }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L leg lower": { - "rotate": [ - { - "time": 0, - "angle": 22.34, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.2333, - "angle": -65.53, - "curve": [ 0.094, -0.03, 0.678, 1.08 ] - }, - { - "time": 0.5, - "angle": 43.39, - "curve": [ 0.25, 0, 0.287, 1 ] - }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 1, "x": 0.58, "y": -1.74 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L foot": { - "rotate": [ - { "time": 0, "angle": -22.23 }, - { "time": 0.2333, "angle": -1.44 }, - { "time": 0.5, "angle": 5.06 }, - { "time": 0.6333, "angle": 27.11 }, - { "time": 0.6666, "angle": 50.34 }, - { "time": 1, "angle": -12.47 } - ], - "translate": [ - { "time": 0, "x": -4.13, "y": -3.42 }, - { "time": 0.6333, "x": 1.22, "y": 1.73 }, - { "time": 0.6666, "x": -0.56, "y": 5.49 }, - { "time": 1, "x": -0.87, "y": -0.96 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "back": { - "rotate": [ - { "time": 0, "angle": -1.79 }, - { "time": 0.2333, "angle": -10.71 }, - { "time": 0.5, "angle": -2.16 }, - { "time": 0.7, "angle": -10.27 }, - { "time": 0.9666, "angle": -1.79 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.2333, "x": 5.2, "y": -6.5 }, - { "time": 0.5, "x": 1.3, "y": -2.6 }, - { "time": 0.7, "x": 7.81, "y": -6.5 }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "R arm upper": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.5, "angle": 235.62 }, - { "time": 0.7, "angle": -57.38 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 } - ] - }, - "R arm lower": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.068, 0, 0.632, 1.14 ] - }, - { "time": 0.5, "angle": -34.21 }, - { - "time": 0.7, - "angle": 17.35, - "curve": [ 0.221, 0.26, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 } - ] - }, - "R hand": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": 30.13 }, - { "time": 0.7, "angle": 3.91 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 } - ] - }, - "L arm upper": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.5, - "angle": -190.85, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "L hand": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 1, 0.75, 1 ] - }, - { - "time": 0.5, - "angle": -15.76, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "L arm lower": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3, "angle": 45.27 }, - { "time": 0.5, "angle": -20.97 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "fore wing": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.2333, "angle": 17.36 }, - { "time": 0.5333, "angle": -2.27 }, - { "time": 0.7333, "angle": 20.14 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "rear wing": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.2333, "angle": 17.36 }, - { "time": 0.5333, "angle": -2.27 }, - { "time": 0.7333, "angle": 20.14 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "head": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.2666, "angle": -13.61 }, - { "time": 0.5, "angle": 0 }, - { "time": 0.7333, "angle": -11.08 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.2666, "x": 4.54, "y": -38.81 }, - { "time": 0.5, "x": 0, "y": 0 }, - { "time": 0.7333, "x": 0.32, "y": -40.1 }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "jaw": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.2333, "angle": -3.93 }, - { "time": 0.4666, "angle": 8.79 }, - { "time": 0.7333, "angle": 13.97 }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.2333, "x": 4.63, "y": 6.7 }, - { "time": 0.4666, "x": 6.67, "y": -4.82 }, - { "time": 0.7333, "x": 6.8, "y": -7.61 }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "hair back": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.2333, - "angle": -3.9, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.5, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.7666, - "angle": -4, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { "time": 0.2333, "x": -1.3, "y": -6.5 }, - { "time": 0.5, "x": 0, "y": 0 }, - { "time": 0.7666, "x": -3.49, "y": -10.15 }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "hair front": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.2333, - "angle": -3.9, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.5, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.7666, - "angle": -4, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - }, - "hair mid": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.2333, - "angle": -3.9, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.5, - "angle": 0, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { - "time": 0.7666, - "angle": -4, - "curve": [ 0.25, 0, 0.75, 1 ] - }, - { "time": 0.9666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9666, "x": 0, "y": 0 } - ] - } - } - } -} -} diff --git a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/Pixie.png b/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/Pixie.png deleted file mode 100755 index b1e5b77..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/Pixie.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/dragon.atlas b/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/dragon.atlas deleted file mode 100755 index eefbc1d..0000000 --- a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/dragon.atlas +++ /dev/null @@ -1,290 +0,0 @@ - -dragon.png -format: RGBA8888 -filter: Linear,Linear -repeat: none -L_rear_thigh - rotate: false - xy: 895, 20 - size: 91, 148 - orig: 91, 149 - offset: 0, 0 - index: -1 -L_wing01 - rotate: false - xy: 814, 672 - size: 191, 256 - orig: 191, 256 - offset: 0, 0 - index: -1 -L_wing02 - rotate: false - xy: 714, 189 - size: 179, 269 - orig: 179, 269 - offset: 0, 0 - index: -1 -L_wing03 - rotate: false - xy: 785, 463 - size: 186, 207 - orig: 186, 207 - offset: 0, 0 - index: -1 -L_wing05 - rotate: true - xy: 2, 9 - size: 218, 213 - orig: 218, 213 - offset: 0, 0 - index: -1 -L_wing06 - rotate: false - xy: 2, 229 - size: 192, 331 - orig: 192, 331 - offset: 0, 0 - index: -1 -R_wing01 - rotate: true - xy: 502, 709 - size: 219, 310 - orig: 219, 310 - offset: 0, 0 - index: -1 -R_wing02 - rotate: true - xy: 204, 463 - size: 203, 305 - orig: 203, 305 - offset: 0, 0 - index: -1 -R_wing03 - rotate: false - xy: 511, 460 - size: 272, 247 - orig: 272, 247 - offset: 0, 0 - index: -1 -R_wing05 - rotate: false - xy: 196, 232 - size: 251, 229 - orig: 251, 229 - offset: 0, 0 - index: -1 -R_wing06 - rotate: false - xy: 2, 562 - size: 200, 366 - orig: 200, 366 - offset: 0, 0 - index: -1 -R_wing07 - rotate: true - xy: 449, 258 - size: 200, 263 - orig: 200, 263 - offset: 0, 0 - index: -1 -R_wing08 - rotate: false - xy: 467, 2 - size: 234, 254 - orig: 234, 254 - offset: 0, 0 - index: -1 -R_wing09 - rotate: false - xy: 217, 26 - size: 248, 204 - orig: 248, 204 - offset: 0, 0 - index: -1 -back - rotate: false - xy: 703, 2 - size: 190, 185 - orig: 190, 185 - offset: 0, 0 - index: -1 -chest - rotate: true - xy: 895, 170 - size: 136, 122 - orig: 136, 122 - offset: 0, 0 - index: -1 -front_toeA - rotate: false - xy: 976, 972 - size: 29, 50 - orig: 29, 50 - offset: 0, 0 - index: -1 -head - rotate: false - xy: 204, 668 - size: 296, 260 - orig: 296, 260 - offset: 0, 0 - index: -1 -logo - rotate: false - xy: 2, 930 - size: 897, 92 - orig: 897, 92 - offset: 0, 0 - index: -1 -tail01 - rotate: false - xy: 895, 308 - size: 120, 153 - orig: 120, 153 - offset: 0, 0 - index: -1 -tail03 - rotate: false - xy: 901, 930 - size: 73, 92 - orig: 73, 92 - offset: 0, 0 - index: -1 - -dragon2.png -format: RGBA8888 -filter: Linear,Linear -repeat: none -L_front_leg - rotate: true - xy: 391, 141 - size: 84, 57 - orig: 84, 57 - offset: 0, 0 - index: -1 -L_front_thigh - rotate: false - xy: 446, 269 - size: 84, 72 - orig: 84, 72 - offset: 0, 0 - index: -1 -L_rear_leg - rotate: true - xy: 888, 342 - size: 168, 132 - orig: 206, 177 - offset: 19, 20 - index: -1 -L_wing04 - rotate: false - xy: 256, 227 - size: 188, 135 - orig: 188, 135 - offset: 0, 0 - index: -1 -L_wing07 - rotate: false - xy: 2, 109 - size: 159, 255 - orig: 159, 255 - offset: 0, 0 - index: -1 -L_wing08 - rotate: true - xy: 705, 346 - size: 164, 181 - orig: 164, 181 - offset: 0, 0 - index: -1 -L_wing09 - rotate: false - xy: 499, 343 - size: 204, 167 - orig: 204, 167 - offset: 0, 0 - index: -1 -R_front_leg - rotate: false - xy: 273, 34 - size: 101, 89 - orig: 101, 89 - offset: 0, 0 - index: -1 -R_front_thigh - rotate: false - xy: 163, 106 - size: 108, 108 - orig: 108, 108 - offset: 0, 0 - index: -1 -R_rear_leg - rotate: false - xy: 273, 125 - size: 116, 100 - orig: 116, 100 - offset: 0, 0 - index: -1 -R_rear_thigh - rotate: false - xy: 163, 216 - size: 91, 148 - orig: 91, 149 - offset: 0, 0 - index: -1 -R_wing04 - rotate: false - xy: 2, 366 - size: 279, 144 - orig: 279, 144 - offset: 0, 0 - index: -1 -chin - rotate: false - xy: 283, 364 - size: 214, 146 - orig: 214, 146 - offset: 0, 0 - index: -1 -front_toeB - rotate: false - xy: 590, 284 - size: 56, 57 - orig: 56, 57 - offset: 0, 0 - index: -1 -rear-toe - rotate: true - xy: 2, 2 - size: 105, 77 - orig: 109, 77 - offset: 0, 0 - index: -1 -tail02 - rotate: true - xy: 151, 9 - size: 95, 120 - orig: 95, 120 - offset: 0, 0 - index: -1 -tail04 - rotate: false - xy: 532, 270 - size: 56, 71 - orig: 56, 71 - offset: 0, 0 - index: -1 -tail05 - rotate: false - xy: 648, 282 - size: 52, 59 - orig: 52, 59 - offset: 0, 0 - index: -1 -tail06 - rotate: true - xy: 81, 12 - size: 95, 68 - orig: 95, 68 - offset: 0, 0 - index: -1 diff --git a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/dragon.json b/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/dragon.json deleted file mode 100755 index 0d25038..0000000 --- a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/dragon.json +++ /dev/null @@ -1,783 +0,0 @@ -{ -"bones": [ - { "name": "root", "y": -176.12 }, - { "name": "COG", "parent": "root", "y": 176.12 }, - { "name": "back", "parent": "COG", "length": 115.37, "x": 16.03, "y": 27.94, "rotation": 151.83 }, - { "name": "chest", "parent": "COG", "length": 31.24, "x": 52.52, "y": 15.34, "rotation": 161.7 }, - { "name": "neck", "parent": "COG", "length": 41.36, "x": 64.75, "y": 11.98, "rotation": 39.05 }, - { "name": "L_front_thigh", "parent": "chest", "length": 67.42, "x": -45.58, "y": 7.92, "rotation": 138.94 }, - { "name": "L_wing", "parent": "chest", "length": 301.12, "x": -7.24, "y": -24.65, "rotation": -75.51 }, - { "name": "R_front_thigh", "parent": "chest", "length": 81.63, "x": -10.89, "y": 28.25, "rotation": 67.96 }, - { "name": "R_rear_thigh", "parent": "back", "length": 123.46, "x": 65.31, "y": 59.89, "rotation": 104.87 }, - { "name": "chin", "parent": "neck", "length": 153.15, "x": 64.62, "y": -6.99, "rotation": -69.07 }, - { "name": "head", "parent": "neck", "length": 188.83, "x": 69.96, "y": 2.49, "rotation": 8.06 }, - { "name": "tail1", "parent": "back", "length": 65.65, "x": 115.37, "y": -0.19, "rotation": 44.31 }, - { "name": "L_front_leg", "parent": "L_front_thigh", "length": 51.57, "x": 67.42, "y": 0.02, "rotation": 43.36 }, - { "name": "L_rear_thigh", "parent": "R_rear_thigh", "length": 88.05, "x": -8.59, "y": 30.18, "rotation": 28.35 }, - { "name": "R_front_leg", "parent": "R_front_thigh", "length": 66.52, "x": 83.04, "y": -0.3, "rotation": 92.7 }, - { "name": "R_rear_leg", "parent": "R_rear_thigh", "length": 91.06, "x": 123.46, "y": -0.26, "rotation": -129.04 }, - { "name": "R_wing", "parent": "head", "length": 359.5, "x": -74.68, "y": 20.9, "rotation": 83.21 }, - { "name": "tail2", "parent": "tail1", "length": 54.5, "x": 65.65, "y": 0.22, "rotation": 12 }, - { "name": "L_front_toe1", "parent": "L_front_leg", "length": 51.44, "x": 45.53, "y": 2.43, "rotation": -98 }, - { "name": "L_front_toe2", "parent": "L_front_leg", "length": 61.97, "x": 51.57, "y": -0.12, "rotation": -55.26 }, - { "name": "L_front_toe3", "parent": "L_front_leg", "length": 45.65, "x": 54.19, "y": 0.6, "scaleX": 1.134, "rotation": -11.13 }, - { "name": "L_front_toe4", "parent": "L_front_leg", "length": 53.47, "x": 50.6, "y": 7.08, "scaleX": 1.134, "rotation": 19.42 }, - { "name": "L_rear_leg", "parent": "L_rear_thigh", "length": 103.74, "x": 96.04, "y": -0.97, "rotation": -122.41 }, - { "name": "R_front_toe1", "parent": "R_front_leg", "length": 46.65, "x": 70.03, "y": 5.31, "rotation": 8.59 }, - { "name": "R_front_toe2", "parent": "R_front_leg", "length": 53.66, "x": 66.52, "y": 0.33, "rotation": -35.02 }, - { "name": "R_front_toe3", "parent": "R_front_leg", "length": 58.38, "x": 62.1, "y": -0.79, "rotation": -74.67 }, - { "name": "R_rear_toe1", "parent": "R_rear_leg", "length": 94.99, "x": 90.06, "y": 2.12, "rotation": 141.98 }, - { "name": "R_rear_toe2", "parent": "R_rear_leg", "length": 99.29, "x": 89.6, "y": 1.52, "rotation": 125.32 }, - { "name": "R_rear_toe3", "parent": "R_rear_leg", "length": 103.45, "x": 91.06, "y": -0.35, "rotation": 112.26 }, - { "name": "tail3", "parent": "tail2", "length": 41.78, "x": 54.5, "y": 0.37, "rotation": 1.8 }, - { "name": "tail4", "parent": "tail3", "length": 34.19, "x": 41.78, "y": 0.16, "rotation": -1.8 }, - { "name": "tail5", "parent": "tail4", "length": 32.32, "x": 34.19, "y": -0.19, "rotation": -3.15 }, - { "name": "tail6", "parent": "tail5", "length": 80.08, "x": 32.32, "y": -0.23, "rotation": -29.55 } -], -"slots": [ - { "name": "L_rear_leg", "bone": "L_rear_leg", "attachment": "L_rear_leg" }, - { "name": "L_rear_thigh", "bone": "L_rear_thigh", "attachment": "L_rear_thigh" }, - { "name": "L_wing", "bone": "L_wing", "attachment": "L_wing01" }, - { "name": "tail6", "bone": "tail6", "attachment": "tail06" }, - { "name": "tail5", "bone": "tail5", "attachment": "tail05" }, - { "name": "tail4", "bone": "tail4", "attachment": "tail04" }, - { "name": "tail3", "bone": "tail3", "attachment": "tail03" }, - { "name": "tail2", "bone": "tail2", "attachment": "tail02" }, - { "name": "tail1", "bone": "tail1", "attachment": "tail01" }, - { "name": "back", "bone": "back", "attachment": "back" }, - { "name": "L_front_thigh", "bone": "L_front_thigh", "attachment": "L_front_thigh" }, - { "name": "L_front_leg", "bone": "L_front_leg", "attachment": "L_front_leg" }, - { "name": "L_front_toe1", "bone": "L_front_toe1", "attachment": "front_toeA" }, - { "name": "L_front_toe4", "bone": "L_front_toe4", "attachment": "front_toeB" }, - { "name": "L_front_toe3", "bone": "L_front_toe3", "attachment": "front_toeB" }, - { "name": "L_front_toe2", "bone": "L_front_toe2", "attachment": "front_toeB" }, - { "name": "chest", "bone": "chest", "attachment": "chest" }, - { "name": "R_rear_toe1", "bone": "R_rear_toe1", "attachment": "rear-toe" }, - { "name": "R_rear_toe2", "bone": "R_rear_toe2", "attachment": "rear-toe" }, - { "name": "R_rear_toe3", "bone": "R_rear_toe3", "attachment": "rear-toe" }, - { "name": "R_rear_leg", "bone": "R_rear_leg", "attachment": "R_rear_leg" }, - { "name": "R_rear_thigh", "bone": "R_rear_thigh", "attachment": "R_rear_thigh" }, - { "name": "R_front_toe1", "bone": "R_front_toe1", "attachment": "front_toeB" }, - { "name": "R_front_thigh", "bone": "R_front_thigh", "attachment": "R_front_thigh" }, - { "name": "R_front_leg", "bone": "R_front_leg", "attachment": "R_front_leg" }, - { "name": "R_front_toe2", "bone": "R_front_toe2", "attachment": "front_toeB" }, - { "name": "R_front_toe3", "bone": "R_front_toe3", "attachment": "front_toeB" }, - { "name": "chin", "bone": "chin", "attachment": "chin" }, - { "name": "R_wing", "bone": "R_wing", "attachment": "R_wing01" }, - { "name": "head", "bone": "head", "attachment": "head" }, - { "name": "logo", "bone": "root", "attachment": "logo" } -], -"skins": { - "default": { - "L_front_leg": { - "L_front_leg": { "x": 14.68, "y": 0.48, "rotation": 15.99, "width": 84, "height": 57 } - }, - "L_front_thigh": { - "L_front_thigh": { "x": 27.66, "y": -11.58, "rotation": 58.66, "width": 84, "height": 72 } - }, - "L_front_toe1": { - "front_toeA": { "x": 31.92, "y": 0.61, "rotation": 109.55, "width": 29, "height": 50 } - }, - "L_front_toe2": { - "front_toeB": { "x": 26.83, "y": -4.94, "rotation": 109.51, "width": 56, "height": 57 } - }, - "L_front_toe3": { - "front_toeB": { "x": 18.21, "y": -7.21, "scaleX": 0.881, "scaleY": 0.94, "rotation": 99.71, "width": 56, "height": 57 } - }, - "L_front_toe4": { - "front_toeB": { "x": 23.21, "y": -11.68, "scaleX": 0.881, "rotation": 79.89, "width": 56, "height": 57 } - }, - "L_rear_leg": { - "L_rear_leg": { "x": 67.29, "y": 12.62, "rotation": -162.65, "width": 206, "height": 177 } - }, - "L_rear_thigh": { - "L_rear_thigh": { "x": 56.03, "y": 27.38, "rotation": 74.93, "width": 91, "height": 149 } - }, - "L_wing": { - "L_wing01": { "x": 129.21, "y": -45.49, "rotation": -83.7, "width": 191, "height": 256 }, - "L_wing02": { "x": 126.37, "y": -31.69, "rotation": -86.18, "width": 179, "height": 269 }, - "L_wing03": { "x": 110.26, "y": -90.89, "rotation": -86.18, "width": 186, "height": 207 }, - "L_wing04": { "x": -61.61, "y": -83.26, "rotation": -86.18, "width": 188, "height": 135 }, - "L_wing05": { "x": -90.01, "y": -78.14, "rotation": -86.18, "width": 218, "height": 213 }, - "L_wing06": { "x": -143.76, "y": -83.71, "rotation": -86.18, "width": 192, "height": 331 }, - "L_wing07": { "x": -133.04, "y": -33.89, "rotation": -86.18, "width": 159, "height": 255 }, - "L_wing08": { "x": 50.15, "y": -15.71, "rotation": -86.18, "width": 164, "height": 181 }, - "L_wing09": { "x": 85.94, "y": -11.32, "rotation": -86.18, "width": 204, "height": 167 } - }, - "R_front_leg": { - "R_front_leg": { "x": 17.79, "y": 4.22, "rotation": 37.62, "width": 101, "height": 89 } - }, - "R_front_thigh": { - "R_front_thigh": { "x": 35.28, "y": 2.11, "rotation": 130.33, "width": 108, "height": 108 } - }, - "R_front_toe1": { - "front_toeB": { "x": 24.49, "y": -2.61, "rotation": 104.18, "width": 56, "height": 57 } - }, - "R_front_toe2": { - "front_toeB": { "x": 26.39, "y": 1.16, "rotation": 104.57, "width": 56, "height": 57 } - }, - "R_front_toe3": { - "front_toeB": { "x": 30.66, "y": -0.06, "rotation": 112.29, "width": 56, "height": 57 } - }, - "R_rear_leg": { - "R_rear_leg": { "x": 60.87, "y": -5.72, "rotation": -127.66, "width": 116, "height": 100 } - }, - "R_rear_thigh": { - "R_rear_thigh": { "x": 53.25, "y": 12.58, "rotation": 103.29, "width": 91, "height": 149 } - }, - "R_rear_toe1": { - "rear-toe": { "x": 54.75, "y": -5.72, "rotation": 134.79, "width": 109, "height": 77 } - }, - "R_rear_toe2": { - "rear-toe": { "x": 57.02, "y": -7.22, "rotation": 134.42, "width": 109, "height": 77 } - }, - "R_rear_toe3": { - "rear-toe": { "x": 47.46, "y": -7.64, "rotation": 134.34, "width": 109, "height": 77 } - }, - "R_wing": { - "R_wing01": { "x": 170.08, "y": -23.67, "rotation": -130.33, "width": 219, "height": 310 }, - "R_wing02": { "x": 171.14, "y": -19.33, "rotation": -130.33, "width": 203, "height": 305 }, - "R_wing03": { "x": 166.46, "y": 29.23, "rotation": -130.33, "width": 272, "height": 247 }, - "R_wing04": { "x": 42.94, "y": 134.05, "rotation": -130.33, "width": 279, "height": 144 }, - "R_wing05": { "x": -8.83, "y": 142.59, "rotation": -130.33, "width": 251, "height": 229 }, - "R_wing06": { "x": -123.33, "y": 111.22, "rotation": -130.33, "width": 200, "height": 366 }, - "R_wing07": { "x": -40.17, "y": 118.03, "rotation": -130.33, "width": 200, "height": 263 }, - "R_wing08": { "x": 48.01, "y": 28.76, "rotation": -130.33, "width": 234, "height": 254 }, - "R_wing09": { "x": 128.1, "y": 21.12, "rotation": -130.33, "width": 248, "height": 204 } - }, - "back": { - "back": { "x": 35.84, "y": 19.99, "rotation": -151.83, "width": 190, "height": 185 } - }, - "chest": { - "chest": { "x": -14.6, "y": 24.78, "rotation": -161.7, "width": 136, "height": 122 } - }, - "chin": { - "chin": { "x": 66.55, "y": 7.32, "rotation": 30.01, "width": 214, "height": 146 } - }, - "head": { - "head": { "x": 76.68, "y": 32.21, "rotation": -47.12, "width": 296, "height": 260 } - }, - "logo": { - "logo": { "y": -176.72, "width": 897, "height": 92 } - }, - "tail1": { - "tail01": { "x": 22.59, "y": -4.5, "rotation": 163.85, "width": 120, "height": 153 } - }, - "tail2": { - "tail02": { "x": 18.11, "y": -1.75, "rotation": 151.84, "width": 95, "height": 120 } - }, - "tail3": { - "tail03": { "x": 16.94, "y": -2, "rotation": 150.04, "width": 73, "height": 92 } - }, - "tail4": { - "tail04": { "x": 15.34, "y": -2.17, "rotation": 151.84, "width": 56, "height": 71 } - }, - "tail5": { - "tail05": { "x": 15.05, "y": -3.57, "rotation": 155, "width": 52, "height": 59 } - }, - "tail6": { - "tail06": { "x": 28.02, "y": -16.83, "rotation": -175.44, "width": 95, "height": 68 } - } - } -}, -"animations": { - "flying": { - "slots": { - "L_wing": { - "attachment": [ - { "time": 0, "name": "L_wing01" }, - { "time": 0.0666, "name": "L_wing02" }, - { "time": 0.1333, "name": "L_wing03" }, - { "time": 0.2, "name": "L_wing04" }, - { "time": 0.2666, "name": "L_wing05" }, - { "time": 0.3333, "name": "L_wing06" }, - { "time": 0.4, "name": "L_wing07" }, - { "time": 0.4666, "name": "L_wing08" }, - { "time": 0.5333, "name": "L_wing09" }, - { "time": 0.6, "name": "L_wing01" }, - { "time": 0.7333, "name": "L_wing02" }, - { "time": 0.8, "name": "L_wing03" }, - { "time": 0.8333, "name": "L_wing04" }, - { "time": 0.8666, "name": "L_wing05" }, - { "time": 0.9, "name": "L_wing06" }, - { "time": 0.9333, "name": "L_wing07" }, - { "time": 0.9666, "name": "L_wing08" }, - { "time": 1, "name": "L_wing01" } - ] - }, - "R_wing": { - "attachment": [ - { "time": 0, "name": "R_wing01" }, - { "time": 0.0666, "name": "R_wing02" }, - { "time": 0.1333, "name": "R_wing03" }, - { "time": 0.2, "name": "R_wing04" }, - { "time": 0.2666, "name": "R_wing05" }, - { "time": 0.3333, "name": "R_wing06" }, - { "time": 0.4, "name": "R_wing07" }, - { "time": 0.4666, "name": "R_wing08" }, - { "time": 0.5333, "name": "R_wing09" }, - { "time": 0.6, "name": "R_wing01" }, - { "time": 0.7333, "name": "R_wing02" }, - { "time": 0.7666, "name": "R_wing02" }, - { "time": 0.8, "name": "R_wing03" }, - { "time": 0.8333, "name": "R_wing04" }, - { "time": 0.8666, "name": "R_wing05" }, - { "time": 0.9, "name": "R_wing06" }, - { "time": 0.9333, "name": "R_wing07" }, - { "time": 0.9666, "name": "R_wing08" }, - { "time": 1, "name": "R_wing01" } - ] - } - }, - "bones": { - "back": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 17.39 }, - { "time": 0.5, "angle": 0 }, - { "time": 0.8333, "angle": 7 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "neck": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -8.18 }, - { "time": 0.3333, "angle": -23.16 }, - { "time": 0.5, "angle": -18.01 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "chest": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail1": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -2.42 }, - { "time": 0.3333, "angle": -26.2 }, - { "time": 0.5, "angle": -29.65 }, - { "time": 0.6666, "angle": -23.15 }, - { "time": 0.8333, "angle": -55.46 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_rear_thigh": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail2": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -1.12 }, - { "time": 0.3333, "angle": 10.48 }, - { "time": 0.5, "angle": 7.89 }, - { "time": 0.8333, "angle": -10.38 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail3": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 8.24 }, - { "time": 0.3333, "angle": 15.21 }, - { "time": 0.5, "angle": 14.84 }, - { "time": 0.8333, "angle": -18.9 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail4": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 17.46 }, - { "time": 0.3333, "angle": 22.15 }, - { "time": 0.5, "angle": 22.76 }, - { "time": 0.8333, "angle": -4.37 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail5": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 7.4 }, - { "time": 0.3333, "angle": 28.5 }, - { "time": 0.5, "angle": 21.33 }, - { "time": 0.8333, "angle": -1.27 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "tail6": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 45.99 }, - { "time": 0.4, "angle": 43.53 }, - { "time": 0.5, "angle": 61.79 }, - { "time": 0.8333, "angle": 13.28 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_rear_leg": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -14.21 }, - { "time": 0.5, "angle": 47.17 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_rear_toe3": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": -36.06 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_rear_toe2": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": -20.32 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_rear_toe1": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": -18.71 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "head": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.408, 1.36, 0.675, 1.43 ] - }, - { "time": 0.5, "angle": 1.03 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "chin": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.416, 1.15, 0.494, 1.27 ] - }, - { "time": 0.3333, "angle": -5.15 }, - { "time": 0.5, "angle": 9.79 }, - { "time": 0.6666, "angle": 18.94 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_thigh": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -19.18 }, - { "time": 0.3333, "angle": -32.02 }, - { "time": 0.5, "angle": -19.62 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_front_thigh": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -12.96 }, - { "time": 0.5, "angle": 16.2 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_leg": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 37.77 }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_toe1": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": -16.08 }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_toe2": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.33, "y": 1.029 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_toe4": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": 26.51 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.239, "y": 0.993 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_front_toe3": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.5, "angle": 16.99 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.402, "y": 1.007 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_front_leg": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 26.07 }, - { "time": 0.5, "angle": -21.6 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_front_toe1": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 29.23 }, - { "time": 0.5, "angle": 34.83 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.412, "y": 1 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_front_toe2": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 24.89 }, - { "time": 0.5, "angle": 23.16 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.407, "y": 1.057 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "R_front_toe3": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.1666, "angle": 11.01 }, - { "time": 0.5, "angle": 0, "curve": "stepped" }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 }, - { "time": 0.5, "x": 1.329, "y": 1.181 }, - { "time": 1, "x": 1, "y": 1 } - ] - }, - "L_rear_leg": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.3666, "angle": 25.19 }, - { "time": 0.6666, "angle": -15.65 }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1 } - ] - }, - "COG": { - "rotate": [ - { - "time": 0, - "angle": 0, - "curve": [ 0.456, 0.2, 0.422, 1.06 ] - }, - { "time": 0.3333, "angle": 23.93 }, - { - "time": 0.6666, - "angle": 337.8, - "curve": [ 0.41, 0, 0.887, 0.75 ] - }, - { "time": 1, "angle": 0 } - ], - "translate": [ - { - "time": 0, - "x": 0, - "y": 0, - "curve": [ 0.33, 1, 0.816, 1.33 ] - }, - { - "time": 0.5, - "x": 0, - "y": 113.01, - "curve": [ 0.396, 0, 0.709, 2.03 ] - }, - { "time": 1, "x": 0, "y": 0 } - ] - } - } - } -} -} \ No newline at end of file diff --git a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/dragon.png b/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/dragon.png deleted file mode 100755 index bb1fc41..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/dragon.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/dragon2.png b/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/dragon2.png deleted file mode 100755 index 381e77a..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/dragon2.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/goblins.atlas b/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/goblins.atlas deleted file mode 100755 index c9cb702..0000000 --- a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/goblins.atlas +++ /dev/null @@ -1,293 +0,0 @@ - -goblins.png -size: 228,523 -format: RGBA8888 -filter: Linear,Linear -repeat: none -dagger - rotate: false - xy: 2, 43 - size: 26, 108 - orig: 26, 108 - offset: 0, 0 - index: -1 -goblin/eyes-closed - rotate: false - xy: 166, 237 - size: 34, 12 - orig: 34, 12 - offset: 0, 0 - index: -1 -goblin/head - rotate: false - xy: 26, 372 - size: 103, 66 - orig: 103, 66 - offset: 0, 0 - index: -1 -goblin/left-arm - rotate: false - xy: 166, 251 - size: 37, 35 - orig: 37, 35 - offset: 0, 0 - index: -1 -goblin/left-foot - rotate: true - xy: 195, 358 - size: 65, 31 - orig: 65, 31 - offset: 0, 0 - index: -1 -goblin/left-hand - rotate: false - xy: 49, 2 - size: 36, 41 - orig: 36, 41 - offset: 0, 0 - index: -1 -goblin/left-lower-leg - rotate: false - xy: 30, 45 - size: 33, 70 - orig: 33, 70 - offset: 0, 0 - index: -1 -goblin/left-shoulder - rotate: true - xy: 169, 288 - size: 29, 44 - orig: 29, 44 - offset: 0, 0 - index: -1 -goblin/left-upper-leg - rotate: false - xy: 134, 305 - size: 33, 73 - orig: 33, 73 - offset: 0, 0 - index: -1 -goblin/neck - rotate: false - xy: 87, 2 - size: 36, 41 - orig: 36, 41 - offset: 0, 0 - index: -1 -goblin/pelvis - rotate: false - xy: 131, 380 - size: 62, 43 - orig: 62, 43 - offset: 0, 0 - index: -1 -goblin/right-arm - rotate: false - xy: 135, 69 - size: 23, 50 - orig: 23, 50 - offset: 0, 0 - index: -1 -goblin/right-foot - rotate: true - xy: 104, 157 - size: 63, 33 - orig: 63, 33 - offset: 0, 0 - index: -1 -goblin/right-hand - rotate: false - xy: 190, 319 - size: 36, 37 - orig: 36, 37 - offset: 0, 0 - index: -1 -goblin/right-lower-leg - rotate: false - xy: 96, 294 - size: 36, 76 - orig: 36, 76 - offset: 0, 0 - index: -1 -goblin/right-shoulder - rotate: true - xy: 2, 2 - size: 39, 45 - orig: 39, 45 - offset: 0, 0 - index: -1 -goblin/right-upper-leg - rotate: false - xy: 139, 162 - size: 34, 63 - orig: 34, 63 - offset: 0, 0 - index: -1 -goblin/torso - rotate: false - xy: 131, 425 - size: 68, 96 - orig: 68, 96 - offset: 0, 0 - index: -1 -goblin/undie-straps - rotate: true - xy: 201, 466 - size: 55, 19 - orig: 55, 19 - offset: 0, 0 - index: -1 -goblin/undies - rotate: false - xy: 190, 51 - size: 36, 29 - orig: 36, 29 - offset: 0, 0 - index: -1 -goblingirl/eyes-closed - rotate: true - xy: 201, 427 - size: 37, 21 - orig: 37, 21 - offset: 0, 0 - index: -1 -goblingirl/head - rotate: false - xy: 26, 440 - size: 103, 81 - orig: 103, 81 - offset: 0, 0 - index: -1 -goblingirl/left-arm - rotate: true - xy: 175, 198 - size: 37, 35 - orig: 37, 35 - offset: 0, 0 - index: -1 -goblingirl/left-foot - rotate: true - xy: 133, 227 - size: 65, 31 - orig: 65, 31 - offset: 0, 0 - index: -1 -goblingirl/left-hand - rotate: true - xy: 168, 2 - size: 35, 40 - orig: 35, 40 - offset: 0, 0 - index: -1 -goblingirl/left-lower-leg - rotate: false - xy: 65, 45 - size: 33, 70 - orig: 33, 70 - offset: 0, 0 - index: -1 -goblingirl/left-shoulder - rotate: true - xy: 135, 39 - size: 28, 46 - orig: 28, 46 - offset: 0, 0 - index: -1 -goblingirl/left-upper-leg - rotate: false - xy: 98, 222 - size: 33, 70 - orig: 33, 70 - offset: 0, 0 - index: -1 -goblingirl/neck - rotate: true - xy: 125, 2 - size: 35, 41 - orig: 35, 41 - offset: 0, 0 - index: -1 -goblingirl/pelvis - rotate: false - xy: 30, 117 - size: 62, 43 - orig: 62, 43 - offset: 0, 0 - index: -1 -goblingirl/right-arm - rotate: false - xy: 160, 69 - size: 28, 50 - orig: 28, 50 - offset: 0, 0 - index: -1 -goblingirl/right-foot - rotate: true - xy: 100, 56 - size: 63, 33 - orig: 63, 33 - offset: 0, 0 - index: -1 -goblingirl/right-hand - rotate: false - xy: 190, 82 - size: 36, 37 - orig: 36, 37 - offset: 0, 0 - index: -1 -goblingirl/right-lower-leg - rotate: true - xy: 26, 162 - size: 36, 76 - orig: 36, 76 - offset: 0, 0 - index: -1 -goblingirl/right-shoulder - rotate: true - xy: 159, 121 - size: 39, 45 - orig: 39, 45 - offset: 0, 0 - index: -1 -goblingirl/right-upper-leg - rotate: true - xy: 94, 121 - size: 34, 63 - orig: 34, 63 - offset: 0, 0 - index: -1 -goblingirl/torso - rotate: false - xy: 26, 274 - size: 68, 96 - orig: 68, 96 - offset: 0, 0 - index: -1 -goblingirl/undie-straps - rotate: true - xy: 169, 323 - size: 55, 19 - orig: 55, 19 - offset: 0, 0 - index: -1 -goblingirl/undies - rotate: false - xy: 175, 167 - size: 36, 29 - orig: 36, 29 - offset: 0, 0 - index: -1 -shield - rotate: false - xy: 26, 200 - size: 70, 72 - orig: 70, 72 - offset: 0, 0 - index: -1 -spear - rotate: false - xy: 2, 153 - size: 22, 368 - orig: 22, 368 - offset: 0, 0 - index: -1 diff --git a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/goblins.json b/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/goblins.json deleted file mode 100755 index 5d83ae1..0000000 --- a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/goblins.json +++ /dev/null @@ -1 +0,0 @@ -{"skeleton":{"hash":"BMzsp4a1APif5tjCQwomTTo3Ino","spine":"2.1.05","width":233.95,"height":354.87},"bones":[{"name":"root"},{"name":"hip","parent":"root","x":0.64,"y":114.41},{"name":"left upper leg","parent":"hip","length":50.39,"x":14.45,"y":2.81,"rotation":-89.09},{"name":"pelvis","parent":"hip","x":1.41,"y":-6.57},{"name":"right upper leg","parent":"hip","length":42.45,"x":-20.07,"y":-6.83,"rotation":-97.49},{"name":"torso","parent":"hip","length":85.82,"x":-6.42,"y":1.97,"rotation":93.92},{"name":"left lower leg","parent":"left upper leg","length":49.89,"x":56.34,"y":0.98,"rotation":-16.65},{"name":"left shoulder","parent":"torso","length":35.43,"x":74.04,"y":-20.38,"rotation":-156.96},{"name":"neck","parent":"torso","length":18.38,"x":81.67,"y":-6.34,"rotation":-1.51},{"name":"right lower leg","parent":"right upper leg","length":58.52,"x":42.99,"y":-0.61,"rotation":-14.34},{"name":"right shoulder","parent":"torso","length":37.24,"x":76.02,"y":18.14,"rotation":133.88},{"name":"head","parent":"neck","length":68.28,"x":20.93,"y":11.59,"rotation":-13.92},{"name":"left arm","parent":"left shoulder","length":35.62,"x":37.85,"y":-2.34,"rotation":28.16},{"name":"left foot","parent":"left lower leg","length":46.5,"x":58.94,"y":-7.61,"rotation":102.43},{"name":"right arm","parent":"right shoulder","length":36.74,"x":37.6,"y":0.31,"rotation":36.32},{"name":"right foot","parent":"right lower leg","length":45.45,"x":64.88,"y":0.04,"rotation":110.3},{"name":"left hand","parent":"left arm","length":11.52,"x":35.62,"y":0.07,"rotation":2.7},{"name":"right hand","parent":"right arm","length":15.32,"x":36.9,"y":0.34,"rotation":2.35}],"slots":[{"name":"left shoulder","bone":"left shoulder","attachment":"left shoulder"},{"name":"left arm","bone":"left arm","attachment":"left arm"},{"name":"left hand item","bone":"left hand","attachment":"spear"},{"name":"left hand","bone":"left hand","attachment":"left hand"},{"name":"left foot","bone":"left foot","attachment":"left foot"},{"name":"left lower leg","bone":"left lower leg","attachment":"left lower leg"},{"name":"left upper leg","bone":"left upper leg","attachment":"left upper leg"},{"name":"neck","bone":"neck","attachment":"neck"},{"name":"torso","bone":"torso","attachment":"torso"},{"name":"pelvis","bone":"pelvis","attachment":"pelvis"},{"name":"right foot","bone":"right foot","attachment":"right foot"},{"name":"right lower leg","bone":"right lower leg","attachment":"right lower leg"},{"name":"undie straps","bone":"pelvis","attachment":"undie straps"},{"name":"undies","bone":"pelvis","attachment":"undies"},{"name":"right upper leg","bone":"right upper leg","attachment":"right upper leg"},{"name":"head","bone":"head","attachment":"head"},{"name":"eyes","bone":"head"},{"name":"right shoulder","bone":"right shoulder","attachment":"right shoulder"},{"name":"right arm","bone":"right arm","attachment":"right arm"},{"name":"right hand item","bone":"right hand"},{"name":"right hand","bone":"right hand","attachment":"right hand"},{"name":"right hand item top","bone":"right hand","attachment":"shield"}],"skins":{"default":{"left hand item":{"dagger":{"x":7.88,"y":-23.45,"rotation":10.47,"width":26,"height":108},"spear":{"x":-4.55,"y":39.2,"rotation":13.04,"width":22,"height":368}},"right hand item":{"dagger":{"x":6.51,"y":-24.15,"rotation":-8.06,"width":26,"height":108}},"right hand item top":{"shield":{"rotation":93.49,"width":70,"height":72}}},"goblin":{"eyes":{"eyes closed":{"name":"goblin/eyes-closed","x":32.21,"y":-21.27,"rotation":-88.92,"width":34,"height":12}},"head":{"head":{"name":"goblin/head","x":25.73,"y":2.33,"rotation":-92.29,"width":103,"height":66}},"left arm":{"left arm":{"name":"goblin/left-arm","x":16.7,"y":-1.69,"scaleX":1.057,"scaleY":1.057,"rotation":33.84,"width":37,"height":35}},"left foot":{"left foot":{"name":"goblin/left-foot","x":24.85,"y":8.74,"rotation":3.32,"width":65,"height":31}},"left hand":{"left hand":{"name":"goblin/left-hand","x":3.47,"y":3.41,"scaleX":0.892,"scaleY":0.892,"rotation":31.14,"width":36,"height":41}},"left lower leg":{"left lower leg":{"name":"goblin/left-lower-leg","x":23.58,"y":-2.06,"rotation":105.75,"width":33,"height":70}},"left shoulder":{"left shoulder":{"name":"goblin/left-shoulder","x":15.56,"y":-2.26,"rotation":62.01,"width":29,"height":44}},"left upper leg":{"left upper leg":{"name":"goblin/left-upper-leg","x":29.68,"y":-3.87,"rotation":89.09,"width":33,"height":73}},"neck":{"neck":{"name":"goblin/neck","x":10.1,"y":0.42,"rotation":-93.69,"width":36,"height":41}},"pelvis":{"pelvis":{"name":"goblin/pelvis","x":-5.61,"y":0.76,"width":62,"height":43}},"right arm":{"right arm":{"name":"goblin/right-arm","x":16.44,"y":-1.04,"rotation":94.32,"width":23,"height":50}},"right foot":{"right foot":{"name":"goblin/right-foot","x":23.56,"y":9.8,"rotation":1.52,"width":63,"height":33}},"right hand":{"right hand":{"name":"goblin/right-hand","x":7.88,"y":2.78,"rotation":91.96,"width":36,"height":37}},"right lower leg":{"right lower leg":{"name":"goblin/right-lower-leg","x":25.68,"y":-3.15,"rotation":111.83,"width":36,"height":76}},"right shoulder":{"right shoulder":{"name":"goblin/right-shoulder","x":15.68,"y":-1.03,"rotation":130.65,"width":39,"height":45}},"right upper leg":{"right upper leg":{"name":"goblin/right-upper-leg","x":20.35,"y":1.47,"rotation":97.49,"width":34,"height":63}},"torso":{"torso":{"name":"goblin/torso","x":38.09,"y":-3.87,"rotation":-94.95,"width":68,"height":96}},"undie straps":{"undie straps":{"name":"goblin/undie-straps","x":-3.87,"y":13.1,"scaleX":1.089,"width":55,"height":19}},"undies":{"undies":{"name":"goblin/undies","x":6.3,"y":0.12,"rotation":0.91,"width":36,"height":29}}},"goblingirl":{"eyes":{"eyes closed":{"name":"goblingirl/eyes-closed","x":28,"y":-25.54,"rotation":-87.04,"width":37,"height":21}},"head":{"head":{"name":"goblingirl/head","x":27.71,"y":-4.32,"rotation":-85.58,"width":103,"height":81}},"left arm":{"left arm":{"name":"goblingirl/left-arm","x":19.64,"y":-2.42,"rotation":33.05,"width":37,"height":35}},"left foot":{"left foot":{"name":"goblingirl/left-foot","x":25.17,"y":7.92,"rotation":3.32,"width":65,"height":31}},"left hand":{"left hand":{"name":"goblingirl/left-hand","x":4.34,"y":2.39,"scaleX":0.896,"scaleY":0.896,"rotation":30.34,"width":35,"height":40}},"left lower leg":{"left lower leg":{"name":"goblingirl/left-lower-leg","x":25.02,"y":-0.6,"rotation":105.75,"width":33,"height":70}},"left shoulder":{"left shoulder":{"name":"goblingirl/left-shoulder","x":19.8,"y":-0.42,"rotation":61.21,"width":28,"height":46}},"left upper leg":{"left upper leg":{"name":"goblingirl/left-upper-leg","x":30.21,"y":-2.95,"rotation":89.09,"width":33,"height":70}},"neck":{"neck":{"name":"goblingirl/neck","x":6.16,"y":-3.14,"rotation":-98.86,"width":35,"height":41}},"pelvis":{"pelvis":{"name":"goblingirl/pelvis","x":-3.87,"y":3.18,"width":62,"height":43}},"right arm":{"right arm":{"name":"goblingirl/right-arm","x":16.85,"y":-0.66,"rotation":93.52,"width":28,"height":50}},"right foot":{"right foot":{"name":"goblingirl/right-foot","x":23.46,"y":9.66,"rotation":1.52,"width":63,"height":33}},"right hand":{"right hand":{"name":"goblingirl/right-hand","x":7.21,"y":3.43,"rotation":91.16,"width":36,"height":37}},"right lower leg":{"right lower leg":{"name":"goblingirl/right-lower-leg","x":26.15,"y":-3.27,"rotation":111.83,"width":36,"height":76}},"right shoulder":{"right shoulder":{"name":"goblingirl/right-shoulder","x":14.46,"y":0.45,"rotation":129.85,"width":39,"height":45}},"right upper leg":{"right upper leg":{"name":"goblingirl/right-upper-leg","x":19.69,"y":2.13,"rotation":97.49,"width":34,"height":63}},"torso":{"torso":{"name":"goblingirl/torso","x":36.28,"y":-5.14,"rotation":-95.74,"width":68,"height":96}},"undie straps":{"undie straps":{"name":"goblingirl/undie-straps","x":-1.51,"y":14.18,"width":55,"height":19}},"undies":{"undies":{"name":"goblingirl/undies","x":5.4,"y":1.7,"width":36,"height":29}}}},"animations":{"walk":{"slots":{"eyes":{"attachment":[{"time":0.7,"name":"eyes closed"},{"time":0.8,"name":null}]}},"bones":{"left upper leg":{"rotate":[{"time":0,"angle":-26.55},{"time":0.1333,"angle":-8.78},{"time":0.2333,"angle":9.51},{"time":0.3666,"angle":30.74},{"time":0.5,"angle":25.33},{"time":0.6333,"angle":26.11},{"time":0.7333,"angle":-7.7},{"time":0.8666,"angle":-21.19},{"time":1,"angle":-26.55}],"translate":[{"time":0,"x":-1.32,"y":1.7},{"time":0.3666,"x":-0.06,"y":2.42},{"time":1,"x":-1.32,"y":1.7}]},"right upper leg":{"rotate":[{"time":0,"angle":42.45},{"time":0.1333,"angle":52.1},{"time":0.2333,"angle":8.53},{"time":0.5,"angle":-16.93},{"time":0.6333,"angle":1.89},{"time":0.7333,"angle":28.06,"curve":[0.462,0.11,1,1]},{"time":0.8666,"angle":58.68,"curve":[0.5,0.02,1,1]},{"time":1,"angle":42.45}],"translate":[{"time":0,"x":6.23,"y":0},{"time":0.2333,"x":2.14,"y":2.4},{"time":0.5,"x":2.44,"y":4.8},{"time":1,"x":6.23,"y":0}]},"left lower leg":{"rotate":[{"time":0,"angle":-22.98},{"time":0.1333,"angle":-63.5},{"time":0.2333,"angle":-73.76},{"time":0.5,"angle":5.11},{"time":0.6333,"angle":-28.29},{"time":0.7333,"angle":4.08},{"time":0.8666,"angle":3.53},{"time":1,"angle":-22.98}],"translate":[{"time":0,"x":0,"y":0},{"time":0.2333,"x":2.55,"y":-0.47},{"time":0.5,"x":0,"y":0,"curve":"stepped"},{"time":1,"x":0,"y":0}]},"left foot":{"rotate":[{"time":0,"angle":-3.69},{"time":0.1333,"angle":-10.42},{"time":0.2333,"angle":-5.01},{"time":0.3666,"angle":3.87},{"time":0.5,"angle":-3.87},{"time":0.6333,"angle":2.78},{"time":0.7333,"angle":1.68},{"time":0.8666,"angle":-8.54},{"time":1,"angle":-3.69}]},"right shoulder":{"rotate":[{"time":0,"angle":5.29,"curve":[0.264,0,0.75,1]},{"time":0.6333,"angle":6.65},{"time":1,"angle":5.29}]},"right arm":{"rotate":[{"time":0,"angle":-4.02,"curve":[0.267,0,0.804,0.99]},{"time":0.6333,"angle":19.78,"curve":[0.307,0,0.787,0.99]},{"time":1,"angle":-4.02}]},"right hand":{"rotate":[{"time":0,"angle":8.98},{"time":0.6333,"angle":0.51},{"time":1,"angle":8.98}]},"left shoulder":{"rotate":[{"time":0,"angle":6.25,"curve":[0.339,0,0.683,1]},{"time":0.5,"angle":-11.78,"curve":[0.281,0,0.686,0.99]},{"time":1,"angle":6.25}],"translate":[{"time":0,"x":1.15,"y":0.23}]},"left hand":{"rotate":[{"time":0,"angle":-21.23,"curve":[0.295,0,0.755,0.98]},{"time":0.5,"angle":-27.28,"curve":[0.241,0,0.75,0.97]},{"time":1,"angle":-21.23}]},"left arm":{"rotate":[{"time":0,"angle":28.37,"curve":[0.339,0,0.683,1]},{"time":0.5,"angle":60.09,"curve":[0.281,0,0.686,0.99]},{"time":1,"angle":28.37}]},"torso":{"rotate":[{"time":0,"angle":-10.28},{"time":0.1333,"angle":-15.38,"curve":[0.545,0,0.818,1]},{"time":0.3666,"angle":-9.78,"curve":[0.58,0.17,0.669,0.99]},{"time":0.6333,"angle":-15.75,"curve":[0.235,0.01,0.795,1]},{"time":0.8666,"angle":-7.06,"curve":[0.209,0,0.816,0.98]},{"time":1,"angle":-10.28}],"translate":[{"time":0,"x":-1.29,"y":1.68}]},"right foot":{"rotate":[{"time":0,"angle":-5.25},{"time":0.2333,"angle":-1.91},{"time":0.3666,"angle":-6.45},{"time":0.5,"angle":-5.39},{"time":0.7333,"angle":-11.68},{"time":0.8666,"angle":0.46},{"time":1,"angle":-5.25}]},"right lower leg":{"rotate":[{"time":0,"angle":-3.39,"curve":[0.316,0.01,0.741,0.98]},{"time":0.1333,"angle":-45.53,"curve":[0.229,0,0.738,0.97]},{"time":0.2333,"angle":-4.83},{"time":0.5,"angle":-19.53},{"time":0.6333,"angle":-64.8},{"time":0.7333,"angle":-82.56,"curve":[0.557,0.18,1,1]},{"time":1,"angle":-3.39}],"translate":[{"time":0,"x":0,"y":0,"curve":"stepped"},{"time":0.5,"x":0,"y":0},{"time":0.6333,"x":2.18,"y":0.21},{"time":1,"x":0,"y":0}]},"hip":{"rotate":[{"time":0,"angle":0,"curve":"stepped"},{"time":1,"angle":0}],"translate":[{"time":0,"x":0,"y":-4.16},{"time":0.1333,"x":0,"y":-7.05,"curve":[0.359,0.47,0.646,0.74]},{"time":0.3666,"x":0,"y":6.78},{"time":0.5,"x":0,"y":-6.13},{"time":0.6333,"x":0,"y":-7.05,"curve":[0.359,0.47,0.646,0.74]},{"time":0.8666,"x":0,"y":6.78},{"time":1,"x":0,"y":-4.16}]},"neck":{"rotate":[{"time":0,"angle":3.6},{"time":0.1333,"angle":17.49},{"time":0.2333,"angle":6.1},{"time":0.3666,"angle":3.45},{"time":0.5,"angle":5.17},{"time":0.6333,"angle":18.36},{"time":0.7333,"angle":6.09},{"time":0.8666,"angle":2.28},{"time":1,"angle":3.6}]},"head":{"rotate":[{"time":0,"angle":3.6,"curve":[0,0,0.704,1.17]},{"time":0.1333,"angle":-0.2},{"time":0.2333,"angle":6.1},{"time":0.3666,"angle":3.45},{"time":0.5,"angle":5.17,"curve":[0,0,0.704,1.61]},{"time":0.6666,"angle":1.1},{"time":0.7333,"angle":6.09},{"time":0.8666,"angle":2.28},{"time":1,"angle":3.6}]}}}}} \ No newline at end of file diff --git a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/goblins.png b/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/goblins.png deleted file mode 100755 index f2cdf16..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/goblins.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/iP4_BGtile.jpg b/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/iP4_BGtile.jpg deleted file mode 100755 index 767a4fd..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/iP4_BGtile.jpg and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/iP4_ground.png b/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/iP4_ground.png deleted file mode 100755 index a7f92af..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/iP4_ground.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/spineboy.atlas b/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/spineboy.atlas deleted file mode 100755 index cf32cd0..0000000 --- a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/spineboy.atlas +++ /dev/null @@ -1,165 +0,0 @@ -spineboy.png -format: RGBA8888 -filter: Linear,Linear -repeat: none -eyes-closed - rotate: false - xy: 73, 509 - size: 34, 27 - orig: 34, 27 - offset: 0, 0 - index: -1 -eyes - rotate: false - xy: 75, 464 - size: 34, 27 - orig: 34, 27 - offset: 0, 0 - index: -1 -head - rotate: false - xy: 2, 2 - size: 121, 132 - orig: 121, 132 - offset: 0, 0 - index: -1 -left-ankle - rotate: false - xy: 96, 351 - size: 25, 32 - orig: 25, 32 - offset: 0, 0 - index: -1 -left-arm - rotate: false - xy: 39, 423 - size: 35, 29 - orig: 35, 29 - offset: 0, 0 - index: -1 -left-foot - rotate: false - xy: 2, 262 - size: 65, 30 - orig: 65, 30 - offset: 0, 0 - index: -1 -left-hand - rotate: false - xy: 2, 423 - size: 35, 38 - orig: 35, 38 - offset: 0, 0 - index: -1 -left-lower-leg - rotate: false - xy: 72, 202 - size: 49, 64 - orig: 49, 64 - offset: 0, 0 - index: -1 -left-pant-bottom - rotate: false - xy: 2, 363 - size: 44, 22 - orig: 44, 22 - offset: 0, 0 - index: -1 -left-shoulder - rotate: false - xy: 39, 454 - size: 34, 53 - orig: 34, 53 - offset: 0, 0 - index: -1 -left-upper-leg - rotate: false - xy: 2, 464 - size: 33, 67 - orig: 33, 67 - offset: 0, 0 - index: -1 -neck - rotate: false - xy: 37, 509 - size: 34, 28 - orig: 34, 28 - offset: 0, 0 - index: -1 -pelvis - rotate: false - xy: 2, 294 - size: 63, 47 - orig: 63, 47 - offset: 0, 0 - index: -1 -right-ankle - rotate: false - xy: 96, 385 - size: 25, 30 - orig: 25, 30 - offset: 0, 0 - index: -1 -right-arm - rotate: false - xy: 96, 417 - size: 21, 45 - orig: 21, 45 - offset: 0, 0 - index: -1 -right-foot-idle - rotate: false - xy: 69, 268 - size: 53, 28 - orig: 53, 28 - offset: 0, 0 - index: -1 -right-foot - rotate: false - xy: 2, 230 - size: 67, 30 - orig: 67, 30 - offset: 0, 0 - index: -1 -right-hand - rotate: false - xy: 2, 387 - size: 32, 32 - orig: 32, 32 - offset: 0, 0 - index: -1 -right-lower-leg - rotate: false - xy: 72, 136 - size: 51, 64 - orig: 51, 64 - offset: 0, 0 - index: -1 -right-pant-bottom - rotate: false - xy: 2, 343 - size: 46, 18 - orig: 46, 18 - offset: 0, 0 - index: -1 -right-shoulder - rotate: false - xy: 67, 298 - size: 52, 51 - orig: 52, 51 - offset: 0, 0 - index: -1 -right-upper-leg - rotate: false - xy: 50, 351 - size: 44, 70 - orig: 44, 70 - offset: 0, 0 - index: -1 -torso - rotate: false - xy: 2, 136 - size: 68, 92 - orig: 68, 92 - offset: 0, 0 - index: -1 diff --git a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/spineboy.json b/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/spineboy.json deleted file mode 100755 index 17c5095..0000000 --- a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/spineboy.json +++ /dev/null @@ -1,787 +0,0 @@ -{ -"bones": [ - { "name": "root" }, - { "name": "hip", "parent": "root", "x": 0.64, "y": 114.41 }, - { "name": "left upper leg", "parent": "hip", "length": 50.39, "x": 14.45, "y": 2.81, "rotation": -89.09 }, - { "name": "left lower leg", "parent": "left upper leg", "length": 56.45, "x": 51.78, "y": 3.46, "rotation": -16.65 }, - { "name": "left foot", "parent": "left lower leg", "length": 46.5, "x": 64.02, "y": -8.67, "rotation": 102.43 }, - { "name": "right upper leg", "parent": "hip", "length": 45.76, "x": -18.27, "rotation": -101.13 }, - { "name": "right lower leg", "parent": "right upper leg", "length": 58.52, "x": 50.21, "y": 0.6, "rotation": -10.7 }, - { "name": "right foot", "parent": "right lower leg", "length": 45.45, "x": 64.88, "y": 0.04, "rotation": 110.3 }, - { "name": "torso", "parent": "hip", "length": 85.82, "x": -6.42, "y": 1.97, "rotation": 94.95 }, - { "name": "neck", "parent": "torso", "length": 18.38, "x": 83.64, "y": -1.78, "rotation": 0.9 }, - { "name": "head", "parent": "neck", "length": 68.28, "x": 19.09, "y": 6.97, "rotation": -8.94 }, - { "name": "right shoulder", "parent": "torso", "length": 49.95, "x": 81.9, "y": 6.79, "rotation": 130.6 }, - { "name": "right arm", "parent": "right shoulder", "length": 36.74, "x": 49.95, "y": -0.12, "rotation": 40.12 }, - { "name": "right hand", "parent": "right arm", "length": 15.32, "x": 36.9, "y": 0.34, "rotation": 2.35 }, - { "name": "left shoulder", "parent": "torso", "length": 44.19, "x": 78.96, "y": -15.75, "rotation": -156.96 }, - { "name": "left arm", "parent": "left shoulder", "length": 35.62, "x": 44.19, "y": -0.01, "rotation": 28.16 }, - { "name": "left hand", "parent": "left arm", "length": 11.52, "x": 35.62, "y": 0.07, "rotation": 2.7 }, - { "name": "pelvis", "parent": "hip", "x": 1.41, "y": -6.57 } -], -"slots": [ - { "name": "left shoulder", "bone": "left shoulder", "attachment": "left-shoulder" }, - { "name": "left arm", "bone": "left arm", "attachment": "left-arm" }, - { "name": "left hand", "bone": "left hand", "attachment": "left-hand" }, - { "name": "left foot", "bone": "left foot", "attachment": "left-foot" }, - { "name": "left lower leg", "bone": "left lower leg", "attachment": "left-lower-leg" }, - { "name": "left upper leg", "bone": "left upper leg", "attachment": "left-upper-leg" }, - { "name": "pelvis", "bone": "pelvis", "attachment": "pelvis" }, - { "name": "right foot", "bone": "right foot", "attachment": "right-foot" }, - { "name": "right lower leg", "bone": "right lower leg", "attachment": "right-lower-leg" }, - { "name": "right upper leg", "bone": "right upper leg", "attachment": "right-upper-leg" }, - { "name": "torso", "bone": "torso", "attachment": "torso" }, - { "name": "neck", "bone": "neck", "attachment": "neck" }, - { "name": "head", "bone": "head", "attachment": "head" }, - { "name": "eyes", "bone": "head", "attachment": "eyes" }, - { "name": "right shoulder", "bone": "right shoulder", "attachment": "right-shoulder" }, - { "name": "right arm", "bone": "right arm", "attachment": "right-arm" }, - { "name": "right hand", "bone": "right hand", "attachment": "right-hand" } -], -"skins": { - "default": { - "left shoulder": { - "left-shoulder": { "x": 23.74, "y": 0.11, "rotation": 62.01, "width": 34, "height": 53 } - }, - "left arm": { - "left-arm": { "x": 15.11, "y": -0.44, "rotation": 33.84, "width": 35, "height": 29 } - }, - "left hand": { - "left-hand": { "x": 0.75, "y": 1.86, "rotation": 31.14, "width": 35, "height": 38 } - }, - "left foot": { - "left-foot": { "x": 24.35, "y": 8.88, "rotation": 3.32, "width": 65, "height": 30 } - }, - "left lower leg": { - "left-lower-leg": { "x": 24.55, "y": -1.92, "rotation": 105.75, "width": 49, "height": 64 } - }, - "left upper leg": { - "left-upper-leg": { "x": 26.12, "y": -1.85, "rotation": 89.09, "width": 33, "height": 67 } - }, - "pelvis": { - "pelvis": { "x": -4.83, "y": 10.62, "width": 63, "height": 47 } - }, - "right foot": { - "right-foot": { "x": 19.02, "y": 8.47, "rotation": 1.52, "width": 67, "height": 30 } - }, - "right lower leg": { - "right-lower-leg": { "x": 23.28, "y": -2.59, "rotation": 111.83, "width": 51, "height": 64 } - }, - "right upper leg": { - "right-upper-leg": { "x": 23.03, "y": 0.25, "rotation": 101.13, "width": 44, "height": 70 } - }, - "torso": { - "torso": { "x": 44.57, "y": -7.08, "rotation": -94.95, "width": 68, "height": 92 } - }, - "neck": { - "neck": { "x": 9.42, "y": -3.66, "rotation": -100.15, "width": 34, "height": 28 } - }, - "head": { - "head": { "x": 53.94, "y": -5.75, "rotation": -86.9, "width": 121, "height": 132 } - }, - "eyes": { - "eyes": { "x": 28.94, "y": -32.92, "rotation": -86.9, "width": 34, "height": 27 }, - "eyes-closed": { "x": 28.77, "y": -32.86, "rotation": -86.9, "width": 34, "height": 27 } - }, - "right shoulder": { - "right-shoulder": { "x": 25.86, "y": 0.03, "rotation": 134.44, "width": 52, "height": 51 } - }, - "right arm": { - "right-arm": { "x": 18.34, "y": -2.64, "rotation": 94.32, "width": 21, "height": 45 } - }, - "right hand": { - "right-hand": { "x": 6.82, "y": 1.25, "rotation": 91.96, "width": 32, "height": 32 } - } - } -}, -"animations": { - "walk": { - "bones": { - "left upper leg": { - "rotate": [ - { "time": 0, "angle": -26.55 }, - { "time": 0.1333, "angle": -8.78 }, - { "time": 0.2666, "angle": 9.51 }, - { "time": 0.4, "angle": 30.74 }, - { "time": 0.5333, "angle": 25.33 }, - { "time": 0.6666, "angle": 26.11 }, - { "time": 0.8, "angle": -7.7 }, - { "time": 0.9333, "angle": -21.19 }, - { "time": 1.0666, "angle": -26.55 } - ], - "translate": [ - { "time": 0, "x": -3, "y": -2.25 }, - { "time": 0.4, "x": -2.18, "y": -2.25 }, - { "time": 1.0666, "x": -3, "y": -2.25 } - ] - }, - "right upper leg": { - "rotate": [ - { "time": 0, "angle": 42.45 }, - { "time": 0.1333, "angle": 52.1 }, - { "time": 0.2666, "angle": 5.96 }, - { "time": 0.5333, "angle": -16.93 }, - { "time": 0.6666, "angle": 1.89 }, - { - "time": 0.8, - "angle": 28.06, - "curve": [ 0.462, 0.11, 1, 1 ] - }, - { - "time": 0.9333, - "angle": 58.68, - "curve": [ 0.5, 0.02, 1, 1 ] - }, - { "time": 1.0666, "angle": 42.45 } - ], - "translate": [ - { "time": 0, "x": 8.11, "y": -2.36 }, - { "time": 0.1333, "x": 10.03, "y": -2.56 }, - { "time": 0.4, "x": 2.76, "y": -2.97 }, - { "time": 0.5333, "x": 2.76, "y": -2.81 }, - { "time": 0.9333, "x": 8.67, "y": -2.54 }, - { "time": 1.0666, "x": 8.11, "y": -2.36 } - ] - }, - "left lower leg": { - "rotate": [ - { "time": 0, "angle": -10.21 }, - { "time": 0.1333, "angle": -55.64 }, - { "time": 0.2666, "angle": -68.12 }, - { "time": 0.5333, "angle": 5.11 }, - { "time": 0.6666, "angle": -28.29 }, - { "time": 0.8, "angle": 4.08 }, - { "time": 0.9333, "angle": 3.53 }, - { "time": 1.0666, "angle": -10.21 } - ] - }, - "left foot": { - "rotate": [ - { "time": 0, "angle": -3.69 }, - { "time": 0.1333, "angle": -10.42 }, - { "time": 0.2666, "angle": -17.14 }, - { "time": 0.4, "angle": -2.83 }, - { "time": 0.5333, "angle": -3.87 }, - { "time": 0.6666, "angle": 2.78 }, - { "time": 0.8, "angle": 1.68 }, - { "time": 0.9333, "angle": -8.54 }, - { "time": 1.0666, "angle": -3.69 } - ] - }, - "right shoulder": { - "rotate": [ - { - "time": 0, - "angle": 20.89, - "curve": [ 0.264, 0, 0.75, 1 ] - }, - { - "time": 0.1333, - "angle": 3.72, - "curve": [ 0.272, 0, 0.841, 1 ] - }, - { "time": 0.6666, "angle": -278.28 }, - { "time": 1.0666, "angle": 20.89 } - ], - "translate": [ - { "time": 0, "x": -7.84, "y": 7.19 }, - { "time": 0.1333, "x": -6.36, "y": 6.42 }, - { "time": 0.6666, "x": -11.07, "y": 5.25 }, - { "time": 1.0666, "x": -7.84, "y": 7.19 } - ] - }, - "right arm": { - "rotate": [ - { - "time": 0, - "angle": -4.02, - "curve": [ 0.267, 0, 0.804, 0.99 ] - }, - { - "time": 0.1333, - "angle": -13.99, - "curve": [ 0.341, 0, 1, 1 ] - }, - { - "time": 0.6666, - "angle": 36.54, - "curve": [ 0.307, 0, 0.787, 0.99 ] - }, - { "time": 1.0666, "angle": -4.02 } - ] - }, - "right hand": { - "rotate": [ - { "time": 0, "angle": 22.92 }, - { "time": 0.4, "angle": -8.97 }, - { "time": 0.6666, "angle": 0.51 }, - { "time": 1.0666, "angle": 22.92 } - ] - }, - "left shoulder": { - "rotate": [ - { "time": 0, "angle": -1.47 }, - { "time": 0.1333, "angle": 13.6 }, - { "time": 0.6666, "angle": 280.74 }, - { "time": 1.0666, "angle": -1.47 } - ], - "translate": [ - { "time": 0, "x": -1.76, "y": 0.56 }, - { "time": 0.6666, "x": -2.47, "y": 8.14 }, - { "time": 1.0666, "x": -1.76, "y": 0.56 } - ] - }, - "left hand": { - "rotate": [ - { - "time": 0, - "angle": 11.58, - "curve": [ 0.169, 0.37, 0.632, 1.55 ] - }, - { - "time": 0.1333, - "angle": 28.13, - "curve": [ 0.692, 0, 0.692, 0.99 ] - }, - { - "time": 0.6666, - "angle": -27.42, - "curve": [ 0.117, 0.41, 0.738, 1.76 ] - }, - { "time": 0.8, "angle": -36.32 }, - { "time": 1.0666, "angle": 11.58 } - ] - }, - "left arm": { - "rotate": [ - { "time": 0, "angle": -8.27 }, - { "time": 0.1333, "angle": 18.43 }, - { "time": 0.6666, "angle": 0.88 }, - { "time": 1.0666, "angle": -8.27 } - ] - }, - "torso": { - "rotate": [ - { "time": 0, "angle": -10.28 }, - { - "time": 0.1333, - "angle": -15.38, - "curve": [ 0.545, 0, 1, 1 ] - }, - { - "time": 0.4, - "angle": -9.78, - "curve": [ 0.58, 0.17, 1, 1 ] - }, - { "time": 0.6666, "angle": -15.75 }, - { "time": 0.9333, "angle": -7.06 }, - { "time": 1.0666, "angle": -10.28 } - ], - "translate": [ - { "time": 0, "x": -3.67, "y": 1.68 }, - { "time": 0.1333, "x": -3.67, "y": 0.68 }, - { "time": 0.4, "x": -3.67, "y": 1.97 }, - { "time": 0.6666, "x": -3.67, "y": -0.14 }, - { "time": 1.0666, "x": -3.67, "y": 1.68 } - ] - }, - "right foot": { - "rotate": [ - { "time": 0, "angle": -5.25 }, - { "time": 0.2666, "angle": -4.08 }, - { "time": 0.4, "angle": -6.45 }, - { "time": 0.5333, "angle": -5.39 }, - { "time": 0.8, "angle": -11.68 }, - { "time": 0.9333, "angle": 0.46 }, - { "time": 1.0666, "angle": -5.25 } - ] - }, - "right lower leg": { - "rotate": [ - { "time": 0, "angle": -3.39 }, - { "time": 0.1333, "angle": -45.53 }, - { "time": 0.2666, "angle": -2.59 }, - { "time": 0.5333, "angle": -19.53 }, - { "time": 0.6666, "angle": -64.8 }, - { - "time": 0.8, - "angle": -82.56, - "curve": [ 0.557, 0.18, 1, 1 ] - }, - { "time": 1.0666, "angle": -3.39 } - ] - }, - "hip": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 1.0666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { - "time": 0.1333, - "x": 0, - "y": -7.61, - "curve": [ 0.272, 0.86, 1, 1 ] - }, - { "time": 0.4, "x": 0, "y": 8.7 }, - { "time": 0.5333, "x": 0, "y": -0.41 }, - { - "time": 0.6666, - "x": 0, - "y": -7.05, - "curve": [ 0.235, 0.89, 1, 1 ] - }, - { "time": 0.8, "x": 0, "y": 2.92 }, - { "time": 0.9333, "x": 0, "y": 6.78 }, - { "time": 1.0666, "x": 0, "y": 0 } - ] - }, - "neck": { - "rotate": [ - { "time": 0, "angle": 3.6 }, - { "time": 0.1333, "angle": 17.49 }, - { "time": 0.2666, "angle": 6.1 }, - { "time": 0.4, "angle": 3.45 }, - { "time": 0.5333, "angle": 5.17 }, - { "time": 0.6666, "angle": 18.36 }, - { "time": 0.8, "angle": 6.09 }, - { "time": 0.9333, "angle": 2.28 }, - { "time": 1.0666, "angle": 3.6 } - ] - }, - "head": { - "rotate": [ - { - "time": 0, - "angle": 3.6, - "curve": [ 0, 0, 0.704, 1.61 ] - }, - { "time": 0.1666, "angle": -0.2 }, - { "time": 0.2666, "angle": 6.1 }, - { "time": 0.4, "angle": 3.45 }, - { - "time": 0.5333, - "angle": 5.17, - "curve": [ 0, 0, 0.704, 1.61 ] - }, - { "time": 0.7, "angle": 1.1 }, - { "time": 0.8, "angle": 6.09 }, - { "time": 0.9333, "angle": 2.28 }, - { "time": 1.0666, "angle": 3.6 } - ] - } - } - }, - "jump": { - "bones": { - "hip": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 0.9333, "angle": 0, "curve": "stepped" }, - { "time": 1.3666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": -11.57, "y": -3 }, - { "time": 0.2333, "x": -16.2, "y": -19.43 }, - { - "time": 0.3333, - "x": 7.66, - "y": -8.48, - "curve": [ 0.057, 0.06, 0.712, 1 ] - }, - { "time": 0.3666, "x": 15.38, "y": 5.01 }, - { "time": 0.4666, "x": -7.84, "y": 57.22 }, - { - "time": 0.6, - "x": -10.81, - "y": 96.34, - "curve": [ 0.241, 0, 1, 1 ] - }, - { "time": 0.7333, "x": -7.01, "y": 54.7 }, - { "time": 0.8, "x": -10.58, "y": 32.2 }, - { "time": 0.9333, "x": -31.99, "y": 0.45 }, - { "time": 1.0666, "x": -12.48, "y": -29.47 }, - { "time": 1.3666, "x": -11.57, "y": -3 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left upper leg": { - "rotate": [ - { "time": 0, "angle": 17.13 }, - { "time": 0.2333, "angle": 44.35 }, - { "time": 0.3333, "angle": 16.46 }, - { "time": 0.4, "angle": -9.88 }, - { "time": 0.4666, "angle": -11.42 }, - { "time": 0.5666, "angle": 23.46 }, - { "time": 0.7666, "angle": 71.82 }, - { "time": 0.9333, "angle": 65.53 }, - { "time": 1.0666, "angle": 51.01 }, - { "time": 1.3666, "angle": 17.13 } - ], - "translate": [ - { "time": 0, "x": -3, "y": -2.25, "curve": "stepped" }, - { "time": 0.9333, "x": -3, "y": -2.25, "curve": "stepped" }, - { "time": 1.3666, "x": -3, "y": -2.25 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left lower leg": { - "rotate": [ - { "time": 0, "angle": -16.25 }, - { "time": 0.2333, "angle": -52.21 }, - { "time": 0.4, "angle": 15.04 }, - { "time": 0.4666, "angle": -8.95 }, - { "time": 0.5666, "angle": -39.53 }, - { "time": 0.7666, "angle": -27.27 }, - { "time": 0.9333, "angle": -3.52 }, - { "time": 1.0666, "angle": -61.92 }, - { "time": 1.3666, "angle": -16.25 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left foot": { - "rotate": [ - { "time": 0, "angle": 0.33 }, - { "time": 0.2333, "angle": 6.2 }, - { "time": 0.3333, "angle": 14.73 }, - { "time": 0.4, "angle": -15.54 }, - { "time": 0.4333, "angle": -21.2 }, - { "time": 0.5666, "angle": -7.55 }, - { "time": 0.7666, "angle": -0.67 }, - { "time": 0.9333, "angle": -0.58 }, - { "time": 1.0666, "angle": 14.64 }, - { "time": 1.3666, "angle": 0.33 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right upper leg": { - "rotate": [ - { "time": 0, "angle": 25.97 }, - { "time": 0.2333, "angle": 46.43 }, - { "time": 0.3333, "angle": 22.61 }, - { "time": 0.4, "angle": 2.13 }, - { - "time": 0.4666, - "angle": 0.04, - "curve": [ 0, 0, 0.637, 0.98 ] - }, - { "time": 0.6, "angle": 65.55 }, - { "time": 0.7666, "angle": 64.93 }, - { "time": 0.9333, "angle": 41.08 }, - { "time": 1.0666, "angle": 66.25 }, - { "time": 1.3666, "angle": 25.97 } - ], - "translate": [ - { "time": 0, "x": 5.74, "y": 0.61 }, - { "time": 0.2333, "x": 4.79, "y": 1.79 }, - { "time": 0.3333, "x": 6.05, "y": -4.55 }, - { "time": 0.9333, "x": 4.79, "y": 1.79, "curve": "stepped" }, - { "time": 1.0666, "x": 4.79, "y": 1.79 }, - { "time": 1.3666, "x": 5.74, "y": 0.61 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right lower leg": { - "rotate": [ - { "time": 0, "angle": -27.46 }, - { "time": 0.2333, "angle": -64.03 }, - { "time": 0.4, "angle": -48.36 }, - { "time": 0.5666, "angle": -76.86 }, - { "time": 0.7666, "angle": -26.89 }, - { "time": 0.9, "angle": -18.97 }, - { "time": 0.9333, "angle": -14.18 }, - { "time": 1.0666, "angle": -80.45 }, - { "time": 1.3666, "angle": -27.46 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right foot": { - "rotate": [ - { "time": 0, "angle": 1.08 }, - { "time": 0.2333, "angle": 16.02 }, - { "time": 0.3, "angle": 12.94 }, - { "time": 0.3333, "angle": 15.16 }, - { "time": 0.4, "angle": -14.7 }, - { "time": 0.4333, "angle": -12.85 }, - { "time": 0.4666, "angle": -19.18 }, - { "time": 0.5666, "angle": -15.82 }, - { "time": 0.6, "angle": -3.59 }, - { "time": 0.7666, "angle": -3.56 }, - { "time": 0.9333, "angle": 1.86 }, - { "time": 1.0666, "angle": 16.02 }, - { "time": 1.3666, "angle": 1.08 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "torso": { - "rotate": [ - { "time": 0, "angle": -13.35 }, - { "time": 0.2333, "angle": -48.95 }, - { "time": 0.4333, "angle": -35.77 }, - { "time": 0.6, "angle": -4.59 }, - { "time": 0.7666, "angle": 14.61 }, - { "time": 0.9333, "angle": 15.74 }, - { "time": 1.0666, "angle": -32.44 }, - { "time": 1.3666, "angle": -13.35 } - ], - "translate": [ - { "time": 0, "x": -3.67, "y": 1.68, "curve": "stepped" }, - { "time": 0.9333, "x": -3.67, "y": 1.68, "curve": "stepped" }, - { "time": 1.3666, "x": -3.67, "y": 1.68 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "neck": { - "rotate": [ - { "time": 0, "angle": 12.78 }, - { "time": 0.2333, "angle": 16.46 }, - { "time": 0.4, "angle": 26.49 }, - { "time": 0.6, "angle": 15.51 }, - { "time": 0.7666, "angle": 1.34 }, - { "time": 0.9333, "angle": 2.35 }, - { "time": 1.0666, "angle": 6.08 }, - { "time": 1.3, "angle": 21.23 }, - { "time": 1.3666, "angle": 12.78 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "head": { - "rotate": [ - { "time": 0, "angle": 5.19 }, - { "time": 0.2333, "angle": 20.27 }, - { "time": 0.4, "angle": 15.27 }, - { "time": 0.6, "angle": -24.69 }, - { "time": 0.7666, "angle": -11.02 }, - { "time": 0.9333, "angle": -24.38 }, - { "time": 1.0666, "angle": 11.99 }, - { "time": 1.3, "angle": 4.86 }, - { "time": 1.3666, "angle": 5.19 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left shoulder": { - "rotate": [ - { - "time": 0, - "angle": 0.05, - "curve": [ 0, 0, 0.62, 1 ] - }, - { - "time": 0.2333, - "angle": 279.66, - "curve": [ 0.218, 0.67, 0.66, 0.99 ] - }, - { - "time": 0.5, - "angle": 62.27, - "curve": [ 0.462, 0, 0.764, 0.58 ] - }, - { "time": 0.9333, "angle": 28.91 }, - { "time": 1.0666, "angle": -8.62 }, - { "time": 1.1666, "angle": -18.43 }, - { "time": 1.3666, "angle": 0.05 } - ], - "translate": [ - { "time": 0, "x": -1.76, "y": 0.56, "curve": "stepped" }, - { "time": 0.9333, "x": -1.76, "y": 0.56, "curve": "stepped" }, - { "time": 1.3666, "x": -1.76, "y": 0.56 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left hand": { - "rotate": [ - { "time": 0, "angle": 11.58, "curve": "stepped" }, - { "time": 0.9333, "angle": 11.58, "curve": "stepped" }, - { "time": 1.3666, "angle": 11.58 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "left arm": { - "rotate": [ - { "time": 0, "angle": 0.51 }, - { "time": 0.4333, "angle": 12.82 }, - { "time": 0.6, "angle": 47.55 }, - { "time": 0.9333, "angle": 12.82 }, - { "time": 1.1666, "angle": -6.5 }, - { "time": 1.3666, "angle": 0.51 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right shoulder": { - "rotate": [ - { - "time": 0, - "angle": 43.82, - "curve": [ 0, 0, 0.62, 1 ] - }, - { - "time": 0.2333, - "angle": -8.74, - "curve": [ 0.304, 0.58, 0.709, 0.97 ] - }, - { - "time": 0.5333, - "angle": -208.02, - "curve": [ 0.462, 0, 0.764, 0.58 ] - }, - { "time": 0.9333, "angle": -246.72 }, - { "time": 1.0666, "angle": -307.13 }, - { "time": 1.1666, "angle": 37.15 }, - { "time": 1.3666, "angle": 43.82 } - ], - "translate": [ - { "time": 0, "x": -7.84, "y": 7.19, "curve": "stepped" }, - { "time": 0.9333, "x": -7.84, "y": 7.19, "curve": "stepped" }, - { "time": 1.3666, "x": -7.84, "y": 7.19 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right arm": { - "rotate": [ - { "time": 0, "angle": -4.02 }, - { "time": 0.6, "angle": 17.5 }, - { "time": 0.9333, "angle": -4.02 }, - { "time": 1.1666, "angle": -16.72 }, - { "time": 1.3666, "angle": -4.02 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "right hand": { - "rotate": [ - { "time": 0, "angle": 22.92, "curve": "stepped" }, - { "time": 0.9333, "angle": 22.92, "curve": "stepped" }, - { "time": 1.3666, "angle": 22.92 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 0.9333, "x": 0, "y": 0, "curve": "stepped" }, - { "time": 1.3666, "x": 0, "y": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 0.9333, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - }, - "root": { - "rotate": [ - { "time": 0, "angle": 0 }, - { "time": 0.4333, "angle": -14.52 }, - { "time": 0.8, "angle": 9.86 }, - { "time": 1.3666, "angle": 0 } - ], - "scale": [ - { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, - { "time": 1.3666, "x": 1, "y": 1 } - ] - } - } - } -} -} diff --git a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/spineboy.png b/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/spineboy.png deleted file mode 100755 index ab85747..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 12 - Spine/data/spineboy.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 12 - Spine/index.html b/tutorial-4/pixi.js-master/examples/example 12 - Spine/index.html deleted file mode 100755 index 514267d..0000000 --- a/tutorial-4/pixi.js-master/examples/example 12 - Spine/index.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - pixi.js example 12 Spine - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 12 - Spine/index_dragon.html b/tutorial-4/pixi.js-master/examples/example 12 - Spine/index_dragon.html deleted file mode 100755 index a4f62d6..0000000 --- a/tutorial-4/pixi.js-master/examples/example 12 - Spine/index_dragon.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - pixi.js example 12 Spine - - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 12 - Spine/index_goblins.html b/tutorial-4/pixi.js-master/examples/example 12 - Spine/index_goblins.html deleted file mode 100755 index 245e9a0..0000000 --- a/tutorial-4/pixi.js-master/examples/example 12 - Spine/index_goblins.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - pixi.js example 12 Spine - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 12 - Spine/index_pixie.html b/tutorial-4/pixi.js-master/examples/example 12 - Spine/index_pixie.html deleted file mode 100755 index 59d0b36..0000000 --- a/tutorial-4/pixi.js-master/examples/example 12 - Spine/index_pixie.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - pixi.js example 12 Spine - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 13 - Graphics/index.html b/tutorial-4/pixi.js-master/examples/example 13 - Graphics/index.html deleted file mode 100755 index 1164b62..0000000 --- a/tutorial-4/pixi.js-master/examples/example 13 - Graphics/index.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - pixi.js example 13 - Graphics - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 13 - Graphics/indexLineTest.html b/tutorial-4/pixi.js-master/examples/example 13 - Graphics/indexLineTest.html deleted file mode 100755 index 2856845..0000000 --- a/tutorial-4/pixi.js-master/examples/example 13 - Graphics/indexLineTest.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - pixi.js example 13 - Graphics - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_01.png b/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_01.png deleted file mode 100755 index 8687366..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_01.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_02.png b/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_02.png deleted file mode 100755 index a140876..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_02.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_03.png b/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_03.png deleted file mode 100755 index 82532c7..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_03.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_04.png b/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_04.png deleted file mode 100755 index 9c790c3..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_04.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_05.png b/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_05.png deleted file mode 100755 index ebb28c8..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_05.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_06.png b/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_06.png deleted file mode 100755 index 1dec5c8..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_06.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_07.png b/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_07.png deleted file mode 100755 index e14a021..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_07.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_08.png b/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_08.png deleted file mode 100755 index 0197fef..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 13 - Graphics/spinObj_08.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 14 - Masking/BGrotate.jpg b/tutorial-4/pixi.js-master/examples/example 14 - Masking/BGrotate.jpg deleted file mode 100755 index f33f7d4..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 14 - Masking/BGrotate.jpg and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 14 - Masking/Copy of index.html b/tutorial-4/pixi.js-master/examples/example 14 - Masking/Copy of index.html deleted file mode 100755 index ef90f62..0000000 --- a/tutorial-4/pixi.js-master/examples/example 14 - Masking/Copy of index.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - pixi.js example 14 - Masking - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 14 - Masking/LightRotate1.png b/tutorial-4/pixi.js-master/examples/example 14 - Masking/LightRotate1.png deleted file mode 100755 index 44966cf..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 14 - Masking/LightRotate1.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 14 - Masking/LightRotate2.png b/tutorial-4/pixi.js-master/examples/example 14 - Masking/LightRotate2.png deleted file mode 100755 index a6e63c0..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 14 - Masking/LightRotate2.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 14 - Masking/SceneRotate.jpg b/tutorial-4/pixi.js-master/examples/example 14 - Masking/SceneRotate.jpg deleted file mode 100755 index 26fe78b..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 14 - Masking/SceneRotate.jpg and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 14 - Masking/index double mask.html b/tutorial-4/pixi.js-master/examples/example 14 - Masking/index double mask.html deleted file mode 100755 index 5751e7b..0000000 --- a/tutorial-4/pixi.js-master/examples/example 14 - Masking/index double mask.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - pixi.js example 14 - Masking - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 14 - Masking/index nested masks.html b/tutorial-4/pixi.js-master/examples/example 14 - Masking/index nested masks.html deleted file mode 100755 index 7113762..0000000 --- a/tutorial-4/pixi.js-master/examples/example 14 - Masking/index nested masks.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - pixi.js example 14 - Masking - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 14 - Masking/index.html b/tutorial-4/pixi.js-master/examples/example 14 - Masking/index.html deleted file mode 100755 index d786ce1..0000000 --- a/tutorial-4/pixi.js-master/examples/example 14 - Masking/index.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - pixi.js example 14 - Masking - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 14 - Masking/panda.png b/tutorial-4/pixi.js-master/examples/example 14 - Masking/panda.png deleted file mode 100755 index 215a4a9..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 14 - Masking/panda.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 15 - Filters/BGrotate.jpg b/tutorial-4/pixi.js-master/examples/example 15 - Filters/BGrotate.jpg deleted file mode 100755 index f33f7d4..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 15 - Filters/BGrotate.jpg and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 15 - Filters/LightRotate1.png b/tutorial-4/pixi.js-master/examples/example 15 - Filters/LightRotate1.png deleted file mode 100755 index 44966cf..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 15 - Filters/LightRotate1.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 15 - Filters/LightRotate2.png b/tutorial-4/pixi.js-master/examples/example 15 - Filters/LightRotate2.png deleted file mode 100755 index a6e63c0..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 15 - Filters/LightRotate2.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 15 - Filters/SceneRotate.jpg b/tutorial-4/pixi.js-master/examples/example 15 - Filters/SceneRotate.jpg deleted file mode 100755 index 26fe78b..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 15 - Filters/SceneRotate.jpg and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 15 - Filters/dat.gui.min.js b/tutorial-4/pixi.js-master/examples/example 15 - Filters/dat.gui.min.js deleted file mode 100755 index 17e4a3c..0000000 --- a/tutorial-4/pixi.js-master/examples/example 15 - Filters/dat.gui.min.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ -var dat=dat||{};dat.gui=dat.gui||{};dat.utils=dat.utils||{};dat.controllers=dat.controllers||{};dat.dom=dat.dom||{};dat.color=dat.color||{};dat.utils.css=function(){return{load:function(e,a){var a=a||document,c=a.createElement("link");c.type="text/css";c.rel="stylesheet";c.href=e;a.getElementsByTagName("head")[0].appendChild(c)},inject:function(e,a){var a=a||document,c=document.createElement("style");c.type="text/css";c.innerHTML=e;a.getElementsByTagName("head")[0].appendChild(c)}}}(); -dat.utils.common=function(){var e=Array.prototype.forEach,a=Array.prototype.slice;return{BREAK:{},extend:function(c){this.each(a.call(arguments,1),function(a){for(var f in a)this.isUndefined(a[f])||(c[f]=a[f])},this);return c},defaults:function(c){this.each(a.call(arguments,1),function(a){for(var f in a)this.isUndefined(c[f])&&(c[f]=a[f])},this);return c},compose:function(){var c=a.call(arguments);return function(){for(var d=a.call(arguments),f=c.length-1;f>=0;f--)d=[c[f].apply(this,d)];return d[0]}}, -each:function(a,d,f){if(e&&a.forEach===e)a.forEach(d,f);else if(a.length===a.length+0)for(var b=0,n=a.length;b-1?d.length-d.indexOf(".")-1:0};c.superclass=e;a.extend(c.prototype,e.prototype,{setValue:function(a){if(this.__min!==void 0&&athis.__max)a=this.__max;this.__step!==void 0&&a%this.__step!=0&&(a=Math.round(a/this.__step)*this.__step);return c.superclass.prototype.setValue.call(this,a)},min:function(a){this.__min=a;return this},max:function(a){this.__max=a;return this},step:function(a){this.__step=a;return this}});return c}(dat.controllers.Controller,dat.utils.common); -dat.controllers.NumberControllerBox=function(e,a,c){var d=function(f,b,e){function h(){var a=parseFloat(l.__input.value);c.isNaN(a)||l.setValue(a)}function j(a){var b=o-a.clientY;l.setValue(l.getValue()+b*l.__impliedStep);o=a.clientY}function m(){a.unbind(window,"mousemove",j);a.unbind(window,"mouseup",m)}this.__truncationSuspended=false;d.superclass.call(this,f,b,e);var l=this,o;this.__input=document.createElement("input");this.__input.setAttribute("type","text");a.bind(this.__input,"change",h); -a.bind(this.__input,"blur",function(){h();l.__onFinishChange&&l.__onFinishChange.call(l,l.getValue())});a.bind(this.__input,"mousedown",function(b){a.bind(window,"mousemove",j);a.bind(window,"mouseup",m);o=b.clientY});a.bind(this.__input,"keydown",function(a){if(a.keyCode===13)l.__truncationSuspended=true,this.blur(),l.__truncationSuspended=false});this.updateDisplay();this.domElement.appendChild(this.__input)};d.superclass=e;c.extend(d.prototype,e.prototype,{updateDisplay:function(){var a=this.__input, -b;if(this.__truncationSuspended)b=this.getValue();else{b=this.getValue();var c=Math.pow(10,this.__precision);b=Math.round(b*c)/c}a.value=b;return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.NumberController,dat.dom.dom,dat.utils.common); -dat.controllers.NumberControllerSlider=function(e,a,c,d,f){var b=function(d,c,f,e,l){function o(b){b.preventDefault();var d=a.getOffset(g.__background),c=a.getWidth(g.__background);g.setValue(g.__min+(g.__max-g.__min)*((b.clientX-d.left)/(d.left+c-d.left)));return false}function y(){a.unbind(window,"mousemove",o);a.unbind(window,"mouseup",y);g.__onFinishChange&&g.__onFinishChange.call(g,g.getValue())}b.superclass.call(this,d,c,{min:f,max:e,step:l});var g=this;this.__background=document.createElement("div"); -this.__foreground=document.createElement("div");a.bind(this.__background,"mousedown",function(b){a.bind(window,"mousemove",o);a.bind(window,"mouseup",y);o(b)});a.addClass(this.__background,"slider");a.addClass(this.__foreground,"slider-fg");this.updateDisplay();this.__background.appendChild(this.__foreground);this.domElement.appendChild(this.__background)};b.superclass=e;b.useDefaultStyles=function(){c.inject(f)};d.extend(b.prototype,e.prototype,{updateDisplay:function(){this.__foreground.style.width= -(this.getValue()-this.__min)/(this.__max-this.__min)*100+"%";return b.superclass.prototype.updateDisplay.call(this)}});return b}(dat.controllers.NumberController,dat.dom.dom,dat.utils.css,dat.utils.common,".slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}"); -dat.controllers.FunctionController=function(e,a,c){var d=function(c,b,e){d.superclass.call(this,c,b);var h=this;this.__button=document.createElement("div");this.__button.innerHTML=e===void 0?"Fire":e;a.bind(this.__button,"click",function(a){a.preventDefault();h.fire();return false});a.addClass(this.__button,"button");this.domElement.appendChild(this.__button)};d.superclass=e;c.extend(d.prototype,e.prototype,{fire:function(){this.__onChange&&this.__onChange.call(this);this.__onFinishChange&&this.__onFinishChange.call(this, -this.getValue());this.getValue().call(this.object)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common); -dat.controllers.BooleanController=function(e,a,c){var d=function(c,b){d.superclass.call(this,c,b);var e=this;this.__prev=this.getValue();this.__checkbox=document.createElement("input");this.__checkbox.setAttribute("type","checkbox");a.bind(this.__checkbox,"change",function(){e.setValue(!e.__prev)},false);this.domElement.appendChild(this.__checkbox);this.updateDisplay()};d.superclass=e;c.extend(d.prototype,e.prototype,{setValue:function(a){a=d.superclass.prototype.setValue.call(this,a);this.__onFinishChange&& -this.__onFinishChange.call(this,this.getValue());this.__prev=this.getValue();return a},updateDisplay:function(){this.getValue()===true?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=true):this.__checkbox.checked=false;return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common); -dat.color.toString=function(e){return function(a){if(a.a==1||e.isUndefined(a.a)){for(a=a.hex.toString(16);a.length<6;)a="0"+a;return"#"+a}else return"rgba("+Math.round(a.r)+","+Math.round(a.g)+","+Math.round(a.b)+","+a.a+")"}}(dat.utils.common); -dat.color.interpret=function(e,a){var c,d,f=[{litmus:a.isString,conversions:{THREE_CHAR_HEX:{read:function(a){a=a.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return a===null?false:{space:"HEX",hex:parseInt("0x"+a[1].toString()+a[1].toString()+a[2].toString()+a[2].toString()+a[3].toString()+a[3].toString())}},write:e},SIX_CHAR_HEX:{read:function(a){a=a.match(/^#([A-F0-9]{6})$/i);return a===null?false:{space:"HEX",hex:parseInt("0x"+a[1].toString())}},write:e},CSS_RGB:{read:function(a){a=a.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/); -return a===null?false:{space:"RGB",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3])}},write:e},CSS_RGBA:{read:function(a){a=a.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);return a===null?false:{space:"RGB",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3]),a:parseFloat(a[4])}},write:e}}},{litmus:a.isNumber,conversions:{HEX:{read:function(a){return{space:"HEX",hex:a,conversionName:"HEX"}},write:function(a){return a.hex}}}},{litmus:a.isArray,conversions:{RGB_ARRAY:{read:function(a){return a.length!= -3?false:{space:"RGB",r:a[0],g:a[1],b:a[2]}},write:function(a){return[a.r,a.g,a.b]}},RGBA_ARRAY:{read:function(a){return a.length!=4?false:{space:"RGB",r:a[0],g:a[1],b:a[2],a:a[3]}},write:function(a){return[a.r,a.g,a.b,a.a]}}}},{litmus:a.isObject,conversions:{RGBA_OBJ:{read:function(b){return a.isNumber(b.r)&&a.isNumber(b.g)&&a.isNumber(b.b)&&a.isNumber(b.a)?{space:"RGB",r:b.r,g:b.g,b:b.b,a:b.a}:false},write:function(a){return{r:a.r,g:a.g,b:a.b,a:a.a}}},RGB_OBJ:{read:function(b){return a.isNumber(b.r)&& -a.isNumber(b.g)&&a.isNumber(b.b)?{space:"RGB",r:b.r,g:b.g,b:b.b}:false},write:function(a){return{r:a.r,g:a.g,b:a.b}}},HSVA_OBJ:{read:function(b){return a.isNumber(b.h)&&a.isNumber(b.s)&&a.isNumber(b.v)&&a.isNumber(b.a)?{space:"HSV",h:b.h,s:b.s,v:b.v,a:b.a}:false},write:function(a){return{h:a.h,s:a.s,v:a.v,a:a.a}}},HSV_OBJ:{read:function(b){return a.isNumber(b.h)&&a.isNumber(b.s)&&a.isNumber(b.v)?{space:"HSV",h:b.h,s:b.s,v:b.v}:false},write:function(a){return{h:a.h,s:a.s,v:a.v}}}}}];return function(){d= -false;var b=arguments.length>1?a.toArray(arguments):arguments[0];a.each(f,function(e){if(e.litmus(b))return a.each(e.conversions,function(e,f){c=e.read(b);if(d===false&&c!==false)return d=c,c.conversionName=f,c.conversion=e,a.BREAK}),a.BREAK});return d}}(dat.color.toString,dat.utils.common); -dat.GUI=dat.gui.GUI=function(e,a,c,d,f,b,n,h,j,m,l,o,y,g,i){function q(a,b,r,c){if(b[r]===void 0)throw Error("Object "+b+' has no property "'+r+'"');c.color?b=new l(b,r):(b=[b,r].concat(c.factoryArgs),b=d.apply(a,b));if(c.before instanceof f)c.before=c.before.__li;t(a,b);g.addClass(b.domElement,"c");r=document.createElement("span");g.addClass(r,"property-name");r.innerHTML=b.property;var e=document.createElement("div");e.appendChild(r);e.appendChild(b.domElement);c=s(a,e,c.before);g.addClass(c,k.CLASS_CONTROLLER_ROW); -g.addClass(c,typeof b.getValue());p(a,c,b);a.__controllers.push(b);return b}function s(a,b,d){var c=document.createElement("li");b&&c.appendChild(b);d?a.__ul.insertBefore(c,params.before):a.__ul.appendChild(c);a.onResize();return c}function p(a,d,c){c.__li=d;c.__gui=a;i.extend(c,{options:function(b){if(arguments.length>1)return c.remove(),q(a,c.object,c.property,{before:c.__li.nextElementSibling,factoryArgs:[i.toArray(arguments)]});if(i.isArray(b)||i.isObject(b))return c.remove(),q(a,c.object,c.property, -{before:c.__li.nextElementSibling,factoryArgs:[b]})},name:function(a){c.__li.firstElementChild.firstElementChild.innerHTML=a;return c},listen:function(){c.__gui.listen(c);return c},remove:function(){c.__gui.remove(c);return c}});if(c instanceof j){var e=new h(c.object,c.property,{min:c.__min,max:c.__max,step:c.__step});i.each(["updateDisplay","onChange","onFinishChange"],function(a){var b=c[a],H=e[a];c[a]=e[a]=function(){var a=Array.prototype.slice.call(arguments);b.apply(c,a);return H.apply(e,a)}}); -g.addClass(d,"has-slider");c.domElement.insertBefore(e.domElement,c.domElement.firstElementChild)}else if(c instanceof h){var f=function(b){return i.isNumber(c.__min)&&i.isNumber(c.__max)?(c.remove(),q(a,c.object,c.property,{before:c.__li.nextElementSibling,factoryArgs:[c.__min,c.__max,c.__step]})):b};c.min=i.compose(f,c.min);c.max=i.compose(f,c.max)}else if(c instanceof b)g.bind(d,"click",function(){g.fakeEvent(c.__checkbox,"click")}),g.bind(c.__checkbox,"click",function(a){a.stopPropagation()}); -else if(c instanceof n)g.bind(d,"click",function(){g.fakeEvent(c.__button,"click")}),g.bind(d,"mouseover",function(){g.addClass(c.__button,"hover")}),g.bind(d,"mouseout",function(){g.removeClass(c.__button,"hover")});else if(c instanceof l)g.addClass(d,"color"),c.updateDisplay=i.compose(function(a){d.style.borderLeftColor=c.__color.toString();return a},c.updateDisplay),c.updateDisplay();c.setValue=i.compose(function(b){a.getRoot().__preset_select&&c.isModified()&&B(a.getRoot(),true);return b},c.setValue)} -function t(a,b){var c=a.getRoot(),d=c.__rememberedObjects.indexOf(b.object);if(d!=-1){var e=c.__rememberedObjectIndecesToControllers[d];e===void 0&&(e={},c.__rememberedObjectIndecesToControllers[d]=e);e[b.property]=b;if(c.load&&c.load.remembered){c=c.load.remembered;if(c[a.preset])c=c[a.preset];else if(c[w])c=c[w];else return;if(c[d]&&c[d][b.property]!==void 0)d=c[d][b.property],b.initialValue=d,b.setValue(d)}}}function I(a){var b=a.__save_row=document.createElement("li");g.addClass(a.domElement, -"has-save");a.__ul.insertBefore(b,a.__ul.firstChild);g.addClass(b,"save-row");var c=document.createElement("span");c.innerHTML=" ";g.addClass(c,"button gears");var d=document.createElement("span");d.innerHTML="Save";g.addClass(d,"button");g.addClass(d,"save");var e=document.createElement("span");e.innerHTML="New";g.addClass(e,"button");g.addClass(e,"save-as");var f=document.createElement("span");f.innerHTML="Revert";g.addClass(f,"button");g.addClass(f,"revert");var m=a.__preset_select=document.createElement("select"); -a.load&&a.load.remembered?i.each(a.load.remembered,function(b,c){C(a,c,c==a.preset)}):C(a,w,false);g.bind(m,"change",function(){for(var b=0;b0){a.preset=this.preset;if(!a.remembered)a.remembered={};a.remembered[this.preset]=z(this)}a.folders={};i.each(this.__folders,function(b, -c){a.folders[c]=b.getSaveObject()});return a},save:function(){if(!this.load.remembered)this.load.remembered={};this.load.remembered[this.preset]=z(this);B(this,false)},saveAs:function(a){if(!this.load.remembered)this.load.remembered={},this.load.remembered[w]=z(this,true);this.load.remembered[a]=z(this);this.preset=a;C(this,a,true)},revert:function(a){i.each(this.__controllers,function(b){this.getRoot().load.remembered?t(a||this.getRoot(),b):b.setValue(b.initialValue)},this);i.each(this.__folders, -function(a){a.revert(a)});a||B(this.getRoot(),false)},listen:function(a){var b=this.__listening.length==0;this.__listening.push(a);b&&E(this.__listening)}});return k}(dat.utils.css,'
    \n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n
    \n\n Automatically save\n values to localStorage on exit.\n\n
    The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n \n
    \n \n
    \n\n
    ', -".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear;border:0;position:absolute;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-x:hidden}.dg.a.has-save ul{margin-top:27px}.dg.a.has-save ul.closed{margin-top:0}.dg.a .save-row{position:fixed;top:0;z-index:1002}.dg li{-webkit-transition:height 0.1s ease-out;-o-transition:height 0.1s ease-out;-moz-transition:height 0.1s ease-out;transition:height 0.1s ease-out}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;overflow:hidden;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li > *{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:9px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n", -dat.controllers.factory=function(e,a,c,d,f,b,n){return function(h,j,m,l){var o=h[j];if(n.isArray(m)||n.isObject(m))return new e(h,j,m);if(n.isNumber(o))return n.isNumber(m)&&n.isNumber(l)?new c(h,j,m,l):new a(h,j,{min:m,max:l});if(n.isString(o))return new d(h,j);if(n.isFunction(o))return new f(h,j,"");if(n.isBoolean(o))return new b(h,j)}}(dat.controllers.OptionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.StringController=function(e,a,c){var d= -function(c,b){function e(){h.setValue(h.__input.value)}d.superclass.call(this,c,b);var h=this;this.__input=document.createElement("input");this.__input.setAttribute("type","text");a.bind(this.__input,"keyup",e);a.bind(this.__input,"change",e);a.bind(this.__input,"blur",function(){h.__onFinishChange&&h.__onFinishChange.call(h,h.getValue())});a.bind(this.__input,"keydown",function(a){a.keyCode===13&&this.blur()});this.updateDisplay();this.domElement.appendChild(this.__input)};d.superclass=e;c.extend(d.prototype, -e.prototype,{updateDisplay:function(){if(!a.isActive(this.__input))this.__input.value=this.getValue();return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common),dat.controllers.FunctionController,dat.controllers.BooleanController,dat.utils.common),dat.controllers.Controller,dat.controllers.BooleanController,dat.controllers.FunctionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.OptionController, -dat.controllers.ColorController=function(e,a,c,d,f){function b(a,b,c,d){a.style.background="";f.each(j,function(e){a.style.cssText+="background: "+e+"linear-gradient("+b+", "+c+" 0%, "+d+" 100%); "})}function n(a){a.style.background="";a.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);";a.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"; -a.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);";a.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);";a.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}var h=function(e,l){function o(b){q(b);a.bind(window,"mousemove",q);a.bind(window, -"mouseup",j)}function j(){a.unbind(window,"mousemove",q);a.unbind(window,"mouseup",j)}function g(){var a=d(this.value);a!==false?(p.__color.__state=a,p.setValue(p.__color.toOriginal())):this.value=p.__color.toString()}function i(){a.unbind(window,"mousemove",s);a.unbind(window,"mouseup",i)}function q(b){b.preventDefault();var c=a.getWidth(p.__saturation_field),d=a.getOffset(p.__saturation_field),e=(b.clientX-d.left+document.body.scrollLeft)/c,b=1-(b.clientY-d.top+document.body.scrollTop)/c;b>1?b= -1:b<0&&(b=0);e>1?e=1:e<0&&(e=0);p.__color.v=b;p.__color.s=e;p.setValue(p.__color.toOriginal());return false}function s(b){b.preventDefault();var c=a.getHeight(p.__hue_field),d=a.getOffset(p.__hue_field),b=1-(b.clientY-d.top+document.body.scrollTop)/c;b>1?b=1:b<0&&(b=0);p.__color.h=b*360;p.setValue(p.__color.toOriginal());return false}h.superclass.call(this,e,l);this.__color=new c(this.getValue());this.__temp=new c(0);var p=this;this.domElement=document.createElement("div");a.makeSelectable(this.domElement, -false);this.__selector=document.createElement("div");this.__selector.className="selector";this.__saturation_field=document.createElement("div");this.__saturation_field.className="saturation-field";this.__field_knob=document.createElement("div");this.__field_knob.className="field-knob";this.__field_knob_border="2px solid ";this.__hue_knob=document.createElement("div");this.__hue_knob.className="hue-knob";this.__hue_field=document.createElement("div");this.__hue_field.className="hue-field";this.__input= -document.createElement("input");this.__input.type="text";this.__input_textShadow="0 1px 1px ";a.bind(this.__input,"keydown",function(a){a.keyCode===13&&g.call(this)});a.bind(this.__input,"blur",g);a.bind(this.__selector,"mousedown",function(){a.addClass(this,"drag").bind(window,"mouseup",function(){a.removeClass(p.__selector,"drag")})});var t=document.createElement("div");f.extend(this.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}); -f.extend(this.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:this.__field_knob_border+(this.__color.v<0.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1});f.extend(this.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1});f.extend(this.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"});f.extend(t.style, -{width:"100%",height:"100%",background:"none"});b(t,"top","rgba(0,0,0,0)","#000");f.extend(this.__hue_field.style,{width:"15px",height:"100px",display:"inline-block",border:"1px solid #555",cursor:"ns-resize"});n(this.__hue_field);f.extend(this.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:this.__input_textShadow+"rgba(0,0,0,0.7)"});a.bind(this.__saturation_field,"mousedown",o);a.bind(this.__field_knob,"mousedown",o);a.bind(this.__hue_field,"mousedown", -function(b){s(b);a.bind(window,"mousemove",s);a.bind(window,"mouseup",i)});this.__saturation_field.appendChild(t);this.__selector.appendChild(this.__field_knob);this.__selector.appendChild(this.__saturation_field);this.__selector.appendChild(this.__hue_field);this.__hue_field.appendChild(this.__hue_knob);this.domElement.appendChild(this.__input);this.domElement.appendChild(this.__selector);this.updateDisplay()};h.superclass=e;f.extend(h.prototype,e.prototype,{updateDisplay:function(){var a=d(this.getValue()); -if(a!==false){var e=false;f.each(c.COMPONENTS,function(b){if(!f.isUndefined(a[b])&&!f.isUndefined(this.__color.__state[b])&&a[b]!==this.__color.__state[b])return e=true,{}},this);e&&f.extend(this.__color.__state,a)}f.extend(this.__temp.__state,this.__color.__state);this.__temp.a=1;var h=this.__color.v<0.5||this.__color.s>0.5?255:0,j=255-h;f.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toString(),border:this.__field_knob_border+ -"rgb("+h+","+h+","+h+")"});this.__hue_knob.style.marginTop=(1-this.__color.h/360)*100+"px";this.__temp.s=1;this.__temp.v=1;b(this.__saturation_field,"left","#fff",this.__temp.toString());f.extend(this.__input.style,{backgroundColor:this.__input.value=this.__color.toString(),color:"rgb("+h+","+h+","+h+")",textShadow:this.__input_textShadow+"rgba("+j+","+j+","+j+",.7)"})}});var j=["-moz-","-o-","-webkit-","-ms-",""];return h}(dat.controllers.Controller,dat.dom.dom,dat.color.Color=function(e,a,c,d){function f(a, -b,c){Object.defineProperty(a,b,{get:function(){if(this.__state.space==="RGB")return this.__state[b];n(this,b,c);return this.__state[b]},set:function(a){if(this.__state.space!=="RGB")n(this,b,c),this.__state.space="RGB";this.__state[b]=a}})}function b(a,b){Object.defineProperty(a,b,{get:function(){if(this.__state.space==="HSV")return this.__state[b];h(this);return this.__state[b]},set:function(a){if(this.__state.space!=="HSV")h(this),this.__state.space="HSV";this.__state[b]=a}})}function n(b,c,e){if(b.__state.space=== -"HEX")b.__state[c]=a.component_from_hex(b.__state.hex,e);else if(b.__state.space==="HSV")d.extend(b.__state,a.hsv_to_rgb(b.__state.h,b.__state.s,b.__state.v));else throw"Corrupted color state";}function h(b){var c=a.rgb_to_hsv(b.r,b.g,b.b);d.extend(b.__state,{s:c.s,v:c.v});if(d.isNaN(c.h)){if(d.isUndefined(b.__state.h))b.__state.h=0}else b.__state.h=c.h}var j=function(){this.__state=e.apply(this,arguments);if(this.__state===false)throw"Failed to interpret color arguments";this.__state.a=this.__state.a|| -1};j.COMPONENTS="r,g,b,h,s,v,hex,a".split(",");d.extend(j.prototype,{toString:function(){return c(this)},toOriginal:function(){return this.__state.conversion.write(this)}});f(j.prototype,"r",2);f(j.prototype,"g",1);f(j.prototype,"b",0);b(j.prototype,"h");b(j.prototype,"s");b(j.prototype,"v");Object.defineProperty(j.prototype,"a",{get:function(){return this.__state.a},set:function(a){this.__state.a=a}});Object.defineProperty(j.prototype,"hex",{get:function(){if(!this.__state.space!=="HEX")this.__state.hex= -a.rgb_to_hex(this.r,this.g,this.b);return this.__state.hex},set:function(a){this.__state.space="HEX";this.__state.hex=a}});return j}(dat.color.interpret,dat.color.math=function(){var e;return{hsv_to_rgb:function(a,c,d){var e=a/60-Math.floor(a/60),b=d*(1-c),n=d*(1-e*c),c=d*(1-(1-e)*c),a=[[d,c,b],[n,d,b],[b,d,c],[b,n,d],[c,b,d],[d,b,n]][Math.floor(a/60)%6];return{r:a[0]*255,g:a[1]*255,b:a[2]*255}},rgb_to_hsv:function(a,c,d){var e=Math.min(a,c,d),b=Math.max(a,c,d),e=b-e;if(b==0)return{h:NaN,s:0,v:0}; -a=a==b?(c-d)/e:c==b?2+(d-a)/e:4+(a-c)/e;a/=6;a<0&&(a+=1);return{h:a*360,s:e/b,v:b/255}},rgb_to_hex:function(a,c,d){a=this.hex_with_component(0,2,a);a=this.hex_with_component(a,1,c);return a=this.hex_with_component(a,0,d)},component_from_hex:function(a,c){return a>>c*8&255},hex_with_component:function(a,c,d){return d<<(e=c*8)|a&~(255< - - - pixi.js example 15 - Filters - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 15 - Filters/indexAll.html b/tutorial-4/pixi.js-master/examples/example 15 - Filters/indexAll.html deleted file mode 100755 index 4e83cb8..0000000 --- a/tutorial-4/pixi.js-master/examples/example 15 - Filters/indexAll.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - pixi.js example 15 - Filters - - - - - - - - - -
    - - - - - -
    - - - diff --git a/tutorial-4/pixi.js-master/examples/example 15 - Filters/indexBlur.html b/tutorial-4/pixi.js-master/examples/example 15 - Filters/indexBlur.html deleted file mode 100755 index dc899dc..0000000 --- a/tutorial-4/pixi.js-master/examples/example 15 - Filters/indexBlur.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - pixi.js example 15 - Filters - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 15 - Filters/indexDisplacement.html b/tutorial-4/pixi.js-master/examples/example 15 - Filters/indexDisplacement.html deleted file mode 100755 index 23f7f96..0000000 --- a/tutorial-4/pixi.js-master/examples/example 15 - Filters/indexDisplacement.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - pixi.js example 15 - Filters - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 15 - Filters/indexDisplacement_2.html b/tutorial-4/pixi.js-master/examples/example 15 - Filters/indexDisplacement_2.html deleted file mode 100755 index 8cda5d9..0000000 --- a/tutorial-4/pixi.js-master/examples/example 15 - Filters/indexDisplacement_2.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - pixi.js example 15 - Filters - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 15 - Filters/panda.png b/tutorial-4/pixi.js-master/examples/example 15 - Filters/panda.png deleted file mode 100755 index 215a4a9..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 15 - Filters/panda.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 15 - Filters/zeldaWaves.png b/tutorial-4/pixi.js-master/examples/example 15 - Filters/zeldaWaves.png deleted file mode 100755 index 01552c0..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 15 - Filters/zeldaWaves.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 16 - BlendModes/BGrotate.jpg b/tutorial-4/pixi.js-master/examples/example 16 - BlendModes/BGrotate.jpg deleted file mode 100755 index eab4d57..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 16 - BlendModes/BGrotate.jpg and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 16 - BlendModes/flowerTop.png b/tutorial-4/pixi.js-master/examples/example 16 - BlendModes/flowerTop.png deleted file mode 100755 index 041cf2a..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 16 - BlendModes/flowerTop.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 16 - BlendModes/index.html b/tutorial-4/pixi.js-master/examples/example 16 - BlendModes/index.html deleted file mode 100755 index 5bb21a8..0000000 --- a/tutorial-4/pixi.js-master/examples/example 16 - BlendModes/index.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - Pixi.js Blend Modes - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 17 - Tinting/BGrotate.jpg b/tutorial-4/pixi.js-master/examples/example 17 - Tinting/BGrotate.jpg deleted file mode 100755 index eab4d57..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 17 - Tinting/BGrotate.jpg and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 17 - Tinting/eggHead.png b/tutorial-4/pixi.js-master/examples/example 17 - Tinting/eggHead.png deleted file mode 100755 index f8bff53..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 17 - Tinting/eggHead.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 17 - Tinting/index.html b/tutorial-4/pixi.js-master/examples/example 17 - Tinting/index.html deleted file mode 100755 index f051fd1..0000000 --- a/tutorial-4/pixi.js-master/examples/example 17 - Tinting/index.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - Tinting - - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 18 - Batch/click.png b/tutorial-4/pixi.js-master/examples/example 18 - Batch/click.png deleted file mode 100755 index b796e52..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 18 - Batch/click.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 18 - Batch/index.html b/tutorial-4/pixi.js-master/examples/example 18 - Batch/index.html deleted file mode 100755 index ce7c542..0000000 --- a/tutorial-4/pixi.js-master/examples/example 18 - Batch/index.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - Sprite Batch - - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 18 - Batch/logo_small.png b/tutorial-4/pixi.js-master/examples/example 18 - Batch/logo_small.png deleted file mode 100755 index 3a63544..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 18 - Batch/logo_small.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 18 - Batch/tinyMaggot.png b/tutorial-4/pixi.js-master/examples/example 18 - Batch/tinyMaggot.png deleted file mode 100755 index c0b1c00..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 18 - Batch/tinyMaggot.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.json b/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.json deleted file mode 100755 index 7dddba8..0000000 --- a/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.json +++ /dev/null @@ -1,44 +0,0 @@ -{"frames": { - -"eggHead.png": -{ - "frame": {"x":2,"y":169,"w":142,"h":157}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":142,"h":157}, - "sourceSize": {"w":142,"h":157} -}, -"flowerTop.png": -{ - "frame": {"x":2,"y":328,"w":119,"h":181}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":119,"h":181}, - "sourceSize": {"w":119,"h":181} -}, -"helmlok.png": -{ - "frame": {"x":123,"y":328,"w":123,"h":177}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":123,"h":177}, - "sourceSize": {"w":123,"h":177} -}, -"skully.png": -{ - "frame": {"x":2,"y":2,"w":155,"h":165}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":155,"h":165}, - "sourceSize": {"w":155,"h":165} -}}, -"meta": { - "app": "http://www.texturepacker.com", - "version": "1.0", - "image": "SpriteSheet.png", - "format": "RGBA8888", - "size": {"w":256,"h":512}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:9e3e5afd01ea8e418afabfbdcd724485$" -} -} diff --git a/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.png b/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.png deleted file mode 100755 index 210acb1..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/SpriteSheet.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/index.html b/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/index.html deleted file mode 100755 index ca82cdc..0000000 --- a/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/index.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - pixi.js example 2 loading a sprite sheet - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/SpriteSheet.tps b/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/SpriteSheet.tps deleted file mode 100755 index c81ef28..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/SpriteSheet.tps and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/eggHead.png b/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/eggHead.png deleted file mode 100755 index f8bff53..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/eggHead.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/flowerTop.png b/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/flowerTop.png deleted file mode 100755 index 041cf2a..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/flowerTop.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/helmlok.png b/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/helmlok.png deleted file mode 100755 index c6b96c0..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/helmlok.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/skully.png b/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/skully.png deleted file mode 100755 index c21b40d..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 19 - CacheAsBitmap/tp/skully.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.json b/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.json deleted file mode 100755 index 7dddba8..0000000 --- a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.json +++ /dev/null @@ -1,44 +0,0 @@ -{"frames": { - -"eggHead.png": -{ - "frame": {"x":2,"y":169,"w":142,"h":157}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":142,"h":157}, - "sourceSize": {"w":142,"h":157} -}, -"flowerTop.png": -{ - "frame": {"x":2,"y":328,"w":119,"h":181}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":119,"h":181}, - "sourceSize": {"w":119,"h":181} -}, -"helmlok.png": -{ - "frame": {"x":123,"y":328,"w":123,"h":177}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":123,"h":177}, - "sourceSize": {"w":123,"h":177} -}, -"skully.png": -{ - "frame": {"x":2,"y":2,"w":155,"h":165}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":155,"h":165}, - "sourceSize": {"w":155,"h":165} -}}, -"meta": { - "app": "http://www.texturepacker.com", - "version": "1.0", - "image": "SpriteSheet.png", - "format": "RGBA8888", - "size": {"w":256,"h":512}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:9e3e5afd01ea8e418afabfbdcd724485$" -} -} diff --git a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.png b/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.png deleted file mode 100755 index 210acb1..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/SpriteSheet.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/fighter.json b/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/fighter.json deleted file mode 100755 index e20b4a6..0000000 --- a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/fighter.json +++ /dev/null @@ -1,252 +0,0 @@ -{"frames": { - -"rollSequence0000.png": -{ - "frame": {"x":483,"y":692,"w":169,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":4,"w":169,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0001.png": -{ - "frame": {"x":468,"y":2,"w":169,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":4,"w":169,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0002.png": -{ - "frame": {"x":639,"y":2,"w":167,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":5,"w":167,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0003.png": -{ - "frame": {"x":808,"y":2,"w":165,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":5,"w":165,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0004.png": -{ - "frame": {"x":654,"y":688,"w":161,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":5,"w":161,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0005.png": -{ - "frame": {"x":817,"y":458,"w":151,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":6,"y":5,"w":151,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0006.png": -{ - "frame": {"x":817,"y":686,"w":137,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":11,"y":5,"w":137,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0007.png": -{ - "frame": {"x":290,"y":2,"w":113,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":22,"y":3,"w":113,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0008.png": -{ - "frame": {"x":284,"y":692,"w":79,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":40,"y":3,"w":79,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0009.png": -{ - "frame": {"x":405,"y":2,"w":61,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":53,"y":3,"w":61,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0010.png": -{ - "frame": {"x":444,"y":462,"w":49,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":64,"y":3,"w":49,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0011.png": -{ - "frame": {"x":377,"y":462,"w":65,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":52,"y":3,"w":65,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0012.png": -{ - "frame": {"x":272,"y":462,"w":103,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":37,"y":3,"w":103,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0013.png": -{ - "frame": {"x":143,"y":692,"w":139,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":3,"w":139,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0014.png": -{ - "frame": {"x":2,"y":462,"w":163,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":7,"y":3,"w":163,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0015.png": -{ - "frame": {"x":2,"y":2,"w":171,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":2,"y":3,"w":171,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0016.png": -{ - "frame": {"x":2,"y":232,"w":163,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":4,"y":3,"w":163,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0017.png": -{ - "frame": {"x":2,"y":692,"w":139,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":16,"y":3,"w":139,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0018.png": -{ - "frame": {"x":167,"y":462,"w":103,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":35,"y":3,"w":103,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0019.png": -{ - "frame": {"x":365,"y":692,"w":65,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":58,"y":3,"w":65,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0020.png": -{ - "frame": {"x":432,"y":692,"w":49,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":62,"y":3,"w":49,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0021.png": -{ - "frame": {"x":389,"y":232,"w":61,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":61,"y":3,"w":61,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0022.png": -{ - "frame": {"x":306,"y":232,"w":81,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":55,"y":3,"w":81,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0023.png": -{ - "frame": {"x":175,"y":2,"w":113,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":39,"y":3,"w":113,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0024.png": -{ - "frame": {"x":167,"y":232,"w":137,"h":228}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":26,"y":3,"w":137,"h":228}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0025.png": -{ - "frame": {"x":664,"y":458,"w":151,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":5,"w":151,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0026.png": -{ - "frame": {"x":792,"y":230,"w":161,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":11,"y":5,"w":161,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0027.png": -{ - "frame": {"x":623,"y":230,"w":167,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":6,"y":5,"w":167,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0028.png": -{ - "frame": {"x":495,"y":460,"w":167,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":5,"y":5,"w":167,"h":226}, - "sourceSize": {"w":175,"h":240} -}, -"rollSequence0029.png": -{ - "frame": {"x":452,"y":232,"w":169,"h":226}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":3,"y":4,"w":169,"h":226}, - "sourceSize": {"w":175,"h":240} -}}, -"meta": { - "app": "http://www.texturepacker.com", - "version": "1.0", - "image": "fighter.png", - "format": "RGBA8888", - "size": {"w":1024,"h":1024}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:2f213a6b451f9f5719773418dfe80ae8$" -} -} diff --git a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/fighter.png b/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/fighter.png deleted file mode 100755 index 5395f7b..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/fighter.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/index.html b/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/index.html deleted file mode 100755 index ecd4b55..0000000 --- a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/index.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - pixi.js example 2 loading a sprite sheet - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/indexTrim.html b/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/indexTrim.html deleted file mode 100755 index 4682c4e..0000000 --- a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/indexTrim.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - pixi.js example 2 loading a sprite sheet - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/tp/SpriteSheet.tps b/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/tp/SpriteSheet.tps deleted file mode 100755 index c81ef28..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/tp/SpriteSheet.tps and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/tp/eggHead.png b/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/tp/eggHead.png deleted file mode 100755 index f8bff53..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/tp/eggHead.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/tp/flowerTop.png b/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/tp/flowerTop.png deleted file mode 100755 index 041cf2a..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/tp/flowerTop.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/tp/helmlok.png b/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/tp/helmlok.png deleted file mode 100755 index c6b96c0..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/tp/helmlok.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/tp/skully.png b/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/tp/skully.png deleted file mode 100755 index c21b40d..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 2 - SpriteSheet/tp/skully.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 20 - Strip/index.html b/tutorial-4/pixi.js-master/examples/example 20 - Strip/index.html deleted file mode 100755 index 95cd621..0000000 --- a/tutorial-4/pixi.js-master/examples/example 20 - Strip/index.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - pixi.js example 20 - strip - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 20 - Strip/snake.png b/tutorial-4/pixi.js-master/examples/example 20 - Strip/snake.png deleted file mode 100755 index 0cb81d4..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 20 - Strip/snake.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 21 - Complex Graphics/index.html b/tutorial-4/pixi.js-master/examples/example 21 - Complex Graphics/index.html deleted file mode 100755 index 2424e38..0000000 --- a/tutorial-4/pixi.js-master/examples/example 21 - Complex Graphics/index.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - pixi.js example 21 Complex Graphics - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 22 - Complex Masking/eggHead.png b/tutorial-4/pixi.js-master/examples/example 22 - Complex Masking/eggHead.png deleted file mode 100755 index f8bff53..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 22 - Complex Masking/eggHead.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 22 - Complex Masking/flowerTop.png b/tutorial-4/pixi.js-master/examples/example 22 - Complex Masking/flowerTop.png deleted file mode 100755 index 041cf2a..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 22 - Complex Masking/flowerTop.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 22 - Complex Masking/helmlok.png b/tutorial-4/pixi.js-master/examples/example 22 - Complex Masking/helmlok.png deleted file mode 100755 index c6b96c0..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 22 - Complex Masking/helmlok.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 22 - Complex Masking/index.html b/tutorial-4/pixi.js-master/examples/example 22 - Complex Masking/index.html deleted file mode 100755 index db7d0a5..0000000 --- a/tutorial-4/pixi.js-master/examples/example 22 - Complex Masking/index.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - pixi.js example 22 complex masking - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 22 - Complex Masking/skully.png b/tutorial-4/pixi.js-master/examples/example 22 - Complex Masking/skully.png deleted file mode 100755 index c21b40d..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 22 - Complex Masking/skully.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 23 - Texture Swap/eggHead.png b/tutorial-4/pixi.js-master/examples/example 23 - Texture Swap/eggHead.png deleted file mode 100755 index f8bff53..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 23 - Texture Swap/eggHead.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 23 - Texture Swap/flowerTop.png b/tutorial-4/pixi.js-master/examples/example 23 - Texture Swap/flowerTop.png deleted file mode 100755 index 041cf2a..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 23 - Texture Swap/flowerTop.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 23 - Texture Swap/index.html b/tutorial-4/pixi.js-master/examples/example 23 - Texture Swap/index.html deleted file mode 100755 index 21feded..0000000 --- a/tutorial-4/pixi.js-master/examples/example 23 - Texture Swap/index.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - pixi.js example 23 - Texture Swap - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 24 - Box2D Integration/box2d.min.js b/tutorial-4/pixi.js-master/examples/example 24 - Box2D Integration/box2d.min.js deleted file mode 100755 index 1b579fd..0000000 --- a/tutorial-4/pixi.js-master/examples/example 24 - Box2D Integration/box2d.min.js +++ /dev/null @@ -1,112 +0,0 @@ -var b2Settings=function(){};b2Settings.prototype={};b2Settings.USHRT_MAX=65535;b2Settings.b2_pi=Math.PI;b2Settings.b2_massUnitsPerKilogram=1;b2Settings.b2_timeUnitsPerSecond=1;b2Settings.b2_lengthUnitsPerMeter=30;b2Settings.b2_maxManifoldPoints=2;b2Settings.b2_maxShapesPerBody=64;b2Settings.b2_maxPolyVertices=8;b2Settings.b2_maxProxies=1024;b2Settings.b2_maxPairs=8*b2Settings.b2_maxProxies;b2Settings.b2_linearSlop=0.005*b2Settings.b2_lengthUnitsPerMeter;b2Settings.b2_angularSlop=2/180*b2Settings.b2_pi;b2Settings.b2_velocityThreshold=1*b2Settings.b2_lengthUnitsPerMeter/b2Settings.b2_timeUnitsPerSecond;b2Settings.b2_maxLinearCorrection=0.2*b2Settings.b2_lengthUnitsPerMeter;b2Settings.b2_maxAngularCorrection=8/180*b2Settings.b2_pi;b2Settings.b2_contactBaumgarte=0.2;b2Settings.b2_timeToSleep=0.5*b2Settings.b2_timeUnitsPerSecond;b2Settings.b2_linearSleepTolerance=0.01*b2Settings.b2_lengthUnitsPerMeter/b2Settings.b2_timeUnitsPerSecond;b2Settings.b2_angularSleepTolerance=2/180/b2Settings.b2_timeUnitsPerSecond; -b2Settings.b2Assert=function(b){if(!b){var c;c.x++}};Object.extend=function(a,c){for(var b in c){a[b]=c[b]}return a};var b2Vec2=function(a,b){this.x=a;this.y=b};b2Vec2.prototype={SetZero:function(){this.x=0;this.y=0},Set:function(a,b){this.x=a;this.y=b},SetV:function(a){this.x=a.x;this.y=a.y},Negative:function(){return new b2Vec2(-this.x,-this.y)},Copy:function(){return new b2Vec2(this.x,this.y)},Add:function(a){this.x+=a.x;this.y+=a.y},Subtract:function(a){this.x-=a.x;this.y-=a.y},Multiply:function(b){this.x*=b;this.y*=b},MulM:function(b){var a=this.x;this.x=b.col1.x*a+b.col2.x*this.y;this.y=b.col1.y*a+b.col2.y*this.y},MulTM:function(b){var a=b2Math.b2Dot(this,b.col1);this.y=b2Math.b2Dot(this,b.col2);this.x=a},CrossVF:function(b){var a=this.x;this.x=b*this.y;this.y=-b*a},CrossFV:function(b){var a=this.x;this.x=-b*this.y;this.y=b*a},MinV:function(a){this.x=this.xa.x?this.x:a.x;this.y=this.y>a.y?this.y:a.y},Abs:function(){this.x=Math.abs(this.x);this.y=Math.abs(this.y)},Length:function(){return Math.sqrt(this.x*this.x+this.y*this.y) -},Normalize:function(){var b=this.Length();if(b0?b:-b};b2Math.b2AbsV=function(d){var c=new b2Vec2(b2Math.b2Abs(d.x),b2Math.b2Abs(d.y));return c};b2Math.b2AbsM=function(a){var b=new b2Mat22(0,b2Math.b2AbsV(a.col1),b2Math.b2AbsV(a.col2));return b};b2Math.b2Min=function(d,c){return dc?d:c};b2Math.b2MaxV=function(e,d){var f=new b2Vec2(b2Math.b2Max(e.x,d.x),b2Math.b2Max(e.y,d.y));return f};b2Math.b2Clamp=function(c,b,d){return b2Math.b2Max(b,b2Math.b2Min(c,d))};b2Math.b2ClampV=function(c,b,d){return b2Math.b2MaxV(b,b2Math.b2MinV(c,d))};b2Math.b2Swap=function(d,c){var e=d[0];d[0]=c[0];c[0]=e};b2Math.b2Random=function(){return Math.random()*2-1};b2Math.b2NextPowerOfTwo=function(a){a|=(a>>1)&2147483647;a|=(a>>2)&1073741823;a|=(a>>4)&268435455;a|=(a>>8)&16777215; -a|=(a>>16)&65535;return a+1};b2Math.b2IsPowerOfTwo=function(b){var a=b>0&&(b&(b-1))==0;return a};b2Math.tempVec2=new b2Vec2();b2Math.tempVec3=new b2Vec2();b2Math.tempVec4=new b2Vec2();b2Math.tempVec5=new b2Vec2();b2Math.tempMat=new b2Mat22();var b2AABB=function(){this.minVertex=new b2Vec2();this.maxVertex=new b2Vec2()};b2AABB.prototype={IsValid:function(){var b=this.maxVertex.x;var a=this.maxVertex.y;b=this.maxVertex.x;a=this.maxVertex.y;b-=this.minVertex.x;a-=this.minVertex.y;var c=b>=0&&a>=0;c=c&&this.minVertex.IsValid()&&this.maxVertex.IsValid();return c},minVertex:new b2Vec2(),maxVertex:new b2Vec2()};var b2Bound=function(){};b2Bound.prototype={IsLower:function(){return(this.value&1)==0},IsUpper:function(){return(this.value&1)==1},Swap:function(c){var e=this.value;var d=this.proxyId;var a=this.stabbingCount;this.value=c.value;this.proxyId=c.proxyId;this.stabbingCount=c.stabbingCount;c.value=e;c.proxyId=d;c.stabbingCount=a},value:0,proxyId:0,stabbingCount:0};var b2BoundValues=function(){this.lowerValues=[0,0];this.upperValues=[0,0]};b2BoundValues.prototype={lowerValues:[0,0],upperValues:[0,0]};var b2Pair=function(){};b2Pair.prototype={SetBuffered:function(){this.status|=b2Pair.e_pairBuffered},ClearBuffered:function(){this.status&=~b2Pair.e_pairBuffered},IsBuffered:function(){return(this.status&b2Pair.e_pairBuffered)==b2Pair.e_pairBuffered},SetRemoved:function(){this.status|=b2Pair.e_pairRemoved},ClearRemoved:function(){this.status&=~b2Pair.e_pairRemoved},IsRemoved:function(){return(this.status&b2Pair.e_pairRemoved)==b2Pair.e_pairRemoved},SetFinal:function(){this.status|=b2Pair.e_pairFinal},IsFinal:function(){return(this.status&b2Pair.e_pairFinal)==b2Pair.e_pairFinal},userData:null,proxyId1:0,proxyId2:0,next:0,status:0};b2Pair.b2_nullPair=b2Settings.USHRT_MAX;b2Pair.b2_nullProxy=b2Settings.USHRT_MAX;b2Pair.b2_tableCapacity=b2Settings.b2_maxPairs;b2Pair.b2_tableMask=b2Pair.b2_tableCapacity-1;b2Pair.e_pairBuffered=1;b2Pair.e_pairRemoved=2;b2Pair.e_pairFinal=4;var b2PairCallback=function(){};b2PairCallback.prototype={PairAdded:function(b,a){return null},PairRemoved:function(c,b,a){}};var b2BufferedPair=function(){};b2BufferedPair.prototype={proxyId1:0,proxyId2:0};var b2PairManager=function(){var a=0;this.m_hashTable=new Array(b2Pair.b2_tableCapacity);for(a=0;aa){var c=b;b=a;a=c}var d=b2PairManager.Hash(b,a)&b2Pair.b2_tableMask;var f=f=this.FindHash(b,a,d);if(f!=null){return f}var e=this.m_freePair;f=this.m_pairs[e];this.m_freePair=f.next;f.proxyId1=b;f.proxyId2=a;f.status=0;f.userData=null;f.next=this.m_hashTable[d];this.m_hashTable[d]=e;++this.m_pairCount;return f},RemovePair:function(g,f){if(g>f){var i=g;g=f;f=i}var d=b2PairManager.Hash(g,f)&b2Pair.b2_tableMask;var b=this.m_hashTable[d];var h=null;while(b!=b2Pair.b2_nullPair){if(b2PairManager.Equals(this.m_pairs[b],g,f)){var e=b;if(h){h.next=this.m_pairs[b].next}else{this.m_hashTable[d]=this.m_pairs[b].next}var c=this.m_pairs[e];var a=c.userData;c.next=this.m_freePair;c.proxyId1=b2Pair.b2_nullProxy;c.proxyId2=b2Pair.b2_nullProxy;c.userData=null;c.status=0;this.m_freePair=e;--this.m_pairCount;return a}else{h=this.m_pairs[b];b=h.next}}return null},Find:function(b,a){if(b>a){var c=b;b=a;a=c -}var d=b2PairManager.Hash(b,a)&b2Pair.b2_tableMask;return this.FindHash(b,a,d)},FindHash:function(b,a,d){var c=this.m_hashTable[d];while(c!=b2Pair.b2_nullPair&&b2PairManager.Equals(this.m_pairs[c],b,a)==false){c=this.m_pairs[c].next}if(c==b2Pair.b2_nullPair){return null}return this.m_pairs[c]},ValidateBuffer:function(){},ValidateTable:function(){},m_broadPhase:null,m_callback:null,m_pairs:null,m_freePair:0,m_pairCount:0,m_pairBuffer:null,m_pairBufferCount:0,m_hashTable:null};b2PairManager.Hash=function(b,a){var c=((a<<16)&4294901760)|b;c=~c+((c<<15)&4294934528);c=c^((c>>12)&1048575);c=c+((c<<2)&4294967292);c=c^((c>>4)&268435455);c=c*2057;c=c^((c>>16)&65535);return c};b2PairManager.Equals=function(c,b,a){return(c.proxyId1==b&&c.proxyId2==a)};b2PairManager.EqualsPair=function(b,a){return b.proxyId1==a.proxyId1&&b.proxyId2==a.proxyId2};var b2BroadPhase=function(f,g){this.m_pairManager=new b2PairManager();this.m_proxyPool=new Array(b2Settings.b2_maxPairs);this.m_bounds=new Array(2*b2Settings.b2_maxProxies);this.m_queryResults=new Array(b2Settings.b2_maxProxies);this.m_quantizationFactor=new b2Vec2();var d=0;this.m_pairManager.Initialize(this,g);this.m_worldAABB=f;this.m_proxyCount=0;for(d=0;d0&&t0){g=m;while(g0){g=k;while(g0&&bb[c.upperBounds[a]].value){return false}if(b[d.upperBounds[a]].valued[e.upperBounds[c]].value){return false}if(a.upperValues[c]0){var g=c-1;var n=a[g].stabbingCount;while(n){if(a[g].IsLower()){var k=this.m_proxyPool[a[g].proxyId];if(c<=k.upperBounds[b]){this.IncrementOverlapCount(a[g].proxyId);--n}}--g}}h[0]=c;d[0]=l},IncrementOverlapCount:function(b){var a=this.m_proxyPool[b];if(a.timeStampf){e=b-1}else{if(d[b].value0){f[c].id=b[0].id}else{f[c].id=b[1].id}++c}return c};b2Collision.EdgeSeparation=function(p,q,o){var f=p.m_vertices;var g=o.m_vertexCount;var r=o.m_vertices;var e=p.m_normals[q].x;var d=p.m_normals[q].y;var s=e;var l=p.m_R;e=l.col1.x*s+l.col2.x*d;d=l.col1.y*s+l.col2.y*d;var v=e;var u=d;l=o.m_R;s=v*l.col1.x+u*l.col1.y;u=v*l.col2.x+u*l.col2.y;v=s;var n=0;var m=Number.MAX_VALUE;for(var w=0;wa){a=o;h=p}}var n=b2Collision.EdgeSeparation(m,h,l);if(n>0&&w==false){return n}var g=h-1>=0?h-1:j-1;var t=b2Collision.EdgeSeparation(m,g,l);if(t>0&&w==false){return t}var q=h+10&&w==false){return u}var b=0;var k;var v=0;if(t>n&&t>u){v=-1;b=g;k=t}else{if(u>n){v=1;b=q;k=u}else{r[0]=h;return n}}while(true){if(v==-1){h=b-1>=0?b-1:j-1}else{h=b+10&&w==false){return n}if(n>k){b=h;k=n}else{break}}r[0]=b;return k};b2Collision.FindIncidentEdge=function(D,p,q,n){var h=p.m_vertexCount;var f=p.m_vertices;var g=n.m_vertexCount;var s=n.m_vertices;var a=q; -var F=q+1==h?0:q+1;var e=f[F];var C=e.x;var A=e.y;e=f[a];C-=e.x;A-=e.y;var v=C;C=A;A=-v;var E=1/Math.sqrt(C*C+A*A);C*=E;A*=E;var r=C;var o=A;v=r;var l=p.m_R;r=l.col1.x*v+l.col2.x*o;o=l.col1.y*v+l.col2.y*o;var d=r;var b=o;l=n.m_R;v=d*l.col1.x+b*l.col1.y;b=d*l.col2.x+b*l.col2.y;d=v;var k=0;var j=0;var m=Number.MAX_VALUE;for(var B=0;B0&&b==false){return -}var K=0;var g=[K];var E=b2Collision.FindMaxSeparation(g,j,k,b);K=g[0];if(E>0&&b==false){return}var p;var o;var a=0;var R=0;var d=0.98;var O=0.001;if(E>d*F+O){p=j;o=k;a=K;R=1}else{p=k;o=j;a=M;R=0}var c=[new ClipVertex(),new ClipVertex()];b2Collision.FindIncidentEdge(c,p,a,o);var B=p.m_vertexCount;var q=p.m_vertices;var I=q[a];var H=a+1l*l&&b==false){return}var d;if(mg){return}if(t>o){o=t;B=A}}if(og){return}x.pointCount=1;x.normal.Set(n.col1.x*e+n.col2.x*d,n.col1.y*e+n.col2.y*d);h=x.points[0];h.id.features.incidentEdge=b2Collision.b2_nullFeature;h.id.features.incidentVertex=b;h.id.features.referenceFace=b2Collision.b2_nullFeature;h.id.features.flip=0;h.position.x=k.m_position.x-g*x.normal.x;h.position.y=k.m_position.y-g*x.normal.y;h.separation=w-g;return}var q=(z-m.m_vertices[b].x)*r+(y-m.m_vertices[b].y)*p;h=x.points[0];h.id.features.incidentEdge=b2Collision.b2_nullFeature;h.id.features.incidentVertex=b2Collision.b2_nullFeature;h.id.features.referenceFace=b2Collision.b2_nullFeature;h.id.features.flip=0;var l,j;if(q<=0){l=m.m_vertices[b].x;j=m.m_vertices[b].y;h.id.features.incidentVertex=b}else{if(q>=f){l=m.m_vertices[a].x;j=m.m_vertices[a].y;h.id.features.incidentVertex=a}else{l=r*q+m.m_vertices[b].x;j=p*q+m.m_vertices[b].y;h.id.features.incidentEdge=b}}e=z-l;d=y-j;w=Math.sqrt(e*e+d*d);e/=w;d/=w;if(w>g){return}x.pointCount=1;x.normal.Set(n.col1.x*e+n.col2.x*d,n.col1.y*e+n.col2.y*d); -h.position.x=k.m_position.x-g*x.normal.x;h.position.y=k.m_position.y-g*x.normal.y;h.separation=w-g};b2Collision.b2TestOverlap=function(d,c){var i=c.minVertex;var g=d.maxVertex;var f=i.x-g.x;var e=i.y-g.y;i=d.minVertex;g=c.maxVertex;var j=i.x-g.x;var h=i.y-g.y;if(f>0||e>0){return false}if(j>0||h>0){return false}return true};var Features=function(){};Features.prototype={set_referenceFace:function(a){this._referenceFace=a;this._m_id._key=(this._m_id._key&4294967040)|(this._referenceFace&255)},get_referenceFace:function(){return this._referenceFace},_referenceFace:0,set_incidentEdge:function(a){this._incidentEdge=a;this._m_id._key=(this._m_id._key&4294902015)|((this._incidentEdge<<8)&65280)},get_incidentEdge:function(){return this._incidentEdge},_incidentEdge:0,set_incidentVertex:function(a){this._incidentVertex=a;this._m_id._key=(this._m_id._key&4278255615)|((this._incidentVertex<<16)&16711680)},get_incidentVertex:function(){return this._incidentVertex},_incidentVertex:0,set_flip:function(a){this._flip=a;this._m_id._key=(this._m_id._key&16777215)|((this._flip<<24)&4278190080)},get_flip:function(){return this._flip},_flip:0,_m_id:null};var b2ContactID=function(){this.features=new Features();this.features._m_id=this};b2ContactID.prototype={Set:function(a){this.set_key(a._key)},Copy:function(){var a=new b2ContactID();a.set_key(this._key);return a},get_key:function(){return this._key},set_key:function(a){this._key=a;this.features._referenceFace=this._key&255;this.features._incidentEdge=((this._key&65280)>>8)&255;this.features._incidentVertex=((this._key&16711680)>>16)&255;this.features._flip=((this._key&4278190080)>>24)&255},features:new Features(),_key:0};var b2ContactPoint=function(){this.position=new b2Vec2();this.id=new b2ContactID()};b2ContactPoint.prototype={position:new b2Vec2(),separation:null,normalImpulse:null,tangentImpulse:null,id:new b2ContactID()};var b2Distance=function(){};b2Distance.prototype={};b2Distance.ProcessTwo=function(j,h,b,k,i){var f=-i[1].x;var e=-i[1].y;var d=i[0].x-i[1].x;var c=i[0].y-i[1].y;var a=Math.sqrt(d*d+c*c);d/=a;c/=a;var g=f*d+e*c;if(g<=0||a=0&&F>=0){var B=x/(x+F);q.x=m[1].x+B*(m[2].x-m[1].x);q.y=m[1].y+B*(m[2].y-m[1].y);D.x=C[1].x+B*(C[2].x-C[1].x); -D.y=C[1].y+B*(C[2].y-C[1].y);m[0].SetV(m[2]);C[0].SetV(C[2]);G[0].SetV(G[2]);return 2}var f=E*(J*h-I*k);if(f<=0&&j>=0&&o>=0){var B=j/(j+o);q.x=m[0].x+B*(m[2].x-m[0].x);q.y=m[0].y+B*(m[2].y-m[0].y);D.x=C[0].x+B*(C[2].x-C[0].x);D.y=C[0].y+B*(C[2].y-C[0].y);m[1].SetV(m[2]);C[1].SetV(C[2]);G[1].SetV(G[2]);return 2}var d=g+f+e;d=1/d;var A=g*d;var t=f*d;var p=1-A-t;q.x=A*m[0].x+t*m[1].x+p*m[2].x;q.y=A*m[0].y+t*m[1].y+p*m[2].y;D.x=A*C[0].x+t*C[1].x+p*C[2].x;D.y=A*C[0].y+t*C[1].y+p*C[2].y;return 3};b2Distance.InPoinsts=function(a,c,d){for(var b=0;bNumber.MIN_VALUE){D*=1/d;C*=1/d}this.m_coreVertices[w].x=this.m_vertices[w].x-2*b2Settings.b2_linearSlop*D;this.m_coreVertices[w].y=this.m_vertices[w].y-2*b2Settings.b2_linearSlop*C}}var y=Number.MAX_VALUE;var x=Number.MAX_VALUE;var m=-Number.MAX_VALUE;var l=-Number.MAX_VALUE;this.m_maxRadius=0;for(w=0;w0){return false}}return true},syncAABB:new b2AABB(),syncMat:new b2Mat22(),Synchronize:function(c,e,a,b){this.m_R.SetM(b); -this.m_position.x=this.m_body.m_position.x+(b.col1.x*this.m_localCentroid.x+b.col2.x*this.m_localCentroid.y);this.m_position.y=this.m_body.m_position.y+(b.col1.y*this.m_localCentroid.x+b.col2.y*this.m_localCentroid.y);if(this.m_proxyId==b2Pair.b2_nullProxy){return}var m;var l;var k=e.col1;var j=e.col2;var i=this.m_localOBB.R.col1;var h=this.m_localOBB.R.col2;this.syncMat.col1.x=k.x*i.x+j.x*i.y;this.syncMat.col1.y=k.y*i.x+j.y*i.y;this.syncMat.col2.x=k.x*h.x+j.x*h.y;this.syncMat.col2.y=k.y*h.x+j.y*h.y;this.syncMat.Abs();m=this.m_localCentroid.x+this.m_localOBB.center.x;l=this.m_localCentroid.y+this.m_localOBB.center.y;var f=c.x+(e.col1.x*m+e.col2.x*l);var d=c.y+(e.col1.y*m+e.col2.y*l);m=this.syncMat.col1.x*this.m_localOBB.extents.x+this.syncMat.col2.x*this.m_localOBB.extents.y;l=this.syncMat.col1.y*this.m_localOBB.extents.x+this.syncMat.col2.y*this.m_localOBB.extents.y;this.syncAABB.minVertex.x=f-m;this.syncAABB.minVertex.y=d-l;this.syncAABB.maxVertex.x=f+m;this.syncAABB.maxVertex.y=d+l;k=b.col1; -j=b.col2;i=this.m_localOBB.R.col1;h=this.m_localOBB.R.col2;this.syncMat.col1.x=k.x*i.x+j.x*i.y;this.syncMat.col1.y=k.y*i.x+j.y*i.y;this.syncMat.col2.x=k.x*h.x+j.x*h.y;this.syncMat.col2.y=k.y*h.x+j.y*h.y;this.syncMat.Abs();m=this.m_localCentroid.x+this.m_localOBB.center.x;l=this.m_localCentroid.y+this.m_localOBB.center.y;f=a.x+(b.col1.x*m+b.col2.x*l);d=a.y+(b.col1.y*m+b.col2.y*l);m=this.syncMat.col1.x*this.m_localOBB.extents.x+this.syncMat.col2.x*this.m_localOBB.extents.y;l=this.syncMat.col1.y*this.m_localOBB.extents.x+this.syncMat.col2.y*this.m_localOBB.extents.y;this.syncAABB.minVertex.x=Math.min(this.syncAABB.minVertex.x,f-m);this.syncAABB.minVertex.y=Math.min(this.syncAABB.minVertex.y,d-l);this.syncAABB.maxVertex.x=Math.max(this.syncAABB.maxVertex.x,f+m);this.syncAABB.maxVertex.y=Math.max(this.syncAABB.maxVertex.y,d+l);var g=this.m_body.m_world.m_broadPhase;if(g.InRange(this.syncAABB)){g.MoveProxy(this.m_proxyId,this.syncAABB)}else{this.m_body.Freeze()}},QuickSync:function(a,b){this.m_R.SetM(b); -this.m_position.x=a.x+(b.col1.x*this.m_localCentroid.x+b.col2.x*this.m_localCentroid.y);this.m_position.y=a.y+(b.col1.y*this.m_localCentroid.x+b.col2.y*this.m_localCentroid.y)},ResetProxy:function(b){if(this.m_proxyId==b2Pair.b2_nullProxy){return}var e=b.GetProxy(this.m_proxyId);b.DestroyProxy(this.m_proxyId);e=null;var g=b2Math.b2MulMM(this.m_R,this.m_localOBB.R);var d=b2Math.b2AbsM(g);var f=b2Math.b2MulMV(d,this.m_localOBB.extents);var a=b2Math.b2MulMV(this.m_R,this.m_localOBB.center);a.Add(this.m_position);var c=new b2AABB();c.minVertex.SetV(a);c.minVertex.Subtract(f);c.maxVertex.SetV(a);c.maxVertex.Add(f);if(b.InRange(c)){this.m_proxyId=b.CreateProxy(c,this)}else{this.m_proxyId=b2Pair.b2_nullProxy}if(this.m_proxyId==b2Pair.b2_nullProxy){this.m_body.Freeze()}},Support:function(c,a,b){var g=(c*this.m_R.col1.x+a*this.m_R.col1.y);var f=(c*this.m_R.col2.x+a*this.m_R.col2.y);var e=0;var j=(this.m_coreVertices[0].x*g+this.m_coreVertices[0].y*f);for(var d=1;dj){e=d;j=h}}b.Set(this.m_position.x+(this.m_R.col1.x*this.m_coreVertices[e].x+this.m_R.col2.x*this.m_coreVertices[e].y),this.m_position.y+(this.m_R.col1.y*this.m_coreVertices[e].x+this.m_R.col2.y*this.m_coreVertices[e].y))},m_localCentroid:new b2Vec2(),m_localOBB:new b2OBB(),m_vertices:null,m_coreVertices:null,m_vertexCount:0,m_normals:null});b2PolyShape.tempVec=new b2Vec2();b2PolyShape.tAbsR=new b2Mat22();var b2Body=function(f,e){this.sMat0=new b2Mat22();this.m_position=new b2Vec2();this.m_R=new b2Mat22(0);this.m_position0=new b2Vec2();var c=0;var g;var a;this.m_flags=0;this.m_position.SetV(f.position);this.m_rotation=f.rotation;this.m_R.Set(this.m_rotation);this.m_position0.SetV(this.m_position);this.m_rotation0=this.m_rotation;this.m_world=e;this.m_linearDamping=b2Math.b2Clamp(1-f.linearDamping,0,1);this.m_angularDamping=b2Math.b2Clamp(1-f.angularDamping,0,1);this.m_force=new b2Vec2(0,0);this.m_torque=0;this.m_mass=0;var h=new Array(b2Settings.b2_maxShapesPerBody);for(c=0;c0){this.m_center.Multiply(1/this.m_mass);this.m_position.Add(b2Math.b2MulMV(this.m_R,this.m_center)) -}else{this.m_flags|=b2Body.e_staticFlag}this.m_I=0;for(c=0;c0){this.m_invMass=1/this.m_mass}else{this.m_invMass=0}if(this.m_I>0&&f.preventRotation==false){this.m_invI=1/this.m_I}else{this.m_I=0;this.m_invI=0}this.m_linearVelocity=b2Math.AddVV(f.linearVelocity,b2Math.b2CrossFV(f.angularVelocity,this.m_center));this.m_angularVelocity=f.angularVelocity;this.m_jointList=null;this.m_contactList=null;this.m_prev=null;this.m_next=null;this.m_shapeList=null;for(c=0;c0}var c=(b.m_maskBits&a.m_categoryBits)!=0&&(b.m_categoryBits&a.m_maskBits)!=0;return c}};b2CollisionFilter.b2_defaultFilter=new b2CollisionFilter;var b2Island=function(e,d,c,a){var b=0;this.m_bodyCapacity=e;this.m_contactCapacity=d;this.m_jointCapacity=c;this.m_bodyCount=0;this.m_contactCount=0;this.m_jointCount=0;this.m_bodies=new Array(e);for(b=0;bc||b2Math.b2Dot(a.m_linearVelocity,a.m_linearVelocity)>d){a.m_sleepTime=0;e=0}else{a.m_sleepTime+=g;e=b2Math.b2Min(e,a.m_sleepTime)}}if(e>=b2Settings.b2_timeToSleep){for(f=0;f0){a.m_shape1.m_body.WakeUp();a.m_shape2.m_body.WakeUp()}var d=a.m_shape1.m_type;var b=a.m_shape2.m_type;var e=b2Contact.s_registers[d][b].destroyFcn;e(a,c)};b2Contact.s_registers=null;b2Contact.s_initialized=false;var b2ContactConstraint=function(){this.normal=new b2Vec2();this.points=new Array(b2Settings.b2_maxManifoldPoints);for(var a=0;a0){b.velocityBias=-60*b.separation}var h=f+(-F*C)-u-(-G*Q);var g=d+(F*D)-s-(G*S);var P=V.normal.x*h+V.normal.y*g;if(P<-b2Settings.b2_velocityThreshold){b.velocityBias+=-V.restitution*P}}++L}}};b2ContactSolver.prototype={PreSolve:function(){var b;var A;var r;for(var w=0;w=-b2Settings.b2_linearSlop},PostSolve:function(){for(var d=0;d0){this.m_manifoldCount=1 -}else{this.m_manifoldCount=0}},GetManifolds:function(){return this.m_manifold},m_manifold:[new b2Manifold()]});b2CircleContact.Create=function(b,a,c){return new b2CircleContact(b,a)};b2CircleContact.Destroy=function(a,b){};var b2Conservative=function(){};b2Conservative.prototype={};b2Conservative.R1=new b2Mat22();b2Conservative.R2=new b2Mat22();b2Conservative.x1=new b2Vec2();b2Conservative.x2=new b2Vec2();b2Conservative.Conservative=function(k,j){var i=k.GetBody();var h=j.GetBody();var s=i.m_position.x-i.m_position0.x;var q=i.m_position.y-i.m_position0.y;var H=i.m_rotation-i.m_rotation0;var b=h.m_position.x-h.m_position0.x;var a=h.m_position.y-h.m_position0.y;var F=h.m_rotation-h.m_rotation0;var m=k.GetMaxRadius();var l=j.GetMaxRadius();var I=i.m_position0.x;var D=i.m_position0.y;var z=i.m_rotation0;var E=h.m_position0.x;var C=h.m_position0.y;var n=h.m_rotation0;var e=I;var c=D;var J=z;var B=E;var A=C;var G=n;b2Conservative.R1.Set(J);b2Conservative.R2.Set(G);k.QuickSync(p1,b2Conservative.R1);j.QuickSync(p2,b2Conservative.R2);var L=0;var o=10;var u;var t;var y=0;var v=true;for(var w=0;wFLT_EPSILON){d*=b2_linearSlop/p}if(i.IsStatic()){i.m_position.x=e;i.m_position.y=c}else{i.m_position.x=e-u;i.m_position.y=c-t}i.m_rotation=J;i.m_R.Set(J);i.QuickSyncShapes();if(h.IsStatic()){h.m_position.x=B;h.m_position.y=A}else{h.m_position.x=B+u;h.m_position.y=A+t}h.m_position.x=B+u;h.m_position.y=A+t;h.m_rotation=G;h.m_R.Set(G);h.QuickSyncShapes();return true -}k.QuickSync(i.m_position,i.m_R);j.QuickSync(h.m_position,h.m_R);return false};var b2NullContact=function(b,a){this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!b||!a){this.m_shape1=null;this.m_shape2=null;return}this.m_shape1=b;this.m_shape2=a;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null};Object.extend(b2NullContact.prototype,b2Contact.prototype);Object.extend(b2NullContact.prototype,{Evaluate:function(){},GetManifolds:function(){return null}});var b2PolyAndCircleContact=function(b,a){this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!b||!a){this.m_shape1=null;this.m_shape2=null;return}this.m_shape1=b;this.m_shape2=a;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null;this.m_manifold=[new b2Manifold()];b2Settings.b2Assert(this.m_shape1.m_type==b2Shape.e_polyShape);b2Settings.b2Assert(this.m_shape2.m_type==b2Shape.e_circleShape);this.m_manifold[0].pointCount=0;this.m_manifold[0].points[0].normalImpulse=0;this.m_manifold[0].points[0].tangentImpulse=0};Object.extend(b2PolyAndCircleContact.prototype,b2Contact.prototype);Object.extend(b2PolyAndCircleContact.prototype,{Evaluate:function(){b2Collision.b2CollidePolyAndCircle(this.m_manifold[0],this.m_shape1,this.m_shape2,false); -if(this.m_manifold[0].pointCount>0){this.m_manifoldCount=1}else{this.m_manifoldCount=0}},GetManifolds:function(){return this.m_manifold},m_manifold:[new b2Manifold()]});b2PolyAndCircleContact.Create=function(b,a,c){return new b2PolyAndCircleContact(b,a)};b2PolyAndCircleContact.Destroy=function(a,b){};var b2PolyContact=function(b,a){this.m_node1=new b2ContactNode();this.m_node2=new b2ContactNode();this.m_flags=0;if(!b||!a){this.m_shape1=null;this.m_shape2=null;return}this.m_shape1=b;this.m_shape2=a;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_prev=null;this.m_next=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null;this.m0=new b2Manifold();this.m_manifold=[new b2Manifold()];this.m_manifold[0].pointCount=0};Object.extend(b2PolyContact.prototype,b2Contact.prototype);Object.extend(b2PolyContact.prototype,{m0:new b2Manifold(),Evaluate:function(){var a=this.m_manifold[0];var b=this.m0.points;for(var d=0;d0){var h=[false,false];for(var f=0;f0){var e=f.m_shape1.m_body;var d=f.m_shape2.m_body;var b=f.m_node1;var a=f.m_node2;e.WakeUp();d.WakeUp();if(b.prev){b.prev.next=b.next}if(b.next){b.next.prev=b.prev}if(b==e.m_contactList){e.m_contactList=b.next}b.prev=null;b.next=null;if(a.prev){a.prev.next=a.next}if(a.next){a.next.prev=a.prev}if(a==d.m_contactList){d.m_contactList=a.next}a.prev=null;a.next=null}b2Contact.Destroy(f,this.m_world.m_blockAllocator);--this.m_world.m_contactCount},CleanContactList:function(){var b=this.m_world.m_contactList;while(b!=null){var a=b;b=b.m_next;if(a.m_flags&b2Contact.e_destroyFlag){this.DestroyContact(a);a=null}}},Collide:function(){var f;var e;var d;var a;for(var h=this.m_world.m_contactList;h!=null;h=h.m_next){if(h.m_shape1.m_body.IsSleeping()&&h.m_shape2.m_body.IsSleeping()){continue -}var b=h.GetManifoldCount();h.Evaluate();var g=h.GetManifoldCount();if(b==0&&g>0){f=h.m_shape1.m_body;e=h.m_shape2.m_body;d=h.m_node1;a=h.m_node2;d.contact=h;d.other=e;d.prev=null;d.next=f.m_contactList;if(d.next!=null){d.next.prev=h.m_node1}f.m_contactList=h.m_node1;a.contact=h;a.other=f;a.prev=null;a.next=e.m_contactList;if(a.next!=null){a.next.prev=a}e.m_contactList=a}else{if(b>0&&g==0){f=h.m_shape1.m_body;e=h.m_shape2.m_body;d=h.m_node1;a=h.m_node2;if(d.prev){d.prev.next=d.next}if(d.next){d.next.prev=d.prev}if(d==f.m_contactList){f.m_contactList=d.next}d.prev=null;d.next=null;if(a.prev){a.prev.next=a.next}if(a.next){a.next.prev=a.prev}if(a==e.m_contactList){e.m_contactList=a.next}a.prev=null;a.next=null}}}},m_world:null,m_nullContact:new b2NullContact(),m_destroyImmediate:null});var b2World=function(a,d,c){this.step=new b2TimeStep();this.m_contactManager=new b2ContactManager();this.m_listener=null;this.m_filter=b2CollisionFilter.b2_defaultFilter;this.m_bodyList=null;this.m_contactList=null;this.m_jointList=null;this.m_bodyCount=0;this.m_contactCount=0;this.m_jointCount=0;this.m_bodyDestroyList=null;this.m_allowSleep=c;this.m_gravity=d;this.m_contactManager.m_world=this;this.m_broadPhase=new b2BroadPhase(a,this.m_contactManager);var b=new b2BodyDef();this.m_groundBody=this.CreateBody(b)};b2World.prototype={SetListener:function(a){this.m_listener=a},SetFilter:function(a){this.m_filter=a},CreateBody:function(c){var a=new b2Body(c,this);a.m_prev=null;a.m_next=this.m_bodyList;if(this.m_bodyList){this.m_bodyList.m_prev=a}this.m_bodyList=a;++this.m_bodyCount;return a},DestroyBody:function(a){if(a.m_flags&b2Body.e_destroyFlag){return}if(a.m_prev){a.m_prev.m_next=a.m_next}if(a.m_next){a.m_next.m_prev=a.m_prev}if(a==this.m_bodyList){this.m_bodyList=a.m_next}a.m_flags|=b2Body.e_destroyFlag; ---this.m_bodyCount;a.m_prev=null;a.m_next=this.m_bodyDestroyList;this.m_bodyDestroyList=a},CleanBodyList:function(){this.m_contactManager.m_destroyImmediate=true;var c=this.m_bodyDestroyList;while(c){var e=c;c=c.m_next;var d=e.m_jointList;while(d){var a=d;d=d.next;if(this.m_listener){this.m_listener.NotifyJointDestroyed(a.joint)}this.DestroyJoint(a.joint)}e.Destroy()}this.m_bodyDestroyList=null;this.m_contactManager.m_destroyImmediate=false},CreateJoint:function(e){var c=b2Joint.Create(e,this.m_blockAllocator);c.m_prev=null;c.m_next=this.m_jointList;if(this.m_jointList){this.m_jointList.m_prev=c}this.m_jointList=c;++this.m_jointCount;c.m_node1.joint=c;c.m_node1.other=c.m_body2;c.m_node1.prev=null;c.m_node1.next=c.m_body1.m_jointList;if(c.m_body1.m_jointList){c.m_body1.m_jointList.prev=c.m_node1}c.m_body1.m_jointList=c.m_node1;c.m_node2.joint=c;c.m_node2.other=c.m_body1;c.m_node2.prev=null;c.m_node2.next=c.m_body2.m_jointList;if(c.m_body2.m_jointList){c.m_body2.m_jointList.prev=c.m_node2 -}c.m_body2.m_jointList=c.m_node2;if(e.collideConnected==false){var a=e.body1.m_shapeCount0){this.step.inv_dt=1/a}else{this.step.inv_dt=0}this.m_positionIterationCount=0;this.m_contactManager.CleanContactList();this.CleanBodyList();this.m_contactManager.Collide();var n=new b2Island(this.m_bodyCount,this.m_contactCount,this.m_jointCount,this.m_stackAllocator);for(r=this.m_bodyList;r!=null;r=r.m_next){r.m_flags&=~b2Body.e_islandFlag}for(var p=this.m_contactList;p!=null;p=p.m_next){p.m_flags&=~b2Contact.e_islandFlag}for(var h=this.m_jointList;h!=null;h=h.m_next){h.m_islandFlag=false}var u=this.m_bodyCount;var q=new Array(this.m_bodyCount);for(var g=0;g0){r=q[--t];n.AddBody(r);r.m_flags&=~b2Body.e_sleepFlag; -if(r.m_flags&b2Body.e_staticFlag){continue}for(var s=r.m_contactList;s!=null;s=s.next){if(s.contact.m_flags&b2Contact.e_islandFlag){continue}n.AddContact(s.contact);s.contact.m_flags|=b2Contact.e_islandFlag;o=s.other;if(o.m_flags&b2Body.e_islandFlag){continue}q[t++]=o;o.m_flags|=b2Body.e_islandFlag}for(var f=r.m_jointList;f!=null;f=f.next){if(f.joint.m_islandFlag==true){continue}n.AddJoint(f.joint);f.joint.m_islandFlag=true;o=f.other;if(o.m_flags&b2Body.e_islandFlag){continue}q[t++]=o;o.m_flags|=b2Body.e_islandFlag}}n.Solve(this.step,this.m_gravity);this.m_positionIterationCount=b2Math.b2Max(this.m_positionIterationCount,b2Island.m_positionIterationCount);if(this.m_allowSleep){n.UpdateSleep(a)}for(var l=0;lb2Settings.b2_linearSlop){this.m_u.Multiply(1/a)}else{this.m_u.SetZero()}var h=(j*this.m_u.y-i*this.m_u.x);var d=(f*this.m_u.y-e*this.m_u.x);this.m_mass=this.m_body1.m_invMass+this.m_body1.m_invI*h*h+this.m_body2.m_invMass+this.m_body2.m_invI*d*d;this.m_mass=1/this.m_mass;if(b2World.s_enableWarmStarting){var c=this.m_impulse*this.m_u.x;var b=this.m_impulse*this.m_u.y;this.m_body1.m_linearVelocity.x-=this.m_body1.m_invMass*c;this.m_body1.m_linearVelocity.y-=this.m_body1.m_invMass*b;this.m_body1.m_angularVelocity-=this.m_body1.m_invI*(j*b-i*c); -this.m_body2.m_linearVelocity.x+=this.m_body2.m_invMass*c;this.m_body2.m_linearVelocity.y+=this.m_body2.m_invMass*b;this.m_body2.m_angularVelocity+=this.m_body2.m_invI*(f*b-e*c)}else{this.m_impulse=0}},SolveVelocityConstraints:function(b){var j;j=this.m_body1.m_R;var n=j.col1.x*this.m_localAnchor1.x+j.col2.x*this.m_localAnchor1.y;var m=j.col1.y*this.m_localAnchor1.x+j.col2.y*this.m_localAnchor1.y;j=this.m_body2.m_R;var h=j.col1.x*this.m_localAnchor2.x+j.col2.x*this.m_localAnchor2.y;var g=j.col1.y*this.m_localAnchor2.x+j.col2.y*this.m_localAnchor2.y;var l=this.m_body1.m_linearVelocity.x+(-this.m_body1.m_angularVelocity*m);var k=this.m_body1.m_linearVelocity.y+(this.m_body1.m_angularVelocity*n);var f=this.m_body2.m_linearVelocity.x+(-this.m_body2.m_angularVelocity*g);var e=this.m_body2.m_linearVelocity.y+(this.m_body2.m_angularVelocity*h);var i=(this.m_u.x*(f-l)+this.m_u.y*(e-k));var a=-this.m_mass*i;this.m_impulse+=a;var d=a*this.m_u.x;var c=a*this.m_u.y;this.m_body1.m_linearVelocity.x-=this.m_body1.m_invMass*d; -this.m_body1.m_linearVelocity.y-=this.m_body1.m_invMass*c;this.m_body1.m_angularVelocity-=this.m_body1.m_invI*(n*c-m*d);this.m_body2.m_linearVelocity.x+=this.m_body2.m_invMass*d;this.m_body2.m_linearVelocity.y+=this.m_body2.m_invMass*c;this.m_body2.m_angularVelocity+=this.m_body2.m_invI*(h*c-g*d)},SolvePositionConstraints:function(){var j;j=this.m_body1.m_R;var l=j.col1.x*this.m_localAnchor1.x+j.col2.x*this.m_localAnchor1.y;var k=j.col1.y*this.m_localAnchor1.x+j.col2.y*this.m_localAnchor1.y;j=this.m_body2.m_R;var i=j.col1.x*this.m_localAnchor2.x+j.col2.x*this.m_localAnchor2.y;var h=j.col1.y*this.m_localAnchor2.x+j.col2.y*this.m_localAnchor2.y;var g=this.m_body2.m_position.x+i-this.m_body1.m_position.x-l;var f=this.m_body2.m_position.y+h-this.m_body1.m_position.y-k;var c=Math.sqrt(g*g+f*f);g/=c;f/=c;var a=c-this.m_length;a=b2Math.b2Clamp(a,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);var b=-this.m_mass*a;this.m_u.Set(g,f);var e=b*this.m_u.x;var d=b*this.m_u.y;this.m_body1.m_position.x-=this.m_body1.m_invMass*e; -this.m_body1.m_position.y-=this.m_body1.m_invMass*d;this.m_body1.m_rotation-=this.m_body1.m_invI*(l*d-k*e);this.m_body2.m_position.x+=this.m_body2.m_invMass*e;this.m_body2.m_position.y+=this.m_body2.m_invMass*d;this.m_body2.m_rotation+=this.m_body2.m_invI*(i*d-h*e);this.m_body1.m_R.Set(this.m_body1.m_rotation);this.m_body2.m_R.Set(this.m_body2.m_rotation);return b2Math.b2Abs(a)d.dt*this.m_maxForce){this.m_impulse.Multiply(d.dt*this.m_maxForce/b)}e=this.m_impulse.x-j;c=this.m_impulse.y-g;i.m_linearVelocity.x+=i.m_invMass*e;i.m_linearVelocity.y+=i.m_invMass*c; -i.m_angularVelocity+=i.m_invI*(h*c-f*e)},SolvePositionConstraints:function(){return true},m_localAnchor:new b2Vec2(),m_target:new b2Vec2(),m_impulse:new b2Vec2(),m_ptpMass:new b2Mat22(),m_C:new b2Vec2(),m_maxForce:null,m_beta:null,m_gamma:null});var b2MouseJointDef=function(){this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.target=new b2Vec2();this.type=b2Joint.e_mouseJoint;this.maxForce=0;this.frequencyHz=5;this.dampingRatio=0.7;this.timeStep=1/60};Object.extend(b2MouseJointDef.prototype,b2JointDef.prototype);Object.extend(b2MouseJointDef.prototype,{target:new b2Vec2(),maxForce:null,frequencyHz:null,dampingRatio:null,timeStep:null});var b2PrismaticJoint=function(c){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=c.type;this.m_prev=null;this.m_next=null;this.m_body1=c.body1;this.m_body2=c.body2;this.m_collideConnected=c.collideConnected;this.m_islandFlag=false;this.m_userData=c.userData;this.m_localAnchor1=new b2Vec2();this.m_localAnchor2=new b2Vec2();this.m_localXAxis1=new b2Vec2();this.m_localYAxis1=new b2Vec2();this.m_linearJacobian=new b2Jacobian();this.m_motorJacobian=new b2Jacobian();var b;var a;var d;b=this.m_body1.m_R;a=(c.anchorPoint.x-this.m_body1.m_position.x);d=(c.anchorPoint.y-this.m_body1.m_position.y);this.m_localAnchor1.Set((a*b.col1.x+d*b.col1.y),(a*b.col2.x+d*b.col2.y));b=this.m_body2.m_R;a=(c.anchorPoint.x-this.m_body2.m_position.x);d=(c.anchorPoint.y-this.m_body2.m_position.y);this.m_localAnchor2.Set((a*b.col1.x+d*b.col1.y),(a*b.col2.x+d*b.col2.y));b=this.m_body1.m_R;a=c.axis.x;d=c.axis.y;this.m_localXAxis1.Set((a*b.col1.x+d*b.col1.y),(a*b.col2.x+d*b.col2.y));this.m_localYAxis1.x=-this.m_localXAxis1.y; -this.m_localYAxis1.y=this.m_localXAxis1.x;this.m_initialAngle=this.m_body2.m_rotation-this.m_body1.m_rotation;this.m_linearJacobian.SetZero();this.m_linearMass=0;this.m_linearImpulse=0;this.m_angularMass=0;this.m_angularImpulse=0;this.m_motorJacobian.SetZero();this.m_motorMass=0;this.m_motorImpulse=0;this.m_limitImpulse=0;this.m_limitPositionImpulse=0;this.m_lowerTranslation=c.lowerTranslation;this.m_upperTranslation=c.upperTranslation;this.m_maxMotorForce=c.motorForce;this.m_motorSpeed=c.motorSpeed;this.m_enableLimit=c.enableLimit;this.m_enableMotor=c.enableMotor};Object.extend(b2PrismaticJoint.prototype,b2Joint.prototype);Object.extend(b2PrismaticJoint.prototype,{GetAnchor1:function(){var a=this.m_body1;var b=new b2Vec2();b.SetV(this.m_localAnchor1);b.MulM(a.m_R);b.Add(a.m_position);return b},GetAnchor2:function(){var a=this.m_body2;var b=new b2Vec2();b.SetV(this.m_localAnchor2);b.MulM(a.m_R);b.Add(a.m_position);return b},GetJointTranslation:function(){var l=this.m_body1;var k=this.m_body2; -var j;j=l.m_R;var p=j.col1.x*this.m_localAnchor1.x+j.col2.x*this.m_localAnchor1.y;var n=j.col1.y*this.m_localAnchor1.x+j.col2.y*this.m_localAnchor1.y;j=k.m_R;var i=j.col1.x*this.m_localAnchor2.x+j.col2.x*this.m_localAnchor2.y;var h=j.col1.y*this.m_localAnchor2.x+j.col2.y*this.m_localAnchor2.y;var g=l.m_position.x+p;var f=l.m_position.y+n;var c=k.m_position.x+i;var b=k.m_position.y+h;var e=c-g;var d=b-f;j=l.m_R;var o=j.col1.x*this.m_localXAxis1.x+j.col2.x*this.m_localXAxis1.y;var m=j.col1.y*this.m_localXAxis1.x+j.col2.y*this.m_localXAxis1.y;var a=o*e+m*d;return a},GetJointSpeed:function(){var j=this.m_body1;var i=this.m_body2;var k;k=j.m_R;var t=k.col1.x*this.m_localAnchor1.x+k.col2.x*this.m_localAnchor1.y;var s=k.col1.y*this.m_localAnchor1.x+k.col2.y*this.m_localAnchor1.y;k=i.m_R;var h=k.col1.x*this.m_localAnchor2.x+k.col2.x*this.m_localAnchor2.y;var g=k.col1.y*this.m_localAnchor2.x+k.col2.y*this.m_localAnchor2.y;var r=j.m_position.x+t;var p=j.m_position.y+s;var c=i.m_position.x+h;var a=i.m_position.y+g; -var f=c-r;var e=a-p;k=j.m_R;var o=k.col1.x*this.m_localXAxis1.x+k.col2.x*this.m_localXAxis1.y;var n=k.col1.y*this.m_localXAxis1.x+k.col2.y*this.m_localXAxis1.y;var d=j.m_linearVelocity;var b=i.m_linearVelocity;var m=j.m_angularVelocity;var l=i.m_angularVelocity;var q=(f*(-m*n)+e*(m*o))+(o*(((b.x+(-l*g))-d.x)-(-m*s))+n*(((b.y+(l*h))-d.y)-(m*t)));return q},GetMotorForce:function(a){return a*this.m_motorImpulse},SetMotorSpeed:function(a){this.m_motorSpeed=a},SetMotorForce:function(a){this.m_maxMotorForce=a},GetReactionForce:function(b){var e=b*this.m_limitImpulse;var d;d=this.m_body1.m_R;var g=e*(d.col1.x*this.m_localXAxis1.x+d.col2.x*this.m_localXAxis1.y);var f=e*(d.col1.y*this.m_localXAxis1.x+d.col2.y*this.m_localXAxis1.y);var c=e*(d.col1.x*this.m_localYAxis1.x+d.col2.x*this.m_localYAxis1.y);var a=e*(d.col1.y*this.m_localYAxis1.x+d.col2.y*this.m_localYAxis1.y);return new b2Vec2(g+c,f+a)},GetReactionTorque:function(a){return a*this.m_angularImpulse},PrepareVelocitySolver:function(){var m=this.m_body1; -var l=this.m_body2;var p;p=m.m_R;var z=p.col1.x*this.m_localAnchor1.x+p.col2.x*this.m_localAnchor1.y;var y=p.col1.y*this.m_localAnchor1.x+p.col2.y*this.m_localAnchor1.y;p=l.m_R;var i=p.col1.x*this.m_localAnchor2.x+p.col2.x*this.m_localAnchor2.y;var g=p.col1.y*this.m_localAnchor2.x+p.col2.y*this.m_localAnchor2.y;var s=m.m_invMass;var r=l.m_invMass;var k=m.m_invI;var j=l.m_invI;p=m.m_R;var h=p.col1.x*this.m_localYAxis1.x+p.col2.x*this.m_localYAxis1.y;var f=p.col1.y*this.m_localYAxis1.x+p.col2.y*this.m_localYAxis1.y;var t=l.m_position.x+i-m.m_position.x;var q=l.m_position.y+g-m.m_position.y;this.m_linearJacobian.linear1.x=-h;this.m_linearJacobian.linear1.y=-f;this.m_linearJacobian.linear2.x=h;this.m_linearJacobian.linear2.y=f;this.m_linearJacobian.angular1=-(t*f-q*h);this.m_linearJacobian.angular2=i*f-g*h;this.m_linearMass=s+k*this.m_linearJacobian.angular1*this.m_linearJacobian.angular1+r+j*this.m_linearJacobian.angular2*this.m_linearJacobian.angular2;this.m_linearMass=1/this.m_linearMass; -this.m_angularMass=1/(k+j);if(this.m_enableLimit||this.m_enableMotor){p=m.m_R;var v=p.col1.x*this.m_localXAxis1.x+p.col2.x*this.m_localXAxis1.y;var u=p.col1.y*this.m_localXAxis1.x+p.col2.y*this.m_localXAxis1.y;this.m_motorJacobian.linear1.x=-v;this.m_motorJacobian.linear1.y=-u;this.m_motorJacobian.linear2.x=v;this.m_motorJacobian.linear2.y=u;this.m_motorJacobian.angular1=-(t*u-q*v);this.m_motorJacobian.angular2=i*u-g*v;this.m_motorMass=s+k*this.m_motorJacobian.angular1*this.m_motorJacobian.angular1+r+j*this.m_motorJacobian.angular2*this.m_motorJacobian.angular2;this.m_motorMass=1/this.m_motorMass;if(this.m_enableLimit){var e=t-z;var d=q-y;var c=v*e+u*d;if(b2Math.b2Abs(this.m_upperTranslation-this.m_lowerTranslation)<2*b2Settings.b2_linearSlop){this.m_limitState=b2Joint.e_equalLimits}else{if(c<=this.m_lowerTranslation){if(this.m_limitState!=b2Joint.e_atLowerLimit){this.m_limitImpulse=0}this.m_limitState=b2Joint.e_atLowerLimit}else{if(c>=this.m_upperTranslation){if(this.m_limitState!=b2Joint.e_atUpperLimit){this.m_limitImpulse=0 -}this.m_limitState=b2Joint.e_atUpperLimit}else{this.m_limitState=b2Joint.e_inactiveLimit;this.m_limitImpulse=0}}}}}if(this.m_enableMotor==false){this.m_motorImpulse=0}if(this.m_enableLimit==false){this.m_limitImpulse=0}if(b2World.s_enableWarmStarting){var b=this.m_linearImpulse*this.m_linearJacobian.linear1.x+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear1.x;var a=this.m_linearImpulse*this.m_linearJacobian.linear1.y+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear1.y;var o=this.m_linearImpulse*this.m_linearJacobian.linear2.x+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear2.x;var n=this.m_linearImpulse*this.m_linearJacobian.linear2.y+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.linear2.y;var x=this.m_linearImpulse*this.m_linearJacobian.angular1-this.m_angularImpulse+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.angular1;var w=this.m_linearImpulse*this.m_linearJacobian.angular2+this.m_angularImpulse+(this.m_motorImpulse+this.m_limitImpulse)*this.m_motorJacobian.angular2; -m.m_linearVelocity.x+=s*b;m.m_linearVelocity.y+=s*a;m.m_angularVelocity+=k*x;l.m_linearVelocity.x+=r*o;l.m_linearVelocity.y+=r*n;l.m_angularVelocity+=j*w}else{this.m_linearImpulse=0;this.m_angularImpulse=0;this.m_limitImpulse=0;this.m_motorImpulse=0}this.m_limitPositionImpulse=0},SolveVelocityConstraints:function(b){var l=this.m_body1;var k=this.m_body2;var q=l.m_invMass;var o=k.m_invMass;var d=l.m_invI;var c=k.m_invI;var p;var e=this.m_linearJacobian.Compute(l.m_linearVelocity,l.m_angularVelocity,k.m_linearVelocity,k.m_angularVelocity);var j=-this.m_linearMass*e;this.m_linearImpulse+=j;l.m_linearVelocity.x+=(q*j)*this.m_linearJacobian.linear1.x;l.m_linearVelocity.y+=(q*j)*this.m_linearJacobian.linear1.y;l.m_angularVelocity+=d*j*this.m_linearJacobian.angular1;k.m_linearVelocity.x+=(o*j)*this.m_linearJacobian.linear2.x;k.m_linearVelocity.y+=(o*j)*this.m_linearJacobian.linear2.y;k.m_angularVelocity+=c*j*this.m_linearJacobian.angular2;var h=k.m_angularVelocity-l.m_angularVelocity;var a=-this.m_angularMass*h; -this.m_angularImpulse+=a;l.m_angularVelocity-=d*a;k.m_angularVelocity+=c*a;if(this.m_enableMotor&&this.m_limitState!=b2Joint.e_equalLimits){var m=this.m_motorJacobian.Compute(l.m_linearVelocity,l.m_angularVelocity,k.m_linearVelocity,k.m_angularVelocity)-this.m_motorSpeed;var f=-this.m_motorMass*m;var n=this.m_motorImpulse;this.m_motorImpulse=b2Math.b2Clamp(this.m_motorImpulse+f,-b.dt*this.m_maxMotorForce,b.dt*this.m_maxMotorForce);f=this.m_motorImpulse-n;l.m_linearVelocity.x+=(q*f)*this.m_motorJacobian.linear1.x;l.m_linearVelocity.y+=(q*f)*this.m_motorJacobian.linear1.y;l.m_angularVelocity+=d*f*this.m_motorJacobian.angular1;k.m_linearVelocity.x+=(o*f)*this.m_motorJacobian.linear2.x;k.m_linearVelocity.y+=(o*f)*this.m_motorJacobian.linear2.y;k.m_angularVelocity+=c*f*this.m_motorJacobian.angular2}if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit){var i=this.m_motorJacobian.Compute(l.m_linearVelocity,l.m_angularVelocity,k.m_linearVelocity,k.m_angularVelocity);var g=-this.m_motorMass*i; -if(this.m_limitState==b2Joint.e_equalLimits){this.m_limitImpulse+=g}else{if(this.m_limitState==b2Joint.e_atLowerLimit){p=this.m_limitImpulse;this.m_limitImpulse=b2Math.b2Max(this.m_limitImpulse+g,0);g=this.m_limitImpulse-p}else{if(this.m_limitState==b2Joint.e_atUpperLimit){p=this.m_limitImpulse;this.m_limitImpulse=b2Math.b2Min(this.m_limitImpulse+g,0);g=this.m_limitImpulse-p}}}l.m_linearVelocity.x+=(q*g)*this.m_motorJacobian.linear1.x;l.m_linearVelocity.y+=(q*g)*this.m_motorJacobian.linear1.y;l.m_angularVelocity+=d*g*this.m_motorJacobian.angular1;k.m_linearVelocity.x+=(o*g)*this.m_motorJacobian.linear2.x;k.m_linearVelocity.y+=(o*g)*this.m_motorJacobian.linear2.y;k.m_angularVelocity+=c*g*this.m_motorJacobian.angular2}},SolvePositionConstraints:function(){var o;var y;var m=this.m_body1;var k=this.m_body2;var t=m.m_invMass;var s=k.m_invMass;var j=m.m_invI;var i=k.m_invI;var q;q=m.m_R;var E=q.col1.x*this.m_localAnchor1.x+q.col2.x*this.m_localAnchor1.y;var D=q.col1.y*this.m_localAnchor1.x+q.col2.y*this.m_localAnchor1.y; -q=k.m_R;var h=q.col1.x*this.m_localAnchor2.x+q.col2.x*this.m_localAnchor2.y;var g=q.col1.y*this.m_localAnchor2.x+q.col2.y*this.m_localAnchor2.y;var B=m.m_position.x+E;var z=m.m_position.y+D;var b=k.m_position.x+h;var a=k.m_position.y+g;var e=b-B;var c=a-z;q=m.m_R;var f=q.col1.x*this.m_localYAxis1.x+q.col2.x*this.m_localYAxis1.y;var d=q.col1.y*this.m_localYAxis1.x+q.col2.y*this.m_localYAxis1.y;var l=f*e+d*c;l=b2Math.b2Clamp(l,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);var x=-this.m_linearMass*l;m.m_position.x+=(t*x)*this.m_linearJacobian.linear1.x;m.m_position.y+=(t*x)*this.m_linearJacobian.linear1.y;m.m_rotation+=j*x*this.m_linearJacobian.angular1;k.m_position.x+=(s*x)*this.m_linearJacobian.linear2.x;k.m_position.y+=(s*x)*this.m_linearJacobian.linear2.y;k.m_rotation+=i*x*this.m_linearJacobian.angular2;var p=b2Math.b2Abs(l);var A=k.m_rotation-m.m_rotation-this.m_initialAngle;A=b2Math.b2Clamp(A,-b2Settings.b2_maxAngularCorrection,b2Settings.b2_maxAngularCorrection); -var r=-this.m_angularMass*A;m.m_rotation-=m.m_invI*r;m.m_R.Set(m.m_rotation);k.m_rotation+=k.m_invI*r;k.m_R.Set(k.m_rotation);var C=b2Math.b2Abs(A);if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit){q=m.m_R;E=q.col1.x*this.m_localAnchor1.x+q.col2.x*this.m_localAnchor1.y;D=q.col1.y*this.m_localAnchor1.x+q.col2.y*this.m_localAnchor1.y;q=k.m_R;h=q.col1.x*this.m_localAnchor2.x+q.col2.x*this.m_localAnchor2.y;g=q.col1.y*this.m_localAnchor2.x+q.col2.y*this.m_localAnchor2.y;B=m.m_position.x+E;z=m.m_position.y+D;b=k.m_position.x+h;a=k.m_position.y+g;e=b-B;c=a-z;q=m.m_R;var v=q.col1.x*this.m_localXAxis1.x+q.col2.x*this.m_localXAxis1.y;var u=q.col1.y*this.m_localXAxis1.x+q.col2.y*this.m_localXAxis1.y;var n=(v*e+u*c);var w=0;if(this.m_limitState==b2Joint.e_equalLimits){o=b2Math.b2Clamp(n,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);w=-this.m_motorMass*o;p=b2Math.b2Max(p,b2Math.b2Abs(A))}else{if(this.m_limitState==b2Joint.e_atLowerLimit){o=n-this.m_lowerTranslation; -p=b2Math.b2Max(p,-o);o=b2Math.b2Clamp(o+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0);w=-this.m_motorMass*o;y=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Max(this.m_limitPositionImpulse+w,0);w=this.m_limitPositionImpulse-y}else{if(this.m_limitState==b2Joint.e_atUpperLimit){o=n-this.m_upperTranslation;p=b2Math.b2Max(p,o);o=b2Math.b2Clamp(o-b2Settings.b2_linearSlop,0,b2Settings.b2_maxLinearCorrection);w=-this.m_motorMass*o;y=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Min(this.m_limitPositionImpulse+w,0);w=this.m_limitPositionImpulse-y}}}m.m_position.x+=(t*w)*this.m_motorJacobian.linear1.x;m.m_position.y+=(t*w)*this.m_motorJacobian.linear1.y;m.m_rotation+=j*w*this.m_motorJacobian.angular1;m.m_R.Set(m.m_rotation);k.m_position.x+=(s*w)*this.m_motorJacobian.linear2.x;k.m_position.y+=(s*w)*this.m_motorJacobian.linear2.y;k.m_rotation+=i*w*this.m_motorJacobian.angular2;k.m_R.Set(k.m_rotation)}return p<=b2Settings.b2_linearSlop&&C<=b2Settings.b2_angularSlop -},m_localAnchor1:new b2Vec2(),m_localAnchor2:new b2Vec2(),m_localXAxis1:new b2Vec2(),m_localYAxis1:new b2Vec2(),m_initialAngle:null,m_linearJacobian:new b2Jacobian(),m_linearMass:null,m_linearImpulse:null,m_angularMass:null,m_angularImpulse:null,m_motorJacobian:new b2Jacobian(),m_motorMass:null,m_motorImpulse:null,m_limitImpulse:null,m_limitPositionImpulse:null,m_lowerTranslation:null,m_upperTranslation:null,m_maxMotorForce:null,m_motorSpeed:null,m_enableLimit:null,m_enableMotor:null,m_limitState:0});var b2PrismaticJointDef=function(){this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.type=b2Joint.e_prismaticJoint;this.anchorPoint=new b2Vec2(0,0);this.axis=new b2Vec2(0,0);this.lowerTranslation=0;this.upperTranslation=0;this.motorForce=0;this.motorSpeed=0;this.enableLimit=false;this.enableMotor=false};Object.extend(b2PrismaticJointDef.prototype,b2JointDef.prototype);Object.extend(b2PrismaticJointDef.prototype,{anchorPoint:null,axis:null,lowerTranslation:null,upperTranslation:null,motorForce:null,motorSpeed:null,enableLimit:null,enableMotor:null,Initialize:function(b,a,d,c){this.body1=b;this.body2=a;this.anchorPoint=d;this.axis=c}});var b2PulleyJoint=function(d){this.m_node1=new b2JointNode();this.m_node2=new b2JointNode();this.m_type=d.type;this.m_prev=null;this.m_next=null;this.m_body1=d.body1;this.m_body2=d.body2;this.m_collideConnected=d.collideConnected;this.m_islandFlag=false;this.m_userData=d.userData;this.m_groundAnchor1=new b2Vec2();this.m_groundAnchor2=new b2Vec2();this.m_localAnchor1=new b2Vec2();this.m_localAnchor2=new b2Vec2();this.m_u1=new b2Vec2();this.m_u2=new b2Vec2();var b;var a;var h;this.m_ground=this.m_body1.m_world.m_groundBody;this.m_groundAnchor1.x=d.groundPoint1.x-this.m_ground.m_position.x;this.m_groundAnchor1.y=d.groundPoint1.y-this.m_ground.m_position.y;this.m_groundAnchor2.x=d.groundPoint2.x-this.m_ground.m_position.x;this.m_groundAnchor2.y=d.groundPoint2.y-this.m_ground.m_position.y;b=this.m_body1.m_R;a=d.anchorPoint1.x-this.m_body1.m_position.x;h=d.anchorPoint1.y-this.m_body1.m_position.y;this.m_localAnchor1.x=a*b.col1.x+h*b.col1.y;this.m_localAnchor1.y=a*b.col2.x+h*b.col2.y;b=this.m_body2.m_R; -a=d.anchorPoint2.x-this.m_body2.m_position.x;h=d.anchorPoint2.y-this.m_body2.m_position.y;this.m_localAnchor2.x=a*b.col1.x+h*b.col1.y;this.m_localAnchor2.y=a*b.col2.x+h*b.col2.y;this.m_ratio=d.ratio;a=d.groundPoint1.x-d.anchorPoint1.x;h=d.groundPoint1.y-d.anchorPoint1.y;var f=Math.sqrt(a*a+h*h);a=d.groundPoint2.x-d.anchorPoint2.x;h=d.groundPoint2.y-d.anchorPoint2.y;var c=Math.sqrt(a*a+h*h);var g=b2Math.b2Max(0.5*b2PulleyJoint.b2_minPulleyLength,f);var e=b2Math.b2Max(0.5*b2PulleyJoint.b2_minPulleyLength,c);this.m_constant=g+this.m_ratio*e;this.m_maxLength1=b2Math.b2Clamp(d.maxLength1,g,this.m_constant-this.m_ratio*b2PulleyJoint.b2_minPulleyLength);this.m_maxLength2=b2Math.b2Clamp(d.maxLength2,e,(this.m_constant-b2PulleyJoint.b2_minPulleyLength)/this.m_ratio);this.m_pulleyImpulse=0;this.m_limitImpulse1=0;this.m_limitImpulse2=0};Object.extend(b2PulleyJoint.prototype,b2Joint.prototype);Object.extend(b2PulleyJoint.prototype,{GetAnchor1:function(){var a=this.m_body1.m_R;return new b2Vec2(this.m_body1.m_position.x+(a.col1.x*this.m_localAnchor1.x+a.col2.x*this.m_localAnchor1.y),this.m_body1.m_position.y+(a.col1.y*this.m_localAnchor1.x+a.col2.y*this.m_localAnchor1.y)) -},GetAnchor2:function(){var a=this.m_body2.m_R;return new b2Vec2(this.m_body2.m_position.x+(a.col1.x*this.m_localAnchor2.x+a.col2.x*this.m_localAnchor2.y),this.m_body2.m_position.y+(a.col1.y*this.m_localAnchor2.x+a.col2.y*this.m_localAnchor2.y))},GetGroundPoint1:function(){return new b2Vec2(this.m_ground.m_position.x+this.m_groundAnchor1.x,this.m_ground.m_position.y+this.m_groundAnchor1.y)},GetGroundPoint2:function(){return new b2Vec2(this.m_ground.m_position.x+this.m_groundAnchor2.x,this.m_ground.m_position.y+this.m_groundAnchor2.y)},GetReactionForce:function(a){return new b2Vec2()},GetReactionTorque:function(a){return 0},GetLength1:function(){var e;e=this.m_body1.m_R;var d=this.m_body1.m_position.x+(e.col1.x*this.m_localAnchor1.x+e.col2.x*this.m_localAnchor1.y);var c=this.m_body1.m_position.y+(e.col1.y*this.m_localAnchor1.x+e.col2.y*this.m_localAnchor1.y);var b=d-(this.m_ground.m_position.x+this.m_groundAnchor1.x);var a=c-(this.m_ground.m_position.y+this.m_groundAnchor1.y);return Math.sqrt(b*b+a*a) -},GetLength2:function(){var e;e=this.m_body2.m_R;var d=this.m_body2.m_position.x+(e.col1.x*this.m_localAnchor2.x+e.col2.x*this.m_localAnchor2.y);var c=this.m_body2.m_position.y+(e.col1.y*this.m_localAnchor2.x+e.col2.y*this.m_localAnchor2.y);var b=d-(this.m_ground.m_position.x+this.m_groundAnchor2.x);var a=c-(this.m_ground.m_position.y+this.m_groundAnchor2.y);return Math.sqrt(b*b+a*a)},GetRatio:function(){return this.m_ratio},PrepareVelocitySolver:function(){var h=this.m_body1;var g=this.m_body2;var l;l=h.m_R;var v=l.col1.x*this.m_localAnchor1.x+l.col2.x*this.m_localAnchor1.y;var u=l.col1.y*this.m_localAnchor1.x+l.col2.y*this.m_localAnchor1.y;l=g.m_R;var f=l.col1.x*this.m_localAnchor2.x+l.col2.x*this.m_localAnchor2.y;var e=l.col1.y*this.m_localAnchor2.x+l.col2.y*this.m_localAnchor2.y;var t=h.m_position.x+v;var r=h.m_position.y+u;var d=g.m_position.x+f;var c=g.m_position.y+e;var m=this.m_ground.m_position.x+this.m_groundAnchor1.x;var k=this.m_ground.m_position.y+this.m_groundAnchor1.y;var s=this.m_ground.m_position.x+this.m_groundAnchor2.x; -var q=this.m_ground.m_position.y+this.m_groundAnchor2.y;this.m_u1.Set(t-m,r-k);this.m_u2.Set(d-s,c-q);var p=this.m_u1.Length();var o=this.m_u2.Length();if(p>b2Settings.b2_linearSlop){this.m_u1.Multiply(1/p)}else{this.m_u1.SetZero()}if(o>b2Settings.b2_linearSlop){this.m_u2.Multiply(1/o)}else{this.m_u2.SetZero()}if(pb2Settings.b2_linearSlop){this.m_u1.Multiply(1/n)}else{this.m_u1.SetZero()}if(m>b2Settings.b2_linearSlop){this.m_u2.Multiply(1/m)}else{this.m_u2.SetZero()}l=this.m_constant-n-this.m_ratio*m;e=b2Math.b2Max(e,Math.abs(l));l=b2Math.b2Clamp(l,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection);h=-this.m_pulleyMass*l;r=-h*this.m_u1.x;p=-h*this.m_u1.y;b=-this.m_ratio*h*this.m_u2.x;a=-this.m_ratio*h*this.m_u2.y;g.m_position.x+=g.m_invMass*r;g.m_position.y+=g.m_invMass*p;g.m_rotation+=g.m_invI*(u*p-t*r);f.m_position.x+=f.m_invMass*b;f.m_position.y+=f.m_invMass*a;f.m_rotation+=f.m_invI*(d*a-c*b);g.m_R.Set(g.m_rotation);f.m_R.Set(f.m_rotation);if(this.m_limitState1==b2Joint.e_atUpperLimit){j=g.m_R;u=j.col1.x*this.m_localAnchor1.x+j.col2.x*this.m_localAnchor1.y;t=j.col1.y*this.m_localAnchor1.x+j.col2.y*this.m_localAnchor1.y; -r=g.m_position.x+u;p=g.m_position.y+t;this.m_u1.Set(r-k,p-i);n=this.m_u1.Length();if(n>b2Settings.b2_linearSlop){this.m_u1.x*=1/n;this.m_u1.y*=1/n}else{this.m_u1.SetZero()}l=this.m_maxLength1-n;e=b2Math.b2Max(e,-l);l=b2Math.b2Clamp(l+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0);h=-this.m_limitMass1*l;s=this.m_limitPositionImpulse1;this.m_limitPositionImpulse1=b2Math.b2Max(0,this.m_limitPositionImpulse1+h);h=this.m_limitPositionImpulse1-s;r=-h*this.m_u1.x;p=-h*this.m_u1.y;g.m_position.x+=g.m_invMass*r;g.m_position.y+=g.m_invMass*p;g.m_rotation+=g.m_invI*(u*p-t*r);g.m_R.Set(g.m_rotation)}if(this.m_limitState2==b2Joint.e_atUpperLimit){j=f.m_R;d=j.col1.x*this.m_localAnchor2.x+j.col2.x*this.m_localAnchor2.y;c=j.col1.y*this.m_localAnchor2.x+j.col2.y*this.m_localAnchor2.y;b=f.m_position.x+d;a=f.m_position.y+c;this.m_u2.Set(b-q,a-o);m=this.m_u2.Length();if(m>b2Settings.b2_linearSlop){this.m_u2.x*=1/m;this.m_u2.y*=1/m}else{this.m_u2.SetZero()}l=this.m_maxLength2-m;e=b2Math.b2Max(e,-l); -l=b2Math.b2Clamp(l+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0);h=-this.m_limitMass2*l;s=this.m_limitPositionImpulse2;this.m_limitPositionImpulse2=b2Math.b2Max(0,this.m_limitPositionImpulse2+h);h=this.m_limitPositionImpulse2-s;b=-h*this.m_u2.x;a=-h*this.m_u2.y;f.m_position.x+=f.m_invMass*b;f.m_position.y+=f.m_invMass*a;f.m_rotation+=f.m_invI*(d*a-c*b);f.m_R.Set(f.m_rotation)}return e=this.m_upperAngle){if(this.m_limitState!=b2Joint.e_atUpperLimit){this.m_limitImpulse=0}this.m_limitState=b2Joint.e_atUpperLimit}else{this.m_limitState=b2Joint.e_inactiveLimit;this.m_limitImpulse=0}}}}else{this.m_limitImpulse=0}if(b2World.s_enableWarmStarting){h.m_linearVelocity.x-=l*this.m_ptpImpulse.x;h.m_linearVelocity.y-=l*this.m_ptpImpulse.y;h.m_angularVelocity-=c*((k*this.m_ptpImpulse.y-i*this.m_ptpImpulse.x)+this.m_motorImpulse+this.m_limitImpulse); -g.m_linearVelocity.x+=j*this.m_ptpImpulse.x;g.m_linearVelocity.y+=j*this.m_ptpImpulse.y;g.m_angularVelocity+=b*((e*this.m_ptpImpulse.y-d*this.m_ptpImpulse.x)+this.m_motorImpulse+this.m_limitImpulse)}else{this.m_ptpImpulse.SetZero();this.m_motorImpulse=0;this.m_limitImpulse=0}this.m_limitPositionImpulse=0},SolveVelocityConstraints:function(f){var g=this.m_body1;var e=this.m_body2;var i;i=g.m_R;var o=i.col1.x*this.m_localAnchor1.x+i.col2.x*this.m_localAnchor1.y;var n=i.col1.y*this.m_localAnchor1.x+i.col2.y*this.m_localAnchor1.y;i=e.m_R;var b=i.col1.x*this.m_localAnchor2.x+i.col2.x*this.m_localAnchor2.y;var a=i.col1.y*this.m_localAnchor2.x+i.col2.y*this.m_localAnchor2.y;var k;var q=e.m_linearVelocity.x+(-e.m_angularVelocity*a)-g.m_linearVelocity.x-(-g.m_angularVelocity*n);var p=e.m_linearVelocity.y+(e.m_angularVelocity*b)-g.m_linearVelocity.y-(g.m_angularVelocity*o);var m=-(this.m_ptpMass.col1.x*q+this.m_ptpMass.col2.x*p);var l=-(this.m_ptpMass.col1.y*q+this.m_ptpMass.col2.y*p);this.m_ptpImpulse.x+=m; -this.m_ptpImpulse.y+=l;g.m_linearVelocity.x-=g.m_invMass*m;g.m_linearVelocity.y-=g.m_invMass*l;g.m_angularVelocity-=g.m_invI*(o*l-n*m);e.m_linearVelocity.x+=e.m_invMass*m;e.m_linearVelocity.y+=e.m_invMass*l;e.m_angularVelocity+=e.m_invI*(b*l-a*m);if(this.m_enableMotor&&this.m_limitState!=b2Joint.e_equalLimits){var r=e.m_angularVelocity-g.m_angularVelocity-this.m_motorSpeed;var c=-this.m_motorMass*r;var d=this.m_motorImpulse;this.m_motorImpulse=b2Math.b2Clamp(this.m_motorImpulse+c,-f.dt*this.m_maxMotorTorque,f.dt*this.m_maxMotorTorque);c=this.m_motorImpulse-d;g.m_angularVelocity-=g.m_invI*c;e.m_angularVelocity+=e.m_invI*c}if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit){var h=e.m_angularVelocity-g.m_angularVelocity;var j=-this.m_motorMass*h;if(this.m_limitState==b2Joint.e_equalLimits){this.m_limitImpulse+=j}else{if(this.m_limitState==b2Joint.e_atLowerLimit){k=this.m_limitImpulse;this.m_limitImpulse=b2Math.b2Max(this.m_limitImpulse+j,0);j=this.m_limitImpulse-k}else{if(this.m_limitState==b2Joint.e_atUpperLimit){k=this.m_limitImpulse; -this.m_limitImpulse=b2Math.b2Min(this.m_limitImpulse+j,0);j=this.m_limitImpulse-k}}}g.m_angularVelocity-=g.m_invI*j;e.m_angularVelocity+=e.m_invI*j}},SolvePositionConstraints:function(){var s;var m;var l=this.m_body1;var k=this.m_body2;var o=0;var n;n=l.m_R;var y=n.col1.x*this.m_localAnchor1.x+n.col2.x*this.m_localAnchor1.y;var x=n.col1.y*this.m_localAnchor1.x+n.col2.y*this.m_localAnchor1.y;n=k.m_R;var f=n.col1.x*this.m_localAnchor2.x+n.col2.x*this.m_localAnchor2.y;var e=n.col1.y*this.m_localAnchor2.x+n.col2.y*this.m_localAnchor2.y;var u=l.m_position.x+y;var t=l.m_position.y+x;var d=k.m_position.x+f;var c=k.m_position.y+e;var j=d-u;var i=c-t;o=Math.sqrt(j*j+i*i);var q=l.m_invMass;var p=k.m_invMass;var h=l.m_invI;var g=k.m_invI;this.K1.col1.x=q+p;this.K1.col2.x=0;this.K1.col1.y=0;this.K1.col2.y=q+p;this.K2.col1.x=h*x*x;this.K2.col2.x=-h*y*x;this.K2.col1.y=-h*y*x;this.K2.col2.y=h*y*y;this.K3.col1.x=g*e*e;this.K3.col2.x=-g*f*e;this.K3.col1.y=-g*f*e;this.K3.col2.y=g*f*f;this.K.SetM(this.K1); -this.K.AddM(this.K2);this.K.AddM(this.K3);this.K.Solve(b2RevoluteJoint.tImpulse,-j,-i);var b=b2RevoluteJoint.tImpulse.x;var a=b2RevoluteJoint.tImpulse.y;l.m_position.x-=l.m_invMass*b;l.m_position.y-=l.m_invMass*a;l.m_rotation-=l.m_invI*(y*a-x*b);l.m_R.Set(l.m_rotation);k.m_position.x+=k.m_invMass*b;k.m_position.y+=k.m_invMass*a;k.m_rotation+=k.m_invI*(f*a-e*b);k.m_R.Set(k.m_rotation);var w=0;if(this.m_enableLimit&&this.m_limitState!=b2Joint.e_inactiveLimit){var v=k.m_rotation-l.m_rotation-this.m_intialAngle;var r=0;if(this.m_limitState==b2Joint.e_equalLimits){m=b2Math.b2Clamp(v,-b2Settings.b2_maxAngularCorrection,b2Settings.b2_maxAngularCorrection);r=-this.m_motorMass*m;w=b2Math.b2Abs(m)}else{if(this.m_limitState==b2Joint.e_atLowerLimit){m=v-this.m_lowerAngle;w=b2Math.b2Max(0,-m);m=b2Math.b2Clamp(m+b2Settings.b2_angularSlop,-b2Settings.b2_maxAngularCorrection,0);r=-this.m_motorMass*m;s=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Max(this.m_limitPositionImpulse+r,0); -r=this.m_limitPositionImpulse-s}else{if(this.m_limitState==b2Joint.e_atUpperLimit){m=v-this.m_upperAngle;w=b2Math.b2Max(0,m);m=b2Math.b2Clamp(m-b2Settings.b2_angularSlop,0,b2Settings.b2_maxAngularCorrection);r=-this.m_motorMass*m;s=this.m_limitPositionImpulse;this.m_limitPositionImpulse=b2Math.b2Min(this.m_limitPositionImpulse+r,0);r=this.m_limitPositionImpulse-s}}}l.m_rotation-=l.m_invI*r;l.m_R.Set(l.m_rotation);k.m_rotation+=k.m_invI*r;k.m_R.Set(k.m_rotation)}return o<=b2Settings.b2_linearSlop&&w<=b2Settings.b2_angularSlop},m_localAnchor1:new b2Vec2(),m_localAnchor2:new b2Vec2(),m_ptpImpulse:new b2Vec2(),m_motorImpulse:null,m_limitImpulse:null,m_limitPositionImpulse:null,m_ptpMass:new b2Mat22(),m_motorMass:null,m_intialAngle:null,m_lowerAngle:null,m_upperAngle:null,m_maxMotorTorque:null,m_motorSpeed:null,m_enableLimit:null,m_enableMotor:null,m_limitState:0});b2RevoluteJoint.tImpulse=new b2Vec2();var b2RevoluteJointDef=function(){this.type=b2Joint.e_unknownJoint;this.userData=null;this.body1=null;this.body2=null;this.collideConnected=false;this.type=b2Joint.e_revoluteJoint;this.anchorPoint=new b2Vec2(0,0);this.lowerAngle=0;this.upperAngle=0;this.motorTorque=0;this.motorSpeed=0;this.enableLimit=false;this.enableMotor=false};Object.extend(b2RevoluteJointDef.prototype,b2JointDef.prototype);Object.extend(b2RevoluteJointDef.prototype,{anchorPoint:null,lowerAngle:null,upperAngle:null,motorTorque:null,motorSpeed:null,enableLimit:null,enableMotor:null,Initialize:function(b,a,c){this.body1=b;this.body2=a;this.anchorPoint=c}}); \ No newline at end of file diff --git a/tutorial-4/pixi.js-master/examples/example 24 - Box2D Integration/bricks.png b/tutorial-4/pixi.js-master/examples/example 24 - Box2D Integration/bricks.png deleted file mode 100755 index 4495016..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 24 - Box2D Integration/bricks.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 24 - Box2D Integration/bunny.png b/tutorial-4/pixi.js-master/examples/example 24 - Box2D Integration/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 24 - Box2D Integration/bunny.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 24 - Box2D Integration/grass.png b/tutorial-4/pixi.js-master/examples/example 24 - Box2D Integration/grass.png deleted file mode 100755 index a9dd3a9..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 24 - Box2D Integration/grass.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 24 - Box2D Integration/index.html b/tutorial-4/pixi.js-master/examples/example 24 - Box2D Integration/index.html deleted file mode 100755 index 1cdfabf..0000000 --- a/tutorial-4/pixi.js-master/examples/example 24 - Box2D Integration/index.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - pixi.js example 24 - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 25 - Video/bunny.png b/tutorial-4/pixi.js-master/examples/example 25 - Video/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 25 - Video/bunny.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 25 - Video/index.html b/tutorial-4/pixi.js-master/examples/example 25 - Video/index.html deleted file mode 100755 index ac6fd8f..0000000 --- a/tutorial-4/pixi.js-master/examples/example 25 - Video/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - deus - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 25 - Video/testVideo.mp4 b/tutorial-4/pixi.js-master/examples/example 25 - Video/testVideo.mp4 deleted file mode 100755 index aa45029..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 25 - Video/testVideo.mp4 and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.json b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.json deleted file mode 100755 index 3e419a2..0000000 --- a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.json +++ /dev/null @@ -1,228 +0,0 @@ -{"frames": { - -"Explosion_Sequence_A 1.png": -{ - "frame": {"x":244,"y":1454,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 10.png": -{ - "frame": {"x":244,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 11.png": -{ - "frame": {"x":2,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 12.png": -{ - "frame": {"x":728,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 13.png": -{ - "frame": {"x":486,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 14.png": -{ - "frame": {"x":244,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 15.png": -{ - "frame": {"x":2,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 16.png": -{ - "frame": {"x":728,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 17.png": -{ - "frame": {"x":486,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 18.png": -{ - "frame": {"x":244,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 19.png": -{ - "frame": {"x":2,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 2.png": -{ - "frame": {"x":728,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 20.png": -{ - "frame": {"x":728,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 21.png": -{ - "frame": {"x":486,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 22.png": -{ - "frame": {"x":244,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 23.png": -{ - "frame": {"x":2,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 24.png": -{ - "frame": {"x":728,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 25.png": -{ - "frame": {"x":486,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 26.png": -{ - "frame": {"x":244,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 27.png": -{ - "frame": {"x":2,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 3.png": -{ - "frame": {"x":486,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 4.png": -{ - "frame": {"x":244,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 5.png": -{ - "frame": {"x":2,"y":1696,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 6.png": -{ - "frame": {"x":2,"y":1454,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 7.png": -{ - "frame": {"x":2,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 8.png": -{ - "frame": {"x":728,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 9.png": -{ - "frame": {"x":486,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}}, -"meta": { - "app": "http://www.texturepacker.com", - "version": "1.0", - "image": "SpriteSheet.png", - "format": "RGBA8888", - "size": {"w":1024,"h":2048}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:17e4a2d92ff3e27832c3f4938cec7c85$" -} -} diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.png deleted file mode 100755 index 79e1a69..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/SpriteSheet.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/index.html b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/index.html deleted file mode 100755 index 7c7c79e..0000000 --- a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/index.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - pixi.js example 3 using a movieclip - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/SpriteSheet.tps b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/SpriteSheet.tps deleted file mode 100755 index ba7d215..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/SpriteSheet.tps and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 1.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 1.png deleted file mode 100755 index 0e3b33a..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 1.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 10.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 10.png deleted file mode 100755 index 42629ac..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 10.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 11.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 11.png deleted file mode 100755 index f286b30..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 11.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 12.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 12.png deleted file mode 100755 index c4b19db..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 12.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 13.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 13.png deleted file mode 100755 index b57ec0c..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 13.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 14.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 14.png deleted file mode 100755 index a4c8458..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 14.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 15.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 15.png deleted file mode 100755 index 4b7e8e6..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 15.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 16.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 16.png deleted file mode 100755 index edbfd79..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 16.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 17.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 17.png deleted file mode 100755 index 2378b55..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 17.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 18.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 18.png deleted file mode 100755 index 61a13d6..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 18.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 19.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 19.png deleted file mode 100755 index a507ce1..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 19.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 2.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 2.png deleted file mode 100755 index 6cfe0d7..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 2.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 20.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 20.png deleted file mode 100755 index f371ecc..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 20.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 21.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 21.png deleted file mode 100755 index 389aa20..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 21.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 22.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 22.png deleted file mode 100755 index 5d324e5..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 22.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 23.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 23.png deleted file mode 100755 index 9e03ef7..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 23.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 24.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 24.png deleted file mode 100755 index 5a7b29e..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 24.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 25.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 25.png deleted file mode 100755 index 32fed5a..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 25.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 26.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 26.png deleted file mode 100755 index aed27f4..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 26.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 27.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 27.png deleted file mode 100755 index 03efab1..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 27.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 3.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 3.png deleted file mode 100755 index 400ef98..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 3.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 4.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 4.png deleted file mode 100755 index 13368c7..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 4.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 5.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 5.png deleted file mode 100755 index 8bbcfcd..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 5.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 6.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 6.png deleted file mode 100755 index b13a53b..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 6.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 7.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 7.png deleted file mode 100755 index 7a97e9c..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 7.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 8.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 8.png deleted file mode 100755 index 2daf240..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 8.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 9.png b/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 9.png deleted file mode 100755 index 72cd176..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 3 - MovieClip/tp/explosion/Explosion_Sequence_A 9.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 4 - Balls/assets/bubble_32x32.png b/tutorial-4/pixi.js-master/examples/example 4 - Balls/assets/bubble_32x32.png deleted file mode 100755 index 33b877e..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 4 - Balls/assets/bubble_32x32.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 4 - Balls/assets/bubble_64x64.png b/tutorial-4/pixi.js-master/examples/example 4 - Balls/assets/bubble_64x64.png deleted file mode 100755 index 573822c..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 4 - Balls/assets/bubble_64x64.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 4 - Balls/assets/photonstorm.png b/tutorial-4/pixi.js-master/examples/example 4 - Balls/assets/photonstorm.png deleted file mode 100755 index c24685b..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 4 - Balls/assets/photonstorm.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 4 - Balls/assets/pixi.png b/tutorial-4/pixi.js-master/examples/example 4 - Balls/assets/pixi.png deleted file mode 100755 index 13276bb..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 4 - Balls/assets/pixi.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 4 - Balls/index.html b/tutorial-4/pixi.js-master/examples/example 4 - Balls/index.html deleted file mode 100755 index 8f3b930..0000000 --- a/tutorial-4/pixi.js-master/examples/example 4 - Balls/index.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - Pixi Balls by Photon Storm - - - - - - - - - - -
    SX: 0
    SY: 0
    - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 4 - Balls/storm.css b/tutorial-4/pixi.js-master/examples/example 4 - Balls/storm.css deleted file mode 100755 index 2807f21..0000000 --- a/tutorial-4/pixi.js-master/examples/example 4 - Balls/storm.css +++ /dev/null @@ -1,34 +0,0 @@ -body { - margin: 0; - padding: 0; - background-color: #000000; -} - -#rnd { - position: absolute; - top: 16px; - left: 16px; -} - -#photonstorm { - position: absolute; - bottom: 16px; - right: 16px; -} - -#pixi { - position: absolute; - bottom: 16px; - left: 16px; -} - -#sx { - position: absolute; - top: 16px; - right: 16px; - width: 200px; - height: 48px; - font-size: 12px; - font-family: Arial; - color: rgba(255,255,255,0.8); -} diff --git a/tutorial-4/pixi.js-master/examples/example 5 - Morph/assets/photonstorm.png b/tutorial-4/pixi.js-master/examples/example 5 - Morph/assets/photonstorm.png deleted file mode 100755 index c24685b..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 5 - Morph/assets/photonstorm.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 5 - Morph/assets/pixel.png b/tutorial-4/pixi.js-master/examples/example 5 - Morph/assets/pixel.png deleted file mode 100755 index 5fdbb86..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 5 - Morph/assets/pixel.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 5 - Morph/assets/pixi.png b/tutorial-4/pixi.js-master/examples/example 5 - Morph/assets/pixi.png deleted file mode 100755 index 13276bb..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 5 - Morph/assets/pixi.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 5 - Morph/index.html b/tutorial-4/pixi.js-master/examples/example 5 - Morph/index.html deleted file mode 100755 index 8cf6639..0000000 --- a/tutorial-4/pixi.js-master/examples/example 5 - Morph/index.html +++ /dev/null @@ -1,312 +0,0 @@ - - - - Pixi Morph by Photon Storm - - - - - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 5 - Morph/storm.css b/tutorial-4/pixi.js-master/examples/example 5 - Morph/storm.css deleted file mode 100755 index 625022e..0000000 --- a/tutorial-4/pixi.js-master/examples/example 5 - Morph/storm.css +++ /dev/null @@ -1,17 +0,0 @@ -body { - margin: 0; - padding: 0; - background-color: #000000; -} - -#photonstorm { - position: absolute; - bottom: 16px; - right: 16px; -} - -#pixi { - position: absolute; - bottom: 16px; - left: 16px; -} diff --git a/tutorial-4/pixi.js-master/examples/example 6 - Interactivity/button.png b/tutorial-4/pixi.js-master/examples/example 6 - Interactivity/button.png deleted file mode 100755 index b0cd012..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 6 - Interactivity/button.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 6 - Interactivity/buttonDown.png b/tutorial-4/pixi.js-master/examples/example 6 - Interactivity/buttonDown.png deleted file mode 100755 index 643b757..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 6 - Interactivity/buttonDown.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 6 - Interactivity/buttonOver.png b/tutorial-4/pixi.js-master/examples/example 6 - Interactivity/buttonOver.png deleted file mode 100755 index 8117a2d..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 6 - Interactivity/buttonOver.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 6 - Interactivity/button_test_BG.jpg b/tutorial-4/pixi.js-master/examples/example 6 - Interactivity/button_test_BG.jpg deleted file mode 100755 index 0449cbb..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 6 - Interactivity/button_test_BG.jpg and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 6 - Interactivity/index.html b/tutorial-4/pixi.js-master/examples/example 6 - Interactivity/index.html deleted file mode 100755 index 29bd4cf..0000000 --- a/tutorial-4/pixi.js-master/examples/example 6 - Interactivity/index.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - pixi.js example 6 Interactivity - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 6 - Interactivity/pixi.png b/tutorial-4/pixi.js-master/examples/example 6 - Interactivity/pixi.png deleted file mode 100755 index 13276bb..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 6 - Interactivity/pixi.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 7 - Transparent Background/bunny.png b/tutorial-4/pixi.js-master/examples/example 7 - Transparent Background/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 7 - Transparent Background/bunny.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 7 - Transparent Background/index.html b/tutorial-4/pixi.js-master/examples/example 7 - Transparent Background/index.html deleted file mode 100755 index 305c3bd..0000000 --- a/tutorial-4/pixi.js-master/examples/example 7 - Transparent Background/index.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - pixi.js example 7 transparency - - - - -
    Hi there, I'm some HTML text... blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah - blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
    - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 7 - Transparent Background/shapeTris.png b/tutorial-4/pixi.js-master/examples/example 7 - Transparent Background/shapeTris.png deleted file mode 100755 index 426ff68..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 7 - Transparent Background/shapeTris.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 8 - Dragging/bunny.png b/tutorial-4/pixi.js-master/examples/example 8 - Dragging/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 8 - Dragging/bunny.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/example 8 - Dragging/index.html b/tutorial-4/pixi.js-master/examples/example 8 - Dragging/index.html deleted file mode 100755 index 69352af..0000000 --- a/tutorial-4/pixi.js-master/examples/example 8 - Dragging/index.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - pixi.js example 8 Dragging - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 9 - Tiling Texture/index.html b/tutorial-4/pixi.js-master/examples/example 9 - Tiling Texture/index.html deleted file mode 100755 index 411ded9..0000000 --- a/tutorial-4/pixi.js-master/examples/example 9 - Tiling Texture/index.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - pixi.js example 9 Tiling Texture - - - - - - - - diff --git a/tutorial-4/pixi.js-master/examples/example 9 - Tiling Texture/p2.jpeg b/tutorial-4/pixi.js-master/examples/example 9 - Tiling Texture/p2.jpeg deleted file mode 100755 index 4943288..0000000 Binary files a/tutorial-4/pixi.js-master/examples/example 9 - Tiling Texture/p2.jpeg and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/test/bunny.png b/tutorial-4/pixi.js-master/examples/test/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-4/pixi.js-master/examples/test/bunny.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/examples/test/index.html b/tutorial-4/pixi.js-master/examples/test/index.html deleted file mode 100755 index f1009cb..0000000 --- a/tutorial-4/pixi.js-master/examples/test/index.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - pixi.js test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tutorial-4/pixi.js-master/logo.png b/tutorial-4/pixi.js-master/logo.png deleted file mode 100755 index 654d77f..0000000 Binary files a/tutorial-4/pixi.js-master/logo.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/logo_small.png b/tutorial-4/pixi.js-master/logo_small.png deleted file mode 100755 index f7c1f4f..0000000 Binary files a/tutorial-4/pixi.js-master/logo_small.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/package.json b/tutorial-4/pixi.js-master/package.json deleted file mode 100755 index 463e77c..0000000 --- a/tutorial-4/pixi.js-master/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "pixi.js", - "version": "2.2.7", - "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", - "author": "Mat Groves", - "contributors": [ - "Chad Engler " - ], - "logo": "http://www.goodboydigital.com/pixijs/logo_small.png", - "homepage": "http://goodboydigital.com/", - "bugs": "https://github.com/GoodBoyDigital/pixi.js/issues", - "license": "MIT", - "licenseUrl": "http://www.opensource.org/licenses/mit-license.php", - "repository": { - "type": "git", - "url": "https://github.com/GoodBoyDigital/pixi.js.git" - }, - "main": "bin/pixi.dev.js", - "scripts": { - "test": "grunt travis --verbose" - }, - "dependencies": {}, - "devDependencies": { - "grunt": "~0.4.1", - "grunt-contrib-jshint": "~0.8", - "grunt-contrib-uglify": "~0.2", - "grunt-contrib-connect": "~0.5", - "grunt-contrib-yuidoc": "~0.5", - "grunt-concat-sourcemap": "~0.4", - "grunt-contrib-concat": "~0.3", - "mocha": "~1.15", - "chai": "~1.8", - "karma": "~0.12", - "karma-chrome-launcher": "~0.1", - "karma-firefox-launcher": "~0.1", - "karma-mocha": "~0.1", - "karma-spec-reporter": "~0.0.6", - "grunt-contrib-watch": "~0.5.3" - } -} diff --git a/tutorial-4/pixi.js-master/src/pixi/InteractionData.js b/tutorial-4/pixi.js-master/src/pixi/InteractionData.js deleted file mode 100755 index b0d8a6a..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/InteractionData.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Holds all information related to an Interaction event - * - * @class InteractionData - * @constructor - */ -PIXI.InteractionData = function() -{ - /** - * This point stores the global coords of where the touch/mouse event happened - * - * @property global - * @type Point - */ - this.global = new PIXI.Point(); - - /** - * The target Sprite that was interacted with - * - * @property target - * @type Sprite - */ - this.target = null; - - /** - * When passed to an event handler, this will be the original DOM Event that was captured - * - * @property originalEvent - * @type Event - */ - this.originalEvent = null; -}; - -/** - * This will return the local coordinates of the specified displayObject for this InteractionData - * - * @method getLocalPosition - * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off - * @param [point] {Point} A Point object in which to store the value, optional (otherwise will create a new point) - * @return {Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject - */ -PIXI.InteractionData.prototype.getLocalPosition = function(displayObject, point) -{ - var worldTransform = displayObject.worldTransform; - var global = this.global; - - // do a cheeky transform to get the mouse coords; - var a00 = worldTransform.a, a01 = worldTransform.c, a02 = worldTransform.tx, - a10 = worldTransform.b, a11 = worldTransform.d, a12 = worldTransform.ty, - id = 1 / (a00 * a11 + a01 * -a10); - - point = point || new PIXI.Point(); - - point.x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id; - point.y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; - - // set the mouse coords... - return point; -}; - -// constructor -PIXI.InteractionData.prototype.constructor = PIXI.InteractionData; diff --git a/tutorial-4/pixi.js-master/src/pixi/InteractionManager.js b/tutorial-4/pixi.js-master/src/pixi/InteractionManager.js deleted file mode 100755 index 646d0a8..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/InteractionManager.js +++ /dev/null @@ -1,944 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - - /** - * The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive - * if its interactive parameter is set to true - * This manager also supports multitouch. - * - * @class InteractionManager - * @constructor - * @param stage {Stage} The stage to handle interactions - */ -PIXI.InteractionManager = function(stage) -{ - /** - * A reference to the stage - * - * @property stage - * @type Stage - */ - this.stage = stage; - - /** - * The mouse data - * - * @property mouse - * @type InteractionData - */ - this.mouse = new PIXI.InteractionData(); - - /** - * An object that stores current touches (InteractionData) by id reference - * - * @property touches - * @type Object - */ - this.touches = {}; - - /** - * @property tempPoint - * @type Point - * @private - */ - this.tempPoint = new PIXI.Point(); - - /** - * @property mouseoverEnabled - * @type Boolean - * @default - */ - this.mouseoverEnabled = true; - - /** - * Tiny little interactiveData pool ! - * - * @property pool - * @type Array - */ - this.pool = []; - - /** - * An array containing all the iterative items from the our interactive tree - * @property interactiveItems - * @type Array - * @private - */ - this.interactiveItems = []; - - /** - * Our canvas - * @property interactionDOMElement - * @type HTMLCanvasElement - * @private - */ - this.interactionDOMElement = null; - - //this will make it so that you don't have to call bind all the time - - /** - * @property onMouseMove - * @type Function - */ - this.onMouseMove = this.onMouseMove.bind( this ); - - /** - * @property onMouseDown - * @type Function - */ - this.onMouseDown = this.onMouseDown.bind(this); - - /** - * @property onMouseOut - * @type Function - */ - this.onMouseOut = this.onMouseOut.bind(this); - - /** - * @property onMouseUp - * @type Function - */ - this.onMouseUp = this.onMouseUp.bind(this); - - /** - * @property onTouchStart - * @type Function - */ - this.onTouchStart = this.onTouchStart.bind(this); - - /** - * @property onTouchEnd - * @type Function - */ - this.onTouchEnd = this.onTouchEnd.bind(this); - - /** - * @property onTouchCancel - * @type Function - */ - this.onTouchCancel = this.onTouchCancel.bind(this); - - /** - * @property onTouchMove - * @type Function - */ - this.onTouchMove = this.onTouchMove.bind(this); - - /** - * @property last - * @type Number - */ - this.last = 0; - - /** - * The css style of the cursor that is being used - * @property currentCursorStyle - * @type String - */ - this.currentCursorStyle = 'inherit'; - - /** - * Is set to true when the mouse is moved out of the canvas - * @property mouseOut - * @type Boolean - */ - this.mouseOut = false; - - /** - * @property resolution - * @type Number - */ - this.resolution = 1; - - // used for hit testing - this._tempPoint = new PIXI.Point(); -}; - -// constructor -PIXI.InteractionManager.prototype.constructor = PIXI.InteractionManager; - -/** - * Collects an interactive sprite recursively to have their interactions managed - * - * @method collectInteractiveSprite - * @param displayObject {DisplayObject} the displayObject to collect - * @param iParent {DisplayObject} the display object's parent - * @private - */ -PIXI.InteractionManager.prototype.collectInteractiveSprite = function(displayObject, iParent) -{ - var children = displayObject.children; - var length = children.length; - - // make an interaction tree... {item.__interactiveParent} - for (var i = length - 1; i >= 0; i--) - { - var child = children[i]; - - // push all interactive bits - if (child._interactive) - { - iParent.interactiveChildren = true; - //child.__iParent = iParent; - this.interactiveItems.push(child); - - if (child.children.length > 0) { - this.collectInteractiveSprite(child, child); - } - } - else - { - child.__iParent = null; - if (child.children.length > 0) - { - this.collectInteractiveSprite(child, iParent); - } - } - - } -}; - -/** - * Sets the target for event delegation - * - * @method setTarget - * @param target {WebGLRenderer|CanvasRenderer} the renderer to bind events to - * @private - */ -PIXI.InteractionManager.prototype.setTarget = function(target) -{ - this.target = target; - this.resolution = target.resolution; - - // Check if the dom element has been set. If it has don't do anything. - if (this.interactionDOMElement !== null) return; - - this.setTargetDomElement (target.view); -}; - -/** - * Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM - * elements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element - * to receive those events - * - * @method setTargetDomElement - * @param domElement {DOMElement} the DOM element which will receive mouse and touch events - * @private - */ -PIXI.InteractionManager.prototype.setTargetDomElement = function(domElement) -{ - this.removeEvents(); - - if (window.navigator.msPointerEnabled) - { - // time to remove some of that zoom in ja.. - domElement.style['-ms-content-zooming'] = 'none'; - domElement.style['-ms-touch-action'] = 'none'; - } - - this.interactionDOMElement = domElement; - - domElement.addEventListener('mousemove', this.onMouseMove, true); - domElement.addEventListener('mousedown', this.onMouseDown, true); - domElement.addEventListener('mouseout', this.onMouseOut, true); - - // aint no multi touch just yet! - domElement.addEventListener('touchstart', this.onTouchStart, true); - domElement.addEventListener('touchend', this.onTouchEnd, true); - domElement.addEventListener('touchleave', this.onTouchCancel, true); - domElement.addEventListener('touchcancel', this.onTouchCancel, true); - domElement.addEventListener('touchmove', this.onTouchMove, true); - - window.addEventListener('mouseup', this.onMouseUp, true); -}; - -/** - * @method removeEvents - * @private - */ -PIXI.InteractionManager.prototype.removeEvents = function() -{ - if (!this.interactionDOMElement) return; - - this.interactionDOMElement.style['-ms-content-zooming'] = ''; - this.interactionDOMElement.style['-ms-touch-action'] = ''; - - this.interactionDOMElement.removeEventListener('mousemove', this.onMouseMove, true); - this.interactionDOMElement.removeEventListener('mousedown', this.onMouseDown, true); - this.interactionDOMElement.removeEventListener('mouseout', this.onMouseOut, true); - - // aint no multi touch just yet! - this.interactionDOMElement.removeEventListener('touchstart', this.onTouchStart, true); - this.interactionDOMElement.removeEventListener('touchend', this.onTouchEnd, true); - this.interactionDOMElement.removeEventListener('touchleave', this.onTouchCancel, true); - this.interactionDOMElement.removeEventListener('touchcancel', this.onTouchCancel, true); - this.interactionDOMElement.removeEventListener('touchmove', this.onTouchMove, true); - - this.interactionDOMElement = null; - - window.removeEventListener('mouseup', this.onMouseUp, true); -}; - -/** - * updates the state of interactive objects - * - * @method update - * @private - */ -PIXI.InteractionManager.prototype.update = function() -{ - if (!this.target) return; - - // frequency of 30fps?? - var now = Date.now(); - var diff = now - this.last; - diff = (diff * PIXI.INTERACTION_FREQUENCY ) / 1000; - if (diff < 1) return; - this.last = now; - - var i = 0; - - // ok.. so mouse events?? - // yes for now :) - // OPTIMISE - how often to check?? - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - // loop through interactive objects! - var length = this.interactiveItems.length; - var cursor = 'inherit'; - var over = false; - - for (i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - // OPTIMISATION - only calculate every time if the mousemove function exists.. - // OK so.. does the object have any other interactive functions? - // hit-test the clip! - // if (item.mouseover || item.mouseout || item.buttonMode) - // { - // ok so there are some functions so lets hit test it.. - item.__hit = this.hitTest(item, this.mouse); - this.mouse.target = item; - // ok so deal with interactions.. - // looks like there was a hit! - if (item.__hit && !over) - { - if (item.buttonMode) cursor = item.defaultCursor; - - if (!item.interactiveChildren) - { - over = true; - } - - if (!item.__isOver) - { - if (item.mouseover) - { - item.mouseover (this.mouse); - } - item.__isOver = true; - } - } - else - { - if (item.__isOver) - { - // roll out! - if (item.mouseout) - { - item.mouseout (this.mouse); - } - item.__isOver = false; - } - } - } - - if (this.currentCursorStyle !== cursor) - { - this.currentCursorStyle = cursor; - this.interactionDOMElement.style.cursor = cursor; - } -}; - -/** - * @method rebuildInteractiveGraph - * @private - */ -PIXI.InteractionManager.prototype.rebuildInteractiveGraph = function() -{ - this.dirty = false; - - var len = this.interactiveItems.length; - - for (var i = 0; i < len; i++) { - this.interactiveItems[i].interactiveChildren = false; - } - - this.interactiveItems = []; - - if (this.stage.interactive) - { - this.interactiveItems.push(this.stage); - } - - // Go through and collect all the objects that are interactive.. - this.collectInteractiveSprite(this.stage, this.stage); -}; - -/** - * Is called when the mouse moves across the renderer element - * - * @method onMouseMove - * @param event {Event} The DOM event of the mouse moving - * @private - */ -PIXI.InteractionManager.prototype.onMouseMove = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - // TODO optimize by not check EVERY TIME! maybe half as often? // - var rect = this.interactionDOMElement.getBoundingClientRect(); - - this.mouse.global.x = (event.clientX - rect.left) * (this.target.width / rect.width) / this.resolution; - this.mouse.global.y = (event.clientY - rect.top) * ( this.target.height / rect.height) / this.resolution; - - var length = this.interactiveItems.length; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - // Call the function! - if (item.mousemove) - { - item.mousemove(this.mouse); - } - } -}; - -/** - * Is called when the mouse button is pressed down on the renderer element - * - * @method onMouseDown - * @param event {Event} The DOM event of a mouse button being pressed down - * @private - */ -PIXI.InteractionManager.prototype.onMouseDown = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - if (PIXI.AUTO_PREVENT_DEFAULT) - { - this.mouse.originalEvent.preventDefault(); - } - - // loop through interaction tree... - // hit test each item! -> - // get interactive items under point?? - //stage.__i - var length = this.interactiveItems.length; - - var e = this.mouse.originalEvent; - var isRightButton = e.button === 2 || e.which === 3; - var downFunction = isRightButton ? 'rightdown' : 'mousedown'; - var clickFunction = isRightButton ? 'rightclick' : 'click'; - var buttonIsDown = isRightButton ? '__rightIsDown' : '__mouseIsDown'; - var isDown = isRightButton ? '__isRightDown' : '__isDown'; - - // while - // hit test - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - if (item[downFunction] || item[clickFunction]) - { - item[buttonIsDown] = true; - item.__hit = this.hitTest(item, this.mouse); - - if (item.__hit) - { - //call the function! - if (item[downFunction]) - { - item[downFunction](this.mouse); - } - item[isDown] = true; - - // just the one! - if (!item.interactiveChildren) break; - } - } - } -}; - -/** - * Is called when the mouse is moved out of the renderer element - * - * @method onMouseOut - * @param event {Event} The DOM event of a mouse being moved out - * @private - */ -PIXI.InteractionManager.prototype.onMouseOut = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - var length = this.interactiveItems.length; - - this.interactionDOMElement.style.cursor = 'inherit'; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - if (item.__isOver) - { - this.mouse.target = item; - if (item.mouseout) - { - item.mouseout(this.mouse); - } - item.__isOver = false; - } - } - - this.mouseOut = true; - - // move the mouse to an impossible position - this.mouse.global.x = -10000; - this.mouse.global.y = -10000; -}; - -/** - * Is called when the mouse button is released on the renderer element - * - * @method onMouseUp - * @param event {Event} The DOM event of a mouse button being released - * @private - */ -PIXI.InteractionManager.prototype.onMouseUp = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - this.mouse.originalEvent = event; - - var length = this.interactiveItems.length; - var up = false; - - var e = this.mouse.originalEvent; - var isRightButton = e.button === 2 || e.which === 3; - - var upFunction = isRightButton ? 'rightup' : 'mouseup'; - var clickFunction = isRightButton ? 'rightclick' : 'click'; - var upOutsideFunction = isRightButton ? 'rightupoutside' : 'mouseupoutside'; - var isDown = isRightButton ? '__isRightDown' : '__isDown'; - - for (var i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - - if (item[clickFunction] || item[upFunction] || item[upOutsideFunction]) - { - item.__hit = this.hitTest(item, this.mouse); - - if (item.__hit && !up) - { - //call the function! - if (item[upFunction]) - { - item[upFunction](this.mouse); - } - if (item[isDown]) - { - if (item[clickFunction]) - { - item[clickFunction](this.mouse); - } - } - - if (!item.interactiveChildren) - { - up = true; - } - } - else - { - if (item[isDown]) - { - if (item[upOutsideFunction]) item[upOutsideFunction](this.mouse); - } - } - - item[isDown] = false; - } - } -}; - -/** - * Tests if the current mouse coordinates hit a sprite - * - * @method hitTest - * @param item {DisplayObject} The displayObject to test for a hit - * @param interactionData {InteractionData} The interactionData object to update in the case there is a hit - * @private - */ -PIXI.InteractionManager.prototype.hitTest = function(item, interactionData) -{ - var global = interactionData.global; - - if (!item.worldVisible) - { - return false; - } - - // map the global point to local space. - item.worldTransform.applyInverse(global, this._tempPoint); - - var x = this._tempPoint.x, - y = this._tempPoint.y, - i; - - interactionData.target = item; - - //a sprite or display object with a hit area defined - if (item.hitArea && item.hitArea.contains) - { - return item.hitArea.contains(x, y); - } - // a sprite with no hitarea defined - else if(item instanceof PIXI.Sprite) - { - var width = item.texture.frame.width; - var height = item.texture.frame.height; - var x1 = -width * item.anchor.x; - var y1; - - if (x > x1 && x < x1 + width) - { - y1 = -height * item.anchor.y; - - if (y > y1 && y < y1 + height) - { - // set the target property if a hit is true! - return true; - } - } - } - else if(item instanceof PIXI.Graphics) - { - var graphicsData = item.graphicsData; - for (i = 0; i < graphicsData.length; i++) - { - var data = graphicsData[i]; - if(!data.fill)continue; - - // only deal with fills.. - if(data.shape) - { - if(data.shape.contains(x, y)) - { - //interactionData.target = item; - return true; - } - } - } - } - - var length = item.children.length; - - for (i = 0; i < length; i++) - { - var tempItem = item.children[i]; - var hit = this.hitTest(tempItem, interactionData); - if (hit) - { - // hmm.. TODO SET CORRECT TARGET? - interactionData.target = item; - return true; - } - } - return false; -}; - -/** - * Is called when a touch is moved across the renderer element - * - * @method onTouchMove - * @param event {Event} The DOM event of a touch moving across the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchMove = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - var touchData; - var i = 0; - - for (i = 0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - touchData = this.touches[touchEvent.identifier]; - touchData.originalEvent = event; - - // update the touch position - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - for (var j = 0; j < this.interactiveItems.length; j++) - { - var item = this.interactiveItems[j]; - if (item.touchmove && item.__touchData && item.__touchData[touchEvent.identifier]) - { - item.touchmove(touchData); - } - } - } -}; - -/** - * Is called when a touch is started on the renderer element - * - * @method onTouchStart - * @param event {Event} The DOM event of a touch starting on the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchStart = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - - if (PIXI.AUTO_PREVENT_DEFAULT) - { - event.preventDefault(); - } - - var changedTouches = event.changedTouches; - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - - var touchData = this.pool.pop(); - if (!touchData) - { - touchData = new PIXI.InteractionData(); - } - - touchData.originalEvent = event; - - this.touches[touchEvent.identifier] = touchData; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.touchstart || item.tap) - { - item.__hit = this.hitTest(item, touchData); - - if (item.__hit) - { - //call the function! - if (item.touchstart)item.touchstart(touchData); - item.__isDown = true; - item.__touchData = item.__touchData || {}; - item.__touchData[touchEvent.identifier] = touchData; - - if (!item.interactiveChildren) break; - } - } - } - } -}; - -/** - * Is called when a touch is ended on the renderer element - * - * @method onTouchEnd - * @param event {Event} The DOM event of a touch ending on the renderer view - * @private - */ -PIXI.InteractionManager.prototype.onTouchEnd = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - var touchData = this.touches[touchEvent.identifier]; - var up = false; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.__touchData && item.__touchData[touchEvent.identifier]) - { - - item.__hit = this.hitTest(item, item.__touchData[touchEvent.identifier]); - - // so this one WAS down... - touchData.originalEvent = event; - // hitTest?? - - if (item.touchend || item.tap) - { - if (item.__hit && !up) - { - if (item.touchend) - { - item.touchend(touchData); - } - if (item.__isDown && item.tap) - { - item.tap(touchData); - } - if (!item.interactiveChildren) - { - up = true; - } - } - else - { - if (item.__isDown && item.touchendoutside) - { - item.touchendoutside(touchData); - } - } - - item.__isDown = false; - } - - item.__touchData[touchEvent.identifier] = null; - } - } - // remove the touch.. - this.pool.push(touchData); - this.touches[touchEvent.identifier] = null; - } -}; - -/** - * Is called when a touch is canceled - * - * @method onTouchCancel - * @param event {Event} The DOM event of a touch canceled - * @private - */ -PIXI.InteractionManager.prototype.onTouchCancel = function(event) -{ - if (this.dirty) - { - this.rebuildInteractiveGraph(); - } - - var rect = this.interactionDOMElement.getBoundingClientRect(); - var changedTouches = event.changedTouches; - - for (var i=0; i < changedTouches.length; i++) - { - var touchEvent = changedTouches[i]; - var touchData = this.touches[touchEvent.identifier]; - var up = false; - touchData.global.x = ( (touchEvent.clientX - rect.left) * (this.target.width / rect.width) ) / this.resolution; - touchData.global.y = ( (touchEvent.clientY - rect.top) * (this.target.height / rect.height) ) / this.resolution; - if (navigator.isCocoonJS && !rect.left && !rect.top && !event.target.style.width && !event.target.style.height) - { - //Support for CocoonJS fullscreen scale modes - touchData.global.x = touchEvent.clientX; - touchData.global.y = touchEvent.clientY; - } - - var length = this.interactiveItems.length; - for (var j = 0; j < length; j++) - { - var item = this.interactiveItems[j]; - - if (item.__touchData && item.__touchData[touchEvent.identifier]) - { - - item.__hit = this.hitTest(item, item.__touchData[touchEvent.identifier]); - - // so this one WAS down... - touchData.originalEvent = event; - // hitTest?? - - if (item.touchcancel && !up) - { - item.touchcancel(touchData); - if (!item.interactiveChildren) - { - up = true; - } - } - - item.__isDown = false; - item.__touchData[touchEvent.identifier] = null; - } - } - // remove the touch.. - this.pool.push(touchData); - this.touches[touchEvent.identifier] = null; - } -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/Intro.js b/tutorial-4/pixi.js-master/src/pixi/Intro.js deleted file mode 100755 index 07d01da..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/Intro.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -(function(){ - - var root = this; diff --git a/tutorial-4/pixi.js-master/src/pixi/Outro.js b/tutorial-4/pixi.js-master/src/pixi/Outro.js deleted file mode 100755 index bf38bbc..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/Outro.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @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 if (typeof define !== 'undefined' && define.amd) { - define(PIXI); - } else { - root.PIXI = PIXI; - } -}).call(this); \ No newline at end of file diff --git a/tutorial-4/pixi.js-master/src/pixi/Pixi.js b/tutorial-4/pixi.js-master/src/pixi/Pixi.js deleted file mode 100755 index 1b17b5c..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/Pixi.js +++ /dev/null @@ -1,213 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The [pixi.js](http://www.pixijs.com/) module/namespace. - * - * @module PIXI - */ - -/** - * Namespace-class for [pixi.js](http://www.pixijs.com/). - * - * Contains assorted static properties and enumerations. - * - * @class PIXI - * @static - */ -var PIXI = PIXI || {}; - -/** - * @property {Number} WEBGL_RENDERER - * @protected - * @static - */ -PIXI.WEBGL_RENDERER = 0; -/** - * @property {Number} CANVAS_RENDERER - * @protected - * @static - */ -PIXI.CANVAS_RENDERER = 1; - -/** - * Version of pixi that is loaded. - * @property {String} VERSION - * @static - */ -PIXI.VERSION = "v2.2.7"; - -/** - * Various blend modes supported by pixi. IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes. - * @property {Object} blendModes - * @property {Number} blendModes.NORMAL - * @property {Number} blendModes.ADD - * @property {Number} blendModes.MULTIPLY - * @property {Number} blendModes.SCREEN - * @property {Number} blendModes.OVERLAY - * @property {Number} blendModes.DARKEN - * @property {Number} blendModes.LIGHTEN - * @property {Number} blendModes.COLOR_DODGE - * @property {Number} blendModes.COLOR_BURN - * @property {Number} blendModes.HARD_LIGHT - * @property {Number} blendModes.SOFT_LIGHT - * @property {Number} blendModes.DIFFERENCE - * @property {Number} blendModes.EXCLUSION - * @property {Number} blendModes.HUE - * @property {Number} blendModes.SATURATION - * @property {Number} blendModes.COLOR - * @property {Number} blendModes.LUMINOSITY - * @static - */ -PIXI.blendModes = { - NORMAL:0, - ADD:1, - MULTIPLY:2, - SCREEN:3, - OVERLAY:4, - DARKEN:5, - LIGHTEN:6, - COLOR_DODGE:7, - COLOR_BURN:8, - HARD_LIGHT:9, - SOFT_LIGHT:10, - DIFFERENCE:11, - EXCLUSION:12, - HUE:13, - SATURATION:14, - COLOR:15, - LUMINOSITY:16 -}; - -/** - * The scale modes that are supported by pixi. - * - * The DEFAULT scale mode affects the default scaling mode of future operations. - * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. - * - * @property {Object} scaleModes - * @property {Number} scaleModes.DEFAULT=LINEAR - * @property {Number} scaleModes.LINEAR Smooth scaling - * @property {Number} scaleModes.NEAREST Pixelating scaling - * @static - */ -PIXI.scaleModes = { - DEFAULT:0, - LINEAR:0, - NEAREST:1 -}; - -// used to create uids for various pixi objects.. -PIXI._UID = 0; - -if(typeof(Float32Array) != 'undefined') -{ - PIXI.Float32Array = Float32Array; - PIXI.Uint16Array = Uint16Array; - - // Uint32Array and ArrayBuffer only used by WebGL renderer - // We can suppose that if WebGL is supported then typed arrays are supported too - // as they predate WebGL support for all browsers: - // see typed arrays support: http://caniuse.com/#search=TypedArrays - // see WebGL support: http://caniuse.com/#search=WebGL - PIXI.Uint32Array = Uint32Array; - PIXI.ArrayBuffer = ArrayBuffer; -} -else -{ - PIXI.Float32Array = Array; - PIXI.Uint16Array = Array; -} - -// interaction frequency -PIXI.INTERACTION_FREQUENCY = 30; -PIXI.AUTO_PREVENT_DEFAULT = true; - -/** - * @property {Number} PI_2 - * @static - */ -PIXI.PI_2 = Math.PI * 2; - -/** - * @property {Number} RAD_TO_DEG - * @static - */ -PIXI.RAD_TO_DEG = 180 / Math.PI; - -/** - * @property {Number} DEG_TO_RAD - * @static - */ -PIXI.DEG_TO_RAD = Math.PI / 180; - -/** - * @property {String} RETINA_PREFIX - * @protected - * @static - */ -PIXI.RETINA_PREFIX = "@2x"; -//PIXI.SCALE_PREFIX "@x%%"; - -/** - * If true the default pixi startup (console) banner message will be suppressed. - * - * @property {Boolean} dontSayHello - * @default false - * @static - */ -PIXI.dontSayHello = false; - -/** - * The default render options if none are supplied to - * {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}. - * - * @property {Object} defaultRenderOptions - * @property {Object} defaultRenderOptions.view=null - * @property {Boolean} defaultRenderOptions.transparent=false - * @property {Boolean} defaultRenderOptions.antialias=false - * @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false - * @property {Number} defaultRenderOptions.resolution=1 - * @property {Boolean} defaultRenderOptions.clearBeforeRender=true - * @property {Boolean} defaultRenderOptions.autoResize=false - * @static - */ -PIXI.defaultRenderOptions = { - view:null, - transparent:false, - antialias:false, - preserveDrawingBuffer:false, - resolution:1, - clearBeforeRender:true, - autoResize:false -} - -PIXI.sayHello = function (type) -{ - if(PIXI.dontSayHello)return; - - if ( navigator.userAgent.toLowerCase().indexOf('chrome') > -1 ) - { - var args = [ - '%c %c %c Pixi.js ' + PIXI.VERSION + ' - ' + type + ' %c ' + ' %c ' + ' http://www.pixijs.com/ %c %c ♥%c♥%c♥ ', - 'background: #ff66a5', - 'background: #ff66a5', - 'color: #ff66a5; background: #030307;', - 'background: #ff66a5', - 'background: #ffc3dc', - 'background: #ff66a5', - 'color: #ff2424; background: #fff', - 'color: #ff2424; background: #fff', - 'color: #ff2424; background: #fff' - ]; - - console.log.apply(console, args); - } - else if (window['console']) - { - console.log('Pixi.js ' + PIXI.VERSION + ' - http://www.pixijs.com/'); - } - - PIXI.dontSayHello = true; -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/display/DisplayObject.js b/tutorial-4/pixi.js-master/src/pixi/display/DisplayObject.js deleted file mode 100755 index 58b375c..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/display/DisplayObject.js +++ /dev/null @@ -1,765 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The base class for all objects that are rendered on the screen. - * This is an abstract class and should not be used on its own rather it should be extended. - * - * @class DisplayObject - * @constructor - */ -PIXI.DisplayObject = function() -{ - /** - * The coordinate of the object relative to the local coordinates of the parent. - * - * @property position - * @type Point - */ - this.position = new PIXI.Point(); - - /** - * The scale factor of the object. - * - * @property scale - * @type Point - */ - this.scale = new PIXI.Point(1,1);//{x:1, y:1}; - - /** - * The pivot point of the displayObject that it rotates around - * - * @property pivot - * @type Point - */ - this.pivot = new PIXI.Point(0,0); - - /** - * The rotation of the object in radians. - * - * @property rotation - * @type Number - */ - this.rotation = 0; - - /** - * The opacity of the object. - * - * @property alpha - * @type Number - */ - this.alpha = 1; - - /** - * The visibility of the object. - * - * @property visible - * @type Boolean - */ - this.visible = true; - - /** - * This is the defined area that will pick up mouse / touch events. It is null by default. - * Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children) - * - * @property hitArea - * @type Rectangle|Circle|Ellipse|Polygon - */ - this.hitArea = null; - - /** - * This is used to indicate if the displayObject should display a mouse hand cursor on rollover - * - * @property buttonMode - * @type Boolean - */ - this.buttonMode = false; - - /** - * Can this object be rendered - * - * @property renderable - * @type Boolean - */ - this.renderable = false; - - /** - * [read-only] The display object container that contains this display object. - * - * @property parent - * @type DisplayObjectContainer - * @readOnly - */ - this.parent = null; - - /** - * [read-only] The stage the display object is connected to, or undefined if it is not connected to the stage. - * - * @property stage - * @type Stage - * @readOnly - */ - this.stage = null; - - /** - * [read-only] The multiplied alpha of the displayObject - * - * @property worldAlpha - * @type Number - * @readOnly - */ - this.worldAlpha = 1; - - /** - * [read-only] Whether or not the object is interactive, do not toggle directly! use the `interactive` property - * - * @property _interactive - * @type Boolean - * @readOnly - * @private - */ - this._interactive = false; - - /** - * This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true - * - * @property defaultCursor - * @type String - * - */ - this.defaultCursor = 'pointer'; - - /** - * [read-only] Current transform of the object based on world (parent) factors - * - * @property worldTransform - * @type Matrix - * @readOnly - * @private - */ - this.worldTransform = new PIXI.Matrix(); - - /** - * cached sin rotation and cos rotation - * - * @property _sr - * @type Number - * @private - */ - this._sr = 0; - - /** - * cached sin rotation and cos rotation - * - * @property _cr - * @type Number - * @private - */ - this._cr = 1; - - /** - * The area the filter is applied to like the hitArea this is used as more of an optimisation - * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle - * - * @property filterArea - * @type Rectangle - */ - this.filterArea = null;//new PIXI.Rectangle(0,0,1,1); - - /** - * The original, cached bounds of the object - * - * @property _bounds - * @type Rectangle - * @private - */ - this._bounds = new PIXI.Rectangle(0, 0, 1, 1); - - /** - * The most up-to-date bounds of the object - * - * @property _currentBounds - * @type Rectangle - * @private - */ - this._currentBounds = null; - - /** - * The original, cached mask of the object - * - * @property _currentBounds - * @type Rectangle - * @private - */ - this._mask = null; - - /** - * Cached internal flag. - * - * @property _cacheAsBitmap - * @type Boolean - * @private - */ - this._cacheAsBitmap = false; - - /** - * Cached internal flag. - * - * @property _cacheIsDirty - * @type Boolean - * @private - */ - this._cacheIsDirty = false; - - - /* - * MOUSE Callbacks - */ - - /** - * A callback that is used when the users mouse rolls over the displayObject - * @method mouseover - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the users mouse leaves the displayObject - * @method mouseout - * @param interactionData {InteractionData} - */ - - //Left button - /** - * A callback that is used when the users clicks on the displayObject with their mouse's left button - * @method click - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user clicks the mouse's left button down over the sprite - * @method mousedown - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's left button that was over the displayObject - * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject - * @method mouseup - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's left button that was over the displayObject but is no longer over the displayObject - * for this callback to be fired, the mouse's left button must have been pressed down over the displayObject - * @method mouseupoutside - * @param interactionData {InteractionData} - */ - - //Right button - /** - * A callback that is used when the users clicks on the displayObject with their mouse's right button - * @method rightclick - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user clicks the mouse's right button down over the sprite - * @method rightdown - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's right button that was over the displayObject - * for this callback to be fired the mouse's right button must have been pressed down over the displayObject - * @method rightup - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the mouse's right button that was over the displayObject but is no longer over the displayObject - * for this callback to be fired, the mouse's right button must have been pressed down over the displayObject - * @method rightupoutside - * @param interactionData {InteractionData} - */ - - /* - * TOUCH Callbacks - */ - - /** - * A callback that is used when the users taps on the sprite with their finger - * basically a touch version of click - * @method tap - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user touches over the displayObject - * @method touchstart - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases a touch over the displayObject - * @method touchend - * @param interactionData {InteractionData} - */ - - /** - * A callback that is used when the user releases the touch that was over the displayObject - * for this callback to be fired, The touch must have started over the sprite - * @method touchendoutside - * @param interactionData {InteractionData} - */ -}; - -// constructor -PIXI.DisplayObject.prototype.constructor = PIXI.DisplayObject; - -/** - * Indicates if the sprite will have touch and mouse interactivity. It is false by default - * - * @property interactive - * @type Boolean - * @default false - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'interactive', { - get: function() { - return this._interactive; - }, - set: function(value) { - this._interactive = value; - - // TODO more to be done here.. - // need to sort out a re-crawl! - if(this.stage)this.stage.dirty = true; - } -}); - -/** - * [read-only] Indicates if the sprite is globally visible. - * - * @property worldVisible - * @type Boolean - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'worldVisible', { - get: function() { - var item = this; - - do - { - if(!item.visible)return false; - item = item.parent; - } - while(item); - - return true; - } -}); - -/** - * Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. - * In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. - * To remove a mask, set this property to null. - * - * @property mask - * @type Graphics - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'mask', { - get: function() { - return this._mask; - }, - set: function(value) { - - if(this._mask)this._mask.isMask = false; - this._mask = value; - if(this._mask)this._mask.isMask = true; - } -}); - -/** - * Sets the filters for the displayObject. - * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. - * To remove filters simply set this property to 'null' - * @property filters - * @type Array(Filter) - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { - - get: function() { - return this._filters; - }, - - set: function(value) { - - if(value) - { - // now put all the passes in one place.. - var passes = []; - for (var i = 0; i < value.length; i++) - { - var filterPasses = value[i].passes; - for (var j = 0; j < filterPasses.length; j++) - { - passes.push(filterPasses[j]); - } - } - - // TODO change this as it is legacy - this._filterBlock = {target:this, filterPasses:passes}; - } - - this._filters = value; - } -}); - -/** - * Set if this display object is cached as a bitmap. - * This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. - * To remove simply set this property to 'null' - * @property cacheAsBitmap - * @type Boolean - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'cacheAsBitmap', { - - get: function() { - return this._cacheAsBitmap; - }, - - set: function(value) { - - if(this._cacheAsBitmap === value)return; - - if(value) - { - this._generateCachedSprite(); - } - else - { - this._destroyCachedSprite(); - } - - this._cacheAsBitmap = value; - } -}); - -/* - * Updates the object transform for rendering - * - * @method updateTransform - * @private - */ -PIXI.DisplayObject.prototype.updateTransform = function() -{ - // create some matrix refs for easy access - var pt = this.parent.worldTransform; - var wt = this.worldTransform; - - // temporary matrix variables - var a, b, c, d, tx, ty; - - // so if rotation is between 0 then we can simplify the multiplication process.. - if(this.rotation % PIXI.PI_2) - { - // check to see if the rotation is the same as the previous render. This means we only need to use sin and cos when rotation actually changes - if(this.rotation !== this.rotationCache) - { - this.rotationCache = this.rotation; - this._sr = Math.sin(this.rotation); - this._cr = Math.cos(this.rotation); - } - - // get the matrix values of the displayobject based on its transform properties.. - a = this._cr * this.scale.x; - b = this._sr * this.scale.x; - c = -this._sr * this.scale.y; - d = this._cr * this.scale.y; - tx = this.position.x; - ty = this.position.y; - - // check for pivot.. not often used so geared towards that fact! - if(this.pivot.x || this.pivot.y) - { - tx -= this.pivot.x * a + this.pivot.y * c; - ty -= this.pivot.x * b + this.pivot.y * d; - } - - // concat the parent matrix with the objects transform. - wt.a = a * pt.a + b * pt.c; - wt.b = a * pt.b + b * pt.d; - wt.c = c * pt.a + d * pt.c; - wt.d = c * pt.b + d * pt.d; - wt.tx = tx * pt.a + ty * pt.c + pt.tx; - wt.ty = tx * pt.b + ty * pt.d + pt.ty; - - - } - else - { - // lets do the fast version as we know there is no rotation.. - a = this.scale.x; - d = this.scale.y; - - tx = this.position.x - this.pivot.x * a; - ty = this.position.y - this.pivot.y * d; - - wt.a = a * pt.a; - wt.b = a * pt.b; - wt.c = d * pt.c; - wt.d = d * pt.d; - wt.tx = tx * pt.a + ty * pt.c + pt.tx; - wt.ty = tx * pt.b + ty * pt.d + pt.ty; - } - - // multiply the alphas.. - this.worldAlpha = this.alpha * this.parent.worldAlpha; -}; - -// performance increase to avoid using call.. (10x faster) -PIXI.DisplayObject.prototype.displayObjectUpdateTransform = PIXI.DisplayObject.prototype.updateTransform; - -/** - * Retrieves the bounds of the displayObject as a rectangle object - * - * @method getBounds - * @param matrix {Matrix} - * @return {Rectangle} the rectangular bounding area - */ -PIXI.DisplayObject.prototype.getBounds = function(matrix) -{ - matrix = matrix;//just to get passed js hinting (and preserve inheritance) - return PIXI.EmptyRectangle; -}; - -/** - * Retrieves the local bounds of the displayObject as a rectangle object - * - * @method getLocalBounds - * @return {Rectangle} the rectangular bounding area - */ -PIXI.DisplayObject.prototype.getLocalBounds = function() -{ - return this.getBounds(PIXI.identityMatrix);///PIXI.EmptyRectangle(); -}; - -/** - * Sets the object's stage reference, the stage this object is connected to - * - * @method setStageReference - * @param stage {Stage} the stage that the object will have as its current stage reference - */ -PIXI.DisplayObject.prototype.setStageReference = function(stage) -{ - this.stage = stage; - if(this._interactive)this.stage.dirty = true; -}; - -/** - * Useful function that returns a texture of the displayObject object that can then be used to create sprites - * This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times. - * - * @method generateTexture - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used to generate the texture. - * @return {Texture} a texture of the graphics object - */ -PIXI.DisplayObject.prototype.generateTexture = function(resolution, scaleMode, renderer) -{ - var bounds = this.getLocalBounds(); - - var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0, renderer, scaleMode, resolution); - - PIXI.DisplayObject._tempMatrix.tx = -bounds.x; - PIXI.DisplayObject._tempMatrix.ty = -bounds.y; - - renderTexture.render(this, PIXI.DisplayObject._tempMatrix); - - return renderTexture; -}; - -/** - * Generates and updates the cached sprite for this object. - * - * @method updateCache - */ -PIXI.DisplayObject.prototype.updateCache = function() -{ - this._generateCachedSprite(); -}; - -/** - * Calculates the global position of the display object - * - * @method toGlobal - * @param position {Point} The world origin to calculate from - * @return {Point} A point object representing the position of this object - */ -PIXI.DisplayObject.prototype.toGlobal = function(position) -{ - // don't need to u[date the lot - this.displayObjectUpdateTransform(); - return this.worldTransform.apply(position); -}; - -/** - * Calculates the local position of the display object relative to another point - * - * @method toLocal - * @param position {Point} The world origin to calculate from - * @param [from] {DisplayObject} The DisplayObject to calculate the global position from - * @return {Point} A point object representing the position of this object - */ -PIXI.DisplayObject.prototype.toLocal = function(position, from) -{ - // - if (from) - { - position = from.toGlobal(position); - } - - // don't need to u[date the lot - this.displayObjectUpdateTransform(); - return this.worldTransform.applyInverse(position); -}; - -/** - * Internal method. - * - * @method _renderCachedSprite - * @param renderSession {Object} The render session - * @private - */ -PIXI.DisplayObject.prototype._renderCachedSprite = function(renderSession) -{ - this._cachedSprite.worldAlpha = this.worldAlpha; - - if(renderSession.gl) - { - PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession); - } - else - { - PIXI.Sprite.prototype._renderCanvas.call(this._cachedSprite, renderSession); - } -}; - -/** - * Internal method. - * - * @method _generateCachedSprite - * @private - */ -PIXI.DisplayObject.prototype._generateCachedSprite = function() -{ - this._cacheAsBitmap = false; - var bounds = this.getLocalBounds(); - - if(!this._cachedSprite) - { - var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0);//, renderSession.renderer); - - this._cachedSprite = new PIXI.Sprite(renderTexture); - this._cachedSprite.worldTransform = this.worldTransform; - } - else - { - this._cachedSprite.texture.resize(bounds.width | 0, bounds.height | 0); - } - - //REMOVE filter! - var tempFilters = this._filters; - this._filters = null; - - this._cachedSprite.filters = tempFilters; - - PIXI.DisplayObject._tempMatrix.tx = -bounds.x; - PIXI.DisplayObject._tempMatrix.ty = -bounds.y; - - this._cachedSprite.texture.render(this, PIXI.DisplayObject._tempMatrix, true); - - this._cachedSprite.anchor.x = -( bounds.x / bounds.width ); - this._cachedSprite.anchor.y = -( bounds.y / bounds.height ); - - this._filters = tempFilters; - - this._cacheAsBitmap = true; -}; - -/** -* Destroys the cached sprite. -* -* @method _destroyCachedSprite -* @private -*/ -PIXI.DisplayObject.prototype._destroyCachedSprite = function() -{ - if(!this._cachedSprite)return; - - this._cachedSprite.texture.destroy(true); - - // TODO could be object pooled! - this._cachedSprite = null; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.DisplayObject.prototype._renderWebGL = function(renderSession) -{ - // OVERWRITE; - // this line is just here to pass jshinting :) - renderSession = renderSession; -}; - -/** -* Renders the object using the Canvas renderer -* -* @method _renderCanvas -* @param renderSession {RenderSession} -* @private -*/ -PIXI.DisplayObject.prototype._renderCanvas = function(renderSession) -{ - // OVERWRITE; - // this line is just here to pass jshinting :) - renderSession = renderSession; -}; - - -PIXI.DisplayObject._tempMatrix = new PIXI.Matrix(); - -/** - * The position of the displayObject on the x axis relative to the local coordinates of the parent. - * - * @property x - * @type Number - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'x', { - get: function() { - return this.position.x; - }, - set: function(value) { - this.position.x = value; - } -}); - -/** - * The position of the displayObject on the y axis relative to the local coordinates of the parent. - * - * @property y - * @type Number - */ -Object.defineProperty(PIXI.DisplayObject.prototype, 'y', { - get: function() { - return this.position.y; - }, - set: function(value) { - this.position.y = value; - } -}); diff --git a/tutorial-4/pixi.js-master/src/pixi/display/DisplayObjectContainer.js b/tutorial-4/pixi.js-master/src/pixi/display/DisplayObjectContainer.js deleted file mode 100755 index e3ccc20..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/display/DisplayObjectContainer.js +++ /dev/null @@ -1,515 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A DisplayObjectContainer represents a collection of display objects. - * It is the base class of all display objects that act as a container for other objects. - * - * @class DisplayObjectContainer - * @extends DisplayObject - * @constructor - */ -PIXI.DisplayObjectContainer = function() -{ - PIXI.DisplayObject.call( this ); - - /** - * [read-only] The array of children of this container. - * - * @property children - * @type Array(DisplayObject) - * @readOnly - */ - this.children = []; - - // fast access to update transform.. - -}; - -// constructor -PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); -PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer; - - -/** - * The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', { - get: function() { - return this.scale.x * this.getLocalBounds().width; - }, - set: function(value) { - - var width = this.getLocalBounds().width; - - if(width !== 0) - { - this.scale.x = value / width; - } - else - { - this.scale.x = 1; - } - - - this._width = value; - } -}); - -/** - * The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', { - get: function() { - return this.scale.y * this.getLocalBounds().height; - }, - set: function(value) { - - var height = this.getLocalBounds().height; - - if(height !== 0) - { - this.scale.y = value / height ; - } - else - { - this.scale.y = 1; - } - - this._height = value; - } -}); - -/** - * Adds a child to the container. - * - * @method addChild - * @param child {DisplayObject} The DisplayObject to add to the container - * @return {DisplayObject} The child that was added. - */ -PIXI.DisplayObjectContainer.prototype.addChild = function(child) -{ - return this.addChildAt(child, this.children.length); -}; - -/** - * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown - * - * @method addChildAt - * @param child {DisplayObject} The child to add - * @param index {Number} The index to place the child in - * @return {DisplayObject} The child that was added. - */ -PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) -{ - if(index >= 0 && index <= this.children.length) - { - if(child.parent) - { - child.parent.removeChild(child); - } - - child.parent = this; - - this.children.splice(index, 0, child); - - if(this.stage)child.setStageReference(this.stage); - - return child; - } - else - { - throw new Error(child + 'addChildAt: The index '+ index +' supplied is out of bounds ' + this.children.length); - } -}; - -/** - * Swaps the position of 2 Display Objects within this container. - * - * @method swapChildren - * @param child {DisplayObject} - * @param child2 {DisplayObject} - */ -PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2) -{ - if(child === child2) { - return; - } - - var index1 = this.getChildIndex(child); - var index2 = this.getChildIndex(child2); - - if(index1 < 0 || index2 < 0) { - throw new Error('swapChildren: Both the supplied DisplayObjects must be a child of the caller.'); - } - - this.children[index1] = child2; - this.children[index2] = child; - -}; - -/** - * Returns the index position of a child DisplayObject instance - * - * @method getChildIndex - * @param child {DisplayObject} The DisplayObject instance to identify - * @return {Number} The index position of the child display object to identify - */ -PIXI.DisplayObjectContainer.prototype.getChildIndex = function(child) -{ - var index = this.children.indexOf(child); - if (index === -1) - { - throw new Error('The supplied DisplayObject must be a child of the caller'); - } - return index; -}; - -/** - * Changes the position of an existing child in the display object container - * - * @method setChildIndex - * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number - * @param index {Number} The resulting index number for the child display object - */ -PIXI.DisplayObjectContainer.prototype.setChildIndex = function(child, index) -{ - if (index < 0 || index >= this.children.length) - { - throw new Error('The supplied index is out of bounds'); - } - var currentIndex = this.getChildIndex(child); - this.children.splice(currentIndex, 1); //remove from old position - this.children.splice(index, 0, child); //add at new position -}; - -/** - * Returns the child at the specified index - * - * @method getChildAt - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child at the given index, if any. - */ -PIXI.DisplayObjectContainer.prototype.getChildAt = function(index) -{ - if (index < 0 || index >= this.children.length) - { - throw new Error('getChildAt: Supplied index '+ index +' does not exist in the child list, or the supplied DisplayObject must be a child of the caller'); - } - return this.children[index]; - -}; - -/** - * Removes a child from the container. - * - * @method removeChild - * @param child {DisplayObject} The DisplayObject to remove - * @return {DisplayObject} The child that was removed. - */ -PIXI.DisplayObjectContainer.prototype.removeChild = function(child) -{ - var index = this.children.indexOf( child ); - if(index === -1)return; - - return this.removeChildAt( index ); -}; - -/** - * Removes a child from the specified index position. - * - * @method removeChildAt - * @param index {Number} The index to get the child from - * @return {DisplayObject} The child that was removed. - */ -PIXI.DisplayObjectContainer.prototype.removeChildAt = function(index) -{ - var child = this.getChildAt( index ); - if(this.stage) - child.removeStageReference(); - - child.parent = undefined; - this.children.splice( index, 1 ); - return child; -}; - -/** -* Removes all children from this container that are within the begin and end indexes. -* -* @method removeChildren -* @param beginIndex {Number} The beginning position. Default value is 0. -* @param endIndex {Number} The ending position. Default value is size of the container. -*/ -PIXI.DisplayObjectContainer.prototype.removeChildren = function(beginIndex, endIndex) -{ - var begin = beginIndex || 0; - var end = typeof endIndex === 'number' ? endIndex : this.children.length; - var range = end - begin; - - if (range > 0 && range <= end) - { - var removed = this.children.splice(begin, range); - for (var i = 0; i < removed.length; i++) { - var child = removed[i]; - if(this.stage) - child.removeStageReference(); - child.parent = undefined; - } - return removed; - } - else if (range === 0 && this.children.length === 0) - { - return []; - } - else - { - throw new Error( 'removeChildren: Range Error, numeric values are outside the acceptable range' ); - } -}; - -/* - * Updates the transform on all children of this container for rendering - * - * @method updateTransform - * @private - */ -PIXI.DisplayObjectContainer.prototype.updateTransform = function() -{ - if(!this.visible)return; - - this.displayObjectUpdateTransform(); - - //PIXI.DisplayObject.prototype.updateTransform.call( this ); - - if(this._cacheAsBitmap)return; - - for(var i=0,j=this.children.length; i childMaxX ? maxX : childMaxX; - maxY = maxY > childMaxY ? maxY : childMaxY; - } - - if(!childVisible) - return PIXI.EmptyRectangle; - - var bounds = this._bounds; - - bounds.x = minX; - bounds.y = minY; - bounds.width = maxX - minX; - bounds.height = maxY - minY; - - // TODO: store a reference so that if this function gets called again in the render cycle we do not have to recalculate - //this._currentBounds = bounds; - - return bounds; -}; - -/** - * Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration. - * - * @method getLocalBounds - * @return {Rectangle} The rectangular bounding area - */ -PIXI.DisplayObjectContainer.prototype.getLocalBounds = function() -{ - var matrixCache = this.worldTransform; - - this.worldTransform = PIXI.identityMatrix; - - for(var i=0,j=this.children.length; i= this.textures.length) - { - this.gotoAndStop(this.textures.length - 1); - if(this.onComplete) - { - this.onComplete(); - } - } -}; - -/** - * A short hand way of creating a movieclip from an array of frame ids - * - * @static - * @method fromFrames - * @param frames {Array} the array of frames ids the movieclip will use as its texture frames - * @return {MovieClip} - */ -PIXI.MovieClip.fromFrames = function(frames) -{ - var textures = []; - - for (var i = 0; i < frames.length; i++) - { - textures.push(new PIXI.Texture.fromFrame(frames[i])); - } - - return new PIXI.MovieClip(textures); -}; - -/** - * A short hand way of creating a movieclip from an array of image ids - * - * @static - * @method fromImages - * @param frames {Array} the array of image ids the movieclip will use as its texture frames - * @return {MovieClip} - */ -PIXI.MovieClip.fromImages = function(images) -{ - var textures = []; - - for (var i = 0; i < images.length; i++) - { - textures.push(new PIXI.Texture.fromImage(images[i])); - } - - return new PIXI.MovieClip(textures); -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/display/Sprite.js b/tutorial-4/pixi.js-master/src/pixi/display/Sprite.js deleted file mode 100755 index aab559a..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/display/Sprite.js +++ /dev/null @@ -1,471 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Sprite object is the base for all textured objects that are rendered to the screen - * - * @class Sprite - * @extends DisplayObjectContainer - * @constructor - * @param texture {Texture} The texture for this sprite - * - * A sprite can be created directly from an image like this : - * var sprite = new PIXI.Sprite.fromImage('assets/image.png'); - * yourStage.addChild(sprite); - * then obviously don't forget to add it to the stage you have already created - */ -PIXI.Sprite = function(texture) -{ - PIXI.DisplayObjectContainer.call( this ); - - /** - * The anchor sets the origin point of the texture. - * The default is 0,0 this means the texture's origin is the top left - * Setting than anchor to 0.5,0.5 means the textures origin is centered - * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner - * - * @property anchor - * @type Point - */ - this.anchor = new PIXI.Point(); - - /** - * The texture that the sprite is using - * - * @property texture - * @type Texture - */ - this.texture = texture || PIXI.Texture.emptyTexture; - - /** - * The width of the sprite (this is initially set by the texture) - * - * @property _width - * @type Number - * @private - */ - this._width = 0; - - /** - * The height of the sprite (this is initially set by the texture) - * - * @property _height - * @type Number - * @private - */ - this._height = 0; - - /** - * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. - * - * @property tint - * @type Number - * @default 0xFFFFFF - */ - this.tint = 0xFFFFFF; - - /** - * The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode. - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - /** - * The shader that will be used to render the texture to the stage. Set to null to remove a current shader. - * - * @property shader - * @type AbstractFilter - * @default null - */ - this.shader = null; - - if(this.texture.baseTexture.hasLoaded) - { - this.onTextureUpdate(); - } - else - { - this.texture.on( 'update', this.onTextureUpdate.bind(this) ); - } - - this.renderable = true; - -}; - -// constructor -PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); -PIXI.Sprite.prototype.constructor = PIXI.Sprite; - -/** - * The width of the sprite, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.Sprite.prototype, 'width', { - get: function() { - return this.scale.x * this.texture.frame.width; - }, - set: function(value) { - this.scale.x = value / this.texture.frame.width; - this._width = value; - } -}); - -/** - * The height of the sprite, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.Sprite.prototype, 'height', { - get: function() { - return this.scale.y * this.texture.frame.height; - }, - set: function(value) { - this.scale.y = value / this.texture.frame.height; - this._height = value; - } -}); - -/** - * Sets the texture of the sprite - * - * @method setTexture - * @param texture {Texture} The PIXI texture that is displayed by the sprite - */ -PIXI.Sprite.prototype.setTexture = function(texture) -{ - this.texture = texture; - this.cachedTint = 0xFFFFFF; -}; - -/** - * When the texture is updated, this event will fire to update the scale and frame - * - * @method onTextureUpdate - * @param event - * @private - */ -PIXI.Sprite.prototype.onTextureUpdate = function() -{ - // so if _width is 0 then width was not set.. - if(this._width)this.scale.x = this._width / this.texture.frame.width; - if(this._height)this.scale.y = this._height / this.texture.frame.height; - - //this.updateFrame = true; -}; - -/** -* Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account. -* -* @method getBounds -* @param matrix {Matrix} the transformation matrix of the sprite -* @return {Rectangle} the framing rectangle -*/ -PIXI.Sprite.prototype.getBounds = function(matrix) -{ - var width = this.texture.frame.width; - var height = this.texture.frame.height; - - var w0 = width * (1-this.anchor.x); - var w1 = width * -this.anchor.x; - - var h0 = height * (1-this.anchor.y); - var h1 = height * -this.anchor.y; - - var worldTransform = matrix || this.worldTransform ; - - var a = worldTransform.a; - var b = worldTransform.b; - var c = worldTransform.c; - var d = worldTransform.d; - var tx = worldTransform.tx; - var ty = worldTransform.ty; - - var maxX = -Infinity; - var maxY = -Infinity; - - var minX = Infinity; - var minY = Infinity; - - if(b === 0 && c === 0) - { - // scale may be negative! - if(a < 0)a *= -1; - if(d < 0)d *= -1; - - // this means there is no rotation going on right? RIGHT? - // if thats the case then we can avoid checking the bound values! yay - minX = a * w1 + tx; - maxX = a * w0 + tx; - minY = d * h1 + ty; - maxY = d * h0 + ty; - } - else - { - var x1 = a * w1 + c * h1 + tx; - var y1 = d * h1 + b * w1 + ty; - - var x2 = a * w0 + c * h1 + tx; - var y2 = d * h1 + b * w0 + ty; - - var x3 = a * w0 + c * h0 + tx; - var y3 = d * h0 + b * w0 + ty; - - var x4 = a * w1 + c * h0 + tx; - var y4 = d * h0 + b * w1 + ty; - - minX = x1 < minX ? x1 : minX; - minX = x2 < minX ? x2 : minX; - minX = x3 < minX ? x3 : minX; - minX = x4 < minX ? x4 : minX; - - minY = y1 < minY ? y1 : minY; - minY = y2 < minY ? y2 : minY; - minY = y3 < minY ? y3 : minY; - minY = y4 < minY ? y4 : minY; - - maxX = x1 > maxX ? x1 : maxX; - maxX = x2 > maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y1 > maxY ? y1 : maxY; - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - } - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Sprite.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(!this.visible || this.alpha <= 0)return; - - var i,j; - - // do a quick check to see if this element has a mask or a filter. - if(this._mask || this._filters) - { - var spriteBatch = renderSession.spriteBatch; - - // push filter first as we need to ensure the stencil buffer is correct for any masking - if(this._filters) - { - spriteBatch.flush(); - renderSession.filterManager.pushFilter(this._filterBlock); - } - - if(this._mask) - { - spriteBatch.stop(); - renderSession.maskManager.pushMask(this.mask, renderSession); - spriteBatch.start(); - } - - // add this sprite to the batch - spriteBatch.render(this); - - // now loop through the children and make sure they get rendered - for(i=0,j=this.children.length; i 1) ratio = 1; - - perpLength = Math.sqrt(perp.x * perp.x + perp.y * perp.y); - num = this.texture.height / 2; //(20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio; - perp.x /= perpLength; - perp.y /= perpLength; - - perp.x *= num; - perp.y *= num; - - vertices[index] = point.x + perp.x; - vertices[index+1] = point.y + perp.y; - vertices[index+2] = point.x - perp.x; - vertices[index+3] = point.y - perp.y; - - lastPoint = point; - } - - PIXI.DisplayObjectContainer.prototype.updateTransform.call( this ); -}; -/* - * Sets the texture that the Rope will use - * - * @method setTexture - * @param texture {Texture} the texture that will be used - */ -PIXI.Rope.prototype.setTexture = function(texture) -{ - // stop current texture - this.texture = texture; - //this.updateFrame = true; -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/extras/SPINE-LICENSE b/tutorial-4/pixi.js-master/src/pixi/extras/SPINE-LICENSE deleted file mode 100755 index 7bb7566..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/extras/SPINE-LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Spine Runtimes Software License -Version 2.1 - -Copyright (c) 2013, Esoteric Software -All rights reserved. - -You are granted a perpetual, non-exclusive, non-sublicensable and -non-transferable license to install, execute and perform the Spine Runtimes -Software (the "Software") solely for internal use. Without the written -permission of Esoteric Software (typically granted by licensing Spine), you -may not (a) modify, translate, adapt or otherwise create derivative works, -improvements of the Software or develop new applications using the Software -or (b) remove, delete, alter or obscure any trademarks or any copyright, -trademark, patent or other intellectual property or proprietary rights notices -on or in the Software, including any copy thereof. Redistributions in binary -or source form must include this license and terms. - -THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tutorial-4/pixi.js-master/src/pixi/extras/Spine.js b/tutorial-4/pixi.js-master/src/pixi/extras/Spine.js deleted file mode 100755 index 06ce610..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/extras/Spine.js +++ /dev/null @@ -1,2626 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License - * Version 2.1 - * - * Copyright (c) 2013, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable and - * non-transferable license to install, execute and perform the Spine Runtimes - * Software (the "Software") solely for internal use. Without the written - * permission of Esoteric Software (typically granted by licensing Spine), you - * may not (a) modify, translate, adapt or otherwise create derivative works, - * improvements of the Software or develop new applications using the Software - * or (b) remove, delete, alter or obscure any trademarks or any copyright, - * trademark, patent or other intellectual property or proprietary rights - * notices on or in the Software, including any copy thereof. Redistributions - * in binary or source form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -var spine = { - radDeg: 180 / Math.PI, - degRad: Math.PI / 180, - temp: [], - Float32Array: (typeof(Float32Array) === 'undefined') ? Array : Float32Array, - Uint16Array: (typeof(Uint16Array) === 'undefined') ? Array : Uint16Array -}; - -spine.BoneData = function (name, parent) { - this.name = name; - this.parent = parent; -}; -spine.BoneData.prototype = { - length: 0, - x: 0, y: 0, - rotation: 0, - scaleX: 1, scaleY: 1, - inheritScale: true, - inheritRotation: true, - flipX: false, flipY: false -}; - -spine.SlotData = function (name, boneData) { - this.name = name; - this.boneData = boneData; -}; -spine.SlotData.prototype = { - r: 1, g: 1, b: 1, a: 1, - attachmentName: null, - additiveBlending: false -}; - -spine.IkConstraintData = function (name) { - this.name = name; - this.bones = []; -}; -spine.IkConstraintData.prototype = { - target: null, - bendDirection: 1, - mix: 1 -}; - -spine.Bone = function (boneData, skeleton, parent) { - this.data = boneData; - this.skeleton = skeleton; - this.parent = parent; - this.setToSetupPose(); -}; -spine.Bone.yDown = false; -spine.Bone.prototype = { - x: 0, y: 0, - rotation: 0, rotationIK: 0, - scaleX: 1, scaleY: 1, - flipX: false, flipY: false, - m00: 0, m01: 0, worldX: 0, // a b x - m10: 0, m11: 0, worldY: 0, // c d y - worldRotation: 0, - worldScaleX: 1, worldScaleY: 1, - worldFlipX: false, worldFlipY: false, - updateWorldTransform: function () { - var parent = this.parent; - if (parent) { - this.worldX = this.x * parent.m00 + this.y * parent.m01 + parent.worldX; - this.worldY = this.x * parent.m10 + this.y * parent.m11 + parent.worldY; - if (this.data.inheritScale) { - this.worldScaleX = parent.worldScaleX * this.scaleX; - this.worldScaleY = parent.worldScaleY * this.scaleY; - } else { - this.worldScaleX = this.scaleX; - this.worldScaleY = this.scaleY; - } - this.worldRotation = this.data.inheritRotation ? (parent.worldRotation + this.rotationIK) : this.rotationIK; - this.worldFlipX = parent.worldFlipX != this.flipX; - this.worldFlipY = parent.worldFlipY != this.flipY; - } else { - var skeletonFlipX = this.skeleton.flipX, skeletonFlipY = this.skeleton.flipY; - this.worldX = skeletonFlipX ? -this.x : this.x; - this.worldY = (skeletonFlipY != spine.Bone.yDown) ? -this.y : this.y; - this.worldScaleX = this.scaleX; - this.worldScaleY = this.scaleY; - this.worldRotation = this.rotationIK; - this.worldFlipX = skeletonFlipX != this.flipX; - this.worldFlipY = skeletonFlipY != this.flipY; - } - var radians = this.worldRotation * spine.degRad; - var cos = Math.cos(radians); - var sin = Math.sin(radians); - if (this.worldFlipX) { - this.m00 = -cos * this.worldScaleX; - this.m01 = sin * this.worldScaleY; - } else { - this.m00 = cos * this.worldScaleX; - this.m01 = -sin * this.worldScaleY; - } - if (this.worldFlipY != spine.Bone.yDown) { - this.m10 = -sin * this.worldScaleX; - this.m11 = -cos * this.worldScaleY; - } else { - this.m10 = sin * this.worldScaleX; - this.m11 = cos * this.worldScaleY; - } - }, - setToSetupPose: function () { - var data = this.data; - this.x = data.x; - this.y = data.y; - this.rotation = data.rotation; - this.rotationIK = this.rotation; - this.scaleX = data.scaleX; - this.scaleY = data.scaleY; - this.flipX = data.flipX; - this.flipY = data.flipY; - }, - worldToLocal: function (world) { - var dx = world[0] - this.worldX, dy = world[1] - this.worldY; - var m00 = this.m00, m10 = this.m10, m01 = this.m01, m11 = this.m11; - if (this.worldFlipX != (this.worldFlipY != spine.Bone.yDown)) { - m00 = -m00; - m11 = -m11; - } - var invDet = 1 / (m00 * m11 - m01 * m10); - world[0] = dx * m00 * invDet - dy * m01 * invDet; - world[1] = dy * m11 * invDet - dx * m10 * invDet; - }, - localToWorld: function (local) { - var localX = local[0], localY = local[1]; - local[0] = localX * this.m00 + localY * this.m01 + this.worldX; - local[1] = localX * this.m10 + localY * this.m11 + this.worldY; - } -}; - -spine.Slot = function (slotData, bone) { - this.data = slotData; - this.bone = bone; - this.setToSetupPose(); -}; -spine.Slot.prototype = { - r: 1, g: 1, b: 1, a: 1, - _attachmentTime: 0, - attachment: null, - attachmentVertices: [], - setAttachment: function (attachment) { - this.attachment = attachment; - this._attachmentTime = this.bone.skeleton.time; - this.attachmentVertices.length = 0; - }, - setAttachmentTime: function (time) { - this._attachmentTime = this.bone.skeleton.time - time; - }, - getAttachmentTime: function () { - return this.bone.skeleton.time - this._attachmentTime; - }, - setToSetupPose: function () { - var data = this.data; - this.r = data.r; - this.g = data.g; - this.b = data.b; - this.a = data.a; - - var slotDatas = this.bone.skeleton.data.slots; - for (var i = 0, n = slotDatas.length; i < n; i++) { - if (slotDatas[i] == data) { - this.setAttachment(!data.attachmentName ? null : this.bone.skeleton.getAttachmentBySlotIndex(i, data.attachmentName)); - break; - } - } - } -}; - -spine.IkConstraint = function (data, skeleton) { - this.data = data; - this.mix = data.mix; - this.bendDirection = data.bendDirection; - - this.bones = []; - for (var i = 0, n = data.bones.length; i < n; i++) - this.bones.push(skeleton.findBone(data.bones[i].name)); - this.target = skeleton.findBone(data.target.name); -}; -spine.IkConstraint.prototype = { - apply: function () { - var target = this.target; - var bones = this.bones; - switch (bones.length) { - case 1: - spine.IkConstraint.apply1(bones[0], target.worldX, target.worldY, this.mix); - break; - case 2: - spine.IkConstraint.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.mix); - break; - } - } -}; -/** Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified in the world - * coordinate system. */ -spine.IkConstraint.apply1 = function (bone, targetX, targetY, alpha) { - var parentRotation = (!bone.data.inheritRotation || !bone.parent) ? 0 : bone.parent.worldRotation; - var rotation = bone.rotation; - var rotationIK = Math.atan2(targetY - bone.worldY, targetX - bone.worldX) * spine.radDeg - parentRotation; - bone.rotationIK = rotation + (rotationIK - rotation) * alpha; -}; -/** Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as possible. The - * target is specified in the world coordinate system. - * @param child Any descendant bone of the parent. */ -spine.IkConstraint.apply2 = function (parent, child, targetX, targetY, bendDirection, alpha) { - var childRotation = child.rotation, parentRotation = parent.rotation; - if (!alpha) { - child.rotationIK = childRotation; - parent.rotationIK = parentRotation; - return; - } - var positionX, positionY, tempPosition = spine.temp; - var parentParent = parent.parent; - if (parentParent) { - tempPosition[0] = targetX; - tempPosition[1] = targetY; - parentParent.worldToLocal(tempPosition); - targetX = (tempPosition[0] - parent.x) * parentParent.worldScaleX; - targetY = (tempPosition[1] - parent.y) * parentParent.worldScaleY; - } else { - targetX -= parent.x; - targetY -= parent.y; - } - if (child.parent == parent) { - positionX = child.x; - positionY = child.y; - } else { - tempPosition[0] = child.x; - tempPosition[1] = child.y; - child.parent.localToWorld(tempPosition); - parent.worldToLocal(tempPosition); - positionX = tempPosition[0]; - positionY = tempPosition[1]; - } - var childX = positionX * parent.worldScaleX, childY = positionY * parent.worldScaleY; - var offset = Math.atan2(childY, childX); - var len1 = Math.sqrt(childX * childX + childY * childY), len2 = child.data.length * child.worldScaleX; - // Based on code by Ryan Juckett with permission: Copyright (c) 2008-2009 Ryan Juckett, http://www.ryanjuckett.com/ - var cosDenom = 2 * len1 * len2; - if (cosDenom < 0.0001) { - child.rotationIK = childRotation + (Math.atan2(targetY, targetX) * spine.radDeg - parentRotation - childRotation) * alpha; - return; - } - var cos = (targetX * targetX + targetY * targetY - len1 * len1 - len2 * len2) / cosDenom; - if (cos < -1) - cos = -1; - else if (cos > 1) - cos = 1; - var childAngle = Math.acos(cos) * bendDirection; - var adjacent = len1 + len2 * cos, opposite = len2 * Math.sin(childAngle); - var parentAngle = Math.atan2(targetY * adjacent - targetX * opposite, targetX * adjacent + targetY * opposite); - var rotation = (parentAngle - offset) * spine.radDeg - parentRotation; - if (rotation > 180) - rotation -= 360; - else if (rotation < -180) // - rotation += 360; - parent.rotationIK = parentRotation + rotation * alpha; - rotation = (childAngle + offset) * spine.radDeg - childRotation; - if (rotation > 180) - rotation -= 360; - else if (rotation < -180) // - rotation += 360; - child.rotationIK = childRotation + (rotation + parent.worldRotation - child.parent.worldRotation) * alpha; -}; - -spine.Skin = function (name) { - this.name = name; - this.attachments = {}; -}; -spine.Skin.prototype = { - addAttachment: function (slotIndex, name, attachment) { - this.attachments[slotIndex + ":" + name] = attachment; - }, - getAttachment: function (slotIndex, name) { - return this.attachments[slotIndex + ":" + name]; - }, - _attachAll: function (skeleton, oldSkin) { - for (var key in oldSkin.attachments) { - var colon = key.indexOf(":"); - var slotIndex = parseInt(key.substring(0, colon)); - var name = key.substring(colon + 1); - var slot = skeleton.slots[slotIndex]; - if (slot.attachment && slot.attachment.name == name) { - var attachment = this.getAttachment(slotIndex, name); - if (attachment) slot.setAttachment(attachment); - } - } - } -}; - -spine.Animation = function (name, timelines, duration) { - this.name = name; - this.timelines = timelines; - this.duration = duration; -}; -spine.Animation.prototype = { - apply: function (skeleton, lastTime, time, loop, events) { - if (loop && this.duration != 0) { - time %= this.duration; - lastTime %= this.duration; - } - var timelines = this.timelines; - for (var i = 0, n = timelines.length; i < n; i++) - timelines[i].apply(skeleton, lastTime, time, events, 1); - }, - mix: function (skeleton, lastTime, time, loop, events, alpha) { - if (loop && this.duration != 0) { - time %= this.duration; - lastTime %= this.duration; - } - var timelines = this.timelines; - for (var i = 0, n = timelines.length; i < n; i++) - timelines[i].apply(skeleton, lastTime, time, events, alpha); - } -}; -spine.Animation.binarySearch = function (values, target, step) { - var low = 0; - var high = Math.floor(values.length / step) - 2; - if (!high) return step; - var current = high >>> 1; - while (true) { - if (values[(current + 1) * step] <= target) - low = current + 1; - else - high = current; - if (low == high) return (low + 1) * step; - current = (low + high) >>> 1; - } -}; -spine.Animation.binarySearch1 = function (values, target) { - var low = 0; - var high = values.length - 2; - if (!high) return 1; - var current = high >>> 1; - while (true) { - if (values[current + 1] <= target) - low = current + 1; - else - high = current; - if (low == high) return low + 1; - current = (low + high) >>> 1; - } -}; -spine.Animation.linearSearch = function (values, target, step) { - for (var i = 0, last = values.length - step; i <= last; i += step) - if (values[i] > target) return i; - return -1; -}; - -spine.Curves = function (frameCount) { - this.curves = []; // type, x, y, ... - //this.curves.length = (frameCount - 1) * 19/*BEZIER_SIZE*/; -}; -spine.Curves.prototype = { - setLinear: function (frameIndex) { - this.curves[frameIndex * 19/*BEZIER_SIZE*/] = 0/*LINEAR*/; - }, - setStepped: function (frameIndex) { - this.curves[frameIndex * 19/*BEZIER_SIZE*/] = 1/*STEPPED*/; - }, - /** Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next. - * cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of - * the difference between the keyframe's values. */ - setCurve: function (frameIndex, cx1, cy1, cx2, cy2) { - var subdiv1 = 1 / 10/*BEZIER_SEGMENTS*/, subdiv2 = subdiv1 * subdiv1, subdiv3 = subdiv2 * subdiv1; - var pre1 = 3 * subdiv1, pre2 = 3 * subdiv2, pre4 = 6 * subdiv2, pre5 = 6 * subdiv3; - var tmp1x = -cx1 * 2 + cx2, tmp1y = -cy1 * 2 + cy2, tmp2x = (cx1 - cx2) * 3 + 1, tmp2y = (cy1 - cy2) * 3 + 1; - var dfx = cx1 * pre1 + tmp1x * pre2 + tmp2x * subdiv3, dfy = cy1 * pre1 + tmp1y * pre2 + tmp2y * subdiv3; - var ddfx = tmp1x * pre4 + tmp2x * pre5, ddfy = tmp1y * pre4 + tmp2y * pre5; - var dddfx = tmp2x * pre5, dddfy = tmp2y * pre5; - - var i = frameIndex * 19/*BEZIER_SIZE*/; - var curves = this.curves; - curves[i++] = 2/*BEZIER*/; - - var x = dfx, y = dfy; - for (var n = i + 19/*BEZIER_SIZE*/ - 1; i < n; i += 2) { - curves[i] = x; - curves[i + 1] = y; - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - x += dfx; - y += dfy; - } - }, - getCurvePercent: function (frameIndex, percent) { - percent = percent < 0 ? 0 : (percent > 1 ? 1 : percent); - var curves = this.curves; - var i = frameIndex * 19/*BEZIER_SIZE*/; - var type = curves[i]; - if (type === 0/*LINEAR*/) return percent; - if (type == 1/*STEPPED*/) return 0; - i++; - var x = 0; - for (var start = i, n = i + 19/*BEZIER_SIZE*/ - 1; i < n; i += 2) { - x = curves[i]; - if (x >= percent) { - var prevX, prevY; - if (i == start) { - prevX = 0; - prevY = 0; - } else { - prevX = curves[i - 2]; - prevY = curves[i - 1]; - } - return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX); - } - } - var y = curves[i - 1]; - return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1. - } -}; - -spine.RotateTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, angle, ... - this.frames.length = frameCount * 2; -}; -spine.RotateTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, angle) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = angle; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 2]) { // Time is after last frame. - var amount = bone.data.rotation + frames[frames.length - 1] - bone.rotation; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - bone.rotation += amount * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 2); - var prevFrameValue = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 2/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 2 - 1, percent); - - var amount = frames[frameIndex + 1/*FRAME_VALUE*/] - prevFrameValue; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - amount = bone.data.rotation + (prevFrameValue + amount * percent) - bone.rotation; - while (amount > 180) - amount -= 360; - while (amount < -180) - amount += 360; - bone.rotation += amount * alpha; - } -}; - -spine.TranslateTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, x, y, ... - this.frames.length = frameCount * 3; -}; -spine.TranslateTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, x, y) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = x; - this.frames[frameIndex + 2] = y; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - bone.x += (bone.data.x + frames[frames.length - 2] - bone.x) * alpha; - bone.y += (bone.data.y + frames[frames.length - 1] - bone.y) * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameX = frames[frameIndex - 2]; - var prevFrameY = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - bone.x += (bone.data.x + prevFrameX + (frames[frameIndex + 1/*FRAME_X*/] - prevFrameX) * percent - bone.x) * alpha; - bone.y += (bone.data.y + prevFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - prevFrameY) * percent - bone.y) * alpha; - } -}; - -spine.ScaleTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, x, y, ... - this.frames.length = frameCount * 3; -}; -spine.ScaleTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, x, y) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = x; - this.frames[frameIndex + 2] = y; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var bone = skeleton.bones[this.boneIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - bone.scaleX += (bone.data.scaleX * frames[frames.length - 2] - bone.scaleX) * alpha; - bone.scaleY += (bone.data.scaleY * frames[frames.length - 1] - bone.scaleY) * alpha; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameX = frames[frameIndex - 2]; - var prevFrameY = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - bone.scaleX += (bone.data.scaleX * (prevFrameX + (frames[frameIndex + 1/*FRAME_X*/] - prevFrameX) * percent) - bone.scaleX) * alpha; - bone.scaleY += (bone.data.scaleY * (prevFrameY + (frames[frameIndex + 2/*FRAME_Y*/] - prevFrameY) * percent) - bone.scaleY) * alpha; - } -}; - -spine.ColorTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, r, g, b, a, ... - this.frames.length = frameCount * 5; -}; -spine.ColorTimeline.prototype = { - slotIndex: 0, - getFrameCount: function () { - return this.frames.length / 5; - }, - setFrame: function (frameIndex, time, r, g, b, a) { - frameIndex *= 5; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = r; - this.frames[frameIndex + 2] = g; - this.frames[frameIndex + 3] = b; - this.frames[frameIndex + 4] = a; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var r, g, b, a; - if (time >= frames[frames.length - 5]) { - // Time is after last frame. - var i = frames.length - 1; - r = frames[i - 3]; - g = frames[i - 2]; - b = frames[i - 1]; - a = frames[i]; - } else { - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 5); - var prevFrameR = frames[frameIndex - 4]; - var prevFrameG = frames[frameIndex - 3]; - var prevFrameB = frames[frameIndex - 2]; - var prevFrameA = frames[frameIndex - 1]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 5/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 5 - 1, percent); - - r = prevFrameR + (frames[frameIndex + 1/*FRAME_R*/] - prevFrameR) * percent; - g = prevFrameG + (frames[frameIndex + 2/*FRAME_G*/] - prevFrameG) * percent; - b = prevFrameB + (frames[frameIndex + 3/*FRAME_B*/] - prevFrameB) * percent; - a = prevFrameA + (frames[frameIndex + 4/*FRAME_A*/] - prevFrameA) * percent; - } - var slot = skeleton.slots[this.slotIndex]; - if (alpha < 1) { - slot.r += (r - slot.r) * alpha; - slot.g += (g - slot.g) * alpha; - slot.b += (b - slot.b) * alpha; - slot.a += (a - slot.a) * alpha; - } else { - slot.r = r; - slot.g = g; - slot.b = b; - slot.a = a; - } - } -}; - -spine.AttachmentTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, ... - this.frames.length = frameCount; - this.attachmentNames = []; - this.attachmentNames.length = frameCount; -}; -spine.AttachmentTimeline.prototype = { - slotIndex: 0, - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, attachmentName) { - this.frames[frameIndex] = time; - this.attachmentNames[frameIndex] = attachmentName; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - - var frameIndex = time >= frames[frames.length - 1] ? frames.length - 1 : spine.Animation.binarySearch1(frames, time) - 1; - if (frames[frameIndex] < lastTime) return; - - var attachmentName = this.attachmentNames[frameIndex]; - skeleton.slots[this.slotIndex].setAttachment( - !attachmentName ? null : skeleton.getAttachmentBySlotIndex(this.slotIndex, attachmentName)); - } -}; - -spine.EventTimeline = function (frameCount) { - this.frames = []; // time, ... - this.frames.length = frameCount; - this.events = []; - this.events.length = frameCount; -}; -spine.EventTimeline.prototype = { - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, event) { - this.frames[frameIndex] = time; - this.events[frameIndex] = event; - }, - /** Fires events for frames > lastTime and <= time. */ - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - if (!firedEvents) return; - - var frames = this.frames; - var frameCount = frames.length; - - if (lastTime > time) { // Fire events after last time for looped animations. - this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha); - lastTime = -1; - } else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame. - return; - if (time < frames[0]) return; // Time is before first frame. - - var frameIndex; - if (lastTime < frames[0]) - frameIndex = 0; - else { - frameIndex = spine.Animation.binarySearch1(frames, lastTime); - var frame = frames[frameIndex]; - while (frameIndex > 0) { // Fire multiple events with the same frame. - if (frames[frameIndex - 1] != frame) break; - frameIndex--; - } - } - var events = this.events; - for (; frameIndex < frameCount && time >= frames[frameIndex]; frameIndex++) - firedEvents.push(events[frameIndex]); - } -}; - -spine.DrawOrderTimeline = function (frameCount) { - this.frames = []; // time, ... - this.frames.length = frameCount; - this.drawOrders = []; - this.drawOrders.length = frameCount; -}; -spine.DrawOrderTimeline.prototype = { - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, drawOrder) { - this.frames[frameIndex] = time; - this.drawOrders[frameIndex] = drawOrder; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var frameIndex; - if (time >= frames[frames.length - 1]) // Time is after last frame. - frameIndex = frames.length - 1; - else - frameIndex = spine.Animation.binarySearch1(frames, time) - 1; - - var drawOrder = skeleton.drawOrder; - var slots = skeleton.slots; - var drawOrderToSetupIndex = this.drawOrders[frameIndex]; - if (!drawOrderToSetupIndex) { - for (var i = 0, n = slots.length; i < n; i++) - drawOrder[i] = slots[i]; - } else { - for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++) - drawOrder[i] = skeleton.slots[drawOrderToSetupIndex[i]]; - } - - } -}; - -spine.FfdTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; - this.frames.length = frameCount; - this.frameVertices = []; - this.frameVertices.length = frameCount; -}; -spine.FfdTimeline.prototype = { - slotIndex: 0, - attachment: 0, - getFrameCount: function () { - return this.frames.length; - }, - setFrame: function (frameIndex, time, vertices) { - this.frames[frameIndex] = time; - this.frameVertices[frameIndex] = vertices; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var slot = skeleton.slots[this.slotIndex]; - if (slot.attachment != this.attachment) return; - - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var frameVertices = this.frameVertices; - var vertexCount = frameVertices[0].length; - - var vertices = slot.attachmentVertices; - if (vertices.length != vertexCount) alpha = 1; - vertices.length = vertexCount; - - if (time >= frames[frames.length - 1]) { // Time is after last frame. - var lastVertices = frameVertices[frames.length - 1]; - if (alpha < 1) { - for (var i = 0; i < vertexCount; i++) - vertices[i] += (lastVertices[i] - vertices[i]) * alpha; - } else { - for (var i = 0; i < vertexCount; i++) - vertices[i] = lastVertices[i]; - } - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch1(frames, time); - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex - 1] - frameTime); - percent = this.curves.getCurvePercent(frameIndex - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent)); - - var prevVertices = frameVertices[frameIndex - 1]; - var nextVertices = frameVertices[frameIndex]; - - if (alpha < 1) { - for (var i = 0; i < vertexCount; i++) { - var prev = prevVertices[i]; - vertices[i] += (prev + (nextVertices[i] - prev) * percent - vertices[i]) * alpha; - } - } else { - for (var i = 0; i < vertexCount; i++) { - var prev = prevVertices[i]; - vertices[i] = prev + (nextVertices[i] - prev) * percent; - } - } - } -}; - -spine.IkConstraintTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, mix, bendDirection, ... - this.frames.length = frameCount * 3; -}; -spine.IkConstraintTimeline.prototype = { - ikConstraintIndex: 0, - getFrameCount: function () { - return this.frames.length / 3; - }, - setFrame: function (frameIndex, time, mix, bendDirection) { - frameIndex *= 3; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = mix; - this.frames[frameIndex + 2] = bendDirection; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) return; // Time is before first frame. - - var ikConstraint = skeleton.ikConstraints[this.ikConstraintIndex]; - - if (time >= frames[frames.length - 3]) { // Time is after last frame. - ikConstraint.mix += (frames[frames.length - 2] - ikConstraint.mix) * alpha; - ikConstraint.bendDirection = frames[frames.length - 1]; - return; - } - - // Interpolate between the previous frame and the current frame. - var frameIndex = spine.Animation.binarySearch(frames, time, 3); - var prevFrameMix = frames[frameIndex + -2/*PREV_FRAME_MIX*/]; - var frameTime = frames[frameIndex]; - var percent = 1 - (time - frameTime) / (frames[frameIndex + -3/*PREV_FRAME_TIME*/] - frameTime); - percent = this.curves.getCurvePercent(frameIndex / 3 - 1, percent); - - var mix = prevFrameMix + (frames[frameIndex + 1/*FRAME_MIX*/] - prevFrameMix) * percent; - ikConstraint.mix += (mix - ikConstraint.mix) * alpha; - ikConstraint.bendDirection = frames[frameIndex + -1/*PREV_FRAME_BEND_DIRECTION*/]; - } -}; - -spine.FlipXTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, flip, ... - this.frames.length = frameCount * 2; -}; -spine.FlipXTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, flip) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = flip ? 1 : 0; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - var frameIndex = (time >= frames[frames.length - 2] ? frames.length : spine.Animation.binarySearch(frames, time, 2)) - 2; - if (frames[frameIndex] < lastTime) return; - skeleton.bones[boneIndex].flipX = frames[frameIndex + 1] != 0; - } -}; - -spine.FlipYTimeline = function (frameCount) { - this.curves = new spine.Curves(frameCount); - this.frames = []; // time, flip, ... - this.frames.length = frameCount * 2; -}; -spine.FlipYTimeline.prototype = { - boneIndex: 0, - getFrameCount: function () { - return this.frames.length / 2; - }, - setFrame: function (frameIndex, time, flip) { - frameIndex *= 2; - this.frames[frameIndex] = time; - this.frames[frameIndex + 1] = flip ? 1 : 0; - }, - apply: function (skeleton, lastTime, time, firedEvents, alpha) { - var frames = this.frames; - if (time < frames[0]) { - if (lastTime > time) this.apply(skeleton, lastTime, Number.MAX_VALUE, null, 0); - return; - } else if (lastTime > time) // - lastTime = -1; - var frameIndex = (time >= frames[frames.length - 2] ? frames.length : spine.Animation.binarySearch(frames, time, 2)) - 2; - if (frames[frameIndex] < lastTime) return; - skeleton.bones[boneIndex].flipY = frames[frameIndex + 1] != 0; - } -}; - -spine.SkeletonData = function () { - this.bones = []; - this.slots = []; - this.skins = []; - this.events = []; - this.animations = []; - this.ikConstraints = []; -}; -spine.SkeletonData.prototype = { - name: null, - defaultSkin: null, - width: 0, height: 0, - version: null, hash: null, - /** @return May be null. */ - findBone: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].name == boneName) return bones[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findBoneIndex: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].name == boneName) return i; - return -1; - }, - /** @return May be null. */ - findSlot: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - if (slots[i].name == slotName) return slot[i]; - } - return null; - }, - /** @return -1 if the bone was not found. */ - findSlotIndex: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].name == slotName) return i; - return -1; - }, - /** @return May be null. */ - findSkin: function (skinName) { - var skins = this.skins; - for (var i = 0, n = skins.length; i < n; i++) - if (skins[i].name == skinName) return skins[i]; - return null; - }, - /** @return May be null. */ - findEvent: function (eventName) { - var events = this.events; - for (var i = 0, n = events.length; i < n; i++) - if (events[i].name == eventName) return events[i]; - return null; - }, - /** @return May be null. */ - findAnimation: function (animationName) { - var animations = this.animations; - for (var i = 0, n = animations.length; i < n; i++) - if (animations[i].name == animationName) return animations[i]; - return null; - }, - /** @return May be null. */ - findIkConstraint: function (ikConstraintName) { - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) - if (ikConstraints[i].name == ikConstraintName) return ikConstraints[i]; - return null; - } -}; - -spine.Skeleton = function (skeletonData) { - this.data = skeletonData; - - this.bones = []; - for (var i = 0, n = skeletonData.bones.length; i < n; i++) { - var boneData = skeletonData.bones[i]; - var parent = !boneData.parent ? null : this.bones[skeletonData.bones.indexOf(boneData.parent)]; - this.bones.push(new spine.Bone(boneData, this, parent)); - } - - this.slots = []; - this.drawOrder = []; - for (var i = 0, n = skeletonData.slots.length; i < n; i++) { - var slotData = skeletonData.slots[i]; - var bone = this.bones[skeletonData.bones.indexOf(slotData.boneData)]; - var slot = new spine.Slot(slotData, bone); - this.slots.push(slot); - this.drawOrder.push(slot); - } - - this.ikConstraints = []; - for (var i = 0, n = skeletonData.ikConstraints.length; i < n; i++) - this.ikConstraints.push(new spine.IkConstraint(skeletonData.ikConstraints[i], this)); - - this.boneCache = []; - this.updateCache(); -}; -spine.Skeleton.prototype = { - x: 0, y: 0, - skin: null, - r: 1, g: 1, b: 1, a: 1, - time: 0, - flipX: false, flipY: false, - /** Caches information about bones and IK constraints. Must be called if bones or IK constraints are added or removed. */ - updateCache: function () { - var ikConstraints = this.ikConstraints; - var ikConstraintsCount = ikConstraints.length; - - var arrayCount = ikConstraintsCount + 1; - var boneCache = this.boneCache; - if (boneCache.length > arrayCount) boneCache.length = arrayCount; - for (var i = 0, n = boneCache.length; i < n; i++) - boneCache[i].length = 0; - while (boneCache.length < arrayCount) - boneCache[boneCache.length] = []; - - var nonIkBones = boneCache[0]; - var bones = this.bones; - - outer: - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - var current = bone; - do { - for (var ii = 0; ii < ikConstraintsCount; ii++) { - var ikConstraint = ikConstraints[ii]; - var parent = ikConstraint.bones[0]; - var child= ikConstraint.bones[ikConstraint.bones.length - 1]; - while (true) { - if (current == child) { - boneCache[ii].push(bone); - boneCache[ii + 1].push(bone); - continue outer; - } - if (child == parent) break; - child = child.parent; - } - } - current = current.parent; - } while (current); - nonIkBones[nonIkBones.length] = bone; - } - }, - /** Updates the world transform for each bone. */ - updateWorldTransform: function () { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) { - var bone = bones[i]; - bone.rotationIK = bone.rotation; - } - var i = 0, last = this.boneCache.length - 1; - while (true) { - var cacheBones = this.boneCache[i]; - for (var ii = 0, nn = cacheBones.length; ii < nn; ii++) - cacheBones[ii].updateWorldTransform(); - if (i == last) break; - this.ikConstraints[i].apply(); - i++; - } - }, - /** Sets the bones and slots to their setup pose values. */ - setToSetupPose: function () { - this.setBonesToSetupPose(); - this.setSlotsToSetupPose(); - }, - setBonesToSetupPose: function () { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - bones[i].setToSetupPose(); - - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) { - var ikConstraint = ikConstraints[i]; - ikConstraint.bendDirection = ikConstraint.data.bendDirection; - ikConstraint.mix = ikConstraint.data.mix; - } - }, - setSlotsToSetupPose: function () { - var slots = this.slots; - var drawOrder = this.drawOrder; - for (var i = 0, n = slots.length; i < n; i++) { - drawOrder[i] = slots[i]; - slots[i].setToSetupPose(i); - } - }, - /** @return May return null. */ - getRootBone: function () { - return this.bones.length ? this.bones[0] : null; - }, - /** @return May be null. */ - findBone: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].data.name == boneName) return bones[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findBoneIndex: function (boneName) { - var bones = this.bones; - for (var i = 0, n = bones.length; i < n; i++) - if (bones[i].data.name == boneName) return i; - return -1; - }, - /** @return May be null. */ - findSlot: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].data.name == slotName) return slots[i]; - return null; - }, - /** @return -1 if the bone was not found. */ - findSlotIndex: function (slotName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) - if (slots[i].data.name == slotName) return i; - return -1; - }, - setSkinByName: function (skinName) { - var skin = this.data.findSkin(skinName); - if (!skin) throw "Skin not found: " + skinName; - this.setSkin(skin); - }, - /** Sets the skin used to look up attachments before looking in the {@link SkeletonData#getDefaultSkin() default skin}. - * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was - * no old skin, each slot's setup mode attachment is attached from the new skin. - * @param newSkin May be null. */ - setSkin: function (newSkin) { - if (newSkin) { - if (this.skin) - newSkin._attachAll(this, this.skin); - else { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - var name = slot.data.attachmentName; - if (name) { - var attachment = newSkin.getAttachment(i, name); - if (attachment) slot.setAttachment(attachment); - } - } - } - } - this.skin = newSkin; - }, - /** @return May be null. */ - getAttachmentBySlotName: function (slotName, attachmentName) { - return this.getAttachmentBySlotIndex(this.data.findSlotIndex(slotName), attachmentName); - }, - /** @return May be null. */ - getAttachmentBySlotIndex: function (slotIndex, attachmentName) { - if (this.skin) { - var attachment = this.skin.getAttachment(slotIndex, attachmentName); - if (attachment) return attachment; - } - if (this.data.defaultSkin) return this.data.defaultSkin.getAttachment(slotIndex, attachmentName); - return null; - }, - /** @param attachmentName May be null. */ - setAttachment: function (slotName, attachmentName) { - var slots = this.slots; - for (var i = 0, n = slots.length; i < n; i++) { - var slot = slots[i]; - if (slot.data.name == slotName) { - var attachment = null; - if (attachmentName) { - attachment = this.getAttachmentBySlotIndex(i, attachmentName); - if (!attachment) throw "Attachment not found: " + attachmentName + ", for slot: " + slotName; - } - slot.setAttachment(attachment); - return; - } - } - throw "Slot not found: " + slotName; - }, - /** @return May be null. */ - findIkConstraint: function (ikConstraintName) { - var ikConstraints = this.ikConstraints; - for (var i = 0, n = ikConstraints.length; i < n; i++) - if (ikConstraints[i].data.name == ikConstraintName) return ikConstraints[i]; - return null; - }, - update: function (delta) { - this.time += delta; - } -}; - -spine.EventData = function (name) { - this.name = name; -}; -spine.EventData.prototype = { - intValue: 0, - floatValue: 0, - stringValue: null -}; - -spine.Event = function (data) { - this.data = data; -}; -spine.Event.prototype = { - intValue: 0, - floatValue: 0, - stringValue: null -}; - -spine.AttachmentType = { - region: 0, - boundingbox: 1, - mesh: 2, - skinnedmesh: 3 -}; - -spine.RegionAttachment = function (name) { - this.name = name; - this.offset = []; - this.offset.length = 8; - this.uvs = []; - this.uvs.length = 8; -}; -spine.RegionAttachment.prototype = { - type: spine.AttachmentType.region, - x: 0, y: 0, - rotation: 0, - scaleX: 1, scaleY: 1, - width: 0, height: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - setUVs: function (u, v, u2, v2, rotate) { - var uvs = this.uvs; - if (rotate) { - uvs[2/*X2*/] = u; - uvs[3/*Y2*/] = v2; - uvs[4/*X3*/] = u; - uvs[5/*Y3*/] = v; - uvs[6/*X4*/] = u2; - uvs[7/*Y4*/] = v; - uvs[0/*X1*/] = u2; - uvs[1/*Y1*/] = v2; - } else { - uvs[0/*X1*/] = u; - uvs[1/*Y1*/] = v2; - uvs[2/*X2*/] = u; - uvs[3/*Y2*/] = v; - uvs[4/*X3*/] = u2; - uvs[5/*Y3*/] = v; - uvs[6/*X4*/] = u2; - uvs[7/*Y4*/] = v2; - } - }, - updateOffset: function () { - var regionScaleX = this.width / this.regionOriginalWidth * this.scaleX; - var regionScaleY = this.height / this.regionOriginalHeight * this.scaleY; - var localX = -this.width / 2 * this.scaleX + this.regionOffsetX * regionScaleX; - var localY = -this.height / 2 * this.scaleY + this.regionOffsetY * regionScaleY; - var localX2 = localX + this.regionWidth * regionScaleX; - var localY2 = localY + this.regionHeight * regionScaleY; - var radians = this.rotation * spine.degRad; - var cos = Math.cos(radians); - var sin = Math.sin(radians); - var localXCos = localX * cos + this.x; - var localXSin = localX * sin; - var localYCos = localY * cos + this.y; - var localYSin = localY * sin; - var localX2Cos = localX2 * cos + this.x; - var localX2Sin = localX2 * sin; - var localY2Cos = localY2 * cos + this.y; - var localY2Sin = localY2 * sin; - var offset = this.offset; - offset[0/*X1*/] = localXCos - localYSin; - offset[1/*Y1*/] = localYCos + localXSin; - offset[2/*X2*/] = localXCos - localY2Sin; - offset[3/*Y2*/] = localY2Cos + localXSin; - offset[4/*X3*/] = localX2Cos - localY2Sin; - offset[5/*Y3*/] = localY2Cos + localX2Sin; - offset[6/*X4*/] = localX2Cos - localYSin; - offset[7/*Y4*/] = localYCos + localX2Sin; - }, - computeVertices: function (x, y, bone, vertices) { - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var offset = this.offset; - vertices[0/*X1*/] = offset[0/*X1*/] * m00 + offset[1/*Y1*/] * m01 + x; - vertices[1/*Y1*/] = offset[0/*X1*/] * m10 + offset[1/*Y1*/] * m11 + y; - vertices[2/*X2*/] = offset[2/*X2*/] * m00 + offset[3/*Y2*/] * m01 + x; - vertices[3/*Y2*/] = offset[2/*X2*/] * m10 + offset[3/*Y2*/] * m11 + y; - vertices[4/*X3*/] = offset[4/*X3*/] * m00 + offset[5/*X3*/] * m01 + x; - vertices[5/*X3*/] = offset[4/*X3*/] * m10 + offset[5/*X3*/] * m11 + y; - vertices[6/*X4*/] = offset[6/*X4*/] * m00 + offset[7/*Y4*/] * m01 + x; - vertices[7/*Y4*/] = offset[6/*X4*/] * m10 + offset[7/*Y4*/] * m11 + y; - } -}; - -spine.MeshAttachment = function (name) { - this.name = name; -}; -spine.MeshAttachment.prototype = { - type: spine.AttachmentType.mesh, - vertices: null, - uvs: null, - regionUVs: null, - triangles: null, - hullLength: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionU: 0, regionV: 0, regionU2: 0, regionV2: 0, regionRotate: false, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - edges: null, - width: 0, height: 0, - updateUVs: function () { - var width = this.regionU2 - this.regionU, height = this.regionV2 - this.regionV; - var n = this.regionUVs.length; - if (!this.uvs || this.uvs.length != n) { - this.uvs = new spine.Float32Array(n); - } - if (this.regionRotate) { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i + 1] * width; - this.uvs[i + 1] = this.regionV + height - this.regionUVs[i] * height; - } - } else { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i] * width; - this.uvs[i + 1] = this.regionV + this.regionUVs[i + 1] * height; - } - } - }, - computeWorldVertices: function (x, y, slot, worldVertices) { - var bone = slot.bone; - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var vertices = this.vertices; - var verticesCount = vertices.length; - if (slot.attachmentVertices.length == verticesCount) vertices = slot.attachmentVertices; - for (var i = 0; i < verticesCount; i += 2) { - var vx = vertices[i]; - var vy = vertices[i + 1]; - worldVertices[i] = vx * m00 + vy * m01 + x; - worldVertices[i + 1] = vx * m10 + vy * m11 + y; - } - } -}; - -spine.SkinnedMeshAttachment = function (name) { - this.name = name; -}; -spine.SkinnedMeshAttachment.prototype = { - type: spine.AttachmentType.skinnedmesh, - bones: null, - weights: null, - uvs: null, - regionUVs: null, - triangles: null, - hullLength: 0, - r: 1, g: 1, b: 1, a: 1, - path: null, - rendererObject: null, - regionU: 0, regionV: 0, regionU2: 0, regionV2: 0, regionRotate: false, - regionOffsetX: 0, regionOffsetY: 0, - regionWidth: 0, regionHeight: 0, - regionOriginalWidth: 0, regionOriginalHeight: 0, - edges: null, - width: 0, height: 0, - updateUVs: function (u, v, u2, v2, rotate) { - var width = this.regionU2 - this.regionU, height = this.regionV2 - this.regionV; - var n = this.regionUVs.length; - if (!this.uvs || this.uvs.length != n) { - this.uvs = new spine.Float32Array(n); - } - if (this.regionRotate) { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i + 1] * width; - this.uvs[i + 1] = this.regionV + height - this.regionUVs[i] * height; - } - } else { - for (var i = 0; i < n; i += 2) { - this.uvs[i] = this.regionU + this.regionUVs[i] * width; - this.uvs[i + 1] = this.regionV + this.regionUVs[i + 1] * height; - } - } - }, - computeWorldVertices: function (x, y, slot, worldVertices) { - var skeletonBones = slot.bone.skeleton.bones; - var weights = this.weights; - var bones = this.bones; - - var w = 0, v = 0, b = 0, f = 0, n = bones.length, nn; - var wx, wy, bone, vx, vy, weight; - if (!slot.attachmentVertices.length) { - for (; v < n; w += 2) { - wx = 0; - wy = 0; - nn = bones[v++] + v; - for (; v < nn; v++, b += 3) { - bone = skeletonBones[bones[v]]; - vx = weights[b]; - vy = weights[b + 1]; - weight = weights[b + 2]; - wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight; - wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight; - } - worldVertices[w] = wx + x; - worldVertices[w + 1] = wy + y; - } - } else { - var ffd = slot.attachmentVertices; - for (; v < n; w += 2) { - wx = 0; - wy = 0; - nn = bones[v++] + v; - for (; v < nn; v++, b += 3, f += 2) { - bone = skeletonBones[bones[v]]; - vx = weights[b] + ffd[f]; - vy = weights[b + 1] + ffd[f + 1]; - weight = weights[b + 2]; - wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight; - wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight; - } - worldVertices[w] = wx + x; - worldVertices[w + 1] = wy + y; - } - } - } -}; - -spine.BoundingBoxAttachment = function (name) { - this.name = name; - this.vertices = []; -}; -spine.BoundingBoxAttachment.prototype = { - type: spine.AttachmentType.boundingbox, - computeWorldVertices: function (x, y, bone, worldVertices) { - x += bone.worldX; - y += bone.worldY; - var m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; - var vertices = this.vertices; - for (var i = 0, n = vertices.length; i < n; i += 2) { - var px = vertices[i]; - var py = vertices[i + 1]; - worldVertices[i] = px * m00 + py * m01 + x; - worldVertices[i + 1] = px * m10 + py * m11 + y; - } - } -}; - -spine.AnimationStateData = function (skeletonData) { - this.skeletonData = skeletonData; - this.animationToMixTime = {}; -}; -spine.AnimationStateData.prototype = { - defaultMix: 0, - setMixByName: function (fromName, toName, duration) { - var from = this.skeletonData.findAnimation(fromName); - if (!from) throw "Animation not found: " + fromName; - var to = this.skeletonData.findAnimation(toName); - if (!to) throw "Animation not found: " + toName; - this.setMix(from, to, duration); - }, - setMix: function (from, to, duration) { - this.animationToMixTime[from.name + ":" + to.name] = duration; - }, - getMix: function (from, to) { - var key = from.name + ":" + to.name; - return this.animationToMixTime.hasOwnProperty(key) ? this.animationToMixTime[key] : this.defaultMix; - } -}; - -spine.TrackEntry = function () {}; -spine.TrackEntry.prototype = { - next: null, previous: null, - animation: null, - loop: false, - delay: 0, time: 0, lastTime: -1, endTime: 0, - timeScale: 1, - mixTime: 0, mixDuration: 0, mix: 1, - onStart: null, onEnd: null, onComplete: null, onEvent: null -}; - -spine.AnimationState = function (stateData) { - this.data = stateData; - this.tracks = []; - this.events = []; -}; -spine.AnimationState.prototype = { - onStart: null, - onEnd: null, - onComplete: null, - onEvent: null, - timeScale: 1, - update: function (delta) { - delta *= this.timeScale; - for (var i = 0; i < this.tracks.length; i++) { - var current = this.tracks[i]; - if (!current) continue; - - current.time += delta * current.timeScale; - if (current.previous) { - var previousDelta = delta * current.previous.timeScale; - current.previous.time += previousDelta; - current.mixTime += previousDelta; - } - - var next = current.next; - if (next) { - next.time = current.lastTime - next.delay; - if (next.time >= 0) this.setCurrent(i, next); - } else { - // End non-looping animation when it reaches its end time and there is no next entry. - if (!current.loop && current.lastTime >= current.endTime) this.clearTrack(i); - } - } - }, - apply: function (skeleton) { - for (var i = 0; i < this.tracks.length; i++) { - var current = this.tracks[i]; - if (!current) continue; - - this.events.length = 0; - - var time = current.time; - var lastTime = current.lastTime; - var endTime = current.endTime; - var loop = current.loop; - if (!loop && time > endTime) time = endTime; - - var previous = current.previous; - if (!previous) { - if (current.mix == 1) - current.animation.apply(skeleton, current.lastTime, time, loop, this.events); - else - current.animation.mix(skeleton, current.lastTime, time, loop, this.events, current.mix); - } else { - var previousTime = previous.time; - if (!previous.loop && previousTime > previous.endTime) previousTime = previous.endTime; - previous.animation.apply(skeleton, previousTime, previousTime, previous.loop, null); - - var alpha = current.mixTime / current.mixDuration * current.mix; - if (alpha >= 1) { - alpha = 1; - current.previous = null; - } - current.animation.mix(skeleton, current.lastTime, time, loop, this.events, alpha); - } - - for (var ii = 0, nn = this.events.length; ii < nn; ii++) { - var event = this.events[ii]; - if (current.onEvent) current.onEvent(i, event); - if (this.onEvent) this.onEvent(i, event); - } - - // Check if completed the animation or a loop iteration. - if (loop ? (lastTime % endTime > time % endTime) : (lastTime < endTime && time >= endTime)) { - var count = Math.floor(time / endTime); - if (current.onComplete) current.onComplete(i, count); - if (this.onComplete) this.onComplete(i, count); - } - - current.lastTime = current.time; - } - }, - clearTracks: function () { - for (var i = 0, n = this.tracks.length; i < n; i++) - this.clearTrack(i); - this.tracks.length = 0; - }, - clearTrack: function (trackIndex) { - if (trackIndex >= this.tracks.length) return; - var current = this.tracks[trackIndex]; - if (!current) return; - - if (current.onEnd) current.onEnd(trackIndex); - if (this.onEnd) this.onEnd(trackIndex); - - this.tracks[trackIndex] = null; - }, - _expandToIndex: function (index) { - if (index < this.tracks.length) return this.tracks[index]; - while (index >= this.tracks.length) - this.tracks.push(null); - return null; - }, - setCurrent: function (index, entry) { - var current = this._expandToIndex(index); - if (current) { - var previous = current.previous; - current.previous = null; - - if (current.onEnd) current.onEnd(index); - if (this.onEnd) this.onEnd(index); - - entry.mixDuration = this.data.getMix(current.animation, entry.animation); - if (entry.mixDuration > 0) { - entry.mixTime = 0; - // If a mix is in progress, mix from the closest animation. - if (previous && current.mixTime / current.mixDuration < 0.5) - entry.previous = previous; - else - entry.previous = current; - } - } - - this.tracks[index] = entry; - - if (entry.onStart) entry.onStart(index); - if (this.onStart) this.onStart(index); - }, - setAnimationByName: function (trackIndex, animationName, loop) { - var animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) throw "Animation not found: " + animationName; - return this.setAnimation(trackIndex, animation, loop); - }, - /** Set the current animation. Any queued animations are cleared. */ - setAnimation: function (trackIndex, animation, loop) { - var entry = new spine.TrackEntry(); - entry.animation = animation; - entry.loop = loop; - entry.endTime = animation.duration; - this.setCurrent(trackIndex, entry); - return entry; - }, - addAnimationByName: function (trackIndex, animationName, loop, delay) { - var animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) throw "Animation not found: " + animationName; - return this.addAnimation(trackIndex, animation, loop, delay); - }, - /** Adds an animation to be played delay seconds after the current or last queued animation. - * @param delay May be <= 0 to use duration of previous animation minus any mix duration plus the negative delay. */ - addAnimation: function (trackIndex, animation, loop, delay) { - var entry = new spine.TrackEntry(); - entry.animation = animation; - entry.loop = loop; - entry.endTime = animation.duration; - - var last = this._expandToIndex(trackIndex); - if (last) { - while (last.next) - last = last.next; - last.next = entry; - } else - this.tracks[trackIndex] = entry; - - if (delay <= 0) { - if (last) - delay += last.endTime - this.data.getMix(last.animation, animation); - else - delay = 0; - } - entry.delay = delay; - - return entry; - }, - /** May be null. */ - getCurrent: function (trackIndex) { - if (trackIndex >= this.tracks.length) return null; - return this.tracks[trackIndex]; - } -}; - -spine.SkeletonJson = function (attachmentLoader) { - this.attachmentLoader = attachmentLoader; -}; -spine.SkeletonJson.prototype = { - scale: 1, - readSkeletonData: function (root, name) { - var skeletonData = new spine.SkeletonData(); - skeletonData.name = name; - - // Skeleton. - var skeletonMap = root["skeleton"]; - if (skeletonMap) { - skeletonData.hash = skeletonMap["hash"]; - skeletonData.version = skeletonMap["spine"]; - skeletonData.width = skeletonMap["width"] || 0; - skeletonData.height = skeletonMap["height"] || 0; - } - - // Bones. - var bones = root["bones"]; - for (var i = 0, n = bones.length; i < n; i++) { - var boneMap = bones[i]; - var parent = null; - if (boneMap["parent"]) { - parent = skeletonData.findBone(boneMap["parent"]); - if (!parent) throw "Parent bone not found: " + boneMap["parent"]; - } - var boneData = new spine.BoneData(boneMap["name"], parent); - boneData.length = (boneMap["length"] || 0) * this.scale; - boneData.x = (boneMap["x"] || 0) * this.scale; - boneData.y = (boneMap["y"] || 0) * this.scale; - boneData.rotation = (boneMap["rotation"] || 0); - boneData.scaleX = boneMap.hasOwnProperty("scaleX") ? boneMap["scaleX"] : 1; - boneData.scaleY = boneMap.hasOwnProperty("scaleY") ? boneMap["scaleY"] : 1; - boneData.inheritScale = boneMap.hasOwnProperty("inheritScale") ? boneMap["inheritScale"] : true; - boneData.inheritRotation = boneMap.hasOwnProperty("inheritRotation") ? boneMap["inheritRotation"] : true; - skeletonData.bones.push(boneData); - } - - // IK constraints. - var ik = root["ik"]; - if (ik) { - for (var i = 0, n = ik.length; i < n; i++) { - var ikMap = ik[i]; - var ikConstraintData = new spine.IkConstraintData(ikMap["name"]); - - var bones = ikMap["bones"]; - for (var ii = 0, nn = bones.length; ii < nn; ii++) { - var bone = skeletonData.findBone(bones[ii]); - if (!bone) throw "IK bone not found: " + bones[ii]; - ikConstraintData.bones.push(bone); - } - - ikConstraintData.target = skeletonData.findBone(ikMap["target"]); - if (!ikConstraintData.target) throw "Target bone not found: " + ikMap["target"]; - - ikConstraintData.bendDirection = (!ikMap.hasOwnProperty("bendPositive") || ikMap["bendPositive"]) ? 1 : -1; - ikConstraintData.mix = ikMap.hasOwnProperty("mix") ? ikMap["mix"] : 1; - - skeletonData.ikConstraints.push(ikConstraintData); - } - } - - // Slots. - var slots = root["slots"]; - for (var i = 0, n = slots.length; i < n; i++) { - var slotMap = slots[i]; - var boneData = skeletonData.findBone(slotMap["bone"]); - if (!boneData) throw "Slot bone not found: " + slotMap["bone"]; - var slotData = new spine.SlotData(slotMap["name"], boneData); - - var color = slotMap["color"]; - if (color) { - slotData.r = this.toColor(color, 0); - slotData.g = this.toColor(color, 1); - slotData.b = this.toColor(color, 2); - slotData.a = this.toColor(color, 3); - } - - slotData.attachmentName = slotMap["attachment"]; - slotData.additiveBlending = slotMap["additive"] && slotMap["additive"] == "true"; - - skeletonData.slots.push(slotData); - } - - // Skins. - var skins = root["skins"]; - for (var skinName in skins) { - if (!skins.hasOwnProperty(skinName)) continue; - var skinMap = skins[skinName]; - var skin = new spine.Skin(skinName); - for (var slotName in skinMap) { - if (!skinMap.hasOwnProperty(slotName)) continue; - var slotIndex = skeletonData.findSlotIndex(slotName); - var slotEntry = skinMap[slotName]; - for (var attachmentName in slotEntry) { - if (!slotEntry.hasOwnProperty(attachmentName)) continue; - var attachment = this.readAttachment(skin, attachmentName, slotEntry[attachmentName]); - if (attachment) skin.addAttachment(slotIndex, attachmentName, attachment); - } - } - skeletonData.skins.push(skin); - if (skin.name == "default") skeletonData.defaultSkin = skin; - } - - // Events. - var events = root["events"]; - for (var eventName in events) { - if (!events.hasOwnProperty(eventName)) continue; - var eventMap = events[eventName]; - var eventData = new spine.EventData(eventName); - eventData.intValue = eventMap["int"] || 0; - eventData.floatValue = eventMap["float"] || 0; - eventData.stringValue = eventMap["string"] || null; - skeletonData.events.push(eventData); - } - - // Animations. - var animations = root["animations"]; - for (var animationName in animations) { - if (!animations.hasOwnProperty(animationName)) continue; - this.readAnimation(animationName, animations[animationName], skeletonData); - } - - return skeletonData; - }, - readAttachment: function (skin, name, map) { - name = map["name"] || name; - - var type = spine.AttachmentType[map["type"] || "region"]; - var path = map["path"] || name; - - var scale = this.scale; - if (type == spine.AttachmentType.region) { - var region = this.attachmentLoader.newRegionAttachment(skin, name, path); - if (!region) return null; - region.path = path; - region.x = (map["x"] || 0) * scale; - region.y = (map["y"] || 0) * scale; - region.scaleX = map.hasOwnProperty("scaleX") ? map["scaleX"] : 1; - region.scaleY = map.hasOwnProperty("scaleY") ? map["scaleY"] : 1; - region.rotation = map["rotation"] || 0; - region.width = (map["width"] || 0) * scale; - region.height = (map["height"] || 0) * scale; - - var color = map["color"]; - if (color) { - region.r = this.toColor(color, 0); - region.g = this.toColor(color, 1); - region.b = this.toColor(color, 2); - region.a = this.toColor(color, 3); - } - - region.updateOffset(); - return region; - } else if (type == spine.AttachmentType.mesh) { - var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path); - if (!mesh) return null; - mesh.path = path; - mesh.vertices = this.getFloatArray(map, "vertices", scale); - mesh.triangles = this.getIntArray(map, "triangles"); - mesh.regionUVs = this.getFloatArray(map, "uvs", 1); - mesh.updateUVs(); - - color = map["color"]; - if (color) { - mesh.r = this.toColor(color, 0); - mesh.g = this.toColor(color, 1); - mesh.b = this.toColor(color, 2); - mesh.a = this.toColor(color, 3); - } - - mesh.hullLength = (map["hull"] || 0) * 2; - if (map["edges"]) mesh.edges = this.getIntArray(map, "edges"); - mesh.width = (map["width"] || 0) * scale; - mesh.height = (map["height"] || 0) * scale; - return mesh; - } else if (type == spine.AttachmentType.skinnedmesh) { - var mesh = this.attachmentLoader.newSkinnedMeshAttachment(skin, name, path); - if (!mesh) return null; - mesh.path = path; - - var uvs = this.getFloatArray(map, "uvs", 1); - var vertices = this.getFloatArray(map, "vertices", 1); - var weights = []; - var bones = []; - for (var i = 0, n = vertices.length; i < n; ) { - var boneCount = vertices[i++] | 0; - bones[bones.length] = boneCount; - for (var nn = i + boneCount * 4; i < nn; ) { - bones[bones.length] = vertices[i]; - weights[weights.length] = vertices[i + 1] * scale; - weights[weights.length] = vertices[i + 2] * scale; - weights[weights.length] = vertices[i + 3]; - i += 4; - } - } - mesh.bones = bones; - mesh.weights = weights; - mesh.triangles = this.getIntArray(map, "triangles"); - mesh.regionUVs = uvs; - mesh.updateUVs(); - - color = map["color"]; - if (color) { - mesh.r = this.toColor(color, 0); - mesh.g = this.toColor(color, 1); - mesh.b = this.toColor(color, 2); - mesh.a = this.toColor(color, 3); - } - - mesh.hullLength = (map["hull"] || 0) * 2; - if (map["edges"]) mesh.edges = this.getIntArray(map, "edges"); - mesh.width = (map["width"] || 0) * scale; - mesh.height = (map["height"] || 0) * scale; - return mesh; - } else if (type == spine.AttachmentType.boundingbox) { - var attachment = this.attachmentLoader.newBoundingBoxAttachment(skin, name); - var vertices = map["vertices"]; - for (var i = 0, n = vertices.length; i < n; i++) - attachment.vertices.push(vertices[i] * scale); - return attachment; - } - throw "Unknown attachment type: " + type; - }, - readAnimation: function (name, map, skeletonData) { - var timelines = []; - var duration = 0; - - var slots = map["slots"]; - for (var slotName in slots) { - if (!slots.hasOwnProperty(slotName)) continue; - var slotMap = slots[slotName]; - var slotIndex = skeletonData.findSlotIndex(slotName); - - for (var timelineName in slotMap) { - if (!slotMap.hasOwnProperty(timelineName)) continue; - var values = slotMap[timelineName]; - if (timelineName == "color") { - var timeline = new spine.ColorTimeline(values.length); - timeline.slotIndex = slotIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var color = valueMap["color"]; - var r = this.toColor(color, 0); - var g = this.toColor(color, 1); - var b = this.toColor(color, 2); - var a = this.toColor(color, 3); - timeline.setFrame(frameIndex, valueMap["time"], r, g, b, a); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 5 - 5]); - - } else if (timelineName == "attachment") { - var timeline = new spine.AttachmentTimeline(values.length); - timeline.slotIndex = slotIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex++, valueMap["time"], valueMap["name"]); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - - } else - throw "Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")"; - } - } - - var bones = map["bones"]; - for (var boneName in bones) { - if (!bones.hasOwnProperty(boneName)) continue; - var boneIndex = skeletonData.findBoneIndex(boneName); - if (boneIndex == -1) throw "Bone not found: " + boneName; - var boneMap = bones[boneName]; - - for (var timelineName in boneMap) { - if (!boneMap.hasOwnProperty(timelineName)) continue; - var values = boneMap[timelineName]; - if (timelineName == "rotate") { - var timeline = new spine.RotateTimeline(values.length); - timeline.boneIndex = boneIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex, valueMap["time"], valueMap["angle"]); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 2 - 2]); - - } else if (timelineName == "translate" || timelineName == "scale") { - var timeline; - var timelineScale = 1; - if (timelineName == "scale") - timeline = new spine.ScaleTimeline(values.length); - else { - timeline = new spine.TranslateTimeline(values.length); - timelineScale = this.scale; - } - timeline.boneIndex = boneIndex; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var x = (valueMap["x"] || 0) * timelineScale; - var y = (valueMap["y"] || 0) * timelineScale; - timeline.setFrame(frameIndex, valueMap["time"], x, y); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 3 - 3]); - - } else if (timelineName == "flipX" || timelineName == "flipY") { - var x = timelineName == "flipX"; - var timeline = x ? new spine.FlipXTimeline(values.length) : new spine.FlipYTimeline(values.length); - timeline.boneIndex = boneIndex; - - var field = x ? "x" : "y"; - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - timeline.setFrame(frameIndex, valueMap["time"], valueMap[field] || false); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 2 - 2]); - } else - throw "Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")"; - } - } - - var ikMap = map["ik"]; - for (var ikConstraintName in ikMap) { - if (!ikMap.hasOwnProperty(ikConstraintName)) continue; - var ikConstraint = skeletonData.findIkConstraint(ikConstraintName); - var values = ikMap[ikConstraintName]; - var timeline = new spine.IkConstraintTimeline(values.length); - timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(ikConstraint); - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var mix = valueMap.hasOwnProperty("mix") ? valueMap["mix"] : 1; - var bendDirection = (!valueMap.hasOwnProperty("bendPositive") || valueMap["bendPositive"]) ? 1 : -1; - timeline.setFrame(frameIndex, valueMap["time"], mix, bendDirection); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.frameCount * 3 - 3]); - } - - var ffd = map["ffd"]; - for (var skinName in ffd) { - var skin = skeletonData.findSkin(skinName); - var slotMap = ffd[skinName]; - for (slotName in slotMap) { - var slotIndex = skeletonData.findSlotIndex(slotName); - var meshMap = slotMap[slotName]; - for (var meshName in meshMap) { - var values = meshMap[meshName]; - var timeline = new spine.FfdTimeline(values.length); - var attachment = skin.getAttachment(slotIndex, meshName); - if (!attachment) throw "FFD attachment not found: " + meshName; - timeline.slotIndex = slotIndex; - timeline.attachment = attachment; - - var isMesh = attachment.type == spine.AttachmentType.mesh; - var vertexCount; - if (isMesh) - vertexCount = attachment.vertices.length; - else - vertexCount = attachment.weights.length / 3 * 2; - - var frameIndex = 0; - for (var i = 0, n = values.length; i < n; i++) { - var valueMap = values[i]; - var vertices; - if (!valueMap["vertices"]) { - if (isMesh) - vertices = attachment.vertices; - else { - vertices = []; - vertices.length = vertexCount; - } - } else { - var verticesValue = valueMap["vertices"]; - var vertices = []; - vertices.length = vertexCount; - var start = valueMap["offset"] || 0; - var nn = verticesValue.length; - if (this.scale == 1) { - for (var ii = 0; ii < nn; ii++) - vertices[ii + start] = verticesValue[ii]; - } else { - for (var ii = 0; ii < nn; ii++) - vertices[ii + start] = verticesValue[ii] * this.scale; - } - if (isMesh) { - var meshVertices = attachment.vertices; - for (var ii = 0, nn = vertices.length; ii < nn; ii++) - vertices[ii] += meshVertices[ii]; - } - } - - timeline.setFrame(frameIndex, valueMap["time"], vertices); - this.readCurve(timeline, frameIndex, valueMap); - frameIndex++; - } - timelines[timelines.length] = timeline; - duration = Math.max(duration, timeline.frames[timeline.frameCount - 1]); - } - } - } - - var drawOrderValues = map["drawOrder"]; - if (!drawOrderValues) drawOrderValues = map["draworder"]; - if (drawOrderValues) { - var timeline = new spine.DrawOrderTimeline(drawOrderValues.length); - var slotCount = skeletonData.slots.length; - var frameIndex = 0; - for (var i = 0, n = drawOrderValues.length; i < n; i++) { - var drawOrderMap = drawOrderValues[i]; - var drawOrder = null; - if (drawOrderMap["offsets"]) { - drawOrder = []; - drawOrder.length = slotCount; - for (var ii = slotCount - 1; ii >= 0; ii--) - drawOrder[ii] = -1; - var offsets = drawOrderMap["offsets"]; - var unchanged = []; - unchanged.length = slotCount - offsets.length; - var originalIndex = 0, unchangedIndex = 0; - for (var ii = 0, nn = offsets.length; ii < nn; ii++) { - var offsetMap = offsets[ii]; - var slotIndex = skeletonData.findSlotIndex(offsetMap["slot"]); - if (slotIndex == -1) throw "Slot not found: " + offsetMap["slot"]; - // Collect unchanged items. - while (originalIndex != slotIndex) - unchanged[unchangedIndex++] = originalIndex++; - // Set changed items. - drawOrder[originalIndex + offsetMap["offset"]] = originalIndex++; - } - // Collect remaining unchanged items. - while (originalIndex < slotCount) - unchanged[unchangedIndex++] = originalIndex++; - // Fill in unchanged items. - for (var ii = slotCount - 1; ii >= 0; ii--) - if (drawOrder[ii] == -1) drawOrder[ii] = unchanged[--unchangedIndex]; - } - timeline.setFrame(frameIndex++, drawOrderMap["time"], drawOrder); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - - var events = map["events"]; - if (events) { - var timeline = new spine.EventTimeline(events.length); - var frameIndex = 0; - for (var i = 0, n = events.length; i < n; i++) { - var eventMap = events[i]; - var eventData = skeletonData.findEvent(eventMap["name"]); - if (!eventData) throw "Event not found: " + eventMap["name"]; - var event = new spine.Event(eventData); - event.intValue = eventMap.hasOwnProperty("int") ? eventMap["int"] : eventData.intValue; - event.floatValue = eventMap.hasOwnProperty("float") ? eventMap["float"] : eventData.floatValue; - event.stringValue = eventMap.hasOwnProperty("string") ? eventMap["string"] : eventData.stringValue; - timeline.setFrame(frameIndex++, eventMap["time"], event); - } - timelines.push(timeline); - duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]); - } - - skeletonData.animations.push(new spine.Animation(name, timelines, duration)); - }, - readCurve: function (timeline, frameIndex, valueMap) { - var curve = valueMap["curve"]; - if (!curve) - timeline.curves.setLinear(frameIndex); - else if (curve == "stepped") - timeline.curves.setStepped(frameIndex); - else if (curve instanceof Array) - timeline.curves.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]); - }, - toColor: function (hexString, colorIndex) { - if (hexString.length != 8) throw "Color hexidecimal length must be 8, recieved: " + hexString; - return parseInt(hexString.substring(colorIndex * 2, (colorIndex * 2) + 2), 16) / 255; - }, - getFloatArray: function (map, name, scale) { - var list = map[name]; - var values = new spine.Float32Array(list.length); - var i = 0, n = list.length; - if (scale == 1) { - for (; i < n; i++) - values[i] = list[i]; - } else { - for (; i < n; i++) - values[i] = list[i] * scale; - } - return values; - }, - getIntArray: function (map, name) { - var list = map[name]; - var values = new spine.Uint16Array(list.length); - for (var i = 0, n = list.length; i < n; i++) - values[i] = list[i] | 0; - return values; - } -}; - -spine.Atlas = function (atlasText, textureLoader) { - this.textureLoader = textureLoader; - this.pages = []; - this.regions = []; - - var reader = new spine.AtlasReader(atlasText); - var tuple = []; - tuple.length = 4; - var page = null; - while (true) { - var line = reader.readLine(); - if (line === null) break; - line = reader.trim(line); - if (!line.length) - page = null; - else if (!page) { - page = new spine.AtlasPage(); - page.name = line; - - if (reader.readTuple(tuple) == 2) { // size is only optional for an atlas packed with an old TexturePacker. - page.width = parseInt(tuple[0]); - page.height = parseInt(tuple[1]); - reader.readTuple(tuple); - } - page.format = spine.Atlas.Format[tuple[0]]; - - reader.readTuple(tuple); - page.minFilter = spine.Atlas.TextureFilter[tuple[0]]; - page.magFilter = spine.Atlas.TextureFilter[tuple[1]]; - - var direction = reader.readValue(); - page.uWrap = spine.Atlas.TextureWrap.clampToEdge; - page.vWrap = spine.Atlas.TextureWrap.clampToEdge; - if (direction == "x") - page.uWrap = spine.Atlas.TextureWrap.repeat; - else if (direction == "y") - page.vWrap = spine.Atlas.TextureWrap.repeat; - else if (direction == "xy") - page.uWrap = page.vWrap = spine.Atlas.TextureWrap.repeat; - - textureLoader.load(page, line, this); - - this.pages.push(page); - - } else { - var region = new spine.AtlasRegion(); - region.name = line; - region.page = page; - - region.rotate = reader.readValue() == "true"; - - reader.readTuple(tuple); - var x = parseInt(tuple[0]); - var y = parseInt(tuple[1]); - - reader.readTuple(tuple); - var width = parseInt(tuple[0]); - var height = parseInt(tuple[1]); - - region.u = x / page.width; - region.v = y / page.height; - if (region.rotate) { - region.u2 = (x + height) / page.width; - region.v2 = (y + width) / page.height; - } else { - region.u2 = (x + width) / page.width; - region.v2 = (y + height) / page.height; - } - region.x = x; - region.y = y; - region.width = Math.abs(width); - region.height = Math.abs(height); - - if (reader.readTuple(tuple) == 4) { // split is optional - region.splits = [parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3])]; - - if (reader.readTuple(tuple) == 4) { // pad is optional, but only present with splits - region.pads = [parseInt(tuple[0]), parseInt(tuple[1]), parseInt(tuple[2]), parseInt(tuple[3])]; - - reader.readTuple(tuple); - } - } - - region.originalWidth = parseInt(tuple[0]); - region.originalHeight = parseInt(tuple[1]); - - reader.readTuple(tuple); - region.offsetX = parseInt(tuple[0]); - region.offsetY = parseInt(tuple[1]); - - region.index = parseInt(reader.readValue()); - - this.regions.push(region); - } - } -}; -spine.Atlas.prototype = { - findRegion: function (name) { - var regions = this.regions; - for (var i = 0, n = regions.length; i < n; i++) - if (regions[i].name == name) return regions[i]; - return null; - }, - dispose: function () { - var pages = this.pages; - for (var i = 0, n = pages.length; i < n; i++) - this.textureLoader.unload(pages[i].rendererObject); - }, - updateUVs: function (page) { - var regions = this.regions; - for (var i = 0, n = regions.length; i < n; i++) { - var region = regions[i]; - if (region.page != page) continue; - region.u = region.x / page.width; - region.v = region.y / page.height; - if (region.rotate) { - region.u2 = (region.x + region.height) / page.width; - region.v2 = (region.y + region.width) / page.height; - } else { - region.u2 = (region.x + region.width) / page.width; - region.v2 = (region.y + region.height) / page.height; - } - } - } -}; - -spine.Atlas.Format = { - alpha: 0, - intensity: 1, - luminanceAlpha: 2, - rgb565: 3, - rgba4444: 4, - rgb888: 5, - rgba8888: 6 -}; - -spine.Atlas.TextureFilter = { - nearest: 0, - linear: 1, - mipMap: 2, - mipMapNearestNearest: 3, - mipMapLinearNearest: 4, - mipMapNearestLinear: 5, - mipMapLinearLinear: 6 -}; - -spine.Atlas.TextureWrap = { - mirroredRepeat: 0, - clampToEdge: 1, - repeat: 2 -}; - -spine.AtlasPage = function () {}; -spine.AtlasPage.prototype = { - name: null, - format: null, - minFilter: null, - magFilter: null, - uWrap: null, - vWrap: null, - rendererObject: null, - width: 0, - height: 0 -}; - -spine.AtlasRegion = function () {}; -spine.AtlasRegion.prototype = { - page: null, - name: null, - x: 0, y: 0, - width: 0, height: 0, - u: 0, v: 0, u2: 0, v2: 0, - offsetX: 0, offsetY: 0, - originalWidth: 0, originalHeight: 0, - index: 0, - rotate: false, - splits: null, - pads: null -}; - -spine.AtlasReader = function (text) { - this.lines = text.split(/\r\n|\r|\n/); -}; -spine.AtlasReader.prototype = { - index: 0, - trim: function (value) { - return value.replace(/^\s+|\s+$/g, ""); - }, - readLine: function () { - if (this.index >= this.lines.length) return null; - return this.lines[this.index++]; - }, - readValue: function () { - var line = this.readLine(); - var colon = line.indexOf(":"); - if (colon == -1) throw "Invalid line: " + line; - return this.trim(line.substring(colon + 1)); - }, - /** Returns the number of tuple values read (1, 2 or 4). */ - readTuple: function (tuple) { - var line = this.readLine(); - var colon = line.indexOf(":"); - if (colon == -1) throw "Invalid line: " + line; - var i = 0, lastMatch = colon + 1; - for (; i < 3; i++) { - var comma = line.indexOf(",", lastMatch); - if (comma == -1) break; - tuple[i] = this.trim(line.substr(lastMatch, comma - lastMatch)); - lastMatch = comma + 1; - } - tuple[i] = this.trim(line.substring(lastMatch)); - return i + 1; - } -}; - -spine.AtlasAttachmentLoader = function (atlas) { - this.atlas = atlas; -}; -spine.AtlasAttachmentLoader.prototype = { - newRegionAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (region attachment: " + name + ")"; - var attachment = new spine.RegionAttachment(name); - attachment.rendererObject = region; - attachment.setUVs(region.u, region.v, region.u2, region.v2, region.rotate); - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newMeshAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (mesh attachment: " + name + ")"; - var attachment = new spine.MeshAttachment(name); - attachment.rendererObject = region; - attachment.regionU = region.u; - attachment.regionV = region.v; - attachment.regionU2 = region.u2; - attachment.regionV2 = region.v2; - attachment.regionRotate = region.rotate; - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newSkinnedMeshAttachment: function (skin, name, path) { - var region = this.atlas.findRegion(path); - if (!region) throw "Region not found in atlas: " + path + " (skinned mesh attachment: " + name + ")"; - var attachment = new spine.SkinnedMeshAttachment(name); - attachment.rendererObject = region; - attachment.regionU = region.u; - attachment.regionV = region.v; - attachment.regionU2 = region.u2; - attachment.regionV2 = region.v2; - attachment.regionRotate = region.rotate; - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - return attachment; - }, - newBoundingBoxAttachment: function (skin, name) { - return new spine.BoundingBoxAttachment(name); - } -}; - -spine.SkeletonBounds = function () { - this.polygonPool = []; - this.polygons = []; - this.boundingBoxes = []; -}; -spine.SkeletonBounds.prototype = { - minX: 0, minY: 0, maxX: 0, maxY: 0, - update: function (skeleton, updateAabb) { - var slots = skeleton.slots; - var slotCount = slots.length; - var x = skeleton.x, y = skeleton.y; - var boundingBoxes = this.boundingBoxes; - var polygonPool = this.polygonPool; - var polygons = this.polygons; - - boundingBoxes.length = 0; - for (var i = 0, n = polygons.length; i < n; i++) - polygonPool.push(polygons[i]); - polygons.length = 0; - - for (var i = 0; i < slotCount; i++) { - var slot = slots[i]; - var boundingBox = slot.attachment; - if (boundingBox.type != spine.AttachmentType.boundingbox) continue; - boundingBoxes.push(boundingBox); - - var poolCount = polygonPool.length, polygon; - if (poolCount > 0) { - polygon = polygonPool[poolCount - 1]; - polygonPool.splice(poolCount - 1, 1); - } else - polygon = []; - polygons.push(polygon); - - polygon.length = boundingBox.vertices.length; - boundingBox.computeWorldVertices(x, y, slot.bone, polygon); - } - - if (updateAabb) this.aabbCompute(); - }, - aabbCompute: function () { - var polygons = this.polygons; - var minX = Number.MAX_VALUE, minY = Number.MAX_VALUE, maxX = Number.MIN_VALUE, maxY = Number.MIN_VALUE; - for (var i = 0, n = polygons.length; i < n; i++) { - var vertices = polygons[i]; - for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) { - var x = vertices[ii]; - var y = vertices[ii + 1]; - minX = Math.min(minX, x); - minY = Math.min(minY, y); - maxX = Math.max(maxX, x); - maxY = Math.max(maxY, y); - } - } - this.minX = minX; - this.minY = minY; - this.maxX = maxX; - this.maxY = maxY; - }, - /** Returns true if the axis aligned bounding box contains the point. */ - aabbContainsPoint: function (x, y) { - return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY; - }, - /** Returns true if the axis aligned bounding box intersects the line segment. */ - aabbIntersectsSegment: function (x1, y1, x2, y2) { - var minX = this.minX, minY = this.minY, maxX = this.maxX, maxY = this.maxY; - if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY)) - return false; - var m = (y2 - y1) / (x2 - x1); - var y = m * (minX - x1) + y1; - if (y > minY && y < maxY) return true; - y = m * (maxX - x1) + y1; - if (y > minY && y < maxY) return true; - var x = (minY - y1) / m + x1; - if (x > minX && x < maxX) return true; - x = (maxY - y1) / m + x1; - if (x > minX && x < maxX) return true; - return false; - }, - /** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */ - aabbIntersectsSkeleton: function (bounds) { - return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY; - }, - /** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more - * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */ - containsPoint: function (x, y) { - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) - if (this.polygonContainsPoint(polygons[i], x, y)) return this.boundingBoxes[i]; - return null; - }, - /** Returns the first bounding box attachment that contains the line segment, or null. When doing many checks, it is usually - * more efficient to only call this method if {@link #aabbIntersectsSegment(float, float, float, float)} returns true. */ - intersectsSegment: function (x1, y1, x2, y2) { - var polygons = this.polygons; - for (var i = 0, n = polygons.length; i < n; i++) - if (polygons[i].intersectsSegment(x1, y1, x2, y2)) return this.boundingBoxes[i]; - return null; - }, - /** Returns true if the polygon contains the point. */ - polygonContainsPoint: function (polygon, x, y) { - var nn = polygon.length; - var prevIndex = nn - 2; - var inside = false; - for (var ii = 0; ii < nn; ii += 2) { - var vertexY = polygon[ii + 1]; - var prevY = polygon[prevIndex + 1]; - if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) { - var vertexX = polygon[ii]; - if (vertexX + (y - vertexY) / (prevY - vertexY) * (polygon[prevIndex] - vertexX) < x) inside = !inside; - } - prevIndex = ii; - } - return inside; - }, - /** Returns true if the polygon contains the line segment. */ - polygonIntersectsSegment: function (polygon, x1, y1, x2, y2) { - var nn = polygon.length; - var width12 = x1 - x2, height12 = y1 - y2; - var det1 = x1 * y2 - y1 * x2; - var x3 = polygon[nn - 2], y3 = polygon[nn - 1]; - for (var ii = 0; ii < nn; ii += 2) { - var x4 = polygon[ii], y4 = polygon[ii + 1]; - var det2 = x3 * y4 - y3 * x4; - var width34 = x3 - x4, height34 = y3 - y4; - var det3 = width12 * height34 - height12 * width34; - var x = (det1 * width34 - width12 * det2) / det3; - if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) { - var y = (det1 * height34 - height12 * det2) / det3; - if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) return true; - } - x3 = x4; - y3 = y4; - } - return false; - }, - getPolygon: function (attachment) { - var index = this.boundingBoxes.indexOf(attachment); - return index == -1 ? null : this.polygons[index]; - }, - getWidth: function () { - return this.maxX - this.minX; - }, - getHeight: function () { - return this.maxY - this.minY; - } -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/extras/Strip.js b/tutorial-4/pixi.js-master/src/pixi/extras/Strip.js deleted file mode 100755 index 6cff5df..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/extras/Strip.js +++ /dev/null @@ -1,469 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ - */ - - /** - * - * @class Strip - * @extends DisplayObjectContainer - * @constructor - * @param texture {Texture} The texture to use - * @param width {Number} the width - * @param height {Number} the height - * - */ -PIXI.Strip = function(texture) -{ - PIXI.DisplayObjectContainer.call( this ); - - - /** - * The texture of the strip - * - * @property texture - * @type Texture - */ - this.texture = texture; - - // set up the main bits.. - this.uvs = new PIXI.Float32Array([0, 1, - 1, 1, - 1, 0, - 0, 1]); - - this.vertices = new PIXI.Float32Array([0, 0, - 100, 0, - 100, 100, - 0, 100]); - - this.colors = new PIXI.Float32Array([1, 1, 1, 1]); - - this.indices = new PIXI.Uint16Array([0, 1, 2, 3]); - - /** - * Whether the strip is dirty or not - * - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode. - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - /** - * Triangles in canvas mode are automatically antialiased, use this value to force triangles to overlap a bit with each other. - * - * @property canvasPadding - * @type Number - */ - this.canvasPadding = 0; - - this.drawMode = PIXI.Strip.DrawModes.TRIANGLE_STRIP; - -}; - -// constructor -PIXI.Strip.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); -PIXI.Strip.prototype.constructor = PIXI.Strip; - -PIXI.Strip.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(!this.visible || this.alpha <= 0)return; - // render triangle strip.. - - renderSession.spriteBatch.stop(); - - // init! init! - if(!this._vertexBuffer)this._initWebGL(renderSession); - - renderSession.shaderManager.setShader(renderSession.shaderManager.stripShader); - - this._renderStrip(renderSession); - - ///renderSession.shaderManager.activateDefaultShader(); - - renderSession.spriteBatch.start(); - - //TODO check culling -}; - -PIXI.Strip.prototype._initWebGL = function(renderSession) -{ - // build the strip! - var gl = renderSession.gl; - - this._vertexBuffer = gl.createBuffer(); - this._indexBuffer = gl.createBuffer(); - this._uvBuffer = gl.createBuffer(); - this._colorBuffer = gl.createBuffer(); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvs, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this._colorBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.colors, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); -}; - -PIXI.Strip.prototype._renderStrip = function(renderSession) -{ - var gl = renderSession.gl; - var projection = renderSession.projection, - offset = renderSession.offset, - shader = renderSession.shaderManager.stripShader; - - var drawMode = this.drawMode === PIXI.Strip.DrawModes.TRIANGLE_STRIP ? gl.TRIANGLE_STRIP : gl.TRIANGLES; - - // gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mat4Real); - - renderSession.blendModeManager.setBlendMode(this.blendMode); - - - // set uniforms - gl.uniformMatrix3fv(shader.translationMatrix, false, this.worldTransform.toArray(true)); - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - gl.uniform1f(shader.alpha, this.worldAlpha); - - if(!this.dirty) - { - - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - // update the uvs - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.activeTexture(gl.TEXTURE0); - - // check if a texture is dirty.. - if(this.texture.baseTexture._dirty[gl.id]) - { - renderSession.renderer.updateTexture(this.texture.baseTexture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]); - } - - // dont need to upload! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - - - } - else - { - - this.dirty = false; - gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.STATIC_DRAW); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - // update the uvs - gl.bindBuffer(gl.ARRAY_BUFFER, this._uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvs, gl.STATIC_DRAW); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.activeTexture(gl.TEXTURE0); - - // check if a texture is dirty.. - if(this.texture.baseTexture._dirty[gl.id]) - { - renderSession.renderer.updateTexture(this.texture.baseTexture); - } - else - { - gl.bindTexture(gl.TEXTURE_2D, this.texture.baseTexture._glTextures[gl.id]); - } - - // dont need to upload! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - } - //console.log(gl.TRIANGLE_STRIP) - // - // - gl.drawElements(drawMode, this.indices.length, gl.UNSIGNED_SHORT, 0); - - -}; - - - -PIXI.Strip.prototype._renderCanvas = function(renderSession) -{ - var context = renderSession.context; - - var transform = this.worldTransform; - - if (renderSession.roundPixels) - { - context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx | 0, transform.ty | 0); - } - else - { - context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty); - } - - if (this.drawMode === PIXI.Strip.DrawModes.TRIANGLE_STRIP) - { - this._renderCanvasTriangleStrip(context); - } - else - { - this._renderCanvasTriangles(context); - } -}; - -PIXI.Strip.prototype._renderCanvasTriangleStrip = function(context) -{ - // draw triangles!! - var vertices = this.vertices; - var uvs = this.uvs; - - var length = vertices.length / 2; - this.count++; - - for (var i = 0; i < length - 2; i++) { - // draw some triangles! - var index = i * 2; - this._renderCanvasDrawTriangle(context, vertices, uvs, index, (index + 2), (index + 4)); - } -}; - -PIXI.Strip.prototype._renderCanvasTriangles = function(context) -{ - // draw triangles!! - var vertices = this.vertices; - var uvs = this.uvs; - var indices = this.indices; - - var length = indices.length; - this.count++; - - for (var i = 0; i < length; i += 3) { - // draw some triangles! - var index0 = indices[i] * 2, index1 = indices[i + 1] * 2, index2 = indices[i + 2] * 2; - this._renderCanvasDrawTriangle(context, vertices, uvs, index0, index1, index2); - } -}; - -PIXI.Strip.prototype._renderCanvasDrawTriangle = function(context, vertices, uvs, index0, index1, index2) -{ - var textureSource = this.texture.baseTexture.source; - var textureWidth = this.texture.width; - var textureHeight = this.texture.height; - - var x0 = vertices[index0], x1 = vertices[index1], x2 = vertices[index2]; - var y0 = vertices[index0 + 1], y1 = vertices[index1 + 1], y2 = vertices[index2 + 1]; - - var u0 = uvs[index0] * textureWidth, u1 = uvs[index1] * textureWidth, u2 = uvs[index2] * textureWidth; - var v0 = uvs[index0 + 1] * textureHeight, v1 = uvs[index1 + 1] * textureHeight, v2 = uvs[index2 + 1] * textureHeight; - - if (this.canvasPadding > 0) { - var paddingX = this.canvasPadding / this.worldTransform.a; - var paddingY = this.canvasPadding / this.worldTransform.d; - var centerX = (x0 + x1 + x2) / 3; - var centerY = (y0 + y1 + y2) / 3; - - var normX = x0 - centerX; - var normY = y0 - centerY; - - var dist = Math.sqrt(normX * normX + normY * normY); - x0 = centerX + (normX / dist) * (dist + paddingX); - y0 = centerY + (normY / dist) * (dist + paddingY); - - // - - normX = x1 - centerX; - normY = y1 - centerY; - - dist = Math.sqrt(normX * normX + normY * normY); - x1 = centerX + (normX / dist) * (dist + paddingX); - y1 = centerY + (normY / dist) * (dist + paddingY); - - normX = x2 - centerX; - normY = y2 - centerY; - - dist = Math.sqrt(normX * normX + normY * normY); - x2 = centerX + (normX / dist) * (dist + paddingX); - y2 = centerY + (normY / dist) * (dist + paddingY); - } - - context.save(); - context.beginPath(); - - - context.moveTo(x0, y0); - context.lineTo(x1, y1); - context.lineTo(x2, y2); - - context.closePath(); - - context.clip(); - - // Compute matrix transform - var delta = (u0 * v1) + (v0 * u2) + (u1 * v2) - (v1 * u2) - (v0 * u1) - (u0 * v2); - var deltaA = (x0 * v1) + (v0 * x2) + (x1 * v2) - (v1 * x2) - (v0 * x1) - (x0 * v2); - var deltaB = (u0 * x1) + (x0 * u2) + (u1 * x2) - (x1 * u2) - (x0 * u1) - (u0 * x2); - var deltaC = (u0 * v1 * x2) + (v0 * x1 * u2) + (x0 * u1 * v2) - (x0 * v1 * u2) - (v0 * u1 * x2) - (u0 * x1 * v2); - var deltaD = (y0 * v1) + (v0 * y2) + (y1 * v2) - (v1 * y2) - (v0 * y1) - (y0 * v2); - var deltaE = (u0 * y1) + (y0 * u2) + (u1 * y2) - (y1 * u2) - (y0 * u1) - (u0 * y2); - var deltaF = (u0 * v1 * y2) + (v0 * y1 * u2) + (y0 * u1 * v2) - (y0 * v1 * u2) - (v0 * u1 * y2) - (u0 * y1 * v2); - - context.transform(deltaA / delta, deltaD / delta, - deltaB / delta, deltaE / delta, - deltaC / delta, deltaF / delta); - - context.drawImage(textureSource, 0, 0); - context.restore(); -}; - - - -/** - * Renders a flat strip - * - * @method renderStripFlat - * @param strip {Strip} The Strip to render - * @private - */ -PIXI.Strip.prototype.renderStripFlat = function(strip) -{ - var context = this.context; - var vertices = strip.vertices; - - var length = vertices.length/2; - this.count++; - - context.beginPath(); - for (var i=1; i < length-2; i++) - { - // draw some triangles! - var index = i*2; - - var x0 = vertices[index], x1 = vertices[index+2], x2 = vertices[index+4]; - var y0 = vertices[index+1], y1 = vertices[index+3], y2 = vertices[index+5]; - - context.moveTo(x0, y0); - context.lineTo(x1, y1); - context.lineTo(x2, y2); - } - - context.fillStyle = '#FF0000'; - context.fill(); - context.closePath(); -}; - -/* -PIXI.Strip.prototype.setTexture = function(texture) -{ - //TODO SET THE TEXTURES - //TODO VISIBILITY - - // stop current texture - this.texture = texture; - this.width = texture.frame.width; - this.height = texture.frame.height; - this.updateFrame = true; -}; -*/ - -/** - * When the texture is updated, this event will fire to update the scale and frame - * - * @method onTextureUpdate - * @param event - * @private - */ - -PIXI.Strip.prototype.onTextureUpdate = function() -{ - this.updateFrame = true; -}; - -/** - * Returns the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account. - * - * @method getBounds - * @param matrix {Matrix} the transformation matrix of the sprite - * @return {Rectangle} the framing rectangle - */ -PIXI.Strip.prototype.getBounds = function(matrix) -{ - var worldTransform = matrix || this.worldTransform; - - var a = worldTransform.a; - var b = worldTransform.b; - var c = worldTransform.c; - var d = worldTransform.d; - var tx = worldTransform.tx; - var ty = worldTransform.ty; - - var maxX = -Infinity; - var maxY = -Infinity; - - var minX = Infinity; - var minY = Infinity; - - var vertices = this.vertices; - for (var i = 0, n = vertices.length; i < n; i += 2) - { - var rawX = vertices[i], rawY = vertices[i + 1]; - var x = (a * rawX) + (c * rawY) + tx; - var y = (d * rawY) + (b * rawX) + ty; - - minX = x < minX ? x : minX; - minY = y < minY ? y : minY; - - maxX = x > maxX ? x : maxX; - maxY = y > maxY ? y : maxY; - } - - if (minX === -Infinity || maxY === Infinity) - { - return PIXI.EmptyRectangle; - } - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - -/** - * Different drawing buffer modes supported - * - * @property - * @type {{TRIANGLE_STRIP: number, TRIANGLES: number}} - * @static - */ -PIXI.Strip.DrawModes = { - TRIANGLE_STRIP: 0, - TRIANGLES: 1 -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/extras/TilingSprite.js b/tutorial-4/pixi.js-master/src/pixi/extras/TilingSprite.js deleted file mode 100755 index 2ad39d2..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/extras/TilingSprite.js +++ /dev/null @@ -1,485 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * A tiling sprite is a fast way of rendering a tiling image - * - * @class TilingSprite - * @extends Sprite - * @constructor - * @param texture {Texture} the texture of the tiling sprite - * @param width {Number} the width of the tiling sprite - * @param height {Number} the height of the tiling sprite - */ -PIXI.TilingSprite = function(texture, width, height) -{ - PIXI.Sprite.call( this, texture); - - /** - * The with of the tiling sprite - * - * @property width - * @type Number - */ - this._width = width || 100; - - /** - * The height of the tiling sprite - * - * @property height - * @type Number - */ - this._height = height || 100; - - /** - * The scaling of the image that is being tiled - * - * @property tileScale - * @type Point - */ - this.tileScale = new PIXI.Point(1,1); - - /** - * A point that represents the scale of the texture object - * - * @property tileScaleOffset - * @type Point - */ - this.tileScaleOffset = new PIXI.Point(1,1); - - /** - * The offset position of the image that is being tiled - * - * @property tilePosition - * @type Point - */ - this.tilePosition = new PIXI.Point(0,0); - - /** - * Whether this sprite is renderable or not - * - * @property renderable - * @type Boolean - * @default true - */ - this.renderable = true; - - /** - * The tint applied to the sprite. This is a hex value - * - * @property tint - * @type Number - * @default 0xFFFFFF - */ - this.tint = 0xFFFFFF; - - /** - * The blend mode to be applied to the sprite - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - - -}; - -// constructor -PIXI.TilingSprite.prototype = Object.create(PIXI.Sprite.prototype); -PIXI.TilingSprite.prototype.constructor = PIXI.TilingSprite; - - -/** - * The width of the sprite, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.TilingSprite.prototype, 'width', { - get: function() { - return this._width; - }, - set: function(value) { - - this._width = value; - } -}); - -/** - * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.TilingSprite.prototype, 'height', { - get: function() { - return this._height; - }, - set: function(value) { - this._height = value; - } -}); - -PIXI.TilingSprite.prototype.setTexture = function(texture) -{ - if (this.texture === texture) return; - - this.texture = texture; - - this.refreshTexture = true; - - this.cachedTint = 0xFFFFFF; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.TilingSprite.prototype._renderWebGL = function(renderSession) -{ - if (this.visible === false || this.alpha === 0) return; - var i,j; - - if (this._mask) - { - renderSession.spriteBatch.stop(); - renderSession.maskManager.pushMask(this.mask, renderSession); - renderSession.spriteBatch.start(); - } - - if (this._filters) - { - renderSession.spriteBatch.flush(); - renderSession.filterManager.pushFilter(this._filterBlock); - } - - - - if (!this.tilingTexture || this.refreshTexture) - { - this.generateTilingTexture(true); - - if (this.tilingTexture && this.tilingTexture.needsUpdate) - { - //TODO - tweaking - renderSession.renderer.updateTexture(this.tilingTexture.baseTexture); - this.tilingTexture.needsUpdate = false; - // this.tilingTexture._uvs = null; - } - } - else - { - renderSession.spriteBatch.renderTilingSprite(this); - } - // simple render children! - for (i=0,j=this.children.length; i maxX ? x1 : maxX; - maxX = x2 > maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y1 > maxY ? y1 : maxY; - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - - var bounds = this._bounds; - - bounds.x = minX; - bounds.width = maxX - minX; - - bounds.y = minY; - bounds.height = maxY - minY; - - // store a reference so that if this function gets called again in the render cycle we do not have to recalculate - this._currentBounds = bounds; - - return bounds; -}; - - - -/** - * When the texture is updated, this event will fire to update the scale and frame - * - * @method onTextureUpdate - * @param event - * @private - */ -PIXI.TilingSprite.prototype.onTextureUpdate = function() -{ - // overriding the sprite version of this! -}; - - -/** -* -* @method generateTilingTexture -* -* @param forcePowerOfTwo {Boolean} Whether we want to force the texture to be a power of two -*/ -PIXI.TilingSprite.prototype.generateTilingTexture = function(forcePowerOfTwo) -{ - if (!this.texture.baseTexture.hasLoaded) return; - - var texture = this.originalTexture || this.texture; - var frame = texture.frame; - var targetWidth, targetHeight; - - // Check that the frame is the same size as the base texture. - var isFrame = frame.width !== texture.baseTexture.width || frame.height !== texture.baseTexture.height; - - var newTextureRequired = false; - - if (!forcePowerOfTwo) - { - if (isFrame) - { - if (texture.trim) - { - targetWidth = texture.trim.width; - targetHeight = texture.trim.height; - } - else - { - targetWidth = frame.width; - targetHeight = frame.height; - } - - newTextureRequired = true; - } - } - else - { - targetWidth = PIXI.getNextPowerOfTwo(frame.width); - targetHeight = PIXI.getNextPowerOfTwo(frame.height); - - // If the BaseTexture dimensions don't match the texture frame then we need a new texture anyway because it's part of a texture atlas - if (frame.width !== targetWidth || frame.height !== targetHeight || texture.baseTexture.width !== targetWidth || texture.baseTexture.height || targetHeight) newTextureRequired = true; - } - - if (newTextureRequired) - { - var canvasBuffer; - - if (this.tilingTexture && this.tilingTexture.isTiling) - { - canvasBuffer = this.tilingTexture.canvasBuffer; - canvasBuffer.resize(targetWidth, targetHeight); - this.tilingTexture.baseTexture.width = targetWidth; - this.tilingTexture.baseTexture.height = targetHeight; - this.tilingTexture.needsUpdate = true; - } - else - { - canvasBuffer = new PIXI.CanvasBuffer(targetWidth, targetHeight); - - this.tilingTexture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); - this.tilingTexture.canvasBuffer = canvasBuffer; - this.tilingTexture.isTiling = true; - } - - canvasBuffer.context.drawImage(texture.baseTexture.source, - texture.crop.x, - texture.crop.y, - texture.crop.width, - texture.crop.height, - 0, - 0, - targetWidth, - targetHeight); - - this.tileScaleOffset.x = frame.width / targetWidth; - this.tileScaleOffset.y = frame.height / targetHeight; - } - else - { - // TODO - switching? - if (this.tilingTexture && this.tilingTexture.isTiling) - { - // destroy the tiling texture! - // TODO could store this somewhere? - this.tilingTexture.destroy(true); - } - - this.tileScaleOffset.x = 1; - this.tileScaleOffset.y = 1; - this.tilingTexture = texture; - } - - this.refreshTexture = false; - - this.originalTexture = this.texture; - this.texture = this.tilingTexture; - - this.tilingTexture.baseTexture._powerOf2 = true; -}; - -PIXI.TilingSprite.prototype.destroy = function () { - PIXI.Sprite.prototype.destroy.call(this); - - this.tileScale = null; - this.tileScaleOffset = null; - this.tilePosition = null; - - this.tilingTexture.destroy(true); - this.tilingTexture = null; -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/AbstractFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/AbstractFilter.js deleted file mode 100755 index 6727dc5..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/AbstractFilter.js +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This is the base class for creating a PIXI filter. Currently only webGL supports filters. - * If you want to make a custom filter this should be your base class. - * @class AbstractFilter - * @constructor - * @param fragmentSrc {Array} The fragment source in an array of strings. - * @param uniforms {Object} An object containing the uniforms for this filter. - */ -PIXI.AbstractFilter = function(fragmentSrc, uniforms) -{ - /** - * An array of passes - some filters contain a few steps this array simply stores the steps in a liniear fashion. - * For example the blur filter has two passes blurX and blurY. - * @property passes - * @type Array(Filter) - * @private - */ - this.passes = [this]; - - /** - * @property shaders - * @type Array(Shader) - * @private - */ - this.shaders = []; - - /** - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * @property padding - * @type Number - */ - this.padding = 0; - - /** - * @property uniforms - * @type object - * @private - */ - this.uniforms = uniforms || {}; - - /** - * @property fragmentSrc - * @type Array - * @private - */ - this.fragmentSrc = fragmentSrc || []; -}; - -PIXI.AbstractFilter.prototype.constructor = PIXI.AbstractFilter; - -/** - * Syncs the uniforms between the class object and the shaders. - * - * @method syncUniforms - */ -PIXI.AbstractFilter.prototype.syncUniforms = function() -{ - for(var i=0,j=this.shaders.length; i 0.2) n = 65600.0; // :', - ' if (gray > 0.3) n = 332772.0; // *', - ' if (gray > 0.4) n = 15255086.0; // o', - ' if (gray > 0.5) n = 23385164.0; // &', - ' if (gray > 0.6) n = 15252014.0; // 8', - ' if (gray > 0.7) n = 13199452.0; // @', - ' if (gray > 0.8) n = 11512810.0; // #', - - ' vec2 p = mod( uv / ( pixelSize * 0.5 ), 2.0) - vec2(1.0);', - ' col = col * character(n, p);', - - ' gl_FragColor = vec4(col, 1.0);', - '}' - ]; -}; - -PIXI.AsciiFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.AsciiFilter.prototype.constructor = PIXI.AsciiFilter; - -/** - * The pixel size used by the filter. - * - * @property size - * @type Number - */ -Object.defineProperty(PIXI.AsciiFilter.prototype, 'size', { - get: function() { - return this.uniforms.pixelSize.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.pixelSize.value = value; - } -}); \ No newline at end of file diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/BlurFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/BlurFilter.js deleted file mode 100755 index d93d147..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/BlurFilter.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The BlurFilter applies a Gaussian blur to an object. - * The strength of the blur can be set for x- and y-axis separately (always relative to the stage). - * - * @class BlurFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.BlurFilter = function() -{ - this.blurXFilter = new PIXI.BlurXFilter(); - this.blurYFilter = new PIXI.BlurYFilter(); - - this.passes =[this.blurXFilter, this.blurYFilter]; -}; - -PIXI.BlurFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.BlurFilter.prototype.constructor = PIXI.BlurFilter; - -/** - * Sets the strength of both the blurX and blurY properties simultaneously - * - * @property blur - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.BlurFilter.prototype, 'blur', { - get: function() { - return this.blurXFilter.blur; - }, - set: function(value) { - this.blurXFilter.blur = this.blurYFilter.blur = value; - } -}); - -/** - * Sets the strength of the blurX property - * - * @property blurX - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.BlurFilter.prototype, 'blurX', { - get: function() { - return this.blurXFilter.blur; - }, - set: function(value) { - this.blurXFilter.blur = value; - } -}); - -/** - * Sets the strength of the blurY property - * - * @property blurY - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.BlurFilter.prototype, 'blurY', { - get: function() { - return this.blurYFilter.blur; - }, - set: function(value) { - this.blurYFilter.blur = value; - } -}); diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/BlurXFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/BlurXFilter.js deleted file mode 100755 index 13f67c3..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/BlurXFilter.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The BlurXFilter applies a horizontal Gaussian blur to an object. - * - * @class BlurXFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.BlurXFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 1/512} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float blur;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' vec4 sum = vec4(0.0);', - - ' sum += texture2D(uSampler, vec2(vTextureCoord.x - 4.0*blur, vTextureCoord.y)) * 0.05;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x - 3.0*blur, vTextureCoord.y)) * 0.09;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x - 2.0*blur, vTextureCoord.y)) * 0.12;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x - blur, vTextureCoord.y)) * 0.15;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x + blur, vTextureCoord.y)) * 0.15;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x + 2.0*blur, vTextureCoord.y)) * 0.12;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x + 3.0*blur, vTextureCoord.y)) * 0.09;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x + 4.0*blur, vTextureCoord.y)) * 0.05;', - - ' gl_FragColor = sum;', - '}' - ]; -}; - -PIXI.BlurXFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.BlurXFilter.prototype.constructor = PIXI.BlurXFilter; - -/** - * Sets the strength of both the blur. - * - * @property blur - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.BlurXFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value / (1/7000); - }, - set: function(value) { - - this.dirty = true; - this.uniforms.blur.value = (1/7000) * value; - } -}); diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/BlurYFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/BlurYFilter.js deleted file mode 100755 index 5aecfef..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/BlurYFilter.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The BlurYFilter applies a vertical Gaussian blur to an object. - * - * @class BlurYFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.BlurYFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 1/512} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float blur;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' vec4 sum = vec4(0.0);', - - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 4.0*blur)) * 0.05;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 3.0*blur)) * 0.09;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - 2.0*blur)) * 0.12;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - blur)) * 0.15;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + blur)) * 0.15;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 2.0*blur)) * 0.12;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 3.0*blur)) * 0.09;', - ' sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + 4.0*blur)) * 0.05;', - - ' gl_FragColor = sum;', - '}' - ]; -}; - -PIXI.BlurYFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.BlurYFilter.prototype.constructor = PIXI.BlurYFilter; - -/** - * Sets the strength of both the blur. - * - * @property blur - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.BlurYFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value / (1/7000); - }, - set: function(value) { - //this.padding = value; - this.uniforms.blur.value = (1/7000) * value; - } -}); diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/ColorMatrixFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/ColorMatrixFilter.js deleted file mode 100755 index 8f1dcbe..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/ColorMatrixFilter.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The ColorMatrixFilter class lets you apply a 4x4 matrix transformation on the RGBA - * color and alpha values of every pixel on your displayObject to produce a result - * with a new set of RGBA color and alpha values. It's pretty powerful! - * - * @class ColorMatrixFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.ColorMatrixFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - matrix: {type: 'mat4', value: [1,0,0,0, - 0,1,0,0, - 0,0,1,0, - 0,0,0,1]} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float invert;', - 'uniform mat4 matrix;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * matrix;', - // ' gl_FragColor = gl_FragColor;', - '}' - ]; -}; - -PIXI.ColorMatrixFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.ColorMatrixFilter.prototype.constructor = PIXI.ColorMatrixFilter; - -/** - * Sets the matrix of the color matrix filter - * - * @property matrix - * @type Array(Number) - * @default [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] - */ -Object.defineProperty(PIXI.ColorMatrixFilter.prototype, 'matrix', { - get: function() { - return this.uniforms.matrix.value; - }, - set: function(value) { - this.uniforms.matrix.value = value; - } -}); \ No newline at end of file diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/ColorStepFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/ColorStepFilter.js deleted file mode 100755 index 9481acd..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/ColorStepFilter.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This lowers the color depth of your image by the given amount, producing an image with a smaller palette. - * - * @class ColorStepFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.ColorStepFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - step: {type: '1f', value: 5} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'uniform float step;', - - 'void main(void) {', - ' vec4 color = texture2D(uSampler, vTextureCoord);', - ' color = floor(color * step) / step;', - ' gl_FragColor = color;', - '}' - ]; -}; - -PIXI.ColorStepFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.ColorStepFilter.prototype.constructor = PIXI.ColorStepFilter; - -/** - * The number of steps to reduce the palette by. - * - * @property step - * @type Number - */ -Object.defineProperty(PIXI.ColorStepFilter.prototype, 'step', { - get: function() { - return this.uniforms.step.value; - }, - set: function(value) { - this.uniforms.step.value = value; - } -}); diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/ConvolutionFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/ConvolutionFilter.js deleted file mode 100755 index 1d180d7..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/ConvolutionFilter.js +++ /dev/null @@ -1,106 +0,0 @@ -/** - * The ConvolutionFilter class applies a matrix convolution filter effect. - * A convolution combines pixels in the input image with neighboring pixels to produce a new image. - * A wide variety of image effects can be achieved through convolutions, including blurring, edge detection, sharpening, embossing, and beveling. - * The matrix should be specified as a 9 point Array. See http://docs.gimp.org/en/plug-in-convmatrix.html for more info. - * - * @class ConvolutionFilter - * @extends AbstractFilter - * @constructor - * @param matrix {Array} An array of values used for matrix transformation. Specified as a 9 point Array. - * @param width {Number} Width of the object you are transforming - * @param height {Number} Height of the object you are transforming - */ -PIXI.ConvolutionFilter = function(matrix, width, height) -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - m : {type: '1fv', value: new PIXI.Float32Array(matrix)}, - texelSizeX: {type: '1f', value: 1 / width}, - texelSizeY: {type: '1f', value: 1 / height} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying mediump vec2 vTextureCoord;', - 'uniform sampler2D texture;', - 'uniform float texelSizeX;', - 'uniform float texelSizeY;', - 'uniform float m[9];', - - 'vec2 px = vec2(texelSizeX, texelSizeY);', - - 'void main(void) {', - 'vec4 c11 = texture2D(texture, vTextureCoord - px);', // top left - 'vec4 c12 = texture2D(texture, vec2(vTextureCoord.x, vTextureCoord.y - px.y));', // top center - 'vec4 c13 = texture2D(texture, vec2(vTextureCoord.x + px.x, vTextureCoord.y - px.y));', // top right - - 'vec4 c21 = texture2D(texture, vec2(vTextureCoord.x - px.x, vTextureCoord.y) );', // mid left - 'vec4 c22 = texture2D(texture, vTextureCoord);', // mid center - 'vec4 c23 = texture2D(texture, vec2(vTextureCoord.x + px.x, vTextureCoord.y) );', // mid right - - 'vec4 c31 = texture2D(texture, vec2(vTextureCoord.x - px.x, vTextureCoord.y + px.y) );', // bottom left - 'vec4 c32 = texture2D(texture, vec2(vTextureCoord.x, vTextureCoord.y + px.y) );', // bottom center - 'vec4 c33 = texture2D(texture, vTextureCoord + px );', // bottom right - - 'gl_FragColor = ', - 'c11 * m[0] + c12 * m[1] + c22 * m[2] +', - 'c21 * m[3] + c22 * m[4] + c23 * m[5] +', - 'c31 * m[6] + c32 * m[7] + c33 * m[8];', - 'gl_FragColor.a = c22.a;', - '}' - ]; - -}; - -PIXI.ConvolutionFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.ConvolutionFilter.prototype.constructor = PIXI.ConvolutionFilter; - -/** - * An array of values used for matrix transformation. Specified as a 9 point Array. - * - * @property matrix - * @type Array - */ -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'matrix', { - get: function() { - return this.uniforms.m.value; - }, - set: function(value) { - this.uniforms.m.value = new PIXI.Float32Array(value); - } -}); - -/** - * Width of the object you are transforming - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'width', { - get: function() { - return this.uniforms.texelSizeX.value; - }, - set: function(value) { - this.uniforms.texelSizeX.value = 1/value; - } -}); - -/** - * Height of the object you are transforming - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.ConvolutionFilter.prototype, 'height', { - get: function() { - return this.uniforms.texelSizeY.value; - }, - set: function(value) { - this.uniforms.texelSizeY.value = 1/value; - } -}); diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/CrossHatchFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/CrossHatchFilter.js deleted file mode 100755 index 4b9f381..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/CrossHatchFilter.js +++ /dev/null @@ -1,80 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A Cross Hatch effect filter. - * - * @class CrossHatchFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.CrossHatchFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 1 / 512} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float blur;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);', - - ' gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);', - - ' if (lum < 1.00) {', - ' if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {', - ' gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);', - ' }', - ' }', - - ' if (lum < 0.75) {', - ' if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {', - ' gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);', - ' }', - ' }', - - ' if (lum < 0.50) {', - ' if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {', - ' gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);', - ' }', - ' }', - - ' if (lum < 0.3) {', - ' if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {', - ' gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);', - ' }', - ' }', - '}' - ]; -}; - -PIXI.CrossHatchFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.CrossHatchFilter.prototype.constructor = PIXI.CrossHatchFilter; - -/** - * Sets the strength of both the blur. - * - * @property blur - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.CrossHatchFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value / (1/7000); - }, - set: function(value) { - //this.padding = value; - this.uniforms.blur.value = (1/7000) * value; - } -}); diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/DisplacementFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/DisplacementFilter.js deleted file mode 100755 index 803b7b8..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/DisplacementFilter.js +++ /dev/null @@ -1,134 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The DisplacementFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. - * You can use this filter to apply all manor of crazy warping effects - * Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y. - * - * @class DisplacementFilter - * @extends AbstractFilter - * @constructor - * @param texture {Texture} The texture used for the displacement map * must be power of 2 texture at the moment - */ -PIXI.DisplacementFilter = function(texture) -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - texture.baseTexture._powerOf2 = true; - - // set the uniforms - this.uniforms = { - displacementMap: {type: 'sampler2D', value:texture}, - scale: {type: '2f', value:{x:30, y:30}}, - offset: {type: '2f', value:{x:0, y:0}}, - mapDimensions: {type: '2f', value:{x:1, y:5112}}, - dimensions: {type: '4fv', value:[0,0,0,0]} - }; - - if(texture.baseTexture.hasLoaded) - { - this.uniforms.mapDimensions.value.x = texture.width; - this.uniforms.mapDimensions.value.y = texture.height; - } - else - { - this.boundLoadedFunction = this.onTextureLoaded.bind(this); - - texture.baseTexture.on('loaded', this.boundLoadedFunction); - } - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D displacementMap;', - 'uniform sampler2D uSampler;', - 'uniform vec2 scale;', - 'uniform vec2 offset;', - 'uniform vec4 dimensions;', - 'uniform vec2 mapDimensions;',// = vec2(256.0, 256.0);', - // 'const vec2 textureDimensions = vec2(750.0, 750.0);', - - 'void main(void) {', - ' vec2 mapCords = vTextureCoord.xy;', - //' mapCords -= ;', - ' mapCords += (dimensions.zw + offset)/ dimensions.xy ;', - ' mapCords.y *= -1.0;', - ' mapCords.y += 1.0;', - ' vec2 matSample = texture2D(displacementMap, mapCords).xy;', - ' matSample -= 0.5;', - ' matSample *= scale;', - ' matSample /= mapDimensions;', - ' gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + matSample.x, vTextureCoord.y + matSample.y));', - ' gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb, 1.0);', - ' vec2 cord = vTextureCoord;', - - //' gl_FragColor = texture2D(displacementMap, cord);', - // ' gl_FragColor = gl_FragColor;', - '}' - ]; -}; - -PIXI.DisplacementFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.DisplacementFilter.prototype.constructor = PIXI.DisplacementFilter; - -/** - * Sets the map dimensions uniforms when the texture becomes available. - * - * @method onTextureLoaded - */ -PIXI.DisplacementFilter.prototype.onTextureLoaded = function() -{ - this.uniforms.mapDimensions.value.x = this.uniforms.displacementMap.value.width; - this.uniforms.mapDimensions.value.y = this.uniforms.displacementMap.value.height; - - this.uniforms.displacementMap.value.baseTexture.off('loaded', this.boundLoadedFunction); -}; - -/** - * The texture used for the displacement map. Must be power of 2 texture. - * - * @property map - * @type Texture - */ -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'map', { - get: function() { - return this.uniforms.displacementMap.value; - }, - set: function(value) { - this.uniforms.displacementMap.value = value; - } -}); - -/** - * The multiplier used to scale the displacement result from the map calculation. - * - * @property scale - * @type Point - */ -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'scale', { - get: function() { - return this.uniforms.scale.value; - }, - set: function(value) { - this.uniforms.scale.value = value; - } -}); - -/** - * The offset used to move the displacement map. - * - * @property offset - * @type Point - */ -Object.defineProperty(PIXI.DisplacementFilter.prototype, 'offset', { - get: function() { - return this.uniforms.offset.value; - }, - set: function(value) { - this.uniforms.offset.value = value; - } -}); diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/DotScreenFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/DotScreenFilter.js deleted file mode 100755 index 5a7462f..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/DotScreenFilter.js +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/fun/dotscreen.js - */ - -/** - * This filter applies a dotscreen effect making display objects appear to be made out of black and white halftone dots like an old printer. - * - * @class DotScreenFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.DotScreenFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - scale: {type: '1f', value:1}, - angle: {type: '1f', value:5}, - dimensions: {type: '4fv', value:[0,0,0,0]} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform vec4 dimensions;', - 'uniform sampler2D uSampler;', - - 'uniform float angle;', - 'uniform float scale;', - - 'float pattern() {', - ' float s = sin(angle), c = cos(angle);', - ' vec2 tex = vTextureCoord * dimensions.xy;', - ' vec2 point = vec2(', - ' c * tex.x - s * tex.y,', - ' s * tex.x + c * tex.y', - ' ) * scale;', - ' return (sin(point.x) * sin(point.y)) * 4.0;', - '}', - - 'void main() {', - ' vec4 color = texture2D(uSampler, vTextureCoord);', - ' float average = (color.r + color.g + color.b) / 3.0;', - ' gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);', - '}' - ]; -}; - -PIXI.DotScreenFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.DotScreenFilter.prototype.constructor = PIXI.DotScreenFilter; - -/** - * The scale of the effect. - * @property scale - * @type Number - */ -Object.defineProperty(PIXI.DotScreenFilter.prototype, 'scale', { - get: function() { - return this.uniforms.scale.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.scale.value = value; - } -}); - -/** - * The radius of the effect. - * @property angle - * @type Number - */ -Object.defineProperty(PIXI.DotScreenFilter.prototype, 'angle', { - get: function() { - return this.uniforms.angle.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.angle.value = value; - } -}); diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/FilterBlock.js b/tutorial-4/pixi.js-master/src/pixi/filters/FilterBlock.js deleted file mode 100755 index fbdacc2..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/FilterBlock.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A target and pass info object for filters. - * - * @class FilterBlock - * @constructor - */ -PIXI.FilterBlock = function() -{ - /** - * The visible state of this FilterBlock. - * - * @property visible - * @type Boolean - */ - this.visible = true; - - /** - * The renderable state of this FilterBlock. - * - * @property renderable - * @type Boolean - */ - this.renderable = true; -}; - -PIXI.FilterBlock.prototype.constructor = PIXI.FilterBlock; diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/GrayFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/GrayFilter.js deleted file mode 100755 index 201d026..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/GrayFilter.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This greyscales the palette of your Display Objects. - * - * @class GrayFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.GrayFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - gray: {type: '1f', value: 1} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'uniform float gray;', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord);', - ' gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(0.2126*gl_FragColor.r + 0.7152*gl_FragColor.g + 0.0722*gl_FragColor.b), gray);', - // ' gl_FragColor = gl_FragColor;', - '}' - ]; -}; - -PIXI.GrayFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.GrayFilter.prototype.constructor = PIXI.GrayFilter; - -/** - * The strength of the gray. 1 will make the object black and white, 0 will make the object its normal color. - * @property gray - * @type Number - */ -Object.defineProperty(PIXI.GrayFilter.prototype, 'gray', { - get: function() { - return this.uniforms.gray.value; - }, - set: function(value) { - this.uniforms.gray.value = value; - } -}); diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/InvertFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/InvertFilter.js deleted file mode 100755 index 7f5e84c..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/InvertFilter.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This inverts your Display Objects colors. - * - * @class InvertFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.InvertFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - invert: {type: '1f', value: 1} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float invert;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord);', - ' gl_FragColor.rgb = mix( (vec3(1)-gl_FragColor.rgb) * gl_FragColor.a, gl_FragColor.rgb, 1.0 - invert);', - //' gl_FragColor.rgb = gl_FragColor.rgb * gl_FragColor.a;', - // ' gl_FragColor = gl_FragColor * vColor;', - '}' - ]; -}; - -PIXI.InvertFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.InvertFilter.prototype.constructor = PIXI.InvertFilter; - -/** - * The strength of the invert. 1 will fully invert the colors, 0 will make the object its normal color - * @property invert - * @type Number -*/ -Object.defineProperty(PIXI.InvertFilter.prototype, 'invert', { - get: function() { - return this.uniforms.invert.value; - }, - set: function(value) { - this.uniforms.invert.value = value; - } -}); diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/NoiseFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/NoiseFilter.js deleted file mode 100755 index ff248e4..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/NoiseFilter.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @author Vico @vicocotea - * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js - */ - -/** - * A Noise effect filter. - * - * @class NoiseFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.NoiseFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - noise: {type: '1f', value: 0.5} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'uniform sampler2D uSampler;', - 'uniform float noise;', - 'varying vec2 vTextureCoord;', - - 'float rand(vec2 co) {', - ' return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);', - '}', - 'void main() {', - ' vec4 color = texture2D(uSampler, vTextureCoord);', - - ' float diff = (rand(vTextureCoord) - 0.5) * noise;', - ' color.r += diff;', - ' color.g += diff;', - ' color.b += diff;', - - ' gl_FragColor = color;', - '}' - ]; -}; - -PIXI.NoiseFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.NoiseFilter.prototype.constructor = PIXI.NoiseFilter; - -/** - * The amount of noise to apply. - * @property noise - * @type Number -*/ -Object.defineProperty(PIXI.NoiseFilter.prototype, 'noise', { - get: function() { - return this.uniforms.noise.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.noise.value = value; - } -}); diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/NormalMapFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/NormalMapFilter.js deleted file mode 100755 index e686905..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/NormalMapFilter.js +++ /dev/null @@ -1,196 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - - -/** - * The NormalMapFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object. - * You can use this filter to apply all manor of crazy warping effects - * Currently the r property of the texture is used offset the x and the g property of the texture is used to offset the y. - * - * @class NormalMapFilter - * @extends AbstractFilter - * @constructor - * @param texture {Texture} The texture used for the displacement map * must be power of 2 texture at the moment - */ -PIXI.NormalMapFilter = function(texture) -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - texture.baseTexture._powerOf2 = true; - - // set the uniforms - this.uniforms = { - displacementMap: {type: 'sampler2D', value:texture}, - scale: {type: '2f', value:{x:15, y:15}}, - offset: {type: '2f', value:{x:0, y:0}}, - mapDimensions: {type: '2f', value:{x:1, y:1}}, - dimensions: {type: '4f', value:[0,0,0,0]}, - // LightDir: {type: 'f3', value:[0, 1, 0]}, - LightPos: {type: '3f', value:[0, 1, 0]} - }; - - - if(texture.baseTexture.hasLoaded) - { - this.uniforms.mapDimensions.value.x = texture.width; - this.uniforms.mapDimensions.value.y = texture.height; - } - else - { - this.boundLoadedFunction = this.onTextureLoaded.bind(this); - - texture.baseTexture.on("loaded", this.boundLoadedFunction); - } - - this.fragmentSrc = [ - "precision mediump float;", - "varying vec2 vTextureCoord;", - "varying float vColor;", - "uniform sampler2D displacementMap;", - "uniform sampler2D uSampler;", - - "uniform vec4 dimensions;", - - "const vec2 Resolution = vec2(1.0,1.0);", //resolution of screen - "uniform vec3 LightPos;", //light position, normalized - "const vec4 LightColor = vec4(1.0, 1.0, 1.0, 1.0);", //light RGBA -- alpha is intensity - "const vec4 AmbientColor = vec4(1.0, 1.0, 1.0, 0.5);", //ambient RGBA -- alpha is intensity - "const vec3 Falloff = vec3(0.0, 1.0, 0.2);", //attenuation coefficients - - "uniform vec3 LightDir;",//" = vec3(1.0, 0.0, 1.0);", - - - "uniform vec2 mapDimensions;",// = vec2(256.0, 256.0);", - - - "void main(void) {", - "vec2 mapCords = vTextureCoord.xy;", - - "vec4 color = texture2D(uSampler, vTextureCoord.st);", - "vec3 nColor = texture2D(displacementMap, vTextureCoord.st).rgb;", - - - "mapCords *= vec2(dimensions.x/512.0, dimensions.y/512.0);", - - "mapCords.y *= -1.0;", - "mapCords.y += 1.0;", - - //RGBA of our diffuse color - "vec4 DiffuseColor = texture2D(uSampler, vTextureCoord);", - - //RGB of our normal map - "vec3 NormalMap = texture2D(displacementMap, mapCords).rgb;", - - //The delta position of light - //"vec3 LightDir = vec3(LightPos.xy - (gl_FragCoord.xy / Resolution.xy), LightPos.z);", - "vec3 LightDir = vec3(LightPos.xy - (mapCords.xy), LightPos.z);", - //Correct for aspect ratio - //"LightDir.x *= Resolution.x / Resolution.y;", - - //Determine distance (used for attenuation) BEFORE we normalize our LightDir - "float D = length(LightDir);", - - //normalize our vectors - "vec3 N = normalize(NormalMap * 2.0 - 1.0);", - "vec3 L = normalize(LightDir);", - - //Pre-multiply light color with intensity - //Then perform "N dot L" to determine our diffuse term - "vec3 Diffuse = (LightColor.rgb * LightColor.a) * max(dot(N, L), 0.0);", - - //pre-multiply ambient color with intensity - "vec3 Ambient = AmbientColor.rgb * AmbientColor.a;", - - //calculate attenuation - "float Attenuation = 1.0 / ( Falloff.x + (Falloff.y*D) + (Falloff.z*D*D) );", - - //the calculation which brings it all together - "vec3 Intensity = Ambient + Diffuse * Attenuation;", - "vec3 FinalColor = DiffuseColor.rgb * Intensity;", - "gl_FragColor = vColor * vec4(FinalColor, DiffuseColor.a);", - //"gl_FragColor = vec4(1.0, 0.0, 0.0, Attenuation);",//vColor * vec4(FinalColor, DiffuseColor.a);", - /* - // normalise color - "vec3 normal = normalize(nColor * 2.0 - 1.0);", - - "vec3 deltaPos = vec3( (light.xy - gl_FragCoord.xy) / resolution.xy, light.z );", - - "float lambert = clamp(dot(normal, lightDir), 0.0, 1.0);", - - "float d = sqrt(dot(deltaPos, deltaPos));", - "float att = 1.0 / ( attenuation.x + (attenuation.y*d) + (attenuation.z*d*d) );", - - "vec3 result = (ambientColor * ambientIntensity) + (lightColor.rgb * lambert) * att;", - "result *= color.rgb;", - - "gl_FragColor = vec4(result, 1.0);",*/ - - - - "}" - ]; - -} - -PIXI.NormalMapFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.NormalMapFilter.prototype.constructor = PIXI.NormalMapFilter; - -/** - * Sets the map dimensions uniforms when the texture becomes available. - * - * @method onTextureLoaded - */ -PIXI.NormalMapFilter.prototype.onTextureLoaded = function() -{ - this.uniforms.mapDimensions.value.x = this.uniforms.displacementMap.value.width; - this.uniforms.mapDimensions.value.y = this.uniforms.displacementMap.value.height; - - this.uniforms.displacementMap.value.baseTexture.off("loaded", this.boundLoadedFunction) -}; - -/** - * The texture used for the displacement map. Must be power of 2 texture. - * - * @property map - * @type Texture - */ -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'map', { - get: function() { - return this.uniforms.displacementMap.value; - }, - set: function(value) { - this.uniforms.displacementMap.value = value; - } -}); - -/** - * The multiplier used to scale the displacement result from the map calculation. - * - * @property scale - * @type Point - */ -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'scale', { - get: function() { - return this.uniforms.scale.value; - }, - set: function(value) { - this.uniforms.scale.value = value; - } -}); - -/** - * The offset used to move the displacement map. - * - * @property offset - * @type Point - */ -Object.defineProperty(PIXI.NormalMapFilter.prototype, 'offset', { - get: function() { - return this.uniforms.offset.value; - }, - set: function(value) { - this.uniforms.offset.value = value; - } -}); diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/PixelateFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/PixelateFilter.js deleted file mode 100755 index 2a3127d..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/PixelateFilter.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This filter applies a pixelate effect making display objects appear 'blocky'. - * - * @class PixelateFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.PixelateFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - invert: {type: '1f', value: 0}, - dimensions: {type: '4fv', value:new PIXI.Float32Array([10000, 100, 10, 10])}, - pixelSize: {type: '2f', value:{x:10, y:10}} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform vec2 testDim;', - 'uniform vec4 dimensions;', - 'uniform vec2 pixelSize;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' vec2 coord = vTextureCoord;', - - ' vec2 size = dimensions.xy/pixelSize;', - - ' vec2 color = floor( ( vTextureCoord * size ) ) / size + pixelSize/dimensions.xy * 0.5;', - ' gl_FragColor = texture2D(uSampler, color);', - '}' - ]; -}; - -PIXI.PixelateFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.PixelateFilter.prototype.constructor = PIXI.PixelateFilter; - -/** - * This a point that describes the size of the blocks. x is the width of the block and y is the height. - * - * @property size - * @type Point - */ -Object.defineProperty(PIXI.PixelateFilter.prototype, 'size', { - get: function() { - return this.uniforms.pixelSize.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.pixelSize.value = value; - } -}); diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/RGBSplitFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/RGBSplitFilter.js deleted file mode 100755 index 7169637..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/RGBSplitFilter.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * An RGB Split Filter. - * - * @class RGBSplitFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.RGBSplitFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - red: {type: '2f', value: {x:20, y:20}}, - green: {type: '2f', value: {x:-20, y:20}}, - blue: {type: '2f', value: {x:20, y:-20}}, - dimensions: {type: '4fv', value:[0,0,0,0]} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform vec2 red;', - 'uniform vec2 green;', - 'uniform vec2 blue;', - 'uniform vec4 dimensions;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/dimensions.xy).r;', - ' gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/dimensions.xy).g;', - ' gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/dimensions.xy).b;', - ' gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;', - '}' - ]; -}; - -PIXI.RGBSplitFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.RGBSplitFilter.prototype.constructor = PIXI.RGBSplitFilter; - -/** - * Red channel offset. - * - * @property red - * @type Point - */ -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'red', { - get: function() { - return this.uniforms.red.value; - }, - set: function(value) { - this.uniforms.red.value = value; - } -}); - -/** - * Green channel offset. - * - * @property green - * @type Point - */ -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'green', { - get: function() { - return this.uniforms.green.value; - }, - set: function(value) { - this.uniforms.green.value = value; - } -}); - -/** - * Blue offset. - * - * @property blue - * @type Point - */ -Object.defineProperty(PIXI.RGBSplitFilter.prototype, 'blue', { - get: function() { - return this.uniforms.blue.value; - }, - set: function(value) { - this.uniforms.blue.value = value; - } -}); diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/SepiaFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/SepiaFilter.js deleted file mode 100755 index 5596e53..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/SepiaFilter.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This applies a sepia effect to your Display Objects. - * - * @class SepiaFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.SepiaFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - sepia: {type: '1f', value: 1} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform float sepia;', - 'uniform sampler2D uSampler;', - - 'const mat3 sepiaMatrix = mat3(0.3588, 0.7044, 0.1368, 0.2990, 0.5870, 0.1140, 0.2392, 0.4696, 0.0912);', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord);', - ' gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb * sepiaMatrix, sepia);', - // ' gl_FragColor = gl_FragColor * vColor;', - '}' - ]; -}; - -PIXI.SepiaFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.SepiaFilter.prototype.constructor = PIXI.SepiaFilter; - -/** - * The strength of the sepia. 1 will apply the full sepia effect, 0 will make the object its normal color. - * @property sepia - * @type Number -*/ -Object.defineProperty(PIXI.SepiaFilter.prototype, 'sepia', { - get: function() { - return this.uniforms.sepia.value; - }, - set: function(value) { - this.uniforms.sepia.value = value; - } -}); diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/SmartBlurFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/SmartBlurFilter.js deleted file mode 100755 index 44a47f4..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/SmartBlurFilter.js +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A Smart Blur Filter. - * - * @class SmartBlurFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.SmartBlurFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 1/512} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'uniform sampler2D uSampler;', - //'uniform vec2 delta;', - 'const vec2 delta = vec2(1.0/10.0, 0.0);', - //'uniform float darkness;', - - 'float random(vec3 scale, float seed) {', - ' return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);', - '}', - - - 'void main(void) {', - ' vec4 color = vec4(0.0);', - ' float total = 0.0;', - - ' float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);', - - ' for (float t = -30.0; t <= 30.0; t++) {', - ' float percent = (t + offset - 0.5) / 30.0;', - ' float weight = 1.0 - abs(percent);', - ' vec4 sample = texture2D(uSampler, vTextureCoord + delta * percent);', - ' sample.rgb *= sample.a;', - ' color += sample * weight;', - ' total += weight;', - ' }', - - ' gl_FragColor = color / total;', - ' gl_FragColor.rgb /= gl_FragColor.a + 0.00001;', - //' gl_FragColor.rgb *= darkness;', - '}' - ]; -}; - -PIXI.SmartBlurFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.SmartBlurFilter.prototype.constructor = PIXI.SmartBlurFilter; - -/** - * The strength of the blur. - * - * @property blur - * @type Number - * @default 2 - */ -Object.defineProperty(PIXI.SmartBlurFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value; - }, - set: function(value) { - this.uniforms.blur.value = value; - } -}); diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/TiltShiftFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/TiltShiftFilter.js deleted file mode 100755 index 2eb3776..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/TiltShiftFilter.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @author Vico @vicocotea - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/ - */ - -/** - * A TiltShift Filter. Manages the pass of both a TiltShiftXFilter and TiltShiftYFilter. - * - * @class TiltShiftFilter - * @constructor - */ -PIXI.TiltShiftFilter = function() -{ - this.tiltShiftXFilter = new PIXI.TiltShiftXFilter(); - this.tiltShiftYFilter = new PIXI.TiltShiftYFilter(); - this.tiltShiftXFilter.updateDelta(); - this.tiltShiftXFilter.updateDelta(); - - this.passes = [this.tiltShiftXFilter, this.tiltShiftYFilter]; -}; - -PIXI.TiltShiftFilter.prototype.constructor = PIXI.TiltShiftFilter; - -/** - * The strength of the blur. - * - * @property blur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'blur', { - get: function() { - return this.tiltShiftXFilter.blur; - }, - set: function(value) { - this.tiltShiftXFilter.blur = this.tiltShiftYFilter.blur = value; - } -}); - -/** - * The strength of the gradient blur. - * - * @property gradientBlur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'gradientBlur', { - get: function() { - return this.tiltShiftXFilter.gradientBlur; - }, - set: function(value) { - this.tiltShiftXFilter.gradientBlur = this.tiltShiftYFilter.gradientBlur = value; - } -}); - -/** - * The Y value to start the effect at. - * - * @property start - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'start', { - get: function() { - return this.tiltShiftXFilter.start; - }, - set: function(value) { - this.tiltShiftXFilter.start = this.tiltShiftYFilter.start = value; - } -}); - -/** - * The Y value to end the effect at. - * - * @property end - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftFilter.prototype, 'end', { - get: function() { - return this.tiltShiftXFilter.end; - }, - set: function(value) { - this.tiltShiftXFilter.end = this.tiltShiftYFilter.end = value; - } -}); diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/TiltShiftXFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/TiltShiftXFilter.js deleted file mode 100755 index 29d8f38..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/TiltShiftXFilter.js +++ /dev/null @@ -1,149 +0,0 @@ -/** - * @author Vico @vicocotea - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/ - */ - -/** - * A TiltShiftXFilter. - * - * @class TiltShiftXFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.TiltShiftXFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 100.0}, - gradientBlur: {type: '1f', value: 600.0}, - start: {type: '2f', value:{x:0, y:window.screenHeight / 2}}, - end: {type: '2f', value:{x:600, y:window.screenHeight / 2}}, - delta: {type: '2f', value:{x:30, y:30}}, - texSize: {type: '2f', value:{x:window.screenWidth, y:window.screenHeight}} - }; - - this.updateDelta(); - - this.fragmentSrc = [ - 'precision mediump float;', - 'uniform sampler2D uSampler;', - 'uniform float blur;', - 'uniform float gradientBlur;', - 'uniform vec2 start;', - 'uniform vec2 end;', - 'uniform vec2 delta;', - 'uniform vec2 texSize;', - 'varying vec2 vTextureCoord;', - - 'float random(vec3 scale, float seed) {', - ' return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);', - '}', - - 'void main(void) {', - ' vec4 color = vec4(0.0);', - ' float total = 0.0;', - - ' float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);', - ' vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));', - ' float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;', - - ' for (float t = -30.0; t <= 30.0; t++) {', - ' float percent = (t + offset - 0.5) / 30.0;', - ' float weight = 1.0 - abs(percent);', - ' vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);', - ' sample.rgb *= sample.a;', - ' color += sample * weight;', - ' total += weight;', - ' }', - - ' gl_FragColor = color / total;', - ' gl_FragColor.rgb /= gl_FragColor.a + 0.00001;', - '}' - ]; -}; - -PIXI.TiltShiftXFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.TiltShiftXFilter.prototype.constructor = PIXI.TiltShiftXFilter; - -/** - * The strength of the blur. - * - * @property blur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.blur.value = value; - } -}); - -/** - * The strength of the gradient blur. - * - * @property gradientBlur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'gradientBlur', { - get: function() { - return this.uniforms.gradientBlur.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.gradientBlur.value = value; - } -}); - -/** - * The X value to start the effect at. - * - * @property start - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'start', { - get: function() { - return this.uniforms.start.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.start.value = value; - this.updateDelta(); - } -}); - -/** - * The X value to end the effect at. - * - * @property end - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftXFilter.prototype, 'end', { - get: function() { - return this.uniforms.end.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.end.value = value; - this.updateDelta(); - } -}); - -/** - * Updates the filter delta values. - * - * @method updateDelta - */ -PIXI.TiltShiftXFilter.prototype.updateDelta = function(){ - var dx = this.uniforms.end.value.x - this.uniforms.start.value.x; - var dy = this.uniforms.end.value.y - this.uniforms.start.value.y; - var d = Math.sqrt(dx * dx + dy * dy); - this.uniforms.delta.value.x = dx / d; - this.uniforms.delta.value.y = dy / d; -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/TiltShiftYFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/TiltShiftYFilter.js deleted file mode 100755 index 3a92851..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/TiltShiftYFilter.js +++ /dev/null @@ -1,149 +0,0 @@ -/** - * @author Vico @vicocotea - * original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js by Evan Wallace : http://madebyevan.com/ - */ - -/** - * A TiltShiftYFilter. - * - * @class TiltShiftYFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.TiltShiftYFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - blur: {type: '1f', value: 100.0}, - gradientBlur: {type: '1f', value: 600.0}, - start: {type: '2f', value:{x:0, y:window.screenHeight / 2}}, - end: {type: '2f', value:{x:600, y:window.screenHeight / 2}}, - delta: {type: '2f', value:{x:30, y:30}}, - texSize: {type: '2f', value:{x:window.screenWidth, y:window.screenHeight}} - }; - - this.updateDelta(); - - this.fragmentSrc = [ - 'precision mediump float;', - 'uniform sampler2D uSampler;', - 'uniform float blur;', - 'uniform float gradientBlur;', - 'uniform vec2 start;', - 'uniform vec2 end;', - 'uniform vec2 delta;', - 'uniform vec2 texSize;', - 'varying vec2 vTextureCoord;', - - 'float random(vec3 scale, float seed) {', - ' return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);', - '}', - - 'void main(void) {', - ' vec4 color = vec4(0.0);', - ' float total = 0.0;', - - ' float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);', - ' vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));', - ' float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;', - - ' for (float t = -30.0; t <= 30.0; t++) {', - ' float percent = (t + offset - 0.5) / 30.0;', - ' float weight = 1.0 - abs(percent);', - ' vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);', - ' sample.rgb *= sample.a;', - ' color += sample * weight;', - ' total += weight;', - ' }', - - ' gl_FragColor = color / total;', - ' gl_FragColor.rgb /= gl_FragColor.a + 0.00001;', - '}' - ]; -}; - -PIXI.TiltShiftYFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.TiltShiftYFilter.prototype.constructor = PIXI.TiltShiftYFilter; - -/** - * The strength of the blur. - * - * @property blur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'blur', { - get: function() { - return this.uniforms.blur.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.blur.value = value; - } -}); - -/** - * The strength of the gradient blur. - * - * @property gradientBlur - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'gradientBlur', { - get: function() { - return this.uniforms.gradientBlur.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.gradientBlur.value = value; - } -}); - -/** - * The Y value to start the effect at. - * - * @property start - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'start', { - get: function() { - return this.uniforms.start.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.start.value = value; - this.updateDelta(); - } -}); - -/** - * The Y value to end the effect at. - * - * @property end - * @type Number - */ -Object.defineProperty(PIXI.TiltShiftYFilter.prototype, 'end', { - get: function() { - return this.uniforms.end.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.end.value = value; - this.updateDelta(); - } -}); - -/** - * Updates the filter delta values. - * - * @method updateDelta - */ -PIXI.TiltShiftYFilter.prototype.updateDelta = function(){ - var dx = this.uniforms.end.value.x - this.uniforms.start.value.x; - var dy = this.uniforms.end.value.y - this.uniforms.start.value.y; - var d = Math.sqrt(dx * dx + dy * dy); - this.uniforms.delta.value.x = -dy / d; - this.uniforms.delta.value.y = dx / d; -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/filters/TwistFilter.js b/tutorial-4/pixi.js-master/src/pixi/filters/TwistFilter.js deleted file mode 100755 index 08a3122..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/filters/TwistFilter.js +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This filter applies a twist effect making display objects appear twisted in the given direction. - * - * @class TwistFilter - * @extends AbstractFilter - * @constructor - */ -PIXI.TwistFilter = function() -{ - PIXI.AbstractFilter.call( this ); - - this.passes = [this]; - - // set the uniforms - this.uniforms = { - radius: {type: '1f', value:0.5}, - angle: {type: '1f', value:5}, - offset: {type: '2f', value:{x:0.5, y:0.5}} - }; - - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform vec4 dimensions;', - 'uniform sampler2D uSampler;', - - 'uniform float radius;', - 'uniform float angle;', - 'uniform vec2 offset;', - - 'void main(void) {', - ' vec2 coord = vTextureCoord - offset;', - ' float distance = length(coord);', - - ' if (distance < radius) {', - ' float ratio = (radius - distance) / radius;', - ' float angleMod = ratio * ratio * angle;', - ' float s = sin(angleMod);', - ' float c = cos(angleMod);', - ' coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);', - ' }', - - ' gl_FragColor = texture2D(uSampler, coord+offset);', - '}' - ]; -}; - -PIXI.TwistFilter.prototype = Object.create( PIXI.AbstractFilter.prototype ); -PIXI.TwistFilter.prototype.constructor = PIXI.TwistFilter; - -/** - * This point describes the the offset of the twist. - * - * @property offset - * @type Point - */ -Object.defineProperty(PIXI.TwistFilter.prototype, 'offset', { - get: function() { - return this.uniforms.offset.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.offset.value = value; - } -}); - -/** - * This radius of the twist. - * - * @property radius - * @type Number - */ -Object.defineProperty(PIXI.TwistFilter.prototype, 'radius', { - get: function() { - return this.uniforms.radius.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.radius.value = value; - } -}); - -/** - * This angle of the twist. - * - * @property angle - * @type Number - */ -Object.defineProperty(PIXI.TwistFilter.prototype, 'angle', { - get: function() { - return this.uniforms.angle.value; - }, - set: function(value) { - this.dirty = true; - this.uniforms.angle.value = value; - } -}); diff --git a/tutorial-4/pixi.js-master/src/pixi/geom/Circle.js b/tutorial-4/pixi.js-master/src/pixi/geom/Circle.js deleted file mode 100755 index 47288c6..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/geom/Circle.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @author Chad Engler - */ - -/** - * The Circle object can be used to specify a hit area for displayObjects - * - * @class Circle - * @constructor - * @param x {Number} The X coordinate of the center of this circle - * @param y {Number} The Y coordinate of the center of this circle - * @param radius {Number} The radius of the circle - */ -PIXI.Circle = function(x, y, radius) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property radius - * @type Number - * @default 0 - */ - this.radius = radius || 0; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.CIRC in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Circle instance - * - * @method clone - * @return {Circle} a copy of the Circle - */ -PIXI.Circle.prototype.clone = function() -{ - return new PIXI.Circle(this.x, this.y, this.radius); -}; - -/** - * Checks whether the x and y coordinates given are contained within this circle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Circle - */ -PIXI.Circle.prototype.contains = function(x, y) -{ - if(this.radius <= 0) - return false; - - var dx = (this.x - x), - dy = (this.y - y), - r2 = this.radius * this.radius; - - dx *= dx; - dy *= dy; - - return (dx + dy <= r2); -}; - -/** -* Returns the framing rectangle of the circle as a PIXI.Rectangle object -* -* @method getBounds -* @return {Rectangle} the framing rectangle -*/ -PIXI.Circle.prototype.getBounds = function() -{ - return new PIXI.Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2); -}; - -// constructor -PIXI.Circle.prototype.constructor = PIXI.Circle; diff --git a/tutorial-4/pixi.js-master/src/pixi/geom/Ellipse.js b/tutorial-4/pixi.js-master/src/pixi/geom/Ellipse.js deleted file mode 100755 index 2700a71..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/geom/Ellipse.js +++ /dev/null @@ -1,100 +0,0 @@ -/** - * @author Chad Engler - */ - -/** - * The Ellipse object can be used to specify a hit area for displayObjects - * - * @class Ellipse - * @constructor - * @param x {Number} The X coordinate of the center of the ellipse - * @param y {Number} The Y coordinate of the center of the ellipse - * @param width {Number} The half width of this ellipse - * @param height {Number} The half height of this ellipse - */ -PIXI.Ellipse = function(x, y, width, height) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.ELIP in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Ellipse instance - * - * @method clone - * @return {Ellipse} a copy of the ellipse - */ -PIXI.Ellipse.prototype.clone = function() -{ - return new PIXI.Ellipse(this.x, this.y, this.width, this.height); -}; - -/** - * Checks whether the x and y coordinates given are contained within this ellipse - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coords are within this ellipse - */ -PIXI.Ellipse.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - //normalize the coords to an ellipse with center 0,0 - var normx = ((x - this.x) / this.width), - normy = ((y - this.y) / this.height); - - normx *= normx; - normy *= normy; - - return (normx + normy <= 1); -}; - -/** -* Returns the framing rectangle of the ellipse as a PIXI.Rectangle object -* -* @method getBounds -* @return {Rectangle} the framing rectangle -*/ -PIXI.Ellipse.prototype.getBounds = function() -{ - return new PIXI.Rectangle(this.x - this.width, this.y - this.height, this.width, this.height); -}; - -// constructor -PIXI.Ellipse.prototype.constructor = PIXI.Ellipse; diff --git a/tutorial-4/pixi.js-master/src/pixi/geom/Matrix.js b/tutorial-4/pixi.js-master/src/pixi/geom/Matrix.js deleted file mode 100755 index b0f043f..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/geom/Matrix.js +++ /dev/null @@ -1,268 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Matrix class is now an object, which makes it a lot faster, - * here is a representation of it : - * | a | b | tx| - * | c | d | ty| - * | 0 | 0 | 1 | - * - * @class Matrix - * @constructor - */ -PIXI.Matrix = function() -{ - /** - * @property a - * @type Number - * @default 1 - */ - this.a = 1; - - /** - * @property b - * @type Number - * @default 0 - */ - this.b = 0; - - /** - * @property c - * @type Number - * @default 0 - */ - this.c = 0; - - /** - * @property d - * @type Number - * @default 1 - */ - this.d = 1; - - /** - * @property tx - * @type Number - * @default 0 - */ - this.tx = 0; - - /** - * @property ty - * @type Number - * @default 0 - */ - this.ty = 0; -}; - -/** - * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows: - * - * a = array[0] - * b = array[1] - * c = array[3] - * d = array[4] - * tx = array[2] - * ty = array[5] - * - * @method fromArray - * @param array {Array} The array that the matrix will be populated from. - */ -PIXI.Matrix.prototype.fromArray = function(array) -{ - this.a = array[0]; - this.b = array[1]; - this.c = array[3]; - this.d = array[4]; - this.tx = array[2]; - this.ty = array[5]; -}; - -/** - * Creates an array from the current Matrix object. - * - * @method toArray - * @param transpose {Boolean} Whether we need to transpose the matrix or not - * @return {Array} the newly created array which contains the matrix - */ -PIXI.Matrix.prototype.toArray = function(transpose) -{ - if(!this.array) this.array = new PIXI.Float32Array(9); - var array = this.array; - - if(transpose) - { - array[0] = this.a; - array[1] = this.b; - array[2] = 0; - array[3] = this.c; - array[4] = this.d; - array[5] = 0; - array[6] = this.tx; - array[7] = this.ty; - array[8] = 1; - } - else - { - array[0] = this.a; - array[1] = this.c; - array[2] = this.tx; - array[3] = this.b; - array[4] = this.d; - array[5] = this.ty; - array[6] = 0; - array[7] = 0; - array[8] = 1; - } - - return array; -}; - -/** - * Get a new position with the current transformation applied. - * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) - * - * @method apply - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, transformed through this matrix - */ -PIXI.Matrix.prototype.apply = function(pos, newPos) -{ - newPos = newPos || new PIXI.Point(); - - newPos.x = this.a * pos.x + this.c * pos.y + this.tx; - newPos.y = this.b * pos.x + this.d * pos.y + this.ty; - - return newPos; -}; - -/** - * Get a new position with the inverse of the current transformation applied. - * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) - * - * @method applyInverse - * @param pos {Point} The origin - * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) - * @return {Point} The new point, inverse-transformed through this matrix - */ -PIXI.Matrix.prototype.applyInverse = function(pos, newPos) -{ - newPos = newPos || new PIXI.Point(); - - var id = 1 / (this.a * this.d + this.c * -this.b); - - newPos.x = this.d * id * pos.x + -this.c * id * pos.y + (this.ty * this.c - this.tx * this.d) * id; - newPos.y = this.a * id * pos.y + -this.b * id * pos.x + (-this.ty * this.a + this.tx * this.b) * id; - - return newPos; -}; - -/** - * Translates the matrix on the x and y. - * - * @method translate - * @param {Number} x - * @param {Number} y - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.translate = function(x, y) -{ - this.tx += x; - this.ty += y; - - return this; -}; - -/** - * Applies a scale transformation to the matrix. - * - * @method scale - * @param {Number} x The amount to scale horizontally - * @param {Number} y The amount to scale vertically - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.scale = function(x, y) -{ - this.a *= x; - this.d *= y; - this.c *= x; - this.b *= y; - this.tx *= x; - this.ty *= y; - - return this; -}; - - -/** - * Applies a rotation transformation to the matrix. - * @method rotate - * @param {Number} angle The angle in radians. - * @return {Matrix} This matrix. Good for chaining method calls. - **/ -PIXI.Matrix.prototype.rotate = function(angle) -{ - var cos = Math.cos( angle ); - var sin = Math.sin( angle ); - - var a1 = this.a; - var c1 = this.c; - var tx1 = this.tx; - - this.a = a1 * cos-this.b * sin; - this.b = a1 * sin+this.b * cos; - this.c = c1 * cos-this.d * sin; - this.d = c1 * sin+this.d * cos; - this.tx = tx1 * cos - this.ty * sin; - this.ty = tx1 * sin + this.ty * cos; - - return this; -}; - -/** - * Appends the given Matrix to this Matrix. - * - * @method append - * @param {Matrix} matrix - * @return {Matrix} This matrix. Good for chaining method calls. - */ -PIXI.Matrix.prototype.append = function(matrix) -{ - var a1 = this.a; - var b1 = this.b; - var c1 = this.c; - var d1 = this.d; - - this.a = matrix.a * a1 + matrix.b * c1; - this.b = matrix.a * b1 + matrix.b * d1; - this.c = matrix.c * a1 + matrix.d * c1; - this.d = matrix.c * b1 + matrix.d * d1; - - this.tx = matrix.tx * a1 + matrix.ty * c1 + this.tx; - this.ty = matrix.tx * b1 + matrix.ty * d1 + this.ty; - - return this; -}; - -/** - * Resets this Matix to an identity (default) matrix. - * - * @method identity - * @return {Matrix} This matrix. Good for chaining method calls. - */ -PIXI.Matrix.prototype.identity = function() -{ - this.a = 1; - this.b = 0; - this.c = 0; - this.d = 1; - this.tx = 0; - this.ty = 0; - - return this; -}; - -PIXI.identityMatrix = new PIXI.Matrix(); diff --git a/tutorial-4/pixi.js-master/src/pixi/geom/Point.js b/tutorial-4/pixi.js-master/src/pixi/geom/Point.js deleted file mode 100755 index 2adcb13..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/geom/Point.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis. - * - * @class Point - * @constructor - * @param x {Number} position of the point on the x axis - * @param y {Number} position of the point on the y axis - */ -PIXI.Point = function(x, y) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; -}; - -/** - * Creates a clone of this point - * - * @method clone - * @return {Point} a copy of the point - */ -PIXI.Point.prototype.clone = function() -{ - return new PIXI.Point(this.x, this.y); -}; - -/** - * Sets the point to a new x and y position. - * If y is omitted, both x and y will be set to x. - * - * @method set - * @param [x=0] {Number} position of the point on the x axis - * @param [y=0] {Number} position of the point on the y axis - */ -PIXI.Point.prototype.set = function(x, y) -{ - this.x = x || 0; - this.y = y || ( (y !== 0) ? this.x : 0 ) ; -}; - -// constructor -PIXI.Point.prototype.constructor = PIXI.Point; \ No newline at end of file diff --git a/tutorial-4/pixi.js-master/src/pixi/geom/Polygon.js b/tutorial-4/pixi.js-master/src/pixi/geom/Polygon.js deleted file mode 100755 index 77f8f56..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/geom/Polygon.js +++ /dev/null @@ -1,90 +0,0 @@ -/** - * @author Adrien Brault - */ - -/** - * @class Polygon - * @constructor - * @param points* {Array(Point)|Array(Number)|Point...|Number...} This can be an array of Points that form the polygon, - * a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be - * all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the - * arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are - * Numbers. - */ -PIXI.Polygon = function(points) -{ - //if points isn't an array, use arguments as the array - if(!(points instanceof Array))points = Array.prototype.slice.call(arguments); - - //if this is a flat array of numbers, convert it to points - if(points[0] instanceof PIXI.Point) - { - var p = []; - for(var i = 0, il = points.length; i < il; i++) - { - p.push(points[i].x, points[i].y); - } - - points = p; - } - - this.closed = true; - - /** - * An array of the points of this polygon - * @property points - * @type Array(Point)|Array(Number) - * - */ - this.points = points; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.POLY in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this polygon - * - * @method clone - * @return {Polygon} a copy of the polygon - */ -PIXI.Polygon.prototype.clone = function() -{ - var points = this.points.slice(); - return new PIXI.Polygon(points); -}; - -/** - * Checks whether the x and y coordinates passed to this function are contained within this polygon - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this polygon - */ -PIXI.Polygon.prototype.contains = function(x, y) -{ - var inside = false; - - // use some raycasting to test hits - // https://github.com/substack/point-in-polygon/blob/master/index.js - var length = this.points.length / 2; - - for(var i = 0, j = length - 1; i < length; j = i++) - { - var xi = this.points[i * 2], yi = this.points[i * 2 + 1], - xj = this.points[j * 2], yj = this.points[j * 2 + 1], - intersect = ((yi > y) !== (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi); - - if(intersect) inside = !inside; - } - - return inside; -}; - -// constructor -PIXI.Polygon.prototype.constructor = PIXI.Polygon; diff --git a/tutorial-4/pixi.js-master/src/pixi/geom/Rectangle.js b/tutorial-4/pixi.js-master/src/pixi/geom/Rectangle.js deleted file mode 100755 index 61985fa..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/geom/Rectangle.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height. - * - * @class Rectangle - * @constructor - * @param x {Number} The X coordinate of the upper-left corner of the rectangle - * @param y {Number} The Y coordinate of the upper-left corner of the rectangle - * @param width {Number} The overall width of this rectangle - * @param height {Number} The overall height of this rectangle - */ -PIXI.Rectangle = function(x, y, width, height) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RECT in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Rectangle - * - * @method clone - * @return {Rectangle} a copy of the rectangle - */ -PIXI.Rectangle.prototype.clone = function() -{ - return new PIXI.Rectangle(this.x, this.y, this.width, this.height); -}; - -/** - * Checks whether the x and y coordinates given are contained within this Rectangle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Rectangle - */ -PIXI.Rectangle.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - var x1 = this.x; - if(x >= x1 && x <= x1 + this.width) - { - var y1 = this.y; - - if(y >= y1 && y <= y1 + this.height) - { - return true; - } - } - - return false; -}; - -// constructor -PIXI.Rectangle.prototype.constructor = PIXI.Rectangle; - -PIXI.EmptyRectangle = new PIXI.Rectangle(0,0,0,0); \ No newline at end of file diff --git a/tutorial-4/pixi.js-master/src/pixi/geom/RoundedRectangle.js b/tutorial-4/pixi.js-master/src/pixi/geom/RoundedRectangle.js deleted file mode 100755 index 4f75723..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/geom/RoundedRectangle.js +++ /dev/null @@ -1,101 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ - */ - -/** - * The Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height. - * - * @class RoundedRectangle - * @constructor - * @param x {Number} The X coordinate of the upper-left corner of the rounded rectangle - * @param y {Number} The Y coordinate of the upper-left corner of the rounded rectangle - * @param width {Number} The overall width of this rounded rectangle - * @param height {Number} The overall height of this rounded rectangle - * @param radius {Number} Controls the radius of the rounded corners - */ -PIXI.RoundedRectangle = function(x, y, width, height, radius) -{ - /** - * @property x - * @type Number - * @default 0 - */ - this.x = x || 0; - - /** - * @property y - * @type Number - * @default 0 - */ - this.y = y || 0; - - /** - * @property width - * @type Number - * @default 0 - */ - this.width = width || 0; - - /** - * @property height - * @type Number - * @default 0 - */ - this.height = height || 0; - - /** - * @property radius - * @type Number - * @default 20 - */ - this.radius = radius || 20; - - /** - * The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RRECT in this case - * @property type - * @type Number - * @default 0 - */ -}; - -/** - * Creates a clone of this Rounded Rectangle - * - * @method clone - * @return {RoundedRectangle} a copy of the rounded rectangle - */ -PIXI.RoundedRectangle.prototype.clone = function() -{ - return new PIXI.RoundedRectangle(this.x, this.y, this.width, this.height, this.radius); -}; - -/** - * Checks whether the x and y coordinates given are contained within this Rounded Rectangle - * - * @method contains - * @param x {Number} The X coordinate of the point to test - * @param y {Number} The Y coordinate of the point to test - * @return {Boolean} Whether the x/y coordinates are within this Rounded Rectangle - */ -PIXI.RoundedRectangle.prototype.contains = function(x, y) -{ - if(this.width <= 0 || this.height <= 0) - return false; - - var x1 = this.x; - if(x >= x1 && x <= x1 + this.width) - { - var y1 = this.y; - - if(y >= y1 && y <= y1 + this.height) - { - return true; - } - } - - return false; -}; - -// constructor -PIXI.RoundedRectangle.prototype.constructor = PIXI.RoundedRectangle; - diff --git a/tutorial-4/pixi.js-master/src/pixi/loaders/AssetLoader.js b/tutorial-4/pixi.js-master/src/pixi/loaders/AssetLoader.js deleted file mode 100755 index 0e4b858..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/loaders/AssetLoader.js +++ /dev/null @@ -1,167 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * 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 - * @uses EventTarget - * @param assetURLs {Array(String)} 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'. - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.AssetLoader = function(assetURLs, crossorigin) -{ - /** - * The array of asset URLs that are going to be loaded - * - * @property assetURLs - * @type Array(String) - */ - this.assetURLs = assetURLs; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * Maps file extension to loader types - * - * @property loadersByType - * @type Object - */ - this.loadersByType = { - 'jpg': PIXI.ImageLoader, - 'jpeg': PIXI.ImageLoader, - 'png': PIXI.ImageLoader, - 'gif': PIXI.ImageLoader, - 'webp': PIXI.ImageLoader, - 'json': PIXI.JsonLoader, - 'atlas': PIXI.AtlasLoader, - 'anim': PIXI.SpineLoader, - 'xml': PIXI.BitmapFontLoader, - 'fnt': PIXI.BitmapFontLoader - }; -}; - -PIXI.EventTarget.mixin(PIXI.AssetLoader.prototype); - -/** - * Fired when an item has loaded - * @event onProgress - */ - -/** - * Fired when all the assets have loaded - * @event onComplete - */ - -// constructor -PIXI.AssetLoader.prototype.constructor = PIXI.AssetLoader; - -/** - * Given a filename, returns its extension. - * - * @method _getDataType - * @param str {String} the name of the asset - */ -PIXI.AssetLoader.prototype._getDataType = function(str) -{ - var test = 'data:'; - //starts with 'data:' - var start = str.slice(0, test.length).toLowerCase(); - if (start === test) { - var data = str.slice(test.length); - - var sepIdx = data.indexOf(','); - if (sepIdx === -1) //malformed data URI scheme - return null; - - //e.g. 'image/gif;base64' => 'image/gif' - var info = data.slice(0, sepIdx).split(';')[0]; - - //We might need to handle some special cases here... - //standardize text/plain to 'txt' file extension - if (!info || info.toLowerCase() === 'text/plain') - return 'txt'; - - //User specified mime type, try splitting it by '/' - return info.split('/').pop().toLowerCase(); - } - - return null; -}; - -/** - * Starts loading the assets sequentially - * - * @method load - */ -PIXI.AssetLoader.prototype.load = function() -{ - var scope = this; - - function onLoad(evt) { - scope.onAssetLoaded(evt.data.content); - } - - this.loadCount = this.assetURLs.length; - - for (var i=0; i < this.assetURLs.length; i++) - { - var fileName = this.assetURLs[i]; - //first see if we have a data URI scheme.. - var fileType = this._getDataType(fileName); - - //if not, assume it's a file URI - if (!fileType) - fileType = fileName.split('?').shift().split('.').pop().toLowerCase(); - - var Constructor = this.loadersByType[fileType]; - if(!Constructor) - throw new Error(fileType + ' is an unsupported file type'); - - var loader = new Constructor(fileName, this.crossorigin); - - loader.on('loaded', onLoad); - loader.load(); - } -}; - -/** - * Invoked after each file is loaded - * - * @method onAssetLoaded - * @private - */ -PIXI.AssetLoader.prototype.onAssetLoaded = function(loader) -{ - this.loadCount--; - - this.emit('onProgress', { - content: this, - loader: loader, - loaded: this.assetURLs.length - this.loadCount, - total: this.assetURLs.length - }); - - if (this.onProgress) this.onProgress(loader); - - if (!this.loadCount) - { - this.emit('onComplete', { content: this }); - if(this.onComplete) this.onComplete(); - } -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/loaders/AtlasLoader.js b/tutorial-4/pixi.js-master/src/pixi/loaders/AtlasLoader.js deleted file mode 100755 index 5368b6b..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/loaders/AtlasLoader.js +++ /dev/null @@ -1,190 +0,0 @@ -/** - * @author Martin Kelm http://mkelm.github.com - */ - -/** - * The atlas file loader is used to load in Texture Atlas data and parse it. When loaded this class will dispatch a 'loaded' event. If loading fails this class will dispatch an 'error' event. - * - * To generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format. - * - * It is highly recommended to use texture atlases (also know as 'sprite sheets') as it allowed sprites to 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.fromFrameId() - * - * @class AtlasLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.AtlasLoader = function (url, crossorigin) { - this.url = url; - this.baseUrl = url.replace(/[^\/]*$/, ''); - this.crossorigin = crossorigin; - this.loaded = false; - -}; - -// constructor -PIXI.AtlasLoader.constructor = PIXI.AtlasLoader; - -PIXI.EventTarget.mixin(PIXI.AtlasLoader.prototype); - - /** - * Starts loading the JSON file - * - * @method load - */ -PIXI.AtlasLoader.prototype.load = function () { - this.ajaxRequest = new PIXI.AjaxRequest(); - this.ajaxRequest.onreadystatechange = this.onAtlasLoaded.bind(this); - - this.ajaxRequest.open('GET', this.url, true); - if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/json'); - this.ajaxRequest.send(null); -}; - -/** - * Invoked when the Atlas has fully loaded. Parses the JSON and builds the texture frames. - * - * @method onAtlasLoaded - * @private - */ -PIXI.AtlasLoader.prototype.onAtlasLoaded = function () { - if (this.ajaxRequest.readyState === 4) { - if (this.ajaxRequest.status === 200 || window.location.href.indexOf('http') === -1) { - this.atlas = { - meta : { - image : [] - }, - frames : [] - }; - var result = this.ajaxRequest.responseText.split(/\r?\n/); - var lineCount = -3; - - var currentImageId = 0; - var currentFrame = null; - var nameInNextLine = false; - - var i = 0, - j = 0, - selfOnLoaded = this.onLoaded.bind(this); - - // parser without rotation support yet! - for (i = 0; i < result.length; i++) { - result[i] = result[i].replace(/^\s+|\s+$/g, ''); - if (result[i] === '') { - nameInNextLine = i+1; - } - if (result[i].length > 0) { - if (nameInNextLine === i) { - this.atlas.meta.image.push(result[i]); - currentImageId = this.atlas.meta.image.length - 1; - this.atlas.frames.push({}); - lineCount = -3; - } else if (lineCount > 0) { - if (lineCount % 7 === 1) { // frame name - if (currentFrame != null) { //jshint ignore:line - this.atlas.frames[currentImageId][currentFrame.name] = currentFrame; - } - currentFrame = { name: result[i], frame : {} }; - } else { - var text = result[i].split(' '); - if (lineCount % 7 === 3) { // position - currentFrame.frame.x = Number(text[1].replace(',', '')); - currentFrame.frame.y = Number(text[2]); - } else if (lineCount % 7 === 4) { // size - currentFrame.frame.w = Number(text[1].replace(',', '')); - currentFrame.frame.h = Number(text[2]); - } else if (lineCount % 7 === 5) { // real size - var realSize = { - x : 0, - y : 0, - w : Number(text[1].replace(',', '')), - h : Number(text[2]) - }; - - if (realSize.w > currentFrame.frame.w || realSize.h > currentFrame.frame.h) { - currentFrame.trimmed = true; - currentFrame.realSize = realSize; - } else { - currentFrame.trimmed = false; - } - } - } - } - lineCount++; - } - } - - if (currentFrame != null) { //jshint ignore:line - this.atlas.frames[currentImageId][currentFrame.name] = currentFrame; - } - - if (this.atlas.meta.image.length > 0) { - this.images = []; - for (j = 0; j < this.atlas.meta.image.length; j++) { - // sprite sheet - var textureUrl = this.baseUrl + this.atlas.meta.image[j]; - var frameData = this.atlas.frames[j]; - this.images.push(new PIXI.ImageLoader(textureUrl, this.crossorigin)); - - for (i in frameData) { - var rect = frameData[i].frame; - if (rect) { - PIXI.TextureCache[i] = new PIXI.Texture(this.images[j].texture.baseTexture, { - x: rect.x, - y: rect.y, - width: rect.w, - height: rect.h - }); - if (frameData[i].trimmed) { - PIXI.TextureCache[i].realSize = frameData[i].realSize; - // trim in pixi not supported yet, todo update trim properties if it is done ... - PIXI.TextureCache[i].trim.x = 0; - PIXI.TextureCache[i].trim.y = 0; - } - } - } - } - - this.currentImageId = 0; - for (j = 0; j < this.images.length; j++) { - this.images[j].on('loaded', selfOnLoaded); - } - this.images[this.currentImageId].load(); - - } else { - this.onLoaded(); - } - - } else { - this.onError(); - } - } -}; - -/** - * Invoked when json file has loaded. - * - * @method onLoaded - * @private - */ -PIXI.AtlasLoader.prototype.onLoaded = function () { - if (this.images.length - 1 > this.currentImageId) { - this.currentImageId++; - this.images[this.currentImageId].load(); - } else { - this.loaded = true; - this.emit('loaded', { content: this }); - } -}; - -/** - * Invoked when an error occurs. - * - * @method onError - * @private - */ -PIXI.AtlasLoader.prototype.onError = function () { - this.emit('error', { content: this }); -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/loaders/BitmapFontLoader.js b/tutorial-4/pixi.js-master/src/pixi/loaders/BitmapFontLoader.js deleted file mode 100755 index 3eb54c4..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/loaders/BitmapFontLoader.js +++ /dev/null @@ -1,161 +0,0 @@ -/** - * @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 - * @uses EventTarget - * @constructor - * @param url {String} The url of the sprite sheet JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.BitmapFontLoader = function(url, crossorigin) -{ - /** - * The url of the bitmap font data - * - * @property url - * @type String - */ - this.url = url; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * [read-only] The base url of the bitmap font data - * - * @property baseUrl - * @type String - * @readOnly - */ - this.baseUrl = url.replace(/[^\/]*$/, ''); - - /** - * [read-only] The texture of the bitmap font - * - * @property texture - * @type Texture - */ - this.texture = null; -}; - -// constructor -PIXI.BitmapFontLoader.prototype.constructor = PIXI.BitmapFontLoader; -PIXI.EventTarget.mixin(PIXI.BitmapFontLoader.prototype); - -/** - * Loads the XML font data - * - * @method load - */ -PIXI.BitmapFontLoader.prototype.load = function() -{ - this.ajaxRequest = new PIXI.AjaxRequest(); - this.ajaxRequest.onreadystatechange = this.onXMLLoaded.bind(this); - - this.ajaxRequest.open('GET', this.url, true); - if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/xml'); - this.ajaxRequest.send(null); -}; - -/** - * Invoked when the XML file is loaded, parses the data. - * - * @method onXMLLoaded - * @private - */ -PIXI.BitmapFontLoader.prototype.onXMLLoaded = function() -{ - if (this.ajaxRequest.readyState === 4) - { - if (this.ajaxRequest.status === 200 || window.location.protocol.indexOf('http') === -1) - { - var responseXML = this.ajaxRequest.responseXML; - if(!responseXML || /MSIE 9/i.test(navigator.userAgent) || navigator.isCocoonJS) { - if(typeof(window.DOMParser) === 'function') { - var domparser = new DOMParser(); - responseXML = domparser.parseFromString(this.ajaxRequest.responseText, 'text/xml'); - } else { - var div = document.createElement('div'); - div.innerHTML = this.ajaxRequest.responseText; - responseXML = div; - } - } - - var textureUrl = this.baseUrl + responseXML.getElementsByTagName('page')[0].getAttribute('file'); - var image = new PIXI.ImageLoader(textureUrl, this.crossorigin); - this.texture = image.texture.baseTexture; - - var data = {}; - var info = responseXML.getElementsByTagName('info')[0]; - var common = responseXML.getElementsByTagName('common')[0]; - data.font = info.getAttribute('face'); - data.size = parseInt(info.getAttribute('size'), 10); - data.lineHeight = parseInt(common.getAttribute('lineHeight'), 10); - data.chars = {}; - - //parse letters - var letters = responseXML.getElementsByTagName('char'); - - for (var i = 0; i < letters.length; i++) - { - var charCode = parseInt(letters[i].getAttribute('id'), 10); - - var textureRect = new PIXI.Rectangle( - parseInt(letters[i].getAttribute('x'), 10), - parseInt(letters[i].getAttribute('y'), 10), - parseInt(letters[i].getAttribute('width'), 10), - parseInt(letters[i].getAttribute('height'), 10) - ); - - data.chars[charCode] = { - xOffset: parseInt(letters[i].getAttribute('xoffset'), 10), - yOffset: parseInt(letters[i].getAttribute('yoffset'), 10), - xAdvance: parseInt(letters[i].getAttribute('xadvance'), 10), - kerning: {}, - texture: PIXI.TextureCache[charCode] = new PIXI.Texture(this.texture, textureRect) - - }; - } - - //parse kernings - var kernings = responseXML.getElementsByTagName('kerning'); - for (i = 0; i < kernings.length; i++) - { - var first = parseInt(kernings[i].getAttribute('first'), 10); - var second = parseInt(kernings[i].getAttribute('second'), 10); - var amount = parseInt(kernings[i].getAttribute('amount'), 10); - - data.chars[second].kerning[first] = amount; - - } - - PIXI.BitmapText.fonts[data.font] = data; - - image.addEventListener('loaded', this.onLoaded.bind(this)); - image.load(); - } - } -}; - -/** - * Invoked when all files are loaded (xml/fnt and texture) - * - * @method onLoaded - * @private - */ -PIXI.BitmapFontLoader.prototype.onLoaded = function() -{ - this.emit('loaded', { content: this }); -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/loaders/ImageLoader.js b/tutorial-4/pixi.js-master/src/pixi/loaders/ImageLoader.js deleted file mode 100755 index 1567f29..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/loaders/ImageLoader.js +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @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.fromFrame() and PIXI.Sprite.fromFrame() - * When loaded this class will dispatch a 'loaded' event - * - * @class ImageLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the image - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.ImageLoader = function(url, crossorigin) -{ - /** - * The texture being loaded - * - * @property texture - * @type Texture - */ - this.texture = PIXI.Texture.fromImage(url, crossorigin); - - /** - * if the image is loaded with loadFramedSpriteSheet - * frames will contain the sprite sheet frames - * - * @property frames - * @type Array - * @readOnly - */ - this.frames = []; -}; - -// constructor -PIXI.ImageLoader.prototype.constructor = PIXI.ImageLoader; - -PIXI.EventTarget.mixin(PIXI.ImageLoader.prototype); - -/** - * Loads image or takes it from cache - * - * @method load - */ -PIXI.ImageLoader.prototype.load = function() -{ - if(!this.texture.baseTexture.hasLoaded) - { - this.texture.baseTexture.on('loaded', this.onLoaded.bind(this)); - } - else - { - this.onLoaded(); - } -}; - -/** - * Invoked when image file is loaded or it is already cached and ready to use - * - * @method onLoaded - * @private - */ -PIXI.ImageLoader.prototype.onLoaded = function() -{ - this.emit('loaded', { content: this }); -}; - -/** - * Loads image and split it to uniform sized frames - * - * @method loadFramedSpriteSheet - * @param frameWidth {Number} width of each frame - * @param frameHeight {Number} height of each frame - * @param textureName {String} if given, the frames will be cached in - format - */ -PIXI.ImageLoader.prototype.loadFramedSpriteSheet = function(frameWidth, frameHeight, textureName) -{ - this.frames = []; - var cols = Math.floor(this.texture.width / frameWidth); - var rows = Math.floor(this.texture.height / frameHeight); - - var i=0; - for (var y=0; y 0) - { - textureLoader.addEventListener('loadedBaseTexture', function(evt){ - if (evt.content.content.loadingCount <= 0) - { - originalLoader.onLoaded(); - } - }); - } - else - { - originalLoader.onLoaded(); - } - }; - // start the loading // - atlasLoader.load(); - } - } - else - { - this.onLoaded(); - } -}; - -/** - * Invoke when json file loaded - * - * @method onLoaded - * @private - */ -PIXI.JsonLoader.prototype.onLoaded = function () { - this.loaded = true; - this.dispatchEvent({ - type: 'loaded', - content: this - }); -}; - -/** - * Invoke when error occured - * - * @method onError - * @private - */ -PIXI.JsonLoader.prototype.onError = function () { - - this.dispatchEvent({ - type: 'error', - content: this - }); -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/loaders/SpineLoader.js b/tutorial-4/pixi.js-master/src/pixi/loaders/SpineLoader.js deleted file mode 100755 index c736c50..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/loaders/SpineLoader.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * based on pixi impact spine implementation made by Eemeli Kelokorpi (@ekelokorpi) https://github.com/ekelokorpi - * - * Awesome JS run time provided by EsotericSoftware - * https://github.com/EsotericSoftware/spine-runtimes - * - */ - -/** - * The Spine loader is used to load in JSON spine data - * To generate the data you need to use http://esotericsoftware.com/ and export in the "JSON" format - * Due to a clash of names You will need to change the extension of the spine file from *.json to *.anim for it to load - * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source - * You will need to generate a sprite sheet to accompany the spine data - * When loaded this class will dispatch a "loaded" event - * - * @class SpineLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.SpineLoader = function(url, crossorigin) -{ - /** - * The url of the bitmap font data - * - * @property url - * @type String - */ - this.url = url; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * [read-only] Whether the data has loaded yet - * - * @property loaded - * @type Boolean - * @readOnly - */ - this.loaded = false; -}; - -PIXI.SpineLoader.prototype.constructor = PIXI.SpineLoader; - -PIXI.EventTarget.mixin(PIXI.SpineLoader.prototype); - -/** - * Loads the JSON data - * - * @method load - */ -PIXI.SpineLoader.prototype.load = function () { - - var scope = this; - var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin); - jsonLoader.on('loaded', function (event) { - scope.json = event.data.content.json; - scope.onLoaded(); - }); - jsonLoader.load(); -}; - -/** - * Invoked when JSON file is loaded. - * - * @method onLoaded - * @private - */ -PIXI.SpineLoader.prototype.onLoaded = function () { - this.loaded = true; - this.emit('loaded', { content: this }); -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/loaders/SpriteSheetLoader.js b/tutorial-4/pixi.js-master/src/pixi/loaders/SpriteSheetLoader.js deleted file mode 100755 index 4d50430..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/loaders/SpriteSheetLoader.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * 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 in 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 a 'texture atlas') as it means sprites 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.fromFrameId() - * This loader will load the image file that the Spritesheet points to as well as the data. - * When loaded this class will dispatch a 'loaded' event - * - * @class SpriteSheetLoader - * @uses EventTarget - * @constructor - * @param url {String} The url of the sprite sheet JSON file - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - */ -PIXI.SpriteSheetLoader = function (url, crossorigin) { - - /** - * The url of the atlas data - * - * @property url - * @type String - */ - this.url = url; - - /** - * Whether the requests should be treated as cross origin - * - * @property crossorigin - * @type Boolean - */ - this.crossorigin = crossorigin; - - /** - * [read-only] The base url of the bitmap font data - * - * @property baseUrl - * @type String - * @readOnly - */ - this.baseUrl = url.replace(/[^\/]*$/, ''); - - /** - * The texture being loaded - * - * @property texture - * @type Texture - */ - this.texture = null; - - /** - * The frames of the sprite sheet - * - * @property frames - * @type Object - */ - this.frames = {}; -}; - -// constructor -PIXI.SpriteSheetLoader.prototype.constructor = PIXI.SpriteSheetLoader; - -PIXI.EventTarget.mixin(PIXI.SpriteSheetLoader.prototype); - -/** - * This will begin loading the JSON file - * - * @method load - */ -PIXI.SpriteSheetLoader.prototype.load = function () { - var scope = this; - var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin); - jsonLoader.on('loaded', function (event) { - scope.json = event.data.content.json; - scope.onLoaded(); - }); - jsonLoader.load(); -}; - -/** - * Invoke when all files are loaded (json and texture) - * - * @method onLoaded - * @private - */ -PIXI.SpriteSheetLoader.prototype.onLoaded = function () { - this.emit('loaded', { - content: this - }); -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/primitives/Graphics.js b/tutorial-4/pixi.js-master/src/pixi/primitives/Graphics.js deleted file mode 100755 index fcfdbb9..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/primitives/Graphics.js +++ /dev/null @@ -1,1140 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The Graphics class contains methods used to draw primitive shapes such as lines, circles and rectangles to the display, and color and fill them. - * - * @class Graphics - * @extends DisplayObjectContainer - * @constructor - */ -PIXI.Graphics = function() -{ - PIXI.DisplayObjectContainer.call( this ); - - this.renderable = true; - - /** - * The alpha value used when filling the Graphics object. - * - * @property fillAlpha - * @type Number - */ - this.fillAlpha = 1; - - /** - * The width (thickness) of any lines drawn. - * - * @property lineWidth - * @type Number - */ - this.lineWidth = 0; - - /** - * The color of any lines drawn. - * - * @property lineColor - * @type String - * @default 0 - */ - this.lineColor = 0; - - /** - * Graphics data - * - * @property graphicsData - * @type Array - * @private - */ - this.graphicsData = []; - - /** - * The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to reset the tint. - * - * @property tint - * @type Number - * @default 0xFFFFFF - */ - this.tint = 0xFFFFFF; - - /** - * The blend mode to be applied to the graphic shape. Apply a value of PIXI.blendModes.NORMAL to reset the blend mode. - * - * @property blendMode - * @type Number - * @default PIXI.blendModes.NORMAL; - */ - this.blendMode = PIXI.blendModes.NORMAL; - - /** - * Current path - * - * @property currentPath - * @type Object - * @private - */ - this.currentPath = null; - - /** - * Array containing some WebGL-related properties used by the WebGL renderer. - * - * @property _webGL - * @type Array - * @private - */ - this._webGL = []; - - /** - * Whether this shape is being used as a mask. - * - * @property isMask - * @type Boolean - */ - this.isMask = false; - - /** - * The bounds' padding used for bounds calculation. - * - * @property boundsPadding - * @type Number - */ - this.boundsPadding = 0; - - this._localBounds = new PIXI.Rectangle(0,0,1,1); - - /** - * Used to detect if the graphics object has changed. If this is set to true then the graphics object will be recalculated. - * - * @property dirty - * @type Boolean - * @private - */ - this.dirty = true; - - /** - * Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated. - * - * @property webGLDirty - * @type Boolean - * @private - */ - this.webGLDirty = false; - - /** - * Used to detect if the cached sprite object needs to be updated. - * - * @property cachedSpriteDirty - * @type Boolean - * @private - */ - this.cachedSpriteDirty = false; - -}; - -// constructor -PIXI.Graphics.prototype = Object.create( PIXI.DisplayObjectContainer.prototype ); -PIXI.Graphics.prototype.constructor = PIXI.Graphics; - -/** - * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. - * This is useful if your graphics element does not change often, as it will speed up the rendering of the object in exchange for taking up texture memory. - * It is also useful if you need the graphics object to be anti-aliased, because it will be rendered using canvas. - * This is not recommended if you are constantly redrawing the graphics element. - * - * @property cacheAsBitmap - * @type Boolean - * @default false - * @private - */ -Object.defineProperty(PIXI.Graphics.prototype, "cacheAsBitmap", { - get: function() { - return this._cacheAsBitmap; - }, - set: function(value) { - this._cacheAsBitmap = value; - - if(this._cacheAsBitmap) - { - - this._generateCachedSprite(); - } - else - { - this.destroyCachedSprite(); - this.dirty = true; - } - - } -}); - -/** - * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method. - * - * @method lineStyle - * @param lineWidth {Number} width of the line to draw, will update the objects stored style - * @param color {Number} color of the line to draw, will update the objects stored style - * @param alpha {Number} alpha of the line to draw, will update the objects stored style - * @return {Graphics} - */ -PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha) -{ - this.lineWidth = lineWidth || 0; - this.lineColor = color || 0; - this.lineAlpha = (arguments.length < 3) ? 1 : alpha; - - if(this.currentPath) - { - if(this.currentPath.shape.points.length) - { - // halfway through a line? start a new one! - this.drawShape( new PIXI.Polygon( this.currentPath.shape.points.slice(-2) )); - return this; - } - - // otherwise its empty so lets just set the line properties - this.currentPath.lineWidth = this.lineWidth; - this.currentPath.lineColor = this.lineColor; - this.currentPath.lineAlpha = this.lineAlpha; - - } - - return this; -}; - -/** - * Moves the current drawing position to x, y. - * - * @method moveTo - * @param x {Number} the X coordinate to move to - * @param y {Number} the Y coordinate to move to - * @return {Graphics} - */ -PIXI.Graphics.prototype.moveTo = function(x, y) -{ - this.drawShape(new PIXI.Polygon([x,y])); - - return this; -}; - -/** - * Draws a line using the current line style from the current drawing position to (x, y); - * The current drawing position is then set to (x, y). - * - * @method lineTo - * @param x {Number} the X coordinate to draw to - * @param y {Number} the Y coordinate to draw to - * @return {Graphics} - */ -PIXI.Graphics.prototype.lineTo = function(x, y) -{ - this.currentPath.shape.points.push(x, y); - this.dirty = true; - - return this; -}; - -/** - * Calculate the points for a quadratic bezier curve and then draws it. - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c - * - * @method quadraticCurveTo - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Graphics} - */ -PIXI.Graphics.prototype.quadraticCurveTo = function(cpX, cpY, toX, toY) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0]; - } - else - { - this.moveTo(0,0); - } - - var xa, - ya, - n = 20, - points = this.currentPath.shape.points; - if(points.length === 0)this.moveTo(0, 0); - - - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - - var j = 0; - for (var i = 1; i <= n; i++ ) - { - j = i / n; - - xa = fromX + ( (cpX - fromX) * j ); - ya = fromY + ( (cpY - fromY) * j ); - - points.push( xa + ( ((cpX + ( (toX - cpX) * j )) - xa) * j ), - ya + ( ((cpY + ( (toY - cpY) * j )) - ya) * j ) ); - } - - - this.dirty = true; - - return this; -}; - -/** - * Calculate the points for a bezier curve and then draws it. - * - * @method bezierCurveTo - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param cpX2 {Number} Second Control point x - * @param cpY2 {Number} Second Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Graphics} - */ -PIXI.Graphics.prototype.bezierCurveTo = function(cpX, cpY, cpX2, cpY2, toX, toY) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0)this.currentPath.shape.points = [0,0]; - } - else - { - this.moveTo(0,0); - } - - var n = 20, - dt, - dt2, - dt3, - t2, - t3, - points = this.currentPath.shape.points; - - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - - var j = 0; - - for (var i=1; i<=n; i++) - { - j = i / n; - - dt = (1 - j); - dt2 = dt * dt; - dt3 = dt2 * dt; - - t2 = j * j; - t3 = t2 * j; - - points.push( dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX, - dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY); - } - - this.dirty = true; - - return this; -}; - -/* - * The arcTo() method creates an arc/curve between two tangents on the canvas. - * - * "borrowed" from https://code.google.com/p/fxcanvas/ - thanks google! - * - * @method arcTo - * @param x1 {Number} The x-coordinate of the beginning of the arc - * @param y1 {Number} The y-coordinate of the beginning of the arc - * @param x2 {Number} The x-coordinate of the end of the arc - * @param y2 {Number} The y-coordinate of the end of the arc - * @param radius {Number} The radius of the arc - * @return {Graphics} - */ -PIXI.Graphics.prototype.arcTo = function(x1, y1, x2, y2, radius) -{ - if( this.currentPath ) - { - if(this.currentPath.shape.points.length === 0) - { - this.currentPath.shape.points.push(x1, y1); - } - } - else - { - this.moveTo(x1, y1); - } - - var points = this.currentPath.shape.points; - var fromX = points[points.length-2]; - var fromY = points[points.length-1]; - var a1 = fromY - y1; - var b1 = fromX - x1; - var a2 = y2 - y1; - var b2 = x2 - x1; - var mm = Math.abs(a1 * b2 - b1 * a2); - - - if (mm < 1.0e-8 || radius === 0) - { - if( points[points.length-2] !== x1 || points[points.length-1] !== y1) - { - //console.log(">>") - points.push(x1, y1); - } - } - else - { - var dd = a1 * a1 + b1 * b1; - var cc = a2 * a2 + b2 * b2; - var tt = a1 * a2 + b1 * b2; - var k1 = radius * Math.sqrt(dd) / mm; - var k2 = radius * Math.sqrt(cc) / mm; - var j1 = k1 * tt / dd; - var j2 = k2 * tt / cc; - var cx = k1 * b2 + k2 * b1; - var cy = k1 * a2 + k2 * a1; - var px = b1 * (k2 + j1); - var py = a1 * (k2 + j1); - var qx = b2 * (k1 + j2); - var qy = a2 * (k1 + j2); - var startAngle = Math.atan2(py - cy, px - cx); - var endAngle = Math.atan2(qy - cy, qx - cx); - - this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1); - } - - this.dirty = true; - - return this; -}; - -/** - * The arc method creates an arc/curve (used to create circles, or parts of circles). - * - * @method arc - * @param cx {Number} The x-coordinate of the center of the circle - * @param cy {Number} The y-coordinate of the center of the circle - * @param radius {Number} The radius of the circle - * @param startAngle {Number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) - * @param endAngle {Number} The ending angle, in radians - * @param anticlockwise {Boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @return {Graphics} - */ -PIXI.Graphics.prototype.arc = function(cx, cy, radius, startAngle, endAngle, anticlockwise) -{ - var startX = cx + Math.cos(startAngle) * radius; - var startY = cy + Math.sin(startAngle) * radius; - var points; - - if( this.currentPath ) - { - points = this.currentPath.shape.points; - - if(points.length === 0) - { - points.push(startX, startY); - } - else if( points[points.length-2] !== startX || points[points.length-1] !== startY) - { - points.push(startX, startY); - } - } - else - { - this.moveTo(startX, startY); - points = this.currentPath.shape.points; - } - - if (startAngle === endAngle)return this; - - if( !anticlockwise && endAngle <= startAngle ) - { - endAngle += Math.PI * 2; - } - else if( anticlockwise && startAngle <= endAngle ) - { - startAngle += Math.PI * 2; - } - - var sweep = anticlockwise ? (startAngle - endAngle) *-1 : (endAngle - startAngle); - var segs = ( Math.abs(sweep)/ (Math.PI * 2) ) * 40; - - if( sweep === 0 ) return this; - - var theta = sweep/(segs*2); - var theta2 = theta*2; - - var cTheta = Math.cos(theta); - var sTheta = Math.sin(theta); - - var segMinus = segs - 1; - - var remainder = ( segMinus % 1 ) / segMinus; - - for(var i=0; i<=segMinus; i++) - { - var real = i + remainder * i; - - - var angle = ((theta) + startAngle + (theta2 * real)); - - var c = Math.cos(angle); - var s = -Math.sin(angle); - - points.push(( (cTheta * c) + (sTheta * s) ) * radius + cx, - ( (cTheta * -s) + (sTheta * c) ) * radius + cy); - } - - this.dirty = true; - - return this; -}; - -/** - * Specifies a simple one-color fill that subsequent calls to other Graphics methods - * (such as lineTo() or drawCircle()) use when drawing. - * - * @method beginFill - * @param color {Number} the color of the fill - * @param alpha {Number} the alpha of the fill - * @return {Graphics} - */ -PIXI.Graphics.prototype.beginFill = function(color, alpha) -{ - this.filling = true; - this.fillColor = color || 0; - this.fillAlpha = (alpha === undefined) ? 1 : alpha; - - if(this.currentPath) - { - if(this.currentPath.shape.points.length <= 2) - { - this.currentPath.fill = this.filling; - this.currentPath.fillColor = this.fillColor; - this.currentPath.fillAlpha = this.fillAlpha; - } - } - return this; -}; - -/** - * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. - * - * @method endFill - * @return {Graphics} - */ -PIXI.Graphics.prototype.endFill = function() -{ - this.filling = false; - this.fillColor = null; - this.fillAlpha = 1; - - return this; -}; - -/** - * Draws a rectangle. - * - * @method drawRect - * - * @param x {Number} The X coord of the top-left of the rectangle - * @param y {Number} The Y coord of the top-left of the rectangle - * @param width {Number} The width of the rectangle - * @param height {Number} The height of the rectangle - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawRect = function( x, y, width, height ) -{ - this.drawShape(new PIXI.Rectangle(x,y, width, height)); - - return this; -}; - -/** - * Draws a rounded rectangle. - * - * @method drawRoundedRect - * - * @param x {Number} The X coord of the top-left of the rectangle - * @param y {Number} The Y coord of the top-left of the rectangle - * @param width {Number} The width of the rectangle - * @param height {Number} The height of the rectangle - * @param radius {Number} Radius of the rectangle corners - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawRoundedRect = function( x, y, width, height, radius ) -{ - this.drawShape(new PIXI.RoundedRectangle(x, y, width, height, radius)); - - return this; -}; - -/** - * Draws a circle. - * - * @method drawCircle - * @param x {Number} The X coordinate of the center of the circle - * @param y {Number} The Y coordinate of the center of the circle - * @param radius {Number} The radius of the circle - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawCircle = function(x, y, radius) -{ - this.drawShape(new PIXI.Circle(x,y, radius)); - - return this; -}; - -/** - * Draws an ellipse. - * - * @method drawEllipse - * @param x {Number} The X coordinate of the center of the ellipse - * @param y {Number} The Y coordinate of the center of the ellipse - * @param width {Number} The half width of the ellipse - * @param height {Number} The half height of the ellipse - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawEllipse = function(x, y, width, height) -{ - this.drawShape(new PIXI.Ellipse(x, y, width, height)); - - return this; -}; - -/** - * Draws a polygon using the given path. - * - * @method drawPolygon - * @param path {Array} The path data used to construct the polygon. - * @return {Graphics} - */ -PIXI.Graphics.prototype.drawPolygon = function(path) -{ - if(!(path instanceof Array))path = Array.prototype.slice.call(arguments); - this.drawShape(new PIXI.Polygon(path)); - return this; -}; - -/** - * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. - * - * @method clear - * @return {Graphics} - */ -PIXI.Graphics.prototype.clear = function() -{ - this.lineWidth = 0; - this.filling = false; - - this.dirty = true; - this.clearDirty = true; - this.graphicsData = []; - - return this; -}; - -/** - * Useful function that returns a texture of the graphics object that can then be used to create sprites - * This can be quite useful if your geometry is complicated and needs to be reused multiple times. - * - * @method generateTexture - * @param resolution {Number} The resolution of the texture being generated - * @param scaleMode {Number} Should be one of the PIXI.scaleMode consts - * @return {Texture} a texture of the graphics object - */ -PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode) -{ - resolution = resolution || 1; - - var bounds = this.getBounds(); - - var canvasBuffer = new PIXI.CanvasBuffer(bounds.width * resolution, bounds.height * resolution); - - var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas, scaleMode); - texture.baseTexture.resolution = resolution; - - canvasBuffer.context.scale(resolution, resolution); - - canvasBuffer.context.translate(-bounds.x,-bounds.y); - - PIXI.CanvasGraphics.renderGraphics(this, canvasBuffer.context); - - return texture; -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Graphics.prototype._renderWebGL = function(renderSession) -{ - // if the sprite is not visible or the alpha is 0 then no need to render this element - if(this.visible === false || this.alpha === 0 || this.isMask === true)return; - - if(this._cacheAsBitmap) - { - - if(this.dirty || this.cachedSpriteDirty) - { - - this._generateCachedSprite(); - - // we will also need to update the texture on the gpu too! - this.updateCachedSpriteTexture(); - - this.cachedSpriteDirty = false; - this.dirty = false; - } - - this._cachedSprite.worldAlpha = this.worldAlpha; - PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession); - - return; - } - else - { - renderSession.spriteBatch.stop(); - renderSession.blendModeManager.setBlendMode(this.blendMode); - - if(this._mask)renderSession.maskManager.pushMask(this._mask, renderSession); - if(this._filters)renderSession.filterManager.pushFilter(this._filterBlock); - - // check blend mode - if(this.blendMode !== renderSession.spriteBatch.currentBlendMode) - { - renderSession.spriteBatch.currentBlendMode = this.blendMode; - var blendModeWebGL = PIXI.blendModesWebGL[renderSession.spriteBatch.currentBlendMode]; - renderSession.spriteBatch.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); - } - - // check if the webgl graphic needs to be updated - if(this.webGLDirty) - { - this.dirty = true; - this.webGLDirty = false; - } - - PIXI.WebGLGraphics.renderGraphics(this, renderSession); - - // only render if it has children! - if(this.children.length) - { - renderSession.spriteBatch.start(); - - // simple render children! - for(var i=0, j=this.children.length; i maxX ? x2 : maxX; - maxX = x3 > maxX ? x3 : maxX; - maxX = x4 > maxX ? x4 : maxX; - - maxY = y2 > maxY ? y2 : maxY; - maxY = y3 > maxY ? y3 : maxY; - maxY = y4 > maxY ? y4 : maxY; - - this._bounds.x = minX; - this._bounds.width = maxX - minX; - - this._bounds.y = minY; - this._bounds.height = maxY - minY; - - return this._bounds; -}; - -/** - * Update the bounds of the object - * - * @method updateLocalBounds - */ -PIXI.Graphics.prototype.updateLocalBounds = function() -{ - var minX = Infinity; - var maxX = -Infinity; - - var minY = Infinity; - var maxY = -Infinity; - - if(this.graphicsData.length) - { - var shape, points, x, y, w, h; - - for (var i = 0; i < this.graphicsData.length; i++) { - var data = this.graphicsData[i]; - var type = data.type; - var lineWidth = data.lineWidth; - shape = data.shape; - - - if(type === PIXI.Graphics.RECT || type === PIXI.Graphics.RREC) - { - x = shape.x - lineWidth/2; - y = shape.y - lineWidth/2; - w = shape.width + lineWidth; - h = shape.height + lineWidth; - - minX = x < minX ? x : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y < minY ? y : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else if(type === PIXI.Graphics.CIRC) - { - x = shape.x; - y = shape.y; - w = shape.radius + lineWidth/2; - h = shape.radius + lineWidth/2; - - minX = x - w < minX ? x - w : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y - h < minY ? y - h : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else if(type === PIXI.Graphics.ELIP) - { - x = shape.x; - y = shape.y; - w = shape.width + lineWidth/2; - h = shape.height + lineWidth/2; - - minX = x - w < minX ? x - w : minX; - maxX = x + w > maxX ? x + w : maxX; - - minY = y - h < minY ? y - h : minY; - maxY = y + h > maxY ? y + h : maxY; - } - else - { - // POLY - points = shape.points; - - for (var j = 0; j < points.length; j+=2) - { - - x = points[j]; - y = points[j+1]; - minX = x-lineWidth < minX ? x-lineWidth : minX; - maxX = x+lineWidth > maxX ? x+lineWidth : maxX; - - minY = y-lineWidth < minY ? y-lineWidth : minY; - maxY = y+lineWidth > maxY ? y+lineWidth : maxY; - } - } - } - } - else - { - minX = 0; - maxX = 0; - minY = 0; - maxY = 0; - } - - var padding = this.boundsPadding; - - this._localBounds.x = minX - padding; - this._localBounds.width = (maxX - minX) + padding * 2; - - this._localBounds.y = minY - padding; - this._localBounds.height = (maxY - minY) + padding * 2; -}; - -/** - * Generates the cached sprite when the sprite has cacheAsBitmap = true - * - * @method _generateCachedSprite - * @private - */ -PIXI.Graphics.prototype._generateCachedSprite = function() -{ - var bounds = this.getLocalBounds(); - - if(!this._cachedSprite) - { - var canvasBuffer = new PIXI.CanvasBuffer(bounds.width, bounds.height); - var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); - - this._cachedSprite = new PIXI.Sprite(texture); - this._cachedSprite.buffer = canvasBuffer; - - this._cachedSprite.worldTransform = this.worldTransform; - } - else - { - this._cachedSprite.buffer.resize(bounds.width, bounds.height); - } - - // leverage the anchor to account for the offset of the element - this._cachedSprite.anchor.x = -( bounds.x / bounds.width ); - this._cachedSprite.anchor.y = -( bounds.y / bounds.height ); - - // this._cachedSprite.buffer.context.save(); - this._cachedSprite.buffer.context.translate(-bounds.x,-bounds.y); - - // make sure we set the alpha of the graphics to 1 for the render.. - this.worldAlpha = 1; - - // now render the graphic.. - PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context); - this._cachedSprite.alpha = this.alpha; -}; - -/** - * Updates texture size based on canvas size - * - * @method updateCachedSpriteTexture - * @private - */ -PIXI.Graphics.prototype.updateCachedSpriteTexture = function() -{ - var cachedSprite = this._cachedSprite; - var texture = cachedSprite.texture; - var canvas = cachedSprite.buffer.canvas; - - texture.baseTexture.width = canvas.width; - texture.baseTexture.height = canvas.height; - texture.crop.width = texture.frame.width = canvas.width; - texture.crop.height = texture.frame.height = canvas.height; - - cachedSprite._width = canvas.width; - cachedSprite._height = canvas.height; - - // update the dirty base textures - texture.baseTexture.dirty(); -}; - -/** - * Destroys a previous cached sprite. - * - * @method destroyCachedSprite - */ -PIXI.Graphics.prototype.destroyCachedSprite = function() -{ - this._cachedSprite.texture.destroy(true); - - // let the gc collect the unused sprite - // TODO could be object pooled! - this._cachedSprite = null; -}; - -/** - * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. - * - * @method drawShape - * @param {Circle|Rectangle|Ellipse|Line|Polygon} shape The Shape object to draw. - * @return {GraphicsData} The generated GraphicsData object. - */ -PIXI.Graphics.prototype.drawShape = function(shape) -{ - if(this.currentPath) - { - // check current path! - if(this.currentPath.shape.points.length <= 2)this.graphicsData.pop(); - } - - this.currentPath = null; - - var data = new PIXI.GraphicsData(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, shape); - - this.graphicsData.push(data); - - if(data.type === PIXI.Graphics.POLY) - { - data.shape.closed = this.filling; - this.currentPath = data; - } - - this.dirty = true; - - return data; -}; - -/** - * A GraphicsData object. - * - * @class GraphicsData - * @constructor - */ -PIXI.GraphicsData = function(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, shape) -{ - this.lineWidth = lineWidth; - this.lineColor = lineColor; - this.lineAlpha = lineAlpha; - this._lineTint = lineColor; - - this.fillColor = fillColor; - this.fillAlpha = fillAlpha; - this._fillTint = fillColor; - this.fill = fill; - - this.shape = shape; - this.type = shape.type; -}; - -// SOME TYPES: -PIXI.Graphics.POLY = 0; -PIXI.Graphics.RECT = 1; -PIXI.Graphics.CIRC = 2; -PIXI.Graphics.ELIP = 3; -PIXI.Graphics.RREC = 4; - -PIXI.Polygon.prototype.type = PIXI.Graphics.POLY; -PIXI.Rectangle.prototype.type = PIXI.Graphics.RECT; -PIXI.Circle.prototype.type = PIXI.Graphics.CIRC; -PIXI.Ellipse.prototype.type = PIXI.Graphics.ELIP; -PIXI.RoundedRectangle.prototype.type = PIXI.Graphics.RREC; - diff --git a/tutorial-4/pixi.js-master/src/pixi/renderers/canvas/CanvasGraphics.js b/tutorial-4/pixi.js-master/src/pixi/renderers/canvas/CanvasGraphics.js deleted file mode 100755 index 1fb5372..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/renderers/canvas/CanvasGraphics.js +++ /dev/null @@ -1,358 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - - -/** - * A set of functions used by the canvas renderer to draw the primitive graphics data. - * - * @class CanvasGraphics - * @static - */ -PIXI.CanvasGraphics = function() -{ -}; - -/* - * Renders a PIXI.Graphics object to a canvas. - * - * @method renderGraphics - * @static - * @param graphics {Graphics} the actual graphics object to render - * @param context {CanvasRenderingContext2D} the 2d drawing method of the canvas - */ -PIXI.CanvasGraphics.renderGraphics = function(graphics, context) -{ - var worldAlpha = graphics.worldAlpha; - - if(graphics.dirty) - { - this.updateGraphicsTint(graphics); - graphics.dirty = false; - } - - - for (var i = 0; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - var shape = data.shape; - - var fillColor = data._fillTint; - var lineColor = data._lineTint; - - context.lineWidth = data.lineWidth; - - if(data.type === PIXI.Graphics.POLY) - { - context.beginPath(); - - var points = shape.points; - - context.moveTo(points[0], points[1]); - - for (var j=1; j < points.length/2; j++) - { - context.lineTo(points[j * 2], points[j * 2 + 1]); - } - - if(shape.closed) - { - context.lineTo(points[0], points[1]); - } - - // if the first and last point are the same close the path - much neater :) - if(points[0] === points[points.length-2] && points[1] === points[points.length-1]) - { - context.closePath(); - } - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if(data.type === PIXI.Graphics.RECT) - { - - if(data.fillColor || data.fillColor === 0) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fillRect(shape.x, shape.y, shape.width, shape.height); - - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.strokeRect(shape.x, shape.y, shape.width, shape.height); - } - } - else if(data.type === PIXI.Graphics.CIRC) - { - // TODO - need to be Undefined! - context.beginPath(); - context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI); - context.closePath(); - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if(data.type === PIXI.Graphics.ELIP) - { - // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas - - var w = shape.width * 2; - var h = shape.height * 2; - - var x = shape.x - w/2; - var y = shape.y - h/2; - - context.beginPath(); - - var kappa = 0.5522848, - ox = (w / 2) * kappa, // control point offset horizontal - oy = (h / 2) * kappa, // control point offset vertical - xe = x + w, // x-end - ye = y + h, // y-end - xm = x + w / 2, // x-middle - ym = y + h / 2; // y-middle - - context.moveTo(x, ym); - context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); - context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); - context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); - context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); - - context.closePath(); - - if(data.fill) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - else if (data.type === PIXI.Graphics.RREC) - { - var rx = shape.x; - var ry = shape.y; - var width = shape.width; - var height = shape.height; - var radius = shape.radius; - - var maxRadius = Math.min(width, height) / 2 | 0; - radius = radius > maxRadius ? maxRadius : radius; - - context.beginPath(); - context.moveTo(rx, ry + radius); - context.lineTo(rx, ry + height - radius); - context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height); - context.lineTo(rx + width - radius, ry + height); - context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius); - context.lineTo(rx + width, ry + radius); - context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry); - context.lineTo(rx + radius, ry); - context.quadraticCurveTo(rx, ry, rx, ry + radius); - context.closePath(); - - if(data.fillColor || data.fillColor === 0) - { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.fill(); - - } - if(data.lineWidth) - { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + ( lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - } -}; - -/* - * Renders a graphics mask - * - * @static - * @private - * @method renderGraphicsMask - * @param graphics {Graphics} the graphics which will be used as a mask - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas - */ -PIXI.CanvasGraphics.renderGraphicsMask = function(graphics, context) -{ - var len = graphics.graphicsData.length; - - if(len === 0) return; - - if(len > 1) - { - len = 1; - window.console.log('Pixi.js warning: masks in canvas can only mask using the first path in the graphics object'); - } - - for (var i = 0; i < 1; i++) - { - var data = graphics.graphicsData[i]; - var shape = data.shape; - - if(data.type === PIXI.Graphics.POLY) - { - context.beginPath(); - - var points = shape.points; - - context.moveTo(points[0], points[1]); - - for (var j=1; j < points.length/2; j++) - { - context.lineTo(points[j * 2], points[j * 2 + 1]); - } - - // if the first and last point are the same close the path - much neater :) - if(points[0] === points[points.length-2] && points[1] === points[points.length-1]) - { - context.closePath(); - } - - } - else if(data.type === PIXI.Graphics.RECT) - { - context.beginPath(); - context.rect(shape.x, shape.y, shape.width, shape.height); - context.closePath(); - } - else if(data.type === PIXI.Graphics.CIRC) - { - // TODO - need to be Undefined! - context.beginPath(); - context.arc(shape.x, shape.y, shape.radius,0,2*Math.PI); - context.closePath(); - } - else if(data.type === PIXI.Graphics.ELIP) - { - - // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas - - var w = shape.width * 2; - var h = shape.height * 2; - - var x = shape.x - w/2; - var y = shape.y - h/2; - - context.beginPath(); - - var kappa = 0.5522848, - ox = (w / 2) * kappa, // control point offset horizontal - oy = (h / 2) * kappa, // control point offset vertical - xe = x + w, // x-end - ye = y + h, // y-end - xm = x + w / 2, // x-middle - ym = y + h / 2; // y-middle - - context.moveTo(x, ym); - context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); - context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); - context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); - context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); - context.closePath(); - } - else if (data.type === PIXI.Graphics.RREC) - { - - var pts = shape.points; - var rx = pts[0]; - var ry = pts[1]; - var width = pts[2]; - var height = pts[3]; - var radius = pts[4]; - - var maxRadius = Math.min(width, height) / 2 | 0; - radius = radius > maxRadius ? maxRadius : radius; - - context.beginPath(); - context.moveTo(rx, ry + radius); - context.lineTo(rx, ry + height - radius); - context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height); - context.lineTo(rx + width - radius, ry + height); - context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius); - context.lineTo(rx + width, ry + radius); - context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry); - context.lineTo(rx + radius, ry); - context.quadraticCurveTo(rx, ry, rx, ry + radius); - context.closePath(); - } - } -}; - -PIXI.CanvasGraphics.updateGraphicsTint = function(graphics) -{ - if(graphics.tint === 0xFFFFFF)return; - - var tintR = (graphics.tint >> 16 & 0xFF) / 255; - var tintG = (graphics.tint >> 8 & 0xFF) / 255; - var tintB = (graphics.tint & 0xFF)/ 255; - - for (var i = 0; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - - var fillColor = data.fillColor | 0; - var lineColor = data.lineColor | 0; - - /* - var colorR = (fillColor >> 16 & 0xFF) / 255; - var colorG = (fillColor >> 8 & 0xFF) / 255; - var colorB = (fillColor & 0xFF) / 255; - - colorR *= tintR; - colorG *= tintG; - colorB *= tintB; - - fillColor = ((colorR*255 << 16) + (colorG*255 << 8) + colorB*255); - - colorR = (lineColor >> 16 & 0xFF) / 255; - colorG = (lineColor >> 8 & 0xFF) / 255; - colorB = (lineColor & 0xFF) / 255; - - colorR *= tintR; - colorG *= tintG; - colorB *= tintB; - - lineColor = ((colorR*255 << 16) + (colorG*255 << 8) + colorB*255); - */ - - // super inline cos im an optimization NAZI :) - data._fillTint = (((fillColor >> 16 & 0xFF) / 255 * tintR*255 << 16) + ((fillColor >> 8 & 0xFF) / 255 * tintG*255 << 8) + (fillColor & 0xFF) / 255 * tintB*255); - data._lineTint = (((lineColor >> 16 & 0xFF) / 255 * tintR*255 << 16) + ((lineColor >> 8 & 0xFF) / 255 * tintG*255 << 8) + (lineColor & 0xFF) / 255 * tintB*255); - - } -}; - diff --git a/tutorial-4/pixi.js-master/src/pixi/renderers/canvas/CanvasRenderer.js b/tutorial-4/pixi.js-master/src/pixi/renderers/canvas/CanvasRenderer.js deleted file mode 100755 index 86a12f9..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/renderers/canvas/CanvasRenderer.js +++ /dev/null @@ -1,345 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * The CanvasRenderer draws the Stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. - * Don't forget to add the CanvasRenderer.view to your DOM or you will not see anything :) - * - * @class CanvasRenderer - * @constructor - * @param [width=800] {Number} the width of the canvas view - * @param [height=600] {Number} the height of the canvas view - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * @param [options.clearBeforeRender=true] {Boolean} This sets if the CanvasRenderer will clear the canvas or not before the new render pass. - */ -PIXI.CanvasRenderer = function(width, height, options) -{ - if(options) - { - for (var i in PIXI.defaultRenderOptions) - { - if (typeof options[i] === "undefined") options[i] = PIXI.defaultRenderOptions[i]; - } - } - else - { - options = PIXI.defaultRenderOptions; - } - - if(!PIXI.defaultRenderer) - { - PIXI.sayHello("Canvas"); - PIXI.defaultRenderer = this; - } - - /** - * The renderer type. - * - * @property type - * @type Number - */ - this.type = PIXI.CANVAS_RENDERER; - - /** - * The resolution of the canvas. - * - * @property resolution - * @type Number - */ - this.resolution = options.resolution; - - /** - * This sets if the CanvasRenderer will clear the canvas or not before the new render pass. - * If the Stage is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color. - * If the Stage is transparent Pixi will use clearRect to clear the canvas every frame. - * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set. - * - * @property clearBeforeRender - * @type Boolean - * @default - */ - this.clearBeforeRender = options.clearBeforeRender; - - /** - * Whether the render view is transparent - * - * @property transparent - * @type Boolean - */ - this.transparent = options.transparent; - - /** - * Whether the render view should be resized automatically - * - * @property autoResize - * @type Boolean - */ - this.autoResize = options.autoResize || false; - - - /** - * The width of the canvas view - * - * @property width - * @type Number - * @default 800 - */ - this.width = width || 800; - - /** - * The height of the canvas view - * - * @property height - * @type Number - * @default 600 - */ - this.height = height || 600; - - this.width *= this.resolution; - this.height *= this.resolution; - - /** - * The canvas element that everything is drawn to. - * - * @property view - * @type HTMLCanvasElement - */ - this.view = options.view || document.createElement( "canvas" ); - - /** - * The canvas 2d context that everything is drawn with - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.view.getContext( "2d", { alpha: this.transparent } ); - - /** - * Boolean flag controlling canvas refresh. - * - * @property refresh - * @type Boolean - */ - this.refresh = true; - - this.view.width = this.width * this.resolution; - this.view.height = this.height * this.resolution; - - /** - * Internal var. - * - * @property count - * @type Number - */ - this.count = 0; - - /** - * Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer - * @property maskManager - * @type CanvasMaskManager - */ - this.maskManager = new PIXI.CanvasMaskManager(); - - /** - * The render session is just a bunch of parameter used for rendering - * @property renderSession - * @type Object - */ - this.renderSession = { - context: this.context, - maskManager: this.maskManager, - scaleMode: null, - smoothProperty: null, - /** - * If true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation. - * Handy for crisp pixel art and speed on legacy devices. - * - */ - roundPixels: false - }; - - this.mapBlendModes(); - - this.resize(width, height); - - if("imageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "imageSmoothingEnabled"; - else if("webkitImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "webkitImageSmoothingEnabled"; - else if("mozImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "mozImageSmoothingEnabled"; - else if("oImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "oImageSmoothingEnabled"; - else if ("msImageSmoothingEnabled" in this.context) - this.renderSession.smoothProperty = "msImageSmoothingEnabled"; -}; - -// constructor -PIXI.CanvasRenderer.prototype.constructor = PIXI.CanvasRenderer; - -/** - * Renders the Stage to this canvas view - * - * @method render - * @param stage {Stage} the Stage element to be rendered - */ -PIXI.CanvasRenderer.prototype.render = function(stage) -{ - stage.updateTransform(); - - this.context.setTransform(1,0,0,1,0,0); - - this.context.globalAlpha = 1; - - this.renderSession.currentBlendMode = PIXI.blendModes.NORMAL; - this.context.globalCompositeOperation = PIXI.blendModesCanvas[PIXI.blendModes.NORMAL]; - - if (navigator.isCocoonJS && this.view.screencanvas) { - this.context.fillStyle = "black"; - this.context.clear(); - } - - if (this.clearBeforeRender) - { - if (this.transparent) - { - this.context.clearRect(0, 0, this.width, this.height); - } - else - { - this.context.fillStyle = stage.backgroundColorString; - this.context.fillRect(0, 0, this.width , this.height); - } - } - - this.renderDisplayObject(stage); - - // run interaction! - if(stage.interactive) - { - //need to add some events! - if(!stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = true; - stage.interactionManager.setTarget(this); - } - } -}; - -/** - * Removes everything from the renderer and optionally removes the Canvas DOM element. - * - * @method destroy - * @param [removeView=true] {boolean} Removes the Canvas element from the DOM. - */ -PIXI.CanvasRenderer.prototype.destroy = function(removeView) -{ - if (typeof removeView === "undefined") { removeView = true; } - - if (removeView && this.view.parent) - { - this.view.parent.removeChild(this.view); - } - - this.view = null; - this.context = null; - this.maskManager = null; - this.renderSession = null; - -}; - -/** - * Resizes the canvas view to the specified width and height - * - * @method resize - * @param width {Number} the new width of the canvas view - * @param height {Number} the new height of the canvas view - */ -PIXI.CanvasRenderer.prototype.resize = function(width, height) -{ - this.width = width * this.resolution; - this.height = height * this.resolution; - - this.view.width = this.width; - this.view.height = this.height; - - if (this.autoResize) { - this.view.style.width = this.width / this.resolution + "px"; - this.view.style.height = this.height / this.resolution + "px"; - } -}; - -/** - * Renders a display object - * - * @method renderDisplayObject - * @param displayObject {DisplayObject} The displayObject to render - * @param context {CanvasRenderingContext2D} the context 2d method of the canvas - * @private - */ -PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject, context) -{ - this.renderSession.context = context || this.context; - this.renderSession.resolution = this.resolution; - displayObject._renderCanvas(this.renderSession); -}; - -/** - * Maps Pixi blend modes to canvas blend modes. - * - * @method mapBlendModes - * @private - */ -PIXI.CanvasRenderer.prototype.mapBlendModes = function() -{ - if(!PIXI.blendModesCanvas) - { - PIXI.blendModesCanvas = []; - - if(PIXI.canUseNewCanvasBlendModes()) - { - PIXI.blendModesCanvas[PIXI.blendModes.NORMAL] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.ADD] = "lighter"; //IS THIS OK??? - PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "multiply"; - PIXI.blendModesCanvas[PIXI.blendModes.SCREEN] = "screen"; - PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY] = "overlay"; - PIXI.blendModesCanvas[PIXI.blendModes.DARKEN] = "darken"; - PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN] = "lighten"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "color-dodge"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "color-burn"; - PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "hard-light"; - PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "soft-light"; - PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "difference"; - PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "exclusion"; - PIXI.blendModesCanvas[PIXI.blendModes.HUE] = "hue"; - PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "saturation"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR] = "color"; - PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "luminosity"; - } - else - { - // this means that the browser does not support the cool new blend modes in canvas "cough" ie "cough" - PIXI.blendModesCanvas[PIXI.blendModes.NORMAL] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.ADD] = "lighter"; //IS THIS OK??? - PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SCREEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.DARKEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.HUE] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.COLOR] = "source-over"; - PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "source-over"; - } - } -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasBuffer.js b/tutorial-4/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasBuffer.js deleted file mode 100755 index b53d851..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasBuffer.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Creates a Canvas element of the given size. - * - * @class CanvasBuffer - * @constructor - * @param width {Number} the width for the newly created canvas - * @param height {Number} the height for the newly created canvas - */ -PIXI.CanvasBuffer = function(width, height) -{ - /** - * The width of the Canvas in pixels. - * - * @property width - * @type Number - */ - this.width = width; - - /** - * The height of the Canvas in pixels. - * - * @property height - * @type Number - */ - this.height = height; - - /** - * The Canvas object that belongs to this CanvasBuffer. - * - * @property canvas - * @type HTMLCanvasElement - */ - this.canvas = document.createElement("canvas"); - - /** - * A CanvasRenderingContext2D object representing a two-dimensional rendering context. - * - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.canvas.getContext("2d"); - - this.canvas.width = width; - this.canvas.height = height; -}; - -PIXI.CanvasBuffer.prototype.constructor = PIXI.CanvasBuffer; - -/** - * Clears the canvas that was created by the CanvasBuffer class. - * - * @method clear - * @private - */ -PIXI.CanvasBuffer.prototype.clear = function() -{ - this.context.setTransform(1, 0, 0, 1, 0, 0); - this.context.clearRect(0,0, this.width, this.height); -}; - -/** - * Resizes the canvas to the specified width and height. - * - * @method resize - * @param width {Number} the new width of the canvas - * @param height {Number} the new height of the canvas - */ -PIXI.CanvasBuffer.prototype.resize = function(width, height) -{ - this.width = this.canvas.width = width; - this.height = this.canvas.height = height; -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasMaskManager.js b/tutorial-4/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasMaskManager.js deleted file mode 100755 index 748adda..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasMaskManager.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A set of functions used to handle masking. - * - * @class CanvasMaskManager - * @constructor - */ -PIXI.CanvasMaskManager = function() -{ -}; - -PIXI.CanvasMaskManager.prototype.constructor = PIXI.CanvasMaskManager; - -/** - * This method adds it to the current stack of masks. - * - * @method pushMask - * @param maskData {Object} the maskData that will be pushed - * @param renderSession {Object} The renderSession whose context will be used for this mask manager. - */ -PIXI.CanvasMaskManager.prototype.pushMask = function(maskData, renderSession) -{ - var context = renderSession.context; - - context.save(); - - var cacheAlpha = maskData.alpha; - var transform = maskData.worldTransform; - - var resolution = renderSession.resolution; - - context.setTransform(transform.a * resolution, - transform.b * resolution, - transform.c * resolution, - transform.d * resolution, - transform.tx * resolution, - transform.ty * resolution); - - PIXI.CanvasGraphics.renderGraphicsMask(maskData, context); - - context.clip(); - - maskData.worldAlpha = cacheAlpha; -}; - -/** - * Restores the current drawing context to the state it was before the mask was applied. - * - * @method popMask - * @param renderSession {Object} The renderSession whose context will be used for this mask manager. - */ -PIXI.CanvasMaskManager.prototype.popMask = function(renderSession) -{ - renderSession.context.restore(); -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasTinter.js b/tutorial-4/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasTinter.js deleted file mode 100755 index dd50b06..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/renderers/canvas/utils/CanvasTinter.js +++ /dev/null @@ -1,242 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * Utility methods for Sprite/Texture tinting. - * - * @class CanvasTinter - * @static - */ -PIXI.CanvasTinter = function() -{ -}; - -/** - * Basically this method just needs a sprite and a color and tints the sprite with the given color. - * - * @method getTintedTexture - * @static - * @param sprite {Sprite} the sprite to tint - * @param color {Number} the color to use to tint the sprite with - * @return {HTMLCanvasElement} The tinted canvas - */ -PIXI.CanvasTinter.getTintedTexture = function(sprite, color) -{ - var texture = sprite.texture; - - color = PIXI.CanvasTinter.roundColor(color); - - var stringColor = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - - texture.tintCache = texture.tintCache || {}; - - if(texture.tintCache[stringColor]) return texture.tintCache[stringColor]; - - // clone texture.. - var canvas = PIXI.CanvasTinter.canvas || document.createElement("canvas"); - - //PIXI.CanvasTinter.tintWithPerPixel(texture, stringColor, canvas); - PIXI.CanvasTinter.tintMethod(texture, color, canvas); - - if(PIXI.CanvasTinter.convertTintToImage) - { - // is this better? - var tintImage = new Image(); - tintImage.src = canvas.toDataURL(); - - texture.tintCache[stringColor] = tintImage; - } - else - { - texture.tintCache[stringColor] = canvas; - // if we are not converting the texture to an image then we need to lose the reference to the canvas - PIXI.CanvasTinter.canvas = null; - } - - return canvas; -}; - -/** - * Tint a texture using the "multiply" operation. - * - * @method tintWithMultiply - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithMultiply = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - - context.fillRect(0, 0, crop.width, crop.height); - - context.globalCompositeOperation = "multiply"; - - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - context.globalCompositeOperation = "destination-atop"; - - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); -}; - -/** - * Tint a texture using the "overlay" operation. - * - * @method tintWithOverlay - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithOverlay = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.globalCompositeOperation = "copy"; - context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - context.fillRect(0, 0, crop.width, crop.height); - - context.globalCompositeOperation = "destination-atop"; - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - //context.globalCompositeOperation = "copy"; -}; - -/** - * Tint a texture pixel per pixel. - * - * @method tintPerPixel - * @static - * @param texture {Texture} the texture to tint - * @param color {Number} the color to use to tint the sprite with - * @param canvas {HTMLCanvasElement} the current canvas - */ -PIXI.CanvasTinter.tintWithPerPixel = function(texture, color, canvas) -{ - var context = canvas.getContext( "2d" ); - - var crop = texture.crop; - - canvas.width = crop.width; - canvas.height = crop.height; - - context.globalCompositeOperation = "copy"; - context.drawImage(texture.baseTexture.source, - crop.x, - crop.y, - crop.width, - crop.height, - 0, - 0, - crop.width, - crop.height); - - var rgbValues = PIXI.hex2rgb(color); - var r = rgbValues[0], g = rgbValues[1], b = rgbValues[2]; - - var pixelData = context.getImageData(0, 0, crop.width, crop.height); - - var pixels = pixelData.data; - - for (var i = 0; i < pixels.length; i += 4) - { - pixels[i+0] *= r; - pixels[i+1] *= g; - pixels[i+2] *= b; - } - - context.putImageData(pixelData, 0, 0); -}; - -/** - * Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel. - * - * @method roundColor - * @static - * @param color {number} the color to round, should be a hex color - */ -PIXI.CanvasTinter.roundColor = function(color) -{ - var step = PIXI.CanvasTinter.cacheStepsPerColorChannel; - - var rgbValues = PIXI.hex2rgb(color); - - rgbValues[0] = Math.min(255, (rgbValues[0] / step) * step); - rgbValues[1] = Math.min(255, (rgbValues[1] / step) * step); - rgbValues[2] = Math.min(255, (rgbValues[2] / step) * step); - - return PIXI.rgb2hex(rgbValues); -}; - -/** - * Number of steps which will be used as a cap when rounding colors. - * - * @property cacheStepsPerColorChannel - * @type Number - * @static - */ -PIXI.CanvasTinter.cacheStepsPerColorChannel = 8; - -/** - * Tint cache boolean flag. - * - * @property convertTintToImage - * @type Boolean - * @static - */ -PIXI.CanvasTinter.convertTintToImage = false; - -/** - * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. - * - * @property canUseMultiply - * @type Boolean - * @static - */ -PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes(); - -/** - * The tinting method that will be used. - * - * @method tintMethod - * @static - */ -PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel; diff --git a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/WebGLRenderer.js b/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/WebGLRenderer.js deleted file mode 100755 index 02b30e4..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/WebGLRenderer.js +++ /dev/null @@ -1,554 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -PIXI.glContexts = []; // this is where we store the webGL contexts for easy access. -PIXI.instances = []; - -/** - * The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer - * should be used for browsers that support webGL. This Render works by automatically managing webGLBatchs. - * So no need for Sprite Batches or Sprite Clouds. - * Don't forget to add the view to your DOM or you will not see anything :) - * - * @class WebGLRenderer - * @constructor - * @param [width=0] {Number} the width of the canvas view - * @param [height=0] {Number} the height of the canvas view - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.autoResize=false] {Boolean} If the render view is automatically resized, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - */ -PIXI.WebGLRenderer = function(width, height, options) -{ - if(options) - { - for (var i in PIXI.defaultRenderOptions) - { - if (typeof options[i] === 'undefined') options[i] = PIXI.defaultRenderOptions[i]; - } - } - else - { - options = PIXI.defaultRenderOptions; - } - - if(!PIXI.defaultRenderer) - { - PIXI.sayHello('webGL'); - PIXI.defaultRenderer = this; - } - - /** - * @property type - * @type Number - */ - this.type = PIXI.WEBGL_RENDERER; - - /** - * The resolution of the renderer - * - * @property resolution - * @type Number - * @default 1 - */ - this.resolution = options.resolution; - - // do a catch.. only 1 webGL renderer.. - - /** - * Whether the render view is transparent - * - * @property transparent - * @type Boolean - */ - this.transparent = options.transparent; - - /** - * Whether the render view should be resized automatically - * - * @property autoResize - * @type Boolean - */ - this.autoResize = options.autoResize || false; - - /** - * The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering. - * - * @property preserveDrawingBuffer - * @type Boolean - */ - this.preserveDrawingBuffer = options.preserveDrawingBuffer; - - /** - * This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true: - * If the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0). - * If the Stage is transparent, Pixi will clear to the target Stage's background color. - * Disable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set. - * - * @property clearBeforeRender - * @type Boolean - * @default - */ - this.clearBeforeRender = options.clearBeforeRender; - - /** - * The width of the canvas view - * - * @property width - * @type Number - * @default 800 - */ - this.width = width || 800; - - /** - * The height of the canvas view - * - * @property height - * @type Number - * @default 600 - */ - this.height = height || 600; - - /** - * The canvas element that everything is drawn to - * - * @property view - * @type HTMLCanvasElement - */ - this.view = options.view || document.createElement( 'canvas' ); - - // deal with losing context.. - - /** - * @property contextLostBound - * @type Function - */ - this.contextLostBound = this.handleContextLost.bind(this); - - /** - * @property contextRestoredBound - * @type Function - */ - this.contextRestoredBound = this.handleContextRestored.bind(this); - - this.view.addEventListener('webglcontextlost', this.contextLostBound, false); - this.view.addEventListener('webglcontextrestored', this.contextRestoredBound, false); - - /** - * @property _contextOptions - * @type Object - * @private - */ - this._contextOptions = { - alpha: this.transparent, - antialias: options.antialias, // SPEED UP?? - premultipliedAlpha:this.transparent && this.transparent !== 'notMultiplied', - stencil:true, - preserveDrawingBuffer: options.preserveDrawingBuffer - }; - - /** - * @property projection - * @type Point - */ - this.projection = new PIXI.Point(); - - /** - * @property offset - * @type Point - */ - this.offset = new PIXI.Point(0, 0); - - // time to create the render managers! each one focuses on managing a state in webGL - - /** - * Deals with managing the shader programs and their attribs - * @property shaderManager - * @type WebGLShaderManager - */ - this.shaderManager = new PIXI.WebGLShaderManager(); - - /** - * Manages the rendering of sprites - * @property spriteBatch - * @type WebGLSpriteBatch - */ - this.spriteBatch = new PIXI.WebGLSpriteBatch(); - - /** - * Manages the masks using the stencil buffer - * @property maskManager - * @type WebGLMaskManager - */ - this.maskManager = new PIXI.WebGLMaskManager(); - - /** - * Manages the filters - * @property filterManager - * @type WebGLFilterManager - */ - this.filterManager = new PIXI.WebGLFilterManager(); - - /** - * Manages the stencil buffer - * @property stencilManager - * @type WebGLStencilManager - */ - this.stencilManager = new PIXI.WebGLStencilManager(); - - /** - * Manages the blendModes - * @property blendModeManager - * @type WebGLBlendModeManager - */ - this.blendModeManager = new PIXI.WebGLBlendModeManager(); - - /** - * TODO remove - * @property renderSession - * @type Object - */ - this.renderSession = {}; - this.renderSession.gl = this.gl; - this.renderSession.drawCount = 0; - this.renderSession.shaderManager = this.shaderManager; - this.renderSession.maskManager = this.maskManager; - this.renderSession.filterManager = this.filterManager; - this.renderSession.blendModeManager = this.blendModeManager; - this.renderSession.spriteBatch = this.spriteBatch; - this.renderSession.stencilManager = this.stencilManager; - this.renderSession.renderer = this; - this.renderSession.resolution = this.resolution; - - // time init the context.. - this.initContext(); - - // map some webGL blend modes.. - this.mapBlendModes(); -}; - -// constructor -PIXI.WebGLRenderer.prototype.constructor = PIXI.WebGLRenderer; - -/** -* @method initContext -*/ -PIXI.WebGLRenderer.prototype.initContext = function() -{ - var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); - this.gl = gl; - - if (!gl) { - // fail, not able to get a context - throw new Error('This browser does not support webGL. Try using the canvas renderer'); - } - - this.glContextId = gl.id = PIXI.WebGLRenderer.glContextId ++; - - PIXI.glContexts[this.glContextId] = gl; - - PIXI.instances[this.glContextId] = this; - - // set up the default pixi settings.. - gl.disable(gl.DEPTH_TEST); - gl.disable(gl.CULL_FACE); - gl.enable(gl.BLEND); - - // need to set the context for all the managers... - this.shaderManager.setContext(gl); - this.spriteBatch.setContext(gl); - this.maskManager.setContext(gl); - this.filterManager.setContext(gl); - this.blendModeManager.setContext(gl); - this.stencilManager.setContext(gl); - - this.renderSession.gl = this.gl; - - // now resize and we are good to go! - this.resize(this.width, this.height); -}; - -/** - * Renders the stage to its webGL view - * - * @method render - * @param stage {Stage} the Stage element to be rendered - */ -PIXI.WebGLRenderer.prototype.render = function(stage) -{ - // no point rendering if our context has been blown up! - if(this.contextLost)return; - - // if rendering a new stage clear the batches.. - if(this.__stage !== stage) - { - if(stage.interactive)stage.interactionManager.removeEvents(); - - // TODO make this work - // dont think this is needed any more? - this.__stage = stage; - } - - // update the scene graph - stage.updateTransform(); - - var gl = this.gl; - - // interaction - if(stage._interactive) - { - //need to add some events! - if(!stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = true; - stage.interactionManager.setTarget(this); - } - } - else - { - if(stage._interactiveEventsAdded) - { - stage._interactiveEventsAdded = false; - stage.interactionManager.setTarget(this); - } - } - - // -- Does this need to be set every frame? -- // - gl.viewport(0, 0, this.width, this.height); - - // make sure we are bound to the main frame buffer - gl.bindFramebuffer(gl.FRAMEBUFFER, null); - - if (this.clearBeforeRender) - { - if(this.transparent) - { - gl.clearColor(0, 0, 0, 0); - } - else - { - gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], 1); - } - - gl.clear (gl.COLOR_BUFFER_BIT); - } - - this.renderDisplayObject( stage, this.projection ); -}; - -/** - * Renders a Display Object. - * - * @method renderDisplayObject - * @param displayObject {DisplayObject} The DisplayObject to render - * @param projection {Point} The projection - * @param buffer {Array} a standard WebGL buffer - */ -PIXI.WebGLRenderer.prototype.renderDisplayObject = function(displayObject, projection, buffer) -{ - this.renderSession.blendModeManager.setBlendMode(PIXI.blendModes.NORMAL); - - // reset the render session data.. - this.renderSession.drawCount = 0; - - // make sure to flip the Y if using a render texture.. - this.renderSession.flipY = buffer ? -1 : 1; - - // set the default projection - this.renderSession.projection = projection; - - //set the default offset - this.renderSession.offset = this.offset; - - // start the sprite batch - this.spriteBatch.begin(this.renderSession); - - // start the filter manager - this.filterManager.begin(this.renderSession, buffer); - - // render the scene! - displayObject._renderWebGL(this.renderSession); - - // finish the sprite batch - this.spriteBatch.end(); -}; - -/** - * Resizes the webGL view to the specified width and height. - * - * @method resize - * @param width {Number} the new width of the webGL view - * @param height {Number} the new height of the webGL view - */ -PIXI.WebGLRenderer.prototype.resize = function(width, height) -{ - this.width = width * this.resolution; - this.height = height * this.resolution; - - this.view.width = this.width; - this.view.height = this.height; - - if (this.autoResize) { - this.view.style.width = this.width / this.resolution + 'px'; - this.view.style.height = this.height / this.resolution + 'px'; - } - - this.gl.viewport(0, 0, this.width, this.height); - - this.projection.x = this.width / 2 / this.resolution; - this.projection.y = -this.height / 2 / this.resolution; -}; - -/** - * Updates and Creates a WebGL texture for the renderers context. - * - * @method updateTexture - * @param texture {Texture} the texture to update - */ -PIXI.WebGLRenderer.prototype.updateTexture = function(texture) -{ - if(!texture.hasLoaded )return; - - var gl = this.gl; - - if(!texture._glTextures[gl.id])texture._glTextures[gl.id] = gl.createTexture(); - - gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]); - - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultipliedAlpha); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source); - - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - - - if(texture.mipmap && PIXI.isPowerOfTwo(texture.width, texture.height)) - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR_MIPMAP_LINEAR : gl.NEAREST_MIPMAP_NEAREST); - gl.generateMipmap(gl.TEXTURE_2D); - } - else - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - } - - // reguler... - if(!texture._powerOf2) - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - } - else - { - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT); - } - - texture._dirty[gl.id] = false; - - return texture._glTextures[gl.id]; -}; - -/** - * Handles a lost webgl context - * - * @method handleContextLost - * @param event {Event} - * @private - */ -PIXI.WebGLRenderer.prototype.handleContextLost = function(event) -{ - event.preventDefault(); - this.contextLost = true; -}; - -/** - * Handles a restored webgl context - * - * @method handleContextRestored - * @param event {Event} - * @private - */ -PIXI.WebGLRenderer.prototype.handleContextRestored = function() -{ - this.initContext(); - - // empty all the ol gl textures as they are useless now - for(var key in PIXI.TextureCache) - { - var texture = PIXI.TextureCache[key].baseTexture; - texture._glTextures = []; - } - - this.contextLost = false; -}; - -/** - * Removes everything from the renderer (event listeners, spritebatch, etc...) - * - * @method destroy - */ -PIXI.WebGLRenderer.prototype.destroy = function() -{ - // remove listeners - this.view.removeEventListener('webglcontextlost', this.contextLostBound); - this.view.removeEventListener('webglcontextrestored', this.contextRestoredBound); - - PIXI.glContexts[this.glContextId] = null; - - this.projection = null; - this.offset = null; - - // time to create the render managers! each one focuses on managine a state in webGL - this.shaderManager.destroy(); - this.spriteBatch.destroy(); - this.maskManager.destroy(); - this.filterManager.destroy(); - - this.shaderManager = null; - this.spriteBatch = null; - this.maskManager = null; - this.filterManager = null; - - this.gl = null; - this.renderSession = null; -}; - -/** - * Maps Pixi blend modes to WebGL blend modes. - * - * @method mapBlendModes - */ -PIXI.WebGLRenderer.prototype.mapBlendModes = function() -{ - var gl = this.gl; - - if(!PIXI.blendModesWebGL) - { - PIXI.blendModesWebGL = []; - - PIXI.blendModesWebGL[PIXI.blendModes.NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.ADD] = [gl.SRC_ALPHA, gl.DST_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SCREEN] = [gl.SRC_ALPHA, gl.ONE]; - PIXI.blendModesWebGL[PIXI.blendModes.OVERLAY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.DARKEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.LIGHTEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR_DODGE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR_BURN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.HARD_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SOFT_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.DIFFERENCE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.EXCLUSION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.HUE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.SATURATION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.COLOR] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - PIXI.blendModesWebGL[PIXI.blendModes.LUMINOSITY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - } -}; - -PIXI.WebGLRenderer.glContextId = 0; diff --git a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js b/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js deleted file mode 100755 index bbd3259..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/shaders/ComplexPrimitiveShader.js +++ /dev/null @@ -1,122 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class ComplexPrimitiveShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.ComplexPrimitiveShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - - 'precision mediump float;', - - 'varying vec4 vColor;', - - 'void main(void) {', - ' gl_FragColor = vColor;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - //'attribute vec4 aColor;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - - 'uniform vec3 tint;', - 'uniform float alpha;', - 'uniform vec3 color;', - 'uniform float flipY;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);', - ' vColor = vec4(color * alpha * tint, alpha);',//" * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.ComplexPrimitiveShader.prototype.constructor = PIXI.ComplexPrimitiveShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.ComplexPrimitiveShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.tintColor = gl.getUniformLocation(program, 'tint'); - this.color = gl.getUniformLocation(program, 'color'); - this.flipY = gl.getUniformLocation(program, 'flipY'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - // this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - this.attributes = [this.aVertexPosition, this.colorAttribute]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.ComplexPrimitiveShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attribute = null; -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiFastShader.js b/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiFastShader.js deleted file mode 100755 index 8e685e7..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiFastShader.js +++ /dev/null @@ -1,155 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class PixiFastShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PixiFastShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying float vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aPositionCoord;', - 'attribute vec2 aScale;', - 'attribute float aRotation;', - 'attribute vec2 aTextureCoord;', - 'attribute float aColor;', - - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - 'uniform mat3 uMatrix;', - - 'varying vec2 vTextureCoord;', - 'varying float vColor;', - - 'const vec2 center = vec2(-1.0, 1.0);', - - 'void main(void) {', - ' vec2 v;', - ' vec2 sv = aVertexPosition * aScale;', - ' v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);', - ' v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);', - ' v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;', - ' gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - // ' vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;', - ' vColor = aColor;', - '}' - ]; - - /** - * A local texture counter for multi-texture shaders. - * @property textureCount - * @type Number - */ - this.textureCount = 0; - - this.init(); -}; - -PIXI.PixiFastShader.prototype.constructor = PIXI.PixiFastShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PixiFastShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.dimensions = gl.getUniformLocation(program, 'dimensions'); - this.uMatrix = gl.getUniformLocation(program, 'uMatrix'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aPositionCoord = gl.getAttribLocation(program, 'aPositionCoord'); - - this.aScale = gl.getAttribLocation(program, 'aScale'); - this.aRotation = gl.getAttribLocation(program, 'aRotation'); - - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - // Begin worst hack eva // - - // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? - // maybe its somthing to do with the current state of the gl context. - // Im convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel - // If theres any webGL people that know why could happen please help :) - if(this.colorAttribute === -1) - { - this.colorAttribute = 2; - } - - this.attributes = [this.aVertexPosition, this.aPositionCoord, this.aScale, this.aRotation, this.aTextureCoord, this.colorAttribute]; - - // End worst hack eva // - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PixiFastShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiShader.js b/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiShader.js deleted file mode 100755 index e70be7f..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/shaders/PixiShader.js +++ /dev/null @@ -1,389 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * @author Richard Davey http://www.photonstorm.com @photonstorm - */ - -/** -* @class PixiShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PixiShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]; - - /** - * A local texture counter for multi-texture shaders. - * @property textureCount - * @type Number - */ - this.textureCount = 0; - - /** - * A local flag - * @property firstRun - * @type Boolean - * @private - */ - this.firstRun = true; - - /** - * A dirty flag - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * Uniform attributes cache. - * @property attributes - * @type Array - * @private - */ - this.attributes = []; - - this.init(); -}; - -PIXI.PixiShader.prototype.constructor = PIXI.PixiShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PixiShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc || PIXI.PixiShader.defaultVertexSrc, this.fragmentSrc); - - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.dimensions = gl.getUniformLocation(program, 'dimensions'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - // Begin worst hack eva // - - // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters? - // maybe its something to do with the current state of the gl context. - // I'm convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel - // If theres any webGL people that know why could happen please help :) - if(this.colorAttribute === -1) - { - this.colorAttribute = 2; - } - - this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute]; - - // End worst hack eva // - - // add those custom shaders! - for (var key in this.uniforms) - { - // get the uniform locations.. - this.uniforms[key].uniformLocation = gl.getUniformLocation(program, key); - } - - this.initUniforms(); - - this.program = program; -}; - -/** -* Initialises the shader uniform values. -* -* Uniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/ -* http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf -* -* @method initUniforms -*/ -PIXI.PixiShader.prototype.initUniforms = function() -{ - this.textureCount = 1; - var gl = this.gl; - var uniform; - - for (var key in this.uniforms) - { - uniform = this.uniforms[key]; - - var type = uniform.type; - - if (type === 'sampler2D') - { - uniform._init = false; - - if (uniform.value !== null) - { - this.initSampler2D(uniform); - } - } - else if (type === 'mat2' || type === 'mat3' || type === 'mat4') - { - // These require special handling - uniform.glMatrix = true; - uniform.glValueLength = 1; - - if (type === 'mat2') - { - uniform.glFunc = gl.uniformMatrix2fv; - } - else if (type === 'mat3') - { - uniform.glFunc = gl.uniformMatrix3fv; - } - else if (type === 'mat4') - { - uniform.glFunc = gl.uniformMatrix4fv; - } - } - else - { - // GL function reference - uniform.glFunc = gl['uniform' + type]; - - if (type === '2f' || type === '2i') - { - uniform.glValueLength = 2; - } - else if (type === '3f' || type === '3i') - { - uniform.glValueLength = 3; - } - else if (type === '4f' || type === '4i') - { - uniform.glValueLength = 4; - } - else - { - uniform.glValueLength = 1; - } - } - } - -}; - -/** -* Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded) -* -* @method initSampler2D -*/ -PIXI.PixiShader.prototype.initSampler2D = function(uniform) -{ - if (!uniform.value || !uniform.value.baseTexture || !uniform.value.baseTexture.hasLoaded) - { - return; - } - - var gl = this.gl; - - gl.activeTexture(gl['TEXTURE' + this.textureCount]); - gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]); - - // Extended texture data - if (uniform.textureData) - { - var data = uniform.textureData; - - // GLTexture = mag linear, min linear_mipmap_linear, wrap repeat + gl.generateMipmap(gl.TEXTURE_2D); - // GLTextureLinear = mag/min linear, wrap clamp - // GLTextureNearestRepeat = mag/min NEAREST, wrap repeat - // GLTextureNearest = mag/min nearest, wrap clamp - // AudioTexture = whatever + luminance + width 512, height 2, border 0 - // KeyTexture = whatever + luminance + width 256, height 2, border 0 - - // magFilter can be: gl.LINEAR, gl.LINEAR_MIPMAP_LINEAR or gl.NEAREST - // wrapS/T can be: gl.CLAMP_TO_EDGE or gl.REPEAT - - var magFilter = (data.magFilter) ? data.magFilter : gl.LINEAR; - var minFilter = (data.minFilter) ? data.minFilter : gl.LINEAR; - var wrapS = (data.wrapS) ? data.wrapS : gl.CLAMP_TO_EDGE; - var wrapT = (data.wrapT) ? data.wrapT : gl.CLAMP_TO_EDGE; - var format = (data.luminance) ? gl.LUMINANCE : gl.RGBA; - - if (data.repeat) - { - wrapS = gl.REPEAT; - wrapT = gl.REPEAT; - } - - gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, !!data.flipY); - - if (data.width) - { - var width = (data.width) ? data.width : 512; - var height = (data.height) ? data.height : 2; - var border = (data.border) ? data.border : 0; - - // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels); - gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, border, format, gl.UNSIGNED_BYTE, null); - } - else - { - // void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, ImageData? pixels); - gl.texImage2D(gl.TEXTURE_2D, 0, format, gl.RGBA, gl.UNSIGNED_BYTE, uniform.value.baseTexture.source); - } - - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrapS); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT); - } - - gl.uniform1i(uniform.uniformLocation, this.textureCount); - - uniform._init = true; - - this.textureCount++; - -}; - -/** -* Updates the shader uniform values. -* -* @method syncUniforms -*/ -PIXI.PixiShader.prototype.syncUniforms = function() -{ - this.textureCount = 1; - var uniform; - var gl = this.gl; - - // This would probably be faster in an array and it would guarantee key order - for (var key in this.uniforms) - { - uniform = this.uniforms[key]; - - if (uniform.glValueLength === 1) - { - if (uniform.glMatrix === true) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.transpose, uniform.value); - } - else - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value); - } - } - else if (uniform.glValueLength === 2) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y); - } - else if (uniform.glValueLength === 3) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z); - } - else if (uniform.glValueLength === 4) - { - uniform.glFunc.call(gl, uniform.uniformLocation, uniform.value.x, uniform.value.y, uniform.value.z, uniform.value.w); - } - else if (uniform.type === 'sampler2D') - { - if (uniform._init) - { - gl.activeTexture(gl['TEXTURE' + this.textureCount]); - - if(uniform.value.baseTexture._dirty[gl.id]) - { - PIXI.instances[gl.id].updateTexture(uniform.value.baseTexture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id]); - } - - // gl.bindTexture(gl.TEXTURE_2D, uniform.value.baseTexture._glTextures[gl.id] || PIXI.createWebGLTexture( uniform.value.baseTexture, gl)); - gl.uniform1i(uniform.uniformLocation, this.textureCount); - this.textureCount++; - } - else - { - this.initSampler2D(uniform); - } - } - } - -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PixiShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; - -/** -* The Default Vertex shader source. -* -* @property defaultVertexSrc -* @type String -*/ -PIXI.PixiShader.defaultVertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aTextureCoord;', - 'attribute vec4 aColor;', - - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - - 'const vec2 center = vec2(-1.0, 1.0);', - - 'void main(void) {', - ' gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - ' vColor = vec4(aColor.rgb * aColor.a, aColor.a);', - '}' -]; \ No newline at end of file diff --git a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/shaders/PrimitiveShader.js b/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/shaders/PrimitiveShader.js deleted file mode 100755 index bdaab89..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/shaders/PrimitiveShader.js +++ /dev/null @@ -1,117 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class PrimitiveShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.PrimitiveShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' gl_FragColor = vColor;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec4 aColor;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - 'uniform float alpha;', - 'uniform float flipY;', - 'uniform vec3 tint;', - 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, (v.y / projectionVector.y * -flipY) + flipY , 0.0, 1.0);', - ' vColor = aColor * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.PrimitiveShader.prototype.constructor = PIXI.PrimitiveShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.PrimitiveShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.tintColor = gl.getUniformLocation(program, 'tint'); - this.flipY = gl.getUniformLocation(program, 'flipY'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - - this.attributes = [this.aVertexPosition, this.colorAttribute]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.PrimitiveShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attributes = null; -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/shaders/StripShader.js b/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/shaders/StripShader.js deleted file mode 100755 index 6b47244..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/shaders/StripShader.js +++ /dev/null @@ -1,123 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class StripShader -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.StripShader = function(gl) -{ - /** - * @property _UID - * @type Number - * @private - */ - this._UID = PIXI._UID++; - - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - /** - * The WebGL program. - * @property program - * @type Any - */ - this.program = null; - - /** - * The fragment shader. - * @property fragmentSrc - * @type Array - */ - this.fragmentSrc = [ - 'precision mediump float;', - 'varying vec2 vTextureCoord;', - // 'varying float vColor;', - 'uniform float alpha;', - 'uniform sampler2D uSampler;', - - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * alpha;', - // ' gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);',//gl_FragColor * alpha;', - '}' - ]; - - /** - * The vertex shader. - * @property vertexSrc - * @type Array - */ - this.vertexSrc = [ - 'attribute vec2 aVertexPosition;', - 'attribute vec2 aTextureCoord;', - 'uniform mat3 translationMatrix;', - 'uniform vec2 projectionVector;', - 'uniform vec2 offsetVector;', - // 'uniform float alpha;', - // 'uniform vec3 tint;', - 'varying vec2 vTextureCoord;', - // 'varying vec4 vColor;', - - 'void main(void) {', - ' vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);', - ' v -= offsetVector.xyx;', - ' gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);', - ' vTextureCoord = aTextureCoord;', - // ' vColor = aColor * vec4(tint * alpha, alpha);', - '}' - ]; - - this.init(); -}; - -PIXI.StripShader.prototype.constructor = PIXI.StripShader; - -/** -* Initialises the shader. -* -* @method init -*/ -PIXI.StripShader.prototype.init = function() -{ - var gl = this.gl; - - var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc); - gl.useProgram(program); - - // get and store the uniforms for the shader - this.uSampler = gl.getUniformLocation(program, 'uSampler'); - this.projectionVector = gl.getUniformLocation(program, 'projectionVector'); - this.offsetVector = gl.getUniformLocation(program, 'offsetVector'); - this.colorAttribute = gl.getAttribLocation(program, 'aColor'); - //this.dimensions = gl.getUniformLocation(this.program, 'dimensions'); - - // get and store the attributes - this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition'); - this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord'); - - this.attributes = [this.aVertexPosition, this.aTextureCoord]; - - this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix'); - this.alpha = gl.getUniformLocation(program, 'alpha'); - - this.program = program; -}; - -/** -* Destroys the shader. -* -* @method destroy -*/ -PIXI.StripShader.prototype.destroy = function() -{ - this.gl.deleteProgram( this.program ); - this.uniforms = null; - this.gl = null; - - this.attribute = null; -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/FilterTexture.js b/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/FilterTexture.js deleted file mode 100755 index 0340289..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/FilterTexture.js +++ /dev/null @@ -1,110 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class FilterTexture -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -* @param width {Number} the horizontal range of the filter -* @param height {Number} the vertical range of the filter -* @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values -*/ -PIXI.FilterTexture = function(gl, width, height, scaleMode) -{ - /** - * @property gl - * @type WebGLContext - */ - this.gl = gl; - - // next time to create a frame buffer and texture - - /** - * @property frameBuffer - * @type Any - */ - this.frameBuffer = gl.createFramebuffer(); - - /** - * @property texture - * @type Any - */ - this.texture = gl.createTexture(); - - /** - * @property scaleMode - * @type Number - */ - scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - gl.bindTexture(gl.TEXTURE_2D, this.texture); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer ); - - gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer ); - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0); - - // required for masking a mask?? - this.renderBuffer = gl.createRenderbuffer(); - gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer); - gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.renderBuffer); - - this.resize(width, height); -}; - -PIXI.FilterTexture.prototype.constructor = PIXI.FilterTexture; - -/** -* Clears the filter texture. -* -* @method clear -*/ -PIXI.FilterTexture.prototype.clear = function() -{ - var gl = this.gl; - - gl.clearColor(0,0,0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); -}; - -/** - * Resizes the texture to the specified width and height - * - * @method resize - * @param width {Number} the new width of the texture - * @param height {Number} the new height of the texture - */ -PIXI.FilterTexture.prototype.resize = function(width, height) -{ - if(this.width === width && this.height === height) return; - - this.width = width; - this.height = height; - - var gl = this.gl; - - gl.bindTexture(gl.TEXTURE_2D, this.texture); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width , height , 0, gl.RGBA, gl.UNSIGNED_BYTE, null); - // update the stencil buffer width and height - gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer); - gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width , height ); -}; - -/** -* Destroys the filter texture. -* -* @method destroy -*/ -PIXI.FilterTexture.prototype.destroy = function() -{ - var gl = this.gl; - gl.deleteFramebuffer( this.frameBuffer ); - gl.deleteTexture( this.texture ); - - this.frameBuffer = null; - this.texture = null; -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js b/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js deleted file mode 100755 index 3de0ec9..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLBlendModeManager.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLBlendModeManager -* @constructor -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLBlendModeManager = function() -{ - /** - * @property currentBlendMode - * @type Number - */ - this.currentBlendMode = 99999; -}; - -PIXI.WebGLBlendModeManager.prototype.constructor = PIXI.WebGLBlendModeManager; - -/** - * Sets the WebGL Context. - * - * @method setContext - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLBlendModeManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Sets-up the given blendMode from WebGL's point of view. -* -* @method setBlendMode -* @param blendMode {Number} the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD -*/ -PIXI.WebGLBlendModeManager.prototype.setBlendMode = function(blendMode) -{ - if(this.currentBlendMode === blendMode)return false; - - this.currentBlendMode = blendMode; - - var blendModeWebGL = PIXI.blendModesWebGL[this.currentBlendMode]; - this.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); - - return true; -}; - -/** -* Destroys this object. -* -* @method destroy -*/ -PIXI.WebGLBlendModeManager.prototype.destroy = function() -{ - this.gl = null; -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js b/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js deleted file mode 100755 index d870f50..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js +++ /dev/null @@ -1,428 +0,0 @@ -/** - * @author Mat Groves - * - * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ - * for creating the original pixi version! - * - * Heavily inspired by LibGDX's WebGLSpriteBatch: - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java - */ - -/** -* @class WebGLFastSpriteBatch -* @constructor -*/ -PIXI.WebGLFastSpriteBatch = function(gl) -{ - /** - * @property vertSize - * @type Number - */ - this.vertSize = 10; - - /** - * @property maxSize - * @type Number - */ - this.maxSize = 6000;//Math.pow(2, 16) / this.vertSize; - - /** - * @property size - * @type Number - */ - this.size = this.maxSize; - - //the total number of floats in our batch - var numVerts = this.size * 4 * this.vertSize; - - //the total number of indices in our batch - var numIndices = this.maxSize * 6; - - /** - * Vertex data - * @property vertices - * @type Float32Array - */ - this.vertices = new PIXI.Float32Array(numVerts); - - /** - * Index data - * @property indices - * @type Uint16Array - */ - this.indices = new PIXI.Uint16Array(numIndices); - - /** - * @property vertexBuffer - * @type Object - */ - this.vertexBuffer = null; - - /** - * @property indexBuffer - * @type Object - */ - this.indexBuffer = null; - - /** - * @property lastIndexCount - * @type Number - */ - this.lastIndexCount = 0; - - for (var i=0, j=0; i < numIndices; i += 6, j += 4) - { - this.indices[i + 0] = j + 0; - this.indices[i + 1] = j + 1; - this.indices[i + 2] = j + 2; - this.indices[i + 3] = j + 0; - this.indices[i + 4] = j + 2; - this.indices[i + 5] = j + 3; - } - - /** - * @property drawing - * @type Boolean - */ - this.drawing = false; - - /** - * @property currentBatchSize - * @type Number - */ - this.currentBatchSize = 0; - - /** - * @property currentBaseTexture - * @type BaseTexture - */ - this.currentBaseTexture = null; - - /** - * @property currentBlendMode - * @type Number - */ - this.currentBlendMode = 0; - - /** - * @property renderSession - * @type Object - */ - this.renderSession = null; - - /** - * @property shader - * @type Object - */ - this.shader = null; - - /** - * @property matrix - * @type Matrix - */ - this.matrix = null; - - this.setContext(gl); -}; - -PIXI.WebGLFastSpriteBatch.prototype.constructor = PIXI.WebGLFastSpriteBatch; - -/** - * Sets the WebGL Context. - * - * @method setContext - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLFastSpriteBatch.prototype.setContext = function(gl) -{ - this.gl = gl; - - // create a couple of buffers - this.vertexBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // 65535 is max index, so 65535 / 6 = 10922. - - //upload the index data - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); -}; - -/** - * @method begin - * @param spriteBatch {WebGLSpriteBatch} - * @param renderSession {Object} - */ -PIXI.WebGLFastSpriteBatch.prototype.begin = function(spriteBatch, renderSession) -{ - this.renderSession = renderSession; - this.shader = this.renderSession.shaderManager.fastShader; - - this.matrix = spriteBatch.worldTransform.toArray(true); - - this.start(); -}; - -/** - * @method end - */ -PIXI.WebGLFastSpriteBatch.prototype.end = function() -{ - this.flush(); -}; - -/** - * @method render - * @param spriteBatch {WebGLSpriteBatch} - */ -PIXI.WebGLFastSpriteBatch.prototype.render = function(spriteBatch) -{ - var children = spriteBatch.children; - var sprite = children[0]; - - // if the uvs have not updated then no point rendering just yet! - - // check texture. - if(!sprite.texture._uvs)return; - - this.currentBaseTexture = sprite.texture.baseTexture; - - // check blend mode - if(sprite.blendMode !== this.renderSession.blendModeManager.currentBlendMode) - { - this.flush(); - this.renderSession.blendModeManager.setBlendMode(sprite.blendMode); - } - - for(var i=0,j= children.length; i= this.size) - { - this.flush(); - } -}; - -/** - * @method flush - */ -PIXI.WebGLFastSpriteBatch.prototype.flush = function() -{ - // If the batch is length 0 then return as there is nothing to draw - if (this.currentBatchSize===0)return; - - var gl = this.gl; - - // bind the current texture - - if(!this.currentBaseTexture._glTextures[gl.id])this.renderSession.renderer.updateTexture(this.currentBaseTexture, gl); - - gl.bindTexture(gl.TEXTURE_2D, this.currentBaseTexture._glTextures[gl.id]); - - // upload the verts to the buffer - - if(this.currentBatchSize > ( this.size * 0.5 ) ) - { - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - } - else - { - var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize); - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); - } - - // now draw those suckas! - gl.drawElements(gl.TRIANGLES, this.currentBatchSize * 6, gl.UNSIGNED_SHORT, 0); - - // then reset the batch! - this.currentBatchSize = 0; - - // increment the draw count - this.renderSession.drawCount++; -}; - - -/** - * @method stop - */ -PIXI.WebGLFastSpriteBatch.prototype.stop = function() -{ - this.flush(); -}; - -/** - * @method start - */ -PIXI.WebGLFastSpriteBatch.prototype.start = function() -{ - var gl = this.gl; - - // bind the main texture - gl.activeTexture(gl.TEXTURE0); - - // bind the buffers - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - // set the projection - var projection = this.renderSession.projection; - gl.uniform2f(this.shader.projectionVector, projection.x, projection.y); - - // set the matrix - gl.uniformMatrix3fv(this.shader.uMatrix, false, this.matrix); - - // set the pointers - var stride = this.vertSize * 4; - - gl.vertexAttribPointer(this.shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0); - gl.vertexAttribPointer(this.shader.aPositionCoord, 2, gl.FLOAT, false, stride, 2 * 4); - gl.vertexAttribPointer(this.shader.aScale, 2, gl.FLOAT, false, stride, 4 * 4); - gl.vertexAttribPointer(this.shader.aRotation, 1, gl.FLOAT, false, stride, 6 * 4); - gl.vertexAttribPointer(this.shader.aTextureCoord, 2, gl.FLOAT, false, stride, 7 * 4); - gl.vertexAttribPointer(this.shader.colorAttribute, 1, gl.FLOAT, false, stride, 9 * 4); - -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFilterManager.js b/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFilterManager.js deleted file mode 100755 index e726891..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLFilterManager.js +++ /dev/null @@ -1,450 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLFilterManager -* @constructor -*/ -PIXI.WebGLFilterManager = function() -{ - /** - * @property filterStack - * @type Array - */ - this.filterStack = []; - - /** - * @property offsetX - * @type Number - */ - this.offsetX = 0; - - /** - * @property offsetY - * @type Number - */ - this.offsetY = 0; -}; - -PIXI.WebGLFilterManager.prototype.constructor = PIXI.WebGLFilterManager; - -/** -* Initialises the context and the properties. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLFilterManager.prototype.setContext = function(gl) -{ - this.gl = gl; - this.texturePool = []; - - this.initShaderBuffers(); -}; - -/** -* @method begin -* @param renderSession {RenderSession} -* @param buffer {ArrayBuffer} -*/ -PIXI.WebGLFilterManager.prototype.begin = function(renderSession, buffer) -{ - this.renderSession = renderSession; - this.defaultShader = renderSession.shaderManager.defaultShader; - - var projection = this.renderSession.projection; - this.width = projection.x * 2; - this.height = -projection.y * 2; - this.buffer = buffer; -}; - -/** -* Applies the filter and adds it to the current filter stack. -* -* @method pushFilter -* @param filterBlock {Object} the filter that will be pushed to the current filter stack -*/ -PIXI.WebGLFilterManager.prototype.pushFilter = function(filterBlock) -{ - var gl = this.gl; - - var projection = this.renderSession.projection; - var offset = this.renderSession.offset; - - filterBlock._filterArea = filterBlock.target.filterArea || filterBlock.target.getBounds(); - - // filter program - // OPTIMISATION - the first filter is free if its a simple color change? - this.filterStack.push(filterBlock); - - var filter = filterBlock.filterPasses[0]; - - this.offsetX += filterBlock._filterArea.x; - this.offsetY += filterBlock._filterArea.y; - - var texture = this.texturePool.pop(); - if(!texture) - { - texture = new PIXI.FilterTexture(this.gl, this.width, this.height); - } - else - { - texture.resize(this.width, this.height); - } - - gl.bindTexture(gl.TEXTURE_2D, texture.texture); - - var filterArea = filterBlock._filterArea;// filterBlock.target.getBounds();///filterBlock.target.filterArea; - - var padding = filter.padding; - filterArea.x -= padding; - filterArea.y -= padding; - filterArea.width += padding * 2; - filterArea.height += padding * 2; - - // cap filter to screen size.. - if(filterArea.x < 0)filterArea.x = 0; - if(filterArea.width > this.width)filterArea.width = this.width; - if(filterArea.y < 0)filterArea.y = 0; - if(filterArea.height > this.height)filterArea.height = this.height; - - //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, filterArea.width, filterArea.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); - gl.bindFramebuffer(gl.FRAMEBUFFER, texture.frameBuffer); - - // set view port - gl.viewport(0, 0, filterArea.width, filterArea.height); - - projection.x = filterArea.width/2; - projection.y = -filterArea.height/2; - - offset.x = -filterArea.x; - offset.y = -filterArea.y; - - // update projection - // now restore the regular shader.. - // this.renderSession.shaderManager.setShader(this.defaultShader); - //gl.uniform2f(this.defaultShader.projectionVector, filterArea.width/2, -filterArea.height/2); - //gl.uniform2f(this.defaultShader.offsetVector, -filterArea.x, -filterArea.y); - - gl.colorMask(true, true, true, true); - gl.clearColor(0,0,0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); - - filterBlock._glFilterTexture = texture; - -}; - -/** -* Removes the last filter from the filter stack and doesn't return it. -* -* @method popFilter -*/ -PIXI.WebGLFilterManager.prototype.popFilter = function() -{ - var gl = this.gl; - var filterBlock = this.filterStack.pop(); - var filterArea = filterBlock._filterArea; - var texture = filterBlock._glFilterTexture; - var projection = this.renderSession.projection; - var offset = this.renderSession.offset; - - if(filterBlock.filterPasses.length > 1) - { - gl.viewport(0, 0, filterArea.width, filterArea.height); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - - this.vertexArray[0] = 0; - this.vertexArray[1] = filterArea.height; - - this.vertexArray[2] = filterArea.width; - this.vertexArray[3] = filterArea.height; - - this.vertexArray[4] = 0; - this.vertexArray[5] = 0; - - this.vertexArray[6] = filterArea.width; - this.vertexArray[7] = 0; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - // now set the uvs.. - this.uvArray[2] = filterArea.width/this.width; - this.uvArray[5] = filterArea.height/this.height; - this.uvArray[6] = filterArea.width/this.width; - this.uvArray[7] = filterArea.height/this.height; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray); - - var inputTexture = texture; - var outputTexture = this.texturePool.pop(); - if(!outputTexture)outputTexture = new PIXI.FilterTexture(this.gl, this.width, this.height); - outputTexture.resize(this.width, this.height); - - // need to clear this FBO as it may have some left over elements from a previous filter. - gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer ); - gl.clear(gl.COLOR_BUFFER_BIT); - - gl.disable(gl.BLEND); - - for (var i = 0; i < filterBlock.filterPasses.length-1; i++) - { - var filterPass = filterBlock.filterPasses[i]; - - gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer ); - - // set texture - gl.activeTexture(gl.TEXTURE0); - gl.bindTexture(gl.TEXTURE_2D, inputTexture.texture); - - // draw texture.. - //filterPass.applyFilterPass(filterArea.width, filterArea.height); - this.applyFilterPass(filterPass, filterArea, filterArea.width, filterArea.height); - - // swap the textures.. - var temp = inputTexture; - inputTexture = outputTexture; - outputTexture = temp; - } - - gl.enable(gl.BLEND); - - texture = inputTexture; - this.texturePool.push(outputTexture); - } - - var filter = filterBlock.filterPasses[filterBlock.filterPasses.length-1]; - - this.offsetX -= filterArea.x; - this.offsetY -= filterArea.y; - - var sizeX = this.width; - var sizeY = this.height; - - var offsetX = 0; - var offsetY = 0; - - var buffer = this.buffer; - - // time to render the filters texture to the previous scene - if(this.filterStack.length === 0) - { - gl.colorMask(true, true, true, true);//this.transparent); - } - else - { - var currentFilter = this.filterStack[this.filterStack.length-1]; - filterArea = currentFilter._filterArea; - - sizeX = filterArea.width; - sizeY = filterArea.height; - - offsetX = filterArea.x; - offsetY = filterArea.y; - - buffer = currentFilter._glFilterTexture.frameBuffer; - } - - // TODO need to remove these global elements.. - projection.x = sizeX/2; - projection.y = -sizeY/2; - - offset.x = offsetX; - offset.y = offsetY; - - filterArea = filterBlock._filterArea; - - var x = filterArea.x-offsetX; - var y = filterArea.y-offsetY; - - // update the buffers.. - // make sure to flip the y! - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - - this.vertexArray[0] = x; - this.vertexArray[1] = y + filterArea.height; - - this.vertexArray[2] = x + filterArea.width; - this.vertexArray[3] = y + filterArea.height; - - this.vertexArray[4] = x; - this.vertexArray[5] = y; - - this.vertexArray[6] = x + filterArea.width; - this.vertexArray[7] = y; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - - this.uvArray[2] = filterArea.width/this.width; - this.uvArray[5] = filterArea.height/this.height; - this.uvArray[6] = filterArea.width/this.width; - this.uvArray[7] = filterArea.height/this.height; - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.uvArray); - - gl.viewport(0, 0, sizeX * this.renderSession.resolution, sizeY * this.renderSession.resolution); - - // bind the buffer - gl.bindFramebuffer(gl.FRAMEBUFFER, buffer ); - - // set the blend mode! - //gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA) - - // set texture - gl.activeTexture(gl.TEXTURE0); - gl.bindTexture(gl.TEXTURE_2D, texture.texture); - - // apply! - this.applyFilterPass(filter, filterArea, sizeX, sizeY); - - // now restore the regular shader.. should happen automatically now.. - // this.renderSession.shaderManager.setShader(this.defaultShader); - // gl.uniform2f(this.defaultShader.projectionVector, sizeX/2, -sizeY/2); - // gl.uniform2f(this.defaultShader.offsetVector, -offsetX, -offsetY); - - // return the texture to the pool - this.texturePool.push(texture); - filterBlock._glFilterTexture = null; -}; - - -/** -* Applies the filter to the specified area. -* -* @method applyFilterPass -* @param filter {AbstractFilter} the filter that needs to be applied -* @param filterArea {Texture} TODO - might need an update -* @param width {Number} the horizontal range of the filter -* @param height {Number} the vertical range of the filter -*/ -PIXI.WebGLFilterManager.prototype.applyFilterPass = function(filter, filterArea, width, height) -{ - // use program - var gl = this.gl; - var shader = filter.shaders[gl.id]; - - if(!shader) - { - shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc = filter.fragmentSrc; - shader.uniforms = filter.uniforms; - shader.init(); - - filter.shaders[gl.id] = shader; - } - - // set the shader - this.renderSession.shaderManager.setShader(shader); - -// gl.useProgram(shader.program); - - gl.uniform2f(shader.projectionVector, width/2, -height/2); - gl.uniform2f(shader.offsetVector, 0,0); - - if(filter.uniforms.dimensions) - { - filter.uniforms.dimensions.value[0] = this.width;//width; - filter.uniforms.dimensions.value[1] = this.height;//height; - filter.uniforms.dimensions.value[2] = this.vertexArray[0]; - filter.uniforms.dimensions.value[3] = this.vertexArray[5];//filterArea.height; - } - - shader.syncUniforms(); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer); - gl.vertexAttribPointer(shader.colorAttribute, 2, gl.FLOAT, false, 0, 0); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - // draw the filter... - gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 ); - - this.renderSession.drawCount++; -}; - -/** -* Initialises the shader buffers. -* -* @method initShaderBuffers -*/ -PIXI.WebGLFilterManager.prototype.initShaderBuffers = function() -{ - var gl = this.gl; - - // create some buffers - this.vertexBuffer = gl.createBuffer(); - this.uvBuffer = gl.createBuffer(); - this.colorBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // bind and upload the vertexs.. - // keep a reference to the vertexFloatData.. - this.vertexArray = new PIXI.Float32Array([0.0, 0.0, - 1.0, 0.0, - 0.0, 1.0, - 1.0, 1.0]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertexArray, gl.STATIC_DRAW); - - // bind and upload the uv buffer - this.uvArray = new PIXI.Float32Array([0.0, 0.0, - 1.0, 0.0, - 0.0, 1.0, - 1.0, 1.0]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.uvArray, gl.STATIC_DRAW); - - this.colorArray = new PIXI.Float32Array([1.0, 0xFFFFFF, - 1.0, 0xFFFFFF, - 1.0, 0xFFFFFF, - 1.0, 0xFFFFFF]); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.colorArray, gl.STATIC_DRAW); - - // bind and upload the index - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 1, 3, 2]), gl.STATIC_DRAW); - -}; - -/** -* Destroys the filter and removes it from the filter stack. -* -* @method destroy -*/ -PIXI.WebGLFilterManager.prototype.destroy = function() -{ - var gl = this.gl; - - this.filterStack = null; - - this.offsetX = 0; - this.offsetY = 0; - - // destroy textures - for (var i = 0; i < this.texturePool.length; i++) { - this.texturePool[i].destroy(); - } - - this.texturePool = null; - - //destroy buffers.. - gl.deleteBuffer(this.vertexBuffer); - gl.deleteBuffer(this.uvBuffer); - gl.deleteBuffer(this.colorBuffer); - gl.deleteBuffer(this.indexBuffer); -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLGraphics.js b/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLGraphics.js deleted file mode 100755 index 710383c..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLGraphics.js +++ /dev/null @@ -1,896 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A set of functions used by the webGL renderer to draw the primitive graphics data - * - * @class WebGLGraphics - * @private - * @static - */ -PIXI.WebGLGraphics = function() -{ -}; - -/** - * Renders the graphics object - * - * @static - * @private - * @method renderGraphics - * @param graphics {Graphics} - * @param renderSession {Object} - */ -PIXI.WebGLGraphics.renderGraphics = function(graphics, renderSession)//projection, offset) -{ - var gl = renderSession.gl; - var projection = renderSession.projection, - offset = renderSession.offset, - shader = renderSession.shaderManager.primitiveShader, - webGLData; - - if(graphics.dirty) - { - PIXI.WebGLGraphics.updateGraphics(graphics, gl); - } - - var webGL = graphics._webGL[gl.id]; - - // This could be speeded up for sure! - - for (var i = 0; i < webGL.data.length; i++) - { - if(webGL.data[i].mode === 1) - { - webGLData = webGL.data[i]; - - renderSession.stencilManager.pushStencil(graphics, webGLData, renderSession); - - // render quad.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - renderSession.stencilManager.popStencil(graphics, webGLData, renderSession); - } - else - { - webGLData = webGL.data[i]; - - - renderSession.shaderManager.setShader( shader );//activatePrimitiveShader(); - shader = renderSession.shaderManager.primitiveShader; - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform1f(shader.flipY, 1); - - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - - gl.uniform1f(shader.alpha, graphics.worldAlpha); - - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0); - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4); - - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - } - } -}; - -/** - * Updates the graphics object - * - * @static - * @private - * @method updateGraphics - * @param graphicsData {Graphics} The graphics object to update - * @param gl {WebGLContext} the current WebGL drawing context - */ -PIXI.WebGLGraphics.updateGraphics = function(graphics, gl) -{ - // get the contexts graphics object - var webGL = graphics._webGL[gl.id]; - // if the graphics object does not exist in the webGL context time to create it! - if(!webGL)webGL = graphics._webGL[gl.id] = {lastIndex:0, data:[], gl:gl}; - - // flag the graphics as not dirty as we are about to update it... - graphics.dirty = false; - - var i; - - // if the user cleared the graphics object we will need to clear every object - if(graphics.clearDirty) - { - graphics.clearDirty = false; - - // lop through and return all the webGLDatas to the object pool so than can be reused later on - for (i = 0; i < webGL.data.length; i++) - { - var graphicsData = webGL.data[i]; - graphicsData.reset(); - PIXI.WebGLGraphics.graphicsDataPool.push( graphicsData ); - } - - // clear the array and reset the index.. - webGL.data = []; - webGL.lastIndex = 0; - } - - var webGLData; - - // loop through the graphics datas and construct each one.. - // if the object is a complex fill then the new stencil buffer technique will be used - // other wise graphics objects will be pushed into a batch.. - for (i = webGL.lastIndex; i < graphics.graphicsData.length; i++) - { - var data = graphics.graphicsData[i]; - - if(data.type === PIXI.Graphics.POLY) - { - // need to add the points the the graphics object.. - data.points = data.shape.points.slice(); - if(data.shape.closed) - { - // close the poly if the value is true! - if(data.points[0] !== data.points[data.points.length-2] || data.points[1] !== data.points[data.points.length-1]) - { - data.points.push(data.points[0], data.points[1]); - } - } - - // MAKE SURE WE HAVE THE CORRECT TYPE.. - if(data.fill) - { - if(data.points.length >= 6) - { - if(data.points.length < 6 * 2) - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - - var canDrawUsingSimple = PIXI.WebGLGraphics.buildPoly(data, webGLData); - // console.log(canDrawUsingSimple); - - if(!canDrawUsingSimple) - { - // console.log("<>>>") - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1); - PIXI.WebGLGraphics.buildComplexPoly(data, webGLData); - } - - } - else - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1); - PIXI.WebGLGraphics.buildComplexPoly(data, webGLData); - } - } - } - - if(data.lineWidth > 0) - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - PIXI.WebGLGraphics.buildLine(data, webGLData); - - } - } - else - { - webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0); - - if(data.type === PIXI.Graphics.RECT) - { - PIXI.WebGLGraphics.buildRectangle(data, webGLData); - } - else if(data.type === PIXI.Graphics.CIRC || data.type === PIXI.Graphics.ELIP) - { - PIXI.WebGLGraphics.buildCircle(data, webGLData); - } - else if(data.type === PIXI.Graphics.RREC) - { - PIXI.WebGLGraphics.buildRoundedRectangle(data, webGLData); - } - } - - webGL.lastIndex++; - } - - // upload all the dirty data... - for (i = 0; i < webGL.data.length; i++) - { - webGLData = webGL.data[i]; - if(webGLData.dirty)webGLData.upload(); - } -}; - -/** - * @static - * @private - * @method switchMode - * @param webGL {WebGLContext} - * @param type {Number} - */ -PIXI.WebGLGraphics.switchMode = function(webGL, type) -{ - var webGLData; - - if(!webGL.data.length) - { - webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl); - webGLData.mode = type; - webGL.data.push(webGLData); - } - else - { - webGLData = webGL.data[webGL.data.length-1]; - - if(webGLData.mode !== type || type === 1) - { - webGLData = PIXI.WebGLGraphics.graphicsDataPool.pop() || new PIXI.WebGLGraphicsData(webGL.gl); - webGLData.mode = type; - webGL.data.push(webGLData); - } - } - - webGLData.dirty = true; - - return webGLData; -}; - -/** - * Builds a rectangle to draw - * - * @static - * @private - * @method buildRectangle - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildRectangle = function(graphicsData, webGLData) -{ - // --- // - // need to convert points to a nice regular data - // - var rectData = graphicsData.shape; - var x = rectData.x; - var y = rectData.y; - var width = rectData.width; - var height = rectData.height; - - if(graphicsData.fill) - { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vertPos = verts.length/6; - - // start - verts.push(x, y); - verts.push(r, g, b, alpha); - - verts.push(x + width, y); - verts.push(r, g, b, alpha); - - verts.push(x , y + height); - verts.push(r, g, b, alpha); - - verts.push(x + width, y + height); - verts.push(r, g, b, alpha); - - // insert 2 dead triangles.. - indices.push(vertPos, vertPos, vertPos+1, vertPos+2, vertPos+3, vertPos+3); - } - - if(graphicsData.lineWidth) - { - var tempPoints = graphicsData.points; - - graphicsData.points = [x, y, - x + width, y, - x + width, y + height, - x, y + height, - x, y]; - - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Builds a rounded rectangle to draw - * - * @static - * @private - * @method buildRoundedRectangle - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildRoundedRectangle = function(graphicsData, webGLData) -{ - var rrectData = graphicsData.shape; - var x = rrectData.x; - var y = rrectData.y; - var width = rrectData.width; - var height = rrectData.height; - - var radius = rrectData.radius; - - var recPoints = []; - recPoints.push(x, y + radius); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x, y + height - radius, x, y + height, x + radius, y + height)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + width, y + radius, x + width, y, x + width - radius, y)); - recPoints = recPoints.concat(PIXI.WebGLGraphics.quadraticBezierCurve(x + radius, y, x, y, x, y + radius)); - - if (graphicsData.fill) { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vecPos = verts.length/6; - - var triangles = PIXI.PolyK.Triangulate(recPoints); - - // - - var i = 0; - for (i = 0; i < triangles.length; i+=3) - { - indices.push(triangles[i] + vecPos); - indices.push(triangles[i] + vecPos); - indices.push(triangles[i+1] + vecPos); - indices.push(triangles[i+2] + vecPos); - indices.push(triangles[i+2] + vecPos); - } - - - for (i = 0; i < recPoints.length; i++) - { - verts.push(recPoints[i], recPoints[++i], r, g, b, alpha); - } - } - - if (graphicsData.lineWidth) { - var tempPoints = graphicsData.points; - - graphicsData.points = recPoints; - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Calculate the points for a quadratic bezier curve. (helper function..) - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c - * - * @static - * @private - * @method quadraticBezierCurve - * @param fromX {Number} Origin point x - * @param fromY {Number} Origin point x - * @param cpX {Number} Control point x - * @param cpY {Number} Control point y - * @param toX {Number} Destination point x - * @param toY {Number} Destination point y - * @return {Array(Number)} - */ -PIXI.WebGLGraphics.quadraticBezierCurve = function(fromX, fromY, cpX, cpY, toX, toY) { - - var xa, - ya, - xb, - yb, - x, - y, - n = 20, - points = []; - - function getPt(n1 , n2, perc) { - var diff = n2 - n1; - - return n1 + ( diff * perc ); - } - - var j = 0; - for (var i = 0; i <= n; i++ ) - { - j = i / n; - - // The Green Line - xa = getPt( fromX , cpX , j ); - ya = getPt( fromY , cpY , j ); - xb = getPt( cpX , toX , j ); - yb = getPt( cpY , toY , j ); - - // The Black Dot - x = getPt( xa , xb , j ); - y = getPt( ya , yb , j ); - - points.push(x, y); - } - return points; -}; - -/** - * Builds a circle to draw - * - * @static - * @private - * @method buildCircle - * @param graphicsData {Graphics} The graphics object to draw - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildCircle = function(graphicsData, webGLData) -{ - // need to convert points to a nice regular data - var circleData = graphicsData.shape; - var x = circleData.x; - var y = circleData.y; - var width; - var height; - - // TODO - bit hacky?? - if(graphicsData.type === PIXI.Graphics.CIRC) - { - width = circleData.radius; - height = circleData.radius; - } - else - { - width = circleData.width; - height = circleData.height; - } - - var totalSegs = 40; - var seg = (Math.PI * 2) / totalSegs ; - - var i = 0; - - if(graphicsData.fill) - { - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vecPos = verts.length/6; - - indices.push(vecPos); - - for (i = 0; i < totalSegs + 1 ; i++) - { - verts.push(x,y, r, g, b, alpha); - - verts.push(x + Math.sin(seg * i) * width, - y + Math.cos(seg * i) * height, - r, g, b, alpha); - - indices.push(vecPos++, vecPos++); - } - - indices.push(vecPos-1); - } - - if(graphicsData.lineWidth) - { - var tempPoints = graphicsData.points; - - graphicsData.points = []; - - for (i = 0; i < totalSegs + 1; i++) - { - graphicsData.points.push(x + Math.sin(seg * i) * width, - y + Math.cos(seg * i) * height); - } - - PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); - - graphicsData.points = tempPoints; - } -}; - -/** - * Builds a line to draw - * - * @static - * @private - * @method buildLine - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildLine = function(graphicsData, webGLData) -{ - // TODO OPTIMISE! - var i = 0; - var points = graphicsData.points; - if(points.length === 0)return; - - // if the line width is an odd number add 0.5 to align to a whole pixel - if(graphicsData.lineWidth%2) - { - for (i = 0; i < points.length; i++) { - points[i] += 0.5; - } - } - - // get first and last point.. figure out the middle! - var firstPoint = new PIXI.Point( points[0], points[1] ); - var lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); - - // if the first point is the last point - gonna have issues :) - if(firstPoint.x === lastPoint.x && firstPoint.y === lastPoint.y) - { - // need to clone as we are going to slightly modify the shape.. - points = points.slice(); - - points.pop(); - points.pop(); - - lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); - - var midPointX = lastPoint.x + (firstPoint.x - lastPoint.x) *0.5; - var midPointY = lastPoint.y + (firstPoint.y - lastPoint.y) *0.5; - - points.unshift(midPointX, midPointY); - points.push(midPointX, midPointY); - } - - var verts = webGLData.points; - var indices = webGLData.indices; - var length = points.length / 2; - var indexCount = points.length; - var indexStart = verts.length/6; - - // DRAW the Line - var width = graphicsData.lineWidth / 2; - - // sort color - var color = PIXI.hex2rgb(graphicsData.lineColor); - var alpha = graphicsData.lineAlpha; - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var px, py, p1x, p1y, p2x, p2y, p3x, p3y; - var perpx, perpy, perp2x, perp2y, perp3x, perp3y; - var a1, b1, c1, a2, b2, c2; - var denom, pdist, dist; - - p1x = points[0]; - p1y = points[1]; - - p2x = points[2]; - p2y = points[3]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - // start - verts.push(p1x - perpx , p1y - perpy, - r, g, b, alpha); - - verts.push(p1x + perpx , p1y + perpy, - r, g, b, alpha); - - for (i = 1; i < length-1; i++) - { - p1x = points[(i-1)*2]; - p1y = points[(i-1)*2 + 1]; - - p2x = points[(i)*2]; - p2y = points[(i)*2 + 1]; - - p3x = points[(i+1)*2]; - p3y = points[(i+1)*2 + 1]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - perp2x = -(p2y - p3y); - perp2y = p2x - p3x; - - dist = Math.sqrt(perp2x*perp2x + perp2y*perp2y); - perp2x /= dist; - perp2y /= dist; - perp2x *= width; - perp2y *= width; - - a1 = (-perpy + p1y) - (-perpy + p2y); - b1 = (-perpx + p2x) - (-perpx + p1x); - c1 = (-perpx + p1x) * (-perpy + p2y) - (-perpx + p2x) * (-perpy + p1y); - a2 = (-perp2y + p3y) - (-perp2y + p2y); - b2 = (-perp2x + p2x) - (-perp2x + p3x); - c2 = (-perp2x + p3x) * (-perp2y + p2y) - (-perp2x + p2x) * (-perp2y + p3y); - - denom = a1*b2 - a2*b1; - - if(Math.abs(denom) < 0.1 ) - { - - denom+=10.1; - verts.push(p2x - perpx , p2y - perpy, - r, g, b, alpha); - - verts.push(p2x + perpx , p2y + perpy, - r, g, b, alpha); - - continue; - } - - px = (b1*c2 - b2*c1)/denom; - py = (a2*c1 - a1*c2)/denom; - - - pdist = (px -p2x) * (px -p2x) + (py -p2y) + (py -p2y); - - - if(pdist > 140 * 140) - { - perp3x = perpx - perp2x; - perp3y = perpy - perp2y; - - dist = Math.sqrt(perp3x*perp3x + perp3y*perp3y); - perp3x /= dist; - perp3y /= dist; - perp3x *= width; - perp3y *= width; - - verts.push(p2x - perp3x, p2y -perp3y); - verts.push(r, g, b, alpha); - - verts.push(p2x + perp3x, p2y +perp3y); - verts.push(r, g, b, alpha); - - verts.push(p2x - perp3x, p2y -perp3y); - verts.push(r, g, b, alpha); - - indexCount++; - } - else - { - - verts.push(px , py); - verts.push(r, g, b, alpha); - - verts.push(p2x - (px-p2x), p2y - (py - p2y)); - verts.push(r, g, b, alpha); - } - } - - p1x = points[(length-2)*2]; - p1y = points[(length-2)*2 + 1]; - - p2x = points[(length-1)*2]; - p2y = points[(length-1)*2 + 1]; - - perpx = -(p1y - p2y); - perpy = p1x - p2x; - - dist = Math.sqrt(perpx*perpx + perpy*perpy); - perpx /= dist; - perpy /= dist; - perpx *= width; - perpy *= width; - - verts.push(p2x - perpx , p2y - perpy); - verts.push(r, g, b, alpha); - - verts.push(p2x + perpx , p2y + perpy); - verts.push(r, g, b, alpha); - - indices.push(indexStart); - - for (i = 0; i < indexCount; i++) - { - indices.push(indexStart++); - } - - indices.push(indexStart-1); -}; - -/** - * Builds a complex polygon to draw - * - * @static - * @private - * @method buildComplexPoly - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildComplexPoly = function(graphicsData, webGLData) -{ - //TODO - no need to copy this as it gets turned into a FLoat32Array anyways.. - var points = graphicsData.points.slice(); - if(points.length < 6)return; - - // get first and last point.. figure out the middle! - var indices = webGLData.indices; - webGLData.points = points; - webGLData.alpha = graphicsData.fillAlpha; - webGLData.color = PIXI.hex2rgb(graphicsData.fillColor); - - /* - calclate the bounds.. - */ - var minX = Infinity; - var maxX = -Infinity; - - var minY = Infinity; - var maxY = -Infinity; - - var x,y; - - // get size.. - for (var i = 0; i < points.length; i+=2) - { - x = points[i]; - y = points[i+1]; - - minX = x < minX ? x : minX; - maxX = x > maxX ? x : maxX; - - minY = y < minY ? y : minY; - maxY = y > maxY ? y : maxY; - } - - // add a quad to the end cos there is no point making another buffer! - points.push(minX, minY, - maxX, minY, - maxX, maxY, - minX, maxY); - - // push a quad onto the end.. - - //TODO - this aint needed! - var length = points.length / 2; - for (i = 0; i < length; i++) - { - indices.push( i ); - } - -}; - -/** - * Builds a polygon to draw - * - * @static - * @private - * @method buildPoly - * @param graphicsData {Graphics} The graphics object containing all the necessary properties - * @param webGLData {Object} - */ -PIXI.WebGLGraphics.buildPoly = function(graphicsData, webGLData) -{ - var points = graphicsData.points; - - if(points.length < 6)return; - // get first and last point.. figure out the middle! - var verts = webGLData.points; - var indices = webGLData.indices; - - var length = points.length / 2; - - // sort color - var color = PIXI.hex2rgb(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var triangles = PIXI.PolyK.Triangulate(points); - - if(!triangles)return false; - - var vertPos = verts.length / 6; - - var i = 0; - - for (i = 0; i < triangles.length; i+=3) - { - indices.push(triangles[i] + vertPos); - indices.push(triangles[i] + vertPos); - indices.push(triangles[i+1] + vertPos); - indices.push(triangles[i+2] +vertPos); - indices.push(triangles[i+2] + vertPos); - } - - for (i = 0; i < length; i++) - { - verts.push(points[i * 2], points[i * 2 + 1], - r, g, b, alpha); - } - - return true; -}; - -PIXI.WebGLGraphics.graphicsDataPool = []; - -/** - * @class WebGLGraphicsData - * @private - * @static - */ -PIXI.WebGLGraphicsData = function(gl) -{ - this.gl = gl; - - //TODO does this need to be split before uploding?? - this.color = [0,0,0]; // color split! - this.points = []; - this.indices = []; - this.buffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - this.mode = 1; - this.alpha = 1; - this.dirty = true; -}; - -/** - * @method reset - */ -PIXI.WebGLGraphicsData.prototype.reset = function() -{ - this.points = []; - this.indices = []; -}; - -/** - * @method upload - */ -PIXI.WebGLGraphicsData.prototype.upload = function() -{ - var gl = this.gl; - -// this.lastIndex = graphics.graphicsData.length; - this.glPoints = new PIXI.Float32Array(this.points); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer); - gl.bufferData(gl.ARRAY_BUFFER, this.glPoints, gl.STATIC_DRAW); - - this.glIndicies = new PIXI.Uint16Array(this.indices); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.glIndicies, gl.STATIC_DRAW); - - this.dirty = false; -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLMaskManager.js b/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLMaskManager.js deleted file mode 100755 index 607d5dd..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLMaskManager.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLMaskManager -* @constructor -* @private -*/ -PIXI.WebGLMaskManager = function() -{ -}; - -PIXI.WebGLMaskManager.prototype.constructor = PIXI.WebGLMaskManager; - -/** -* Sets the drawing context to the one given in parameter. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLMaskManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Applies the Mask and adds it to the current filter stack. -* -* @method pushMask -* @param maskData {Array} -* @param renderSession {Object} -*/ -PIXI.WebGLMaskManager.prototype.pushMask = function(maskData, renderSession) -{ - var gl = renderSession.gl; - - if(maskData.dirty) - { - PIXI.WebGLGraphics.updateGraphics(maskData, gl); - } - - if(!maskData._webGL[gl.id].data.length)return; - - renderSession.stencilManager.pushStencil(maskData, maskData._webGL[gl.id].data[0], renderSession); -}; - -/** -* Removes the last filter from the filter stack and doesn't return it. -* -* @method popMask -* @param maskData {Array} -* @param renderSession {Object} an object containing all the useful parameters -*/ -PIXI.WebGLMaskManager.prototype.popMask = function(maskData, renderSession) -{ - var gl = this.gl; - renderSession.stencilManager.popStencil(maskData, maskData._webGL[gl.id].data[0], renderSession); -}; - -/** -* Destroys the mask stack. -* -* @method destroy -*/ -PIXI.WebGLMaskManager.prototype.destroy = function() -{ - this.gl = null; -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderManager.js b/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderManager.js deleted file mode 100755 index a15974e..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderManager.js +++ /dev/null @@ -1,157 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLShaderManager -* @constructor -* @private -*/ -PIXI.WebGLShaderManager = function() -{ - /** - * @property maxAttibs - * @type Number - */ - this.maxAttibs = 10; - - /** - * @property attribState - * @type Array - */ - this.attribState = []; - - /** - * @property tempAttribState - * @type Array - */ - this.tempAttribState = []; - - for (var i = 0; i < this.maxAttibs; i++) - { - this.attribState[i] = false; - } - - /** - * @property stack - * @type Array - */ - this.stack = []; - -}; - -PIXI.WebGLShaderManager.prototype.constructor = PIXI.WebGLShaderManager; - -/** -* Initialises the context and the properties. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLShaderManager.prototype.setContext = function(gl) -{ - this.gl = gl; - - // the next one is used for rendering primitives - this.primitiveShader = new PIXI.PrimitiveShader(gl); - - // the next one is used for rendering triangle strips - this.complexPrimitiveShader = new PIXI.ComplexPrimitiveShader(gl); - - // this shader is used for the default sprite rendering - this.defaultShader = new PIXI.PixiShader(gl); - - // this shader is used for the fast sprite rendering - this.fastShader = new PIXI.PixiFastShader(gl); - - // the next one is used for rendering triangle strips - this.stripShader = new PIXI.StripShader(gl); - this.setShader(this.defaultShader); -}; - -/** -* Takes the attributes given in parameters. -* -* @method setAttribs -* @param attribs {Array} attribs -*/ -PIXI.WebGLShaderManager.prototype.setAttribs = function(attribs) -{ - // reset temp state - var i; - - for (i = 0; i < this.tempAttribState.length; i++) - { - this.tempAttribState[i] = false; - } - - // set the new attribs - for (i = 0; i < attribs.length; i++) - { - var attribId = attribs[i]; - this.tempAttribState[attribId] = true; - } - - var gl = this.gl; - - for (i = 0; i < this.attribState.length; i++) - { - if(this.attribState[i] !== this.tempAttribState[i]) - { - this.attribState[i] = this.tempAttribState[i]; - - if(this.tempAttribState[i]) - { - gl.enableVertexAttribArray(i); - } - else - { - gl.disableVertexAttribArray(i); - } - } - } -}; - -/** -* Sets the current shader. -* -* @method setShader -* @param shader {Any} -*/ -PIXI.WebGLShaderManager.prototype.setShader = function(shader) -{ - if(this._currentId === shader._UID)return false; - - this._currentId = shader._UID; - - this.currentShader = shader; - - this.gl.useProgram(shader.program); - this.setAttribs(shader.attributes); - - return true; -}; - -/** -* Destroys this object. -* -* @method destroy -*/ -PIXI.WebGLShaderManager.prototype.destroy = function() -{ - this.attribState = null; - - this.tempAttribState = null; - - this.primitiveShader.destroy(); - - this.complexPrimitiveShader.destroy(); - - this.defaultShader.destroy(); - - this.fastShader.destroy(); - - this.stripShader.destroy(); - - this.gl = null; -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderUtils.js b/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderUtils.js deleted file mode 100755 index a7d7826..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLShaderUtils.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @method initDefaultShaders -* @static -* @private -*/ -PIXI.initDefaultShaders = function() -{ -}; - -/** -* @method CompileVertexShader -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @return {Any} -*/ -PIXI.CompileVertexShader = function(gl, shaderSrc) -{ - return PIXI._CompileShader(gl, shaderSrc, gl.VERTEX_SHADER); -}; - -/** -* @method CompileFragmentShader -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @return {Any} -*/ -PIXI.CompileFragmentShader = function(gl, shaderSrc) -{ - return PIXI._CompileShader(gl, shaderSrc, gl.FRAGMENT_SHADER); -}; - -/** -* @method _CompileShader -* @static -* @private -* @param gl {WebGLContext} the current WebGL drawing context -* @param shaderSrc {Array} -* @param shaderType {Number} -* @return {Any} -*/ -PIXI._CompileShader = function(gl, shaderSrc, shaderType) -{ - var src = shaderSrc.join("\n"); - var shader = gl.createShader(shaderType); - gl.shaderSource(shader, src); - gl.compileShader(shader); - - if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) - { - window.console.log(gl.getShaderInfoLog(shader)); - return null; - } - - return shader; -}; - -/** -* @method compileProgram -* @static -* @param gl {WebGLContext} the current WebGL drawing context -* @param vertexSrc {Array} -* @param fragmentSrc {Array} -* @return {Any} -*/ -PIXI.compileProgram = function(gl, vertexSrc, fragmentSrc) -{ - var fragmentShader = PIXI.CompileFragmentShader(gl, fragmentSrc); - var vertexShader = PIXI.CompileVertexShader(gl, vertexSrc); - - var shaderProgram = gl.createProgram(); - - gl.attachShader(shaderProgram, vertexShader); - gl.attachShader(shaderProgram, fragmentShader); - gl.linkProgram(shaderProgram); - - if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) - { - window.console.log("Could not initialise shaders"); - } - - return shaderProgram; -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js b/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js deleted file mode 100755 index 711b4da..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js +++ /dev/null @@ -1,635 +0,0 @@ -/** - * @author Mat Groves - * - * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ - * for creating the original pixi version! - * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now share 4 bytes on the vertex buffer - * - * Heavily inspired by LibGDX's WebGLSpriteBatch: - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java - */ - - /** - * - * @class WebGLSpriteBatch - * @private - * @constructor - */ -PIXI.WebGLSpriteBatch = function() -{ - /** - * @property vertSize - * @type Number - */ - this.vertSize = 5; - - /** - * The number of images in the SpriteBatch before it flushes - * @property size - * @type Number - */ - this.size = 2000;//Math.pow(2, 16) / this.vertSize; - - //the total number of bytes in our batch - var numVerts = this.size * 4 * 4 * this.vertSize; - //the total number of indices in our batch - var numIndices = this.size * 6; - - /** - * Holds the vertices - * - * @property vertices - * @type ArrayBuffer - */ - this.vertices = new PIXI.ArrayBuffer(numVerts); - - /** - * View on the vertices as a Float32Array - * - * @property positions - * @type Float32Array - */ - this.positions = new PIXI.Float32Array(this.vertices); - - /** - * View on the vertices as a Uint32Array - * - * @property colors - * @type Uint32Array - */ - this.colors = new PIXI.Uint32Array(this.vertices); - - /** - * Holds the indices - * - * @property indices - * @type Uint16Array - */ - this.indices = new PIXI.Uint16Array(numIndices); - - /** - * @property lastIndexCount - * @type Number - */ - this.lastIndexCount = 0; - - for (var i=0, j=0; i < numIndices; i += 6, j += 4) - { - this.indices[i + 0] = j + 0; - this.indices[i + 1] = j + 1; - this.indices[i + 2] = j + 2; - this.indices[i + 3] = j + 0; - this.indices[i + 4] = j + 2; - this.indices[i + 5] = j + 3; - } - - /** - * @property drawing - * @type Boolean - */ - this.drawing = false; - - /** - * @property currentBatchSize - * @type Number - */ - this.currentBatchSize = 0; - - /** - * @property currentBaseTexture - * @type BaseTexture - */ - this.currentBaseTexture = null; - - /** - * @property dirty - * @type Boolean - */ - this.dirty = true; - - /** - * @property textures - * @type Array - */ - this.textures = []; - - /** - * @property blendModes - * @type Array - */ - this.blendModes = []; - - /** - * @property shaders - * @type Array - */ - this.shaders = []; - - /** - * @property sprites - * @type Array - */ - this.sprites = []; - - /** - * @property defaultShader - * @type AbstractFilter - */ - this.defaultShader = new PIXI.AbstractFilter([ - 'precision lowp float;', - 'varying vec2 vTextureCoord;', - 'varying vec4 vColor;', - 'uniform sampler2D uSampler;', - 'void main(void) {', - ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;', - '}' - ]); -}; - -/** -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLSpriteBatch.prototype.setContext = function(gl) -{ - this.gl = gl; - - // create a couple of buffers - this.vertexBuffer = gl.createBuffer(); - this.indexBuffer = gl.createBuffer(); - - // 65535 is max index, so 65535 / 6 = 10922. - - //upload the index data - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW); - - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW); - - this.currentBlendMode = 99999; - - var shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc = this.defaultShader.fragmentSrc; - shader.uniforms = {}; - shader.init(); - - this.defaultShader.shaders[gl.id] = shader; -}; - -/** -* @method begin -* @param renderSession {Object} The RenderSession object -*/ -PIXI.WebGLSpriteBatch.prototype.begin = function(renderSession) -{ - this.renderSession = renderSession; - this.shader = this.renderSession.shaderManager.defaultShader; - - this.start(); -}; - -/** -* @method end -*/ -PIXI.WebGLSpriteBatch.prototype.end = function() -{ - this.flush(); -}; - -/** -* @method render -* @param sprite {Sprite} the sprite to render when using this spritebatch -*/ -PIXI.WebGLSpriteBatch.prototype.render = function(sprite) -{ - var texture = sprite.texture; - - //TODO set blend modes.. - // check texture.. - if(this.currentBatchSize >= this.size) - { - this.flush(); - this.currentBaseTexture = texture.baseTexture; - } - - // get the uvs for the texture - var uvs = texture._uvs; - // if the uvs have not updated then no point rendering just yet! - if(!uvs)return; - - // TODO trim?? - var aX = sprite.anchor.x; - var aY = sprite.anchor.y; - - var w0, w1, h0, h1; - - if (texture.trim) - { - // if the sprite is trimmed then we need to add the extra space before transforming the sprite coords.. - var trim = texture.trim; - - w1 = trim.x - aX * trim.width; - w0 = w1 + texture.crop.width; - - h1 = trim.y - aY * trim.height; - h0 = h1 + texture.crop.height; - - } - else - { - w0 = (texture.frame.width ) * (1-aX); - w1 = (texture.frame.width ) * -aX; - - h0 = texture.frame.height * (1-aY); - h1 = texture.frame.height * -aY; - } - - var index = this.currentBatchSize * 4 * this.vertSize; - - var resolution = texture.baseTexture.resolution; - - var worldTransform = sprite.worldTransform; - - var a = worldTransform.a / resolution; - var b = worldTransform.b / resolution; - var c = worldTransform.c / resolution; - var d = worldTransform.d / resolution; - var tx = worldTransform.tx; - var ty = worldTransform.ty; - - var colors = this.colors; - var positions = this.positions; - - if(this.renderSession.roundPixels) - { - // xy - positions[index] = a * w1 + c * h1 + tx | 0; - positions[index+1] = d * h1 + b * w1 + ty | 0; - - // xy - positions[index+5] = a * w0 + c * h1 + tx | 0; - positions[index+6] = d * h1 + b * w0 + ty | 0; - - // xy - positions[index+10] = a * w0 + c * h0 + tx | 0; - positions[index+11] = d * h0 + b * w0 + ty | 0; - - // xy - positions[index+15] = a * w1 + c * h0 + tx | 0; - positions[index+16] = d * h0 + b * w1 + ty | 0; - } - else - { - // xy - positions[index] = a * w1 + c * h1 + tx; - positions[index+1] = d * h1 + b * w1 + ty; - - // xy - positions[index+5] = a * w0 + c * h1 + tx; - positions[index+6] = d * h1 + b * w0 + ty; - - // xy - positions[index+10] = a * w0 + c * h0 + tx; - positions[index+11] = d * h0 + b * w0 + ty; - - // xy - positions[index+15] = a * w1 + c * h0 + tx; - positions[index+16] = d * h0 + b * w1 + ty; - } - - // uv - positions[index+2] = uvs.x0; - positions[index+3] = uvs.y0; - - // uv - positions[index+7] = uvs.x1; - positions[index+8] = uvs.y1; - - // uv - positions[index+12] = uvs.x2; - positions[index+13] = uvs.y2; - - // uv - positions[index+17] = uvs.x3; - positions[index+18] = uvs.y3; - - // color and alpha - var tint = sprite.tint; - colors[index+4] = colors[index+9] = colors[index+14] = colors[index+19] = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16) + (sprite.worldAlpha * 255 << 24); - - // increment the batchsize - this.sprites[this.currentBatchSize++] = sprite; - - -}; - -/** -* Renders a TilingSprite using the spriteBatch. -* -* @method renderTilingSprite -* @param sprite {TilingSprite} the tilingSprite to render -*/ -PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite) -{ - var texture = tilingSprite.tilingTexture; - - // check texture.. - if(this.currentBatchSize >= this.size) - { - //return; - this.flush(); - this.currentBaseTexture = texture.baseTexture; - } - - // set the textures uvs temporarily - // TODO create a separate texture so that we can tile part of a texture - - if(!tilingSprite._uvs)tilingSprite._uvs = new PIXI.TextureUvs(); - - var uvs = tilingSprite._uvs; - - tilingSprite.tilePosition.x %= texture.baseTexture.width * tilingSprite.tileScaleOffset.x; - tilingSprite.tilePosition.y %= texture.baseTexture.height * tilingSprite.tileScaleOffset.y; - - var offsetX = tilingSprite.tilePosition.x/(texture.baseTexture.width*tilingSprite.tileScaleOffset.x); - var offsetY = tilingSprite.tilePosition.y/(texture.baseTexture.height*tilingSprite.tileScaleOffset.y); - - var scaleX = (tilingSprite.width / texture.baseTexture.width) / (tilingSprite.tileScale.x * tilingSprite.tileScaleOffset.x); - var scaleY = (tilingSprite.height / texture.baseTexture.height) / (tilingSprite.tileScale.y * tilingSprite.tileScaleOffset.y); - - uvs.x0 = 0 - offsetX; - uvs.y0 = 0 - offsetY; - - uvs.x1 = (1 * scaleX) - offsetX; - uvs.y1 = 0 - offsetY; - - uvs.x2 = (1 * scaleX) - offsetX; - uvs.y2 = (1 * scaleY) - offsetY; - - uvs.x3 = 0 - offsetX; - uvs.y3 = (1 * scaleY) - offsetY; - - // get the tilingSprites current alpha and tint and combining them into a single color - var tint = tilingSprite.tint; - var color = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16) + (tilingSprite.alpha * 255 << 24); - - var positions = this.positions; - var colors = this.colors; - - var width = tilingSprite.width; - var height = tilingSprite.height; - - // TODO trim?? - var aX = tilingSprite.anchor.x; - var aY = tilingSprite.anchor.y; - var w0 = width * (1-aX); - var w1 = width * -aX; - - var h0 = height * (1-aY); - var h1 = height * -aY; - - var index = this.currentBatchSize * 4 * this.vertSize; - - var resolution = texture.baseTexture.resolution; - - var worldTransform = tilingSprite.worldTransform; - - var a = worldTransform.a / resolution;//[0]; - var b = worldTransform.b / resolution;//[3]; - var c = worldTransform.c / resolution;//[1]; - var d = worldTransform.d / resolution;//[4]; - var tx = worldTransform.tx;//[2]; - var ty = worldTransform.ty;//[5]; - - // xy - positions[index++] = a * w1 + c * h1 + tx; - positions[index++] = d * h1 + b * w1 + ty; - // uv - positions[index++] = uvs.x0; - positions[index++] = uvs.y0; - // color - colors[index++] = color; - - // xy - positions[index++] = (a * w0 + c * h1 + tx); - positions[index++] = d * h1 + b * w0 + ty; - // uv - positions[index++] = uvs.x1; - positions[index++] = uvs.y1; - // color - colors[index++] = color; - - // xy - positions[index++] = a * w0 + c * h0 + tx; - positions[index++] = d * h0 + b * w0 + ty; - // uv - positions[index++] = uvs.x2; - positions[index++] = uvs.y2; - // color - colors[index++] = color; - - // xy - positions[index++] = a * w1 + c * h0 + tx; - positions[index++] = d * h0 + b * w1 + ty; - // uv - positions[index++] = uvs.x3; - positions[index++] = uvs.y3; - // color - colors[index++] = color; - - // increment the batchsize - this.sprites[this.currentBatchSize++] = tilingSprite; -}; - -/** -* Renders the content and empties the current batch. -* -* @method flush -*/ -PIXI.WebGLSpriteBatch.prototype.flush = function() -{ - // If the batch is length 0 then return as there is nothing to draw - if (this.currentBatchSize===0)return; - - var gl = this.gl; - var shader; - - if(this.dirty) - { - this.dirty = false; - // bind the main texture - gl.activeTexture(gl.TEXTURE0); - - // bind the buffers - gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer); - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); - - shader = this.defaultShader.shaders[gl.id]; - - // this is the same for each shader? - var stride = this.vertSize * 4; - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0); - gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, stride, 2 * 4); - - // color attributes will be interpreted as unsigned bytes and normalized - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.UNSIGNED_BYTE, true, stride, 4 * 4); - } - - // upload the verts to the buffer - if(this.currentBatchSize > ( this.size * 0.5 ) ) - { - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); - } - else - { - var view = this.positions.subarray(0, this.currentBatchSize * 4 * this.vertSize); - gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); - } - - var nextTexture, nextBlendMode, nextShader; - var batchSize = 0; - var start = 0; - - var currentBaseTexture = null; - var currentBlendMode = this.renderSession.blendModeManager.currentBlendMode; - var currentShader = null; - - var blendSwap = false; - var shaderSwap = false; - var sprite; - - for (var i = 0, j = this.currentBatchSize; i < j; i++) { - - sprite = this.sprites[i]; - - nextTexture = sprite.texture.baseTexture; - nextBlendMode = sprite.blendMode; - nextShader = sprite.shader || this.defaultShader; - - blendSwap = currentBlendMode !== nextBlendMode; - shaderSwap = currentShader !== nextShader; // should I use _UIDS??? - - if(currentBaseTexture !== nextTexture || blendSwap || shaderSwap) - { - this.renderBatch(currentBaseTexture, batchSize, start); - - start = i; - batchSize = 0; - currentBaseTexture = nextTexture; - - if( blendSwap ) - { - currentBlendMode = nextBlendMode; - this.renderSession.blendModeManager.setBlendMode( currentBlendMode ); - } - - if( shaderSwap ) - { - currentShader = nextShader; - - shader = currentShader.shaders[gl.id]; - - if(!shader) - { - shader = new PIXI.PixiShader(gl); - - shader.fragmentSrc =currentShader.fragmentSrc; - shader.uniforms =currentShader.uniforms; - shader.init(); - - currentShader.shaders[gl.id] = shader; - } - - // set shader function??? - this.renderSession.shaderManager.setShader(shader); - - if(shader.dirty)shader.syncUniforms(); - - // both thease only need to be set if they are changing.. - // set the projection - var projection = this.renderSession.projection; - gl.uniform2f(shader.projectionVector, projection.x, projection.y); - - // TODO - this is temprorary! - var offsetVector = this.renderSession.offset; - gl.uniform2f(shader.offsetVector, offsetVector.x, offsetVector.y); - - // set the pointers - } - } - - batchSize++; - } - - this.renderBatch(currentBaseTexture, batchSize, start); - - // then reset the batch! - this.currentBatchSize = 0; -}; - -/** -* @method renderBatch -* @param texture {Texture} -* @param size {Number} -* @param startIndex {Number} -*/ -PIXI.WebGLSpriteBatch.prototype.renderBatch = function(texture, size, startIndex) -{ - if(size === 0)return; - - var gl = this.gl; - - // check if a texture is dirty.. - if(texture._dirty[gl.id]) - { - this.renderSession.renderer.updateTexture(texture); - } - else - { - // bind the current texture - gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]); - } - - // now draw those suckas! - gl.drawElements(gl.TRIANGLES, size * 6, gl.UNSIGNED_SHORT, startIndex * 6 * 2); - - // increment the draw count - this.renderSession.drawCount++; -}; - -/** -* @method stop -*/ -PIXI.WebGLSpriteBatch.prototype.stop = function() -{ - this.flush(); - this.dirty = true; -}; - -/** -* @method start -*/ -PIXI.WebGLSpriteBatch.prototype.start = function() -{ - this.dirty = true; -}; - -/** -* Destroys the SpriteBatch. -* -* @method destroy -*/ -PIXI.WebGLSpriteBatch.prototype.destroy = function() -{ - this.vertices = null; - this.indices = null; - - this.gl.deleteBuffer( this.vertexBuffer ); - this.gl.deleteBuffer( this.indexBuffer ); - - this.currentBaseTexture = null; - - this.gl = null; -}; \ No newline at end of file diff --git a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLStencilManager.js b/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLStencilManager.js deleted file mode 100755 index 989d8cf..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/renderers/webgl/utils/WebGLStencilManager.js +++ /dev/null @@ -1,297 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** -* @class WebGLStencilManager -* @constructor -* @private -*/ -PIXI.WebGLStencilManager = function() -{ - this.stencilStack = []; - this.reverse = true; - this.count = 0; -}; - -/** -* Sets the drawing context to the one given in parameter. -* -* @method setContext -* @param gl {WebGLContext} the current WebGL drawing context -*/ -PIXI.WebGLStencilManager.prototype.setContext = function(gl) -{ - this.gl = gl; -}; - -/** -* Applies the Mask and adds it to the current filter stack. -* -* @method pushMask -* @param graphics {Graphics} -* @param webGLData {Array} -* @param renderSession {Object} -*/ -PIXI.WebGLStencilManager.prototype.pushStencil = function(graphics, webGLData, renderSession) -{ - var gl = this.gl; - this.bindGraphics(graphics, webGLData, renderSession); - - if(this.stencilStack.length === 0) - { - gl.enable(gl.STENCIL_TEST); - gl.clear(gl.STENCIL_BUFFER_BIT); - this.reverse = true; - this.count = 0; - } - - this.stencilStack.push(webGLData); - - var level = this.count; - - gl.colorMask(false, false, false, false); - - gl.stencilFunc(gl.ALWAYS,0,0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT); - - // draw the triangle strip! - - if(webGLData.mode === 1) - { - gl.drawElements(gl.TRIANGLE_FAN, webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 ); - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - - // draw a quad to increment.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - } - - this.reverse = !this.reverse; - } - else - { - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level+1), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - } - } - - gl.colorMask(true, true, true, true); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP); - - this.count++; -}; - -/** - * TODO this does not belong here! - * - * @method bindGraphics - * @param graphics {Graphics} - * @param webGLData {Array} - * @param renderSession {Object} - */ -PIXI.WebGLStencilManager.prototype.bindGraphics = function(graphics, webGLData, renderSession) -{ - //if(this._currentGraphics === graphics)return; - this._currentGraphics = graphics; - - var gl = this.gl; - - // bind the graphics object.. - var projection = renderSession.projection, - offset = renderSession.offset, - shader;// = renderSession.shaderManager.primitiveShader; - - if(webGLData.mode === 1) - { - shader = renderSession.shaderManager.complexPrimitiveShader; - - renderSession.shaderManager.setShader( shader ); - - gl.uniform1f(shader.flipY, renderSession.flipY); - - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - gl.uniform3fv(shader.color, webGLData.color); - - gl.uniform1f(shader.alpha, graphics.worldAlpha * webGLData.alpha); - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 2, 0); - - - // now do the rest.. - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - } - else - { - //renderSession.shaderManager.activatePrimitiveShader(); - shader = renderSession.shaderManager.primitiveShader; - renderSession.shaderManager.setShader( shader ); - - gl.uniformMatrix3fv(shader.translationMatrix, false, graphics.worldTransform.toArray(true)); - - gl.uniform1f(shader.flipY, renderSession.flipY); - gl.uniform2f(shader.projectionVector, projection.x, -projection.y); - gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); - - gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); - - gl.uniform1f(shader.alpha, graphics.worldAlpha); - - gl.bindBuffer(gl.ARRAY_BUFFER, webGLData.buffer); - - gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0); - gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4); - - // set the index buffer! - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGLData.indexBuffer); - } -}; - -/** - * @method popStencil - * @param graphics {Graphics} - * @param webGLData {Array} - * @param renderSession {Object} - */ -PIXI.WebGLStencilManager.prototype.popStencil = function(graphics, webGLData, renderSession) -{ - var gl = this.gl; - this.stencilStack.pop(); - - this.count--; - - if(this.stencilStack.length === 0) - { - // the stack is empty! - gl.disable(gl.STENCIL_TEST); - - } - else - { - - var level = this.count; - - this.bindGraphics(graphics, webGLData, renderSession); - - gl.colorMask(false, false, false, false); - - if(webGLData.mode === 1) - { - this.reverse = !this.reverse; - - if(this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - - // draw a quad to increment.. - gl.drawElements(gl.TRIANGLE_FAN, 4, gl.UNSIGNED_SHORT, ( webGLData.indices.length - 4 ) * 2 ); - - gl.stencilFunc(gl.ALWAYS,0,0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INVERT); - - // draw the triangle strip! - gl.drawElements(gl.TRIANGLE_FAN, webGLData.indices.length - 4, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - } - - } - else - { - // console.log("<<>>") - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL, 0xFF - (level+1), 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR); - } - else - { - gl.stencilFunc(gl.EQUAL,level+1, 0xFF); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.DECR); - } - - gl.drawElements(gl.TRIANGLE_STRIP, webGLData.indices.length, gl.UNSIGNED_SHORT, 0 ); - - if(!this.reverse) - { - gl.stencilFunc(gl.EQUAL,0xFF-(level), 0xFF); - } - else - { - gl.stencilFunc(gl.EQUAL,level, 0xFF); - } - } - - gl.colorMask(true, true, true, true); - gl.stencilOp(gl.KEEP,gl.KEEP,gl.KEEP); - - - } -}; - -/** -* Destroys the mask stack. -* -* @method destroy -*/ -PIXI.WebGLStencilManager.prototype.destroy = function() -{ - this.stencilStack = null; - this.gl = null; -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/text/BitmapText.js b/tutorial-4/pixi.js-master/src/pixi/text/BitmapText.js deleted file mode 100755 index a1d20af..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/text/BitmapText.js +++ /dev/null @@ -1,215 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A BitmapText object will create a line or multiple lines of text using bitmap font. To split a line you can use '\n', '\r' or '\r\n' in your string. - * You can generate the fnt files using - * http://www.angelcode.com/products/bmfont/ for windows or - * http://www.bmglyph.com/ for mac. - * - * @class BitmapText - * @extends DisplayObjectContainer - * @constructor - * @param text {String} The copy that you would like the text to display - * @param style {Object} The style parameters - * @param style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously) - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - */ -PIXI.BitmapText = function(text, style) -{ - PIXI.DisplayObjectContainer.call(this); - - /** - * [read-only] The width of the overall text, different from fontSize, - * which is defined in the style object - * - * @property textWidth - * @type Number - * @readOnly - */ - this.textWidth = 0; - - /** - * [read-only] The height of the overall text, different from fontSize, - * which is defined in the style object - * - * @property textHeight - * @type Number - * @readOnly - */ - this.textHeight = 0; - - /** - * @property _pool - * @type Array - * @private - */ - this._pool = []; - - this.setText(text); - this.setStyle(style); - this.updateText(); - - /** - * The dirty state of this object. - * @property dirty - * @type Boolean - */ - this.dirty = false; -}; - -// constructor -PIXI.BitmapText.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); -PIXI.BitmapText.prototype.constructor = PIXI.BitmapText; - -/** - * Set the text string to be rendered. - * - * @method setText - * @param text {String} The text that you would like displayed - */ -PIXI.BitmapText.prototype.setText = function(text) -{ - this.text = text || ' '; - this.dirty = true; -}; - -/** - * Set the style of the text - * style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously) - * [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single lines of text - * - * @method setStyle - * @param style {Object} The style parameters, contained as properties of an object - */ -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; - this.tint = style.tint; -}; - -/** - * Renders text and updates it when needed - * - * @method updateText - * @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(/(?:\r\n|\r|\n)/.test(this.text.charAt(i))) - { - 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.kerning[prevCharCode]) - { - pos.x += charData.kerning[prevCharCode]; - } - - chars.push({texture:charData.texture, 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); - } - - var lenChildren = this.children.length; - var lenChars = chars.length; - var tint = this.tint || 0xFFFFFF; - - for(i = 0; i < lenChars; i++) - { - var c = i < lenChildren ? this.children[i] : this._pool.pop(); // get old child if have. if not - take from pool. - - if (c) c.setTexture(chars[i].texture); // check if got one before. - else c = new PIXI.Sprite(chars[i].texture); // if no create new one. - - c.position.x = (chars[i].position.x + lineAlignOffsets[chars[i].line]) * scale; - c.position.y = chars[i].position.y * scale; - c.scale.x = c.scale.y = scale; - c.tint = tint; - if (!c.parent) this.addChild(c); - } - - // remove unnecessary children. - // and put their into the pool. - while(this.children.length > lenChars) - { - var child = this.getChildAt(this.children.length - 1); - this._pool.push(child); - this.removeChild(child); - } - - this.textWidth = maxLineWidth * scale; - this.textHeight = (pos.y + data.lineHeight) * scale; -}; - -/** - * Updates the transform of this object - * - * @method updateTransform - * @private - */ -PIXI.BitmapText.prototype.updateTransform = function() -{ - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - PIXI.DisplayObjectContainer.prototype.updateTransform.call(this); -}; - -PIXI.BitmapText.fonts = {}; diff --git a/tutorial-4/pixi.js-master/src/pixi/text/Text.js b/tutorial-4/pixi.js-master/src/pixi/text/Text.js deleted file mode 100755 index b5a6e30..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/text/Text.js +++ /dev/null @@ -1,533 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * Modified by Tom Slezakowski http://www.tomslezakowski.com @TomSlezakowski (24/03/2014) - Added dropShadowColor. - */ - -/** - * A Text Object will create a line or multiple lines of text. To split a line you can use '\n' in your text string, - * or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object. - * - * @class Text - * @extends Sprite - * @constructor - * @param text {String} The copy that you would like the text to display - * @param [style] {Object} The style parameters - * @param [style.font] {String} default 'bold 20px Arial' The style and size of the font - * @param [style.fill='black'] {String|Number} A canvas fillstyle that will be used on the text e.g 'red', '#00FF00' - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - * @param [style.stroke] {String|Number} A canvas fillstyle that will be used on the text stroke e.g 'blue', '#FCFF00' - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke) - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap, it needs wordWrap to be set to true - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00' - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow - */ -PIXI.Text = function(text, style) -{ - /** - * The canvas element that everything is drawn to - * - * @property canvas - * @type HTMLCanvasElement - */ - this.canvas = document.createElement('canvas'); - - /** - * The canvas 2d context that everything is drawn with - * @property context - * @type CanvasRenderingContext2D - */ - this.context = this.canvas.getContext('2d'); - - /** - * The resolution of the canvas. - * @property resolution - * @type Number - */ - this.resolution = 1; - - PIXI.Sprite.call(this, PIXI.Texture.fromCanvas(this.canvas)); - - this.setText(text); - this.setStyle(style); - -}; - -// constructor -PIXI.Text.prototype = Object.create(PIXI.Sprite.prototype); -PIXI.Text.prototype.constructor = PIXI.Text; - -/** - * The width of the Text, setting this will actually modify the scale to achieve the value set - * - * @property width - * @type Number - */ -Object.defineProperty(PIXI.Text.prototype, 'width', { - get: function() { - - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - - return this.scale.x * this.texture.frame.width; - }, - set: function(value) { - this.scale.x = value / this.texture.frame.width; - this._width = value; - } -}); - -/** - * The height of the Text, setting this will actually modify the scale to achieve the value set - * - * @property height - * @type Number - */ -Object.defineProperty(PIXI.Text.prototype, 'height', { - get: function() { - - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - - return this.scale.y * this.texture.frame.height; - }, - set: function(value) { - this.scale.y = value / this.texture.frame.height; - this._height = value; - } -}); - -/** - * Set the style of the text - * - * @method setStyle - * @param [style] {Object} The style parameters - * @param [style.font='bold 20pt Arial'] {String} The style and size of the font - * @param [style.fill='black'] {Object} A canvas fillstyle that will be used on the text eg 'red', '#00FF00' - * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text - * @param [style.stroke='black'] {String} A canvas fillstyle that will be used on the text stroke eg 'blue', '#FCFF00' - * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke) - * @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used - * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap - * @param [style.dropShadow=false] {Boolean} Set a drop shadow for the text - * @param [style.dropShadowColor='#000000'] {String} A fill style to be used on the dropshadow e.g 'red', '#00FF00' - * @param [style.dropShadowAngle=Math.PI/4] {Number} Set a angle of the drop shadow - * @param [style.dropShadowDistance=5] {Number} Set a distance of the drop shadow - */ -PIXI.Text.prototype.setStyle = function(style) -{ - style = style || {}; - style.font = style.font || 'bold 20pt Arial'; - style.fill = style.fill || 'black'; - style.align = style.align || 'left'; - style.stroke = style.stroke || 'black'; //provide a default, see: https://github.com/GoodBoyDigital/pixi.js/issues/136 - style.strokeThickness = style.strokeThickness || 0; - style.wordWrap = style.wordWrap || false; - style.wordWrapWidth = style.wordWrapWidth || 100; - - style.dropShadow = style.dropShadow || false; - style.dropShadowAngle = style.dropShadowAngle || Math.PI / 6; - style.dropShadowDistance = style.dropShadowDistance || 4; - style.dropShadowColor = style.dropShadowColor || 'black'; - - this.style = style; - this.dirty = true; -}; - -/** - * Set the copy for the text object. To split a line you can use '\n'. - * - * @method setText - * @param text {String} The copy that you would like the text to display - */ -PIXI.Text.prototype.setText = function(text) -{ - this.text = text.toString() || ' '; - this.dirty = true; -}; - -/** - * Renders text and updates it when needed - * - * @method updateText - * @private - */ -PIXI.Text.prototype.updateText = function() -{ - this.texture.baseTexture.resolution = this.resolution; - - this.context.font = this.style.font; - - var outputText = this.text; - - // word wrap - // preserve original text - if(this.style.wordWrap)outputText = this.wordWrap(this.text); - - //split text into lines - var lines = outputText.split(/(?:\r\n|\r|\n)/); - - //calculate text width - var lineWidths = []; - var maxLineWidth = 0; - var fontProperties = this.determineFontProperties(this.style.font); - for (var i = 0; i < lines.length; i++) - { - var lineWidth = this.context.measureText(lines[i]).width; - lineWidths[i] = lineWidth; - maxLineWidth = Math.max(maxLineWidth, lineWidth); - } - - var width = maxLineWidth + this.style.strokeThickness; - if(this.style.dropShadow)width += this.style.dropShadowDistance; - - this.canvas.width = ( width + this.context.lineWidth ) * this.resolution; - - //calculate text height - var lineHeight = fontProperties.fontSize + this.style.strokeThickness; - - var height = lineHeight * lines.length; - if(this.style.dropShadow)height += this.style.dropShadowDistance; - - this.canvas.height = height * this.resolution; - - this.context.scale( this.resolution, this.resolution); - - if(navigator.isCocoonJS) this.context.clearRect(0,0,this.canvas.width,this.canvas.height); - - // used for debugging.. - //this.context.fillStyle ="#FF0000" - //this.context.fillRect(0, 0, this.canvas.width,this.canvas.height); - - this.context.font = this.style.font; - this.context.strokeStyle = this.style.stroke; - this.context.lineWidth = this.style.strokeThickness; - this.context.textBaseline = 'alphabetic'; - //this.context.lineJoin = 'round'; - - var linePositionX; - var linePositionY; - - if(this.style.dropShadow) - { - this.context.fillStyle = this.style.dropShadowColor; - - var xShadowOffset = Math.sin(this.style.dropShadowAngle) * this.style.dropShadowDistance; - var yShadowOffset = Math.cos(this.style.dropShadowAngle) * this.style.dropShadowDistance; - - for (i = 0; i < lines.length; i++) - { - linePositionX = this.style.strokeThickness / 2; - linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent; - - if(this.style.align === 'right') - { - linePositionX += maxLineWidth - lineWidths[i]; - } - else if(this.style.align === 'center') - { - linePositionX += (maxLineWidth - lineWidths[i]) / 2; - } - - if(this.style.fill) - { - this.context.fillText(lines[i], linePositionX + xShadowOffset, linePositionY + yShadowOffset); - } - - // if(dropShadow) - } - } - - //set canvas text styles - this.context.fillStyle = this.style.fill; - - //draw lines line by line - for (i = 0; i < lines.length; i++) - { - linePositionX = this.style.strokeThickness / 2; - linePositionY = (this.style.strokeThickness / 2 + i * lineHeight) + fontProperties.ascent; - - if(this.style.align === 'right') - { - linePositionX += maxLineWidth - lineWidths[i]; - } - else if(this.style.align === 'center') - { - linePositionX += (maxLineWidth - lineWidths[i]) / 2; - } - - if(this.style.stroke && this.style.strokeThickness) - { - this.context.strokeText(lines[i], linePositionX, linePositionY); - } - - if(this.style.fill) - { - this.context.fillText(lines[i], linePositionX, linePositionY); - } - - // if(dropShadow) - } - - this.updateTexture(); -}; - -/** - * Updates texture size based on canvas size - * - * @method updateTexture - * @private - */ -PIXI.Text.prototype.updateTexture = function() -{ - this.texture.baseTexture.width = this.canvas.width; - this.texture.baseTexture.height = this.canvas.height; - this.texture.crop.width = this.texture.frame.width = this.canvas.width; - this.texture.crop.height = this.texture.frame.height = this.canvas.height; - - this._width = this.canvas.width; - this._height = this.canvas.height; - - // update the dirty base textures - this.texture.baseTexture.dirty(); -}; - -/** -* Renders the object using the WebGL renderer -* -* @method _renderWebGL -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Text.prototype._renderWebGL = function(renderSession) -{ - if(this.dirty) - { - this.resolution = renderSession.resolution; - - this.updateText(); - this.dirty = false; - } - - PIXI.Sprite.prototype._renderWebGL.call(this, renderSession); -}; - -/** -* Renders the object using the Canvas renderer -* -* @method _renderCanvas -* @param renderSession {RenderSession} -* @private -*/ -PIXI.Text.prototype._renderCanvas = function(renderSession) -{ - if(this.dirty) - { - this.resolution = renderSession.resolution; - - this.updateText(); - this.dirty = false; - } - - PIXI.Sprite.prototype._renderCanvas.call(this, renderSession); -}; - -/** -* Calculates the ascent, descent and fontSize of a given fontStyle -* -* @method determineFontProperties -* @param fontStyle {Object} -* @private -*/ -PIXI.Text.prototype.determineFontProperties = function(fontStyle) -{ - var properties = PIXI.Text.fontPropertiesCache[fontStyle]; - - if(!properties) - { - properties = {}; - - var canvas = PIXI.Text.fontPropertiesCanvas; - var context = PIXI.Text.fontPropertiesContext; - - context.font = fontStyle; - - var width = Math.ceil(context.measureText('|Mq').width); - var baseline = Math.ceil(context.measureText('M').width); - var height = 2 * baseline; - - baseline = baseline * 1.4 | 0; - - canvas.width = width; - canvas.height = height; - - context.fillStyle = '#f00'; - context.fillRect(0, 0, width, height); - - context.font = fontStyle; - - context.textBaseline = 'alphabetic'; - context.fillStyle = '#000'; - context.fillText('|MÉq', 0, baseline); - - var imagedata = context.getImageData(0, 0, width, height).data; - var pixels = imagedata.length; - var line = width * 4; - - var i, j; - - var idx = 0; - var stop = false; - - // ascent. scan from top to bottom until we find a non red pixel - for(i = 0; i < baseline; i++) - { - for(j = 0; j < line; j += 4) - { - if(imagedata[idx + j] !== 255) - { - stop = true; - break; - } - } - if(!stop) - { - idx += line; - } - else - { - break; - } - } - - properties.ascent = baseline - i; - - idx = pixels - line; - stop = false; - - // descent. scan from bottom to top until we find a non red pixel - for(i = height; i > baseline; i--) - { - for(j = 0; j < line; j += 4) - { - if(imagedata[idx + j] !== 255) - { - stop = true; - break; - } - } - if(!stop) - { - idx -= line; - } - else - { - break; - } - } - - properties.descent = i - baseline; - //TODO might need a tweak. kind of a temp fix! - properties.descent += 6; - properties.fontSize = properties.ascent + properties.descent; - - PIXI.Text.fontPropertiesCache[fontStyle] = properties; - } - - return properties; -}; - -/** - * Applies newlines to a string to have it optimally fit into the horizontal - * bounds set by the Text object's wordWrapWidth property. - * - * @method wordWrap - * @param text {String} - * @private - */ -PIXI.Text.prototype.wordWrap = function(text) -{ - // Greedy wrapping algorithm that will wrap words as the line grows longer - // than its horizontal bounds. - var result = ''; - var lines = text.split('\n'); - for (var i = 0; i < lines.length; i++) - { - var spaceLeft = this.style.wordWrapWidth; - var words = lines[i].split(' '); - for (var j = 0; j < words.length; j++) - { - var wordWidth = this.context.measureText(words[j]).width; - var wordWidthWithSpace = wordWidth + this.context.measureText(' ').width; - if(j === 0 || wordWidthWithSpace > spaceLeft) - { - // Skip printing the newline if it's the first word of the line that is - // greater than the word wrap width. - if(j > 0) - { - result += '\n'; - } - result += words[j]; - spaceLeft = this.style.wordWrapWidth - wordWidth; - } - else - { - spaceLeft -= wordWidthWithSpace; - result += ' ' + words[j]; - } - } - - if (i < lines.length-1) - { - result += '\n'; - } - } - return result; -}; - -/** -* Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. -* -* @method getBounds -* @param matrix {Matrix} the transformation matrix of the Text -* @return {Rectangle} the framing rectangle -*/ -PIXI.Text.prototype.getBounds = function(matrix) -{ - if(this.dirty) - { - this.updateText(); - this.dirty = false; - } - - return PIXI.Sprite.prototype.getBounds.call(this, matrix); -}; - -/** - * Destroys this text object. - * - * @method destroy - * @param destroyBaseTexture {Boolean} whether to destroy the base texture as well - */ -PIXI.Text.prototype.destroy = function(destroyBaseTexture) -{ - // make sure to reset the the context and canvas.. dont want this hanging around in memory! - this.context = null; - this.canvas = null; - - this.texture.destroy(destroyBaseTexture === undefined ? true : destroyBaseTexture); -}; - -PIXI.Text.fontPropertiesCache = {}; -PIXI.Text.fontPropertiesCanvas = document.createElement('canvas'); -PIXI.Text.fontPropertiesContext = PIXI.Text.fontPropertiesCanvas.getContext('2d'); diff --git a/tutorial-4/pixi.js-master/src/pixi/textures/BaseTexture.js b/tutorial-4/pixi.js-master/src/pixi/textures/BaseTexture.js deleted file mode 100755 index 0145849..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/textures/BaseTexture.js +++ /dev/null @@ -1,305 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -PIXI.BaseTextureCache = {}; - -PIXI.BaseTextureCacheIdGenerator = 0; - -/** - * A texture stores the information that represents an image. All textures have a base texture. - * - * @class BaseTexture - * @uses EventTarget - * @constructor - * @param source {String} the source object (image or canvas) - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - */ -PIXI.BaseTexture = function(source, scaleMode) -{ - /** - * The Resolution of the texture. - * - * @property resolution - * @type Number - */ - this.resolution = 1; - - /** - * [read-only] The width of the base texture set when the image has loaded - * - * @property width - * @type Number - * @readOnly - */ - this.width = 100; - - /** - * [read-only] The height of the base texture set when the image has loaded - * - * @property height - * @type Number - * @readOnly - */ - this.height = 100; - - /** - * The scale mode to apply when scaling this texture - * - * @property scaleMode - * @type {Number} - * @default PIXI.scaleModes.LINEAR - */ - this.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - /** - * [read-only] Set to true once the base texture has loaded - * - * @property hasLoaded - * @type Boolean - * @readOnly - */ - this.hasLoaded = false; - - /** - * The image source that is used to create the texture. - * - * @property source - * @type Image - */ - this.source = source; - - this._UID = PIXI._UID++; - - /** - * Controls if RGB channels should be pre-multiplied by Alpha (WebGL only) - * - * @property premultipliedAlpha - * @type Boolean - * @default true - */ - this.premultipliedAlpha = true; - - // used for webGL - - /** - * @property _glTextures - * @type Array - * @private - */ - this._glTextures = []; - - /** - * - * Set this to true if a mipmap of this texture needs to be generated. This value needs to be set before the texture is used - * Also the texture must be a power of two size to work - * - * @property mipmap - * @type {Boolean} - */ - this.mipmap = false; - - // used for webGL texture updating... - // TODO - this needs to be addressed - - /** - * @property _dirty - * @type Array - * @private - */ - this._dirty = [true, true, true, true]; - - if(!source)return; - - if((this.source.complete || this.source.getContext) && this.source.width && this.source.height) - { - this.hasLoaded = true; - this.width = this.source.naturalWidth || this.source.width; - this.height = this.source.naturalHeight || this.source.height; - this.dirty(); - } - else - { - var scope = this; - - this.source.onload = function() { - - scope.hasLoaded = true; - scope.width = scope.source.naturalWidth || scope.source.width; - scope.height = scope.source.naturalHeight || scope.source.height; - - scope.dirty(); - - // add it to somewhere... - scope.dispatchEvent( { type: 'loaded', content: scope } ); - }; - - this.source.onerror = function() { - scope.dispatchEvent( { type: 'error', content: scope } ); - }; - } - - /** - * @property imageUrl - * @type String - */ - this.imageUrl = null; - - /** - * @property _powerOf2 - * @type Boolean - * @private - */ - this._powerOf2 = false; - -}; - -PIXI.BaseTexture.prototype.constructor = PIXI.BaseTexture; - -PIXI.EventTarget.mixin(PIXI.BaseTexture.prototype); - -/** - * Destroys this base texture - * - * @method destroy - */ -PIXI.BaseTexture.prototype.destroy = function() -{ - if(this.imageUrl) - { - delete PIXI.BaseTextureCache[this.imageUrl]; - delete PIXI.TextureCache[this.imageUrl]; - this.imageUrl = null; - if (!navigator.isCocoonJS) this.source.src = ''; - } - else if (this.source && this.source._pixiId) - { - delete PIXI.BaseTextureCache[this.source._pixiId]; - } - this.source = null; - - this.unloadFromGPU(); -}; - -/** - * Changes the source image of the texture - * - * @method updateSourceImage - * @param newSrc {String} the path of the image - */ -PIXI.BaseTexture.prototype.updateSourceImage = function(newSrc) -{ - this.hasLoaded = false; - this.source.src = null; - this.source.src = newSrc; -}; - -/** - * Sets all glTextures to be dirty. - * - * @method dirty - */ -PIXI.BaseTexture.prototype.dirty = function() -{ - for (var i = 0; i < this._glTextures.length; i++) - { - this._dirty[i] = true; - } -}; - -/** - * Removes the base texture from the GPU, useful for managing resources on the GPU. - * Atexture is still 100% usable and will simply be reuploaded if there is a sprite on screen that is using it. - * - * @method unloadFromGPU - */ -PIXI.BaseTexture.prototype.unloadFromGPU = function() -{ - this.dirty(); - - // delete the webGL textures if any. - for (var i = this._glTextures.length - 1; i >= 0; i--) - { - var glTexture = this._glTextures[i]; - var gl = PIXI.glContexts[i]; - - if(gl && glTexture) - { - gl.deleteTexture(glTexture); - } - - } - - this._glTextures.length = 0; - - this.dirty(); -}; - -/** - * Helper function that creates a base texture from the given image url. - * If the image is not in the base texture cache it will be created and loaded. - * - * @static - * @method fromImage - * @param imageUrl {String} The image url of the texture - * @param crossorigin {Boolean} - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return BaseTexture - */ -PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode) -{ - var baseTexture = PIXI.BaseTextureCache[imageUrl]; - - if(crossorigin === undefined && imageUrl.indexOf('data:') === -1) crossorigin = true; - - if(!baseTexture) - { - // new Image() breaks tex loading in some versions of Chrome. - // See https://code.google.com/p/chromium/issues/detail?id=238071 - var image = new Image();//document.createElement('img'); - if (crossorigin) - { - image.crossOrigin = ''; - } - - image.src = imageUrl; - baseTexture = new PIXI.BaseTexture(image, scaleMode); - baseTexture.imageUrl = imageUrl; - PIXI.BaseTextureCache[imageUrl] = baseTexture; - - // if there is an @2x at the end of the url we are going to assume its a highres image - if( imageUrl.indexOf(PIXI.RETINA_PREFIX + '.') !== -1) - { - baseTexture.resolution = 2; - } - } - - return baseTexture; -}; - -/** - * Helper function that creates a base texture from the given canvas element. - * - * @static - * @method fromCanvas - * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return BaseTexture - */ -PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode) -{ - if(!canvas._pixiId) - { - canvas._pixiId = 'canvas_' + PIXI.TextureCacheIdGenerator++; - } - - var baseTexture = PIXI.BaseTextureCache[canvas._pixiId]; - - if(!baseTexture) - { - baseTexture = new PIXI.BaseTexture(canvas, scaleMode); - PIXI.BaseTextureCache[canvas._pixiId] = baseTexture; - } - - return baseTexture; -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/textures/RenderTexture.js b/tutorial-4/pixi.js-master/src/pixi/textures/RenderTexture.js deleted file mode 100755 index 849ce47..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/textures/RenderTexture.js +++ /dev/null @@ -1,339 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * A RenderTexture is a special texture that allows any Pixi display object to be rendered to it. - * - * __Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead. - * - * A RenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example: - * - * var renderTexture = new PIXI.RenderTexture(800, 600); - * var sprite = PIXI.Sprite.fromImage("spinObj_01.png"); - * sprite.position.x = 800/2; - * sprite.position.y = 600/2; - * sprite.anchor.x = 0.5; - * sprite.anchor.y = 0.5; - * renderTexture.render(sprite); - * - * The Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual position a DisplayObjectContainer should be used: - * - * var doc = new PIXI.DisplayObjectContainer(); - * doc.addChild(sprite); - * renderTexture.render(doc); // Renders to center of renderTexture - * - * @class RenderTexture - * @extends Texture - * @constructor - * @param width {Number} The width of the render texture - * @param height {Number} The height of the render texture - * @param renderer {CanvasRenderer|WebGLRenderer} The renderer used for this RenderTexture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @param resolution {Number} The resolution of the texture being generated - */ -PIXI.RenderTexture = function(width, height, renderer, scaleMode, resolution) -{ - /** - * The with of the render texture - * - * @property width - * @type Number - */ - this.width = width || 100; - - /** - * The height of the render texture - * - * @property height - * @type Number - */ - this.height = height || 100; - - /** - * The Resolution of the texture. - * - * @property resolution - * @type Number - */ - this.resolution = resolution || 1; - - /** - * The framing rectangle of the render texture - * - * @property frame - * @type Rectangle - */ - this.frame = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @property crop - * @type Rectangle - */ - this.crop = new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution); - - /** - * The base texture object that this texture uses - * - * @property baseTexture - * @type BaseTexture - */ - this.baseTexture = new PIXI.BaseTexture(); - this.baseTexture.width = this.width * this.resolution; - this.baseTexture.height = this.height * this.resolution; - this.baseTexture._glTextures = []; - this.baseTexture.resolution = this.resolution; - - this.baseTexture.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT; - - this.baseTexture.hasLoaded = true; - - PIXI.Texture.call(this, - this.baseTexture, - new PIXI.Rectangle(0, 0, this.width * this.resolution, this.height * this.resolution) - ); - - /** - * The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL. - * - * @property renderer - * @type CanvasRenderer|WebGLRenderer - */ - this.renderer = renderer || PIXI.defaultRenderer; - - if(this.renderer.type === PIXI.WEBGL_RENDERER) - { - var gl = this.renderer.gl; - this.baseTexture._dirty[gl.id] = false; - - this.textureBuffer = new PIXI.FilterTexture(gl, this.width, this.height, this.baseTexture.scaleMode); - this.baseTexture._glTextures[gl.id] = this.textureBuffer.texture; - - this.render = this.renderWebGL; - this.projection = new PIXI.Point(this.width*0.5, -this.height*0.5); - } - else - { - this.render = this.renderCanvas; - this.textureBuffer = new PIXI.CanvasBuffer(this.width* this.resolution, this.height* this.resolution); - this.baseTexture.source = this.textureBuffer.canvas; - } - - /** - * @property valid - * @type Boolean - */ - this.valid = true; - - this._updateUvs(); -}; - -PIXI.RenderTexture.prototype = Object.create(PIXI.Texture.prototype); -PIXI.RenderTexture.prototype.constructor = PIXI.RenderTexture; - -/** - * Resizes the RenderTexture. - * - * @method resize - * @param width {Number} The width to resize to. - * @param height {Number} The height to resize to. - * @param updateBase {Boolean} Should the baseTexture.width and height values be resized as well? - */ -PIXI.RenderTexture.prototype.resize = function(width, height, updateBase) -{ - if (width === this.width && height === this.height)return; - - this.valid = (width > 0 && height > 0); - - this.width = width; - this.height = height; - - this.frame.width = this.crop.width = width * this.resolution; - this.frame.height = this.crop.height = height * this.resolution; - - if (updateBase) - { - this.baseTexture.width = this.width * this.resolution; - this.baseTexture.height = this.height * this.resolution; - } - - if (this.renderer.type === PIXI.WEBGL_RENDERER) - { - this.projection.x = this.width / 2; - this.projection.y = -this.height / 2; - } - - if(!this.valid)return; - - this.textureBuffer.resize(this.width, this.height); -}; - -/** - * Clears the RenderTexture. - * - * @method clear - */ -PIXI.RenderTexture.prototype.clear = function() -{ - if(!this.valid)return; - - if (this.renderer.type === PIXI.WEBGL_RENDERER) - { - this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer); - } - - this.textureBuffer.clear(); -}; - -/** - * This function will draw the display object to the texture. - * - * @method renderWebGL - * @param displayObject {DisplayObject} The display object to render this texture on - * @param [matrix] {Matrix} Optional matrix to apply to the display object before rendering. - * @param [clear] {Boolean} If true the texture will be cleared before the displayObject is drawn - * @private - */ -PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, matrix, clear) -{ - if(!this.valid)return; - //TOOD replace position with matrix.. - - //Lets create a nice matrix to apply to our display object. Frame buffers come in upside down so we need to flip the matrix - var wt = displayObject.worldTransform; - wt.identity(); - wt.translate(0, this.projection.y * 2); - if(matrix)wt.append(matrix); - wt.scale(1,-1); - - // setWorld Alpha to ensure that the object is renderer at full opacity - displayObject.worldAlpha = 1; - - // Time to update all the children of the displayObject with the new matrix.. - var children = displayObject.children; - - for(var i=0,j=children.length; i this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) - { - throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); - } - - this.valid = frame && frame.width && frame.height && this.baseTexture.source && this.baseTexture.hasLoaded; - - if (this.trim) - { - this.width = this.trim.width; - this.height = this.trim.height; - this.frame.width = this.trim.width; - this.frame.height = this.trim.height; - } - - if (this.valid) this._updateUvs(); - -}; - -/** - * Updates the internal WebGL UV cache. - * - * @method _updateUvs - * @private - */ -PIXI.Texture.prototype._updateUvs = function() -{ - if(!this._uvs)this._uvs = new PIXI.TextureUvs(); - - var frame = this.crop; - var tw = this.baseTexture.width; - var th = this.baseTexture.height; - - this._uvs.x0 = frame.x / tw; - this._uvs.y0 = frame.y / th; - - this._uvs.x1 = (frame.x + frame.width) / tw; - this._uvs.y1 = frame.y / th; - - this._uvs.x2 = (frame.x + frame.width) / tw; - this._uvs.y2 = (frame.y + frame.height) / th; - - this._uvs.x3 = frame.x / tw; - this._uvs.y3 = (frame.y + frame.height) / th; -}; - -/** - * Helper function that creates a Texture object from the given image url. - * If the image is not in the texture cache it will be created and loaded. - * - * @static - * @method fromImage - * @param imageUrl {String} The image url of the texture - * @param crossorigin {Boolean} Whether requests should be treated as crossorigin - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return Texture - */ -PIXI.Texture.fromImage = function(imageUrl, crossorigin, scaleMode) -{ - var texture = PIXI.TextureCache[imageUrl]; - - if(!texture) - { - texture = new PIXI.Texture(PIXI.BaseTexture.fromImage(imageUrl, crossorigin, scaleMode)); - PIXI.TextureCache[imageUrl] = texture; - } - - return texture; -}; - -/** - * Helper function that returns a Texture objected based on the given frame id. - * If the frame id is not in the texture cache an error will be thrown. - * - * @static - * @method fromFrame - * @param frameId {String} The frame id of the texture - * @return Texture - */ -PIXI.Texture.fromFrame = function(frameId) -{ - var texture = PIXI.TextureCache[frameId]; - if(!texture) throw new Error('The frameId "' + frameId + '" does not exist in the texture cache '); - return texture; -}; - -/** - * Helper function that creates a new a Texture based on the given canvas element. - * - * @static - * @method fromCanvas - * @param canvas {Canvas} The canvas element source of the texture - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return Texture - */ -PIXI.Texture.fromCanvas = function(canvas, scaleMode) -{ - var baseTexture = PIXI.BaseTexture.fromCanvas(canvas, scaleMode); - - return new PIXI.Texture( baseTexture ); - -}; - -/** - * Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object. - * - * @static - * @method addTextureToCache - * @param texture {Texture} The Texture to add to the cache. - * @param id {String} The id that the texture will be stored against. - */ -PIXI.Texture.addTextureToCache = function(texture, id) -{ - PIXI.TextureCache[id] = texture; -}; - -/** - * Remove a texture from the global PIXI.TextureCache. - * - * @static - * @method removeTextureFromCache - * @param id {String} The id of the texture to be removed - * @return {Texture} The texture that was removed - */ -PIXI.Texture.removeTextureFromCache = function(id) -{ - var texture = PIXI.TextureCache[id]; - delete PIXI.TextureCache[id]; - delete PIXI.BaseTextureCache[id]; - return texture; -}; - -PIXI.TextureUvs = function() -{ - this.x0 = 0; - this.y0 = 0; - - this.x1 = 0; - this.y1 = 0; - - this.x2 = 0; - this.y2 = 0; - - this.x3 = 0; - this.y3 = 0; -}; - -PIXI.Texture.emptyTexture = new PIXI.Texture(new PIXI.BaseTexture()); - diff --git a/tutorial-4/pixi.js-master/src/pixi/textures/VideoTexture.js b/tutorial-4/pixi.js-master/src/pixi/textures/VideoTexture.js deleted file mode 100755 index ad58ec5..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/textures/VideoTexture.js +++ /dev/null @@ -1,168 +0,0 @@ -/** - * A texture of a [playing] Video. - * - * See the ["deus" demo](http://www.goodboydigital.com/pixijs/examples/deus/). - * - * @class VideoTexture - * @extends BaseTexture - * @constructor - * @param source {HTMLVideoElement} - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - */ -PIXI.VideoTexture = function( source, scaleMode ) -{ - if( !source ){ - throw new Error( 'No video source element specified.' ); - } - - // hook in here to check if video is already available. - // PIXI.BaseTexture looks for a source.complete boolean, plus width & height. - - if( (source.readyState === source.HAVE_ENOUGH_DATA || source.readyState === source.HAVE_FUTURE_DATA ) && source.width && source.height ) - { - source.complete = true; - } - - PIXI.BaseTexture.call( this, source, scaleMode ); - - this.autoUpdate = false; - this.updateBound = this._onUpdate.bind(this); - - if( !source.complete ) - { - this._onCanPlay = this.onCanPlay.bind(this); - - source.addEventListener( 'canplay', this._onCanPlay ); - source.addEventListener( 'canplaythrough', this._onCanPlay ); - - // started playing.. - source.addEventListener( 'play', this.onPlayStart.bind(this) ); - source.addEventListener( 'pause', this.onPlayStop.bind(this) ); - } - -}; - -PIXI.VideoTexture.prototype = Object.create( PIXI.BaseTexture.prototype ); - -PIXI.VideoTexture.constructor = PIXI.VideoTexture; - -PIXI.VideoTexture.prototype._onUpdate = function() -{ - if(this.autoUpdate) - { - window.requestAnimationFrame(this.updateBound); - this.dirty(); - } -}; - -PIXI.VideoTexture.prototype.onPlayStart = function() -{ - if(!this.autoUpdate) - { - window.requestAnimationFrame(this.updateBound); - this.autoUpdate = true; - } -}; - -PIXI.VideoTexture.prototype.onPlayStop = function() -{ - this.autoUpdate = false; -}; - -PIXI.VideoTexture.prototype.onCanPlay = function() -{ - if( event.type === 'canplaythrough' ) - { - this.hasLoaded = true; - - - if( this.source ) - { - this.source.removeEventListener( 'canplay', this._onCanPlay ); - this.source.removeEventListener( 'canplaythrough', this._onCanPlay ); - - this.width = this.source.videoWidth; - this.height = this.source.videoHeight; - - // prevent multiple loaded dispatches.. - if( !this.__loaded ){ - this.__loaded = true; - this.dispatchEvent( { type: 'loaded', content: this } ); - } - } - } -}; - -PIXI.VideoTexture.prototype.destroy = function() -{ - if( this.source && this.source._pixiId ) - { - PIXI.BaseTextureCache[ this.source._pixiId ] = null; - delete PIXI.BaseTextureCache[ this.source._pixiId ]; - - this.source._pixiId = null; - delete this.source._pixiId; - } - - PIXI.BaseTexture.prototype.destroy.call( this ); -}; - -/** - * Mimic Pixi BaseTexture.from.... method. - * - * @static - * @method baseTextureFromVideo - * @param video {HTMLVideoElement} - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return {VideoTexture} - */ -PIXI.VideoTexture.baseTextureFromVideo = function( video, scaleMode ) -{ - if( !video._pixiId ) - { - video._pixiId = 'video_' + PIXI.TextureCacheIdGenerator++; - } - - var baseTexture = PIXI.BaseTextureCache[ video._pixiId ]; - - if( !baseTexture ) - { - baseTexture = new PIXI.VideoTexture( video, scaleMode ); - PIXI.BaseTextureCache[ video._pixiId ] = baseTexture; - } - - return baseTexture; -}; - -/** - * Mimic Pixi BaseTexture.from.... method. - * - * @static - * @method textureFromVideo - * @param video {HTMLVideoElement} - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return {Texture} A Texture, but not a VideoTexture. - */ -PIXI.VideoTexture.textureFromVideo = function( video, scaleMode ) -{ - var baseTexture = PIXI.VideoTexture.baseTextureFromVideo( video, scaleMode ); - return new PIXI.Texture( baseTexture ); -}; - -/** - * Mimic Pixi BaseTexture.from.... method. - * - * @static - * @method fromUrl - * @param videoSrc {String} The URL for the video. - * @param scaleMode {Number} See {{#crossLink "PIXI/scaleModes:property"}}PIXI.scaleModes{{/crossLink}} for possible values - * @return {VideoTexture} - */ -PIXI.VideoTexture.fromUrl = function( videoSrc, scaleMode ) -{ - var video = document.createElement('video'); - video.src = videoSrc; - video.autoPlay = true; - video.play(); - return PIXI.VideoTexture.textureFromVideo( video, scaleMode); -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/utils/Detector.js b/tutorial-4/pixi.js-master/src/pixi/utils/Detector.js deleted file mode 100755 index fe38f04..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/utils/Detector.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -/** - * This helper function will automatically detect which renderer you should be using. - * WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by - * the browser then this function will return a canvas renderer - * - * @method autoDetectRenderer - * @for PIXI - * @static - * @param width=800 {Number} the width of the renderers view - * @param height=600 {Number} the height of the renderers view - * - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * - */ -PIXI.autoDetectRenderer = function(width, height, options) -{ - if(!width)width = 800; - if(!height)height = 600; - - // BORROWED from Mr Doob (mrdoob.com) - var webgl = ( function () { try { - var canvas = document.createElement( 'canvas' ); - return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ); - } catch( e ) { - return false; - } - } )(); - - if( webgl ) - { - return new PIXI.WebGLRenderer(width, height, options); - } - - return new PIXI.CanvasRenderer(width, height, options); -}; - -/** - * This helper function will automatically detect which renderer you should be using. - * This function is very similar to the autoDetectRenderer function except that is will return a canvas renderer for android. - * Even thought both android chrome supports webGL the canvas implementation perform better at the time of writing. - * This function will likely change and update as webGL performance improves on these devices. - * - * @method autoDetectRecommendedRenderer - * @for PIXI - * @static - * @param width=800 {Number} the width of the renderers view - * @param height=600 {Number} the height of the renderers view - * - * @param [options] {Object} The optional renderer parameters - * @param [options.view] {HTMLCanvasElement} the canvas to use as a view, optional - * @param [options.transparent=false] {Boolean} If the render view is transparent, default false - * @param [options.antialias=false] {Boolean} sets antialias (only applicable in chrome at the moment) - * @param [options.preserveDrawingBuffer=false] {Boolean} enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context - * @param [options.resolution=1] {Number} the resolution of the renderer retina would be 2 - * - */ -PIXI.autoDetectRecommendedRenderer = function(width, height, options) -{ - if(!width)width = 800; - if(!height)height = 600; - - // BORROWED from Mr Doob (mrdoob.com) - var webgl = ( function () { try { - var canvas = document.createElement( 'canvas' ); - return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ); - } catch( e ) { - return false; - } - } )(); - - var isAndroid = /Android/i.test(navigator.userAgent); - - if( webgl && !isAndroid) - { - return new PIXI.WebGLRenderer(width, height, options); - } - - return new PIXI.CanvasRenderer(width, height, options); -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/utils/EventTarget.js b/tutorial-4/pixi.js-master/src/pixi/utils/EventTarget.js deleted file mode 100755 index 35aa31b..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/utils/EventTarget.js +++ /dev/null @@ -1,284 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - * @author Chad Engler https://github.com/englercj @Rolnaaba - */ - -/** - * Originally based on https://github.com/mrdoob/eventtarget.js/ from mr Doob. - * Currently takes inspiration from the nodejs EventEmitter, EventEmitter3, and smokesignals - */ - -/** - * Mixins event emitter functionality to a class - * - * @class EventTarget - * @example - * function MyEmitter() {} - * - * PIXI.EventTarget.mixin(MyEmitter.prototype); - * - * var em = new MyEmitter(); - * em.emit('eventName', 'some data', 'some more data', {}, null, ...); - */ -PIXI.EventTarget = { - /** - * Backward compat from when this used to be a function - */ - call: function callCompat(obj) { - if(obj) { - obj = obj.prototype || obj; - PIXI.EventTarget.mixin(obj); - } - }, - - /** - * Mixes in the properties of the EventTarget prototype onto another object - * - * @method mixin - * @param object {Object} The obj to mix into - */ - mixin: function mixin(obj) { - /** - * Return a list of assigned event listeners. - * - * @method listeners - * @param eventName {String} The events that should be listed. - * @return {Array} An array of listener functions - */ - obj.listeners = function listeners(eventName) { - this._listeners = this._listeners || {}; - - return this._listeners[eventName] ? this._listeners[eventName].slice() : []; - }; - - /** - * Emit an event to all registered event listeners. - * - * @method emit - * @alias dispatchEvent - * @param eventName {String} The name of the event. - * @return {Boolean} Indication if we've emitted an event. - */ - obj.emit = obj.dispatchEvent = function emit(eventName, data) { - this._listeners = this._listeners || {}; - - //backwards compat with old method ".emit({ type: 'something' })" - if(typeof eventName === 'object') { - data = eventName; - eventName = eventName.type; - } - - //ensure we are using a real pixi event - if(!data || data.__isEventObject !== true) { - data = new PIXI.Event(this, eventName, data); - } - - //iterate the listeners - if(this._listeners && this._listeners[eventName]) { - var listeners = this._listeners[eventName].slice(0), - length = listeners.length, - fn = listeners[0], - i; - - for(i = 0; i < length; fn = listeners[++i]) { - //call the event listener - fn.call(this, data); - - //if "stopImmediatePropagation" is called, stop calling sibling events - if(data.stoppedImmediate) { - return this; - } - } - - //if "stopPropagation" is called then don't bubble the event - if(data.stopped) { - return this; - } - } - - //bubble this event up the scene graph - if(this.parent && this.parent.emit) { - this.parent.emit.call(this.parent, eventName, data); - } - - return this; - }; - - /** - * Register a new EventListener for the given event. - * - * @method on - * @alias addEventListener - * @param eventName {String} Name of the event. - * @param callback {Functon} fn Callback function. - */ - obj.on = obj.addEventListener = function on(eventName, fn) { - this._listeners = this._listeners || {}; - - (this._listeners[eventName] = this._listeners[eventName] || []) - .push(fn); - - return this; - }; - - /** - * Add an EventListener that's only called once. - * - * @method once - * @param eventName {String} Name of the event. - * @param callback {Function} Callback function. - */ - obj.once = function once(eventName, fn) { - this._listeners = this._listeners || {}; - - var self = this; - function onceHandlerWrapper() { - fn.apply(self.off(eventName, onceHandlerWrapper), arguments); - } - onceHandlerWrapper._originalHandler = fn; - - return this.on(eventName, onceHandlerWrapper); - }; - - /** - * Remove event listeners. - * - * @method off - * @alias removeEventListener - * @param eventName {String} The event we want to remove. - * @param callback {Function} The listener that we need to find. - */ - obj.off = obj.removeEventListener = function off(eventName, fn) { - this._listeners = this._listeners || {}; - - if(!this._listeners[eventName]) - return this; - - var list = this._listeners[eventName], - i = fn ? list.length : 0; - - while(i-- > 0) { - if(list[i] === fn || list[i]._originalHandler === fn) { - list.splice(i, 1); - } - } - - if(list.length === 0) { - delete this._listeners[eventName]; - } - - return this; - }; - - /** - * Remove all listeners or only the listeners for the specified event. - * - * @method removeAllListeners - * @param eventName {String} The event you want to remove all listeners for. - */ - obj.removeAllListeners = function removeAllListeners(eventName) { - this._listeners = this._listeners || {}; - - if(!this._listeners[eventName]) - return this; - - delete this._listeners[eventName]; - - return this; - }; - } -}; - -/** - * Creates an homogenous object for tracking events so users can know what to expect. - * - * @class Event - * @extends Object - * @constructor - * @param target {Object} The target object that the event is called on - * @param name {String} The string name of the event that was triggered - * @param data {Object} Arbitrary event data to pass along - */ -PIXI.Event = function(target, name, data) { - //for duck typing in the ".on()" function - this.__isEventObject = true; - - /** - * Tracks the state of bubbling propagation. Do not - * set this directly, instead use `event.stopPropagation()` - * - * @property stopped - * @type Boolean - * @private - * @readOnly - */ - this.stopped = false; - - /** - * Tracks the state of sibling listener propagation. Do not - * set this directly, instead use `event.stopImmediatePropagation()` - * - * @property stoppedImmediate - * @type Boolean - * @private - * @readOnly - */ - this.stoppedImmediate = false; - - /** - * The original target the event triggered on. - * - * @property target - * @type Object - * @readOnly - */ - this.target = target; - - /** - * The string name of the event that this represents. - * - * @property type - * @type String - * @readOnly - */ - this.type = name; - - /** - * The data that was passed in with this event. - * - * @property data - * @type Object - * @readOnly - */ - this.data = data; - - //backwards compat with older version of events - this.content = data; - - /** - * The timestamp when the event occurred. - * - * @property timeStamp - * @type Number - * @readOnly - */ - this.timeStamp = Date.now(); -}; - -/** - * Stops the propagation of events up the scene graph (prevents bubbling). - * - * @method stopPropagation - */ -PIXI.Event.prototype.stopPropagation = function stopPropagation() { - this.stopped = true; -}; - -/** - * Stops the propagation of events to sibling listeners (no longer calls any listeners). - * - * @method stopImmediatePropagation - */ -PIXI.Event.prototype.stopImmediatePropagation = function stopImmediatePropagation() { - this.stoppedImmediate = true; -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/utils/Polyk.js b/tutorial-4/pixi.js-master/src/pixi/utils/Polyk.js deleted file mode 100755 index 838e6a2..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/utils/Polyk.js +++ /dev/null @@ -1,168 +0,0 @@ -/* - PolyK library - url: http://polyk.ivank.net - Released under MIT licence. - - Copyright (c) 2012 Ivan Kuckir - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation - files (the "Software"), to deal in the Software without - restriction, including without limitation the rights to use, - copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following - conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. - - This is an amazing lib! - - Slightly modified by Mat Groves (matgroves.com); -*/ - -/** - * Based on the Polyk library http://polyk.ivank.net released under MIT licence. - * This is an amazing lib! - * Slightly modified by Mat Groves (matgroves.com); - * @class PolyK - */ -PIXI.PolyK = {}; - -/** - * Triangulates shapes for webGL graphic fills. - * - * @method Triangulate - */ -PIXI.PolyK.Triangulate = function(p) -{ - var sign = true; - - var n = p.length >> 1; - if(n < 3) return []; - - var tgs = []; - var avl = []; - for(var i = 0; i < n; i++) avl.push(i); - - i = 0; - var al = n; - while(al > 3) - { - var i0 = avl[(i+0)%al]; - var i1 = avl[(i+1)%al]; - var i2 = avl[(i+2)%al]; - - var ax = p[2*i0], ay = p[2*i0+1]; - var bx = p[2*i1], by = p[2*i1+1]; - var cx = p[2*i2], cy = p[2*i2+1]; - - var earFound = false; - if(PIXI.PolyK._convex(ax, ay, bx, by, cx, cy, sign)) - { - earFound = true; - for(var j = 0; j < al; j++) - { - var vi = avl[j]; - if(vi === i0 || vi === i1 || vi === i2) continue; - - if(PIXI.PolyK._PointInTriangle(p[2*vi], p[2*vi+1], ax, ay, bx, by, cx, cy)) { - earFound = false; - break; - } - } - } - - if(earFound) - { - tgs.push(i0, i1, i2); - avl.splice((i+1)%al, 1); - al--; - i = 0; - } - else if(i++ > 3*al) - { - // need to flip flip reverse it! - // reset! - if(sign) - { - tgs = []; - avl = []; - for(i = 0; i < n; i++) avl.push(i); - - i = 0; - al = n; - - sign = false; - } - else - { - // window.console.log("PIXI Warning: shape too complex to fill"); - return null; - } - } - } - - tgs.push(avl[0], avl[1], avl[2]); - return tgs; -}; - -/** - * Checks whether a point is within a triangle - * - * @method _PointInTriangle - * @param px {Number} x coordinate of the point to test - * @param py {Number} y coordinate of the point to test - * @param ax {Number} x coordinate of the a point of the triangle - * @param ay {Number} y coordinate of the a point of the triangle - * @param bx {Number} x coordinate of the b point of the triangle - * @param by {Number} y coordinate of the b point of the triangle - * @param cx {Number} x coordinate of the c point of the triangle - * @param cy {Number} y coordinate of the c point of the triangle - * @private - * @return {Boolean} - */ -PIXI.PolyK._PointInTriangle = function(px, py, ax, ay, bx, by, cx, cy) -{ - var v0x = cx-ax; - var v0y = cy-ay; - var v1x = bx-ax; - var v1y = by-ay; - var v2x = px-ax; - var v2y = py-ay; - - var dot00 = v0x*v0x+v0y*v0y; - var dot01 = v0x*v1x+v0y*v1y; - var dot02 = v0x*v2x+v0y*v2y; - var dot11 = v1x*v1x+v1y*v1y; - var dot12 = v1x*v2x+v1y*v2y; - - var invDenom = 1 / (dot00 * dot11 - dot01 * dot01); - var u = (dot11 * dot02 - dot01 * dot12) * invDenom; - var v = (dot00 * dot12 - dot01 * dot02) * invDenom; - - // Check if point is in triangle - return (u >= 0) && (v >= 0) && (u + v < 1); -}; - -/** - * Checks whether a shape is convex - * - * @method _convex - * @private - * @return {Boolean} - */ -PIXI.PolyK._convex = function(ax, ay, bx, by, cx, cy, sign) -{ - return ((ay-by)*(cx-bx) + (bx-ax)*(cy-by) >= 0) === sign; -}; diff --git a/tutorial-4/pixi.js-master/src/pixi/utils/Utils.js b/tutorial-4/pixi.js-master/src/pixi/utils/Utils.js deleted file mode 100755 index 1a0127d..0000000 --- a/tutorial-4/pixi.js-master/src/pixi/utils/Utils.js +++ /dev/null @@ -1,220 +0,0 @@ -/** - * @author Mat Groves http://matgroves.com/ @Doormat23 - */ - -// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ -// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating - -// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel - -// MIT license - -/** - * A polyfill for requestAnimationFrame - * You can actually use both requestAnimationFrame and requestAnimFrame, - * you will still benefit from the polyfill - * - * @method requestAnimationFrame - */ - -/** - * A polyfill for cancelAnimationFrame - * - * @method cancelAnimationFrame - */ -(function(window) { - var lastTime = 0; - var vendors = ['ms', 'moz', 'webkit', 'o']; - for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { - window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']; - window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || - window[vendors[x] + 'CancelRequestAnimationFrame']; - } - - if (!window.requestAnimationFrame) { - window.requestAnimationFrame = function(callback) { - var currTime = new Date().getTime(); - var timeToCall = Math.max(0, 16 - (currTime - lastTime)); - var id = window.setTimeout(function() { callback(currTime + timeToCall); }, - timeToCall); - lastTime = currTime + timeToCall; - return id; - }; - } - - if (!window.cancelAnimationFrame) { - window.cancelAnimationFrame = function(id) { - clearTimeout(id); - }; - } - - window.requestAnimFrame = window.requestAnimationFrame; -})(this); - -/** - * Converts a hex color number to an [R, G, B] array - * - * @method hex2rgb - * @param hex {Number} - */ -PIXI.hex2rgb = function(hex) { - return [(hex >> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255]; -}; - -/** - * Converts a color as an [R, G, B] array to a hex number - * - * @method rgb2hex - * @param rgb {Array} - */ -PIXI.rgb2hex = function(rgb) { - return ((rgb[0]*255 << 16) + (rgb[1]*255 << 8) + rgb[2]*255); -}; - -/** - * A polyfill for Function.prototype.bind - * - * @method bind - */ -if (typeof Function.prototype.bind !== 'function') { - Function.prototype.bind = (function () { - return function (thisArg) { - var target = this, i = arguments.length - 1, boundArgs = []; - if (i > 0) - { - boundArgs.length = i; - while (i--) boundArgs[i] = arguments[i + 1]; - } - - if (typeof target !== 'function') throw new TypeError(); - - function bound() { - var i = arguments.length, args = new Array(i); - while (i--) args[i] = arguments[i]; - args = boundArgs.concat(args); - return target.apply(this instanceof bound ? this : thisArg, args); - } - - bound.prototype = (function F(proto) { - if (proto) F.prototype = proto; - if (!(this instanceof F)) return new F(); - })(target.prototype); - - return bound; - }; - })(); -} - -/** - * A wrapper for ajax requests to be handled cross browser - * - * @class AjaxRequest - * @constructor - */ -PIXI.AjaxRequest = function() -{ - var activexmodes = ['Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.3.0', 'Microsoft.XMLHTTP']; //activeX versions to check for in IE - - if (window.ActiveXObject) - { //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken) - for (var i=0; i 0 && (number & (number - 1)) === 0) // see: http://goo.gl/D9kPj - return number; - else - { - var result = 1; - while (result < number) result <<= 1; - return result; - } -}; - -/** - * checks if the given width and height make a power of two texture - * @method isPowerOfTwo - * @param width {Number} - * @param height {Number} - * @return {Boolean} - */ -PIXI.isPowerOfTwo = function(width, height) -{ - return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0); - -}; diff --git a/tutorial-4/pixi.js-master/tasks/karma.js b/tutorial-4/pixi.js-master/tasks/karma.js deleted file mode 100755 index e20aca5..0000000 --- a/tutorial-4/pixi.js-master/tasks/karma.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = function (grunt) { - 'use strict'; - - var path = require('path'); - var server = require('karma').server; - - grunt.registerMultiTask('karma', 'run karma.', function(target) { - //merge data onto options, with data taking precedence - var options = grunt.util._.merge(this.options(), this.data), - done = this.async(); - - if (options.configFile) { - options.configFile = grunt.template.process(options.configFile); - options.configFile = path.resolve(options.configFile); - } - - done = this.async(); - server.start(options, function(code) { - done(!code); - }); - }); -}; diff --git a/tutorial-4/pixi.js-master/test/functional/example-1-basics/bunny.png b/tutorial-4/pixi.js-master/test/functional/example-1-basics/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-4/pixi.js-master/test/functional/example-1-basics/bunny.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/test/functional/example-1-basics/frame-30.png b/tutorial-4/pixi.js-master/test/functional/example-1-basics/frame-30.png deleted file mode 100755 index 96e3409..0000000 Binary files a/tutorial-4/pixi.js-master/test/functional/example-1-basics/frame-30.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/test/functional/example-1-basics/frame-60.png b/tutorial-4/pixi.js-master/test/functional/example-1-basics/frame-60.png deleted file mode 100755 index af3f4ce..0000000 Binary files a/tutorial-4/pixi.js-master/test/functional/example-1-basics/frame-60.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/test/functional/example-1-basics/frame-90.png b/tutorial-4/pixi.js-master/test/functional/example-1-basics/frame-90.png deleted file mode 100755 index 099b823..0000000 Binary files a/tutorial-4/pixi.js-master/test/functional/example-1-basics/frame-90.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/test/functional/example-1-basics/index.js b/tutorial-4/pixi.js-master/test/functional/example-1-basics/index.js deleted file mode 100755 index 2ad32bd..0000000 --- a/tutorial-4/pixi.js-master/test/functional/example-1-basics/index.js +++ /dev/null @@ -1,133 +0,0 @@ -describe('Example 1 - Basics', function () { - 'use strict'; - - var baseUri = '/base/test/functional/example-1-basics'; - var expect = chai.expect; - var currentFrame = 0; - var frameEvents = {}; - var stage; - var renderer; - var bunny; - - function onFrame(frame, callback) { - frameEvents[frame] = callback; - } - - function animate() { - currentFrame += 1; - - window.requestAnimFrame( animate ); - - // just for fun, lets rotate mr rabbit a little - bunny.rotation += 0.1; - - // render the stage - renderer.render(stage); - - if (frameEvents[currentFrame]) - frameEvents[currentFrame](currentFrame); - } - - function initScene() { - // create an new instance of a pixi stage - stage = new PIXI.Stage(0x66FF99); - - // create a renderer instance - renderer = PIXI.autoDetectRenderer(400, 300); - console.log('Is PIXI.WebGLRenderer: ' + (renderer instanceof PIXI.WebGLRenderer)); - - // add the renderer view element to the DOM - document.body.appendChild(renderer.view); - - window.requestAnimFrame( animate ); - - // create a texture from an image path - var texture = PIXI.Texture.fromImage(baseUri + '/bunny.png'); - // create a new Sprite using the texture - bunny = new PIXI.Sprite(texture); - - // center the sprites anchor point - bunny.anchor.x = 0.5; - bunny.anchor.y = 0.5; - - // move the sprite t the center of the screen - bunny.position.x = 200; - bunny.position.y = 150; - - stage.addChild(bunny); - } - - it('assets loaded', function (done) { - var loader = new PIXI.AssetLoader([ - baseUri + '/bunny.png', - baseUri + '/frame-30.png', - baseUri + '/frame-60.png', - baseUri + '/frame-90.png' - ]); - // loader.on('onProgress', function (event) { - // console.log(event.content); - // }); - loader.on('onComplete', function () { - done(); - initScene(); - }); - loader.load(); - }); - - it('frame 30 should match', function (done) { - this.timeout(700); - onFrame(30, function () { - var str = renderer.view.toDataURL('image/png'); - //console.log(''); - resemble(str) - .compareTo(baseUri + '/frame-30.png') - .onComplete(function (data) { - expect(data).to.be.an('object'); - expect(data.isSameDimensions).to.equal(true); - expect(data.misMatchPercentage).to.be.below(0.2); - done(); - }); - }); - }); - - it('frame 60 should match', function (done) { - this.timeout(1200); - onFrame(60, function () { - var str = renderer.view.toDataURL('image/png'); - //console.log(''); - resemble(str) - .compareTo(baseUri + '/frame-60.png') - .onComplete(function (data) { - expect(data).to.be.an('object'); - expect(data.isSameDimensions).to.equal(true); - expect(data.misMatchPercentage).to.be.below(0.2); - done(); - }); - }); - }); - - it('frame 90 should match', function (done) { - this.timeout(1700); - onFrame(90, function () { - var str = renderer.view.toDataURL('image/png'); - //console.log(''); - resemble(str) - .compareTo(baseUri + '/frame-90.png') - .onComplete(function (data) { - expect(data).to.be.an('object'); - expect(data.isSameDimensions).to.equal(true); - expect(data.misMatchPercentage).to.be.below(0.2); - done(); - }); - }); - }); - - // it('capture something', function (done) { - // this.timeout(2000000); - // onFrame(30, function () { - // var img = new Image(); - // img.src = renderer.view.toDataURL('image/png'); - // document.body.appendChild(img); - // }); - // }); -}); diff --git a/tutorial-4/pixi.js-master/test/karma.conf.js b/tutorial-4/pixi.js-master/test/karma.conf.js deleted file mode 100755 index 86715ab..0000000 --- a/tutorial-4/pixi.js-master/test/karma.conf.js +++ /dev/null @@ -1,83 +0,0 @@ -module.exports = function(config) { - config.set({ - - // base path, that will be used to resolve files and exclude - basePath : '../', - - frameworks : ['mocha'], - - // list of files / patterns to load in the browser - files : [ - 'node_modules/chai/chai.js', - 'bin/pixi.dev.js', - 'test/lib/**/*.js', - 'test/unit/**/*.js', - // 'test/functional/**/*.js', - {pattern: 'test/**/*.png', watched: false, included: false, served: true} - ], - - // list of files to exclude - //exclude : [], - - // use dolts reporter, as travis terminal does not support escaping sequences - // possible values: 'dots', 'progress', 'junit', 'teamcity' - // CLI --reporters progress - reporters : ['spec'], - - // web server port - // CLI --port 9876 - port : 9876, - - // cli runner port - // CLI --runner-port 9100 - runnerPort : 9100, - - // enable / disable colors in the output (reporters and logs) - // CLI --colors --no-colors - colors : true, - - // level of logging - // possible values: karma.LOG_DISABLE || karma.LOG_ERROR || karma.LOG_WARN || karma.LOG_INFO || karma.LOG_DEBUG - // CLI --log-level debug - logLevel : config.LOG_INFO, - - // enable / disable watching file and executing tests whenever any file changes - // CLI --auto-watch --no-auto-watch - autoWatch : false, - - // Start these browsers, currently available: - // - Chrome - // - ChromeCanary - // - Firefox - // - Opera - // - Safari (only Mac) - // - PhantomJS - // - IE (only Windows) - // CLI --browsers Chrome,Firefox,Safari - browsers : ['Firefox'], - - // If browser does not capture in given timeout [ms], kill it - // CLI --capture-timeout 60000 - captureTimeout : 60000, - - // Auto run tests on start (when browsers are captured) and exit - // CLI --single-run --no-single-run - singleRun : true, - - // report which specs are slower than 500ms - // CLI --report-slower-than 500 - reportSlowerThan : 500, - - preprocessors : { - // '**/client/js/*.js': 'coverage' - }, - - plugins : [ - 'karma-chrome-launcher', - 'karma-firefox-launcher', - 'karma-mocha', - // 'karma-phantomjs-launcher' - 'karma-spec-reporter' - ] - }); -}; diff --git a/tutorial-4/pixi.js-master/test/lib/pixi/core/Circle.js b/tutorial-4/pixi.js-master/test/lib/pixi/core/Circle.js deleted file mode 100755 index e7cbd4d..0000000 --- a/tutorial-4/pixi.js-master/test/lib/pixi/core/Circle.js +++ /dev/null @@ -1,22 +0,0 @@ -function pixi_core_Circle_confirmNewCircle(obj) { - var expect = chai.expect; - - expect(obj).to.be.an.instanceof(PIXI.Circle); - expect(obj).to.respondTo('clone'); - expect(obj).to.respondTo('contains'); - expect(obj).to.respondTo('getBounds'); - - expect(obj).to.have.property('x', 0); - expect(obj).to.have.property('y', 0); - expect(obj).to.have.property('radius', 0); -} - -function pixi_core_Circle_isBoundedByRectangle(obj, rect) { - var expect = chai.expect; - - expect(rect).to.have.property('x', obj.x - obj.radius); - expect(rect).to.have.property('y', obj.y - obj.radius); - - expect(rect).to.have.property('width', obj.radius * 2); - expect(rect).to.have.property('height', obj.radius * 2); -} diff --git a/tutorial-4/pixi.js-master/test/lib/pixi/core/Matrix.js b/tutorial-4/pixi.js-master/test/lib/pixi/core/Matrix.js deleted file mode 100755 index 77492c2..0000000 --- a/tutorial-4/pixi.js-master/test/lib/pixi/core/Matrix.js +++ /dev/null @@ -1,13 +0,0 @@ -function pixi_core_Matrix_confirmNewMatrix(matrix) { - var expect = chai.expect; - - expect(matrix).to.be.an.instanceof(PIXI.Matrix); - expect(matrix).to.not.be.empty; - - expect(matrix.a).to.equal(1); - expect(matrix.b).to.equal(0); - expect(matrix.c).to.equal(0); - expect(matrix.d).to.equal(1); - expect(matrix.tx).to.equal(0); - expect(matrix.ty).to.equal(0); -} \ No newline at end of file diff --git a/tutorial-4/pixi.js-master/test/lib/pixi/core/Point.js b/tutorial-4/pixi.js-master/test/lib/pixi/core/Point.js deleted file mode 100755 index e5df07b..0000000 --- a/tutorial-4/pixi.js-master/test/lib/pixi/core/Point.js +++ /dev/null @@ -1,10 +0,0 @@ - -function pixi_core_Point_confirm(obj, x, y) { - var expect = chai.expect; - - expect(obj).to.be.an.instanceof(PIXI.Point); - expect(obj).to.respondTo('clone'); - - expect(obj).to.have.property('x', x); - expect(obj).to.have.property('y', y); -} diff --git a/tutorial-4/pixi.js-master/test/lib/pixi/core/Rectangle.js b/tutorial-4/pixi.js-master/test/lib/pixi/core/Rectangle.js deleted file mode 100755 index 23f0d12..0000000 --- a/tutorial-4/pixi.js-master/test/lib/pixi/core/Rectangle.js +++ /dev/null @@ -1,13 +0,0 @@ - -function pixi_core_Rectangle_confirm(obj, x, y, width, height) { - var expect = chai.expect; - - expect(obj).to.be.an.instanceof(PIXI.Rectangle); - expect(obj).to.respondTo('clone'); - expect(obj).to.respondTo('contains'); - - expect(obj).to.have.property('x', x); - expect(obj).to.have.property('y', y); - expect(obj).to.have.property('width', width); - expect(obj).to.have.property('height', height); -} diff --git a/tutorial-4/pixi.js-master/test/lib/pixi/display/DisplayObject.js b/tutorial-4/pixi.js-master/test/lib/pixi/display/DisplayObject.js deleted file mode 100755 index 9ca495e..0000000 --- a/tutorial-4/pixi.js-master/test/lib/pixi/display/DisplayObject.js +++ /dev/null @@ -1,38 +0,0 @@ - -function pixi_display_DisplayObject_confirmNew(obj) { - var expect = chai.expect; - - expect(obj).to.be.an.instanceof(PIXI.DisplayObject); - //expect(obj).to.respondTo('setInteractive'); - //expect(obj).to.respondTo('addFilter'); - //expect(obj).to.respondTo('removeFilter'); - expect(obj).to.respondTo('updateTransform'); - - expect(obj).to.contain.property('position'); - pixi_core_Point_confirm(obj.position, 0, 0); - expect(obj).to.contain.property('scale'); - pixi_core_Point_confirm(obj.scale, 1, 1); - expect(obj).to.contain.property('pivot'); - pixi_core_Point_confirm(obj.pivot, 0, 0); - - expect(obj).to.have.property('rotation', 0); - expect(obj).to.have.property('alpha', 1); - expect(obj).to.have.property('visible', true); - expect(obj).to.have.property('buttonMode', false); - expect(obj).to.have.property('parent', null); - expect(obj).to.have.property('worldAlpha', 1); - - expect(obj).to.have.property('hitArea'); - expect(obj).to.have.property('interactive'); // TODO: Have a better default value - expect('mask' in obj).to.be.true; // TODO: Have a better default value - expect(obj.mask).to.be.null; - - expect(obj).to.have.property('renderable'); - expect(obj).to.have.property('stage'); - - expect(obj).to.have.deep.property('worldTransform'); - pixi_core_Matrix_confirmNewMatrix(obj.worldTransform); - - //expect(obj).to.have.deep.property('color.length', 0); - //expect(obj).to.have.property('dynamic', true); -} diff --git a/tutorial-4/pixi.js-master/test/lib/pixi/display/DisplayObjectContainer.js b/tutorial-4/pixi.js-master/test/lib/pixi/display/DisplayObjectContainer.js deleted file mode 100755 index 58160a9..0000000 --- a/tutorial-4/pixi.js-master/test/lib/pixi/display/DisplayObjectContainer.js +++ /dev/null @@ -1,18 +0,0 @@ - -function pixi_display_DisplayObjectContainer_confirmNew(obj) { - var expect = chai.expect; - - pixi_display_DisplayObject_confirmNew(obj); - - expect(obj).to.be.an.instanceof(PIXI.DisplayObjectContainer); - expect(obj).to.respondTo('addChild'); - expect(obj).to.respondTo('addChildAt'); - expect(obj).to.respondTo('swapChildren'); - expect(obj).to.respondTo('getChildAt'); - expect(obj).to.respondTo('getChildIndex'); - expect(obj).to.respondTo('setChildIndex'); - expect(obj).to.respondTo('removeChild'); - expect(obj).to.respondTo('updateTransform'); - - expect(obj).to.have.deep.property('children.length', 0); -} diff --git a/tutorial-4/pixi.js-master/test/lib/pixi/display/Sprite.js b/tutorial-4/pixi.js-master/test/lib/pixi/display/Sprite.js deleted file mode 100755 index 2288c16..0000000 --- a/tutorial-4/pixi.js-master/test/lib/pixi/display/Sprite.js +++ /dev/null @@ -1,30 +0,0 @@ - -function pixi_display_Sprite_confirmNew(obj, done) { - var expect = chai.expect; - - pixi_display_DisplayObjectContainer_confirmNew(obj); - - expect(obj).to.be.an.instanceof(PIXI.Sprite); - expect(obj).to.respondTo('setTexture'); - expect(obj).to.respondTo('onTextureUpdate'); - - expect(obj).to.have.property('hitArea', null); - expect(obj).to.have.property('interactive', false); - expect(obj).to.have.property('renderable', true); - expect(obj).to.have.property('stage', null); - - expect(obj).to.have.property('anchor'); - pixi_core_Point_confirm(obj.anchor, 0, 0); - - expect(obj).to.have.property('blendMode', PIXI.blendModes.NORMAL); - expect(obj).to.have.property('width', 1); // TODO: is 1 expected - expect(obj).to.have.property('height', 1); // TODO: is 1 expected - - expect(obj).to.have.property('tint', 0xFFFFFF); - - // FIXME: Just make this a boolean that is always there - expect(!!obj.updateFrame).to.equal(obj.texture.baseTexture.hasLoaded); - - expect(obj).to.have.property('texture'); - pixi_textures_Texture_confirmNew(obj.texture, done); -} diff --git a/tutorial-4/pixi.js-master/test/lib/pixi/extras/Strip.js b/tutorial-4/pixi.js-master/test/lib/pixi/extras/Strip.js deleted file mode 100755 index 8927a8a..0000000 --- a/tutorial-4/pixi.js-master/test/lib/pixi/extras/Strip.js +++ /dev/null @@ -1,12 +0,0 @@ - -function pixi_extras_Strip_confirmNew(obj) { - var expect = chai.expect; - - pixi_display_DisplayObjectContainer_confirmNew(obj); - - expect(obj).to.be.an.instanceof(PIXI.Strip); - expect(obj).to.respondTo('setTexture'); - expect(obj).to.respondTo('onTextureUpdate'); - - // TODO: Test properties -} diff --git a/tutorial-4/pixi.js-master/test/lib/pixi/textures/RenderTexture.js b/tutorial-4/pixi.js-master/test/lib/pixi/textures/RenderTexture.js deleted file mode 100755 index 8556501..0000000 --- a/tutorial-4/pixi.js-master/test/lib/pixi/textures/RenderTexture.js +++ /dev/null @@ -1,14 +0,0 @@ - -function pixi_textures_RenderTexture_confirmNew(obj, done) { - var expect = chai.expect; - - expect(obj).to.have.property('width'); - expect(obj).to.have.property('height'); - - expect(obj).to.have.property('render'); - expect(obj).to.have.property('renderer'); - // expect(obj).to.have.property('projection'); - expect(obj).to.have.property('textureBuffer'); - - pixi_textures_Texture_confirmNew(obj, done); -} diff --git a/tutorial-4/pixi.js-master/test/lib/pixi/textures/Texture.js b/tutorial-4/pixi.js-master/test/lib/pixi/textures/Texture.js deleted file mode 100755 index 2493385..0000000 --- a/tutorial-4/pixi.js-master/test/lib/pixi/textures/Texture.js +++ /dev/null @@ -1,26 +0,0 @@ - -function pixi_textures_Texture_confirmNew(obj, done) { - var expect = chai.expect; - - function confirmFrameDone() { - pixi_core_Rectangle_confirm(obj.frame, 0, 0, obj.baseTexture.width, obj.baseTexture.height); - - expect(obj).to.have.property('width', obj.baseTexture.width); - expect(obj).to.have.property('height', obj.baseTexture.height); - done(); - } - - expect(obj).to.be.an.instanceof(PIXI.Texture); - pixi_utils_EventTarget_confirm(obj); - - expect(obj).to.have.property('baseTexture') - .and.to.be.an.instanceof(PIXI.BaseTexture); - - expect(obj).to.have.property('frame'); - if (obj.baseTexture.hasLoaded) { - confirmFrameDone(); - } else { - obj.on('update', confirmFrameDone); - pixi_core_Rectangle_confirm(obj.frame, 0, 0, 1, 1); - } -} diff --git a/tutorial-4/pixi.js-master/test/lib/pixi/utils/EventTarget.js b/tutorial-4/pixi.js-master/test/lib/pixi/utils/EventTarget.js deleted file mode 100755 index a0c3924..0000000 --- a/tutorial-4/pixi.js-master/test/lib/pixi/utils/EventTarget.js +++ /dev/null @@ -1,34 +0,0 @@ - -function pixi_utils_EventTarget_confirm(obj) { - var expect = chai.expect; - - //public API - expect(obj).to.respondTo('listeners'); - expect(obj).to.respondTo('emit'); - expect(obj).to.respondTo('on'); - expect(obj).to.respondTo('once'); - expect(obj).to.respondTo('off'); - expect(obj).to.respondTo('removeAllListeners'); - - //Aliased names - expect(obj).to.respondTo('removeEventListener'); - expect(obj).to.respondTo('addEventListener'); - expect(obj).to.respondTo('dispatchEvent'); -} - -function pixi_utils_EventTarget_Event_confirm(event, obj, data) { - var expect = chai.expect; - - expect(event).to.be.an.instanceOf(PIXI.Event); - - expect(event).to.have.property('stopped', false); - expect(event).to.have.property('stoppedImmediate', false); - - expect(event).to.have.property('target', obj); - expect(event).to.have.property('type', data.type || 'myevent'); - expect(event).to.have.property('data', data); - expect(event).to.have.property('content', data); - - expect(event).to.respondTo('stopPropagation'); - expect(event).to.respondTo('stopImmediatePropagation'); -} \ No newline at end of file diff --git a/tutorial-4/pixi.js-master/test/lib/resemble.js b/tutorial-4/pixi.js-master/test/lib/resemble.js deleted file mode 100755 index 1cb8c29..0000000 --- a/tutorial-4/pixi.js-master/test/lib/resemble.js +++ /dev/null @@ -1,535 +0,0 @@ -/* -Author: James Cryer -Company: Huddle -Last updated date: 21 Feb 2013 -URL: https://github.com/Huddle/Resemble.js -*/ - -(function(_this){ - 'use strict'; - - _this['resemble'] = function( fileData ){ - - var data = {}; - var images = []; - var updateCallbackArray = []; - - var tolerance = { // between 0 and 255 - red: 16, - green: 16, - blue: 16, - minBrightness: 16, - maxBrightness: 240 - }; - - var ignoreAntialiasing = false; - var ignoreColors = false; - - function triggerDataUpdate(){ - var len = updateCallbackArray.length; - var i; - for(i=0;i tolerance.maxBrightness; - } - - function getHue(r,g,b){ - - r = r / 255; - g = g / 255; - b = b / 255; - var max = Math.max(r, g, b), min = Math.min(r, g, b); - var h; - var d; - - if (max == min){ - h = 0; // achromatic - } else{ - d = max - min; - switch(max){ - case r: h = (g - b) / d + (g < b ? 6 : 0); break; - case g: h = (b - r) / d + 2; break; - case b: h = (r - g) / d + 4; break; - } - h /= 6; - } - - return h; - } - - function isAntialiased(sourcePix, data, cacheSet, verticalPos, horizontalPos, width){ - var offset; - var targetPix; - var distance = 1; - var i; - var j; - var hasHighContrastSibling = 0; - var hasSiblingWithDifferentHue = 0; - var hasEquivilantSibling = 0; - - addHueInfo(sourcePix); - - for (i = distance*-1; i <= distance; i++){ - for (j = distance*-1; j <= distance; j++){ - - if(i===0 && j===0){ - // ignore source pixel - } else { - - offset = ((verticalPos+j)*width + (horizontalPos+i)) * 4; - targetPix = getPixelInfo(data, offset, cacheSet); - - if(targetPix === null){ - continue; - } - - addBrightnessInfo(targetPix); - addHueInfo(targetPix); - - if( isContrasting(sourcePix, targetPix) ){ - hasHighContrastSibling++; - } - - if( isRGBSame(sourcePix,targetPix) ){ - hasEquivilantSibling++; - } - - if( Math.abs(targetPix.h - sourcePix.h) > 0.3 ){ - hasSiblingWithDifferentHue++; - } - - if( hasSiblingWithDifferentHue > 1 || hasHighContrastSibling > 1){ - return true; - } - } - } - } - - if(hasEquivilantSibling < 2){ - return true; - } - - return false; - } - - function errorPixel(px, offset){ - px[offset] = 255; //r - px[offset + 1] = 0; //g - px[offset + 2] = 255; //b - px[offset + 3] = 255; //a - } - - function copyPixel(px, offset, data){ - px[offset] = data.r; //r - px[offset + 1] = data.g; //g - px[offset + 2] = data.b; //b - px[offset + 3] = 255; //a - } - - function copyGrayScalePixel(px, offset, data){ - px[offset] = data.brightness; //r - px[offset + 1] = data.brightness; //g - px[offset + 2] = data.brightness; //b - px[offset + 3] = 255; //a - } - - - function getPixelInfo(data, offset, cacheSet){ - var r; - var g; - var b; - var d; - - if(typeof data[offset] !== 'undefined'){ - r = data[offset]; - g = data[offset+1]; - b = data[offset+2]; - d = { - r: r, - g: g, - b: b - }; - - return d; - } else { - return null; - } - } - - function addBrightnessInfo(data){ - data.brightness = getBrightness(data.r,data.g,data.b); // 'corrected' lightness - } - - function addHueInfo(data){ - data.h = getHue(data.r,data.g,data.b); - } - - function analyseImages(img1, img2, width, height){ - - var hiddenCanvas = document.createElement('canvas'); - - var data1 = img1.data; - var data2 = img2.data; - - hiddenCanvas.width = width; - hiddenCanvas.height = height; - - var context = hiddenCanvas.getContext('2d'); - var imgd = context.createImageData(width,height); - var targetPix = imgd.data; - - var mismatchCount = 0; - - var time = Date.now(); - - var skip; - - if( (width > 1200 || height > 1200) && ignoreAntialiasing){ - skip = 6; - } - - loop(height, width, function(verticalPos, horizontalPos){ - - if(skip){ // only skip if the image isn't small - if(verticalPos % skip === 0 || horizontalPos % skip === 0){ - return; - } - } - - var offset = (verticalPos*width + horizontalPos) * 4; - var pixel1 = getPixelInfo(data1, offset, 1); - var pixel2 = getPixelInfo(data2, offset, 2); - - if(pixel1 === null || pixel2 === null){ - return; - } - - if (ignoreColors){ - - addBrightnessInfo(pixel1); - addBrightnessInfo(pixel2); - - if( isPixelBrightnessSimilar(pixel1, pixel2) ){ - copyGrayScalePixel(targetPix, offset, pixel2); - } else { - errorPixel(targetPix, offset); - mismatchCount++; - } - return; - } - - if( isRGBSimilar(pixel1, pixel2) ){ - copyPixel(targetPix, offset, pixel2); - - } else if( ignoreAntialiasing && ( - addBrightnessInfo(pixel1), // jit pixel info augmentation looks a little weird, sorry. - addBrightnessInfo(pixel2), - isAntialiased(pixel1, data1, 1, verticalPos, horizontalPos, width) || - isAntialiased(pixel2, data2, 2, verticalPos, horizontalPos, width) - )){ - - if( isPixelBrightnessSimilar(pixel1, pixel2) ){ - copyGrayScalePixel(targetPix, offset, pixel2); - } else { - errorPixel(targetPix, offset); - mismatchCount++; - } - } else { - errorPixel(targetPix, offset); - mismatchCount++; - } - - }); - - data.misMatchPercentage = (mismatchCount / (height*width) * 100).toFixed(2); - data.analysisTime = Date.now() - time; - - data.getImageDataUrl = function(text){ - var barHeight = 0; - - if(text){ - barHeight = addLabel(text,context,hiddenCanvas); - } - - context.putImageData(imgd, 0, barHeight); - - return hiddenCanvas.toDataURL("image/png"); - }; - } - - function addLabel(text, context, hiddenCanvas){ - var textPadding = 2; - - context.font = '12px sans-serif'; - - var textWidth = context.measureText(text).width + textPadding*2; - var barHeight = 22; - - if(textWidth > hiddenCanvas.width){ - hiddenCanvas.width = textWidth; - } - - hiddenCanvas.height += barHeight; - - context.fillStyle = "#666"; - context.fillRect(0,0,hiddenCanvas.width,barHeight -4); - context.fillStyle = "#fff"; - context.fillRect(0,barHeight -4,hiddenCanvas.width, 4); - - context.fillStyle = "#fff"; - context.textBaseline = "top"; - context.font = '12px sans-serif'; - context.fillText(text, textPadding, 1); - - return barHeight; - } - - function normalise(img, w, h){ - var c; - var context; - - if(img.height < h || img.width < w){ - c = document.createElement('canvas'); - c.width = w; - c.height = h; - context = c.getContext('2d'); - context.putImageData(img, 0, 0); - return context.getImageData(0, 0, w, h); - } - - return img; - } - - function compare(one, two){ - - function onceWeHaveBoth(){ - var width; - var height; - if(images.length === 2){ - width = images[0].width > images[1].width ? images[0].width : images[1].width; - height = images[0].height > images[1].height ? images[0].height : images[1].height; - - if( (images[0].width === images[1].width) && (images[0].height === images[1].height) ){ - data.isSameDimensions = true; - } else { - data.isSameDimensions = false; - } - - analyseImages( normalise(images[0],width, height), normalise(images[1],width, height), width, height); - - triggerDataUpdate(); - } - } - - images = []; - loadImageData(one, onceWeHaveBoth); - loadImageData(two, onceWeHaveBoth); - } - - function getCompareApi(param){ - - var secondFileData, - hasMethod = typeof param === 'function'; - - if( !hasMethod ){ - // assume it's file data - secondFileData = param; - } - - var self = { - ignoreNothing: function(){ - - tolerance.red = 16; - tolerance.green = 16; - tolerance.blue = 16; - tolerance.minBrightness = 16; - tolerance.maxBrightness = 240; - - ignoreAntialiasing = false; - ignoreColors = false; - - if(hasMethod) { param(); } - return self; - }, - ignoreAntialiasing: function(){ - - tolerance.red = 32; - tolerance.green = 32; - tolerance.blue = 32; - tolerance.minBrightness = 64; - tolerance.maxBrightness = 96; - - ignoreAntialiasing = true; - ignoreColors = false; - - if(hasMethod) { param(); } - return self; - }, - ignoreColors: function(){ - - tolerance.minBrightness = 16; - tolerance.maxBrightness = 240; - - ignoreAntialiasing = false; - ignoreColors = true; - - if(hasMethod) { param(); } - return self; - }, - onComplete: function( callback ){ - - updateCallbackArray.push(callback); - - var wrapper = function(){ - compare(fileData, secondFileData); - }; - - wrapper(); - - return getCompareApi(wrapper); - } - }; - - return self; - } - - return { - onComplete: function( callback ){ - updateCallbackArray.push(callback); - loadImageData(fileData, function(imageData, width, height){ - parseImage(imageData.data, width, height); - }); - }, - compareTo: function(secondFileData){ - return getCompareApi(secondFileData); - } - }; - - }; -}(this)); \ No newline at end of file diff --git a/tutorial-4/pixi.js-master/test/textures/SpriteSheet-Aliens.png b/tutorial-4/pixi.js-master/test/textures/SpriteSheet-Aliens.png deleted file mode 100755 index 210acb1..0000000 Binary files a/tutorial-4/pixi.js-master/test/textures/SpriteSheet-Aliens.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/test/textures/SpriteSheet-Explosion.png b/tutorial-4/pixi.js-master/test/textures/SpriteSheet-Explosion.png deleted file mode 100755 index 79e1a69..0000000 Binary files a/tutorial-4/pixi.js-master/test/textures/SpriteSheet-Explosion.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/test/textures/bunny.png b/tutorial-4/pixi.js-master/test/textures/bunny.png deleted file mode 100755 index 79c3167..0000000 Binary files a/tutorial-4/pixi.js-master/test/textures/bunny.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/InteractionManager.js b/tutorial-4/pixi.js-master/test/unit/pixi/InteractionManager.js deleted file mode 100755 index ed3001f..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/InteractionManager.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/InteractionManager', function () { - 'use strict'; - - var expect = chai.expect; - var InteractionManager = PIXI.InteractionManager; - - it('Module exists', function () { - expect(InteractionManager).to.be.a('function'); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/Pixi.js b/tutorial-4/pixi.js-master/test/unit/pixi/Pixi.js deleted file mode 100755 index 27debc1..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/Pixi.js +++ /dev/null @@ -1,9 +0,0 @@ -describe('pixi/Pixi', function () { - 'use strict'; - - var expect = chai.expect; - - it('Module exists', function () { - expect(global).to.have.property('PIXI').and.to.be.an('object'); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/core/Circle.js b/tutorial-4/pixi.js-master/test/unit/pixi/core/Circle.js deleted file mode 100755 index fbcfa17..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/core/Circle.js +++ /dev/null @@ -1,21 +0,0 @@ -describe('pixi/core/Circle', function () { - 'use strict'; - - var expect = chai.expect; - var Circle = PIXI.Circle; - - it('Module exists', function () { - expect(Circle).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new Circle(); - pixi_core_Circle_confirmNewCircle(obj); - }); - - it("getBounds should return Rectangle that bounds the circle", function() { - var obj = new Circle(100, 250, 50); - var bounds = obj.getBounds(); - pixi_core_Circle_isBoundedByRectangle(obj, bounds); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/core/Ellipse.js b/tutorial-4/pixi.js-master/test/unit/pixi/core/Ellipse.js deleted file mode 100755 index 026b56f..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/core/Ellipse.js +++ /dev/null @@ -1,24 +0,0 @@ -describe('pixi/core/Ellipse', function () { - 'use strict'; - - var expect = chai.expect; - var Ellipse = PIXI.Ellipse; - - it('Module exists', function () { - expect(Ellipse).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new Ellipse(); - - expect(obj).to.be.an.instanceof(Ellipse); - expect(obj).to.respondTo('clone'); - expect(obj).to.respondTo('contains'); - expect(obj).to.respondTo('getBounds'); - - expect(obj).to.have.property('x', 0); - expect(obj).to.have.property('y', 0); - expect(obj).to.have.property('width', 0); - expect(obj).to.have.property('height', 0); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/core/Matrix.js b/tutorial-4/pixi.js-master/test/unit/pixi/core/Matrix.js deleted file mode 100755 index da75e2e..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/core/Matrix.js +++ /dev/null @@ -1,14 +0,0 @@ -describe('pixi/core/Matrix', function () { - 'use strict'; - - var expect = chai.expect; - - it('Matrix exists', function () { - expect(PIXI.Matrix).to.be.an('function'); - }); - - it('Confirm new Matrix', function () { - var matrix = new PIXI.Matrix(); - pixi_core_Matrix_confirmNewMatrix(matrix); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/core/Point.js b/tutorial-4/pixi.js-master/test/unit/pixi/core/Point.js deleted file mode 100755 index c4d5163..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/core/Point.js +++ /dev/null @@ -1,15 +0,0 @@ -describe('pixi/core/Point', function () { - 'use strict'; - - var expect = chai.expect; - var Point = PIXI.Point; - - it('Module exists', function () { - expect(Point).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new Point(); - pixi_core_Point_confirm(obj, 0, 0); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/core/Polygon.js b/tutorial-4/pixi.js-master/test/unit/pixi/core/Polygon.js deleted file mode 100755 index dc8c918..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/core/Polygon.js +++ /dev/null @@ -1,20 +0,0 @@ -describe('pixi/core/Polygon', function () { - 'use strict'; - - var expect = chai.expect; - var Polygon = PIXI.Polygon; - - it('Module exists', function () { - expect(Polygon).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new Polygon(); - - expect(obj).to.be.an.instanceof(Polygon); - expect(obj).to.respondTo('clone'); - expect(obj).to.respondTo('contains'); - - expect(obj).to.have.deep.property('points.length', 0); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/core/Rectangle.js b/tutorial-4/pixi.js-master/test/unit/pixi/core/Rectangle.js deleted file mode 100755 index d43316e..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/core/Rectangle.js +++ /dev/null @@ -1,15 +0,0 @@ -describe('pixi/core/Rectangle', function () { - 'use strict'; - - var expect = chai.expect; - var Rectangle = PIXI.Rectangle; - - it('Module exists', function () { - expect(Rectangle).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var rect = new Rectangle(); - pixi_core_Rectangle_confirm(rect, 0, 0, 0, 0); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/display/DisplayObject.js b/tutorial-4/pixi.js-master/test/unit/pixi/display/DisplayObject.js deleted file mode 100755 index 044acf8..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/display/DisplayObject.js +++ /dev/null @@ -1,21 +0,0 @@ -describe('pixi/display/DisplayObject', function () { - 'use strict'; - - var expect = chai.expect; - var DisplayObject = PIXI.DisplayObject; - - it('Module exists', function () { - expect(DisplayObject).to.be.a('function'); - // expect(PIXI).to.have.property('visibleCount', 0); - }); - - it('Confirm new instance', function () { - var obj = new DisplayObject(); - - pixi_display_DisplayObject_confirmNew(obj); - expect(obj).to.have.property('hitArea', null); - expect(obj).to.have.property('interactive', false); - expect(obj).to.have.property('renderable', false); - expect(obj).to.have.property('stage', null); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/display/DisplayObjectContainer.js b/tutorial-4/pixi.js-master/test/unit/pixi/display/DisplayObjectContainer.js deleted file mode 100755 index 15a3376..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/display/DisplayObjectContainer.js +++ /dev/null @@ -1,67 +0,0 @@ -describe('pixi/display/DisplayObjectContainer', function () { - 'use strict'; - - var expect = chai.expect; - var DisplayObjectContainer = PIXI.DisplayObjectContainer; - - it('Module exists', function () { - expect(DisplayObjectContainer).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new DisplayObjectContainer(); - - pixi_display_DisplayObjectContainer_confirmNew(obj); - expect(obj).to.have.property('hitArea', null); - expect(obj).to.have.property('interactive', false); - expect(obj).to.have.property('renderable', false); - expect(obj).to.have.property('stage', null); - }); - - it('Gets child index', function() { - var container = new PIXI.DisplayObjectContainer(); - var children = []; - for (var i = 0; i < 10; i++) { - var child = new PIXI.DisplayObject(); - children.push(child); - container.addChild(child); - } - - for (i = 0; i < children.length; i++) { - expect(i).to.eql(container.getChildIndex(children[i])); - } - }); - - it('throws error when trying to get index of not a child', function() { - var container = new PIXI.DisplayObjectContainer(); - var child = new PIXI.DisplayObject(); - - expect(function() { container.getChildIndex(child); }).to.throw(); - }); - - it('Sets child index', function() { - var container = new PIXI.DisplayObjectContainer(); - var children = []; - - for (var i = 0; i < 10; i++) { - var child = new PIXI.DisplayObject(); - children.push(child); - container.addChild(child); - } - children.reverse(); - - for (i = 0; i < children.length; i++) { - container.setChildIndex(children[i], i); - expect(i).to.eql(container.getChildIndex(children[i])); - } - }); - - it('throws error when trying to set incorect index', function() { - var container = new PIXI.DisplayObjectContainer(); - var child = new PIXI.DisplayObject(); - container.addChild(child); - - expect(function() { container.setChildIndex(child, -1); }).to.throw(); - expect(function() { container.setChildIndex(child, 1); }).to.throw(); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/display/MovieClip.js b/tutorial-4/pixi.js-master/test/unit/pixi/display/MovieClip.js deleted file mode 100755 index f3c6c6a..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/display/MovieClip.js +++ /dev/null @@ -1,33 +0,0 @@ -describe('pixi/display/MovieClip', function () { - 'use strict'; - - var expect = chai.expect; - var MovieClip = PIXI.MovieClip; - var Texture = PIXI.Texture; - - it('Module exists', function () { - expect(MovieClip).to.be.a('function'); - }); - - it('Confirm new instance', function (done) { - var texture = Texture.fromImage('/base/test/textures/SpriteSheet-Explosion.png'); - var obj = new MovieClip([texture]); - - pixi_display_Sprite_confirmNew(obj, done); - - expect(obj).to.be.an.instanceof(MovieClip); - expect(obj).to.respondTo('stop'); - expect(obj).to.respondTo('play'); - expect(obj).to.respondTo('gotoAndStop'); - expect(obj).to.respondTo('gotoAndPlay'); - expect(obj).to.respondTo('updateTransform'); - - expect(obj).to.have.deep.property('textures.length', 1); - expect(obj).to.have.deep.property('textures[0]', texture); - expect(obj).to.have.property('animationSpeed', 1); - expect(obj).to.have.property('loop', true); - expect(obj).to.have.property('onComplete', null); - expect(obj).to.have.property('currentFrame', 0); - expect(obj).to.have.property('playing', false); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/display/Sprite.js b/tutorial-4/pixi.js-master/test/unit/pixi/display/Sprite.js deleted file mode 100755 index 30c8076..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/display/Sprite.js +++ /dev/null @@ -1,28 +0,0 @@ -describe('pixi/display/Sprite', function () { - 'use strict'; - - var expect = chai.expect; - var Sprite = PIXI.Sprite; - var Texture = PIXI.Texture; - - it('Module exists', function () { - expect(Sprite).to.be.a('function'); - expect(PIXI).to.have.deep.property('blendModes.NORMAL', 0); - expect(PIXI).to.have.deep.property('blendModes.ADD', 1); - expect(PIXI).to.have.deep.property('blendModes.MULTIPLY', 2); - expect(PIXI).to.have.deep.property('blendModes.SCREEN', 3); - }); - - - it('Members exist', function () { - expect(Sprite).itself.to.respondTo('fromImage'); - expect(Sprite).itself.to.respondTo('fromFrame'); - }); - - it('Confirm new instance', function (done) { - var texture = Texture.fromImage('/base/test/textures/SpriteSheet-Aliens.png'); - var obj = new Sprite(texture); - - pixi_display_Sprite_confirmNew(obj, done); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/display/Stage.js b/tutorial-4/pixi.js-master/test/unit/pixi/display/Stage.js deleted file mode 100755 index 6974c2e..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/display/Stage.js +++ /dev/null @@ -1,49 +0,0 @@ -describe('pixi/display/Stage', function () { - 'use strict'; - - var expect = chai.expect; - var Stage = PIXI.Stage; - var InteractionManager = PIXI.InteractionManager; - var Rectangle = PIXI.Rectangle; - - it('Module exists', function () { - expect(Stage).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var obj = new Stage(null, true); - - pixi_display_DisplayObjectContainer_confirmNew(obj); - - expect(obj).to.be.an.instanceof(Stage); - expect(obj).to.respondTo('updateTransform'); - expect(obj).to.respondTo('setBackgroundColor'); - expect(obj).to.respondTo('getMousePosition'); - // FIXME: duplicate member in DisplayObject - pixi_core_Matrix_confirmNewMatrix(obj.worldTransform); - // FIXME: convert arg to bool in constructor - expect(obj).to.have.property('interactive', true); - - expect(obj).to.have.property('interactionManager') - .and.to.be.an.instanceof(InteractionManager) - .and.to.have.property('stage', obj); - - expect(obj).to.have.property('dirty', true); - - expect(obj).to.have.property('stage', obj); - - expect(obj).to.have.property('hitArea') - .and.to.be.an.instanceof(Rectangle); - pixi_core_Rectangle_confirm(obj.hitArea, 0, 0, 100000, 100000); - - expect(obj).to.have.property('backgroundColor', 0x000000); - expect(obj).to.have.deep.property('backgroundColorSplit.length', 3); - expect(obj).to.have.deep.property('backgroundColorSplit[0]', 0); - expect(obj).to.have.deep.property('backgroundColorSplit[1]', 0); - expect(obj).to.have.deep.property('backgroundColorSplit[2]', 0); - expect(obj).to.have.property('backgroundColorString', '#000000'); - - - expect(obj).to.have.property('worldVisible', true); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/extras/Rope.js b/tutorial-4/pixi.js-master/test/unit/pixi/extras/Rope.js deleted file mode 100755 index 05885ac..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/extras/Rope.js +++ /dev/null @@ -1,31 +0,0 @@ -describe('pixi/extras/Rope', function () { - 'use strict'; - - var expect = chai.expect; - var Rope = PIXI.Rope; - var Texture = PIXI.Texture; - var Point = PIXI.Point; - - it('Module exists', function () { - expect(Rope).to.be.a('function'); - }); - - it('Confirm new instance', function () { - - var texture = Texture.fromImage('/base/test/textures/bunny.png'); - - // TODO-Alvin - // Same as Strip - - // var obj = new Rope(texture, [new Point(), new Point(5, 10), new Point(10, 20)]); - - // pixi_extras_Strip_confirmNew(obj); - - // expect(obj).to.be.an.instanceof(Rope); - // expect(obj).to.respondTo('refresh'); - // expect(obj).to.respondTo('updateTransform'); - // expect(obj).to.respondTo('setTexture'); - - // TODO: Test properties - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/extras/Spine.js b/tutorial-4/pixi.js-master/test/unit/pixi/extras/Spine.js deleted file mode 100755 index 0708bc0..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/extras/Spine.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/extras/Spine', function () { - 'use strict'; - - var expect = chai.expect; - var Spine = PIXI.Spine; - - it('Module exists', function () { - expect(Spine).to.be.a('function'); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/extras/Strip.js b/tutorial-4/pixi.js-master/test/unit/pixi/extras/Strip.js deleted file mode 100755 index 230af90..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/extras/Strip.js +++ /dev/null @@ -1,26 +0,0 @@ -describe('pixi/extras/Strip', function () { - 'use strict'; - - var expect = chai.expect; - var Strip = PIXI.Strip; - var Texture = PIXI.Texture; - - it('Module exists', function () { - expect(Strip).to.be.a('function'); - }); - - it('Confirm new instance', function () { - - - // TODO-Alvin - // We tweaked it to make it pass the tests, but the whole strip class needs - // to be re-coded - - var texture = Texture.fromImage('/base/test/textures/bunny.png'); - - // var obj = new Strip(texture, 20, 10000); - - - // pixi_extras_Strip_confirmNew(obj); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/extras/TilingSprite.js b/tutorial-4/pixi.js-master/test/unit/pixi/extras/TilingSprite.js deleted file mode 100755 index 56aea14..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/extras/TilingSprite.js +++ /dev/null @@ -1,24 +0,0 @@ -describe('pixi/extras/TilingSprite', function () { - 'use strict'; - - var expect = chai.expect; - var TilingSprite = PIXI.TilingSprite; - var Texture = PIXI.Texture; - - it('Module exists', function () { - expect(TilingSprite).to.be.a('function'); - }); - - it('Confirm new instance', function () { - var texture = Texture.fromImage('/base/test/textures/bunny.png'); - var obj = new TilingSprite(texture, 6000, 12000); - - pixi_display_DisplayObjectContainer_confirmNew(obj); - - expect(obj).to.be.an.instanceof(TilingSprite); - expect(obj).to.respondTo('setTexture'); - expect(obj).to.respondTo('onTextureUpdate'); - - // TODO: Test properties - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/filters/FilterBlock.js b/tutorial-4/pixi.js-master/test/unit/pixi/filters/FilterBlock.js deleted file mode 100755 index 870cec0..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/filters/FilterBlock.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/filters/FilterBlock', function () { - 'use strict'; - - var expect = chai.expect; - var FilterBlock = PIXI.FilterBlock; - - it('Module exists', function () { - expect(FilterBlock).to.be.a('function'); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/loaders/AssetLoader.js b/tutorial-4/pixi.js-master/test/unit/pixi/loaders/AssetLoader.js deleted file mode 100755 index a0aa0b5..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/loaders/AssetLoader.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/loaders/AssetLoader', function () { - 'use strict'; - - var expect = chai.expect; - var AssetLoader = PIXI.AssetLoader; - - it('Module exists', function () { - expect(AssetLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/loaders/BitmapFontLoader.js b/tutorial-4/pixi.js-master/test/unit/pixi/loaders/BitmapFontLoader.js deleted file mode 100755 index 046f018..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/loaders/BitmapFontLoader.js +++ /dev/null @@ -1,9 +0,0 @@ -describe('pixi/loaders/BitmapFontLoader', function () { - 'use strict'; - - var expect = chai.expect; - - it('Module exists', function () { - expect(PIXI.BitmapFontLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/loaders/ImageLoader.js b/tutorial-4/pixi.js-master/test/unit/pixi/loaders/ImageLoader.js deleted file mode 100755 index 8b1f556..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/loaders/ImageLoader.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/loaders/ImageLoader', function () { - 'use strict'; - - var expect = chai.expect; - var ImageLoader = PIXI.ImageLoader; - - it('Module exists', function () { - expect(ImageLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/loaders/JsonLoader.js b/tutorial-4/pixi.js-master/test/unit/pixi/loaders/JsonLoader.js deleted file mode 100755 index c577e83..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/loaders/JsonLoader.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/loaders/JsonLoader', function () { - 'use strict'; - - var expect = chai.expect; - var JsonLoader = PIXI.JsonLoader; - - it('Module exists', function () { - expect(JsonLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/loaders/SpineLoader.js b/tutorial-4/pixi.js-master/test/unit/pixi/loaders/SpineLoader.js deleted file mode 100755 index fdcc0b8..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/loaders/SpineLoader.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/loaders/SpineLoader', function () { - 'use strict'; - - var expect = chai.expect; - var SpineLoader = PIXI.SpineLoader; - - it('Module exists', function () { - expect(SpineLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/loaders/SpriteSheetLoader.js b/tutorial-4/pixi.js-master/test/unit/pixi/loaders/SpriteSheetLoader.js deleted file mode 100755 index 57beb27..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/loaders/SpriteSheetLoader.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/loaders/SpriteSheetLoader', function () { - 'use strict'; - - var expect = chai.expect; - var SpriteSheetLoader = PIXI.SpriteSheetLoader; - - it('Module exists', function () { - expect(SpriteSheetLoader).to.be.a('function'); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/primitives/Graphics.js b/tutorial-4/pixi.js-master/test/unit/pixi/primitives/Graphics.js deleted file mode 100755 index f3849eb..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/primitives/Graphics.js +++ /dev/null @@ -1,44 +0,0 @@ -describe('pixi/primitives/Graphics', function () { - 'use strict'; - - var expect = chai.expect; - var Graphics = PIXI.Graphics; - - it('Module exists', function () { - expect(Graphics).to.be.a('function'); - - expect(Graphics).itself.to.have.property('POLY', 0); - expect(Graphics).itself.to.have.property('RECT', 1); - expect(Graphics).itself.to.have.property('CIRC', 2); - expect(Graphics).itself.to.have.property('ELIP', 3); - expect(Graphics).itself.to.have.property('RREC', 4); - }); - - it('Confirm new instance', function () { - var obj = new Graphics(); - - pixi_display_DisplayObjectContainer_confirmNew(obj); - - expect(obj).to.be.an.instanceof(Graphics); - expect(obj).to.respondTo('lineStyle'); - expect(obj).to.respondTo('lineStyle'); - expect(obj).to.respondTo('moveTo'); - expect(obj).to.respondTo('lineTo'); - expect(obj).to.respondTo('beginFill'); - expect(obj).to.respondTo('endFill'); - expect(obj).to.respondTo('drawRect'); - // expect(obj).to.respondTo('drawRoundedRect'); - expect(obj).to.respondTo('drawCircle'); - expect(obj).to.respondTo('drawEllipse'); - expect(obj).to.respondTo('clear'); - - expect(obj).to.have.property('renderable', true); - expect(obj).to.have.property('fillAlpha', 1); - expect(obj).to.have.property('lineWidth', 0); - expect(obj).to.have.property('width', 0); - expect(obj).to.have.property('height', 0); - expect(obj).to.have.property('lineColor', 0); - expect(obj).to.have.deep.property('graphicsData.length', 0); - // expect(obj).to.have.deep.property('currentPath.points.length', 0); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasGraphics.js b/tutorial-4/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasGraphics.js deleted file mode 100755 index 8f44472..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasGraphics.js +++ /dev/null @@ -1,15 +0,0 @@ -describe('renders/canvas/CanvasGraphics', function () { - 'use strict'; - - var expect = chai.expect; - var CanvasGraphics = PIXI.CanvasGraphics; - - it('Module exists', function () { - expect(CanvasGraphics).to.be.a('function'); - }); - - it('Members exist', function () { - expect(CanvasGraphics).itself.to.respondTo('renderGraphics'); - expect(CanvasGraphics).itself.to.respondTo('renderGraphicsMask'); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasRenderer.js b/tutorial-4/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasRenderer.js deleted file mode 100755 index 1646444..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/renderers/canvas/CanvasRenderer.js +++ /dev/null @@ -1,36 +0,0 @@ -describe('renderers/canvas/CanvasRenderer', function () { - 'use strict'; - - var expect = chai.expect; - var CanvasRenderer = PIXI.CanvasRenderer; - - it('Module exists', function () { - expect(CanvasRenderer).to.be.a('function'); - }); - - describe('.autoResize', function () { - it('Should automatically resize view if enabled', function () { - var renderer = new CanvasRenderer(200, 200, { - autoResize: true - }); - - expect(renderer.view.style.width).to.equal('200px'); - }); - - it('Should not automatically resize view if disabled', function () { - var renderer = new CanvasRenderer(200, 200, { - autoResize: false - }); - - expect(renderer.view.style.width).to.equal(''); - }); - - it('Should not automatically resize view if not specified', function () { - var renderer = new CanvasRenderer(200, 200, { - resolution: 2 - }); - - expect(renderer.view.style.width).to.equal(''); - }); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLGraphics.js b/tutorial-4/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLGraphics.js deleted file mode 100755 index 5867b28..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLGraphics.js +++ /dev/null @@ -1,20 +0,0 @@ -describe('renderers/wegbl/WebGLGraphics', function () { - 'use strict'; - - var expect = chai.expect; - var WebGLGraphics = PIXI.WebGLGraphics; - - it('Module exists', function () { - expect(WebGLGraphics).to.be.a('function'); - }); - - it('Members exist', function () { - expect(WebGLGraphics).itself.to.respondTo('renderGraphics'); - expect(WebGLGraphics).itself.to.respondTo('updateGraphics'); - expect(WebGLGraphics).itself.to.respondTo('buildRectangle'); - expect(WebGLGraphics).itself.to.respondTo('buildRoundedRectangle'); - expect(WebGLGraphics).itself.to.respondTo('buildCircle'); - expect(WebGLGraphics).itself.to.respondTo('buildLine'); - expect(WebGLGraphics).itself.to.respondTo('buildPoly'); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLRenderer.js b/tutorial-4/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLRenderer.js deleted file mode 100755 index 1680a80..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLRenderer.js +++ /dev/null @@ -1,49 +0,0 @@ -describe('renderers/webgl/WebGLRenderer', function () { - 'use strict'; - - var expect = chai.expect; - var WebGLRenderer = PIXI.WebGLRenderer; - - it('Module exists', function () { - expect(WebGLRenderer).to.be.a('function'); - }); - - // Skip tests if WebGL is not available (WebGL not supported in Travis CI) - try { - var renderer = new WebGLRenderer(400, 300, {}); - renderer.destroy(); - } catch (error) { - return; - } - - it('Destroy renderer', function () { - var renderer = new WebGLRenderer(400, 300, {}); - renderer.destroy(); - }); - - describe('.autoResize', function () { - it('Should automatically resize view if enabled', function () { - var renderer = new WebGLRenderer(200, 200, { - autoResize: true - }); - - expect(renderer.view.style.width).to.equal('200px'); - }); - - it('Should not automatically resize view if disabled', function () { - var renderer = new WebGLRenderer(200, 200, { - autoResize: false - }); - - expect(renderer.view.style.width).to.equal(''); - }); - - it('Should not automatically resize view if not specified', function () { - var renderer = new WebGLRenderer(200, 200, { - resolution: 2 - }); - - expect(renderer.view.style.width).to.equal(''); - }); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLShaders.js b/tutorial-4/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLShaders.js deleted file mode 100755 index 6e33e4f..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLShaders.js +++ /dev/null @@ -1,13 +0,0 @@ -describe('renderers/webgl/WebGLShaders', function () { - 'use strict'; - - var expect = chai.expect; - - it('Module members exist', function () { - - expect(PIXI).to.respondTo('CompileVertexShader'); - expect(PIXI).to.respondTo('CompileFragmentShader'); - expect(PIXI).to.respondTo('_CompileShader'); - expect(PIXI).to.respondTo('compileProgram'); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLSpriteBatch.js b/tutorial-4/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLSpriteBatch.js deleted file mode 100755 index e662b63..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/renderers/webgl/WebGLSpriteBatch.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('renderers/webgl/utils/WebGLSpriteBatch', function () { - 'use strict'; - - var expect = chai.expect; - var WebGLSpriteBatch = PIXI.WebGLSpriteBatch; - - it('Module exists', function () { - expect(WebGLSpriteBatch).to.be.a('function'); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/text/BitmapText.js b/tutorial-4/pixi.js-master/test/unit/pixi/text/BitmapText.js deleted file mode 100755 index 9388e3d..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/text/BitmapText.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/text/BitmapText', function () { - 'use strict'; - - var expect = chai.expect; - var BitmapText = PIXI.BitmapText; - - it('Module exists', function () { - expect(BitmapText).to.be.a('function'); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/text/Text.js b/tutorial-4/pixi.js-master/test/unit/pixi/text/Text.js deleted file mode 100755 index 9bc9ac5..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/text/Text.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/text/Text', function () { - 'use strict'; - - var expect = chai.expect; - var Text = PIXI.Text; - - it('Module exists', function () { - expect(Text).to.be.a('function'); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/textures/BaseTexture.js b/tutorial-4/pixi.js-master/test/unit/pixi/textures/BaseTexture.js deleted file mode 100755 index 502b724..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/textures/BaseTexture.js +++ /dev/null @@ -1,11 +0,0 @@ -describe('pixi/textures/BaseTexture', function () { - 'use strict'; - - var expect = chai.expect; - var BaseTexture = PIXI.BaseTexture; - - it('Module exists', function () { - expect(BaseTexture).to.be.a('function'); - expect(PIXI).to.have.property('BaseTextureCache').and.to.be.an('object'); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/textures/RenderTexture.js b/tutorial-4/pixi.js-master/test/unit/pixi/textures/RenderTexture.js deleted file mode 100755 index 96acdb4..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/textures/RenderTexture.js +++ /dev/null @@ -1,15 +0,0 @@ -describe('pixi/textures/RenderTexture', function () { - 'use strict'; - - var expect = chai.expect; - var RenderTexture = PIXI.RenderTexture; - - it('Module exists', function () { - expect(RenderTexture).to.be.a('function'); - }); - - it('Confirm new instance', function (done) { - var texture = new RenderTexture(100, 100, new PIXI.CanvasRenderer()); - pixi_textures_RenderTexture_confirmNew(texture, done); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/textures/Texture.js b/tutorial-4/pixi.js-master/test/unit/pixi/textures/Texture.js deleted file mode 100755 index 090f64d..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/textures/Texture.js +++ /dev/null @@ -1,26 +0,0 @@ -describe('pixi/textures/Texture', function () { - 'use strict'; - - var expect = chai.expect; - var Texture = PIXI.Texture; - - it('Module exists', function () { - expect(Texture).to.be.a('function'); - expect(PIXI).to.have.property('TextureCache').and.to.be.an('object'); - }); - - it('Members exist', function () { - expect(Texture).itself.to.respondTo('fromImage'); - expect(Texture).itself.to.respondTo('fromFrame'); - expect(Texture).itself.to.respondTo('fromCanvas'); - expect(Texture).itself.to.respondTo('addTextureToCache'); - expect(Texture).itself.to.respondTo('removeTextureFromCache'); - - // expect(Texture).itself.to.have.deep.property('frameUpdates.length', 0); - }); - - it('Confirm new instance', function (done) { - var texture = Texture.fromImage('/base/test/textures/bunny.png'); - pixi_textures_Texture_confirmNew(texture, done); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/utils/Detector.js b/tutorial-4/pixi.js-master/test/unit/pixi/utils/Detector.js deleted file mode 100755 index 4cf6008..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/utils/Detector.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('pixi/utils/Detector', function () { - 'use strict'; - - var expect = chai.expect; - var autoDetectRenderer = PIXI.autoDetectRenderer; - - it('Module exists', function () { - expect(autoDetectRenderer).to.be.a('function'); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/utils/EventTarget.js b/tutorial-4/pixi.js-master/test/unit/pixi/utils/EventTarget.js deleted file mode 100755 index 1cfc3a4..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/utils/EventTarget.js +++ /dev/null @@ -1,361 +0,0 @@ -describe('pixi/utils/EventTarget', function () { - 'use strict'; - - var expect = chai.expect; - - var Clazz, PClazz, obj, pobj, obj2; - beforeEach(function () { - Clazz = function () {}; - PClazz = function () {}; - - PIXI.EventTarget.mixin(Clazz.prototype); - PIXI.EventTarget.mixin(PClazz.prototype); - - obj = new Clazz(); - obj2 = new Clazz(); - pobj = new PClazz(); - - obj.parent = pobj; - obj2.parent = obj; - }); - - it('Module exists', function () { - expect(PIXI.EventTarget).to.be.an('object'); - }); - - it('Confirm new instance', function () { - pixi_utils_EventTarget_confirm(obj); - }); - - it('simple on/emit case works', function () { - var myData = {}; - - obj.on('myevent', function (event) { - pixi_utils_EventTarget_Event_confirm(event, obj, myData); - }); - - obj.emit('myevent', myData); - }); - - it('simple once case works', function () { - var called = 0; - - obj.once('myevent', function() { called++; }); - - obj.emit('myevent'); - obj.emit('myevent'); - obj.emit('myevent'); - obj.emit('myevent'); - obj.emit('myevent'); - - expect(called).to.equal(1); - }); - - it('simple off case works', function (done) { - function onMyEvent() { - done(new Error('Event listener should not have been called')); - } - - obj.on('myevent', onMyEvent); - obj.off('myevent', onMyEvent); - obj.emit('myevent'); - - done(); - }); - - it('simple propagation case works', function (done) { - var myData = {}; - - pobj.on('myevent', function () { - done(); - }); - - obj.emit('myevent'); - }); - - it('simple stopPropagation case works', function (done) { - var myData = {}; - - pobj.on('myevent', function () { - done(new Error('Event listener should not have been called on the parent element')); - }); - - obj.on('myevent', function (evt) { - evt.stopPropagation(); - }); - - obj.emit('myevent'); - - done(); - }); - - it('simple stopImmediatePropagation case works', function (done) { - var myData = {}; - - pobj.on('myevent', function () { - done(new Error('Event listener should not have been called on the parent')); - }); - - obj.on('myevent', function (evt) { - evt.stopImmediatePropagation(); - }); - - obj.on('myevent', function () { - done(new Error('Event listener should not have been called on the second')); - }); - - obj.emit('myevent'); - - done(); - }); - - it('multiple dispatches work properly', function () { - var called = 0; - - function onMyEvent() { - called++; - } - - obj.on('myevent', onMyEvent); - obj.emit('myevent'); - obj.emit('myevent'); - obj.emit('myevent'); - obj.emit('myevent'); - - expect(called).to.equal(4); - }); - - it('multiple events work properly', function () { - var called = 0; - - function onMyEvent() { - called++; - } - - obj.on('myevent1', onMyEvent); - obj.on('myevent2', onMyEvent); - obj.on('myevent3', onMyEvent); - obj.emit('myevent1'); - obj.emit('myevent2'); - obj.emit('myevent3'); - - expect(called).to.equal(3); - }); - - it('multiple events one removed works properly', function () { - var called = 0; - - function onMyEvent() { - called++; - } - - obj.on('myevent1', onMyEvent); - obj.on('myevent2', onMyEvent); - obj.on('myevent3', onMyEvent); - - obj.emit('myevent1'); - obj.emit('myevent2'); - obj.emit('myevent3'); - - obj.off('myevent2', onMyEvent); - - obj.emit('myevent1'); - obj.emit('myevent2'); - obj.emit('myevent3'); - - expect(called).to.equal(5); - }); - - it('multiple handlers for one event with some removed', function () { - var called = 0; - - var onMyEvent = function () { - called++; - }, - onMyEvent2 = function () { - called++; - }; - - // add 2 handlers and confirm they both get called - obj.on('myevent', onMyEvent); - obj.on('myevent', onMyEvent); - obj.on('myevent', onMyEvent2); - obj.on('myevent', onMyEvent2); - - obj.emit('myevent'); - - expect(called).to.equal(4); - - // remove one of the handlers, emit again, then ensure 1 more call is made - obj.off('myevent', onMyEvent); - - obj.emit('myevent'); - - expect(called).to.equal(6); - }); - - it('calls to off without a handler do nothing', function () { - var called = 0; - - var onMyEvent = function () { - called++; - }; - - obj.on('myevent', onMyEvent); - obj.on('myevent', onMyEvent); - - obj.emit('myevent'); - - expect(called).to.equal(2); - - obj.off('myevent'); - - obj.emit('myevent'); - - expect(called).to.equal(4); - - obj.off('myevent', onMyEvent); - - obj.emit('myevent'); - - expect(called).to.equal(4); - }); - - it('handles multiple instances with the same prototype', function () { - var called = 0; - - function onMyEvent(e) { - called++; - } - - obj.on('myevent1', onMyEvent); - obj.on('myevent2', onMyEvent); - - obj2.istwo = true; - obj2.on('myevent1', onMyEvent); - obj2.on('myevent2', onMyEvent); - - obj.emit('myevent1'); - obj.emit('myevent2'); - obj2.emit('myevent1'); - obj2.emit('myevent2'); - - //we emit 4 times, but since obj2 is a child of obj the event should bubble - //up to obj and show up there as well. So the obj2.emit() calls each increment - //the counter twice. - expect(called).to.equal(6); - }); - - it('is backwards compatible with older .dispatchEvent({})', function () { - var called = 0, - data = { - some: 'thing', - hello: true - }; - - function onMyEvent(event) { - pixi_utils_EventTarget_Event_confirm(event, obj, data); - - called++; - } - - obj.on('myevent1', onMyEvent); - obj.on('myevent2', onMyEvent); - obj.on('myevent3', onMyEvent); - - data.type = 'myevent1'; - obj.emit(data); - - data.type = 'myevent2'; - obj.emit(data); - - data.type = 'myevent3'; - obj.emit(data); - - obj.off('myevent2', onMyEvent); - - data.type = 'myevent1'; - obj.emit(data); - - data.type = 'myevent2'; - obj.emit(data); - - data.type = 'myevent3'; - obj.emit(data); - - expect(called).to.equal(5); - }); - - it('is backwards compatible with older .call(this)', function () { - var Fn = function() { - PIXI.EventTarget.call(this); - }, - o = new Fn(); - - pixi_utils_EventTarget_confirm(o); - }); - - it('is backwards compatible with older .addEventListener("")', function () { - var called = 0, - data = { - some: 'thing', - hello: true - }; - - function onMyEvent(event) { - pixi_utils_EventTarget_Event_confirm(event, obj, data); - - called++; - } - - obj.addEventListener('myevent1', onMyEvent); - obj.addEventListener('myevent2', onMyEvent); - obj.addEventListener('myevent3', onMyEvent); - - data.type = 'myevent1'; - obj.emit(data); - - data.type = 'myevent2'; - obj.emit(data); - - data.type = 'myevent3'; - obj.emit(data); - - obj.off('myevent2', onMyEvent); - - data.type = 'myevent1'; - obj.emit(data); - - data.type = 'myevent2'; - obj.emit(data); - - data.type = 'myevent3'; - obj.emit(data); - - expect(called).to.equal(5); - }); - - it('event remove during emit call properly', function () { - var called = 0; - - function cb1() { - called++; - obj.off('myevent', cb1); - } - function cb2() { - called++; - obj.off('myevent', cb2); - } - function cb3() { - called++; - obj.off('myevent', cb3); - } - - obj.on('myevent', cb1); - obj.on('myevent', cb2); - obj.on('myevent', cb3); - obj.emit('myevent', ''); - - expect(called).to.equal(3); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/utils/Polyk.js b/tutorial-4/pixi.js-master/test/unit/pixi/utils/Polyk.js deleted file mode 100755 index dfc7128..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/utils/Polyk.js +++ /dev/null @@ -1,14 +0,0 @@ -describe('pixi/utils/Polyk', function () { - 'use strict'; - - var expect = chai.expect; - var PolyK = PIXI.PolyK; - - it('Module exists', function () { - expect(PolyK).to.be.an('object'); - }); - - it('Members exist', function () { - expect(PolyK).to.respondTo('Triangulate'); - }); -}); diff --git a/tutorial-4/pixi.js-master/test/unit/pixi/utils/Utils.js b/tutorial-4/pixi.js-master/test/unit/pixi/utils/Utils.js deleted file mode 100755 index c97b3c6..0000000 --- a/tutorial-4/pixi.js-master/test/unit/pixi/utils/Utils.js +++ /dev/null @@ -1,17 +0,0 @@ -describe('Utils', function () { - 'use strict'; - - var expect = chai.expect; - - it('requestAnimationFrame exists', function () { - expect(global).to.respondTo('requestAnimationFrame'); - }); - - it('cancelAnimationFrame exists', function () { - expect(global).to.respondTo('cancelAnimationFrame'); - }); - - it('requestAnimFrame exists', function () { - expect(global).to.respondTo('requestAnimFrame'); - }); -}); diff --git a/tutorial-4/pixi.js-master/trim/SpriteSheet.json b/tutorial-4/pixi.js-master/trim/SpriteSheet.json deleted file mode 100755 index 978c2f2..0000000 --- a/tutorial-4/pixi.js-master/trim/SpriteSheet.json +++ /dev/null @@ -1,228 +0,0 @@ -{"frames": { - -"Explosion_Sequence_A 1.png": -{ - "frame": {"x":244,"y":1454,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 10.png": -{ - "frame": {"x":244,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 11.png": -{ - "frame": {"x":2,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 12.png": -{ - "frame": {"x":728,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 13.png": -{ - "frame": {"x":486,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 14.png": -{ - "frame": {"x":244,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 15.png": -{ - "frame": {"x":2,"y":728,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 16.png": -{ - "frame": {"x":728,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 17.png": -{ - "frame": {"x":486,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 18.png": -{ - "frame": {"x":244,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 19.png": -{ - "frame": {"x":2,"y":486,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 2.png": -{ - "frame": {"x":728,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 20.png": -{ - "frame": {"x":728,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 21.png": -{ - "frame": {"x":486,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 22.png": -{ - "frame": {"x":244,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 23.png": -{ - "frame": {"x":2,"y":244,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 24.png": -{ - "frame": {"x":728,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 25.png": -{ - "frame": {"x":486,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 26.png": -{ - "frame": {"x":244,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 27.png": -{ - "frame": {"x":2,"y":2,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 3.png": -{ - "frame": {"x":486,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 4.png": -{ - "frame": {"x":244,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 5.png": -{ - "frame": {"x":2,"y":1696,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 6.png": -{ - "frame": {"x":2,"y":1454,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 7.png": -{ - "frame": {"x":2,"y":1212,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 8.png": -{ - "frame": {"x":728,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"Explosion_Sequence_A 9.png": -{ - "frame": {"x":486,"y":970,"w":240,"h":240}, - "rotated": false, - "trimmed": false, - "spriteSourceSize": {"x":0,"y":0,"w":240,"h":240}, - "sourceSize": {"w":240,"h":240} -}}, -"meta": { - "app": "http://www.texturepacker.com", - "version": "1.0", - "image": "SpriteSheet.png", - "format": "RGBA8888", - "size": {"w":1024,"h":2048}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:17e4a2d92ff3e27832c3f4938cec7c85$" -} -} diff --git a/tutorial-4/pixi.js-master/trim/SpriteSheet.png b/tutorial-4/pixi.js-master/trim/SpriteSheet.png deleted file mode 100755 index 79e1a69..0000000 Binary files a/tutorial-4/pixi.js-master/trim/SpriteSheet.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/trim/SpriteSheetTrimmed.json b/tutorial-4/pixi.js-master/trim/SpriteSheetTrimmed.json deleted file mode 100755 index 7f9dd6a..0000000 --- a/tutorial-4/pixi.js-master/trim/SpriteSheetTrimmed.json +++ /dev/null @@ -1,228 +0,0 @@ -{"frames": { - -"TExplosion_Sequence_A 1.png": -{ - "frame": {"x":436,"y":1636,"w":204,"h":182}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":32,"y":38,"w":204,"h":182}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 10.png": -{ - "frame": {"x":2,"y":728,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 11.png": -{ - "frame": {"x":226,"y":486,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 12.png": -{ - "frame": {"x":2,"y":2,"w":224,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":16,"y":0,"w":224,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 13.png": -{ - "frame": {"x":2,"y":970,"w":224,"h":234}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":16,"y":0,"w":224,"h":234}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 14.png": -{ - "frame": {"x":2,"y":1206,"w":224,"h":220}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":16,"y":0,"w":224,"h":220}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 15.png": -{ - "frame": {"x":228,"y":1190,"w":216,"h":214}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":216,"h":214}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 16.png": -{ - "frame": {"x":228,"y":970,"w":216,"h":218}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":216,"h":218}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 17.png": -{ - "frame": {"x":2,"y":1428,"w":222,"h":220}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":220}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 18.png": -{ - "frame": {"x":440,"y":1416,"w":210,"h":218}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":210,"h":218}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 19.png": -{ - "frame": {"x":228,"y":1406,"w":210,"h":220}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":19,"y":0,"w":210,"h":220}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 2.png": -{ - "frame": {"x":2,"y":1650,"w":218,"h":198}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":22,"w":218,"h":198}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 20.png": -{ - "frame": {"x":226,"y":1628,"w":208,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":208,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 21.png": -{ - "frame": {"x":446,"y":1214,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 22.png": -{ - "frame": {"x":446,"y":1012,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 23.png": -{ - "frame": {"x":448,"y":810,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 24.png": -{ - "frame": {"x":450,"y":608,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 25.png": -{ - "frame": {"x":450,"y":406,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 26.png": -{ - "frame": {"x":452,"y":204,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 27.png": -{ - "frame": {"x":452,"y":2,"w":200,"h":200}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":20,"y":20,"w":200,"h":200}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 3.png": -{ - "frame": {"x":442,"y":1820,"w":208,"h":196}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":19,"y":22,"w":208,"h":196}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 4.png": -{ - "frame": {"x":222,"y":1830,"w":218,"h":196}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":22,"w":218,"h":196}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 5.png": -{ - "frame": {"x":226,"y":728,"w":220,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":19,"y":0,"w":220,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 6.png": -{ - "frame": {"x":2,"y":486,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 7.png": -{ - "frame": {"x":226,"y":244,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 8.png": -{ - "frame": {"x":2,"y":244,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}, -"TExplosion_Sequence_A 9.png": -{ - "frame": {"x":228,"y":2,"w":222,"h":240}, - "rotated": false, - "trimmed": true, - "spriteSourceSize": {"x":18,"y":0,"w":222,"h":240}, - "sourceSize": {"w":240,"h":240} -}}, -"meta": { - "app": "http://www.codeandweb.com/texturepacker ", - "version": "1.0", - "image": "SpriteSheetTrimmed.png", - "format": "RGBA8888", - "size": {"w":654,"h":2028}, - "scale": "1", - "smartupdate": "$TexturePacker:SmartUpdate:6ba345a190bfe2d62301a49ce8112726:aaa6f60c39d4c316b8ed9667f27805ca:b0c0aa18e0b197cfe7bc02a7377aa72f$" -} -} diff --git a/tutorial-4/pixi.js-master/trim/SpriteSheetTrimmed.png b/tutorial-4/pixi.js-master/trim/SpriteSheetTrimmed.png deleted file mode 100755 index 9214f71..0000000 Binary files a/tutorial-4/pixi.js-master/trim/SpriteSheetTrimmed.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/trim/bikkuriman.png b/tutorial-4/pixi.js-master/trim/bikkuriman.png deleted file mode 100755 index 3bc5592..0000000 Binary files a/tutorial-4/pixi.js-master/trim/bikkuriman.png and /dev/null differ diff --git a/tutorial-4/pixi.js-master/trim/index.html b/tutorial-4/pixi.js-master/trim/index.html deleted file mode 100755 index d051dfa..0000000 --- a/tutorial-4/pixi.js-master/trim/index.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - Pixi Trim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Test 1

    -

    Test 2

    -

    Test 3

    - - - diff --git a/tutorial-4/pixi.js-master/trim/index2.html b/tutorial-4/pixi.js-master/trim/index2.html deleted file mode 100755 index 4276c57..0000000 --- a/tutorial-4/pixi.js-master/trim/index2.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - Pixi Trim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Test 1

    -

    Test 2

    -

    Test 3

    - - - diff --git a/tutorial-4/pixi.js-master/trim/index3.html b/tutorial-4/pixi.js-master/trim/index3.html deleted file mode 100755 index 1a506b3..0000000 --- a/tutorial-4/pixi.js-master/trim/index3.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - Pixi Trim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Test 1

    -

    Test 2

    -

    Test 3

    - - -